libav #include changes for latest upstream compatibility
[mplayer.git] / configure
blob5c1e288c423942cc7c18094834824e8872485814
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: Check the Subversion log.
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, look at the existing checks
23 # and try to use helper functions where you can.
25 # Furthermore you need to add the variable _feature to the list of default
26 # settings and set it to one of yes/no/auto. Also add appropriate
27 # --enable-feature/--disable-feature command line options.
28 # The results of the check should be written to config.h and config.mak
29 # at the end of this script. The variable names used for this should be
30 # uniform, i.e. if the option is named 'feature':
32 # _feature : should have a value of yes/no/auto
33 # def_feature : '#define ... 1' or '#undef ...' for conditional compilation
34 # _ld_feature : '-L/path/dir -lfeature' GCC options
36 #############################################################################
38 # Prevent locale nonsense from breaking basic text processing utils
39 export LC_ALL=C
41 # Store the configure line that was used
42 configuration="$*"
44 # Prefer these macros to full length text !
45 # These macros only return an error code - NO display is done
46 compile_check() {
47 source="$1"
48 shift
49 echo >> "$TMPLOG"
50 cat "$source" >> "$TMPLOG"
51 echo >> "$TMPLOG"
52 echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
53 rm -f "$TMPEXE"
54 $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
55 TMPRES="$?"
56 echo >> "$TMPLOG"
57 echo >> "$TMPLOG"
58 return "$TMPRES"
61 cc_check() {
62 compile_check $TMPC $@
65 cxx_check() {
66 compile_check $TMPCPP $@ -lstdc++
69 cflag_check() {
70 cat > $TMPC << EOF
71 int main(void) { return 0; }
72 EOF
73 compile_check $TMPC $@
76 header_check() {
77 cat > $TMPC << EOF
78 #include <$1>
79 int main(void) { return 0; }
80 EOF
81 shift
82 compile_check $TMPC $@
85 return_check() {
86 cat > $TMPC << EOF
87 #include <$1>
88 int main(void) { return $2; }
89 EOF
90 shift 2
91 compile_check $TMPC $@
94 statement_check() {
95 cat > $TMPC << EOF
96 #include <$1>
97 int main(void) { $2; return 0; }
98 EOF
99 shift
100 shift
101 compile_check $TMPC $@
104 define_statement_check() {
105 cat > $TMPC << EOF
106 #define $1
107 #include <$2>
108 int main(void) { $3; return 0; }
110 shift 3
111 compile_check $TMPC $@
114 return_statement_check() {
115 cat > $TMPC << EOF
116 #include <$1>
117 int main(void) { $2; return $3; }
119 shift 3
120 compile_check $TMPC $@
123 inline_asm_check() {
124 cat > $TMPC << EOF
125 int main(void) { __asm__ volatile ($1); return 0; }
127 shift
128 compile_check $TMPC $@
131 # The following checks are special and should only be used with broken and
132 # non-selfsufficient headers that do not include all of their dependencies.
134 header_check_broken() {
135 cat > $TMPC << EOF
136 #include <$1>
137 #include <$2>
138 int main(void) { return 0; }
140 shift
141 shift
142 compile_check $TMPC $@
145 statement_check_broken() {
146 cat > $TMPC << EOF
147 #include <$1>
148 #include <$2>
149 int main(void) { $3; return 0; }
151 shift 3
152 compile_check $TMPC $@
155 yasm_check() {
156 echo >> "$TMPLOG"
157 cat "$TMPS" >> "$TMPLOG"
158 echo >> "$TMPLOG"
159 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
160 rm -f "$TMPEXE"
161 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
162 TMPRES="$?"
163 echo >> "$TMPLOG"
164 echo >> "$TMPLOG"
165 return "$TMPRES"
168 pkg_config_add() {
169 unset IFS # shell should not be used for programming
170 echo >> "$TMPLOG"
171 echo "$_pkg_config --cflags $@" >> "$TMPLOG"
172 ctmp=$($_pkg_config --cflags "$@" 2>> "$TMPLOG") || return $?
173 echo >> "$TMPLOG"
174 echo "$_pkg_config --libs $@" >> "$TMPLOG"
175 ltmp=$($_pkg_config --libs "$@" 2>> "$TMPLOG") || return $?
176 echo >> "$TMPLOG"
177 echo "cflags: $ctmp" >> "$TMPLOG"
178 echo "libs: $ltmp" >> "$TMPLOG"
179 echo >> "$TMPLOG"
180 extra_cflags="$extra_cflags $ctmp"
181 extra_ldflags="$extra_ldflags $ltmp"
184 tmp_run() {
185 "$TMPEXE" >> "$TMPLOG" 2>&1
188 # Display error message, flushes tempfile, exit
189 die () {
190 echo
191 echo "Error: $@" >&2
192 echo >&2
193 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
194 echo "Check \"$TMPLOG\" if you do not understand why it failed."
195 exit 1
198 # OS test booleans functions
199 issystem() {
200 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
202 aix() { issystem "AIX"; }
203 amigaos() { issystem "AmigaOS"; }
204 beos() { issystem "BEOS"; }
205 bsdos() { issystem "BSD/OS"; }
206 cygwin() { issystem "CYGWIN"; }
207 darwin() { issystem "Darwin"; }
208 dragonfly() { issystem "DragonFly"; }
209 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
210 gnu() { issystem "GNU"; }
211 hpux() { issystem "HP-UX"; }
212 linux() { issystem "Linux"; }
213 mingw32() { issystem "MINGW32"; }
214 morphos() { issystem "MorphOS"; }
215 netbsd() { issystem "NetBSD"; }
216 openbsd() { issystem "OpenBSD"; }
217 qnx() { issystem "QNX"; }
218 sunos() { issystem "SunOS"; }
219 win32() { cygwin || mingw32; }
221 # arch test boolean functions
222 # x86/x86pc is used by QNX
223 x86_32() {
224 case "$host_arch" in
225 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
226 *) return 1 ;;
227 esac
230 x86_64() {
231 case "$host_arch" in
232 x86_64|amd64) return 0 ;;
233 *) return 1 ;;
234 esac
237 x86() {
238 x86_32 || x86_64
241 ppc() {
242 case "$host_arch" in
243 ppc|ppc64|powerpc|powerpc64) return 0;;
244 *) return 1;;
245 esac
248 alpha() {
249 case "$host_arch" in
250 alpha*) return 0;;
251 *) return 1;;
252 esac
255 arm() {
256 case "$host_arch" in
257 arm*) return 0;;
258 *) return 1;;
259 esac
262 # Use this before starting a check
263 echocheck() {
264 echo "============ Checking for $@ ============" >> "$TMPLOG"
265 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
268 # Use this to echo the results of a check
269 echores() {
270 if test "$res_comment" ; then
271 res_comment="($res_comment)"
273 echo "Result is: $@ $res_comment" >> "$TMPLOG"
274 echo "##########################################" >> "$TMPLOG"
275 echo "" >> "$TMPLOG"
276 echo "$@ $res_comment"
277 res_comment=""
279 #############################################################################
281 # Check how echo works in this /bin/sh
282 case $(echo -n) in
283 -n) _echo_n= _echo_c='\c' ;; # SysV echo
284 *) _echo_n='-n ' _echo_c= ;; # BSD echo
285 esac
287 msg_lang_all=''
288 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
289 man_lang_all=$(echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g")
290 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
292 show_help(){
293 cat << EOF
294 Usage: $0 [OPTIONS]...
296 Configuration:
297 -h, --help display this help and exit
299 Installation directories:
300 --prefix=DIR prefix directory for installation [/usr/local]
301 --bindir=DIR directory for installing binaries [PREFIX/bin]
302 --datadir=DIR directory for installing machine independent
303 data files (skins, etc) [PREFIX/share/mplayer]
304 --mandir=DIR directory for installing man pages [PREFIX/share/man]
305 --confdir=DIR directory for installing configuration files
306 [PREFIX/etc/mplayer]
307 --localedir=DIR directory for locale tree [PREFIX/share/locale]
308 --libdir=DIR directory for object code libraries [PREFIX/lib]
309 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
311 Optional features:
312 --disable-mplayer disable MPlayer compilation [enable]
313 --enable-termcap use termcap database for key codes [autodetect]
314 --enable-termios use termios database for key codes [autodetect]
315 --disable-iconv disable iconv for encoding conversion [autodetect]
316 --disable-langinfo do not use langinfo [autodetect]
317 --enable-lirc enable LIRC (remote control) support [autodetect]
318 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
319 --enable-joystick enable joystick support [disable]
320 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
321 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
322 --disable-vm disable X video mode extensions [autodetect]
323 --disable-xf86keysym disable support for multimedia keys [autodetect]
324 --enable-radio enable radio interface [disable]
325 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
326 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
327 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
328 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
329 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
330 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
331 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
332 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
333 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
334 --disable-networking disable networking [enable]
335 --enable-winsock2_h enable winsock2_h [autodetect]
336 --enable-smb enable Samba (SMB) input [autodetect]
337 --enable-live enable LIVE555 Streaming Media [disable]
338 --enable-nemesi enable Nemesi Streaming Media [autodetect]
339 --disable-vcd disable VCD support [autodetect]
340 --disable-bluray disable Blu-ray support [autodetect]
341 --disable-dvdnav disable libdvdnav [autodetect]
342 --disable-dvdread disable libdvdread [autodetect]
343 --disable-dvdread-internal disable internal libdvdread [autodetect]
344 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
345 --disable-cddb disable cddb [autodetect]
346 --disable-bitmap-font disable bitmap font support [enable]
347 --disable-freetype disable FreeType 2 font rendering [autodetect]
348 --disable-fontconfig disable fontconfig font lookup [autodetect]
349 --disable-unrarexec disable using of UnRAR executable [enabled]
350 --disable-sortsub disable subtitle sorting [enabled]
351 --enable-fribidi enable the FriBiDi libs [autodetect]
352 --disable-enca disable ENCA charset oracle library [autodetect]
353 --enable-macosx-finder enable Mac OS X Finder invocation parameter
354 parsing [disabled]
355 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
356 --disable-inet6 disable IPv6 support [autodetect]
357 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
358 --disable-ftp disable FTP support [enabled]
359 --disable-vstream disable TiVo vstream client support [autodetect]
360 --disable-pthreads disable Posix threads support [autodetect]
361 --disable-w32threads disable Win32 threads support [autodetect]
362 --disable-libass disable subtitle rendering with libass [autodetect]
363 --enable-rpath enable runtime linker path for extra libs [disabled]
364 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
366 Codecs:
367 --enable-gif enable GIF support [autodetect]
368 --enable-png enable PNG input/output support [autodetect]
369 --enable-mng enable MNG input support [autodetect]
370 --enable-jpeg enable JPEG input/output support [autodetect]
371 --enable-libcdio enable libcdio support [autodetect]
372 --disable-win32dll disable Win32 DLL support [autodetect]
373 --disable-qtx disable QuickTime codecs support [enabled]
374 --disable-xanim disable XAnim codecs support [enabled]
375 --disable-real disable RealPlayer codecs support [enabled]
376 --disable-xvid disable Xvid [autodetect]
377 --disable-libnut disable libnut [autodetect]
378 --enable-libav skip Libav autodetection [autodetect]
379 --disable-libvorbis disable libvorbis support [autodetect]
380 --disable-tremor disable Tremor [autodetect if no libvorbis]
381 --disable-speex disable Speex support [autodetect]
382 --enable-theora enable OggTheora libraries [autodetect]
383 --enable-faad enable FAAD2 (AAC) [autodetect]
384 --disable-ladspa disable LADSPA plugin support [autodetect]
385 --disable-libbs2b disable libbs2b audio filter support [autodetect]
386 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
387 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
388 --disable-mad disable libmad (MPEG audio) support [autodetect]
389 --enable-xmms enable XMMS input plugin support [disabled]
390 --enable-libdca enable libdca support [autodetect]
391 --disable-liba52 disable liba52 [autodetect]
392 --enable-musepack enable libmpcdec support (deprecated, libavcodec
393 Musepack decoder is preferred) [disabled]
395 Video output:
396 --enable-gl enable OpenGL video output [autodetect]
397 --enable-dga2 enable DGA 2 support [autodetect]
398 --enable-dga1 enable DGA 1 support [autodetect]
399 --enable-vesa enable VESA video output [autodetect]
400 --enable-svga enable SVGAlib video output [autodetect]
401 --enable-sdl enable SDL video output [autodetect]
402 --enable-aa enable AAlib video output [autodetect]
403 --enable-caca enable CACA video output [autodetect]
404 --enable-ggi enable GGI video output [autodetect]
405 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
406 --enable-direct3d enable Direct3D video output [autodetect]
407 --enable-directx enable DirectX video output [autodetect]
408 --enable-dxr3 enable DXR3/H+ video output [autodetect]
409 --enable-ivtv enable IVTV TV-Out video output [autodetect]
410 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
411 --enable-dvb enable DVB video output [autodetect]
412 --enable-mga enable mga_vid video output [autodetect]
413 --enable-xmga enable mga_vid X11 video output [autodetect]
414 --enable-xv enable Xv video output [autodetect]
415 --enable-vdpau enable VDPAU acceleration [autodetect]
416 --enable-vm enable XF86VidMode support [autodetect]
417 --enable-xinerama enable Xinerama support [autodetect]
418 --enable-x11 enable X11 video output [autodetect]
419 --enable-xshape enable XShape support [autodetect]
420 --disable-xss disable screensaver support via xss [autodetect]
421 --enable-fbdev enable FBDev video output [autodetect]
422 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
423 --enable-tdfxfb enable tdfxfb video output [disable]
424 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
425 --enable-wii enable Nintendo Wii/GameCube video output [disable]
426 --enable-directfb enable DirectFB video output [autodetect]
427 --enable-bl enable Blinkenlights video output [disable]
428 --enable-tdfxvid enable tdfx_vid video output [disable]
429 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
430 --disable-tga disable Targa video output [enable]
431 --disable-pnm disable PNM video output [enable]
432 --disable-md5sum disable md5sum video output [enable]
433 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
434 --disable-corevideo disable CoreVideo video output [autodetect]
435 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
436 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
438 Audio output:
439 --disable-alsa disable ALSA audio output [autodetect]
440 --disable-ossaudio disable OSS audio output [autodetect]
441 --disable-rsound disable RSound audio output [autodetect]
442 --disable-pulse disable Pulseaudio audio output [autodetect]
443 --disable-portaudio disable PortAudio audio output [autodetect]
444 --disable-jack disable JACK audio output [autodetect]
445 --enable-openal enable OpenAL audio output [disable]
446 --disable-nas disable NAS audio output [autodetect]
447 --disable-sunaudio disable Sun audio output [autodetect]
448 --disable-win32waveout disable Windows waveout audio output [autodetect]
449 --disable-coreaudio disable CoreAudio audio output [autodetect]
450 --disable-select disable using select() on the audio device [enable]
452 Language options:
453 --enable-translation enable support for translated output [disable]
454 --charset=charset convert the console messages to this character set
455 --language-doc=lang language to use for the documentation [en]
456 --language-man=lang language to use for the man pages [en]
457 --language-msg=lang extra languages for program messages [all]
458 --language=lang default language to use [en]
459 Specific options override --language. You can pass a list of languages separated
460 by whitespace or commas instead of a single language. Nonexisting translations
461 will be dropped from each list. All translations available in the list will be
462 installed. The value "all" will activate all translations. The LINGUAS
463 environment variable is honored. In all cases the fallback is English.
464 The program always supports English-language output; additional message
465 languages are only installed if --enable-translation is also specified.
466 Available values for --language-doc are: all $doc_lang_all
467 Available values for --language-man are: all $man_lang_all
468 Available values for --language-msg are: all $msg_lang_all
470 Miscellaneous options:
471 --enable-runtime-cpudetection enable runtime CPU detection [disable]
472 --enable-cross-compile enable cross-compilation [disable]
473 --cc=COMPILER C compiler to build MPlayer [gcc]
474 --as=ASSEMBLER assembler to build MPlayer [as]
475 --nm=NM nm tool to build MPlayer [nm]
476 --yasm=YASM Yasm assembler to build MPlayer [yasm]
477 --ar=AR librarian to build MPlayer [ar]
478 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
479 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
480 --windres=WINDRES windres to build MPlayer [windres]
481 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
482 --enable-static build a statically linked binary
483 --with-install=PATH path to a custom install program
485 Advanced options:
486 --enable-mmx enable MMX [autodetect]
487 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
488 --enable-3dnow enable 3DNow! [autodetect]
489 --enable-3dnowext enable extended 3DNow! [autodetect]
490 --enable-sse enable SSE [autodetect]
491 --enable-sse2 enable SSE2 [autodetect]
492 --enable-ssse3 enable SSSE3 [autodetect]
493 --enable-shm enable shm [autodetect]
494 --enable-altivec enable AltiVec (PowerPC) [autodetect]
495 --enable-armv5te enable DSP extensions (ARM) [autodetect]
496 --enable-armv6 enable ARMv6 (ARM) [autodetect]
497 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
498 --enable-armvfp enable ARM VFP (ARM) [autodetect]
499 --enable-neon enable NEON (ARM) [autodetect]
500 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
501 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
502 --enable-big-endian force byte order to big-endian [autodetect]
503 --enable-debug[=1-3] compile-in debugging information [disable]
504 --enable-profile compile-in profiling information [disable]
505 --disable-sighandler disable sighandler for crashes [enable]
506 --enable-crash-debug enable automatic gdb attach on crash [disable]
508 Use these options if autodetection fails:
509 --extra-cflags=FLAGS extra CFLAGS
510 --extra-ldflags=FLAGS extra LDFLAGS
511 --extra-libs=FLAGS extra linker flags
512 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
514 --with-sdl-config=PATH path to sdl*-config
515 --with-dvdnav-config=PATH path to dvdnav-config
516 --with-dvdread-config=PATH path to dvdread-config
518 This configure script is NOT autoconf-based, even though its output is similar.
519 It will try to autodetect all configuration options. If you --enable an option
520 it will be forcefully turned on, skipping autodetection. This can break
521 compilation, so you need to know what you are doing.
523 exit 0
524 } #show_help()
526 # GOTCHA: the variables below defines the default behavior for autodetection
527 # and have - unless stated otherwise - at least 2 states : yes no
528 # If autodetection is available then the third state is: auto
529 _mmx=auto
530 _3dnow=auto
531 _3dnowext=auto
532 _mmxext=auto
533 _sse=auto
534 _sse2=auto
535 _ssse3=auto
536 _cmov=auto
537 _fast_cmov=auto
538 _fast_clz=auto
539 _armv5te=auto
540 _armv6=auto
541 _armv6t2=auto
542 _armvfp=auto
543 neon=auto
544 _iwmmxt=auto
545 _altivec=auto
546 _install=install
547 _pkg_config=auto
548 _ranlib=auto
549 _windres=auto
550 _cc=auto
551 _ar=auto
552 test "$CC" && _cc="$CC"
553 _as=auto
554 _nm=auto
555 _yasm=auto
556 _runtime_cpudetection=no
557 _cross_compile=no
558 _prefix="/usr/local"
559 ffmpeg=auto
560 ffmpeg_internals=no
561 _mplayer=yes
562 _x11=auto
563 _xshape=auto
564 _xss=auto
565 _dga1=auto
566 _dga2=auto
567 _xv=auto
568 _vdpau=auto
569 _sdl=auto
570 _direct3d=auto
571 _directx=auto
572 _win32waveout=auto
573 _nas=auto
574 _png=auto
575 _mng=auto
576 _jpeg=auto
577 _pnm=yes
578 _md5sum=yes
579 _yuv4mpeg=yes
580 _gif=auto
581 _gl=auto
582 _ggi=auto
583 _ggiwmh=auto
584 _aa=auto
585 _caca=auto
586 _svga=auto
587 _vesa=auto
588 _fbdev=auto
589 _dvb=auto
590 _dxr3=auto
591 _ivtv=auto
592 _v4l2=auto
593 _iconv=auto
594 _langinfo=auto
595 _rtc=auto
596 _ossaudio=auto
597 _rsound=auto
598 _pulse=auto
599 _portaudio=auto
600 _jack=auto
601 _openal=no
602 _libcdio=auto
603 _mad=auto
604 _tremor=auto
605 _libvorbis=auto
606 _speex=auto
607 _theora=auto
608 _mpg123=auto
609 _liba52=auto
610 _libdca=auto
611 _faad=auto
612 _ladspa=auto
613 _libbs2b=auto
614 _xmms=no
615 _vcd=auto
616 _bluray=auto
617 _dvdnav=auto
618 _dvdnavconfig=dvdnav-config
619 _dvdreadconfig=dvdread-config
620 _dvdread=auto
621 _dvdread_internal=auto
622 _libdvdcss_internal=auto
623 _xanim=auto
624 _real=auto
625 _live=no
626 _nemesi=auto
627 _native_rtsp=yes
628 _xinerama=auto
629 _mga=auto
630 _xmga=auto
631 _vm=auto
632 _xf86keysym=auto
633 _sunaudio=auto
634 _alsa=auto
635 _fastmemcpy=yes
636 _unrar_exec=auto
637 _win32dll=auto
638 _select=yes
639 _radio=no
640 _radio_capture=no
641 _radio_v4l=auto
642 _radio_v4l2=auto
643 _radio_bsdbt848=auto
644 _tv=yes
645 _tv_v4l1=auto
646 _tv_v4l2=auto
647 _tv_bsdbt848=auto
648 _tv_dshow=auto
649 _pvr=auto
650 networking=yes
651 _winsock2_h=auto
652 _smb=auto
653 _joystick=no
654 _xvid=auto
655 _libnut=auto
656 _lirc=auto
657 _lircc=auto
658 _apple_remote=auto
659 _apple_ir=auto
660 _termcap=auto
661 _termios=auto
662 _3dfx=no
663 _s3fb=no
664 _wii=no
665 _tdfxfb=no
666 _tdfxvid=no
667 _xvr100=auto
668 _tga=yes
669 _directfb=auto
670 _bl=no
671 #language=en
672 _shm=auto
673 _translation=no
674 _charset="UTF-8"
675 _crash_debug=no
676 _sighandler=yes
677 _libdv=auto
678 _cdda=auto
679 _cddb=auto
680 _big_endian=auto
681 _bitmap_font=yes
682 _freetype=auto
683 _fontconfig=auto
684 _qtx=auto
685 _coreaudio=auto
686 _corevideo=auto
687 _cocoa=auto
688 _sharedbuffer=auto
689 quicktime=auto
690 _macosx_finder=no
691 _macosx_bundle=auto
692 _sortsub=yes
693 _fribidi=auto
694 _enca=auto
695 _inet6=auto
696 _gethostbyname2=auto
697 _ftp=auto
698 _musepack=no
699 _vstream=auto
700 _pthreads=auto
701 _w32threads=auto
702 _ass=auto
703 _rpath=no
704 libpostproc=auto
705 _asmalign_pot=auto
706 _stream_cache=yes
707 _priority=no
708 def_dos_paths="#define HAVE_DOS_PATHS 0"
709 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
710 def_priority="#undef CONFIG_PRIORITY"
711 def_pthread_cache="#undef PTHREAD_CACHE"
712 need_shmem=yes
713 for ac_option do
714 case "$ac_option" in
715 --help|-help|-h)
716 show_help
718 --prefix=*)
719 _prefix=$(echo $ac_option | cut -d '=' -f 2)
721 --bindir=*)
722 _bindir=$(echo $ac_option | cut -d '=' -f 2)
724 --datadir=*)
725 _datadir=$(echo $ac_option | cut -d '=' -f 2)
727 --mandir=*)
728 _mandir=$(echo $ac_option | cut -d '=' -f 2)
730 --confdir=*)
731 _confdir=$(echo $ac_option | cut -d '=' -f 2)
733 --libdir=*)
734 _libdir=$(echo $ac_option | cut -d '=' -f 2)
736 --codecsdir=*)
737 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
739 --localedir=*)
740 _localedir=$(echo $ac_option | cut -d '=' -f 2)
743 --with-install=*)
744 _install=$(echo $ac_option | cut -d '=' -f 2 )
747 --with-sdl-config=*)
748 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
750 --with-dvdnav-config=*)
751 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
753 --with-dvdread-config=*)
754 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
757 --extra-cflags=*)
758 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
760 --extra-ldflags=*)
761 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
763 --extra-libs=*)
764 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
766 --extra-libs-mplayer=*)
767 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
770 --target=*)
771 _target=$(echo $ac_option | cut -d '=' -f 2)
773 --cc=*)
774 _cc=$(echo $ac_option | cut -d '=' -f 2)
776 --as=*)
777 _as=$(echo $ac_option | cut -d '=' -f 2)
779 --nm=*)
780 _nm=$(echo $ac_option | cut -d '=' -f 2)
782 --yasm=*)
783 _yasm=$(echo $ac_option | cut -d '=' -f 2)
785 --ar=*)
786 _ar=$(echo $ac_option | cut -d '=' -f 2)
788 --pkg-config=*)
789 _pkg_config=$(echo $ac_option | cut -d '=' -f 2)
791 --ranlib=*)
792 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
794 --windres=*)
795 _windres=$(echo $ac_option | cut -d '=' -f 2)
797 --charset=*)
798 _charset=$(echo $ac_option | cut -d '=' -f 2)
800 --language-doc=*)
801 language_doc=$(echo $ac_option | cut -d '=' -f 2)
803 --language-man=*)
804 language_man=$(echo $ac_option | cut -d '=' -f 2)
806 --language-msg=*)
807 language_msg=$(echo $ac_option | cut -d '=' -f 2)
809 --language=*)
810 language=$(echo $ac_option | cut -d '=' -f 2)
813 --enable-static)
814 _ld_static='-static'
816 --disable-static)
817 _ld_static=''
819 --enable-profile)
820 _profile='-p'
822 --disable-profile)
823 _profile=
825 --enable-debug)
826 _debug='-g'
828 --enable-debug=*)
829 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
831 --disable-debug)
832 _debug=
834 --enable-translation) _translation=yes ;;
835 --disable-translation) _translation=no ;;
836 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
837 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
838 --enable-cross-compile) _cross_compile=yes ;;
839 --disable-cross-compile) _cross_compile=no ;;
840 --enable-mplayer) _mplayer=yes ;;
841 --disable-mplayer) _mplayer=no ;;
842 --enable-x11) _x11=yes ;;
843 --disable-x11) _x11=no ;;
844 --enable-xshape) _xshape=yes ;;
845 --disable-xshape) _xshape=no ;;
846 --enable-xss) _xss=yes ;;
847 --disable-xss) _xss=no ;;
848 --enable-xv) _xv=yes ;;
849 --disable-xv) _xv=no ;;
850 --enable-vdpau) _vdpau=yes ;;
851 --disable-vdpau) _vdpau=no ;;
852 --enable-sdl) _sdl=yes ;;
853 --disable-sdl) _sdl=no ;;
854 --enable-direct3d) _direct3d=yes ;;
855 --disable-direct3d) _direct3d=no ;;
856 --enable-directx) _directx=yes ;;
857 --disable-directx) _directx=no ;;
858 --enable-win32waveout) _win32waveout=yes ;;
859 --disable-win32waveout) _win32waveout=no ;;
860 --enable-nas) _nas=yes ;;
861 --disable-nas) _nas=no ;;
862 --enable-png) _png=yes ;;
863 --disable-png) _png=no ;;
864 --enable-mng) _mng=yes ;;
865 --disable-mng) _mng=no ;;
866 --enable-jpeg) _jpeg=yes ;;
867 --disable-jpeg) _jpeg=no ;;
868 --enable-pnm) _pnm=yes ;;
869 --disable-pnm) _pnm=no ;;
870 --enable-md5sum) _md5sum=yes ;;
871 --disable-md5sum) _md5sum=no ;;
872 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
873 --disable-yuv4mpeg) _yuv4mpeg=no ;;
874 --enable-gif) _gif=yes ;;
875 --disable-gif) _gif=no ;;
876 --enable-gl) _gl=yes ;;
877 --disable-gl) _gl=no ;;
878 --enable-ggi) _ggi=yes ;;
879 --disable-ggi) _ggi=no ;;
880 --enable-ggiwmh) _ggiwmh=yes ;;
881 --disable-ggiwmh) _ggiwmh=no ;;
882 --enable-aa) _aa=yes ;;
883 --disable-aa) _aa=no ;;
884 --enable-caca) _caca=yes ;;
885 --disable-caca) _caca=no ;;
886 --enable-svga) _svga=yes ;;
887 --disable-svga) _svga=no ;;
888 --enable-vesa) _vesa=yes ;;
889 --disable-vesa) _vesa=no ;;
890 --enable-fbdev) _fbdev=yes ;;
891 --disable-fbdev) _fbdev=no ;;
892 --enable-dvb) _dvb=yes ;;
893 --disable-dvb) _dvb=no ;;
894 --enable-dxr3) _dxr3=yes ;;
895 --disable-dxr3) _dxr3=no ;;
896 --enable-ivtv) _ivtv=yes ;;
897 --disable-ivtv) _ivtv=no ;;
898 --enable-v4l2) _v4l2=yes ;;
899 --disable-v4l2) _v4l2=no ;;
900 --enable-iconv) _iconv=yes ;;
901 --disable-iconv) _iconv=no ;;
902 --enable-langinfo) _langinfo=yes ;;
903 --disable-langinfo) _langinfo=no ;;
904 --enable-rtc) _rtc=yes ;;
905 --disable-rtc) _rtc=no ;;
906 --enable-libdv) _libdv=yes ;;
907 --disable-libdv) _libdv=no ;;
908 --enable-ossaudio) _ossaudio=yes ;;
909 --disable-ossaudio) _ossaudio=no ;;
910 --enable-rsound) _rsound=yes ;;
911 --disable-rsound) _rsound=no ;;
912 --enable-pulse) _pulse=yes ;;
913 --disable-pulse) _pulse=no ;;
914 --enable-portaudio) _portaudio=yes ;;
915 --disable-portaudio) _portaudio=no ;;
916 --enable-jack) _jack=yes ;;
917 --disable-jack) _jack=no ;;
918 --enable-openal) _openal=yes ;;
919 --disable-openal) _openal=no ;;
920 --enable-mad) _mad=yes ;;
921 --disable-mad) _mad=no ;;
922 --enable-libcdio) _libcdio=yes ;;
923 --disable-libcdio) _libcdio=no ;;
924 --enable-libvorbis) _libvorbis=yes ;;
925 --disable-libvorbis) _libvorbis=no ;;
926 --enable-speex) _speex=yes ;;
927 --disable-speex) _speex=no ;;
928 --enable-tremor) _tremor=yes ;;
929 --disable-tremor) _tremor=no ;;
930 --enable-theora) _theora=yes ;;
931 --disable-theora) _theora=no ;;
932 --enable-mpg123) _mpg123=yes ;;
933 --disable-mpg123) _mpg123=no ;;
934 --enable-liba52) _liba52=yes ;;
935 --disable-liba52) _liba52=no ;;
936 --enable-libdca) _libdca=yes ;;
937 --disable-libdca) _libdca=no ;;
938 --enable-musepack) _musepack=yes ;;
939 --disable-musepack) _musepack=no ;;
940 --enable-faad) _faad=yes ;;
941 --disable-faad) _faad=no ;;
942 --enable-ladspa) _ladspa=yes ;;
943 --disable-ladspa) _ladspa=no ;;
944 --enable-libbs2b) _libbs2b=yes ;;
945 --disable-libbs2b) _libbs2b=no ;;
946 --enable-xmms) _xmms=yes ;;
947 --disable-xmms) _xmms=no ;;
948 --enable-vcd) _vcd=yes ;;
949 --disable-vcd) _vcd=no ;;
950 --enable-bluray) _bluray=yes ;;
951 --disable-bluray) _bluray=no ;;
952 --enable-dvdread) _dvdread=yes ;;
953 --disable-dvdread) _dvdread=no ;;
954 --enable-dvdread-internal) _dvdread_internal=yes ;;
955 --disable-dvdread-internal) _dvdread_internal=no ;;
956 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
957 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
958 --enable-dvdnav) _dvdnav=yes ;;
959 --disable-dvdnav) _dvdnav=no ;;
960 --enable-xanim) _xanim=yes ;;
961 --disable-xanim) _xanim=no ;;
962 --enable-real) _real=yes ;;
963 --disable-real) _real=no ;;
964 --enable-live) _live=yes ;;
965 --disable-live) _live=no ;;
966 --enable-nemesi) _nemesi=yes ;;
967 --disable-nemesi) _nemesi=no ;;
968 --enable-xinerama) _xinerama=yes ;;
969 --disable-xinerama) _xinerama=no ;;
970 --enable-mga) _mga=yes ;;
971 --disable-mga) _mga=no ;;
972 --enable-xmga) _xmga=yes ;;
973 --disable-xmga) _xmga=no ;;
974 --enable-vm) _vm=yes ;;
975 --disable-vm) _vm=no ;;
976 --enable-xf86keysym) _xf86keysym=yes ;;
977 --disable-xf86keysym) _xf86keysym=no ;;
978 --enable-sunaudio) _sunaudio=yes ;;
979 --disable-sunaudio) _sunaudio=no ;;
980 --enable-alsa) _alsa=yes ;;
981 --disable-alsa) _alsa=no ;;
982 --enable-tv) _tv=yes ;;
983 --disable-tv) _tv=no ;;
984 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
985 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
986 --enable-tv-v4l1) _tv_v4l1=yes ;;
987 --disable-tv-v4l1) _tv_v4l1=no ;;
988 --enable-tv-v4l2) _tv_v4l2=yes ;;
989 --disable-tv-v4l2) _tv_v4l2=no ;;
990 --enable-tv-dshow) _tv_dshow=yes ;;
991 --disable-tv-dshow) _tv_dshow=no ;;
992 --enable-radio) _radio=yes ;;
993 --enable-radio-capture) _radio_capture=yes ;;
994 --disable-radio-capture) _radio_capture=no ;;
995 --disable-radio) _radio=no ;;
996 --enable-radio-v4l) _radio_v4l=yes ;;
997 --disable-radio-v4l) _radio_v4l=no ;;
998 --enable-radio-v4l2) _radio_v4l2=yes ;;
999 --disable-radio-v4l2) _radio_v4l2=no ;;
1000 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1001 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1002 --enable-pvr) _pvr=yes ;;
1003 --disable-pvr) _pvr=no ;;
1004 --enable-fastmemcpy) _fastmemcpy=yes ;;
1005 --disable-fastmemcpy) _fastmemcpy=no ;;
1006 --enable-networking) networking=yes ;;
1007 --disable-networking) networking=no ;;
1008 --enable-winsock2_h) _winsock2_h=yes ;;
1009 --disable-winsock2_h) _winsock2_h=no ;;
1010 --enable-smb) _smb=yes ;;
1011 --disable-smb) _smb=no ;;
1012 --enable-joystick) _joystick=yes ;;
1013 --disable-joystick) _joystick=no ;;
1014 --enable-xvid) _xvid=yes ;;
1015 --disable-xvid) _xvid=no ;;
1016 --enable-libnut) _libnut=yes ;;
1017 --disable-libnut) _libnut=no ;;
1018 --enable-libav) ffmpeg=yes ;;
1019 --ffmpeg-source-dir=*)
1020 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1022 --enable-lirc) _lirc=yes ;;
1023 --disable-lirc) _lirc=no ;;
1024 --enable-lircc) _lircc=yes ;;
1025 --disable-lircc) _lircc=no ;;
1026 --enable-apple-remote) _apple_remote=yes ;;
1027 --disable-apple-remote) _apple_remote=no ;;
1028 --enable-apple-ir) _apple_ir=yes ;;
1029 --disable-apple-ir) _apple_ir=no ;;
1030 --enable-termcap) _termcap=yes ;;
1031 --disable-termcap) _termcap=no ;;
1032 --enable-termios) _termios=yes ;;
1033 --disable-termios) _termios=no ;;
1034 --enable-3dfx) _3dfx=yes ;;
1035 --disable-3dfx) _3dfx=no ;;
1036 --enable-s3fb) _s3fb=yes ;;
1037 --disable-s3fb) _s3fb=no ;;
1038 --enable-wii) _wii=yes ;;
1039 --disable-wii) _wii=no ;;
1040 --enable-tdfxfb) _tdfxfb=yes ;;
1041 --disable-tdfxfb) _tdfxfb=no ;;
1042 --disable-tdfxvid) _tdfxvid=no ;;
1043 --enable-tdfxvid) _tdfxvid=yes ;;
1044 --disable-xvr100) _xvr100=no ;;
1045 --enable-xvr100) _xvr100=yes ;;
1046 --disable-tga) _tga=no ;;
1047 --enable-tga) _tga=yes ;;
1048 --enable-directfb) _directfb=yes ;;
1049 --disable-directfb) _directfb=no ;;
1050 --enable-bl) _bl=yes ;;
1051 --disable-bl) _bl=no ;;
1052 --enable-shm) _shm=yes ;;
1053 --disable-shm) _shm=no ;;
1054 --enable-select) _select=yes ;;
1055 --disable-select) _select=no ;;
1056 --enable-cddb) _cddb=yes ;;
1057 --disable-cddb) _cddb=no ;;
1058 --enable-big-endian) _big_endian=yes ;;
1059 --disable-big-endian) _big_endian=no ;;
1060 --enable-bitmap-font) _bitmap_font=yes ;;
1061 --disable-bitmap-font) _bitmap_font=no ;;
1062 --enable-freetype) _freetype=yes ;;
1063 --disable-freetype) _freetype=no ;;
1064 --enable-fontconfig) _fontconfig=yes ;;
1065 --disable-fontconfig) _fontconfig=no ;;
1066 --enable-unrarexec) _unrar_exec=yes ;;
1067 --disable-unrarexec) _unrar_exec=no ;;
1068 --enable-ftp) _ftp=yes ;;
1069 --disable-ftp) _ftp=no ;;
1070 --enable-vstream) _vstream=yes ;;
1071 --disable-vstream) _vstream=no ;;
1072 --enable-pthreads) _pthreads=yes ;;
1073 --disable-pthreads) _pthreads=no ;;
1074 --enable-w32threads) _w32threads=yes ;;
1075 --disable-w32threads) _w32threads=no ;;
1076 --enable-libass) _ass=yes ;;
1077 --disable-libass) _ass=no ;;
1078 --enable-rpath) _rpath=yes ;;
1079 --disable-rpath) _rpath=no ;;
1080 --enable-libpostproc) libpostproc=yes ;;
1081 --disable-libpostproc) libpostproc=no ;;
1083 --enable-fribidi) _fribidi=yes ;;
1084 --disable-fribidi) _fribidi=no ;;
1086 --enable-enca) _enca=yes ;;
1087 --disable-enca) _enca=no ;;
1089 --enable-inet6) _inet6=yes ;;
1090 --disable-inet6) _inet6=no ;;
1092 --enable-gethostbyname2) _gethostbyname2=yes ;;
1093 --disable-gethostbyname2) _gethostbyname2=no ;;
1095 --enable-dga1) _dga1=yes ;;
1096 --disable-dga1) _dga1=no ;;
1097 --enable-dga2) _dga2=yes ;;
1098 --disable-dga2) _dga2=no ;;
1100 --enable-qtx) _qtx=yes ;;
1101 --disable-qtx) _qtx=no ;;
1103 --enable-coreaudio) _coreaudio=yes ;;
1104 --disable-coreaudio) _coreaudio=no ;;
1105 --enable-corevideo) _corevideo=yes ;;
1106 --disable-corevideo) _corevideo=no ;;
1107 --enable-cocoa) _cocoa=yes ;;
1108 --disable-cocoa) _cocoa=no ;;
1109 --enable-sharedbuffer) _sharedbuffer=yes ;;
1110 --disable-sharedbuffer) _sharedbuffer=no ;;
1111 --enable-macosx-finder) _macosx_finder=yes ;;
1112 --disable-macosx-finder) _macosx_finder=no ;;
1113 --enable-macosx-bundle) _macosx_bundle=yes ;;
1114 --disable-macosx-bundle) _macosx_bundle=no ;;
1116 --enable-sortsub) _sortsub=yes ;;
1117 --disable-sortsub) _sortsub=no ;;
1119 --enable-crash-debug) _crash_debug=yes ;;
1120 --disable-crash-debug) _crash_debug=no ;;
1121 --enable-sighandler) _sighandler=yes ;;
1122 --disable-sighandler) _sighandler=no ;;
1123 --enable-win32dll) _win32dll=yes ;;
1124 --disable-win32dll) _win32dll=no ;;
1126 --enable-sse) _sse=yes ;;
1127 --disable-sse) _sse=no ;;
1128 --enable-sse2) _sse2=yes ;;
1129 --disable-sse2) _sse2=no ;;
1130 --enable-ssse3) _ssse3=yes ;;
1131 --disable-ssse3) _ssse3=no ;;
1132 --enable-mmxext) _mmxext=yes ;;
1133 --disable-mmxext) _mmxext=no ;;
1134 --enable-3dnow) _3dnow=yes ;;
1135 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1136 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1137 --disable-3dnowext) _3dnowext=no ;;
1138 --enable-cmov) _cmov=yes ;;
1139 --disable-cmov) _cmov=no ;;
1140 --enable-fast-cmov) _fast_cmov=yes ;;
1141 --disable-fast-cmov) _fast_cmov=no ;;
1142 --enable-fast-clz) _fast_clz=yes ;;
1143 --disable-fast-clz) _fast_clz=no ;;
1144 --enable-altivec) _altivec=yes ;;
1145 --disable-altivec) _altivec=no ;;
1146 --enable-armv5te) _armv5te=yes ;;
1147 --disable-armv5te) _armv5te=no ;;
1148 --enable-armv6) _armv6=yes ;;
1149 --disable-armv6) _armv6=no ;;
1150 --enable-armv6t2) _armv6t2=yes ;;
1151 --disable-armv6t2) _armv6t2=no ;;
1152 --enable-armvfp) _armvfp=yes ;;
1153 --disable-armvfp) _armvfp=no ;;
1154 --enable-neon) neon=yes ;;
1155 --disable-neon) neon=no ;;
1156 --enable-iwmmxt) _iwmmxt=yes ;;
1157 --disable-iwmmxt) _iwmmxt=no ;;
1158 --enable-mmx) _mmx=yes ;;
1159 --disable-mmx) # 3Dnow! and MMX2 require MMX
1160 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1163 echo "Unknown parameter: $ac_option" >&2
1164 exit 1
1167 esac
1168 done
1170 # Atmos: moved this here, to be correct, if --prefix is specified
1171 test -z "$_bindir" && _bindir="$_prefix/bin"
1172 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1173 test -z "$_mandir" && _mandir="$_prefix/share/man"
1174 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1175 test -z "$_libdir" && _libdir="$_prefix/lib"
1176 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1178 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1179 test "$tmpdir" && break
1180 done
1182 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1183 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1185 TMPLOG="config.log"
1187 rm -f "$TMPLOG"
1188 echo Parameters configure was run with: > "$TMPLOG"
1189 if test -n "$CFLAGS" ; then
1190 echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1192 if test -n "$PKG_CONFIG_PATH" ; then
1193 echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1195 echo ./configure $configuration >> "$TMPLOG"
1196 echo >> "$TMPLOG"
1199 echocheck "cross compilation"
1200 echores $_cross_compile
1202 if test $_cross_compile = yes; then
1203 tmp_run() {
1204 return 0
1208 tool_prefix=""
1210 if test $_cross_compile = yes ; then
1211 # Usually cross-compiler prefixes match with the target triplet
1212 test -n "$_target" && tool_prefix="$_target"-
1215 test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib
1216 test "$_windres" = auto && _windres="$tool_prefix"windres
1217 test "$_ar" = auto && _ar="$tool_prefix"ar
1218 test "$_yasm" = auto && _yasm="$tool_prefix"yasm
1219 test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
1221 if test "$_cc" = auto ; then
1222 if test -n "$tool_prefix" ; then
1223 _cc="$tool_prefix"gcc
1224 else
1225 _cc=cc
1229 # Determine our OS name and CPU architecture
1230 if test -z "$_target" ; then
1231 # OS name
1232 system_name=$(uname -s 2>&1)
1233 case "$system_name" in
1234 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1236 Haiku)
1237 system_name=BeOS
1239 GNU/kFreeBSD)
1240 system_name=FreeBSD
1242 HP-UX*)
1243 system_name=HP-UX
1245 [cC][yY][gG][wW][iI][nN]*)
1246 system_name=CYGWIN
1248 MINGW32*)
1249 system_name=MINGW32
1251 OS/2*)
1252 system_name=OS/2
1255 system_name="$system_name-UNKNOWN"
1257 esac
1260 # host's CPU/instruction set
1261 host_arch=$(uname -p 2>&1)
1262 case "$host_arch" in
1263 i386|sparc|ppc|alpha|arm|mips|vax)
1265 powerpc) # Darwin returns 'powerpc'
1266 host_arch=ppc
1268 *) # uname -p on Linux returns 'unknown' for the processor type,
1269 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1271 # Maybe uname -m (machine hardware name) returns something we
1272 # recognize.
1274 # x86/x86pc is used by QNX
1275 case "$(uname -m 2>&1)" in
1276 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 ;;
1277 ia64) host_arch=ia64 ;;
1278 macppc|ppc) host_arch=ppc ;;
1279 ppc64) host_arch=ppc64 ;;
1280 alpha) host_arch=alpha ;;
1281 sparc) host_arch=sparc ;;
1282 sparc64) host_arch=sparc64 ;;
1283 parisc*|hppa*|9000*) host_arch=hppa ;;
1284 arm*|zaurus|cats) host_arch=arm ;;
1285 sh3|sh4|sh4a) host_arch=sh ;;
1286 s390) host_arch=s390 ;;
1287 s390x) host_arch=s390x ;;
1288 *mips*) host_arch=mips ;;
1289 vax) host_arch=vax ;;
1290 xtensa*) host_arch=xtensa ;;
1291 *) host_arch=UNKNOWN ;;
1292 esac
1294 esac
1295 else # if test -z "$_target"
1296 for i in 2 3; do
1297 system_name=$(echo $_target | cut -d '-' -f $i)
1298 case "$(echo $system_name | tr A-Z a-z)" in
1299 linux) system_name=Linux ;;
1300 freebsd) system_name=FreeBSD ;;
1301 gnu/kfreebsd) system_name=FreeBSD ;;
1302 netbsd) system_name=NetBSD ;;
1303 bsd/os) system_name=BSD/OS ;;
1304 openbsd) system_name=OpenBSD ;;
1305 dragonfly) system_name=DragonFly ;;
1306 sunos) system_name=SunOS ;;
1307 qnx) system_name=QNX ;;
1308 morphos) system_name=MorphOS ;;
1309 amigaos) system_name=AmigaOS ;;
1310 mingw32*) system_name=MINGW32 ;;
1311 *) continue ;;
1312 esac
1313 break
1314 done
1315 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1316 host_arch=$(echo $_target | cut -d '-' -f 1)
1317 if test $(echo $host_arch) != "x86_64" ; then
1318 host_arch=$(echo $host_arch | tr '_' '-')
1322 extra_cflags="-I. $extra_cflags"
1323 _timer=timer-linux.c
1324 _getch=getch2.c
1325 if freebsd ; then
1326 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1327 extra_cflags="$extra_cflags -I/usr/local/include"
1330 if netbsd || dragonfly ; then
1331 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1332 extra_cflags="$extra_cflags -I/usr/pkg/include"
1335 if darwin; then
1336 extra_cflags="-mdynamic-no-pic $extra_cflags"
1337 _timer=timer-darwin.c
1340 if aix ; then
1341 extra_ldflags="$extra_ldflags -lC"
1344 if linux ; then
1345 _ranlib='true'
1348 if win32 ; then
1349 _exesuf=".exe"
1350 extra_cflags="$extra_cflags -fno-common"
1351 # -lwinmm is always needed for osdep/timer-win2.c
1352 extra_ldflags="$extra_ldflags -lwinmm"
1353 _pe_executable=yes
1354 _timer=timer-win2.c
1355 _priority=yes
1356 def_dos_paths="#define HAVE_DOS_PATHS 1"
1357 def_priority="#define CONFIG_PRIORITY 1"
1360 if mingw32 ; then
1361 _getch=getch2-win.c
1362 need_shmem=no
1363 extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1366 if amigaos ; then
1367 _select=no
1368 _sighandler=no
1369 _stream_cache=no
1370 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1371 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1374 if qnx ; then
1375 extra_ldflags="$extra_ldflags -lph"
1378 TMPC="$mplayer_tmpdir/tmp.c"
1379 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1380 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1381 TMPH="$mplayer_tmpdir/tmp.h"
1382 TMPS="$mplayer_tmpdir/tmp.S"
1384 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1385 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1389 # Checking CC version...
1390 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1391 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1392 echocheck "$_cc version"
1393 cc_vendor=intel
1394 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1395 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1396 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1397 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1398 # TODO verify older icc/ecc compatibility
1399 case $cc_version in
1401 cc_version="v. ?.??, bad"
1402 cc_fail=yes
1404 10.1|11.0|11.1)
1405 cc_version="$cc_version, ok"
1408 cc_version="$cc_version, bad"
1409 cc_fail=yes
1411 esac
1412 echores "$cc_version"
1413 else
1414 for _cc in "$_cc" gcc cc ; do
1415 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1416 if test "$cc_name_tmp" = "gcc"; then
1417 cc_name=$cc_name_tmp
1418 echocheck "$_cc version"
1419 cc_vendor=gnu
1420 cc_version=$($_cc -dumpversion 2>&1)
1421 case $cc_version in
1422 2.96*)
1423 cc_fail=yes
1426 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1427 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1428 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1430 esac
1431 echores "$cc_version"
1432 break
1434 if $_cc -v 2>&1 | grep -q "clang"; then
1435 echocheck "$_cc version"
1436 cc_vendor=clang
1437 cc_version=$($_cc -dumpversion 2>&1)
1438 res_comment="experimental support only"
1439 echores "clang $cc_version"
1440 break
1442 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1443 if test "$cc_name_tmp" = "Sun C"; then
1444 echocheck "$_cc version"
1445 cc_vendor=sun
1446 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1447 res_comment="experimental support only"
1448 echores "Sun C $cc_version"
1449 break
1451 done
1452 fi # icc
1453 test "$cc_fail" = yes && die "unsupported compiler version"
1455 echocheck "working compiler"
1456 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1457 echo "yes"
1459 if test -z "$_target" && x86 ; then
1460 cat > $TMPC << EOF
1461 int main(void) {
1462 int test[(int)sizeof(char *)-7];
1463 return 0;
1466 cc_check && host_arch=x86_64 || host_arch=i386
1469 echo "Detected operating system: $system_name"
1470 echo "Detected host architecture: $host_arch"
1472 # ---
1474 # now that we know what compiler should be used for compilation, try to find
1475 # out which assembler is used by the $_cc compiler
1476 if test "$_as" = auto ; then
1477 _as=$($_cc -print-prog-name=as)
1478 test -z "$_as" && _as=as
1481 if test "$_nm" = auto ; then
1482 _nm=$($_cc -print-prog-name=nm)
1483 test -z "$_nm" && _nm=nm
1486 # XXX: this should be ok..
1487 _cpuinfo="echo"
1489 if test "$_runtime_cpudetection" = no ; then
1491 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1492 # FIXME: Remove the cygwin check once AMD CPUs are supported
1493 if test -r /proc/cpuinfo && ! cygwin; then
1494 # Linux with /proc mounted, extract CPU information from it
1495 _cpuinfo="cat /proc/cpuinfo"
1496 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1497 # FreeBSD with Linux emulation /proc mounted,
1498 # extract CPU information from it
1499 # Don't use it on x86 though, it never reports 3Dnow
1500 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1501 elif darwin && ! x86 ; then
1502 # use hostinfo on Darwin
1503 _cpuinfo="hostinfo"
1504 elif aix; then
1505 # use 'lsattr' on AIX
1506 _cpuinfo="lsattr -E -l proc0 -a type"
1507 elif x86; then
1508 # all other OSes try to extract CPU information from a small helper
1509 # program cpuinfo instead
1510 $_cc -o cpuinfo$_exesuf cpuinfo.c
1511 _cpuinfo="./cpuinfo$_exesuf"
1514 if x86 ; then
1515 # gather more CPU information
1516 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1517 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1518 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1519 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1520 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1522 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1524 pparam=$(echo $exts | sed -e s/xmm/sse/ -e s/kni/sse/)
1525 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1526 pparam=$(echo $pparam | sed -e 's/sse/sse mmxext/')
1528 for ext in $pparam ; do
1529 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1530 done
1532 echocheck "CPU vendor"
1533 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1535 echocheck "CPU type"
1536 echores "$pname"
1539 fi # test "$_runtime_cpudetection" = no
1541 if x86 && test "$_runtime_cpudetection" = no ; then
1542 extcheck() {
1543 if test "$1" = kernel_check ; then
1544 echocheck "kernel support of $2"
1545 cat > $TMPC <<EOF
1546 #include <stdlib.h>
1547 #include <signal.h>
1548 static void catch(int sig) { exit(1); }
1549 int main(void) {
1550 signal(SIGILL, catch);
1551 __asm__ volatile ("$3":::"memory"); return 0;
1555 if cc_check && tmp_run ; then
1556 eval _$2=yes
1557 echores "yes"
1558 _optimizing="$_optimizing $2"
1559 return 0
1560 else
1561 eval _$2=no
1562 echores "failed"
1563 echo "It seems that your kernel does not correctly support $2."
1564 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1565 return 1
1568 return 0
1571 extcheck $_mmx "mmx" "emms"
1572 extcheck $_mmxext "mmxext" "sfence"
1573 extcheck $_3dnow "3dnow" "femms"
1574 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1575 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1576 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1577 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1578 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1580 if test "$_gcc3_ext" != ""; then
1581 # if we had to disable sse/sse2 because the active kernel does not
1582 # support this instruction set extension, we also have to tell
1583 # gcc3 to not generate sse/sse2 instructions for normal C code
1584 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1590 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1591 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1592 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1593 subarch_all='X86_32 X86_64 PPC64'
1594 case "$host_arch" in
1595 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1596 arch='x86'
1597 subarch='x86_32'
1598 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1599 iproc=486
1600 proc=i486
1603 if test "$_runtime_cpudetection" = no ; then
1604 case "$pvendor" in
1605 AuthenticAMD)
1606 case "$pfamily" in
1607 3) proc=i386 iproc=386 ;;
1608 4) proc=i486 iproc=486 ;;
1609 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1610 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1611 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1612 proc=k6-3
1613 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1614 proc=geode
1615 elif test "$pmodel" -ge 8; then
1616 proc=k6-2
1617 elif test "$pmodel" -ge 6; then
1618 proc=k6
1619 else
1620 proc=i586
1623 6) iproc=686
1624 # It's a bit difficult to determine the correct type of Family 6
1625 # AMD CPUs just from their signature. Instead, we check directly
1626 # whether it supports SSE.
1627 if test "$_sse" = yes; then
1628 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1629 proc=athlon-xp
1630 else
1631 # Again, gcc treats athlon and athlon-tbird similarly.
1632 proc=athlon
1635 15) iproc=686
1636 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1637 # caught and remedied in the optimization tests below.
1638 proc=k8
1641 *) proc=amdfam10 iproc=686
1642 test $_fast_clz = "auto" && _fast_clz=yes
1644 esac
1646 GenuineIntel)
1647 case "$pfamily" in
1648 3) proc=i386 iproc=386 ;;
1649 4) proc=i486 iproc=486 ;;
1650 5) iproc=586
1651 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1652 proc=pentium-mmx # 4 is desktop, 8 is mobile
1653 else
1654 proc=i586
1657 6) iproc=686
1658 if test "$pmodel" -ge 15; then
1659 proc=core2
1660 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1661 proc=pentium-m
1662 elif test "$pmodel" -ge 7; then
1663 proc=pentium3
1664 elif test "$pmodel" -ge 3; then
1665 proc=pentium2
1666 else
1667 proc=i686
1669 test $_fast_clz = "auto" && _fast_clz=yes
1671 15) iproc=686
1672 # A nocona in 32-bit mode has no more capabilities than a prescott.
1673 if test "$pmodel" -ge 3; then
1674 proc=prescott
1675 else
1676 proc=pentium4
1677 test $_fast_clz = "auto" && _fast_clz=yes
1679 test $_fast_cmov = "auto" && _fast_cmov=no
1681 *) proc=prescott iproc=686 ;;
1682 esac
1684 CentaurHauls)
1685 case "$pfamily" in
1686 5) iproc=586
1687 if test "$pmodel" -ge 8; then
1688 proc=winchip2
1689 elif test "$pmodel" -ge 4; then
1690 proc=winchip-c6
1691 else
1692 proc=i586
1695 6) iproc=686
1696 if test "$pmodel" -ge 9; then
1697 proc=c3-2
1698 else
1699 proc=c3
1700 iproc=586
1703 *) proc=i686 iproc=i686 ;;
1704 esac
1706 unknown)
1707 case "$pfamily" in
1708 3) proc=i386 iproc=386 ;;
1709 4) proc=i486 iproc=486 ;;
1710 *) proc=i586 iproc=586 ;;
1711 esac
1714 proc=i586 iproc=586 ;;
1715 esac
1716 test $_fast_clz = "auto" && _fast_clz=no
1717 fi # test "$_runtime_cpudetection" = no
1720 # check that gcc supports our CPU, if not, fall back to earlier ones
1721 # LGB: check -mcpu and -march swithing step by step with enabling
1722 # to fall back till 386.
1724 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1726 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1727 cpuopt=-mtune
1728 else
1729 cpuopt=-mcpu
1732 echocheck "GCC & CPU optimization abilities"
1733 if test "$_runtime_cpudetection" = no ; then
1734 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1735 cflag_check -march=native && proc=native
1737 if test "$proc" = "amdfam10"; then
1738 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1740 if test "$proc" = "k8"; then
1741 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1743 if test "$proc" = "athlon-xp"; then
1744 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1746 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1747 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1749 if test "$proc" = "k6" || test "$proc" = "c3"; then
1750 if ! cflag_check -march=$proc $cpuopt=$proc; then
1751 if cflag_check -march=i586 $cpuopt=i686; then
1752 proc=i586-i686
1753 else
1754 proc=i586
1758 if test "$proc" = "prescott" ; then
1759 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1761 if test "$proc" = "core2" ; then
1762 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1764 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
1765 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1767 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1768 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1770 if test "$proc" = "i586"; then
1771 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1773 if test "$proc" = "i486" ; then
1774 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1776 if test "$proc" = "i386" ; then
1777 cflag_check -march=$proc $cpuopt=$proc || proc=error
1779 if test "$proc" = "error" ; then
1780 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1781 _mcpu=""
1782 _march=""
1783 _optimizing=""
1784 elif test "$proc" = "i586-i686"; then
1785 _march="-march=i586"
1786 _mcpu="$cpuopt=i686"
1787 _optimizing="$proc"
1788 else
1789 _march="-march=$proc"
1790 _mcpu="$cpuopt=$proc"
1791 _optimizing="$proc"
1793 else # if test "$_runtime_cpudetection" = no
1794 _mcpu="$cpuopt=generic"
1795 # at least i486 required, for bswap instruction
1796 _march="-march=i486"
1797 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1798 cflag_check $_mcpu || _mcpu=""
1799 cflag_check $_march $_mcpu || _march=""
1802 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1803 ## autodetected mcpu/march parameters
1804 if test "$_target" ; then
1805 # TODO: it may be a good idea to check GCC and fall back in all cases
1806 if test "$host_arch" = "i586-i686"; then
1807 _march="-march=i586"
1808 _mcpu="$cpuopt=i686"
1809 else
1810 _march="-march=$host_arch"
1811 _mcpu="$cpuopt=$host_arch"
1814 proc="$host_arch"
1816 case "$proc" in
1817 i386) iproc=386 ;;
1818 i486) iproc=486 ;;
1819 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1820 i686|athlon*|pentium*) iproc=686 ;;
1821 *) iproc=586 ;;
1822 esac
1825 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1826 _fast_cmov="yes"
1827 else
1828 _fast_cmov="no"
1830 test $_fast_clz = "auto" && _fast_clz=yes
1832 echores "$proc"
1835 ia64)
1836 arch='ia64'
1837 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1838 iproc='ia64'
1841 x86_64|amd64)
1842 arch='x86'
1843 subarch='x86_64'
1844 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1845 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1846 iproc='x86_64'
1848 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1849 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1850 cpuopt=-mtune
1851 else
1852 cpuopt=-mcpu
1854 if test "$_runtime_cpudetection" = no ; then
1855 case "$pvendor" in
1856 AuthenticAMD)
1857 case "$pfamily" in
1858 15) proc=k8
1859 test $_fast_clz = "auto" && _fast_clz=no
1861 *) proc=amdfam10;;
1862 esac
1864 GenuineIntel)
1865 case "$pfamily" in
1866 6) proc=core2;;
1868 # 64-bit prescotts exist, but as far as GCC is concerned they
1869 # have the same capabilities as a nocona.
1870 proc=nocona
1871 test $_fast_cmov = "auto" && _fast_cmov=no
1872 test $_fast_clz = "auto" && _fast_clz=no
1874 esac
1877 proc=error;;
1878 esac
1879 fi # test "$_runtime_cpudetection" = no
1881 echocheck "GCC & CPU optimization abilities"
1882 # This is a stripped-down version of the i386 fallback.
1883 if test "$_runtime_cpudetection" = no ; then
1884 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1885 cflag_check -march=native && proc=native
1887 # --- AMD processors ---
1888 if test "$proc" = "amdfam10"; then
1889 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1891 if test "$proc" = "k8"; then
1892 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1894 # This will fail if gcc version < 3.3, which is ok because earlier
1895 # versions don't really support 64-bit on amd64.
1896 # Is this a valid assumption? -Corey
1897 if test "$proc" = "athlon-xp"; then
1898 cflag_check -march=$proc $cpuopt=$proc || proc=error
1900 # --- Intel processors ---
1901 if test "$proc" = "core2"; then
1902 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1904 if test "$proc" = "x86-64"; then
1905 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1907 if test "$proc" = "nocona"; then
1908 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1910 if test "$proc" = "pentium4"; then
1911 cflag_check -march=$proc $cpuopt=$proc || proc=error
1914 _march="-march=$proc"
1915 _mcpu="$cpuopt=$proc"
1916 if test "$proc" = "error" ; then
1917 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1918 _mcpu=""
1919 _march=""
1921 else # if test "$_runtime_cpudetection" = no
1922 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1923 _march="-march=x86-64"
1924 _mcpu="$cpuopt=generic"
1925 cflag_check $_mcpu || _mcpu="x86-64"
1926 cflag_check $_mcpu || _mcpu=""
1927 cflag_check $_march $_mcpu || _march=""
1930 _optimizing="$proc"
1931 test $_fast_cmov = "auto" && _fast_cmov=yes
1932 test $_fast_clz = "auto" && _fast_clz=yes
1934 echores "$proc"
1937 sparc|sparc64)
1938 arch='sparc'
1939 iproc='sparc'
1940 if test "$host_arch" = "sparc64" ; then
1941 _vis='yes'
1942 proc='ultrasparc'
1943 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1944 elif sunos ; then
1945 echocheck "CPU type"
1946 karch=$(uname -m)
1947 case "$(echo $karch)" in
1948 sun4) proc=v7 ;;
1949 sun4c) proc=v7 ;;
1950 sun4d) proc=v8 ;;
1951 sun4m) proc=v8 ;;
1952 sun4u) proc=ultrasparc _vis='yes' ;;
1953 sun4v) proc=v9 ;;
1954 *) proc=v8 ;;
1955 esac
1956 echores "$proc"
1957 else
1958 proc=v8
1960 _mcpu="-mcpu=$proc"
1961 _optimizing="$proc"
1964 arm*)
1965 arch='arm'
1966 iproc='arm'
1969 avr32)
1970 arch='avr32'
1971 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1972 iproc='avr32'
1973 test $_fast_clz = "auto" && _fast_clz=yes
1976 sh|sh4)
1977 arch='sh4'
1978 iproc='sh4'
1981 ppc|ppc64|powerpc|powerpc64)
1982 arch='ppc'
1983 def_dcbzl='#define HAVE_DCBZL 0'
1984 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1985 iproc='ppc'
1987 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
1988 subarch='ppc64'
1989 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1991 echocheck "CPU type"
1992 case $system_name in
1993 Linux)
1994 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
1995 if test -n "$($_cpuinfo | grep altivec)"; then
1996 test $_altivec = auto && _altivec=yes
1999 Darwin)
2000 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2001 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2002 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2003 test $_altivec = auto && _altivec=yes
2006 NetBSD)
2007 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2008 case $cc_version in
2009 2*|3.0*|3.1*|3.2*|3.3*)
2012 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2013 test $_altivec = auto && _altivec=yes
2016 esac
2018 AIX)
2019 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2021 esac
2022 if test "$_altivec" = yes; then
2023 echores "$proc altivec"
2024 else
2025 _altivec=no
2026 echores "$proc"
2029 echocheck "GCC & CPU optimization abilities"
2031 if test -n "$proc"; then
2032 case "$proc" in
2033 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2034 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2035 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2036 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2037 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2038 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2039 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2040 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2041 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2042 *) ;;
2043 esac
2044 # gcc 3.1(.1) and up supports 7400 and 7450
2045 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2046 case "$proc" in
2047 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2048 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2049 *) ;;
2050 esac
2052 # gcc 3.2 and up supports 970
2053 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2054 case "$proc" in
2055 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2056 def_dcbzl='#define HAVE_DCBZL 1' ;;
2057 *) ;;
2058 esac
2060 # gcc 3.3 and up supports POWER4
2061 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2062 case "$proc" in
2063 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2064 *) ;;
2065 esac
2067 # gcc 3.4 and up supports 440*
2068 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2069 case "$proc" in
2070 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2071 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2072 *) ;;
2073 esac
2075 # gcc 4.0 and up supports POWER5
2076 if test "$_cc_major" -ge "4"; then
2077 case "$proc" in
2078 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2079 *) ;;
2080 esac
2084 if test -n "$_mcpu"; then
2085 _optimizing=$(echo $_mcpu | cut -c 8-)
2086 echores "$_optimizing"
2087 else
2088 echores "none"
2091 test $_fast_clz = "auto" && _fast_clz=yes
2095 alpha*)
2096 arch='alpha'
2097 iproc='alpha'
2098 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2100 echocheck "CPU type"
2101 cat > $TMPC << EOF
2102 int main(void) {
2103 unsigned long ver, mask;
2104 __asm__ ("implver %0" : "=r" (ver));
2105 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2106 printf("%ld-%x\n", ver, ~mask);
2107 return 0;
2110 $_cc -o "$TMPEXE" "$TMPC"
2111 case $("$TMPEXE") in
2113 0-0) proc="ev4"; _mvi="0";;
2114 1-0) proc="ev5"; _mvi="0";;
2115 1-1) proc="ev56"; _mvi="0";;
2116 1-101) proc="pca56"; _mvi="1";;
2117 2-303) proc="ev6"; _mvi="1";;
2118 2-307) proc="ev67"; _mvi="1";;
2119 2-1307) proc="ev68"; _mvi="1";;
2120 esac
2121 echores "$proc"
2123 echocheck "GCC & CPU optimization abilities"
2124 if test "$proc" = "ev68" ; then
2125 cc_check -mcpu=$proc || proc=ev67
2127 if test "$proc" = "ev67" ; then
2128 cc_check -mcpu=$proc || proc=ev6
2130 _mcpu="-mcpu=$proc"
2131 echores "$proc"
2133 test $_fast_clz = "auto" && _fast_clz=yes
2135 _optimizing="$proc"
2138 mips*)
2139 arch='mips'
2140 iproc='mips'
2142 test $_fast_clz = "auto" && _fast_clz=yes
2146 hppa)
2147 arch='pa_risc'
2148 iproc='PA-RISC'
2151 s390)
2152 arch='s390'
2153 iproc='390'
2156 s390x)
2157 arch='s390x'
2158 iproc='390x'
2161 vax)
2162 arch='vax'
2163 iproc='vax'
2166 xtensa)
2167 arch='xtensa'
2168 iproc='xtensa'
2171 generic)
2172 arch='generic'
2176 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2177 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2178 die "unsupported architecture $host_arch"
2180 esac # case "$host_arch" in
2182 if test "$_runtime_cpudetection" = yes ; then
2183 if x86 ; then
2184 test "$_cmov" != no && _cmov=yes
2185 x86_32 && _cmov=no
2186 test "$_mmx" != no && _mmx=yes
2187 test "$_3dnow" != no && _3dnow=yes
2188 test "$_3dnowext" != no && _3dnowext=yes
2189 test "$_mmxext" != no && _mmxext=yes
2190 test "$_sse" != no && _sse=yes
2191 test "$_sse2" != no && _sse2=yes
2192 test "$_ssse3" != no && _ssse3=yes
2194 if ppc; then
2195 _altivec=yes
2200 # endian testing
2201 echocheck "byte order"
2202 if test "$_big_endian" = auto ; then
2203 cat > $TMPC <<EOF
2204 short ascii_name[] = {
2205 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2206 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2207 int main(void) { return (long)ascii_name; }
2209 if cc_check ; then
2210 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2211 _big_endian=yes
2212 else
2213 _big_endian=no
2215 else
2216 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2219 if test "$_big_endian" = yes ; then
2220 _byte_order='big-endian'
2221 def_words_endian='#define WORDS_BIGENDIAN 1'
2222 def_bigendian='#define HAVE_BIGENDIAN 1'
2223 else
2224 _byte_order='little-endian'
2225 def_words_endian='#undef WORDS_BIGENDIAN'
2226 def_bigendian='#define HAVE_BIGENDIAN 0'
2228 echores "$_byte_order"
2231 echocheck "extern symbol prefix"
2232 cat > $TMPC << EOF
2233 int ff_extern;
2235 cc_check -c || die "Symbol mangling check failed."
2236 sym=$($_nm -P -g $TMPEXE)
2237 extern_prefix=${sym%%ff_extern*}
2238 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2239 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2240 echores $extern_prefix
2243 echocheck "assembler support of -pipe option"
2244 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2245 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2248 if darwin && test "$cc_vendor" = "gnu" ; then
2249 echocheck "GCC support of -mstackrealign"
2250 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2251 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2252 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2253 # wrong code with this flag, but this can be worked around by adding
2254 # -fno-unit-at-a-time as described in the blog post at
2255 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2256 cat > $TMPC << EOF
2257 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2258 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2260 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2261 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2262 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2263 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2264 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2267 # Checking for CFLAGS
2268 _install_strip="-s"
2269 if test "$_profile" != "" || test "$_debug" != "" ; then
2270 _install_strip=
2272 if test -z "$CFLAGS" ; then
2273 if test "$cc_vendor" = "intel" ; then
2274 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2275 WARNFLAGS="-wd167 -wd556 -wd144"
2276 elif test "$cc_vendor" = "sun" ; then
2277 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2278 elif test "$cc_vendor" = "clang"; then
2279 CFLAGS="-O2 $_debug $_profile $_march $_pipe"
2280 WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2281 ERRORFLAGS="-Werror=implicit-function-declaration"
2282 elif test "$cc_vendor" != "gnu" ; then
2283 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2284 else
2285 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2286 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2287 ERRORFLAGS="-Werror-implicit-function-declaration"
2288 extra_ldflags="$extra_ldflags -ffast-math"
2290 else
2291 warn_cflags=yes
2294 if darwin && test "$cc_vendor" = "gnu" ; then
2295 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
2298 if test "$cc_vendor" = "gnu" ; then
2299 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2300 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2301 # that's the only variable specific to C now, and this option is not valid
2302 # for C++.
2303 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2304 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2305 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2306 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2307 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2308 else
2309 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2312 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2313 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2316 if test -n "$LDFLAGS" ; then
2317 extra_ldflags="$extra_ldflags $LDFLAGS"
2318 warn_cflags=yes
2319 elif test "$cc_vendor" = "intel" ; then
2320 extra_ldflags="$extra_ldflags -i-static"
2322 if test -n "$CPPFLAGS" ; then
2323 extra_cflags="$extra_cflags $CPPFLAGS"
2324 warn_cflags=yes
2329 if x86_32 ; then
2330 # Checking assembler (_as) compatibility...
2331 # Added workaround for older as that reads from stdin by default - atmos
2332 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2333 echocheck "assembler ($_as $as_version)"
2335 _pref_as_version='2.9.1'
2336 echo 'nop' > $TMPS
2337 if test "$_mmx" = yes ; then
2338 echo 'emms' >> $TMPS
2340 if test "$_3dnow" = yes ; then
2341 _pref_as_version='2.10.1'
2342 echo 'femms' >> $TMPS
2344 if test "$_3dnowext" = yes ; then
2345 _pref_as_version='2.10.1'
2346 echo 'pswapd %mm0, %mm0' >> $TMPS
2348 if test "$_mmxext" = yes ; then
2349 _pref_as_version='2.10.1'
2350 echo 'movntq %mm0, (%eax)' >> $TMPS
2352 if test "$_sse" = yes ; then
2353 _pref_as_version='2.10.1'
2354 echo 'xorps %xmm0, %xmm0' >> $TMPS
2356 #if test "$_sse2" = yes ; then
2357 # _pref_as_version='2.11'
2358 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2360 if test "$_cmov" = yes ; then
2361 _pref_as_version='2.10.1'
2362 echo 'cmovb %eax, %ebx' >> $TMPS
2364 if test "$_ssse3" = yes ; then
2365 _pref_as_version='2.16.92'
2366 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2368 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2370 if test "$as_verc_fail" != yes ; then
2371 echores "ok"
2372 else
2373 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2374 echores "failed"
2375 die "obsolete binutils version"
2378 fi #if x86_32
2381 echocheck "PIC"
2382 pic=no
2383 cat > $TMPC << EOF
2384 int main(void) {
2385 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2386 #error PIC not enabled
2387 #endif
2388 return 0;
2391 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2392 echores $pic
2395 if x86 ; then
2397 echocheck ".align is a power of two"
2398 if test "$_asmalign_pot" = auto ; then
2399 _asmalign_pot=no
2400 inline_asm_check '".align 3"' && _asmalign_pot=yes
2402 if test "$_asmalign_pot" = "yes" ; then
2403 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2404 else
2405 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2407 echores $_asmalign_pot
2410 echocheck "ebx availability"
2411 ebx_available=no
2412 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2413 cat > $TMPC << EOF
2414 int main(void) {
2415 int x;
2416 __asm__ volatile(
2417 "xor %0, %0"
2418 :"=b"(x)
2419 // just adding ebx to clobber list seems unreliable with some
2420 // compilers, e.g. Haiku's gcc 2.95
2422 // and the above check does not work for OSX 64 bit...
2423 __asm__ volatile("":::"%ebx");
2424 return 0;
2427 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2428 echores $ebx_available
2431 echocheck "yasm"
2432 if test -z "$YASMFLAGS" ; then
2433 if darwin ; then
2434 x86_64 && objformat="macho64" || objformat="macho"
2435 elif win32 ; then
2436 objformat="win32"
2437 else
2438 objformat="elf"
2440 # currently tested for Linux x86, x86_64
2441 YASMFLAGS="-f $objformat"
2442 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2443 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2444 case "$objformat" in
2445 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2446 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2447 esac
2448 else
2449 warn_cflags=yes
2452 echo "pabsw xmm0, xmm0" > $TMPS
2453 yasm_check || _yasm=""
2454 if test $_yasm ; then
2455 def_yasm='#define HAVE_YASM 1'
2456 have_yasm="yes"
2457 echores "$_yasm"
2458 else
2459 def_yasm='#define HAVE_YASM 0'
2460 have_yasm="no"
2461 echores "no"
2464 echocheck "bswap"
2465 def_bswap='#define HAVE_BSWAP 0'
2466 echo 'bswap %eax' > $TMPS
2467 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2468 echores "$bswap"
2469 fi #if x86
2472 #FIXME: This should happen before the check for CFLAGS..
2473 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2474 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2476 # check if AltiVec is supported by the compiler, and how to enable it
2477 echocheck "GCC AltiVec flags"
2478 if $(cflag_check -maltivec -mabi=altivec) ; then
2479 _altivec_gcc_flags="-maltivec -mabi=altivec"
2480 # check if <altivec.h> should be included
2481 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2482 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2483 inc_altivec_h='#include <altivec.h>'
2484 else
2485 if $(cflag_check -faltivec) ; then
2486 _altivec_gcc_flags="-faltivec"
2487 else
2488 _altivec=no
2489 _altivec_gcc_flags="none, AltiVec disabled"
2493 echores "$_altivec_gcc_flags"
2495 # check if the compiler supports braces for vector declarations
2496 cat > $TMPC << EOF
2497 $inc_altivec_h
2498 int main(void) { (vector int) {1}; return 0; }
2500 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2502 # Disable runtime cpudetection if we cannot generate AltiVec code or
2503 # AltiVec is disabled by the user.
2504 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2505 && _runtime_cpudetection=no
2507 # Show that we are optimizing for AltiVec (if enabled and supported).
2508 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2509 && _optimizing="$_optimizing altivec"
2511 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2512 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2515 if ppc ; then
2516 def_xform_asm='#define HAVE_XFORM_ASM 0'
2517 xform_asm=no
2518 echocheck "XFORM ASM support"
2519 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2520 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2521 echores "$xform_asm"
2524 if arm ; then
2525 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2526 if test $_armv5te = "auto" ; then
2527 _armv5te=no
2528 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2530 echores "$_armv5te"
2532 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2534 echocheck "ARMv6 (SIMD instructions)"
2535 if test $_armv6 = "auto" ; then
2536 _armv6=no
2537 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2539 echores "$_armv6"
2541 echocheck "ARMv6t2 (SIMD instructions)"
2542 if test $_armv6t2 = "auto" ; then
2543 _armv6t2=no
2544 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2546 echores "$_armv6t2"
2548 echocheck "ARM VFP"
2549 if test $_armvfp = "auto" ; then
2550 _armvfp=no
2551 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2553 echores "$_armvfp"
2555 echocheck "ARM NEON"
2556 if test $neon = "auto" ; then
2557 neon=no
2558 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2560 echores "$neon"
2562 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2563 if test $_iwmmxt = "auto" ; then
2564 _iwmmxt=no
2565 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2567 echores "$_iwmmxt"
2570 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2571 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2572 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2573 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2574 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2575 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2576 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2577 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2578 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2579 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2580 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2581 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2582 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2583 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2584 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2585 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2586 test "$neon" = yes && cpuexts="NEON $cpuexts"
2587 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2588 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2589 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2591 # Checking kernel version...
2592 if x86_32 && linux ; then
2593 _k_verc_problem=no
2594 kernel_version=$(uname -r 2>&1)
2595 echocheck "$system_name kernel version"
2596 case "$kernel_version" in
2597 '') kernel_version="?.??"; _k_verc_fail=yes;;
2598 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2599 _k_verc_problem=yes;;
2600 esac
2601 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2602 _k_verc_fail=yes
2604 if test "$_k_verc_fail" ; then
2605 echores "$kernel_version, fail"
2606 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2607 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2608 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2609 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2610 echo "2.2.x you must upgrade it to get SSE support!"
2611 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2612 else
2613 echores "$kernel_version, ok"
2617 ######################
2618 # MAIN TESTS GO HERE #
2619 ######################
2622 echocheck "-lposix"
2623 if cflag_check -lposix ; then
2624 extra_ldflags="$extra_ldflags -lposix"
2625 echores "yes"
2626 else
2627 echores "no"
2630 echocheck "-lm"
2631 if cflag_check -lm ; then
2632 _ld_lm="-lm"
2633 echores "yes"
2634 else
2635 _ld_lm=""
2636 echores "no"
2640 echocheck "langinfo"
2641 if test "$_langinfo" = auto ; then
2642 _langinfo=no
2643 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2645 if test "$_langinfo" = yes ; then
2646 def_langinfo='#define HAVE_LANGINFO 1'
2647 else
2648 def_langinfo='#undef HAVE_LANGINFO'
2650 echores "$_langinfo"
2653 echocheck "translation support"
2654 if test "$_translation" = yes; then
2655 def_translation="#define CONFIG_TRANSLATION 1"
2656 else
2657 def_translation="#undef CONFIG_TRANSLATION"
2659 echores "$_translation"
2661 echocheck "language"
2662 # Set preferred languages, "all" uses English as main language.
2663 test -z "$language" && language=$LINGUAS
2664 test -z "$language_doc" && language_doc=$language
2665 test -z "$language_man" && language_man=$language
2666 test -z "$language_msg" && language_msg=$language
2667 test -z "$language_msg" && language_msg="all"
2668 language_doc=$(echo $language_doc | tr , " ")
2669 language_man=$(echo $language_man | tr , " ")
2670 language_msg=$(echo $language_msg | tr , " ")
2672 test "$language_doc" = "all" && language_doc=$doc_lang_all
2673 test "$language_man" = "all" && language_man=$man_lang_all
2674 test "$language_msg" = "all" && language_msg=$msg_lang_all
2676 if test "$_translation" != yes ; then
2677 language_msg=""
2680 # Prune non-existing translations from language lists.
2681 # Set message translation to the first available language.
2682 # Fall back on English.
2683 for lang in $language_doc ; do
2684 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2685 done
2686 language_doc=$tmp_language_doc
2687 test -z "$language_doc" && language_doc=en
2689 for lang in $language_man ; do
2690 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2691 done
2692 language_man=$tmp_language_man
2693 test -z "$language_man" && language_man=en
2695 for lang in $language_msg ; do
2696 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2697 done
2698 language_msg=$tmp_language_msg
2700 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2703 echocheck "enable sighandler"
2704 if test "$_sighandler" = yes ; then
2705 def_sighandler='#define CONFIG_SIGHANDLER 1'
2706 else
2707 def_sighandler='#undef CONFIG_SIGHANDLER'
2709 echores "$_sighandler"
2711 echocheck "runtime cpudetection"
2712 if test "$_runtime_cpudetection" = yes ; then
2713 _optimizing="Runtime CPU-Detection enabled"
2714 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2715 else
2716 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2718 echores "$_runtime_cpudetection"
2721 echocheck "restrict keyword"
2722 for restrict_keyword in restrict __restrict __restrict__ ; do
2723 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2724 if cc_check; then
2725 def_restrict_keyword=$restrict_keyword
2726 break;
2728 done
2729 if [ -n "$def_restrict_keyword" ]; then
2730 echores "$def_restrict_keyword"
2731 else
2732 echores "none"
2734 # Avoid infinite recursion loop ("#define restrict restrict")
2735 if [ "$def_restrict_keyword" != "restrict" ]; then
2736 def_restrict_keyword="#define restrict $def_restrict_keyword"
2737 else
2738 def_restrict_keyword=""
2742 echocheck "__builtin_expect"
2743 # GCC branch prediction hint
2744 cat > $TMPC << EOF
2745 static int foo(int a) {
2746 a = __builtin_expect(a, 10);
2747 return a == 10 ? 0 : 1;
2749 int main(void) { return foo(10) && foo(0); }
2751 _builtin_expect=no
2752 cc_check && _builtin_expect=yes
2753 if test "$_builtin_expect" = yes ; then
2754 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2755 else
2756 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2758 echores "$_builtin_expect"
2761 echocheck "kstat"
2762 _kstat=no
2763 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2764 if test "$_kstat" = yes ; then
2765 def_kstat="#define HAVE_LIBKSTAT 1"
2766 extra_ldflags="$extra_ldflags -lkstat"
2767 else
2768 def_kstat="#undef HAVE_LIBKSTAT"
2770 echores "$_kstat"
2773 echocheck "posix4"
2774 # required for nanosleep on some systems
2775 _posix4=no
2776 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2777 if test "$_posix4" = yes ; then
2778 extra_ldflags="$extra_ldflags -lposix4"
2780 echores "$_posix4"
2782 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2783 echocheck $func
2784 eval _$func=no
2785 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2786 if eval test "x\$_$func" = "xyes"; then
2787 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2788 echores yes
2789 else
2790 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2791 echores no
2793 done
2796 echocheck "mkstemp"
2797 _mkstemp=no
2798 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2799 if test "$_mkstemp" = yes ; then
2800 def_mkstemp='#define HAVE_MKSTEMP 1'
2801 else
2802 def_mkstemp='#define HAVE_MKSTEMP 0'
2804 echores "$_mkstemp"
2807 echocheck "nanosleep"
2808 _nanosleep=no
2809 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2810 if test "$_nanosleep" = yes ; then
2811 def_nanosleep='#define HAVE_NANOSLEEP 1'
2812 else
2813 def_nanosleep='#undef HAVE_NANOSLEEP'
2815 echores "$_nanosleep"
2818 echocheck "socklib"
2819 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2820 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2821 cat > $TMPC << EOF
2822 #include <netdb.h>
2823 #include <sys/socket.h>
2824 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2826 _socklib=no
2827 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2828 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2829 done
2830 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2831 if test $_winsock2_h = auto ; then
2832 _winsock2_h=no
2833 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2835 test "$_ld_sock" && res_comment="using $_ld_sock"
2836 echores "$_socklib"
2839 if test $_winsock2_h = yes ; then
2840 _ld_sock="-lws2_32"
2841 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2842 else
2843 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2847 echocheck "arpa/inet.h"
2848 arpa_inet_h=no
2849 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2850 header_check arpa/inet.h && arpa_inet_h=yes &&
2851 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2852 echores "$arpa_inet_h"
2855 echocheck "inet_pton()"
2856 def_inet_pton='#define HAVE_INET_PTON 0'
2857 inet_pton=no
2858 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2859 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2860 done
2861 if test $inet_pton = yes ; then
2862 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2863 def_inet_pton='#define HAVE_INET_PTON 1'
2865 echores "$inet_pton"
2868 echocheck "inet_aton()"
2869 def_inet_aton='#define HAVE_INET_ATON 0'
2870 inet_aton=no
2871 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2872 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2873 done
2874 if test $inet_aton = yes ; then
2875 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2876 def_inet_aton='#define HAVE_INET_ATON 1'
2878 echores "$inet_aton"
2881 echocheck "socklen_t"
2882 _socklen_t=no
2883 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2884 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2885 done
2886 if test "$_socklen_t" = yes ; then
2887 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2888 else
2889 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2891 echores "$_socklen_t"
2894 echocheck "closesocket()"
2895 _closesocket=no
2896 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2897 if test "$_closesocket" = yes ; then
2898 def_closesocket='#define HAVE_CLOSESOCKET 1'
2899 else
2900 def_closesocket='#define HAVE_CLOSESOCKET 0'
2902 echores "$_closesocket"
2905 echocheck "networking"
2906 test $_winsock2_h = no && test $inet_pton = no &&
2907 test $inet_aton = no && networking=no
2908 if test "$networking" = yes ; then
2909 def_network='#define CONFIG_NETWORK 1'
2910 def_networking='#define CONFIG_NETWORKING 1'
2911 extra_ldflags="$extra_ldflags $_ld_sock"
2912 inputmodules="networking $inputmodules"
2913 else
2914 noinputmodules="networking $noinputmodules"
2915 def_network='#define CONFIG_NETWORK 0'
2916 def_networking='#undef CONFIG_NETWORKING'
2918 echores "$networking"
2921 echocheck "inet6"
2922 if test "$_inet6" = auto ; then
2923 cat > $TMPC << EOF
2924 #include <sys/types.h>
2925 #if !defined(_WIN32)
2926 #include <sys/socket.h>
2927 #include <netinet/in.h>
2928 #else
2929 #include <ws2tcpip.h>
2930 #endif
2931 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2933 _inet6=no
2934 if cc_check $_ld_sock ; then
2935 _inet6=yes
2938 if test "$_inet6" = yes ; then
2939 def_inet6='#define HAVE_AF_INET6 1'
2940 else
2941 def_inet6='#undef HAVE_AF_INET6'
2943 echores "$_inet6"
2946 echocheck "gethostbyname2"
2947 if test "$_gethostbyname2" = auto ; then
2948 cat > $TMPC << EOF
2949 #include <sys/types.h>
2950 #include <sys/socket.h>
2951 #include <netdb.h>
2952 int main(void) { gethostbyname2("", AF_INET); return 0; }
2954 _gethostbyname2=no
2955 if cc_check ; then
2956 _gethostbyname2=yes
2959 if test "$_gethostbyname2" = yes ; then
2960 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
2961 else
2962 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
2964 echores "$_gethostbyname2"
2967 echocheck "inttypes.h (required)"
2968 _inttypes=no
2969 header_check inttypes.h && _inttypes=yes
2970 echores "$_inttypes"
2972 if test "$_inttypes" = no ; then
2973 echocheck "sys/bitypes.h (inttypes.h predecessor)"
2974 header_check sys/bitypes.h && _inttypes=yes
2975 if test "$_inttypes" = yes ; then
2976 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."
2977 else
2978 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2983 echocheck "malloc.h"
2984 _malloc=no
2985 header_check malloc.h && _malloc=yes
2986 if test "$_malloc" = yes ; then
2987 def_malloc_h='#define HAVE_MALLOC_H 1'
2988 else
2989 def_malloc_h='#define HAVE_MALLOC_H 0'
2991 echores "$_malloc"
2994 echocheck "memalign()"
2995 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2996 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
2997 _memalign=no
2998 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
2999 if test "$_memalign" = yes ; then
3000 def_memalign='#define HAVE_MEMALIGN 1'
3001 else
3002 def_memalign='#define HAVE_MEMALIGN 0'
3003 def_map_memalign='#define memalign(a, b) malloc(b)'
3004 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3006 echores "$_memalign"
3009 echocheck "posix_memalign()"
3010 posix_memalign=no
3011 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3012 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
3013 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3014 echores "$posix_memalign"
3017 echocheck "alloca.h"
3018 _alloca=no
3019 statement_check alloca.h 'alloca(0)' && _alloca=yes
3020 if cc_check ; then
3021 def_alloca_h='#define HAVE_ALLOCA_H 1'
3022 else
3023 def_alloca_h='#undef HAVE_ALLOCA_H'
3025 echores "$_alloca"
3028 echocheck "fastmemcpy"
3029 if test "$_fastmemcpy" = yes ; then
3030 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3031 else
3032 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3034 echores "$_fastmemcpy"
3037 echocheck "mman.h"
3038 _mman=no
3039 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3040 if test "$_mman" = yes ; then
3041 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3042 else
3043 def_mman_h='#undef HAVE_SYS_MMAN_H'
3045 echores "$_mman"
3047 _mman_has_map_failed=no
3048 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
3049 if test "$_mman_has_map_failed" = yes ; then
3050 def_mman_has_map_failed=''
3051 else
3052 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3055 echocheck "dynamic loader"
3056 _dl=no
3057 for _ld_tmp in "" "-ldl"; do
3058 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3059 done
3060 if test "$_dl" = yes ; then
3061 def_dl='#define HAVE_LIBDL 1'
3062 else
3063 def_dl='#undef HAVE_LIBDL'
3065 echores "$_dl"
3068 def_threads='#define HAVE_THREADS 0'
3070 echocheck "pthread"
3071 if linux ; then
3072 THREAD_CFLAGS=-D_REENTRANT
3073 elif freebsd || netbsd || openbsd || bsdos ; then
3074 THREAD_CFLAGS=-D_THREAD_SAFE
3076 if test "$_pthreads" = auto ; then
3077 cat > $TMPC << EOF
3078 #include <pthread.h>
3079 static void *func(void *arg) { return arg; }
3080 int main(void) {
3081 pthread_t tid;
3082 #ifdef PTW32_STATIC_LIB
3083 pthread_win32_process_attach_np();
3084 pthread_win32_thread_attach_np();
3085 #endif
3086 return pthread_create (&tid, 0, func, 0) != 0;
3089 _pthreads=no
3090 if ! hpux ; then
3091 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3092 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3093 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3094 done
3095 if test "$_pthreads" = no && mingw32 ; then
3096 _ld_tmp="-lpthreadGC2 -lws2_32"
3097 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
3101 if test "$_pthreads" = yes ; then
3102 test $_ld_pthread && res_comment="using $_ld_pthread"
3103 def_pthreads='#define HAVE_PTHREADS 1'
3104 def_threads='#define HAVE_THREADS 1'
3105 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3106 else
3107 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3108 def_pthreads='#undef HAVE_PTHREADS'
3109 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3110 mingw32 || _win32dll=no
3112 echores "$_pthreads"
3114 if cygwin ; then
3115 if test "$_pthreads" = yes ; then
3116 def_pthread_cache="#define PTHREAD_CACHE 1"
3117 else
3118 _stream_cache=no
3119 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3123 echocheck "w32threads"
3124 if test "$_pthreads" = yes ; then
3125 res_comment="using pthread instead"
3126 _w32threads=no
3128 if test "$_w32threads" = auto ; then
3129 _w32threads=no
3130 mingw32 && _w32threads=yes
3132 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3133 echores "$_w32threads"
3135 echocheck "rpath"
3136 if test "$_rpath" = yes ; then
3137 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3138 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3139 done
3140 extra_ldflags=$tmp
3142 echores "$_rpath"
3144 echocheck "iconv"
3145 if test "$_iconv" = auto ; then
3146 cat > $TMPC << EOF
3147 #include <stdio.h>
3148 #include <unistd.h>
3149 #include <iconv.h>
3150 #define INBUFSIZE 1024
3151 #define OUTBUFSIZE 4096
3153 char inbuffer[INBUFSIZE];
3154 char outbuffer[OUTBUFSIZE];
3156 int main(void) {
3157 size_t numread;
3158 iconv_t icdsc;
3159 char *tocode="UTF-8";
3160 char *fromcode="cp1250";
3161 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3162 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3163 char *iptr=inbuffer;
3164 char *optr=outbuffer;
3165 size_t inleft=numread;
3166 size_t outleft=OUTBUFSIZE;
3167 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3168 != (size_t)(-1)) {
3169 write(1, outbuffer, OUTBUFSIZE - outleft);
3172 if (iconv_close(icdsc) == -1)
3175 return 0;
3178 _iconv=no
3179 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3180 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3181 _iconv=yes && break
3182 done
3183 if test "$_iconv" != yes ; then
3184 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."
3187 if test "$_iconv" = yes ; then
3188 def_iconv='#define CONFIG_ICONV 1'
3189 else
3190 def_iconv='#undef CONFIG_ICONV'
3192 echores "$_iconv"
3195 echocheck "soundcard.h"
3196 _soundcard_h=no
3197 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3198 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3199 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3200 header_check $_soundcard_header && _soundcard_h=yes &&
3201 res_comment="$_soundcard_header" && break
3202 done
3204 if test "$_soundcard_h" = yes ; then
3205 if test $_soundcard_header = "sys/soundcard.h"; then
3206 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3207 else
3208 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3211 echores "$_soundcard_h"
3214 echocheck "sys/videoio.h"
3215 sys_videoio_h=no
3216 def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
3217 header_check sys/videoio.h && sys_videoio_h=yes &&
3218 def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
3219 echores "$sys_videoio_h"
3222 echocheck "sys/dvdio.h"
3223 _dvdio=no
3224 # FreeBSD 8.1 has broken dvdio.h
3225 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3226 if test "$_dvdio" = yes ; then
3227 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3228 else
3229 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3231 echores "$_dvdio"
3234 echocheck "sys/cdio.h"
3235 _cdio=no
3236 # at least OpenSolaris has a broken cdio.h
3237 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3238 if test "$_cdio" = yes ; then
3239 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3240 else
3241 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3243 echores "$_cdio"
3246 echocheck "linux/cdrom.h"
3247 _cdrom=no
3248 header_check linux/cdrom.h && _cdrom=yes
3249 if test "$_cdrom" = yes ; then
3250 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3251 else
3252 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3254 echores "$_cdrom"
3257 echocheck "dvd.h"
3258 _dvd=no
3259 header_check dvd.h && _dvd=yes
3260 if test "$_dvd" = yes ; then
3261 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3262 else
3263 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3265 echores "$_dvd"
3268 if bsdos; then
3269 echocheck "BSDI dvd.h"
3270 _bsdi_dvd=no
3271 header_check dvd.h && _bsdi_dvd=yes
3272 if test "$_bsdi_dvd" = yes ; then
3273 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3274 else
3275 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3277 echores "$_bsdi_dvd"
3278 fi #if bsdos
3281 if hpux; then
3282 # also used by AIX, but AIX does not support VCD and/or libdvdread
3283 echocheck "HP-UX SCSI header"
3284 _hpux_scsi_h=no
3285 header_check sys/scsi.h && _hpux_scsi_h=yes
3286 if test "$_hpux_scsi_h" = yes ; then
3287 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3288 else
3289 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3291 echores "$_hpux_scsi_h"
3292 fi #if hpux
3295 if sunos; then
3296 echocheck "userspace SCSI headers (Solaris)"
3297 _sol_scsi_h=no
3298 header_check sys/scsi/scsi_types.h &&
3299 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3300 _sol_scsi_h=yes
3301 if test "$_sol_scsi_h" = yes ; then
3302 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3303 else
3304 def_sol_scsi_h='#undef SOLARIS_USCSI'
3306 echores "$_sol_scsi_h"
3307 fi #if sunos
3310 echocheck "termcap"
3311 if test "$_termcap" = auto ; then
3312 _termcap=no
3313 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3314 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3315 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3316 done
3318 if test "$_termcap" = yes ; then
3319 def_termcap='#define HAVE_TERMCAP 1'
3320 test $_ld_tmp && res_comment="using $_ld_tmp"
3321 else
3322 def_termcap='#undef HAVE_TERMCAP'
3324 echores "$_termcap"
3327 echocheck "termios"
3328 def_termios='#undef HAVE_TERMIOS'
3329 def_termios_h='#undef HAVE_TERMIOS_H'
3330 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3331 if test "$_termios" = auto ; then
3332 _termios=no
3333 for _termios_header in "termios.h" "sys/termios.h"; do
3334 header_check $_termios_header && _termios=yes &&
3335 res_comment="using $_termios_header" && break
3336 done
3339 if test "$_termios" = yes ; then
3340 def_termios='#define HAVE_TERMIOS 1'
3341 if test "$_termios_header" = "termios.h" ; then
3342 def_termios_h='#define HAVE_TERMIOS_H 1'
3343 else
3344 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3347 echores "$_termios"
3350 echocheck "shm"
3351 if test "$_shm" = auto ; then
3352 _shm=no
3353 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3355 if test "$_shm" = yes ; then
3356 def_shm='#define HAVE_SHM 1'
3357 else
3358 def_shm='#undef HAVE_SHM'
3360 echores "$_shm"
3363 echocheck "strsep()"
3364 _strsep=no
3365 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3366 if test "$_strsep" = yes ; then
3367 def_strsep='#define HAVE_STRSEP 1'
3368 need_strsep=no
3369 else
3370 def_strsep='#undef HAVE_STRSEP'
3371 need_strsep=yes
3373 echores "$_strsep"
3376 echocheck "vsscanf()"
3377 cat > $TMPC << EOF
3378 #define _ISOC99_SOURCE
3379 #include <stdarg.h>
3380 #include <stdio.h>
3381 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3383 _vsscanf=no
3384 cc_check && _vsscanf=yes
3385 if test "$_vsscanf" = yes ; then
3386 def_vsscanf='#define HAVE_VSSCANF 1'
3387 need_vsscanf=no
3388 else
3389 def_vsscanf='#undef HAVE_VSSCANF'
3390 need_vsscanf=yes
3392 echores "$_vsscanf"
3395 echocheck "swab()"
3396 _swab=no
3397 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3398 statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3399 if test "$_swab" = yes ; then
3400 def_swab='#define HAVE_SWAB 1'
3401 need_swab=no
3402 else
3403 def_swab='#undef HAVE_SWAB'
3404 need_swab=yes
3406 echores "$_swab"
3408 echocheck "POSIX select()"
3409 cat > $TMPC << EOF
3410 #include <stdio.h>
3411 #include <stdlib.h>
3412 #include <sys/types.h>
3413 #include <string.h>
3414 #include <sys/time.h>
3415 #include <unistd.h>
3416 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3418 _posix_select=no
3419 def_posix_select='#undef HAVE_POSIX_SELECT'
3420 cc_check && _posix_select=yes &&
3421 def_posix_select='#define HAVE_POSIX_SELECT 1'
3422 echores "$_posix_select"
3425 echocheck "audio select()"
3426 if test "$_select" = no ; then
3427 def_select='#undef HAVE_AUDIO_SELECT'
3428 elif test "$_select" = yes ; then
3429 def_select='#define HAVE_AUDIO_SELECT 1'
3431 echores "$_select"
3434 echocheck "gettimeofday()"
3435 _gettimeofday=no
3436 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3437 if test "$_gettimeofday" = yes ; then
3438 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3439 need_gettimeofday=no
3440 else
3441 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3442 need_gettimeofday=yes
3444 echores "$_gettimeofday"
3447 echocheck "glob()"
3448 _glob=no
3449 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3450 need_glob=no
3451 if test "$_glob" = yes ; then
3452 def_glob='#define HAVE_GLOB 1'
3453 else
3454 def_glob='#undef HAVE_GLOB'
3455 # HACK! need_glob currently enables compilation of a
3456 # win32-specific glob()-replacement.
3457 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3458 win32 && need_glob=yes
3460 echores "$_glob"
3463 echocheck "setenv()"
3464 _setenv=no
3465 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3466 if test "$_setenv" = yes ; then
3467 def_setenv='#define HAVE_SETENV 1'
3468 need_setenv=no
3469 else
3470 def_setenv='#undef HAVE_SETENV'
3471 need_setenv=yes
3473 echores "$_setenv"
3476 echocheck "setmode()"
3477 _setmode=no
3478 def_setmode='#define HAVE_SETMODE 0'
3479 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3480 echores "$_setmode"
3483 if sunos; then
3484 echocheck "sysi86()"
3485 _sysi86=no
3486 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3487 if test "$_sysi86" = yes ; then
3488 def_sysi86='#define HAVE_SYSI86 1'
3489 statement_check sys/sysi86.h 'int sysi86(int, void*); sysi86(0)' && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3490 else
3491 def_sysi86='#undef HAVE_SYSI86'
3493 echores "$_sysi86"
3494 fi #if sunos
3497 echocheck "sys/sysinfo.h"
3498 _sys_sysinfo=no
3499 statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
3500 if test "$_sys_sysinfo" = yes ; then
3501 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3502 else
3503 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3505 echores "$_sys_sysinfo"
3508 if darwin; then
3510 echocheck "Mac OS X Finder Support"
3511 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3512 if test "$_macosx_finder" = yes ; then
3513 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3514 extra_ldflags="$extra_ldflags -framework Cocoa"
3516 echores "$_macosx_finder"
3518 echocheck "Mac OS X Bundle file locations"
3519 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3520 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3521 if test "$_macosx_bundle" = yes ; then
3522 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3524 echores "$_macosx_bundle"
3526 echocheck "Apple Remote"
3527 if test "$_apple_remote" = auto ; then
3528 _apple_remote=no
3529 cat > $TMPC <<EOF
3530 #include <stdio.h>
3531 #include <IOKit/IOCFPlugIn.h>
3532 int main(void) {
3533 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3534 CFMutableDictionaryRef hidMatchDictionary;
3535 IOReturn ioReturnValue;
3537 // Set up a matching dictionary to search the I/O Registry by class.
3538 // name for all HID class devices
3539 hidMatchDictionary = IOServiceMatching("AppleIRController");
3541 // Now search I/O Registry for matching devices.
3542 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3543 hidMatchDictionary, &hidObjectIterator);
3545 // If search is unsuccessful, return nonzero.
3546 if (ioReturnValue != kIOReturnSuccess ||
3547 !IOIteratorIsValid(hidObjectIterator)) {
3548 return 1;
3550 return 0;
3553 cc_check -framework IOKit && _apple_remote=yes
3555 if test "$_apple_remote" = yes ; then
3556 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3557 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3558 else
3559 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3561 echores "$_apple_remote"
3563 fi #if darwin
3565 if linux; then
3567 echocheck "Apple IR"
3568 if test "$_apple_ir" = auto ; then
3569 _apple_ir=no
3570 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3572 if test "$_apple_ir" = yes ; then
3573 def_apple_ir='#define CONFIG_APPLE_IR 1'
3574 else
3575 def_apple_ir='#undef CONFIG_APPLE_IR'
3577 echores "$_apple_ir"
3578 fi #if linux
3580 echocheck "pkg-config"
3581 if $($_pkg_config --version > /dev/null 2>&1); then
3582 if test "$_ld_static"; then
3583 _pkg_config="$_pkg_config --static"
3585 echores "yes"
3586 else
3587 _pkg_config=false
3588 echores "no"
3592 echocheck "Samba support (libsmbclient)"
3593 if test "$_smb" = yes; then
3594 extra_ldflags="$extra_ldflags -lsmbclient"
3596 if test "$_smb" = auto; then
3597 _smb=no
3598 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3599 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3600 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3601 done
3604 if test "$_smb" = yes; then
3605 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3606 inputmodules="smb $inputmodules"
3607 else
3608 def_smb="#undef CONFIG_LIBSMBCLIENT"
3609 noinputmodules="smb $noinputmodules"
3611 echores "$_smb"
3614 #########
3615 # VIDEO #
3616 #########
3619 echocheck "tdfxfb"
3620 if test "$_tdfxfb" = yes ; then
3621 def_tdfxfb='#define CONFIG_TDFXFB 1'
3622 vomodules="tdfxfb $vomodules"
3623 else
3624 def_tdfxfb='#undef CONFIG_TDFXFB'
3625 novomodules="tdfxfb $novomodules"
3627 echores "$_tdfxfb"
3629 echocheck "s3fb"
3630 if test "$_s3fb" = yes ; then
3631 def_s3fb='#define CONFIG_S3FB 1'
3632 vomodules="s3fb $vomodules"
3633 else
3634 def_s3fb='#undef CONFIG_S3FB'
3635 novomodules="s3fb $novomodules"
3637 echores "$_s3fb"
3639 echocheck "wii"
3640 if test "$_wii" = yes ; then
3641 def_wii='#define CONFIG_WII 1'
3642 vomodules="wii $vomodules"
3643 else
3644 def_wii='#undef CONFIG_WII'
3645 novomodules="wii $novomodules"
3647 echores "$_wii"
3649 echocheck "tdfxvid"
3650 if test "$_tdfxvid" = yes ; then
3651 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3652 vomodules="tdfx_vid $vomodules"
3653 else
3654 def_tdfxvid='#undef CONFIG_TDFX_VID'
3655 novomodules="tdfx_vid $novomodules"
3657 echores "$_tdfxvid"
3659 echocheck "xvr100"
3660 if test "$_xvr100" = auto ; then
3661 cat > $TMPC << EOF
3662 #include <unistd.h>
3663 #include <sys/fbio.h>
3664 #include <sys/visual_io.h>
3665 int main(void) {
3666 struct vis_identifier ident;
3667 struct fbgattr attr;
3668 ioctl(0, VIS_GETIDENTIFIER, &ident);
3669 ioctl(0, FBIOGATTR, &attr);
3670 return 0;
3673 _xvr100=no
3674 cc_check && _xvr100=yes
3676 if test "$_xvr100" = yes ; then
3677 def_xvr100='#define CONFIG_XVR100 1'
3678 vomodules="xvr100 $vomodules"
3679 else
3680 def_tdfxvid='#undef CONFIG_XVR100'
3681 novomodules="xvr100 $novomodules"
3683 echores "$_xvr100"
3685 echocheck "tga"
3686 if test "$_tga" = yes ; then
3687 def_tga='#define CONFIG_TGA 1'
3688 vomodules="tga $vomodules"
3689 else
3690 def_tga='#undef CONFIG_TGA'
3691 novomodules="tga $novomodules"
3693 echores "$_tga"
3696 echocheck "md5sum support"
3697 if test "$_md5sum" = yes; then
3698 def_md5sum="#define CONFIG_MD5SUM 1"
3699 vomodules="md5sum $vomodules"
3700 else
3701 def_md5sum="#undef CONFIG_MD5SUM"
3702 novomodules="md5sum $novomodules"
3704 echores "$_md5sum"
3707 echocheck "yuv4mpeg support"
3708 if test "$_yuv4mpeg" = yes; then
3709 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3710 vomodules="yuv4mpeg $vomodules"
3711 else
3712 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3713 novomodules="yuv4mpeg $novomodules"
3715 echores "$_yuv4mpeg"
3718 echocheck "bl"
3719 if test "$_bl" = yes ; then
3720 def_bl='#define CONFIG_BL 1'
3721 vomodules="bl $vomodules"
3722 else
3723 def_bl='#undef CONFIG_BL'
3724 novomodules="bl $novomodules"
3726 echores "$_bl"
3729 echocheck "DirectFB"
3730 if test "$_directfb" = auto ; then
3731 _directfb=no
3732 cat > $TMPC << EOF
3733 #include <directfb.h>
3734 #include <directfb_version.h>
3735 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3736 #error "DirectFB version too old."
3737 #endif
3738 int main(void) { DirectFBInit(0, 0); return 0; }
3740 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3741 cc_check $_inc_tmp -ldirectfb &&
3742 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3743 done
3745 if test "$_directfb" = yes ; then
3746 def_directfb='#define CONFIG_DIRECTFB 1'
3747 vomodules="directfb dfbmga $vomodules"
3748 libs_mplayer="$libs_mplayer -ldirectfb"
3749 else
3750 def_directfb='#undef CONFIG_DIRECTFB'
3751 novomodules="directfb dfbmga $novomodules"
3753 echores "$_directfb"
3756 if darwin; then
3758 echocheck "QuickTime"
3759 if test "$quicktime" = auto ; then
3760 quicktime=no
3761 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
3763 if test "$quicktime" = yes ; then
3764 extra_ldflags="$extra_ldflags -framework QuickTime"
3765 def_quicktime='#define CONFIG_QUICKTIME 1'
3766 else
3767 def_quicktime='#undef CONFIG_QUICKTIME'
3769 echores $quicktime
3771 echocheck "Cocoa"
3772 if test "$_cocoa" = auto ; then
3773 cat > $TMPC <<EOF
3774 #include <CoreServices/CoreServices.h>
3775 #include <OpenGL/OpenGL.h>
3776 int main(void) {
3777 NSApplicationLoad();
3780 _cocoa=no
3781 cc_check -framework Cocoa -framework OpenGL && _cocoa=yes
3783 if test "$_cocoa" = yes ; then
3784 libs_mplayer="$libs_mplayer -framework Cocoa -framework OpenGL"
3785 def_cocoa='#define CONFIG_COCOA 1'
3786 else
3787 def_cocoa='#undef CONFIG_COCOA'
3789 echores "$_cocoa"
3791 echocheck "CoreVideo"
3792 if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
3793 cat > $TMPC <<EOF
3794 #include <QuartzCore/CoreVideo.h>
3795 int main(void) { return 0; }
3797 _corevideo=no
3798 cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
3800 if test "$_corevideo" = yes ; then
3801 vomodules="corevideo $vomodules"
3802 libs_mplayer="$libs_mplayer -framework QuartzCore"
3803 def_corevideo='#define CONFIG_COREVIDEO 1'
3804 else
3805 novomodules="corevideo $novomodules"
3806 def_corevideo='#undef CONFIG_COREVIDEO'
3808 echores "$_corevideo"
3810 echocheck "SharedBuffer"
3811 if test "$_sharedbuffer" = auto ; then
3812 cat > $TMPC <<EOF
3813 int main(void) {
3814 NSApplicationLoad();
3817 _sharedbuffer=no
3818 cc_check -framework Cocoa && _sharedbuffer=yes
3820 if test "$_sharedbuffer" = yes ; then
3821 vomodules="sharedbuffer $vomodules"
3822 libs_mplayer="$libs_mplayer -framework Cocoa"
3823 def_sharedbuffer='#define CONFIG_SHAREDBUFFER 1'
3824 else
3825 novomodules="sharedbuffer $novomodules"
3826 def_sharedbuffer='#undef CONFIG_SHAREDBUFFER'
3828 echores "$_sharedbuffer"
3830 depends_on_application_services(){
3831 test "$_corevideo" = yes
3834 fi #if darwin
3837 echocheck "X11 headers presence"
3838 _x11_headers="no"
3839 res_comment="check if the dev(el) packages are installed"
3840 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3841 if test -f "$I/X11/Xlib.h" ; then
3842 _x11_headers="yes"
3843 res_comment=""
3844 break
3846 done
3847 if test $_cross_compile = no; then
3848 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3849 /usr/include/X11R6 /usr/openwin/include ; do
3850 if test -f "$I/X11/Xlib.h" ; then
3851 extra_cflags="$extra_cflags -I$I"
3852 _x11_headers="yes"
3853 res_comment="using $I"
3854 break
3856 done
3858 echores "$_x11_headers"
3861 echocheck "X11"
3862 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3863 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3864 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3865 -L/usr/lib ; do
3866 if netbsd; then
3867 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3868 else
3869 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3871 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3872 _x11=yes
3873 # Check that there aren't conflicting headers between ApplicationServices
3874 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3875 # is included by -framework ApplicationServices and clashes with the X11
3876 # definition of the "Cursor" type.
3877 if darwin && depends_on_application_services && test "$_x11" = yes ; then
3878 _x11=no
3879 header_check_broken ApplicationServices/ApplicationServices.h \
3880 X11/Xutil.h $_ld_tmp && _x11=yes
3882 if test "$_x11" = yes ; then
3883 libs_mplayer="$libs_mplayer $_ld_tmp"
3884 break
3886 done
3888 if test "$_x11" = yes ; then
3889 def_x11='#define CONFIG_X11 1'
3890 vomodules="x11 xover $vomodules"
3891 else
3892 _x11=no
3893 def_x11='#undef CONFIG_X11'
3894 novomodules="x11 $novomodules"
3895 res_comment="check if the dev(el) packages are installed"
3897 echores "$_x11"
3899 echocheck "Xss screensaver extensions"
3900 if test "$_xss" = auto ; then
3901 _xss=no
3902 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3904 if test "$_xss" = yes ; then
3905 def_xss='#define CONFIG_XSS 1'
3906 libs_mplayer="$libs_mplayer -lXss"
3907 else
3908 def_xss='#undef CONFIG_XSS'
3910 echores "$_xss"
3912 echocheck "DPMS"
3913 _xdpms3=no
3914 _xdpms4=no
3915 if test "$_x11" = yes ; then
3916 cat > $TMPC <<EOF
3917 #include <X11/Xmd.h>
3918 #include <X11/Xlib.h>
3919 #include <X11/Xutil.h>
3920 #include <X11/Xatom.h>
3921 #include <X11/extensions/dpms.h>
3922 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3924 cc_check -lXdpms && _xdpms3=yes
3925 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3927 if test "$_xdpms4" = yes ; then
3928 def_xdpms='#define CONFIG_XDPMS 1'
3929 res_comment="using Xdpms 4"
3930 echores "yes"
3931 elif test "$_xdpms3" = yes ; then
3932 def_xdpms='#define CONFIG_XDPMS 1'
3933 libs_mplayer="$libs_mplayer -lXdpms"
3934 res_comment="using Xdpms 3"
3935 echores "yes"
3936 else
3937 def_xdpms='#undef CONFIG_XDPMS'
3938 echores "no"
3942 echocheck "Xv"
3943 if test "$_xv" = auto && test "$_x11" = yes ; then
3944 _xv=no
3945 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3948 if test "$_xv" = yes ; then
3949 def_xv='#define CONFIG_XV 1'
3950 libs_mplayer="$libs_mplayer -lXv"
3951 vomodules="xv $vomodules"
3952 else
3953 def_xv='#undef CONFIG_XV'
3954 novomodules="xv $novomodules"
3956 echores "$_xv"
3959 echocheck "VDPAU"
3960 if test "$_vdpau" = auto && test "$_x11" = yes ; then
3961 _vdpau=no
3962 if test "$_dl" = yes ; then
3963 pkg_config_add 'vdpau >= 0.2' && _vdpau=yes
3966 if test "$_vdpau" = yes ; then
3967 def_vdpau='#define CONFIG_VDPAU 1'
3968 vomodules="vdpau $vomodules"
3969 else
3970 def_vdpau='#define CONFIG_VDPAU 0'
3971 novomodules="vdpau $novomodules"
3973 echores "$_vdpau"
3976 echocheck "Xinerama"
3977 if test "$_xinerama" = auto && test "$_x11" = yes ; then
3978 _xinerama=no
3979 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
3982 if test "$_xinerama" = yes ; then
3983 def_xinerama='#define CONFIG_XINERAMA 1'
3984 libs_mplayer="$libs_mplayer -lXinerama"
3985 else
3986 def_xinerama='#undef CONFIG_XINERAMA'
3988 echores "$_xinerama"
3991 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3992 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3993 # named 'X extensions' or something similar.
3994 # This check may be useful for future mplayer versions (to change resolution)
3995 # If you run into problems, remove '-lXxf86vm'.
3996 echocheck "Xxf86vm"
3997 if test "$_vm" = auto && test "$_x11" = yes ; then
3998 _vm=no
3999 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
4001 if test "$_vm" = yes ; then
4002 def_vm='#define CONFIG_XF86VM 1'
4003 libs_mplayer="$libs_mplayer -lXxf86vm"
4004 else
4005 def_vm='#undef CONFIG_XF86VM'
4007 echores "$_vm"
4009 # Check for the presence of special keycodes, like audio control buttons
4010 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4011 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4012 # have these new keycodes.
4013 echocheck "XF86keysym"
4014 if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
4015 _xf86keysym=no
4016 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
4018 if test "$_xf86keysym" = yes ; then
4019 def_xf86keysym='#define CONFIG_XF86XK 1'
4020 else
4021 def_xf86keysym='#undef CONFIG_XF86XK'
4023 echores "$_xf86keysym"
4025 echocheck "DGA"
4026 if test "$_dga2" = auto && test "$_x11" = yes ; then
4027 _dga2=no
4028 statement_check_broken X11/Xlib.h X11/extensions/Xxf86dga.h 'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2=yes
4030 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4031 _dga1=no
4032 statement_check_broken X11/Xlib.h X11/extensions/Xxf86dga.h 'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1=yes
4035 _dga=no
4036 def_dga='#undef CONFIG_DGA'
4037 def_dga1='#undef CONFIG_DGA1'
4038 def_dga2='#undef CONFIG_DGA2'
4039 if test "$_dga1" = yes ; then
4040 _dga=yes
4041 def_dga1='#define CONFIG_DGA1 1'
4042 res_comment="using DGA 1.0"
4043 elif test "$_dga2" = yes ; then
4044 _dga=yes
4045 def_dga2='#define CONFIG_DGA2 1'
4046 res_comment="using DGA 2.0"
4048 if test "$_dga" = yes ; then
4049 def_dga='#define CONFIG_DGA 1'
4050 libs_mplayer="$libs_mplayer -lXxf86dga"
4051 vomodules="dga $vomodules"
4052 else
4053 novomodules="dga $novomodules"
4055 echores "$_dga"
4058 echocheck "3dfx"
4059 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4060 def_3dfx='#define CONFIG_3DFX 1'
4061 vomodules="3dfx $vomodules"
4062 else
4063 _3dfx=no
4064 def_3dfx='#undef CONFIG_3DFX'
4065 novomodules="3dfx $novomodules"
4067 echores "$_3dfx"
4070 echocheck "GGI"
4071 if test "$_ggi" = auto ; then
4072 _ggi=no
4073 statement_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4075 if test "$_ggi" = yes ; then
4076 def_ggi='#define CONFIG_GGI 1'
4077 libs_mplayer="$libs_mplayer -lggi"
4078 vomodules="ggi $vomodules"
4079 else
4080 def_ggi='#undef CONFIG_GGI'
4081 novomodules="ggi $novomodules"
4083 echores "$_ggi"
4085 echocheck "GGI extension: libggiwmh"
4086 if test "$_ggiwmh" = auto ; then
4087 _ggiwmh=no
4088 statement_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4090 # needed to get right output on obscure combination
4091 # like --disable-ggi --enable-ggiwmh
4092 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4093 def_ggiwmh='#define CONFIG_GGIWMH 1'
4094 libs_mplayer="$libs_mplayer -lggiwmh"
4095 else
4096 _ggiwmh=no
4097 def_ggiwmh='#undef CONFIG_GGIWMH'
4099 echores "$_ggiwmh"
4102 echocheck "AA"
4103 if test "$_aa" = auto ; then
4104 cat > $TMPC << EOF
4105 #include <aalib.h>
4106 int main(void) {
4107 aa_context *c;
4108 aa_renderparams *p;
4109 aa_init(0, 0, 0);
4110 c = aa_autoinit(&aa_defparams);
4111 p = aa_getrenderparams();
4112 aa_autoinitkbd(c, 0);
4113 return 0; }
4115 _aa=no
4116 for _ld_tmp in "-laa" ; do
4117 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4118 done
4120 if test "$_aa" = yes ; then
4121 def_aa='#define CONFIG_AA 1'
4122 if cygwin ; then
4123 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4125 vomodules="aa $vomodules"
4126 else
4127 def_aa='#undef CONFIG_AA'
4128 novomodules="aa $novomodules"
4130 echores "$_aa"
4133 echocheck "CACA"
4134 if test "$_caca" = auto ; then
4135 _caca=no
4136 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4137 cat > $TMPC << EOF
4138 #include <caca.h>
4139 #ifdef CACA_API_VERSION_1
4140 #include <caca0.h>
4141 #endif
4142 int main(void) { caca_init(); return 0; }
4144 cc_check $(caca-config --libs) && _caca=yes
4147 if test "$_caca" = yes ; then
4148 def_caca='#define CONFIG_CACA 1'
4149 extra_cflags="$extra_cflags $(caca-config --cflags)"
4150 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4151 vomodules="caca $vomodules"
4152 else
4153 def_caca='#undef CONFIG_CACA'
4154 novomodules="caca $novomodules"
4156 echores "$_caca"
4159 echocheck "SVGAlib"
4160 if test "$_svga" = auto ; then
4161 _svga=no
4162 header_check vga.h -lvga $_ld_lm && _svga=yes
4164 if test "$_svga" = yes ; then
4165 def_svga='#define CONFIG_SVGALIB 1'
4166 libs_mplayer="$libs_mplayer -lvga"
4167 vomodules="svga $vomodules"
4168 else
4169 def_svga='#undef CONFIG_SVGALIB'
4170 novomodules="svga $novomodules"
4172 echores "$_svga"
4175 echocheck "FBDev"
4176 if test "$_fbdev" = auto ; then
4177 _fbdev=no
4178 linux && _fbdev=yes
4180 if test "$_fbdev" = yes ; then
4181 def_fbdev='#define CONFIG_FBDEV 1'
4182 vomodules="fbdev $vomodules"
4183 else
4184 def_fbdev='#undef CONFIG_FBDEV'
4185 novomodules="fbdev $novomodules"
4187 echores "$_fbdev"
4191 echocheck "DVB"
4192 if test "$_dvb" = auto ; then
4193 _dvb=no
4194 cat >$TMPC << EOF
4195 #include <poll.h>
4196 #include <sys/ioctl.h>
4197 #include <stdio.h>
4198 #include <time.h>
4199 #include <unistd.h>
4200 #include <linux/dvb/dmx.h>
4201 #include <linux/dvb/frontend.h>
4202 #include <linux/dvb/video.h>
4203 #include <linux/dvb/audio.h>
4204 int main(void) {return 0;}
4206 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4207 cc_check $_inc_tmp && _dvb=yes &&
4208 extra_cflags="$extra_cflags $_inc_tmp" && break
4209 done
4211 echores "$_dvb"
4212 if test "$_dvb" = yes ; then
4213 _dvbin=yes
4214 inputmodules="dvb $inputmodules"
4215 def_dvb='#define CONFIG_DVB 1'
4216 def_dvbin='#define CONFIG_DVBIN 1'
4217 aomodules="mpegpes(dvb) $aomodules"
4218 vomodules="mpegpes(dvb) $vomodules"
4219 else
4220 _dvbin=no
4221 noinputmodules="dvb $noinputmodules"
4222 def_dvb='#undef CONFIG_DVB'
4223 def_dvbin='#undef CONFIG_DVBIN '
4224 aomodules="mpegpes(file) $aomodules"
4225 vomodules="mpegpes(file) $vomodules"
4229 echocheck "PNG support"
4230 if test "$_png" = auto ; then
4231 _png=no
4232 cat > $TMPC << EOF
4233 #include <stdio.h>
4234 #include <string.h>
4235 #include <png.h>
4236 int main(void) {
4237 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4238 printf("libpng: %s\n", png_libpng_ver);
4239 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4242 cc_check -lpng -lz $_ld_lm && _png=yes
4244 echores "$_png"
4245 if test "$_png" = yes ; then
4246 def_png='#define CONFIG_PNG 1'
4247 extra_ldflags="$extra_ldflags -lpng -lz"
4248 else
4249 def_png='#undef CONFIG_PNG'
4252 echocheck "MNG support"
4253 if test "$_mng" = auto ; then
4254 _mng=no
4255 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
4257 echores "$_mng"
4258 if test "$_mng" = yes ; then
4259 def_mng='#define CONFIG_MNG 1'
4260 extra_ldflags="$extra_ldflags -lmng -lz"
4261 else
4262 def_mng='#undef CONFIG_MNG'
4265 echocheck "JPEG support"
4266 if test "$_jpeg" = auto ; then
4267 _jpeg=no
4268 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
4270 echores "$_jpeg"
4272 if test "$_jpeg" = yes ; then
4273 def_jpeg='#define CONFIG_JPEG 1'
4274 vomodules="jpeg $vomodules"
4275 extra_ldflags="$extra_ldflags -ljpeg"
4276 else
4277 def_jpeg='#undef CONFIG_JPEG'
4278 novomodules="jpeg $novomodules"
4283 echocheck "PNM support"
4284 if test "$_pnm" = yes; then
4285 def_pnm="#define CONFIG_PNM 1"
4286 vomodules="pnm $vomodules"
4287 else
4288 def_pnm="#undef CONFIG_PNM"
4289 novomodules="pnm $novomodules"
4291 echores "$_pnm"
4295 echocheck "GIF support"
4296 # This is to appease people who want to force gif support.
4297 # If it is forced to yes, then we still do checks to determine
4298 # which gif library to use.
4299 if test "$_gif" = yes ; then
4300 _force_gif=yes
4301 _gif=auto
4304 if test "$_gif" = auto ; then
4305 _gif=no
4306 for _ld_gif in "-lungif" "-lgif" ; do
4307 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4308 done
4311 # If no library was found, and the user wants support forced,
4312 # then we force it on with libgif, as this is the safest
4313 # assumption IMHO. (libungif & libregif both create symbolic
4314 # links to libgif. We also assume that no x11 support is needed,
4315 # because if you are forcing this, then you _should_ know what
4316 # you are doing. [ Besides, package maintainers should never
4317 # have compiled x11 deps into libungif in the first place. ] )
4318 # </rant>
4319 # --Joey
4320 if test "$_force_gif" = yes && test "$_gif" = no ; then
4321 _gif=yes
4322 _ld_gif="-lgif"
4325 if test "$_gif" = yes ; then
4326 def_gif='#define CONFIG_GIF 1'
4327 codecmodules="gif $codecmodules"
4328 vomodules="gif89a $vomodules"
4329 res_comment="old version, some encoding functions disabled"
4330 def_gif_4='#undef CONFIG_GIF_4'
4331 extra_ldflags="$extra_ldflags $_ld_gif"
4333 cat > $TMPC << EOF
4334 #include <signal.h>
4335 #include <stdio.h>
4336 #include <stdlib.h>
4337 #include <gif_lib.h>
4338 static void catch(int sig) { exit(1); }
4339 int main(void) {
4340 signal(SIGSEGV, catch); // catch segfault
4341 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4342 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4343 return 0;
4346 if cc_check "$_ld_gif" ; then
4347 def_gif_4='#define CONFIG_GIF_4 1'
4348 res_comment=""
4350 else
4351 def_gif='#undef CONFIG_GIF'
4352 def_gif_4='#undef CONFIG_GIF_4'
4353 novomodules="gif89a $novomodules"
4354 nocodecmodules="gif $nocodecmodules"
4356 echores "$_gif"
4359 case "$_gif" in yes*)
4360 echocheck "broken giflib workaround"
4361 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4363 cat > $TMPC << EOF
4364 #include <stdio.h>
4365 #include <gif_lib.h>
4366 int main(void) {
4367 GifFileType gif = {.UserData = NULL};
4368 printf("UserData is at address %p\n", gif.UserData);
4369 return 0;
4372 if cc_check "$_ld_gif" ; then
4373 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4374 echores "disabled"
4375 else
4376 echores "enabled"
4379 esac
4382 echocheck "VESA support"
4383 if test "$_vesa" = auto ; then
4384 _vesa=no
4385 statement_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4387 if test "$_vesa" = yes ; then
4388 def_vesa='#define CONFIG_VESA 1'
4389 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4390 vomodules="vesa $vomodules"
4391 else
4392 def_vesa='#undef CONFIG_VESA'
4393 novomodules="vesa $novomodules"
4395 echores "$_vesa"
4397 #################
4398 # VIDEO + AUDIO #
4399 #################
4402 echocheck "SDL"
4403 _inc_tmp=""
4404 _ld_tmp=""
4405 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4406 if test -z "$_sdlconfig" ; then
4407 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4408 _sdlconfig="sdl-config"
4409 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4410 _sdlconfig="sdl11-config"
4411 else
4412 _sdlconfig=false
4415 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4416 cat > $TMPC << EOF
4417 #ifdef CONFIG_SDL_SDL_H
4418 #include <SDL/SDL.h>
4419 #else
4420 #include <SDL.h>
4421 #endif
4422 #ifndef __APPLE__
4423 // we allow SDL hacking our main() only on OSX
4424 #undef main
4425 #endif
4426 int main(int argc, char *argv[]) {
4427 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4428 return 0;
4431 _sdl=no
4432 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4433 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4434 _sdl=yes
4435 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4436 break
4438 done
4439 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4440 res_comment="using $_sdlconfig"
4441 if cygwin ; then
4442 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4443 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4444 elif mingw32 ; then
4445 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4446 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4447 else
4448 _inc_tmp="$($_sdlconfig --cflags)"
4449 _ld_tmp="$($_sdlconfig --libs)"
4451 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4452 _sdl=yes
4453 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4454 # HACK for BeOS/Haiku SDL
4455 _ld_tmp="$_ld_tmp -lstdc++"
4456 _sdl=yes
4460 if test "$_sdl" = yes ; then
4461 def_sdl='#define CONFIG_SDL 1'
4462 extra_cflags="$extra_cflags $_inc_tmp"
4463 libs_mplayer="$libs_mplayer $_ld_tmp"
4464 vomodules="sdl $vomodules"
4465 aomodules="sdl $aomodules"
4466 else
4467 def_sdl='#undef CONFIG_SDL'
4468 novomodules="sdl $novomodules"
4469 noaomodules="sdl $noaomodules"
4471 echores "$_sdl"
4474 # make sure this stays below CoreVideo to avoid issues due to namespace
4475 # conflicts between -lGL and -framework OpenGL
4476 echocheck "OpenGL"
4477 #Note: this test is run even with --enable-gl since we autodetect linker flags
4478 if (test "$_x11" = yes || test "$_sdl" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
4479 cat > $TMPC << EOF
4480 #ifdef GL_WIN32
4481 #include <windows.h>
4482 #include <GL/gl.h>
4483 #elif defined(GL_SDL)
4484 #include <GL/gl.h>
4485 #ifdef CONFIG_SDL_SDL_H
4486 #include <SDL/SDL.h>
4487 #else
4488 #include <SDL.h>
4489 #endif
4490 #ifndef __APPLE__
4491 // we allow SDL hacking our main() only on OSX
4492 #undef main
4493 #endif
4494 #else
4495 #include <GL/gl.h>
4496 #include <X11/Xlib.h>
4497 #include <GL/glx.h>
4498 #endif
4499 int main(int argc, char *argv[]) {
4500 #ifdef GL_WIN32
4501 HDC dc;
4502 wglCreateContext(dc);
4503 #elif defined(GL_SDL)
4504 SDL_GL_SwapBuffers();
4505 #else
4506 glXCreateContext(NULL, NULL, NULL, True);
4507 #endif
4508 glFinish();
4509 return 0;
4512 _gl=no
4513 if test "$_x11" = yes ; then
4514 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4515 if cc_check $_ld_tmp $_ld_lm ; then
4516 _gl=yes
4517 _gl_x11=yes
4518 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4519 break
4521 done
4523 if win32 && cc_check -DGL_WIN32 -lopengl32 ; then
4524 _gl=yes
4525 _gl_win32=yes
4526 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4528 if test "$_cocoa" = yes ; then
4529 _gl=yes
4530 _gl_cocoa=yes
4532 # last so it can reuse any linker etc. flags detected before
4533 if test "$_sdl" = yes ; then
4534 if cc_check -DGL_SDL ||
4535 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4536 _gl=yes
4537 _gl_sdl=yes
4538 elif cc_check -DGL_SDL -lGL ||
4539 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4540 _gl=yes
4541 _gl_sdl=yes
4542 libs_mplayer="$libs_mplayer -lGL"
4545 else
4546 _gl=no
4548 if test "$_gl" = yes ; then
4549 def_gl='#define CONFIG_GL 1'
4550 res_comment="backends:"
4551 if test "$_gl_cocoa" = yes ; then
4552 def_gl_cocoa='#define CONFIG_GL_COCOA 1'
4553 res_comment="$res_comment cocoa"
4555 if test "$_gl_win32" = yes ; then
4556 def_gl_win32='#define CONFIG_GL_WIN32 1'
4557 res_comment="$res_comment win32"
4559 if test "$_gl_x11" = yes ; then
4560 def_gl_x11='#define CONFIG_GL_X11 1'
4561 res_comment="$res_comment x11"
4563 if test "$_gl_sdl" = yes ; then
4564 def_gl_sdl='#define CONFIG_GL_SDL 1'
4565 res_comment="$res_comment sdl"
4567 vomodules="opengl $vomodules"
4568 else
4569 def_gl='#undef CONFIG_GL'
4570 def_gl_cocoa='#undef CONFIG_GL_COCOA'
4571 def_gl_win32='#undef CONFIG_GL_WIN32'
4572 def_gl_x11='#undef CONFIG_GL_X11'
4573 def_gl_sdl='#undef CONFIG_GL_SDL'
4574 novomodules="opengl $novomodules"
4576 echores "$_gl"
4579 if win32; then
4581 echocheck "Windows waveout"
4582 if test "$_win32waveout" = auto ; then
4583 _win32waveout=no
4584 header_check_broken windows.h mmsystem.h -lwinmm && _win32waveout=yes
4586 if test "$_win32waveout" = yes ; then
4587 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4588 libs_mplayer="$libs_mplayer -lwinmm"
4589 aomodules="win32 $aomodules"
4590 else
4591 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4592 noaomodules="win32 $noaomodules"
4594 echores "$_win32waveout"
4596 echocheck "Direct3D"
4597 if test "$_direct3d" = auto ; then
4598 _direct3d=no
4599 header_check d3d9.h && _direct3d=yes
4601 if test "$_direct3d" = yes ; then
4602 def_direct3d='#define CONFIG_DIRECT3D 1'
4603 vomodules="direct3d $vomodules"
4604 else
4605 def_direct3d='#undef CONFIG_DIRECT3D'
4606 novomodules="direct3d $novomodules"
4608 echores "$_direct3d"
4610 echocheck "Directx"
4611 if test "$_directx" = auto ; then
4612 cat > $TMPC << EOF
4613 #include <ddraw.h>
4614 #include <dsound.h>
4615 int main(void) { return 0; }
4617 _directx=no
4618 cc_check -lgdi32 && _directx=yes
4620 if test "$_directx" = yes ; then
4621 def_directx='#define CONFIG_DIRECTX 1'
4622 libs_mplayer="$libs_mplayer -lgdi32"
4623 vomodules="directx $vomodules"
4624 aomodules="dsound $aomodules"
4625 else
4626 def_directx='#undef CONFIG_DIRECTX'
4627 novomodules="directx $novomodules"
4628 noaomodules="dsound $noaomodules"
4630 echores "$_directx"
4632 fi #if win32; then
4635 echocheck "DXR3/H+"
4636 if test "$_dxr3" = auto ; then
4637 _dxr3=no
4638 header_check linux/em8300.h && _dxr3=yes
4640 if test "$_dxr3" = yes ; then
4641 def_dxr3='#define CONFIG_DXR3 1'
4642 vomodules="dxr3 $vomodules"
4643 else
4644 def_dxr3='#undef CONFIG_DXR3'
4645 novomodules="dxr3 $novomodules"
4647 echores "$_dxr3"
4650 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4651 if test "$_ivtv" = auto ; then
4652 cat > $TMPC << EOF
4653 #include <sys/time.h>
4654 #include <linux/videodev2.h>
4655 #include <linux/ivtv.h>
4656 #include <sys/ioctl.h>
4657 int main(void) {
4658 struct ivtv_cfg_stop_decode sd;
4659 struct ivtv_cfg_start_decode sd1;
4660 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4661 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
4662 return 0; }
4664 _ivtv=no
4665 cc_check && _ivtv=yes
4667 if test "$_ivtv" = yes ; then
4668 def_ivtv='#define CONFIG_IVTV 1'
4669 vomodules="ivtv $vomodules"
4670 aomodules="ivtv $aomodules"
4671 else
4672 def_ivtv='#undef CONFIG_IVTV'
4673 novomodules="ivtv $novomodules"
4674 noaomodules="ivtv $noaomodules"
4676 echores "$_ivtv"
4679 echocheck "V4L2 MPEG Decoder"
4680 if test "$_v4l2" = auto ; then
4681 cat > $TMPC << EOF
4682 #include <sys/time.h>
4683 #include <linux/videodev2.h>
4684 #include <linux/version.h>
4685 int main(void) {
4686 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4687 #error kernel headers too old, need 2.6.22
4688 #endif
4689 struct v4l2_ext_controls ctrls;
4690 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4691 return 0;
4694 _v4l2=no
4695 cc_check && _v4l2=yes
4697 if test "$_v4l2" = yes ; then
4698 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4699 vomodules="v4l2 $vomodules"
4700 aomodules="v4l2 $aomodules"
4701 else
4702 def_v4l2='#undef CONFIG_V4L2_DECODER'
4703 novomodules="v4l2 $novomodules"
4704 noaomodules="v4l2 $noaomodules"
4706 echores "$_v4l2"
4710 #########
4711 # AUDIO #
4712 #########
4715 echocheck "OSS Audio"
4716 if test "$_ossaudio" = auto ; then
4717 _ossaudio=no
4718 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4720 if test "$_ossaudio" = yes ; then
4721 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4722 aomodules="oss $aomodules"
4723 cat > $TMPC << EOF
4724 #include <$_soundcard_header>
4725 #ifdef OPEN_SOUND_SYSTEM
4726 int main(void) { return 0; }
4727 #else
4728 #error Not the real thing
4729 #endif
4731 _real_ossaudio=no
4732 cc_check && _real_ossaudio=yes
4733 if test "$_real_ossaudio" = yes; then
4734 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4735 # Check for OSS4 headers (override default headers)
4736 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4737 if test -f /etc/oss.conf; then
4738 . /etc/oss.conf
4739 _ossinc="$OSSLIBDIR/include"
4740 if test -f "$_ossinc/sys/soundcard.h"; then
4741 extra_cflags="-I$_ossinc $extra_cflags"
4744 elif netbsd || openbsd ; then
4745 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4746 extra_ldflags="$extra_ldflags -lossaudio"
4747 else
4748 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4750 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4751 else
4752 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4753 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4754 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4755 noaomodules="oss $noaomodules"
4757 echores "$_ossaudio"
4760 echocheck "RSound"
4761 if test "$_rsound" = auto ; then
4762 _rsound=no
4763 statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
4765 echores "$_rsound"
4767 if test "$_rsound" = yes ; then
4768 def_rsound='#define CONFIG_RSOUND 1'
4769 aomodules="rsound $aomodules"
4770 libs_mplayer="$libs_mplayer -lrsound"
4771 else
4772 def_rsound='#undef CONFIG_RSOUND'
4773 noaomodules="rsound $noaomodules"
4777 echocheck "NAS"
4778 if test "$_nas" = auto ; then
4779 _nas=no
4780 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
4782 if test "$_nas" = yes ; then
4783 def_nas='#define CONFIG_NAS 1'
4784 libs_mplayer="$libs_mplayer -laudio -lXt"
4785 aomodules="nas $aomodules"
4786 else
4787 noaomodules="nas $noaomodules"
4788 def_nas='#undef CONFIG_NAS'
4790 echores "$_nas"
4793 echocheck "pulse"
4794 if test "$_pulse" = auto ; then
4795 _pulse=no
4796 if pkg_config_add 'libpulse >= 0.9' ; then
4797 _pulse=yes
4800 echores "$_pulse"
4802 if test "$_pulse" = yes ; then
4803 def_pulse='#define CONFIG_PULSE 1'
4804 aomodules="pulse $aomodules"
4805 else
4806 def_pulse='#undef CONFIG_PULSE'
4807 noaomodules="pulse $noaomodules"
4811 echocheck "PortAudio"
4812 if test "$_portaudio" = auto && test "$_pthreads" != yes ; then
4813 _portaudio=no
4814 res_comment="pthreads not enabled"
4816 if test "$_portaudio" = auto ; then
4817 _portaudio=no
4818 if pkg_config_add 'portaudio-2.0 >= 19' ; then
4819 _portaudio=yes
4822 echores "$_portaudio"
4824 if test "$_portaudio" = yes ; then
4825 def_portaudio='#define CONFIG_PORTAUDIO 1'
4826 aomodules="portaudio $aomodules"
4827 else
4828 def_portaudio='#undef CONFIG_PORTAUDIO'
4829 noaomodules="portaudio $noaomodules"
4833 echocheck "JACK"
4834 if test "$_jack" = auto ; then
4835 _jack=no
4836 if pkg_config_add jack ; then
4837 _jack=yes
4841 if test "$_jack" = yes ; then
4842 def_jack='#define CONFIG_JACK 1'
4843 aomodules="jack $aomodules"
4844 else
4845 noaomodules="jack $noaomodules"
4847 echores "$_jack"
4849 echocheck "OpenAL"
4850 if test "$_openal" = auto ; then
4851 _openal=no
4852 cat > $TMPC << EOF
4853 #ifdef OPENAL_AL_H
4854 #include <OpenAL/al.h>
4855 #else
4856 #include <AL/al.h>
4857 #endif
4858 int main(void) {
4859 alSourceQueueBuffers(0, 0, 0);
4860 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4861 return 0;
4864 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4865 cc_check $I && _openal=yes && break
4866 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4867 done
4868 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4870 if test "$_openal" = yes ; then
4871 def_openal='#define CONFIG_OPENAL 1'
4872 aomodules="openal $aomodules"
4873 else
4874 noaomodules="openal $noaomodules"
4876 echores "$_openal"
4878 echocheck "ALSA audio"
4879 if test "$_alloca" != yes ; then
4880 _alsa=no
4881 res_comment="alloca missing"
4883 if test "$_alsa" = auto ; then
4884 _alsa=no
4885 if pkg_config_add "alsa >= 1.0.9" ; then
4886 _alsa=yes
4889 def_alsa='#undef CONFIG_ALSA'
4890 if test "$_alsa" = yes ; then
4891 aomodules="alsa $aomodules"
4892 def_alsa='#define CONFIG_ALSA 1'
4893 else
4894 noaomodules="alsa $noaomodules"
4896 echores "$_alsa"
4899 echocheck "Sun audio"
4900 if test "$_sunaudio" = auto ; then
4901 cat > $TMPC << EOF
4902 #include <sys/types.h>
4903 #include <sys/audioio.h>
4904 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4906 _sunaudio=no
4907 cc_check && _sunaudio=yes
4909 if test "$_sunaudio" = yes ; then
4910 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
4911 aomodules="sun $aomodules"
4912 else
4913 def_sunaudio='#undef CONFIG_SUN_AUDIO'
4914 noaomodules="sun $noaomodules"
4916 echores "$_sunaudio"
4919 if darwin; then
4920 echocheck "CoreAudio"
4921 if test "$_coreaudio" = auto ; then
4922 cat > $TMPC <<EOF
4923 #include <CoreAudio/CoreAudio.h>
4924 #include <AudioToolbox/AudioToolbox.h>
4925 #include <AudioUnit/AudioUnit.h>
4926 int main(void) { return 0; }
4928 _coreaudio=no
4929 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
4931 if test "$_coreaudio" = yes ; then
4932 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4933 def_coreaudio='#define CONFIG_COREAUDIO 1'
4934 aomodules="coreaudio $aomodules"
4935 else
4936 def_coreaudio='#undef CONFIG_COREAUDIO'
4937 noaomodules="coreaudio $noaomodules"
4939 echores $_coreaudio
4940 fi #if darwin
4943 # set default CD/DVD devices
4944 if win32 ; then
4945 default_cdrom_device="D:"
4946 elif darwin ; then
4947 default_cdrom_device="/dev/disk1"
4948 elif dragonfly ; then
4949 default_cdrom_device="/dev/cd0"
4950 elif freebsd ; then
4951 default_cdrom_device="/dev/acd0"
4952 elif openbsd ; then
4953 default_cdrom_device="/dev/rcd0c"
4954 elif sunos ; then
4955 default_cdrom_device="/vol/dev/aliases/cdrom0"
4956 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
4957 # file system and the volfs service.
4958 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
4959 elif amigaos ; then
4960 default_cdrom_device="a1ide.device:2"
4961 else
4962 default_cdrom_device="/dev/cdrom"
4965 if win32 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
4966 default_dvd_device=$default_cdrom_device
4967 elif darwin ; then
4968 default_dvd_device="/dev/rdiskN"
4969 else
4970 default_dvd_device="/dev/dvd"
4974 echocheck "VCD support"
4975 if test "$_vcd" = auto; then
4976 _vcd=no
4977 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos; then
4978 _vcd=yes
4979 elif mingw32; then
4980 header_check ddk/ntddcdrm.h && _vcd=yes
4983 if test "$_vcd" = yes; then
4984 inputmodules="vcd $inputmodules"
4985 def_vcd='#define CONFIG_VCD 1'
4986 else
4987 def_vcd='#undef CONFIG_VCD'
4988 noinputmodules="vcd $noinputmodules"
4989 res_comment="not supported on this OS"
4991 echores "$_vcd"
4995 echocheck "Blu-ray support"
4996 if test "$_bluray" = auto ; then
4997 _bluray=no
4998 pkg_config_add 'libbluray >= 0.2.1' && _bluray=yes
5000 if test "$_bluray" = yes ; then
5001 def_bluray='#define CONFIG_LIBBLURAY 1'
5002 inputmodules="bluray $inputmodules"
5003 else
5004 def_bluray='#undef CONFIG_LIBBLURAY'
5005 noinputmodules="bluray $noinputmodules"
5007 echores "$_bluray"
5009 echocheck "dvdread"
5010 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5011 _dvdread_internal=no
5013 if test "$_dvdread_internal" = auto ; then
5014 _dvdread_internal=no
5015 _dvdread=no
5016 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) &&
5017 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
5018 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
5019 darwin || win32; then
5020 _dvdread_internal=yes
5021 _dvdread=yes
5022 extra_cflags="-Ilibdvdread4 $extra_cflags"
5024 elif test "$_dvdread" = auto ; then
5025 _dvdread=no
5026 if test "$_dl" = yes; then
5027 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5028 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5029 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5030 _dvdread=yes
5031 extra_cflags="$extra_cflags $_dvdreadcflags"
5032 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5033 res_comment="external"
5038 if test "$_dvdread_internal" = yes; then
5039 def_dvdread='#define CONFIG_DVDREAD 1'
5040 inputmodules="dvdread(internal) $inputmodules"
5041 res_comment="internal"
5042 elif test "$_dvdread" = yes; then
5043 def_dvdread='#define CONFIG_DVDREAD 1'
5044 extra_ldflags="$extra_ldflags -ldvdread"
5045 inputmodules="dvdread(external) $inputmodules"
5046 res_comment="external"
5047 else
5048 def_dvdread='#undef CONFIG_DVDREAD'
5049 noinputmodules="dvdread $noinputmodules"
5051 echores "$_dvdread"
5054 echocheck "internal libdvdcss"
5055 if test "$_libdvdcss_internal" = auto ; then
5056 _libdvdcss_internal=no
5057 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
5058 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5060 if test "$_libdvdcss_internal" = yes ; then
5061 if linux || netbsd || openbsd || bsdos ; then
5062 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5063 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5064 elif freebsd || dragonfly ; then
5065 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5066 elif darwin ; then
5067 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5068 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5069 elif cygwin ; then
5070 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5071 elif beos ; then
5072 cflags_libdvdcss="-DSYS_BEOS"
5074 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5075 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5076 inputmodules="libdvdcss(internal) $inputmodules"
5077 else
5078 noinputmodules="libdvdcss(internal) $noinputmodules"
5080 echores "$_libdvdcss_internal"
5083 echocheck "libcdio"
5084 if test "$_libcdio" = auto ; then
5085 _libcdio=no
5086 if pkg_config_add libcdio_paranoia ; then
5087 _libcdio=yes
5090 if test "$_libcdio" = yes ; then
5091 _cdda='yes'
5092 def_cdda='#define CONFIG_CDDA 1'
5093 test $_cddb = auto && test $networking = yes && _cddb=yes
5094 inputmodules="cdda $inputmodules"
5095 else
5096 _libcdio=no
5097 _cdda='no'
5098 def_cdda='#undef CONFIG_CDDA'
5099 noinputmodules="cdda $noinputmodules"
5101 echores "$_libcdio"
5103 if test "$_cddb" = yes ; then
5104 def_cddb='#define CONFIG_CDDB 1'
5105 inputmodules="cddb $inputmodules"
5106 else
5107 _cddb=no
5108 def_cddb='#undef CONFIG_CDDB'
5109 noinputmodules="cddb $noinputmodules"
5112 echocheck "bitmap font support"
5113 if test "$_bitmap_font" = yes ; then
5114 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5115 else
5116 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5118 echores "$_bitmap_font"
5121 echocheck "freetype >= 2.0.9"
5123 # freetype depends on iconv
5124 if test "$_iconv" = no ; then
5125 _freetype=no
5126 res_comment="iconv support needed"
5129 if test "$_freetype" = auto ; then
5130 if pkg_config_add freetype2 ; then
5131 _freetype=yes
5132 else
5133 die "Unable to find development files for libfreetype. Aborting. If you really mean to compile without FreeType support use --disable-freetype."
5136 if test "$_freetype" = yes ; then
5137 def_freetype='#define CONFIG_FREETYPE 1'
5138 else
5139 def_freetype='#undef CONFIG_FREETYPE'
5141 echores "$_freetype"
5143 if test "$_freetype" = no ; then
5144 _fontconfig=no
5145 res_comment="FreeType support needed"
5147 echocheck "fontconfig"
5148 if test "$_fontconfig" = auto ; then
5149 if pkg_config_add 'fontconfig >= 2.4.2' ; then
5150 _fontconfig=yes
5151 else
5152 die "Unable to find development files for libfontconfig. Aborting. If you really mean to compile without fontconfig support use --disable-fontconfig."
5155 if test "$_fontconfig" = yes ; then
5156 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5157 else
5158 def_fontconfig='#undef CONFIG_FONTCONFIG'
5160 echores "$_fontconfig"
5163 echocheck "SSA/ASS support"
5164 if test "$_ass" = auto ; then
5165 if pkg_config_add libass ; then
5166 _ass=yes
5167 def_ass='#define CONFIG_ASS 1'
5168 else
5169 die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
5171 else
5172 def_ass='#undef CONFIG_ASS'
5174 echores "$_ass"
5177 echocheck "fribidi with charsets"
5178 if test "$_fribidi" = auto ; then
5179 _fribidi=no
5180 if pkg_config_add fribidi ; then
5181 _fribidi=yes
5184 if test "$_fribidi" = yes ; then
5185 def_fribidi='#define CONFIG_FRIBIDI 1'
5186 else
5187 def_fribidi='#undef CONFIG_FRIBIDI'
5189 echores "$_fribidi"
5192 echocheck "ENCA"
5193 if test "$_enca" = auto ; then
5194 _enca=no
5195 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
5197 if test "$_enca" = yes ; then
5198 def_enca='#define CONFIG_ENCA 1'
5199 extra_ldflags="$extra_ldflags -lenca"
5200 else
5201 def_enca='#undef CONFIG_ENCA'
5203 echores "$_enca"
5206 echocheck "zlib"
5207 _zlib=no
5208 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5209 if test "$_zlib" = yes ; then
5210 def_zlib='#define CONFIG_ZLIB 1'
5211 extra_ldflags="$extra_ldflags -lz"
5212 else
5213 def_zlib='#define CONFIG_ZLIB 0'
5215 echores "$_zlib"
5218 echocheck "RTC"
5219 if test "$_rtc" = auto ; then
5220 cat > $TMPC << EOF
5221 #include <sys/ioctl.h>
5222 #ifdef __linux__
5223 #include <linux/rtc.h>
5224 #else
5225 #include <rtc.h>
5226 #define RTC_PIE_ON RTCIO_PIE_ON
5227 #endif
5228 int main(void) { return RTC_PIE_ON; }
5230 _rtc=no
5231 cc_check && _rtc=yes
5232 ppc && _rtc=no
5234 if test "$_rtc" = yes ; then
5235 def_rtc='#define HAVE_RTC 1'
5236 else
5237 def_rtc='#undef HAVE_RTC'
5239 echores "$_rtc"
5242 echocheck "mad support"
5243 if test "$_mad" = auto ; then
5244 _mad=no
5245 header_check mad.h -lmad && _mad=yes
5247 if test "$_mad" = yes ; then
5248 def_mad='#define CONFIG_LIBMAD 1'
5249 extra_ldflags="$extra_ldflags -lmad"
5250 codecmodules="libmad $codecmodules"
5251 else
5252 def_mad='#undef CONFIG_LIBMAD'
5253 nocodecmodules="libmad $nocodecmodules"
5255 echores "$_mad"
5257 echocheck "OggVorbis support"
5258 if test "$_libvorbis" = auto; then
5259 _libvorbis=no
5260 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
5261 elif test "$_libvorbis" = yes ; then
5262 _tremor=no
5264 if test "$_tremor" = auto; then
5265 _tremor=no
5266 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
5268 if test "$_tremor" = yes ; then
5269 _vorbis=yes
5270 def_vorbis='#define CONFIG_OGGVORBIS 1'
5271 def_tremor='#define CONFIG_TREMOR 1'
5272 codecmodules="tremor(external) $codecmodules"
5273 res_comment="external Tremor"
5274 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
5275 elif test "$_libvorbis" = yes ; then
5276 _vorbis=yes
5277 def_vorbis='#define CONFIG_OGGVORBIS 1'
5278 codecmodules="libvorbis $codecmodules"
5279 res_comment="libvorbis"
5280 extra_ldflags="$extra_ldflags -lvorbis -logg"
5281 else
5282 _vorbis=no
5283 nocodecmodules="libvorbis $nocodecmodules"
5285 echores "$_vorbis"
5287 echocheck "libspeex (version >= 1.1 required)"
5288 if test "$_speex" = auto ; then
5289 _speex=no
5290 cat > $TMPC << EOF
5291 #include <stddef.h>
5292 #include <speex/speex.h>
5293 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5295 cc_check -lspeex $_ld_lm && _speex=yes
5297 if test "$_speex" = yes ; then
5298 def_speex='#define CONFIG_SPEEX 1'
5299 extra_ldflags="$extra_ldflags -lspeex"
5300 codecmodules="speex $codecmodules"
5301 else
5302 def_speex='#undef CONFIG_SPEEX'
5303 nocodecmodules="speex $nocodecmodules"
5305 echores "$_speex"
5307 echocheck "OggTheora support"
5308 if test "$_theora" = auto ; then
5309 _theora=no
5310 if pkg_config_add theora ; then
5311 _theora=yes
5314 if test "$_theora" = yes ; then
5315 def_theora='#define CONFIG_OGGTHEORA 1'
5316 codecmodules="libtheora $codecmodules"
5317 else
5318 def_theora='#undef CONFIG_OGGTHEORA'
5319 nocodecmodules="libtheora $nocodecmodules"
5321 echores "$_theora"
5323 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
5324 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
5325 echocheck "mpg123 support"
5326 def_mpg123='#undef CONFIG_MPG123'
5327 if test "$_mpg123" = auto; then
5328 _mpg123=no
5329 pkg_config_add 'libmpg123 >= 1.2.0' && _mpg123=yes
5331 if test "$_mpg123" = yes ; then
5332 def_mpg123='#define CONFIG_MPG123 1'
5333 codecmodules="mpg123 $codecmodules"
5334 else
5335 nocodecmodules="mpg123 $nocodecmodules"
5337 echores "$_mpg123"
5339 echocheck "liba52 support"
5340 def_liba52='#undef CONFIG_LIBA52'
5341 if test "$_liba52" = auto ; then
5342 _liba52=no
5343 cat > $TMPC << EOF
5344 #include <inttypes.h>
5345 #include <a52dec/a52.h>
5346 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
5348 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
5350 if test "$_liba52" = yes ; then
5351 def_liba52='#define CONFIG_LIBA52 1'
5352 codecmodules="liba52 $codecmodules"
5353 else
5354 nocodecmodules="liba52 $nocodecmodules"
5356 echores "$_liba52"
5358 echocheck "libdca support"
5359 if test "$_libdca" = auto ; then
5360 _libdca=no
5361 for _ld_dca in -ldca -ldts ; do
5362 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
5363 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
5364 done
5366 if test "$_libdca" = yes ; then
5367 def_libdca='#define CONFIG_LIBDCA 1'
5368 codecmodules="libdca $codecmodules"
5369 else
5370 def_libdca='#undef CONFIG_LIBDCA'
5371 nocodecmodules="libdca $nocodecmodules"
5373 echores "$_libdca"
5375 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5376 if test "$_musepack" = yes ; then
5377 _musepack=no
5378 cat > $TMPC << EOF
5379 #include <stddef.h>
5380 #include <mpcdec/mpcdec.h>
5381 int main(void) {
5382 mpc_streaminfo info;
5383 mpc_decoder decoder;
5384 mpc_decoder_set_streaminfo(&decoder, &info);
5385 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5386 return 0;
5389 cc_check -lmpcdec $_ld_lm && _musepack=yes
5391 if test "$_musepack" = yes ; then
5392 def_musepack='#define CONFIG_MUSEPACK 1'
5393 extra_ldflags="$extra_ldflags -lmpcdec"
5394 codecmodules="musepack $codecmodules"
5395 else
5396 def_musepack='#undef CONFIG_MUSEPACK'
5397 nocodecmodules="musepack $nocodecmodules"
5399 echores "$_musepack"
5402 echocheck "FAAD2 support"
5403 if test "$_faad" = auto ; then
5404 _faad=no
5405 cat > $TMPC << EOF
5406 #include <faad.h>
5407 #ifndef FAAD_MIN_STREAMSIZE
5408 #error Too old version
5409 #endif
5410 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
5411 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5413 cc_check -lfaad $_ld_lm && _faad=yes
5416 def_faad='#undef CONFIG_FAAD'
5417 if test "$_faad" = yes ; then
5418 def_faad='#define CONFIG_FAAD 1'
5419 extra_ldflags="$extra_ldflags -lfaad"
5420 codecmodules="faad2 $codecmodules"
5421 else
5422 nocodecmodules="faad2 $nocodecmodules"
5424 echores "$_faad"
5427 echocheck "LADSPA plugin support"
5428 if test "$_ladspa" = auto ; then
5429 _ladspa=no
5430 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
5432 if test "$_ladspa" = yes; then
5433 def_ladspa="#define CONFIG_LADSPA 1"
5434 else
5435 def_ladspa="#undef CONFIG_LADSPA"
5437 echores "$_ladspa"
5440 echocheck "libbs2b audio filter support"
5441 if test "$_libbs2b" = auto ; then
5442 _libbs2b=no
5443 if pkg_config_add libbs2b ; then
5444 _libbs2b=yes
5447 def_libbs2b="#undef CONFIG_LIBBS2B"
5448 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
5449 echores "$_libbs2b"
5452 if test -z "$_codecsdir" ; then
5453 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5454 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5455 if test -d "$dir" ; then
5456 _codecsdir="$dir"
5457 break;
5459 done
5461 # Fall back on default directory.
5462 if test -z "$_codecsdir" ; then
5463 _codecsdir="$_libdir/codecs"
5464 mingw32 && _codecsdir="codecs"
5468 echocheck "Win32 codecs"
5469 if test "$_win32dll" = auto ; then
5470 _win32dll=no
5471 if x86_32 && ! qnx; then
5472 _win32dll=yes
5475 if test "$_win32dll" = yes ; then
5476 def_win32dll='#define CONFIG_WIN32DLL 1'
5477 if ! win32 ; then
5478 def_win32_loader='#define WIN32_LOADER 1'
5479 _win32_emulation=yes
5480 else
5481 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
5482 res_comment="using native windows"
5484 codecmodules="win32 $codecmodules"
5485 else
5486 def_win32dll='#undef CONFIG_WIN32DLL'
5487 def_win32_loader='#undef WIN32_LOADER'
5488 nocodecmodules="win32 $nocodecmodules"
5490 echores "$_win32dll"
5493 echocheck "XAnim codecs"
5494 if test "$_xanim" = auto ; then
5495 _xanim=no
5496 res_comment="dynamic loader support needed"
5497 if test "$_dl" = yes ; then
5498 _xanim=yes
5501 if test "$_xanim" = yes ; then
5502 def_xanim='#define CONFIG_XANIM 1'
5503 codecmodules="xanim $codecmodules"
5504 else
5505 def_xanim='#undef CONFIG_XANIM'
5506 nocodecmodules="xanim $nocodecmodules"
5508 echores "$_xanim"
5511 echocheck "RealPlayer codecs"
5512 if test "$_real" = auto ; then
5513 _real=no
5514 res_comment="dynamic loader support needed"
5515 if test "$_dl" = yes || test "$_win32dll" = yes &&
5516 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
5517 _real=yes
5520 if test "$_real" = yes ; then
5521 def_real='#define CONFIG_REALCODECS 1'
5522 codecmodules="real $codecmodules"
5523 else
5524 def_real='#undef CONFIG_REALCODECS'
5525 nocodecmodules="real $nocodecmodules"
5527 echores "$_real"
5530 echocheck "QuickTime codecs"
5531 _qtx_emulation=no
5532 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
5533 if test "$_qtx" = auto ; then
5534 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
5536 if test "$_qtx" = yes ; then
5537 def_qtx='#define CONFIG_QTX_CODECS 1'
5538 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
5539 codecmodules="qtx $codecmodules"
5540 darwin || win32 || _qtx_emulation=yes
5541 else
5542 def_qtx='#undef CONFIG_QTX_CODECS'
5543 nocodecmodules="qtx $nocodecmodules"
5545 echores "$_qtx"
5547 echocheck "Nemesi Streaming Media libraries"
5548 if test "$_nemesi" = auto && test "$networking" = yes ; then
5549 _nemesi=no
5550 if pkg_config_add libnemesi ; then
5551 _nemesi=yes
5554 if test "$_nemesi" = yes; then
5555 _native_rtsp=no
5556 def_nemesi='#define CONFIG_LIBNEMESI 1'
5557 inputmodules="nemesi $inputmodules"
5558 else
5559 _native_rtsp="$networking"
5560 _nemesi=no
5561 def_nemesi='#undef CONFIG_LIBNEMESI'
5562 noinputmodules="nemesi $noinputmodules"
5564 echores "$_nemesi"
5566 echocheck "LIVE555 Streaming Media libraries"
5567 if test "$_live" != no && test "$networking" = yes ; then
5568 cat > $TMPCPP << EOF
5569 #include <liveMedia.hh>
5570 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
5571 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5572 #endif
5573 int main(void) { return 0; }
5576 _live=no
5577 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
5578 cxx_check $I/liveMedia/include $I/UsageEnvironment/include $I/groupsock/include &&
5579 _livelibdir=$(echo $I| sed s/-I//) &&
5580 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
5581 $_livelibdir/groupsock/libgroupsock.a \
5582 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
5583 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
5584 $extra_ldflags -lstdc++" \
5585 extra_cxxflags="-I$_livelibdir/liveMedia/include \
5586 -I$_livelibdir/UsageEnvironment/include \
5587 -I$_livelibdir/BasicUsageEnvironment/include \
5588 -I$_livelibdir/groupsock/include" &&
5589 _live=yes && break
5590 done
5591 if test "$_live" != yes ; then
5592 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
5593 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
5594 _live_dist=yes
5598 if test "$_live" = yes && test "$networking" = yes; then
5599 test $_livelibdir && res_comment="using $_livelibdir"
5600 def_live='#define CONFIG_LIVE555 1'
5601 inputmodules="live555 $inputmodules"
5602 elif test "$_live_dist" = yes && test "$networking" = yes; then
5603 res_comment="using distribution version"
5604 _live="yes"
5605 def_live='#define CONFIG_LIVE555 1'
5606 extra_ldflags="$extra_ldflags $ld_tmp"
5607 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
5608 inputmodules="live555 $inputmodules"
5609 else
5610 _live=no
5611 def_live='#undef CONFIG_LIVE555'
5612 noinputmodules="live555 $noinputmodules"
5614 echores "$_live"
5618 # Test with > against Libav 0.8 versions which will NOT work rather than
5619 # specify minimum version, to allow (future) point releases to possibly work.
5620 all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5621 echocheck "Libav ($all_libav_libs)"
5622 if test "$ffmpeg" = auto ; then
5623 IFS=":" # shell should not be used for programming
5624 if ! pkg_config_add $all_libav_libs ; then
5625 die "Unable to find development files for some of the required Libav libraries above. Aborting."
5628 echores "yes"
5630 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
5631 if ! test -z "$_ffmpeg_source" ; then
5632 def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
5635 echocheck "libpostproc >= 52.0.0"
5636 if test "$libpostproc" = auto ; then
5637 libpostproc=no
5638 if pkg_config_add "libpostproc >= 52.0.0" ; then
5639 libpostproc=yes
5642 if test "$libpostproc" = yes ; then
5643 def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
5644 else
5645 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
5647 echores "$libpostproc"
5650 echocheck "libdv-0.9.5+"
5651 if test "$_libdv" = auto ; then
5652 _libdv=no
5653 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
5655 if test "$_libdv" = yes ; then
5656 def_libdv='#define CONFIG_LIBDV095 1'
5657 extra_ldflags="$extra_ldflags -ldv"
5658 codecmodules="libdv $codecmodules"
5659 else
5660 def_libdv='#undef CONFIG_LIBDV095'
5661 nocodecmodules="libdv $nocodecmodules"
5663 echores "$_libdv"
5666 echocheck "Xvid"
5667 if test "$_xvid" = auto ; then
5668 _xvid=no
5669 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5670 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5671 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
5672 done
5675 if test "$_xvid" = yes ; then
5676 def_xvid='#define CONFIG_XVID4 1'
5677 codecmodules="xvid $codecmodules"
5678 else
5679 def_xvid='#undef CONFIG_XVID4'
5680 nocodecmodules="xvid $nocodecmodules"
5682 echores "$_xvid"
5685 echocheck "libnut"
5686 if test "$_libnut" = auto ; then
5687 _libnut=no
5688 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
5691 if test "$_libnut" = yes ; then
5692 def_libnut='#define CONFIG_LIBNUT 1'
5693 extra_ldflags="$extra_ldflags -lnut"
5694 else
5695 def_libnut='#undef CONFIG_LIBNUT'
5697 echores "$_libnut"
5699 # These VO checks must be done after the FFmpeg one
5700 echocheck "/dev/mga_vid"
5701 if test "$_mga" = auto ; then
5702 _mga=no
5703 test -c /dev/mga_vid && _mga=yes
5705 if test "$_mga" = yes ; then
5706 def_mga='#define CONFIG_MGA 1'
5707 vomodules="mga $vomodules"
5708 else
5709 def_mga='#undef CONFIG_MGA'
5710 novomodules="mga $novomodules"
5712 echores "$_mga"
5715 echocheck "xmga"
5716 if test "$_xmga" = auto ; then
5717 _xmga=no
5718 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
5720 if test "$_xmga" = yes ; then
5721 def_xmga='#define CONFIG_XMGA 1'
5722 vomodules="xmga $vomodules"
5723 else
5724 def_xmga='#undef CONFIG_XMGA'
5725 novomodules="xmga $novomodules"
5727 echores "$_xmga"
5730 echocheck "UnRAR executable"
5731 if test "$_unrar_exec" = auto ; then
5732 _unrar_exec="yes"
5733 mingw32 && _unrar_exec="no"
5735 if test "$_unrar_exec" = yes ; then
5736 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
5737 else
5738 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
5740 echores "$_unrar_exec"
5742 echocheck "TV interface"
5743 if test "$_tv" = yes ; then
5744 def_tv='#define CONFIG_TV 1'
5745 inputmodules="tv $inputmodules"
5746 else
5747 noinputmodules="tv $noinputmodules"
5748 def_tv='#undef CONFIG_TV'
5750 echores "$_tv"
5753 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
5754 echocheck "*BSD BT848 bt8xx header"
5755 _ioctl_bt848_h=no
5756 for file in "machine/ioctl_bt848.h" \
5757 "dev/bktr/ioctl_bt848.h" \
5758 "dev/video/bktr/ioctl_bt848.h" \
5759 "dev/ic/bt8xx.h" ; do
5760 cat > $TMPC <<EOF
5761 #include <sys/types.h>
5762 #include <sys/ioctl.h>
5763 #include <$file>
5764 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5766 if cc_check ; then
5767 _ioctl_bt848_h=yes
5768 _ioctl_bt848_h_name="$file"
5769 break;
5771 done
5772 if test "$_ioctl_bt848_h" = yes ; then
5773 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5774 res_comment="using $_ioctl_bt848_h_name"
5775 else
5776 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
5778 echores "$_ioctl_bt848_h"
5780 echocheck "*BSD ioctl_meteor.h"
5781 _ioctl_meteor_h=no
5782 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5783 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5784 _ioctl_meteor_h=yes && break
5785 done
5786 if test "$_ioctl_meteor_h" = yes ; then
5787 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5788 res_comment="using $ioctl_meteor_h_path"
5789 else
5790 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
5792 echores "$_ioctl_meteor_h"
5794 echocheck "*BSD BrookTree 848 TV interface"
5795 if test "$_tv_bsdbt848" = auto ; then
5796 _tv_bsdbt848=no
5797 if test "$_tv" = yes ; then
5798 cat > $TMPC <<EOF
5799 #include <sys/types.h>
5800 $def_ioctl_meteor_h_name
5801 $def_ioctl_bt848_h_name
5802 #ifdef IOCTL_METEOR_H_NAME
5803 #include IOCTL_METEOR_H_NAME
5804 #endif
5805 #ifdef IOCTL_BT848_H_NAME
5806 #include IOCTL_BT848_H_NAME
5807 #endif
5808 int main(void) {
5809 ioctl(0, METEORSINPUT, 0);
5810 ioctl(0, TVTUNER_GETFREQ, 0);
5811 return 0;
5814 cc_check && _tv_bsdbt848=yes
5817 if test "$_tv_bsdbt848" = yes ; then
5818 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
5819 inputmodules="tv-bsdbt848 $inputmodules"
5820 else
5821 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
5822 noinputmodules="tv-bsdbt848 $noinputmodules"
5824 echores "$_tv_bsdbt848"
5825 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5828 echocheck "DirectShow TV interface"
5829 if test "$_tv_dshow" = auto ; then
5830 _tv_dshow=no
5831 if test "$_tv" = yes && win32 ; then
5832 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
5835 if test "$_tv_dshow" = yes ; then
5836 inputmodules="tv-dshow $inputmodules"
5837 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
5838 extra_ldflags="$extra_ldflags -lole32 -luuid"
5839 else
5840 noinputmodules="tv-dshow $noinputmodules"
5841 def_tv_dshow='#undef CONFIG_TV_DSHOW'
5843 echores "$_tv_dshow"
5846 echocheck "Video 4 Linux TV interface"
5847 if test "$_tv_v4l1" = auto ; then
5848 _tv_v4l1=no
5849 if test "$_tv" = yes && linux ; then
5850 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
5853 if test "$_tv_v4l1" = yes ; then
5854 _audio_input=yes
5855 _tv_v4l=yes
5856 def_tv_v4l='#define CONFIG_TV_V4L 1'
5857 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
5858 inputmodules="tv-v4l $inputmodules"
5859 else
5860 noinputmodules="tv-v4l1 $noinputmodules"
5861 def_tv_v4l='#undef CONFIG_TV_V4L'
5863 echores "$_tv_v4l1"
5866 echocheck "Video 4 Linux 2 TV interface"
5867 if test "$_tv_v4l2" = auto ; then
5868 _tv_v4l2=no
5869 if test "$_tv" = yes && linux ; then
5870 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
5871 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5872 _tv_v4l2=yes
5875 if test "$_tv_v4l2" = yes ; then
5876 _audio_input=yes
5877 _tv_v4l=yes
5878 def_tv_v4l='#define CONFIG_TV_V4L 1'
5879 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
5880 inputmodules="tv-v4l2 $inputmodules"
5881 else
5882 noinputmodules="tv-v4l2 $noinputmodules"
5883 def_tv_v4l2='#undef CONFIG_TV_V4L2'
5885 echores "$_tv_v4l2"
5888 echocheck "Radio interface"
5889 if test "$_radio" = yes ; then
5890 def_radio='#define CONFIG_RADIO 1'
5891 inputmodules="radio $inputmodules"
5892 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5893 _radio_capture=no
5895 if test "$_radio_capture" = yes ; then
5896 _audio_input=yes
5897 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
5898 else
5899 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5901 else
5902 noinputmodules="radio $noinputmodules"
5903 def_radio='#undef CONFIG_RADIO'
5904 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5905 _radio_capture=no
5907 echores "$_radio"
5908 echocheck "Capture for Radio interface"
5909 echores "$_radio_capture"
5911 echocheck "Video 4 Linux 2 Radio interface"
5912 if test "$_radio_v4l2" = auto ; then
5913 _radio_v4l2=no
5914 if test "$_radio" = yes && linux ; then
5915 header_check linux/videodev2.h && _radio_v4l2=yes
5918 if test "$_radio_v4l2" = yes ; then
5919 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
5920 else
5921 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
5923 echores "$_radio_v4l2"
5925 echocheck "Video 4 Linux Radio interface"
5926 if test "$_radio_v4l" = auto ; then
5927 _radio_v4l=no
5928 if test "$_radio" = yes && linux ; then
5929 header_check linux/videodev.h && _radio_v4l=yes
5932 if test "$_radio_v4l" = yes ; then
5933 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
5934 else
5935 def_radio_v4l='#undef CONFIG_RADIO_V4L'
5937 echores "$_radio_v4l"
5939 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
5940 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
5941 echocheck "*BSD BrookTree 848 Radio interface"
5942 _radio_bsdbt848=no
5943 cat > $TMPC <<EOF
5944 #include <sys/types.h>
5945 $def_ioctl_bt848_h_name
5946 #ifdef IOCTL_BT848_H_NAME
5947 #include IOCTL_BT848_H_NAME
5948 #endif
5949 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5951 cc_check && _radio_bsdbt848=yes
5952 echores "$_radio_bsdbt848"
5953 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5955 if test "$_radio_bsdbt848" = yes ; then
5956 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
5957 else
5958 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
5961 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
5962 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
5963 die "Radio driver requires BSD BT848, V4L or V4L2!"
5966 echocheck "Video 4 Linux 2 MPEG PVR interface"
5967 if test "$_pvr" = auto ; then
5968 _pvr=no
5969 if test "$_tv_v4l2" = yes && linux ; then
5970 cat > $TMPC <<EOF
5971 #include <sys/time.h>
5972 #include <linux/videodev2.h>
5973 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5975 cc_check && _pvr=yes
5978 if test "$_pvr" = yes ; then
5979 def_pvr='#define CONFIG_PVR 1'
5980 inputmodules="pvr $inputmodules"
5981 else
5982 noinputmodules="pvr $noinputmodules"
5983 def_pvr='#undef CONFIG_PVR'
5985 echores "$_pvr"
5988 echocheck "ftp"
5989 if test "$_ftp" = "auto" ; then
5990 test "$networking" = "yes" && ! beos && _ftp=yes
5992 if test "$_ftp" = yes ; then
5993 def_ftp='#define CONFIG_FTP 1'
5994 inputmodules="ftp $inputmodules"
5995 else
5996 noinputmodules="ftp $noinputmodules"
5997 def_ftp='#undef CONFIG_FTP'
5999 echores "$_ftp"
6001 echocheck "vstream client"
6002 if test "$_vstream" = auto ; then
6003 _vstream=no
6004 cat > $TMPC <<EOF
6005 #include <vstream-client.h>
6006 void vstream_error(const char *format, ... ) {}
6007 int main(void) { vstream_start(); return 0; }
6009 cc_check -lvstream-client && _vstream=yes
6011 if test "$_vstream" = yes ; then
6012 def_vstream='#define CONFIG_VSTREAM 1'
6013 inputmodules="vstream $inputmodules"
6014 extra_ldflags="$extra_ldflags -lvstream-client"
6015 else
6016 noinputmodules="vstream $noinputmodules"
6017 def_vstream='#undef CONFIG_VSTREAM'
6019 echores "$_vstream"
6022 echocheck "Subtitles sorting"
6023 if test "$_sortsub" = yes ; then
6024 def_sortsub='#define CONFIG_SORTSUB 1'
6025 else
6026 def_sortsub='#undef CONFIG_SORTSUB'
6028 echores "$_sortsub"
6031 echocheck "XMMS inputplugin support"
6032 if test "$_xmms" = yes ; then
6033 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6034 _xmmsplugindir=$(xmms-config --input-plugin-dir)
6035 _xmmslibdir=$(xmms-config --exec-prefix)/lib
6036 else
6037 _xmmsplugindir=/usr/lib/xmms/Input
6038 _xmmslibdir=/usr/lib
6041 def_xmms='#define CONFIG_XMMS 1'
6042 if darwin ; then
6043 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6044 else
6045 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6047 else
6048 def_xmms='#undef CONFIG_XMMS'
6050 echores "$_xmms"
6052 if test "$_charset" != "noconv" ; then
6053 def_charset="#define MSG_CHARSET \"$_charset\""
6054 else
6055 def_charset="#undef MSG_CHARSET"
6056 _charset="UTF-8"
6059 #############################################################################
6061 echocheck "automatic gdb attach"
6062 if test "$_crash_debug" = yes ; then
6063 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
6064 else
6065 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
6066 _crash_debug=no
6068 echores "$_crash_debug"
6070 echocheck "compiler support for noexecstack"
6071 if cflag_check -Wl,-z,noexecstack ; then
6072 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
6073 echores "yes"
6074 else
6075 echores "no"
6078 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
6079 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6080 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6081 echores "yes"
6082 else
6083 echores "no"
6087 # Dynamic linking flags
6088 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6089 _ld_dl_dynamic=''
6090 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
6091 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! sunos; then
6092 _ld_dl_dynamic='-rdynamic'
6095 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6096 bsdos && extra_ldflags="$extra_ldflags -ldvd"
6097 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
6099 def_debug='#undef MP_DEBUG'
6100 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
6103 echocheck "joystick"
6104 def_joystick='#undef CONFIG_JOYSTICK'
6105 if test "$_joystick" = yes ; then
6106 if linux || freebsd ; then
6107 # TODO add some check
6108 def_joystick='#define CONFIG_JOYSTICK 1'
6109 else
6110 _joystick="no"
6111 res_comment="unsupported under $system_name"
6114 echores "$_joystick"
6116 echocheck "lirc"
6117 if test "$_lirc" = auto ; then
6118 _lirc=no
6119 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
6121 if test "$_lirc" = yes ; then
6122 def_lirc='#define CONFIG_LIRC 1'
6123 libs_mplayer="$libs_mplayer -llirc_client"
6124 else
6125 def_lirc='#undef CONFIG_LIRC'
6127 echores "$_lirc"
6129 echocheck "lircc"
6130 if test "$_lircc" = auto ; then
6131 _lircc=no
6132 header_check lirc/lircc.h -llircc && _lircc=yes
6134 if test "$_lircc" = yes ; then
6135 def_lircc='#define CONFIG_LIRCC 1'
6136 libs_mplayer="$libs_mplayer -llircc"
6137 else
6138 def_lircc='#undef CONFIG_LIRCC'
6140 echores "$_lircc"
6142 #############################################################################
6144 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
6146 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
6148 # This must be the last test to be performed. Any other tests following it
6149 # could fail due to linker errors. libdvdnavmini is intentionally not linked
6150 # against libdvdread (to permit MPlayer to use its own copy of the library).
6151 # So any compilation using the flags added here but not linking against
6152 # libdvdread can fail.
6153 echocheck "DVD support (libdvdnav)"
6154 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
6155 _dvdnav=no
6157 dvdnav_internal=no
6158 if test "$_dvdnav" = auto ; then
6159 if test "$_dvdread_internal" = yes ; then
6160 _dvdnav=yes
6161 dvdnav_internal=yes
6162 res_comment="internal"
6163 else
6164 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
6167 if test "$_dvdnav" = auto ; then
6168 _dvdnav=no
6169 _dvdnavdir=$($_dvdnavconfig --cflags)
6170 _dvdnavlibs=$($_dvdnavconfig --libs)
6171 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
6173 if test "$_dvdnav" = yes ; then
6174 def_dvdnav='#define CONFIG_DVDNAV 1'
6175 if test "$dvdnav_internal" = yes ; then
6176 cflags_libdvdnav="-Ilibdvdnav"
6177 inputmodules="dvdnav(internal) $inputmodules"
6178 else
6179 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
6180 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
6181 inputmodules="dvdnav $inputmodules"
6183 else
6184 def_dvdnav='#undef CONFIG_DVDNAV'
6185 noinputmodules="dvdnav $noinputmodules"
6187 echores "$_dvdnav"
6189 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
6190 # Read dvdnav comment above.
6192 mak_enable () {
6193 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6194 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6195 nprefix=$3;
6196 for part in $list; do
6197 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6198 echo "${nprefix}_$part = yes"
6200 done
6203 #############################################################################
6204 echo "Creating config.mak"
6205 cat > config.mak << EOF
6206 # -------- Generated by configure -----------
6208 # Ensure that locale settings do not interfere with shell commands.
6209 export LC_ALL = C
6211 CONFIGURATION = $configuration
6213 CHARSET = $_charset
6214 DOC_LANGS = $language_doc
6215 DOC_LANG_ALL = $doc_lang_all
6216 MAN_LANGS = $language_man
6217 MAN_LANG_ALL = $man_lang_all
6218 MSG_LANGS = $language_msg
6219 MSG_LANG_ALL = $msg_lang_all
6221 prefix = \$(DESTDIR)$_prefix
6222 BINDIR = \$(DESTDIR)$_bindir
6223 DATADIR = \$(DESTDIR)$_datadir
6224 LIBDIR = \$(DESTDIR)$_libdir
6225 MANDIR = \$(DESTDIR)$_mandir
6226 CONFDIR = \$(DESTDIR)$_confdir
6227 LOCALEDIR = \$(DESTDIR)$_localedir
6229 AR = $_ar
6230 AS = $_cc
6231 CC = $_cc
6232 CXX = $_cc
6233 INSTALL = $_install
6234 INSTALLSTRIP = $_install_strip
6235 WINDRES = $_windres
6237 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
6238 CXXFLAGS = $WARNFLAGS $ERRORFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
6239 DEPFLAGS = $DEPFLAGS
6241 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
6242 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
6243 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
6244 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
6245 CFLAGS_STACKREALIGN = $cflags_stackrealign
6247 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
6248 EXTRALIBS_MPLAYER = $libs_mplayer
6250 GETCH = $_getch
6251 TIMER = $_timer
6253 EXESUF = $_exesuf
6254 EXESUFS_ALL = .exe
6256 ARCH = $arch
6257 $(mak_enable "$arch_all" "$arch" ARCH)
6258 $(mak_enable "$subarch_all" "$subarch" ARCH)
6259 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
6261 MPLAYER = $_mplayer
6263 NEED_GETTIMEOFDAY = $need_gettimeofday
6264 NEED_GLOB = $need_glob
6265 NEED_SETENV = $need_setenv
6266 NEED_SHMEM = $need_shmem
6267 NEED_STRSEP = $need_strsep
6268 NEED_SWAB = $need_swab
6269 NEED_VSSCANF = $need_vsscanf
6271 # features
6272 3DFX = $_3dfx
6273 AA = $_aa
6274 ALSA = $_alsa
6275 APPLE_IR = $_apple_ir
6276 APPLE_REMOTE = $_apple_remote
6277 AUDIO_INPUT = $_audio_input
6278 BITMAP_FONT = $_bitmap_font
6279 BL = $_bl
6280 CACA = $_caca
6281 CDDA = $_cdda
6282 CDDB = $_cddb
6283 COCOA = $_cocoa
6284 COREAUDIO = $_coreaudio
6285 COREVIDEO = $_corevideo
6286 SHAREDBUFFER = $_sharedbuffer
6287 DGA = $_dga
6288 DIRECT3D = $_direct3d
6289 DIRECTFB = $_directfb
6290 DIRECTX = $_directx
6291 DVBIN = $_dvbin
6292 DVDNAV = $_dvdnav
6293 DVDNAV_INTERNAL = $dvdnav_internal
6294 DVDREAD = $_dvdread
6295 DVDREAD_INTERNAL = $_dvdread_internal
6296 DXR3 = $_dxr3
6297 FAAD = $_faad
6298 FASTMEMCPY = $_fastmemcpy
6299 FBDEV = $_fbdev
6300 FREETYPE = $_freetype
6301 FTP = $_ftp
6302 GIF = $_gif
6303 GGI = $_ggi
6304 GL = $_gl
6305 GL_COCOA = $_gl_cocoa
6306 GL_WIN32 = $_gl_win32
6307 GL_X11 = $_gl_x11
6308 GL_SDL = $_gl_sdl
6309 HAVE_POSIX_SELECT = $_posix_select
6310 HAVE_SYS_MMAN_H = $_mman
6311 IVTV = $_ivtv
6312 JACK = $_jack
6313 JOYSTICK = $_joystick
6314 JPEG = $_jpeg
6315 LADSPA = $_ladspa
6316 LIBA52 = $_liba52
6317 LIBASS = $_ass
6318 LIBBLURAY = $_bluray
6319 LIBBS2B = $_libbs2b
6320 LIBDCA = $_libdca
6321 LIBDV = $_libdv
6322 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
6323 LIBMAD = $_mad
6324 LIBNEMESI = $_nemesi
6325 LIBNUT = $_libnut
6326 LIBPOSTPROC = $libpostproc
6327 LIBSMBCLIENT = $_smb
6328 LIBTHEORA = $_theora
6329 LIRC = $_lirc
6330 LIVE555 = $_live
6331 MACOSX_FINDER = $_macosx_finder
6332 MD5SUM = $_md5sum
6333 MGA = $_mga
6334 MNG = $_mng
6335 MPG123 = $_mpg123
6336 MUSEPACK = $_musepack
6337 NAS = $_nas
6338 NATIVE_RTSP = $_native_rtsp
6339 NETWORKING = $networking
6340 OPENAL = $_openal
6341 OSS = $_ossaudio
6342 PE_EXECUTABLE = $_pe_executable
6343 PNG = $_png
6344 PNM = $_pnm
6345 PRIORITY = $_priority
6346 PULSE = $_pulse
6347 PORTAUDIO = $_portaudio
6348 PVR = $_pvr
6349 QTX_CODECS = $_qtx
6350 QTX_CODECS_WIN32 = $_qtx_codecs_win32
6351 QTX_EMULATION = $_qtx_emulation
6352 RADIO=$_radio
6353 RADIO_CAPTURE=$_radio_capture
6354 REAL_CODECS = $_real
6355 RSOUND = $_rsound
6356 S3FB = $_s3fb
6357 SDL = $_sdl
6358 SPEEX = $_speex
6359 STREAM_CACHE = $_stream_cache
6360 SUNAUDIO = $_sunaudio
6361 SVGA = $_svga
6362 TDFXFB = $_tdfxfb
6363 TDFXVID = $_tdfxvid
6364 TGA = $_tga
6365 TV = $_tv
6366 TV_BSDBT848 = $_tv_bsdbt848
6367 TV_DSHOW = $_tv_dshow
6368 TV_V4L = $_tv_v4l
6369 TV_V4L1 = $_tv_v4l1
6370 TV_V4L2 = $_tv_v4l2
6371 UNRAR_EXEC = $_unrar_exec
6372 V4L2 = $_v4l2
6373 VCD = $_vcd
6374 VDPAU = $_vdpau
6375 VESA = $_vesa
6376 VORBIS = $_vorbis
6377 VSTREAM = $_vstream
6378 WII = $_wii
6379 WIN32DLL = $_win32dll
6380 WIN32WAVEOUT = $_win32waveout
6381 WIN32_EMULATION = $_win32_emulation
6382 X11 = $_x11
6383 XANIM_CODECS = $_xanim
6384 XMGA = $_xmga
6385 XMMS_PLUGINS = $_xmms
6386 XV = $_xv
6387 XVID4 = $_xvid
6388 XVR100 = $_xvr100
6389 YUV4MPEG = $_yuv4mpeg
6391 # FFmpeg
6392 FFMPEG_INTERNALS = $ffmpeg_internals
6393 FFMPEG_SOURCE_PATH = $_ffmpeg_source
6395 RANLIB = $_ranlib
6396 YASM = $_yasm
6397 YASMFLAGS = $YASMFLAGS
6399 CONFIG_VDPAU = $_vdpau
6400 CONFIG_ZLIB = $_zlib
6402 HAVE_PTHREADS = $_pthreads
6403 HAVE_SHM = $_shm
6404 HAVE_W32THREADS = $_w32threads
6405 HAVE_YASM = $have_yasm
6409 #############################################################################
6411 ff_config_enable () {
6412 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6413 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6414 _nprefix=$3;
6415 test -z "$_nprefix" && _nprefix='CONFIG'
6416 for part in $list; do
6417 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6418 echo "#define ${_nprefix}_$part 1"
6419 else
6420 echo "#define ${_nprefix}_$part 0"
6422 done
6425 echo "Creating config.h"
6426 cat > $TMPH << EOF
6427 /*----------------------------------------------------------------------------
6428 ** This file has been automatically generated by configure any changes in it
6429 ** will be lost when you run configure again.
6430 ** Instead of modifying definitions here, use the --enable/--disable options
6431 ** of the configure script! See ./configure --help for details.
6432 *---------------------------------------------------------------------------*/
6434 #ifndef MPLAYER_CONFIG_H
6435 #define MPLAYER_CONFIG_H
6437 /* Undefine this if you do not want to select mono audio (left or right)
6438 with a stereo MPEG layer 2/3 audio stream. The command line option
6439 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6440 right-only), with 0 being the default.
6442 #define CONFIG_FAKE_MONO 1
6444 /* set up audio OUTBURST. Do not change this! */
6445 #define OUTBURST 512
6447 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
6448 #undef FAST_OSD
6449 #undef FAST_OSD_TABLE
6453 #define CONFIGURATION "$configuration"
6455 #define MPLAYER_DATADIR "$_datadir"
6456 #define MPLAYER_CONFDIR "$_confdir"
6457 #define MPLAYER_LOCALEDIR "$_localedir"
6459 $def_translation
6461 /* definitions needed by included libraries */
6462 #define HAVE_INTTYPES_H 1
6463 /* libdvdcss */
6464 #define HAVE_ERRNO_H 1
6465 /* libdvdcss + libdvdread */
6466 #define HAVE_LIMITS_H 1
6467 /* libdvdcss */
6468 #define HAVE_UNISTD_H 1
6469 /* libdvdread */
6470 #define STDC_HEADERS 1
6471 #define HAVE_MEMCPY 1
6472 /* libdvdnav */
6473 #define READ_CACHE_TRACE 0
6474 /* libdvdread */
6475 #define HAVE_DLFCN_H 1
6476 $def_dvdcss
6479 /* system headers */
6480 $def_alloca_h
6481 $def_altivec_h
6482 $def_malloc_h
6483 $def_mman_h
6484 $def_mman_has_map_failed
6485 $def_soundcard_h
6486 $def_sys_soundcard_h
6487 $def_sys_sysinfo_h
6488 $def_sys_videoio_h
6489 $def_termios_h
6490 $def_termios_sys_h
6491 $def_winsock2_h
6494 /* system functions */
6495 $def_gethostbyname2
6496 $def_gettimeofday
6497 $def_glob
6498 $def_langinfo
6499 $def_lrintf
6500 $def_map_memalign
6501 $def_memalign
6502 $def_nanosleep
6503 $def_posix_select
6504 $def_select
6505 $def_setenv
6506 $def_setmode
6507 $def_shm
6508 $def_strsep
6509 $def_swab
6510 $def_sysi86
6511 $def_sysi86_iv
6512 $def_termcap
6513 $def_termios
6514 $def_vsscanf
6517 /* system-specific features */
6518 $def_asmalign_pot
6519 $def_builtin_expect
6520 $def_dl
6521 $def_dos_paths
6522 $def_extern_asm
6523 $def_extern_prefix
6524 $def_iconv
6525 $def_kstat
6526 $def_macosx_bundle
6527 $def_macosx_finder
6528 $def_priority
6529 $def_quicktime
6530 $def_restrict_keyword
6531 $def_rtc
6532 $def_unrar_exec
6535 /* configurable options */
6536 $def_charset
6537 $def_crash_debug
6538 $def_debug
6539 $def_fastmemcpy
6540 $def_runtime_cpudetection
6541 $def_sighandler
6542 $def_sortsub
6543 $def_stream_cache
6544 $def_pthread_cache
6547 /* CPU stuff */
6548 #define __CPU__ $iproc
6549 $def_ebx_available
6550 $def_words_endian
6551 $def_bigendian
6552 $(ff_config_enable "$arch_all" "$arch" "ARCH")
6553 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
6554 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
6557 /* Blu-ray/DVD/VCD/CD */
6558 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
6559 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
6560 $def_bluray
6561 $def_bsdi_dvd
6562 $def_cdda
6563 $def_cddb
6564 $def_cdio
6565 $def_cdrom
6566 $def_dvd
6567 $def_dvd_bsd
6568 $def_dvd_darwin
6569 $def_dvd_linux
6570 $def_dvd_openbsd
6571 $def_dvdio
6572 $def_dvdnav
6573 $def_dvdread
6574 $def_hpux_scsi_h
6575 $def_sol_scsi_h
6576 $def_vcd
6579 /* codec libraries */
6580 $def_faad
6581 $def_liba52
6582 $def_libdca
6583 $def_libdv
6584 $def_mad
6585 $def_mpg123
6586 $def_musepack
6587 $def_speex
6588 $def_theora
6589 $def_tremor
6590 $def_vorbis
6591 $def_xvid
6592 $def_zlib
6594 $def_libpostproc
6595 $def_libnut
6598 /* binary codecs */
6599 $def_qtx
6600 $def_qtx_win32
6601 $def_real
6602 $def_win32_loader
6603 $def_win32dll
6604 $def_xanim
6605 $def_xmms
6606 #define BINARY_CODECS_PATH "$_codecsdir"
6607 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
6610 /* Audio output drivers */
6611 $def_alsa
6612 $def_coreaudio
6613 $def_jack
6614 $def_nas
6615 $def_openal
6616 $def_openal_h
6617 $def_ossaudio
6618 $def_ossaudio_devdsp
6619 $def_ossaudio_devmixer
6620 $def_pulse
6621 $def_portaudio
6622 $def_rsound
6623 $def_sunaudio
6624 $def_win32waveout
6626 $def_ladspa
6627 $def_libbs2b
6630 /* input */
6631 $def_apple_ir
6632 $def_apple_remote
6633 $def_ioctl_bt848_h_name
6634 $def_ioctl_meteor_h_name
6635 $def_joystick
6636 $def_lirc
6637 $def_lircc
6638 $def_pvr
6639 $def_radio
6640 $def_radio_bsdbt848
6641 $def_radio_capture
6642 $def_radio_v4l
6643 $def_radio_v4l2
6644 $def_tv
6645 $def_tv_bsdbt848
6646 $def_tv_dshow
6647 $def_tv_v4l
6648 $def_tv_v4l1
6649 $def_tv_v4l2
6652 /* font stuff */
6653 $def_ass
6654 $def_bitmap_font
6655 $def_enca
6656 $def_fontconfig
6657 $def_freetype
6658 $def_fribidi
6661 /* networking */
6662 $def_closesocket
6663 $def_ftp
6664 $def_inet6
6665 $def_inet_aton
6666 $def_inet_pton
6667 $def_live
6668 $def_nemesi
6669 $def_networking
6670 $def_smb
6671 $def_socklen_t
6672 $def_vstream
6675 /* libvo options */
6676 $def_3dfx
6677 $def_aa
6678 $def_bl
6679 $def_caca
6680 $def_corevideo
6681 $def_cocoa
6682 $def_sharedbuffer
6683 $def_dga
6684 $def_dga1
6685 $def_dga2
6686 $def_direct3d
6687 $def_directfb
6688 $def_directx
6689 $def_dvb
6690 $def_dvbin
6691 $def_dxr3
6692 $def_fbdev
6693 $def_ggi
6694 $def_ggiwmh
6695 $def_gif
6696 $def_gif_4
6697 $def_gif_tvt_hack
6698 $def_gl
6699 $def_gl_cocoa
6700 $def_gl_win32
6701 $def_gl_x11
6702 $def_gl_sdl
6703 $def_ivtv
6704 $def_jpeg
6705 $def_md5sum
6706 $def_mga
6707 $def_mng
6708 $def_png
6709 $def_pnm
6710 $def_s3fb
6711 $def_sdl
6712 $def_sdl_sdl_h
6713 $def_svga
6714 $def_tdfxfb
6715 $def_tdfxvid
6716 $def_tga
6717 $def_v4l2
6718 $def_vdpau
6719 $def_vesa
6720 $def_vm
6721 $def_wii
6722 $def_x11
6723 $def_xdpms
6724 $def_xf86keysym
6725 $def_xinerama
6726 $def_xmga
6727 $def_xss
6728 $def_xv
6729 $def_xvr100
6730 $def_yuv4mpeg
6733 /* FFmpeg */
6734 $def_ffmpeg_internals
6736 $def_arpa_inet_h
6737 $def_bswap
6738 $def_dcbzl
6739 $def_exp2
6740 $def_exp2f
6741 $def_fast_64bit
6742 $def_fast_unaligned
6743 $def_llrint
6744 $def_log2
6745 $def_log2f
6746 $def_lrint
6747 $def_memalign_hack
6748 $def_mkstemp
6749 $def_posix_memalign
6750 $def_pthreads
6751 $def_round
6752 $def_roundf
6753 $def_threads
6754 $def_truncf
6755 $def_xform_asm
6756 $def_yasm
6758 #define HAVE_INLINE_ASM 1
6760 /* Use these registers in x86 inline asm. No proper detection yet. */
6761 #define HAVE_EBP_AVAILABLE 1
6763 #endif /* MPLAYER_CONFIG_H */
6766 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6767 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
6769 #############################################################################
6771 cat << EOF
6773 Config files successfully generated by ./configure $configuration !
6775 Install prefix: $_prefix
6776 Data directory: $_datadir
6777 Config direct.: $_confdir
6779 Byte order: $_byte_order
6780 Optimizing for: $_optimizing
6782 Languages:
6783 Messages (in addition to English): $language_msg
6784 Manual pages: $language_man
6785 Documentation: $language_doc
6787 Enabled optional drivers:
6788 Input: $inputmodules
6789 Codecs: $codecmodules
6790 Audio output: $aomodules
6791 Video output: $vomodules
6793 Disabled optional drivers:
6794 Input: $noinputmodules
6795 Codecs: $nocodecmodules
6796 Audio output: $noaomodules
6797 Video output: $novomodules
6799 'config.h' and 'config.mak' contain your configuration options.
6800 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6801 compile *** DO NOT REPORT BUGS if you tweak these files ***
6803 'make' will now compile MPlayer and 'make install' will install it.
6804 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6809 cat <<EOF
6810 Check $TMPLOG if you wonder why an autodetection failed (make sure
6811 development headers/packages are installed).
6813 NOTE: The --enable-* parameters unconditionally force options on, completely
6814 skipping autodetection. This behavior is unlike what you may be used to from
6815 autoconf-based configure scripts that can decide to override you. This greater
6816 level of control comes at a price. You may have to provide the correct compiler
6817 and linker flags yourself.
6818 If you used one of these options (except --enable-runtime-cpudetection and
6819 similar ones that turn on internal features) and experience a compilation or
6820 linking failure, make sure you have passed the necessary compiler/linker flags
6821 to configure.
6823 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6827 if test "$warn_cflags" = yes; then
6828 cat <<EOF
6830 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6831 but:
6833 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6835 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6836 To do so, execute 'CFLAGS= ./configure <options>'
6841 # Last move:
6842 rm -rf "$mplayer_tmpdir"