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