configure: prefer libvorbis to libvorbisidec/tremor
[mplayer/greg.git] / configure
blob0fe2e64f067d47ab08b9f79570066ffbef1957c4
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 tmp_run() {
169 "$TMPEXE" >> "$TMPLOG" 2>&1
172 # Display error message, flushes tempfile, exit
173 die () {
174 echo
175 echo "Error: $@" >&2
176 echo >&2
177 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
178 echo "Check \"$TMPLOG\" if you do not understand why it failed."
179 exit 1
182 # OS test booleans functions
183 issystem() {
184 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
186 aix() { issystem "AIX"; }
187 amigaos() { issystem "AmigaOS"; }
188 beos() { issystem "BEOS"; }
189 bsdos() { issystem "BSD/OS"; }
190 cygwin() { issystem "CYGWIN"; }
191 darwin() { issystem "Darwin"; }
192 dragonfly() { issystem "DragonFly"; }
193 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
194 gnu() { issystem "GNU"; }
195 hpux() { issystem "HP-UX"; }
196 irix() { issystem "IRIX"; }
197 linux() { issystem "Linux"; }
198 mingw32() { issystem "MINGW32"; }
199 morphos() { issystem "MorphOS"; }
200 netbsd() { issystem "NetBSD"; }
201 openbsd() { issystem "OpenBSD"; }
202 os2() { issystem "OS/2"; }
203 qnx() { issystem "QNX"; }
204 sunos() { issystem "SunOS"; }
205 win32() { cygwin || mingw32; }
207 # arch test boolean functions
208 # x86/x86pc is used by QNX
209 x86_32() {
210 case "$host_arch" in
211 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
212 *) return 1 ;;
213 esac
216 x86_64() {
217 case "$host_arch" in
218 x86_64|amd64) return 0 ;;
219 *) return 1 ;;
220 esac
223 x86() {
224 x86_32 || x86_64
227 ppc() {
228 case "$host_arch" in
229 ppc|ppc64|powerpc|powerpc64) return 0;;
230 *) return 1;;
231 esac
234 alpha() {
235 case "$host_arch" in
236 alpha*) return 0;;
237 *) return 1;;
238 esac
241 arm() {
242 case "$host_arch" in
243 arm*) return 0;;
244 *) return 1;;
245 esac
248 # Use this before starting a check
249 echocheck() {
250 echo "============ Checking for $@ ============" >> "$TMPLOG"
251 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
254 # Use this to echo the results of a check
255 echores() {
256 if test "$res_comment" ; then
257 res_comment="($res_comment)"
259 echo "Result is: $@ $res_comment" >> "$TMPLOG"
260 echo "##########################################" >> "$TMPLOG"
261 echo "" >> "$TMPLOG"
262 echo "$@ $res_comment"
263 res_comment=""
265 #############################################################################
267 # Check how echo works in this /bin/sh
268 case $(echo -n) in
269 -n) _echo_n= _echo_c='\c' ;; # SysV echo
270 *) _echo_n='-n ' _echo_c= ;; # BSD echo
271 esac
273 msg_lang_all=''
274 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
275 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")
276 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
278 show_help(){
279 cat << EOF
280 Usage: $0 [OPTIONS]...
282 Configuration:
283 -h, --help display this help and exit
285 Installation directories:
286 --prefix=DIR prefix directory for installation [/usr/local]
287 --bindir=DIR directory for installing binaries [PREFIX/bin]
288 --datadir=DIR directory for installing machine independent
289 data files (skins, etc) [PREFIX/share/mplayer]
290 --mandir=DIR directory for installing man pages [PREFIX/share/man]
291 --confdir=DIR directory for installing configuration files
292 [PREFIX/etc/mplayer]
293 --localedir=DIR directory for locale tree [PREFIX/share/locale]
294 --libdir=DIR directory for object code libraries [PREFIX/lib]
295 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
297 Optional features:
298 --disable-mplayer disable MPlayer compilation [enable]
299 --disable-largefiles disable support for files > 2GB [enable]
300 --enable-termcap use termcap database for key codes [autodetect]
301 --enable-termios use termios database for key codes [autodetect]
302 --disable-iconv disable iconv for encoding conversion [autodetect]
303 --disable-langinfo do not use langinfo [autodetect]
304 --enable-lirc enable LIRC (remote control) support [autodetect]
305 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
306 --enable-joystick enable joystick support [disable]
307 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
308 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
309 --disable-vm disable X video mode extensions [autodetect]
310 --disable-xf86keysym disable support for multimedia keys [autodetect]
311 --enable-radio enable radio interface [disable]
312 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
313 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
314 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
315 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
316 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
317 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
318 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
319 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
320 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
321 --disable-networking disable networking [enable]
322 --enable-winsock2_h enable winsock2_h [autodetect]
323 --enable-smb enable Samba (SMB) input [autodetect]
324 --enable-live enable LIVE555 Streaming Media [autodetect]
325 --enable-nemesi enable Nemesi Streaming Media [autodetect]
326 --disable-vcd disable VCD support [autodetect]
327 --disable-bluray disable Blu-ray support [autodetect]
328 --disable-dvdnav disable libdvdnav [autodetect]
329 --disable-dvdread disable libdvdread [autodetect]
330 --disable-dvdread-internal disable internal libdvdread [autodetect]
331 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
332 --disable-cdparanoia disable cdparanoia [autodetect]
333 --disable-cddb disable cddb [autodetect]
334 --disable-bitmap-font disable bitmap font support [enable]
335 --disable-freetype disable FreeType 2 font rendering [autodetect]
336 --disable-fontconfig disable fontconfig font lookup [autodetect]
337 --disable-unrarexec disable using of UnRAR executable [enabled]
338 --enable-menu enable OSD menu (not DVD menu) [disabled]
339 --disable-sortsub disable subtitle sorting [enabled]
340 --enable-fribidi enable the FriBiDi libs [autodetect]
341 --disable-enca disable ENCA charset oracle library [autodetect]
342 --disable-maemo disable maemo specific features [autodetect]
343 --enable-macosx-finder enable Mac OS X Finder invocation parameter
344 parsing [disabled]
345 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
346 --disable-inet6 disable IPv6 support [autodetect]
347 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
348 --disable-ftp disable FTP support [enabled]
349 --disable-vstream disable TiVo vstream client support [autodetect]
350 --disable-pthreads disable Posix threads support [autodetect]
351 --disable-w32threads disable Win32 threads support [autodetect]
352 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
353 --enable-rpath enable runtime linker path for extra libs [disabled]
355 Codecs:
356 --enable-gif enable GIF support [autodetect]
357 --enable-png enable PNG input/output support [autodetect]
358 --enable-mng enable MNG input support [autodetect]
359 --enable-jpeg enable JPEG input/output support [autodetect]
360 --enable-libcdio enable libcdio support [autodetect]
361 --enable-liblzo enable liblzo support [autodetect]
362 --disable-win32dll disable Win32 DLL support [autodetect]
363 --disable-qtx disable QuickTime codecs support [enabled]
364 --disable-xanim disable XAnim codecs support [enabled]
365 --disable-real disable RealPlayer codecs support [enabled]
366 --disable-xvid disable Xvid [autodetect]
367 --disable-libnut disable libnut [autodetect]
368 --disable-ffmpeg disable FFmpeg [autodetect]
369 --disable-libvorbis disable libvorbis support [autodetect]
370 --disable-tremor disable Tremor [autodetect if no libvorbis]
371 --disable-speex disable Speex support [autodetect]
372 --enable-theora enable OggTheora libraries [autodetect]
373 --enable-faad enable FAAD2 (AAC) [autodetect]
374 --disable-ladspa disable LADSPA plugin support [autodetect]
375 --disable-libbs2b disable libbs2b audio filter support [autodetect]
376 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
377 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
378 --disable-mad disable libmad (MPEG audio) support [autodetect]
379 --enable-xmms enable XMMS input plugin support [disabled]
380 --enable-libdca enable libdca support [autodetect]
381 --disable-mp3lib disable builtin mp3lib [autodetect]
382 --disable-liba52 disable liba52 [autodetect]
383 --disable-musepack disable musepack support [autodetect]
385 Video output:
386 --enable-gl enable OpenGL video output [autodetect]
387 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
388 --enable-dga2 enable DGA 2 support [autodetect]
389 --enable-dga1 enable DGA 1 support [autodetect]
390 --enable-vesa enable VESA video output [autodetect]
391 --enable-svga enable SVGAlib video output [autodetect]
392 --enable-sdl enable SDL video output [autodetect]
393 --enable-kva enable KVA video output [autodetect]
394 --enable-aa enable AAlib video output [autodetect]
395 --enable-caca enable CACA video output [autodetect]
396 --enable-ggi enable GGI video output [autodetect]
397 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
398 --enable-direct3d enable Direct3D video output [autodetect]
399 --enable-directx enable DirectX video output [autodetect]
400 --enable-dxr3 enable DXR3/H+ video output [autodetect]
401 --enable-ivtv enable IVTV TV-Out video output [autodetect]
402 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
403 --enable-dvb enable DVB video output [autodetect]
404 --enable-mga enable mga_vid video output [autodetect]
405 --enable-xmga enable mga_vid X11 video output [autodetect]
406 --enable-xv enable Xv video output [autodetect]
407 --enable-xvmc enable XvMC acceleration [disable]
408 --enable-vdpau enable VDPAU acceleration [autodetect]
409 --enable-vm enable XF86VidMode support [autodetect]
410 --enable-xinerama enable Xinerama support [autodetect]
411 --enable-x11 enable X11 video output [autodetect]
412 --enable-xshape enable XShape support [autodetect]
413 --disable-xss disable screensaver support via xss [autodetect]
414 --enable-fbdev enable FBDev video output [autodetect]
415 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
416 --enable-tdfxfb enable tdfxfb video output [disable]
417 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
418 --enable-wii enable Nintendo Wii/GameCube video output [disable]
419 --enable-directfb enable DirectFB video output [autodetect]
420 --enable-bl enable Blinkenlights video output [disable]
421 --enable-tdfxvid enable tdfx_vid video output [disable]
422 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
423 --disable-tga disable Targa video output [enable]
424 --disable-pnm disable PNM video output [enable]
425 --disable-md5sum disable md5sum video output [enable]
426 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
427 --disable-corevideo disable CoreVideo video output [autodetect]
428 --disable-quartz disable Quartz video output [autodetect]
430 Audio output:
431 --disable-alsa disable ALSA audio output [autodetect]
432 --disable-ossaudio disable OSS audio output [autodetect]
433 --disable-arts disable aRts audio output [autodetect]
434 --disable-esd disable esd audio output [autodetect]
435 --disable-pulse disable Pulseaudio audio output [autodetect]
436 --disable-jack disable JACK audio output [autodetect]
437 --enable-openal enable OpenAL audio output [disable]
438 --disable-nas disable NAS audio output [autodetect]
439 --disable-sgiaudio disable SGI audio output [autodetect]
440 --disable-sunaudio disable Sun audio output [autodetect]
441 --disable-kai disable KAI audio output [autodetect]
442 --disable-dart disable DART audio output [autodetect]
443 --disable-win32waveout disable Windows waveout audio output [autodetect]
444 --disable-coreaudio disable CoreAudio audio output [autodetect]
445 --disable-select disable using select() on the audio device [enable]
447 Language options:
448 --enable-translation enable support for translated output [disable]
449 --charset=charset convert the console messages to this character set
450 --language-doc=lang language to use for the documentation [en]
451 --language-man=lang language to use for the man pages [en]
452 --language-msg=lang extra languages for program messages [all]
453 --language=lang default language to use [en]
454 Specific options override --language. You can pass a list of languages separated
455 by whitespace or commas instead of a single language. Nonexisting translations
456 will be dropped from each list. All translations available in the list will be
457 installed. The value "all" will activate all translations. The LINGUAS
458 environment variable is honored. In all cases the fallback is English.
459 The program always supports English-language output; additional message
460 languages are only installed if --enable-translation is also specified.
461 Available values for --language-doc are: all $doc_lang_all
462 Available values for --language-man are: all $man_lang_all
463 Available values for --language-msg are: all $msg_lang_all
465 Miscellaneous options:
466 --enable-runtime-cpudetection enable runtime CPU detection [disable]
467 --enable-cross-compile enable cross-compilation [autodetect]
468 --cc=COMPILER C compiler to build MPlayer [gcc]
469 --host-cc=COMPILER C compiler for tools needed while building [gcc]
470 --as=ASSEMBLER assembler to build MPlayer [as]
471 --nm=NM nm tool to build MPlayer [nm]
472 --yasm=YASM Yasm assembler to build MPlayer [yasm]
473 --ar=AR librarian to build MPlayer [ar]
474 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
475 --windres=WINDRES windres to build MPlayer [windres]
476 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
477 --enable-static build a statically linked binary
478 --with-install=PATH path to a custom install program
480 Advanced options:
481 --enable-mmx enable MMX [autodetect]
482 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
483 --enable-3dnow enable 3DNow! [autodetect]
484 --enable-3dnowext enable extended 3DNow! [autodetect]
485 --enable-sse enable SSE [autodetect]
486 --enable-sse2 enable SSE2 [autodetect]
487 --enable-ssse3 enable SSSE3 [autodetect]
488 --enable-shm enable shm [autodetect]
489 --enable-altivec enable AltiVec (PowerPC) [autodetect]
490 --enable-armv5te enable DSP extensions (ARM) [autodetect]
491 --enable-armv6 enable ARMv6 (ARM) [autodetect]
492 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
493 --enable-armvfp enable ARM VFP (ARM) [autodetect]
494 --enable-neon enable NEON (ARM) [autodetect]
495 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
496 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
497 --enable-big-endian force byte order to big-endian [autodetect]
498 --enable-debug[=1-3] compile-in debugging information [disable]
499 --enable-profile compile-in profiling information [disable]
500 --disable-sighandler disable sighandler for crashes [enable]
501 --enable-crash-debug enable automatic gdb attach on crash [disable]
502 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
503 --ffmpeg-source-dir=PATH enable features requiring internal FFmpeg headers
505 Use these options if autodetection fails:
506 --extra-cflags=FLAGS extra CFLAGS
507 --extra-ldflags=FLAGS extra LDFLAGS
508 --extra-libs=FLAGS extra linker flags
509 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
510 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
512 --with-freetype-config=PATH path to freetype-config
513 --with-glib-config=PATH path to glib*-config
514 --with-gtk-config=PATH path to gtk*-config
515 --with-sdl-config=PATH path to sdl*-config
516 --with-dvdnav-config=PATH path to dvdnav-config
517 --with-dvdread-config=PATH path to dvdread-config
519 This configure script is NOT autoconf-based, even though its output is similar.
520 It will try to autodetect all configuration options. If you --enable an option
521 it will be forcefully turned on, skipping autodetection. This can break
522 compilation, so you need to know what you are doing.
524 exit 0
525 } #show_help()
527 # GOTCHA: the variables below defines the default behavior for autodetection
528 # and have - unless stated otherwise - at least 2 states : yes no
529 # If autodetection is available then the third state is: auto
530 _mmx=auto
531 _3dnow=auto
532 _3dnowext=auto
533 _mmxext=auto
534 _sse=auto
535 _sse2=auto
536 _ssse3=auto
537 _cmov=auto
538 _fast_cmov=auto
539 _fast_clz=auto
540 _armv5te=auto
541 _armv6=auto
542 _armv6t2=auto
543 _armvfp=auto
544 neon=auto
545 _iwmmxt=auto
546 _mtrr=auto
547 _altivec=auto
548 _install=install
549 _ranlib=ranlib
550 _windres=windres
551 _cc=cc
552 _ar=ar
553 test "$CC" && _cc="$CC"
554 _as=auto
555 _nm=auto
556 _yasm=yasm
557 _runtime_cpudetection=no
558 _cross_compile=auto
559 _prefix="/usr/local"
560 ffmpeg=auto
561 ffmpeg_internals=no
562 _mplayer=yes
563 _x11=auto
564 _xshape=auto
565 _xss=auto
566 _dga1=auto
567 _dga2=auto
568 _xv=auto
569 _xvmc=no #auto when complete
570 _vdpau=auto
571 _sdl=auto
572 _kva=auto
573 _direct3d=auto
574 _directx=auto
575 _win32waveout=auto
576 _nas=auto
577 _png=auto
578 _mng=auto
579 _jpeg=auto
580 _pnm=yes
581 _md5sum=yes
582 _yuv4mpeg=yes
583 _gif=auto
584 _gl=auto
585 matrixview=yes
586 _ggi=auto
587 _ggiwmh=auto
588 _aa=auto
589 _caca=auto
590 _svga=auto
591 _vesa=auto
592 _fbdev=auto
593 _dvb=auto
594 _dxr3=auto
595 _ivtv=auto
596 _v4l2=auto
597 _iconv=auto
598 _langinfo=auto
599 _rtc=auto
600 _ossaudio=auto
601 _arts=auto
602 _esd=auto
603 _pulse=auto
604 _jack=auto
605 _kai=auto
606 _dart=auto
607 _openal=no
608 _libcdio=auto
609 _liblzo=auto
610 _mad=auto
611 _tremor=auto
612 _libvorbis=auto
613 _speex=auto
614 _theora=auto
615 _mpg123=auto
616 _mp3lib=auto
617 _liba52=auto
618 _libdca=auto
619 _faad=auto
620 _ladspa=auto
621 _libbs2b=auto
622 _xmms=no
623 _vcd=auto
624 _bluray=auto
625 _dvdnav=auto
626 _dvdnavconfig=dvdnav-config
627 _dvdreadconfig=dvdread-config
628 _dvdread=auto
629 _dvdread_internal=auto
630 _libdvdcss_internal=auto
631 _xanim=auto
632 _real=auto
633 _live=auto
634 _nemesi=auto
635 _native_rtsp=yes
636 _xinerama=auto
637 _mga=auto
638 _xmga=auto
639 _vm=auto
640 _xf86keysym=auto
641 _sgiaudio=auto
642 _sunaudio=auto
643 _alsa=auto
644 _fastmemcpy=yes
645 _unrar_exec=auto
646 _win32dll=auto
647 _select=yes
648 _radio=no
649 _radio_capture=no
650 _radio_v4l=auto
651 _radio_v4l2=auto
652 _radio_bsdbt848=auto
653 _tv=yes
654 _tv_v4l1=auto
655 _tv_v4l2=auto
656 _tv_bsdbt848=auto
657 _tv_dshow=auto
658 _pvr=auto
659 networking=yes
660 _winsock2_h=auto
661 _smb=auto
662 _joystick=no
663 _xvid=auto
664 _libnut=auto
665 _lirc=auto
666 _lircc=auto
667 _apple_remote=auto
668 _apple_ir=auto
669 _gui=no
670 _gtk1=no
671 _termcap=auto
672 _termios=auto
673 _3dfx=no
674 _s3fb=no
675 _wii=no
676 _tdfxfb=no
677 _tdfxvid=no
678 _xvr100=auto
679 _tga=yes
680 _directfb=auto
681 _bl=no
682 _largefiles=yes
683 #language=en
684 _shm=auto
685 _translation=no
686 _charset="UTF-8"
687 _dynamic_plugins=no
688 _crash_debug=no
689 _sighandler=yes
690 _libdv=auto
691 _cdparanoia=auto
692 _cddb=auto
693 _big_endian=auto
694 _bitmap_font=yes
695 _freetype=auto
696 _fontconfig=auto
697 _menu=no
698 _qtx=auto
699 _maemo=auto
700 _coreaudio=auto
701 _corevideo=auto
702 _quartz=auto
703 quicktime=auto
704 _macosx_finder=no
705 _macosx_bundle=auto
706 _sortsub=yes
707 _freetypeconfig='freetype-config'
708 _fribidi=auto
709 _enca=auto
710 _inet6=auto
711 _gethostbyname2=auto
712 _ftp=auto
713 _musepack=auto
714 _vstream=auto
715 _pthreads=auto
716 _w32threads=auto
717 _ass=auto
718 _rpath=no
719 _asmalign_pot=auto
720 _stream_cache=yes
721 _priority=no
722 def_dos_paths="#define HAVE_DOS_PATHS 0"
723 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
724 def_priority="#undef CONFIG_PRIORITY"
725 def_pthread_cache="#undef PTHREAD_CACHE"
726 need_shmem=yes
727 for ac_option do
728 case "$ac_option" in
729 --help|-help|-h)
730 show_help
732 --prefix=*)
733 _prefix=$(echo $ac_option | cut -d '=' -f 2)
735 --bindir=*)
736 _bindir=$(echo $ac_option | cut -d '=' -f 2)
738 --datadir=*)
739 _datadir=$(echo $ac_option | cut -d '=' -f 2)
741 --mandir=*)
742 _mandir=$(echo $ac_option | cut -d '=' -f 2)
744 --confdir=*)
745 _confdir=$(echo $ac_option | cut -d '=' -f 2)
747 --libdir=*)
748 _libdir=$(echo $ac_option | cut -d '=' -f 2)
750 --codecsdir=*)
751 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
753 --localedir=*)
754 _localedir=$(echo $ac_option | cut -d '=' -f 2)
757 --with-install=*)
758 _install=$(echo $ac_option | cut -d '=' -f 2 )
760 --with-xvmclib=*)
761 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
764 --with-sdl-config=*)
765 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
767 --with-freetype-config=*)
768 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
770 --with-gtk-config=*)
771 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
773 --with-glib-config=*)
774 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
776 --with-dvdnav-config=*)
777 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
779 --with-dvdread-config=*)
780 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
783 --extra-cflags=*)
784 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
786 --extra-ldflags=*)
787 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
789 --extra-libs=*)
790 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
792 --extra-libs-mplayer=*)
793 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
796 --target=*)
797 _target=$(echo $ac_option | cut -d '=' -f 2)
799 --cc=*)
800 _cc=$(echo $ac_option | cut -d '=' -f 2)
802 --host-cc=*)
803 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
805 --as=*)
806 _as=$(echo $ac_option | cut -d '=' -f 2)
808 --nm=*)
809 _nm=$(echo $ac_option | cut -d '=' -f 2)
811 --yasm=*)
812 _yasm=$(echo $ac_option | cut -d '=' -f 2)
814 --ar=*)
815 _ar=$(echo $ac_option | cut -d '=' -f 2)
817 --ranlib=*)
818 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
820 --windres=*)
821 _windres=$(echo $ac_option | cut -d '=' -f 2)
823 --charset=*)
824 _charset=$(echo $ac_option | cut -d '=' -f 2)
826 --language-doc=*)
827 language_doc=$(echo $ac_option | cut -d '=' -f 2)
829 --language-man=*)
830 language_man=$(echo $ac_option | cut -d '=' -f 2)
832 --language-msg=*)
833 language_msg=$(echo $ac_option | cut -d '=' -f 2)
835 --language=*)
836 language=$(echo $ac_option | cut -d '=' -f 2)
839 --enable-static)
840 _ld_static='-static'
842 --disable-static)
843 _ld_static=''
845 --enable-profile)
846 _profile='-p'
848 --disable-profile)
849 _profile=
851 --enable-debug)
852 _debug='-g'
854 --enable-debug=*)
855 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
857 --disable-debug)
858 _debug=
860 --enable-translation) _translation=yes ;;
861 --disable-translation) _translation=no ;;
862 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
863 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
864 --enable-cross-compile) _cross_compile=yes ;;
865 --disable-cross-compile) _cross_compile=no ;;
866 --enable-mplayer) _mplayer=yes ;;
867 --disable-mplayer) _mplayer=no ;;
868 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
869 --disable-dynamic-plugins) _dynamic_plugins=no ;;
870 --enable-x11) _x11=yes ;;
871 --disable-x11) _x11=no ;;
872 --enable-xshape) _xshape=yes ;;
873 --disable-xshape) _xshape=no ;;
874 --enable-xss) _xss=yes ;;
875 --disable-xss) _xss=no ;;
876 --enable-xv) _xv=yes ;;
877 --disable-xv) _xv=no ;;
878 --enable-xvmc) _xvmc=yes ;;
879 --disable-xvmc) _xvmc=no ;;
880 --enable-vdpau) _vdpau=yes ;;
881 --disable-vdpau) _vdpau=no ;;
882 --enable-sdl) _sdl=yes ;;
883 --disable-sdl) _sdl=no ;;
884 --enable-kva) _kva=yes ;;
885 --disable-kva) _kva=no ;;
886 --enable-direct3d) _direct3d=yes ;;
887 --disable-direct3d) _direct3d=no ;;
888 --enable-directx) _directx=yes ;;
889 --disable-directx) _directx=no ;;
890 --enable-win32waveout) _win32waveout=yes ;;
891 --disable-win32waveout) _win32waveout=no ;;
892 --enable-nas) _nas=yes ;;
893 --disable-nas) _nas=no ;;
894 --enable-png) _png=yes ;;
895 --disable-png) _png=no ;;
896 --enable-mng) _mng=yes ;;
897 --disable-mng) _mng=no ;;
898 --enable-jpeg) _jpeg=yes ;;
899 --disable-jpeg) _jpeg=no ;;
900 --enable-pnm) _pnm=yes ;;
901 --disable-pnm) _pnm=no ;;
902 --enable-md5sum) _md5sum=yes ;;
903 --disable-md5sum) _md5sum=no ;;
904 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
905 --disable-yuv4mpeg) _yuv4mpeg=no ;;
906 --enable-gif) _gif=yes ;;
907 --disable-gif) _gif=no ;;
908 --enable-gl) _gl=yes ;;
909 --disable-gl) _gl=no ;;
910 --enable-matrixview) matrixview=yes ;;
911 --disable-matrixview) matrixview=no ;;
912 --enable-ggi) _ggi=yes ;;
913 --disable-ggi) _ggi=no ;;
914 --enable-ggiwmh) _ggiwmh=yes ;;
915 --disable-ggiwmh) _ggiwmh=no ;;
916 --enable-aa) _aa=yes ;;
917 --disable-aa) _aa=no ;;
918 --enable-caca) _caca=yes ;;
919 --disable-caca) _caca=no ;;
920 --enable-svga) _svga=yes ;;
921 --disable-svga) _svga=no ;;
922 --enable-vesa) _vesa=yes ;;
923 --disable-vesa) _vesa=no ;;
924 --enable-fbdev) _fbdev=yes ;;
925 --disable-fbdev) _fbdev=no ;;
926 --enable-dvb) _dvb=yes ;;
927 --disable-dvb) _dvb=no ;;
928 --enable-dxr3) _dxr3=yes ;;
929 --disable-dxr3) _dxr3=no ;;
930 --enable-ivtv) _ivtv=yes ;;
931 --disable-ivtv) _ivtv=no ;;
932 --enable-v4l2) _v4l2=yes ;;
933 --disable-v4l2) _v4l2=no ;;
934 --enable-iconv) _iconv=yes ;;
935 --disable-iconv) _iconv=no ;;
936 --enable-langinfo) _langinfo=yes ;;
937 --disable-langinfo) _langinfo=no ;;
938 --enable-rtc) _rtc=yes ;;
939 --disable-rtc) _rtc=no ;;
940 --enable-libdv) _libdv=yes ;;
941 --disable-libdv) _libdv=no ;;
942 --enable-ossaudio) _ossaudio=yes ;;
943 --disable-ossaudio) _ossaudio=no ;;
944 --enable-arts) _arts=yes ;;
945 --disable-arts) _arts=no ;;
946 --enable-esd) _esd=yes ;;
947 --disable-esd) _esd=no ;;
948 --enable-pulse) _pulse=yes ;;
949 --disable-pulse) _pulse=no ;;
950 --enable-jack) _jack=yes ;;
951 --disable-jack) _jack=no ;;
952 --enable-openal) _openal=yes ;;
953 --disable-openal) _openal=no ;;
954 --enable-kai) _kai=yes ;;
955 --disable-kai) _kai=no ;;
956 --enable-dart) _dart=yes ;;
957 --disable-dart) _dart=no ;;
958 --enable-mad) _mad=yes ;;
959 --disable-mad) _mad=no ;;
960 --enable-libcdio) _libcdio=yes ;;
961 --disable-libcdio) _libcdio=no ;;
962 --enable-liblzo) _liblzo=yes ;;
963 --disable-liblzo) _liblzo=no ;;
964 --enable-libvorbis) _libvorbis=yes ;;
965 --disable-libvorbis) _libvorbis=no ;;
966 --enable-speex) _speex=yes ;;
967 --disable-speex) _speex=no ;;
968 --enable-tremor) _tremor=yes ;;
969 --disable-tremor) _tremor=no ;;
970 --enable-theora) _theora=yes ;;
971 --disable-theora) _theora=no ;;
972 --enable-mpg123) _mpg123=yes ;;
973 --disable-mpg123) _mpg123=no ;;
974 --enable-mp3lib) _mp3lib=yes ;;
975 --disable-mp3lib) _mp3lib=no ;;
976 --enable-liba52) _liba52=yes ;;
977 --disable-liba52) _liba52=no ;;
978 --enable-libdca) _libdca=yes ;;
979 --disable-libdca) _libdca=no ;;
980 --enable-musepack) _musepack=yes ;;
981 --disable-musepack) _musepack=no ;;
982 --enable-faad) _faad=yes ;;
983 --disable-faad) _faad=no ;;
984 --enable-ladspa) _ladspa=yes ;;
985 --disable-ladspa) _ladspa=no ;;
986 --enable-libbs2b) _libbs2b=yes ;;
987 --disable-libbs2b) _libbs2b=no ;;
988 --enable-xmms) _xmms=yes ;;
989 --disable-xmms) _xmms=no ;;
990 --enable-vcd) _vcd=yes ;;
991 --disable-vcd) _vcd=no ;;
992 --enable-bluray) _bluray=yes ;;
993 --disable-bluray) _bluray=no ;;
994 --enable-dvdread) _dvdread=yes ;;
995 --disable-dvdread) _dvdread=no ;;
996 --enable-dvdread-internal) _dvdread_internal=yes ;;
997 --disable-dvdread-internal) _dvdread_internal=no ;;
998 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
999 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1000 --enable-dvdnav) _dvdnav=yes ;;
1001 --disable-dvdnav) _dvdnav=no ;;
1002 --enable-xanim) _xanim=yes ;;
1003 --disable-xanim) _xanim=no ;;
1004 --enable-real) _real=yes ;;
1005 --disable-real) _real=no ;;
1006 --enable-live) _live=yes ;;
1007 --disable-live) _live=no ;;
1008 --enable-nemesi) _nemesi=yes ;;
1009 --disable-nemesi) _nemesi=no ;;
1010 --enable-xinerama) _xinerama=yes ;;
1011 --disable-xinerama) _xinerama=no ;;
1012 --enable-mga) _mga=yes ;;
1013 --disable-mga) _mga=no ;;
1014 --enable-xmga) _xmga=yes ;;
1015 --disable-xmga) _xmga=no ;;
1016 --enable-vm) _vm=yes ;;
1017 --disable-vm) _vm=no ;;
1018 --enable-xf86keysym) _xf86keysym=yes ;;
1019 --disable-xf86keysym) _xf86keysym=no ;;
1020 --enable-sunaudio) _sunaudio=yes ;;
1021 --disable-sunaudio) _sunaudio=no ;;
1022 --enable-sgiaudio) _sgiaudio=yes ;;
1023 --disable-sgiaudio) _sgiaudio=no ;;
1024 --enable-alsa) _alsa=yes ;;
1025 --disable-alsa) _alsa=no ;;
1026 --enable-tv) _tv=yes ;;
1027 --disable-tv) _tv=no ;;
1028 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1029 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1030 --enable-tv-v4l1) _tv_v4l1=yes ;;
1031 --disable-tv-v4l1) _tv_v4l1=no ;;
1032 --enable-tv-v4l2) _tv_v4l2=yes ;;
1033 --disable-tv-v4l2) _tv_v4l2=no ;;
1034 --enable-tv-dshow) _tv_dshow=yes ;;
1035 --disable-tv-dshow) _tv_dshow=no ;;
1036 --enable-radio) _radio=yes ;;
1037 --enable-radio-capture) _radio_capture=yes ;;
1038 --disable-radio-capture) _radio_capture=no ;;
1039 --disable-radio) _radio=no ;;
1040 --enable-radio-v4l) _radio_v4l=yes ;;
1041 --disable-radio-v4l) _radio_v4l=no ;;
1042 --enable-radio-v4l2) _radio_v4l2=yes ;;
1043 --disable-radio-v4l2) _radio_v4l2=no ;;
1044 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1045 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1046 --enable-pvr) _pvr=yes ;;
1047 --disable-pvr) _pvr=no ;;
1048 --enable-fastmemcpy) _fastmemcpy=yes ;;
1049 --disable-fastmemcpy) _fastmemcpy=no ;;
1050 --enable-networking) networking=yes ;;
1051 --disable-networking) networking=no ;;
1052 --enable-winsock2_h) _winsock2_h=yes ;;
1053 --disable-winsock2_h) _winsock2_h=no ;;
1054 --enable-smb) _smb=yes ;;
1055 --disable-smb) _smb=no ;;
1056 --enable-joystick) _joystick=yes ;;
1057 --disable-joystick) _joystick=no ;;
1058 --enable-xvid) _xvid=yes ;;
1059 --disable-xvid) _xvid=no ;;
1060 --enable-libnut) _libnut=yes ;;
1061 --disable-libnut) _libnut=no ;;
1062 --enable-ffmpeg) ffmpeg=yes ;;
1063 --disable-ffmpeg) ffmpeg=no ;;
1064 --ffmpeg-source-dir=*)
1065 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1067 --enable-lirc) _lirc=yes ;;
1068 --disable-lirc) _lirc=no ;;
1069 --enable-lircc) _lircc=yes ;;
1070 --disable-lircc) _lircc=no ;;
1071 --enable-apple-remote) _apple_remote=yes ;;
1072 --disable-apple-remote) _apple_remote=no ;;
1073 --enable-apple-ir) _apple_ir=yes ;;
1074 --disable-apple-ir) _apple_ir=no ;;
1075 --enable-gui) _gui=yes ;;
1076 --disable-gui) _gui=no ;;
1077 --enable-gtk1) _gtk1=yes ;;
1078 --disable-gtk1) _gtk1=no ;;
1079 --enable-termcap) _termcap=yes ;;
1080 --disable-termcap) _termcap=no ;;
1081 --enable-termios) _termios=yes ;;
1082 --disable-termios) _termios=no ;;
1083 --enable-3dfx) _3dfx=yes ;;
1084 --disable-3dfx) _3dfx=no ;;
1085 --enable-s3fb) _s3fb=yes ;;
1086 --disable-s3fb) _s3fb=no ;;
1087 --enable-wii) _wii=yes ;;
1088 --disable-wii) _wii=no ;;
1089 --enable-tdfxfb) _tdfxfb=yes ;;
1090 --disable-tdfxfb) _tdfxfb=no ;;
1091 --disable-tdfxvid) _tdfxvid=no ;;
1092 --enable-tdfxvid) _tdfxvid=yes ;;
1093 --disable-xvr100) _xvr100=no ;;
1094 --enable-xvr100) _xvr100=yes ;;
1095 --disable-tga) _tga=no ;;
1096 --enable-tga) _tga=yes ;;
1097 --enable-directfb) _directfb=yes ;;
1098 --disable-directfb) _directfb=no ;;
1099 --enable-bl) _bl=yes ;;
1100 --disable-bl) _bl=no ;;
1101 --enable-mtrr) _mtrr=yes ;;
1102 --disable-mtrr) _mtrr=no ;;
1103 --enable-largefiles) _largefiles=yes ;;
1104 --disable-largefiles) _largefiles=no ;;
1105 --enable-shm) _shm=yes ;;
1106 --disable-shm) _shm=no ;;
1107 --enable-select) _select=yes ;;
1108 --disable-select) _select=no ;;
1109 --enable-cdparanoia) _cdparanoia=yes ;;
1110 --disable-cdparanoia) _cdparanoia=no ;;
1111 --enable-cddb) _cddb=yes ;;
1112 --disable-cddb) _cddb=no ;;
1113 --enable-big-endian) _big_endian=yes ;;
1114 --disable-big-endian) _big_endian=no ;;
1115 --enable-bitmap-font) _bitmap_font=yes ;;
1116 --disable-bitmap-font) _bitmap_font=no ;;
1117 --enable-freetype) _freetype=yes ;;
1118 --disable-freetype) _freetype=no ;;
1119 --enable-fontconfig) _fontconfig=yes ;;
1120 --disable-fontconfig) _fontconfig=no ;;
1121 --enable-unrarexec) _unrar_exec=yes ;;
1122 --disable-unrarexec) _unrar_exec=no ;;
1123 --enable-ftp) _ftp=yes ;;
1124 --disable-ftp) _ftp=no ;;
1125 --enable-vstream) _vstream=yes ;;
1126 --disable-vstream) _vstream=no ;;
1127 --enable-pthreads) _pthreads=yes ;;
1128 --disable-pthreads) _pthreads=no ;;
1129 --enable-w32threads) _w32threads=yes ;;
1130 --disable-w32threads) _w32threads=no ;;
1131 --enable-ass) _ass=yes ;;
1132 --disable-ass) _ass=no ;;
1133 --enable-rpath) _rpath=yes ;;
1134 --disable-rpath) _rpath=no ;;
1136 --enable-fribidi) _fribidi=yes ;;
1137 --disable-fribidi) _fribidi=no ;;
1139 --enable-enca) _enca=yes ;;
1140 --disable-enca) _enca=no ;;
1142 --enable-inet6) _inet6=yes ;;
1143 --disable-inet6) _inet6=no ;;
1145 --enable-gethostbyname2) _gethostbyname2=yes ;;
1146 --disable-gethostbyname2) _gethostbyname2=no ;;
1148 --enable-dga1) _dga1=yes ;;
1149 --disable-dga1) _dga1=no ;;
1150 --enable-dga2) _dga2=yes ;;
1151 --disable-dga2) _dga2=no ;;
1153 --enable-menu) _menu=yes ;;
1154 --disable-menu) _menu=no ;;
1156 --enable-qtx) _qtx=yes ;;
1157 --disable-qtx) _qtx=no ;;
1159 --enable-coreaudio) _coreaudio=yes ;;
1160 --disable-coreaudio) _coreaudio=no ;;
1161 --enable-corevideo) _corevideo=yes ;;
1162 --disable-corevideo) _corevideo=no ;;
1163 --enable-quartz) _quartz=yes ;;
1164 --disable-quartz) _quartz=no ;;
1165 --enable-macosx-finder) _macosx_finder=yes ;;
1166 --disable-macosx-finder) _macosx_finder=no ;;
1167 --enable-macosx-bundle) _macosx_bundle=yes ;;
1168 --disable-macosx-bundle) _macosx_bundle=no ;;
1170 --enable-maemo) _maemo=yes ;;
1171 --disable-maemo) _maemo=no ;;
1173 --enable-sortsub) _sortsub=yes ;;
1174 --disable-sortsub) _sortsub=no ;;
1176 --enable-crash-debug) _crash_debug=yes ;;
1177 --disable-crash-debug) _crash_debug=no ;;
1178 --enable-sighandler) _sighandler=yes ;;
1179 --disable-sighandler) _sighandler=no ;;
1180 --enable-win32dll) _win32dll=yes ;;
1181 --disable-win32dll) _win32dll=no ;;
1183 --enable-sse) _sse=yes ;;
1184 --disable-sse) _sse=no ;;
1185 --enable-sse2) _sse2=yes ;;
1186 --disable-sse2) _sse2=no ;;
1187 --enable-ssse3) _ssse3=yes ;;
1188 --disable-ssse3) _ssse3=no ;;
1189 --enable-mmxext) _mmxext=yes ;;
1190 --disable-mmxext) _mmxext=no ;;
1191 --enable-3dnow) _3dnow=yes ;;
1192 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1193 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1194 --disable-3dnowext) _3dnowext=no ;;
1195 --enable-cmov) _cmov=yes ;;
1196 --disable-cmov) _cmov=no ;;
1197 --enable-fast-cmov) _fast_cmov=yes ;;
1198 --disable-fast-cmov) _fast_cmov=no ;;
1199 --enable-fast-clz) _fast_clz=yes ;;
1200 --disable-fast-clz) _fast_clz=no ;;
1201 --enable-altivec) _altivec=yes ;;
1202 --disable-altivec) _altivec=no ;;
1203 --enable-armv5te) _armv5te=yes ;;
1204 --disable-armv5te) _armv5te=no ;;
1205 --enable-armv6) _armv6=yes ;;
1206 --disable-armv6) _armv6=no ;;
1207 --enable-armv6t2) _armv6t2=yes ;;
1208 --disable-armv6t2) _armv6t2=no ;;
1209 --enable-armvfp) _armvfp=yes ;;
1210 --disable-armvfp) _armvfp=no ;;
1211 --enable-neon) neon=yes ;;
1212 --disable-neon) neon=no ;;
1213 --enable-iwmmxt) _iwmmxt=yes ;;
1214 --disable-iwmmxt) _iwmmxt=no ;;
1215 --enable-mmx) _mmx=yes ;;
1216 --disable-mmx) # 3Dnow! and MMX2 require MMX
1217 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1220 echo "Unknown parameter: $ac_option"
1221 exit 1
1224 esac
1225 done
1227 if test "$_gui" = yes ; then
1228 die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
1229 (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
1232 # Atmos: moved this here, to be correct, if --prefix is specified
1233 test -z "$_bindir" && _bindir="$_prefix/bin"
1234 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1235 test -z "$_mandir" && _mandir="$_prefix/share/man"
1236 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1237 test -z "$_libdir" && _libdir="$_prefix/lib"
1238 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1240 # Determine our OS name and CPU architecture
1241 if test -z "$_target" ; then
1242 # OS name
1243 system_name=$(uname -s 2>&1)
1244 case "$system_name" in
1245 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1247 Haiku)
1248 system_name=BeOS
1250 IRIX*)
1251 system_name=IRIX
1253 GNU/kFreeBSD)
1254 system_name=FreeBSD
1256 HP-UX*)
1257 system_name=HP-UX
1259 [cC][yY][gG][wW][iI][nN]*)
1260 system_name=CYGWIN
1262 MINGW32*)
1263 system_name=MINGW32
1265 OS/2*)
1266 system_name=OS/2
1269 system_name="$system_name-UNKNOWN"
1271 esac
1274 # host's CPU/instruction set
1275 host_arch=$(uname -p 2>&1)
1276 case "$host_arch" in
1277 i386|sparc|ppc|alpha|arm|mips|vax)
1279 powerpc) # Darwin returns 'powerpc'
1280 host_arch=ppc
1282 *) # uname -p on Linux returns 'unknown' for the processor type,
1283 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1285 # Maybe uname -m (machine hardware name) returns something we
1286 # recognize.
1288 # x86/x86pc is used by QNX
1289 case "$(uname -m 2>&1)" in
1290 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 ;;
1291 ia64) host_arch=ia64 ;;
1292 macppc|ppc) host_arch=ppc ;;
1293 ppc64) host_arch=ppc64 ;;
1294 alpha) host_arch=alpha ;;
1295 sparc) host_arch=sparc ;;
1296 sparc64) host_arch=sparc64 ;;
1297 parisc*|hppa*|9000*) host_arch=hppa ;;
1298 arm*|zaurus|cats) host_arch=arm ;;
1299 sh3|sh4|sh4a) host_arch=sh ;;
1300 s390) host_arch=s390 ;;
1301 s390x) host_arch=s390x ;;
1302 *mips*) host_arch=mips ;;
1303 vax) host_arch=vax ;;
1304 xtensa*) host_arch=xtensa ;;
1305 *) host_arch=UNKNOWN ;;
1306 esac
1308 esac
1309 else # if test -z "$_target"
1310 system_name=$(echo $_target | cut -d '-' -f 2)
1311 case "$(echo $system_name | tr A-Z a-z)" in
1312 linux) system_name=Linux ;;
1313 freebsd) system_name=FreeBSD ;;
1314 gnu/kfreebsd) system_name=FreeBSD ;;
1315 netbsd) system_name=NetBSD ;;
1316 bsd/os) system_name=BSD/OS ;;
1317 openbsd) system_name=OpenBSD ;;
1318 dragonfly) system_name=DragonFly ;;
1319 sunos) system_name=SunOS ;;
1320 qnx) system_name=QNX ;;
1321 morphos) system_name=MorphOS ;;
1322 amigaos) system_name=AmigaOS ;;
1323 mingw32*) system_name=MINGW32 ;;
1324 esac
1325 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1326 host_arch=$(echo $_target | cut -d '-' -f 1)
1327 if test $(echo $host_arch) != "x86_64" ; then
1328 host_arch=$(echo $host_arch | tr '_' '-')
1332 extra_cflags="-I. $extra_cflags"
1333 _timer=timer-linux.c
1334 _getch=getch2.c
1335 if freebsd ; then
1336 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1337 extra_cflags="$extra_cflags -I/usr/local/include"
1340 if netbsd || dragonfly ; then
1341 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1342 extra_cflags="$extra_cflags -I/usr/pkg/include"
1345 if darwin; then
1346 extra_cflags="-mdynamic-no-pic $extra_cflags"
1347 if test "$(basename $_cc)" != "clang" ; then
1348 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
1350 _timer=timer-darwin.c
1353 if aix ; then
1354 extra_ldflags="$extra_ldflags -lC"
1357 if irix ; then
1358 _ranlib='ar -r'
1359 elif linux ; then
1360 _ranlib='true'
1363 if win32 ; then
1364 _exesuf=".exe"
1365 extra_cflags="$extra_cflags -fno-common"
1366 # -lwinmm is always needed for osdep/timer-win2.c
1367 extra_ldflags="$extra_ldflags -lwinmm"
1368 _pe_executable=yes
1369 _timer=timer-win2.c
1370 _priority=yes
1371 def_dos_paths="#define HAVE_DOS_PATHS 1"
1372 def_priority="#define CONFIG_PRIORITY 1"
1375 if mingw32 ; then
1376 _getch=getch2-win.c
1377 need_shmem=no
1380 if amigaos ; then
1381 _select=no
1382 _sighandler=no
1383 _stream_cache=no
1384 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1385 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1388 if qnx ; then
1389 extra_ldflags="$extra_ldflags -lph"
1392 if os2 ; then
1393 _exesuf=".exe"
1394 _getch=getch2-os2.c
1395 need_shmem=no
1396 _priority=yes
1397 def_dos_paths="#define HAVE_DOS_PATHS 1"
1398 def_priority="#define CONFIG_PRIORITY 1"
1401 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1402 test "$tmpdir" && break
1403 done
1405 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1406 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1408 TMPLOG="config.log"
1409 TMPC="$mplayer_tmpdir/tmp.c"
1410 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1411 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1412 TMPH="$mplayer_tmpdir/tmp.h"
1413 TMPS="$mplayer_tmpdir/tmp.S"
1415 rm -f "$TMPLOG"
1416 echo configuration: $configuration > "$TMPLOG"
1417 echo >> "$TMPLOG"
1420 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1421 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1425 # Checking CC version...
1426 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1427 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1428 echocheck "$_cc version"
1429 cc_vendor=intel
1430 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1431 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1432 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1433 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1434 # TODO verify older icc/ecc compatibility
1435 case $cc_version in
1437 cc_version="v. ?.??, bad"
1438 cc_fail=yes
1440 10.1|11.0|11.1)
1441 cc_version="$cc_version, ok"
1444 cc_version="$cc_version, bad"
1445 cc_fail=yes
1447 esac
1448 echores "$cc_version"
1449 else
1450 for _cc in "$_cc" gcc cc ; do
1451 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1452 if test "$cc_name_tmp" = "gcc"; then
1453 cc_name=$cc_name_tmp
1454 echocheck "$_cc version"
1455 cc_vendor=gnu
1456 cc_version=$($_cc -dumpversion 2>&1)
1457 case $cc_version in
1458 2.96*)
1459 cc_fail=yes
1462 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1463 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1464 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1466 esac
1467 echores "$cc_version"
1468 break
1470 cc_name_tmp=$($_cc -v 2>&1 | head -n 1 | cut -d ' ' -f 1)
1471 if test "$cc_name_tmp" = "clang"; then
1472 echocheck "$_cc version"
1473 cc_vendor=clang
1474 cc_version=$($_cc -dumpversion 2>&1)
1475 res_comment="experimental support only"
1476 echores "clang $cc_version"
1477 break
1479 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1480 if test "$cc_name_tmp" = "Sun C"; then
1481 echocheck "$_cc version"
1482 cc_vendor=sun
1483 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1484 res_comment="experimental support only"
1485 echores "Sun C $cc_version"
1486 break
1488 done
1489 fi # icc
1490 test "$cc_fail" = yes && die "unsupported compiler version"
1492 if test -z "$_target" && x86 ; then
1493 cat > $TMPC << EOF
1494 int main(void) {
1495 int test[(int)sizeof(char *)-7];
1496 return 0;
1499 cc_check && host_arch=x86_64 || host_arch=i386
1502 echo "Detected operating system: $system_name"
1503 echo "Detected host architecture: $host_arch"
1505 echocheck "host cc"
1506 test "$_host_cc" || _host_cc=$_cc
1507 echores $_host_cc
1509 echocheck "cross compilation"
1510 if test $_cross_compile = auto ; then
1511 _cross_compile=yes
1512 cflag_check "" && "$TMPEXE" && _cross_compile=no
1514 echores $_cross_compile
1516 if test $_cross_compile = yes; then
1517 tmp_run() {
1518 return 0
1522 # ---
1524 # now that we know what compiler should be used for compilation, try to find
1525 # out which assembler is used by the $_cc compiler
1526 if test "$_as" = auto ; then
1527 _as=$($_cc -print-prog-name=as)
1528 test -z "$_as" && _as=as
1531 if test "$_nm" = auto ; then
1532 _nm=$($_cc -print-prog-name=nm)
1533 test -z "$_nm" && _nm=nm
1536 # XXX: this should be ok..
1537 _cpuinfo="echo"
1539 if test "$_runtime_cpudetection" = no ; then
1541 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1542 # FIXME: Remove the cygwin check once AMD CPUs are supported
1543 if test -r /proc/cpuinfo && ! cygwin; then
1544 # Linux with /proc mounted, extract CPU information from it
1545 _cpuinfo="cat /proc/cpuinfo"
1546 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1547 # FreeBSD with Linux emulation /proc mounted,
1548 # extract CPU information from it
1549 # Don't use it on x86 though, it never reports 3Dnow
1550 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1551 elif darwin && ! x86 ; then
1552 # use hostinfo on Darwin
1553 _cpuinfo="hostinfo"
1554 elif aix; then
1555 # use 'lsattr' on AIX
1556 _cpuinfo="lsattr -E -l proc0 -a type"
1557 elif x86; then
1558 # all other OSes try to extract CPU information from a small helper
1559 # program cpuinfo instead
1560 $_cc -o cpuinfo$_exesuf cpuinfo.c
1561 _cpuinfo="./cpuinfo$_exesuf"
1564 if x86 ; then
1565 # gather more CPU information
1566 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1567 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1568 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1569 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1570 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1572 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1574 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1575 -e s/xmm/sse/ -e s/kni/sse/)
1577 for ext in $pparam ; do
1578 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1579 done
1581 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1582 test $_sse = kernel_check && _mmxext=kernel_check
1584 echocheck "CPU vendor"
1585 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1587 echocheck "CPU type"
1588 echores "$pname"
1591 fi # test "$_runtime_cpudetection" = no
1593 if x86 && test "$_runtime_cpudetection" = no ; then
1594 extcheck() {
1595 if test "$1" = kernel_check ; then
1596 echocheck "kernel support of $2"
1597 cat > $TMPC <<EOF
1598 #include <stdlib.h>
1599 #include <signal.h>
1600 static void catch(int sig) { exit(1); }
1601 int main(void) {
1602 signal(SIGILL, catch);
1603 __asm__ volatile ("$3":::"memory"); return 0;
1607 if cc_check && tmp_run ; then
1608 eval _$2=yes
1609 echores "yes"
1610 _optimizing="$_optimizing $2"
1611 return 0
1612 else
1613 eval _$2=no
1614 echores "failed"
1615 echo "It seems that your kernel does not correctly support $2."
1616 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1617 return 1
1620 return 0
1623 extcheck $_mmx "mmx" "emms"
1624 extcheck $_mmxext "mmxext" "sfence"
1625 extcheck $_3dnow "3dnow" "femms"
1626 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1627 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1628 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1629 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1630 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1632 echocheck "mtrr support"
1633 if test "$_mtrr" = kernel_check ; then
1634 _mtrr="yes"
1635 _optimizing="$_optimizing mtrr"
1637 echores "$_mtrr"
1639 if test "$_gcc3_ext" != ""; then
1640 # if we had to disable sse/sse2 because the active kernel does not
1641 # support this instruction set extension, we also have to tell
1642 # gcc3 to not generate sse/sse2 instructions for normal C code
1643 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1649 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1650 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1651 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1652 subarch_all='X86_32 X86_64 PPC64'
1653 case "$host_arch" in
1654 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1655 arch='x86'
1656 subarch='x86_32'
1657 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1658 iproc=486
1659 proc=i486
1662 if test "$_runtime_cpudetection" = no ; then
1663 case "$pvendor" in
1664 AuthenticAMD)
1665 case "$pfamily" in
1666 3) proc=i386 iproc=386 ;;
1667 4) proc=i486 iproc=486 ;;
1668 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1669 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1670 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1671 proc=k6-3
1672 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1673 proc=geode
1674 elif test "$pmodel" -ge 8; then
1675 proc=k6-2
1676 elif test "$pmodel" -ge 6; then
1677 proc=k6
1678 else
1679 proc=i586
1682 6) iproc=686
1683 # It's a bit difficult to determine the correct type of Family 6
1684 # AMD CPUs just from their signature. Instead, we check directly
1685 # whether it supports SSE.
1686 if test "$_sse" = yes; then
1687 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1688 proc=athlon-xp
1689 else
1690 # Again, gcc treats athlon and athlon-tbird similarly.
1691 proc=athlon
1694 15) iproc=686
1695 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1696 # caught and remedied in the optimization tests below.
1697 proc=k8
1700 *) proc=amdfam10 iproc=686
1701 test $_fast_clz = "auto" && _fast_clz=yes
1703 esac
1705 GenuineIntel)
1706 case "$pfamily" in
1707 3) proc=i386 iproc=386 ;;
1708 4) proc=i486 iproc=486 ;;
1709 5) iproc=586
1710 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1711 proc=pentium-mmx # 4 is desktop, 8 is mobile
1712 else
1713 proc=i586
1716 6) iproc=686
1717 if test "$pmodel" -ge 15; then
1718 proc=core2
1719 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1720 proc=pentium-m
1721 elif test "$pmodel" -ge 7; then
1722 proc=pentium3
1723 elif test "$pmodel" -ge 3; then
1724 proc=pentium2
1725 else
1726 proc=i686
1728 test $_fast_clz = "auto" && _fast_clz=yes
1730 15) iproc=686
1731 # A nocona in 32-bit mode has no more capabilities than a prescott.
1732 if test "$pmodel" -ge 3; then
1733 proc=prescott
1734 else
1735 proc=pentium4
1736 test $_fast_clz = "auto" && _fast_clz=yes
1738 test $_fast_cmov = "auto" && _fast_cmov=no
1740 *) proc=prescott iproc=686 ;;
1741 esac
1743 CentaurHauls)
1744 case "$pfamily" in
1745 5) iproc=586
1746 if test "$pmodel" -ge 8; then
1747 proc=winchip2
1748 elif test "$pmodel" -ge 4; then
1749 proc=winchip-c6
1750 else
1751 proc=i586
1754 6) iproc=686
1755 if test "$pmodel" -ge 9; then
1756 proc=c3-2
1757 else
1758 proc=c3
1759 iproc=586
1762 *) proc=i686 iproc=i686 ;;
1763 esac
1765 unknown)
1766 case "$pfamily" in
1767 3) proc=i386 iproc=386 ;;
1768 4) proc=i486 iproc=486 ;;
1769 *) proc=i586 iproc=586 ;;
1770 esac
1773 proc=i586 iproc=586 ;;
1774 esac
1775 test $_fast_clz = "auto" && _fast_clz=no
1776 fi # test "$_runtime_cpudetection" = no
1779 # check that gcc supports our CPU, if not, fall back to earlier ones
1780 # LGB: check -mcpu and -march swithing step by step with enabling
1781 # to fall back till 386.
1783 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1785 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1786 cpuopt=-mtune
1787 else
1788 cpuopt=-mcpu
1791 echocheck "GCC & CPU optimization abilities"
1792 if test "$_runtime_cpudetection" = no ; then
1793 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1794 cflag_check -march=native && proc=native
1796 if test "$proc" = "amdfam10"; then
1797 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1799 if test "$proc" = "k8"; then
1800 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1802 if test "$proc" = "athlon-xp"; then
1803 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1805 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1806 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1808 if test "$proc" = "k6" || test "$proc" = "c3"; then
1809 if ! cflag_check -march=$proc $cpuopt=$proc; then
1810 if cflag_check -march=i586 $cpuopt=i686; then
1811 proc=i586-i686
1812 else
1813 proc=i586
1817 if test "$proc" = "prescott" ; then
1818 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1820 if test "$proc" = "core2" ; then
1821 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1823 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
1824 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1826 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1827 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1829 if test "$proc" = "i586"; then
1830 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1832 if test "$proc" = "i486" ; then
1833 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1835 if test "$proc" = "i386" ; then
1836 cflag_check -march=$proc $cpuopt=$proc || proc=error
1838 if test "$proc" = "error" ; then
1839 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1840 _mcpu=""
1841 _march=""
1842 _optimizing=""
1843 elif test "$proc" = "i586-i686"; then
1844 _march="-march=i586"
1845 _mcpu="$cpuopt=i686"
1846 _optimizing="$proc"
1847 else
1848 _march="-march=$proc"
1849 _mcpu="$cpuopt=$proc"
1850 _optimizing="$proc"
1852 else # if test "$_runtime_cpudetection" = no
1853 _mcpu="$cpuopt=generic"
1854 # at least i486 required, for bswap instruction
1855 _march="-march=i486"
1856 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1857 cflag_check $_mcpu || _mcpu=""
1858 cflag_check $_march $_mcpu || _march=""
1861 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1862 ## autodetected mcpu/march parameters
1863 if test "$_target" ; then
1864 # TODO: it may be a good idea to check GCC and fall back in all cases
1865 if test "$host_arch" = "i586-i686"; then
1866 _march="-march=i586"
1867 _mcpu="$cpuopt=i686"
1868 else
1869 _march="-march=$host_arch"
1870 _mcpu="$cpuopt=$host_arch"
1873 proc="$host_arch"
1875 case "$proc" in
1876 i386) iproc=386 ;;
1877 i486) iproc=486 ;;
1878 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1879 i686|athlon*|pentium*) iproc=686 ;;
1880 *) iproc=586 ;;
1881 esac
1884 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1885 _fast_cmov="yes"
1886 else
1887 _fast_cmov="no"
1889 test $_fast_clz = "auto" && _fast_clz=yes
1891 echores "$proc"
1894 ia64)
1895 arch='ia64'
1896 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1897 iproc='ia64'
1900 x86_64|amd64)
1901 arch='x86'
1902 subarch='x86_64'
1903 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1904 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1905 iproc='x86_64'
1907 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1908 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1909 cpuopt=-mtune
1910 else
1911 cpuopt=-mcpu
1913 if test "$_runtime_cpudetection" = no ; then
1914 case "$pvendor" in
1915 AuthenticAMD)
1916 case "$pfamily" in
1917 15) proc=k8
1918 test $_fast_clz = "auto" && _fast_clz=no
1920 *) proc=amdfam10;;
1921 esac
1923 GenuineIntel)
1924 case "$pfamily" in
1925 6) proc=core2;;
1927 # 64-bit prescotts exist, but as far as GCC is concerned they
1928 # have the same capabilities as a nocona.
1929 proc=nocona
1930 test $_fast_cmov = "auto" && _fast_cmov=no
1931 test $_fast_clz = "auto" && _fast_clz=no
1933 esac
1936 proc=error;;
1937 esac
1938 fi # test "$_runtime_cpudetection" = no
1940 echocheck "GCC & CPU optimization abilities"
1941 # This is a stripped-down version of the i386 fallback.
1942 if test "$_runtime_cpudetection" = no ; then
1943 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1944 cflag_check -march=native && proc=native
1946 # --- AMD processors ---
1947 if test "$proc" = "amdfam10"; then
1948 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1950 if test "$proc" = "k8"; then
1951 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1953 # This will fail if gcc version < 3.3, which is ok because earlier
1954 # versions don't really support 64-bit on amd64.
1955 # Is this a valid assumption? -Corey
1956 if test "$proc" = "athlon-xp"; then
1957 cflag_check -march=$proc $cpuopt=$proc || proc=error
1959 # --- Intel processors ---
1960 if test "$proc" = "core2"; then
1961 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1963 if test "$proc" = "x86-64"; then
1964 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1966 if test "$proc" = "nocona"; then
1967 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1969 if test "$proc" = "pentium4"; then
1970 cflag_check -march=$proc $cpuopt=$proc || proc=error
1973 _march="-march=$proc"
1974 _mcpu="$cpuopt=$proc"
1975 if test "$proc" = "error" ; then
1976 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1977 _mcpu=""
1978 _march=""
1980 else # if test "$_runtime_cpudetection" = no
1981 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1982 _march="-march=x86-64"
1983 _mcpu="$cpuopt=generic"
1984 cflag_check $_mcpu || _mcpu="x86-64"
1985 cflag_check $_mcpu || _mcpu=""
1986 cflag_check $_march $_mcpu || _march=""
1989 _optimizing="$proc"
1990 test $_fast_cmov = "auto" && _fast_cmov=yes
1991 test $_fast_clz = "auto" && _fast_clz=yes
1993 echores "$proc"
1996 sparc|sparc64)
1997 arch='sparc'
1998 iproc='sparc'
1999 if test "$host_arch" = "sparc64" ; then
2000 _vis='yes'
2001 proc='ultrasparc'
2002 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2003 elif sunos ; then
2004 echocheck "CPU type"
2005 karch=$(uname -m)
2006 case "$(echo $karch)" in
2007 sun4) proc=v7 ;;
2008 sun4c) proc=v7 ;;
2009 sun4d) proc=v8 ;;
2010 sun4m) proc=v8 ;;
2011 sun4u) proc=ultrasparc _vis='yes' ;;
2012 sun4v) proc=v9 ;;
2013 *) proc=v8 ;;
2014 esac
2015 echores "$proc"
2016 else
2017 proc=v8
2019 _mcpu="-mcpu=$proc"
2020 _optimizing="$proc"
2023 arm*)
2024 arch='arm'
2025 iproc='arm'
2028 avr32)
2029 arch='avr32'
2030 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2031 iproc='avr32'
2032 test $_fast_clz = "auto" && _fast_clz=yes
2035 sh|sh4)
2036 arch='sh4'
2037 iproc='sh4'
2040 ppc|ppc64|powerpc|powerpc64)
2041 arch='ppc'
2042 def_dcbzl='#define HAVE_DCBZL 0'
2043 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2044 iproc='ppc'
2046 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2047 subarch='ppc64'
2048 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2050 echocheck "CPU type"
2051 case $system_name in
2052 Linux)
2053 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2054 if test -n "$($_cpuinfo | grep altivec)"; then
2055 test $_altivec = auto && _altivec=yes
2058 Darwin)
2059 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2060 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2061 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2062 test $_altivec = auto && _altivec=yes
2065 NetBSD)
2066 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2067 case $cc_version in
2068 2*|3.0*|3.1*|3.2*|3.3*)
2071 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2072 test $_altivec = auto && _altivec=yes
2075 esac
2077 AIX)
2078 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2080 esac
2081 if test "$_altivec" = yes; then
2082 echores "$proc altivec"
2083 else
2084 _altivec=no
2085 echores "$proc"
2088 echocheck "GCC & CPU optimization abilities"
2090 if test -n "$proc"; then
2091 case "$proc" in
2092 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2093 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2094 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2095 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2096 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2097 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2098 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2099 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2100 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2101 *) ;;
2102 esac
2103 # gcc 3.1(.1) and up supports 7400 and 7450
2104 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2105 case "$proc" in
2106 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2107 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2108 *) ;;
2109 esac
2111 # gcc 3.2 and up supports 970
2112 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2113 case "$proc" in
2114 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2115 def_dcbzl='#define HAVE_DCBZL 1' ;;
2116 *) ;;
2117 esac
2119 # gcc 3.3 and up supports POWER4
2120 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2121 case "$proc" in
2122 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2123 *) ;;
2124 esac
2126 # gcc 3.4 and up supports 440*
2127 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2128 case "$proc" in
2129 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2130 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2131 *) ;;
2132 esac
2134 # gcc 4.0 and up supports POWER5
2135 if test "$_cc_major" -ge "4"; then
2136 case "$proc" in
2137 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2138 *) ;;
2139 esac
2143 if test -n "$_mcpu"; then
2144 _optimizing=$(echo $_mcpu | cut -c 8-)
2145 echores "$_optimizing"
2146 else
2147 echores "none"
2150 test $_fast_clz = "auto" && _fast_clz=yes
2154 alpha*)
2155 arch='alpha'
2156 iproc='alpha'
2157 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2159 echocheck "CPU type"
2160 cat > $TMPC << EOF
2161 int main(void) {
2162 unsigned long ver, mask;
2163 __asm__ ("implver %0" : "=r" (ver));
2164 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2165 printf("%ld-%x\n", ver, ~mask);
2166 return 0;
2169 $_cc -o "$TMPEXE" "$TMPC"
2170 case $("$TMPEXE") in
2172 0-0) proc="ev4"; _mvi="0";;
2173 1-0) proc="ev5"; _mvi="0";;
2174 1-1) proc="ev56"; _mvi="0";;
2175 1-101) proc="pca56"; _mvi="1";;
2176 2-303) proc="ev6"; _mvi="1";;
2177 2-307) proc="ev67"; _mvi="1";;
2178 2-1307) proc="ev68"; _mvi="1";;
2179 esac
2180 echores "$proc"
2182 echocheck "GCC & CPU optimization abilities"
2183 if test "$proc" = "ev68" ; then
2184 cc_check -mcpu=$proc || proc=ev67
2186 if test "$proc" = "ev67" ; then
2187 cc_check -mcpu=$proc || proc=ev6
2189 _mcpu="-mcpu=$proc"
2190 echores "$proc"
2192 test $_fast_clz = "auto" && _fast_clz=yes
2194 _optimizing="$proc"
2197 mips*)
2198 arch='mips'
2199 iproc='mips'
2201 if irix ; then
2202 echocheck "CPU type"
2203 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2204 case "$(echo $proc)" in
2205 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2206 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2207 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2208 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2209 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2210 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2211 esac
2212 # gcc < 3.x does not support -mtune.
2213 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2214 _mcpu=''
2216 echores "$proc"
2219 test $_fast_clz = "auto" && _fast_clz=yes
2223 hppa)
2224 arch='pa_risc'
2225 iproc='PA-RISC'
2228 s390)
2229 arch='s390'
2230 iproc='390'
2233 s390x)
2234 arch='s390x'
2235 iproc='390x'
2238 vax)
2239 arch='vax'
2240 iproc='vax'
2243 xtensa)
2244 arch='xtensa'
2245 iproc='xtensa'
2248 generic)
2249 arch='generic'
2253 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2254 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2255 die "unsupported architecture $host_arch"
2257 esac # case "$host_arch" in
2259 if test "$_runtime_cpudetection" = yes ; then
2260 if x86 ; then
2261 test "$_cmov" != no && _cmov=yes
2262 x86_32 && _cmov=no
2263 test "$_mmx" != no && _mmx=yes
2264 test "$_3dnow" != no && _3dnow=yes
2265 test "$_3dnowext" != no && _3dnowext=yes
2266 test "$_mmxext" != no && _mmxext=yes
2267 test "$_sse" != no && _sse=yes
2268 test "$_sse2" != no && _sse2=yes
2269 test "$_ssse3" != no && _ssse3=yes
2270 test "$_mtrr" != no && _mtrr=yes
2272 if ppc; then
2273 _altivec=yes
2278 # endian testing
2279 echocheck "byte order"
2280 if test "$_big_endian" = auto ; then
2281 cat > $TMPC <<EOF
2282 short ascii_name[] = {
2283 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2284 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2285 int main(void) { return (long)ascii_name; }
2287 if cc_check ; then
2288 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2289 _big_endian=yes
2290 else
2291 _big_endian=no
2293 else
2294 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2297 if test "$_big_endian" = yes ; then
2298 _byte_order='big-endian'
2299 def_words_endian='#define WORDS_BIGENDIAN 1'
2300 def_bigendian='#define HAVE_BIGENDIAN 1'
2301 else
2302 _byte_order='little-endian'
2303 def_words_endian='#undef WORDS_BIGENDIAN'
2304 def_bigendian='#define HAVE_BIGENDIAN 0'
2306 echores "$_byte_order"
2309 echocheck "extern symbol prefix"
2310 cat > $TMPC << EOF
2311 int ff_extern;
2313 cc_check -c || die "Symbol mangling check failed."
2314 sym=$($_nm -P -g $TMPEXE)
2315 extern_prefix=${sym%%ff_extern*}
2316 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2317 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2318 echores $extern_prefix
2321 echocheck "assembler support of -pipe option"
2322 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2323 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2326 echocheck "compiler support of named assembler arguments"
2327 _named_asm_args=yes
2328 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2329 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2330 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2331 _named_asm_args=no
2332 def_named_asm_args="#undef NAMED_ASM_ARGS"
2334 echores $_named_asm_args
2337 if darwin && test "$cc_vendor" = "gnu" ; then
2338 echocheck "GCC support of -mstackrealign"
2339 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2340 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2341 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2342 # wrong code with this flag, but this can be worked around by adding
2343 # -fno-unit-at-a-time as described in the blog post at
2344 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2345 cat > $TMPC << EOF
2346 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2347 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2349 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2350 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2351 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2352 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2353 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2356 # Checking for CFLAGS
2357 _install_strip="-s"
2358 if test "$_profile" != "" || test "$_debug" != "" ; then
2359 CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
2360 WARNFLAGS="-W -Wall"
2361 _install_strip=
2362 elif test -z "$CFLAGS" ; then
2363 if test "$cc_vendor" = "intel" ; then
2364 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2365 WARNFLAGS="-wd167 -wd556 -wd144"
2366 elif test "$cc_vendor" = "sun" ; then
2367 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2368 elif test "$cc_vendor" = "clang"; then
2369 CFLAGS="-O2 $_march $_pipe"
2370 elif test "$cc_vendor" != "gnu" ; then
2371 CFLAGS="-O2 $_march $_mcpu $_pipe"
2372 else
2373 CFLAGS="-O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2374 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2375 extra_ldflags="$extra_ldflags -ffast-math"
2377 else
2378 warn_cflags=yes
2381 if test "$cc_vendor" = "gnu" ; then
2382 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2383 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2384 # that's the only variable specific to C now, and this option is not valid
2385 # for C++.
2386 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2387 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2388 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2389 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2390 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2391 else
2392 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2395 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2396 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2399 if test -n "$LDFLAGS" ; then
2400 extra_ldflags="$extra_ldflags $LDFLAGS"
2401 warn_cflags=yes
2402 elif test "$cc_vendor" = "intel" ; then
2403 extra_ldflags="$extra_ldflags -i-static"
2405 if test -n "$CPPFLAGS" ; then
2406 extra_cflags="$extra_cflags $CPPFLAGS"
2407 warn_cflags=yes
2412 if x86_32 ; then
2413 # Checking assembler (_as) compatibility...
2414 # Added workaround for older as that reads from stdin by default - atmos
2415 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2416 echocheck "assembler ($_as $as_version)"
2418 _pref_as_version='2.9.1'
2419 echo 'nop' > $TMPS
2420 if test "$_mmx" = yes ; then
2421 echo 'emms' >> $TMPS
2423 if test "$_3dnow" = yes ; then
2424 _pref_as_version='2.10.1'
2425 echo 'femms' >> $TMPS
2427 if test "$_3dnowext" = yes ; then
2428 _pref_as_version='2.10.1'
2429 echo 'pswapd %mm0, %mm0' >> $TMPS
2431 if test "$_mmxext" = yes ; then
2432 _pref_as_version='2.10.1'
2433 echo 'movntq %mm0, (%eax)' >> $TMPS
2435 if test "$_sse" = yes ; then
2436 _pref_as_version='2.10.1'
2437 echo 'xorps %xmm0, %xmm0' >> $TMPS
2439 #if test "$_sse2" = yes ; then
2440 # _pref_as_version='2.11'
2441 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2443 if test "$_cmov" = yes ; then
2444 _pref_as_version='2.10.1'
2445 echo 'cmovb %eax, %ebx' >> $TMPS
2447 if test "$_ssse3" = yes ; then
2448 _pref_as_version='2.16.92'
2449 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2451 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2453 if test "$as_verc_fail" != yes ; then
2454 echores "ok"
2455 else
2456 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2457 echores "failed"
2458 die "obsolete binutils version"
2461 fi #if x86_32
2464 echocheck "PIC"
2465 pic=no
2466 cat > $TMPC << EOF
2467 int main(void) {
2468 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2469 #error PIC not enabled
2470 #endif
2471 return 0;
2474 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2475 echores $pic
2478 if x86 ; then
2480 echocheck ".align is a power of two"
2481 if test "$_asmalign_pot" = auto ; then
2482 _asmalign_pot=no
2483 inline_asm_check '".align 3"' && _asmalign_pot=yes
2485 if test "$_asmalign_pot" = "yes" ; then
2486 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2487 else
2488 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2490 echores $_asmalign_pot
2493 echocheck "10 assembler operands"
2494 ten_operands=no
2495 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2496 cat > $TMPC << EOF
2497 int main(void) {
2498 int x=0;
2499 __asm__ volatile(
2501 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2503 return 0;
2506 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2507 echores $ten_operands
2509 echocheck "ebx availability"
2510 ebx_available=no
2511 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2512 cat > $TMPC << EOF
2513 int main(void) {
2514 int x;
2515 __asm__ volatile(
2516 "xor %0, %0"
2517 :"=b"(x)
2518 // just adding ebx to clobber list seems unreliable with some
2519 // compilers, e.g. Haiku's gcc 2.95
2521 // and the above check does not work for OSX 64 bit...
2522 __asm__ volatile("":::"%ebx");
2523 return 0;
2526 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2527 echores $ebx_available
2530 echocheck "yasm"
2531 if test -z "$YASMFLAGS" ; then
2532 if darwin ; then
2533 x86_64 && objformat="macho64" || objformat="macho"
2534 elif win32 ; then
2535 objformat="win32"
2536 else
2537 objformat="elf"
2539 # currently tested for Linux x86, x86_64
2540 YASMFLAGS="-f $objformat"
2541 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2542 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2543 case "$objformat" in
2544 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2545 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2546 esac
2547 else
2548 warn_cflags=yes
2551 echo "pabsw xmm0, xmm0" > $TMPS
2552 yasm_check || _yasm=""
2553 if test $_yasm ; then
2554 def_yasm='#define HAVE_YASM 1'
2555 have_yasm="yes"
2556 echores "$_yasm"
2557 else
2558 def_yasm='#define HAVE_YASM 0'
2559 have_yasm="no"
2560 echores "no"
2563 echocheck "bswap"
2564 def_bswap='#define HAVE_BSWAP 0'
2565 echo 'bswap %eax' > $TMPS
2566 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2567 echores "$bswap"
2568 fi #if x86
2571 #FIXME: This should happen before the check for CFLAGS..
2572 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2573 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2575 # check if AltiVec is supported by the compiler, and how to enable it
2576 echocheck "GCC AltiVec flags"
2577 if $(cflag_check -maltivec -mabi=altivec) ; then
2578 _altivec_gcc_flags="-maltivec -mabi=altivec"
2579 # check if <altivec.h> should be included
2580 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2581 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2582 inc_altivec_h='#include <altivec.h>'
2583 else
2584 if $(cflag_check -faltivec) ; then
2585 _altivec_gcc_flags="-faltivec"
2586 else
2587 _altivec=no
2588 _altivec_gcc_flags="none, AltiVec disabled"
2592 echores "$_altivec_gcc_flags"
2594 # check if the compiler supports braces for vector declarations
2595 cat > $TMPC << EOF
2596 $inc_altivec_h
2597 int main(void) { (vector int) {1}; return 0; }
2599 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2601 # Disable runtime cpudetection if we cannot generate AltiVec code or
2602 # AltiVec is disabled by the user.
2603 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2604 && _runtime_cpudetection=no
2606 # Show that we are optimizing for AltiVec (if enabled and supported).
2607 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2608 && _optimizing="$_optimizing altivec"
2610 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2611 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2614 if ppc ; then
2615 def_xform_asm='#define HAVE_XFORM_ASM 0'
2616 xform_asm=no
2617 echocheck "XFORM ASM support"
2618 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2619 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2620 echores "$xform_asm"
2623 if arm ; then
2624 echocheck "ARM pld instruction"
2625 pld=no
2626 inline_asm_check '"pld [r0]"' && pld=yes
2627 echores "$pld"
2629 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2630 if test $_armv5te = "auto" ; then
2631 _armv5te=no
2632 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2634 echores "$_armv5te"
2636 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2638 echocheck "ARMv6 (SIMD instructions)"
2639 if test $_armv6 = "auto" ; then
2640 _armv6=no
2641 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2643 echores "$_armv6"
2645 echocheck "ARMv6t2 (SIMD instructions)"
2646 if test $_armv6t2 = "auto" ; then
2647 _armv6t2=no
2648 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2650 echores "$_armv6"
2652 echocheck "ARM VFP"
2653 if test $_armvfp = "auto" ; then
2654 _armvfp=no
2655 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2657 echores "$_armvfp"
2659 echocheck "ARM NEON"
2660 if test $neon = "auto" ; then
2661 neon=no
2662 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2664 echores "$neon"
2666 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2667 if test $_iwmmxt = "auto" ; then
2668 _iwmmxt=no
2669 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2671 echores "$_iwmmxt"
2674 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2675 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2676 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2677 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2678 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2679 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2680 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2681 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2682 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2683 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2684 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2685 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2686 test "$pld" = yes && cpuexts="PLD $cpuexts"
2687 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2688 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2689 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2690 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2691 test "$neon" = yes && cpuexts="NEON $cpuexts"
2692 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2693 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2694 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2696 # Checking kernel version...
2697 if x86_32 && linux ; then
2698 _k_verc_problem=no
2699 kernel_version=$(uname -r 2>&1)
2700 echocheck "$system_name kernel version"
2701 case "$kernel_version" in
2702 '') kernel_version="?.??"; _k_verc_fail=yes;;
2703 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2704 _k_verc_problem=yes;;
2705 esac
2706 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2707 _k_verc_fail=yes
2709 if test "$_k_verc_fail" ; then
2710 echores "$kernel_version, fail"
2711 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2712 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2713 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2714 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2715 echo "2.2.x you must upgrade it to get SSE support!"
2716 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2717 else
2718 echores "$kernel_version, ok"
2722 ######################
2723 # MAIN TESTS GO HERE #
2724 ######################
2727 echocheck "-lposix"
2728 if cflag_check -lposix ; then
2729 extra_ldflags="$extra_ldflags -lposix"
2730 echores "yes"
2731 else
2732 echores "no"
2735 echocheck "-lm"
2736 if cflag_check -lm ; then
2737 _ld_lm="-lm"
2738 echores "yes"
2739 else
2740 _ld_lm=""
2741 echores "no"
2745 echocheck "langinfo"
2746 if test "$_langinfo" = auto ; then
2747 _langinfo=no
2748 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2750 if test "$_langinfo" = yes ; then
2751 def_langinfo='#define HAVE_LANGINFO 1'
2752 else
2753 def_langinfo='#undef HAVE_LANGINFO'
2755 echores "$_langinfo"
2758 echocheck "translation support"
2759 if test "$_translation" = yes; then
2760 def_translation="#define CONFIG_TRANSLATION 1"
2761 else
2762 def_translation="#undef CONFIG_TRANSLATION"
2764 echores "$_translation"
2766 echocheck "language"
2767 # Set preferred languages, "all" uses English as main language.
2768 test -z "$language" && language=$LINGUAS
2769 test -z "$language_doc" && language_doc=$language
2770 test -z "$language_man" && language_man=$language
2771 test -z "$language_msg" && language_msg="all"
2772 language_doc=$(echo $language_doc | tr , " ")
2773 language_man=$(echo $language_man | tr , " ")
2774 language_msg=$(echo $language_msg | tr , " ")
2776 test "$language_doc" = "all" && language_doc=$doc_lang_all
2777 test "$language_man" = "all" && language_man=$man_lang_all
2778 test "$language_msg" = "all" && language_msg=$msg_lang_all
2780 if test "$_translation" != yes ; then
2781 language_msg=""
2784 # Prune non-existing translations from language lists.
2785 # Set message translation to the first available language.
2786 # Fall back on English.
2787 for lang in $language_doc ; do
2788 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2789 done
2790 language_doc=$tmp_language_doc
2791 test -z "$language_doc" && language_doc=en
2793 for lang in $language_man ; do
2794 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2795 done
2796 language_man=$tmp_language_man
2797 test -z "$language_man" && language_man=en
2799 for lang in $language_msg ; do
2800 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2801 done
2802 language_msg=$tmp_language_msg
2804 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2807 echocheck "enable sighandler"
2808 if test "$_sighandler" = yes ; then
2809 def_sighandler='#define CONFIG_SIGHANDLER 1'
2810 else
2811 def_sighandler='#undef CONFIG_SIGHANDLER'
2813 echores "$_sighandler"
2815 echocheck "runtime cpudetection"
2816 if test "$_runtime_cpudetection" = yes ; then
2817 _optimizing="Runtime CPU-Detection enabled"
2818 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2819 else
2820 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2822 echores "$_runtime_cpudetection"
2825 echocheck "restrict keyword"
2826 for restrict_keyword in restrict __restrict __restrict__ ; do
2827 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2828 if cc_check; then
2829 def_restrict_keyword=$restrict_keyword
2830 break;
2832 done
2833 if [ -n "$def_restrict_keyword" ]; then
2834 echores "$def_restrict_keyword"
2835 else
2836 echores "none"
2838 # Avoid infinite recursion loop ("#define restrict restrict")
2839 if [ "$def_restrict_keyword" != "restrict" ]; then
2840 def_restrict_keyword="#define restrict $def_restrict_keyword"
2841 else
2842 def_restrict_keyword=""
2846 echocheck "__builtin_expect"
2847 # GCC branch prediction hint
2848 cat > $TMPC << EOF
2849 static int foo(int a) {
2850 a = __builtin_expect(a, 10);
2851 return a == 10 ? 0 : 1;
2853 int main(void) { return foo(10) && foo(0); }
2855 _builtin_expect=no
2856 cc_check && _builtin_expect=yes
2857 if test "$_builtin_expect" = yes ; then
2858 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2859 else
2860 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2862 echores "$_builtin_expect"
2865 echocheck "kstat"
2866 _kstat=no
2867 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2868 if test "$_kstat" = yes ; then
2869 def_kstat="#define HAVE_LIBKSTAT 1"
2870 extra_ldflags="$extra_ldflags -lkstat"
2871 else
2872 def_kstat="#undef HAVE_LIBKSTAT"
2874 echores "$_kstat"
2877 echocheck "posix4"
2878 # required for nanosleep on some systems
2879 _posix4=no
2880 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2881 if test "$_posix4" = yes ; then
2882 extra_ldflags="$extra_ldflags -lposix4"
2884 echores "$_posix4"
2886 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2887 echocheck $func
2888 eval _$func=no
2889 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2890 if eval test "x\$_$func" = "xyes"; then
2891 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2892 echores yes
2893 else
2894 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2895 echores no
2897 done
2900 echocheck "mkstemp"
2901 _mkstemp=no
2902 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2903 if test "$_mkstemp" = yes ; then
2904 def_mkstemp='#define HAVE_MKSTEMP 1'
2905 else
2906 def_mkstemp='#define HAVE_MKSTEMP 0'
2908 echores "$_mkstemp"
2911 echocheck "nanosleep"
2912 _nanosleep=no
2913 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2914 if test "$_nanosleep" = yes ; then
2915 def_nanosleep='#define HAVE_NANOSLEEP 1'
2916 else
2917 def_nanosleep='#undef HAVE_NANOSLEEP'
2919 echores "$_nanosleep"
2922 echocheck "socklib"
2923 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2924 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2925 cat > $TMPC << EOF
2926 #include <netdb.h>
2927 #include <sys/socket.h>
2928 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2930 _socklib=no
2931 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2932 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2933 done
2934 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2935 if test $_winsock2_h = auto ; then
2936 _winsock2_h=no
2937 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2939 test "$_ld_sock" && res_comment="using $_ld_sock"
2940 echores "$_socklib"
2943 if test $_winsock2_h = yes ; then
2944 _ld_sock="-lws2_32"
2945 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2946 else
2947 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2951 echocheck "arpa/inet.h"
2952 arpa_inet_h=no
2953 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2954 header_check arpa/inet.h && arpa_inet_h=yes &&
2955 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2956 echores "$arpa_inet_h"
2959 echocheck "inet_pton()"
2960 def_inet_pton='#define HAVE_INET_PTON 0'
2961 inet_pton=no
2962 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2963 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2964 done
2965 if test $inet_pton = yes ; then
2966 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2967 def_inet_pton='#define HAVE_INET_PTON 1'
2969 echores "$inet_pton"
2972 echocheck "inet_aton()"
2973 def_inet_aton='#define HAVE_INET_ATON 0'
2974 inet_aton=no
2975 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2976 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2977 done
2978 if test $inet_aton = yes ; then
2979 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2980 def_inet_aton='#define HAVE_INET_ATON 1'
2982 echores "$inet_aton"
2985 echocheck "socklen_t"
2986 _socklen_t=no
2987 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2988 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2989 done
2990 if test "$_socklen_t" = yes ; then
2991 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2992 else
2993 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2995 echores "$_socklen_t"
2998 echocheck "closesocket()"
2999 _closesocket=no
3000 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
3001 if test "$_closesocket" = yes ; then
3002 def_closesocket='#define HAVE_CLOSESOCKET 1'
3003 else
3004 def_closesocket='#define HAVE_CLOSESOCKET 0'
3006 echores "$_closesocket"
3009 echocheck "networking"
3010 test $_winsock2_h = no && test $inet_pton = no &&
3011 test $inet_aton = no && networking=no
3012 if test "$networking" = yes ; then
3013 def_network='#define CONFIG_NETWORK 1'
3014 def_networking='#define CONFIG_NETWORKING 1'
3015 extra_ldflags="$extra_ldflags $_ld_sock"
3016 inputmodules="networking $inputmodules"
3017 else
3018 noinputmodules="networking $noinputmodules"
3019 def_network='#define CONFIG_NETWORK 0'
3020 def_networking='#undef CONFIG_NETWORKING'
3022 echores "$networking"
3025 echocheck "inet6"
3026 if test "$_inet6" = auto ; then
3027 cat > $TMPC << EOF
3028 #include <sys/types.h>
3029 #if !defined(_WIN32)
3030 #include <sys/socket.h>
3031 #include <netinet/in.h>
3032 #else
3033 #include <ws2tcpip.h>
3034 #endif
3035 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3037 _inet6=no
3038 if cc_check $_ld_sock ; then
3039 _inet6=yes
3042 if test "$_inet6" = yes ; then
3043 def_inet6='#define HAVE_AF_INET6 1'
3044 else
3045 def_inet6='#undef HAVE_AF_INET6'
3047 echores "$_inet6"
3050 echocheck "gethostbyname2"
3051 if test "$_gethostbyname2" = auto ; then
3052 cat > $TMPC << EOF
3053 #include <sys/types.h>
3054 #include <sys/socket.h>
3055 #include <netdb.h>
3056 int main(void) { gethostbyname2("", AF_INET); return 0; }
3058 _gethostbyname2=no
3059 if cc_check ; then
3060 _gethostbyname2=yes
3063 if test "$_gethostbyname2" = yes ; then
3064 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3065 else
3066 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3068 echores "$_gethostbyname2"
3071 echocheck "inttypes.h (required)"
3072 _inttypes=no
3073 header_check inttypes.h && _inttypes=yes
3074 echores "$_inttypes"
3076 if test "$_inttypes" = no ; then
3077 echocheck "sys/bitypes.h (inttypes.h predecessor)"
3078 header_check sys/bitypes.h && _inttypes=yes
3079 if test "$_inttypes" = yes ; then
3080 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."
3081 else
3082 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3087 echocheck "malloc.h"
3088 _malloc=no
3089 header_check malloc.h && _malloc=yes
3090 if test "$_malloc" = yes ; then
3091 def_malloc_h='#define HAVE_MALLOC_H 1'
3092 else
3093 def_malloc_h='#define HAVE_MALLOC_H 0'
3095 echores "$_malloc"
3098 echocheck "memalign()"
3099 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3100 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3101 _memalign=no
3102 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3103 if test "$_memalign" = yes ; then
3104 def_memalign='#define HAVE_MEMALIGN 1'
3105 else
3106 def_memalign='#define HAVE_MEMALIGN 0'
3107 def_map_memalign='#define memalign(a, b) malloc(b)'
3108 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3110 echores "$_memalign"
3113 echocheck "posix_memalign()"
3114 posix_memalign=no
3115 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3116 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
3117 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3118 echores "$posix_memalign"
3121 echocheck "alloca.h"
3122 _alloca=no
3123 statement_check alloca.h 'alloca(0)' && _alloca=yes
3124 if cc_check ; then
3125 def_alloca_h='#define HAVE_ALLOCA_H 1'
3126 else
3127 def_alloca_h='#undef HAVE_ALLOCA_H'
3129 echores "$_alloca"
3132 echocheck "fastmemcpy"
3133 if test "$_fastmemcpy" = yes ; then
3134 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3135 else
3136 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3138 echores "$_fastmemcpy"
3141 echocheck "mman.h"
3142 _mman=no
3143 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3144 if test "$_mman" = yes ; then
3145 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3146 else
3147 def_mman_h='#undef HAVE_SYS_MMAN_H'
3148 os2 && need_mmap=yes
3150 echores "$_mman"
3152 _mman_has_map_failed=no
3153 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
3154 if test "$_mman_has_map_failed" = yes ; then
3155 def_mman_has_map_failed=''
3156 else
3157 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3160 echocheck "dynamic loader"
3161 _dl=no
3162 for _ld_tmp in "" "-ldl"; do
3163 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3164 done
3165 if test "$_dl" = yes ; then
3166 def_dl='#define HAVE_LIBDL 1'
3167 else
3168 def_dl='#undef HAVE_LIBDL'
3170 echores "$_dl"
3173 echocheck "dynamic a/v plugins support"
3174 if test "$_dl" = no ; then
3175 _dynamic_plugins=no
3177 if test "$_dynamic_plugins" = yes ; then
3178 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3179 else
3180 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3182 echores "$_dynamic_plugins"
3185 def_threads='#define HAVE_THREADS 0'
3187 echocheck "pthread"
3188 if linux ; then
3189 THREAD_CFLAGS=-D_REENTRANT
3190 elif freebsd || netbsd || openbsd || bsdos ; then
3191 THREAD_CFLAGS=-D_THREAD_SAFE
3193 if test "$_pthreads" = auto ; then
3194 cat > $TMPC << EOF
3195 #include <pthread.h>
3196 static void *func(void *arg) { return arg; }
3197 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3199 _pthreads=no
3200 if ! hpux ; then
3201 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3202 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3203 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3204 done
3207 if test "$_pthreads" = yes ; then
3208 test $_ld_pthread && res_comment="using $_ld_pthread"
3209 def_pthreads='#define HAVE_PTHREADS 1'
3210 def_threads='#define HAVE_THREADS 1'
3211 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3212 else
3213 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3214 def_pthreads='#undef HAVE_PTHREADS'
3215 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3216 mingw32 || _win32dll=no
3218 echores "$_pthreads"
3220 if cygwin ; then
3221 if test "$_pthreads" = yes ; then
3222 def_pthread_cache="#define PTHREAD_CACHE 1"
3223 else
3224 _stream_cache=no
3225 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3229 echocheck "w32threads"
3230 if test "$_pthreads" = yes ; then
3231 res_comment="using pthread instead"
3232 _w32threads=no
3234 if test "$_w32threads" = auto ; then
3235 _w32threads=no
3236 mingw32 && _w32threads=yes
3238 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3239 echores "$_w32threads"
3241 echocheck "rpath"
3242 if test "$_rpath" = yes ; then
3243 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3244 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3245 done
3246 extra_ldflags=$tmp
3248 echores "$_rpath"
3250 echocheck "iconv"
3251 if test "$_iconv" = auto ; then
3252 cat > $TMPC << EOF
3253 #include <stdio.h>
3254 #include <unistd.h>
3255 #include <iconv.h>
3256 #define INBUFSIZE 1024
3257 #define OUTBUFSIZE 4096
3259 char inbuffer[INBUFSIZE];
3260 char outbuffer[OUTBUFSIZE];
3262 int main(void) {
3263 size_t numread;
3264 iconv_t icdsc;
3265 char *tocode="UTF-8";
3266 char *fromcode="cp1250";
3267 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3268 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3269 char *iptr=inbuffer;
3270 char *optr=outbuffer;
3271 size_t inleft=numread;
3272 size_t outleft=OUTBUFSIZE;
3273 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3274 != (size_t)(-1)) {
3275 write(1, outbuffer, OUTBUFSIZE - outleft);
3278 if (iconv_close(icdsc) == -1)
3281 return 0;
3284 _iconv=no
3285 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3286 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3287 _iconv=yes && break
3288 done
3290 if test "$_iconv" = yes ; then
3291 def_iconv='#define CONFIG_ICONV 1'
3292 else
3293 def_iconv='#undef CONFIG_ICONV'
3295 echores "$_iconv"
3298 echocheck "soundcard.h"
3299 _soundcard_h=no
3300 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3301 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3302 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3303 header_check $_soundcard_header && _soundcard_h=yes &&
3304 res_comment="$_soundcard_header" && break
3305 done
3307 if test "$_soundcard_h" = yes ; then
3308 if test $_soundcard_header = "sys/soundcard.h"; then
3309 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3310 else
3311 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3314 echores "$_soundcard_h"
3317 echocheck "sys/dvdio.h"
3318 _dvdio=no
3319 # FreeBSD 8.1 has broken dvdio.h
3320 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3321 if test "$_dvdio" = yes ; then
3322 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3323 else
3324 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3326 echores "$_dvdio"
3329 echocheck "sys/cdio.h"
3330 _cdio=no
3331 # at least OpenSolaris has a broken cdio.h
3332 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3333 if test "$_cdio" = yes ; then
3334 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3335 else
3336 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3338 echores "$_cdio"
3341 echocheck "linux/cdrom.h"
3342 _cdrom=no
3343 header_check linux/cdrom.h && _cdrom=yes
3344 if test "$_cdrom" = yes ; then
3345 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3346 else
3347 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3349 echores "$_cdrom"
3352 echocheck "dvd.h"
3353 _dvd=no
3354 header_check dvd.h && _dvd=yes
3355 if test "$_dvd" = yes ; then
3356 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3357 else
3358 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3360 echores "$_dvd"
3363 if bsdos; then
3364 echocheck "BSDI dvd.h"
3365 _bsdi_dvd=no
3366 header_check dvd.h && _bsdi_dvd=yes
3367 if test "$_bsdi_dvd" = yes ; then
3368 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3369 else
3370 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3372 echores "$_bsdi_dvd"
3373 fi #if bsdos
3376 if hpux; then
3377 # also used by AIX, but AIX does not support VCD and/or libdvdread
3378 echocheck "HP-UX SCSI header"
3379 _hpux_scsi_h=no
3380 header_check sys/scsi.h && _hpux_scsi_h=yes
3381 if test "$_hpux_scsi_h" = yes ; then
3382 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3383 else
3384 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3386 echores "$_hpux_scsi_h"
3387 fi #if hpux
3390 if sunos; then
3391 echocheck "userspace SCSI headers (Solaris)"
3392 _sol_scsi_h=no
3393 header_check sys/scsi/scsi_types.h &&
3394 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3395 _sol_scsi_h=yes
3396 if test "$_sol_scsi_h" = yes ; then
3397 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3398 else
3399 def_sol_scsi_h='#undef SOLARIS_USCSI'
3401 echores "$_sol_scsi_h"
3402 fi #if sunos
3405 echocheck "termcap"
3406 if test "$_termcap" = auto ; then
3407 _termcap=no
3408 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3409 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3410 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3411 done
3413 if test "$_termcap" = yes ; then
3414 def_termcap='#define HAVE_TERMCAP 1'
3415 test $_ld_tmp && res_comment="using $_ld_tmp"
3416 else
3417 def_termcap='#undef HAVE_TERMCAP'
3419 echores "$_termcap"
3422 echocheck "termios"
3423 def_termios='#undef HAVE_TERMIOS'
3424 def_termios_h='#undef HAVE_TERMIOS_H'
3425 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3426 if test "$_termios" = auto ; then
3427 _termios=no
3428 for _termios_header in "termios.h" "sys/termios.h"; do
3429 header_check $_termios_header && _termios=yes &&
3430 res_comment="using $_termios_header" && break
3431 done
3434 if test "$_termios" = yes ; then
3435 def_termios='#define HAVE_TERMIOS 1'
3436 if test "$_termios_header" = "termios.h" ; then
3437 def_termios_h='#define HAVE_TERMIOS_H 1'
3438 else
3439 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3442 echores "$_termios"
3445 echocheck "shm"
3446 if test "$_shm" = auto ; then
3447 _shm=no
3448 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3450 if test "$_shm" = yes ; then
3451 def_shm='#define HAVE_SHM 1'
3452 else
3453 def_shm='#undef HAVE_SHM'
3455 echores "$_shm"
3458 echocheck "strsep()"
3459 _strsep=no
3460 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3461 if test "$_strsep" = yes ; then
3462 def_strsep='#define HAVE_STRSEP 1'
3463 need_strsep=no
3464 else
3465 def_strsep='#undef HAVE_STRSEP'
3466 need_strsep=yes
3468 echores "$_strsep"
3471 echocheck "vsscanf()"
3472 cat > $TMPC << EOF
3473 #define _ISOC99_SOURCE
3474 #include <stdarg.h>
3475 #include <stdio.h>
3476 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3478 _vsscanf=no
3479 cc_check && _vsscanf=yes
3480 if test "$_vsscanf" = yes ; then
3481 def_vsscanf='#define HAVE_VSSCANF 1'
3482 need_vsscanf=no
3483 else
3484 def_vsscanf='#undef HAVE_VSSCANF'
3485 need_vsscanf=yes
3487 echores "$_vsscanf"
3490 echocheck "swab()"
3491 _swab=no
3492 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3493 if test "$_swab" = yes ; then
3494 def_swab='#define HAVE_SWAB 1'
3495 need_swab=no
3496 else
3497 def_swab='#undef HAVE_SWAB'
3498 need_swab=yes
3500 echores "$_swab"
3502 echocheck "POSIX select()"
3503 cat > $TMPC << EOF
3504 #include <stdio.h>
3505 #include <stdlib.h>
3506 #include <sys/types.h>
3507 #include <string.h>
3508 #include <sys/time.h>
3509 #include <unistd.h>
3510 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3512 _posix_select=no
3513 def_posix_select='#undef HAVE_POSIX_SELECT'
3514 #select() of kLIBC (OS/2) supports socket only
3515 ! os2 && cc_check && _posix_select=yes &&
3516 def_posix_select='#define HAVE_POSIX_SELECT 1'
3517 echores "$_posix_select"
3520 echocheck "audio select()"
3521 if test "$_select" = no ; then
3522 def_select='#undef HAVE_AUDIO_SELECT'
3523 elif test "$_select" = yes ; then
3524 def_select='#define HAVE_AUDIO_SELECT 1'
3526 echores "$_select"
3529 echocheck "gettimeofday()"
3530 _gettimeofday=no
3531 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3532 if test "$_gettimeofday" = yes ; then
3533 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3534 need_gettimeofday=no
3535 else
3536 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3537 need_gettimeofday=yes
3539 echores "$_gettimeofday"
3542 echocheck "glob()"
3543 _glob=no
3544 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3545 if test "$_glob" = yes ; then
3546 def_glob='#define HAVE_GLOB 1'
3547 need_glob=no
3548 else
3549 def_glob='#undef HAVE_GLOB'
3550 need_glob=yes
3552 echores "$_glob"
3555 echocheck "setenv()"
3556 _setenv=no
3557 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3558 if test "$_setenv" = yes ; then
3559 def_setenv='#define HAVE_SETENV 1'
3560 need_setenv=no
3561 else
3562 def_setenv='#undef HAVE_SETENV'
3563 need_setenv=yes
3565 echores "$_setenv"
3568 echocheck "setmode()"
3569 _setmode=no
3570 def_setmode='#define HAVE_SETMODE 0'
3571 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3572 echores "$_setmode"
3575 if sunos; then
3576 echocheck "sysi86()"
3577 _sysi86=no
3578 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3579 if test "$_sysi86" = yes ; then
3580 def_sysi86='#define HAVE_SYSI86 1'
3581 statement_check sys/sysi86.h 'int sysi86(int, void*); sysi86(0)' && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3582 else
3583 def_sysi86='#undef HAVE_SYSI86'
3585 echores "$_sysi86"
3586 fi #if sunos
3589 echocheck "sys/sysinfo.h"
3590 _sys_sysinfo=no
3591 statement_check sys/sysinfo.h 'struct sysinfo s_info; sysinfo(&s_info)' && _sys_sysinfo=yes
3592 if test "$_sys_sysinfo" = yes ; then
3593 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3594 else
3595 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3597 echores "$_sys_sysinfo"
3600 if darwin; then
3602 echocheck "Mac OS X Finder Support"
3603 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3604 if test "$_macosx_finder" = yes ; then
3605 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3606 extra_ldflags="$extra_ldflags -framework Carbon"
3608 echores "$_macosx_finder"
3610 echocheck "Mac OS X Bundle file locations"
3611 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3612 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3613 if test "$_macosx_bundle" = yes ; then
3614 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3615 extra_ldflags="$extra_ldflags -framework Carbon"
3617 echores "$_macosx_bundle"
3619 echocheck "Apple Remote"
3620 if test "$_apple_remote" = auto ; then
3621 _apple_remote=no
3622 cat > $TMPC <<EOF
3623 #include <stdio.h>
3624 #include <IOKit/IOCFPlugIn.h>
3625 int main(void) {
3626 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3627 CFMutableDictionaryRef hidMatchDictionary;
3628 IOReturn ioReturnValue;
3630 // Set up a matching dictionary to search the I/O Registry by class.
3631 // name for all HID class devices
3632 hidMatchDictionary = IOServiceMatching("AppleIRController");
3634 // Now search I/O Registry for matching devices.
3635 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3636 hidMatchDictionary, &hidObjectIterator);
3638 // If search is unsuccessful, return nonzero.
3639 if (ioReturnValue != kIOReturnSuccess ||
3640 !IOIteratorIsValid(hidObjectIterator)) {
3641 return 1;
3643 return 0;
3646 cc_check -framework IOKit && _apple_remote=yes
3648 if test "$_apple_remote" = yes ; then
3649 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3650 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3651 else
3652 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3654 echores "$_apple_remote"
3656 fi #if darwin
3658 if linux; then
3660 echocheck "Apple IR"
3661 if test "$_apple_ir" = auto ; then
3662 _apple_ir=no
3663 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3665 if test "$_apple_ir" = yes ; then
3666 def_apple_ir='#define CONFIG_APPLE_IR 1'
3667 else
3668 def_apple_ir='#undef CONFIG_APPLE_IR'
3670 echores "$_apple_ir"
3671 fi #if linux
3673 echocheck "pkg-config"
3674 _pkg_config=pkg-config
3675 if $($_pkg_config --version > /dev/null 2>&1); then
3676 if test "$_ld_static"; then
3677 _pkg_config="$_pkg_config --static"
3679 echores "yes"
3680 else
3681 _pkg_config=false
3682 echores "no"
3686 echocheck "Samba support (libsmbclient)"
3687 if test "$_smb" = yes; then
3688 extra_ldflags="$extra_ldflags -lsmbclient"
3690 if test "$_smb" = auto; then
3691 _smb=no
3692 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3693 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3694 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3695 done
3698 if test "$_smb" = yes; then
3699 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3700 inputmodules="smb $inputmodules"
3701 else
3702 def_smb="#undef CONFIG_LIBSMBCLIENT"
3703 noinputmodules="smb $noinputmodules"
3705 echores "$_smb"
3708 #########
3709 # VIDEO #
3710 #########
3713 echocheck "tdfxfb"
3714 if test "$_tdfxfb" = yes ; then
3715 def_tdfxfb='#define CONFIG_TDFXFB 1'
3716 vomodules="tdfxfb $vomodules"
3717 else
3718 def_tdfxfb='#undef CONFIG_TDFXFB'
3719 novomodules="tdfxfb $novomodules"
3721 echores "$_tdfxfb"
3723 echocheck "s3fb"
3724 if test "$_s3fb" = yes ; then
3725 def_s3fb='#define CONFIG_S3FB 1'
3726 vomodules="s3fb $vomodules"
3727 else
3728 def_s3fb='#undef CONFIG_S3FB'
3729 novomodules="s3fb $novomodules"
3731 echores "$_s3fb"
3733 echocheck "wii"
3734 if test "$_wii" = yes ; then
3735 def_wii='#define CONFIG_WII 1'
3736 vomodules="wii $vomodules"
3737 else
3738 def_wii='#undef CONFIG_WII'
3739 novomodules="wii $novomodules"
3741 echores "$_wii"
3743 echocheck "tdfxvid"
3744 if test "$_tdfxvid" = yes ; then
3745 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3746 vomodules="tdfx_vid $vomodules"
3747 else
3748 def_tdfxvid='#undef CONFIG_TDFX_VID'
3749 novomodules="tdfx_vid $novomodules"
3751 echores "$_tdfxvid"
3753 echocheck "xvr100"
3754 if test "$_xvr100" = auto ; then
3755 cat > $TMPC << EOF
3756 #include <unistd.h>
3757 #include <sys/fbio.h>
3758 #include <sys/visual_io.h>
3759 int main(void) {
3760 struct vis_identifier ident;
3761 struct fbgattr attr;
3762 ioctl(0, VIS_GETIDENTIFIER, &ident);
3763 ioctl(0, FBIOGATTR, &attr);
3764 return 0;
3767 _xvr100=no
3768 cc_check && _xvr100=yes
3770 if test "$_xvr100" = yes ; then
3771 def_xvr100='#define CONFIG_XVR100 1'
3772 vomodules="xvr100 $vomodules"
3773 else
3774 def_tdfxvid='#undef CONFIG_XVR100'
3775 novomodules="xvr100 $novomodules"
3777 echores "$_xvr100"
3779 echocheck "tga"
3780 if test "$_tga" = yes ; then
3781 def_tga='#define CONFIG_TGA 1'
3782 vomodules="tga $vomodules"
3783 else
3784 def_tga='#undef CONFIG_TGA'
3785 novomodules="tga $novomodules"
3787 echores "$_tga"
3790 echocheck "md5sum support"
3791 if test "$_md5sum" = yes; then
3792 def_md5sum="#define CONFIG_MD5SUM 1"
3793 vomodules="md5sum $vomodules"
3794 else
3795 def_md5sum="#undef CONFIG_MD5SUM"
3796 novomodules="md5sum $novomodules"
3798 echores "$_md5sum"
3801 echocheck "yuv4mpeg support"
3802 if test "$_yuv4mpeg" = yes; then
3803 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3804 vomodules="yuv4mpeg $vomodules"
3805 else
3806 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3807 novomodules="yuv4mpeg $novomodules"
3809 echores "$_yuv4mpeg"
3812 echocheck "bl"
3813 if test "$_bl" = yes ; then
3814 def_bl='#define CONFIG_BL 1'
3815 vomodules="bl $vomodules"
3816 else
3817 def_bl='#undef CONFIG_BL'
3818 novomodules="bl $novomodules"
3820 echores "$_bl"
3823 echocheck "DirectFB"
3824 if test "$_directfb" = auto ; then
3825 _directfb=no
3826 cat > $TMPC << EOF
3827 #include <directfb.h>
3828 #include <directfb_version.h>
3829 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3830 #error "DirectFB version too old."
3831 #endif
3832 int main(void) { DirectFBInit(0, 0); return 0; }
3834 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3835 cc_check $_inc_tmp -ldirectfb &&
3836 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3837 done
3839 if test "$_directfb" = yes ; then
3840 def_directfb='#define CONFIG_DIRECTFB 1'
3841 vomodules="directfb dfbmga $vomodules"
3842 libs_mplayer="$libs_mplayer -ldirectfb"
3843 else
3844 def_directfb='#undef CONFIG_DIRECTFB'
3845 novomodules="directfb dfbmga $novomodules"
3847 echores "$_directfb"
3850 echocheck "X11 headers presence"
3851 _x11_headers="no"
3852 res_comment="check if the dev(el) packages are installed"
3853 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3854 if test -f "$I/X11/Xlib.h" ; then
3855 _x11_headers="yes"
3856 res_comment=""
3857 break
3859 done
3860 if test $_cross_compile = no; then
3861 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3862 /usr/include/X11R6 /usr/openwin/include ; do
3863 if test -f "$I/X11/Xlib.h" ; then
3864 extra_cflags="$extra_cflags -I$I"
3865 _x11_headers="yes"
3866 res_comment="using $I"
3867 break
3869 done
3871 echores "$_x11_headers"
3874 echocheck "X11"
3875 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3876 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3877 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3878 -L/usr/lib ; do
3879 if netbsd; then
3880 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3881 else
3882 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3884 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3885 libs_mplayer="$libs_mplayer $_ld_tmp" && _x11=yes && break
3886 done
3888 if test "$_x11" = yes ; then
3889 def_x11='#define CONFIG_X11 1'
3890 vomodules="x11 xover $vomodules"
3891 else
3892 _x11=no
3893 def_x11='#undef CONFIG_X11'
3894 novomodules="x11 $novomodules"
3895 res_comment="check if the dev(el) packages are installed"
3896 # disable stuff that depends on X
3897 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
3899 echores "$_x11"
3901 echocheck "Xss screensaver extensions"
3902 if test "$_xss" = auto ; then
3903 _xss=no
3904 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3906 if test "$_xss" = yes ; then
3907 def_xss='#define CONFIG_XSS 1'
3908 libs_mplayer="$libs_mplayer -lXss"
3909 else
3910 def_xss='#undef CONFIG_XSS'
3912 echores "$_xss"
3914 echocheck "DPMS"
3915 _xdpms3=no
3916 _xdpms4=no
3917 if test "$_x11" = yes ; then
3918 cat > $TMPC <<EOF
3919 #include <X11/Xmd.h>
3920 #include <X11/Xlib.h>
3921 #include <X11/Xutil.h>
3922 #include <X11/Xatom.h>
3923 #include <X11/extensions/dpms.h>
3924 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3926 cc_check -lXdpms && _xdpms3=yes
3927 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3929 if test "$_xdpms4" = yes ; then
3930 def_xdpms='#define CONFIG_XDPMS 1'
3931 res_comment="using Xdpms 4"
3932 echores "yes"
3933 elif test "$_xdpms3" = yes ; then
3934 def_xdpms='#define CONFIG_XDPMS 1'
3935 libs_mplayer="$libs_mplayer -lXdpms"
3936 res_comment="using Xdpms 3"
3937 echores "yes"
3938 else
3939 def_xdpms='#undef CONFIG_XDPMS'
3940 echores "no"
3944 echocheck "Xv"
3945 if test "$_xv" = auto ; then
3946 _xv=no
3947 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3950 if test "$_xv" = yes ; then
3951 def_xv='#define CONFIG_XV 1'
3952 libs_mplayer="$libs_mplayer -lXv"
3953 vomodules="xv $vomodules"
3954 else
3955 def_xv='#undef CONFIG_XV'
3956 novomodules="xv $novomodules"
3958 echores "$_xv"
3961 echocheck "XvMC"
3962 if test "$_xv" = yes && test "$_xvmc" != no ; then
3963 _xvmc=no
3964 cat > $TMPC <<EOF
3965 #include <X11/Xlib.h>
3966 #include <X11/extensions/Xvlib.h>
3967 #include <X11/extensions/XvMClib.h>
3968 int main(void) {
3969 XvMCQueryExtension(0, 0, 0);
3970 XvMCCreateContext(0, 0, 0, 0, 0, 0, 0);
3971 return 0; }
3973 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3974 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3975 done
3977 if test "$_xvmc" = yes ; then
3978 def_xvmc='#define CONFIG_XVMC 1'
3979 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
3980 vomodules="xvmc $vomodules"
3981 res_comment="using $_xvmclib"
3982 else
3983 def_xvmc='#define CONFIG_XVMC 0'
3984 novomodules="xvmc $novomodules"
3986 echores "$_xvmc"
3989 echocheck "VDPAU"
3990 if test "$_vdpau" = auto ; then
3991 _vdpau=no
3992 if test "$_dl" = yes ; then
3993 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
3996 if test "$_vdpau" = yes ; then
3997 def_vdpau='#define CONFIG_VDPAU 1'
3998 libs_mplayer="$libs_mplayer -lvdpau"
3999 vomodules="vdpau $vomodules"
4000 else
4001 def_vdpau='#define CONFIG_VDPAU 0'
4002 novomodules="vdpau $novomodules"
4004 echores "$_vdpau"
4007 echocheck "Xinerama"
4008 if test "$_xinerama" = auto ; then
4009 _xinerama=no
4010 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
4013 if test "$_xinerama" = yes ; then
4014 def_xinerama='#define CONFIG_XINERAMA 1'
4015 libs_mplayer="$libs_mplayer -lXinerama"
4016 else
4017 def_xinerama='#undef CONFIG_XINERAMA'
4019 echores "$_xinerama"
4022 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4023 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4024 # named 'X extensions' or something similar.
4025 # This check may be useful for future mplayer versions (to change resolution)
4026 # If you run into problems, remove '-lXxf86vm'.
4027 echocheck "Xxf86vm"
4028 if test "$_vm" = auto ; then
4029 _vm=no
4030 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
4032 if test "$_vm" = yes ; then
4033 def_vm='#define CONFIG_XF86VM 1'
4034 libs_mplayer="$libs_mplayer -lXxf86vm"
4035 else
4036 def_vm='#undef CONFIG_XF86VM'
4038 echores "$_vm"
4040 # Check for the presence of special keycodes, like audio control buttons
4041 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4042 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4043 # have these new keycodes.
4044 echocheck "XF86keysym"
4045 if test "$_xf86keysym" = auto; then
4046 _xf86keysym=no
4047 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
4049 if test "$_xf86keysym" = yes ; then
4050 def_xf86keysym='#define CONFIG_XF86XK 1'
4051 else
4052 def_xf86keysym='#undef CONFIG_XF86XK'
4054 echores "$_xf86keysym"
4056 echocheck "DGA"
4057 if test "$_dga2" = auto && test "$_x11" = yes ; then
4058 _dga2=no
4059 statement_check_broken X11/Xlib.h X11/extensions/xf86dga.h 'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2=yes
4061 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4062 _dga1=no
4063 statement_check_broken X11/Xlib.h X11/extensions/xf86dga.h 'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1=yes
4066 _dga=no
4067 def_dga='#undef CONFIG_DGA'
4068 def_dga1='#undef CONFIG_DGA1'
4069 def_dga2='#undef CONFIG_DGA2'
4070 if test "$_dga1" = yes ; then
4071 _dga=yes
4072 def_dga1='#define CONFIG_DGA1 1'
4073 res_comment="using DGA 1.0"
4074 elif test "$_dga2" = yes ; then
4075 _dga=yes
4076 def_dga2='#define CONFIG_DGA2 1'
4077 res_comment="using DGA 2.0"
4079 if test "$_dga" = yes ; then
4080 def_dga='#define CONFIG_DGA 1'
4081 libs_mplayer="$libs_mplayer -lXxf86dga"
4082 vomodules="dga $vomodules"
4083 else
4084 novomodules="dga $novomodules"
4086 echores "$_dga"
4089 echocheck "3dfx"
4090 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4091 def_3dfx='#define CONFIG_3DFX 1'
4092 vomodules="3dfx $vomodules"
4093 else
4094 def_3dfx='#undef CONFIG_3DFX'
4095 novomodules="3dfx $novomodules"
4097 echores "$_3dfx"
4100 echocheck "GGI"
4101 if test "$_ggi" = auto ; then
4102 _ggi=no
4103 statement_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4105 if test "$_ggi" = yes ; then
4106 def_ggi='#define CONFIG_GGI 1'
4107 libs_mplayer="$libs_mplayer -lggi"
4108 vomodules="ggi $vomodules"
4109 else
4110 def_ggi='#undef CONFIG_GGI'
4111 novomodules="ggi $novomodules"
4113 echores "$_ggi"
4115 echocheck "GGI extension: libggiwmh"
4116 if test "$_ggiwmh" = auto ; then
4117 _ggiwmh=no
4118 statement_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4120 # needed to get right output on obscure combination
4121 # like --disable-ggi --enable-ggiwmh
4122 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4123 def_ggiwmh='#define CONFIG_GGIWMH 1'
4124 libs_mplayer="$libs_mplayer -lggiwmh"
4125 else
4126 _ggiwmh=no
4127 def_ggiwmh='#undef CONFIG_GGIWMH'
4129 echores "$_ggiwmh"
4132 echocheck "AA"
4133 if test "$_aa" = auto ; then
4134 cat > $TMPC << EOF
4135 #include <aalib.h>
4136 int main(void) {
4137 aa_context *c;
4138 aa_renderparams *p;
4139 aa_init(0, 0, 0);
4140 c = aa_autoinit(&aa_defparams);
4141 p = aa_getrenderparams();
4142 aa_autoinitkbd(c, 0);
4143 return 0; }
4145 _aa=no
4146 for _ld_tmp in "-laa" ; do
4147 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4148 done
4150 if test "$_aa" = yes ; then
4151 def_aa='#define CONFIG_AA 1'
4152 if cygwin ; then
4153 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4155 vomodules="aa $vomodules"
4156 else
4157 def_aa='#undef CONFIG_AA'
4158 novomodules="aa $novomodules"
4160 echores "$_aa"
4163 echocheck "CACA"
4164 if test "$_caca" = auto ; then
4165 _caca=no
4166 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4167 cat > $TMPC << EOF
4168 #include <caca.h>
4169 #ifdef CACA_API_VERSION_1
4170 #include <caca0.h>
4171 #endif
4172 int main(void) { caca_init(); return 0; }
4174 cc_check $(caca-config --libs) && _caca=yes
4177 if test "$_caca" = yes ; then
4178 def_caca='#define CONFIG_CACA 1'
4179 extra_cflags="$extra_cflags $(caca-config --cflags)"
4180 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4181 vomodules="caca $vomodules"
4182 else
4183 def_caca='#undef CONFIG_CACA'
4184 novomodules="caca $novomodules"
4186 echores "$_caca"
4189 echocheck "SVGAlib"
4190 if test "$_svga" = auto ; then
4191 _svga=no
4192 header_check vga.h -lvga $_ld_lm && _svga=yes
4194 if test "$_svga" = yes ; then
4195 def_svga='#define CONFIG_SVGALIB 1'
4196 libs_mplayer="$libs_mplayer -lvga"
4197 vomodules="svga $vomodules"
4198 else
4199 def_svga='#undef CONFIG_SVGALIB'
4200 novomodules="svga $novomodules"
4202 echores "$_svga"
4205 echocheck "FBDev"
4206 if test "$_fbdev" = auto ; then
4207 _fbdev=no
4208 linux && _fbdev=yes
4210 if test "$_fbdev" = yes ; then
4211 def_fbdev='#define CONFIG_FBDEV 1'
4212 vomodules="fbdev $vomodules"
4213 else
4214 def_fbdev='#undef CONFIG_FBDEV'
4215 novomodules="fbdev $novomodules"
4217 echores "$_fbdev"
4221 echocheck "DVB"
4222 if test "$_dvb" = auto ; then
4223 _dvb=no
4224 cat >$TMPC << EOF
4225 #include <poll.h>
4226 #include <sys/ioctl.h>
4227 #include <stdio.h>
4228 #include <time.h>
4229 #include <unistd.h>
4230 #include <linux/dvb/dmx.h>
4231 #include <linux/dvb/frontend.h>
4232 #include <linux/dvb/video.h>
4233 #include <linux/dvb/audio.h>
4234 int main(void) {return 0;}
4236 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4237 cc_check $_inc_tmp && _dvb=yes &&
4238 extra_cflags="$extra_cflags $_inc_tmp" && break
4239 done
4241 echores "$_dvb"
4242 if test "$_dvb" = yes ; then
4243 _dvbin=yes
4244 inputmodules="dvb $inputmodules"
4245 def_dvb='#define CONFIG_DVB 1'
4246 def_dvbin='#define CONFIG_DVBIN 1'
4247 aomodules="mpegpes(dvb) $aomodules"
4248 vomodules="mpegpes(dvb) $vomodules"
4249 else
4250 _dvbin=no
4251 noinputmodules="dvb $noinputmodules"
4252 def_dvb='#undef CONFIG_DVB'
4253 def_dvbin='#undef CONFIG_DVBIN '
4254 aomodules="mpegpes(file) $aomodules"
4255 vomodules="mpegpes(file) $vomodules"
4259 if darwin; then
4261 echocheck "QuickTime"
4262 if test "$quicktime" = auto ; then
4263 quicktime=no
4264 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
4266 if test "$quicktime" = yes ; then
4267 extra_ldflags="$extra_ldflags -framework QuickTime"
4268 def_quicktime='#define CONFIG_QUICKTIME 1'
4269 else
4270 def_quicktime='#undef CONFIG_QUICKTIME'
4271 _quartz=no
4273 echores $quicktime
4275 echocheck "Quartz"
4276 if test "$_quartz" = auto ; then
4277 _quartz=no
4278 statement_check Carbon/Carbon.h 'CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false)' -framework Carbon && _quartz=yes
4280 if test "$_quartz" = yes ; then
4281 libs_mplayer="$libs_mplayer -framework Carbon"
4282 def_quartz='#define CONFIG_QUARTZ 1'
4283 vomodules="quartz $vomodules"
4284 else
4285 def_quartz='#undef CONFIG_QUARTZ'
4286 novomodules="quartz $novomodules"
4288 echores $_quartz
4290 echocheck "CoreVideo"
4291 if test "$_corevideo" = auto ; then
4292 cat > $TMPC <<EOF
4293 #include <Carbon/Carbon.h>
4294 #include <CoreServices/CoreServices.h>
4295 #include <OpenGL/OpenGL.h>
4296 #include <QuartzCore/CoreVideo.h>
4297 int main(void) { return 0; }
4299 _corevideo=no
4300 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4302 if test "$_corevideo" = yes ; then
4303 vomodules="corevideo $vomodules"
4304 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4305 def_corevideo='#define CONFIG_COREVIDEO 1'
4306 else
4307 novomodules="corevideo $novomodules"
4308 def_corevideo='#undef CONFIG_COREVIDEO'
4310 echores "$_corevideo"
4312 fi #if darwin
4315 echocheck "PNG support"
4316 if test "$_png" = auto ; then
4317 _png=no
4318 if irix ; then
4319 # Don't check for -lpng on irix since it has its own libpng
4320 # incompatible with the GNU libpng
4321 res_comment="disabled on irix (not GNU libpng)"
4322 else
4323 cat > $TMPC << EOF
4324 #include <stdio.h>
4325 #include <string.h>
4326 #include <png.h>
4327 int main(void) {
4328 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4329 printf("libpng: %s\n", png_libpng_ver);
4330 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4333 cc_check -lpng -lz $_ld_lm && _png=yes
4336 echores "$_png"
4337 if test "$_png" = yes ; then
4338 def_png='#define CONFIG_PNG 1'
4339 extra_ldflags="$extra_ldflags -lpng -lz"
4340 else
4341 def_png='#undef CONFIG_PNG'
4344 echocheck "MNG support"
4345 if test "$_mng" = auto ; then
4346 _mng=no
4347 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
4349 echores "$_mng"
4350 if test "$_mng" = yes ; then
4351 def_mng='#define CONFIG_MNG 1'
4352 extra_ldflags="$extra_ldflags -lmng -lz"
4353 else
4354 def_mng='#undef CONFIG_MNG'
4357 echocheck "JPEG support"
4358 if test "$_jpeg" = auto ; then
4359 _jpeg=no
4360 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
4362 echores "$_jpeg"
4364 if test "$_jpeg" = yes ; then
4365 def_jpeg='#define CONFIG_JPEG 1'
4366 vomodules="jpeg $vomodules"
4367 extra_ldflags="$extra_ldflags -ljpeg"
4368 else
4369 def_jpeg='#undef CONFIG_JPEG'
4370 novomodules="jpeg $novomodules"
4375 echocheck "PNM support"
4376 if test "$_pnm" = yes; then
4377 def_pnm="#define CONFIG_PNM 1"
4378 vomodules="pnm $vomodules"
4379 else
4380 def_pnm="#undef CONFIG_PNM"
4381 novomodules="pnm $novomodules"
4383 echores "$_pnm"
4387 echocheck "GIF support"
4388 # This is to appease people who want to force gif support.
4389 # If it is forced to yes, then we still do checks to determine
4390 # which gif library to use.
4391 if test "$_gif" = yes ; then
4392 _force_gif=yes
4393 _gif=auto
4396 if test "$_gif" = auto ; then
4397 _gif=no
4398 for _ld_gif in "-lungif" "-lgif" ; do
4399 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4400 done
4403 # If no library was found, and the user wants support forced,
4404 # then we force it on with libgif, as this is the safest
4405 # assumption IMHO. (libungif & libregif both create symbolic
4406 # links to libgif. We also assume that no x11 support is needed,
4407 # because if you are forcing this, then you _should_ know what
4408 # you are doing. [ Besides, package maintainers should never
4409 # have compiled x11 deps into libungif in the first place. ] )
4410 # </rant>
4411 # --Joey
4412 if test "$_force_gif" = yes && test "$_gif" = no ; then
4413 _gif=yes
4414 _ld_gif="-lgif"
4417 if test "$_gif" = yes ; then
4418 def_gif='#define CONFIG_GIF 1'
4419 codecmodules="gif $codecmodules"
4420 vomodules="gif89a $vomodules"
4421 res_comment="old version, some encoding functions disabled"
4422 def_gif_4='#undef CONFIG_GIF_4'
4423 extra_ldflags="$extra_ldflags $_ld_gif"
4425 cat > $TMPC << EOF
4426 #include <signal.h>
4427 #include <stdio.h>
4428 #include <stdlib.h>
4429 #include <gif_lib.h>
4430 static void catch(int sig) { exit(1); }
4431 int main(void) {
4432 signal(SIGSEGV, catch); // catch segfault
4433 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4434 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4435 return 0;
4438 if cc_check "$_ld_gif" ; then
4439 def_gif_4='#define CONFIG_GIF_4 1'
4440 res_comment=""
4442 else
4443 def_gif='#undef CONFIG_GIF'
4444 def_gif_4='#undef CONFIG_GIF_4'
4445 novomodules="gif89a $novomodules"
4446 nocodecmodules="gif $nocodecmodules"
4448 echores "$_gif"
4451 case "$_gif" in yes*)
4452 echocheck "broken giflib workaround"
4453 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4455 cat > $TMPC << EOF
4456 #include <stdio.h>
4457 #include <gif_lib.h>
4458 int main(void) {
4459 GifFileType gif = {.UserData = NULL};
4460 printf("UserData is at address %p\n", gif.UserData);
4461 return 0;
4464 if cc_check "$_ld_gif" ; then
4465 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4466 echores "disabled"
4467 else
4468 echores "enabled"
4471 esac
4474 echocheck "VESA support"
4475 if test "$_vesa" = auto ; then
4476 _vesa=no
4477 statement_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4479 if test "$_vesa" = yes ; then
4480 def_vesa='#define CONFIG_VESA 1'
4481 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4482 vomodules="vesa $vomodules"
4483 else
4484 def_vesa='#undef CONFIG_VESA'
4485 novomodules="vesa $novomodules"
4487 echores "$_vesa"
4489 #################
4490 # VIDEO + AUDIO #
4491 #################
4494 echocheck "SDL"
4495 _inc_tmp=""
4496 _ld_tmp=""
4497 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4498 if test -z "$_sdlconfig" ; then
4499 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4500 _sdlconfig="sdl-config"
4501 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4502 _sdlconfig="sdl11-config"
4503 else
4504 _sdlconfig=false
4507 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4508 cat > $TMPC << EOF
4509 #ifdef CONFIG_SDL_SDL_H
4510 #include <SDL/SDL.h>
4511 #else
4512 #include <SDL.h>
4513 #endif
4514 #ifndef __APPLE__
4515 // we allow SDL hacking our main() only on OSX
4516 #undef main
4517 #endif
4518 int main(int argc, char *argv[]) {
4519 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4520 return 0;
4523 _sdl=no
4524 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4525 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4526 _sdl=yes
4527 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4528 break
4530 done
4531 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4532 res_comment="using $_sdlconfig"
4533 if cygwin ; then
4534 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4535 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4536 elif mingw32 ; then
4537 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4538 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4539 else
4540 _inc_tmp="$($_sdlconfig --cflags)"
4541 _ld_tmp="$($_sdlconfig --libs)"
4543 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4544 _sdl=yes
4545 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4546 # HACK for BeOS/Haiku SDL
4547 _ld_tmp="$_ld_tmp -lstdc++"
4548 _sdl=yes
4552 if test "$_sdl" = yes ; then
4553 def_sdl='#define CONFIG_SDL 1'
4554 extra_cflags="$extra_cflags $_inc_tmp"
4555 libs_mplayer="$libs_mplayer $_ld_tmp"
4556 vomodules="sdl $vomodules"
4557 aomodules="sdl $aomodules"
4558 else
4559 def_sdl='#undef CONFIG_SDL'
4560 novomodules="sdl $novomodules"
4561 noaomodules="sdl $noaomodules"
4563 echores "$_sdl"
4566 # make sure this stays below CoreVideo to avoid issues due to namespace
4567 # conflicts between -lGL and -framework OpenGL
4568 echocheck "OpenGL"
4569 #Note: this test is run even with --enable-gl since we autodetect linker flags
4570 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
4571 cat > $TMPC << EOF
4572 #ifdef GL_WIN32
4573 #include <windows.h>
4574 #include <GL/gl.h>
4575 #elif defined(GL_SDL)
4576 #include <GL/gl.h>
4577 #ifdef CONFIG_SDL_SDL_H
4578 #include <SDL/SDL.h>
4579 #else
4580 #include <SDL.h>
4581 #endif
4582 #ifndef __APPLE__
4583 // we allow SDL hacking our main() only on OSX
4584 #undef main
4585 #endif
4586 #else
4587 #include <GL/gl.h>
4588 #include <X11/Xlib.h>
4589 #include <GL/glx.h>
4590 #endif
4591 int main(int argc, char *argv[]) {
4592 #ifdef GL_WIN32
4593 HDC dc;
4594 wglCreateContext(dc);
4595 #elif defined(GL_SDL)
4596 SDL_GL_SwapBuffers();
4597 #else
4598 glXCreateContext(NULL, NULL, NULL, True);
4599 #endif
4600 glFinish();
4601 return 0;
4604 _gl=no
4605 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4606 if cc_check $_ld_tmp $_ld_lm ; then
4607 _gl=yes
4608 _gl_x11=yes
4609 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4610 break
4612 done
4613 if cc_check -DGL_WIN32 -lopengl32 ; then
4614 _gl=yes
4615 _gl_win32=yes
4616 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4618 # last so it can reuse any linker etc. flags detected before
4619 if test "$_sdl" = yes ; then
4620 if cc_check -DGL_SDL ||
4621 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4622 _gl=yes
4623 _gl_sdl=yes
4624 elif cc_check -DGL_SDL -lGL ||
4625 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4626 _gl=yes
4627 _gl_sdl=yes
4628 libs_mplayer="$libs_mplayer -lGL"
4631 else
4632 _gl=no
4634 if test "$_gl" = yes ; then
4635 def_gl='#define CONFIG_GL 1'
4636 res_comment="backends:"
4637 if test "$_gl_win32" = yes ; then
4638 def_gl_win32='#define CONFIG_GL_WIN32 1'
4639 res_comment="$res_comment win32"
4641 if test "$_gl_x11" = yes ; then
4642 def_gl_x11='#define CONFIG_GL_X11 1'
4643 res_comment="$res_comment x11"
4645 if test "$_gl_sdl" = yes ; then
4646 def_gl_sdl='#define CONFIG_GL_SDL 1'
4647 res_comment="$res_comment sdl"
4649 vomodules="opengl $vomodules"
4650 else
4651 def_gl='#undef CONFIG_GL'
4652 def_gl_win32='#undef CONFIG_GL_WIN32'
4653 def_gl_x11='#undef CONFIG_GL_X11'
4654 def_gl_sdl='#undef CONFIG_GL_SDL'
4655 novomodules="opengl $novomodules"
4657 echores "$_gl"
4660 echocheck "MatrixView"
4661 if test "$_gl" = no ; then
4662 matrixview=no
4664 if test "$matrixview" = yes ; then
4665 vomodules="matrixview $vomodules"
4666 def_matrixview='#define CONFIG_MATRIXVIEW 1'
4667 else
4668 novomodules="matrixview $novomodules"
4669 def_matrixview='#undef CONFIG_MATRIXVIEW'
4671 echores "$matrixview"
4674 if os2 ; then
4675 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
4676 if test "$_kva" = auto; then
4677 _kva=no;
4678 header_check_broken os2.h kva.h -lkva && _kva=yes
4680 if test "$_kva" = yes ; then
4681 def_kva='#define CONFIG_KVA 1'
4682 libs_mplayer="$libs_mplayer -lkva"
4683 vomodules="kva $vomodules"
4684 else
4685 def_kva='#undef CONFIG_KVA'
4686 novomodules="kva $novomodules"
4688 echores "$_kva"
4689 fi #if os2
4692 if win32; then
4694 echocheck "Windows waveout"
4695 if test "$_win32waveout" = auto ; then
4696 _win32waveout=no
4697 header_check_broken windows.h mmsystem.h -lwinmm && _win32waveout=yes
4699 if test "$_win32waveout" = yes ; then
4700 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4701 libs_mplayer="$libs_mplayer -lwinmm"
4702 aomodules="win32 $aomodules"
4703 else
4704 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4705 noaomodules="win32 $noaomodules"
4707 echores "$_win32waveout"
4709 echocheck "Direct3D"
4710 if test "$_direct3d" = auto ; then
4711 _direct3d=no
4712 header_check d3d9.h && _direct3d=yes
4714 if test "$_direct3d" = yes ; then
4715 def_direct3d='#define CONFIG_DIRECT3D 1'
4716 vomodules="direct3d $vomodules"
4717 else
4718 def_direct3d='#undef CONFIG_DIRECT3D'
4719 novomodules="direct3d $novomodules"
4721 echores "$_direct3d"
4723 echocheck "Directx"
4724 if test "$_directx" = auto ; then
4725 cat > $TMPC << EOF
4726 #include <ddraw.h>
4727 #include <dsound.h>
4728 int main(void) { return 0; }
4730 _directx=no
4731 cc_check -lgdi32 && _directx=yes
4733 if test "$_directx" = yes ; then
4734 def_directx='#define CONFIG_DIRECTX 1'
4735 libs_mplayer="$libs_mplayer -lgdi32"
4736 vomodules="directx $vomodules"
4737 aomodules="dsound $aomodules"
4738 else
4739 def_directx='#undef CONFIG_DIRECTX'
4740 novomodules="directx $novomodules"
4741 noaomodules="dsound $noaomodules"
4743 echores "$_directx"
4745 fi #if win32; then
4748 echocheck "DXR3/H+"
4749 if test "$_dxr3" = auto ; then
4750 _dxr3=no
4751 header_check linux/em8300.h && _dxr3=yes
4753 if test "$_dxr3" = yes ; then
4754 def_dxr3='#define CONFIG_DXR3 1'
4755 vomodules="dxr3 $vomodules"
4756 else
4757 def_dxr3='#undef CONFIG_DXR3'
4758 novomodules="dxr3 $novomodules"
4760 echores "$_dxr3"
4763 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4764 if test "$_ivtv" = auto ; then
4765 cat > $TMPC << EOF
4766 #include <sys/time.h>
4767 #include <linux/videodev2.h>
4768 #include <linux/ivtv.h>
4769 #include <sys/ioctl.h>
4770 int main(void) {
4771 struct ivtv_cfg_stop_decode sd;
4772 struct ivtv_cfg_start_decode sd1;
4773 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4774 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
4775 return 0; }
4777 _ivtv=no
4778 cc_check && _ivtv=yes
4780 if test "$_ivtv" = yes ; then
4781 def_ivtv='#define CONFIG_IVTV 1'
4782 vomodules="ivtv $vomodules"
4783 aomodules="ivtv $aomodules"
4784 else
4785 def_ivtv='#undef CONFIG_IVTV'
4786 novomodules="ivtv $novomodules"
4787 noaomodules="ivtv $noaomodules"
4789 echores "$_ivtv"
4792 echocheck "V4L2 MPEG Decoder"
4793 if test "$_v4l2" = auto ; then
4794 cat > $TMPC << EOF
4795 #include <sys/time.h>
4796 #include <linux/videodev2.h>
4797 #include <linux/version.h>
4798 int main(void) {
4799 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4800 #error kernel headers too old, need 2.6.22
4801 #endif
4802 struct v4l2_ext_controls ctrls;
4803 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4804 return 0;
4807 _v4l2=no
4808 cc_check && _v4l2=yes
4810 if test "$_v4l2" = yes ; then
4811 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4812 vomodules="v4l2 $vomodules"
4813 aomodules="v4l2 $aomodules"
4814 else
4815 def_v4l2='#undef CONFIG_V4L2_DECODER'
4816 novomodules="v4l2 $novomodules"
4817 noaomodules="v4l2 $noaomodules"
4819 echores "$_v4l2"
4823 #########
4824 # AUDIO #
4825 #########
4828 echocheck "OSS Audio"
4829 if test "$_ossaudio" = auto ; then
4830 _ossaudio=no
4831 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4833 if test "$_ossaudio" = yes ; then
4834 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4835 aomodules="oss $aomodules"
4836 cat > $TMPC << EOF
4837 #include <$_soundcard_header>
4838 #ifdef OPEN_SOUND_SYSTEM
4839 int main(void) { return 0; }
4840 #else
4841 #error Not the real thing
4842 #endif
4844 _real_ossaudio=no
4845 cc_check && _real_ossaudio=yes
4846 if test "$_real_ossaudio" = yes; then
4847 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4848 # Check for OSS4 headers (override default headers)
4849 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4850 if test -f /etc/oss.conf; then
4851 . /etc/oss.conf
4852 _ossinc="$OSSLIBDIR/include"
4853 if test -f "$_ossinc/sys/soundcard.h"; then
4854 extra_cflags="-I$_ossinc $extra_cflags"
4857 elif netbsd || openbsd ; then
4858 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4859 extra_ldflags="$extra_ldflags -lossaudio"
4860 else
4861 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4863 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4864 else
4865 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4866 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4867 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4868 noaomodules="oss $noaomodules"
4870 echores "$_ossaudio"
4873 echocheck "aRts"
4874 if test "$_arts" = auto ; then
4875 _arts=no
4876 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4877 statement_check artsc.h 'arts_init()' $(artsc-config --libs) $(artsc-config --cflags) &&
4878 _arts=yes
4882 if test "$_arts" = yes ; then
4883 def_arts='#define CONFIG_ARTS 1'
4884 aomodules="arts $aomodules"
4885 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
4886 extra_cflags="$extra_cflags $(artsc-config --cflags)"
4887 else
4888 noaomodules="arts $noaomodules"
4890 echores "$_arts"
4893 echocheck "EsounD"
4894 if test "$_esd" = auto ; then
4895 _esd=no
4896 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4897 statement_check esd.h 'esd_open_sound("test")' $(esd-config --libs) $(esd-config --cflags) && _esd=yes
4900 echores "$_esd"
4902 if test "$_esd" = yes ; then
4903 def_esd='#define CONFIG_ESD 1'
4904 aomodules="esd $aomodules"
4905 libs_mplayer="$libs_mplayer $(esd-config --libs)"
4906 extra_cflags="$extra_cflags $(esd-config --cflags)"
4908 echocheck "esd_get_latency()"
4909 statement_check esd.h 'esd_get_latency(0)' $(esd-config --libs) $(esd-config --cflags) &&
4910 _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
4911 echores "$_esd_latency"
4912 else
4913 def_esd='#undef CONFIG_ESD'
4914 def_esd_latency='#undef CONFIG_ESD_LATENCY'
4915 noaomodules="esd $noaomodules"
4919 echocheck "NAS"
4920 if test "$_nas" = auto ; then
4921 _nas=no
4922 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
4924 if test "$_nas" = yes ; then
4925 def_nas='#define CONFIG_NAS 1'
4926 libs_mplayer="$libs_mplayer -laudio -lXt"
4927 aomodules="nas $aomodules"
4928 else
4929 noaomodules="nas $noaomodules"
4930 def_nas='#undef CONFIG_NAS'
4932 echores "$_nas"
4935 echocheck "pulse"
4936 if test "$_pulse" = auto ; then
4937 _pulse=no
4938 if $_pkg_config --exists 'libpulse >= 0.9' ; then
4939 header_check pulse/pulseaudio.h $($_pkg_config --libs --cflags libpulse) &&
4940 _pulse=yes
4943 echores "$_pulse"
4945 if test "$_pulse" = yes ; then
4946 def_pulse='#define CONFIG_PULSE 1'
4947 aomodules="pulse $aomodules"
4948 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
4949 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
4950 else
4951 def_pulse='#undef CONFIG_PULSE'
4952 noaomodules="pulse $noaomodules"
4956 echocheck "JACK"
4957 if test "$_jack" = auto ; then
4958 _jack=yes
4959 if statement_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' -ljack ; then
4960 libs_mplayer="$libs_mplayer -ljack"
4961 elif statement_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' $($_pkg_config --libs --cflags --silence-errors jack) ; then
4962 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
4963 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
4964 else
4965 _jack=no
4969 if test "$_jack" = yes ; then
4970 def_jack='#define CONFIG_JACK 1'
4971 aomodules="jack $aomodules"
4972 else
4973 noaomodules="jack $noaomodules"
4975 echores "$_jack"
4977 echocheck "OpenAL"
4978 if test "$_openal" = auto ; then
4979 _openal=no
4980 cat > $TMPC << EOF
4981 #ifdef OPENAL_AL_H
4982 #include <OpenAL/al.h>
4983 #else
4984 #include <AL/al.h>
4985 #endif
4986 int main(void) {
4987 alSourceQueueBuffers(0, 0, 0);
4988 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4989 return 0;
4992 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4993 cc_check $I && _openal=yes && break
4994 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4995 done
4996 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4998 if test "$_openal" = yes ; then
4999 def_openal='#define CONFIG_OPENAL 1'
5000 aomodules="openal $aomodules"
5001 else
5002 noaomodules="openal $noaomodules"
5004 echores "$_openal"
5006 echocheck "ALSA audio"
5007 if test "$_alloca" != yes ; then
5008 _alsa=no
5009 res_comment="alloca missing"
5011 if test "$_alsa" != no ; then
5012 _alsa=no
5013 cat > $TMPC << EOF
5014 #include <sys/asoundlib.h>
5015 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5016 #error "alsa version != 0.5.x"
5017 #endif
5018 int main(void) { return 0; }
5020 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5022 cat > $TMPC << EOF
5023 #include <sys/asoundlib.h>
5024 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5025 #error "alsa version != 0.9.x"
5026 #endif
5027 int main(void) { return 0; }
5029 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5030 cat > $TMPC << EOF
5031 #include <alsa/asoundlib.h>
5032 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5033 #error "alsa version != 0.9.x"
5034 #endif
5035 int main(void) { return 0; }
5037 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5039 cat > $TMPC << EOF
5040 #include <sys/asoundlib.h>
5041 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5042 #error "alsa version != 1.0.x"
5043 #endif
5044 int main(void) { return 0; }
5046 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5047 cat > $TMPC << EOF
5048 #include <alsa/asoundlib.h>
5049 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5050 #error "alsa version != 1.0.x"
5051 #endif
5052 int main(void) { return 0; }
5054 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5056 def_alsa='#undef CONFIG_ALSA'
5057 def_alsa5='#undef CONFIG_ALSA5'
5058 def_alsa9='#undef CONFIG_ALSA9'
5059 def_alsa1x='#undef CONFIG_ALSA1X'
5060 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5061 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5062 if test "$_alsaver" ; then
5063 _alsa=yes
5064 if test "$_alsaver" = '0.5.x' ; then
5065 _alsa5=yes
5066 aomodules="alsa5 $aomodules"
5067 def_alsa5='#define CONFIG_ALSA5 1'
5068 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5069 res_comment="using alsa 0.5.x and sys/asoundlib.h"
5070 elif test "$_alsaver" = '0.9.x-sys' ; then
5071 _alsa9=yes
5072 aomodules="alsa $aomodules"
5073 def_alsa='#define CONFIG_ALSA 1'
5074 def_alsa9='#define CONFIG_ALSA9 1'
5075 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5076 res_comment="using alsa 0.9.x and sys/asoundlib.h"
5077 elif test "$_alsaver" = '0.9.x-alsa' ; then
5078 _alsa9=yes
5079 aomodules="alsa $aomodules"
5080 def_alsa='#define CONFIG_ALSA 1'
5081 def_alsa9='#define CONFIG_ALSA9 1'
5082 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5083 res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5084 elif test "$_alsaver" = '1.0.x-sys' ; then
5085 _alsa1x=yes
5086 aomodules="alsa $aomodules"
5087 def_alsa='#define CONFIG_ALSA 1'
5088 def_alsa1x="#define CONFIG_ALSA1X 1"
5089 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5090 res_comment="using alsa 1.0.x and sys/asoundlib.h"
5091 elif test "$_alsaver" = '1.0.x-alsa' ; then
5092 _alsa1x=yes
5093 aomodules="alsa $aomodules"
5094 def_alsa='#define CONFIG_ALSA 1'
5095 def_alsa1x="#define CONFIG_ALSA1X 1"
5096 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5097 res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5098 else
5099 _alsa=no
5100 res_comment="unknown version"
5102 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5103 else
5104 noaomodules="alsa $noaomodules"
5106 echores "$_alsa"
5109 echocheck "Sun audio"
5110 if test "$_sunaudio" = auto ; then
5111 cat > $TMPC << EOF
5112 #include <sys/types.h>
5113 #include <sys/audioio.h>
5114 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5116 _sunaudio=no
5117 cc_check && _sunaudio=yes
5119 if test "$_sunaudio" = yes ; then
5120 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5121 aomodules="sun $aomodules"
5122 else
5123 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5124 noaomodules="sun $noaomodules"
5126 echores "$_sunaudio"
5129 if darwin; then
5130 echocheck "CoreAudio"
5131 if test "$_coreaudio" = auto ; then
5132 cat > $TMPC <<EOF
5133 #include <CoreAudio/CoreAudio.h>
5134 #include <AudioToolbox/AudioToolbox.h>
5135 #include <AudioUnit/AudioUnit.h>
5136 int main(void) { return 0; }
5138 _coreaudio=no
5139 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5141 if test "$_coreaudio" = yes ; then
5142 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5143 def_coreaudio='#define CONFIG_COREAUDIO 1'
5144 aomodules="coreaudio $aomodules"
5145 else
5146 def_coreaudio='#undef CONFIG_COREAUDIO'
5147 noaomodules="coreaudio $noaomodules"
5149 echores $_coreaudio
5150 fi #if darwin
5153 if irix; then
5154 echocheck "SGI audio"
5155 if test "$_sgiaudio" = auto ; then
5156 _sgiaudio=no
5157 header_check dmedia/audio.h && _sgiaudio=yes
5159 if test "$_sgiaudio" = "yes" ; then
5160 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5161 libs_mplayer="$libs_mplayer -laudio"
5162 aomodules="sgi $aomodules"
5163 else
5164 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5165 noaomodules="sgi $noaomodules"
5167 echores "$_sgiaudio"
5168 fi #if irix
5171 if os2 ; then
5172 echocheck "KAI (UNIAUD/DART)"
5173 if test "$_kai" = auto; then
5174 _kai=no;
5175 header_check_broken os2.h kai.h -lkai && _kai=yes
5177 if test "$_kai" = yes ; then
5178 def_kai='#define CONFIG_KAI 1'
5179 libs_mplayer="$libs_mplayer -lkai"
5180 aomodules="kai $aomodules"
5181 else
5182 def_kai='#undef CONFIG_KAI'
5183 noaomodules="kai $noaomodules"
5185 echores "$_kai"
5187 echocheck "DART"
5188 if test "$_dart" = auto; then
5189 _dart=no;
5190 header_check_broken os2.h dart.h -ldart && _dart=yes
5192 if test "$_dart" = yes ; then
5193 def_dart='#define CONFIG_DART 1'
5194 libs_mplayer="$libs_mplayer -ldart"
5195 aomodules="dart $aomodules"
5196 else
5197 def_dart='#undef CONFIG_DART'
5198 noaomodules="dart $noaomodules"
5200 echores "$_dart"
5201 fi #if os2
5204 # set default CD/DVD devices
5205 if win32 || os2 ; then
5206 default_cdrom_device="D:"
5207 elif darwin ; then
5208 default_cdrom_device="/dev/disk1"
5209 elif dragonfly ; then
5210 default_cdrom_device="/dev/cd0"
5211 elif freebsd ; then
5212 default_cdrom_device="/dev/acd0"
5213 elif openbsd ; then
5214 default_cdrom_device="/dev/rcd0c"
5215 elif sunos ; then
5216 default_cdrom_device="/vol/dev/aliases/cdrom0"
5217 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5218 # file system and the volfs service.
5219 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5220 elif amigaos ; then
5221 default_cdrom_device="a1ide.device:2"
5222 else
5223 default_cdrom_device="/dev/cdrom"
5226 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5227 default_dvd_device=$default_cdrom_device
5228 elif darwin ; then
5229 default_dvd_device="/dev/rdiskN"
5230 else
5231 default_dvd_device="/dev/dvd"
5235 echocheck "VCD support"
5236 if test "$_vcd" = auto; then
5237 _vcd=no
5238 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
5239 _vcd=yes
5240 elif mingw32; then
5241 header_check ddk/ntddcdrm.h && _vcd=yes
5244 if test "$_vcd" = yes; then
5245 inputmodules="vcd $inputmodules"
5246 def_vcd='#define CONFIG_VCD 1'
5247 else
5248 def_vcd='#undef CONFIG_VCD'
5249 noinputmodules="vcd $noinputmodules"
5250 res_comment="not supported on this OS"
5252 echores "$_vcd"
5256 echocheck "Blu-ray support"
5257 if test "$_bluray" = auto ; then
5258 _bluray=no
5259 statement_check libbluray/bluray.h 'bd_get_title_info(0, 0)' -lbluray && _bluray=yes
5261 if test "$_bluray" = yes ; then
5262 def_bluray='#define CONFIG_LIBBLURAY 1'
5263 extra_ldflags="$extra_ldflags -lbluray"
5264 inputmodules="bluray $inputmodules"
5265 else
5266 def_bluray='#undef CONFIG_LIBBLURAY'
5267 noinputmodules="bluray $noinputmodules"
5269 echores "$_bluray"
5271 echocheck "dvdread"
5272 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5273 _dvdread_internal=no
5275 if test "$_dvdread_internal" = auto ; then
5276 _dvdread_internal=no
5277 _dvdread=no
5278 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) &&
5279 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
5280 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
5281 darwin || win32 || os2; then
5282 _dvdread_internal=yes
5283 _dvdread=yes
5284 extra_cflags="-Ilibdvdread4 $extra_cflags"
5286 elif test "$_dvdread" = auto ; then
5287 _dvdread=no
5288 if test "$_dl" = yes; then
5289 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5290 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5291 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5292 _dvdread=yes
5293 extra_cflags="$extra_cflags $_dvdreadcflags"
5294 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5295 res_comment="external"
5300 if test "$_dvdread_internal" = yes; then
5301 def_dvdread='#define CONFIG_DVDREAD 1'
5302 inputmodules="dvdread(internal) $inputmodules"
5303 _largefiles=yes
5304 res_comment="internal"
5305 elif test "$_dvdread" = yes; then
5306 def_dvdread='#define CONFIG_DVDREAD 1'
5307 _largefiles=yes
5308 extra_ldflags="$extra_ldflags -ldvdread"
5309 inputmodules="dvdread(external) $inputmodules"
5310 res_comment="external"
5311 else
5312 def_dvdread='#undef CONFIG_DVDREAD'
5313 noinputmodules="dvdread $noinputmodules"
5315 echores "$_dvdread"
5318 echocheck "internal libdvdcss"
5319 if test "$_libdvdcss_internal" = auto ; then
5320 _libdvdcss_internal=no
5321 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
5322 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5324 if test "$_libdvdcss_internal" = yes ; then
5325 if linux || netbsd || openbsd || bsdos ; then
5326 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5327 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5328 elif freebsd || dragonfly ; then
5329 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5330 elif darwin ; then
5331 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5332 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5333 elif cygwin ; then
5334 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5335 elif beos ; then
5336 cflags_libdvdcss="-DSYS_BEOS"
5337 elif os2 ; then
5338 cflags_libdvdcss="-DSYS_OS2"
5340 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5341 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5342 inputmodules="libdvdcss(internal) $inputmodules"
5343 _largefiles=yes
5344 else
5345 noinputmodules="libdvdcss(internal) $noinputmodules"
5347 echores "$_libdvdcss_internal"
5350 echocheck "cdparanoia"
5351 if test "$_cdparanoia" = auto ; then
5352 cat > $TMPC <<EOF
5353 #include <cdda_interface.h>
5354 #include <cdda_paranoia.h>
5355 // This need a better test. How ?
5356 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5358 _cdparanoia=no
5359 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5360 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm &&
5361 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5362 done
5364 if test "$_cdparanoia" = yes ; then
5365 _cdda='yes'
5366 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5367 openbsd && extra_ldflags="$extra_ldflags -lutil"
5369 echores "$_cdparanoia"
5372 echocheck "libcdio"
5373 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5374 cat > $TMPC << EOF
5375 #include <stdio.h>
5376 #include <cdio/version.h>
5377 #include <cdio/cdda.h>
5378 #include <cdio/paranoia.h>
5379 int main(void) {
5380 void *test = cdda_verbose_set;
5381 printf("%s\n", CDIO_VERSION);
5382 return test == (void *)1;
5385 _libcdio=no
5386 for _ld_tmp in "" "-lwinmm" ; do
5387 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5388 cc_check $_ld_tmp $_ld_lm && _libcdio=yes &&
5389 extra_ldflags="$extra_ldflags $_ld_tmp" && break
5390 done
5391 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5392 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
5393 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
5394 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes &&
5395 extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5398 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5399 _cdda='yes'
5400 def_libcdio='#define CONFIG_LIBCDIO 1'
5401 def_havelibcdio='yes'
5402 else
5403 if test "$_cdparanoia" = yes ; then
5404 res_comment="using cdparanoia"
5406 def_libcdio='#undef CONFIG_LIBCDIO'
5407 def_havelibcdio='no'
5409 echores "$_libcdio"
5411 if test "$_cdda" = yes ; then
5412 test $_cddb = auto && test $networking = yes && _cddb=yes
5413 def_cdparanoia='#define CONFIG_CDDA 1'
5414 inputmodules="cdda $inputmodules"
5415 else
5416 def_cdparanoia='#undef CONFIG_CDDA'
5417 noinputmodules="cdda $noinputmodules"
5420 if test "$_cddb" = yes ; then
5421 def_cddb='#define CONFIG_CDDB 1'
5422 inputmodules="cddb $inputmodules"
5423 else
5424 _cddb=no
5425 def_cddb='#undef CONFIG_CDDB'
5426 noinputmodules="cddb $noinputmodules"
5429 echocheck "bitmap font support"
5430 if test "$_bitmap_font" = yes ; then
5431 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5432 else
5433 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5435 echores "$_bitmap_font"
5438 echocheck "freetype >= 2.0.9"
5440 # freetype depends on iconv
5441 if test "$_iconv" = no ; then
5442 _freetype=no
5443 res_comment="iconv support needed"
5446 if test "$_freetype" = auto ; then
5447 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5448 cat > $TMPC << EOF
5449 #include <stdio.h>
5450 #include <ft2build.h>
5451 #include FT_FREETYPE_H
5452 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5453 #error "Need FreeType 2.0.9 or newer"
5454 #endif
5455 int main(void) {
5456 FT_Library library;
5457 FT_Init_FreeType(&library);
5458 return 0;
5461 _freetype=no
5462 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
5463 else
5464 _freetype=no
5467 if test "$_freetype" = yes ; then
5468 def_freetype='#define CONFIG_FREETYPE 1'
5469 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
5470 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
5471 else
5472 def_freetype='#undef CONFIG_FREETYPE'
5474 echores "$_freetype"
5476 if test "$_freetype" = no ; then
5477 _fontconfig=no
5478 res_comment="FreeType support needed"
5480 echocheck "fontconfig"
5481 if test "$_fontconfig" = auto ; then
5482 cat > $TMPC << EOF
5483 #include <stdio.h>
5484 #include <stdlib.h>
5485 #include <fontconfig/fontconfig.h>
5486 #if FC_VERSION < 20402
5487 #error At least version 2.4.2 of fontconfig required
5488 #endif
5489 int main(void) {
5490 int err = FcInit();
5491 if (err == FcFalse) {
5492 printf("Couldn't initialize fontconfig lib\n");
5493 exit(err);
5495 return 0;
5498 _fontconfig=no
5499 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
5500 _ld_tmp="-lfontconfig $_ld_tmp"
5501 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5502 done
5503 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5504 _inc_tmp=$($_pkg_config --cflags fontconfig)
5505 _ld_tmp=$($_pkg_config --libs fontconfig)
5506 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes &&
5507 extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5510 if test "$_fontconfig" = yes ; then
5511 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5512 else
5513 def_fontconfig='#undef CONFIG_FONTCONFIG'
5515 echores "$_fontconfig"
5518 echocheck "SSA/ASS support"
5519 if test "$_ass" = auto -o "$_ass" = yes ; then
5520 if $_pkg_config libass; then
5521 _ass=yes
5522 def_ass='#define CONFIG_ASS 1'
5523 extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
5524 extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
5525 else
5526 _ass=no
5527 def_ass='#undef CONFIG_ASS'
5529 else
5530 def_ass='#undef CONFIG_ASS'
5532 echores "$_ass"
5535 echocheck "fribidi with charsets"
5536 _inc_tmp=""
5537 _ld_tmp=""
5538 if test "$_fribidi" = auto ; then
5539 cat > $TMPC << EOF
5540 #include <stdlib.h>
5541 /* workaround for fribidi 0.10.4 and below */
5542 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5543 #include <fribidi/fribidi.h>
5544 int main(void) {
5545 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8)
5546 exit(1);
5547 return 0;
5550 _fribidi=no
5551 _inc_tmp=""
5552 _ld_tmp="-lfribidi"
5553 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5554 if $_pkg_config --exists fribidi > /dev/null 2>&1 &&
5555 test "$_fribidi" = no ; then
5556 _inc_tmp="$($_pkg_config --cflags)"
5557 _ld_tmp="$($_pkg_config --libs)"
5558 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5561 if test "$_fribidi" = yes ; then
5562 def_fribidi='#define CONFIG_FRIBIDI 1'
5563 extra_cflags="$extra_cflags $_inc_tmp"
5564 extra_ldflags="$extra_ldflags $_ld_tmp"
5565 else
5566 def_fribidi='#undef CONFIG_FRIBIDI'
5568 echores "$_fribidi"
5571 echocheck "ENCA"
5572 if test "$_enca" = auto ; then
5573 _enca=no
5574 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
5576 if test "$_enca" = yes ; then
5577 def_enca='#define CONFIG_ENCA 1'
5578 extra_ldflags="$extra_ldflags -lenca"
5579 else
5580 def_enca='#undef CONFIG_ENCA'
5582 echores "$_enca"
5585 echocheck "zlib"
5586 _zlib=no
5587 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5588 if test "$_zlib" = yes ; then
5589 def_zlib='#define CONFIG_ZLIB 1'
5590 extra_ldflags="$extra_ldflags -lz"
5591 else
5592 def_zlib='#define CONFIG_ZLIB 0'
5594 echores "$_zlib"
5597 echocheck "bzlib"
5598 bzlib=no
5599 def_bzlib='#define CONFIG_BZLIB 0'
5600 statement_check bzlib.h 'BZ2_bzlibVersion()' -lbz2 && bzlib=yes
5601 if test "$bzlib" = yes ; then
5602 def_bzlib='#define CONFIG_BZLIB 1'
5603 extra_ldflags="$extra_ldflags -lbz2"
5605 echores "$bzlib"
5608 echocheck "RTC"
5609 if test "$_rtc" = auto ; then
5610 cat > $TMPC << EOF
5611 #include <sys/ioctl.h>
5612 #ifdef __linux__
5613 #include <linux/rtc.h>
5614 #else
5615 #include <rtc.h>
5616 #define RTC_PIE_ON RTCIO_PIE_ON
5617 #endif
5618 int main(void) { return RTC_PIE_ON; }
5620 _rtc=no
5621 cc_check && _rtc=yes
5622 ppc && _rtc=no
5624 if test "$_rtc" = yes ; then
5625 def_rtc='#define HAVE_RTC 1'
5626 else
5627 def_rtc='#undef HAVE_RTC'
5629 echores "$_rtc"
5632 echocheck "liblzo2 support"
5633 if test "$_liblzo" = auto ; then
5634 _liblzo=no
5635 statement_check lzo/lzo1x.h 'lzo_init()' -llzo2 && _liblzo=yes
5637 if test "$_liblzo" = yes ; then
5638 def_liblzo='#define CONFIG_LIBLZO 1'
5639 extra_ldflags="$extra_ldflags -llzo2"
5640 codecmodules="liblzo $codecmodules"
5641 else
5642 def_liblzo='#undef CONFIG_LIBLZO'
5643 nocodecmodules="liblzo $nocodecmodules"
5645 echores "$_liblzo"
5648 echocheck "mad support"
5649 if test "$_mad" = auto ; then
5650 _mad=no
5651 header_check mad.h -lmad && _mad=yes
5653 if test "$_mad" = yes ; then
5654 def_mad='#define CONFIG_LIBMAD 1'
5655 extra_ldflags="$extra_ldflags -lmad"
5656 codecmodules="libmad $codecmodules"
5657 else
5658 def_mad='#undef CONFIG_LIBMAD'
5659 nocodecmodules="libmad $nocodecmodules"
5661 echores "$_mad"
5663 echocheck "OggVorbis support"
5664 if test "$_libvorbis" = auto; then
5665 _libvorbis=no
5666 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
5668 if test "$_tremor" = auto; then
5669 _tremor=no
5670 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
5672 if test "$_tremor" = yes ; then
5673 _vorbis=yes
5674 def_vorbis='#define CONFIG_OGGVORBIS 1'
5675 def_tremor='#define CONFIG_TREMOR 1'
5676 codecmodules="tremor(external) $codecmodules"
5677 res_comment="external Tremor"
5678 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
5679 elif test "$_libvorbis" = yes ; then
5680 _vorbis=yes
5681 def_vorbis='#define CONFIG_OGGVORBIS 1'
5682 codecmodules="libvorbis $codecmodules"
5683 res_comment="libvorbis"
5684 extra_ldflags="$extra_ldflags -lvorbis -logg"
5685 else
5686 _vorbis=no
5687 nocodecmodules="libvorbis $nocodecmodules"
5689 echores "$_vorbis"
5691 echocheck "libspeex (version >= 1.1 required)"
5692 if test "$_speex" = auto ; then
5693 _speex=no
5694 cat > $TMPC << EOF
5695 #include <stddef.h>
5696 #include <speex/speex.h>
5697 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5699 cc_check -lspeex $_ld_lm && _speex=yes
5701 if test "$_speex" = yes ; then
5702 def_speex='#define CONFIG_SPEEX 1'
5703 extra_ldflags="$extra_ldflags -lspeex"
5704 codecmodules="speex $codecmodules"
5705 else
5706 def_speex='#undef CONFIG_SPEEX'
5707 nocodecmodules="speex $nocodecmodules"
5709 echores "$_speex"
5711 echocheck "OggTheora support"
5712 if test "$_theora" = auto ; then
5713 _theora=no
5714 cat > $TMPC << EOF
5715 #include <theora/theora.h>
5716 #include <string.h>
5717 int main(void) {
5718 /* Theora is in flux, make sure that all interface routines and datatypes
5719 * exist and work the way we expect it, so we don't break MPlayer. */
5720 ogg_packet op;
5721 theora_comment tc;
5722 theora_info inf;
5723 theora_state st;
5724 yuv_buffer yuv;
5725 int r;
5726 double t;
5728 theora_info_init(&inf);
5729 theora_comment_init(&tc);
5731 return 0;
5733 /* we don't want to execute this kind of nonsense; just for making sure
5734 * that compilation works... */
5735 memset(&op, 0, sizeof(op));
5736 r = theora_decode_header(&inf, &tc, &op);
5737 r = theora_decode_init(&st, &inf);
5738 t = theora_granule_time(&st, op.granulepos);
5739 r = theora_decode_packetin(&st, &op);
5740 r = theora_decode_YUVout(&st, &yuv);
5741 theora_clear(&st);
5743 return 0;
5746 _ld_theora=$($_pkg_config --silence-errors --libs theora)
5747 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
5748 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
5749 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
5750 if test _theora = no; then
5751 _ld_theora="-ltheora -logg"
5752 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
5755 if test "$_theora" = yes ; then
5756 def_theora='#define CONFIG_OGGTHEORA 1'
5757 codecmodules="libtheora $codecmodules"
5758 # when --enable-theora is forced, we'd better provide a probably sane
5759 # $_ld_theora than nothing
5760 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
5761 else
5762 def_theora='#undef CONFIG_OGGTHEORA'
5763 nocodecmodules="libtheora $nocodecmodules"
5765 echores "$_theora"
5767 echocheck "mp3lib support"
5768 if test "$_mp3lib" = auto ; then
5769 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
5771 if test "$_mp3lib" = yes ; then
5772 def_mp3lib='#define CONFIG_MP3LIB 1'
5773 codecmodules="mp3lib(internal) $codecmodules"
5774 else
5775 def_mp3lib='#undef CONFIG_MP3LIB'
5776 nocodecmodules="mp3lib(internal) $nocodecmodules"
5778 echores "$_mp3lib"
5780 # Any version of libmpg123 shall be fine.
5781 echocheck "mpg123 support"
5782 def_mpg123='#undef CONFIG_MPG123'
5783 if test "$_mpg123" = auto; then
5784 _mpg123=no
5785 statement_check mpg123.h 'mpg123_init()' -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
5787 if test "$_mpg123" = yes ; then
5788 def_mpg123='#define CONFIG_MPG123 1'
5789 codecmodules="mpg123 $codecmodules"
5790 else
5791 nocodecmodules="mpg123 $nocodecmodules"
5793 echores "$_mpg123"
5795 echocheck "liba52 support"
5796 def_liba52='#undef CONFIG_LIBA52'
5797 if test "$_liba52" = auto ; then
5798 _liba52=no
5799 cat > $TMPC << EOF
5800 #include <inttypes.h>
5801 #include <a52dec/a52.h>
5802 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
5804 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
5806 if test "$_liba52" = yes ; then
5807 def_liba52='#define CONFIG_LIBA52 1'
5808 codecmodules="liba52 $codecmodules"
5809 else
5810 nocodecmodules="liba52 $nocodecmodules"
5812 echores "$_liba52"
5814 echocheck "libdca support"
5815 if test "$_libdca" = auto ; then
5816 _libdca=no
5817 for _ld_dca in -ldca -ldts ; do
5818 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
5819 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
5820 done
5822 if test "$_libdca" = yes ; then
5823 def_libdca='#define CONFIG_LIBDCA 1'
5824 codecmodules="libdca $codecmodules"
5825 else
5826 def_libdca='#undef CONFIG_LIBDCA'
5827 nocodecmodules="libdca $nocodecmodules"
5829 echores "$_libdca"
5831 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5832 if test "$_musepack" = auto ; then
5833 _musepack=no
5834 cat > $TMPC << EOF
5835 #include <stddef.h>
5836 #include <mpcdec/mpcdec.h>
5837 int main(void) {
5838 mpc_streaminfo info;
5839 mpc_decoder decoder;
5840 mpc_decoder_set_streaminfo(&decoder, &info);
5841 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5842 return 0;
5845 cc_check -lmpcdec $_ld_lm && _musepack=yes
5847 if test "$_musepack" = yes ; then
5848 def_musepack='#define CONFIG_MUSEPACK 1'
5849 extra_ldflags="$extra_ldflags -lmpcdec"
5850 codecmodules="musepack $codecmodules"
5851 else
5852 def_musepack='#undef CONFIG_MUSEPACK'
5853 nocodecmodules="musepack $nocodecmodules"
5855 echores "$_musepack"
5858 echocheck "FAAD2 support"
5859 if test "$_faad" = auto ; then
5860 _faad=no
5861 cat > $TMPC << EOF
5862 #include <faad.h>
5863 #ifndef FAAD_MIN_STREAMSIZE
5864 #error Too old version
5865 #endif
5866 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
5867 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5869 cc_check -lfaad $_ld_lm && _faad=yes
5872 def_faad='#undef CONFIG_FAAD'
5873 if test "$_faad" = yes ; then
5874 def_faad='#define CONFIG_FAAD 1'
5875 extra_ldflags="$extra_ldflags -lfaad"
5876 codecmodules="faad2 $codecmodules"
5877 else
5878 nocodecmodules="faad2 $nocodecmodules"
5880 echores "$_faad"
5883 echocheck "LADSPA plugin support"
5884 if test "$_ladspa" = auto ; then
5885 _ladspa=no
5886 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
5888 if test "$_ladspa" = yes; then
5889 def_ladspa="#define CONFIG_LADSPA 1"
5890 else
5891 def_ladspa="#undef CONFIG_LADSPA"
5893 echores "$_ladspa"
5896 echocheck "libbs2b audio filter support"
5897 if test "$_libbs2b" = auto ; then
5898 cat > $TMPC <<EOF
5899 #include <bs2b.h>
5900 #if BS2B_VERSION_MAJOR < 3
5901 #error Please use libbs2b >= 3.0.0, older versions are not supported.
5902 #endif
5903 int main(void) {
5904 t_bs2bdp filter;
5905 filter=bs2b_open();
5906 bs2b_close(filter);
5907 return 0;
5910 _libbs2b=no
5911 if $_pkg_config --exists libbs2b ; then
5912 _inc_tmp=$($_pkg_config --cflags libbs2b)
5913 _ld_tmp=$($_pkg_config --libs libbs2b)
5914 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
5915 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
5916 else
5917 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
5918 -I/usr/local/include/bs2b ; do
5919 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
5920 extra_ldflags="$extra_ldflags -lbs2b"
5921 extra_cflags="$extra_cflags $_inc_tmp"
5922 _libbs2b=yes
5923 break
5925 done
5928 def_libbs2b="#undef CONFIG_LIBBS2B"
5929 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
5930 echores "$_libbs2b"
5933 if test -z "$_codecsdir" ; then
5934 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5935 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5936 if test -d "$dir" ; then
5937 _codecsdir="$dir"
5938 break;
5940 done
5942 # Fall back on default directory.
5943 if test -z "$_codecsdir" ; then
5944 _codecsdir="$_libdir/codecs"
5945 mingw32 || os2 && _codecsdir="codecs"
5949 echocheck "Win32 codecs"
5950 if test "$_win32dll" = auto ; then
5951 _win32dll=no
5952 if x86_32 && ! qnx; then
5953 _win32dll=yes
5956 if test "$_win32dll" = yes ; then
5957 def_win32dll='#define CONFIG_WIN32DLL 1'
5958 if ! win32 ; then
5959 def_win32_loader='#define WIN32_LOADER 1'
5960 _win32_emulation=yes
5961 else
5962 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
5963 res_comment="using native windows"
5965 codecmodules="win32 $codecmodules"
5966 else
5967 def_win32dll='#undef CONFIG_WIN32DLL'
5968 def_win32_loader='#undef WIN32_LOADER'
5969 nocodecmodules="win32 $nocodecmodules"
5971 echores "$_win32dll"
5974 echocheck "XAnim codecs"
5975 if test "$_xanim" = auto ; then
5976 _xanim=no
5977 res_comment="dynamic loader support needed"
5978 if test "$_dl" = yes ; then
5979 _xanim=yes
5982 if test "$_xanim" = yes ; then
5983 def_xanim='#define CONFIG_XANIM 1'
5984 codecmodules="xanim $codecmodules"
5985 else
5986 def_xanim='#undef CONFIG_XANIM'
5987 nocodecmodules="xanim $nocodecmodules"
5989 echores "$_xanim"
5992 echocheck "RealPlayer codecs"
5993 if test "$_real" = auto ; then
5994 _real=no
5995 res_comment="dynamic loader support needed"
5996 if test "$_dl" = yes || test "$_win32dll" = yes &&
5997 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
5998 _real=yes
6001 if test "$_real" = yes ; then
6002 def_real='#define CONFIG_REALCODECS 1'
6003 codecmodules="real $codecmodules"
6004 else
6005 def_real='#undef CONFIG_REALCODECS'
6006 nocodecmodules="real $nocodecmodules"
6008 echores "$_real"
6011 echocheck "QuickTime codecs"
6012 _qtx_emulation=no
6013 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6014 if test "$_qtx" = auto ; then
6015 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6017 if test "$_qtx" = yes ; then
6018 def_qtx='#define CONFIG_QTX_CODECS 1'
6019 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6020 codecmodules="qtx $codecmodules"
6021 darwin || win32 || _qtx_emulation=yes
6022 else
6023 def_qtx='#undef CONFIG_QTX_CODECS'
6024 nocodecmodules="qtx $nocodecmodules"
6026 echores "$_qtx"
6028 echocheck "Nemesi Streaming Media libraries"
6029 if test "$_nemesi" = auto && test "$networking" = yes ; then
6030 _nemesi=no
6031 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6032 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6033 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6034 _nemesi=yes
6037 if test "$_nemesi" = yes; then
6038 _native_rtsp=no
6039 def_nemesi='#define CONFIG_LIBNEMESI 1'
6040 inputmodules="nemesi $inputmodules"
6041 else
6042 _native_rtsp="$networking"
6043 _nemesi=no
6044 def_nemesi='#undef CONFIG_LIBNEMESI'
6045 noinputmodules="nemesi $noinputmodules"
6047 echores "$_nemesi"
6049 echocheck "LIVE555 Streaming Media libraries"
6050 if test "$_live" = auto && test "$networking" = yes ; then
6051 cat > $TMPCPP << EOF
6052 #include <liveMedia.hh>
6053 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6054 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6055 #endif
6056 int main(void) { return 0; }
6059 _live=no
6060 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
6061 cxx_check $I/liveMedia/include $I/UsageEnvironment/include $I/groupsock/include &&
6062 _livelibdir=$(echo $I| sed s/-I//) &&
6063 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6064 $_livelibdir/groupsock/libgroupsock.a \
6065 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6066 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6067 $extra_ldflags -lstdc++" \
6068 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6069 -I$_livelibdir/UsageEnvironment/include \
6070 -I$_livelibdir/BasicUsageEnvironment/include \
6071 -I$_livelibdir/groupsock/include" &&
6072 _live=yes && break
6073 done
6074 if test "$_live" != yes ; then
6075 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6076 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
6077 _live_dist=yes
6081 if test "$_live" = yes && test "$networking" = yes; then
6082 test $_livelibdir && res_comment="using $_livelibdir"
6083 def_live='#define CONFIG_LIVE555 1'
6084 inputmodules="live555 $inputmodules"
6085 elif test "$_live_dist" = yes && test "$networking" = yes; then
6086 res_comment="using distribution version"
6087 _live="yes"
6088 def_live='#define CONFIG_LIVE555 1'
6089 extra_ldflags="$extra_ldflags $ld_tmp"
6090 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6091 inputmodules="live555 $inputmodules"
6092 else
6093 _live=no
6094 def_live='#undef CONFIG_LIVE555'
6095 noinputmodules="live555 $noinputmodules"
6097 echores "$_live"
6101 all_ffmpeg_libs="libavutil libavcodec libavformat libswscale libpostproc"
6102 echocheck "FFmpeg ($all_ffmpeg_libs)"
6103 if test "$ffmpeg" = auto ; then
6104 ffmpeg=no
6105 if $_pkg_config --exists $all_ffmpeg_libs ; then
6106 inc_ffmpeg=$($_pkg_config --cflags $all_ffmpeg_libs)
6107 _ld_tmp=$($_pkg_config --libs $all_ffmpeg_libs)
6108 extra_ldflags="$extra_ldflags $_ld_tmp"
6109 extra_cflags="$extra_cflags $inc_ffmpeg"
6110 ffmpeg=yes
6111 elif header_check libavcore/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil $_ld_lm ; then
6112 extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil -lavcore"
6113 ffmpeg=yes
6117 ffmpeg_eval_api=no
6118 def_ffmpeg_eval_api="#undef CONFIG_FFMPEG_EVAL_API"
6119 if test "$ffmpeg" = yes; then
6120 def_ffmpeg='#define CONFIG_FFMPEG 1'
6121 codecmodules="ffmpeg $codecmodules"
6122 if $_pkg_config --atleast-version=50.18.0 libavutil ; then
6123 ffmpeg_eval_api=yes
6124 def_ffmpeg_eval_api="#define CONFIG_FFMPEG_EVAL_API 1"
6126 else
6127 def_ffmpeg='#undef CONFIG_FFMPEG'
6128 nocodecmodules="ffmpeg $nocodecmodules"
6130 echores "$ffmpeg"
6132 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
6133 if ! test -z "$_ffmpeg_source" ; then
6134 test "$ffmpeg" = yes && def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
6139 echocheck "libdv-0.9.5+"
6140 if test "$_libdv" = auto ; then
6141 _libdv=no
6142 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
6144 if test "$_libdv" = yes ; then
6145 def_libdv='#define CONFIG_LIBDV095 1'
6146 extra_ldflags="$extra_ldflags -ldv"
6147 codecmodules="libdv $codecmodules"
6148 else
6149 def_libdv='#undef CONFIG_LIBDV095'
6150 nocodecmodules="libdv $nocodecmodules"
6152 echores "$_libdv"
6155 echocheck "Xvid"
6156 if test "$_xvid" = auto ; then
6157 _xvid=no
6158 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6159 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
6160 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
6161 done
6164 if test "$_xvid" = yes ; then
6165 def_xvid='#define CONFIG_XVID4 1'
6166 codecmodules="xvid $codecmodules"
6167 else
6168 def_xvid='#undef CONFIG_XVID4'
6169 nocodecmodules="xvid $nocodecmodules"
6171 echores "$_xvid"
6174 echocheck "libnut"
6175 if test "$_libnut" = auto ; then
6176 _libnut=no
6177 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
6180 if test "$_libnut" = yes ; then
6181 def_libnut='#define CONFIG_LIBNUT 1'
6182 extra_ldflags="$extra_ldflags -lnut"
6183 else
6184 def_libnut='#undef CONFIG_LIBNUT'
6186 echores "$_libnut"
6188 # These VO checks must be done after the FFmpeg one
6189 echocheck "/dev/mga_vid"
6190 if test "$_mga" = auto ; then
6191 _mga=no
6192 test -c /dev/mga_vid && _mga=yes
6194 if test "$_mga" = yes ; then
6195 def_mga='#define CONFIG_MGA 1'
6196 vomodules="mga $vomodules"
6197 else
6198 def_mga='#undef CONFIG_MGA'
6199 novomodules="mga $novomodules"
6201 echores "$_mga"
6204 echocheck "xmga"
6205 if test "$_xmga" = auto ; then
6206 _xmga=no
6207 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
6209 if test "$_xmga" = yes ; then
6210 def_xmga='#define CONFIG_XMGA 1'
6211 vomodules="xmga $vomodules"
6212 else
6213 def_xmga='#undef CONFIG_XMGA'
6214 novomodules="xmga $novomodules"
6216 echores "$_xmga"
6219 echocheck "UnRAR executable"
6220 if test "$_unrar_exec" = auto ; then
6221 _unrar_exec="yes"
6222 mingw32 && _unrar_exec="no"
6224 if test "$_unrar_exec" = yes ; then
6225 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
6226 else
6227 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
6229 echores "$_unrar_exec"
6231 echocheck "TV interface"
6232 if test "$_tv" = yes ; then
6233 def_tv='#define CONFIG_TV 1'
6234 inputmodules="tv $inputmodules"
6235 else
6236 noinputmodules="tv $noinputmodules"
6237 def_tv='#undef CONFIG_TV'
6239 echores "$_tv"
6242 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
6243 echocheck "*BSD BT848 bt8xx header"
6244 _ioctl_bt848_h=no
6245 for file in "machine/ioctl_bt848.h" \
6246 "dev/bktr/ioctl_bt848.h" \
6247 "dev/video/bktr/ioctl_bt848.h" \
6248 "dev/ic/bt8xx.h" ; do
6249 cat > $TMPC <<EOF
6250 #include <sys/types.h>
6251 #include <sys/ioctl.h>
6252 #include <$file>
6253 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
6255 if cc_check ; then
6256 _ioctl_bt848_h=yes
6257 _ioctl_bt848_h_name="$file"
6258 break;
6260 done
6261 if test "$_ioctl_bt848_h" = yes ; then
6262 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6263 res_comment="using $_ioctl_bt848_h_name"
6264 else
6265 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6267 echores "$_ioctl_bt848_h"
6269 echocheck "*BSD ioctl_meteor.h"
6270 _ioctl_meteor_h=no
6271 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
6272 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
6273 _ioctl_meteor_h=yes && break
6274 done
6275 if test "$_ioctl_meteor_h" = yes ; then
6276 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
6277 res_comment="using $ioctl_meteor_h_path"
6278 else
6279 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6281 echores "$_ioctl_meteor_h"
6283 echocheck "*BSD BrookTree 848 TV interface"
6284 if test "$_tv_bsdbt848" = auto ; then
6285 _tv_bsdbt848=no
6286 if test "$_tv" = yes ; then
6287 cat > $TMPC <<EOF
6288 #include <sys/types.h>
6289 $def_ioctl_meteor_h_name
6290 $def_ioctl_bt848_h_name
6291 #ifdef IOCTL_METEOR_H_NAME
6292 #include IOCTL_METEOR_H_NAME
6293 #endif
6294 #ifdef IOCTL_BT848_H_NAME
6295 #include IOCTL_BT848_H_NAME
6296 #endif
6297 int main(void) {
6298 ioctl(0, METEORSINPUT, 0);
6299 ioctl(0, TVTUNER_GETFREQ, 0);
6300 return 0;
6303 cc_check && _tv_bsdbt848=yes
6306 if test "$_tv_bsdbt848" = yes ; then
6307 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
6308 inputmodules="tv-bsdbt848 $inputmodules"
6309 else
6310 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
6311 noinputmodules="tv-bsdbt848 $noinputmodules"
6313 echores "$_tv_bsdbt848"
6314 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
6317 echocheck "DirectShow TV interface"
6318 if test "$_tv_dshow" = auto ; then
6319 _tv_dshow=no
6320 if test "$_tv" = yes && win32 ; then
6321 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
6324 if test "$_tv_dshow" = yes ; then
6325 inputmodules="tv-dshow $inputmodules"
6326 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
6327 extra_ldflags="$extra_ldflags -lole32 -luuid"
6328 else
6329 noinputmodules="tv-dshow $noinputmodules"
6330 def_tv_dshow='#undef CONFIG_TV_DSHOW'
6332 echores "$_tv_dshow"
6335 echocheck "Video 4 Linux TV interface"
6336 if test "$_tv_v4l1" = auto ; then
6337 _tv_v4l1=no
6338 if test "$_tv" = yes && linux ; then
6339 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
6342 if test "$_tv_v4l1" = yes ; then
6343 _audio_input=yes
6344 _tv_v4l=yes
6345 def_tv_v4l='#define CONFIG_TV_V4L 1'
6346 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
6347 inputmodules="tv-v4l $inputmodules"
6348 else
6349 noinputmodules="tv-v4l1 $noinputmodules"
6350 def_tv_v4l='#undef CONFIG_TV_V4L'
6352 echores "$_tv_v4l1"
6355 echocheck "Video 4 Linux 2 TV interface"
6356 if test "$_tv_v4l2" = auto ; then
6357 _tv_v4l2=no
6358 if test "$_tv" = yes && linux ; then
6359 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
6362 if test "$_tv_v4l2" = yes ; then
6363 _audio_input=yes
6364 _tv_v4l=yes
6365 def_tv_v4l='#define CONFIG_TV_V4L 1'
6366 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
6367 inputmodules="tv-v4l2 $inputmodules"
6368 else
6369 noinputmodules="tv-v4l2 $noinputmodules"
6370 def_tv_v4l2='#undef CONFIG_TV_V4L2'
6372 echores "$_tv_v4l2"
6375 echocheck "Radio interface"
6376 if test "$_radio" = yes ; then
6377 def_radio='#define CONFIG_RADIO 1'
6378 inputmodules="radio $inputmodules"
6379 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6380 _radio_capture=no
6382 if test "$_radio_capture" = yes ; then
6383 _audio_input=yes
6384 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
6385 else
6386 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6388 else
6389 noinputmodules="radio $noinputmodules"
6390 def_radio='#undef CONFIG_RADIO'
6391 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6392 _radio_capture=no
6394 echores "$_radio"
6395 echocheck "Capture for Radio interface"
6396 echores "$_radio_capture"
6398 echocheck "Video 4 Linux 2 Radio interface"
6399 if test "$_radio_v4l2" = auto ; then
6400 _radio_v4l2=no
6401 if test "$_radio" = yes && linux ; then
6402 header_check linux/videodev2.h && _radio_v4l2=yes
6405 if test "$_radio_v4l2" = yes ; then
6406 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
6407 else
6408 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
6410 echores "$_radio_v4l2"
6412 echocheck "Video 4 Linux Radio interface"
6413 if test "$_radio_v4l" = auto ; then
6414 _radio_v4l=no
6415 if test "$_radio" = yes && linux ; then
6416 header_check linux/videodev.h && _radio_v4l=yes
6419 if test "$_radio_v4l" = yes ; then
6420 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
6421 else
6422 def_radio_v4l='#undef CONFIG_RADIO_V4L'
6424 echores "$_radio_v4l"
6426 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
6427 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6428 echocheck "*BSD BrookTree 848 Radio interface"
6429 _radio_bsdbt848=no
6430 cat > $TMPC <<EOF
6431 #include <sys/types.h>
6432 $def_ioctl_bt848_h_name
6433 #ifdef IOCTL_BT848_H_NAME
6434 #include IOCTL_BT848_H_NAME
6435 #endif
6436 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
6438 cc_check && _radio_bsdbt848=yes
6439 echores "$_radio_bsdbt848"
6440 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
6442 if test "$_radio_bsdbt848" = yes ; then
6443 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
6444 else
6445 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
6448 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
6449 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6450 die "Radio driver requires BSD BT848, V4L or V4L2!"
6453 echocheck "Video 4 Linux 2 MPEG PVR interface"
6454 if test "$_pvr" = auto ; then
6455 _pvr=no
6456 if test "$_tv_v4l2" = yes && linux ; then
6457 cat > $TMPC <<EOF
6458 #include <sys/time.h>
6459 #include <linux/videodev2.h>
6460 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
6462 cc_check && _pvr=yes
6465 if test "$_pvr" = yes ; then
6466 def_pvr='#define CONFIG_PVR 1'
6467 inputmodules="pvr $inputmodules"
6468 else
6469 noinputmodules="pvr $noinputmodules"
6470 def_pvr='#undef CONFIG_PVR'
6472 echores "$_pvr"
6475 echocheck "ftp"
6476 if test "$_ftp" = "auto" ; then
6477 test "$networking" = "yes" && ! beos && _ftp=yes
6479 if test "$_ftp" = yes ; then
6480 def_ftp='#define CONFIG_FTP 1'
6481 inputmodules="ftp $inputmodules"
6482 else
6483 noinputmodules="ftp $noinputmodules"
6484 def_ftp='#undef CONFIG_FTP'
6486 echores "$_ftp"
6488 echocheck "vstream client"
6489 if test "$_vstream" = auto ; then
6490 _vstream=no
6491 cat > $TMPC <<EOF
6492 #include <vstream-client.h>
6493 void vstream_error(const char *format, ... ) {}
6494 int main(void) { vstream_start(); return 0; }
6496 cc_check -lvstream-client && _vstream=yes
6498 if test "$_vstream" = yes ; then
6499 def_vstream='#define CONFIG_VSTREAM 1'
6500 inputmodules="vstream $inputmodules"
6501 extra_ldflags="$extra_ldflags -lvstream-client"
6502 else
6503 noinputmodules="vstream $noinputmodules"
6504 def_vstream='#undef CONFIG_VSTREAM'
6506 echores "$_vstream"
6509 echocheck "OSD menu"
6510 if test "$_menu" = yes ; then
6511 def_menu='#define CONFIG_MENU 1'
6512 test $_dvbin = "yes" && _menu_dvbin=yes
6513 else
6514 def_menu='#undef CONFIG_MENU'
6515 _menu_dvbin=no
6517 echores "$_menu"
6520 echocheck "Subtitles sorting"
6521 if test "$_sortsub" = yes ; then
6522 def_sortsub='#define CONFIG_SORTSUB 1'
6523 else
6524 def_sortsub='#undef CONFIG_SORTSUB'
6526 echores "$_sortsub"
6529 echocheck "XMMS inputplugin support"
6530 if test "$_xmms" = yes ; then
6531 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6532 _xmmsplugindir=$(xmms-config --input-plugin-dir)
6533 _xmmslibdir=$(xmms-config --exec-prefix)/lib
6534 else
6535 _xmmsplugindir=/usr/lib/xmms/Input
6536 _xmmslibdir=/usr/lib
6539 def_xmms='#define CONFIG_XMMS 1'
6540 if darwin ; then
6541 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6542 else
6543 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6545 else
6546 def_xmms='#undef CONFIG_XMMS'
6548 echores "$_xmms"
6550 if test "$_charset" != "noconv" ; then
6551 def_charset="#define MSG_CHARSET \"$_charset\""
6552 else
6553 def_charset="#undef MSG_CHARSET"
6554 _charset="UTF-8"
6557 #############################################################################
6559 echocheck "automatic gdb attach"
6560 if test "$_crash_debug" = yes ; then
6561 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
6562 else
6563 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
6564 _crash_debug=no
6566 echores "$_crash_debug"
6568 echocheck "compiler support for noexecstack"
6569 if cflag_check -Wl,-z,noexecstack ; then
6570 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
6571 echores "yes"
6572 else
6573 echores "no"
6576 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
6577 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6578 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6579 echores "yes"
6580 else
6581 echores "no"
6585 # Dynamic linking flags
6586 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6587 _ld_dl_dynamic=''
6588 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
6589 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
6590 _ld_dl_dynamic='-rdynamic'
6593 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6594 bsdos && extra_ldflags="$extra_ldflags -ldvd"
6595 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
6597 def_debug='#undef MP_DEBUG'
6598 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
6601 echocheck "joystick"
6602 def_joystick='#undef CONFIG_JOYSTICK'
6603 if test "$_joystick" = yes ; then
6604 if linux || freebsd ; then
6605 # TODO add some check
6606 def_joystick='#define CONFIG_JOYSTICK 1'
6607 else
6608 _joystick="no"
6609 res_comment="unsupported under $system_name"
6612 echores "$_joystick"
6614 echocheck "lirc"
6615 if test "$_lirc" = auto ; then
6616 _lirc=no
6617 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
6619 if test "$_lirc" = yes ; then
6620 def_lirc='#define CONFIG_LIRC 1'
6621 libs_mplayer="$libs_mplayer -llirc_client"
6622 else
6623 def_lirc='#undef CONFIG_LIRC'
6625 echores "$_lirc"
6627 echocheck "lircc"
6628 if test "$_lircc" = auto ; then
6629 _lircc=no
6630 header_check lirc/lircc.h -llircc && _lircc=yes
6632 if test "$_lircc" = yes ; then
6633 def_lircc='#define CONFIG_LIRCC 1'
6634 libs_mplayer="$libs_mplayer -llircc"
6635 else
6636 def_lircc='#undef CONFIG_LIRCC'
6638 echores "$_lircc"
6640 if arm; then
6641 # Detect maemo development platform libraries availability (http://www.maemo.org),
6642 # they are used when run on Nokia 770|8x0
6643 echocheck "maemo (Nokia 770|8x0)"
6644 if test "$_maemo" = auto ; then
6645 _maemo=no
6646 statement_check libosso.h 'osso_initialize('', '', 0, NULL)' $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
6648 if test "$_maemo" = yes ; then
6649 def_maemo='#define CONFIG_MAEMO 1'
6650 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
6651 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
6652 else
6653 def_maemo='#undef CONFIG_MAEMO'
6655 echores "$_maemo"
6658 #############################################################################
6660 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
6661 # the OMF format needs to come after the 'extern symbol prefix' check, which
6662 # uses nm.
6663 if os2 ; then
6664 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
6667 #############################################################################
6668 # 64 bit file offsets?
6669 if test "$_largefiles" = yes || freebsd ; then
6670 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
6671 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
6672 # dvdread support requires this (for off64_t)
6673 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
6677 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
6679 # This must be the last test to be performed. Any other tests following it
6680 # could fail due to linker errors. libdvdnavmini is intentionally not linked
6681 # against libdvdread (to permit MPlayer to use its own copy of the library).
6682 # So any compilation using the flags added here but not linking against
6683 # libdvdread can fail.
6684 echocheck "DVD support (libdvdnav)"
6685 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
6686 _dvdnav=no
6688 dvdnav_internal=no
6689 if test "$_dvdnav" = auto ; then
6690 if test "$_dvdread_internal" = yes ; then
6691 _dvdnav=yes
6692 dvdnav_internal=yes
6693 res_comment="internal"
6694 else
6695 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
6698 if test "$_dvdnav" = auto ; then
6699 _dvdnav=no
6700 _dvdnavdir=$($_dvdnavconfig --cflags)
6701 _dvdnavlibs=$($_dvdnavconfig --libs)
6702 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
6704 if test "$_dvdnav" = yes ; then
6705 _largefiles=yes
6706 def_dvdnav='#define CONFIG_DVDNAV 1'
6707 if test "$dvdnav_internal" = yes ; then
6708 cflags_libdvdnav="-Ilibdvdnav"
6709 inputmodules="dvdnav(internal) $inputmodules"
6710 else
6711 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
6712 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
6713 inputmodules="dvdnav $inputmodules"
6715 else
6716 def_dvdnav='#undef CONFIG_DVDNAV'
6717 noinputmodules="dvdnav $noinputmodules"
6719 echores "$_dvdnav"
6721 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
6722 # Read dvdnav comment above.
6724 mak_enable () {
6725 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6726 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6727 nprefix=$3;
6728 for part in $list; do
6729 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6730 echo "${nprefix}_$part = yes"
6732 done
6735 #############################################################################
6736 echo "Creating config.mak"
6737 cat > config.mak << EOF
6738 # -------- Generated by configure -----------
6740 # Ensure that locale settings do not interfere with shell commands.
6741 export LC_ALL = C
6743 CONFIGURATION = $configuration
6745 CHARSET = $_charset
6746 DOC_LANGS = $language_doc
6747 DOC_LANG_ALL = $doc_lang_all
6748 MAN_LANGS = $language_man
6749 MAN_LANG_ALL = $man_lang_all
6750 MSG_LANGS = $language_msg
6751 MSG_LANG_ALL = $msg_lang_all
6753 prefix = \$(DESTDIR)$_prefix
6754 BINDIR = \$(DESTDIR)$_bindir
6755 DATADIR = \$(DESTDIR)$_datadir
6756 LIBDIR = \$(DESTDIR)$_libdir
6757 MANDIR = \$(DESTDIR)$_mandir
6758 CONFDIR = \$(DESTDIR)$_confdir
6759 LOCALEDIR = \$(DESTDIR)$_localedir
6761 AR = $_ar
6762 AS = $_cc
6763 CC = $_cc
6764 CXX = $_cc
6765 HOST_CC = $_host_cc
6766 INSTALL = $_install
6767 INSTALLSTRIP = $_install_strip
6768 WINDRES = $_windres
6770 CFLAGS = $WARNFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
6771 CXXFLAGS = $WARNFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
6772 DEPFLAGS = $DEPFLAGS
6774 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
6775 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
6776 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
6777 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
6778 CFLAGS_STACKREALIGN = $cflags_stackrealign
6780 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
6781 EXTRALIBS_MPLAYER = $libs_mplayer
6783 GETCH = $_getch
6784 TIMER = $_timer
6786 EXESUF = $_exesuf
6787 EXESUFS_ALL = .exe
6789 ARCH = $arch
6790 $(mak_enable "$arch_all" "$arch" ARCH)
6791 $(mak_enable "$subarch_all" "$subarch" ARCH)
6792 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
6794 MPLAYER = $_mplayer
6796 NEED_GETTIMEOFDAY = $need_gettimeofday
6797 NEED_GLOB = $need_glob
6798 NEED_MMAP = $need_mmap
6799 NEED_SETENV = $need_setenv
6800 NEED_SHMEM = $need_shmem
6801 NEED_STRSEP = $need_strsep
6802 NEED_SWAB = $need_swab
6803 NEED_VSSCANF = $need_vsscanf
6805 # features
6806 3DFX = $_3dfx
6807 AA = $_aa
6808 ALSA1X = $_alsa1x
6809 ALSA9 = $_alsa9
6810 ALSA5 = $_alsa5
6811 APPLE_IR = $_apple_ir
6812 APPLE_REMOTE = $_apple_remote
6813 ARTS = $_arts
6814 AUDIO_INPUT = $_audio_input
6815 BITMAP_FONT = $_bitmap_font
6816 BL = $_bl
6817 CACA = $_caca
6818 CDDA = $_cdda
6819 CDDB = $_cddb
6820 COREAUDIO = $_coreaudio
6821 COREVIDEO = $_corevideo
6822 DART = $_dart
6823 DGA = $_dga
6824 DIRECT3D = $_direct3d
6825 DIRECTFB = $_directfb
6826 DIRECTX = $_directx
6827 DVBIN = $_dvbin
6828 DVDNAV = $_dvdnav
6829 DVDNAV_INTERNAL = $dvdnav_internal
6830 DVDREAD = $_dvdread
6831 DVDREAD_INTERNAL = $_dvdread_internal
6832 DXR3 = $_dxr3
6833 ESD = $_esd
6834 FAAD = $_faad
6835 FASTMEMCPY = $_fastmemcpy
6836 FBDEV = $_fbdev
6837 FREETYPE = $_freetype
6838 FTP = $_ftp
6839 GIF = $_gif
6840 GGI = $_ggi
6841 GL = $_gl
6842 GL_WIN32 = $_gl_win32
6843 GL_X11 = $_gl_x11
6844 GL_SDL = $_gl_sdl
6845 MATRIXVIEW = $matrixview
6846 HAVE_POSIX_SELECT = $_posix_select
6847 HAVE_SYS_MMAN_H = $_mman
6848 IVTV = $_ivtv
6849 JACK = $_jack
6850 JOYSTICK = $_joystick
6851 JPEG = $_jpeg
6852 KAI = $_kai
6853 KVA = $_kva
6854 LADSPA = $_ladspa
6855 LIBA52 = $_liba52
6856 LIBASS = $_ass
6857 LIBBLURAY = $_bluray
6858 LIBBS2B = $_libbs2b
6859 LIBDCA = $_libdca
6860 LIBDV = $_libdv
6861 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
6862 LIBLZO = $_liblzo
6863 LIBMAD = $_mad
6864 LIBMENU = $_menu
6865 LIBMENU_DVBIN = $_menu_dvbin
6866 LIBNEMESI = $_nemesi
6867 LIBNUT = $_libnut
6868 LIBSMBCLIENT = $_smb
6869 LIBTHEORA = $_theora
6870 LIRC = $_lirc
6871 LIVE555 = $_live
6872 MACOSX_FINDER = $_macosx_finder
6873 MD5SUM = $_md5sum
6874 MGA = $_mga
6875 MNG = $_mng
6876 MP3LIB = $_mp3lib
6877 MPG123 = $_mpg123
6878 MUSEPACK = $_musepack
6879 NAS = $_nas
6880 NATIVE_RTSP = $_native_rtsp
6881 NETWORKING = $networking
6882 OPENAL = $_openal
6883 OSS = $_ossaudio
6884 PE_EXECUTABLE = $_pe_executable
6885 PNG = $_png
6886 PNM = $_pnm
6887 PRIORITY = $_priority
6888 PULSE = $_pulse
6889 PVR = $_pvr
6890 QTX_CODECS = $_qtx
6891 QTX_CODECS_WIN32 = $_qtx_codecs_win32
6892 QTX_EMULATION = $_qtx_emulation
6893 QUARTZ = $_quartz
6894 RADIO=$_radio
6895 RADIO_CAPTURE=$_radio_capture
6896 REAL_CODECS = $_real
6897 S3FB = $_s3fb
6898 SDL = $_sdl
6899 SPEEX = $_speex
6900 STREAM_CACHE = $_stream_cache
6901 SGIAUDIO = $_sgiaudio
6902 SUNAUDIO = $_sunaudio
6903 SVGA = $_svga
6904 TDFXFB = $_tdfxfb
6905 TDFXVID = $_tdfxvid
6906 TGA = $_tga
6907 TV = $_tv
6908 TV_BSDBT848 = $_tv_bsdbt848
6909 TV_DSHOW = $_tv_dshow
6910 TV_V4L = $_tv_v4l
6911 TV_V4L1 = $_tv_v4l1
6912 TV_V4L2 = $_tv_v4l2
6913 UNRAR_EXEC = $_unrar_exec
6914 V4L2 = $_v4l2
6915 VCD = $_vcd
6916 VDPAU = $_vdpau
6917 VESA = $_vesa
6918 VORBIS = $_vorbis
6919 VSTREAM = $_vstream
6920 WII = $_wii
6921 WIN32DLL = $_win32dll
6922 WIN32WAVEOUT = $_win32waveout
6923 WIN32_EMULATION = $_win32_emulation
6924 X11 = $_x11
6925 XANIM_CODECS = $_xanim
6926 XMGA = $_xmga
6927 XMMS_PLUGINS = $_xmms
6928 XV = $_xv
6929 XVID4 = $_xvid
6930 XVMC = $_xvmc
6931 XVR100 = $_xvr100
6932 YUV4MPEG = $_yuv4mpeg
6934 # FFmpeg
6935 FFMPEG = $ffmpeg
6936 FFMPEG_EVAL_API = $ffmpeg_eval_api
6937 FFMPEG_INTERNALS = $ffmpeg_internals
6938 FFMPEG_SOURCE_PATH = $_ffmpeg_source
6940 RANLIB = $_ranlib
6941 YASM = $_yasm
6942 YASMFLAGS = $YASMFLAGS
6944 CONFIG_BZLIB = $bzlib
6945 CONFIG_VDPAU = $_vdpau
6946 CONFIG_XVMC = $_xvmc
6947 CONFIG_ZLIB = $_zlib
6949 HAVE_PTHREADS = $_pthreads
6950 HAVE_SHM = $_shm
6951 HAVE_W32THREADS = $_w32threads
6952 HAVE_YASM = $have_yasm
6956 #############################################################################
6958 ff_config_enable () {
6959 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6960 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6961 _nprefix=$3;
6962 test -z "$_nprefix" && _nprefix='CONFIG'
6963 for part in $list; do
6964 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6965 echo "#define ${_nprefix}_$part 1"
6966 else
6967 echo "#define ${_nprefix}_$part 0"
6969 done
6972 echo "Creating config.h"
6973 cat > $TMPH << EOF
6974 /*----------------------------------------------------------------------------
6975 ** This file has been automatically generated by configure any changes in it
6976 ** will be lost when you run configure again.
6977 ** Instead of modifying definitions here, use the --enable/--disable options
6978 ** of the configure script! See ./configure --help for details.
6979 *---------------------------------------------------------------------------*/
6981 #ifndef MPLAYER_CONFIG_H
6982 #define MPLAYER_CONFIG_H
6984 /* Undefine this if you do not want to select mono audio (left or right)
6985 with a stereo MPEG layer 2/3 audio stream. The command line option
6986 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6987 right-only), with 0 being the default.
6989 #define CONFIG_FAKE_MONO 1
6991 /* set up audio OUTBURST. Do not change this! */
6992 #define OUTBURST 512
6994 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
6995 #undef FAST_OSD
6996 #undef FAST_OSD_TABLE
7000 #define CONFIGURATION "$configuration"
7002 #define MPLAYER_DATADIR "$_datadir"
7003 #define MPLAYER_CONFDIR "$_confdir"
7004 #define MPLAYER_LIBDIR "$_libdir"
7005 #define MPLAYER_LOCALEDIR "$_localedir"
7007 $def_translation
7009 /* definitions needed by included libraries */
7010 #define HAVE_INTTYPES_H 1
7011 /* libdvdcss */
7012 #define HAVE_ERRNO_H 1
7013 /* libdvdcss + libdvdread */
7014 #define HAVE_LIMITS_H 1
7015 /* libdvdcss */
7016 #define HAVE_UNISTD_H 1
7017 /* libdvdread */
7018 #define STDC_HEADERS 1
7019 #define HAVE_MEMCPY 1
7020 /* libdvdnav */
7021 #define READ_CACHE_TRACE 0
7022 /* libdvdread */
7023 #define HAVE_DLFCN_H 1
7024 $def_dvdcss
7027 /* system headers */
7028 $def_alloca_h
7029 $def_alsa_asoundlib_h
7030 $def_altivec_h
7031 $def_malloc_h
7032 $def_mman_h
7033 $def_mman_has_map_failed
7034 $def_soundcard_h
7035 $def_sys_asoundlib_h
7036 $def_sys_soundcard_h
7037 $def_sys_sysinfo_h
7038 $def_termios_h
7039 $def_termios_sys_h
7040 $def_winsock2_h
7043 /* system functions */
7044 $def_gethostbyname2
7045 $def_gettimeofday
7046 $def_glob
7047 $def_langinfo
7048 $def_lrintf
7049 $def_map_memalign
7050 $def_memalign
7051 $def_nanosleep
7052 $def_posix_select
7053 $def_select
7054 $def_setenv
7055 $def_setmode
7056 $def_shm
7057 $def_strsep
7058 $def_swab
7059 $def_sysi86
7060 $def_sysi86_iv
7061 $def_termcap
7062 $def_termios
7063 $def_vsscanf
7066 /* system-specific features */
7067 $def_asmalign_pot
7068 $def_builtin_expect
7069 $def_dl
7070 $def_dos_paths
7071 $def_extern_asm
7072 $def_extern_prefix
7073 $def_iconv
7074 $def_kstat
7075 $def_macosx_bundle
7076 $def_macosx_finder
7077 $def_maemo
7078 $def_named_asm_args
7079 $def_priority
7080 $def_quicktime
7081 $def_restrict_keyword
7082 $def_rtc
7083 $def_unrar_exec
7086 /* configurable options */
7087 $def_charset
7088 $def_crash_debug
7089 $def_debug
7090 $def_dynamic_plugins
7091 $def_fastmemcpy
7092 $def_menu
7093 $def_runtime_cpudetection
7094 $def_sighandler
7095 $def_sortsub
7096 $def_stream_cache
7097 $def_pthread_cache
7100 /* CPU stuff */
7101 #define __CPU__ $iproc
7102 $def_ebx_available
7103 $def_words_endian
7104 $def_bigendian
7105 $(ff_config_enable "$arch_all" "$arch" "ARCH")
7106 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
7107 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
7110 /* Blu-ray/DVD/VCD/CD */
7111 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
7112 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
7113 $def_bluray
7114 $def_bsdi_dvd
7115 $def_cddb
7116 $def_cdio
7117 $def_cdparanoia
7118 $def_cdrom
7119 $def_dvd
7120 $def_dvd_bsd
7121 $def_dvd_darwin
7122 $def_dvd_linux
7123 $def_dvd_openbsd
7124 $def_dvdio
7125 $def_dvdnav
7126 $def_dvdread
7127 $def_hpux_scsi_h
7128 $def_libcdio
7129 $def_sol_scsi_h
7130 $def_vcd
7133 /* codec libraries */
7134 $def_faad
7135 $def_liba52
7136 $def_libdca
7137 $def_libdv
7138 $def_liblzo
7139 $def_mad
7140 $def_mp3lib
7141 $def_mpg123
7142 $def_musepack
7143 $def_speex
7144 $def_theora
7145 $def_tremor
7146 $def_vorbis
7147 $def_xvid
7148 $def_zlib
7150 $def_libnut
7153 /* binary codecs */
7154 $def_qtx
7155 $def_qtx_win32
7156 $def_real
7157 $def_win32_loader
7158 $def_win32dll
7159 $def_xanim
7160 $def_xmms
7161 #define BINARY_CODECS_PATH "$_codecsdir"
7162 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7165 /* Audio output drivers */
7166 $def_alsa
7167 $def_alsa1x
7168 $def_alsa5
7169 $def_alsa9
7170 $def_arts
7171 $def_coreaudio
7172 $def_dart
7173 $def_esd
7174 $def_esd_latency
7175 $def_jack
7176 $def_kai
7177 $def_nas
7178 $def_openal
7179 $def_openal_h
7180 $def_ossaudio
7181 $def_ossaudio_devdsp
7182 $def_ossaudio_devmixer
7183 $def_pulse
7184 $def_sgiaudio
7185 $def_sunaudio
7186 $def_win32waveout
7188 $def_ladspa
7189 $def_libbs2b
7192 /* input */
7193 $def_apple_ir
7194 $def_apple_remote
7195 $def_ioctl_bt848_h_name
7196 $def_ioctl_meteor_h_name
7197 $def_joystick
7198 $def_lirc
7199 $def_lircc
7200 $def_pvr
7201 $def_radio
7202 $def_radio_bsdbt848
7203 $def_radio_capture
7204 $def_radio_v4l
7205 $def_radio_v4l2
7206 $def_tv
7207 $def_tv_bsdbt848
7208 $def_tv_dshow
7209 $def_tv_v4l
7210 $def_tv_v4l1
7211 $def_tv_v4l2
7214 /* font stuff */
7215 $def_ass
7216 $def_bitmap_font
7217 $def_enca
7218 $def_fontconfig
7219 $def_freetype
7220 $def_fribidi
7223 /* networking */
7224 $def_closesocket
7225 $def_ftp
7226 $def_inet6
7227 $def_inet_aton
7228 $def_inet_pton
7229 $def_live
7230 $def_nemesi
7231 $def_networking
7232 $def_smb
7233 $def_socklen_t
7234 $def_vstream
7237 /* libvo options */
7238 $def_3dfx
7239 $def_aa
7240 $def_bl
7241 $def_caca
7242 $def_corevideo
7243 $def_dga
7244 $def_dga1
7245 $def_dga2
7246 $def_direct3d
7247 $def_directfb
7248 $def_directx
7249 $def_dvb
7250 $def_dvbin
7251 $def_dxr3
7252 $def_fbdev
7253 $def_ggi
7254 $def_ggiwmh
7255 $def_gif
7256 $def_gif_4
7257 $def_gif_tvt_hack
7258 $def_gl
7259 $def_gl_win32
7260 $def_gl_x11
7261 $def_gl_sdl
7262 $def_matrixview
7263 $def_ivtv
7264 $def_jpeg
7265 $def_kva
7266 $def_md5sum
7267 $def_mga
7268 $def_mng
7269 $def_png
7270 $def_pnm
7271 $def_quartz
7272 $def_s3fb
7273 $def_sdl
7274 $def_sdl_sdl_h
7275 $def_svga
7276 $def_tdfxfb
7277 $def_tdfxvid
7278 $def_tga
7279 $def_v4l2
7280 $def_vdpau
7281 $def_vesa
7282 $def_vm
7283 $def_wii
7284 $def_x11
7285 $def_xdpms
7286 $def_xf86keysym
7287 $def_xinerama
7288 $def_xmga
7289 $def_xss
7290 $def_xv
7291 $def_xvmc
7292 $def_xvr100
7293 $def_yuv4mpeg
7296 /* FFmpeg */
7297 $def_ffmpeg
7298 $def_ffmpeg_eval_api
7299 $def_ffmpeg_internals
7301 $def_arpa_inet_h
7302 $def_bswap
7303 $def_bzlib
7304 $def_dcbzl
7305 $def_exp2
7306 $def_exp2f
7307 $def_fast_64bit
7308 $def_fast_unaligned
7309 $def_llrint
7310 $def_log2
7311 $def_log2f
7312 $def_lrint
7313 $def_memalign_hack
7314 $def_mkstemp
7315 $def_posix_memalign
7316 $def_pthreads
7317 $def_round
7318 $def_roundf
7319 $def_ten_operands
7320 $def_threads
7321 $def_truncf
7322 $def_xform_asm
7323 $def_yasm
7325 #define HAVE_INLINE_ASM 1
7327 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
7328 #ifndef MP_DEBUG
7329 #define HAVE_EBP_AVAILABLE 1
7330 #else
7331 #define HAVE_EBP_AVAILABLE 0
7332 #endif
7334 #endif /* MPLAYER_CONFIG_H */
7337 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
7338 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
7340 #############################################################################
7342 ./version.sh `$_cc -dumpversion`
7344 cat << EOF
7346 Config files successfully generated by ./configure $configuration !
7348 Install prefix: $_prefix
7349 Data directory: $_datadir
7350 Config direct.: $_confdir
7352 Byte order: $_byte_order
7353 Optimizing for: $_optimizing
7355 Languages:
7356 Messages (in addition to English): $language_msg
7357 Manual pages: $language_man
7358 Documentation: $language_doc
7360 Enabled optional drivers:
7361 Input: $inputmodules
7362 Codecs: $codecmodules
7363 Audio output: $aomodules
7364 Video output: $vomodules
7366 Disabled optional drivers:
7367 Input: $noinputmodules
7368 Codecs: $nocodecmodules
7369 Audio output: $noaomodules
7370 Video output: $novomodules
7372 'config.h' and 'config.mak' contain your configuration options.
7373 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7374 compile *** DO NOT REPORT BUGS if you tweak these files ***
7376 'make' will now compile MPlayer and 'make install' will install it.
7377 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7382 if test "$_mtrr" = yes ; then
7383 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$language_doc/video.html#mtrr)"
7384 echo
7387 if ! x86_32; then
7388 cat <<EOF
7389 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7390 operating system ($system_name). You may encounter a few files that cannot
7391 be played due to missing open source video/audio codec support.
7397 cat <<EOF
7398 Check $TMPLOG if you wonder why an autodetection failed (make sure
7399 development headers/packages are installed).
7401 NOTE: The --enable-* parameters unconditionally force options on, completely
7402 skipping autodetection. This behavior is unlike what you may be used to from
7403 autoconf-based configure scripts that can decide to override you. This greater
7404 level of control comes at a price. You may have to provide the correct compiler
7405 and linker flags yourself.
7406 If you used one of these options (except --enable-menu and similar ones that
7407 turn on internal features) and experience a compilation or linking failure,
7408 make sure you have passed the necessary compiler/linker flags to configure.
7410 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
7414 if test "$warn_cflags" = yes; then
7415 cat <<EOF
7417 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
7418 but:
7420 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
7422 It is strongly recommended to let MPlayer choose the correct CFLAGS!
7423 To do so, execute 'CFLAGS= ./configure <options>'
7428 # Last move:
7429 rm -rf "$mplayer_tmpdir"