cosmetics: stream_cdda.c: reformat
[mplayer.git] / configure
blob71dbecab684336618333c1ef008d865caeb91010
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 irix() { issystem "IRIX"; }
213 linux() { issystem "Linux"; }
214 mingw32() { issystem "MINGW32"; }
215 morphos() { issystem "MorphOS"; }
216 netbsd() { issystem "NetBSD"; }
217 openbsd() { issystem "OpenBSD"; }
218 qnx() { issystem "QNX"; }
219 sunos() { issystem "SunOS"; }
220 win32() { cygwin || mingw32; }
222 # arch test boolean functions
223 # x86/x86pc is used by QNX
224 x86_32() {
225 case "$host_arch" in
226 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
227 *) return 1 ;;
228 esac
231 x86_64() {
232 case "$host_arch" in
233 x86_64|amd64) return 0 ;;
234 *) return 1 ;;
235 esac
238 x86() {
239 x86_32 || x86_64
242 ppc() {
243 case "$host_arch" in
244 ppc|ppc64|powerpc|powerpc64) return 0;;
245 *) return 1;;
246 esac
249 alpha() {
250 case "$host_arch" in
251 alpha*) return 0;;
252 *) return 1;;
253 esac
256 arm() {
257 case "$host_arch" in
258 arm*) return 0;;
259 *) return 1;;
260 esac
263 # Use this before starting a check
264 echocheck() {
265 echo "============ Checking for $@ ============" >> "$TMPLOG"
266 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
269 # Use this to echo the results of a check
270 echores() {
271 if test "$res_comment" ; then
272 res_comment="($res_comment)"
274 echo "Result is: $@ $res_comment" >> "$TMPLOG"
275 echo "##########################################" >> "$TMPLOG"
276 echo "" >> "$TMPLOG"
277 echo "$@ $res_comment"
278 res_comment=""
280 #############################################################################
282 # Check how echo works in this /bin/sh
283 case $(echo -n) in
284 -n) _echo_n= _echo_c='\c' ;; # SysV echo
285 *) _echo_n='-n ' _echo_c= ;; # BSD echo
286 esac
288 msg_lang_all=''
289 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
290 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")
291 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
293 show_help(){
294 cat << EOF
295 Usage: $0 [OPTIONS]...
297 Configuration:
298 -h, --help display this help and exit
300 Installation directories:
301 --prefix=DIR prefix directory for installation [/usr/local]
302 --bindir=DIR directory for installing binaries [PREFIX/bin]
303 --datadir=DIR directory for installing machine independent
304 data files (skins, etc) [PREFIX/share/mplayer]
305 --mandir=DIR directory for installing man pages [PREFIX/share/man]
306 --confdir=DIR directory for installing configuration files
307 [PREFIX/etc/mplayer]
308 --localedir=DIR directory for locale tree [PREFIX/share/locale]
309 --libdir=DIR directory for object code libraries [PREFIX/lib]
310 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
312 Optional features:
313 --disable-mplayer disable MPlayer compilation [enable]
314 --enable-termcap use termcap database for key codes [autodetect]
315 --enable-termios use termios database for key codes [autodetect]
316 --disable-iconv disable iconv for encoding conversion [autodetect]
317 --disable-langinfo do not use langinfo [autodetect]
318 --enable-lirc enable LIRC (remote control) support [autodetect]
319 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
320 --enable-joystick enable joystick support [disable]
321 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
322 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
323 --disable-vm disable X video mode extensions [autodetect]
324 --disable-xf86keysym disable support for multimedia keys [autodetect]
325 --enable-radio enable radio interface [disable]
326 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
327 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
328 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
329 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
330 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
331 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
332 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
333 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
334 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
335 --disable-networking disable networking [enable]
336 --enable-winsock2_h enable winsock2_h [autodetect]
337 --enable-smb enable Samba (SMB) input [autodetect]
338 --enable-live enable LIVE555 Streaming Media [disable]
339 --enable-nemesi enable Nemesi Streaming Media [autodetect]
340 --disable-vcd disable VCD support [autodetect]
341 --disable-bluray disable Blu-ray support [autodetect]
342 --disable-dvdnav disable libdvdnav [autodetect]
343 --disable-dvdread disable libdvdread [autodetect]
344 --disable-dvdread-internal disable internal libdvdread [autodetect]
345 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
346 --disable-cdparanoia disable cdparanoia [autodetect]
347 --disable-cddb disable cddb [autodetect]
348 --disable-bitmap-font disable bitmap font support [enable]
349 --disable-freetype disable FreeType 2 font rendering [autodetect]
350 --disable-fontconfig disable fontconfig font lookup [autodetect]
351 --disable-unrarexec disable using of UnRAR executable [enabled]
352 --disable-sortsub disable subtitle sorting [enabled]
353 --enable-fribidi enable the FriBiDi libs [autodetect]
354 --disable-enca disable ENCA charset oracle library [autodetect]
355 --enable-macosx-finder enable Mac OS X Finder invocation parameter
356 parsing [disabled]
357 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
358 --disable-inet6 disable IPv6 support [autodetect]
359 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
360 --disable-ftp disable FTP support [enabled]
361 --disable-vstream disable TiVo vstream client support [autodetect]
362 --disable-pthreads disable Posix threads support [autodetect]
363 --disable-w32threads disable Win32 threads support [autodetect]
364 --disable-libass disable subtitle rendering with libass [autodetect]
365 --enable-rpath enable runtime linker path for extra libs [disabled]
366 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
368 Codecs:
369 --enable-gif enable GIF support [autodetect]
370 --enable-png enable PNG input/output support [autodetect]
371 --enable-mng enable MNG input support [autodetect]
372 --enable-jpeg enable JPEG input/output support [autodetect]
373 --enable-libcdio enable libcdio support [autodetect]
374 --disable-win32dll disable Win32 DLL support [autodetect]
375 --disable-qtx disable QuickTime codecs support [enabled]
376 --disable-xanim disable XAnim codecs support [enabled]
377 --disable-real disable RealPlayer codecs support [enabled]
378 --disable-xvid disable Xvid [autodetect]
379 --disable-libnut disable libnut [autodetect]
380 --enable-libav skip Libav autodetection [autodetect]
381 --disable-libvorbis disable libvorbis support [autodetect]
382 --disable-tremor disable Tremor [autodetect if no libvorbis]
383 --disable-speex disable Speex support [autodetect]
384 --enable-theora enable OggTheora libraries [autodetect]
385 --enable-faad enable FAAD2 (AAC) [autodetect]
386 --disable-ladspa disable LADSPA plugin support [autodetect]
387 --disable-libbs2b disable libbs2b audio filter support [autodetect]
388 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
389 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
390 --disable-mad disable libmad (MPEG audio) support [autodetect]
391 --enable-xmms enable XMMS input plugin support [disabled]
392 --enable-libdca enable libdca support [autodetect]
393 --disable-liba52 disable liba52 [autodetect]
394 --enable-musepack enable libmpcdec support (deprecated, libavcodec
395 Musepack decoder is preferred) [disabled]
397 Video output:
398 --enable-gl enable OpenGL video output [autodetect]
399 --enable-dga2 enable DGA 2 support [autodetect]
400 --enable-dga1 enable DGA 1 support [autodetect]
401 --enable-vesa enable VESA video output [autodetect]
402 --enable-svga enable SVGAlib video output [autodetect]
403 --enable-sdl enable SDL video output [autodetect]
404 --enable-aa enable AAlib video output [autodetect]
405 --enable-caca enable CACA video output [autodetect]
406 --enable-ggi enable GGI video output [autodetect]
407 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
408 --enable-direct3d enable Direct3D video output [autodetect]
409 --enable-directx enable DirectX video output [autodetect]
410 --enable-dxr3 enable DXR3/H+ video output [autodetect]
411 --enable-ivtv enable IVTV TV-Out video output [autodetect]
412 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
413 --enable-dvb enable DVB video output [autodetect]
414 --enable-mga enable mga_vid video output [autodetect]
415 --enable-xmga enable mga_vid X11 video output [autodetect]
416 --enable-xv enable Xv video output [autodetect]
417 --enable-vdpau enable VDPAU acceleration [autodetect]
418 --enable-vm enable XF86VidMode support [autodetect]
419 --enable-xinerama enable Xinerama support [autodetect]
420 --enable-x11 enable X11 video output [autodetect]
421 --enable-xshape enable XShape support [autodetect]
422 --disable-xss disable screensaver support via xss [autodetect]
423 --enable-fbdev enable FBDev video output [autodetect]
424 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
425 --enable-tdfxfb enable tdfxfb video output [disable]
426 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
427 --enable-wii enable Nintendo Wii/GameCube video output [disable]
428 --enable-directfb enable DirectFB video output [autodetect]
429 --enable-bl enable Blinkenlights video output [disable]
430 --enable-tdfxvid enable tdfx_vid video output [disable]
431 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
432 --disable-tga disable Targa video output [enable]
433 --disable-pnm disable PNM video output [enable]
434 --disable-md5sum disable md5sum video output [enable]
435 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
436 --disable-corevideo disable CoreVideo video output [autodetect]
437 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
438 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
440 Audio output:
441 --disable-alsa disable ALSA audio output [autodetect]
442 --disable-ossaudio disable OSS audio output [autodetect]
443 --disable-arts disable aRts audio output [autodetect]
444 --disable-esd disable esd audio output [autodetect]
445 --disable-rsound disable RSound audio output [autodetect]
446 --disable-pulse disable Pulseaudio audio output [autodetect]
447 --disable-jack disable JACK audio output [autodetect]
448 --enable-openal enable OpenAL audio output [disable]
449 --disable-nas disable NAS audio output [autodetect]
450 --disable-sgiaudio disable SGI audio output [autodetect]
451 --disable-sunaudio disable Sun audio output [autodetect]
452 --disable-win32waveout disable Windows waveout audio output [autodetect]
453 --disable-coreaudio disable CoreAudio audio output [autodetect]
454 --disable-select disable using select() on the audio device [enable]
456 Language options:
457 --enable-translation enable support for translated output [disable]
458 --charset=charset convert the console messages to this character set
459 --language-doc=lang language to use for the documentation [en]
460 --language-man=lang language to use for the man pages [en]
461 --language-msg=lang extra languages for program messages [all]
462 --language=lang default language to use [en]
463 Specific options override --language. You can pass a list of languages separated
464 by whitespace or commas instead of a single language. Nonexisting translations
465 will be dropped from each list. All translations available in the list will be
466 installed. The value "all" will activate all translations. The LINGUAS
467 environment variable is honored. In all cases the fallback is English.
468 The program always supports English-language output; additional message
469 languages are only installed if --enable-translation is also specified.
470 Available values for --language-doc are: all $doc_lang_all
471 Available values for --language-man are: all $man_lang_all
472 Available values for --language-msg are: all $msg_lang_all
474 Miscellaneous options:
475 --enable-runtime-cpudetection enable runtime CPU detection [disable]
476 --enable-cross-compile enable cross-compilation [disable]
477 --cc=COMPILER C compiler to build MPlayer [gcc]
478 --host-cc=COMPILER C compiler for tools needed while building [gcc]
479 --as=ASSEMBLER assembler to build MPlayer [as]
480 --nm=NM nm tool to build MPlayer [nm]
481 --yasm=YASM Yasm assembler to build MPlayer [yasm]
482 --ar=AR librarian to build MPlayer [ar]
483 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
484 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
485 --windres=WINDRES windres to build MPlayer [windres]
486 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
487 --enable-static build a statically linked binary
488 --with-install=PATH path to a custom install program
490 Advanced options:
491 --enable-mmx enable MMX [autodetect]
492 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
493 --enable-3dnow enable 3DNow! [autodetect]
494 --enable-3dnowext enable extended 3DNow! [autodetect]
495 --enable-sse enable SSE [autodetect]
496 --enable-sse2 enable SSE2 [autodetect]
497 --enable-ssse3 enable SSSE3 [autodetect]
498 --enable-shm enable shm [autodetect]
499 --enable-altivec enable AltiVec (PowerPC) [autodetect]
500 --enable-armv5te enable DSP extensions (ARM) [autodetect]
501 --enable-armv6 enable ARMv6 (ARM) [autodetect]
502 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
503 --enable-armvfp enable ARM VFP (ARM) [autodetect]
504 --enable-neon enable NEON (ARM) [autodetect]
505 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
506 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
507 --enable-big-endian force byte order to big-endian [autodetect]
508 --enable-debug[=1-3] compile-in debugging information [disable]
509 --enable-profile compile-in profiling information [disable]
510 --disable-sighandler disable sighandler for crashes [enable]
511 --enable-crash-debug enable automatic gdb attach on crash [disable]
513 Use these options if autodetection fails:
514 --extra-cflags=FLAGS extra CFLAGS
515 --extra-ldflags=FLAGS extra LDFLAGS
516 --extra-libs=FLAGS extra linker flags
517 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
519 --with-sdl-config=PATH path to sdl*-config
520 --with-dvdnav-config=PATH path to dvdnav-config
521 --with-dvdread-config=PATH path to dvdread-config
523 This configure script is NOT autoconf-based, even though its output is similar.
524 It will try to autodetect all configuration options. If you --enable an option
525 it will be forcefully turned on, skipping autodetection. This can break
526 compilation, so you need to know what you are doing.
528 exit 0
529 } #show_help()
531 # GOTCHA: the variables below defines the default behavior for autodetection
532 # and have - unless stated otherwise - at least 2 states : yes no
533 # If autodetection is available then the third state is: auto
534 _mmx=auto
535 _3dnow=auto
536 _3dnowext=auto
537 _mmxext=auto
538 _sse=auto
539 _sse2=auto
540 _ssse3=auto
541 _cmov=auto
542 _fast_cmov=auto
543 _fast_clz=auto
544 _armv5te=auto
545 _armv6=auto
546 _armv6t2=auto
547 _armvfp=auto
548 neon=auto
549 _iwmmxt=auto
550 _altivec=auto
551 _install=install
552 _pkg_config=auto
553 _ranlib=auto
554 _windres=auto
555 _cc=auto
556 _ar=auto
557 test "$CC" && _cc="$CC"
558 _as=auto
559 _nm=auto
560 _yasm=auto
561 _runtime_cpudetection=no
562 _cross_compile=no
563 _prefix="/usr/local"
564 ffmpeg=auto
565 ffmpeg_internals=no
566 _mplayer=yes
567 _x11=auto
568 _xshape=auto
569 _xss=auto
570 _dga1=auto
571 _dga2=auto
572 _xv=auto
573 _vdpau=auto
574 _sdl=auto
575 _direct3d=auto
576 _directx=auto
577 _win32waveout=auto
578 _nas=auto
579 _png=auto
580 _mng=auto
581 _jpeg=auto
582 _pnm=yes
583 _md5sum=yes
584 _yuv4mpeg=yes
585 _gif=auto
586 _gl=auto
587 _ggi=auto
588 _ggiwmh=auto
589 _aa=auto
590 _caca=auto
591 _svga=auto
592 _vesa=auto
593 _fbdev=auto
594 _dvb=auto
595 _dxr3=auto
596 _ivtv=auto
597 _v4l2=auto
598 _iconv=auto
599 _langinfo=auto
600 _rtc=auto
601 _ossaudio=auto
602 _arts=auto
603 _esd=auto
604 _rsound=auto
605 _pulse=auto
606 _jack=auto
607 _openal=no
608 _libcdio=auto
609 _mad=auto
610 _tremor=auto
611 _libvorbis=auto
612 _speex=auto
613 _theora=auto
614 _mpg123=auto
615 _liba52=auto
616 _libdca=auto
617 _faad=auto
618 _ladspa=auto
619 _libbs2b=auto
620 _xmms=no
621 _vcd=auto
622 _bluray=auto
623 _dvdnav=auto
624 _dvdnavconfig=dvdnav-config
625 _dvdreadconfig=dvdread-config
626 _dvdread=auto
627 _dvdread_internal=auto
628 _libdvdcss_internal=auto
629 _xanim=auto
630 _real=auto
631 _live=no
632 _nemesi=auto
633 _native_rtsp=yes
634 _xinerama=auto
635 _mga=auto
636 _xmga=auto
637 _vm=auto
638 _xf86keysym=auto
639 _sgiaudio=auto
640 _sunaudio=auto
641 _alsa=auto
642 _fastmemcpy=yes
643 _unrar_exec=auto
644 _win32dll=auto
645 _select=yes
646 _radio=no
647 _radio_capture=no
648 _radio_v4l=auto
649 _radio_v4l2=auto
650 _radio_bsdbt848=auto
651 _tv=yes
652 _tv_v4l1=auto
653 _tv_v4l2=auto
654 _tv_bsdbt848=auto
655 _tv_dshow=auto
656 _pvr=auto
657 networking=yes
658 _winsock2_h=auto
659 _smb=auto
660 _joystick=no
661 _xvid=auto
662 _libnut=auto
663 _lirc=auto
664 _lircc=auto
665 _apple_remote=auto
666 _apple_ir=auto
667 _termcap=auto
668 _termios=auto
669 _3dfx=no
670 _s3fb=no
671 _wii=no
672 _tdfxfb=no
673 _tdfxvid=no
674 _xvr100=auto
675 _tga=yes
676 _directfb=auto
677 _bl=no
678 #language=en
679 _shm=auto
680 _translation=no
681 _charset="UTF-8"
682 _crash_debug=no
683 _sighandler=yes
684 _libdv=auto
685 _cdparanoia=auto
686 _cddb=auto
687 _big_endian=auto
688 _bitmap_font=yes
689 _freetype=auto
690 _fontconfig=auto
691 _qtx=auto
692 _coreaudio=auto
693 _corevideo=auto
694 _cocoa=auto
695 _sharedbuffer=auto
696 quicktime=auto
697 _macosx_finder=no
698 _macosx_bundle=auto
699 _sortsub=yes
700 _fribidi=auto
701 _enca=auto
702 _inet6=auto
703 _gethostbyname2=auto
704 _ftp=auto
705 _musepack=no
706 _vstream=auto
707 _pthreads=auto
708 _w32threads=auto
709 _ass=auto
710 _rpath=no
711 libpostproc=auto
712 _asmalign_pot=auto
713 _stream_cache=yes
714 _priority=no
715 def_dos_paths="#define HAVE_DOS_PATHS 0"
716 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
717 def_priority="#undef CONFIG_PRIORITY"
718 def_pthread_cache="#undef PTHREAD_CACHE"
719 need_shmem=yes
720 for ac_option do
721 case "$ac_option" in
722 --help|-help|-h)
723 show_help
725 --prefix=*)
726 _prefix=$(echo $ac_option | cut -d '=' -f 2)
728 --bindir=*)
729 _bindir=$(echo $ac_option | cut -d '=' -f 2)
731 --datadir=*)
732 _datadir=$(echo $ac_option | cut -d '=' -f 2)
734 --mandir=*)
735 _mandir=$(echo $ac_option | cut -d '=' -f 2)
737 --confdir=*)
738 _confdir=$(echo $ac_option | cut -d '=' -f 2)
740 --libdir=*)
741 _libdir=$(echo $ac_option | cut -d '=' -f 2)
743 --codecsdir=*)
744 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
746 --localedir=*)
747 _localedir=$(echo $ac_option | cut -d '=' -f 2)
750 --with-install=*)
751 _install=$(echo $ac_option | cut -d '=' -f 2 )
754 --with-sdl-config=*)
755 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
757 --with-dvdnav-config=*)
758 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
760 --with-dvdread-config=*)
761 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
764 --extra-cflags=*)
765 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
767 --extra-ldflags=*)
768 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
770 --extra-libs=*)
771 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
773 --extra-libs-mplayer=*)
774 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
777 --target=*)
778 _target=$(echo $ac_option | cut -d '=' -f 2)
780 --cc=*)
781 _cc=$(echo $ac_option | cut -d '=' -f 2)
783 --host-cc=*)
784 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
786 --as=*)
787 _as=$(echo $ac_option | cut -d '=' -f 2)
789 --nm=*)
790 _nm=$(echo $ac_option | cut -d '=' -f 2)
792 --yasm=*)
793 _yasm=$(echo $ac_option | cut -d '=' -f 2)
795 --ar=*)
796 _ar=$(echo $ac_option | cut -d '=' -f 2)
798 --pkg-config=*)
799 _pkg_config=$(echo $ac_option | cut -d '=' -f 2)
801 --ranlib=*)
802 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
804 --windres=*)
805 _windres=$(echo $ac_option | cut -d '=' -f 2)
807 --charset=*)
808 _charset=$(echo $ac_option | cut -d '=' -f 2)
810 --language-doc=*)
811 language_doc=$(echo $ac_option | cut -d '=' -f 2)
813 --language-man=*)
814 language_man=$(echo $ac_option | cut -d '=' -f 2)
816 --language-msg=*)
817 language_msg=$(echo $ac_option | cut -d '=' -f 2)
819 --language=*)
820 language=$(echo $ac_option | cut -d '=' -f 2)
823 --enable-static)
824 _ld_static='-static'
826 --disable-static)
827 _ld_static=''
829 --enable-profile)
830 _profile='-p'
832 --disable-profile)
833 _profile=
835 --enable-debug)
836 _debug='-g'
838 --enable-debug=*)
839 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
841 --disable-debug)
842 _debug=
844 --enable-translation) _translation=yes ;;
845 --disable-translation) _translation=no ;;
846 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
847 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
848 --enable-cross-compile) _cross_compile=yes ;;
849 --disable-cross-compile) _cross_compile=no ;;
850 --enable-mplayer) _mplayer=yes ;;
851 --disable-mplayer) _mplayer=no ;;
852 --enable-x11) _x11=yes ;;
853 --disable-x11) _x11=no ;;
854 --enable-xshape) _xshape=yes ;;
855 --disable-xshape) _xshape=no ;;
856 --enable-xss) _xss=yes ;;
857 --disable-xss) _xss=no ;;
858 --enable-xv) _xv=yes ;;
859 --disable-xv) _xv=no ;;
860 --enable-vdpau) _vdpau=yes ;;
861 --disable-vdpau) _vdpau=no ;;
862 --enable-sdl) _sdl=yes ;;
863 --disable-sdl) _sdl=no ;;
864 --enable-direct3d) _direct3d=yes ;;
865 --disable-direct3d) _direct3d=no ;;
866 --enable-directx) _directx=yes ;;
867 --disable-directx) _directx=no ;;
868 --enable-win32waveout) _win32waveout=yes ;;
869 --disable-win32waveout) _win32waveout=no ;;
870 --enable-nas) _nas=yes ;;
871 --disable-nas) _nas=no ;;
872 --enable-png) _png=yes ;;
873 --disable-png) _png=no ;;
874 --enable-mng) _mng=yes ;;
875 --disable-mng) _mng=no ;;
876 --enable-jpeg) _jpeg=yes ;;
877 --disable-jpeg) _jpeg=no ;;
878 --enable-pnm) _pnm=yes ;;
879 --disable-pnm) _pnm=no ;;
880 --enable-md5sum) _md5sum=yes ;;
881 --disable-md5sum) _md5sum=no ;;
882 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
883 --disable-yuv4mpeg) _yuv4mpeg=no ;;
884 --enable-gif) _gif=yes ;;
885 --disable-gif) _gif=no ;;
886 --enable-gl) _gl=yes ;;
887 --disable-gl) _gl=no ;;
888 --enable-ggi) _ggi=yes ;;
889 --disable-ggi) _ggi=no ;;
890 --enable-ggiwmh) _ggiwmh=yes ;;
891 --disable-ggiwmh) _ggiwmh=no ;;
892 --enable-aa) _aa=yes ;;
893 --disable-aa) _aa=no ;;
894 --enable-caca) _caca=yes ;;
895 --disable-caca) _caca=no ;;
896 --enable-svga) _svga=yes ;;
897 --disable-svga) _svga=no ;;
898 --enable-vesa) _vesa=yes ;;
899 --disable-vesa) _vesa=no ;;
900 --enable-fbdev) _fbdev=yes ;;
901 --disable-fbdev) _fbdev=no ;;
902 --enable-dvb) _dvb=yes ;;
903 --disable-dvb) _dvb=no ;;
904 --enable-dxr3) _dxr3=yes ;;
905 --disable-dxr3) _dxr3=no ;;
906 --enable-ivtv) _ivtv=yes ;;
907 --disable-ivtv) _ivtv=no ;;
908 --enable-v4l2) _v4l2=yes ;;
909 --disable-v4l2) _v4l2=no ;;
910 --enable-iconv) _iconv=yes ;;
911 --disable-iconv) _iconv=no ;;
912 --enable-langinfo) _langinfo=yes ;;
913 --disable-langinfo) _langinfo=no ;;
914 --enable-rtc) _rtc=yes ;;
915 --disable-rtc) _rtc=no ;;
916 --enable-libdv) _libdv=yes ;;
917 --disable-libdv) _libdv=no ;;
918 --enable-ossaudio) _ossaudio=yes ;;
919 --disable-ossaudio) _ossaudio=no ;;
920 --enable-arts) _arts=yes ;;
921 --disable-arts) _arts=no ;;
922 --enable-esd) _esd=yes ;;
923 --disable-esd) _esd=no ;;
924 --enable-rsound) _rsound=yes ;;
925 --disable-rsound) _rsound=no ;;
926 --enable-pulse) _pulse=yes ;;
927 --disable-pulse) _pulse=no ;;
928 --enable-jack) _jack=yes ;;
929 --disable-jack) _jack=no ;;
930 --enable-openal) _openal=yes ;;
931 --disable-openal) _openal=no ;;
932 --enable-mad) _mad=yes ;;
933 --disable-mad) _mad=no ;;
934 --enable-libcdio) _libcdio=yes ;;
935 --disable-libcdio) _libcdio=no ;;
936 --enable-libvorbis) _libvorbis=yes ;;
937 --disable-libvorbis) _libvorbis=no ;;
938 --enable-speex) _speex=yes ;;
939 --disable-speex) _speex=no ;;
940 --enable-tremor) _tremor=yes ;;
941 --disable-tremor) _tremor=no ;;
942 --enable-theora) _theora=yes ;;
943 --disable-theora) _theora=no ;;
944 --enable-mpg123) _mpg123=yes ;;
945 --disable-mpg123) _mpg123=no ;;
946 --enable-liba52) _liba52=yes ;;
947 --disable-liba52) _liba52=no ;;
948 --enable-libdca) _libdca=yes ;;
949 --disable-libdca) _libdca=no ;;
950 --enable-musepack) _musepack=yes ;;
951 --disable-musepack) _musepack=no ;;
952 --enable-faad) _faad=yes ;;
953 --disable-faad) _faad=no ;;
954 --enable-ladspa) _ladspa=yes ;;
955 --disable-ladspa) _ladspa=no ;;
956 --enable-libbs2b) _libbs2b=yes ;;
957 --disable-libbs2b) _libbs2b=no ;;
958 --enable-xmms) _xmms=yes ;;
959 --disable-xmms) _xmms=no ;;
960 --enable-vcd) _vcd=yes ;;
961 --disable-vcd) _vcd=no ;;
962 --enable-bluray) _bluray=yes ;;
963 --disable-bluray) _bluray=no ;;
964 --enable-dvdread) _dvdread=yes ;;
965 --disable-dvdread) _dvdread=no ;;
966 --enable-dvdread-internal) _dvdread_internal=yes ;;
967 --disable-dvdread-internal) _dvdread_internal=no ;;
968 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
969 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
970 --enable-dvdnav) _dvdnav=yes ;;
971 --disable-dvdnav) _dvdnav=no ;;
972 --enable-xanim) _xanim=yes ;;
973 --disable-xanim) _xanim=no ;;
974 --enable-real) _real=yes ;;
975 --disable-real) _real=no ;;
976 --enable-live) _live=yes ;;
977 --disable-live) _live=no ;;
978 --enable-nemesi) _nemesi=yes ;;
979 --disable-nemesi) _nemesi=no ;;
980 --enable-xinerama) _xinerama=yes ;;
981 --disable-xinerama) _xinerama=no ;;
982 --enable-mga) _mga=yes ;;
983 --disable-mga) _mga=no ;;
984 --enable-xmga) _xmga=yes ;;
985 --disable-xmga) _xmga=no ;;
986 --enable-vm) _vm=yes ;;
987 --disable-vm) _vm=no ;;
988 --enable-xf86keysym) _xf86keysym=yes ;;
989 --disable-xf86keysym) _xf86keysym=no ;;
990 --enable-sunaudio) _sunaudio=yes ;;
991 --disable-sunaudio) _sunaudio=no ;;
992 --enable-sgiaudio) _sgiaudio=yes ;;
993 --disable-sgiaudio) _sgiaudio=no ;;
994 --enable-alsa) _alsa=yes ;;
995 --disable-alsa) _alsa=no ;;
996 --enable-tv) _tv=yes ;;
997 --disable-tv) _tv=no ;;
998 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
999 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1000 --enable-tv-v4l1) _tv_v4l1=yes ;;
1001 --disable-tv-v4l1) _tv_v4l1=no ;;
1002 --enable-tv-v4l2) _tv_v4l2=yes ;;
1003 --disable-tv-v4l2) _tv_v4l2=no ;;
1004 --enable-tv-dshow) _tv_dshow=yes ;;
1005 --disable-tv-dshow) _tv_dshow=no ;;
1006 --enable-radio) _radio=yes ;;
1007 --enable-radio-capture) _radio_capture=yes ;;
1008 --disable-radio-capture) _radio_capture=no ;;
1009 --disable-radio) _radio=no ;;
1010 --enable-radio-v4l) _radio_v4l=yes ;;
1011 --disable-radio-v4l) _radio_v4l=no ;;
1012 --enable-radio-v4l2) _radio_v4l2=yes ;;
1013 --disable-radio-v4l2) _radio_v4l2=no ;;
1014 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1015 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1016 --enable-pvr) _pvr=yes ;;
1017 --disable-pvr) _pvr=no ;;
1018 --enable-fastmemcpy) _fastmemcpy=yes ;;
1019 --disable-fastmemcpy) _fastmemcpy=no ;;
1020 --enable-networking) networking=yes ;;
1021 --disable-networking) networking=no ;;
1022 --enable-winsock2_h) _winsock2_h=yes ;;
1023 --disable-winsock2_h) _winsock2_h=no ;;
1024 --enable-smb) _smb=yes ;;
1025 --disable-smb) _smb=no ;;
1026 --enable-joystick) _joystick=yes ;;
1027 --disable-joystick) _joystick=no ;;
1028 --enable-xvid) _xvid=yes ;;
1029 --disable-xvid) _xvid=no ;;
1030 --enable-libnut) _libnut=yes ;;
1031 --disable-libnut) _libnut=no ;;
1032 --enable-libav) ffmpeg=yes ;;
1033 --ffmpeg-source-dir=*)
1034 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1036 --enable-lirc) _lirc=yes ;;
1037 --disable-lirc) _lirc=no ;;
1038 --enable-lircc) _lircc=yes ;;
1039 --disable-lircc) _lircc=no ;;
1040 --enable-apple-remote) _apple_remote=yes ;;
1041 --disable-apple-remote) _apple_remote=no ;;
1042 --enable-apple-ir) _apple_ir=yes ;;
1043 --disable-apple-ir) _apple_ir=no ;;
1044 --enable-termcap) _termcap=yes ;;
1045 --disable-termcap) _termcap=no ;;
1046 --enable-termios) _termios=yes ;;
1047 --disable-termios) _termios=no ;;
1048 --enable-3dfx) _3dfx=yes ;;
1049 --disable-3dfx) _3dfx=no ;;
1050 --enable-s3fb) _s3fb=yes ;;
1051 --disable-s3fb) _s3fb=no ;;
1052 --enable-wii) _wii=yes ;;
1053 --disable-wii) _wii=no ;;
1054 --enable-tdfxfb) _tdfxfb=yes ;;
1055 --disable-tdfxfb) _tdfxfb=no ;;
1056 --disable-tdfxvid) _tdfxvid=no ;;
1057 --enable-tdfxvid) _tdfxvid=yes ;;
1058 --disable-xvr100) _xvr100=no ;;
1059 --enable-xvr100) _xvr100=yes ;;
1060 --disable-tga) _tga=no ;;
1061 --enable-tga) _tga=yes ;;
1062 --enable-directfb) _directfb=yes ;;
1063 --disable-directfb) _directfb=no ;;
1064 --enable-bl) _bl=yes ;;
1065 --disable-bl) _bl=no ;;
1066 --enable-shm) _shm=yes ;;
1067 --disable-shm) _shm=no ;;
1068 --enable-select) _select=yes ;;
1069 --disable-select) _select=no ;;
1070 --enable-cdparanoia) _cdparanoia=yes ;;
1071 --disable-cdparanoia) _cdparanoia=no ;;
1072 --enable-cddb) _cddb=yes ;;
1073 --disable-cddb) _cddb=no ;;
1074 --enable-big-endian) _big_endian=yes ;;
1075 --disable-big-endian) _big_endian=no ;;
1076 --enable-bitmap-font) _bitmap_font=yes ;;
1077 --disable-bitmap-font) _bitmap_font=no ;;
1078 --enable-freetype) _freetype=yes ;;
1079 --disable-freetype) _freetype=no ;;
1080 --enable-fontconfig) _fontconfig=yes ;;
1081 --disable-fontconfig) _fontconfig=no ;;
1082 --enable-unrarexec) _unrar_exec=yes ;;
1083 --disable-unrarexec) _unrar_exec=no ;;
1084 --enable-ftp) _ftp=yes ;;
1085 --disable-ftp) _ftp=no ;;
1086 --enable-vstream) _vstream=yes ;;
1087 --disable-vstream) _vstream=no ;;
1088 --enable-pthreads) _pthreads=yes ;;
1089 --disable-pthreads) _pthreads=no ;;
1090 --enable-w32threads) _w32threads=yes ;;
1091 --disable-w32threads) _w32threads=no ;;
1092 --enable-libass) _ass=yes ;;
1093 --disable-libass) _ass=no ;;
1094 --enable-rpath) _rpath=yes ;;
1095 --disable-rpath) _rpath=no ;;
1096 --enable-libpostproc) libpostproc=yes ;;
1097 --disable-libpostproc) libpostproc=no ;;
1099 --enable-fribidi) _fribidi=yes ;;
1100 --disable-fribidi) _fribidi=no ;;
1102 --enable-enca) _enca=yes ;;
1103 --disable-enca) _enca=no ;;
1105 --enable-inet6) _inet6=yes ;;
1106 --disable-inet6) _inet6=no ;;
1108 --enable-gethostbyname2) _gethostbyname2=yes ;;
1109 --disable-gethostbyname2) _gethostbyname2=no ;;
1111 --enable-dga1) _dga1=yes ;;
1112 --disable-dga1) _dga1=no ;;
1113 --enable-dga2) _dga2=yes ;;
1114 --disable-dga2) _dga2=no ;;
1116 --enable-qtx) _qtx=yes ;;
1117 --disable-qtx) _qtx=no ;;
1119 --enable-coreaudio) _coreaudio=yes ;;
1120 --disable-coreaudio) _coreaudio=no ;;
1121 --enable-corevideo) _corevideo=yes ;;
1122 --disable-corevideo) _corevideo=no ;;
1123 --enable-cocoa) _cocoa=yes ;;
1124 --disable-cocoa) _cocoa=no ;;
1125 --enable-sharedbuffer) _sharedbuffer=yes ;;
1126 --disable-sharedbuffer) _sharedbuffer=no ;;
1127 --enable-macosx-finder) _macosx_finder=yes ;;
1128 --disable-macosx-finder) _macosx_finder=no ;;
1129 --enable-macosx-bundle) _macosx_bundle=yes ;;
1130 --disable-macosx-bundle) _macosx_bundle=no ;;
1132 --enable-sortsub) _sortsub=yes ;;
1133 --disable-sortsub) _sortsub=no ;;
1135 --enable-crash-debug) _crash_debug=yes ;;
1136 --disable-crash-debug) _crash_debug=no ;;
1137 --enable-sighandler) _sighandler=yes ;;
1138 --disable-sighandler) _sighandler=no ;;
1139 --enable-win32dll) _win32dll=yes ;;
1140 --disable-win32dll) _win32dll=no ;;
1142 --enable-sse) _sse=yes ;;
1143 --disable-sse) _sse=no ;;
1144 --enable-sse2) _sse2=yes ;;
1145 --disable-sse2) _sse2=no ;;
1146 --enable-ssse3) _ssse3=yes ;;
1147 --disable-ssse3) _ssse3=no ;;
1148 --enable-mmxext) _mmxext=yes ;;
1149 --disable-mmxext) _mmxext=no ;;
1150 --enable-3dnow) _3dnow=yes ;;
1151 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1152 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1153 --disable-3dnowext) _3dnowext=no ;;
1154 --enable-cmov) _cmov=yes ;;
1155 --disable-cmov) _cmov=no ;;
1156 --enable-fast-cmov) _fast_cmov=yes ;;
1157 --disable-fast-cmov) _fast_cmov=no ;;
1158 --enable-fast-clz) _fast_clz=yes ;;
1159 --disable-fast-clz) _fast_clz=no ;;
1160 --enable-altivec) _altivec=yes ;;
1161 --disable-altivec) _altivec=no ;;
1162 --enable-armv5te) _armv5te=yes ;;
1163 --disable-armv5te) _armv5te=no ;;
1164 --enable-armv6) _armv6=yes ;;
1165 --disable-armv6) _armv6=no ;;
1166 --enable-armv6t2) _armv6t2=yes ;;
1167 --disable-armv6t2) _armv6t2=no ;;
1168 --enable-armvfp) _armvfp=yes ;;
1169 --disable-armvfp) _armvfp=no ;;
1170 --enable-neon) neon=yes ;;
1171 --disable-neon) neon=no ;;
1172 --enable-iwmmxt) _iwmmxt=yes ;;
1173 --disable-iwmmxt) _iwmmxt=no ;;
1174 --enable-mmx) _mmx=yes ;;
1175 --disable-mmx) # 3Dnow! and MMX2 require MMX
1176 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1179 echo "Unknown parameter: $ac_option" >&2
1180 exit 1
1183 esac
1184 done
1186 # Atmos: moved this here, to be correct, if --prefix is specified
1187 test -z "$_bindir" && _bindir="$_prefix/bin"
1188 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1189 test -z "$_mandir" && _mandir="$_prefix/share/man"
1190 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1191 test -z "$_libdir" && _libdir="$_prefix/lib"
1192 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1194 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1195 test "$tmpdir" && break
1196 done
1198 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1199 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1201 TMPLOG="config.log"
1203 rm -f "$TMPLOG"
1204 echo Parameters configure was run with: > "$TMPLOG"
1205 if test -n "$CFLAGS" ; then
1206 echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1208 if test -n "$PKG_CONFIG_PATH" ; then
1209 echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1211 echo ./configure $configuration >> "$TMPLOG"
1212 echo >> "$TMPLOG"
1215 echocheck "cross compilation"
1216 echores $_cross_compile
1218 if test $_cross_compile = yes; then
1219 tmp_run() {
1220 return 0
1222 test "$_host_cc" || _host_cc=cc
1225 tool_prefix=""
1227 if test $_cross_compile = yes ; then
1228 # Usually cross-compiler prefixes match with the target triplet
1229 test -n "$_target" && tool_prefix="$_target"-
1232 test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib
1233 test "$_windres" = auto && _windres="$tool_prefix"windres
1234 test "$_ar" = auto && _ar="$tool_prefix"ar
1235 test "$_yasm" = auto && _yasm="$tool_prefix"yasm
1236 test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
1238 if test "$_cc" = auto ; then
1239 if test -n "$tool_prefix" ; then
1240 _cc="$tool_prefix"gcc
1241 else
1242 _cc=cc
1246 # Determine our OS name and CPU architecture
1247 if test -z "$_target" ; then
1248 # OS name
1249 system_name=$(uname -s 2>&1)
1250 case "$system_name" in
1251 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1253 Haiku)
1254 system_name=BeOS
1256 IRIX*)
1257 system_name=IRIX
1259 GNU/kFreeBSD)
1260 system_name=FreeBSD
1262 HP-UX*)
1263 system_name=HP-UX
1265 [cC][yY][gG][wW][iI][nN]*)
1266 system_name=CYGWIN
1268 MINGW32*)
1269 system_name=MINGW32
1271 OS/2*)
1272 system_name=OS/2
1275 system_name="$system_name-UNKNOWN"
1277 esac
1280 # host's CPU/instruction set
1281 host_arch=$(uname -p 2>&1)
1282 case "$host_arch" in
1283 i386|sparc|ppc|alpha|arm|mips|vax)
1285 powerpc) # Darwin returns 'powerpc'
1286 host_arch=ppc
1288 *) # uname -p on Linux returns 'unknown' for the processor type,
1289 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1291 # Maybe uname -m (machine hardware name) returns something we
1292 # recognize.
1294 # x86/x86pc is used by QNX
1295 case "$(uname -m 2>&1)" in
1296 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 ;;
1297 ia64) host_arch=ia64 ;;
1298 macppc|ppc) host_arch=ppc ;;
1299 ppc64) host_arch=ppc64 ;;
1300 alpha) host_arch=alpha ;;
1301 sparc) host_arch=sparc ;;
1302 sparc64) host_arch=sparc64 ;;
1303 parisc*|hppa*|9000*) host_arch=hppa ;;
1304 arm*|zaurus|cats) host_arch=arm ;;
1305 sh3|sh4|sh4a) host_arch=sh ;;
1306 s390) host_arch=s390 ;;
1307 s390x) host_arch=s390x ;;
1308 *mips*) host_arch=mips ;;
1309 vax) host_arch=vax ;;
1310 xtensa*) host_arch=xtensa ;;
1311 *) host_arch=UNKNOWN ;;
1312 esac
1314 esac
1315 else # if test -z "$_target"
1316 for i in 2 3; do
1317 system_name=$(echo $_target | cut -d '-' -f $i)
1318 case "$(echo $system_name | tr A-Z a-z)" in
1319 linux) system_name=Linux ;;
1320 freebsd) system_name=FreeBSD ;;
1321 gnu/kfreebsd) system_name=FreeBSD ;;
1322 netbsd) system_name=NetBSD ;;
1323 bsd/os) system_name=BSD/OS ;;
1324 openbsd) system_name=OpenBSD ;;
1325 dragonfly) system_name=DragonFly ;;
1326 sunos) system_name=SunOS ;;
1327 qnx) system_name=QNX ;;
1328 morphos) system_name=MorphOS ;;
1329 amigaos) system_name=AmigaOS ;;
1330 mingw32*) system_name=MINGW32 ;;
1331 *) continue ;;
1332 esac
1333 break
1334 done
1335 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1336 host_arch=$(echo $_target | cut -d '-' -f 1)
1337 if test $(echo $host_arch) != "x86_64" ; then
1338 host_arch=$(echo $host_arch | tr '_' '-')
1342 extra_cflags="-I. $extra_cflags"
1343 _timer=timer-linux.c
1344 _getch=getch2.c
1345 if freebsd ; then
1346 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1347 extra_cflags="$extra_cflags -I/usr/local/include"
1350 if netbsd || dragonfly ; then
1351 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1352 extra_cflags="$extra_cflags -I/usr/pkg/include"
1355 if darwin; then
1356 extra_cflags="-mdynamic-no-pic $extra_cflags"
1357 if test "$(basename $_cc)" != "clang" ; then
1358 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
1360 _timer=timer-darwin.c
1363 if aix ; then
1364 extra_ldflags="$extra_ldflags -lC"
1367 if irix ; then
1368 _ranlib='ar -r'
1369 elif linux ; then
1370 _ranlib='true'
1373 if win32 ; then
1374 _exesuf=".exe"
1375 extra_cflags="$extra_cflags -fno-common"
1376 # -lwinmm is always needed for osdep/timer-win2.c
1377 extra_ldflags="$extra_ldflags -lwinmm"
1378 _pe_executable=yes
1379 _timer=timer-win2.c
1380 _priority=yes
1381 def_dos_paths="#define HAVE_DOS_PATHS 1"
1382 def_priority="#define CONFIG_PRIORITY 1"
1385 if mingw32 ; then
1386 _getch=getch2-win.c
1387 need_shmem=no
1388 extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1391 if amigaos ; then
1392 _select=no
1393 _sighandler=no
1394 _stream_cache=no
1395 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1396 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1399 if qnx ; then
1400 extra_ldflags="$extra_ldflags -lph"
1403 TMPC="$mplayer_tmpdir/tmp.c"
1404 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1405 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1406 TMPH="$mplayer_tmpdir/tmp.h"
1407 TMPS="$mplayer_tmpdir/tmp.S"
1409 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1410 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1414 # Checking CC version...
1415 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1416 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1417 echocheck "$_cc version"
1418 cc_vendor=intel
1419 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1420 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1421 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1422 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1423 # TODO verify older icc/ecc compatibility
1424 case $cc_version in
1426 cc_version="v. ?.??, bad"
1427 cc_fail=yes
1429 10.1|11.0|11.1)
1430 cc_version="$cc_version, ok"
1433 cc_version="$cc_version, bad"
1434 cc_fail=yes
1436 esac
1437 echores "$cc_version"
1438 else
1439 for _cc in "$_cc" gcc cc ; do
1440 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1441 if test "$cc_name_tmp" = "gcc"; then
1442 cc_name=$cc_name_tmp
1443 echocheck "$_cc version"
1444 cc_vendor=gnu
1445 cc_version=$($_cc -dumpversion 2>&1)
1446 case $cc_version in
1447 2.96*)
1448 cc_fail=yes
1451 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1452 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1453 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1455 esac
1456 echores "$cc_version"
1457 break
1459 if $_cc -v 2>&1 | grep -q "clang"; then
1460 echocheck "$_cc version"
1461 cc_vendor=clang
1462 cc_version=$($_cc -dumpversion 2>&1)
1463 res_comment="experimental support only"
1464 echores "clang $cc_version"
1465 break
1467 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1468 if test "$cc_name_tmp" = "Sun C"; then
1469 echocheck "$_cc version"
1470 cc_vendor=sun
1471 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1472 res_comment="experimental support only"
1473 echores "Sun C $cc_version"
1474 break
1476 done
1477 fi # icc
1478 test "$cc_fail" = yes && die "unsupported compiler version"
1480 echocheck "working compiler"
1481 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1482 echo "yes"
1484 if test -z "$_target" && x86 ; then
1485 cat > $TMPC << EOF
1486 int main(void) {
1487 int test[(int)sizeof(char *)-7];
1488 return 0;
1491 cc_check && host_arch=x86_64 || host_arch=i386
1494 echocheck "host cc"
1495 test "$_host_cc" || _host_cc=$_cc
1496 echores $_host_cc
1498 echo "Detected operating system: $system_name"
1499 echo "Detected host architecture: $host_arch"
1501 # ---
1503 # now that we know what compiler should be used for compilation, try to find
1504 # out which assembler is used by the $_cc compiler
1505 if test "$_as" = auto ; then
1506 _as=$($_cc -print-prog-name=as)
1507 test -z "$_as" && _as=as
1510 if test "$_nm" = auto ; then
1511 _nm=$($_cc -print-prog-name=nm)
1512 test -z "$_nm" && _nm=nm
1515 # XXX: this should be ok..
1516 _cpuinfo="echo"
1518 if test "$_runtime_cpudetection" = no ; then
1520 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1521 # FIXME: Remove the cygwin check once AMD CPUs are supported
1522 if test -r /proc/cpuinfo && ! cygwin; then
1523 # Linux with /proc mounted, extract CPU information from it
1524 _cpuinfo="cat /proc/cpuinfo"
1525 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1526 # FreeBSD with Linux emulation /proc mounted,
1527 # extract CPU information from it
1528 # Don't use it on x86 though, it never reports 3Dnow
1529 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1530 elif darwin && ! x86 ; then
1531 # use hostinfo on Darwin
1532 _cpuinfo="hostinfo"
1533 elif aix; then
1534 # use 'lsattr' on AIX
1535 _cpuinfo="lsattr -E -l proc0 -a type"
1536 elif x86; then
1537 # all other OSes try to extract CPU information from a small helper
1538 # program cpuinfo instead
1539 $_cc -o cpuinfo$_exesuf cpuinfo.c
1540 _cpuinfo="./cpuinfo$_exesuf"
1543 if x86 ; then
1544 # gather more CPU information
1545 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1546 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1547 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1548 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1549 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1551 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1553 pparam=$(echo $exts | sed -e s/xmm/sse/ -e s/kni/sse/)
1554 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1555 pparam=$(echo $pparam | sed -e 's/sse/sse mmxext/')
1557 for ext in $pparam ; do
1558 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1559 done
1561 echocheck "CPU vendor"
1562 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1564 echocheck "CPU type"
1565 echores "$pname"
1568 fi # test "$_runtime_cpudetection" = no
1570 if x86 && test "$_runtime_cpudetection" = no ; then
1571 extcheck() {
1572 if test "$1" = kernel_check ; then
1573 echocheck "kernel support of $2"
1574 cat > $TMPC <<EOF
1575 #include <stdlib.h>
1576 #include <signal.h>
1577 static void catch(int sig) { exit(1); }
1578 int main(void) {
1579 signal(SIGILL, catch);
1580 __asm__ volatile ("$3":::"memory"); return 0;
1584 if cc_check && tmp_run ; then
1585 eval _$2=yes
1586 echores "yes"
1587 _optimizing="$_optimizing $2"
1588 return 0
1589 else
1590 eval _$2=no
1591 echores "failed"
1592 echo "It seems that your kernel does not correctly support $2."
1593 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1594 return 1
1597 return 0
1600 extcheck $_mmx "mmx" "emms"
1601 extcheck $_mmxext "mmxext" "sfence"
1602 extcheck $_3dnow "3dnow" "femms"
1603 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1604 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1605 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1606 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1607 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1609 if test "$_gcc3_ext" != ""; then
1610 # if we had to disable sse/sse2 because the active kernel does not
1611 # support this instruction set extension, we also have to tell
1612 # gcc3 to not generate sse/sse2 instructions for normal C code
1613 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1619 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1620 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1621 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1622 subarch_all='X86_32 X86_64 PPC64'
1623 case "$host_arch" in
1624 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1625 arch='x86'
1626 subarch='x86_32'
1627 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1628 iproc=486
1629 proc=i486
1632 if test "$_runtime_cpudetection" = no ; then
1633 case "$pvendor" in
1634 AuthenticAMD)
1635 case "$pfamily" in
1636 3) proc=i386 iproc=386 ;;
1637 4) proc=i486 iproc=486 ;;
1638 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1639 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1640 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1641 proc=k6-3
1642 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1643 proc=geode
1644 elif test "$pmodel" -ge 8; then
1645 proc=k6-2
1646 elif test "$pmodel" -ge 6; then
1647 proc=k6
1648 else
1649 proc=i586
1652 6) iproc=686
1653 # It's a bit difficult to determine the correct type of Family 6
1654 # AMD CPUs just from their signature. Instead, we check directly
1655 # whether it supports SSE.
1656 if test "$_sse" = yes; then
1657 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1658 proc=athlon-xp
1659 else
1660 # Again, gcc treats athlon and athlon-tbird similarly.
1661 proc=athlon
1664 15) iproc=686
1665 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1666 # caught and remedied in the optimization tests below.
1667 proc=k8
1670 *) proc=amdfam10 iproc=686
1671 test $_fast_clz = "auto" && _fast_clz=yes
1673 esac
1675 GenuineIntel)
1676 case "$pfamily" in
1677 3) proc=i386 iproc=386 ;;
1678 4) proc=i486 iproc=486 ;;
1679 5) iproc=586
1680 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1681 proc=pentium-mmx # 4 is desktop, 8 is mobile
1682 else
1683 proc=i586
1686 6) iproc=686
1687 if test "$pmodel" -ge 15; then
1688 proc=core2
1689 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1690 proc=pentium-m
1691 elif test "$pmodel" -ge 7; then
1692 proc=pentium3
1693 elif test "$pmodel" -ge 3; then
1694 proc=pentium2
1695 else
1696 proc=i686
1698 test $_fast_clz = "auto" && _fast_clz=yes
1700 15) iproc=686
1701 # A nocona in 32-bit mode has no more capabilities than a prescott.
1702 if test "$pmodel" -ge 3; then
1703 proc=prescott
1704 else
1705 proc=pentium4
1706 test $_fast_clz = "auto" && _fast_clz=yes
1708 test $_fast_cmov = "auto" && _fast_cmov=no
1710 *) proc=prescott iproc=686 ;;
1711 esac
1713 CentaurHauls)
1714 case "$pfamily" in
1715 5) iproc=586
1716 if test "$pmodel" -ge 8; then
1717 proc=winchip2
1718 elif test "$pmodel" -ge 4; then
1719 proc=winchip-c6
1720 else
1721 proc=i586
1724 6) iproc=686
1725 if test "$pmodel" -ge 9; then
1726 proc=c3-2
1727 else
1728 proc=c3
1729 iproc=586
1732 *) proc=i686 iproc=i686 ;;
1733 esac
1735 unknown)
1736 case "$pfamily" in
1737 3) proc=i386 iproc=386 ;;
1738 4) proc=i486 iproc=486 ;;
1739 *) proc=i586 iproc=586 ;;
1740 esac
1743 proc=i586 iproc=586 ;;
1744 esac
1745 test $_fast_clz = "auto" && _fast_clz=no
1746 fi # test "$_runtime_cpudetection" = no
1749 # check that gcc supports our CPU, if not, fall back to earlier ones
1750 # LGB: check -mcpu and -march swithing step by step with enabling
1751 # to fall back till 386.
1753 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1755 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1756 cpuopt=-mtune
1757 else
1758 cpuopt=-mcpu
1761 echocheck "GCC & CPU optimization abilities"
1762 if test "$_runtime_cpudetection" = no ; then
1763 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1764 cflag_check -march=native && proc=native
1766 if test "$proc" = "amdfam10"; then
1767 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1769 if test "$proc" = "k8"; then
1770 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1772 if test "$proc" = "athlon-xp"; then
1773 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1775 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1776 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1778 if test "$proc" = "k6" || test "$proc" = "c3"; then
1779 if ! cflag_check -march=$proc $cpuopt=$proc; then
1780 if cflag_check -march=i586 $cpuopt=i686; then
1781 proc=i586-i686
1782 else
1783 proc=i586
1787 if test "$proc" = "prescott" ; then
1788 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1790 if test "$proc" = "core2" ; then
1791 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1793 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
1794 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1796 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1797 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1799 if test "$proc" = "i586"; then
1800 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1802 if test "$proc" = "i486" ; then
1803 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1805 if test "$proc" = "i386" ; then
1806 cflag_check -march=$proc $cpuopt=$proc || proc=error
1808 if test "$proc" = "error" ; then
1809 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1810 _mcpu=""
1811 _march=""
1812 _optimizing=""
1813 elif test "$proc" = "i586-i686"; then
1814 _march="-march=i586"
1815 _mcpu="$cpuopt=i686"
1816 _optimizing="$proc"
1817 else
1818 _march="-march=$proc"
1819 _mcpu="$cpuopt=$proc"
1820 _optimizing="$proc"
1822 else # if test "$_runtime_cpudetection" = no
1823 _mcpu="$cpuopt=generic"
1824 # at least i486 required, for bswap instruction
1825 _march="-march=i486"
1826 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1827 cflag_check $_mcpu || _mcpu=""
1828 cflag_check $_march $_mcpu || _march=""
1831 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1832 ## autodetected mcpu/march parameters
1833 if test "$_target" ; then
1834 # TODO: it may be a good idea to check GCC and fall back in all cases
1835 if test "$host_arch" = "i586-i686"; then
1836 _march="-march=i586"
1837 _mcpu="$cpuopt=i686"
1838 else
1839 _march="-march=$host_arch"
1840 _mcpu="$cpuopt=$host_arch"
1843 proc="$host_arch"
1845 case "$proc" in
1846 i386) iproc=386 ;;
1847 i486) iproc=486 ;;
1848 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1849 i686|athlon*|pentium*) iproc=686 ;;
1850 *) iproc=586 ;;
1851 esac
1854 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1855 _fast_cmov="yes"
1856 else
1857 _fast_cmov="no"
1859 test $_fast_clz = "auto" && _fast_clz=yes
1861 echores "$proc"
1864 ia64)
1865 arch='ia64'
1866 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1867 iproc='ia64'
1870 x86_64|amd64)
1871 arch='x86'
1872 subarch='x86_64'
1873 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1874 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1875 iproc='x86_64'
1877 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1878 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1879 cpuopt=-mtune
1880 else
1881 cpuopt=-mcpu
1883 if test "$_runtime_cpudetection" = no ; then
1884 case "$pvendor" in
1885 AuthenticAMD)
1886 case "$pfamily" in
1887 15) proc=k8
1888 test $_fast_clz = "auto" && _fast_clz=no
1890 *) proc=amdfam10;;
1891 esac
1893 GenuineIntel)
1894 case "$pfamily" in
1895 6) proc=core2;;
1897 # 64-bit prescotts exist, but as far as GCC is concerned they
1898 # have the same capabilities as a nocona.
1899 proc=nocona
1900 test $_fast_cmov = "auto" && _fast_cmov=no
1901 test $_fast_clz = "auto" && _fast_clz=no
1903 esac
1906 proc=error;;
1907 esac
1908 fi # test "$_runtime_cpudetection" = no
1910 echocheck "GCC & CPU optimization abilities"
1911 # This is a stripped-down version of the i386 fallback.
1912 if test "$_runtime_cpudetection" = no ; then
1913 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1914 cflag_check -march=native && proc=native
1916 # --- AMD processors ---
1917 if test "$proc" = "amdfam10"; then
1918 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1920 if test "$proc" = "k8"; then
1921 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1923 # This will fail if gcc version < 3.3, which is ok because earlier
1924 # versions don't really support 64-bit on amd64.
1925 # Is this a valid assumption? -Corey
1926 if test "$proc" = "athlon-xp"; then
1927 cflag_check -march=$proc $cpuopt=$proc || proc=error
1929 # --- Intel processors ---
1930 if test "$proc" = "core2"; then
1931 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1933 if test "$proc" = "x86-64"; then
1934 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1936 if test "$proc" = "nocona"; then
1937 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1939 if test "$proc" = "pentium4"; then
1940 cflag_check -march=$proc $cpuopt=$proc || proc=error
1943 _march="-march=$proc"
1944 _mcpu="$cpuopt=$proc"
1945 if test "$proc" = "error" ; then
1946 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1947 _mcpu=""
1948 _march=""
1950 else # if test "$_runtime_cpudetection" = no
1951 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1952 _march="-march=x86-64"
1953 _mcpu="$cpuopt=generic"
1954 cflag_check $_mcpu || _mcpu="x86-64"
1955 cflag_check $_mcpu || _mcpu=""
1956 cflag_check $_march $_mcpu || _march=""
1959 _optimizing="$proc"
1960 test $_fast_cmov = "auto" && _fast_cmov=yes
1961 test $_fast_clz = "auto" && _fast_clz=yes
1963 echores "$proc"
1966 sparc|sparc64)
1967 arch='sparc'
1968 iproc='sparc'
1969 if test "$host_arch" = "sparc64" ; then
1970 _vis='yes'
1971 proc='ultrasparc'
1972 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1973 elif sunos ; then
1974 echocheck "CPU type"
1975 karch=$(uname -m)
1976 case "$(echo $karch)" in
1977 sun4) proc=v7 ;;
1978 sun4c) proc=v7 ;;
1979 sun4d) proc=v8 ;;
1980 sun4m) proc=v8 ;;
1981 sun4u) proc=ultrasparc _vis='yes' ;;
1982 sun4v) proc=v9 ;;
1983 *) proc=v8 ;;
1984 esac
1985 echores "$proc"
1986 else
1987 proc=v8
1989 _mcpu="-mcpu=$proc"
1990 _optimizing="$proc"
1993 arm*)
1994 arch='arm'
1995 iproc='arm'
1998 avr32)
1999 arch='avr32'
2000 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2001 iproc='avr32'
2002 test $_fast_clz = "auto" && _fast_clz=yes
2005 sh|sh4)
2006 arch='sh4'
2007 iproc='sh4'
2010 ppc|ppc64|powerpc|powerpc64)
2011 arch='ppc'
2012 def_dcbzl='#define HAVE_DCBZL 0'
2013 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2014 iproc='ppc'
2016 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2017 subarch='ppc64'
2018 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2020 echocheck "CPU type"
2021 case $system_name in
2022 Linux)
2023 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2024 if test -n "$($_cpuinfo | grep altivec)"; then
2025 test $_altivec = auto && _altivec=yes
2028 Darwin)
2029 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2030 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2031 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2032 test $_altivec = auto && _altivec=yes
2035 NetBSD)
2036 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2037 case $cc_version in
2038 2*|3.0*|3.1*|3.2*|3.3*)
2041 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2042 test $_altivec = auto && _altivec=yes
2045 esac
2047 AIX)
2048 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2050 esac
2051 if test "$_altivec" = yes; then
2052 echores "$proc altivec"
2053 else
2054 _altivec=no
2055 echores "$proc"
2058 echocheck "GCC & CPU optimization abilities"
2060 if test -n "$proc"; then
2061 case "$proc" in
2062 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2063 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2064 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2065 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2066 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2067 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2068 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2069 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2070 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2071 *) ;;
2072 esac
2073 # gcc 3.1(.1) and up supports 7400 and 7450
2074 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2075 case "$proc" in
2076 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2077 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2078 *) ;;
2079 esac
2081 # gcc 3.2 and up supports 970
2082 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2083 case "$proc" in
2084 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2085 def_dcbzl='#define HAVE_DCBZL 1' ;;
2086 *) ;;
2087 esac
2089 # gcc 3.3 and up supports POWER4
2090 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2091 case "$proc" in
2092 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2093 *) ;;
2094 esac
2096 # gcc 3.4 and up supports 440*
2097 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2098 case "$proc" in
2099 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2100 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2101 *) ;;
2102 esac
2104 # gcc 4.0 and up supports POWER5
2105 if test "$_cc_major" -ge "4"; then
2106 case "$proc" in
2107 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2108 *) ;;
2109 esac
2113 if test -n "$_mcpu"; then
2114 _optimizing=$(echo $_mcpu | cut -c 8-)
2115 echores "$_optimizing"
2116 else
2117 echores "none"
2120 test $_fast_clz = "auto" && _fast_clz=yes
2124 alpha*)
2125 arch='alpha'
2126 iproc='alpha'
2127 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2129 echocheck "CPU type"
2130 cat > $TMPC << EOF
2131 int main(void) {
2132 unsigned long ver, mask;
2133 __asm__ ("implver %0" : "=r" (ver));
2134 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2135 printf("%ld-%x\n", ver, ~mask);
2136 return 0;
2139 $_cc -o "$TMPEXE" "$TMPC"
2140 case $("$TMPEXE") in
2142 0-0) proc="ev4"; _mvi="0";;
2143 1-0) proc="ev5"; _mvi="0";;
2144 1-1) proc="ev56"; _mvi="0";;
2145 1-101) proc="pca56"; _mvi="1";;
2146 2-303) proc="ev6"; _mvi="1";;
2147 2-307) proc="ev67"; _mvi="1";;
2148 2-1307) proc="ev68"; _mvi="1";;
2149 esac
2150 echores "$proc"
2152 echocheck "GCC & CPU optimization abilities"
2153 if test "$proc" = "ev68" ; then
2154 cc_check -mcpu=$proc || proc=ev67
2156 if test "$proc" = "ev67" ; then
2157 cc_check -mcpu=$proc || proc=ev6
2159 _mcpu="-mcpu=$proc"
2160 echores "$proc"
2162 test $_fast_clz = "auto" && _fast_clz=yes
2164 _optimizing="$proc"
2167 mips*)
2168 arch='mips'
2169 iproc='mips'
2171 if irix ; then
2172 echocheck "CPU type"
2173 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2174 case "$(echo $proc)" in
2175 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2176 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2177 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2178 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2179 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2180 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2181 esac
2182 # gcc < 3.x does not support -mtune.
2183 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2184 _mcpu=''
2186 echores "$proc"
2189 test $_fast_clz = "auto" && _fast_clz=yes
2193 hppa)
2194 arch='pa_risc'
2195 iproc='PA-RISC'
2198 s390)
2199 arch='s390'
2200 iproc='390'
2203 s390x)
2204 arch='s390x'
2205 iproc='390x'
2208 vax)
2209 arch='vax'
2210 iproc='vax'
2213 xtensa)
2214 arch='xtensa'
2215 iproc='xtensa'
2218 generic)
2219 arch='generic'
2223 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2224 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2225 die "unsupported architecture $host_arch"
2227 esac # case "$host_arch" in
2229 if test "$_runtime_cpudetection" = yes ; then
2230 if x86 ; then
2231 test "$_cmov" != no && _cmov=yes
2232 x86_32 && _cmov=no
2233 test "$_mmx" != no && _mmx=yes
2234 test "$_3dnow" != no && _3dnow=yes
2235 test "$_3dnowext" != no && _3dnowext=yes
2236 test "$_mmxext" != no && _mmxext=yes
2237 test "$_sse" != no && _sse=yes
2238 test "$_sse2" != no && _sse2=yes
2239 test "$_ssse3" != no && _ssse3=yes
2241 if ppc; then
2242 _altivec=yes
2247 # endian testing
2248 echocheck "byte order"
2249 if test "$_big_endian" = auto ; then
2250 cat > $TMPC <<EOF
2251 short ascii_name[] = {
2252 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2253 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2254 int main(void) { return (long)ascii_name; }
2256 if cc_check ; then
2257 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2258 _big_endian=yes
2259 else
2260 _big_endian=no
2262 else
2263 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2266 if test "$_big_endian" = yes ; then
2267 _byte_order='big-endian'
2268 def_words_endian='#define WORDS_BIGENDIAN 1'
2269 def_bigendian='#define HAVE_BIGENDIAN 1'
2270 else
2271 _byte_order='little-endian'
2272 def_words_endian='#undef WORDS_BIGENDIAN'
2273 def_bigendian='#define HAVE_BIGENDIAN 0'
2275 echores "$_byte_order"
2278 echocheck "extern symbol prefix"
2279 cat > $TMPC << EOF
2280 int ff_extern;
2282 cc_check -c || die "Symbol mangling check failed."
2283 sym=$($_nm -P -g $TMPEXE)
2284 extern_prefix=${sym%%ff_extern*}
2285 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2286 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2287 echores $extern_prefix
2290 echocheck "assembler support of -pipe option"
2291 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2292 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2295 if darwin && test "$cc_vendor" = "gnu" ; then
2296 echocheck "GCC support of -mstackrealign"
2297 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2298 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2299 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2300 # wrong code with this flag, but this can be worked around by adding
2301 # -fno-unit-at-a-time as described in the blog post at
2302 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2303 cat > $TMPC << EOF
2304 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2305 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2307 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2308 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2309 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2310 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2311 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2314 # Checking for CFLAGS
2315 _install_strip="-s"
2316 if test "$_profile" != "" || test "$_debug" != "" ; then
2317 _install_strip=
2319 if test -z "$CFLAGS" ; then
2320 if test "$cc_vendor" = "intel" ; then
2321 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2322 WARNFLAGS="-wd167 -wd556 -wd144"
2323 elif test "$cc_vendor" = "sun" ; then
2324 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2325 elif test "$cc_vendor" = "clang"; then
2326 CFLAGS="-O2 $_debug $_profile $_march $_pipe"
2327 WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2328 ERRORFLAGS="-Werror=implicit-function-declaration"
2329 elif test "$cc_vendor" != "gnu" ; then
2330 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2331 else
2332 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2333 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2334 ERRORFLAGS="-Werror-implicit-function-declaration"
2335 extra_ldflags="$extra_ldflags -ffast-math"
2337 else
2338 warn_cflags=yes
2341 if test "$cc_vendor" = "gnu" ; then
2342 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2343 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2344 # that's the only variable specific to C now, and this option is not valid
2345 # for C++.
2346 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2347 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2348 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2349 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2350 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2351 else
2352 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2355 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2356 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2359 if test -n "$LDFLAGS" ; then
2360 extra_ldflags="$extra_ldflags $LDFLAGS"
2361 warn_cflags=yes
2362 elif test "$cc_vendor" = "intel" ; then
2363 extra_ldflags="$extra_ldflags -i-static"
2365 if test -n "$CPPFLAGS" ; then
2366 extra_cflags="$extra_cflags $CPPFLAGS"
2367 warn_cflags=yes
2372 if x86_32 ; then
2373 # Checking assembler (_as) compatibility...
2374 # Added workaround for older as that reads from stdin by default - atmos
2375 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2376 echocheck "assembler ($_as $as_version)"
2378 _pref_as_version='2.9.1'
2379 echo 'nop' > $TMPS
2380 if test "$_mmx" = yes ; then
2381 echo 'emms' >> $TMPS
2383 if test "$_3dnow" = yes ; then
2384 _pref_as_version='2.10.1'
2385 echo 'femms' >> $TMPS
2387 if test "$_3dnowext" = yes ; then
2388 _pref_as_version='2.10.1'
2389 echo 'pswapd %mm0, %mm0' >> $TMPS
2391 if test "$_mmxext" = yes ; then
2392 _pref_as_version='2.10.1'
2393 echo 'movntq %mm0, (%eax)' >> $TMPS
2395 if test "$_sse" = yes ; then
2396 _pref_as_version='2.10.1'
2397 echo 'xorps %xmm0, %xmm0' >> $TMPS
2399 #if test "$_sse2" = yes ; then
2400 # _pref_as_version='2.11'
2401 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2403 if test "$_cmov" = yes ; then
2404 _pref_as_version='2.10.1'
2405 echo 'cmovb %eax, %ebx' >> $TMPS
2407 if test "$_ssse3" = yes ; then
2408 _pref_as_version='2.16.92'
2409 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2411 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2413 if test "$as_verc_fail" != yes ; then
2414 echores "ok"
2415 else
2416 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2417 echores "failed"
2418 die "obsolete binutils version"
2421 fi #if x86_32
2424 echocheck "PIC"
2425 pic=no
2426 cat > $TMPC << EOF
2427 int main(void) {
2428 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2429 #error PIC not enabled
2430 #endif
2431 return 0;
2434 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2435 echores $pic
2438 if x86 ; then
2440 echocheck ".align is a power of two"
2441 if test "$_asmalign_pot" = auto ; then
2442 _asmalign_pot=no
2443 inline_asm_check '".align 3"' && _asmalign_pot=yes
2445 if test "$_asmalign_pot" = "yes" ; then
2446 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2447 else
2448 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2450 echores $_asmalign_pot
2453 echocheck "ebx availability"
2454 ebx_available=no
2455 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2456 cat > $TMPC << EOF
2457 int main(void) {
2458 int x;
2459 __asm__ volatile(
2460 "xor %0, %0"
2461 :"=b"(x)
2462 // just adding ebx to clobber list seems unreliable with some
2463 // compilers, e.g. Haiku's gcc 2.95
2465 // and the above check does not work for OSX 64 bit...
2466 __asm__ volatile("":::"%ebx");
2467 return 0;
2470 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2471 echores $ebx_available
2474 echocheck "yasm"
2475 if test -z "$YASMFLAGS" ; then
2476 if darwin ; then
2477 x86_64 && objformat="macho64" || objformat="macho"
2478 elif win32 ; then
2479 objformat="win32"
2480 else
2481 objformat="elf"
2483 # currently tested for Linux x86, x86_64
2484 YASMFLAGS="-f $objformat"
2485 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2486 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2487 case "$objformat" in
2488 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2489 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2490 esac
2491 else
2492 warn_cflags=yes
2495 echo "pabsw xmm0, xmm0" > $TMPS
2496 yasm_check || _yasm=""
2497 if test $_yasm ; then
2498 def_yasm='#define HAVE_YASM 1'
2499 have_yasm="yes"
2500 echores "$_yasm"
2501 else
2502 def_yasm='#define HAVE_YASM 0'
2503 have_yasm="no"
2504 echores "no"
2507 echocheck "bswap"
2508 def_bswap='#define HAVE_BSWAP 0'
2509 echo 'bswap %eax' > $TMPS
2510 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2511 echores "$bswap"
2512 fi #if x86
2515 #FIXME: This should happen before the check for CFLAGS..
2516 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2517 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2519 # check if AltiVec is supported by the compiler, and how to enable it
2520 echocheck "GCC AltiVec flags"
2521 if $(cflag_check -maltivec -mabi=altivec) ; then
2522 _altivec_gcc_flags="-maltivec -mabi=altivec"
2523 # check if <altivec.h> should be included
2524 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2525 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2526 inc_altivec_h='#include <altivec.h>'
2527 else
2528 if $(cflag_check -faltivec) ; then
2529 _altivec_gcc_flags="-faltivec"
2530 else
2531 _altivec=no
2532 _altivec_gcc_flags="none, AltiVec disabled"
2536 echores "$_altivec_gcc_flags"
2538 # check if the compiler supports braces for vector declarations
2539 cat > $TMPC << EOF
2540 $inc_altivec_h
2541 int main(void) { (vector int) {1}; return 0; }
2543 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2545 # Disable runtime cpudetection if we cannot generate AltiVec code or
2546 # AltiVec is disabled by the user.
2547 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2548 && _runtime_cpudetection=no
2550 # Show that we are optimizing for AltiVec (if enabled and supported).
2551 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2552 && _optimizing="$_optimizing altivec"
2554 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2555 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2558 if ppc ; then
2559 def_xform_asm='#define HAVE_XFORM_ASM 0'
2560 xform_asm=no
2561 echocheck "XFORM ASM support"
2562 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2563 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2564 echores "$xform_asm"
2567 if arm ; then
2568 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2569 if test $_armv5te = "auto" ; then
2570 _armv5te=no
2571 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2573 echores "$_armv5te"
2575 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2577 echocheck "ARMv6 (SIMD instructions)"
2578 if test $_armv6 = "auto" ; then
2579 _armv6=no
2580 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2582 echores "$_armv6"
2584 echocheck "ARMv6t2 (SIMD instructions)"
2585 if test $_armv6t2 = "auto" ; then
2586 _armv6t2=no
2587 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2589 echores "$_armv6t2"
2591 echocheck "ARM VFP"
2592 if test $_armvfp = "auto" ; then
2593 _armvfp=no
2594 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2596 echores "$_armvfp"
2598 echocheck "ARM NEON"
2599 if test $neon = "auto" ; then
2600 neon=no
2601 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2603 echores "$neon"
2605 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2606 if test $_iwmmxt = "auto" ; then
2607 _iwmmxt=no
2608 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2610 echores "$_iwmmxt"
2613 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2614 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2615 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2616 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2617 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2618 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2619 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2620 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2621 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2622 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2623 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2624 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2625 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2626 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2627 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2628 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2629 test "$neon" = yes && cpuexts="NEON $cpuexts"
2630 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2631 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2632 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2634 # Checking kernel version...
2635 if x86_32 && linux ; then
2636 _k_verc_problem=no
2637 kernel_version=$(uname -r 2>&1)
2638 echocheck "$system_name kernel version"
2639 case "$kernel_version" in
2640 '') kernel_version="?.??"; _k_verc_fail=yes;;
2641 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2642 _k_verc_problem=yes;;
2643 esac
2644 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2645 _k_verc_fail=yes
2647 if test "$_k_verc_fail" ; then
2648 echores "$kernel_version, fail"
2649 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2650 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2651 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2652 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2653 echo "2.2.x you must upgrade it to get SSE support!"
2654 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2655 else
2656 echores "$kernel_version, ok"
2660 ######################
2661 # MAIN TESTS GO HERE #
2662 ######################
2665 echocheck "-lposix"
2666 if cflag_check -lposix ; then
2667 extra_ldflags="$extra_ldflags -lposix"
2668 echores "yes"
2669 else
2670 echores "no"
2673 echocheck "-lm"
2674 if cflag_check -lm ; then
2675 _ld_lm="-lm"
2676 echores "yes"
2677 else
2678 _ld_lm=""
2679 echores "no"
2683 echocheck "langinfo"
2684 if test "$_langinfo" = auto ; then
2685 _langinfo=no
2686 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2688 if test "$_langinfo" = yes ; then
2689 def_langinfo='#define HAVE_LANGINFO 1'
2690 else
2691 def_langinfo='#undef HAVE_LANGINFO'
2693 echores "$_langinfo"
2696 echocheck "translation support"
2697 if test "$_translation" = yes; then
2698 def_translation="#define CONFIG_TRANSLATION 1"
2699 else
2700 def_translation="#undef CONFIG_TRANSLATION"
2702 echores "$_translation"
2704 echocheck "language"
2705 # Set preferred languages, "all" uses English as main language.
2706 test -z "$language" && language=$LINGUAS
2707 test -z "$language_doc" && language_doc=$language
2708 test -z "$language_man" && language_man=$language
2709 test -z "$language_msg" && language_msg=$language
2710 test -z "$language_msg" && language_msg="all"
2711 language_doc=$(echo $language_doc | tr , " ")
2712 language_man=$(echo $language_man | tr , " ")
2713 language_msg=$(echo $language_msg | tr , " ")
2715 test "$language_doc" = "all" && language_doc=$doc_lang_all
2716 test "$language_man" = "all" && language_man=$man_lang_all
2717 test "$language_msg" = "all" && language_msg=$msg_lang_all
2719 if test "$_translation" != yes ; then
2720 language_msg=""
2723 # Prune non-existing translations from language lists.
2724 # Set message translation to the first available language.
2725 # Fall back on English.
2726 for lang in $language_doc ; do
2727 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2728 done
2729 language_doc=$tmp_language_doc
2730 test -z "$language_doc" && language_doc=en
2732 for lang in $language_man ; do
2733 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2734 done
2735 language_man=$tmp_language_man
2736 test -z "$language_man" && language_man=en
2738 for lang in $language_msg ; do
2739 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2740 done
2741 language_msg=$tmp_language_msg
2743 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2746 echocheck "enable sighandler"
2747 if test "$_sighandler" = yes ; then
2748 def_sighandler='#define CONFIG_SIGHANDLER 1'
2749 else
2750 def_sighandler='#undef CONFIG_SIGHANDLER'
2752 echores "$_sighandler"
2754 echocheck "runtime cpudetection"
2755 if test "$_runtime_cpudetection" = yes ; then
2756 _optimizing="Runtime CPU-Detection enabled"
2757 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2758 else
2759 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2761 echores "$_runtime_cpudetection"
2764 echocheck "restrict keyword"
2765 for restrict_keyword in restrict __restrict __restrict__ ; do
2766 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2767 if cc_check; then
2768 def_restrict_keyword=$restrict_keyword
2769 break;
2771 done
2772 if [ -n "$def_restrict_keyword" ]; then
2773 echores "$def_restrict_keyword"
2774 else
2775 echores "none"
2777 # Avoid infinite recursion loop ("#define restrict restrict")
2778 if [ "$def_restrict_keyword" != "restrict" ]; then
2779 def_restrict_keyword="#define restrict $def_restrict_keyword"
2780 else
2781 def_restrict_keyword=""
2785 echocheck "__builtin_expect"
2786 # GCC branch prediction hint
2787 cat > $TMPC << EOF
2788 static int foo(int a) {
2789 a = __builtin_expect(a, 10);
2790 return a == 10 ? 0 : 1;
2792 int main(void) { return foo(10) && foo(0); }
2794 _builtin_expect=no
2795 cc_check && _builtin_expect=yes
2796 if test "$_builtin_expect" = yes ; then
2797 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2798 else
2799 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2801 echores "$_builtin_expect"
2804 echocheck "kstat"
2805 _kstat=no
2806 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2807 if test "$_kstat" = yes ; then
2808 def_kstat="#define HAVE_LIBKSTAT 1"
2809 extra_ldflags="$extra_ldflags -lkstat"
2810 else
2811 def_kstat="#undef HAVE_LIBKSTAT"
2813 echores "$_kstat"
2816 echocheck "posix4"
2817 # required for nanosleep on some systems
2818 _posix4=no
2819 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2820 if test "$_posix4" = yes ; then
2821 extra_ldflags="$extra_ldflags -lposix4"
2823 echores "$_posix4"
2825 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2826 echocheck $func
2827 eval _$func=no
2828 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2829 if eval test "x\$_$func" = "xyes"; then
2830 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2831 echores yes
2832 else
2833 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2834 echores no
2836 done
2839 echocheck "mkstemp"
2840 _mkstemp=no
2841 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2842 if test "$_mkstemp" = yes ; then
2843 def_mkstemp='#define HAVE_MKSTEMP 1'
2844 else
2845 def_mkstemp='#define HAVE_MKSTEMP 0'
2847 echores "$_mkstemp"
2850 echocheck "nanosleep"
2851 _nanosleep=no
2852 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2853 if test "$_nanosleep" = yes ; then
2854 def_nanosleep='#define HAVE_NANOSLEEP 1'
2855 else
2856 def_nanosleep='#undef HAVE_NANOSLEEP'
2858 echores "$_nanosleep"
2861 echocheck "socklib"
2862 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2863 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2864 cat > $TMPC << EOF
2865 #include <netdb.h>
2866 #include <sys/socket.h>
2867 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2869 _socklib=no
2870 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2871 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2872 done
2873 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2874 if test $_winsock2_h = auto ; then
2875 _winsock2_h=no
2876 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2878 test "$_ld_sock" && res_comment="using $_ld_sock"
2879 echores "$_socklib"
2882 if test $_winsock2_h = yes ; then
2883 _ld_sock="-lws2_32"
2884 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2885 else
2886 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2890 echocheck "arpa/inet.h"
2891 arpa_inet_h=no
2892 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2893 header_check arpa/inet.h && arpa_inet_h=yes &&
2894 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2895 echores "$arpa_inet_h"
2898 echocheck "inet_pton()"
2899 def_inet_pton='#define HAVE_INET_PTON 0'
2900 inet_pton=no
2901 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2902 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2903 done
2904 if test $inet_pton = yes ; then
2905 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2906 def_inet_pton='#define HAVE_INET_PTON 1'
2908 echores "$inet_pton"
2911 echocheck "inet_aton()"
2912 def_inet_aton='#define HAVE_INET_ATON 0'
2913 inet_aton=no
2914 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2915 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2916 done
2917 if test $inet_aton = yes ; then
2918 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2919 def_inet_aton='#define HAVE_INET_ATON 1'
2921 echores "$inet_aton"
2924 echocheck "socklen_t"
2925 _socklen_t=no
2926 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2927 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2928 done
2929 if test "$_socklen_t" = yes ; then
2930 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2931 else
2932 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2934 echores "$_socklen_t"
2937 echocheck "closesocket()"
2938 _closesocket=no
2939 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2940 if test "$_closesocket" = yes ; then
2941 def_closesocket='#define HAVE_CLOSESOCKET 1'
2942 else
2943 def_closesocket='#define HAVE_CLOSESOCKET 0'
2945 echores "$_closesocket"
2948 echocheck "networking"
2949 test $_winsock2_h = no && test $inet_pton = no &&
2950 test $inet_aton = no && networking=no
2951 if test "$networking" = yes ; then
2952 def_network='#define CONFIG_NETWORK 1'
2953 def_networking='#define CONFIG_NETWORKING 1'
2954 extra_ldflags="$extra_ldflags $_ld_sock"
2955 inputmodules="networking $inputmodules"
2956 else
2957 noinputmodules="networking $noinputmodules"
2958 def_network='#define CONFIG_NETWORK 0'
2959 def_networking='#undef CONFIG_NETWORKING'
2961 echores "$networking"
2964 echocheck "inet6"
2965 if test "$_inet6" = auto ; then
2966 cat > $TMPC << EOF
2967 #include <sys/types.h>
2968 #if !defined(_WIN32)
2969 #include <sys/socket.h>
2970 #include <netinet/in.h>
2971 #else
2972 #include <ws2tcpip.h>
2973 #endif
2974 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2976 _inet6=no
2977 if cc_check $_ld_sock ; then
2978 _inet6=yes
2981 if test "$_inet6" = yes ; then
2982 def_inet6='#define HAVE_AF_INET6 1'
2983 else
2984 def_inet6='#undef HAVE_AF_INET6'
2986 echores "$_inet6"
2989 echocheck "gethostbyname2"
2990 if test "$_gethostbyname2" = auto ; then
2991 cat > $TMPC << EOF
2992 #include <sys/types.h>
2993 #include <sys/socket.h>
2994 #include <netdb.h>
2995 int main(void) { gethostbyname2("", AF_INET); return 0; }
2997 _gethostbyname2=no
2998 if cc_check ; then
2999 _gethostbyname2=yes
3002 if test "$_gethostbyname2" = yes ; then
3003 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3004 else
3005 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3007 echores "$_gethostbyname2"
3010 echocheck "inttypes.h (required)"
3011 _inttypes=no
3012 header_check inttypes.h && _inttypes=yes
3013 echores "$_inttypes"
3015 if test "$_inttypes" = no ; then
3016 echocheck "sys/bitypes.h (inttypes.h predecessor)"
3017 header_check sys/bitypes.h && _inttypes=yes
3018 if test "$_inttypes" = yes ; then
3019 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."
3020 else
3021 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3026 echocheck "malloc.h"
3027 _malloc=no
3028 header_check malloc.h && _malloc=yes
3029 if test "$_malloc" = yes ; then
3030 def_malloc_h='#define HAVE_MALLOC_H 1'
3031 else
3032 def_malloc_h='#define HAVE_MALLOC_H 0'
3034 echores "$_malloc"
3037 echocheck "memalign()"
3038 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3039 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3040 _memalign=no
3041 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3042 if test "$_memalign" = yes ; then
3043 def_memalign='#define HAVE_MEMALIGN 1'
3044 else
3045 def_memalign='#define HAVE_MEMALIGN 0'
3046 def_map_memalign='#define memalign(a, b) malloc(b)'
3047 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3049 echores "$_memalign"
3052 echocheck "posix_memalign()"
3053 posix_memalign=no
3054 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3055 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
3056 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3057 echores "$posix_memalign"
3060 echocheck "alloca.h"
3061 _alloca=no
3062 statement_check alloca.h 'alloca(0)' && _alloca=yes
3063 if cc_check ; then
3064 def_alloca_h='#define HAVE_ALLOCA_H 1'
3065 else
3066 def_alloca_h='#undef HAVE_ALLOCA_H'
3068 echores "$_alloca"
3071 echocheck "fastmemcpy"
3072 if test "$_fastmemcpy" = yes ; then
3073 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3074 else
3075 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3077 echores "$_fastmemcpy"
3080 echocheck "mman.h"
3081 _mman=no
3082 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3083 if test "$_mman" = yes ; then
3084 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3085 else
3086 def_mman_h='#undef HAVE_SYS_MMAN_H'
3088 echores "$_mman"
3090 _mman_has_map_failed=no
3091 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
3092 if test "$_mman_has_map_failed" = yes ; then
3093 def_mman_has_map_failed=''
3094 else
3095 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3098 echocheck "dynamic loader"
3099 _dl=no
3100 for _ld_tmp in "" "-ldl"; do
3101 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3102 done
3103 if test "$_dl" = yes ; then
3104 def_dl='#define HAVE_LIBDL 1'
3105 else
3106 def_dl='#undef HAVE_LIBDL'
3108 echores "$_dl"
3111 def_threads='#define HAVE_THREADS 0'
3113 echocheck "pthread"
3114 if linux ; then
3115 THREAD_CFLAGS=-D_REENTRANT
3116 elif freebsd || netbsd || openbsd || bsdos ; then
3117 THREAD_CFLAGS=-D_THREAD_SAFE
3119 if test "$_pthreads" = auto ; then
3120 cat > $TMPC << EOF
3121 #include <pthread.h>
3122 static void *func(void *arg) { return arg; }
3123 int main(void) {
3124 pthread_t tid;
3125 #ifdef PTW32_STATIC_LIB
3126 pthread_win32_process_attach_np();
3127 pthread_win32_thread_attach_np();
3128 #endif
3129 return pthread_create (&tid, 0, func, 0) != 0;
3132 _pthreads=no
3133 if ! hpux ; then
3134 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3135 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3136 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3137 done
3138 if test "$_pthreads" = no && mingw32 ; then
3139 _ld_tmp="-lpthreadGC2 -lws2_32"
3140 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
3144 if test "$_pthreads" = yes ; then
3145 test $_ld_pthread && res_comment="using $_ld_pthread"
3146 def_pthreads='#define HAVE_PTHREADS 1'
3147 def_threads='#define HAVE_THREADS 1'
3148 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3149 else
3150 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3151 def_pthreads='#undef HAVE_PTHREADS'
3152 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3153 mingw32 || _win32dll=no
3155 echores "$_pthreads"
3157 if cygwin ; then
3158 if test "$_pthreads" = yes ; then
3159 def_pthread_cache="#define PTHREAD_CACHE 1"
3160 else
3161 _stream_cache=no
3162 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3166 echocheck "w32threads"
3167 if test "$_pthreads" = yes ; then
3168 res_comment="using pthread instead"
3169 _w32threads=no
3171 if test "$_w32threads" = auto ; then
3172 _w32threads=no
3173 mingw32 && _w32threads=yes
3175 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3176 echores "$_w32threads"
3178 echocheck "rpath"
3179 if test "$_rpath" = yes ; then
3180 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3181 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3182 done
3183 extra_ldflags=$tmp
3185 echores "$_rpath"
3187 echocheck "iconv"
3188 if test "$_iconv" = auto ; then
3189 cat > $TMPC << EOF
3190 #include <stdio.h>
3191 #include <unistd.h>
3192 #include <iconv.h>
3193 #define INBUFSIZE 1024
3194 #define OUTBUFSIZE 4096
3196 char inbuffer[INBUFSIZE];
3197 char outbuffer[OUTBUFSIZE];
3199 int main(void) {
3200 size_t numread;
3201 iconv_t icdsc;
3202 char *tocode="UTF-8";
3203 char *fromcode="cp1250";
3204 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3205 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3206 char *iptr=inbuffer;
3207 char *optr=outbuffer;
3208 size_t inleft=numread;
3209 size_t outleft=OUTBUFSIZE;
3210 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3211 != (size_t)(-1)) {
3212 write(1, outbuffer, OUTBUFSIZE - outleft);
3215 if (iconv_close(icdsc) == -1)
3218 return 0;
3221 _iconv=no
3222 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3223 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3224 _iconv=yes && break
3225 done
3226 if test "$_iconv" != yes ; then
3227 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."
3230 if test "$_iconv" = yes ; then
3231 def_iconv='#define CONFIG_ICONV 1'
3232 else
3233 def_iconv='#undef CONFIG_ICONV'
3235 echores "$_iconv"
3238 echocheck "soundcard.h"
3239 _soundcard_h=no
3240 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3241 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3242 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3243 header_check $_soundcard_header && _soundcard_h=yes &&
3244 res_comment="$_soundcard_header" && break
3245 done
3247 if test "$_soundcard_h" = yes ; then
3248 if test $_soundcard_header = "sys/soundcard.h"; then
3249 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3250 else
3251 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3254 echores "$_soundcard_h"
3257 echocheck "sys/videoio.h"
3258 sys_videoio_h=no
3259 def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
3260 header_check sys/videoio.h && sys_videoio_h=yes &&
3261 def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
3262 echores "$sys_videoio_h"
3265 echocheck "sys/dvdio.h"
3266 _dvdio=no
3267 # FreeBSD 8.1 has broken dvdio.h
3268 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3269 if test "$_dvdio" = yes ; then
3270 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3271 else
3272 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3274 echores "$_dvdio"
3277 echocheck "sys/cdio.h"
3278 _cdio=no
3279 # at least OpenSolaris has a broken cdio.h
3280 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3281 if test "$_cdio" = yes ; then
3282 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3283 else
3284 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3286 echores "$_cdio"
3289 echocheck "linux/cdrom.h"
3290 _cdrom=no
3291 header_check linux/cdrom.h && _cdrom=yes
3292 if test "$_cdrom" = yes ; then
3293 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3294 else
3295 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3297 echores "$_cdrom"
3300 echocheck "dvd.h"
3301 _dvd=no
3302 header_check dvd.h && _dvd=yes
3303 if test "$_dvd" = yes ; then
3304 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3305 else
3306 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3308 echores "$_dvd"
3311 if bsdos; then
3312 echocheck "BSDI dvd.h"
3313 _bsdi_dvd=no
3314 header_check dvd.h && _bsdi_dvd=yes
3315 if test "$_bsdi_dvd" = yes ; then
3316 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3317 else
3318 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3320 echores "$_bsdi_dvd"
3321 fi #if bsdos
3324 if hpux; then
3325 # also used by AIX, but AIX does not support VCD and/or libdvdread
3326 echocheck "HP-UX SCSI header"
3327 _hpux_scsi_h=no
3328 header_check sys/scsi.h && _hpux_scsi_h=yes
3329 if test "$_hpux_scsi_h" = yes ; then
3330 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3331 else
3332 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3334 echores "$_hpux_scsi_h"
3335 fi #if hpux
3338 if sunos; then
3339 echocheck "userspace SCSI headers (Solaris)"
3340 _sol_scsi_h=no
3341 header_check sys/scsi/scsi_types.h &&
3342 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3343 _sol_scsi_h=yes
3344 if test "$_sol_scsi_h" = yes ; then
3345 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3346 else
3347 def_sol_scsi_h='#undef SOLARIS_USCSI'
3349 echores "$_sol_scsi_h"
3350 fi #if sunos
3353 echocheck "termcap"
3354 if test "$_termcap" = auto ; then
3355 _termcap=no
3356 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3357 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3358 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3359 done
3361 if test "$_termcap" = yes ; then
3362 def_termcap='#define HAVE_TERMCAP 1'
3363 test $_ld_tmp && res_comment="using $_ld_tmp"
3364 else
3365 def_termcap='#undef HAVE_TERMCAP'
3367 echores "$_termcap"
3370 echocheck "termios"
3371 def_termios='#undef HAVE_TERMIOS'
3372 def_termios_h='#undef HAVE_TERMIOS_H'
3373 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3374 if test "$_termios" = auto ; then
3375 _termios=no
3376 for _termios_header in "termios.h" "sys/termios.h"; do
3377 header_check $_termios_header && _termios=yes &&
3378 res_comment="using $_termios_header" && break
3379 done
3382 if test "$_termios" = yes ; then
3383 def_termios='#define HAVE_TERMIOS 1'
3384 if test "$_termios_header" = "termios.h" ; then
3385 def_termios_h='#define HAVE_TERMIOS_H 1'
3386 else
3387 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3390 echores "$_termios"
3393 echocheck "shm"
3394 if test "$_shm" = auto ; then
3395 _shm=no
3396 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3398 if test "$_shm" = yes ; then
3399 def_shm='#define HAVE_SHM 1'
3400 else
3401 def_shm='#undef HAVE_SHM'
3403 echores "$_shm"
3406 echocheck "strsep()"
3407 _strsep=no
3408 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3409 if test "$_strsep" = yes ; then
3410 def_strsep='#define HAVE_STRSEP 1'
3411 need_strsep=no
3412 else
3413 def_strsep='#undef HAVE_STRSEP'
3414 need_strsep=yes
3416 echores "$_strsep"
3419 echocheck "vsscanf()"
3420 cat > $TMPC << EOF
3421 #define _ISOC99_SOURCE
3422 #include <stdarg.h>
3423 #include <stdio.h>
3424 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3426 _vsscanf=no
3427 cc_check && _vsscanf=yes
3428 if test "$_vsscanf" = yes ; then
3429 def_vsscanf='#define HAVE_VSSCANF 1'
3430 need_vsscanf=no
3431 else
3432 def_vsscanf='#undef HAVE_VSSCANF'
3433 need_vsscanf=yes
3435 echores "$_vsscanf"
3438 echocheck "swab()"
3439 _swab=no
3440 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3441 statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3442 if test "$_swab" = yes ; then
3443 def_swab='#define HAVE_SWAB 1'
3444 need_swab=no
3445 else
3446 def_swab='#undef HAVE_SWAB'
3447 need_swab=yes
3449 echores "$_swab"
3451 echocheck "POSIX select()"
3452 cat > $TMPC << EOF
3453 #include <stdio.h>
3454 #include <stdlib.h>
3455 #include <sys/types.h>
3456 #include <string.h>
3457 #include <sys/time.h>
3458 #include <unistd.h>
3459 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3461 _posix_select=no
3462 def_posix_select='#undef HAVE_POSIX_SELECT'
3463 cc_check && _posix_select=yes &&
3464 def_posix_select='#define HAVE_POSIX_SELECT 1'
3465 echores "$_posix_select"
3468 echocheck "audio select()"
3469 if test "$_select" = no ; then
3470 def_select='#undef HAVE_AUDIO_SELECT'
3471 elif test "$_select" = yes ; then
3472 def_select='#define HAVE_AUDIO_SELECT 1'
3474 echores "$_select"
3477 echocheck "gettimeofday()"
3478 _gettimeofday=no
3479 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3480 if test "$_gettimeofday" = yes ; then
3481 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3482 need_gettimeofday=no
3483 else
3484 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3485 need_gettimeofday=yes
3487 echores "$_gettimeofday"
3490 echocheck "glob()"
3491 _glob=no
3492 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3493 need_glob=no
3494 if test "$_glob" = yes ; then
3495 def_glob='#define HAVE_GLOB 1'
3496 else
3497 def_glob='#undef HAVE_GLOB'
3498 # HACK! need_glob currently enables compilation of a
3499 # win32-specific glob()-replacement.
3500 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3501 win32 && need_glob=yes
3503 echores "$_glob"
3506 echocheck "setenv()"
3507 _setenv=no
3508 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3509 if test "$_setenv" = yes ; then
3510 def_setenv='#define HAVE_SETENV 1'
3511 need_setenv=no
3512 else
3513 def_setenv='#undef HAVE_SETENV'
3514 need_setenv=yes
3516 echores "$_setenv"
3519 echocheck "setmode()"
3520 _setmode=no
3521 def_setmode='#define HAVE_SETMODE 0'
3522 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3523 echores "$_setmode"
3526 if sunos; then
3527 echocheck "sysi86()"
3528 _sysi86=no
3529 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3530 if test "$_sysi86" = yes ; then
3531 def_sysi86='#define HAVE_SYSI86 1'
3532 statement_check sys/sysi86.h 'int sysi86(int, void*); sysi86(0)' && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3533 else
3534 def_sysi86='#undef HAVE_SYSI86'
3536 echores "$_sysi86"
3537 fi #if sunos
3540 echocheck "sys/sysinfo.h"
3541 _sys_sysinfo=no
3542 statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
3543 if test "$_sys_sysinfo" = yes ; then
3544 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3545 else
3546 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3548 echores "$_sys_sysinfo"
3551 if darwin; then
3553 echocheck "Mac OS X Finder Support"
3554 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3555 if test "$_macosx_finder" = yes ; then
3556 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3557 extra_ldflags="$extra_ldflags -framework Cocoa"
3559 echores "$_macosx_finder"
3561 echocheck "Mac OS X Bundle file locations"
3562 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3563 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3564 if test "$_macosx_bundle" = yes ; then
3565 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3567 echores "$_macosx_bundle"
3569 echocheck "Apple Remote"
3570 if test "$_apple_remote" = auto ; then
3571 _apple_remote=no
3572 cat > $TMPC <<EOF
3573 #include <stdio.h>
3574 #include <IOKit/IOCFPlugIn.h>
3575 int main(void) {
3576 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3577 CFMutableDictionaryRef hidMatchDictionary;
3578 IOReturn ioReturnValue;
3580 // Set up a matching dictionary to search the I/O Registry by class.
3581 // name for all HID class devices
3582 hidMatchDictionary = IOServiceMatching("AppleIRController");
3584 // Now search I/O Registry for matching devices.
3585 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3586 hidMatchDictionary, &hidObjectIterator);
3588 // If search is unsuccessful, return nonzero.
3589 if (ioReturnValue != kIOReturnSuccess ||
3590 !IOIteratorIsValid(hidObjectIterator)) {
3591 return 1;
3593 return 0;
3596 cc_check -framework IOKit && _apple_remote=yes
3598 if test "$_apple_remote" = yes ; then
3599 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3600 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3601 else
3602 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3604 echores "$_apple_remote"
3606 fi #if darwin
3608 if linux; then
3610 echocheck "Apple IR"
3611 if test "$_apple_ir" = auto ; then
3612 _apple_ir=no
3613 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3615 if test "$_apple_ir" = yes ; then
3616 def_apple_ir='#define CONFIG_APPLE_IR 1'
3617 else
3618 def_apple_ir='#undef CONFIG_APPLE_IR'
3620 echores "$_apple_ir"
3621 fi #if linux
3623 echocheck "pkg-config"
3624 if $($_pkg_config --version > /dev/null 2>&1); then
3625 if test "$_ld_static"; then
3626 _pkg_config="$_pkg_config --static"
3628 echores "yes"
3629 else
3630 _pkg_config=false
3631 echores "no"
3635 echocheck "Samba support (libsmbclient)"
3636 if test "$_smb" = yes; then
3637 extra_ldflags="$extra_ldflags -lsmbclient"
3639 if test "$_smb" = auto; then
3640 _smb=no
3641 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3642 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3643 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3644 done
3647 if test "$_smb" = yes; then
3648 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3649 inputmodules="smb $inputmodules"
3650 else
3651 def_smb="#undef CONFIG_LIBSMBCLIENT"
3652 noinputmodules="smb $noinputmodules"
3654 echores "$_smb"
3657 #########
3658 # VIDEO #
3659 #########
3662 echocheck "tdfxfb"
3663 if test "$_tdfxfb" = yes ; then
3664 def_tdfxfb='#define CONFIG_TDFXFB 1'
3665 vomodules="tdfxfb $vomodules"
3666 else
3667 def_tdfxfb='#undef CONFIG_TDFXFB'
3668 novomodules="tdfxfb $novomodules"
3670 echores "$_tdfxfb"
3672 echocheck "s3fb"
3673 if test "$_s3fb" = yes ; then
3674 def_s3fb='#define CONFIG_S3FB 1'
3675 vomodules="s3fb $vomodules"
3676 else
3677 def_s3fb='#undef CONFIG_S3FB'
3678 novomodules="s3fb $novomodules"
3680 echores "$_s3fb"
3682 echocheck "wii"
3683 if test "$_wii" = yes ; then
3684 def_wii='#define CONFIG_WII 1'
3685 vomodules="wii $vomodules"
3686 else
3687 def_wii='#undef CONFIG_WII'
3688 novomodules="wii $novomodules"
3690 echores "$_wii"
3692 echocheck "tdfxvid"
3693 if test "$_tdfxvid" = yes ; then
3694 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3695 vomodules="tdfx_vid $vomodules"
3696 else
3697 def_tdfxvid='#undef CONFIG_TDFX_VID'
3698 novomodules="tdfx_vid $novomodules"
3700 echores "$_tdfxvid"
3702 echocheck "xvr100"
3703 if test "$_xvr100" = auto ; then
3704 cat > $TMPC << EOF
3705 #include <unistd.h>
3706 #include <sys/fbio.h>
3707 #include <sys/visual_io.h>
3708 int main(void) {
3709 struct vis_identifier ident;
3710 struct fbgattr attr;
3711 ioctl(0, VIS_GETIDENTIFIER, &ident);
3712 ioctl(0, FBIOGATTR, &attr);
3713 return 0;
3716 _xvr100=no
3717 cc_check && _xvr100=yes
3719 if test "$_xvr100" = yes ; then
3720 def_xvr100='#define CONFIG_XVR100 1'
3721 vomodules="xvr100 $vomodules"
3722 else
3723 def_tdfxvid='#undef CONFIG_XVR100'
3724 novomodules="xvr100 $novomodules"
3726 echores "$_xvr100"
3728 echocheck "tga"
3729 if test "$_tga" = yes ; then
3730 def_tga='#define CONFIG_TGA 1'
3731 vomodules="tga $vomodules"
3732 else
3733 def_tga='#undef CONFIG_TGA'
3734 novomodules="tga $novomodules"
3736 echores "$_tga"
3739 echocheck "md5sum support"
3740 if test "$_md5sum" = yes; then
3741 def_md5sum="#define CONFIG_MD5SUM 1"
3742 vomodules="md5sum $vomodules"
3743 else
3744 def_md5sum="#undef CONFIG_MD5SUM"
3745 novomodules="md5sum $novomodules"
3747 echores "$_md5sum"
3750 echocheck "yuv4mpeg support"
3751 if test "$_yuv4mpeg" = yes; then
3752 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3753 vomodules="yuv4mpeg $vomodules"
3754 else
3755 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3756 novomodules="yuv4mpeg $novomodules"
3758 echores "$_yuv4mpeg"
3761 echocheck "bl"
3762 if test "$_bl" = yes ; then
3763 def_bl='#define CONFIG_BL 1'
3764 vomodules="bl $vomodules"
3765 else
3766 def_bl='#undef CONFIG_BL'
3767 novomodules="bl $novomodules"
3769 echores "$_bl"
3772 echocheck "DirectFB"
3773 if test "$_directfb" = auto ; then
3774 _directfb=no
3775 cat > $TMPC << EOF
3776 #include <directfb.h>
3777 #include <directfb_version.h>
3778 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3779 #error "DirectFB version too old."
3780 #endif
3781 int main(void) { DirectFBInit(0, 0); return 0; }
3783 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3784 cc_check $_inc_tmp -ldirectfb &&
3785 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3786 done
3788 if test "$_directfb" = yes ; then
3789 def_directfb='#define CONFIG_DIRECTFB 1'
3790 vomodules="directfb dfbmga $vomodules"
3791 libs_mplayer="$libs_mplayer -ldirectfb"
3792 else
3793 def_directfb='#undef CONFIG_DIRECTFB'
3794 novomodules="directfb dfbmga $novomodules"
3796 echores "$_directfb"
3799 if darwin; then
3801 echocheck "QuickTime"
3802 if test "$quicktime" = auto ; then
3803 quicktime=no
3804 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
3806 if test "$quicktime" = yes ; then
3807 extra_ldflags="$extra_ldflags -framework QuickTime"
3808 def_quicktime='#define CONFIG_QUICKTIME 1'
3809 else
3810 def_quicktime='#undef CONFIG_QUICKTIME'
3812 echores $quicktime
3814 echocheck "Cocoa"
3815 if test "$_cocoa" = auto ; then
3816 cat > $TMPC <<EOF
3817 #include <CoreServices/CoreServices.h>
3818 #include <OpenGL/OpenGL.h>
3819 int main(void) {
3820 NSApplicationLoad();
3823 _cocoa=no
3824 cc_check -framework Cocoa -framework OpenGL && _cocoa=yes
3826 if test "$_cocoa" = yes ; then
3827 libs_mplayer="$libs_mplayer -framework Cocoa -framework OpenGL"
3828 def_cocoa='#define CONFIG_COCOA 1'
3829 else
3830 def_cocoa='#undef CONFIG_COCOA'
3832 echores "$_cocoa"
3834 echocheck "CoreVideo"
3835 if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
3836 cat > $TMPC <<EOF
3837 #include <QuartzCore/CoreVideo.h>
3838 int main(void) { return 0; }
3840 _corevideo=no
3841 cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
3843 if test "$_corevideo" = yes ; then
3844 vomodules="corevideo $vomodules"
3845 libs_mplayer="$libs_mplayer -framework QuartzCore"
3846 def_corevideo='#define CONFIG_COREVIDEO 1'
3847 else
3848 novomodules="corevideo $novomodules"
3849 def_corevideo='#undef CONFIG_COREVIDEO'
3851 echores "$_corevideo"
3853 echocheck "SharedBuffer"
3854 if test "$_sharedbuffer" = auto ; then
3855 cat > $TMPC <<EOF
3856 int main(void) {
3857 NSApplicationLoad();
3860 _sharedbuffer=no
3861 cc_check -framework Cocoa && _sharedbuffer=yes
3863 if test "$_sharedbuffer" = yes ; then
3864 vomodules="sharedbuffer $vomodules"
3865 libs_mplayer="$libs_mplayer -framework Cocoa"
3866 def_sharedbuffer='#define CONFIG_SHAREDBUFFER 1'
3867 else
3868 novomodules="sharedbuffer $novomodules"
3869 def_sharedbuffer='#undef CONFIG_SHAREDBUFFER'
3871 echores "$_sharedbuffer"
3873 depends_on_application_services(){
3874 test "$_corevideo" = yes
3877 fi #if darwin
3880 echocheck "X11 headers presence"
3881 _x11_headers="no"
3882 res_comment="check if the dev(el) packages are installed"
3883 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3884 if test -f "$I/X11/Xlib.h" ; then
3885 _x11_headers="yes"
3886 res_comment=""
3887 break
3889 done
3890 if test $_cross_compile = no; then
3891 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3892 /usr/include/X11R6 /usr/openwin/include ; do
3893 if test -f "$I/X11/Xlib.h" ; then
3894 extra_cflags="$extra_cflags -I$I"
3895 _x11_headers="yes"
3896 res_comment="using $I"
3897 break
3899 done
3901 echores "$_x11_headers"
3904 echocheck "X11"
3905 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3906 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3907 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3908 -L/usr/lib ; do
3909 if netbsd; then
3910 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3911 else
3912 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3914 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3915 _x11=yes
3916 # Check that there aren't conflicting headers between ApplicationServices
3917 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3918 # is included by -framework ApplicationServices and clashes with the X11
3919 # definition of the "Cursor" type.
3920 if darwin && depends_on_application_services && test "$_x11" = yes ; then
3921 _x11=no
3922 header_check_broken ApplicationServices/ApplicationServices.h \
3923 X11/Xutil.h $_ld_tmp && _x11=yes
3925 if test "$_x11" = yes ; then
3926 libs_mplayer="$libs_mplayer $_ld_tmp"
3927 break
3929 done
3931 if test "$_x11" = yes ; then
3932 def_x11='#define CONFIG_X11 1'
3933 vomodules="x11 xover $vomodules"
3934 else
3935 _x11=no
3936 def_x11='#undef CONFIG_X11'
3937 novomodules="x11 $novomodules"
3938 res_comment="check if the dev(el) packages are installed"
3940 echores "$_x11"
3942 echocheck "Xss screensaver extensions"
3943 if test "$_xss" = auto ; then
3944 _xss=no
3945 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3947 if test "$_xss" = yes ; then
3948 def_xss='#define CONFIG_XSS 1'
3949 libs_mplayer="$libs_mplayer -lXss"
3950 else
3951 def_xss='#undef CONFIG_XSS'
3953 echores "$_xss"
3955 echocheck "DPMS"
3956 _xdpms3=no
3957 _xdpms4=no
3958 if test "$_x11" = yes ; then
3959 cat > $TMPC <<EOF
3960 #include <X11/Xmd.h>
3961 #include <X11/Xlib.h>
3962 #include <X11/Xutil.h>
3963 #include <X11/Xatom.h>
3964 #include <X11/extensions/dpms.h>
3965 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3967 cc_check -lXdpms && _xdpms3=yes
3968 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3970 if test "$_xdpms4" = yes ; then
3971 def_xdpms='#define CONFIG_XDPMS 1'
3972 res_comment="using Xdpms 4"
3973 echores "yes"
3974 elif test "$_xdpms3" = yes ; then
3975 def_xdpms='#define CONFIG_XDPMS 1'
3976 libs_mplayer="$libs_mplayer -lXdpms"
3977 res_comment="using Xdpms 3"
3978 echores "yes"
3979 else
3980 def_xdpms='#undef CONFIG_XDPMS'
3981 echores "no"
3985 echocheck "Xv"
3986 if test "$_xv" = auto && test "$_x11" = yes ; then
3987 _xv=no
3988 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3991 if test "$_xv" = yes ; then
3992 def_xv='#define CONFIG_XV 1'
3993 libs_mplayer="$libs_mplayer -lXv"
3994 vomodules="xv $vomodules"
3995 else
3996 def_xv='#undef CONFIG_XV'
3997 novomodules="xv $novomodules"
3999 echores "$_xv"
4002 echocheck "VDPAU"
4003 if test "$_vdpau" = auto && test "$_x11" = yes ; then
4004 _vdpau=no
4005 if test "$_dl" = yes ; then
4006 return_statement_check vdpau/vdpau_x11.h 'vdp_device_create_x11(0, 0, 0, 0)' VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 -lvdpau && _vdpau=yes
4009 if test "$_vdpau" = yes ; then
4010 def_vdpau='#define CONFIG_VDPAU 1'
4011 libs_mplayer="$libs_mplayer -lvdpau"
4012 vomodules="vdpau $vomodules"
4013 else
4014 def_vdpau='#define CONFIG_VDPAU 0'
4015 novomodules="vdpau $novomodules"
4017 echores "$_vdpau"
4020 echocheck "Xinerama"
4021 if test "$_xinerama" = auto && test "$_x11" = yes ; then
4022 _xinerama=no
4023 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
4026 if test "$_xinerama" = yes ; then
4027 def_xinerama='#define CONFIG_XINERAMA 1'
4028 libs_mplayer="$libs_mplayer -lXinerama"
4029 else
4030 def_xinerama='#undef CONFIG_XINERAMA'
4032 echores "$_xinerama"
4035 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4036 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4037 # named 'X extensions' or something similar.
4038 # This check may be useful for future mplayer versions (to change resolution)
4039 # If you run into problems, remove '-lXxf86vm'.
4040 echocheck "Xxf86vm"
4041 if test "$_vm" = auto && test "$_x11" = yes ; then
4042 _vm=no
4043 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
4045 if test "$_vm" = yes ; then
4046 def_vm='#define CONFIG_XF86VM 1'
4047 libs_mplayer="$libs_mplayer -lXxf86vm"
4048 else
4049 def_vm='#undef CONFIG_XF86VM'
4051 echores "$_vm"
4053 # Check for the presence of special keycodes, like audio control buttons
4054 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4055 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4056 # have these new keycodes.
4057 echocheck "XF86keysym"
4058 if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
4059 _xf86keysym=no
4060 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
4062 if test "$_xf86keysym" = yes ; then
4063 def_xf86keysym='#define CONFIG_XF86XK 1'
4064 else
4065 def_xf86keysym='#undef CONFIG_XF86XK'
4067 echores "$_xf86keysym"
4069 echocheck "DGA"
4070 if test "$_dga2" = auto && test "$_x11" = yes ; then
4071 _dga2=no
4072 statement_check_broken X11/Xlib.h X11/extensions/Xxf86dga.h 'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2=yes
4074 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4075 _dga1=no
4076 statement_check_broken X11/Xlib.h X11/extensions/Xxf86dga.h 'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1=yes
4079 _dga=no
4080 def_dga='#undef CONFIG_DGA'
4081 def_dga1='#undef CONFIG_DGA1'
4082 def_dga2='#undef CONFIG_DGA2'
4083 if test "$_dga1" = yes ; then
4084 _dga=yes
4085 def_dga1='#define CONFIG_DGA1 1'
4086 res_comment="using DGA 1.0"
4087 elif test "$_dga2" = yes ; then
4088 _dga=yes
4089 def_dga2='#define CONFIG_DGA2 1'
4090 res_comment="using DGA 2.0"
4092 if test "$_dga" = yes ; then
4093 def_dga='#define CONFIG_DGA 1'
4094 libs_mplayer="$libs_mplayer -lXxf86dga"
4095 vomodules="dga $vomodules"
4096 else
4097 novomodules="dga $novomodules"
4099 echores "$_dga"
4102 echocheck "3dfx"
4103 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4104 def_3dfx='#define CONFIG_3DFX 1'
4105 vomodules="3dfx $vomodules"
4106 else
4107 _3dfx=no
4108 def_3dfx='#undef CONFIG_3DFX'
4109 novomodules="3dfx $novomodules"
4111 echores "$_3dfx"
4114 echocheck "GGI"
4115 if test "$_ggi" = auto ; then
4116 _ggi=no
4117 statement_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4119 if test "$_ggi" = yes ; then
4120 def_ggi='#define CONFIG_GGI 1'
4121 libs_mplayer="$libs_mplayer -lggi"
4122 vomodules="ggi $vomodules"
4123 else
4124 def_ggi='#undef CONFIG_GGI'
4125 novomodules="ggi $novomodules"
4127 echores "$_ggi"
4129 echocheck "GGI extension: libggiwmh"
4130 if test "$_ggiwmh" = auto ; then
4131 _ggiwmh=no
4132 statement_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4134 # needed to get right output on obscure combination
4135 # like --disable-ggi --enable-ggiwmh
4136 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4137 def_ggiwmh='#define CONFIG_GGIWMH 1'
4138 libs_mplayer="$libs_mplayer -lggiwmh"
4139 else
4140 _ggiwmh=no
4141 def_ggiwmh='#undef CONFIG_GGIWMH'
4143 echores "$_ggiwmh"
4146 echocheck "AA"
4147 if test "$_aa" = auto ; then
4148 cat > $TMPC << EOF
4149 #include <aalib.h>
4150 int main(void) {
4151 aa_context *c;
4152 aa_renderparams *p;
4153 aa_init(0, 0, 0);
4154 c = aa_autoinit(&aa_defparams);
4155 p = aa_getrenderparams();
4156 aa_autoinitkbd(c, 0);
4157 return 0; }
4159 _aa=no
4160 for _ld_tmp in "-laa" ; do
4161 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4162 done
4164 if test "$_aa" = yes ; then
4165 def_aa='#define CONFIG_AA 1'
4166 if cygwin ; then
4167 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4169 vomodules="aa $vomodules"
4170 else
4171 def_aa='#undef CONFIG_AA'
4172 novomodules="aa $novomodules"
4174 echores "$_aa"
4177 echocheck "CACA"
4178 if test "$_caca" = auto ; then
4179 _caca=no
4180 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4181 cat > $TMPC << EOF
4182 #include <caca.h>
4183 #ifdef CACA_API_VERSION_1
4184 #include <caca0.h>
4185 #endif
4186 int main(void) { caca_init(); return 0; }
4188 cc_check $(caca-config --libs) && _caca=yes
4191 if test "$_caca" = yes ; then
4192 def_caca='#define CONFIG_CACA 1'
4193 extra_cflags="$extra_cflags $(caca-config --cflags)"
4194 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4195 vomodules="caca $vomodules"
4196 else
4197 def_caca='#undef CONFIG_CACA'
4198 novomodules="caca $novomodules"
4200 echores "$_caca"
4203 echocheck "SVGAlib"
4204 if test "$_svga" = auto ; then
4205 _svga=no
4206 header_check vga.h -lvga $_ld_lm && _svga=yes
4208 if test "$_svga" = yes ; then
4209 def_svga='#define CONFIG_SVGALIB 1'
4210 libs_mplayer="$libs_mplayer -lvga"
4211 vomodules="svga $vomodules"
4212 else
4213 def_svga='#undef CONFIG_SVGALIB'
4214 novomodules="svga $novomodules"
4216 echores "$_svga"
4219 echocheck "FBDev"
4220 if test "$_fbdev" = auto ; then
4221 _fbdev=no
4222 linux && _fbdev=yes
4224 if test "$_fbdev" = yes ; then
4225 def_fbdev='#define CONFIG_FBDEV 1'
4226 vomodules="fbdev $vomodules"
4227 else
4228 def_fbdev='#undef CONFIG_FBDEV'
4229 novomodules="fbdev $novomodules"
4231 echores "$_fbdev"
4235 echocheck "DVB"
4236 if test "$_dvb" = auto ; then
4237 _dvb=no
4238 cat >$TMPC << EOF
4239 #include <poll.h>
4240 #include <sys/ioctl.h>
4241 #include <stdio.h>
4242 #include <time.h>
4243 #include <unistd.h>
4244 #include <linux/dvb/dmx.h>
4245 #include <linux/dvb/frontend.h>
4246 #include <linux/dvb/video.h>
4247 #include <linux/dvb/audio.h>
4248 int main(void) {return 0;}
4250 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4251 cc_check $_inc_tmp && _dvb=yes &&
4252 extra_cflags="$extra_cflags $_inc_tmp" && break
4253 done
4255 echores "$_dvb"
4256 if test "$_dvb" = yes ; then
4257 _dvbin=yes
4258 inputmodules="dvb $inputmodules"
4259 def_dvb='#define CONFIG_DVB 1'
4260 def_dvbin='#define CONFIG_DVBIN 1'
4261 aomodules="mpegpes(dvb) $aomodules"
4262 vomodules="mpegpes(dvb) $vomodules"
4263 else
4264 _dvbin=no
4265 noinputmodules="dvb $noinputmodules"
4266 def_dvb='#undef CONFIG_DVB'
4267 def_dvbin='#undef CONFIG_DVBIN '
4268 aomodules="mpegpes(file) $aomodules"
4269 vomodules="mpegpes(file) $vomodules"
4273 echocheck "PNG support"
4274 if test "$_png" = auto ; then
4275 _png=no
4276 if irix ; then
4277 # Don't check for -lpng on irix since it has its own libpng
4278 # incompatible with the GNU libpng
4279 res_comment="disabled on irix (not GNU libpng)"
4280 else
4281 cat > $TMPC << EOF
4282 #include <stdio.h>
4283 #include <string.h>
4284 #include <png.h>
4285 int main(void) {
4286 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4287 printf("libpng: %s\n", png_libpng_ver);
4288 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4291 cc_check -lpng -lz $_ld_lm && _png=yes
4294 echores "$_png"
4295 if test "$_png" = yes ; then
4296 def_png='#define CONFIG_PNG 1'
4297 extra_ldflags="$extra_ldflags -lpng -lz"
4298 else
4299 def_png='#undef CONFIG_PNG'
4302 echocheck "MNG support"
4303 if test "$_mng" = auto ; then
4304 _mng=no
4305 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
4307 echores "$_mng"
4308 if test "$_mng" = yes ; then
4309 def_mng='#define CONFIG_MNG 1'
4310 extra_ldflags="$extra_ldflags -lmng -lz"
4311 else
4312 def_mng='#undef CONFIG_MNG'
4315 echocheck "JPEG support"
4316 if test "$_jpeg" = auto ; then
4317 _jpeg=no
4318 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
4320 echores "$_jpeg"
4322 if test "$_jpeg" = yes ; then
4323 def_jpeg='#define CONFIG_JPEG 1'
4324 vomodules="jpeg $vomodules"
4325 extra_ldflags="$extra_ldflags -ljpeg"
4326 else
4327 def_jpeg='#undef CONFIG_JPEG'
4328 novomodules="jpeg $novomodules"
4333 echocheck "PNM support"
4334 if test "$_pnm" = yes; then
4335 def_pnm="#define CONFIG_PNM 1"
4336 vomodules="pnm $vomodules"
4337 else
4338 def_pnm="#undef CONFIG_PNM"
4339 novomodules="pnm $novomodules"
4341 echores "$_pnm"
4345 echocheck "GIF support"
4346 # This is to appease people who want to force gif support.
4347 # If it is forced to yes, then we still do checks to determine
4348 # which gif library to use.
4349 if test "$_gif" = yes ; then
4350 _force_gif=yes
4351 _gif=auto
4354 if test "$_gif" = auto ; then
4355 _gif=no
4356 for _ld_gif in "-lungif" "-lgif" ; do
4357 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4358 done
4361 # If no library was found, and the user wants support forced,
4362 # then we force it on with libgif, as this is the safest
4363 # assumption IMHO. (libungif & libregif both create symbolic
4364 # links to libgif. We also assume that no x11 support is needed,
4365 # because if you are forcing this, then you _should_ know what
4366 # you are doing. [ Besides, package maintainers should never
4367 # have compiled x11 deps into libungif in the first place. ] )
4368 # </rant>
4369 # --Joey
4370 if test "$_force_gif" = yes && test "$_gif" = no ; then
4371 _gif=yes
4372 _ld_gif="-lgif"
4375 if test "$_gif" = yes ; then
4376 def_gif='#define CONFIG_GIF 1'
4377 codecmodules="gif $codecmodules"
4378 vomodules="gif89a $vomodules"
4379 res_comment="old version, some encoding functions disabled"
4380 def_gif_4='#undef CONFIG_GIF_4'
4381 extra_ldflags="$extra_ldflags $_ld_gif"
4383 cat > $TMPC << EOF
4384 #include <signal.h>
4385 #include <stdio.h>
4386 #include <stdlib.h>
4387 #include <gif_lib.h>
4388 static void catch(int sig) { exit(1); }
4389 int main(void) {
4390 signal(SIGSEGV, catch); // catch segfault
4391 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4392 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4393 return 0;
4396 if cc_check "$_ld_gif" ; then
4397 def_gif_4='#define CONFIG_GIF_4 1'
4398 res_comment=""
4400 else
4401 def_gif='#undef CONFIG_GIF'
4402 def_gif_4='#undef CONFIG_GIF_4'
4403 novomodules="gif89a $novomodules"
4404 nocodecmodules="gif $nocodecmodules"
4406 echores "$_gif"
4409 case "$_gif" in yes*)
4410 echocheck "broken giflib workaround"
4411 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4413 cat > $TMPC << EOF
4414 #include <stdio.h>
4415 #include <gif_lib.h>
4416 int main(void) {
4417 GifFileType gif = {.UserData = NULL};
4418 printf("UserData is at address %p\n", gif.UserData);
4419 return 0;
4422 if cc_check "$_ld_gif" ; then
4423 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4424 echores "disabled"
4425 else
4426 echores "enabled"
4429 esac
4432 echocheck "VESA support"
4433 if test "$_vesa" = auto ; then
4434 _vesa=no
4435 statement_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4437 if test "$_vesa" = yes ; then
4438 def_vesa='#define CONFIG_VESA 1'
4439 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4440 vomodules="vesa $vomodules"
4441 else
4442 def_vesa='#undef CONFIG_VESA'
4443 novomodules="vesa $novomodules"
4445 echores "$_vesa"
4447 #################
4448 # VIDEO + AUDIO #
4449 #################
4452 echocheck "SDL"
4453 _inc_tmp=""
4454 _ld_tmp=""
4455 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4456 if test -z "$_sdlconfig" ; then
4457 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4458 _sdlconfig="sdl-config"
4459 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4460 _sdlconfig="sdl11-config"
4461 else
4462 _sdlconfig=false
4465 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4466 cat > $TMPC << EOF
4467 #ifdef CONFIG_SDL_SDL_H
4468 #include <SDL/SDL.h>
4469 #else
4470 #include <SDL.h>
4471 #endif
4472 #ifndef __APPLE__
4473 // we allow SDL hacking our main() only on OSX
4474 #undef main
4475 #endif
4476 int main(int argc, char *argv[]) {
4477 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4478 return 0;
4481 _sdl=no
4482 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4483 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4484 _sdl=yes
4485 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4486 break
4488 done
4489 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4490 res_comment="using $_sdlconfig"
4491 if cygwin ; then
4492 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4493 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4494 elif mingw32 ; then
4495 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4496 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4497 else
4498 _inc_tmp="$($_sdlconfig --cflags)"
4499 _ld_tmp="$($_sdlconfig --libs)"
4501 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4502 _sdl=yes
4503 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4504 # HACK for BeOS/Haiku SDL
4505 _ld_tmp="$_ld_tmp -lstdc++"
4506 _sdl=yes
4510 if test "$_sdl" = yes ; then
4511 def_sdl='#define CONFIG_SDL 1'
4512 extra_cflags="$extra_cflags $_inc_tmp"
4513 libs_mplayer="$libs_mplayer $_ld_tmp"
4514 vomodules="sdl $vomodules"
4515 aomodules="sdl $aomodules"
4516 else
4517 def_sdl='#undef CONFIG_SDL'
4518 novomodules="sdl $novomodules"
4519 noaomodules="sdl $noaomodules"
4521 echores "$_sdl"
4524 # make sure this stays below CoreVideo to avoid issues due to namespace
4525 # conflicts between -lGL and -framework OpenGL
4526 echocheck "OpenGL"
4527 #Note: this test is run even with --enable-gl since we autodetect linker flags
4528 if (test "$_x11" = yes || test "$_sdl" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
4529 cat > $TMPC << EOF
4530 #ifdef GL_WIN32
4531 #include <windows.h>
4532 #include <GL/gl.h>
4533 #elif defined(GL_SDL)
4534 #include <GL/gl.h>
4535 #ifdef CONFIG_SDL_SDL_H
4536 #include <SDL/SDL.h>
4537 #else
4538 #include <SDL.h>
4539 #endif
4540 #ifndef __APPLE__
4541 // we allow SDL hacking our main() only on OSX
4542 #undef main
4543 #endif
4544 #else
4545 #include <GL/gl.h>
4546 #include <X11/Xlib.h>
4547 #include <GL/glx.h>
4548 #endif
4549 int main(int argc, char *argv[]) {
4550 #ifdef GL_WIN32
4551 HDC dc;
4552 wglCreateContext(dc);
4553 #elif defined(GL_SDL)
4554 SDL_GL_SwapBuffers();
4555 #else
4556 glXCreateContext(NULL, NULL, NULL, True);
4557 #endif
4558 glFinish();
4559 return 0;
4562 _gl=no
4563 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4564 if cc_check $_ld_tmp $_ld_lm ; then
4565 _gl=yes
4566 _gl_x11=yes
4567 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4568 break
4570 done
4571 if cc_check -DGL_WIN32 -lopengl32 ; then
4572 _gl=yes
4573 _gl_win32=yes
4574 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4576 if test "$_cocoa" = yes ; then
4577 _gl=yes
4578 _gl_cocoa=yes
4580 # last so it can reuse any linker etc. flags detected before
4581 if test "$_sdl" = yes ; then
4582 if cc_check -DGL_SDL ||
4583 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4584 _gl=yes
4585 _gl_sdl=yes
4586 elif cc_check -DGL_SDL -lGL ||
4587 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4588 _gl=yes
4589 _gl_sdl=yes
4590 libs_mplayer="$libs_mplayer -lGL"
4593 else
4594 _gl=no
4596 if test "$_gl" = yes ; then
4597 def_gl='#define CONFIG_GL 1'
4598 res_comment="backends:"
4599 if test "$_gl_cocoa" = yes ; then
4600 def_gl_cocoa='#define CONFIG_GL_COCOA 1'
4601 res_comment="$res_comment cocoa"
4603 if test "$_gl_win32" = yes ; then
4604 def_gl_win32='#define CONFIG_GL_WIN32 1'
4605 res_comment="$res_comment win32"
4607 if test "$_gl_x11" = yes ; then
4608 def_gl_x11='#define CONFIG_GL_X11 1'
4609 res_comment="$res_comment x11"
4611 if test "$_gl_sdl" = yes ; then
4612 def_gl_sdl='#define CONFIG_GL_SDL 1'
4613 res_comment="$res_comment sdl"
4615 vomodules="opengl $vomodules"
4616 else
4617 def_gl='#undef CONFIG_GL'
4618 def_gl_cocoa='#undef CONFIG_GL_COCOA'
4619 def_gl_win32='#undef CONFIG_GL_WIN32'
4620 def_gl_x11='#undef CONFIG_GL_X11'
4621 def_gl_sdl='#undef CONFIG_GL_SDL'
4622 novomodules="opengl $novomodules"
4624 echores "$_gl"
4627 if win32; then
4629 echocheck "Windows waveout"
4630 if test "$_win32waveout" = auto ; then
4631 _win32waveout=no
4632 header_check_broken windows.h mmsystem.h -lwinmm && _win32waveout=yes
4634 if test "$_win32waveout" = yes ; then
4635 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4636 libs_mplayer="$libs_mplayer -lwinmm"
4637 aomodules="win32 $aomodules"
4638 else
4639 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4640 noaomodules="win32 $noaomodules"
4642 echores "$_win32waveout"
4644 echocheck "Direct3D"
4645 if test "$_direct3d" = auto ; then
4646 _direct3d=no
4647 header_check d3d9.h && _direct3d=yes
4649 if test "$_direct3d" = yes ; then
4650 def_direct3d='#define CONFIG_DIRECT3D 1'
4651 vomodules="direct3d $vomodules"
4652 else
4653 def_direct3d='#undef CONFIG_DIRECT3D'
4654 novomodules="direct3d $novomodules"
4656 echores "$_direct3d"
4658 echocheck "Directx"
4659 if test "$_directx" = auto ; then
4660 cat > $TMPC << EOF
4661 #include <ddraw.h>
4662 #include <dsound.h>
4663 int main(void) { return 0; }
4665 _directx=no
4666 cc_check -lgdi32 && _directx=yes
4668 if test "$_directx" = yes ; then
4669 def_directx='#define CONFIG_DIRECTX 1'
4670 libs_mplayer="$libs_mplayer -lgdi32"
4671 vomodules="directx $vomodules"
4672 aomodules="dsound $aomodules"
4673 else
4674 def_directx='#undef CONFIG_DIRECTX'
4675 novomodules="directx $novomodules"
4676 noaomodules="dsound $noaomodules"
4678 echores "$_directx"
4680 fi #if win32; then
4683 echocheck "DXR3/H+"
4684 if test "$_dxr3" = auto ; then
4685 _dxr3=no
4686 header_check linux/em8300.h && _dxr3=yes
4688 if test "$_dxr3" = yes ; then
4689 def_dxr3='#define CONFIG_DXR3 1'
4690 vomodules="dxr3 $vomodules"
4691 else
4692 def_dxr3='#undef CONFIG_DXR3'
4693 novomodules="dxr3 $novomodules"
4695 echores "$_dxr3"
4698 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4699 if test "$_ivtv" = auto ; then
4700 cat > $TMPC << EOF
4701 #include <sys/time.h>
4702 #include <linux/videodev2.h>
4703 #include <linux/ivtv.h>
4704 #include <sys/ioctl.h>
4705 int main(void) {
4706 struct ivtv_cfg_stop_decode sd;
4707 struct ivtv_cfg_start_decode sd1;
4708 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4709 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
4710 return 0; }
4712 _ivtv=no
4713 cc_check && _ivtv=yes
4715 if test "$_ivtv" = yes ; then
4716 def_ivtv='#define CONFIG_IVTV 1'
4717 vomodules="ivtv $vomodules"
4718 aomodules="ivtv $aomodules"
4719 else
4720 def_ivtv='#undef CONFIG_IVTV'
4721 novomodules="ivtv $novomodules"
4722 noaomodules="ivtv $noaomodules"
4724 echores "$_ivtv"
4727 echocheck "V4L2 MPEG Decoder"
4728 if test "$_v4l2" = auto ; then
4729 cat > $TMPC << EOF
4730 #include <sys/time.h>
4731 #include <linux/videodev2.h>
4732 #include <linux/version.h>
4733 int main(void) {
4734 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4735 #error kernel headers too old, need 2.6.22
4736 #endif
4737 struct v4l2_ext_controls ctrls;
4738 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4739 return 0;
4742 _v4l2=no
4743 cc_check && _v4l2=yes
4745 if test "$_v4l2" = yes ; then
4746 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4747 vomodules="v4l2 $vomodules"
4748 aomodules="v4l2 $aomodules"
4749 else
4750 def_v4l2='#undef CONFIG_V4L2_DECODER'
4751 novomodules="v4l2 $novomodules"
4752 noaomodules="v4l2 $noaomodules"
4754 echores "$_v4l2"
4758 #########
4759 # AUDIO #
4760 #########
4763 echocheck "OSS Audio"
4764 if test "$_ossaudio" = auto ; then
4765 _ossaudio=no
4766 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4768 if test "$_ossaudio" = yes ; then
4769 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4770 aomodules="oss $aomodules"
4771 cat > $TMPC << EOF
4772 #include <$_soundcard_header>
4773 #ifdef OPEN_SOUND_SYSTEM
4774 int main(void) { return 0; }
4775 #else
4776 #error Not the real thing
4777 #endif
4779 _real_ossaudio=no
4780 cc_check && _real_ossaudio=yes
4781 if test "$_real_ossaudio" = yes; then
4782 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4783 # Check for OSS4 headers (override default headers)
4784 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4785 if test -f /etc/oss.conf; then
4786 . /etc/oss.conf
4787 _ossinc="$OSSLIBDIR/include"
4788 if test -f "$_ossinc/sys/soundcard.h"; then
4789 extra_cflags="-I$_ossinc $extra_cflags"
4792 elif netbsd || openbsd ; then
4793 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4794 extra_ldflags="$extra_ldflags -lossaudio"
4795 else
4796 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4798 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4799 else
4800 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4801 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4802 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4803 noaomodules="oss $noaomodules"
4805 echores "$_ossaudio"
4808 echocheck "aRts"
4809 if test "$_arts" = auto ; then
4810 _arts=no
4811 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4812 statement_check artsc.h 'arts_init()' $(artsc-config --libs) $(artsc-config --cflags) &&
4813 _arts=yes
4817 if test "$_arts" = yes ; then
4818 def_arts='#define CONFIG_ARTS 1'
4819 aomodules="arts $aomodules"
4820 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
4821 extra_cflags="$extra_cflags $(artsc-config --cflags)"
4822 else
4823 noaomodules="arts $noaomodules"
4825 echores "$_arts"
4828 echocheck "EsounD"
4829 if test "$_esd" = auto ; then
4830 _esd=no
4831 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4832 statement_check esd.h 'esd_open_sound("test")' $(esd-config --libs) $(esd-config --cflags) && _esd=yes
4835 echores "$_esd"
4837 if test "$_esd" = yes ; then
4838 def_esd='#define CONFIG_ESD 1'
4839 aomodules="esd $aomodules"
4840 libs_mplayer="$libs_mplayer $(esd-config --libs)"
4841 extra_cflags="$extra_cflags $(esd-config --cflags)"
4843 echocheck "esd_get_latency()"
4844 statement_check esd.h 'esd_get_latency(0)' $(esd-config --libs) $(esd-config --cflags) &&
4845 _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
4846 echores "$_esd_latency"
4847 else
4848 def_esd='#undef CONFIG_ESD'
4849 def_esd_latency='#undef CONFIG_ESD_LATENCY'
4850 noaomodules="esd $noaomodules"
4853 echocheck "RSound"
4854 if test "$_rsound" = auto ; then
4855 _rsound=no
4856 statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
4858 echores "$_rsound"
4860 if test "$_rsound" = yes ; then
4861 def_rsound='#define CONFIG_RSOUND 1'
4862 aomodules="rsound $aomodules"
4863 libs_mplayer="$libs_mplayer -lrsound"
4864 else
4865 def_rsound='#undef CONFIG_RSOUND'
4866 noaomodules="rsound $noaomodules"
4870 echocheck "NAS"
4871 if test "$_nas" = auto ; then
4872 _nas=no
4873 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
4875 if test "$_nas" = yes ; then
4876 def_nas='#define CONFIG_NAS 1'
4877 libs_mplayer="$libs_mplayer -laudio -lXt"
4878 aomodules="nas $aomodules"
4879 else
4880 noaomodules="nas $noaomodules"
4881 def_nas='#undef CONFIG_NAS'
4883 echores "$_nas"
4886 echocheck "pulse"
4887 if test "$_pulse" = auto ; then
4888 _pulse=no
4889 if pkg_config_add 'libpulse >= 0.9' ; then
4890 _pulse=yes
4893 echores "$_pulse"
4895 if test "$_pulse" = yes ; then
4896 def_pulse='#define CONFIG_PULSE 1'
4897 aomodules="pulse $aomodules"
4898 else
4899 def_pulse='#undef CONFIG_PULSE'
4900 noaomodules="pulse $noaomodules"
4904 echocheck "JACK"
4905 if test "$_jack" = auto ; then
4906 _jack=no
4907 if pkg_config_add jack ; then
4908 _jack=yes
4912 if test "$_jack" = yes ; then
4913 def_jack='#define CONFIG_JACK 1'
4914 aomodules="jack $aomodules"
4915 else
4916 noaomodules="jack $noaomodules"
4918 echores "$_jack"
4920 echocheck "OpenAL"
4921 if test "$_openal" = auto ; then
4922 _openal=no
4923 cat > $TMPC << EOF
4924 #ifdef OPENAL_AL_H
4925 #include <OpenAL/al.h>
4926 #else
4927 #include <AL/al.h>
4928 #endif
4929 int main(void) {
4930 alSourceQueueBuffers(0, 0, 0);
4931 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4932 return 0;
4935 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4936 cc_check $I && _openal=yes && break
4937 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4938 done
4939 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4941 if test "$_openal" = yes ; then
4942 def_openal='#define CONFIG_OPENAL 1'
4943 aomodules="openal $aomodules"
4944 else
4945 noaomodules="openal $noaomodules"
4947 echores "$_openal"
4949 echocheck "ALSA audio"
4950 if test "$_alloca" != yes ; then
4951 _alsa=no
4952 res_comment="alloca missing"
4954 if test "$_alsa" = auto ; then
4955 _alsa=no
4956 if pkg_config_add "alsa >= 1.0.9" ; then
4957 _alsa=yes
4960 def_alsa='#undef CONFIG_ALSA'
4961 if test "$_alsa" = yes ; then
4962 aomodules="alsa $aomodules"
4963 def_alsa='#define CONFIG_ALSA 1'
4964 else
4965 noaomodules="alsa $noaomodules"
4967 echores "$_alsa"
4970 echocheck "Sun audio"
4971 if test "$_sunaudio" = auto ; then
4972 cat > $TMPC << EOF
4973 #include <sys/types.h>
4974 #include <sys/audioio.h>
4975 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4977 _sunaudio=no
4978 cc_check && _sunaudio=yes
4980 if test "$_sunaudio" = yes ; then
4981 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
4982 aomodules="sun $aomodules"
4983 else
4984 def_sunaudio='#undef CONFIG_SUN_AUDIO'
4985 noaomodules="sun $noaomodules"
4987 echores "$_sunaudio"
4990 if darwin; then
4991 echocheck "CoreAudio"
4992 if test "$_coreaudio" = auto ; then
4993 cat > $TMPC <<EOF
4994 #include <CoreAudio/CoreAudio.h>
4995 #include <AudioToolbox/AudioToolbox.h>
4996 #include <AudioUnit/AudioUnit.h>
4997 int main(void) { return 0; }
4999 _coreaudio=no
5000 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5002 if test "$_coreaudio" = yes ; then
5003 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5004 def_coreaudio='#define CONFIG_COREAUDIO 1'
5005 aomodules="coreaudio $aomodules"
5006 else
5007 def_coreaudio='#undef CONFIG_COREAUDIO'
5008 noaomodules="coreaudio $noaomodules"
5010 echores $_coreaudio
5011 fi #if darwin
5014 if irix; then
5015 echocheck "SGI audio"
5016 if test "$_sgiaudio" = auto ; then
5017 _sgiaudio=no
5018 header_check dmedia/audio.h && _sgiaudio=yes
5020 if test "$_sgiaudio" = "yes" ; then
5021 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5022 libs_mplayer="$libs_mplayer -laudio"
5023 aomodules="sgi $aomodules"
5024 else
5025 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5026 noaomodules="sgi $noaomodules"
5028 echores "$_sgiaudio"
5029 fi #if irix
5032 # set default CD/DVD devices
5033 if win32 ; then
5034 default_cdrom_device="D:"
5035 elif darwin ; then
5036 default_cdrom_device="/dev/disk1"
5037 elif dragonfly ; then
5038 default_cdrom_device="/dev/cd0"
5039 elif freebsd ; then
5040 default_cdrom_device="/dev/acd0"
5041 elif openbsd ; then
5042 default_cdrom_device="/dev/rcd0c"
5043 elif sunos ; then
5044 default_cdrom_device="/vol/dev/aliases/cdrom0"
5045 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5046 # file system and the volfs service.
5047 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5048 elif amigaos ; then
5049 default_cdrom_device="a1ide.device:2"
5050 else
5051 default_cdrom_device="/dev/cdrom"
5054 if win32 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5055 default_dvd_device=$default_cdrom_device
5056 elif darwin ; then
5057 default_dvd_device="/dev/rdiskN"
5058 else
5059 default_dvd_device="/dev/dvd"
5063 echocheck "VCD support"
5064 if test "$_vcd" = auto; then
5065 _vcd=no
5066 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos; then
5067 _vcd=yes
5068 elif mingw32; then
5069 header_check ddk/ntddcdrm.h && _vcd=yes
5072 if test "$_vcd" = yes; then
5073 inputmodules="vcd $inputmodules"
5074 def_vcd='#define CONFIG_VCD 1'
5075 else
5076 def_vcd='#undef CONFIG_VCD'
5077 noinputmodules="vcd $noinputmodules"
5078 res_comment="not supported on this OS"
5080 echores "$_vcd"
5084 echocheck "Blu-ray support"
5085 if test "$_bluray" = auto ; then
5086 _bluray=no
5087 statement_check libbluray/bluray.h 'bd_get_title_info(0, 0, 0)' -lbluray && _bluray=yes
5089 if test "$_bluray" = yes ; then
5090 def_bluray='#define CONFIG_LIBBLURAY 1'
5091 extra_ldflags="$extra_ldflags -lbluray"
5092 inputmodules="bluray $inputmodules"
5093 else
5094 def_bluray='#undef CONFIG_LIBBLURAY'
5095 noinputmodules="bluray $noinputmodules"
5097 echores "$_bluray"
5099 echocheck "dvdread"
5100 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5101 _dvdread_internal=no
5103 if test "$_dvdread_internal" = auto ; then
5104 _dvdread_internal=no
5105 _dvdread=no
5106 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) &&
5107 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
5108 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
5109 darwin || win32; then
5110 _dvdread_internal=yes
5111 _dvdread=yes
5112 extra_cflags="-Ilibdvdread4 $extra_cflags"
5114 elif test "$_dvdread" = auto ; then
5115 _dvdread=no
5116 if test "$_dl" = yes; then
5117 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5118 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5119 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5120 _dvdread=yes
5121 extra_cflags="$extra_cflags $_dvdreadcflags"
5122 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5123 res_comment="external"
5128 if test "$_dvdread_internal" = yes; then
5129 def_dvdread='#define CONFIG_DVDREAD 1'
5130 inputmodules="dvdread(internal) $inputmodules"
5131 res_comment="internal"
5132 elif test "$_dvdread" = yes; then
5133 def_dvdread='#define CONFIG_DVDREAD 1'
5134 extra_ldflags="$extra_ldflags -ldvdread"
5135 inputmodules="dvdread(external) $inputmodules"
5136 res_comment="external"
5137 else
5138 def_dvdread='#undef CONFIG_DVDREAD'
5139 noinputmodules="dvdread $noinputmodules"
5141 echores "$_dvdread"
5144 echocheck "internal libdvdcss"
5145 if test "$_libdvdcss_internal" = auto ; then
5146 _libdvdcss_internal=no
5147 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
5148 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5150 if test "$_libdvdcss_internal" = yes ; then
5151 if linux || netbsd || openbsd || bsdos ; then
5152 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5153 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5154 elif freebsd || dragonfly ; then
5155 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5156 elif darwin ; then
5157 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5158 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5159 elif cygwin ; then
5160 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5161 elif beos ; then
5162 cflags_libdvdcss="-DSYS_BEOS"
5164 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5165 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5166 inputmodules="libdvdcss(internal) $inputmodules"
5167 else
5168 noinputmodules="libdvdcss(internal) $noinputmodules"
5170 echores "$_libdvdcss_internal"
5173 echocheck "cdparanoia"
5174 if test "$_cdparanoia" = auto ; then
5175 cat > $TMPC <<EOF
5176 #include <cdda_interface.h>
5177 #include <cdda_paranoia.h>
5178 // This need a better test. How ?
5179 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5181 _cdparanoia=no
5182 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5183 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm &&
5184 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5185 done
5187 if test "$_cdparanoia" = yes ; then
5188 _cdda='yes'
5189 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5190 openbsd && extra_ldflags="$extra_ldflags -lutil"
5192 echores "$_cdparanoia"
5195 echocheck "libcdio"
5196 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5197 _libcdio=no
5198 if pkg_config_add libcdio_paranoia ; then
5199 _libcdio=yes
5202 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5203 _cdda='yes'
5204 def_libcdio='#define CONFIG_LIBCDIO 1'
5205 def_havelibcdio='yes'
5206 else
5207 _libcdio=no
5208 if test "$_cdparanoia" = yes ; then
5209 res_comment="using cdparanoia"
5211 def_libcdio='#undef CONFIG_LIBCDIO'
5212 def_havelibcdio='no'
5214 echores "$_libcdio"
5216 if test "$_cdda" = yes ; then
5217 test $_cddb = auto && test $networking = yes && _cddb=yes
5218 def_cdparanoia='#define CONFIG_CDDA 1'
5219 inputmodules="cdda $inputmodules"
5220 else
5221 def_cdparanoia='#undef CONFIG_CDDA'
5222 noinputmodules="cdda $noinputmodules"
5225 if test "$_cddb" = yes ; then
5226 def_cddb='#define CONFIG_CDDB 1'
5227 inputmodules="cddb $inputmodules"
5228 else
5229 _cddb=no
5230 def_cddb='#undef CONFIG_CDDB'
5231 noinputmodules="cddb $noinputmodules"
5234 echocheck "bitmap font support"
5235 if test "$_bitmap_font" = yes ; then
5236 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5237 else
5238 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5240 echores "$_bitmap_font"
5243 echocheck "freetype >= 2.0.9"
5245 # freetype depends on iconv
5246 if test "$_iconv" = no ; then
5247 _freetype=no
5248 res_comment="iconv support needed"
5251 if test "$_freetype" = auto ; then
5252 if pkg_config_add freetype2 ; then
5253 _freetype=yes
5254 else
5255 die "Unable to find development files for libfreetype. Aborting. If you really mean to compile without FreeType support use --disable-freetype."
5258 if test "$_freetype" = yes ; then
5259 def_freetype='#define CONFIG_FREETYPE 1'
5260 else
5261 def_freetype='#undef CONFIG_FREETYPE'
5263 echores "$_freetype"
5265 if test "$_freetype" = no ; then
5266 _fontconfig=no
5267 res_comment="FreeType support needed"
5269 echocheck "fontconfig"
5270 if test "$_fontconfig" = auto ; then
5271 if pkg_config_add 'fontconfig >= 2.4.2' ; then
5272 _fontconfig=yes
5273 else
5274 die "Unable to find development files for libfontconfig. Aborting. If you really mean to compile without fontconfig support use --disable-fontconfig."
5277 if test "$_fontconfig" = yes ; then
5278 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5279 else
5280 def_fontconfig='#undef CONFIG_FONTCONFIG'
5282 echores "$_fontconfig"
5285 echocheck "SSA/ASS support"
5286 if test "$_ass" = auto ; then
5287 if pkg_config_add libass ; then
5288 _ass=yes
5289 def_ass='#define CONFIG_ASS 1'
5290 else
5291 die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
5293 else
5294 def_ass='#undef CONFIG_ASS'
5296 echores "$_ass"
5299 echocheck "fribidi with charsets"
5300 if test "$_fribidi" = auto ; then
5301 _fribidi=no
5302 if pkg_config_add fribidi ; then
5303 _fribidi=yes
5306 if test "$_fribidi" = yes ; then
5307 def_fribidi='#define CONFIG_FRIBIDI 1'
5308 else
5309 def_fribidi='#undef CONFIG_FRIBIDI'
5311 echores "$_fribidi"
5314 echocheck "ENCA"
5315 if test "$_enca" = auto ; then
5316 _enca=no
5317 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
5319 if test "$_enca" = yes ; then
5320 def_enca='#define CONFIG_ENCA 1'
5321 extra_ldflags="$extra_ldflags -lenca"
5322 else
5323 def_enca='#undef CONFIG_ENCA'
5325 echores "$_enca"
5328 echocheck "zlib"
5329 _zlib=no
5330 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5331 if test "$_zlib" = yes ; then
5332 def_zlib='#define CONFIG_ZLIB 1'
5333 extra_ldflags="$extra_ldflags -lz"
5334 else
5335 def_zlib='#define CONFIG_ZLIB 0'
5337 echores "$_zlib"
5340 echocheck "RTC"
5341 if test "$_rtc" = auto ; then
5342 cat > $TMPC << EOF
5343 #include <sys/ioctl.h>
5344 #ifdef __linux__
5345 #include <linux/rtc.h>
5346 #else
5347 #include <rtc.h>
5348 #define RTC_PIE_ON RTCIO_PIE_ON
5349 #endif
5350 int main(void) { return RTC_PIE_ON; }
5352 _rtc=no
5353 cc_check && _rtc=yes
5354 ppc && _rtc=no
5356 if test "$_rtc" = yes ; then
5357 def_rtc='#define HAVE_RTC 1'
5358 else
5359 def_rtc='#undef HAVE_RTC'
5361 echores "$_rtc"
5364 echocheck "mad support"
5365 if test "$_mad" = auto ; then
5366 _mad=no
5367 header_check mad.h -lmad && _mad=yes
5369 if test "$_mad" = yes ; then
5370 def_mad='#define CONFIG_LIBMAD 1'
5371 extra_ldflags="$extra_ldflags -lmad"
5372 codecmodules="libmad $codecmodules"
5373 else
5374 def_mad='#undef CONFIG_LIBMAD'
5375 nocodecmodules="libmad $nocodecmodules"
5377 echores "$_mad"
5379 echocheck "OggVorbis support"
5380 if test "$_libvorbis" = auto; then
5381 _libvorbis=no
5382 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
5383 elif test "$_libvorbis" = yes ; then
5384 _tremor=no
5386 if test "$_tremor" = auto; then
5387 _tremor=no
5388 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
5390 if test "$_tremor" = yes ; then
5391 _vorbis=yes
5392 def_vorbis='#define CONFIG_OGGVORBIS 1'
5393 def_tremor='#define CONFIG_TREMOR 1'
5394 codecmodules="tremor(external) $codecmodules"
5395 res_comment="external Tremor"
5396 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
5397 elif test "$_libvorbis" = yes ; then
5398 _vorbis=yes
5399 def_vorbis='#define CONFIG_OGGVORBIS 1'
5400 codecmodules="libvorbis $codecmodules"
5401 res_comment="libvorbis"
5402 extra_ldflags="$extra_ldflags -lvorbis -logg"
5403 else
5404 _vorbis=no
5405 nocodecmodules="libvorbis $nocodecmodules"
5407 echores "$_vorbis"
5409 echocheck "libspeex (version >= 1.1 required)"
5410 if test "$_speex" = auto ; then
5411 _speex=no
5412 cat > $TMPC << EOF
5413 #include <stddef.h>
5414 #include <speex/speex.h>
5415 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5417 cc_check -lspeex $_ld_lm && _speex=yes
5419 if test "$_speex" = yes ; then
5420 def_speex='#define CONFIG_SPEEX 1'
5421 extra_ldflags="$extra_ldflags -lspeex"
5422 codecmodules="speex $codecmodules"
5423 else
5424 def_speex='#undef CONFIG_SPEEX'
5425 nocodecmodules="speex $nocodecmodules"
5427 echores "$_speex"
5429 echocheck "OggTheora support"
5430 if test "$_theora" = auto ; then
5431 _theora=no
5432 if pkg_config_add theora ; then
5433 _theora=yes
5436 if test "$_theora" = yes ; then
5437 def_theora='#define CONFIG_OGGTHEORA 1'
5438 codecmodules="libtheora $codecmodules"
5439 else
5440 def_theora='#undef CONFIG_OGGTHEORA'
5441 nocodecmodules="libtheora $nocodecmodules"
5443 echores "$_theora"
5445 # Any version of libmpg123 shall be fine.
5446 echocheck "mpg123 support"
5447 def_mpg123='#undef CONFIG_MPG123'
5448 if test "$_mpg123" = auto; then
5449 _mpg123=no
5450 statement_check mpg123.h 'mpg123_init()' -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
5452 if test "$_mpg123" = yes ; then
5453 def_mpg123='#define CONFIG_MPG123 1'
5454 codecmodules="mpg123 $codecmodules"
5455 else
5456 nocodecmodules="mpg123 $nocodecmodules"
5458 echores "$_mpg123"
5460 echocheck "liba52 support"
5461 def_liba52='#undef CONFIG_LIBA52'
5462 if test "$_liba52" = auto ; then
5463 _liba52=no
5464 cat > $TMPC << EOF
5465 #include <inttypes.h>
5466 #include <a52dec/a52.h>
5467 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
5469 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
5471 if test "$_liba52" = yes ; then
5472 def_liba52='#define CONFIG_LIBA52 1'
5473 codecmodules="liba52 $codecmodules"
5474 else
5475 nocodecmodules="liba52 $nocodecmodules"
5477 echores "$_liba52"
5479 echocheck "libdca support"
5480 if test "$_libdca" = auto ; then
5481 _libdca=no
5482 for _ld_dca in -ldca -ldts ; do
5483 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
5484 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
5485 done
5487 if test "$_libdca" = yes ; then
5488 def_libdca='#define CONFIG_LIBDCA 1'
5489 codecmodules="libdca $codecmodules"
5490 else
5491 def_libdca='#undef CONFIG_LIBDCA'
5492 nocodecmodules="libdca $nocodecmodules"
5494 echores "$_libdca"
5496 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5497 if test "$_musepack" = yes ; then
5498 _musepack=no
5499 cat > $TMPC << EOF
5500 #include <stddef.h>
5501 #include <mpcdec/mpcdec.h>
5502 int main(void) {
5503 mpc_streaminfo info;
5504 mpc_decoder decoder;
5505 mpc_decoder_set_streaminfo(&decoder, &info);
5506 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5507 return 0;
5510 cc_check -lmpcdec $_ld_lm && _musepack=yes
5512 if test "$_musepack" = yes ; then
5513 def_musepack='#define CONFIG_MUSEPACK 1'
5514 extra_ldflags="$extra_ldflags -lmpcdec"
5515 codecmodules="musepack $codecmodules"
5516 else
5517 def_musepack='#undef CONFIG_MUSEPACK'
5518 nocodecmodules="musepack $nocodecmodules"
5520 echores "$_musepack"
5523 echocheck "FAAD2 support"
5524 if test "$_faad" = auto ; then
5525 _faad=no
5526 cat > $TMPC << EOF
5527 #include <faad.h>
5528 #ifndef FAAD_MIN_STREAMSIZE
5529 #error Too old version
5530 #endif
5531 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
5532 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5534 cc_check -lfaad $_ld_lm && _faad=yes
5537 def_faad='#undef CONFIG_FAAD'
5538 if test "$_faad" = yes ; then
5539 def_faad='#define CONFIG_FAAD 1'
5540 extra_ldflags="$extra_ldflags -lfaad"
5541 codecmodules="faad2 $codecmodules"
5542 else
5543 nocodecmodules="faad2 $nocodecmodules"
5545 echores "$_faad"
5548 echocheck "LADSPA plugin support"
5549 if test "$_ladspa" = auto ; then
5550 _ladspa=no
5551 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
5553 if test "$_ladspa" = yes; then
5554 def_ladspa="#define CONFIG_LADSPA 1"
5555 else
5556 def_ladspa="#undef CONFIG_LADSPA"
5558 echores "$_ladspa"
5561 echocheck "libbs2b audio filter support"
5562 if test "$_libbs2b" = auto ; then
5563 _libbs2b=no
5564 if pkg_config_add libbs2b ; then
5565 _libbs2b=yes
5568 def_libbs2b="#undef CONFIG_LIBBS2B"
5569 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
5570 echores "$_libbs2b"
5573 if test -z "$_codecsdir" ; then
5574 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5575 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5576 if test -d "$dir" ; then
5577 _codecsdir="$dir"
5578 break;
5580 done
5582 # Fall back on default directory.
5583 if test -z "$_codecsdir" ; then
5584 _codecsdir="$_libdir/codecs"
5585 mingw32 && _codecsdir="codecs"
5589 echocheck "Win32 codecs"
5590 if test "$_win32dll" = auto ; then
5591 _win32dll=no
5592 if x86_32 && ! qnx; then
5593 _win32dll=yes
5596 if test "$_win32dll" = yes ; then
5597 def_win32dll='#define CONFIG_WIN32DLL 1'
5598 if ! win32 ; then
5599 def_win32_loader='#define WIN32_LOADER 1'
5600 _win32_emulation=yes
5601 else
5602 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
5603 res_comment="using native windows"
5605 codecmodules="win32 $codecmodules"
5606 else
5607 def_win32dll='#undef CONFIG_WIN32DLL'
5608 def_win32_loader='#undef WIN32_LOADER'
5609 nocodecmodules="win32 $nocodecmodules"
5611 echores "$_win32dll"
5614 echocheck "XAnim codecs"
5615 if test "$_xanim" = auto ; then
5616 _xanim=no
5617 res_comment="dynamic loader support needed"
5618 if test "$_dl" = yes ; then
5619 _xanim=yes
5622 if test "$_xanim" = yes ; then
5623 def_xanim='#define CONFIG_XANIM 1'
5624 codecmodules="xanim $codecmodules"
5625 else
5626 def_xanim='#undef CONFIG_XANIM'
5627 nocodecmodules="xanim $nocodecmodules"
5629 echores "$_xanim"
5632 echocheck "RealPlayer codecs"
5633 if test "$_real" = auto ; then
5634 _real=no
5635 res_comment="dynamic loader support needed"
5636 if test "$_dl" = yes || test "$_win32dll" = yes &&
5637 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
5638 _real=yes
5641 if test "$_real" = yes ; then
5642 def_real='#define CONFIG_REALCODECS 1'
5643 codecmodules="real $codecmodules"
5644 else
5645 def_real='#undef CONFIG_REALCODECS'
5646 nocodecmodules="real $nocodecmodules"
5648 echores "$_real"
5651 echocheck "QuickTime codecs"
5652 _qtx_emulation=no
5653 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
5654 if test "$_qtx" = auto ; then
5655 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
5657 if test "$_qtx" = yes ; then
5658 def_qtx='#define CONFIG_QTX_CODECS 1'
5659 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
5660 codecmodules="qtx $codecmodules"
5661 darwin || win32 || _qtx_emulation=yes
5662 else
5663 def_qtx='#undef CONFIG_QTX_CODECS'
5664 nocodecmodules="qtx $nocodecmodules"
5666 echores "$_qtx"
5668 echocheck "Nemesi Streaming Media libraries"
5669 if test "$_nemesi" = auto && test "$networking" = yes ; then
5670 _nemesi=no
5671 if pkg_config_add libnemesi ; then
5672 _nemesi=yes
5675 if test "$_nemesi" = yes; then
5676 _native_rtsp=no
5677 def_nemesi='#define CONFIG_LIBNEMESI 1'
5678 inputmodules="nemesi $inputmodules"
5679 else
5680 _native_rtsp="$networking"
5681 _nemesi=no
5682 def_nemesi='#undef CONFIG_LIBNEMESI'
5683 noinputmodules="nemesi $noinputmodules"
5685 echores "$_nemesi"
5687 echocheck "LIVE555 Streaming Media libraries"
5688 if test "$_live" != no && test "$networking" = yes ; then
5689 cat > $TMPCPP << EOF
5690 #include <liveMedia.hh>
5691 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
5692 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5693 #endif
5694 int main(void) { return 0; }
5697 _live=no
5698 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
5699 cxx_check $I/liveMedia/include $I/UsageEnvironment/include $I/groupsock/include &&
5700 _livelibdir=$(echo $I| sed s/-I//) &&
5701 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
5702 $_livelibdir/groupsock/libgroupsock.a \
5703 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
5704 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
5705 $extra_ldflags -lstdc++" \
5706 extra_cxxflags="-I$_livelibdir/liveMedia/include \
5707 -I$_livelibdir/UsageEnvironment/include \
5708 -I$_livelibdir/BasicUsageEnvironment/include \
5709 -I$_livelibdir/groupsock/include" &&
5710 _live=yes && break
5711 done
5712 if test "$_live" != yes ; then
5713 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
5714 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
5715 _live_dist=yes
5719 if test "$_live" = yes && test "$networking" = yes; then
5720 test $_livelibdir && res_comment="using $_livelibdir"
5721 def_live='#define CONFIG_LIVE555 1'
5722 inputmodules="live555 $inputmodules"
5723 elif test "$_live_dist" = yes && test "$networking" = yes; then
5724 res_comment="using distribution version"
5725 _live="yes"
5726 def_live='#define CONFIG_LIVE555 1'
5727 extra_ldflags="$extra_ldflags $ld_tmp"
5728 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
5729 inputmodules="live555 $inputmodules"
5730 else
5731 _live=no
5732 def_live='#undef CONFIG_LIVE555'
5733 noinputmodules="live555 $noinputmodules"
5735 echores "$_live"
5739 # Test with > against Libav 0.8 versions which will NOT work rather than
5740 # specify minimum version, to allow (future) point releases to possibly work.
5741 all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5742 echocheck "Libav ($all_libav_libs)"
5743 if test "$ffmpeg" = auto ; then
5744 IFS=":" # shell should not be used for programming
5745 if ! pkg_config_add $all_libav_libs ; then
5746 die "Unable to find development files for some of the required Libav libraries above. Aborting."
5749 echores "yes"
5751 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
5752 if ! test -z "$_ffmpeg_source" ; then
5753 def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
5756 echocheck "libpostproc >= 52.0.0"
5757 if test "$libpostproc" = auto ; then
5758 libpostproc=no
5759 if pkg_config_add "libpostproc >= 52.0.0" ; then
5760 libpostproc=yes
5763 if test "$libpostproc" = yes ; then
5764 def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
5765 else
5766 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
5768 echores "$libpostproc"
5771 echocheck "libdv-0.9.5+"
5772 if test "$_libdv" = auto ; then
5773 _libdv=no
5774 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
5776 if test "$_libdv" = yes ; then
5777 def_libdv='#define CONFIG_LIBDV095 1'
5778 extra_ldflags="$extra_ldflags -ldv"
5779 codecmodules="libdv $codecmodules"
5780 else
5781 def_libdv='#undef CONFIG_LIBDV095'
5782 nocodecmodules="libdv $nocodecmodules"
5784 echores "$_libdv"
5787 echocheck "Xvid"
5788 if test "$_xvid" = auto ; then
5789 _xvid=no
5790 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5791 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5792 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
5793 done
5796 if test "$_xvid" = yes ; then
5797 def_xvid='#define CONFIG_XVID4 1'
5798 codecmodules="xvid $codecmodules"
5799 else
5800 def_xvid='#undef CONFIG_XVID4'
5801 nocodecmodules="xvid $nocodecmodules"
5803 echores "$_xvid"
5806 echocheck "libnut"
5807 if test "$_libnut" = auto ; then
5808 _libnut=no
5809 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
5812 if test "$_libnut" = yes ; then
5813 def_libnut='#define CONFIG_LIBNUT 1'
5814 extra_ldflags="$extra_ldflags -lnut"
5815 else
5816 def_libnut='#undef CONFIG_LIBNUT'
5818 echores "$_libnut"
5820 # These VO checks must be done after the FFmpeg one
5821 echocheck "/dev/mga_vid"
5822 if test "$_mga" = auto ; then
5823 _mga=no
5824 test -c /dev/mga_vid && _mga=yes
5826 if test "$_mga" = yes ; then
5827 def_mga='#define CONFIG_MGA 1'
5828 vomodules="mga $vomodules"
5829 else
5830 def_mga='#undef CONFIG_MGA'
5831 novomodules="mga $novomodules"
5833 echores "$_mga"
5836 echocheck "xmga"
5837 if test "$_xmga" = auto ; then
5838 _xmga=no
5839 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
5841 if test "$_xmga" = yes ; then
5842 def_xmga='#define CONFIG_XMGA 1'
5843 vomodules="xmga $vomodules"
5844 else
5845 def_xmga='#undef CONFIG_XMGA'
5846 novomodules="xmga $novomodules"
5848 echores "$_xmga"
5851 echocheck "UnRAR executable"
5852 if test "$_unrar_exec" = auto ; then
5853 _unrar_exec="yes"
5854 mingw32 && _unrar_exec="no"
5856 if test "$_unrar_exec" = yes ; then
5857 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
5858 else
5859 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
5861 echores "$_unrar_exec"
5863 echocheck "TV interface"
5864 if test "$_tv" = yes ; then
5865 def_tv='#define CONFIG_TV 1'
5866 inputmodules="tv $inputmodules"
5867 else
5868 noinputmodules="tv $noinputmodules"
5869 def_tv='#undef CONFIG_TV'
5871 echores "$_tv"
5874 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
5875 echocheck "*BSD BT848 bt8xx header"
5876 _ioctl_bt848_h=no
5877 for file in "machine/ioctl_bt848.h" \
5878 "dev/bktr/ioctl_bt848.h" \
5879 "dev/video/bktr/ioctl_bt848.h" \
5880 "dev/ic/bt8xx.h" ; do
5881 cat > $TMPC <<EOF
5882 #include <sys/types.h>
5883 #include <sys/ioctl.h>
5884 #include <$file>
5885 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5887 if cc_check ; then
5888 _ioctl_bt848_h=yes
5889 _ioctl_bt848_h_name="$file"
5890 break;
5892 done
5893 if test "$_ioctl_bt848_h" = yes ; then
5894 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5895 res_comment="using $_ioctl_bt848_h_name"
5896 else
5897 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
5899 echores "$_ioctl_bt848_h"
5901 echocheck "*BSD ioctl_meteor.h"
5902 _ioctl_meteor_h=no
5903 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5904 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5905 _ioctl_meteor_h=yes && break
5906 done
5907 if test "$_ioctl_meteor_h" = yes ; then
5908 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5909 res_comment="using $ioctl_meteor_h_path"
5910 else
5911 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
5913 echores "$_ioctl_meteor_h"
5915 echocheck "*BSD BrookTree 848 TV interface"
5916 if test "$_tv_bsdbt848" = auto ; then
5917 _tv_bsdbt848=no
5918 if test "$_tv" = yes ; then
5919 cat > $TMPC <<EOF
5920 #include <sys/types.h>
5921 $def_ioctl_meteor_h_name
5922 $def_ioctl_bt848_h_name
5923 #ifdef IOCTL_METEOR_H_NAME
5924 #include IOCTL_METEOR_H_NAME
5925 #endif
5926 #ifdef IOCTL_BT848_H_NAME
5927 #include IOCTL_BT848_H_NAME
5928 #endif
5929 int main(void) {
5930 ioctl(0, METEORSINPUT, 0);
5931 ioctl(0, TVTUNER_GETFREQ, 0);
5932 return 0;
5935 cc_check && _tv_bsdbt848=yes
5938 if test "$_tv_bsdbt848" = yes ; then
5939 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
5940 inputmodules="tv-bsdbt848 $inputmodules"
5941 else
5942 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
5943 noinputmodules="tv-bsdbt848 $noinputmodules"
5945 echores "$_tv_bsdbt848"
5946 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5949 echocheck "DirectShow TV interface"
5950 if test "$_tv_dshow" = auto ; then
5951 _tv_dshow=no
5952 if test "$_tv" = yes && win32 ; then
5953 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
5956 if test "$_tv_dshow" = yes ; then
5957 inputmodules="tv-dshow $inputmodules"
5958 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
5959 extra_ldflags="$extra_ldflags -lole32 -luuid"
5960 else
5961 noinputmodules="tv-dshow $noinputmodules"
5962 def_tv_dshow='#undef CONFIG_TV_DSHOW'
5964 echores "$_tv_dshow"
5967 echocheck "Video 4 Linux TV interface"
5968 if test "$_tv_v4l1" = auto ; then
5969 _tv_v4l1=no
5970 if test "$_tv" = yes && linux ; then
5971 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
5974 if test "$_tv_v4l1" = yes ; then
5975 _audio_input=yes
5976 _tv_v4l=yes
5977 def_tv_v4l='#define CONFIG_TV_V4L 1'
5978 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
5979 inputmodules="tv-v4l $inputmodules"
5980 else
5981 noinputmodules="tv-v4l1 $noinputmodules"
5982 def_tv_v4l='#undef CONFIG_TV_V4L'
5984 echores "$_tv_v4l1"
5987 echocheck "Video 4 Linux 2 TV interface"
5988 if test "$_tv_v4l2" = auto ; then
5989 _tv_v4l2=no
5990 if test "$_tv" = yes && linux ; then
5991 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
5992 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5993 _tv_v4l2=yes
5996 if test "$_tv_v4l2" = yes ; then
5997 _audio_input=yes
5998 _tv_v4l=yes
5999 def_tv_v4l='#define CONFIG_TV_V4L 1'
6000 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
6001 inputmodules="tv-v4l2 $inputmodules"
6002 else
6003 noinputmodules="tv-v4l2 $noinputmodules"
6004 def_tv_v4l2='#undef CONFIG_TV_V4L2'
6006 echores "$_tv_v4l2"
6009 echocheck "Radio interface"
6010 if test "$_radio" = yes ; then
6011 def_radio='#define CONFIG_RADIO 1'
6012 inputmodules="radio $inputmodules"
6013 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
6014 _radio_capture=no
6016 if test "$_radio_capture" = yes ; then
6017 _audio_input=yes
6018 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
6019 else
6020 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6022 else
6023 noinputmodules="radio $noinputmodules"
6024 def_radio='#undef CONFIG_RADIO'
6025 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6026 _radio_capture=no
6028 echores "$_radio"
6029 echocheck "Capture for Radio interface"
6030 echores "$_radio_capture"
6032 echocheck "Video 4 Linux 2 Radio interface"
6033 if test "$_radio_v4l2" = auto ; then
6034 _radio_v4l2=no
6035 if test "$_radio" = yes && linux ; then
6036 header_check linux/videodev2.h && _radio_v4l2=yes
6039 if test "$_radio_v4l2" = yes ; then
6040 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
6041 else
6042 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
6044 echores "$_radio_v4l2"
6046 echocheck "Video 4 Linux Radio interface"
6047 if test "$_radio_v4l" = auto ; then
6048 _radio_v4l=no
6049 if test "$_radio" = yes && linux ; then
6050 header_check linux/videodev.h && _radio_v4l=yes
6053 if test "$_radio_v4l" = yes ; then
6054 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
6055 else
6056 def_radio_v4l='#undef CONFIG_RADIO_V4L'
6058 echores "$_radio_v4l"
6060 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
6061 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6062 echocheck "*BSD BrookTree 848 Radio interface"
6063 _radio_bsdbt848=no
6064 cat > $TMPC <<EOF
6065 #include <sys/types.h>
6066 $def_ioctl_bt848_h_name
6067 #ifdef IOCTL_BT848_H_NAME
6068 #include IOCTL_BT848_H_NAME
6069 #endif
6070 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
6072 cc_check && _radio_bsdbt848=yes
6073 echores "$_radio_bsdbt848"
6074 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
6076 if test "$_radio_bsdbt848" = yes ; then
6077 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
6078 else
6079 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
6082 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
6083 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6084 die "Radio driver requires BSD BT848, V4L or V4L2!"
6087 echocheck "Video 4 Linux 2 MPEG PVR interface"
6088 if test "$_pvr" = auto ; then
6089 _pvr=no
6090 if test "$_tv_v4l2" = yes && linux ; then
6091 cat > $TMPC <<EOF
6092 #include <sys/time.h>
6093 #include <linux/videodev2.h>
6094 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
6096 cc_check && _pvr=yes
6099 if test "$_pvr" = yes ; then
6100 def_pvr='#define CONFIG_PVR 1'
6101 inputmodules="pvr $inputmodules"
6102 else
6103 noinputmodules="pvr $noinputmodules"
6104 def_pvr='#undef CONFIG_PVR'
6106 echores "$_pvr"
6109 echocheck "ftp"
6110 if test "$_ftp" = "auto" ; then
6111 test "$networking" = "yes" && ! beos && _ftp=yes
6113 if test "$_ftp" = yes ; then
6114 def_ftp='#define CONFIG_FTP 1'
6115 inputmodules="ftp $inputmodules"
6116 else
6117 noinputmodules="ftp $noinputmodules"
6118 def_ftp='#undef CONFIG_FTP'
6120 echores "$_ftp"
6122 echocheck "vstream client"
6123 if test "$_vstream" = auto ; then
6124 _vstream=no
6125 cat > $TMPC <<EOF
6126 #include <vstream-client.h>
6127 void vstream_error(const char *format, ... ) {}
6128 int main(void) { vstream_start(); return 0; }
6130 cc_check -lvstream-client && _vstream=yes
6132 if test "$_vstream" = yes ; then
6133 def_vstream='#define CONFIG_VSTREAM 1'
6134 inputmodules="vstream $inputmodules"
6135 extra_ldflags="$extra_ldflags -lvstream-client"
6136 else
6137 noinputmodules="vstream $noinputmodules"
6138 def_vstream='#undef CONFIG_VSTREAM'
6140 echores "$_vstream"
6143 echocheck "Subtitles sorting"
6144 if test "$_sortsub" = yes ; then
6145 def_sortsub='#define CONFIG_SORTSUB 1'
6146 else
6147 def_sortsub='#undef CONFIG_SORTSUB'
6149 echores "$_sortsub"
6152 echocheck "XMMS inputplugin support"
6153 if test "$_xmms" = yes ; then
6154 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6155 _xmmsplugindir=$(xmms-config --input-plugin-dir)
6156 _xmmslibdir=$(xmms-config --exec-prefix)/lib
6157 else
6158 _xmmsplugindir=/usr/lib/xmms/Input
6159 _xmmslibdir=/usr/lib
6162 def_xmms='#define CONFIG_XMMS 1'
6163 if darwin ; then
6164 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6165 else
6166 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6168 else
6169 def_xmms='#undef CONFIG_XMMS'
6171 echores "$_xmms"
6173 if test "$_charset" != "noconv" ; then
6174 def_charset="#define MSG_CHARSET \"$_charset\""
6175 else
6176 def_charset="#undef MSG_CHARSET"
6177 _charset="UTF-8"
6180 #############################################################################
6182 echocheck "automatic gdb attach"
6183 if test "$_crash_debug" = yes ; then
6184 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
6185 else
6186 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
6187 _crash_debug=no
6189 echores "$_crash_debug"
6191 echocheck "compiler support for noexecstack"
6192 if cflag_check -Wl,-z,noexecstack ; then
6193 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
6194 echores "yes"
6195 else
6196 echores "no"
6199 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
6200 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6201 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6202 echores "yes"
6203 else
6204 echores "no"
6208 # Dynamic linking flags
6209 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6210 _ld_dl_dynamic=''
6211 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
6212 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! sunos; then
6213 _ld_dl_dynamic='-rdynamic'
6216 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6217 bsdos && extra_ldflags="$extra_ldflags -ldvd"
6218 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
6220 def_debug='#undef MP_DEBUG'
6221 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
6224 echocheck "joystick"
6225 def_joystick='#undef CONFIG_JOYSTICK'
6226 if test "$_joystick" = yes ; then
6227 if linux || freebsd ; then
6228 # TODO add some check
6229 def_joystick='#define CONFIG_JOYSTICK 1'
6230 else
6231 _joystick="no"
6232 res_comment="unsupported under $system_name"
6235 echores "$_joystick"
6237 echocheck "lirc"
6238 if test "$_lirc" = auto ; then
6239 _lirc=no
6240 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
6242 if test "$_lirc" = yes ; then
6243 def_lirc='#define CONFIG_LIRC 1'
6244 libs_mplayer="$libs_mplayer -llirc_client"
6245 else
6246 def_lirc='#undef CONFIG_LIRC'
6248 echores "$_lirc"
6250 echocheck "lircc"
6251 if test "$_lircc" = auto ; then
6252 _lircc=no
6253 header_check lirc/lircc.h -llircc && _lircc=yes
6255 if test "$_lircc" = yes ; then
6256 def_lircc='#define CONFIG_LIRCC 1'
6257 libs_mplayer="$libs_mplayer -llircc"
6258 else
6259 def_lircc='#undef CONFIG_LIRCC'
6261 echores "$_lircc"
6263 #############################################################################
6265 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
6267 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
6269 # This must be the last test to be performed. Any other tests following it
6270 # could fail due to linker errors. libdvdnavmini is intentionally not linked
6271 # against libdvdread (to permit MPlayer to use its own copy of the library).
6272 # So any compilation using the flags added here but not linking against
6273 # libdvdread can fail.
6274 echocheck "DVD support (libdvdnav)"
6275 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
6276 _dvdnav=no
6278 dvdnav_internal=no
6279 if test "$_dvdnav" = auto ; then
6280 if test "$_dvdread_internal" = yes ; then
6281 _dvdnav=yes
6282 dvdnav_internal=yes
6283 res_comment="internal"
6284 else
6285 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
6288 if test "$_dvdnav" = auto ; then
6289 _dvdnav=no
6290 _dvdnavdir=$($_dvdnavconfig --cflags)
6291 _dvdnavlibs=$($_dvdnavconfig --libs)
6292 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
6294 if test "$_dvdnav" = yes ; then
6295 def_dvdnav='#define CONFIG_DVDNAV 1'
6296 if test "$dvdnav_internal" = yes ; then
6297 cflags_libdvdnav="-Ilibdvdnav"
6298 inputmodules="dvdnav(internal) $inputmodules"
6299 else
6300 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
6301 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
6302 inputmodules="dvdnav $inputmodules"
6304 else
6305 def_dvdnav='#undef CONFIG_DVDNAV'
6306 noinputmodules="dvdnav $noinputmodules"
6308 echores "$_dvdnav"
6310 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
6311 # Read dvdnav comment above.
6313 mak_enable () {
6314 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6315 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6316 nprefix=$3;
6317 for part in $list; do
6318 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6319 echo "${nprefix}_$part = yes"
6321 done
6324 #############################################################################
6325 echo "Creating config.mak"
6326 cat > config.mak << EOF
6327 # -------- Generated by configure -----------
6329 # Ensure that locale settings do not interfere with shell commands.
6330 export LC_ALL = C
6332 CONFIGURATION = $configuration
6334 CHARSET = $_charset
6335 DOC_LANGS = $language_doc
6336 DOC_LANG_ALL = $doc_lang_all
6337 MAN_LANGS = $language_man
6338 MAN_LANG_ALL = $man_lang_all
6339 MSG_LANGS = $language_msg
6340 MSG_LANG_ALL = $msg_lang_all
6342 prefix = \$(DESTDIR)$_prefix
6343 BINDIR = \$(DESTDIR)$_bindir
6344 DATADIR = \$(DESTDIR)$_datadir
6345 LIBDIR = \$(DESTDIR)$_libdir
6346 MANDIR = \$(DESTDIR)$_mandir
6347 CONFDIR = \$(DESTDIR)$_confdir
6348 LOCALEDIR = \$(DESTDIR)$_localedir
6350 AR = $_ar
6351 AS = $_cc
6352 CC = $_cc
6353 CXX = $_cc
6354 HOST_CC = $_host_cc
6355 INSTALL = $_install
6356 INSTALLSTRIP = $_install_strip
6357 WINDRES = $_windres
6359 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
6360 CXXFLAGS = $WARNFLAGS $ERRORFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
6361 DEPFLAGS = $DEPFLAGS
6363 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
6364 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
6365 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
6366 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
6367 CFLAGS_STACKREALIGN = $cflags_stackrealign
6369 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
6370 EXTRALIBS_MPLAYER = $libs_mplayer
6372 GETCH = $_getch
6373 TIMER = $_timer
6375 EXESUF = $_exesuf
6376 EXESUFS_ALL = .exe
6378 ARCH = $arch
6379 $(mak_enable "$arch_all" "$arch" ARCH)
6380 $(mak_enable "$subarch_all" "$subarch" ARCH)
6381 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
6383 MPLAYER = $_mplayer
6385 NEED_GETTIMEOFDAY = $need_gettimeofday
6386 NEED_GLOB = $need_glob
6387 NEED_SETENV = $need_setenv
6388 NEED_SHMEM = $need_shmem
6389 NEED_STRSEP = $need_strsep
6390 NEED_SWAB = $need_swab
6391 NEED_VSSCANF = $need_vsscanf
6393 # features
6394 3DFX = $_3dfx
6395 AA = $_aa
6396 ALSA = $_alsa
6397 APPLE_IR = $_apple_ir
6398 APPLE_REMOTE = $_apple_remote
6399 ARTS = $_arts
6400 AUDIO_INPUT = $_audio_input
6401 BITMAP_FONT = $_bitmap_font
6402 BL = $_bl
6403 CACA = $_caca
6404 CDDA = $_cdda
6405 CDDB = $_cddb
6406 COCOA = $_cocoa
6407 COREAUDIO = $_coreaudio
6408 COREVIDEO = $_corevideo
6409 SHAREDBUFFER = $_sharedbuffer
6410 DGA = $_dga
6411 DIRECT3D = $_direct3d
6412 DIRECTFB = $_directfb
6413 DIRECTX = $_directx
6414 DVBIN = $_dvbin
6415 DVDNAV = $_dvdnav
6416 DVDNAV_INTERNAL = $dvdnav_internal
6417 DVDREAD = $_dvdread
6418 DVDREAD_INTERNAL = $_dvdread_internal
6419 DXR3 = $_dxr3
6420 ESD = $_esd
6421 FAAD = $_faad
6422 FASTMEMCPY = $_fastmemcpy
6423 FBDEV = $_fbdev
6424 FREETYPE = $_freetype
6425 FTP = $_ftp
6426 GIF = $_gif
6427 GGI = $_ggi
6428 GL = $_gl
6429 GL_COCOA = $_gl_cocoa
6430 GL_WIN32 = $_gl_win32
6431 GL_X11 = $_gl_x11
6432 GL_SDL = $_gl_sdl
6433 HAVE_POSIX_SELECT = $_posix_select
6434 HAVE_SYS_MMAN_H = $_mman
6435 IVTV = $_ivtv
6436 JACK = $_jack
6437 JOYSTICK = $_joystick
6438 JPEG = $_jpeg
6439 LADSPA = $_ladspa
6440 LIBA52 = $_liba52
6441 LIBASS = $_ass
6442 LIBBLURAY = $_bluray
6443 LIBBS2B = $_libbs2b
6444 LIBDCA = $_libdca
6445 LIBDV = $_libdv
6446 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
6447 LIBMAD = $_mad
6448 LIBNEMESI = $_nemesi
6449 LIBNUT = $_libnut
6450 LIBPOSTPROC = $libpostproc
6451 LIBSMBCLIENT = $_smb
6452 LIBTHEORA = $_theora
6453 LIRC = $_lirc
6454 LIVE555 = $_live
6455 MACOSX_FINDER = $_macosx_finder
6456 MD5SUM = $_md5sum
6457 MGA = $_mga
6458 MNG = $_mng
6459 MPG123 = $_mpg123
6460 MUSEPACK = $_musepack
6461 NAS = $_nas
6462 NATIVE_RTSP = $_native_rtsp
6463 NETWORKING = $networking
6464 OPENAL = $_openal
6465 OSS = $_ossaudio
6466 PE_EXECUTABLE = $_pe_executable
6467 PNG = $_png
6468 PNM = $_pnm
6469 PRIORITY = $_priority
6470 PULSE = $_pulse
6471 PVR = $_pvr
6472 QTX_CODECS = $_qtx
6473 QTX_CODECS_WIN32 = $_qtx_codecs_win32
6474 QTX_EMULATION = $_qtx_emulation
6475 RADIO=$_radio
6476 RADIO_CAPTURE=$_radio_capture
6477 REAL_CODECS = $_real
6478 RSOUND = $_rsound
6479 S3FB = $_s3fb
6480 SDL = $_sdl
6481 SPEEX = $_speex
6482 STREAM_CACHE = $_stream_cache
6483 SGIAUDIO = $_sgiaudio
6484 SUNAUDIO = $_sunaudio
6485 SVGA = $_svga
6486 TDFXFB = $_tdfxfb
6487 TDFXVID = $_tdfxvid
6488 TGA = $_tga
6489 TV = $_tv
6490 TV_BSDBT848 = $_tv_bsdbt848
6491 TV_DSHOW = $_tv_dshow
6492 TV_V4L = $_tv_v4l
6493 TV_V4L1 = $_tv_v4l1
6494 TV_V4L2 = $_tv_v4l2
6495 UNRAR_EXEC = $_unrar_exec
6496 V4L2 = $_v4l2
6497 VCD = $_vcd
6498 VDPAU = $_vdpau
6499 VESA = $_vesa
6500 VORBIS = $_vorbis
6501 VSTREAM = $_vstream
6502 WII = $_wii
6503 WIN32DLL = $_win32dll
6504 WIN32WAVEOUT = $_win32waveout
6505 WIN32_EMULATION = $_win32_emulation
6506 X11 = $_x11
6507 XANIM_CODECS = $_xanim
6508 XMGA = $_xmga
6509 XMMS_PLUGINS = $_xmms
6510 XV = $_xv
6511 XVID4 = $_xvid
6512 XVR100 = $_xvr100
6513 YUV4MPEG = $_yuv4mpeg
6515 # FFmpeg
6516 FFMPEG_INTERNALS = $ffmpeg_internals
6517 FFMPEG_SOURCE_PATH = $_ffmpeg_source
6519 RANLIB = $_ranlib
6520 YASM = $_yasm
6521 YASMFLAGS = $YASMFLAGS
6523 CONFIG_VDPAU = $_vdpau
6524 CONFIG_ZLIB = $_zlib
6526 HAVE_PTHREADS = $_pthreads
6527 HAVE_SHM = $_shm
6528 HAVE_W32THREADS = $_w32threads
6529 HAVE_YASM = $have_yasm
6533 #############################################################################
6535 ff_config_enable () {
6536 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6537 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6538 _nprefix=$3;
6539 test -z "$_nprefix" && _nprefix='CONFIG'
6540 for part in $list; do
6541 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6542 echo "#define ${_nprefix}_$part 1"
6543 else
6544 echo "#define ${_nprefix}_$part 0"
6546 done
6549 echo "Creating config.h"
6550 cat > $TMPH << EOF
6551 /*----------------------------------------------------------------------------
6552 ** This file has been automatically generated by configure any changes in it
6553 ** will be lost when you run configure again.
6554 ** Instead of modifying definitions here, use the --enable/--disable options
6555 ** of the configure script! See ./configure --help for details.
6556 *---------------------------------------------------------------------------*/
6558 #ifndef MPLAYER_CONFIG_H
6559 #define MPLAYER_CONFIG_H
6561 /* Undefine this if you do not want to select mono audio (left or right)
6562 with a stereo MPEG layer 2/3 audio stream. The command line option
6563 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6564 right-only), with 0 being the default.
6566 #define CONFIG_FAKE_MONO 1
6568 /* set up audio OUTBURST. Do not change this! */
6569 #define OUTBURST 512
6571 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
6572 #undef FAST_OSD
6573 #undef FAST_OSD_TABLE
6577 #define CONFIGURATION "$configuration"
6579 #define MPLAYER_DATADIR "$_datadir"
6580 #define MPLAYER_CONFDIR "$_confdir"
6581 #define MPLAYER_LOCALEDIR "$_localedir"
6583 $def_translation
6585 /* definitions needed by included libraries */
6586 #define HAVE_INTTYPES_H 1
6587 /* libdvdcss */
6588 #define HAVE_ERRNO_H 1
6589 /* libdvdcss + libdvdread */
6590 #define HAVE_LIMITS_H 1
6591 /* libdvdcss */
6592 #define HAVE_UNISTD_H 1
6593 /* libdvdread */
6594 #define STDC_HEADERS 1
6595 #define HAVE_MEMCPY 1
6596 /* libdvdnav */
6597 #define READ_CACHE_TRACE 0
6598 /* libdvdread */
6599 #define HAVE_DLFCN_H 1
6600 $def_dvdcss
6603 /* system headers */
6604 $def_alloca_h
6605 $def_altivec_h
6606 $def_malloc_h
6607 $def_mman_h
6608 $def_mman_has_map_failed
6609 $def_soundcard_h
6610 $def_sys_soundcard_h
6611 $def_sys_sysinfo_h
6612 $def_sys_videoio_h
6613 $def_termios_h
6614 $def_termios_sys_h
6615 $def_winsock2_h
6618 /* system functions */
6619 $def_gethostbyname2
6620 $def_gettimeofday
6621 $def_glob
6622 $def_langinfo
6623 $def_lrintf
6624 $def_map_memalign
6625 $def_memalign
6626 $def_nanosleep
6627 $def_posix_select
6628 $def_select
6629 $def_setenv
6630 $def_setmode
6631 $def_shm
6632 $def_strsep
6633 $def_swab
6634 $def_sysi86
6635 $def_sysi86_iv
6636 $def_termcap
6637 $def_termios
6638 $def_vsscanf
6641 /* system-specific features */
6642 $def_asmalign_pot
6643 $def_builtin_expect
6644 $def_dl
6645 $def_dos_paths
6646 $def_extern_asm
6647 $def_extern_prefix
6648 $def_iconv
6649 $def_kstat
6650 $def_macosx_bundle
6651 $def_macosx_finder
6652 $def_priority
6653 $def_quicktime
6654 $def_restrict_keyword
6655 $def_rtc
6656 $def_unrar_exec
6659 /* configurable options */
6660 $def_charset
6661 $def_crash_debug
6662 $def_debug
6663 $def_fastmemcpy
6664 $def_runtime_cpudetection
6665 $def_sighandler
6666 $def_sortsub
6667 $def_stream_cache
6668 $def_pthread_cache
6671 /* CPU stuff */
6672 #define __CPU__ $iproc
6673 $def_ebx_available
6674 $def_words_endian
6675 $def_bigendian
6676 $(ff_config_enable "$arch_all" "$arch" "ARCH")
6677 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
6678 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
6681 /* Blu-ray/DVD/VCD/CD */
6682 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
6683 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
6684 $def_bluray
6685 $def_bsdi_dvd
6686 $def_cddb
6687 $def_cdio
6688 $def_cdparanoia
6689 $def_cdrom
6690 $def_dvd
6691 $def_dvd_bsd
6692 $def_dvd_darwin
6693 $def_dvd_linux
6694 $def_dvd_openbsd
6695 $def_dvdio
6696 $def_dvdnav
6697 $def_dvdread
6698 $def_hpux_scsi_h
6699 $def_libcdio
6700 $def_sol_scsi_h
6701 $def_vcd
6704 /* codec libraries */
6705 $def_faad
6706 $def_liba52
6707 $def_libdca
6708 $def_libdv
6709 $def_mad
6710 $def_mpg123
6711 $def_musepack
6712 $def_speex
6713 $def_theora
6714 $def_tremor
6715 $def_vorbis
6716 $def_xvid
6717 $def_zlib
6719 $def_libpostproc
6720 $def_libnut
6723 /* binary codecs */
6724 $def_qtx
6725 $def_qtx_win32
6726 $def_real
6727 $def_win32_loader
6728 $def_win32dll
6729 $def_xanim
6730 $def_xmms
6731 #define BINARY_CODECS_PATH "$_codecsdir"
6732 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
6735 /* Audio output drivers */
6736 $def_alsa
6737 $def_arts
6738 $def_coreaudio
6739 $def_esd
6740 $def_esd_latency
6741 $def_jack
6742 $def_nas
6743 $def_openal
6744 $def_openal_h
6745 $def_ossaudio
6746 $def_ossaudio_devdsp
6747 $def_ossaudio_devmixer
6748 $def_pulse
6749 $def_rsound
6750 $def_sgiaudio
6751 $def_sunaudio
6752 $def_win32waveout
6754 $def_ladspa
6755 $def_libbs2b
6758 /* input */
6759 $def_apple_ir
6760 $def_apple_remote
6761 $def_ioctl_bt848_h_name
6762 $def_ioctl_meteor_h_name
6763 $def_joystick
6764 $def_lirc
6765 $def_lircc
6766 $def_pvr
6767 $def_radio
6768 $def_radio_bsdbt848
6769 $def_radio_capture
6770 $def_radio_v4l
6771 $def_radio_v4l2
6772 $def_tv
6773 $def_tv_bsdbt848
6774 $def_tv_dshow
6775 $def_tv_v4l
6776 $def_tv_v4l1
6777 $def_tv_v4l2
6780 /* font stuff */
6781 $def_ass
6782 $def_bitmap_font
6783 $def_enca
6784 $def_fontconfig
6785 $def_freetype
6786 $def_fribidi
6789 /* networking */
6790 $def_closesocket
6791 $def_ftp
6792 $def_inet6
6793 $def_inet_aton
6794 $def_inet_pton
6795 $def_live
6796 $def_nemesi
6797 $def_networking
6798 $def_smb
6799 $def_socklen_t
6800 $def_vstream
6803 /* libvo options */
6804 $def_3dfx
6805 $def_aa
6806 $def_bl
6807 $def_caca
6808 $def_corevideo
6809 $def_cocoa
6810 $def_sharedbuffer
6811 $def_dga
6812 $def_dga1
6813 $def_dga2
6814 $def_direct3d
6815 $def_directfb
6816 $def_directx
6817 $def_dvb
6818 $def_dvbin
6819 $def_dxr3
6820 $def_fbdev
6821 $def_ggi
6822 $def_ggiwmh
6823 $def_gif
6824 $def_gif_4
6825 $def_gif_tvt_hack
6826 $def_gl
6827 $def_gl_cocoa
6828 $def_gl_win32
6829 $def_gl_x11
6830 $def_gl_sdl
6831 $def_ivtv
6832 $def_jpeg
6833 $def_md5sum
6834 $def_mga
6835 $def_mng
6836 $def_png
6837 $def_pnm
6838 $def_s3fb
6839 $def_sdl
6840 $def_sdl_sdl_h
6841 $def_svga
6842 $def_tdfxfb
6843 $def_tdfxvid
6844 $def_tga
6845 $def_v4l2
6846 $def_vdpau
6847 $def_vesa
6848 $def_vm
6849 $def_wii
6850 $def_x11
6851 $def_xdpms
6852 $def_xf86keysym
6853 $def_xinerama
6854 $def_xmga
6855 $def_xss
6856 $def_xv
6857 $def_xvr100
6858 $def_yuv4mpeg
6861 /* FFmpeg */
6862 $def_ffmpeg_internals
6864 $def_arpa_inet_h
6865 $def_bswap
6866 $def_dcbzl
6867 $def_exp2
6868 $def_exp2f
6869 $def_fast_64bit
6870 $def_fast_unaligned
6871 $def_llrint
6872 $def_log2
6873 $def_log2f
6874 $def_lrint
6875 $def_memalign_hack
6876 $def_mkstemp
6877 $def_posix_memalign
6878 $def_pthreads
6879 $def_round
6880 $def_roundf
6881 $def_threads
6882 $def_truncf
6883 $def_xform_asm
6884 $def_yasm
6886 #define HAVE_INLINE_ASM 1
6888 /* Use these registers in x86 inline asm. No proper detection yet. */
6889 #define HAVE_EBP_AVAILABLE 1
6891 #endif /* MPLAYER_CONFIG_H */
6894 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6895 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
6897 #############################################################################
6899 cat << EOF
6901 Config files successfully generated by ./configure $configuration !
6903 Install prefix: $_prefix
6904 Data directory: $_datadir
6905 Config direct.: $_confdir
6907 Byte order: $_byte_order
6908 Optimizing for: $_optimizing
6910 Languages:
6911 Messages (in addition to English): $language_msg
6912 Manual pages: $language_man
6913 Documentation: $language_doc
6915 Enabled optional drivers:
6916 Input: $inputmodules
6917 Codecs: $codecmodules
6918 Audio output: $aomodules
6919 Video output: $vomodules
6921 Disabled optional drivers:
6922 Input: $noinputmodules
6923 Codecs: $nocodecmodules
6924 Audio output: $noaomodules
6925 Video output: $novomodules
6927 'config.h' and 'config.mak' contain your configuration options.
6928 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6929 compile *** DO NOT REPORT BUGS if you tweak these files ***
6931 'make' will now compile MPlayer and 'make install' will install it.
6932 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6937 cat <<EOF
6938 Check $TMPLOG if you wonder why an autodetection failed (make sure
6939 development headers/packages are installed).
6941 NOTE: The --enable-* parameters unconditionally force options on, completely
6942 skipping autodetection. This behavior is unlike what you may be used to from
6943 autoconf-based configure scripts that can decide to override you. This greater
6944 level of control comes at a price. You may have to provide the correct compiler
6945 and linker flags yourself.
6946 If you used one of these options (except --enable-runtime-cpudetection and
6947 similar ones that turn on internal features) and experience a compilation or
6948 linking failure, make sure you have passed the necessary compiler/linker flags
6949 to configure.
6951 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6955 if test "$warn_cflags" = yes; then
6956 cat <<EOF
6958 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6959 but:
6961 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6963 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6964 To do so, execute 'CFLAGS= ./configure <options>'
6969 # Last move:
6970 rm -rf "$mplayer_tmpdir"