configure: add return_check and return_statement_check helpers
[mplayer/greg.git] / configure
blob279cab99fa871f8cfdcd3867d81737ab29abb069
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: Check the Subversion log.
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, look at the existing checks
23 # and try to use helper functions where you can.
25 # Furthermore you need to add the variable _feature to the list of default
26 # settings and set it to one of yes/no/auto. Also add appropriate
27 # --enable-feature/--disable-feature command line options.
28 # The results of the check should be written to config.h and config.mak
29 # at the end of this script. The variable names used for this should be
30 # uniform, i.e. if the option is named 'feature':
32 # _feature : should have a value of yes/no/auto
33 # def_feature : '#define ... 1' or '#undef ...' for conditional compilation
34 # _ld_feature : '-L/path/dir -lfeature' GCC options
36 #############################################################################
38 # Prevent locale nonsense from breaking basic text processing utils
39 export LC_ALL=C
41 # Store the configure line that was used
42 configuration="$*"
44 # Prefer these macros to full length text !
45 # These macros only return an error code - NO display is done
46 compile_check() {
47 source="$1"
48 shift
49 echo >> "$TMPLOG"
50 cat "$source" >> "$TMPLOG"
51 echo >> "$TMPLOG"
52 echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
53 rm -f "$TMPEXE"
54 $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
55 TMPRES="$?"
56 echo >> "$TMPLOG"
57 echo >> "$TMPLOG"
58 return "$TMPRES"
61 cc_check() {
62 compile_check $TMPC $@
65 cxx_check() {
66 compile_check $TMPCPP $@ -lstdc++
69 cflag_check() {
70 cat > $TMPC << EOF
71 int main(void) { return 0; }
72 EOF
73 compile_check $TMPC $@
76 header_check() {
77 cat > $TMPC << EOF
78 #include <$1>
79 int main(void) { return 0; }
80 EOF
81 shift
82 compile_check $TMPC $@
85 return_check() {
86 cat > $TMPC << EOF
87 #include <$1>
88 int main(void) { return $2; }
89 EOF
90 shift 2
91 compile_check $TMPC $@
94 statement_check() {
95 cat > $TMPC << EOF
96 #include <$1>
97 int main(void) { $2; return 0; }
98 EOF
99 shift
100 shift
101 compile_check $TMPC $@
104 define_statement_check() {
105 cat > $TMPC << EOF
106 #define $1
107 #include <$2>
108 int main(void) { $3; return 0; }
110 shift 3
111 compile_check $TMPC $@
114 return_statement_check() {
115 cat > $TMPC << EOF
116 #include <$1>
117 int main(void) { $2; return $3; }
119 shift 3
120 compile_check $TMPC $@
123 inline_asm_check() {
124 cat > $TMPC << EOF
125 int main(void) { __asm__ volatile ($1); return 0; }
127 shift
128 compile_check $TMPC $@
131 # The following checks are special and should only be used with broken and
132 # non-selfsufficient headers that do not include all of their dependencies.
134 header_check_broken() {
135 cat > $TMPC << EOF
136 #include <$1>
137 #include <$2>
138 int main(void) { return 0; }
140 shift
141 shift
142 compile_check $TMPC $@
145 statement_check_broken() {
146 cat > $TMPC << EOF
147 #include <$1>
148 #include <$2>
149 int main(void) { $3; return 0; }
151 shift 3
152 compile_check $TMPC $@
155 yasm_check() {
156 echo >> "$TMPLOG"
157 cat "$TMPS" >> "$TMPLOG"
158 echo >> "$TMPLOG"
159 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
160 rm -f "$TMPEXE"
161 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
162 TMPRES="$?"
163 echo >> "$TMPLOG"
164 echo >> "$TMPLOG"
165 return "$TMPRES"
168 tmp_run() {
169 "$TMPEXE" >> "$TMPLOG" 2>&1
172 # Display error message, flushes tempfile, exit
173 die () {
174 echo
175 echo "Error: $@" >&2
176 echo >&2
177 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
178 echo "Check \"$TMPLOG\" if you do not understand why it failed."
179 exit 1
182 # OS test booleans functions
183 issystem() {
184 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
186 aix() { issystem "AIX"; }
187 amigaos() { issystem "AmigaOS"; }
188 beos() { issystem "BEOS"; }
189 bsdos() { issystem "BSD/OS"; }
190 cygwin() { issystem "CYGWIN"; }
191 darwin() { issystem "Darwin"; }
192 dragonfly() { issystem "DragonFly"; }
193 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
194 gnu() { issystem "GNU"; }
195 hpux() { issystem "HP-UX"; }
196 irix() { issystem "IRIX"; }
197 linux() { issystem "Linux"; }
198 mingw32() { issystem "MINGW32"; }
199 morphos() { issystem "MorphOS"; }
200 netbsd() { issystem "NetBSD"; }
201 openbsd() { issystem "OpenBSD"; }
202 os2() { issystem "OS/2"; }
203 qnx() { issystem "QNX"; }
204 sunos() { issystem "SunOS"; }
205 win32() { cygwin || mingw32; }
207 # arch test boolean functions
208 # x86/x86pc is used by QNX
209 x86_32() {
210 case "$host_arch" in
211 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
212 *) return 1 ;;
213 esac
216 x86_64() {
217 case "$host_arch" in
218 x86_64|amd64) return 0 ;;
219 *) return 1 ;;
220 esac
223 x86() {
224 x86_32 || x86_64
227 ppc() {
228 case "$host_arch" in
229 ppc|ppc64|powerpc|powerpc64) return 0;;
230 *) return 1;;
231 esac
234 alpha() {
235 case "$host_arch" in
236 alpha*) return 0;;
237 *) return 1;;
238 esac
241 arm() {
242 case "$host_arch" in
243 arm*) return 0;;
244 *) return 1;;
245 esac
248 # Use this before starting a check
249 echocheck() {
250 echo "============ Checking for $@ ============" >> "$TMPLOG"
251 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
254 # Use this to echo the results of a check
255 echores() {
256 if test "$res_comment" ; then
257 res_comment="($res_comment)"
259 echo "Result is: $@ $res_comment" >> "$TMPLOG"
260 echo "##########################################" >> "$TMPLOG"
261 echo "" >> "$TMPLOG"
262 echo "$@ $res_comment"
263 res_comment=""
265 #############################################################################
267 # Check how echo works in this /bin/sh
268 case $(echo -n) in
269 -n) _echo_n= _echo_c='\c' ;; # SysV echo
270 *) _echo_n='-n ' _echo_c= ;; # BSD echo
271 esac
273 msg_lang_all=''
274 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
275 man_lang_all=$(echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g")
276 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
278 show_help(){
279 cat << EOF
280 Usage: $0 [OPTIONS]...
282 Configuration:
283 -h, --help display this help and exit
285 Installation directories:
286 --prefix=DIR prefix directory for installation [/usr/local]
287 --bindir=DIR directory for installing binaries [PREFIX/bin]
288 --datadir=DIR directory for installing machine independent
289 data files (skins, etc) [PREFIX/share/mplayer]
290 --mandir=DIR directory for installing man pages [PREFIX/share/man]
291 --confdir=DIR directory for installing configuration files
292 [PREFIX/etc/mplayer]
293 --localedir=DIR directory for locale tree [PREFIX/share/locale]
294 --libdir=DIR directory for object code libraries [PREFIX/lib]
295 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
297 Optional features:
298 --disable-mplayer disable MPlayer compilation [enable]
299 --disable-largefiles disable support for files > 2GB [enable]
300 --enable-termcap use termcap database for key codes [autodetect]
301 --enable-termios use termios database for key codes [autodetect]
302 --disable-iconv disable iconv for encoding conversion [autodetect]
303 --disable-langinfo do not use langinfo [autodetect]
304 --enable-lirc enable LIRC (remote control) support [autodetect]
305 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
306 --enable-joystick enable joystick support [disable]
307 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
308 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
309 --disable-vm disable X video mode extensions [autodetect]
310 --disable-xf86keysym disable support for multimedia keys [autodetect]
311 --enable-radio enable radio interface [disable]
312 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
313 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
314 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
315 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
316 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
317 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
318 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
319 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
320 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
321 --disable-networking disable networking [enable]
322 --enable-winsock2_h enable winsock2_h [autodetect]
323 --enable-smb enable Samba (SMB) input [autodetect]
324 --enable-live enable LIVE555 Streaming Media [autodetect]
325 --enable-nemesi enable Nemesi Streaming Media [autodetect]
326 --disable-vcd disable VCD support [autodetect]
327 --disable-bluray disable Blu-ray support [autodetect]
328 --disable-dvdnav disable libdvdnav [autodetect]
329 --disable-dvdread disable libdvdread [autodetect]
330 --disable-dvdread-internal disable internal libdvdread [autodetect]
331 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
332 --disable-cdparanoia disable cdparanoia [autodetect]
333 --disable-cddb disable cddb [autodetect]
334 --disable-bitmap-font disable bitmap font support [enable]
335 --disable-freetype disable FreeType 2 font rendering [autodetect]
336 --disable-fontconfig disable fontconfig font lookup [autodetect]
337 --disable-unrarexec disable using of UnRAR executable [enabled]
338 --enable-menu enable OSD menu (not DVD menu) [disabled]
339 --disable-sortsub disable subtitle sorting [enabled]
340 --enable-fribidi enable the FriBiDi libs [autodetect]
341 --disable-enca disable ENCA charset oracle library [autodetect]
342 --disable-maemo disable maemo specific features [autodetect]
343 --enable-macosx-finder enable Mac OS X Finder invocation parameter
344 parsing [disabled]
345 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
346 --disable-inet6 disable IPv6 support [autodetect]
347 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
348 --disable-ftp disable FTP support [enabled]
349 --disable-vstream disable TiVo vstream client support [autodetect]
350 --disable-pthreads disable Posix threads support [autodetect]
351 --disable-w32threads disable Win32 threads support [autodetect]
352 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
353 --enable-rpath enable runtime linker path for extra libs [disabled]
355 Codecs:
356 --enable-gif enable GIF support [autodetect]
357 --enable-png enable PNG input/output support [autodetect]
358 --enable-mng enable MNG input support [autodetect]
359 --enable-jpeg enable JPEG input/output support [autodetect]
360 --enable-libcdio enable libcdio support [autodetect]
361 --enable-liblzo enable liblzo support [autodetect]
362 --disable-win32dll disable Win32 DLL support [autodetect]
363 --disable-qtx disable QuickTime codecs support [enabled]
364 --disable-xanim disable XAnim codecs support [enabled]
365 --disable-real disable RealPlayer codecs support [enabled]
366 --disable-xvid disable Xvid [autodetect]
367 --disable-libnut disable libnut [autodetect]
368 --disable-ffmpeg disable FFmpeg [autodetect]
369 --disable-tremor-internal disable internal Tremor [enabled]
370 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
371 --enable-tremor enable external Tremor [autodetect]
372 --disable-libvorbis disable libvorbis support [autodetect]
373 --disable-speex disable Speex support [autodetect]
374 --enable-theora enable OggTheora libraries [autodetect]
375 --enable-faad enable FAAD2 (AAC) [autodetect]
376 --disable-ladspa disable LADSPA plugin support [autodetect]
377 --disable-libbs2b disable libbs2b audio filter support [autodetect]
378 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
379 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
380 --disable-mad disable libmad (MPEG audio) support [autodetect]
381 --enable-xmms enable XMMS input plugin support [disabled]
382 --enable-libdca enable libdca support [autodetect]
383 --disable-mp3lib disable builtin mp3lib [autodetect]
384 --disable-liba52 disable liba52 [autodetect]
385 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
386 --disable-musepack disable musepack support [autodetect]
388 Video output:
389 --disable-vidix disable VIDIX [for x86 *nix]
390 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
391 Available: cyberblade, ivtv, mach64, mga, mga_crtc2,
392 nvidia, pm2, pm3, radeon, rage128, s3, sis, unichrome
393 --disable-vidix-pcidb disable VIDIX PCI device name database
394 --enable-dhahelper enable VIDIX dhahelper support
395 --enable-svgalib_helper enable VIDIX svgalib_helper support
396 --enable-gl enable OpenGL video output [autodetect]
397 --disable-matrixview disable OpenGL MatrixView 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-kva enable KVA video output [autodetect]
404 --enable-aa enable AAlib video output [autodetect]
405 --enable-caca enable CACA video output [autodetect]
406 --enable-ggi enable GGI video output [autodetect]
407 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
408 --enable-direct3d enable Direct3D video output [autodetect]
409 --enable-directx enable DirectX video output [autodetect]
410 --enable-dxr2 enable DXR2 video output [autodetect]
411 --enable-dxr3 enable DXR3/H+ video output [autodetect]
412 --enable-ivtv enable IVTV TV-Out video output [autodetect]
413 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
414 --enable-dvb enable DVB video output [autodetect]
415 --enable-mga enable mga_vid video output [autodetect]
416 --enable-xmga enable mga_vid X11 video output [autodetect]
417 --enable-xv enable Xv video output [autodetect]
418 --enable-xvmc enable XvMC acceleration [disable]
419 --enable-vdpau enable VDPAU acceleration [autodetect]
420 --enable-vm enable XF86VidMode support [autodetect]
421 --enable-xinerama enable Xinerama support [autodetect]
422 --enable-x11 enable X11 video output [autodetect]
423 --enable-xshape enable XShape support [autodetect]
424 --disable-xss disable screensaver support via xss [autodetect]
425 --enable-fbdev enable FBDev video output [autodetect]
426 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
427 --enable-tdfxfb enable tdfxfb video output [disable]
428 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
429 --enable-wii enable Nintendo Wii/GameCube video output [disable]
430 --enable-directfb enable DirectFB video output [autodetect]
431 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
432 --enable-bl enable Blinkenlights video output [disable]
433 --enable-tdfxvid enable tdfx_vid video output [disable]
434 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
435 --disable-tga disable Targa video output [enable]
436 --disable-pnm disable PNM video output [enable]
437 --disable-md5sum disable md5sum video output [enable]
438 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
439 --disable-corevideo disable CoreVideo video output [autodetect]
440 --disable-quartz disable Quartz video output [autodetect]
442 Audio output:
443 --disable-alsa disable ALSA audio output [autodetect]
444 --disable-ossaudio disable OSS audio output [autodetect]
445 --disable-arts disable aRts audio output [autodetect]
446 --disable-esd disable esd audio output [autodetect]
447 --disable-pulse disable Pulseaudio audio output [autodetect]
448 --disable-jack disable JACK audio output [autodetect]
449 --enable-openal enable OpenAL audio output [disable]
450 --disable-nas disable NAS audio output [autodetect]
451 --disable-sgiaudio disable SGI audio output [autodetect]
452 --disable-sunaudio disable Sun audio output [autodetect]
453 --disable-kai disable KAI audio output [autodetect]
454 --disable-dart disable DART audio output [autodetect]
455 --disable-win32waveout disable Windows waveout audio output [autodetect]
456 --disable-coreaudio disable CoreAudio audio output [autodetect]
457 --disable-select disable using select() on the audio device [enable]
459 Language options:
460 --enable-translation enable support for translated output [disable]
461 --charset=charset convert the console messages to this character set
462 --language-doc=lang language to use for the documentation [en]
463 --language-man=lang language to use for the man pages [en]
464 --language-msg=lang extra languages for program messages [all]
465 --language=lang default language to use [en]
466 Specific options override --language. You can pass a list of languages separated
467 by whitespace or commas instead of a single language. Nonexisting translations
468 will be dropped from each list. All translations available in the list will be
469 installed. The value "all" will activate all translations. The LINGUAS
470 environment variable is honored. In all cases the fallback is English.
471 The program always supports English-language output; additional message
472 languages are only installed if --enable-translation is also specified.
473 Available values for --language-doc are: all $doc_lang_all
474 Available values for --language-man are: all $man_lang_all
475 Available values for --language-msg are: all $msg_lang_all
477 Miscellaneous options:
478 --enable-runtime-cpudetection enable runtime CPU detection [disable]
479 --enable-cross-compile enable cross-compilation [autodetect]
480 --cc=COMPILER C compiler to build MPlayer [gcc]
481 --host-cc=COMPILER C compiler for tools needed while building [gcc]
482 --as=ASSEMBLER assembler to build MPlayer [as]
483 --nm=NM nm tool to build MPlayer [nm]
484 --yasm=YASM Yasm assembler to build MPlayer [yasm]
485 --ar=AR librarian to build MPlayer [ar]
486 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
487 --windres=WINDRES windres to build MPlayer [windres]
488 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
489 --enable-static build a statically linked binary
490 --with-install=PATH path to a custom install program
492 Advanced options:
493 --enable-mmx enable MMX [autodetect]
494 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
495 --enable-3dnow enable 3DNow! [autodetect]
496 --enable-3dnowext enable extended 3DNow! [autodetect]
497 --enable-sse enable SSE [autodetect]
498 --enable-sse2 enable SSE2 [autodetect]
499 --enable-ssse3 enable SSSE3 [autodetect]
500 --enable-shm enable shm [autodetect]
501 --enable-altivec enable AltiVec (PowerPC) [autodetect]
502 --enable-armv5te enable DSP extensions (ARM) [autodetect]
503 --enable-armv6 enable ARMv6 (ARM) [autodetect]
504 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
505 --enable-armvfp enable ARM VFP (ARM) [autodetect]
506 --enable-neon enable NEON (ARM) [autodetect]
507 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
508 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
509 --enable-big-endian force byte order to big-endian [autodetect]
510 --enable-debug[=1-3] compile-in debugging information [disable]
511 --enable-profile compile-in profiling information [disable]
512 --disable-sighandler disable sighandler for crashes [enable]
513 --enable-crash-debug enable automatic gdb attach on crash [disable]
514 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
515 --ffmpeg-source-dir=PATH enable features requiring internal FFmpeg headers
517 Use these options if autodetection fails:
518 --extra-cflags=FLAGS extra CFLAGS
519 --extra-ldflags=FLAGS extra LDFLAGS
520 --extra-libs=FLAGS extra linker flags
521 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
522 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
524 --with-freetype-config=PATH path to freetype-config
525 --with-glib-config=PATH path to glib*-config
526 --with-gtk-config=PATH path to gtk*-config
527 --with-sdl-config=PATH path to sdl*-config
528 --with-dvdnav-config=PATH path to dvdnav-config
529 --with-dvdread-config=PATH path to dvdread-config
531 This configure script is NOT autoconf-based, even though its output is similar.
532 It will try to autodetect all configuration options. If you --enable an option
533 it will be forcefully turned on, skipping autodetection. This can break
534 compilation, so you need to know what you are doing.
536 exit 0
537 } #show_help()
539 # GOTCHA: the variables below defines the default behavior for autodetection
540 # and have - unless stated otherwise - at least 2 states : yes no
541 # If autodetection is available then the third state is: auto
542 _mmx=auto
543 _3dnow=auto
544 _3dnowext=auto
545 _mmxext=auto
546 _sse=auto
547 _sse2=auto
548 _ssse3=auto
549 _cmov=auto
550 _fast_cmov=auto
551 _fast_clz=auto
552 _armv5te=auto
553 _armv6=auto
554 _armv6t2=auto
555 _armvfp=auto
556 neon=auto
557 _iwmmxt=auto
558 _mtrr=auto
559 _altivec=auto
560 _install=install
561 _ranlib=ranlib
562 _windres=windres
563 _cc=cc
564 _ar=ar
565 test "$CC" && _cc="$CC"
566 _as=auto
567 _nm=auto
568 _yasm=yasm
569 _runtime_cpudetection=no
570 _cross_compile=auto
571 _prefix="/usr/local"
572 ffmpeg=auto
573 ffmpeg_internals=no
574 _mplayer=yes
575 _x11=auto
576 _xshape=auto
577 _xss=auto
578 _dga1=auto
579 _dga2=auto
580 _xv=auto
581 _xvmc=no #auto when complete
582 _vdpau=auto
583 _sdl=auto
584 _kva=auto
585 _direct3d=auto
586 _directx=auto
587 _win32waveout=auto
588 _nas=auto
589 _png=auto
590 _mng=auto
591 _jpeg=auto
592 _pnm=yes
593 _md5sum=yes
594 _yuv4mpeg=yes
595 _gif=auto
596 _gl=auto
597 matrixview=yes
598 _ggi=auto
599 _ggiwmh=auto
600 _aa=auto
601 _caca=auto
602 _svga=auto
603 _vesa=auto
604 _fbdev=auto
605 _dvb=auto
606 _dxr2=auto
607 _dxr3=auto
608 _ivtv=auto
609 _v4l2=auto
610 _iconv=auto
611 _langinfo=auto
612 _rtc=auto
613 _ossaudio=auto
614 _arts=auto
615 _esd=auto
616 _pulse=auto
617 _jack=auto
618 _kai=auto
619 _dart=auto
620 _openal=no
621 _libcdio=auto
622 _liblzo=auto
623 _mad=auto
624 _tremor=auto
625 _tremor_internal=yes
626 _tremor_low=no
627 _libvorbis=auto
628 _speex=auto
629 _theora=auto
630 _mpg123=auto
631 _mp3lib=auto
632 _liba52=auto
633 _libdca=auto
634 _libmpeg2=auto
635 _faad=auto
636 _ladspa=auto
637 _libbs2b=auto
638 _xmms=no
639 _vcd=auto
640 _bluray=auto
641 _dvdnav=auto
642 _dvdnavconfig=dvdnav-config
643 _dvdreadconfig=dvdread-config
644 _dvdread=auto
645 _dvdread_internal=auto
646 _libdvdcss_internal=auto
647 _xanim=auto
648 _real=auto
649 _live=auto
650 _nemesi=auto
651 _native_rtsp=yes
652 _xinerama=auto
653 _mga=auto
654 _xmga=auto
655 _vm=auto
656 _xf86keysym=auto
657 _sgiaudio=auto
658 _sunaudio=auto
659 _alsa=auto
660 _fastmemcpy=yes
661 _unrar_exec=auto
662 _win32dll=auto
663 _select=yes
664 _radio=no
665 _radio_capture=no
666 _radio_v4l=auto
667 _radio_v4l2=auto
668 _radio_bsdbt848=auto
669 _tv=yes
670 _tv_v4l1=auto
671 _tv_v4l2=auto
672 _tv_bsdbt848=auto
673 _tv_dshow=auto
674 _pvr=auto
675 networking=yes
676 _winsock2_h=auto
677 _smb=auto
678 _vidix=auto
679 _vidix_pcidb=yes
680 _dhahelper=no
681 _svgalib_helper=no
682 _joystick=no
683 _xvid=auto
684 _libnut=auto
685 _lirc=auto
686 _lircc=auto
687 _apple_remote=auto
688 _apple_ir=auto
689 _gui=no
690 _gtk1=no
691 _termcap=auto
692 _termios=auto
693 _3dfx=no
694 _s3fb=no
695 _wii=no
696 _tdfxfb=no
697 _tdfxvid=no
698 _xvr100=auto
699 _tga=yes
700 _directfb=auto
701 _zr=auto
702 _bl=no
703 _largefiles=yes
704 #language=en
705 _shm=auto
706 _translation=no
707 _charset="UTF-8"
708 _dynamic_plugins=no
709 _crash_debug=no
710 _sighandler=yes
711 _libdv=auto
712 _cdparanoia=auto
713 _cddb=auto
714 _big_endian=auto
715 _bitmap_font=yes
716 _freetype=auto
717 _fontconfig=auto
718 _menu=no
719 _qtx=auto
720 _maemo=auto
721 _coreaudio=auto
722 _corevideo=auto
723 _quartz=auto
724 quicktime=auto
725 _macosx_finder=no
726 _macosx_bundle=auto
727 _sortsub=yes
728 _freetypeconfig='freetype-config'
729 _fribidi=auto
730 _enca=auto
731 _inet6=auto
732 _gethostbyname2=auto
733 _ftp=auto
734 _musepack=auto
735 _vstream=auto
736 _pthreads=auto
737 _w32threads=auto
738 _ass=auto
739 _rpath=no
740 _asmalign_pot=auto
741 _stream_cache=yes
742 _priority=no
743 def_dos_paths="#define HAVE_DOS_PATHS 0"
744 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
745 def_priority="#undef CONFIG_PRIORITY"
746 def_pthread_cache="#undef PTHREAD_CACHE"
747 _need_shmem=yes
748 for ac_option do
749 case "$ac_option" in
750 --help|-help|-h)
751 show_help
753 --prefix=*)
754 _prefix=$(echo $ac_option | cut -d '=' -f 2)
756 --bindir=*)
757 _bindir=$(echo $ac_option | cut -d '=' -f 2)
759 --datadir=*)
760 _datadir=$(echo $ac_option | cut -d '=' -f 2)
762 --mandir=*)
763 _mandir=$(echo $ac_option | cut -d '=' -f 2)
765 --confdir=*)
766 _confdir=$(echo $ac_option | cut -d '=' -f 2)
768 --libdir=*)
769 _libdir=$(echo $ac_option | cut -d '=' -f 2)
771 --codecsdir=*)
772 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
774 --localedir=*)
775 _localedir=$(echo $ac_option | cut -d '=' -f 2)
778 --with-install=*)
779 _install=$(echo $ac_option | cut -d '=' -f 2 )
781 --with-xvmclib=*)
782 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
785 --with-sdl-config=*)
786 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
788 --with-freetype-config=*)
789 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
791 --with-gtk-config=*)
792 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
794 --with-glib-config=*)
795 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
797 --with-dvdnav-config=*)
798 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
800 --with-dvdread-config=*)
801 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
804 --extra-cflags=*)
805 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
807 --extra-ldflags=*)
808 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
810 --extra-libs=*)
811 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
813 --extra-libs-mplayer=*)
814 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
817 --target=*)
818 _target=$(echo $ac_option | cut -d '=' -f 2)
820 --cc=*)
821 _cc=$(echo $ac_option | cut -d '=' -f 2)
823 --host-cc=*)
824 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
826 --as=*)
827 _as=$(echo $ac_option | cut -d '=' -f 2)
829 --nm=*)
830 _nm=$(echo $ac_option | cut -d '=' -f 2)
832 --yasm=*)
833 _yasm=$(echo $ac_option | cut -d '=' -f 2)
835 --ar=*)
836 _ar=$(echo $ac_option | cut -d '=' -f 2)
838 --ranlib=*)
839 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
841 --windres=*)
842 _windres=$(echo $ac_option | cut -d '=' -f 2)
844 --charset=*)
845 _charset=$(echo $ac_option | cut -d '=' -f 2)
847 --language-doc=*)
848 language_doc=$(echo $ac_option | cut -d '=' -f 2)
850 --language-man=*)
851 language_man=$(echo $ac_option | cut -d '=' -f 2)
853 --language-msg=*)
854 language_msg=$(echo $ac_option | cut -d '=' -f 2)
856 --language=*)
857 language=$(echo $ac_option | cut -d '=' -f 2)
860 --enable-static)
861 _ld_static='-static'
863 --disable-static)
864 _ld_static=''
866 --enable-profile)
867 _profile='-p'
869 --disable-profile)
870 _profile=
872 --enable-debug)
873 _debug='-g'
875 --enable-debug=*)
876 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
878 --disable-debug)
879 _debug=
881 --enable-translation) _translation=yes ;;
882 --disable-translation) _translation=no ;;
883 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
884 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
885 --enable-cross-compile) _cross_compile=yes ;;
886 --disable-cross-compile) _cross_compile=no ;;
887 --enable-mplayer) _mplayer=yes ;;
888 --disable-mplayer) _mplayer=no ;;
889 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
890 --disable-dynamic-plugins) _dynamic_plugins=no ;;
891 --enable-x11) _x11=yes ;;
892 --disable-x11) _x11=no ;;
893 --enable-xshape) _xshape=yes ;;
894 --disable-xshape) _xshape=no ;;
895 --enable-xss) _xss=yes ;;
896 --disable-xss) _xss=no ;;
897 --enable-xv) _xv=yes ;;
898 --disable-xv) _xv=no ;;
899 --enable-xvmc) _xvmc=yes ;;
900 --disable-xvmc) _xvmc=no ;;
901 --enable-vdpau) _vdpau=yes ;;
902 --disable-vdpau) _vdpau=no ;;
903 --enable-sdl) _sdl=yes ;;
904 --disable-sdl) _sdl=no ;;
905 --enable-kva) _kva=yes ;;
906 --disable-kva) _kva=no ;;
907 --enable-direct3d) _direct3d=yes ;;
908 --disable-direct3d) _direct3d=no ;;
909 --enable-directx) _directx=yes ;;
910 --disable-directx) _directx=no ;;
911 --enable-win32waveout) _win32waveout=yes ;;
912 --disable-win32waveout) _win32waveout=no ;;
913 --enable-nas) _nas=yes ;;
914 --disable-nas) _nas=no ;;
915 --enable-png) _png=yes ;;
916 --disable-png) _png=no ;;
917 --enable-mng) _mng=yes ;;
918 --disable-mng) _mng=no ;;
919 --enable-jpeg) _jpeg=yes ;;
920 --disable-jpeg) _jpeg=no ;;
921 --enable-pnm) _pnm=yes ;;
922 --disable-pnm) _pnm=no ;;
923 --enable-md5sum) _md5sum=yes ;;
924 --disable-md5sum) _md5sum=no ;;
925 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
926 --disable-yuv4mpeg) _yuv4mpeg=no ;;
927 --enable-gif) _gif=yes ;;
928 --disable-gif) _gif=no ;;
929 --enable-gl) _gl=yes ;;
930 --disable-gl) _gl=no ;;
931 --enable-matrixview) matrixview=yes ;;
932 --disable-matrixview) matrixview=no ;;
933 --enable-ggi) _ggi=yes ;;
934 --disable-ggi) _ggi=no ;;
935 --enable-ggiwmh) _ggiwmh=yes ;;
936 --disable-ggiwmh) _ggiwmh=no ;;
937 --enable-aa) _aa=yes ;;
938 --disable-aa) _aa=no ;;
939 --enable-caca) _caca=yes ;;
940 --disable-caca) _caca=no ;;
941 --enable-svga) _svga=yes ;;
942 --disable-svga) _svga=no ;;
943 --enable-vesa) _vesa=yes ;;
944 --disable-vesa) _vesa=no ;;
945 --enable-fbdev) _fbdev=yes ;;
946 --disable-fbdev) _fbdev=no ;;
947 --enable-dvb) _dvb=yes ;;
948 --disable-dvb) _dvb=no ;;
949 --enable-dxr2) _dxr2=yes ;;
950 --disable-dxr2) _dxr2=no ;;
951 --enable-dxr3) _dxr3=yes ;;
952 --disable-dxr3) _dxr3=no ;;
953 --enable-ivtv) _ivtv=yes ;;
954 --disable-ivtv) _ivtv=no ;;
955 --enable-v4l2) _v4l2=yes ;;
956 --disable-v4l2) _v4l2=no ;;
957 --enable-iconv) _iconv=yes ;;
958 --disable-iconv) _iconv=no ;;
959 --enable-langinfo) _langinfo=yes ;;
960 --disable-langinfo) _langinfo=no ;;
961 --enable-rtc) _rtc=yes ;;
962 --disable-rtc) _rtc=no ;;
963 --enable-libdv) _libdv=yes ;;
964 --disable-libdv) _libdv=no ;;
965 --enable-ossaudio) _ossaudio=yes ;;
966 --disable-ossaudio) _ossaudio=no ;;
967 --enable-arts) _arts=yes ;;
968 --disable-arts) _arts=no ;;
969 --enable-esd) _esd=yes ;;
970 --disable-esd) _esd=no ;;
971 --enable-pulse) _pulse=yes ;;
972 --disable-pulse) _pulse=no ;;
973 --enable-jack) _jack=yes ;;
974 --disable-jack) _jack=no ;;
975 --enable-openal) _openal=yes ;;
976 --disable-openal) _openal=no ;;
977 --enable-kai) _kai=yes ;;
978 --disable-kai) _kai=no ;;
979 --enable-dart) _dart=yes ;;
980 --disable-dart) _dart=no ;;
981 --enable-mad) _mad=yes ;;
982 --disable-mad) _mad=no ;;
983 --enable-libcdio) _libcdio=yes ;;
984 --disable-libcdio) _libcdio=no ;;
985 --enable-liblzo) _liblzo=yes ;;
986 --disable-liblzo) _liblzo=no ;;
987 --enable-libvorbis) _libvorbis=yes ;;
988 --disable-libvorbis) _libvorbis=no ;;
989 --enable-speex) _speex=yes ;;
990 --disable-speex) _speex=no ;;
991 --enable-tremor) _tremor=yes ;;
992 --disable-tremor) _tremor=no ;;
993 --enable-tremor-internal) _tremor_internal=yes ;;
994 --disable-tremor-internal) _tremor_internal=no ;;
995 --enable-tremor-low) _tremor_low=yes ;;
996 --disable-tremor-low) _tremor_low=no ;;
997 --enable-theora) _theora=yes ;;
998 --disable-theora) _theora=no ;;
999 --enable-mpg123) _mpg123=yes ;;
1000 --disable-mpg123) _mpg123=no ;;
1001 --enable-mp3lib) _mp3lib=yes ;;
1002 --disable-mp3lib) _mp3lib=no ;;
1003 --enable-liba52) _liba52=yes ;;
1004 --disable-liba52) _liba52=no ;;
1005 --enable-libdca) _libdca=yes ;;
1006 --disable-libdca) _libdca=no ;;
1007 --enable-libmpeg2) _libmpeg2=yes ;;
1008 --disable-libmpeg2) _libmpeg2=no ;;
1009 --enable-musepack) _musepack=yes ;;
1010 --disable-musepack) _musepack=no ;;
1011 --enable-faad) _faad=yes ;;
1012 --disable-faad) _faad=no ;;
1013 --enable-ladspa) _ladspa=yes ;;
1014 --disable-ladspa) _ladspa=no ;;
1015 --enable-libbs2b) _libbs2b=yes ;;
1016 --disable-libbs2b) _libbs2b=no ;;
1017 --enable-xmms) _xmms=yes ;;
1018 --disable-xmms) _xmms=no ;;
1019 --enable-vcd) _vcd=yes ;;
1020 --disable-vcd) _vcd=no ;;
1021 --enable-bluray) _bluray=yes ;;
1022 --disable-bluray) _bluray=no ;;
1023 --enable-dvdread) _dvdread=yes ;;
1024 --disable-dvdread) _dvdread=no ;;
1025 --enable-dvdread-internal) _dvdread_internal=yes ;;
1026 --disable-dvdread-internal) _dvdread_internal=no ;;
1027 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1028 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1029 --enable-dvdnav) _dvdnav=yes ;;
1030 --disable-dvdnav) _dvdnav=no ;;
1031 --enable-xanim) _xanim=yes ;;
1032 --disable-xanim) _xanim=no ;;
1033 --enable-real) _real=yes ;;
1034 --disable-real) _real=no ;;
1035 --enable-live) _live=yes ;;
1036 --disable-live) _live=no ;;
1037 --enable-nemesi) _nemesi=yes ;;
1038 --disable-nemesi) _nemesi=no ;;
1039 --enable-xinerama) _xinerama=yes ;;
1040 --disable-xinerama) _xinerama=no ;;
1041 --enable-mga) _mga=yes ;;
1042 --disable-mga) _mga=no ;;
1043 --enable-xmga) _xmga=yes ;;
1044 --disable-xmga) _xmga=no ;;
1045 --enable-vm) _vm=yes ;;
1046 --disable-vm) _vm=no ;;
1047 --enable-xf86keysym) _xf86keysym=yes ;;
1048 --disable-xf86keysym) _xf86keysym=no ;;
1049 --enable-sunaudio) _sunaudio=yes ;;
1050 --disable-sunaudio) _sunaudio=no ;;
1051 --enable-sgiaudio) _sgiaudio=yes ;;
1052 --disable-sgiaudio) _sgiaudio=no ;;
1053 --enable-alsa) _alsa=yes ;;
1054 --disable-alsa) _alsa=no ;;
1055 --enable-tv) _tv=yes ;;
1056 --disable-tv) _tv=no ;;
1057 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1058 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1059 --enable-tv-v4l1) _tv_v4l1=yes ;;
1060 --disable-tv-v4l1) _tv_v4l1=no ;;
1061 --enable-tv-v4l2) _tv_v4l2=yes ;;
1062 --disable-tv-v4l2) _tv_v4l2=no ;;
1063 --enable-tv-dshow) _tv_dshow=yes ;;
1064 --disable-tv-dshow) _tv_dshow=no ;;
1065 --enable-radio) _radio=yes ;;
1066 --enable-radio-capture) _radio_capture=yes ;;
1067 --disable-radio-capture) _radio_capture=no ;;
1068 --disable-radio) _radio=no ;;
1069 --enable-radio-v4l) _radio_v4l=yes ;;
1070 --disable-radio-v4l) _radio_v4l=no ;;
1071 --enable-radio-v4l2) _radio_v4l2=yes ;;
1072 --disable-radio-v4l2) _radio_v4l2=no ;;
1073 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1074 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1075 --enable-pvr) _pvr=yes ;;
1076 --disable-pvr) _pvr=no ;;
1077 --enable-fastmemcpy) _fastmemcpy=yes ;;
1078 --disable-fastmemcpy) _fastmemcpy=no ;;
1079 --enable-networking) networking=yes ;;
1080 --disable-networking) networking=no ;;
1081 --enable-winsock2_h) _winsock2_h=yes ;;
1082 --disable-winsock2_h) _winsock2_h=no ;;
1083 --enable-smb) _smb=yes ;;
1084 --disable-smb) _smb=no ;;
1085 --enable-vidix) _vidix=yes ;;
1086 --disable-vidix) _vidix=no ;;
1087 --with-vidix-drivers=*)
1088 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1090 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1091 --enable-dhahelper) _dhahelper=yes ;;
1092 --disable-dhahelper) _dhahelper=no ;;
1093 --enable-svgalib_helper) _svgalib_helper=yes ;;
1094 --disable-svgalib_helper) _svgalib_helper=no ;;
1095 --enable-joystick) _joystick=yes ;;
1096 --disable-joystick) _joystick=no ;;
1097 --enable-xvid) _xvid=yes ;;
1098 --disable-xvid) _xvid=no ;;
1099 --enable-libnut) _libnut=yes ;;
1100 --disable-libnut) _libnut=no ;;
1101 --enable-ffmpeg) ffmpeg=yes ;;
1102 --disable-ffmpeg) ffmpeg=no ;;
1103 --ffmpeg-source-dir=*)
1104 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1106 --enable-lirc) _lirc=yes ;;
1107 --disable-lirc) _lirc=no ;;
1108 --enable-lircc) _lircc=yes ;;
1109 --disable-lircc) _lircc=no ;;
1110 --enable-apple-remote) _apple_remote=yes ;;
1111 --disable-apple-remote) _apple_remote=no ;;
1112 --enable-apple-ir) _apple_ir=yes ;;
1113 --disable-apple-ir) _apple_ir=no ;;
1114 --enable-gui) _gui=yes ;;
1115 --disable-gui) _gui=no ;;
1116 --enable-gtk1) _gtk1=yes ;;
1117 --disable-gtk1) _gtk1=no ;;
1118 --enable-termcap) _termcap=yes ;;
1119 --disable-termcap) _termcap=no ;;
1120 --enable-termios) _termios=yes ;;
1121 --disable-termios) _termios=no ;;
1122 --enable-3dfx) _3dfx=yes ;;
1123 --disable-3dfx) _3dfx=no ;;
1124 --enable-s3fb) _s3fb=yes ;;
1125 --disable-s3fb) _s3fb=no ;;
1126 --enable-wii) _wii=yes ;;
1127 --disable-wii) _wii=no ;;
1128 --enable-tdfxfb) _tdfxfb=yes ;;
1129 --disable-tdfxfb) _tdfxfb=no ;;
1130 --disable-tdfxvid) _tdfxvid=no ;;
1131 --enable-tdfxvid) _tdfxvid=yes ;;
1132 --disable-xvr100) _xvr100=no ;;
1133 --enable-xvr100) _xvr100=yes ;;
1134 --disable-tga) _tga=no ;;
1135 --enable-tga) _tga=yes ;;
1136 --enable-directfb) _directfb=yes ;;
1137 --disable-directfb) _directfb=no ;;
1138 --enable-zr) _zr=yes ;;
1139 --disable-zr) _zr=no ;;
1140 --enable-bl) _bl=yes ;;
1141 --disable-bl) _bl=no ;;
1142 --enable-mtrr) _mtrr=yes ;;
1143 --disable-mtrr) _mtrr=no ;;
1144 --enable-largefiles) _largefiles=yes ;;
1145 --disable-largefiles) _largefiles=no ;;
1146 --enable-shm) _shm=yes ;;
1147 --disable-shm) _shm=no ;;
1148 --enable-select) _select=yes ;;
1149 --disable-select) _select=no ;;
1150 --enable-cdparanoia) _cdparanoia=yes ;;
1151 --disable-cdparanoia) _cdparanoia=no ;;
1152 --enable-cddb) _cddb=yes ;;
1153 --disable-cddb) _cddb=no ;;
1154 --enable-big-endian) _big_endian=yes ;;
1155 --disable-big-endian) _big_endian=no ;;
1156 --enable-bitmap-font) _bitmap_font=yes ;;
1157 --disable-bitmap-font) _bitmap_font=no ;;
1158 --enable-freetype) _freetype=yes ;;
1159 --disable-freetype) _freetype=no ;;
1160 --enable-fontconfig) _fontconfig=yes ;;
1161 --disable-fontconfig) _fontconfig=no ;;
1162 --enable-unrarexec) _unrar_exec=yes ;;
1163 --disable-unrarexec) _unrar_exec=no ;;
1164 --enable-ftp) _ftp=yes ;;
1165 --disable-ftp) _ftp=no ;;
1166 --enable-vstream) _vstream=yes ;;
1167 --disable-vstream) _vstream=no ;;
1168 --enable-pthreads) _pthreads=yes ;;
1169 --disable-pthreads) _pthreads=no ;;
1170 --enable-w32threads) _w32threads=yes ;;
1171 --disable-w32threads) _w32threads=no ;;
1172 --enable-ass) _ass=yes ;;
1173 --disable-ass) _ass=no ;;
1174 --enable-rpath) _rpath=yes ;;
1175 --disable-rpath) _rpath=no ;;
1177 --enable-fribidi) _fribidi=yes ;;
1178 --disable-fribidi) _fribidi=no ;;
1180 --enable-enca) _enca=yes ;;
1181 --disable-enca) _enca=no ;;
1183 --enable-inet6) _inet6=yes ;;
1184 --disable-inet6) _inet6=no ;;
1186 --enable-gethostbyname2) _gethostbyname2=yes ;;
1187 --disable-gethostbyname2) _gethostbyname2=no ;;
1189 --enable-dga1) _dga1=yes ;;
1190 --disable-dga1) _dga1=no ;;
1191 --enable-dga2) _dga2=yes ;;
1192 --disable-dga2) _dga2=no ;;
1194 --enable-menu) _menu=yes ;;
1195 --disable-menu) _menu=no ;;
1197 --enable-qtx) _qtx=yes ;;
1198 --disable-qtx) _qtx=no ;;
1200 --enable-coreaudio) _coreaudio=yes ;;
1201 --disable-coreaudio) _coreaudio=no ;;
1202 --enable-corevideo) _corevideo=yes ;;
1203 --disable-corevideo) _corevideo=no ;;
1204 --enable-quartz) _quartz=yes ;;
1205 --disable-quartz) _quartz=no ;;
1206 --enable-macosx-finder) _macosx_finder=yes ;;
1207 --disable-macosx-finder) _macosx_finder=no ;;
1208 --enable-macosx-bundle) _macosx_bundle=yes ;;
1209 --disable-macosx-bundle) _macosx_bundle=no ;;
1211 --enable-maemo) _maemo=yes ;;
1212 --disable-maemo) _maemo=no ;;
1214 --enable-sortsub) _sortsub=yes ;;
1215 --disable-sortsub) _sortsub=no ;;
1217 --enable-crash-debug) _crash_debug=yes ;;
1218 --disable-crash-debug) _crash_debug=no ;;
1219 --enable-sighandler) _sighandler=yes ;;
1220 --disable-sighandler) _sighandler=no ;;
1221 --enable-win32dll) _win32dll=yes ;;
1222 --disable-win32dll) _win32dll=no ;;
1224 --enable-sse) _sse=yes ;;
1225 --disable-sse) _sse=no ;;
1226 --enable-sse2) _sse2=yes ;;
1227 --disable-sse2) _sse2=no ;;
1228 --enable-ssse3) _ssse3=yes ;;
1229 --disable-ssse3) _ssse3=no ;;
1230 --enable-mmxext) _mmxext=yes ;;
1231 --disable-mmxext) _mmxext=no ;;
1232 --enable-3dnow) _3dnow=yes ;;
1233 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1234 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1235 --disable-3dnowext) _3dnowext=no ;;
1236 --enable-cmov) _cmov=yes ;;
1237 --disable-cmov) _cmov=no ;;
1238 --enable-fast-cmov) _fast_cmov=yes ;;
1239 --disable-fast-cmov) _fast_cmov=no ;;
1240 --enable-fast-clz) _fast_clz=yes ;;
1241 --disable-fast-clz) _fast_clz=no ;;
1242 --enable-altivec) _altivec=yes ;;
1243 --disable-altivec) _altivec=no ;;
1244 --enable-armv5te) _armv5te=yes ;;
1245 --disable-armv5te) _armv5te=no ;;
1246 --enable-armv6) _armv6=yes ;;
1247 --disable-armv6) _armv6=no ;;
1248 --enable-armv6t2) _armv6t2=yes ;;
1249 --disable-armv6t2) _armv6t2=no ;;
1250 --enable-armvfp) _armvfp=yes ;;
1251 --disable-armvfp) _armvfp=no ;;
1252 --enable-neon) neon=yes ;;
1253 --disable-neon) neon=no ;;
1254 --enable-iwmmxt) _iwmmxt=yes ;;
1255 --disable-iwmmxt) _iwmmxt=no ;;
1256 --enable-mmx) _mmx=yes ;;
1257 --disable-mmx) # 3Dnow! and MMX2 require MMX
1258 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1261 echo "Unknown parameter: $ac_option"
1262 exit 1
1265 esac
1266 done
1268 if test "$_gui" = yes ; then
1269 die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
1270 (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
1273 # Atmos: moved this here, to be correct, if --prefix is specified
1274 test -z "$_bindir" && _bindir="$_prefix/bin"
1275 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1276 test -z "$_mandir" && _mandir="$_prefix/share/man"
1277 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1278 test -z "$_libdir" && _libdir="$_prefix/lib"
1279 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1281 # Determine our OS name and CPU architecture
1282 if test -z "$_target" ; then
1283 # OS name
1284 system_name=$(uname -s 2>&1)
1285 case "$system_name" in
1286 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1288 Haiku)
1289 system_name=BeOS
1291 IRIX*)
1292 system_name=IRIX
1294 GNU/kFreeBSD)
1295 system_name=FreeBSD
1297 HP-UX*)
1298 system_name=HP-UX
1300 [cC][yY][gG][wW][iI][nN]*)
1301 system_name=CYGWIN
1303 MINGW32*)
1304 system_name=MINGW32
1306 OS/2*)
1307 system_name=OS/2
1310 system_name="$system_name-UNKNOWN"
1312 esac
1315 # host's CPU/instruction set
1316 host_arch=$(uname -p 2>&1)
1317 case "$host_arch" in
1318 i386|sparc|ppc|alpha|arm|mips|vax)
1320 powerpc) # Darwin returns 'powerpc'
1321 host_arch=ppc
1323 *) # uname -p on Linux returns 'unknown' for the processor type,
1324 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1326 # Maybe uname -m (machine hardware name) returns something we
1327 # recognize.
1329 # x86/x86pc is used by QNX
1330 case "$(uname -m 2>&1)" in
1331 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 ;;
1332 ia64) host_arch=ia64 ;;
1333 macppc|ppc) host_arch=ppc ;;
1334 ppc64) host_arch=ppc64 ;;
1335 alpha) host_arch=alpha ;;
1336 sparc) host_arch=sparc ;;
1337 sparc64) host_arch=sparc64 ;;
1338 parisc*|hppa*|9000*) host_arch=hppa ;;
1339 arm*|zaurus|cats) host_arch=arm ;;
1340 sh3|sh4|sh4a) host_arch=sh ;;
1341 s390) host_arch=s390 ;;
1342 s390x) host_arch=s390x ;;
1343 *mips*) host_arch=mips ;;
1344 vax) host_arch=vax ;;
1345 xtensa*) host_arch=xtensa ;;
1346 *) host_arch=UNKNOWN ;;
1347 esac
1349 esac
1350 else # if test -z "$_target"
1351 system_name=$(echo $_target | cut -d '-' -f 2)
1352 case "$(echo $system_name | tr A-Z a-z)" in
1353 linux) system_name=Linux ;;
1354 freebsd) system_name=FreeBSD ;;
1355 gnu/kfreebsd) system_name=FreeBSD ;;
1356 netbsd) system_name=NetBSD ;;
1357 bsd/os) system_name=BSD/OS ;;
1358 openbsd) system_name=OpenBSD ;;
1359 dragonfly) system_name=DragonFly ;;
1360 sunos) system_name=SunOS ;;
1361 qnx) system_name=QNX ;;
1362 morphos) system_name=MorphOS ;;
1363 amigaos) system_name=AmigaOS ;;
1364 mingw32*) system_name=MINGW32 ;;
1365 esac
1366 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1367 host_arch=$(echo $_target | cut -d '-' -f 1)
1368 if test $(echo $host_arch) != "x86_64" ; then
1369 host_arch=$(echo $host_arch | tr '_' '-')
1373 extra_cflags="-I. $extra_cflags"
1374 _timer=timer-linux.c
1375 _getch=getch2.c
1376 if freebsd ; then
1377 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1378 extra_cflags="$extra_cflags -I/usr/local/include"
1381 if netbsd || dragonfly ; then
1382 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1383 extra_cflags="$extra_cflags -I/usr/pkg/include"
1386 if darwin; then
1387 extra_cflags="-mdynamic-no-pic $extra_cflags"
1388 if test "$(basename $_cc)" != "clang" ; then
1389 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
1391 _timer=timer-darwin.c
1394 if aix ; then
1395 extra_ldflags="$extra_ldflags -lC"
1398 if irix ; then
1399 _ranlib='ar -r'
1400 elif linux ; then
1401 _ranlib='true'
1404 if win32 ; then
1405 _exesuf=".exe"
1406 extra_cflags="$extra_cflags -fno-common"
1407 # -lwinmm is always needed for osdep/timer-win2.c
1408 extra_ldflags="$extra_ldflags -lwinmm"
1409 _pe_executable=yes
1410 _timer=timer-win2.c
1411 _priority=yes
1412 def_dos_paths="#define HAVE_DOS_PATHS 1"
1413 def_priority="#define CONFIG_PRIORITY 1"
1416 if mingw32 ; then
1417 _getch=getch2-win.c
1418 _need_shmem=no
1421 if amigaos ; then
1422 _select=no
1423 _sighandler=no
1424 _stream_cache=no
1425 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1426 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1429 if qnx ; then
1430 extra_ldflags="$extra_ldflags -lph"
1433 if os2 ; then
1434 _exesuf=".exe"
1435 _getch=getch2-os2.c
1436 _need_shmem=no
1437 _priority=yes
1438 def_dos_paths="#define HAVE_DOS_PATHS 1"
1439 def_priority="#define CONFIG_PRIORITY 1"
1442 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1443 test "$tmpdir" && break
1444 done
1446 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1447 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1449 TMPLOG="config.log"
1450 TMPC="$mplayer_tmpdir/tmp.c"
1451 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1452 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1453 TMPH="$mplayer_tmpdir/tmp.h"
1454 TMPS="$mplayer_tmpdir/tmp.S"
1456 rm -f "$TMPLOG"
1457 echo configuration: $configuration > "$TMPLOG"
1458 echo >> "$TMPLOG"
1461 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1462 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1466 # Checking CC version...
1467 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1468 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1469 echocheck "$_cc version"
1470 cc_vendor=intel
1471 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1472 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1473 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1474 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1475 # TODO verify older icc/ecc compatibility
1476 case $cc_version in
1478 cc_version="v. ?.??, bad"
1479 cc_fail=yes
1481 10.1|11.0|11.1)
1482 cc_version="$cc_version, ok"
1485 cc_version="$cc_version, bad"
1486 cc_fail=yes
1488 esac
1489 echores "$cc_version"
1490 else
1491 for _cc in "$_cc" gcc cc ; do
1492 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1493 if test "$cc_name_tmp" = "gcc"; then
1494 cc_name=$cc_name_tmp
1495 echocheck "$_cc version"
1496 cc_vendor=gnu
1497 cc_version=$($_cc -dumpversion 2>&1)
1498 case $cc_version in
1499 2.96*)
1500 cc_fail=yes
1503 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1504 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1505 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1507 esac
1508 echores "$cc_version"
1509 break
1511 cc_name_tmp=$($_cc -v 2>&1 | head -n 1 | cut -d ' ' -f 1)
1512 if test "$cc_name_tmp" = "clang"; then
1513 echocheck "$_cc version"
1514 cc_vendor=clang
1515 cc_version=$($_cc -dumpversion 2>&1)
1516 res_comment="experimental support only"
1517 echores "clang $cc_version"
1518 break
1520 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1521 if test "$cc_name_tmp" = "Sun C"; then
1522 echocheck "$_cc version"
1523 cc_vendor=sun
1524 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1525 res_comment="experimental support only"
1526 echores "Sun C $cc_version"
1527 break
1529 done
1530 fi # icc
1531 test "$cc_fail" = yes && die "unsupported compiler version"
1533 if test -z "$_target" && x86 ; then
1534 cat > $TMPC << EOF
1535 int main(void) {
1536 int test[(int)sizeof(char *)-7];
1537 return 0;
1540 cc_check && host_arch=x86_64 || host_arch=i386
1543 echo "Detected operating system: $system_name"
1544 echo "Detected host architecture: $host_arch"
1546 echocheck "host cc"
1547 test "$_host_cc" || _host_cc=$_cc
1548 echores $_host_cc
1550 echocheck "cross compilation"
1551 if test $_cross_compile = auto ; then
1552 _cross_compile=yes
1553 cflag_check "" && "$TMPEXE" && _cross_compile=no
1555 echores $_cross_compile
1557 if test $_cross_compile = yes; then
1558 tmp_run() {
1559 return 0
1563 # ---
1565 # now that we know what compiler should be used for compilation, try to find
1566 # out which assembler is used by the $_cc compiler
1567 if test "$_as" = auto ; then
1568 _as=$($_cc -print-prog-name=as)
1569 test -z "$_as" && _as=as
1572 if test "$_nm" = auto ; then
1573 _nm=$($_cc -print-prog-name=nm)
1574 test -z "$_nm" && _nm=nm
1577 # XXX: this should be ok..
1578 _cpuinfo="echo"
1580 if test "$_runtime_cpudetection" = no ; then
1582 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1583 # FIXME: Remove the cygwin check once AMD CPUs are supported
1584 if test -r /proc/cpuinfo && ! cygwin; then
1585 # Linux with /proc mounted, extract CPU information from it
1586 _cpuinfo="cat /proc/cpuinfo"
1587 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1588 # FreeBSD with Linux emulation /proc mounted,
1589 # extract CPU information from it
1590 # Don't use it on x86 though, it never reports 3Dnow
1591 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1592 elif darwin && ! x86 ; then
1593 # use hostinfo on Darwin
1594 _cpuinfo="hostinfo"
1595 elif aix; then
1596 # use 'lsattr' on AIX
1597 _cpuinfo="lsattr -E -l proc0 -a type"
1598 elif x86; then
1599 # all other OSes try to extract CPU information from a small helper
1600 # program cpuinfo instead
1601 $_cc -o cpuinfo$_exesuf cpuinfo.c
1602 _cpuinfo="./cpuinfo$_exesuf"
1605 if x86 ; then
1606 # gather more CPU information
1607 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1608 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1609 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1610 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1611 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1613 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1615 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1616 -e s/xmm/sse/ -e s/kni/sse/)
1618 for ext in $pparam ; do
1619 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1620 done
1622 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1623 test $_sse = kernel_check && _mmxext=kernel_check
1625 echocheck "CPU vendor"
1626 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1628 echocheck "CPU type"
1629 echores "$pname"
1632 fi # test "$_runtime_cpudetection" = no
1634 if x86 && test "$_runtime_cpudetection" = no ; then
1635 extcheck() {
1636 if test "$1" = kernel_check ; then
1637 echocheck "kernel support of $2"
1638 cat > $TMPC <<EOF
1639 #include <stdlib.h>
1640 #include <signal.h>
1641 static void catch(int sig) { exit(1); }
1642 int main(void) {
1643 signal(SIGILL, catch);
1644 __asm__ volatile ("$3":::"memory"); return 0;
1648 if cc_check && tmp_run ; then
1649 eval _$2=yes
1650 echores "yes"
1651 _optimizing="$_optimizing $2"
1652 return 0
1653 else
1654 eval _$2=no
1655 echores "failed"
1656 echo "It seems that your kernel does not correctly support $2."
1657 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1658 return 1
1661 return 0
1664 extcheck $_mmx "mmx" "emms"
1665 extcheck $_mmxext "mmxext" "sfence"
1666 extcheck $_3dnow "3dnow" "femms"
1667 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1668 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1669 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1670 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1671 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1673 echocheck "mtrr support"
1674 if test "$_mtrr" = kernel_check ; then
1675 _mtrr="yes"
1676 _optimizing="$_optimizing mtrr"
1678 echores "$_mtrr"
1680 if test "$_gcc3_ext" != ""; then
1681 # if we had to disable sse/sse2 because the active kernel does not
1682 # support this instruction set extension, we also have to tell
1683 # gcc3 to not generate sse/sse2 instructions for normal C code
1684 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1690 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1691 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1692 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1693 subarch_all='X86_32 X86_64 PPC64'
1694 case "$host_arch" in
1695 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1696 arch='x86'
1697 subarch='x86_32'
1698 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1699 iproc=486
1700 proc=i486
1703 if test "$_runtime_cpudetection" = no ; then
1704 case "$pvendor" in
1705 AuthenticAMD)
1706 case "$pfamily" in
1707 3) proc=i386 iproc=386 ;;
1708 4) proc=i486 iproc=486 ;;
1709 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1710 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1711 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1712 proc=k6-3
1713 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1714 proc=geode
1715 elif test "$pmodel" -ge 8; then
1716 proc=k6-2
1717 elif test "$pmodel" -ge 6; then
1718 proc=k6
1719 else
1720 proc=i586
1723 6) iproc=686
1724 # It's a bit difficult to determine the correct type of Family 6
1725 # AMD CPUs just from their signature. Instead, we check directly
1726 # whether it supports SSE.
1727 if test "$_sse" = yes; then
1728 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1729 proc=athlon-xp
1730 else
1731 # Again, gcc treats athlon and athlon-tbird similarly.
1732 proc=athlon
1735 15) iproc=686
1736 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1737 # caught and remedied in the optimization tests below.
1738 proc=k8
1741 *) proc=amdfam10 iproc=686
1742 test $_fast_clz = "auto" && _fast_clz=yes
1744 esac
1746 GenuineIntel)
1747 case "$pfamily" in
1748 3) proc=i386 iproc=386 ;;
1749 4) proc=i486 iproc=486 ;;
1750 5) iproc=586
1751 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1752 proc=pentium-mmx # 4 is desktop, 8 is mobile
1753 else
1754 proc=i586
1757 6) iproc=686
1758 if test "$pmodel" -ge 15; then
1759 proc=core2
1760 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1761 proc=pentium-m
1762 elif test "$pmodel" -ge 7; then
1763 proc=pentium3
1764 elif test "$pmodel" -ge 3; then
1765 proc=pentium2
1766 else
1767 proc=i686
1769 test $_fast_clz = "auto" && _fast_clz=yes
1771 15) iproc=686
1772 # A nocona in 32-bit mode has no more capabilities than a prescott.
1773 if test "$pmodel" -ge 3; then
1774 proc=prescott
1775 else
1776 proc=pentium4
1777 test $_fast_clz = "auto" && _fast_clz=yes
1779 test $_fast_cmov = "auto" && _fast_cmov=no
1781 *) proc=prescott iproc=686 ;;
1782 esac
1784 CentaurHauls)
1785 case "$pfamily" in
1786 5) iproc=586
1787 if test "$pmodel" -ge 8; then
1788 proc=winchip2
1789 elif test "$pmodel" -ge 4; then
1790 proc=winchip-c6
1791 else
1792 proc=i586
1795 6) iproc=686
1796 if test "$pmodel" -ge 9; then
1797 proc=c3-2
1798 else
1799 proc=c3
1800 iproc=586
1803 *) proc=i686 iproc=i686 ;;
1804 esac
1806 unknown)
1807 case "$pfamily" in
1808 3) proc=i386 iproc=386 ;;
1809 4) proc=i486 iproc=486 ;;
1810 *) proc=i586 iproc=586 ;;
1811 esac
1814 proc=i586 iproc=586 ;;
1815 esac
1816 test $_fast_clz = "auto" && _fast_clz=no
1817 fi # test "$_runtime_cpudetection" = no
1820 # check that gcc supports our CPU, if not, fall back to earlier ones
1821 # LGB: check -mcpu and -march swithing step by step with enabling
1822 # to fall back till 386.
1824 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1826 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1827 cpuopt=-mtune
1828 else
1829 cpuopt=-mcpu
1832 echocheck "GCC & CPU optimization abilities"
1833 if test "$_runtime_cpudetection" = no ; then
1834 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1835 cflag_check -march=native && proc=native
1837 if test "$proc" = "amdfam10"; then
1838 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1840 if test "$proc" = "k8"; then
1841 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1843 if test "$proc" = "athlon-xp"; then
1844 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1846 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1847 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1849 if test "$proc" = "k6" || test "$proc" = "c3"; then
1850 if ! cflag_check -march=$proc $cpuopt=$proc; then
1851 if cflag_check -march=i586 $cpuopt=i686; then
1852 proc=i586-i686
1853 else
1854 proc=i586
1858 if test "$proc" = "prescott" ; then
1859 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1861 if test "$proc" = "core2" ; then
1862 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1864 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
1865 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1867 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1868 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1870 if test "$proc" = "i586"; then
1871 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1873 if test "$proc" = "i486" ; then
1874 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1876 if test "$proc" = "i386" ; then
1877 cflag_check -march=$proc $cpuopt=$proc || proc=error
1879 if test "$proc" = "error" ; then
1880 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1881 _mcpu=""
1882 _march=""
1883 _optimizing=""
1884 elif test "$proc" = "i586-i686"; then
1885 _march="-march=i586"
1886 _mcpu="$cpuopt=i686"
1887 _optimizing="$proc"
1888 else
1889 _march="-march=$proc"
1890 _mcpu="$cpuopt=$proc"
1891 _optimizing="$proc"
1893 else # if test "$_runtime_cpudetection" = no
1894 _mcpu="$cpuopt=generic"
1895 # at least i486 required, for bswap instruction
1896 _march="-march=i486"
1897 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1898 cflag_check $_mcpu || _mcpu=""
1899 cflag_check $_march $_mcpu || _march=""
1902 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1903 ## autodetected mcpu/march parameters
1904 if test "$_target" ; then
1905 # TODO: it may be a good idea to check GCC and fall back in all cases
1906 if test "$host_arch" = "i586-i686"; then
1907 _march="-march=i586"
1908 _mcpu="$cpuopt=i686"
1909 else
1910 _march="-march=$host_arch"
1911 _mcpu="$cpuopt=$host_arch"
1914 proc="$host_arch"
1916 case "$proc" in
1917 i386) iproc=386 ;;
1918 i486) iproc=486 ;;
1919 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1920 i686|athlon*|pentium*) iproc=686 ;;
1921 *) iproc=586 ;;
1922 esac
1925 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1926 _fast_cmov="yes"
1927 else
1928 _fast_cmov="no"
1930 test $_fast_clz = "auto" && _fast_clz=yes
1932 echores "$proc"
1935 ia64)
1936 arch='ia64'
1937 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1938 iproc='ia64'
1941 x86_64|amd64)
1942 arch='x86'
1943 subarch='x86_64'
1944 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1945 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1946 iproc='x86_64'
1948 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1949 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1950 cpuopt=-mtune
1951 else
1952 cpuopt=-mcpu
1954 if test "$_runtime_cpudetection" = no ; then
1955 case "$pvendor" in
1956 AuthenticAMD)
1957 case "$pfamily" in
1958 15) proc=k8
1959 test $_fast_clz = "auto" && _fast_clz=no
1961 *) proc=amdfam10;;
1962 esac
1964 GenuineIntel)
1965 case "$pfamily" in
1966 6) proc=core2;;
1968 # 64-bit prescotts exist, but as far as GCC is concerned they
1969 # have the same capabilities as a nocona.
1970 proc=nocona
1971 test $_fast_cmov = "auto" && _fast_cmov=no
1972 test $_fast_clz = "auto" && _fast_clz=no
1974 esac
1977 proc=error;;
1978 esac
1979 fi # test "$_runtime_cpudetection" = no
1981 echocheck "GCC & CPU optimization abilities"
1982 # This is a stripped-down version of the i386 fallback.
1983 if test "$_runtime_cpudetection" = no ; then
1984 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1985 cflag_check -march=native && proc=native
1987 # --- AMD processors ---
1988 if test "$proc" = "amdfam10"; then
1989 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1991 if test "$proc" = "k8"; then
1992 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1994 # This will fail if gcc version < 3.3, which is ok because earlier
1995 # versions don't really support 64-bit on amd64.
1996 # Is this a valid assumption? -Corey
1997 if test "$proc" = "athlon-xp"; then
1998 cflag_check -march=$proc $cpuopt=$proc || proc=error
2000 # --- Intel processors ---
2001 if test "$proc" = "core2"; then
2002 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
2004 if test "$proc" = "x86-64"; then
2005 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
2007 if test "$proc" = "nocona"; then
2008 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
2010 if test "$proc" = "pentium4"; then
2011 cflag_check -march=$proc $cpuopt=$proc || proc=error
2014 _march="-march=$proc"
2015 _mcpu="$cpuopt=$proc"
2016 if test "$proc" = "error" ; then
2017 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2018 _mcpu=""
2019 _march=""
2021 else # if test "$_runtime_cpudetection" = no
2022 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2023 _march="-march=x86-64"
2024 _mcpu="$cpuopt=generic"
2025 cflag_check $_mcpu || _mcpu="x86-64"
2026 cflag_check $_mcpu || _mcpu=""
2027 cflag_check $_march $_mcpu || _march=""
2030 _optimizing="$proc"
2031 test $_fast_cmov = "auto" && _fast_cmov=yes
2032 test $_fast_clz = "auto" && _fast_clz=yes
2034 echores "$proc"
2037 sparc|sparc64)
2038 arch='sparc'
2039 iproc='sparc'
2040 if test "$host_arch" = "sparc64" ; then
2041 _vis='yes'
2042 proc='ultrasparc'
2043 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2044 elif sunos ; then
2045 echocheck "CPU type"
2046 karch=$(uname -m)
2047 case "$(echo $karch)" in
2048 sun4) proc=v7 ;;
2049 sun4c) proc=v7 ;;
2050 sun4d) proc=v8 ;;
2051 sun4m) proc=v8 ;;
2052 sun4u) proc=ultrasparc _vis='yes' ;;
2053 sun4v) proc=v9 ;;
2054 *) proc=v8 ;;
2055 esac
2056 echores "$proc"
2057 else
2058 proc=v8
2060 _mcpu="-mcpu=$proc"
2061 _optimizing="$proc"
2064 arm*)
2065 arch='arm'
2066 iproc='arm'
2069 avr32)
2070 arch='avr32'
2071 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2072 iproc='avr32'
2073 test $_fast_clz = "auto" && _fast_clz=yes
2076 sh|sh4)
2077 arch='sh4'
2078 iproc='sh4'
2081 ppc|ppc64|powerpc|powerpc64)
2082 arch='ppc'
2083 def_dcbzl='#define HAVE_DCBZL 0'
2084 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2085 iproc='ppc'
2087 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2088 subarch='ppc64'
2089 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2091 echocheck "CPU type"
2092 case $system_name in
2093 Linux)
2094 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2095 if test -n "$($_cpuinfo | grep altivec)"; then
2096 test $_altivec = auto && _altivec=yes
2099 Darwin)
2100 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2101 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2102 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2103 test $_altivec = auto && _altivec=yes
2106 NetBSD)
2107 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2108 case $cc_version in
2109 2*|3.0*|3.1*|3.2*|3.3*)
2112 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2113 test $_altivec = auto && _altivec=yes
2116 esac
2118 AIX)
2119 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2121 esac
2122 if test "$_altivec" = yes; then
2123 echores "$proc altivec"
2124 else
2125 _altivec=no
2126 echores "$proc"
2129 echocheck "GCC & CPU optimization abilities"
2131 if test -n "$proc"; then
2132 case "$proc" in
2133 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2134 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2135 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2136 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2137 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2138 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2139 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2140 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2141 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2142 *) ;;
2143 esac
2144 # gcc 3.1(.1) and up supports 7400 and 7450
2145 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2146 case "$proc" in
2147 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2148 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2149 *) ;;
2150 esac
2152 # gcc 3.2 and up supports 970
2153 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2154 case "$proc" in
2155 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2156 def_dcbzl='#define HAVE_DCBZL 1' ;;
2157 *) ;;
2158 esac
2160 # gcc 3.3 and up supports POWER4
2161 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2162 case "$proc" in
2163 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2164 *) ;;
2165 esac
2167 # gcc 3.4 and up supports 440*
2168 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2169 case "$proc" in
2170 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2171 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2172 *) ;;
2173 esac
2175 # gcc 4.0 and up supports POWER5
2176 if test "$_cc_major" -ge "4"; then
2177 case "$proc" in
2178 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2179 *) ;;
2180 esac
2184 if test -n "$_mcpu"; then
2185 _optimizing=$(echo $_mcpu | cut -c 8-)
2186 echores "$_optimizing"
2187 else
2188 echores "none"
2191 test $_fast_clz = "auto" && _fast_clz=yes
2195 alpha*)
2196 arch='alpha'
2197 iproc='alpha'
2198 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2200 echocheck "CPU type"
2201 cat > $TMPC << EOF
2202 int main(void) {
2203 unsigned long ver, mask;
2204 __asm__ ("implver %0" : "=r" (ver));
2205 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2206 printf("%ld-%x\n", ver, ~mask);
2207 return 0;
2210 $_cc -o "$TMPEXE" "$TMPC"
2211 case $("$TMPEXE") in
2213 0-0) proc="ev4"; _mvi="0";;
2214 1-0) proc="ev5"; _mvi="0";;
2215 1-1) proc="ev56"; _mvi="0";;
2216 1-101) proc="pca56"; _mvi="1";;
2217 2-303) proc="ev6"; _mvi="1";;
2218 2-307) proc="ev67"; _mvi="1";;
2219 2-1307) proc="ev68"; _mvi="1";;
2220 esac
2221 echores "$proc"
2223 echocheck "GCC & CPU optimization abilities"
2224 if test "$proc" = "ev68" ; then
2225 cc_check -mcpu=$proc || proc=ev67
2227 if test "$proc" = "ev67" ; then
2228 cc_check -mcpu=$proc || proc=ev6
2230 _mcpu="-mcpu=$proc"
2231 echores "$proc"
2233 test $_fast_clz = "auto" && _fast_clz=yes
2235 _optimizing="$proc"
2238 mips*)
2239 arch='mips'
2240 iproc='mips'
2242 if irix ; then
2243 echocheck "CPU type"
2244 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2245 case "$(echo $proc)" in
2246 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2247 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2248 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2249 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2250 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2251 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2252 esac
2253 # gcc < 3.x does not support -mtune.
2254 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2255 _mcpu=''
2257 echores "$proc"
2260 test $_fast_clz = "auto" && _fast_clz=yes
2264 hppa)
2265 arch='pa_risc'
2266 iproc='PA-RISC'
2269 s390)
2270 arch='s390'
2271 iproc='390'
2274 s390x)
2275 arch='s390x'
2276 iproc='390x'
2279 vax)
2280 arch='vax'
2281 iproc='vax'
2284 xtensa)
2285 arch='xtensa'
2286 iproc='xtensa'
2289 generic)
2290 arch='generic'
2294 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2295 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2296 die "unsupported architecture $host_arch"
2298 esac # case "$host_arch" in
2300 if test "$_runtime_cpudetection" = yes ; then
2301 if x86 ; then
2302 test "$_cmov" != no && _cmov=yes
2303 x86_32 && _cmov=no
2304 test "$_mmx" != no && _mmx=yes
2305 test "$_3dnow" != no && _3dnow=yes
2306 test "$_3dnowext" != no && _3dnowext=yes
2307 test "$_mmxext" != no && _mmxext=yes
2308 test "$_sse" != no && _sse=yes
2309 test "$_sse2" != no && _sse2=yes
2310 test "$_ssse3" != no && _ssse3=yes
2311 test "$_mtrr" != no && _mtrr=yes
2313 if ppc; then
2314 _altivec=yes
2319 # endian testing
2320 echocheck "byte order"
2321 if test "$_big_endian" = auto ; then
2322 cat > $TMPC <<EOF
2323 short ascii_name[] = {
2324 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2325 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2326 int main(void) { return (long)ascii_name; }
2328 if cc_check ; then
2329 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2330 _big_endian=yes
2331 else
2332 _big_endian=no
2334 else
2335 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2338 if test "$_big_endian" = yes ; then
2339 _byte_order='big-endian'
2340 def_words_endian='#define WORDS_BIGENDIAN 1'
2341 def_bigendian='#define HAVE_BIGENDIAN 1'
2342 else
2343 _byte_order='little-endian'
2344 def_words_endian='#undef WORDS_BIGENDIAN'
2345 def_bigendian='#define HAVE_BIGENDIAN 0'
2347 echores "$_byte_order"
2350 echocheck "extern symbol prefix"
2351 cat > $TMPC << EOF
2352 int ff_extern;
2354 cc_check -c || die "Symbol mangling check failed."
2355 sym=$($_nm -P -g $TMPEXE)
2356 extern_prefix=${sym%%ff_extern*}
2357 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2358 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2359 echores $extern_prefix
2362 echocheck "assembler support of -pipe option"
2363 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2364 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2367 echocheck "compiler support of named assembler arguments"
2368 _named_asm_args=yes
2369 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2370 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2371 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2372 _named_asm_args=no
2373 def_named_asm_args="#undef NAMED_ASM_ARGS"
2375 echores $_named_asm_args
2378 if darwin && test "$cc_vendor" = "gnu" ; then
2379 echocheck "GCC support of -mstackrealign"
2380 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2381 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2382 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2383 # wrong code with this flag, but this can be worked around by adding
2384 # -fno-unit-at-a-time as described in the blog post at
2385 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2386 cat > $TMPC << EOF
2387 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2388 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2390 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2391 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time &&
2392 tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2393 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2394 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2397 # Checking for CFLAGS
2398 _install_strip="-s"
2399 if test "$_profile" != "" || test "$_debug" != "" ; then
2400 CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
2401 WARNFLAGS="-W -Wall"
2402 _install_strip=
2403 elif test -z "$CFLAGS" ; then
2404 if test "$cc_vendor" = "intel" ; then
2405 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2406 WARNFLAGS="-wd167 -wd556 -wd144"
2407 elif test "$cc_vendor" = "sun" ; then
2408 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2409 elif test "$cc_vendor" = "clang"; then
2410 CFLAGS="-O2 $_march $_pipe"
2411 elif test "$cc_vendor" != "gnu" ; then
2412 CFLAGS="-O2 $_march $_mcpu $_pipe"
2413 else
2414 CFLAGS="-O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2415 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2416 extra_ldflags="$extra_ldflags -ffast-math"
2418 else
2419 warn_cflags=yes
2422 if test "$cc_vendor" = "gnu" ; then
2423 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2424 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2425 # that's the only variable specific to C now, and this option is not valid
2426 # for C++.
2427 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2428 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2429 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2430 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2431 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2432 else
2433 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2436 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2437 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2440 if test -n "$LDFLAGS" ; then
2441 extra_ldflags="$extra_ldflags $LDFLAGS"
2442 warn_cflags=yes
2443 elif test "$cc_vendor" = "intel" ; then
2444 extra_ldflags="$extra_ldflags -i-static"
2446 if test -n "$CPPFLAGS" ; then
2447 extra_cflags="$extra_cflags $CPPFLAGS"
2448 warn_cflags=yes
2453 if x86_32 ; then
2454 # Checking assembler (_as) compatibility...
2455 # Added workaround for older as that reads from stdin by default - atmos
2456 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2457 echocheck "assembler ($_as $as_version)"
2459 _pref_as_version='2.9.1'
2460 echo 'nop' > $TMPS
2461 if test "$_mmx" = yes ; then
2462 echo 'emms' >> $TMPS
2464 if test "$_3dnow" = yes ; then
2465 _pref_as_version='2.10.1'
2466 echo 'femms' >> $TMPS
2468 if test "$_3dnowext" = yes ; then
2469 _pref_as_version='2.10.1'
2470 echo 'pswapd %mm0, %mm0' >> $TMPS
2472 if test "$_mmxext" = yes ; then
2473 _pref_as_version='2.10.1'
2474 echo 'movntq %mm0, (%eax)' >> $TMPS
2476 if test "$_sse" = yes ; then
2477 _pref_as_version='2.10.1'
2478 echo 'xorps %xmm0, %xmm0' >> $TMPS
2480 #if test "$_sse2" = yes ; then
2481 # _pref_as_version='2.11'
2482 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2484 if test "$_cmov" = yes ; then
2485 _pref_as_version='2.10.1'
2486 echo 'cmovb %eax, %ebx' >> $TMPS
2488 if test "$_ssse3" = yes ; then
2489 _pref_as_version='2.16.92'
2490 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2492 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2494 if test "$as_verc_fail" != yes ; then
2495 echores "ok"
2496 else
2497 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2498 echores "failed"
2499 die "obsolete binutils version"
2502 fi #if x86_32
2505 echocheck "PIC"
2506 pic=no
2507 cat > $TMPC << EOF
2508 int main(void) {
2509 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2510 #error PIC not enabled
2511 #endif
2512 return 0;
2515 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2516 echores $pic
2519 if x86 ; then
2521 echocheck ".align is a power of two"
2522 if test "$_asmalign_pot" = auto ; then
2523 _asmalign_pot=no
2524 inline_asm_check '".align 3"' && _asmalign_pot=yes
2526 if test "$_asmalign_pot" = "yes" ; then
2527 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2528 else
2529 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2531 echores $_asmalign_pot
2534 echocheck "10 assembler operands"
2535 ten_operands=no
2536 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2537 cat > $TMPC << EOF
2538 int main(void) {
2539 int x=0;
2540 __asm__ volatile(
2542 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2544 return 0;
2547 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2548 echores $ten_operands
2550 echocheck "ebx availability"
2551 ebx_available=no
2552 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2553 cat > $TMPC << EOF
2554 int main(void) {
2555 int x;
2556 __asm__ volatile(
2557 "xor %0, %0"
2558 :"=b"(x)
2559 // just adding ebx to clobber list seems unreliable with some
2560 // compilers, e.g. Haiku's gcc 2.95
2562 // and the above check does not work for OSX 64 bit...
2563 __asm__ volatile("":::"%ebx");
2564 return 0;
2567 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2568 echores $ebx_available
2571 echocheck "yasm"
2572 if test -z "$YASMFLAGS" ; then
2573 if darwin ; then
2574 x86_64 && objformat="macho64" || objformat="macho"
2575 elif win32 ; then
2576 objformat="win32"
2577 else
2578 objformat="elf"
2580 # currently tested for Linux x86, x86_64
2581 YASMFLAGS="-f $objformat"
2582 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2583 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2584 case "$objformat" in
2585 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2586 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2587 esac
2588 else
2589 warn_cflags=yes
2592 echo "pabsw xmm0, xmm0" > $TMPS
2593 yasm_check || _yasm=""
2594 if test $_yasm ; then
2595 def_yasm='#define HAVE_YASM 1'
2596 have_yasm="yes"
2597 echores "$_yasm"
2598 else
2599 def_yasm='#define HAVE_YASM 0'
2600 have_yasm="no"
2601 echores "no"
2604 echocheck "bswap"
2605 def_bswap='#define HAVE_BSWAP 0'
2606 echo 'bswap %eax' > $TMPS
2607 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2608 echores "$bswap"
2609 fi #if x86
2612 #FIXME: This should happen before the check for CFLAGS..
2613 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2614 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2616 # check if AltiVec is supported by the compiler, and how to enable it
2617 echocheck "GCC AltiVec flags"
2618 if $(cflag_check -maltivec -mabi=altivec) ; then
2619 _altivec_gcc_flags="-maltivec -mabi=altivec"
2620 # check if <altivec.h> should be included
2621 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2622 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2623 inc_altivec_h='#include <altivec.h>'
2624 else
2625 if $(cflag_check -faltivec) ; then
2626 _altivec_gcc_flags="-faltivec"
2627 else
2628 _altivec=no
2629 _altivec_gcc_flags="none, AltiVec disabled"
2633 echores "$_altivec_gcc_flags"
2635 # check if the compiler supports braces for vector declarations
2636 cat > $TMPC << EOF
2637 $inc_altivec_h
2638 int main(void) { (vector int) {1}; return 0; }
2640 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2642 # Disable runtime cpudetection if we cannot generate AltiVec code or
2643 # AltiVec is disabled by the user.
2644 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2645 && _runtime_cpudetection=no
2647 # Show that we are optimizing for AltiVec (if enabled and supported).
2648 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2649 && _optimizing="$_optimizing altivec"
2651 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2652 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2655 if ppc ; then
2656 def_xform_asm='#define HAVE_XFORM_ASM 0'
2657 xform_asm=no
2658 echocheck "XFORM ASM support"
2659 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2660 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2661 echores "$xform_asm"
2664 if arm ; then
2665 echocheck "ARM pld instruction"
2666 pld=no
2667 inline_asm_check '"pld [r0]"' && pld=yes
2668 echores "$pld"
2670 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2671 if test $_armv5te = "auto" ; then
2672 _armv5te=no
2673 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2675 echores "$_armv5te"
2677 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2679 echocheck "ARMv6 (SIMD instructions)"
2680 if test $_armv6 = "auto" ; then
2681 _armv6=no
2682 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2684 echores "$_armv6"
2686 echocheck "ARMv6t2 (SIMD instructions)"
2687 if test $_armv6t2 = "auto" ; then
2688 _armv6t2=no
2689 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2691 echores "$_armv6"
2693 echocheck "ARM VFP"
2694 if test $_armvfp = "auto" ; then
2695 _armvfp=no
2696 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2698 echores "$_armvfp"
2700 echocheck "ARM NEON"
2701 if test $neon = "auto" ; then
2702 neon=no
2703 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2705 echores "$neon"
2707 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2708 if test $_iwmmxt = "auto" ; then
2709 _iwmmxt=no
2710 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2712 echores "$_iwmmxt"
2715 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2716 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2717 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2718 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2719 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2720 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2721 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2722 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2723 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2724 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2725 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2726 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2727 test "$pld" = yes && cpuexts="PLD $cpuexts"
2728 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2729 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2730 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2731 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2732 test "$neon" = yes && cpuexts="NEON $cpuexts"
2733 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2734 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2735 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2737 # Checking kernel version...
2738 if x86_32 && linux ; then
2739 _k_verc_problem=no
2740 kernel_version=$(uname -r 2>&1)
2741 echocheck "$system_name kernel version"
2742 case "$kernel_version" in
2743 '') kernel_version="?.??"; _k_verc_fail=yes;;
2744 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2745 _k_verc_problem=yes;;
2746 esac
2747 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2748 _k_verc_fail=yes
2750 if test "$_k_verc_fail" ; then
2751 echores "$kernel_version, fail"
2752 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2753 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2754 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2755 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2756 echo "2.2.x you must upgrade it to get SSE support!"
2757 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2758 else
2759 echores "$kernel_version, ok"
2763 ######################
2764 # MAIN TESTS GO HERE #
2765 ######################
2768 echocheck "-lposix"
2769 if cflag_check -lposix ; then
2770 extra_ldflags="$extra_ldflags -lposix"
2771 echores "yes"
2772 else
2773 echores "no"
2776 echocheck "-lm"
2777 if cflag_check -lm ; then
2778 _ld_lm="-lm"
2779 echores "yes"
2780 else
2781 _ld_lm=""
2782 echores "no"
2786 echocheck "langinfo"
2787 if test "$_langinfo" = auto ; then
2788 _langinfo=no
2789 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2791 if test "$_langinfo" = yes ; then
2792 def_langinfo='#define HAVE_LANGINFO 1'
2793 else
2794 def_langinfo='#undef HAVE_LANGINFO'
2796 echores "$_langinfo"
2799 echocheck "translation support"
2800 if test "$_translation" = yes; then
2801 def_translation="#define CONFIG_TRANSLATION 1"
2802 else
2803 def_translation="#undef CONFIG_TRANSLATION"
2805 echores "$_translation"
2807 echocheck "language"
2808 # Set preferred languages, "all" uses English as main language.
2809 test -z "$language" && language=$LINGUAS
2810 test -z "$language_doc" && language_doc=$language
2811 test -z "$language_man" && language_man=$language
2812 test -z "$language_msg" && language_msg="all"
2813 language_doc=$(echo $language_doc | tr , " ")
2814 language_man=$(echo $language_man | tr , " ")
2815 language_msg=$(echo $language_msg | tr , " ")
2817 test "$language_doc" = "all" && language_doc=$doc_lang_all
2818 test "$language_man" = "all" && language_man=$man_lang_all
2819 test "$language_msg" = "all" && language_msg=$msg_lang_all
2821 if test "$_translation" != yes ; then
2822 language_msg=""
2825 # Prune non-existing translations from language lists.
2826 # Set message translation to the first available language.
2827 # Fall back on English.
2828 for lang in $language_doc ; do
2829 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2830 done
2831 language_doc=$tmp_language_doc
2832 test -z "$language_doc" && language_doc=en
2834 for lang in $language_man ; do
2835 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2836 done
2837 language_man=$tmp_language_man
2838 test -z "$language_man" && language_man=en
2840 for lang in $language_msg ; do
2841 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2842 done
2843 language_msg=$tmp_language_msg
2845 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2848 echocheck "enable sighandler"
2849 if test "$_sighandler" = yes ; then
2850 def_sighandler='#define CONFIG_SIGHANDLER 1'
2851 else
2852 def_sighandler='#undef CONFIG_SIGHANDLER'
2854 echores "$_sighandler"
2856 echocheck "runtime cpudetection"
2857 if test "$_runtime_cpudetection" = yes ; then
2858 _optimizing="Runtime CPU-Detection enabled"
2859 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2860 else
2861 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2863 echores "$_runtime_cpudetection"
2866 echocheck "restrict keyword"
2867 for restrict_keyword in restrict __restrict __restrict__ ; do
2868 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2869 if cc_check; then
2870 def_restrict_keyword=$restrict_keyword
2871 break;
2873 done
2874 if [ -n "$def_restrict_keyword" ]; then
2875 echores "$def_restrict_keyword"
2876 else
2877 echores "none"
2879 # Avoid infinite recursion loop ("#define restrict restrict")
2880 if [ "$def_restrict_keyword" != "restrict" ]; then
2881 def_restrict_keyword="#define restrict $def_restrict_keyword"
2882 else
2883 def_restrict_keyword=""
2887 echocheck "__builtin_expect"
2888 # GCC branch prediction hint
2889 cat > $TMPC << EOF
2890 static int foo(int a) {
2891 a = __builtin_expect(a, 10);
2892 return a == 10 ? 0 : 1;
2894 int main(void) { return foo(10) && foo(0); }
2896 _builtin_expect=no
2897 cc_check && _builtin_expect=yes
2898 if test "$_builtin_expect" = yes ; then
2899 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2900 else
2901 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2903 echores "$_builtin_expect"
2906 echocheck "kstat"
2907 _kstat=no
2908 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2909 if test "$_kstat" = yes ; then
2910 def_kstat="#define HAVE_LIBKSTAT 1"
2911 extra_ldflags="$extra_ldflags -lkstat"
2912 else
2913 def_kstat="#undef HAVE_LIBKSTAT"
2915 echores "$_kstat"
2918 echocheck "posix4"
2919 # required for nanosleep on some systems
2920 _posix4=no
2921 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2922 if test "$_posix4" = yes ; then
2923 extra_ldflags="$extra_ldflags -lposix4"
2925 echores "$_posix4"
2927 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2928 echocheck $func
2929 eval _$func=no
2930 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2931 if eval test "x\$_$func" = "xyes"; then
2932 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2933 echores yes
2934 else
2935 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2936 echores no
2938 done
2941 echocheck "mkstemp"
2942 _mkstemp=no
2943 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2944 if test "$_mkstemp" = yes ; then
2945 def_mkstemp='#define HAVE_MKSTEMP 1'
2946 else
2947 def_mkstemp='#define HAVE_MKSTEMP 0'
2949 echores "$_mkstemp"
2952 echocheck "nanosleep"
2953 _nanosleep=no
2954 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2955 if test "$_nanosleep" = yes ; then
2956 def_nanosleep='#define HAVE_NANOSLEEP 1'
2957 else
2958 def_nanosleep='#undef HAVE_NANOSLEEP'
2960 echores "$_nanosleep"
2963 echocheck "socklib"
2964 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2965 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2966 cat > $TMPC << EOF
2967 #include <netdb.h>
2968 #include <sys/socket.h>
2969 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2971 _socklib=no
2972 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2973 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2974 done
2975 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2976 if test $_winsock2_h = auto ; then
2977 _winsock2_h=no
2978 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2980 test "$_ld_sock" && res_comment="using $_ld_sock"
2981 echores "$_socklib"
2984 if test $_winsock2_h = yes ; then
2985 _ld_sock="-lws2_32"
2986 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2987 else
2988 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2992 echocheck "arpa/inet.h"
2993 arpa_inet_h=no
2994 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2995 header_check arpa/inet.h && arpa_inet_h=yes &&
2996 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2997 echores "$arpa_inet_h"
3000 echocheck "inet_pton()"
3001 def_inet_pton='#define HAVE_INET_PTON 0'
3002 inet_pton=no
3003 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3004 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
3005 done
3006 if test $inet_pton = yes ; then
3007 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3008 def_inet_pton='#define HAVE_INET_PTON 1'
3010 echores "$inet_pton"
3013 echocheck "inet_aton()"
3014 def_inet_aton='#define HAVE_INET_ATON 0'
3015 inet_aton=no
3016 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3017 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
3018 done
3019 if test $inet_aton = yes ; then
3020 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3021 def_inet_aton='#define HAVE_INET_ATON 1'
3023 echores "$inet_aton"
3026 echocheck "socklen_t"
3027 _socklen_t=no
3028 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3029 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
3030 done
3031 if test "$_socklen_t" = yes ; then
3032 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3033 else
3034 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3036 echores "$_socklen_t"
3039 echocheck "closesocket()"
3040 _closesocket=no
3041 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
3042 if test "$_closesocket" = yes ; then
3043 def_closesocket='#define HAVE_CLOSESOCKET 1'
3044 else
3045 def_closesocket='#define HAVE_CLOSESOCKET 0'
3047 echores "$_closesocket"
3050 echocheck "networking"
3051 test $_winsock2_h = no && test $inet_pton = no &&
3052 test $inet_aton = no && networking=no
3053 if test "$networking" = yes ; then
3054 def_network='#define CONFIG_NETWORK 1'
3055 def_networking='#define CONFIG_NETWORKING 1'
3056 extra_ldflags="$extra_ldflags $_ld_sock"
3057 inputmodules="networking $inputmodules"
3058 else
3059 noinputmodules="networking $noinputmodules"
3060 def_network='#define CONFIG_NETWORK 0'
3061 def_networking='#undef CONFIG_NETWORKING'
3063 echores "$networking"
3066 echocheck "inet6"
3067 if test "$_inet6" = auto ; then
3068 cat > $TMPC << EOF
3069 #include <sys/types.h>
3070 #if !defined(_WIN32)
3071 #include <sys/socket.h>
3072 #include <netinet/in.h>
3073 #else
3074 #include <ws2tcpip.h>
3075 #endif
3076 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3078 _inet6=no
3079 if cc_check $_ld_sock ; then
3080 _inet6=yes
3083 if test "$_inet6" = yes ; then
3084 def_inet6='#define HAVE_AF_INET6 1'
3085 else
3086 def_inet6='#undef HAVE_AF_INET6'
3088 echores "$_inet6"
3091 echocheck "gethostbyname2"
3092 if test "$_gethostbyname2" = auto ; then
3093 cat > $TMPC << EOF
3094 #include <sys/types.h>
3095 #include <sys/socket.h>
3096 #include <netdb.h>
3097 int main(void) { gethostbyname2("", AF_INET); return 0; }
3099 _gethostbyname2=no
3100 if cc_check ; then
3101 _gethostbyname2=yes
3104 if test "$_gethostbyname2" = yes ; then
3105 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3106 else
3107 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3109 echores "$_gethostbyname2"
3112 echocheck "inttypes.h (required)"
3113 _inttypes=no
3114 header_check inttypes.h && _inttypes=yes
3115 echores "$_inttypes"
3117 if test "$_inttypes" = no ; then
3118 echocheck "sys/bitypes.h (inttypes.h predecessor)"
3119 header_check sys/bitypes.h && _inttypes=yes
3120 if test "$_inttypes" = yes ; then
3121 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."
3122 else
3123 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3128 echocheck "int_fastXY_t in inttypes.h"
3129 _fast_inttypes=no
3130 statement_check "inttypes.h" 'volatile int_fast16_t v = 0' && _fast_inttypes=yes
3131 if test "$_fast_inttypes" = no ; then
3132 def_fast_inttypes='
3133 typedef signed char int_fast8_t;
3134 typedef signed int int_fast16_t;
3135 typedef signed int int_fast32_t;
3136 typedef signed long long int_fast64_t;
3137 typedef unsigned char uint_fast8_t;
3138 typedef unsigned int uint_fast16_t;
3139 typedef unsigned int uint_fast32_t;
3140 typedef unsigned long long uint_fast64_t;'
3142 echores "$_fast_inttypes"
3145 echocheck "malloc.h"
3146 _malloc=no
3147 header_check malloc.h && _malloc=yes
3148 if test "$_malloc" = yes ; then
3149 def_malloc_h='#define HAVE_MALLOC_H 1'
3150 else
3151 def_malloc_h='#define HAVE_MALLOC_H 0'
3153 echores "$_malloc"
3156 echocheck "memalign()"
3157 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3158 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3159 _memalign=no
3160 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3161 if test "$_memalign" = yes ; then
3162 def_memalign='#define HAVE_MEMALIGN 1'
3163 else
3164 def_memalign='#define HAVE_MEMALIGN 0'
3165 def_map_memalign='#define memalign(a, b) malloc(b)'
3166 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3168 echores "$_memalign"
3171 echocheck "posix_memalign()"
3172 posix_memalign=no
3173 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3174 define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'posix_memalign(NULL, 0, 0)' &&
3175 posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3176 echores "$posix_memalign"
3179 echocheck "alloca.h"
3180 _alloca=no
3181 statement_check alloca.h 'alloca(0)' && _alloca=yes
3182 if cc_check ; then
3183 def_alloca_h='#define HAVE_ALLOCA_H 1'
3184 else
3185 def_alloca_h='#undef HAVE_ALLOCA_H'
3187 echores "$_alloca"
3190 echocheck "fastmemcpy"
3191 if test "$_fastmemcpy" = yes ; then
3192 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3193 else
3194 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3196 echores "$_fastmemcpy"
3199 echocheck "mman.h"
3200 _mman=no
3201 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3202 if test "$_mman" = yes ; then
3203 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3204 else
3205 def_mman_h='#undef HAVE_SYS_MMAN_H'
3206 os2 && _need_mmap=yes
3208 echores "$_mman"
3210 _mman_has_map_failed=no
3211 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
3212 if test "$_mman_has_map_failed" = yes ; then
3213 def_mman_has_map_failed=''
3214 else
3215 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3218 echocheck "dynamic loader"
3219 _dl=no
3220 for _ld_tmp in "" "-ldl"; do
3221 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3222 done
3223 if test "$_dl" = yes ; then
3224 def_dl='#define HAVE_LIBDL 1'
3225 else
3226 def_dl='#undef HAVE_LIBDL'
3228 echores "$_dl"
3231 echocheck "dynamic a/v plugins support"
3232 if test "$_dl" = no ; then
3233 _dynamic_plugins=no
3235 if test "$_dynamic_plugins" = yes ; then
3236 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3237 else
3238 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3240 echores "$_dynamic_plugins"
3243 def_threads='#define HAVE_THREADS 0'
3245 echocheck "pthread"
3246 if linux ; then
3247 THREAD_CFLAGS=-D_REENTRANT
3248 elif freebsd || netbsd || openbsd || bsdos ; then
3249 THREAD_CFLAGS=-D_THREAD_SAFE
3251 if test "$_pthreads" = auto ; then
3252 cat > $TMPC << EOF
3253 #include <pthread.h>
3254 static void *func(void *arg) { return arg; }
3255 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3257 _pthreads=no
3258 if ! hpux ; then
3259 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3260 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3261 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3262 done
3265 if test "$_pthreads" = yes ; then
3266 test $_ld_pthread && res_comment="using $_ld_pthread"
3267 def_pthreads='#define HAVE_PTHREADS 1'
3268 def_threads='#define HAVE_THREADS 1'
3269 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3270 else
3271 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3272 def_pthreads='#undef HAVE_PTHREADS'
3273 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3274 mingw32 || _win32dll=no
3276 echores "$_pthreads"
3278 if cygwin ; then
3279 if test "$_pthreads" = yes ; then
3280 def_pthread_cache="#define PTHREAD_CACHE 1"
3281 else
3282 _stream_cache=no
3283 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3287 echocheck "w32threads"
3288 if test "$_pthreads" = yes ; then
3289 res_comment="using pthread instead"
3290 _w32threads=no
3292 if test "$_w32threads" = auto ; then
3293 _w32threads=no
3294 mingw32 && _w32threads=yes
3296 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3297 echores "$_w32threads"
3299 echocheck "rpath"
3300 if test "$_rpath" = yes ; then
3301 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3302 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3303 done
3304 extra_ldflags=$tmp
3306 echores "$_rpath"
3308 echocheck "iconv"
3309 if test "$_iconv" = auto ; then
3310 cat > $TMPC << EOF
3311 #include <stdio.h>
3312 #include <unistd.h>
3313 #include <iconv.h>
3314 #define INBUFSIZE 1024
3315 #define OUTBUFSIZE 4096
3317 char inbuffer[INBUFSIZE];
3318 char outbuffer[OUTBUFSIZE];
3320 int main(void) {
3321 size_t numread;
3322 iconv_t icdsc;
3323 char *tocode="UTF-8";
3324 char *fromcode="cp1250";
3325 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3326 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3327 char *iptr=inbuffer;
3328 char *optr=outbuffer;
3329 size_t inleft=numread;
3330 size_t outleft=OUTBUFSIZE;
3331 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3332 != (size_t)(-1)) {
3333 write(1, outbuffer, OUTBUFSIZE - outleft);
3336 if (iconv_close(icdsc) == -1)
3339 return 0;
3342 _iconv=no
3343 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3344 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
3345 _iconv=yes && break
3346 done
3348 if test "$_iconv" = yes ; then
3349 def_iconv='#define CONFIG_ICONV 1'
3350 else
3351 def_iconv='#undef CONFIG_ICONV'
3353 echores "$_iconv"
3356 echocheck "soundcard.h"
3357 _soundcard_h=no
3358 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3359 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3360 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3361 header_check $_soundcard_header && _soundcard_h=yes &&
3362 res_comment="$_soundcard_header" && break
3363 done
3365 if test "$_soundcard_h" = yes ; then
3366 if test $_soundcard_header = "sys/soundcard.h"; then
3367 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3368 else
3369 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3372 echores "$_soundcard_h"
3375 echocheck "sys/dvdio.h"
3376 _dvdio=no
3377 # FreeBSD 8.1 has broken dvdio.h
3378 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3379 if test "$_dvdio" = yes ; then
3380 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3381 else
3382 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3384 echores "$_dvdio"
3387 echocheck "sys/cdio.h"
3388 _cdio=no
3389 # at least OpenSolaris has a broken cdio.h
3390 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3391 if test "$_cdio" = yes ; then
3392 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3393 else
3394 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3396 echores "$_cdio"
3399 echocheck "linux/cdrom.h"
3400 _cdrom=no
3401 header_check linux/cdrom.h && _cdrom=yes
3402 if test "$_cdrom" = yes ; then
3403 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3404 else
3405 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3407 echores "$_cdrom"
3410 echocheck "dvd.h"
3411 _dvd=no
3412 header_check dvd.h && _dvd=yes
3413 if test "$_dvd" = yes ; then
3414 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3415 else
3416 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3418 echores "$_dvd"
3421 if bsdos; then
3422 echocheck "BSDI dvd.h"
3423 _bsdi_dvd=no
3424 header_check dvd.h && _bsdi_dvd=yes
3425 if test "$_bsdi_dvd" = yes ; then
3426 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3427 else
3428 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3430 echores "$_bsdi_dvd"
3431 fi #if bsdos
3434 if hpux; then
3435 # also used by AIX, but AIX does not support VCD and/or libdvdread
3436 echocheck "HP-UX SCSI header"
3437 _hpux_scsi_h=no
3438 header_check sys/scsi.h && _hpux_scsi_h=yes
3439 if test "$_hpux_scsi_h" = yes ; then
3440 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3441 else
3442 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3444 echores "$_hpux_scsi_h"
3445 fi #if hpux
3448 if sunos; then
3449 echocheck "userspace SCSI headers (Solaris)"
3450 _sol_scsi_h=no
3451 header_check sys/scsi/scsi_types.h &&
3452 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3453 _sol_scsi_h=yes
3454 if test "$_sol_scsi_h" = yes ; then
3455 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3456 else
3457 def_sol_scsi_h='#undef SOLARIS_USCSI'
3459 echores "$_sol_scsi_h"
3460 fi #if sunos
3463 echocheck "termcap"
3464 if test "$_termcap" = auto ; then
3465 _termcap=no
3466 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3467 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3468 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3469 done
3471 if test "$_termcap" = yes ; then
3472 def_termcap='#define HAVE_TERMCAP 1'
3473 test $_ld_tmp && res_comment="using $_ld_tmp"
3474 else
3475 def_termcap='#undef HAVE_TERMCAP'
3477 echores "$_termcap"
3480 echocheck "termios"
3481 def_termios='#undef HAVE_TERMIOS'
3482 def_termios_h='#undef HAVE_TERMIOS_H'
3483 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3484 if test "$_termios" = auto ; then
3485 _termios=no
3486 for _termios_header in "termios.h" "sys/termios.h"; do
3487 header_check $_termios_header && _termios=yes &&
3488 res_comment="using $_termios_header" && break
3489 done
3492 if test "$_termios" = yes ; then
3493 def_termios='#define HAVE_TERMIOS 1'
3494 if test "$_termios_header" = "termios.h" ; then
3495 def_termios_h='#define HAVE_TERMIOS_H 1'
3496 else
3497 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3500 echores "$_termios"
3503 echocheck "shm"
3504 if test "$_shm" = auto ; then
3505 _shm=no
3506 statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
3508 if test "$_shm" = yes ; then
3509 def_shm='#define HAVE_SHM 1'
3510 else
3511 def_shm='#undef HAVE_SHM'
3513 echores "$_shm"
3516 echocheck "strsep()"
3517 _strsep=no
3518 statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
3519 if test "$_strsep" = yes ; then
3520 def_strsep='#define HAVE_STRSEP 1'
3521 _need_strsep=no
3522 else
3523 def_strsep='#undef HAVE_STRSEP'
3524 _need_strsep=yes
3526 echores "$_strsep"
3529 echocheck "vsscanf()"
3530 cat > $TMPC << EOF
3531 #define _ISOC99_SOURCE
3532 #include <stdarg.h>
3533 #include <stdio.h>
3534 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3536 _vsscanf=no
3537 cc_check && _vsscanf=yes
3538 if test "$_vsscanf" = yes ; then
3539 def_vsscanf='#define HAVE_VSSCANF 1'
3540 _need_vsscanf=no
3541 else
3542 def_vsscanf='#undef HAVE_VSSCANF'
3543 _need_vsscanf=yes
3545 echores "$_vsscanf"
3548 echocheck "swab()"
3549 _swab=no
3550 define_statement_check "_XOPEN_SOURCE 600" "unistd.h" 'int a, b; swab(&a, &b, 0)' && _swab=yes
3551 if test "$_swab" = yes ; then
3552 def_swab='#define HAVE_SWAB 1'
3553 _need_swab=no
3554 else
3555 def_swab='#undef HAVE_SWAB'
3556 _need_swab=yes
3558 echores "$_swab"
3560 echocheck "POSIX select()"
3561 cat > $TMPC << EOF
3562 #include <stdio.h>
3563 #include <stdlib.h>
3564 #include <sys/types.h>
3565 #include <string.h>
3566 #include <sys/time.h>
3567 #include <unistd.h>
3568 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3570 _posix_select=no
3571 def_posix_select='#undef HAVE_POSIX_SELECT'
3572 #select() of kLIBC (OS/2) supports socket only
3573 ! os2 && cc_check && _posix_select=yes &&
3574 def_posix_select='#define HAVE_POSIX_SELECT 1'
3575 echores "$_posix_select"
3578 echocheck "audio select()"
3579 if test "$_select" = no ; then
3580 def_select='#undef HAVE_AUDIO_SELECT'
3581 elif test "$_select" = yes ; then
3582 def_select='#define HAVE_AUDIO_SELECT 1'
3584 echores "$_select"
3587 echocheck "gettimeofday()"
3588 _gettimeofday=no
3589 statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
3590 if test "$_gettimeofday" = yes ; then
3591 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3592 _need_gettimeofday=no
3593 else
3594 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3595 _need_gettimeofday=yes
3597 echores "$_gettimeofday"
3600 echocheck "glob()"
3601 _glob=no
3602 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3603 if test "$_glob" = yes ; then
3604 def_glob='#define HAVE_GLOB 1'
3605 _need_glob=no
3606 else
3607 def_glob='#undef HAVE_GLOB'
3608 _need_glob=yes
3610 echores "$_glob"
3613 echocheck "setenv()"
3614 _setenv=no
3615 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3616 if test "$_setenv" = yes ; then
3617 def_setenv='#define HAVE_SETENV 1'
3618 _need_setenv=no
3619 else
3620 def_setenv='#undef HAVE_SETENV'
3621 _need_setenv=yes
3623 echores "$_setenv"
3626 echocheck "setmode()"
3627 _setmode=no
3628 def_setmode='#define HAVE_SETMODE 0'
3629 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3630 echores "$_setmode"
3633 if sunos; then
3634 echocheck "sysi86()"
3635 _sysi86=no
3636 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3637 if test "$_sysi86" = yes ; then
3638 def_sysi86='#define HAVE_SYSI86 1'
3639 statement_check sys/sysi86.h 'int sysi86(int, void*); sysi86(0)' && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3640 else
3641 def_sysi86='#undef HAVE_SYSI86'
3643 echores "$_sysi86"
3644 fi #if sunos
3647 echocheck "sys/sysinfo.h"
3648 _sys_sysinfo=no
3649 statement_check sys/sysinfo.h 'struct sysinfo s_info; sysinfo(&s_info)' && _sys_sysinfo=yes
3650 if test "$_sys_sysinfo" = yes ; then
3651 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3652 else
3653 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3655 echores "$_sys_sysinfo"
3658 if darwin; then
3660 echocheck "Mac OS X Finder Support"
3661 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3662 if test "$_macosx_finder" = yes ; then
3663 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3664 extra_ldflags="$extra_ldflags -framework Carbon"
3666 echores "$_macosx_finder"
3668 echocheck "Mac OS X Bundle file locations"
3669 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3670 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3671 if test "$_macosx_bundle" = yes ; then
3672 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3673 extra_ldflags="$extra_ldflags -framework Carbon"
3675 echores "$_macosx_bundle"
3677 echocheck "Apple Remote"
3678 if test "$_apple_remote" = auto ; then
3679 _apple_remote=no
3680 cat > $TMPC <<EOF
3681 #include <stdio.h>
3682 #include <IOKit/IOCFPlugIn.h>
3683 int main(void) {
3684 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3685 CFMutableDictionaryRef hidMatchDictionary;
3686 IOReturn ioReturnValue;
3688 // Set up a matching dictionary to search the I/O Registry by class.
3689 // name for all HID class devices
3690 hidMatchDictionary = IOServiceMatching("AppleIRController");
3692 // Now search I/O Registry for matching devices.
3693 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3694 hidMatchDictionary, &hidObjectIterator);
3696 // If search is unsuccessful, return nonzero.
3697 if (ioReturnValue != kIOReturnSuccess ||
3698 !IOIteratorIsValid(hidObjectIterator)) {
3699 return 1;
3701 return 0;
3704 cc_check -framework IOKit && _apple_remote=yes
3706 if test "$_apple_remote" = yes ; then
3707 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3708 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3709 else
3710 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3712 echores "$_apple_remote"
3714 fi #if darwin
3716 if linux; then
3718 echocheck "Apple IR"
3719 if test "$_apple_ir" = auto ; then
3720 _apple_ir=no
3721 statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
3723 if test "$_apple_ir" = yes ; then
3724 def_apple_ir='#define CONFIG_APPLE_IR 1'
3725 else
3726 def_apple_ir='#undef CONFIG_APPLE_IR'
3728 echores "$_apple_ir"
3729 fi #if linux
3731 echocheck "pkg-config"
3732 _pkg_config=pkg-config
3733 if $($_pkg_config --version > /dev/null 2>&1); then
3734 if test "$_ld_static"; then
3735 _pkg_config="$_pkg_config --static"
3737 echores "yes"
3738 else
3739 _pkg_config=false
3740 echores "no"
3744 echocheck "Samba support (libsmbclient)"
3745 if test "$_smb" = yes; then
3746 extra_ldflags="$extra_ldflags -lsmbclient"
3748 if test "$_smb" = auto; then
3749 _smb=no
3750 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3751 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3752 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3753 done
3756 if test "$_smb" = yes; then
3757 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3758 inputmodules="smb $inputmodules"
3759 else
3760 def_smb="#undef CONFIG_LIBSMBCLIENT"
3761 noinputmodules="smb $noinputmodules"
3763 echores "$_smb"
3766 #########
3767 # VIDEO #
3768 #########
3771 echocheck "tdfxfb"
3772 if test "$_tdfxfb" = yes ; then
3773 def_tdfxfb='#define CONFIG_TDFXFB 1'
3774 vomodules="tdfxfb $vomodules"
3775 else
3776 def_tdfxfb='#undef CONFIG_TDFXFB'
3777 novomodules="tdfxfb $novomodules"
3779 echores "$_tdfxfb"
3781 echocheck "s3fb"
3782 if test "$_s3fb" = yes ; then
3783 def_s3fb='#define CONFIG_S3FB 1'
3784 vomodules="s3fb $vomodules"
3785 else
3786 def_s3fb='#undef CONFIG_S3FB'
3787 novomodules="s3fb $novomodules"
3789 echores "$_s3fb"
3791 echocheck "wii"
3792 if test "$_wii" = yes ; then
3793 def_wii='#define CONFIG_WII 1'
3794 vomodules="wii $vomodules"
3795 else
3796 def_wii='#undef CONFIG_WII'
3797 novomodules="wii $novomodules"
3799 echores "$_wii"
3801 echocheck "tdfxvid"
3802 if test "$_tdfxvid" = yes ; then
3803 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3804 vomodules="tdfx_vid $vomodules"
3805 else
3806 def_tdfxvid='#undef CONFIG_TDFX_VID'
3807 novomodules="tdfx_vid $novomodules"
3809 echores "$_tdfxvid"
3811 echocheck "xvr100"
3812 if test "$_xvr100" = auto ; then
3813 cat > $TMPC << EOF
3814 #include <unistd.h>
3815 #include <sys/fbio.h>
3816 #include <sys/visual_io.h>
3817 int main(void) {
3818 struct vis_identifier ident;
3819 struct fbgattr attr;
3820 ioctl(0, VIS_GETIDENTIFIER, &ident);
3821 ioctl(0, FBIOGATTR, &attr);
3822 return 0;
3825 _xvr100=no
3826 cc_check && _xvr100=yes
3828 if test "$_xvr100" = yes ; then
3829 def_xvr100='#define CONFIG_XVR100 1'
3830 vomodules="xvr100 $vomodules"
3831 else
3832 def_tdfxvid='#undef CONFIG_XVR100'
3833 novomodules="xvr100 $novomodules"
3835 echores "$_xvr100"
3837 echocheck "tga"
3838 if test "$_tga" = yes ; then
3839 def_tga='#define CONFIG_TGA 1'
3840 vomodules="tga $vomodules"
3841 else
3842 def_tga='#undef CONFIG_TGA'
3843 novomodules="tga $novomodules"
3845 echores "$_tga"
3848 echocheck "md5sum support"
3849 if test "$_md5sum" = yes; then
3850 def_md5sum="#define CONFIG_MD5SUM 1"
3851 vomodules="md5sum $vomodules"
3852 else
3853 def_md5sum="#undef CONFIG_MD5SUM"
3854 novomodules="md5sum $novomodules"
3856 echores "$_md5sum"
3859 echocheck "yuv4mpeg support"
3860 if test "$_yuv4mpeg" = yes; then
3861 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3862 vomodules="yuv4mpeg $vomodules"
3863 else
3864 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3865 novomodules="yuv4mpeg $novomodules"
3867 echores "$_yuv4mpeg"
3870 echocheck "bl"
3871 if test "$_bl" = yes ; then
3872 def_bl='#define CONFIG_BL 1'
3873 vomodules="bl $vomodules"
3874 else
3875 def_bl='#undef CONFIG_BL'
3876 novomodules="bl $novomodules"
3878 echores "$_bl"
3881 echocheck "DirectFB"
3882 if test "$_directfb" = auto ; then
3883 _directfb=no
3884 cat > $TMPC << EOF
3885 #include <directfb.h>
3886 #include <directfb_version.h>
3887 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3888 #error "DirectFB version too old."
3889 #endif
3890 int main(void) { DirectFBInit(0, 0); return 0; }
3892 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3893 cc_check $_inc_tmp -ldirectfb &&
3894 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3895 done
3897 if test "$_directfb" = yes ; then
3898 def_directfb='#define CONFIG_DIRECTFB 1'
3899 vomodules="directfb dfbmga $vomodules"
3900 libs_mplayer="$libs_mplayer -ldirectfb"
3901 else
3902 def_directfb='#undef CONFIG_DIRECTFB'
3903 novomodules="directfb dfbmga $novomodules"
3905 echores "$_directfb"
3908 echocheck "X11 headers presence"
3909 _x11_headers="no"
3910 res_comment="check if the dev(el) packages are installed"
3911 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3912 if test -f "$I/X11/Xlib.h" ; then
3913 _x11_headers="yes"
3914 res_comment=""
3915 break
3917 done
3918 if test $_cross_compile = no; then
3919 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3920 /usr/include/X11R6 /usr/openwin/include ; do
3921 if test -f "$I/X11/Xlib.h" ; then
3922 extra_cflags="$extra_cflags -I$I"
3923 _x11_headers="yes"
3924 res_comment="using $I"
3925 break
3927 done
3929 echores "$_x11_headers"
3932 echocheck "X11"
3933 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3934 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3935 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3936 -L/usr/lib ; do
3937 if netbsd; then
3938 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3939 else
3940 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3942 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3943 libs_mplayer="$libs_mplayer $_ld_tmp" && _x11=yes && break
3944 done
3946 if test "$_x11" = yes ; then
3947 def_x11='#define CONFIG_X11 1'
3948 vomodules="x11 xover $vomodules"
3949 else
3950 _x11=no
3951 def_x11='#undef CONFIG_X11'
3952 novomodules="x11 $novomodules"
3953 res_comment="check if the dev(el) packages are installed"
3954 # disable stuff that depends on X
3955 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
3957 echores "$_x11"
3959 echocheck "Xss screensaver extensions"
3960 if test "$_xss" = auto ; then
3961 _xss=no
3962 statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
3964 if test "$_xss" = yes ; then
3965 def_xss='#define CONFIG_XSS 1'
3966 libs_mplayer="$libs_mplayer -lXss"
3967 else
3968 def_xss='#undef CONFIG_XSS'
3970 echores "$_xss"
3972 echocheck "DPMS"
3973 _xdpms3=no
3974 _xdpms4=no
3975 if test "$_x11" = yes ; then
3976 cat > $TMPC <<EOF
3977 #include <X11/Xmd.h>
3978 #include <X11/Xlib.h>
3979 #include <X11/Xutil.h>
3980 #include <X11/Xatom.h>
3981 #include <X11/extensions/dpms.h>
3982 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
3984 cc_check -lXdpms && _xdpms3=yes
3985 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
3987 if test "$_xdpms4" = yes ; then
3988 def_xdpms='#define CONFIG_XDPMS 1'
3989 res_comment="using Xdpms 4"
3990 echores "yes"
3991 elif test "$_xdpms3" = yes ; then
3992 def_xdpms='#define CONFIG_XDPMS 1'
3993 libs_mplayer="$libs_mplayer -lXdpms"
3994 res_comment="using Xdpms 3"
3995 echores "yes"
3996 else
3997 def_xdpms='#undef CONFIG_XDPMS'
3998 echores "no"
4002 echocheck "Xv"
4003 if test "$_xv" = auto ; then
4004 _xv=no
4005 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
4008 if test "$_xv" = yes ; then
4009 def_xv='#define CONFIG_XV 1'
4010 libs_mplayer="$libs_mplayer -lXv"
4011 vomodules="xv $vomodules"
4012 else
4013 def_xv='#undef CONFIG_XV'
4014 novomodules="xv $novomodules"
4016 echores "$_xv"
4019 echocheck "XvMC"
4020 if test "$_xv" = yes && test "$_xvmc" != no ; then
4021 _xvmc=no
4022 cat > $TMPC <<EOF
4023 #include <X11/Xlib.h>
4024 #include <X11/extensions/Xvlib.h>
4025 #include <X11/extensions/XvMClib.h>
4026 int main(void) {
4027 XvMCQueryExtension(0, 0, 0);
4028 XvMCCreateContext(0, 0, 0, 0, 0, 0, 0);
4029 return 0; }
4031 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4032 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4033 done
4035 if test "$_xvmc" = yes ; then
4036 def_xvmc='#define CONFIG_XVMC 1'
4037 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4038 vomodules="xvmc $vomodules"
4039 res_comment="using $_xvmclib"
4040 else
4041 def_xvmc='#define CONFIG_XVMC 0'
4042 novomodules="xvmc $novomodules"
4044 echores "$_xvmc"
4047 echocheck "VDPAU"
4048 if test "$_vdpau" = auto ; then
4049 _vdpau=no
4050 if test "$_dl" = yes ; then
4051 return_statement_check vdpau/vdpau_x11.h 'vdp_device_create_x11(0, 0, 0, 0)' VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 -lvdpau && _vdpau=yes
4054 if test "$_vdpau" = yes ; then
4055 def_vdpau='#define CONFIG_VDPAU 1'
4056 libs_mplayer="$libs_mplayer -lvdpau"
4057 vomodules="vdpau $vomodules"
4058 else
4059 def_vdpau='#define CONFIG_VDPAU 0'
4060 novomodules="vdpau $novomodules"
4062 echores "$_vdpau"
4065 echocheck "Xinerama"
4066 if test "$_xinerama" = auto ; then
4067 _xinerama=no
4068 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
4071 if test "$_xinerama" = yes ; then
4072 def_xinerama='#define CONFIG_XINERAMA 1'
4073 libs_mplayer="$libs_mplayer -lXinerama"
4074 else
4075 def_xinerama='#undef CONFIG_XINERAMA'
4077 echores "$_xinerama"
4080 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4081 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4082 # named 'X extensions' or something similar.
4083 # This check may be useful for future mplayer versions (to change resolution)
4084 # If you run into problems, remove '-lXxf86vm'.
4085 echocheck "Xxf86vm"
4086 if test "$_vm" = auto ; then
4087 _vm=no
4088 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
4090 if test "$_vm" = yes ; then
4091 def_vm='#define CONFIG_XF86VM 1'
4092 libs_mplayer="$libs_mplayer -lXxf86vm"
4093 else
4094 def_vm='#undef CONFIG_XF86VM'
4096 echores "$_vm"
4098 # Check for the presence of special keycodes, like audio control buttons
4099 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4100 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4101 # have these new keycodes.
4102 echocheck "XF86keysym"
4103 if test "$_xf86keysym" = auto; then
4104 _xf86keysym=no
4105 return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
4107 if test "$_xf86keysym" = yes ; then
4108 def_xf86keysym='#define CONFIG_XF86XK 1'
4109 else
4110 def_xf86keysym='#undef CONFIG_XF86XK'
4112 echores "$_xf86keysym"
4114 echocheck "DGA"
4115 if test "$_dga2" = auto && test "$_x11" = yes ; then
4116 _dga2=no
4117 statement_check_broken X11/Xlib.h X11/extensions/xf86dga.h 'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2=yes
4119 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4120 _dga1=no
4121 statement_check_broken X11/Xlib.h X11/extensions/xf86dga.h 'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1=yes
4124 _dga=no
4125 def_dga='#undef CONFIG_DGA'
4126 def_dga1='#undef CONFIG_DGA1'
4127 def_dga2='#undef CONFIG_DGA2'
4128 if test "$_dga1" = yes ; then
4129 _dga=yes
4130 def_dga1='#define CONFIG_DGA1 1'
4131 res_comment="using DGA 1.0"
4132 elif test "$_dga2" = yes ; then
4133 _dga=yes
4134 def_dga2='#define CONFIG_DGA2 1'
4135 res_comment="using DGA 2.0"
4137 if test "$_dga" = yes ; then
4138 def_dga='#define CONFIG_DGA 1'
4139 libs_mplayer="$libs_mplayer -lXxf86dga"
4140 vomodules="dga $vomodules"
4141 else
4142 novomodules="dga $novomodules"
4144 echores "$_dga"
4147 echocheck "3dfx"
4148 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4149 def_3dfx='#define CONFIG_3DFX 1'
4150 vomodules="3dfx $vomodules"
4151 else
4152 def_3dfx='#undef CONFIG_3DFX'
4153 novomodules="3dfx $novomodules"
4155 echores "$_3dfx"
4158 echocheck "VIDIX"
4159 def_vidix='#undef CONFIG_VIDIX'
4160 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4161 _vidix_drv_cyberblade=no
4162 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4163 _vidix_drv_ivtv=no
4164 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4165 _vidix_drv_mach64=no
4166 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4167 _vidix_drv_mga=no
4168 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4169 _vidix_drv_mga_crtc2=no
4170 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4171 _vidix_drv_nvidia=no
4172 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4173 _vidix_drv_pm2=no
4174 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4175 _vidix_drv_pm3=no
4176 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4177 _vidix_drv_radeon=no
4178 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4179 _vidix_drv_rage128=no
4180 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4181 _vidix_drv_s3=no
4182 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4183 _vidix_drv_sh_veu=no
4184 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4185 _vidix_drv_sis=no
4186 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4187 _vidix_drv_unichrome=no
4188 if test "$_vidix" = auto ; then
4189 _vidix=no
4190 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4191 && _vidix=yes
4192 x86_64 && ! linux && _vidix=no
4193 (ppc || alpha) && linux && _vidix=yes
4195 echores "$_vidix"
4197 if test "$_vidix" = yes ; then
4198 def_vidix='#define CONFIG_VIDIX 1'
4199 vomodules="cvidix $vomodules"
4200 # FIXME: ivtv driver temporarily disabled until we have a proper test
4201 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4202 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4204 # some vidix drivers are architecture and os specific, discard them elsewhere
4205 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4206 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4208 for driver in $_vidix_drivers ; do
4209 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4210 eval _vidix_drv_${driver}=yes
4211 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4212 done
4214 echocheck "VIDIX PCI device name database"
4215 echores "$_vidix_pcidb"
4216 if test "$_vidix_pcidb" = yes ; then
4217 _vidix_pcidb_val=1
4218 else
4219 _vidix_pcidb_val=0
4222 echocheck "VIDIX dhahelper support"
4223 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4224 echores "$_dhahelper"
4226 echocheck "VIDIX svgalib_helper support"
4227 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4228 echores "$_svgalib_helper"
4230 else
4231 novomodules="cvidix $novomodules"
4234 if test "$_vidix" = yes && win32; then
4235 winvidix=yes
4236 vomodules="winvidix $vomodules"
4237 libs_mplayer="$libs_mplayer -lgdi32"
4238 else
4239 novomodules="winvidix $novomodules"
4241 if test "$_vidix" = yes && test "$_x11" = yes; then
4242 xvidix=yes
4243 vomodules="xvidix $vomodules"
4244 else
4245 novomodules="xvidix $novomodules"
4248 echocheck "GGI"
4249 if test "$_ggi" = auto ; then
4250 _ggi=no
4251 statement_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4253 if test "$_ggi" = yes ; then
4254 def_ggi='#define CONFIG_GGI 1'
4255 libs_mplayer="$libs_mplayer -lggi"
4256 vomodules="ggi $vomodules"
4257 else
4258 def_ggi='#undef CONFIG_GGI'
4259 novomodules="ggi $novomodules"
4261 echores "$_ggi"
4263 echocheck "GGI extension: libggiwmh"
4264 if test "$_ggiwmh" = auto ; then
4265 _ggiwmh=no
4266 statement_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4268 # needed to get right output on obscure combination
4269 # like --disable-ggi --enable-ggiwmh
4270 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4271 def_ggiwmh='#define CONFIG_GGIWMH 1'
4272 libs_mplayer="$libs_mplayer -lggiwmh"
4273 else
4274 _ggiwmh=no
4275 def_ggiwmh='#undef CONFIG_GGIWMH'
4277 echores "$_ggiwmh"
4280 echocheck "AA"
4281 if test "$_aa" = auto ; then
4282 cat > $TMPC << EOF
4283 #include <aalib.h>
4284 int main(void) {
4285 aa_context *c;
4286 aa_renderparams *p;
4287 aa_init(0, 0, 0);
4288 c = aa_autoinit(&aa_defparams);
4289 p = aa_getrenderparams();
4290 aa_autoinitkbd(c, 0);
4291 return 0; }
4293 _aa=no
4294 for _ld_tmp in "-laa" ; do
4295 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4296 done
4298 if test "$_aa" = yes ; then
4299 def_aa='#define CONFIG_AA 1'
4300 if cygwin ; then
4301 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4303 vomodules="aa $vomodules"
4304 else
4305 def_aa='#undef CONFIG_AA'
4306 novomodules="aa $novomodules"
4308 echores "$_aa"
4311 echocheck "CACA"
4312 if test "$_caca" = auto ; then
4313 _caca=no
4314 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4315 cat > $TMPC << EOF
4316 #include <caca.h>
4317 #ifdef CACA_API_VERSION_1
4318 #include <caca0.h>
4319 #endif
4320 int main(void) { caca_init(); return 0; }
4322 cc_check $(caca-config --libs) && _caca=yes
4325 if test "$_caca" = yes ; then
4326 def_caca='#define CONFIG_CACA 1'
4327 extra_cflags="$extra_cflags $(caca-config --cflags)"
4328 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4329 vomodules="caca $vomodules"
4330 else
4331 def_caca='#undef CONFIG_CACA'
4332 novomodules="caca $novomodules"
4334 echores "$_caca"
4337 echocheck "SVGAlib"
4338 if test "$_svga" = auto ; then
4339 _svga=no
4340 header_check vga.h -lvga $_ld_lm && _svga=yes
4342 if test "$_svga" = yes ; then
4343 def_svga='#define CONFIG_SVGALIB 1'
4344 libs_mplayer="$libs_mplayer -lvga"
4345 vomodules="svga $vomodules"
4346 else
4347 def_svga='#undef CONFIG_SVGALIB'
4348 novomodules="svga $novomodules"
4350 echores "$_svga"
4353 echocheck "FBDev"
4354 if test "$_fbdev" = auto ; then
4355 _fbdev=no
4356 linux && _fbdev=yes
4358 if test "$_fbdev" = yes ; then
4359 def_fbdev='#define CONFIG_FBDEV 1'
4360 vomodules="fbdev $vomodules"
4361 else
4362 def_fbdev='#undef CONFIG_FBDEV'
4363 novomodules="fbdev $novomodules"
4365 echores "$_fbdev"
4369 echocheck "DVB"
4370 if test "$_dvb" = auto ; then
4371 _dvb=no
4372 cat >$TMPC << EOF
4373 #include <poll.h>
4374 #include <sys/ioctl.h>
4375 #include <stdio.h>
4376 #include <time.h>
4377 #include <unistd.h>
4378 #include <linux/dvb/dmx.h>
4379 #include <linux/dvb/frontend.h>
4380 #include <linux/dvb/video.h>
4381 #include <linux/dvb/audio.h>
4382 int main(void) {return 0;}
4384 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4385 cc_check $_inc_tmp && _dvb=yes &&
4386 extra_cflags="$extra_cflags $_inc_tmp" && break
4387 done
4389 echores "$_dvb"
4390 if test "$_dvb" = yes ; then
4391 _dvbin=yes
4392 inputmodules="dvb $inputmodules"
4393 def_dvb='#define CONFIG_DVB 1'
4394 def_dvbin='#define CONFIG_DVBIN 1'
4395 aomodules="mpegpes(dvb) $aomodules"
4396 vomodules="mpegpes(dvb) $vomodules"
4397 else
4398 _dvbin=no
4399 noinputmodules="dvb $noinputmodules"
4400 def_dvb='#undef CONFIG_DVB'
4401 def_dvbin='#undef CONFIG_DVBIN '
4402 aomodules="mpegpes(file) $aomodules"
4403 vomodules="mpegpes(file) $vomodules"
4407 if darwin; then
4409 echocheck "QuickTime"
4410 if test "$quicktime" = auto ; then
4411 quicktime=no
4412 statement_check QuickTime/QuickTime.h 'ImageDescription *desc; EnterMovies(); ExitMovies()' -framework QuickTime && quicktime=yes
4414 if test "$quicktime" = yes ; then
4415 extra_ldflags="$extra_ldflags -framework QuickTime"
4416 def_quicktime='#define CONFIG_QUICKTIME 1'
4417 else
4418 def_quicktime='#undef CONFIG_QUICKTIME'
4419 _quartz=no
4421 echores $quicktime
4423 echocheck "Quartz"
4424 if test "$_quartz" = auto ; then
4425 _quartz=no
4426 statement_check Carbon/Carbon.h 'CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false)' -framework Carbon && _quartz=yes
4428 if test "$_quartz" = yes ; then
4429 libs_mplayer="$libs_mplayer -framework Carbon"
4430 def_quartz='#define CONFIG_QUARTZ 1'
4431 vomodules="quartz $vomodules"
4432 else
4433 def_quartz='#undef CONFIG_QUARTZ'
4434 novomodules="quartz $novomodules"
4436 echores $_quartz
4438 echocheck "CoreVideo"
4439 if test "$_corevideo" = auto ; then
4440 cat > $TMPC <<EOF
4441 #include <Carbon/Carbon.h>
4442 #include <CoreServices/CoreServices.h>
4443 #include <OpenGL/OpenGL.h>
4444 #include <QuartzCore/CoreVideo.h>
4445 int main(void) { return 0; }
4447 _corevideo=no
4448 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4450 if test "$_corevideo" = yes ; then
4451 vomodules="corevideo $vomodules"
4452 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4453 def_corevideo='#define CONFIG_COREVIDEO 1'
4454 else
4455 novomodules="corevideo $novomodules"
4456 def_corevideo='#undef CONFIG_COREVIDEO'
4458 echores "$_corevideo"
4460 fi #if darwin
4463 echocheck "PNG support"
4464 if test "$_png" = auto ; then
4465 _png=no
4466 if irix ; then
4467 # Don't check for -lpng on irix since it has its own libpng
4468 # incompatible with the GNU libpng
4469 res_comment="disabled on irix (not GNU libpng)"
4470 else
4471 cat > $TMPC << EOF
4472 #include <stdio.h>
4473 #include <string.h>
4474 #include <png.h>
4475 int main(void) {
4476 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4477 printf("libpng: %s\n", png_libpng_ver);
4478 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4481 cc_check -lpng -lz $_ld_lm && _png=yes
4484 echores "$_png"
4485 if test "$_png" = yes ; then
4486 def_png='#define CONFIG_PNG 1'
4487 extra_ldflags="$extra_ldflags -lpng -lz"
4488 else
4489 def_png='#undef CONFIG_PNG'
4492 echocheck "MNG support"
4493 if test "$_mng" = auto ; then
4494 _mng=no
4495 return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
4497 echores "$_mng"
4498 if test "$_mng" = yes ; then
4499 def_mng='#define CONFIG_MNG 1'
4500 extra_ldflags="$extra_ldflags -lmng -lz"
4501 else
4502 def_mng='#undef CONFIG_MNG'
4505 echocheck "JPEG support"
4506 if test "$_jpeg" = auto ; then
4507 _jpeg=no
4508 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
4510 echores "$_jpeg"
4512 if test "$_jpeg" = yes ; then
4513 def_jpeg='#define CONFIG_JPEG 1'
4514 vomodules="jpeg $vomodules"
4515 extra_ldflags="$extra_ldflags -ljpeg"
4516 else
4517 def_jpeg='#undef CONFIG_JPEG'
4518 novomodules="jpeg $novomodules"
4523 echocheck "PNM support"
4524 if test "$_pnm" = yes; then
4525 def_pnm="#define CONFIG_PNM 1"
4526 vomodules="pnm $vomodules"
4527 else
4528 def_pnm="#undef CONFIG_PNM"
4529 novomodules="pnm $novomodules"
4531 echores "$_pnm"
4535 echocheck "GIF support"
4536 # This is to appease people who want to force gif support.
4537 # If it is forced to yes, then we still do checks to determine
4538 # which gif library to use.
4539 if test "$_gif" = yes ; then
4540 _force_gif=yes
4541 _gif=auto
4544 if test "$_gif" = auto ; then
4545 _gif=no
4546 for _ld_gif in "-lungif" "-lgif" ; do
4547 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4548 done
4551 # If no library was found, and the user wants support forced,
4552 # then we force it on with libgif, as this is the safest
4553 # assumption IMHO. (libungif & libregif both create symbolic
4554 # links to libgif. We also assume that no x11 support is needed,
4555 # because if you are forcing this, then you _should_ know what
4556 # you are doing. [ Besides, package maintainers should never
4557 # have compiled x11 deps into libungif in the first place. ] )
4558 # </rant>
4559 # --Joey
4560 if test "$_force_gif" = yes && test "$_gif" = no ; then
4561 _gif=yes
4562 _ld_gif="-lgif"
4565 if test "$_gif" = yes ; then
4566 def_gif='#define CONFIG_GIF 1'
4567 codecmodules="gif $codecmodules"
4568 vomodules="gif89a $vomodules"
4569 res_comment="old version, some encoding functions disabled"
4570 def_gif_4='#undef CONFIG_GIF_4'
4571 extra_ldflags="$extra_ldflags $_ld_gif"
4573 cat > $TMPC << EOF
4574 #include <signal.h>
4575 #include <stdio.h>
4576 #include <stdlib.h>
4577 #include <gif_lib.h>
4578 static void catch(int sig) { exit(1); }
4579 int main(void) {
4580 signal(SIGSEGV, catch); // catch segfault
4581 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4582 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4583 return 0;
4586 if cc_check "$_ld_gif" ; then
4587 def_gif_4='#define CONFIG_GIF_4 1'
4588 res_comment=""
4590 else
4591 def_gif='#undef CONFIG_GIF'
4592 def_gif_4='#undef CONFIG_GIF_4'
4593 novomodules="gif89a $novomodules"
4594 nocodecmodules="gif $nocodecmodules"
4596 echores "$_gif"
4599 case "$_gif" in yes*)
4600 echocheck "broken giflib workaround"
4601 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4603 cat > $TMPC << EOF
4604 #include <stdio.h>
4605 #include <gif_lib.h>
4606 int main(void) {
4607 GifFileType gif = {.UserData = NULL};
4608 printf("UserData is at address %p\n", gif.UserData);
4609 return 0;
4612 if cc_check "$_ld_gif" ; then
4613 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4614 echores "disabled"
4615 else
4616 echores "enabled"
4619 esac
4622 echocheck "VESA support"
4623 if test "$_vesa" = auto ; then
4624 _vesa=no
4625 statement_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4627 if test "$_vesa" = yes ; then
4628 def_vesa='#define CONFIG_VESA 1'
4629 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4630 vomodules="vesa $vomodules"
4631 else
4632 def_vesa='#undef CONFIG_VESA'
4633 novomodules="vesa $novomodules"
4635 echores "$_vesa"
4637 #################
4638 # VIDEO + AUDIO #
4639 #################
4642 echocheck "SDL"
4643 _inc_tmp=""
4644 _ld_tmp=""
4645 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4646 if test -z "$_sdlconfig" ; then
4647 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4648 _sdlconfig="sdl-config"
4649 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4650 _sdlconfig="sdl11-config"
4651 else
4652 _sdlconfig=false
4655 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4656 cat > $TMPC << EOF
4657 #ifdef CONFIG_SDL_SDL_H
4658 #include <SDL/SDL.h>
4659 #else
4660 #include <SDL.h>
4661 #endif
4662 #ifndef __APPLE__
4663 // we allow SDL hacking our main() only on OSX
4664 #undef main
4665 #endif
4666 int main(int argc, char *argv[]) {
4667 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4668 return 0;
4671 _sdl=no
4672 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4673 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4674 _sdl=yes
4675 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4676 break
4678 done
4679 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4680 res_comment="using $_sdlconfig"
4681 if cygwin ; then
4682 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4683 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4684 elif mingw32 ; then
4685 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4686 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4687 else
4688 _inc_tmp="$($_sdlconfig --cflags)"
4689 _ld_tmp="$($_sdlconfig --libs)"
4691 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4692 _sdl=yes
4693 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4694 # HACK for BeOS/Haiku SDL
4695 _ld_tmp="$_ld_tmp -lstdc++"
4696 _sdl=yes
4700 if test "$_sdl" = yes ; then
4701 def_sdl='#define CONFIG_SDL 1'
4702 extra_cflags="$extra_cflags $_inc_tmp"
4703 libs_mplayer="$libs_mplayer $_ld_tmp"
4704 vomodules="sdl $vomodules"
4705 aomodules="sdl $aomodules"
4706 else
4707 def_sdl='#undef CONFIG_SDL'
4708 novomodules="sdl $novomodules"
4709 noaomodules="sdl $noaomodules"
4711 echores "$_sdl"
4714 # make sure this stays below CoreVideo to avoid issues due to namespace
4715 # conflicts between -lGL and -framework OpenGL
4716 echocheck "OpenGL"
4717 #Note: this test is run even with --enable-gl since we autodetect linker flags
4718 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
4719 cat > $TMPC << EOF
4720 #ifdef GL_WIN32
4721 #include <windows.h>
4722 #include <GL/gl.h>
4723 #elif defined(GL_SDL)
4724 #include <GL/gl.h>
4725 #ifdef CONFIG_SDL_SDL_H
4726 #include <SDL/SDL.h>
4727 #else
4728 #include <SDL.h>
4729 #endif
4730 #ifndef __APPLE__
4731 // we allow SDL hacking our main() only on OSX
4732 #undef main
4733 #endif
4734 #else
4735 #include <GL/gl.h>
4736 #include <X11/Xlib.h>
4737 #include <GL/glx.h>
4738 #endif
4739 int main(int argc, char *argv[]) {
4740 #ifdef GL_WIN32
4741 HDC dc;
4742 wglCreateContext(dc);
4743 #elif defined(GL_SDL)
4744 SDL_GL_SwapBuffers();
4745 #else
4746 glXCreateContext(NULL, NULL, NULL, True);
4747 #endif
4748 glFinish();
4749 return 0;
4752 _gl=no
4753 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4754 if cc_check $_ld_tmp $_ld_lm ; then
4755 _gl=yes
4756 _gl_x11=yes
4757 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4758 break
4760 done
4761 if cc_check -DGL_WIN32 -lopengl32 ; then
4762 _gl=yes
4763 _gl_win32=yes
4764 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4766 # last so it can reuse any linker etc. flags detected before
4767 if test "$_sdl" = yes ; then
4768 if cc_check -DGL_SDL ||
4769 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4770 _gl=yes
4771 _gl_sdl=yes
4772 elif cc_check -DGL_SDL -lGL ||
4773 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4774 _gl=yes
4775 _gl_sdl=yes
4776 libs_mplayer="$libs_mplayer -lGL"
4779 else
4780 _gl=no
4782 if test "$_gl" = yes ; then
4783 def_gl='#define CONFIG_GL 1'
4784 res_comment="backends:"
4785 if test "$_gl_win32" = yes ; then
4786 def_gl_win32='#define CONFIG_GL_WIN32 1'
4787 res_comment="$res_comment win32"
4789 if test "$_gl_x11" = yes ; then
4790 def_gl_x11='#define CONFIG_GL_X11 1'
4791 res_comment="$res_comment x11"
4793 if test "$_gl_sdl" = yes ; then
4794 def_gl_sdl='#define CONFIG_GL_SDL 1'
4795 res_comment="$res_comment sdl"
4797 vomodules="opengl $vomodules"
4798 else
4799 def_gl='#undef CONFIG_GL'
4800 def_gl_win32='#undef CONFIG_GL_WIN32'
4801 def_gl_x11='#undef CONFIG_GL_X11'
4802 def_gl_sdl='#undef CONFIG_GL_SDL'
4803 novomodules="opengl $novomodules"
4805 echores "$_gl"
4808 echocheck "MatrixView"
4809 if test "$_gl" = no ; then
4810 matrixview=no
4812 if test "$matrixview" = yes ; then
4813 vomodules="matrixview $vomodules"
4814 def_matrixview='#define CONFIG_MATRIXVIEW 1'
4815 else
4816 novomodules="matrixview $novomodules"
4817 def_matrixview='#undef CONFIG_MATRIXVIEW'
4819 echores "$matrixview"
4822 if os2 ; then
4823 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
4824 if test "$_kva" = auto; then
4825 _kva=no;
4826 header_check_broken os2.h kva.h -lkva && _kva=yes
4828 if test "$_kva" = yes ; then
4829 def_kva='#define CONFIG_KVA 1'
4830 libs_mplayer="$libs_mplayer -lkva"
4831 vomodules="kva $vomodules"
4832 else
4833 def_kva='#undef CONFIG_KVA'
4834 novomodules="kva $novomodules"
4836 echores "$_kva"
4837 fi #if os2
4840 if win32; then
4842 echocheck "Windows waveout"
4843 if test "$_win32waveout" = auto ; then
4844 _win32waveout=no
4845 header_check_broken windows.h mmsystem.h -lwinmm && _win32waveout=yes
4847 if test "$_win32waveout" = yes ; then
4848 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4849 libs_mplayer="$libs_mplayer -lwinmm"
4850 aomodules="win32 $aomodules"
4851 else
4852 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4853 noaomodules="win32 $noaomodules"
4855 echores "$_win32waveout"
4857 echocheck "Direct3D"
4858 if test "$_direct3d" = auto ; then
4859 _direct3d=no
4860 header_check d3d9.h && _direct3d=yes
4862 if test "$_direct3d" = yes ; then
4863 def_direct3d='#define CONFIG_DIRECT3D 1'
4864 vomodules="direct3d $vomodules"
4865 else
4866 def_direct3d='#undef CONFIG_DIRECT3D'
4867 novomodules="direct3d $novomodules"
4869 echores "$_direct3d"
4871 echocheck "Directx"
4872 if test "$_directx" = auto ; then
4873 cat > $TMPC << EOF
4874 #include <ddraw.h>
4875 #include <dsound.h>
4876 int main(void) { return 0; }
4878 _directx=no
4879 cc_check -lgdi32 && _directx=yes
4881 if test "$_directx" = yes ; then
4882 def_directx='#define CONFIG_DIRECTX 1'
4883 libs_mplayer="$libs_mplayer -lgdi32"
4884 vomodules="directx $vomodules"
4885 aomodules="dsound $aomodules"
4886 else
4887 def_directx='#undef CONFIG_DIRECTX'
4888 novomodules="directx $novomodules"
4889 noaomodules="dsound $noaomodules"
4891 echores "$_directx"
4893 fi #if win32; then
4896 echocheck "DXR2"
4897 if test "$_dxr2" = auto; then
4898 _dxr2=no
4899 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4900 header_check dxr2ioctl.h $_inc_tmp && _dxr2=yes &&
4901 extra_cflags="$extra_cflags $_inc_tmp" && break
4902 done
4904 if test "$_dxr2" = yes; then
4905 def_dxr2='#define CONFIG_DXR2 1'
4906 aomodules="dxr2 $aomodules"
4907 vomodules="dxr2 $vomodules"
4908 else
4909 def_dxr2='#undef CONFIG_DXR2'
4910 noaomodules="dxr2 $noaomodules"
4911 novomodules="dxr2 $novomodules"
4913 echores "$_dxr2"
4915 echocheck "DXR3/H+"
4916 if test "$_dxr3" = auto ; then
4917 _dxr3=no
4918 header_check linux/em8300.h && _dxr3=yes
4920 if test "$_dxr3" = yes ; then
4921 def_dxr3='#define CONFIG_DXR3 1'
4922 vomodules="dxr3 $vomodules"
4923 else
4924 def_dxr3='#undef CONFIG_DXR3'
4925 novomodules="dxr3 $novomodules"
4927 echores "$_dxr3"
4930 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4931 if test "$_ivtv" = auto ; then
4932 cat > $TMPC << EOF
4933 #include <sys/time.h>
4934 #include <linux/videodev2.h>
4935 #include <linux/ivtv.h>
4936 #include <sys/ioctl.h>
4937 int main(void) {
4938 struct ivtv_cfg_stop_decode sd;
4939 struct ivtv_cfg_start_decode sd1;
4940 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4941 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
4942 return 0; }
4944 _ivtv=no
4945 cc_check && _ivtv=yes
4947 if test "$_ivtv" = yes ; then
4948 def_ivtv='#define CONFIG_IVTV 1'
4949 vomodules="ivtv $vomodules"
4950 aomodules="ivtv $aomodules"
4951 else
4952 def_ivtv='#undef CONFIG_IVTV'
4953 novomodules="ivtv $novomodules"
4954 noaomodules="ivtv $noaomodules"
4956 echores "$_ivtv"
4959 echocheck "V4L2 MPEG Decoder"
4960 if test "$_v4l2" = auto ; then
4961 cat > $TMPC << EOF
4962 #include <sys/time.h>
4963 #include <linux/videodev2.h>
4964 #include <linux/version.h>
4965 int main(void) {
4966 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4967 #error kernel headers too old, need 2.6.22
4968 #endif
4969 struct v4l2_ext_controls ctrls;
4970 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4971 return 0;
4974 _v4l2=no
4975 cc_check && _v4l2=yes
4977 if test "$_v4l2" = yes ; then
4978 def_v4l2='#define CONFIG_V4L2_DECODER 1'
4979 vomodules="v4l2 $vomodules"
4980 aomodules="v4l2 $aomodules"
4981 else
4982 def_v4l2='#undef CONFIG_V4L2_DECODER'
4983 novomodules="v4l2 $novomodules"
4984 noaomodules="v4l2 $noaomodules"
4986 echores "$_v4l2"
4990 #########
4991 # AUDIO #
4992 #########
4995 echocheck "OSS Audio"
4996 if test "$_ossaudio" = auto ; then
4997 _ossaudio=no
4998 return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
5000 if test "$_ossaudio" = yes ; then
5001 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5002 aomodules="oss $aomodules"
5003 cat > $TMPC << EOF
5004 #include <$_soundcard_header>
5005 #ifdef OPEN_SOUND_SYSTEM
5006 int main(void) { return 0; }
5007 #else
5008 #error Not the real thing
5009 #endif
5011 _real_ossaudio=no
5012 cc_check && _real_ossaudio=yes
5013 if test "$_real_ossaudio" = yes; then
5014 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5015 # Check for OSS4 headers (override default headers)
5016 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
5017 if test -f /etc/oss.conf; then
5018 . /etc/oss.conf
5019 _ossinc="$OSSLIBDIR/include"
5020 if test -f "$_ossinc/sys/soundcard.h"; then
5021 extra_cflags="-I$_ossinc $extra_cflags"
5024 elif netbsd || openbsd ; then
5025 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5026 extra_ldflags="$extra_ldflags -lossaudio"
5027 else
5028 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5030 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5031 else
5032 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5033 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5034 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5035 noaomodules="oss $noaomodules"
5037 echores "$_ossaudio"
5040 echocheck "aRts"
5041 if test "$_arts" = auto ; then
5042 _arts=no
5043 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5044 statement_check artsc.h 'arts_init()' $(artsc-config --libs) $(artsc-config --cflags) &&
5045 _arts=yes
5049 if test "$_arts" = yes ; then
5050 def_arts='#define CONFIG_ARTS 1'
5051 aomodules="arts $aomodules"
5052 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5053 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5054 else
5055 noaomodules="arts $noaomodules"
5057 echores "$_arts"
5060 echocheck "EsounD"
5061 if test "$_esd" = auto ; then
5062 _esd=no
5063 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5064 statement_check esd.h 'esd_open_sound("test")' $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5067 echores "$_esd"
5069 if test "$_esd" = yes ; then
5070 def_esd='#define CONFIG_ESD 1'
5071 aomodules="esd $aomodules"
5072 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5073 extra_cflags="$extra_cflags $(esd-config --cflags)"
5075 echocheck "esd_get_latency()"
5076 statement_check esd.h 'esd_get_latency(0)' $(esd-config --libs) $(esd-config --cflags) &&
5077 _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5078 echores "$_esd_latency"
5079 else
5080 def_esd='#undef CONFIG_ESD'
5081 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5082 noaomodules="esd $noaomodules"
5086 echocheck "NAS"
5087 if test "$_nas" = auto ; then
5088 _nas=no
5089 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
5091 if test "$_nas" = yes ; then
5092 def_nas='#define CONFIG_NAS 1'
5093 libs_mplayer="$libs_mplayer -laudio -lXt"
5094 aomodules="nas $aomodules"
5095 else
5096 noaomodules="nas $noaomodules"
5097 def_nas='#undef CONFIG_NAS'
5099 echores "$_nas"
5102 echocheck "pulse"
5103 if test "$_pulse" = auto ; then
5104 _pulse=no
5105 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5106 header_check pulse/pulseaudio.h $($_pkg_config --libs --cflags libpulse) &&
5107 _pulse=yes
5110 echores "$_pulse"
5112 if test "$_pulse" = yes ; then
5113 def_pulse='#define CONFIG_PULSE 1'
5114 aomodules="pulse $aomodules"
5115 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5116 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5117 else
5118 def_pulse='#undef CONFIG_PULSE'
5119 noaomodules="pulse $noaomodules"
5123 echocheck "JACK"
5124 if test "$_jack" = auto ; then
5125 _jack=yes
5126 if statement_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' -ljack ; then
5127 libs_mplayer="$libs_mplayer -ljack"
5128 elif statement_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' $($_pkg_config --libs --cflags --silence-errors jack) ; then
5129 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5130 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5131 else
5132 _jack=no
5136 if test "$_jack" = yes ; then
5137 def_jack='#define CONFIG_JACK 1'
5138 aomodules="jack $aomodules"
5139 else
5140 noaomodules="jack $noaomodules"
5142 echores "$_jack"
5144 echocheck "OpenAL"
5145 if test "$_openal" = auto ; then
5146 _openal=no
5147 cat > $TMPC << EOF
5148 #ifdef OPENAL_AL_H
5149 #include <OpenAL/al.h>
5150 #else
5151 #include <AL/al.h>
5152 #endif
5153 int main(void) {
5154 alSourceQueueBuffers(0, 0, 0);
5155 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5156 return 0;
5159 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5160 cc_check $I && _openal=yes && break
5161 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5162 done
5163 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5165 if test "$_openal" = yes ; then
5166 def_openal='#define CONFIG_OPENAL 1'
5167 aomodules="openal $aomodules"
5168 else
5169 noaomodules="openal $noaomodules"
5171 echores "$_openal"
5173 echocheck "ALSA audio"
5174 if test "$_alloca" != yes ; then
5175 _alsa=no
5176 res_comment="alloca missing"
5178 if test "$_alsa" != no ; then
5179 _alsa=no
5180 cat > $TMPC << EOF
5181 #include <sys/asoundlib.h>
5182 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5183 #error "alsa version != 0.5.x"
5184 #endif
5185 int main(void) { return 0; }
5187 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5189 cat > $TMPC << EOF
5190 #include <sys/asoundlib.h>
5191 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5192 #error "alsa version != 0.9.x"
5193 #endif
5194 int main(void) { return 0; }
5196 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5197 cat > $TMPC << EOF
5198 #include <alsa/asoundlib.h>
5199 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5200 #error "alsa version != 0.9.x"
5201 #endif
5202 int main(void) { return 0; }
5204 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5206 cat > $TMPC << EOF
5207 #include <sys/asoundlib.h>
5208 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5209 #error "alsa version != 1.0.x"
5210 #endif
5211 int main(void) { return 0; }
5213 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5214 cat > $TMPC << EOF
5215 #include <alsa/asoundlib.h>
5216 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5217 #error "alsa version != 1.0.x"
5218 #endif
5219 int main(void) { return 0; }
5221 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5223 def_alsa='#undef CONFIG_ALSA'
5224 def_alsa5='#undef CONFIG_ALSA5'
5225 def_alsa9='#undef CONFIG_ALSA9'
5226 def_alsa1x='#undef CONFIG_ALSA1X'
5227 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5228 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5229 if test "$_alsaver" ; then
5230 _alsa=yes
5231 if test "$_alsaver" = '0.5.x' ; then
5232 _alsa5=yes
5233 aomodules="alsa5 $aomodules"
5234 def_alsa5='#define CONFIG_ALSA5 1'
5235 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5236 res_comment="using alsa 0.5.x and sys/asoundlib.h"
5237 elif test "$_alsaver" = '0.9.x-sys' ; then
5238 _alsa9=yes
5239 aomodules="alsa $aomodules"
5240 def_alsa='#define CONFIG_ALSA 1'
5241 def_alsa9='#define CONFIG_ALSA9 1'
5242 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5243 res_comment="using alsa 0.9.x and sys/asoundlib.h"
5244 elif test "$_alsaver" = '0.9.x-alsa' ; then
5245 _alsa9=yes
5246 aomodules="alsa $aomodules"
5247 def_alsa='#define CONFIG_ALSA 1'
5248 def_alsa9='#define CONFIG_ALSA9 1'
5249 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5250 res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5251 elif test "$_alsaver" = '1.0.x-sys' ; then
5252 _alsa1x=yes
5253 aomodules="alsa $aomodules"
5254 def_alsa='#define CONFIG_ALSA 1'
5255 def_alsa1x="#define CONFIG_ALSA1X 1"
5256 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5257 res_comment="using alsa 1.0.x and sys/asoundlib.h"
5258 elif test "$_alsaver" = '1.0.x-alsa' ; then
5259 _alsa1x=yes
5260 aomodules="alsa $aomodules"
5261 def_alsa='#define CONFIG_ALSA 1'
5262 def_alsa1x="#define CONFIG_ALSA1X 1"
5263 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5264 res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5265 else
5266 _alsa=no
5267 res_comment="unknown version"
5269 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5270 else
5271 noaomodules="alsa $noaomodules"
5273 echores "$_alsa"
5276 echocheck "Sun audio"
5277 if test "$_sunaudio" = auto ; then
5278 cat > $TMPC << EOF
5279 #include <sys/types.h>
5280 #include <sys/audioio.h>
5281 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5283 _sunaudio=no
5284 cc_check && _sunaudio=yes
5286 if test "$_sunaudio" = yes ; then
5287 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5288 aomodules="sun $aomodules"
5289 else
5290 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5291 noaomodules="sun $noaomodules"
5293 echores "$_sunaudio"
5296 if darwin; then
5297 echocheck "CoreAudio"
5298 if test "$_coreaudio" = auto ; then
5299 cat > $TMPC <<EOF
5300 #include <CoreAudio/CoreAudio.h>
5301 #include <AudioToolbox/AudioToolbox.h>
5302 #include <AudioUnit/AudioUnit.h>
5303 int main(void) { return 0; }
5305 _coreaudio=no
5306 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5308 if test "$_coreaudio" = yes ; then
5309 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5310 def_coreaudio='#define CONFIG_COREAUDIO 1'
5311 aomodules="coreaudio $aomodules"
5312 else
5313 def_coreaudio='#undef CONFIG_COREAUDIO'
5314 noaomodules="coreaudio $noaomodules"
5316 echores $_coreaudio
5317 fi #if darwin
5320 if irix; then
5321 echocheck "SGI audio"
5322 if test "$_sgiaudio" = auto ; then
5323 _sgiaudio=no
5324 header_check dmedia/audio.h && _sgiaudio=yes
5326 if test "$_sgiaudio" = "yes" ; then
5327 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5328 libs_mplayer="$libs_mplayer -laudio"
5329 aomodules="sgi $aomodules"
5330 else
5331 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5332 noaomodules="sgi $noaomodules"
5334 echores "$_sgiaudio"
5335 fi #if irix
5338 if os2 ; then
5339 echocheck "KAI (UNIAUD/DART)"
5340 if test "$_kai" = auto; then
5341 _kai=no;
5342 header_check_broken os2.h kai.h -lkai && _kai=yes
5344 if test "$_kai" = yes ; then
5345 def_kai='#define CONFIG_KAI 1'
5346 libs_mplayer="$libs_mplayer -lkai"
5347 aomodules="kai $aomodules"
5348 else
5349 def_kai='#undef CONFIG_KAI'
5350 noaomodules="kai $noaomodules"
5352 echores "$_kai"
5354 echocheck "DART"
5355 if test "$_dart" = auto; then
5356 _dart=no;
5357 header_check_broken os2.h dart.h -ldart && _dart=yes
5359 if test "$_dart" = yes ; then
5360 def_dart='#define CONFIG_DART 1'
5361 libs_mplayer="$libs_mplayer -ldart"
5362 aomodules="dart $aomodules"
5363 else
5364 def_dart='#undef CONFIG_DART'
5365 noaomodules="dart $noaomodules"
5367 echores "$_dart"
5368 fi #if os2
5371 # set default CD/DVD devices
5372 if win32 || os2 ; then
5373 default_cdrom_device="D:"
5374 elif darwin ; then
5375 default_cdrom_device="/dev/disk1"
5376 elif dragonfly ; then
5377 default_cdrom_device="/dev/cd0"
5378 elif freebsd ; then
5379 default_cdrom_device="/dev/acd0"
5380 elif openbsd ; then
5381 default_cdrom_device="/dev/rcd0c"
5382 elif sunos ; then
5383 default_cdrom_device="/vol/dev/aliases/cdrom0"
5384 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5385 # file system and the volfs service.
5386 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5387 elif amigaos ; then
5388 default_cdrom_device="a1ide.device:2"
5389 else
5390 default_cdrom_device="/dev/cdrom"
5393 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5394 default_dvd_device=$default_cdrom_device
5395 elif darwin ; then
5396 default_dvd_device="/dev/rdiskN"
5397 else
5398 default_dvd_device="/dev/dvd"
5402 echocheck "VCD support"
5403 if test "$_vcd" = auto; then
5404 _vcd=no
5405 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
5406 _vcd=yes
5407 elif mingw32; then
5408 header_check ddk/ntddcdrm.h && _vcd=yes
5411 if test "$_vcd" = yes; then
5412 inputmodules="vcd $inputmodules"
5413 def_vcd='#define CONFIG_VCD 1'
5414 else
5415 def_vcd='#undef CONFIG_VCD'
5416 noinputmodules="vcd $noinputmodules"
5417 res_comment="not supported on this OS"
5419 echores "$_vcd"
5423 echocheck "Blu-ray support"
5424 if test "$_bluray" = auto ; then
5425 _bluray=no
5426 statement_check libbluray/bluray.h 'bd_get_title_info(0, 0)' -lbluray && _bluray=yes
5428 if test "$_bluray" = yes ; then
5429 def_bluray='#define CONFIG_LIBBLURAY 1'
5430 extra_ldflags="$extra_ldflags -lbluray"
5431 inputmodules="bluray $inputmodules"
5432 else
5433 def_bluray='#undef CONFIG_LIBBLURAY'
5434 noinputmodules="bluray $noinputmodules"
5436 echores "$_bluray"
5438 echocheck "dvdread"
5439 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5440 _dvdread_internal=no
5442 if test "$_dvdread_internal" = auto ; then
5443 _dvdread_internal=no
5444 _dvdread=no
5445 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) &&
5446 (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes ||
5447 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) ||
5448 darwin || win32 || os2; then
5449 _dvdread_internal=yes
5450 _dvdread=yes
5451 extra_cflags="-Ilibdvdread4 $extra_cflags"
5453 elif test "$_dvdread" = auto ; then
5454 _dvdread=no
5455 if test "$_dl" = yes; then
5456 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5457 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5458 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5459 _dvdread=yes
5460 extra_cflags="$extra_cflags $_dvdreadcflags"
5461 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5462 res_comment="external"
5467 if test "$_dvdread_internal" = yes; then
5468 def_dvdread='#define CONFIG_DVDREAD 1'
5469 inputmodules="dvdread(internal) $inputmodules"
5470 _largefiles=yes
5471 res_comment="internal"
5472 elif test "$_dvdread" = yes; then
5473 def_dvdread='#define CONFIG_DVDREAD 1'
5474 _largefiles=yes
5475 extra_ldflags="$extra_ldflags -ldvdread"
5476 inputmodules="dvdread(external) $inputmodules"
5477 res_comment="external"
5478 else
5479 def_dvdread='#undef CONFIG_DVDREAD'
5480 noinputmodules="dvdread $noinputmodules"
5482 echores "$_dvdread"
5485 echocheck "internal libdvdcss"
5486 if test "$_libdvdcss_internal" = auto ; then
5487 _libdvdcss_internal=no
5488 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
5489 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5491 if test "$_libdvdcss_internal" = yes ; then
5492 if linux || netbsd || openbsd || bsdos ; then
5493 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5494 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5495 elif freebsd || dragonfly ; then
5496 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5497 elif darwin ; then
5498 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5499 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5500 elif cygwin ; then
5501 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5502 elif beos ; then
5503 cflags_libdvdcss="-DSYS_BEOS"
5504 elif os2 ; then
5505 cflags_libdvdcss="-DSYS_OS2"
5507 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5508 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5509 inputmodules="libdvdcss(internal) $inputmodules"
5510 _largefiles=yes
5511 else
5512 noinputmodules="libdvdcss(internal) $noinputmodules"
5514 echores "$_libdvdcss_internal"
5517 echocheck "cdparanoia"
5518 if test "$_cdparanoia" = auto ; then
5519 cat > $TMPC <<EOF
5520 #include <cdda_interface.h>
5521 #include <cdda_paranoia.h>
5522 // This need a better test. How ?
5523 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5525 _cdparanoia=no
5526 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5527 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm &&
5528 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5529 done
5531 if test "$_cdparanoia" = yes ; then
5532 _cdda='yes'
5533 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5534 openbsd && extra_ldflags="$extra_ldflags -lutil"
5536 echores "$_cdparanoia"
5539 echocheck "libcdio"
5540 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5541 cat > $TMPC << EOF
5542 #include <stdio.h>
5543 #include <cdio/version.h>
5544 #include <cdio/cdda.h>
5545 #include <cdio/paranoia.h>
5546 int main(void) {
5547 void *test = cdda_verbose_set;
5548 printf("%s\n", CDIO_VERSION);
5549 return test == (void *)1;
5552 _libcdio=no
5553 for _ld_tmp in "" "-lwinmm" ; do
5554 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5555 cc_check $_ld_tmp $_ld_lm && _libcdio=yes &&
5556 extra_ldflags="$extra_ldflags $_ld_tmp" && break
5557 done
5558 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5559 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
5560 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
5561 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes &&
5562 extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5565 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5566 _cdda='yes'
5567 def_libcdio='#define CONFIG_LIBCDIO 1'
5568 def_havelibcdio='yes'
5569 else
5570 if test "$_cdparanoia" = yes ; then
5571 res_comment="using cdparanoia"
5573 def_libcdio='#undef CONFIG_LIBCDIO'
5574 def_havelibcdio='no'
5576 echores "$_libcdio"
5578 if test "$_cdda" = yes ; then
5579 test $_cddb = auto && test $networking = yes && _cddb=yes
5580 def_cdparanoia='#define CONFIG_CDDA 1'
5581 inputmodules="cdda $inputmodules"
5582 else
5583 def_cdparanoia='#undef CONFIG_CDDA'
5584 noinputmodules="cdda $noinputmodules"
5587 if test "$_cddb" = yes ; then
5588 def_cddb='#define CONFIG_CDDB 1'
5589 inputmodules="cddb $inputmodules"
5590 else
5591 _cddb=no
5592 def_cddb='#undef CONFIG_CDDB'
5593 noinputmodules="cddb $noinputmodules"
5596 echocheck "bitmap font support"
5597 if test "$_bitmap_font" = yes ; then
5598 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5599 else
5600 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5602 echores "$_bitmap_font"
5605 echocheck "freetype >= 2.0.9"
5607 # freetype depends on iconv
5608 if test "$_iconv" = no ; then
5609 _freetype=no
5610 res_comment="iconv support needed"
5613 if test "$_freetype" = auto ; then
5614 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5615 cat > $TMPC << EOF
5616 #include <stdio.h>
5617 #include <ft2build.h>
5618 #include FT_FREETYPE_H
5619 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5620 #error "Need FreeType 2.0.9 or newer"
5621 #endif
5622 int main(void) {
5623 FT_Library library;
5624 FT_Init_FreeType(&library);
5625 return 0;
5628 _freetype=no
5629 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
5630 else
5631 _freetype=no
5634 if test "$_freetype" = yes ; then
5635 def_freetype='#define CONFIG_FREETYPE 1'
5636 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
5637 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
5638 else
5639 def_freetype='#undef CONFIG_FREETYPE'
5641 echores "$_freetype"
5643 if test "$_freetype" = no ; then
5644 _fontconfig=no
5645 res_comment="FreeType support needed"
5647 echocheck "fontconfig"
5648 if test "$_fontconfig" = auto ; then
5649 cat > $TMPC << EOF
5650 #include <stdio.h>
5651 #include <stdlib.h>
5652 #include <fontconfig/fontconfig.h>
5653 #if FC_VERSION < 20402
5654 #error At least version 2.4.2 of fontconfig required
5655 #endif
5656 int main(void) {
5657 int err = FcInit();
5658 if (err == FcFalse) {
5659 printf("Couldn't initialize fontconfig lib\n");
5660 exit(err);
5662 return 0;
5665 _fontconfig=no
5666 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
5667 _ld_tmp="-lfontconfig $_ld_tmp"
5668 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5669 done
5670 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5671 _inc_tmp=$($_pkg_config --cflags fontconfig)
5672 _ld_tmp=$($_pkg_config --libs fontconfig)
5673 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes &&
5674 extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5677 if test "$_fontconfig" = yes ; then
5678 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5679 else
5680 def_fontconfig='#undef CONFIG_FONTCONFIG'
5682 echores "$_fontconfig"
5685 echocheck "SSA/ASS support"
5686 if test "$_ass" = auto -o "$_ass" = yes ; then
5687 if $_pkg_config libass; then
5688 _ass=yes
5689 def_ass='#define CONFIG_ASS 1'
5690 extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
5691 extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
5692 else
5693 _ass=no
5694 def_ass='#undef CONFIG_ASS'
5696 else
5697 def_ass='#undef CONFIG_ASS'
5699 echores "$_ass"
5702 echocheck "fribidi with charsets"
5703 _inc_tmp=""
5704 _ld_tmp=""
5705 if test "$_fribidi" = auto ; then
5706 cat > $TMPC << EOF
5707 #include <stdlib.h>
5708 /* workaround for fribidi 0.10.4 and below */
5709 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5710 #include <fribidi/fribidi.h>
5711 int main(void) {
5712 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8)
5713 exit(1);
5714 return 0;
5717 _fribidi=no
5718 _inc_tmp=""
5719 _ld_tmp="-lfribidi"
5720 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5721 if $_pkg_config --exists fribidi > /dev/null 2>&1 &&
5722 test "$_fribidi" = no ; then
5723 _inc_tmp="$($_pkg_config --cflags)"
5724 _ld_tmp="$($_pkg_config --libs)"
5725 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5728 if test "$_fribidi" = yes ; then
5729 def_fribidi='#define CONFIG_FRIBIDI 1'
5730 extra_cflags="$extra_cflags $_inc_tmp"
5731 extra_ldflags="$extra_ldflags $_ld_tmp"
5732 else
5733 def_fribidi='#undef CONFIG_FRIBIDI'
5735 echores "$_fribidi"
5738 echocheck "ENCA"
5739 if test "$_enca" = auto ; then
5740 _enca=no
5741 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
5743 if test "$_enca" = yes ; then
5744 def_enca='#define CONFIG_ENCA 1'
5745 extra_ldflags="$extra_ldflags -lenca"
5746 else
5747 def_enca='#undef CONFIG_ENCA'
5749 echores "$_enca"
5752 echocheck "zlib"
5753 _zlib=no
5754 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5755 if test "$_zlib" = yes ; then
5756 def_zlib='#define CONFIG_ZLIB 1'
5757 extra_ldflags="$extra_ldflags -lz"
5758 else
5759 def_zlib='#define CONFIG_ZLIB 0'
5761 echores "$_zlib"
5764 echocheck "bzlib"
5765 bzlib=no
5766 def_bzlib='#define CONFIG_BZLIB 0'
5767 statement_check bzlib.h 'BZ2_bzlibVersion()' -lbz2 && bzlib=yes
5768 if test "$bzlib" = yes ; then
5769 def_bzlib='#define CONFIG_BZLIB 1'
5770 extra_ldflags="$extra_ldflags -lbz2"
5772 echores "$bzlib"
5775 echocheck "RTC"
5776 if test "$_rtc" = auto ; then
5777 cat > $TMPC << EOF
5778 #include <sys/ioctl.h>
5779 #ifdef __linux__
5780 #include <linux/rtc.h>
5781 #else
5782 #include <rtc.h>
5783 #define RTC_PIE_ON RTCIO_PIE_ON
5784 #endif
5785 int main(void) { return RTC_PIE_ON; }
5787 _rtc=no
5788 cc_check && _rtc=yes
5789 ppc && _rtc=no
5791 if test "$_rtc" = yes ; then
5792 def_rtc='#define HAVE_RTC 1'
5793 else
5794 def_rtc='#undef HAVE_RTC'
5796 echores "$_rtc"
5799 echocheck "liblzo2 support"
5800 if test "$_liblzo" = auto ; then
5801 _liblzo=no
5802 statement_check lzo/lzo1x.h 'lzo_init()' -llzo2 && _liblzo=yes
5804 if test "$_liblzo" = yes ; then
5805 def_liblzo='#define CONFIG_LIBLZO 1'
5806 extra_ldflags="$extra_ldflags -llzo2"
5807 codecmodules="liblzo $codecmodules"
5808 else
5809 def_liblzo='#undef CONFIG_LIBLZO'
5810 nocodecmodules="liblzo $nocodecmodules"
5812 echores "$_liblzo"
5815 echocheck "mad support"
5816 if test "$_mad" = auto ; then
5817 _mad=no
5818 header_check mad.h -lmad && _mad=yes
5820 if test "$_mad" = yes ; then
5821 def_mad='#define CONFIG_LIBMAD 1'
5822 extra_ldflags="$extra_ldflags -lmad"
5823 codecmodules="libmad $codecmodules"
5824 else
5825 def_mad='#undef CONFIG_LIBMAD'
5826 nocodecmodules="libmad $nocodecmodules"
5828 echores "$_mad"
5830 echocheck "OggVorbis support"
5831 if test "$_tremor_internal" = yes; then
5832 _libvorbis=no
5833 elif test "$_tremor" = auto; then
5834 _tremor=no
5835 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
5837 if test "$_libvorbis" = auto; then
5838 _libvorbis=no
5839 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes
5841 if test "$_tremor_internal" = yes ; then
5842 _vorbis=yes
5843 def_vorbis='#define CONFIG_OGGVORBIS 1'
5844 def_tremor='#define CONFIG_TREMOR 1'
5845 codecmodules="tremor(internal) $codecmodules"
5846 res_comment="internal Tremor"
5847 if test "$_tremor_low" = yes ; then
5848 cflags_tremor_low="-D_LOW_ACCURACY_"
5849 res_comment="internal low accuracy Tremor"
5851 elif test "$_tremor" = yes ; then
5852 _vorbis=yes
5853 def_vorbis='#define CONFIG_OGGVORBIS 1'
5854 def_tremor='#define CONFIG_TREMOR 1'
5855 codecmodules="tremor(external) $codecmodules"
5856 res_comment="external Tremor"
5857 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
5858 elif test "$_libvorbis" = yes ; then
5859 _vorbis=yes
5860 def_vorbis='#define CONFIG_OGGVORBIS 1'
5861 codecmodules="libvorbis $codecmodules"
5862 res_comment="libvorbis"
5863 extra_ldflags="$extra_ldflags -lvorbis -logg"
5864 else
5865 _vorbis=no
5866 nocodecmodules="libvorbis $nocodecmodules"
5868 echores "$_vorbis"
5870 echocheck "libspeex (version >= 1.1 required)"
5871 if test "$_speex" = auto ; then
5872 _speex=no
5873 cat > $TMPC << EOF
5874 #include <stddef.h>
5875 #include <speex/speex.h>
5876 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5878 cc_check -lspeex $_ld_lm && _speex=yes
5880 if test "$_speex" = yes ; then
5881 def_speex='#define CONFIG_SPEEX 1'
5882 extra_ldflags="$extra_ldflags -lspeex"
5883 codecmodules="speex $codecmodules"
5884 else
5885 def_speex='#undef CONFIG_SPEEX'
5886 nocodecmodules="speex $nocodecmodules"
5888 echores "$_speex"
5890 echocheck "OggTheora support"
5891 if test "$_theora" = auto ; then
5892 _theora=no
5893 cat > $TMPC << EOF
5894 #include <theora/theora.h>
5895 #include <string.h>
5896 int main(void) {
5897 /* Theora is in flux, make sure that all interface routines and datatypes
5898 * exist and work the way we expect it, so we don't break MPlayer. */
5899 ogg_packet op;
5900 theora_comment tc;
5901 theora_info inf;
5902 theora_state st;
5903 yuv_buffer yuv;
5904 int r;
5905 double t;
5907 theora_info_init(&inf);
5908 theora_comment_init(&tc);
5910 return 0;
5912 /* we don't want to execute this kind of nonsense; just for making sure
5913 * that compilation works... */
5914 memset(&op, 0, sizeof(op));
5915 r = theora_decode_header(&inf, &tc, &op);
5916 r = theora_decode_init(&st, &inf);
5917 t = theora_granule_time(&st, op.granulepos);
5918 r = theora_decode_packetin(&st, &op);
5919 r = theora_decode_YUVout(&st, &yuv);
5920 theora_clear(&st);
5922 return 0;
5925 _ld_theora=$($_pkg_config --silence-errors --libs theora)
5926 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
5927 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
5928 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
5929 if test _theora = no; then
5930 _ld_theora="-ltheora -logg"
5931 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
5933 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5934 _ld_theora=$($_pkg_config --silence-errors --libs theora)
5935 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
5936 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
5937 extra_ldflags="$extra_ldflags $_ld_theora" &&
5938 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
5939 if test _theora = no; then
5940 _ld_theora="-ltheora -logg"
5941 cc_check tremor/bitwise.c $_ld_theora &&
5942 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
5946 if test "$_theora" = yes ; then
5947 def_theora='#define CONFIG_OGGTHEORA 1'
5948 codecmodules="libtheora $codecmodules"
5949 # when --enable-theora is forced, we'd better provide a probably sane
5950 # $_ld_theora than nothing
5951 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
5952 else
5953 def_theora='#undef CONFIG_OGGTHEORA'
5954 nocodecmodules="libtheora $nocodecmodules"
5956 echores "$_theora"
5958 echocheck "mp3lib support"
5959 if test "$_mp3lib" = auto ; then
5960 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
5962 if test "$_mp3lib" = yes ; then
5963 def_mp3lib='#define CONFIG_MP3LIB 1'
5964 codecmodules="mp3lib(internal) $codecmodules"
5965 else
5966 def_mp3lib='#undef CONFIG_MP3LIB'
5967 nocodecmodules="mp3lib(internal) $nocodecmodules"
5969 echores "$_mp3lib"
5971 # Any version of libmpg123 shall be fine.
5972 echocheck "mpg123 support"
5973 def_mpg123='#undef CONFIG_MPG123'
5974 if test "$_mpg123" = auto; then
5975 _mpg123=no
5976 statement_check mpg123.h 'mpg123_init()' -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
5978 if test "$_mpg123" = yes ; then
5979 def_mpg123='#define CONFIG_MPG123 1'
5980 codecmodules="mpg123 $codecmodules"
5981 else
5982 nocodecmodules="mpg123 $nocodecmodules"
5984 echores "$_mpg123"
5986 echocheck "liba52 support"
5987 def_liba52='#undef CONFIG_LIBA52'
5988 if test "$_liba52" = auto ; then
5989 _liba52=no
5990 cat > $TMPC << EOF
5991 #include <inttypes.h>
5992 #include <a52dec/a52.h>
5993 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
5995 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
5997 if test "$_liba52" = yes ; then
5998 def_liba52='#define CONFIG_LIBA52 1'
5999 codecmodules="liba52 $codecmodules"
6000 else
6001 nocodecmodules="liba52 $nocodecmodules"
6003 echores "$_liba52"
6005 echocheck "internal libmpeg2 support"
6006 if test "$_libmpeg2" = auto ; then
6007 _libmpeg2=yes
6008 if alpha && test cc_vendor=gnu; then
6009 case $cc_version in
6010 2*|3.0*|3.1*) # cannot compile MVI instructions
6011 _libmpeg2=no
6012 res_comment="broken gcc"
6014 esac
6017 if test "$_libmpeg2" = yes ; then
6018 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6019 codecmodules="libmpeg2(internal) $codecmodules"
6020 else
6021 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6022 nocodecmodules="libmpeg2(internal) $nocodecmodules"
6024 echores "$_libmpeg2"
6026 echocheck "libdca support"
6027 if test "$_libdca" = auto ; then
6028 _libdca=no
6029 for _ld_dca in -ldca -ldts ; do
6030 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
6031 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
6032 done
6034 if test "$_libdca" = yes ; then
6035 def_libdca='#define CONFIG_LIBDCA 1'
6036 codecmodules="libdca $codecmodules"
6037 else
6038 def_libdca='#undef CONFIG_LIBDCA'
6039 nocodecmodules="libdca $nocodecmodules"
6041 echores "$_libdca"
6043 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6044 if test "$_musepack" = auto ; then
6045 _musepack=no
6046 cat > $TMPC << EOF
6047 #include <stddef.h>
6048 #include <mpcdec/mpcdec.h>
6049 int main(void) {
6050 mpc_streaminfo info;
6051 mpc_decoder decoder;
6052 mpc_decoder_set_streaminfo(&decoder, &info);
6053 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6054 return 0;
6057 cc_check -lmpcdec $_ld_lm && _musepack=yes
6059 if test "$_musepack" = yes ; then
6060 def_musepack='#define CONFIG_MUSEPACK 1'
6061 extra_ldflags="$extra_ldflags -lmpcdec"
6062 codecmodules="musepack $codecmodules"
6063 else
6064 def_musepack='#undef CONFIG_MUSEPACK'
6065 nocodecmodules="musepack $nocodecmodules"
6067 echores "$_musepack"
6070 echocheck "FAAD2 support"
6071 if test "$_faad" = auto ; then
6072 _faad=no
6073 cat > $TMPC << EOF
6074 #include <faad.h>
6075 #ifndef FAAD_MIN_STREAMSIZE
6076 #error Too old version
6077 #endif
6078 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6079 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6081 cc_check -lfaad $_ld_lm && _faad=yes
6084 def_faad='#undef CONFIG_FAAD'
6085 if test "$_faad" = yes ; then
6086 def_faad='#define CONFIG_FAAD 1'
6087 extra_ldflags="$extra_ldflags -lfaad"
6088 codecmodules="faad2 $codecmodules"
6089 else
6090 nocodecmodules="faad2 $nocodecmodules"
6092 echores "$_faad"
6095 echocheck "LADSPA plugin support"
6096 if test "$_ladspa" = auto ; then
6097 _ladspa=no
6098 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
6100 if test "$_ladspa" = yes; then
6101 def_ladspa="#define CONFIG_LADSPA 1"
6102 else
6103 def_ladspa="#undef CONFIG_LADSPA"
6105 echores "$_ladspa"
6108 echocheck "libbs2b audio filter support"
6109 if test "$_libbs2b" = auto ; then
6110 cat > $TMPC <<EOF
6111 #include <bs2b.h>
6112 #if BS2B_VERSION_MAJOR < 3
6113 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6114 #endif
6115 int main(void) {
6116 t_bs2bdp filter;
6117 filter=bs2b_open();
6118 bs2b_close(filter);
6119 return 0;
6122 _libbs2b=no
6123 if $_pkg_config --exists libbs2b ; then
6124 _inc_tmp=$($_pkg_config --cflags libbs2b)
6125 _ld_tmp=$($_pkg_config --libs libbs2b)
6126 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6127 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6128 else
6129 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6130 -I/usr/local/include/bs2b ; do
6131 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6132 extra_ldflags="$extra_ldflags -lbs2b"
6133 extra_cflags="$extra_cflags $_inc_tmp"
6134 _libbs2b=yes
6135 break
6137 done
6140 def_libbs2b="#undef CONFIG_LIBBS2B"
6141 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6142 echores "$_libbs2b"
6145 if test -z "$_codecsdir" ; then
6146 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6147 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6148 if test -d "$dir" ; then
6149 _codecsdir="$dir"
6150 break;
6152 done
6154 # Fall back on default directory.
6155 if test -z "$_codecsdir" ; then
6156 _codecsdir="$_libdir/codecs"
6157 mingw32 || os2 && _codecsdir="codecs"
6161 echocheck "Win32 codecs"
6162 if test "$_win32dll" = auto ; then
6163 _win32dll=no
6164 if x86_32 && ! qnx; then
6165 _win32dll=yes
6168 if test "$_win32dll" = yes ; then
6169 def_win32dll='#define CONFIG_WIN32DLL 1'
6170 if ! win32 ; then
6171 def_win32_loader='#define WIN32_LOADER 1'
6172 _win32_emulation=yes
6173 else
6174 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6175 res_comment="using native windows"
6177 codecmodules="win32 $codecmodules"
6178 else
6179 def_win32dll='#undef CONFIG_WIN32DLL'
6180 def_win32_loader='#undef WIN32_LOADER'
6181 nocodecmodules="win32 $nocodecmodules"
6183 echores "$_win32dll"
6186 echocheck "XAnim codecs"
6187 if test "$_xanim" = auto ; then
6188 _xanim=no
6189 res_comment="dynamic loader support needed"
6190 if test "$_dl" = yes ; then
6191 _xanim=yes
6194 if test "$_xanim" = yes ; then
6195 def_xanim='#define CONFIG_XANIM 1'
6196 codecmodules="xanim $codecmodules"
6197 else
6198 def_xanim='#undef CONFIG_XANIM'
6199 nocodecmodules="xanim $nocodecmodules"
6201 echores "$_xanim"
6204 echocheck "RealPlayer codecs"
6205 if test "$_real" = auto ; then
6206 _real=no
6207 res_comment="dynamic loader support needed"
6208 if test "$_dl" = yes || test "$_win32dll" = yes &&
6209 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
6210 _real=yes
6213 if test "$_real" = yes ; then
6214 def_real='#define CONFIG_REALCODECS 1'
6215 codecmodules="real $codecmodules"
6216 else
6217 def_real='#undef CONFIG_REALCODECS'
6218 nocodecmodules="real $nocodecmodules"
6220 echores "$_real"
6223 echocheck "QuickTime codecs"
6224 _qtx_emulation=no
6225 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6226 if test "$_qtx" = auto ; then
6227 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6229 if test "$_qtx" = yes ; then
6230 def_qtx='#define CONFIG_QTX_CODECS 1'
6231 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6232 codecmodules="qtx $codecmodules"
6233 darwin || win32 || _qtx_emulation=yes
6234 else
6235 def_qtx='#undef CONFIG_QTX_CODECS'
6236 nocodecmodules="qtx $nocodecmodules"
6238 echores "$_qtx"
6240 echocheck "Nemesi Streaming Media libraries"
6241 if test "$_nemesi" = auto && test "$networking" = yes ; then
6242 _nemesi=no
6243 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6244 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6245 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6246 _nemesi=yes
6249 if test "$_nemesi" = yes; then
6250 _native_rtsp=no
6251 def_nemesi='#define CONFIG_LIBNEMESI 1'
6252 inputmodules="nemesi $inputmodules"
6253 else
6254 _native_rtsp="$networking"
6255 _nemesi=no
6256 def_nemesi='#undef CONFIG_LIBNEMESI'
6257 noinputmodules="nemesi $noinputmodules"
6259 echores "$_nemesi"
6261 echocheck "LIVE555 Streaming Media libraries"
6262 if test "$_live" = auto && test "$networking" = yes ; then
6263 cat > $TMPCPP << EOF
6264 #include <liveMedia.hh>
6265 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6266 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6267 #endif
6268 int main(void) { return 0; }
6271 _live=no
6272 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
6273 cxx_check $I/liveMedia/include $I/UsageEnvironment/include $I/groupsock/include &&
6274 _livelibdir=$(echo $I| sed s/-I//) &&
6275 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6276 $_livelibdir/groupsock/libgroupsock.a \
6277 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6278 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6279 $extra_ldflags -lstdc++" \
6280 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6281 -I$_livelibdir/UsageEnvironment/include \
6282 -I$_livelibdir/BasicUsageEnvironment/include \
6283 -I$_livelibdir/groupsock/include" &&
6284 _live=yes && break
6285 done
6286 if test "$_live" != yes ; then
6287 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6288 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
6289 _live_dist=yes
6293 if test "$_live" = yes && test "$networking" = yes; then
6294 test $_livelibdir && res_comment="using $_livelibdir"
6295 def_live='#define CONFIG_LIVE555 1'
6296 inputmodules="live555 $inputmodules"
6297 elif test "$_live_dist" = yes && test "$networking" = yes; then
6298 res_comment="using distribution version"
6299 _live="yes"
6300 def_live='#define CONFIG_LIVE555 1'
6301 extra_ldflags="$extra_ldflags $ld_tmp"
6302 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6303 inputmodules="live555 $inputmodules"
6304 else
6305 _live=no
6306 def_live='#undef CONFIG_LIVE555'
6307 noinputmodules="live555 $noinputmodules"
6309 echores "$_live"
6313 all_ffmpeg_libs="libavutil libavcodec libavformat libswscale libpostproc"
6314 echocheck "FFmpeg ($all_ffmpeg_libs)"
6315 if test "$ffmpeg" = auto ; then
6316 ffmpeg=no
6317 if $_pkg_config --exists $all_ffmpeg_libs ; then
6318 inc_ffmpeg=$($_pkg_config --cflags $all_ffmpeg_libs)
6319 _ld_tmp=$($_pkg_config --libs $all_ffmpeg_libs)
6320 extra_ldflags="$extra_ldflags $_ld_tmp"
6321 extra_cflags="$extra_cflags $inc_ffmpeg"
6322 ffmpeg=yes
6323 elif header_check libavcore/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil $_ld_lm ; then
6324 extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil -lavcore"
6325 ffmpeg=yes
6329 ffmpeg_eval_api=no
6330 def_ffmpeg_eval_api="#undef CONFIG_FFMPEG_EVAL_API"
6331 if test "$ffmpeg" = yes; then
6332 def_ffmpeg='#define CONFIG_FFMPEG 1'
6333 codecmodules="ffmpeg $codecmodules"
6334 if $_pkg_config --atleast-version=50.18.0 libavutil ; then
6335 ffmpeg_eval_api=yes
6336 def_ffmpeg_eval_api="#define CONFIG_FFMPEG_EVAL_API 1"
6338 else
6339 def_ffmpeg='#undef CONFIG_FFMPEG'
6340 nocodecmodules="ffmpeg $nocodecmodules"
6342 echores "$ffmpeg"
6344 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
6345 if ! test -z "$_ffmpeg_source" ; then
6346 test "$ffmpeg" = yes && def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
6351 echocheck "libdv-0.9.5+"
6352 if test "$_libdv" = auto ; then
6353 _libdv=no
6354 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
6356 if test "$_libdv" = yes ; then
6357 def_libdv='#define CONFIG_LIBDV095 1'
6358 extra_ldflags="$extra_ldflags -ldv"
6359 codecmodules="libdv $codecmodules"
6360 else
6361 def_libdv='#undef CONFIG_LIBDV095'
6362 nocodecmodules="libdv $nocodecmodules"
6364 echores "$_libdv"
6367 echocheck "Xvid"
6368 if test "$_xvid" = auto ; then
6369 _xvid=no
6370 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6371 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
6372 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
6373 done
6376 if test "$_xvid" = yes ; then
6377 def_xvid='#define CONFIG_XVID4 1'
6378 codecmodules="xvid $codecmodules"
6379 else
6380 def_xvid='#undef CONFIG_XVID4'
6381 nocodecmodules="xvid $nocodecmodules"
6383 echores "$_xvid"
6386 echocheck "libnut"
6387 if test "$_libnut" = auto ; then
6388 _libnut=no
6389 statement_check libnut.h 'nut_context_tt * nut; nut_error(0)' -lnut && _libnut=yes
6392 if test "$_libnut" = yes ; then
6393 def_libnut='#define CONFIG_LIBNUT 1'
6394 extra_ldflags="$extra_ldflags -lnut"
6395 else
6396 def_libnut='#undef CONFIG_LIBNUT'
6398 echores "$_libnut"
6400 # These VO checks must be done after the FFmpeg one
6401 echocheck "/dev/mga_vid"
6402 if test "$_mga" = auto ; then
6403 _mga=no
6404 test -c /dev/mga_vid && _mga=yes
6406 if test "$_mga" = yes ; then
6407 def_mga='#define CONFIG_MGA 1'
6408 vomodules="mga $vomodules"
6409 else
6410 def_mga='#undef CONFIG_MGA'
6411 novomodules="mga $novomodules"
6413 echores "$_mga"
6416 echocheck "xmga"
6417 if test "$_xmga" = auto ; then
6418 _xmga=no
6419 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
6421 if test "$_xmga" = yes ; then
6422 def_xmga='#define CONFIG_XMGA 1'
6423 vomodules="xmga $vomodules"
6424 else
6425 def_xmga='#undef CONFIG_XMGA'
6426 novomodules="xmga $novomodules"
6428 echores "$_xmga"
6430 echocheck "zr"
6431 if test "$_zr" = auto ; then
6432 #36067's seem to identify themselves as 36057PQC's, so the line
6433 #below should work for 36067's and 36057's.
6434 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
6435 _zr=yes
6436 else
6437 _zr=no
6440 if test "$_zr" = yes ; then
6441 if test "$ffmpeg_internals" = yes ; then
6442 def_zr='#define CONFIG_ZR 1'
6443 vomodules="zr zr2 $vomodules"
6444 else
6445 res_comment="FFmpeg internal headers are required by zr, sorry"
6446 novomodules="zr $novomodules"
6447 def_zr='#undef CONFIG_ZR'
6449 else
6450 def_zr='#undef CONFIG_ZR'
6451 novomodules="zr zr2 $novomodules"
6453 echores "$_zr"
6456 echocheck "UnRAR executable"
6457 if test "$_unrar_exec" = auto ; then
6458 _unrar_exec="yes"
6459 mingw32 && _unrar_exec="no"
6461 if test "$_unrar_exec" = yes ; then
6462 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
6463 else
6464 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
6466 echores "$_unrar_exec"
6468 echocheck "TV interface"
6469 if test "$_tv" = yes ; then
6470 def_tv='#define CONFIG_TV 1'
6471 inputmodules="tv $inputmodules"
6472 else
6473 noinputmodules="tv $noinputmodules"
6474 def_tv='#undef CONFIG_TV'
6476 echores "$_tv"
6479 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
6480 echocheck "*BSD BT848 bt8xx header"
6481 _ioctl_bt848_h=no
6482 for file in "machine/ioctl_bt848.h" \
6483 "dev/bktr/ioctl_bt848.h" \
6484 "dev/video/bktr/ioctl_bt848.h" \
6485 "dev/ic/bt8xx.h" ; do
6486 cat > $TMPC <<EOF
6487 #include <sys/types.h>
6488 #include <sys/ioctl.h>
6489 #include <$file>
6490 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
6492 if cc_check ; then
6493 _ioctl_bt848_h=yes
6494 _ioctl_bt848_h_name="$file"
6495 break;
6497 done
6498 if test "$_ioctl_bt848_h" = yes ; then
6499 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6500 res_comment="using $_ioctl_bt848_h_name"
6501 else
6502 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6504 echores "$_ioctl_bt848_h"
6506 echocheck "*BSD ioctl_meteor.h"
6507 _ioctl_meteor_h=no
6508 for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
6509 statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
6510 _ioctl_meteor_h=yes && break
6511 done
6512 if test "$_ioctl_meteor_h" = yes ; then
6513 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
6514 res_comment="using $ioctl_meteor_h_path"
6515 else
6516 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6518 echores "$_ioctl_meteor_h"
6520 echocheck "*BSD BrookTree 848 TV interface"
6521 if test "$_tv_bsdbt848" = auto ; then
6522 _tv_bsdbt848=no
6523 if test "$_tv" = yes ; then
6524 cat > $TMPC <<EOF
6525 #include <sys/types.h>
6526 $def_ioctl_meteor_h_name
6527 $def_ioctl_bt848_h_name
6528 #ifdef IOCTL_METEOR_H_NAME
6529 #include IOCTL_METEOR_H_NAME
6530 #endif
6531 #ifdef IOCTL_BT848_H_NAME
6532 #include IOCTL_BT848_H_NAME
6533 #endif
6534 int main(void) {
6535 ioctl(0, METEORSINPUT, 0);
6536 ioctl(0, TVTUNER_GETFREQ, 0);
6537 return 0;
6540 cc_check && _tv_bsdbt848=yes
6543 if test "$_tv_bsdbt848" = yes ; then
6544 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
6545 inputmodules="tv-bsdbt848 $inputmodules"
6546 else
6547 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
6548 noinputmodules="tv-bsdbt848 $noinputmodules"
6550 echores "$_tv_bsdbt848"
6551 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
6554 echocheck "DirectShow TV interface"
6555 if test "$_tv_dshow" = auto ; then
6556 _tv_dshow=no
6557 if test "$_tv" = yes && win32 ; then
6558 statement_check ole2.h 'void* p; CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p)' -lole32 -luuid && _tv_dshow=yes
6561 if test "$_tv_dshow" = yes ; then
6562 inputmodules="tv-dshow $inputmodules"
6563 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
6564 extra_ldflags="$extra_ldflags -lole32 -luuid"
6565 else
6566 noinputmodules="tv-dshow $noinputmodules"
6567 def_tv_dshow='#undef CONFIG_TV_DSHOW'
6569 echores "$_tv_dshow"
6572 echocheck "Video 4 Linux TV interface"
6573 if test "$_tv_v4l1" = auto ; then
6574 _tv_v4l1=no
6575 if test "$_tv" = yes && linux ; then
6576 header_check_broken sys/time.h linux/videodev.h && _tv_v4l1=yes
6579 if test "$_tv_v4l1" = yes ; then
6580 _audio_input=yes
6581 _tv_v4l=yes
6582 def_tv_v4l='#define CONFIG_TV_V4L 1'
6583 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
6584 inputmodules="tv-v4l $inputmodules"
6585 else
6586 noinputmodules="tv-v4l1 $noinputmodules"
6587 def_tv_v4l='#undef CONFIG_TV_V4L'
6589 echores "$_tv_v4l1"
6592 echocheck "Video 4 Linux 2 TV interface"
6593 if test "$_tv_v4l2" = auto ; then
6594 _tv_v4l2=no
6595 if test "$_tv" = yes && linux ; then
6596 header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
6599 if test "$_tv_v4l2" = yes ; then
6600 _audio_input=yes
6601 _tv_v4l=yes
6602 def_tv_v4l='#define CONFIG_TV_V4L 1'
6603 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
6604 inputmodules="tv-v4l2 $inputmodules"
6605 else
6606 noinputmodules="tv-v4l2 $noinputmodules"
6607 def_tv_v4l2='#undef CONFIG_TV_V4L2'
6609 echores "$_tv_v4l2"
6612 echocheck "Radio interface"
6613 if test "$_radio" = yes ; then
6614 def_radio='#define CONFIG_RADIO 1'
6615 inputmodules="radio $inputmodules"
6616 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6617 _radio_capture=no
6619 if test "$_radio_capture" = yes ; then
6620 _audio_input=yes
6621 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
6622 else
6623 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6625 else
6626 noinputmodules="radio $noinputmodules"
6627 def_radio='#undef CONFIG_RADIO'
6628 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6629 _radio_capture=no
6631 echores "$_radio"
6632 echocheck "Capture for Radio interface"
6633 echores "$_radio_capture"
6635 echocheck "Video 4 Linux 2 Radio interface"
6636 if test "$_radio_v4l2" = auto ; then
6637 _radio_v4l2=no
6638 if test "$_radio" = yes && linux ; then
6639 header_check linux/videodev2.h && _radio_v4l2=yes
6642 if test "$_radio_v4l2" = yes ; then
6643 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
6644 else
6645 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
6647 echores "$_radio_v4l2"
6649 echocheck "Video 4 Linux Radio interface"
6650 if test "$_radio_v4l" = auto ; then
6651 _radio_v4l=no
6652 if test "$_radio" = yes && linux ; then
6653 header_check linux/videodev.h && _radio_v4l=yes
6656 if test "$_radio_v4l" = yes ; then
6657 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
6658 else
6659 def_radio_v4l='#undef CONFIG_RADIO_V4L'
6661 echores "$_radio_v4l"
6663 if freebsd || netbsd || openbsd || dragonfly || bsdos &&
6664 test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6665 echocheck "*BSD BrookTree 848 Radio interface"
6666 _radio_bsdbt848=no
6667 cat > $TMPC <<EOF
6668 #include <sys/types.h>
6669 $def_ioctl_bt848_h_name
6670 #ifdef IOCTL_BT848_H_NAME
6671 #include IOCTL_BT848_H_NAME
6672 #endif
6673 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
6675 cc_check && _radio_bsdbt848=yes
6676 echores "$_radio_bsdbt848"
6677 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
6679 if test "$_radio_bsdbt848" = yes ; then
6680 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
6681 else
6682 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
6685 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no &&
6686 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6687 die "Radio driver requires BSD BT848, V4L or V4L2!"
6690 echocheck "Video 4 Linux 2 MPEG PVR interface"
6691 if test "$_pvr" = auto ; then
6692 _pvr=no
6693 if test "$_tv_v4l2" = yes && linux ; then
6694 cat > $TMPC <<EOF
6695 #include <sys/time.h>
6696 #include <linux/videodev2.h>
6697 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
6699 cc_check && _pvr=yes
6702 if test "$_pvr" = yes ; then
6703 def_pvr='#define CONFIG_PVR 1'
6704 inputmodules="pvr $inputmodules"
6705 else
6706 noinputmodules="pvr $noinputmodules"
6707 def_pvr='#undef CONFIG_PVR'
6709 echores "$_pvr"
6712 echocheck "ftp"
6713 if test "$_ftp" = "auto" ; then
6714 test "$networking" = "yes" && ! beos && _ftp=yes
6716 if test "$_ftp" = yes ; then
6717 def_ftp='#define CONFIG_FTP 1'
6718 inputmodules="ftp $inputmodules"
6719 else
6720 noinputmodules="ftp $noinputmodules"
6721 def_ftp='#undef CONFIG_FTP'
6723 echores "$_ftp"
6725 echocheck "vstream client"
6726 if test "$_vstream" = auto ; then
6727 _vstream=no
6728 cat > $TMPC <<EOF
6729 #include <vstream-client.h>
6730 void vstream_error(const char *format, ... ) {}
6731 int main(void) { vstream_start(); return 0; }
6733 cc_check -lvstream-client && _vstream=yes
6735 if test "$_vstream" = yes ; then
6736 def_vstream='#define CONFIG_VSTREAM 1'
6737 inputmodules="vstream $inputmodules"
6738 extra_ldflags="$extra_ldflags -lvstream-client"
6739 else
6740 noinputmodules="vstream $noinputmodules"
6741 def_vstream='#undef CONFIG_VSTREAM'
6743 echores "$_vstream"
6746 echocheck "OSD menu"
6747 if test "$_menu" = yes ; then
6748 def_menu='#define CONFIG_MENU 1'
6749 test $_dvbin = "yes" && _menu_dvbin=yes
6750 else
6751 def_menu='#undef CONFIG_MENU'
6752 _menu_dvbin=no
6754 echores "$_menu"
6757 echocheck "Subtitles sorting"
6758 if test "$_sortsub" = yes ; then
6759 def_sortsub='#define CONFIG_SORTSUB 1'
6760 else
6761 def_sortsub='#undef CONFIG_SORTSUB'
6763 echores "$_sortsub"
6766 echocheck "XMMS inputplugin support"
6767 if test "$_xmms" = yes ; then
6768 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6769 _xmmsplugindir=$(xmms-config --input-plugin-dir)
6770 _xmmslibdir=$(xmms-config --exec-prefix)/lib
6771 else
6772 _xmmsplugindir=/usr/lib/xmms/Input
6773 _xmmslibdir=/usr/lib
6776 def_xmms='#define CONFIG_XMMS 1'
6777 if darwin ; then
6778 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6779 else
6780 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6782 else
6783 def_xmms='#undef CONFIG_XMMS'
6785 echores "$_xmms"
6787 if test "$_charset" != "noconv" ; then
6788 def_charset="#define MSG_CHARSET \"$_charset\""
6789 else
6790 def_charset="#undef MSG_CHARSET"
6791 _charset="UTF-8"
6794 #############################################################################
6796 echocheck "automatic gdb attach"
6797 if test "$_crash_debug" = yes ; then
6798 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
6799 else
6800 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
6801 _crash_debug=no
6803 echores "$_crash_debug"
6805 echocheck "compiler support for noexecstack"
6806 if cflag_check -Wl,-z,noexecstack ; then
6807 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
6808 echores "yes"
6809 else
6810 echores "no"
6813 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
6814 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6815 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6816 echores "yes"
6817 else
6818 echores "no"
6822 # Dynamic linking flags
6823 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6824 _ld_dl_dynamic=''
6825 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
6826 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
6827 _ld_dl_dynamic='-rdynamic'
6830 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6831 bsdos && extra_ldflags="$extra_ldflags -ldvd"
6832 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
6834 def_debug='#undef MP_DEBUG'
6835 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
6838 echocheck "joystick"
6839 def_joystick='#undef CONFIG_JOYSTICK'
6840 if test "$_joystick" = yes ; then
6841 if linux || freebsd ; then
6842 # TODO add some check
6843 def_joystick='#define CONFIG_JOYSTICK 1'
6844 else
6845 _joystick="no"
6846 res_comment="unsupported under $system_name"
6849 echores "$_joystick"
6851 echocheck "lirc"
6852 if test "$_lirc" = auto ; then
6853 _lirc=no
6854 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
6856 if test "$_lirc" = yes ; then
6857 def_lirc='#define CONFIG_LIRC 1'
6858 libs_mplayer="$libs_mplayer -llirc_client"
6859 else
6860 def_lirc='#undef CONFIG_LIRC'
6862 echores "$_lirc"
6864 echocheck "lircc"
6865 if test "$_lircc" = auto ; then
6866 _lircc=no
6867 header_check lirc/lircc.h -llircc && _lircc=yes
6869 if test "$_lircc" = yes ; then
6870 def_lircc='#define CONFIG_LIRCC 1'
6871 libs_mplayer="$libs_mplayer -llircc"
6872 else
6873 def_lircc='#undef CONFIG_LIRCC'
6875 echores "$_lircc"
6877 if arm; then
6878 # Detect maemo development platform libraries availability (http://www.maemo.org),
6879 # they are used when run on Nokia 770|8x0
6880 echocheck "maemo (Nokia 770|8x0)"
6881 if test "$_maemo" = auto ; then
6882 _maemo=no
6883 statement_check libosso.h 'osso_initialize('', '', 0, NULL)' $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
6885 if test "$_maemo" = yes ; then
6886 def_maemo='#define CONFIG_MAEMO 1'
6887 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
6888 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
6889 else
6890 def_maemo='#undef CONFIG_MAEMO'
6892 echores "$_maemo"
6895 #############################################################################
6897 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
6898 # the OMF format needs to come after the 'extern symbol prefix' check, which
6899 # uses nm.
6900 if os2 ; then
6901 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
6904 #############################################################################
6905 # 64 bit file offsets?
6906 if test "$_largefiles" = yes || freebsd ; then
6907 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
6908 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
6909 # dvdread support requires this (for off64_t)
6910 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
6914 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
6916 # This must be the last test to be performed. Any other tests following it
6917 # could fail due to linker errors. libdvdnavmini is intentionally not linked
6918 # against libdvdread (to permit MPlayer to use its own copy of the library).
6919 # So any compilation using the flags added here but not linking against
6920 # libdvdread can fail.
6921 echocheck "DVD support (libdvdnav)"
6922 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
6923 _dvdnav=no
6925 dvdnav_internal=no
6926 if test "$_dvdnav" = auto ; then
6927 if test "$_dvdread_internal" = yes ; then
6928 _dvdnav=yes
6929 dvdnav_internal=yes
6930 res_comment="internal"
6931 else
6932 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
6935 if test "$_dvdnav" = auto ; then
6936 _dvdnav=no
6937 _dvdnavdir=$($_dvdnavconfig --cflags)
6938 _dvdnavlibs=$($_dvdnavconfig --libs)
6939 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
6941 if test "$_dvdnav" = yes ; then
6942 _largefiles=yes
6943 def_dvdnav='#define CONFIG_DVDNAV 1'
6944 if test "$dvdnav_internal" = yes ; then
6945 cflags_libdvdnav="-Ilibdvdnav"
6946 inputmodules="dvdnav(internal) $inputmodules"
6947 else
6948 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
6949 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
6950 inputmodules="dvdnav $inputmodules"
6952 else
6953 def_dvdnav='#undef CONFIG_DVDNAV'
6954 noinputmodules="dvdnav $noinputmodules"
6956 echores "$_dvdnav"
6958 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
6959 # Read dvdnav comment above.
6961 mak_enable () {
6962 list=$(echo $1 | tr '[a-z]' '[A-Z]')
6963 item=$(echo $2 | tr '[a-z]' '[A-Z]')
6964 nprefix=$3;
6965 for part in $list; do
6966 if $(echo $item | grep -q -E "(^| )$part($| )"); then
6967 echo "${nprefix}_$part = yes"
6969 done
6972 #############################################################################
6973 echo "Creating config.mak"
6974 cat > config.mak << EOF
6975 # -------- Generated by configure -----------
6977 # Ensure that locale settings do not interfere with shell commands.
6978 export LC_ALL = C
6980 CONFIGURATION = $configuration
6982 CHARSET = $_charset
6983 DOC_LANGS = $language_doc
6984 DOC_LANG_ALL = $doc_lang_all
6985 MAN_LANGS = $language_man
6986 MAN_LANG_ALL = $man_lang_all
6987 MSG_LANGS = $language_msg
6988 MSG_LANG_ALL = $msg_lang_all
6990 prefix = \$(DESTDIR)$_prefix
6991 BINDIR = \$(DESTDIR)$_bindir
6992 DATADIR = \$(DESTDIR)$_datadir
6993 LIBDIR = \$(DESTDIR)$_libdir
6994 MANDIR = \$(DESTDIR)$_mandir
6995 CONFDIR = \$(DESTDIR)$_confdir
6996 LOCALEDIR = \$(DESTDIR)$_localedir
6998 AR = $_ar
6999 AS = $_cc
7000 CC = $_cc
7001 CXX = $_cc
7002 HOST_CC = $_host_cc
7003 INSTALL = $_install
7004 INSTALLSTRIP = $_install_strip
7005 WINDRES = $_windres
7007 CFLAGS = $WARNFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
7008 CXXFLAGS = $WARNFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
7009 DEPFLAGS = $DEPFLAGS
7011 CFLAGS_DHAHELPER = $cflags_dhahelper
7012 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
7013 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
7014 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
7015 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
7016 CFLAGS_STACKREALIGN = $cflags_stackrealign
7017 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
7018 CFLAGS_TREMOR_LOW = $cflags_tremor_low
7020 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
7021 EXTRALIBS_MPLAYER = $libs_mplayer
7023 GETCH = $_getch
7024 TIMER = $_timer
7026 EXESUF = $_exesuf
7027 EXESUFS_ALL = .exe
7029 ARCH = $arch
7030 $(mak_enable "$arch_all" "$arch" ARCH)
7031 $(mak_enable "$subarch_all" "$subarch" ARCH)
7032 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
7034 MPLAYER = $_mplayer
7036 NEED_GETTIMEOFDAY = $_need_gettimeofday
7037 NEED_GLOB = $_need_glob
7038 NEED_MMAP = $_need_mmap
7039 NEED_SETENV = $_need_setenv
7040 NEED_SHMEM = $_need_shmem
7041 NEED_STRSEP = $_need_strsep
7042 NEED_SWAB = $_need_swab
7043 NEED_VSSCANF = $_need_vsscanf
7045 # features
7046 3DFX = $_3dfx
7047 AA = $_aa
7048 ALSA1X = $_alsa1x
7049 ALSA9 = $_alsa9
7050 ALSA5 = $_alsa5
7051 APPLE_IR = $_apple_ir
7052 APPLE_REMOTE = $_apple_remote
7053 ARTS = $_arts
7054 AUDIO_INPUT = $_audio_input
7055 BITMAP_FONT = $_bitmap_font
7056 BL = $_bl
7057 CACA = $_caca
7058 CDDA = $_cdda
7059 CDDB = $_cddb
7060 COREAUDIO = $_coreaudio
7061 COREVIDEO = $_corevideo
7062 DART = $_dart
7063 DGA = $_dga
7064 DIRECT3D = $_direct3d
7065 DIRECTFB = $_directfb
7066 DIRECTX = $_directx
7067 DVBIN = $_dvbin
7068 DVDNAV = $_dvdnav
7069 DVDNAV_INTERNAL = $dvdnav_internal
7070 DVDREAD = $_dvdread
7071 DVDREAD_INTERNAL = $_dvdread_internal
7072 DXR2 = $_dxr2
7073 DXR3 = $_dxr3
7074 ESD = $_esd
7075 FAAD = $_faad
7076 FASTMEMCPY = $_fastmemcpy
7077 FBDEV = $_fbdev
7078 FREETYPE = $_freetype
7079 FTP = $_ftp
7080 GIF = $_gif
7081 GGI = $_ggi
7082 GL = $_gl
7083 GL_WIN32 = $_gl_win32
7084 GL_X11 = $_gl_x11
7085 GL_SDL = $_gl_sdl
7086 MATRIXVIEW = $matrixview
7087 HAVE_POSIX_SELECT = $_posix_select
7088 HAVE_SYS_MMAN_H = $_mman
7089 IVTV = $_ivtv
7090 JACK = $_jack
7091 JOYSTICK = $_joystick
7092 JPEG = $_jpeg
7093 KAI = $_kai
7094 KVA = $_kva
7095 LADSPA = $_ladspa
7096 LIBA52 = $_liba52
7097 LIBASS = $_ass
7098 LIBBLURAY = $_bluray
7099 LIBBS2B = $_libbs2b
7100 LIBDCA = $_libdca
7101 LIBDV = $_libdv
7102 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7103 LIBLZO = $_liblzo
7104 LIBMAD = $_mad
7105 LIBMENU = $_menu
7106 LIBMENU_DVBIN = $_menu_dvbin
7107 LIBMPEG2 = $_libmpeg2
7108 LIBNEMESI = $_nemesi
7109 LIBNUT = $_libnut
7110 LIBSMBCLIENT = $_smb
7111 LIBTHEORA = $_theora
7112 LIRC = $_lirc
7113 LIVE555 = $_live
7114 MACOSX_FINDER = $_macosx_finder
7115 MD5SUM = $_md5sum
7116 MGA = $_mga
7117 MNG = $_mng
7118 MP3LIB = $_mp3lib
7119 MPG123 = $_mpg123
7120 MUSEPACK = $_musepack
7121 NAS = $_nas
7122 NATIVE_RTSP = $_native_rtsp
7123 NETWORKING = $networking
7124 OPENAL = $_openal
7125 OSS = $_ossaudio
7126 PE_EXECUTABLE = $_pe_executable
7127 PNG = $_png
7128 PNM = $_pnm
7129 PRIORITY = $_priority
7130 PULSE = $_pulse
7131 PVR = $_pvr
7132 QTX_CODECS = $_qtx
7133 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7134 QTX_EMULATION = $_qtx_emulation
7135 QUARTZ = $_quartz
7136 RADIO=$_radio
7137 RADIO_CAPTURE=$_radio_capture
7138 REAL_CODECS = $_real
7139 S3FB = $_s3fb
7140 SDL = $_sdl
7141 SPEEX = $_speex
7142 STREAM_CACHE = $_stream_cache
7143 SGIAUDIO = $_sgiaudio
7144 SUNAUDIO = $_sunaudio
7145 SVGA = $_svga
7146 TDFXFB = $_tdfxfb
7147 TDFXVID = $_tdfxvid
7148 TGA = $_tga
7149 TREMOR_INTERNAL = $_tremor_internal
7150 TV = $_tv
7151 TV_BSDBT848 = $_tv_bsdbt848
7152 TV_DSHOW = $_tv_dshow
7153 TV_V4L = $_tv_v4l
7154 TV_V4L1 = $_tv_v4l1
7155 TV_V4L2 = $_tv_v4l2
7156 UNRAR_EXEC = $_unrar_exec
7157 V4L2 = $_v4l2
7158 VCD = $_vcd
7159 VDPAU = $_vdpau
7160 VESA = $_vesa
7161 VIDIX = $_vidix
7162 VIDIX_PCIDB = $_vidix_pcidb_val
7163 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7164 VIDIX_IVTV=$_vidix_drv_ivtv
7165 VIDIX_MACH64=$_vidix_drv_mach64
7166 VIDIX_MGA=$_vidix_drv_mga
7167 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7168 VIDIX_NVIDIA=$_vidix_drv_nvidia
7169 VIDIX_PM2=$_vidix_drv_pm2
7170 VIDIX_PM3=$_vidix_drv_pm3
7171 VIDIX_RADEON=$_vidix_drv_radeon
7172 VIDIX_RAGE128=$_vidix_drv_rage128
7173 VIDIX_S3=$_vidix_drv_s3
7174 VIDIX_SH_VEU=$_vidix_drv_sh_veu
7175 VIDIX_SIS=$_vidix_drv_sis
7176 VIDIX_UNICHROME=$_vidix_drv_unichrome
7177 VORBIS = $_vorbis
7178 VSTREAM = $_vstream
7179 WII = $_wii
7180 WIN32DLL = $_win32dll
7181 WIN32WAVEOUT = $_win32waveout
7182 WIN32_EMULATION = $_win32_emulation
7183 WINVIDIX = $winvidix
7184 X11 = $_x11
7185 XANIM_CODECS = $_xanim
7186 XMGA = $_xmga
7187 XMMS_PLUGINS = $_xmms
7188 XV = $_xv
7189 XVID4 = $_xvid
7190 XVIDIX = $xvidix
7191 XVMC = $_xvmc
7192 XVR100 = $_xvr100
7193 YUV4MPEG = $_yuv4mpeg
7194 ZR = $_zr
7196 # FFmpeg
7197 FFMPEG = $ffmpeg
7198 FFMPEG_EVAL_API = $ffmpeg_eval_api
7199 FFMPEG_INTERNALS = $ffmpeg_internals
7200 FFMPEG_SOURCE_PATH = $_ffmpeg_source
7202 RANLIB = $_ranlib
7203 YASM = $_yasm
7204 YASMFLAGS = $YASMFLAGS
7206 CONFIG_BZLIB = $bzlib
7207 CONFIG_VDPAU = $_vdpau
7208 CONFIG_XVMC = $_xvmc
7209 CONFIG_ZLIB = $_zlib
7211 HAVE_PTHREADS = $_pthreads
7212 HAVE_SHM = $_shm
7213 HAVE_W32THREADS = $_w32threads
7214 HAVE_YASM = $have_yasm
7218 #############################################################################
7220 ff_config_enable () {
7221 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7222 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7223 _nprefix=$3;
7224 test -z "$_nprefix" && _nprefix='CONFIG'
7225 for part in $list; do
7226 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7227 echo "#define ${_nprefix}_$part 1"
7228 else
7229 echo "#define ${_nprefix}_$part 0"
7231 done
7234 echo "Creating config.h"
7235 cat > $TMPH << EOF
7236 /*----------------------------------------------------------------------------
7237 ** This file has been automatically generated by configure any changes in it
7238 ** will be lost when you run configure again.
7239 ** Instead of modifying definitions here, use the --enable/--disable options
7240 ** of the configure script! See ./configure --help for details.
7241 *---------------------------------------------------------------------------*/
7243 #ifndef MPLAYER_CONFIG_H
7244 #define MPLAYER_CONFIG_H
7246 /* Undefine this if you do not want to select mono audio (left or right)
7247 with a stereo MPEG layer 2/3 audio stream. The command line option
7248 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7249 right-only), with 0 being the default.
7251 #define CONFIG_FAKE_MONO 1
7253 /* set up audio OUTBURST. Do not change this! */
7254 #define OUTBURST 512
7256 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7257 #undef FAST_OSD
7258 #undef FAST_OSD_TABLE
7260 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
7261 #define MPEG12_POSTPROC 1
7262 #define ATTRIBUTE_ALIGNED_MAX 16
7266 #define CONFIGURATION "$configuration"
7268 #define MPLAYER_DATADIR "$_datadir"
7269 #define MPLAYER_CONFDIR "$_confdir"
7270 #define MPLAYER_LIBDIR "$_libdir"
7271 #define MPLAYER_LOCALEDIR "$_localedir"
7273 $def_translation
7275 /* definitions needed by included libraries */
7276 #define HAVE_INTTYPES_H 1
7277 /* libmpeg2 + FFmpeg */
7278 $def_fast_inttypes
7279 /* libdvdcss */
7280 #define HAVE_ERRNO_H 1
7281 /* libdvdcss + libdvdread */
7282 #define HAVE_LIMITS_H 1
7283 /* libdvdcss */
7284 #define HAVE_UNISTD_H 1
7285 /* libdvdread */
7286 #define STDC_HEADERS 1
7287 #define HAVE_MEMCPY 1
7288 /* libdvdnav */
7289 #define READ_CACHE_TRACE 0
7290 /* libdvdread */
7291 #define HAVE_DLFCN_H 1
7292 $def_dvdcss
7295 /* system headers */
7296 $def_alloca_h
7297 $def_alsa_asoundlib_h
7298 $def_altivec_h
7299 $def_malloc_h
7300 $def_mman_h
7301 $def_mman_has_map_failed
7302 $def_soundcard_h
7303 $def_sys_asoundlib_h
7304 $def_sys_soundcard_h
7305 $def_sys_sysinfo_h
7306 $def_termios_h
7307 $def_termios_sys_h
7308 $def_winsock2_h
7311 /* system functions */
7312 $def_gethostbyname2
7313 $def_gettimeofday
7314 $def_glob
7315 $def_langinfo
7316 $def_lrintf
7317 $def_map_memalign
7318 $def_memalign
7319 $def_nanosleep
7320 $def_posix_select
7321 $def_select
7322 $def_setenv
7323 $def_setmode
7324 $def_shm
7325 $def_strsep
7326 $def_swab
7327 $def_sysi86
7328 $def_sysi86_iv
7329 $def_termcap
7330 $def_termios
7331 $def_vsscanf
7334 /* system-specific features */
7335 $def_asmalign_pot
7336 $def_builtin_expect
7337 $def_dl
7338 $def_dos_paths
7339 $def_extern_asm
7340 $def_extern_prefix
7341 $def_iconv
7342 $def_kstat
7343 $def_macosx_bundle
7344 $def_macosx_finder
7345 $def_maemo
7346 $def_named_asm_args
7347 $def_priority
7348 $def_quicktime
7349 $def_restrict_keyword
7350 $def_rtc
7351 $def_unrar_exec
7354 /* configurable options */
7355 $def_charset
7356 $def_crash_debug
7357 $def_debug
7358 $def_dynamic_plugins
7359 $def_fastmemcpy
7360 $def_menu
7361 $def_runtime_cpudetection
7362 $def_sighandler
7363 $def_sortsub
7364 $def_stream_cache
7365 $def_pthread_cache
7368 /* CPU stuff */
7369 #define __CPU__ $iproc
7370 $def_ebx_available
7371 $def_words_endian
7372 $def_bigendian
7373 $(ff_config_enable "$arch_all" "$arch" "ARCH")
7374 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
7375 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
7378 /* Blu-ray/DVD/VCD/CD */
7379 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
7380 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
7381 $def_bluray
7382 $def_bsdi_dvd
7383 $def_cddb
7384 $def_cdio
7385 $def_cdparanoia
7386 $def_cdrom
7387 $def_dvd
7388 $def_dvd_bsd
7389 $def_dvd_darwin
7390 $def_dvd_linux
7391 $def_dvd_openbsd
7392 $def_dvdio
7393 $def_dvdnav
7394 $def_dvdread
7395 $def_hpux_scsi_h
7396 $def_libcdio
7397 $def_sol_scsi_h
7398 $def_vcd
7401 /* codec libraries */
7402 $def_faad
7403 $def_liba52
7404 $def_libdca
7405 $def_libdv
7406 $def_liblzo
7407 $def_libmpeg2
7408 $def_mad
7409 $def_mp3lib
7410 $def_mpg123
7411 $def_musepack
7412 $def_speex
7413 $def_theora
7414 $def_tremor
7415 $def_vorbis
7416 $def_xvid
7417 $def_zlib
7419 $def_libnut
7422 /* binary codecs */
7423 $def_qtx
7424 $def_qtx_win32
7425 $def_real
7426 $def_win32_loader
7427 $def_win32dll
7428 $def_xanim
7429 $def_xmms
7430 #define BINARY_CODECS_PATH "$_codecsdir"
7431 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7434 /* Audio output drivers */
7435 $def_alsa
7436 $def_alsa1x
7437 $def_alsa5
7438 $def_alsa9
7439 $def_arts
7440 $def_coreaudio
7441 $def_dart
7442 $def_esd
7443 $def_esd_latency
7444 $def_jack
7445 $def_kai
7446 $def_nas
7447 $def_openal
7448 $def_openal_h
7449 $def_ossaudio
7450 $def_ossaudio_devdsp
7451 $def_ossaudio_devmixer
7452 $def_pulse
7453 $def_sgiaudio
7454 $def_sunaudio
7455 $def_win32waveout
7457 $def_ladspa
7458 $def_libbs2b
7461 /* input */
7462 $def_apple_ir
7463 $def_apple_remote
7464 $def_ioctl_bt848_h_name
7465 $def_ioctl_meteor_h_name
7466 $def_joystick
7467 $def_lirc
7468 $def_lircc
7469 $def_pvr
7470 $def_radio
7471 $def_radio_bsdbt848
7472 $def_radio_capture
7473 $def_radio_v4l
7474 $def_radio_v4l2
7475 $def_tv
7476 $def_tv_bsdbt848
7477 $def_tv_dshow
7478 $def_tv_v4l
7479 $def_tv_v4l1
7480 $def_tv_v4l2
7483 /* font stuff */
7484 $def_ass
7485 $def_bitmap_font
7486 $def_enca
7487 $def_fontconfig
7488 $def_freetype
7489 $def_fribidi
7492 /* networking */
7493 $def_closesocket
7494 $def_ftp
7495 $def_inet6
7496 $def_inet_aton
7497 $def_inet_pton
7498 $def_live
7499 $def_nemesi
7500 $def_networking
7501 $def_smb
7502 $def_socklen_t
7503 $def_vstream
7506 /* libvo options */
7507 $def_3dfx
7508 $def_aa
7509 $def_bl
7510 $def_caca
7511 $def_corevideo
7512 $def_dga
7513 $def_dga1
7514 $def_dga2
7515 $def_direct3d
7516 $def_directfb
7517 $def_directx
7518 $def_dvb
7519 $def_dvbin
7520 $def_dxr2
7521 $def_dxr3
7522 $def_fbdev
7523 $def_ggi
7524 $def_ggiwmh
7525 $def_gif
7526 $def_gif_4
7527 $def_gif_tvt_hack
7528 $def_gl
7529 $def_gl_win32
7530 $def_gl_x11
7531 $def_gl_sdl
7532 $def_matrixview
7533 $def_ivtv
7534 $def_jpeg
7535 $def_kva
7536 $def_md5sum
7537 $def_mga
7538 $def_mng
7539 $def_png
7540 $def_pnm
7541 $def_quartz
7542 $def_s3fb
7543 $def_sdl
7544 $def_sdl_sdl_h
7545 $def_svga
7546 $def_tdfxfb
7547 $def_tdfxvid
7548 $def_tga
7549 $def_v4l2
7550 $def_vdpau
7551 $def_vesa
7552 $def_vidix
7553 $def_vidix_drv_cyberblade
7554 $def_vidix_drv_ivtv
7555 $def_vidix_drv_mach64
7556 $def_vidix_drv_mga
7557 $def_vidix_drv_mga_crtc2
7558 $def_vidix_drv_nvidia
7559 $def_vidix_drv_pm3
7560 $def_vidix_drv_radeon
7561 $def_vidix_drv_rage128
7562 $def_vidix_drv_s3
7563 $def_vidix_drv_sh_veu
7564 $def_vidix_drv_sis
7565 $def_vidix_drv_unichrome
7566 $def_vidix_pfx
7567 $def_vm
7568 $def_wii
7569 $def_x11
7570 $def_xdpms
7571 $def_xf86keysym
7572 $def_xinerama
7573 $def_xmga
7574 $def_xss
7575 $def_xv
7576 $def_xvmc
7577 $def_xvr100
7578 $def_yuv4mpeg
7579 $def_zr
7582 /* FFmpeg */
7583 $def_ffmpeg
7584 $def_ffmpeg_eval_api
7585 $def_ffmpeg_internals
7587 $def_arpa_inet_h
7588 $def_bswap
7589 $def_bzlib
7590 $def_dcbzl
7591 $def_exp2
7592 $def_exp2f
7593 $def_fast_64bit
7594 $def_fast_unaligned
7595 $def_llrint
7596 $def_log2
7597 $def_log2f
7598 $def_lrint
7599 $def_memalign_hack
7600 $def_mkstemp
7601 $def_posix_memalign
7602 $def_pthreads
7603 $def_round
7604 $def_roundf
7605 $def_ten_operands
7606 $def_threads
7607 $def_truncf
7608 $def_xform_asm
7609 $def_yasm
7611 #define HAVE_INLINE_ASM 1
7613 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
7614 #ifndef MP_DEBUG
7615 #define HAVE_EBP_AVAILABLE 1
7616 #else
7617 #define HAVE_EBP_AVAILABLE 0
7618 #endif
7620 #endif /* MPLAYER_CONFIG_H */
7623 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
7624 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
7626 #############################################################################
7628 ./version.sh `$_cc -dumpversion`
7630 cat << EOF
7632 Config files successfully generated by ./configure $configuration !
7634 Install prefix: $_prefix
7635 Data directory: $_datadir
7636 Config direct.: $_confdir
7638 Byte order: $_byte_order
7639 Optimizing for: $_optimizing
7641 Languages:
7642 Messages (in addition to English): $language_msg
7643 Manual pages: $language_man
7644 Documentation: $language_doc
7646 Enabled optional drivers:
7647 Input: $inputmodules
7648 Codecs: $codecmodules
7649 Audio output: $aomodules
7650 Video output: $vomodules
7652 Disabled optional drivers:
7653 Input: $noinputmodules
7654 Codecs: $nocodecmodules
7655 Audio output: $noaomodules
7656 Video output: $novomodules
7658 'config.h' and 'config.mak' contain your configuration options.
7659 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7660 compile *** DO NOT REPORT BUGS if you tweak these files ***
7662 'make' will now compile MPlayer and 'make install' will install it.
7663 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7668 if test "$_mtrr" = yes ; then
7669 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$language_doc/video.html#mtrr)"
7670 echo
7673 if ! x86_32; then
7674 cat <<EOF
7675 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7676 operating system ($system_name). You may encounter a few files that cannot
7677 be played due to missing open source video/audio codec support.
7683 cat <<EOF
7684 Check $TMPLOG if you wonder why an autodetection failed (make sure
7685 development headers/packages are installed).
7687 NOTE: The --enable-* parameters unconditionally force options on, completely
7688 skipping autodetection. This behavior is unlike what you may be used to from
7689 autoconf-based configure scripts that can decide to override you. This greater
7690 level of control comes at a price. You may have to provide the correct compiler
7691 and linker flags yourself.
7692 If you used one of these options (except --enable-menu and similar ones that
7693 turn on internal features) and experience a compilation or linking failure,
7694 make sure you have passed the necessary compiler/linker flags to configure.
7696 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
7700 if test "$warn_cflags" = yes; then
7701 cat <<EOF
7703 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
7704 but:
7706 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
7708 It is strongly recommended to let MPlayer choose the correct CFLAGS!
7709 To do so, execute 'CFLAGS= ./configure <options>'
7714 # Last move:
7715 rm -rf "$mplayer_tmpdir"