Simplify condition, since both time and time_last are unsigned.
[mplayer/glamo.git] / configure
blob20f057495bb61d48ee88b6c8c934e7483cecc493
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: check the cvs log !
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak libvo/config.mak libao2/config.mak Gui/config.mak
21 # and libaf/config.mak are included from the Makefiles.
23 # If you want to add a new check for $feature, here is a simple skeleton:
25 # echocheck "$feature"
26 # if "$_feature" = auto; then
27 # cat > $TMPC << EOF
28 # #include <feature.h>
29 # int main(void) { return 0; }
30 # EOF
31 # _feature=no
32 # cc_check && _feature=yes
33 # if test "$_feature" = yes ; then
34 # _def_feature='#define HAVE_FEATURE 1'
35 # else
36 # _def_feature='#undef HAVE_FEATURE'
37 # fi
38 # echores "$_feature"
40 # Furthermore you need to add the variable _feature to the list of default
41 # settings and set it to one of yes/no/auto. Also add appropriate
42 # --enable-feature/--disable-feature command line options.
43 # The results of the check should be written to config.h and config.mak
44 # at the end of this script. The variable names used for this should be
45 # uniform, i.e. if the option is named 'feature':
47 # _feature : should have a value of yes/no/auto
48 # _def_feature : '#define ... 1' or '#undef ...' for conditional compilation
49 # _ld_feature : '-L/path/dir -lfeature' GCC options
50 # _inc_feature : '-I/path/dir/include' extra include paths
52 #############################################################################
54 # Prevent locale nonsense from breaking basic text processing utils
55 LC_ALL=C
56 export LC_ALL
58 # Prefer these macros to full length text !
59 # These macros only return an error code - NO display is done
60 compile_check() {
61 echo >> "$TMPLOG"
62 cat "$1" >> "$TMPLOG"
63 echo >> "$TMPLOG"
64 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o $TMPO $@" >> "$TMPLOG"
65 rm -f "$TMPO"
66 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o "$TMPO" "$@" >> "$TMPLOG" 2>&1
67 TMP="$?"
68 echo >> "$TMPLOG"
69 echo "ldd $TMPO" >> "$TMPLOG"
70 $_ldd "$TMPO" >> "$TMPLOG" 2>&1
71 echo >> "$TMPLOG"
72 return "$TMP"
75 cc_check() {
76 compile_check $TMPC $@
79 cxx_check() {
80 compile_check $TMPCPP $@ -lstdc++
83 tmp_run() {
84 "$TMPO" >> "$TMPLOG" 2>&1
87 # Display error message, flushes tempfile, exit
88 die () {
89 echo
90 echo "Error: $@" >&2
91 echo >&2
92 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
93 echo "Check \"$TMPLOG\" if you do not understand why it failed."
94 exit 1
97 # OS test booleans functions
98 issystem() {
99 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
101 linux() { issystem "Linux" ; return "$?" ; }
102 sunos() { issystem "SunOS" ; return "$?" ; }
103 hpux() { issystem "HP-UX" ; return "$?" ; }
104 irix() { issystem "IRIX" ; return "$?" ; }
105 aix() { issystem "AIX" ; return "$?" ; }
106 cygwin() { issystem "CYGWIN" ; return "$?" ; }
107 freebsd() { issystem "FreeBSD" ; return "$?" ; }
108 netbsd() { issystem "NetBSD" ; return "$?" ; }
109 bsdos() { issystem "BSD/OS" ; return "$?" ; }
110 openbsd() { issystem "OpenBSD" ; return "$?" ; }
111 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
112 qnx() { issystem "QNX" ; return "$?" ; }
113 darwin() { issystem "Darwin" ; return "$?" ; }
114 gnu() { issystem "GNU" ; return "$?" ; }
115 mingw32() { issystem "MINGW32" ; return "$?" ; }
116 morphos() { issystem "MorphOS" ; return "$?" ; }
117 win32() { cygwin || mingw32 ; return "$?" ; }
118 beos() { issystem "BEOS" ; return "$?" ; }
120 # arch test boolean functions
121 # x86/x86pc is used by QNX
122 x86() {
123 case "$host_arch" in
124 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
125 *) return 1 ;;
126 esac
129 x86_64() {
130 case "$host_arch" in
131 x86_64|amd64) return 0 ;;
132 *) return 1 ;;
133 esac
136 ppc() {
137 case "$host_arch" in
138 ppc) return 0;;
139 *) return 1;;
140 esac
143 alpha() {
144 case "$host_arch" in
145 alpha) return 0;;
146 *) return 1;;
147 esac
150 # not boolean test: implement the posix shell "!" operator for a
151 # non-posix /bin/sh.
152 # usage: not {command}
153 # returns exit status "success" when the execution of "command"
154 # fails.
155 not() {
156 eval "$@"
157 test $? -ne 0
160 # Use this before starting a check
161 echocheck() {
162 echo "============ Checking for $@ ============" >> "$TMPLOG"
163 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
166 # Use this to echo the results of a check
167 echores() {
168 if test "$_res_comment" ; then
169 _res_comment="($_res_comment)"
171 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
172 echo "##########################################" >> "$TMPLOG"
173 echo "" >> "$TMPLOG"
174 echo "$@ $_res_comment"
175 _res_comment=""
177 #############################################################################
179 # Check how echo works in this /bin/sh
180 case `echo -n` in
181 -n) _echo_n= _echo_c='\c' ;; # SysV echo
182 *) _echo_n='-n ' _echo_c= ;; # BSD echo
183 esac
185 LANGUAGES=`echo help/help_mp-??.h help/help_mp-??_??.h | sed "s:help/help_mp-\(..\).h:\1:g" | sed "s:help/help_mp-\(.....\).h:\1:g"`
187 for parm in "$@" ; do
188 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
189 cat << EOF
191 Usage: $0 [OPTIONS]...
193 Configuration:
194 -h, --help display this help and exit
196 Installation directories:
197 --prefix=DIR use this prefix for installing mplayer [/usr/local]
198 --bindir=DIR use this prefix for installing mplayer binary
199 [PREFIX/bin]
200 --datadir=DIR use this prefix for installing machine independent
201 data files (fonts, skins) [PREFIX/share/mplayer]
202 --mandir=DIR use this prefix for installing manpages [PREFIX/man]
203 --confdir=DIR use this prefix for installing configuration files
204 [PREFIX/etc/mplayer]
205 --libdir=DIR use this prefix for object code libraries [PREFIX/lib]
207 Optional features:
208 --disable-mencoder disable mencoder (a/v encoder) compilation [enable]
209 --enable-gui enable gmplayer compilation (GTK+ GUI) [disable]
210 --enable-old-gtk force using GTK 1.2 for GUI [disable]
211 --enable-largefiles enable support for files > 2 GBytes [disable]
212 --enable-linux-devfs set default devices to devfs ones [disable]
213 --enable-termcap use termcap database for key codes [autodetect]
214 --enable-termios use termios database for key codes [autodetect]
215 --disable-iconv do not use iconv(3) function [autodetect]
216 --disable-setlocale disable setlocale using in mplayer [autodetect]
217 --disable-langinfo do not use langinfo [autodetect]
218 --enable-lirc enable LIRC (remote control) support [autodetect]
219 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
220 --enable-joystick enable joystick support [disable]
221 --disable-vm disable support X video mode extensions [autodetect]
222 --disable-xf86keysym disable support for 'multimedia' keys [autodetect]
223 --disable-tv disable TV Interface (tv/dvb grabbers) [enable]
224 --disable-tv-v4l disable Video4Linux TV Interface support [autodetect]
225 --disable-tv-v4l2 disable Video4Linux2 TV Interface support [autodetect]
226 --disable-tv-bsdbt848 disable BSD BT848 Interface support [autodetect]
227 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
228 --disable-network disable network support (for: http/mms/rtp) [enable]
229 --enable-winsock2 enable winsock2 usage [autodetect]
230 --enable-smb enable Samba (SMB) input support [autodetect]
231 --enable-live enable LIVE555 Streaming Media support [autodetect]
232 --disable-dvdread Disable libdvdread support [autodetect]
233 --disable-mpdvdkit Disable mpdvdkit2 support [autodetect]
234 --disable-cdparanoia Disable cdparanoia support [autodetect]
235 --disable-freetype Disable freetype2 font rendering support [autodetect]
236 --disable-fontconfig Disable fontconfig font lookup support [autodetect]
237 --disable-unrarlib Disable Unique RAR File Library [enabled]
238 --enable-menu Enable OSD menu support (NOT DVD MENU) [disabled]
239 --disable-sortsub Disable subtitles sorting [enabled]
240 --enable-fribidi Enable using the FriBiDi libs [autodetect]
241 --disable-enca Disable using ENCA charset oracle library [autodetect]
242 --disable-macosx Disable Mac OS X specific features [autodetect]
243 --enable-macosx-finder-support Enable Mac OS X Finder invocation parameter parsing [disabled]
244 --enable-macosx-bundle Enable Mac OS X bundle file locations [autodetect]
245 --disable-inet6 Disable IPv6 support [autodetect]
246 --disable-gethostbyname2 gethostbyname() function is not provided by the C
247 library [autodetect]
248 --disable-ftp Disable ftp support [enabled]
249 --disable-vstream Disable tivo vstream client support [autodetect]
250 --disable-pthreads Disable Posix threads support [autodetect]
252 Codecs:
253 --enable-gif enable gif support [autodetect]
254 --enable-png enable png input/output support [autodetect]
255 --enable-jpeg enable jpeg input/output support [autodetect]
256 --enable-libcdio enable external libcdio support [autodetect]
257 --enable-liblzo enable external liblzo support [autodetect]
258 --disable-win32 disable Win32 DLL support [autodetect]
259 --disable-dshow disable Win32/DirectShow support [autodetect]
260 --disable-qtx disable Quicktime codecs [autodetect]
261 --disable-xanim disable XAnim DLL support [autodetect]
262 --disable-real disable RealPlayer DLL support [autodetect]
263 --disable-xvid disable XviD codec [autodetect]
264 --disable-x264 disable H.264 encoder [autodetect]
265 --disable-divx4linux disable DivX4linux/Divx5linux codec [autodetect]
266 --enable-opendivx enable _old_ OpenDivx codec [disable]
267 --disable-libavutil disable libavutil [autodetect]
268 --disable-libavcodec disable libavcodec [autodetect]
269 --disable-libavformat disable libavformat [autodetect]
270 --disable-libpostproc disable libpostproc [autodetect]
271 --disable-libavutil_so disable shared libavutil [autodetect]
272 --disable-libavcodec_so disable shared libavcodec [autodetect]
273 --disable-libavformat_so disable shared libavformat [autodetect]
274 --disable-libpostproc_so disable shared libpostproc [autodetect]
275 --enable-libfame enable libfame realtime encoder [autodetect]
276 --disable-internal-tremor do not build internal OggVorbis support [enabled]
277 --enable-tremor-low build with lower accuracy internal tremor [disabled]
278 --enable-external-tremor build with external tremor [disabled]
279 --disable-vorbis disable OggVorbis support entirely [autodetect]
280 --disable-speex disable Speex support [autodetect]
281 --enable-theora build with OggTheora support [autodetect]
282 --enable-external-faad build with external FAAD2 (AAC) support [autodetect]
283 --disable-internal-faad disable internal FAAD2 (AAC) support [autodetect]
284 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
285 --disable-ladspa disable LADSPA plugin support [autodetect]
286 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
287 --disable-mad disable libmad (MPEG audio) support [autodetect]
288 --disable-toolame disable Toolame (MPEG layer 2 audio) support in mencoder [autodetect]
289 --disable-twolame disable Twolame (MPEG layer 2 audio) support in mencoder [autodetect]
290 --enable-xmms build with XMMS inputplugin support [disabled]
291 --disable-mp3lib disable builtin mp3lib [enabled]
292 --disable-liba52 disable builtin liba52 [enabled]
293 --enable-libdts enable libdts support [autodetect]
294 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
295 --disable-musepack disable musepack support [autodetect]
296 --disable-amr_nb disable amr narrowband, floating point [autodetect]
297 --disable-amr_nb-fixed disable amr narrowband, fixed point [autodetect]
298 --disable-amr_wb disable amr wideband, floating point [autodetect]
299 --disable-codec=CODEC disable specified codec
300 --enable-codec=CODEC dnable specified codec
302 Video output:
303 --disable-internal-vidix disable internal VIDIX [for x86 *nix]
304 --disable-external-vidix disable external VIDIX [for x86 *nix]
305 --enable-gl build with OpenGL render support [autodetect]
306 --enable-dga[=n] build with DGA [n in {1, 2} ] support [autodetect]
307 --enable-vesa build with VESA support [autodetect]
308 --enable-svga build with SVGAlib support [autodetect]
309 --enable-sdl build with SDL render support [autodetect]
310 --enable-aa build with AAlib render support [autodetect]
311 --enable-caca build with CACA render support [autodetect]
312 --enable-ggi build with GGI render support [autodetect]
313 --enable-ggiwmh build with GGI libggiwmh extension [autodetect]
314 --enable-directx build with DirectX support [autodetect]
315 --enable-dxr2 build with DXR2 render support [autodetect]
316 --enable-dxr3 build with DXR3/H+ render support [autodetect]
317 --enable-dvb build with support for output via DVB-Card [autodetect]
318 --enable-dvbhead build with DVB support (HEAD version) [autodetect]
319 --enable-mga build with mga_vid (for Matrox G200/G4x0/G550) support
320 (check for /dev/mga_vid) [autodetect]
321 --enable-xmga build with mga_vid X Window support
322 (check for X & /dev/mga_vid) [autodetect]
323 --enable-xv build with Xv render support for X 4.x [autodetect]
324 --enable-xvmc build with XvMC acceleration for X 4.x [disable]
325 --enable-vm build with XF86VidMode support for X11 [autodetect]
326 --enable-xinerama build with Xinerama support for X11 [autodetect]
327 --enable-x11 build with X11 render support [autodetect]
328 --enable-fbdev build with FBDev render support [autodetect]
329 --enable-mlib build with mediaLib support (Solaris only) [disable]
330 --enable-3dfx build with obsolete /dev/3dfx support [disable]
331 --enable-tdfxfb build with tdfxfb (Voodoo 3/banshee) support [disable]
332 --enable-directfb build with DirectFB support [autodetect]
333 --enable-zr build with ZR360[56]7/ZR36060 support [autodetect]
334 --enable-bl build with Blinkenlights support [disable]
335 --enable-tdfxvid build with tdfx_vid support [disable]
336 --disable-tga disable targa output support [enable]
337 --disable-pnm disable pnm output support [enable]
338 --disable-md5sum disable md5sum output support [enable]
340 Audio output:
341 --disable-alsa disable ALSA sound support [autodetect]
342 --disable-ossaudio disable OSS sound support [autodetect]
343 --disable-arts disable aRts sound support [autodetect]
344 --disable-esd disable esd sound support [autodetect]
345 --disable-polyp disable Polypaudio sound support [autodetect]
346 --disable-jack disable JACK sound support [autodetect]
347 --disable-openal disable OpenAL sound support [autodetect]
348 --disable-nas disable NAS sound support [autodetect]
349 --disable-sgiaudio disable SGI sound support [autodetect]
350 --disable-sunaudio disable Sun sound support [autodetect]
351 --disable-win32waveout disable Windows waveout sound support [autodetect]
352 --disable-select disable using select() on audio device [enable]
354 Miscellaneous options:
355 --enable-runtime-cpudetection Enable runtime CPU detection [disable]
356 --enable-cross-compile Enable cross-compilation [autodetect]
357 --cc=COMPILER use this C compiler to build MPlayer [gcc]
358 --host-cc=COMPILER use this C compiler to build apps needed for the build process [gcc]
359 --as=ASSEMBLER use this assembler to build MPlayer [as]
360 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
361 --enable-static build a statically linked binary. Set further linking
362 options with --enable-static="-lslang -lncurses"
363 --charset convert the help messages to this charset
364 --language=list a white space or comma separated list of languages
365 for translated man pages, the first language is the
366 primary and therefore used for translated messages
367 and GUI (also the environment variable \$LINGUAS is
368 honored) [en]
369 (Available: $LANGUAGES all)
370 --with-install=PATH use a custom install program (useful if your OS uses
371 a GNU-incompatible install utility by default and
372 you want to use GNU version)
373 --install-path=PATH the path to a custom install program
374 this option is obsolete and will be removed soon,
375 use --with-install instead.
377 Advanced options:
378 --enable-mmx build with MMX support [autodetect]
379 --enable-mmxext build with MMX2 support (PIII, Athlon) [autodetect]
380 --enable-3dnow build with 3DNow! support [autodetect]
381 --enable-3dnowext build with extended 3DNow! support [autodetect]
382 --enable-sse build with SSE support [autodetect]
383 --enable-sse2 build with SSE2 support [autodetect]
384 --enable-shm build with shm support [autodetect]
385 --enable-altivec build with Altivec support (PowerPC) [autodetect]
386 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy() [enable]
387 --enable-big-endian Force byte order to big-endian [autodetect]
388 --enable-debug[=1-3] compile debugging information into mplayer [disable]
389 --enable-profile compile profiling information into mplayer [disable]
390 --disable-sighandler disable sighandler for crashes [enable]
391 --enable-crash-debug enable automatic gdb attach on crash [disable]
392 --enable-dynamic-plugins Enable support for dynamic a/v plugins [disable]
394 Hazardous options a.k.a. "DO NOT REPORT ANY BUGS!"
395 --disable-gcc-checking disable gcc version checking [enable]
397 Use these options if autodetection fails (Options marked with (*) accept
398 multiple paths separated by ':'):
399 --with-extraincdir=DIR extra headers (png, mad, sdl, ...) in DIR (*)
400 --with-extralibdir=DIR extra library files (png, mad, sdl, ...) in DIR (*)
401 --with-x11incdir=DIR X headers in DIR (*)
402 --with-x11libdir=DIR X library files in DIR (*)
403 --with-dxr2incdir=DIR DXR2 headers in DIR (*)
404 --with-dvbincdir=DIR DVB headers in DIR (*)
405 --with-madlibdir=DIR libmad (libmad shared library) in DIR (*)
406 --with-mlibdir=DIR libmlib (mediaLib support) in DIR (Solaris only)
407 --with-codecsdir=DIR Binary codec files in DIR
408 --with-win32libdir=DIR W*ndows DLL files in DIR
409 --with-xanimlibdir=DIR XAnim DLL files in DIR
410 --with-reallibdir=DIR RealPlayer DLL files in DIR
411 --with-xvidlibdir=DIR libxvidcore (XviD) in DIR (*)
412 --with-xvidincdir=DIR XviD header in DIR (*)
413 --with-x264libdir=DIR libx264 in DIR
414 --with-x264incdir=DIR x264 header in DIR
415 --with-dtslibdir=DIR libdts library in DIR (*)
416 --with-dtsincdir=DIR libdts header in DIR (*)
417 --with-livelibdir=DIR LIVE555 Streaming Media libraries in DIR
418 --with-toolamedir=DIR path to Toolame library and include file
419 --with-xmmsplugindir=DIR XMMS plugins in DIR
420 --with-xmmslibdir=DIR libxmms.so.1 in DIR
421 --with-cdparanoiaincdir=DIR cdparanoia headers in DIR (*)
422 --with-cdparanoialibdir=DIR cdparanoia libraries (libcdda_*) in DIR (*)
423 --with-xvmclib=NAME name of adapter-specific library (e.g. XvMCNVIDIA)
424 --with-termcaplib=NAME name of library with termcap functionality
425 name should be given without leading "lib"
426 checks for "termcap" and "tinfo"
428 --with-freetype-config=PATH path to freetype-config
429 (e.g. /opt/bin/freetype-config)
430 --with-fribidi-config=PATH path to fribidi-config
431 (e.g. /opt/bin/fribidi-config)
432 --with-glib-config=PATH path to glib*-config (e.g. /opt/bin/glib-config)
433 --with-gtk-config=PATH path to gtk*-config (e.g. /opt/bin/gtk-config)
434 --with-sdl-config=PATH path to sdl*-config (e.g. /opt/bin/sdl-config)
436 This configure script is NOT autoconf-based, even though its output is similar.
437 It will try to autodetect all configuration options. If you --enable an option
438 it will be forcefully turned on, skipping autodetection. This can break
439 compilation, so you need to know what you are doing.
441 exit 0
443 done # for parm in ...
446 # 1st pass checking for vital options
447 _mmx=auto
448 _3dnow=auto
449 _3dnowext=auto
450 _mmxext=auto
451 _sse=auto
452 _sse2=auto
453 _mtrr=auto
454 _install=install
455 _ranlib=ranlib
456 _cc=cc
457 test "$CC" && _cc="$CC"
458 _as=auto
459 _runtime_cpudetection=no
460 _cross_compile=auto
461 for ac_option do
462 case "$ac_option" in
463 --target=*)
464 _target=`echo $ac_option | cut -d '=' -f 2`
466 --cc=*)
467 _cc=`echo $ac_option | cut -d '=' -f 2`
469 --host-cc=*)
470 _host_cc=`echo $ac_option | cut -d '=' -f 2`
472 --as=*)
473 _as=`echo $ac_option | cut -d '=' -f 2`
475 --enable-gcc-checking)
476 _skip_cc_check=no
478 --disable-gcc-checking)
479 _skip_cc_check=yes
481 --enable-static)
482 _ld_static='-static'
484 --disable-static)
485 _ld_static=''
487 --enable-static=*)
488 _ld_static="-static `echo $ac_option | cut -d '=' -f 2`"
490 --with-extraincdir=*)
491 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
493 --with-extralibdir=*)
494 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
496 --enable-runtime-cpudetection)
497 _runtime_cpudetection=yes
499 --disable-runtime-cpudetection)
500 _runtime_cpudetection=no
502 --enable-cross-compile)
503 _cross_compile=yes
505 --disable-cross-compile)
506 _cross_compile=no
508 --install-path=*)
509 _install=`echo $ac_option | cut -d '=' -f 2 | sed 's/\/$//'`"/install"
511 --with-install=*)
512 _install=`echo $ac_option | cut -d '=' -f 2 `
514 --enable-profile)
515 _profile='-p'
517 --disable-profile)
518 _profile=
520 --enable-debug)
521 _debug='-g'
523 --enable-debug=*)
524 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
526 --disable-debug)
527 _debug=
529 esac
530 done
532 # Determine our OS name and CPU architecture
533 if test -z "$_target" ; then
534 # OS name
535 system_name=`uname -s 2>&1`
536 case "$system_name" in
537 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX)
539 IRIX*)
540 system_name=IRIX
542 HP-UX*)
543 system_name=HP-UX
545 [cC][yY][gG][wW][iI][nN]*)
546 system_name=CYGWIN
548 MINGW32*)
549 system_name=MINGW32
552 system_name="$system_name-UNKNOWN"
554 esac
557 # host's CPU/instruction set
558 host_arch=`uname -p 2>&1`
559 case "$host_arch" in
560 i386|sparc|ppc|alpha|arm|mips|vax)
562 powerpc) # Darwin returns 'powerpc'
563 host_arch=ppc
565 *) # uname -p on Linux returns 'unknown' for the processor type,
566 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
568 # Maybe uname -m (machine hardware name) returns something we
569 # recognize.
571 # x86/x86pc is used by QNX
572 case "`uname -m 2>&1`" in
573 i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
574 ia64) host_arch=ia64 ;;
575 x86_64|amd64)
576 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
577 -z "`echo $CFLAGS | grep -- -m32`" ]; then
578 host_arch=x86_64
579 else
580 host_arch=i386
583 macppc|ppc|ppc64) host_arch=ppc ;;
584 alpha) host_arch=alpha ;;
585 sparc) host_arch=sparc ;;
586 sparc64) host_arch=sparc64 ;;
587 parisc*|hppa*|9000*) host_arch=hppa ;;
588 arm*|zaurus|cats) host_arch=arm ;;
589 s390) host_arch=s390 ;;
590 s390x) host_arch=s390x ;;
591 mips*) host_arch=mips ;;
592 vax) host_arch=vax ;;
593 *) host_arch=UNKNOWN ;;
594 esac
596 esac
597 else # if test -z "$_target"
598 system_name=`echo $_target | cut -d '-' -f 2`
599 case "`echo $system_name | tr A-Z a-z`" in
600 linux) system_name=Linux ;;
601 freebsd) system_name=FreeBSD ;;
602 netbsd) system_name=NetBSD ;;
603 bsd/os) system_name=BSD/OS ;;
604 openbsd) system_name=OpenBSD ;;
605 sunos) system_name=SunOS ;;
606 qnx) system_name=QNX ;;
607 morphos) system_name=MorphOS ;;
608 mingw32msvc) system_name=MINGW32 ;;
609 esac
610 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
611 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
614 echo "Detected operating system: $system_name"
615 echo "Detected host architecture: $host_arch"
617 # LGB: temporary files
618 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
619 test "$I" && break
620 done
622 TMPLOG="configure.log"
623 rm -f "$TMPLOG"
624 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
625 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
626 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
627 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
629 # config files
631 # FIXME: A lot of stuff is installed under /usr/local
632 # NK: But we should never use this stuff implicitly since we call compiler
633 # from /usr we should be sure that there no effects from other compilers
634 # (libraries) which might be installed into /usr/local. Let users use this
635 # stuff explicitly as command line argument. In other words: It would be
636 # resonable to have only /usr/include or only /usr/local/include.
638 if freebsd ; then
639 _ld_extra="$_ld_extra -L/usr/local/lib"
640 _inc_extra="$_inc_extra -I/usr/local/include"
643 if netbsd ; then
644 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
645 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
646 done
647 _ld_extra=$tmp
650 _ldd=ldd
651 if darwin; then
652 _ldd="otool -L"
655 if aix ; then
656 _ld_libC="-lC"
657 else
658 _ld_libC=""
661 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
662 # if used as 'head -1' instead of 'head -n 1', but older versions don't
663 # know about '-n'.
664 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
665 _head() { head -$1 2>/dev/null ; }
666 else
667 _head() { head -n $1 2>/dev/null ; }
669 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
670 _tail() { tail -$1 2>/dev/null ; }
671 else
672 _tail() { tail -n $1 2>/dev/null ; }
675 # Checking CC version...
676 if test "$_skip_cc_check" != yes ; then
677 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
678 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
679 echocheck "$_cc version"
680 cc_vendor=intel
681 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
682 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
683 _cc_major=`echo $cc_version | cut -d '.' -f 1`
684 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
685 # TODO verify older icc/ecc compatibility
686 case $cc_version in
688 cc_version="v. ?.??, bad"
689 cc_verc_fail=yes
691 8.0)
692 cc_version="$cc_version, ok"
693 cc_verc_fail=no
696 cc_version="$cc_version, bad"
697 cc_verc_fail=yes
699 esac
700 echores "$cc_version"
701 else
702 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
703 echocheck "$_cc version"
704 cc_vendor=gnu
705 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
706 cc_version=`$_cc -dumpversion 2>&1`
707 if test "$?" -gt 0; then
708 cc_version="not found"
710 case $cc_version in
712 cc_version="v. ?.??, bad"
713 cc_verc_fail=yes
715 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
716 _cc_major=`echo $cc_version | cut -d '.' -f 1`
717 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
718 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
719 cc_version="$cc_version, ok"
720 cc_verc_fail=no
722 'not found')
723 cc_verc_fail=yes
726 cc_version="$cc_version, bad"
727 cc_verc_fail=yes
729 esac
730 echores "$cc_version"
731 test "$cc_verc_fail" = "no" && break
732 done
733 fi # icc
734 if test "$cc_verc_fail" = yes ; then
735 cat <<EOF
737 *** Please downgrade/upgrade C compiler to version gcc-2.95.x or gcc-3.x! ***
739 You are not using a supported compiler. We do not have the time to make sure
740 everything works with compilers other than the ones we use. Use either the
741 same compiler as we do, or use --disable-gcc-checking but DO *NOT* REPORT BUGS
742 unless you can reproduce them after recompiling with a 2.95.x or 3.x version!
744 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
745 mplayer and lame (which is used for mencoder). If you get compile errors,
746 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
747 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
748 bugs!
750 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
752 *** For details please read DOCS/HTML/en/users-vs-dev.html ***
755 die "Bad gcc version"
757 else
758 cat <<EOF
760 ******************************************************************************
762 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
763 Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???
765 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
766 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
767 Lame which is used by mencoder produces weird errors, too.
769 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
770 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
772 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
774 ******************************************************************************
778 read _answer
781 echocheck "host cc"
782 test "$_host_cc" || _host_cc=$_cc
783 echores $_host_cc
785 echocheck "cross compilation"
786 if test $_cross_compile = auto ; then
787 cat > $TMPC << EOF
788 int main() { return 0; }
790 _cross_compile=yes
791 cc_check && "$TMPO" && _cross_compile=no
793 echores $_cross_compile
795 if test $_cross_compile = yes; then
796 tmp_run() {
797 return 0
801 # ---
803 # now that we know what compiler should be used for compilation, try to find
804 # out which assembler is used by the $_cc compiler
805 if test "$_as" = auto ; then
806 _as=`$_cc -print-prog-name=as`
807 test -z "$_as" && _as=as
810 # XXX: this should be ok..
811 _cpuinfo="echo"
812 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
813 # FIXME: Remove the cygwin check once AMD CPUs are supported
814 if test -r /proc/cpuinfo && not cygwin; then
815 # Linux with /proc mounted, extract CPU information from it
816 _cpuinfo="cat /proc/cpuinfo"
817 elif test -r /compat/linux/proc/cpuinfo && not x86 ; then
818 # FreeBSD with Linux emulation /proc mounted,
819 # extract CPU information from it
820 _cpuinfo="cat /compat/linux/proc/cpuinfo"
821 elif darwin && not x86 ; then
822 # use hostinfo on Darwin
823 _cpuinfo="hostinfo"
824 elif aix; then
825 # use 'lsattr' on AIX
826 _cpuinfo="lsattr -E -l proc0 -a type"
827 elif x86; then
828 # all other OSes try to extract CPU information from a small helper
829 # program TOOLS/cpuinfo instead
830 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
831 _cpuinfo="TOOLS/cpuinfo"
834 if x86 || x86_64 ; then
835 # gather more CPU information
836 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
837 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
838 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
839 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
840 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
842 exts=`$_cpuinfo | grep 'features\|flags' | cut -d ':' -f 2 | _head 1`
844 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ \
845 -e s/xmm/sse/ -e s/kni/sse/`
847 for ext in $pparam ; do
848 eval _$ext=auto && eval _$ext=yes
849 done
851 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
852 test $_sse = yes && _mmxext=yes
854 echocheck "CPU vendor"
855 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
857 echocheck "CPU type"
858 echores "$pname"
861 case "$host_arch" in
862 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
863 _def_arch="#define ARCH_X86 1"
864 _target_arch="TARGET_ARCH_X86 = yes"
867 case "$pvendor" in
868 AuthenticAMD)
869 case "$pfamily" in
870 3) proc=i386 iproc=386 ;;
871 4) proc=i486 iproc=486 ;;
872 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
873 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
874 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
875 proc=k6-3
876 elif test "$pmodel" -ge 8; then
877 proc=k6-2
878 elif test "$pmodel" -ge 6; then
879 proc=k6
880 else
881 proc=i586
884 6) iproc=686
885 # It's a bit difficult to determine the correct type of Family 6
886 # AMD CPUs just from their signature. Instead, we check directly
887 # whether it supports SSE.
888 if test "$_sse" = yes; then
889 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
890 proc=athlon-xp
891 else
892 # Again, gcc treats athlon and athlon-tbird similarly.
893 proc=athlon
896 15) iproc=686
897 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
898 # caught and remedied in the optimization tests below.
899 proc=k8
902 *) proc=k8 iproc=686 ;;
903 esac
905 GenuineIntel)
906 case "$pfamily" in
907 3) proc=i386 iproc=386 ;;
908 4) proc=i486 iproc=486 ;;
909 5) iproc=586
910 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
911 proc=pentium-mmx # 4 is desktop, 8 is mobile
912 else
913 proc=i586
916 6) iproc=686
917 if test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
918 proc=pentium-m
919 elif test "$pmodel" -ge 7; then
920 proc=pentium3
921 elif test "$pmodel" -ge 3; then
922 proc=pentium2
923 else
924 proc=i686
927 15) iproc=686
928 # A nocona in 32-bit mode has no more capabilities than a prescott.
929 if test "$pmodel" -ge 3; then
930 proc=prescott
931 else
932 proc=pentium4
935 *) proc=prescott iproc=686 ;;
936 esac
938 CentaurHauls)
939 case "$pfamily" in
940 5) iproc=586
941 if test "$pmodel" -ge 8; then
942 proc=winchip2
943 elif test "$pmodel" -ge 4; then
944 proc=winchip-c6
945 else
946 proc=i586
949 6) iproc=686
950 if test "$pmodel" -ge 9; then
951 proc=c3-2
952 else
953 proc=c3
954 iproc=586
957 *) proc=i686 iproc=i686 ;;
958 esac
960 unknown)
961 case "$pfamily" in
962 3) proc=i386 iproc=386 ;;
963 4) proc=i486 iproc=486 ;;
964 *) proc=i586 iproc=586 ;;
965 esac
968 proc=i586 iproc=586 ;;
969 esac
971 # check that gcc supports our CPU, if not, fall back to earlier ones
972 # LGB: check -mcpu and -march swithing step by step with enabling
973 # to fall back till 386.
975 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
977 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
978 cpuopt=-mtune
979 else
980 cpuopt=-mcpu
983 echocheck "GCC & CPU optimization abilities"
984 cat > $TMPC << EOF
985 int main(void) { return 0; }
987 if test "$_runtime_cpudetection" = no ; then
988 if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
989 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
991 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" || test "$proc" = "athlon-tbird"; then
992 cc_check -march=$proc $cpuopt=$proc || proc=athlon
994 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
995 cc_check -march=$proc $cpuopt=$proc || proc=k6
997 if test "$proc" = "k6" || test "$proc" = "c3"; then
998 if not cc_check -march=$proc $cpuopt=$proc; then
999 if cc_check -march=i586 $cpuopt=i686; then
1000 proc=i586-i686
1001 else
1002 proc=i586
1006 if test "$proc" = "pentium4" || test "$proc" = "pentium-m" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon" || test "$proc" = "c3-2"; then
1007 cc_check -march=$proc $cpuopt=$proc || proc=i686
1009 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1010 cc_check -march=$proc $cpuopt=$proc || proc=i586
1012 if test "$proc" = "i586"; then
1013 cc_check -march=$proc $cpuopt=$proc || proc=i486
1015 if test "$proc" = "i486" ; then
1016 cc_check -march=$proc $cpuopt=$proc || proc=i386
1018 if test "$proc" = "i386" ; then
1019 cc_check -march=$proc $cpuopt=$proc || proc=error
1021 if test "$proc" = "error" ; then
1022 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1023 _mcpu=""
1024 _march=""
1025 _optimizing=""
1026 elif test "$proc" = "i586-i686"; then
1027 _march="-march=i586"
1028 _mcpu="$cpuopt=i686"
1029 _optimizing="$proc"
1030 else
1031 _march="-march=$proc"
1032 _mcpu="$cpuopt=$proc"
1033 _optimizing="$proc"
1035 else # if test "$_runtime_cpudetection" = no
1036 # i686 is probably the most common CPU - optimize for it
1037 _mcpu="$cpuopt=i686"
1038 # at least i486 required, for bswap instruction
1039 _march="-march=i486"
1040 cc_check $_mcpu || _mcpu=""
1041 cc_check $_march $_mcpu || _march=""
1044 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1045 ## autodetected mcpu/march parameters
1046 if test "$_target" ; then
1047 # TODO: it may be a good idea to check GCC and fall back in all cases
1048 if test "$host_arch" = "i586-i686"; then
1049 _march="-march=i586"
1050 _mcpu="$cpuopt=i686"
1051 else
1052 _march="-march=$host_arch"
1053 _mcpu="$cpuopt=$host_arch"
1056 proc="$host_arch"
1058 case "$proc" in
1059 i386) iproc=386 ;;
1060 i486) iproc=486 ;;
1061 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1062 i686|athlon*|pentium*) iproc=686 ;;
1063 *) iproc=586 ;;
1064 esac
1067 echores "$proc"
1070 ia64)
1071 _def_arch='#define ARCH_IA64 1'
1072 _target_arch='TARGET_ARCH_IA64 = yes'
1073 iproc='ia64'
1074 proc=''
1075 _march=''
1076 _mcpu=''
1077 _optimizing=''
1080 x86_64|amd64)
1081 _def_arch='#define ARCH_X86_64 1'
1082 _target_arch='TARGET_ARCH_X86_64 = yes'
1083 iproc='x86_64'
1085 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1086 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1087 cpuopt=-mtune
1088 else
1089 cpuopt=-mcpu
1091 case "$pvendor" in
1092 AuthenticAMD)
1093 proc=k8;;
1094 GenuineIntel)
1095 # 64-bit prescotts exist, but as far as GCC is concerned they have the
1096 # same capabilities as a nocona.
1097 proc=nocona;;
1099 proc=error;;
1100 esac
1102 echocheck "GCC & CPU optimization abilities"
1103 cat > $TMPC << EOF
1104 int main(void) { return 0; }
1106 # This is a stripped-down version of the i386 fallback.
1107 if test "$_runtime_cpudetection" = no ; then
1108 # --- AMD processors ---
1109 if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
1110 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1112 # This will fail if gcc version < 3.3, which is ok because earlier
1113 # versions don't really support 64-bit on amd64.
1114 # Is this a valid assumption? -Corey
1115 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" ; then
1116 cc_check -march=$proc $cpuopt=$proc || proc=error
1118 # --- Intel processors ---
1119 if test "$proc" = "nocona" || test "$proc" = "prescott" ; then
1120 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1122 if test "$proc" = "pentium4" || test "$proc" = "pentium4m" ; then
1123 cc_check -march=$proc $cpuopt=$proc || proc=error
1126 _march="-march=$proc"
1127 _mcpu="$cpuopt=$proc"
1128 if test "$proc" = "error" ; then
1129 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1130 _mcpu=""
1131 _march=""
1133 else
1134 _march=""
1135 _mcpu=""
1138 _optimizing=""
1140 echores "$proc"
1143 sparc)
1144 _def_arch='#define ARCH_SPARC 1'
1145 _target_arch='TARGET_ARCH_SPARC = yes'
1146 iproc='sparc'
1147 if sunos ; then
1148 echocheck "CPU type"
1149 karch=`uname -m`
1150 case "`echo $karch`" in
1151 sun4) proc=v7 ;;
1152 sun4c) proc=v7 ;;
1153 sun4d) proc=v8 ;;
1154 sun4m) proc=v8 ;;
1155 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1156 *) ;;
1157 esac
1158 echores "$proc"
1159 else
1160 proc=v8
1162 _march=''
1163 _mcpu="-mcpu=$proc"
1164 _optimizing="$proc"
1167 sparc64)
1168 _def_arch='#define ARCH_SPARC 1'
1169 _target_arch='TARGET_ARCH_SPARC = yes'
1170 _vis='yes'
1171 _def_vis='#define HAVE_VIS = yes'
1172 iproc='sparc'
1173 proc='v9'
1174 _march=''
1175 _mcpu="-mcpu=$proc"
1176 _optimizing="$proc"
1179 arm|armv4l|armv5tel)
1180 _def_arch='#define ARCH_ARMV4L 1'
1181 _target_arch='TARGET_ARCH_ARMV4L = yes'
1182 iproc='arm'
1183 proc=''
1184 _march=''
1185 _mcpu=''
1186 _optimizing=''
1189 ppc)
1190 _def_arch='#define ARCH_POWERPC 1'
1191 _def_dcbzl='#define NO_DCBZL 1'
1192 _target_arch='TARGET_ARCH_POWERPC = yes'
1193 iproc='ppc'
1194 proc=''
1195 _march=''
1196 _mcpu=''
1197 _optimizing=''
1198 _altivec=no
1200 echocheck "CPU type"
1201 case $system_name in
1202 Linux)
1203 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1204 if test -n "`$_cpuinfo | grep altivec`"; then
1205 _altivec=yes
1208 Darwin)
1209 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1210 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
1211 "`sysctl -n hw.optional.altivec 2>/dev/null`" -eq 1 ]; then
1212 _altivec=yes
1215 NetBSD)
1216 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1217 case $cc_version in
1218 2*|3.0*|3.1*|3.2*|3.3*)
1221 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1222 _altivec=yes
1225 esac
1227 AIX)
1228 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
1230 esac
1231 if test "$_altivec" = yes; then
1232 echores "$proc altivec"
1233 else
1234 echores "$proc"
1237 echocheck "GCC & CPU optimization abilities"
1239 if test -n "$proc"; then
1240 case "$proc" in
1241 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1242 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1243 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1244 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1245 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1246 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1247 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
1248 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
1249 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
1250 *) ;;
1251 esac
1252 # gcc 3.1(.1) and up supports 7400 and 7450
1253 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1254 case "$proc" in
1255 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1256 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1257 *) ;;
1258 esac
1260 # gcc 3.2 and up supports 970
1261 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1262 case "$proc" in
1263 970*) _march='-mcpu=970' _mcpu='-mtune=970'
1264 _def_dcbzl='#undef NO_DCBZL' ;;
1265 *) ;;
1266 esac
1268 # gcc 3.3 and up supports POWER4
1269 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1270 case "$proc" in
1271 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
1272 *) ;;
1273 esac
1275 # gcc 4.0 and up supports POWER5
1276 if test "$_cc_major" -ge "4"; then
1277 case "$proc" in
1278 POWER5) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
1279 *) ;;
1280 esac
1284 if test -n "$_mcpu"; then
1285 _optimizing=`echo $_mcpu | cut -c 8-`
1286 echores "$_optimizing"
1287 else
1288 echores "none"
1293 alpha)
1294 _def_arch='#define ARCH_ALPHA 1'
1295 _target_arch='TARGET_ARCH_ALPHA = yes'
1296 iproc='alpha'
1297 _march=''
1299 echocheck "CPU type"
1300 cat > $TMPC << EOF
1301 int main() {
1302 unsigned long ver, mask;
1303 asm ("implver %0" : "=r" (ver));
1304 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1305 printf("%ld-%x\n", ver, ~mask);
1306 return 0;
1309 $_cc -o "$TMPO" "$TMPC"
1310 case `"$TMPO"` in
1312 0-0) proc="ev4"; cpu_understands_mvi="0";;
1313 1-0) proc="ev5"; cpu_understands_mvi="0";;
1314 1-1) proc="ev56"; cpu_understands_mvi="0";;
1315 1-101) proc="pca56"; cpu_understands_mvi="1";;
1316 2-303) proc="ev6"; cpu_understands_mvi="1";;
1317 2-307) proc="ev67"; cpu_understands_mvi="1";;
1318 2-1307) proc="ev68"; cpu_understands_mvi="1";;
1319 esac
1320 echores "$proc"
1322 echocheck "GCC & CPU optimization abilities"
1323 if test "$proc" = "ev68" ; then
1324 cc_check -mcpu=$proc || proc=ev67
1326 if test "$proc" = "ev67" ; then
1327 cc_check -mcpu=$proc || proc=ev6
1329 _mcpu="-mcpu=$proc"
1330 echores "$proc"
1332 _optimizing="$proc"
1334 echocheck "MVI instruction support in GCC"
1335 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
1336 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
1337 echores "yes"
1338 else
1339 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
1340 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
1344 mips)
1345 _def_arch='#define ARCH_SGI_MIPS 1'
1346 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
1347 iproc='sgi-mips'
1348 proc=''
1349 _march=''
1350 _mcpu=''
1351 _optimizing=''
1353 if irix ; then
1354 echocheck "CPU type"
1355 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
1356 case "`echo $proc`" in
1357 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
1358 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
1359 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
1360 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
1361 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
1362 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
1363 esac
1364 echores "$proc"
1369 hppa)
1370 _def_arch='#define ARCH_PA_RISC 1'
1371 _target_arch='TARGET_ARCH_PA_RISC = yes'
1372 iproc='PA-RISC'
1373 proc=''
1374 _march=''
1375 _mcpu=''
1376 _optimizing=''
1379 s390)
1380 _def_arch='#define ARCH_S390 1'
1381 _target_arch='TARGET_ARCH_S390 = yes'
1382 iproc='390'
1383 proc=''
1384 _march=''
1385 _mcpu=''
1386 _optimizing=''
1389 s390x)
1390 _def_arch='#define ARCH_S390X 1'
1391 _target_arch='TARGET_ARCH_S390X = yes'
1392 iproc='390x'
1393 proc=''
1394 _march=''
1395 _mcpu=''
1396 _optimizing=''
1399 vax)
1400 _def_arch='#define ARCH_VAX 1'
1401 _target_arch='TARGET_ARCH_VAX = yes'
1402 iproc='vax'
1403 proc=''
1404 _march=''
1405 _mcpu=''
1406 _optimizing=''
1410 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1411 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1412 die "unsupported architecture $host_arch"
1414 esac # case "$host_arch" in
1416 if test "$_runtime_cpudetection" = yes ; then
1417 if x86; then
1418 _mmx=yes
1419 _3dnow=yes
1420 _3dnowext=yes
1421 _mmxext=yes
1422 _sse=yes
1423 _sse2=yes
1424 _mtrr=yes
1426 if ppc; then
1427 _altivec=yes
1431 if x86 && test "$_runtime_cpudetection" = no ; then
1432 extcheck() {
1433 if test "$1" = yes ; then
1434 echocheck "kernel support of $2"
1435 cat > $TMPC <<EOF
1436 #include <signal.h>
1437 void catch() { exit(1); }
1438 int main(void){
1439 signal(SIGILL, catch);
1440 __asm__ __volatile__ ("$3":::"memory");return(0);
1444 if cc_check && tmp_run ; then
1445 echores "yes"
1446 _optimizing="$_optimizing $2"
1447 return 0
1448 else
1449 echores "failed"
1450 echo "It seems that your kernel does not correctly support $2."
1451 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1452 return 1
1455 return 0
1458 extcheck $_mmx "mmx" "emms" || _mmx=no
1459 extcheck $_mmxext "mmxext" "sfence" || _mmxext=no
1460 extcheck $_3dnow "3dnow" "femms" || _3dnow=no
1461 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0" || _3dnowext=no
1462 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no _gcc3_ext="$_gcc3_ext -mno-sse"
1463 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no _gcc3_ext="$_gcc3_ext -mno-sse2"
1464 echocheck "mtrr support"
1465 echores "$_mtrr"
1467 if test "$_mtrr" = yes ; then
1468 _optimizing="$_optimizing mtrr"
1471 if test "$_gcc3_ext" != ""; then
1472 # if we had to disable sse/sse2 because the active kernel does not
1473 # support this instruction set extension, we also have to tell
1474 # gcc3 to not generate sse/sse2 instructions for normal C code
1475 cat > $TMPC << EOF
1476 int main(void) { return 0; }
1478 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1483 echocheck "assembler support of -pipe option"
1484 cat > $TMPC << EOF
1485 int main(void) { return 0; }
1487 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
1489 # Checking for CFLAGS
1490 _stripbinaries=yes
1491 if test "$_profile" != "" || test "$_debug" != "" ; then
1492 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
1493 if test "$_cc_major" -ge "3" ; then
1494 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
1496 _stripbinaries=no
1497 elif test -z "$CFLAGS" ; then
1498 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
1499 else
1500 _warn_CFLAGS=yes
1502 if test -n "$LDFLAGS" ; then
1503 _ld_extra="$_ld_extra $LDFLAGS"
1504 _warn_CFLAGS=yes
1506 if test -n "$CPPFLAGS" ; then
1507 _inc_extra="$_inc_extra $LDFLAGS"
1508 _warn_CFLAGS=yes
1511 _prefix="/usr/local"
1513 # GOTCHA: the variables below defines the default behavior for autodetection
1514 # and have - unless stated otherwise - at least 2 states : yes no
1515 # If autodetection is available then the third state is: auto
1516 _libavutil=auto
1517 _libavutil_so=auto
1518 _libavcodec=auto
1519 _amr_nb=auto
1520 _amr_nb_fixed=auto
1521 _amr_wb=auto
1522 _libavcodecs=`grep 'register_avcodec(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1523 _libavcodec_so=auto
1524 _libavformat=auto
1525 _libavformat_so=auto
1526 _libpostproc=auto
1527 _libpostproc_so=auto
1528 _fame=auto
1529 _mp1e=no
1530 _mencoder=yes
1531 _x11=auto
1532 _dga=auto # 1 2 no auto
1533 _xv=auto
1534 _xvmc=no #auto when complete
1535 _sdl=auto
1536 _directx=auto
1537 _win32waveout=auto
1538 _nas=auto
1539 _png=auto
1540 _jpg=auto
1541 _pnm=yes
1542 _md5sum=yes
1543 _gif=auto
1544 _gl=auto
1545 _ggi=auto
1546 _ggiwmh=auto
1547 _aa=auto
1548 _caca=auto
1549 _svga=auto
1550 _vesa=auto
1551 _fbdev=auto
1552 _dvb=auto
1553 _dvbhead=auto
1554 _dxr2=auto
1555 _dxr3=auto
1556 _iconv=auto
1557 _langinfo=auto
1558 _rtc=auto
1559 _ossaudio=auto
1560 _arts=auto
1561 _esd=auto
1562 _polyp=auto
1563 _jack=auto
1564 _openal=auto
1565 _libcdio=auto
1566 _liblzo=auto
1567 _mad=auto
1568 _toolame=auto
1569 _twolame=auto
1570 _tremor_internal=yes
1571 _tremor_low=no
1572 _vorbis=auto
1573 _speex=auto
1574 _theora=auto
1575 _mp3lib=yes
1576 _liba52=yes
1577 _libdts=auto
1578 _libmpeg2=yes
1579 _tremor=no
1580 _faad_internal=auto
1581 _faad_external=auto
1582 _faac=auto
1583 _ladspa=auto
1584 _xmms=no
1585 _have_dvd=no
1586 # dvdnav disabled, it does not work
1587 #_dvdnav=no
1588 _dvdread=auto
1589 _dvdkit=auto
1590 _xanim=auto
1591 _real=auto
1592 _live=auto
1593 _xinerama=auto
1594 _mga=auto
1595 _xmga=auto
1596 _vm=auto
1597 _xf86keysym=auto
1598 _mlib=no #broken, thus disabled
1599 _sgiaudio=auto
1600 _sunaudio=auto
1601 _alsa=auto
1602 _fastmemcpy=yes
1603 _unrarlib=yes
1604 _win32=auto
1605 _dshow=yes
1606 _select=yes
1607 _tv=yes
1608 _tv_v4l=auto
1609 _tv_v4l2=auto
1610 _tv_bsdbt848=auto
1611 _network=yes
1612 _winsock2=auto
1613 _smbsupport=auto
1614 _vidix_internal=auto
1615 _vidix_external=auto
1616 _joystick=no
1617 _xvid=auto
1618 _x264=auto
1619 _divx4linux=auto
1620 _opendivx=no
1621 _lirc=auto
1622 _lircc=auto
1623 _gui=no
1624 _gtk1=no
1625 _termcap=auto
1626 _termios=auto
1627 _3dfx=no
1628 _tdfxfb=no
1629 _tdfxvid=no
1630 _tga=yes
1631 _directfb=auto
1632 _zr=auto
1633 _bl=no
1634 _largefiles=no
1635 #_language=en
1636 _shm=auto
1637 _linux_devfs=no
1638 #_charset=utf8
1639 _dynamic_plugins=no
1640 _crash_debug=no
1641 _sighandler=yes
1642 _libdv=auto
1643 _cdparanoia=auto
1644 _big_endian=auto
1645 _freetype=auto
1646 _fontconfig=auto
1647 _menu=no
1648 _qtx=auto
1649 _macosx=auto
1650 _macosx_finder_support=no
1651 _macosx_bundle=auto
1652 _sortsub=yes
1653 _freetypeconfig='freetype-config'
1654 _fribidi=auto
1655 _fribidiconfig='fribidi-config'
1656 _enca=auto
1657 _inet6=auto
1658 _gethostbyname2=auto
1659 _ftp=yes
1660 _musepack=auto
1661 _vstream=auto
1662 _pthreads=yes
1663 for ac_option do
1664 case "$ac_option" in
1665 # Skip 1st pass
1666 --target=*) ;;
1667 --cc=*) ;;
1668 --host-cc=*) ;;
1669 --as=*) ;;
1670 --enable-gcc-checking) ;;
1671 --disable-gcc-checking) ;;
1672 --enable-static*) ;;
1673 --disable-static*) ;;
1674 --with-extraincdir=*) ;;
1675 --with-extralibdir=*) ;;
1676 --enable-runtime-cpudetection) ;;
1677 --disable-runtime-cpudetection) ;;
1678 --enable-cross-compile) ;;
1679 --disable-cross-compile) ;;
1680 --install-path=*) ;;
1681 --with-install=*) ;;
1682 --enable-profile) ;;
1683 --disable-profile) ;;
1684 --enable-debug) ;;
1685 --enable-debug=*) ;;
1686 --disable-debug) ;;
1688 # Real 2nd pass
1689 --enable-mencoder) _mencoder=yes ;;
1690 --disable-mencoder) _mencoder=no ;;
1691 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
1692 --disable-dynamic-plugins) _dynamic_plugins=no ;;
1693 --enable-x11) _x11=yes ;;
1694 --disable-x11) _x11=no ;;
1695 --enable-xv) _xv=yes ;;
1696 --disable-xv) _xv=no ;;
1697 --enable-xvmc) _xvmc=yes ;;
1698 --disable-xvmc) _xvmc=no ;;
1699 --enable-sdl) _sdl=yes ;;
1700 --disable-sdl) _sdl=no ;;
1701 --enable-directx) _directx=yes ;;
1702 --disable-directx) _directx=no ;;
1703 --enable-win32waveout) _win32waveout=yes ;;
1704 --disable-win32waveout) _win32waveout=no ;;
1705 --enable-nas) _nas=yes ;;
1706 --disable-nas) _nas=no ;;
1707 --enable-png) _png=yes ;;
1708 --disable-png) _png=no ;;
1709 --enable-jpeg) _jpg=yes ;;
1710 --disable-jpeg) _jpg=no ;;
1711 --enable-pnm) _pnm=yes ;;
1712 --disable-pnm) _pnm=no ;;
1713 --enable-md5sum) _md5sum=yes ;;
1714 --disable-md5sum) _md5sum=no ;;
1715 --enable-gif) _gif=yes ;;
1716 --disable-gif) _gif=no ;;
1717 --enable-gl) _gl=yes ;;
1718 --disable-gl) _gl=no ;;
1719 --enable-ggi) _ggi=yes ;;
1720 --disable-ggi) _ggi=no ;;
1721 --enable-ggiwmh) _ggiwmh=yes ;;
1722 --disable-ggiwmh) _ggiwmh=no ;;
1723 --enable-aa) _aa=yes ;;
1724 --disable-aa) _aa=no ;;
1725 --enable-caca) _caca=yes ;;
1726 --disable-caca) _caca=no ;;
1727 --enable-svga) _svga=yes ;;
1728 --disable-svga) _svga=no ;;
1729 --enable-vesa) _vesa=yes ;;
1730 --disable-vesa) _vesa=no ;;
1731 --enable-fbdev) _fbdev=yes ;;
1732 --disable-fbdev) _fbdev=no ;;
1733 --enable-dvb) _dvb=yes ;;
1734 --disable-dvb) _dvb=no ;;
1735 --enable-dvbhead) _dvbhead=yes ;;
1736 --disable-dvbhead) _dvbhead=no ;;
1737 --enable-dxr2) _dxr2=yes ;;
1738 --disable-dxr2) _dxr2=no ;;
1739 --enable-dxr3) _dxr3=yes ;;
1740 --disable-dxr3) _dxr3=no ;;
1741 --enable-iconv) _iconv=yes ;;
1742 --disable-iconv) _iconv=no ;;
1743 --enable-langinfo) _langinfo=yes ;;
1744 --disable-langinfo) _langinfo=no ;;
1745 --enable-rtc) _rtc=yes ;;
1746 --disable-rtc) _rtc=no ;;
1747 --enable-mp1e) _mp1e=yes ;;
1748 --disable-mp1e) _mp1e=no ;;
1749 --enable-libdv) _libdv=yes ;;
1750 --disable-libdv) _libdv=no ;;
1751 --enable-ossaudio) _ossaudio=yes ;;
1752 --disable-ossaudio) _ossaudio=no ;;
1753 --enable-arts) _arts=yes ;;
1754 --disable-arts) _arts=no ;;
1755 --enable-esd) _esd=yes ;;
1756 --disable-esd) _esd=no ;;
1757 --enable-polyp) _polyp=yes ;;
1758 --disable-polyp) _polyp=no ;;
1759 --enable-jack) _jack=yes ;;
1760 --disable-jack) _jack=no ;;
1761 --enable-openal) _openal=yes ;;
1762 --disable-openal) _openal=no ;;
1763 --enable-mad) _mad=yes ;;
1764 --disable-mad) _mad=no ;;
1765 --enable-toolame) _toolame=yes ;;
1766 --disable-toolame) _toolame=no ;;
1767 --enable-twolame) _twolame=yes ;;
1768 --disable-twolame) _twolame=no ;;
1769 --enable-libcdio) _libcdio=yes ;;
1770 --disable-libcdio) _libcdio=no ;;
1771 --enable-liblzo) _liblzo=yes ;;
1772 --disable-liblzo) _liblzo=no ;;
1773 --enable-vorbis) _vorbis=yes ;;
1774 --disable-vorbis) _vorbis=no ;;
1775 --enable-speex) _speex=yes ;;
1776 --disable-speex) _speex=no ;;
1777 --enable-internal-tremor) _tremor_internal=yes ;;
1778 --disable-internal-tremor) _tremor_internal=no ;;
1779 --enable-tremor-low) _tremor_low=yes ;;
1780 --disable-tremor-low) _tremor_low=no ;;
1781 --enable-external-tremor) _tremor=yes ;;
1782 --disable-external-tremor) _tremor=no ;;
1783 --enable-theora) _theora=yes ;;
1784 --disable-theora) _theora=no ;;
1785 --enable-mp3lib) _mp3lib=yes ;;
1786 --disable-mp3lib) _mp3lib=no ;;
1787 --enable-liba52) _liba52=yes ;;
1788 --disable-liba52) _liba52=no ;;
1789 --enable-libdts) _libdts=yes ;;
1790 --disable-libdts) _libdts=no ;;
1791 --enable-libmpeg2) _libmpeg2=yes ;;
1792 --disable-libmpeg2) _libmpeg2=no ;;
1793 --enable-musepack) _musepack=yes ;;
1794 --disable-musepack) _musepack=no ;;
1795 --enable-internal-faad) _faad_internal=yes _faad_external=no ;;
1796 --disable-internal-faad) _faad_internal=no ;;
1797 --enable-external-faad) _faad_external=yes _faad_internal=no ;;
1798 --disable-external-faad) _faad_external=no ;;
1799 --enable-faac) _faac=yes ;;
1800 --disable-faac) _faac=no ;;
1801 --enable-ladspa) _ladspa=yes ;;
1802 --disable-ladspa) _ladspa=no ;;
1803 --enable-xmms) _xmms=yes ;;
1804 --disable-xmms) _xmms=no ;;
1805 --enable-dvdread) _dvdread=yes ;;
1806 --disable-dvdread) _dvdread=no ;;
1807 --enable-mpdvdkit) _dvdkit=yes ;;
1808 --disable-mpdvdkit) _dvdkit=no ;;
1809 # dvdnav disabled, it does not work
1810 # --enable-dvdnav) _dvdnav=yes ;;
1811 # --disable-dvdnav) _dvdnav=no ;;
1812 --enable-xanim) _xanim=yes ;;
1813 --disable-xanim) _xanim=no ;;
1814 --enable-real) _real=yes ;;
1815 --disable-real) _real=no ;;
1816 --enable-live) _live=yes ;;
1817 --disable-live) _live=no ;;
1818 --enable-xinerama) _xinerama=yes ;;
1819 --disable-xinerama) _xinerama=no ;;
1820 --enable-mga) _mga=yes ;;
1821 --disable-mga) _mga=no ;;
1822 --enable-xmga) _xmga=yes ;;
1823 --disable-xmga) _xmga=no ;;
1824 --enable-vm) _vm=yes ;;
1825 --disable-vm) _vm=no ;;
1826 --enable-xf86keysym) _xf86keysym=yes ;;
1827 --disable-xf86keysym) _xf86keysym=no ;;
1828 --enable-mlib) _mlib=yes ;;
1829 --disable-mlib) _mlib=no ;;
1830 --enable-sunaudio) _sunaudio=yes ;;
1831 --disable-sunaudio) _sunaudio=no ;;
1832 --enable-sgiaudio) _sgiaudio=yes ;;
1833 --disable-sgiaudio) _sgiaudio=no ;;
1834 --enable-alsa) _alsa=yes ;;
1835 --disable-alsa) _alsa=no ;;
1836 --enable-tv) _tv=yes ;;
1837 --disable-tv) _tv=no ;;
1838 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1839 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1840 --enable-tv-v4l) _tv_v4l=yes ;;
1841 --disable-tv-v4l) _tv_v4l=no ;;
1842 --enable-tv-v4l2) _tv_v4l2=yes ;;
1843 --disable-tv-v4l2) _tv_v4l2=no ;;
1844 --enable-fastmemcpy) _fastmemcpy=yes ;;
1845 --disable-fastmemcpy) _fastmemcpy=no ;;
1846 --enable-network) _network=yes ;;
1847 --disable-network) _network=no ;;
1848 --enable-winsock2) _winsock2=yes ;;
1849 --disable-winsock2) _winsock2=no ;;
1850 --enable-smb) _smbsupport=yes ;;
1851 --disable-smb) _smbsupport=no ;;
1852 --enable-internal-vidix) _vidix_internal=yes ;;
1853 --disable-internal-vidix) _vidix_internal=no ;;
1854 --enable-external-vidix) _vidix_external=yes ;;
1855 --disable-external-vidix) _vidix_external=no ;;
1856 --enable-joystick) _joystick=yes ;;
1857 --disable-joystick) _joystick=no ;;
1858 --enable-xvid) _xvid=yes ;;
1859 --disable-xvid) _xvid=no ;;
1860 --enable-x264) _x264=yes ;;
1861 --disable-x264) _x264=no ;;
1862 --enable-divx4linux) _divx4linux=yes ;;
1863 --disable-divx4linux) _divx4linux=no ;;
1864 --enable-opendivx) _opendivx=yes ;;
1865 --disable-opendivx) _opendivx=no ;;
1866 --enable-libavutil) _libavutil=yes ;;
1867 --disable-libavutil) _libavutil=no ;;
1868 --enable-libavutil_so) _libavutil_so=yes ;;
1869 --disable-libavutil_so) _libavutil_so=no ;;
1870 --enable-libavcodec) _libavcodec=yes ;;
1871 --disable-libavcodec) _libavcodec=no ;;
1872 --enable-libavcodec_so) _libavcodec_so=yes ;;
1873 --disable-libavcodec_so) _libavcodec_so=no ;;
1874 --enable-amr_nb) _amr_nb=yes ;;
1875 --disable-amr_nb) _amr_nb=no ;;
1876 --enable-amr_nb-fixed) _amr_nb_fixed=yes ;;
1877 --disable-amr_nb-fixed) _amr_nb_fixed=no ;;
1878 --enable-amr_wb) _amr_wb=yes ;;
1879 --disable-amr_wb) _amr_wb=no ;;
1880 --enable-codec=*) _libavcodecs="$_libavcodecs `echo $ac_option | cut -d '=' -f 2`" ;;
1881 --disable-codec=*) _libavcodecs=`echo $_libavcodecs | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1882 --enable-libavformat) _libavformat=yes;;
1883 --disable-libavformat) _libavformat=no ;;
1884 --enable-libavformat_so) _libavformat_so=yes ;;
1885 --disable-libavformat_so) _libavformat_so=no ;;
1886 --enable-libpostproc) _libpostproc=yes ;;
1887 --disable-libpostproc) _libpostproc=no ;;
1888 --enable-libpostproc_so) _libpostproc_so=yes ;;
1889 --disable-libpostproc_so) _libpostproc_so=no ;;
1890 --enable-libfame) _fame=yes ;;
1891 --disable-libfame) _fame=no ;;
1892 --enable-lirc) _lirc=yes ;;
1893 --disable-lirc) _lirc=no ;;
1894 --enable-lircc) _lircc=yes ;;
1895 --disable-lircc) _lircc=no ;;
1896 --enable-gui) _gui=yes ;;
1897 --disable-gui) _gui=no ;;
1898 --enable-old-gtk) _gtk1=yes ;;
1899 --enable-termcap) _termcap=yes ;;
1900 --disable-termcap) _termcap=no ;;
1901 --enable-termios) _termios=yes ;;
1902 --disable-termios) _termios=no ;;
1903 --enable-3dfx) _3dfx=yes ;;
1904 --disable-3dfx) _3dfx=no ;;
1905 --enable-tdfxfb) _tdfxfb=yes ;;
1906 --disable-tdfxvid) _tdfxvid=no ;;
1907 --enable-tdfxvid) _tdfxvid=yes ;;
1908 --disable-tga) _tga=no ;;
1909 --enable-tga) _tga=yes ;;
1910 --disable-tdfxfb) _tdfxfb=no ;;
1911 --enable-directfb) _directfb=yes ;;
1912 --disable-directfb) _directfb=no ;;
1913 --enable-zr) _zr=yes ;;
1914 --disable-zr) _zr=no ;;
1915 --enable-bl) _bl=yes ;;
1916 --disable-bl) _bl=no ;;
1917 --enable-mtrr) _mtrr=yes ;;
1918 --disable-mtrr) _mtrr=no ;;
1919 --enable-largefiles) _largefiles=yes ;;
1920 --disable-largefiles) _largefiles=no ;;
1921 --enable-shm) _shm=yes ;;
1922 --disable-shm) _shm=no ;;
1923 --enable-select) _select=yes ;;
1924 --disable-select) _select=no ;;
1925 --enable-linux-devfs) _linux_devfs=yes ;;
1926 --disable-linux-devfs) _linux_devfs=no ;;
1927 --enable-cdparanoia) _cdparanoia=yes ;;
1928 --disable-cdparanoia) _cdparanoia=no ;;
1929 --enable-big-endian) _big_endian=yes ;;
1930 --disable-big-endian) _big_endian=no ;;
1931 --enable-freetype) _freetype=yes ;;
1932 --disable-freetype) _freetype=no ;;
1933 --enable-fontconfig) _fontconfig=yes ;;
1934 --disable-fontconfig) _fontconfig=no ;;
1935 --enable-unrarlib) _unrarlib=yes ;;
1936 --disable-unrarlib) _unrarlib=no ;;
1937 --enable-ftp) _ftp=yes ;;
1938 --disable-ftp) _ftp=no ;;
1939 --enable-vstream) _vstream=yes ;;
1940 --disable-vstream) _vstream=no ;;
1941 --enable-pthreads) _pthreads=yes ;;
1942 --disable-pthreads) _pthreads=no ;;
1944 --enable-fribidi) _fribidi=yes ;;
1945 --disable-fribidi) _fribidi=no ;;
1947 --enable-enca) _enca=yes ;;
1948 --disable-enca) _enca=no ;;
1950 --enable-inet6) _inet6=yes ;;
1951 --disable-inet6) _inet6=no ;;
1953 --enable-gethostbyname2) _gethostbyname2=yes ;;
1954 --disable-gethostbyname2) _gethostbyname2=no ;;
1956 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1957 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1958 --disable-dga) _dga=no ;;
1960 --enable-menu) _menu=yes ;;
1961 --disable-menu) _menu=no ;;
1963 --enable-qtx) _qtx=yes ;;
1964 --disable-qtx) _qtx=no ;;
1966 --enable-macosx) _macosx=yes ;;
1967 --disable-macosx) _macosx=no ;;
1968 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1969 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1970 --enable-macosx-bundle) _macosx_bundle=yes;;
1971 --disable-macosx-bundle) _macosx_bundle=no;;
1973 --enable-sortsub) _sortsub=yes ;;
1974 --disable-sortsub) _sortsub=no ;;
1976 --charset=*)
1977 _charset=`echo $ac_option | cut -d '=' -f 2`
1979 --language=*)
1980 _language=`echo $ac_option | cut -d '=' -f 2`
1982 # dvdnav disabled, it does not work
1983 # --with-libdvdnav=*)
1984 # _dvdnavdir=`echo $ac_option | cut -d '=' -f 2`
1985 # _dvdnav=yes
1986 # ;;
1988 --with-codecsdir=*)
1989 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1990 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1991 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1993 --with-win32libdir=*)
1994 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1995 _win32=yes
1997 --with-xanimlibdir=*)
1998 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1999 _xanim=yes
2001 --with-reallibdir=*)
2002 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
2003 _real=yes
2005 --with-livelibdir=*)
2006 _livelibdir=`echo $ac_option | cut -d '=' -f 2`
2008 --with-toolamedir=*)
2009 _toolamedir=`echo $ac_option | cut -d '=' -f 2`
2011 --with-mlibdir=*)
2012 _mlibdir=`echo $ac_option | cut -d '=' -f 2`
2013 _mlib=yes
2016 --with-xmmslibdir=*)
2017 _xmmslibdir=`echo $ac_option | cut -d '=' -f 2`
2020 --with-xmmsplugindir=*)
2021 _xmmsplugindir=`echo $ac_option | cut -d '=' -f 2`
2024 --enable-crash-debug)
2025 _crash_debug=yes
2027 --disable-crash-debug)
2028 _crash_debug=no
2030 --enable-sighandler)
2031 _sighandler=yes
2033 --disable-sighandler)
2034 _sighandler=no
2037 --enable-sse) _sse=yes ;;
2038 --disable-sse) _sse=no ;;
2039 --enable-sse2) _sse2=yes ;;
2040 --disable-sse2) _sse2=no ;;
2041 --enable-mmxext) _mmxext=yes ;;
2042 --disable-mmxext) _mmxext=no ;;
2043 --enable-3dnow) _3dnow=yes ;;
2044 --disable-3dnow) _3dnow=no _3dnowext=no ;;
2045 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
2046 --disable-3dnowext) _3dnowext=no ;;
2047 --enable-altivec) _altivec=yes ;;
2048 --disable-altivec) _altivec=no ;;
2049 --enable-mmx) _mmx=yes ;;
2050 --disable-mmx) # 3Dnow! and MMX2 require MMX
2051 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
2053 --enable-win32) _win32=yes ;;
2054 --disable-win32) _win32=no _dshow=no ;;
2055 --enable-dshow) _win32=yes _dshow=yes ;;
2056 --disable-dshow) _dshow=no ;;
2058 --with-x11incdir=*)
2059 _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2061 --with-x11libdir=*)
2062 _x11_paths=`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2064 --with-dxr2incdir=*)
2065 _inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2067 --with-xvmclib=*)
2068 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
2070 --with-dvbincdir=*)
2071 _inc_dvb=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2073 --with-xvidlibdir=*)
2074 _ld_xvid=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2076 --with-xvidincdir=*)
2077 _inc_xvid=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2079 --with-dtslibdir=*)
2080 _ld_libdts=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2082 --with-dtsincdir=*)
2083 _inc_libdts=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2085 --with-x264libdir=*)
2086 _ld_x264=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2088 --with-x264incdir=*)
2089 _inc_x264=-I`echo $ac_option | cut -d '=' -f 2 |sed 's,:, -I,g'`
2091 --with-sdl-config=*)
2092 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
2094 --with-freetype-config=*)
2095 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
2097 --with-fribidi-config=*)
2098 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
2100 --with-gtk-config=*)
2101 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
2103 --with-glib-config=*)
2104 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
2106 # dvdnav disabled, it does not work
2107 # --with-dvdnav-config=*)
2108 # _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
2109 # ;;
2110 --with-madlibdir=*)
2111 _ld_mad=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2113 --with-cdparanoiaincdir=*)
2114 _inc_cdparanoia=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2116 --with-cdparanoialibdir=*)
2117 _ld_cdparanoia=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2119 --with-termcaplib=*)
2120 _ld_termcap=-l`echo $ac_option | cut -d '=' -f 2`
2121 _termcap=yes
2123 --prefix=*)
2124 _prefix=`echo $ac_option | cut -d '=' -f 2`
2126 --bindir=*)
2127 _bindir=`echo $ac_option | cut -d '=' -f 2`
2129 --datadir=*)
2130 _datadir=`echo $ac_option | cut -d '=' -f 2`
2132 --mandir=*)
2133 _mandir=`echo $ac_option | cut -d '=' -f 2`
2135 --confdir=*)
2136 _confdir=`echo $ac_option | cut -d '=' -f 2`
2138 --libdir=*)
2139 _libdir=`echo $ac_option | cut -d '=' -f 2`
2143 echo "Unknown parameter: $ac_option"
2144 exit 1
2147 esac
2148 done
2150 # Atmos: moved this here, to be correct, if --prefix is specified
2151 test -z "$_bindir" && _bindir="$_prefix/bin"
2152 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
2153 test -z "$_mandir" && _mandir="$_prefix/man"
2154 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
2155 test -z "$_libdir" && _libdir="$_prefix/lib"
2156 test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
2158 if x86 ; then
2159 # Checking assembler (_as) compatibility...
2160 # Added workaround for older as that reads from stdin by default - atmos
2161 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2162 echocheck "assembler ($_as $as_version)"
2164 _pref_as_version='2.9.1'
2165 echo 'nop' > $TMPS
2166 if test "$_mmx" = yes ; then
2167 echo 'emms' >> $TMPS
2169 if test "$_3dnow" = yes ; then
2170 _pref_as_version='2.10.1'
2171 echo 'femms' >> $TMPS
2173 if test "$_3dnowext" = yes ; then
2174 _pref_as_version='2.10.1'
2175 echo 'pswapd %mm0, %mm0' >> $TMPS
2177 if test "$_mmxext" = yes ; then
2178 _pref_as_version='2.10.1'
2179 echo 'movntq %mm0, (%eax)' >> $TMPS
2181 if test "$_sse" = yes ; then
2182 _pref_as_version='2.10.1'
2183 echo 'xorps %xmm0, %xmm0' >> $TMPS
2185 #if test "$_sse2" = yes ; then
2186 # _pref_as_version='2.11'
2187 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2189 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2191 if test "$as_verc_fail" != yes ; then
2192 echores "ok"
2193 else
2194 _res_comment="Upgrade binutils to ${_pref_as_version} ..."
2195 echores "failed"
2196 die "obsolete binutils version"
2200 #FIXME: This should happen before the check for CFLAGS..
2201 if ppc ; then
2203 # check if altivec is supported by the compiler, and how to enable it
2205 _altivec_gcc_flags=''
2207 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2208 echocheck "GCC altivec support"
2210 p=''
2211 cat > $TMPC << EOF
2212 int main() {
2213 return 0;
2216 FSF_flags='-maltivec -mabi=altivec'
2217 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2219 # check for Darwin-style flags first, since
2220 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2221 # accepts but ignores FSF-style flags...
2223 if test -z "$p"; then
2224 cc_check $Darwin_flags && p='Darwin'
2226 if test -z "$p"; then
2227 cc_check $FSF_flags && p='FSF'
2230 case $p in
2231 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2232 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2233 *) _altivec=no ;;
2234 esac
2236 if test -z "$p"; then
2237 p=none
2238 else
2239 p="$p-style ($_altivec_gcc_flags)"
2242 echores "$p"
2245 # check if <altivec.h> should be included
2247 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2249 if test "$_altivec" = yes ; then
2250 echocheck "altivec.h"
2251 cat > $TMPC << EOF
2252 #include <altivec.h>
2253 int main(void) { return 0; }
2255 _have_altivec_h=no
2256 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2257 if test "$_have_altivec_h" = yes ; then
2258 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2260 echores "$_have_altivec_h"
2263 # disable runtime cpudetection if
2264 # - we cannot generate altivec code
2265 # - altivec is disabled by the user
2267 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2268 _runtime_cpudetection=no
2271 # show that we are optimizing for altivec (if enabled and supported)
2273 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2274 _optimizing="$_optimizing altivec"
2277 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2279 if test "$_altivec" = yes ; then
2280 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2281 #_mcpu="$_mcpu $_altivec_gcc_flags"
2282 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2285 # setup _def_altivec correctly
2287 if test "$_altivec" = yes ; then
2288 _def_altivec='#define HAVE_ALTIVEC 1'
2289 else
2290 _def_altivec='#undef HAVE_ALTIVEC'
2294 _def_mmx='#undef HAVE_MMX'
2295 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2296 _def_mmxext='#undef HAVE_MMX2'
2297 test "$_mmxext" = yes && _def_mmxext='#define HAVE_MMX2 1'
2298 _def_3dnow='#undef HAVE_3DNOW'
2299 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2300 _def_3dnowext='#undef HAVE_3DNOWEX'
2301 test "$_3dnowext" = yes && _def_3dnowext='#define HAVE_3DNOWEX 1'
2302 _def_sse='#undef HAVE_SSE'
2303 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2304 _def_sse2='#undef HAVE_SSE2'
2305 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2307 # Checking kernel version...
2308 if x86 && linux ; then
2309 _k_verc_problem=no
2310 kernel_version=`uname -r 2>&1`
2311 echocheck "$system_name kernel version"
2312 case "$kernel_version" in
2313 '') kernel_version="?.??"; _k_verc_fail=yes;;
2314 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2315 _k_verc_problem=yes;;
2316 esac
2317 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2318 _k_verc_fail=yes
2320 if test "$_k_verc_fail" ; then
2321 echores "$kernel_version, fail"
2322 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2323 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2324 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2325 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2326 echo "2.2.x you must upgrade it to get SSE support!"
2327 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2328 else
2329 echores "$kernel_version, ok"
2333 if test "$_vidix_internal" = auto ; then
2334 _vidix_internal=no
2335 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2336 x86 && _vidix_internal=yes
2337 x86_64 && _vidix_internal=yes
2338 ppc && linux && _vidix_internal=yes
2339 alpha && linux && _vidix_internal=yes
2340 qnx && _vidix_internal=no
2341 sunos && _vidix_internal=no
2342 beos && _vidix_internal=no
2343 darwin && _vidix_internal=no
2346 echocheck "MPlayer binary name"
2347 if win32 ; then
2348 _prg="mplayer.exe"
2349 _prg_mencoder="mencoder.exe"
2350 else
2351 _prg="mplayer"
2352 _prg_mencoder="mencoder"
2354 echores $_prg
2357 # On QNX we must link to libph - Gabucino
2358 if qnx ; then
2359 _ld_arch="$_ld_arch -lph"
2362 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2363 _awk=
2364 if test "$_vidix_internal" = yes ; then
2365 _awk_verc_fail=yes
2366 echocheck "awk"
2367 for _awk in mawk gawk nawk awk; do
2368 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2369 _awk_verc_fail=no
2370 break
2372 done
2373 test "$_awk_verc_fail" = yes && _awk=no
2374 echores "$_awk"
2375 if test "$_awk_verc_fail" = yes; then
2376 echo "VIDIX needs awk, but no working implementation was found!"
2377 echo "Try the GNU version, which can be downloaded from:"
2378 echo "ftp://ftp.gnu.org/gnu/gawk/"
2379 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2380 die "no awk"
2384 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2385 if irix ; then
2386 _ranlib='ar -r'
2387 elif linux ; then
2388 _ranlib='true'
2391 ######################
2392 # MAIN TESTS GO HERE #
2393 ######################
2396 echocheck "extra headers"
2397 if test "$_inc_extra" ; then
2398 echores "$_inc_extra"
2399 else
2400 echores "none"
2404 echocheck "extra libs"
2405 if test "$_ld_extra" ; then
2406 echores "$_ld_extra"
2407 else
2408 echores "none"
2411 echocheck "-lposix"
2412 cat > $TMPC <<EOF
2413 int main(void) { return 0; }
2415 if cc_check -lposix ; then
2416 _ld_arch="$_ld_arch -lposix"
2417 echores "yes"
2418 else
2419 echores "no"
2422 echocheck "-lm"
2423 cat > $TMPC <<EOF
2424 int main(void) { return 0; }
2426 if cc_check -lm ; then
2427 _ld_lm="-lm"
2428 echores "yes"
2429 else
2430 _ld_lm=""
2431 echores "no"
2435 echocheck "langinfo"
2436 if test "$_langinfo" = auto ; then
2437 cat > $TMPC <<EOF
2438 #include <langinfo.h>
2439 int main(void) { nl_langinfo(CODESET); return 0; }
2441 _langinfo=no
2442 cc_check && _langinfo=yes
2444 if test "$_langinfo" = yes ; then
2445 _def_langinfo='#define USE_LANGINFO 1'
2446 else
2447 _def_langinfo='#undef USE_LANGINFO'
2449 echores "$_langinfo"
2452 echocheck "language"
2453 test -z "$_language" && _language=$LINGUAS
2454 _language=`echo $_language | sed 's/,/ /g'`
2455 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2456 for lang in $_language ; do
2457 test "$lang" = all && lang=en
2458 if test -f "help/help_mp-${lang}.h" ; then
2459 _language=$lang
2460 break
2461 else
2462 echo -n "$lang not found, "
2463 _language=`echo $_language | sed "s/$lang *//"`
2465 done
2466 test -z "$_language" && _language=en
2467 _mp_help="help/help_mp-${_language}.h"
2468 test -f $_mp_help || die "$_mp_help not found"
2469 for lang in $LANGUAGES ; do
2470 if test -f "DOCS/man/$lang/mplayer.1" ; then
2471 MAN_LANG="$MAN_LANG $lang"
2473 done
2474 _doc_lang=$_language
2475 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2476 echores "using $_language (man pages: $MAN_LANG)"
2479 echocheck "enable sighandler"
2480 if test "$_sighandler" = yes ; then
2481 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2482 else
2483 _def_sighandler='#undef ENABLE_SIGHANDLER'
2485 echores "$_sighandler"
2487 echocheck "runtime cpudetection"
2488 if test "$_runtime_cpudetection" = yes ; then
2489 _optimizing="Runtime CPU-Detection enabled"
2490 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2491 else
2492 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2494 echores "$_runtime_cpudetection"
2497 echocheck "restrict keyword"
2498 for restrict_keyword in restrict __restrict __restrict__ ; do
2499 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2500 if cc_check; then
2501 _def_restrict_keyword=$restrict_keyword
2502 break;
2504 done
2505 if [ -n "$_def_restrict_keyword" ]; then
2506 echores "$_def_restrict_keyword"
2507 else
2508 echores "none"
2510 # Avoid infinite recursion loop ("#define restrict restrict")
2511 if [ "$_def_restrict_keyword" != "restrict" ]; then
2512 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2513 else
2514 _def_restrict_keyword=""
2518 echocheck "__builtin_expect"
2519 # GCC branch prediction hint
2520 cat > $TMPC << EOF
2521 int foo (int a) {
2522 a = __builtin_expect (a, 10);
2523 return a == 10 ? 0 : 1;
2525 int main() { return foo(10) && foo(0); }
2527 _builtin_expect=no
2528 cc_check && _builtin_expect=yes
2529 if test "$_builtin_expect" = yes ; then
2530 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2531 else
2532 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2534 echores "$_builtin_expect"
2537 echocheck "kstat"
2538 cat > $TMPC << EOF
2539 #include <kstat.h>
2540 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2542 _kstat=no
2543 cc_check -lkstat && _kstat=yes
2544 if test "$_kstat" = yes ; then
2545 _def_kstat="#define HAVE_LIBKSTAT 1"
2546 _ld_arch="-lkstat $_ld_arch"
2547 else
2548 _def_kstat="#undef HAVE_LIBKSTAT"
2550 echores "$_kstat"
2553 echocheck "posix4"
2554 # required for nanosleep on some systems
2555 cat > $TMPC << EOF
2556 #include <time.h>
2557 int main(void) { (void) nanosleep(0, 0); return 0; }
2559 _posix4=no
2560 cc_check -lposix4 && _posix4=yes
2561 if test "$_posix4" = yes ; then
2562 _ld_arch="-lposix4 $_ld_arch"
2564 echores "$_posix4"
2566 echocheck "lrintf"
2567 cat > $TMPC << EOF
2568 #include <math.h>
2569 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2571 _lrintf=no
2572 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2573 if test "$_lrintf" = yes ; then
2574 _def_lrintf="#define HAVE_LRINTF 1"
2575 else
2576 _def_lrintf="#undef HAVE_LRINTF"
2578 echores "$_lrintf"
2580 echocheck "round"
2581 cat > $TMPC << EOF
2582 #include <math.h>
2583 int main(void) { (void) round(0.0); return 0; }
2585 _round=no
2586 cc_check $_ld_lm && _round=yes
2587 if test "$_round" = yes ; then
2588 _def_round="#define HAVE_ROUND 1"
2589 else
2590 _def_round="#undef HAVE_ROUND"
2592 echores "$_round"
2594 echocheck "nanosleep"
2595 # also check for nanosleep
2596 cat > $TMPC << EOF
2597 #include <time.h>
2598 int main(void) { (void) nanosleep(0, 0); return 0; }
2600 _nanosleep=no
2601 cc_check $_ld_arch && _nanosleep=yes
2602 if test "$_nanosleep" = yes ; then
2603 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2604 else
2605 _def_nanosleep='#undef HAVE_NANOSLEEP'
2607 echores "$_nanosleep"
2610 echocheck "socklib"
2611 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2612 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2613 cat > $TMPC << EOF
2614 #include <netdb.h>
2615 #include <sys/socket.h>
2616 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2618 for _ld_tmp in "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2619 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && break
2620 done
2621 if test $_winsock2 = auto && not cygwin ; then
2622 _winsock2=no
2623 cat > $TMPC << EOF
2624 #include <winsock2.h>
2625 int main(void) { (void) gethostbyname(0); return 0; }
2627 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2629 if test "$_ld_sock" ; then
2630 _res_comment="using $_ld_sock"
2631 echores "yes"
2632 else
2633 echores "no"
2637 if test $_winsock2 = yes ; then
2638 _ld_sock="-lws2_32"
2639 _def_winsock2='#define HAVE_WINSOCK2 1'
2640 else
2641 _def_winsock2='#undef HAVE_WINSOCK2'
2645 _use_aton=no
2646 echocheck "inet_pton()"
2647 cat > $TMPC << EOF
2648 #include <sys/types.h>
2649 #include <sys/socket.h>
2650 #include <arpa/inet.h>
2651 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2653 if test "$_winsock2" = yes ; then
2654 _res_comment="using winsock2 functions instead"
2655 echores "no"
2656 elif cc_check $_ld_sock ; then
2657 # NOTE: Linux has libresolv but does not need it
2659 _res_comment="using $_ld_sock"
2660 echores "yes"
2661 elif cc_check $_ld_sock -lresolv ; then
2662 # NOTE: needed for SunOS at least
2663 _ld_sock="$_ld_sock -lresolv"
2664 _res_comment="using $_ld_sock"
2665 echores "yes"
2666 else
2667 _res_comment="trying inet_aton next"
2668 echores "no"
2670 echocheck "inet_aton()"
2671 cat > $TMPC << EOF
2672 #include <sys/types.h>
2673 #include <sys/socket.h>
2674 #include <arpa/inet.h>
2675 int main(void) { (void) inet_aton(0, 0); return 0; }
2677 _use_aton=yes
2678 if cc_check $_ld_sock ; then
2679 # NOTE: Linux has libresolv but does not need it
2681 _res_comment="using $_ld_sock"
2682 elif cc_check $_ld_sock -lresolv ; then
2683 # NOTE: needed for SunOS at least
2684 _ld_sock="$_ld_sock -lresolv"
2685 _res_comment="using $_ld_sock"
2686 else
2687 _use_aton=no
2688 _network=no
2689 _res_comment="network support disabled"
2691 echores "$_use_aton"
2694 _def_use_aton='#undef USE_ATON'
2695 if test "$_use_aton" != no; then
2696 _def_use_aton='#define USE_ATON 1'
2700 echocheck "inttypes.h (required)"
2701 cat > $TMPC << EOF
2702 #include <inttypes.h>
2703 int main(void) { return 0; }
2705 _inttypes=no
2706 cc_check && _inttypes=yes
2707 echores "$_inttypes"
2709 if test "$_inttypes" = no ; then
2710 echocheck "bitypes.h (inttypes.h predecessor)"
2711 cat > $TMPC << EOF
2712 #include <sys/bitypes.h>
2713 int main(void) { return 0; }
2715 cc_check && _inttypes=yes
2716 if test "$_inttypes" = yes ; then
2717 die "You don't have inttypes.h, but sys/bitypes.h is present. Please copy etc/inttypes.h into the include path, and re-run configure."
2718 else
2719 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2724 echocheck "int_fastXY_t in inttypes.h"
2725 cat > $TMPC << EOF
2726 #include <inttypes.h>
2727 int main(void) {
2728 volatile int_fast16_t v= 0;
2729 return v; }
2731 _fast_inttypes=no
2732 cc_check && _fast_inttypes=yes
2733 if test "$_fast_inttypes" = yes ; then
2734 # nothing to do
2736 else
2737 _def_fast_inttypes='
2738 typedef signed char int_fast8_t;
2739 typedef signed int int_fast16_t;
2740 typedef signed int int_fast32_t;
2741 typedef unsigned char uint_fast8_t;
2742 typedef unsigned int uint_fast16_t;
2743 typedef unsigned int uint_fast32_t;'
2745 echores "$_fast_inttypes"
2748 echocheck "word size"
2749 _mp_wordsize="#undef MP_WORDSIZE"
2750 cat > $TMPC << EOF
2751 #include <stdio.h>
2752 #include <sys/types.h>
2753 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2755 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2756 echores "$_wordsize"
2759 echocheck "stddef.h"
2760 cat > $TMPC << EOF
2761 #include <stddef.h>
2762 int main(void) { return 0; }
2764 _stddef=no
2765 cc_check && _stddef=yes
2766 if test "$_stddef" = yes ; then
2767 _def_stddef='#define HAVE_STDDEF_H 1'
2768 else
2769 _def_stddef='#undef HAVE_STDDEF_H'
2771 echores "$_stddef"
2774 echocheck "malloc.h"
2775 cat > $TMPC << EOF
2776 #include <malloc.h>
2777 int main(void) { (void) malloc(0); return 0; }
2779 _malloc=no
2780 cc_check && _malloc=yes
2781 if test "$_malloc" = yes ; then
2782 _def_malloc='#define HAVE_MALLOC_H 1'
2783 else
2784 _def_malloc='#undef HAVE_MALLOC_H'
2786 # malloc.h emits a warning in FreeBSD and OpenBSD
2787 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2788 echores "$_malloc"
2791 echocheck "memalign()"
2792 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2793 cat > $TMPC << EOF
2794 #include <malloc.h>
2795 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2797 _memalign=no
2798 cc_check && _memalign=yes
2799 if test "$_memalign" = yes ; then
2800 _def_memalign='#define HAVE_MEMALIGN 1'
2801 else
2802 _def_memalign='#undef HAVE_MEMALIGN'
2804 echores "$_memalign"
2807 echocheck "alloca.h"
2808 cat > $TMPC << EOF
2809 #include <alloca.h>
2810 int main(void) { (void) alloca(0); return 0; }
2812 _alloca=no
2813 cc_check && _alloca=yes
2814 if cc_check ; then
2815 _def_alloca='#define HAVE_ALLOCA_H 1'
2816 else
2817 _def_alloca='#undef HAVE_ALLOCA_H'
2819 echores "$_alloca"
2822 echocheck "mman.h"
2823 cat > $TMPC << EOF
2824 #include <sys/types.h>
2825 #include <sys/mman.h>
2826 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2828 _mman=no
2829 cc_check && _mman=yes
2830 if test "$_mman" = yes ; then
2831 _def_mman='#define HAVE_SYS_MMAN_H 1'
2832 else
2833 _def_mman='#undef HAVE_SYS_MMAN_H'
2835 echores "$_mman"
2837 cat > $TMPC << EOF
2838 #include <sys/types.h>
2839 #include <sys/mman.h>
2840 int main(void) { void *p = MAP_FAILED; return 0; }
2842 _mman_has_map_failed=no
2843 cc_check && _mman_has_map_failed=yes
2844 if test "$_mman_has_map_failed" = yes ; then
2845 _def_mman_has_map_failed=''
2846 else
2847 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2850 echocheck "dynamic loader"
2851 cat > $TMPC << EOF
2852 #include <dlfcn.h>
2853 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2855 _dl=no
2856 for _ld_tmp in "" "-ldl" ; do
2857 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2858 done
2859 if test "$_dl" = yes ; then
2860 _def_dl='#define HAVE_LIBDL 1'
2861 else
2862 _def_dl='#undef HAVE_LIBDL'
2864 echores "$_dl"
2867 echocheck "dynamic a/v plugins support"
2868 if test "$_dl" = no ; then
2869 _dynamic_plugins=no
2871 if test "$_dynamic_plugins" = yes ; then
2872 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
2873 else
2874 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
2876 echores "$_dynamic_plugins"
2879 #echocheck "dynamic linking"
2880 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
2881 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
2882 #cat > $TMPC << EOF
2883 #int main(void) { return 0; }
2884 #EOF
2885 #if cc_check -rdynamic ; then
2886 # _ld_dl_dynamic='-rdynamic'
2887 #elif cc_check -Bdynamic ; then
2888 # _ld_dl_dynamic='-Bdynamic'
2889 #elif cc_check ; then
2890 # _ld_dl_dynamic=''
2892 #echores "using $_ld_dl_dynamic"
2894 _def_threads='#undef HAVE_THREADS'
2896 echocheck "pthread"
2897 if test "$_pthreads" != no ; then
2898 cat > $TMPC << EOF
2899 #include <pthread.h>
2900 void* func(void *arg) { return arg; }
2901 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
2903 _pthreads=no
2904 if not hpux ; then
2905 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2906 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2907 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
2908 done
2911 if test "$_pthreads" = yes ; then
2912 _res_comment="using $_ld_pthread"
2913 _def_pthreads='#define HAVE_PTHREADS 1'
2914 _def_threads='#define HAVE_THREADS 1'
2915 else
2916 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
2917 _def_pthreads='#undef HAVE_PTHREADS'
2918 _nas=no ; _tv_v4l=no ; _macosx=no
2919 if not mingw32 ; then
2920 _win32=no
2923 echores "$_pthreads"
2926 echocheck "iconv"
2927 if test "$_iconv" = auto ; then
2928 _iconv_tmp='#include <iconv.h>'
2930 cat > $TMPC << EOF
2931 #include <stdio.h>
2932 #include <unistd.h>
2933 $_iconv_tmp
2934 #define INBUFSIZE 1024
2935 #define OUTBUFSIZE 4096
2937 char inbuffer[INBUFSIZE];
2938 char outbuffer[OUTBUFSIZE];
2940 int main(void) {
2941 size_t numread;
2942 iconv_t icdsc;
2943 char *tocode="UTF-8";
2944 char *fromcode="cp1250";
2945 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
2946 while ((numread = read (0, inbuffer, INBUFSIZE))) {
2947 char *iptr=inbuffer;
2948 char *optr=outbuffer;
2949 size_t inleft=numread;
2950 size_t outleft=OUTBUFSIZE;
2951 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
2952 != (size_t)(-1)) {
2953 write (1, outbuffer, OUTBUFSIZE - outleft);
2956 if (iconv_close(icdsc) == -1)
2961 _iconv=no
2962 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
2963 cc_check $_ld_lm $_ld_tmp && _ld_iconv="$_ld_tmp" && _iconv=yes && break
2964 done
2966 if test "$_iconv" = yes ; then
2967 _def_iconv='#define USE_ICONV 1'
2968 else
2969 _def_iconv='#undef USE_ICONV'
2971 echores "$_iconv"
2974 echocheck "sys/soundcard.h"
2975 cat > $TMPC << EOF
2976 #include <sys/soundcard.h>
2977 int main(void) { return 0; }
2979 _sys_soundcard=no
2980 cc_check && _sys_soundcard=yes
2981 if test "$_sys_soundcard" = yes ; then
2982 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
2983 _inc_soundcard='#include <sys/soundcard.h>'
2984 else
2985 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
2987 echores "$_sys_soundcard"
2989 if test "$_sys_soundcard" != yes ; then
2990 echocheck "soundcard.h"
2991 cat > $TMPC << EOF
2992 #include <soundcard.h>
2993 int main(void) { return 0; }
2995 _soundcard=no
2996 cc_check && _soundcard=yes
2997 if linux || test "$_ossaudio" != no ; then
2998 # use soundcard.h on Linux, or when OSS support is enabled
2999 echores "$_soundcard"
3000 else
3001 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
3002 _res_comment= "but ignored!"
3003 echores "$_soundcard"
3004 _soundcard=no
3006 if test "$_soundcard" = yes ; then
3007 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3008 _inc_soundcard='#include <soundcard.h>'
3009 else
3010 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3012 else
3013 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3017 echocheck "sys/dvdio.h"
3018 cat > $TMPC << EOF
3019 #include <unistd.h>
3020 #include <sys/dvdio.h>
3021 int main(void) { return 0; }
3023 _dvdio=no
3024 cc_check && _dvdio=yes
3025 if test "$_dvdio" = yes ; then
3026 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3027 else
3028 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3030 echores "$_dvdio"
3033 echocheck "sys/cdio.h"
3034 cat > $TMPC << EOF
3035 #include <unistd.h>
3036 #include <sys/cdio.h>
3037 int main(void) { return 0; }
3039 _cdio=no
3040 cc_check && _cdio=yes
3041 if test "$_cdio" = yes ; then
3042 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3043 else
3044 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3046 echores "$_cdio"
3049 echocheck "linux/cdrom.h"
3050 cat > $TMPC << EOF
3051 #include <sys/types.h>
3052 #include <linux/cdrom.h>
3053 int main(void) { return 0; }
3055 _cdrom=no
3056 cc_check && _cdrom=yes
3057 if test "$_cdrom" = yes ; then
3058 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3059 else
3060 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3062 echores "$_cdrom"
3065 echocheck "dvd.h"
3066 cat > $TMPC << EOF
3067 #include <dvd.h>
3068 int main(void) { return 0; }
3070 _dvd=no
3071 cc_check && _dvd=yes
3072 if test "$_dvd" = yes ; then
3073 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3074 else
3075 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3077 echores "$_dvd"
3080 echocheck "BSDI dvd.h"
3081 cat > $TMPC << EOF
3082 #include <dvd.h>
3083 int main(void) { return 0; }
3085 _bsdi_dvd=no
3086 cc_check && _bsdi_dvd=yes
3087 if test "$_bsdi_dvd" = yes ; then
3088 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3089 else
3090 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3092 echores "$_bsdi_dvd"
3095 # also used by AIX, but AIX does not support VCD and/or libdvdread
3096 echocheck "HP-UX SCSI header"
3097 cat > $TMPC << EOF
3098 #include <sys/scsi.h>
3099 int main(void) { return 0; }
3101 _hpux_scsi_h=no
3102 cc_check && _hpux_scsi_h=yes
3103 if test "$_hpux_scsi_h" = yes ; then
3104 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3105 else
3106 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3108 echores "$_hpux_scsi_h"
3111 echocheck "userspace SCSI headers (Solaris)"
3112 cat > $TMPC << EOF
3113 # include <unistd.h>
3114 # include <stropts.h>
3115 # include <sys/scsi/scsi_types.h>
3116 # include <sys/scsi/impl/uscsi.h>
3117 int main(void) { return 0; }
3119 _sol_scsi_h=no
3120 cc_check && _sol_scsi_h=yes
3121 if test "$_sol_scsi_h" = yes ; then
3122 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3123 else
3124 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3126 echores "$_sol_scsi_h"
3129 echocheck "termcap"
3130 if test "$_termcap" = auto ; then
3131 cat > $TMPC <<EOF
3132 int main(void) { tgetent(); return 0; }
3134 _termcap=no
3135 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3136 cc_check $_ld_tmp && _ld_termcap="$_ld_tmp" && _termcap=yes && break
3137 done
3139 if test "$_termcap" = yes ; then
3140 _def_termcap='#define USE_TERMCAP 1'
3141 _res_comment="using $_ld_termcap"
3142 else
3143 _def_termcap='#undef USE_TERMCAP'
3145 echores "$_termcap"
3148 echocheck "termios"
3149 if test "$_termios" = auto ; then
3150 cat > $TMPC <<EOF
3151 #include <sys/termios.h>
3152 int main(void) { return 0; }
3154 _termios=auto
3155 cc_check && _termios=yes
3156 _def_termios_h_name='sys/termios.h'
3158 # second test:
3159 if test "$_termios" = auto ; then
3160 cat > $TMPC <<EOF
3161 #include <termios.h>
3162 int main(void) { return 0; }
3164 _termios=no
3165 cc_check && _termios=yes
3166 _def_termios_h_name='termios.h'
3169 if test "$_termios" = yes ; then
3170 _def_termios='#define HAVE_TERMIOS 1'
3171 _def_termios_h='#undef HAVE_TERMIOS_H'
3172 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3174 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3175 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3176 elif test "$_def_termios_h_name" = 'termios.h' ; then
3177 _def_termios_h='#define HAVE_TERMIOS_H 1'
3179 _res_comment="using $_def_termios_h_name"
3180 else
3181 _def_termios='#undef HAVE_TERMIOS'
3182 _def_termios_h_name=''
3183 _termios=no
3185 echores "$_termios"
3188 echocheck "shm"
3189 if test "$_shm" = auto ; then
3190 cat > $TMPC << EOF
3191 #include <sys/types.h>
3192 #include <sys/shm.h>
3193 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3195 _shm=no
3196 cc_check && _shm=yes
3198 if test "$_shm" = yes ; then
3199 _def_shm='#define HAVE_SHM 1'
3200 else
3201 _def_shm='#undef HAVE_SHM'
3203 echores "$_shm"
3206 # XXX: FIXME, add runtime checking
3207 echocheck "linux devfs"
3208 echores "$_linux_devfs"
3211 echocheck "scandir()"
3212 cat > $TMPC << EOF
3213 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3215 _scandir=no
3216 cc_check && _scandir=yes
3217 if test "$_scandir" = yes ; then
3218 _def_scandir='#define HAVE_SCANDIR 1'
3219 else
3220 _def_scandir='#undef HAVE_SCANDIR'
3222 echores "$_scandir"
3225 echocheck "strsep()"
3226 cat > $TMPC << EOF
3227 #include <string.h>
3228 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3230 _strsep=no
3231 cc_check && _strsep=yes
3232 if test "$_strsep" = yes ; then
3233 _def_strsep='#define HAVE_STRSEP 1'
3234 else
3235 _def_strsep='#undef HAVE_STRSEP'
3237 echores "$_strsep"
3239 echocheck "strlcpy()"
3240 cat > $TMPC << EOF
3241 #include <string.h>
3242 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3244 _strlcpy=no
3245 cc_check && _strlcpy=yes
3246 if test "$_strlcpy" = yes ; then
3247 _def_strlcpy='#define HAVE_STRLCPY 1'
3248 else
3249 _def_strlcpy='#undef HAVE_STRLCPY'
3251 echores "$_strlcpy"
3253 echocheck "strlcat()"
3254 cat > $TMPC << EOF
3255 #include <string.h>
3256 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3258 _strlcat=no
3259 cc_check && _strlcat=yes
3260 if test "$_strlcat" = yes ; then
3261 _def_strlcat='#define HAVE_STRLCAT 1'
3262 else
3263 _def_strlcat='#undef HAVE_STRLCAT'
3265 echores "$_strlcat"
3267 echocheck "fseeko()"
3268 cat > $TMPC << EOF
3269 #include <stdio.h>
3270 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3272 _fseeko=no
3273 cc_check && _fseeko=yes
3274 if test "$_fseeko" = yes ; then
3275 _def_fseeko='#define HAVE_FSEEKO 1'
3276 else
3277 _def_fseeko='#undef HAVE_FSEEKO'
3279 echores "$_fseeko"
3281 echocheck "localtime_r()"
3282 cat > $TMPC << EOF
3283 #include <time.h>
3284 int main( void ) { localtime_r(NULL, NULL); }
3286 _localtime_r=no
3287 cc_check && _localtime_r=yes
3288 if test "$_localtime_r" = yes ; then
3289 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3290 else
3291 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3293 echores "$_localtime_r"
3295 echocheck "vsscanf()"
3296 cat > $TMPC << EOF
3297 #include <stdarg.h>
3298 int main(void) { vsscanf(0, 0, 0); return 0; }
3300 _vsscanf=no
3301 cc_check && _vsscanf=yes
3302 if test "$_vsscanf" = yes ; then
3303 _def_vsscanf='#define HAVE_VSSCANF 1'
3304 else
3305 _def_vsscanf='#undef HAVE_VSSCANF'
3307 echores "$_vsscanf"
3310 echocheck "swab()"
3311 cat > $TMPC << EOF
3312 #include <unistd.h>
3313 int main(void) { swab(0, 0, 0); return 0; }
3315 _swab=no
3316 cc_check && _swab=yes
3317 if test "$_swab" = yes ; then
3318 _def_swab='#define HAVE_SWAB 1'
3319 else
3320 _def_swab='#undef HAVE_SWAB'
3322 echores "$_swab"
3324 echocheck "POSIX select()"
3325 cat > $TMPC << EOF
3326 #include <stdio.h>
3327 #include <stdlib.h>
3328 #include <sys/types.h>
3329 #include <string.h>
3330 #include <sys/time.h>
3331 #include <unistd.h>
3332 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3334 _posix_select=no
3335 cc_check && _posix_select=yes
3336 if test "$_posix_select" = no ; then
3337 _def_no_posix_select='#define HAVE_NO_POSIX_SELECT 1'
3338 else
3339 _def_no_posix_select='#undef HAVE_NO_POSIX_SELECT'
3341 echores "$_posix_select"
3344 echocheck "gettimeofday()"
3345 cat > $TMPC << EOF
3346 #include <stdio.h>
3347 #include <sys/time.h>
3348 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3350 _gettimeofday=no
3351 cc_check && _gettimeofday=yes
3352 if test "$_gettimeofday" = yes ; then
3353 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3354 else
3355 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3357 echores "$_gettimeofday"
3360 echocheck "glob()"
3361 cat > $TMPC << EOF
3362 #include <stdio.h>
3363 #include <glob.h>
3364 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3366 _glob=no
3367 cc_check && _glob=yes
3368 if test "$_glob" = yes ; then
3369 _def_glob='#define HAVE_GLOB 1'
3370 else
3371 _def_glob='#undef HAVE_GLOB'
3373 echores "$_glob"
3376 echocheck "setenv()"
3377 cat > $TMPC << EOF
3378 #include <stdlib.h>
3379 int main (void){ setenv("","",0); return 0; }
3381 _setenv=no
3382 cc_check && _setenv=yes
3383 if test "$_setenv" = yes ; then
3384 _def_setenv='#define HAVE_SETENV 1'
3385 else
3386 _def_setenv='#undef HAVE_SETENV'
3388 echores "$_setenv"
3391 if sunos; then
3392 echocheck "sysi86()"
3393 cat > $TMPC << EOF
3394 #include <sys/sysi86.h>
3395 int main (void) { sysi86(0); return 0; }
3397 _sysi86=no
3398 cc_check && _sysi86=yes
3399 if test "$_sysi86" = yes ; then
3400 _def_sysi86='#define HAVE_SYSI86 1'
3401 else
3402 _def_sysi86='#undef HAVE_SYSI86'
3404 echores "$_sysi86"
3408 echocheck "sys/sysinfo.h"
3409 cat > $TMPC << EOF
3410 #include <sys/sysinfo.h>
3411 int main(void) {
3412 struct sysinfo s_info;
3413 sysinfo(&s_info);
3414 return 0;
3417 _sys_sysinfo=no
3418 cc_check && _sys_sysinfo=yes
3419 if test "$_sys_sysinfo" = yes ; then
3420 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3421 _inc_sysinfo='#include <sys/sysinfo.h>'
3422 else
3423 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3425 echores "$_sys_sysinfo"
3428 echocheck "Mac OS X APIs"
3429 if test "$_macosx" = auto && darwin ; then
3430 productName=`/usr/bin/sw_vers -productName`
3431 if test "$productName" = "Mac OS X" ; then
3432 _macosx=yes
3433 else
3434 _macosx=no
3435 _def_macosx='#undef MACOSX'
3436 _noaomodules="macosx $_noaomodules"
3437 _novomodules="quartz $_novomodules"
3440 if test "$_macosx" = yes ; then
3441 cat > $TMPC <<EOF
3442 #include <Carbon/Carbon.h>
3443 #include <QuickTime/QuickTime.h>
3444 #include <CoreAudio/CoreAudio.h>
3445 int main(void) {
3446 EnterMovies();
3447 ExitMovies();
3448 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3451 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3452 _macosx=yes
3453 _macosx_frameworks="-framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3454 _def_macosx='#define MACOSX 1'
3455 _aosrc="$_aosrc ao_macosx.c"
3456 _aomodules="macosx $_aomodules"
3457 _vosrc="$_vosrc vo_quartz.c"
3458 _vomodules="quartz $_vomodules"
3459 else
3460 _macosx=no
3461 _def_macosx='#undef MACOSX'
3462 _noaomodules="macosx $_noaomodules"
3463 _novomodules="quartz $_novomodules"
3465 cat > $TMPC <<EOF
3466 #include <Carbon/Carbon.h>
3467 #include <QuartzCore/CoreVideo.h>
3468 int main(void) {}
3470 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3471 _vosrc="$_vosrc vo_macosx.m"
3472 _vomodules="macosx $_vomodules"
3473 _macosx_frameworks="$_macosx_frameworks -framework Cocoa -framework QuartzCore -framework OpenGL"
3474 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3475 _macosx_corevideo=yes
3476 else
3477 _novomodules="macosx $_novomodules"
3478 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3479 _macosx_corevideo=no
3482 echores "$_macosx"
3484 echocheck "Mac OS X Finder Support"
3485 if test "$_macosx_finder_support" = auto ; then
3486 _macosx_finder_support=$_macosx
3488 if test "$_macosx_finder_support" = yes; then
3489 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3490 _macosx_finder_support=yes
3491 else
3492 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3493 _macosx_finder_support=no
3495 echores "$_macosx_finder_support"
3497 echocheck "Mac OS X Bundle file locations"
3498 if test "$_macosx_bundle" = auto ; then
3499 _macosx_bundle=$_macosx_finder_support
3501 if test "$_macosx_bundle" = yes; then
3502 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3503 else
3504 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3505 _macosx_bundle=no
3507 echores "$_macosx_bundle"
3509 echocheck "Samba support (libsmbclient)"
3510 if test "$_smbsupport" = yes; then
3511 _ld_smb="-lsmbclient"
3513 if test "$_smbsupport" = auto; then
3514 _smbsupport=no
3515 cat > $TMPC << EOF
3516 #include <libsmbclient.h>
3517 int main(void) { smbc_opendir("smb://"); return 0; }
3519 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3520 cc_check $_ld_tmp && _ld_smb="$_ld_tmp" && _smbsupport=yes && break
3521 done
3524 if test "$_smbsupport" = yes; then
3525 _def_smbsupport="#define LIBSMBCLIENT"
3526 _inputmodules="smb $_inputmodules"
3527 else
3528 _def_smbsupport="#undef LIBSMBCLIENT"
3529 _noinputmodules="smb $_noinputmodules"
3531 echores "$_smbsupport"
3534 #########
3535 # VIDEO #
3536 #########
3539 echocheck "3dfx"
3540 if test "$_3dfx" = yes ; then
3541 _def_3dfx='#define HAVE_3DFX 1'
3542 _vosrc="$_vosrc vo_3dfx.c"
3543 _vomodules="3dfx $_vomodules"
3544 else
3545 _def_3dfx='#undef HAVE_3DFX'
3546 _novomodules="3dfx $_novomodules"
3548 echores "$_3dfx"
3551 echocheck "tdfxfb"
3552 if test "$_tdfxfb" = yes ; then
3553 _def_tdfxfb='#define HAVE_TDFXFB 1'
3554 _vosrc="$_vosrc vo_tdfxfb.c"
3555 _vomodules="tdfxfb $_vomodules"
3556 else
3557 _def_tdfxfb='#undef HAVE_TDFXFB'
3558 _novomodules="tdfxfb $_novomodules"
3560 echores "$_tdfxfb"
3562 echocheck "tdfxvid"
3563 if test "$_tdfxvid" = yes ; then
3564 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3565 _vosrc="$_vosrc vo_tdfx_vid.c"
3566 _vomodules="tdfx_vid $_vomodules"
3567 else
3568 _def_tdfxvid='#undef HAVE_TDFX_VID'
3569 _novomodules="tdfx_vid $_novomodules"
3571 echores "$_tdfxfb"
3573 echocheck "tga"
3574 if test "$_tga" = yes ; then
3575 _def_tga='#define HAVE_TGA 1'
3576 _vosrc="$_vosrc vo_tga.c"
3577 _vomodules="tga $_vomodules"
3578 else
3579 _def_tga='#undef HAVE_TGA'
3580 _novomodules="tga $_novomodules"
3582 echores "$_tga"
3584 echocheck "DirectFB headers presence"
3585 if test -z "$_inc_directfb" ; then
3586 for I in /usr/include /usr/local/include `echo $_inc_extra | sed s/-I//g`; do
3587 if test -d "$I/directfb" && test -f "$I/directfb/directfb.h" ; then
3588 _inc_directfb="-I$I/directfb"
3589 _res_comment="using $_inc_directfb"
3590 echores "yes"
3591 break
3593 if test -d "$I" && test -f "$I/directfb.h" ; then
3594 _inc_directfb="-I$I"
3595 _res_comment="using $_inc_directfb"
3596 echores "yes"
3597 break
3599 done
3600 if test -z "$_inc_directfb" ; then
3601 _directfb=no
3602 echores "not found"
3604 else
3605 _res_comment="using $_inc_directfb"
3606 echores "yes"
3608 if test "$_inc_directfb" = "-I/usr/include" ; then
3609 _inc_directfb=""
3612 echocheck "DirectFB"
3613 if test "$_directfb" = auto ; then
3614 _directfb=no
3615 cat > $TMPC <<EOF
3616 #include <directfb.h>
3617 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3619 linux && test -c /dev/fb0 && cc_check $_inc_directfb -ldirectfb && _directfb=yes
3622 if test "$_directfb" = yes; then
3623 cat > $TMPC << EOF
3624 #include <directfb_version.h>
3626 dfb_ver = DIRECTFB_MAJOR_VERSION DIRECTFB_MINOR_VERSION DIRECTFB_MICRO_VERSION
3629 if $_cc -E $TMPC $_inc_directfb > "$TMPO"; then
3630 _directfb_version=`sed -n 's/^dfb_ver[^1-9]*\(.*\)/\1/p' "$TMPO" | tr -d '() '`
3631 _def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
3632 if test "$_directfb_version" -ge 913; then
3633 _res_comment="$_directfb_version"
3634 else
3635 _def_directfb_version='#undef DIRECTFBVERSION'
3636 _directfb=no
3637 _res_comment="version >=0.9.13 required"
3639 else
3640 _directfb=no
3641 _res_comment="failed to get version"
3644 echores "$_directfb"
3646 if test "$_directfb" = yes ; then
3647 _def_directfb='#define HAVE_DIRECTFB 1'
3648 if test "$_directfb_version" -ge 913; then
3649 _vosrc="$_vosrc vo_directfb2.c"
3650 _vomodules="directfb $_vomodules"
3651 _ld_directfb='-ldirectfb'
3654 if test "$_directfb_version" -ge 915; then
3655 _vosrc="$_vosrc vo_dfbmga.c"
3656 _vomodules="dfbmga $_vomodules"
3658 else
3659 _def_directfb='#undef HAVE_DIRECTFB'
3660 _novomodules="directfb $_novomodules"
3661 _inc_directfb=""
3665 echocheck "X11 headers presence"
3666 if test -z "$_inc_x11" ; then
3667 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3668 if test -d "$I/X11" && test -f "$I/X11/Xlib.h" ; then
3669 _inc_x11="-I$I"
3670 _x11_headers="yes"
3671 _res_comment="using $I"
3672 break
3674 done
3675 if test -z "$_inc_x11" ; then
3676 _x11=no
3677 _x11_headers="no"
3678 _res_comment="check if the dev(el) packages are installed"
3680 else
3681 _x11_headers="yes"
3682 _res_comment="using $_inc_x11"
3684 if test "$_inc_x11" = "-I/usr/include" ; then
3685 _inc_x11=""
3687 echores "$_x11_headers"
3690 echocheck "X11"
3691 if test "$_x11" != no ; then
3692 cat > $TMPC <<EOF
3693 #include <X11/Xlib.h>
3694 #include <X11/Xutil.h>
3695 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3697 if test -z "$_x11_paths" ; then
3698 _x11_paths="/usr/X11R6/lib /usr/lib/X11R6 /usr/X11/lib /usr/lib32 /usr/openwin/lib /usr/X11R6/lib64 /usr/lib"
3700 for I in $_x11_paths ; do
3701 _ld_x11="-L$I -lXext -lX11 $_ld_sock $_ld_pthread"
3702 if netbsd; then
3703 _ld_x11="$_ld_x11 -Wl,-R$I"
3705 if test -d "$I" && cc_check $_inc_x11 $_ld_x11 ; then
3706 _x11=yes
3707 break
3709 done
3711 if test "$_x11" = yes ; then
3712 _def_x11='#define HAVE_X11 1'
3713 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3714 _vomodules="x11 xover $_vomodules"
3715 _res_comment="using $I"
3716 else
3717 _x11=no
3718 _def_x11='#undef HAVE_X11'
3719 _inc_x11=''
3720 _ld_x11=''
3721 _novomodules="x11 $_novomodules"
3722 _res_comment="check if the dev(el) packages are installed"
3724 echores "$_x11"
3727 echocheck "DPMS"
3728 _xdpms3=no
3729 _xdpms4=no
3730 if test "$_x11" = yes ; then
3731 cat > $TMPC <<EOF
3732 #include <X11/Xmd.h>
3733 #include <X11/Xlib.h>
3734 #include <X11/Xutil.h>
3735 #include <X11/Xatom.h>
3736 #include <X11/extensions/dpms.h>
3737 int main(void) {
3738 (void) DPMSQueryExtension(0, 0, 0);
3741 cc_check $_inc_x11 -lXdpms $_ld_x11 && _xdpms3=yes
3742 cat > $TMPC <<EOF
3743 #include <X11/Xlib.h>
3744 #include <X11/extensions/dpms.h>
3745 int main(void) {
3746 (void) DPMSQueryExtension(0, 0, 0);
3749 cc_check $_inc_x11 $_ld_x11 && _xdpms4=yes
3751 if test "$_xdpms4" = yes ; then
3752 _def_xdpms='#define HAVE_XDPMS 1'
3753 _res_comment="using Xdpms 4"
3754 echores "yes"
3755 elif test "$_xdpms3" = yes ; then
3756 _def_xdpms='#define HAVE_XDPMS 1'
3757 _ld_x11="-lXdpms $_ld_x11"
3758 _res_comment="using Xdpms 3"
3759 echores "yes"
3760 else
3761 _def_xdpms='#undef HAVE_XDPMS'
3762 echores "no"
3766 echocheck "Xv"
3767 if test "$_x11" = yes && test "$_xv" != no ; then
3768 cat > $TMPC <<EOF
3769 #include <X11/Xlib.h>
3770 #include <X11/extensions/Xvlib.h>
3771 int main(void) {
3772 (void) XvGetPortAttribute(0, 0, 0, 0);
3773 (void) XvQueryPortAttributes(0, 0, 0);
3774 return 0; }
3776 _xv=no
3777 cc_check $_inc_x11 -lXv $_ld_x11 && _xv=yes
3778 else
3779 _xv=no
3781 if test "$_xv" = yes ; then
3782 _def_xv='#define HAVE_XV 1'
3783 _ld_xv='-lXv'
3784 _vosrc="$_vosrc vo_xv.c"
3785 _vomodules="xv $_vomodules"
3786 else
3787 _def_xv='#undef HAVE_XV'
3788 _novomodules="xv $_novomodules"
3790 echores "$_xv"
3793 echocheck "XvMC"
3794 if test "$_x11" = yes && test "$_xv" = yes && test "$_xvmc" != no ; then
3795 _xvmc=no
3796 cat > $TMPC <<EOF
3797 #include <X11/Xlib.h>
3798 #include <X11/extensions/Xvlib.h>
3799 #include <X11/extensions/XvMClib.h>
3800 int main(void) {
3801 (void) XvMCQueryExtension(0,0,0);
3802 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3803 return 0; }
3805 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3806 cc_check $_inc_x11 -lXvMC -l$_ld_tmp $_ld_xv $_ld_x11 && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3807 done
3809 if test "$_xvmc" = yes ; then
3810 _def_xvmc='#define HAVE_XVMC 1'
3811 _ld_xvmc="-lXvMC -l$_xvmclib"
3812 _vosrc="$_vosrc vo_xvmc.c"
3813 _vomodules="xvmc $_vomodules"
3814 _res_comment="using $_xvmclib"
3815 else
3816 _def_xvmc='#undef HAVE_XVMC'
3817 _novomodules="xvmc $_novomodules"
3819 echores "$_xvmc"
3822 echocheck "Xinerama"
3823 if test "$_x11" = yes && test "$_xinerama" != no ; then
3824 cat > $TMPC <<EOF
3825 #include <X11/Xlib.h>
3826 #include <X11/extensions/Xinerama.h>
3827 int main(void) { (void) XineramaIsActive(0); return 0; }
3829 _xinerama=no
3830 cc_check $_inc_x11 -lXinerama $_ld_x11 && _xinerama=yes
3831 else
3832 _xinerama=no
3834 if test "$_xinerama" = yes ; then
3835 _def_xinerama='#define HAVE_XINERAMA 1'
3836 _ld_xinerama='-lXinerama'
3837 else
3838 _def_xinerama='#undef HAVE_XINERAMA'
3840 echores "$_xinerama"
3843 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3844 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3845 # named 'X extensions' or something similar.
3846 # This check may be useful for future mplayer versions (to change resolution)
3847 # If you run into problems, remove '-lXxf86vm'.
3848 echocheck "Xxf86vm"
3849 if test "$_x11" = yes && test "$_vm" = auto ; then
3850 cat > $TMPC <<EOF
3851 #include <X11/Xlib.h>
3852 #include <X11/extensions/xf86vmode.h>
3853 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3855 _vm=no
3856 cc_check $_inc_x11 -lXxf86vm $_ld_x11 && _vm=yes
3858 if test "$_vm" = yes ; then
3859 _def_vm='#define HAVE_XF86VM 1'
3860 _ld_vm='-lXxf86vm'
3861 else
3862 _def_vm='#undef HAVE_XF86VM'
3864 echores "$_vm"
3866 # Check for the presence of special keycodes, like audio control buttons
3867 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3868 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3869 # have these new keycodes.
3870 echocheck "XF86keysym"
3871 if test "$_xf86keysym" = auto; then
3872 _xf86keysym=no
3873 if test "$_x11" = yes ; then
3874 cat > $TMPC <<EOF
3875 #include <X11/Xlib.h>
3876 #include <X11/XF86keysym.h>
3877 int main(void) { return XF86XK_AudioPause; }
3879 cc_check $_inc_x11 $_ld_x11 && _xf86keysym=yes
3882 if test "$_xf86keysym" = yes ; then
3883 _def_xf86keysym='#define HAVE_XF86XK 1'
3884 else
3885 _def_xf86keysym='#undef HAVE_XF86XK'
3887 echores "$_xf86keysym"
3889 echocheck "DGA"
3890 if test "$_x11" = no ; then
3891 _dga=no
3893 # Version 2 is preferred to version 1 if available
3894 if test "$_dga" = auto ; then
3895 cat > $TMPC << EOF
3896 #include <X11/Xlib.h>
3897 #include <X11/extensions/xf86dga.h>
3898 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
3900 _dga=no
3901 cc_check $_inc_x11 -lXxf86dga -lXxf86vm $_ld_x11 && _dga=1
3903 cat > $TMPC << EOF
3904 #include <X11/Xlib.h>
3905 #include <X11/extensions/xf86dga.h>
3906 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
3908 cc_check $_inc_x11 -lXxf86dga $_ld_x11 && _dga=2
3911 _def_dga='#undef HAVE_DGA'
3912 _def_dga2='#undef HAVE_DGA2'
3913 if test "$_dga" = 1 ; then
3914 _def_dga='#define HAVE_DGA 1'
3915 _ld_dga='-lXxf86dga'
3916 _vosrc="$_vosrc vo_dga.c"
3917 _vomodules="dga $_vomodules"
3918 _res_comment="using DGA 1.0"
3919 elif test "$_dga" = 2 ; then
3920 _def_dga='#define HAVE_DGA 1'
3921 _def_dga2='#define HAVE_DGA2 1'
3922 _ld_dga='-lXxf86dga'
3923 _vosrc="$_vosrc vo_dga.c"
3924 _vomodules="dga $_vomodules"
3925 _res_comment="using DGA 2.0"
3926 elif test "$_dga" = no ; then
3927 _novomodules="dga $_novomodules"
3928 else
3929 die "DGA version must be 1 or 2"
3931 echores "$_dga"
3934 echocheck "OpenGL"
3935 #Note: this test is run even with --enable-gl since we autodetect $_ld_gl
3936 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
3937 cat > $TMPC << EOF
3938 #include <GL/gl.h>
3939 int main(void) { return 0; }
3941 _gl=no
3942 if cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm ; then
3943 _gl=yes
3944 _ld_gl="-lGL $_ld_dl"
3945 elif cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm $_ld_pthread ; then
3946 _gl=yes
3947 _ld_gl="-lGL $_ld_pthread $_ld_dl"
3948 elif cc_check -lopengl32 ; then
3949 _gl=yes
3950 _gl_win32=yes
3951 _ld_gl="-lopengl32 -lgdi32"
3953 else
3954 _gl=no
3956 if test "$_gl" = yes ; then
3957 _def_gl='#define HAVE_GL 1'
3958 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
3959 if test "$_gl_win32" = yes ; then
3960 _def_gl_win32='#define GL_WIN32 1'
3961 _vosrc="$_vosrc w32_common.c"
3962 _res_comment="win32 version"
3964 _vomodules="opengl $_vomodules"
3965 else
3966 _def_gl='#undef HAVE_GL'
3967 _def_gl_win32='#undef GL_WIN32'
3968 _novomodules="opengl $_novomodules"
3970 echores "$_gl"
3973 echocheck "/dev/mga_vid"
3974 if test "$_mga" = auto ; then
3975 _mga=no
3976 test -c /dev/mga_vid && _mga=yes
3978 if test "$_mga" = yes ; then
3979 _def_mga='#define HAVE_MGA 1'
3980 _vosrc="$_vosrc vo_mga.c"
3981 _vomodules="mga $_vomodules"
3982 else
3983 _def_mga='#undef HAVE_MGA'
3984 _novomodules="mga $_novomodules"
3986 echores "$_mga"
3989 # echocheck "syncfb"
3990 # _syncfb=no
3991 # test "$_mga" = yes && _syncfb=yes
3992 # if test "$_syncfb" = yes ; then
3993 # _def_syncfb='#define HAVE_SYNCFB 1'
3994 # _vosrc="$_vosrc vo_syncfb.c"
3995 # else
3996 # _def_syncfb='#undef HAVE_SYNCFB'
3997 # fi
3998 # echores "$_syncfb"
4001 echocheck "xmga"
4002 if test "$_xmga" = auto ; then
4003 _xmga=no
4004 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4006 if test "$_xmga" = yes ; then
4007 _def_xmga='#define HAVE_XMGA 1'
4008 _vosrc="$_vosrc vo_xmga.c"
4009 _vomodules="xmga $_vomodules"
4010 else
4011 _def_xmga='#undef HAVE_XMGA'
4012 _novomodules="xmga $_novomodules"
4014 echores "$_xmga"
4017 echocheck "GGI"
4018 if test "$_ggi" = auto ; then
4019 cat > $TMPC << EOF
4020 #include <ggi/ggi.h>
4021 int main(void) { return 0; }
4023 _ggi=no
4024 cc_check -lggi && _ggi=yes
4026 if test "$_ggi" = yes ; then
4027 _def_ggi='#define HAVE_GGI 1'
4028 _ld_ggi='-lggi'
4029 _vosrc="$_vosrc vo_ggi.c"
4030 _vomodules="ggi $_vomodules"
4031 else
4032 _def_ggi='#undef HAVE_GGI'
4033 _novomodules="ggi $_novomodules"
4035 echores "$_ggi"
4037 echocheck "GGI extension: libggiwmh"
4038 if test "$_ggiwmh" = auto ; then
4039 _ggiwmh=no
4040 cat > $TMPC << EOF
4041 #include <ggi/ggi.h>
4042 #include <ggi/wmh.h>
4043 int main(void) { return 0; }
4045 cc_check -lggi -lggiwmh && _ggiwmh=yes
4047 # needed to get right output on obscure combination
4048 # like --disable-ggi --enable-ggiwmh
4049 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4050 _def_ggiwmh='#define HAVE_GGIWMH 1'
4051 _ld_ggi="$_ld_ggi -lggiwmh"
4052 else
4053 _ggiwmh=no
4054 _def_ggiwmh='#undef HAVE_GGIWMH'
4056 echores "$_ggiwmh"
4059 echocheck "AA"
4060 if test "$_aa" = auto ; then
4061 cat > $TMPC << EOF
4062 #include <aalib.h>
4063 extern struct aa_hardware_params aa_defparams;
4064 extern struct aa_renderparams aa_defrenderparams;
4065 int main(void) {
4066 aa_context *c;
4067 aa_renderparams *p;
4068 (void) aa_init(0, 0, 0);
4069 c = aa_autoinit(&aa_defparams);
4070 p = aa_getrenderparams();
4071 aa_autoinitkbd(c,0);
4072 return 0; }
4074 _aa=no
4075 for _ld_tmp in "-laa" "$_ld_x11 -laa" ; do
4076 cc_check $_ld_tmp && _ld_aa=$_ld_tmp && _aa=yes && break
4077 done
4079 if test "$_aa" = yes ; then
4080 _def_aa='#define HAVE_AA 1'
4081 if cygwin ; then
4082 _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6`
4084 _vosrc="$_vosrc vo_aa.c"
4085 _vomodules="aa $_vomodules"
4086 else
4087 _def_aa='#undef HAVE_AA'
4088 _novomodules="aa $_novomodules"
4090 echores "$_aa"
4093 echocheck "CACA"
4094 if test "$_caca" = auto ; then
4095 _caca=no
4096 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4097 cat > $TMPC << EOF
4098 #include <caca.h>
4099 int main(void) { (void) caca_init(); return 0; }
4101 cc_check `caca-config --libs` && _caca=yes
4104 if test "$_caca" = yes ; then
4105 _def_caca='#define HAVE_CACA 1'
4106 _inc_caca=`caca-config --cflags`
4107 _ld_caca=`caca-config --libs`
4108 _vosrc="$_vosrc vo_caca.c"
4109 _vomodules="caca $_vomodules"
4110 else
4111 _def_caca='#undef HAVE_CACA'
4112 _novomodules="caca $_novomodules"
4114 echores "$_caca"
4117 echocheck "SVGAlib"
4118 if test "$_svga" = auto ; then
4119 cat > $TMPC << EOF
4120 #include <vga.h>
4121 int main(void) { return 0; }
4123 _svga=no
4124 cc_check -lvga $_ld_lm && _svga=yes
4126 if test "$_svga" = yes ; then
4127 _def_svga='#define HAVE_SVGALIB 1'
4128 _ld_svga="-lvga"
4129 _vosrc="$_vosrc vo_svga.c"
4130 _vomodules="svga $_vomodules"
4131 else
4132 _def_svga='#undef HAVE_SVGALIB'
4133 _novomodules="svga $_novomodules"
4135 echores "$_svga"
4138 echocheck "FBDev"
4139 if test "$_fbdev" = auto ; then
4140 _fbdev=no
4141 linux && test -c /dev/fb0 && _fbdev=yes
4143 if test "$_fbdev" = yes ; then
4144 _def_fbdev='#define HAVE_FBDEV 1'
4145 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4146 _vomodules="fbdev $_vomodules"
4147 else
4148 _def_fbdev='#undef HAVE_FBDEV'
4149 _novomodules="fbdev $_novomodules"
4151 echores "$_fbdev"
4155 echocheck "DVB"
4156 if test "$_dvb" != no ; then
4157 _dvb=no
4158 cat >$TMPC << EOF
4159 #include <sys/poll.h>
4160 #include <sys/ioctl.h>
4161 #include <stdio.h>
4162 #include <time.h>
4163 #include <unistd.h>
4165 #include <ost/dmx.h>
4166 #include <ost/frontend.h>
4167 #include <ost/sec.h>
4168 #include <ost/video.h>
4169 #include <ost/audio.h>
4170 int main(void) {return 0;}
4172 if cc_check ; then
4173 _dvb=yes
4174 else
4175 for I in "$_inc_dvb" "-I/usr/src/DVB/ost/include" ; do
4176 if cc_check "$I" ; then
4177 _dvb=yes
4178 _inc_dvb="$I"
4179 _res_comment="using $_inc_dvb"
4180 break
4182 done
4183 test "$_dvb" = no && _res_comment="specify path to DVB/ost/include with --with-dvbincdir=DIR"
4186 echores "$_dvb"
4187 if test "$_dvb" = yes ; then
4188 _def_dvb='#define HAVE_DVB 1'
4189 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4190 _aomodules="mpegpes(dvb) $_aomodules"
4191 _vomodules="mpegpes(dvb) $_vomodules"
4193 if test "$_dvbhead" != no ; then
4194 echocheck "DVB HEAD"
4195 if test "$_dvbhead" != no ; then
4196 _dvbhead=no
4198 cat >$TMPC << EOF
4199 #include <sys/poll.h>
4200 #include <sys/ioctl.h>
4201 #include <stdio.h>
4202 #include <time.h>
4203 #include <unistd.h>
4205 #include <linux/dvb/dmx.h>
4206 #include <linux/dvb/frontend.h>
4207 #include <linux/dvb/video.h>
4208 #include <linux/dvb/audio.h>
4209 int main(void) {return 0;}
4211 if cc_check ; then
4212 _dvbhead=yes
4213 else
4214 for I in "$_inc_dvb" "-I/usr/src/DVB/include" ; do
4215 if cc_check "$I" ; then
4216 _dvbhead=yes
4217 _inc_dvb="$I"
4218 _res_comment="using $_inc_dvb"
4219 break
4221 done
4222 test "$_dvbhead" = no && _res_comment="specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR"
4225 echores "$_dvbhead"
4226 if test "$_dvbhead" = yes ; then
4227 _def_dvb='#define HAVE_DVB_HEAD 1'
4228 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4229 _aomodules="mpegpes(dvb) $_aomodules"
4230 _vomodules="mpegpes(dvb) $_vomodules"
4233 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4234 _def_dvb='#undef HAVE_DVB'
4235 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4236 _aomodules="mpegpes(file) $_aomodules"
4237 _vomodules="mpegpes(file) $_vomodules"
4240 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4241 _dvbin=yes
4242 _inputmodules="dvb $_inputmodules"
4243 else
4244 _dvbin=no
4245 _noinputmodules="dvb $_noinputmodules"
4248 echocheck "PNG support"
4249 if test "$_png" = auto ; then
4250 _png=no
4251 if irix ; then
4252 # Don't check for -lpng on irix since it has its own libpng
4253 # incompatible with the GNU libpng
4254 _res_comment="disabled on irix (not GNU libpng)"
4255 else
4256 cat > $TMPC << EOF
4257 #include <png.h>
4258 #include <string.h>
4259 int main(void) {
4260 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4261 printf("libpng: %s\n", png_libpng_ver);
4262 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4265 if cc_check -lpng -lz $_ld_lm ; then
4266 if tmp_run ; then
4267 _png=yes
4268 else
4269 _res_comment="mismatch of library and header versions"
4274 echores "$_png"
4275 if test "$_png" = yes ; then
4276 _def_png='#define HAVE_PNG 1'
4277 _ld_png='-lpng -lz'
4278 _vosrc="$_vosrc vo_png.c"
4279 _vomodules="png $_vomodules"
4280 _mkf_png="yes"
4281 else
4282 _def_png='#undef HAVE_PNG'
4283 _novomodules="png $_novomodules"
4284 _mkf_png="no"
4287 echocheck "JPEG support"
4288 if test "$_jpg" = auto ; then
4289 _jpg=no
4290 cat > $TMPC << EOF
4291 #include <stdio.h>
4292 #include <stdlib.h>
4293 #include <setjmp.h>
4294 #include <string.h>
4295 #include <jpeglib.h>
4296 int main(void) {
4297 return 0;
4300 if cc_check -ljpeg $_ld_lm ; then
4301 if tmp_run ; then
4302 _jpg=yes
4306 echores "$_jpg"
4308 if test "$_jpg" = yes ; then
4309 _def_jpg='#define HAVE_JPEG 1'
4310 _vosrc="$_vosrc vo_jpeg.c"
4311 _vomodules="jpeg $_vomodules"
4312 _ld_jpg="-ljpeg"
4313 _mkf_jpg="yes"
4314 else
4315 _def_jpg='#undef HAVE_JPEG'
4316 _novomodules="jpeg $_novomodules"
4317 _mkf_jpg="no"
4322 echocheck "PNM support"
4323 if test "$_pnm" = yes; then
4324 _def_pnm="#define HAVE_PNM"
4325 _vosrc="$_vosrc vo_pnm.c"
4326 _vomodules="pnm $_vomodules"
4327 else
4328 _def_pnm="#undef HAVE_PNM"
4329 _novomodules="pnm $_novomodules"
4331 echores "$_pnm"
4335 echocheck "md5sum support"
4336 if test "$_md5sum" = yes; then
4337 _def_md5sum="#define HAVE_MD5SUM"
4338 _vosrc="$_vosrc vo_md5sum.c md5sum.c"
4339 _vomodules="md5sum $_vomodules"
4340 else
4341 _def_md5sum="#undef HAVE_MD5SUM"
4342 _novomodules="md5sum $_novomodules"
4344 echores "$_md5sum"
4348 echocheck "GIF support"
4349 # This is to appease people who want to force gif support.
4350 # If it is forced to yes, then we still do checks to determine
4351 # which gif library to use.
4352 if test "$_gif" = yes ; then
4353 _force_gif=yes
4354 _gif=auto
4357 if test "$_gif" = auto ; then
4358 _gif=no
4359 cat > $TMPC << EOF
4360 #include <gif_lib.h>
4361 int main(void) {
4362 return 0;
4365 for _ld_tmp in "-lungif" "-lungif $_ld_x11" "-lgif" "-lgif $_ld_x11" ; do
4366 cc_check $_ld_tmp && tmp_run && _ld_gif="$_ld_tmp" && _gif=yes && break
4367 done
4370 # If no library was found, and the user wants support forced,
4371 # then we force it on with libgif, as this is the safest
4372 # assumption IMHO. (libungif & libregif both create symbolic
4373 # links to libgif. We also assume that no x11 support is needed,
4374 # because if you are forcing this, then you _should_ know what
4375 # you are doing. [ Besides, package maintainers should never
4376 # have compiled x11 deps into libungif in the first place. ] )
4377 # </rant>
4378 # --Joey
4379 if test "$_force_gif" = yes && test "$_gif" = no ; then
4380 _gif=yes
4381 _ld_gif="-lgif"
4384 if test "$_gif" = yes ; then
4385 _def_gif='#define HAVE_GIF 1'
4386 _vosrc="$_vosrc vo_gif89a.c"
4387 _codecmodules="gif $_codecmodules"
4388 _vomodules="gif89a $_vomodules"
4389 _mkf_gif="yes"
4390 _res_comment="old version, some encoding functions disabled"
4391 _def_gif_4='#undef HAVE_GIF_4'
4393 cat > $TMPC << EOF
4394 #include <signal.h>
4395 #include <gif_lib.h>
4396 void catch() { exit(1); }
4397 int main(void) {
4398 signal(SIGSEGV, catch); // catch segfault
4399 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4400 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4401 return 0;
4404 if cc_check "$_ld_gif" && tmp_run ; then
4405 _def_gif_4='#define HAVE_GIF_4 1'
4406 _res_comment=""
4408 else
4409 _def_gif='#undef HAVE_GIF'
4410 _def_gif_4='#undef HAVE_GIF_4'
4411 _novomodules="gif89a $_novomodules"
4412 _nocodecmodules="gif $_nocodecmodules"
4413 _mkf_gif="no"
4415 echores "$_gif"
4418 case "$_gif" in yes*)
4419 echocheck "broken giflib workaround"
4420 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4422 cat > $TMPC << EOF
4423 #include <gif_lib.h>
4424 int main(void) {
4425 GifFileType gif;
4426 printf("UserData is at address %p\n", gif.UserData);
4427 return 0;
4430 if cc_check "$_ld_gif" && tmp_run ; then
4431 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4432 echores "disabled"
4433 else
4434 echores "enabled"
4437 esac
4440 echocheck "VESA support"
4441 if test "$_vesa" = auto ; then
4442 cat > $TMPC << EOF
4443 #include <vbe.h>
4444 int main(void) { vbeVersion(); return 0; }
4446 _vesa=no
4447 cc_check -lvbe -llrmi && _vesa=yes
4449 if test "$_vesa" = yes ; then
4450 _def_vesa='#define HAVE_VESA 1'
4451 _ld_vesa="-lvbe -llrmi"
4452 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4453 _vomodules="vesa $_vomodules"
4454 else
4455 _def_vesa='#undef HAVE_VESA'
4456 _novomodules="vesa $_novomodules"
4458 echores "$_vesa"
4460 #################
4461 # VIDEO + AUDIO #
4462 #################
4465 echocheck "SDL"
4466 if test -z "$_sdlconfig" ; then
4467 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4468 _sdlconfig="sdl-config"
4469 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4470 _sdlconfig="sdl11-config"
4471 else
4472 _sdlconfig=false
4475 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4476 cat > $TMPC << EOF
4477 #include <SDL.h>
4478 int main(int argc, char *argv[]) { return 0; }
4480 _sdl=no
4481 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4482 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4483 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4484 if test "$_sdlversion" -gt 116 ; then
4485 if test "$_sdlversion" -lt 121 ; then
4486 _def_sdlbuggy='#define BUGGY_SDL'
4487 else
4488 _def_sdlbuggy='#undef BUGGY_SDL'
4490 _sdl=yes
4491 else
4492 _res_comment="outdated"
4497 if test "$_sdl" = yes ; then
4498 _def_sdl='#define HAVE_SDL 1'
4499 if cygwin ; then
4500 _ld_sdl=`$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`
4501 _inc_sdl=`$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`
4502 elif mingw32 ; then
4503 _ld_sdl=`$_sdlconfig --libs | sed s/-mwindows//`
4504 _inc_sdl=`$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`
4505 else
4506 _ld_sdl=`$_sdlconfig --libs`
4507 _inc_sdl=`$_sdlconfig --cflags`
4509 _vosrc="$_vosrc vo_sdl.c"
4510 _vomodules="sdl $_vomodules"
4511 _aosrc="$_aosrc ao_sdl.c"
4512 _aomodules="sdl $_aomodules"
4513 _res_comment="using $_sdlconfig"
4514 else
4515 _def_sdl='#undef HAVE_SDL'
4516 _novomodules="sdl $_novomodules"
4517 _noaomodules="sdl $_noaomodules"
4519 echores "$_sdl"
4521 echocheck "Windows waveout"
4522 if test "$_win32waveout" = auto ; then
4523 cat > $TMPC << EOF
4524 #include <windows.h>
4525 #include <mmsystem.h>
4526 int main(void) { return 0; }
4528 _win32waveout=no
4529 cc_check -lwinmm && _win32waveout=yes
4531 if test "$_win32waveout" = yes ; then
4532 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4533 _ld_win32libs="-lwinmm $_ld_win32libs"
4534 _aosrc="$_aosrc ao_win32.c"
4535 _aomodules="win32 $_aomodules"
4536 else
4537 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4538 _noaomodules="win32 $_noaomodules"
4540 echores "$_win32waveout"
4542 echocheck "Directx"
4543 if test "$_directx" = auto ; then
4544 cat > $TMPC << EOF
4545 #include <windows.h>
4546 #include <ddraw.h>
4547 #include <dsound.h>
4548 int main(void) { return 0; }
4550 _directx=no
4551 cc_check -lgdi32 && _directx=yes
4553 if test "$_directx" = yes ; then
4554 _def_directx='#define HAVE_DIRECTX 1'
4555 _ld_win32libs="-lgdi32 $_ld_win32libs"
4556 _vosrc="$_vosrc vo_directx.c"
4557 _vomodules="directx $_vomodules"
4558 _aosrc="$_aosrc ao_dsound.c"
4559 _aomodules="dsound $_aomodules"
4560 else
4561 _def_directx='#undef HAVE_DIRECTX'
4562 _novomodules="directx $_novomodules"
4563 _noaomodules="dsound $_noaomodules"
4565 echores "$_directx"
4567 echocheck "NAS"
4568 if test "$_nas" = auto ; then
4569 cat > $TMPC << EOF
4570 #include <audio/audiolib.h>
4571 int main(void) { return 0; }
4573 _nas=no
4574 cc_check -laudio $_inc_x11 -lXt $_ld_x11 $_ld_lm && _nas=yes
4576 if test "$_nas" = yes ; then
4577 _def_nas='#define HAVE_NAS 1'
4578 _ld_nas="-laudio -lXt $_ld_x11"
4579 _aosrc="$_aosrc ao_nas.c"
4580 _aomodules="nas $_aomodules"
4581 else
4582 _noaomodules="nas $_noaomodules"
4583 _def_nas='#undef HAVE_NAS'
4585 echores "$_nas"
4587 echocheck "DXR2"
4588 if test "$_dxr2" = auto; then
4589 _dxr2=no
4590 cat > $TMPC << EOF
4591 #include <dxr2ioctl.h>
4592 int main(void) { return 0; }
4594 for _inc_dxr2 in "$_inc_dxr2" \
4595 "-I/usr/local/include/dxr2" \
4596 "-I/usr/include/dxr2"; do
4597 cc_check $_inc_dxr2 && _dxr2=yes && break
4598 done
4600 if test "$_dxr2" = yes; then
4601 _def_dxr2='#define HAVE_DXR2 1'
4602 _vosrc="$_vosrc vo_dxr2.c"
4603 _aosrc="$_aosrc ao_dxr2.c"
4604 _aomodules="dxr2 $_aomodules"
4605 _vomodules="dxr2 $_vomodules"
4606 _res_comment="using $_inc_dxr2"
4607 else
4608 _def_dxr2='#undef HAVE_DXR2'
4609 _noaomodules="dxr2 $_noaomodules"
4610 _novomodules="dxr2 $_novomodules"
4611 _inc_dxr2=""
4613 echores "$_dxr2"
4615 echocheck "DXR3/H+"
4616 if test "$_dxr3" = auto ; then
4617 cat > $TMPC << EOF
4618 #include <linux/em8300.h>
4619 int main(void) { return 0; }
4621 _dxr3=no
4622 cc_check && _dxr3=yes
4624 if test "$_dxr3" = yes ; then
4625 _def_dxr3='#define HAVE_DXR3 1'
4626 _vosrc="$_vosrc vo_dxr3.c"
4627 _vomodules="dxr3 $_vomodules"
4628 else
4629 _def_dxr3='#undef HAVE_DXR3'
4630 _novomodules="dxr3 $_novomodules"
4631 if test "$_mp1e" = auto ; then
4632 # we don't need mp1e
4633 _mp1e=no
4636 echores "$_dxr3"
4638 echocheck "libmp1e"
4639 if test "$_mmx" = no ; then
4640 # mp1e REQUIRES mmx!
4641 _mp1e=no
4643 if test "$_mp1e" != no ; then
4644 _mp1e=yes
4645 _def_mp1e='#define USE_MP1E'
4646 _ld_mp1e='libmp1e/libmp1e.a'
4647 _dep_mp1e='libmp1e/libmp1e.a'
4648 else
4649 _mp1e=no
4650 _def_mp1e='#undef USE_MP1E'
4651 _ld_mp1e=""
4652 _dep_mp1e=''
4654 echores "$_mp1e"
4657 echocheck "libfame"
4658 if test "$_fame" = auto ; then
4659 _fame=no
4660 test "$_dxr2" = yes && _fame=auto
4661 test "$_dxr3" = yes && _fame=auto
4662 test "$_dvb" = yes && _fame=auto
4664 if test "$_fame" = auto ; then
4665 _fame=no
4666 if test -d libfame && test -f libfame/fame.h ; then
4667 # disable fame on cygwin as no sense to port - atmos
4668 cygwin || _fame=yes
4669 else
4670 _res_comment="no fame dir"
4673 echores "$_fame"
4675 _def_fame='#undef USE_LIBFAME'
4676 if test "$_fame" = yes ; then
4677 _def_fame='#define USE_LIBFAME 1'
4678 _ld_fame='libfame/libfame.a'
4682 #########
4683 # AUDIO #
4684 #########
4687 echocheck "OSS Audio"
4688 if test "$_ossaudio" = auto ; then
4689 cat > $TMPC << EOF
4690 #include <sys/ioctl.h>
4691 $_inc_soundcard
4692 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4694 _ossaudio=no
4695 cc_check && _ossaudio=yes
4697 if test "$_ossaudio" = yes ; then
4698 _def_ossaudio='#define USE_OSS_AUDIO 1'
4699 _aosrc="$_aosrc ao_oss.c"
4700 _aomodules="oss $_aomodules"
4701 if test "$_linux_devfs" = yes; then
4702 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4703 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4704 else
4705 cat > $TMPC << EOF
4706 #include <sys/ioctl.h>
4707 $_inc_soundcard
4708 #ifdef OPEN_SOUND_SYSTEM
4709 int main(void) { return 0; }
4710 #else
4711 #error Not the real thing
4712 #endif
4714 _real_ossaudio=no
4715 cc_check && _real_ossaudio=yes
4716 if test "$_real_ossaudio" = yes; then
4717 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4718 elif netbsd || openbsd ; then
4719 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4720 _ld_arch="$_ld_arch -lossaudio"
4721 else
4722 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4724 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4726 else
4727 _def_ossaudio='#undef USE_OSS_AUDIO'
4728 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4729 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4730 _noaomodules="oss $_noaomodules"
4732 echores "$_ossaudio"
4735 echocheck "aRts"
4736 if test "$_arts" = auto ; then
4737 _arts=no
4738 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4740 cat > $TMPC << EOF
4741 #include <artsc.h>
4742 int main(void) { return 0; }
4744 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
4749 if test "$_arts" = yes ; then
4750 _def_arts='#define USE_ARTS 1'
4751 _aosrc="$_aosrc ao_arts.c"
4752 _aomodules="arts $_aomodules"
4753 _ld_arts=`artsc-config --libs`
4754 _inc_arts=`artsc-config --cflags`
4755 else
4756 _noaomodules="arts $_noaomodules"
4758 echores "$_arts"
4761 echocheck "EsounD"
4762 if test "$_esd" = auto ; then
4763 _esd=no
4764 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4766 cat > $TMPC << EOF
4767 #include <esd.h>
4768 int main(void) { return 0; }
4770 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes
4774 echores "$_esd"
4776 if test "$_esd" = yes ; then
4777 _def_esd='#define USE_ESD 1'
4778 _aosrc="$_aosrc ao_esd.c"
4779 _aomodules="esd $_aomodules"
4780 _ld_esd=`esd-config --libs`
4781 _inc_esd=`esd-config --cflags`
4783 echocheck "esd_get_latency()"
4784 cat > $TMPC << EOF
4785 #include <esd.h>
4786 int main(void) { return esd_get_latency(0); }
4788 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4789 echores "$_esd_latency"
4790 else
4791 _def_esd='#undef USE_ESD'
4792 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4793 _noaomodules="esd $_noaomodules"
4796 echocheck "Polyp"
4797 if test "$_polyp" = auto ; then
4798 _polyp=no
4799 if pkg-config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
4801 cat > $TMPC << EOF
4802 #include <polyp/polyplib.h>
4803 #include <polyp/mainloop.h>
4804 #include <polyp/polyplib-error.h>
4805 int main(void) { return 0; }
4807 cc_check `pkg-config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
4811 echores "$_polyp"
4813 if test "$_polyp" = yes ; then
4814 _def_polyp='#define USE_POLYP 1'
4815 _aosrc="$_aosrc ao_polyp.c"
4816 _aomodules="polyp $_aomodules"
4817 _ld_polyp=`pkg-config --libs polyplib polyplib-error polyplib-mainloop`
4818 _inc_polyp=`pkg-config --cflags polyplib polyplib-error polyplib-mainloop`
4819 else
4820 _def_polyp='#undef USE_POLYP'
4821 _noaomodules="polyp $_noaomodules"
4825 echocheck "JACK"
4826 if test "$_jack" = auto ; then
4827 _jack=yes
4829 cat > $TMPC << EOF
4830 #include <jack/jack.h>
4831 int main(void) { jack_client_new("test"); return 0; }
4833 if cc_check -ljack ; then
4834 _ld_jack="-ljack"
4835 elif cc_check `pkg-config --libs --cflags --silence-errors jack` ; then
4836 _ld_jack="`pkg-config --libs jack`"
4837 _inc_jack="`pkg-config --cflags jack`"
4838 else
4839 _jack=no
4843 if test "$_jack" = yes ; then
4844 _def_jack='#define USE_JACK 1'
4845 _aosrc="$_aosrc ao_jack.c"
4846 _aomodules="jack $_aomodules"
4847 else
4848 _noaomodules="jack $_noaomodules"
4850 echores "$_jack"
4852 echocheck "OpenAL"
4853 if test "$_openal" = auto ; then
4854 _openal=no
4855 cat > $TMPC << EOF
4856 #include <AL/al.h>
4857 int main(void) {
4858 alSourceQueueBuffers(0, 0, 0);
4859 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4860 return 0;
4863 if cc_check -lopenal ; then
4864 _ld_openal="-lopenal"
4865 _openal=yes
4868 if test "$_openal" = yes ; then
4869 _def_openal='#define USE_OPENAL 1'
4870 _aosrc="$_aosrc ao_openal.c"
4871 _aomodules="openal $_aomodules"
4872 else
4873 _noaomodules="openal $_noaomodules"
4875 echores "$_openal"
4877 echocheck "ALSA audio"
4878 if test "$_alsa" != no ; then
4879 _alsa=no
4880 cat > $TMPC << EOF
4881 #include <sys/asoundlib.h>
4882 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
4883 #error "alsa version != 0.5.x"
4884 #endif
4885 int main(void) { return 0; }
4887 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
4889 cat > $TMPC << EOF
4890 #include <sys/asoundlib.h>
4891 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4892 #error "alsa version != 0.9.x"
4893 #endif
4894 int main(void) { return 0; }
4896 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
4897 cat > $TMPC << EOF
4898 #include <alsa/asoundlib.h>
4899 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4900 #error "alsa version != 0.9.x"
4901 #endif
4902 int main(void) { return 0; }
4904 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
4906 cat > $TMPC << EOF
4907 #include <sys/asoundlib.h>
4908 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4909 #error "alsa version != 1.0.x"
4910 #endif
4911 int main(void) { return 0; }
4913 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
4914 cat > $TMPC << EOF
4915 #include <alsa/asoundlib.h>
4916 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4917 #error "alsa version != 1.0.x"
4918 #endif
4919 int main(void) { return 0; }
4921 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
4923 _def_alsa5='#undef HAVE_ALSA5'
4924 _def_alsa9='#undef HAVE_ALSA9'
4925 _def_alsa1x='#undef HAVE_ALSA1X'
4926 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
4927 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
4928 if test "$_alsaver" ; then
4929 _alsa=yes
4930 if test "$_alsaver" = '0.5.x' ; then
4931 _aosrc="$_aosrc ao_alsa5.c"
4932 _aomodules="alsa5 $_aomodules"
4933 _def_alsa5='#define HAVE_ALSA5 1'
4934 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4935 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
4936 elif test "$_alsaver" = '0.9.x-sys' ; then
4937 _aosrc="$_aosrc ao_alsa.c"
4938 _aomodules="alsa $_aomodules"
4939 _def_alsa9='#define HAVE_ALSA9 1'
4940 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4941 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
4942 elif test "$_alsaver" = '0.9.x-alsa' ; then
4943 _aosrc="$_aosrc ao_alsa.c"
4944 _aomodules="alsa $_aomodules"
4945 _def_alsa9='#define HAVE_ALSA9 1'
4946 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4947 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
4948 elif test "$_alsaver" = '1.0.x-sys' ; then
4949 _aosrc="$_aosrc ao_alsa.c"
4950 _aomodules="alsa $_aomodules"
4951 _def_alsa1x="#define HAVE_ALSA1X 1"
4952 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4953 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
4954 elif test "$_alsaver" = '1.0.x-alsa' ; then
4955 _aosrc="$_aosrc ao_alsa.c"
4956 _aomodules="alsa $_aomodules"
4957 _def_alsa1x="#define HAVE_ALSA1X 1"
4958 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4959 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
4960 else
4961 _alsa=no
4962 _res_comment="unknown version"
4964 _ld_alsa="-lasound $_ld_dl $_ld_pthread"
4965 else
4966 _noaomodules="alsa $_noaomodules"
4968 echores "$_alsa"
4971 echocheck "Sun audio"
4972 if test "$_sunaudio" = auto ; then
4973 cat > $TMPC << EOF
4974 #include <sys/types.h>
4975 #include <sys/audioio.h>
4976 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4978 _sunaudio=no
4979 cc_check && _sunaudio=yes
4981 if test "$_sunaudio" = yes ; then
4982 _def_sunaudio='#define USE_SUN_AUDIO 1'
4983 _aosrc="$_aosrc ao_sun.c"
4984 _aomodules="sun $_aomodules"
4985 else
4986 _def_sunaudio='#undef USE_SUN_AUDIO'
4987 _noaomodules="sun $_noaomodules"
4989 echores "$_sunaudio"
4992 echocheck "Sun mediaLib"
4993 if test "$_mlib" = auto ; then
4994 _mlib=no
4995 test -z "$_mlibdir" && _mlibdir=/opt/SUNWmlib
4996 cat > $TMPC << EOF
4997 #include <mlib.h>
4998 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5000 cc_check -I${_mlibdir}/include -L${_mlibdir}/lib -lmlib && _mlib=yes
5002 if test "$_mlib" = yes ; then
5003 _def_mlib='#define HAVE_MLIB 1'
5004 _inc_mlib=" -I${_mlibdir}/include "
5005 _ld_mlib=" -L${_mlibdir}/lib -R${_mlibdir}/lib -lmlib "
5006 else
5007 _def_mlib='#undef HAVE_MLIB'
5009 echores "$_mlib"
5012 echocheck "SGI audio"
5013 if test "$_sgiaudio" = auto ; then
5014 # check for SGI audio
5015 cat > $TMPC << EOF
5016 #include <dmedia/audio.h>
5017 int main(void) { return 0; }
5019 _sgiaudio=no
5020 cc_check && _sgiaudio=yes
5022 if test "$_sgiaudio" = "yes" ; then
5023 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5024 _ld_sgiaudio='-laudio'
5025 _aosrc="$_aosrc ao_sgi.c"
5026 _aomodules="sgi $_aomodules"
5027 else
5028 _def_sgiaudio='#undef USE_SGI_AUDIO'
5029 _noaomodules="sgi $_noaomodules"
5031 echores "$_sgiaudio"
5034 echocheck "VCD support"
5035 if linux || bsdos || freebsd || netbsd || sunos || darwin ; then
5036 _inputmodules="vcd $_inputmodules"
5037 _def_vcd='#define HAVE_VCD 1'
5038 _vcd="yes"
5039 else
5040 _def_vcd='#undef HAVE_VCD'
5041 _noinputmodules="vcd $_noinputmodules"
5042 _res_comment="not supported on this OS"
5043 _vcd="no"
5045 echores "$_vcd"
5048 echocheck "DVD support (libmpdvdkit2)"
5049 if test "$_dvdkit" = auto ; then
5050 _dvdkit=no
5051 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux; then
5052 test -f "./libmpdvdkit2/Makefile" && _dvdkit=yes
5055 if test "$_dvdkit" = yes ; then
5056 if test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5057 _inputmodules="mpdvdkit2 $_inputmodules"
5058 _dvdread=libmpdvdkit2
5059 else
5060 _noinputmodules="mpdvdkit2 $_noinputmodules"
5062 _def_dvd_linux='#undef HAVE_LINUX_DVD_STRUCT'
5063 _def_dvd_bsd='#undef HAVE_BSD_DVD_STRUCT'
5064 _dev_dvd_openbsd='#undef HAVE_OPENBSD_DVD_STRUCT'
5065 _def_dvd_darwin='#undef DARWIN_DVD_IOCTL'
5066 if linux || netbsd || openbsd || bsdos ; then
5067 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5068 if openbsd ; then
5069 _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5071 else
5072 if freebsd ; then
5073 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5074 else
5075 if darwin ; then
5076 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5080 else
5081 _noinputmodules="mpdvdkit2 $_noinputmodules"
5083 echores "$_dvdkit"
5085 echocheck "DVD support (libdvdread)"
5086 if test "$_dvdread" = auto ; then
5087 cat > $TMPC << EOF
5088 #include <inttypes.h>
5089 #include <dvdread/dvd_reader.h>
5090 #include <dvdread/ifo_types.h>
5091 #include <dvdread/ifo_read.h>
5092 #include <dvdread/nav_read.h>
5093 int main(void) { return 0; }
5095 _dvdread=no
5096 if test "$_dl" = yes; then
5097 cc_check \
5098 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread $_ld_dl && \
5099 _dvdread=yes
5102 _def_mpdvdkit="#undef USE_MPDVDKIT"
5103 case "$_dvdread" in
5104 yes)
5105 _largefiles=yes
5106 _def_dvdread='#define USE_DVDREAD 1'
5107 _ld_dvdread='-ldvdread'
5108 _inputmodules="dvdread $_inputmodules"
5109 _have_dvd=yes
5112 _def_dvdread='#undef USE_DVDREAD'
5113 _noinputmodules="dvdread $_noinputmodules"
5115 libmpdvdkit2)
5116 _largefiles=yes
5117 _def_dvdread='#define USE_DVDREAD 1'
5118 _ld_dvdread='-Llibmpdvdkit2 -lmpdvdkit'
5119 _noinputmodules="dvdread $_noinputmodules"
5120 _def_mpdvdkit="#define USE_MPDVDKIT 2"
5121 _have_dvd=yes
5122 _dvdread=no
5123 _res_comment="disabled by libmpdvdkit2"
5125 esac
5126 echores "$_dvdread"
5128 if test "$_have_dvd" = yes ; then
5129 _def_have_dvd='#define HAVE_DVD 1'
5130 else
5131 _def_have_dvd='#undef HAVE_DVD'
5134 # dvdnav disabled, it does not work
5135 # echocheck "DVD support (libdvdnav)"
5136 # if test "$_dvdnav" = yes ; then
5137 # cat > $TMPC <<EOF
5138 # #include <dvdnav.h>
5139 # int main(void) { dvdnav_t *dvd=0; return 0; }
5140 # EOF
5141 # _dvdnav=no
5142 # test -n "$_dvdnavdir" && _legal_dvdnavdir=-L$_dvdnavdir/.libs
5143 # if test -z "$_dvdnavconfig" ; then
5144 # if ( dvdnav-config --version ) >/dev/null 2>&1 ; then
5145 # _dvdnavconfig="dvdnav-config"
5146 # fi
5147 # fi
5148 # test -z "$_dvdnavdir" && test -n "$_dvdnavconfig" && _dvdnavdir=`$_dvdnavconfig --cflags`
5149 # _used_css=
5150 # test "$_dvdkit" = no && _used_css=$_ld_css
5151 # cc_check $_inc_extra -I$_dvdnavdir $_legal_dvdnavdir -ldvdnav $_used_css $_ld_dl $_ld_pthread && _dvdnav=yes
5152 # fi
5153 # if test "$_dvdnav" = yes ; then
5154 # _largefiles=yes
5155 # _def_dvdnav='#define USE_DVDNAV 1'
5156 # if test -n "$_legal_dvdnavdir" ; then
5157 # _ld_css="$_ld_css $_legal_dvdnavdir -ldvdnav"
5158 # elif test -n "$_dvdnavconfig" ; then
5159 # _ld_css="$_ld_css `$_dvdnavconfig --libs`"
5160 # else
5161 # _ld_css="$_ld_css -ldvdnav"
5162 # fi
5163 # if test -n "$_dvdnavconfig" ; then
5164 # _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
5165 # _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
5166 # fi
5167 # if test -n "$_dvdnavdir" ; then
5168 # _inc_extra="$_inc_extra -I$_dvdnavdir"
5169 # fi
5170 # _inputmodules="dvdnav $_inputmodules"
5171 # else
5172 # _def_dvdnav='#undef USE_DVDNAV'
5173 # _noinputmodules="dvdnav $_noinputmodules"
5174 # fi
5175 # echores "$_dvdnav"
5177 echocheck "cdparanoia"
5178 if test "$_cdparanoia" = auto ; then
5179 cat > $TMPC <<EOF
5180 #include <cdda_interface.h>
5181 #include <cdda_paranoia.h>
5182 // This need a better test. How ?
5183 int main(void) { return 1; }
5185 _cdparanoia=no
5186 for _inc_tmp in "$_inc_cdparanoia" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5187 cc_check $_inc_tmp $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm && _inc_cdparanoia="$_inc_tmp" && _cdparanoia=yes && break
5188 done
5190 if test "$_cdparanoia" = yes ; then
5191 _def_cdparanoia='#define HAVE_CDDA'
5192 _inputmodules="cdda $_inputmodules"
5193 _ld_cdparanoia="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
5194 openbsd && _ld_cdparanoia="$_ld_cdparanoia -lutil"
5195 else
5196 _def_cdparanoia='#undef HAVE_CDDA'
5197 _noinputmodules="cdda $_noinputmodules"
5199 echores "$_cdparanoia"
5202 echocheck "libcdio"
5203 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5204 if pkg-config --exists libcdio ; then
5205 cat > $TMPC << EOF
5206 #include <stdio.h>
5207 #include <cdio/version.h>
5208 #include <cdio/cdda.h>
5209 #include <cdio/paranoia.h>
5210 int main()
5212 printf("%s\n", CDIO_VERSION);
5213 return 0;
5217 _libcdio=no
5218 for _inc_tmp in "$_inc_libcdio" "-I/usr/include/cdio" "-I/usr/local/include/cdio" ; do
5219 cc_check `pkg-config --cflags --libs libcdio_paranoia` $_inc_tmp $_ld_lm \
5220 && _inc_libcdio="$_inc_tmp" && ( $TMPO >> "$TMPLOG" ) \
5221 && _libcdio=yes && break
5222 done
5223 else
5224 _libcdio=no
5227 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5228 _def_libcdio='#define HAVE_LIBCDIO'
5229 _def_cdparanoia='#define HAVE_CDDA'
5230 _def_havelibcdio='yes'
5231 _inputmodules="cdda $_inputmodules"
5232 _inc_libcdio=`pkg-config --cflags libcdio`
5233 _ld_libcdio=`pkg-config --libs libcdio_paranoia`
5234 else
5235 if test "$_cdparanoia" = yes ; then
5236 _res_comment="using cdparanoia"
5238 _def_libcdio='#undef HAVE_LIBCDIO'
5239 _def_havelibcdio='no'
5241 echores "$_libcdio"
5244 echocheck "freetype >= 2.0.9"
5246 # freetype depends on iconv
5247 if test "$_iconv" = no ; then
5248 _freetype=no
5249 _res_comment="iconv support needed"
5252 if test "$_freetype" = auto ; then
5253 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5254 cat > $TMPC << EOF
5255 #include <stdio.h>
5256 #include <ft2build.h>
5257 #include FT_FREETYPE_H
5258 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5259 #error "Need FreeType 2.0.9 or newer"
5260 #endif
5261 int main()
5263 FT_Library library;
5264 FT_Int major=-1,minor=-1,patch=-1;
5265 int err=FT_Init_FreeType(&library);
5266 if(err){
5267 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5268 exit(err);
5270 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5271 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5272 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5273 (int)major,(int)minor,(int)patch );
5274 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5275 printf("Library and header version mismatch! Fix it in your distribution!\n");
5276 exit(1);
5278 return 0;
5281 _freetype=no
5282 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5283 else
5284 _freetype=no
5287 if test "$_freetype" = yes ; then
5288 _def_freetype='#define HAVE_FREETYPE'
5289 _inc_freetype=`$_freetypeconfig --cflags`
5290 _ld_freetype=`$_freetypeconfig --libs`
5291 else
5292 _def_freetype='#undef HAVE_FREETYPE'
5294 echores "$_freetype"
5296 if test "$_freetype" = no ; then
5297 _fontconfig=no
5298 _res_comment="freetype support needed"
5300 echocheck "fontconfig"
5301 if test "$_fontconfig" = auto ; then
5302 cat > $TMPC << EOF
5303 #include <stdio.h>
5304 #include <fontconfig/fontconfig.h>
5305 int main()
5307 int err = FcInit();
5308 if(err == FcFalse){
5309 printf("Couldn't initialize fontconfig lib\n");
5310 exit(err);
5312 return 0;
5316 _fontconfig=yes
5317 if cc_check -lfontconfig ; then
5318 _ld_fontconfig="-lfontconfig"
5319 elif cc_check `pkg-config --silence-errors --cflags --libs fontconfig` ; then
5320 _inc_fontconfig=`pkg-config --cflags fontconfig`
5321 _ld_fontconfig=`pkg-config --libs fontconfig`
5322 else
5323 _fontconfig=no
5326 if test "$_fontconfig" = yes ; then
5327 _def_fontconfig='#define HAVE_FONTCONFIG'
5328 else
5329 _def_fontconfig='#undef HAVE_FONTCONFIG'
5331 echores "$_fontconfig"
5333 echocheck "fribidi with charsets"
5334 if test "$_fribidi" = auto ; then
5335 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5336 cat > $TMPC << EOF
5337 #include <stdio.h>
5338 /* workaround for fribidi 0.10.4 and below */
5339 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5340 #include <fribidi/fribidi.h>
5341 int main()
5343 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5344 printf("Fribidi headers are not consistents with the library!\n");
5345 exit(1);
5347 return 0;
5350 _fribidi=no
5351 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5352 else
5353 _fribidi=no
5356 if test "$_fribidi" = yes ; then
5357 _def_fribidi='#define USE_FRIBIDI'
5358 _inc_fribidi=`$_fribidiconfig --cflags`
5359 _ld_fribidi=`$_fribidiconfig --libs`
5360 else
5361 _def_fribidi='#undef USE_FRIBIDI'
5363 echores "$_fribidi"
5366 echocheck "ENCA"
5367 if test "$_enca" = auto ; then
5368 cat > $TMPC << EOF
5369 #include <enca.h>
5370 int main()
5372 const char **langs;
5373 size_t langcnt;
5374 langs = enca_get_languages(&langcnt);
5375 return 0;
5378 _enca=no
5379 cc_check -lenca $_ld_lm && _enca=yes
5381 if test "$_enca" = yes ; then
5382 _def_enca='#define HAVE_ENCA 1'
5383 _ld_enca='-lenca'
5384 else
5385 _def_enca='#undef HAVE_ENCA'
5387 echores "$_enca"
5390 echocheck "zlib"
5391 cat > $TMPC << EOF
5392 #include <zlib.h>
5393 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5395 _zlib=no
5396 cc_check -lz && _zlib=yes
5397 if test "$_zlib" = yes ; then
5398 _def_zlib='#define HAVE_ZLIB 1'
5399 _ld_zlib='-lz'
5400 else
5401 _def_zlib='#undef HAVE_ZLIB'
5403 echores "$_zlib"
5406 echocheck "RTC"
5407 if test "$_rtc" = auto ; then
5408 cat > $TMPC << EOF
5409 #include <sys/ioctl.h>
5410 #ifdef __linux__
5411 #include <linux/rtc.h>
5412 #else
5413 #include <rtc.h>
5414 #define RTC_PIE_ON RTCIO_PIE_ON
5415 #endif
5416 int main(void) { return RTC_PIE_ON; }
5418 _rtc=no
5419 cc_check && _rtc=yes
5420 ppc && _rtc=no
5422 if test "$_rtc" = yes ; then
5423 _def_rtc='#define HAVE_RTC 1'
5424 else
5425 _def_rtc='#undef HAVE_RTC'
5427 echores "$_rtc"
5430 echocheck "external liblzo support"
5431 if test "$_liblzo" = auto ; then
5432 _liblzo=no
5433 cat > $TMPC << EOF
5434 #include <lzo1x.h>
5435 int main(void) { lzo_init();return 0; }
5437 cc_check -llzo && _liblzo=yes
5439 if test "$_liblzo" = yes ; then
5440 _def_liblzo='#define USE_LIBLZO 1'
5441 _ld_liblzo='-llzo'
5442 _codecmodules="liblzo $_codecmodules"
5443 else
5444 _def_liblzo='#undef USE_LIBLZO'
5445 _nocodecmodules="liblzo $_nocodecmodules"
5447 echores "$_liblzo"
5450 echocheck "mad support"
5451 if test "$_mad" = auto ; then
5452 _mad=no
5453 cat > $TMPC << EOF
5454 #include <mad.h>
5455 int main(void) { return 0; }
5457 cc_check $_madlibdir -lmad && _mad=yes
5459 if test "$_mad" = yes ; then
5460 _def_mad='#define USE_LIBMAD 1'
5461 _ld_mad='-lmad'
5462 _codecmodules="libmad $_codecmodules"
5463 else
5464 _def_mad='#undef USE_LIBMAD'
5465 _nocodecmodules="libmad $_nocodecmodules"
5467 echores "$_mad"
5469 echocheck "Toolame"
5470 if test "$_toolame" = auto ; then
5471 cat > $TMPC <<EOF
5472 #include <toolame.h>
5473 int main(void) { toolame_init(); return 0; }
5475 _toolame=no
5476 _toolame_extraflags=""
5477 _toolame_lib="-ltoolame"
5478 if test -n "$_toolamedir"; then
5479 _toolame_extraflags="-I$_toolamedir -L$_toolamedir"
5481 cc_check $_toolame_extraflags $_toolame_lib $_ld_lm && _toolame=yes
5483 if test "$_toolame" = yes ; then
5484 _def_toolame='#define HAVE_TOOLAME 1'
5485 _codecmodules="$_codecmodules toolame"
5486 else
5487 _def_toolame='#undef HAVE_TOOLAME'
5488 _toolame_lib=""
5489 _nocodecmodules="toolame $_nocodecmodules"
5491 if test "$_toolamedir" ; then
5492 _res_comment="using $_toolamedir"
5494 echores "$_toolame"
5496 echocheck "Twolame"
5497 if test "$_twolame" = auto ; then
5498 cat > $TMPC <<EOF
5499 #include <twolame.h>
5500 int main(void) { twolame_init(); return 0; }
5502 _twolame=no
5503 _twolame_lib="-ltwolame"
5504 cc_check $_twolame_lib $_ld_lm && _twolame=yes
5506 if test "$_twolame" = yes ; then
5507 _def_twolame='#define HAVE_TWOLAME 1'
5508 _codecmodules="$_codecmodules twolame"
5509 else
5510 _def_twolame='#undef HAVE_TWOLAME'
5511 _twolame_lib=""
5512 _nocodecmodules="twolame $_nocodecmodules"
5514 echores "$_twolame"
5516 echocheck "OggVorbis support"
5517 if test "$_tremor_internal" = yes; then
5518 _vorbis=yes
5519 elif test "$_vorbis" = auto; then
5520 _vorbis=no
5521 cat > $TMPC << EOF
5522 #include <vorbis/codec.h>
5523 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5525 cc_check -lvorbis -logg $_ld_lm && _vorbis=yes
5527 if test "$_vorbis" = yes ; then
5528 _def_vorbis='#define HAVE_OGGVORBIS 1'
5529 if test "$_tremor_internal" = yes ; then
5530 # do not set _ld_vorbis as it is resolved separately
5531 # mp3lame support for vorbis is deprecated so don't care
5532 _def_tremor='#define TREMOR 1'
5533 if test "$_tremor_low" = yes ; then
5534 _tremor_flags='-D_LOW_ACCURACY_'
5535 else
5536 _tremor_flags=''
5538 _codecmodules="tremor(internal) $_codecmodules"
5539 elif test "$_tremor" = yes ; then
5540 _def_tremor='#define TREMOR 1'
5541 _ld_vorbis='-lvorbisidec'
5542 _codecmodules="tremor $_codecmodules"
5543 else
5544 _def_tremor='#undef TREMOR'
5545 _ld_vorbis='-lvorbis -logg'
5546 _codecmodules="libvorbis $_codecmodules"
5548 else
5549 _def_vorbis='#undef HAVE_OGGVORBIS'
5550 _def_tremor='#undef TREMOR'
5551 _nocodecmodules="libvorbis $_nocodecmodules"
5553 if test "$_vorbis" = yes -a "$_tremor_internal" = yes -a "$_tremor_low" = yes ; then
5554 _res_comment="internal low accuracy Tremor"
5555 elif test "$_vorbis" = yes -a "$_tremor_internal" = yes ; then
5556 _res_comment="internal Tremor"
5557 elif test "$_vorbis" = yes -a "$_tremor" = yes ; then
5558 _res_comment="Tremor"
5560 echores "$_vorbis"
5562 echocheck "libspeex (version >= 1.1 required)"
5563 if test "$_speex" = auto ; then
5564 _speex=no
5565 cat > $TMPC << EOF
5566 #include <speex/speex.h>
5567 int main(void) {
5568 SpeexBits bits;
5569 void *dec;
5570 speex_decode_int(dec, &bits, dec);
5573 cc_check -lspeex $_ld_lm && _speex=yes
5575 if test "$_speex" = yes ; then
5576 _def_speex='#define HAVE_SPEEX 1'
5577 _ld_speex='-lspeex'
5578 _codecmodules="speex $_codecmodules"
5579 else
5580 _def_speex='#undef HAVE_SPEEX'
5581 _nocodecmodules="speex $_nocodecmodules"
5583 echores "$_speex"
5585 echocheck "OggTheora support"
5586 if test "$_theora" = auto ; then
5587 _theora=no
5588 cat > $TMPC << EOF
5589 #include <theora/theora.h>
5590 #include <string.h>
5591 int main(void)
5593 /* theora is in flux, make sure that all interface routines and
5594 * datatypes exist and work the way we expect it, so we don't break
5595 * mplayer */
5596 ogg_packet op;
5597 theora_comment tc;
5598 theora_info inf;
5599 theora_state st;
5600 yuv_buffer yuv;
5601 int r;
5602 double t;
5604 theora_info_init (&inf);
5605 theora_comment_init (&tc);
5607 return 0;
5609 /* we don't want to execute this kind of nonsense; just for making sure
5610 * that compilation works... */
5611 memset(&op, 0, sizeof(op));
5612 r = theora_decode_header (&inf, &tc, &op);
5613 r = theora_decode_init (&st, &inf);
5614 t = theora_granule_time (&st, op.granulepos);
5615 r = theora_decode_packetin (&st, &op);
5616 r = theora_decode_YUVout (&st, &yuv);
5617 theora_clear (&st);
5619 return 0;
5622 for _ld_theora in "`pkg-config --silence-errors --libs --cflags theora`" "-ltheora"; do
5623 cc_check $_ld_theora && _theora=yes && break
5624 done
5625 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5626 for _ld_theora in "`pkg-config --silence-errors --libs --cflags theora`" "-ltheora"; do
5627 cc_check -I. tremor/bitwise.c $_ld_theora && _theora=yes && break
5628 done
5631 if test "$_theora" = yes ; then
5632 _def_theora='#define HAVE_OGGTHEORA 1'
5633 _codecmodules="libtheora $_codecmodules"
5634 # when --enable-theora is forced, we'd better provide a probably sane
5635 # $_ld_theora than nothing
5636 test -z "$_ld_theora" && _ld_theora="-ltheora -logg"
5637 else
5638 _def_theora='#undef HAVE_OGGTHEORA'
5639 _nocodecmodules="libtheora $_nocodecmodules"
5640 _ld_theora=""
5642 echores "$_theora"
5644 echocheck "mp3lib support"
5645 if test "$_mp3lib" = yes ; then
5646 _def_mp3lib='#define USE_MP3LIB 1'
5647 _codecmodules="mp3lib $_codecmodules"
5648 else
5649 _def_mp3lib='#undef USE_MP3LIB'
5650 _nocodecmodules="mp3lib $_nocodecmodules"
5652 echores "$_mp3lib"
5654 echocheck "liba52 support"
5655 if test "$_liba52" = yes ; then
5656 _def_liba52='#define USE_LIBA52 1'
5657 _codecmodules="liba52 $_codecmodules"
5658 else
5659 _def_liba52='#undef USE_LIBA52'
5660 _nocodecmodules="liba52 $_nocodecmodules"
5662 echores "$_liba52"
5664 echocheck "libdts support"
5665 if test "$_libdts" = auto ; then
5666 _libdts=no
5667 cat > $TMPC << EOF
5668 #include <inttypes.h>
5669 #include <dts.h>
5670 int main(void) { dts_init (0); return 0; }
5672 cc_check $_inc_libdts $_ld_libdts -ldts $_ld_lm && _libdts=yes
5674 if test "$_libdts" = yes ; then
5675 _def_libdts='#define CONFIG_DTS 1'
5676 _ld_libdts="$_ld_libdts -ldts"
5677 _codecmodules="libdts $_codecmodules"
5678 else
5679 _def_libdts='#undef CONFIG_DTS'
5680 _nocodecmodules="libdts $_nocodecmodules"
5682 echores "$_libdts"
5684 echocheck "libmpeg2 support"
5685 if test "$_libmpeg2" = yes ; then
5686 _def_libmpeg2='#define USE_LIBMPEG2 1'
5687 _codecmodules="libmpeg2 $_codecmodules"
5688 else
5689 _def_libmpeg2='#undef USE_LIBMPEG2'
5690 _nocodecmodules="libmpeg2 $_nocodecmodules"
5692 echores "$_libmpeg2"
5694 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5695 if test "$_musepack" = auto ; then
5696 _musepack=no
5697 cat > $TMPC << EOF
5698 #include <mpcdec/mpcdec.h>
5699 int main(void) {
5700 mpc_streaminfo info;
5701 mpc_decoder decoder;
5702 mpc_decoder_set_streaminfo(&decoder, &info);
5703 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5706 cc_check -lmpcdec $_ld_lm && _musepack=yes
5708 if test "$_musepack" = yes ; then
5709 _def_musepack='#define HAVE_MUSEPACK 1'
5710 _ld_musepack='-lmpcdec'
5711 _codecmodules="musepack $_codecmodules"
5712 else
5713 _def_musepack='#undef HAVE_MUSEPACK'
5714 _nocodecmodules="musepack $_nocodecmodules"
5716 echores "$_musepack"
5719 echocheck "FAAC (AAC encoder) support"
5720 if test "$_faac" = auto ; then
5721 cat > $TMPC <<EOF
5722 #include <inttypes.h>
5723 #include <faac.h>
5724 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5726 _faac=no
5727 for _ld_tmp in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5728 cc_check -c -O4 $_ld_tmp $_ld_lm && _ld_faac="$_ld_tmp" && _faac=yes && break
5729 done
5731 if test "$_faac" = yes ; then
5732 _def_faac="#define HAVE_FAAC 1"
5733 _def_lavc_faac="#define CONFIG_FAAC 1"
5734 _codecmodules="faac $_codecmodules"
5735 else
5736 _def_faac="#undef HAVE_FAAC"
5737 _nocodecmodules="faac $_nocodecmodules"
5739 echores "$_faac"
5741 echocheck "internal FAAD2 (AAC) support"
5742 if test "$_faad_internal" = auto ; then
5743 if x86 && test cc_vendor=gnu; then
5744 case $cc_version in
5745 3.1*|3.2) # ICE/insn with these versions
5746 _faad_internal=no
5747 _res_comment="broken gcc"
5750 _faad_internal=yes
5752 esac
5753 else
5754 _faad_internal=yes
5757 if test "$_faad_internal" = yes ; then
5758 _def_faad_internal="#define USE_INTERNAL_FAAD 1"
5759 _faad_external=no
5760 else
5761 _def_faad_internal="#undef USE_INTERNAL_FAAD"
5762 _inc_faad=
5764 echores "$_faad_internal"
5767 echocheck "external FAAD2 (AAC) support"
5768 if test "$_faad_external" != no ; then
5769 _ld_faad='-lfaad'
5770 _inc_faad="$_inc_extra"
5771 # external faad: check if it's really faad2 :)
5772 if test "$_faad_external" = auto ; then
5773 _faad_external=no
5774 cat > $TMPC << EOF
5775 #include <faad.h>
5776 #ifndef FAAD_MIN_STREAMSIZE
5777 #error Too old version
5778 #endif
5779 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5781 cc_check $_inc_faad $_ld_faad $_ld_lm && _faad_external=yes
5784 echores "$_faad_external"
5786 if test "$_faad_external" = yes; then
5787 _def_faad='#define HAVE_FAAD 1'
5788 _codecmodules="faad2(external) $_codecmodules"
5789 elif test "$_faad_internal" = yes; then
5790 _def_faad='#define HAVE_FAAD 1'
5791 _codecmodules="faad2(internal) $_codecmodules"
5792 else
5793 _def_faad='#undef HAVE_FAAD'
5794 _nocodecmodules="faad2 $_nocodecmodules"
5795 _ld_faad=
5799 echocheck "LADSPA plugin support"
5800 if test "$_ladspa" = auto ; then
5801 cat > $TMPC <<EOF
5802 #include <stdio.h>
5803 #include <ladspa.h>
5804 int main(void) {
5805 const LADSPA_Descriptor *ld = NULL;
5806 return 0;
5809 _ladspa=no
5810 cc_check && _ladspa=yes
5812 if test "$_ladspa" = yes; then
5813 _def_ladspa="#define HAVE_LADSPA"
5814 _afsrc="$_afsrc af_ladspa.c"
5815 _afmodules="ladspa $_afmodules"
5816 else
5817 _def_ladspa="#undef HAVE_LADSPA"
5818 _noafmodules="ladspa $_noafmodules"
5820 echores "$_ladspa"
5823 if test "$_win32" = auto ; then
5824 if x86 ; then
5825 qnx && _win32=no
5826 else
5827 _win32=no # x86 arch only
5831 if test "$_win32" != no ; then
5832 if test -z "$_win32libdir" ; then
5833 for I in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5834 if test -d "$I" ; then
5835 _win32libdir="$I"
5836 break;
5838 done
5839 # Fall back on a subfolder of the current dir on Windows
5840 mingw32 && _win32libdir="codecs"
5844 echocheck "Win32 codec DLL support"
5845 if test "$_win32" = auto ; then
5846 _win32=no
5847 test -n "$_win32libdir" && _win32=yes
5849 if test "$_win32" = yes ; then
5850 _def_win32='#define USE_WIN32DLL 1'
5851 _res_comment="using $_win32libdir"
5852 else
5853 _def_win32='#undef USE_WIN32DLL'
5854 _nocodecmodules="win32 $_nocodecmodules"
5855 _dshow=no
5857 echores "$_win32"
5859 if test "$_win32" != no ; then
5860 _def_win32_loader='#undef WIN32_LOADER'
5861 echocheck "Win32 loader support"
5862 _ld_win32='loader/libloader.a'
5863 _dep_win32='loader/libloader.a'
5864 _codecmodules="win32 $_codecmodules"
5865 if openbsd ; then
5866 x86 && _ld_win32="$_ld_win32 -li386"
5868 if not win32 ; then
5869 _def_win32_loader='#define WIN32_LOADER 1'
5870 else
5871 _ld_win32libs="$_ld_win32libs -ladvapi32 -lole32"
5872 _res_comment="using native windows"
5875 echores "$_win32"
5878 echocheck "DirectShow"
5879 if false ; then
5881 if test "$_dshow" != no ; then
5882 _dshow=no
5883 # check if compiler supports C++ and C++-libs are installed correctly
5884 cat > "$TMPCPP" << EOF
5885 #include <string>
5886 class myclass {
5887 private: int ret;
5888 public: int myreturn(void);
5890 int myclass::myreturn(void) { ret = 0; return ret ; }
5891 int main(void) { myclass myobject; return myobject.myreturn(); }
5893 if cxx_check && tmp_run ; then
5894 _dshow=yes
5895 echores "yes (C++ is ok)"
5896 else
5897 echores "no"
5898 cat << EOF
5900 Your C++ runtime environment is broken.
5902 Hints: Does $_cc support C++? Do you have you a C++ compiler installed?
5903 Are the C++ libraries correctly installed?
5904 Check for libstdc++ and in (/etc/)ld.so.conf.
5906 If you do not need DirectShow support, you can also use:
5907 ./configure --disable-dshow <your-normal-configure-options>
5908 to disable building the C++ based DirectShow code.
5911 die "$_cc's C++ is broken"
5917 echores "$_dshow"
5919 if test "$_dshow" = yes ; then
5920 _def_dshow='#define USE_DIRECTSHOW 1'
5921 _ld_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5922 _dep_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5923 _codecmodules="dshow/dmo $_codecmodules"
5924 else
5925 _def_dshow='#undef USE_DIRECTSHOW'
5926 _nocodecmodules="dshow/dmo $_nocodecmodules"
5930 echocheck "XAnim DLL"
5931 if test "$_xanim" = auto ; then
5932 _xanim=no
5933 _res_comment="dynamic loader support needed"
5934 if test "$_dl" = yes ; then
5935 _res_comment="no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html"
5936 if test -z "$_xanimlibdir" ; then
5937 for I in "$_libdir/codecs" /usr/local/lib/xanim/mods /usr/lib/xanim/mods /usr/lib/xanim $XANIM_MOD_DIR ; do
5938 if test -d "$I" ; then
5939 _xanimlibdir="$I"
5940 break;
5942 done
5944 test "$_xanimlibdir" && _xanim=yes
5947 if test "$_xanim" = yes ; then
5948 _def_xanim='#define USE_XANIM 1'
5949 _def_xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
5950 _codecmodules="xanim $_codecmodules"
5951 _res_comment="using $_xanimlibdir"
5952 else
5953 _def_xanim='#undef USE_XANIM'
5954 _def_xanim_path='#undef XACODEC_PATH'
5955 _nocodecmodules="xanim $_nocodecmodules"
5957 echores "$_xanim"
5959 echocheck "RealPlayer DLL"
5960 if test "$_real" = auto ; then
5961 _real=no
5962 _res_comment="dynamic loader support needed"
5963 if test "$_dl" = yes || test "$_win32" = yes ; then
5964 # if test "$_dl" = yes ; then
5965 _res_comment="tested only on Linux/FreeBSD/NetBSD/Cygwin/MinGW/Darwin"
5966 if linux || freebsd || netbsd || win32 || darwin ; then
5967 _res_comment="no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html"
5968 if test -z "$_reallibdir" ; then
5969 for I in "$_libdir/codecs" "$_libdir/real" /usr/lib/real \
5970 /usr/lib/RealPlayer{9,8,}/Codecs /usr/local/RealPlayer{9,8,}/Codecs \
5971 /usr/local/lib/RealPlayer{9,8,}/Codecs /opt/RealPlayer{9,8,}/{Real/,}Codecs \
5972 {~,}/Applications/RealOne\ Player.app/Contents/MacOS/Library/Codecs \
5973 "$_win32libdir"; do
5974 if test -d "$I" ; then
5975 _reallibdir="$I"
5976 break
5978 # Fall back on a subfolder of the current dir on Windows
5979 mingw32 && _reallibdir="codecs"
5980 done
5982 test "$_reallibdir" && _real=yes
5986 if test "$_real" = yes ; then
5987 _def_real='#define USE_REALCODECS 1'
5988 _def_real_path="#define REALCODEC_PATH \"$_reallibdir\""
5989 _codecmodules="real $_codecmodules"
5990 _res_comment="using $_reallibdir"
5991 else
5992 _def_real='#undef USE_REALCODECS'
5993 _def_real_path="#undef REALCODEC_PATH"
5994 _nocodecmodules="real $_nocodecmodules"
5996 echores "$_real"
5999 echocheck "LIVE555 Streaming Media libraries"
6000 if test "$_live" = auto && test "$_network" = yes ; then
6001 cat > $TMPCPP << EOF
6002 #include <liveMedia.hh>
6003 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1090195200)
6004 #error Please upgrade to version 2004.07.19 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6005 #endif
6006 int main(void) {}
6009 _live=no
6010 for I in "$_livelibdir" "$_libdir/live" "/usr/lib/live" "/usr/local/live" "/usr/local/lib/live" ; do
6011 cxx_check -I$I/liveMedia/include -I$I/UsageEnvironment/include -I$I/groupsock/include && _livelibdir=$I && _live=yes && break
6012 done
6013 if test "$_live" != yes ; then
6014 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6015 _live_dist=yes
6019 if test "$_live" = yes && test "$_network" = yes ; then
6020 _res_comment="using $_livelibdir"
6021 _def_live='#define STREAMING_LIVE555 1'
6022 _live_libs_def="# LIVE555 Streaming Media libraries:
6023 LIVE_LIB_DIR = $_livelibdir
6024 LIVE_LIBS = \$(LIVE_LIB_DIR)/liveMedia/libliveMedia.a
6025 LIVE_LIBS += \$(LIVE_LIB_DIR)/groupsock/libgroupsock.a
6026 LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
6027 LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
6028 LIVE_LIBS += -lstdc++
6029 LIVE_INCLUDES = -I\$(LIVE_LIB_DIR)/liveMedia/include
6030 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/UsageEnvironment/include
6031 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/BasicUsageEnvironment/include
6032 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/groupsock/include"
6033 _ld_live='$(LIVE_LIBS)'
6034 _inputmodules="live555 $_inputmodules"
6035 elif test "$_live_dist" = yes && test "$_network" = yes ; then
6036 _res_comment="using distribution version"
6037 _live="yes"
6038 _def_live='#define STREAMING_LIVE555 1'
6039 _live_libs_def="# LIVE555 Streaming Media libraries:
6040 LIVE_LIB_DIR = $_livelibdir
6041 LIVE_LIBS = -lliveMedia
6042 LIVE_LIBS += -lgroupsock
6043 LIVE_LIBS += -lUsageEnvironment
6044 LIVE_LIBS += -lBasicUsageEnvironment
6045 LIVE_LIBS += -lstdc++
6046 LIVE_INCLUDES = -I/usr/include/liveMedia
6047 LIVE_INCLUDES += -I/usr/include/UsageEnvironment
6048 LIVE_INCLUDES += -I/usr/include/BasicUsageEnvironment
6049 LIVE_INCLUDES += -I/usr/include/groupsock"
6050 _ld_live='$(LIVE_LIBS)'
6051 _inputmodules="live555 $_inputmodules"
6052 else
6053 _def_live='#undef STREAMING_LIVE555'
6054 _noinputmodules="live555 $_noinputmodules"
6056 echores "$_live"
6059 echocheck "FFmpeg libavutil (static)"
6060 if test "$_libavutil" = auto ; then
6061 if test -d libavutil ; then
6062 _libavutil=yes
6063 else
6064 _libavutil=no
6067 echores "$_libavutil"
6069 echocheck "FFmpeg libavcodec (static)"
6070 if test "$_libavcodec" = auto ; then
6071 # Note: static linking is preferred to dynamic linking
6072 _libavcodec=no
6073 _res_comment="see DOCS/HTML/$_doc_lang/codecs.html"
6074 if test -d libavcodec && test -f libavcodec/utils.c ; then
6075 _res_comment="old ffmpeg version, use CVS !"
6076 if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
6077 # check if libavutil is a required
6078 cat > $TMPC << EOF
6079 #include "libavcodec/avcodec.h"
6080 #if LIBAVCODEC_BUILD >= 3211265
6081 #error We need libavutil!
6082 #endif
6083 int main(void) { return 0; }
6086 if cc_check -I. -I./libavutil; then
6087 _libavutil_required="no"
6088 else
6089 _libavutil_required="yes"
6091 _res_comment="libavutil availability does not fit libavcodec version"
6092 if test "$_libavutil_required" = "$_libavutil"; then
6093 _libavcodec="yes"
6094 _res_comment=""
6099 echores "$_libavcodec"
6101 echocheck "FFmpeg libavformat (static)"
6102 if test "$_libavformat" = auto ; then
6103 # Note: static linking is preferred to dynamic linking
6104 _libavformat=no
6105 if test -d libavformat && test -f libavformat/utils.c ; then
6106 _libavformat=yes
6109 echores "$_libavformat"
6111 echocheck "FFmpeg libpostproc (static)"
6112 if test "$_libpostproc" = auto ; then
6113 _libpostproc=no
6114 if test -d libavcodec && test -f libavcodec/libpostproc/postprocess.h ; then
6115 _libpostproc='yes'
6118 echores "$_libpostproc"
6121 if test "$_libavutil" != yes ; then
6122 echocheck "FFmpeg libavutil (dynamic)"
6123 if test "$_libavutil_so" = auto ; then
6124 _libavutil_so=no
6125 cat > $TMPC << EOF
6126 #include <ffmpeg/common.h>
6127 int main(void) { ff_gcd(1,1); return 0; }
6129 if pkg-config --exists libavutil ; then
6130 _inc_libavutil=`pkg-config --cflags libavutil`
6131 _ld_libavutil=`pkg-config --libs libavutil`
6132 cc_check $_inc_libavutil $_ld_libavutil && _libavutil_so=yes
6133 elif cc_check -lavutil $_ld_lm ; then
6134 _libavutil_so=yes
6136 if test "$_libavutil_so" == yes ; then
6137 _res_comment="using libavutil.so, but static libavutil is recommended"
6140 echores "$_libavutil_so"
6143 if test "$_libavcodec" != yes ; then
6144 echocheck "FFmpeg libavcodec (dynamic)"
6145 if test "$_libavcodec_so" = auto ; then
6146 _libavcodec_so=no
6147 _res_comment="libavcodec.so is broken/obsolete"
6148 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
6149 cat > $TMPC << EOF
6150 #include <ffmpeg/avcodec.h>
6151 int main(void) {
6152 avcodec_find_encoder_by_name("");
6153 return 0;
6156 if pkg-config --exists libavcodec ; then
6157 _inc_libavcodec=`pkg-config --cflags libavcodec`
6158 _ld_libavcodec=`pkg-config --libs libavcodec`
6159 cc_check $_inc_libavcodec $_ld_libavcodec && _libavcodec_so=yes
6160 elif cc_check -lavcodec $_ld_lm ; then
6161 _libavcodec_so=yes
6163 if test "$_libavcodec_so" == yes ; then
6164 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6167 echores "$_libavcodec_so"
6170 if test "$_libavformat" != yes ; then
6171 echocheck "FFmpeg libavformat (dynamic)"
6172 if test "$_libavformat_so" = auto ; then
6173 _libavformat_so=no
6174 cat > $TMPC <<EOF
6175 #include <ffmpeg/avformat.h>
6176 int main(void) { av_alloc_format_context(); return 0; }
6178 if pkg-config --exists libavformat ; then
6179 _inc_libavformat=`pkg-config --cflags libavformat`
6180 _ld_libavformat=`pkg-config --libs libavformat`
6181 cc_check $_inc_libavformat $_ld_libavformat && _libavformat_so=yes
6182 elif cc_check $_ld_lm -lavformat ; then
6183 _libavformat_so=yes
6185 if test "$_libavformat_so" == yes ; then
6186 _res_comment="using libavformat.so, but static libavformat is recommended"
6189 echores "$_libavformat_so"
6192 if test "$_libpostproc" != yes ; then
6193 echocheck "FFmpeg libpostproc (dynamic)"
6194 if test "$_libpostproc_so" = auto ; then
6195 _libpostproc_so=no
6196 cat > $TMPC << EOF
6197 #define USE_LIBPOSTPROC 1
6198 #include <inttypes.h>
6199 #include <postproc/postprocess.h>
6200 int main(void) {
6201 pp_get_mode_by_name_and_quality("de", 0);
6202 return 0;}
6204 if cc_check -lpostproc $_ld_lm ; then
6205 _libpostproc_so=yes
6206 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6209 echores "$_libpostproc_so"
6212 _def_libavcodec='#undef USE_LIBAVCODEC'
6213 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6214 _def_lavc_dsputil='#undef USE_LIBAVCODEC_DSPUTIL'
6215 if test "$_libavcodec" = yes ; then
6216 _def_libavcodec='#define USE_LIBAVCODEC 1'
6217 _def_lavc_dsputil='#define USE_LIBAVCODEC_DSPUTIL'
6218 _ld_libavcodec='libavcodec/libavcodec.a'
6219 _dep_libavcodec='libavcodec/libavcodec.a'
6220 _codecmodules="libavcodec $_codecmodules"
6221 if test "$_libavutil" = yes; then
6222 _ld_libavutil='libavutil/libavutil.a'
6223 _dep_libavutil='libavutil/libavutil.a'
6225 elif test "$_libavcodec_so" = yes ; then
6226 _def_libavcodec='#define USE_LIBAVCODEC 1'
6227 _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6228 test "$_ld_libavcodec" || _ld_libavcodec='-lavcodec'
6229 _codecmodules="libavcodec.so $_codecmodules"
6230 else
6231 _nocodecmodules="libavcodec $_nocodecmodules"
6234 _def_libavformat='#undef USE_LIBAVFORMAT'
6235 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6236 _def_libavformat_win32='#undef CONFIG_WIN32'
6237 if test "$_libavformat" = yes ; then
6238 _def_libavformat='#define USE_LIBAVFORMAT 1'
6239 _ld_libavformat='libavformat/libavformat.a'
6240 _dep_libavformat='libavformat/libavformat.a'
6241 if win32 ; then
6242 _def_libavformat_win32='#define CONFIG_WIN32 1'
6244 else
6245 if test "$_libavformat_so" = yes ; then
6246 _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6247 test "$_ld_libavformat" || _ld_libavformat='-lavformat'
6248 if win32 ; then
6249 _def_libavformat_win32='#define CONFIG_WIN32 1'
6254 _def_libpostproc='#undef USE_LIBPOSTPROC'
6255 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6256 if test "$_libpostproc" = yes ; then
6257 _def_libpostproc='#define USE_LIBPOSTPROC 1'
6258 _ld_libpostproc='libavcodec/libpostproc/libpostproc.a'
6259 _dep_libpostproc='libavcodec/libpostproc/libpostproc.a'
6260 else
6261 if test "$_libpostproc_so" = yes ; then
6262 _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6263 _ld_libpostproc='-lpostproc'
6267 echocheck "AMR narrowband"
6268 if test "$_amr_nb" = auto ; then
6269 _amr_nb=no
6270 if test -f libavcodec/amr_float/sp_dec.c ; then
6271 if test "$_libavcodec" = yes ; then
6272 _amr_nb=yes
6273 else
6274 _res_comment="libavcodec (static) is required by amr_nb, sorry"
6278 if test "$_amr_nb" = yes ; then
6279 _amr=yes
6280 _def_amr='#define AMR 1'
6281 _def_amr_nb='#define AMR_NB 1'
6282 else
6283 _def_amr_nb='#undef AMR_NB'
6285 echores "$_amr_nb"
6287 echocheck "AMR narrowband, fixed point"
6288 if test "$_amr_nb_fixed" = auto ; then
6289 _amr_nb_fixed=no
6290 if test -f libavcodec/amr/dtx_dec.c ; then
6291 if test "$_libavcodec" = yes ; then
6292 if test "$_amr_nb" = no ; then
6293 _amr_nb_fixed=yes
6294 else
6295 _res_comment="disabled by amr_nb"
6297 else
6298 _res_comment="libavcodec (static) is required by amr_nb-fixed, sorry"
6302 if test "$_amr_nb_fixed" = yes ; then
6303 _amr=yes
6304 _def_amr='#define AMR 1'
6305 _def_amr_nb_fixed='#define AMR_NB_FIXED 1'
6306 else
6307 _def_amr_nb_fixed='#undef AMR_NB_FIXED'
6309 echores "$_amr_nb_fixed"
6311 if test "$_amr_nb" = yes ; then
6312 _codecmodules="amr_nb $_codecmodules"
6313 else
6314 _nocodecmodules="amr_nb $_nocodecmodules"
6317 echocheck "AMR wideband"
6318 if test "$_amr_wb" = auto ; then
6319 _amr_wb=no
6320 if test -f libavcodec/amrwb_float/dec_dtx.c ; then
6321 if test "$_libavcodec" = yes ; then
6322 _amr_wb=yes
6323 else
6324 _res_comment="libavcodec (static) is required by amr_wb, sorry"
6328 if test "$_amr_wb" = yes ; then
6329 _amr=yes
6330 _def_amr='#define AMR 1'
6331 _def_amr_wb='#define AMR_WB 1'
6332 _codecmodules="amr_wb $_codecmodules"
6333 else
6334 _def_amr_wb='#undef AMR_WB'
6335 _nocodecmodules="amr_wb $_nocodecmodules"
6337 echores "$_amr_wb"
6339 echocheck "libdv-0.9.5+"
6340 if test "$_libdv" = auto ; then
6341 _libdv=no
6342 cat > $TMPC <<EOF
6343 #include <libdv/dv.h>
6344 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6346 cc_check -ldv $_ld_lm && _libdv=yes
6348 if test "$_libdv" = yes ; then
6349 _def_libdv='#define HAVE_LIBDV095 1'
6350 _ld_libdv="-ldv"
6351 _codecmodules="libdv $_codecmodules"
6352 else
6353 _def_libdv='#undef HAVE_LIBDV095'
6354 _nocodecmodules="libdv $_nocodecmodules"
6356 echores "$_libdv"
6358 echocheck "zr"
6359 if test "$_zr" = auto ; then
6360 #36067's seem to identify themselves as 36057PQC's, so the line
6361 #below should work for 36067's and 36057's.
6362 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6363 _zr=yes
6364 else
6365 _zr=no
6368 if test "$_zr" = yes ; then
6369 if test "$_libavcodec" = yes ; then
6370 _def_zr='#define HAVE_ZR 1'
6371 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6372 _vomodules="zr zr2 $_vomodules"
6373 else
6374 _res_comment="libavcodec (static) is required by zr, sorry"
6375 _novomodules="zr $_novomodules"
6376 _def_zr='#undef HAVE_ZR'
6378 else
6379 _def_zr='#undef HAVE_ZR'
6380 _novomodules="zr zr2 $_novomodules"
6382 echores "$_zr"
6384 echocheck "bl"
6385 if test "$_bl" = yes ; then
6386 _def_bl='#define HAVE_BL 1'
6387 _vosrc="$_vosrc vo_bl.c"
6388 _vomodules="bl $_vomodules"
6389 else
6390 _def_bl='#undef HAVE_BL'
6391 _novomodules="bl $_novomodules"
6393 echores "$_bl"
6395 echocheck "XviD"
6396 cat > $TMPC << EOF
6397 #include <xvid.h>
6398 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
6400 _ld_xvid="$_ld_xvid -lxvidcore"
6401 _xvid4=no
6402 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid $_ld_lm ; then
6403 _xvid=yes
6404 _def_xvid3='#define HAVE_XVID3 1'
6405 _def_xvid4='#undef HAVE_XVID4'
6406 _codecmodules="xvid $_codecmodules"
6407 else
6408 cat > $TMPC << EOF
6409 #include <xvid.h>
6410 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6412 if test "$_xvid" != no ;then
6413 if cc_check $_inc_xvid $_ld_xvid $_ld_lm ; then
6414 _xvid4=yes
6415 elif cc_check $_inc_xvid $_ld_xvid $_ld_lm $_ld_pthread ; then
6416 _xvid4=yes;
6417 _ld_xvid="$_ld_xvid $_ld_pthread"
6421 if test "$_xvid4" = yes ; then
6422 _xvid=yes
6423 _xvid4=yes
6424 _def_xvid3='#undef HAVE_XVID3'
6425 _def_xvid4='#define HAVE_XVID4 1'
6426 _codecmodules="xvid $_codecmodules"
6427 else
6428 _xvid=no
6429 _ld_xvid=''
6430 _def_xvid3='#undef HAVE_XVID3'
6431 _def_xvid4='#undef HAVE_XVID4'
6432 _nocodecmodules="xvid $_nocodecmodules"
6435 echores "$_xvid"
6437 if test "$_xvid4" = yes ; then
6438 echocheck "XviD two pass plugin"
6439 cat > $TMPC << EOF
6440 #include <xvid.h>
6441 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6443 if cc_check $_inc_xvid $_ld_xvid $_ld_lb ; then
6444 _lavc_xvid=yes
6445 _def_lavc_xvid='#define CONFIG_XVID 1'
6446 else
6447 _lavc_xvid=no
6448 _def_lavc_xvid='#undef CONFIG_XVID'
6450 echores "$_lavc_xvid"
6453 _xvidcompat=no
6454 _def_decore_xvid='#undef DECORE_XVID'
6455 _def_encore_xvid='#undef ENCORE_XVID'
6456 if test "$_xvid" = yes ; then
6457 echocheck "DivX4 compatibility in XviD"
6458 cat > $TMPC << EOF
6459 #include <divx4.h>
6460 int main(void) { (void) decore(0, 0, 0, 0); return 0; }
6462 cc_check $_ld_lm "$_ld_xvid" && _xvidcompat=yes
6463 echores "$_xvidcompat"
6466 echocheck "x264"
6467 cat > $TMPC << EOF
6468 #include <inttypes.h>
6469 #include <x264.h>
6470 #if X264_BUILD < 46
6471 #error We do not support old versions of x264. Get the latest from SVN.
6472 #endif
6473 int main(void) { x264_encoder_open((void*)0); return 0; }
6475 _ld_x264="$_ld_x264 -lx264 $_ld_pthread"
6476 if test "$_x264" != no ; then
6477 _x264=no
6478 if cc_check $_inc_x264 $_ld_x264 $_ld_lm ; then
6479 _x264=yes
6480 elif test "$_x11" = yes && cc_check $_inc_x264 $_inc_x11 $_ld_x264 $_ld_x11 $_ld_lm ; then
6481 _x264=yes
6482 _ld_x264="$_ld_x264 $_ld_x11"
6486 if test "$_x264" = yes ; then
6487 _x264=yes
6488 _def_x264='#define HAVE_X264 1'
6489 _codecmodules="x264 $_codecmodules"
6490 else
6491 _x264=no
6492 _ld_x264=''
6493 _def_x264='#undef HAVE_X264'
6494 _nocodecmodules="x264 $_nocodecmodules"
6496 echores "$_x264"
6498 echocheck "DivX4linux/DivX5linux/OpenDivX decore"
6499 # DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
6500 cat > $TMPC << EOF
6501 #include <decore.h>
6502 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_FRAME_311; }
6504 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
6505 _divx=yes
6506 _opendivx=no
6507 _ld_decore='-ldivxdecore'
6508 _def_decore='#define NEW_DECORE 1'
6509 _def_divx='#define USE_DIVX'
6510 _def_divx5='#undef DECORE_DIVX5'
6511 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6512 _codecmodules="divx4linux $_codecmodules"
6513 _res_comment="DivX4linux - with libdivxdecore.so"
6514 else
6515 # if test "$_divx4linux" != no ; then
6516 # DivX5 check
6517 # OdivxPP disabled because of:
6518 # ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
6519 cat > $TMPC << EOF
6520 #include <decore.h>
6521 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_INIT; }
6523 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
6524 _divx=yes
6525 _opendivx=no
6526 # _ld_decore='-ldivxdecore opendivx/postprocess.o'
6527 _ld_decore='-ldivxdecore'
6528 _def_decore='#define NEW_DECORE 1'
6529 _def_divx='#define USE_DIVX'
6530 _def_divx5='#define DECORE_DIVX5 1'
6531 # _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
6532 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6533 _codecmodules="divx5linux $_codecmodules"
6534 _nocodecmodules="divx4linux $_nocodecmodules"
6535 _res_comment="DivX5linux - with libdivxdecore.so"
6536 elif test "$_opendivx" != no ; then
6537 _divx=yes
6538 _opendivx=yes
6539 _ld_decore='opendivx/libdecore.a'
6540 _def_decore='#undef NEW_DECORE'
6541 _def_divx='#define USE_DIVX'
6542 _def_divx5='#undef DECORE_DIVX5'
6543 _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
6544 _codecmodules="opendivx $_codecmodules"
6545 _nocodecmodules="divx5linux $_nocodecmodules"
6546 _res_comment="OpenDivX"
6547 elif test "$_xvidcompat" = yes ; then
6548 _divx=yes
6549 _opendivx=no
6550 _ld_decore=''
6551 _def_decore='#define NEW_DECORE 1'
6552 _def_divx='#define USE_DIVX 1'
6553 _def_divx5='#undef DECORE_DIVX5'
6554 _def_decore_xvid='#define DECORE_XVID 1'
6555 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6556 _nocodecmodules="opendivx divx5linux divx4linux $_nocodecmodules"
6557 _res_comment="XviD compat."
6558 else
6559 _divx=no
6560 _opendivx=no
6561 _ld_decore=''
6562 _def_decore='#undef NEW_DECORE'
6563 _def_divx='#undef USE_DIVX'
6564 _def_divx5='#undef DECORE_DIVX5'
6565 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6566 _nocodecmodules="opendivx $_nocodecmodules"
6567 fi # DivX5 check
6569 echores "$_divx"
6572 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
6573 if test "$_mencoder" != no ; then
6575 echocheck "libmp3lame (for mencoder)"
6576 _mp3lame=no
6577 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6578 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6579 cat > $TMPC <<EOF
6580 #include <lame/lame.h>
6581 int main(void) { lame_version_t lv; (void) lame_init(); get_lame_version_numerical(&lv); printf("%d%d\n",lv.major,lv.minor); return 0; }
6583 # Note: libmp3lame usually depends on vorbis
6584 cc_check -lmp3lame $_ld_vorbis $_ld_lm && tmp_run && _mp3lame=yes
6585 if test "$_mp3lame" = yes ; then
6586 _def_mp3lame="#define HAVE_MP3LAME"
6587 _def_lavc_mp3lame="#define CONFIG_MP3LAME 1"
6588 _ld_mp3lame="-lmp3lame $_ld_vorbis"
6589 cat > $TMPC << EOF
6590 #include <lame/lame.h>
6591 int main(void) { int p = STANDARD_FAST; return 0; }
6593 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6594 cat > $TMPC << EOF
6595 #include <lame/lame.h>
6596 int main(void) { int p = MEDIUM_FAST; return 0; }
6598 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6599 else
6600 _def_mp3lame='#undef HAVE_MP3LAME'
6602 echores "$_mp3lame"
6605 echocheck "DivX4linux encore (for mencoder)"
6606 cat > $TMPC << EOF
6607 #include <encore2.h>
6608 int main(void) { (void) encore(0, 0, 0, 0); return 0; }
6610 if test "$_divx4linux" != no && cc_check -ldivxencore $_ld_lm ; then
6611 _divx_encore=yes
6612 _def_encore='#define HAVE_DIVX4ENCORE 1'
6613 _ld_encore='-ldivxencore'
6614 _res_comment="DivX4linux - with libdivxencore.so"
6615 elif test "$_xvidcompat" = yes ; then
6616 _divx_encore=yes
6617 _def_encore='#define HAVE_DIVX4ENCORE 1'
6618 _ld_encore=''
6619 _def_encore_xvid='#define ENCORE_XVID 1'
6620 _res_comment="XviD compatibility"
6621 else
6622 _divx_encore=no
6623 _def_encore='#undef HAVE_DIVX4ENCORE'
6625 echores "$_divx_encore"
6629 echocheck "mencoder"
6630 _mencoder_flag='#undef HAVE_MENCODER'
6631 if test "$_mencoder" = yes ; then
6632 _mencoder_flag='#define HAVE_MENCODER'
6634 echores "$_mencoder"
6636 echocheck "fastmemcpy"
6637 # fastmemcpy check is done earlier with tests of CPU & binutils features
6638 if test "$_fastmemcpy" = yes ; then
6639 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6640 else
6641 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6643 echores "$_fastmemcpy"
6645 echocheck "UniquE RAR File Library"
6646 if test "$_unrarlib" = yes ; then
6647 _def_unrarlib='#define USE_UNRARLIB 1'
6648 else
6649 _def_unrarlib='#undef USE_UNRARLIB'
6651 echores "$_unrarlib"
6653 echocheck "TV interface"
6654 if test "$_tv" = yes ; then
6655 _def_tv='#define USE_TV 1'
6656 _inputmodules="tv $_inputmodules"
6657 else
6658 _noinputmodules="tv $_noinputmodules"
6659 _def_tv='#undef USE_TV'
6661 echores "$_tv"
6663 echocheck "*BSD BrookTree 848 TV interface"
6664 if test "$_tv_bsdbt848" = auto ; then
6665 _tv_bsdbt848=no
6666 if test "$_tv" = yes ; then
6667 cat > $TMPC <<EOF
6668 #include <sys/types.h>
6669 #if defined(__NetBSD__)
6670 #include <dev/ic/bt8xx.h>
6671 #else
6672 #include <machine/ioctl_bt848.h>
6673 #endif
6674 int main(void) { return 0; }
6676 cc_check && _tv_bsdbt848=yes
6679 if test "$_tv_bsdbt848" = yes ; then
6680 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6681 _inputmodules="tv-bsdbt848 $_inputmodules"
6682 else
6683 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6684 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6686 echores "$_tv_bsdbt848"
6688 echocheck "Video 4 Linux TV interface"
6689 if test "$_tv_v4l" = auto ; then
6690 _tv_v4l=no
6691 if test "$_tv" = yes && linux ; then
6692 cat > $TMPC <<EOF
6693 #include <stdlib.h>
6694 #include <linux/videodev.h>
6695 int main(void) { return 0; }
6697 cc_check && _tv_v4l=yes
6700 if test "$_tv_v4l" = yes ; then
6701 _def_tv_v4l='#define HAVE_TV_V4L 1'
6702 _inputmodules="tv-v4l $_inputmodules"
6703 else
6704 _noinputmodules="tv-v4l $_noinputmodules"
6705 _def_tv_v4l='#undef HAVE_TV_V4L'
6707 echores "$_tv_v4l"
6710 echocheck "Video 4 Linux 2 TV interface"
6711 if test "$_tv_v4l2" = auto ; then
6712 _tv_v4l2=no
6713 if test "$_tv" = yes && linux ; then
6714 cat > $TMPC <<EOF
6715 #include <stdlib.h>
6716 #include <linux/types.h>
6717 #include <linux/videodev2.h>
6718 int main(void) { return 0; }
6720 cc_check && _tv_v4l2=yes
6723 if test "$_tv_v4l2" = yes ; then
6724 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6725 _inputmodules="tv-v4l2 $_inputmodules"
6726 else
6727 _noinputmodules="tv-v4l2 $_noinputmodules"
6728 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6730 echores "$_tv_v4l2"
6733 echocheck "audio select()"
6734 if test "$_select" = no ; then
6735 _def_select='#undef HAVE_AUDIO_SELECT'
6736 elif test "$_select" = yes ; then
6737 _def_select='#define HAVE_AUDIO_SELECT 1'
6739 echores "$_select"
6742 echocheck "network"
6743 # FIXME network check
6744 if test "$_network" != no ; then
6745 _def_network='#define MPLAYER_NETWORK 1'
6746 _ld_network="$_ld_sock"
6747 _inputmodules="network $_inputmodules"
6748 else
6749 _noinputmodules="network $_noinputmodules"
6750 _def_network='#undef MPLAYER_NETWORK'
6751 _ftp=no
6753 echores "$_network"
6755 echocheck "ftp"
6756 if not beos && test "$_ftp" != no ; then
6757 _def_ftp='#define HAVE_FTP 1'
6758 _inputmodules="ftp $_inputmodules"
6759 else
6760 _noinputmodules="ftp $_noinputmodules"
6761 _def_ftp='#undef HAVE_FTP'
6763 echores "$_ftp"
6765 echocheck "vstream client"
6766 if test "$_vstream" = auto ; then
6767 _vstream=no
6768 cat > $TMPC <<EOF
6769 #include <vstream-client.h>
6770 void vstream_error(const char *format, ... ) {}
6771 int main(void) { vstream_start(); return 0; }
6773 cc_check -lvstream-client && _vstream=yes
6775 if test "$_vstream" = yes ; then
6776 _def_vstream='#define HAVE_VSTREAM 1'
6777 _inputmodules="vstream $_inputmodules"
6778 _ld_vstream='-lvstream-client'
6779 else
6780 _noinputmodules="vstream $_noinputmodules"
6781 _def_vstream='#undef HAVE_VSTREAM'
6783 echores "$_vstream"
6785 # endian testing
6786 echocheck "byte order"
6787 if test "$_big_endian" = auto ; then
6788 cat > $TMPC <<EOF
6789 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6790 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6791 int main(){
6792 return (int)ascii_name;
6795 if cc_check ; then
6796 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6797 _big_endian=yes
6798 else
6799 _big_endian=no
6801 else
6802 echo -n "failed to autodetect byte order, defaulting to "
6805 if test "$_big_endian" = yes ; then
6806 _byte_order='big-endian'
6807 _def_words_endian='#define WORDS_BIGENDIAN 1'
6808 else
6809 _byte_order='little-endian'
6810 _def_words_endian='#undef WORDS_BIGENDIAN'
6812 echores "$_byte_order"
6814 echocheck "OSD menu"
6815 if test "$_menu" = yes ; then
6816 _def_menu='#define HAVE_MENU 1'
6817 else
6818 _def_menu='#undef HAVE_MENU'
6820 echores "$_menu"
6822 # Check to see if they want QTX codecs enabled
6823 echocheck "QTX codecs"
6824 if test "$_qtx" = auto ; then
6825 _qtx=$_win32
6827 if test "$_qtx" = yes ; then
6828 _def_qtx='#define USE_QTX_CODECS 1'
6829 _codecmodules="qtx $_codecmodules"
6830 else
6831 _def_qtx='#undef USE_QTX_CODECS'
6832 _nocodecmodules="qtx $_nocodecmodules"
6834 echores "$_qtx"
6837 echocheck "Subtitles sorting"
6838 if test "$_sortsub" = yes ; then
6839 _def_sortsub='#define USE_SORTSUB 1'
6840 else
6841 _def_sortsub='#undef USE_SORTSUB'
6843 echores "$_sortsub"
6846 echocheck "XMMS inputplugin support"
6847 if test "$_xmms" = yes ; then
6849 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6850 if test -z "$_xmmsplugindir" ; then
6851 _xmmsplugindir=`xmms-config --input-plugin-dir`
6853 if test -z "$_xmmslibdir" ; then
6854 _xmmslibdir=`xmms-config --exec-prefix`/lib
6856 else
6857 if test -z "$_xmmsplugindir" ; then
6858 _xmmsplugindir=/usr/lib/xmms/Input
6860 if test -z "$_xmmslibdir" ; then
6861 _xmmslibdir=/usr/lib
6865 _def_xmms='#define HAVE_XMMS 1'
6866 if darwin ; then
6867 _xmms_lib="${_xmmslibdir}/libxmms.dylib"
6868 else
6869 _xmms_lib="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6871 else
6872 _def_xmms='#undef HAVE_XMMS'
6874 echores "$_xmms"
6876 echocheck "inet6"
6877 if test "$_inet6" = auto ; then
6878 cat > $TMPC << EOF
6879 #include <sys/types.h>
6880 #include <sys/socket.h>
6881 int main(void) { socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6883 _inet6=no
6884 if cc_check ; then
6885 _inet6=yes
6888 if test "$_inet6" = yes ; then
6889 _def_inet6='#define HAVE_AF_INET6 1'
6890 else
6891 _def_inet6='#undef HAVE_AF_INET6'
6893 echores "$_inet6"
6896 echocheck "gethostbyname2"
6897 if test "$_gethostbyname2" = auto ; then
6898 cat > $TMPC << EOF
6899 #include <sys/types.h>
6900 #include <sys/socket.h>
6901 #include <netdb.h>
6902 int main(void) { gethostbyname2("", AF_INET); }
6904 _gethostbyname2=no
6905 if cc_check ; then
6906 _gethostbyname2=yes
6910 if test "$_gethostbyname2" = yes ; then
6911 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6912 else
6913 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6915 echores "$_gethostbyname2"
6917 # --------------- GUI specific tests begin -------------------
6918 echocheck "GUI"
6919 echo "$_gui"
6920 if test "$_gui" = yes ; then
6922 # Required libraries
6923 test "$_png" != yes && die "PNG support required for GUI compilation, please install libpng and libpng-dev packages."
6924 test "$_x11" != yes && die "X11 support required for GUI compilation"
6926 echocheck "XShape extension"
6927 _xshape=no
6928 if test "$_x11" = yes ; then
6929 cat > $TMPC << EOF
6930 #include <X11/Xlib.h>
6931 #include <X11/Xproto.h>
6932 #include <X11/Xutil.h>
6933 #include <X11/extensions/shape.h>
6934 #include <stdlib.h>
6935 int main(void) {
6936 char *name = ":0.0";
6937 Display *wsDisplay;
6938 int exitvar = 0;
6939 int eventbase, errorbase;
6940 if (getenv("DISPLAY"))
6941 name=getenv("DISPLAY");
6942 wsDisplay=XOpenDisplay(name);
6943 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6944 exitvar=1;
6945 XCloseDisplay(wsDisplay);
6946 return exitvar;
6949 cc_check $_inc_x11 $_ld_x11 && _xshape=yes
6951 if test "$_xshape" = yes ; then
6952 _def_xshape='#define HAVE_XSHAPE 1'
6953 else
6954 die "The GUI requires the X11 extension XShape (which was not found)."
6956 echores "$_xshape"
6958 #Check for GTK
6959 if test "$_gtk1" = no ; then
6960 #Check for GTK2 :
6961 echocheck "GTK+ version"
6963 if pkg-config gtk+-2.0 --exists ; then
6964 _gtk=`pkg-config gtk+-2.0 --modversion 2>/dev/null`
6965 _inc_gtk=`pkg-config gtk+-2.0 --cflags 2>/dev/null`
6966 _ld_gtk=`pkg-config gtk+-2.0 --libs 2>/dev/null`
6967 echores "$_gtk"
6969 # Check for GLIB2
6970 if pkg-config glib-2.0 --exists ; then
6971 echocheck "glib version"
6972 _glib=`pkg-config glib-2.0 --modversion 2>/dev/null`
6973 _inc_glib=`pkg-config glib-2.0 --cflags 2>/dev/null`
6974 _ld_glib=`pkg-config glib-2.0 --libs 2>/dev/null`
6975 echores "$_glib"
6977 _def_gui='#define HAVE_NEW_GUI 1'
6978 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
6979 _ld_gui='$(GTKLIB) $(GLIBLIB)'
6980 else
6981 _gtk1=yes
6982 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
6984 else
6985 echo "GTK-2 devel packages were not found, trying GTK 1.2"
6986 _gtk1=yes
6990 if test "$_gtk1" = yes ; then
6991 # Check for old GTK (1.2.x)
6992 echocheck "GTK version"
6993 if test -z "$_gtkconfig" ; then
6994 if ( gtk-config --version ) >/dev/null 2>&1 ; then
6995 _gtkconfig="gtk-config"
6996 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
6997 _gtkconfig="gtk12-config"
6998 else
6999 die "The GUI requires GTK devel packages (which were not found)."
7002 _gtk=`$_gtkconfig --version 2>&1`
7003 _inc_gtk=`$_gtkconfig --cflags 2>&1`
7004 _ld_gtk=`$_gtkconfig --libs 2>&1`
7005 echores "$_gtk (using $_gtkconfig)"
7007 # Check for GLIB
7008 echocheck "glib version"
7009 if test -z "$_glibconfig" ; then
7010 if ( glib-config --version ) >/dev/null 2>&1 ; then
7011 _glibconfig="glib-config"
7012 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7013 _glibconfig="glib12-config"
7014 else
7015 die "The GUI requires GLib devel packages (which were not found)"
7018 _glib=`$_glibconfig --version 2>&1`
7019 _inc_glib=`$_glibconfig --cflags 2>&1`
7020 _ld_glib=`$_glibconfig --libs 2>&1`
7021 echores "$_glib (using $_glibconfig)"
7023 _def_gui='#define HAVE_NEW_GUI 1'
7024 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7025 _ld_gui='$(GTKLIB) $(GLIBLIB)'
7028 echo "Creating Gui/config.mak"
7029 cat > Gui/config.mak << EOF
7030 # -------- Generated by configure -----------
7032 GTKINC = $_inc_gtk
7033 GTKLIBS = $_ld_gtk
7034 GLIBINC = $_inc_glib
7035 GLIBLIBS = $_ld_glib
7039 else
7040 _def_gui='#undef HAVE_NEW_GUI'
7041 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7043 # --------------- GUI specific tests end -------------------
7045 if test "$_charset" = "noconv" ; then
7046 _charset=""
7047 elif test -z "$_charset" ; then
7048 if test "$_gtk1" = yes ; then
7049 _charset=`cat ${_mp_help}.charset`
7050 else
7051 _charset="UTF-8"
7054 if test "$_charset" ; then
7055 _def_charset="#define MSG_CHARSET \"$_charset\""
7056 else
7057 _def_charset="#undef MSG_CHARSET"
7061 #############################################################################
7063 echocheck "automatic gdb attach"
7064 if test "$_crash_debug" = yes ; then
7065 _def_crash_debug='#define CRASH_DEBUG 1'
7066 else
7067 _def_crash_debug='#undef CRASH_DEBUG'
7068 _crash_debug=no
7070 echores "$_crash_debug"
7072 if darwin ; then
7073 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN"
7074 if x86 ; then
7075 CFLAGS="$CFLAGS -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
7077 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7078 CFLAGS="$CFLAGS -no-cpp-precomp"
7081 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
7082 test "$_altivec" = yes && CFLAGS="$CFLAGS -DCONFIG_DARWIN"
7084 if hpux ; then
7085 # use flag for HPUX missing setenv()
7086 CFLAGS="$CFLAGS -DHPUX"
7088 # Thread support
7089 if linux ; then
7090 CFLAGS="$CFLAGS -D_REENTRANT"
7091 elif bsd ; then
7092 # FIXME bsd needs this so maybe other OS'es
7093 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7095 # 64 bit file offsets?
7096 if test "$_largefiles" = yes || freebsd ; then
7097 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7098 if test "$_dvdread" = yes ; then
7099 # dvdread support requires this (for off64_t)
7100 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7104 echocheck "compiler support for -fno-PIC"
7105 if x86; then
7106 cat > $TMPC <<EOF
7107 int main(void) { return 0; }
7109 if cc_check -fno-PIC ; then
7110 CFLAGS="-fno-PIC $CFLAGS"
7111 echores "yes"
7112 else
7113 echores "no"
7115 else
7116 echores "only used for x86"
7119 echocheck "compiler support for noexecstack"
7120 cat > $TMPC <<EOF
7121 int main(void) { return 0; }
7123 if cc_check -Wl,-z,noexecstack ; then
7124 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7125 echores "yes"
7126 else
7127 echores "no"
7130 echocheck "ftello()"
7131 # if we don't have ftello use the osdep/ compatibility module
7132 cat > $TMPC << EOF
7133 #include <stdio.h>
7134 #include <sys/types.h>
7135 int main (void) { ftello(stdin); return 0; }
7137 _ftello=no
7138 cc_check && _ftello=yes
7139 if test "$_ftello" = yes ; then
7140 _def_ftello='#define HAVE_FTELLO 1'
7141 else
7142 _def_ftello='#undef HAVE_FTELLO'
7144 echores "$_ftello"
7146 # Determine OS dependent libs
7147 if cygwin ; then
7148 _def_confwin32='#define WIN32'
7149 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
7150 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
7151 CFLAGS="$CFLAGS -D__CYGWIN__"
7154 if win32 ; then
7155 _confwin32='TARGET_WIN32 = yes'
7156 else
7157 _confwin32='TARGET_WIN32 = no'
7160 # Dynamic linking flags
7161 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7162 _ld_dl_dynamic=''
7163 bsd && _ld_dl_dynamic='-rdynamic'
7164 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7165 _ld_dl_dynamic='-rdynamic'
7168 _ld_arch="$_ld_arch $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7169 bsdos && _ld_arch="$_ld_arch -ldvd"
7170 if netbsd ; then
7171 x86 && _ld_arch="$_ld_arch -li386"
7174 _def_debug='#undef MP_DEBUG'
7175 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7177 _def_linux='#undef TARGET_LINUX'
7178 linux && _def_linux='#define TARGET_LINUX 1'
7180 # TODO cleanup the VIDIX stuff here
7181 echocheck "VIDIX (internal)"
7182 echores "$_vidix_internal"
7184 echocheck "VIDIX (external)"
7185 if test "$_vidix_external" = auto; then
7186 _vidix_external=no
7187 cat > $TMPC <<EOF
7188 #include <vidix/vidix.h>
7189 int main(void) { return 0; }
7191 cc_check -lvidix && _vidix_external=yes
7193 echores "$_vidix_external"
7195 if test "$_vidix_internal" = yes || test "$_vidix_external" = yes ; then
7196 _vidix=yes
7197 _def_vidix='#define CONFIG_VIDIX 1'
7198 else
7199 _vidix=no
7200 _def_vidix='#undef CONFIG_VIDIX'
7203 if test "$_vidix_internal" = yes ; then
7204 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
7205 elif test "$_vidix_external" = yes ; then
7206 _ld_vidix_external="-lvidix"
7207 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
7210 if test "$_vidix" = yes; then
7211 _vosrc="$_vosrc vo_cvidix.c"
7212 _vomodules="cvidix $_vomodules"
7213 else
7214 _novomodules="cvidix $_novomodules"
7216 if test "$_vidix" = yes && win32; then
7217 _vosrc="$_vosrc vo_winvidix.c"
7218 _vomodules="winvidix $_vomodules"
7219 _ld_win32libs="-lgdi32 $_ld_win32libs"
7220 else
7221 _novomodules="winvidix $_novomodules"
7223 if test "$_vidix" = yes && test "$_x11" = yes; then
7224 _vosrc="$_vosrc vo_xvidix.c"
7225 _vomodules="xvidix $_vomodules"
7226 else
7227 _novomodules="xvidix $_novomodules"
7230 echocheck "joystick"
7231 _def_joystick='#undef HAVE_JOYSTICK'
7232 if test "$_joystick" = yes ; then
7233 if linux ; then
7234 # TODO add some check
7235 _def_joystick='#define HAVE_JOYSTICK 1'
7236 else
7237 _joystick="no (unsupported under $system_name)"
7240 echores "$_joystick"
7242 echocheck "lirc"
7243 if test "$_lirc" = auto ; then
7244 _lirc=no
7245 if test -c /dev/lirc -o -c /dev/lirc/0 ; then
7246 cat > $TMPC <<EOF
7247 #include <lirc/lirc_client.h>
7248 int main(void) { return 0; }
7250 cc_check -llirc_client && _lirc=yes
7253 if test "$_lirc" = yes ; then
7254 _def_lirc='#define HAVE_LIRC 1'
7255 _ld_lirc='-llirc_client'
7256 else
7257 _def_lirc='#undef HAVE_LIRC'
7259 echores "$_lirc"
7261 echocheck "lircc"
7262 if test "$_lircc" = auto ; then
7263 _lircc=no
7264 cat > $TMPC <<EOF
7265 #include <lirc/lircc.h>
7266 int main(void) { return 0; }
7268 cc_check -llircc && _lircc=yes
7270 if test "$_lircc" = yes ; then
7271 _def_lircc='#define HAVE_LIRCC 1'
7272 _ld_lircc='-llircc'
7273 else
7274 _def_lircc='#undef HAVE_LIRCC'
7276 echores "$_lircc"
7278 #############################################################################
7279 echo "Creating config.mak"
7280 cat > config.mak << EOF
7281 # -------- Generated by configure -----------
7283 LANG = C
7284 MAN_LANG = $MAN_LANG
7285 TARGET_OS = $system_name
7286 DESTDIR =
7287 prefix = \$(DESTDIR)$_prefix
7288 BINDIR = \$(DESTDIR)$_bindir
7289 DATADIR = \$(DESTDIR)$_datadir
7290 MANDIR = \$(DESTDIR)$_mandir
7291 CONFDIR = \$(DESTDIR)$_confdir
7292 LIBDIR = \$(DESTDIR)$_libdir
7293 # FFmpeg uses libdir instead of LIBDIR
7294 libdir = \$(LIBDIR)
7295 #AR = ar
7296 CC = $_cc
7297 HOST_CC = $_host_cc
7298 AWK = $_awk
7299 RANLIB = $_ranlib
7300 INSTALL = $_install
7301 EXTRA_INC = $_inc_extra
7302 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
7303 STRIPBINARIES = $_stripbinaries
7304 CHARSET = $_charset
7305 HELP_FILE = $_mp_help
7307 PRG = $_prg
7308 PRG_MENCODER = $_prg_mencoder
7310 $_live_libs_def
7312 MPLAYER_NETWORK = $_network
7313 STREAMING_LIVE555 = $_live
7314 MPLAYER_NETWORK_LIB = $_ld_live $_ld_vstream $_ld_network
7315 DVBIN = $_dvbin
7316 VIDIX = $_vidix_internal
7317 EXTERNAL_VIDIX = $_vidix_external
7318 EXTERNAL_VIDIX_LIB = $_ld_vidix_external
7319 CONFIG_PP = yes
7320 CONFIG_MP3LAME = $_mp3lame
7321 LIBMENU = $_menu
7323 OPENDIVX = $_opendivx
7325 MP3LIB = $_mp3lib
7326 LIBA52 = $_liba52
7327 LIBMPEG2 = $_libmpeg2
7328 TREMOR = $_tremor_internal
7329 TREMOR_FLAGS = $_tremor_flags
7331 SPEEX = $_speex
7332 MUSEPACK = $_musepack
7334 UNRARLIB = $_unrarlib
7335 PNG = $_mkf_png
7336 JPEG = $_mkf_jpg
7337 GIF = $_mkf_gif
7339 EXTRA_LIB = $_ld_extra
7340 Z_LIB = $_ld_static $_ld_zlib
7341 HAVE_MLIB = $_mlib
7342 WIN32_LIB = $_ld_win32libs
7343 STATIC_LIB = $_ld_static
7344 ENCA_LIB = $_ld_enca
7345 HAVE_PTHREADS = $_pthreads
7346 MATH_LIB = $_ld_lm
7347 LIBC_LIB = $_ld_libC
7349 X11_INC = $_inc_x11
7350 X11DIR = $_ld_x11
7352 HAVE_XVMC_ACCEL = $_xvmc
7354 # for FFmpeg
7355 SRC_PATH=`pwd`
7356 LIBPREF=lib
7357 LIBSUF=.a
7358 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7360 # video output
7361 X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
7362 GGI_LIB = $_ld_ggi
7363 MLIB_LIB = $_ld_mlib
7364 MLIB_INC = $_inc_mlib
7365 DXR2_INC = $_inc_dxr2
7366 DVB_INC = $_inc_dvb
7367 PNG_LIB = $_ld_png
7368 JPEG_LIB = $_ld_jpg
7369 GIF_LIB = $_ld_gif
7370 SDL_LIB = $_ld_sdl
7371 SVGA_LIB = $_ld_svga
7372 VESA_LIB = $_ld_vesa
7373 AA_LIB = $_ld_aa
7374 CACA_INC = $_inc_caca
7375 CACA_LIB = $_ld_caca
7377 # audio output
7378 ALSA_LIB = $_ld_alsa
7379 NAS_LIB = $_ld_nas
7380 ARTS_LIB = $_ld_arts
7381 ARTS_INC = $_inc_arts
7382 ESD_LIB = $_ld_esd
7383 ESD_INC = $_inc_esd
7384 POLYP_LIB = $_ld_polyp
7385 POLYP_INC = $_inc_polyp
7386 JACK_LIB = $_ld_jack
7387 JACK_INC = $_inc_jack
7388 OPENAL_LIB = $_ld_openal
7389 OPENAL_INC = $_inc_openal
7390 SGIAUDIO_LIB = $_ld_sgiaudio
7392 # input/demuxer/codecs
7393 TERMCAP_LIB = $_ld_termcap
7394 LIRC_LIB = $_ld_lirc
7395 LIRCC_LIB = $_ld_lircc
7396 HAVE_DVD = $_have_dvd
7397 DVDREAD = $_dvdread
7398 DVDREAD_LIB = $_ld_dvdread
7399 DVDKIT2 = $_dvdkit
7400 SDL_INC = $_inc_sdl
7401 W32_DEP = $_dep_win32
7402 W32_LIB = $_ld_win32
7403 DS_DEP = $_dep_dshow
7404 DS_LIB = $_ld_dshow
7405 AV_DEP = $_dep_libavcodec $_dep_libavformat $_dep_libavutil $_dep_libpostproc
7406 AV_LIB = $_ld_libavcodec $_ld_libavformat $_ld_libavutil $_ld_libpostproc
7407 CONFIG_LIBAVUTIL = $_libavutil
7408 CONFIG_LIBAVUTIL_SO = $_libavutil_so
7409 CONFIG_LIBAVCODEC = $_libavcodec
7410 CONFIG_LIBAVCODEC_SO = $_libavcodec_so
7411 CONFIG_LIBAVFORMAT = $_libavformat
7412 CONFIG_LIBAVFORMAT_SO = $_libavformat_so
7413 CONFIG_LIBPOSTPROC = $_libpostproc
7414 CONFIG_LIBPOSTPROC_SO = $_libpostproc_so
7415 ZORAN = $_zr
7416 FAME = $_fame
7417 FAME_LIB = $_ld_fame
7418 MP1E_DEP = $_dep_mp1e
7419 MP1E_LIB = $_ld_mp1e
7420 ARCH_LIB = $_ld_arch $_ld_iconv
7421 XVID = $_xvid
7422 XVID_INC = $_inc_xvid
7423 XVID_LIB = $_ld_xvid
7424 X264 = $_x264
7425 X264_INC = $_inc_x264
7426 X264_LIB = $_ld_x264
7427 CONFIG_DTS = $_libdts
7428 DTS_INC = $_inc_libdts
7429 DTS_LIB = $_ld_libdts
7430 DECORE_LIB = $_ld_decore $_ld_mp3lame
7431 MENCODER = $_mencoder
7432 ENCORE_LIB = $_ld_encore $_ld_mp3lame
7433 DIRECTFB_INC = $_inc_directfb
7434 DIRECTFB_LIB = $_ld_directfb
7435 CDPARANOIA_INC = $_inc_cdparanoia
7436 CDPARANOIA_LIB = $_ld_cdparanoia
7437 FREETYPE_INC = $_inc_freetype
7438 FREETYPE_LIB = $_ld_freetype
7439 FONTCONFIG_INC = $_inc_fontconfig
7440 FONTCONFIG_LIB = $_ld_fontconfig
7441 FRIBIDI_INC = $_inc_fribidi
7442 FRIBIDI_LIB = $_ld_fribidi
7443 LIBCDIO_INC = $_inc_libcdio
7444 LIBCDIO_LIB = $_ld_libcdio
7445 LIBLZO_LIB= $_ld_liblzo
7446 MAD_LIB = $_ld_mad
7447 VORBIS_LIB = $_ld_vorbis $_ld_libdv
7448 SPEEX_LIB = $_ld_speex
7449 THEORA_LIB = $_ld_theora
7450 FAAD_LIB = $_ld_faad
7451 INTERNAL_FAAD = $_faad_internal
7452 SMBSUPPORT_LIB = $_ld_smb
7453 XMMS_PLUGINS = $_xmms
7454 XMMS_LIB = $_xmms_lib
7455 MACOSX = $_macosx
7456 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7457 MACOSX_BUNDLE = $_macosx_bundle
7458 MACOSX_FRAMEWORKS = $_macosx_frameworks
7459 MACOSX_COREVIDEO = $_macosx_corevideo
7460 TOOLAME=$_toolame
7461 TOOLAME_EXTRAFLAGS=$_toolame_extraflags
7462 TOOLAME_LIB=$_toolame_lib
7463 TWOLAME=$_twolame
7464 TWOLAME_LIB=$_twolame_lib
7465 MUSEPACK_LIB = $_ld_musepack
7466 FAAC=$_faac
7467 FAAC_LIB=$_ld_faac
7468 AMR=$_amr
7469 AMR_NB=$_amr_nb
7470 AMR_NB_FIXED=$_amr_nb_fixed
7471 AMR_WB=$_amr_wb
7472 `echo $_libavcodecs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7473 CONFIG_FAAC=$_faac
7474 CONFIG_XVID=$_lavc_xvid
7475 CONFIG_GPL=yes
7476 CONFIG_MUXERS=yes
7478 # --- Some stuff for autoconfigure ----
7479 $_target_arch
7480 $_confwin32
7481 TARGET_CPU=$iproc
7482 TARGET_MMX = $_mmx
7483 TARGET_MMX2 = $_mmxext
7484 TARGET_3DNOW = $_3dnow
7485 TARGET_3DNOWEX = $_3dnowext
7486 TARGET_SSE = $_sse
7487 TARGET_ALTIVEC = $_altivec
7488 TARGET_VIS = $_vis
7490 # --- GUI stuff ---
7491 GTKINC = $_inc_gtk
7492 GTKLIB = $_ld_static $_ld_gtk
7493 GLIBLIB = $_ld_static $_ld_glib
7494 GTK_LIBS = $_ld_static $_ld_gui
7495 GUI = $_gui
7496 DEBUG = -DDEBUG
7500 #############################################################################
7501 echo "Creating config.h"
7502 cat > config.h << EOF
7503 /* -------- This file has been automatically generated by configure ---------
7504 Note: Any changes in it will be lost when you run configure again. */
7506 /* Protect against multiple inclusion */
7507 #ifndef MPLAYER_CONFIG_H
7508 #define MPLAYER_CONFIG_H 1
7510 /* use GNU internationalization */
7511 $_def_i18n
7513 /* name of messages charset */
7514 $_def_charset
7516 /* Runtime CPU detection */
7517 $_def_runtime_cpudetection
7519 /* Dynamic a/v plugins */
7520 $_def_dynamic_plugins
7522 /* "restrict" keyword */
7523 $_def_restrict_keyword
7525 /* __builtin_expect branch prediction hint */
7526 $_def_builtin_expect
7527 #ifdef HAVE_BUILTIN_EXPECT
7528 #define likely(x) __builtin_expect ((x) != 0, 1)
7529 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7530 #else
7531 #define likely(x) (x)
7532 #define unlikely(x) (x)
7533 #endif
7535 /* attribute(used) as needed by some compilers */
7536 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7537 # define attribute_used __attribute__((used))
7538 #else
7539 # define attribute_used
7540 #endif
7542 #define PREFIX "$_prefix"
7544 #define USE_OSD 1
7545 #define USE_SUB 1
7547 /* enable/disable SIGHANDLER */
7548 $_def_sighandler
7550 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7551 $_def_crash_debug
7553 /* Toggles debugging informations */
7554 $_def_debug
7556 /* Toggles colorized output */
7557 //#define MSG_USE_COLORS 1
7559 /* Indicates that libcdio is available for VCD and CD-DA playback */
7560 $_def_libcdio
7562 /* Indicates that Ogle's libdvdread is available for DVD playback */
7563 $_def_dvdread
7565 /* Indicates that dvdread is from libmpdvdkit */
7566 $_def_mpdvdkit
7568 /* Additional options for libmpdvdkit*/
7569 $_def_dvd
7570 $_def_cdrom
7571 $_def_cdio
7572 $_def_dvdio
7573 $_def_bsdi_dvd
7574 $_def_dvd_bsd
7575 $_def_dvd_linux
7576 $_dev_dvd_openbsd
7577 $_def_dvd_darwin
7578 $_def_sol_scsi_h
7579 $_def_hpux_scsi_h
7580 $_def_stddef
7581 $_def_have_dvd
7583 /* Common data directory (for fonts, etc) */
7584 #define MPLAYER_DATADIR "$_datadir"
7585 #define MPLAYER_CONFDIR "$_confdir"
7586 #define MPLAYER_LIBDIR "$_libdir"
7588 /* Define this to compile stream-caching support, it can be enabled via
7589 -cache <kilobytes> */
7590 #define USE_STREAM_CACHE 1
7592 /* Define to include support for XviD/Divx4Linux/OpenDivx */
7593 $_def_divx
7595 /* Define to use the new XviD/DivX4Linux library instead of open source OpenDivX */
7596 /* You have to change DECORE_LIBS in config.mak, too! */
7597 $_def_decore
7599 /* Define if you are using DivX5Linux Decore library */
7600 $_def_divx5
7602 /* Define if you are using XviD library */
7603 $_def_xvid3
7604 $_def_xvid4
7605 $_def_decore_xvid
7606 $_def_encore_xvid
7608 /* Define if you are using the X.264 library */
7609 $_def_x264
7611 /* Define to include support for libdv-0.9.5 */
7612 $_def_libdv
7614 /* If build mencoder */
7615 $_mencoder_flag
7617 /* Indicates if XviD/Divx4linux encore is available
7618 Note: for mencoder */
7619 $_def_encore
7621 /* Indicates if libmp3lame is available
7622 Note: for mencoder */
7623 $_def_mp3lame
7624 $_def_mp3lame_preset
7625 $_def_mp3lame_preset_medium
7627 /* Define libmp1e for realtime mpeg encoding (for DXR3 and DVB cards) */
7628 $_def_mp1e
7630 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7631 (use -bps or -nobps commandline option for run-time method selection)
7632 -bps gives better sync for vbr mp3 audio, it is now default */
7633 #define AVI_SYNC_BPS 1
7635 /* Undefine this if you do not want to select mono audio (left or right)
7636 with a stereo MPEG layer 2/3 audio stream. The command line option
7637 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7638 right-only), with 0 being the default.
7640 #define USE_FAKE_MONO 1
7642 /* Undefine this if your sound card driver has no working select().
7643 If you have kernel Oops, player hangups, or just no audio, you should
7644 try to recompile MPlayer with this option disabled! */
7645 $_def_select
7647 /* define this to use iconv(3) function to codepage conversions */
7648 $_def_iconv
7650 /* define this to use nl_langinfo function */
7651 $_def_langinfo
7653 /* define this to use RTC (/dev/rtc) for video timers */
7654 $_def_rtc
7656 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7657 #define MAX_OUTBURST 65536
7659 /* set up audio OUTBURST. Do not change this! */
7660 #define OUTBURST 512
7662 /* Define this if your system has the header file for the OSS sound interface */
7663 $_def_sys_soundcard
7665 /* Define this if your system has the header file for the OSS sound interface
7666 * in /usr/include */
7667 $_def_soundcard
7669 /* Define this if your system has the sysinfo header */
7670 $_def_sys_sysinfo
7672 /* Define this if your system has ftello() */
7674 $_def_ftello
7675 #ifndef HAVE_FTELLO
7676 /* Need these for FILE and off_t an config.h is usually before other includes*/
7677 #include <stdio.h>
7678 #include <sys/types.h>
7679 off_t ftello(FILE *);
7680 #endif
7682 /* Define this if your system has the "malloc.h" header file */
7683 $_def_malloc
7685 /* memalign is mapped to malloc if unsupported */
7686 $_def_memalign
7687 #ifndef HAVE_MEMALIGN
7688 # define memalign(a,b) malloc(b)
7689 #define MEMALIGN_HACK 1
7690 #endif
7692 /* Define this if your system has the "alloca.h" header file */
7693 $_def_alloca
7695 /* Define this if your system has the "sys/mman.h" header file */
7696 $_def_mman
7697 $_def_mman_has_map_failed
7699 /* Define this if you have the elf dynamic linker -ldl library */
7700 $_def_dl
7702 /* Define this if you have the kstat kernel statistics library */
7703 $_def_kstat
7705 /* Define this if you have zlib */
7706 $_def_zlib
7707 #ifdef HAVE_ZLIB
7708 #define CONFIG_ZLIB 1
7709 #endif
7711 /* Define this if you have shm support */
7712 $_def_shm
7714 /* Define this if your system has scandir & alphasort */
7715 $_def_scandir
7717 /* Define this if your system has strsep */
7718 $_def_strsep
7720 /* Define this if your system has strlcpy */
7721 $_def_strlcpy
7722 #ifndef HAVE_STRLCPY
7723 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7724 #endif
7726 /* Define this if your system has strlcat */
7727 $_def_strlcat
7728 #ifndef HAVE_STRLCAT
7729 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7730 #endif
7732 /* Define this if your system has fseeko */
7733 $_def_fseeko
7734 #ifndef HAVE_FSEEKO
7735 /* Need these for FILE and off_t an config.h is usually before other includes*/
7736 #include <stdio.h>
7737 #include <sys/types.h>
7738 int fseeko(FILE *, off_t, int);
7739 #endif
7741 $_def_localtime_r
7743 /* Define this if your system has vsscanf */
7744 $_def_vsscanf
7746 /* Define this if your system has swab */
7747 $_def_swab
7749 /* Define this if your system has no posix select */
7750 $_def_no_posix_select
7752 /* Define this if your system has gettimeofday */
7753 $_def_gettimeofday
7755 /* Define this if your system has glob */
7756 $_def_glob
7758 /* Define this if your system has setenv */
7759 $_def_setenv
7760 #ifndef HAVE_SETENV
7761 int setenv(const char *name, const char *val, int overwrite);
7762 #endif
7764 /* Define this if your system has sysi86 */
7765 $_def_sysi86
7767 /* Define this if your system has pthreads */
7768 $_def_pthreads
7770 /* Define this if you enabled thread support for libavcodec */
7771 $_def_threads
7773 /* LIRC (remote control, see www.lirc.org) support: */
7774 $_def_lirc
7777 * LIRCCD (LIRC client daemon)
7778 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7780 $_def_lircc
7782 /* DVD navigation support using libdvdnav */
7783 $_def_dvdnav
7784 $_def_dvdnav_version
7786 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7787 #define MPEG12_POSTPROC 1
7789 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7790 $_def_libpostproc
7791 $_def_libpostproc_so
7793 /* Define to include support for OpenDivx postprocessing */
7794 $_def_odivx_postprocess
7796 /* Win32 DLL support */
7797 $_def_win32
7798 #define WIN32_PATH "$_win32libdir"
7800 /* DirectShow support */
7801 $_def_dshow
7803 /* Mac OS X specific features */
7804 $_def_macosx
7805 $_def_macosx_finder_support
7806 $_def_macosx_bundle
7807 $_def_macosx_corevideo
7809 /* Build our Win32-loader */
7810 $_def_win32_loader
7812 /* ffmpeg's libavcodec support (requires libavcodec source) */
7813 $_def_libavcodec
7814 $_def_libavcodec_so
7815 $_def_lavc_dsputil
7817 /* ffmpeg's libavformat support (requires libavformat source) */
7818 $_def_libavformat
7819 $_def_libavformat_so
7820 $_def_libavformat_win32
7822 /* Use libavcodec's decoders */
7823 #define CONFIG_DECODERS 1
7824 /* Use libavcodec's encoders */
7825 #define CONFIG_ENCODERS 1
7827 /* Use libavformat's demuxers */
7828 #define CONFIG_DEMUXERS 1
7829 /* Use libavformat's muxers */
7830 #define CONFIG_MUXERS 1
7832 #define CONFIG_MPEGAUDIO_HP 1
7834 #define CONFIG_GPL 1
7836 /* Use amr codecs from libavcodec (requires amr sources) */
7837 $_def_amr
7838 $_def_amr_nb
7839 $_def_amr_nb_fixed
7840 $_def_amr_wb
7842 /* Use specific codecs from libavcodec */
7843 `echo $_libavcodecs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7844 $_def_lavc_faac
7845 $_def_lavc_xvid
7846 $_def_lavc_mp3lame
7848 /* Use codec libs included in mplayer CVS / source dist: */
7849 $_def_mp3lib
7850 $_def_liba52
7851 $_def_libdts
7852 $_def_libmpeg2
7854 /* Use libfame encoder filter */
7855 $_def_fame
7857 /* XAnim DLL support */
7858 $_def_xanim
7859 /* Default search path */
7860 $_def_xanim_path
7862 /* RealPlayer DLL support */
7863 $_def_real
7864 /* Default search path */
7865 $_def_real_path
7867 /* LIVE555 Streaming Media library support */
7868 $_def_live
7870 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
7871 $_def_fastmemcpy
7873 /* Use unrarlib for Vobsubs */
7874 $_def_unrarlib
7876 /* gui support, please do not edit this option */
7877 $_def_gui
7878 $_def_gtk2_gui
7880 /* Audio output drivers */
7881 $_def_ossaudio
7882 $_def_ossaudio_devdsp
7883 $_def_ossaudio_devmixer
7884 $_def_alsa5
7885 $_def_alsa9
7886 $_def_alsa1x
7887 $_def_arts
7888 $_def_esd
7889 $_def_esd_latency
7890 $_def_polyp
7891 $_def_jack
7892 $_def_openal
7893 $_def_sys_asoundlib_h
7894 $_def_alsa_asoundlib_h
7895 $_def_sunaudio
7896 $_def_sgiaudio
7897 $_def_win32waveout
7898 $_def_nas
7900 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7901 #undef FAST_OSD
7902 #undef FAST_OSD_TABLE
7904 /* Enable TV Interface support */
7905 $_def_tv
7907 /* Enable Video 4 Linux TV interface support */
7908 $_def_tv_v4l
7910 /* Enable Video 4 Linux 2 TV interface support */
7911 $_def_tv_v4l2
7913 /* Enable *BSD BrookTree TV interface support */
7914 $_def_tv_bsdbt848
7916 /* Define if your processor stores words with the most significant
7917 byte first (like Motorola and SPARC, unlike Intel and VAX). */
7918 $_def_words_endian
7920 $_def_arch
7922 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
7923 have the instruction. */
7924 $_def_dcbzl
7926 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
7927 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
7929 #ifdef ARCH_POWERPC
7930 #define ARCH_PPC 1
7931 #endif
7933 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
7934 #ifdef ARCH_ARMV4L
7935 #define ARCH_ARM 1
7936 #endif
7938 /* only gcc3 can compile mvi instructions */
7939 $_def_gcc_mvi_support
7941 /* Define this for Cygwin build for win32 */
7942 $_def_confwin32
7944 /* Define this to any prefered value from 386 up to infinity with step 100 */
7945 #define __CPU__ $iproc
7947 $_mp_wordsize
7949 $_def_linux
7951 $_def_vcd
7953 #ifdef sun
7954 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
7955 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7956 #elif defined(HPUX)
7957 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7958 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7959 #elif defined(WIN32)
7960 #define DEFAULT_CDROM_DEVICE "D:"
7961 #define DEFAULT_DVD_DEVICE "D:"
7962 #elif defined(SYS_DARWIN)
7963 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
7964 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
7965 #elif defined(__OpenBSD__)
7966 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
7967 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7968 #elif defined(__FreeBSD__)
7969 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
7970 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7971 #else
7972 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7973 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7974 #endif
7977 /*----------------------------------------------------------------------------
7979 ** NOTE: Instead of modifying these definitions here, use the
7980 ** --enable/--disable options of the ./configure script!
7981 ** See ./configure --help for details.
7983 *---------------------------------------------------------------------------*/
7985 /* C99 lrintf function available */
7986 $_def_lrintf
7988 /* round function is available */
7989 $_def_round
7991 /* yes, we have inttypes.h */
7992 #define HAVE_INTTYPES_H 1
7994 /* int_fastXY_t emulation */
7995 $_def_fast_inttypes
7997 /* nanosleep support */
7998 $_def_nanosleep
8000 /* SMB support */
8001 $_def_smbsupport
8003 /* termcap flag for getch2.c */
8004 $_def_termcap
8006 /* termios flag for getch2.c */
8007 $_def_termios
8008 $_def_termios_h
8009 $_def_termios_sys_h
8011 /* enable PNG support */
8012 $_def_png
8014 /* enable JPEG support */
8015 $_def_jpg
8017 /* enable PNM support */
8018 $_def_pnm
8020 /* enable md5sum support */
8021 $_def_md5sum
8023 /* enable GIF support */
8024 $_def_gif
8025 $_def_gif_4
8026 $_def_gif_tvt_hack
8028 /* enable FreeType support */
8029 $_def_freetype
8031 /* enable Fontconfig support */
8032 $_def_fontconfig
8034 /* enable FriBiDi usage */
8035 $_def_fribidi
8037 /* enable ENCA usage */
8038 $_def_enca
8040 /* liblzo support */
8041 $_def_liblzo
8042 #ifdef USE_LIBLZO
8043 #define CONFIG_LZO 1
8044 #endif
8046 /* libmad support */
8047 $_def_mad
8049 /* enable OggVorbis support */
8050 $_def_vorbis
8052 /* enable Tremor as vorbis decoder */
8053 $_def_tremor
8055 /* enable Speex support */
8056 $_def_speex
8058 /* enable musepack support */
8059 $_def_musepack
8061 /* enable OggTheora support */
8062 $_def_theora
8064 /* enable FAAD (AAC) support */
8065 $_def_faad
8066 $_def_faad_internal
8068 /* enable FAAC (AAC encoder) support */
8069 $_def_faac
8071 /* enable LADSPA plugin support */
8072 $_def_ladspa
8074 /* enable network */
8075 $_def_network
8077 /* enable ftp support */
8078 $_def_ftp
8080 /* enable vstream support */
8081 $_def_vstream
8083 /* enable winsock2 instead of Unix functions*/
8084 $_def_winsock2
8086 /* define this to use inet_aton() instead of inet_pton() */
8087 $_def_use_aton
8089 /* enables / disables cdparanoia support */
8090 $_def_cdparanoia
8092 /* enables / disables VIDIX usage */
8093 $_def_vidix
8094 $_def_vidix_pfx
8096 /* enables / disables new input joystick support */
8097 $_def_joystick
8099 /* enables / disables QTX codecs */
8100 $_def_qtx
8102 /* enables / disables osd menu */
8103 $_def_menu
8105 /* enables / disables subtitles sorting */
8106 $_def_sortsub
8108 /* XMMS input plugin support */
8109 $_def_xmms
8110 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8112 /* enables inet6 support */
8113 $_def_inet6
8115 /* do we have gethostbyname2? */
8116 $_def_gethostbyname2
8118 /* Extension defines */
8119 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
8120 $_def_3dnowext // only define if you have 3DNOWEXT (AMD Athlon, etc.)
8121 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
8122 $_def_mmxext // only define if you have MMX2 (Athlon/PIII/4/CelII)
8123 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
8124 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
8125 $_def_altivec // only define if you have Altivec (G4)
8127 $_def_altivec_h // enables usage of altivec.h
8130 $_def_mlib // Sun mediaLib, available only on solaris
8131 $_def_vis // only define if you have VIS ( ultrasparc )
8133 /* libmpeg2 uses a different feature test macro for mediaLib */
8134 #ifdef HAVE_MLIB
8135 #define LIBMPEG2_MLIB 1
8136 #endif
8138 /* libvo options */
8139 #define SCREEN_SIZE_X 1
8140 #define SCREEN_SIZE_Y 1
8141 $_def_x11
8142 $_def_xv
8143 $_def_xvmc
8144 $_def_vm
8145 $_def_xf86keysym
8146 $_def_xinerama
8147 $_def_gl
8148 $_def_gl_win32
8149 $_def_dga
8150 $_def_dga2
8151 $_def_sdl
8152 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8153 $_def_sdlbuggy
8154 $_def_directx
8155 $_def_ggi
8156 $_def_ggiwmh
8157 $_def_3dfx
8158 $_def_tdfxfb
8159 $_def_tdfxvid
8160 $_def_directfb
8161 $_def_directfb_version
8162 $_def_zr
8163 $_def_bl
8164 $_def_mga
8165 $_def_xmga
8166 $_def_syncfb
8167 $_def_fbdev
8168 $_def_dxr2
8169 $_def_dxr3
8170 $_def_dvb
8171 $_def_dvb_in
8172 $_def_svga
8173 $_def_vesa
8174 $_def_xdpms
8175 $_def_aa
8176 $_def_caca
8177 $_def_tga
8178 $_def_toolame
8179 $_def_twolame
8181 /* used by GUI: */
8182 $_def_xshape
8184 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8185 #define X11_FULLSCREEN 1
8186 #endif
8188 #endif /* MPLAYER_CONFIG_H */
8191 #############################################################################
8193 echo "Creating libvo/config.mak"
8194 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g;s/\.m/\.o/g'`
8195 cat > libvo/config.mak << EOF
8196 include ../config.mak
8197 OPTIONAL_SRCS = $_vosrc
8198 OPTIONAL_OBJS = $_voobj
8201 #############################################################################
8203 echo "Creating libao2/config.mak"
8204 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'`
8205 cat > libao2/config.mak << EOF
8206 include ../config.mak
8207 OPTIONAL_SRCS = $_aosrc
8208 OPTIONAL_OBJS = $_aoobj
8211 #############################################################################
8213 echo "Creating libaf/config.mak"
8214 _afobj=`echo $_afsrc | sed -e 's/\.c/\.o/g'`
8215 cat > libaf/config.mak << EOF
8216 include ../config.mak
8217 OPTIONAL_SRCS = $_afsrc
8218 OPTIONAL_OBJS = $_afobj
8221 #############################################################################
8223 cat << EOF
8225 Config files successfully generated by ./configure !
8227 Install prefix: $_prefix
8228 Data directory: $_datadir
8229 Config direct.: $_confdir
8231 Byte order: $_byte_order
8232 Optimizing for: $_optimizing
8234 Languages:
8235 Messages/GUI: $_language
8238 echo -n " Manual pages: $MAN_LANG"
8239 test "$LANGUAGES" = en && echo -n " (no localization selected, use --language=all)"
8240 echo
8242 cat << EOF
8244 Enabled optional drivers:
8245 Input: $_inputmodules
8246 Codecs: $_codecmodules
8247 Audio output: $_aomodules
8248 Video output: $_vomodules
8249 Audio filters: $_afmodules
8250 Disabled optional drivers:
8251 Input: $_noinputmodules
8252 Codecs: $_nocodecmodules
8253 Audio output: $_noaomodules
8254 Video output: $_novomodules
8255 Audio filters: $_noafmodules
8257 'config.h' and 'config.mak' contain your configuration options.
8258 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8259 compile *** DO NOT REPORT BUGS if you tweak these files ***
8261 'make' will now compile MPlayer and 'make install' will install it.
8262 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8267 if test "$_mtrr" = yes ; then
8268 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8269 echo
8272 if test "$_sdl" = "outdated" ; then
8273 cat <<EOF
8274 You have an outdated version of libSDL installed (older than v1.1.7) and SDL
8275 support has therefore been disabled.
8277 Please upgrade to a more recent version (version 1.1.8 and above are known to
8278 work). You may get this library from: http://www.libsdl.org
8280 You need to rerun ./configure and recompile after updating SDL. If you are
8281 only interested in the libSDL audio drivers, then an older version might work.
8283 Use --enable-sdl to force usage of libSDL.
8288 if x86; then
8289 if test "$_win32" = no ; then
8290 if test "$_win32libdir" ; then
8291 echo "Failed to find a Win32 codecs dir at $_win32libdir!"
8292 else
8293 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
8295 cat << EOF
8296 Create it and copy the DLL files there! You can download the codecs from our
8297 homepage at http://www.mplayerhq.hu/MPlayer/releases/codecs/
8301 else
8302 cat <<EOF
8303 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8304 operating system ($system_name). You may encounter a few files that cannot
8305 be played due to missing open source video/audio codec support.
8311 cat <<EOF
8313 Check $TMPLOG if you wonder why an autodetection failed (check whether
8314 the development headers/packages are installed).
8315 Do not report compilation errors if you used any of the --enable-* options
8316 (except --enable-gui and maybe --enable-debug).
8318 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8322 if test "$_vidix" = no ; then
8323 cat <<EOF
8324 You've disabled VIDIX. Although it would be better to PORT it instead.
8325 Have a look at the documentation for supported cards!
8330 if test "$_warn_CFLAGS" = yes; then
8331 cat <<EOF
8333 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8335 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8337 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8338 To do so, execute 'CFLAGS= ./configure <options>'
8343 # Last move:
8344 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"