options: simplify option parsing/setting machinery
[mplayer.git] / configure
blob6e90b4861da0c9f0c1bfa9869e71c73008ab1710
1 #! /bin/sh
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
39 export LC_ALL=C
41 # Store the configure line that was used
42 configuration="$*"
44 # Prefer these macros to full length text !
45 # These macros only return an error code - NO display is done
46 compile_check() {
47 source="$1"
48 shift
49 echo >> "$TMPLOG"
50 cat "$source" >> "$TMPLOG"
51 echo >> "$TMPLOG"
52 echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
53 rm -f "$TMPEXE"
54 $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
55 TMPRES="$?"
56 echo >> "$TMPLOG"
57 echo >> "$TMPLOG"
58 return "$TMPRES"
61 cc_check() {
62 compile_check $TMPC $@
65 cxx_check() {
66 compile_check $TMPCPP $@ -lstdc++
69 cflag_check() {
70 cat > $TMPC << EOF
71 int main(void) { return 0; }
72 EOF
73 compile_check $TMPC $@
76 header_check() {
77 cat > $TMPC << EOF
78 #include <$1>
79 int main(void) { return 0; }
80 EOF
81 shift
82 compile_check $TMPC $@
85 return_check() {
86 cat > $TMPC << EOF
87 #include <$1>
88 int main(void) { return $2; }
89 EOF
90 shift 2
91 compile_check $TMPC $@
94 statement_check() {
95 cat > $TMPC << EOF
96 #include <$1>
97 int main(void) { $2; return 0; }
98 EOF
99 shift
100 shift
101 compile_check $TMPC $@
104 define_statement_check() {
105 cat > $TMPC << EOF
106 #define $1
107 #include <$2>
108 int main(void) { $3; return 0; }
110 shift 3
111 compile_check $TMPC $@
114 return_statement_check() {
115 cat > $TMPC << EOF
116 #include <$1>
117 int main(void) { $2; return $3; }
119 shift 3
120 compile_check $TMPC $@
123 inline_asm_check() {
124 cat > $TMPC << EOF
125 int main(void) { __asm__ volatile ($1); return 0; }
127 shift
128 compile_check $TMPC $@
131 # The following checks are special and should only be used with broken and
132 # non-selfsufficient headers that do not include all of their dependencies.
134 header_check_broken() {
135 cat > $TMPC << EOF
136 #include <$1>
137 #include <$2>
138 int main(void) { return 0; }
140 shift
141 shift
142 compile_check $TMPC $@
145 statement_check_broken() {
146 cat > $TMPC << EOF
147 #include <$1>
148 #include <$2>
149 int main(void) { $3; return 0; }
151 shift 3
152 compile_check $TMPC $@
155 yasm_check() {
156 echo >> "$TMPLOG"
157 cat "$TMPS" >> "$TMPLOG"
158 echo >> "$TMPLOG"
159 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
160 rm -f "$TMPEXE"
161 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
162 TMPRES="$?"
163 echo >> "$TMPLOG"
164 echo >> "$TMPLOG"
165 return "$TMPRES"
168 pkg_config_add() {
169 unset IFS # shell should not be used for programming
170 echo >> "$TMPLOG"
171 echo "$_pkg_config --cflags $@" >> "$TMPLOG"
172 ctmp=$($_pkg_config --cflags "$@" 2>> "$TMPLOG") || return $?
173 echo >> "$TMPLOG"
174 echo "$_pkg_config --libs $@" >> "$TMPLOG"
175 ltmp=$($_pkg_config --libs "$@" 2>> "$TMPLOG") || return $?
176 echo >> "$TMPLOG"
177 echo "cflags: $ctmp" >> "$TMPLOG"
178 echo "libs: $ltmp" >> "$TMPLOG"
179 echo >> "$TMPLOG"
180 extra_cflags="$extra_cflags $ctmp"
181 extra_ldflags="$extra_ldflags $ltmp"
184 tmp_run() {
185 "$TMPEXE" >> "$TMPLOG" 2>&1
188 # Display error message, flushes tempfile, exit
189 die () {
190 echo
191 echo "Error: $@" >&2
192 echo >&2
193 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
194 echo "Check \"$TMPLOG\" if you do not understand why it failed."
195 exit 1
198 # OS test booleans functions
199 issystem() {
200 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
202 aix() { issystem "AIX"; }
203 amigaos() { issystem "AmigaOS"; }
204 beos() { issystem "BEOS"; }
205 bsdos() { issystem "BSD/OS"; }
206 cygwin() { issystem "CYGWIN"; }
207 darwin() { issystem "Darwin"; }
208 dragonfly() { issystem "DragonFly"; }
209 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
210 gnu() { issystem "GNU"; }
211 hpux() { issystem "HP-UX"; }
212 linux() { issystem "Linux"; }
213 mingw32() { issystem "MINGW32"; }
214 morphos() { issystem "MorphOS"; }
215 netbsd() { issystem "NetBSD"; }
216 openbsd() { issystem "OpenBSD"; }
217 qnx() { issystem "QNX"; }
218 sunos() { issystem "SunOS"; }
219 win32() { cygwin || mingw32; }
221 # arch test boolean functions
222 # x86/x86pc is used by QNX
223 x86_32() {
224 case "$host_arch" in
225 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
226 *) return 1 ;;
227 esac
230 x86_64() {
231 case "$host_arch" in
232 x86_64|amd64) return 0 ;;
233 *) return 1 ;;
234 esac
237 x86() {
238 x86_32 || x86_64
241 ppc() {
242 case "$host_arch" in
243 ppc|ppc64|powerpc|powerpc64) return 0;;
244 *) return 1;;
245 esac
248 alpha() {
249 case "$host_arch" in
250 alpha*) return 0;;
251 *) return 1;;
252 esac
255 arm() {
256 case "$host_arch" in
257 arm*) return 0;;
258 *) return 1;;
259 esac
262 # Use this before starting a check
263 echocheck() {
264 echo "============ Checking for $@ ============" >> "$TMPLOG"
265 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
268 # Use this to echo the results of a check
269 echores() {
270 if test "$res_comment" ; then
271 res_comment="($res_comment)"
273 echo "Result is: $@ $res_comment" >> "$TMPLOG"
274 echo "##########################################" >> "$TMPLOG"
275 echo "" >> "$TMPLOG"
276 echo "$@ $res_comment"
277 res_comment=""
279 #############################################################################
281 # Check how echo works in this /bin/sh
282 case $(echo -n) in
283 -n) _echo_n= _echo_c='\c' ;; # SysV echo
284 *) _echo_n='-n ' _echo_c= ;; # BSD echo
285 esac
287 msg_lang_all=''
288 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
289 man_lang_all=$(echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g")
290 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
292 show_help(){
293 cat << EOF
294 Usage: $0 [OPTIONS]...
296 Configuration:
297 -h, --help display this help and exit
299 Installation directories:
300 --prefix=DIR prefix directory for installation [/usr/local]
301 --bindir=DIR directory for installing binaries [PREFIX/bin]
302 --datadir=DIR directory for installing machine independent
303 data files (skins, etc) [PREFIX/share/mplayer]
304 --mandir=DIR directory for installing man pages [PREFIX/share/man]
305 --confdir=DIR directory for installing configuration files
306 [PREFIX/etc/mplayer]
307 --localedir=DIR directory for locale tree [PREFIX/share/locale]
308 --libdir=DIR directory for object code libraries [PREFIX/lib]
309 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
311 Optional features:
312 --disable-mplayer disable MPlayer compilation [enable]
313 --enable-termcap use termcap database for key codes [autodetect]
314 --enable-termios use termios database for key codes [autodetect]
315 --disable-iconv disable iconv for encoding conversion [autodetect]
316 --disable-langinfo do not use langinfo [autodetect]
317 --enable-lirc enable LIRC (remote control) support [autodetect]
318 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
319 --enable-joystick enable joystick support [disable]
320 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
321 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
322 --disable-vm disable X video mode extensions [autodetect]
323 --disable-xf86keysym disable support for multimedia keys [autodetect]
324 --enable-radio enable radio interface [disable]
325 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
326 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
327 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
328 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
329 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
330 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
331 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
332 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
333 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
334 --disable-networking disable networking [enable]
335 --enable-winsock2_h enable winsock2_h [autodetect]
336 --enable-smb enable Samba (SMB) input [autodetect]
337 --enable-live enable LIVE555 Streaming Media [disable]
338 --enable-nemesi enable Nemesi Streaming Media [autodetect]
339 --disable-vcd disable VCD support [autodetect]
340 --disable-bluray disable Blu-ray support [autodetect]
341 --disable-dvdnav disable libdvdnav [autodetect]
342 --disable-dvdread disable libdvdread [autodetect]
343 --disable-dvdread-internal disable internal libdvdread [autodetect]
344 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
345 --disable-cddb disable cddb [autodetect]
346 --disable-bitmap-font disable bitmap font support [enable]
347 --disable-freetype disable FreeType 2 font rendering [autodetect]
348 --disable-fontconfig disable fontconfig font lookup [autodetect]
349 --disable-unrarexec disable using of UnRAR executable [enabled]
350 --disable-sortsub disable subtitle sorting [enabled]
351 --enable-fribidi enable the FriBiDi libs [autodetect]
352 --disable-enca disable ENCA charset oracle library [autodetect]
353 --enable-macosx-finder enable Mac OS X Finder invocation parameter
354 parsing [disabled]
355 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
356 --disable-inet6 disable IPv6 support [autodetect]
357 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
358 --disable-ftp disable FTP support [enabled]
359 --disable-vstream disable TiVo vstream client support [autodetect]
360 --disable-pthreads disable Posix threads support [autodetect]
361 --disable-w32threads disable Win32 threads support [autodetect]
362 --disable-libass disable subtitle rendering with libass [autodetect]
363 --enable-rpath enable runtime linker path for extra libs [disabled]
364 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
366 Codecs:
367 --enable-gif enable GIF support [autodetect]
368 --enable-png enable PNG input/output support [autodetect]
369 --enable-mng enable MNG input support [autodetect]
370 --enable-jpeg enable JPEG input/output support [autodetect]
371 --enable-libcdio enable libcdio support [autodetect]
372 --disable-win32dll disable Win32 DLL support [autodetect]
373 --disable-qtx disable QuickTime codecs support [enabled]
374 --disable-xanim disable XAnim codecs support [enabled]
375 --disable-real disable RealPlayer codecs support [enabled]
376 --disable-xvid disable Xvid [autodetect]
377 --disable-libnut disable libnut [autodetect]
378 --enable-libav skip Libav autodetection [autodetect]
379 --disable-libvorbis disable libvorbis support [autodetect]
380 --disable-tremor disable Tremor [autodetect if no libvorbis]
381 --disable-speex disable Speex support [autodetect]
382 --enable-theora enable OggTheora libraries [autodetect]
383 --enable-faad enable FAAD2 (AAC) [autodetect]
384 --disable-ladspa disable LADSPA plugin support [autodetect]
385 --disable-libbs2b disable libbs2b audio filter support [autodetect]
386 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
387 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
388 --disable-mad disable libmad (MPEG audio) support [autodetect]
389 --enable-xmms enable XMMS input plugin support [disabled]
390 --enable-libdca enable libdca support [autodetect]
391 --disable-liba52 disable liba52 [autodetect]
392 --enable-musepack enable libmpcdec support (deprecated, libavcodec
393 Musepack decoder is preferred) [disabled]
395 Video output:
396 --enable-gl enable OpenGL video output [autodetect]
397 --enable-dga2 enable DGA 2 support [autodetect]
398 --enable-dga1 enable DGA 1 support [autodetect]
399 --enable-vesa enable VESA video output [autodetect]
400 --enable-svga enable SVGAlib video output [autodetect]
401 --enable-sdl enable SDL video output [autodetect]
402 --enable-aa enable AAlib video output [autodetect]
403 --enable-caca enable CACA video output [autodetect]
404 --enable-ggi enable GGI video output [autodetect]
405 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
406 --enable-direct3d enable Direct3D video output [autodetect]
407 --enable-directx enable DirectX video output [autodetect]
408 --enable-dxr3 enable DXR3/H+ video output [autodetect]
409 --enable-ivtv enable IVTV TV-Out video output [autodetect]
410 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
411 --enable-dvb enable DVB video output [autodetect]
412 --enable-mga enable mga_vid video output [autodetect]
413 --enable-xmga enable mga_vid X11 video output [autodetect]
414 --enable-xv enable Xv video output [autodetect]
415 --enable-vdpau enable VDPAU acceleration [autodetect]
416 --enable-vm enable XF86VidMode support [autodetect]
417 --enable-xinerama enable Xinerama support [autodetect]
418 --enable-x11 enable X11 video output [autodetect]
419 --enable-xshape enable XShape support [autodetect]
420 --disable-xss disable screensaver support via xss [autodetect]
421 --enable-fbdev enable FBDev video output [autodetect]
422 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
423 --enable-tdfxfb enable tdfxfb video output [disable]
424 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
425 --enable-wii enable Nintendo Wii/GameCube video output [disable]
426 --enable-directfb enable DirectFB video output [autodetect]
427 --enable-bl enable Blinkenlights video output [disable]
428 --enable-tdfxvid enable tdfx_vid video output [disable]
429 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
430 --disable-tga disable Targa video output [enable]
431 --disable-pnm disable PNM video output [enable]
432 --disable-md5sum disable md5sum video output [enable]
433 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
434 --disable-corevideo disable CoreVideo video output [autodetect]
435 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
436 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
438 Audio output:
439 --disable-alsa disable ALSA audio output [autodetect]
440 --disable-ossaudio disable OSS audio output [autodetect]
441 --disable-rsound disable RSound audio output [autodetect]
442 --disable-pulse disable Pulseaudio audio output [autodetect]
443 --disable-portaudio disable PortAudio audio output [autodetect]
444 --disable-jack disable JACK audio output [autodetect]
445 --enable-openal enable OpenAL audio output [disable]
446 --disable-nas disable NAS audio output [autodetect]
447 --disable-sunaudio disable Sun audio output [autodetect]
448 --disable-win32waveout disable Windows waveout audio output [autodetect]
449 --disable-coreaudio disable CoreAudio audio output [autodetect]
450 --disable-select disable using select() on the audio device [enable]
452 Language options:
453 --enable-translation enable support for translated output [disable]
454 --charset=charset convert the console messages to this character set
455 --language-doc=lang language to use for the documentation [en]
456 --language-man=lang language to use for the man pages [en]
457 --language-msg=lang extra languages for program messages [all]
458 --language=lang default language to use [en]
459 Specific options override --language. You can pass a list of languages separated
460 by whitespace or commas instead of a single language. Nonexisting translations
461 will be dropped from each list. All translations available in the list will be
462 installed. The value "all" will activate all translations. The LINGUAS
463 environment variable is honored. In all cases the fallback is English.
464 The program always supports English-language output; additional message
465 languages are only installed if --enable-translation is also specified.
466 Available values for --language-doc are: all $doc_lang_all
467 Available values for --language-man are: all $man_lang_all
468 Available values for --language-msg are: all $msg_lang_all
470 Miscellaneous options:
471 --enable-runtime-cpudetection enable runtime CPU detection [disable]
472 --enable-cross-compile enable cross-compilation [disable]
473 --cc=COMPILER C compiler to build MPlayer [gcc]
474 --host-cc=COMPILER C compiler for tools needed while building [gcc]
475 --as=ASSEMBLER assembler to build MPlayer [as]
476 --nm=NM nm tool to build MPlayer [nm]
477 --yasm=YASM Yasm assembler to build MPlayer [yasm]
478 --ar=AR librarian to build MPlayer [ar]
479 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
480 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
481 --windres=WINDRES windres to build MPlayer [windres]
482 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
483 --enable-static build a statically linked binary
484 --with-install=PATH path to a custom install program
486 Advanced options:
487 --enable-mmx enable MMX [autodetect]
488 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
489 --enable-3dnow enable 3DNow! [autodetect]
490 --enable-3dnowext enable extended 3DNow! [autodetect]
491 --enable-sse enable SSE [autodetect]
492 --enable-sse2 enable SSE2 [autodetect]
493 --enable-ssse3 enable SSSE3 [autodetect]
494 --enable-shm enable shm [autodetect]
495 --enable-altivec enable AltiVec (PowerPC) [autodetect]
496 --enable-armv5te enable DSP extensions (ARM) [autodetect]
497 --enable-armv6 enable ARMv6 (ARM) [autodetect]
498 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
499 --enable-armvfp enable ARM VFP (ARM) [autodetect]
500 --enable-neon enable NEON (ARM) [autodetect]
501 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
502 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
503 --enable-big-endian force byte order to big-endian [autodetect]
504 --enable-debug[=1-3] compile-in debugging information [disable]
505 --enable-profile compile-in profiling information [disable]
506 --disable-sighandler disable sighandler for crashes [enable]
507 --enable-crash-debug enable automatic gdb attach on crash [disable]
509 Use these options if autodetection fails:
510 --extra-cflags=FLAGS extra CFLAGS
511 --extra-ldflags=FLAGS extra LDFLAGS
512 --extra-libs=FLAGS extra linker flags
513 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
515 --with-sdl-config=PATH path to sdl*-config
516 --with-dvdnav-config=PATH path to dvdnav-config
517 --with-dvdread-config=PATH path to dvdread-config
519 This configure script is NOT autoconf-based, even though its output is similar.
520 It will try to autodetect all configuration options. If you --enable an option
521 it will be forcefully turned on, skipping autodetection. This can break
522 compilation, so you need to know what you are doing.
524 exit 0
525 } #show_help()
527 # GOTCHA: the variables below defines the default behavior for autodetection
528 # and have - unless stated otherwise - at least 2 states : yes no
529 # If autodetection is available then the third state is: auto
530 _mmx=auto
531 _3dnow=auto
532 _3dnowext=auto
533 _mmxext=auto
534 _sse=auto
535 _sse2=auto
536 _ssse3=auto
537 _cmov=auto
538 _fast_cmov=auto
539 _fast_clz=auto
540 _armv5te=auto
541 _armv6=auto
542 _armv6t2=auto
543 _armvfp=auto
544 neon=auto
545 _iwmmxt=auto
546 _altivec=auto
547 _install=install
548 _pkg_config=auto
549 _ranlib=auto
550 _windres=auto
551 _cc=auto
552 _ar=auto
553 test "$CC" && _cc="$CC"
554 _as=auto
555 _nm=auto
556 _yasm=auto
557 _runtime_cpudetection=no
558 _cross_compile=no
559 _prefix="/usr/local"
560 ffmpeg=auto
561 ffmpeg_internals=no
562 _mplayer=yes
563 _x11=auto
564 _xshape=auto
565 _xss=auto
566 _dga1=auto
567 _dga2=auto
568 _xv=auto
569 _vdpau=auto
570 _sdl=auto
571 _direct3d=auto
572 _directx=auto
573 _win32waveout=auto
574 _nas=auto
575 _png=auto
576 _mng=auto
577 _jpeg=auto
578 _pnm=yes
579 _md5sum=yes
580 _yuv4mpeg=yes
581 _gif=auto
582 _gl=auto
583 _ggi=auto
584 _ggiwmh=auto
585 _aa=auto
586 _caca=auto
587 _svga=auto
588 _vesa=auto
589 _fbdev=auto
590 _dvb=auto
591 _dxr3=auto
592 _ivtv=auto
593 _v4l2=auto
594 _iconv=auto
595 _langinfo=auto
596 _rtc=auto
597 _ossaudio=auto
598 _rsound=auto
599 _pulse=auto
600 _portaudio=auto
601 _jack=auto
602 _openal=no
603 _libcdio=auto
604 _mad=auto
605 _tremor=auto
606 _libvorbis=auto
607 _speex=auto
608 _theora=auto
609 _mpg123=auto
610 _liba52=auto
611 _libdca=auto
612 _faad=auto
613 _ladspa=auto
614 _libbs2b=auto
615 _xmms=no
616 _vcd=auto
617 _bluray=auto
618 _dvdnav=auto
619 _dvdnavconfig=dvdnav-config
620 _dvdreadconfig=dvdread-config
621 _dvdread=auto
622 _dvdread_internal=auto
623 _libdvdcss_internal=auto
624 _xanim=auto
625 _real=auto
626 _live=no
627 _nemesi=auto
628 _native_rtsp=yes
629 _xinerama=auto
630 _mga=auto
631 _xmga=auto
632 _vm=auto
633 _xf86keysym=auto
634 _sunaudio=auto
635 _alsa=auto
636 _fastmemcpy=yes
637 _unrar_exec=auto
638 _win32dll=auto
639 _select=yes
640 _radio=no
641 _radio_capture=no
642 _radio_v4l=auto
643 _radio_v4l2=auto
644 _radio_bsdbt848=auto
645 _tv=yes
646 _tv_v4l1=auto
647 _tv_v4l2=auto
648 _tv_bsdbt848=auto
649 _tv_dshow=auto
650 _pvr=auto
651 networking=yes
652 _winsock2_h=auto
653 _smb=auto
654 _joystick=no
655 _xvid=auto
656 _libnut=auto
657 _lirc=auto
658 _lircc=auto
659 _apple_remote=auto
660 _apple_ir=auto
661 _termcap=auto
662 _termios=auto
663 _3dfx=no
664 _s3fb=no
665 _wii=no
666 _tdfxfb=no
667 _tdfxvid=no
668 _xvr100=auto
669 _tga=yes
670 _directfb=auto
671 _bl=no
672 #language=en
673 _shm=auto
674 _translation=no
675 _charset="UTF-8"
676 _crash_debug=no
677 _sighandler=yes
678 _libdv=auto
679 _cdda=auto
680 _cddb=auto
681 _big_endian=auto
682 _bitmap_font=yes
683 _freetype=auto
684 _fontconfig=auto
685 _qtx=auto
686 _coreaudio=auto
687 _corevideo=auto
688 _cocoa=auto
689 _sharedbuffer=auto
690 quicktime=auto
691 _macosx_finder=no
692 _macosx_bundle=auto
693 _sortsub=yes
694 _fribidi=auto
695 _enca=auto
696 _inet6=auto
697 _gethostbyname2=auto
698 _ftp=auto
699 _musepack=no
700 _vstream=auto
701 _pthreads=auto
702 _w32threads=auto
703 _ass=auto
704 _rpath=no
705 libpostproc=auto
706 _asmalign_pot=auto
707 _stream_cache=yes
708 _priority=no
709 def_dos_paths="#define HAVE_DOS_PATHS 0"
710 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
711 def_priority="#undef CONFIG_PRIORITY"
712 def_pthread_cache="#undef PTHREAD_CACHE"
713 need_shmem=yes
714 for ac_option do
715 case "$ac_option" in
716 --help|-help|-h)
717 show_help
719 --prefix=*)
720 _prefix=$(echo $ac_option | cut -d '=' -f 2)
722 --bindir=*)
723 _bindir=$(echo $ac_option | cut -d '=' -f 2)
725 --datadir=*)
726 _datadir=$(echo $ac_option | cut -d '=' -f 2)
728 --mandir=*)
729 _mandir=$(echo $ac_option | cut -d '=' -f 2)
731 --confdir=*)
732 _confdir=$(echo $ac_option | cut -d '=' -f 2)
734 --libdir=*)
735 _libdir=$(echo $ac_option | cut -d '=' -f 2)
737 --codecsdir=*)
738 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
740 --localedir=*)
741 _localedir=$(echo $ac_option | cut -d '=' -f 2)
744 --with-install=*)
745 _install=$(echo $ac_option | cut -d '=' -f 2 )
748 --with-sdl-config=*)
749 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
751 --with-dvdnav-config=*)
752 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
754 --with-dvdread-config=*)
755 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
758 --extra-cflags=*)
759 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
761 --extra-ldflags=*)
762 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
764 --extra-libs=*)
765 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
767 --extra-libs-mplayer=*)
768 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
771 --target=*)
772 _target=$(echo $ac_option | cut -d '=' -f 2)
774 --cc=*)
775 _cc=$(echo $ac_option | cut -d '=' -f 2)
777 --host-cc=*)
778 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
780 --as=*)
781 _as=$(echo $ac_option | cut -d '=' -f 2)
783 --nm=*)
784 _nm=$(echo $ac_option | cut -d '=' -f 2)
786 --yasm=*)
787 _yasm=$(echo $ac_option | cut -d '=' -f 2)
789 --ar=*)
790 _ar=$(echo $ac_option | cut -d '=' -f 2)
792 --pkg-config=*)
793 _pkg_config=$(echo $ac_option | cut -d '=' -f 2)
795 --ranlib=*)
796 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
798 --windres=*)
799 _windres=$(echo $ac_option | cut -d '=' -f 2)
801 --charset=*)
802 _charset=$(echo $ac_option | cut -d '=' -f 2)
804 --language-doc=*)
805 language_doc=$(echo $ac_option | cut -d '=' -f 2)
807 --language-man=*)
808 language_man=$(echo $ac_option | cut -d '=' -f 2)
810 --language-msg=*)
811 language_msg=$(echo $ac_option | cut -d '=' -f 2)
813 --language=*)
814 language=$(echo $ac_option | cut -d '=' -f 2)
817 --enable-static)
818 _ld_static='-static'
820 --disable-static)
821 _ld_static=''
823 --enable-profile)
824 _profile='-p'
826 --disable-profile)
827 _profile=
829 --enable-debug)
830 _debug='-g'
832 --enable-debug=*)
833 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
835 --disable-debug)
836 _debug=
838 --enable-translation) _translation=yes ;;
839 --disable-translation) _translation=no ;;
840 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
841 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
842 --enable-cross-compile) _cross_compile=yes ;;
843 --disable-cross-compile) _cross_compile=no ;;
844 --enable-mplayer) _mplayer=yes ;;
845 --disable-mplayer) _mplayer=no ;;
846 --enable-x11) _x11=yes ;;
847 --disable-x11) _x11=no ;;
848 --enable-xshape) _xshape=yes ;;
849 --disable-xshape) _xshape=no ;;
850 --enable-xss) _xss=yes ;;
851 --disable-xss) _xss=no ;;
852 --enable-xv) _xv=yes ;;
853 --disable-xv) _xv=no ;;
854 --enable-vdpau) _vdpau=yes ;;
855 --disable-vdpau) _vdpau=no ;;
856 --enable-sdl) _sdl=yes ;;
857 --disable-sdl) _sdl=no ;;
858 --enable-direct3d) _direct3d=yes ;;
859 --disable-direct3d) _direct3d=no ;;
860 --enable-directx) _directx=yes ;;
861 --disable-directx) _directx=no ;;
862 --enable-win32waveout) _win32waveout=yes ;;
863 --disable-win32waveout) _win32waveout=no ;;
864 --enable-nas) _nas=yes ;;
865 --disable-nas) _nas=no ;;
866 --enable-png) _png=yes ;;
867 --disable-png) _png=no ;;
868 --enable-mng) _mng=yes ;;
869 --disable-mng) _mng=no ;;
870 --enable-jpeg) _jpeg=yes ;;
871 --disable-jpeg) _jpeg=no ;;
872 --enable-pnm) _pnm=yes ;;
873 --disable-pnm) _pnm=no ;;
874 --enable-md5sum) _md5sum=yes ;;
875 --disable-md5sum) _md5sum=no ;;
876 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
877 --disable-yuv4mpeg) _yuv4mpeg=no ;;
878 --enable-gif) _gif=yes ;;
879 --disable-gif) _gif=no ;;
880 --enable-gl) _gl=yes ;;
881 --disable-gl) _gl=no ;;
882 --enable-ggi) _ggi=yes ;;
883 --disable-ggi) _ggi=no ;;
884 --enable-ggiwmh) _ggiwmh=yes ;;
885 --disable-ggiwmh) _ggiwmh=no ;;
886 --enable-aa) _aa=yes ;;
887 --disable-aa) _aa=no ;;
888 --enable-caca) _caca=yes ;;
889 --disable-caca) _caca=no ;;
890 --enable-svga) _svga=yes ;;
891 --disable-svga) _svga=no ;;
892 --enable-vesa) _vesa=yes ;;
893 --disable-vesa) _vesa=no ;;
894 --enable-fbdev) _fbdev=yes ;;
895 --disable-fbdev) _fbdev=no ;;
896 --enable-dvb) _dvb=yes ;;
897 --disable-dvb) _dvb=no ;;
898 --enable-dxr3) _dxr3=yes ;;
899 --disable-dxr3) _dxr3=no ;;
900 --enable-ivtv) _ivtv=yes ;;
901 --disable-ivtv) _ivtv=no ;;
902 --enable-v4l2) _v4l2=yes ;;
903 --disable-v4l2) _v4l2=no ;;
904 --enable-iconv) _iconv=yes ;;
905 --disable-iconv) _iconv=no ;;
906 --enable-langinfo) _langinfo=yes ;;
907 --disable-langinfo) _langinfo=no ;;
908 --enable-rtc) _rtc=yes ;;
909 --disable-rtc) _rtc=no ;;
910 --enable-libdv) _libdv=yes ;;
911 --disable-libdv) _libdv=no ;;
912 --enable-ossaudio) _ossaudio=yes ;;
913 --disable-ossaudio) _ossaudio=no ;;
914 --enable-rsound) _rsound=yes ;;
915 --disable-rsound) _rsound=no ;;
916 --enable-pulse) _pulse=yes ;;
917 --disable-pulse) _pulse=no ;;
918 --enable-portaudio) _portaudio=yes ;;
919 --disable-portaudio) _portaudio=no ;;
920 --enable-jack) _jack=yes ;;
921 --disable-jack) _jack=no ;;
922 --enable-openal) _openal=yes ;;
923 --disable-openal) _openal=no ;;
924 --enable-mad) _mad=yes ;;
925 --disable-mad) _mad=no ;;
926 --enable-libcdio) _libcdio=yes ;;
927 --disable-libcdio) _libcdio=no ;;
928 --enable-libvorbis) _libvorbis=yes ;;
929 --disable-libvorbis) _libvorbis=no ;;
930 --enable-speex) _speex=yes ;;
931 --disable-speex) _speex=no ;;
932 --enable-tremor) _tremor=yes ;;
933 --disable-tremor) _tremor=no ;;
934 --enable-theora) _theora=yes ;;
935 --disable-theora) _theora=no ;;
936 --enable-mpg123) _mpg123=yes ;;
937 --disable-mpg123) _mpg123=no ;;
938 --enable-liba52) _liba52=yes ;;
939 --disable-liba52) _liba52=no ;;
940 --enable-libdca) _libdca=yes ;;
941 --disable-libdca) _libdca=no ;;
942 --enable-musepack) _musepack=yes ;;
943 --disable-musepack) _musepack=no ;;
944 --enable-faad) _faad=yes ;;
945 --disable-faad) _faad=no ;;
946 --enable-ladspa) _ladspa=yes ;;
947 --disable-ladspa) _ladspa=no ;;
948 --enable-libbs2b) _libbs2b=yes ;;
949 --disable-libbs2b) _libbs2b=no ;;
950 --enable-xmms) _xmms=yes ;;
951 --disable-xmms) _xmms=no ;;
952 --enable-vcd) _vcd=yes ;;
953 --disable-vcd) _vcd=no ;;
954 --enable-bluray) _bluray=yes ;;
955 --disable-bluray) _bluray=no ;;
956 --enable-dvdread) _dvdread=yes ;;
957 --disable-dvdread) _dvdread=no ;;
958 --enable-dvdread-internal) _dvdread_internal=yes ;;
959 --disable-dvdread-internal) _dvdread_internal=no ;;
960 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
961 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
962 --enable-dvdnav) _dvdnav=yes ;;
963 --disable-dvdnav) _dvdnav=no ;;
964 --enable-xanim) _xanim=yes ;;
965 --disable-xanim) _xanim=no ;;
966 --enable-real) _real=yes ;;
967 --disable-real) _real=no ;;
968 --enable-live) _live=yes ;;
969 --disable-live) _live=no ;;
970 --enable-nemesi) _nemesi=yes ;;
971 --disable-nemesi) _nemesi=no ;;
972 --enable-xinerama) _xinerama=yes ;;
973 --disable-xinerama) _xinerama=no ;;
974 --enable-mga) _mga=yes ;;
975 --disable-mga) _mga=no ;;
976 --enable-xmga) _xmga=yes ;;
977 --disable-xmga) _xmga=no ;;
978 --enable-vm) _vm=yes ;;
979 --disable-vm) _vm=no ;;
980 --enable-xf86keysym) _xf86keysym=yes ;;
981 --disable-xf86keysym) _xf86keysym=no ;;
982 --enable-sunaudio) _sunaudio=yes ;;
983 --disable-sunaudio) _sunaudio=no ;;
984 --enable-alsa) _alsa=yes ;;
985 --disable-alsa) _alsa=no ;;
986 --enable-tv) _tv=yes ;;
987 --disable-tv) _tv=no ;;
988 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
989 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
990 --enable-tv-v4l1) _tv_v4l1=yes ;;
991 --disable-tv-v4l1) _tv_v4l1=no ;;
992 --enable-tv-v4l2) _tv_v4l2=yes ;;
993 --disable-tv-v4l2) _tv_v4l2=no ;;
994 --enable-tv-dshow) _tv_dshow=yes ;;
995 --disable-tv-dshow) _tv_dshow=no ;;
996 --enable-radio) _radio=yes ;;
997 --enable-radio-capture) _radio_capture=yes ;;
998 --disable-radio-capture) _radio_capture=no ;;
999 --disable-radio) _radio=no ;;
1000 --enable-radio-v4l) _radio_v4l=yes ;;
1001 --disable-radio-v4l) _radio_v4l=no ;;
1002 --enable-radio-v4l2) _radio_v4l2=yes ;;
1003 --disable-radio-v4l2) _radio_v4l2=no ;;
1004 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1005 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1006 --enable-pvr) _pvr=yes ;;
1007 --disable-pvr) _pvr=no ;;
1008 --enable-fastmemcpy) _fastmemcpy=yes ;;
1009 --disable-fastmemcpy) _fastmemcpy=no ;;
1010 --enable-networking) networking=yes ;;
1011 --disable-networking) networking=no ;;
1012 --enable-winsock2_h) _winsock2_h=yes ;;
1013 --disable-winsock2_h) _winsock2_h=no ;;
1014 --enable-smb) _smb=yes ;;
1015 --disable-smb) _smb=no ;;
1016 --enable-joystick) _joystick=yes ;;
1017 --disable-joystick) _joystick=no ;;
1018 --enable-xvid) _xvid=yes ;;
1019 --disable-xvid) _xvid=no ;;
1020 --enable-libnut) _libnut=yes ;;
1021 --disable-libnut) _libnut=no ;;
1022 --enable-libav) ffmpeg=yes ;;
1023 --ffmpeg-source-dir=*)
1024 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1026 --enable-lirc) _lirc=yes ;;
1027 --disable-lirc) _lirc=no ;;
1028 --enable-lircc) _lircc=yes ;;
1029 --disable-lircc) _lircc=no ;;
1030 --enable-apple-remote) _apple_remote=yes ;;
1031 --disable-apple-remote) _apple_remote=no ;;
1032 --enable-apple-ir) _apple_ir=yes ;;
1033 --disable-apple-ir) _apple_ir=no ;;
1034 --enable-termcap) _termcap=yes ;;
1035 --disable-termcap) _termcap=no ;;
1036 --enable-termios) _termios=yes ;;
1037 --disable-termios) _termios=no ;;
1038 --enable-3dfx) _3dfx=yes ;;
1039 --disable-3dfx) _3dfx=no ;;
1040 --enable-s3fb) _s3fb=yes ;;
1041 --disable-s3fb) _s3fb=no ;;
1042 --enable-wii) _wii=yes ;;
1043 --disable-wii) _wii=no ;;
1044 --enable-tdfxfb) _tdfxfb=yes ;;
1045 --disable-tdfxfb) _tdfxfb=no ;;
1046 --disable-tdfxvid) _tdfxvid=no ;;
1047 --enable-tdfxvid) _tdfxvid=yes ;;
1048 --disable-xvr100) _xvr100=no ;;
1049 --enable-xvr100) _xvr100=yes ;;
1050 --disable-tga) _tga=no ;;
1051 --enable-tga) _tga=yes ;;
1052 --enable-directfb) _directfb=yes ;;
1053 --disable-directfb) _directfb=no ;;
1054 --enable-bl) _bl=yes ;;
1055 --disable-bl) _bl=no ;;
1056 --enable-shm) _shm=yes ;;
1057 --disable-shm) _shm=no ;;
1058 --enable-select) _select=yes ;;
1059 --disable-select) _select=no ;;
1060 --enable-cddb) _cddb=yes ;;
1061 --disable-cddb) _cddb=no ;;
1062 --enable-big-endian) _big_endian=yes ;;
1063 --disable-big-endian) _big_endian=no ;;
1064 --enable-bitmap-font) _bitmap_font=yes ;;
1065 --disable-bitmap-font) _bitmap_font=no ;;
1066 --enable-freetype) _freetype=yes ;;
1067 --disable-freetype) _freetype=no ;;
1068 --enable-fontconfig) _fontconfig=yes ;;
1069 --disable-fontconfig) _fontconfig=no ;;
1070 --enable-unrarexec) _unrar_exec=yes ;;
1071 --disable-unrarexec) _unrar_exec=no ;;
1072 --enable-ftp) _ftp=yes ;;
1073 --disable-ftp) _ftp=no ;;
1074 --enable-vstream) _vstream=yes ;;
1075 --disable-vstream) _vstream=no ;;
1076 --enable-pthreads) _pthreads=yes ;;
1077 --disable-pthreads) _pthreads=no ;;
1078 --enable-w32threads) _w32threads=yes ;;
1079 --disable-w32threads) _w32threads=no ;;
1080 --enable-libass) _ass=yes ;;
1081 --disable-libass) _ass=no ;;
1082 --enable-rpath) _rpath=yes ;;
1083 --disable-rpath) _rpath=no ;;
1084 --enable-libpostproc) libpostproc=yes ;;
1085 --disable-libpostproc) libpostproc=no ;;
1087 --enable-fribidi) _fribidi=yes ;;
1088 --disable-fribidi) _fribidi=no ;;
1090 --enable-enca) _enca=yes ;;
1091 --disable-enca) _enca=no ;;
1093 --enable-inet6) _inet6=yes ;;
1094 --disable-inet6) _inet6=no ;;
1096 --enable-gethostbyname2) _gethostbyname2=yes ;;
1097 --disable-gethostbyname2) _gethostbyname2=no ;;
1099 --enable-dga1) _dga1=yes ;;
1100 --disable-dga1) _dga1=no ;;
1101 --enable-dga2) _dga2=yes ;;
1102 --disable-dga2) _dga2=no ;;
1104 --enable-qtx) _qtx=yes ;;
1105 --disable-qtx) _qtx=no ;;
1107 --enable-coreaudio) _coreaudio=yes ;;
1108 --disable-coreaudio) _coreaudio=no ;;
1109 --enable-corevideo) _corevideo=yes ;;
1110 --disable-corevideo) _corevideo=no ;;
1111 --enable-cocoa) _cocoa=yes ;;
1112 --disable-cocoa) _cocoa=no ;;
1113 --enable-sharedbuffer) _sharedbuffer=yes ;;
1114 --disable-sharedbuffer) _sharedbuffer=no ;;
1115 --enable-macosx-finder) _macosx_finder=yes ;;
1116 --disable-macosx-finder) _macosx_finder=no ;;
1117 --enable-macosx-bundle) _macosx_bundle=yes ;;
1118 --disable-macosx-bundle) _macosx_bundle=no ;;
1120 --enable-sortsub) _sortsub=yes ;;
1121 --disable-sortsub) _sortsub=no ;;
1123 --enable-crash-debug) _crash_debug=yes ;;
1124 --disable-crash-debug) _crash_debug=no ;;
1125 --enable-sighandler) _sighandler=yes ;;
1126 --disable-sighandler) _sighandler=no ;;
1127 --enable-win32dll) _win32dll=yes ;;
1128 --disable-win32dll) _win32dll=no ;;
1130 --enable-sse) _sse=yes ;;
1131 --disable-sse) _sse=no ;;
1132 --enable-sse2) _sse2=yes ;;
1133 --disable-sse2) _sse2=no ;;
1134 --enable-ssse3) _ssse3=yes ;;
1135 --disable-ssse3) _ssse3=no ;;
1136 --enable-mmxext) _mmxext=yes ;;
1137 --disable-mmxext) _mmxext=no ;;
1138 --enable-3dnow) _3dnow=yes ;;
1139 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1140 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1141 --disable-3dnowext) _3dnowext=no ;;
1142 --enable-cmov) _cmov=yes ;;
1143 --disable-cmov) _cmov=no ;;
1144 --enable-fast-cmov) _fast_cmov=yes ;;
1145 --disable-fast-cmov) _fast_cmov=no ;;
1146 --enable-fast-clz) _fast_clz=yes ;;
1147 --disable-fast-clz) _fast_clz=no ;;
1148 --enable-altivec) _altivec=yes ;;
1149 --disable-altivec) _altivec=no ;;
1150 --enable-armv5te) _armv5te=yes ;;
1151 --disable-armv5te) _armv5te=no ;;
1152 --enable-armv6) _armv6=yes ;;
1153 --disable-armv6) _armv6=no ;;
1154 --enable-armv6t2) _armv6t2=yes ;;
1155 --disable-armv6t2) _armv6t2=no ;;
1156 --enable-armvfp) _armvfp=yes ;;
1157 --disable-armvfp) _armvfp=no ;;
1158 --enable-neon) neon=yes ;;
1159 --disable-neon) neon=no ;;
1160 --enable-iwmmxt) _iwmmxt=yes ;;
1161 --disable-iwmmxt) _iwmmxt=no ;;
1162 --enable-mmx) _mmx=yes ;;
1163 --disable-mmx) # 3Dnow! and MMX2 require MMX
1164 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1167 echo "Unknown parameter: $ac_option" >&2
1168 exit 1
1171 esac
1172 done
1174 # Atmos: moved this here, to be correct, if --prefix is specified
1175 test -z "$_bindir" && _bindir="$_prefix/bin"
1176 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1177 test -z "$_mandir" && _mandir="$_prefix/share/man"
1178 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1179 test -z "$_libdir" && _libdir="$_prefix/lib"
1180 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1182 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1183 test "$tmpdir" && break
1184 done
1186 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1187 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1189 TMPLOG="config.log"
1191 rm -f "$TMPLOG"
1192 echo Parameters configure was run with: > "$TMPLOG"
1193 if test -n "$CFLAGS" ; then
1194 echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1196 if test -n "$PKG_CONFIG_PATH" ; then
1197 echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1199 echo ./configure $configuration >> "$TMPLOG"
1200 echo >> "$TMPLOG"
1203 echocheck "cross compilation"
1204 echores $_cross_compile
1206 if test $_cross_compile = yes; then
1207 tmp_run() {
1208 return 0
1210 test "$_host_cc" || _host_cc=cc
1213 tool_prefix=""
1215 if test $_cross_compile = yes ; then
1216 # Usually cross-compiler prefixes match with the target triplet
1217 test -n "$_target" && tool_prefix="$_target"-
1220 test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib
1221 test "$_windres" = auto && _windres="$tool_prefix"windres
1222 test "$_ar" = auto && _ar="$tool_prefix"ar
1223 test "$_yasm" = auto && _yasm="$tool_prefix"yasm
1224 test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
1226 if test "$_cc" = auto ; then
1227 if test -n "$tool_prefix" ; then
1228 _cc="$tool_prefix"gcc
1229 else
1230 _cc=cc
1234 # Determine our OS name and CPU architecture
1235 if test -z "$_target" ; then
1236 # OS name
1237 system_name=$(uname -s 2>&1)
1238 case "$system_name" in
1239 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1241 Haiku)
1242 system_name=BeOS
1244 GNU/kFreeBSD)
1245 system_name=FreeBSD
1247 HP-UX*)
1248 system_name=HP-UX
1250 [cC][yY][gG][wW][iI][nN]*)
1251 system_name=CYGWIN
1253 MINGW32*)
1254 system_name=MINGW32
1256 OS/2*)
1257 system_name=OS/2
1260 system_name="$system_name-UNKNOWN"
1262 esac
1265 # host's CPU/instruction set
1266 host_arch=$(uname -p 2>&1)
1267 case "$host_arch" in
1268 i386|sparc|ppc|alpha|arm|mips|vax)
1270 powerpc) # Darwin returns 'powerpc'
1271 host_arch=ppc
1273 *) # uname -p on Linux returns 'unknown' for the processor type,
1274 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1276 # Maybe uname -m (machine hardware name) returns something we
1277 # recognize.
1279 # x86/x86pc is used by QNX
1280 case "$(uname -m 2>&1)" in
1281 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 ;;
1282 ia64) host_arch=ia64 ;;
1283 macppc|ppc) host_arch=ppc ;;
1284 ppc64) host_arch=ppc64 ;;
1285 alpha) host_arch=alpha ;;
1286 sparc) host_arch=sparc ;;
1287 sparc64) host_arch=sparc64 ;;
1288 parisc*|hppa*|9000*) host_arch=hppa ;;
1289 arm*|zaurus|cats) host_arch=arm ;;
1290 sh3|sh4|sh4a) host_arch=sh ;;
1291 s390) host_arch=s390 ;;
1292 s390x) host_arch=s390x ;;
1293 *mips*) host_arch=mips ;;
1294 vax) host_arch=vax ;;
1295 xtensa*) host_arch=xtensa ;;
1296 *) host_arch=UNKNOWN ;;
1297 esac
1299 esac
1300 else # if test -z "$_target"
1301 for i in 2 3; do
1302 system_name=$(echo $_target | cut -d '-' -f $i)
1303 case "$(echo $system_name | tr A-Z a-z)" in
1304 linux) system_name=Linux ;;
1305 freebsd) system_name=FreeBSD ;;
1306 gnu/kfreebsd) system_name=FreeBSD ;;
1307 netbsd) system_name=NetBSD ;;
1308 bsd/os) system_name=BSD/OS ;;
1309 openbsd) system_name=OpenBSD ;;
1310 dragonfly) system_name=DragonFly ;;
1311 sunos) system_name=SunOS ;;
1312 qnx) system_name=QNX ;;
1313 morphos) system_name=MorphOS ;;
1314 amigaos) system_name=AmigaOS ;;
1315 mingw32*) system_name=MINGW32 ;;
1316 *) continue ;;
1317 esac
1318 break
1319 done
1320 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1321 host_arch=$(echo $_target | cut -d '-' -f 1)
1322 if test $(echo $host_arch) != "x86_64" ; then
1323 host_arch=$(echo $host_arch | tr '_' '-')
1327 extra_cflags="-I. $extra_cflags"
1328 _timer=timer-linux.c
1329 _getch=getch2.c
1330 if freebsd ; then
1331 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1332 extra_cflags="$extra_cflags -I/usr/local/include"
1335 if netbsd || dragonfly ; then
1336 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1337 extra_cflags="$extra_cflags -I/usr/pkg/include"
1340 if darwin; then
1341 extra_cflags="-mdynamic-no-pic $extra_cflags"
1342 if test "$(basename $_cc)" != "clang" ; then
1343 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
1345 _timer=timer-darwin.c
1348 if aix ; then
1349 extra_ldflags="$extra_ldflags -lC"
1352 if linux ; then
1353 _ranlib='true'
1356 if win32 ; then
1357 _exesuf=".exe"
1358 extra_cflags="$extra_cflags -fno-common"
1359 # -lwinmm is always needed for osdep/timer-win2.c
1360 extra_ldflags="$extra_ldflags -lwinmm"
1361 _pe_executable=yes
1362 _timer=timer-win2.c
1363 _priority=yes
1364 def_dos_paths="#define HAVE_DOS_PATHS 1"
1365 def_priority="#define CONFIG_PRIORITY 1"
1368 if mingw32 ; then
1369 _getch=getch2-win.c
1370 need_shmem=no
1371 extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1374 if amigaos ; then
1375 _select=no
1376 _sighandler=no
1377 _stream_cache=no
1378 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1379 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1382 if qnx ; then
1383 extra_ldflags="$extra_ldflags -lph"
1386 TMPC="$mplayer_tmpdir/tmp.c"
1387 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1388 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1389 TMPH="$mplayer_tmpdir/tmp.h"
1390 TMPS="$mplayer_tmpdir/tmp.S"
1392 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1393 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1397 # Checking CC version...
1398 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1399 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1400 echocheck "$_cc version"
1401 cc_vendor=intel
1402 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1403 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1404 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1405 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1406 # TODO verify older icc/ecc compatibility
1407 case $cc_version in
1409 cc_version="v. ?.??, bad"
1410 cc_fail=yes
1412 10.1|11.0|11.1)
1413 cc_version="$cc_version, ok"
1416 cc_version="$cc_version, bad"
1417 cc_fail=yes
1419 esac
1420 echores "$cc_version"
1421 else
1422 for _cc in "$_cc" gcc cc ; do
1423 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1424 if test "$cc_name_tmp" = "gcc"; then
1425 cc_name=$cc_name_tmp
1426 echocheck "$_cc version"
1427 cc_vendor=gnu
1428 cc_version=$($_cc -dumpversion 2>&1)
1429 case $cc_version in
1430 2.96*)
1431 cc_fail=yes
1434 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1435 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1436 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1438 esac
1439 echores "$cc_version"
1440 break
1442 if $_cc -v 2>&1 | grep -q "clang"; then
1443 echocheck "$_cc version"
1444 cc_vendor=clang
1445 cc_version=$($_cc -dumpversion 2>&1)
1446 res_comment="experimental support only"
1447 echores "clang $cc_version"
1448 break
1450 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1451 if test "$cc_name_tmp" = "Sun C"; then
1452 echocheck "$_cc version"
1453 cc_vendor=sun
1454 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1455 res_comment="experimental support only"
1456 echores "Sun C $cc_version"
1457 break
1459 done
1460 fi # icc
1461 test "$cc_fail" = yes && die "unsupported compiler version"
1463 echocheck "working compiler"
1464 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1465 echo "yes"
1467 if test -z "$_target" && x86 ; then
1468 cat > $TMPC << EOF
1469 int main(void) {
1470 int test[(int)sizeof(char *)-7];
1471 return 0;
1474 cc_check && host_arch=x86_64 || host_arch=i386
1477 echocheck "host cc"
1478 test "$_host_cc" || _host_cc=$_cc
1479 echores $_host_cc
1481 echo "Detected operating system: $system_name"
1482 echo "Detected host architecture: $host_arch"
1484 # ---
1486 # now that we know what compiler should be used for compilation, try to find
1487 # out which assembler is used by the $_cc compiler
1488 if test "$_as" = auto ; then
1489 _as=$($_cc -print-prog-name=as)
1490 test -z "$_as" && _as=as
1493 if test "$_nm" = auto ; then
1494 _nm=$($_cc -print-prog-name=nm)
1495 test -z "$_nm" && _nm=nm
1498 # XXX: this should be ok..
1499 _cpuinfo="echo"
1501 if test "$_runtime_cpudetection" = no ; then
1503 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1504 # FIXME: Remove the cygwin check once AMD CPUs are supported
1505 if test -r /proc/cpuinfo && ! cygwin; then
1506 # Linux with /proc mounted, extract CPU information from it
1507 _cpuinfo="cat /proc/cpuinfo"
1508 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1509 # FreeBSD with Linux emulation /proc mounted,
1510 # extract CPU information from it
1511 # Don't use it on x86 though, it never reports 3Dnow
1512 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1513 elif darwin && ! x86 ; then
1514 # use hostinfo on Darwin
1515 _cpuinfo="hostinfo"
1516 elif aix; then
1517 # use 'lsattr' on AIX
1518 _cpuinfo="lsattr -E -l proc0 -a type"
1519 elif x86; then
1520 # all other OSes try to extract CPU information from a small helper
1521 # program cpuinfo instead
1522 $_cc -o cpuinfo$_exesuf cpuinfo.c
1523 _cpuinfo="./cpuinfo$_exesuf"
1526 if x86 ; then
1527 # gather more CPU information
1528 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1529 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1530 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1531 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1532 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1534 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1536 pparam=$(echo $exts | sed -e s/xmm/sse/ -e s/kni/sse/)
1537 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1538 pparam=$(echo $pparam | sed -e 's/sse/sse mmxext/')
1540 for ext in $pparam ; do
1541 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1542 done
1544 echocheck "CPU vendor"
1545 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1547 echocheck "CPU type"
1548 echores "$pname"
1551 fi # test "$_runtime_cpudetection" = no
1553 if x86 && test "$_runtime_cpudetection" = no ; then
1554 extcheck() {
1555 if test "$1" = kernel_check ; then
1556 echocheck "kernel support of $2"
1557 cat > $TMPC <<EOF
1558 #include <stdlib.h>
1559 #include <signal.h>
1560 static void catch(int sig) { exit(1); }
1561 int main(void) {
1562 signal(SIGILL, catch);
1563 __asm__ volatile ("$3":::"memory"); return 0;
1567 if cc_check && tmp_run ; then
1568 eval _$2=yes
1569 echores "yes"
1570 _optimizing="$_optimizing $2"
1571 return 0
1572 else
1573 eval _$2=no
1574 echores "failed"
1575 echo "It seems that your kernel does not correctly support $2."
1576 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1577 return 1
1580 return 0
1583 extcheck $_mmx "mmx" "emms"
1584 extcheck $_mmxext "mmxext" "sfence"
1585 extcheck $_3dnow "3dnow" "femms"
1586 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1587 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1588 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1589 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1590 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1592 if test "$_gcc3_ext" != ""; then
1593 # if we had to disable sse/sse2 because the active kernel does not
1594 # support this instruction set extension, we also have to tell
1595 # gcc3 to not generate sse/sse2 instructions for normal C code
1596 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1602 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1603 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1604 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1605 subarch_all='X86_32 X86_64 PPC64'
1606 case "$host_arch" in
1607 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1608 arch='x86'
1609 subarch='x86_32'
1610 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1611 iproc=486
1612 proc=i486
1615 if test "$_runtime_cpudetection" = no ; then
1616 case "$pvendor" in
1617 AuthenticAMD)
1618 case "$pfamily" in
1619 3) proc=i386 iproc=386 ;;
1620 4) proc=i486 iproc=486 ;;
1621 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1622 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1623 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1624 proc=k6-3
1625 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1626 proc=geode
1627 elif test "$pmodel" -ge 8; then
1628 proc=k6-2
1629 elif test "$pmodel" -ge 6; then
1630 proc=k6
1631 else
1632 proc=i586
1635 6) iproc=686
1636 # It's a bit difficult to determine the correct type of Family 6
1637 # AMD CPUs just from their signature. Instead, we check directly
1638 # whether it supports SSE.
1639 if test "$_sse" = yes; then
1640 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1641 proc=athlon-xp
1642 else
1643 # Again, gcc treats athlon and athlon-tbird similarly.
1644 proc=athlon
1647 15) iproc=686
1648 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1649 # caught and remedied in the optimization tests below.
1650 proc=k8
1653 *) proc=amdfam10 iproc=686
1654 test $_fast_clz = "auto" && _fast_clz=yes
1656 esac
1658 GenuineIntel)
1659 case "$pfamily" in
1660 3) proc=i386 iproc=386 ;;
1661 4) proc=i486 iproc=486 ;;
1662 5) iproc=586
1663 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1664 proc=pentium-mmx # 4 is desktop, 8 is mobile
1665 else
1666 proc=i586
1669 6) iproc=686
1670 if test "$pmodel" -ge 15; then
1671 proc=core2
1672 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1673 proc=pentium-m
1674 elif test "$pmodel" -ge 7; then
1675 proc=pentium3
1676 elif test "$pmodel" -ge 3; then
1677 proc=pentium2
1678 else
1679 proc=i686
1681 test $_fast_clz = "auto" && _fast_clz=yes
1683 15) iproc=686
1684 # A nocona in 32-bit mode has no more capabilities than a prescott.
1685 if test "$pmodel" -ge 3; then
1686 proc=prescott
1687 else
1688 proc=pentium4
1689 test $_fast_clz = "auto" && _fast_clz=yes
1691 test $_fast_cmov = "auto" && _fast_cmov=no
1693 *) proc=prescott iproc=686 ;;
1694 esac
1696 CentaurHauls)
1697 case "$pfamily" in
1698 5) iproc=586
1699 if test "$pmodel" -ge 8; then
1700 proc=winchip2
1701 elif test "$pmodel" -ge 4; then
1702 proc=winchip-c6
1703 else
1704 proc=i586
1707 6) iproc=686
1708 if test "$pmodel" -ge 9; then
1709 proc=c3-2
1710 else
1711 proc=c3
1712 iproc=586
1715 *) proc=i686 iproc=i686 ;;
1716 esac
1718 unknown)
1719 case "$pfamily" in
1720 3) proc=i386 iproc=386 ;;
1721 4) proc=i486 iproc=486 ;;
1722 *) proc=i586 iproc=586 ;;
1723 esac
1726 proc=i586 iproc=586 ;;
1727 esac
1728 test $_fast_clz = "auto" && _fast_clz=no
1729 fi # test "$_runtime_cpudetection" = no
1732 # check that gcc supports our CPU, if not, fall back to earlier ones
1733 # LGB: check -mcpu and -march swithing step by step with enabling
1734 # to fall back till 386.
1736 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1738 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1739 cpuopt=-mtune
1740 else
1741 cpuopt=-mcpu
1744 echocheck "GCC & CPU optimization abilities"
1745 if test "$_runtime_cpudetection" = no ; then
1746 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1747 cflag_check -march=native && proc=native
1749 if test "$proc" = "amdfam10"; then
1750 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1752 if test "$proc" = "k8"; then
1753 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1755 if test "$proc" = "athlon-xp"; then
1756 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1758 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1759 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1761 if test "$proc" = "k6" || test "$proc" = "c3"; then
1762 if ! cflag_check -march=$proc $cpuopt=$proc; then
1763 if cflag_check -march=i586 $cpuopt=i686; then
1764 proc=i586-i686
1765 else
1766 proc=i586
1770 if test "$proc" = "prescott" ; then
1771 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1773 if test "$proc" = "core2" ; then
1774 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1776 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
1777 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1779 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1780 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1782 if test "$proc" = "i586"; then
1783 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1785 if test "$proc" = "i486" ; then
1786 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1788 if test "$proc" = "i386" ; then
1789 cflag_check -march=$proc $cpuopt=$proc || proc=error
1791 if test "$proc" = "error" ; then
1792 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1793 _mcpu=""
1794 _march=""
1795 _optimizing=""
1796 elif test "$proc" = "i586-i686"; then
1797 _march="-march=i586"
1798 _mcpu="$cpuopt=i686"
1799 _optimizing="$proc"
1800 else
1801 _march="-march=$proc"
1802 _mcpu="$cpuopt=$proc"
1803 _optimizing="$proc"
1805 else # if test "$_runtime_cpudetection" = no
1806 _mcpu="$cpuopt=generic"
1807 # at least i486 required, for bswap instruction
1808 _march="-march=i486"
1809 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1810 cflag_check $_mcpu || _mcpu=""
1811 cflag_check $_march $_mcpu || _march=""
1814 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1815 ## autodetected mcpu/march parameters
1816 if test "$_target" ; then
1817 # TODO: it may be a good idea to check GCC and fall back in all cases
1818 if test "$host_arch" = "i586-i686"; then
1819 _march="-march=i586"
1820 _mcpu="$cpuopt=i686"
1821 else
1822 _march="-march=$host_arch"
1823 _mcpu="$cpuopt=$host_arch"
1826 proc="$host_arch"
1828 case "$proc" in
1829 i386) iproc=386 ;;
1830 i486) iproc=486 ;;
1831 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1832 i686|athlon*|pentium*) iproc=686 ;;
1833 *) iproc=586 ;;
1834 esac
1837 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1838 _fast_cmov="yes"
1839 else
1840 _fast_cmov="no"
1842 test $_fast_clz = "auto" && _fast_clz=yes
1844 echores "$proc"
1847 ia64)
1848 arch='ia64'
1849 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1850 iproc='ia64'
1853 x86_64|amd64)
1854 arch='x86'
1855 subarch='x86_64'
1856 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1857 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1858 iproc='x86_64'
1860 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1861 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1862 cpuopt=-mtune
1863 else
1864 cpuopt=-mcpu
1866 if test "$_runtime_cpudetection" = no ; then
1867 case "$pvendor" in
1868 AuthenticAMD)
1869 case "$pfamily" in
1870 15) proc=k8
1871 test $_fast_clz = "auto" && _fast_clz=no
1873 *) proc=amdfam10;;
1874 esac
1876 GenuineIntel)
1877 case "$pfamily" in
1878 6) proc=core2;;
1880 # 64-bit prescotts exist, but as far as GCC is concerned they
1881 # have the same capabilities as a nocona.
1882 proc=nocona
1883 test $_fast_cmov = "auto" && _fast_cmov=no
1884 test $_fast_clz = "auto" && _fast_clz=no
1886 esac
1889 proc=error;;
1890 esac
1891 fi # test "$_runtime_cpudetection" = no
1893 echocheck "GCC & CPU optimization abilities"
1894 # This is a stripped-down version of the i386 fallback.
1895 if test "$_runtime_cpudetection" = no ; then
1896 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1897 cflag_check -march=native && proc=native
1899 # --- AMD processors ---
1900 if test "$proc" = "amdfam10"; then
1901 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1903 if test "$proc" = "k8"; then
1904 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1906 # This will fail if gcc version < 3.3, which is ok because earlier
1907 # versions don't really support 64-bit on amd64.
1908 # Is this a valid assumption? -Corey
1909 if test "$proc" = "athlon-xp"; then
1910 cflag_check -march=$proc $cpuopt=$proc || proc=error
1912 # --- Intel processors ---
1913 if test "$proc" = "core2"; then
1914 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1916 if test "$proc" = "x86-64"; then
1917 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1919 if test "$proc" = "nocona"; then
1920 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1922 if test "$proc" = "pentium4"; then
1923 cflag_check -march=$proc $cpuopt=$proc || proc=error
1926 _march="-march=$proc"
1927 _mcpu="$cpuopt=$proc"
1928 if test "$proc" = "error" ; then
1929 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1930 _mcpu=""
1931 _march=""
1933 else # if test "$_runtime_cpudetection" = no
1934 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1935 _march="-march=x86-64"
1936 _mcpu="$cpuopt=generic"
1937 cflag_check $_mcpu || _mcpu="x86-64"
1938 cflag_check $_mcpu || _mcpu=""
1939 cflag_check $_march $_mcpu || _march=""
1942 _optimizing="$proc"
1943 test $_fast_cmov = "auto" && _fast_cmov=yes
1944 test $_fast_clz = "auto" && _fast_clz=yes
1946 echores "$proc"
1949 sparc|sparc64)
1950 arch='sparc'
1951 iproc='sparc'
1952 if test "$host_arch" = "sparc64" ; then
1953 _vis='yes'
1954 proc='ultrasparc'
1955 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1956 elif sunos ; then
1957 echocheck "CPU type"
1958 karch=$(uname -m)
1959 case "$(echo $karch)" in
1960 sun4) proc=v7 ;;
1961 sun4c) proc=v7 ;;
1962 sun4d) proc=v8 ;;
1963 sun4m) proc=v8 ;;
1964 sun4u) proc=ultrasparc _vis='yes' ;;
1965 sun4v) proc=v9 ;;
1966 *) proc=v8 ;;
1967 esac
1968 echores "$proc"
1969 else
1970 proc=v8
1972 _mcpu="-mcpu=$proc"
1973 _optimizing="$proc"
1976 arm*)
1977 arch='arm'
1978 iproc='arm'
1981 avr32)
1982 arch='avr32'
1983 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1984 iproc='avr32'
1985 test $_fast_clz = "auto" && _fast_clz=yes
1988 sh|sh4)
1989 arch='sh4'
1990 iproc='sh4'
1993 ppc|ppc64|powerpc|powerpc64)
1994 arch='ppc'
1995 def_dcbzl='#define HAVE_DCBZL 0'
1996 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1997 iproc='ppc'
1999 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2000 subarch='ppc64'
2001 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2003 echocheck "CPU type"
2004 case $system_name in
2005 Linux)
2006 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2007 if test -n "$($_cpuinfo | grep altivec)"; then
2008 test $_altivec = auto && _altivec=yes
2011 Darwin)
2012 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2013 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2014 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2015 test $_altivec = auto && _altivec=yes
2018 NetBSD)
2019 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2020 case $cc_version in
2021 2*|3.0*|3.1*|3.2*|3.3*)
2024 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2025 test $_altivec = auto && _altivec=yes
2028 esac
2030 AIX)
2031 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2033 esac
2034 if test "$_altivec" = yes; then
2035 echores "$proc altivec"
2036 else
2037 _altivec=no
2038 echores "$proc"
2041 echocheck "GCC & CPU optimization abilities"
2043 if test -n "$proc"; then
2044 case "$proc" in
2045 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2046 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2047 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2048 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2049 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2050 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2051 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2052 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2053 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2054 *) ;;
2055 esac
2056 # gcc 3.1(.1) and up supports 7400 and 7450
2057 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2058 case "$proc" in
2059 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2060 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2061 *) ;;
2062 esac
2064 # gcc 3.2 and up supports 970
2065 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2066 case "$proc" in
2067 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2068 def_dcbzl='#define HAVE_DCBZL 1' ;;
2069 *) ;;
2070 esac
2072 # gcc 3.3 and up supports POWER4
2073 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2074 case "$proc" in
2075 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2076 *) ;;
2077 esac
2079 # gcc 3.4 and up supports 440*
2080 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2081 case "$proc" in
2082 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2083 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2084 *) ;;
2085 esac
2087 # gcc 4.0 and up supports POWER5
2088 if test "$_cc_major" -ge "4"; then
2089 case "$proc" in
2090 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2091 *) ;;
2092 esac
2096 if test -n "$_mcpu"; then
2097 _optimizing=$(echo $_mcpu | cut -c 8-)
2098 echores "$_optimizing"
2099 else
2100 echores "none"
2103 test $_fast_clz = "auto" && _fast_clz=yes
2107 alpha*)
2108 arch='alpha'
2109 iproc='alpha'
2110 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2112 echocheck "CPU type"
2113 cat > $TMPC << EOF
2114 int main(void) {
2115 unsigned long ver, mask;
2116 __asm__ ("implver %0" : "=r" (ver));
2117 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2118 printf("%ld-%x\n", ver, ~mask);
2119 return 0;
2122 $_cc -o "$TMPEXE" "$TMPC"
2123 case $("$TMPEXE") in
2125 0-0) proc="ev4"; _mvi="0";;
2126 1-0) proc="ev5"; _mvi="0";;
2127 1-1) proc="ev56"; _mvi="0";;
2128 1-101) proc="pca56"; _mvi="1";;
2129 2-303) proc="ev6"; _mvi="1";;
2130 2-307) proc="ev67"; _mvi="1";;
2131 2-1307) proc="ev68"; _mvi="1";;
2132 esac
2133 echores "$proc"
2135 echocheck "GCC & CPU optimization abilities"
2136 if test "$proc" = "ev68" ; then
2137 cc_check -mcpu=$proc || proc=ev67
2139 if test "$proc" = "ev67" ; then
2140 cc_check -mcpu=$proc || proc=ev6
2142 _mcpu="-mcpu=$proc"
2143 echores "$proc"
2145 test $_fast_clz = "auto" && _fast_clz=yes
2147 _optimizing="$proc"
2150 mips*)
2151 arch='mips'
2152 iproc='mips'
2154 test $_fast_clz = "auto" && _fast_clz=yes
2158 hppa)
2159 arch='pa_risc'
2160 iproc='PA-RISC'
2163 s390)
2164 arch='s390'
2165 iproc='390'
2168 s390x)
2169 arch='s390x'
2170 iproc='390x'
2173 vax)
2174 arch='vax'
2175 iproc='vax'
2178 xtensa)
2179 arch='xtensa'
2180 iproc='xtensa'
2183 generic)
2184 arch='generic'
2188 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2189 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2190 die "unsupported architecture $host_arch"
2192 esac # case "$host_arch" in
2194 if test "$_runtime_cpudetection" = yes ; then
2195 if x86 ; then
2196 test "$_cmov" != no && _cmov=yes
2197 x86_32 && _cmov=no
2198 test "$_mmx" != no && _mmx=yes
2199 test "$_3dnow" != no && _3dnow=yes
2200 test "$_3dnowext" != no && _3dnowext=yes
2201 test "$_mmxext" != no && _mmxext=yes
2202 test "$_sse" != no && _sse=yes
2203 test "$_sse2" != no && _sse2=yes
2204 test "$_ssse3" != no && _ssse3=yes
2206 if ppc; then
2207 _altivec=yes
2212 # endian testing
2213 echocheck "byte order"
2214 if test "$_big_endian" = auto ; then
2215 cat > $TMPC <<EOF
2216 short ascii_name[] = {
2217 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2218 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2219 int main(void) { return (long)ascii_name; }
2221 if cc_check ; then
2222 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2223 _big_endian=yes
2224 else
2225 _big_endian=no
2227 else
2228 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2231 if test "$_big_endian" = yes ; then
2232 _byte_order='big-endian'
2233 def_words_endian='#define WORDS_BIGENDIAN 1'
2234 def_bigendian='#define HAVE_BIGENDIAN 1'
2235 else
2236 _byte_order='little-endian'
2237 def_words_endian='#undef WORDS_BIGENDIAN'
2238 def_bigendian='#define HAVE_BIGENDIAN 0'
2240 echores "$_byte_order"
2243 echocheck "extern symbol prefix"
2244 cat > $TMPC << EOF
2245 int ff_extern;
2247 cc_check -c || die "Symbol mangling check failed."
2248 sym=$($_nm -P -g $TMPEXE)
2249 extern_prefix=${sym%%ff_extern*}
2250 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2251 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2252 echores $extern_prefix
2255 echocheck "assembler support of -pipe option"
2256 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2257 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2260 if darwin && test "$cc_vendor" = "gnu" ; then
2261 echocheck "GCC support of -mstackrealign"
2262 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2263 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2264 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2265 # wrong code with this flag, but this can be worked around by adding
2266 # -fno-unit-at-a-time as described in the blog post at
2267 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2268 cat > $TMPC << EOF
2269 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2270 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2272 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2273 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2274 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2275 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2276 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2279 # Checking for CFLAGS
2280 _install_strip="-s"
2281 if test "$_profile" != "" || test "$_debug" != "" ; then
2282 _install_strip=
2284 if test -z "$CFLAGS" ; then
2285 if test "$cc_vendor" = "intel" ; then
2286 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2287 WARNFLAGS="-wd167 -wd556 -wd144"
2288 elif test "$cc_vendor" = "sun" ; then
2289 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2290 elif test "$cc_vendor" = "clang"; then
2291 CFLAGS="-O2 $_debug $_profile $_march $_pipe"
2292 WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2293 ERRORFLAGS="-Werror=implicit-function-declaration"
2294 elif test "$cc_vendor" != "gnu" ; then
2295 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2296 else
2297 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2298 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2299 ERRORFLAGS="-Werror-implicit-function-declaration"
2300 extra_ldflags="$extra_ldflags -ffast-math"
2302 else
2303 warn_cflags=yes
2306 if test "$cc_vendor" = "gnu" ; then
2307 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2308 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2309 # that's the only variable specific to C now, and this option is not valid
2310 # for C++.
2311 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2312 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2313 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2314 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2315 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2316 else
2317 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2320 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2321 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2324 if test -n "$LDFLAGS" ; then
2325 extra_ldflags="$extra_ldflags $LDFLAGS"
2326 warn_cflags=yes
2327 elif test "$cc_vendor" = "intel" ; then
2328 extra_ldflags="$extra_ldflags -i-static"
2330 if test -n "$CPPFLAGS" ; then
2331 extra_cflags="$extra_cflags $CPPFLAGS"
2332 warn_cflags=yes
2337 if x86_32 ; then
2338 # Checking assembler (_as) compatibility...
2339 # Added workaround for older as that reads from stdin by default - atmos
2340 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2341 echocheck "assembler ($_as $as_version)"
2343 _pref_as_version='2.9.1'
2344 echo 'nop' > $TMPS
2345 if test "$_mmx" = yes ; then
2346 echo 'emms' >> $TMPS
2348 if test "$_3dnow" = yes ; then
2349 _pref_as_version='2.10.1'
2350 echo 'femms' >> $TMPS
2352 if test "$_3dnowext" = yes ; then
2353 _pref_as_version='2.10.1'
2354 echo 'pswapd %mm0, %mm0' >> $TMPS
2356 if test "$_mmxext" = yes ; then
2357 _pref_as_version='2.10.1'
2358 echo 'movntq %mm0, (%eax)' >> $TMPS
2360 if test "$_sse" = yes ; then
2361 _pref_as_version='2.10.1'
2362 echo 'xorps %xmm0, %xmm0' >> $TMPS
2364 #if test "$_sse2" = yes ; then
2365 # _pref_as_version='2.11'
2366 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2368 if test "$_cmov" = yes ; then
2369 _pref_as_version='2.10.1'
2370 echo 'cmovb %eax, %ebx' >> $TMPS
2372 if test "$_ssse3" = yes ; then
2373 _pref_as_version='2.16.92'
2374 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2376 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2378 if test "$as_verc_fail" != yes ; then
2379 echores "ok"
2380 else
2381 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2382 echores "failed"
2383 die "obsolete binutils version"
2386 fi #if x86_32
2389 echocheck "PIC"
2390 pic=no
2391 cat > $TMPC << EOF
2392 int main(void) {
2393 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2394 #error PIC not enabled
2395 #endif
2396 return 0;
2399 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2400 echores $pic
2403 if x86 ; then
2405 echocheck ".align is a power of two"
2406 if test "$_asmalign_pot" = auto ; then
2407 _asmalign_pot=no
2408 inline_asm_check '".align 3"' && _asmalign_pot=yes
2410 if test "$_asmalign_pot" = "yes" ; then
2411 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2412 else
2413 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2415 echores $_asmalign_pot
2418 echocheck "ebx availability"
2419 ebx_available=no
2420 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2421 cat > $TMPC << EOF
2422 int main(void) {
2423 int x;
2424 __asm__ volatile(
2425 "xor %0, %0"
2426 :"=b"(x)
2427 // just adding ebx to clobber list seems unreliable with some
2428 // compilers, e.g. Haiku's gcc 2.95
2430 // and the above check does not work for OSX 64 bit...
2431 __asm__ volatile("":::"%ebx");
2432 return 0;
2435 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2436 echores $ebx_available
2439 echocheck "yasm"
2440 if test -z "$YASMFLAGS" ; then
2441 if darwin ; then
2442 x86_64 && objformat="macho64" || objformat="macho"
2443 elif win32 ; then
2444 objformat="win32"
2445 else
2446 objformat="elf"
2448 # currently tested for Linux x86, x86_64
2449 YASMFLAGS="-f $objformat"
2450 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2451 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2452 case "$objformat" in
2453 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2454 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2455 esac
2456 else
2457 warn_cflags=yes
2460 echo "pabsw xmm0, xmm0" > $TMPS
2461 yasm_check || _yasm=""
2462 if test $_yasm ; then
2463 def_yasm='#define HAVE_YASM 1'
2464 have_yasm="yes"
2465 echores "$_yasm"
2466 else
2467 def_yasm='#define HAVE_YASM 0'
2468 have_yasm="no"
2469 echores "no"
2472 echocheck "bswap"
2473 def_bswap='#define HAVE_BSWAP 0'
2474 echo 'bswap %eax' > $TMPS
2475 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2476 echores "$bswap"
2477 fi #if x86
2480 #FIXME: This should happen before the check for CFLAGS..
2481 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2482 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2484 # check if AltiVec is supported by the compiler, and how to enable it
2485 echocheck "GCC AltiVec flags"
2486 if $(cflag_check -maltivec -mabi=altivec) ; then
2487 _altivec_gcc_flags="-maltivec -mabi=altivec"
2488 # check if <altivec.h> should be included
2489 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2490 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2491 inc_altivec_h='#include <altivec.h>'
2492 else
2493 if $(cflag_check -faltivec) ; then
2494 _altivec_gcc_flags="-faltivec"
2495 else
2496 _altivec=no
2497 _altivec_gcc_flags="none, AltiVec disabled"
2501 echores "$_altivec_gcc_flags"
2503 # check if the compiler supports braces for vector declarations
2504 cat > $TMPC << EOF
2505 $inc_altivec_h
2506 int main(void) { (vector int) {1}; return 0; }
2508 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2510 # Disable runtime cpudetection if we cannot generate AltiVec code or
2511 # AltiVec is disabled by the user.
2512 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2513 && _runtime_cpudetection=no
2515 # Show that we are optimizing for AltiVec (if enabled and supported).
2516 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2517 && _optimizing="$_optimizing altivec"
2519 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2520 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2523 if ppc ; then
2524 def_xform_asm='#define HAVE_XFORM_ASM 0'
2525 xform_asm=no
2526 echocheck "XFORM ASM support"
2527 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2528 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2529 echores "$xform_asm"
2532 if arm ; then
2533 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2534 if test $_armv5te = "auto" ; then
2535 _armv5te=no
2536 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2538 echores "$_armv5te"
2540 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2542 echocheck "ARMv6 (SIMD instructions)"
2543 if test $_armv6 = "auto" ; then
2544 _armv6=no
2545 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2547 echores "$_armv6"
2549 echocheck "ARMv6t2 (SIMD instructions)"
2550 if test $_armv6t2 = "auto" ; then
2551 _armv6t2=no
2552 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2554 echores "$_armv6t2"
2556 echocheck "ARM VFP"
2557 if test $_armvfp = "auto" ; then
2558 _armvfp=no
2559 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2561 echores "$_armvfp"
2563 echocheck "ARM NEON"
2564 if test $neon = "auto" ; then
2565 neon=no
2566 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2568 echores "$neon"
2570 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2571 if test $_iwmmxt = "auto" ; then
2572 _iwmmxt=no
2573 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2575 echores "$_iwmmxt"
2578 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2579 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2580 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2581 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2582 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2583 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2584 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2585 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2586 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2587 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2588 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2589 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2590 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2591 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2592 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2593 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2594 test "$neon" = yes && cpuexts="NEON $cpuexts"
2595 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2596 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2597 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2599 # Checking kernel version...
2600 if x86_32 && linux ; then
2601 _k_verc_problem=no
2602 kernel_version=$(uname -r 2>&1)
2603 echocheck "$system_name kernel version"
2604 case "$kernel_version" in
2605 '') kernel_version="?.??"; _k_verc_fail=yes;;
2606 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2607 _k_verc_problem=yes;;
2608 esac
2609 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2610 _k_verc_fail=yes
2612 if test "$_k_verc_fail" ; then
2613 echores "$kernel_version, fail"
2614 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2615 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2616 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2617 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2618 echo "2.2.x you must upgrade it to get SSE support!"
2619 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2620 else
2621 echores "$kernel_version, ok"
2625 ######################
2626 # MAIN TESTS GO HERE #
2627 ######################
2630 echocheck "-lposix"
2631 if cflag_check -lposix ; then
2632 extra_ldflags="$extra_ldflags -lposix"
2633 echores "yes"
2634 else
2635 echores "no"
2638 echocheck "-lm"
2639 if cflag_check -lm ; then
2640 _ld_lm="-lm"
2641 echores "yes"
2642 else
2643 _ld_lm=""
2644 echores "no"
2648 echocheck "langinfo"
2649 if test "$_langinfo" = auto ; then
2650 _langinfo=no
2651 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2653 if test "$_langinfo" = yes ; then
2654 def_langinfo='#define HAVE_LANGINFO 1'
2655 else
2656 def_langinfo='#undef HAVE_LANGINFO'
2658 echores "$_langinfo"
2661 echocheck "translation support"
2662 if test "$_translation" = yes; then
2663 def_translation="#define CONFIG_TRANSLATION 1"
2664 else
2665 def_translation="#undef CONFIG_TRANSLATION"
2667 echores "$_translation"
2669 echocheck "language"
2670 # Set preferred languages, "all" uses English as main language.
2671 test -z "$language" && language=$LINGUAS
2672 test -z "$language_doc" && language_doc=$language
2673 test -z "$language_man" && language_man=$language
2674 test -z "$language_msg" && language_msg=$language
2675 test -z "$language_msg" && language_msg="all"
2676 language_doc=$(echo $language_doc | tr , " ")
2677 language_man=$(echo $language_man | tr , " ")
2678 language_msg=$(echo $language_msg | tr , " ")
2680 test "$language_doc" = "all" && language_doc=$doc_lang_all
2681 test "$language_man" = "all" && language_man=$man_lang_all
2682 test "$language_msg" = "all" && language_msg=$msg_lang_all
2684 if test "$_translation" != yes ; then
2685 language_msg=""
2688 # Prune non-existing translations from language lists.
2689 # Set message translation to the first available language.
2690 # Fall back on English.
2691 for lang in $language_doc ; do
2692 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2693 done
2694 language_doc=$tmp_language_doc
2695 test -z "$language_doc" && language_doc=en
2697 for lang in $language_man ; do
2698 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2699 done
2700 language_man=$tmp_language_man
2701 test -z "$language_man" && language_man=en
2703 for lang in $language_msg ; do
2704 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2705 done
2706 language_msg=$tmp_language_msg
2708 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2711 echocheck "enable sighandler"
2712 if test "$_sighandler" = yes ; then
2713 def_sighandler='#define CONFIG_SIGHANDLER 1'
2714 else
2715 def_sighandler='#undef CONFIG_SIGHANDLER'
2717 echores "$_sighandler"
2719 echocheck "runtime cpudetection"
2720 if test "$_runtime_cpudetection" = yes ; then
2721 _optimizing="Runtime CPU-Detection enabled"
2722 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2723 else
2724 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2726 echores "$_runtime_cpudetection"
2729 echocheck "restrict keyword"
2730 for restrict_keyword in restrict __restrict __restrict__ ; do
2731 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2732 if cc_check; then
2733 def_restrict_keyword=$restrict_keyword
2734 break;
2736 done
2737 if [ -n "$def_restrict_keyword" ]; then
2738 echores "$def_restrict_keyword"
2739 else
2740 echores "none"
2742 # Avoid infinite recursion loop ("#define restrict restrict")
2743 if [ "$def_restrict_keyword" != "restrict" ]; then
2744 def_restrict_keyword="#define restrict $def_restrict_keyword"
2745 else
2746 def_restrict_keyword=""
2750 echocheck "__builtin_expect"
2751 # GCC branch prediction hint
2752 cat > $TMPC << EOF
2753 static int foo(int a) {
2754 a = __builtin_expect(a, 10);
2755 return a == 10 ? 0 : 1;
2757 int main(void) { return foo(10) && foo(0); }
2759 _builtin_expect=no
2760 cc_check && _builtin_expect=yes
2761 if test "$_builtin_expect" = yes ; then
2762 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2763 else
2764 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2766 echores "$_builtin_expect"
2769 echocheck "kstat"
2770 _kstat=no
2771 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2772 if test "$_kstat" = yes ; then
2773 def_kstat="#define HAVE_LIBKSTAT 1"
2774 extra_ldflags="$extra_ldflags -lkstat"
2775 else
2776 def_kstat="#undef HAVE_LIBKSTAT"
2778 echores "$_kstat"
2781 echocheck "posix4"
2782 # required for nanosleep on some systems
2783 _posix4=no
2784 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2785 if test "$_posix4" = yes ; then
2786 extra_ldflags="$extra_ldflags -lposix4"
2788 echores "$_posix4"
2790 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2791 echocheck $func
2792 eval _$func=no
2793 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2794 if eval test "x\$_$func" = "xyes"; then
2795 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2796 echores yes
2797 else
2798 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2799 echores no
2801 done
2804 echocheck "mkstemp"
2805 _mkstemp=no
2806 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2807 if test "$_mkstemp" = yes ; then
2808 def_mkstemp='#define HAVE_MKSTEMP 1'
2809 else
2810 def_mkstemp='#define HAVE_MKSTEMP 0'
2812 echores "$_mkstemp"
2815 echocheck "nanosleep"
2816 _nanosleep=no
2817 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2818 if test "$_nanosleep" = yes ; then
2819 def_nanosleep='#define HAVE_NANOSLEEP 1'
2820 else
2821 def_nanosleep='#undef HAVE_NANOSLEEP'
2823 echores "$_nanosleep"
2826 echocheck "socklib"
2827 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2828 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2829 cat > $TMPC << EOF
2830 #include <netdb.h>
2831 #include <sys/socket.h>
2832 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2834 _socklib=no
2835 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2836 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2837 done
2838 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2839 if test $_winsock2_h = auto ; then
2840 _winsock2_h=no
2841 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2843 test "$_ld_sock" && res_comment="using $_ld_sock"
2844 echores "$_socklib"
2847 if test $_winsock2_h = yes ; then
2848 _ld_sock="-lws2_32"
2849 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2850 else
2851 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2855 echocheck "arpa/inet.h"
2856 arpa_inet_h=no
2857 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2858 header_check arpa/inet.h && arpa_inet_h=yes &&
2859 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2860 echores "$arpa_inet_h"
2863 echocheck "inet_pton()"
2864 def_inet_pton='#define HAVE_INET_PTON 0'
2865 inet_pton=no
2866 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2867 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2868 done
2869 if test $inet_pton = yes ; then
2870 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2871 def_inet_pton='#define HAVE_INET_PTON 1'
2873 echores "$inet_pton"
2876 echocheck "inet_aton()"
2877 def_inet_aton='#define HAVE_INET_ATON 0'
2878 inet_aton=no
2879 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2880 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2881 done
2882 if test $inet_aton = yes ; then
2883 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2884 def_inet_aton='#define HAVE_INET_ATON 1'
2886 echores "$inet_aton"
2889 echocheck "socklen_t"
2890 _socklen_t=no
2891 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2892 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2893 done
2894 if test "$_socklen_t" = yes ; then
2895 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2896 else
2897 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2899 echores "$_socklen_t"
2902 echocheck "closesocket()"
2903 _closesocket=no
2904 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2905 if test "$_closesocket" = yes ; then
2906 def_closesocket='#define HAVE_CLOSESOCKET 1'
2907 else
2908 def_closesocket='#define HAVE_CLOSESOCKET 0'
2910 echores "$_closesocket"
2913 echocheck "networking"
2914 test $_winsock2_h = no && test $inet_pton = no &&
2915 test $inet_aton = no && networking=no
2916 if test "$networking" = yes ; then
2917 def_network='#define CONFIG_NETWORK 1'
2918 def_networking='#define CONFIG_NETWORKING 1'
2919 extra_ldflags="$extra_ldflags $_ld_sock"
2920 inputmodules="networking $inputmodules"
2921 else
2922 noinputmodules="networking $noinputmodules"
2923 def_network='#define CONFIG_NETWORK 0'
2924 def_networking='#undef CONFIG_NETWORKING'
2926 echores "$networking"
2929 echocheck "inet6"
2930 if test "$_inet6" = auto ; then
2931 cat > $TMPC << EOF
2932 #include <sys/types.h>
2933 #if !defined(_WIN32)
2934 #include <sys/socket.h>
2935 #include <netinet/in.h>
2936 #else
2937 #include <ws2tcpip.h>
2938 #endif
2939 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2941 _inet6=no
2942 if cc_check $_ld_sock ; then
2943 _inet6=yes
2946 if test "$_inet6" = yes ; then
2947 def_inet6='#define HAVE_AF_INET6 1'
2948 else
2949 def_inet6='#undef HAVE_AF_INET6'
2951 echores "$_inet6"
2954 echocheck "gethostbyname2"
2955 if test "$_gethostbyname2" = auto ; then
2956 cat > $TMPC << EOF
2957 #include <sys/types.h>
2958 #include <sys/socket.h>
2959 #include <netdb.h>
2960 int main(void) { gethostbyname2("", AF_INET); return 0; }
2962 _gethostbyname2=no
2963 if cc_check ; then
2964 _gethostbyname2=yes
2967 if test "$_gethostbyname2" = yes ; then
2968 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
2969 else
2970 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
2972 echores "$_gethostbyname2"
2975 echocheck "inttypes.h (required)"
2976 _inttypes=no
2977 header_check inttypes.h && _inttypes=yes
2978 echores "$_inttypes"
2980 if test "$_inttypes" = no ; then
2981 echocheck "sys/bitypes.h (inttypes.h predecessor)"
2982 header_check sys/bitypes.h && _inttypes=yes
2983 if test "$_inttypes" = yes ; then
2984 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."
2985 else
2986 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2991 echocheck "malloc.h"
2992 _malloc=no
2993 header_check malloc.h && _malloc=yes
2994 if test "$_malloc" = yes ; then
2995 def_malloc_h='#define HAVE_MALLOC_H 1'
2996 else
2997 def_malloc_h='#define HAVE_MALLOC_H 0'
2999 echores "$_malloc"
3002 echocheck "memalign()"
3003 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3004 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3005 _memalign=no
3006 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3007 if test "$_memalign" = yes ; then
3008 def_memalign='#define HAVE_MEMALIGN 1'
3009 else
3010 def_memalign='#define HAVE_MEMALIGN 0'
3011 def_map_memalign='#define memalign(a, b) malloc(b)'
3012 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3014 echores "$_memalign"
3017 echocheck "posix_memalign()"
3018 posix_memalign=no
3019 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3020 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
3021 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3022 echores "$posix_memalign"
3025 echocheck "alloca.h"
3026 _alloca=no
3027 statement_check alloca.h 'alloca(0)' && _alloca=yes
3028 if cc_check ; then
3029 def_alloca_h='#define HAVE_ALLOCA_H 1'
3030 else
3031 def_alloca_h='#undef HAVE_ALLOCA_H'
3033 echores "$_alloca"
3036 echocheck "fastmemcpy"
3037 if test "$_fastmemcpy" = yes ; then
3038 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3039 else
3040 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3042 echores "$_fastmemcpy"
3045 echocheck "mman.h"
3046 _mman=no
3047 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3048 if test "$_mman" = yes ; then
3049 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3050 else
3051 def_mman_h='#undef HAVE_SYS_MMAN_H'
3053 echores "$_mman"
3055 _mman_has_map_failed=no
3056 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
3057 if test "$_mman_has_map_failed" = yes ; then
3058 def_mman_has_map_failed=''
3059 else
3060 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3063 echocheck "dynamic loader"
3064 _dl=no
3065 for _ld_tmp in "" "-ldl"; do
3066 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3067 done
3068 if test "$_dl" = yes ; then
3069 def_dl='#define HAVE_LIBDL 1'
3070 else
3071 def_dl='#undef HAVE_LIBDL'
3073 echores "$_dl"
3076 def_threads='#define HAVE_THREADS 0'
3078 echocheck "pthread"
3079 if linux ; then
3080 THREAD_CFLAGS=-D_REENTRANT
3081 elif freebsd || netbsd || openbsd || bsdos ; then
3082 THREAD_CFLAGS=-D_THREAD_SAFE
3084 if test "$_pthreads" = auto ; then
3085 cat > $TMPC << EOF
3086 #include <pthread.h>
3087 static void *func(void *arg) { return arg; }
3088 int main(void) {
3089 pthread_t tid;
3090 #ifdef PTW32_STATIC_LIB
3091 pthread_win32_process_attach_np();
3092 pthread_win32_thread_attach_np();
3093 #endif
3094 return pthread_create (&tid, 0, func, 0) != 0;
3097 _pthreads=no
3098 if ! hpux ; then
3099 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3100 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3101 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3102 done
3103 if test "$_pthreads" = no && mingw32 ; then
3104 _ld_tmp="-lpthreadGC2 -lws2_32"
3105 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
3109 if test "$_pthreads" = yes ; then
3110 test $_ld_pthread && res_comment="using $_ld_pthread"
3111 def_pthreads='#define HAVE_PTHREADS 1'
3112 def_threads='#define HAVE_THREADS 1'
3113 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3114 else
3115 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3116 def_pthreads='#undef HAVE_PTHREADS'
3117 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3118 mingw32 || _win32dll=no
3120 echores "$_pthreads"
3122 if cygwin ; then
3123 if test "$_pthreads" = yes ; then
3124 def_pthread_cache="#define PTHREAD_CACHE 1"
3125 else
3126 _stream_cache=no
3127 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3131 echocheck "w32threads"
3132 if test "$_pthreads" = yes ; then
3133 res_comment="using pthread instead"
3134 _w32threads=no
3136 if test "$_w32threads" = auto ; then
3137 _w32threads=no
3138 mingw32 && _w32threads=yes
3140 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3141 echores "$_w32threads"
3143 echocheck "rpath"
3144 if test "$_rpath" = yes ; then
3145 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3146 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3147 done
3148 extra_ldflags=$tmp
3150 echores "$_rpath"
3152 echocheck "iconv"
3153 if test "$_iconv" = auto ; then
3154 cat > $TMPC << EOF
3155 #include <stdio.h>
3156 #include <unistd.h>
3157 #include <iconv.h>
3158 #define INBUFSIZE 1024
3159 #define OUTBUFSIZE 4096
3161 char inbuffer[INBUFSIZE];
3162 char outbuffer[OUTBUFSIZE];
3164 int main(void) {
3165 size_t numread;
3166 iconv_t icdsc;
3167 char *tocode="UTF-8";
3168 char *fromcode="cp1250";
3169 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3170 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3171 char *iptr=inbuffer;
3172 char *optr=outbuffer;
3173 size_t inleft=numread;
3174 size_t outleft=OUTBUFSIZE;
3175 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3176 != (size_t)(-1)) {
3177 write(1, outbuffer, OUTBUFSIZE - outleft);
3180 if (iconv_close(icdsc) == -1)
3183 return 0;
3186 _iconv=no
3187 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3188 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3189 _iconv=yes && break
3190 done
3191 if test "$_iconv" != yes ; then
3192 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."
3195 if test "$_iconv" = yes ; then
3196 def_iconv='#define CONFIG_ICONV 1'
3197 else
3198 def_iconv='#undef CONFIG_ICONV'
3200 echores "$_iconv"
3203 echocheck "soundcard.h"
3204 _soundcard_h=no
3205 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3206 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3207 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3208 header_check $_soundcard_header && _soundcard_h=yes &&
3209 res_comment="$_soundcard_header" && break
3210 done
3212 if test "$_soundcard_h" = yes ; then
3213 if test $_soundcard_header = "sys/soundcard.h"; then
3214 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3215 else
3216 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3219 echores "$_soundcard_h"
3222 echocheck "sys/videoio.h"
3223 sys_videoio_h=no
3224 def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
3225 header_check sys/videoio.h && sys_videoio_h=yes &&
3226 def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
3227 echores "$sys_videoio_h"
3230 echocheck "sys/dvdio.h"
3231 _dvdio=no
3232 # FreeBSD 8.1 has broken dvdio.h
3233 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3234 if test "$_dvdio" = yes ; then
3235 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3236 else
3237 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3239 echores "$_dvdio"
3242 echocheck "sys/cdio.h"
3243 _cdio=no
3244 # at least OpenSolaris has a broken cdio.h
3245 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3246 if test "$_cdio" = yes ; then
3247 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3248 else
3249 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3251 echores "$_cdio"
3254 echocheck "linux/cdrom.h"
3255 _cdrom=no
3256 header_check linux/cdrom.h && _cdrom=yes
3257 if test "$_cdrom" = yes ; then
3258 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3259 else
3260 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3262 echores "$_cdrom"
3265 echocheck "dvd.h"
3266 _dvd=no
3267 header_check dvd.h && _dvd=yes
3268 if test "$_dvd" = yes ; then
3269 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3270 else
3271 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3273 echores "$_dvd"
3276 if bsdos; then
3277 echocheck "BSDI dvd.h"
3278 _bsdi_dvd=no
3279 header_check dvd.h && _bsdi_dvd=yes
3280 if test "$_bsdi_dvd" = yes ; then
3281 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3282 else
3283 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3285 echores "$_bsdi_dvd"
3286 fi #if bsdos
3289 if hpux; then
3290 # also used by AIX, but AIX does not support VCD and/or libdvdread
3291 echocheck "HP-UX SCSI header"
3292 _hpux_scsi_h=no
3293 header_check sys/scsi.h && _hpux_scsi_h=yes
3294 if test "$_hpux_scsi_h" = yes ; then
3295 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3296 else
3297 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3299 echores "$_hpux_scsi_h"
3300 fi #if hpux
3303 if sunos; then
3304 echocheck "userspace SCSI headers (Solaris)"
3305 _sol_scsi_h=no
3306 header_check sys/scsi/scsi_types.h &&
3307 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3308 _sol_scsi_h=yes
3309 if test "$_sol_scsi_h" = yes ; then
3310 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3311 else
3312 def_sol_scsi_h='#undef SOLARIS_USCSI'
3314 echores "$_sol_scsi_h"
3315 fi #if sunos
3318 echocheck "termcap"
3319 if test "$_termcap" = auto ; then
3320 _termcap=no
3321 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3322 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3323 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3324 done
3326 if test "$_termcap" = yes ; then
3327 def_termcap='#define HAVE_TERMCAP 1'
3328 test $_ld_tmp && res_comment="using $_ld_tmp"
3329 else
3330 def_termcap='#undef HAVE_TERMCAP'
3332 echores "$_termcap"
3335 echocheck "termios"
3336 def_termios='#undef HAVE_TERMIOS'
3337 def_termios_h='#undef HAVE_TERMIOS_H'
3338 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3339 if test "$_termios" = auto ; then
3340 _termios=no
3341 for _termios_header in "termios.h" "sys/termios.h"; do
3342 header_check $_termios_header && _termios=yes &&
3343 res_comment="using $_termios_header" && break
3344 done
3347 if test "$_termios" = yes ; then
3348 def_termios='#define HAVE_TERMIOS 1'
3349 if test "$_termios_header" = "termios.h" ; then
3350 def_termios_h='#define HAVE_TERMIOS_H 1'
3351 else
3352 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3355 echores "$_termios"
3358 echocheck "shm"
3359 if test "$_shm" = auto ; then
3360 _shm=no
3361 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3363 if test "$_shm" = yes ; then
3364 def_shm='#define HAVE_SHM 1'
3365 else
3366 def_shm='#undef HAVE_SHM'
3368 echores "$_shm"
3371 echocheck "strsep()"
3372 _strsep=no
3373 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3374 if test "$_strsep" = yes ; then
3375 def_strsep='#define HAVE_STRSEP 1'
3376 need_strsep=no
3377 else
3378 def_strsep='#undef HAVE_STRSEP'
3379 need_strsep=yes
3381 echores "$_strsep"
3384 echocheck "vsscanf()"
3385 cat > $TMPC << EOF
3386 #define _ISOC99_SOURCE
3387 #include <stdarg.h>
3388 #include <stdio.h>
3389 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3391 _vsscanf=no
3392 cc_check && _vsscanf=yes
3393 if test "$_vsscanf" = yes ; then
3394 def_vsscanf='#define HAVE_VSSCANF 1'
3395 need_vsscanf=no
3396 else
3397 def_vsscanf='#undef HAVE_VSSCANF'
3398 need_vsscanf=yes
3400 echores "$_vsscanf"
3403 echocheck "swab()"
3404 _swab=no
3405 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3406 statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3407 if test "$_swab" = yes ; then
3408 def_swab='#define HAVE_SWAB 1'
3409 need_swab=no
3410 else
3411 def_swab='#undef HAVE_SWAB'
3412 need_swab=yes
3414 echores "$_swab"
3416 echocheck "POSIX select()"
3417 cat > $TMPC << EOF
3418 #include <stdio.h>
3419 #include <stdlib.h>
3420 #include <sys/types.h>
3421 #include <string.h>
3422 #include <sys/time.h>
3423 #include <unistd.h>
3424 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3426 _posix_select=no
3427 def_posix_select='#undef HAVE_POSIX_SELECT'
3428 cc_check && _posix_select=yes &&
3429 def_posix_select='#define HAVE_POSIX_SELECT 1'
3430 echores "$_posix_select"
3433 echocheck "audio select()"
3434 if test "$_select" = no ; then
3435 def_select='#undef HAVE_AUDIO_SELECT'
3436 elif test "$_select" = yes ; then
3437 def_select='#define HAVE_AUDIO_SELECT 1'
3439 echores "$_select"
3442 echocheck "gettimeofday()"
3443 _gettimeofday=no
3444 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3445 if test "$_gettimeofday" = yes ; then
3446 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3447 need_gettimeofday=no
3448 else
3449 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3450 need_gettimeofday=yes
3452 echores "$_gettimeofday"
3455 echocheck "glob()"
3456 _glob=no
3457 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3458 need_glob=no
3459 if test "$_glob" = yes ; then
3460 def_glob='#define HAVE_GLOB 1'
3461 else
3462 def_glob='#undef HAVE_GLOB'
3463 # HACK! need_glob currently enables compilation of a
3464 # win32-specific glob()-replacement.
3465 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3466 win32 && need_glob=yes
3468 echores "$_glob"
3471 echocheck "setenv()"
3472 _setenv=no
3473 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3474 if test "$_setenv" = yes ; then
3475 def_setenv='#define HAVE_SETENV 1'
3476 need_setenv=no
3477 else
3478 def_setenv='#undef HAVE_SETENV'
3479 need_setenv=yes
3481 echores "$_setenv"
3484 echocheck "setmode()"
3485 _setmode=no
3486 def_setmode='#define HAVE_SETMODE 0'
3487 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3488 echores "$_setmode"
3491 if sunos; then
3492 echocheck "sysi86()"
3493 _sysi86=no
3494 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3495 if test "$_sysi86" = yes ; then
3496 def_sysi86='#define HAVE_SYSI86 1'
3497 statement_check sys/sysi86.h 'int sysi86(int, void*); sysi86(0)' && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3498 else
3499 def_sysi86='#undef HAVE_SYSI86'
3501 echores "$_sysi86"
3502 fi #if sunos
3505 echocheck "sys/sysinfo.h"
3506 _sys_sysinfo=no
3507 statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
3508 if test "$_sys_sysinfo" = yes ; then
3509 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3510 else
3511 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3513 echores "$_sys_sysinfo"
3516 if darwin; then
3518 echocheck "Mac OS X Finder Support"
3519 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3520 if test "$_macosx_finder" = yes ; then
3521 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3522 extra_ldflags="$extra_ldflags -framework Cocoa"
3524 echores "$_macosx_finder"
3526 echocheck "Mac OS X Bundle file locations"
3527 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3528 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3529 if test "$_macosx_bundle" = yes ; then
3530 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3532 echores "$_macosx_bundle"
3534 echocheck "Apple Remote"
3535 if test "$_apple_remote" = auto ; then
3536 _apple_remote=no
3537 cat > $TMPC <<EOF
3538 #include <stdio.h>
3539 #include <IOKit/IOCFPlugIn.h>
3540 int main(void) {
3541 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3542 CFMutableDictionaryRef hidMatchDictionary;
3543 IOReturn ioReturnValue;
3545 // Set up a matching dictionary to search the I/O Registry by class.
3546 // name for all HID class devices
3547 hidMatchDictionary = IOServiceMatching("AppleIRController");
3549 // Now search I/O Registry for matching devices.
3550 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3551 hidMatchDictionary, &hidObjectIterator);
3553 // If search is unsuccessful, return nonzero.
3554 if (ioReturnValue != kIOReturnSuccess ||
3555 !IOIteratorIsValid(hidObjectIterator)) {
3556 return 1;
3558 return 0;
3561 cc_check -framework IOKit && _apple_remote=yes
3563 if test "$_apple_remote" = yes ; then
3564 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3565 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3566 else
3567 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3569 echores "$_apple_remote"
3571 fi #if darwin
3573 if linux; then
3575 echocheck "Apple IR"
3576 if test "$_apple_ir" = auto ; then
3577 _apple_ir=no
3578 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3580 if test "$_apple_ir" = yes ; then
3581 def_apple_ir='#define CONFIG_APPLE_IR 1'
3582 else
3583 def_apple_ir='#undef CONFIG_APPLE_IR'
3585 echores "$_apple_ir"
3586 fi #if linux
3588 echocheck "pkg-config"
3589 if $($_pkg_config --version > /dev/null 2>&1); then
3590 if test "$_ld_static"; then
3591 _pkg_config="$_pkg_config --static"
3593 echores "yes"
3594 else
3595 _pkg_config=false
3596 echores "no"
3600 echocheck "Samba support (libsmbclient)"
3601 if test "$_smb" = yes; then
3602 extra_ldflags="$extra_ldflags -lsmbclient"
3604 if test "$_smb" = auto; then
3605 _smb=no
3606 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3607 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3608 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3609 done
3612 if test "$_smb" = yes; then
3613 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3614 inputmodules="smb $inputmodules"
3615 else
3616 def_smb="#undef CONFIG_LIBSMBCLIENT"
3617 noinputmodules="smb $noinputmodules"
3619 echores "$_smb"
3622 #########
3623 # VIDEO #
3624 #########
3627 echocheck "tdfxfb"
3628 if test "$_tdfxfb" = yes ; then
3629 def_tdfxfb='#define CONFIG_TDFXFB 1'
3630 vomodules="tdfxfb $vomodules"
3631 else
3632 def_tdfxfb='#undef CONFIG_TDFXFB'
3633 novomodules="tdfxfb $novomodules"
3635 echores "$_tdfxfb"
3637 echocheck "s3fb"
3638 if test "$_s3fb" = yes ; then
3639 def_s3fb='#define CONFIG_S3FB 1'
3640 vomodules="s3fb $vomodules"
3641 else
3642 def_s3fb='#undef CONFIG_S3FB'
3643 novomodules="s3fb $novomodules"
3645 echores "$_s3fb"
3647 echocheck "wii"
3648 if test "$_wii" = yes ; then
3649 def_wii='#define CONFIG_WII 1'
3650 vomodules="wii $vomodules"
3651 else
3652 def_wii='#undef CONFIG_WII'
3653 novomodules="wii $novomodules"
3655 echores "$_wii"
3657 echocheck "tdfxvid"
3658 if test "$_tdfxvid" = yes ; then
3659 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3660 vomodules="tdfx_vid $vomodules"
3661 else
3662 def_tdfxvid='#undef CONFIG_TDFX_VID'
3663 novomodules="tdfx_vid $novomodules"
3665 echores "$_tdfxvid"
3667 echocheck "xvr100"
3668 if test "$_xvr100" = auto ; then
3669 cat > $TMPC << EOF
3670 #include <unistd.h>
3671 #include <sys/fbio.h>
3672 #include <sys/visual_io.h>
3673 int main(void) {
3674 struct vis_identifier ident;
3675 struct fbgattr attr;
3676 ioctl(0, VIS_GETIDENTIFIER, &ident);
3677 ioctl(0, FBIOGATTR, &attr);
3678 return 0;
3681 _xvr100=no
3682 cc_check && _xvr100=yes
3684 if test "$_xvr100" = yes ; then
3685 def_xvr100='#define CONFIG_XVR100 1'
3686 vomodules="xvr100 $vomodules"
3687 else
3688 def_tdfxvid='#undef CONFIG_XVR100'
3689 novomodules="xvr100 $novomodules"
3691 echores "$_xvr100"
3693 echocheck "tga"
3694 if test "$_tga" = yes ; then
3695 def_tga='#define CONFIG_TGA 1'
3696 vomodules="tga $vomodules"
3697 else
3698 def_tga='#undef CONFIG_TGA'
3699 novomodules="tga $novomodules"
3701 echores "$_tga"
3704 echocheck "md5sum support"
3705 if test "$_md5sum" = yes; then
3706 def_md5sum="#define CONFIG_MD5SUM 1"
3707 vomodules="md5sum $vomodules"
3708 else
3709 def_md5sum="#undef CONFIG_MD5SUM"
3710 novomodules="md5sum $novomodules"
3712 echores "$_md5sum"
3715 echocheck "yuv4mpeg support"
3716 if test "$_yuv4mpeg" = yes; then
3717 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3718 vomodules="yuv4mpeg $vomodules"
3719 else
3720 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3721 novomodules="yuv4mpeg $novomodules"
3723 echores "$_yuv4mpeg"
3726 echocheck "bl"
3727 if test "$_bl" = yes ; then
3728 def_bl='#define CONFIG_BL 1'
3729 vomodules="bl $vomodules"
3730 else
3731 def_bl='#undef CONFIG_BL'
3732 novomodules="bl $novomodules"
3734 echores "$_bl"
3737 echocheck "DirectFB"
3738 if test "$_directfb" = auto ; then
3739 _directfb=no
3740 cat > $TMPC << EOF
3741 #include <directfb.h>
3742 #include <directfb_version.h>
3743 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3744 #error "DirectFB version too old."
3745 #endif
3746 int main(void) { DirectFBInit(0, 0); return 0; }
3748 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3749 cc_check $_inc_tmp -ldirectfb &&
3750 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3751 done
3753 if test "$_directfb" = yes ; then
3754 def_directfb='#define CONFIG_DIRECTFB 1'
3755 vomodules="directfb dfbmga $vomodules"
3756 libs_mplayer="$libs_mplayer -ldirectfb"
3757 else
3758 def_directfb='#undef CONFIG_DIRECTFB'
3759 novomodules="directfb dfbmga $novomodules"
3761 echores "$_directfb"
3764 if darwin; then
3766 echocheck "QuickTime"
3767 if test "$quicktime" = auto ; then
3768 quicktime=no
3769 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
3771 if test "$quicktime" = yes ; then
3772 extra_ldflags="$extra_ldflags -framework QuickTime"
3773 def_quicktime='#define CONFIG_QUICKTIME 1'
3774 else
3775 def_quicktime='#undef CONFIG_QUICKTIME'
3777 echores $quicktime
3779 echocheck "Cocoa"
3780 if test "$_cocoa" = auto ; then
3781 cat > $TMPC <<EOF
3782 #include <CoreServices/CoreServices.h>
3783 #include <OpenGL/OpenGL.h>
3784 int main(void) {
3785 NSApplicationLoad();
3788 _cocoa=no
3789 cc_check -framework Cocoa -framework OpenGL && _cocoa=yes
3791 if test "$_cocoa" = yes ; then
3792 libs_mplayer="$libs_mplayer -framework Cocoa -framework OpenGL"
3793 def_cocoa='#define CONFIG_COCOA 1'
3794 else
3795 def_cocoa='#undef CONFIG_COCOA'
3797 echores "$_cocoa"
3799 echocheck "CoreVideo"
3800 if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
3801 cat > $TMPC <<EOF
3802 #include <QuartzCore/CoreVideo.h>
3803 int main(void) { return 0; }
3805 _corevideo=no
3806 cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
3808 if test "$_corevideo" = yes ; then
3809 vomodules="corevideo $vomodules"
3810 libs_mplayer="$libs_mplayer -framework QuartzCore"
3811 def_corevideo='#define CONFIG_COREVIDEO 1'
3812 else
3813 novomodules="corevideo $novomodules"
3814 def_corevideo='#undef CONFIG_COREVIDEO'
3816 echores "$_corevideo"
3818 echocheck "SharedBuffer"
3819 if test "$_sharedbuffer" = auto ; then
3820 cat > $TMPC <<EOF
3821 int main(void) {
3822 NSApplicationLoad();
3825 _sharedbuffer=no
3826 cc_check -framework Cocoa && _sharedbuffer=yes
3828 if test "$_sharedbuffer" = yes ; then
3829 vomodules="sharedbuffer $vomodules"
3830 libs_mplayer="$libs_mplayer -framework Cocoa"
3831 def_sharedbuffer='#define CONFIG_SHAREDBUFFER 1'
3832 else
3833 novomodules="sharedbuffer $novomodules"
3834 def_sharedbuffer='#undef CONFIG_SHAREDBUFFER'
3836 echores "$_sharedbuffer"
3838 depends_on_application_services(){
3839 test "$_corevideo" = yes
3842 fi #if darwin
3845 echocheck "X11 headers presence"
3846 _x11_headers="no"
3847 res_comment="check if the dev(el) packages are installed"
3848 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3849 if test -f "$I/X11/Xlib.h" ; then
3850 _x11_headers="yes"
3851 res_comment=""
3852 break
3854 done
3855 if test $_cross_compile = no; then
3856 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3857 /usr/include/X11R6 /usr/openwin/include ; do
3858 if test -f "$I/X11/Xlib.h" ; then
3859 extra_cflags="$extra_cflags -I$I"
3860 _x11_headers="yes"
3861 res_comment="using $I"
3862 break
3864 done
3866 echores "$_x11_headers"
3869 echocheck "X11"
3870 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3871 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3872 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3873 -L/usr/lib ; do
3874 if netbsd; then
3875 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3876 else
3877 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3879 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3880 _x11=yes
3881 # Check that there aren't conflicting headers between ApplicationServices
3882 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3883 # is included by -framework ApplicationServices and clashes with the X11
3884 # definition of the "Cursor" type.
3885 if darwin && depends_on_application_services && test "$_x11" = yes ; then
3886 _x11=no
3887 header_check_broken ApplicationServices/ApplicationServices.h \
3888 X11/Xutil.h $_ld_tmp && _x11=yes
3890 if test "$_x11" = yes ; then
3891 libs_mplayer="$libs_mplayer $_ld_tmp"
3892 break
3894 done
3896 if test "$_x11" = yes ; then
3897 def_x11='#define CONFIG_X11 1'
3898 vomodules="x11 xover $vomodules"
3899 else
3900 _x11=no
3901 def_x11='#undef CONFIG_X11'
3902 novomodules="x11 $novomodules"
3903 res_comment="check if the dev(el) packages are installed"
3905 echores "$_x11"
3907 echocheck "Xss screensaver extensions"
3908 if test "$_xss" = auto ; then
3909 _xss=no
3910 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3912 if test "$_xss" = yes ; then
3913 def_xss='#define CONFIG_XSS 1'
3914 libs_mplayer="$libs_mplayer -lXss"
3915 else
3916 def_xss='#undef CONFIG_XSS'
3918 echores "$_xss"
3920 echocheck "DPMS"
3921 _xdpms3=no
3922 _xdpms4=no
3923 if test "$_x11" = yes ; then
3924 cat > $TMPC <<EOF
3925 #include <X11/Xmd.h>
3926 #include <X11/Xlib.h>
3927 #include <X11/Xutil.h>
3928 #include <X11/Xatom.h>
3929 #include <X11/extensions/dpms.h>
3930 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3932 cc_check -lXdpms && _xdpms3=yes
3933 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3935 if test "$_xdpms4" = yes ; then
3936 def_xdpms='#define CONFIG_XDPMS 1'
3937 res_comment="using Xdpms 4"
3938 echores "yes"
3939 elif test "$_xdpms3" = yes ; then
3940 def_xdpms='#define CONFIG_XDPMS 1'
3941 libs_mplayer="$libs_mplayer -lXdpms"
3942 res_comment="using Xdpms 3"
3943 echores "yes"
3944 else
3945 def_xdpms='#undef CONFIG_XDPMS'
3946 echores "no"
3950 echocheck "Xv"
3951 if test "$_xv" = auto && test "$_x11" = yes ; then
3952 _xv=no
3953 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3956 if test "$_xv" = yes ; then
3957 def_xv='#define CONFIG_XV 1'
3958 libs_mplayer="$libs_mplayer -lXv"
3959 vomodules="xv $vomodules"
3960 else
3961 def_xv='#undef CONFIG_XV'
3962 novomodules="xv $novomodules"
3964 echores "$_xv"
3967 echocheck "VDPAU"
3968 if test "$_vdpau" = auto && test "$_x11" = yes ; then
3969 _vdpau=no
3970 if test "$_dl" = yes ; then
3971 pkg_config_add 'vdpau >= 0.2' && _vdpau=yes
3974 if test "$_vdpau" = yes ; then
3975 def_vdpau='#define CONFIG_VDPAU 1'
3976 vomodules="vdpau $vomodules"
3977 else
3978 def_vdpau='#define CONFIG_VDPAU 0'
3979 novomodules="vdpau $novomodules"
3981 echores "$_vdpau"
3984 echocheck "Xinerama"
3985 if test "$_xinerama" = auto && test "$_x11" = yes ; then
3986 _xinerama=no
3987 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
3990 if test "$_xinerama" = yes ; then
3991 def_xinerama='#define CONFIG_XINERAMA 1'
3992 libs_mplayer="$libs_mplayer -lXinerama"
3993 else
3994 def_xinerama='#undef CONFIG_XINERAMA'
3996 echores "$_xinerama"
3999 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4000 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4001 # named 'X extensions' or something similar.
4002 # This check may be useful for future mplayer versions (to change resolution)
4003 # If you run into problems, remove '-lXxf86vm'.
4004 echocheck "Xxf86vm"
4005 if test "$_vm" = auto && test "$_x11" = yes ; then
4006 _vm=no
4007 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
4009 if test "$_vm" = yes ; then
4010 def_vm='#define CONFIG_XF86VM 1'
4011 libs_mplayer="$libs_mplayer -lXxf86vm"
4012 else
4013 def_vm='#undef CONFIG_XF86VM'
4015 echores "$_vm"
4017 # Check for the presence of special keycodes, like audio control buttons
4018 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4019 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4020 # have these new keycodes.
4021 echocheck "XF86keysym"
4022 if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
4023 _xf86keysym=no
4024 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
4026 if test "$_xf86keysym" = yes ; then
4027 def_xf86keysym='#define CONFIG_XF86XK 1'
4028 else
4029 def_xf86keysym='#undef CONFIG_XF86XK'
4031 echores "$_xf86keysym"
4033 echocheck "DGA"
4034 if test "$_dga2" = auto && test "$_x11" = yes ; then
4035 _dga2=no
4036 statement_check_broken X11/Xlib.h X11/extensions/Xxf86dga.h 'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2=yes
4038 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4039 _dga1=no
4040 statement_check_broken X11/Xlib.h X11/extensions/Xxf86dga.h 'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1=yes
4043 _dga=no
4044 def_dga='#undef CONFIG_DGA'
4045 def_dga1='#undef CONFIG_DGA1'
4046 def_dga2='#undef CONFIG_DGA2'
4047 if test "$_dga1" = yes ; then
4048 _dga=yes
4049 def_dga1='#define CONFIG_DGA1 1'
4050 res_comment="using DGA 1.0"
4051 elif test "$_dga2" = yes ; then
4052 _dga=yes
4053 def_dga2='#define CONFIG_DGA2 1'
4054 res_comment="using DGA 2.0"
4056 if test "$_dga" = yes ; then
4057 def_dga='#define CONFIG_DGA 1'
4058 libs_mplayer="$libs_mplayer -lXxf86dga"
4059 vomodules="dga $vomodules"
4060 else
4061 novomodules="dga $novomodules"
4063 echores "$_dga"
4066 echocheck "3dfx"
4067 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4068 def_3dfx='#define CONFIG_3DFX 1'
4069 vomodules="3dfx $vomodules"
4070 else
4071 _3dfx=no
4072 def_3dfx='#undef CONFIG_3DFX'
4073 novomodules="3dfx $novomodules"
4075 echores "$_3dfx"
4078 echocheck "GGI"
4079 if test "$_ggi" = auto ; then
4080 _ggi=no
4081 statement_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4083 if test "$_ggi" = yes ; then
4084 def_ggi='#define CONFIG_GGI 1'
4085 libs_mplayer="$libs_mplayer -lggi"
4086 vomodules="ggi $vomodules"
4087 else
4088 def_ggi='#undef CONFIG_GGI'
4089 novomodules="ggi $novomodules"
4091 echores "$_ggi"
4093 echocheck "GGI extension: libggiwmh"
4094 if test "$_ggiwmh" = auto ; then
4095 _ggiwmh=no
4096 statement_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4098 # needed to get right output on obscure combination
4099 # like --disable-ggi --enable-ggiwmh
4100 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4101 def_ggiwmh='#define CONFIG_GGIWMH 1'
4102 libs_mplayer="$libs_mplayer -lggiwmh"
4103 else
4104 _ggiwmh=no
4105 def_ggiwmh='#undef CONFIG_GGIWMH'
4107 echores "$_ggiwmh"
4110 echocheck "AA"
4111 if test "$_aa" = auto ; then
4112 cat > $TMPC << EOF
4113 #include <aalib.h>
4114 int main(void) {
4115 aa_context *c;
4116 aa_renderparams *p;
4117 aa_init(0, 0, 0);
4118 c = aa_autoinit(&aa_defparams);
4119 p = aa_getrenderparams();
4120 aa_autoinitkbd(c, 0);
4121 return 0; }
4123 _aa=no
4124 for _ld_tmp in "-laa" ; do
4125 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4126 done
4128 if test "$_aa" = yes ; then
4129 def_aa='#define CONFIG_AA 1'
4130 if cygwin ; then
4131 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4133 vomodules="aa $vomodules"
4134 else
4135 def_aa='#undef CONFIG_AA'
4136 novomodules="aa $novomodules"
4138 echores "$_aa"
4141 echocheck "CACA"
4142 if test "$_caca" = auto ; then
4143 _caca=no
4144 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4145 cat > $TMPC << EOF
4146 #include <caca.h>
4147 #ifdef CACA_API_VERSION_1
4148 #include <caca0.h>
4149 #endif
4150 int main(void) { caca_init(); return 0; }
4152 cc_check $(caca-config --libs) && _caca=yes
4155 if test "$_caca" = yes ; then
4156 def_caca='#define CONFIG_CACA 1'
4157 extra_cflags="$extra_cflags $(caca-config --cflags)"
4158 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4159 vomodules="caca $vomodules"
4160 else
4161 def_caca='#undef CONFIG_CACA'
4162 novomodules="caca $novomodules"
4164 echores "$_caca"
4167 echocheck "SVGAlib"
4168 if test "$_svga" = auto ; then
4169 _svga=no
4170 header_check vga.h -lvga $_ld_lm && _svga=yes
4172 if test "$_svga" = yes ; then
4173 def_svga='#define CONFIG_SVGALIB 1'
4174 libs_mplayer="$libs_mplayer -lvga"
4175 vomodules="svga $vomodules"
4176 else
4177 def_svga='#undef CONFIG_SVGALIB'
4178 novomodules="svga $novomodules"
4180 echores "$_svga"
4183 echocheck "FBDev"
4184 if test "$_fbdev" = auto ; then
4185 _fbdev=no
4186 linux && _fbdev=yes
4188 if test "$_fbdev" = yes ; then
4189 def_fbdev='#define CONFIG_FBDEV 1'
4190 vomodules="fbdev $vomodules"
4191 else
4192 def_fbdev='#undef CONFIG_FBDEV'
4193 novomodules="fbdev $novomodules"
4195 echores "$_fbdev"
4199 echocheck "DVB"
4200 if test "$_dvb" = auto ; then
4201 _dvb=no
4202 cat >$TMPC << EOF
4203 #include <poll.h>
4204 #include <sys/ioctl.h>
4205 #include <stdio.h>
4206 #include <time.h>
4207 #include <unistd.h>
4208 #include <linux/dvb/dmx.h>
4209 #include <linux/dvb/frontend.h>
4210 #include <linux/dvb/video.h>
4211 #include <linux/dvb/audio.h>
4212 int main(void) {return 0;}
4214 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4215 cc_check $_inc_tmp && _dvb=yes &&
4216 extra_cflags="$extra_cflags $_inc_tmp" && break
4217 done
4219 echores "$_dvb"
4220 if test "$_dvb" = yes ; then
4221 _dvbin=yes
4222 inputmodules="dvb $inputmodules"
4223 def_dvb='#define CONFIG_DVB 1'
4224 def_dvbin='#define CONFIG_DVBIN 1'
4225 aomodules="mpegpes(dvb) $aomodules"
4226 vomodules="mpegpes(dvb) $vomodules"
4227 else
4228 _dvbin=no
4229 noinputmodules="dvb $noinputmodules"
4230 def_dvb='#undef CONFIG_DVB'
4231 def_dvbin='#undef CONFIG_DVBIN '
4232 aomodules="mpegpes(file) $aomodules"
4233 vomodules="mpegpes(file) $vomodules"
4237 echocheck "PNG support"
4238 if test "$_png" = auto ; then
4239 _png=no
4240 cat > $TMPC << EOF
4241 #include <stdio.h>
4242 #include <string.h>
4243 #include <png.h>
4244 int main(void) {
4245 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4246 printf("libpng: %s\n", png_libpng_ver);
4247 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4250 cc_check -lpng -lz $_ld_lm && _png=yes
4252 echores "$_png"
4253 if test "$_png" = yes ; then
4254 def_png='#define CONFIG_PNG 1'
4255 extra_ldflags="$extra_ldflags -lpng -lz"
4256 else
4257 def_png='#undef CONFIG_PNG'
4260 echocheck "MNG support"
4261 if test "$_mng" = auto ; then
4262 _mng=no
4263 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
4265 echores "$_mng"
4266 if test "$_mng" = yes ; then
4267 def_mng='#define CONFIG_MNG 1'
4268 extra_ldflags="$extra_ldflags -lmng -lz"
4269 else
4270 def_mng='#undef CONFIG_MNG'
4273 echocheck "JPEG support"
4274 if test "$_jpeg" = auto ; then
4275 _jpeg=no
4276 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
4278 echores "$_jpeg"
4280 if test "$_jpeg" = yes ; then
4281 def_jpeg='#define CONFIG_JPEG 1'
4282 vomodules="jpeg $vomodules"
4283 extra_ldflags="$extra_ldflags -ljpeg"
4284 else
4285 def_jpeg='#undef CONFIG_JPEG'
4286 novomodules="jpeg $novomodules"
4291 echocheck "PNM support"
4292 if test "$_pnm" = yes; then
4293 def_pnm="#define CONFIG_PNM 1"
4294 vomodules="pnm $vomodules"
4295 else
4296 def_pnm="#undef CONFIG_PNM"
4297 novomodules="pnm $novomodules"
4299 echores "$_pnm"
4303 echocheck "GIF support"
4304 # This is to appease people who want to force gif support.
4305 # If it is forced to yes, then we still do checks to determine
4306 # which gif library to use.
4307 if test "$_gif" = yes ; then
4308 _force_gif=yes
4309 _gif=auto
4312 if test "$_gif" = auto ; then
4313 _gif=no
4314 for _ld_gif in "-lungif" "-lgif" ; do
4315 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4316 done
4319 # If no library was found, and the user wants support forced,
4320 # then we force it on with libgif, as this is the safest
4321 # assumption IMHO. (libungif & libregif both create symbolic
4322 # links to libgif. We also assume that no x11 support is needed,
4323 # because if you are forcing this, then you _should_ know what
4324 # you are doing. [ Besides, package maintainers should never
4325 # have compiled x11 deps into libungif in the first place. ] )
4326 # </rant>
4327 # --Joey
4328 if test "$_force_gif" = yes && test "$_gif" = no ; then
4329 _gif=yes
4330 _ld_gif="-lgif"
4333 if test "$_gif" = yes ; then
4334 def_gif='#define CONFIG_GIF 1'
4335 codecmodules="gif $codecmodules"
4336 vomodules="gif89a $vomodules"
4337 res_comment="old version, some encoding functions disabled"
4338 def_gif_4='#undef CONFIG_GIF_4'
4339 extra_ldflags="$extra_ldflags $_ld_gif"
4341 cat > $TMPC << EOF
4342 #include <signal.h>
4343 #include <stdio.h>
4344 #include <stdlib.h>
4345 #include <gif_lib.h>
4346 static void catch(int sig) { exit(1); }
4347 int main(void) {
4348 signal(SIGSEGV, catch); // catch segfault
4349 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4350 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4351 return 0;
4354 if cc_check "$_ld_gif" ; then
4355 def_gif_4='#define CONFIG_GIF_4 1'
4356 res_comment=""
4358 else
4359 def_gif='#undef CONFIG_GIF'
4360 def_gif_4='#undef CONFIG_GIF_4'
4361 novomodules="gif89a $novomodules"
4362 nocodecmodules="gif $nocodecmodules"
4364 echores "$_gif"
4367 case "$_gif" in yes*)
4368 echocheck "broken giflib workaround"
4369 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4371 cat > $TMPC << EOF
4372 #include <stdio.h>
4373 #include <gif_lib.h>
4374 int main(void) {
4375 GifFileType gif = {.UserData = NULL};
4376 printf("UserData is at address %p\n", gif.UserData);
4377 return 0;
4380 if cc_check "$_ld_gif" ; then
4381 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4382 echores "disabled"
4383 else
4384 echores "enabled"
4387 esac
4390 echocheck "VESA support"
4391 if test "$_vesa" = auto ; then
4392 _vesa=no
4393 statement_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4395 if test "$_vesa" = yes ; then
4396 def_vesa='#define CONFIG_VESA 1'
4397 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4398 vomodules="vesa $vomodules"
4399 else
4400 def_vesa='#undef CONFIG_VESA'
4401 novomodules="vesa $novomodules"
4403 echores "$_vesa"
4405 #################
4406 # VIDEO + AUDIO #
4407 #################
4410 echocheck "SDL"
4411 _inc_tmp=""
4412 _ld_tmp=""
4413 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4414 if test -z "$_sdlconfig" ; then
4415 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4416 _sdlconfig="sdl-config"
4417 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4418 _sdlconfig="sdl11-config"
4419 else
4420 _sdlconfig=false
4423 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4424 cat > $TMPC << EOF
4425 #ifdef CONFIG_SDL_SDL_H
4426 #include <SDL/SDL.h>
4427 #else
4428 #include <SDL.h>
4429 #endif
4430 #ifndef __APPLE__
4431 // we allow SDL hacking our main() only on OSX
4432 #undef main
4433 #endif
4434 int main(int argc, char *argv[]) {
4435 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4436 return 0;
4439 _sdl=no
4440 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4441 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4442 _sdl=yes
4443 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4444 break
4446 done
4447 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4448 res_comment="using $_sdlconfig"
4449 if cygwin ; then
4450 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4451 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4452 elif mingw32 ; then
4453 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4454 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4455 else
4456 _inc_tmp="$($_sdlconfig --cflags)"
4457 _ld_tmp="$($_sdlconfig --libs)"
4459 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4460 _sdl=yes
4461 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4462 # HACK for BeOS/Haiku SDL
4463 _ld_tmp="$_ld_tmp -lstdc++"
4464 _sdl=yes
4468 if test "$_sdl" = yes ; then
4469 def_sdl='#define CONFIG_SDL 1'
4470 extra_cflags="$extra_cflags $_inc_tmp"
4471 libs_mplayer="$libs_mplayer $_ld_tmp"
4472 vomodules="sdl $vomodules"
4473 aomodules="sdl $aomodules"
4474 else
4475 def_sdl='#undef CONFIG_SDL'
4476 novomodules="sdl $novomodules"
4477 noaomodules="sdl $noaomodules"
4479 echores "$_sdl"
4482 # make sure this stays below CoreVideo to avoid issues due to namespace
4483 # conflicts between -lGL and -framework OpenGL
4484 echocheck "OpenGL"
4485 #Note: this test is run even with --enable-gl since we autodetect linker flags
4486 if (test "$_x11" = yes || test "$_sdl" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
4487 cat > $TMPC << EOF
4488 #ifdef GL_WIN32
4489 #include <windows.h>
4490 #include <GL/gl.h>
4491 #elif defined(GL_SDL)
4492 #include <GL/gl.h>
4493 #ifdef CONFIG_SDL_SDL_H
4494 #include <SDL/SDL.h>
4495 #else
4496 #include <SDL.h>
4497 #endif
4498 #ifndef __APPLE__
4499 // we allow SDL hacking our main() only on OSX
4500 #undef main
4501 #endif
4502 #else
4503 #include <GL/gl.h>
4504 #include <X11/Xlib.h>
4505 #include <GL/glx.h>
4506 #endif
4507 int main(int argc, char *argv[]) {
4508 #ifdef GL_WIN32
4509 HDC dc;
4510 wglCreateContext(dc);
4511 #elif defined(GL_SDL)
4512 SDL_GL_SwapBuffers();
4513 #else
4514 glXCreateContext(NULL, NULL, NULL, True);
4515 #endif
4516 glFinish();
4517 return 0;
4520 _gl=no
4521 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4522 if cc_check $_ld_tmp $_ld_lm ; then
4523 _gl=yes
4524 _gl_x11=yes
4525 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4526 break
4528 done
4529 if cc_check -DGL_WIN32 -lopengl32 ; then
4530 _gl=yes
4531 _gl_win32=yes
4532 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4534 if test "$_cocoa" = yes ; then
4535 _gl=yes
4536 _gl_cocoa=yes
4538 # last so it can reuse any linker etc. flags detected before
4539 if test "$_sdl" = yes ; then
4540 if cc_check -DGL_SDL ||
4541 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4542 _gl=yes
4543 _gl_sdl=yes
4544 elif cc_check -DGL_SDL -lGL ||
4545 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4546 _gl=yes
4547 _gl_sdl=yes
4548 libs_mplayer="$libs_mplayer -lGL"
4551 else
4552 _gl=no
4554 if test "$_gl" = yes ; then
4555 def_gl='#define CONFIG_GL 1'
4556 res_comment="backends:"
4557 if test "$_gl_cocoa" = yes ; then
4558 def_gl_cocoa='#define CONFIG_GL_COCOA 1'
4559 res_comment="$res_comment cocoa"
4561 if test "$_gl_win32" = yes ; then
4562 def_gl_win32='#define CONFIG_GL_WIN32 1'
4563 res_comment="$res_comment win32"
4565 if test "$_gl_x11" = yes ; then
4566 def_gl_x11='#define CONFIG_GL_X11 1'
4567 res_comment="$res_comment x11"
4569 if test "$_gl_sdl" = yes ; then
4570 def_gl_sdl='#define CONFIG_GL_SDL 1'
4571 res_comment="$res_comment sdl"
4573 vomodules="opengl $vomodules"
4574 else
4575 def_gl='#undef CONFIG_GL'
4576 def_gl_cocoa='#undef CONFIG_GL_COCOA'
4577 def_gl_win32='#undef CONFIG_GL_WIN32'
4578 def_gl_x11='#undef CONFIG_GL_X11'
4579 def_gl_sdl='#undef CONFIG_GL_SDL'
4580 novomodules="opengl $novomodules"
4582 echores "$_gl"
4585 if win32; then
4587 echocheck "Windows waveout"
4588 if test "$_win32waveout" = auto ; then
4589 _win32waveout=no
4590 header_check_broken windows.h mmsystem.h -lwinmm && _win32waveout=yes
4592 if test "$_win32waveout" = yes ; then
4593 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4594 libs_mplayer="$libs_mplayer -lwinmm"
4595 aomodules="win32 $aomodules"
4596 else
4597 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4598 noaomodules="win32 $noaomodules"
4600 echores "$_win32waveout"
4602 echocheck "Direct3D"
4603 if test "$_direct3d" = auto ; then
4604 _direct3d=no
4605 header_check d3d9.h && _direct3d=yes
4607 if test "$_direct3d" = yes ; then
4608 def_direct3d='#define CONFIG_DIRECT3D 1'
4609 vomodules="direct3d $vomodules"
4610 else
4611 def_direct3d='#undef CONFIG_DIRECT3D'
4612 novomodules="direct3d $novomodules"
4614 echores "$_direct3d"
4616 echocheck "Directx"
4617 if test "$_directx" = auto ; then
4618 cat > $TMPC << EOF
4619 #include <ddraw.h>
4620 #include <dsound.h>
4621 int main(void) { return 0; }
4623 _directx=no
4624 cc_check -lgdi32 && _directx=yes
4626 if test "$_directx" = yes ; then
4627 def_directx='#define CONFIG_DIRECTX 1'
4628 libs_mplayer="$libs_mplayer -lgdi32"
4629 vomodules="directx $vomodules"
4630 aomodules="dsound $aomodules"
4631 else
4632 def_directx='#undef CONFIG_DIRECTX'
4633 novomodules="directx $novomodules"
4634 noaomodules="dsound $noaomodules"
4636 echores "$_directx"
4638 fi #if win32; then
4641 echocheck "DXR3/H+"
4642 if test "$_dxr3" = auto ; then
4643 _dxr3=no
4644 header_check linux/em8300.h && _dxr3=yes
4646 if test "$_dxr3" = yes ; then
4647 def_dxr3='#define CONFIG_DXR3 1'
4648 vomodules="dxr3 $vomodules"
4649 else
4650 def_dxr3='#undef CONFIG_DXR3'
4651 novomodules="dxr3 $novomodules"
4653 echores "$_dxr3"
4656 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4657 if test "$_ivtv" = auto ; then
4658 cat > $TMPC << EOF
4659 #include <sys/time.h>
4660 #include <linux/videodev2.h>
4661 #include <linux/ivtv.h>
4662 #include <sys/ioctl.h>
4663 int main(void) {
4664 struct ivtv_cfg_stop_decode sd;
4665 struct ivtv_cfg_start_decode sd1;
4666 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4667 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
4668 return 0; }
4670 _ivtv=no
4671 cc_check && _ivtv=yes
4673 if test "$_ivtv" = yes ; then
4674 def_ivtv='#define CONFIG_IVTV 1'
4675 vomodules="ivtv $vomodules"
4676 aomodules="ivtv $aomodules"
4677 else
4678 def_ivtv='#undef CONFIG_IVTV'
4679 novomodules="ivtv $novomodules"
4680 noaomodules="ivtv $noaomodules"
4682 echores "$_ivtv"
4685 echocheck "V4L2 MPEG Decoder"
4686 if test "$_v4l2" = auto ; then
4687 cat > $TMPC << EOF
4688 #include <sys/time.h>
4689 #include <linux/videodev2.h>
4690 #include <linux/version.h>
4691 int main(void) {
4692 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4693 #error kernel headers too old, need 2.6.22
4694 #endif
4695 struct v4l2_ext_controls ctrls;
4696 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4697 return 0;
4700 _v4l2=no
4701 cc_check && _v4l2=yes
4703 if test "$_v4l2" = yes ; then
4704 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4705 vomodules="v4l2 $vomodules"
4706 aomodules="v4l2 $aomodules"
4707 else
4708 def_v4l2='#undef CONFIG_V4L2_DECODER'
4709 novomodules="v4l2 $novomodules"
4710 noaomodules="v4l2 $noaomodules"
4712 echores "$_v4l2"
4716 #########
4717 # AUDIO #
4718 #########
4721 echocheck "OSS Audio"
4722 if test "$_ossaudio" = auto ; then
4723 _ossaudio=no
4724 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4726 if test "$_ossaudio" = yes ; then
4727 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4728 aomodules="oss $aomodules"
4729 cat > $TMPC << EOF
4730 #include <$_soundcard_header>
4731 #ifdef OPEN_SOUND_SYSTEM
4732 int main(void) { return 0; }
4733 #else
4734 #error Not the real thing
4735 #endif
4737 _real_ossaudio=no
4738 cc_check && _real_ossaudio=yes
4739 if test "$_real_ossaudio" = yes; then
4740 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4741 # Check for OSS4 headers (override default headers)
4742 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4743 if test -f /etc/oss.conf; then
4744 . /etc/oss.conf
4745 _ossinc="$OSSLIBDIR/include"
4746 if test -f "$_ossinc/sys/soundcard.h"; then
4747 extra_cflags="-I$_ossinc $extra_cflags"
4750 elif netbsd || openbsd ; then
4751 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4752 extra_ldflags="$extra_ldflags -lossaudio"
4753 else
4754 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4756 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4757 else
4758 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4759 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4760 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4761 noaomodules="oss $noaomodules"
4763 echores "$_ossaudio"
4766 echocheck "RSound"
4767 if test "$_rsound" = auto ; then
4768 _rsound=no
4769 statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
4771 echores "$_rsound"
4773 if test "$_rsound" = yes ; then
4774 def_rsound='#define CONFIG_RSOUND 1'
4775 aomodules="rsound $aomodules"
4776 libs_mplayer="$libs_mplayer -lrsound"
4777 else
4778 def_rsound='#undef CONFIG_RSOUND'
4779 noaomodules="rsound $noaomodules"
4783 echocheck "NAS"
4784 if test "$_nas" = auto ; then
4785 _nas=no
4786 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
4788 if test "$_nas" = yes ; then
4789 def_nas='#define CONFIG_NAS 1'
4790 libs_mplayer="$libs_mplayer -laudio -lXt"
4791 aomodules="nas $aomodules"
4792 else
4793 noaomodules="nas $noaomodules"
4794 def_nas='#undef CONFIG_NAS'
4796 echores "$_nas"
4799 echocheck "pulse"
4800 if test "$_pulse" = auto ; then
4801 _pulse=no
4802 if pkg_config_add 'libpulse >= 0.9' ; then
4803 _pulse=yes
4806 echores "$_pulse"
4808 if test "$_pulse" = yes ; then
4809 def_pulse='#define CONFIG_PULSE 1'
4810 aomodules="pulse $aomodules"
4811 else
4812 def_pulse='#undef CONFIG_PULSE'
4813 noaomodules="pulse $noaomodules"
4817 echocheck "PortAudio"
4818 if test "$_portaudio" = auto && test "$_pthreads" != yes ; then
4819 _portaudio=no
4820 res_comment="pthreads not enabled"
4822 if test "$_portaudio" = auto ; then
4823 _portaudio=no
4824 if pkg_config_add 'portaudio-2.0 >= 19' ; then
4825 _portaudio=yes
4828 echores "$_portaudio"
4830 if test "$_portaudio" = yes ; then
4831 def_portaudio='#define CONFIG_PORTAUDIO 1'
4832 aomodules="portaudio $aomodules"
4833 else
4834 def_portaudio='#undef CONFIG_PORTAUDIO'
4835 noaomodules="portaudio $noaomodules"
4839 echocheck "JACK"
4840 if test "$_jack" = auto ; then
4841 _jack=no
4842 if pkg_config_add jack ; then
4843 _jack=yes
4847 if test "$_jack" = yes ; then
4848 def_jack='#define CONFIG_JACK 1'
4849 aomodules="jack $aomodules"
4850 else
4851 noaomodules="jack $noaomodules"
4853 echores "$_jack"
4855 echocheck "OpenAL"
4856 if test "$_openal" = auto ; then
4857 _openal=no
4858 cat > $TMPC << EOF
4859 #ifdef OPENAL_AL_H
4860 #include <OpenAL/al.h>
4861 #else
4862 #include <AL/al.h>
4863 #endif
4864 int main(void) {
4865 alSourceQueueBuffers(0, 0, 0);
4866 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4867 return 0;
4870 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4871 cc_check $I && _openal=yes && break
4872 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4873 done
4874 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4876 if test "$_openal" = yes ; then
4877 def_openal='#define CONFIG_OPENAL 1'
4878 aomodules="openal $aomodules"
4879 else
4880 noaomodules="openal $noaomodules"
4882 echores "$_openal"
4884 echocheck "ALSA audio"
4885 if test "$_alloca" != yes ; then
4886 _alsa=no
4887 res_comment="alloca missing"
4889 if test "$_alsa" = auto ; then
4890 _alsa=no
4891 if pkg_config_add "alsa >= 1.0.9" ; then
4892 _alsa=yes
4895 def_alsa='#undef CONFIG_ALSA'
4896 if test "$_alsa" = yes ; then
4897 aomodules="alsa $aomodules"
4898 def_alsa='#define CONFIG_ALSA 1'
4899 else
4900 noaomodules="alsa $noaomodules"
4902 echores "$_alsa"
4905 echocheck "Sun audio"
4906 if test "$_sunaudio" = auto ; then
4907 cat > $TMPC << EOF
4908 #include <sys/types.h>
4909 #include <sys/audioio.h>
4910 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4912 _sunaudio=no
4913 cc_check && _sunaudio=yes
4915 if test "$_sunaudio" = yes ; then
4916 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
4917 aomodules="sun $aomodules"
4918 else
4919 def_sunaudio='#undef CONFIG_SUN_AUDIO'
4920 noaomodules="sun $noaomodules"
4922 echores "$_sunaudio"
4925 if darwin; then
4926 echocheck "CoreAudio"
4927 if test "$_coreaudio" = auto ; then
4928 cat > $TMPC <<EOF
4929 #include <CoreAudio/CoreAudio.h>
4930 #include <AudioToolbox/AudioToolbox.h>
4931 #include <AudioUnit/AudioUnit.h>
4932 int main(void) { return 0; }
4934 _coreaudio=no
4935 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
4937 if test "$_coreaudio" = yes ; then
4938 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4939 def_coreaudio='#define CONFIG_COREAUDIO 1'
4940 aomodules="coreaudio $aomodules"
4941 else
4942 def_coreaudio='#undef CONFIG_COREAUDIO'
4943 noaomodules="coreaudio $noaomodules"
4945 echores $_coreaudio
4946 fi #if darwin
4949 # set default CD/DVD devices
4950 if win32 ; then
4951 default_cdrom_device="D:"
4952 elif darwin ; then
4953 default_cdrom_device="/dev/disk1"
4954 elif dragonfly ; then
4955 default_cdrom_device="/dev/cd0"
4956 elif freebsd ; then
4957 default_cdrom_device="/dev/acd0"
4958 elif openbsd ; then
4959 default_cdrom_device="/dev/rcd0c"
4960 elif sunos ; then
4961 default_cdrom_device="/vol/dev/aliases/cdrom0"
4962 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
4963 # file system and the volfs service.
4964 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
4965 elif amigaos ; then
4966 default_cdrom_device="a1ide.device:2"
4967 else
4968 default_cdrom_device="/dev/cdrom"
4971 if win32 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
4972 default_dvd_device=$default_cdrom_device
4973 elif darwin ; then
4974 default_dvd_device="/dev/rdiskN"
4975 else
4976 default_dvd_device="/dev/dvd"
4980 echocheck "VCD support"
4981 if test "$_vcd" = auto; then
4982 _vcd=no
4983 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos; then
4984 _vcd=yes
4985 elif mingw32; then
4986 header_check ddk/ntddcdrm.h && _vcd=yes
4989 if test "$_vcd" = yes; then
4990 inputmodules="vcd $inputmodules"
4991 def_vcd='#define CONFIG_VCD 1'
4992 else
4993 def_vcd='#undef CONFIG_VCD'
4994 noinputmodules="vcd $noinputmodules"
4995 res_comment="not supported on this OS"
4997 echores "$_vcd"
5001 echocheck "Blu-ray support"
5002 if test "$_bluray" = auto ; then
5003 _bluray=no
5004 pkg_config_add 'libbluray >= 0.2.1' && _bluray=yes
5006 if test "$_bluray" = yes ; then
5007 def_bluray='#define CONFIG_LIBBLURAY 1'
5008 inputmodules="bluray $inputmodules"
5009 else
5010 def_bluray='#undef CONFIG_LIBBLURAY'
5011 noinputmodules="bluray $noinputmodules"
5013 echores "$_bluray"
5015 echocheck "dvdread"
5016 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5017 _dvdread_internal=no
5019 if test "$_dvdread_internal" = auto ; then
5020 _dvdread_internal=no
5021 _dvdread=no
5022 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) &&
5023 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
5024 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
5025 darwin || win32; then
5026 _dvdread_internal=yes
5027 _dvdread=yes
5028 extra_cflags="-Ilibdvdread4 $extra_cflags"
5030 elif test "$_dvdread" = auto ; then
5031 _dvdread=no
5032 if test "$_dl" = yes; then
5033 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5034 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5035 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5036 _dvdread=yes
5037 extra_cflags="$extra_cflags $_dvdreadcflags"
5038 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5039 res_comment="external"
5044 if test "$_dvdread_internal" = yes; then
5045 def_dvdread='#define CONFIG_DVDREAD 1'
5046 inputmodules="dvdread(internal) $inputmodules"
5047 res_comment="internal"
5048 elif test "$_dvdread" = yes; then
5049 def_dvdread='#define CONFIG_DVDREAD 1'
5050 extra_ldflags="$extra_ldflags -ldvdread"
5051 inputmodules="dvdread(external) $inputmodules"
5052 res_comment="external"
5053 else
5054 def_dvdread='#undef CONFIG_DVDREAD'
5055 noinputmodules="dvdread $noinputmodules"
5057 echores "$_dvdread"
5060 echocheck "internal libdvdcss"
5061 if test "$_libdvdcss_internal" = auto ; then
5062 _libdvdcss_internal=no
5063 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
5064 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5066 if test "$_libdvdcss_internal" = yes ; then
5067 if linux || netbsd || openbsd || bsdos ; then
5068 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5069 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5070 elif freebsd || dragonfly ; then
5071 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5072 elif darwin ; then
5073 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5074 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5075 elif cygwin ; then
5076 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5077 elif beos ; then
5078 cflags_libdvdcss="-DSYS_BEOS"
5080 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5081 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5082 inputmodules="libdvdcss(internal) $inputmodules"
5083 else
5084 noinputmodules="libdvdcss(internal) $noinputmodules"
5086 echores "$_libdvdcss_internal"
5089 echocheck "libcdio"
5090 if test "$_libcdio" = auto ; then
5091 _libcdio=no
5092 if pkg_config_add libcdio_paranoia ; then
5093 _libcdio=yes
5096 if test "$_libcdio" = yes ; then
5097 _cdda='yes'
5098 def_cdda='#define CONFIG_CDDA 1'
5099 test $_cddb = auto && test $networking = yes && _cddb=yes
5100 inputmodules="cdda $inputmodules"
5101 else
5102 _libcdio=no
5103 _cdda='no'
5104 def_cdda='#undef CONFIG_CDDA'
5105 noinputmodules="cdda $noinputmodules"
5107 echores "$_libcdio"
5109 if test "$_cddb" = yes ; then
5110 def_cddb='#define CONFIG_CDDB 1'
5111 inputmodules="cddb $inputmodules"
5112 else
5113 _cddb=no
5114 def_cddb='#undef CONFIG_CDDB'
5115 noinputmodules="cddb $noinputmodules"
5118 echocheck "bitmap font support"
5119 if test "$_bitmap_font" = yes ; then
5120 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5121 else
5122 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5124 echores "$_bitmap_font"
5127 echocheck "freetype >= 2.0.9"
5129 # freetype depends on iconv
5130 if test "$_iconv" = no ; then
5131 _freetype=no
5132 res_comment="iconv support needed"
5135 if test "$_freetype" = auto ; then
5136 if pkg_config_add freetype2 ; then
5137 _freetype=yes
5138 else
5139 die "Unable to find development files for libfreetype. Aborting. If you really mean to compile without FreeType support use --disable-freetype."
5142 if test "$_freetype" = yes ; then
5143 def_freetype='#define CONFIG_FREETYPE 1'
5144 else
5145 def_freetype='#undef CONFIG_FREETYPE'
5147 echores "$_freetype"
5149 if test "$_freetype" = no ; then
5150 _fontconfig=no
5151 res_comment="FreeType support needed"
5153 echocheck "fontconfig"
5154 if test "$_fontconfig" = auto ; then
5155 if pkg_config_add 'fontconfig >= 2.4.2' ; then
5156 _fontconfig=yes
5157 else
5158 die "Unable to find development files for libfontconfig. Aborting. If you really mean to compile without fontconfig support use --disable-fontconfig."
5161 if test "$_fontconfig" = yes ; then
5162 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5163 else
5164 def_fontconfig='#undef CONFIG_FONTCONFIG'
5166 echores "$_fontconfig"
5169 echocheck "SSA/ASS support"
5170 if test "$_ass" = auto ; then
5171 if pkg_config_add libass ; then
5172 _ass=yes
5173 def_ass='#define CONFIG_ASS 1'
5174 else
5175 die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
5177 else
5178 def_ass='#undef CONFIG_ASS'
5180 echores "$_ass"
5183 echocheck "fribidi with charsets"
5184 if test "$_fribidi" = auto ; then
5185 _fribidi=no
5186 if pkg_config_add fribidi ; then
5187 _fribidi=yes
5190 if test "$_fribidi" = yes ; then
5191 def_fribidi='#define CONFIG_FRIBIDI 1'
5192 else
5193 def_fribidi='#undef CONFIG_FRIBIDI'
5195 echores "$_fribidi"
5198 echocheck "ENCA"
5199 if test "$_enca" = auto ; then
5200 _enca=no
5201 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
5203 if test "$_enca" = yes ; then
5204 def_enca='#define CONFIG_ENCA 1'
5205 extra_ldflags="$extra_ldflags -lenca"
5206 else
5207 def_enca='#undef CONFIG_ENCA'
5209 echores "$_enca"
5212 echocheck "zlib"
5213 _zlib=no
5214 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5215 if test "$_zlib" = yes ; then
5216 def_zlib='#define CONFIG_ZLIB 1'
5217 extra_ldflags="$extra_ldflags -lz"
5218 else
5219 def_zlib='#define CONFIG_ZLIB 0'
5221 echores "$_zlib"
5224 echocheck "RTC"
5225 if test "$_rtc" = auto ; then
5226 cat > $TMPC << EOF
5227 #include <sys/ioctl.h>
5228 #ifdef __linux__
5229 #include <linux/rtc.h>
5230 #else
5231 #include <rtc.h>
5232 #define RTC_PIE_ON RTCIO_PIE_ON
5233 #endif
5234 int main(void) { return RTC_PIE_ON; }
5236 _rtc=no
5237 cc_check && _rtc=yes
5238 ppc && _rtc=no
5240 if test "$_rtc" = yes ; then
5241 def_rtc='#define HAVE_RTC 1'
5242 else
5243 def_rtc='#undef HAVE_RTC'
5245 echores "$_rtc"
5248 echocheck "mad support"
5249 if test "$_mad" = auto ; then
5250 _mad=no
5251 header_check mad.h -lmad && _mad=yes
5253 if test "$_mad" = yes ; then
5254 def_mad='#define CONFIG_LIBMAD 1'
5255 extra_ldflags="$extra_ldflags -lmad"
5256 codecmodules="libmad $codecmodules"
5257 else
5258 def_mad='#undef CONFIG_LIBMAD'
5259 nocodecmodules="libmad $nocodecmodules"
5261 echores "$_mad"
5263 echocheck "OggVorbis support"
5264 if test "$_libvorbis" = auto; then
5265 _libvorbis=no
5266 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
5267 elif test "$_libvorbis" = yes ; then
5268 _tremor=no
5270 if test "$_tremor" = auto; then
5271 _tremor=no
5272 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
5274 if test "$_tremor" = yes ; then
5275 _vorbis=yes
5276 def_vorbis='#define CONFIG_OGGVORBIS 1'
5277 def_tremor='#define CONFIG_TREMOR 1'
5278 codecmodules="tremor(external) $codecmodules"
5279 res_comment="external Tremor"
5280 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
5281 elif test "$_libvorbis" = yes ; then
5282 _vorbis=yes
5283 def_vorbis='#define CONFIG_OGGVORBIS 1'
5284 codecmodules="libvorbis $codecmodules"
5285 res_comment="libvorbis"
5286 extra_ldflags="$extra_ldflags -lvorbis -logg"
5287 else
5288 _vorbis=no
5289 nocodecmodules="libvorbis $nocodecmodules"
5291 echores "$_vorbis"
5293 echocheck "libspeex (version >= 1.1 required)"
5294 if test "$_speex" = auto ; then
5295 _speex=no
5296 cat > $TMPC << EOF
5297 #include <stddef.h>
5298 #include <speex/speex.h>
5299 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5301 cc_check -lspeex $_ld_lm && _speex=yes
5303 if test "$_speex" = yes ; then
5304 def_speex='#define CONFIG_SPEEX 1'
5305 extra_ldflags="$extra_ldflags -lspeex"
5306 codecmodules="speex $codecmodules"
5307 else
5308 def_speex='#undef CONFIG_SPEEX'
5309 nocodecmodules="speex $nocodecmodules"
5311 echores "$_speex"
5313 echocheck "OggTheora support"
5314 if test "$_theora" = auto ; then
5315 _theora=no
5316 if pkg_config_add theora ; then
5317 _theora=yes
5320 if test "$_theora" = yes ; then
5321 def_theora='#define CONFIG_OGGTHEORA 1'
5322 codecmodules="libtheora $codecmodules"
5323 else
5324 def_theora='#undef CONFIG_OGGTHEORA'
5325 nocodecmodules="libtheora $nocodecmodules"
5327 echores "$_theora"
5329 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
5330 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
5331 echocheck "mpg123 support"
5332 def_mpg123='#undef CONFIG_MPG123'
5333 if test "$_mpg123" = auto; then
5334 _mpg123=no
5335 pkg_config_add 'libmpg123 >= 1.2.0' && _mpg123=yes
5337 if test "$_mpg123" = yes ; then
5338 def_mpg123='#define CONFIG_MPG123 1'
5339 codecmodules="mpg123 $codecmodules"
5340 else
5341 nocodecmodules="mpg123 $nocodecmodules"
5343 echores "$_mpg123"
5345 echocheck "liba52 support"
5346 def_liba52='#undef CONFIG_LIBA52'
5347 if test "$_liba52" = auto ; then
5348 _liba52=no
5349 cat > $TMPC << EOF
5350 #include <inttypes.h>
5351 #include <a52dec/a52.h>
5352 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
5354 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
5356 if test "$_liba52" = yes ; then
5357 def_liba52='#define CONFIG_LIBA52 1'
5358 codecmodules="liba52 $codecmodules"
5359 else
5360 nocodecmodules="liba52 $nocodecmodules"
5362 echores "$_liba52"
5364 echocheck "libdca support"
5365 if test "$_libdca" = auto ; then
5366 _libdca=no
5367 for _ld_dca in -ldca -ldts ; do
5368 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
5369 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
5370 done
5372 if test "$_libdca" = yes ; then
5373 def_libdca='#define CONFIG_LIBDCA 1'
5374 codecmodules="libdca $codecmodules"
5375 else
5376 def_libdca='#undef CONFIG_LIBDCA'
5377 nocodecmodules="libdca $nocodecmodules"
5379 echores "$_libdca"
5381 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5382 if test "$_musepack" = yes ; then
5383 _musepack=no
5384 cat > $TMPC << EOF
5385 #include <stddef.h>
5386 #include <mpcdec/mpcdec.h>
5387 int main(void) {
5388 mpc_streaminfo info;
5389 mpc_decoder decoder;
5390 mpc_decoder_set_streaminfo(&decoder, &info);
5391 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5392 return 0;
5395 cc_check -lmpcdec $_ld_lm && _musepack=yes
5397 if test "$_musepack" = yes ; then
5398 def_musepack='#define CONFIG_MUSEPACK 1'
5399 extra_ldflags="$extra_ldflags -lmpcdec"
5400 codecmodules="musepack $codecmodules"
5401 else
5402 def_musepack='#undef CONFIG_MUSEPACK'
5403 nocodecmodules="musepack $nocodecmodules"
5405 echores "$_musepack"
5408 echocheck "FAAD2 support"
5409 if test "$_faad" = auto ; then
5410 _faad=no
5411 cat > $TMPC << EOF
5412 #include <faad.h>
5413 #ifndef FAAD_MIN_STREAMSIZE
5414 #error Too old version
5415 #endif
5416 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
5417 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5419 cc_check -lfaad $_ld_lm && _faad=yes
5422 def_faad='#undef CONFIG_FAAD'
5423 if test "$_faad" = yes ; then
5424 def_faad='#define CONFIG_FAAD 1'
5425 extra_ldflags="$extra_ldflags -lfaad"
5426 codecmodules="faad2 $codecmodules"
5427 else
5428 nocodecmodules="faad2 $nocodecmodules"
5430 echores "$_faad"
5433 echocheck "LADSPA plugin support"
5434 if test "$_ladspa" = auto ; then
5435 _ladspa=no
5436 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
5438 if test "$_ladspa" = yes; then
5439 def_ladspa="#define CONFIG_LADSPA 1"
5440 else
5441 def_ladspa="#undef CONFIG_LADSPA"
5443 echores "$_ladspa"
5446 echocheck "libbs2b audio filter support"
5447 if test "$_libbs2b" = auto ; then
5448 _libbs2b=no
5449 if pkg_config_add libbs2b ; then
5450 _libbs2b=yes
5453 def_libbs2b="#undef CONFIG_LIBBS2B"
5454 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
5455 echores "$_libbs2b"
5458 if test -z "$_codecsdir" ; then
5459 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5460 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5461 if test -d "$dir" ; then
5462 _codecsdir="$dir"
5463 break;
5465 done
5467 # Fall back on default directory.
5468 if test -z "$_codecsdir" ; then
5469 _codecsdir="$_libdir/codecs"
5470 mingw32 && _codecsdir="codecs"
5474 echocheck "Win32 codecs"
5475 if test "$_win32dll" = auto ; then
5476 _win32dll=no
5477 if x86_32 && ! qnx; then
5478 _win32dll=yes
5481 if test "$_win32dll" = yes ; then
5482 def_win32dll='#define CONFIG_WIN32DLL 1'
5483 if ! win32 ; then
5484 def_win32_loader='#define WIN32_LOADER 1'
5485 _win32_emulation=yes
5486 else
5487 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
5488 res_comment="using native windows"
5490 codecmodules="win32 $codecmodules"
5491 else
5492 def_win32dll='#undef CONFIG_WIN32DLL'
5493 def_win32_loader='#undef WIN32_LOADER'
5494 nocodecmodules="win32 $nocodecmodules"
5496 echores "$_win32dll"
5499 echocheck "XAnim codecs"
5500 if test "$_xanim" = auto ; then
5501 _xanim=no
5502 res_comment="dynamic loader support needed"
5503 if test "$_dl" = yes ; then
5504 _xanim=yes
5507 if test "$_xanim" = yes ; then
5508 def_xanim='#define CONFIG_XANIM 1'
5509 codecmodules="xanim $codecmodules"
5510 else
5511 def_xanim='#undef CONFIG_XANIM'
5512 nocodecmodules="xanim $nocodecmodules"
5514 echores "$_xanim"
5517 echocheck "RealPlayer codecs"
5518 if test "$_real" = auto ; then
5519 _real=no
5520 res_comment="dynamic loader support needed"
5521 if test "$_dl" = yes || test "$_win32dll" = yes &&
5522 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
5523 _real=yes
5526 if test "$_real" = yes ; then
5527 def_real='#define CONFIG_REALCODECS 1'
5528 codecmodules="real $codecmodules"
5529 else
5530 def_real='#undef CONFIG_REALCODECS'
5531 nocodecmodules="real $nocodecmodules"
5533 echores "$_real"
5536 echocheck "QuickTime codecs"
5537 _qtx_emulation=no
5538 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
5539 if test "$_qtx" = auto ; then
5540 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
5542 if test "$_qtx" = yes ; then
5543 def_qtx='#define CONFIG_QTX_CODECS 1'
5544 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
5545 codecmodules="qtx $codecmodules"
5546 darwin || win32 || _qtx_emulation=yes
5547 else
5548 def_qtx='#undef CONFIG_QTX_CODECS'
5549 nocodecmodules="qtx $nocodecmodules"
5551 echores "$_qtx"
5553 echocheck "Nemesi Streaming Media libraries"
5554 if test "$_nemesi" = auto && test "$networking" = yes ; then
5555 _nemesi=no
5556 if pkg_config_add libnemesi ; then
5557 _nemesi=yes
5560 if test "$_nemesi" = yes; then
5561 _native_rtsp=no
5562 def_nemesi='#define CONFIG_LIBNEMESI 1'
5563 inputmodules="nemesi $inputmodules"
5564 else
5565 _native_rtsp="$networking"
5566 _nemesi=no
5567 def_nemesi='#undef CONFIG_LIBNEMESI'
5568 noinputmodules="nemesi $noinputmodules"
5570 echores "$_nemesi"
5572 echocheck "LIVE555 Streaming Media libraries"
5573 if test "$_live" != no && test "$networking" = yes ; then
5574 cat > $TMPCPP << EOF
5575 #include <liveMedia.hh>
5576 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
5577 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5578 #endif
5579 int main(void) { return 0; }
5582 _live=no
5583 for I in $extra_cflags "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/lib64/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
5584 cxx_check $I/liveMedia/include $I/UsageEnvironment/include $I/groupsock/include &&
5585 _livelibdir=$(echo $I| sed s/-I//) &&
5586 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
5587 $_livelibdir/groupsock/libgroupsock.a \
5588 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
5589 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
5590 $extra_ldflags -lstdc++" \
5591 extra_cxxflags="-I$_livelibdir/liveMedia/include \
5592 -I$_livelibdir/UsageEnvironment/include \
5593 -I$_livelibdir/BasicUsageEnvironment/include \
5594 -I$_livelibdir/groupsock/include" &&
5595 _live=yes && break
5596 done
5597 if test "$_live" != yes ; then
5598 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
5599 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
5600 _live_dist=yes
5604 if test "$_live" = yes && test "$networking" = yes; then
5605 test $_livelibdir && res_comment="using $_livelibdir"
5606 def_live='#define CONFIG_LIVE555 1'
5607 inputmodules="live555 $inputmodules"
5608 elif test "$_live_dist" = yes && test "$networking" = yes; then
5609 res_comment="using distribution version"
5610 _live="yes"
5611 def_live='#define CONFIG_LIVE555 1'
5612 extra_ldflags="$extra_ldflags $ld_tmp"
5613 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
5614 inputmodules="live555 $inputmodules"
5615 else
5616 _live=no
5617 def_live='#undef CONFIG_LIVE555'
5618 noinputmodules="live555 $noinputmodules"
5620 echores "$_live"
5624 # Test with > against Libav 0.8 versions which will NOT work rather than
5625 # specify minimum version, to allow (future) point releases to possibly work.
5626 all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5627 echocheck "Libav ($all_libav_libs)"
5628 if test "$ffmpeg" = auto ; then
5629 IFS=":" # shell should not be used for programming
5630 if ! pkg_config_add $all_libav_libs ; then
5631 die "Unable to find development files for some of the required Libav libraries above. Aborting."
5634 echores "yes"
5636 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
5637 if ! test -z "$_ffmpeg_source" ; then
5638 def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
5641 echocheck "libpostproc >= 52.0.0"
5642 if test "$libpostproc" = auto ; then
5643 libpostproc=no
5644 if pkg_config_add "libpostproc >= 52.0.0" ; then
5645 libpostproc=yes
5648 if test "$libpostproc" = yes ; then
5649 def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
5650 else
5651 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
5653 echores "$libpostproc"
5656 echocheck "libdv-0.9.5+"
5657 if test "$_libdv" = auto ; then
5658 _libdv=no
5659 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
5661 if test "$_libdv" = yes ; then
5662 def_libdv='#define CONFIG_LIBDV095 1'
5663 extra_ldflags="$extra_ldflags -ldv"
5664 codecmodules="libdv $codecmodules"
5665 else
5666 def_libdv='#undef CONFIG_LIBDV095'
5667 nocodecmodules="libdv $nocodecmodules"
5669 echores "$_libdv"
5672 echocheck "Xvid"
5673 if test "$_xvid" = auto ; then
5674 _xvid=no
5675 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5676 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5677 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
5678 done
5681 if test "$_xvid" = yes ; then
5682 def_xvid='#define CONFIG_XVID4 1'
5683 codecmodules="xvid $codecmodules"
5684 else
5685 def_xvid='#undef CONFIG_XVID4'
5686 nocodecmodules="xvid $nocodecmodules"
5688 echores "$_xvid"
5691 echocheck "libnut"
5692 if test "$_libnut" = auto ; then
5693 _libnut=no
5694 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
5697 if test "$_libnut" = yes ; then
5698 def_libnut='#define CONFIG_LIBNUT 1'
5699 extra_ldflags="$extra_ldflags -lnut"
5700 else
5701 def_libnut='#undef CONFIG_LIBNUT'
5703 echores "$_libnut"
5705 # These VO checks must be done after the FFmpeg one
5706 echocheck "/dev/mga_vid"
5707 if test "$_mga" = auto ; then
5708 _mga=no
5709 test -c /dev/mga_vid && _mga=yes
5711 if test "$_mga" = yes ; then
5712 def_mga='#define CONFIG_MGA 1'
5713 vomodules="mga $vomodules"
5714 else
5715 def_mga='#undef CONFIG_MGA'
5716 novomodules="mga $novomodules"
5718 echores "$_mga"
5721 echocheck "xmga"
5722 if test "$_xmga" = auto ; then
5723 _xmga=no
5724 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
5726 if test "$_xmga" = yes ; then
5727 def_xmga='#define CONFIG_XMGA 1'
5728 vomodules="xmga $vomodules"
5729 else
5730 def_xmga='#undef CONFIG_XMGA'
5731 novomodules="xmga $novomodules"
5733 echores "$_xmga"
5736 echocheck "UnRAR executable"
5737 if test "$_unrar_exec" = auto ; then
5738 _unrar_exec="yes"
5739 mingw32 && _unrar_exec="no"
5741 if test "$_unrar_exec" = yes ; then
5742 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
5743 else
5744 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
5746 echores "$_unrar_exec"
5748 echocheck "TV interface"
5749 if test "$_tv" = yes ; then
5750 def_tv='#define CONFIG_TV 1'
5751 inputmodules="tv $inputmodules"
5752 else
5753 noinputmodules="tv $noinputmodules"
5754 def_tv='#undef CONFIG_TV'
5756 echores "$_tv"
5759 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
5760 echocheck "*BSD BT848 bt8xx header"
5761 _ioctl_bt848_h=no
5762 for file in "machine/ioctl_bt848.h" \
5763 "dev/bktr/ioctl_bt848.h" \
5764 "dev/video/bktr/ioctl_bt848.h" \
5765 "dev/ic/bt8xx.h" ; do
5766 cat > $TMPC <<EOF
5767 #include <sys/types.h>
5768 #include <sys/ioctl.h>
5769 #include <$file>
5770 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5772 if cc_check ; then
5773 _ioctl_bt848_h=yes
5774 _ioctl_bt848_h_name="$file"
5775 break;
5777 done
5778 if test "$_ioctl_bt848_h" = yes ; then
5779 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5780 res_comment="using $_ioctl_bt848_h_name"
5781 else
5782 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
5784 echores "$_ioctl_bt848_h"
5786 echocheck "*BSD ioctl_meteor.h"
5787 _ioctl_meteor_h=no
5788 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5789 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5790 _ioctl_meteor_h=yes && break
5791 done
5792 if test "$_ioctl_meteor_h" = yes ; then
5793 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5794 res_comment="using $ioctl_meteor_h_path"
5795 else
5796 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
5798 echores "$_ioctl_meteor_h"
5800 echocheck "*BSD BrookTree 848 TV interface"
5801 if test "$_tv_bsdbt848" = auto ; then
5802 _tv_bsdbt848=no
5803 if test "$_tv" = yes ; then
5804 cat > $TMPC <<EOF
5805 #include <sys/types.h>
5806 $def_ioctl_meteor_h_name
5807 $def_ioctl_bt848_h_name
5808 #ifdef IOCTL_METEOR_H_NAME
5809 #include IOCTL_METEOR_H_NAME
5810 #endif
5811 #ifdef IOCTL_BT848_H_NAME
5812 #include IOCTL_BT848_H_NAME
5813 #endif
5814 int main(void) {
5815 ioctl(0, METEORSINPUT, 0);
5816 ioctl(0, TVTUNER_GETFREQ, 0);
5817 return 0;
5820 cc_check && _tv_bsdbt848=yes
5823 if test "$_tv_bsdbt848" = yes ; then
5824 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
5825 inputmodules="tv-bsdbt848 $inputmodules"
5826 else
5827 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
5828 noinputmodules="tv-bsdbt848 $noinputmodules"
5830 echores "$_tv_bsdbt848"
5831 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5834 echocheck "DirectShow TV interface"
5835 if test "$_tv_dshow" = auto ; then
5836 _tv_dshow=no
5837 if test "$_tv" = yes && win32 ; then
5838 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
5841 if test "$_tv_dshow" = yes ; then
5842 inputmodules="tv-dshow $inputmodules"
5843 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
5844 extra_ldflags="$extra_ldflags -lole32 -luuid"
5845 else
5846 noinputmodules="tv-dshow $noinputmodules"
5847 def_tv_dshow='#undef CONFIG_TV_DSHOW'
5849 echores "$_tv_dshow"
5852 echocheck "Video 4 Linux TV interface"
5853 if test "$_tv_v4l1" = auto ; then
5854 _tv_v4l1=no
5855 if test "$_tv" = yes && linux ; then
5856 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
5859 if test "$_tv_v4l1" = yes ; then
5860 _audio_input=yes
5861 _tv_v4l=yes
5862 def_tv_v4l='#define CONFIG_TV_V4L 1'
5863 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
5864 inputmodules="tv-v4l $inputmodules"
5865 else
5866 noinputmodules="tv-v4l1 $noinputmodules"
5867 def_tv_v4l='#undef CONFIG_TV_V4L'
5869 echores "$_tv_v4l1"
5872 echocheck "Video 4 Linux 2 TV interface"
5873 if test "$_tv_v4l2" = auto ; then
5874 _tv_v4l2=no
5875 if test "$_tv" = yes && linux ; then
5876 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
5877 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5878 _tv_v4l2=yes
5881 if test "$_tv_v4l2" = yes ; then
5882 _audio_input=yes
5883 _tv_v4l=yes
5884 def_tv_v4l='#define CONFIG_TV_V4L 1'
5885 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
5886 inputmodules="tv-v4l2 $inputmodules"
5887 else
5888 noinputmodules="tv-v4l2 $noinputmodules"
5889 def_tv_v4l2='#undef CONFIG_TV_V4L2'
5891 echores "$_tv_v4l2"
5894 echocheck "Radio interface"
5895 if test "$_radio" = yes ; then
5896 def_radio='#define CONFIG_RADIO 1'
5897 inputmodules="radio $inputmodules"
5898 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5899 _radio_capture=no
5901 if test "$_radio_capture" = yes ; then
5902 _audio_input=yes
5903 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
5904 else
5905 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5907 else
5908 noinputmodules="radio $noinputmodules"
5909 def_radio='#undef CONFIG_RADIO'
5910 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5911 _radio_capture=no
5913 echores "$_radio"
5914 echocheck "Capture for Radio interface"
5915 echores "$_radio_capture"
5917 echocheck "Video 4 Linux 2 Radio interface"
5918 if test "$_radio_v4l2" = auto ; then
5919 _radio_v4l2=no
5920 if test "$_radio" = yes && linux ; then
5921 header_check linux/videodev2.h && _radio_v4l2=yes
5924 if test "$_radio_v4l2" = yes ; then
5925 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
5926 else
5927 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
5929 echores "$_radio_v4l2"
5931 echocheck "Video 4 Linux Radio interface"
5932 if test "$_radio_v4l" = auto ; then
5933 _radio_v4l=no
5934 if test "$_radio" = yes && linux ; then
5935 header_check linux/videodev.h && _radio_v4l=yes
5938 if test "$_radio_v4l" = yes ; then
5939 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
5940 else
5941 def_radio_v4l='#undef CONFIG_RADIO_V4L'
5943 echores "$_radio_v4l"
5945 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
5946 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
5947 echocheck "*BSD BrookTree 848 Radio interface"
5948 _radio_bsdbt848=no
5949 cat > $TMPC <<EOF
5950 #include <sys/types.h>
5951 $def_ioctl_bt848_h_name
5952 #ifdef IOCTL_BT848_H_NAME
5953 #include IOCTL_BT848_H_NAME
5954 #endif
5955 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5957 cc_check && _radio_bsdbt848=yes
5958 echores "$_radio_bsdbt848"
5959 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5961 if test "$_radio_bsdbt848" = yes ; then
5962 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
5963 else
5964 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
5967 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
5968 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
5969 die "Radio driver requires BSD BT848, V4L or V4L2!"
5972 echocheck "Video 4 Linux 2 MPEG PVR interface"
5973 if test "$_pvr" = auto ; then
5974 _pvr=no
5975 if test "$_tv_v4l2" = yes && linux ; then
5976 cat > $TMPC <<EOF
5977 #include <sys/time.h>
5978 #include <linux/videodev2.h>
5979 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5981 cc_check && _pvr=yes
5984 if test "$_pvr" = yes ; then
5985 def_pvr='#define CONFIG_PVR 1'
5986 inputmodules="pvr $inputmodules"
5987 else
5988 noinputmodules="pvr $noinputmodules"
5989 def_pvr='#undef CONFIG_PVR'
5991 echores "$_pvr"
5994 echocheck "ftp"
5995 if test "$_ftp" = "auto" ; then
5996 test "$networking" = "yes" && ! beos && _ftp=yes
5998 if test "$_ftp" = yes ; then
5999 def_ftp='#define CONFIG_FTP 1'
6000 inputmodules="ftp $inputmodules"
6001 else
6002 noinputmodules="ftp $noinputmodules"
6003 def_ftp='#undef CONFIG_FTP'
6005 echores "$_ftp"
6007 echocheck "vstream client"
6008 if test "$_vstream" = auto ; then
6009 _vstream=no
6010 cat > $TMPC <<EOF
6011 #include <vstream-client.h>
6012 void vstream_error(const char *format, ... ) {}
6013 int main(void) { vstream_start(); return 0; }
6015 cc_check -lvstream-client && _vstream=yes
6017 if test "$_vstream" = yes ; then
6018 def_vstream='#define CONFIG_VSTREAM 1'
6019 inputmodules="vstream $inputmodules"
6020 extra_ldflags="$extra_ldflags -lvstream-client"
6021 else
6022 noinputmodules="vstream $noinputmodules"
6023 def_vstream='#undef CONFIG_VSTREAM'
6025 echores "$_vstream"
6028 echocheck "Subtitles sorting"
6029 if test "$_sortsub" = yes ; then
6030 def_sortsub='#define CONFIG_SORTSUB 1'
6031 else
6032 def_sortsub='#undef CONFIG_SORTSUB'
6034 echores "$_sortsub"
6037 echocheck "XMMS inputplugin support"
6038 if test "$_xmms" = yes ; then
6039 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6040 _xmmsplugindir=$(xmms-config --input-plugin-dir)
6041 _xmmslibdir=$(xmms-config --exec-prefix)/lib
6042 else
6043 _xmmsplugindir=/usr/lib/xmms/Input
6044 _xmmslibdir=/usr/lib
6047 def_xmms='#define CONFIG_XMMS 1'
6048 if darwin ; then
6049 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6050 else
6051 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6053 else
6054 def_xmms='#undef CONFIG_XMMS'
6056 echores "$_xmms"
6058 if test "$_charset" != "noconv" ; then
6059 def_charset="#define MSG_CHARSET \"$_charset\""
6060 else
6061 def_charset="#undef MSG_CHARSET"
6062 _charset="UTF-8"
6065 #############################################################################
6067 echocheck "automatic gdb attach"
6068 if test "$_crash_debug" = yes ; then
6069 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
6070 else
6071 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
6072 _crash_debug=no
6074 echores "$_crash_debug"
6076 echocheck "compiler support for noexecstack"
6077 if cflag_check -Wl,-z,noexecstack ; then
6078 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
6079 echores "yes"
6080 else
6081 echores "no"
6084 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
6085 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6086 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6087 echores "yes"
6088 else
6089 echores "no"
6093 # Dynamic linking flags
6094 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6095 _ld_dl_dynamic=''
6096 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
6097 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! sunos; then
6098 _ld_dl_dynamic='-rdynamic'
6101 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6102 bsdos && extra_ldflags="$extra_ldflags -ldvd"
6103 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
6105 def_debug='#undef MP_DEBUG'
6106 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
6109 echocheck "joystick"
6110 def_joystick='#undef CONFIG_JOYSTICK'
6111 if test "$_joystick" = yes ; then
6112 if linux || freebsd ; then
6113 # TODO add some check
6114 def_joystick='#define CONFIG_JOYSTICK 1'
6115 else
6116 _joystick="no"
6117 res_comment="unsupported under $system_name"
6120 echores "$_joystick"
6122 echocheck "lirc"
6123 if test "$_lirc" = auto ; then
6124 _lirc=no
6125 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
6127 if test "$_lirc" = yes ; then
6128 def_lirc='#define CONFIG_LIRC 1'
6129 libs_mplayer="$libs_mplayer -llirc_client"
6130 else
6131 def_lirc='#undef CONFIG_LIRC'
6133 echores "$_lirc"
6135 echocheck "lircc"
6136 if test "$_lircc" = auto ; then
6137 _lircc=no
6138 header_check lirc/lircc.h -llircc && _lircc=yes
6140 if test "$_lircc" = yes ; then
6141 def_lircc='#define CONFIG_LIRCC 1'
6142 libs_mplayer="$libs_mplayer -llircc"
6143 else
6144 def_lircc='#undef CONFIG_LIRCC'
6146 echores "$_lircc"
6148 #############################################################################
6150 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
6152 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
6154 # This must be the last test to be performed. Any other tests following it
6155 # could fail due to linker errors. libdvdnavmini is intentionally not linked
6156 # against libdvdread (to permit MPlayer to use its own copy of the library).
6157 # So any compilation using the flags added here but not linking against
6158 # libdvdread can fail.
6159 echocheck "DVD support (libdvdnav)"
6160 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
6161 _dvdnav=no
6163 dvdnav_internal=no
6164 if test "$_dvdnav" = auto ; then
6165 if test "$_dvdread_internal" = yes ; then
6166 _dvdnav=yes
6167 dvdnav_internal=yes
6168 res_comment="internal"
6169 else
6170 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
6173 if test "$_dvdnav" = auto ; then
6174 _dvdnav=no
6175 _dvdnavdir=$($_dvdnavconfig --cflags)
6176 _dvdnavlibs=$($_dvdnavconfig --libs)
6177 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
6179 if test "$_dvdnav" = yes ; then
6180 def_dvdnav='#define CONFIG_DVDNAV 1'
6181 if test "$dvdnav_internal" = yes ; then
6182 cflags_libdvdnav="-Ilibdvdnav"
6183 inputmodules="dvdnav(internal) $inputmodules"
6184 else
6185 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
6186 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
6187 inputmodules="dvdnav $inputmodules"
6189 else
6190 def_dvdnav='#undef CONFIG_DVDNAV'
6191 noinputmodules="dvdnav $noinputmodules"
6193 echores "$_dvdnav"
6195 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
6196 # Read dvdnav comment above.
6198 mak_enable () {
6199 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6200 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6201 nprefix=$3;
6202 for part in $list; do
6203 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6204 echo "${nprefix}_$part = yes"
6206 done
6209 #############################################################################
6210 echo "Creating config.mak"
6211 cat > config.mak << EOF
6212 # -------- Generated by configure -----------
6214 # Ensure that locale settings do not interfere with shell commands.
6215 export LC_ALL = C
6217 CONFIGURATION = $configuration
6219 CHARSET = $_charset
6220 DOC_LANGS = $language_doc
6221 DOC_LANG_ALL = $doc_lang_all
6222 MAN_LANGS = $language_man
6223 MAN_LANG_ALL = $man_lang_all
6224 MSG_LANGS = $language_msg
6225 MSG_LANG_ALL = $msg_lang_all
6227 prefix = \$(DESTDIR)$_prefix
6228 BINDIR = \$(DESTDIR)$_bindir
6229 DATADIR = \$(DESTDIR)$_datadir
6230 LIBDIR = \$(DESTDIR)$_libdir
6231 MANDIR = \$(DESTDIR)$_mandir
6232 CONFDIR = \$(DESTDIR)$_confdir
6233 LOCALEDIR = \$(DESTDIR)$_localedir
6235 AR = $_ar
6236 AS = $_cc
6237 CC = $_cc
6238 CXX = $_cc
6239 HOST_CC = $_host_cc
6240 INSTALL = $_install
6241 INSTALLSTRIP = $_install_strip
6242 WINDRES = $_windres
6244 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
6245 CXXFLAGS = $WARNFLAGS $ERRORFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
6246 DEPFLAGS = $DEPFLAGS
6248 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
6249 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
6250 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
6251 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
6252 CFLAGS_STACKREALIGN = $cflags_stackrealign
6254 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
6255 EXTRALIBS_MPLAYER = $libs_mplayer
6257 GETCH = $_getch
6258 TIMER = $_timer
6260 EXESUF = $_exesuf
6261 EXESUFS_ALL = .exe
6263 ARCH = $arch
6264 $(mak_enable "$arch_all" "$arch" ARCH)
6265 $(mak_enable "$subarch_all" "$subarch" ARCH)
6266 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
6268 MPLAYER = $_mplayer
6270 NEED_GETTIMEOFDAY = $need_gettimeofday
6271 NEED_GLOB = $need_glob
6272 NEED_SETENV = $need_setenv
6273 NEED_SHMEM = $need_shmem
6274 NEED_STRSEP = $need_strsep
6275 NEED_SWAB = $need_swab
6276 NEED_VSSCANF = $need_vsscanf
6278 # features
6279 3DFX = $_3dfx
6280 AA = $_aa
6281 ALSA = $_alsa
6282 APPLE_IR = $_apple_ir
6283 APPLE_REMOTE = $_apple_remote
6284 AUDIO_INPUT = $_audio_input
6285 BITMAP_FONT = $_bitmap_font
6286 BL = $_bl
6287 CACA = $_caca
6288 CDDA = $_cdda
6289 CDDB = $_cddb
6290 COCOA = $_cocoa
6291 COREAUDIO = $_coreaudio
6292 COREVIDEO = $_corevideo
6293 SHAREDBUFFER = $_sharedbuffer
6294 DGA = $_dga
6295 DIRECT3D = $_direct3d
6296 DIRECTFB = $_directfb
6297 DIRECTX = $_directx
6298 DVBIN = $_dvbin
6299 DVDNAV = $_dvdnav
6300 DVDNAV_INTERNAL = $dvdnav_internal
6301 DVDREAD = $_dvdread
6302 DVDREAD_INTERNAL = $_dvdread_internal
6303 DXR3 = $_dxr3
6304 FAAD = $_faad
6305 FASTMEMCPY = $_fastmemcpy
6306 FBDEV = $_fbdev
6307 FREETYPE = $_freetype
6308 FTP = $_ftp
6309 GIF = $_gif
6310 GGI = $_ggi
6311 GL = $_gl
6312 GL_COCOA = $_gl_cocoa
6313 GL_WIN32 = $_gl_win32
6314 GL_X11 = $_gl_x11
6315 GL_SDL = $_gl_sdl
6316 HAVE_POSIX_SELECT = $_posix_select
6317 HAVE_SYS_MMAN_H = $_mman
6318 IVTV = $_ivtv
6319 JACK = $_jack
6320 JOYSTICK = $_joystick
6321 JPEG = $_jpeg
6322 LADSPA = $_ladspa
6323 LIBA52 = $_liba52
6324 LIBASS = $_ass
6325 LIBBLURAY = $_bluray
6326 LIBBS2B = $_libbs2b
6327 LIBDCA = $_libdca
6328 LIBDV = $_libdv
6329 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
6330 LIBMAD = $_mad
6331 LIBNEMESI = $_nemesi
6332 LIBNUT = $_libnut
6333 LIBPOSTPROC = $libpostproc
6334 LIBSMBCLIENT = $_smb
6335 LIBTHEORA = $_theora
6336 LIRC = $_lirc
6337 LIVE555 = $_live
6338 MACOSX_FINDER = $_macosx_finder
6339 MD5SUM = $_md5sum
6340 MGA = $_mga
6341 MNG = $_mng
6342 MPG123 = $_mpg123
6343 MUSEPACK = $_musepack
6344 NAS = $_nas
6345 NATIVE_RTSP = $_native_rtsp
6346 NETWORKING = $networking
6347 OPENAL = $_openal
6348 OSS = $_ossaudio
6349 PE_EXECUTABLE = $_pe_executable
6350 PNG = $_png
6351 PNM = $_pnm
6352 PRIORITY = $_priority
6353 PULSE = $_pulse
6354 PORTAUDIO = $_portaudio
6355 PVR = $_pvr
6356 QTX_CODECS = $_qtx
6357 QTX_CODECS_WIN32 = $_qtx_codecs_win32
6358 QTX_EMULATION = $_qtx_emulation
6359 RADIO=$_radio
6360 RADIO_CAPTURE=$_radio_capture
6361 REAL_CODECS = $_real
6362 RSOUND = $_rsound
6363 S3FB = $_s3fb
6364 SDL = $_sdl
6365 SPEEX = $_speex
6366 STREAM_CACHE = $_stream_cache
6367 SUNAUDIO = $_sunaudio
6368 SVGA = $_svga
6369 TDFXFB = $_tdfxfb
6370 TDFXVID = $_tdfxvid
6371 TGA = $_tga
6372 TV = $_tv
6373 TV_BSDBT848 = $_tv_bsdbt848
6374 TV_DSHOW = $_tv_dshow
6375 TV_V4L = $_tv_v4l
6376 TV_V4L1 = $_tv_v4l1
6377 TV_V4L2 = $_tv_v4l2
6378 UNRAR_EXEC = $_unrar_exec
6379 V4L2 = $_v4l2
6380 VCD = $_vcd
6381 VDPAU = $_vdpau
6382 VESA = $_vesa
6383 VORBIS = $_vorbis
6384 VSTREAM = $_vstream
6385 WII = $_wii
6386 WIN32DLL = $_win32dll
6387 WIN32WAVEOUT = $_win32waveout
6388 WIN32_EMULATION = $_win32_emulation
6389 X11 = $_x11
6390 XANIM_CODECS = $_xanim
6391 XMGA = $_xmga
6392 XMMS_PLUGINS = $_xmms
6393 XV = $_xv
6394 XVID4 = $_xvid
6395 XVR100 = $_xvr100
6396 YUV4MPEG = $_yuv4mpeg
6398 # FFmpeg
6399 FFMPEG_INTERNALS = $ffmpeg_internals
6400 FFMPEG_SOURCE_PATH = $_ffmpeg_source
6402 RANLIB = $_ranlib
6403 YASM = $_yasm
6404 YASMFLAGS = $YASMFLAGS
6406 CONFIG_VDPAU = $_vdpau
6407 CONFIG_ZLIB = $_zlib
6409 HAVE_PTHREADS = $_pthreads
6410 HAVE_SHM = $_shm
6411 HAVE_W32THREADS = $_w32threads
6412 HAVE_YASM = $have_yasm
6416 #############################################################################
6418 ff_config_enable () {
6419 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6420 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6421 _nprefix=$3;
6422 test -z "$_nprefix" && _nprefix='CONFIG'
6423 for part in $list; do
6424 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6425 echo "#define ${_nprefix}_$part 1"
6426 else
6427 echo "#define ${_nprefix}_$part 0"
6429 done
6432 echo "Creating config.h"
6433 cat > $TMPH << EOF
6434 /*----------------------------------------------------------------------------
6435 ** This file has been automatically generated by configure any changes in it
6436 ** will be lost when you run configure again.
6437 ** Instead of modifying definitions here, use the --enable/--disable options
6438 ** of the configure script! See ./configure --help for details.
6439 *---------------------------------------------------------------------------*/
6441 #ifndef MPLAYER_CONFIG_H
6442 #define MPLAYER_CONFIG_H
6444 /* Undefine this if you do not want to select mono audio (left or right)
6445 with a stereo MPEG layer 2/3 audio stream. The command line option
6446 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6447 right-only), with 0 being the default.
6449 #define CONFIG_FAKE_MONO 1
6451 /* set up audio OUTBURST. Do not change this! */
6452 #define OUTBURST 512
6454 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
6455 #undef FAST_OSD
6456 #undef FAST_OSD_TABLE
6460 #define CONFIGURATION "$configuration"
6462 #define MPLAYER_DATADIR "$_datadir"
6463 #define MPLAYER_CONFDIR "$_confdir"
6464 #define MPLAYER_LOCALEDIR "$_localedir"
6466 $def_translation
6468 /* definitions needed by included libraries */
6469 #define HAVE_INTTYPES_H 1
6470 /* libdvdcss */
6471 #define HAVE_ERRNO_H 1
6472 /* libdvdcss + libdvdread */
6473 #define HAVE_LIMITS_H 1
6474 /* libdvdcss */
6475 #define HAVE_UNISTD_H 1
6476 /* libdvdread */
6477 #define STDC_HEADERS 1
6478 #define HAVE_MEMCPY 1
6479 /* libdvdnav */
6480 #define READ_CACHE_TRACE 0
6481 /* libdvdread */
6482 #define HAVE_DLFCN_H 1
6483 $def_dvdcss
6486 /* system headers */
6487 $def_alloca_h
6488 $def_altivec_h
6489 $def_malloc_h
6490 $def_mman_h
6491 $def_mman_has_map_failed
6492 $def_soundcard_h
6493 $def_sys_soundcard_h
6494 $def_sys_sysinfo_h
6495 $def_sys_videoio_h
6496 $def_termios_h
6497 $def_termios_sys_h
6498 $def_winsock2_h
6501 /* system functions */
6502 $def_gethostbyname2
6503 $def_gettimeofday
6504 $def_glob
6505 $def_langinfo
6506 $def_lrintf
6507 $def_map_memalign
6508 $def_memalign
6509 $def_nanosleep
6510 $def_posix_select
6511 $def_select
6512 $def_setenv
6513 $def_setmode
6514 $def_shm
6515 $def_strsep
6516 $def_swab
6517 $def_sysi86
6518 $def_sysi86_iv
6519 $def_termcap
6520 $def_termios
6521 $def_vsscanf
6524 /* system-specific features */
6525 $def_asmalign_pot
6526 $def_builtin_expect
6527 $def_dl
6528 $def_dos_paths
6529 $def_extern_asm
6530 $def_extern_prefix
6531 $def_iconv
6532 $def_kstat
6533 $def_macosx_bundle
6534 $def_macosx_finder
6535 $def_priority
6536 $def_quicktime
6537 $def_restrict_keyword
6538 $def_rtc
6539 $def_unrar_exec
6542 /* configurable options */
6543 $def_charset
6544 $def_crash_debug
6545 $def_debug
6546 $def_fastmemcpy
6547 $def_runtime_cpudetection
6548 $def_sighandler
6549 $def_sortsub
6550 $def_stream_cache
6551 $def_pthread_cache
6554 /* CPU stuff */
6555 #define __CPU__ $iproc
6556 $def_ebx_available
6557 $def_words_endian
6558 $def_bigendian
6559 $(ff_config_enable "$arch_all" "$arch" "ARCH")
6560 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
6561 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
6564 /* Blu-ray/DVD/VCD/CD */
6565 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
6566 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
6567 $def_bluray
6568 $def_bsdi_dvd
6569 $def_cdda
6570 $def_cddb
6571 $def_cdio
6572 $def_cdrom
6573 $def_dvd
6574 $def_dvd_bsd
6575 $def_dvd_darwin
6576 $def_dvd_linux
6577 $def_dvd_openbsd
6578 $def_dvdio
6579 $def_dvdnav
6580 $def_dvdread
6581 $def_hpux_scsi_h
6582 $def_sol_scsi_h
6583 $def_vcd
6586 /* codec libraries */
6587 $def_faad
6588 $def_liba52
6589 $def_libdca
6590 $def_libdv
6591 $def_mad
6592 $def_mpg123
6593 $def_musepack
6594 $def_speex
6595 $def_theora
6596 $def_tremor
6597 $def_vorbis
6598 $def_xvid
6599 $def_zlib
6601 $def_libpostproc
6602 $def_libnut
6605 /* binary codecs */
6606 $def_qtx
6607 $def_qtx_win32
6608 $def_real
6609 $def_win32_loader
6610 $def_win32dll
6611 $def_xanim
6612 $def_xmms
6613 #define BINARY_CODECS_PATH "$_codecsdir"
6614 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
6617 /* Audio output drivers */
6618 $def_alsa
6619 $def_coreaudio
6620 $def_jack
6621 $def_nas
6622 $def_openal
6623 $def_openal_h
6624 $def_ossaudio
6625 $def_ossaudio_devdsp
6626 $def_ossaudio_devmixer
6627 $def_pulse
6628 $def_portaudio
6629 $def_rsound
6630 $def_sunaudio
6631 $def_win32waveout
6633 $def_ladspa
6634 $def_libbs2b
6637 /* input */
6638 $def_apple_ir
6639 $def_apple_remote
6640 $def_ioctl_bt848_h_name
6641 $def_ioctl_meteor_h_name
6642 $def_joystick
6643 $def_lirc
6644 $def_lircc
6645 $def_pvr
6646 $def_radio
6647 $def_radio_bsdbt848
6648 $def_radio_capture
6649 $def_radio_v4l
6650 $def_radio_v4l2
6651 $def_tv
6652 $def_tv_bsdbt848
6653 $def_tv_dshow
6654 $def_tv_v4l
6655 $def_tv_v4l1
6656 $def_tv_v4l2
6659 /* font stuff */
6660 $def_ass
6661 $def_bitmap_font
6662 $def_enca
6663 $def_fontconfig
6664 $def_freetype
6665 $def_fribidi
6668 /* networking */
6669 $def_closesocket
6670 $def_ftp
6671 $def_inet6
6672 $def_inet_aton
6673 $def_inet_pton
6674 $def_live
6675 $def_nemesi
6676 $def_networking
6677 $def_smb
6678 $def_socklen_t
6679 $def_vstream
6682 /* libvo options */
6683 $def_3dfx
6684 $def_aa
6685 $def_bl
6686 $def_caca
6687 $def_corevideo
6688 $def_cocoa
6689 $def_sharedbuffer
6690 $def_dga
6691 $def_dga1
6692 $def_dga2
6693 $def_direct3d
6694 $def_directfb
6695 $def_directx
6696 $def_dvb
6697 $def_dvbin
6698 $def_dxr3
6699 $def_fbdev
6700 $def_ggi
6701 $def_ggiwmh
6702 $def_gif
6703 $def_gif_4
6704 $def_gif_tvt_hack
6705 $def_gl
6706 $def_gl_cocoa
6707 $def_gl_win32
6708 $def_gl_x11
6709 $def_gl_sdl
6710 $def_ivtv
6711 $def_jpeg
6712 $def_md5sum
6713 $def_mga
6714 $def_mng
6715 $def_png
6716 $def_pnm
6717 $def_s3fb
6718 $def_sdl
6719 $def_sdl_sdl_h
6720 $def_svga
6721 $def_tdfxfb
6722 $def_tdfxvid
6723 $def_tga
6724 $def_v4l2
6725 $def_vdpau
6726 $def_vesa
6727 $def_vm
6728 $def_wii
6729 $def_x11
6730 $def_xdpms
6731 $def_xf86keysym
6732 $def_xinerama
6733 $def_xmga
6734 $def_xss
6735 $def_xv
6736 $def_xvr100
6737 $def_yuv4mpeg
6740 /* FFmpeg */
6741 $def_ffmpeg_internals
6743 $def_arpa_inet_h
6744 $def_bswap
6745 $def_dcbzl
6746 $def_exp2
6747 $def_exp2f
6748 $def_fast_64bit
6749 $def_fast_unaligned
6750 $def_llrint
6751 $def_log2
6752 $def_log2f
6753 $def_lrint
6754 $def_memalign_hack
6755 $def_mkstemp
6756 $def_posix_memalign
6757 $def_pthreads
6758 $def_round
6759 $def_roundf
6760 $def_threads
6761 $def_truncf
6762 $def_xform_asm
6763 $def_yasm
6765 #define HAVE_INLINE_ASM 1
6767 /* Use these registers in x86 inline asm. No proper detection yet. */
6768 #define HAVE_EBP_AVAILABLE 1
6770 #endif /* MPLAYER_CONFIG_H */
6773 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6774 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
6776 #############################################################################
6778 cat << EOF
6780 Config files successfully generated by ./configure $configuration !
6782 Install prefix: $_prefix
6783 Data directory: $_datadir
6784 Config direct.: $_confdir
6786 Byte order: $_byte_order
6787 Optimizing for: $_optimizing
6789 Languages:
6790 Messages (in addition to English): $language_msg
6791 Manual pages: $language_man
6792 Documentation: $language_doc
6794 Enabled optional drivers:
6795 Input: $inputmodules
6796 Codecs: $codecmodules
6797 Audio output: $aomodules
6798 Video output: $vomodules
6800 Disabled optional drivers:
6801 Input: $noinputmodules
6802 Codecs: $nocodecmodules
6803 Audio output: $noaomodules
6804 Video output: $novomodules
6806 'config.h' and 'config.mak' contain your configuration options.
6807 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6808 compile *** DO NOT REPORT BUGS if you tweak these files ***
6810 'make' will now compile MPlayer and 'make install' will install it.
6811 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6816 cat <<EOF
6817 Check $TMPLOG if you wonder why an autodetection failed (make sure
6818 development headers/packages are installed).
6820 NOTE: The --enable-* parameters unconditionally force options on, completely
6821 skipping autodetection. This behavior is unlike what you may be used to from
6822 autoconf-based configure scripts that can decide to override you. This greater
6823 level of control comes at a price. You may have to provide the correct compiler
6824 and linker flags yourself.
6825 If you used one of these options (except --enable-runtime-cpudetection and
6826 similar ones that turn on internal features) and experience a compilation or
6827 linking failure, make sure you have passed the necessary compiler/linker flags
6828 to configure.
6830 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6834 if test "$warn_cflags" = yes; then
6835 cat <<EOF
6837 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6838 but:
6840 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6842 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6843 To do so, execute 'CFLAGS= ./configure <options>'
6848 # Last move:
6849 rm -rf "$mplayer_tmpdir"