quvi: Add support for streaming sites using libquvi
[mplayer.git] / configure
blob18bc404e071798264b3fcdf588423bc3c9179822
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-libquvi enable libquvi [autodetect]
339 --enable-nemesi enable Nemesi Streaming Media [autodetect]
340 --disable-vcd disable VCD support [autodetect]
341 --disable-bluray disable Blu-ray support [autodetect]
342 --disable-dvdnav disable libdvdnav [autodetect]
343 --disable-dvdread disable libdvdread [autodetect]
344 --disable-dvdread-internal disable internal libdvdread [autodetect]
345 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
346 --disable-cddb disable cddb [autodetect]
347 --disable-bitmap-font disable bitmap font support [enable]
348 --disable-freetype disable FreeType 2 font rendering [autodetect]
349 --disable-fontconfig disable fontconfig font lookup [autodetect]
350 --disable-unrarexec disable using of UnRAR executable [enabled]
351 --disable-sortsub disable subtitle sorting [enabled]
352 --enable-fribidi enable the FriBiDi libs [autodetect]
353 --disable-enca disable ENCA charset oracle library [autodetect]
354 --enable-macosx-finder enable Mac OS X Finder invocation parameter
355 parsing [disabled]
356 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
357 --disable-inet6 disable IPv6 support [autodetect]
358 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
359 --disable-ftp disable FTP support [enabled]
360 --disable-vstream disable TiVo vstream client support [autodetect]
361 --disable-pthreads disable Posix threads support [autodetect]
362 --disable-w32threads disable Win32 threads support [autodetect]
363 --disable-libass disable subtitle rendering with libass [autodetect]
364 --enable-rpath enable runtime linker path for extra libs [disabled]
365 --disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
367 Codecs:
368 --enable-gif enable GIF support [autodetect]
369 --enable-png enable PNG input/output support [autodetect]
370 --enable-mng enable MNG input support [autodetect]
371 --enable-jpeg enable JPEG input/output support [autodetect]
372 --enable-libcdio enable libcdio support [autodetect]
373 --disable-win32dll disable Win32 DLL support [autodetect]
374 --disable-qtx disable QuickTime codecs support [enabled]
375 --disable-xanim disable XAnim codecs support [enabled]
376 --disable-real disable RealPlayer codecs support [enabled]
377 --disable-xvid disable Xvid [autodetect]
378 --disable-libnut disable libnut [autodetect]
379 --enable-libav skip Libav autodetection [autodetect]
380 --disable-libvorbis disable libvorbis support [autodetect]
381 --disable-tremor disable Tremor [autodetect if no libvorbis]
382 --disable-speex disable Speex support [autodetect]
383 --enable-theora enable OggTheora libraries [autodetect]
384 --enable-faad enable FAAD2 (AAC) [autodetect]
385 --disable-ladspa disable LADSPA plugin support [autodetect]
386 --disable-libbs2b disable libbs2b audio filter support [autodetect]
387 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
388 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
389 --disable-mad disable libmad (MPEG audio) support [autodetect]
390 --enable-xmms enable XMMS input plugin support [disabled]
391 --enable-libdca enable libdca support [autodetect]
392 --disable-liba52 disable liba52 [autodetect]
393 --enable-musepack enable libmpcdec support (deprecated, libavcodec
394 Musepack decoder is preferred) [disabled]
396 Video output:
397 --enable-gl enable OpenGL video output [autodetect]
398 --enable-dga2 enable DGA 2 support [autodetect]
399 --enable-dga1 enable DGA 1 support [autodetect]
400 --enable-vesa enable VESA video output [autodetect]
401 --enable-svga enable SVGAlib video output [autodetect]
402 --enable-sdl enable SDL video output [autodetect]
403 --enable-aa enable AAlib video output [autodetect]
404 --enable-caca enable CACA video output [autodetect]
405 --enable-ggi enable GGI video output [autodetect]
406 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
407 --enable-direct3d enable Direct3D video output [autodetect]
408 --enable-directx enable DirectX video output [autodetect]
409 --enable-dxr3 enable DXR3/H+ video output [autodetect]
410 --enable-ivtv enable IVTV TV-Out video output [autodetect]
411 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
412 --enable-dvb enable DVB video output [autodetect]
413 --enable-mga enable mga_vid video output [autodetect]
414 --enable-xmga enable mga_vid X11 video output [autodetect]
415 --enable-xv enable Xv video output [autodetect]
416 --enable-vdpau enable VDPAU acceleration [autodetect]
417 --enable-vm enable XF86VidMode support [autodetect]
418 --enable-xinerama enable Xinerama support [autodetect]
419 --enable-x11 enable X11 video output [autodetect]
420 --enable-xshape enable XShape support [autodetect]
421 --disable-xss disable screensaver support via xss [autodetect]
422 --enable-fbdev enable FBDev video output [autodetect]
423 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
424 --enable-tdfxfb enable tdfxfb video output [disable]
425 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
426 --enable-wii enable Nintendo Wii/GameCube video output [disable]
427 --enable-directfb enable DirectFB video output [autodetect]
428 --enable-bl enable Blinkenlights video output [disable]
429 --enable-tdfxvid enable tdfx_vid video output [disable]
430 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
431 --disable-tga disable Targa video output [enable]
432 --disable-pnm disable PNM video output [enable]
433 --disable-md5sum disable md5sum video output [enable]
434 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
435 --disable-corevideo disable CoreVideo video output [autodetect]
436 --disable-cocoa disable Cocoa OpenGL backend [autodetect]
437 --disable-sharedbuffer disable OSX shared buffer video output [autodetect]
439 Audio output:
440 --disable-alsa disable ALSA audio output [autodetect]
441 --disable-ossaudio disable OSS audio output [autodetect]
442 --disable-rsound disable RSound audio output [autodetect]
443 --disable-pulse disable Pulseaudio audio output [autodetect]
444 --disable-portaudio disable PortAudio audio output [autodetect]
445 --disable-jack disable JACK audio output [autodetect]
446 --enable-openal enable OpenAL audio output [disable]
447 --disable-nas disable NAS audio output [autodetect]
448 --disable-sunaudio disable Sun audio output [autodetect]
449 --disable-win32waveout disable Windows waveout audio output [autodetect]
450 --disable-coreaudio disable CoreAudio audio output [autodetect]
451 --disable-select disable using select() on the audio device [enable]
453 Language options:
454 --enable-translation enable support for translated output [disable]
455 --charset=charset convert the console messages to this character set
456 --language-doc=lang language to use for the documentation [en]
457 --language-man=lang language to use for the man pages [en]
458 --language-msg=lang extra languages for program messages [all]
459 --language=lang default language to use [en]
460 Specific options override --language. You can pass a list of languages separated
461 by whitespace or commas instead of a single language. Nonexisting translations
462 will be dropped from each list. All translations available in the list will be
463 installed. The value "all" will activate all translations. The LINGUAS
464 environment variable is honored. In all cases the fallback is English.
465 The program always supports English-language output; additional message
466 languages are only installed if --enable-translation is also specified.
467 Available values for --language-doc are: all $doc_lang_all
468 Available values for --language-man are: all $man_lang_all
469 Available values for --language-msg are: all $msg_lang_all
471 Miscellaneous options:
472 --enable-runtime-cpudetection enable runtime CPU detection [disable]
473 --enable-cross-compile enable cross-compilation [disable]
474 --cc=COMPILER C compiler to build MPlayer [gcc]
475 --as=ASSEMBLER assembler to build MPlayer [as]
476 --nm=NM nm tool to build MPlayer [nm]
477 --yasm=YASM Yasm assembler to build MPlayer [yasm]
478 --ar=AR librarian to build MPlayer [ar]
479 --pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
480 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
481 --windres=WINDRES windres to build MPlayer [windres]
482 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
483 --enable-static build a statically linked binary
484 --with-install=PATH path to a custom install program
486 Advanced options:
487 --enable-mmx enable MMX [autodetect]
488 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
489 --enable-3dnow enable 3DNow! [autodetect]
490 --enable-3dnowext enable extended 3DNow! [autodetect]
491 --enable-sse enable SSE [autodetect]
492 --enable-sse2 enable SSE2 [autodetect]
493 --enable-ssse3 enable SSSE3 [autodetect]
494 --enable-shm enable shm [autodetect]
495 --enable-altivec enable AltiVec (PowerPC) [autodetect]
496 --enable-armv5te enable DSP extensions (ARM) [autodetect]
497 --enable-armv6 enable ARMv6 (ARM) [autodetect]
498 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
499 --enable-armvfp enable ARM VFP (ARM) [autodetect]
500 --enable-neon enable NEON (ARM) [autodetect]
501 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
502 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
503 --enable-big-endian force byte order to big-endian [autodetect]
504 --enable-debug[=1-3] compile-in debugging information [disable]
505 --enable-profile compile-in profiling information [disable]
506 --disable-sighandler disable sighandler for crashes [enable]
507 --enable-crash-debug enable automatic gdb attach on crash [disable]
509 Use these options if autodetection fails:
510 --extra-cflags=FLAGS extra CFLAGS
511 --extra-ldflags=FLAGS extra LDFLAGS
512 --extra-libs=FLAGS extra linker flags
513 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
515 --with-sdl-config=PATH path to sdl*-config
516 --with-dvdnav-config=PATH path to dvdnav-config
517 --with-dvdread-config=PATH path to dvdread-config
519 This configure script is NOT autoconf-based, even though its output is similar.
520 It will try to autodetect all configuration options. If you --enable an option
521 it will be forcefully turned on, skipping autodetection. This can break
522 compilation, so you need to know what you are doing.
524 exit 0
525 } #show_help()
527 # GOTCHA: the variables below defines the default behavior for autodetection
528 # and have - unless stated otherwise - at least 2 states : yes no
529 # If autodetection is available then the third state is: auto
530 _mmx=auto
531 _3dnow=auto
532 _3dnowext=auto
533 _mmxext=auto
534 _sse=auto
535 _sse2=auto
536 _ssse3=auto
537 _cmov=auto
538 _fast_cmov=auto
539 _fast_clz=auto
540 _armv5te=auto
541 _armv6=auto
542 _armv6t2=auto
543 _armvfp=auto
544 neon=auto
545 _iwmmxt=auto
546 _altivec=auto
547 _install=install
548 _pkg_config=auto
549 _ranlib=auto
550 _windres=auto
551 _cc=auto
552 _ar=auto
553 test "$CC" && _cc="$CC"
554 _as=auto
555 _nm=auto
556 _yasm=auto
557 _runtime_cpudetection=no
558 _cross_compile=no
559 _prefix="/usr/local"
560 ffmpeg=auto
561 ffmpeg_internals=no
562 _mplayer=yes
563 _x11=auto
564 _xshape=auto
565 _xss=auto
566 _dga1=auto
567 _dga2=auto
568 _xv=auto
569 _vdpau=auto
570 _sdl=auto
571 _direct3d=auto
572 _directx=auto
573 _win32waveout=auto
574 _nas=auto
575 _png=auto
576 _mng=auto
577 _jpeg=auto
578 _pnm=yes
579 _md5sum=yes
580 _yuv4mpeg=yes
581 _gif=auto
582 _gl=auto
583 _ggi=auto
584 _ggiwmh=auto
585 _aa=auto
586 _caca=auto
587 _svga=auto
588 _vesa=auto
589 _fbdev=auto
590 _dvb=auto
591 _dxr3=auto
592 _ivtv=auto
593 _v4l2=auto
594 _iconv=auto
595 _langinfo=auto
596 _rtc=auto
597 _ossaudio=auto
598 _rsound=auto
599 _pulse=auto
600 _portaudio=auto
601 _jack=auto
602 _openal=no
603 _libcdio=auto
604 _mad=auto
605 _tremor=auto
606 _libvorbis=auto
607 _speex=auto
608 _theora=auto
609 _mpg123=auto
610 _liba52=auto
611 _libdca=auto
612 _faad=auto
613 _ladspa=auto
614 _libbs2b=auto
615 _xmms=no
616 _vcd=auto
617 _bluray=auto
618 _dvdnav=auto
619 _dvdnavconfig=dvdnav-config
620 _dvdreadconfig=dvdread-config
621 _dvdread=auto
622 _dvdread_internal=auto
623 _libdvdcss_internal=auto
624 _xanim=auto
625 _real=auto
626 _live=no
627 _nemesi=auto
628 _native_rtsp=yes
629 _xinerama=auto
630 _mga=auto
631 _xmga=auto
632 _vm=auto
633 _xf86keysym=auto
634 _sunaudio=auto
635 _alsa=auto
636 _fastmemcpy=yes
637 _unrar_exec=auto
638 _win32dll=auto
639 _select=yes
640 _radio=no
641 _radio_capture=no
642 _radio_v4l=auto
643 _radio_v4l2=auto
644 _radio_bsdbt848=auto
645 _tv=yes
646 _tv_v4l1=auto
647 _tv_v4l2=auto
648 _tv_bsdbt848=auto
649 _tv_dshow=auto
650 _pvr=auto
651 networking=yes
652 _winsock2_h=auto
653 _smb=auto
654 _libquvi=auto
655 _joystick=no
656 _xvid=auto
657 _libnut=auto
658 _lirc=auto
659 _lircc=auto
660 _apple_remote=auto
661 _apple_ir=auto
662 _termcap=auto
663 _termios=auto
664 _3dfx=no
665 _s3fb=no
666 _wii=no
667 _tdfxfb=no
668 _tdfxvid=no
669 _xvr100=auto
670 _tga=yes
671 _directfb=auto
672 _bl=no
673 #language=en
674 _shm=auto
675 _translation=no
676 _charset="UTF-8"
677 _crash_debug=no
678 _sighandler=yes
679 _libdv=auto
680 _cdda=auto
681 _cddb=auto
682 _big_endian=auto
683 _bitmap_font=yes
684 _freetype=auto
685 _fontconfig=auto
686 _qtx=auto
687 _coreaudio=auto
688 _corevideo=auto
689 _cocoa=auto
690 _sharedbuffer=auto
691 quicktime=auto
692 _macosx_finder=no
693 _macosx_bundle=auto
694 _sortsub=yes
695 _fribidi=auto
696 _enca=auto
697 _inet6=auto
698 _gethostbyname2=auto
699 _ftp=auto
700 _musepack=no
701 _vstream=auto
702 _pthreads=auto
703 _w32threads=auto
704 _ass=auto
705 _rpath=no
706 libpostproc=auto
707 _asmalign_pot=auto
708 _stream_cache=yes
709 _priority=no
710 def_dos_paths="#define HAVE_DOS_PATHS 0"
711 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
712 def_priority="#undef CONFIG_PRIORITY"
713 def_pthread_cache="#undef PTHREAD_CACHE"
714 need_shmem=yes
715 for ac_option do
716 case "$ac_option" in
717 --help|-help|-h)
718 show_help
720 --prefix=*)
721 _prefix=$(echo $ac_option | cut -d '=' -f 2)
723 --bindir=*)
724 _bindir=$(echo $ac_option | cut -d '=' -f 2)
726 --datadir=*)
727 _datadir=$(echo $ac_option | cut -d '=' -f 2)
729 --mandir=*)
730 _mandir=$(echo $ac_option | cut -d '=' -f 2)
732 --confdir=*)
733 _confdir=$(echo $ac_option | cut -d '=' -f 2)
735 --libdir=*)
736 _libdir=$(echo $ac_option | cut -d '=' -f 2)
738 --codecsdir=*)
739 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
741 --localedir=*)
742 _localedir=$(echo $ac_option | cut -d '=' -f 2)
745 --with-install=*)
746 _install=$(echo $ac_option | cut -d '=' -f 2 )
749 --with-sdl-config=*)
750 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
752 --with-dvdnav-config=*)
753 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
755 --with-dvdread-config=*)
756 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
759 --extra-cflags=*)
760 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
762 --extra-ldflags=*)
763 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
765 --extra-libs=*)
766 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
768 --extra-libs-mplayer=*)
769 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
772 --target=*)
773 _target=$(echo $ac_option | cut -d '=' -f 2)
775 --cc=*)
776 _cc=$(echo $ac_option | cut -d '=' -f 2)
778 --as=*)
779 _as=$(echo $ac_option | cut -d '=' -f 2)
781 --nm=*)
782 _nm=$(echo $ac_option | cut -d '=' -f 2)
784 --yasm=*)
785 _yasm=$(echo $ac_option | cut -d '=' -f 2)
787 --ar=*)
788 _ar=$(echo $ac_option | cut -d '=' -f 2)
790 --pkg-config=*)
791 _pkg_config=$(echo $ac_option | cut -d '=' -f 2)
793 --ranlib=*)
794 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
796 --windres=*)
797 _windres=$(echo $ac_option | cut -d '=' -f 2)
799 --charset=*)
800 _charset=$(echo $ac_option | cut -d '=' -f 2)
802 --language-doc=*)
803 language_doc=$(echo $ac_option | cut -d '=' -f 2)
805 --language-man=*)
806 language_man=$(echo $ac_option | cut -d '=' -f 2)
808 --language-msg=*)
809 language_msg=$(echo $ac_option | cut -d '=' -f 2)
811 --language=*)
812 language=$(echo $ac_option | cut -d '=' -f 2)
815 --enable-static)
816 _ld_static='-static'
818 --disable-static)
819 _ld_static=''
821 --enable-profile)
822 _profile='-p'
824 --disable-profile)
825 _profile=
827 --enable-debug)
828 _debug='-g'
830 --enable-debug=*)
831 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
833 --disable-debug)
834 _debug=
836 --enable-translation) _translation=yes ;;
837 --disable-translation) _translation=no ;;
838 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
839 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
840 --enable-cross-compile) _cross_compile=yes ;;
841 --disable-cross-compile) _cross_compile=no ;;
842 --enable-mplayer) _mplayer=yes ;;
843 --disable-mplayer) _mplayer=no ;;
844 --enable-x11) _x11=yes ;;
845 --disable-x11) _x11=no ;;
846 --enable-xshape) _xshape=yes ;;
847 --disable-xshape) _xshape=no ;;
848 --enable-xss) _xss=yes ;;
849 --disable-xss) _xss=no ;;
850 --enable-xv) _xv=yes ;;
851 --disable-xv) _xv=no ;;
852 --enable-vdpau) _vdpau=yes ;;
853 --disable-vdpau) _vdpau=no ;;
854 --enable-sdl) _sdl=yes ;;
855 --disable-sdl) _sdl=no ;;
856 --enable-direct3d) _direct3d=yes ;;
857 --disable-direct3d) _direct3d=no ;;
858 --enable-directx) _directx=yes ;;
859 --disable-directx) _directx=no ;;
860 --enable-win32waveout) _win32waveout=yes ;;
861 --disable-win32waveout) _win32waveout=no ;;
862 --enable-nas) _nas=yes ;;
863 --disable-nas) _nas=no ;;
864 --enable-png) _png=yes ;;
865 --disable-png) _png=no ;;
866 --enable-mng) _mng=yes ;;
867 --disable-mng) _mng=no ;;
868 --enable-jpeg) _jpeg=yes ;;
869 --disable-jpeg) _jpeg=no ;;
870 --enable-pnm) _pnm=yes ;;
871 --disable-pnm) _pnm=no ;;
872 --enable-md5sum) _md5sum=yes ;;
873 --disable-md5sum) _md5sum=no ;;
874 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
875 --disable-yuv4mpeg) _yuv4mpeg=no ;;
876 --enable-gif) _gif=yes ;;
877 --disable-gif) _gif=no ;;
878 --enable-gl) _gl=yes ;;
879 --disable-gl) _gl=no ;;
880 --enable-ggi) _ggi=yes ;;
881 --disable-ggi) _ggi=no ;;
882 --enable-ggiwmh) _ggiwmh=yes ;;
883 --disable-ggiwmh) _ggiwmh=no ;;
884 --enable-aa) _aa=yes ;;
885 --disable-aa) _aa=no ;;
886 --enable-caca) _caca=yes ;;
887 --disable-caca) _caca=no ;;
888 --enable-svga) _svga=yes ;;
889 --disable-svga) _svga=no ;;
890 --enable-vesa) _vesa=yes ;;
891 --disable-vesa) _vesa=no ;;
892 --enable-fbdev) _fbdev=yes ;;
893 --disable-fbdev) _fbdev=no ;;
894 --enable-dvb) _dvb=yes ;;
895 --disable-dvb) _dvb=no ;;
896 --enable-dxr3) _dxr3=yes ;;
897 --disable-dxr3) _dxr3=no ;;
898 --enable-ivtv) _ivtv=yes ;;
899 --disable-ivtv) _ivtv=no ;;
900 --enable-v4l2) _v4l2=yes ;;
901 --disable-v4l2) _v4l2=no ;;
902 --enable-iconv) _iconv=yes ;;
903 --disable-iconv) _iconv=no ;;
904 --enable-langinfo) _langinfo=yes ;;
905 --disable-langinfo) _langinfo=no ;;
906 --enable-rtc) _rtc=yes ;;
907 --disable-rtc) _rtc=no ;;
908 --enable-libdv) _libdv=yes ;;
909 --disable-libdv) _libdv=no ;;
910 --enable-ossaudio) _ossaudio=yes ;;
911 --disable-ossaudio) _ossaudio=no ;;
912 --enable-rsound) _rsound=yes ;;
913 --disable-rsound) _rsound=no ;;
914 --enable-pulse) _pulse=yes ;;
915 --disable-pulse) _pulse=no ;;
916 --enable-portaudio) _portaudio=yes ;;
917 --disable-portaudio) _portaudio=no ;;
918 --enable-jack) _jack=yes ;;
919 --disable-jack) _jack=no ;;
920 --enable-openal) _openal=yes ;;
921 --disable-openal) _openal=no ;;
922 --enable-mad) _mad=yes ;;
923 --disable-mad) _mad=no ;;
924 --enable-libcdio) _libcdio=yes ;;
925 --disable-libcdio) _libcdio=no ;;
926 --enable-libvorbis) _libvorbis=yes ;;
927 --disable-libvorbis) _libvorbis=no ;;
928 --enable-speex) _speex=yes ;;
929 --disable-speex) _speex=no ;;
930 --enable-tremor) _tremor=yes ;;
931 --disable-tremor) _tremor=no ;;
932 --enable-theora) _theora=yes ;;
933 --disable-theora) _theora=no ;;
934 --enable-mpg123) _mpg123=yes ;;
935 --disable-mpg123) _mpg123=no ;;
936 --enable-liba52) _liba52=yes ;;
937 --disable-liba52) _liba52=no ;;
938 --enable-libdca) _libdca=yes ;;
939 --disable-libdca) _libdca=no ;;
940 --enable-musepack) _musepack=yes ;;
941 --disable-musepack) _musepack=no ;;
942 --enable-faad) _faad=yes ;;
943 --disable-faad) _faad=no ;;
944 --enable-ladspa) _ladspa=yes ;;
945 --disable-ladspa) _ladspa=no ;;
946 --enable-libbs2b) _libbs2b=yes ;;
947 --disable-libbs2b) _libbs2b=no ;;
948 --enable-xmms) _xmms=yes ;;
949 --disable-xmms) _xmms=no ;;
950 --enable-vcd) _vcd=yes ;;
951 --disable-vcd) _vcd=no ;;
952 --enable-bluray) _bluray=yes ;;
953 --disable-bluray) _bluray=no ;;
954 --enable-dvdread) _dvdread=yes ;;
955 --disable-dvdread) _dvdread=no ;;
956 --enable-dvdread-internal) _dvdread_internal=yes ;;
957 --disable-dvdread-internal) _dvdread_internal=no ;;
958 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
959 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
960 --enable-dvdnav) _dvdnav=yes ;;
961 --disable-dvdnav) _dvdnav=no ;;
962 --enable-xanim) _xanim=yes ;;
963 --disable-xanim) _xanim=no ;;
964 --enable-real) _real=yes ;;
965 --disable-real) _real=no ;;
966 --enable-live) _live=yes ;;
967 --disable-live) _live=no ;;
968 --enable-nemesi) _nemesi=yes ;;
969 --disable-nemesi) _nemesi=no ;;
970 --enable-xinerama) _xinerama=yes ;;
971 --disable-xinerama) _xinerama=no ;;
972 --enable-mga) _mga=yes ;;
973 --disable-mga) _mga=no ;;
974 --enable-xmga) _xmga=yes ;;
975 --disable-xmga) _xmga=no ;;
976 --enable-vm) _vm=yes ;;
977 --disable-vm) _vm=no ;;
978 --enable-xf86keysym) _xf86keysym=yes ;;
979 --disable-xf86keysym) _xf86keysym=no ;;
980 --enable-sunaudio) _sunaudio=yes ;;
981 --disable-sunaudio) _sunaudio=no ;;
982 --enable-alsa) _alsa=yes ;;
983 --disable-alsa) _alsa=no ;;
984 --enable-tv) _tv=yes ;;
985 --disable-tv) _tv=no ;;
986 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
987 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
988 --enable-tv-v4l1) _tv_v4l1=yes ;;
989 --disable-tv-v4l1) _tv_v4l1=no ;;
990 --enable-tv-v4l2) _tv_v4l2=yes ;;
991 --disable-tv-v4l2) _tv_v4l2=no ;;
992 --enable-tv-dshow) _tv_dshow=yes ;;
993 --disable-tv-dshow) _tv_dshow=no ;;
994 --enable-radio) _radio=yes ;;
995 --enable-radio-capture) _radio_capture=yes ;;
996 --disable-radio-capture) _radio_capture=no ;;
997 --disable-radio) _radio=no ;;
998 --enable-radio-v4l) _radio_v4l=yes ;;
999 --disable-radio-v4l) _radio_v4l=no ;;
1000 --enable-radio-v4l2) _radio_v4l2=yes ;;
1001 --disable-radio-v4l2) _radio_v4l2=no ;;
1002 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1003 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1004 --enable-pvr) _pvr=yes ;;
1005 --disable-pvr) _pvr=no ;;
1006 --enable-fastmemcpy) _fastmemcpy=yes ;;
1007 --disable-fastmemcpy) _fastmemcpy=no ;;
1008 --enable-networking) networking=yes ;;
1009 --disable-networking) networking=no ;;
1010 --enable-winsock2_h) _winsock2_h=yes ;;
1011 --disable-winsock2_h) _winsock2_h=no ;;
1012 --enable-smb) _smb=yes ;;
1013 --disable-smb) _smb=no ;;
1014 --enable-libquvi) _libquvi=yes ;;
1015 --disable-libquvi) _libquvi=no ;;
1016 --enable-joystick) _joystick=yes ;;
1017 --disable-joystick) _joystick=no ;;
1018 --enable-xvid) _xvid=yes ;;
1019 --disable-xvid) _xvid=no ;;
1020 --enable-libnut) _libnut=yes ;;
1021 --disable-libnut) _libnut=no ;;
1022 --enable-libav) ffmpeg=yes ;;
1023 --ffmpeg-source-dir=*)
1024 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1026 --enable-lirc) _lirc=yes ;;
1027 --disable-lirc) _lirc=no ;;
1028 --enable-lircc) _lircc=yes ;;
1029 --disable-lircc) _lircc=no ;;
1030 --enable-apple-remote) _apple_remote=yes ;;
1031 --disable-apple-remote) _apple_remote=no ;;
1032 --enable-apple-ir) _apple_ir=yes ;;
1033 --disable-apple-ir) _apple_ir=no ;;
1034 --enable-termcap) _termcap=yes ;;
1035 --disable-termcap) _termcap=no ;;
1036 --enable-termios) _termios=yes ;;
1037 --disable-termios) _termios=no ;;
1038 --enable-3dfx) _3dfx=yes ;;
1039 --disable-3dfx) _3dfx=no ;;
1040 --enable-s3fb) _s3fb=yes ;;
1041 --disable-s3fb) _s3fb=no ;;
1042 --enable-wii) _wii=yes ;;
1043 --disable-wii) _wii=no ;;
1044 --enable-tdfxfb) _tdfxfb=yes ;;
1045 --disable-tdfxfb) _tdfxfb=no ;;
1046 --disable-tdfxvid) _tdfxvid=no ;;
1047 --enable-tdfxvid) _tdfxvid=yes ;;
1048 --disable-xvr100) _xvr100=no ;;
1049 --enable-xvr100) _xvr100=yes ;;
1050 --disable-tga) _tga=no ;;
1051 --enable-tga) _tga=yes ;;
1052 --enable-directfb) _directfb=yes ;;
1053 --disable-directfb) _directfb=no ;;
1054 --enable-bl) _bl=yes ;;
1055 --disable-bl) _bl=no ;;
1056 --enable-shm) _shm=yes ;;
1057 --disable-shm) _shm=no ;;
1058 --enable-select) _select=yes ;;
1059 --disable-select) _select=no ;;
1060 --enable-cddb) _cddb=yes ;;
1061 --disable-cddb) _cddb=no ;;
1062 --enable-big-endian) _big_endian=yes ;;
1063 --disable-big-endian) _big_endian=no ;;
1064 --enable-bitmap-font) _bitmap_font=yes ;;
1065 --disable-bitmap-font) _bitmap_font=no ;;
1066 --enable-freetype) _freetype=yes ;;
1067 --disable-freetype) _freetype=no ;;
1068 --enable-fontconfig) _fontconfig=yes ;;
1069 --disable-fontconfig) _fontconfig=no ;;
1070 --enable-unrarexec) _unrar_exec=yes ;;
1071 --disable-unrarexec) _unrar_exec=no ;;
1072 --enable-ftp) _ftp=yes ;;
1073 --disable-ftp) _ftp=no ;;
1074 --enable-vstream) _vstream=yes ;;
1075 --disable-vstream) _vstream=no ;;
1076 --enable-pthreads) _pthreads=yes ;;
1077 --disable-pthreads) _pthreads=no ;;
1078 --enable-w32threads) _w32threads=yes ;;
1079 --disable-w32threads) _w32threads=no ;;
1080 --enable-libass) _ass=yes ;;
1081 --disable-libass) _ass=no ;;
1082 --enable-rpath) _rpath=yes ;;
1083 --disable-rpath) _rpath=no ;;
1084 --enable-libpostproc) libpostproc=yes ;;
1085 --disable-libpostproc) libpostproc=no ;;
1087 --enable-fribidi) _fribidi=yes ;;
1088 --disable-fribidi) _fribidi=no ;;
1090 --enable-enca) _enca=yes ;;
1091 --disable-enca) _enca=no ;;
1093 --enable-inet6) _inet6=yes ;;
1094 --disable-inet6) _inet6=no ;;
1096 --enable-gethostbyname2) _gethostbyname2=yes ;;
1097 --disable-gethostbyname2) _gethostbyname2=no ;;
1099 --enable-dga1) _dga1=yes ;;
1100 --disable-dga1) _dga1=no ;;
1101 --enable-dga2) _dga2=yes ;;
1102 --disable-dga2) _dga2=no ;;
1104 --enable-qtx) _qtx=yes ;;
1105 --disable-qtx) _qtx=no ;;
1107 --enable-coreaudio) _coreaudio=yes ;;
1108 --disable-coreaudio) _coreaudio=no ;;
1109 --enable-corevideo) _corevideo=yes ;;
1110 --disable-corevideo) _corevideo=no ;;
1111 --enable-cocoa) _cocoa=yes ;;
1112 --disable-cocoa) _cocoa=no ;;
1113 --enable-sharedbuffer) _sharedbuffer=yes ;;
1114 --disable-sharedbuffer) _sharedbuffer=no ;;
1115 --enable-macosx-finder) _macosx_finder=yes ;;
1116 --disable-macosx-finder) _macosx_finder=no ;;
1117 --enable-macosx-bundle) _macosx_bundle=yes ;;
1118 --disable-macosx-bundle) _macosx_bundle=no ;;
1120 --enable-sortsub) _sortsub=yes ;;
1121 --disable-sortsub) _sortsub=no ;;
1123 --enable-crash-debug) _crash_debug=yes ;;
1124 --disable-crash-debug) _crash_debug=no ;;
1125 --enable-sighandler) _sighandler=yes ;;
1126 --disable-sighandler) _sighandler=no ;;
1127 --enable-win32dll) _win32dll=yes ;;
1128 --disable-win32dll) _win32dll=no ;;
1130 --enable-sse) _sse=yes ;;
1131 --disable-sse) _sse=no ;;
1132 --enable-sse2) _sse2=yes ;;
1133 --disable-sse2) _sse2=no ;;
1134 --enable-ssse3) _ssse3=yes ;;
1135 --disable-ssse3) _ssse3=no ;;
1136 --enable-mmxext) _mmxext=yes ;;
1137 --disable-mmxext) _mmxext=no ;;
1138 --enable-3dnow) _3dnow=yes ;;
1139 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1140 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1141 --disable-3dnowext) _3dnowext=no ;;
1142 --enable-cmov) _cmov=yes ;;
1143 --disable-cmov) _cmov=no ;;
1144 --enable-fast-cmov) _fast_cmov=yes ;;
1145 --disable-fast-cmov) _fast_cmov=no ;;
1146 --enable-fast-clz) _fast_clz=yes ;;
1147 --disable-fast-clz) _fast_clz=no ;;
1148 --enable-altivec) _altivec=yes ;;
1149 --disable-altivec) _altivec=no ;;
1150 --enable-armv5te) _armv5te=yes ;;
1151 --disable-armv5te) _armv5te=no ;;
1152 --enable-armv6) _armv6=yes ;;
1153 --disable-armv6) _armv6=no ;;
1154 --enable-armv6t2) _armv6t2=yes ;;
1155 --disable-armv6t2) _armv6t2=no ;;
1156 --enable-armvfp) _armvfp=yes ;;
1157 --disable-armvfp) _armvfp=no ;;
1158 --enable-neon) neon=yes ;;
1159 --disable-neon) neon=no ;;
1160 --enable-iwmmxt) _iwmmxt=yes ;;
1161 --disable-iwmmxt) _iwmmxt=no ;;
1162 --enable-mmx) _mmx=yes ;;
1163 --disable-mmx) # 3Dnow! and MMX2 require MMX
1164 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1167 echo "Unknown parameter: $ac_option" >&2
1168 exit 1
1171 esac
1172 done
1174 # Atmos: moved this here, to be correct, if --prefix is specified
1175 test -z "$_bindir" && _bindir="$_prefix/bin"
1176 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1177 test -z "$_mandir" && _mandir="$_prefix/share/man"
1178 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1179 test -z "$_libdir" && _libdir="$_prefix/lib"
1180 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1182 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1183 test "$tmpdir" && break
1184 done
1186 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1187 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1189 TMPLOG="config.log"
1191 rm -f "$TMPLOG"
1192 echo Parameters configure was run with: > "$TMPLOG"
1193 if test -n "$CFLAGS" ; then
1194 echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
1196 if test -n "$PKG_CONFIG_PATH" ; then
1197 echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
1199 echo ./configure $configuration >> "$TMPLOG"
1200 echo >> "$TMPLOG"
1203 echocheck "cross compilation"
1204 echores $_cross_compile
1206 if test $_cross_compile = yes; then
1207 tmp_run() {
1208 return 0
1212 tool_prefix=""
1214 if test $_cross_compile = yes ; then
1215 # Usually cross-compiler prefixes match with the target triplet
1216 test -n "$_target" && tool_prefix="$_target"-
1219 test "$_ranlib" = auto && _ranlib="$tool_prefix"ranlib
1220 test "$_windres" = auto && _windres="$tool_prefix"windres
1221 test "$_ar" = auto && _ar="$tool_prefix"ar
1222 test "$_yasm" = auto && _yasm="$tool_prefix"yasm
1223 test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
1225 if test "$_cc" = auto ; then
1226 if test -n "$tool_prefix" ; then
1227 _cc="$tool_prefix"gcc
1228 else
1229 _cc=cc
1233 # Determine our OS name and CPU architecture
1234 if test -z "$_target" ; then
1235 # OS name
1236 system_name=$(uname -s 2>&1)
1237 case "$system_name" in
1238 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1240 Haiku)
1241 system_name=BeOS
1243 GNU/kFreeBSD)
1244 system_name=FreeBSD
1246 HP-UX*)
1247 system_name=HP-UX
1249 [cC][yY][gG][wW][iI][nN]*)
1250 system_name=CYGWIN
1252 MINGW32*)
1253 system_name=MINGW32
1255 OS/2*)
1256 system_name=OS/2
1259 system_name="$system_name-UNKNOWN"
1261 esac
1264 # host's CPU/instruction set
1265 host_arch=$(uname -p 2>&1)
1266 case "$host_arch" in
1267 i386|sparc|ppc|alpha|arm|mips|vax)
1269 powerpc) # Darwin returns 'powerpc'
1270 host_arch=ppc
1272 *) # uname -p on Linux returns 'unknown' for the processor type,
1273 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1275 # Maybe uname -m (machine hardware name) returns something we
1276 # recognize.
1278 # x86/x86pc is used by QNX
1279 case "$(uname -m 2>&1)" in
1280 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 ;;
1281 ia64) host_arch=ia64 ;;
1282 macppc|ppc) host_arch=ppc ;;
1283 ppc64) host_arch=ppc64 ;;
1284 alpha) host_arch=alpha ;;
1285 sparc) host_arch=sparc ;;
1286 sparc64) host_arch=sparc64 ;;
1287 parisc*|hppa*|9000*) host_arch=hppa ;;
1288 arm*|zaurus|cats) host_arch=arm ;;
1289 sh3|sh4|sh4a) host_arch=sh ;;
1290 s390) host_arch=s390 ;;
1291 s390x) host_arch=s390x ;;
1292 *mips*) host_arch=mips ;;
1293 vax) host_arch=vax ;;
1294 xtensa*) host_arch=xtensa ;;
1295 *) host_arch=UNKNOWN ;;
1296 esac
1298 esac
1299 else # if test -z "$_target"
1300 for i in 2 3; do
1301 system_name=$(echo $_target | cut -d '-' -f $i)
1302 case "$(echo $system_name | tr A-Z a-z)" in
1303 linux) system_name=Linux ;;
1304 freebsd) system_name=FreeBSD ;;
1305 gnu/kfreebsd) system_name=FreeBSD ;;
1306 netbsd) system_name=NetBSD ;;
1307 bsd/os) system_name=BSD/OS ;;
1308 openbsd) system_name=OpenBSD ;;
1309 dragonfly) system_name=DragonFly ;;
1310 sunos) system_name=SunOS ;;
1311 qnx) system_name=QNX ;;
1312 morphos) system_name=MorphOS ;;
1313 amigaos) system_name=AmigaOS ;;
1314 mingw32*) system_name=MINGW32 ;;
1315 *) continue ;;
1316 esac
1317 break
1318 done
1319 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1320 host_arch=$(echo $_target | cut -d '-' -f 1)
1321 if test $(echo $host_arch) != "x86_64" ; then
1322 host_arch=$(echo $host_arch | tr '_' '-')
1326 extra_cflags="-I. $extra_cflags"
1327 _timer=timer-linux.c
1328 _getch=getch2.c
1329 if freebsd ; then
1330 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1331 extra_cflags="$extra_cflags -I/usr/local/include"
1334 if netbsd || dragonfly ; then
1335 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1336 extra_cflags="$extra_cflags -I/usr/pkg/include"
1339 if darwin; then
1340 extra_cflags="-mdynamic-no-pic $extra_cflags"
1341 _timer=timer-darwin.c
1344 if aix ; then
1345 extra_ldflags="$extra_ldflags -lC"
1348 if linux ; then
1349 _ranlib='true'
1352 if win32 ; then
1353 _exesuf=".exe"
1354 extra_cflags="$extra_cflags -fno-common"
1355 # -lwinmm is always needed for osdep/timer-win2.c
1356 extra_ldflags="$extra_ldflags -lwinmm"
1357 _pe_executable=yes
1358 _timer=timer-win2.c
1359 _priority=yes
1360 def_dos_paths="#define HAVE_DOS_PATHS 1"
1361 def_priority="#define CONFIG_PRIORITY 1"
1364 if mingw32 ; then
1365 _getch=getch2-win.c
1366 need_shmem=no
1367 extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
1370 if amigaos ; then
1371 _select=no
1372 _sighandler=no
1373 _stream_cache=no
1374 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1375 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1378 if qnx ; then
1379 extra_ldflags="$extra_ldflags -lph"
1382 TMPC="$mplayer_tmpdir/tmp.c"
1383 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1384 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1385 TMPH="$mplayer_tmpdir/tmp.h"
1386 TMPS="$mplayer_tmpdir/tmp.S"
1388 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1389 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1393 # Checking CC version...
1394 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1395 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1396 echocheck "$_cc version"
1397 cc_vendor=intel
1398 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1399 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1400 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1401 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1402 # TODO verify older icc/ecc compatibility
1403 case $cc_version in
1405 cc_version="v. ?.??, bad"
1406 cc_fail=yes
1408 10.1|11.0|11.1)
1409 cc_version="$cc_version, ok"
1412 cc_version="$cc_version, bad"
1413 cc_fail=yes
1415 esac
1416 echores "$cc_version"
1417 else
1418 for _cc in "$_cc" gcc cc ; do
1419 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1420 if test "$cc_name_tmp" = "gcc"; then
1421 cc_name=$cc_name_tmp
1422 echocheck "$_cc version"
1423 cc_vendor=gnu
1424 cc_version=$($_cc -dumpversion 2>&1)
1425 case $cc_version in
1426 2.96*)
1427 cc_fail=yes
1430 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1431 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1432 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1434 esac
1435 echores "$cc_version"
1436 break
1438 if $_cc -v 2>&1 | grep -q "clang"; then
1439 echocheck "$_cc version"
1440 cc_vendor=clang
1441 cc_version=$($_cc -dumpversion 2>&1)
1442 res_comment="experimental support only"
1443 echores "clang $cc_version"
1444 break
1446 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1447 if test "$cc_name_tmp" = "Sun C"; then
1448 echocheck "$_cc version"
1449 cc_vendor=sun
1450 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1451 res_comment="experimental support only"
1452 echores "Sun C $cc_version"
1453 break
1455 done
1456 fi # icc
1457 test "$cc_fail" = yes && die "unsupported compiler version"
1459 echocheck "working compiler"
1460 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
1461 echo "yes"
1463 if test -z "$_target" && x86 ; then
1464 cat > $TMPC << EOF
1465 int main(void) {
1466 int test[(int)sizeof(char *)-7];
1467 return 0;
1470 cc_check && host_arch=x86_64 || host_arch=i386
1473 echo "Detected operating system: $system_name"
1474 echo "Detected host architecture: $host_arch"
1476 # ---
1478 # now that we know what compiler should be used for compilation, try to find
1479 # out which assembler is used by the $_cc compiler
1480 if test "$_as" = auto ; then
1481 _as=$($_cc -print-prog-name=as)
1482 test -z "$_as" && _as=as
1485 if test "$_nm" = auto ; then
1486 _nm=$($_cc -print-prog-name=nm)
1487 test -z "$_nm" && _nm=nm
1490 # XXX: this should be ok..
1491 _cpuinfo="echo"
1493 if test "$_runtime_cpudetection" = no ; then
1495 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1496 # FIXME: Remove the cygwin check once AMD CPUs are supported
1497 if test -r /proc/cpuinfo && ! cygwin; then
1498 # Linux with /proc mounted, extract CPU information from it
1499 _cpuinfo="cat /proc/cpuinfo"
1500 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1501 # FreeBSD with Linux emulation /proc mounted,
1502 # extract CPU information from it
1503 # Don't use it on x86 though, it never reports 3Dnow
1504 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1505 elif darwin && ! x86 ; then
1506 # use hostinfo on Darwin
1507 _cpuinfo="hostinfo"
1508 elif aix; then
1509 # use 'lsattr' on AIX
1510 _cpuinfo="lsattr -E -l proc0 -a type"
1511 elif x86; then
1512 # all other OSes try to extract CPU information from a small helper
1513 # program cpuinfo instead
1514 $_cc -o cpuinfo$_exesuf cpuinfo.c
1515 _cpuinfo="./cpuinfo$_exesuf"
1518 if x86 ; then
1519 # gather more CPU information
1520 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1521 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1522 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1523 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1524 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1526 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1528 pparam=$(echo $exts | sed -e s/xmm/sse/ -e s/kni/sse/)
1529 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1530 pparam=$(echo $pparam | sed -e 's/sse/sse mmxext/')
1532 for ext in $pparam ; do
1533 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1534 done
1536 echocheck "CPU vendor"
1537 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1539 echocheck "CPU type"
1540 echores "$pname"
1543 fi # test "$_runtime_cpudetection" = no
1545 if x86 && test "$_runtime_cpudetection" = no ; then
1546 extcheck() {
1547 if test "$1" = kernel_check ; then
1548 echocheck "kernel support of $2"
1549 cat > $TMPC <<EOF
1550 #include <stdlib.h>
1551 #include <signal.h>
1552 static void catch(int sig) { exit(1); }
1553 int main(void) {
1554 signal(SIGILL, catch);
1555 __asm__ volatile ("$3":::"memory"); return 0;
1559 if cc_check && tmp_run ; then
1560 eval _$2=yes
1561 echores "yes"
1562 _optimizing="$_optimizing $2"
1563 return 0
1564 else
1565 eval _$2=no
1566 echores "failed"
1567 echo "It seems that your kernel does not correctly support $2."
1568 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1569 return 1
1572 return 0
1575 extcheck $_mmx "mmx" "emms"
1576 extcheck $_mmxext "mmxext" "sfence"
1577 extcheck $_3dnow "3dnow" "femms"
1578 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1579 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1580 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1581 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1582 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1584 if test "$_gcc3_ext" != ""; then
1585 # if we had to disable sse/sse2 because the active kernel does not
1586 # support this instruction set extension, we also have to tell
1587 # gcc3 to not generate sse/sse2 instructions for normal C code
1588 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1594 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1595 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1596 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1597 subarch_all='X86_32 X86_64 PPC64'
1598 case "$host_arch" in
1599 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1600 arch='x86'
1601 subarch='x86_32'
1602 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1603 iproc=486
1604 proc=i486
1607 if test "$_runtime_cpudetection" = no ; then
1608 case "$pvendor" in
1609 AuthenticAMD)
1610 case "$pfamily" in
1611 3) proc=i386 iproc=386 ;;
1612 4) proc=i486 iproc=486 ;;
1613 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1614 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1615 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1616 proc=k6-3
1617 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1618 proc=geode
1619 elif test "$pmodel" -ge 8; then
1620 proc=k6-2
1621 elif test "$pmodel" -ge 6; then
1622 proc=k6
1623 else
1624 proc=i586
1627 6) iproc=686
1628 # It's a bit difficult to determine the correct type of Family 6
1629 # AMD CPUs just from their signature. Instead, we check directly
1630 # whether it supports SSE.
1631 if test "$_sse" = yes; then
1632 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1633 proc=athlon-xp
1634 else
1635 # Again, gcc treats athlon and athlon-tbird similarly.
1636 proc=athlon
1639 15) iproc=686
1640 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1641 # caught and remedied in the optimization tests below.
1642 proc=k8
1645 *) proc=amdfam10 iproc=686
1646 test $_fast_clz = "auto" && _fast_clz=yes
1648 esac
1650 GenuineIntel)
1651 case "$pfamily" in
1652 3) proc=i386 iproc=386 ;;
1653 4) proc=i486 iproc=486 ;;
1654 5) iproc=586
1655 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1656 proc=pentium-mmx # 4 is desktop, 8 is mobile
1657 else
1658 proc=i586
1661 6) iproc=686
1662 if test "$pmodel" -ge 15; then
1663 proc=core2
1664 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1665 proc=pentium-m
1666 elif test "$pmodel" -ge 7; then
1667 proc=pentium3
1668 elif test "$pmodel" -ge 3; then
1669 proc=pentium2
1670 else
1671 proc=i686
1673 test $_fast_clz = "auto" && _fast_clz=yes
1675 15) iproc=686
1676 # A nocona in 32-bit mode has no more capabilities than a prescott.
1677 if test "$pmodel" -ge 3; then
1678 proc=prescott
1679 else
1680 proc=pentium4
1681 test $_fast_clz = "auto" && _fast_clz=yes
1683 test $_fast_cmov = "auto" && _fast_cmov=no
1685 *) proc=prescott iproc=686 ;;
1686 esac
1688 CentaurHauls)
1689 case "$pfamily" in
1690 5) iproc=586
1691 if test "$pmodel" -ge 8; then
1692 proc=winchip2
1693 elif test "$pmodel" -ge 4; then
1694 proc=winchip-c6
1695 else
1696 proc=i586
1699 6) iproc=686
1700 if test "$pmodel" -ge 9; then
1701 proc=c3-2
1702 else
1703 proc=c3
1704 iproc=586
1707 *) proc=i686 iproc=i686 ;;
1708 esac
1710 unknown)
1711 case "$pfamily" in
1712 3) proc=i386 iproc=386 ;;
1713 4) proc=i486 iproc=486 ;;
1714 *) proc=i586 iproc=586 ;;
1715 esac
1718 proc=i586 iproc=586 ;;
1719 esac
1720 test $_fast_clz = "auto" && _fast_clz=no
1721 fi # test "$_runtime_cpudetection" = no
1724 # check that gcc supports our CPU, if not, fall back to earlier ones
1725 # LGB: check -mcpu and -march swithing step by step with enabling
1726 # to fall back till 386.
1728 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1730 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1731 cpuopt=-mtune
1732 else
1733 cpuopt=-mcpu
1736 echocheck "GCC & CPU optimization abilities"
1737 if test "$_runtime_cpudetection" = no ; then
1738 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1739 cflag_check -march=native && proc=native
1741 if test "$proc" = "amdfam10"; then
1742 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1744 if test "$proc" = "k8"; then
1745 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1747 if test "$proc" = "athlon-xp"; then
1748 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1750 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1751 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1753 if test "$proc" = "k6" || test "$proc" = "c3"; then
1754 if ! cflag_check -march=$proc $cpuopt=$proc; then
1755 if cflag_check -march=i586 $cpuopt=i686; then
1756 proc=i586-i686
1757 else
1758 proc=i586
1762 if test "$proc" = "prescott" ; then
1763 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1765 if test "$proc" = "core2" ; then
1766 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1768 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
1769 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1771 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1772 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1774 if test "$proc" = "i586"; then
1775 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1777 if test "$proc" = "i486" ; then
1778 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1780 if test "$proc" = "i386" ; then
1781 cflag_check -march=$proc $cpuopt=$proc || proc=error
1783 if test "$proc" = "error" ; then
1784 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1785 _mcpu=""
1786 _march=""
1787 _optimizing=""
1788 elif test "$proc" = "i586-i686"; then
1789 _march="-march=i586"
1790 _mcpu="$cpuopt=i686"
1791 _optimizing="$proc"
1792 else
1793 _march="-march=$proc"
1794 _mcpu="$cpuopt=$proc"
1795 _optimizing="$proc"
1797 else # if test "$_runtime_cpudetection" = no
1798 _mcpu="$cpuopt=generic"
1799 # at least i486 required, for bswap instruction
1800 _march="-march=i486"
1801 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1802 cflag_check $_mcpu || _mcpu=""
1803 cflag_check $_march $_mcpu || _march=""
1806 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1807 ## autodetected mcpu/march parameters
1808 if test "$_target" ; then
1809 # TODO: it may be a good idea to check GCC and fall back in all cases
1810 if test "$host_arch" = "i586-i686"; then
1811 _march="-march=i586"
1812 _mcpu="$cpuopt=i686"
1813 else
1814 _march="-march=$host_arch"
1815 _mcpu="$cpuopt=$host_arch"
1818 proc="$host_arch"
1820 case "$proc" in
1821 i386) iproc=386 ;;
1822 i486) iproc=486 ;;
1823 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1824 i686|athlon*|pentium*) iproc=686 ;;
1825 *) iproc=586 ;;
1826 esac
1829 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1830 _fast_cmov="yes"
1831 else
1832 _fast_cmov="no"
1834 test $_fast_clz = "auto" && _fast_clz=yes
1836 echores "$proc"
1839 ia64)
1840 arch='ia64'
1841 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1842 iproc='ia64'
1845 x86_64|amd64)
1846 arch='x86'
1847 subarch='x86_64'
1848 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1849 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1850 iproc='x86_64'
1852 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1853 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1854 cpuopt=-mtune
1855 else
1856 cpuopt=-mcpu
1858 if test "$_runtime_cpudetection" = no ; then
1859 case "$pvendor" in
1860 AuthenticAMD)
1861 case "$pfamily" in
1862 15) proc=k8
1863 test $_fast_clz = "auto" && _fast_clz=no
1865 *) proc=amdfam10;;
1866 esac
1868 GenuineIntel)
1869 case "$pfamily" in
1870 6) proc=core2;;
1872 # 64-bit prescotts exist, but as far as GCC is concerned they
1873 # have the same capabilities as a nocona.
1874 proc=nocona
1875 test $_fast_cmov = "auto" && _fast_cmov=no
1876 test $_fast_clz = "auto" && _fast_clz=no
1878 esac
1881 proc=error;;
1882 esac
1883 fi # test "$_runtime_cpudetection" = no
1885 echocheck "GCC & CPU optimization abilities"
1886 # This is a stripped-down version of the i386 fallback.
1887 if test "$_runtime_cpudetection" = no ; then
1888 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1889 cflag_check -march=native && proc=native
1891 # --- AMD processors ---
1892 if test "$proc" = "amdfam10"; then
1893 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1895 if test "$proc" = "k8"; then
1896 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1898 # This will fail if gcc version < 3.3, which is ok because earlier
1899 # versions don't really support 64-bit on amd64.
1900 # Is this a valid assumption? -Corey
1901 if test "$proc" = "athlon-xp"; then
1902 cflag_check -march=$proc $cpuopt=$proc || proc=error
1904 # --- Intel processors ---
1905 if test "$proc" = "core2"; then
1906 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1908 if test "$proc" = "x86-64"; then
1909 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1911 if test "$proc" = "nocona"; then
1912 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1914 if test "$proc" = "pentium4"; then
1915 cflag_check -march=$proc $cpuopt=$proc || proc=error
1918 _march="-march=$proc"
1919 _mcpu="$cpuopt=$proc"
1920 if test "$proc" = "error" ; then
1921 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1922 _mcpu=""
1923 _march=""
1925 else # if test "$_runtime_cpudetection" = no
1926 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1927 _march="-march=x86-64"
1928 _mcpu="$cpuopt=generic"
1929 cflag_check $_mcpu || _mcpu="x86-64"
1930 cflag_check $_mcpu || _mcpu=""
1931 cflag_check $_march $_mcpu || _march=""
1934 _optimizing="$proc"
1935 test $_fast_cmov = "auto" && _fast_cmov=yes
1936 test $_fast_clz = "auto" && _fast_clz=yes
1938 echores "$proc"
1941 sparc|sparc64)
1942 arch='sparc'
1943 iproc='sparc'
1944 if test "$host_arch" = "sparc64" ; then
1945 _vis='yes'
1946 proc='ultrasparc'
1947 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1948 elif sunos ; then
1949 echocheck "CPU type"
1950 karch=$(uname -m)
1951 case "$(echo $karch)" in
1952 sun4) proc=v7 ;;
1953 sun4c) proc=v7 ;;
1954 sun4d) proc=v8 ;;
1955 sun4m) proc=v8 ;;
1956 sun4u) proc=ultrasparc _vis='yes' ;;
1957 sun4v) proc=v9 ;;
1958 *) proc=v8 ;;
1959 esac
1960 echores "$proc"
1961 else
1962 proc=v8
1964 _mcpu="-mcpu=$proc"
1965 _optimizing="$proc"
1968 arm*)
1969 arch='arm'
1970 iproc='arm'
1973 avr32)
1974 arch='avr32'
1975 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1976 iproc='avr32'
1977 test $_fast_clz = "auto" && _fast_clz=yes
1980 sh|sh4)
1981 arch='sh4'
1982 iproc='sh4'
1985 ppc|ppc64|powerpc|powerpc64)
1986 arch='ppc'
1987 def_dcbzl='#define HAVE_DCBZL 0'
1988 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1989 iproc='ppc'
1991 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
1992 subarch='ppc64'
1993 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1995 echocheck "CPU type"
1996 case $system_name in
1997 Linux)
1998 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
1999 if test -n "$($_cpuinfo | grep altivec)"; then
2000 test $_altivec = auto && _altivec=yes
2003 Darwin)
2004 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2005 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2006 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2007 test $_altivec = auto && _altivec=yes
2010 NetBSD)
2011 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2012 case $cc_version in
2013 2*|3.0*|3.1*|3.2*|3.3*)
2016 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2017 test $_altivec = auto && _altivec=yes
2020 esac
2022 AIX)
2023 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2025 esac
2026 if test "$_altivec" = yes; then
2027 echores "$proc altivec"
2028 else
2029 _altivec=no
2030 echores "$proc"
2033 echocheck "GCC & CPU optimization abilities"
2035 if test -n "$proc"; then
2036 case "$proc" in
2037 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2038 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2039 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2040 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2041 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2042 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2043 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2044 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2045 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2046 *) ;;
2047 esac
2048 # gcc 3.1(.1) and up supports 7400 and 7450
2049 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2050 case "$proc" in
2051 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2052 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2053 *) ;;
2054 esac
2056 # gcc 3.2 and up supports 970
2057 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2058 case "$proc" in
2059 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2060 def_dcbzl='#define HAVE_DCBZL 1' ;;
2061 *) ;;
2062 esac
2064 # gcc 3.3 and up supports POWER4
2065 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2066 case "$proc" in
2067 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2068 *) ;;
2069 esac
2071 # gcc 3.4 and up supports 440*
2072 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2073 case "$proc" in
2074 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2075 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2076 *) ;;
2077 esac
2079 # gcc 4.0 and up supports POWER5
2080 if test "$_cc_major" -ge "4"; then
2081 case "$proc" in
2082 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2083 *) ;;
2084 esac
2088 if test -n "$_mcpu"; then
2089 _optimizing=$(echo $_mcpu | cut -c 8-)
2090 echores "$_optimizing"
2091 else
2092 echores "none"
2095 test $_fast_clz = "auto" && _fast_clz=yes
2099 alpha*)
2100 arch='alpha'
2101 iproc='alpha'
2102 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2104 echocheck "CPU type"
2105 cat > $TMPC << EOF
2106 int main(void) {
2107 unsigned long ver, mask;
2108 __asm__ ("implver %0" : "=r" (ver));
2109 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2110 printf("%ld-%x\n", ver, ~mask);
2111 return 0;
2114 $_cc -o "$TMPEXE" "$TMPC"
2115 case $("$TMPEXE") in
2117 0-0) proc="ev4"; _mvi="0";;
2118 1-0) proc="ev5"; _mvi="0";;
2119 1-1) proc="ev56"; _mvi="0";;
2120 1-101) proc="pca56"; _mvi="1";;
2121 2-303) proc="ev6"; _mvi="1";;
2122 2-307) proc="ev67"; _mvi="1";;
2123 2-1307) proc="ev68"; _mvi="1";;
2124 esac
2125 echores "$proc"
2127 echocheck "GCC & CPU optimization abilities"
2128 if test "$proc" = "ev68" ; then
2129 cc_check -mcpu=$proc || proc=ev67
2131 if test "$proc" = "ev67" ; then
2132 cc_check -mcpu=$proc || proc=ev6
2134 _mcpu="-mcpu=$proc"
2135 echores "$proc"
2137 test $_fast_clz = "auto" && _fast_clz=yes
2139 _optimizing="$proc"
2142 mips*)
2143 arch='mips'
2144 iproc='mips'
2146 test $_fast_clz = "auto" && _fast_clz=yes
2150 hppa)
2151 arch='pa_risc'
2152 iproc='PA-RISC'
2155 s390)
2156 arch='s390'
2157 iproc='390'
2160 s390x)
2161 arch='s390x'
2162 iproc='390x'
2165 vax)
2166 arch='vax'
2167 iproc='vax'
2170 xtensa)
2171 arch='xtensa'
2172 iproc='xtensa'
2175 generic)
2176 arch='generic'
2180 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2181 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2182 die "unsupported architecture $host_arch"
2184 esac # case "$host_arch" in
2186 if test "$_runtime_cpudetection" = yes ; then
2187 if x86 ; then
2188 test "$_cmov" != no && _cmov=yes
2189 x86_32 && _cmov=no
2190 test "$_mmx" != no && _mmx=yes
2191 test "$_3dnow" != no && _3dnow=yes
2192 test "$_3dnowext" != no && _3dnowext=yes
2193 test "$_mmxext" != no && _mmxext=yes
2194 test "$_sse" != no && _sse=yes
2195 test "$_sse2" != no && _sse2=yes
2196 test "$_ssse3" != no && _ssse3=yes
2198 if ppc; then
2199 _altivec=yes
2204 # endian testing
2205 echocheck "byte order"
2206 if test "$_big_endian" = auto ; then
2207 cat > $TMPC <<EOF
2208 short ascii_name[] = {
2209 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2210 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2211 int main(void) { return (long)ascii_name; }
2213 if cc_check ; then
2214 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2215 _big_endian=yes
2216 else
2217 _big_endian=no
2219 else
2220 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2223 if test "$_big_endian" = yes ; then
2224 _byte_order='big-endian'
2225 def_words_endian='#define WORDS_BIGENDIAN 1'
2226 def_bigendian='#define HAVE_BIGENDIAN 1'
2227 else
2228 _byte_order='little-endian'
2229 def_words_endian='#undef WORDS_BIGENDIAN'
2230 def_bigendian='#define HAVE_BIGENDIAN 0'
2232 echores "$_byte_order"
2235 echocheck "extern symbol prefix"
2236 cat > $TMPC << EOF
2237 int ff_extern;
2239 cc_check -c || die "Symbol mangling check failed."
2240 sym=$($_nm -P -g $TMPEXE)
2241 extern_prefix=${sym%%ff_extern*}
2242 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2243 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2244 echores $extern_prefix
2247 echocheck "assembler support of -pipe option"
2248 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2249 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2252 if darwin && test "$cc_vendor" = "gnu" ; then
2253 echocheck "GCC support of -mstackrealign"
2254 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2255 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2256 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2257 # wrong code with this flag, but this can be worked around by adding
2258 # -fno-unit-at-a-time as described in the blog post at
2259 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2260 cat > $TMPC << EOF
2261 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2262 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2264 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2265 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2266 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2267 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2268 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2271 # Checking for CFLAGS
2272 _install_strip="-s"
2273 if test "$_profile" != "" || test "$_debug" != "" ; then
2274 _install_strip=
2276 if test -z "$CFLAGS" ; then
2277 if test "$cc_vendor" = "intel" ; then
2278 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2279 WARNFLAGS="-wd167 -wd556 -wd144"
2280 elif test "$cc_vendor" = "sun" ; then
2281 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2282 elif test "$cc_vendor" = "clang"; then
2283 CFLAGS="-O2 $_debug $_profile $_march $_pipe"
2284 WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
2285 ERRORFLAGS="-Werror=implicit-function-declaration"
2286 elif test "$cc_vendor" != "gnu" ; then
2287 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe"
2288 else
2289 CFLAGS="-O2 $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2290 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2291 ERRORFLAGS="-Werror-implicit-function-declaration"
2292 extra_ldflags="$extra_ldflags -ffast-math"
2294 else
2295 warn_cflags=yes
2298 if darwin && test "$cc_vendor" = "gnu" ; then
2299 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
2302 if test "$cc_vendor" = "gnu" ; then
2303 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2304 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2305 # that's the only variable specific to C now, and this option is not valid
2306 # for C++.
2307 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2308 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2309 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2310 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2311 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2312 else
2313 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2316 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2317 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2320 if test -n "$LDFLAGS" ; then
2321 extra_ldflags="$extra_ldflags $LDFLAGS"
2322 warn_cflags=yes
2323 elif test "$cc_vendor" = "intel" ; then
2324 extra_ldflags="$extra_ldflags -i-static"
2326 if test -n "$CPPFLAGS" ; then
2327 extra_cflags="$extra_cflags $CPPFLAGS"
2328 warn_cflags=yes
2333 if x86_32 ; then
2334 # Checking assembler (_as) compatibility...
2335 # Added workaround for older as that reads from stdin by default - atmos
2336 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2337 echocheck "assembler ($_as $as_version)"
2339 _pref_as_version='2.9.1'
2340 echo 'nop' > $TMPS
2341 if test "$_mmx" = yes ; then
2342 echo 'emms' >> $TMPS
2344 if test "$_3dnow" = yes ; then
2345 _pref_as_version='2.10.1'
2346 echo 'femms' >> $TMPS
2348 if test "$_3dnowext" = yes ; then
2349 _pref_as_version='2.10.1'
2350 echo 'pswapd %mm0, %mm0' >> $TMPS
2352 if test "$_mmxext" = yes ; then
2353 _pref_as_version='2.10.1'
2354 echo 'movntq %mm0, (%eax)' >> $TMPS
2356 if test "$_sse" = yes ; then
2357 _pref_as_version='2.10.1'
2358 echo 'xorps %xmm0, %xmm0' >> $TMPS
2360 #if test "$_sse2" = yes ; then
2361 # _pref_as_version='2.11'
2362 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2364 if test "$_cmov" = yes ; then
2365 _pref_as_version='2.10.1'
2366 echo 'cmovb %eax, %ebx' >> $TMPS
2368 if test "$_ssse3" = yes ; then
2369 _pref_as_version='2.16.92'
2370 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2372 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2374 if test "$as_verc_fail" != yes ; then
2375 echores "ok"
2376 else
2377 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2378 echores "failed"
2379 die "obsolete binutils version"
2382 fi #if x86_32
2385 echocheck "PIC"
2386 pic=no
2387 cat > $TMPC << EOF
2388 int main(void) {
2389 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2390 #error PIC not enabled
2391 #endif
2392 return 0;
2395 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2396 echores $pic
2399 if x86 ; then
2401 echocheck ".align is a power of two"
2402 if test "$_asmalign_pot" = auto ; then
2403 _asmalign_pot=no
2404 inline_asm_check '".align 3"' && _asmalign_pot=yes
2406 if test "$_asmalign_pot" = "yes" ; then
2407 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2408 else
2409 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2411 echores $_asmalign_pot
2414 echocheck "ebx availability"
2415 ebx_available=no
2416 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2417 cat > $TMPC << EOF
2418 int main(void) {
2419 int x;
2420 __asm__ volatile(
2421 "xor %0, %0"
2422 :"=b"(x)
2423 // just adding ebx to clobber list seems unreliable with some
2424 // compilers, e.g. Haiku's gcc 2.95
2426 // and the above check does not work for OSX 64 bit...
2427 __asm__ volatile("":::"%ebx");
2428 return 0;
2431 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2432 echores $ebx_available
2435 echocheck "yasm"
2436 if test -z "$YASMFLAGS" ; then
2437 if darwin ; then
2438 x86_64 && objformat="macho64" || objformat="macho"
2439 elif win32 ; then
2440 objformat="win32"
2441 else
2442 objformat="elf"
2444 # currently tested for Linux x86, x86_64
2445 YASMFLAGS="-f $objformat"
2446 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2447 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2448 case "$objformat" in
2449 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2450 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2451 esac
2452 else
2453 warn_cflags=yes
2456 echo "pabsw xmm0, xmm0" > $TMPS
2457 yasm_check || _yasm=""
2458 if test $_yasm ; then
2459 def_yasm='#define HAVE_YASM 1'
2460 have_yasm="yes"
2461 echores "$_yasm"
2462 else
2463 def_yasm='#define HAVE_YASM 0'
2464 have_yasm="no"
2465 echores "no"
2468 echocheck "bswap"
2469 def_bswap='#define HAVE_BSWAP 0'
2470 echo 'bswap %eax' > $TMPS
2471 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2472 echores "$bswap"
2473 fi #if x86
2476 #FIXME: This should happen before the check for CFLAGS..
2477 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2478 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2480 # check if AltiVec is supported by the compiler, and how to enable it
2481 echocheck "GCC AltiVec flags"
2482 if $(cflag_check -maltivec -mabi=altivec) ; then
2483 _altivec_gcc_flags="-maltivec -mabi=altivec"
2484 # check if <altivec.h> should be included
2485 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2486 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2487 inc_altivec_h='#include <altivec.h>'
2488 else
2489 if $(cflag_check -faltivec) ; then
2490 _altivec_gcc_flags="-faltivec"
2491 else
2492 _altivec=no
2493 _altivec_gcc_flags="none, AltiVec disabled"
2497 echores "$_altivec_gcc_flags"
2499 # check if the compiler supports braces for vector declarations
2500 cat > $TMPC << EOF
2501 $inc_altivec_h
2502 int main(void) { (vector int) {1}; return 0; }
2504 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2506 # Disable runtime cpudetection if we cannot generate AltiVec code or
2507 # AltiVec is disabled by the user.
2508 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2509 && _runtime_cpudetection=no
2511 # Show that we are optimizing for AltiVec (if enabled and supported).
2512 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2513 && _optimizing="$_optimizing altivec"
2515 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2516 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2519 if ppc ; then
2520 def_xform_asm='#define HAVE_XFORM_ASM 0'
2521 xform_asm=no
2522 echocheck "XFORM ASM support"
2523 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2524 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2525 echores "$xform_asm"
2528 if arm ; then
2529 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2530 if test $_armv5te = "auto" ; then
2531 _armv5te=no
2532 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2534 echores "$_armv5te"
2536 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2538 echocheck "ARMv6 (SIMD instructions)"
2539 if test $_armv6 = "auto" ; then
2540 _armv6=no
2541 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2543 echores "$_armv6"
2545 echocheck "ARMv6t2 (SIMD instructions)"
2546 if test $_armv6t2 = "auto" ; then
2547 _armv6t2=no
2548 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2550 echores "$_armv6t2"
2552 echocheck "ARM VFP"
2553 if test $_armvfp = "auto" ; then
2554 _armvfp=no
2555 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2557 echores "$_armvfp"
2559 echocheck "ARM NEON"
2560 if test $neon = "auto" ; then
2561 neon=no
2562 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2564 echores "$neon"
2566 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2567 if test $_iwmmxt = "auto" ; then
2568 _iwmmxt=no
2569 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2571 echores "$_iwmmxt"
2574 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2575 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2576 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2577 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2578 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2579 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2580 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2581 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2582 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2583 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2584 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2585 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2586 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2587 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2588 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2589 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2590 test "$neon" = yes && cpuexts="NEON $cpuexts"
2591 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2592 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2593 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2595 # Checking kernel version...
2596 if x86_32 && linux ; then
2597 _k_verc_problem=no
2598 kernel_version=$(uname -r 2>&1)
2599 echocheck "$system_name kernel version"
2600 case "$kernel_version" in
2601 '') kernel_version="?.??"; _k_verc_fail=yes;;
2602 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2603 _k_verc_problem=yes;;
2604 esac
2605 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2606 _k_verc_fail=yes
2608 if test "$_k_verc_fail" ; then
2609 echores "$kernel_version, fail"
2610 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2611 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2612 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2613 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2614 echo "2.2.x you must upgrade it to get SSE support!"
2615 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2616 else
2617 echores "$kernel_version, ok"
2621 ######################
2622 # MAIN TESTS GO HERE #
2623 ######################
2626 echocheck "-lposix"
2627 if cflag_check -lposix ; then
2628 extra_ldflags="$extra_ldflags -lposix"
2629 echores "yes"
2630 else
2631 echores "no"
2634 echocheck "-lm"
2635 if cflag_check -lm ; then
2636 _ld_lm="-lm"
2637 echores "yes"
2638 else
2639 _ld_lm=""
2640 echores "no"
2644 echocheck "langinfo"
2645 if test "$_langinfo" = auto ; then
2646 _langinfo=no
2647 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2649 if test "$_langinfo" = yes ; then
2650 def_langinfo='#define HAVE_LANGINFO 1'
2651 else
2652 def_langinfo='#undef HAVE_LANGINFO'
2654 echores "$_langinfo"
2657 echocheck "translation support"
2658 if test "$_translation" = yes; then
2659 def_translation="#define CONFIG_TRANSLATION 1"
2660 else
2661 def_translation="#undef CONFIG_TRANSLATION"
2663 echores "$_translation"
2665 echocheck "language"
2666 # Set preferred languages, "all" uses English as main language.
2667 test -z "$language" && language=$LINGUAS
2668 test -z "$language_doc" && language_doc=$language
2669 test -z "$language_man" && language_man=$language
2670 test -z "$language_msg" && language_msg=$language
2671 test -z "$language_msg" && language_msg="all"
2672 language_doc=$(echo $language_doc | tr , " ")
2673 language_man=$(echo $language_man | tr , " ")
2674 language_msg=$(echo $language_msg | tr , " ")
2676 test "$language_doc" = "all" && language_doc=$doc_lang_all
2677 test "$language_man" = "all" && language_man=$man_lang_all
2678 test "$language_msg" = "all" && language_msg=$msg_lang_all
2680 if test "$_translation" != yes ; then
2681 language_msg=""
2684 # Prune non-existing translations from language lists.
2685 # Set message translation to the first available language.
2686 # Fall back on English.
2687 for lang in $language_doc ; do
2688 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2689 done
2690 language_doc=$tmp_language_doc
2691 test -z "$language_doc" && language_doc=en
2693 for lang in $language_man ; do
2694 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2695 done
2696 language_man=$tmp_language_man
2697 test -z "$language_man" && language_man=en
2699 for lang in $language_msg ; do
2700 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2701 done
2702 language_msg=$tmp_language_msg
2704 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2707 echocheck "enable sighandler"
2708 if test "$_sighandler" = yes ; then
2709 def_sighandler='#define CONFIG_SIGHANDLER 1'
2710 else
2711 def_sighandler='#undef CONFIG_SIGHANDLER'
2713 echores "$_sighandler"
2715 echocheck "runtime cpudetection"
2716 if test "$_runtime_cpudetection" = yes ; then
2717 _optimizing="Runtime CPU-Detection enabled"
2718 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2719 else
2720 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2722 echores "$_runtime_cpudetection"
2725 echocheck "restrict keyword"
2726 for restrict_keyword in restrict __restrict __restrict__ ; do
2727 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2728 if cc_check; then
2729 def_restrict_keyword=$restrict_keyword
2730 break;
2732 done
2733 if [ -n "$def_restrict_keyword" ]; then
2734 echores "$def_restrict_keyword"
2735 else
2736 echores "none"
2738 # Avoid infinite recursion loop ("#define restrict restrict")
2739 if [ "$def_restrict_keyword" != "restrict" ]; then
2740 def_restrict_keyword="#define restrict $def_restrict_keyword"
2741 else
2742 def_restrict_keyword=""
2746 echocheck "__builtin_expect"
2747 # GCC branch prediction hint
2748 cat > $TMPC << EOF
2749 static int foo(int a) {
2750 a = __builtin_expect(a, 10);
2751 return a == 10 ? 0 : 1;
2753 int main(void) { return foo(10) && foo(0); }
2755 _builtin_expect=no
2756 cc_check && _builtin_expect=yes
2757 if test "$_builtin_expect" = yes ; then
2758 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2759 else
2760 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2762 echores "$_builtin_expect"
2765 echocheck "kstat"
2766 _kstat=no
2767 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2768 if test "$_kstat" = yes ; then
2769 def_kstat="#define HAVE_LIBKSTAT 1"
2770 extra_ldflags="$extra_ldflags -lkstat"
2771 else
2772 def_kstat="#undef HAVE_LIBKSTAT"
2774 echores "$_kstat"
2777 echocheck "posix4"
2778 # required for nanosleep on some systems
2779 _posix4=no
2780 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2781 if test "$_posix4" = yes ; then
2782 extra_ldflags="$extra_ldflags -lposix4"
2784 echores "$_posix4"
2786 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2787 echocheck $func
2788 eval _$func=no
2789 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2790 if eval test "x\$_$func" = "xyes"; then
2791 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2792 echores yes
2793 else
2794 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2795 echores no
2797 done
2800 echocheck "mkstemp"
2801 _mkstemp=no
2802 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2803 if test "$_mkstemp" = yes ; then
2804 def_mkstemp='#define HAVE_MKSTEMP 1'
2805 else
2806 def_mkstemp='#define HAVE_MKSTEMP 0'
2808 echores "$_mkstemp"
2811 echocheck "nanosleep"
2812 _nanosleep=no
2813 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2814 if test "$_nanosleep" = yes ; then
2815 def_nanosleep='#define HAVE_NANOSLEEP 1'
2816 else
2817 def_nanosleep='#undef HAVE_NANOSLEEP'
2819 echores "$_nanosleep"
2822 echocheck "socklib"
2823 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2824 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2825 cat > $TMPC << EOF
2826 #include <netdb.h>
2827 #include <sys/socket.h>
2828 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2830 _socklib=no
2831 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2832 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2833 done
2834 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2835 if test $_winsock2_h = auto ; then
2836 _winsock2_h=no
2837 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2839 test "$_ld_sock" && res_comment="using $_ld_sock"
2840 echores "$_socklib"
2843 if test $_winsock2_h = yes ; then
2844 _ld_sock="-lws2_32"
2845 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2846 else
2847 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2851 echocheck "arpa/inet.h"
2852 arpa_inet_h=no
2853 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2854 header_check arpa/inet.h && arpa_inet_h=yes &&
2855 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2856 echores "$arpa_inet_h"
2859 echocheck "inet_pton()"
2860 def_inet_pton='#define HAVE_INET_PTON 0'
2861 inet_pton=no
2862 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2863 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2864 done
2865 if test $inet_pton = yes ; then
2866 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2867 def_inet_pton='#define HAVE_INET_PTON 1'
2869 echores "$inet_pton"
2872 echocheck "inet_aton()"
2873 def_inet_aton='#define HAVE_INET_ATON 0'
2874 inet_aton=no
2875 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2876 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2877 done
2878 if test $inet_aton = yes ; then
2879 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2880 def_inet_aton='#define HAVE_INET_ATON 1'
2882 echores "$inet_aton"
2885 echocheck "socklen_t"
2886 _socklen_t=no
2887 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2888 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2889 done
2890 if test "$_socklen_t" = yes ; then
2891 def_socklen_t='#define HAVE_SOCKLEN_T 1'
2892 else
2893 def_socklen_t='#define HAVE_SOCKLEN_T 0'
2895 echores "$_socklen_t"
2898 echocheck "closesocket()"
2899 _closesocket=no
2900 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2901 if test "$_closesocket" = yes ; then
2902 def_closesocket='#define HAVE_CLOSESOCKET 1'
2903 else
2904 def_closesocket='#define HAVE_CLOSESOCKET 0'
2906 echores "$_closesocket"
2909 echocheck "networking"
2910 test $_winsock2_h = no && test $inet_pton = no &&
2911 test $inet_aton = no && networking=no
2912 if test "$networking" = yes ; then
2913 def_network='#define CONFIG_NETWORK 1'
2914 def_networking='#define CONFIG_NETWORKING 1'
2915 extra_ldflags="$extra_ldflags $_ld_sock"
2916 inputmodules="networking $inputmodules"
2917 else
2918 noinputmodules="networking $noinputmodules"
2919 def_network='#define CONFIG_NETWORK 0'
2920 def_networking='#undef CONFIG_NETWORKING'
2922 echores "$networking"
2925 echocheck "inet6"
2926 if test "$_inet6" = auto ; then
2927 cat > $TMPC << EOF
2928 #include <sys/types.h>
2929 #if !defined(_WIN32)
2930 #include <sys/socket.h>
2931 #include <netinet/in.h>
2932 #else
2933 #include <ws2tcpip.h>
2934 #endif
2935 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
2937 _inet6=no
2938 if cc_check $_ld_sock ; then
2939 _inet6=yes
2942 if test "$_inet6" = yes ; then
2943 def_inet6='#define HAVE_AF_INET6 1'
2944 else
2945 def_inet6='#undef HAVE_AF_INET6'
2947 echores "$_inet6"
2950 echocheck "gethostbyname2"
2951 if test "$_gethostbyname2" = auto ; then
2952 cat > $TMPC << EOF
2953 #include <sys/types.h>
2954 #include <sys/socket.h>
2955 #include <netdb.h>
2956 int main(void) { gethostbyname2("", AF_INET); return 0; }
2958 _gethostbyname2=no
2959 if cc_check ; then
2960 _gethostbyname2=yes
2963 if test "$_gethostbyname2" = yes ; then
2964 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
2965 else
2966 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
2968 echores "$_gethostbyname2"
2971 echocheck "inttypes.h (required)"
2972 _inttypes=no
2973 header_check inttypes.h && _inttypes=yes
2974 echores "$_inttypes"
2976 if test "$_inttypes" = no ; then
2977 echocheck "sys/bitypes.h (inttypes.h predecessor)"
2978 header_check sys/bitypes.h && _inttypes=yes
2979 if test "$_inttypes" = yes ; then
2980 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."
2981 else
2982 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2987 echocheck "malloc.h"
2988 _malloc=no
2989 header_check malloc.h && _malloc=yes
2990 if test "$_malloc" = yes ; then
2991 def_malloc_h='#define HAVE_MALLOC_H 1'
2992 else
2993 def_malloc_h='#define HAVE_MALLOC_H 0'
2995 echores "$_malloc"
2998 echocheck "memalign()"
2999 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3000 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3001 _memalign=no
3002 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3003 if test "$_memalign" = yes ; then
3004 def_memalign='#define HAVE_MEMALIGN 1'
3005 else
3006 def_memalign='#define HAVE_MEMALIGN 0'
3007 def_map_memalign='#define memalign(a, b) malloc(b)'
3008 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3010 echores "$_memalign"
3013 echocheck "posix_memalign()"
3014 posix_memalign=no
3015 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3016 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
3017 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3018 echores "$posix_memalign"
3021 echocheck "alloca.h"
3022 _alloca=no
3023 statement_check alloca.h 'alloca(0)' && _alloca=yes
3024 if cc_check ; then
3025 def_alloca_h='#define HAVE_ALLOCA_H 1'
3026 else
3027 def_alloca_h='#undef HAVE_ALLOCA_H'
3029 echores "$_alloca"
3032 echocheck "fastmemcpy"
3033 if test "$_fastmemcpy" = yes ; then
3034 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3035 else
3036 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3038 echores "$_fastmemcpy"
3041 echocheck "mman.h"
3042 _mman=no
3043 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3044 if test "$_mman" = yes ; then
3045 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3046 else
3047 def_mman_h='#undef HAVE_SYS_MMAN_H'
3049 echores "$_mman"
3051 _mman_has_map_failed=no
3052 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
3053 if test "$_mman_has_map_failed" = yes ; then
3054 def_mman_has_map_failed=''
3055 else
3056 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3059 echocheck "dynamic loader"
3060 _dl=no
3061 for _ld_tmp in "" "-ldl"; do
3062 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3063 done
3064 if test "$_dl" = yes ; then
3065 def_dl='#define HAVE_LIBDL 1'
3066 else
3067 def_dl='#undef HAVE_LIBDL'
3069 echores "$_dl"
3072 def_threads='#define HAVE_THREADS 0'
3074 echocheck "pthread"
3075 if linux ; then
3076 THREAD_CFLAGS=-D_REENTRANT
3077 elif freebsd || netbsd || openbsd || bsdos ; then
3078 THREAD_CFLAGS=-D_THREAD_SAFE
3080 if test "$_pthreads" = auto ; then
3081 cat > $TMPC << EOF
3082 #include <pthread.h>
3083 static void *func(void *arg) { return arg; }
3084 int main(void) {
3085 pthread_t tid;
3086 #ifdef PTW32_STATIC_LIB
3087 pthread_win32_process_attach_np();
3088 pthread_win32_thread_attach_np();
3089 #endif
3090 return pthread_create (&tid, 0, func, 0) != 0;
3093 _pthreads=no
3094 if ! hpux ; then
3095 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3096 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3097 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3098 done
3099 if test "$_pthreads" = no && mingw32 ; then
3100 _ld_tmp="-lpthreadGC2 -lws2_32"
3101 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
3105 if test "$_pthreads" = yes ; then
3106 test $_ld_pthread && res_comment="using $_ld_pthread"
3107 def_pthreads='#define HAVE_PTHREADS 1'
3108 def_threads='#define HAVE_THREADS 1'
3109 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3110 else
3111 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3112 def_pthreads='#undef HAVE_PTHREADS'
3113 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3114 mingw32 || _win32dll=no
3116 echores "$_pthreads"
3118 if cygwin ; then
3119 if test "$_pthreads" = yes ; then
3120 def_pthread_cache="#define PTHREAD_CACHE 1"
3121 else
3122 _stream_cache=no
3123 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3127 echocheck "w32threads"
3128 if test "$_pthreads" = yes ; then
3129 res_comment="using pthread instead"
3130 _w32threads=no
3132 if test "$_w32threads" = auto ; then
3133 _w32threads=no
3134 mingw32 && _w32threads=yes
3136 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3137 echores "$_w32threads"
3139 echocheck "rpath"
3140 if test "$_rpath" = yes ; then
3141 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3142 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3143 done
3144 extra_ldflags=$tmp
3146 echores "$_rpath"
3148 echocheck "iconv"
3149 if test "$_iconv" = auto ; then
3150 cat > $TMPC << EOF
3151 #include <stdio.h>
3152 #include <unistd.h>
3153 #include <iconv.h>
3154 #define INBUFSIZE 1024
3155 #define OUTBUFSIZE 4096
3157 char inbuffer[INBUFSIZE];
3158 char outbuffer[OUTBUFSIZE];
3160 int main(void) {
3161 size_t numread;
3162 iconv_t icdsc;
3163 char *tocode="UTF-8";
3164 char *fromcode="cp1250";
3165 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3166 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3167 char *iptr=inbuffer;
3168 char *optr=outbuffer;
3169 size_t inleft=numread;
3170 size_t outleft=OUTBUFSIZE;
3171 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3172 != (size_t)(-1)) {
3173 write(1, outbuffer, OUTBUFSIZE - outleft);
3176 if (iconv_close(icdsc) == -1)
3179 return 0;
3182 _iconv=no
3183 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3184 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3185 _iconv=yes && break
3186 done
3187 if test "$_iconv" != yes ; then
3188 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."
3191 if test "$_iconv" = yes ; then
3192 def_iconv='#define CONFIG_ICONV 1'
3193 else
3194 def_iconv='#undef CONFIG_ICONV'
3196 echores "$_iconv"
3199 echocheck "soundcard.h"
3200 _soundcard_h=no
3201 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3202 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3203 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3204 header_check $_soundcard_header && _soundcard_h=yes &&
3205 res_comment="$_soundcard_header" && break
3206 done
3208 if test "$_soundcard_h" = yes ; then
3209 if test $_soundcard_header = "sys/soundcard.h"; then
3210 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3211 else
3212 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3215 echores "$_soundcard_h"
3218 echocheck "sys/videoio.h"
3219 sys_videoio_h=no
3220 def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
3221 header_check sys/videoio.h && sys_videoio_h=yes &&
3222 def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
3223 echores "$sys_videoio_h"
3226 echocheck "sys/dvdio.h"
3227 _dvdio=no
3228 # FreeBSD 8.1 has broken dvdio.h
3229 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3230 if test "$_dvdio" = yes ; then
3231 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3232 else
3233 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3235 echores "$_dvdio"
3238 echocheck "sys/cdio.h"
3239 _cdio=no
3240 # at least OpenSolaris has a broken cdio.h
3241 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3242 if test "$_cdio" = yes ; then
3243 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3244 else
3245 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3247 echores "$_cdio"
3250 echocheck "linux/cdrom.h"
3251 _cdrom=no
3252 header_check linux/cdrom.h && _cdrom=yes
3253 if test "$_cdrom" = yes ; then
3254 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3255 else
3256 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3258 echores "$_cdrom"
3261 echocheck "dvd.h"
3262 _dvd=no
3263 header_check dvd.h && _dvd=yes
3264 if test "$_dvd" = yes ; then
3265 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3266 else
3267 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3269 echores "$_dvd"
3272 if bsdos; then
3273 echocheck "BSDI dvd.h"
3274 _bsdi_dvd=no
3275 header_check dvd.h && _bsdi_dvd=yes
3276 if test "$_bsdi_dvd" = yes ; then
3277 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3278 else
3279 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3281 echores "$_bsdi_dvd"
3282 fi #if bsdos
3285 if hpux; then
3286 # also used by AIX, but AIX does not support VCD and/or libdvdread
3287 echocheck "HP-UX SCSI header"
3288 _hpux_scsi_h=no
3289 header_check sys/scsi.h && _hpux_scsi_h=yes
3290 if test "$_hpux_scsi_h" = yes ; then
3291 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3292 else
3293 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3295 echores "$_hpux_scsi_h"
3296 fi #if hpux
3299 if sunos; then
3300 echocheck "userspace SCSI headers (Solaris)"
3301 _sol_scsi_h=no
3302 header_check sys/scsi/scsi_types.h &&
3303 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3304 _sol_scsi_h=yes
3305 if test "$_sol_scsi_h" = yes ; then
3306 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3307 else
3308 def_sol_scsi_h='#undef SOLARIS_USCSI'
3310 echores "$_sol_scsi_h"
3311 fi #if sunos
3314 echocheck "termcap"
3315 if test "$_termcap" = auto ; then
3316 _termcap=no
3317 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3318 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3319 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3320 done
3322 if test "$_termcap" = yes ; then
3323 def_termcap='#define HAVE_TERMCAP 1'
3324 test $_ld_tmp && res_comment="using $_ld_tmp"
3325 else
3326 def_termcap='#undef HAVE_TERMCAP'
3328 echores "$_termcap"
3331 echocheck "termios"
3332 def_termios='#undef HAVE_TERMIOS'
3333 def_termios_h='#undef HAVE_TERMIOS_H'
3334 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3335 if test "$_termios" = auto ; then
3336 _termios=no
3337 for _termios_header in "termios.h" "sys/termios.h"; do
3338 header_check $_termios_header && _termios=yes &&
3339 res_comment="using $_termios_header" && break
3340 done
3343 if test "$_termios" = yes ; then
3344 def_termios='#define HAVE_TERMIOS 1'
3345 if test "$_termios_header" = "termios.h" ; then
3346 def_termios_h='#define HAVE_TERMIOS_H 1'
3347 else
3348 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3351 echores "$_termios"
3354 echocheck "shm"
3355 if test "$_shm" = auto ; then
3356 _shm=no
3357 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3359 if test "$_shm" = yes ; then
3360 def_shm='#define HAVE_SHM 1'
3361 else
3362 def_shm='#undef HAVE_SHM'
3364 echores "$_shm"
3367 echocheck "strsep()"
3368 _strsep=no
3369 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3370 if test "$_strsep" = yes ; then
3371 def_strsep='#define HAVE_STRSEP 1'
3372 need_strsep=no
3373 else
3374 def_strsep='#undef HAVE_STRSEP'
3375 need_strsep=yes
3377 echores "$_strsep"
3380 echocheck "vsscanf()"
3381 cat > $TMPC << EOF
3382 #define _ISOC99_SOURCE
3383 #include <stdarg.h>
3384 #include <stdio.h>
3385 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3387 _vsscanf=no
3388 cc_check && _vsscanf=yes
3389 if test "$_vsscanf" = yes ; then
3390 def_vsscanf='#define HAVE_VSSCANF 1'
3391 need_vsscanf=no
3392 else
3393 def_vsscanf='#undef HAVE_VSSCANF'
3394 need_vsscanf=yes
3396 echores "$_vsscanf"
3399 echocheck "swab()"
3400 _swab=no
3401 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' ||
3402 statement_check "string.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3403 if test "$_swab" = yes ; then
3404 def_swab='#define HAVE_SWAB 1'
3405 need_swab=no
3406 else
3407 def_swab='#undef HAVE_SWAB'
3408 need_swab=yes
3410 echores "$_swab"
3412 echocheck "POSIX select()"
3413 cat > $TMPC << EOF
3414 #include <stdio.h>
3415 #include <stdlib.h>
3416 #include <sys/types.h>
3417 #include <string.h>
3418 #include <sys/time.h>
3419 #include <unistd.h>
3420 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3422 _posix_select=no
3423 def_posix_select='#undef HAVE_POSIX_SELECT'
3424 cc_check && _posix_select=yes &&
3425 def_posix_select='#define HAVE_POSIX_SELECT 1'
3426 echores "$_posix_select"
3429 echocheck "audio select()"
3430 if test "$_select" = no ; then
3431 def_select='#undef HAVE_AUDIO_SELECT'
3432 elif test "$_select" = yes ; then
3433 def_select='#define HAVE_AUDIO_SELECT 1'
3435 echores "$_select"
3438 echocheck "gettimeofday()"
3439 _gettimeofday=no
3440 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3441 if test "$_gettimeofday" = yes ; then
3442 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3443 need_gettimeofday=no
3444 else
3445 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3446 need_gettimeofday=yes
3448 echores "$_gettimeofday"
3451 echocheck "glob()"
3452 _glob=no
3453 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3454 need_glob=no
3455 if test "$_glob" = yes ; then
3456 def_glob='#define HAVE_GLOB 1'
3457 else
3458 def_glob='#undef HAVE_GLOB'
3459 # HACK! need_glob currently enables compilation of a
3460 # win32-specific glob()-replacement.
3461 # Other OS neither need it nor can they use it (mf:// is disabled for them).
3462 win32 && need_glob=yes
3464 echores "$_glob"
3467 echocheck "setenv()"
3468 _setenv=no
3469 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3470 if test "$_setenv" = yes ; then
3471 def_setenv='#define HAVE_SETENV 1'
3472 need_setenv=no
3473 else
3474 def_setenv='#undef HAVE_SETENV'
3475 need_setenv=yes
3477 echores "$_setenv"
3480 echocheck "setmode()"
3481 _setmode=no
3482 def_setmode='#define HAVE_SETMODE 0'
3483 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3484 echores "$_setmode"
3487 if sunos; then
3488 echocheck "sysi86()"
3489 _sysi86=no
3490 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3491 if test "$_sysi86" = yes ; then
3492 def_sysi86='#define HAVE_SYSI86 1'
3493 statement_check sys/sysi86.h 'int sysi86(int, void*); sysi86(0)' && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3494 else
3495 def_sysi86='#undef HAVE_SYSI86'
3497 echores "$_sysi86"
3498 fi #if sunos
3501 echocheck "sys/sysinfo.h"
3502 _sys_sysinfo=no
3503 statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
3504 if test "$_sys_sysinfo" = yes ; then
3505 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3506 else
3507 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3509 echores "$_sys_sysinfo"
3512 if darwin; then
3514 echocheck "Mac OS X Finder Support"
3515 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3516 if test "$_macosx_finder" = yes ; then
3517 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3518 extra_ldflags="$extra_ldflags -framework Cocoa"
3520 echores "$_macosx_finder"
3522 echocheck "Mac OS X Bundle file locations"
3523 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3524 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3525 if test "$_macosx_bundle" = yes ; then
3526 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3528 echores "$_macosx_bundle"
3530 echocheck "Apple Remote"
3531 if test "$_apple_remote" = auto ; then
3532 _apple_remote=no
3533 cat > $TMPC <<EOF
3534 #include <stdio.h>
3535 #include <IOKit/IOCFPlugIn.h>
3536 int main(void) {
3537 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3538 CFMutableDictionaryRef hidMatchDictionary;
3539 IOReturn ioReturnValue;
3541 // Set up a matching dictionary to search the I/O Registry by class.
3542 // name for all HID class devices
3543 hidMatchDictionary = IOServiceMatching("AppleIRController");
3545 // Now search I/O Registry for matching devices.
3546 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3547 hidMatchDictionary, &hidObjectIterator);
3549 // If search is unsuccessful, return nonzero.
3550 if (ioReturnValue != kIOReturnSuccess ||
3551 !IOIteratorIsValid(hidObjectIterator)) {
3552 return 1;
3554 return 0;
3557 cc_check -framework IOKit && _apple_remote=yes
3559 if test "$_apple_remote" = yes ; then
3560 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3561 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3562 else
3563 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3565 echores "$_apple_remote"
3567 fi #if darwin
3569 if linux; then
3571 echocheck "Apple IR"
3572 if test "$_apple_ir" = auto ; then
3573 _apple_ir=no
3574 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3576 if test "$_apple_ir" = yes ; then
3577 def_apple_ir='#define CONFIG_APPLE_IR 1'
3578 else
3579 def_apple_ir='#undef CONFIG_APPLE_IR'
3581 echores "$_apple_ir"
3582 fi #if linux
3584 echocheck "pkg-config"
3585 if $($_pkg_config --version > /dev/null 2>&1); then
3586 if test "$_ld_static"; then
3587 _pkg_config="$_pkg_config --static"
3589 echores "yes"
3590 else
3591 _pkg_config=false
3592 echores "no"
3596 echocheck "Samba support (libsmbclient)"
3597 if test "$_smb" = yes; then
3598 extra_ldflags="$extra_ldflags -lsmbclient"
3600 if test "$_smb" = auto; then
3601 _smb=no
3602 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3603 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3604 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3605 done
3608 if test "$_smb" = yes; then
3609 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3610 inputmodules="smb $inputmodules"
3611 else
3612 def_smb="#undef CONFIG_LIBSMBCLIENT"
3613 noinputmodules="smb $noinputmodules"
3615 echores "$_smb"
3617 echocheck "libquvi support"
3618 if test "$_libquvi" = auto ; then
3619 _libquvi=no
3620 if pkg_config_add libquvi ; then
3621 _libquvi=yes
3624 if test "$_libquvi" = yes; then
3625 def_libquvi="#define CONFIG_LIBQUVI 1"
3626 else
3627 def_libquvi="#undef CONFIG_LIBQUVI"
3629 echores "$_libquvi"
3631 #########
3632 # VIDEO #
3633 #########
3636 echocheck "tdfxfb"
3637 if test "$_tdfxfb" = yes ; then
3638 def_tdfxfb='#define CONFIG_TDFXFB 1'
3639 vomodules="tdfxfb $vomodules"
3640 else
3641 def_tdfxfb='#undef CONFIG_TDFXFB'
3642 novomodules="tdfxfb $novomodules"
3644 echores "$_tdfxfb"
3646 echocheck "s3fb"
3647 if test "$_s3fb" = yes ; then
3648 def_s3fb='#define CONFIG_S3FB 1'
3649 vomodules="s3fb $vomodules"
3650 else
3651 def_s3fb='#undef CONFIG_S3FB'
3652 novomodules="s3fb $novomodules"
3654 echores "$_s3fb"
3656 echocheck "wii"
3657 if test "$_wii" = yes ; then
3658 def_wii='#define CONFIG_WII 1'
3659 vomodules="wii $vomodules"
3660 else
3661 def_wii='#undef CONFIG_WII'
3662 novomodules="wii $novomodules"
3664 echores "$_wii"
3666 echocheck "tdfxvid"
3667 if test "$_tdfxvid" = yes ; then
3668 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3669 vomodules="tdfx_vid $vomodules"
3670 else
3671 def_tdfxvid='#undef CONFIG_TDFX_VID'
3672 novomodules="tdfx_vid $novomodules"
3674 echores "$_tdfxvid"
3676 echocheck "xvr100"
3677 if test "$_xvr100" = auto ; then
3678 cat > $TMPC << EOF
3679 #include <unistd.h>
3680 #include <sys/fbio.h>
3681 #include <sys/visual_io.h>
3682 int main(void) {
3683 struct vis_identifier ident;
3684 struct fbgattr attr;
3685 ioctl(0, VIS_GETIDENTIFIER, &ident);
3686 ioctl(0, FBIOGATTR, &attr);
3687 return 0;
3690 _xvr100=no
3691 cc_check && _xvr100=yes
3693 if test "$_xvr100" = yes ; then
3694 def_xvr100='#define CONFIG_XVR100 1'
3695 vomodules="xvr100 $vomodules"
3696 else
3697 def_tdfxvid='#undef CONFIG_XVR100'
3698 novomodules="xvr100 $novomodules"
3700 echores "$_xvr100"
3702 echocheck "tga"
3703 if test "$_tga" = yes ; then
3704 def_tga='#define CONFIG_TGA 1'
3705 vomodules="tga $vomodules"
3706 else
3707 def_tga='#undef CONFIG_TGA'
3708 novomodules="tga $novomodules"
3710 echores "$_tga"
3713 echocheck "md5sum support"
3714 if test "$_md5sum" = yes; then
3715 def_md5sum="#define CONFIG_MD5SUM 1"
3716 vomodules="md5sum $vomodules"
3717 else
3718 def_md5sum="#undef CONFIG_MD5SUM"
3719 novomodules="md5sum $novomodules"
3721 echores "$_md5sum"
3724 echocheck "yuv4mpeg support"
3725 if test "$_yuv4mpeg" = yes; then
3726 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3727 vomodules="yuv4mpeg $vomodules"
3728 else
3729 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3730 novomodules="yuv4mpeg $novomodules"
3732 echores "$_yuv4mpeg"
3735 echocheck "bl"
3736 if test "$_bl" = yes ; then
3737 def_bl='#define CONFIG_BL 1'
3738 vomodules="bl $vomodules"
3739 else
3740 def_bl='#undef CONFIG_BL'
3741 novomodules="bl $novomodules"
3743 echores "$_bl"
3746 echocheck "DirectFB"
3747 if test "$_directfb" = auto ; then
3748 _directfb=no
3749 cat > $TMPC << EOF
3750 #include <directfb.h>
3751 #include <directfb_version.h>
3752 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3753 #error "DirectFB version too old."
3754 #endif
3755 int main(void) { DirectFBInit(0, 0); return 0; }
3757 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3758 cc_check $_inc_tmp -ldirectfb &&
3759 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3760 done
3762 if test "$_directfb" = yes ; then
3763 def_directfb='#define CONFIG_DIRECTFB 1'
3764 vomodules="directfb dfbmga $vomodules"
3765 libs_mplayer="$libs_mplayer -ldirectfb"
3766 else
3767 def_directfb='#undef CONFIG_DIRECTFB'
3768 novomodules="directfb dfbmga $novomodules"
3770 echores "$_directfb"
3773 if darwin; then
3775 echocheck "QuickTime"
3776 if test "$quicktime" = auto ; then
3777 quicktime=no
3778 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
3780 if test "$quicktime" = yes ; then
3781 extra_ldflags="$extra_ldflags -framework QuickTime"
3782 def_quicktime='#define CONFIG_QUICKTIME 1'
3783 else
3784 def_quicktime='#undef CONFIG_QUICKTIME'
3786 echores $quicktime
3788 echocheck "Cocoa"
3789 if test "$_cocoa" = auto ; then
3790 cat > $TMPC <<EOF
3791 #include <CoreServices/CoreServices.h>
3792 #include <OpenGL/OpenGL.h>
3793 int main(void) {
3794 NSApplicationLoad();
3797 _cocoa=no
3798 cc_check -framework Cocoa -framework OpenGL && _cocoa=yes
3800 if test "$_cocoa" = yes ; then
3801 libs_mplayer="$libs_mplayer -framework Cocoa -framework OpenGL"
3802 def_cocoa='#define CONFIG_COCOA 1'
3803 else
3804 def_cocoa='#undef CONFIG_COCOA'
3806 echores "$_cocoa"
3808 echocheck "CoreVideo"
3809 if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
3810 cat > $TMPC <<EOF
3811 #include <QuartzCore/CoreVideo.h>
3812 int main(void) { return 0; }
3814 _corevideo=no
3815 cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
3817 if test "$_corevideo" = yes ; then
3818 vomodules="corevideo $vomodules"
3819 libs_mplayer="$libs_mplayer -framework QuartzCore"
3820 def_corevideo='#define CONFIG_COREVIDEO 1'
3821 else
3822 novomodules="corevideo $novomodules"
3823 def_corevideo='#undef CONFIG_COREVIDEO'
3825 echores "$_corevideo"
3827 echocheck "SharedBuffer"
3828 if test "$_sharedbuffer" = auto ; then
3829 cat > $TMPC <<EOF
3830 int main(void) {
3831 NSApplicationLoad();
3834 _sharedbuffer=no
3835 cc_check -framework Cocoa && _sharedbuffer=yes
3837 if test "$_sharedbuffer" = yes ; then
3838 vomodules="sharedbuffer $vomodules"
3839 libs_mplayer="$libs_mplayer -framework Cocoa"
3840 def_sharedbuffer='#define CONFIG_SHAREDBUFFER 1'
3841 else
3842 novomodules="sharedbuffer $novomodules"
3843 def_sharedbuffer='#undef CONFIG_SHAREDBUFFER'
3845 echores "$_sharedbuffer"
3847 depends_on_application_services(){
3848 test "$_corevideo" = yes
3851 fi #if darwin
3854 echocheck "X11 headers presence"
3855 _x11_headers="no"
3856 res_comment="check if the dev(el) packages are installed"
3857 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3858 if test -f "$I/X11/Xlib.h" ; then
3859 _x11_headers="yes"
3860 res_comment=""
3861 break
3863 done
3864 if test $_cross_compile = no; then
3865 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3866 /usr/include/X11R6 /usr/openwin/include ; do
3867 if test -f "$I/X11/Xlib.h" ; then
3868 extra_cflags="$extra_cflags -I$I"
3869 _x11_headers="yes"
3870 res_comment="using $I"
3871 break
3873 done
3875 echores "$_x11_headers"
3878 echocheck "X11"
3879 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3880 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3881 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3882 -L/usr/lib ; do
3883 if netbsd; then
3884 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3885 else
3886 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3888 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3889 _x11=yes
3890 # Check that there aren't conflicting headers between ApplicationServices
3891 # and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
3892 # is included by -framework ApplicationServices and clashes with the X11
3893 # definition of the "Cursor" type.
3894 if darwin && depends_on_application_services && test "$_x11" = yes ; then
3895 _x11=no
3896 header_check_broken ApplicationServices/ApplicationServices.h \
3897 X11/Xutil.h $_ld_tmp && _x11=yes
3899 if test "$_x11" = yes ; then
3900 libs_mplayer="$libs_mplayer $_ld_tmp"
3901 break
3903 done
3905 if test "$_x11" = yes ; then
3906 def_x11='#define CONFIG_X11 1'
3907 vomodules="x11 xover $vomodules"
3908 else
3909 _x11=no
3910 def_x11='#undef CONFIG_X11'
3911 novomodules="x11 $novomodules"
3912 res_comment="check if the dev(el) packages are installed"
3914 echores "$_x11"
3916 echocheck "Xss screensaver extensions"
3917 if test "$_xss" = auto ; then
3918 _xss=no
3919 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3921 if test "$_xss" = yes ; then
3922 def_xss='#define CONFIG_XSS 1'
3923 libs_mplayer="$libs_mplayer -lXss"
3924 else
3925 def_xss='#undef CONFIG_XSS'
3927 echores "$_xss"
3929 echocheck "DPMS"
3930 _xdpms3=no
3931 _xdpms4=no
3932 if test "$_x11" = yes ; then
3933 cat > $TMPC <<EOF
3934 #include <X11/Xmd.h>
3935 #include <X11/Xlib.h>
3936 #include <X11/Xutil.h>
3937 #include <X11/Xatom.h>
3938 #include <X11/extensions/dpms.h>
3939 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3941 cc_check -lXdpms && _xdpms3=yes
3942 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3944 if test "$_xdpms4" = yes ; then
3945 def_xdpms='#define CONFIG_XDPMS 1'
3946 res_comment="using Xdpms 4"
3947 echores "yes"
3948 elif test "$_xdpms3" = yes ; then
3949 def_xdpms='#define CONFIG_XDPMS 1'
3950 libs_mplayer="$libs_mplayer -lXdpms"
3951 res_comment="using Xdpms 3"
3952 echores "yes"
3953 else
3954 def_xdpms='#undef CONFIG_XDPMS'
3955 echores "no"
3959 echocheck "Xv"
3960 if test "$_xv" = auto && test "$_x11" = yes ; then
3961 _xv=no
3962 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
3965 if test "$_xv" = yes ; then
3966 def_xv='#define CONFIG_XV 1'
3967 libs_mplayer="$libs_mplayer -lXv"
3968 vomodules="xv $vomodules"
3969 else
3970 def_xv='#undef CONFIG_XV'
3971 novomodules="xv $novomodules"
3973 echores "$_xv"
3976 echocheck "VDPAU"
3977 if test "$_vdpau" = auto && test "$_x11" = yes ; then
3978 _vdpau=no
3979 if test "$_dl" = yes ; then
3980 pkg_config_add 'vdpau >= 0.2' && _vdpau=yes
3983 if test "$_vdpau" = yes ; then
3984 def_vdpau='#define CONFIG_VDPAU 1'
3985 vomodules="vdpau $vomodules"
3986 else
3987 def_vdpau='#define CONFIG_VDPAU 0'
3988 novomodules="vdpau $novomodules"
3990 echores "$_vdpau"
3993 echocheck "Xinerama"
3994 if test "$_xinerama" = auto && test "$_x11" = yes ; then
3995 _xinerama=no
3996 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
3999 if test "$_xinerama" = yes ; then
4000 def_xinerama='#define CONFIG_XINERAMA 1'
4001 libs_mplayer="$libs_mplayer -lXinerama"
4002 else
4003 def_xinerama='#undef CONFIG_XINERAMA'
4005 echores "$_xinerama"
4008 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4009 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4010 # named 'X extensions' or something similar.
4011 # This check may be useful for future mplayer versions (to change resolution)
4012 # If you run into problems, remove '-lXxf86vm'.
4013 echocheck "Xxf86vm"
4014 if test "$_vm" = auto && test "$_x11" = yes ; then
4015 _vm=no
4016 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
4018 if test "$_vm" = yes ; then
4019 def_vm='#define CONFIG_XF86VM 1'
4020 libs_mplayer="$libs_mplayer -lXxf86vm"
4021 else
4022 def_vm='#undef CONFIG_XF86VM'
4024 echores "$_vm"
4026 # Check for the presence of special keycodes, like audio control buttons
4027 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4028 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4029 # have these new keycodes.
4030 echocheck "XF86keysym"
4031 if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
4032 _xf86keysym=no
4033 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
4035 if test "$_xf86keysym" = yes ; then
4036 def_xf86keysym='#define CONFIG_XF86XK 1'
4037 else
4038 def_xf86keysym='#undef CONFIG_XF86XK'
4040 echores "$_xf86keysym"
4042 echocheck "DGA"
4043 if test "$_dga2" = auto && test "$_x11" = yes ; then
4044 _dga2=no
4045 statement_check_broken X11/Xlib.h X11/extensions/Xxf86dga.h 'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2=yes
4047 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4048 _dga1=no
4049 statement_check_broken X11/Xlib.h X11/extensions/Xxf86dga.h 'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1=yes
4052 _dga=no
4053 def_dga='#undef CONFIG_DGA'
4054 def_dga1='#undef CONFIG_DGA1'
4055 def_dga2='#undef CONFIG_DGA2'
4056 if test "$_dga1" = yes ; then
4057 _dga=yes
4058 def_dga1='#define CONFIG_DGA1 1'
4059 res_comment="using DGA 1.0"
4060 elif test "$_dga2" = yes ; then
4061 _dga=yes
4062 def_dga2='#define CONFIG_DGA2 1'
4063 res_comment="using DGA 2.0"
4065 if test "$_dga" = yes ; then
4066 def_dga='#define CONFIG_DGA 1'
4067 libs_mplayer="$libs_mplayer -lXxf86dga"
4068 vomodules="dga $vomodules"
4069 else
4070 novomodules="dga $novomodules"
4072 echores "$_dga"
4075 echocheck "3dfx"
4076 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4077 def_3dfx='#define CONFIG_3DFX 1'
4078 vomodules="3dfx $vomodules"
4079 else
4080 _3dfx=no
4081 def_3dfx='#undef CONFIG_3DFX'
4082 novomodules="3dfx $novomodules"
4084 echores "$_3dfx"
4087 echocheck "GGI"
4088 if test "$_ggi" = auto ; then
4089 _ggi=no
4090 statement_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4092 if test "$_ggi" = yes ; then
4093 def_ggi='#define CONFIG_GGI 1'
4094 libs_mplayer="$libs_mplayer -lggi"
4095 vomodules="ggi $vomodules"
4096 else
4097 def_ggi='#undef CONFIG_GGI'
4098 novomodules="ggi $novomodules"
4100 echores "$_ggi"
4102 echocheck "GGI extension: libggiwmh"
4103 if test "$_ggiwmh" = auto ; then
4104 _ggiwmh=no
4105 statement_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4107 # needed to get right output on obscure combination
4108 # like --disable-ggi --enable-ggiwmh
4109 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4110 def_ggiwmh='#define CONFIG_GGIWMH 1'
4111 libs_mplayer="$libs_mplayer -lggiwmh"
4112 else
4113 _ggiwmh=no
4114 def_ggiwmh='#undef CONFIG_GGIWMH'
4116 echores "$_ggiwmh"
4119 echocheck "AA"
4120 if test "$_aa" = auto ; then
4121 cat > $TMPC << EOF
4122 #include <aalib.h>
4123 int main(void) {
4124 aa_context *c;
4125 aa_renderparams *p;
4126 aa_init(0, 0, 0);
4127 c = aa_autoinit(&aa_defparams);
4128 p = aa_getrenderparams();
4129 aa_autoinitkbd(c, 0);
4130 return 0; }
4132 _aa=no
4133 for _ld_tmp in "-laa" ; do
4134 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4135 done
4137 if test "$_aa" = yes ; then
4138 def_aa='#define CONFIG_AA 1'
4139 if cygwin ; then
4140 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4142 vomodules="aa $vomodules"
4143 else
4144 def_aa='#undef CONFIG_AA'
4145 novomodules="aa $novomodules"
4147 echores "$_aa"
4150 echocheck "CACA"
4151 if test "$_caca" = auto ; then
4152 _caca=no
4153 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4154 cat > $TMPC << EOF
4155 #include <caca.h>
4156 #ifdef CACA_API_VERSION_1
4157 #include <caca0.h>
4158 #endif
4159 int main(void) { caca_init(); return 0; }
4161 cc_check $(caca-config --libs) && _caca=yes
4164 if test "$_caca" = yes ; then
4165 def_caca='#define CONFIG_CACA 1'
4166 extra_cflags="$extra_cflags $(caca-config --cflags)"
4167 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4168 vomodules="caca $vomodules"
4169 else
4170 def_caca='#undef CONFIG_CACA'
4171 novomodules="caca $novomodules"
4173 echores "$_caca"
4176 echocheck "SVGAlib"
4177 if test "$_svga" = auto ; then
4178 _svga=no
4179 header_check vga.h -lvga $_ld_lm && _svga=yes
4181 if test "$_svga" = yes ; then
4182 def_svga='#define CONFIG_SVGALIB 1'
4183 libs_mplayer="$libs_mplayer -lvga"
4184 vomodules="svga $vomodules"
4185 else
4186 def_svga='#undef CONFIG_SVGALIB'
4187 novomodules="svga $novomodules"
4189 echores "$_svga"
4192 echocheck "FBDev"
4193 if test "$_fbdev" = auto ; then
4194 _fbdev=no
4195 linux && _fbdev=yes
4197 if test "$_fbdev" = yes ; then
4198 def_fbdev='#define CONFIG_FBDEV 1'
4199 vomodules="fbdev $vomodules"
4200 else
4201 def_fbdev='#undef CONFIG_FBDEV'
4202 novomodules="fbdev $novomodules"
4204 echores "$_fbdev"
4208 echocheck "DVB"
4209 if test "$_dvb" = auto ; then
4210 _dvb=no
4211 cat >$TMPC << EOF
4212 #include <poll.h>
4213 #include <sys/ioctl.h>
4214 #include <stdio.h>
4215 #include <time.h>
4216 #include <unistd.h>
4217 #include <linux/dvb/dmx.h>
4218 #include <linux/dvb/frontend.h>
4219 #include <linux/dvb/video.h>
4220 #include <linux/dvb/audio.h>
4221 int main(void) {return 0;}
4223 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4224 cc_check $_inc_tmp && _dvb=yes &&
4225 extra_cflags="$extra_cflags $_inc_tmp" && break
4226 done
4228 echores "$_dvb"
4229 if test "$_dvb" = yes ; then
4230 _dvbin=yes
4231 inputmodules="dvb $inputmodules"
4232 def_dvb='#define CONFIG_DVB 1'
4233 def_dvbin='#define CONFIG_DVBIN 1'
4234 aomodules="mpegpes(dvb) $aomodules"
4235 vomodules="mpegpes(dvb) $vomodules"
4236 else
4237 _dvbin=no
4238 noinputmodules="dvb $noinputmodules"
4239 def_dvb='#undef CONFIG_DVB'
4240 def_dvbin='#undef CONFIG_DVBIN '
4241 aomodules="mpegpes(file) $aomodules"
4242 vomodules="mpegpes(file) $vomodules"
4246 echocheck "PNG support"
4247 if test "$_png" = auto ; then
4248 _png=no
4249 cat > $TMPC << EOF
4250 #include <stdio.h>
4251 #include <string.h>
4252 #include <png.h>
4253 int main(void) {
4254 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4255 printf("libpng: %s\n", png_libpng_ver);
4256 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4259 cc_check -lpng -lz $_ld_lm && _png=yes
4261 echores "$_png"
4262 if test "$_png" = yes ; then
4263 def_png='#define CONFIG_PNG 1'
4264 extra_ldflags="$extra_ldflags -lpng -lz"
4265 else
4266 def_png='#undef CONFIG_PNG'
4269 echocheck "MNG support"
4270 if test "$_mng" = auto ; then
4271 _mng=no
4272 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
4274 echores "$_mng"
4275 if test "$_mng" = yes ; then
4276 def_mng='#define CONFIG_MNG 1'
4277 extra_ldflags="$extra_ldflags -lmng -lz"
4278 else
4279 def_mng='#undef CONFIG_MNG'
4282 echocheck "JPEG support"
4283 if test "$_jpeg" = auto ; then
4284 _jpeg=no
4285 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
4287 echores "$_jpeg"
4289 if test "$_jpeg" = yes ; then
4290 def_jpeg='#define CONFIG_JPEG 1'
4291 vomodules="jpeg $vomodules"
4292 extra_ldflags="$extra_ldflags -ljpeg"
4293 else
4294 def_jpeg='#undef CONFIG_JPEG'
4295 novomodules="jpeg $novomodules"
4300 echocheck "PNM support"
4301 if test "$_pnm" = yes; then
4302 def_pnm="#define CONFIG_PNM 1"
4303 vomodules="pnm $vomodules"
4304 else
4305 def_pnm="#undef CONFIG_PNM"
4306 novomodules="pnm $novomodules"
4308 echores "$_pnm"
4312 echocheck "GIF support"
4313 # This is to appease people who want to force gif support.
4314 # If it is forced to yes, then we still do checks to determine
4315 # which gif library to use.
4316 if test "$_gif" = yes ; then
4317 _force_gif=yes
4318 _gif=auto
4321 if test "$_gif" = auto ; then
4322 _gif=no
4323 for _ld_gif in "-lungif" "-lgif" ; do
4324 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4325 done
4328 # If no library was found, and the user wants support forced,
4329 # then we force it on with libgif, as this is the safest
4330 # assumption IMHO. (libungif & libregif both create symbolic
4331 # links to libgif. We also assume that no x11 support is needed,
4332 # because if you are forcing this, then you _should_ know what
4333 # you are doing. [ Besides, package maintainers should never
4334 # have compiled x11 deps into libungif in the first place. ] )
4335 # </rant>
4336 # --Joey
4337 if test "$_force_gif" = yes && test "$_gif" = no ; then
4338 _gif=yes
4339 _ld_gif="-lgif"
4342 if test "$_gif" = yes ; then
4343 def_gif='#define CONFIG_GIF 1'
4344 codecmodules="gif $codecmodules"
4345 vomodules="gif89a $vomodules"
4346 res_comment="old version, some encoding functions disabled"
4347 def_gif_4='#undef CONFIG_GIF_4'
4348 extra_ldflags="$extra_ldflags $_ld_gif"
4350 cat > $TMPC << EOF
4351 #include <signal.h>
4352 #include <stdio.h>
4353 #include <stdlib.h>
4354 #include <gif_lib.h>
4355 static void catch(int sig) { exit(1); }
4356 int main(void) {
4357 signal(SIGSEGV, catch); // catch segfault
4358 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4359 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4360 return 0;
4363 if cc_check "$_ld_gif" ; then
4364 def_gif_4='#define CONFIG_GIF_4 1'
4365 res_comment=""
4367 else
4368 def_gif='#undef CONFIG_GIF'
4369 def_gif_4='#undef CONFIG_GIF_4'
4370 novomodules="gif89a $novomodules"
4371 nocodecmodules="gif $nocodecmodules"
4373 echores "$_gif"
4376 case "$_gif" in yes*)
4377 echocheck "broken giflib workaround"
4378 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4380 cat > $TMPC << EOF
4381 #include <stdio.h>
4382 #include <gif_lib.h>
4383 int main(void) {
4384 GifFileType gif = {.UserData = NULL};
4385 printf("UserData is at address %p\n", gif.UserData);
4386 return 0;
4389 if cc_check "$_ld_gif" ; then
4390 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4391 echores "disabled"
4392 else
4393 echores "enabled"
4396 esac
4399 echocheck "VESA support"
4400 if test "$_vesa" = auto ; then
4401 _vesa=no
4402 statement_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4404 if test "$_vesa" = yes ; then
4405 def_vesa='#define CONFIG_VESA 1'
4406 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4407 vomodules="vesa $vomodules"
4408 else
4409 def_vesa='#undef CONFIG_VESA'
4410 novomodules="vesa $novomodules"
4412 echores "$_vesa"
4414 #################
4415 # VIDEO + AUDIO #
4416 #################
4419 echocheck "SDL"
4420 _inc_tmp=""
4421 _ld_tmp=""
4422 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4423 if test -z "$_sdlconfig" ; then
4424 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4425 _sdlconfig="sdl-config"
4426 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4427 _sdlconfig="sdl11-config"
4428 else
4429 _sdlconfig=false
4432 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4433 cat > $TMPC << EOF
4434 #ifdef CONFIG_SDL_SDL_H
4435 #include <SDL/SDL.h>
4436 #else
4437 #include <SDL.h>
4438 #endif
4439 #ifndef __APPLE__
4440 // we allow SDL hacking our main() only on OSX
4441 #undef main
4442 #endif
4443 int main(int argc, char *argv[]) {
4444 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4445 return 0;
4448 _sdl=no
4449 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4450 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4451 _sdl=yes
4452 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4453 break
4455 done
4456 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4457 res_comment="using $_sdlconfig"
4458 if cygwin ; then
4459 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4460 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4461 elif mingw32 ; then
4462 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4463 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4464 else
4465 _inc_tmp="$($_sdlconfig --cflags)"
4466 _ld_tmp="$($_sdlconfig --libs)"
4468 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4469 _sdl=yes
4470 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4471 # HACK for BeOS/Haiku SDL
4472 _ld_tmp="$_ld_tmp -lstdc++"
4473 _sdl=yes
4477 if test "$_sdl" = yes ; then
4478 def_sdl='#define CONFIG_SDL 1'
4479 extra_cflags="$extra_cflags $_inc_tmp"
4480 libs_mplayer="$libs_mplayer $_ld_tmp"
4481 vomodules="sdl $vomodules"
4482 aomodules="sdl $aomodules"
4483 else
4484 def_sdl='#undef CONFIG_SDL'
4485 novomodules="sdl $novomodules"
4486 noaomodules="sdl $noaomodules"
4488 echores "$_sdl"
4491 # make sure this stays below CoreVideo to avoid issues due to namespace
4492 # conflicts between -lGL and -framework OpenGL
4493 echocheck "OpenGL"
4494 #Note: this test is run even with --enable-gl since we autodetect linker flags
4495 if (test "$_x11" = yes || test "$_sdl" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
4496 cat > $TMPC << EOF
4497 #ifdef GL_WIN32
4498 #include <windows.h>
4499 #include <GL/gl.h>
4500 #elif defined(GL_SDL)
4501 #include <GL/gl.h>
4502 #ifdef CONFIG_SDL_SDL_H
4503 #include <SDL/SDL.h>
4504 #else
4505 #include <SDL.h>
4506 #endif
4507 #ifndef __APPLE__
4508 // we allow SDL hacking our main() only on OSX
4509 #undef main
4510 #endif
4511 #else
4512 #include <GL/gl.h>
4513 #include <X11/Xlib.h>
4514 #include <GL/glx.h>
4515 #endif
4516 int main(int argc, char *argv[]) {
4517 #ifdef GL_WIN32
4518 HDC dc;
4519 wglCreateContext(dc);
4520 #elif defined(GL_SDL)
4521 SDL_GL_SwapBuffers();
4522 #else
4523 glXCreateContext(NULL, NULL, NULL, True);
4524 #endif
4525 glFinish();
4526 return 0;
4529 _gl=no
4530 if test "$_x11" = yes ; then
4531 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4532 if cc_check $_ld_tmp $_ld_lm ; then
4533 _gl=yes
4534 _gl_x11=yes
4535 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4536 break
4538 done
4540 if win32 && cc_check -DGL_WIN32 -lopengl32 ; then
4541 _gl=yes
4542 _gl_win32=yes
4543 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4545 if test "$_cocoa" = yes ; then
4546 _gl=yes
4547 _gl_cocoa=yes
4549 # last so it can reuse any linker etc. flags detected before
4550 if test "$_sdl" = yes ; then
4551 if cc_check -DGL_SDL ||
4552 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4553 _gl=yes
4554 _gl_sdl=yes
4555 elif cc_check -DGL_SDL -lGL ||
4556 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4557 _gl=yes
4558 _gl_sdl=yes
4559 libs_mplayer="$libs_mplayer -lGL"
4562 else
4563 _gl=no
4565 if test "$_gl" = yes ; then
4566 def_gl='#define CONFIG_GL 1'
4567 res_comment="backends:"
4568 if test "$_gl_cocoa" = yes ; then
4569 def_gl_cocoa='#define CONFIG_GL_COCOA 1'
4570 res_comment="$res_comment cocoa"
4572 if test "$_gl_win32" = yes ; then
4573 def_gl_win32='#define CONFIG_GL_WIN32 1'
4574 res_comment="$res_comment win32"
4576 if test "$_gl_x11" = yes ; then
4577 def_gl_x11='#define CONFIG_GL_X11 1'
4578 res_comment="$res_comment x11"
4580 if test "$_gl_sdl" = yes ; then
4581 def_gl_sdl='#define CONFIG_GL_SDL 1'
4582 res_comment="$res_comment sdl"
4584 vomodules="opengl $vomodules"
4585 else
4586 def_gl='#undef CONFIG_GL'
4587 def_gl_cocoa='#undef CONFIG_GL_COCOA'
4588 def_gl_win32='#undef CONFIG_GL_WIN32'
4589 def_gl_x11='#undef CONFIG_GL_X11'
4590 def_gl_sdl='#undef CONFIG_GL_SDL'
4591 novomodules="opengl $novomodules"
4593 echores "$_gl"
4596 if win32; then
4598 echocheck "Windows waveout"
4599 if test "$_win32waveout" = auto ; then
4600 _win32waveout=no
4601 header_check_broken windows.h mmsystem.h -lwinmm && _win32waveout=yes
4603 if test "$_win32waveout" = yes ; then
4604 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4605 libs_mplayer="$libs_mplayer -lwinmm"
4606 aomodules="win32 $aomodules"
4607 else
4608 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4609 noaomodules="win32 $noaomodules"
4611 echores "$_win32waveout"
4613 echocheck "Direct3D"
4614 if test "$_direct3d" = auto ; then
4615 _direct3d=no
4616 header_check d3d9.h && _direct3d=yes
4618 if test "$_direct3d" = yes ; then
4619 def_direct3d='#define CONFIG_DIRECT3D 1'
4620 vomodules="direct3d $vomodules"
4621 else
4622 def_direct3d='#undef CONFIG_DIRECT3D'
4623 novomodules="direct3d $novomodules"
4625 echores "$_direct3d"
4627 echocheck "Directx"
4628 if test "$_directx" = auto ; then
4629 cat > $TMPC << EOF
4630 #include <ddraw.h>
4631 #include <dsound.h>
4632 int main(void) { return 0; }
4634 _directx=no
4635 cc_check -lgdi32 && _directx=yes
4637 if test "$_directx" = yes ; then
4638 def_directx='#define CONFIG_DIRECTX 1'
4639 libs_mplayer="$libs_mplayer -lgdi32"
4640 vomodules="directx $vomodules"
4641 aomodules="dsound $aomodules"
4642 else
4643 def_directx='#undef CONFIG_DIRECTX'
4644 novomodules="directx $novomodules"
4645 noaomodules="dsound $noaomodules"
4647 echores "$_directx"
4649 fi #if win32; then
4652 echocheck "DXR3/H+"
4653 if test "$_dxr3" = auto ; then
4654 _dxr3=no
4655 header_check linux/em8300.h && _dxr3=yes
4657 if test "$_dxr3" = yes ; then
4658 def_dxr3='#define CONFIG_DXR3 1'
4659 vomodules="dxr3 $vomodules"
4660 else
4661 def_dxr3='#undef CONFIG_DXR3'
4662 novomodules="dxr3 $novomodules"
4664 echores "$_dxr3"
4667 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4668 if test "$_ivtv" = auto ; then
4669 cat > $TMPC << EOF
4670 #include <sys/time.h>
4671 #include <linux/videodev2.h>
4672 #include <linux/ivtv.h>
4673 #include <sys/ioctl.h>
4674 int main(void) {
4675 struct ivtv_cfg_stop_decode sd;
4676 struct ivtv_cfg_start_decode sd1;
4677 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4678 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
4679 return 0; }
4681 _ivtv=no
4682 cc_check && _ivtv=yes
4684 if test "$_ivtv" = yes ; then
4685 def_ivtv='#define CONFIG_IVTV 1'
4686 vomodules="ivtv $vomodules"
4687 aomodules="ivtv $aomodules"
4688 else
4689 def_ivtv='#undef CONFIG_IVTV'
4690 novomodules="ivtv $novomodules"
4691 noaomodules="ivtv $noaomodules"
4693 echores "$_ivtv"
4696 echocheck "V4L2 MPEG Decoder"
4697 if test "$_v4l2" = auto ; then
4698 cat > $TMPC << EOF
4699 #include <sys/time.h>
4700 #include <linux/videodev2.h>
4701 #include <linux/version.h>
4702 int main(void) {
4703 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4704 #error kernel headers too old, need 2.6.22
4705 #endif
4706 struct v4l2_ext_controls ctrls;
4707 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4708 return 0;
4711 _v4l2=no
4712 cc_check && _v4l2=yes
4714 if test "$_v4l2" = yes ; then
4715 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4716 vomodules="v4l2 $vomodules"
4717 aomodules="v4l2 $aomodules"
4718 else
4719 def_v4l2='#undef CONFIG_V4L2_DECODER'
4720 novomodules="v4l2 $novomodules"
4721 noaomodules="v4l2 $noaomodules"
4723 echores "$_v4l2"
4727 #########
4728 # AUDIO #
4729 #########
4732 echocheck "OSS Audio"
4733 if test "$_ossaudio" = auto ; then
4734 _ossaudio=no
4735 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
4737 if test "$_ossaudio" = yes ; then
4738 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
4739 aomodules="oss $aomodules"
4740 cat > $TMPC << EOF
4741 #include <$_soundcard_header>
4742 #ifdef OPEN_SOUND_SYSTEM
4743 int main(void) { return 0; }
4744 #else
4745 #error Not the real thing
4746 #endif
4748 _real_ossaudio=no
4749 cc_check && _real_ossaudio=yes
4750 if test "$_real_ossaudio" = yes; then
4751 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4752 # Check for OSS4 headers (override default headers)
4753 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
4754 if test -f /etc/oss.conf; then
4755 . /etc/oss.conf
4756 _ossinc="$OSSLIBDIR/include"
4757 if test -f "$_ossinc/sys/soundcard.h"; then
4758 extra_cflags="-I$_ossinc $extra_cflags"
4761 elif netbsd || openbsd ; then
4762 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4763 extra_ldflags="$extra_ldflags -lossaudio"
4764 else
4765 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4767 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4768 else
4769 def_ossaudio='#undef CONFIG_OSS_AUDIO'
4770 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4771 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4772 noaomodules="oss $noaomodules"
4774 echores "$_ossaudio"
4777 echocheck "RSound"
4778 if test "$_rsound" = auto ; then
4779 _rsound=no
4780 statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
4782 echores "$_rsound"
4784 if test "$_rsound" = yes ; then
4785 def_rsound='#define CONFIG_RSOUND 1'
4786 aomodules="rsound $aomodules"
4787 libs_mplayer="$libs_mplayer -lrsound"
4788 else
4789 def_rsound='#undef CONFIG_RSOUND'
4790 noaomodules="rsound $noaomodules"
4794 echocheck "NAS"
4795 if test "$_nas" = auto ; then
4796 _nas=no
4797 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
4799 if test "$_nas" = yes ; then
4800 def_nas='#define CONFIG_NAS 1'
4801 libs_mplayer="$libs_mplayer -laudio -lXt"
4802 aomodules="nas $aomodules"
4803 else
4804 noaomodules="nas $noaomodules"
4805 def_nas='#undef CONFIG_NAS'
4807 echores "$_nas"
4810 echocheck "pulse"
4811 if test "$_pulse" = auto ; then
4812 _pulse=no
4813 if pkg_config_add 'libpulse >= 0.9' ; then
4814 _pulse=yes
4817 echores "$_pulse"
4819 if test "$_pulse" = yes ; then
4820 def_pulse='#define CONFIG_PULSE 1'
4821 aomodules="pulse $aomodules"
4822 else
4823 def_pulse='#undef CONFIG_PULSE'
4824 noaomodules="pulse $noaomodules"
4828 echocheck "PortAudio"
4829 if test "$_portaudio" = auto && test "$_pthreads" != yes ; then
4830 _portaudio=no
4831 res_comment="pthreads not enabled"
4833 if test "$_portaudio" = auto ; then
4834 _portaudio=no
4835 if pkg_config_add 'portaudio-2.0 >= 19' ; then
4836 _portaudio=yes
4839 echores "$_portaudio"
4841 if test "$_portaudio" = yes ; then
4842 def_portaudio='#define CONFIG_PORTAUDIO 1'
4843 aomodules="portaudio $aomodules"
4844 else
4845 def_portaudio='#undef CONFIG_PORTAUDIO'
4846 noaomodules="portaudio $noaomodules"
4850 echocheck "JACK"
4851 if test "$_jack" = auto ; then
4852 _jack=no
4853 if pkg_config_add jack ; then
4854 _jack=yes
4858 if test "$_jack" = yes ; then
4859 def_jack='#define CONFIG_JACK 1'
4860 aomodules="jack $aomodules"
4861 else
4862 noaomodules="jack $noaomodules"
4864 echores "$_jack"
4866 echocheck "OpenAL"
4867 if test "$_openal" = auto ; then
4868 _openal=no
4869 cat > $TMPC << EOF
4870 #ifdef OPENAL_AL_H
4871 #include <OpenAL/al.h>
4872 #else
4873 #include <AL/al.h>
4874 #endif
4875 int main(void) {
4876 alSourceQueueBuffers(0, 0, 0);
4877 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4878 return 0;
4881 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
4882 cc_check $I && _openal=yes && break
4883 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4884 done
4885 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
4887 if test "$_openal" = yes ; then
4888 def_openal='#define CONFIG_OPENAL 1'
4889 aomodules="openal $aomodules"
4890 else
4891 noaomodules="openal $noaomodules"
4893 echores "$_openal"
4895 echocheck "ALSA audio"
4896 if test "$_alloca" != yes ; then
4897 _alsa=no
4898 res_comment="alloca missing"
4900 if test "$_alsa" = auto ; then
4901 _alsa=no
4902 if pkg_config_add "alsa >= 1.0.9" ; then
4903 _alsa=yes
4906 def_alsa='#undef CONFIG_ALSA'
4907 if test "$_alsa" = yes ; then
4908 aomodules="alsa $aomodules"
4909 def_alsa='#define CONFIG_ALSA 1'
4910 else
4911 noaomodules="alsa $noaomodules"
4913 echores "$_alsa"
4916 echocheck "Sun audio"
4917 if test "$_sunaudio" = auto ; then
4918 cat > $TMPC << EOF
4919 #include <sys/types.h>
4920 #include <sys/audioio.h>
4921 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4923 _sunaudio=no
4924 cc_check && _sunaudio=yes
4926 if test "$_sunaudio" = yes ; then
4927 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
4928 aomodules="sun $aomodules"
4929 else
4930 def_sunaudio='#undef CONFIG_SUN_AUDIO'
4931 noaomodules="sun $noaomodules"
4933 echores "$_sunaudio"
4936 if darwin; then
4937 echocheck "CoreAudio"
4938 if test "$_coreaudio" = auto ; then
4939 cat > $TMPC <<EOF
4940 #include <CoreAudio/CoreAudio.h>
4941 #include <AudioToolbox/AudioToolbox.h>
4942 #include <AudioUnit/AudioUnit.h>
4943 int main(void) { return 0; }
4945 _coreaudio=no
4946 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
4948 if test "$_coreaudio" = yes ; then
4949 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
4950 def_coreaudio='#define CONFIG_COREAUDIO 1'
4951 aomodules="coreaudio $aomodules"
4952 else
4953 def_coreaudio='#undef CONFIG_COREAUDIO'
4954 noaomodules="coreaudio $noaomodules"
4956 echores $_coreaudio
4957 fi #if darwin
4960 # set default CD/DVD devices
4961 if win32 ; then
4962 default_cdrom_device="D:"
4963 elif darwin ; then
4964 default_cdrom_device="/dev/disk1"
4965 elif dragonfly ; then
4966 default_cdrom_device="/dev/cd0"
4967 elif freebsd ; then
4968 default_cdrom_device="/dev/acd0"
4969 elif openbsd ; then
4970 default_cdrom_device="/dev/rcd0c"
4971 elif sunos ; then
4972 default_cdrom_device="/vol/dev/aliases/cdrom0"
4973 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
4974 # file system and the volfs service.
4975 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
4976 elif amigaos ; then
4977 default_cdrom_device="a1ide.device:2"
4978 else
4979 default_cdrom_device="/dev/cdrom"
4982 if win32 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
4983 default_dvd_device=$default_cdrom_device
4984 elif darwin ; then
4985 default_dvd_device="/dev/rdiskN"
4986 else
4987 default_dvd_device="/dev/dvd"
4991 echocheck "VCD support"
4992 if test "$_vcd" = auto; then
4993 _vcd=no
4994 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos; then
4995 _vcd=yes
4996 elif mingw32; then
4997 header_check ddk/ntddcdrm.h && _vcd=yes
5000 if test "$_vcd" = yes; then
5001 inputmodules="vcd $inputmodules"
5002 def_vcd='#define CONFIG_VCD 1'
5003 else
5004 def_vcd='#undef CONFIG_VCD'
5005 noinputmodules="vcd $noinputmodules"
5006 res_comment="not supported on this OS"
5008 echores "$_vcd"
5012 echocheck "Blu-ray support"
5013 if test "$_bluray" = auto ; then
5014 _bluray=no
5015 pkg_config_add 'libbluray >= 0.2.1' && _bluray=yes
5017 if test "$_bluray" = yes ; then
5018 def_bluray='#define CONFIG_LIBBLURAY 1'
5019 inputmodules="bluray $inputmodules"
5020 else
5021 def_bluray='#undef CONFIG_LIBBLURAY'
5022 noinputmodules="bluray $noinputmodules"
5024 echores "$_bluray"
5026 echocheck "dvdread"
5027 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5028 _dvdread_internal=no
5030 if test "$_dvdread_internal" = auto ; then
5031 _dvdread_internal=no
5032 _dvdread=no
5033 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) &&
5034 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
5035 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
5036 darwin || win32; then
5037 _dvdread_internal=yes
5038 _dvdread=yes
5039 extra_cflags="-Ilibdvdread4 $extra_cflags"
5041 elif test "$_dvdread" = auto ; then
5042 _dvdread=no
5043 if test "$_dl" = yes; then
5044 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5045 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5046 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5047 _dvdread=yes
5048 extra_cflags="$extra_cflags $_dvdreadcflags"
5049 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5050 res_comment="external"
5055 if test "$_dvdread_internal" = yes; then
5056 def_dvdread='#define CONFIG_DVDREAD 1'
5057 inputmodules="dvdread(internal) $inputmodules"
5058 res_comment="internal"
5059 elif test "$_dvdread" = yes; then
5060 def_dvdread='#define CONFIG_DVDREAD 1'
5061 extra_ldflags="$extra_ldflags -ldvdread"
5062 inputmodules="dvdread(external) $inputmodules"
5063 res_comment="external"
5064 else
5065 def_dvdread='#undef CONFIG_DVDREAD'
5066 noinputmodules="dvdread $noinputmodules"
5068 echores "$_dvdread"
5071 echocheck "internal libdvdcss"
5072 if test "$_libdvdcss_internal" = auto ; then
5073 _libdvdcss_internal=no
5074 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
5075 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5077 if test "$_libdvdcss_internal" = yes ; then
5078 if linux || netbsd || openbsd || bsdos ; then
5079 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5080 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5081 elif freebsd || dragonfly ; then
5082 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5083 elif darwin ; then
5084 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5085 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5086 elif cygwin ; then
5087 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5088 elif beos ; then
5089 cflags_libdvdcss="-DSYS_BEOS"
5091 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5092 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5093 inputmodules="libdvdcss(internal) $inputmodules"
5094 else
5095 noinputmodules="libdvdcss(internal) $noinputmodules"
5097 echores "$_libdvdcss_internal"
5100 echocheck "libcdio"
5101 if test "$_libcdio" = auto ; then
5102 _libcdio=no
5103 if pkg_config_add libcdio_paranoia ; then
5104 _libcdio=yes
5107 if test "$_libcdio" = yes ; then
5108 _cdda='yes'
5109 def_cdda='#define CONFIG_CDDA 1'
5110 test $_cddb = auto && test $networking = yes && _cddb=yes
5111 inputmodules="cdda $inputmodules"
5112 else
5113 _libcdio=no
5114 _cdda='no'
5115 def_cdda='#undef CONFIG_CDDA'
5116 noinputmodules="cdda $noinputmodules"
5118 echores "$_libcdio"
5120 if test "$_cddb" = yes ; then
5121 def_cddb='#define CONFIG_CDDB 1'
5122 inputmodules="cddb $inputmodules"
5123 else
5124 _cddb=no
5125 def_cddb='#undef CONFIG_CDDB'
5126 noinputmodules="cddb $noinputmodules"
5129 echocheck "bitmap font support"
5130 if test "$_bitmap_font" = yes ; then
5131 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5132 else
5133 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5135 echores "$_bitmap_font"
5138 echocheck "freetype >= 2.0.9"
5140 # freetype depends on iconv
5141 if test "$_iconv" = no ; then
5142 _freetype=no
5143 res_comment="iconv support needed"
5146 if test "$_freetype" = auto ; then
5147 if pkg_config_add freetype2 ; then
5148 _freetype=yes
5149 else
5150 die "Unable to find development files for libfreetype. Aborting. If you really mean to compile without FreeType support use --disable-freetype."
5153 if test "$_freetype" = yes ; then
5154 def_freetype='#define CONFIG_FREETYPE 1'
5155 else
5156 def_freetype='#undef CONFIG_FREETYPE'
5158 echores "$_freetype"
5160 if test "$_freetype" = no ; then
5161 _fontconfig=no
5162 res_comment="FreeType support needed"
5164 echocheck "fontconfig"
5165 if test "$_fontconfig" = auto ; then
5166 if pkg_config_add 'fontconfig >= 2.4.2' ; then
5167 _fontconfig=yes
5168 else
5169 die "Unable to find development files for libfontconfig. Aborting. If you really mean to compile without fontconfig support use --disable-fontconfig."
5172 if test "$_fontconfig" = yes ; then
5173 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5174 else
5175 def_fontconfig='#undef CONFIG_FONTCONFIG'
5177 echores "$_fontconfig"
5180 echocheck "SSA/ASS support"
5181 if test "$_ass" = auto ; then
5182 if pkg_config_add libass ; then
5183 _ass=yes
5184 def_ass='#define CONFIG_ASS 1'
5185 else
5186 die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
5188 else
5189 def_ass='#undef CONFIG_ASS'
5191 echores "$_ass"
5194 echocheck "fribidi with charsets"
5195 if test "$_fribidi" = auto ; then
5196 _fribidi=no
5197 if pkg_config_add fribidi ; then
5198 _fribidi=yes
5201 if test "$_fribidi" = yes ; then
5202 def_fribidi='#define CONFIG_FRIBIDI 1'
5203 else
5204 def_fribidi='#undef CONFIG_FRIBIDI'
5206 echores "$_fribidi"
5209 echocheck "ENCA"
5210 if test "$_enca" = auto ; then
5211 _enca=no
5212 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
5214 if test "$_enca" = yes ; then
5215 def_enca='#define CONFIG_ENCA 1'
5216 extra_ldflags="$extra_ldflags -lenca"
5217 else
5218 def_enca='#undef CONFIG_ENCA'
5220 echores "$_enca"
5223 echocheck "zlib"
5224 _zlib=no
5225 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5226 if test "$_zlib" = yes ; then
5227 def_zlib='#define CONFIG_ZLIB 1'
5228 extra_ldflags="$extra_ldflags -lz"
5229 else
5230 def_zlib='#define CONFIG_ZLIB 0'
5232 echores "$_zlib"
5235 echocheck "RTC"
5236 if test "$_rtc" = auto ; then
5237 cat > $TMPC << EOF
5238 #include <sys/ioctl.h>
5239 #ifdef __linux__
5240 #include <linux/rtc.h>
5241 #else
5242 #include <rtc.h>
5243 #define RTC_PIE_ON RTCIO_PIE_ON
5244 #endif
5245 int main(void) { return RTC_PIE_ON; }
5247 _rtc=no
5248 cc_check && _rtc=yes
5249 ppc && _rtc=no
5251 if test "$_rtc" = yes ; then
5252 def_rtc='#define HAVE_RTC 1'
5253 else
5254 def_rtc='#undef HAVE_RTC'
5256 echores "$_rtc"
5259 echocheck "mad support"
5260 if test "$_mad" = auto ; then
5261 _mad=no
5262 header_check mad.h -lmad && _mad=yes
5264 if test "$_mad" = yes ; then
5265 def_mad='#define CONFIG_LIBMAD 1'
5266 extra_ldflags="$extra_ldflags -lmad"
5267 codecmodules="libmad $codecmodules"
5268 else
5269 def_mad='#undef CONFIG_LIBMAD'
5270 nocodecmodules="libmad $nocodecmodules"
5272 echores "$_mad"
5274 echocheck "OggVorbis support"
5275 if test "$_libvorbis" = auto; then
5276 _libvorbis=no
5277 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes && _tremor=no
5278 elif test "$_libvorbis" = yes ; then
5279 _tremor=no
5281 if test "$_tremor" = auto; then
5282 _tremor=no
5283 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes
5285 if test "$_tremor" = yes ; then
5286 _vorbis=yes
5287 def_vorbis='#define CONFIG_OGGVORBIS 1'
5288 def_tremor='#define CONFIG_TREMOR 1'
5289 codecmodules="tremor(external) $codecmodules"
5290 res_comment="external Tremor"
5291 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
5292 elif test "$_libvorbis" = yes ; then
5293 _vorbis=yes
5294 def_vorbis='#define CONFIG_OGGVORBIS 1'
5295 codecmodules="libvorbis $codecmodules"
5296 res_comment="libvorbis"
5297 extra_ldflags="$extra_ldflags -lvorbis -logg"
5298 else
5299 _vorbis=no
5300 nocodecmodules="libvorbis $nocodecmodules"
5302 echores "$_vorbis"
5304 echocheck "libspeex (version >= 1.1 required)"
5305 if test "$_speex" = auto ; then
5306 _speex=no
5307 cat > $TMPC << EOF
5308 #include <stddef.h>
5309 #include <speex/speex.h>
5310 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5312 cc_check -lspeex $_ld_lm && _speex=yes
5314 if test "$_speex" = yes ; then
5315 def_speex='#define CONFIG_SPEEX 1'
5316 extra_ldflags="$extra_ldflags -lspeex"
5317 codecmodules="speex $codecmodules"
5318 else
5319 def_speex='#undef CONFIG_SPEEX'
5320 nocodecmodules="speex $nocodecmodules"
5322 echores "$_speex"
5324 echocheck "OggTheora support"
5325 if test "$_theora" = auto ; then
5326 _theora=no
5327 if pkg_config_add theora ; then
5328 _theora=yes
5331 if test "$_theora" = yes ; then
5332 def_theora='#define CONFIG_OGGTHEORA 1'
5333 codecmodules="libtheora $codecmodules"
5334 else
5335 def_theora='#undef CONFIG_OGGTHEORA'
5336 nocodecmodules="libtheora $nocodecmodules"
5338 echores "$_theora"
5340 # Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
5341 # That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
5342 echocheck "mpg123 support"
5343 def_mpg123='#undef CONFIG_MPG123'
5344 if test "$_mpg123" = auto; then
5345 _mpg123=no
5346 pkg_config_add 'libmpg123 >= 1.2.0' && _mpg123=yes
5348 if test "$_mpg123" = yes ; then
5349 def_mpg123='#define CONFIG_MPG123 1'
5350 codecmodules="mpg123 $codecmodules"
5351 else
5352 nocodecmodules="mpg123 $nocodecmodules"
5354 echores "$_mpg123"
5356 echocheck "liba52 support"
5357 def_liba52='#undef CONFIG_LIBA52'
5358 if test "$_liba52" = auto ; then
5359 _liba52=no
5360 cat > $TMPC << EOF
5361 #include <inttypes.h>
5362 #include <a52dec/a52.h>
5363 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
5365 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
5367 if test "$_liba52" = yes ; then
5368 def_liba52='#define CONFIG_LIBA52 1'
5369 codecmodules="liba52 $codecmodules"
5370 else
5371 nocodecmodules="liba52 $nocodecmodules"
5373 echores "$_liba52"
5375 echocheck "libdca support"
5376 if test "$_libdca" = auto ; then
5377 _libdca=no
5378 for _ld_dca in -ldca -ldts ; do
5379 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
5380 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
5381 done
5383 if test "$_libdca" = yes ; then
5384 def_libdca='#define CONFIG_LIBDCA 1'
5385 codecmodules="libdca $codecmodules"
5386 else
5387 def_libdca='#undef CONFIG_LIBDCA'
5388 nocodecmodules="libdca $nocodecmodules"
5390 echores "$_libdca"
5392 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5393 if test "$_musepack" = yes ; then
5394 _musepack=no
5395 cat > $TMPC << EOF
5396 #include <stddef.h>
5397 #include <mpcdec/mpcdec.h>
5398 int main(void) {
5399 mpc_streaminfo info;
5400 mpc_decoder decoder;
5401 mpc_decoder_set_streaminfo(&decoder, &info);
5402 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5403 return 0;
5406 cc_check -lmpcdec $_ld_lm && _musepack=yes
5408 if test "$_musepack" = yes ; then
5409 def_musepack='#define CONFIG_MUSEPACK 1'
5410 extra_ldflags="$extra_ldflags -lmpcdec"
5411 codecmodules="musepack $codecmodules"
5412 else
5413 def_musepack='#undef CONFIG_MUSEPACK'
5414 nocodecmodules="musepack $nocodecmodules"
5416 echores "$_musepack"
5419 echocheck "FAAD2 support"
5420 if test "$_faad" = auto ; then
5421 _faad=no
5422 cat > $TMPC << EOF
5423 #include <faad.h>
5424 #ifndef FAAD_MIN_STREAMSIZE
5425 #error Too old version
5426 #endif
5427 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
5428 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5430 cc_check -lfaad $_ld_lm && _faad=yes
5433 def_faad='#undef CONFIG_FAAD'
5434 if test "$_faad" = yes ; then
5435 def_faad='#define CONFIG_FAAD 1'
5436 extra_ldflags="$extra_ldflags -lfaad"
5437 codecmodules="faad2 $codecmodules"
5438 else
5439 nocodecmodules="faad2 $nocodecmodules"
5441 echores "$_faad"
5444 echocheck "LADSPA plugin support"
5445 if test "$_ladspa" = auto ; then
5446 _ladspa=no
5447 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
5449 if test "$_ladspa" = yes; then
5450 def_ladspa="#define CONFIG_LADSPA 1"
5451 else
5452 def_ladspa="#undef CONFIG_LADSPA"
5454 echores "$_ladspa"
5457 echocheck "libbs2b audio filter support"
5458 if test "$_libbs2b" = auto ; then
5459 _libbs2b=no
5460 if pkg_config_add libbs2b ; then
5461 _libbs2b=yes
5464 def_libbs2b="#undef CONFIG_LIBBS2B"
5465 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
5466 echores "$_libbs2b"
5469 if test -z "$_codecsdir" ; then
5470 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5471 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5472 if test -d "$dir" ; then
5473 _codecsdir="$dir"
5474 break;
5476 done
5478 # Fall back on default directory.
5479 if test -z "$_codecsdir" ; then
5480 _codecsdir="$_libdir/codecs"
5481 mingw32 && _codecsdir="codecs"
5485 echocheck "Win32 codecs"
5486 if test "$_win32dll" = auto ; then
5487 _win32dll=no
5488 if x86_32 && ! qnx; then
5489 _win32dll=yes
5492 if test "$_win32dll" = yes ; then
5493 def_win32dll='#define CONFIG_WIN32DLL 1'
5494 if ! win32 ; then
5495 def_win32_loader='#define WIN32_LOADER 1'
5496 _win32_emulation=yes
5497 else
5498 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
5499 res_comment="using native windows"
5501 codecmodules="win32 $codecmodules"
5502 else
5503 def_win32dll='#undef CONFIG_WIN32DLL'
5504 def_win32_loader='#undef WIN32_LOADER'
5505 nocodecmodules="win32 $nocodecmodules"
5507 echores "$_win32dll"
5510 echocheck "XAnim codecs"
5511 if test "$_xanim" = auto ; then
5512 _xanim=no
5513 res_comment="dynamic loader support needed"
5514 if test "$_dl" = yes ; then
5515 _xanim=yes
5518 if test "$_xanim" = yes ; then
5519 def_xanim='#define CONFIG_XANIM 1'
5520 codecmodules="xanim $codecmodules"
5521 else
5522 def_xanim='#undef CONFIG_XANIM'
5523 nocodecmodules="xanim $nocodecmodules"
5525 echores "$_xanim"
5528 echocheck "RealPlayer codecs"
5529 if test "$_real" = auto ; then
5530 _real=no
5531 res_comment="dynamic loader support needed"
5532 if test "$_dl" = yes || test "$_win32dll" = yes &&
5533 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
5534 _real=yes
5537 if test "$_real" = yes ; then
5538 def_real='#define CONFIG_REALCODECS 1'
5539 codecmodules="real $codecmodules"
5540 else
5541 def_real='#undef CONFIG_REALCODECS'
5542 nocodecmodules="real $nocodecmodules"
5544 echores "$_real"
5547 echocheck "QuickTime codecs"
5548 _qtx_emulation=no
5549 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
5550 if test "$_qtx" = auto ; then
5551 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
5553 if test "$_qtx" = yes ; then
5554 def_qtx='#define CONFIG_QTX_CODECS 1'
5555 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
5556 codecmodules="qtx $codecmodules"
5557 darwin || win32 || _qtx_emulation=yes
5558 else
5559 def_qtx='#undef CONFIG_QTX_CODECS'
5560 nocodecmodules="qtx $nocodecmodules"
5562 echores "$_qtx"
5564 echocheck "Nemesi Streaming Media libraries"
5565 if test "$_nemesi" = auto && test "$networking" = yes ; then
5566 _nemesi=no
5567 if pkg_config_add libnemesi ; then
5568 _nemesi=yes
5571 if test "$_nemesi" = yes; then
5572 _native_rtsp=no
5573 def_nemesi='#define CONFIG_LIBNEMESI 1'
5574 inputmodules="nemesi $inputmodules"
5575 else
5576 _native_rtsp="$networking"
5577 _nemesi=no
5578 def_nemesi='#undef CONFIG_LIBNEMESI'
5579 noinputmodules="nemesi $noinputmodules"
5581 echores "$_nemesi"
5583 echocheck "LIVE555 Streaming Media libraries"
5584 if test "$_live" != no && test "$networking" = yes ; then
5585 cat > $TMPCPP << EOF
5586 #include <liveMedia.hh>
5587 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
5588 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5589 #endif
5590 int main(void) { return 0; }
5593 _live=no
5594 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
5595 cxx_check $I/liveMedia/include $I/UsageEnvironment/include $I/groupsock/include &&
5596 _livelibdir=$(echo $I| sed s/-I//) &&
5597 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
5598 $_livelibdir/groupsock/libgroupsock.a \
5599 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
5600 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
5601 $extra_ldflags -lstdc++" \
5602 extra_cxxflags="-I$_livelibdir/liveMedia/include \
5603 -I$_livelibdir/UsageEnvironment/include \
5604 -I$_livelibdir/BasicUsageEnvironment/include \
5605 -I$_livelibdir/groupsock/include" &&
5606 _live=yes && break
5607 done
5608 if test "$_live" != yes ; then
5609 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
5610 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
5611 _live_dist=yes
5615 if test "$_live" = yes && test "$networking" = yes; then
5616 test $_livelibdir && res_comment="using $_livelibdir"
5617 def_live='#define CONFIG_LIVE555 1'
5618 inputmodules="live555 $inputmodules"
5619 elif test "$_live_dist" = yes && test "$networking" = yes; then
5620 res_comment="using distribution version"
5621 _live="yes"
5622 def_live='#define CONFIG_LIVE555 1'
5623 extra_ldflags="$extra_ldflags $ld_tmp"
5624 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
5625 inputmodules="live555 $inputmodules"
5626 else
5627 _live=no
5628 def_live='#undef CONFIG_LIVE555'
5629 noinputmodules="live555 $noinputmodules"
5631 echores "$_live"
5635 # Test with > against Libav 0.8 versions which will NOT work rather than
5636 # specify minimum version, to allow (future) point releases to possibly work.
5637 all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
5638 echocheck "Libav ($all_libav_libs)"
5639 if test "$ffmpeg" = auto ; then
5640 IFS=":" # shell should not be used for programming
5641 if ! pkg_config_add $all_libav_libs ; then
5642 die "Unable to find development files for some of the required Libav libraries above. Aborting."
5645 echores "yes"
5647 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
5648 if ! test -z "$_ffmpeg_source" ; then
5649 def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
5652 echocheck "libpostproc >= 52.0.0"
5653 if test "$libpostproc" = auto ; then
5654 libpostproc=no
5655 if pkg_config_add "libpostproc >= 52.0.0" ; then
5656 libpostproc=yes
5659 if test "$libpostproc" = yes ; then
5660 def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
5661 else
5662 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
5664 echores "$libpostproc"
5667 echocheck "libdv-0.9.5+"
5668 if test "$_libdv" = auto ; then
5669 _libdv=no
5670 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
5672 if test "$_libdv" = yes ; then
5673 def_libdv='#define CONFIG_LIBDV095 1'
5674 extra_ldflags="$extra_ldflags -ldv"
5675 codecmodules="libdv $codecmodules"
5676 else
5677 def_libdv='#undef CONFIG_LIBDV095'
5678 nocodecmodules="libdv $nocodecmodules"
5680 echores "$_libdv"
5683 echocheck "Xvid"
5684 if test "$_xvid" = auto ; then
5685 _xvid=no
5686 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
5687 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
5688 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
5689 done
5692 if test "$_xvid" = yes ; then
5693 def_xvid='#define CONFIG_XVID4 1'
5694 codecmodules="xvid $codecmodules"
5695 else
5696 def_xvid='#undef CONFIG_XVID4'
5697 nocodecmodules="xvid $nocodecmodules"
5699 echores "$_xvid"
5702 echocheck "libnut"
5703 if test "$_libnut" = auto ; then
5704 _libnut=no
5705 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
5708 if test "$_libnut" = yes ; then
5709 def_libnut='#define CONFIG_LIBNUT 1'
5710 extra_ldflags="$extra_ldflags -lnut"
5711 else
5712 def_libnut='#undef CONFIG_LIBNUT'
5714 echores "$_libnut"
5716 # These VO checks must be done after the FFmpeg one
5717 echocheck "/dev/mga_vid"
5718 if test "$_mga" = auto ; then
5719 _mga=no
5720 test -c /dev/mga_vid && _mga=yes
5722 if test "$_mga" = yes ; then
5723 def_mga='#define CONFIG_MGA 1'
5724 vomodules="mga $vomodules"
5725 else
5726 def_mga='#undef CONFIG_MGA'
5727 novomodules="mga $novomodules"
5729 echores "$_mga"
5732 echocheck "xmga"
5733 if test "$_xmga" = auto ; then
5734 _xmga=no
5735 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
5737 if test "$_xmga" = yes ; then
5738 def_xmga='#define CONFIG_XMGA 1'
5739 vomodules="xmga $vomodules"
5740 else
5741 def_xmga='#undef CONFIG_XMGA'
5742 novomodules="xmga $novomodules"
5744 echores "$_xmga"
5747 echocheck "UnRAR executable"
5748 if test "$_unrar_exec" = auto ; then
5749 _unrar_exec="yes"
5750 mingw32 && _unrar_exec="no"
5752 if test "$_unrar_exec" = yes ; then
5753 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
5754 else
5755 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
5757 echores "$_unrar_exec"
5759 echocheck "TV interface"
5760 if test "$_tv" = yes ; then
5761 def_tv='#define CONFIG_TV 1'
5762 inputmodules="tv $inputmodules"
5763 else
5764 noinputmodules="tv $noinputmodules"
5765 def_tv='#undef CONFIG_TV'
5767 echores "$_tv"
5770 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
5771 echocheck "*BSD BT848 bt8xx header"
5772 _ioctl_bt848_h=no
5773 for file in "machine/ioctl_bt848.h" \
5774 "dev/bktr/ioctl_bt848.h" \
5775 "dev/video/bktr/ioctl_bt848.h" \
5776 "dev/ic/bt8xx.h" ; do
5777 cat > $TMPC <<EOF
5778 #include <sys/types.h>
5779 #include <sys/ioctl.h>
5780 #include <$file>
5781 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
5783 if cc_check ; then
5784 _ioctl_bt848_h=yes
5785 _ioctl_bt848_h_name="$file"
5786 break;
5788 done
5789 if test "$_ioctl_bt848_h" = yes ; then
5790 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
5791 res_comment="using $_ioctl_bt848_h_name"
5792 else
5793 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
5795 echores "$_ioctl_bt848_h"
5797 echocheck "*BSD ioctl_meteor.h"
5798 _ioctl_meteor_h=no
5799 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
5800 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
5801 _ioctl_meteor_h=yes && break
5802 done
5803 if test "$_ioctl_meteor_h" = yes ; then
5804 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
5805 res_comment="using $ioctl_meteor_h_path"
5806 else
5807 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
5809 echores "$_ioctl_meteor_h"
5811 echocheck "*BSD BrookTree 848 TV interface"
5812 if test "$_tv_bsdbt848" = auto ; then
5813 _tv_bsdbt848=no
5814 if test "$_tv" = yes ; then
5815 cat > $TMPC <<EOF
5816 #include <sys/types.h>
5817 $def_ioctl_meteor_h_name
5818 $def_ioctl_bt848_h_name
5819 #ifdef IOCTL_METEOR_H_NAME
5820 #include IOCTL_METEOR_H_NAME
5821 #endif
5822 #ifdef IOCTL_BT848_H_NAME
5823 #include IOCTL_BT848_H_NAME
5824 #endif
5825 int main(void) {
5826 ioctl(0, METEORSINPUT, 0);
5827 ioctl(0, TVTUNER_GETFREQ, 0);
5828 return 0;
5831 cc_check && _tv_bsdbt848=yes
5834 if test "$_tv_bsdbt848" = yes ; then
5835 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
5836 inputmodules="tv-bsdbt848 $inputmodules"
5837 else
5838 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
5839 noinputmodules="tv-bsdbt848 $noinputmodules"
5841 echores "$_tv_bsdbt848"
5842 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
5845 echocheck "DirectShow TV interface"
5846 if test "$_tv_dshow" = auto ; then
5847 _tv_dshow=no
5848 if test "$_tv" = yes && win32 ; then
5849 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
5852 if test "$_tv_dshow" = yes ; then
5853 inputmodules="tv-dshow $inputmodules"
5854 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
5855 extra_ldflags="$extra_ldflags -lole32 -luuid"
5856 else
5857 noinputmodules="tv-dshow $noinputmodules"
5858 def_tv_dshow='#undef CONFIG_TV_DSHOW'
5860 echores "$_tv_dshow"
5863 echocheck "Video 4 Linux TV interface"
5864 if test "$_tv_v4l1" = auto ; then
5865 _tv_v4l1=no
5866 if test "$_tv" = yes && linux ; then
5867 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
5870 if test "$_tv_v4l1" = yes ; then
5871 _audio_input=yes
5872 _tv_v4l=yes
5873 def_tv_v4l='#define CONFIG_TV_V4L 1'
5874 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
5875 inputmodules="tv-v4l $inputmodules"
5876 else
5877 noinputmodules="tv-v4l1 $noinputmodules"
5878 def_tv_v4l='#undef CONFIG_TV_V4L'
5880 echores "$_tv_v4l1"
5883 echocheck "Video 4 Linux 2 TV interface"
5884 if test "$_tv_v4l2" = auto ; then
5885 _tv_v4l2=no
5886 if test "$_tv" = yes && linux ; then
5887 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
5888 elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
5889 _tv_v4l2=yes
5892 if test "$_tv_v4l2" = yes ; then
5893 _audio_input=yes
5894 _tv_v4l=yes
5895 def_tv_v4l='#define CONFIG_TV_V4L 1'
5896 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
5897 inputmodules="tv-v4l2 $inputmodules"
5898 else
5899 noinputmodules="tv-v4l2 $noinputmodules"
5900 def_tv_v4l2='#undef CONFIG_TV_V4L2'
5902 echores "$_tv_v4l2"
5905 echocheck "Radio interface"
5906 if test "$_radio" = yes ; then
5907 def_radio='#define CONFIG_RADIO 1'
5908 inputmodules="radio $inputmodules"
5909 if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
5910 _radio_capture=no
5912 if test "$_radio_capture" = yes ; then
5913 _audio_input=yes
5914 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
5915 else
5916 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5918 else
5919 noinputmodules="radio $noinputmodules"
5920 def_radio='#undef CONFIG_RADIO'
5921 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
5922 _radio_capture=no
5924 echores "$_radio"
5925 echocheck "Capture for Radio interface"
5926 echores "$_radio_capture"
5928 echocheck "Video 4 Linux 2 Radio interface"
5929 if test "$_radio_v4l2" = auto ; then
5930 _radio_v4l2=no
5931 if test "$_radio" = yes && linux ; then
5932 header_check linux/videodev2.h && _radio_v4l2=yes
5935 if test "$_radio_v4l2" = yes ; then
5936 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
5937 else
5938 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
5940 echores "$_radio_v4l2"
5942 echocheck "Video 4 Linux Radio interface"
5943 if test "$_radio_v4l" = auto ; then
5944 _radio_v4l=no
5945 if test "$_radio" = yes && linux ; then
5946 header_check linux/videodev.h && _radio_v4l=yes
5949 if test "$_radio_v4l" = yes ; then
5950 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
5951 else
5952 def_radio_v4l='#undef CONFIG_RADIO_V4L'
5954 echores "$_radio_v4l"
5956 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
5957 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
5958 echocheck "*BSD BrookTree 848 Radio interface"
5959 _radio_bsdbt848=no
5960 cat > $TMPC <<EOF
5961 #include <sys/types.h>
5962 $def_ioctl_bt848_h_name
5963 #ifdef IOCTL_BT848_H_NAME
5964 #include IOCTL_BT848_H_NAME
5965 #endif
5966 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
5968 cc_check && _radio_bsdbt848=yes
5969 echores "$_radio_bsdbt848"
5970 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
5972 if test "$_radio_bsdbt848" = yes ; then
5973 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
5974 else
5975 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
5978 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
5979 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
5980 die "Radio driver requires BSD BT848, V4L or V4L2!"
5983 echocheck "Video 4 Linux 2 MPEG PVR interface"
5984 if test "$_pvr" = auto ; then
5985 _pvr=no
5986 if test "$_tv_v4l2" = yes && linux ; then
5987 cat > $TMPC <<EOF
5988 #include <sys/time.h>
5989 #include <linux/videodev2.h>
5990 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
5992 cc_check && _pvr=yes
5995 if test "$_pvr" = yes ; then
5996 def_pvr='#define CONFIG_PVR 1'
5997 inputmodules="pvr $inputmodules"
5998 else
5999 noinputmodules="pvr $noinputmodules"
6000 def_pvr='#undef CONFIG_PVR'
6002 echores "$_pvr"
6005 echocheck "ftp"
6006 if test "$_ftp" = "auto" ; then
6007 test "$networking" = "yes" && ! beos && _ftp=yes
6009 if test "$_ftp" = yes ; then
6010 def_ftp='#define CONFIG_FTP 1'
6011 inputmodules="ftp $inputmodules"
6012 else
6013 noinputmodules="ftp $noinputmodules"
6014 def_ftp='#undef CONFIG_FTP'
6016 echores "$_ftp"
6018 echocheck "vstream client"
6019 if test "$_vstream" = auto ; then
6020 _vstream=no
6021 cat > $TMPC <<EOF
6022 #include <vstream-client.h>
6023 void vstream_error(const char *format, ... ) {}
6024 int main(void) { vstream_start(); return 0; }
6026 cc_check -lvstream-client && _vstream=yes
6028 if test "$_vstream" = yes ; then
6029 def_vstream='#define CONFIG_VSTREAM 1'
6030 inputmodules="vstream $inputmodules"
6031 extra_ldflags="$extra_ldflags -lvstream-client"
6032 else
6033 noinputmodules="vstream $noinputmodules"
6034 def_vstream='#undef CONFIG_VSTREAM'
6036 echores "$_vstream"
6039 echocheck "Subtitles sorting"
6040 if test "$_sortsub" = yes ; then
6041 def_sortsub='#define CONFIG_SORTSUB 1'
6042 else
6043 def_sortsub='#undef CONFIG_SORTSUB'
6045 echores "$_sortsub"
6048 echocheck "XMMS inputplugin support"
6049 if test "$_xmms" = yes ; then
6050 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6051 _xmmsplugindir=$(xmms-config --input-plugin-dir)
6052 _xmmslibdir=$(xmms-config --exec-prefix)/lib
6053 else
6054 _xmmsplugindir=/usr/lib/xmms/Input
6055 _xmmslibdir=/usr/lib
6058 def_xmms='#define CONFIG_XMMS 1'
6059 if darwin ; then
6060 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6061 else
6062 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6064 else
6065 def_xmms='#undef CONFIG_XMMS'
6067 echores "$_xmms"
6069 if test "$_charset" != "noconv" ; then
6070 def_charset="#define MSG_CHARSET \"$_charset\""
6071 else
6072 def_charset="#undef MSG_CHARSET"
6073 _charset="UTF-8"
6076 #############################################################################
6078 echocheck "automatic gdb attach"
6079 if test "$_crash_debug" = yes ; then
6080 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
6081 else
6082 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
6083 _crash_debug=no
6085 echores "$_crash_debug"
6087 echocheck "compiler support for noexecstack"
6088 if cflag_check -Wl,-z,noexecstack ; then
6089 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
6090 echores "yes"
6091 else
6092 echores "no"
6095 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
6096 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6097 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6098 echores "yes"
6099 else
6100 echores "no"
6104 # Dynamic linking flags
6105 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6106 _ld_dl_dynamic=''
6107 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
6108 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! sunos; then
6109 _ld_dl_dynamic='-rdynamic'
6112 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6113 bsdos && extra_ldflags="$extra_ldflags -ldvd"
6114 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
6116 def_debug='#undef MP_DEBUG'
6117 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
6120 echocheck "joystick"
6121 def_joystick='#undef CONFIG_JOYSTICK'
6122 if test "$_joystick" = yes ; then
6123 if linux || freebsd ; then
6124 # TODO add some check
6125 def_joystick='#define CONFIG_JOYSTICK 1'
6126 else
6127 _joystick="no"
6128 res_comment="unsupported under $system_name"
6131 echores "$_joystick"
6133 echocheck "lirc"
6134 if test "$_lirc" = auto ; then
6135 _lirc=no
6136 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
6138 if test "$_lirc" = yes ; then
6139 def_lirc='#define CONFIG_LIRC 1'
6140 libs_mplayer="$libs_mplayer -llirc_client"
6141 else
6142 def_lirc='#undef CONFIG_LIRC'
6144 echores "$_lirc"
6146 echocheck "lircc"
6147 if test "$_lircc" = auto ; then
6148 _lircc=no
6149 header_check lirc/lircc.h -llircc && _lircc=yes
6151 if test "$_lircc" = yes ; then
6152 def_lircc='#define CONFIG_LIRCC 1'
6153 libs_mplayer="$libs_mplayer -llircc"
6154 else
6155 def_lircc='#undef CONFIG_LIRCC'
6157 echores "$_lircc"
6159 #############################################################################
6161 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
6163 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
6165 # This must be the last test to be performed. Any other tests following it
6166 # could fail due to linker errors. libdvdnavmini is intentionally not linked
6167 # against libdvdread (to permit MPlayer to use its own copy of the library).
6168 # So any compilation using the flags added here but not linking against
6169 # libdvdread can fail.
6170 echocheck "DVD support (libdvdnav)"
6171 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
6172 _dvdnav=no
6174 dvdnav_internal=no
6175 if test "$_dvdnav" = auto ; then
6176 if test "$_dvdread_internal" = yes ; then
6177 _dvdnav=yes
6178 dvdnav_internal=yes
6179 res_comment="internal"
6180 else
6181 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
6184 if test "$_dvdnav" = auto ; then
6185 _dvdnav=no
6186 _dvdnavdir=$($_dvdnavconfig --cflags)
6187 _dvdnavlibs=$($_dvdnavconfig --libs)
6188 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
6190 if test "$_dvdnav" = yes ; then
6191 def_dvdnav='#define CONFIG_DVDNAV 1'
6192 if test "$dvdnav_internal" = yes ; then
6193 cflags_libdvdnav="-Ilibdvdnav"
6194 inputmodules="dvdnav(internal) $inputmodules"
6195 else
6196 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
6197 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
6198 inputmodules="dvdnav $inputmodules"
6200 else
6201 def_dvdnav='#undef CONFIG_DVDNAV'
6202 noinputmodules="dvdnav $noinputmodules"
6204 echores "$_dvdnav"
6206 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
6207 # Read dvdnav comment above.
6209 mak_enable () {
6210 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6211 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6212 nprefix=$3;
6213 for part in $list; do
6214 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6215 echo "${nprefix}_$part = yes"
6217 done
6220 #############################################################################
6221 echo "Creating config.mak"
6222 cat > config.mak << EOF
6223 # -------- Generated by configure -----------
6225 # Ensure that locale settings do not interfere with shell commands.
6226 export LC_ALL = C
6228 CONFIGURATION = $configuration
6230 CHARSET = $_charset
6231 DOC_LANGS = $language_doc
6232 DOC_LANG_ALL = $doc_lang_all
6233 MAN_LANGS = $language_man
6234 MAN_LANG_ALL = $man_lang_all
6235 MSG_LANGS = $language_msg
6236 MSG_LANG_ALL = $msg_lang_all
6238 prefix = \$(DESTDIR)$_prefix
6239 BINDIR = \$(DESTDIR)$_bindir
6240 DATADIR = \$(DESTDIR)$_datadir
6241 LIBDIR = \$(DESTDIR)$_libdir
6242 MANDIR = \$(DESTDIR)$_mandir
6243 CONFDIR = \$(DESTDIR)$_confdir
6244 LOCALEDIR = \$(DESTDIR)$_localedir
6246 AR = $_ar
6247 AS = $_cc
6248 CC = $_cc
6249 CXX = $_cc
6250 INSTALL = $_install
6251 INSTALLSTRIP = $_install_strip
6252 WINDRES = $_windres
6254 CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
6255 CXXFLAGS = $WARNFLAGS $ERRORFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
6256 DEPFLAGS = $DEPFLAGS
6258 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
6259 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
6260 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
6261 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
6262 CFLAGS_STACKREALIGN = $cflags_stackrealign
6264 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
6265 EXTRALIBS_MPLAYER = $libs_mplayer
6267 GETCH = $_getch
6268 TIMER = $_timer
6270 EXESUF = $_exesuf
6271 EXESUFS_ALL = .exe
6273 ARCH = $arch
6274 $(mak_enable "$arch_all" "$arch" ARCH)
6275 $(mak_enable "$subarch_all" "$subarch" ARCH)
6276 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
6278 MPLAYER = $_mplayer
6280 NEED_GETTIMEOFDAY = $need_gettimeofday
6281 NEED_GLOB = $need_glob
6282 NEED_SETENV = $need_setenv
6283 NEED_SHMEM = $need_shmem
6284 NEED_STRSEP = $need_strsep
6285 NEED_SWAB = $need_swab
6286 NEED_VSSCANF = $need_vsscanf
6288 # features
6289 3DFX = $_3dfx
6290 AA = $_aa
6291 ALSA = $_alsa
6292 APPLE_IR = $_apple_ir
6293 APPLE_REMOTE = $_apple_remote
6294 AUDIO_INPUT = $_audio_input
6295 BITMAP_FONT = $_bitmap_font
6296 BL = $_bl
6297 CACA = $_caca
6298 CDDA = $_cdda
6299 CDDB = $_cddb
6300 COCOA = $_cocoa
6301 COREAUDIO = $_coreaudio
6302 COREVIDEO = $_corevideo
6303 SHAREDBUFFER = $_sharedbuffer
6304 DGA = $_dga
6305 DIRECT3D = $_direct3d
6306 DIRECTFB = $_directfb
6307 DIRECTX = $_directx
6308 DVBIN = $_dvbin
6309 DVDNAV = $_dvdnav
6310 DVDNAV_INTERNAL = $dvdnav_internal
6311 DVDREAD = $_dvdread
6312 DVDREAD_INTERNAL = $_dvdread_internal
6313 DXR3 = $_dxr3
6314 FAAD = $_faad
6315 FASTMEMCPY = $_fastmemcpy
6316 FBDEV = $_fbdev
6317 FREETYPE = $_freetype
6318 FTP = $_ftp
6319 GIF = $_gif
6320 GGI = $_ggi
6321 GL = $_gl
6322 GL_COCOA = $_gl_cocoa
6323 GL_WIN32 = $_gl_win32
6324 GL_X11 = $_gl_x11
6325 GL_SDL = $_gl_sdl
6326 HAVE_POSIX_SELECT = $_posix_select
6327 HAVE_SYS_MMAN_H = $_mman
6328 IVTV = $_ivtv
6329 JACK = $_jack
6330 JOYSTICK = $_joystick
6331 JPEG = $_jpeg
6332 LADSPA = $_ladspa
6333 LIBA52 = $_liba52
6334 LIBASS = $_ass
6335 LIBBLURAY = $_bluray
6336 LIBBS2B = $_libbs2b
6337 LIBDCA = $_libdca
6338 LIBDV = $_libdv
6339 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
6340 LIBMAD = $_mad
6341 LIBNEMESI = $_nemesi
6342 LIBNUT = $_libnut
6343 LIBPOSTPROC = $libpostproc
6344 LIBSMBCLIENT = $_smb
6345 LIBQUVI = $_libquvi
6346 LIBTHEORA = $_theora
6347 LIRC = $_lirc
6348 LIVE555 = $_live
6349 MACOSX_FINDER = $_macosx_finder
6350 MD5SUM = $_md5sum
6351 MGA = $_mga
6352 MNG = $_mng
6353 MPG123 = $_mpg123
6354 MUSEPACK = $_musepack
6355 NAS = $_nas
6356 NATIVE_RTSP = $_native_rtsp
6357 NETWORKING = $networking
6358 OPENAL = $_openal
6359 OSS = $_ossaudio
6360 PE_EXECUTABLE = $_pe_executable
6361 PNG = $_png
6362 PNM = $_pnm
6363 PRIORITY = $_priority
6364 PULSE = $_pulse
6365 PORTAUDIO = $_portaudio
6366 PVR = $_pvr
6367 QTX_CODECS = $_qtx
6368 QTX_CODECS_WIN32 = $_qtx_codecs_win32
6369 QTX_EMULATION = $_qtx_emulation
6370 RADIO=$_radio
6371 RADIO_CAPTURE=$_radio_capture
6372 REAL_CODECS = $_real
6373 RSOUND = $_rsound
6374 S3FB = $_s3fb
6375 SDL = $_sdl
6376 SPEEX = $_speex
6377 STREAM_CACHE = $_stream_cache
6378 SUNAUDIO = $_sunaudio
6379 SVGA = $_svga
6380 TDFXFB = $_tdfxfb
6381 TDFXVID = $_tdfxvid
6382 TGA = $_tga
6383 TV = $_tv
6384 TV_BSDBT848 = $_tv_bsdbt848
6385 TV_DSHOW = $_tv_dshow
6386 TV_V4L = $_tv_v4l
6387 TV_V4L1 = $_tv_v4l1
6388 TV_V4L2 = $_tv_v4l2
6389 UNRAR_EXEC = $_unrar_exec
6390 V4L2 = $_v4l2
6391 VCD = $_vcd
6392 VDPAU = $_vdpau
6393 VESA = $_vesa
6394 VORBIS = $_vorbis
6395 VSTREAM = $_vstream
6396 WII = $_wii
6397 WIN32DLL = $_win32dll
6398 WIN32WAVEOUT = $_win32waveout
6399 WIN32_EMULATION = $_win32_emulation
6400 X11 = $_x11
6401 XANIM_CODECS = $_xanim
6402 XMGA = $_xmga
6403 XMMS_PLUGINS = $_xmms
6404 XV = $_xv
6405 XVID4 = $_xvid
6406 XVR100 = $_xvr100
6407 YUV4MPEG = $_yuv4mpeg
6409 # FFmpeg
6410 FFMPEG_INTERNALS = $ffmpeg_internals
6411 FFMPEG_SOURCE_PATH = $_ffmpeg_source
6413 RANLIB = $_ranlib
6414 YASM = $_yasm
6415 YASMFLAGS = $YASMFLAGS
6417 CONFIG_VDPAU = $_vdpau
6418 CONFIG_ZLIB = $_zlib
6420 HAVE_PTHREADS = $_pthreads
6421 HAVE_SHM = $_shm
6422 HAVE_W32THREADS = $_w32threads
6423 HAVE_YASM = $have_yasm
6427 #############################################################################
6429 ff_config_enable () {
6430 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6431 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6432 _nprefix=$3;
6433 test -z "$_nprefix" && _nprefix='CONFIG'
6434 for part in $list; do
6435 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6436 echo "#define ${_nprefix}_$part 1"
6437 else
6438 echo "#define ${_nprefix}_$part 0"
6440 done
6443 echo "Creating config.h"
6444 cat > $TMPH << EOF
6445 /*----------------------------------------------------------------------------
6446 ** This file has been automatically generated by configure any changes in it
6447 ** will be lost when you run configure again.
6448 ** Instead of modifying definitions here, use the --enable/--disable options
6449 ** of the configure script! See ./configure --help for details.
6450 *---------------------------------------------------------------------------*/
6452 #ifndef MPLAYER_CONFIG_H
6453 #define MPLAYER_CONFIG_H
6455 /* Undefine this if you do not want to select mono audio (left or right)
6456 with a stereo MPEG layer 2/3 audio stream. The command line option
6457 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6458 right-only), with 0 being the default.
6460 #define CONFIG_FAKE_MONO 1
6462 /* set up audio OUTBURST. Do not change this! */
6463 #define OUTBURST 512
6465 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
6466 #undef FAST_OSD
6467 #undef FAST_OSD_TABLE
6471 #define CONFIGURATION "$configuration"
6473 #define MPLAYER_DATADIR "$_datadir"
6474 #define MPLAYER_CONFDIR "$_confdir"
6475 #define MPLAYER_LOCALEDIR "$_localedir"
6477 $def_translation
6479 /* definitions needed by included libraries */
6480 #define HAVE_INTTYPES_H 1
6481 /* libdvdcss */
6482 #define HAVE_ERRNO_H 1
6483 /* libdvdcss + libdvdread */
6484 #define HAVE_LIMITS_H 1
6485 /* libdvdcss */
6486 #define HAVE_UNISTD_H 1
6487 /* libdvdread */
6488 #define STDC_HEADERS 1
6489 #define HAVE_MEMCPY 1
6490 /* libdvdnav */
6491 #define READ_CACHE_TRACE 0
6492 /* libdvdread */
6493 #define HAVE_DLFCN_H 1
6494 $def_dvdcss
6497 /* system headers */
6498 $def_alloca_h
6499 $def_altivec_h
6500 $def_malloc_h
6501 $def_mman_h
6502 $def_mman_has_map_failed
6503 $def_soundcard_h
6504 $def_sys_soundcard_h
6505 $def_sys_sysinfo_h
6506 $def_sys_videoio_h
6507 $def_termios_h
6508 $def_termios_sys_h
6509 $def_winsock2_h
6512 /* system functions */
6513 $def_gethostbyname2
6514 $def_gettimeofday
6515 $def_glob
6516 $def_langinfo
6517 $def_lrintf
6518 $def_map_memalign
6519 $def_memalign
6520 $def_nanosleep
6521 $def_posix_select
6522 $def_select
6523 $def_setenv
6524 $def_setmode
6525 $def_shm
6526 $def_strsep
6527 $def_swab
6528 $def_sysi86
6529 $def_sysi86_iv
6530 $def_termcap
6531 $def_termios
6532 $def_vsscanf
6535 /* system-specific features */
6536 $def_asmalign_pot
6537 $def_builtin_expect
6538 $def_dl
6539 $def_dos_paths
6540 $def_extern_asm
6541 $def_extern_prefix
6542 $def_iconv
6543 $def_kstat
6544 $def_macosx_bundle
6545 $def_macosx_finder
6546 $def_priority
6547 $def_quicktime
6548 $def_restrict_keyword
6549 $def_rtc
6550 $def_unrar_exec
6553 /* configurable options */
6554 $def_charset
6555 $def_crash_debug
6556 $def_debug
6557 $def_fastmemcpy
6558 $def_runtime_cpudetection
6559 $def_sighandler
6560 $def_sortsub
6561 $def_stream_cache
6562 $def_pthread_cache
6565 /* CPU stuff */
6566 #define __CPU__ $iproc
6567 $def_ebx_available
6568 $def_words_endian
6569 $def_bigendian
6570 $(ff_config_enable "$arch_all" "$arch" "ARCH")
6571 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
6572 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
6575 /* Blu-ray/DVD/VCD/CD */
6576 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
6577 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
6578 $def_bluray
6579 $def_bsdi_dvd
6580 $def_cdda
6581 $def_cddb
6582 $def_cdio
6583 $def_cdrom
6584 $def_dvd
6585 $def_dvd_bsd
6586 $def_dvd_darwin
6587 $def_dvd_linux
6588 $def_dvd_openbsd
6589 $def_dvdio
6590 $def_dvdnav
6591 $def_dvdread
6592 $def_hpux_scsi_h
6593 $def_sol_scsi_h
6594 $def_vcd
6597 /* codec libraries */
6598 $def_faad
6599 $def_liba52
6600 $def_libdca
6601 $def_libdv
6602 $def_mad
6603 $def_mpg123
6604 $def_musepack
6605 $def_speex
6606 $def_theora
6607 $def_tremor
6608 $def_vorbis
6609 $def_xvid
6610 $def_zlib
6612 $def_libpostproc
6613 $def_libnut
6616 /* binary codecs */
6617 $def_qtx
6618 $def_qtx_win32
6619 $def_real
6620 $def_win32_loader
6621 $def_win32dll
6622 $def_xanim
6623 $def_xmms
6624 #define BINARY_CODECS_PATH "$_codecsdir"
6625 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
6628 /* Audio output drivers */
6629 $def_alsa
6630 $def_coreaudio
6631 $def_jack
6632 $def_nas
6633 $def_openal
6634 $def_openal_h
6635 $def_ossaudio
6636 $def_ossaudio_devdsp
6637 $def_ossaudio_devmixer
6638 $def_pulse
6639 $def_portaudio
6640 $def_rsound
6641 $def_sunaudio
6642 $def_win32waveout
6644 $def_ladspa
6645 $def_libbs2b
6648 /* input */
6649 $def_apple_ir
6650 $def_apple_remote
6651 $def_ioctl_bt848_h_name
6652 $def_ioctl_meteor_h_name
6653 $def_joystick
6654 $def_lirc
6655 $def_lircc
6656 $def_pvr
6657 $def_radio
6658 $def_radio_bsdbt848
6659 $def_radio_capture
6660 $def_radio_v4l
6661 $def_radio_v4l2
6662 $def_tv
6663 $def_tv_bsdbt848
6664 $def_tv_dshow
6665 $def_tv_v4l
6666 $def_tv_v4l1
6667 $def_tv_v4l2
6670 /* font stuff */
6671 $def_ass
6672 $def_bitmap_font
6673 $def_enca
6674 $def_fontconfig
6675 $def_freetype
6676 $def_fribidi
6679 /* networking */
6680 $def_closesocket
6681 $def_ftp
6682 $def_inet6
6683 $def_inet_aton
6684 $def_inet_pton
6685 $def_live
6686 $def_nemesi
6687 $def_networking
6688 $def_smb
6689 $def_libquvi
6690 $def_socklen_t
6691 $def_vstream
6694 /* libvo options */
6695 $def_3dfx
6696 $def_aa
6697 $def_bl
6698 $def_caca
6699 $def_corevideo
6700 $def_cocoa
6701 $def_sharedbuffer
6702 $def_dga
6703 $def_dga1
6704 $def_dga2
6705 $def_direct3d
6706 $def_directfb
6707 $def_directx
6708 $def_dvb
6709 $def_dvbin
6710 $def_dxr3
6711 $def_fbdev
6712 $def_ggi
6713 $def_ggiwmh
6714 $def_gif
6715 $def_gif_4
6716 $def_gif_tvt_hack
6717 $def_gl
6718 $def_gl_cocoa
6719 $def_gl_win32
6720 $def_gl_x11
6721 $def_gl_sdl
6722 $def_ivtv
6723 $def_jpeg
6724 $def_md5sum
6725 $def_mga
6726 $def_mng
6727 $def_png
6728 $def_pnm
6729 $def_s3fb
6730 $def_sdl
6731 $def_sdl_sdl_h
6732 $def_svga
6733 $def_tdfxfb
6734 $def_tdfxvid
6735 $def_tga
6736 $def_v4l2
6737 $def_vdpau
6738 $def_vesa
6739 $def_vm
6740 $def_wii
6741 $def_x11
6742 $def_xdpms
6743 $def_xf86keysym
6744 $def_xinerama
6745 $def_xmga
6746 $def_xss
6747 $def_xv
6748 $def_xvr100
6749 $def_yuv4mpeg
6752 /* FFmpeg */
6753 $def_ffmpeg_internals
6755 $def_arpa_inet_h
6756 $def_bswap
6757 $def_dcbzl
6758 $def_exp2
6759 $def_exp2f
6760 $def_fast_64bit
6761 $def_fast_unaligned
6762 $def_llrint
6763 $def_log2
6764 $def_log2f
6765 $def_lrint
6766 $def_memalign_hack
6767 $def_mkstemp
6768 $def_posix_memalign
6769 $def_pthreads
6770 $def_round
6771 $def_roundf
6772 $def_threads
6773 $def_truncf
6774 $def_xform_asm
6775 $def_yasm
6777 #define HAVE_INLINE_ASM 1
6779 /* Use these registers in x86 inline asm. No proper detection yet. */
6780 #define HAVE_EBP_AVAILABLE 1
6782 #endif /* MPLAYER_CONFIG_H */
6785 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
6786 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
6788 #############################################################################
6790 cat << EOF
6792 Config files successfully generated by ./configure $configuration !
6794 Install prefix: $_prefix
6795 Data directory: $_datadir
6796 Config direct.: $_confdir
6798 Byte order: $_byte_order
6799 Optimizing for: $_optimizing
6801 Languages:
6802 Messages (in addition to English): $language_msg
6803 Manual pages: $language_man
6804 Documentation: $language_doc
6806 Enabled optional drivers:
6807 Input: $inputmodules
6808 Codecs: $codecmodules
6809 Audio output: $aomodules
6810 Video output: $vomodules
6812 Disabled optional drivers:
6813 Input: $noinputmodules
6814 Codecs: $nocodecmodules
6815 Audio output: $noaomodules
6816 Video output: $novomodules
6818 'config.h' and 'config.mak' contain your configuration options.
6819 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
6820 compile *** DO NOT REPORT BUGS if you tweak these files ***
6822 'make' will now compile MPlayer and 'make install' will install it.
6823 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
6828 cat <<EOF
6829 Check $TMPLOG if you wonder why an autodetection failed (make sure
6830 development headers/packages are installed).
6832 NOTE: The --enable-* parameters unconditionally force options on, completely
6833 skipping autodetection. This behavior is unlike what you may be used to from
6834 autoconf-based configure scripts that can decide to override you. This greater
6835 level of control comes at a price. You may have to provide the correct compiler
6836 and linker flags yourself.
6837 If you used one of these options (except --enable-runtime-cpudetection and
6838 similar ones that turn on internal features) and experience a compilation or
6839 linking failure, make sure you have passed the necessary compiler/linker flags
6840 to configure.
6842 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
6846 if test "$warn_cflags" = yes; then
6847 cat <<EOF
6849 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
6850 but:
6852 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6854 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6855 To do so, execute 'CFLAGS= ./configure <options>'
6860 # Last move:
6861 rm -rf "$mplayer_tmpdir"