win32: get_path(): fix undefined behavior
[mplayer.git] / configure
blobaca6a6e61c213f1fbe246785a16d7e12eaaada8f
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: Check the Subversion log.
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, look at the existing checks
23 # and try to use helper functions where you can.
25 # Furthermore you need to add the variable _feature to the list of default
26 # settings and set it to one of yes/no/auto. Also add appropriate
27 # --enable-feature/--disable-feature command line options.
28 # The results of the check should be written to config.h and config.mak
29 # at the end of this script. The variable names used for this should be
30 # uniform, i.e. if the option is named 'feature':
32 # _feature : should have a value of yes/no/auto
33 # def_feature : '#define ... 1' or '#undef ...' for conditional compilation
34 # _ld_feature : '-L/path/dir -lfeature' GCC options
36 #############################################################################
38 # Prevent locale nonsense from breaking basic text processing utils
39 export LC_ALL=C
41 # Store the configure line that was used
42 configuration="$*"
44 # Prefer these macros to full length text !
45 # These macros only return an error code - NO display is done
46 compile_check() {
47 source="$1"
48 shift
49 echo >> "$TMPLOG"
50 cat "$source" >> "$TMPLOG"
51 echo >> "$TMPLOG"
52 echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
53 rm -f "$TMPEXE"
54 $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
55 TMPRES="$?"
56 echo >> "$TMPLOG"
57 echo >> "$TMPLOG"
58 return "$TMPRES"
61 cc_check() {
62 compile_check $TMPC $@
65 cxx_check() {
66 compile_check $TMPCPP $@ -lstdc++
69 cflag_check() {
70 cat > $TMPC << EOF
71 int main(void) { return 0; }
72 EOF
73 compile_check $TMPC $@
76 header_check() {
77 cat > $TMPC << EOF
78 #include <$1>
79 int main(void) { return 0; }
80 EOF
81 shift
82 compile_check $TMPC $@
85 return_check() {
86 cat > $TMPC << EOF
87 #include <$1>
88 int main(void) { return $2; }
89 EOF
90 shift 2
91 compile_check $TMPC $@
94 statement_check() {
95 cat > $TMPC << EOF
96 #include <$1>
97 int main(void) { $2; return 0; }
98 EOF
99 shift
100 shift
101 compile_check $TMPC $@
104 define_statement_check() {
105 cat > $TMPC << EOF
106 #define $1
107 #include <$2>
108 int main(void) { $3; return 0; }
110 shift 3
111 compile_check $TMPC $@
114 return_statement_check() {
115 cat > $TMPC << EOF
116 #include <$1>
117 int main(void) { $2; return $3; }
119 shift 3
120 compile_check $TMPC $@
123 inline_asm_check() {
124 cat > $TMPC << EOF
125 int main(void) { __asm__ volatile ($1); return 0; }
127 shift
128 compile_check $TMPC $@
131 # The following checks are special and should only be used with broken and
132 # non-selfsufficient headers that do not include all of their dependencies.
134 header_check_broken() {
135 cat > $TMPC << EOF
136 #include <$1>
137 #include <$2>
138 int main(void) { return 0; }
140 shift
141 shift
142 compile_check $TMPC $@
145 statement_check_broken() {
146 cat > $TMPC << EOF
147 #include <$1>
148 #include <$2>
149 int main(void) { $3; return 0; }
151 shift 3
152 compile_check $TMPC $@
155 yasm_check() {
156 echo >> "$TMPLOG"
157 cat "$TMPS" >> "$TMPLOG"
158 echo >> "$TMPLOG"
159 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
160 rm -f "$TMPEXE"
161 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
162 TMPRES="$?"
163 echo >> "$TMPLOG"
164 echo >> "$TMPLOG"
165 return "$TMPRES"
168 pkg_config_add() {
169 unset IFS # shell should not be used for programming
170 echo >> "$TMPLOG"
171 echo "$_pkg_config --cflags $@" >> "$TMPLOG"
172 ctmp=$($_pkg_config --cflags "$@" 2>> "$TMPLOG") || return $?
173 echo >> "$TMPLOG"
174 echo "$_pkg_config --libs $@" >> "$TMPLOG"
175 ltmp=$($_pkg_config --libs "$@" 2>> "$TMPLOG") || return $?
176 echo >> "$TMPLOG"
177 echo "cflags: $ctmp" >> "$TMPLOG"
178 echo "libs: $ltmp" >> "$TMPLOG"
179 echo >> "$TMPLOG"
180 extra_cflags="$extra_cflags $ctmp"
181 extra_ldflags="$extra_ldflags $ltmp"
184 tmp_run() {
185 "$TMPEXE" >> "$TMPLOG" 2>&1
188 # Display error message, flushes tempfile, exit
189 die () {
190 echo
191 echo "Error: $@" >&2
192 echo >&2
193 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
194 echo "Check \"$TMPLOG\" if you do not understand why it failed."
195 exit 1
198 # OS test booleans functions
199 issystem() {
200 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
202 aix() { issystem "AIX"; }
203 amigaos() { issystem "AmigaOS"; }
204 beos() { issystem "BEOS"; }
205 bsdos() { issystem "BSD/OS"; }
206 cygwin() { issystem "CYGWIN"; }
207 darwin() { issystem "Darwin"; }
208 dragonfly() { issystem "DragonFly"; }
209 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
210 gnu() { issystem "GNU"; }
211 hpux() { issystem "HP-UX"; }
212 irix() { issystem "IRIX"; }
213 linux() { issystem "Linux"; }
214 mingw32() { issystem "MINGW32"; }
215 morphos() { issystem "MorphOS"; }
216 netbsd() { issystem "NetBSD"; }
217 openbsd() { issystem "OpenBSD"; }
218 qnx() { issystem "QNX"; }
219 sunos() { issystem "SunOS"; }
220 win32() { cygwin || mingw32; }
222 # arch test boolean functions
223 # x86/x86pc is used by QNX
224 x86_32() {
225 case "$host_arch" in
226 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
227 *) return 1 ;;
228 esac
231 x86_64() {
232 case "$host_arch" in
233 x86_64|amd64) return 0 ;;
234 *) return 1 ;;
235 esac
238 x86() {
239 x86_32 || x86_64
242 ppc() {
243 case "$host_arch" in
244 ppc|ppc64|powerpc|powerpc64) return 0;;
245 *) return 1;;
246 esac
249 alpha() {
250 case "$host_arch" in
251 alpha*) return 0;;
252 *) return 1;;
253 esac
256 arm() {
257 case "$host_arch" in
258 arm*) return 0;;
259 *) return 1;;
260 esac
263 # Use this before starting a check
264 echocheck() {
265 echo "============ Checking for $@ ============" >> "$TMPLOG"
266 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
269 # Use this to echo the results of a check
270 echores() {
271 if test "$res_comment" ; then
272 res_comment="($res_comment)"
274 echo "Result is: $@ $res_comment" >> "$TMPLOG"
275 echo "##########################################" >> "$TMPLOG"
276 echo "" >> "$TMPLOG"
277 echo "$@ $res_comment"
278 res_comment=""
280 #############################################################################
282 # Check how echo works in this /bin/sh
283 case $(echo -n) in
284 -n) _echo_n= _echo_c='\c' ;; # SysV echo
285 *) _echo_n='-n ' _echo_c= ;; # BSD echo
286 esac
288 msg_lang_all=''
289 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
290 man_lang_all=$(echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g")
291 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
293 show_help(){
294 cat << EOF
295 Usage: $0 [OPTIONS]...
297 Configuration:
298 -h, --help display this help and exit
300 Installation directories:
301 --prefix=DIR prefix directory for installation [/usr/local]
302 --bindir=DIR directory for installing binaries [PREFIX/bin]
303 --datadir=DIR directory for installing machine independent
304 data files (skins, etc) [PREFIX/share/mplayer]
305 --mandir=DIR directory for installing man pages [PREFIX/share/man]
306 --confdir=DIR directory for installing configuration files
307 [PREFIX/etc/mplayer]
308 --localedir=DIR directory for locale tree [PREFIX/share/locale]
309 --libdir=DIR directory for object code libraries [PREFIX/lib]
310 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
312 Optional features:
313 --disable-mplayer disable MPlayer compilation [enable]
314 --enable-termcap use termcap database for key codes [autodetect]
315 --enable-termios use termios database for key codes [autodetect]
316 --disable-iconv disable iconv for encoding conversion [autodetect]
317 --disable-langinfo do not use langinfo [autodetect]
318 --enable-lirc enable LIRC (remote control) support [autodetect]
319 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
320 --enable-joystick enable joystick support [disable]
321 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
322 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
323 --disable-vm disable X video mode extensions [autodetect]
324 --disable-xf86keysym disable support for multimedia keys [autodetect]
325 --enable-radio enable radio interface [disable]
326 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
327 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
328 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
329 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
330 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
331 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
332 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
333 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
334 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
335 --disable-networking disable networking [enable]
336 --enable-winsock2_h enable winsock2_h [autodetect]
337 --enable-smb enable Samba (SMB) input [autodetect]
338 --enable-live enable LIVE555 Streaming Media [disable]
339 --enable-nemesi enable Nemesi Streaming Media [autodetect]
340 --disable-vcd disable VCD support [autodetect]
341 --disable-bluray disable Blu-ray support [autodetect]
342 --disable-dvdnav disable libdvdnav [autodetect]
343 --disable-dvdread disable libdvdread [autodetect]
344 --disable-dvdread-internal disable internal libdvdread [autodetect]
345 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
346 --disable-cddb disable cddb [autodetect]
347 --disable-bitmap-font disable bitmap font support [enable]
348 --disable-freetype disable FreeType 2 font rendering [autodetect]
349 --disable-fontconfig disable fontconfig font lookup [autodetect]
350 --disable-unrarexec disable using of UnRAR executable [enabled]
351 --disable-sortsub disable subtitle sorting [enabled]
352 --enable-fribidi enable the FriBiDi libs [autodetect]
353 --disable-enca disable ENCA charset oracle library [autodetect]
354 --enable-macosx-finder enable Mac OS X Finder invocation parameter
355 parsing [disabled]
356 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
357 --disable-inet6 disable IPv6 support [autodetect]
358 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
359 --disable-ftp disable FTP support [enabled]
360 --disable-vstream disable TiVo vstream client support [autodetect]
361 --disable-pthreads disable Posix threads support [autodetect]
362 --disable-w32threads disable Win32 threads support [autodetect]
363 --disable-libass disable subtitle rendering with libass [autodetect]
364 --enable-rpath enable runtime linker path for extra libs [disabled]
365 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
367 Codecs:
368 --enable-gif enable GIF support [autodetect]
369 --enable-png enable PNG input/output support [autodetect]
370 --enable-mng enable MNG input support [autodetect]
371 --enable-jpeg enable JPEG input/output support [autodetect]
372 --enable-libcdio enable libcdio support [autodetect]
373 --disable-win32dll disable Win32 DLL support [autodetect]
374 --disable-qtx disable QuickTime codecs support [enabled]
375 --disable-xanim disable XAnim codecs support [enabled]
376 --disable-real disable RealPlayer codecs support [enabled]
377 --disable-xvid disable Xvid [autodetect]
378 --disable-libnut disable libnut [autodetect]
379 --enable-libav skip Libav autodetection [autodetect]
380 --disable-libvorbis disable libvorbis support [autodetect]
381 --disable-tremor disable Tremor [autodetect if no libvorbis]
382 --disable-speex disable Speex support [autodetect]
383 --enable-theora enable OggTheora libraries [autodetect]
384 --enable-faad enable FAAD2 (AAC) [autodetect]
385 --disable-ladspa disable LADSPA plugin support [autodetect]
386 --disable-libbs2b disable libbs2b audio filter support [autodetect]
387 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
388 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
389 --disable-mad disable libmad (MPEG audio) support [autodetect]
390 --enable-xmms enable XMMS input plugin support [disabled]
391 --enable-libdca enable libdca support [autodetect]
392 --disable-liba52 disable liba52 [autodetect]
393 --enable-musepack enable libmpcdec support (deprecated, libavcodec
394 Musepack decoder is preferred) [disabled]
396 Video output:
397 --enable-gl enable OpenGL video output [autodetect]
398 --enable-dga2 enable DGA 2 support [autodetect]
399 --enable-dga1 enable DGA 1 support [autodetect]
400 --enable-vesa enable VESA video output [autodetect]
401 --enable-svga enable SVGAlib video output [autodetect]
402 --enable-sdl enable SDL video output [autodetect]
403 --enable-aa enable AAlib video output [autodetect]
404 --enable-caca enable CACA video output [autodetect]
405 --enable-ggi enable GGI video output [autodetect]
406 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
407 --enable-direct3d enable Direct3D video output [autodetect]
408 --enable-directx enable DirectX video output [autodetect]
409 --enable-dxr3 enable DXR3/H+ video output [autodetect]
410 --enable-ivtv enable IVTV TV-Out video output [autodetect]
411 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
412 --enable-dvb enable DVB video output [autodetect]
413 --enable-mga enable mga_vid video output [autodetect]
414 --enable-xmga enable mga_vid X11 video output [autodetect]
415 --enable-xv enable Xv video output [autodetect]
416 --enable-vdpau enable VDPAU acceleration [autodetect]
417 --enable-vm enable XF86VidMode support [autodetect]
418 --enable-xinerama enable Xinerama support [autodetect]
419 --enable-x11 enable X11 video output [autodetect]
420 --enable-xshape enable XShape support [autodetect]
421 --disable-xss disable screensaver support via xss [autodetect]
422 --enable-fbdev enable FBDev video output [autodetect]
423 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
424 --enable-tdfxfb enable tdfxfb video output [disable]
425 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
426 --enable-wii enable Nintendo Wii/GameCube video output [disable]
427 --enable-directfb enable DirectFB video output [autodetect]
428 --enable-bl enable Blinkenlights video output [disable]
429 --enable-tdfxvid enable tdfx_vid video output [disable]
430 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
431 --disable-tga disable Targa video output [enable]
432 --disable-pnm disable PNM video output [enable]
433 --disable-md5sum disable md5sum video output [enable]
434 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
435 --disable-corevideo disable CoreVideo video output [autodetect]
436 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
437 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
439 Audio output:
440 --disable-alsa disable ALSA audio output [autodetect]
441 --disable-ossaudio disable OSS audio output [autodetect]
442 --disable-arts disable aRts audio output [autodetect]
443 --disable-esd disable esd audio output [autodetect]
444 --disable-rsound disable RSound audio output [autodetect]
445 --disable-pulse disable Pulseaudio audio output [autodetect]
446 --disable-jack disable JACK audio output [autodetect]
447 --enable-openal enable OpenAL audio output [disable]
448 --disable-nas disable NAS audio output [autodetect]
449 --disable-sgiaudio disable SGI audio output [autodetect]
450 --disable-sunaudio disable Sun audio output [autodetect]
451 --disable-win32waveout disable Windows waveout audio output [autodetect]
452 --disable-coreaudio disable CoreAudio audio output [autodetect]
453 --disable-select disable using select() on the audio device [enable]
455 Language options:
456 --enable-translation enable support for translated output [disable]
457 --charset=charset convert the console messages to this character set
458 --language-doc=lang language to use for the documentation [en]
459 --language-man=lang language to use for the man pages [en]
460 --language-msg=lang extra languages for program messages [all]
461 --language=lang default language to use [en]
462 Specific options override --language. You can pass a list of languages separated
463 by whitespace or commas instead of a single language. Nonexisting translations
464 will be dropped from each list. All translations available in the list will be
465 installed. The value "all" will activate all translations. The LINGUAS
466 environment variable is honored. In all cases the fallback is English.
467 The program always supports English-language output; additional message
468 languages are only installed if --enable-translation is also specified.
469 Available values for --language-doc are: all $doc_lang_all
470 Available values for --language-man are: all $man_lang_all
471 Available values for --language-msg are: all $msg_lang_all
473 Miscellaneous options:
474 --enable-runtime-cpudetection enable runtime CPU detection [disable]
475 --enable-cross-compile enable cross-compilation [disable]
476 --cc=COMPILER C compiler to build MPlayer [gcc]
477 --host-cc=COMPILER C compiler for tools needed while building [gcc]
478 --as=ASSEMBLER assembler to build MPlayer [as]
479 --nm=NM nm tool to build MPlayer [nm]
480 --yasm=YASM Yasm assembler to build MPlayer [yasm]
481 --ar=AR librarian to build MPlayer [ar]
482 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
483 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
484 --windres=WINDRES windres to build MPlayer [windres]
485 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
486 --enable-static build a statically linked binary
487 --with-install=PATH path to a custom install program
489 Advanced options:
490 --enable-mmx enable MMX [autodetect]
491 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
492 --enable-3dnow enable 3DNow! [autodetect]
493 --enable-3dnowext enable extended 3DNow! [autodetect]
494 --enable-sse enable SSE [autodetect]
495 --enable-sse2 enable SSE2 [autodetect]
496 --enable-ssse3 enable SSSE3 [autodetect]
497 --enable-shm enable shm [autodetect]
498 --enable-altivec enable AltiVec (PowerPC) [autodetect]
499 --enable-armv5te enable DSP extensions (ARM) [autodetect]
500 --enable-armv6 enable ARMv6 (ARM) [autodetect]
501 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
502 --enable-armvfp enable ARM VFP (ARM) [autodetect]
503 --enable-neon enable NEON (ARM) [autodetect]
504 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
505 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
506 --enable-big-endian force byte order to big-endian [autodetect]
507 --enable-debug[=1-3] compile-in debugging information [disable]
508 --enable-profile compile-in profiling information [disable]
509 --disable-sighandler disable sighandler for crashes [enable]
510 --enable-crash-debug enable automatic gdb attach on crash [disable]
512 Use these options if autodetection fails:
513 --extra-cflags=FLAGS extra CFLAGS
514 --extra-ldflags=FLAGS extra LDFLAGS
515 --extra-libs=FLAGS extra linker flags
516 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
518 --with-sdl-config=PATH path to sdl*-config
519 --with-dvdnav-config=PATH path to dvdnav-config
520 --with-dvdread-config=PATH path to dvdread-config
522 This configure script is NOT autoconf-based, even though its output is similar.
523 It will try to autodetect all configuration options. If you --enable an option
524 it will be forcefully turned on, skipping autodetection. This can break
525 compilation, so you need to know what you are doing.
527 exit 0
528 } #show_help()
530 # GOTCHA: the variables below defines the default behavior for autodetection
531 # and have - unless stated otherwise - at least 2 states : yes no
532 # If autodetection is available then the third state is: auto
533 _mmx=auto
534 _3dnow=auto
535 _3dnowext=auto
536 _mmxext=auto
537 _sse=auto
538 _sse2=auto
539 _ssse3=auto
540 _cmov=auto
541 _fast_cmov=auto
542 _fast_clz=auto
543 _armv5te=auto
544 _armv6=auto
545 _armv6t2=auto
546 _armvfp=auto
547 neon=auto
548 _iwmmxt=auto
549 _altivec=auto
550 _install=install
551 _pkg_config=auto
552 _ranlib=auto
553 _windres=auto
554 _cc=auto
555 _ar=auto
556 test "$CC" && _cc="$CC"
557 _as=auto
558 _nm=auto
559 _yasm=auto
560 _runtime_cpudetection=no
561 _cross_compile=no
562 _prefix="/usr/local"
563 ffmpeg=auto
564 ffmpeg_internals=no
565 _mplayer=yes
566 _x11=auto
567 _xshape=auto
568 _xss=auto
569 _dga1=auto
570 _dga2=auto
571 _xv=auto
572 _vdpau=auto
573 _sdl=auto
574 _direct3d=auto
575 _directx=auto
576 _win32waveout=auto
577 _nas=auto
578 _png=auto
579 _mng=auto
580 _jpeg=auto
581 _pnm=yes
582 _md5sum=yes
583 _yuv4mpeg=yes
584 _gif=auto
585 _gl=auto
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 _rsound=auto
604 _pulse=auto
605 _jack=auto
606 _openal=no
607 _libcdio=auto
608 _mad=auto
609 _tremor=auto
610 _libvorbis=auto
611 _speex=auto
612 _theora=auto
613 _mpg123=auto
614 _liba52=auto
615 _libdca=auto
616 _faad=auto
617 _ladspa=auto
618 _libbs2b=auto
619 _xmms=no
620 _vcd=auto
621 _bluray=auto
622 _dvdnav=auto
623 _dvdnavconfig=dvdnav-config
624 _dvdreadconfig=dvdread-config
625 _dvdread=auto
626 _dvdread_internal=auto
627 _libdvdcss_internal=auto
628 _xanim=auto
629 _real=auto
630 _live=no
631 _nemesi=auto
632 _native_rtsp=yes
633 _xinerama=auto
634 _mga=auto
635 _xmga=auto
636 _vm=auto
637 _xf86keysym=auto
638 _sgiaudio=auto
639 _sunaudio=auto
640 _alsa=auto
641 _fastmemcpy=yes
642 _unrar_exec=auto
643 _win32dll=auto
644 _select=yes
645 _radio=no
646 _radio_capture=no
647 _radio_v4l=auto
648 _radio_v4l2=auto
649 _radio_bsdbt848=auto
650 _tv=yes
651 _tv_v4l1=auto
652 _tv_v4l2=auto
653 _tv_bsdbt848=auto
654 _tv_dshow=auto
655 _pvr=auto
656 networking=yes
657 _winsock2_h=auto
658 _smb=auto
659 _joystick=no
660 _xvid=auto
661 _libnut=auto
662 _lirc=auto
663 _lircc=auto
664 _apple_remote=auto
665 _apple_ir=auto
666 _termcap=auto
667 _termios=auto
668 _3dfx=no
669 _s3fb=no
670 _wii=no
671 _tdfxfb=no
672 _tdfxvid=no
673 _xvr100=auto
674 _tga=yes
675 _directfb=auto
676 _bl=no
677 #language=en
678 _shm=auto
679 _translation=no
680 _charset="UTF-8"
681 _crash_debug=no
682 _sighandler=yes
683 _libdv=auto
684 _cdda=auto
685 _cddb=auto
686 _big_endian=auto
687 _bitmap_font=yes
688 _freetype=auto
689 _fontconfig=auto
690 _qtx=auto
691 _coreaudio=auto
692 _corevideo=auto
693 _cocoa=auto
694 _sharedbuffer=auto
695 quicktime=auto
696 _macosx_finder=no
697 _macosx_bundle=auto
698 _sortsub=yes
699 _fribidi=auto
700 _enca=auto
701 _inet6=auto
702 _gethostbyname2=auto
703 _ftp=auto
704 _musepack=no
705 _vstream=auto
706 _pthreads=auto
707 _w32threads=auto
708 _ass=auto
709 _rpath=no
710 libpostproc=auto
711 _asmalign_pot=auto
712 _stream_cache=yes
713 _priority=no
714 def_dos_paths="#define HAVE_DOS_PATHS 0"
715 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
716 def_priority="#undef CONFIG_PRIORITY"
717 def_pthread_cache="#undef PTHREAD_CACHE"
718 need_shmem=yes
719 for ac_option do
720 case "$ac_option" in
721 --help|-help|-h)
722 show_help
724 --prefix=*)
725 _prefix=$(echo $ac_option | cut -d '=' -f 2)
727 --bindir=*)
728 _bindir=$(echo $ac_option | cut -d '=' -f 2)
730 --datadir=*)
731 _datadir=$(echo $ac_option | cut -d '=' -f 2)
733 --mandir=*)
734 _mandir=$(echo $ac_option | cut -d '=' -f 2)
736 --confdir=*)
737 _confdir=$(echo $ac_option | cut -d '=' -f 2)
739 --libdir=*)
740 _libdir=$(echo $ac_option | cut -d '=' -f 2)
742 --codecsdir=*)
743 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
745 --localedir=*)
746 _localedir=$(echo $ac_option | cut -d '=' -f 2)
749 --with-install=*)
750 _install=$(echo $ac_option | cut -d '=' -f 2 )
753 --with-sdl-config=*)
754 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
756 --with-dvdnav-config=*)
757 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
759 --with-dvdread-config=*)
760 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
763 --extra-cflags=*)
764 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
766 --extra-ldflags=*)
767 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
769 --extra-libs=*)
770 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
772 --extra-libs-mplayer=*)
773 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
776 --target=*)
777 _target=$(echo $ac_option | cut -d '=' -f 2)
779 --cc=*)
780 _cc=$(echo $ac_option | cut -d '=' -f 2)
782 --host-cc=*)
783 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
785 --as=*)
786 _as=$(echo $ac_option | cut -d '=' -f 2)
788 --nm=*)
789 _nm=$(echo $ac_option | cut -d '=' -f 2)
791 --yasm=*)
792 _yasm=$(echo $ac_option | cut -d '=' -f 2)
794 --ar=*)
795 _ar=$(echo $ac_option | cut -d '=' -f 2)
797 --pkg-config=*)
798 _pkg_config=$(echo $ac_option | cut -d '=' -f 2)
800 --ranlib=*)
801 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
803 --windres=*)
804 _windres=$(echo $ac_option | cut -d '=' -f 2)
806 --charset=*)
807 _charset=$(echo $ac_option | cut -d '=' -f 2)
809 --language-doc=*)
810 language_doc=$(echo $ac_option | cut -d '=' -f 2)
812 --language-man=*)
813 language_man=$(echo $ac_option | cut -d '=' -f 2)
815 --language-msg=*)
816 language_msg=$(echo $ac_option | cut -d '=' -f 2)
818 --language=*)
819 language=$(echo $ac_option | cut -d '=' -f 2)
822 --enable-static)
823 _ld_static='-static'
825 --disable-static)
826 _ld_static=''
828 --enable-profile)
829 _profile='-p'
831 --disable-profile)
832 _profile=
834 --enable-debug)
835 _debug='-g'
837 --enable-debug=*)
838 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
840 --disable-debug)
841 _debug=
843 --enable-translation) _translation=yes ;;
844 --disable-translation) _translation=no ;;
845 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
846 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
847 --enable-cross-compile) _cross_compile=yes ;;
848 --disable-cross-compile) _cross_compile=no ;;
849 --enable-mplayer) _mplayer=yes ;;
850 --disable-mplayer) _mplayer=no ;;
851 --enable-x11) _x11=yes ;;
852 --disable-x11) _x11=no ;;
853 --enable-xshape) _xshape=yes ;;
854 --disable-xshape) _xshape=no ;;
855 --enable-xss) _xss=yes ;;
856 --disable-xss) _xss=no ;;
857 --enable-xv) _xv=yes ;;
858 --disable-xv) _xv=no ;;
859 --enable-vdpau) _vdpau=yes ;;
860 --disable-vdpau) _vdpau=no ;;
861 --enable-sdl) _sdl=yes ;;
862 --disable-sdl) _sdl=no ;;
863 --enable-direct3d) _direct3d=yes ;;
864 --disable-direct3d) _direct3d=no ;;
865 --enable-directx) _directx=yes ;;
866 --disable-directx) _directx=no ;;
867 --enable-win32waveout) _win32waveout=yes ;;
868 --disable-win32waveout) _win32waveout=no ;;
869 --enable-nas) _nas=yes ;;
870 --disable-nas) _nas=no ;;
871 --enable-png) _png=yes ;;
872 --disable-png) _png=no ;;
873 --enable-mng) _mng=yes ;;
874 --disable-mng) _mng=no ;;
875 --enable-jpeg) _jpeg=yes ;;
876 --disable-jpeg) _jpeg=no ;;
877 --enable-pnm) _pnm=yes ;;
878 --disable-pnm) _pnm=no ;;
879 --enable-md5sum) _md5sum=yes ;;
880 --disable-md5sum) _md5sum=no ;;
881 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
882 --disable-yuv4mpeg) _yuv4mpeg=no ;;
883 --enable-gif) _gif=yes ;;
884 --disable-gif) _gif=no ;;
885 --enable-gl) _gl=yes ;;
886 --disable-gl) _gl=no ;;
887 --enable-ggi) _ggi=yes ;;
888 --disable-ggi) _ggi=no ;;
889 --enable-ggiwmh) _ggiwmh=yes ;;
890 --disable-ggiwmh) _ggiwmh=no ;;
891 --enable-aa) _aa=yes ;;
892 --disable-aa) _aa=no ;;
893 --enable-caca) _caca=yes ;;
894 --disable-caca) _caca=no ;;
895 --enable-svga) _svga=yes ;;
896 --disable-svga) _svga=no ;;
897 --enable-vesa) _vesa=yes ;;
898 --disable-vesa) _vesa=no ;;
899 --enable-fbdev) _fbdev=yes ;;
900 --disable-fbdev) _fbdev=no ;;
901 --enable-dvb) _dvb=yes ;;
902 --disable-dvb) _dvb=no ;;
903 --enable-dxr3) _dxr3=yes ;;
904 --disable-dxr3) _dxr3=no ;;
905 --enable-ivtv) _ivtv=yes ;;
906 --disable-ivtv) _ivtv=no ;;
907 --enable-v4l2) _v4l2=yes ;;
908 --disable-v4l2) _v4l2=no ;;
909 --enable-iconv) _iconv=yes ;;
910 --disable-iconv) _iconv=no ;;
911 --enable-langinfo) _langinfo=yes ;;
912 --disable-langinfo) _langinfo=no ;;
913 --enable-rtc) _rtc=yes ;;
914 --disable-rtc) _rtc=no ;;
915 --enable-libdv) _libdv=yes ;;
916 --disable-libdv) _libdv=no ;;
917 --enable-ossaudio) _ossaudio=yes ;;
918 --disable-ossaudio) _ossaudio=no ;;
919 --enable-arts) _arts=yes ;;
920 --disable-arts) _arts=no ;;
921 --enable-esd) _esd=yes ;;
922 --disable-esd) _esd=no ;;
923 --enable-rsound) _rsound=yes ;;
924 --disable-rsound) _rsound=no ;;
925 --enable-pulse) _pulse=yes ;;
926 --disable-pulse) _pulse=no ;;
927 --enable-jack) _jack=yes ;;
928 --disable-jack) _jack=no ;;
929 --enable-openal) _openal=yes ;;
930 --disable-openal) _openal=no ;;
931 --enable-mad) _mad=yes ;;
932 --disable-mad) _mad=no ;;
933 --enable-libcdio) _libcdio=yes ;;
934 --disable-libcdio) _libcdio=no ;;
935 --enable-libvorbis) _libvorbis=yes ;;
936 --disable-libvorbis) _libvorbis=no ;;
937 --enable-speex) _speex=yes ;;
938 --disable-speex) _speex=no ;;
939 --enable-tremor) _tremor=yes ;;
940 --disable-tremor) _tremor=no ;;
941 --enable-theora) _theora=yes ;;
942 --disable-theora) _theora=no ;;
943 --enable-mpg123) _mpg123=yes ;;
944 --disable-mpg123) _mpg123=no ;;
945 --enable-liba52) _liba52=yes ;;
946 --disable-liba52) _liba52=no ;;
947 --enable-libdca) _libdca=yes ;;
948 --disable-libdca) _libdca=no ;;
949 --enable-musepack) _musepack=yes ;;
950 --disable-musepack) _musepack=no ;;
951 --enable-faad) _faad=yes ;;
952 --disable-faad) _faad=no ;;
953 --enable-ladspa) _ladspa=yes ;;
954 --disable-ladspa) _ladspa=no ;;
955 --enable-libbs2b) _libbs2b=yes ;;
956 --disable-libbs2b) _libbs2b=no ;;
957 --enable-xmms) _xmms=yes ;;
958 --disable-xmms) _xmms=no ;;
959 --enable-vcd) _vcd=yes ;;
960 --disable-vcd) _vcd=no ;;
961 --enable-bluray) _bluray=yes ;;
962 --disable-bluray) _bluray=no ;;
963 --enable-dvdread) _dvdread=yes ;;
964 --disable-dvdread) _dvdread=no ;;
965 --enable-dvdread-internal) _dvdread_internal=yes ;;
966 --disable-dvdread-internal) _dvdread_internal=no ;;
967 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
968 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
969 --enable-dvdnav) _dvdnav=yes ;;
970 --disable-dvdnav) _dvdnav=no ;;
971 --enable-xanim) _xanim=yes ;;
972 --disable-xanim) _xanim=no ;;
973 --enable-real) _real=yes ;;
974 --disable-real) _real=no ;;
975 --enable-live) _live=yes ;;
976 --disable-live) _live=no ;;
977 --enable-nemesi) _nemesi=yes ;;
978 --disable-nemesi) _nemesi=no ;;
979 --enable-xinerama) _xinerama=yes ;;
980 --disable-xinerama) _xinerama=no ;;
981 --enable-mga) _mga=yes ;;
982 --disable-mga) _mga=no ;;
983 --enable-xmga) _xmga=yes ;;
984 --disable-xmga) _xmga=no ;;
985 --enable-vm) _vm=yes ;;
986 --disable-vm) _vm=no ;;
987 --enable-xf86keysym) _xf86keysym=yes ;;
988 --disable-xf86keysym) _xf86keysym=no ;;
989 --enable-sunaudio) _sunaudio=yes ;;
990 --disable-sunaudio) _sunaudio=no ;;
991 --enable-sgiaudio) _sgiaudio=yes ;;
992 --disable-sgiaudio) _sgiaudio=no ;;
993 --enable-alsa) _alsa=yes ;;
994 --disable-alsa) _alsa=no ;;
995 --enable-tv) _tv=yes ;;
996 --disable-tv) _tv=no ;;
997 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
998 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
999 --enable-tv-v4l1) _tv_v4l1=yes ;;
1000 --disable-tv-v4l1) _tv_v4l1=no ;;
1001 --enable-tv-v4l2) _tv_v4l2=yes ;;
1002 --disable-tv-v4l2) _tv_v4l2=no ;;
1003 --enable-tv-dshow) _tv_dshow=yes ;;
1004 --disable-tv-dshow) _tv_dshow=no ;;
1005 --enable-radio) _radio=yes ;;
1006 --enable-radio-capture) _radio_capture=yes ;;
1007 --disable-radio-capture) _radio_capture=no ;;
1008 --disable-radio) _radio=no ;;
1009 --enable-radio-v4l) _radio_v4l=yes ;;
1010 --disable-radio-v4l) _radio_v4l=no ;;
1011 --enable-radio-v4l2) _radio_v4l2=yes ;;
1012 --disable-radio-v4l2) _radio_v4l2=no ;;
1013 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1014 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1015 --enable-pvr) _pvr=yes ;;
1016 --disable-pvr) _pvr=no ;;
1017 --enable-fastmemcpy) _fastmemcpy=yes ;;
1018 --disable-fastmemcpy) _fastmemcpy=no ;;
1019 --enable-networking) networking=yes ;;
1020 --disable-networking) networking=no ;;
1021 --enable-winsock2_h) _winsock2_h=yes ;;
1022 --disable-winsock2_h) _winsock2_h=no ;;
1023 --enable-smb) _smb=yes ;;
1024 --disable-smb) _smb=no ;;
1025 --enable-joystick) _joystick=yes ;;
1026 --disable-joystick) _joystick=no ;;
1027 --enable-xvid) _xvid=yes ;;
1028 --disable-xvid) _xvid=no ;;
1029 --enable-libnut) _libnut=yes ;;
1030 --disable-libnut) _libnut=no ;;
1031 --enable-libav) ffmpeg=yes ;;
1032 --ffmpeg-source-dir=*)
1033 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1035 --enable-lirc) _lirc=yes ;;
1036 --disable-lirc) _lirc=no ;;
1037 --enable-lircc) _lircc=yes ;;
1038 --disable-lircc) _lircc=no ;;
1039 --enable-apple-remote) _apple_remote=yes ;;
1040 --disable-apple-remote) _apple_remote=no ;;
1041 --enable-apple-ir) _apple_ir=yes ;;
1042 --disable-apple-ir) _apple_ir=no ;;
1043 --enable-termcap) _termcap=yes ;;
1044 --disable-termcap) _termcap=no ;;
1045 --enable-termios) _termios=yes ;;
1046 --disable-termios) _termios=no ;;
1047 --enable-3dfx) _3dfx=yes ;;
1048 --disable-3dfx) _3dfx=no ;;
1049 --enable-s3fb) _s3fb=yes ;;
1050 --disable-s3fb) _s3fb=no ;;
1051 --enable-wii) _wii=yes ;;
1052 --disable-wii) _wii=no ;;
1053 --enable-tdfxfb) _tdfxfb=yes ;;
1054 --disable-tdfxfb) _tdfxfb=no ;;
1055 --disable-tdfxvid) _tdfxvid=no ;;
1056 --enable-tdfxvid) _tdfxvid=yes ;;
1057 --disable-xvr100) _xvr100=no ;;
1058 --enable-xvr100) _xvr100=yes ;;
1059 --disable-tga) _tga=no ;;
1060 --enable-tga) _tga=yes ;;
1061 --enable-directfb) _directfb=yes ;;
1062 --disable-directfb) _directfb=no ;;
1063 --enable-bl) _bl=yes ;;
1064 --disable-bl) _bl=no ;;
1065 --enable-shm) _shm=yes ;;
1066 --disable-shm) _shm=no ;;
1067 --enable-select) _select=yes ;;
1068 --disable-select) _select=no ;;
1069 --enable-cddb) _cddb=yes ;;
1070 --disable-cddb) _cddb=no ;;
1071 --enable-big-endian) _big_endian=yes ;;
1072 --disable-big-endian) _big_endian=no ;;
1073 --enable-bitmap-font) _bitmap_font=yes ;;
1074 --disable-bitmap-font) _bitmap_font=no ;;
1075 --enable-freetype) _freetype=yes ;;
1076 --disable-freetype) _freetype=no ;;
1077 --enable-fontconfig) _fontconfig=yes ;;
1078 --disable-fontconfig) _fontconfig=no ;;
1079 --enable-unrarexec) _unrar_exec=yes ;;
1080 --disable-unrarexec) _unrar_exec=no ;;
1081 --enable-ftp) _ftp=yes ;;
1082 --disable-ftp) _ftp=no ;;
1083 --enable-vstream) _vstream=yes ;;
1084 --disable-vstream) _vstream=no ;;
1085 --enable-pthreads) _pthreads=yes ;;
1086 --disable-pthreads) _pthreads=no ;;
1087 --enable-w32threads) _w32threads=yes ;;
1088 --disable-w32threads) _w32threads=no ;;
1089 --enable-libass) _ass=yes ;;
1090 --disable-libass) _ass=no ;;
1091 --enable-rpath) _rpath=yes ;;
1092 --disable-rpath) _rpath=no ;;
1093 --enable-libpostproc) libpostproc=yes ;;
1094 --disable-libpostproc) libpostproc=no ;;
1096 --enable-fribidi) _fribidi=yes ;;
1097 --disable-fribidi) _fribidi=no ;;
1099 --enable-enca) _enca=yes ;;
1100 --disable-enca) _enca=no ;;
1102 --enable-inet6) _inet6=yes ;;
1103 --disable-inet6) _inet6=no ;;
1105 --enable-gethostbyname2) _gethostbyname2=yes ;;
1106 --disable-gethostbyname2) _gethostbyname2=no ;;
1108 --enable-dga1) _dga1=yes ;;
1109 --disable-dga1) _dga1=no ;;
1110 --enable-dga2) _dga2=yes ;;
1111 --disable-dga2) _dga2=no ;;
1113 --enable-qtx) _qtx=yes ;;
1114 --disable-qtx) _qtx=no ;;
1116 --enable-coreaudio) _coreaudio=yes ;;
1117 --disable-coreaudio) _coreaudio=no ;;
1118 --enable-corevideo) _corevideo=yes ;;
1119 --disable-corevideo) _corevideo=no ;;
1120 --enable-cocoa) _cocoa=yes ;;
1121 --disable-cocoa) _cocoa=no ;;
1122 --enable-sharedbuffer) _sharedbuffer=yes ;;
1123 --disable-sharedbuffer) _sharedbuffer=no ;;
1124 --enable-macosx-finder) _macosx_finder=yes ;;
1125 --disable-macosx-finder) _macosx_finder=no ;;
1126 --enable-macosx-bundle) _macosx_bundle=yes ;;
1127 --disable-macosx-bundle) _macosx_bundle=no ;;
1129 --enable-sortsub) _sortsub=yes ;;
1130 --disable-sortsub) _sortsub=no ;;
1132 --enable-crash-debug) _crash_debug=yes ;;
1133 --disable-crash-debug) _crash_debug=no ;;
1134 --enable-sighandler) _sighandler=yes ;;
1135 --disable-sighandler) _sighandler=no ;;
1136 --enable-win32dll) _win32dll=yes ;;
1137 --disable-win32dll) _win32dll=no ;;
1139 --enable-sse) _sse=yes ;;
1140 --disable-sse) _sse=no ;;
1141 --enable-sse2) _sse2=yes ;;
1142 --disable-sse2) _sse2=no ;;
1143 --enable-ssse3) _ssse3=yes ;;
1144 --disable-ssse3) _ssse3=no ;;
1145 --enable-mmxext) _mmxext=yes ;;
1146 --disable-mmxext) _mmxext=no ;;
1147 --enable-3dnow) _3dnow=yes ;;
1148 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1149 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1150 --disable-3dnowext) _3dnowext=no ;;
1151 --enable-cmov) _cmov=yes ;;
1152 --disable-cmov) _cmov=no ;;
1153 --enable-fast-cmov) _fast_cmov=yes ;;
1154 --disable-fast-cmov) _fast_cmov=no ;;
1155 --enable-fast-clz) _fast_clz=yes ;;
1156 --disable-fast-clz) _fast_clz=no ;;
1157 --enable-altivec) _altivec=yes ;;
1158 --disable-altivec) _altivec=no ;;
1159 --enable-armv5te) _armv5te=yes ;;
1160 --disable-armv5te) _armv5te=no ;;
1161 --enable-armv6) _armv6=yes ;;
1162 --disable-armv6) _armv6=no ;;
1163 --enable-armv6t2) _armv6t2=yes ;;
1164 --disable-armv6t2) _armv6t2=no ;;
1165 --enable-armvfp) _armvfp=yes ;;
1166 --disable-armvfp) _armvfp=no ;;
1167 --enable-neon) neon=yes ;;
1168 --disable-neon) neon=no ;;
1169 --enable-iwmmxt) _iwmmxt=yes ;;
1170 --disable-iwmmxt) _iwmmxt=no ;;
1171 --enable-mmx) _mmx=yes ;;
1172 --disable-mmx) # 3Dnow! and MMX2 require MMX
1173 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1176 echo "Unknown parameter: $ac_option" >&2
1177 exit 1
1180 esac
1181 done
1183 # Atmos: moved this here, to be correct, if --prefix is specified
1184 test -z "$_bindir" && _bindir="$_prefix/bin"
1185 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1186 test -z "$_mandir" && _mandir="$_prefix/share/man"
1187 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1188 test -z "$_libdir" && _libdir="$_prefix/lib"
1189 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1191 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1192 test "$tmpdir" && break
1193 done
1195 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1196 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1198 TMPLOG="config.log"
1200 rm -f "$TMPLOG"
1201 echo Parameters configure was run with: > "$TMPLOG"
1202 if test -n "$CFLAGS" ; then
1203 echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1205 if test -n "$PKG_CONFIG_PATH" ; then
1206 echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1208 echo ./configure $configuration >> "$TMPLOG"
1209 echo >> "$TMPLOG"
1212 echocheck "cross compilation"
1213 echores $_cross_compile
1215 if test $_cross_compile = yes; then
1216 tmp_run() {
1217 return 0
1219 test "$_host_cc" || _host_cc=cc
1222 tool_prefix=""
1224 if test $_cross_compile = yes ; then
1225 # Usually cross-compiler prefixes match with the target triplet
1226 test -n "$_target" && tool_prefix="$_target"-
1229 test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib
1230 test "$_windres" = auto && _windres="$tool_prefix"windres
1231 test "$_ar" = auto && _ar="$tool_prefix"ar
1232 test "$_yasm" = auto && _yasm="$tool_prefix"yasm
1233 test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
1235 if test "$_cc" = auto ; then
1236 if test -n "$tool_prefix" ; then
1237 _cc="$tool_prefix"gcc
1238 else
1239 _cc=cc
1243 # Determine our OS name and CPU architecture
1244 if test -z "$_target" ; then
1245 # OS name
1246 system_name=$(uname -s 2>&1)
1247 case "$system_name" in
1248 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1250 Haiku)
1251 system_name=BeOS
1253 IRIX*)
1254 system_name=IRIX
1256 GNU/kFreeBSD)
1257 system_name=FreeBSD
1259 HP-UX*)
1260 system_name=HP-UX
1262 [cC][yY][gG][wW][iI][nN]*)
1263 system_name=CYGWIN
1265 MINGW32*)
1266 system_name=MINGW32
1268 OS/2*)
1269 system_name=OS/2
1272 system_name="$system_name-UNKNOWN"
1274 esac
1277 # host's CPU/instruction set
1278 host_arch=$(uname -p 2>&1)
1279 case "$host_arch" in
1280 i386|sparc|ppc|alpha|arm|mips|vax)
1282 powerpc) # Darwin returns 'powerpc'
1283 host_arch=ppc
1285 *) # uname -p on Linux returns 'unknown' for the processor type,
1286 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1288 # Maybe uname -m (machine hardware name) returns something we
1289 # recognize.
1291 # x86/x86pc is used by QNX
1292 case "$(uname -m 2>&1)" in
1293 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 ;;
1294 ia64) host_arch=ia64 ;;
1295 macppc|ppc) host_arch=ppc ;;
1296 ppc64) host_arch=ppc64 ;;
1297 alpha) host_arch=alpha ;;
1298 sparc) host_arch=sparc ;;
1299 sparc64) host_arch=sparc64 ;;
1300 parisc*|hppa*|9000*) host_arch=hppa ;;
1301 arm*|zaurus|cats) host_arch=arm ;;
1302 sh3|sh4|sh4a) host_arch=sh ;;
1303 s390) host_arch=s390 ;;
1304 s390x) host_arch=s390x ;;
1305 *mips*) host_arch=mips ;;
1306 vax) host_arch=vax ;;
1307 xtensa*) host_arch=xtensa ;;
1308 *) host_arch=UNKNOWN ;;
1309 esac
1311 esac
1312 else # if test -z "$_target"
1313 for i in 2 3; do
1314 system_name=$(echo $_target | cut -d '-' -f $i)
1315 case "$(echo $system_name | tr A-Z a-z)" in
1316 linux) system_name=Linux ;;
1317 freebsd) system_name=FreeBSD ;;
1318 gnu/kfreebsd) system_name=FreeBSD ;;
1319 netbsd) system_name=NetBSD ;;
1320 bsd/os) system_name=BSD/OS ;;
1321 openbsd) system_name=OpenBSD ;;
1322 dragonfly) system_name=DragonFly ;;
1323 sunos) system_name=SunOS ;;
1324 qnx) system_name=QNX ;;
1325 morphos) system_name=MorphOS ;;
1326 amigaos) system_name=AmigaOS ;;
1327 mingw32*) system_name=MINGW32 ;;
1328 *) continue ;;
1329 esac
1330 break
1331 done
1332 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1333 host_arch=$(echo $_target | cut -d '-' -f 1)
1334 if test $(echo $host_arch) != "x86_64" ; then
1335 host_arch=$(echo $host_arch | tr '_' '-')
1339 extra_cflags="-I. $extra_cflags"
1340 _timer=timer-linux.c
1341 _getch=getch2.c
1342 if freebsd ; then
1343 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1344 extra_cflags="$extra_cflags -I/usr/local/include"
1347 if netbsd || dragonfly ; then
1348 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1349 extra_cflags="$extra_cflags -I/usr/pkg/include"
1352 if darwin; then
1353 extra_cflags="-mdynamic-no-pic $extra_cflags"
1354 if test "$(basename $_cc)" != "clang" ; then
1355 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
1357 _timer=timer-darwin.c
1360 if aix ; then
1361 extra_ldflags="$extra_ldflags -lC"
1364 if irix ; then
1365 _ranlib='ar -r'
1366 elif linux ; then
1367 _ranlib='true'
1370 if win32 ; then
1371 _exesuf=".exe"
1372 extra_cflags="$extra_cflags -fno-common"
1373 # -lwinmm is always needed for osdep/timer-win2.c
1374 extra_ldflags="$extra_ldflags -lwinmm"
1375 _pe_executable=yes
1376 _timer=timer-win2.c
1377 _priority=yes
1378 def_dos_paths="#define HAVE_DOS_PATHS 1"
1379 def_priority="#define CONFIG_PRIORITY 1"
1382 if mingw32 ; then
1383 _getch=getch2-win.c
1384 need_shmem=no
1385 extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1388 if amigaos ; then
1389 _select=no
1390 _sighandler=no
1391 _stream_cache=no
1392 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1393 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1396 if qnx ; then
1397 extra_ldflags="$extra_ldflags -lph"
1400 TMPC="$mplayer_tmpdir/tmp.c"
1401 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1402 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1403 TMPH="$mplayer_tmpdir/tmp.h"
1404 TMPS="$mplayer_tmpdir/tmp.S"
1406 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1407 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1411 # Checking CC version...
1412 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1413 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1414 echocheck "$_cc version"
1415 cc_vendor=intel
1416 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1417 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1418 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1419 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1420 # TODO verify older icc/ecc compatibility
1421 case $cc_version in
1423 cc_version="v. ?.??, bad"
1424 cc_fail=yes
1426 10.1|11.0|11.1)
1427 cc_version="$cc_version, ok"
1430 cc_version="$cc_version, bad"
1431 cc_fail=yes
1433 esac
1434 echores "$cc_version"
1435 else
1436 for _cc in "$_cc" gcc cc ; do
1437 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1438 if test "$cc_name_tmp" = "gcc"; then
1439 cc_name=$cc_name_tmp
1440 echocheck "$_cc version"
1441 cc_vendor=gnu
1442 cc_version=$($_cc -dumpversion 2>&1)
1443 case $cc_version in
1444 2.96*)
1445 cc_fail=yes
1448 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1449 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1450 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1452 esac
1453 echores "$cc_version"
1454 break
1456 if $_cc -v 2>&1 | grep -q "clang"; then
1457 echocheck "$_cc version"
1458 cc_vendor=clang
1459 cc_version=$($_cc -dumpversion 2>&1)
1460 res_comment="experimental support only"
1461 echores "clang $cc_version"
1462 break
1464 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1465 if test "$cc_name_tmp" = "Sun C"; then
1466 echocheck "$_cc version"
1467 cc_vendor=sun
1468 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1469 res_comment="experimental support only"
1470 echores "Sun C $cc_version"
1471 break
1473 done
1474 fi # icc
1475 test "$cc_fail" = yes && die "unsupported compiler version"
1477 echocheck "working compiler"
1478 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1479 echo "yes"
1481 if test -z "$_target" && x86 ; then
1482 cat > $TMPC << EOF
1483 int main(void) {
1484 int test[(int)sizeof(char *)-7];
1485 return 0;
1488 cc_check && host_arch=x86_64 || host_arch=i386
1491 echocheck "host cc"
1492 test "$_host_cc" || _host_cc=$_cc
1493 echores $_host_cc
1495 echo "Detected operating system: $system_name"
1496 echo "Detected host architecture: $host_arch"
1498 # ---
1500 # now that we know what compiler should be used for compilation, try to find
1501 # out which assembler is used by the $_cc compiler
1502 if test "$_as" = auto ; then
1503 _as=$($_cc -print-prog-name=as)
1504 test -z "$_as" && _as=as
1507 if test "$_nm" = auto ; then
1508 _nm=$($_cc -print-prog-name=nm)
1509 test -z "$_nm" && _nm=nm
1512 # XXX: this should be ok..
1513 _cpuinfo="echo"
1515 if test "$_runtime_cpudetection" = no ; then
1517 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1518 # FIXME: Remove the cygwin check once AMD CPUs are supported
1519 if test -r /proc/cpuinfo && ! cygwin; then
1520 # Linux with /proc mounted, extract CPU information from it
1521 _cpuinfo="cat /proc/cpuinfo"
1522 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1523 # FreeBSD with Linux emulation /proc mounted,
1524 # extract CPU information from it
1525 # Don't use it on x86 though, it never reports 3Dnow
1526 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1527 elif darwin && ! x86 ; then
1528 # use hostinfo on Darwin
1529 _cpuinfo="hostinfo"
1530 elif aix; then
1531 # use 'lsattr' on AIX
1532 _cpuinfo="lsattr -E -l proc0 -a type"
1533 elif x86; then
1534 # all other OSes try to extract CPU information from a small helper
1535 # program cpuinfo instead
1536 $_cc -o cpuinfo$_exesuf cpuinfo.c
1537 _cpuinfo="./cpuinfo$_exesuf"
1540 if x86 ; then
1541 # gather more CPU information
1542 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1543 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1544 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1545 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1546 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1548 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1550 pparam=$(echo $exts | sed -e s/xmm/sse/ -e s/kni/sse/)
1551 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1552 pparam=$(echo $pparam | sed -e 's/sse/sse mmxext/')
1554 for ext in $pparam ; do
1555 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1556 done
1558 echocheck "CPU vendor"
1559 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1561 echocheck "CPU type"
1562 echores "$pname"
1565 fi # test "$_runtime_cpudetection" = no
1567 if x86 && test "$_runtime_cpudetection" = no ; then
1568 extcheck() {
1569 if test "$1" = kernel_check ; then
1570 echocheck "kernel support of $2"
1571 cat > $TMPC <<EOF
1572 #include <stdlib.h>
1573 #include <signal.h>
1574 static void catch(int sig) { exit(1); }
1575 int main(void) {
1576 signal(SIGILL, catch);
1577 __asm__ volatile ("$3":::"memory"); return 0;
1581 if cc_check && tmp_run ; then
1582 eval _$2=yes
1583 echores "yes"
1584 _optimizing="$_optimizing $2"
1585 return 0
1586 else
1587 eval _$2=no
1588 echores "failed"
1589 echo "It seems that your kernel does not correctly support $2."
1590 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1591 return 1
1594 return 0
1597 extcheck $_mmx "mmx" "emms"
1598 extcheck $_mmxext "mmxext" "sfence"
1599 extcheck $_3dnow "3dnow" "femms"
1600 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1601 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1602 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1603 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1604 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1606 if test "$_gcc3_ext" != ""; then
1607 # if we had to disable sse/sse2 because the active kernel does not
1608 # support this instruction set extension, we also have to tell
1609 # gcc3 to not generate sse/sse2 instructions for normal C code
1610 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1616 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1617 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1618 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1619 subarch_all='X86_32 X86_64 PPC64'
1620 case "$host_arch" in
1621 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1622 arch='x86'
1623 subarch='x86_32'
1624 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1625 iproc=486
1626 proc=i486
1629 if test "$_runtime_cpudetection" = no ; then
1630 case "$pvendor" in
1631 AuthenticAMD)
1632 case "$pfamily" in
1633 3) proc=i386 iproc=386 ;;
1634 4) proc=i486 iproc=486 ;;
1635 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1636 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1637 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1638 proc=k6-3
1639 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1640 proc=geode
1641 elif test "$pmodel" -ge 8; then
1642 proc=k6-2
1643 elif test "$pmodel" -ge 6; then
1644 proc=k6
1645 else
1646 proc=i586
1649 6) iproc=686
1650 # It's a bit difficult to determine the correct type of Family 6
1651 # AMD CPUs just from their signature. Instead, we check directly
1652 # whether it supports SSE.
1653 if test "$_sse" = yes; then
1654 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1655 proc=athlon-xp
1656 else
1657 # Again, gcc treats athlon and athlon-tbird similarly.
1658 proc=athlon
1661 15) iproc=686
1662 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1663 # caught and remedied in the optimization tests below.
1664 proc=k8
1667 *) proc=amdfam10 iproc=686
1668 test $_fast_clz = "auto" && _fast_clz=yes
1670 esac
1672 GenuineIntel)
1673 case "$pfamily" in
1674 3) proc=i386 iproc=386 ;;
1675 4) proc=i486 iproc=486 ;;
1676 5) iproc=586
1677 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1678 proc=pentium-mmx # 4 is desktop, 8 is mobile
1679 else
1680 proc=i586
1683 6) iproc=686
1684 if test "$pmodel" -ge 15; then
1685 proc=core2
1686 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1687 proc=pentium-m
1688 elif test "$pmodel" -ge 7; then
1689 proc=pentium3
1690 elif test "$pmodel" -ge 3; then
1691 proc=pentium2
1692 else
1693 proc=i686
1695 test $_fast_clz = "auto" && _fast_clz=yes
1697 15) iproc=686
1698 # A nocona in 32-bit mode has no more capabilities than a prescott.
1699 if test "$pmodel" -ge 3; then
1700 proc=prescott
1701 else
1702 proc=pentium4
1703 test $_fast_clz = "auto" && _fast_clz=yes
1705 test $_fast_cmov = "auto" && _fast_cmov=no
1707 *) proc=prescott iproc=686 ;;
1708 esac
1710 CentaurHauls)
1711 case "$pfamily" in
1712 5) iproc=586
1713 if test "$pmodel" -ge 8; then
1714 proc=winchip2
1715 elif test "$pmodel" -ge 4; then
1716 proc=winchip-c6
1717 else
1718 proc=i586
1721 6) iproc=686
1722 if test "$pmodel" -ge 9; then
1723 proc=c3-2
1724 else
1725 proc=c3
1726 iproc=586
1729 *) proc=i686 iproc=i686 ;;
1730 esac
1732 unknown)
1733 case "$pfamily" in
1734 3) proc=i386 iproc=386 ;;
1735 4) proc=i486 iproc=486 ;;
1736 *) proc=i586 iproc=586 ;;
1737 esac
1740 proc=i586 iproc=586 ;;
1741 esac
1742 test $_fast_clz = "auto" && _fast_clz=no
1743 fi # test "$_runtime_cpudetection" = no
1746 # check that gcc supports our CPU, if not, fall back to earlier ones
1747 # LGB: check -mcpu and -march swithing step by step with enabling
1748 # to fall back till 386.
1750 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1752 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1753 cpuopt=-mtune
1754 else
1755 cpuopt=-mcpu
1758 echocheck "GCC & CPU optimization abilities"
1759 if test "$_runtime_cpudetection" = no ; then
1760 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1761 cflag_check -march=native && proc=native
1763 if test "$proc" = "amdfam10"; then
1764 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1766 if test "$proc" = "k8"; then
1767 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1769 if test "$proc" = "athlon-xp"; then
1770 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1772 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1773 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1775 if test "$proc" = "k6" || test "$proc" = "c3"; then
1776 if ! cflag_check -march=$proc $cpuopt=$proc; then
1777 if cflag_check -march=i586 $cpuopt=i686; then
1778 proc=i586-i686
1779 else
1780 proc=i586
1784 if test "$proc" = "prescott" ; then
1785 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1787 if test "$proc" = "core2" ; then
1788 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1790 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
1791 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1793 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1794 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1796 if test "$proc" = "i586"; then
1797 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1799 if test "$proc" = "i486" ; then
1800 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1802 if test "$proc" = "i386" ; then
1803 cflag_check -march=$proc $cpuopt=$proc || proc=error
1805 if test "$proc" = "error" ; then
1806 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1807 _mcpu=""
1808 _march=""
1809 _optimizing=""
1810 elif test "$proc" = "i586-i686"; then
1811 _march="-march=i586"
1812 _mcpu="$cpuopt=i686"
1813 _optimizing="$proc"
1814 else
1815 _march="-march=$proc"
1816 _mcpu="$cpuopt=$proc"
1817 _optimizing="$proc"
1819 else # if test "$_runtime_cpudetection" = no
1820 _mcpu="$cpuopt=generic"
1821 # at least i486 required, for bswap instruction
1822 _march="-march=i486"
1823 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1824 cflag_check $_mcpu || _mcpu=""
1825 cflag_check $_march $_mcpu || _march=""
1828 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1829 ## autodetected mcpu/march parameters
1830 if test "$_target" ; then
1831 # TODO: it may be a good idea to check GCC and fall back in all cases
1832 if test "$host_arch" = "i586-i686"; then
1833 _march="-march=i586"
1834 _mcpu="$cpuopt=i686"
1835 else
1836 _march="-march=$host_arch"
1837 _mcpu="$cpuopt=$host_arch"
1840 proc="$host_arch"
1842 case "$proc" in
1843 i386) iproc=386 ;;
1844 i486) iproc=486 ;;
1845 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1846 i686|athlon*|pentium*) iproc=686 ;;
1847 *) iproc=586 ;;
1848 esac
1851 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1852 _fast_cmov="yes"
1853 else
1854 _fast_cmov="no"
1856 test $_fast_clz = "auto" && _fast_clz=yes
1858 echores "$proc"
1861 ia64)
1862 arch='ia64'
1863 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1864 iproc='ia64'
1867 x86_64|amd64)
1868 arch='x86'
1869 subarch='x86_64'
1870 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1871 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1872 iproc='x86_64'
1874 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1875 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1876 cpuopt=-mtune
1877 else
1878 cpuopt=-mcpu
1880 if test "$_runtime_cpudetection" = no ; then
1881 case "$pvendor" in
1882 AuthenticAMD)
1883 case "$pfamily" in
1884 15) proc=k8
1885 test $_fast_clz = "auto" && _fast_clz=no
1887 *) proc=amdfam10;;
1888 esac
1890 GenuineIntel)
1891 case "$pfamily" in
1892 6) proc=core2;;
1894 # 64-bit prescotts exist, but as far as GCC is concerned they
1895 # have the same capabilities as a nocona.
1896 proc=nocona
1897 test $_fast_cmov = "auto" && _fast_cmov=no
1898 test $_fast_clz = "auto" && _fast_clz=no
1900 esac
1903 proc=error;;
1904 esac
1905 fi # test "$_runtime_cpudetection" = no
1907 echocheck "GCC & CPU optimization abilities"
1908 # This is a stripped-down version of the i386 fallback.
1909 if test "$_runtime_cpudetection" = no ; then
1910 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1911 cflag_check -march=native && proc=native
1913 # --- AMD processors ---
1914 if test "$proc" = "amdfam10"; then
1915 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1917 if test "$proc" = "k8"; then
1918 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1920 # This will fail if gcc version < 3.3, which is ok because earlier
1921 # versions don't really support 64-bit on amd64.
1922 # Is this a valid assumption? -Corey
1923 if test "$proc" = "athlon-xp"; then
1924 cflag_check -march=$proc $cpuopt=$proc || proc=error
1926 # --- Intel processors ---
1927 if test "$proc" = "core2"; then
1928 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1930 if test "$proc" = "x86-64"; then
1931 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1933 if test "$proc" = "nocona"; then
1934 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1936 if test "$proc" = "pentium4"; then
1937 cflag_check -march=$proc $cpuopt=$proc || proc=error
1940 _march="-march=$proc"
1941 _mcpu="$cpuopt=$proc"
1942 if test "$proc" = "error" ; then
1943 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1944 _mcpu=""
1945 _march=""
1947 else # if test "$_runtime_cpudetection" = no
1948 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1949 _march="-march=x86-64"
1950 _mcpu="$cpuopt=generic"
1951 cflag_check $_mcpu || _mcpu="x86-64"
1952 cflag_check $_mcpu || _mcpu=""
1953 cflag_check $_march $_mcpu || _march=""
1956 _optimizing="$proc"
1957 test $_fast_cmov = "auto" && _fast_cmov=yes
1958 test $_fast_clz = "auto" && _fast_clz=yes
1960 echores "$proc"
1963 sparc|sparc64)
1964 arch='sparc'
1965 iproc='sparc'
1966 if test "$host_arch" = "sparc64" ; then
1967 _vis='yes'
1968 proc='ultrasparc'
1969 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1970 elif sunos ; then
1971 echocheck "CPU type"
1972 karch=$(uname -m)
1973 case "$(echo $karch)" in
1974 sun4) proc=v7 ;;
1975 sun4c) proc=v7 ;;
1976 sun4d) proc=v8 ;;
1977 sun4m) proc=v8 ;;
1978 sun4u) proc=ultrasparc _vis='yes' ;;
1979 sun4v) proc=v9 ;;
1980 *) proc=v8 ;;
1981 esac
1982 echores "$proc"
1983 else
1984 proc=v8
1986 _mcpu="-mcpu=$proc"
1987 _optimizing="$proc"
1990 arm*)
1991 arch='arm'
1992 iproc='arm'
1995 avr32)
1996 arch='avr32'
1997 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1998 iproc='avr32'
1999 test $_fast_clz = "auto" && _fast_clz=yes
2002 sh|sh4)
2003 arch='sh4'
2004 iproc='sh4'
2007 ppc|ppc64|powerpc|powerpc64)
2008 arch='ppc'
2009 def_dcbzl='#define HAVE_DCBZL 0'
2010 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2011 iproc='ppc'
2013 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2014 subarch='ppc64'
2015 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2017 echocheck "CPU type"
2018 case $system_name in
2019 Linux)
2020 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2021 if test -n "$($_cpuinfo | grep altivec)"; then
2022 test $_altivec = auto && _altivec=yes
2025 Darwin)
2026 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2027 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2028 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2029 test $_altivec = auto && _altivec=yes
2032 NetBSD)
2033 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2034 case $cc_version in
2035 2*|3.0*|3.1*|3.2*|3.3*)
2038 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2039 test $_altivec = auto && _altivec=yes
2042 esac
2044 AIX)
2045 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2047 esac
2048 if test "$_altivec" = yes; then
2049 echores "$proc altivec"
2050 else
2051 _altivec=no
2052 echores "$proc"
2055 echocheck "GCC & CPU optimization abilities"
2057 if test -n "$proc"; then
2058 case "$proc" in
2059 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2060 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2061 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2062 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2063 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2064 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2065 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2066 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2067 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2068 *) ;;
2069 esac
2070 # gcc 3.1(.1) and up supports 7400 and 7450
2071 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2072 case "$proc" in
2073 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2074 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2075 *) ;;
2076 esac
2078 # gcc 3.2 and up supports 970
2079 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2080 case "$proc" in
2081 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2082 def_dcbzl='#define HAVE_DCBZL 1' ;;
2083 *) ;;
2084 esac
2086 # gcc 3.3 and up supports POWER4
2087 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2088 case "$proc" in
2089 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2090 *) ;;
2091 esac
2093 # gcc 3.4 and up supports 440*
2094 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2095 case "$proc" in
2096 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2097 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2098 *) ;;
2099 esac
2101 # gcc 4.0 and up supports POWER5
2102 if test "$_cc_major" -ge "4"; then
2103 case "$proc" in
2104 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2105 *) ;;
2106 esac
2110 if test -n "$_mcpu"; then
2111 _optimizing=$(echo $_mcpu | cut -c 8-)
2112 echores "$_optimizing"
2113 else
2114 echores "none"
2117 test $_fast_clz = "auto" && _fast_clz=yes
2121 alpha*)
2122 arch='alpha'
2123 iproc='alpha'
2124 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2126 echocheck "CPU type"
2127 cat > $TMPC << EOF
2128 int main(void) {
2129 unsigned long ver, mask;
2130 __asm__ ("implver %0" : "=r" (ver));
2131 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2132 printf("%ld-%x\n", ver, ~mask);
2133 return 0;
2136 $_cc -o "$TMPEXE" "$TMPC"
2137 case $("$TMPEXE") in
2139 0-0) proc="ev4"; _mvi="0";;
2140 1-0) proc="ev5"; _mvi="0";;
2141 1-1) proc="ev56"; _mvi="0";;
2142 1-101) proc="pca56"; _mvi="1";;
2143 2-303) proc="ev6"; _mvi="1";;
2144 2-307) proc="ev67"; _mvi="1";;
2145 2-1307) proc="ev68"; _mvi="1";;
2146 esac
2147 echores "$proc"
2149 echocheck "GCC & CPU optimization abilities"
2150 if test "$proc" = "ev68" ; then
2151 cc_check -mcpu=$proc || proc=ev67
2153 if test "$proc" = "ev67" ; then
2154 cc_check -mcpu=$proc || proc=ev6
2156 _mcpu="-mcpu=$proc"
2157 echores "$proc"
2159 test $_fast_clz = "auto" && _fast_clz=yes
2161 _optimizing="$proc"
2164 mips*)
2165 arch='mips'
2166 iproc='mips'
2168 if irix ; then
2169 echocheck "CPU type"
2170 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2171 case "$(echo $proc)" in
2172 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2173 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2174 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2175 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2176 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2177 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2178 esac
2179 # gcc < 3.x does not support -mtune.
2180 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2181 _mcpu=''
2183 echores "$proc"
2186 test $_fast_clz = "auto" && _fast_clz=yes
2190 hppa)
2191 arch='pa_risc'
2192 iproc='PA-RISC'
2195 s390)
2196 arch='s390'
2197 iproc='390'
2200 s390x)
2201 arch='s390x'
2202 iproc='390x'
2205 vax)
2206 arch='vax'
2207 iproc='vax'
2210 xtensa)
2211 arch='xtensa'
2212 iproc='xtensa'
2215 generic)
2216 arch='generic'
2220 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2221 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2222 die "unsupported architecture $host_arch"
2224 esac # case "$host_arch" in
2226 if test "$_runtime_cpudetection" = yes ; then
2227 if x86 ; then
2228 test "$_cmov" != no && _cmov=yes
2229 x86_32 && _cmov=no
2230 test "$_mmx" != no && _mmx=yes
2231 test "$_3dnow" != no && _3dnow=yes
2232 test "$_3dnowext" != no && _3dnowext=yes
2233 test "$_mmxext" != no && _mmxext=yes
2234 test "$_sse" != no && _sse=yes
2235 test "$_sse2" != no && _sse2=yes
2236 test "$_ssse3" != no && _ssse3=yes
2238 if ppc; then
2239 _altivec=yes
2244 # endian testing
2245 echocheck "byte order"
2246 if test "$_big_endian" = auto ; then
2247 cat > $TMPC <<EOF
2248 short ascii_name[] = {
2249 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2250 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2251 int main(void) { return (long)ascii_name; }
2253 if cc_check ; then
2254 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2255 _big_endian=yes
2256 else
2257 _big_endian=no
2259 else
2260 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2263 if test "$_big_endian" = yes ; then
2264 _byte_order='big-endian'
2265 def_words_endian='#define WORDS_BIGENDIAN 1'
2266 def_bigendian='#define HAVE_BIGENDIAN 1'
2267 else
2268 _byte_order='little-endian'
2269 def_words_endian='#undef WORDS_BIGENDIAN'
2270 def_bigendian='#define HAVE_BIGENDIAN 0'
2272 echores "$_byte_order"
2275 echocheck "extern symbol prefix"
2276 cat > $TMPC << EOF
2277 int ff_extern;
2279 cc_check -c || die "Symbol mangling check failed."
2280 sym=$($_nm -P -g $TMPEXE)
2281 extern_prefix=${sym%%ff_extern*}
2282 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2283 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2284 echores $extern_prefix
2287 echocheck "assembler support of -pipe option"
2288 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2289 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2292 if darwin && test "$cc_vendor" = "gnu" ; then
2293 echocheck "GCC support of -mstackrealign"
2294 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2295 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2296 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2297 # wrong code with this flag, but this can be worked around by adding
2298 # -fno-unit-at-a-time as described in the blog post at
2299 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2300 cat > $TMPC << EOF
2301 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2302 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2304 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2305 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2306 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2307 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2308 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2311 # Checking for CFLAGS
2312 _install_strip="-s"
2313 if test "$_profile" != "" || test "$_debug" != "" ; then
2314 _install_strip=
2316 if test -z "$CFLAGS" ; then
2317 if test "$cc_vendor" = "intel" ; then
2318 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2319 WARNFLAGS="-wd167 -wd556 -wd144"
2320 elif test "$cc_vendor" = "sun" ; then
2321 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2322 elif test "$cc_vendor" = "clang"; then
2323 CFLAGS="-O2 $_debug $_profile $_march $_pipe"
2324 WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2325 ERRORFLAGS="-Werror=implicit-function-declaration"
2326 elif test "$cc_vendor" != "gnu" ; then
2327 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2328 else
2329 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2330 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2331 ERRORFLAGS="-Werror-implicit-function-declaration"
2332 extra_ldflags="$extra_ldflags -ffast-math"
2334 else
2335 warn_cflags=yes
2338 if test "$cc_vendor" = "gnu" ; then
2339 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2340 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2341 # that's the only variable specific to C now, and this option is not valid
2342 # for C++.
2343 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2344 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2345 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2346 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2347 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2348 else
2349 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2352 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2353 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2356 if test -n "$LDFLAGS" ; then
2357 extra_ldflags="$extra_ldflags $LDFLAGS"
2358 warn_cflags=yes
2359 elif test "$cc_vendor" = "intel" ; then
2360 extra_ldflags="$extra_ldflags -i-static"
2362 if test -n "$CPPFLAGS" ; then
2363 extra_cflags="$extra_cflags $CPPFLAGS"
2364 warn_cflags=yes
2369 if x86_32 ; then
2370 # Checking assembler (_as) compatibility...
2371 # Added workaround for older as that reads from stdin by default - atmos
2372 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2373 echocheck "assembler ($_as $as_version)"
2375 _pref_as_version='2.9.1'
2376 echo 'nop' > $TMPS
2377 if test "$_mmx" = yes ; then
2378 echo 'emms' >> $TMPS
2380 if test "$_3dnow" = yes ; then
2381 _pref_as_version='2.10.1'
2382 echo 'femms' >> $TMPS
2384 if test "$_3dnowext" = yes ; then
2385 _pref_as_version='2.10.1'
2386 echo 'pswapd %mm0, %mm0' >> $TMPS
2388 if test "$_mmxext" = yes ; then
2389 _pref_as_version='2.10.1'
2390 echo 'movntq %mm0, (%eax)' >> $TMPS
2392 if test "$_sse" = yes ; then
2393 _pref_as_version='2.10.1'
2394 echo 'xorps %xmm0, %xmm0' >> $TMPS
2396 #if test "$_sse2" = yes ; then
2397 # _pref_as_version='2.11'
2398 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2400 if test "$_cmov" = yes ; then
2401 _pref_as_version='2.10.1'
2402 echo 'cmovb %eax, %ebx' >> $TMPS
2404 if test "$_ssse3" = yes ; then
2405 _pref_as_version='2.16.92'
2406 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2408 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2410 if test "$as_verc_fail" != yes ; then
2411 echores "ok"
2412 else
2413 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2414 echores "failed"
2415 die "obsolete binutils version"
2418 fi #if x86_32
2421 echocheck "PIC"
2422 pic=no
2423 cat > $TMPC << EOF
2424 int main(void) {
2425 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2426 #error PIC not enabled
2427 #endif
2428 return 0;
2431 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2432 echores $pic
2435 if x86 ; then
2437 echocheck ".align is a power of two"
2438 if test "$_asmalign_pot" = auto ; then
2439 _asmalign_pot=no
2440 inline_asm_check '".align 3"' && _asmalign_pot=yes
2442 if test "$_asmalign_pot" = "yes" ; then
2443 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2444 else
2445 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2447 echores $_asmalign_pot
2450 echocheck "ebx availability"
2451 ebx_available=no
2452 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2453 cat > $TMPC << EOF
2454 int main(void) {
2455 int x;
2456 __asm__ volatile(
2457 "xor %0, %0"
2458 :"=b"(x)
2459 // just adding ebx to clobber list seems unreliable with some
2460 // compilers, e.g. Haiku's gcc 2.95
2462 // and the above check does not work for OSX 64 bit...
2463 __asm__ volatile("":::"%ebx");
2464 return 0;
2467 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2468 echores $ebx_available
2471 echocheck "yasm"
2472 if test -z "$YASMFLAGS" ; then
2473 if darwin ; then
2474 x86_64 && objformat="macho64" || objformat="macho"
2475 elif win32 ; then
2476 objformat="win32"
2477 else
2478 objformat="elf"
2480 # currently tested for Linux x86, x86_64
2481 YASMFLAGS="-f $objformat"
2482 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2483 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2484 case "$objformat" in
2485 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2486 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2487 esac
2488 else
2489 warn_cflags=yes
2492 echo "pabsw xmm0, xmm0" > $TMPS
2493 yasm_check || _yasm=""
2494 if test $_yasm ; then
2495 def_yasm='#define HAVE_YASM 1'
2496 have_yasm="yes"
2497 echores "$_yasm"
2498 else
2499 def_yasm='#define HAVE_YASM 0'
2500 have_yasm="no"
2501 echores "no"
2504 echocheck "bswap"
2505 def_bswap='#define HAVE_BSWAP 0'
2506 echo 'bswap %eax' > $TMPS
2507 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2508 echores "$bswap"
2509 fi #if x86
2512 #FIXME: This should happen before the check for CFLAGS..
2513 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2514 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2516 # check if AltiVec is supported by the compiler, and how to enable it
2517 echocheck "GCC AltiVec flags"
2518 if $(cflag_check -maltivec -mabi=altivec) ; then
2519 _altivec_gcc_flags="-maltivec -mabi=altivec"
2520 # check if <altivec.h> should be included
2521 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2522 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2523 inc_altivec_h='#include <altivec.h>'
2524 else
2525 if $(cflag_check -faltivec) ; then
2526 _altivec_gcc_flags="-faltivec"
2527 else
2528 _altivec=no
2529 _altivec_gcc_flags="none, AltiVec disabled"
2533 echores "$_altivec_gcc_flags"
2535 # check if the compiler supports braces for vector declarations
2536 cat > $TMPC << EOF
2537 $inc_altivec_h
2538 int main(void) { (vector int) {1}; return 0; }
2540 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2542 # Disable runtime cpudetection if we cannot generate AltiVec code or
2543 # AltiVec is disabled by the user.
2544 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2545 && _runtime_cpudetection=no
2547 # Show that we are optimizing for AltiVec (if enabled and supported).
2548 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2549 && _optimizing="$_optimizing altivec"
2551 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2552 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2555 if ppc ; then
2556 def_xform_asm='#define HAVE_XFORM_ASM 0'
2557 xform_asm=no
2558 echocheck "XFORM ASM support"
2559 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2560 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2561 echores "$xform_asm"
2564 if arm ; then
2565 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2566 if test $_armv5te = "auto" ; then
2567 _armv5te=no
2568 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2570 echores "$_armv5te"
2572 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2574 echocheck "ARMv6 (SIMD instructions)"
2575 if test $_armv6 = "auto" ; then
2576 _armv6=no
2577 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2579 echores "$_armv6"
2581 echocheck "ARMv6t2 (SIMD instructions)"
2582 if test $_armv6t2 = "auto" ; then
2583 _armv6t2=no
2584 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2586 echores "$_armv6t2"
2588 echocheck "ARM VFP"
2589 if test $_armvfp = "auto" ; then
2590 _armvfp=no
2591 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2593 echores "$_armvfp"
2595 echocheck "ARM NEON"
2596 if test $neon = "auto" ; then
2597 neon=no
2598 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2600 echores "$neon"
2602 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2603 if test $_iwmmxt = "auto" ; then
2604 _iwmmxt=no
2605 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2607 echores "$_iwmmxt"
2610 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2611 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2612 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2613 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2614 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2615 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2616 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2617 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2618 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2619 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2620 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2621 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2622 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2623 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2624 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2625 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2626 test "$neon" = yes && cpuexts="NEON $cpuexts"
2627 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2628 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2629 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2631 # Checking kernel version...
2632 if x86_32 && linux ; then
2633 _k_verc_problem=no
2634 kernel_version=$(uname -r 2>&1)
2635 echocheck "$system_name kernel version"
2636 case "$kernel_version" in
2637 '') kernel_version="?.??"; _k_verc_fail=yes;;
2638 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2639 _k_verc_problem=yes;;
2640 esac
2641 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2642 _k_verc_fail=yes
2644 if test "$_k_verc_fail" ; then
2645 echores "$kernel_version, fail"
2646 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2647 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2648 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2649 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2650 echo "2.2.x you must upgrade it to get SSE support!"
2651 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2652 else
2653 echores "$kernel_version, ok"
2657 ######################
2658 # MAIN TESTS GO HERE #
2659 ######################
2662 echocheck "-lposix"
2663 if cflag_check -lposix ; then
2664 extra_ldflags="$extra_ldflags -lposix"
2665 echores "yes"
2666 else
2667 echores "no"
2670 echocheck "-lm"
2671 if cflag_check -lm ; then
2672 _ld_lm="-lm"
2673 echores "yes"
2674 else
2675 _ld_lm=""
2676 echores "no"
2680 echocheck "langinfo"
2681 if test "$_langinfo" = auto ; then
2682 _langinfo=no
2683 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2685 if test "$_langinfo" = yes ; then
2686 def_langinfo='#define HAVE_LANGINFO 1'
2687 else
2688 def_langinfo='#undef HAVE_LANGINFO'
2690 echores "$_langinfo"
2693 echocheck "translation support"
2694 if test "$_translation" = yes; then
2695 def_translation="#define CONFIG_TRANSLATION 1"
2696 else
2697 def_translation="#undef CONFIG_TRANSLATION"
2699 echores "$_translation"
2701 echocheck "language"
2702 # Set preferred languages, "all" uses English as main language.
2703 test -z "$language" && language=$LINGUAS
2704 test -z "$language_doc" && language_doc=$language
2705 test -z "$language_man" && language_man=$language
2706 test -z "$language_msg" && language_msg=$language
2707 test -z "$language_msg" && language_msg="all"
2708 language_doc=$(echo $language_doc | tr , " ")
2709 language_man=$(echo $language_man | tr , " ")
2710 language_msg=$(echo $language_msg | tr , " ")
2712 test "$language_doc" = "all" && language_doc=$doc_lang_all
2713 test "$language_man" = "all" && language_man=$man_lang_all
2714 test "$language_msg" = "all" && language_msg=$msg_lang_all
2716 if test "$_translation" != yes ; then
2717 language_msg=""
2720 # Prune non-existing translations from language lists.
2721 # Set message translation to the first available language.
2722 # Fall back on English.
2723 for lang in $language_doc ; do
2724 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2725 done
2726 language_doc=$tmp_language_doc
2727 test -z "$language_doc" && language_doc=en
2729 for lang in $language_man ; do
2730 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2731 done
2732 language_man=$tmp_language_man
2733 test -z "$language_man" && language_man=en
2735 for lang in $language_msg ; do
2736 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2737 done
2738 language_msg=$tmp_language_msg
2740 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2743 echocheck "enable sighandler"
2744 if test "$_sighandler" = yes ; then
2745 def_sighandler='#define CONFIG_SIGHANDLER 1'
2746 else
2747 def_sighandler='#undef CONFIG_SIGHANDLER'
2749 echores "$_sighandler"
2751 echocheck "runtime cpudetection"
2752 if test "$_runtime_cpudetection" = yes ; then
2753 _optimizing="Runtime CPU-Detection enabled"
2754 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2755 else
2756 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2758 echores "$_runtime_cpudetection"
2761 echocheck "restrict keyword"
2762 for restrict_keyword in restrict __restrict __restrict__ ; do
2763 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2764 if cc_check; then
2765 def_restrict_keyword=$restrict_keyword
2766 break;
2768 done
2769 if [ -n "$def_restrict_keyword" ]; then
2770 echores "$def_restrict_keyword"
2771 else
2772 echores "none"
2774 # Avoid infinite recursion loop ("#define restrict restrict")
2775 if [ "$def_restrict_keyword" != "restrict" ]; then
2776 def_restrict_keyword="#define restrict $def_restrict_keyword"
2777 else
2778 def_restrict_keyword=""
2782 echocheck "__builtin_expect"
2783 # GCC branch prediction hint
2784 cat > $TMPC << EOF
2785 static int foo(int a) {
2786 a = __builtin_expect(a, 10);
2787 return a == 10 ? 0 : 1;
2789 int main(void) { return foo(10) && foo(0); }
2791 _builtin_expect=no
2792 cc_check && _builtin_expect=yes
2793 if test "$_builtin_expect" = yes ; then
2794 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2795 else
2796 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2798 echores "$_builtin_expect"
2801 echocheck "kstat"
2802 _kstat=no
2803 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2804 if test "$_kstat" = yes ; then
2805 def_kstat="#define HAVE_LIBKSTAT 1"
2806 extra_ldflags="$extra_ldflags -lkstat"
2807 else
2808 def_kstat="#undef HAVE_LIBKSTAT"
2810 echores "$_kstat"
2813 echocheck "posix4"
2814 # required for nanosleep on some systems
2815 _posix4=no
2816 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2817 if test "$_posix4" = yes ; then
2818 extra_ldflags="$extra_ldflags -lposix4"
2820 echores "$_posix4"
2822 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2823 echocheck $func
2824 eval _$func=no
2825 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2826 if eval test "x\$_$func" = "xyes"; then
2827 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2828 echores yes
2829 else
2830 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2831 echores no
2833 done
2836 echocheck "mkstemp"
2837 _mkstemp=no
2838 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2839 if test "$_mkstemp" = yes ; then
2840 def_mkstemp='#define HAVE_MKSTEMP 1'
2841 else
2842 def_mkstemp='#define HAVE_MKSTEMP 0'
2844 echores "$_mkstemp"
2847 echocheck "nanosleep"
2848 _nanosleep=no
2849 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2850 if test "$_nanosleep" = yes ; then
2851 def_nanosleep='#define HAVE_NANOSLEEP 1'
2852 else
2853 def_nanosleep='#undef HAVE_NANOSLEEP'
2855 echores "$_nanosleep"
2858 echocheck "socklib"
2859 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2860 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2861 cat > $TMPC << EOF
2862 #include <netdb.h>
2863 #include <sys/socket.h>
2864 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2866 _socklib=no
2867 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2868 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2869 done
2870 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2871 if test $_winsock2_h = auto ; then
2872 _winsock2_h=no
2873 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2875 test "$_ld_sock" && res_comment="using $_ld_sock"
2876 echores "$_socklib"
2879 if test $_winsock2_h = yes ; then
2880 _ld_sock="-lws2_32"
2881 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2882 else
2883 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2887 echocheck "arpa/inet.h"
2888 arpa_inet_h=no
2889 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2890 header_check arpa/inet.h && arpa_inet_h=yes &&
2891 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2892 echores "$arpa_inet_h"
2895 echocheck "inet_pton()"
2896 def_inet_pton='#define HAVE_INET_PTON 0'
2897 inet_pton=no
2898 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2899 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2900 done
2901 if test $inet_pton = yes ; then
2902 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2903 def_inet_pton='#define HAVE_INET_PTON 1'
2905 echores "$inet_pton"
2908 echocheck "inet_aton()"
2909 def_inet_aton='#define HAVE_INET_ATON 0'
2910 inet_aton=no
2911 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2912 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2913 done
2914 if test $inet_aton = yes ; then
2915 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2916 def_inet_aton='#define HAVE_INET_ATON 1'
2918 echores "$inet_aton"
2921 echocheck "socklen_t"
2922 _socklen_t=no
2923 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2924 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2925 done
2926 if test "$_socklen_t" = yes ; then
2927 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2928 else
2929 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2931 echores "$_socklen_t"
2934 echocheck "closesocket()"
2935 _closesocket=no
2936 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2937 if test "$_closesocket" = yes ; then
2938 def_closesocket='#define HAVE_CLOSESOCKET 1'
2939 else
2940 def_closesocket='#define HAVE_CLOSESOCKET 0'
2942 echores "$_closesocket"
2945 echocheck "networking"
2946 test $_winsock2_h = no && test $inet_pton = no &&
2947 test $inet_aton = no && networking=no
2948 if test "$networking" = yes ; then
2949 def_network='#define CONFIG_NETWORK 1'
2950 def_networking='#define CONFIG_NETWORKING 1'
2951 extra_ldflags="$extra_ldflags $_ld_sock"
2952 inputmodules="networking $inputmodules"
2953 else
2954 noinputmodules="networking $noinputmodules"
2955 def_network='#define CONFIG_NETWORK 0'
2956 def_networking='#undef CONFIG_NETWORKING'
2958 echores "$networking"
2961 echocheck "inet6"
2962 if test "$_inet6" = auto ; then
2963 cat > $TMPC << EOF
2964 #include <sys/types.h>
2965 #if !defined(_WIN32)
2966 #include <sys/socket.h>
2967 #include <netinet/in.h>
2968 #else
2969 #include <ws2tcpip.h>
2970 #endif
2971 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2973 _inet6=no
2974 if cc_check $_ld_sock ; then
2975 _inet6=yes
2978 if test "$_inet6" = yes ; then
2979 def_inet6='#define HAVE_AF_INET6 1'
2980 else
2981 def_inet6='#undef HAVE_AF_INET6'
2983 echores "$_inet6"
2986 echocheck "gethostbyname2"
2987 if test "$_gethostbyname2" = auto ; then
2988 cat > $TMPC << EOF
2989 #include <sys/types.h>
2990 #include <sys/socket.h>
2991 #include <netdb.h>
2992 int main(void) { gethostbyname2("", AF_INET); return 0; }
2994 _gethostbyname2=no
2995 if cc_check ; then
2996 _gethostbyname2=yes
2999 if test "$_gethostbyname2" = yes ; then
3000 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3001 else
3002 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3004 echores "$_gethostbyname2"
3007 echocheck "inttypes.h (required)"
3008 _inttypes=no
3009 header_check inttypes.h && _inttypes=yes
3010 echores "$_inttypes"
3012 if test "$_inttypes" = no ; then
3013 echocheck "sys/bitypes.h (inttypes.h predecessor)"
3014 header_check sys/bitypes.h && _inttypes=yes
3015 if test "$_inttypes" = yes ; then
3016 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."
3017 else
3018 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3023 echocheck "malloc.h"
3024 _malloc=no
3025 header_check malloc.h && _malloc=yes
3026 if test "$_malloc" = yes ; then
3027 def_malloc_h='#define HAVE_MALLOC_H 1'
3028 else
3029 def_malloc_h='#define HAVE_MALLOC_H 0'
3031 echores "$_malloc"
3034 echocheck "memalign()"
3035 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3036 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3037 _memalign=no
3038 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3039 if test "$_memalign" = yes ; then
3040 def_memalign='#define HAVE_MEMALIGN 1'
3041 else
3042 def_memalign='#define HAVE_MEMALIGN 0'
3043 def_map_memalign='#define memalign(a, b) malloc(b)'
3044 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3046 echores "$_memalign"
3049 echocheck "posix_memalign()"
3050 posix_memalign=no
3051 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3052 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
3053 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3054 echores "$posix_memalign"
3057 echocheck "alloca.h"
3058 _alloca=no
3059 statement_check alloca.h 'alloca(0)' && _alloca=yes
3060 if cc_check ; then
3061 def_alloca_h='#define HAVE_ALLOCA_H 1'
3062 else
3063 def_alloca_h='#undef HAVE_ALLOCA_H'
3065 echores "$_alloca"
3068 echocheck "fastmemcpy"
3069 if test "$_fastmemcpy" = yes ; then
3070 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3071 else
3072 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3074 echores "$_fastmemcpy"
3077 echocheck "mman.h"
3078 _mman=no
3079 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3080 if test "$_mman" = yes ; then
3081 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3082 else
3083 def_mman_h='#undef HAVE_SYS_MMAN_H'
3085 echores "$_mman"
3087 _mman_has_map_failed=no
3088 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
3089 if test "$_mman_has_map_failed" = yes ; then
3090 def_mman_has_map_failed=''
3091 else
3092 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3095 echocheck "dynamic loader"
3096 _dl=no
3097 for _ld_tmp in "" "-ldl"; do
3098 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3099 done
3100 if test "$_dl" = yes ; then
3101 def_dl='#define HAVE_LIBDL 1'
3102 else
3103 def_dl='#undef HAVE_LIBDL'
3105 echores "$_dl"
3108 def_threads='#define HAVE_THREADS 0'
3110 echocheck "pthread"
3111 if linux ; then
3112 THREAD_CFLAGS=-D_REENTRANT
3113 elif freebsd || netbsd || openbsd || bsdos ; then
3114 THREAD_CFLAGS=-D_THREAD_SAFE
3116 if test "$_pthreads" = auto ; then
3117 cat > $TMPC << EOF
3118 #include <pthread.h>
3119 static void *func(void *arg) { return arg; }
3120 int main(void) {
3121 pthread_t tid;
3122 #ifdef PTW32_STATIC_LIB
3123 pthread_win32_process_attach_np();
3124 pthread_win32_thread_attach_np();
3125 #endif
3126 return pthread_create (&tid, 0, func, 0) != 0;
3129 _pthreads=no
3130 if ! hpux ; then
3131 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3132 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3133 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3134 done
3135 if test "$_pthreads" = no && mingw32 ; then
3136 _ld_tmp="-lpthreadGC2 -lws2_32"
3137 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
3141 if test "$_pthreads" = yes ; then
3142 test $_ld_pthread && res_comment="using $_ld_pthread"
3143 def_pthreads='#define HAVE_PTHREADS 1'
3144 def_threads='#define HAVE_THREADS 1'
3145 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3146 else
3147 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3148 def_pthreads='#undef HAVE_PTHREADS'
3149 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3150 mingw32 || _win32dll=no
3152 echores "$_pthreads"
3154 if cygwin ; then
3155 if test "$_pthreads" = yes ; then
3156 def_pthread_cache="#define PTHREAD_CACHE 1"
3157 else
3158 _stream_cache=no
3159 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3163 echocheck "w32threads"
3164 if test "$_pthreads" = yes ; then
3165 res_comment="using pthread instead"
3166 _w32threads=no
3168 if test "$_w32threads" = auto ; then
3169 _w32threads=no
3170 mingw32 && _w32threads=yes
3172 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3173 echores "$_w32threads"
3175 echocheck "rpath"
3176 if test "$_rpath" = yes ; then
3177 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3178 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3179 done
3180 extra_ldflags=$tmp
3182 echores "$_rpath"
3184 echocheck "iconv"
3185 if test "$_iconv" = auto ; then
3186 cat > $TMPC << EOF
3187 #include <stdio.h>
3188 #include <unistd.h>
3189 #include <iconv.h>
3190 #define INBUFSIZE 1024
3191 #define OUTBUFSIZE 4096
3193 char inbuffer[INBUFSIZE];
3194 char outbuffer[OUTBUFSIZE];
3196 int main(void) {
3197 size_t numread;
3198 iconv_t icdsc;
3199 char *tocode="UTF-8";
3200 char *fromcode="cp1250";
3201 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3202 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3203 char *iptr=inbuffer;
3204 char *optr=outbuffer;
3205 size_t inleft=numread;
3206 size_t outleft=OUTBUFSIZE;
3207 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3208 != (size_t)(-1)) {
3209 write(1, outbuffer, OUTBUFSIZE - outleft);
3212 if (iconv_close(icdsc) == -1)
3215 return 0;
3218 _iconv=no
3219 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3220 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3221 _iconv=yes && break
3222 done
3223 if test "$_iconv" != yes ; then
3224 die "Unable to find iconv which should be part of standard compilation environment. Aborting. If you really mean to compile without iconv support use --disable-iconv."
3227 if test "$_iconv" = yes ; then
3228 def_iconv='#define CONFIG_ICONV 1'
3229 else
3230 def_iconv='#undef CONFIG_ICONV'
3232 echores "$_iconv"
3235 echocheck "soundcard.h"
3236 _soundcard_h=no
3237 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3238 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3239 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3240 header_check $_soundcard_header && _soundcard_h=yes &&
3241 res_comment="$_soundcard_header" && break
3242 done
3244 if test "$_soundcard_h" = yes ; then
3245 if test $_soundcard_header = "sys/soundcard.h"; then
3246 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3247 else
3248 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3251 echores "$_soundcard_h"
3254 echocheck "sys/videoio.h"
3255 sys_videoio_h=no
3256 def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
3257 header_check sys/videoio.h && sys_videoio_h=yes &&
3258 def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
3259 echores "$sys_videoio_h"
3262 echocheck "sys/dvdio.h"
3263 _dvdio=no
3264 # FreeBSD 8.1 has broken dvdio.h
3265 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3266 if test "$_dvdio" = yes ; then
3267 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3268 else
3269 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3271 echores "$_dvdio"
3274 echocheck "sys/cdio.h"
3275 _cdio=no
3276 # at least OpenSolaris has a broken cdio.h
3277 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3278 if test "$_cdio" = yes ; then
3279 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3280 else
3281 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3283 echores "$_cdio"
3286 echocheck "linux/cdrom.h"
3287 _cdrom=no
3288 header_check linux/cdrom.h && _cdrom=yes
3289 if test "$_cdrom" = yes ; then
3290 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3291 else
3292 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3294 echores "$_cdrom"
3297 echocheck "dvd.h"
3298 _dvd=no
3299 header_check dvd.h && _dvd=yes
3300 if test "$_dvd" = yes ; then
3301 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3302 else
3303 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3305 echores "$_dvd"
3308 if bsdos; then
3309 echocheck "BSDI dvd.h"
3310 _bsdi_dvd=no
3311 header_check dvd.h && _bsdi_dvd=yes
3312 if test "$_bsdi_dvd" = yes ; then
3313 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3314 else
3315 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3317 echores "$_bsdi_dvd"
3318 fi #if bsdos
3321 if hpux; then
3322 # also used by AIX, but AIX does not support VCD and/or libdvdread
3323 echocheck "HP-UX SCSI header"
3324 _hpux_scsi_h=no
3325 header_check sys/scsi.h && _hpux_scsi_h=yes
3326 if test "$_hpux_scsi_h" = yes ; then
3327 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3328 else
3329 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3331 echores "$_hpux_scsi_h"
3332 fi #if hpux
3335 if sunos; then
3336 echocheck "userspace SCSI headers (Solaris)"
3337 _sol_scsi_h=no
3338 header_check sys/scsi/scsi_types.h &&
3339 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3340 _sol_scsi_h=yes
3341 if test "$_sol_scsi_h" = yes ; then
3342 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3343 else
3344 def_sol_scsi_h='#undef SOLARIS_USCSI'
3346 echores "$_sol_scsi_h"
3347 fi #if sunos
3350 echocheck "termcap"
3351 if test "$_termcap" = auto ; then
3352 _termcap=no
3353 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3354 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3355 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3356 done
3358 if test "$_termcap" = yes ; then
3359 def_termcap='#define HAVE_TERMCAP 1'
3360 test $_ld_tmp && res_comment="using $_ld_tmp"
3361 else
3362 def_termcap='#undef HAVE_TERMCAP'
3364 echores "$_termcap"
3367 echocheck "termios"
3368 def_termios='#undef HAVE_TERMIOS'
3369 def_termios_h='#undef HAVE_TERMIOS_H'
3370 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3371 if test "$_termios" = auto ; then
3372 _termios=no
3373 for _termios_header in "termios.h" "sys/termios.h"; do
3374 header_check $_termios_header && _termios=yes &&
3375 res_comment="using $_termios_header" && break
3376 done
3379 if test "$_termios" = yes ; then
3380 def_termios='#define HAVE_TERMIOS 1'
3381 if test "$_termios_header" = "termios.h" ; then
3382 def_termios_h='#define HAVE_TERMIOS_H 1'
3383 else
3384 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3387 echores "$_termios"
3390 echocheck "shm"
3391 if test "$_shm" = auto ; then
3392 _shm=no
3393 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3395 if test "$_shm" = yes ; then
3396 def_shm='#define HAVE_SHM 1'
3397 else
3398 def_shm='#undef HAVE_SHM'
3400 echores "$_shm"
3403 echocheck "strsep()"
3404 _strsep=no
3405 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3406 if test "$_strsep" = yes ; then
3407 def_strsep='#define HAVE_STRSEP 1'
3408 need_strsep=no
3409 else
3410 def_strsep='#undef HAVE_STRSEP'
3411 need_strsep=yes
3413 echores "$_strsep"
3416 echocheck "vsscanf()"
3417 cat > $TMPC << EOF
3418 #define _ISOC99_SOURCE
3419 #include <stdarg.h>
3420 #include <stdio.h>
3421 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3423 _vsscanf=no
3424 cc_check && _vsscanf=yes
3425 if test "$_vsscanf" = yes ; then
3426 def_vsscanf='#define HAVE_VSSCANF 1'
3427 need_vsscanf=no
3428 else
3429 def_vsscanf='#undef HAVE_VSSCANF'
3430 need_vsscanf=yes
3432 echores "$_vsscanf"
3435 echocheck "swab()"
3436 _swab=no
3437 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3438 statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3439 if test "$_swab" = yes ; then
3440 def_swab='#define HAVE_SWAB 1'
3441 need_swab=no
3442 else
3443 def_swab='#undef HAVE_SWAB'
3444 need_swab=yes
3446 echores "$_swab"
3448 echocheck "POSIX select()"
3449 cat > $TMPC << EOF
3450 #include <stdio.h>
3451 #include <stdlib.h>
3452 #include <sys/types.h>
3453 #include <string.h>
3454 #include <sys/time.h>
3455 #include <unistd.h>
3456 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3458 _posix_select=no
3459 def_posix_select='#undef HAVE_POSIX_SELECT'
3460 cc_check && _posix_select=yes &&
3461 def_posix_select='#define HAVE_POSIX_SELECT 1'
3462 echores "$_posix_select"
3465 echocheck "audio select()"
3466 if test "$_select" = no ; then
3467 def_select='#undef HAVE_AUDIO_SELECT'
3468 elif test "$_select" = yes ; then
3469 def_select='#define HAVE_AUDIO_SELECT 1'
3471 echores "$_select"
3474 echocheck "gettimeofday()"
3475 _gettimeofday=no
3476 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3477 if test "$_gettimeofday" = yes ; then
3478 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3479 need_gettimeofday=no
3480 else
3481 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3482 need_gettimeofday=yes
3484 echores "$_gettimeofday"
3487 echocheck "glob()"
3488 _glob=no
3489 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3490 need_glob=no
3491 if test "$_glob" = yes ; then
3492 def_glob='#define HAVE_GLOB 1'
3493 else
3494 def_glob='#undef HAVE_GLOB'
3495 # HACK! need_glob currently enables compilation of a
3496 # win32-specific glob()-replacement.
3497 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3498 win32 && need_glob=yes
3500 echores "$_glob"
3503 echocheck "setenv()"
3504 _setenv=no
3505 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3506 if test "$_setenv" = yes ; then
3507 def_setenv='#define HAVE_SETENV 1'
3508 need_setenv=no
3509 else
3510 def_setenv='#undef HAVE_SETENV'
3511 need_setenv=yes
3513 echores "$_setenv"
3516 echocheck "setmode()"
3517 _setmode=no
3518 def_setmode='#define HAVE_SETMODE 0'
3519 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3520 echores "$_setmode"
3523 if sunos; then
3524 echocheck "sysi86()"
3525 _sysi86=no
3526 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3527 if test "$_sysi86" = yes ; then
3528 def_sysi86='#define HAVE_SYSI86 1'
3529 statement_check sys/sysi86.h 'int sysi86(int, void*); sysi86(0)' && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3530 else
3531 def_sysi86='#undef HAVE_SYSI86'
3533 echores "$_sysi86"
3534 fi #if sunos
3537 echocheck "sys/sysinfo.h"
3538 _sys_sysinfo=no
3539 statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
3540 if test "$_sys_sysinfo" = yes ; then
3541 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3542 else
3543 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3545 echores "$_sys_sysinfo"
3548 if darwin; then
3550 echocheck "Mac OS X Finder Support"
3551 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3552 if test "$_macosx_finder" = yes ; then
3553 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3554 extra_ldflags="$extra_ldflags -framework Cocoa"
3556 echores "$_macosx_finder"
3558 echocheck "Mac OS X Bundle file locations"
3559 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3560 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3561 if test "$_macosx_bundle" = yes ; then
3562 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3564 echores "$_macosx_bundle"
3566 echocheck "Apple Remote"
3567 if test "$_apple_remote" = auto ; then
3568 _apple_remote=no
3569 cat > $TMPC <<EOF
3570 #include <stdio.h>
3571 #include <IOKit/IOCFPlugIn.h>
3572 int main(void) {
3573 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3574 CFMutableDictionaryRef hidMatchDictionary;
3575 IOReturn ioReturnValue;
3577 // Set up a matching dictionary to search the I/O Registry by class.
3578 // name for all HID class devices
3579 hidMatchDictionary = IOServiceMatching("AppleIRController");
3581 // Now search I/O Registry for matching devices.
3582 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3583 hidMatchDictionary, &hidObjectIterator);
3585 // If search is unsuccessful, return nonzero.
3586 if (ioReturnValue != kIOReturnSuccess ||
3587 !IOIteratorIsValid(hidObjectIterator)) {
3588 return 1;
3590 return 0;
3593 cc_check -framework IOKit && _apple_remote=yes
3595 if test "$_apple_remote" = yes ; then
3596 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3597 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3598 else
3599 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3601 echores "$_apple_remote"
3603 fi #if darwin
3605 if linux; then
3607 echocheck "Apple IR"
3608 if test "$_apple_ir" = auto ; then
3609 _apple_ir=no
3610 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3612 if test "$_apple_ir" = yes ; then
3613 def_apple_ir='#define CONFIG_APPLE_IR 1'
3614 else
3615 def_apple_ir='#undef CONFIG_APPLE_IR'
3617 echores "$_apple_ir"
3618 fi #if linux
3620 echocheck "pkg-config"
3621 if $($_pkg_config --version > /dev/null 2>&1); then
3622 if test "$_ld_static"; then
3623 _pkg_config="$_pkg_config --static"
3625 echores "yes"
3626 else
3627 _pkg_config=false
3628 echores "no"
3632 echocheck "Samba support (libsmbclient)"
3633 if test "$_smb" = yes; then
3634 extra_ldflags="$extra_ldflags -lsmbclient"
3636 if test "$_smb" = auto; then
3637 _smb=no
3638 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3639 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3640 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3641 done
3644 if test "$_smb" = yes; then
3645 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3646 inputmodules="smb $inputmodules"
3647 else
3648 def_smb="#undef CONFIG_LIBSMBCLIENT"
3649 noinputmodules="smb $noinputmodules"
3651 echores "$_smb"
3654 #########
3655 # VIDEO #
3656 #########
3659 echocheck "tdfxfb"
3660 if test "$_tdfxfb" = yes ; then
3661 def_tdfxfb='#define CONFIG_TDFXFB 1'
3662 vomodules="tdfxfb $vomodules"
3663 else
3664 def_tdfxfb='#undef CONFIG_TDFXFB'
3665 novomodules="tdfxfb $novomodules"
3667 echores "$_tdfxfb"
3669 echocheck "s3fb"
3670 if test "$_s3fb" = yes ; then
3671 def_s3fb='#define CONFIG_S3FB 1'
3672 vomodules="s3fb $vomodules"
3673 else
3674 def_s3fb='#undef CONFIG_S3FB'
3675 novomodules="s3fb $novomodules"
3677 echores "$_s3fb"
3679 echocheck "wii"
3680 if test "$_wii" = yes ; then
3681 def_wii='#define CONFIG_WII 1'
3682 vomodules="wii $vomodules"
3683 else
3684 def_wii='#undef CONFIG_WII'
3685 novomodules="wii $novomodules"
3687 echores "$_wii"
3689 echocheck "tdfxvid"
3690 if test "$_tdfxvid" = yes ; then
3691 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3692 vomodules="tdfx_vid $vomodules"
3693 else
3694 def_tdfxvid='#undef CONFIG_TDFX_VID'
3695 novomodules="tdfx_vid $novomodules"
3697 echores "$_tdfxvid"
3699 echocheck "xvr100"
3700 if test "$_xvr100" = auto ; then
3701 cat > $TMPC << EOF
3702 #include <unistd.h>
3703 #include <sys/fbio.h>
3704 #include <sys/visual_io.h>
3705 int main(void) {
3706 struct vis_identifier ident;
3707 struct fbgattr attr;
3708 ioctl(0, VIS_GETIDENTIFIER, &ident);
3709 ioctl(0, FBIOGATTR, &attr);
3710 return 0;
3713 _xvr100=no
3714 cc_check && _xvr100=yes
3716 if test "$_xvr100" = yes ; then
3717 def_xvr100='#define CONFIG_XVR100 1'
3718 vomodules="xvr100 $vomodules"
3719 else
3720 def_tdfxvid='#undef CONFIG_XVR100'
3721 novomodules="xvr100 $novomodules"
3723 echores "$_xvr100"
3725 echocheck "tga"
3726 if test "$_tga" = yes ; then
3727 def_tga='#define CONFIG_TGA 1'
3728 vomodules="tga $vomodules"
3729 else
3730 def_tga='#undef CONFIG_TGA'
3731 novomodules="tga $novomodules"
3733 echores "$_tga"
3736 echocheck "md5sum support"
3737 if test "$_md5sum" = yes; then
3738 def_md5sum="#define CONFIG_MD5SUM 1"
3739 vomodules="md5sum $vomodules"
3740 else
3741 def_md5sum="#undef CONFIG_MD5SUM"
3742 novomodules="md5sum $novomodules"
3744 echores "$_md5sum"
3747 echocheck "yuv4mpeg support"
3748 if test "$_yuv4mpeg" = yes; then
3749 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3750 vomodules="yuv4mpeg $vomodules"
3751 else
3752 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3753 novomodules="yuv4mpeg $novomodules"
3755 echores "$_yuv4mpeg"
3758 echocheck "bl"
3759 if test "$_bl" = yes ; then
3760 def_bl='#define CONFIG_BL 1'
3761 vomodules="bl $vomodules"
3762 else
3763 def_bl='#undef CONFIG_BL'
3764 novomodules="bl $novomodules"
3766 echores "$_bl"
3769 echocheck "DirectFB"
3770 if test "$_directfb" = auto ; then
3771 _directfb=no
3772 cat > $TMPC << EOF
3773 #include <directfb.h>
3774 #include <directfb_version.h>
3775 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3776 #error "DirectFB version too old."
3777 #endif
3778 int main(void) { DirectFBInit(0, 0); return 0; }
3780 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3781 cc_check $_inc_tmp -ldirectfb &&
3782 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3783 done
3785 if test "$_directfb" = yes ; then
3786 def_directfb='#define CONFIG_DIRECTFB 1'
3787 vomodules="directfb dfbmga $vomodules"
3788 libs_mplayer="$libs_mplayer -ldirectfb"
3789 else
3790 def_directfb='#undef CONFIG_DIRECTFB'
3791 novomodules="directfb dfbmga $novomodules"
3793 echores "$_directfb"
3796 if darwin; then
3798 echocheck "QuickTime"
3799 if test "$quicktime" = auto ; then
3800 quicktime=no
3801 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
3803 if test "$quicktime" = yes ; then
3804 extra_ldflags="$extra_ldflags -framework QuickTime"
3805 def_quicktime='#define CONFIG_QUICKTIME 1'
3806 else
3807 def_quicktime='#undef CONFIG_QUICKTIME'
3809 echores $quicktime
3811 echocheck "Cocoa"
3812 if test "$_cocoa" = auto ; then
3813 cat > $TMPC <<EOF
3814 #include <CoreServices/CoreServices.h>
3815 #include <OpenGL/OpenGL.h>
3816 int main(void) {
3817 NSApplicationLoad();
3820 _cocoa=no
3821 cc_check -framework Cocoa -framework OpenGL && _cocoa=yes
3823 if test "$_cocoa" = yes ; then
3824 libs_mplayer="$libs_mplayer -framework Cocoa -framework OpenGL"
3825 def_cocoa='#define CONFIG_COCOA 1'
3826 else
3827 def_cocoa='#undef CONFIG_COCOA'
3829 echores "$_cocoa"
3831 echocheck "CoreVideo"
3832 if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
3833 cat > $TMPC <<EOF
3834 #include <QuartzCore/CoreVideo.h>
3835 int main(void) { return 0; }
3837 _corevideo=no
3838 cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
3840 if test "$_corevideo" = yes ; then
3841 vomodules="corevideo $vomodules"
3842 libs_mplayer="$libs_mplayer -framework QuartzCore"
3843 def_corevideo='#define CONFIG_COREVIDEO 1'
3844 else
3845 novomodules="corevideo $novomodules"
3846 def_corevideo='#undef CONFIG_COREVIDEO'
3848 echores "$_corevideo"
3850 echocheck "SharedBuffer"
3851 if test "$_sharedbuffer" = auto ; then
3852 cat > $TMPC <<EOF
3853 int main(void) {
3854 NSApplicationLoad();
3857 _sharedbuffer=no
3858 cc_check -framework Cocoa && _sharedbuffer=yes
3860 if test "$_sharedbuffer" = yes ; then
3861 vomodules="sharedbuffer $vomodules"
3862 libs_mplayer="$libs_mplayer -framework Cocoa"
3863 def_sharedbuffer='#define CONFIG_SHAREDBUFFER 1'
3864 else
3865 novomodules="sharedbuffer $novomodules"
3866 def_sharedbuffer='#undef CONFIG_SHAREDBUFFER'
3868 echores "$_sharedbuffer"
3870 depends_on_application_services(){
3871 test "$_corevideo" = yes
3874 fi #if darwin
3877 echocheck "X11 headers presence"
3878 _x11_headers="no"
3879 res_comment="check if the dev(el) packages are installed"
3880 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3881 if test -f "$I/X11/Xlib.h" ; then
3882 _x11_headers="yes"
3883 res_comment=""
3884 break
3886 done
3887 if test $_cross_compile = no; then
3888 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3889 /usr/include/X11R6 /usr/openwin/include ; do
3890 if test -f "$I/X11/Xlib.h" ; then
3891 extra_cflags="$extra_cflags -I$I"
3892 _x11_headers="yes"
3893 res_comment="using $I"
3894 break
3896 done
3898 echores "$_x11_headers"
3901 echocheck "X11"
3902 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3903 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3904 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3905 -L/usr/lib ; do
3906 if netbsd; then
3907 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3908 else
3909 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3911 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3912 _x11=yes
3913 # Check that there aren't conflicting headers between ApplicationServices
3914 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3915 # is included by -framework ApplicationServices and clashes with the X11
3916 # definition of the "Cursor" type.
3917 if darwin && depends_on_application_services && test "$_x11" = yes ; then
3918 _x11=no
3919 header_check_broken ApplicationServices/ApplicationServices.h \
3920 X11/Xutil.h $_ld_tmp && _x11=yes
3922 if test "$_x11" = yes ; then
3923 libs_mplayer="$libs_mplayer $_ld_tmp"
3924 break
3926 done
3928 if test "$_x11" = yes ; then
3929 def_x11='#define CONFIG_X11 1'
3930 vomodules="x11 xover $vomodules"
3931 else
3932 _x11=no
3933 def_x11='#undef CONFIG_X11'
3934 novomodules="x11 $novomodules"
3935 res_comment="check if the dev(el) packages are installed"
3937 echores "$_x11"
3939 echocheck "Xss screensaver extensions"
3940 if test "$_xss" = auto ; then
3941 _xss=no
3942 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3944 if test "$_xss" = yes ; then
3945 def_xss='#define CONFIG_XSS 1'
3946 libs_mplayer="$libs_mplayer -lXss"
3947 else
3948 def_xss='#undef CONFIG_XSS'
3950 echores "$_xss"
3952 echocheck "DPMS"
3953 _xdpms3=no
3954 _xdpms4=no
3955 if test "$_x11" = yes ; then
3956 cat > $TMPC <<EOF
3957 #include <X11/Xmd.h>
3958 #include <X11/Xlib.h>
3959 #include <X11/Xutil.h>
3960 #include <X11/Xatom.h>
3961 #include <X11/extensions/dpms.h>
3962 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3964 cc_check -lXdpms && _xdpms3=yes
3965 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3967 if test "$_xdpms4" = yes ; then
3968 def_xdpms='#define CONFIG_XDPMS 1'
3969 res_comment="using Xdpms 4"
3970 echores "yes"
3971 elif test "$_xdpms3" = yes ; then
3972 def_xdpms='#define CONFIG_XDPMS 1'
3973 libs_mplayer="$libs_mplayer -lXdpms"
3974 res_comment="using Xdpms 3"
3975 echores "yes"
3976 else
3977 def_xdpms='#undef CONFIG_XDPMS'
3978 echores "no"
3982 echocheck "Xv"
3983 if test "$_xv" = auto && test "$_x11" = yes ; then
3984 _xv=no
3985 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3988 if test "$_xv" = yes ; then
3989 def_xv='#define CONFIG_XV 1'
3990 libs_mplayer="$libs_mplayer -lXv"
3991 vomodules="xv $vomodules"
3992 else
3993 def_xv='#undef CONFIG_XV'
3994 novomodules="xv $novomodules"
3996 echores "$_xv"
3999 echocheck "VDPAU"
4000 if test "$_vdpau" = auto && test "$_x11" = yes ; then
4001 _vdpau=no
4002 if test "$_dl" = yes ; then
4003 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
4006 if test "$_vdpau" = yes ; then
4007 def_vdpau='#define CONFIG_VDPAU 1'
4008 libs_mplayer="$libs_mplayer -lvdpau"
4009 vomodules="vdpau $vomodules"
4010 else
4011 def_vdpau='#define CONFIG_VDPAU 0'
4012 novomodules="vdpau $novomodules"
4014 echores "$_vdpau"
4017 echocheck "Xinerama"
4018 if test "$_xinerama" = auto && test "$_x11" = yes ; then
4019 _xinerama=no
4020 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
4023 if test "$_xinerama" = yes ; then
4024 def_xinerama='#define CONFIG_XINERAMA 1'
4025 libs_mplayer="$libs_mplayer -lXinerama"
4026 else
4027 def_xinerama='#undef CONFIG_XINERAMA'
4029 echores "$_xinerama"
4032 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4033 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4034 # named 'X extensions' or something similar.
4035 # This check may be useful for future mplayer versions (to change resolution)
4036 # If you run into problems, remove '-lXxf86vm'.
4037 echocheck "Xxf86vm"
4038 if test "$_vm" = auto && test "$_x11" = yes ; then
4039 _vm=no
4040 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
4042 if test "$_vm" = yes ; then
4043 def_vm='#define CONFIG_XF86VM 1'
4044 libs_mplayer="$libs_mplayer -lXxf86vm"
4045 else
4046 def_vm='#undef CONFIG_XF86VM'
4048 echores "$_vm"
4050 # Check for the presence of special keycodes, like audio control buttons
4051 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4052 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4053 # have these new keycodes.
4054 echocheck "XF86keysym"
4055 if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
4056 _xf86keysym=no
4057 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
4059 if test "$_xf86keysym" = yes ; then
4060 def_xf86keysym='#define CONFIG_XF86XK 1'
4061 else
4062 def_xf86keysym='#undef CONFIG_XF86XK'
4064 echores "$_xf86keysym"
4066 echocheck "DGA"
4067 if test "$_dga2" = auto && test "$_x11" = yes ; then
4068 _dga2=no
4069 statement_check_broken X11/Xlib.h X11/extensions/Xxf86dga.h 'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2=yes
4071 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4072 _dga1=no
4073 statement_check_broken X11/Xlib.h X11/extensions/Xxf86dga.h 'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1=yes
4076 _dga=no
4077 def_dga='#undef CONFIG_DGA'
4078 def_dga1='#undef CONFIG_DGA1'
4079 def_dga2='#undef CONFIG_DGA2'
4080 if test "$_dga1" = yes ; then
4081 _dga=yes
4082 def_dga1='#define CONFIG_DGA1 1'
4083 res_comment="using DGA 1.0"
4084 elif test "$_dga2" = yes ; then
4085 _dga=yes
4086 def_dga2='#define CONFIG_DGA2 1'
4087 res_comment="using DGA 2.0"
4089 if test "$_dga" = yes ; then
4090 def_dga='#define CONFIG_DGA 1'
4091 libs_mplayer="$libs_mplayer -lXxf86dga"
4092 vomodules="dga $vomodules"
4093 else
4094 novomodules="dga $novomodules"
4096 echores "$_dga"
4099 echocheck "3dfx"
4100 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4101 def_3dfx='#define CONFIG_3DFX 1'
4102 vomodules="3dfx $vomodules"
4103 else
4104 _3dfx=no
4105 def_3dfx='#undef CONFIG_3DFX'
4106 novomodules="3dfx $novomodules"
4108 echores "$_3dfx"
4111 echocheck "GGI"
4112 if test "$_ggi" = auto ; then
4113 _ggi=no
4114 statement_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4116 if test "$_ggi" = yes ; then
4117 def_ggi='#define CONFIG_GGI 1'
4118 libs_mplayer="$libs_mplayer -lggi"
4119 vomodules="ggi $vomodules"
4120 else
4121 def_ggi='#undef CONFIG_GGI'
4122 novomodules="ggi $novomodules"
4124 echores "$_ggi"
4126 echocheck "GGI extension: libggiwmh"
4127 if test "$_ggiwmh" = auto ; then
4128 _ggiwmh=no
4129 statement_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4131 # needed to get right output on obscure combination
4132 # like --disable-ggi --enable-ggiwmh
4133 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4134 def_ggiwmh='#define CONFIG_GGIWMH 1'
4135 libs_mplayer="$libs_mplayer -lggiwmh"
4136 else
4137 _ggiwmh=no
4138 def_ggiwmh='#undef CONFIG_GGIWMH'
4140 echores "$_ggiwmh"
4143 echocheck "AA"
4144 if test "$_aa" = auto ; then
4145 cat > $TMPC << EOF
4146 #include <aalib.h>
4147 int main(void) {
4148 aa_context *c;
4149 aa_renderparams *p;
4150 aa_init(0, 0, 0);
4151 c = aa_autoinit(&aa_defparams);
4152 p = aa_getrenderparams();
4153 aa_autoinitkbd(c, 0);
4154 return 0; }
4156 _aa=no
4157 for _ld_tmp in "-laa" ; do
4158 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4159 done
4161 if test "$_aa" = yes ; then
4162 def_aa='#define CONFIG_AA 1'
4163 if cygwin ; then
4164 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4166 vomodules="aa $vomodules"
4167 else
4168 def_aa='#undef CONFIG_AA'
4169 novomodules="aa $novomodules"
4171 echores "$_aa"
4174 echocheck "CACA"
4175 if test "$_caca" = auto ; then
4176 _caca=no
4177 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4178 cat > $TMPC << EOF
4179 #include <caca.h>
4180 #ifdef CACA_API_VERSION_1
4181 #include <caca0.h>
4182 #endif
4183 int main(void) { caca_init(); return 0; }
4185 cc_check $(caca-config --libs) && _caca=yes
4188 if test "$_caca" = yes ; then
4189 def_caca='#define CONFIG_CACA 1'
4190 extra_cflags="$extra_cflags $(caca-config --cflags)"
4191 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4192 vomodules="caca $vomodules"
4193 else
4194 def_caca='#undef CONFIG_CACA'
4195 novomodules="caca $novomodules"
4197 echores "$_caca"
4200 echocheck "SVGAlib"
4201 if test "$_svga" = auto ; then
4202 _svga=no
4203 header_check vga.h -lvga $_ld_lm && _svga=yes
4205 if test "$_svga" = yes ; then
4206 def_svga='#define CONFIG_SVGALIB 1'
4207 libs_mplayer="$libs_mplayer -lvga"
4208 vomodules="svga $vomodules"
4209 else
4210 def_svga='#undef CONFIG_SVGALIB'
4211 novomodules="svga $novomodules"
4213 echores "$_svga"
4216 echocheck "FBDev"
4217 if test "$_fbdev" = auto ; then
4218 _fbdev=no
4219 linux && _fbdev=yes
4221 if test "$_fbdev" = yes ; then
4222 def_fbdev='#define CONFIG_FBDEV 1'
4223 vomodules="fbdev $vomodules"
4224 else
4225 def_fbdev='#undef CONFIG_FBDEV'
4226 novomodules="fbdev $novomodules"
4228 echores "$_fbdev"
4232 echocheck "DVB"
4233 if test "$_dvb" = auto ; then
4234 _dvb=no
4235 cat >$TMPC << EOF
4236 #include <poll.h>
4237 #include <sys/ioctl.h>
4238 #include <stdio.h>
4239 #include <time.h>
4240 #include <unistd.h>
4241 #include <linux/dvb/dmx.h>
4242 #include <linux/dvb/frontend.h>
4243 #include <linux/dvb/video.h>
4244 #include <linux/dvb/audio.h>
4245 int main(void) {return 0;}
4247 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4248 cc_check $_inc_tmp && _dvb=yes &&
4249 extra_cflags="$extra_cflags $_inc_tmp" && break
4250 done
4252 echores "$_dvb"
4253 if test "$_dvb" = yes ; then
4254 _dvbin=yes
4255 inputmodules="dvb $inputmodules"
4256 def_dvb='#define CONFIG_DVB 1'
4257 def_dvbin='#define CONFIG_DVBIN 1'
4258 aomodules="mpegpes(dvb) $aomodules"
4259 vomodules="mpegpes(dvb) $vomodules"
4260 else
4261 _dvbin=no
4262 noinputmodules="dvb $noinputmodules"
4263 def_dvb='#undef CONFIG_DVB'
4264 def_dvbin='#undef CONFIG_DVBIN '
4265 aomodules="mpegpes(file) $aomodules"
4266 vomodules="mpegpes(file) $vomodules"
4270 echocheck "PNG support"
4271 if test "$_png" = auto ; then
4272 _png=no
4273 if irix ; then
4274 # Don't check for -lpng on irix since it has its own libpng
4275 # incompatible with the GNU libpng
4276 res_comment="disabled on irix (not GNU libpng)"
4277 else
4278 cat > $TMPC << EOF
4279 #include <stdio.h>
4280 #include <string.h>
4281 #include <png.h>
4282 int main(void) {
4283 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4284 printf("libpng: %s\n", png_libpng_ver);
4285 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4288 cc_check -lpng -lz $_ld_lm && _png=yes
4291 echores "$_png"
4292 if test "$_png" = yes ; then
4293 def_png='#define CONFIG_PNG 1'
4294 extra_ldflags="$extra_ldflags -lpng -lz"
4295 else
4296 def_png='#undef CONFIG_PNG'
4299 echocheck "MNG support"
4300 if test "$_mng" = auto ; then
4301 _mng=no
4302 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
4304 echores "$_mng"
4305 if test "$_mng" = yes ; then
4306 def_mng='#define CONFIG_MNG 1'
4307 extra_ldflags="$extra_ldflags -lmng -lz"
4308 else
4309 def_mng='#undef CONFIG_MNG'
4312 echocheck "JPEG support"
4313 if test "$_jpeg" = auto ; then
4314 _jpeg=no
4315 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
4317 echores "$_jpeg"
4319 if test "$_jpeg" = yes ; then
4320 def_jpeg='#define CONFIG_JPEG 1'
4321 vomodules="jpeg $vomodules"
4322 extra_ldflags="$extra_ldflags -ljpeg"
4323 else
4324 def_jpeg='#undef CONFIG_JPEG'
4325 novomodules="jpeg $novomodules"
4330 echocheck "PNM support"
4331 if test "$_pnm" = yes; then
4332 def_pnm="#define CONFIG_PNM 1"
4333 vomodules="pnm $vomodules"
4334 else
4335 def_pnm="#undef CONFIG_PNM"
4336 novomodules="pnm $novomodules"
4338 echores "$_pnm"
4342 echocheck "GIF support"
4343 # This is to appease people who want to force gif support.
4344 # If it is forced to yes, then we still do checks to determine
4345 # which gif library to use.
4346 if test "$_gif" = yes ; then
4347 _force_gif=yes
4348 _gif=auto
4351 if test "$_gif" = auto ; then
4352 _gif=no
4353 for _ld_gif in "-lungif" "-lgif" ; do
4354 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4355 done
4358 # If no library was found, and the user wants support forced,
4359 # then we force it on with libgif, as this is the safest
4360 # assumption IMHO. (libungif & libregif both create symbolic
4361 # links to libgif. We also assume that no x11 support is needed,
4362 # because if you are forcing this, then you _should_ know what
4363 # you are doing. [ Besides, package maintainers should never
4364 # have compiled x11 deps into libungif in the first place. ] )
4365 # </rant>
4366 # --Joey
4367 if test "$_force_gif" = yes && test "$_gif" = no ; then
4368 _gif=yes
4369 _ld_gif="-lgif"
4372 if test "$_gif" = yes ; then
4373 def_gif='#define CONFIG_GIF 1'
4374 codecmodules="gif $codecmodules"
4375 vomodules="gif89a $vomodules"
4376 res_comment="old version, some encoding functions disabled"
4377 def_gif_4='#undef CONFIG_GIF_4'
4378 extra_ldflags="$extra_ldflags $_ld_gif"
4380 cat > $TMPC << EOF
4381 #include <signal.h>
4382 #include <stdio.h>
4383 #include <stdlib.h>
4384 #include <gif_lib.h>
4385 static void catch(int sig) { exit(1); }
4386 int main(void) {
4387 signal(SIGSEGV, catch); // catch segfault
4388 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4389 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4390 return 0;
4393 if cc_check "$_ld_gif" ; then
4394 def_gif_4='#define CONFIG_GIF_4 1'
4395 res_comment=""
4397 else
4398 def_gif='#undef CONFIG_GIF'
4399 def_gif_4='#undef CONFIG_GIF_4'
4400 novomodules="gif89a $novomodules"
4401 nocodecmodules="gif $nocodecmodules"
4403 echores "$_gif"
4406 case "$_gif" in yes*)
4407 echocheck "broken giflib workaround"
4408 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4410 cat > $TMPC << EOF
4411 #include <stdio.h>
4412 #include <gif_lib.h>
4413 int main(void) {
4414 GifFileType gif = {.UserData = NULL};
4415 printf("UserData is at address %p\n", gif.UserData);
4416 return 0;
4419 if cc_check "$_ld_gif" ; then
4420 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4421 echores "disabled"
4422 else
4423 echores "enabled"
4426 esac
4429 echocheck "VESA support"
4430 if test "$_vesa" = auto ; then
4431 _vesa=no
4432 statement_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4434 if test "$_vesa" = yes ; then
4435 def_vesa='#define CONFIG_VESA 1'
4436 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4437 vomodules="vesa $vomodules"
4438 else
4439 def_vesa='#undef CONFIG_VESA'
4440 novomodules="vesa $novomodules"
4442 echores "$_vesa"
4444 #################
4445 # VIDEO + AUDIO #
4446 #################
4449 echocheck "SDL"
4450 _inc_tmp=""
4451 _ld_tmp=""
4452 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4453 if test -z "$_sdlconfig" ; then
4454 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4455 _sdlconfig="sdl-config"
4456 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4457 _sdlconfig="sdl11-config"
4458 else
4459 _sdlconfig=false
4462 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4463 cat > $TMPC << EOF
4464 #ifdef CONFIG_SDL_SDL_H
4465 #include <SDL/SDL.h>
4466 #else
4467 #include <SDL.h>
4468 #endif
4469 #ifndef __APPLE__
4470 // we allow SDL hacking our main() only on OSX
4471 #undef main
4472 #endif
4473 int main(int argc, char *argv[]) {
4474 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4475 return 0;
4478 _sdl=no
4479 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4480 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4481 _sdl=yes
4482 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4483 break
4485 done
4486 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4487 res_comment="using $_sdlconfig"
4488 if cygwin ; then
4489 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4490 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4491 elif mingw32 ; then
4492 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4493 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4494 else
4495 _inc_tmp="$($_sdlconfig --cflags)"
4496 _ld_tmp="$($_sdlconfig --libs)"
4498 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4499 _sdl=yes
4500 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4501 # HACK for BeOS/Haiku SDL
4502 _ld_tmp="$_ld_tmp -lstdc++"
4503 _sdl=yes
4507 if test "$_sdl" = yes ; then
4508 def_sdl='#define CONFIG_SDL 1'
4509 extra_cflags="$extra_cflags $_inc_tmp"
4510 libs_mplayer="$libs_mplayer $_ld_tmp"
4511 vomodules="sdl $vomodules"
4512 aomodules="sdl $aomodules"
4513 else
4514 def_sdl='#undef CONFIG_SDL'
4515 novomodules="sdl $novomodules"
4516 noaomodules="sdl $noaomodules"
4518 echores "$_sdl"
4521 # make sure this stays below CoreVideo to avoid issues due to namespace
4522 # conflicts between -lGL and -framework OpenGL
4523 echocheck "OpenGL"
4524 #Note: this test is run even with --enable-gl since we autodetect linker flags
4525 if (test "$_x11" = yes || test "$_sdl" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
4526 cat > $TMPC << EOF
4527 #ifdef GL_WIN32
4528 #include <windows.h>
4529 #include <GL/gl.h>
4530 #elif defined(GL_SDL)
4531 #include <GL/gl.h>
4532 #ifdef CONFIG_SDL_SDL_H
4533 #include <SDL/SDL.h>
4534 #else
4535 #include <SDL.h>
4536 #endif
4537 #ifndef __APPLE__
4538 // we allow SDL hacking our main() only on OSX
4539 #undef main
4540 #endif
4541 #else
4542 #include <GL/gl.h>
4543 #include <X11/Xlib.h>
4544 #include <GL/glx.h>
4545 #endif
4546 int main(int argc, char *argv[]) {
4547 #ifdef GL_WIN32
4548 HDC dc;
4549 wglCreateContext(dc);
4550 #elif defined(GL_SDL)
4551 SDL_GL_SwapBuffers();
4552 #else
4553 glXCreateContext(NULL, NULL, NULL, True);
4554 #endif
4555 glFinish();
4556 return 0;
4559 _gl=no
4560 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4561 if cc_check $_ld_tmp $_ld_lm ; then
4562 _gl=yes
4563 _gl_x11=yes
4564 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4565 break
4567 done
4568 if cc_check -DGL_WIN32 -lopengl32 ; then
4569 _gl=yes
4570 _gl_win32=yes
4571 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4573 if test "$_cocoa" = yes ; then
4574 _gl=yes
4575 _gl_cocoa=yes
4577 # last so it can reuse any linker etc. flags detected before
4578 if test "$_sdl" = yes ; then
4579 if cc_check -DGL_SDL ||
4580 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4581 _gl=yes
4582 _gl_sdl=yes
4583 elif cc_check -DGL_SDL -lGL ||
4584 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4585 _gl=yes
4586 _gl_sdl=yes
4587 libs_mplayer="$libs_mplayer -lGL"
4590 else
4591 _gl=no
4593 if test "$_gl" = yes ; then
4594 def_gl='#define CONFIG_GL 1'
4595 res_comment="backends:"
4596 if test "$_gl_cocoa" = yes ; then
4597 def_gl_cocoa='#define CONFIG_GL_COCOA 1'
4598 res_comment="$res_comment cocoa"
4600 if test "$_gl_win32" = yes ; then
4601 def_gl_win32='#define CONFIG_GL_WIN32 1'
4602 res_comment="$res_comment win32"
4604 if test "$_gl_x11" = yes ; then
4605 def_gl_x11='#define CONFIG_GL_X11 1'
4606 res_comment="$res_comment x11"
4608 if test "$_gl_sdl" = yes ; then
4609 def_gl_sdl='#define CONFIG_GL_SDL 1'
4610 res_comment="$res_comment sdl"
4612 vomodules="opengl $vomodules"
4613 else
4614 def_gl='#undef CONFIG_GL'
4615 def_gl_cocoa='#undef CONFIG_GL_COCOA'
4616 def_gl_win32='#undef CONFIG_GL_WIN32'
4617 def_gl_x11='#undef CONFIG_GL_X11'
4618 def_gl_sdl='#undef CONFIG_GL_SDL'
4619 novomodules="opengl $novomodules"
4621 echores "$_gl"
4624 if win32; then
4626 echocheck "Windows waveout"
4627 if test "$_win32waveout" = auto ; then
4628 _win32waveout=no
4629 header_check_broken windows.h mmsystem.h -lwinmm && _win32waveout=yes
4631 if test "$_win32waveout" = yes ; then
4632 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4633 libs_mplayer="$libs_mplayer -lwinmm"
4634 aomodules="win32 $aomodules"
4635 else
4636 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4637 noaomodules="win32 $noaomodules"
4639 echores "$_win32waveout"
4641 echocheck "Direct3D"
4642 if test "$_direct3d" = auto ; then
4643 _direct3d=no
4644 header_check d3d9.h && _direct3d=yes
4646 if test "$_direct3d" = yes ; then
4647 def_direct3d='#define CONFIG_DIRECT3D 1'
4648 vomodules="direct3d $vomodules"
4649 else
4650 def_direct3d='#undef CONFIG_DIRECT3D'
4651 novomodules="direct3d $novomodules"
4653 echores "$_direct3d"
4655 echocheck "Directx"
4656 if test "$_directx" = auto ; then
4657 cat > $TMPC << EOF
4658 #include <ddraw.h>
4659 #include <dsound.h>
4660 int main(void) { return 0; }
4662 _directx=no
4663 cc_check -lgdi32 && _directx=yes
4665 if test "$_directx" = yes ; then
4666 def_directx='#define CONFIG_DIRECTX 1'
4667 libs_mplayer="$libs_mplayer -lgdi32"
4668 vomodules="directx $vomodules"
4669 aomodules="dsound $aomodules"
4670 else
4671 def_directx='#undef CONFIG_DIRECTX'
4672 novomodules="directx $novomodules"
4673 noaomodules="dsound $noaomodules"
4675 echores "$_directx"
4677 fi #if win32; then
4680 echocheck "DXR3/H+"
4681 if test "$_dxr3" = auto ; then
4682 _dxr3=no
4683 header_check linux/em8300.h && _dxr3=yes
4685 if test "$_dxr3" = yes ; then
4686 def_dxr3='#define CONFIG_DXR3 1'
4687 vomodules="dxr3 $vomodules"
4688 else
4689 def_dxr3='#undef CONFIG_DXR3'
4690 novomodules="dxr3 $novomodules"
4692 echores "$_dxr3"
4695 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4696 if test "$_ivtv" = auto ; then
4697 cat > $TMPC << EOF
4698 #include <sys/time.h>
4699 #include <linux/videodev2.h>
4700 #include <linux/ivtv.h>
4701 #include <sys/ioctl.h>
4702 int main(void) {
4703 struct ivtv_cfg_stop_decode sd;
4704 struct ivtv_cfg_start_decode sd1;
4705 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4706 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
4707 return 0; }
4709 _ivtv=no
4710 cc_check && _ivtv=yes
4712 if test "$_ivtv" = yes ; then
4713 def_ivtv='#define CONFIG_IVTV 1'
4714 vomodules="ivtv $vomodules"
4715 aomodules="ivtv $aomodules"
4716 else
4717 def_ivtv='#undef CONFIG_IVTV'
4718 novomodules="ivtv $novomodules"
4719 noaomodules="ivtv $noaomodules"
4721 echores "$_ivtv"
4724 echocheck "V4L2 MPEG Decoder"
4725 if test "$_v4l2" = auto ; then
4726 cat > $TMPC << EOF
4727 #include <sys/time.h>
4728 #include <linux/videodev2.h>
4729 #include <linux/version.h>
4730 int main(void) {
4731 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4732 #error kernel headers too old, need 2.6.22
4733 #endif
4734 struct v4l2_ext_controls ctrls;
4735 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4736 return 0;
4739 _v4l2=no
4740 cc_check && _v4l2=yes
4742 if test "$_v4l2" = yes ; then
4743 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4744 vomodules="v4l2 $vomodules"
4745 aomodules="v4l2 $aomodules"
4746 else
4747 def_v4l2='#undef CONFIG_V4L2_DECODER'
4748 novomodules="v4l2 $novomodules"
4749 noaomodules="v4l2 $noaomodules"
4751 echores "$_v4l2"
4755 #########
4756 # AUDIO #
4757 #########
4760 echocheck "OSS Audio"
4761 if test "$_ossaudio" = auto ; then
4762 _ossaudio=no
4763 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4765 if test "$_ossaudio" = yes ; then
4766 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4767 aomodules="oss $aomodules"
4768 cat > $TMPC << EOF
4769 #include <$_soundcard_header>
4770 #ifdef OPEN_SOUND_SYSTEM
4771 int main(void) { return 0; }
4772 #else
4773 #error Not the real thing
4774 #endif
4776 _real_ossaudio=no
4777 cc_check && _real_ossaudio=yes
4778 if test "$_real_ossaudio" = yes; then
4779 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4780 # Check for OSS4 headers (override default headers)
4781 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4782 if test -f /etc/oss.conf; then
4783 . /etc/oss.conf
4784 _ossinc="$OSSLIBDIR/include"
4785 if test -f "$_ossinc/sys/soundcard.h"; then
4786 extra_cflags="-I$_ossinc $extra_cflags"
4789 elif netbsd || openbsd ; then
4790 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4791 extra_ldflags="$extra_ldflags -lossaudio"
4792 else
4793 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4795 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4796 else
4797 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4798 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4799 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4800 noaomodules="oss $noaomodules"
4802 echores "$_ossaudio"
4805 echocheck "aRts"
4806 if test "$_arts" = auto ; then
4807 _arts=no
4808 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4809 statement_check artsc.h 'arts_init()' $(artsc-config --libs) $(artsc-config --cflags) &&
4810 _arts=yes
4814 if test "$_arts" = yes ; then
4815 def_arts='#define CONFIG_ARTS 1'
4816 aomodules="arts $aomodules"
4817 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
4818 extra_cflags="$extra_cflags $(artsc-config --cflags)"
4819 else
4820 noaomodules="arts $noaomodules"
4822 echores "$_arts"
4825 echocheck "EsounD"
4826 if test "$_esd" = auto ; then
4827 _esd=no
4828 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4829 statement_check esd.h 'esd_open_sound("test")' $(esd-config --libs) $(esd-config --cflags) && _esd=yes
4832 echores "$_esd"
4834 if test "$_esd" = yes ; then
4835 def_esd='#define CONFIG_ESD 1'
4836 aomodules="esd $aomodules"
4837 libs_mplayer="$libs_mplayer $(esd-config --libs)"
4838 extra_cflags="$extra_cflags $(esd-config --cflags)"
4840 echocheck "esd_get_latency()"
4841 statement_check esd.h 'esd_get_latency(0)' $(esd-config --libs) $(esd-config --cflags) &&
4842 _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
4843 echores "$_esd_latency"
4844 else
4845 def_esd='#undef CONFIG_ESD'
4846 def_esd_latency='#undef CONFIG_ESD_LATENCY'
4847 noaomodules="esd $noaomodules"
4850 echocheck "RSound"
4851 if test "$_rsound" = auto ; then
4852 _rsound=no
4853 statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
4855 echores "$_rsound"
4857 if test "$_rsound" = yes ; then
4858 def_rsound='#define CONFIG_RSOUND 1'
4859 aomodules="rsound $aomodules"
4860 libs_mplayer="$libs_mplayer -lrsound"
4861 else
4862 def_rsound='#undef CONFIG_RSOUND'
4863 noaomodules="rsound $noaomodules"
4867 echocheck "NAS"
4868 if test "$_nas" = auto ; then
4869 _nas=no
4870 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
4872 if test "$_nas" = yes ; then
4873 def_nas='#define CONFIG_NAS 1'
4874 libs_mplayer="$libs_mplayer -laudio -lXt"
4875 aomodules="nas $aomodules"
4876 else
4877 noaomodules="nas $noaomodules"
4878 def_nas='#undef CONFIG_NAS'
4880 echores "$_nas"
4883 echocheck "pulse"
4884 if test "$_pulse" = auto ; then
4885 _pulse=no
4886 if pkg_config_add 'libpulse >= 0.9' ; then
4887 _pulse=yes
4890 echores "$_pulse"
4892 if test "$_pulse" = yes ; then
4893 def_pulse='#define CONFIG_PULSE 1'
4894 aomodules="pulse $aomodules"
4895 else
4896 def_pulse='#undef CONFIG_PULSE'
4897 noaomodules="pulse $noaomodules"
4901 echocheck "JACK"
4902 if test "$_jack" = auto ; then
4903 _jack=no
4904 if pkg_config_add jack ; then
4905 _jack=yes
4909 if test "$_jack" = yes ; then
4910 def_jack='#define CONFIG_JACK 1'
4911 aomodules="jack $aomodules"
4912 else
4913 noaomodules="jack $noaomodules"
4915 echores "$_jack"
4917 echocheck "OpenAL"
4918 if test "$_openal" = auto ; then
4919 _openal=no
4920 cat > $TMPC << EOF
4921 #ifdef OPENAL_AL_H
4922 #include <OpenAL/al.h>
4923 #else
4924 #include <AL/al.h>
4925 #endif
4926 int main(void) {
4927 alSourceQueueBuffers(0, 0, 0);
4928 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4929 return 0;
4932 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4933 cc_check $I && _openal=yes && break
4934 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4935 done
4936 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4938 if test "$_openal" = yes ; then
4939 def_openal='#define CONFIG_OPENAL 1'
4940 aomodules="openal $aomodules"
4941 else
4942 noaomodules="openal $noaomodules"
4944 echores "$_openal"
4946 echocheck "ALSA audio"
4947 if test "$_alloca" != yes ; then
4948 _alsa=no
4949 res_comment="alloca missing"
4951 if test "$_alsa" = auto ; then
4952 _alsa=no
4953 if pkg_config_add "alsa >= 1.0.9" ; then
4954 _alsa=yes
4957 def_alsa='#undef CONFIG_ALSA'
4958 if test "$_alsa" = yes ; then
4959 aomodules="alsa $aomodules"
4960 def_alsa='#define CONFIG_ALSA 1'
4961 else
4962 noaomodules="alsa $noaomodules"
4964 echores "$_alsa"
4967 echocheck "Sun audio"
4968 if test "$_sunaudio" = auto ; then
4969 cat > $TMPC << EOF
4970 #include <sys/types.h>
4971 #include <sys/audioio.h>
4972 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4974 _sunaudio=no
4975 cc_check && _sunaudio=yes
4977 if test "$_sunaudio" = yes ; then
4978 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
4979 aomodules="sun $aomodules"
4980 else
4981 def_sunaudio='#undef CONFIG_SUN_AUDIO'
4982 noaomodules="sun $noaomodules"
4984 echores "$_sunaudio"
4987 if darwin; then
4988 echocheck "CoreAudio"
4989 if test "$_coreaudio" = auto ; then
4990 cat > $TMPC <<EOF
4991 #include <CoreAudio/CoreAudio.h>
4992 #include <AudioToolbox/AudioToolbox.h>
4993 #include <AudioUnit/AudioUnit.h>
4994 int main(void) { return 0; }
4996 _coreaudio=no
4997 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
4999 if test "$_coreaudio" = yes ; then
5000 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5001 def_coreaudio='#define CONFIG_COREAUDIO 1'
5002 aomodules="coreaudio $aomodules"
5003 else
5004 def_coreaudio='#undef CONFIG_COREAUDIO'
5005 noaomodules="coreaudio $noaomodules"
5007 echores $_coreaudio
5008 fi #if darwin
5011 if irix; then
5012 echocheck "SGI audio"
5013 if test "$_sgiaudio" = auto ; then
5014 _sgiaudio=no
5015 header_check dmedia/audio.h && _sgiaudio=yes
5017 if test "$_sgiaudio" = "yes" ; then
5018 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5019 libs_mplayer="$libs_mplayer -laudio"
5020 aomodules="sgi $aomodules"
5021 else
5022 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5023 noaomodules="sgi $noaomodules"
5025 echores "$_sgiaudio"
5026 fi #if irix
5029 # set default CD/DVD devices
5030 if win32 ; then
5031 default_cdrom_device="D:"
5032 elif darwin ; then
5033 default_cdrom_device="/dev/disk1"
5034 elif dragonfly ; then
5035 default_cdrom_device="/dev/cd0"
5036 elif freebsd ; then
5037 default_cdrom_device="/dev/acd0"
5038 elif openbsd ; then
5039 default_cdrom_device="/dev/rcd0c"
5040 elif sunos ; then
5041 default_cdrom_device="/vol/dev/aliases/cdrom0"
5042 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5043 # file system and the volfs service.
5044 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5045 elif amigaos ; then
5046 default_cdrom_device="a1ide.device:2"
5047 else
5048 default_cdrom_device="/dev/cdrom"
5051 if win32 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5052 default_dvd_device=$default_cdrom_device
5053 elif darwin ; then
5054 default_dvd_device="/dev/rdiskN"
5055 else
5056 default_dvd_device="/dev/dvd"
5060 echocheck "VCD support"
5061 if test "$_vcd" = auto; then
5062 _vcd=no
5063 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos; then
5064 _vcd=yes
5065 elif mingw32; then
5066 header_check ddk/ntddcdrm.h && _vcd=yes
5069 if test "$_vcd" = yes; then
5070 inputmodules="vcd $inputmodules"
5071 def_vcd='#define CONFIG_VCD 1'
5072 else
5073 def_vcd='#undef CONFIG_VCD'
5074 noinputmodules="vcd $noinputmodules"
5075 res_comment="not supported on this OS"
5077 echores "$_vcd"
5081 echocheck "Blu-ray support"
5082 if test "$_bluray" = auto ; then
5083 _bluray=no
5084 statement_check libbluray/bluray.h 'bd_get_title_info(0, 0, 0)' -lbluray && _bluray=yes
5086 if test "$_bluray" = yes ; then
5087 def_bluray='#define CONFIG_LIBBLURAY 1'
5088 extra_ldflags="$extra_ldflags -lbluray"
5089 inputmodules="bluray $inputmodules"
5090 else
5091 def_bluray='#undef CONFIG_LIBBLURAY'
5092 noinputmodules="bluray $noinputmodules"
5094 echores "$_bluray"
5096 echocheck "dvdread"
5097 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5098 _dvdread_internal=no
5100 if test "$_dvdread_internal" = auto ; then
5101 _dvdread_internal=no
5102 _dvdread=no
5103 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) &&
5104 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
5105 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
5106 darwin || win32; then
5107 _dvdread_internal=yes
5108 _dvdread=yes
5109 extra_cflags="-Ilibdvdread4 $extra_cflags"
5111 elif test "$_dvdread" = auto ; then
5112 _dvdread=no
5113 if test "$_dl" = yes; then
5114 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5115 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5116 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5117 _dvdread=yes
5118 extra_cflags="$extra_cflags $_dvdreadcflags"
5119 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5120 res_comment="external"
5125 if test "$_dvdread_internal" = yes; then
5126 def_dvdread='#define CONFIG_DVDREAD 1'
5127 inputmodules="dvdread(internal) $inputmodules"
5128 res_comment="internal"
5129 elif test "$_dvdread" = yes; then
5130 def_dvdread='#define CONFIG_DVDREAD 1'
5131 extra_ldflags="$extra_ldflags -ldvdread"
5132 inputmodules="dvdread(external) $inputmodules"
5133 res_comment="external"
5134 else
5135 def_dvdread='#undef CONFIG_DVDREAD'
5136 noinputmodules="dvdread $noinputmodules"
5138 echores "$_dvdread"
5141 echocheck "internal libdvdcss"
5142 if test "$_libdvdcss_internal" = auto ; then
5143 _libdvdcss_internal=no
5144 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
5145 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5147 if test "$_libdvdcss_internal" = yes ; then
5148 if linux || netbsd || openbsd || bsdos ; then
5149 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5150 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5151 elif freebsd || dragonfly ; then
5152 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5153 elif darwin ; then
5154 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5155 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5156 elif cygwin ; then
5157 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5158 elif beos ; then
5159 cflags_libdvdcss="-DSYS_BEOS"
5161 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5162 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5163 inputmodules="libdvdcss(internal) $inputmodules"
5164 else
5165 noinputmodules="libdvdcss(internal) $noinputmodules"
5167 echores "$_libdvdcss_internal"
5170 echocheck "libcdio"
5171 if test "$_libcdio" = auto ; then
5172 _libcdio=no
5173 if pkg_config_add libcdio_paranoia ; then
5174 _libcdio=yes
5177 if test "$_libcdio" = yes ; then
5178 _cdda='yes'
5179 def_cdda='#define CONFIG_CDDA 1'
5180 test $_cddb = auto && test $networking = yes && _cddb=yes
5181 inputmodules="cdda $inputmodules"
5182 else
5183 _libcdio=no
5184 _cdda='no'
5185 def_cdda='#undef CONFIG_CDDA'
5186 noinputmodules="cdda $noinputmodules"
5188 echores "$_libcdio"
5190 if test "$_cddb" = yes ; then
5191 def_cddb='#define CONFIG_CDDB 1'
5192 inputmodules="cddb $inputmodules"
5193 else
5194 _cddb=no
5195 def_cddb='#undef CONFIG_CDDB'
5196 noinputmodules="cddb $noinputmodules"
5199 echocheck "bitmap font support"
5200 if test "$_bitmap_font" = yes ; then
5201 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5202 else
5203 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5205 echores "$_bitmap_font"
5208 echocheck "freetype >= 2.0.9"
5210 # freetype depends on iconv
5211 if test "$_iconv" = no ; then
5212 _freetype=no
5213 res_comment="iconv support needed"
5216 if test "$_freetype" = auto ; then
5217 if pkg_config_add freetype2 ; then
5218 _freetype=yes
5219 else
5220 die "Unable to find development files for libfreetype. Aborting. If you really mean to compile without FreeType support use --disable-freetype."
5223 if test "$_freetype" = yes ; then
5224 def_freetype='#define CONFIG_FREETYPE 1'
5225 else
5226 def_freetype='#undef CONFIG_FREETYPE'
5228 echores "$_freetype"
5230 if test "$_freetype" = no ; then
5231 _fontconfig=no
5232 res_comment="FreeType support needed"
5234 echocheck "fontconfig"
5235 if test "$_fontconfig" = auto ; then
5236 if pkg_config_add 'fontconfig >= 2.4.2' ; then
5237 _fontconfig=yes
5238 else
5239 die "Unable to find development files for libfontconfig. Aborting. If you really mean to compile without fontconfig support use --disable-fontconfig."
5242 if test "$_fontconfig" = yes ; then
5243 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5244 else
5245 def_fontconfig='#undef CONFIG_FONTCONFIG'
5247 echores "$_fontconfig"
5250 echocheck "SSA/ASS support"
5251 if test "$_ass" = auto ; then
5252 if pkg_config_add libass ; then
5253 _ass=yes
5254 def_ass='#define CONFIG_ASS 1'
5255 else
5256 die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
5258 else
5259 def_ass='#undef CONFIG_ASS'
5261 echores "$_ass"
5264 echocheck "fribidi with charsets"
5265 if test "$_fribidi" = auto ; then
5266 _fribidi=no
5267 if pkg_config_add fribidi ; then
5268 _fribidi=yes
5271 if test "$_fribidi" = yes ; then
5272 def_fribidi='#define CONFIG_FRIBIDI 1'
5273 else
5274 def_fribidi='#undef CONFIG_FRIBIDI'
5276 echores "$_fribidi"
5279 echocheck "ENCA"
5280 if test "$_enca" = auto ; then
5281 _enca=no
5282 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
5284 if test "$_enca" = yes ; then
5285 def_enca='#define CONFIG_ENCA 1'
5286 extra_ldflags="$extra_ldflags -lenca"
5287 else
5288 def_enca='#undef CONFIG_ENCA'
5290 echores "$_enca"
5293 echocheck "zlib"
5294 _zlib=no
5295 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5296 if test "$_zlib" = yes ; then
5297 def_zlib='#define CONFIG_ZLIB 1'
5298 extra_ldflags="$extra_ldflags -lz"
5299 else
5300 def_zlib='#define CONFIG_ZLIB 0'
5302 echores "$_zlib"
5305 echocheck "RTC"
5306 if test "$_rtc" = auto ; then
5307 cat > $TMPC << EOF
5308 #include <sys/ioctl.h>
5309 #ifdef __linux__
5310 #include <linux/rtc.h>
5311 #else
5312 #include <rtc.h>
5313 #define RTC_PIE_ON RTCIO_PIE_ON
5314 #endif
5315 int main(void) { return RTC_PIE_ON; }
5317 _rtc=no
5318 cc_check && _rtc=yes
5319 ppc && _rtc=no
5321 if test "$_rtc" = yes ; then
5322 def_rtc='#define HAVE_RTC 1'
5323 else
5324 def_rtc='#undef HAVE_RTC'
5326 echores "$_rtc"
5329 echocheck "mad support"
5330 if test "$_mad" = auto ; then
5331 _mad=no
5332 header_check mad.h -lmad && _mad=yes
5334 if test "$_mad" = yes ; then
5335 def_mad='#define CONFIG_LIBMAD 1'
5336 extra_ldflags="$extra_ldflags -lmad"
5337 codecmodules="libmad $codecmodules"
5338 else
5339 def_mad='#undef CONFIG_LIBMAD'
5340 nocodecmodules="libmad $nocodecmodules"
5342 echores "$_mad"
5344 echocheck "OggVorbis support"
5345 if test "$_libvorbis" = auto; then
5346 _libvorbis=no
5347 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
5348 elif test "$_libvorbis" = yes ; then
5349 _tremor=no
5351 if test "$_tremor" = auto; then
5352 _tremor=no
5353 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
5355 if test "$_tremor" = yes ; then
5356 _vorbis=yes
5357 def_vorbis='#define CONFIG_OGGVORBIS 1'
5358 def_tremor='#define CONFIG_TREMOR 1'
5359 codecmodules="tremor(external) $codecmodules"
5360 res_comment="external Tremor"
5361 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
5362 elif test "$_libvorbis" = yes ; then
5363 _vorbis=yes
5364 def_vorbis='#define CONFIG_OGGVORBIS 1'
5365 codecmodules="libvorbis $codecmodules"
5366 res_comment="libvorbis"
5367 extra_ldflags="$extra_ldflags -lvorbis -logg"
5368 else
5369 _vorbis=no
5370 nocodecmodules="libvorbis $nocodecmodules"
5372 echores "$_vorbis"
5374 echocheck "libspeex (version >= 1.1 required)"
5375 if test "$_speex" = auto ; then
5376 _speex=no
5377 cat > $TMPC << EOF
5378 #include <stddef.h>
5379 #include <speex/speex.h>
5380 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5382 cc_check -lspeex $_ld_lm && _speex=yes
5384 if test "$_speex" = yes ; then
5385 def_speex='#define CONFIG_SPEEX 1'
5386 extra_ldflags="$extra_ldflags -lspeex"
5387 codecmodules="speex $codecmodules"
5388 else
5389 def_speex='#undef CONFIG_SPEEX'
5390 nocodecmodules="speex $nocodecmodules"
5392 echores "$_speex"
5394 echocheck "OggTheora support"
5395 if test "$_theora" = auto ; then
5396 _theora=no
5397 if pkg_config_add theora ; then
5398 _theora=yes
5401 if test "$_theora" = yes ; then
5402 def_theora='#define CONFIG_OGGTHEORA 1'
5403 codecmodules="libtheora $codecmodules"
5404 else
5405 def_theora='#undef CONFIG_OGGTHEORA'
5406 nocodecmodules="libtheora $nocodecmodules"
5408 echores "$_theora"
5410 # Any version of libmpg123 shall be fine.
5411 echocheck "mpg123 support"
5412 def_mpg123='#undef CONFIG_MPG123'
5413 if test "$_mpg123" = auto; then
5414 _mpg123=no
5415 statement_check mpg123.h 'mpg123_init()' -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
5417 if test "$_mpg123" = yes ; then
5418 def_mpg123='#define CONFIG_MPG123 1'
5419 codecmodules="mpg123 $codecmodules"
5420 else
5421 nocodecmodules="mpg123 $nocodecmodules"
5423 echores "$_mpg123"
5425 echocheck "liba52 support"
5426 def_liba52='#undef CONFIG_LIBA52'
5427 if test "$_liba52" = auto ; then
5428 _liba52=no
5429 cat > $TMPC << EOF
5430 #include <inttypes.h>
5431 #include <a52dec/a52.h>
5432 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
5434 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
5436 if test "$_liba52" = yes ; then
5437 def_liba52='#define CONFIG_LIBA52 1'
5438 codecmodules="liba52 $codecmodules"
5439 else
5440 nocodecmodules="liba52 $nocodecmodules"
5442 echores "$_liba52"
5444 echocheck "libdca support"
5445 if test "$_libdca" = auto ; then
5446 _libdca=no
5447 for _ld_dca in -ldca -ldts ; do
5448 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
5449 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
5450 done
5452 if test "$_libdca" = yes ; then
5453 def_libdca='#define CONFIG_LIBDCA 1'
5454 codecmodules="libdca $codecmodules"
5455 else
5456 def_libdca='#undef CONFIG_LIBDCA'
5457 nocodecmodules="libdca $nocodecmodules"
5459 echores "$_libdca"
5461 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5462 if test "$_musepack" = yes ; then
5463 _musepack=no
5464 cat > $TMPC << EOF
5465 #include <stddef.h>
5466 #include <mpcdec/mpcdec.h>
5467 int main(void) {
5468 mpc_streaminfo info;
5469 mpc_decoder decoder;
5470 mpc_decoder_set_streaminfo(&decoder, &info);
5471 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5472 return 0;
5475 cc_check -lmpcdec $_ld_lm && _musepack=yes
5477 if test "$_musepack" = yes ; then
5478 def_musepack='#define CONFIG_MUSEPACK 1'
5479 extra_ldflags="$extra_ldflags -lmpcdec"
5480 codecmodules="musepack $codecmodules"
5481 else
5482 def_musepack='#undef CONFIG_MUSEPACK'
5483 nocodecmodules="musepack $nocodecmodules"
5485 echores "$_musepack"
5488 echocheck "FAAD2 support"
5489 if test "$_faad" = auto ; then
5490 _faad=no
5491 cat > $TMPC << EOF
5492 #include <faad.h>
5493 #ifndef FAAD_MIN_STREAMSIZE
5494 #error Too old version
5495 #endif
5496 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
5497 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5499 cc_check -lfaad $_ld_lm && _faad=yes
5502 def_faad='#undef CONFIG_FAAD'
5503 if test "$_faad" = yes ; then
5504 def_faad='#define CONFIG_FAAD 1'
5505 extra_ldflags="$extra_ldflags -lfaad"
5506 codecmodules="faad2 $codecmodules"
5507 else
5508 nocodecmodules="faad2 $nocodecmodules"
5510 echores "$_faad"
5513 echocheck "LADSPA plugin support"
5514 if test "$_ladspa" = auto ; then
5515 _ladspa=no
5516 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
5518 if test "$_ladspa" = yes; then
5519 def_ladspa="#define CONFIG_LADSPA 1"
5520 else
5521 def_ladspa="#undef CONFIG_LADSPA"
5523 echores "$_ladspa"
5526 echocheck "libbs2b audio filter support"
5527 if test "$_libbs2b" = auto ; then
5528 _libbs2b=no
5529 if pkg_config_add libbs2b ; then
5530 _libbs2b=yes
5533 def_libbs2b="#undef CONFIG_LIBBS2B"
5534 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
5535 echores "$_libbs2b"
5538 if test -z "$_codecsdir" ; then
5539 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5540 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5541 if test -d "$dir" ; then
5542 _codecsdir="$dir"
5543 break;
5545 done
5547 # Fall back on default directory.
5548 if test -z "$_codecsdir" ; then
5549 _codecsdir="$_libdir/codecs"
5550 mingw32 && _codecsdir="codecs"
5554 echocheck "Win32 codecs"
5555 if test "$_win32dll" = auto ; then
5556 _win32dll=no
5557 if x86_32 && ! qnx; then
5558 _win32dll=yes
5561 if test "$_win32dll" = yes ; then
5562 def_win32dll='#define CONFIG_WIN32DLL 1'
5563 if ! win32 ; then
5564 def_win32_loader='#define WIN32_LOADER 1'
5565 _win32_emulation=yes
5566 else
5567 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
5568 res_comment="using native windows"
5570 codecmodules="win32 $codecmodules"
5571 else
5572 def_win32dll='#undef CONFIG_WIN32DLL'
5573 def_win32_loader='#undef WIN32_LOADER'
5574 nocodecmodules="win32 $nocodecmodules"
5576 echores "$_win32dll"
5579 echocheck "XAnim codecs"
5580 if test "$_xanim" = auto ; then
5581 _xanim=no
5582 res_comment="dynamic loader support needed"
5583 if test "$_dl" = yes ; then
5584 _xanim=yes
5587 if test "$_xanim" = yes ; then
5588 def_xanim='#define CONFIG_XANIM 1'
5589 codecmodules="xanim $codecmodules"
5590 else
5591 def_xanim='#undef CONFIG_XANIM'
5592 nocodecmodules="xanim $nocodecmodules"
5594 echores "$_xanim"
5597 echocheck "RealPlayer codecs"
5598 if test "$_real" = auto ; then
5599 _real=no
5600 res_comment="dynamic loader support needed"
5601 if test "$_dl" = yes || test "$_win32dll" = yes &&
5602 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
5603 _real=yes
5606 if test "$_real" = yes ; then
5607 def_real='#define CONFIG_REALCODECS 1'
5608 codecmodules="real $codecmodules"
5609 else
5610 def_real='#undef CONFIG_REALCODECS'
5611 nocodecmodules="real $nocodecmodules"
5613 echores "$_real"
5616 echocheck "QuickTime codecs"
5617 _qtx_emulation=no
5618 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
5619 if test "$_qtx" = auto ; then
5620 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
5622 if test "$_qtx" = yes ; then
5623 def_qtx='#define CONFIG_QTX_CODECS 1'
5624 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
5625 codecmodules="qtx $codecmodules"
5626 darwin || win32 || _qtx_emulation=yes
5627 else
5628 def_qtx='#undef CONFIG_QTX_CODECS'
5629 nocodecmodules="qtx $nocodecmodules"
5631 echores "$_qtx"
5633 echocheck "Nemesi Streaming Media libraries"
5634 if test "$_nemesi" = auto && test "$networking" = yes ; then
5635 _nemesi=no
5636 if pkg_config_add libnemesi ; then
5637 _nemesi=yes
5640 if test "$_nemesi" = yes; then
5641 _native_rtsp=no
5642 def_nemesi='#define CONFIG_LIBNEMESI 1'
5643 inputmodules="nemesi $inputmodules"
5644 else
5645 _native_rtsp="$networking"
5646 _nemesi=no
5647 def_nemesi='#undef CONFIG_LIBNEMESI'
5648 noinputmodules="nemesi $noinputmodules"
5650 echores "$_nemesi"
5652 echocheck "LIVE555 Streaming Media libraries"
5653 if test "$_live" != no && test "$networking" = yes ; then
5654 cat > $TMPCPP << EOF
5655 #include <liveMedia.hh>
5656 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
5657 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5658 #endif
5659 int main(void) { return 0; }
5662 _live=no
5663 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
5664 cxx_check $I/liveMedia/include $I/UsageEnvironment/include $I/groupsock/include &&
5665 _livelibdir=$(echo $I| sed s/-I//) &&
5666 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
5667 $_livelibdir/groupsock/libgroupsock.a \
5668 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
5669 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
5670 $extra_ldflags -lstdc++" \
5671 extra_cxxflags="-I$_livelibdir/liveMedia/include \
5672 -I$_livelibdir/UsageEnvironment/include \
5673 -I$_livelibdir/BasicUsageEnvironment/include \
5674 -I$_livelibdir/groupsock/include" &&
5675 _live=yes && break
5676 done
5677 if test "$_live" != yes ; then
5678 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
5679 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
5680 _live_dist=yes
5684 if test "$_live" = yes && test "$networking" = yes; then
5685 test $_livelibdir && res_comment="using $_livelibdir"
5686 def_live='#define CONFIG_LIVE555 1'
5687 inputmodules="live555 $inputmodules"
5688 elif test "$_live_dist" = yes && test "$networking" = yes; then
5689 res_comment="using distribution version"
5690 _live="yes"
5691 def_live='#define CONFIG_LIVE555 1'
5692 extra_ldflags="$extra_ldflags $ld_tmp"
5693 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
5694 inputmodules="live555 $inputmodules"
5695 else
5696 _live=no
5697 def_live='#undef CONFIG_LIVE555'
5698 noinputmodules="live555 $noinputmodules"
5700 echores "$_live"
5704 # Test with > against Libav 0.8 versions which will NOT work rather than
5705 # specify minimum version, to allow (future) point releases to possibly work.
5706 all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5707 echocheck "Libav ($all_libav_libs)"
5708 if test "$ffmpeg" = auto ; then
5709 IFS=":" # shell should not be used for programming
5710 if ! pkg_config_add $all_libav_libs ; then
5711 die "Unable to find development files for some of the required Libav libraries above. Aborting."
5714 echores "yes"
5716 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
5717 if ! test -z "$_ffmpeg_source" ; then
5718 def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
5721 echocheck "libpostproc >= 52.0.0"
5722 if test "$libpostproc" = auto ; then
5723 libpostproc=no
5724 if pkg_config_add "libpostproc >= 52.0.0" ; then
5725 libpostproc=yes
5728 if test "$libpostproc" = yes ; then
5729 def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
5730 else
5731 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
5733 echores "$libpostproc"
5736 echocheck "libdv-0.9.5+"
5737 if test "$_libdv" = auto ; then
5738 _libdv=no
5739 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
5741 if test "$_libdv" = yes ; then
5742 def_libdv='#define CONFIG_LIBDV095 1'
5743 extra_ldflags="$extra_ldflags -ldv"
5744 codecmodules="libdv $codecmodules"
5745 else
5746 def_libdv='#undef CONFIG_LIBDV095'
5747 nocodecmodules="libdv $nocodecmodules"
5749 echores "$_libdv"
5752 echocheck "Xvid"
5753 if test "$_xvid" = auto ; then
5754 _xvid=no
5755 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5756 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5757 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
5758 done
5761 if test "$_xvid" = yes ; then
5762 def_xvid='#define CONFIG_XVID4 1'
5763 codecmodules="xvid $codecmodules"
5764 else
5765 def_xvid='#undef CONFIG_XVID4'
5766 nocodecmodules="xvid $nocodecmodules"
5768 echores "$_xvid"
5771 echocheck "libnut"
5772 if test "$_libnut" = auto ; then
5773 _libnut=no
5774 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
5777 if test "$_libnut" = yes ; then
5778 def_libnut='#define CONFIG_LIBNUT 1'
5779 extra_ldflags="$extra_ldflags -lnut"
5780 else
5781 def_libnut='#undef CONFIG_LIBNUT'
5783 echores "$_libnut"
5785 # These VO checks must be done after the FFmpeg one
5786 echocheck "/dev/mga_vid"
5787 if test "$_mga" = auto ; then
5788 _mga=no
5789 test -c /dev/mga_vid && _mga=yes
5791 if test "$_mga" = yes ; then
5792 def_mga='#define CONFIG_MGA 1'
5793 vomodules="mga $vomodules"
5794 else
5795 def_mga='#undef CONFIG_MGA'
5796 novomodules="mga $novomodules"
5798 echores "$_mga"
5801 echocheck "xmga"
5802 if test "$_xmga" = auto ; then
5803 _xmga=no
5804 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
5806 if test "$_xmga" = yes ; then
5807 def_xmga='#define CONFIG_XMGA 1'
5808 vomodules="xmga $vomodules"
5809 else
5810 def_xmga='#undef CONFIG_XMGA'
5811 novomodules="xmga $novomodules"
5813 echores "$_xmga"
5816 echocheck "UnRAR executable"
5817 if test "$_unrar_exec" = auto ; then
5818 _unrar_exec="yes"
5819 mingw32 && _unrar_exec="no"
5821 if test "$_unrar_exec" = yes ; then
5822 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
5823 else
5824 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
5826 echores "$_unrar_exec"
5828 echocheck "TV interface"
5829 if test "$_tv" = yes ; then
5830 def_tv='#define CONFIG_TV 1'
5831 inputmodules="tv $inputmodules"
5832 else
5833 noinputmodules="tv $noinputmodules"
5834 def_tv='#undef CONFIG_TV'
5836 echores "$_tv"
5839 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
5840 echocheck "*BSD BT848 bt8xx header"
5841 _ioctl_bt848_h=no
5842 for file in "machine/ioctl_bt848.h" \
5843 "dev/bktr/ioctl_bt848.h" \
5844 "dev/video/bktr/ioctl_bt848.h" \
5845 "dev/ic/bt8xx.h" ; do
5846 cat > $TMPC <<EOF
5847 #include <sys/types.h>
5848 #include <sys/ioctl.h>
5849 #include <$file>
5850 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5852 if cc_check ; then
5853 _ioctl_bt848_h=yes
5854 _ioctl_bt848_h_name="$file"
5855 break;
5857 done
5858 if test "$_ioctl_bt848_h" = yes ; then
5859 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5860 res_comment="using $_ioctl_bt848_h_name"
5861 else
5862 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
5864 echores "$_ioctl_bt848_h"
5866 echocheck "*BSD ioctl_meteor.h"
5867 _ioctl_meteor_h=no
5868 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5869 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5870 _ioctl_meteor_h=yes && break
5871 done
5872 if test "$_ioctl_meteor_h" = yes ; then
5873 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5874 res_comment="using $ioctl_meteor_h_path"
5875 else
5876 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
5878 echores "$_ioctl_meteor_h"
5880 echocheck "*BSD BrookTree 848 TV interface"
5881 if test "$_tv_bsdbt848" = auto ; then
5882 _tv_bsdbt848=no
5883 if test "$_tv" = yes ; then
5884 cat > $TMPC <<EOF
5885 #include <sys/types.h>
5886 $def_ioctl_meteor_h_name
5887 $def_ioctl_bt848_h_name
5888 #ifdef IOCTL_METEOR_H_NAME
5889 #include IOCTL_METEOR_H_NAME
5890 #endif
5891 #ifdef IOCTL_BT848_H_NAME
5892 #include IOCTL_BT848_H_NAME
5893 #endif
5894 int main(void) {
5895 ioctl(0, METEORSINPUT, 0);
5896 ioctl(0, TVTUNER_GETFREQ, 0);
5897 return 0;
5900 cc_check && _tv_bsdbt848=yes
5903 if test "$_tv_bsdbt848" = yes ; then
5904 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
5905 inputmodules="tv-bsdbt848 $inputmodules"
5906 else
5907 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
5908 noinputmodules="tv-bsdbt848 $noinputmodules"
5910 echores "$_tv_bsdbt848"
5911 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5914 echocheck "DirectShow TV interface"
5915 if test "$_tv_dshow" = auto ; then
5916 _tv_dshow=no
5917 if test "$_tv" = yes && win32 ; then
5918 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
5921 if test "$_tv_dshow" = yes ; then
5922 inputmodules="tv-dshow $inputmodules"
5923 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
5924 extra_ldflags="$extra_ldflags -lole32 -luuid"
5925 else
5926 noinputmodules="tv-dshow $noinputmodules"
5927 def_tv_dshow='#undef CONFIG_TV_DSHOW'
5929 echores "$_tv_dshow"
5932 echocheck "Video 4 Linux TV interface"
5933 if test "$_tv_v4l1" = auto ; then
5934 _tv_v4l1=no
5935 if test "$_tv" = yes && linux ; then
5936 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
5939 if test "$_tv_v4l1" = yes ; then
5940 _audio_input=yes
5941 _tv_v4l=yes
5942 def_tv_v4l='#define CONFIG_TV_V4L 1'
5943 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
5944 inputmodules="tv-v4l $inputmodules"
5945 else
5946 noinputmodules="tv-v4l1 $noinputmodules"
5947 def_tv_v4l='#undef CONFIG_TV_V4L'
5949 echores "$_tv_v4l1"
5952 echocheck "Video 4 Linux 2 TV interface"
5953 if test "$_tv_v4l2" = auto ; then
5954 _tv_v4l2=no
5955 if test "$_tv" = yes && linux ; then
5956 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
5957 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5958 _tv_v4l2=yes
5961 if test "$_tv_v4l2" = yes ; then
5962 _audio_input=yes
5963 _tv_v4l=yes
5964 def_tv_v4l='#define CONFIG_TV_V4L 1'
5965 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
5966 inputmodules="tv-v4l2 $inputmodules"
5967 else
5968 noinputmodules="tv-v4l2 $noinputmodules"
5969 def_tv_v4l2='#undef CONFIG_TV_V4L2'
5971 echores "$_tv_v4l2"
5974 echocheck "Radio interface"
5975 if test "$_radio" = yes ; then
5976 def_radio='#define CONFIG_RADIO 1'
5977 inputmodules="radio $inputmodules"
5978 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5979 _radio_capture=no
5981 if test "$_radio_capture" = yes ; then
5982 _audio_input=yes
5983 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
5984 else
5985 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5987 else
5988 noinputmodules="radio $noinputmodules"
5989 def_radio='#undef CONFIG_RADIO'
5990 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5991 _radio_capture=no
5993 echores "$_radio"
5994 echocheck "Capture for Radio interface"
5995 echores "$_radio_capture"
5997 echocheck "Video 4 Linux 2 Radio interface"
5998 if test "$_radio_v4l2" = auto ; then
5999 _radio_v4l2=no
6000 if test "$_radio" = yes && linux ; then
6001 header_check linux/videodev2.h && _radio_v4l2=yes
6004 if test "$_radio_v4l2" = yes ; then
6005 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
6006 else
6007 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
6009 echores "$_radio_v4l2"
6011 echocheck "Video 4 Linux Radio interface"
6012 if test "$_radio_v4l" = auto ; then
6013 _radio_v4l=no
6014 if test "$_radio" = yes && linux ; then
6015 header_check linux/videodev.h && _radio_v4l=yes
6018 if test "$_radio_v4l" = yes ; then
6019 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
6020 else
6021 def_radio_v4l='#undef CONFIG_RADIO_V4L'
6023 echores "$_radio_v4l"
6025 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
6026 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6027 echocheck "*BSD BrookTree 848 Radio interface"
6028 _radio_bsdbt848=no
6029 cat > $TMPC <<EOF
6030 #include <sys/types.h>
6031 $def_ioctl_bt848_h_name
6032 #ifdef IOCTL_BT848_H_NAME
6033 #include IOCTL_BT848_H_NAME
6034 #endif
6035 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
6037 cc_check && _radio_bsdbt848=yes
6038 echores "$_radio_bsdbt848"
6039 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
6041 if test "$_radio_bsdbt848" = yes ; then
6042 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
6043 else
6044 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
6047 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
6048 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6049 die "Radio driver requires BSD BT848, V4L or V4L2!"
6052 echocheck "Video 4 Linux 2 MPEG PVR interface"
6053 if test "$_pvr" = auto ; then
6054 _pvr=no
6055 if test "$_tv_v4l2" = yes && linux ; then
6056 cat > $TMPC <<EOF
6057 #include <sys/time.h>
6058 #include <linux/videodev2.h>
6059 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
6061 cc_check && _pvr=yes
6064 if test "$_pvr" = yes ; then
6065 def_pvr='#define CONFIG_PVR 1'
6066 inputmodules="pvr $inputmodules"
6067 else
6068 noinputmodules="pvr $noinputmodules"
6069 def_pvr='#undef CONFIG_PVR'
6071 echores "$_pvr"
6074 echocheck "ftp"
6075 if test "$_ftp" = "auto" ; then
6076 test "$networking" = "yes" && ! beos && _ftp=yes
6078 if test "$_ftp" = yes ; then
6079 def_ftp='#define CONFIG_FTP 1'
6080 inputmodules="ftp $inputmodules"
6081 else
6082 noinputmodules="ftp $noinputmodules"
6083 def_ftp='#undef CONFIG_FTP'
6085 echores "$_ftp"
6087 echocheck "vstream client"
6088 if test "$_vstream" = auto ; then
6089 _vstream=no
6090 cat > $TMPC <<EOF
6091 #include <vstream-client.h>
6092 void vstream_error(const char *format, ... ) {}
6093 int main(void) { vstream_start(); return 0; }
6095 cc_check -lvstream-client && _vstream=yes
6097 if test "$_vstream" = yes ; then
6098 def_vstream='#define CONFIG_VSTREAM 1'
6099 inputmodules="vstream $inputmodules"
6100 extra_ldflags="$extra_ldflags -lvstream-client"
6101 else
6102 noinputmodules="vstream $noinputmodules"
6103 def_vstream='#undef CONFIG_VSTREAM'
6105 echores "$_vstream"
6108 echocheck "Subtitles sorting"
6109 if test "$_sortsub" = yes ; then
6110 def_sortsub='#define CONFIG_SORTSUB 1'
6111 else
6112 def_sortsub='#undef CONFIG_SORTSUB'
6114 echores "$_sortsub"
6117 echocheck "XMMS inputplugin support"
6118 if test "$_xmms" = yes ; then
6119 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6120 _xmmsplugindir=$(xmms-config --input-plugin-dir)
6121 _xmmslibdir=$(xmms-config --exec-prefix)/lib
6122 else
6123 _xmmsplugindir=/usr/lib/xmms/Input
6124 _xmmslibdir=/usr/lib
6127 def_xmms='#define CONFIG_XMMS 1'
6128 if darwin ; then
6129 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6130 else
6131 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6133 else
6134 def_xmms='#undef CONFIG_XMMS'
6136 echores "$_xmms"
6138 if test "$_charset" != "noconv" ; then
6139 def_charset="#define MSG_CHARSET \"$_charset\""
6140 else
6141 def_charset="#undef MSG_CHARSET"
6142 _charset="UTF-8"
6145 #############################################################################
6147 echocheck "automatic gdb attach"
6148 if test "$_crash_debug" = yes ; then
6149 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
6150 else
6151 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
6152 _crash_debug=no
6154 echores "$_crash_debug"
6156 echocheck "compiler support for noexecstack"
6157 if cflag_check -Wl,-z,noexecstack ; then
6158 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
6159 echores "yes"
6160 else
6161 echores "no"
6164 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
6165 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6166 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6167 echores "yes"
6168 else
6169 echores "no"
6173 # Dynamic linking flags
6174 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6175 _ld_dl_dynamic=''
6176 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
6177 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! sunos; then
6178 _ld_dl_dynamic='-rdynamic'
6181 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6182 bsdos && extra_ldflags="$extra_ldflags -ldvd"
6183 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
6185 def_debug='#undef MP_DEBUG'
6186 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
6189 echocheck "joystick"
6190 def_joystick='#undef CONFIG_JOYSTICK'
6191 if test "$_joystick" = yes ; then
6192 if linux || freebsd ; then
6193 # TODO add some check
6194 def_joystick='#define CONFIG_JOYSTICK 1'
6195 else
6196 _joystick="no"
6197 res_comment="unsupported under $system_name"
6200 echores "$_joystick"
6202 echocheck "lirc"
6203 if test "$_lirc" = auto ; then
6204 _lirc=no
6205 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
6207 if test "$_lirc" = yes ; then
6208 def_lirc='#define CONFIG_LIRC 1'
6209 libs_mplayer="$libs_mplayer -llirc_client"
6210 else
6211 def_lirc='#undef CONFIG_LIRC'
6213 echores "$_lirc"
6215 echocheck "lircc"
6216 if test "$_lircc" = auto ; then
6217 _lircc=no
6218 header_check lirc/lircc.h -llircc && _lircc=yes
6220 if test "$_lircc" = yes ; then
6221 def_lircc='#define CONFIG_LIRCC 1'
6222 libs_mplayer="$libs_mplayer -llircc"
6223 else
6224 def_lircc='#undef CONFIG_LIRCC'
6226 echores "$_lircc"
6228 #############################################################################
6230 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
6232 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
6234 # This must be the last test to be performed. Any other tests following it
6235 # could fail due to linker errors. libdvdnavmini is intentionally not linked
6236 # against libdvdread (to permit MPlayer to use its own copy of the library).
6237 # So any compilation using the flags added here but not linking against
6238 # libdvdread can fail.
6239 echocheck "DVD support (libdvdnav)"
6240 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
6241 _dvdnav=no
6243 dvdnav_internal=no
6244 if test "$_dvdnav" = auto ; then
6245 if test "$_dvdread_internal" = yes ; then
6246 _dvdnav=yes
6247 dvdnav_internal=yes
6248 res_comment="internal"
6249 else
6250 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
6253 if test "$_dvdnav" = auto ; then
6254 _dvdnav=no
6255 _dvdnavdir=$($_dvdnavconfig --cflags)
6256 _dvdnavlibs=$($_dvdnavconfig --libs)
6257 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
6259 if test "$_dvdnav" = yes ; then
6260 def_dvdnav='#define CONFIG_DVDNAV 1'
6261 if test "$dvdnav_internal" = yes ; then
6262 cflags_libdvdnav="-Ilibdvdnav"
6263 inputmodules="dvdnav(internal) $inputmodules"
6264 else
6265 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
6266 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
6267 inputmodules="dvdnav $inputmodules"
6269 else
6270 def_dvdnav='#undef CONFIG_DVDNAV'
6271 noinputmodules="dvdnav $noinputmodules"
6273 echores "$_dvdnav"
6275 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
6276 # Read dvdnav comment above.
6278 mak_enable () {
6279 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6280 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6281 nprefix=$3;
6282 for part in $list; do
6283 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6284 echo "${nprefix}_$part = yes"
6286 done
6289 #############################################################################
6290 echo "Creating config.mak"
6291 cat > config.mak << EOF
6292 # -------- Generated by configure -----------
6294 # Ensure that locale settings do not interfere with shell commands.
6295 export LC_ALL = C
6297 CONFIGURATION = $configuration
6299 CHARSET = $_charset
6300 DOC_LANGS = $language_doc
6301 DOC_LANG_ALL = $doc_lang_all
6302 MAN_LANGS = $language_man
6303 MAN_LANG_ALL = $man_lang_all
6304 MSG_LANGS = $language_msg
6305 MSG_LANG_ALL = $msg_lang_all
6307 prefix = \$(DESTDIR)$_prefix
6308 BINDIR = \$(DESTDIR)$_bindir
6309 DATADIR = \$(DESTDIR)$_datadir
6310 LIBDIR = \$(DESTDIR)$_libdir
6311 MANDIR = \$(DESTDIR)$_mandir
6312 CONFDIR = \$(DESTDIR)$_confdir
6313 LOCALEDIR = \$(DESTDIR)$_localedir
6315 AR = $_ar
6316 AS = $_cc
6317 CC = $_cc
6318 CXX = $_cc
6319 HOST_CC = $_host_cc
6320 INSTALL = $_install
6321 INSTALLSTRIP = $_install_strip
6322 WINDRES = $_windres
6324 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
6325 CXXFLAGS = $WARNFLAGS $ERRORFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
6326 DEPFLAGS = $DEPFLAGS
6328 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
6329 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
6330 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
6331 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
6332 CFLAGS_STACKREALIGN = $cflags_stackrealign
6334 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
6335 EXTRALIBS_MPLAYER = $libs_mplayer
6337 GETCH = $_getch
6338 TIMER = $_timer
6340 EXESUF = $_exesuf
6341 EXESUFS_ALL = .exe
6343 ARCH = $arch
6344 $(mak_enable "$arch_all" "$arch" ARCH)
6345 $(mak_enable "$subarch_all" "$subarch" ARCH)
6346 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
6348 MPLAYER = $_mplayer
6350 NEED_GETTIMEOFDAY = $need_gettimeofday
6351 NEED_GLOB = $need_glob
6352 NEED_SETENV = $need_setenv
6353 NEED_SHMEM = $need_shmem
6354 NEED_STRSEP = $need_strsep
6355 NEED_SWAB = $need_swab
6356 NEED_VSSCANF = $need_vsscanf
6358 # features
6359 3DFX = $_3dfx
6360 AA = $_aa
6361 ALSA = $_alsa
6362 APPLE_IR = $_apple_ir
6363 APPLE_REMOTE = $_apple_remote
6364 ARTS = $_arts
6365 AUDIO_INPUT = $_audio_input
6366 BITMAP_FONT = $_bitmap_font
6367 BL = $_bl
6368 CACA = $_caca
6369 CDDA = $_cdda
6370 CDDB = $_cddb
6371 COCOA = $_cocoa
6372 COREAUDIO = $_coreaudio
6373 COREVIDEO = $_corevideo
6374 SHAREDBUFFER = $_sharedbuffer
6375 DGA = $_dga
6376 DIRECT3D = $_direct3d
6377 DIRECTFB = $_directfb
6378 DIRECTX = $_directx
6379 DVBIN = $_dvbin
6380 DVDNAV = $_dvdnav
6381 DVDNAV_INTERNAL = $dvdnav_internal
6382 DVDREAD = $_dvdread
6383 DVDREAD_INTERNAL = $_dvdread_internal
6384 DXR3 = $_dxr3
6385 ESD = $_esd
6386 FAAD = $_faad
6387 FASTMEMCPY = $_fastmemcpy
6388 FBDEV = $_fbdev
6389 FREETYPE = $_freetype
6390 FTP = $_ftp
6391 GIF = $_gif
6392 GGI = $_ggi
6393 GL = $_gl
6394 GL_COCOA = $_gl_cocoa
6395 GL_WIN32 = $_gl_win32
6396 GL_X11 = $_gl_x11
6397 GL_SDL = $_gl_sdl
6398 HAVE_POSIX_SELECT = $_posix_select
6399 HAVE_SYS_MMAN_H = $_mman
6400 IVTV = $_ivtv
6401 JACK = $_jack
6402 JOYSTICK = $_joystick
6403 JPEG = $_jpeg
6404 LADSPA = $_ladspa
6405 LIBA52 = $_liba52
6406 LIBASS = $_ass
6407 LIBBLURAY = $_bluray
6408 LIBBS2B = $_libbs2b
6409 LIBDCA = $_libdca
6410 LIBDV = $_libdv
6411 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
6412 LIBMAD = $_mad
6413 LIBNEMESI = $_nemesi
6414 LIBNUT = $_libnut
6415 LIBPOSTPROC = $libpostproc
6416 LIBSMBCLIENT = $_smb
6417 LIBTHEORA = $_theora
6418 LIRC = $_lirc
6419 LIVE555 = $_live
6420 MACOSX_FINDER = $_macosx_finder
6421 MD5SUM = $_md5sum
6422 MGA = $_mga
6423 MNG = $_mng
6424 MPG123 = $_mpg123
6425 MUSEPACK = $_musepack
6426 NAS = $_nas
6427 NATIVE_RTSP = $_native_rtsp
6428 NETWORKING = $networking
6429 OPENAL = $_openal
6430 OSS = $_ossaudio
6431 PE_EXECUTABLE = $_pe_executable
6432 PNG = $_png
6433 PNM = $_pnm
6434 PRIORITY = $_priority
6435 PULSE = $_pulse
6436 PVR = $_pvr
6437 QTX_CODECS = $_qtx
6438 QTX_CODECS_WIN32 = $_qtx_codecs_win32
6439 QTX_EMULATION = $_qtx_emulation
6440 RADIO=$_radio
6441 RADIO_CAPTURE=$_radio_capture
6442 REAL_CODECS = $_real
6443 RSOUND = $_rsound
6444 S3FB = $_s3fb
6445 SDL = $_sdl
6446 SPEEX = $_speex
6447 STREAM_CACHE = $_stream_cache
6448 SGIAUDIO = $_sgiaudio
6449 SUNAUDIO = $_sunaudio
6450 SVGA = $_svga
6451 TDFXFB = $_tdfxfb
6452 TDFXVID = $_tdfxvid
6453 TGA = $_tga
6454 TV = $_tv
6455 TV_BSDBT848 = $_tv_bsdbt848
6456 TV_DSHOW = $_tv_dshow
6457 TV_V4L = $_tv_v4l
6458 TV_V4L1 = $_tv_v4l1
6459 TV_V4L2 = $_tv_v4l2
6460 UNRAR_EXEC = $_unrar_exec
6461 V4L2 = $_v4l2
6462 VCD = $_vcd
6463 VDPAU = $_vdpau
6464 VESA = $_vesa
6465 VORBIS = $_vorbis
6466 VSTREAM = $_vstream
6467 WII = $_wii
6468 WIN32DLL = $_win32dll
6469 WIN32WAVEOUT = $_win32waveout
6470 WIN32_EMULATION = $_win32_emulation
6471 X11 = $_x11
6472 XANIM_CODECS = $_xanim
6473 XMGA = $_xmga
6474 XMMS_PLUGINS = $_xmms
6475 XV = $_xv
6476 XVID4 = $_xvid
6477 XVR100 = $_xvr100
6478 YUV4MPEG = $_yuv4mpeg
6480 # FFmpeg
6481 FFMPEG_INTERNALS = $ffmpeg_internals
6482 FFMPEG_SOURCE_PATH = $_ffmpeg_source
6484 RANLIB = $_ranlib
6485 YASM = $_yasm
6486 YASMFLAGS = $YASMFLAGS
6488 CONFIG_VDPAU = $_vdpau
6489 CONFIG_ZLIB = $_zlib
6491 HAVE_PTHREADS = $_pthreads
6492 HAVE_SHM = $_shm
6493 HAVE_W32THREADS = $_w32threads
6494 HAVE_YASM = $have_yasm
6498 #############################################################################
6500 ff_config_enable () {
6501 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6502 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6503 _nprefix=$3;
6504 test -z "$_nprefix" && _nprefix='CONFIG'
6505 for part in $list; do
6506 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6507 echo "#define ${_nprefix}_$part 1"
6508 else
6509 echo "#define ${_nprefix}_$part 0"
6511 done
6514 echo "Creating config.h"
6515 cat > $TMPH << EOF
6516 /*----------------------------------------------------------------------------
6517 ** This file has been automatically generated by configure any changes in it
6518 ** will be lost when you run configure again.
6519 ** Instead of modifying definitions here, use the --enable/--disable options
6520 ** of the configure script! See ./configure --help for details.
6521 *---------------------------------------------------------------------------*/
6523 #ifndef MPLAYER_CONFIG_H
6524 #define MPLAYER_CONFIG_H
6526 /* Undefine this if you do not want to select mono audio (left or right)
6527 with a stereo MPEG layer 2/3 audio stream. The command line option
6528 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6529 right-only), with 0 being the default.
6531 #define CONFIG_FAKE_MONO 1
6533 /* set up audio OUTBURST. Do not change this! */
6534 #define OUTBURST 512
6536 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
6537 #undef FAST_OSD
6538 #undef FAST_OSD_TABLE
6542 #define CONFIGURATION "$configuration"
6544 #define MPLAYER_DATADIR "$_datadir"
6545 #define MPLAYER_CONFDIR "$_confdir"
6546 #define MPLAYER_LOCALEDIR "$_localedir"
6548 $def_translation
6550 /* definitions needed by included libraries */
6551 #define HAVE_INTTYPES_H 1
6552 /* libdvdcss */
6553 #define HAVE_ERRNO_H 1
6554 /* libdvdcss + libdvdread */
6555 #define HAVE_LIMITS_H 1
6556 /* libdvdcss */
6557 #define HAVE_UNISTD_H 1
6558 /* libdvdread */
6559 #define STDC_HEADERS 1
6560 #define HAVE_MEMCPY 1
6561 /* libdvdnav */
6562 #define READ_CACHE_TRACE 0
6563 /* libdvdread */
6564 #define HAVE_DLFCN_H 1
6565 $def_dvdcss
6568 /* system headers */
6569 $def_alloca_h
6570 $def_altivec_h
6571 $def_malloc_h
6572 $def_mman_h
6573 $def_mman_has_map_failed
6574 $def_soundcard_h
6575 $def_sys_soundcard_h
6576 $def_sys_sysinfo_h
6577 $def_sys_videoio_h
6578 $def_termios_h
6579 $def_termios_sys_h
6580 $def_winsock2_h
6583 /* system functions */
6584 $def_gethostbyname2
6585 $def_gettimeofday
6586 $def_glob
6587 $def_langinfo
6588 $def_lrintf
6589 $def_map_memalign
6590 $def_memalign
6591 $def_nanosleep
6592 $def_posix_select
6593 $def_select
6594 $def_setenv
6595 $def_setmode
6596 $def_shm
6597 $def_strsep
6598 $def_swab
6599 $def_sysi86
6600 $def_sysi86_iv
6601 $def_termcap
6602 $def_termios
6603 $def_vsscanf
6606 /* system-specific features */
6607 $def_asmalign_pot
6608 $def_builtin_expect
6609 $def_dl
6610 $def_dos_paths
6611 $def_extern_asm
6612 $def_extern_prefix
6613 $def_iconv
6614 $def_kstat
6615 $def_macosx_bundle
6616 $def_macosx_finder
6617 $def_priority
6618 $def_quicktime
6619 $def_restrict_keyword
6620 $def_rtc
6621 $def_unrar_exec
6624 /* configurable options */
6625 $def_charset
6626 $def_crash_debug
6627 $def_debug
6628 $def_fastmemcpy
6629 $def_runtime_cpudetection
6630 $def_sighandler
6631 $def_sortsub
6632 $def_stream_cache
6633 $def_pthread_cache
6636 /* CPU stuff */
6637 #define __CPU__ $iproc
6638 $def_ebx_available
6639 $def_words_endian
6640 $def_bigendian
6641 $(ff_config_enable "$arch_all" "$arch" "ARCH")
6642 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
6643 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
6646 /* Blu-ray/DVD/VCD/CD */
6647 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
6648 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
6649 $def_bluray
6650 $def_bsdi_dvd
6651 $def_cdda
6652 $def_cddb
6653 $def_cdio
6654 $def_cdrom
6655 $def_dvd
6656 $def_dvd_bsd
6657 $def_dvd_darwin
6658 $def_dvd_linux
6659 $def_dvd_openbsd
6660 $def_dvdio
6661 $def_dvdnav
6662 $def_dvdread
6663 $def_hpux_scsi_h
6664 $def_sol_scsi_h
6665 $def_vcd
6668 /* codec libraries */
6669 $def_faad
6670 $def_liba52
6671 $def_libdca
6672 $def_libdv
6673 $def_mad
6674 $def_mpg123
6675 $def_musepack
6676 $def_speex
6677 $def_theora
6678 $def_tremor
6679 $def_vorbis
6680 $def_xvid
6681 $def_zlib
6683 $def_libpostproc
6684 $def_libnut
6687 /* binary codecs */
6688 $def_qtx
6689 $def_qtx_win32
6690 $def_real
6691 $def_win32_loader
6692 $def_win32dll
6693 $def_xanim
6694 $def_xmms
6695 #define BINARY_CODECS_PATH "$_codecsdir"
6696 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
6699 /* Audio output drivers */
6700 $def_alsa
6701 $def_arts
6702 $def_coreaudio
6703 $def_esd
6704 $def_esd_latency
6705 $def_jack
6706 $def_nas
6707 $def_openal
6708 $def_openal_h
6709 $def_ossaudio
6710 $def_ossaudio_devdsp
6711 $def_ossaudio_devmixer
6712 $def_pulse
6713 $def_rsound
6714 $def_sgiaudio
6715 $def_sunaudio
6716 $def_win32waveout
6718 $def_ladspa
6719 $def_libbs2b
6722 /* input */
6723 $def_apple_ir
6724 $def_apple_remote
6725 $def_ioctl_bt848_h_name
6726 $def_ioctl_meteor_h_name
6727 $def_joystick
6728 $def_lirc
6729 $def_lircc
6730 $def_pvr
6731 $def_radio
6732 $def_radio_bsdbt848
6733 $def_radio_capture
6734 $def_radio_v4l
6735 $def_radio_v4l2
6736 $def_tv
6737 $def_tv_bsdbt848
6738 $def_tv_dshow
6739 $def_tv_v4l
6740 $def_tv_v4l1
6741 $def_tv_v4l2
6744 /* font stuff */
6745 $def_ass
6746 $def_bitmap_font
6747 $def_enca
6748 $def_fontconfig
6749 $def_freetype
6750 $def_fribidi
6753 /* networking */
6754 $def_closesocket
6755 $def_ftp
6756 $def_inet6
6757 $def_inet_aton
6758 $def_inet_pton
6759 $def_live
6760 $def_nemesi
6761 $def_networking
6762 $def_smb
6763 $def_socklen_t
6764 $def_vstream
6767 /* libvo options */
6768 $def_3dfx
6769 $def_aa
6770 $def_bl
6771 $def_caca
6772 $def_corevideo
6773 $def_cocoa
6774 $def_sharedbuffer
6775 $def_dga
6776 $def_dga1
6777 $def_dga2
6778 $def_direct3d
6779 $def_directfb
6780 $def_directx
6781 $def_dvb
6782 $def_dvbin
6783 $def_dxr3
6784 $def_fbdev
6785 $def_ggi
6786 $def_ggiwmh
6787 $def_gif
6788 $def_gif_4
6789 $def_gif_tvt_hack
6790 $def_gl
6791 $def_gl_cocoa
6792 $def_gl_win32
6793 $def_gl_x11
6794 $def_gl_sdl
6795 $def_ivtv
6796 $def_jpeg
6797 $def_md5sum
6798 $def_mga
6799 $def_mng
6800 $def_png
6801 $def_pnm
6802 $def_s3fb
6803 $def_sdl
6804 $def_sdl_sdl_h
6805 $def_svga
6806 $def_tdfxfb
6807 $def_tdfxvid
6808 $def_tga
6809 $def_v4l2
6810 $def_vdpau
6811 $def_vesa
6812 $def_vm
6813 $def_wii
6814 $def_x11
6815 $def_xdpms
6816 $def_xf86keysym
6817 $def_xinerama
6818 $def_xmga
6819 $def_xss
6820 $def_xv
6821 $def_xvr100
6822 $def_yuv4mpeg
6825 /* FFmpeg */
6826 $def_ffmpeg_internals
6828 $def_arpa_inet_h
6829 $def_bswap
6830 $def_dcbzl
6831 $def_exp2
6832 $def_exp2f
6833 $def_fast_64bit
6834 $def_fast_unaligned
6835 $def_llrint
6836 $def_log2
6837 $def_log2f
6838 $def_lrint
6839 $def_memalign_hack
6840 $def_mkstemp
6841 $def_posix_memalign
6842 $def_pthreads
6843 $def_round
6844 $def_roundf
6845 $def_threads
6846 $def_truncf
6847 $def_xform_asm
6848 $def_yasm
6850 #define HAVE_INLINE_ASM 1
6852 /* Use these registers in x86 inline asm. No proper detection yet. */
6853 #define HAVE_EBP_AVAILABLE 1
6855 #endif /* MPLAYER_CONFIG_H */
6858 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6859 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
6861 #############################################################################
6863 cat << EOF
6865 Config files successfully generated by ./configure $configuration !
6867 Install prefix: $_prefix
6868 Data directory: $_datadir
6869 Config direct.: $_confdir
6871 Byte order: $_byte_order
6872 Optimizing for: $_optimizing
6874 Languages:
6875 Messages (in addition to English): $language_msg
6876 Manual pages: $language_man
6877 Documentation: $language_doc
6879 Enabled optional drivers:
6880 Input: $inputmodules
6881 Codecs: $codecmodules
6882 Audio output: $aomodules
6883 Video output: $vomodules
6885 Disabled optional drivers:
6886 Input: $noinputmodules
6887 Codecs: $nocodecmodules
6888 Audio output: $noaomodules
6889 Video output: $novomodules
6891 'config.h' and 'config.mak' contain your configuration options.
6892 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6893 compile *** DO NOT REPORT BUGS if you tweak these files ***
6895 'make' will now compile MPlayer and 'make install' will install it.
6896 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6901 cat <<EOF
6902 Check $TMPLOG if you wonder why an autodetection failed (make sure
6903 development headers/packages are installed).
6905 NOTE: The --enable-* parameters unconditionally force options on, completely
6906 skipping autodetection. This behavior is unlike what you may be used to from
6907 autoconf-based configure scripts that can decide to override you. This greater
6908 level of control comes at a price. You may have to provide the correct compiler
6909 and linker flags yourself.
6910 If you used one of these options (except --enable-runtime-cpudetection and
6911 similar ones that turn on internal features) and experience a compilation or
6912 linking failure, make sure you have passed the necessary compiler/linker flags
6913 to configure.
6915 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6919 if test "$warn_cflags" = yes; then
6920 cat <<EOF
6922 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6923 but:
6925 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6927 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6928 To do so, execute 'CFLAGS= ./configure <options>'
6933 # Last move:
6934 rm -rf "$mplayer_tmpdir"