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 is included from the Makefiles.
22 # If you want to add a new check for $feature, here is a simple skeleton:
24 # echocheck "$feature"
25 # if "$_feature" = auto; then
27 # #include <feature.h>
28 # int main(void) { return 0; }
31 # cc_check && _feature=yes
32 # if test "$_feature" = yes ; then
33 # _def_feature='#define HAVE_FEATURE 1'
35 # _def_feature='#undef HAVE_FEATURE'
39 # Furthermore you need to add the variable _feature to the list of default
40 # settings and set it to one of yes/no/auto. Also add appropriate
41 # --enable-feature/--disable-feature command line options.
42 # The results of the check should be written to config.h and config.mak
43 # at the end of this script. The variable names used for this should be
44 # uniform, i.e. if the option is named 'feature':
46 # _feature : should have a value of yes/no/auto
47 # _def_feature : '#define ... 1' or '#undef ...' for conditional compilation
48 # _ld_feature : '-L/path/dir -lfeature' GCC options
50 #############################################################################
52 # Prevent locale nonsense from breaking basic text processing utils
56 # Prefer these macros to full length text !
57 # These macros only return an error code - NO display is done
62 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o $TMPO $@" >> "$TMPLOG"
64 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o "$TMPO" "$@" >> "$TMPLOG" 2>&1
67 echo "ldd $TMPO" >> "$TMPLOG"
68 $_ldd "$TMPO" >> "$TMPLOG" 2>&1
74 compile_check
$TMPC $@
78 compile_check
$TMPCPP $@
-lstdc++
82 "$TMPO" >> "$TMPLOG" 2>&1
85 # Display error message, flushes tempfile, exit
90 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
91 echo "Check \"$TMPLOG\" if you do not understand why it failed."
95 # OS test booleans functions
97 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
99 linux
() { issystem
"Linux" ; return "$?" ; }
100 sunos
() { issystem
"SunOS" ; return "$?" ; }
101 hpux
() { issystem
"HP-UX" ; return "$?" ; }
102 irix
() { issystem
"IRIX" ; return "$?" ; }
103 aix
() { issystem
"AIX" ; return "$?" ; }
104 cygwin
() { issystem
"CYGWIN" ; return "$?" ; }
105 freebsd
() { issystem
"FreeBSD" ; return "$?" ; }
106 netbsd
() { issystem
"NetBSD" ; return "$?" ; }
107 bsdos
() { issystem
"BSD/OS" ; return "$?" ; }
108 openbsd
() { issystem
"OpenBSD" ; return "$?" ; }
109 bsd
() { freebsd || netbsd || bsdos || openbsd
; return "$?" ; }
110 qnx
() { issystem
"QNX" ; return "$?" ; }
111 darwin
() { issystem
"Darwin" ; return "$?" ; }
112 gnu
() { issystem
"GNU" ; return "$?" ; }
113 mingw32
() { issystem
"MINGW32" ; return "$?" ; }
114 morphos
() { issystem
"MorphOS" ; return "$?" ; }
115 win32
() { cygwin || mingw32
; return "$?" ; }
116 beos
() { issystem
"BEOS" ; return "$?" ; }
118 # arch test boolean functions
119 # x86/x86pc is used by QNX
122 i
[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium
*|athlon
*|i586-i686
) return 0 ;;
129 x86_64|amd64
) return 0 ;;
155 # not boolean test: implement the posix shell "!" operator for a
157 # usage: not {command}
158 # returns exit status "success" when the execution of "command"
165 # Use this before starting a check
167 echo "============ Checking for $@ ============" >> "$TMPLOG"
168 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
171 # Use this to echo the results of a check
173 if test "$_res_comment" ; then
174 _res_comment
="($_res_comment)"
176 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
177 echo "##########################################" >> "$TMPLOG"
179 echo "$@ $_res_comment"
182 #############################################################################
184 # Check how echo works in this /bin/sh
186 -n) _echo_n
= _echo_c
='\c' ;; # SysV echo
187 *) _echo_n
='-n ' _echo_c
= ;; # BSD echo
190 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"`
194 Usage: $0 [OPTIONS]...
197 -h, --help display this help and exit
199 Installation directories:
200 --prefix=DIR prefix directory for installation [/usr/local]
201 --bindir=DIR directory for installing binaries [PREFIX/bin]
202 --datadir=DIR directory for installing machine independent
203 data files (skins, etc) [PREFIX/share/mplayer]
204 --mandir=DIR directory for installing man pages [PREFIX/man]
205 --confdir=DIR directory for installing configuration files
207 --libdir=DIR directory for object code libraries [PREFIX/lib]
208 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
209 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
210 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
211 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
214 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
215 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
216 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
217 --enable-largefiles enable support for files > 2GB [disable]
218 --enable-linux-devfs set default devices to devfs [disable]
219 --enable-termcap use termcap database for key codes [autodetect]
220 --enable-termios use termios database for key codes [autodetect]
221 --disable-iconv disable iconv for encoding conversion [autodetect]
222 --disable-langinfo do not use langinfo [autodetect]
223 --enable-lirc enable LIRC (remote control) support [autodetect]
224 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
225 --enable-joystick enable joystick support [disable]
226 --disable-vm disable X video mode extensions [autodetect]
227 --disable-xf86keysym disable support for multimedia keys [autodetect]
228 --enable-radio enable radio interface [disable]
229 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
230 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
231 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
232 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
233 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
234 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
235 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
236 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
237 --disable-network disable networking [enable]
238 --enable-winsock2 enable winsock2 [autodetect]
239 --enable-smb enable Samba (SMB) input [autodetect]
240 --enable-live enable LIVE555 Streaming Media [autodetect]
241 --disable-dvdnav disable libdvdnav [autodetect]
242 --disable-dvdread disable libdvdread [autodetect]
243 --disable-dvdread-internal disable internal libdvdread [autodetect]
244 --disable-cdparanoia disable cdparanoia [autodetect]
245 --disable-bitmap-font disable bitmap font support [enable]
246 --disable-freetype disable FreeType 2 font rendering [autodetect]
247 --disable-fontconfig disable fontconfig font lookup [autodetect]
248 --disable-unrarlib disable Unique RAR File Library [enabled]
249 --enable-menu enable OSD menu (not DVD menu) [disabled]
250 --disable-sortsub disable subtitle sorting [enabled]
251 --enable-fribidi enable the FriBiDi libs [autodetect]
252 --disable-enca disable ENCA charset oracle library [autodetect]
253 --disable-macosx disable Mac OS X specific features [autodetect]
254 --disable-maemo disable maemo specific features [autodetect]
255 --enable-macosx-finder-support enable Mac OS X Finder invocation
256 parameter parsing [disabled]
257 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
258 --disable-inet6 disable IPv6 support [autodetect]
259 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
260 --disable-ftp disable FTP support [enabled]
261 --disable-vstream disable TiVo vstream client support [autodetect]
262 --disable-pthreads disable Posix threads support [autodetect]
263 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
264 --enable-rpath enable runtime linker path for extra libs [disabled]
267 --enable-gif enable GIF support [autodetect]
268 --enable-png enable PNG input/output support [autodetect]
269 --enable-jpeg enable JPEG input/output support [autodetect]
270 --enable-libcdio enable external libcdio [autodetect]
271 --enable-liblzo enable external liblzo [autodetect]
272 --disable-win32 disable Win32 DLL support [enabled]
273 --disable-qtx disable QuickTime codecs support [enabled]
274 --disable-xanim disable XAnim codecs support [enabled]
275 --disable-real disable RealPlayer codecs support [enabled]
276 --disable-xvid disable XviD [autodetect]
277 --disable-xvid3 disable XviD 3 [autodetect]
278 --disable-x264 disable x264 [autodetect]
279 --disable-nut disable libnut [autodetect]
280 --disable-libavutil disable libavutil [autodetect]
281 --disable-libavcodec disable libavcodec [autodetect]
282 --disable-libavformat disable libavformat [autodetect]
283 --disable-libpostproc disable libpostproc [autodetect]
284 --disable-libavutil_so disable shared libavutil [autodetect]
285 --disable-libavcodec_so disable shared libavcodec [autodetect]
286 --disable-libavformat_so disable shared libavformat [autodetect]
287 --disable-libpostproc_so disable shared libpostproc [autodetect]
288 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
289 in libavcodec [enabled]
290 --disable-tremor-internal disable internal Tremor [enabled]
291 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
292 --enable-tremor-external enable external Tremor [autodetect]
293 --disable-libvorbis disable libvorbis support [autodetect]
294 --disable-speex disable Speex support [autodetect]
295 --enable-theora enable OggTheora libraries [autodetect]
296 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
297 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
298 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
299 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
300 --disable-ladspa disable LADSPA plugin support [autodetect]
301 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
302 --disable-mad disable libmad (MPEG audio) support [autodetect]
303 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
304 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
305 --enable-xmms enable XMMS input plugin support [disabled]
306 --enable-libdts enable libdts support [autodetect]
307 --disable-mp3lib disable builtin mp3lib [enabled]
308 --disable-liba52 disable builtin liba52 [enabled]
309 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
310 --disable-musepack disable musepack support [autodetect]
311 --disable-amr_nb disable AMR narrowband, floating-point [autodetect]
312 --disable-amr_nb-fixed disable AMR narrowband, fixed-point [autodetect]
313 --disable-amr_wb disable AMR wideband, floating-point [autodetect]
314 --disable-decoder=DECODER disable specified FFmpeg decoder
315 --enable-decoder=DECODER enable specified FFmpeg decoder
316 --disable-encoder=ENCODER disable specified FFmpeg encoder
317 --enable-encoder=ENCODER enable specified FFmpeg encoder
318 --disable-parser=PARSER disable specified FFmpeg parser
319 --enable-parser=PARSER enable specified FFmpeg parser
320 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
321 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
322 --disable-muxer=MUXER disable specified FFmpeg muxer
323 --enable-muxer=MUXER enable specified FFmpeg muxer
326 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
327 --disable-vidix-external disable external VIDIX [for x86 *nix]
328 --enable-gl enable OpenGL video output [autodetect]
329 --enable-dga[=n] enable DGA [n in {1, 2} ] support [autodetect]
330 --enable-vesa enable VESA video output [autodetect]
331 --enable-svga enable SVGAlib video output [autodetect]
332 --enable-sdl enable SDL video output [autodetect]
333 --enable-aa enable AAlib video output [autodetect]
334 --enable-caca enable CACA video output [autodetect]
335 --enable-ggi enable GGI video output [autodetect]
336 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
337 --enable-directx enable DirectX video output [autodetect]
338 --enable-dxr2 enable DXR2 video output [autodetect]
339 --enable-dxr3 enable DXR3/H+ video output [autodetect]
340 --enable-ivtv enable IVTV TV-Out video output [autodetect]
341 --enable-dvb enable DVB video output [autodetect]
342 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
343 --enable-mga enable mga_vid video output [autodetect]
344 --enable-xmga enable mga_vid X11 video output [autodetect]
345 --enable-xv enable Xv video output [autodetect]
346 --enable-xvmc enable XvMC acceleration [disable]
347 --enable-vm enable XF86VidMode support [autodetect]
348 --enable-xinerama enable Xinerama support [autodetect]
349 --enable-x11 enable X11 video output [autodetect]
350 --enable-xshape enable XShape support [autodetect]
351 --enable-fbdev enable FBDev video output [autodetect]
352 --enable-mlib enable mediaLib video output (Solaris) [disable]
353 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
354 --enable-tdfxfb enable tdfxfb video output [disable]
355 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
356 --enable-directfb enable DirectFB video output [autodetect]
357 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
358 --enable-bl enable Blinkenlights video output [disable]
359 --enable-tdfxvid enable tdfx_vid video output [disable]
360 --disable-tga disable Targa video output [enable]
361 --disable-pnm disable PNM video output [enable]
362 --disable-md5sum disable md5sum video output [enable]
365 --disable-alsa disable ALSA audio output [autodetect]
366 --disable-ossaudio disable OSS audio output [autodetect]
367 --disable-arts disable aRts audio output [autodetect]
368 --disable-esd disable esd audio output [autodetect]
369 --disable-polyp disable Polypaudio audio output [autodetect]
370 --disable-jack disable JACK audio output [autodetect]
371 --disable-openal disable OpenAL audio output [autodetect]
372 --disable-nas disable NAS audio output [autodetect]
373 --disable-sgiaudio disable SGI audio output [autodetect]
374 --disable-sunaudio disable Sun audio output [autodetect]
375 --disable-win32waveout disable Windows waveout audio output [autodetect]
376 --disable-select disable using select() on the audio device [enable]
378 Miscellaneous options:
379 --enable-runtime-cpudetection enable runtime CPU detection [disable]
380 --enable-cross-compile enable cross-compilation [autodetect]
381 --cc=COMPILER C compiler to build MPlayer [gcc]
382 --host-cc=COMPILER C compiler for tools needed while building [gcc]
383 --as=ASSEMBLER assembler to build MPlayer [as]
384 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
385 --enable-static build a statically linked binary
386 --charset=charset convert the console messages to this character set
387 --language=list a white space or comma separated list of languages for
388 translated man pages, the first language is used for
389 messages and the GUI (the environment variable
390 \$LINGUAS is also honored) [en]
391 (Available: $LANGUAGES all)
392 --with-install=PATH path to a custom install program
393 --enable-color-console enable color console output [disable]
396 --enable-mmx enable MMX [autodetect]
397 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
398 --enable-3dnow enable 3DNow! [autodetect]
399 --enable-3dnowext enable extended 3DNow! [autodetect]
400 --enable-sse enable SSE [autodetect]
401 --enable-sse2 enable SSE2 [autodetect]
402 --enable-shm enable shm [autodetect]
403 --enable-altivec enable AltiVec (PowerPC) [autodetect]
404 --enable-armv5te enable DSP extensions (ARM) [autodetect]
405 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
406 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
407 --enable-big-endian force byte order to big-endian [autodetect]
408 --enable-debug[=1-3] compile-in debugging information [disable]
409 --enable-profile compile-in profiling information [disable]
410 --disable-sighandler disable sighandler for crashes [enable]
411 --enable-crash-debug enable automatic gdb attach on crash [disable]
412 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
414 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
415 --disable-gcc-check disable gcc version checking [enable]
417 Use these options if autodetection fails (Options marked with (*) accept
418 multiple paths separated by ':'):
419 --extra-libs=FLAGS extra linker flags
420 --with-extraincdir=DIR extra header search paths in DIR (*)
421 --with-extralibdir=DIR extra linker search paths in DIR (*)
422 --with-x11libdir=DIR X library files in DIR (*)
423 --with-mliblibdir=DIR libmlib (mediaLib) in DIR (Solaris only)
424 --with-xvidlibdir=DIR libxvidcore (XviD) in DIR (*)
425 --with-x264libdir=DIR libx264 in DIR
426 --with-libdtslibdir=DIR libdts in DIR (*)
427 --with-livelibdir=DIR LIVE555 Streaming Media in DIR
428 --with-toolamelibdir=DIR Toolame in DIR
429 --with-xmmsplugindir=DIR XMMS plugins in DIR
430 --with-xmmslibdir=DIR libxmms.so.1 in DIR
431 --with-cdparanoialibdir=DIR cdparanoia libraries (libcdda_*) in DIR (*)
432 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
434 --with-freetype-config=PATH path to freetype-config
435 --with-fribidi-config=PATH path to fribidi-config
436 --with-glib-config=PATH path to glib*-config
437 --with-gtk-config=PATH path to gtk*-config
438 --with-sdl-config=PATH path to sdl*-config
439 --with-dvdnav-config=PATH path to dvdnav-config
441 This configure script is NOT autoconf-based, even though its output is similar.
442 It will try to autodetect all configuration options. If you --enable an option
443 it will be forcefully turned on, skipping autodetection. This can break
444 compilation, so you need to know what you are doing.
449 for parm
in "$@" ; do
456 # 1st pass checking for vital options
470 test "$CC" && _cc
="$CC"
473 _runtime_cpudetection
=no
478 _target
=`echo $ac_option | cut -d '=' -f 2`
481 _cc
=`echo $ac_option | cut -d '=' -f 2`
484 _host_cc
=`echo $ac_option | cut -d '=' -f 2`
487 _as
=`echo $ac_option | cut -d '=' -f 2`
501 --with-extraincdir=*)
502 _inc_extra
=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
504 --with-extralibdir=*)
505 _ld_extra
=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
508 _extra_libs
=`echo $ac_option | cut -d '=' -f 2`
510 --enable-runtime-cpudetection)
511 _runtime_cpudetection
=yes
513 --disable-runtime-cpudetection)
514 _runtime_cpudetection
=no
516 --enable-cross-compile)
519 --disable-cross-compile)
523 _install
=`echo $ac_option | cut -d '=' -f 2 `
535 _debug
=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
543 # Determine our OS name and CPU architecture
544 if test -z "$_target" ; then
546 system_name
=`uname -s 2>&1`
547 case "$system_name" in
548 Linux|FreeBSD|NetBSD|BSD
/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX
)
556 [cC
][yY
][gG
][wW
][iI
][nN
]*)
563 system_name
="$system_name-UNKNOWN"
568 # host's CPU/instruction set
569 host_arch
=`uname -p 2>&1`
571 i386|sparc|ppc|alpha|arm|mips|vax
)
573 powerpc
) # Darwin returns 'powerpc'
576 *) # uname -p on Linux returns 'unknown' for the processor type,
577 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
579 # Maybe uname -m (machine hardware name) returns something we
582 # x86/x86pc is used by QNX
583 case "`uname -m 2>&1`" in
584 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
;;
585 ia64
) host_arch
=ia64
;;
587 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
588 -z "`echo $CFLAGS | grep -- -m32`" ]; then
594 macppc|ppc|ppc64
) host_arch
=ppc
;;
595 alpha
) host_arch
=alpha
;;
596 sparc
) host_arch
=sparc
;;
597 sparc64
) host_arch
=sparc64
;;
598 parisc
*|hppa
*|
9000*) host_arch
=hppa
;;
599 arm
*|zaurus|cats
) host_arch
=arm
;;
600 s390
) host_arch
=s390
;;
601 s390x
) host_arch
=s390x
;;
602 mips
*) host_arch
=mips
;;
603 vax
) host_arch
=vax
;;
604 *) host_arch
=UNKNOWN
;;
608 else # if test -z "$_target"
609 system_name
=`echo $_target | cut -d '-' -f 2`
610 case "`echo $system_name | tr A-Z a-z`" in
611 linux
) system_name
=Linux
;;
612 freebsd
) system_name
=FreeBSD
;;
613 netbsd
) system_name
=NetBSD
;;
614 bsd
/os
) system_name
=BSD
/OS
;;
615 openbsd
) system_name
=OpenBSD
;;
616 sunos
) system_name
=SunOS
;;
617 qnx
) system_name
=QNX
;;
618 morphos
) system_name
=MorphOS
;;
619 mingw32msvc
) system_name
=MINGW32
;;
621 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
622 host_arch
=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
625 echo "Detected operating system: $system_name"
626 echo "Detected host architecture: $host_arch"
628 # LGB: temporary files
629 for I
in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
633 TMPLOG
="configure.log"
635 TMPC
="$I/mplayer-conf-$RANDOM-$$.c"
636 TMPCPP
="$I/mplayer-conf-$RANDOM-$$.cpp"
637 TMPO
="$I/mplayer-conf-$RANDOM-$$.o"
638 TMPS
="$I/mplayer-conf-$RANDOM-$$.S"
642 # FIXME: A lot of stuff is installed under /usr/local
643 # NK: But we should never use this stuff implicitly since we call compiler
644 # from /usr we should be sure that there no effects from other compilers
645 # (libraries) which might be installed into /usr/local. Let users use this
646 # stuff explicitly as command line argument. In other words: It would be
647 # resonable to have only /usr/include or only /usr/local/include.
650 _ld_extra
="$_ld_extra -L/usr/local/lib"
651 _inc_extra
="$_inc_extra -I/usr/local/include"
665 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
666 # if used as 'head -1' instead of 'head -n 1', but older versions don't
668 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
669 _head
() { head -$1 2>/dev
/null
; }
671 _head
() { head -n $1 2>/dev
/null
; }
673 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
674 _tail
() { tail -$1 2>/dev
/null
; }
676 _tail
() { tail -n $1 2>/dev
/null
; }
679 # Checking CC version...
680 if test "$_gcc_check" = yes ; then
681 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
682 if test "`basename $_cc`" = "icc" ||
test "`basename $_cc`" = "ecc"; then
683 echocheck
"$_cc version"
685 cc_name
=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
686 cc_version
=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
687 _cc_major
=`echo $cc_version | cut -d '.' -f 1`
688 _cc_minor
=`echo $cc_version | cut -d '.' -f 2`
689 # TODO verify older icc/ecc compatibility
692 cc_version
="v. ?.??, bad"
696 cc_version
="$cc_version, ok"
700 cc_version
="$cc_version, bad"
704 echores
"$cc_version"
706 for _cc
in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc
; do
707 echocheck
"$_cc version"
709 cc_name
=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
710 cc_version
=`$_cc -dumpversion 2>&1`
711 if test "$?" -gt 0; then
712 cc_version
="not found"
716 cc_version
="v. ?.??, bad"
719 2.95.
[2-9]|
2.95.
[2-9][-.
]*|
[3-4].
*)
720 _cc_major
=`echo $cc_version | cut -d '.' -f 1`
721 _cc_minor
=`echo $cc_version | cut -d '.' -f 2`
722 _cc_mini
=`echo $cc_version | cut -d '.' -f 3`
723 cc_version
="$cc_version, ok"
730 cc_version
="$cc_version, bad"
734 echores
"$cc_version"
735 test "$cc_verc_fail" = "no" && break
738 if test "$cc_verc_fail" = yes ; then
741 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
743 You are not using a supported compiler. We do not have the time to make sure
744 everything works with compilers other than the ones we use. Use either the
745 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
746 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
748 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
749 mplayer and lame (which is used for mencoder). If you get compile errors,
750 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
751 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
754 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
756 *** For details please read DOCS/HTML/en/users-vs-dev.html ***
759 die
"Bad gcc version"
764 ******************************************************************************
766 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
767 Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???
769 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
770 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
771 Lame which is used by mencoder produces weird errors, too.
773 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
774 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
776 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
778 ******************************************************************************
786 test "$_host_cc" || _host_cc
=$_cc
789 echocheck
"cross compilation"
790 if test $_cross_compile = auto
; then
792 int main() { return 0; }
795 cc_check
&& "$TMPO" && _cross_compile
=no
797 echores
$_cross_compile
799 if test $_cross_compile = yes; then
807 # now that we know what compiler should be used for compilation, try to find
808 # out which assembler is used by the $_cc compiler
809 if test "$_as" = auto
; then
810 _as
=`$_cc -print-prog-name=as`
811 test -z "$_as" && _as
=as
814 # XXX: this should be ok..
816 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
817 # FIXME: Remove the cygwin check once AMD CPUs are supported
818 if test -r /proc
/cpuinfo
&& not cygwin
; then
819 # Linux with /proc mounted, extract CPU information from it
820 _cpuinfo
="cat /proc/cpuinfo"
821 elif test -r /compat
/linux
/proc
/cpuinfo
&& not x86
; then
822 # FreeBSD with Linux emulation /proc mounted,
823 # extract CPU information from it
824 _cpuinfo
="cat /compat/linux/proc/cpuinfo"
825 elif darwin
&& not x86
; then
826 # use hostinfo on Darwin
829 # use 'lsattr' on AIX
830 _cpuinfo
="lsattr -E -l proc0 -a type"
831 elif x86 || x86_64
; then
832 # all other OSes try to extract CPU information from a small helper
833 # program TOOLS/cpuinfo instead
834 $_cc -o TOOLS
/cpuinfo TOOLS
/cpuinfo.c
835 _cpuinfo
="TOOLS/cpuinfo"
838 if x86 || x86_64
; then
839 # gather more CPU information
840 pname
=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
841 pvendor
=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
842 pfamily
=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
843 pmodel
=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
844 pstepping
=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
846 exts
=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
848 pparam
=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
849 -e s/xmm/sse/ -e s/kni/sse/`
851 for ext
in $pparam ; do
852 eval _
$ext=auto
&& eval _
$ext=yes
855 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
856 test $_sse = yes && _mmxext
=yes
858 echocheck
"CPU vendor"
859 echores
"$pvendor ($pfamily:$pmodel:$pstepping)"
866 i
[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium
*|athlon
*|i586-i686
)
867 _def_arch_x86
="#define ARCH_X86 1"
868 _target_arch_x86
="TARGET_ARCH_X86 = yes"
869 _def_arch
="#define ARCH_X86_32 1"
870 _target_arch
="TARGET_ARCH_X86_32 = yes"
876 3) proc
=i386 iproc
=386 ;;
877 4) proc
=i486 iproc
=486 ;;
878 5) iproc
=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
879 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
880 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
882 elif test "$pmodel" -ge 8; then
884 elif test "$pmodel" -ge 6; then
891 # It's a bit difficult to determine the correct type of Family 6
892 # AMD CPUs just from their signature. Instead, we check directly
893 # whether it supports SSE.
894 if test "$_sse" = yes; then
895 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
898 # Again, gcc treats athlon and athlon-tbird similarly.
903 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
904 # caught and remedied in the optimization tests below.
908 *) proc
=k8 iproc
=686 ;;
913 3) proc
=i386 iproc
=386 ;;
914 4) proc
=i486 iproc
=486 ;;
916 if test "$pmodel" -eq 4 ||
test "$pmodel" -eq 8; then
917 proc
=pentium-mmx
# 4 is desktop, 8 is mobile
923 if test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
925 elif test "$pmodel" -ge 7; then
927 elif test "$pmodel" -ge 3; then
934 # A nocona in 32-bit mode has no more capabilities than a prescott.
935 if test "$pmodel" -ge 3; then
941 *) proc
=prescott iproc
=686 ;;
947 if test "$pmodel" -ge 8; then
949 elif test "$pmodel" -ge 4; then
956 if test "$pmodel" -ge 9; then
963 *) proc
=i686 iproc
=i686
;;
968 3) proc
=i386 iproc
=386 ;;
969 4) proc
=i486 iproc
=486 ;;
970 *) proc
=i586 iproc
=586 ;;
974 proc
=i586 iproc
=586 ;;
977 # check that gcc supports our CPU, if not, fall back to earlier ones
978 # LGB: check -mcpu and -march swithing step by step with enabling
979 # to fall back till 386.
981 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
983 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] ||
( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
989 echocheck
"GCC & CPU optimization abilities"
991 int main(void) { return 0; }
993 if test "$_runtime_cpudetection" = no
; then
994 if test "$proc" = "k8"; then
995 cc_check
-march=$proc $cpuopt=$proc || proc
=athlon-xp
997 if test "$proc" = "athlon-xp"; then
998 cc_check
-march=$proc $cpuopt=$proc || proc
=athlon
1000 if test "$proc" = "k6-3" ||
test "$proc" = "k6-2"; then
1001 cc_check
-march=$proc $cpuopt=$proc || proc
=k6
1003 if test "$proc" = "k6" ||
test "$proc" = "c3"; then
1004 if not cc_check
-march=$proc $cpuopt=$proc; then
1005 if cc_check
-march=i586
$cpuopt=i686
; then
1012 if test "$proc" = "prescott" ; then
1013 cc_check
-march=$proc $cpuopt=$proc || proc
=pentium4
1015 if test "$proc" = "pentium4" ||
test "$proc" = "pentium-m" ||
test "$proc" = "pentium3" ||
test "$proc" = "pentium2" ||
test "$proc" = "athlon" ||
test "$proc" = "c3-2"; then
1016 cc_check
-march=$proc $cpuopt=$proc || proc
=i686
1018 if test "$proc" = "i686" ||
test "$proc" = "pentium-mmx" ||
test "$proc" = "winchip-c6" ||
test "$proc" = "winchip2"; then
1019 cc_check
-march=$proc $cpuopt=$proc || proc
=i586
1021 if test "$proc" = "i586"; then
1022 cc_check
-march=$proc $cpuopt=$proc || proc
=i486
1024 if test "$proc" = "i486" ; then
1025 cc_check
-march=$proc $cpuopt=$proc || proc
=i386
1027 if test "$proc" = "i386" ; then
1028 cc_check
-march=$proc $cpuopt=$proc || proc
=error
1030 if test "$proc" = "error" ; then
1031 echores
"CPU optimization disabled. CPU not recognized or your compiler is too old."
1035 elif test "$proc" = "i586-i686"; then
1036 _march
="-march=i586"
1037 _mcpu
="$cpuopt=i686"
1040 _march
="-march=$proc"
1041 _mcpu
="$cpuopt=$proc"
1044 else # if test "$_runtime_cpudetection" = no
1045 # i686 is probably the most common CPU - optimize for it
1046 _mcpu
="$cpuopt=i686"
1047 # at least i486 required, for bswap instruction
1048 _march
="-march=i486"
1049 cc_check
$_mcpu || _mcpu
=""
1050 cc_check
$_march $_mcpu || _march
=""
1053 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1054 ## autodetected mcpu/march parameters
1055 if test "$_target" ; then
1056 # TODO: it may be a good idea to check GCC and fall back in all cases
1057 if test "$host_arch" = "i586-i686"; then
1058 _march
="-march=i586"
1059 _mcpu
="$cpuopt=i686"
1061 _march
="-march=$host_arch"
1062 _mcpu
="$cpuopt=$host_arch"
1070 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx
) iproc
=586 ;;
1071 i686|athlon
*|pentium
*) iproc
=686 ;;
1080 _def_arch
='#define ARCH_IA64 1'
1081 _target_arch
='TARGET_ARCH_IA64 = yes'
1090 _def_arch
='#define ARCH_X86_64 1'
1091 _target_arch
='TARGET_ARCH_X86_64 = yes'
1092 _def_arch_x86
="#define ARCH_X86 1"
1093 _target_arch_x86
="TARGET_ARCH_X86 = yes"
1096 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1097 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1106 # 64-bit prescotts exist, but as far as GCC is concerned they have the
1107 # same capabilities as a nocona.
1113 echocheck
"GCC & CPU optimization abilities"
1115 int main(void) { return 0; }
1117 # This is a stripped-down version of the i386 fallback.
1118 if test "$_runtime_cpudetection" = no
; then
1119 # --- AMD processors ---
1120 if test "$proc" = "k8"; then
1121 cc_check
-march=$proc $cpuopt=$proc || proc
=athlon-xp
1123 # This will fail if gcc version < 3.3, which is ok because earlier
1124 # versions don't really support 64-bit on amd64.
1125 # Is this a valid assumption? -Corey
1126 if test "$proc" = "athlon-xp"; then
1127 cc_check
-march=$proc $cpuopt=$proc || proc
=error
1129 # --- Intel processors ---
1130 if test "$proc" = "nocona"; then
1131 cc_check
-march=$proc $cpuopt=$proc || proc
=pentium4
1133 if test "$proc" = "pentium4"; then
1134 cc_check
-march=$proc $cpuopt=$proc || proc
=error
1137 _march
="-march=$proc"
1138 _mcpu
="$cpuopt=$proc"
1139 if test "$proc" = "error" ; then
1140 echores
"CPU optimization disabled. CPU not recognized or your compiler is too old."
1144 else # if test "$_runtime_cpudetection" = no
1145 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1146 _march
="-march=x86-64"
1147 _mcpu
="$cpuopt=x86-64"
1148 cc_check
$_mcpu || _mcpu
=""
1149 cc_check
$_march $_mcpu || _march
=""
1158 _def_arch
='#define ARCH_SPARC 1'
1159 _target_arch
='TARGET_ARCH_SPARC = yes'
1162 echocheck
"CPU type"
1164 case "`echo $karch`" in
1169 sun4u
) proc
=v9 _vis
='yes' _def_vis
='#define HAVE_VIS = yes' ;;
1183 _def_arch
='#define ARCH_SPARC 1'
1184 _target_arch
='TARGET_ARCH_SPARC = yes'
1186 _def_vis
='#define HAVE_VIS = yes'
1194 arm|armv4l|armv5tel
)
1195 _def_arch
='#define ARCH_ARMV4L 1'
1196 _target_arch
='TARGET_ARCH_ARMV4L = yes'
1205 _def_arch
='#define ARCH_POWERPC 1'
1206 _def_dcbzl
='#define NO_DCBZL 1'
1207 _target_arch
='TARGET_ARCH_POWERPC = yes'
1215 echocheck
"CPU type"
1216 case $system_name in
1218 proc
=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1219 if test -n "`$_cpuinfo | grep altivec`"; then
1224 proc
=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1225 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
1226 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
1231 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1233 2*|
3.0*|
3.1*|
3.2*|
3.3*)
1236 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1243 proc
=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
1246 if test "$_altivec" = yes; then
1247 echores
"$proc altivec"
1252 echocheck
"GCC & CPU optimization abilities"
1254 if test -n "$proc"; then
1256 601) _march
='-mcpu=601' _mcpu
='-mtune=601' ;;
1257 603) _march
='-mcpu=603' _mcpu
='-mtune=603' ;;
1258 603e|
603ev
) _march
='-mcpu=603e' _mcpu
='-mtune=603e' ;;
1259 604|
604e|
604r|
604ev
) _march
='-mcpu=604' _mcpu
='-mtune=604' ;;
1260 740|
740/750|
745/755) _march
='-mcpu=740' _mcpu
='-mtune=740' ;;
1261 750|
750CX
) _march
='-mcpu=750' _mcpu
='-mtune=750' ;;
1262 POWER
) _march
='-mcpu=power' _mcpu
='-mtune=power' ;;
1263 POWER2
) _march
='-mcpu=power2' _mcpu
='-mtune=power2' ;;
1264 POWER3
) _march
='-mcpu=power3' _mcpu
='-mtune=power3' ;;
1267 # gcc 3.1(.1) and up supports 7400 and 7450
1268 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" ||
test "$_cc_major" -ge "4"; then
1270 7400*|
7410*) _march
='-mcpu=7400' _mcpu
='-mtune=7400' ;;
1271 7447*|
7450*|
7455*) _march
='-mcpu=7450' _mcpu
='-mtune=7450' ;;
1275 # gcc 3.2 and up supports 970
1276 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" ||
test "$_cc_major" -ge "4"; then
1278 970*|PPC970
*) _march
='-mcpu=970' _mcpu
='-mtune=970'
1279 _def_dcbzl
='#undef NO_DCBZL' ;;
1283 # gcc 3.3 and up supports POWER4
1284 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" ||
test "$_cc_major" -ge "4"; then
1286 POWER4
) _march
='-mcpu=power4' _mcpu
='-mtune=power4' ;;
1290 # gcc 4.0 and up supports POWER5
1291 if test "$_cc_major" -ge "4"; then
1293 POWER5
*) _march
='-mcpu=power5' _mcpu
='-mtune=power5' ;;
1299 if test -n "$_mcpu"; then
1300 _optimizing
=`echo $_mcpu | cut -c 8-`
1301 echores
"$_optimizing"
1309 _def_arch
='#define ARCH_ALPHA 1'
1310 _target_arch
='TARGET_ARCH_ALPHA = yes'
1314 echocheck
"CPU type"
1317 unsigned long ver, mask;
1318 asm ("implver %0" : "=r" (ver));
1319 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1320 printf("%ld-%x\n", ver, ~mask);
1324 $_cc -o "$TMPO" "$TMPC"
1327 0-0) proc
="ev4"; cpu_understands_mvi
="0";;
1328 1-0) proc
="ev5"; cpu_understands_mvi
="0";;
1329 1-1) proc
="ev56"; cpu_understands_mvi
="0";;
1330 1-101) proc
="pca56"; cpu_understands_mvi
="1";;
1331 2-303) proc
="ev6"; cpu_understands_mvi
="1";;
1332 2-307) proc
="ev67"; cpu_understands_mvi
="1";;
1333 2-1307) proc
="ev68"; cpu_understands_mvi
="1";;
1337 echocheck
"GCC & CPU optimization abilities"
1338 if test "$proc" = "ev68" ; then
1339 cc_check
-mcpu=$proc || proc
=ev67
1341 if test "$proc" = "ev67" ; then
1342 cc_check
-mcpu=$proc || proc
=ev6
1349 echocheck
"MVI instruction support in GCC"
1350 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
1351 _def_gcc_mvi_support
="#define CAN_COMPILE_ALPHA_MVI 1"
1354 _def_gcc_mvi_support
="#undef CAN_COMPILE_ALPHA_MVI"
1355 echores
"no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
1360 _def_arch
='#define ARCH_SGI_MIPS 1'
1361 _target_arch
='TARGET_ARCH_SGI_MIPS = yes'
1369 echocheck
"CPU type"
1370 proc
=`hinv -c processor | grep CPU | cut -d " " -f3`
1371 case "`echo $proc`" in
1372 R3000
) _march
='-mips1' _mcpu
='-mtune=r2000' ;;
1373 R4000
) _march
='-mips3' _mcpu
='-mtune=r4000' ;;
1374 R4400
) _march
='-mips3' _mcpu
='-mtune=r4400' ;;
1375 R4600
) _march
='-mips3' _mcpu
='-mtune=r4600' ;;
1376 R5000
) _march
='-mips4' _mcpu
='-mtune=r5000' ;;
1377 R8000|R10000|R12000|R14000|R16000
) _march
='-mips4' _mcpu
='-mtune=r8000' ;;
1379 # gcc < 3.x does not support -mtune.
1380 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
1389 _def_arch
='#define ARCH_PA_RISC 1'
1390 _target_arch
='TARGET_ARCH_PA_RISC = yes'
1399 _def_arch
='#define ARCH_S390 1'
1400 _target_arch
='TARGET_ARCH_S390 = yes'
1409 _def_arch
='#define ARCH_S390X 1'
1410 _target_arch
='TARGET_ARCH_S390X = yes'
1419 _def_arch
='#define ARCH_VAX 1'
1420 _target_arch
='TARGET_ARCH_VAX = yes'
1429 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1430 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1431 die
"unsupported architecture $host_arch"
1433 esac # case "$host_arch" in
1435 if test "$_runtime_cpudetection" = yes ; then
1451 if x86
&& test "$_runtime_cpudetection" = no
; then
1453 if test "$1" = yes ; then
1454 echocheck
"kernel support of $2"
1457 void catch() { exit(1); }
1459 signal(SIGILL, catch);
1460 __asm__ __volatile__ ("$3":::"memory");return(0);
1464 if cc_check
&& tmp_run
; then
1466 _optimizing
="$_optimizing $2"
1470 echo "It seems that your kernel does not correctly support $2."
1471 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1478 extcheck
$_mmx "mmx" "emms" || _mmx
=no
1479 extcheck
$_mmxext "mmxext" "sfence" || _mmxext
=no
1480 extcheck
$_3dnow "3dnow" "femms" || _3dnow
=no
1481 extcheck
$_3dnowext "3dnowext" "pswapd %%mm0, %%mm0" || _3dnowext
=no
1482 extcheck
$_sse "sse" "xorps %%xmm0, %%xmm0" || _sse
=no _gcc3_ext
="$_gcc3_ext -mno-sse"
1483 extcheck
$_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2
=no _gcc3_ext
="$_gcc3_ext -mno-sse2"
1484 extcheck
$_cmov "cmov" "cmovb %%eax,%%ebx" || _cmov
=no
1485 echocheck
"mtrr support"
1488 if test "$_mtrr" = yes ; then
1489 _optimizing
="$_optimizing mtrr"
1492 if test "$_gcc3_ext" != ""; then
1493 # if we had to disable sse/sse2 because the active kernel does not
1494 # support this instruction set extension, we also have to tell
1495 # gcc3 to not generate sse/sse2 instructions for normal C code
1497 int main(void) { return 0; }
1499 cc_check
$_march $_gcc3_ext && _march
="$_march $_gcc3_ext"
1505 echocheck
"assembler support of -pipe option"
1507 int main(void) { return 0; }
1509 cc_check
-pipe && _pipe
="-pipe" && echores
"yes" || echores
"no"
1512 echocheck
"compiler support of named assembler arguments"
1514 _def_named_asm_args
="#define NAMED_ASM_ARGS 1"
1515 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
1516 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
1518 _def_named_asm_args
="#undef NAMED_ASM_ARGS"
1520 echores
$_named_asm_args
1523 # Checking for CFLAGS
1525 if test "$_profile" != "" ||
test "$_debug" != "" ; then
1526 CFLAGS
="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
1527 if test "$_cc_major" -ge "3" ; then
1528 CFLAGS
=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
1531 elif test -z "$CFLAGS" ; then
1532 CFLAGS
="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
1536 if test -n "$LDFLAGS" ; then
1537 _ld_extra
="$_ld_extra $LDFLAGS"
1540 if test -n "$CPPFLAGS" ; then
1541 _inc_extra
="$_inc_extra $CPPFLAGS"
1545 _prefix
="/usr/local"
1547 # GOTCHA: the variables below defines the default behavior for autodetection
1548 # and have - unless stated otherwise - at least 2 states : yes no
1549 # If autodetection is available then the third state is: auto
1556 _libavdecoders
=`grep 'register_avcodec(&[a-z0-9_]*_decoder)' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1557 _libavencoders
=`grep 'register_avcodec(&[a-z0-9_]*_encoder)' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1558 _libavparsers
=`grep 'av_register_codec_parser(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1559 _libavdemuxers
=`grep 'av_register_input_format(&[a-z]' libavformat/allformats.c | sed 's/.*&\(.*\)).*/\1/'`
1560 _libavmuxers
=`grep 'av_register_output_format(&[a-z]' libavformat/allformats.c | sed 's/.*&\(.*\)).*/\1/'`
1563 _libavformat_so
=auto
1565 _libpostproc_so
=auto
1566 _libavcodec_mpegaudio_hp
=yes
1570 _dga
=auto
# 1 2 no auto
1572 _xvmc
=no
#auto when complete
1609 _tremor_internal
=yes
1611 _tremor_external
=auto
1626 _dvdnavconfig
=dvdnav-config
1628 _dvdread_internal
=auto
1637 _mlib
=no
#broken, thus disabled
1657 _vidix_internal
=auto
1658 _vidix_external
=auto
1696 _macosx_finder_support
=no
1699 _freetypeconfig
='freetype-config'
1701 _fribidiconfig
='fribidi-config'
1704 _gethostbyname2
=auto
1714 case "$ac_option" in
1720 --enable-gcc-check) ;;
1721 --disable-gcc-check) ;;
1722 --enable-static*) ;;
1723 --disable-static*) ;;
1724 --with-extraincdir=*) ;;
1725 --with-extralibdir=*) ;;
1727 --enable-runtime-cpudetection) ;;
1728 --disable-runtime-cpudetection) ;;
1729 --enable-cross-compile) ;;
1730 --disable-cross-compile) ;;
1731 --with-install=*) ;;
1732 --enable-profile) ;;
1733 --disable-profile) ;;
1735 --enable-debug=*) ;;
1739 --enable-mencoder) _mencoder
=yes ;;
1740 --disable-mencoder) _mencoder
=no
;;
1741 --enable-dynamic-plugins) _dynamic_plugins
=yes ;;
1742 --disable-dynamic-plugins) _dynamic_plugins
=no
;;
1743 --enable-x11) _x11
=yes ;;
1744 --disable-x11) _x11
=no
;;
1745 --enable-xshape) _xshape
=yes ;;
1746 --disable-xshape) _xshape
=no
;;
1747 --enable-xv) _xv
=yes ;;
1748 --disable-xv) _xv
=no
;;
1749 --enable-xvmc) _xvmc
=yes ;;
1750 --disable-xvmc) _xvmc
=no
;;
1751 --enable-sdl) _sdl
=yes ;;
1752 --disable-sdl) _sdl
=no
;;
1753 --enable-directx) _directx
=yes ;;
1754 --disable-directx) _directx
=no
;;
1755 --enable-win32waveout) _win32waveout
=yes ;;
1756 --disable-win32waveout) _win32waveout
=no
;;
1757 --enable-nas) _nas
=yes ;;
1758 --disable-nas) _nas
=no
;;
1759 --enable-png) _png
=yes ;;
1760 --disable-png) _png
=no
;;
1761 --enable-jpeg) _jpeg
=yes ;;
1762 --disable-jpeg) _jpeg
=no
;;
1763 --enable-pnm) _pnm
=yes ;;
1764 --disable-pnm) _pnm
=no
;;
1765 --enable-md5sum) _md5sum
=yes ;;
1766 --disable-md5sum) _md5sum
=no
;;
1767 --enable-gif) _gif
=yes ;;
1768 --disable-gif) _gif
=no
;;
1769 --enable-gl) _gl
=yes ;;
1770 --disable-gl) _gl
=no
;;
1771 --enable-ggi) _ggi
=yes ;;
1772 --disable-ggi) _ggi
=no
;;
1773 --enable-ggiwmh) _ggiwmh
=yes ;;
1774 --disable-ggiwmh) _ggiwmh
=no
;;
1775 --enable-aa) _aa
=yes ;;
1776 --disable-aa) _aa
=no
;;
1777 --enable-caca) _caca
=yes ;;
1778 --disable-caca) _caca
=no
;;
1779 --enable-svga) _svga
=yes ;;
1780 --disable-svga) _svga
=no
;;
1781 --enable-vesa) _vesa
=yes ;;
1782 --disable-vesa) _vesa
=no
;;
1783 --enable-fbdev) _fbdev
=yes ;;
1784 --disable-fbdev) _fbdev
=no
;;
1785 --enable-dvb) _dvb
=yes ;;
1786 --disable-dvb) _dvb
=no
;;
1787 --enable-dvbhead) _dvbhead
=yes ;;
1788 --disable-dvbhead) _dvbhead
=no
;;
1789 --enable-dxr2) _dxr2
=yes ;;
1790 --disable-dxr2) _dxr2
=no
;;
1791 --enable-dxr3) _dxr3
=yes ;;
1792 --disable-dxr3) _dxr3
=no
;;
1793 --enable-ivtv) _ivtv
=yes ;;
1794 --disable-ivtv) _ivtv
=no
;;
1795 --enable-iconv) _iconv
=yes ;;
1796 --disable-iconv) _iconv
=no
;;
1797 --enable-langinfo) _langinfo
=yes ;;
1798 --disable-langinfo) _langinfo
=no
;;
1799 --enable-rtc) _rtc
=yes ;;
1800 --disable-rtc) _rtc
=no
;;
1801 --enable-libdv) _libdv
=yes ;;
1802 --disable-libdv) _libdv
=no
;;
1803 --enable-ossaudio) _ossaudio
=yes ;;
1804 --disable-ossaudio) _ossaudio
=no
;;
1805 --enable-arts) _arts
=yes ;;
1806 --disable-arts) _arts
=no
;;
1807 --enable-esd) _esd
=yes ;;
1808 --disable-esd) _esd
=no
;;
1809 --enable-polyp) _polyp
=yes ;;
1810 --disable-polyp) _polyp
=no
;;
1811 --enable-jack) _jack
=yes ;;
1812 --disable-jack) _jack
=no
;;
1813 --enable-openal) _openal
=yes ;;
1814 --disable-openal) _openal
=no
;;
1815 --enable-mad) _mad
=yes ;;
1816 --disable-mad) _mad
=no
;;
1817 --enable-toolame) _toolame
=yes ;;
1818 --disable-toolame) _toolame
=no
;;
1819 --enable-twolame) _twolame
=yes ;;
1820 --disable-twolame) _twolame
=no
;;
1821 --enable-libcdio) _libcdio
=yes ;;
1822 --disable-libcdio) _libcdio
=no
;;
1823 --enable-liblzo) _liblzo
=yes ;;
1824 --disable-liblzo) _liblzo
=no
;;
1825 --enable-libvorbis) _libvorbis
=yes ;;
1826 --disable-libvorbis) _libvorbis
=no
;;
1827 --enable-speex) _speex
=yes ;;
1828 --disable-speex) _speex
=no
;;
1829 --enable-tremor-internal) _tremor_internal
=yes ;;
1830 --disable-tremor-internal) _tremor_internal
=no
;;
1831 --enable-tremor-low) _tremor_low
=yes ;;
1832 --disable-tremor-low) _tremor_low
=no
;;
1833 --enable-tremor-external) _tremor_external
=yes ;;
1834 --disable-tremor-external) _tremor_external
=no
;;
1835 --enable-theora) _theora
=yes ;;
1836 --disable-theora) _theora
=no
;;
1837 --enable-mp3lib) _mp3lib
=yes ;;
1838 --disable-mp3lib) _mp3lib
=no
;;
1839 --enable-liba52) _liba52
=yes ;;
1840 --disable-liba52) _liba52
=no
;;
1841 --enable-libdts) _libdts
=yes ;;
1842 --disable-libdts) _libdts
=no
;;
1843 --enable-libmpeg2) _libmpeg2
=yes ;;
1844 --disable-libmpeg2) _libmpeg2
=no
;;
1845 --enable-musepack) _musepack
=yes ;;
1846 --disable-musepack) _musepack
=no
;;
1847 --enable-faad-internal) _faad_internal
=yes ;;
1848 --disable-faad-internal) _faad_internal
=no
;;
1849 --enable-faad-external) _faad_external
=yes ;;
1850 --disable-faad-external) _faad_external
=no
;;
1851 --enable-faad-fixed) _faad_fixed
=yes ;;
1852 --disable-faad-fixed) _faad_fixed
=no
;;
1853 --enable-faac) _faac
=yes ;;
1854 --disable-faac) _faac
=no
;;
1855 --enable-ladspa) _ladspa
=yes ;;
1856 --disable-ladspa) _ladspa
=no
;;
1857 --enable-xmms) _xmms
=yes ;;
1858 --disable-xmms) _xmms
=no
;;
1859 --enable-dvdread) _dvdread
=yes ;;
1860 --disable-dvdread) _dvdread
=no
;;
1861 --enable-dvdread-internal) _dvdread_internal
=yes ;;
1862 --disable-dvdread-internal) _dvdread_internal
=no
;;
1863 --enable-dvdnav) _dvdnav
=yes ;;
1864 --disable-dvdnav) _dvdnav
=no
;;
1865 --enable-xanim) _xanim
=yes ;;
1866 --disable-xanim) _xanim
=no
;;
1867 --enable-real) _real
=yes ;;
1868 --disable-real) _real
=no
;;
1869 --enable-live) _live
=yes ;;
1870 --disable-live) _live
=no
;;
1871 --enable-xinerama) _xinerama
=yes ;;
1872 --disable-xinerama) _xinerama
=no
;;
1873 --enable-mga) _mga
=yes ;;
1874 --disable-mga) _mga
=no
;;
1875 --enable-xmga) _xmga
=yes ;;
1876 --disable-xmga) _xmga
=no
;;
1877 --enable-vm) _vm
=yes ;;
1878 --disable-vm) _vm
=no
;;
1879 --enable-xf86keysym) _xf86keysym
=yes ;;
1880 --disable-xf86keysym) _xf86keysym
=no
;;
1881 --enable-mlib) _mlib
=yes ;;
1882 --disable-mlib) _mlib
=no
;;
1883 --enable-sunaudio) _sunaudio
=yes ;;
1884 --disable-sunaudio) _sunaudio
=no
;;
1885 --enable-sgiaudio) _sgiaudio
=yes ;;
1886 --disable-sgiaudio) _sgiaudio
=no
;;
1887 --enable-alsa) _alsa
=yes ;;
1888 --disable-alsa) _alsa
=no
;;
1889 --enable-tv) _tv
=yes ;;
1890 --disable-tv) _tv
=no
;;
1891 --enable-tv-bsdbt848) _tv_bsdbt848
=yes ;;
1892 --disable-tv-bsdbt848) _tv_bsdbt848
=no
;;
1893 --enable-tv-v4l1) _tv_v4l1
=yes ;;
1894 --disable-tv-v4l1) _tv_v4l1
=no
;;
1895 --enable-tv-v4l2) _tv_v4l2
=yes ;;
1896 --disable-tv-v4l2) _tv_v4l2
=no
;;
1897 --enable-radio) _radio
=yes ;;
1898 --enable-radio-capture) _radio_capture
=yes ;;
1899 --disable-radio-capture) _radio_capture
=no
;;
1900 --disable-radio) _radio
=no
;;
1901 --enable-radio-v4l) _radio_v4l
=yes ;;
1902 --disable-radio-v4l) _radio_v4l
=no
;;
1903 --enable-radio-v4l2) _radio_v4l2
=yes ;;
1904 --disable-radio-v4l2) _radio_v4l2
=no
;;
1905 --enable-pvr) _pvr
=yes ;;
1906 --disable-pvr) _pvr
=no
;;
1907 --enable-fastmemcpy) _fastmemcpy
=yes ;;
1908 --disable-fastmemcpy) _fastmemcpy
=no
;;
1909 --enable-network) _network
=yes ;;
1910 --disable-network) _network
=no
;;
1911 --enable-winsock2) _winsock2
=yes ;;
1912 --disable-winsock2) _winsock2
=no
;;
1913 --enable-smb) _smbsupport
=yes ;;
1914 --disable-smb) _smbsupport
=no
;;
1915 --enable-vidix-internal) _vidix_internal
=yes ;;
1916 --disable-vidix-internal) _vidix_internal
=no
;;
1917 --enable-vidix-external) _vidix_external
=yes ;;
1918 --disable-vidix-external) _vidix_external
=no
;;
1919 --enable-joystick) _joystick
=yes ;;
1920 --disable-joystick) _joystick
=no
;;
1921 --enable-xvid3) _xvid3
=yes ;;
1922 --disable-xvid3) _xvid3
=no
;;
1923 --enable-xvid) _xvid
=yes ;;
1924 --disable-xvid) _xvid
=no
;;
1925 --enable-x264) _x264
=yes ;;
1926 --disable-x264) _x264
=no
;;
1927 --enable-nut) _nut
=yes ;;
1928 --disable-nut) _nut
=no
;;
1929 --enable-libavutil) _libavutil
=yes ;;
1930 --disable-libavutil) _libavutil
=no
;;
1931 --enable-libavutil_so) _libavutil_so
=yes ;;
1932 --disable-libavutil_so) _libavutil_so
=no
;;
1933 --enable-libavcodec) _libavcodec
=yes ;;
1934 --disable-libavcodec) _libavcodec
=no
;;
1935 --enable-libavcodec_so) _libavcodec_so
=yes ;;
1936 --disable-libavcodec_so) _libavcodec_so
=no
;;
1937 --enable-amr_nb) _amr_nb
=yes ;;
1938 --disable-amr_nb) _amr_nb
=no
;;
1939 --enable-amr_nb-fixed) _amr_nb_fixed
=yes ;;
1940 --disable-amr_nb-fixed) _amr_nb_fixed
=no
;;
1941 --enable-amr_wb) _amr_wb
=yes ;;
1942 --disable-amr_wb) _amr_wb
=no
;;
1943 --enable-decoder=*) _libavdecoders
="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1944 --disable-decoder=*) _libavdecoders
=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut
-d '=' -f 2\
`//g"` ;;
1945 --enable-encoder=*) _libavencoders
="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1946 --disable-encoder=*) _libavencoders
=`echo $_libavencoders | sed "s/\`echo $ac_option | cut
-d '=' -f 2\
`//g"` ;;
1947 --enable-parser=*) _libavparsers
="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1948 --disable-parser=*) _libavparsers
=`echo $_libavparsers | sed "s/\`echo $ac_option | cut
-d '=' -f 2\
`//g"` ;;
1949 --enable-demuxer=*) _libavdemuxers
="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1950 --disable-demuxer=*) _libavdemuxers
=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut
-d '=' -f 2\
`//g"` ;;
1951 --enable-muxer=*) _libavmuxers
="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1952 --disable-muxer=*) _libavmuxers
=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut
-d '=' -f 2\
`//g"` ;;
1953 --enable-libavformat) _libavformat
=yes;;
1954 --disable-libavformat) _libavformat
=no
;;
1955 --enable-libavformat_so) _libavformat_so
=yes ;;
1956 --disable-libavformat_so) _libavformat_so
=no
;;
1957 --enable-libpostproc) _libpostproc
=yes ;;
1958 --disable-libpostproc) _libpostproc
=no
;;
1959 --enable-libpostproc_so) _libpostproc_so
=yes ;;
1960 --disable-libpostproc_so) _libpostproc_so
=no
;;
1961 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp
=yes ;;
1962 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp
=no
;;
1964 --enable-lirc) _lirc
=yes ;;
1965 --disable-lirc) _lirc
=no
;;
1966 --enable-lircc) _lircc
=yes ;;
1967 --disable-lircc) _lircc
=no
;;
1968 --enable-gui) _gui
=yes ;;
1969 --disable-gui) _gui
=no
;;
1970 --enable-gtk1) _gtk1
=yes ;;
1971 --disable-gtk1) _gtk1
=no
;;
1972 --enable-termcap) _termcap
=yes ;;
1973 --disable-termcap) _termcap
=no
;;
1974 --enable-termios) _termios
=yes ;;
1975 --disable-termios) _termios
=no
;;
1976 --enable-3dfx) _3dfx
=yes ;;
1977 --disable-3dfx) _3dfx
=no
;;
1978 --enable-s3fb) _s3fb
=yes ;;
1979 --disable-s3fb) _s3fb
=no
;;
1980 --enable-tdfxfb) _tdfxfb
=yes ;;
1981 --disable-tdfxfb) _tdfxfb
=no
;;
1982 --disable-tdfxvid) _tdfxvid
=no
;;
1983 --enable-tdfxvid) _tdfxvid
=yes ;;
1984 --disable-tga) _tga
=no
;;
1985 --enable-tga) _tga
=yes ;;
1986 --enable-directfb) _directfb
=yes ;;
1987 --disable-directfb) _directfb
=no
;;
1988 --enable-zr) _zr
=yes ;;
1989 --disable-zr) _zr
=no
;;
1990 --enable-bl) _bl
=yes ;;
1991 --disable-bl) _bl
=no
;;
1992 --enable-mtrr) _mtrr
=yes ;;
1993 --disable-mtrr) _mtrr
=no
;;
1994 --enable-largefiles) _largefiles
=yes ;;
1995 --disable-largefiles) _largefiles
=no
;;
1996 --enable-shm) _shm
=yes ;;
1997 --disable-shm) _shm
=no
;;
1998 --enable-select) _select
=yes ;;
1999 --disable-select) _select
=no
;;
2000 --enable-linux-devfs) _linux_devfs
=yes ;;
2001 --disable-linux-devfs) _linux_devfs
=no
;;
2002 --enable-cdparanoia) _cdparanoia
=yes ;;
2003 --disable-cdparanoia) _cdparanoia
=no
;;
2004 --enable-big-endian) _big_endian
=yes ;;
2005 --disable-big-endian) _big_endian
=no
;;
2006 --enable-bitmap-font) _bitmap_font
=yes ;;
2007 --disable-bitmap-font) _bitmap_font
=no
;;
2008 --enable-freetype) _freetype
=yes ;;
2009 --disable-freetype) _freetype
=no
;;
2010 --enable-fontconfig) _fontconfig
=yes ;;
2011 --disable-fontconfig) _fontconfig
=no
;;
2012 --enable-unrarlib) _unrarlib
=yes ;;
2013 --disable-unrarlib) _unrarlib
=no
;;
2014 --enable-ftp) _ftp
=yes ;;
2015 --disable-ftp) _ftp
=no
;;
2016 --enable-vstream) _vstream
=yes ;;
2017 --disable-vstream) _vstream
=no
;;
2018 --enable-pthreads) _pthreads
=yes ;;
2019 --disable-pthreads) _pthreads
=no
;;
2020 --enable-ass) _ass
=yes ;;
2021 --disable-ass) _ass
=no
;;
2022 --enable-rpath) _rpath
=yes ;;
2023 --disable-rpath) _rpath
=no
;;
2024 --enable-color-console) _color_console
=yes ;;
2025 --disable-color-console) _color_console
=no
;;
2027 --enable-fribidi) _fribidi
=yes ;;
2028 --disable-fribidi) _fribidi
=no
;;
2030 --enable-enca) _enca
=yes ;;
2031 --disable-enca) _enca
=no
;;
2033 --enable-inet6) _inet6
=yes ;;
2034 --disable-inet6) _inet6
=no
;;
2036 --enable-gethostbyname2) _gethostbyname2
=yes ;;
2037 --disable-gethostbyname2) _gethostbyname2
=no
;;
2039 --enable-dga) _dga
=auto
;; # as we don't know if it's 1 or 2
2040 --enable-dga=*) _dga
=`echo $ac_option | cut -d '=' -f 2` ;;
2041 --disable-dga) _dga
=no
;;
2043 --enable-menu) _menu
=yes ;;
2044 --disable-menu) _menu
=no
;;
2046 --enable-qtx) _qtx
=yes ;;
2047 --disable-qtx) _qtx
=no
;;
2049 --enable-macosx) _macosx
=yes ;;
2050 --disable-macosx) _macosx
=no
;;
2051 --enable-macosx-finder-support) _macosx_finder_support
=yes ;;
2052 --disable-macosx-finder-support) _macosx_finder_support
=no
;;
2053 --enable-macosx-bundle) _macosx_bundle
=yes;;
2054 --disable-macosx-bundle) _macosx_bundle
=no
;;
2056 --enable-maemo) _maemo
=yes ;;
2057 --disable-maemo) _maemo
=no
;;
2059 --enable-sortsub) _sortsub
=yes ;;
2060 --disable-sortsub) _sortsub
=no
;;
2063 _charset
=`echo $ac_option | cut -d '=' -f 2`
2066 _language
=`echo $ac_option | cut -d '=' -f 2`
2070 _codecsdir
=`echo $ac_option | cut -d '=' -f 2`
2073 _win32codecsdir
=`echo $ac_option | cut -d '=' -f 2`
2076 _xanimcodecsdir
=`echo $ac_option | cut -d '=' -f 2`
2079 _realcodecsdir
=`echo $ac_option | cut -d '=' -f 2`
2081 --with-livelibdir=*)
2082 _livelibdir
=`echo $ac_option | cut -d '=' -f 2`
2085 --with-xmmslibdir=*)
2086 _xmmslibdir
=`echo $ac_option | cut -d '=' -f 2`
2089 --with-xmmsplugindir=*)
2090 _xmmsplugindir
=`echo $ac_option | cut -d '=' -f 2`
2093 --enable-crash-debug)
2096 --disable-crash-debug)
2099 --enable-sighandler)
2102 --disable-sighandler)
2106 --enable-sse) _sse
=yes ;;
2107 --disable-sse) _sse
=no
;;
2108 --enable-sse2) _sse2
=yes ;;
2109 --disable-sse2) _sse2
=no
;;
2110 --enable-mmxext) _mmxext
=yes ;;
2111 --disable-mmxext) _mmxext
=no
;;
2112 --enable-3dnow) _3dnow
=yes ;;
2113 --disable-3dnow) _3dnow
=no _3dnowext
=no
;;
2114 --enable-3dnowext) _3dnow
=yes _3dnowext
=yes ;;
2115 --disable-3dnowext) _3dnowext
=no
;;
2116 --enable-cmov) _cmov
=yes ;;
2117 --disable-cmov) _cmov
=no
;;
2118 --enable-altivec) _altivec
=yes ;;
2119 --disable-altivec) _altivec
=no
;;
2120 --enable-armv5te) _armv5te
=yes ;;
2121 --disable-armv5te) _armv5te
=no
;;
2122 --enable-iwmmxt) _iwmmxt
=yes ;;
2123 --disable-iwmmxt) _iwmmxt
=no
;;
2124 --enable-mmx) _mmx
=yes ;;
2125 --disable-mmx) # 3Dnow! and MMX2 require MMX
2126 _3dnow
=no _3dnowext
=no _mmx
=no _mmxext
=no
;;
2128 --enable-win32) _win32
=yes ;;
2129 --disable-win32) _win32
=no
;;
2132 _ld_x11
=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2135 _xvmclib
=`echo $ac_option | cut -d '=' -f 2`
2137 --with-xvidlibdir=*)
2138 _ld_xvid
=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2140 --with-libdtslibdir=*)
2141 _ld_libdts
=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2143 --with-x264libdir=*)
2144 _ld_x264
=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2146 --with-mliblibdir=*)
2147 _ld_mlib
=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2149 --with-sdl-config=*)
2150 _sdlconfig
=`echo $ac_option | cut -d '=' -f 2`
2152 --with-freetype-config=*)
2153 _freetypeconfig
=`echo $ac_option | cut -d '=' -f 2`
2155 --with-fribidi-config=*)
2156 _fribidiconfig
=`echo $ac_option | cut -d '=' -f 2`
2158 --with-gtk-config=*)
2159 _gtkconfig
=`echo $ac_option | cut -d '=' -f 2`
2161 --with-glib-config=*)
2162 _glibconfig
=`echo $ac_option | cut -d '=' -f 2`
2164 --with-dvdnav-config=*)
2165 _dvdnavconfig
=`echo $ac_option | cut -d '=' -f 2`
2167 --with-cdparanoialibdir=*)
2168 _ld_cdparanoia
=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2170 --with-toolamelibdir=*)
2171 _ld_toolame
=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2174 _prefix
=`echo $ac_option | cut -d '=' -f 2`
2177 _bindir
=`echo $ac_option | cut -d '=' -f 2`
2180 _datadir
=`echo $ac_option | cut -d '=' -f 2`
2183 _mandir
=`echo $ac_option | cut -d '=' -f 2`
2186 _confdir
=`echo $ac_option | cut -d '=' -f 2`
2189 _libdir
=`echo $ac_option | cut -d '=' -f 2`
2193 echo "Unknown parameter: $ac_option"
2200 # Atmos: moved this here, to be correct, if --prefix is specified
2201 test -z "$_bindir" && _bindir
="$_prefix/bin"
2202 test -z "$_datadir" && _datadir
="$_prefix/share/mplayer"
2203 test -z "$_mandir" && _mandir
="$_prefix/man"
2204 test -z "$_confdir" && _confdir
="$_prefix/etc/mplayer"
2205 test -z "$_libdir" && _libdir
="$_prefix/lib"
2207 # For lack of a better place to put platform-specific stuff ..
2208 win32
&& _exesuf
=".exe"
2212 # Checking assembler (_as) compatibility...
2213 # Added workaround for older as that reads from stdin by default - atmos
2214 as_version
=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2215 echocheck
"assembler ($_as $as_version)"
2217 _pref_as_version
='2.9.1'
2219 if test "$_mmx" = yes ; then
2220 echo 'emms' >> $TMPS
2222 if test "$_3dnow" = yes ; then
2223 _pref_as_version
='2.10.1'
2224 echo 'femms' >> $TMPS
2226 if test "$_3dnowext" = yes ; then
2227 _pref_as_version
='2.10.1'
2228 echo 'pswapd %mm0, %mm0' >> $TMPS
2230 if test "$_mmxext" = yes ; then
2231 _pref_as_version
='2.10.1'
2232 echo 'movntq %mm0, (%eax)' >> $TMPS
2234 if test "$_sse" = yes ; then
2235 _pref_as_version
='2.10.1'
2236 echo 'xorps %xmm0, %xmm0' >> $TMPS
2238 #if test "$_sse2" = yes ; then
2239 # _pref_as_version='2.11'
2240 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2242 if test "$_cmov" = yes ; then
2243 _pref_as_version
='2.10.1'
2244 echo 'cmovb %eax, %ebx' >> $TMPS
2246 $_as $TMPS -o $TMPO > /dev
/null
2>&1 || as_verc_fail
=yes
2248 if test "$as_verc_fail" != yes ; then
2251 _res_comment
="Upgrade binutils to ${_pref_as_version} ..."
2253 die
"obsolete binutils version"
2258 echocheck
".align is a power of two"
2259 if test "$_asmalign_pot" = auto
; then
2262 main() { asm (".align 3"); }
2264 cc_check
&& _asmalign_pot
=yes
2266 if test "$_asmalign_pot" = "yes" ; then
2267 _def_asmalign_pot
='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2269 _def_asmalign_pot
='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2271 echores
$_asmalign_pot
2274 #FIXME: This should happen before the check for CFLAGS..
2277 # check if altivec is supported by the compiler, and how to enable it
2279 _altivec_gcc_flags
=''
2281 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2282 echocheck
"GCC altivec support"
2290 FSF_flags
='-maltivec -mabi=altivec'
2291 Darwin_flags
='-faltivec -D__APPLE_ALTIVEC__'
2293 # check for Darwin-style flags first, since
2294 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2295 # accepts but ignores FSF-style flags...
2297 if test -z "$p"; then
2298 cc_check
$Darwin_flags && p
='Darwin'
2300 if test -z "$p"; then
2301 cc_check
$FSF_flags && p
='FSF'
2305 FSF
) _altivec_gcc_flags
="$FSF_flags" _altivec
=yes ;;
2306 Darwin
) _altivec_gcc_flags
="$Darwin_flags" _altivec
=yes ;;
2310 if test -z "$p"; then
2313 p
="$p-style ($_altivec_gcc_flags)"
2319 # check if <altivec.h> should be included
2321 _def_altivec_h
='#undef HAVE_ALTIVEC_H'
2323 if test "$_altivec" = yes ; then
2324 echocheck
"altivec.h"
2326 #include <altivec.h>
2327 int main(void) { return 0; }
2330 cc_check
$_altivec_gcc_flags && _have_altivec_h
=yes
2331 if test "$_have_altivec_h" = yes ; then
2332 _def_altivec_h
='#define HAVE_ALTIVEC_H 1'
2334 echores
"$_have_altivec_h"
2337 # disable runtime cpudetection if
2338 # - we cannot generate altivec code
2339 # - altivec is disabled by the user
2341 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no
; then
2342 _runtime_cpudetection
=no
2345 # show that we are optimizing for altivec (if enabled and supported)
2347 if test "$_runtime_cpudetection" = no
-a "$_altivec" = yes ; then
2348 _optimizing
="$_optimizing altivec"
2351 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2353 if test "$_altivec" = yes ; then
2354 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2355 #_mcpu="$_mcpu $_altivec_gcc_flags"
2356 CFLAGS
="$CFLAGS $_altivec_gcc_flags"
2359 # setup _def_altivec correctly
2361 if test "$_altivec" = yes ; then
2362 _def_altivec
='#define HAVE_ALTIVEC 1'
2364 _def_altivec
='#undef HAVE_ALTIVEC'
2369 echocheck
"ARMv5TE (Enhanced DSP Extensions)"
2370 if test $_armv5te = "auto" ; then
2373 __asm__ __volatile__ ("qadd r0, r0, r0");
2377 cc_check
&& _armv5te
=yes
2381 echocheck
"iWMMXt (Intel XScale SIMD instructions)"
2382 if test $_iwmmxt = "auto" ; then
2385 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2389 cc_check
&& _iwmmxt
=yes
2394 _def_mmx
='#undef HAVE_MMX'
2395 test "$_mmx" = yes && _def_mmx
='#define HAVE_MMX 1'
2396 _def_mmxext
='#undef HAVE_MMX2'
2397 test "$_mmxext" = yes && _def_mmxext
='#define HAVE_MMX2 1'
2398 _def_3dnow
='#undef HAVE_3DNOW'
2399 test "$_3dnow" = yes && _def_3dnow
='#define HAVE_3DNOW 1'
2400 _def_3dnowext
='#undef HAVE_3DNOWEX'
2401 test "$_3dnowext" = yes && _def_3dnowext
='#define HAVE_3DNOWEX 1'
2402 _def_sse
='#undef HAVE_SSE'
2403 test "$_sse" = yes && _def_sse
='#define HAVE_SSE 1'
2404 _def_sse2
='#undef HAVE_SSE2'
2405 test "$_sse2" = yes && _def_sse2
='#define HAVE_SSE2 1'
2406 _def_cmov
='#undef HAVE_CMOV'
2407 test "$_cmov" = yes && _def_cmov
='#define HAVE_CMOV 1'
2408 _def_armv5te
='#undef HAVE_ARMV5TE'
2409 test "$_armv5te" = yes && _def_armv5te
='#define HAVE_ARMV5TE 1'
2410 _def_iwmmxt
='#undef HAVE_IWMMXT'
2411 test "$_iwmmxt" = yes && _def_iwmmxt
='#define HAVE_IWMMXT 1'
2413 # Checking kernel version...
2414 if x86
&& linux
; then
2416 kernel_version
=`uname -r 2>&1`
2417 echocheck
"$system_name kernel version"
2418 case "$kernel_version" in
2419 '') kernel_version
="?.??"; _k_verc_fail
=yes;;
2420 [0-1].
[0-9].
[0-9]*|
2.
[0-3].
[0-9]*)
2421 _k_verc_problem
=yes;;
2423 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2426 if test "$_k_verc_fail" ; then
2427 echores
"$kernel_version, fail"
2428 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2429 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2430 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2431 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2432 echo "2.2.x you must upgrade it to get SSE support!"
2433 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2435 echores
"$kernel_version, ok"
2439 if test "$_vidix_internal" = auto
; then
2441 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2442 x86
&& _vidix_internal
=yes
2443 x86_64
&& _vidix_internal
=yes
2444 ppc
&& linux
&& _vidix_internal
=yes
2445 alpha
&& linux
&& _vidix_internal
=yes
2446 qnx
&& _vidix_internal
=no
2447 sunos
&& _vidix_internal
=no
2448 beos
&& _vidix_internal
=no
2449 darwin
&& _vidix_internal
=no
2453 # On QNX we must link to libph - Gabucino
2455 _ld_arch
="$_ld_arch -lph"
2458 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2460 if test "$_vidix_internal" = yes ; then
2463 for _awk
in mawk gawk nawk
awk; do
2464 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2469 test "$_awk_verc_fail" = yes && _awk
=no
2471 if test "$_awk_verc_fail" = yes; then
2472 echo "VIDIX needs awk, but no working implementation was found!"
2473 echo "Try the GNU version, which can be downloaded from:"
2474 echo "ftp://ftp.gnu.org/gnu/gawk/"
2475 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2480 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2487 ######################
2488 # MAIN TESTS GO HERE #
2489 ######################
2492 echocheck
"extra headers"
2493 if test "$_inc_extra" ; then
2494 echores
"$_inc_extra"
2500 echocheck
"extra libs"
2501 if test "$_ld_extra" ; then
2502 echores
"$_ld_extra"
2509 int main(void) { return 0; }
2511 if cc_check
-lposix ; then
2512 _ld_arch
="$_ld_arch -lposix"
2520 int main(void) { return 0; }
2522 if cc_check
-lm ; then
2531 echocheck
"langinfo"
2532 if test "$_langinfo" = auto
; then
2534 #include <langinfo.h>
2535 int main(void) { nl_langinfo(CODESET); return 0; }
2538 cc_check
&& _langinfo
=yes
2540 if test "$_langinfo" = yes ; then
2541 _def_langinfo
='#define USE_LANGINFO 1'
2543 _def_langinfo
='#undef USE_LANGINFO'
2545 echores
"$_langinfo"
2548 echocheck
"language"
2549 test -z "$_language" && _language
=$LINGUAS
2550 _language
=`echo $_language | sed 's/,/ /g'`
2551 echo $_language |
grep all
> /dev
/null || LANGUAGES
="$_language en"
2552 for lang
in $_language ; do
2553 test "$lang" = all
&& lang
=en
2554 if test -f "help/help_mp-${lang}.h" ; then
2558 echo ${_echo_n} "$lang not found, ${_echo_c}"
2559 _language
=`echo $_language | sed "s/$lang *//"`
2562 test -z "$_language" && _language
=en
2563 _mp_help
="help/help_mp-${_language}.h"
2564 test -f $_mp_help || die
"$_mp_help not found"
2565 for lang
in $LANGUAGES ; do
2566 if test -f "DOCS/man/$lang/mplayer.1" ; then
2567 MAN_LANG
="$lang $MAN_LANG"
2570 _doc_lang
=$_language
2571 test -d DOCS
/xml
/$_doc_lang || _doc_lang
=en
2572 echores
"using $_language (man pages: $MAN_LANG)"
2575 echocheck
"enable sighandler"
2576 if test "$_sighandler" = yes ; then
2577 _def_sighandler
='#define ENABLE_SIGHANDLER 1'
2579 _def_sighandler
='#undef ENABLE_SIGHANDLER'
2581 echores
"$_sighandler"
2583 echocheck
"runtime cpudetection"
2584 if test "$_runtime_cpudetection" = yes ; then
2585 _optimizing
="Runtime CPU-Detection enabled"
2586 _def_runtime_cpudetection
='#define RUNTIME_CPUDETECT 1'
2588 _def_runtime_cpudetection
='#undef RUNTIME_CPUDETECT'
2590 echores
"$_runtime_cpudetection"
2593 echocheck
"restrict keyword"
2594 for restrict_keyword
in restrict __restrict __restrict__
; do
2595 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2597 _def_restrict_keyword
=$restrict_keyword
2601 if [ -n "$_def_restrict_keyword" ]; then
2602 echores
"$_def_restrict_keyword"
2606 # Avoid infinite recursion loop ("#define restrict restrict")
2607 if [ "$_def_restrict_keyword" != "restrict" ]; then
2608 _def_restrict_keyword
="#define restrict $_def_restrict_keyword"
2610 _def_restrict_keyword
=""
2614 echocheck
"__builtin_expect"
2615 # GCC branch prediction hint
2618 a = __builtin_expect (a, 10);
2619 return a == 10 ? 0 : 1;
2621 int main() { return foo(10) && foo(0); }
2624 cc_check
&& _builtin_expect
=yes
2625 if test "$_builtin_expect" = yes ; then
2626 _def_builtin_expect
='#define HAVE_BUILTIN_EXPECT 1'
2628 _def_builtin_expect
='#undef HAVE_BUILTIN_EXPECT'
2630 echores
"$_builtin_expect"
2636 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2639 cc_check
-lkstat && _kstat
=yes
2640 if test "$_kstat" = yes ; then
2641 _def_kstat
="#define HAVE_LIBKSTAT 1"
2642 _ld_arch
="-lkstat $_ld_arch"
2644 _def_kstat
="#undef HAVE_LIBKSTAT"
2650 # required for nanosleep on some systems
2653 int main(void) { (void) nanosleep(0, 0); return 0; }
2656 cc_check
-lposix4 && _posix4
=yes
2657 if test "$_posix4" = yes ; then
2658 _ld_arch
="-lposix4 $_ld_arch"
2665 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2668 cc_check
-D_GNU_SOURCE $_ld_lm && _lrintf
=yes
2669 if test "$_lrintf" = yes ; then
2670 _def_lrintf
="#define HAVE_LRINTF 1"
2672 _def_lrintf
="#undef HAVE_LRINTF"
2679 int main(void) { (void) round(0.0); return 0; }
2682 cc_check
$_ld_lm && _round
=yes
2683 if test "$_round" = yes ; then
2684 _def_round
="#define HAVE_ROUND 1"
2686 _def_round
="#undef HAVE_ROUND"
2690 echocheck
"nanosleep"
2691 # also check for nanosleep
2694 int main(void) { (void) nanosleep(0, 0); return 0; }
2697 cc_check
$_ld_arch && _nanosleep
=yes
2698 if test "$_nanosleep" = yes ; then
2699 _def_nanosleep
='#define HAVE_NANOSLEEP 1'
2701 _def_nanosleep
='#undef HAVE_NANOSLEEP'
2703 echores
"$_nanosleep"
2707 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2708 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2711 #include <sys/socket.h>
2712 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2715 for _ld_tmp
in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2716 cc_check
$_ld_tmp && _ld_sock
="$_ld_tmp" && _socklib
=yes && break
2718 if test $_winsock2 = auto
&& not cygwin
; then
2721 #include <winsock2.h>
2722 int main(void) { (void) gethostbyname(0); return 0; }
2724 cc_check
-lws2_32 && _ld_sock
="-lws2_32" && _winsock2
=yes
2726 test "$_ld_sock" && _res_comment
="using $_ld_sock"
2730 if test $_winsock2 = yes ; then
2732 _def_winsock2
='#define HAVE_WINSOCK2 1'
2734 _def_winsock2
='#undef HAVE_WINSOCK2'
2739 echocheck
"inet_pton()"
2741 #include <sys/types.h>
2742 #include <sys/socket.h>
2743 #include <arpa/inet.h>
2744 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2746 if test "$_winsock2" = yes ; then
2747 _res_comment
="using winsock2 functions instead"
2749 elif cc_check
$_ld_sock ; then
2750 # NOTE: Linux has libresolv but does not need it
2752 _res_comment
="using $_ld_sock"
2754 elif cc_check
$_ld_sock -lresolv ; then
2755 # NOTE: needed for SunOS at least
2756 _ld_sock
="$_ld_sock -lresolv"
2757 _res_comment
="using $_ld_sock"
2760 _res_comment
="trying inet_aton next"
2763 echocheck
"inet_aton()"
2765 #include <sys/types.h>
2766 #include <sys/socket.h>
2767 #include <arpa/inet.h>
2768 int main(void) { (void) inet_aton(0, 0); return 0; }
2771 if cc_check
$_ld_sock ; then
2772 # NOTE: Linux has libresolv but does not need it
2774 _res_comment
="using $_ld_sock"
2775 elif cc_check
$_ld_sock -lresolv ; then
2776 # NOTE: needed for SunOS at least
2777 _ld_sock
="$_ld_sock -lresolv"
2778 _res_comment
="using $_ld_sock"
2782 _res_comment
="network support disabled"
2784 echores
"$_use_aton"
2787 _def_use_aton
='#undef USE_ATON'
2788 if test "$_use_aton" = yes; then
2789 _def_use_aton
='#define USE_ATON 1'
2793 echocheck
"inttypes.h (required)"
2795 #include <inttypes.h>
2796 int main(void) { return 0; }
2799 cc_check
&& _inttypes
=yes
2800 echores
"$_inttypes"
2802 if test "$_inttypes" = no
; then
2803 echocheck
"bitypes.h (inttypes.h predecessor)"
2805 #include <sys/bitypes.h>
2806 int main(void) { return 0; }
2808 cc_check
&& _inttypes
=yes
2809 if test "$_inttypes" = yes ; then
2810 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."
2812 die
"Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2817 echocheck
"int_fastXY_t in inttypes.h"
2819 #include <inttypes.h>
2821 volatile int_fast16_t v= 0;
2825 cc_check
&& _fast_inttypes
=yes
2826 if test "$_fast_inttypes" = yes ; then
2830 _def_fast_inttypes
='
2831 typedef signed char int_fast8_t;
2832 typedef signed int int_fast16_t;
2833 typedef signed int int_fast32_t;
2834 typedef signed long long int_fast64_t;
2835 typedef unsigned char uint_fast8_t;
2836 typedef unsigned int uint_fast16_t;
2837 typedef unsigned int uint_fast32_t;
2838 typedef unsigned long long uint_fast64_t;'
2840 echores
"$_fast_inttypes"
2843 echocheck
"word size"
2844 _mp_wordsize
="#undef MP_WORDSIZE"
2847 #include <sys/types.h>
2848 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2850 cc_check
&& _wordsize
=`$TMPO` && _mp_wordsize
="#define MP_WORDSIZE $_wordsize"
2851 echores
"$_wordsize"
2854 echocheck
"stddef.h"
2857 int main(void) { return 0; }
2860 cc_check
&& _stddef
=yes
2861 if test "$_stddef" = yes ; then
2862 _def_stddef
='#define HAVE_STDDEF_H 1'
2864 _def_stddef
='#undef HAVE_STDDEF_H'
2869 echocheck
"malloc.h"
2872 int main(void) { (void) malloc(0); return 0; }
2875 cc_check
&& _malloc
=yes
2876 if test "$_malloc" = yes ; then
2877 _def_malloc
='#define HAVE_MALLOC_H 1'
2879 _def_malloc
='#undef HAVE_MALLOC_H'
2881 # malloc.h emits a warning in FreeBSD and OpenBSD
2882 freebsd || openbsd
&& _def_malloc
='#undef HAVE_MALLOC_H'
2886 echocheck
"memalign()"
2887 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2890 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2893 cc_check
&& _memalign
=yes
2894 if test "$_memalign" = yes ; then
2895 _def_memalign
='#define HAVE_MEMALIGN 1'
2897 _def_memalign
='#undef HAVE_MEMALIGN'
2898 _def_map_memalign
='#define memalign(a,b) malloc(b)'
2899 not darwin
&& _def_memalign_hack
='#define MEMALIGN_HACK 1'
2901 echores
"$_memalign"
2904 echocheck
"alloca.h"
2907 int main(void) { (void) alloca(0); return 0; }
2910 cc_check
&& _alloca
=yes
2912 _def_alloca
='#define HAVE_ALLOCA_H 1'
2914 _def_alloca
='#undef HAVE_ALLOCA_H'
2921 #include <sys/types.h>
2922 #include <sys/mman.h>
2923 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2926 cc_check
&& _mman
=yes
2927 if test "$_mman" = yes ; then
2928 _def_mman
='#define HAVE_SYS_MMAN_H 1'
2930 _def_mman
='#undef HAVE_SYS_MMAN_H'
2935 #include <sys/types.h>
2936 #include <sys/mman.h>
2937 int main(void) { void *p = MAP_FAILED; return 0; }
2939 _mman_has_map_failed
=no
2940 cc_check
&& _mman_has_map_failed
=yes
2941 if test "$_mman_has_map_failed" = yes ; then
2942 _def_mman_has_map_failed
=''
2944 _def_mman_has_map_failed
='#define MAP_FAILED ((void *) -1)'
2947 echocheck
"dynamic loader"
2950 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2953 for _ld_tmp
in "" "-ldl" ; do
2954 cc_check
$_ld_tmp && _ld_dl
="$_ld_tmp" && _dl
=yes && break
2956 if test "$_dl" = yes ; then
2957 _def_dl
='#define HAVE_LIBDL 1'
2959 _def_dl
='#undef HAVE_LIBDL'
2964 echocheck
"dynamic a/v plugins support"
2965 if test "$_dl" = no
; then
2968 if test "$_dynamic_plugins" = yes ; then
2969 _def_dynamic_plugins
='#define DYNAMIC_PLUGINS 1'
2971 _def_dynamic_plugins
='#undef DYNAMIC_PLUGINS'
2973 echores
"$_dynamic_plugins"
2976 #echocheck "dynamic linking"
2977 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
2978 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
2980 #int main(void) { return 0; }
2982 #if cc_check -rdynamic ; then
2983 # _ld_dl_dynamic='-rdynamic'
2984 #elif cc_check -Bdynamic ; then
2985 # _ld_dl_dynamic='-Bdynamic'
2986 #elif cc_check ; then
2989 #echores "using $_ld_dl_dynamic"
2991 _def_threads
='#undef HAVE_THREADS'
2994 if test "$_pthreads" = auto
; then
2996 #include <pthread.h>
2997 void* func(void *arg) { return arg; }
2998 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3002 for _ld_tmp
in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3003 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3004 cc_check
$_ld_tmp && (tmp_run ||
test "$_ld_static") && _ld_pthread
="$_ld_tmp" && _pthreads
=yes && break
3008 if test "$_pthreads" = yes ; then
3009 _res_comment
="using $_ld_pthread"
3010 _def_pthreads
='#define HAVE_PTHREADS 1'
3011 _def_threads
='#define HAVE_THREADS 1'
3013 _res_comment
="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3014 _def_pthreads
='#undef HAVE_PTHREADS'
3015 _nas
=no
; _tv_v4l1
=no
; _macosx
=no
3016 if not mingw32
; then
3020 echores
"$_pthreads"
3024 if test "$_rpath" = yes ; then
3025 for I
in `echo $_ld_extra | sed 's/-L//g'` ; do
3026 tmp
="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3033 if test "$_iconv" = auto
; then
3034 _iconv_tmp
='#include <iconv.h>'
3040 #define INBUFSIZE 1024
3041 #define OUTBUFSIZE 4096
3043 char inbuffer[INBUFSIZE];
3044 char outbuffer[OUTBUFSIZE];
3049 char *tocode="UTF-8";
3050 char *fromcode="cp1250";
3051 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3052 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3053 char *iptr=inbuffer;
3054 char *optr=outbuffer;
3055 size_t inleft=numread;
3056 size_t outleft=OUTBUFSIZE;
3057 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3059 write (1, outbuffer, OUTBUFSIZE - outleft);
3062 if (iconv_close(icdsc) == -1)
3068 for _ld_tmp
in "" "-liconv" "-liconv $_ld_dl" ; do
3069 cc_check
$_ld_lm $_ld_tmp && _ld_iconv
="$_ld_tmp" && _iconv
=yes && break
3072 if test "$_iconv" = yes ; then
3073 _def_iconv
='#define USE_ICONV 1'
3075 _def_iconv
='#undef USE_ICONV'
3080 echocheck
"sys/soundcard.h"
3082 #include <sys/soundcard.h>
3083 int main(void) { return 0; }
3086 cc_check
&& _sys_soundcard
=yes
3087 if test "$_sys_soundcard" = yes ; then
3088 _def_sys_soundcard
='#define HAVE_SYS_SOUNDCARD_H 1'
3089 _include_soundcard
='#include <sys/soundcard.h>'
3091 _def_sys_soundcard
='#undef HAVE_SYS_SOUNDCARD_H'
3093 echores
"$_sys_soundcard"
3095 if test "$_sys_soundcard" != yes ; then
3096 echocheck
"soundcard.h"
3098 #include <soundcard.h>
3099 int main(void) { return 0; }
3102 cc_check
&& _soundcard
=yes
3103 if linux ||
test "$_ossaudio" != no
; then
3104 # use soundcard.h on Linux, or when OSS support is enabled
3105 echores
"$_soundcard"
3107 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
3108 _res_comment
= "but ignored!"
3109 echores
"$_soundcard"
3112 if test "$_soundcard" = yes ; then
3113 _def_soundcard
='#define HAVE_SOUNDCARD_H 1'
3114 _include_soundcard
='#include <soundcard.h>'
3116 _def_soundcard
='#undef HAVE_SOUNDCARD_H'
3119 _def_soundcard
='#undef HAVE_SOUNDCARD_H'
3123 echocheck
"sys/dvdio.h"
3126 #include <sys/dvdio.h>
3127 int main(void) { return 0; }
3130 cc_check
&& _dvdio
=yes
3131 if test "$_dvdio" = yes ; then
3132 _def_dvdio
='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3134 _def_dvdio
='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3139 echocheck
"sys/cdio.h"
3142 #include <sys/cdio.h>
3143 int main(void) { return 0; }
3146 cc_check
&& _cdio
=yes
3147 if test "$_cdio" = yes ; then
3148 _def_cdio
='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3150 _def_cdio
='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3155 echocheck
"linux/cdrom.h"
3157 #include <sys/types.h>
3158 #include <linux/cdrom.h>
3159 int main(void) { return 0; }
3162 cc_check
&& _cdrom
=yes
3163 if test "$_cdrom" = yes ; then
3164 _def_cdrom
='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3166 _def_cdrom
='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3174 int main(void) { return 0; }
3177 cc_check
&& _dvd
=yes
3178 if test "$_dvd" = yes ; then
3179 _def_dvd
='#define DVD_STRUCT_IN_DVD_H 1'
3181 _def_dvd
='#undef DVD_STRUCT_IN_DVD_H'
3187 echocheck
"BSDI dvd.h"
3190 int main(void) { return 0; }
3193 cc_check
&& _bsdi_dvd
=yes
3194 if test "$_bsdi_dvd" = yes ; then
3195 _def_bsdi_dvd
='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3197 _def_bsdi_dvd
='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3199 echores
"$_bsdi_dvd"
3204 # also used by AIX, but AIX does not support VCD and/or libdvdread
3205 echocheck
"HP-UX SCSI header"
3207 #include <sys/scsi.h>
3208 int main(void) { return 0; }
3211 cc_check
&& _hpux_scsi_h
=yes
3212 if test "$_hpux_scsi_h" = yes ; then
3213 _def_hpux_scsi_h
='#define HPUX_SCTL_IO 1'
3215 _def_hpux_scsi_h
='#undef HPUX_SCTL_IO'
3217 echores
"$_hpux_scsi_h"
3222 echocheck
"userspace SCSI headers (Solaris)"
3224 # include <unistd.h>
3225 # include <stropts.h>
3226 # include <sys/scsi/scsi_types.h>
3227 # include <sys/scsi/impl/uscsi.h>
3228 int main(void) { return 0; }
3231 cc_check
&& _sol_scsi_h
=yes
3232 if test "$_sol_scsi_h" = yes ; then
3233 _def_sol_scsi_h
='#define SOLARIS_USCSI 1'
3235 _def_sol_scsi_h
='#undef SOLARIS_USCSI'
3237 echores
"$_sol_scsi_h"
3242 if test "$_termcap" = auto
; then
3244 int main(void) { tgetent(); return 0; }
3247 for _ld_tmp
in "-lncurses" "-ltinfo" "-ltermcap"; do
3248 cc_check
$_ld_tmp && _ld_termcap
="$_ld_tmp" && _termcap
=yes && break
3251 if test "$_termcap" = yes ; then
3252 _def_termcap
='#define USE_TERMCAP 1'
3253 _res_comment
="using $_ld_termcap"
3255 _def_termcap
='#undef USE_TERMCAP'
3261 if test "$_termios" = auto
; then
3263 #include <sys/termios.h>
3264 int main(void) { return 0; }
3267 cc_check
&& _termios
=yes
3268 _def_termios_h_name
='sys/termios.h'
3271 if test "$_termios" = auto
; then
3273 #include <termios.h>
3274 int main(void) { return 0; }
3277 cc_check
&& _termios
=yes
3278 _def_termios_h_name
='termios.h'
3281 if test "$_termios" = yes ; then
3282 _def_termios
='#define HAVE_TERMIOS 1'
3283 _def_termios_h
='#undef HAVE_TERMIOS_H'
3284 _def_termios_sys_h
='#undef HAVE_SYS_TERMIOS_H'
3286 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3287 _def_termios_sys_h
='#define HAVE_SYS_TERMIOS_H 1'
3288 elif test "$_def_termios_h_name" = 'termios.h' ; then
3289 _def_termios_h
='#define HAVE_TERMIOS_H 1'
3291 _res_comment
="using $_def_termios_h_name"
3293 _def_termios
='#undef HAVE_TERMIOS'
3294 _def_termios_h_name
=''
3301 if test "$_shm" = auto
; then
3303 #include <sys/types.h>
3304 #include <sys/shm.h>
3305 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3308 cc_check
&& _shm
=yes
3310 if test "$_shm" = yes ; then
3311 _def_shm
='#define HAVE_SHM 1'
3313 _def_shm
='#undef HAVE_SHM'
3318 # XXX: FIXME, add runtime checking
3319 echocheck
"linux devfs"
3320 echores
"$_linux_devfs"
3323 echocheck
"scandir()"
3325 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3328 cc_check
&& _scandir
=yes
3329 if test "$_scandir" = yes ; then
3330 _def_scandir
='#define HAVE_SCANDIR 1'
3332 _def_scandir
='#undef HAVE_SCANDIR'
3337 echocheck
"strsep()"
3340 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3343 cc_check
&& _strsep
=yes
3344 if test "$_strsep" = yes ; then
3345 _def_strsep
='#define HAVE_STRSEP 1'
3347 _def_strsep
='#undef HAVE_STRSEP'
3351 echocheck
"strlcpy()"
3354 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3357 cc_check
&& _strlcpy
=yes
3358 if test "$_strlcpy" = yes ; then
3359 _def_strlcpy
='#define HAVE_STRLCPY 1'
3361 _def_strlcpy
='#undef HAVE_STRLCPY'
3365 echocheck
"strlcat()"
3368 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3371 cc_check
&& _strlcat
=yes
3372 if test "$_strlcat" = yes ; then
3373 _def_strlcat
='#define HAVE_STRLCAT 1'
3375 _def_strlcat
='#undef HAVE_STRLCAT'
3379 echocheck
"fseeko()"
3382 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3385 cc_check
&& _fseeko
=yes
3386 if test "$_fseeko" = yes ; then
3387 _def_fseeko
='#define HAVE_FSEEKO 1'
3389 _def_fseeko
='#undef HAVE_FSEEKO'
3393 echocheck
"localtime_r()"
3396 int main( void ) { localtime_r(NULL, NULL); }
3399 cc_check
&& _localtime_r
=yes
3400 if test "$_localtime_r" = yes ; then
3401 _def_localtime_r
='#define HAVE_LOCALTIME_R 1'
3403 _def_localtime_r
='#undef HAVE_LOCALTIME_R'
3405 echores
"$_localtime_r"
3407 echocheck
"vsscanf()"
3410 int main(void) { vsscanf(0, 0, 0); return 0; }
3413 cc_check
&& _vsscanf
=yes
3414 if test "$_vsscanf" = yes ; then
3415 _def_vsscanf
='#define HAVE_VSSCANF 1'
3417 _def_vsscanf
='#undef HAVE_VSSCANF'
3425 int main(void) { swab(0, 0, 0); return 0; }
3428 cc_check
&& _swab
=yes
3429 if test "$_swab" = yes ; then
3430 _def_swab
='#define HAVE_SWAB 1'
3432 _def_swab
='#undef HAVE_SWAB'
3436 echocheck
"POSIX select()"
3440 #include <sys/types.h>
3442 #include <sys/time.h>
3444 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3447 cc_check
&& _posix_select
=yes
3448 if test "$_posix_select" = no
; then
3449 _def_no_posix_select
='#define HAVE_NO_POSIX_SELECT 1'
3451 _def_no_posix_select
='#undef HAVE_NO_POSIX_SELECT'
3453 echores
"$_posix_select"
3456 echocheck
"gettimeofday()"
3459 #include <sys/time.h>
3460 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3463 cc_check
&& _gettimeofday
=yes
3464 if test "$_gettimeofday" = yes ; then
3465 _def_gettimeofday
='#define HAVE_GETTIMEOFDAY 1'
3467 _def_gettimeofday
='#undef HAVE_GETTIMEOFDAY'
3469 echores
"$_gettimeofday"
3476 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3479 cc_check
&& _glob
=yes
3480 if test "$_glob" = yes ; then
3481 _def_glob
='#define HAVE_GLOB 1'
3483 _def_glob
='#undef HAVE_GLOB'
3488 echocheck
"setenv()"
3491 int main (void){ setenv("","",0); return 0; }
3494 cc_check
&& _setenv
=yes
3495 if test "$_setenv" = yes ; then
3496 _def_setenv
='#define HAVE_SETENV 1'
3498 _def_setenv
='#undef HAVE_SETENV'
3504 echocheck
"sysi86()"
3506 #include <sys/sysi86.h>
3507 int main (void) { sysi86(0); return 0; }
3510 cc_check
&& _sysi86
=yes
3511 if test "$_sysi86" = yes ; then
3512 _def_sysi86
='#define HAVE_SYSI86 1'
3514 _def_sysi86
='#undef HAVE_SYSI86'
3520 echocheck
"sys/sysinfo.h"
3522 #include <sys/sysinfo.h>
3524 struct sysinfo s_info;
3530 cc_check
&& _sys_sysinfo
=yes
3531 if test "$_sys_sysinfo" = yes ; then
3532 _def_sys_sysinfo
='#define HAVE_SYS_SYSINFO_H 1'
3534 _def_sys_sysinfo
='#undef HAVE_SYS_SYSINFO_H'
3536 echores
"$_sys_sysinfo"
3541 echocheck
"Mac OS X APIs"
3542 if test "$_macosx" = auto
; then
3543 productName
=`/usr/bin/sw_vers -productName`
3544 if test "$productName" = "Mac OS X" ; then
3548 _def_macosx
='#undef MACOSX'
3549 _noaomodules
="macosx $_noaomodules"
3550 _novomodules
="quartz $_novomodules"
3553 if test "$_macosx" = yes ; then
3555 #include <Carbon/Carbon.h>
3556 #include <QuickTime/QuickTime.h>
3557 #include <CoreAudio/CoreAudio.h>
3561 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3564 if cc_check
-framework Carbon
-framework QuickTime
-framework CoreAudio
; then
3565 _macosx_frameworks
="-framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3566 _def_macosx
='#define MACOSX 1'
3567 _aosrc
="$_aosrc ao_macosx.c"
3568 _aomodules
="macosx $_aomodules"
3569 _vosrc
="$_vosrc vo_quartz.c"
3570 _vomodules
="quartz $_vomodules"
3573 _def_macosx
='#undef MACOSX'
3574 _noaomodules
="macosx $_noaomodules"
3575 _novomodules
="quartz $_novomodules"
3578 #include <Carbon/Carbon.h>
3579 #include <QuartzCore/CoreVideo.h>
3582 if cc_check
-framework Carbon
-framework QuartzCore
-framework OpenGL
; then
3583 _vosrc
="$_vosrc vo_macosx.m"
3584 _vomodules
="macosx $_vomodules"
3585 _macosx_frameworks
="$_macosx_frameworks -framework Cocoa -framework QuartzCore -framework OpenGL"
3586 _def_macosx_corevideo
='#define MACOSX_COREVIDEO 1'
3587 _macosx_corevideo
=yes
3589 _novomodules
="macosx $_novomodules"
3590 _def_macosx_corevideo
='#undef MACOSX_COREVIDEO'
3591 _macosx_corevideo
=no
3596 echocheck
"Mac OS X Finder Support"
3597 if test "$_macosx_finder_support" = auto
; then
3598 _macosx_finder_support
=$_macosx
3600 if test "$_macosx_finder_support" = yes; then
3601 _def_macosx_finder_support
='#define MACOSX_FINDER_SUPPORT 1'
3602 _macosx_finder_support
=yes
3604 _def_macosx_finder_support
='#undef MACOSX_FINDER_SUPPORT'
3605 _macosx_finder_support
=no
3607 echores
"$_macosx_finder_support"
3609 echocheck
"Mac OS X Bundle file locations"
3610 if test "$_macosx_bundle" = auto
; then
3611 _macosx_bundle
=$_macosx_finder_support
3613 if test "$_macosx_bundle" = yes; then
3614 _def_macosx_bundle
='#define MACOSX_BUNDLE 1'
3616 _def_macosx_bundle
='#undef MACOSX_BUNDLE'
3619 echores
"$_macosx_bundle"
3624 echocheck
"pkg-config"
3625 _pkg_config
=pkg-config
3626 if `$_pkg_config --version > /dev/null 2>&1`; then
3634 echocheck
"Samba support (libsmbclient)"
3635 if test "$_smbsupport" = yes; then
3636 _ld_smb
="-lsmbclient"
3638 if test "$_smbsupport" = auto
; then
3641 #include <libsmbclient.h>
3642 int main(void) { smbc_opendir("smb://"); return 0; }
3644 for _ld_tmp
in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3645 cc_check
$_ld_tmp && _ld_smb
="$_ld_tmp" && _smbsupport
=yes && break
3649 if test "$_smbsupport" = yes; then
3650 _def_smbsupport
="#define LIBSMBCLIENT"
3651 _inputmodules
="smb $_inputmodules"
3653 _def_smbsupport
="#undef LIBSMBCLIENT"
3654 _noinputmodules
="smb $_noinputmodules"
3656 echores
"$_smbsupport"
3665 if test "$_3dfx" = yes ; then
3666 _def_3dfx
='#define HAVE_3DFX 1'
3667 _vosrc
="$_vosrc vo_3dfx.c"
3668 _vomodules
="3dfx $_vomodules"
3670 _def_3dfx
='#undef HAVE_3DFX'
3671 _novomodules
="3dfx $_novomodules"
3677 if test "$_tdfxfb" = yes ; then
3678 _def_tdfxfb
='#define HAVE_TDFXFB 1'
3679 _vosrc
="$_vosrc vo_tdfxfb.c"
3680 _vomodules
="tdfxfb $_vomodules"
3682 _def_tdfxfb
='#undef HAVE_TDFXFB'
3683 _novomodules
="tdfxfb $_novomodules"
3688 if test "$_s3fb" = yes ; then
3689 _def_s3fb
='#define HAVE_S3FB 1'
3690 _vosrc
="$_vosrc vo_s3fb.c"
3691 _vomodules
="s3fb $_vomodules"
3693 _def_s3fb
='#undef HAVE_S3FB'
3694 _novomodules
="s3fb $_novomodules"
3699 if test "$_tdfxvid" = yes ; then
3700 _def_tdfxvid
='#define HAVE_TDFX_VID 1'
3701 _vosrc
="$_vosrc vo_tdfx_vid.c"
3702 _vomodules
="tdfx_vid $_vomodules"
3704 _def_tdfxvid
='#undef HAVE_TDFX_VID'
3705 _novomodules
="tdfx_vid $_novomodules"
3710 if test "$_tga" = yes ; then
3711 _def_tga
='#define HAVE_TGA 1'
3712 _vosrc
="$_vosrc vo_tga.c"
3713 _vomodules
="tga $_vomodules"
3715 _def_tga
='#undef HAVE_TGA'
3716 _novomodules
="tga $_novomodules"
3721 echocheck
"DirectFB"
3722 if test "$_directfb" = auto
; then
3725 #include <directfb.h>
3726 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3728 for _inc_tmp
in "" -I/usr
/local
/include
/directfb \
3729 -I/usr
/include
/directfb
-I/usr
/local
/include
-I/usr
/include
; do
3730 cc_check
$_inc_tmp -ldirectfb && _directfb
=yes && \
3731 _inc_extra
="$_inc_extra $_inc_tmp" && break
3736 expr $1 \
* 65536 + $2 \
* 256 + $3
3739 if test "$_directfb" = yes; then
3741 #include <directfb_version.h>
3743 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3746 if $_cc -E $TMPC $_inc_extra > "$TMPO"; then
3747 _directfb_version
=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPO" | tr -d '()'`
3748 _dfb_major
=`echo $_directfb_version | cut -d . -f 1`
3749 _dfb_minor
=`echo $_directfb_version | cut -d . -f 2`
3750 _dfb_micro
=`echo $_directfb_version | cut -d . -f 3`
3751 _dfb_version
=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3752 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3753 _def_directfb_version
="#define DIRECTFBVERSION $_dfb_version"
3754 _res_comment
="$_directfb_version"
3756 _def_directfb_version
='#undef DIRECTFBVERSION'
3758 _res_comment
="version >=0.9.13 required"
3762 _res_comment
="failed to get version"
3765 echores
"$_directfb"
3767 if test "$_directfb" = yes ; then
3768 _def_directfb
='#define HAVE_DIRECTFB 1'
3769 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3770 _vosrc
="$_vosrc vo_directfb2.c"
3771 _vomodules
="directfb $_vomodules"
3772 _ld_directfb
='-ldirectfb'
3774 _novomodules
="directfb $_novomodules"
3777 if test "$_dfb_version" -ge `dfb_version 0 9 15`; then
3778 _vosrc
="$_vosrc vo_dfbmga.c"
3779 _vomodules
="dfbmga $_vomodules"
3780 _def_dfbmga
='#define HAVE_DFBMGA 1'
3782 _novomodules
="dfbmga $_novomodules"
3783 _def_dfbmga
='#undef HAVE_DFBMGA'
3786 _def_directfb
='#undef HAVE_DIRECTFB'
3787 _novomodules
="dfbmga directfb $_novomodules"
3791 echocheck
"X11 headers presence"
3792 for I
in `echo $_inc_extra | sed s/-I//g` /usr
/X11
/include
/usr
/X11R
6/include
/usr
/include
/X11R6
/usr
/include
/usr
/openwin
/include
; do
3793 if test -f "$I/X11/Xlib.h" ; then
3796 _res_comment
="using $I"
3800 #FIXME: This is ugly as it can duplicate a -I parameter..
3801 _inc_extra
="$_inc_extra $_inc_x11"
3802 if test -z "$_inc_x11" ; then
3805 _res_comment
="check if the dev(el) packages are installed"
3807 echores
"$_x11_headers"
3811 if test "$_x11" != no
; then
3813 #include <X11/Xlib.h>
3814 #include <X11/Xutil.h>
3815 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3817 for I
in $_ld_x11 "" -L/usr
/X11R
6/lib
-L/usr
/lib
/X11R6
-L/usr
/X11
/lib \
3818 -L/usr
/lib32
-L/usr
/openwin
/lib
-L/usr
/X11R
6/lib64
-L/usr
/lib
; do
3819 _ld_x11
="$I -lXext -lX11 $_ld_sock $_ld_pthread"
3821 _ld_x11
="$_ld_x11 -Wl,-R`echo $I | sed s/^-L//`"
3823 cc_check
$_ld_x11 && _x11
=yes && break
3826 if test "$_x11" = yes ; then
3827 _def_x11
='#define HAVE_X11 1'
3828 _vosrc
="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3829 _vomodules
="x11 xover $_vomodules"
3832 _def_x11
='#undef HAVE_X11'
3834 _novomodules
="x11 $_novomodules"
3835 _res_comment
="check if the dev(el) packages are installed"
3836 # disable stuff that depends on X
3837 _xv
=no
; _xvmc
=no
; _xinerama
=no
; _vm
=no
; _xf86keysym
=no
; _dga
=no
3845 if test "$_x11" = yes ; then
3847 #include <X11/Xmd.h>
3848 #include <X11/Xlib.h>
3849 #include <X11/Xutil.h>
3850 #include <X11/Xatom.h>
3851 #include <X11/extensions/dpms.h>
3853 (void) DPMSQueryExtension(0, 0, 0);
3856 cc_check
-lXdpms $_ld_x11 && _xdpms3
=yes
3858 #include <X11/Xlib.h>
3859 #include <X11/extensions/dpms.h>
3861 (void) DPMSQueryExtension(0, 0, 0);
3864 cc_check
$_ld_x11 && _xdpms4
=yes
3866 if test "$_xdpms4" = yes ; then
3867 _def_xdpms
='#define HAVE_XDPMS 1'
3868 _res_comment
="using Xdpms 4"
3870 elif test "$_xdpms3" = yes ; then
3871 _def_xdpms
='#define HAVE_XDPMS 1'
3872 _ld_x11
="-lXdpms $_ld_x11"
3873 _res_comment
="using Xdpms 3"
3876 _def_xdpms
='#undef HAVE_XDPMS'
3882 if test "$_xv" = auto
; then
3884 #include <X11/Xlib.h>
3885 #include <X11/extensions/Xvlib.h>
3887 (void) XvGetPortAttribute(0, 0, 0, 0);
3888 (void) XvQueryPortAttributes(0, 0, 0);
3892 cc_check
-lXv $_ld_x11 && _xv
=yes
3895 if test "$_xv" = yes ; then
3896 _def_xv
='#define HAVE_XV 1'
3898 _vosrc
="$_vosrc vo_xv.c"
3899 _vomodules
="xv $_vomodules"
3901 _def_xv
='#undef HAVE_XV'
3902 _novomodules
="xv $_novomodules"
3908 if test "$_xv" = yes && test "$_xvmc" != no
; then
3911 #include <X11/Xlib.h>
3912 #include <X11/extensions/Xvlib.h>
3913 #include <X11/extensions/XvMClib.h>
3915 (void) XvMCQueryExtension(0,0,0);
3916 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3919 for _ld_tmp
in $_xvmclib XvMCNVIDIA XvMCW I810XvMC
; do
3920 cc_check
-lXvMC -l$_ld_tmp $_ld_xv $_ld_x11 && _xvmc
=yes && _xvmclib
="$_ld_tmp" && break
3923 if test "$_xvmc" = yes ; then
3924 _def_xvmc
='#define HAVE_XVMC 1'
3925 _ld_xvmc
="-lXvMC -l$_xvmclib"
3926 _vosrc
="$_vosrc vo_xvmc.c"
3927 _vomodules
="xvmc $_vomodules"
3928 _res_comment
="using $_xvmclib"
3930 _def_xvmc
='#undef HAVE_XVMC'
3931 _novomodules
="xvmc $_novomodules"
3936 echocheck
"Xinerama"
3937 if test "$_xinerama" = auto
; then
3939 #include <X11/Xlib.h>
3940 #include <X11/extensions/Xinerama.h>
3941 int main(void) { (void) XineramaIsActive(0); return 0; }
3944 cc_check
-lXinerama $_ld_x11 && _xinerama
=yes
3947 if test "$_xinerama" = yes ; then
3948 _def_xinerama
='#define HAVE_XINERAMA 1'
3949 _ld_xinerama
='-lXinerama'
3951 _def_xinerama
='#undef HAVE_XINERAMA'
3953 echores
"$_xinerama"
3956 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3957 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3958 # named 'X extensions' or something similar.
3959 # This check may be useful for future mplayer versions (to change resolution)
3960 # If you run into problems, remove '-lXxf86vm'.
3962 if test "$_vm" = auto
; then
3964 #include <X11/Xlib.h>
3965 #include <X11/extensions/xf86vmode.h>
3966 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3969 cc_check
-lXxf86vm $_ld_x11 && _vm
=yes
3971 if test "$_vm" = yes ; then
3972 _def_vm
='#define HAVE_XF86VM 1'
3975 _def_vm
='#undef HAVE_XF86VM'
3979 # Check for the presence of special keycodes, like audio control buttons
3980 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3981 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3982 # have these new keycodes.
3983 echocheck
"XF86keysym"
3984 if test "$_xf86keysym" = auto
; then
3987 #include <X11/Xlib.h>
3988 #include <X11/XF86keysym.h>
3989 int main(void) { return XF86XK_AudioPause; }
3991 cc_check
$_ld_x11 && _xf86keysym
=yes
3993 if test "$_xf86keysym" = yes ; then
3994 _def_xf86keysym
='#define HAVE_XF86XK 1'
3996 _def_xf86keysym
='#undef HAVE_XF86XK'
3998 echores
"$_xf86keysym"
4001 # Version 2 is preferred to version 1 if available
4002 if test "$_dga" = auto
; then
4004 #include <X11/Xlib.h>
4005 #include <X11/extensions/xf86dga.h>
4006 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4009 cc_check
-lXxf86dga -lXxf86vm $_ld_x11 && _dga
=1
4012 #include <X11/Xlib.h>
4013 #include <X11/extensions/xf86dga.h>
4014 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4016 cc_check
-lXxf86dga $_ld_x11 && _dga
=2
4019 _def_dga
='#undef HAVE_DGA'
4020 _def_dga2
='#undef HAVE_DGA2'
4021 if test "$_dga" = 1 ; then
4022 _def_dga
='#define HAVE_DGA 1'
4023 _ld_dga
='-lXxf86dga'
4024 _vosrc
="$_vosrc vo_dga.c"
4025 _vomodules
="dga $_vomodules"
4026 _res_comment
="using DGA 1.0"
4027 elif test "$_dga" = 2 ; then
4028 _def_dga
='#define HAVE_DGA 1'
4029 _def_dga2
='#define HAVE_DGA2 1'
4030 _ld_dga
='-lXxf86dga'
4031 _vosrc
="$_vosrc vo_dga.c"
4032 _vomodules
="dga $_vomodules"
4033 _res_comment
="using DGA 2.0"
4034 elif test "$_dga" = no
; then
4035 _novomodules
="dga $_novomodules"
4037 die
"DGA version must be 1 or 2"
4043 #Note: this test is run even with --enable-gl since we autodetect $_ld_gl
4044 if (test "$_x11" = yes || win32
) && test "$_gl" != no
; then
4047 int main(void) { return 0; }
4050 if cc_check
$_ld_x11 -lGL $_ld_lm ; then
4052 _ld_gl
="-lGL $_ld_dl"
4053 elif cc_check
$_ld_x11 -lGL $_ld_lm $_ld_pthread ; then
4055 _ld_gl
="-lGL $_ld_pthread $_ld_dl"
4056 elif cc_check
-lopengl32 ; then
4059 _ld_gl
="-lopengl32 -lgdi32"
4064 if test "$_gl" = yes ; then
4065 _def_gl
='#define HAVE_GL 1'
4066 _vosrc
="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4067 if test "$_gl_win32" = yes ; then
4068 _def_gl_win32
='#define GL_WIN32 1'
4069 _vosrc
="$_vosrc w32_common.c"
4070 _res_comment
="win32 version"
4072 _vomodules
="opengl $_vomodules"
4074 _def_gl
='#undef HAVE_GL'
4075 _def_gl_win32
='#undef GL_WIN32'
4076 _novomodules
="opengl $_novomodules"
4081 echocheck
"/dev/mga_vid"
4082 if test "$_mga" = auto
; then
4084 test -c /dev
/mga_vid
&& _mga
=yes
4086 if test "$_mga" = yes ; then
4087 _def_mga
='#define HAVE_MGA 1'
4088 _vosrc
="$_vosrc vo_mga.c"
4089 _vomodules
="mga $_vomodules"
4091 _def_mga
='#undef HAVE_MGA'
4092 _novomodules
="mga $_novomodules"
4097 # echocheck "syncfb"
4099 # test "$_mga" = yes && _syncfb=yes
4100 # if test "$_syncfb" = yes ; then
4101 # _def_syncfb='#define HAVE_SYNCFB 1'
4102 # _vosrc="$_vosrc vo_syncfb.c"
4104 # _def_syncfb='#undef HAVE_SYNCFB'
4106 # echores "$_syncfb"
4110 if test "$_xmga" = auto
; then
4112 test "$_x11" = yes && test "$_mga" = yes && _xmga
=yes
4114 if test "$_xmga" = yes ; then
4115 _def_xmga
='#define HAVE_XMGA 1'
4116 _vosrc
="$_vosrc vo_xmga.c"
4117 _vomodules
="xmga $_vomodules"
4119 _def_xmga
='#undef HAVE_XMGA'
4120 _novomodules
="xmga $_novomodules"
4126 if test "$_ggi" = auto
; then
4128 #include <ggi/ggi.h>
4129 int main(void) { return 0; }
4132 cc_check
-lggi && _ggi
=yes
4134 if test "$_ggi" = yes ; then
4135 _def_ggi
='#define HAVE_GGI 1'
4137 _vosrc
="$_vosrc vo_ggi.c"
4138 _vomodules
="ggi $_vomodules"
4140 _def_ggi
='#undef HAVE_GGI'
4141 _novomodules
="ggi $_novomodules"
4145 echocheck
"GGI extension: libggiwmh"
4146 if test "$_ggiwmh" = auto
; then
4149 #include <ggi/ggi.h>
4150 #include <ggi/wmh.h>
4151 int main(void) { return 0; }
4153 cc_check
-lggi -lggiwmh && _ggiwmh
=yes
4155 # needed to get right output on obscure combination
4156 # like --disable-ggi --enable-ggiwmh
4157 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4158 _def_ggiwmh
='#define HAVE_GGIWMH 1'
4159 _ld_ggi
="$_ld_ggi -lggiwmh"
4162 _def_ggiwmh
='#undef HAVE_GGIWMH'
4168 if test "$_aa" = auto
; then
4171 extern struct aa_hardware_params aa_defparams;
4172 extern struct aa_renderparams aa_defrenderparams;
4176 (void) aa_init(0, 0, 0);
4177 c = aa_autoinit(&aa_defparams);
4178 p = aa_getrenderparams();
4179 aa_autoinitkbd(c,0);
4183 for _ld_tmp
in "-laa" "$_ld_x11 -laa" ; do
4184 cc_check
$_ld_tmp && _ld_aa
=$_ld_tmp && _aa
=yes && break
4187 if test "$_aa" = yes ; then
4188 _def_aa
='#define HAVE_AA 1'
4190 _ld_aa
=`aalib-config --libs | cut -d " " -f 2,5,6`
4192 _vosrc
="$_vosrc vo_aa.c"
4193 _vomodules
="aa $_vomodules"
4195 _def_aa
='#undef HAVE_AA'
4196 _novomodules
="aa $_novomodules"
4202 if test "$_caca" = auto
; then
4204 if ( caca-config
--version ) >> "$TMPLOG" 2>&1 ; then
4207 #ifdef CACA_API_VERSION_1
4210 int main(void) { (void) caca_init(); return 0; }
4212 cc_check
`caca-config --libs` && _caca
=yes
4215 if test "$_caca" = yes ; then
4216 _def_caca
='#define HAVE_CACA 1'
4217 _inc_extra
="$_inc_extra `caca-config --cflags`"
4218 _ld_caca
=`caca-config --libs`
4219 _vosrc
="$_vosrc vo_caca.c"
4220 _vomodules
="caca $_vomodules"
4222 _def_caca
='#undef HAVE_CACA'
4223 _novomodules
="caca $_novomodules"
4229 if test "$_svga" = auto
; then
4232 int main(void) { return 0; }
4235 cc_check
-lvga $_ld_lm && _svga
=yes
4237 if test "$_svga" = yes ; then
4238 _def_svga
='#define HAVE_SVGALIB 1'
4240 _vosrc
="$_vosrc vo_svga.c"
4241 _vomodules
="svga $_vomodules"
4243 _def_svga
='#undef HAVE_SVGALIB'
4244 _novomodules
="svga $_novomodules"
4250 if test "$_fbdev" = auto
; then
4252 linux
&& test -c /dev
/fb0
&& _fbdev
=yes
4254 if test "$_fbdev" = yes ; then
4255 _def_fbdev
='#define HAVE_FBDEV 1'
4256 _vosrc
="$_vosrc vo_fbdev.c vo_fbdev2.c"
4257 _vomodules
="fbdev $_vomodules"
4259 _def_fbdev
='#undef HAVE_FBDEV'
4260 _novomodules
="fbdev $_novomodules"
4267 if test "$_dvb" = auto
; then
4270 #include <sys/poll.h>
4271 #include <sys/ioctl.h>
4276 #include <ost/dmx.h>
4277 #include <ost/frontend.h>
4278 #include <ost/sec.h>
4279 #include <ost/video.h>
4280 #include <ost/audio.h>
4281 int main(void) {return 0;}
4283 for _inc_tmp
in "" "-I/usr/src/DVB/ost/include" ; do
4284 cc_check
$_inc_tmp && _dvb
=yes && \
4285 _inc_extra
="$_inc_extra $_inc_tmp" && break
4289 if test "$_dvb" = yes ; then
4290 _def_dvb
='#define HAVE_DVB 1'
4291 _def_dvb_in
='#define HAS_DVBIN_SUPPORT 1'
4292 _aomodules
="mpegpes(dvb) $_aomodules"
4293 _vomodules
="mpegpes(dvb) $_vomodules"
4296 echocheck
"DVB HEAD"
4297 if test "$_dvbhead" = auto
; then
4301 #include <sys/poll.h>
4302 #include <sys/ioctl.h>
4307 #include <linux/dvb/dmx.h>
4308 #include <linux/dvb/frontend.h>
4309 #include <linux/dvb/video.h>
4310 #include <linux/dvb/audio.h>
4311 int main(void) {return 0;}
4313 for _inc_tmp
in "" "-I/usr/src/DVB/include" ; do
4314 cc_check
$_inc_tmp && _dvbhead
=yes && \
4315 _inc_extra
="$_inc_extra $_inc_tmp" && break
4319 if test "$_dvbhead" = yes ; then
4320 _def_dvb
='#define HAVE_DVB_HEAD 1'
4321 _def_dvb_in
='#define HAS_DVBIN_SUPPORT 1'
4322 _aomodules
="mpegpes(dvb) $_aomodules"
4323 _vomodules
="mpegpes(dvb) $_vomodules"
4326 if test "$_dvbhead" = no
&& test "$_dvb" = no
; then
4327 _def_dvb
='#undef HAVE_DVB'
4328 _def_dvb_in
='#undef HAS_DVBIN_SUPPORT '
4329 _aomodules
="mpegpes(file) $_aomodules"
4330 _vomodules
="mpegpes(file) $_vomodules"
4333 if test "$_dvb" = yes ||
test "$_dvbhead" = yes ; then
4335 _inputmodules
="dvb $_inputmodules"
4338 _noinputmodules
="dvb $_noinputmodules"
4341 echocheck
"PNG support"
4342 if test "$_png" = auto
; then
4345 # Don't check for -lpng on irix since it has its own libpng
4346 # incompatible with the GNU libpng
4347 _res_comment
="disabled on irix (not GNU libpng)"
4353 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4354 printf("libpng: %s\n", png_libpng_ver);
4355 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4358 if cc_check
-lpng -lz $_ld_lm ; then
4362 _res_comment
="mismatch of library and header versions"
4368 if test "$_png" = yes ; then
4369 _def_png
='#define HAVE_PNG 1'
4371 _vosrc
="$_vosrc vo_png.c"
4372 _vomodules
="png $_vomodules"
4374 _def_png
='#undef HAVE_PNG'
4375 _novomodules
="png $_novomodules"
4378 echocheck
"JPEG support"
4379 if test "$_jpeg" = auto
; then
4386 #include <jpeglib.h>
4391 if cc_check
-ljpeg $_ld_lm ; then
4399 if test "$_jpeg" = yes ; then
4400 _def_jpeg
='#define HAVE_JPEG 1'
4401 _vosrc
="$_vosrc vo_jpeg.c"
4402 _vomodules
="jpeg $_vomodules"
4405 _def_jpeg
='#undef HAVE_JPEG'
4406 _novomodules
="jpeg $_novomodules"
4411 echocheck
"PNM support"
4412 if test "$_pnm" = yes; then
4413 _def_pnm
="#define HAVE_PNM"
4414 _vosrc
="$_vosrc vo_pnm.c"
4415 _vomodules
="pnm $_vomodules"
4417 _def_pnm
="#undef HAVE_PNM"
4418 _novomodules
="pnm $_novomodules"
4424 echocheck
"GIF support"
4425 # This is to appease people who want to force gif support.
4426 # If it is forced to yes, then we still do checks to determine
4427 # which gif library to use.
4428 if test "$_gif" = yes ; then
4433 if test "$_gif" = auto
; then
4436 #include <gif_lib.h>
4441 for _ld_tmp
in "-lungif" "-lungif $_ld_x11" "-lgif" "-lgif $_ld_x11" ; do
4442 cc_check
$_ld_tmp && tmp_run
&& _ld_gif
="$_ld_tmp" && _gif
=yes && break
4446 # If no library was found, and the user wants support forced,
4447 # then we force it on with libgif, as this is the safest
4448 # assumption IMHO. (libungif & libregif both create symbolic
4449 # links to libgif. We also assume that no x11 support is needed,
4450 # because if you are forcing this, then you _should_ know what
4451 # you are doing. [ Besides, package maintainers should never
4452 # have compiled x11 deps into libungif in the first place. ] )
4455 if test "$_force_gif" = yes && test "$_gif" = no
; then
4460 if test "$_gif" = yes ; then
4461 _def_gif
='#define HAVE_GIF 1'
4462 _vosrc
="$_vosrc vo_gif89a.c"
4463 _codecmodules
="gif $_codecmodules"
4464 _vomodules
="gif89a $_vomodules"
4465 _res_comment
="old version, some encoding functions disabled"
4466 _def_gif_4
='#undef HAVE_GIF_4'
4470 #include <gif_lib.h>
4471 void catch() { exit(1); }
4473 signal(SIGSEGV, catch); // catch segfault
4474 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4475 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4479 if cc_check
"$_ld_gif" && tmp_run
; then
4480 _def_gif_4
='#define HAVE_GIF_4 1'
4484 _def_gif
='#undef HAVE_GIF'
4485 _def_gif_4
='#undef HAVE_GIF_4'
4486 _novomodules
="gif89a $_novomodules"
4487 _nocodecmodules
="gif $_nocodecmodules"
4492 case "$_gif" in yes*)
4493 echocheck
"broken giflib workaround"
4494 _def_gif_tvt_hack
='#define HAVE_GIF_TVT_HACK 1'
4497 #include <gif_lib.h>
4500 printf("UserData is at address %p\n", gif.UserData);
4504 if cc_check
"$_ld_gif" && tmp_run
; then
4505 _def_gif_tvt_hack
='#undef HAVE_GIF_TVT_HACK'
4514 echocheck
"VESA support"
4515 if test "$_vesa" = auto
; then
4518 int main(void) { vbeVersion(); return 0; }
4521 cc_check
-lvbe -llrmi && _vesa
=yes
4523 if test "$_vesa" = yes ; then
4524 _def_vesa
='#define HAVE_VESA 1'
4525 _ld_vesa
="-lvbe -llrmi"
4526 _vosrc
="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4527 _vomodules
="vesa $_vomodules"
4529 _def_vesa
='#undef HAVE_VESA'
4530 _novomodules
="vesa $_novomodules"
4540 if test -z "$_sdlconfig" ; then
4541 if ( sdl-config
--version ) >>"$TMPLOG" 2>&1 ; then
4542 _sdlconfig
="sdl-config"
4543 elif ( sdl11-config
--version ) >>"$TMPLOG" 2>&1 ; then
4544 _sdlconfig
="sdl11-config"
4549 if test "$_sdl" = auto ||
test "$_sdl" = yes ; then
4552 int main(int argc, char *argv[]) { return 0; }
4555 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4556 if cc_check
`$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4557 _sdlversion
=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4558 if test "$_sdlversion" -gt 116 ; then
4559 if test "$_sdlversion" -lt 121 ; then
4560 _def_sdlbuggy
='#define BUGGY_SDL'
4562 _def_sdlbuggy
='#undef BUGGY_SDL'
4569 if test "$_sdl" = yes ; then
4570 _def_sdl
='#define HAVE_SDL 1'
4572 _ld_sdl
=`$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`
4573 _inc_extra
="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4575 _ld_sdl
=`$_sdlconfig --libs | sed s/-mwindows//`
4576 _inc_extra
="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4578 _ld_sdl
=`$_sdlconfig --libs`
4579 _inc_extra
="$_inc_extra `$_sdlconfig --cflags`"
4581 _vosrc
="$_vosrc vo_sdl.c"
4582 _vomodules
="sdl $_vomodules"
4583 _aosrc
="$_aosrc ao_sdl.c"
4584 _aomodules
="sdl $_aomodules"
4585 _res_comment
="using $_sdlconfig"
4587 _def_sdl
='#undef HAVE_SDL'
4588 _novomodules
="sdl $_novomodules"
4589 _noaomodules
="sdl $_noaomodules"
4596 echocheck
"Windows waveout"
4597 if test "$_win32waveout" = auto
; then
4599 #include <windows.h>
4600 #include <mmsystem.h>
4601 int main(void) { return 0; }
4604 cc_check
-lwinmm && _win32waveout
=yes
4606 if test "$_win32waveout" = yes ; then
4607 _def_win32waveout
='#define HAVE_WIN32WAVEOUT 1'
4608 _ld_win32libs
="-lwinmm $_ld_win32libs"
4609 _aosrc
="$_aosrc ao_win32.c"
4610 _aomodules
="win32 $_aomodules"
4612 _def_win32waveout
='#undef HAVE_WIN32WAVEOUT'
4613 _noaomodules
="win32 $_noaomodules"
4615 echores
"$_win32waveout"
4618 if test "$_directx" = auto
; then
4620 #include <windows.h>
4623 int main(void) { return 0; }
4626 cc_check
-lgdi32 && _directx
=yes
4628 if test "$_directx" = yes ; then
4629 _def_directx
='#define HAVE_DIRECTX 1'
4630 _ld_win32libs
="-lgdi32 $_ld_win32libs"
4631 _vosrc
="$_vosrc vo_directx.c"
4632 _vomodules
="directx $_vomodules"
4633 _aosrc
="$_aosrc ao_dsound.c"
4634 _aomodules
="dsound $_aomodules"
4636 _def_directx
='#undef HAVE_DIRECTX'
4637 _novomodules
="directx $_novomodules"
4638 _noaomodules
="dsound $_noaomodules"
4646 if test "$_nas" = auto
; then
4648 #include <audio/audiolib.h>
4649 int main(void) { return 0; }
4652 cc_check
$_ld_lm -laudio -lXt $_ld_x11 && _nas
=yes
4654 if test "$_nas" = yes ; then
4655 _def_nas
='#define HAVE_NAS 1'
4656 _ld_nas
="-laudio -lXt $_ld_x11"
4657 _aosrc
="$_aosrc ao_nas.c"
4658 _aomodules
="nas $_aomodules"
4660 _noaomodules
="nas $_noaomodules"
4661 _def_nas
='#undef HAVE_NAS'
4666 if test "$_dxr2" = auto
; then
4669 #include <dxr2ioctl.h>
4670 int main(void) { return 0; }
4672 for _inc_tmp
in "" -I/usr
/local
/include
/dxr2
-I/usr
/include
/dxr2
; do
4673 cc_check
$_inc_tmp && _dxr2
=yes && \
4674 _inc_extra
="$_inc_extra $_inc_tmp" && break
4677 if test "$_dxr2" = yes; then
4678 _def_dxr2
='#define HAVE_DXR2 1'
4679 _vosrc
="$_vosrc vo_dxr2.c"
4680 _aosrc
="$_aosrc ao_dxr2.c"
4681 _aomodules
="dxr2 $_aomodules"
4682 _vomodules
="dxr2 $_vomodules"
4684 _def_dxr2
='#undef HAVE_DXR2'
4685 _noaomodules
="dxr2 $_noaomodules"
4686 _novomodules
="dxr2 $_novomodules"
4691 if test "$_dxr3" = auto
; then
4693 #include <linux/em8300.h>
4694 int main(void) { return 0; }
4697 cc_check
&& _dxr3
=yes
4699 if test "$_dxr3" = yes ; then
4700 _def_dxr3
='#define HAVE_DXR3 1'
4701 _vosrc
="$_vosrc vo_dxr3.c"
4702 _vomodules
="dxr3 $_vomodules"
4704 _def_dxr3
='#undef HAVE_DXR3'
4705 _novomodules
="dxr3 $_novomodules"
4710 echocheck
"IVTV TV-Out"
4711 if test "$_ivtv" = auto
; then
4714 #include <inttypes.h>
4715 #include <linux/types.h>
4716 #include <linux/videodev2.h>
4717 #include <linux/ivtv.h>
4718 int main(void) { return 0; }
4721 cc_check
&& _ivtv
=yes
4723 if test "$_ivtv" = yes ; then
4724 _def_ivtv
='#define HAVE_IVTV 1'
4725 _vosrc
="$_vosrc vo_ivtv.c"
4726 _vomodules
="ivtv $_vomodules"
4727 _aosrc
="$_aosrc ao_ivtv.c"
4728 _aomodules
="ivtv $_aomodules"
4730 _def_ivtv
='#undef HAVE_IVTV'
4731 _novomodules
="ivtv $_novomodules"
4732 _noaomodules
="ivtv $_noaomodules"
4743 echocheck
"OSS Audio"
4744 if test "$_ossaudio" = auto
; then
4746 #include <sys/ioctl.h>
4748 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4751 cc_check
&& _ossaudio
=yes
4753 if test "$_ossaudio" = yes ; then
4754 _def_ossaudio
='#define USE_OSS_AUDIO 1'
4755 _aosrc
="$_aosrc ao_oss.c"
4756 _aomodules
="oss $_aomodules"
4757 if test "$_linux_devfs" = yes; then
4758 _def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/sound/dsp"'
4759 _def_ossaudio_devmixer
='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4762 #include <sys/ioctl.h>
4764 #ifdef OPEN_SOUND_SYSTEM
4765 int main(void) { return 0; }
4767 #error Not the real thing
4771 cc_check
&& _real_ossaudio
=yes
4772 if test "$_real_ossaudio" = yes; then
4773 _def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4774 elif netbsd || openbsd
; then
4775 _def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/sound"'
4776 _ld_arch
="$_ld_arch -lossaudio"
4778 _def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4780 _def_ossaudio_devmixer
='#define PATH_DEV_MIXER "/dev/mixer"'
4783 _def_ossaudio
='#undef USE_OSS_AUDIO'
4784 _def_ossaudio_devdsp
='#define PATH_DEV_DSP ""'
4785 _def_ossaudio_devmixer
='#define PATH_DEV_MIXER ""'
4786 _noaomodules
="oss $_noaomodules"
4788 echores
"$_ossaudio"
4792 if test "$_arts" = auto
; then
4794 if ( artsc-config
--version ) >> "$TMPLOG" 2>&1 ; then
4798 int main(void) { return 0; }
4800 cc_check
`artsc-config --libs` `artsc-config --cflags` && tmp_run
&& _arts
=yes
4805 if test "$_arts" = yes ; then
4806 _def_arts
='#define USE_ARTS 1'
4807 _aosrc
="$_aosrc ao_arts.c"
4808 _aomodules
="arts $_aomodules"
4809 _ld_arts
=`artsc-config --libs`
4810 _inc_extra
="$_inc_extra `artsc-config --cflags`"
4812 _noaomodules
="arts $_noaomodules"
4818 if test "$_esd" = auto
; then
4820 if ( esd-config
--version ) >> "$TMPLOG" 2>&1 ; then
4824 int main(void) { return 0; }
4826 cc_check
`esd-config --libs` `esd-config --cflags` && tmp_run
&& _esd
=yes
4832 if test "$_esd" = yes ; then
4833 _def_esd
='#define USE_ESD 1'
4834 _aosrc
="$_aosrc ao_esd.c"
4835 _aomodules
="esd $_aomodules"
4836 _ld_esd
=`esd-config --libs`
4837 _inc_extra
="$_inc_extra `esd-config --cflags`"
4839 echocheck
"esd_get_latency()"
4842 int main(void) { return esd_get_latency(0); }
4844 cc_check
`esd-config --libs` `esd-config --cflags` && _esd_latency
=yes && _def_esd_latency
='#define HAVE_ESD_LATENCY'
4845 echores
"$_esd_latency"
4847 _def_esd
='#undef USE_ESD'
4848 _def_esd_latency
='#undef HAVE_ESD_LATENCY'
4849 _noaomodules
="esd $_noaomodules"
4853 if test "$_polyp" = auto
; then
4855 if $_pkg_config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
4858 #include <polyp/polyplib.h>
4859 #include <polyp/mainloop.h>
4860 #include <polyp/polyplib-error.h>
4861 int main(void) { return 0; }
4863 cc_check
`$_pkg_config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run
&& _polyp
=yes
4869 if test "$_polyp" = yes ; then
4870 _def_polyp
='#define USE_POLYP 1'
4871 _aosrc
="$_aosrc ao_polyp.c"
4872 _aomodules
="polyp $_aomodules"
4873 _ld_polyp
=`$_pkg_config --libs polyplib polyplib-error polyplib-mainloop`
4874 _inc_extra
="$_inc_extra `$_pkg_config --cflags polyplib polyplib-error polyplib-mainloop`"
4876 _def_polyp
='#undef USE_POLYP'
4877 _noaomodules
="polyp $_noaomodules"
4882 if test "$_jack" = auto
; then
4886 #include <jack/jack.h>
4887 int main(void) { jack_client_new("test"); return 0; }
4889 if cc_check
-ljack ; then
4891 elif cc_check
`$_pkg_config --libs --cflags --silence-errors jack` ; then
4892 _ld_jack
="`$_pkg_config --libs jack`"
4893 _inc_extra
="$_inc_extra "`$_pkg_config --cflags jack`""
4899 if test "$_jack" = yes ; then
4900 _def_jack
='#define USE_JACK 1'
4901 _aosrc
="$_aosrc ao_jack.c"
4902 _aomodules
="jack $_aomodules"
4904 _noaomodules
="jack $_noaomodules"
4909 if test "$_openal" = auto
; then
4914 alSourceQueueBuffers(0, 0, 0);
4915 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4919 if cc_check
-lopenal ; then
4920 _ld_openal
="-lopenal"
4924 if test "$_openal" = yes ; then
4925 _def_openal
='#define USE_OPENAL 1'
4926 _aosrc
="$_aosrc ao_openal.c"
4927 _aomodules
="openal $_aomodules"
4929 _noaomodules
="openal $_noaomodules"
4933 echocheck
"ALSA audio"
4934 if test "$_alsa" != no
; then
4937 #include <sys/asoundlib.h>
4938 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
4939 #error "alsa version != 0.5.x"
4941 int main(void) { return 0; }
4943 cc_check
-lasound $_ld_dl $_ld_pthread && _alsaver
='0.5.x'
4946 #include <sys/asoundlib.h>
4947 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4948 #error "alsa version != 0.9.x"
4950 int main(void) { return 0; }
4952 cc_check
-lasound $_ld_dl $_ld_pthread && _alsaver
='0.9.x-sys'
4954 #include <alsa/asoundlib.h>
4955 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4956 #error "alsa version != 0.9.x"
4958 int main(void) { return 0; }
4960 cc_check
-lasound $_ld_dl $_ld_pthread && _alsaver
='0.9.x-alsa'
4963 #include <sys/asoundlib.h>
4964 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4965 #error "alsa version != 1.0.x"
4967 int main(void) { return 0; }
4969 cc_check
-lasound $_ld_dl $_ld_pthread && _alsaver
='1.0.x-sys'
4971 #include <alsa/asoundlib.h>
4972 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4973 #error "alsa version != 1.0.x"
4975 int main(void) { return 0; }
4977 cc_check
-lasound $_ld_dl $_ld_pthread && _alsaver
='1.0.x-alsa'
4979 _def_alsa5
='#undef HAVE_ALSA5'
4980 _def_alsa9
='#undef HAVE_ALSA9'
4981 _def_alsa1x
='#undef HAVE_ALSA1X'
4982 _def_sys_asoundlib_h
='#undef HAVE_SYS_ASOUNDLIB_H'
4983 _def_alsa_asoundlib_h
='#undef HAVE_ALSA_ASOUNDLIB_H'
4984 if test "$_alsaver" ; then
4986 if test "$_alsaver" = '0.5.x' ; then
4988 _aosrc
="$_aosrc ao_alsa5.c"
4989 _aomodules
="alsa5 $_aomodules"
4990 _def_alsa5
='#define HAVE_ALSA5 1'
4991 _def_sys_asoundlib_h
='#define HAVE_SYS_ASOUNDLIB_H 1'
4992 _res_comment
="using alsa 0.5.x and sys/asoundlib.h"
4993 elif test "$_alsaver" = '0.9.x-sys' ; then
4995 _aosrc
="$_aosrc ao_alsa.c"
4996 _aomodules
="alsa $_aomodules"
4997 _def_alsa9
='#define HAVE_ALSA9 1'
4998 _def_sys_asoundlib_h
='#define HAVE_SYS_ASOUNDLIB_H 1'
4999 _res_comment
="using alsa 0.9.x and sys/asoundlib.h"
5000 elif test "$_alsaver" = '0.9.x-alsa' ; then
5002 _aosrc
="$_aosrc ao_alsa.c"
5003 _aomodules
="alsa $_aomodules"
5004 _def_alsa9
='#define HAVE_ALSA9 1'
5005 _def_alsa_asoundlib_h
='#define HAVE_ALSA_ASOUNDLIB_H 1'
5006 _res_comment
="using alsa 0.9.x and alsa/asoundlib.h"
5007 elif test "$_alsaver" = '1.0.x-sys' ; then
5009 _aosrc
="$_aosrc ao_alsa.c"
5010 _aomodules
="alsa $_aomodules"
5011 _def_alsa1x
="#define HAVE_ALSA1X 1"
5012 _def_alsa_asoundlib_h
='#define HAVE_SYS_ASOUNDLIB_H 1'
5013 _res_comment
="using alsa 1.0.x and sys/asoundlib.h"
5014 elif test "$_alsaver" = '1.0.x-alsa' ; then
5016 _aosrc
="$_aosrc ao_alsa.c"
5017 _aomodules
="alsa $_aomodules"
5018 _def_alsa1x
="#define HAVE_ALSA1X 1"
5019 _def_alsa_asoundlib_h
='#define HAVE_ALSA_ASOUNDLIB_H 1'
5020 _res_comment
="using alsa 1.0.x and alsa/asoundlib.h"
5023 _res_comment
="unknown version"
5025 _ld_alsa
="-lasound $_ld_dl $_ld_pthread"
5027 _noaomodules
="alsa $_noaomodules"
5032 echocheck
"Sun audio"
5033 if test "$_sunaudio" = auto
; then
5035 #include <sys/types.h>
5036 #include <sys/audioio.h>
5037 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5040 cc_check
&& _sunaudio
=yes
5042 if test "$_sunaudio" = yes ; then
5043 _def_sunaudio
='#define USE_SUN_AUDIO 1'
5044 _aosrc
="$_aosrc ao_sun.c"
5045 _aomodules
="sun $_aomodules"
5047 _def_sunaudio
='#undef USE_SUN_AUDIO'
5048 _noaomodules
="sun $_noaomodules"
5050 echores
"$_sunaudio"
5054 echocheck
"Sun mediaLib"
5055 if test "$_mlib" = auto
; then
5059 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5061 cc_check
$_ld_mlib -lmlib && _mlib
=yes
5063 if test "$_mlib" = yes ; then
5064 _def_mlib
='#define HAVE_MLIB 1'
5065 _ld_mlib
="$_ld_mlib `echo $_ld_mlib | sed s/^-L/-R/` -lmlib"
5067 _def_mlib
='#undef HAVE_MLIB'
5074 echocheck
"SGI audio"
5075 if test "$_sgiaudio" = auto
; then
5076 # check for SGI audio
5078 #include <dmedia/audio.h>
5079 int main(void) { return 0; }
5082 cc_check
&& _sgiaudio
=yes
5084 if test "$_sgiaudio" = "yes" ; then
5085 _def_sgiaudio
='#define USE_SGI_AUDIO 1'
5086 _ld_sgiaudio
='-laudio'
5087 _aosrc
="$_aosrc ao_sgi.c"
5088 _aomodules
="sgi $_aomodules"
5090 _def_sgiaudio
='#undef USE_SGI_AUDIO'
5091 _noaomodules
="sgi $_noaomodules"
5093 echores
"$_sgiaudio"
5097 echocheck
"VCD support"
5098 if linux || bsdos || freebsd || netbsd || sunos || darwin
; then
5099 _inputmodules
="vcd $_inputmodules"
5100 _def_vcd
='#define HAVE_VCD 1'
5103 _def_vcd
='#undef HAVE_VCD'
5104 _noinputmodules
="vcd $_noinputmodules"
5105 _res_comment
="not supported on this OS"
5110 echocheck
"DVD support (libdvdnav)"
5111 if test "$_dvdnav" = auto
; then
5112 $_dvdnavconfig --version >> $TMPLOG 2>&1 || _dvdnav
=no
5114 if test "$_dvdnav" = auto
; then
5117 int main(void) { dvdnav_t *dvd=0; return 0; }
5120 _dvdnavdir
=`$_dvdnavconfig --cflags`
5121 _dvdnavlibs
=`$_dvdnavconfig --libs`
5122 _dvdnavvsn
=`$_dvdnavconfig --version | sed "s/\.//g"`
5123 _dvdnavmajor
=`echo $_dvdnavvsn | cut -d. -f2`
5124 test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
5125 cc_check
$_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav
=yes
5127 if test "$_dvdnav" = yes ; then
5129 _def_dvdnav
='#define USE_DVDNAV 1'
5130 _ld_dvdnav
=`$_dvdnavconfig --libs`
5131 _dvdnav_version
=`$_dvdnavconfig --version | sed "s/\.//g"`
5132 _def_dvdnav_version
="#define DVDNAVVERSION $_dvdnav_version"
5133 _inc_extra
="$_inc_extra `$_dvdnavconfig --cflags`"
5134 _inputmodules
="dvdnav $_inputmodules"
5136 #disable dvdread checks: dvdread will be enabled using dvdnav's version of dvdread
5137 _dvdread_internal
=no
5140 _def_dvdnav
='#undef USE_DVDNAV'
5141 _noinputmodules
="dvdnav $_noinputmodules"
5147 if test "$_dvdread_internal" = auto
; then
5148 _dvdread_internal
=no
5149 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux
&& \
5150 test "$_dvd" = yes ||
test "$_cdrom" = yes ||
test "$_cdio" = yes || \
5151 test "$_dvdio" = yes ||
test "$_bsdi_dvd" = yes || \
5152 test "$_hpux_scsi_h" = yes || darwin || win32
; then
5153 _dvdread_internal
=yes
5155 _res_comment
="internal"
5157 elif test "$_dvdread" = auto
; then
5159 if test "$_dl" = yes; then
5161 #include <inttypes.h>
5162 #include <dvdread/dvd_reader.h>
5163 #include <dvdread/ifo_types.h>
5164 #include <dvdread/ifo_read.h>
5165 #include <dvdread/nav_read.h>
5166 int main(void) { return 0; }
5168 cc_check
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5169 -ldvdread $_ld_dl && _dvdread
=yes && _res_comment
="external"
5173 if test "$_dvdread_internal" = yes; then
5174 _def_dvdread_internal
="#define USE_DVDREAD_INTERNAL 1"
5175 _def_dvdread
='#define USE_DVDREAD 1'
5176 _inputmodules
="dvdread $_inputmodules"
5178 if linux || netbsd || openbsd || bsdos
; then
5179 _def_dvd_linux
='#define HAVE_LINUX_DVD_STRUCT 1'
5180 openbsd
&& _dev_dvd_openbsd
='#define HAVE_OPENBSD_DVD_STRUCT 1'
5182 _def_dvd_bsd
='#define HAVE_BSD_DVD_STRUCT 1'
5184 _def_dvd_darwin
='#define DARWIN_DVD_IOCTL'
5185 _macosx_frameworks
="$_macosx_frameworks -framework IOKit"
5187 elif test "$_dvdread" = yes; then
5188 _def_dvdread
='#define USE_DVDREAD 1'
5189 _inputmodules
="dvdread $_inputmodules"
5191 test "$_dvdnav" != yes && _ld_dvdread
='-ldvdread'
5193 _def_dvdread_internal
="#undef USE_DVDREAD_INTERNAL"
5194 _def_dvdread
='#undef USE_DVDREAD'
5195 _noinputmodules
="dvdread $_noinputmodules"
5200 echocheck
"cdparanoia"
5201 if test "$_cdparanoia" = auto
; then
5203 #include <cdda_interface.h>
5204 #include <cdda_paranoia.h>
5205 // This need a better test. How ?
5207 void *test = cdda_verbose_set;
5208 return test == (void *)1;
5212 for _inc_tmp
in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5213 cc_check
$_inc_tmp $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm && \
5214 _cdparanoia
=yes && _inc_extra
="$_inc_extra $_inc_tmp" && break
5217 if test "$_cdparanoia" = yes ; then
5219 _ld_cdparanoia
="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
5220 openbsd
&& _ld_cdparanoia
="$_ld_cdparanoia -lutil"
5222 echores
"$_cdparanoia"
5226 if test "$_libcdio" = auto
&& test "$_cdparanoia" = no
; then
5229 #include <cdio/version.h>
5230 #include <cdio/cdda.h>
5231 #include <cdio/paranoia.h>
5234 void *test = cdda_verbose_set;
5235 printf("%s\n", CDIO_VERSION);
5236 return test == (void *)1;
5241 for _ld_tmp
in "" "-lwinmm" ; do
5242 _ld_tmp
="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5243 cc_check
$_ld_tmp $_ld_lm \
5244 && _libcdio
=yes && _ld_libcdio
="$_ld_tmp" && break
5246 if test "$_libcdio" = no
&& $_pkg_config --exists libcdio_paranoia
; then
5247 _inc_tmp
=`$_pkg_config --cflags libcdio_paranoia`
5248 _ld_tmp
=`$_pkg_config --libs libcdio_paranoia`
5249 cc_check
$_inc_tmp $_ld_tmp $_ld_lm && _libcdio
=yes \
5250 && _ld_libcdio
="$_ld_tmp" && _inc_extra
="$_inc_extra $_inc_tmp"
5253 if test "$_libcdio" = yes && test "$_cdparanoia" = no
; then
5255 _def_libcdio
='#define HAVE_LIBCDIO'
5256 _def_havelibcdio
='yes'
5258 if test "$_cdparanoia" = yes ; then
5259 _res_comment
="using cdparanoia"
5261 _def_libcdio
='#undef HAVE_LIBCDIO'
5262 _def_havelibcdio
='no'
5266 if test "$_cdda" = yes ; then
5267 _def_cdparanoia
='#define HAVE_CDDA'
5268 _inputmodules
="cdda $_inputmodules"
5270 _def_cdparanoia
='#undef HAVE_CDDA'
5271 _noinputmodules
="cdda $_noinputmodules"
5274 echocheck
"bitmap font support"
5275 if test "$_bitmap_font" = yes ; then
5276 _def_bitmap_font
="#define HAVE_BITMAP_FONT 1"
5278 _def_bitmap_font
="#undef HAVE_BITMAP_FONT"
5280 echores
"$_bitmap_font"
5283 echocheck
"freetype >= 2.0.9"
5285 # freetype depends on iconv
5286 if test "$_iconv" = no
; then
5288 _res_comment
="iconv support needed"
5291 if test "$_freetype" = auto
; then
5292 if ( $_freetypeconfig --version ) >/dev
/null
2>&1 ; then
5295 #include <ft2build.h>
5296 #include FT_FREETYPE_H
5297 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5298 #error "Need FreeType 2.0.9 or newer"
5303 FT_Int major=-1,minor=-1,patch=-1;
5304 int err=FT_Init_FreeType(&library);
5306 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5309 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5310 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5311 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5312 (int)major,(int)minor,(int)patch );
5313 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5314 printf("Library and header version mismatch! Fix it in your distribution!\n");
5321 cc_check
`$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run
&& _freetype
=yes
5326 if test "$_freetype" = yes ; then
5327 _def_freetype
='#define HAVE_FREETYPE'
5328 _inc_extra
="$_inc_extra `$_freetypeconfig --cflags`"
5329 _ld_freetype
=`$_freetypeconfig --libs`
5331 _def_freetype
='#undef HAVE_FREETYPE'
5333 echores
"$_freetype"
5335 if test "$_freetype" = no
; then
5337 _res_comment
="freetype support needed"
5339 echocheck
"fontconfig"
5340 if test "$_fontconfig" = auto
; then
5343 #include <fontconfig/fontconfig.h>
5348 printf("Couldn't initialize fontconfig lib\n");
5356 for _ld_tmp
in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5357 _ld_tmp
="-lfontconfig $_ld_tmp"
5358 cc_check
$_ld_tmp && _fontconfig
=yes && _ld_fontconfig
="$_ld_tmp" && break
5360 if test "$_fontconfig" = no
&& $_pkg_config --exists fontconfig
; then
5361 _inc_tmp
=`$_pkg_config --cflags fontconfig`
5362 _ld_tmp
=`$_pkg_config --libs fontconfig`
5363 cc_check
$_inc_tmp $_ld_tmp && _fontconfig
=yes \
5364 && _ld_fontconfig
="$_ld_tmp" && _inc_extra
="$_inc_extra $_inc_tmp"
5367 if test "$_fontconfig" = yes ; then
5368 _def_fontconfig
='#define HAVE_FONTCONFIG'
5370 _def_fontconfig
='#undef HAVE_FONTCONFIG'
5372 echores
"$_fontconfig"
5375 echocheck
"SSA/ASS support"
5376 # libass depends on FreeType
5377 if test "$_freetype" = no
; then
5379 _res_comment
="FreeType support needed"
5382 if test "$_ass" = auto
; then
5384 #include <ft2build.h>
5385 #include FT_FREETYPE_H
5386 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5387 #error "Need FreeType 2.1.8 or newer"
5389 int main() { return 0; }
5392 cc_check
`$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run
&& _ass
=yes
5393 if test "$_ass" = no
; then
5394 _res_comment
="FreeType >= 2.1.8 needed"
5397 if test "$_ass" = yes ; then
5398 _def_ass
='#define USE_ASS'
5400 _def_ass
='#undef USE_ASS'
5405 echocheck
"fribidi with charsets"
5406 if test "$_fribidi" = auto
; then
5407 if ( $_fribidiconfig --version ) >/dev
/null
2>&1 ; then
5410 /* workaround for fribidi 0.10.4 and below */
5411 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5412 #include <fribidi/fribidi.h>
5415 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5416 printf("Fribidi headers are not consistents with the library!\n");
5423 cc_check
`$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run
&& _fribidi
=yes
5428 if test "$_fribidi" = yes ; then
5429 _def_fribidi
='#define USE_FRIBIDI'
5430 _inc_extra
="$_inc_extra `$_fribidiconfig --cflags`"
5431 _ld_fribidi
=`$_fribidiconfig --libs`
5433 _def_fribidi
='#undef USE_FRIBIDI'
5439 if test "$_enca" = auto
; then
5446 langs = enca_get_languages(&langcnt);
5451 cc_check
-lenca $_ld_lm && _enca
=yes
5453 if test "$_enca" = yes ; then
5454 _def_enca
='#define HAVE_ENCA 1'
5457 _def_enca
='#undef HAVE_ENCA'
5465 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5468 cc_check
-lz && _zlib
=yes
5469 if test "$_zlib" = yes ; then
5470 _def_zlib
='#define HAVE_ZLIB 1'
5473 _def_zlib
='#undef HAVE_ZLIB'
5479 if test "$_rtc" = auto
; then
5481 #include <sys/ioctl.h>
5483 #include <linux/rtc.h>
5486 #define RTC_PIE_ON RTCIO_PIE_ON
5488 int main(void) { return RTC_PIE_ON; }
5491 cc_check
&& _rtc
=yes
5494 if test "$_rtc" = yes ; then
5495 _def_rtc
='#define HAVE_RTC 1'
5497 _def_rtc
='#undef HAVE_RTC'
5502 echocheck
"external liblzo support"
5503 if test "$_liblzo" = auto
; then
5507 int main(void) { lzo_init();return 0; }
5509 cc_check
-llzo && _liblzo
=yes
5511 if test "$_liblzo" = yes ; then
5512 _def_liblzo
='#define USE_LIBLZO 1'
5514 _codecmodules
="liblzo $_codecmodules"
5516 _def_liblzo
='#undef USE_LIBLZO'
5517 _nocodecmodules
="liblzo $_nocodecmodules"
5522 echocheck
"mad support"
5523 if test "$_mad" = auto
; then
5527 int main(void) { return 0; }
5529 cc_check
-lmad && _mad
=yes
5531 if test "$_mad" = yes ; then
5532 _def_mad
='#define USE_LIBMAD 1'
5534 _codecmodules
="libmad $_codecmodules"
5536 _def_mad
='#undef USE_LIBMAD'
5537 _nocodecmodules
="libmad $_nocodecmodules"
5542 if test "$_toolame" = auto
; then
5544 #include <toolame.h>
5545 int main(void) { toolame_init(); return 0; }
5548 cc_check
$_ld_toolame -ltoolame $_ld_lm && _toolame
=yes
5550 if test "$_toolame" = yes ; then
5551 _def_toolame
='#define HAVE_TOOLAME 1'
5552 _toolame_lib
="-ltoolame"
5553 _codecmodules
="toolame $_codecmodules"
5555 _def_toolame
='#undef HAVE_TOOLAME'
5556 _nocodecmodules
="toolame $_nocodecmodules"
5558 if test "$_toolamedir" ; then
5559 _res_comment
="using $_toolamedir"
5564 if test "$_twolame" = auto
; then
5566 #include <twolame.h>
5567 int main(void) { twolame_init(); return 0; }
5570 _twolame_lib
="-ltwolame"
5571 cc_check
$_twolame_lib $_ld_lm && _twolame
=yes
5573 if test "$_twolame" = yes ; then
5574 _def_twolame
='#define HAVE_TWOLAME 1'
5575 _codecmodules
="twolame $_codecmodules"
5577 _def_twolame
='#undef HAVE_TWOLAME'
5579 _nocodecmodules
="twolame $_nocodecmodules"
5583 echocheck
"OggVorbis support"
5584 if test "$_tremor_internal" = yes; then
5586 elif test "$_tremor_external" = auto
; then
5589 #include <tremor/ivorbiscodec.h>
5590 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5592 cc_check
-logg -lvorbisidec $_ld_lm && _tremor_external
=yes && _libvorbis
=no
5594 if test "$_libvorbis" = auto
; then
5597 #include <vorbis/codec.h>
5598 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5600 cc_check
-lvorbis -logg $_ld_lm && _libvorbis
=yes
5602 if test "$_tremor_internal" = yes ; then
5604 _def_vorbis
='#define HAVE_OGGVORBIS 1'
5605 _def_tremor
='#define TREMOR 1'
5606 _codecmodules
="tremor(internal) $_codecmodules"
5607 _res_comment
="internal Tremor"
5608 if test "$_tremor_low" = yes ; then
5609 _tremor_flags
='-D_LOW_ACCURACY_'
5610 _res_comment
="internal low accuracy Tremor"
5612 elif test "$_tremor_external" = yes ; then
5614 _def_vorbis
='#define HAVE_OGGVORBIS 1'
5615 _def_tremor
='#define TREMOR 1'
5616 _codecmodules
="tremor(external) $_codecmodules"
5617 _res_comment
="external Tremor"
5618 _ld_vorbis
='-logg -lvorbisidec'
5619 elif test "$_libvorbis" = yes ; then
5621 _def_vorbis
='#define HAVE_OGGVORBIS 1'
5622 _codecmodules
="libvorbis $_codecmodules"
5623 _res_comment
="libvorbis"
5624 _ld_vorbis
='-lvorbis -logg'
5627 _nocodecmodules
="libvorbis $_nocodecmodules"
5631 echocheck
"libspeex (version >= 1.1 required)"
5632 if test "$_speex" = auto
; then
5635 #include <speex/speex.h>
5639 speex_decode_int(dec, &bits, dec);
5642 cc_check
-lspeex $_ld_lm && _speex
=yes
5644 if test "$_speex" = yes ; then
5645 _def_speex
='#define HAVE_SPEEX 1'
5647 _codecmodules
="speex $_codecmodules"
5649 _def_speex
='#undef HAVE_SPEEX'
5650 _nocodecmodules
="speex $_nocodecmodules"
5654 echocheck
"OggTheora support"
5655 if test "$_theora" = auto
; then
5658 #include <theora/theora.h>
5662 /* theora is in flux, make sure that all interface routines and
5663 * datatypes exist and work the way we expect it, so we don't break
5673 theora_info_init (&inf);
5674 theora_comment_init (&tc);
5678 /* we don't want to execute this kind of nonsense; just for making sure
5679 * that compilation works... */
5680 memset(&op, 0, sizeof(op));
5681 r = theora_decode_header (&inf, &tc, &op);
5682 r = theora_decode_init (&st, &inf);
5683 t = theora_granule_time (&st, op.granulepos);
5684 r = theora_decode_packetin (&st, &op);
5685 r = theora_decode_YUVout (&st, &yuv);
5691 for _ld_theora
in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5692 cc_check
$_ld_theora && _theora
=yes && break
5694 if test "$_theora" = no
&& test "$_tremor_internal" = yes; then
5695 for _ld_theora
in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5696 cc_check
-I. tremor
/bitwise.c
$_ld_theora && _theora
=yes && break
5700 if test "$_theora" = yes ; then
5701 _def_theora
='#define HAVE_OGGTHEORA 1'
5702 _codecmodules
="libtheora $_codecmodules"
5703 # when --enable-theora is forced, we'd better provide a probably sane
5704 # $_ld_theora than nothing
5705 test -z "$_ld_theora" && _ld_theora
="-ltheora -logg"
5707 _def_theora
='#undef HAVE_OGGTHEORA'
5708 _nocodecmodules
="libtheora $_nocodecmodules"
5713 echocheck
"mp3lib support"
5714 if test "$_mp3lib" = yes ; then
5715 _def_mp3lib
='#define USE_MP3LIB 1'
5716 _codecmodules
="mp3lib $_codecmodules"
5718 _def_mp3lib
='#undef USE_MP3LIB'
5719 _nocodecmodules
="mp3lib $_nocodecmodules"
5723 echocheck
"liba52 support"
5724 if test "$_liba52" = yes ; then
5725 _def_liba52
='#define USE_LIBA52 1'
5726 _codecmodules
="liba52 $_codecmodules"
5728 _def_liba52
='#undef USE_LIBA52'
5729 _nocodecmodules
="liba52 $_nocodecmodules"
5733 echocheck
"libdts support"
5734 if test "$_libdts" = auto
; then
5737 #include <inttypes.h>
5739 int main(void) { dts_init (0); return 0; }
5741 cc_check
$_ld_libdts -ldts $_ld_lm && _libdts
=yes
5743 if test "$_libdts" = yes ; then
5744 _def_libdts
='#define CONFIG_DTS 1'
5745 _ld_libdts
="$_ld_libdts -ldts"
5746 _codecmodules
="libdts $_codecmodules"
5748 _def_libdts
='#undef CONFIG_DTS'
5749 _nocodecmodules
="libdts $_nocodecmodules"
5753 echocheck
"libmpeg2 support"
5754 if test "$_libmpeg2" = yes ; then
5755 _def_libmpeg2
='#define USE_LIBMPEG2 1'
5756 _codecmodules
="libmpeg2 $_codecmodules"
5758 _def_libmpeg2
='#undef USE_LIBMPEG2'
5759 _nocodecmodules
="libmpeg2 $_nocodecmodules"
5761 echores
"$_libmpeg2"
5763 echocheck
"libmpcdec (musepack, version >= 1.2.1 required)"
5764 if test "$_musepack" = auto
; then
5767 #include <mpcdec/mpcdec.h>
5769 mpc_streaminfo info;
5770 mpc_decoder decoder;
5771 mpc_decoder_set_streaminfo(&decoder, &info);
5772 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5775 cc_check
-lmpcdec $_ld_lm && _musepack
=yes
5777 if test "$_musepack" = yes ; then
5778 _def_musepack
='#define HAVE_MUSEPACK 1'
5779 _ld_musepack
='-lmpcdec'
5780 _codecmodules
="musepack $_codecmodules"
5782 _def_musepack
='#undef HAVE_MUSEPACK'
5783 _nocodecmodules
="musepack $_nocodecmodules"
5785 echores
"$_musepack"
5788 echocheck
"FAAC (AAC encoder) support"
5789 if test "$_faac" = auto
; then
5791 #include <inttypes.h>
5793 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5796 for _ld_tmp
in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5797 cc_check
-c -O4 $_ld_tmp $_ld_lm && _ld_faac
="$_ld_tmp" && _faac
=yes && break
5800 if test "$_faac" = yes ; then
5801 _def_faac
="#define HAVE_FAAC 1"
5802 _def_lavc_faac
="#define CONFIG_FAAC 1"
5803 _codecmodules
="faac $_codecmodules"
5805 _def_faac
="#undef HAVE_FAAC"
5806 _nocodecmodules
="faac $_nocodecmodules"
5811 echocheck
"FAAD2 (AAC) support"
5812 if test "$_faad_internal" = auto
; then
5813 if x86
&& test cc_vendor
=gnu
; then
5815 3.1*|
3.2) # ICE/insn with these versions
5817 _res_comment
="broken gcc"
5826 elif test "$_faad_internal" = no
&& test "$_faad_external" = auto
; then
5831 #ifndef FAAD_MIN_STREAMSIZE
5832 #error Too old version
5834 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5836 cc_check
$_ld_faad $_ld_lm && _faad_external
=yes
5839 if test "$_faad_internal" = yes ; then
5840 _def_faad_internal
="#define USE_FAAD_INTERNAL 1"
5842 _res_comment
="internal floating-point"
5843 test "$_faad_fixed" = yes && _res_comment
="internal fixed-point"
5844 elif test "$_faad_external" = yes ; then
5847 _def_faad_internal
="#undef USE_FAAD_INTERNAL"
5851 if test "$_faad" = yes ; then
5852 _def_faad
='#define HAVE_FAAD 1'
5853 _codecmodules
="faad2 $_codecmodules"
5855 _def_faad
='#undef HAVE_FAAD'
5856 _nocodecmodules
="faad2 $_nocodecmodules"
5862 echocheck
"LADSPA plugin support"
5863 if test "$_ladspa" = auto
; then
5868 const LADSPA_Descriptor *ld = NULL;
5873 cc_check
&& _ladspa
=yes
5875 if test "$_ladspa" = yes; then
5876 _def_ladspa
="#define HAVE_LADSPA"
5877 _afsrc
="$_afsrc af_ladspa.c"
5878 _afmodules
="ladspa $_afmodules"
5880 _def_ladspa
="#undef HAVE_LADSPA"
5881 _noafmodules
="ladspa $_noafmodules"
5886 if test -z "$_codecsdir" ; then
5887 for dir
in "$_libdir/codecs" "$_libdir/win32" /usr
/local
/lib
/codecs \
5888 /usr
/lib
/codecs
/usr
/local
/lib
/win32
/usr
/lib
/win32
; do
5889 if test -d "$dir" ; then
5895 # Fall back on default directory.
5896 if test -z "$_codecsdir" ; then
5897 _codecsdir
="$_libdir/codecs"
5898 mingw32
&& _codecsdir
="codecs"
5902 echocheck
"Win32 codecs"
5903 if test "$_win32" = auto
; then
5905 if x86
&& not qnx
; then
5906 test -z "$_win32codecsdir" && _win32codecsdir
=$_codecsdir
5910 if test "$_win32" = yes ; then
5911 _def_win32
='#define USE_WIN32DLL 1'
5912 _res_comment
="using $_win32codecsdir"
5913 _ld_win32
='loader/libloader.a loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5914 _dep_win32
='loader/libloader.a loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5915 openbsd
&& x86
&& _ld_win32
="$_ld_win32 -li386"
5917 _def_win32_loader
='#define WIN32_LOADER 1'
5919 _ld_win32libs
="$_ld_win32libs -ladvapi32 -lole32"
5920 _res_comment
="using native windows"
5922 _codecmodules
="win32 $_codecmodules"
5924 _def_win32
='#undef USE_WIN32DLL'
5925 _def_win32_loader
='#undef WIN32_LOADER'
5926 _nocodecmodules
="win32 $_nocodecmodules"
5931 echocheck
"XAnim codecs"
5932 if test "$_xanim" = auto
; then
5934 _res_comment
="dynamic loader support needed"
5935 if test "$_dl" = yes ; then
5936 test -z "$_xanimcodecsdir" && _xanimcodecsdir
=$_codecsdir
5940 if test "$_xanim" = yes ; then
5941 _def_xanim
='#define USE_XANIM 1'
5942 _def_xanim_path
="#define XACODEC_PATH \"$_xanimcodecsdir\""
5943 _codecmodules
="xanim $_codecmodules"
5944 _res_comment
="using $_xanimcodecsdir"
5946 _def_xanim
='#undef USE_XANIM'
5947 _def_xanim_path
='#undef XACODEC_PATH'
5948 _nocodecmodules
="xanim $_nocodecmodules"
5953 echocheck
"RealPlayer codecs"
5954 if test "$_real" = auto
; then
5956 _res_comment
="dynamic loader support needed"
5957 if test "$_dl" = yes ||
test "$_win32" = yes &&
5958 (linux || freebsd || netbsd || win32 || darwin
) ; then
5959 test -z "$_realcodecsdir" && _realcodecsdir
="$_codecsdir"
5963 if test "$_real" = yes ; then
5964 _def_real
='#define USE_REALCODECS 1'
5965 _def_real_path
="#define REALCODEC_PATH \"$_realcodecsdir\""
5966 _codecmodules
="real $_codecmodules"
5967 _res_comment
="using $_realcodecsdir"
5969 _def_real
='#undef USE_REALCODECS'
5970 _def_real_path
="#undef REALCODEC_PATH"
5971 _nocodecmodules
="real $_nocodecmodules"
5976 echocheck
"LIVE555 Streaming Media libraries"
5977 if test "$_live" = auto
&& test "$_network" = yes ; then
5978 cat > $TMPCPP << EOF
5979 #include <liveMedia.hh>
5980 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1090195200)
5981 #error Please upgrade to version 2004.07.19 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5987 for I
in "$_livelibdir" "$_libdir/live" "/usr/lib/live" "/usr/local/live" "/usr/local/lib/live" ; do
5988 cxx_check
-I$I/liveMedia
/include
-I$I/UsageEnvironment
/include
-I$I/groupsock
/include
&& _livelibdir
=$I && _live
=yes && break
5990 if test "$_live" != yes ; then
5991 if cxx_check
-I/usr
/include
/liveMedia
-I/usr
/include
/UsageEnvironment
-I/usr
/include
/groupsock
; then
5996 if test "$_live" = yes && test "$_network" = yes ; then
5997 _res_comment
="using $_livelibdir"
5998 _def_live
='#define STREAMING_LIVE555 1'
5999 _ld_live
="$_livelibdir/liveMedia/libliveMedia.a \
6000 $_livelibdir/groupsock/libgroupsock.a \
6001 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6002 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6004 _inc_extra
="$_inc_extra -I$_livelibdir/liveMedia/include \
6005 -I$_livelibdir/UsageEnvironment/include \
6006 -I$_livelibdir/BasicUsageEnvironment/include \
6007 -I$_livelibdir/groupsock/include"
6008 _inputmodules
="live555 $_inputmodules"
6009 elif test "$_live_dist" = yes && test "$_network" = yes ; then
6010 _res_comment
="using distribution version"
6012 _def_live
='#define STREAMING_LIVE555 1'
6013 _ld_live
="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6014 _inc_extra
="$_inc_extra -I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6015 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6016 _inputmodules
="live555 $_inputmodules"
6018 _def_live
='#undef STREAMING_LIVE555'
6019 _noinputmodules
="live555 $_noinputmodules"
6024 echocheck
"FFmpeg libavutil (static)"
6025 if test "$_libavutil" = auto
; then
6026 if test -d libavutil
; then
6032 echores
"$_libavutil"
6034 echocheck
"FFmpeg libavcodec (static)"
6035 if test "$_libavcodec" = auto
; then
6036 # Note: static linking is preferred to dynamic linking
6038 _res_comment
="see DOCS/HTML/$_doc_lang/codecs.html"
6039 if test -d libavcodec
&& test -f libavcodec
/utils.c
; then
6040 _res_comment
="old ffmpeg version, use CVS !"
6041 if grep avcodec_find_encoder_by_name libavcodec
/utils.c
> /dev
/null
2>&1 ; then
6042 # check if libavutil is a required
6044 #include "libavcodec/avcodec.h"
6045 #if LIBAVCODEC_BUILD >= 3211265
6046 #error We need libavutil!
6048 int main(void) { return 0; }
6051 if cc_check
-I.
-I.
/libavutil
; then
6052 _libavutil_required
="no"
6054 _libavutil_required
="yes"
6056 _res_comment
="libavutil availability does not fit libavcodec version"
6057 if test "$_libavutil_required" = "$_libavutil"; then
6064 echores
"$_libavcodec"
6066 echocheck
"FFmpeg libavformat (static)"
6067 if test "$_libavformat" = auto
; then
6068 # Note: static linking is preferred to dynamic linking
6070 if test -d libavformat
&& test -f libavformat
/utils.c
; then
6074 echores
"$_libavformat"
6076 echocheck
"FFmpeg libpostproc (static)"
6077 if test "$_libpostproc" = auto
; then
6079 if test -d libpostproc
&& test -f libpostproc
/postprocess.h
; then
6083 echores
"$_libpostproc"
6086 if test "$_libavutil" != yes ; then
6087 echocheck
"FFmpeg libavutil (dynamic)"
6088 if test "$_libavutil_so" = auto
; then
6091 #include <ffmpeg/common.h>
6092 int main(void) { ff_gcd(1,1); return 0; }
6094 if $_pkg_config --exists libavutil
; then
6095 _inc_libavutil
=`$_pkg_config --cflags libavutil`
6096 _ld_libavutil
=`$_pkg_config --libs libavutil`
6097 cc_check
$_inc_libavutil $_ld_libavutil && _libavutil_so
=yes
6098 elif cc_check
-lavutil $_ld_lm ; then
6101 if test "$_libavutil_so" = yes ; then
6102 _res_comment
="using libavutil.so, but static libavutil is recommended"
6105 # neither static nor shared libavutil is available, but it is mandatory ...
6106 if test "$_libavutil_so" = no
; then
6107 die
"You need static or shared libavutil, MPlayer will not compile without!"
6109 echores
"$_libavutil_so"
6110 fi #if test "$_libavutil" != yes ; then
6112 if test "$_libavcodec" != yes ; then
6113 echocheck
"FFmpeg libavcodec (dynamic)"
6114 if test "$_libavcodec_so" = auto
; then
6116 _res_comment
="libavcodec.so is broken/obsolete"
6117 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
6119 #include <ffmpeg/avcodec.h>
6121 avcodec_find_encoder_by_name("");
6125 if $_pkg_config --exists libavcodec
; then
6126 _inc_libavcodec
=`$_pkg_config --cflags libavcodec`
6127 _ld_libavcodec
=`$_pkg_config --libs libavcodec`
6128 cc_check
$_inc_libavcodec $_ld_libavcodec && _libavcodec_so
=yes
6129 elif cc_check
-lavcodec $_ld_lm ; then
6132 if test "$_libavcodec_so" = yes ; then
6133 _res_comment
="using libavcodec.so, but static libavcodec is recommended"
6136 echores
"$_libavcodec_so"
6137 fi #if test "$_libavcodec" != yes ; then
6139 if test "$_libavformat" != yes ; then
6140 echocheck
"FFmpeg libavformat (dynamic)"
6141 if test "$_libavformat_so" = auto
; then
6144 #include <ffmpeg/avformat.h>
6145 #include <ffmpeg/opt.h>
6146 int main(void) { av_alloc_format_context(); return 0; }
6148 if $_pkg_config --exists libavformat
; then
6149 _inc_libavformat
=`$_pkg_config --cflags libavformat`
6150 _ld_libavformat
=`$_pkg_config --libs libavformat`
6151 cc_check
$_inc_libavformat $_ld_libavformat && _libavformat_so
=yes
6152 elif cc_check
$_ld_lm -lavformat ; then
6155 if test "$_libavformat_so" = yes ; then
6156 _res_comment
="using libavformat.so, but static libavformat is recommended"
6159 echores
"$_libavformat_so"
6160 fi #if test "$_libavformat" != yes ; then
6162 if test "$_libpostproc" != yes ; then
6163 echocheck
"FFmpeg libpostproc (dynamic)"
6164 if test "$_libpostproc_so" = auto
; then
6167 #define USE_LIBPOSTPROC 1
6168 #include <inttypes.h>
6169 #include <postproc/postprocess.h>
6171 pp_get_mode_by_name_and_quality("de", 0);
6174 if cc_check
-lpostproc $_ld_lm ; then
6176 _res_comment
="using libpostproc.so, but static libpostproc is recommended"
6179 echores
"$_libpostproc_so"
6180 fi #if test "$_libpostproc" != yes ; then
6182 _def_libavutil
='#undef USE_LIBAVUTIL'
6183 _def_libavutil_so
='#undef USE_LIBAVUTIL_SO'
6184 if test "$_libavutil" = yes ; then
6185 _def_libavutil
='#define USE_LIBAVUTIL 1'
6186 elif test "$_libavutil_so" = yes ; then
6187 _def_libavutil_so
='#define USE_LIBAVUTIL_SO 1'
6190 _def_libavcodec
='#undef USE_LIBAVCODEC'
6191 _def_libavcodec_so
='#undef USE_LIBAVCODEC_SO'
6192 _def_lavc_dsputil
='#undef USE_LIBAVCODEC_DSPUTIL'
6193 if test "$_libavcodec_mpegaudio_hp" = yes ; then
6194 _def_libavcodec_mpegaudio_hp
='#define CONFIG_MPEGAUDIO_HP 1'
6196 if test "$_libavcodec" = yes ; then
6197 _def_libavcodec
='#define USE_LIBAVCODEC 1'
6198 _def_lavc_dsputil
='#define USE_LIBAVCODEC_DSPUTIL'
6199 _ld_libavcodec
='libavcodec/libavcodec.a'
6200 _dep_libavcodec
='libavcodec/libavcodec.a'
6201 _codecmodules
="libavcodec $_codecmodules"
6202 if test "$_libavutil" = yes; then
6203 _ld_libavutil
='libavutil/libavutil.a'
6204 _dep_libavutil
='libavutil/libavutil.a'
6206 elif test "$_libavcodec_so" = yes ; then
6207 _def_libavcodec
='#define USE_LIBAVCODEC 1'
6208 _def_libavcodec_so
='#define USE_LIBAVCODEC_SO 1'
6209 test "$_ld_libavcodec" || _ld_libavcodec
='-lavcodec'
6210 _codecmodules
="libavcodec.so $_codecmodules"
6212 _nocodecmodules
="libavcodec $_nocodecmodules"
6215 _def_libavformat
='#undef USE_LIBAVFORMAT'
6216 _def_libavformat_so
='#undef USE_LIBAVFORMAT_SO'
6217 _def_libavformat_win32
='#undef CONFIG_WIN32'
6218 if test "$_libavformat" = yes ; then
6219 _def_libavformat
='#define USE_LIBAVFORMAT 1'
6220 _ld_libavformat
='libavformat/libavformat.a'
6221 _dep_libavformat
='libavformat/libavformat.a'
6223 _def_libavformat_win32
='#define CONFIG_WIN32 1'
6226 if test "$_libavformat_so" = yes ; then
6227 _def_libavformat_so
='#define USE_LIBAVFORMAT_SO 1'
6228 test "$_ld_libavformat" || _ld_libavformat
='-lavformat'
6230 _def_libavformat_win32
='#define CONFIG_WIN32 1'
6235 _def_libpostproc
='#undef USE_LIBPOSTPROC'
6236 _def_libpostproc_so
='#undef USE_LIBPOSTPROC_SO'
6237 if test "$_libpostproc" = yes ; then
6238 _def_libpostproc
='#define USE_LIBPOSTPROC 1'
6239 _ld_libpostproc
='libpostproc/libpostproc.a'
6240 _dep_libpostproc
='libpostproc/libpostproc.a'
6242 if test "$_libpostproc_so" = yes ; then
6243 _def_libpostproc_so
='#define USE_LIBPOSTPROC_SO 1'
6244 _ld_libpostproc
='-lpostproc'
6248 echocheck
"md5sum support"
6249 if test "$_md5sum" = yes; then
6250 _def_md5sum
="#define HAVE_MD5SUM"
6251 _vosrc
="$_vosrc vo_md5sum.c"
6252 _vomodules
="md5sum $_vomodules"
6254 _def_md5sum
="#undef HAVE_MD5SUM"
6255 _novomodules
="md5sum $_novomodules"
6259 echocheck
"AMR narrowband"
6260 if test "$_amr_nb" = auto
; then
6262 if test -f libavcodec
/amr_float
/sp_dec.c
; then
6263 if test "$_libavcodec" = yes ; then
6266 _res_comment
="libavcodec (static) is required by amr_nb, sorry"
6270 if test "$_amr_nb" = yes ; then
6272 _def_amr
='#define CONFIG_AMR 1'
6273 _def_amr_nb
='#define CONFIG_AMR_NB 1'
6275 _def_amr_nb
='#undef CONFIG_AMR_NB'
6279 echocheck
"AMR narrowband, fixed point"
6280 if test "$_amr_nb_fixed" = auto
; then
6282 if test -f libavcodec
/amr
/dtx_dec.c
; then
6283 if test "$_libavcodec" = yes ; then
6284 if test "$_amr_nb" = no
; then
6287 _res_comment
="disabled by amr_nb"
6290 _res_comment
="libavcodec (static) is required by amr_nb-fixed, sorry"
6294 if test "$_amr_nb_fixed" = yes ; then
6296 _def_amr
='#define CONFIG_AMR 1'
6297 _def_amr_nb_fixed
='#define CONFIG_AMR_NB_FIXED 1'
6299 _def_amr_nb_fixed
='#undef CONFIG_AMR_NB_FIXED'
6301 echores
"$_amr_nb_fixed"
6303 if test "$_amr_nb" = yes ||
test "$_amr_nb_fixed" = yes ; then
6304 _codecmodules
="amr_nb $_codecmodules"
6306 _nocodecmodules
="amr_nb $_nocodecmodules"
6309 echocheck
"AMR wideband"
6310 if test "$_amr_wb" = auto
; then
6312 if test -f libavcodec
/amrwb_float
/dec_dtx.c
; then
6313 if test "$_libavcodec" = yes ; then
6316 _res_comment
="libavcodec (static) is required by amr_wb, sorry"
6320 if test "$_amr_wb" = yes ; then
6322 _def_amr
='#define CONFIG_AMR 1'
6323 _def_amr_wb
='#define CONFIG_AMR_WB 1'
6324 _codecmodules
="amr_wb $_codecmodules"
6326 _def_amr_wb
='#undef CONFIG_AMR_WB'
6327 _nocodecmodules
="amr_wb $_nocodecmodules"
6331 echocheck
"libdv-0.9.5+"
6332 if test "$_libdv" = auto
; then
6335 #include <libdv/dv.h>
6336 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6338 cc_check
-ldv $_ld_pthread $_ld_lm && _libdv
=yes
6340 if test "$_libdv" = yes ; then
6341 _def_libdv
='#define HAVE_LIBDV095 1'
6343 _codecmodules
="libdv $_codecmodules"
6345 _def_libdv
='#undef HAVE_LIBDV095'
6346 _nocodecmodules
="libdv $_nocodecmodules"
6351 if test "$_zr" = auto
; then
6352 #36067's seem to identify themselves as 36057PQC's, so the line
6353 #below should work for 36067's and 36057's.
6354 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc
/pci
> /dev
/null
2>&1; then
6360 if test "$_zr" = yes ; then
6361 if test "$_libavcodec" = yes ; then
6362 _def_zr
='#define HAVE_ZR 1'
6363 _vosrc
="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6364 _vomodules
="zr zr2 $_vomodules"
6366 _res_comment
="libavcodec (static) is required by zr, sorry"
6367 _novomodules
="zr $_novomodules"
6368 _def_zr
='#undef HAVE_ZR'
6371 _def_zr
='#undef HAVE_ZR'
6372 _novomodules
="zr zr2 $_novomodules"
6377 if test "$_bl" = yes ; then
6378 _def_bl
='#define HAVE_BL 1'
6379 _vosrc
="$_vosrc vo_bl.c"
6380 _vomodules
="bl $_vomodules"
6382 _def_bl
='#undef HAVE_BL'
6383 _novomodules
="bl $_novomodules"
6389 if test "$_xvid3" = auto
; then
6392 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
6394 _ld_xvid
="$_ld_xvid -lxvidcore"
6396 cc_check
$_ld_xvid -lxvidcore $_ld_lm && _xvid3
=yes
6399 if test "$_xvid3" = yes ; then
6400 _def_xvid3
='#define HAVE_XVID3 1'
6401 _codecmodules
="xvid3 $_codecmodules"
6403 _def_xvid3
='#undef HAVE_XVID3'
6404 _nocodecmodules
="xvid3 $_nocodecmodules"
6411 if test "$_xvid" = auto
; then
6413 _ld_xvid
="$_ld_xvid -lxvidcore $_ld_lm"
6416 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6418 for _ld_tmp
in "$_ld_xvid" "$_ld_xvid $_ld_pthread" ; do
6419 cc_check
$_ld_tmp && _ld_xvid
="$_ld_tmp" && _xvid
=yes && break
6423 if test "$_xvid" = yes ; then
6424 _def_xvid
='#define HAVE_XVID4 1'
6425 _codecmodules
="xvid $_codecmodules"
6427 _def_xvid
='#undef HAVE_XVID4'
6428 _nocodecmodules
="xvid $_nocodecmodules"
6433 if test "$_xvid" = yes ; then
6434 echocheck
"XviD two pass plugin"
6437 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6439 if cc_check
$_ld_xvid $_ld_lb ; then
6441 _def_lavc_xvid
='#define CONFIG_XVID 1'
6444 _def_lavc_xvid
='#undef CONFIG_XVID'
6446 echores
"$_lavc_xvid"
6451 if test "$_x264" = auto
; then
6453 #include <inttypes.h>
6456 #error We do not support old versions of x264. Get the latest from SVN.
6458 int main(void) { x264_encoder_open((void*)0); return 0; }
6460 _ld_x264
="$_ld_x264 -lx264 $_ld_pthread"
6462 if cc_check
$_ld_x264 $_ld_lm ; then
6464 elif test "$_x11" = yes && cc_check
$_ld_x264 $_ld_x11 $_ld_lm ; then
6466 _ld_x264
="$_ld_x264 $_ld_x11"
6470 if test "$_x264" = yes ; then
6472 _def_x264
='#define HAVE_X264 1'
6473 _def_lavc_x264
='#define CONFIG_X264 1'
6474 _codecmodules
="x264 $_codecmodules"
6478 _def_x264
='#undef HAVE_X264'
6479 _def_lavc_x264
='#undef CONFIG_X264'
6480 _nocodecmodules
="x264 $_nocodecmodules"
6486 if test "$_nut" = auto
; then
6490 #include <inttypes.h>
6492 int main(void) { (void)nut_error(0); return 0; }
6496 cc_check
$_ld_nut && _nut
=yes
6499 if test "$_nut" = yes ; then
6500 _def_nut
='#define HAVE_LIBNUT 1'
6503 _def_nut
='#undef HAVE_LIBNUT'
6508 # mencoder requires (optional) those libs: libmp3lame
6509 if test "$_mencoder" != no
; then
6511 echocheck
"libmp3lame (for mencoder)"
6513 _def_mp3lame_preset
='#undef HAVE_MP3LAME_PRESET'
6514 _def_mp3lame_preset_medium
='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6516 #include <lame/lame.h>
6517 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; }
6519 # Note: libmp3lame usually depends on vorbis
6520 cc_check
-lmp3lame $_ld_vorbis $_ld_lm && tmp_run
&& _mp3lame
=yes
6521 if test "$_mp3lame" = yes ; then
6522 _def_mp3lame
="#define HAVE_MP3LAME"
6523 _def_lavc_mp3lame
="#define CONFIG_MP3LAME 1"
6524 _ld_mp3lame
="-lmp3lame $_ld_vorbis"
6526 #include <lame/lame.h>
6527 int main(void) { int p = STANDARD_FAST; return 0; }
6529 cc_check
$_ld_mp3lame $_ld_lm && _def_mp3lame_preset
="#define HAVE_MP3LAME_PRESET"
6531 #include <lame/lame.h>
6532 int main(void) { int p = MEDIUM_FAST; return 0; }
6534 cc_check
$_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium
="#define HAVE_MP3LAME_PRESET_MEDIUM"
6535 echo $_libavencoders |
grep -q mp3lame
&& _lavc_mp3lame
=yes || _lavc_mp3lame
=no
6537 _def_mp3lame
='#undef HAVE_MP3LAME'
6543 echocheck
"mencoder"
6544 _mencoder_flag
='#undef HAVE_MENCODER'
6545 if test "$_mencoder" = yes ; then
6546 _mencoder_flag
='#define HAVE_MENCODER'
6547 _def_muxers
='#define CONFIG_MUXERS 1'
6549 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6550 _libavencoders
="mpeg1video_encoder snow_encoder"
6553 echores
"$_mencoder"
6555 echocheck
"fastmemcpy"
6556 # fastmemcpy check is done earlier with tests of CPU & binutils features
6557 if test "$_fastmemcpy" = yes ; then
6558 _def_fastmemcpy
='#define USE_FASTMEMCPY 1'
6560 _def_fastmemcpy
='#undef USE_FASTMEMCPY'
6562 echores
"$_fastmemcpy"
6564 echocheck
"UniquE RAR File Library"
6565 if test "$_unrarlib" = yes ; then
6566 _def_unrarlib
='#define USE_UNRARLIB 1'
6568 _def_unrarlib
='#undef USE_UNRARLIB'
6570 echores
"$_unrarlib"
6572 echocheck
"TV interface"
6573 if test "$_tv" = yes ; then
6574 _def_tv
='#define USE_TV 1'
6575 _inputmodules
="tv $_inputmodules"
6577 _noinputmodules
="tv $_noinputmodules"
6578 _def_tv
='#undef USE_TV'
6584 echocheck
"*BSD BrookTree 848 TV interface"
6585 if test "$_tv_bsdbt848" = auto
; then
6587 if test "$_tv" = yes ; then
6589 #include <sys/types.h>
6590 #if defined(__NetBSD__)
6591 #include <dev/ic/bt8xx.h>
6593 #include <machine/ioctl_bt848.h>
6595 int main(void) { return 0; }
6597 cc_check
&& _tv_bsdbt848
=yes
6600 if test "$_tv_bsdbt848" = yes ; then
6601 _def_tv_bsdbt848
='#define HAVE_TV_BSDBT848 1'
6602 _inputmodules
="tv-bsdbt848 $_inputmodules"
6604 _def_tv_bsdbt848
='#undef HAVE_TV_BSDBT848'
6605 _noinputmodules
="tv-bsdbt848 $_noinputmodules"
6607 echores
"$_tv_bsdbt848"
6611 echocheck
"Video 4 Linux TV interface"
6612 if test "$_tv_v4l1" = auto
; then
6614 if test "$_tv" = yes && linux
; then
6617 #include <linux/videodev.h>
6618 int main(void) { return 0; }
6620 cc_check
&& _tv_v4l1
=yes
6623 if test "$_tv_v4l1" = yes ; then
6625 _def_tv_v4l
='#define HAVE_TV_V4L 1'
6626 _def_tv_v4l1
='#define HAVE_TV_V4L1 1'
6627 _inputmodules
="tv-v4l $_inputmodules"
6629 _noinputmodules
="tv-v4l1 $_noinputmodules"
6630 _def_tv_v4l
='#undef HAVE_TV_V4L'
6635 echocheck
"Video 4 Linux 2 TV interface"
6636 if test "$_tv_v4l2" = auto
; then
6638 if test "$_tv" = yes && linux
; then
6641 #include <linux/types.h>
6642 #include <linux/videodev2.h>
6643 int main(void) { return 0; }
6645 cc_check
&& _tv_v4l2
=yes
6648 if test "$_tv_v4l2" = yes ; then
6650 _def_tv_v4l
='#define HAVE_TV_V4L 1'
6651 _def_tv_v4l2
='#define HAVE_TV_V4L2 1'
6652 _inputmodules
="tv-v4l2 $_inputmodules"
6654 _noinputmodules
="tv-v4l2 $_noinputmodules"
6655 _def_tv_v4l2
='#undef HAVE_TV_V4L2'
6660 echocheck
"Radio interface"
6661 if test "$_radio" = yes ; then
6662 _def_radio
='#define USE_RADIO 1'
6663 _inputmodules
="radio $_inputmodules"
6664 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6667 if test "$_radio_capture" = yes ; then
6668 _def_radio_capture
="#define USE_RADIO_CAPTURE 1"
6670 _def_radio_capture
="#undef USE_RADIO_CAPTURE"
6673 _noinputmodules
="radio $_noinputmodules"
6674 _def_radio
='#undef USE_RADIO'
6675 _def_radio_capture
="#undef USE_RADIO_CAPTURE"
6679 echocheck
"Capture for Radio interface"
6680 echores
"$_radio_capture"
6682 echocheck
"Video 4 Linux 2 Radio interface"
6683 if test "$_radio_v4l2" = auto
; then
6685 if test "$_radio" = yes && linux
; then
6688 #include <linux/types.h>
6689 #include <linux/videodev2.h>
6690 int main(void) { return 0; }
6692 cc_check
&& _radio_v4l2
=yes
6695 if test "$_radio_v4l2" = yes ; then
6696 _def_radio_v4l2
='#define HAVE_RADIO_V4L2 1'
6698 _def_radio_v4l2
='#undef HAVE_RADIO_V4L2'
6700 echores
"$_radio_v4l2"
6702 echocheck
"Video 4 Linux Radio interface"
6703 if test "$_radio_v4l" = auto
; then
6705 if test "$_radio" = yes && linux
; then
6708 #include <linux/videodev.h>
6709 int main(void) { return 0; }
6711 cc_check
&& _radio_v4l
=yes
6714 if test "$_radio_v4l" = yes ; then
6715 _def_radio_v4l
='#define HAVE_RADIO_V4L 1'
6717 _def_radio_v4l
='#undef HAVE_RADIO_V4L'
6719 echores
"$_radio_v4l"
6721 if test "$_radio_v4l" = no
&& test "$_radio_v4l2" = no
&& test "$_radio" = yes ; then
6722 die
"Radio driver requires V4L or V4L2!"
6725 echocheck
"Video 4 Linux 2 MPEG PVR interface"
6726 if test "$_pvr" = auto
; then
6728 if test "$_tv_v4l2" = yes && linux
; then
6731 #include <inttypes.h>
6732 #include <linux/types.h>
6733 #include <linux/videodev2.h>
6734 int main(void) { struct v4l2_ext_controls ext; return 0; }
6736 cc_check
&& _pvr
=yes
6739 if test "$_pvr" = yes ; then
6740 _def_pvr
='#define HAVE_PVR 1'
6741 _inputmodules
="pvr $_inputmodules"
6743 _noinputmodules
="pvr $_noinputmodules"
6744 _def_pvr
='#undef HAVE_PVR'
6749 echocheck
"audio select()"
6750 if test "$_select" = no
; then
6751 _def_select
='#undef HAVE_AUDIO_SELECT'
6752 elif test "$_select" = yes ; then
6753 _def_select
='#define HAVE_AUDIO_SELECT 1'
6759 # FIXME network check
6760 if test "$_network" = yes ; then
6761 _def_network
='#define MPLAYER_NETWORK 1'
6762 _ld_network
="$_ld_sock"
6763 _inputmodules
="network $_inputmodules"
6765 _noinputmodules
="network $_noinputmodules"
6766 _def_network
='#undef MPLAYER_NETWORK'
6772 if not beos
&& test "$_ftp" = yes ; then
6773 _def_ftp
='#define HAVE_FTP 1'
6774 _inputmodules
="ftp $_inputmodules"
6776 _noinputmodules
="ftp $_noinputmodules"
6777 _def_ftp
='#undef HAVE_FTP'
6781 echocheck
"vstream client"
6782 if test "$_vstream" = auto
; then
6785 #include <vstream-client.h>
6786 void vstream_error(const char *format, ... ) {}
6787 int main(void) { vstream_start(); return 0; }
6789 cc_check
-lvstream-client && _vstream
=yes
6791 if test "$_vstream" = yes ; then
6792 _def_vstream
='#define HAVE_VSTREAM 1'
6793 _inputmodules
="vstream $_inputmodules"
6794 _ld_vstream
='-lvstream-client'
6796 _noinputmodules
="vstream $_noinputmodules"
6797 _def_vstream
='#undef HAVE_VSTREAM'
6802 echocheck
"byte order"
6803 if test "$_big_endian" = auto
; then
6805 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6806 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6808 return (int)ascii_name;
6812 if strings $TMPO |
grep -l MPlayerBigEndian
>/dev
/null
; then
6818 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
6821 if test "$_big_endian" = yes ; then
6822 _byte_order
='big-endian'
6823 _def_words_endian
='#define WORDS_BIGENDIAN 1'
6825 _byte_order
='little-endian'
6826 _def_words_endian
='#undef WORDS_BIGENDIAN'
6828 echores
"$_byte_order"
6830 echocheck
"OSD menu"
6831 if test "$_menu" = yes ; then
6832 _def_menu
='#define HAVE_MENU 1'
6834 _def_menu
='#undef HAVE_MENU'
6839 echocheck
"QuickTime codecs"
6840 if test "$_qtx" = auto
; then
6841 test "$_win32" = yes || darwin
&& _qtx
=yes
6843 if test "$_qtx" = yes ; then
6844 _def_qtx
='#define USE_QTX_CODECS 1'
6845 _codecmodules
="qtx $_codecmodules"
6847 _def_qtx
='#undef USE_QTX_CODECS'
6848 _nocodecmodules
="qtx $_nocodecmodules"
6853 echocheck
"Subtitles sorting"
6854 if test "$_sortsub" = yes ; then
6855 _def_sortsub
='#define USE_SORTSUB 1'
6857 _def_sortsub
='#undef USE_SORTSUB'
6862 echocheck
"XMMS inputplugin support"
6863 if test "$_xmms" = yes ; then
6865 if ( xmms-config
--version ) >/dev
/null
2>&1 ; then
6866 if test -z "$_xmmsplugindir" ; then
6867 _xmmsplugindir
=`xmms-config --input-plugin-dir`
6869 if test -z "$_xmmslibdir" ; then
6870 _xmmslibdir
=`xmms-config --exec-prefix`/lib
6873 if test -z "$_xmmsplugindir" ; then
6874 _xmmsplugindir
=/usr
/lib
/xmms
/Input
6876 if test -z "$_xmmslibdir" ; then
6877 _xmmslibdir
=/usr
/lib
6881 _def_xmms
='#define HAVE_XMMS 1'
6883 _xmms_lib
="${_xmmslibdir}/libxmms.dylib"
6885 _xmms_lib
="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6888 _def_xmms
='#undef HAVE_XMMS'
6893 if test "$_inet6" = auto
; then
6895 #include <sys/types.h>
6896 #include <sys/socket.h>
6897 #include <netinet/in.h>
6898 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6905 if test "$_inet6" = yes ; then
6906 _def_inet6
='#define HAVE_AF_INET6 1'
6908 _def_inet6
='#undef HAVE_AF_INET6'
6913 echocheck
"gethostbyname2"
6914 if test "$_gethostbyname2" = auto
; then
6916 #include <sys/types.h>
6917 #include <sys/socket.h>
6919 int main(void) { gethostbyname2("", AF_INET); }
6927 if test "$_gethostbyname2" = yes ; then
6928 _def_gethostbyname2
='#define HAVE_GETHOSTBYNAME2 1'
6930 _def_gethostbyname2
='#undef HAVE_GETHOSTBYNAME2'
6932 echores
"$_gethostbyname2"
6935 # --------------- GUI specific tests begin -------------------
6938 if test "$_gui" = yes ; then
6940 # Required libraries
6941 test "$_png" != yes && die
"The GUI requires PNG support, please install libpng and libpng-dev packages."
6943 test "$_x11" != yes && die
"X11 support required for GUI compilation."
6945 echocheck
"XShape extension"
6946 if test "$_xshape" = auto
; then
6949 #include <X11/Xlib.h>
6950 #include <X11/Xproto.h>
6951 #include <X11/Xutil.h>
6952 #include <X11/extensions/shape.h>
6955 char *name = ":0.0";
6958 int eventbase, errorbase;
6959 if (getenv("DISPLAY"))
6960 name=getenv("DISPLAY");
6961 wsDisplay=XOpenDisplay(name);
6962 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6964 XCloseDisplay(wsDisplay);
6968 cc_check
$_ld_x11 && _xshape
=yes
6970 if test "$_xshape" = yes ; then
6971 _def_xshape
='#define HAVE_XSHAPE 1'
6973 die
"The GUI requires the X11 extension XShape (which was not found)."
6978 if test "$_gtk1" = no
; then
6980 echocheck
"GTK+ version"
6982 if $_pkg_config gtk
+-2.0
--exists ; then
6983 _gtk
=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
6984 _inc_extra
="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
6985 _ld_gtk
=`$_pkg_config gtk+-2.0 --libs 2>/dev/null`
6989 if $_pkg_config glib-2.0
--exists ; then
6990 echocheck
"glib version"
6991 _glib
=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
6992 _ld_glib
=`$_pkg_config glib-2.0 --libs 2>/dev/null`
6995 _def_gui
='#define HAVE_NEW_GUI 1'
6996 _def_gtk2_gui
='#define HAVE_GTK2_GUI 1'
6999 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7002 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7007 if test "$_gtk1" = yes ; then
7008 # Check for old GTK (1.2.x)
7009 echocheck
"GTK version"
7010 if test -z "$_gtkconfig" ; then
7011 if ( gtk-config
--version ) >/dev
/null
2>&1 ; then
7012 _gtkconfig
="gtk-config"
7013 elif ( gtk12-config
--version ) >/dev
/null
2>&1 ; then
7014 _gtkconfig
="gtk12-config"
7016 die
"The GUI requires GTK devel packages (which were not found)."
7019 _gtk
=`$_gtkconfig --version 2>&1`
7020 _inc_extra
="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7021 _ld_gtk
=`$_gtkconfig --libs 2>&1`
7022 echores
"$_gtk (using $_gtkconfig)"
7025 echocheck
"glib version"
7026 if test -z "$_glibconfig" ; then
7027 if ( glib-config
--version ) >/dev
/null
2>&1 ; then
7028 _glibconfig
="glib-config"
7029 elif ( glib12-config
--version ) >/dev
/null
2>&1 ; then
7030 _glibconfig
="glib12-config"
7032 die
"The GUI requires GLIB devel packages (which were not found)"
7035 _glib
=`$_glibconfig --version 2>&1`
7036 _ld_glib
=`$_glibconfig --libs 2>&1`
7037 echores
"$_glib (using $_glibconfig)"
7039 _def_gui
='#define HAVE_NEW_GUI 1'
7040 _def_gtk2_gui
='#undef HAVE_GTK2_GUI'
7044 _ld_win32libs
="-lcomdlg32 -lcomctl32 -lshell32 -lkernel32 $_ld_win32libs"
7045 _def_gui
='#define HAVE_NEW_GUI 1'
7046 _def_gtk2_gui
='#undef HAVE_GTK2_GUI'
7049 else #if test "$_gui"
7050 _def_gui
='#undef HAVE_NEW_GUI'
7051 _def_gtk2_gui
='#undef HAVE_GTK2_GUI'
7053 # --------------- GUI specific tests end -------------------
7056 if test "$_charset" = "noconv" ; then
7059 if test "$_charset" ; then
7060 _def_charset
="#define MSG_CHARSET \"$_charset\""
7062 _def_charset
="#undef MSG_CHARSET"
7065 if test "$_charset" = "UTF-8" ; then
7066 # hack to disable conversion in the Makefile
7070 if test "$_charset" ; then
7071 echocheck
"iconv program"
7072 iconv -f UTF-8
-t $_charset ${_mp_help} > /dev
/null
2>> "$TMPLOG"
7073 if test "$?" -ne 0 ; then
7075 echo "No working iconv program found, use "
7076 echo "--charset=UTF-8 to continue anyway."
7077 echo "If you also have problems with iconv library functions use --charset=noconv."
7078 echo "Messages in the GTK-2 interface will be broken then."
7085 #############################################################################
7087 echocheck
"automatic gdb attach"
7088 if test "$_crash_debug" = yes ; then
7089 _def_crash_debug
='#define CRASH_DEBUG 1'
7091 _def_crash_debug
='#undef CRASH_DEBUG'
7094 echores
"$_crash_debug"
7097 CFLAGS
="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN -shared-libgcc"
7099 CFLAGS
="$CFLAGS -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
7101 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7102 CFLAGS
="$CFLAGS -no-cpp-precomp"
7105 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
7106 test "$_altivec" = yes && CFLAGS
="$CFLAGS -DCONFIG_DARWIN"
7109 # use flag for HPUX missing setenv()
7110 CFLAGS
="$CFLAGS -DHPUX"
7114 CFLAGS
="$CFLAGS -D_REENTRANT"
7116 # FIXME bsd needs this so maybe other OS'es
7117 CFLAGS
="$CFLAGS -D_THREAD_SAFE"
7119 # 64 bit file offsets?
7120 if test "$_largefiles" = yes || freebsd
; then
7121 CFLAGS
="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7122 if test "$_dvdread" = yes ; then
7123 # dvdread support requires this (for off64_t)
7124 CFLAGS
="$CFLAGS -D_LARGEFILE64_SOURCE"
7128 echocheck
"compiler support for noexecstack"
7130 int main(void) { return 0; }
7132 if cc_check
-Wl,-z,noexecstack
; then
7133 _ld_extra
="-Wl,-z,noexecstack $_ld_extra"
7139 if cc_check
-Wdeclaration-after-statement ; then
7140 CFLAGS
="-Wdeclaration-after-statement $CFLAGS"
7143 echocheck
"ftello()"
7144 # if we don't have ftello use the osdep/ compatibility module
7147 #include <sys/types.h>
7148 int main (void) { ftello(stdin); return 0; }
7151 cc_check
&& _ftello
=yes
7152 if test "$_ftello" = yes ; then
7153 _def_ftello
='#define HAVE_FTELLO 1'
7155 _def_ftello
='#undef HAVE_FTELLO'
7159 # Determine OS dependent libs
7161 _def_confwin32
='#define WIN32'
7162 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
7163 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
7164 CFLAGS
="$CFLAGS -D__CYGWIN__"
7168 _confwin32
='TARGET_WIN32 = yes'
7170 _confwin32
='TARGET_WIN32 = no'
7173 # Dynamic linking flags
7174 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7176 bsd
&& _ld_dl_dynamic
='-rdynamic'
7177 if test "$_real" = yes ||
test "$_xanim" = yes && not win32
&& not qnx
&& not darwin
; then
7178 _ld_dl_dynamic
='-rdynamic'
7181 _ld_arch
="$_ld_arch $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7182 bsdos
&& _ld_arch
="$_ld_arch -ldvd"
7184 x86
&& _ld_arch
="$_ld_arch -li386"
7187 _def_debug
='#undef MP_DEBUG'
7188 test "$_debug" != "" && _def_debug
='#define MP_DEBUG 1'
7190 _def_linux
='#undef TARGET_LINUX'
7191 linux
&& _def_linux
='#define TARGET_LINUX 1'
7193 # TODO cleanup the VIDIX stuff here
7194 echocheck
"VIDIX (internal)"
7195 echores
"$_vidix_internal"
7197 echocheck
"VIDIX (external)"
7198 if test "$_vidix_external" = auto
; then
7201 #include <vidix/vidix.h>
7202 int main(void) { return 0; }
7204 cc_check
-lvidix && _vidix_external
=yes
7206 echores
"$_vidix_external"
7208 if test "$_vidix_internal" = yes ||
test "$_vidix_external" = yes ; then
7210 _def_vidix
='#define CONFIG_VIDIX 1'
7213 _def_vidix
='#undef CONFIG_VIDIX'
7216 if test "$_vidix_internal" = yes ; then
7217 _def_vidix_pfx
="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
7218 elif test "$_vidix_external" = yes ; then
7219 _ld_vidix_external
="-lvidix"
7220 _def_vidix_pfx
='#define MP_VIDIX_PFX "" '
7223 if test "$_vidix" = yes; then
7224 _vosrc
="$_vosrc vo_cvidix.c"
7225 _vomodules
="cvidix $_vomodules"
7227 _novomodules
="cvidix $_novomodules"
7229 if test "$_vidix" = yes && win32
; then
7230 _vosrc
="$_vosrc vo_winvidix.c"
7231 _vomodules
="winvidix $_vomodules"
7232 _ld_win32libs
="-lgdi32 $_ld_win32libs"
7234 _novomodules
="winvidix $_novomodules"
7236 if test "$_vidix" = yes && test "$_x11" = yes; then
7237 _vosrc
="$_vosrc vo_xvidix.c"
7238 _vomodules
="xvidix $_vomodules"
7240 _novomodules
="xvidix $_novomodules"
7243 echocheck
"joystick"
7244 _def_joystick
='#undef HAVE_JOYSTICK'
7245 if test "$_joystick" = yes ; then
7247 # TODO add some check
7248 _def_joystick
='#define HAVE_JOYSTICK 1'
7250 _joystick
="no (unsupported under $system_name)"
7253 echores
"$_joystick"
7256 if test "$_lirc" = auto
; then
7259 #include <lirc/lirc_client.h>
7260 int main(void) { return 0; }
7262 cc_check
-llirc_client && _lirc
=yes
7264 if test "$_lirc" = yes ; then
7265 _def_lirc
='#define HAVE_LIRC 1'
7266 _ld_lirc
='-llirc_client'
7268 _def_lirc
='#undef HAVE_LIRC'
7273 if test "$_lircc" = auto
; then
7276 #include <lirc/lircc.h>
7277 int main(void) { return 0; }
7279 cc_check
-llircc && _lircc
=yes
7281 if test "$_lircc" = yes ; then
7282 _def_lircc
='#define HAVE_LIRCC 1'
7285 _def_lircc
='#undef HAVE_LIRCC'
7290 # Detect maemo development platform libraries availability (http://www.maemo.org),
7291 # they are used when run on Nokia 770
7292 echocheck
"maemo (Nokia 770)"
7293 if test "$_maemo" = auto
; then
7296 #include <libosso.h>
7297 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7299 cc_check
`$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo
=yes
7301 if test "$_maemo" = yes ; then
7302 _def_maemo
='#define HAVE_MAEMO 1'
7303 _inc_extra
="$_inc_extra `$_pkg_config --cflags libosso`"
7304 _ld_extra
="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7306 _def_maemo
='#undef HAVE_MAEMO'
7311 echocheck
"color console output"
7312 if test "$_color_console" = yes ; then
7313 _def_color_console
='#define MSG_USE_COLORS 1'
7315 _def_color_console
='#undef MSG_USE_COLORS'
7317 echores
"$_color_console"
7319 #############################################################################
7320 echo "Creating config.mak"
7321 cat > config.mak
<< EOF
7322 # -------- Generated by configure -----------
7325 MAN_LANG = $MAN_LANG
7326 TARGET_OS = $system_name
7328 prefix = \$(DESTDIR)$_prefix
7329 BINDIR = \$(DESTDIR)$_bindir
7330 DATADIR = \$(DESTDIR)$_datadir
7331 MANDIR = \$(DESTDIR)$_mandir
7332 CONFDIR = \$(DESTDIR)$_confdir
7333 LIBDIR = \$(DESTDIR)$_libdir
7334 # FFmpeg uses libdir instead of LIBDIR
7342 # FIXME: Should only be _inc_extra eventually.
7343 EXTRA_INC = $_inc_extra
7344 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7345 STRIPBINARIES = $_stripbinaries
7347 HELP_FILE = $_mp_help
7351 MPLAYER_NETWORK = $_network
7353 STREAMING_LIVE555 = $_live
7357 VIDIX = $_vidix_internal
7358 EXTERNAL_VIDIX = $_vidix_external
7360 CONFIG_MP3LAME = $_mp3lame
7365 LIBMPEG2 = $_libmpeg2
7366 TREMOR_INTERNAL = $_tremor_internal
7367 TREMOR_FLAGS = $_tremor_flags
7371 MUSEPACK = $_musepack
7373 UNRARLIB = $_unrarlib
7378 EXTRALIBS = $_extra_libs
7379 EXTRA_LIB = $_ld_extra $_ld_live $_ld_vstream $_ld_network $_ld_enca \
7380 $_ld_static $_ld_zlib $_ld_termcap $_ld_lirc $_ld_lircc $_ld_win32 \
7381 $_ld_win32libs $_ld_lm $_ld_libC $_ld_fribidi $_ld_smb $_ld_gif \
7382 $_ld_libcdio $_ld_dvdread $_ld_dvdnav $_macosx_frameworks $_ld_cdparanoia \
7383 $_ld_xvid $_ld_x264 $_ld_mp3lame $_ld_libdts $_ld_mad \
7384 $_ld_vorbis $_ld_libdv $_ld_theora $_ld_faad $_ld_speex $_xmms_lib \
7385 $_toolame_lib $_twolame_lib $_ld_faac $_ld_musepack $_ld_liblzo $_ld_png \
7386 $_ld_jpeg $_ld_alsa $_ld_nut $_ld_arch $_ld_iconv $_ld_mlib
7387 VO_LIBS = $_ld_aa $_ld_sdl $_ld_ggi $_ld_svga $_ld_directfb $_ld_caca \
7388 $_ld_vesa $_ld_vidix_external $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm \
7389 $_ld_xinerama $_ld_x11 $_ld_sock
7390 AO_LIBS = $_ld_arts $_ld_esd $_ld_jack $_ld_openal $_ld_nas $_ld_sgiaudio \
7392 ENCORE_LIB = $_ld_mp3lame
7393 LAVC_MP3LAME = $_lavc_mp3lame
7394 FREETYPE_LIB = $_ld_freetype
7395 FONTCONFIG_LIB = $_ld_fontconfig
7396 GTK_LIBS = $_ld_static $_ld_gtk $_ld_glib
7399 HAVE_PTHREADS = $_pthreads
7401 HAVE_XVMC_ACCEL = $_xvmc
7408 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7417 # input/demuxer/codecs
7418 JOYSTICK = $_joystick
7424 TV_BSDBT848 = $_tv_bsdbt848
7428 DVDREAD_INTERNAL = $_dvdread_internal
7431 W32_DEP = $_dep_win32
7433 REAL_CODECS = $_real
7434 XANIM_CODECS = $_xanim
7435 AV_DEP = $_dep_libavformat $_dep_libavcodec $_dep_libavutil $_dep_libpostproc
7436 AV_LIB = $_ld_libavformat $_ld_libavcodec $_ld_libavutil $_ld_libpostproc
7437 CONFIG_LIBAVUTIL = $_libavutil
7438 CONFIG_LIBAVUTIL_SO = $_libavutil_so
7439 CONFIG_LIBAVCODEC = $_libavcodec
7440 CONFIG_LIBAVCODEC_SO = $_libavcodec_so
7441 CONFIG_LIBAVFORMAT = $_libavformat
7442 CONFIG_LIBAVFORMAT_SO = $_libavformat_so
7443 CONFIG_LIBPOSTPROC = $_libpostproc
7444 CONFIG_LIBPOSTPROC_SO = $_libpostproc_so
7451 CONFIG_DTS = $_libdts
7452 MENCODER = $_mencoder
7454 BITMAP_FONT = $_bitmap_font
7455 FREETYPE = $_freetype
7458 LIBVORBIS = $_vorbis
7459 LIBTHEORA = $_theora
7460 FAAD_INTERNAL = $_faad_internal
7461 FAAD_FIXED = $_faad_fixed
7462 LIBSMBCLIENT = $_smbsupport
7463 XMMS_PLUGINS = $_xmms
7465 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7466 MACOSX_BUNDLE = $_macosx_bundle
7467 MACOSX_COREVIDEO = $_macosx_corevideo
7472 CONFIG_AMR_NB=$_amr_nb
7473 CONFIG_AMR_NB_FIXED=$_amr_nb_fixed
7474 CONFIG_AMR_WB=$_amr_wb
7475 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7476 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7477 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7478 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7479 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7481 CONFIG_XVID=$_lavc_xvid
7484 CONFIG_ENCODERS=$_mencoder
7485 CONFIG_MUXERS=$_mencoder
7487 RADIO_CAPTURE=$_radio_capture
7489 # --- Some stuff for autoconfigure ----
7495 TARGET_MMX2 = $_mmxext
7496 TARGET_3DNOW = $_3dnow
7497 TARGET_3DNOWEX = $_3dnowext
7499 TARGET_CMOV = $_cmov
7500 TARGET_ALTIVEC = $_altivec
7501 TARGET_ARMV5TE = $_armv5te
7502 TARGET_IWMMXT = $_iwmmxt
7504 TARGET_BUILTIN_VECTOR = $_builtin_vector
7505 TARGET_BUILTIN_3DNOW = $_mm3dnow
7510 # --- libvo stuff ---
7513 # --- libao2 stuff ---
7516 # --- libaf stuff ---
7521 #############################################################################
7522 echo "Creating config.h"
7523 cat > config.h
<< EOF
7524 /* -------- This file has been automatically generated by configure ---------
7525 Note: Any changes in it will be lost when you run configure again. */
7527 /* Protect against multiple inclusion */
7528 #ifndef MPLAYER_CONFIG_H
7529 #define MPLAYER_CONFIG_H 1
7531 /* use GNU internationalization */
7534 /* name of messages charset */
7537 /* Runtime CPU detection */
7538 $_def_runtime_cpudetection
7540 /* Dynamic a/v plugins */
7541 $_def_dynamic_plugins
7543 /* "restrict" keyword */
7544 $_def_restrict_keyword
7546 /* __builtin_expect branch prediction hint */
7547 $_def_builtin_expect
7548 #ifdef HAVE_BUILTIN_EXPECT
7549 #define likely(x) __builtin_expect ((x) != 0, 1)
7550 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7552 #define likely(x) (x)
7553 #define unlikely(x) (x)
7556 /* attribute(used) as needed by some compilers */
7557 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7558 # define attribute_used __attribute__((used))
7560 # define attribute_used
7563 /* compiler support for named assembler arguments */
7564 $_def_named_asm_args
7566 #define PREFIX "$_prefix"
7571 /* enable/disable SIGHANDLER */
7574 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7577 /* Toggles debugging informations */
7580 /* Toggles color console output */
7583 /* Indicates that libcdio is available for VCD and CD-DA playback */
7586 /* Indicates that Ogle's libdvdread is available for DVD playback */
7589 /* Indicates that dvdread is internal */
7590 $_def_dvdread_internal
7592 /* Additional options for libdvdread/libdvdcss */
7606 /* Common data directory (for fonts, etc) */
7607 #define MPLAYER_DATADIR "$_datadir"
7608 #define MPLAYER_CONFDIR "$_confdir"
7609 #define MPLAYER_LIBDIR "$_libdir"
7611 /* Define this to compile stream-caching support, it can be enabled via
7612 -cache <kilobytes> */
7613 #define USE_STREAM_CACHE 1
7615 /* Define if you are using XviD library */
7619 /* Define if you are using the X.264 library */
7622 /* Define if you are using libnut */
7625 /* Define to include support for libdv-0.9.5 */
7628 /* If build mencoder */
7631 /* Indicates if libmp3lame is available
7632 Note: for mencoder */
7634 $_def_mp3lame_preset
7635 $_def_mp3lame_preset_medium
7637 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7638 (use -bps or -nobps commandline option for run-time method selection)
7639 -bps gives better sync for vbr mp3 audio, it is now default */
7640 #define AVI_SYNC_BPS 1
7642 /* Undefine this if you do not want to select mono audio (left or right)
7643 with a stereo MPEG layer 2/3 audio stream. The command line option
7644 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7645 right-only), with 0 being the default.
7647 #define USE_FAKE_MONO 1
7649 /* Undefine this if your sound card driver has no working select().
7650 If you have kernel Oops, player hangups, or just no audio, you should
7651 try to recompile MPlayer with this option disabled! */
7654 /* define this to use iconv(3) function to codepage conversions */
7657 /* define this to use nl_langinfo function */
7660 /* define this to use RTC (/dev/rtc) for video timers */
7663 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7664 #define MAX_OUTBURST 65536
7666 /* set up audio OUTBURST. Do not change this! */
7667 #define OUTBURST 512
7669 /* Define this if your system has the header file for the OSS sound interface */
7672 /* Define this if your system has the header file for the OSS sound interface
7673 * in /usr/include */
7676 /* Define this if your system has the sysinfo header */
7679 /* Define this if your system has ftello() */
7683 /* Need these for FILE and off_t an config.h is usually before other includes*/
7685 #include <sys/types.h>
7686 off_t ftello(FILE *);
7689 /* Define this if your system has the "malloc.h" header file */
7692 /* memalign is mapped to malloc if unsupported */
7697 /* assembler handling of .align */
7700 /* Define this if your system has the "alloca.h" header file */
7703 /* Define this if your system has the "sys/mman.h" header file */
7705 $_def_mman_has_map_failed
7707 /* Define this if you have the elf dynamic linker -ldl library */
7710 /* Define this if you have the kstat kernel statistics library */
7713 /* Define this if you have zlib */
7716 #define CONFIG_ZLIB 1
7719 /* Define this if you have shm support */
7722 /* Define this if your system has scandir & alphasort */
7725 /* Define this if your system has strsep */
7728 /* Define this if your system has strlcpy */
7730 #ifndef HAVE_STRLCPY
7731 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7734 /* Define this if your system has strlcat */
7736 #ifndef HAVE_STRLCAT
7737 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7740 /* Define this if your system has fseeko */
7743 /* Need these for FILE and off_t an config.h is usually before other includes*/
7745 #include <sys/types.h>
7746 int fseeko(FILE *, off_t, int);
7751 /* Define this if your system has vsscanf */
7754 /* Define this if your system has swab */
7757 /* Define this if your system has no posix select */
7758 $_def_no_posix_select
7760 /* Define this if your system has gettimeofday */
7763 /* Define this if your system has glob */
7766 /* Define this if your system has setenv */
7769 int setenv(const char *name, const char *val, int overwrite);
7772 /* Define this if your system has sysi86 */
7775 /* Define this if your system has pthreads */
7778 /* Define this if you enabled thread support for libavcodec */
7781 /* LIRC (remote control, see www.lirc.org) support: */
7784 /* Support for maemo (http://www.maemo.org) */
7788 * LIRCCD (LIRC client daemon)
7789 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7793 /* DVD navigation support using libdvdnav */
7795 $_def_dvdnav_version
7797 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7798 #define MPEG12_POSTPROC 1
7800 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7802 $_def_libpostproc_so
7804 /* Win32 DLL support */
7806 #define WIN32_PATH "$_win32codecsdir"
7808 /* Mac OS X specific features */
7810 $_def_macosx_finder_support
7812 $_def_macosx_corevideo
7814 /* Build our Win32-loader */
7817 /* ffmpeg's libavcodec support (requires libavcodec source) */
7821 $_def_libavcodec_mpegaudio_hp
7823 /* ffmpeg's libavformat support (requires libavformat source) */
7825 $_def_libavformat_so
7826 $_def_libavformat_win32
7831 /* Use libavcodec's decoders */
7832 #define CONFIG_DECODERS 1
7833 /* Use libavcodec's encoders */
7834 #define CONFIG_ENCODERS 1
7836 /* Use libavformat's demuxers */
7837 #define CONFIG_DEMUXERS 1
7838 /* Use libavformat's muxers */
7841 #define CONFIG_GPL 1
7843 /* Use amr codecs from libavcodec (requires amr sources) */
7849 /* Use specific parts from FFmpeg. */
7850 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7851 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7852 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7853 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7854 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7860 /* Use codec libs included in mplayer CVS / source dist: */
7866 /* XAnim DLL support */
7868 /* Default search path */
7871 /* RealPlayer DLL support */
7873 /* Default search path */
7876 /* LIVE555 Streaming Media library support */
7879 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
7882 /* Use unrarlib for Vobsubs */
7885 /* gui support, please do not edit this option */
7889 /* Audio output drivers */
7891 $_def_ossaudio_devdsp
7892 $_def_ossaudio_devmixer
7902 $_def_sys_asoundlib_h
7903 $_def_alsa_asoundlib_h
7909 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7911 #undef FAST_OSD_TABLE
7913 /* Enable TV Interface support */
7916 /* Enable Video 4 Linux TV interface support */
7919 /* Enable Video 4 Linux 1 TV interface support */
7922 /* Enable Video 4 Linux 2 TV interface support */
7925 /* Enable *BSD BrookTree TV interface support */
7928 /* Enable Radio Interface support */
7931 /* Enable Capture for Radio Interface support */
7934 /* Enable Video 4 Linux Radio interface support */
7937 /* Enable Video 4 Linux 2 Radio interface support */
7940 /* Enable Video 4 Linux 2 MPEG PVR support */
7943 /* Define if your processor stores words with the most significant
7944 byte first (like Motorola and SPARC, unlike Intel and VAX). */
7950 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
7951 have the instruction. */
7954 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
7955 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
7961 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
7966 /* only gcc3 can compile mvi instructions */
7967 $_def_gcc_mvi_support
7969 /* Define this for Cygwin build for win32 */
7972 /* Define this to any prefered value from 386 up to infinity with step 100 */
7973 #define __CPU__ $iproc
7982 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
7983 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7985 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7986 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7987 #elif defined(WIN32)
7988 #define DEFAULT_CDROM_DEVICE "D:"
7989 #define DEFAULT_DVD_DEVICE "D:"
7990 #elif defined(SYS_DARWIN)
7991 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
7992 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
7993 #elif defined(__OpenBSD__)
7994 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
7995 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7996 #elif defined(__FreeBSD__)
7997 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
7998 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8000 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8001 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8005 /*----------------------------------------------------------------------------
8007 ** NOTE: Instead of modifying these definitions here, use the
8008 ** --enable/--disable options of the ./configure script!
8009 ** See ./configure --help for details.
8011 *---------------------------------------------------------------------------*/
8013 /* C99 lrintf function available */
8016 /* round function is available */
8019 /* yes, we have inttypes.h */
8020 #define HAVE_INTTYPES_H 1
8022 /* int_fastXY_t emulation */
8025 /* nanosleep support */
8031 /* termcap flag for getch2.c */
8034 /* termios flag for getch2.c */
8039 /* enable PNG support */
8042 /* enable JPEG support */
8045 /* enable PNM support */
8048 /* enable md5sum support */
8051 /* enable GIF support */
8056 /* enable bitmap font support */
8059 /* enable FreeType support */
8062 /* enable Fontconfig support */
8065 /* enable SSA/ASS support */
8068 /* enable FriBiDi usage */
8071 /* enable ENCA usage */
8074 /* liblzo support */
8077 #define CONFIG_LZO 1
8080 /* libmad support */
8083 /* enable OggVorbis support */
8087 /* enable Speex support */
8090 /* enable musepack support */
8093 /* enable OggTheora support */
8096 /* enable FAAD (AAC) support */
8100 /* enable FAAC (AAC encoder) support */
8103 /* enable LADSPA plugin support */
8106 /* enable network */
8109 /* enable ftp support */
8112 /* enable vstream support */
8115 /* enable winsock2 instead of Unix functions*/
8118 /* define this to use inet_aton() instead of inet_pton() */
8121 /* enables / disables cdparanoia support */
8124 /* enables / disables VIDIX usage */
8128 /* enables / disables new input joystick support */
8131 /* enables / disables QTX codecs */
8134 /* enables / disables osd menu */
8137 /* enables / disables subtitles sorting */
8140 /* XMMS input plugin support */
8142 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8144 /* enables inet6 support */
8147 /* do we have gethostbyname2? */
8148 $_def_gethostbyname2
8150 /* Extension defines */
8151 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
8152 $_def_3dnowext // only define if you have 3DNOWEXT (AMD Athlon, etc.)
8153 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
8154 $_def_mmxext // only define if you have MMX2 (Athlon/PIII/4/CelII)
8155 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
8156 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
8157 $_def_cmov // only define if you have CMOV (i686+, without VIA C3)
8158 $_def_altivec // only define if you have Altivec (G4)
8159 $_def_armv5te // only define if you have Enhanced DSP Extensions (ARM)
8160 $_def_iwmmxt // only define if you have XScale IWMMX (ARM)
8162 $_def_altivec_h // enables usage of altivec.h
8164 $_def_mlib // Sun mediaLib, available only on solaris
8165 $_def_vis // only define if you have VIS ( ultrasparc )
8167 /* libmpeg2 uses a different feature test macro for mediaLib */
8169 #define LIBMPEG2_MLIB 1
8173 #define SCREEN_SIZE_X 1
8174 #define SCREEN_SIZE_Y 1
8186 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8196 $_def_directfb_version
8221 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8222 #define X11_FULLSCREEN 1
8225 #endif /* MPLAYER_CONFIG_H */
8228 #############################################################################
8232 Config files successfully generated by ./configure !
8234 Install prefix: $_prefix
8235 Data directory: $_datadir
8236 Config direct.: $_confdir
8238 Byte order: $_byte_order
8239 Optimizing for: $_optimizing
8242 Messages/GUI: $_language
8245 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8246 test "$LANGUAGES" = en
&& echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8251 Enabled optional drivers:
8252 Input: $_inputmodules
8253 Codecs: $_codecmodules
8254 Audio output: $_aomodules
8255 Video output: $_vomodules
8256 Audio filters: $_afmodules
8257 Disabled optional drivers:
8258 Input: $_noinputmodules
8259 Codecs: $_nocodecmodules
8260 Audio output: $_noaomodules
8261 Video output: $_novomodules
8262 Audio filters: $_noafmodules
8264 'config.h' and 'config.mak' contain your configuration options.
8265 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8266 compile *** DO NOT REPORT BUGS if you tweak these files ***
8268 'make' will now compile MPlayer and 'make install' will install it.
8269 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8274 if test "$_mtrr" = yes ; then
8275 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8280 if test "$_win32" = no
; then
8281 if test "$_win32codecsdir" ; then
8282 echo "Failed to find a Win32 codecs directory at $_win32codecsdir!"
8284 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
8287 Create it and copy the DLL files there! You can download the codecs from our
8288 homepage at http://www.mplayerhq.hu/MPlayer/releases/codecs/
8294 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8295 operating system ($system_name). You may encounter a few files that cannot
8296 be played due to missing open source video/audio codec support.
8303 Check $TMPLOG if you wonder why an autodetection failed (make sure
8304 development headers/packages are installed).
8306 NOTE: The --enable-* parameters unconditionally force options on, completely
8307 skipping autodetection. This behavior is unlike what you may be used to from
8308 autoconf-based configure scripts that can decide to override you. This greater
8309 level of control comes at a price. You may have to provide the correct compiler
8310 and linker flags yourself.
8311 If you used one of these options (except --enable-gui and similar ones that
8312 turn on internal features) and experience a compilation or linking failure,
8313 make sure you have passed the necessary compiler/linker flags to configure.
8315 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8319 if test "$_warn_CFLAGS" = yes; then
8322 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8324 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8326 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8327 To do so, execute 'CFLAGS= ./configure <options>'
8333 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"