3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: Check the Subversion 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, look at the existing checks
23 # and try to use helper functions where you can.
25 # Furthermore you need to add the variable _feature to the list of default
26 # settings and set it to one of yes/no/auto. Also add appropriate
27 # --enable-feature/--disable-feature command line options.
28 # The results of the check should be written to config.h and config.mak
29 # at the end of this script. The variable names used for this should be
30 # uniform, i.e. if the option is named 'feature':
32 # _feature : should have a value of yes/no/auto
33 # def_feature : '#define ... 1' or '#undef ...' for conditional compilation
34 # _ld_feature : '-L/path/dir -lfeature' GCC options
36 #############################################################################
38 # Prevent locale nonsense from breaking basic text processing utils
41 # Store the configure line that was used
44 # Prefer these macros to full length text !
45 # These macros only return an error code - NO display is done
50 cat "$source" >> "$TMPLOG"
52 echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
54 $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
62 compile_check
$TMPC $@
67 int main(void) { return 0; }
69 compile_check
$TMPC $@
75 int main(void) { return 0; }
78 compile_check
$TMPC $@
84 int main(void) { return $2; }
87 compile_check
$TMPC $@
93 int main(void) { $2; return 0; }
97 compile_check
$TMPC $@
100 define_statement_check
() {
104 int main(void) { $3; return 0; }
107 compile_check
$TMPC $@
110 return_statement_check
() {
113 int main(void) { $2; return $3; }
116 compile_check
$TMPC $@
121 int main(void) { __asm__ volatile ($1); return 0; }
124 compile_check
$TMPC $@
127 # The following checks are special and should only be used with broken and
128 # non-selfsufficient headers that do not include all of their dependencies.
130 header_check_broken
() {
134 int main(void) { return 0; }
138 compile_check
$TMPC $@
141 statement_check_broken
() {
145 int main(void) { $3; return 0; }
148 compile_check
$TMPC $@
152 unset IFS
# shell should not be used for programming
154 echo "$_pkg_config --cflags $@" >> "$TMPLOG"
155 ctmp
=$
($_pkg_config --cflags "$@" 2>> "$TMPLOG") ||
return $?
157 echo "$_pkg_config --libs $@" >> "$TMPLOG"
158 ltmp
=$
($_pkg_config --libs "$@" 2>> "$TMPLOG") ||
return $?
160 echo "cflags: $ctmp" >> "$TMPLOG"
161 echo "libs: $ltmp" >> "$TMPLOG"
163 extra_cflags
="$extra_cflags $ctmp"
164 extra_ldflags
="$extra_ldflags $ltmp"
168 "$TMPEXE" >> "$TMPLOG" 2>&1
171 # Display error message, flushes tempfile, exit
176 rm -f "$TMPEXE" "$TMPC" "$TMPS"
177 echo "Check \"$TMPLOG\" if you do not understand why it failed."
181 # OS test booleans functions
183 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
185 aix
() { issystem
"AIX"; }
186 amigaos
() { issystem
"AmigaOS"; }
187 beos
() { issystem
"BEOS"; }
188 bsdos
() { issystem
"BSD/OS"; }
189 cygwin
() { issystem
"CYGWIN"; }
190 darwin
() { issystem
"Darwin"; }
191 dragonfly
() { issystem
"DragonFly"; }
192 freebsd
() { issystem
"FreeBSD" || issystem
"GNU/kFreeBSD"; }
193 gnu
() { issystem
"GNU"; }
194 hpux
() { issystem
"HP-UX"; }
195 linux
() { issystem
"Linux"; }
196 mingw32
() { issystem
"MINGW32"; }
197 morphos
() { issystem
"MorphOS"; }
198 netbsd
() { issystem
"NetBSD"; }
199 openbsd
() { issystem
"OpenBSD"; }
200 qnx
() { issystem
"QNX"; }
201 win32
() { cygwin || mingw32
; }
203 # arch test boolean functions
204 # x86/x86pc is used by QNX
207 i
[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium
*|athlon
*|i586-i686
) return 0 ;;
214 x86_64|amd64
) return 0 ;;
225 ppc|ppc64|powerpc|powerpc64
) return 0;;
244 # Use this before starting a check
246 echo "============ Checking for $@ ============" >> "$TMPLOG"
247 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
250 # Use this to echo the results of a check
252 if test "$res_comment" ; then
253 res_comment
="($res_comment)"
255 echo "Result is: $@ $res_comment" >> "$TMPLOG"
256 echo "##########################################" >> "$TMPLOG"
258 echo "$@ $res_comment"
261 #############################################################################
263 # Check how echo works in this /bin/sh
265 -n) _echo_n
= _echo_c
='\c' ;; # SysV echo
266 *) _echo_n
='-n ' _echo_c
= ;; # BSD echo
270 ls po
/*.po
>/dev
/null
2>&1 && msg_lang_all
=$
(echo po
/*.po |
sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
271 man_lang_all
=$
(echo DOCS
/man
/*/mplayer.rst |
sed -e "s:DOCS/man/\(..\)/mplayer.rst:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.rst:\1:g")
272 doc_lang_all
=$
(echo DOCS
/xml
/??
/ DOCS
/xml
/??_??
/ |
sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
276 Usage: $0 [OPTIONS]...
279 -h, --help display this help and exit
281 Installation directories:
282 --prefix=DIR prefix directory for installation [/usr/local]
283 --bindir=DIR directory for installing binaries [PREFIX/bin]
284 --mandir=DIR directory for installing man pages [PREFIX/share/man]
285 --confdir=DIR directory for installing configuration files
287 --localedir=DIR directory for locale tree [PREFIX/share/locale]
288 --libdir=DIR directory for object code libraries [PREFIX/lib]
289 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
292 --disable-mplayer disable MPlayer compilation [enable]
293 --enable-termcap use termcap database for key codes [autodetect]
294 --enable-termios use termios database for key codes [autodetect]
295 --disable-iconv disable iconv for encoding conversion [autodetect]
296 --disable-langinfo do not use langinfo [autodetect]
297 --enable-lirc enable LIRC (remote control) support [autodetect]
298 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
299 --enable-joystick enable joystick support [disable]
300 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
301 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
302 --disable-vm disable X video mode extensions [autodetect]
303 --disable-xf86keysym disable support for multimedia keys [autodetect]
304 --enable-radio enable radio interface [disable]
305 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
306 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
307 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
308 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
309 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
310 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
311 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
312 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
313 --disable-networking disable networking [enable]
314 --enable-winsock2_h enable winsock2_h [autodetect]
315 --enable-smb enable Samba (SMB) input [autodetect]
316 --enable-libquvi enable libquvi [autodetect]
317 --enable-lcms2 enable LCMS2 support [autodetect]
318 --disable-vcd disable VCD support [autodetect]
319 --disable-bluray disable Blu-ray support [autodetect]
320 --disable-dvdnav disable libdvdnav [autodetect]
321 --disable-dvdread disable libdvdread [autodetect]
322 --disable-dvdread-internal disable internal libdvdread [autodetect]
323 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
324 --disable-cddb disable cddb [autodetect]
325 --disable-unrarexec disable using of UnRAR executable [enabled]
326 --disable-enca disable ENCA charset oracle library [autodetect]
327 --enable-macosx-finder enable Mac OS X Finder invocation parameter
329 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
330 --disable-inet6 disable IPv6 support [autodetect]
331 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
332 --disable-ftp disable FTP support [enabled]
333 --disable-vstream disable TiVo vstream client support [autodetect]
334 --disable-pthreads disable Posix threads support [autodetect]
335 --disable-w32threads disable Win32 threads support [autodetect]
336 --disable-libass disable subtitle rendering with libass [autodetect]
337 --enable-rpath enable runtime linker path for extra libs [disabled]
338 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
341 --enable-gif enable GIF support [autodetect]
342 --enable-png enable PNG input/output support [autodetect]
343 --enable-mng enable MNG input support [autodetect]
344 --enable-jpeg enable JPEG input/output support [autodetect]
345 --enable-libcdio enable libcdio support [autodetect]
346 --disable-win32dll disable Win32 DLL support [autodetect]
347 --disable-qtx disable QuickTime codecs support [enabled]
348 --disable-xanim disable XAnim codecs support [enabled]
349 --disable-real disable RealPlayer codecs support [enabled]
350 --disable-xvid disable Xvid [autodetect]
351 --disable-libnut disable libnut [autodetect]
352 --enable-libav skip Libav autodetection [autodetect]
353 --disable-libvorbis disable libvorbis support [autodetect]
354 --disable-tremor disable Tremor [autodetect if no libvorbis]
355 --disable-speex disable Speex support [autodetect]
356 --enable-theora enable OggTheora libraries [autodetect]
357 --enable-faad enable FAAD2 (AAC) [autodetect]
358 --disable-ladspa disable LADSPA plugin support [autodetect]
359 --disable-libbs2b disable libbs2b audio filter support [autodetect]
360 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
361 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
362 --disable-mad disable libmad (MPEG audio) support [autodetect]
363 --enable-xmms enable XMMS input plugin support [disabled]
364 --enable-libdca enable libdca support [autodetect]
365 --disable-liba52 disable liba52 [autodetect]
366 --enable-musepack enable libmpcdec support (deprecated, libavcodec
367 Musepack decoder is preferred) [disabled]
370 --enable-gl enable OpenGL video output [autodetect]
371 --enable-sdl enable SDL video output [autodetect]
372 --enable-caca enable CACA video output [autodetect]
373 --enable-direct3d enable Direct3D video output [autodetect]
374 --enable-directx enable DirectX video output [autodetect]
375 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
376 --enable-dvb enable DVB video input [autodetect]
377 --enable-xv enable Xv video output [autodetect]
378 --enable-vdpau enable VDPAU acceleration [autodetect]
379 --enable-vm enable XF86VidMode support [autodetect]
380 --enable-xinerama enable Xinerama support [autodetect]
381 --enable-x11 enable X11 video output [autodetect]
382 --disable-xss disable screensaver support via xss [autodetect]
383 --enable-directfb enable DirectFB video output [autodetect]
384 --disable-tga disable Targa video output [enable]
385 --disable-pnm disable PNM video output [enable]
386 --disable-md5sum disable md5sum video output [enable]
387 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
388 --disable-corevideo disable CoreVideo video output [autodetect]
389 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
390 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
393 --disable-alsa disable ALSA audio output [autodetect]
394 --disable-ossaudio disable OSS audio output [autodetect]
395 --disable-rsound disable RSound audio output [autodetect]
396 --disable-pulse disable Pulseaudio audio output [autodetect]
397 --disable-portaudio disable PortAudio audio output [autodetect]
398 --disable-jack disable JACK audio output [autodetect]
399 --enable-openal enable OpenAL audio output [disable]
400 --disable-coreaudio disable CoreAudio audio output [autodetect]
401 --disable-select disable using select() on the audio device [enable]
404 --enable-translation enable support for translated output [disable]
405 --charset=charset convert the console messages to this character set
406 --language-doc=lang language to use for the documentation [en]
407 --language-man=lang language to use for the man pages [en]
408 --language-msg=lang extra languages for program messages [all]
409 --language=lang default language to use [en]
410 Specific options override --language. You can pass a list of languages separated
411 by whitespace or commas instead of a single language. Nonexisting translations
412 will be dropped from each list. All translations available in the list will be
413 installed. The value "all" will activate all translations. The LINGUAS
414 environment variable is honored. In all cases the fallback is English.
415 The program always supports English-language output; additional message
416 languages are only installed if --enable-translation is also specified.
417 Available values for --language-doc are: all $doc_lang_all
418 Available values for --language-man are: all $man_lang_all
419 Available values for --language-msg are: all $msg_lang_all
421 Miscellaneous options:
422 --enable-runtime-cpudetection enable runtime CPU detection [disable]
423 --enable-cross-compile enable cross-compilation [disable]
424 --cc=COMPILER C compiler to build MPlayer [gcc]
425 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
426 --windres=WINDRES windres to build MPlayer [windres]
427 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
428 --enable-static build a statically linked binary
429 --with-install=PATH path to a custom install program
432 --enable-mmx enable MMX [autodetect]
433 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
434 --enable-3dnow enable 3DNow! [autodetect]
435 --enable-3dnowext enable extended 3DNow! [autodetect]
436 --enable-sse enable SSE [autodetect]
437 --enable-sse2 enable SSE2 [autodetect]
438 --enable-ssse3 enable SSSE3 [autodetect]
439 --enable-shm enable shm [autodetect]
440 --enable-altivec enable AltiVec (PowerPC) [autodetect]
441 --enable-armv5te enable DSP extensions (ARM) [autodetect]
442 --enable-armv6 enable ARMv6 (ARM) [autodetect]
443 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
444 --enable-armvfp enable ARM VFP (ARM) [autodetect]
445 --enable-neon enable NEON (ARM) [autodetect]
446 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
447 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
448 --enable-big-endian force byte order to big-endian [autodetect]
449 --enable-debug[=1-3] compile-in debugging information [disable]
450 --enable-profile compile-in profiling information [disable]
451 --disable-sighandler disable sighandler for crashes [enable]
452 --enable-crash-debug enable automatic gdb attach on crash [disable]
454 Use these options if autodetection fails:
455 --extra-cflags=FLAGS extra CFLAGS
456 --extra-ldflags=FLAGS extra LDFLAGS
457 --extra-libs=FLAGS extra linker flags
458 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
460 --with-sdl-config=PATH path to sdl*-config
461 --with-dvdnav-config=PATH path to dvdnav-config
462 --with-dvdread-config=PATH path to dvdread-config
464 This configure script is NOT autoconf-based, even though its output is similar.
465 It will try to autodetect all configuration options. If you --enable an option
466 it will be forcefully turned on, skipping autodetection. This can break
467 compilation, so you need to know what you are doing.
472 # GOTCHA: the variables below defines the default behavior for autodetection
473 # and have - unless stated otherwise - at least 2 states : yes no
474 # If autodetection is available then the third state is: auto
496 test "$CC" && _cc
="$CC"
498 _runtime_cpudetection
=no
546 _dvdnavconfig
=dvdnav-config
547 _dvdreadconfig
=dvdread-config
549 _dvdread_internal
=auto
550 _libdvdcss_internal
=auto
618 def_dos_paths
="#define HAVE_DOS_PATHS 0"
619 def_stream_cache
="#define CONFIG_STREAM_CACHE 1"
620 def_priority
="#undef CONFIG_PRIORITY"
621 def_pthread_cache
="#undef PTHREAD_CACHE"
629 _prefix
=$
(echo $ac_option | cut
-d '=' -f 2)
632 _bindir
=$
(echo $ac_option | cut
-d '=' -f 2)
635 _mandir
=$
(echo $ac_option | cut
-d '=' -f 2)
638 _confdir
=$
(echo $ac_option | cut
-d '=' -f 2)
641 _libdir
=$
(echo $ac_option | cut
-d '=' -f 2)
644 _codecsdir
=$
(echo $ac_option | cut
-d '=' -f 2)
647 _localedir
=$
(echo $ac_option | cut
-d '=' -f 2)
651 _install
=$
(echo $ac_option | cut
-d '=' -f 2 )
655 _sdlconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
657 --with-dvdnav-config=*)
658 _dvdnavconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
660 --with-dvdread-config=*)
661 _dvdreadconfig
=$
(echo $ac_option | cut
-d '=' -f 2)
665 extra_cflags
="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
668 extra_ldflags
="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
671 extra_libs
=$
(echo $ac_option | cut
-d '=' -f 2)
673 --extra-libs-mplayer=*)
674 libs_mplayer
=$
(echo $ac_option | cut
-d '=' -f 2)
678 _target
=$
(echo $ac_option | cut
-d '=' -f 2)
681 _cc
=$
(echo $ac_option | cut
-d '=' -f 2)
684 _pkg_config
=$
(echo $ac_option | cut
-d '=' -f 2)
687 _windres
=$
(echo $ac_option | cut
-d '=' -f 2)
690 _charset
=$
(echo $ac_option | cut
-d '=' -f 2)
693 language_doc
=$
(echo $ac_option | cut
-d '=' -f 2)
696 language_man
=$
(echo $ac_option | cut
-d '=' -f 2)
699 language_msg
=$
(echo $ac_option | cut
-d '=' -f 2)
702 language
=$
(echo $ac_option | cut
-d '=' -f 2)
721 _debug
=$
(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut
-d '=' -f 2)
726 --enable-translation) _translation
=yes ;;
727 --disable-translation) _translation
=no
;;
728 --enable-runtime-cpudetection) _runtime_cpudetection
=yes ;;
729 --disable-runtime-cpudetection) _runtime_cpudetection
=no
;;
730 --enable-cross-compile) _cross_compile
=yes ;;
731 --disable-cross-compile) _cross_compile
=no
;;
732 --enable-x11) _x11
=yes ;;
733 --disable-x11) _x11
=no
;;
734 --enable-xss) _xss
=yes ;;
735 --disable-xss) _xss
=no
;;
736 --enable-xv) _xv
=yes ;;
737 --disable-xv) _xv
=no
;;
738 --enable-vdpau) _vdpau
=yes ;;
739 --disable-vdpau) _vdpau
=no
;;
740 --enable-sdl) _sdl
=yes ;;
741 --disable-sdl) _sdl
=no
;;
742 --enable-direct3d) _direct3d
=yes ;;
743 --disable-direct3d) _direct3d
=no
;;
744 --enable-directx) _directx
=yes ;;
745 --disable-directx) _directx
=no
;;
746 --enable-png) _png
=yes ;;
747 --disable-png) _png
=no
;;
748 --enable-mng) _mng
=yes ;;
749 --disable-mng) _mng
=no
;;
750 --enable-jpeg) _jpeg
=yes ;;
751 --disable-jpeg) _jpeg
=no
;;
752 --enable-pnm) _pnm
=yes ;;
753 --disable-pnm) _pnm
=no
;;
754 --enable-md5sum) _md5sum
=yes ;;
755 --disable-md5sum) _md5sum
=no
;;
756 --enable-yuv4mpeg) _yuv4mpeg
=yes ;;
757 --disable-yuv4mpeg) _yuv4mpeg
=no
;;
758 --enable-gif) _gif
=yes ;;
759 --disable-gif) _gif
=no
;;
760 --enable-gl) _gl
=yes ;;
761 --disable-gl) _gl
=no
;;
762 --enable-caca) _caca
=yes ;;
763 --disable-caca) _caca
=no
;;
764 --enable-dvb) _dvb
=yes ;;
765 --disable-dvb) _dvb
=no
;;
766 --enable-v4l2) _v4l2
=yes ;;
767 --disable-v4l2) _v4l2
=no
;;
768 --enable-iconv) _iconv
=yes ;;
769 --disable-iconv) _iconv
=no
;;
770 --enable-langinfo) _langinfo
=yes ;;
771 --disable-langinfo) _langinfo
=no
;;
772 --enable-rtc) _rtc
=yes ;;
773 --disable-rtc) _rtc
=no
;;
774 --enable-libdv) _libdv
=yes ;;
775 --disable-libdv) _libdv
=no
;;
776 --enable-ossaudio) _ossaudio
=yes ;;
777 --disable-ossaudio) _ossaudio
=no
;;
778 --enable-rsound) _rsound
=yes ;;
779 --disable-rsound) _rsound
=no
;;
780 --enable-pulse) _pulse
=yes ;;
781 --disable-pulse) _pulse
=no
;;
782 --enable-portaudio) _portaudio
=yes ;;
783 --disable-portaudio) _portaudio
=no
;;
784 --enable-jack) _jack
=yes ;;
785 --disable-jack) _jack
=no
;;
786 --enable-openal) _openal
=yes ;;
787 --disable-openal) _openal
=no
;;
788 --enable-mad) _mad
=yes ;;
789 --disable-mad) _mad
=no
;;
790 --enable-libcdio) _libcdio
=yes ;;
791 --disable-libcdio) _libcdio
=no
;;
792 --enable-libvorbis) _libvorbis
=yes ;;
793 --disable-libvorbis) _libvorbis
=no
;;
794 --enable-speex) _speex
=yes ;;
795 --disable-speex) _speex
=no
;;
796 --enable-tremor) _tremor
=yes ;;
797 --disable-tremor) _tremor
=no
;;
798 --enable-theora) _theora
=yes ;;
799 --disable-theora) _theora
=no
;;
800 --enable-mpg123) _mpg123
=yes ;;
801 --disable-mpg123) _mpg123
=no
;;
802 --enable-liba52) _liba52
=yes ;;
803 --disable-liba52) _liba52
=no
;;
804 --enable-libdca) _libdca
=yes ;;
805 --disable-libdca) _libdca
=no
;;
806 --enable-musepack) _musepack
=yes ;;
807 --disable-musepack) _musepack
=no
;;
808 --enable-faad) _faad
=yes ;;
809 --disable-faad) _faad
=no
;;
810 --enable-ladspa) _ladspa
=yes ;;
811 --disable-ladspa) _ladspa
=no
;;
812 --enable-libbs2b) _libbs2b
=yes ;;
813 --disable-libbs2b) _libbs2b
=no
;;
814 --enable-xmms) _xmms
=yes ;;
815 --disable-xmms) _xmms
=no
;;
816 --enable-vcd) _vcd
=yes ;;
817 --disable-vcd) _vcd
=no
;;
818 --enable-bluray) _bluray
=yes ;;
819 --disable-bluray) _bluray
=no
;;
820 --enable-dvdread) _dvdread
=yes ;;
821 --disable-dvdread) _dvdread
=no
;;
822 --enable-dvdread-internal) _dvdread_internal
=yes ;;
823 --disable-dvdread-internal) _dvdread_internal
=no
;;
824 --enable-libdvdcss-internal) _libdvdcss_internal
=yes ;;
825 --disable-libdvdcss-internal) _libdvdcss_internal
=no
;;
826 --enable-dvdnav) _dvdnav
=yes ;;
827 --disable-dvdnav) _dvdnav
=no
;;
828 --enable-xanim) _xanim
=yes ;;
829 --disable-xanim) _xanim
=no
;;
830 --enable-real) _real
=yes ;;
831 --disable-real) _real
=no
;;
832 --enable-lcms2) _lcms2
=yes ;;
833 --disable-lcms2) _lcms2
=no
;;
834 --enable-xinerama) _xinerama
=yes ;;
835 --disable-xinerama) _xinerama
=no
;;
836 --enable-vm) _vm
=yes ;;
837 --disable-vm) _vm
=no
;;
838 --enable-xf86keysym) _xf86keysym
=yes ;;
839 --disable-xf86keysym) _xf86keysym
=no
;;
840 --enable-alsa) _alsa
=yes ;;
841 --disable-alsa) _alsa
=no
;;
842 --enable-tv) _tv
=yes ;;
843 --disable-tv) _tv
=no
;;
844 --enable-tv-bsdbt848) _tv_bsdbt848
=yes ;;
845 --disable-tv-bsdbt848) _tv_bsdbt848
=no
;;
846 --enable-tv-v4l2) _tv_v4l2
=yes ;;
847 --disable-tv-v4l2) _tv_v4l2
=no
;;
848 --enable-tv-dshow) _tv_dshow
=yes ;;
849 --disable-tv-dshow) _tv_dshow
=no
;;
850 --enable-radio) _radio
=yes ;;
851 --enable-radio-capture) _radio_capture
=yes ;;
852 --disable-radio-capture) _radio_capture
=no
;;
853 --disable-radio) _radio
=no
;;
854 --enable-radio-v4l2) _radio_v4l2
=yes ;;
855 --disable-radio-v4l2) _radio_v4l2
=no
;;
856 --enable-radio-bsdbt848) _radio_bsdbt848
=yes ;;
857 --disable-radio-bsdbt848) _radio_bsdbt848
=no
;;
858 --enable-pvr) _pvr
=yes ;;
859 --disable-pvr) _pvr
=no
;;
860 --enable-fastmemcpy) _fastmemcpy
=yes ;;
861 --disable-fastmemcpy) _fastmemcpy
=no
;;
862 --enable-networking) networking
=yes ;;
863 --disable-networking) networking
=no
;;
864 --enable-winsock2_h) _winsock2_h
=yes ;;
865 --disable-winsock2_h) _winsock2_h
=no
;;
866 --enable-smb) _smb
=yes ;;
867 --disable-smb) _smb
=no
;;
868 --enable-libquvi) _libquvi
=yes ;;
869 --disable-libquvi) _libquvi
=no
;;
870 --enable-joystick) _joystick
=yes ;;
871 --disable-joystick) _joystick
=no
;;
872 --enable-xvid) _xvid
=yes ;;
873 --disable-xvid) _xvid
=no
;;
874 --enable-libnut) _libnut
=yes ;;
875 --disable-libnut) _libnut
=no
;;
876 --enable-libav) ffmpeg
=yes ;;
878 --enable-lirc) _lirc
=yes ;;
879 --disable-lirc) _lirc
=no
;;
880 --enable-lircc) _lircc
=yes ;;
881 --disable-lircc) _lircc
=no
;;
882 --enable-apple-remote) _apple_remote
=yes ;;
883 --disable-apple-remote) _apple_remote
=no
;;
884 --enable-apple-ir) _apple_ir
=yes ;;
885 --disable-apple-ir) _apple_ir
=no
;;
886 --enable-termcap) _termcap
=yes ;;
887 --disable-termcap) _termcap
=no
;;
888 --enable-termios) _termios
=yes ;;
889 --disable-termios) _termios
=no
;;
890 --disable-tga) _tga
=no
;;
891 --enable-tga) _tga
=yes ;;
892 --enable-directfb) _directfb
=yes ;;
893 --disable-directfb) _directfb
=no
;;
894 --enable-shm) _shm
=yes ;;
895 --disable-shm) _shm
=no
;;
896 --enable-select) _select
=yes ;;
897 --disable-select) _select
=no
;;
898 --enable-cddb) _cddb
=yes ;;
899 --disable-cddb) _cddb
=no
;;
900 --enable-big-endian) _big_endian
=yes ;;
901 --disable-big-endian) _big_endian
=no
;;
902 --enable-unrarexec) _unrar_exec
=yes ;;
903 --disable-unrarexec) _unrar_exec
=no
;;
904 --enable-ftp) _ftp
=yes ;;
905 --disable-ftp) _ftp
=no
;;
906 --enable-vstream) _vstream
=yes ;;
907 --disable-vstream) _vstream
=no
;;
908 --enable-pthreads) _pthreads
=yes ;;
909 --disable-pthreads) _pthreads
=no
;;
910 --enable-w32threads) _w32threads
=yes ;;
911 --disable-w32threads) _w32threads
=no
;;
912 --enable-libass) _ass
=yes ;;
913 --disable-libass) _ass
=no
;;
914 --enable-rpath) _rpath
=yes ;;
915 --disable-rpath) _rpath
=no
;;
916 --enable-libpostproc) libpostproc
=yes ;;
917 --disable-libpostproc) libpostproc
=no
;;
919 --enable-enca) _enca
=yes ;;
920 --disable-enca) _enca
=no
;;
922 --enable-inet6) _inet6
=yes ;;
923 --disable-inet6) _inet6
=no
;;
925 --enable-gethostbyname2) _gethostbyname2
=yes ;;
926 --disable-gethostbyname2) _gethostbyname2
=no
;;
928 --enable-qtx) _qtx
=yes ;;
929 --disable-qtx) _qtx
=no
;;
931 --enable-coreaudio) _coreaudio
=yes ;;
932 --disable-coreaudio) _coreaudio
=no
;;
933 --enable-corevideo) _corevideo
=yes ;;
934 --disable-corevideo) _corevideo
=no
;;
935 --enable-cocoa) _cocoa
=yes ;;
936 --disable-cocoa) _cocoa
=no
;;
937 --enable-sharedbuffer) _sharedbuffer
=yes ;;
938 --disable-sharedbuffer) _sharedbuffer
=no
;;
939 --enable-macosx-finder) _macosx_finder
=yes ;;
940 --disable-macosx-finder) _macosx_finder
=no
;;
941 --enable-macosx-bundle) _macosx_bundle
=yes ;;
942 --disable-macosx-bundle) _macosx_bundle
=no
;;
944 --enable-crash-debug) _crash_debug
=yes ;;
945 --disable-crash-debug) _crash_debug
=no
;;
946 --enable-sighandler) _sighandler
=yes ;;
947 --disable-sighandler) _sighandler
=no
;;
948 --enable-win32dll) _win32dll
=yes ;;
949 --disable-win32dll) _win32dll
=no
;;
951 --enable-sse) _sse
=yes ;;
952 --disable-sse) _sse
=no
;;
953 --enable-sse2) _sse2
=yes ;;
954 --disable-sse2) _sse2
=no
;;
955 --enable-ssse3) _ssse3
=yes ;;
956 --disable-ssse3) _ssse3
=no
;;
957 --enable-mmxext) _mmxext
=yes ;;
958 --disable-mmxext) _mmxext
=no
;;
959 --enable-3dnow) _3dnow
=yes ;;
960 --disable-3dnow) _3dnow
=no _3dnowext
=no
;;
961 --enable-3dnowext) _3dnow
=yes _3dnowext
=yes ;;
962 --disable-3dnowext) _3dnowext
=no
;;
963 --enable-cmov) _cmov
=yes ;;
964 --disable-cmov) _cmov
=no
;;
965 --enable-fast-cmov) _fast_cmov
=yes ;;
966 --disable-fast-cmov) _fast_cmov
=no
;;
967 --enable-fast-clz) _fast_clz
=yes ;;
968 --disable-fast-clz) _fast_clz
=no
;;
969 --enable-altivec) _altivec
=yes ;;
970 --disable-altivec) _altivec
=no
;;
971 --enable-armv5te) _armv5te
=yes ;;
972 --disable-armv5te) _armv5te
=no
;;
973 --enable-armv6) _armv6
=yes ;;
974 --disable-armv6) _armv6
=no
;;
975 --enable-armv6t2) _armv6t2
=yes ;;
976 --disable-armv6t2) _armv6t2
=no
;;
977 --enable-armvfp) _armvfp
=yes ;;
978 --disable-armvfp) _armvfp
=no
;;
979 --enable-neon) neon
=yes ;;
980 --disable-neon) neon
=no
;;
981 --enable-iwmmxt) _iwmmxt
=yes ;;
982 --disable-iwmmxt) _iwmmxt
=no
;;
983 --enable-mmx) _mmx
=yes ;;
984 --disable-mmx) # 3Dnow! and MMX2 require MMX
985 _3dnow
=no _3dnowext
=no _mmx
=no _mmxext
=no
;;
988 echo "Unknown parameter: $ac_option" >&2
995 # Atmos: moved this here, to be correct, if --prefix is specified
996 test -z "$_bindir" && _bindir
="$_prefix/bin"
997 test -z "$_mandir" && _mandir
="$_prefix/share/man"
998 test -z "$_confdir" && _confdir
="$_prefix/etc/mplayer"
999 test -z "$_libdir" && _libdir
="$_prefix/lib"
1000 test -z "$_localedir" && _localedir
="$_prefix/share/locale"
1002 for tmpdir
in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1003 test "$tmpdir" && break
1006 mplayer_tmpdir
="$tmpdir/mplayer-configure-$RANDOM-$$"
1007 mkdir
$mplayer_tmpdir || die
"Unable to create tmpdir."
1012 echo Parameters configure was run with
: > "$TMPLOG"
1013 if test -n "$CFLAGS" ; then
1014 echo ${_echo_n} CFLAGS
="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1016 if test -n "$PKG_CONFIG_PATH" ; then
1017 echo ${_echo_n} PKG_CONFIG_PATH
="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1019 echo .
/configure
$configuration >> "$TMPLOG"
1023 echocheck
"cross compilation"
1024 echores
$_cross_compile
1026 if test $_cross_compile = yes; then
1034 if test $_cross_compile = yes ; then
1035 # Usually cross-compiler prefixes match with the target triplet
1036 test -n "$_target" && tool_prefix
="$_target"-
1039 test "$_windres" = auto
&& _windres
="$tool_prefix"windres
1040 test "$_pkg_config" = auto
&& _pkg_config
="$tool_prefix"pkg-config
1042 if test "$_cc" = auto
; then
1043 if test -n "$tool_prefix" ; then
1044 _cc
="$tool_prefix"gcc
1050 # Determine our OS name and CPU architecture
1051 if test -z "$_target" ; then
1053 system_name
=$
(uname
-s 2>&1)
1054 case "$system_name" in
1055 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD
/OS|Darwin|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS
)
1066 [cC
][yY
][gG
][wW
][iI
][nN
]*)
1076 system_name
="$system_name-UNKNOWN"
1081 # host's CPU/instruction set
1082 host_arch
=$
(uname
-p 2>&1)
1083 case "$host_arch" in
1084 i386|sparc|ppc|alpha|arm|mips|vax
)
1086 powerpc
) # Darwin returns 'powerpc'
1089 *) # uname -p on Linux returns 'unknown' for the processor type,
1090 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1092 # Maybe uname -m (machine hardware name) returns something we
1095 # x86/x86pc is used by QNX
1096 case "$(uname -m 2>&1)" in
1097 x86_64|amd64|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
;;
1098 ia64
) host_arch
=ia64
;;
1099 macppc|ppc
) host_arch
=ppc
;;
1100 ppc64
) host_arch
=ppc64
;;
1101 alpha
) host_arch
=alpha
;;
1102 sparc
) host_arch
=sparc
;;
1103 sparc64
) host_arch
=sparc64
;;
1104 parisc
*|hppa
*|
9000*) host_arch
=hppa
;;
1105 arm
*|zaurus|cats
) host_arch
=arm
;;
1106 sh3|sh4|sh4a
) host_arch
=sh
;;
1107 s390
) host_arch
=s390
;;
1108 s390x
) host_arch
=s390x
;;
1109 *mips
*) host_arch
=mips
;;
1110 vax
) host_arch
=vax
;;
1111 xtensa
*) host_arch
=xtensa
;;
1112 *) host_arch
=UNKNOWN
;;
1116 else # if test -z "$_target"
1118 system_name
=$
(echo $_target | cut
-d '-' -f $i)
1119 case "$(echo $system_name | tr A-Z a-z)" in
1120 linux
) system_name
=Linux
;;
1121 freebsd
) system_name
=FreeBSD
;;
1122 gnu
/kfreebsd
) system_name
=FreeBSD
;;
1123 netbsd
) system_name
=NetBSD
;;
1124 bsd
/os
) system_name
=BSD
/OS
;;
1125 openbsd
) system_name
=OpenBSD
;;
1126 dragonfly
) system_name
=DragonFly
;;
1127 qnx
) system_name
=QNX
;;
1128 morphos
) system_name
=MorphOS
;;
1129 amigaos
) system_name
=AmigaOS
;;
1130 mingw32
*) system_name
=MINGW32
;;
1135 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1136 host_arch
=$
(echo $_target | cut
-d '-' -f 1)
1137 if test $
(echo $host_arch) != "x86_64" ; then
1138 host_arch
=$
(echo $host_arch |
tr '_' '-')
1142 extra_cflags
="-I. $extra_cflags"
1143 _timer
=timer-linux.c
1146 extra_ldflags
="$extra_ldflags -L/usr/local/lib"
1147 extra_cflags
="$extra_cflags -I/usr/local/include"
1150 if netbsd || dragonfly
; then
1151 extra_ldflags
="$extra_ldflags -L/usr/pkg/lib"
1152 extra_cflags
="$extra_cflags -I/usr/pkg/include"
1156 extra_cflags
="-mdynamic-no-pic $extra_cflags"
1157 _timer
=timer-darwin.c
1161 extra_ldflags
="$extra_ldflags -lC"
1166 extra_cflags
="$extra_cflags -fno-common"
1167 # -lwinmm is always needed for osdep/timer-win2.c
1168 extra_ldflags
="$extra_ldflags -lwinmm"
1172 def_dos_paths
="#define HAVE_DOS_PATHS 1"
1173 def_priority
="#define CONFIG_PRIORITY 1"
1179 extra_cflags
="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1186 def_stream_cache
="#undef CONFIG_STREAM_CACHE"
1187 extra_cflags
="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1191 extra_ldflags
="$extra_ldflags -lph"
1194 TMPC
="$mplayer_tmpdir/tmp.c"
1195 TMPEXE
="$mplayer_tmpdir/tmp$_exesuf"
1196 TMPH
="$mplayer_tmpdir/tmp.h"
1197 TMPS
="$mplayer_tmpdir/tmp.S"
1199 if test "$_runtime_cpudetection" = yes && ! x86
&& ! ppc
; then
1200 die
"Runtime CPU detection only works for x86, x86-64 and PPC!"
1204 if [ -f "$(which rst2man.py)" ] ; then
1208 # Checking CC version...
1209 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1210 if test "$(basename $_cc)" = "icc" ||
test "$(basename $_cc)" = "ecc"; then
1211 echocheck
"$_cc version"
1213 cc_name
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ',' -f 1)
1214 cc_version
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ',' -f 2 | cut
-d ' ' -f 3)
1215 _cc_major
=$
(echo $cc_version | cut
-d '.' -f 1)
1216 _cc_minor
=$
(echo $cc_version | cut
-d '.' -f 2)
1217 # TODO verify older icc/ecc compatibility
1220 cc_version
="v. ?.??, bad"
1224 cc_version
="$cc_version, ok"
1227 cc_version
="$cc_version, bad"
1231 echores
"$cc_version"
1233 for _cc
in "$_cc" gcc cc
; do
1234 cc_name_tmp
=$
($_cc -v 2>&1 |
tail -n 1 | cut
-d ' ' -f 1)
1235 if test "$cc_name_tmp" = "gcc"; then
1236 cc_name
=$cc_name_tmp
1237 echocheck
"$_cc version"
1239 cc_version
=$
($_cc -dumpversion 2>&1)
1245 _cc_major
=$
(echo $cc_version | cut
-d '.' -f 1)
1246 _cc_minor
=$
(echo $cc_version | cut
-d '.' -f 2)
1247 _cc_mini
=$
(echo $cc_version | cut
-d '.' -f 3)
1250 echores
"$cc_version"
1253 if $_cc -v 2>&1 |
grep -q "clang"; then
1254 echocheck
"$_cc version"
1256 cc_version
=$
($_cc -dumpversion 2>&1)
1257 res_comment
="experimental support only"
1258 echores
"clang $cc_version"
1261 cc_name_tmp
=$
($_cc -V 2>&1 |
head -n 1 | cut
-d ' ' -f 2,3)
1264 test "$cc_fail" = yes && die
"unsupported compiler version"
1266 echocheck
"working compiler"
1267 cflag_check
"" || die
"Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1270 if test -z "$_target" && x86
; then
1273 int test[(int)sizeof(char *)-7];
1277 cc_check
&& host_arch
=x86_64 || host_arch
=i386
1280 echo "Detected operating system: $system_name"
1281 echo "Detected host architecture: $host_arch"
1285 # XXX: this should be ok..
1288 if test "$_runtime_cpudetection" = no
; then
1290 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1291 # FIXME: Remove the cygwin check once AMD CPUs are supported
1292 if test -r /proc
/cpuinfo
&& ! cygwin
; then
1293 # Linux with /proc mounted, extract CPU information from it
1294 _cpuinfo
="cat /proc/cpuinfo"
1295 elif test -r /compat
/linux
/proc
/cpuinfo
&& ! x86
; then
1296 # FreeBSD with Linux emulation /proc mounted,
1297 # extract CPU information from it
1298 # Don't use it on x86 though, it never reports 3Dnow
1299 _cpuinfo
="cat /compat/linux/proc/cpuinfo"
1300 elif darwin
&& ! x86
; then
1301 # use hostinfo on Darwin
1304 # use 'lsattr' on AIX
1305 _cpuinfo
="lsattr -E -l proc0 -a type"
1307 # all other OSes try to extract CPU information from a small helper
1308 # program cpuinfo instead
1309 $_cc -o cpuinfo
$_exesuf cpuinfo.c
1310 _cpuinfo
="./cpuinfo$_exesuf"
1314 # gather more CPU information
1315 pname
=$
($_cpuinfo |
grep 'model name' | cut
-d ':' -f 2 |
head -n 1)
1316 pvendor
=$
($_cpuinfo |
grep 'vendor_id' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1317 pfamily
=$
($_cpuinfo |
grep 'cpu family' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1318 pmodel
=$
($_cpuinfo |
grep -v 'model name' |
grep 'model' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1319 pstepping
=$
($_cpuinfo |
grep 'stepping' | cut
-d ':' -f 2 | cut
-d ' ' -f 2 |
head -n 1)
1321 exts
=$
($_cpuinfo |
egrep 'features|flags' | cut
-d ':' -f 2 |
head -n 1)
1323 pparam
=$
(echo $exts |
sed -e s
/xmm
/sse
/ -e s
/kni
/sse
/)
1324 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1325 pparam
=$
(echo $pparam |
sed -e 's/sse/sse mmxext/')
1327 for ext
in $pparam ; do
1328 eval test \"\
$_$ext\" = auto
2>/dev
/null
&& eval _
$ext=kernel_check
1331 echocheck
"CPU vendor"
1332 echores
"$pvendor ($pfamily:$pmodel:$pstepping)"
1334 echocheck
"CPU type"
1338 fi # test "$_runtime_cpudetection" = no
1340 if x86
&& test "$_runtime_cpudetection" = no
; then
1342 if test "$1" = kernel_check
; then
1343 echocheck
"kernel support of $2"
1347 static void catch(int sig) { exit(1); }
1349 signal(SIGILL, catch);
1350 __asm__ volatile ("$3":::"memory"); return 0;
1354 if cc_check
&& tmp_run
; then
1357 _optimizing
="$_optimizing $2"
1362 echo "It seems that your kernel does not correctly support $2."
1363 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1370 extcheck
$_mmx "mmx" "emms"
1371 extcheck
$_mmxext "mmxext" "sfence"
1372 extcheck
$_3dnow "3dnow" "femms"
1373 extcheck
$_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1374 extcheck
$_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext
="$_gcc3_ext -mno-sse"
1375 extcheck
$_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext
="$_gcc3_ext -mno-sse2"
1376 extcheck
$_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1377 extcheck
$_cmov "cmov" "cmovb %%eax, %%ebx"
1379 if test "$_gcc3_ext" != ""; then
1380 # if we had to disable sse/sse2 because the active kernel does not
1381 # support this instruction set extension, we also have to tell
1382 # gcc3 to not generate sse/sse2 instructions for normal C code
1383 cflag_check
$_march $_gcc3_ext && _march
="$_march $_gcc3_ext"
1389 def_fast_64bit
='#define HAVE_FAST_64BIT 0'
1390 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 0'
1391 arch_all
='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1392 subarch_all
='X86_32 X86_64 PPC64'
1393 case "$host_arch" in
1394 i
[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium
*|athlon
*|i586-i686
)
1397 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1402 if test "$_runtime_cpudetection" = no
; then
1406 3) proc
=i386 iproc
=386 ;;
1407 4) proc
=i486 iproc
=486 ;;
1408 5) iproc
=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1409 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1410 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1412 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1414 elif test "$pmodel" -ge 8; then
1416 elif test "$pmodel" -ge 6; then
1423 # It's a bit difficult to determine the correct type of Family 6
1424 # AMD CPUs just from their signature. Instead, we check directly
1425 # whether it supports SSE.
1426 if test "$_sse" = yes; then
1427 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1430 # Again, gcc treats athlon and athlon-tbird similarly.
1435 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1436 # caught and remedied in the optimization tests below.
1440 *) proc
=amdfam10 iproc
=686
1441 test $_fast_clz = "auto" && _fast_clz
=yes
1447 3) proc
=i386 iproc
=386 ;;
1448 4) proc
=i486 iproc
=486 ;;
1450 if test "$pmodel" -eq 4 ||
test "$pmodel" -eq 8; then
1451 proc
=pentium-mmx
# 4 is desktop, 8 is mobile
1457 if test "$pmodel" -ge 15; then
1459 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1461 elif test "$pmodel" -ge 7; then
1463 elif test "$pmodel" -ge 3; then
1468 test $_fast_clz = "auto" && _fast_clz
=yes
1471 # A nocona in 32-bit mode has no more capabilities than a prescott.
1472 if test "$pmodel" -ge 3; then
1476 test $_fast_clz = "auto" && _fast_clz
=yes
1478 test $_fast_cmov = "auto" && _fast_cmov
=no
1480 *) proc
=prescott iproc
=686 ;;
1486 if test "$pmodel" -ge 8; then
1488 elif test "$pmodel" -ge 4; then
1495 if test "$pmodel" -ge 9; then
1502 *) proc
=i686 iproc
=i686
;;
1507 3) proc
=i386 iproc
=386 ;;
1508 4) proc
=i486 iproc
=486 ;;
1509 *) proc
=i586 iproc
=586 ;;
1513 proc
=i586 iproc
=586 ;;
1515 test $_fast_clz = "auto" && _fast_clz
=no
1516 fi # test "$_runtime_cpudetection" = no
1519 # check that gcc supports our CPU, if not, fall back to earlier ones
1520 # LGB: check -mcpu and -march swithing step by step with enabling
1521 # to fall back till 386.
1523 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1525 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] ||
( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1531 echocheck
"GCC & CPU optimization abilities"
1532 if test "$_runtime_cpudetection" = no
; then
1533 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1534 cflag_check
-march=native
&& proc
=native
1536 if test "$proc" = "amdfam10"; then
1537 cflag_check
-march=$proc $cpuopt=$proc || proc
=k8
1539 if test "$proc" = "k8"; then
1540 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon-xp
1542 if test "$proc" = "athlon-xp"; then
1543 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon
1545 if test "$proc" = "k6-3" ||
test "$proc" = "k6-2"; then
1546 cflag_check
-march=$proc $cpuopt=$proc || proc
=k6
1548 if test "$proc" = "k6" ||
test "$proc" = "c3"; then
1549 if ! cflag_check
-march=$proc $cpuopt=$proc; then
1550 if cflag_check
-march=i586
$cpuopt=i686
; then
1557 if test "$proc" = "prescott" ; then
1558 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium4
1560 if test "$proc" = "core2" ; then
1561 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium-m
1563 if test "$proc" = "pentium4" ||
test "$proc" = "pentium-m" ||
test "$proc" = "pentium3" ||
test "$proc" = "pentium2" ||
test "$proc" = "athlon" ||
test "$proc" = "c3-2" ||
test "$proc" = "geode"; then
1564 cflag_check
-march=$proc $cpuopt=$proc || proc
=i686
1566 if test "$proc" = "i686" ||
test "$proc" = "pentium-mmx" ||
test "$proc" = "winchip-c6" ||
test "$proc" = "winchip2"; then
1567 cflag_check
-march=$proc $cpuopt=$proc || proc
=i586
1569 if test "$proc" = "i586"; then
1570 cflag_check
-march=$proc $cpuopt=$proc || proc
=i486
1572 if test "$proc" = "i486" ; then
1573 cflag_check
-march=$proc $cpuopt=$proc || proc
=i386
1575 if test "$proc" = "i386" ; then
1576 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1578 if test "$proc" = "error" ; then
1579 echores
"CPU optimization disabled. CPU not recognized or your compiler is too old."
1583 elif test "$proc" = "i586-i686"; then
1584 _march
="-march=i586"
1585 _mcpu
="$cpuopt=i686"
1588 _march
="-march=$proc"
1589 _mcpu
="$cpuopt=$proc"
1592 else # if test "$_runtime_cpudetection" = no
1593 _mcpu
="$cpuopt=generic"
1594 # at least i486 required, for bswap instruction
1595 _march
="-march=i486"
1596 cflag_check
$_mcpu || _mcpu
="$cpuopt=i686"
1597 cflag_check
$_mcpu || _mcpu
=""
1598 cflag_check
$_march $_mcpu || _march
=""
1601 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1602 ## autodetected mcpu/march parameters
1603 if test "$_target" ; then
1604 # TODO: it may be a good idea to check GCC and fall back in all cases
1605 if test "$host_arch" = "i586-i686"; then
1606 _march
="-march=i586"
1607 _mcpu
="$cpuopt=i686"
1609 _march
="-march=$host_arch"
1610 _mcpu
="$cpuopt=$host_arch"
1618 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx
) iproc
=586 ;;
1619 i686|athlon
*|pentium
*) iproc
=686 ;;
1624 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1629 test $_fast_clz = "auto" && _fast_clz
=yes
1636 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1643 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1644 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1647 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1648 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1653 if test "$_runtime_cpudetection" = no
; then
1658 test $_fast_clz = "auto" && _fast_clz
=no
1667 # 64-bit prescotts exist, but as far as GCC is concerned they
1668 # have the same capabilities as a nocona.
1670 test $_fast_cmov = "auto" && _fast_cmov
=no
1671 test $_fast_clz = "auto" && _fast_clz
=no
1678 fi # test "$_runtime_cpudetection" = no
1680 echocheck
"GCC & CPU optimization abilities"
1681 # This is a stripped-down version of the i386 fallback.
1682 if test "$_runtime_cpudetection" = no
; then
1683 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1684 cflag_check
-march=native
&& proc
=native
1686 # --- AMD processors ---
1687 if test "$proc" = "amdfam10"; then
1688 cflag_check
-march=$proc $cpuopt=$proc || proc
=k8
1690 if test "$proc" = "k8"; then
1691 cflag_check
-march=$proc $cpuopt=$proc || proc
=athlon-xp
1693 # This will fail if gcc version < 3.3, which is ok because earlier
1694 # versions don't really support 64-bit on amd64.
1695 # Is this a valid assumption? -Corey
1696 if test "$proc" = "athlon-xp"; then
1697 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1699 # --- Intel processors ---
1700 if test "$proc" = "core2"; then
1701 cflag_check
-march=$proc $cpuopt=$proc || proc
=x86-64
1703 if test "$proc" = "x86-64"; then
1704 cflag_check
-march=$proc $cpuopt=$proc || proc
=nocona
1706 if test "$proc" = "nocona"; then
1707 cflag_check
-march=$proc $cpuopt=$proc || proc
=pentium4
1709 if test "$proc" = "pentium4"; then
1710 cflag_check
-march=$proc $cpuopt=$proc || proc
=error
1713 _march
="-march=$proc"
1714 _mcpu
="$cpuopt=$proc"
1715 if test "$proc" = "error" ; then
1716 echores
"CPU optimization disabled. CPU not recognized or your compiler is too old."
1720 else # if test "$_runtime_cpudetection" = no
1721 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1722 _march
="-march=x86-64"
1723 _mcpu
="$cpuopt=generic"
1724 cflag_check
$_mcpu || _mcpu
="x86-64"
1725 cflag_check
$_mcpu || _mcpu
=""
1726 cflag_check
$_march $_mcpu || _march
=""
1730 test $_fast_cmov = "auto" && _fast_cmov
=yes
1731 test $_fast_clz = "auto" && _fast_clz
=yes
1739 if test "$host_arch" = "sparc64" ; then
1742 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1757 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1759 test $_fast_clz = "auto" && _fast_clz
=yes
1767 ppc|ppc64|powerpc|powerpc64
)
1769 def_fast_unaligned
='#define HAVE_FAST_UNALIGNED 1'
1772 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
1774 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1776 echocheck
"CPU type"
1777 case $system_name in
1779 proc
=$
($_cpuinfo |
grep 'cpu' | cut
-d ':' -f 2 | cut
-d ',' -f 1 | cut
-b 2- |
head -n 1)
1780 if test -n "$($_cpuinfo | grep altivec)"; then
1781 test $_altivec = auto
&& _altivec
=yes
1785 proc
=$
($_cpuinfo |
grep "Processor type" | cut
-f 3 -d ' ' |
sed 's/ppc//')
1786 if [ $
(sysctl
-n hw.vectorunit
) -eq 1 -o \
1787 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
1788 test $_altivec = auto
&& _altivec
=yes
1792 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1794 2*|
3.0*|
3.1*|
3.2*|
3.3*)
1797 if [ $
(sysctl
-n machdep.altivec
) -eq 1 ]; then
1798 test $_altivec = auto
&& _altivec
=yes
1804 proc
=$
($_cpuinfo |
grep 'type' | cut
-f 2 -d ' ' |
sed 's/PowerPC_//')
1807 if test "$_altivec" = yes; then
1808 echores
"$proc altivec"
1814 echocheck
"GCC & CPU optimization abilities"
1816 if test -n "$proc"; then
1818 601) _march
='-mcpu=601' _mcpu
='-mtune=601' ;;
1819 603) _march
='-mcpu=603' _mcpu
='-mtune=603' ;;
1820 603e|
603ev
) _march
='-mcpu=603e' _mcpu
='-mtune=603e' ;;
1821 604|
604e|
604r|
604ev
) _march
='-mcpu=604' _mcpu
='-mtune=604' ;;
1822 740|
740/750|
745/755) _march
='-mcpu=740' _mcpu
='-mtune=740' ;;
1823 750|
750CX
) _march
='-mcpu=750' _mcpu
='-mtune=750' ;;
1824 POWER
) _march
='-mcpu=power' _mcpu
='-mtune=power' ;;
1825 POWER2
) _march
='-mcpu=power2' _mcpu
='-mtune=power2' ;;
1826 POWER3
) _march
='-mcpu=power3' _mcpu
='-mtune=power3' ;;
1829 # gcc 3.1(.1) and up supports 7400 and 7450
1830 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" ||
test "$_cc_major" -ge "4"; then
1832 7400*|
7410*) _march
='-mcpu=7400' _mcpu
='-mtune=7400' ;;
1833 7447*|
7450*|
7455*) _march
='-mcpu=7450' _mcpu
='-mtune=7450' ;;
1837 # gcc 3.2 and up supports 970
1838 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" ||
test "$_cc_major" -ge "4"; then
1840 970*|PPC970
*) _march
='-mcpu=970' _mcpu
='-mtune=970' ;;
1844 # gcc 3.3 and up supports POWER4
1845 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" ||
test "$_cc_major" -ge "4"; then
1847 POWER4
) _march
='-mcpu=power4' _mcpu
='-mtune=power4' ;;
1851 # gcc 3.4 and up supports 440*
1852 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" ||
test "$_cc_major" -ge "4"; then
1854 440EP
*) _march
='-mcpu=440fp' _mcpu
='-mtune=440fp' ;;
1855 440G
* ) _march
='-mcpu=440' _mcpu
='-mtune=440' ;;
1859 # gcc 4.0 and up supports POWER5
1860 if test "$_cc_major" -ge "4"; then
1862 POWER5
*) _march
='-mcpu=power5' _mcpu
='-mtune=power5' ;;
1868 if test -n "$_mcpu"; then
1869 _optimizing
=$
(echo $_mcpu | cut
-c 8-)
1870 echores
"$_optimizing"
1875 test $_fast_clz = "auto" && _fast_clz
=yes
1882 def_fast_64bit
='#define HAVE_FAST_64BIT 1'
1884 echocheck
"CPU type"
1887 unsigned long ver, mask;
1888 __asm__ ("implver %0" : "=r" (ver));
1889 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
1890 printf("%ld-%x\n", ver, ~mask);
1894 $_cc -o "$TMPEXE" "$TMPC"
1895 case $
("$TMPEXE") in
1897 0-0) proc
="ev4"; _mvi
="0";;
1898 1-0) proc
="ev5"; _mvi
="0";;
1899 1-1) proc
="ev56"; _mvi
="0";;
1900 1-101) proc
="pca56"; _mvi
="1";;
1901 2-303) proc
="ev6"; _mvi
="1";;
1902 2-307) proc
="ev67"; _mvi
="1";;
1903 2-1307) proc
="ev68"; _mvi
="1";;
1907 echocheck
"GCC & CPU optimization abilities"
1908 if test "$proc" = "ev68" ; then
1909 cc_check
-mcpu=$proc || proc
=ev67
1911 if test "$proc" = "ev67" ; then
1912 cc_check
-mcpu=$proc || proc
=ev6
1917 test $_fast_clz = "auto" && _fast_clz
=yes
1926 test $_fast_clz = "auto" && _fast_clz
=yes
1960 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1961 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1962 die
"unsupported architecture $host_arch"
1964 esac # case "$host_arch" in
1966 if test "$_runtime_cpudetection" = yes ; then
1968 test "$_cmov" != no
&& _cmov
=yes
1970 test "$_mmx" != no
&& _mmx
=yes
1971 test "$_3dnow" != no
&& _3dnow
=yes
1972 test "$_3dnowext" != no
&& _3dnowext
=yes
1973 test "$_mmxext" != no
&& _mmxext
=yes
1974 test "$_sse" != no
&& _sse
=yes
1975 test "$_sse2" != no
&& _sse2
=yes
1976 test "$_ssse3" != no
&& _ssse3
=yes
1985 echocheck
"byte order"
1986 if test "$_big_endian" = auto
; then
1988 short ascii_name[] = {
1989 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
1990 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
1991 int main(void) { return (long)ascii_name; }
1994 if strings $TMPEXE |
grep -q -l MPlayerBigEndian
; then
2000 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2003 if test "$_big_endian" = yes ; then
2004 _byte_order
='big-endian'
2005 def_words_endian
='#define WORDS_BIGENDIAN 1'
2006 def_bigendian
='#define HAVE_BIGENDIAN 1'
2008 _byte_order
='little-endian'
2009 def_words_endian
='#undef WORDS_BIGENDIAN'
2010 def_bigendian
='#define HAVE_BIGENDIAN 0'
2012 echores
"$_byte_order"
2015 echocheck
"assembler support of -pipe option"
2016 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2017 cflag_check
-pipe -I.
&& _pipe
="-pipe" && echores
"yes" || echores
"no"
2020 if darwin
&& test "$cc_vendor" = "gnu" ; then
2021 echocheck
"GCC support of -mstackrealign"
2022 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2023 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2024 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2025 # wrong code with this flag, but this can be worked around by adding
2026 # -fno-unit-at-a-time as described in the blog post at
2027 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2029 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2030 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2032 cc_check
-O2 -mstackrealign && tmp_run
&& cflags_stackrealign
=-mstackrealign
2033 test -z "$cflags_stackrealign" && cc_check
-O2 -mstackrealign -fno-unit-at-a-time &&
2034 tmp_run
&& cflags_stackrealign
="-mstackrealign -fno-unit-at-a-time"
2035 test -n "$cflags_stackrealign" && echores
"yes" || echores
"no"
2036 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2039 # Checking for CFLAGS
2041 if test "$_profile" != "" ||
test "$_debug" != "" ; then
2044 if test -z "$CFLAGS" ; then
2045 if test "$cc_vendor" = "intel" ; then
2046 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2047 WARNFLAGS
="-wd167 -wd556 -wd144"
2048 elif test "$cc_vendor" = "clang"; then
2049 CFLAGS
="-O2 $_debug $_profile $_march $_pipe"
2050 WARNFLAGS
="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2051 ERRORFLAGS
="-Werror=implicit-function-declaration"
2052 elif test "$cc_vendor" != "gnu" ; then
2053 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2055 CFLAGS
="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2056 WARNFLAGS
="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2057 ERRORFLAGS
="-Werror-implicit-function-declaration"
2058 extra_ldflags
="$extra_ldflags -ffast-math"
2064 if darwin
&& test "$cc_vendor" = "gnu" ; then
2065 extra_cflags
="-falign-loops=16 -shared-libgcc $extra_cflags"
2068 if test "$cc_vendor" = "gnu" ; then
2069 cflag_check
-Wundef && WARNFLAGS
="-Wundef $WARNFLAGS"
2070 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2071 # that's the only variable specific to C now, and this option is not valid
2073 cflag_check
-std=gnu99
&& WARN_CFLAGS
="-std=gnu99 $WARN_CFLAGS"
2074 cflag_check
-Wno-pointer-sign && WARN_CFLAGS
="-Wno-pointer-sign $WARN_CFLAGS"
2075 cflag_check
-Wdisabled-optimization && WARN_CFLAGS
="-Wdisabled-optimization $WARN_CFLAGS"
2076 cflag_check
-Wmissing-prototypes && WARN_CFLAGS
="-Wmissing-prototypes $WARN_CFLAGS"
2077 cflag_check
-Wstrict-prototypes && WARN_CFLAGS
="-Wstrict-prototypes $WARN_CFLAGS"
2079 CFLAGS
="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2082 cflag_check
-mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer
="-mno-omit-leaf-frame-pointer"
2083 cflag_check
-MD -MP && DEPFLAGS
="-MD -MP"
2086 if test -n "$LDFLAGS" ; then
2087 extra_ldflags
="$extra_ldflags $LDFLAGS"
2089 elif test "$cc_vendor" = "intel" ; then
2090 extra_ldflags
="$extra_ldflags -i-static"
2092 if test -n "$CPPFLAGS" ; then
2093 extra_cflags
="$extra_cflags $CPPFLAGS"
2103 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2104 #error PIC not enabled
2109 cc_check
&& pic
=yes && extra_cflags
="$extra_cflags -DPIC"
2115 echocheck
".align is a power of two"
2116 if test "$_asmalign_pot" = auto
; then
2118 inline_asm_check
'".align 3"' && _asmalign_pot
=yes
2120 if test "$_asmalign_pot" = "yes" ; then
2121 def_asmalign_pot
='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2123 def_asmalign_pot
='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2125 echores
$_asmalign_pot
2128 echocheck
"ebx availability"
2130 def_ebx_available
='#define HAVE_EBX_AVAILABLE 0'
2137 // just adding ebx to clobber list seems unreliable with some
2138 // compilers, e.g. Haiku's gcc 2.95
2140 // and the above check does not work for OSX 64 bit...
2141 __asm__ volatile("":::"%ebx");
2145 cc_check
&& ebx_available
=yes && def_ebx_available
='#define HAVE_EBX_AVAILABLE 1'
2146 echores
$ebx_available
2150 #FIXME: This should happen before the check for CFLAGS..
2151 def_altivec_h
='#define HAVE_ALTIVEC_H 0'
2152 if ppc
&& ( test "$_altivec" = yes ||
test "$_runtime_cpudetection" = yes ) ; then
2154 # check if AltiVec is supported by the compiler, and how to enable it
2155 echocheck
"GCC AltiVec flags"
2156 if $
(cflag_check
-maltivec -mabi=altivec
) ; then
2157 _altivec_gcc_flags
="-maltivec -mabi=altivec"
2158 # check if <altivec.h> should be included
2159 if $
(header_check altivec.h
$_altivec_gcc_flags) ; then
2160 def_altivec_h
='#define HAVE_ALTIVEC_H 1'
2161 inc_altivec_h
='#include <altivec.h>'
2163 if $
(cflag_check
-faltivec) ; then
2164 _altivec_gcc_flags
="-faltivec"
2167 _altivec_gcc_flags
="none, AltiVec disabled"
2171 echores
"$_altivec_gcc_flags"
2173 # check if the compiler supports braces for vector declarations
2176 int main(void) { (vector int) {1}; return 0; }
2178 cc_check
$_altivec_gcc_flags || die
"You need a compiler that supports {} in AltiVec vector declarations."
2180 # Disable runtime cpudetection if we cannot generate AltiVec code or
2181 # AltiVec is disabled by the user.
2182 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2183 && _runtime_cpudetection
=no
2185 # Show that we are optimizing for AltiVec (if enabled and supported).
2186 test "$_runtime_cpudetection" = no
&& test "$_altivec" = yes \
2187 && _optimizing
="$_optimizing altivec"
2189 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2190 test "$_altivec" = yes && CFLAGS
="$CFLAGS $_altivec_gcc_flags"
2194 echocheck
"ARMv5TE (Enhanced DSP Extensions)"
2195 if test $_armv5te = "auto" ; then
2197 inline_asm_check
'"qadd r0, r0, r0"' && _armv5te
=yes
2201 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz
=yes
2203 echocheck
"ARMv6 (SIMD instructions)"
2204 if test $_armv6 = "auto" ; then
2206 inline_asm_check
'"sadd16 r0, r0, r0"' && _armv6
=yes
2210 echocheck
"ARMv6t2 (SIMD instructions)"
2211 if test $_armv6t2 = "auto" ; then
2213 inline_asm_check
'"movt r0, #0"' && _armv6t2
=yes
2218 if test $_armvfp = "auto" ; then
2220 inline_asm_check
'"fadds s0, s0, s0"' && _armvfp
=yes
2224 echocheck
"ARM NEON"
2225 if test $neon = "auto" ; then
2227 inline_asm_check
'"vadd.i16 q0, q0, q0"' && neon
=yes
2231 echocheck
"iWMMXt (Intel XScale SIMD instructions)"
2232 if test $_iwmmxt = "auto" ; then
2234 inline_asm_check
'"wunpckelub wr6, wr4"' && _iwmmxt
=yes
2239 cpuexts_all
='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2240 test "$_altivec" = yes && cpuexts
="ALTIVEC $cpuexts"
2241 test "$_mmx" = yes && cpuexts
="MMX $cpuexts"
2242 test "$_mmxext" = yes && cpuexts
="MMX2 $cpuexts"
2243 test "$_3dnow" = yes && cpuexts
="AMD3DNOW $cpuexts"
2244 test "$_3dnowext" = yes && cpuexts
="AMD3DNOWEXT $cpuexts"
2245 test "$_sse" = yes && cpuexts
="SSE $cpuexts"
2246 test "$_sse2" = yes && cpuexts
="SSE2 $cpuexts"
2247 test "$_ssse3" = yes && cpuexts
="SSSE3 $cpuexts"
2248 test "$_cmov" = yes && cpuexts
="CMOV $cpuexts"
2249 test "$_fast_cmov" = yes && cpuexts
="FAST_CMOV $cpuexts"
2250 test "$_fast_clz" = yes && cpuexts
="FAST_CLZ $cpuexts"
2251 test "$_armv5te" = yes && cpuexts
="ARMV5TE $cpuexts"
2252 test "$_armv6" = yes && cpuexts
="ARMV6 $cpuexts"
2253 test "$_armv6t2" = yes && cpuexts
="ARMV6T2 $cpuexts"
2254 test "$_armvfp" = yes && cpuexts
="ARMVFP $cpuexts"
2255 test "$neon" = yes && cpuexts
="NEON $cpuexts"
2256 test "$_iwmmxt" = yes && cpuexts
="IWMMXT $cpuexts"
2257 test "$_vis" = yes && cpuexts
="VIS $cpuexts"
2258 test "$_mvi" = yes && cpuexts
="MVI $cpuexts"
2260 # Checking kernel version...
2261 if x86_32
&& linux
; then
2263 kernel_version
=$
(uname
-r 2>&1)
2264 echocheck
"$system_name kernel version"
2265 case "$kernel_version" in
2266 '') kernel_version
="?.??"; _k_verc_fail
=yes;;
2267 [0-1].
[0-9].
[0-9]*|
2.
[0-3].
[0-9]*)
2268 _k_verc_problem
=yes;;
2270 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2273 if test "$_k_verc_fail" ; then
2274 echores
"$kernel_version, fail"
2275 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2276 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2277 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2278 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2279 echo "2.2.x you must upgrade it to get SSE support!"
2280 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2282 echores
"$kernel_version, ok"
2286 ######################
2287 # MAIN TESTS GO HERE #
2288 ######################
2292 if cflag_check
-lposix ; then
2293 extra_ldflags
="$extra_ldflags -lposix"
2300 if cflag_check
-lm ; then
2309 echocheck
"langinfo"
2310 if test "$_langinfo" = auto
; then
2312 statement_check langinfo.h
'nl_langinfo(CODESET)' && _langinfo
=yes
2314 if test "$_langinfo" = yes ; then
2315 def_langinfo
='#define HAVE_LANGINFO 1'
2317 def_langinfo
='#undef HAVE_LANGINFO'
2319 echores
"$_langinfo"
2322 echocheck
"translation support"
2323 if test "$_translation" = yes; then
2324 def_translation
="#define CONFIG_TRANSLATION 1"
2326 def_translation
="#undef CONFIG_TRANSLATION"
2328 echores
"$_translation"
2330 echocheck
"language"
2331 # Set preferred languages, "all" uses English as main language.
2332 test -z "$language" && language
=$LINGUAS
2333 test -z "$language_doc" && language_doc
=$language
2334 test -z "$language_man" && language_man
=$language
2335 test -z "$language_msg" && language_msg
=$language
2336 test -z "$language_msg" && language_msg
="all"
2337 language_doc
=$
(echo $language_doc |
tr , " ")
2338 language_man
=$
(echo $language_man |
tr , " ")
2339 language_msg
=$
(echo $language_msg |
tr , " ")
2341 test "$language_doc" = "all" && language_doc
=$doc_lang_all
2342 test "$language_man" = "all" && language_man
=$man_lang_all
2343 test "$language_msg" = "all" && language_msg
=$msg_lang_all
2345 if test "$_translation" != yes ; then
2349 # Prune non-existing translations from language lists.
2350 # Set message translation to the first available language.
2351 # Fall back on English.
2352 for lang
in $language_doc ; do
2353 test -d DOCS
/xml
/$lang && tmp_language_doc
="$tmp_language_doc $lang"
2355 language_doc
=$tmp_language_doc
2356 test -z "$language_doc" && language_doc
=en
2358 for lang
in $language_man ; do
2359 test -d DOCS
/man
/$lang && tmp_language_man
="$tmp_language_man $lang"
2361 language_man
=$tmp_language_man
2362 test -z "$language_man" && language_man
=en
2364 for lang
in $language_msg ; do
2365 test -f po
/$lang.po
&& tmp_language_msg
="$tmp_language_msg $lang"
2367 language_msg
=$tmp_language_msg
2369 echores
"messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2372 echocheck
"enable sighandler"
2373 if test "$_sighandler" = yes ; then
2374 def_sighandler
='#define CONFIG_SIGHANDLER 1'
2376 def_sighandler
='#undef CONFIG_SIGHANDLER'
2378 echores
"$_sighandler"
2380 echocheck
"runtime cpudetection"
2381 if test "$_runtime_cpudetection" = yes ; then
2382 _optimizing
="Runtime CPU-Detection enabled"
2383 def_runtime_cpudetection
='#define CONFIG_RUNTIME_CPUDETECT 1'
2385 def_runtime_cpudetection
='#define CONFIG_RUNTIME_CPUDETECT 0'
2387 echores
"$_runtime_cpudetection"
2390 echocheck
"restrict keyword"
2391 for restrict_keyword
in restrict __restrict __restrict__
; do
2392 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2394 def_restrict_keyword
=$restrict_keyword
2398 if [ -n "$def_restrict_keyword" ]; then
2399 echores
"$def_restrict_keyword"
2403 # Avoid infinite recursion loop ("#define restrict restrict")
2404 if [ "$def_restrict_keyword" != "restrict" ]; then
2405 def_restrict_keyword
="#define restrict $def_restrict_keyword"
2407 def_restrict_keyword
=""
2411 echocheck
"__builtin_expect"
2412 # GCC branch prediction hint
2414 static int foo(int a) {
2415 a = __builtin_expect(a, 10);
2416 return a == 10 ? 0 : 1;
2418 int main(void) { return foo(10) && foo(0); }
2421 cc_check
&& _builtin_expect
=yes
2422 if test "$_builtin_expect" = yes ; then
2423 def_builtin_expect
='#define HAVE_BUILTIN_EXPECT 1'
2425 def_builtin_expect
='#undef HAVE_BUILTIN_EXPECT'
2427 echores
"$_builtin_expect"
2432 statement_check kstat.h
'kstat_open()' -lkstat && _kstat
=yes
2433 if test "$_kstat" = yes ; then
2434 def_kstat
="#define HAVE_LIBKSTAT 1"
2435 extra_ldflags
="$extra_ldflags -lkstat"
2437 def_kstat
="#undef HAVE_LIBKSTAT"
2443 # required for nanosleep on some systems
2445 statement_check
time.h
'nanosleep(0, 0)' -lposix4 && _posix4
=yes
2446 if test "$_posix4" = yes ; then
2447 extra_ldflags
="$extra_ldflags -lposix4"
2452 echocheck
"nanosleep"
2454 statement_check
time.h
'nanosleep(0, 0)' && _nanosleep
=yes
2455 if test "$_nanosleep" = yes ; then
2456 def_nanosleep
='#define HAVE_NANOSLEEP 1'
2458 def_nanosleep
='#undef HAVE_NANOSLEEP'
2460 echores
"$_nanosleep"
2464 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2465 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2468 #include <sys/socket.h>
2469 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2472 for _ld_tmp
in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2473 cc_check
$_ld_tmp && _ld_sock
="$_ld_tmp" && _socklib
=yes && break
2475 test $_socklib = yes && test $_winsock2_h = auto
&& _winsock2_h
=no
2476 if test $_winsock2_h = auto
; then
2478 statement_check winsock2.h
'gethostbyname(0)' -lws2_32 && _ld_sock
="-lws2_32" && _winsock2_h
=yes
2480 test "$_ld_sock" && res_comment
="using $_ld_sock"
2484 if test $_winsock2_h = yes ; then
2486 def_winsock2_h
='#define HAVE_WINSOCK2_H 1'
2488 def_winsock2_h
='#define HAVE_WINSOCK2_H 0'
2492 echocheck
"inet_pton()"
2493 def_inet_pton
='#define HAVE_INET_PTON 0'
2495 for _ld_tmp
in "$_ld_sock" "$_ld_sock -lresolv" ; do
2496 statement_check arpa
/inet.h
'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton
=yes && break
2498 if test $inet_pton = yes ; then
2499 test "$_ld_tmp" && res_comment
="using $_ld_tmp"
2500 def_inet_pton
='#define HAVE_INET_PTON 1'
2502 echores
"$inet_pton"
2505 echocheck
"inet_aton()"
2506 def_inet_aton
='#define HAVE_INET_ATON 0'
2508 for _ld_tmp
in "$_ld_sock" "$_ld_sock -lresolv" ; do
2509 statement_check arpa
/inet.h
'inet_aton(0, 0)' $_ld_tmp && inet_aton
=yes && break
2511 if test $inet_aton = yes ; then
2512 test "$_ld_tmp" && res_comment
="using $_ld_tmp"
2513 def_inet_aton
='#define HAVE_INET_ATON 1'
2515 echores
"$inet_aton"
2518 echocheck
"socklen_t"
2520 for header
in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2521 statement_check
$header 'socklen_t v = 0' && _socklen_t
=yes && break
2523 if test "$_socklen_t" = yes ; then
2524 def_socklen_t
='#define HAVE_SOCKLEN_T 1'
2526 def_socklen_t
='#define HAVE_SOCKLEN_T 0'
2528 echores
"$_socklen_t"
2531 echocheck
"closesocket()"
2533 statement_check winsock2.h
'closesocket(~0)' $_ld_sock && _closesocket
=yes
2534 if test "$_closesocket" = yes ; then
2535 def_closesocket
='#define HAVE_CLOSESOCKET 1'
2537 def_closesocket
='#define HAVE_CLOSESOCKET 0'
2539 echores
"$_closesocket"
2542 echocheck
"networking"
2543 test $_winsock2_h = no
&& test $inet_pton = no
&&
2544 test $inet_aton = no
&& networking
=no
2545 if test "$networking" = yes ; then
2546 def_network
='#define CONFIG_NETWORK 1'
2547 def_networking
='#define CONFIG_NETWORKING 1'
2548 extra_ldflags
="$extra_ldflags $_ld_sock"
2549 inputmodules
="networking $inputmodules"
2551 noinputmodules
="networking $noinputmodules"
2552 def_network
='#define CONFIG_NETWORK 0'
2553 def_networking
='#undef CONFIG_NETWORKING'
2555 echores
"$networking"
2559 if test "$_inet6" = auto
; then
2561 #include <sys/types.h>
2562 #if !defined(_WIN32)
2563 #include <sys/socket.h>
2564 #include <netinet/in.h>
2566 #include <ws2tcpip.h>
2568 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2571 if cc_check
$_ld_sock ; then
2575 if test "$_inet6" = yes ; then
2576 def_inet6
='#define HAVE_AF_INET6 1'
2578 def_inet6
='#undef HAVE_AF_INET6'
2583 echocheck
"gethostbyname2"
2584 if test "$_gethostbyname2" = auto
; then
2586 #include <sys/types.h>
2587 #include <sys/socket.h>
2589 int main(void) { gethostbyname2("", AF_INET); return 0; }
2596 if test "$_gethostbyname2" = yes ; then
2597 def_gethostbyname2
='#define HAVE_GETHOSTBYNAME2 1'
2599 def_gethostbyname2
='#undef HAVE_GETHOSTBYNAME2'
2601 echores
"$_gethostbyname2"
2604 echocheck
"inttypes.h (required)"
2606 header_check inttypes.h
&& _inttypes
=yes
2607 echores
"$_inttypes"
2609 if test "$_inttypes" = no
; then
2610 echocheck
"sys/bitypes.h (inttypes.h predecessor)"
2611 header_check sys
/bitypes.h
&& _inttypes
=yes
2612 if test "$_inttypes" = yes ; then
2613 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."
2615 die
"Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2620 echocheck
"alloca.h"
2622 statement_check alloca.h
'alloca(0)' && _alloca
=yes
2624 def_alloca_h
='#define HAVE_ALLOCA_H 1'
2626 def_alloca_h
='#undef HAVE_ALLOCA_H'
2631 echocheck
"fastmemcpy"
2632 if test "$_fastmemcpy" = yes ; then
2633 def_fastmemcpy
='#define CONFIG_FASTMEMCPY 1'
2635 def_fastmemcpy
='#undef CONFIG_FASTMEMCPY'
2637 echores
"$_fastmemcpy"
2642 statement_check sys
/mman.h
'mmap(0, 0, 0, 0, 0, 0)' && _mman
=yes
2643 if test "$_mman" = yes ; then
2644 def_mman_h
='#define HAVE_SYS_MMAN_H 1'
2646 def_mman_h
='#undef HAVE_SYS_MMAN_H'
2650 _mman_has_map_failed
=no
2651 statement_check sys
/mman.h
'void *p = MAP_FAILED' && _mman_has_map_failed
=yes
2652 if test "$_mman_has_map_failed" = yes ; then
2653 def_mman_has_map_failed
=''
2655 def_mman_has_map_failed
='#define MAP_FAILED ((void *) -1)'
2658 echocheck
"dynamic loader"
2660 for _ld_tmp
in "" "-ldl"; do
2661 statement_check dlfcn.h
'dlopen("", 0)' $_ld_tmp && _ld_dl
="$_ld_tmp" && _dl
=yes && break
2663 if test "$_dl" = yes ; then
2664 def_dl
='#define HAVE_LIBDL 1'
2666 def_dl
='#undef HAVE_LIBDL'
2673 THREAD_CFLAGS
=-D_REENTRANT
2674 elif freebsd || netbsd || openbsd || bsdos
; then
2675 THREAD_CFLAGS
=-D_THREAD_SAFE
2677 if test "$_pthreads" = auto
; then
2679 #include <pthread.h>
2680 static void *func(void *arg) { return arg; }
2683 #ifdef PTW32_STATIC_LIB
2684 pthread_win32_process_attach_np();
2685 pthread_win32_thread_attach_np();
2687 return pthread_create (&tid, 0, func, 0) != 0;
2692 for _ld_tmp
in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2693 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2694 cc_check
$THREAD_CFLAGS $_ld_tmp && (tmp_run ||
test "$_ld_static") && _ld_pthread
="$_ld_tmp" && _pthreads
=yes && break
2696 if test "$_pthreads" = no
&& mingw32
; then
2697 _ld_tmp
="-lpthreadGC2 -lws2_32"
2698 cc_check
$_ld_tmp -DPTW32_STATIC_LIB && (tmp_run ||
test "$_ld_static") && _ld_pthread
="$_ld_tmp" && _pthreads
=yes && CFLAGS
="$CFLAGS -DPTW32_STATIC_LIB"
2702 if test "$_pthreads" = yes ; then
2703 test $_ld_pthread && res_comment
="using $_ld_pthread"
2704 def_pthreads
='#define HAVE_PTHREADS 1'
2705 extra_cflags
="$extra_cflags $THREAD_CFLAGS"
2707 res_comment
="v4l2, win32 loader disabled"
2708 def_pthreads
='#undef HAVE_PTHREADS'
2710 mingw32 || _win32dll
=no
2712 echores
"$_pthreads"
2715 if test "$_pthreads" = yes ; then
2716 def_pthread_cache
="#define PTHREAD_CACHE 1"
2719 def_stream_cache
="#undef CONFIG_STREAM_CACHE"
2723 echocheck
"w32threads"
2724 if test "$_pthreads" = yes ; then
2725 res_comment
="using pthread instead"
2728 if test "$_w32threads" = auto
; then
2730 mingw32
&& _w32threads
=yes
2732 echores
"$_w32threads"
2735 if test "$_rpath" = yes ; then
2736 for I
in $
(echo $extra_ldflags |
sed 's/-L//g') ; do
2737 tmp
="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
2744 if test "$_iconv" = auto
; then
2749 #define INBUFSIZE 1024
2750 #define OUTBUFSIZE 4096
2752 char inbuffer[INBUFSIZE];
2753 char outbuffer[OUTBUFSIZE];
2758 char *tocode="UTF-8";
2759 char *fromcode="cp1250";
2760 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
2761 while ((numread = read(0, inbuffer, INBUFSIZE))) {
2762 char *iptr=inbuffer;
2763 char *optr=outbuffer;
2764 size_t inleft=numread;
2765 size_t outleft=OUTBUFSIZE;
2766 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
2768 write(1, outbuffer, OUTBUFSIZE - outleft);
2771 if (iconv_close(icdsc) == -1)
2778 for _ld_tmp
in "" "-liconv" "-liconv $_ld_dl" ; do
2779 cc_check
$_ld_lm $_ld_tmp && extra_ldflags
="$extra_ldflags $_ld_tmp" &&
2782 if test "$_iconv" != yes ; then
2783 die
"Unable to find iconv which should be part of standard compilation environment. Aborting. If you really mean to compile without iconv support use --disable-iconv."
2786 if test "$_iconv" = yes ; then
2787 def_iconv
='#define CONFIG_ICONV 1'
2789 def_iconv
='#undef CONFIG_ICONV'
2794 echocheck
"soundcard.h"
2796 def_soundcard_h
='#undef HAVE_SOUNDCARD_H'
2797 def_sys_soundcard_h
='#undef HAVE_SYS_SOUNDCARD_H'
2798 for _soundcard_header
in "sys/soundcard.h" "soundcard.h"; do
2799 header_check
$_soundcard_header && _soundcard_h
=yes &&
2800 res_comment
="$_soundcard_header" && break
2803 if test "$_soundcard_h" = yes ; then
2804 if test $_soundcard_header = "sys/soundcard.h"; then
2805 def_sys_soundcard_h
='#define HAVE_SYS_SOUNDCARD_H 1'
2807 def_soundcard_h
='#define HAVE_SOUNDCARD_H 1'
2810 echores
"$_soundcard_h"
2813 echocheck
"sys/videoio.h"
2815 def_sys_videoio_h
='#undef HAVE_SYS_VIDEOIO_H'
2816 header_check sys
/videoio.h
&& sys_videoio_h
=yes &&
2817 def_sys_videoio_h
='#define HAVE_SYS_VIDEOIO_H 1'
2818 echores
"$sys_videoio_h"
2821 echocheck
"sys/dvdio.h"
2823 # FreeBSD 8.1 has broken dvdio.h
2824 header_check_broken sys
/types.h sys
/dvdio.h
&& _dvdio
=yes
2825 if test "$_dvdio" = yes ; then
2826 def_dvdio
='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
2828 def_dvdio
='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
2833 echocheck
"sys/cdio.h"
2835 # at least OpenSolaris has a broken cdio.h
2836 header_check_broken sys
/types.h sys
/cdio.h
&& _cdio
=yes
2837 if test "$_cdio" = yes ; then
2838 def_cdio
='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
2840 def_cdio
='#undef DVD_STRUCT_IN_SYS_CDIO_H'
2845 echocheck
"linux/cdrom.h"
2847 header_check linux
/cdrom.h
&& _cdrom
=yes
2848 if test "$_cdrom" = yes ; then
2849 def_cdrom
='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
2851 def_cdrom
='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
2858 header_check dvd.h
&& _dvd
=yes
2859 if test "$_dvd" = yes ; then
2860 def_dvd
='#define DVD_STRUCT_IN_DVD_H 1'
2862 def_dvd
='#undef DVD_STRUCT_IN_DVD_H'
2868 echocheck
"BSDI dvd.h"
2870 header_check dvd.h
&& _bsdi_dvd
=yes
2871 if test "$_bsdi_dvd" = yes ; then
2872 def_bsdi_dvd
='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
2874 def_bsdi_dvd
='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
2876 echores
"$_bsdi_dvd"
2881 # also used by AIX, but AIX does not support VCD and/or libdvdread
2882 echocheck
"HP-UX SCSI header"
2884 header_check sys
/scsi.h
&& _hpux_scsi_h
=yes
2885 if test "$_hpux_scsi_h" = yes ; then
2886 def_hpux_scsi_h
='#define HPUX_SCTL_IO 1'
2888 def_hpux_scsi_h
='#undef HPUX_SCTL_IO'
2890 echores
"$_hpux_scsi_h"
2895 if test "$_termcap" = auto
; then
2897 for _ld_tmp
in "-lncurses" "-ltinfo" "-ltermcap"; do
2898 statement_check term.h
'tgetent(0, 0)' $_ld_tmp &&
2899 extra_ldflags
="$extra_ldflags $_ld_tmp" && _termcap
=yes && break
2902 if test "$_termcap" = yes ; then
2903 def_termcap
='#define HAVE_TERMCAP 1'
2904 test $_ld_tmp && res_comment
="using $_ld_tmp"
2906 def_termcap
='#undef HAVE_TERMCAP'
2912 def_termios
='#undef HAVE_TERMIOS'
2913 def_termios_h
='#undef HAVE_TERMIOS_H'
2914 def_termios_sys_h
='#undef HAVE_SYS_TERMIOS_H'
2915 if test "$_termios" = auto
; then
2917 for _termios_header
in "termios.h" "sys/termios.h"; do
2918 header_check
$_termios_header && _termios
=yes &&
2919 res_comment
="using $_termios_header" && break
2923 if test "$_termios" = yes ; then
2924 def_termios
='#define HAVE_TERMIOS 1'
2925 if test "$_termios_header" = "termios.h" ; then
2926 def_termios_h
='#define HAVE_TERMIOS_H 1'
2928 def_termios_sys_h
='#define HAVE_SYS_TERMIOS_H 1'
2935 if test "$_shm" = auto
; then
2937 statement_check sys
/shm.h
'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm
=yes
2939 if test "$_shm" = yes ; then
2940 def_shm
='#define HAVE_SHM 1'
2942 def_shm
='#undef HAVE_SHM'
2947 echocheck
"strsep()"
2949 statement_check string.h
'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep
=yes
2950 if test "$_strsep" = yes ; then
2951 def_strsep
='#define HAVE_STRSEP 1'
2954 def_strsep
='#undef HAVE_STRSEP'
2960 echocheck
"vsscanf()"
2962 #define _ISOC99_SOURCE
2965 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
2968 cc_check
&& _vsscanf
=yes
2969 if test "$_vsscanf" = yes ; then
2970 def_vsscanf
='#define HAVE_VSSCANF 1'
2973 def_vsscanf
='#undef HAVE_VSSCANF'
2981 define_statement_check
"_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
2982 statement_check
"string.h" 'int a, b; swab(&a, &b, 0)' && _swab
=yes
2983 if test "$_swab" = yes ; then
2984 def_swab
='#define HAVE_SWAB 1'
2987 def_swab
='#undef HAVE_SWAB'
2992 echocheck
"POSIX select()"
2996 #include <sys/types.h>
2998 #include <sys/time.h>
3000 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3003 def_posix_select
='#undef HAVE_POSIX_SELECT'
3004 cc_check
&& _posix_select
=yes &&
3005 def_posix_select
='#define HAVE_POSIX_SELECT 1'
3006 echores
"$_posix_select"
3009 echocheck
"audio select()"
3010 if test "$_select" = no
; then
3011 def_select
='#undef HAVE_AUDIO_SELECT'
3012 elif test "$_select" = yes ; then
3013 def_select
='#define HAVE_AUDIO_SELECT 1'
3018 echocheck
"gettimeofday()"
3020 statement_check sys
/time.h
'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday
=yes
3021 if test "$_gettimeofday" = yes ; then
3022 def_gettimeofday
='#define HAVE_GETTIMEOFDAY 1'
3023 need_gettimeofday
=no
3025 def_gettimeofday
='#undef HAVE_GETTIMEOFDAY'
3026 need_gettimeofday
=yes
3028 echores
"$_gettimeofday"
3033 statement_check glob.h
'glob("filename", 0, 0, 0)' && _glob
=yes
3035 if test "$_glob" = yes ; then
3036 def_glob
='#define HAVE_GLOB 1'
3038 def_glob
='#undef HAVE_GLOB'
3039 # HACK! need_glob currently enables compilation of a
3040 # win32-specific glob()-replacement.
3041 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3042 win32
&& need_glob
=yes
3047 echocheck
"setenv()"
3049 statement_check stdlib.h
'setenv("", "", 0)' && _setenv
=yes
3050 if test "$_setenv" = yes ; then
3051 def_setenv
='#define HAVE_SETENV 1'
3054 def_setenv
='#undef HAVE_SETENV'
3060 echocheck
"setmode()"
3062 def_setmode
='#define HAVE_SETMODE 0'
3063 statement_check io.h
'setmode(0, 0)' && _setmode
=yes && def_setmode
='#define HAVE_SETMODE 1'
3067 echocheck
"sys/sysinfo.h"
3069 statement_check sys
/sysinfo.h
'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo
=yes
3070 if test "$_sys_sysinfo" = yes ; then
3071 def_sys_sysinfo_h
='#define HAVE_SYS_SYSINFO_H 1'
3073 def_sys_sysinfo_h
='#undef HAVE_SYS_SYSINFO_H'
3075 echores
"$_sys_sysinfo"
3080 echocheck
"Mac OS X Finder Support"
3081 def_macosx_finder
='#undef CONFIG_MACOSX_FINDER'
3082 if test "$_macosx_finder" = yes ; then
3083 def_macosx_finder
='#define CONFIG_MACOSX_FINDER 1'
3084 extra_ldflags
="$extra_ldflags -framework Cocoa"
3086 echores
"$_macosx_finder"
3088 echocheck
"Mac OS X Bundle file locations"
3089 def_macosx_bundle
='#undef CONFIG_MACOSX_BUNDLE'
3090 test "$_macosx_bundle" = auto
&& _macosx_bundle
=$_macosx_finder
3091 if test "$_macosx_bundle" = yes ; then
3092 def_macosx_bundle
='#define CONFIG_MACOSX_BUNDLE 1'
3094 echores
"$_macosx_bundle"
3096 echocheck
"Apple Remote"
3097 if test "$_apple_remote" = auto
; then
3101 #include <IOKit/IOCFPlugIn.h>
3103 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3104 CFMutableDictionaryRef hidMatchDictionary;
3105 IOReturn ioReturnValue;
3107 // Set up a matching dictionary to search the I/O Registry by class.
3108 // name for all HID class devices
3109 hidMatchDictionary = IOServiceMatching("AppleIRController");
3111 // Now search I/O Registry for matching devices.
3112 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3113 hidMatchDictionary, &hidObjectIterator);
3115 // If search is unsuccessful, return nonzero.
3116 if (ioReturnValue != kIOReturnSuccess ||
3117 !IOIteratorIsValid(hidObjectIterator)) {
3123 cc_check
-framework IOKit
&& _apple_remote
=yes
3125 if test "$_apple_remote" = yes ; then
3126 def_apple_remote
='#define CONFIG_APPLE_REMOTE 1'
3127 libs_mplayer
="$libs_mplayer -framework IOKit -framework Cocoa"
3129 def_apple_remote
='#undef CONFIG_APPLE_REMOTE'
3131 echores
"$_apple_remote"
3137 echocheck
"Apple IR"
3138 if test "$_apple_ir" = auto
; then
3140 statement_check linux
/input.h
'struct input_event ev; struct input_id id' && _apple_ir
=yes
3142 if test "$_apple_ir" = yes ; then
3143 def_apple_ir
='#define CONFIG_APPLE_IR 1'
3145 def_apple_ir
='#undef CONFIG_APPLE_IR'
3147 echores
"$_apple_ir"
3150 echocheck
"pkg-config"
3151 if $
($_pkg_config --version > /dev
/null
2>&1); then
3152 if test "$_ld_static"; then
3153 _pkg_config
="$_pkg_config --static"
3162 echocheck
"Samba support (libsmbclient)"
3163 if test "$_smb" = yes; then
3164 extra_ldflags
="$extra_ldflags -lsmbclient"
3166 if test "$_smb" = auto
; then
3168 for _ld_tmp
in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3169 statement_check libsmbclient.h
'smbc_opendir("smb://")' $_ld_tmp &&
3170 extra_ldflags
="$extra_ldflags $_ld_tmp" && _smb
=yes && break
3174 if test "$_smb" = yes; then
3175 def_smb
="#define CONFIG_LIBSMBCLIENT 1"
3176 inputmodules
="smb $inputmodules"
3178 def_smb
="#undef CONFIG_LIBSMBCLIENT"
3179 noinputmodules
="smb $noinputmodules"
3183 echocheck
"libquvi support"
3184 if test "$_libquvi" = auto
; then
3186 if pkg_config_add
'libquvi >= 0.4.1' ; then
3190 if test "$_libquvi" = yes; then
3191 def_libquvi
="#define CONFIG_LIBQUVI 1"
3193 def_libquvi
="#undef CONFIG_LIBQUVI"
3203 if test "$_tga" = yes ; then
3204 def_tga
='#define CONFIG_TGA 1'
3205 vomodules
="tga $vomodules"
3207 def_tga
='#undef CONFIG_TGA'
3208 novomodules
="tga $novomodules"
3213 echocheck
"md5sum support"
3214 if test "$_md5sum" = yes; then
3215 def_md5sum
="#define CONFIG_MD5SUM 1"
3216 vomodules
="md5sum $vomodules"
3218 def_md5sum
="#undef CONFIG_MD5SUM"
3219 novomodules
="md5sum $novomodules"
3224 echocheck
"yuv4mpeg support"
3225 if test "$_yuv4mpeg" = yes; then
3226 def_yuv4mpeg
="#define CONFIG_YUV4MPEG 1"
3227 vomodules
="yuv4mpeg $vomodules"
3229 def_yuv4mpeg
="#undef CONFIG_YUV4MPEG"
3230 novomodules
="yuv4mpeg $novomodules"
3232 echores
"$_yuv4mpeg"
3235 echocheck
"DirectFB"
3236 if test "$_directfb" = auto
; then
3239 #include <directfb.h>
3240 #include <directfb_version.h>
3241 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3242 #error "DirectFB version too old."
3244 int main(void) { DirectFBInit(0, 0); return 0; }
3246 for _inc_tmp
in "" -I/usr
/local
/include
/directfb
-I/usr
/include
/directfb
-I/usr
/local
/include
; do
3247 cc_check
$_inc_tmp -ldirectfb &&
3248 _directfb
=yes && extra_cflags
="$extra_cflags $_inc_tmp" && break
3251 if test "$_directfb" = yes ; then
3252 def_directfb
='#define CONFIG_DIRECTFB 1'
3253 vomodules
="directfb $vomodules"
3254 libs_mplayer
="$libs_mplayer -ldirectfb"
3256 def_directfb
='#undef CONFIG_DIRECTFB'
3257 novomodules
="directfb $novomodules"
3259 echores
"$_directfb"
3264 echocheck
"QuickTime"
3265 if test "$quicktime" = auto
; then
3267 statement_check QuickTime
/QuickTime.h
'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime
&& quicktime
=yes
3269 if test "$quicktime" = yes ; then
3270 extra_ldflags
="$extra_ldflags -framework QuickTime"
3271 def_quicktime
='#define CONFIG_QUICKTIME 1'
3273 def_quicktime
='#undef CONFIG_QUICKTIME'
3278 if test "$_cocoa" = auto
; then
3280 #include <CoreServices/CoreServices.h>
3281 #include <OpenGL/OpenGL.h>
3283 NSApplicationLoad();
3287 cc_check
-framework IOKit
-framework Cocoa
-framework OpenGL
&& _cocoa
=yes
3289 if test "$_cocoa" = yes ; then
3290 libs_mplayer
="$libs_mplayer -framework IOKit -framework Cocoa -framework OpenGL"
3291 def_cocoa
='#define CONFIG_COCOA 1'
3293 def_cocoa
='#undef CONFIG_COCOA'
3297 echocheck
"CoreVideo"
3298 if test "$_cocoa" = yes && test "$_corevideo" = auto
; then
3300 #include <QuartzCore/CoreVideo.h>
3301 int main(void) { return 0; }
3304 cc_check
-framework Cocoa
-framework QuartzCore
-framework OpenGL
&& _corevideo
=yes
3306 if test "$_corevideo" = yes ; then
3307 vomodules
="corevideo $vomodules"
3308 libs_mplayer
="$libs_mplayer -framework QuartzCore"
3309 def_corevideo
='#define CONFIG_COREVIDEO 1'
3311 novomodules
="corevideo $novomodules"
3312 def_corevideo
='#undef CONFIG_COREVIDEO'
3314 echores
"$_corevideo"
3316 echocheck
"SharedBuffer"
3317 if test "$_sharedbuffer" = auto
; then
3320 NSApplicationLoad();
3324 cc_check
-framework Cocoa
&& _sharedbuffer
=yes
3326 if test "$_sharedbuffer" = yes ; then
3327 vomodules
="sharedbuffer $vomodules"
3328 libs_mplayer
="$libs_mplayer -framework Cocoa"
3329 def_sharedbuffer
='#define CONFIG_SHAREDBUFFER 1'
3331 novomodules
="sharedbuffer $novomodules"
3332 def_sharedbuffer
='#undef CONFIG_SHAREDBUFFER'
3334 echores
"$_sharedbuffer"
3336 depends_on_application_services
(){
3337 test "$_corevideo" = yes
3343 echocheck
"X11 headers presence"
3345 res_comment
="check if the dev(el) packages are installed"
3346 for I
in $
(echo $extra_cflags |
sed s
/-I//g
) /usr
/include
; do
3347 if test -f "$I/X11/Xlib.h" ; then
3353 if test $_cross_compile = no
; then
3354 for I
in /usr
/X11
/include
/usr
/X11R
7/include
/usr
/local
/include
/usr
/X11R
6/include \
3355 /usr
/include
/X11R6
/usr
/openwin
/include
; do
3356 if test -f "$I/X11/Xlib.h" ; then
3357 extra_cflags
="$extra_cflags -I$I"
3359 res_comment
="using $I"
3364 echores
"$_x11_headers"
3368 if test "$_x11" = auto
&& test "$_x11_headers" = yes ; then
3369 for I
in "" -L/usr
/X11R
7/lib
-L/usr
/local
/lib
-L/usr
/X11R
6/lib
-L/usr
/lib
/X11R6 \
3370 -L/usr
/X11
/lib
-L/usr
/lib32
-L/usr
/openwin
/lib
-L/usr
/local
/lib64
-L/usr
/X11R
6/lib64 \
3373 _ld_tmp
="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3375 _ld_tmp
="$I -lXext -lX11 $_ld_pthread"
3377 statement_check X11
/Xutil.h
'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3379 # Check that there aren't conflicting headers between ApplicationServices
3380 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3381 # is included by -framework ApplicationServices and clashes with the X11
3382 # definition of the "Cursor" type.
3383 if darwin
&& depends_on_application_services
&& test "$_x11" = yes ; then
3385 header_check_broken ApplicationServices
/ApplicationServices.h \
3386 X11
/Xutil.h
$_ld_tmp && _x11
=yes
3388 if test "$_x11" = yes ; then
3389 libs_mplayer
="$libs_mplayer $_ld_tmp"
3394 if test "$_x11" = yes ; then
3395 def_x11
='#define CONFIG_X11 1'
3396 vomodules
="x11 $vomodules"
3399 def_x11
='#undef CONFIG_X11'
3400 novomodules
="x11 $novomodules"
3401 res_comment
="check if the dev(el) packages are installed"
3405 echocheck
"Xss screensaver extensions"
3406 if test "$_xss" = auto
; then
3408 statement_check
"X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss
=yes
3410 if test "$_xss" = yes ; then
3411 def_xss
='#define CONFIG_XSS 1'
3412 libs_mplayer
="$libs_mplayer -lXss"
3414 def_xss
='#undef CONFIG_XSS'
3421 if test "$_x11" = yes ; then
3423 #include <X11/Xmd.h>
3424 #include <X11/Xlib.h>
3425 #include <X11/Xutil.h>
3426 #include <X11/Xatom.h>
3427 #include <X11/extensions/dpms.h>
3428 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3430 cc_check
-lXdpms && _xdpms3
=yes
3431 statement_check_broken X11
/Xlib.h X11
/extensions
/dpms.h
'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4
=yes
3433 if test "$_xdpms4" = yes ; then
3434 def_xdpms
='#define CONFIG_XDPMS 1'
3435 res_comment
="using Xdpms 4"
3437 elif test "$_xdpms3" = yes ; then
3438 def_xdpms
='#define CONFIG_XDPMS 1'
3439 libs_mplayer
="$libs_mplayer -lXdpms"
3440 res_comment
="using Xdpms 3"
3443 def_xdpms
='#undef CONFIG_XDPMS'
3449 if test "$_xv" = auto
&& test "$_x11" = yes ; then
3451 statement_check_broken X11
/Xlib.h X11
/extensions
/Xvlib.h
'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv
=yes
3454 if test "$_xv" = yes ; then
3455 def_xv
='#define CONFIG_XV 1'
3456 libs_mplayer
="$libs_mplayer -lXv"
3457 vomodules
="xv $vomodules"
3459 def_xv
='#undef CONFIG_XV'
3460 novomodules
="xv $novomodules"
3466 if test "$_vdpau" = auto
&& test "$_x11" = yes ; then
3468 if test "$_dl" = yes ; then
3469 pkg_config_add
'vdpau >= 0.2' && _vdpau
=yes
3472 if test "$_vdpau" = yes ; then
3473 def_vdpau
='#define CONFIG_VDPAU 1'
3474 vomodules
="vdpau $vomodules"
3476 def_vdpau
='#define CONFIG_VDPAU 0'
3477 novomodules
="vdpau $novomodules"
3482 echocheck
"Xinerama"
3483 if test "$_xinerama" = auto
&& test "$_x11" = yes ; then
3485 statement_check X11
/extensions
/Xinerama.h
'XineramaIsActive(0)' -lXinerama && _xinerama
=yes
3488 if test "$_xinerama" = yes ; then
3489 def_xinerama
='#define CONFIG_XINERAMA 1'
3490 libs_mplayer
="$libs_mplayer -lXinerama"
3492 def_xinerama
='#undef CONFIG_XINERAMA'
3494 echores
"$_xinerama"
3497 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3498 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3499 # named 'X extensions' or something similar.
3500 # This check may be useful for future mplayer versions (to change resolution)
3501 # If you run into problems, remove '-lXxf86vm'.
3503 if test "$_vm" = auto
&& test "$_x11" = yes ; then
3505 statement_check_broken X11
/Xlib.h X11
/extensions
/xf86vmode.h
'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm
=yes
3507 if test "$_vm" = yes ; then
3508 def_vm
='#define CONFIG_XF86VM 1'
3509 libs_mplayer
="$libs_mplayer -lXxf86vm"
3511 def_vm
='#undef CONFIG_XF86VM'
3515 # Check for the presence of special keycodes, like audio control buttons
3516 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3517 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3518 # have these new keycodes.
3519 echocheck
"XF86keysym"
3520 if test "$_xf86keysym" = auto
&& test "$_x11" = yes ; then
3522 return_check X11
/XF86keysym.h XF86XK_AudioPause
&& _xf86keysym
=yes
3524 if test "$_xf86keysym" = yes ; then
3525 def_xf86keysym
='#define CONFIG_XF86XK 1'
3527 def_xf86keysym
='#undef CONFIG_XF86XK'
3529 echores
"$_xf86keysym"
3533 if test "$_caca" = auto
; then
3535 pkg_config_add
'caca' && _caca
=yes
3537 if test "$_caca" = yes ; then
3538 def_caca
='#define CONFIG_CACA 1'
3539 vomodules
="caca $vomodules"
3541 def_caca
='#undef CONFIG_CACA'
3542 novomodules
="caca $novomodules"
3548 if test "$_dvb" = auto
; then
3552 #include <sys/ioctl.h>
3556 #include <linux/dvb/dmx.h>
3557 #include <linux/dvb/frontend.h>
3558 #include <linux/dvb/video.h>
3559 #include <linux/dvb/audio.h>
3560 int main(void) {return 0;}
3562 for _inc_tmp
in "" "-I/usr/src/DVB/include" ; do
3563 cc_check
$_inc_tmp && _dvb
=yes &&
3564 extra_cflags
="$extra_cflags $_inc_tmp" && break
3568 if test "$_dvb" = yes ; then
3570 inputmodules
="dvb $inputmodules"
3571 def_dvbin
='#define CONFIG_DVBIN 1'
3574 noinputmodules
="dvb $noinputmodules"
3575 def_dvbin
='#undef CONFIG_DVBIN '
3579 echocheck
"PNG support"
3580 if test "$_png" = auto
; then
3587 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
3588 printf("libpng: %s\n", png_libpng_ver);
3589 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
3592 cc_check
-lpng -lz $_ld_lm && _png
=yes
3595 if test "$_png" = yes ; then
3596 def_png
='#define CONFIG_PNG 1'
3597 extra_ldflags
="$extra_ldflags -lpng -lz"
3599 def_png
='#undef CONFIG_PNG'
3602 echocheck
"MNG support"
3603 if test "$_mng" = auto
; then
3605 return_statement_check libmng.h
'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng
=yes
3608 if test "$_mng" = yes ; then
3609 def_mng
='#define CONFIG_MNG 1'
3610 extra_ldflags
="$extra_ldflags -lmng -lz"
3612 def_mng
='#undef CONFIG_MNG'
3615 echocheck
"JPEG support"
3616 if test "$_jpeg" = auto
; then
3618 header_check_broken stdio.h jpeglib.h
-ljpeg $_ld_lm && _jpeg
=yes
3622 if test "$_jpeg" = yes ; then
3623 def_jpeg
='#define CONFIG_JPEG 1'
3624 vomodules
="jpeg $vomodules"
3625 extra_ldflags
="$extra_ldflags -ljpeg"
3627 def_jpeg
='#undef CONFIG_JPEG'
3628 novomodules
="jpeg $novomodules"
3633 echocheck
"PNM support"
3634 if test "$_pnm" = yes; then
3635 def_pnm
="#define CONFIG_PNM 1"
3636 vomodules
="pnm $vomodules"
3638 def_pnm
="#undef CONFIG_PNM"
3639 novomodules
="pnm $novomodules"
3645 echocheck
"GIF support"
3646 # This is to appease people who want to force gif support.
3647 # If it is forced to yes, then we still do checks to determine
3648 # which gif library to use.
3649 if test "$_gif" = yes ; then
3654 if test "$_gif" = auto
; then
3656 for _ld_gif
in "-lungif" "-lgif" ; do
3657 statement_check gif_lib.h
'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif
=yes && break
3661 # If no library was found, and the user wants support forced,
3662 # then we force it on with libgif, as this is the safest
3663 # assumption IMHO. (libungif & libregif both create symbolic
3664 # links to libgif. We also assume that no x11 support is needed,
3665 # because if you are forcing this, then you _should_ know what
3666 # you are doing. [ Besides, package maintainers should never
3667 # have compiled x11 deps into libungif in the first place. ] )
3670 if test "$_force_gif" = yes && test "$_gif" = no
; then
3675 if test "$_gif" = yes ; then
3676 def_gif
='#define CONFIG_GIF 1'
3677 codecmodules
="gif $codecmodules"
3678 vomodules
="gif89a $vomodules"
3679 res_comment
="old version, some encoding functions disabled"
3680 def_gif_4
='#undef CONFIG_GIF_4'
3681 extra_ldflags
="$extra_ldflags $_ld_gif"
3687 #include <gif_lib.h>
3688 static void catch(int sig) { exit(1); }
3690 signal(SIGSEGV, catch); // catch segfault
3691 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
3692 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
3696 if cc_check
"$_ld_gif" ; then
3697 def_gif_4
='#define CONFIG_GIF_4 1'
3701 def_gif
='#undef CONFIG_GIF'
3702 def_gif_4
='#undef CONFIG_GIF_4'
3703 novomodules
="gif89a $novomodules"
3704 nocodecmodules
="gif $nocodecmodules"
3709 case "$_gif" in yes*)
3710 echocheck
"broken giflib workaround"
3711 def_gif_tvt_hack
='#define CONFIG_GIF_TVT_HACK 1'
3715 #include <gif_lib.h>
3717 GifFileType gif = {.UserData = NULL};
3718 printf("UserData is at address %p\n", gif.UserData);
3722 if cc_check
"$_ld_gif" ; then
3723 def_gif_tvt_hack
='#undef CONFIG_GIF_TVT_HACK'
3740 def_sdl_sdl_h
="#undef CONFIG_SDL_SDL_H"
3741 if test -z "$_sdlconfig" ; then
3742 if ( sdl-config
--version ) >>"$TMPLOG" 2>&1 ; then
3743 _sdlconfig
="sdl-config"
3744 elif ( sdl11-config
--version ) >>"$TMPLOG" 2>&1 ; then
3745 _sdlconfig
="sdl11-config"
3750 if test "$_sdl" = auto ||
test "$_sdl" = yes ; then
3752 #ifdef CONFIG_SDL_SDL_H
3753 #include <SDL/SDL.h>
3758 // we allow SDL hacking our main() only on OSX
3761 int main(int argc, char *argv[]) {
3762 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
3767 for _ld_tmp
in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
3768 if cc_check
-DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
3770 def_sdl_sdl_h
="#define CONFIG_SDL_SDL_H 1"
3774 if test "$_sdl" = no
&& "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
3775 res_comment
="using $_sdlconfig"
3777 _inc_tmp
="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
3778 _ld_tmp
="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
3780 _inc_tmp
=$
($_sdlconfig --cflags |
sed s
/-Dmain=SDL_main
//)
3781 _ld_tmp
=$
($_sdlconfig --libs |
sed -e s
/-mwindows// -e s
/-lmingw32//)
3783 _inc_tmp
="$($_sdlconfig --cflags)"
3784 _ld_tmp
="$($_sdlconfig --libs)"
3786 if cc_check
$_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
3788 elif cc_check
$_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
3789 # HACK for BeOS/Haiku SDL
3790 _ld_tmp
="$_ld_tmp -lstdc++"
3795 if test "$_sdl" = yes ; then
3796 def_sdl
='#define CONFIG_SDL 1'
3797 extra_cflags
="$extra_cflags $_inc_tmp"
3798 libs_mplayer
="$libs_mplayer $_ld_tmp"
3799 vomodules
="sdl $vomodules"
3800 aomodules
="sdl $aomodules"
3802 def_sdl
='#undef CONFIG_SDL'
3803 novomodules
="sdl $novomodules"
3804 noaomodules
="sdl $noaomodules"
3809 # make sure this stays below CoreVideo to avoid issues due to namespace
3810 # conflicts between -lGL and -framework OpenGL
3812 #Note: this test is run even with --enable-gl since we autodetect linker flags
3813 if (test "$_x11" = yes ||
test "$_sdl" = yes ||
test "$_cocoa" = yes || win32
) && test "$_gl" != no
; then
3816 #include <windows.h>
3818 #elif defined(GL_SDL)
3820 #ifdef CONFIG_SDL_SDL_H
3821 #include <SDL/SDL.h>
3826 // we allow SDL hacking our main() only on OSX
3831 #include <X11/Xlib.h>
3834 int main(int argc, char *argv[]) {
3837 wglCreateContext(dc);
3838 #elif defined(GL_SDL)
3839 SDL_GL_SwapBuffers();
3841 glXCreateContext(NULL, NULL, NULL, True);
3848 if test "$_x11" = yes ; then
3849 for _ld_tmp
in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
3850 if cc_check
$_ld_tmp $_ld_lm ; then
3853 libs_mplayer
="$libs_mplayer $_ld_tmp $_ld_dl"
3858 if win32
&& cc_check
-DGL_WIN32 -lopengl32 ; then
3861 libs_mplayer
="$libs_mplayer -lopengl32 -lgdi32"
3863 if test "$_cocoa" = yes ; then
3867 # last so it can reuse any linker etc. flags detected before
3868 if test "$_sdl" = yes ; then
3869 if cc_check
-DGL_SDL ||
3870 cc_check
-DCONFIG_SDL_SDL_H -DGL_SDL ; then
3873 elif cc_check
-DGL_SDL -lGL ||
3874 cc_check
-DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
3877 libs_mplayer
="$libs_mplayer -lGL"
3883 if test "$_gl" = yes ; then
3884 def_gl
='#define CONFIG_GL 1'
3885 res_comment
="backends:"
3886 if test "$_gl_cocoa" = yes ; then
3887 def_gl_cocoa
='#define CONFIG_GL_COCOA 1'
3888 res_comment
="$res_comment cocoa"
3890 if test "$_gl_win32" = yes ; then
3891 def_gl_win32
='#define CONFIG_GL_WIN32 1'
3892 res_comment
="$res_comment win32"
3894 if test "$_gl_x11" = yes ; then
3895 def_gl_x11
='#define CONFIG_GL_X11 1'
3896 res_comment
="$res_comment x11"
3898 if test "$_gl_sdl" = yes ; then
3899 def_gl_sdl
='#define CONFIG_GL_SDL 1'
3900 res_comment
="$res_comment sdl"
3902 vomodules
="opengl $vomodules"
3904 def_gl
='#undef CONFIG_GL'
3905 def_gl_cocoa
='#undef CONFIG_GL_COCOA'
3906 def_gl_win32
='#undef CONFIG_GL_WIN32'
3907 def_gl_x11
='#undef CONFIG_GL_X11'
3908 def_gl_sdl
='#undef CONFIG_GL_SDL'
3909 novomodules
="opengl $novomodules"
3916 echocheck
"Direct3D"
3917 if test "$_direct3d" = auto
; then
3919 header_check d3d9.h
&& _direct3d
=yes
3921 if test "$_direct3d" = yes ; then
3922 def_direct3d
='#define CONFIG_DIRECT3D 1'
3923 vomodules
="direct3d $vomodules"
3925 def_direct3d
='#undef CONFIG_DIRECT3D'
3926 novomodules
="direct3d $novomodules"
3928 echores
"$_direct3d"
3931 if test "$_directx" = auto
; then
3935 int main(void) { return 0; }
3938 cc_check
-lgdi32 && _directx
=yes
3940 if test "$_directx" = yes ; then
3941 def_directx
='#define CONFIG_DIRECTX 1'
3942 libs_mplayer
="$libs_mplayer -lgdi32"
3943 vomodules
="directx $vomodules"
3944 aomodules
="dsound $aomodules"
3946 def_directx
='#undef CONFIG_DIRECTX'
3947 novomodules
="directx $novomodules"
3948 noaomodules
="dsound $noaomodules"
3955 echocheck
"V4L2 MPEG Decoder"
3956 if test "$_v4l2" = auto
; then
3958 #include <sys/time.h>
3959 #include <linux/videodev2.h>
3960 #include <linux/version.h>
3962 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
3963 #error kernel headers too old, need 2.6.22
3965 struct v4l2_ext_controls ctrls;
3966 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
3971 cc_check
&& _v4l2
=yes
3973 if test "$_v4l2" = yes ; then
3974 def_v4l2
='#define CONFIG_V4L2_DECODER 1'
3975 vomodules
="v4l2 $vomodules"
3976 aomodules
="v4l2 $aomodules"
3978 def_v4l2
='#undef CONFIG_V4L2_DECODER'
3979 novomodules
="v4l2 $novomodules"
3980 noaomodules
="v4l2 $noaomodules"
3991 echocheck
"OSS Audio"
3992 if test "$_ossaudio" = auto
; then
3994 return_check
$_soundcard_header SNDCTL_DSP_SETFRAGMENT
&& _ossaudio
=yes
3996 if test "$_ossaudio" = yes ; then
3997 def_ossaudio
='#define CONFIG_OSS_AUDIO 1'
3998 aomodules
="oss $aomodules"
4000 #include <$_soundcard_header>
4001 #ifdef OPEN_SOUND_SYSTEM
4002 int main(void) { return 0; }
4004 #error Not the real thing
4008 cc_check
&& _real_ossaudio
=yes
4009 if test "$_real_ossaudio" = yes; then
4010 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4011 # Check for OSS4 headers (override default headers)
4012 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4013 if test -f /etc
/oss.conf
; then
4015 _ossinc
="$OSSLIBDIR/include"
4016 if test -f "$_ossinc/sys/soundcard.h"; then
4017 extra_cflags
="-I$_ossinc $extra_cflags"
4020 elif netbsd || openbsd
; then
4021 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/sound"'
4022 extra_ldflags
="$extra_ldflags -lossaudio"
4024 def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4026 def_ossaudio_devmixer
='#define PATH_DEV_MIXER "/dev/mixer"'
4028 def_ossaudio
='#undef CONFIG_OSS_AUDIO'
4029 def_ossaudio_devdsp
='#define PATH_DEV_DSP ""'
4030 def_ossaudio_devmixer
='#define PATH_DEV_MIXER ""'
4031 noaomodules
="oss $noaomodules"
4033 echores
"$_ossaudio"
4037 if test "$_rsound" = auto
; then
4039 statement_check rsound.h
'rsd_init(NULL);' -lrsound && _rsound
=yes
4043 if test "$_rsound" = yes ; then
4044 def_rsound
='#define CONFIG_RSOUND 1'
4045 aomodules
="rsound $aomodules"
4046 libs_mplayer
="$libs_mplayer -lrsound"
4048 def_rsound
='#undef CONFIG_RSOUND'
4049 noaomodules
="rsound $noaomodules"
4054 if test "$_pulse" = auto
; then
4056 if pkg_config_add
'libpulse >= 0.9' ; then
4062 if test "$_pulse" = yes ; then
4063 def_pulse
='#define CONFIG_PULSE 1'
4064 aomodules
="pulse $aomodules"
4066 def_pulse
='#undef CONFIG_PULSE'
4067 noaomodules
="pulse $noaomodules"
4071 echocheck
"PortAudio"
4072 if test "$_portaudio" = auto
&& test "$_pthreads" != yes ; then
4074 res_comment
="pthreads not enabled"
4076 if test "$_portaudio" = auto
; then
4078 if pkg_config_add
'portaudio-2.0 >= 19' ; then
4082 echores
"$_portaudio"
4084 if test "$_portaudio" = yes ; then
4085 def_portaudio
='#define CONFIG_PORTAUDIO 1'
4086 aomodules
="portaudio $aomodules"
4088 def_portaudio
='#undef CONFIG_PORTAUDIO'
4089 noaomodules
="portaudio $noaomodules"
4094 if test "$_jack" = auto
; then
4096 if pkg_config_add jack
; then
4101 if test "$_jack" = yes ; then
4102 def_jack
='#define CONFIG_JACK 1'
4103 aomodules
="jack $aomodules"
4105 noaomodules
="jack $noaomodules"
4110 if test "$_openal" = auto
; then
4114 #include <OpenAL/al.h>
4119 alSourceQueueBuffers(0, 0, 0);
4120 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4124 for I
in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4125 cc_check
$I && _openal
=yes && break
4126 cc_check
-DOPENAL_AL_H=1 $I && def_openal_h
='#define OPENAL_AL_H 1' && _openal
=yes && break
4128 test "$_openal" = yes && libs_mplayer
="$libs_mplayer $I"
4130 if test "$_openal" = yes ; then
4131 def_openal
='#define CONFIG_OPENAL 1'
4132 aomodules
="openal $aomodules"
4134 noaomodules
="openal $noaomodules"
4138 echocheck
"ALSA audio"
4139 if test "$_alloca" != yes ; then
4141 res_comment
="alloca missing"
4143 if test "$_alsa" = auto
; then
4145 if pkg_config_add
"alsa >= 1.0.9" ; then
4149 def_alsa
='#undef CONFIG_ALSA'
4150 if test "$_alsa" = yes ; then
4151 aomodules
="alsa $aomodules"
4152 def_alsa
='#define CONFIG_ALSA 1'
4154 noaomodules
="alsa $noaomodules"
4160 echocheck
"CoreAudio"
4161 if test "$_coreaudio" = auto
; then
4163 #include <CoreAudio/CoreAudio.h>
4164 #include <AudioToolbox/AudioToolbox.h>
4165 #include <AudioUnit/AudioUnit.h>
4166 int main(void) { return 0; }
4169 cc_check
-framework CoreAudio
-framework AudioUnit
-framework AudioToolbox
&& _coreaudio
=yes
4171 if test "$_coreaudio" = yes ; then
4172 libs_mplayer
="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4173 def_coreaudio
='#define CONFIG_COREAUDIO 1'
4174 aomodules
="coreaudio $aomodules"
4176 def_coreaudio
='#undef CONFIG_COREAUDIO'
4177 noaomodules
="coreaudio $noaomodules"
4183 # set default CD/DVD devices
4185 default_cdrom_device
="D:"
4187 default_cdrom_device
="/dev/disk1"
4188 elif dragonfly
; then
4189 default_cdrom_device
="/dev/cd0"
4191 default_cdrom_device
="/dev/acd0"
4193 default_cdrom_device
="/dev/rcd0c"
4195 default_cdrom_device
="a1ide.device:2"
4197 default_cdrom_device
="/dev/cdrom"
4200 if win32 || dragonfly || freebsd || openbsd || amigaos
; then
4201 default_dvd_device
=$default_cdrom_device
4203 default_dvd_device
="/dev/rdiskN"
4205 default_dvd_device
="/dev/dvd"
4209 echocheck
"VCD support"
4210 if test "$_vcd" = auto
; then
4212 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin
; then
4215 header_check
ddk
/ntddcdrm.h
&& _vcd
=yes
4218 if test "$_vcd" = yes; then
4219 inputmodules
="vcd $inputmodules"
4220 def_vcd
='#define CONFIG_VCD 1'
4222 def_vcd
='#undef CONFIG_VCD'
4223 noinputmodules
="vcd $noinputmodules"
4224 res_comment
="not supported on this OS"
4230 echocheck
"Blu-ray support"
4231 if test "$_bluray" = auto
; then
4233 pkg_config_add
'libbluray >= 0.2.1' && _bluray
=yes
4235 if test "$_bluray" = yes ; then
4236 def_bluray
='#define CONFIG_LIBBLURAY 1'
4237 inputmodules
="bluray $inputmodules"
4239 def_bluray
='#undef CONFIG_LIBBLURAY'
4240 noinputmodules
="bluray $noinputmodules"
4245 if test "$_dvdread_internal" = auto
&& test ! -f "libdvdread4/dvd_reader.c" ; then
4246 _dvdread_internal
=no
4248 if test "$_dvdread_internal" = auto
; then
4249 _dvdread_internal
=no
4251 if (linux || freebsd || netbsd || openbsd || dragonfly || hpux
) &&
4252 (test "$_dvd" = yes ||
test "$_cdrom" = yes ||
test "$_cdio" = yes ||
4253 test "$_dvdio" = yes ||
test "$_bsdi_dvd" = yes) ||
4254 darwin || win32
; then
4255 _dvdread_internal
=yes
4257 extra_cflags
="-Ilibdvdread4 $extra_cflags"
4259 elif test "$_dvdread" = auto
; then
4261 if test "$_dl" = yes; then
4262 _dvdreadcflags
=$
($_dvdreadconfig --cflags 2> /dev
/null
)
4263 _dvdreadlibs
=$
($_dvdreadconfig --libs 2> /dev
/null
)
4264 if header_check dvdread
/dvd_reader.h
$_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
4266 extra_cflags
="$extra_cflags $_dvdreadcflags"
4267 extra_ldflags
="$extra_ldflags $_dvdreadlibs"
4268 res_comment
="external"
4273 if test "$_dvdread_internal" = yes; then
4274 def_dvdread
='#define CONFIG_DVDREAD 1'
4275 inputmodules
="dvdread(internal) $inputmodules"
4276 res_comment
="internal"
4277 elif test "$_dvdread" = yes; then
4278 def_dvdread
='#define CONFIG_DVDREAD 1'
4279 extra_ldflags
="$extra_ldflags -ldvdread"
4280 inputmodules
="dvdread(external) $inputmodules"
4281 res_comment
="external"
4283 def_dvdread
='#undef CONFIG_DVDREAD'
4284 noinputmodules
="dvdread $noinputmodules"
4289 echocheck
"internal libdvdcss"
4290 if test "$_libdvdcss_internal" = auto
; then
4291 _libdvdcss_internal
=no
4292 test "$_dvdread_internal" = yes && test -d libdvdcss
&& _libdvdcss_internal
=yes
4293 hpux
&& test "$_hpux_scsi_h" = no
&& _libdvdcss_internal
=no
4295 if test "$_libdvdcss_internal" = yes ; then
4296 if linux || netbsd || openbsd || bsdos
; then
4297 def_dvd_linux
='#define HAVE_LINUX_DVD_STRUCT 1'
4298 openbsd
&& def_dvd_openbsd
='#define HAVE_OPENBSD_DVD_STRUCT 1'
4299 elif freebsd || dragonfly
; then
4300 def_dvd_bsd
='#define HAVE_BSD_DVD_STRUCT 1'
4302 def_dvd_darwin
='#define DARWIN_DVD_IOCTL'
4303 extra_ldflags
="$extra_ldflags -framework IOKit -framework Carbon"
4305 cflags_libdvdcss
="-DSYS_CYGWIN -DWIN32"
4307 cflags_libdvdcss
="-DSYS_BEOS"
4309 cflags_libdvdcss_dvdread
="-Ilibdvdcss"
4310 def_dvdcss
="#define HAVE_DVDCSS_DVDCSS_H 1"
4311 inputmodules
="libdvdcss(internal) $inputmodules"
4313 noinputmodules
="libdvdcss(internal) $noinputmodules"
4315 echores
"$_libdvdcss_internal"
4319 if test "$_libcdio" = auto
; then
4321 if pkg_config_add libcdio_paranoia
; then
4325 if test "$_libcdio" = yes ; then
4327 def_cdda
='#define CONFIG_CDDA 1'
4328 test $_cddb = auto
&& test $networking = yes && _cddb
=yes
4329 inputmodules
="cdda $inputmodules"
4333 def_cdda
='#undef CONFIG_CDDA'
4334 noinputmodules
="cdda $noinputmodules"
4338 if test "$_cddb" = yes ; then
4339 def_cddb
='#define CONFIG_CDDB 1'
4340 inputmodules
="cddb $inputmodules"
4343 def_cddb
='#undef CONFIG_CDDB'
4344 noinputmodules
="cddb $noinputmodules"
4348 echocheck
"SSA/ASS support"
4349 if test "$_ass" = auto
; then
4350 if pkg_config_add libass
; then
4352 def_ass
='#define CONFIG_ASS 1'
4354 die
"Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
4357 def_ass
='#undef CONFIG_ASS'
4363 if test "$_enca" = auto
; then
4365 statement_check enca.h
'enca_get_languages(NULL)' -lenca $_ld_lm && _enca
=yes
4367 if test "$_enca" = yes ; then
4368 def_enca
='#define CONFIG_ENCA 1'
4369 extra_ldflags
="$extra_ldflags -lenca"
4371 def_enca
='#undef CONFIG_ENCA'
4378 statement_check zlib.h
'inflate(0, Z_NO_FLUSH)' -lz && _zlib
=yes
4379 if test "$_zlib" = yes ; then
4380 def_zlib
='#define CONFIG_ZLIB 1'
4381 extra_ldflags
="$extra_ldflags -lz"
4383 def_zlib
='#define CONFIG_ZLIB 0'
4389 if test "$_rtc" = auto
; then
4391 #include <sys/ioctl.h>
4393 #include <linux/rtc.h>
4396 #define RTC_PIE_ON RTCIO_PIE_ON
4398 int main(void) { return RTC_PIE_ON; }
4401 cc_check
&& _rtc
=yes
4404 if test "$_rtc" = yes ; then
4405 def_rtc
='#define HAVE_RTC 1'
4407 def_rtc
='#undef HAVE_RTC'
4412 echocheck
"mad support"
4413 if test "$_mad" = auto
; then
4415 header_check mad.h
-lmad && _mad
=yes
4417 if test "$_mad" = yes ; then
4418 def_mad
='#define CONFIG_LIBMAD 1'
4419 extra_ldflags
="$extra_ldflags -lmad"
4420 codecmodules
="libmad $codecmodules"
4422 def_mad
='#undef CONFIG_LIBMAD'
4423 nocodecmodules
="libmad $nocodecmodules"
4427 echocheck
"OggVorbis support"
4428 if test "$_libvorbis" = auto
; then
4430 statement_check vorbis
/codec.h
'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis
=yes && _tremor
=no
4431 elif test "$_libvorbis" = yes ; then
4434 if test "$_tremor" = auto
; then
4436 statement_check tremor
/ivorbiscodec.h
'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor
=yes
4438 if test "$_tremor" = yes ; then
4440 def_vorbis
='#define CONFIG_OGGVORBIS 1'
4441 def_tremor
='#define CONFIG_TREMOR 1'
4442 codecmodules
="tremor(external) $codecmodules"
4443 res_comment
="external Tremor"
4444 extra_ldflags
="$extra_ldflags -logg -lvorbisidec"
4445 elif test "$_libvorbis" = yes ; then
4447 def_vorbis
='#define CONFIG_OGGVORBIS 1'
4448 codecmodules
="libvorbis $codecmodules"
4449 res_comment
="libvorbis"
4450 extra_ldflags
="$extra_ldflags -lvorbis -logg"
4453 nocodecmodules
="libvorbis $nocodecmodules"
4457 echocheck
"libspeex (version >= 1.1 required)"
4458 if test "$_speex" = auto
; then
4462 #include <speex/speex.h>
4463 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
4465 cc_check
-lspeex $_ld_lm && _speex
=yes
4467 if test "$_speex" = yes ; then
4468 def_speex
='#define CONFIG_SPEEX 1'
4469 extra_ldflags
="$extra_ldflags -lspeex"
4470 codecmodules
="speex $codecmodules"
4472 def_speex
='#undef CONFIG_SPEEX'
4473 nocodecmodules
="speex $nocodecmodules"
4477 echocheck
"OggTheora support"
4478 if test "$_theora" = auto
; then
4480 if pkg_config_add theora
; then
4484 if test "$_theora" = yes ; then
4485 def_theora
='#define CONFIG_OGGTHEORA 1'
4486 codecmodules
="libtheora $codecmodules"
4488 def_theora
='#undef CONFIG_OGGTHEORA'
4489 nocodecmodules
="libtheora $nocodecmodules"
4493 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
4494 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
4495 echocheck
"mpg123 support"
4496 def_mpg123
='#undef CONFIG_MPG123'
4497 if test "$_mpg123" = auto
; then
4499 pkg_config_add
'libmpg123 >= 1.2.0' && _mpg123
=yes
4501 if test "$_mpg123" = yes ; then
4502 def_mpg123
='#define CONFIG_MPG123 1'
4503 codecmodules
="mpg123 $codecmodules"
4505 nocodecmodules
="mpg123 $nocodecmodules"
4509 echocheck
"liba52 support"
4510 def_liba52
='#undef CONFIG_LIBA52'
4511 if test "$_liba52" = auto
; then
4514 #include <inttypes.h>
4515 #include <a52dec/a52.h>
4516 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
4518 cc_check
-la52 && _liba52
=yes && extra_ldflags
="$extra_ldflags -la52"
4520 if test "$_liba52" = yes ; then
4521 def_liba52
='#define CONFIG_LIBA52 1'
4522 codecmodules
="liba52 $codecmodules"
4524 nocodecmodules
="liba52 $nocodecmodules"
4528 echocheck
"libdca support"
4529 if test "$_libdca" = auto
; then
4531 for _ld_dca
in -ldca -ldts ; do
4532 statement_check_broken stdint.h dts.h
'dts_init(0)' $_ld_dca $_ld_lm &&
4533 extra_ldflags
="$extra_ldflags $_ld_dca" && _libdca
=yes && break
4536 if test "$_libdca" = yes ; then
4537 def_libdca
='#define CONFIG_LIBDCA 1'
4538 codecmodules
="libdca $codecmodules"
4540 def_libdca
='#undef CONFIG_LIBDCA'
4541 nocodecmodules
="libdca $nocodecmodules"
4545 echocheck
"libmpcdec (musepack, version >= 1.2.1 required)"
4546 if test "$_musepack" = yes ; then
4550 #include <mpcdec/mpcdec.h>
4552 mpc_streaminfo info;
4553 mpc_decoder decoder;
4554 mpc_decoder_set_streaminfo(&decoder, &info);
4555 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
4559 cc_check
-lmpcdec $_ld_lm && _musepack
=yes
4561 if test "$_musepack" = yes ; then
4562 def_musepack
='#define CONFIG_MUSEPACK 1'
4563 extra_ldflags
="$extra_ldflags -lmpcdec"
4564 codecmodules
="musepack $codecmodules"
4566 def_musepack
='#undef CONFIG_MUSEPACK'
4567 nocodecmodules
="musepack $nocodecmodules"
4569 echores
"$_musepack"
4572 echocheck
"FAAD2 support"
4573 if test "$_faad" = auto
; then
4577 #ifndef FAAD_MIN_STREAMSIZE
4578 #error Too old version
4580 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
4581 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
4583 cc_check
-lfaad $_ld_lm && _faad
=yes
4586 def_faad
='#undef CONFIG_FAAD'
4587 if test "$_faad" = yes ; then
4588 def_faad
='#define CONFIG_FAAD 1'
4589 extra_ldflags
="$extra_ldflags -lfaad"
4590 codecmodules
="faad2 $codecmodules"
4592 nocodecmodules
="faad2 $nocodecmodules"
4597 echocheck
"LADSPA plugin support"
4598 if test "$_ladspa" = auto
; then
4600 statement_check ladspa.h
'LADSPA_Descriptor ld = {0}' && _ladspa
=yes
4602 if test "$_ladspa" = yes; then
4603 def_ladspa
="#define CONFIG_LADSPA 1"
4605 def_ladspa
="#undef CONFIG_LADSPA"
4610 echocheck
"libbs2b audio filter support"
4611 if test "$_libbs2b" = auto
; then
4613 if pkg_config_add libbs2b
; then
4617 def_libbs2b
="#undef CONFIG_LIBBS2B"
4618 test "$_libbs2b" = yes && def_libbs2b
="#define CONFIG_LIBBS2B 1"
4622 if test -z "$_codecsdir" ; then
4623 for dir
in "$_libdir/codecs" "$_libdir/win32" /usr
/local
/lib
/codecs \
4624 /usr
/lib
/codecs
/usr
/local
/lib
/win32
/usr
/lib
/win32
; do
4625 if test -d "$dir" ; then
4631 # Fall back on default directory.
4632 if test -z "$_codecsdir" ; then
4633 _codecsdir
="$_libdir/codecs"
4634 mingw32
&& _codecsdir
="codecs"
4638 echocheck
"Win32 codecs"
4639 if test "$_win32dll" = auto
; then
4641 if x86_32
&& ! qnx
; then
4645 if test "$_win32dll" = yes ; then
4646 def_win32dll
='#define CONFIG_WIN32DLL 1'
4648 def_win32_loader
='#define WIN32_LOADER 1'
4649 _win32_emulation
=yes
4651 extra_ldflags
="$extra_ldflags -ladvapi32 -lole32"
4652 res_comment
="using native windows"
4654 codecmodules
="win32 $codecmodules"
4656 def_win32dll
='#undef CONFIG_WIN32DLL'
4657 def_win32_loader
='#undef WIN32_LOADER'
4658 nocodecmodules
="win32 $nocodecmodules"
4660 echores
"$_win32dll"
4663 echocheck
"XAnim codecs"
4664 if test "$_xanim" = auto
; then
4666 res_comment
="dynamic loader support needed"
4667 if test "$_dl" = yes ; then
4671 if test "$_xanim" = yes ; then
4672 def_xanim
='#define CONFIG_XANIM 1'
4673 codecmodules
="xanim $codecmodules"
4675 def_xanim
='#undef CONFIG_XANIM'
4676 nocodecmodules
="xanim $nocodecmodules"
4681 echocheck
"RealPlayer codecs"
4682 if test "$_real" = auto
; then
4684 res_comment
="dynamic loader support needed"
4685 if test "$_dl" = yes ||
test "$_win32dll" = yes &&
4686 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32
) ; then
4690 if test "$_real" = yes ; then
4691 def_real
='#define CONFIG_REALCODECS 1'
4692 codecmodules
="real $codecmodules"
4694 def_real
='#undef CONFIG_REALCODECS'
4695 nocodecmodules
="real $nocodecmodules"
4700 echocheck
"QuickTime codecs"
4702 def_qtx_win32
='#undef CONFIG_QTX_CODECS_WIN32'
4703 if test "$_qtx" = auto
; then
4704 test "$_win32dll" = yes ||
test "$quicktime" = yes && _qtx
=yes
4706 if test "$_qtx" = yes ; then
4707 def_qtx
='#define CONFIG_QTX_CODECS 1'
4708 win32
&& _qtx_codecs_win32
=yes && def_qtx_win32
='#define CONFIG_QTX_CODECS_WIN32 1'
4709 codecmodules
="qtx $codecmodules"
4710 darwin || win32 || _qtx_emulation
=yes
4712 def_qtx
='#undef CONFIG_QTX_CODECS'
4713 nocodecmodules
="qtx $nocodecmodules"
4717 echocheck
"LCMS2 support"
4718 if test "$_lcms2" = auto
; then
4720 if pkg_config_add lcms2
; then
4724 if test "$_lcms2" = yes; then
4725 def_lcms2
="#define CONFIG_LCMS2 1"
4727 def_lcms2
="#undef CONFIG_LCMS2"
4732 all_libav_libs
="libavutil > 51.21.0:libavcodec >= 54.25.0:libavformat > 53.20.0:libswscale >= 2.0.0:libavresample >= 1.0.0"
4733 echocheck
"Libav ($all_libav_libs)"
4734 if test "$ffmpeg" = auto
; then
4735 IFS
=":" # shell should not be used for programming
4736 if ! pkg_config_add
$all_libav_libs ; then
4737 die
"Unable to find development files for some of the required Libav libraries above. Aborting."
4742 echocheck
"libpostproc >= 52.0.0"
4743 if test "$libpostproc" = auto
; then
4745 if pkg_config_add
"libpostproc >= 52.0.0" ; then
4749 if test "$libpostproc" = yes ; then
4750 def_libpostproc
='#define CONFIG_LIBPOSTPROC 1'
4752 def_libpostproc
='#undef CONFIG_LIBPOSTPROC'
4754 echores
"$libpostproc"
4756 echocheck
"libdv-0.9.5+"
4757 if test "$_libdv" = auto
; then
4759 statement_check libdv
/dv.h
'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv
=yes
4761 if test "$_libdv" = yes ; then
4762 def_libdv
='#define CONFIG_LIBDV095 1'
4763 extra_ldflags
="$extra_ldflags -ldv"
4764 codecmodules
="libdv $codecmodules"
4766 def_libdv
='#undef CONFIG_LIBDV095'
4767 nocodecmodules
="libdv $nocodecmodules"
4773 if test "$_xvid" = auto
; then
4775 for _ld_tmp
in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
4776 statement_check xvid.h
'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
4777 extra_ldflags
="$extra_ldflags $_ld_tmp" && _xvid
=yes && break
4781 if test "$_xvid" = yes ; then
4782 def_xvid
='#define CONFIG_XVID4 1'
4783 codecmodules
="xvid $codecmodules"
4785 def_xvid
='#undef CONFIG_XVID4'
4786 nocodecmodules
="xvid $nocodecmodules"
4792 if test "$_libnut" = auto
; then
4794 statement_check libnut.h
'nut_context_tt * nut; nut_error(0)' -lnut && _libnut
=yes
4797 if test "$_libnut" = yes ; then
4798 def_libnut
='#define CONFIG_LIBNUT 1'
4799 extra_ldflags
="$extra_ldflags -lnut"
4801 def_libnut
='#undef CONFIG_LIBNUT'
4806 echocheck
"UnRAR executable"
4807 if test "$_unrar_exec" = auto
; then
4809 mingw32
&& _unrar_exec
="no"
4811 if test "$_unrar_exec" = yes ; then
4812 def_unrar_exec
='#define CONFIG_UNRAR_EXEC 1'
4814 def_unrar_exec
='#undef CONFIG_UNRAR_EXEC'
4816 echores
"$_unrar_exec"
4818 echocheck
"TV interface"
4819 if test "$_tv" = yes ; then
4820 def_tv
='#define CONFIG_TV 1'
4821 inputmodules
="tv $inputmodules"
4823 noinputmodules
="tv $noinputmodules"
4824 def_tv
='#undef CONFIG_TV'
4829 if freebsd || netbsd || openbsd || dragonfly || bsdos
; then
4830 echocheck
"*BSD BT848 bt8xx header"
4832 for file in "machine/ioctl_bt848.h" \
4833 "dev/bktr/ioctl_bt848.h" \
4834 "dev/video/bktr/ioctl_bt848.h" \
4835 "dev/ic/bt8xx.h" ; do
4837 #include <sys/types.h>
4838 #include <sys/ioctl.h>
4840 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
4844 _ioctl_bt848_h_name
="$file"
4848 if test "$_ioctl_bt848_h" = yes ; then
4849 def_ioctl_bt848_h_name
="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
4850 res_comment
="using $_ioctl_bt848_h_name"
4852 def_ioctl_bt848_h_name
="#undef IOCTL_BT848_H_NAME"
4854 echores
"$_ioctl_bt848_h"
4856 echocheck
"*BSD ioctl_meteor.h"
4858 for ioctl_meteor_h_path
in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
4859 statement_check_broken
"sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
4860 _ioctl_meteor_h
=yes && break
4862 if test "$_ioctl_meteor_h" = yes ; then
4863 def_ioctl_meteor_h_name
="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
4864 res_comment
="using $ioctl_meteor_h_path"
4866 def_ioctl_meteor_h_name
="#undef IOCTL_METEOR_H_NAME"
4868 echores
"$_ioctl_meteor_h"
4870 echocheck
"*BSD BrookTree 848 TV interface"
4871 if test "$_tv_bsdbt848" = auto
; then
4873 if test "$_tv" = yes ; then
4875 #include <sys/types.h>
4876 $def_ioctl_meteor_h_name
4877 $def_ioctl_bt848_h_name
4878 #ifdef IOCTL_METEOR_H_NAME
4879 #include IOCTL_METEOR_H_NAME
4881 #ifdef IOCTL_BT848_H_NAME
4882 #include IOCTL_BT848_H_NAME
4885 ioctl(0, METEORSINPUT, 0);
4886 ioctl(0, TVTUNER_GETFREQ, 0);
4890 cc_check
&& _tv_bsdbt848
=yes
4893 if test "$_tv_bsdbt848" = yes ; then
4894 def_tv_bsdbt848
='#define CONFIG_TV_BSDBT848 1'
4895 inputmodules
="tv-bsdbt848 $inputmodules"
4897 def_tv_bsdbt848
='#undef CONFIG_TV_BSDBT848'
4898 noinputmodules
="tv-bsdbt848 $noinputmodules"
4900 echores
"$_tv_bsdbt848"
4901 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
4904 echocheck
"DirectShow TV interface"
4905 if test "$_tv_dshow" = auto
; then
4907 if test "$_tv" = yes && win32
; then
4908 statement_check ole2.h
'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow
=yes
4911 if test "$_tv_dshow" = yes ; then
4912 inputmodules
="tv-dshow $inputmodules"
4913 def_tv_dshow
='#define CONFIG_TV_DSHOW 1'
4914 extra_ldflags
="$extra_ldflags -lole32 -luuid"
4916 noinputmodules
="tv-dshow $noinputmodules"
4917 def_tv_dshow
='#undef CONFIG_TV_DSHOW'
4919 echores
"$_tv_dshow"
4922 echocheck
"Video 4 Linux 2 TV interface"
4923 if test "$_tv_v4l2" = auto
; then
4925 if test "$_tv" = yes && linux
; then
4926 header_check_broken sys
/time.h linux
/videodev2.h
&& _tv_v4l2
=yes
4927 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
4931 if test "$_tv_v4l2" = yes ; then
4933 def_tv_v4l2
='#define CONFIG_TV_V4L2 1'
4934 inputmodules
="tv-v4l2 $inputmodules"
4936 noinputmodules
="tv-v4l2 $noinputmodules"
4937 def_tv_v4l2
='#undef CONFIG_TV_V4L2'
4942 echocheck
"Radio interface"
4943 if test "$_radio" = yes ; then
4944 def_radio
='#define CONFIG_RADIO 1'
4945 inputmodules
="radio $inputmodules"
4946 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
4949 if test "$_radio_capture" = yes ; then
4951 def_radio_capture
="#define CONFIG_RADIO_CAPTURE 1"
4953 def_radio_capture
="#undef CONFIG_RADIO_CAPTURE"
4956 noinputmodules
="radio $noinputmodules"
4957 def_radio
='#undef CONFIG_RADIO'
4958 def_radio_capture
="#undef CONFIG_RADIO_CAPTURE"
4962 echocheck
"Capture for Radio interface"
4963 echores
"$_radio_capture"
4965 echocheck
"Video 4 Linux 2 Radio interface"
4966 if test "$_radio_v4l2" = auto
; then
4968 if test "$_radio" = yes && linux
; then
4969 header_check linux
/videodev2.h
&& _radio_v4l2
=yes
4972 if test "$_radio_v4l2" = yes ; then
4973 def_radio_v4l2
='#define CONFIG_RADIO_V4L2 1'
4975 def_radio_v4l2
='#undef CONFIG_RADIO_V4L2'
4977 echores
"$_radio_v4l2"
4979 if freebsd || netbsd || openbsd || dragonfly || bsdos
&&
4980 test "$_radio" = yes && test "$_radio_bsdbt848" = auto
; then
4981 echocheck
"*BSD BrookTree 848 Radio interface"
4984 #include <sys/types.h>
4985 $def_ioctl_bt848_h_name
4986 #ifdef IOCTL_BT848_H_NAME
4987 #include IOCTL_BT848_H_NAME
4989 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
4991 cc_check
&& _radio_bsdbt848
=yes
4992 echores
"$_radio_bsdbt848"
4993 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
4995 if test "$_radio_bsdbt848" = yes ; then
4996 def_radio_bsdbt848
='#define CONFIG_RADIO_BSDBT848 1'
4998 def_radio_bsdbt848
='#undef CONFIG_RADIO_BSDBT848'
5001 if test "$_radio_v4l2" = no
&&
5002 test "$_radio_bsdbt848" = no
&& test "$_radio" = yes ; then
5003 die
"Radio driver requires BSD BT848 or V4L2!"
5006 echocheck
"Video 4 Linux 2 MPEG PVR interface"
5007 if test "$_pvr" = auto
; then
5009 if test "$_tv_v4l2" = yes && linux
; then
5011 #include <sys/time.h>
5012 #include <linux/videodev2.h>
5013 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5015 cc_check
&& _pvr
=yes
5018 if test "$_pvr" = yes ; then
5019 def_pvr
='#define CONFIG_PVR 1'
5020 inputmodules
="pvr $inputmodules"
5022 noinputmodules
="pvr $noinputmodules"
5023 def_pvr
='#undef CONFIG_PVR'
5029 if test "$_ftp" = "auto" ; then
5030 test "$networking" = "yes" && ! beos
&& _ftp
=yes
5032 if test "$_ftp" = yes ; then
5033 def_ftp
='#define CONFIG_FTP 1'
5034 inputmodules
="ftp $inputmodules"
5036 noinputmodules
="ftp $noinputmodules"
5037 def_ftp
='#undef CONFIG_FTP'
5041 echocheck
"vstream client"
5042 if test "$_vstream" = auto
; then
5045 #include <vstream-client.h>
5046 void vstream_error(const char *format, ... ) {}
5047 int main(void) { vstream_start(); return 0; }
5049 cc_check
-lvstream-client && _vstream
=yes
5051 if test "$_vstream" = yes ; then
5052 def_vstream
='#define CONFIG_VSTREAM 1'
5053 inputmodules
="vstream $inputmodules"
5054 extra_ldflags
="$extra_ldflags -lvstream-client"
5056 noinputmodules
="vstream $noinputmodules"
5057 def_vstream
='#undef CONFIG_VSTREAM'
5062 echocheck
"XMMS inputplugin support"
5063 if test "$_xmms" = yes ; then
5064 if ( xmms-config
--version ) >/dev
/null
2>&1 ; then
5065 _xmmsplugindir
=$
(xmms-config
--input-plugin-dir)
5066 _xmmslibdir
=$
(xmms-config
--exec-prefix)/lib
5068 _xmmsplugindir
=/usr
/lib
/xmms
/Input
5069 _xmmslibdir
=/usr
/lib
5072 def_xmms
='#define CONFIG_XMMS 1'
5074 extra_ldflags
="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
5076 extra_ldflags
="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
5079 def_xmms
='#undef CONFIG_XMMS'
5083 if test "$_charset" != "noconv" ; then
5084 def_charset
="#define MSG_CHARSET \"$_charset\""
5086 def_charset
="#undef MSG_CHARSET"
5090 #############################################################################
5092 echocheck
"automatic gdb attach"
5093 if test "$_crash_debug" = yes ; then
5094 def_crash_debug
='#define CONFIG_CRASH_DEBUG 1'
5096 def_crash_debug
='#undef CONFIG_CRASH_DEBUG'
5099 echores
"$_crash_debug"
5101 echocheck
"compiler support for noexecstack"
5102 if cflag_check
-Wl,-z,noexecstack
; then
5103 extra_ldflags
="-Wl,-z,noexecstack $extra_ldflags"
5109 echocheck
"linker support for --nxcompat --no-seh --dynamicbase"
5110 if cflag_check
"-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
5111 extra_ldflags
="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
5118 # Dynamic linking flags
5119 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
5121 freebsd || netbsd || openbsd || dragonfly || bsdos
&& _ld_dl_dynamic
='-rdynamic'
5122 if test "$_real" = yes ||
test "$_xanim" = yes && ! win32
&& ! qnx
&& ! darwin
; then
5123 _ld_dl_dynamic
='-rdynamic'
5126 extra_ldflags
="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
5127 bsdos
&& extra_ldflags
="$extra_ldflags -ldvd"
5128 (netbsd || openbsd
) && x86_32
&& extra_ldflags
="$extra_ldflags -li386"
5130 def_debug
='#undef MP_DEBUG'
5131 test "$_debug" != "" && def_debug
='#define MP_DEBUG 1'
5134 echocheck
"joystick"
5135 def_joystick
='#undef CONFIG_JOYSTICK'
5136 if test "$_joystick" = yes ; then
5137 if linux || freebsd
; then
5138 # TODO add some check
5139 def_joystick
='#define CONFIG_JOYSTICK 1'
5142 res_comment
="unsupported under $system_name"
5145 echores
"$_joystick"
5148 if test "$_lirc" = auto
; then
5150 header_check lirc
/lirc_client.h
-llirc_client && _lirc
=yes
5152 if test "$_lirc" = yes ; then
5153 def_lirc
='#define CONFIG_LIRC 1'
5154 libs_mplayer
="$libs_mplayer -llirc_client"
5156 def_lirc
='#undef CONFIG_LIRC'
5161 if test "$_lircc" = auto
; then
5163 header_check lirc
/lircc.h
-llircc && _lircc
=yes
5165 if test "$_lircc" = yes ; then
5166 def_lircc
='#define CONFIG_LIRCC 1'
5167 libs_mplayer
="$libs_mplayer -llircc"
5169 def_lircc
='#undef CONFIG_LIRCC'
5173 #############################################################################
5175 CFLAGS
="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
5177 # This must be the last test to be performed. Any other tests following it
5178 # could fail due to linker errors. libdvdnavmini is intentionally not linked
5179 # against libdvdread (to permit MPlayer to use its own copy of the library).
5180 # So any compilation using the flags added here but not linking against
5181 # libdvdread can fail.
5182 echocheck
"DVD support (libdvdnav)"
5183 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
5187 if test "$_dvdnav" = auto
; then
5188 if test "$_dvdread_internal" = yes ; then
5191 res_comment
="internal"
5193 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav
=no
5196 if test "$_dvdnav" = auto
; then
5198 _dvdnavdir
=$
($_dvdnavconfig --cflags)
5199 _dvdnavlibs
=$
($_dvdnavconfig --libs)
5200 statement_check_broken stdint.h dvdnav
/dvdnav.h
'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav
=yes
5202 if test "$_dvdnav" = yes ; then
5203 def_dvdnav
='#define CONFIG_DVDNAV 1'
5204 if test "$dvdnav_internal" = yes ; then
5205 cflags_libdvdnav
="-Ilibdvdnav"
5206 inputmodules
="dvdnav(internal) $inputmodules"
5208 extra_cflags
="$extra_cflags $($_dvdnavconfig --cflags)"
5209 extra_ldflags
="$extra_ldflags $($_dvdnavconfig --minilibs)"
5210 inputmodules
="dvdnav $inputmodules"
5213 def_dvdnav
='#undef CONFIG_DVDNAV'
5214 noinputmodules
="dvdnav $noinputmodules"
5218 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
5219 # Read dvdnav comment above.
5222 list
=$
(echo $1 |
tr '[a-z]' '[A-Z]')
5223 item
=$
(echo $2 |
tr '[a-z]' '[A-Z]')
5225 for part
in $list; do
5226 if $
(echo $item |
grep -q -E "(^| )$part($| )"); then
5227 echo "${nprefix}_$part = yes"
5232 #############################################################################
5233 echo "Creating config.mak"
5234 cat > config.mak
<< EOF
5235 # -------- Generated by configure -----------
5237 # Ensure that locale settings do not interfere with shell commands.
5240 CONFIGURATION = $configuration
5243 DOC_LANGS = $language_doc
5244 DOC_LANG_ALL = $doc_lang_all
5245 MAN_LANGS = $language_man
5246 MAN_LANG_ALL = $man_lang_all
5247 MSG_LANGS = $language_msg
5248 MSG_LANG_ALL = $msg_lang_all
5250 prefix = \$(DESTDIR)$_prefix
5251 BINDIR = \$(DESTDIR)$_bindir
5252 LIBDIR = \$(DESTDIR)$_libdir
5253 MANDIR = \$(DESTDIR)$_mandir
5254 CONFDIR = \$(DESTDIR)$_confdir
5255 LOCALEDIR = \$(DESTDIR)$_localedir
5259 INSTALLSTRIP = $_install_strip
5262 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
5263 DEPFLAGS = $DEPFLAGS
5265 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
5266 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
5267 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
5268 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
5269 CFLAGS_STACKREALIGN = $cflags_stackrealign
5271 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
5272 EXTRALIBS_MPLAYER = $libs_mplayer
5282 $(mak_enable "$arch_all" "$arch" ARCH)
5283 $(mak_enable "$subarch_all" "$subarch" ARCH)
5284 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
5286 NEED_GETTIMEOFDAY = $need_gettimeofday
5287 NEED_GLOB = $need_glob
5288 NEED_SETENV = $need_setenv
5289 NEED_SHMEM = $need_shmem
5290 NEED_STRSEP = $need_strsep
5291 NEED_SWAB = $need_swab
5292 NEED_VSSCANF = $need_vsscanf
5296 APPLE_IR = $_apple_ir
5297 APPLE_REMOTE = $_apple_remote
5298 AUDIO_INPUT = $_audio_input
5303 COREAUDIO = $_coreaudio
5304 COREVIDEO = $_corevideo
5305 SHAREDBUFFER = $_sharedbuffer
5306 DIRECT3D = $_direct3d
5307 DIRECTFB = $_directfb
5311 DVDNAV_INTERNAL = $dvdnav_internal
5313 DVDREAD_INTERNAL = $_dvdread_internal
5316 FASTMEMCPY = $_fastmemcpy
5320 GL_COCOA = $_gl_cocoa
5321 GL_WIN32 = $_gl_win32
5324 HAVE_POSIX_SELECT = $_posix_select
5325 HAVE_SYS_MMAN_H = $_mman
5327 JOYSTICK = $_joystick
5332 LIBBLURAY = $_bluray
5336 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
5340 LIBPOSTPROC = $libpostproc
5341 LIBSMBCLIENT = $_smb
5343 LIBTHEORA = $_theora
5345 MACOSX_FINDER = $_macosx_finder
5349 MUSEPACK = $_musepack
5350 NETWORKING = $networking
5353 PE_EXECUTABLE = $_pe_executable
5356 PRIORITY = $_priority
5358 PORTAUDIO = $_portaudio
5361 QTX_CODECS_WIN32 = $_qtx_codecs_win32
5362 QTX_EMULATION = $_qtx_emulation
5364 RADIO_CAPTURE=$_radio_capture
5365 REAL_CODECS = $_real
5369 STREAM_CACHE = $_stream_cache
5372 TV_BSDBT848 = $_tv_bsdbt848
5373 TV_DSHOW = $_tv_dshow
5375 UNRAR_EXEC = $_unrar_exec
5381 WIN32DLL = $_win32dll
5382 WIN32_EMULATION = $_win32_emulation
5384 XANIM_CODECS = $_xanim
5385 XMMS_PLUGINS = $_xmms
5388 YUV4MPEG = $_yuv4mpeg
5390 CONFIG_VDPAU = $_vdpau
5391 CONFIG_ZLIB = $_zlib
5393 HAVE_PTHREADS = $_pthreads
5395 HAVE_W32THREADS = $_w32threads
5399 #############################################################################
5401 ff_config_enable
() {
5402 list
=$
(echo $1 |
tr '[a-z]' '[A-Z]')
5403 item
=$
(echo $2 |
tr '[a-z]' '[A-Z]')
5405 test -z "$_nprefix" && _nprefix
='CONFIG'
5406 for part
in $list; do
5407 if $
(echo $item |
grep -q -E "(^| )$part($| )"); then
5408 echo "#define ${_nprefix}_$part 1"
5410 echo "#define ${_nprefix}_$part 0"
5415 echo "Creating config.h"
5417 /*----------------------------------------------------------------------------
5418 ** This file has been automatically generated by configure any changes in it
5419 ** will be lost when you run configure again.
5420 ** Instead of modifying definitions here, use the --enable/--disable options
5421 ** of the configure script! See ./configure --help for details.
5422 *---------------------------------------------------------------------------*/
5424 #ifndef MPLAYER_CONFIG_H
5425 #define MPLAYER_CONFIG_H
5427 #define CONFIGURATION "$configuration"
5429 #define MPLAYER_CONFDIR "$_confdir"
5430 #define MPLAYER_LOCALEDIR "$_localedir"
5434 /* definitions needed by included libraries */
5435 #define HAVE_INTTYPES_H 1
5437 #define HAVE_ERRNO_H 1
5438 /* libdvdcss + libdvdread */
5439 #define HAVE_LIMITS_H 1
5441 #define HAVE_UNISTD_H 1
5443 #define STDC_HEADERS 1
5444 #define HAVE_MEMCPY 1
5446 #define READ_CACHE_TRACE 0
5448 #define HAVE_DLFCN_H 1
5452 /* system headers */
5456 $def_mman_has_map_failed
5458 $def_sys_soundcard_h
5466 /* system functions */
5486 /* system-specific features */
5499 $def_restrict_keyword
5504 /* configurable options */
5509 $def_runtime_cpudetection
5516 #define __CPU__ $iproc
5520 $(ff_config_enable "$arch_all" "$arch" "ARCH")
5521 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
5522 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
5525 /* Blu-ray/DVD/VCD/CD */
5526 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
5527 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
5547 /* codec libraries */
5574 #define BINARY_CODECS_PATH "$_codecsdir"
5575 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
5578 /* Audio output drivers */
5585 $def_ossaudio_devdsp
5586 $def_ossaudio_devmixer
5598 $def_ioctl_bt848_h_name
5599 $def_ioctl_meteor_h_name
5674 /* Use these registers in x86 inline asm. No proper detection yet. */
5675 #define HAVE_EBP_AVAILABLE 1
5677 #endif /* MPLAYER_CONFIG_H */
5680 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
5681 cmp -s "$TMPH" config.h ||
mv -f "$TMPH" config.h
5683 #############################################################################
5687 Config files successfully generated by ./configure $configuration !
5689 Install prefix: $_prefix
5690 Config direct.: $_confdir
5692 Byte order: $_byte_order
5693 Optimizing for: $_optimizing
5696 Messages (in addition to English): $language_msg
5697 Manual pages: $language_man
5698 Documentation: $language_doc
5700 Enabled optional drivers:
5701 Input: $inputmodules
5702 Codecs: $codecmodules
5703 Audio output: $aomodules
5704 Video output: $vomodules
5706 Disabled optional drivers:
5707 Input: $noinputmodules
5708 Codecs: $nocodecmodules
5709 Audio output: $noaomodules
5710 Video output: $novomodules
5712 'config.h' and 'config.mak' contain your configuration options.
5713 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
5714 compile *** DO NOT REPORT BUGS if you tweak these files ***
5716 'make' will now compile MPlayer and 'make install' will install it.
5717 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
5723 Check $TMPLOG if you wonder why an autodetection failed (make sure
5724 development headers/packages are installed).
5726 NOTE: The --enable-* parameters unconditionally force options on, completely
5727 skipping autodetection. This behavior is unlike what you may be used to from
5728 autoconf-based configure scripts that can decide to override you. This greater
5729 level of control comes at a price. You may have to provide the correct compiler
5730 and linker flags yourself.
5731 If you used one of these options (except --enable-runtime-cpudetection and
5732 similar ones that turn on internal features) and experience a compilation or
5733 linking failure, make sure you have passed the necessary compiler/linker flags
5736 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
5740 if test "$warn_cflags" = yes; then
5743 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you,
5746 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
5748 It is strongly recommended to let MPlayer choose the correct CFLAGS!
5749 To do so, execute 'CFLAGS= ./configure <options>'
5755 rm -rf "$mplayer_tmpdir"