Merge remote-tracking branch 'mplayer/master'
[mplayer/glamo.git] / configure
blob4047179be8b25ead6ecd1a4e2b8e05ccb989259a
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 statement_check() {
77 cat > $TMPC << EOF
78 #include <$1>
79 int main(void) { $2; return 0; }
80 EOF
81 shift
82 shift
83 compile_check $TMPC $@
86 header_check() {
87 cat > $TMPC << EOF
88 #include <$1>
89 int main(void) { return 0; }
90 EOF
91 shift
92 compile_check $TMPC $@
95 inline_asm_check() {
96 cat > $TMPC << EOF
97 int main(void) { __asm__ volatile ($1); return 0; }
98 EOF
99 shift
100 compile_check $TMPC $@
103 # The following checks are special and should only be used with broken and
104 # non-selfsufficient headers that do not include all of their dependencies.
106 header_check_broken() {
107 cat > $TMPC << EOF
108 #include <$1>
109 #include <$2>
110 int main(void) { return 0; }
112 shift
113 shift
114 compile_check $TMPC $@
117 statement_check_broken() {
118 cat > $TMPC << EOF
119 #include <$1>
120 #include <$2>
121 int main(void) { $3; return 0; }
123 shift 3
124 compile_check $TMPC $@
127 yasm_check() {
128 echo >> "$TMPLOG"
129 cat "$TMPS" >> "$TMPLOG"
130 echo >> "$TMPLOG"
131 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
132 rm -f "$TMPEXE"
133 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
134 TMPRES="$?"
135 echo >> "$TMPLOG"
136 echo >> "$TMPLOG"
137 return "$TMPRES"
140 tmp_run() {
141 "$TMPEXE" >> "$TMPLOG" 2>&1
144 # Display error message, flushes tempfile, exit
145 die () {
146 echo
147 echo "Error: $@" >&2
148 echo >&2
149 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
150 echo "Check \"$TMPLOG\" if you do not understand why it failed."
151 exit 1
154 # OS test booleans functions
155 issystem() {
156 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
158 aix() { issystem "AIX"; }
159 amigaos() { issystem "AmigaOS"; }
160 beos() { issystem "BEOS"; }
161 bsdos() { issystem "BSD/OS"; }
162 cygwin() { issystem "CYGWIN"; }
163 darwin() { issystem "Darwin"; }
164 dragonfly() { issystem "DragonFly"; }
165 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
166 gnu() { issystem "GNU"; }
167 hpux() { issystem "HP-UX"; }
168 irix() { issystem "IRIX"; }
169 linux() { issystem "Linux"; }
170 mingw32() { issystem "MINGW32"; }
171 morphos() { issystem "MorphOS"; }
172 netbsd() { issystem "NetBSD"; }
173 openbsd() { issystem "OpenBSD"; }
174 os2() { issystem "OS/2"; }
175 qnx() { issystem "QNX"; }
176 sunos() { issystem "SunOS"; }
177 win32() { cygwin || mingw32; }
179 # arch test boolean functions
180 # x86/x86pc is used by QNX
181 x86_32() {
182 case "$host_arch" in
183 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
184 *) return 1 ;;
185 esac
188 x86_64() {
189 case "$host_arch" in
190 x86_64|amd64) return 0 ;;
191 *) return 1 ;;
192 esac
195 x86() {
196 x86_32 || x86_64
199 ppc() {
200 case "$host_arch" in
201 ppc|ppc64|powerpc|powerpc64) return 0;;
202 *) return 1;;
203 esac
206 alpha() {
207 case "$host_arch" in
208 alpha*) return 0;;
209 *) return 1;;
210 esac
213 arm() {
214 case "$host_arch" in
215 arm*) return 0;;
216 *) return 1;;
217 esac
220 # Use this before starting a check
221 echocheck() {
222 echo "============ Checking for $@ ============" >> "$TMPLOG"
223 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
226 # Use this to echo the results of a check
227 echores() {
228 if test "$res_comment" ; then
229 res_comment="($res_comment)"
231 echo "Result is: $@ $res_comment" >> "$TMPLOG"
232 echo "##########################################" >> "$TMPLOG"
233 echo "" >> "$TMPLOG"
234 echo "$@ $res_comment"
235 res_comment=""
237 #############################################################################
239 # Check how echo works in this /bin/sh
240 case $(echo -n) in
241 -n) _echo_n= _echo_c='\c' ;; # SysV echo
242 *) _echo_n='-n ' _echo_c= ;; # BSD echo
243 esac
245 msg_lang_all=''
246 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
247 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")
248 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
250 show_help(){
251 cat << EOF
252 Usage: $0 [OPTIONS]...
254 Configuration:
255 -h, --help display this help and exit
257 Installation directories:
258 --prefix=DIR prefix directory for installation [/usr/local]
259 --bindir=DIR directory for installing binaries [PREFIX/bin]
260 --datadir=DIR directory for installing machine independent
261 data files (skins, etc) [PREFIX/share/mplayer]
262 --mandir=DIR directory for installing man pages [PREFIX/share/man]
263 --confdir=DIR directory for installing configuration files
264 [PREFIX/etc/mplayer]
265 --localedir=DIR directory for locale tree [PREFIX/share/locale]
266 --libdir=DIR directory for object code libraries [PREFIX/lib]
267 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
269 Optional features:
270 --disable-mplayer disable MPlayer compilation [enable]
271 --disable-largefiles disable support for files > 2GB [enable]
272 --enable-termcap use termcap database for key codes [autodetect]
273 --enable-termios use termios database for key codes [autodetect]
274 --disable-iconv disable iconv for encoding conversion [autodetect]
275 --disable-langinfo do not use langinfo [autodetect]
276 --enable-lirc enable LIRC (remote control) support [autodetect]
277 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
278 --enable-joystick enable joystick support [disable]
279 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
280 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
281 --disable-vm disable X video mode extensions [autodetect]
282 --disable-xf86keysym disable support for multimedia keys [autodetect]
283 --enable-radio enable radio interface [disable]
284 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
285 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
286 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
287 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
288 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
289 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
290 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
291 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
292 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
293 --disable-networking disable networking [enable]
294 --enable-winsock2_h enable winsock2_h [autodetect]
295 --enable-smb enable Samba (SMB) input [autodetect]
296 --enable-live enable LIVE555 Streaming Media [autodetect]
297 --enable-nemesi enable Nemesi Streaming Media [autodetect]
298 --disable-vcd disable VCD support [autodetect]
299 --disable-bluray disable Blu-ray support [autodetect]
300 --disable-dvdnav disable libdvdnav [autodetect]
301 --disable-dvdread disable libdvdread [autodetect]
302 --disable-dvdread-internal disable internal libdvdread [autodetect]
303 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
304 --disable-cdparanoia disable cdparanoia [autodetect]
305 --disable-cddb disable cddb [autodetect]
306 --disable-bitmap-font disable bitmap font support [enable]
307 --disable-freetype disable FreeType 2 font rendering [autodetect]
308 --disable-fontconfig disable fontconfig font lookup [autodetect]
309 --disable-unrarexec disable using of UnRAR executable [enabled]
310 --enable-menu enable OSD menu (not DVD menu) [disabled]
311 --disable-sortsub disable subtitle sorting [enabled]
312 --enable-fribidi enable the FriBiDi libs [autodetect]
313 --disable-enca disable ENCA charset oracle library [autodetect]
314 --disable-maemo disable maemo specific features [autodetect]
315 --enable-macosx-finder enable Mac OS X Finder invocation parameter
316 parsing [disabled]
317 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
318 --disable-inet6 disable IPv6 support [autodetect]
319 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
320 --disable-ftp disable FTP support [enabled]
321 --disable-vstream disable TiVo vstream client support [autodetect]
322 --disable-pthreads disable Posix threads support [autodetect]
323 --disable-w32threads disable Win32 threads support [autodetect]
324 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
325 --enable-rpath enable runtime linker path for extra libs [disabled]
327 Codecs:
328 --enable-gif enable GIF support [autodetect]
329 --enable-png enable PNG input/output support [autodetect]
330 --enable-mng enable MNG input support [autodetect]
331 --enable-jpeg enable JPEG input/output support [autodetect]
332 --enable-libcdio enable libcdio support [autodetect]
333 --enable-liblzo enable liblzo support [autodetect]
334 --disable-win32dll disable Win32 DLL support [autodetect]
335 --disable-qtx disable QuickTime codecs support [enabled]
336 --disable-xanim disable XAnim codecs support [enabled]
337 --disable-real disable RealPlayer codecs support [enabled]
338 --disable-xvid disable Xvid [autodetect]
339 --disable-libnut disable libnut [autodetect]
340 --disable-ffmpeg disable FFmpeg [autodetect]
341 --disable-tremor-internal disable internal Tremor [enabled]
342 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
343 --enable-tremor enable external Tremor [autodetect]
344 --disable-libvorbis disable libvorbis support [autodetect]
345 --disable-speex disable Speex support [autodetect]
346 --enable-theora enable OggTheora libraries [autodetect]
347 --enable-faad enable external FAAD2 (AAC) [autodetect]
348 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
349 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
350 --disable-ladspa disable LADSPA plugin support [autodetect]
351 --disable-libbs2b disable libbs2b audio filter support [autodetect]
352 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
353 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
354 --disable-mad disable libmad (MPEG audio) support [autodetect]
355 --enable-xmms enable XMMS input plugin support [disabled]
356 --enable-libdca enable libdca support [autodetect]
357 --disable-mp3lib disable builtin mp3lib [autodetect]
358 --disable-liba52 disable liba52 [autodetect]
359 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
360 --disable-musepack disable musepack support [autodetect]
362 Video output:
363 --disable-vidix disable VIDIX [for x86 *nix]
364 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
365 Available: cyberblade, ivtv, mach64, mga, mga_crtc2,
366 nvidia, pm2, pm3, radeon, rage128, s3, sis, unichrome
367 --disable-vidix-pcidb disable VIDIX PCI device name database
368 --enable-dhahelper enable VIDIX dhahelper support
369 --enable-svgalib_helper enable VIDIX svgalib_helper support
370 --enable-gl enable OpenGL video output [autodetect]
371 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
372 --enable-dga2 enable DGA 2 support [autodetect]
373 --enable-dga1 enable DGA 1 support [autodetect]
374 --enable-vesa enable VESA video output [autodetect]
375 --enable-svga enable SVGAlib video output [autodetect]
376 --enable-sdl enable SDL video output [autodetect]
377 --enable-kva enable KVA video output [autodetect]
378 --enable-aa enable AAlib video output [autodetect]
379 --enable-caca enable CACA video output [autodetect]
380 --enable-ggi enable GGI video output [autodetect]
381 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
382 --enable-direct3d enable Direct3D video output [autodetect]
383 --enable-directx enable DirectX video output [autodetect]
384 --enable-dxr2 enable DXR2 video output [autodetect]
385 --enable-dxr3 enable DXR3/H+ video output [autodetect]
386 --enable-ivtv enable IVTV TV-Out video output [autodetect]
387 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
388 --enable-dvb enable DVB video output [autodetect]
389 --enable-mga enable mga_vid video output [autodetect]
390 --enable-xmga enable mga_vid X11 video output [autodetect]
391 --enable-xv enable Xv video output [autodetect]
392 --enable-xvmc enable XvMC acceleration [disable]
393 --enable-vdpau enable VDPAU acceleration [autodetect]
394 --enable-vm enable XF86VidMode support [autodetect]
395 --enable-xinerama enable Xinerama support [autodetect]
396 --enable-x11 enable X11 video output [autodetect]
397 --enable-xshape enable XShape support [autodetect]
398 --disable-xss disable screensaver support via xss [autodetect]
399 --enable-fbdev enable FBDev video output [autodetect]
400 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
401 --enable-tdfxfb enable tdfxfb video output [disable]
402 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
403 --enable-wii enable Nintendo Wii/GameCube video output [disable]
404 --enable-directfb enable DirectFB video output [autodetect]
405 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
406 --enable-bl enable Blinkenlights video output [disable]
407 --enable-tdfxvid enable tdfx_vid video output [disable]
408 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
409 --disable-tga disable Targa video output [enable]
410 --disable-pnm disable PNM video output [enable]
411 --disable-md5sum disable md5sum video output [enable]
412 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
413 --disable-corevideo disable CoreVideo video output [autodetect]
414 --disable-quartz disable Quartz video output [autodetect]
415 --disable-glamo disable Glamo accelerated video output [enable]
417 Audio output:
418 --disable-alsa disable ALSA audio output [autodetect]
419 --disable-ossaudio disable OSS audio output [autodetect]
420 --disable-arts disable aRts audio output [autodetect]
421 --disable-esd disable esd audio output [autodetect]
422 --disable-pulse disable Pulseaudio audio output [autodetect]
423 --disable-jack disable JACK audio output [autodetect]
424 --enable-openal enable OpenAL audio output [disable]
425 --disable-nas disable NAS audio output [autodetect]
426 --disable-sgiaudio disable SGI audio output [autodetect]
427 --disable-sunaudio disable Sun audio output [autodetect]
428 --disable-kai disable KAI audio output [autodetect]
429 --disable-dart disable DART audio output [autodetect]
430 --disable-win32waveout disable Windows waveout audio output [autodetect]
431 --disable-coreaudio disable CoreAudio audio output [autodetect]
432 --disable-select disable using select() on the audio device [enable]
434 Language options:
435 --enable-translation enable support for translated output [disable]
436 --charset=charset convert the console messages to this character set
437 --language-doc=lang language to use for the documentation [en]
438 --language-man=lang language to use for the man pages [en]
439 --language-msg=lang extra languages for program messages [all]
440 --language=lang default language to use [en]
441 Specific options override --language. You can pass a list of languages separated
442 by whitespace or commas instead of a single language. Nonexisting translations
443 will be dropped from each list. All translations available in the list will be
444 installed. The value "all" will activate all translations. The LINGUAS
445 environment variable is honored. In all cases the fallback is English.
446 The program always supports English-language output; additional message
447 languages are only installed if --enable-translation is also specified.
448 Available values for --language-doc are: all $doc_lang_all
449 Available values for --language-man are: all $man_lang_all
450 Available values for --language-msg are: all $msg_lang_all
452 Miscellaneous options:
453 --enable-runtime-cpudetection enable runtime CPU detection [disable]
454 --enable-cross-compile enable cross-compilation [autodetect]
455 --cc=COMPILER C compiler to build MPlayer [gcc]
456 --host-cc=COMPILER C compiler for tools needed while building [gcc]
457 --as=ASSEMBLER assembler to build MPlayer [as]
458 --nm=NM nm tool to build MPlayer [nm]
459 --yasm=YASM Yasm assembler to build MPlayer [yasm]
460 --ar=AR librarian to build MPlayer [ar]
461 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
462 --windres=WINDRES windres to build MPlayer [windres]
463 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
464 --enable-static build a statically linked binary
465 --with-install=PATH path to a custom install program
467 Advanced options:
468 --enable-mmx enable MMX [autodetect]
469 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
470 --enable-3dnow enable 3DNow! [autodetect]
471 --enable-3dnowext enable extended 3DNow! [autodetect]
472 --enable-sse enable SSE [autodetect]
473 --enable-sse2 enable SSE2 [autodetect]
474 --enable-ssse3 enable SSSE3 [autodetect]
475 --enable-shm enable shm [autodetect]
476 --enable-altivec enable AltiVec (PowerPC) [autodetect]
477 --enable-armv5te enable DSP extensions (ARM) [autodetect]
478 --enable-armv6 enable ARMv6 (ARM) [autodetect]
479 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
480 --enable-armvfp enable ARM VFP (ARM) [autodetect]
481 --enable-neon enable NEON (ARM) [autodetect]
482 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
483 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
484 --enable-big-endian force byte order to big-endian [autodetect]
485 --enable-debug[=1-3] compile-in debugging information [disable]
486 --enable-profile compile-in profiling information [disable]
487 --disable-sighandler disable sighandler for crashes [enable]
488 --enable-crash-debug enable automatic gdb attach on crash [disable]
489 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
490 --ffmpeg-source-dir=PATH enable features requiring internal FFmpeg headers
492 Use these options if autodetection fails:
493 --extra-cflags=FLAGS extra CFLAGS
494 --extra-ldflags=FLAGS extra LDFLAGS
495 --extra-libs=FLAGS extra linker flags
496 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
497 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
499 --with-freetype-config=PATH path to freetype-config
500 --with-glib-config=PATH path to glib*-config
501 --with-gtk-config=PATH path to gtk*-config
502 --with-sdl-config=PATH path to sdl*-config
503 --with-dvdnav-config=PATH path to dvdnav-config
504 --with-dvdread-config=PATH path to dvdread-config
506 This configure script is NOT autoconf-based, even though its output is similar.
507 It will try to autodetect all configuration options. If you --enable an option
508 it will be forcefully turned on, skipping autodetection. This can break
509 compilation, so you need to know what you are doing.
511 exit 0
512 } #show_help()
514 # GOTCHA: the variables below defines the default behavior for autodetection
515 # and have - unless stated otherwise - at least 2 states : yes no
516 # If autodetection is available then the third state is: auto
517 _mmx=auto
518 _3dnow=auto
519 _3dnowext=auto
520 _mmxext=auto
521 _sse=auto
522 _sse2=auto
523 _ssse3=auto
524 _cmov=auto
525 _fast_cmov=auto
526 _fast_clz=auto
527 _armv5te=auto
528 _armv6=auto
529 _armv6t2=auto
530 _armvfp=auto
531 neon=auto
532 _iwmmxt=auto
533 _mtrr=auto
534 _altivec=auto
535 _install=install
536 _ranlib=ranlib
537 _windres=windres
538 _cc=cc
539 _ar=ar
540 test "$CC" && _cc="$CC"
541 _as=auto
542 _nm=auto
543 _yasm=yasm
544 _runtime_cpudetection=no
545 _cross_compile=auto
546 _prefix="/usr/local"
547 ffmpeg=auto
548 ffmpeg_internals=no
549 _mplayer=yes
550 _x11=auto
551 _xshape=auto
552 _xss=auto
553 _dga1=auto
554 _dga2=auto
555 _xv=auto
556 _xvmc=no #auto when complete
557 _vdpau=auto
558 _sdl=auto
559 _kva=auto
560 _direct3d=auto
561 _directx=auto
562 _win32waveout=auto
563 _nas=auto
564 _png=auto
565 _mng=auto
566 _jpeg=auto
567 _pnm=yes
568 _md5sum=yes
569 _yuv4mpeg=yes
570 _gif=auto
571 _gl=auto
572 matrixview=yes
573 _ggi=auto
574 _ggiwmh=auto
575 _aa=auto
576 _caca=auto
577 _svga=auto
578 _vesa=auto
579 _fbdev=auto
580 _dvb=auto
581 _dxr2=auto
582 _dxr3=auto
583 _ivtv=auto
584 _v4l2=auto
585 _iconv=auto
586 _langinfo=auto
587 _rtc=auto
588 _ossaudio=auto
589 _arts=auto
590 _esd=auto
591 _pulse=auto
592 _jack=auto
593 _kai=auto
594 _dart=auto
595 _openal=no
596 _libcdio=auto
597 _liblzo=auto
598 _mad=auto
599 _tremor=auto
600 _tremor_internal=yes
601 _tremor_low=no
602 _libvorbis=auto
603 _speex=auto
604 _theora=auto
605 _mpg123=auto
606 _mp3lib=auto
607 _liba52=auto
608 _libdca=auto
609 _libmpeg2=auto
610 _faad=auto
611 _faad_internal=auto
612 _faad_fixed=no
613 _ladspa=auto
614 _libbs2b=auto
615 _xmms=no
616 _vcd=auto
617 _bluray=auto
618 _dvdnav=auto
619 _dvdnavconfig=dvdnav-config
620 _dvdreadconfig=dvdread-config
621 _dvdread=auto
622 _dvdread_internal=auto
623 _libdvdcss_internal=auto
624 _xanim=auto
625 _real=auto
626 _live=auto
627 _nemesi=auto
628 _native_rtsp=yes
629 _xinerama=auto
630 _mga=auto
631 _xmga=auto
632 _vm=auto
633 _xf86keysym=auto
634 _sgiaudio=auto
635 _sunaudio=auto
636 _alsa=auto
637 _fastmemcpy=yes
638 _unrar_exec=auto
639 _win32dll=auto
640 _select=yes
641 _radio=no
642 _radio_capture=no
643 _radio_v4l=auto
644 _radio_v4l2=auto
645 _radio_bsdbt848=auto
646 _tv=yes
647 _tv_v4l1=auto
648 _tv_v4l2=auto
649 _tv_bsdbt848=auto
650 _tv_dshow=auto
651 _pvr=auto
652 networking=yes
653 _winsock2_h=auto
654 _smb=auto
655 _vidix=auto
656 _vidix_pcidb=yes
657 _dhahelper=no
658 _svgalib_helper=no
659 _joystick=no
660 _xvid=auto
661 _libnut=auto
662 _lirc=auto
663 _lircc=auto
664 _apple_remote=auto
665 _apple_ir=auto
666 _gui=no
667 _gtk1=no
668 _termcap=auto
669 _termios=auto
670 _3dfx=no
671 _s3fb=no
672 _wii=no
673 _tdfxfb=no
674 _tdfxvid=no
675 _xvr100=auto
676 _tga=yes
677 _directfb=auto
678 _zr=auto
679 _bl=no
680 _glamo=yes
681 _largefiles=yes
682 #language=en
683 _shm=auto
684 _translation=no
685 _charset="UTF-8"
686 _dynamic_plugins=no
687 _crash_debug=no
688 _sighandler=yes
689 _libdv=auto
690 _cdparanoia=auto
691 _cddb=auto
692 _big_endian=auto
693 _bitmap_font=yes
694 _freetype=auto
695 _fontconfig=auto
696 _menu=no
697 _qtx=auto
698 _maemo=auto
699 _coreaudio=auto
700 _corevideo=auto
701 _quartz=auto
702 quicktime=auto
703 _macosx_finder=no
704 _macosx_bundle=auto
705 _sortsub=yes
706 _freetypeconfig='freetype-config'
707 _fribidi=auto
708 _enca=auto
709 _inet6=auto
710 _gethostbyname2=auto
711 _ftp=auto
712 _musepack=auto
713 _vstream=auto
714 _pthreads=auto
715 _w32threads=auto
716 _ass=auto
717 _rpath=no
718 _asmalign_pot=auto
719 _stream_cache=yes
720 _priority=no
721 def_dos_paths="#define HAVE_DOS_PATHS 0"
722 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
723 def_priority="#undef CONFIG_PRIORITY"
724 def_pthread_cache="#undef PTHREAD_CACHE"
725 _need_shmem=yes
726 for ac_option do
727 case "$ac_option" in
728 --help|-help|-h)
729 show_help
731 --prefix=*)
732 _prefix=$(echo $ac_option | cut -d '=' -f 2)
734 --bindir=*)
735 _bindir=$(echo $ac_option | cut -d '=' -f 2)
737 --datadir=*)
738 _datadir=$(echo $ac_option | cut -d '=' -f 2)
740 --mandir=*)
741 _mandir=$(echo $ac_option | cut -d '=' -f 2)
743 --confdir=*)
744 _confdir=$(echo $ac_option | cut -d '=' -f 2)
746 --libdir=*)
747 _libdir=$(echo $ac_option | cut -d '=' -f 2)
749 --codecsdir=*)
750 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
752 --localedir=*)
753 _localedir=$(echo $ac_option | cut -d '=' -f 2)
756 --with-install=*)
757 _install=$(echo $ac_option | cut -d '=' -f 2 )
759 --with-xvmclib=*)
760 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
763 --with-sdl-config=*)
764 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
766 --with-freetype-config=*)
767 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
769 --with-gtk-config=*)
770 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
772 --with-glib-config=*)
773 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
775 --with-dvdnav-config=*)
776 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
778 --with-dvdread-config=*)
779 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
782 --extra-cflags=*)
783 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
785 --extra-ldflags=*)
786 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
788 --extra-libs=*)
789 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
791 --extra-libs-mplayer=*)
792 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
795 --target=*)
796 _target=$(echo $ac_option | cut -d '=' -f 2)
798 --cc=*)
799 _cc=$(echo $ac_option | cut -d '=' -f 2)
801 --host-cc=*)
802 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
804 --as=*)
805 _as=$(echo $ac_option | cut -d '=' -f 2)
807 --nm=*)
808 _nm=$(echo $ac_option | cut -d '=' -f 2)
810 --yasm=*)
811 _yasm=$(echo $ac_option | cut -d '=' -f 2)
813 --ar=*)
814 _ar=$(echo $ac_option | cut -d '=' -f 2)
816 --ranlib=*)
817 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
819 --windres=*)
820 _windres=$(echo $ac_option | cut -d '=' -f 2)
822 --charset=*)
823 _charset=$(echo $ac_option | cut -d '=' -f 2)
825 --language-doc=*)
826 language_doc=$(echo $ac_option | cut -d '=' -f 2)
828 --language-man=*)
829 language_man=$(echo $ac_option | cut -d '=' -f 2)
831 --language-msg=*)
832 language_msg=$(echo $ac_option | cut -d '=' -f 2)
834 --language=*)
835 language=$(echo $ac_option | cut -d '=' -f 2)
838 --enable-static)
839 _ld_static='-static'
841 --disable-static)
842 _ld_static=''
844 --enable-profile)
845 _profile='-p'
847 --disable-profile)
848 _profile=
850 --enable-debug)
851 _debug='-g'
853 --enable-debug=*)
854 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
856 --disable-debug)
857 _debug=
859 --enable-translation) _translation=yes ;;
860 --disable-translation) _translation=no ;;
861 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
862 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
863 --enable-cross-compile) _cross_compile=yes ;;
864 --disable-cross-compile) _cross_compile=no ;;
865 --enable-mplayer) _mplayer=yes ;;
866 --disable-mplayer) _mplayer=no ;;
867 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
868 --disable-dynamic-plugins) _dynamic_plugins=no ;;
869 --enable-x11) _x11=yes ;;
870 --disable-x11) _x11=no ;;
871 --enable-xshape) _xshape=yes ;;
872 --disable-xshape) _xshape=no ;;
873 --enable-xss) _xss=yes ;;
874 --disable-xss) _xss=no ;;
875 --enable-xv) _xv=yes ;;
876 --disable-xv) _xv=no ;;
877 --enable-xvmc) _xvmc=yes ;;
878 --disable-xvmc) _xvmc=no ;;
879 --enable-vdpau) _vdpau=yes ;;
880 --disable-vdpau) _vdpau=no ;;
881 --enable-sdl) _sdl=yes ;;
882 --disable-sdl) _sdl=no ;;
883 --enable-kva) _kva=yes ;;
884 --disable-kva) _kva=no ;;
885 --enable-direct3d) _direct3d=yes ;;
886 --disable-direct3d) _direct3d=no ;;
887 --enable-directx) _directx=yes ;;
888 --disable-directx) _directx=no ;;
889 --enable-win32waveout) _win32waveout=yes ;;
890 --disable-win32waveout) _win32waveout=no ;;
891 --enable-nas) _nas=yes ;;
892 --disable-nas) _nas=no ;;
893 --enable-png) _png=yes ;;
894 --disable-png) _png=no ;;
895 --enable-mng) _mng=yes ;;
896 --disable-mng) _mng=no ;;
897 --enable-jpeg) _jpeg=yes ;;
898 --disable-jpeg) _jpeg=no ;;
899 --enable-pnm) _pnm=yes ;;
900 --disable-pnm) _pnm=no ;;
901 --enable-md5sum) _md5sum=yes ;;
902 --disable-md5sum) _md5sum=no ;;
903 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
904 --disable-yuv4mpeg) _yuv4mpeg=no ;;
905 --enable-gif) _gif=yes ;;
906 --disable-gif) _gif=no ;;
907 --enable-gl) _gl=yes ;;
908 --disable-gl) _gl=no ;;
909 --enable-matrixview) matrixview=yes ;;
910 --disable-matrixview) matrixview=no ;;
911 --enable-ggi) _ggi=yes ;;
912 --disable-ggi) _ggi=no ;;
913 --enable-ggiwmh) _ggiwmh=yes ;;
914 --disable-ggiwmh) _ggiwmh=no ;;
915 --enable-aa) _aa=yes ;;
916 --disable-aa) _aa=no ;;
917 --enable-caca) _caca=yes ;;
918 --disable-caca) _caca=no ;;
919 --enable-svga) _svga=yes ;;
920 --disable-svga) _svga=no ;;
921 --enable-vesa) _vesa=yes ;;
922 --disable-vesa) _vesa=no ;;
923 --enable-fbdev) _fbdev=yes ;;
924 --disable-fbdev) _fbdev=no ;;
925 --enable-dvb) _dvb=yes ;;
926 --disable-dvb) _dvb=no ;;
927 --enable-dxr2) _dxr2=yes ;;
928 --disable-dxr2) _dxr2=no ;;
929 --enable-dxr3) _dxr3=yes ;;
930 --disable-dxr3) _dxr3=no ;;
931 --enable-ivtv) _ivtv=yes ;;
932 --disable-ivtv) _ivtv=no ;;
933 --enable-v4l2) _v4l2=yes ;;
934 --disable-v4l2) _v4l2=no ;;
935 --enable-iconv) _iconv=yes ;;
936 --disable-iconv) _iconv=no ;;
937 --enable-langinfo) _langinfo=yes ;;
938 --disable-langinfo) _langinfo=no ;;
939 --enable-rtc) _rtc=yes ;;
940 --disable-rtc) _rtc=no ;;
941 --enable-libdv) _libdv=yes ;;
942 --disable-libdv) _libdv=no ;;
943 --enable-ossaudio) _ossaudio=yes ;;
944 --disable-ossaudio) _ossaudio=no ;;
945 --enable-arts) _arts=yes ;;
946 --disable-arts) _arts=no ;;
947 --enable-esd) _esd=yes ;;
948 --disable-esd) _esd=no ;;
949 --enable-pulse) _pulse=yes ;;
950 --disable-pulse) _pulse=no ;;
951 --enable-jack) _jack=yes ;;
952 --disable-jack) _jack=no ;;
953 --enable-openal) _openal=yes ;;
954 --disable-openal) _openal=no ;;
955 --enable-kai) _kai=yes ;;
956 --disable-kai) _kai=no ;;
957 --enable-dart) _dart=yes ;;
958 --disable-dart) _dart=no ;;
959 --enable-mad) _mad=yes ;;
960 --disable-mad) _mad=no ;;
961 --enable-libcdio) _libcdio=yes ;;
962 --disable-libcdio) _libcdio=no ;;
963 --enable-liblzo) _liblzo=yes ;;
964 --disable-liblzo) _liblzo=no ;;
965 --enable-libvorbis) _libvorbis=yes ;;
966 --disable-libvorbis) _libvorbis=no ;;
967 --enable-speex) _speex=yes ;;
968 --disable-speex) _speex=no ;;
969 --enable-tremor) _tremor=yes ;;
970 --disable-tremor) _tremor=no ;;
971 --enable-tremor-internal) _tremor_internal=yes ;;
972 --disable-tremor-internal) _tremor_internal=no ;;
973 --enable-tremor-low) _tremor_low=yes ;;
974 --disable-tremor-low) _tremor_low=no ;;
975 --enable-theora) _theora=yes ;;
976 --disable-theora) _theora=no ;;
977 --enable-mpg123) _mpg123=yes ;;
978 --disable-mpg123) _mpg123=no ;;
979 --enable-mp3lib) _mp3lib=yes ;;
980 --disable-mp3lib) _mp3lib=no ;;
981 --enable-liba52) _liba52=yes ;;
982 --disable-liba52) _liba52=no ;;
983 --enable-libdca) _libdca=yes ;;
984 --disable-libdca) _libdca=no ;;
985 --enable-libmpeg2) _libmpeg2=yes ;;
986 --disable-libmpeg2) _libmpeg2=no ;;
987 --enable-musepack) _musepack=yes ;;
988 --disable-musepack) _musepack=no ;;
989 --enable-faad) _faad=yes ;;
990 --disable-faad) _faad=no ;;
991 --enable-faad-internal) _faad_internal=yes ;;
992 --disable-faad-internal) _faad_internal=no ;;
993 --enable-faad-fixed) _faad_fixed=yes ;;
994 --disable-faad-fixed) _faad_fixed=no ;;
995 --enable-ladspa) _ladspa=yes ;;
996 --disable-ladspa) _ladspa=no ;;
997 --enable-libbs2b) _libbs2b=yes ;;
998 --disable-libbs2b) _libbs2b=no ;;
999 --enable-xmms) _xmms=yes ;;
1000 --disable-xmms) _xmms=no ;;
1001 --enable-vcd) _vcd=yes ;;
1002 --disable-vcd) _vcd=no ;;
1003 --enable-bluray) _bluray=yes ;;
1004 --disable-bluray) _bluray=no ;;
1005 --enable-dvdread) _dvdread=yes ;;
1006 --disable-dvdread) _dvdread=no ;;
1007 --enable-dvdread-internal) _dvdread_internal=yes ;;
1008 --disable-dvdread-internal) _dvdread_internal=no ;;
1009 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1010 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1011 --enable-dvdnav) _dvdnav=yes ;;
1012 --disable-dvdnav) _dvdnav=no ;;
1013 --enable-xanim) _xanim=yes ;;
1014 --disable-xanim) _xanim=no ;;
1015 --enable-real) _real=yes ;;
1016 --disable-real) _real=no ;;
1017 --enable-live) _live=yes ;;
1018 --disable-live) _live=no ;;
1019 --enable-nemesi) _nemesi=yes ;;
1020 --disable-nemesi) _nemesi=no ;;
1021 --enable-xinerama) _xinerama=yes ;;
1022 --disable-xinerama) _xinerama=no ;;
1023 --enable-mga) _mga=yes ;;
1024 --disable-mga) _mga=no ;;
1025 --enable-xmga) _xmga=yes ;;
1026 --disable-xmga) _xmga=no ;;
1027 --enable-vm) _vm=yes ;;
1028 --disable-vm) _vm=no ;;
1029 --enable-xf86keysym) _xf86keysym=yes ;;
1030 --disable-xf86keysym) _xf86keysym=no ;;
1031 --enable-sunaudio) _sunaudio=yes ;;
1032 --disable-sunaudio) _sunaudio=no ;;
1033 --enable-sgiaudio) _sgiaudio=yes ;;
1034 --disable-sgiaudio) _sgiaudio=no ;;
1035 --enable-alsa) _alsa=yes ;;
1036 --disable-alsa) _alsa=no ;;
1037 --enable-tv) _tv=yes ;;
1038 --disable-tv) _tv=no ;;
1039 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1040 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1041 --enable-tv-v4l1) _tv_v4l1=yes ;;
1042 --disable-tv-v4l1) _tv_v4l1=no ;;
1043 --enable-tv-v4l2) _tv_v4l2=yes ;;
1044 --disable-tv-v4l2) _tv_v4l2=no ;;
1045 --enable-tv-dshow) _tv_dshow=yes ;;
1046 --disable-tv-dshow) _tv_dshow=no ;;
1047 --enable-radio) _radio=yes ;;
1048 --enable-radio-capture) _radio_capture=yes ;;
1049 --disable-radio-capture) _radio_capture=no ;;
1050 --disable-radio) _radio=no ;;
1051 --enable-radio-v4l) _radio_v4l=yes ;;
1052 --disable-radio-v4l) _radio_v4l=no ;;
1053 --enable-radio-v4l2) _radio_v4l2=yes ;;
1054 --disable-radio-v4l2) _radio_v4l2=no ;;
1055 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1056 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1057 --enable-pvr) _pvr=yes ;;
1058 --disable-pvr) _pvr=no ;;
1059 --enable-fastmemcpy) _fastmemcpy=yes ;;
1060 --disable-fastmemcpy) _fastmemcpy=no ;;
1061 --enable-networking) networking=yes ;;
1062 --disable-networking) networking=no ;;
1063 --enable-winsock2_h) _winsock2_h=yes ;;
1064 --disable-winsock2_h) _winsock2_h=no ;;
1065 --enable-smb) _smb=yes ;;
1066 --disable-smb) _smb=no ;;
1067 --enable-vidix) _vidix=yes ;;
1068 --disable-vidix) _vidix=no ;;
1069 --with-vidix-drivers=*)
1070 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1072 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1073 --enable-dhahelper) _dhahelper=yes ;;
1074 --disable-dhahelper) _dhahelper=no ;;
1075 --enable-svgalib_helper) _svgalib_helper=yes ;;
1076 --disable-svgalib_helper) _svgalib_helper=no ;;
1077 --enable-joystick) _joystick=yes ;;
1078 --disable-joystick) _joystick=no ;;
1079 --enable-xvid) _xvid=yes ;;
1080 --disable-xvid) _xvid=no ;;
1081 --enable-libnut) _libnut=yes ;;
1082 --disable-libnut) _libnut=no ;;
1083 --enable-ffmpeg) ffmpeg=yes ;;
1084 --disable-ffmpeg) ffmpeg=no ;;
1085 --ffmpeg-source-dir=*)
1086 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1088 --enable-lirc) _lirc=yes ;;
1089 --disable-lirc) _lirc=no ;;
1090 --enable-lircc) _lircc=yes ;;
1091 --disable-lircc) _lircc=no ;;
1092 --enable-apple-remote) _apple_remote=yes ;;
1093 --disable-apple-remote) _apple_remote=no ;;
1094 --enable-apple-ir) _apple_ir=yes ;;
1095 --disable-apple-ir) _apple_ir=no ;;
1096 --enable-gui) _gui=yes ;;
1097 --disable-gui) _gui=no ;;
1098 --enable-gtk1) _gtk1=yes ;;
1099 --disable-gtk1) _gtk1=no ;;
1100 --enable-termcap) _termcap=yes ;;
1101 --disable-termcap) _termcap=no ;;
1102 --enable-termios) _termios=yes ;;
1103 --disable-termios) _termios=no ;;
1104 --enable-3dfx) _3dfx=yes ;;
1105 --disable-3dfx) _3dfx=no ;;
1106 --enable-s3fb) _s3fb=yes ;;
1107 --disable-s3fb) _s3fb=no ;;
1108 --enable-wii) _wii=yes ;;
1109 --disable-wii) _wii=no ;;
1110 --enable-tdfxfb) _tdfxfb=yes ;;
1111 --disable-tdfxfb) _tdfxfb=no ;;
1112 --disable-tdfxvid) _tdfxvid=no ;;
1113 --enable-tdfxvid) _tdfxvid=yes ;;
1114 --disable-xvr100) _xvr100=no ;;
1115 --enable-xvr100) _xvr100=yes ;;
1116 --disable-tga) _tga=no ;;
1117 --enable-tga) _tga=yes ;;
1118 --enable-directfb) _directfb=yes ;;
1119 --disable-directfb) _directfb=no ;;
1120 --enable-zr) _zr=yes ;;
1121 --disable-zr) _zr=no ;;
1122 --enable-bl) _bl=yes ;;
1123 --disable-bl) _bl=no ;;
1124 --enable-glamo) _glamo=yes ;;
1125 --disable-glamo) _glamo=no ;;
1126 --enable-mtrr) _mtrr=yes ;;
1127 --disable-mtrr) _mtrr=no ;;
1128 --enable-largefiles) _largefiles=yes ;;
1129 --disable-largefiles) _largefiles=no ;;
1130 --enable-shm) _shm=yes ;;
1131 --disable-shm) _shm=no ;;
1132 --enable-select) _select=yes ;;
1133 --disable-select) _select=no ;;
1134 --enable-cdparanoia) _cdparanoia=yes ;;
1135 --disable-cdparanoia) _cdparanoia=no ;;
1136 --enable-cddb) _cddb=yes ;;
1137 --disable-cddb) _cddb=no ;;
1138 --enable-big-endian) _big_endian=yes ;;
1139 --disable-big-endian) _big_endian=no ;;
1140 --enable-bitmap-font) _bitmap_font=yes ;;
1141 --disable-bitmap-font) _bitmap_font=no ;;
1142 --enable-freetype) _freetype=yes ;;
1143 --disable-freetype) _freetype=no ;;
1144 --enable-fontconfig) _fontconfig=yes ;;
1145 --disable-fontconfig) _fontconfig=no ;;
1146 --enable-unrarexec) _unrar_exec=yes ;;
1147 --disable-unrarexec) _unrar_exec=no ;;
1148 --enable-ftp) _ftp=yes ;;
1149 --disable-ftp) _ftp=no ;;
1150 --enable-vstream) _vstream=yes ;;
1151 --disable-vstream) _vstream=no ;;
1152 --enable-pthreads) _pthreads=yes ;;
1153 --disable-pthreads) _pthreads=no ;;
1154 --enable-w32threads) _w32threads=yes ;;
1155 --disable-w32threads) _w32threads=no ;;
1156 --enable-ass) _ass=yes ;;
1157 --disable-ass) _ass=no ;;
1158 --enable-rpath) _rpath=yes ;;
1159 --disable-rpath) _rpath=no ;;
1161 --enable-fribidi) _fribidi=yes ;;
1162 --disable-fribidi) _fribidi=no ;;
1164 --enable-enca) _enca=yes ;;
1165 --disable-enca) _enca=no ;;
1167 --enable-inet6) _inet6=yes ;;
1168 --disable-inet6) _inet6=no ;;
1170 --enable-gethostbyname2) _gethostbyname2=yes ;;
1171 --disable-gethostbyname2) _gethostbyname2=no ;;
1173 --enable-dga1) _dga1=yes ;;
1174 --disable-dga1) _dga1=no ;;
1175 --enable-dga2) _dga2=yes ;;
1176 --disable-dga2) _dga2=no ;;
1178 --enable-menu) _menu=yes ;;
1179 --disable-menu) _menu=no ;;
1181 --enable-qtx) _qtx=yes ;;
1182 --disable-qtx) _qtx=no ;;
1184 --enable-coreaudio) _coreaudio=yes ;;
1185 --disable-coreaudio) _coreaudio=no ;;
1186 --enable-corevideo) _corevideo=yes ;;
1187 --disable-corevideo) _corevideo=no ;;
1188 --enable-quartz) _quartz=yes ;;
1189 --disable-quartz) _quartz=no ;;
1190 --enable-macosx-finder) _macosx_finder=yes ;;
1191 --disable-macosx-finder) _macosx_finder=no ;;
1192 --enable-macosx-bundle) _macosx_bundle=yes ;;
1193 --disable-macosx-bundle) _macosx_bundle=no ;;
1195 --enable-maemo) _maemo=yes ;;
1196 --disable-maemo) _maemo=no ;;
1198 --enable-sortsub) _sortsub=yes ;;
1199 --disable-sortsub) _sortsub=no ;;
1201 --enable-crash-debug) _crash_debug=yes ;;
1202 --disable-crash-debug) _crash_debug=no ;;
1203 --enable-sighandler) _sighandler=yes ;;
1204 --disable-sighandler) _sighandler=no ;;
1205 --enable-win32dll) _win32dll=yes ;;
1206 --disable-win32dll) _win32dll=no ;;
1208 --enable-sse) _sse=yes ;;
1209 --disable-sse) _sse=no ;;
1210 --enable-sse2) _sse2=yes ;;
1211 --disable-sse2) _sse2=no ;;
1212 --enable-ssse3) _ssse3=yes ;;
1213 --disable-ssse3) _ssse3=no ;;
1214 --enable-mmxext) _mmxext=yes ;;
1215 --disable-mmxext) _mmxext=no ;;
1216 --enable-3dnow) _3dnow=yes ;;
1217 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1218 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1219 --disable-3dnowext) _3dnowext=no ;;
1220 --enable-cmov) _cmov=yes ;;
1221 --disable-cmov) _cmov=no ;;
1222 --enable-fast-cmov) _fast_cmov=yes ;;
1223 --disable-fast-cmov) _fast_cmov=no ;;
1224 --enable-fast-clz) _fast_clz=yes ;;
1225 --disable-fast-clz) _fast_clz=no ;;
1226 --enable-altivec) _altivec=yes ;;
1227 --disable-altivec) _altivec=no ;;
1228 --enable-armv5te) _armv5te=yes ;;
1229 --disable-armv5te) _armv5te=no ;;
1230 --enable-armv6) _armv6=yes ;;
1231 --disable-armv6) _armv6=no ;;
1232 --enable-armv6t2) _armv6t2=yes ;;
1233 --disable-armv6t2) _armv6t2=no ;;
1234 --enable-armvfp) _armvfp=yes ;;
1235 --disable-armvfp) _armvfp=no ;;
1236 --enable-neon) neon=yes ;;
1237 --disable-neon) neon=no ;;
1238 --enable-iwmmxt) _iwmmxt=yes ;;
1239 --disable-iwmmxt) _iwmmxt=no ;;
1240 --enable-mmx) _mmx=yes ;;
1241 --disable-mmx) # 3Dnow! and MMX2 require MMX
1242 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1245 echo "Unknown parameter: $ac_option"
1246 exit 1
1249 esac
1250 done
1252 if test "$_gui" = yes ; then
1253 die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
1254 (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
1257 # Atmos: moved this here, to be correct, if --prefix is specified
1258 test -z "$_bindir" && _bindir="$_prefix/bin"
1259 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1260 test -z "$_mandir" && _mandir="$_prefix/share/man"
1261 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1262 test -z "$_libdir" && _libdir="$_prefix/lib"
1263 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1265 # Determine our OS name and CPU architecture
1266 if test -z "$_target" ; then
1267 # OS name
1268 system_name=$(uname -s 2>&1)
1269 case "$system_name" in
1270 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1272 Haiku)
1273 system_name=BeOS
1275 IRIX*)
1276 system_name=IRIX
1278 GNU/kFreeBSD)
1279 system_name=FreeBSD
1281 HP-UX*)
1282 system_name=HP-UX
1284 [cC][yY][gG][wW][iI][nN]*)
1285 system_name=CYGWIN
1287 MINGW32*)
1288 system_name=MINGW32
1290 OS/2*)
1291 system_name=OS/2
1294 system_name="$system_name-UNKNOWN"
1296 esac
1299 # host's CPU/instruction set
1300 host_arch=$(uname -p 2>&1)
1301 case "$host_arch" in
1302 i386|sparc|ppc|alpha|arm|mips|vax)
1304 powerpc) # Darwin returns 'powerpc'
1305 host_arch=ppc
1307 *) # uname -p on Linux returns 'unknown' for the processor type,
1308 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1310 # Maybe uname -m (machine hardware name) returns something we
1311 # recognize.
1313 # x86/x86pc is used by QNX
1314 case "$(uname -m 2>&1)" in
1315 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 ;;
1316 ia64) host_arch=ia64 ;;
1317 macppc|ppc) host_arch=ppc ;;
1318 ppc64) host_arch=ppc64 ;;
1319 alpha) host_arch=alpha ;;
1320 sparc) host_arch=sparc ;;
1321 sparc64) host_arch=sparc64 ;;
1322 parisc*|hppa*|9000*) host_arch=hppa ;;
1323 arm*|zaurus|cats) host_arch=arm ;;
1324 sh3|sh4|sh4a) host_arch=sh ;;
1325 s390) host_arch=s390 ;;
1326 s390x) host_arch=s390x ;;
1327 *mips*) host_arch=mips ;;
1328 vax) host_arch=vax ;;
1329 xtensa*) host_arch=xtensa ;;
1330 *) host_arch=UNKNOWN ;;
1331 esac
1333 esac
1334 else # if test -z "$_target"
1335 system_name=$(echo $_target | cut -d '-' -f 2)
1336 case "$(echo $system_name | tr A-Z a-z)" in
1337 linux) system_name=Linux ;;
1338 freebsd) system_name=FreeBSD ;;
1339 gnu/kfreebsd) system_name=FreeBSD ;;
1340 netbsd) system_name=NetBSD ;;
1341 bsd/os) system_name=BSD/OS ;;
1342 openbsd) system_name=OpenBSD ;;
1343 dragonfly) system_name=DragonFly ;;
1344 sunos) system_name=SunOS ;;
1345 qnx) system_name=QNX ;;
1346 morphos) system_name=MorphOS ;;
1347 amigaos) system_name=AmigaOS ;;
1348 mingw32*) system_name=MINGW32 ;;
1349 esac
1350 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1351 host_arch=$(echo $_target | cut -d '-' -f 1)
1352 if test $(echo $host_arch) != "x86_64" ; then
1353 host_arch=$(echo $host_arch | tr '_' '-')
1357 extra_cflags="-I. $extra_cflags"
1358 _timer=timer-linux.c
1359 _getch=getch2.c
1360 if freebsd ; then
1361 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1362 extra_cflags="$extra_cflags -I/usr/local/include"
1365 if netbsd || dragonfly ; then
1366 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1367 extra_cflags="$extra_cflags -I/usr/pkg/include"
1370 if darwin; then
1371 extra_cflags="-mdynamic-no-pic $extra_cflags"
1372 if test "$(basename $_cc)" != "clang" ; then
1373 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
1375 _timer=timer-darwin.c
1378 if aix ; then
1379 extra_ldflags="$extra_ldflags -lC"
1382 if irix ; then
1383 _ranlib='ar -r'
1384 elif linux ; then
1385 _ranlib='true'
1388 if win32 ; then
1389 _exesuf=".exe"
1390 extra_cflags="$extra_cflags -fno-common"
1391 # -lwinmm is always needed for osdep/timer-win2.c
1392 extra_ldflags="$extra_ldflags -lwinmm"
1393 _pe_executable=yes
1394 _timer=timer-win2.c
1395 _priority=yes
1396 def_dos_paths="#define HAVE_DOS_PATHS 1"
1397 def_priority="#define CONFIG_PRIORITY 1"
1400 if mingw32 ; then
1401 _getch=getch2-win.c
1402 _need_shmem=no
1405 if amigaos ; then
1406 _select=no
1407 _sighandler=no
1408 _stream_cache=no
1409 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1410 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1413 if qnx ; then
1414 extra_ldflags="$extra_ldflags -lph"
1417 if os2 ; then
1418 _exesuf=".exe"
1419 _getch=getch2-os2.c
1420 _need_shmem=no
1421 _priority=yes
1422 def_dos_paths="#define HAVE_DOS_PATHS 1"
1423 def_priority="#define CONFIG_PRIORITY 1"
1426 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1427 test "$tmpdir" && break
1428 done
1430 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1431 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1433 TMPLOG="config.log"
1434 TMPC="$mplayer_tmpdir/tmp.c"
1435 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1436 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1437 TMPH="$mplayer_tmpdir/tmp.h"
1438 TMPS="$mplayer_tmpdir/tmp.S"
1440 rm -f "$TMPLOG"
1441 echo configuration: $configuration > "$TMPLOG"
1442 echo >> "$TMPLOG"
1445 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1446 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1450 # Checking CC version...
1451 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1452 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1453 echocheck "$_cc version"
1454 cc_vendor=intel
1455 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1456 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1457 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1458 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1459 # TODO verify older icc/ecc compatibility
1460 case $cc_version in
1462 cc_version="v. ?.??, bad"
1463 cc_fail=yes
1465 10.1|11.0|11.1)
1466 cc_version="$cc_version, ok"
1469 cc_version="$cc_version, bad"
1470 cc_fail=yes
1472 esac
1473 echores "$cc_version"
1474 else
1475 for _cc in "$_cc" gcc cc ; do
1476 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1477 if test "$cc_name_tmp" = "gcc"; then
1478 cc_name=$cc_name_tmp
1479 echocheck "$_cc version"
1480 cc_vendor=gnu
1481 cc_version=$($_cc -dumpversion 2>&1)
1482 case $cc_version in
1483 2.96*)
1484 cc_fail=yes
1487 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1488 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1489 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1491 esac
1492 echores "$cc_version"
1493 break
1495 cc_name_tmp=$($_cc -v 2>&1 | head -n 1 | cut -d ' ' -f 1)
1496 if test "$cc_name_tmp" = "clang"; then
1497 echocheck "$_cc version"
1498 cc_vendor=clang
1499 cc_version=$($_cc -dumpversion 2>&1)
1500 res_comment="experimental support only"
1501 echores "clang $cc_version"
1502 break
1504 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1505 if test "$cc_name_tmp" = "Sun C"; then
1506 echocheck "$_cc version"
1507 cc_vendor=sun
1508 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1509 res_comment="experimental support only"
1510 echores "Sun C $cc_version"
1511 break
1513 done
1514 fi # icc
1515 test "$cc_fail" = yes && die "unsupported compiler version"
1517 if test -z "$_target" && x86 ; then
1518 cat > $TMPC << EOF
1519 int main(void) {
1520 int test[(int)sizeof(char *)-7];
1521 return 0;
1524 cc_check && host_arch=x86_64 || host_arch=i386
1527 echo "Detected operating system: $system_name"
1528 echo "Detected host architecture: $host_arch"
1530 echocheck "host cc"
1531 test "$_host_cc" || _host_cc=$_cc
1532 echores $_host_cc
1534 echocheck "cross compilation"
1535 if test $_cross_compile = auto ; then
1536 _cross_compile=yes
1537 cflag_check "" && "$TMPEXE" && _cross_compile=no
1539 echores $_cross_compile
1541 if test $_cross_compile = yes; then
1542 tmp_run() {
1543 return 0
1547 # ---
1549 # now that we know what compiler should be used for compilation, try to find
1550 # out which assembler is used by the $_cc compiler
1551 if test "$_as" = auto ; then
1552 _as=$($_cc -print-prog-name=as)
1553 test -z "$_as" && _as=as
1556 if test "$_nm" = auto ; then
1557 _nm=$($_cc -print-prog-name=nm)
1558 test -z "$_nm" && _nm=nm
1561 # XXX: this should be ok..
1562 _cpuinfo="echo"
1564 if test "$_runtime_cpudetection" = no ; then
1566 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1567 # FIXME: Remove the cygwin check once AMD CPUs are supported
1568 if test -r /proc/cpuinfo && ! cygwin; then
1569 # Linux with /proc mounted, extract CPU information from it
1570 _cpuinfo="cat /proc/cpuinfo"
1571 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1572 # FreeBSD with Linux emulation /proc mounted,
1573 # extract CPU information from it
1574 # Don't use it on x86 though, it never reports 3Dnow
1575 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1576 elif darwin && ! x86 ; then
1577 # use hostinfo on Darwin
1578 _cpuinfo="hostinfo"
1579 elif aix; then
1580 # use 'lsattr' on AIX
1581 _cpuinfo="lsattr -E -l proc0 -a type"
1582 elif x86; then
1583 # all other OSes try to extract CPU information from a small helper
1584 # program cpuinfo instead
1585 $_cc -o cpuinfo$_exesuf cpuinfo.c
1586 _cpuinfo="./cpuinfo$_exesuf"
1589 if x86 ; then
1590 # gather more CPU information
1591 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1592 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1593 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1594 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1595 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1597 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1599 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1600 -e s/xmm/sse/ -e s/kni/sse/)
1602 for ext in $pparam ; do
1603 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1604 done
1606 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1607 test $_sse = kernel_check && _mmxext=kernel_check
1609 echocheck "CPU vendor"
1610 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1612 echocheck "CPU type"
1613 echores "$pname"
1616 fi # test "$_runtime_cpudetection" = no
1618 if x86 && test "$_runtime_cpudetection" = no ; then
1619 extcheck() {
1620 if test "$1" = kernel_check ; then
1621 echocheck "kernel support of $2"
1622 cat > $TMPC <<EOF
1623 #include <stdlib.h>
1624 #include <signal.h>
1625 static void catch(int sig) { exit(1); }
1626 int main(void) {
1627 signal(SIGILL, catch);
1628 __asm__ volatile ("$3":::"memory"); return 0;
1632 if cc_check && tmp_run ; then
1633 eval _$2=yes
1634 echores "yes"
1635 _optimizing="$_optimizing $2"
1636 return 0
1637 else
1638 eval _$2=no
1639 echores "failed"
1640 echo "It seems that your kernel does not correctly support $2."
1641 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1642 return 1
1645 return 0
1648 extcheck $_mmx "mmx" "emms"
1649 extcheck $_mmxext "mmxext" "sfence"
1650 extcheck $_3dnow "3dnow" "femms"
1651 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1652 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1653 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1654 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1655 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1657 echocheck "mtrr support"
1658 if test "$_mtrr" = kernel_check ; then
1659 _mtrr="yes"
1660 _optimizing="$_optimizing mtrr"
1662 echores "$_mtrr"
1664 if test "$_gcc3_ext" != ""; then
1665 # if we had to disable sse/sse2 because the active kernel does not
1666 # support this instruction set extension, we also have to tell
1667 # gcc3 to not generate sse/sse2 instructions for normal C code
1668 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1674 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1675 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1676 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1677 subarch_all='X86_32 X86_64 PPC64'
1678 case "$host_arch" in
1679 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1680 arch='x86'
1681 subarch='x86_32'
1682 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1683 iproc=486
1684 proc=i486
1687 if test "$_runtime_cpudetection" = no ; then
1688 case "$pvendor" in
1689 AuthenticAMD)
1690 case "$pfamily" in
1691 3) proc=i386 iproc=386 ;;
1692 4) proc=i486 iproc=486 ;;
1693 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1694 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1695 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1696 proc=k6-3
1697 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1698 proc=geode
1699 elif test "$pmodel" -ge 8; then
1700 proc=k6-2
1701 elif test "$pmodel" -ge 6; then
1702 proc=k6
1703 else
1704 proc=i586
1707 6) iproc=686
1708 # It's a bit difficult to determine the correct type of Family 6
1709 # AMD CPUs just from their signature. Instead, we check directly
1710 # whether it supports SSE.
1711 if test "$_sse" = yes; then
1712 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1713 proc=athlon-xp
1714 else
1715 # Again, gcc treats athlon and athlon-tbird similarly.
1716 proc=athlon
1719 15) iproc=686
1720 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1721 # caught and remedied in the optimization tests below.
1722 proc=k8
1725 *) proc=amdfam10 iproc=686
1726 test $_fast_clz = "auto" && _fast_clz=yes
1728 esac
1730 GenuineIntel)
1731 case "$pfamily" in
1732 3) proc=i386 iproc=386 ;;
1733 4) proc=i486 iproc=486 ;;
1734 5) iproc=586
1735 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1736 proc=pentium-mmx # 4 is desktop, 8 is mobile
1737 else
1738 proc=i586
1741 6) iproc=686
1742 if test "$pmodel" -ge 15; then
1743 proc=core2
1744 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1745 proc=pentium-m
1746 elif test "$pmodel" -ge 7; then
1747 proc=pentium3
1748 elif test "$pmodel" -ge 3; then
1749 proc=pentium2
1750 else
1751 proc=i686
1753 test $_fast_clz = "auto" && _fast_clz=yes
1755 15) iproc=686
1756 # A nocona in 32-bit mode has no more capabilities than a prescott.
1757 if test "$pmodel" -ge 3; then
1758 proc=prescott
1759 else
1760 proc=pentium4
1761 test $_fast_clz = "auto" && _fast_clz=yes
1763 test $_fast_cmov = "auto" && _fast_cmov=no
1765 *) proc=prescott iproc=686 ;;
1766 esac
1768 CentaurHauls)
1769 case "$pfamily" in
1770 5) iproc=586
1771 if test "$pmodel" -ge 8; then
1772 proc=winchip2
1773 elif test "$pmodel" -ge 4; then
1774 proc=winchip-c6
1775 else
1776 proc=i586
1779 6) iproc=686
1780 if test "$pmodel" -ge 9; then
1781 proc=c3-2
1782 else
1783 proc=c3
1784 iproc=586
1787 *) proc=i686 iproc=i686 ;;
1788 esac
1790 unknown)
1791 case "$pfamily" in
1792 3) proc=i386 iproc=386 ;;
1793 4) proc=i486 iproc=486 ;;
1794 *) proc=i586 iproc=586 ;;
1795 esac
1798 proc=i586 iproc=586 ;;
1799 esac
1800 test $_fast_clz = "auto" && _fast_clz=no
1801 fi # test "$_runtime_cpudetection" = no
1804 # check that gcc supports our CPU, if not, fall back to earlier ones
1805 # LGB: check -mcpu and -march swithing step by step with enabling
1806 # to fall back till 386.
1808 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1810 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1811 cpuopt=-mtune
1812 else
1813 cpuopt=-mcpu
1816 echocheck "GCC & CPU optimization abilities"
1817 if test "$_runtime_cpudetection" = no ; then
1818 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1819 cflag_check -march=native && proc=native
1821 if test "$proc" = "amdfam10"; then
1822 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1824 if test "$proc" = "k8"; then
1825 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1827 if test "$proc" = "athlon-xp"; then
1828 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1830 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1831 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1833 if test "$proc" = "k6" || test "$proc" = "c3"; then
1834 if ! cflag_check -march=$proc $cpuopt=$proc; then
1835 if cflag_check -march=i586 $cpuopt=i686; then
1836 proc=i586-i686
1837 else
1838 proc=i586
1842 if test "$proc" = "prescott" ; then
1843 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1845 if test "$proc" = "core2" ; then
1846 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1848 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
1849 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1851 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1852 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1854 if test "$proc" = "i586"; then
1855 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1857 if test "$proc" = "i486" ; then
1858 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1860 if test "$proc" = "i386" ; then
1861 cflag_check -march=$proc $cpuopt=$proc || proc=error
1863 if test "$proc" = "error" ; then
1864 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1865 _mcpu=""
1866 _march=""
1867 _optimizing=""
1868 elif test "$proc" = "i586-i686"; then
1869 _march="-march=i586"
1870 _mcpu="$cpuopt=i686"
1871 _optimizing="$proc"
1872 else
1873 _march="-march=$proc"
1874 _mcpu="$cpuopt=$proc"
1875 _optimizing="$proc"
1877 else # if test "$_runtime_cpudetection" = no
1878 _mcpu="$cpuopt=generic"
1879 # at least i486 required, for bswap instruction
1880 _march="-march=i486"
1881 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1882 cflag_check $_mcpu || _mcpu=""
1883 cflag_check $_march $_mcpu || _march=""
1886 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1887 ## autodetected mcpu/march parameters
1888 if test "$_target" ; then
1889 # TODO: it may be a good idea to check GCC and fall back in all cases
1890 if test "$host_arch" = "i586-i686"; then
1891 _march="-march=i586"
1892 _mcpu="$cpuopt=i686"
1893 else
1894 _march="-march=$host_arch"
1895 _mcpu="$cpuopt=$host_arch"
1898 proc="$host_arch"
1900 case "$proc" in
1901 i386) iproc=386 ;;
1902 i486) iproc=486 ;;
1903 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1904 i686|athlon*|pentium*) iproc=686 ;;
1905 *) iproc=586 ;;
1906 esac
1909 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1910 _fast_cmov="yes"
1911 else
1912 _fast_cmov="no"
1914 test $_fast_clz = "auto" && _fast_clz=yes
1916 echores "$proc"
1919 ia64)
1920 arch='ia64'
1921 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1922 iproc='ia64'
1925 x86_64|amd64)
1926 arch='x86'
1927 subarch='x86_64'
1928 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1929 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1930 iproc='x86_64'
1932 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1933 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1934 cpuopt=-mtune
1935 else
1936 cpuopt=-mcpu
1938 if test "$_runtime_cpudetection" = no ; then
1939 case "$pvendor" in
1940 AuthenticAMD)
1941 case "$pfamily" in
1942 15) proc=k8
1943 test $_fast_clz = "auto" && _fast_clz=no
1945 *) proc=amdfam10;;
1946 esac
1948 GenuineIntel)
1949 case "$pfamily" in
1950 6) proc=core2;;
1952 # 64-bit prescotts exist, but as far as GCC is concerned they
1953 # have the same capabilities as a nocona.
1954 proc=nocona
1955 test $_fast_cmov = "auto" && _fast_cmov=no
1956 test $_fast_clz = "auto" && _fast_clz=no
1958 esac
1961 proc=error;;
1962 esac
1963 fi # test "$_runtime_cpudetection" = no
1965 echocheck "GCC & CPU optimization abilities"
1966 # This is a stripped-down version of the i386 fallback.
1967 if test "$_runtime_cpudetection" = no ; then
1968 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1969 cflag_check -march=native && proc=native
1971 # --- AMD processors ---
1972 if test "$proc" = "amdfam10"; then
1973 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1975 if test "$proc" = "k8"; then
1976 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1978 # This will fail if gcc version < 3.3, which is ok because earlier
1979 # versions don't really support 64-bit on amd64.
1980 # Is this a valid assumption? -Corey
1981 if test "$proc" = "athlon-xp"; then
1982 cflag_check -march=$proc $cpuopt=$proc || proc=error
1984 # --- Intel processors ---
1985 if test "$proc" = "core2"; then
1986 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1988 if test "$proc" = "x86-64"; then
1989 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1991 if test "$proc" = "nocona"; then
1992 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1994 if test "$proc" = "pentium4"; then
1995 cflag_check -march=$proc $cpuopt=$proc || proc=error
1998 _march="-march=$proc"
1999 _mcpu="$cpuopt=$proc"
2000 if test "$proc" = "error" ; then
2001 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2002 _mcpu=""
2003 _march=""
2005 else # if test "$_runtime_cpudetection" = no
2006 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2007 _march="-march=x86-64"
2008 _mcpu="$cpuopt=generic"
2009 cflag_check $_mcpu || _mcpu="x86-64"
2010 cflag_check $_mcpu || _mcpu=""
2011 cflag_check $_march $_mcpu || _march=""
2014 _optimizing="$proc"
2015 test $_fast_cmov = "auto" && _fast_cmov=yes
2016 test $_fast_clz = "auto" && _fast_clz=yes
2018 echores "$proc"
2021 sparc|sparc64)
2022 arch='sparc'
2023 iproc='sparc'
2024 if test "$host_arch" = "sparc64" ; then
2025 _vis='yes'
2026 proc='ultrasparc'
2027 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2028 elif sunos ; then
2029 echocheck "CPU type"
2030 karch=$(uname -m)
2031 case "$(echo $karch)" in
2032 sun4) proc=v7 ;;
2033 sun4c) proc=v7 ;;
2034 sun4d) proc=v8 ;;
2035 sun4m) proc=v8 ;;
2036 sun4u) proc=ultrasparc _vis='yes' ;;
2037 sun4v) proc=v9 ;;
2038 *) proc=v8 ;;
2039 esac
2040 echores "$proc"
2041 else
2042 proc=v8
2044 _mcpu="-mcpu=$proc"
2045 _optimizing="$proc"
2048 arm*)
2049 arch='arm'
2050 iproc='arm'
2053 avr32)
2054 arch='avr32'
2055 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2056 iproc='avr32'
2057 test $_fast_clz = "auto" && _fast_clz=yes
2060 sh|sh4)
2061 arch='sh4'
2062 iproc='sh4'
2065 ppc|ppc64|powerpc|powerpc64)
2066 arch='ppc'
2067 def_dcbzl='#define HAVE_DCBZL 0'
2068 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2069 iproc='ppc'
2071 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2072 subarch='ppc64'
2073 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2075 echocheck "CPU type"
2076 case $system_name in
2077 Linux)
2078 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2079 if test -n "$($_cpuinfo | grep altivec)"; then
2080 test $_altivec = auto && _altivec=yes
2083 Darwin)
2084 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2085 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2086 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2087 test $_altivec = auto && _altivec=yes
2090 NetBSD)
2091 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2092 case $cc_version in
2093 2*|3.0*|3.1*|3.2*|3.3*)
2096 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2097 test $_altivec = auto && _altivec=yes
2100 esac
2102 AIX)
2103 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2105 esac
2106 if test "$_altivec" = yes; then
2107 echores "$proc altivec"
2108 else
2109 _altivec=no
2110 echores "$proc"
2113 echocheck "GCC & CPU optimization abilities"
2115 if test -n "$proc"; then
2116 case "$proc" in
2117 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2118 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2119 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2120 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2121 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2122 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2123 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2124 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2125 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2126 *) ;;
2127 esac
2128 # gcc 3.1(.1) and up supports 7400 and 7450
2129 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2130 case "$proc" in
2131 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2132 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2133 *) ;;
2134 esac
2136 # gcc 3.2 and up supports 970
2137 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2138 case "$proc" in
2139 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2140 def_dcbzl='#define HAVE_DCBZL 1' ;;
2141 *) ;;
2142 esac
2144 # gcc 3.3 and up supports POWER4
2145 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2146 case "$proc" in
2147 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2148 *) ;;
2149 esac
2151 # gcc 3.4 and up supports 440*
2152 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2153 case "$proc" in
2154 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2155 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2156 *) ;;
2157 esac
2159 # gcc 4.0 and up supports POWER5
2160 if test "$_cc_major" -ge "4"; then
2161 case "$proc" in
2162 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2163 *) ;;
2164 esac
2168 if test -n "$_mcpu"; then
2169 _optimizing=$(echo $_mcpu | cut -c 8-)
2170 echores "$_optimizing"
2171 else
2172 echores "none"
2175 test $_fast_clz = "auto" && _fast_clz=yes
2179 alpha*)
2180 arch='alpha'
2181 iproc='alpha'
2182 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2184 echocheck "CPU type"
2185 cat > $TMPC << EOF
2186 int main(void) {
2187 unsigned long ver, mask;
2188 __asm__ ("implver %0" : "=r" (ver));
2189 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2190 printf("%ld-%x\n", ver, ~mask);
2191 return 0;
2194 $_cc -o "$TMPEXE" "$TMPC"
2195 case $("$TMPEXE") in
2197 0-0) proc="ev4"; _mvi="0";;
2198 1-0) proc="ev5"; _mvi="0";;
2199 1-1) proc="ev56"; _mvi="0";;
2200 1-101) proc="pca56"; _mvi="1";;
2201 2-303) proc="ev6"; _mvi="1";;
2202 2-307) proc="ev67"; _mvi="1";;
2203 2-1307) proc="ev68"; _mvi="1";;
2204 esac
2205 echores "$proc"
2207 echocheck "GCC & CPU optimization abilities"
2208 if test "$proc" = "ev68" ; then
2209 cc_check -mcpu=$proc || proc=ev67
2211 if test "$proc" = "ev67" ; then
2212 cc_check -mcpu=$proc || proc=ev6
2214 _mcpu="-mcpu=$proc"
2215 echores "$proc"
2217 test $_fast_clz = "auto" && _fast_clz=yes
2219 _optimizing="$proc"
2222 mips*)
2223 arch='mips'
2224 iproc='mips'
2226 if irix ; then
2227 echocheck "CPU type"
2228 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2229 case "$(echo $proc)" in
2230 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2231 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2232 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2233 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2234 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2235 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2236 esac
2237 # gcc < 3.x does not support -mtune.
2238 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2239 _mcpu=''
2241 echores "$proc"
2244 test $_fast_clz = "auto" && _fast_clz=yes
2248 hppa)
2249 arch='pa_risc'
2250 iproc='PA-RISC'
2253 s390)
2254 arch='s390'
2255 iproc='390'
2258 s390x)
2259 arch='s390x'
2260 iproc='390x'
2263 vax)
2264 arch='vax'
2265 iproc='vax'
2268 xtensa)
2269 arch='xtensa'
2270 iproc='xtensa'
2273 generic)
2274 arch='generic'
2278 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2279 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2280 die "unsupported architecture $host_arch"
2282 esac # case "$host_arch" in
2284 if test "$_runtime_cpudetection" = yes ; then
2285 if x86 ; then
2286 test "$_cmov" != no && _cmov=yes
2287 x86_32 && _cmov=no
2288 test "$_mmx" != no && _mmx=yes
2289 test "$_3dnow" != no && _3dnow=yes
2290 test "$_3dnowext" != no && _3dnowext=yes
2291 test "$_mmxext" != no && _mmxext=yes
2292 test "$_sse" != no && _sse=yes
2293 test "$_sse2" != no && _sse2=yes
2294 test "$_ssse3" != no && _ssse3=yes
2295 test "$_mtrr" != no && _mtrr=yes
2297 if ppc; then
2298 _altivec=yes
2303 # endian testing
2304 echocheck "byte order"
2305 if test "$_big_endian" = auto ; then
2306 cat > $TMPC <<EOF
2307 short ascii_name[] = {
2308 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2309 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2310 int main(void) { return (long)ascii_name; }
2312 if cc_check ; then
2313 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2314 _big_endian=yes
2315 else
2316 _big_endian=no
2318 else
2319 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2322 if test "$_big_endian" = yes ; then
2323 _byte_order='big-endian'
2324 def_words_endian='#define WORDS_BIGENDIAN 1'
2325 def_bigendian='#define HAVE_BIGENDIAN 1'
2326 else
2327 _byte_order='little-endian'
2328 def_words_endian='#undef WORDS_BIGENDIAN'
2329 def_bigendian='#define HAVE_BIGENDIAN 0'
2331 echores "$_byte_order"
2334 echocheck "extern symbol prefix"
2335 cat > $TMPC << EOF
2336 int ff_extern;
2338 cc_check -c || die "Symbol mangling check failed."
2339 sym=$($_nm -P -g $TMPEXE)
2340 extern_prefix=${sym%%ff_extern*}
2341 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2342 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2343 echores $extern_prefix
2346 echocheck "assembler support of -pipe option"
2347 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2348 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2351 echocheck "compiler support of named assembler arguments"
2352 _named_asm_args=yes
2353 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2354 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2355 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2356 _named_asm_args=no
2357 def_named_asm_args="#undef NAMED_ASM_ARGS"
2359 echores $_named_asm_args
2362 if darwin && test "$cc_vendor" = "gnu" ; then
2363 echocheck "GCC support of -mstackrealign"
2364 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2365 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2366 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2367 # wrong code with this flag, but this can be worked around by adding
2368 # -fno-unit-at-a-time as described in the blog post at
2369 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2370 cat > $TMPC << EOF
2371 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2372 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2374 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2375 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time \
2376 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2377 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2378 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2381 # Checking for CFLAGS
2382 _install_strip="-s"
2383 if test "$_profile" != "" || test "$_debug" != "" ; then
2384 CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
2385 WARNFLAGS="-W -Wall"
2386 _install_strip=
2387 elif test -z "$CFLAGS" ; then
2388 if test "$cc_vendor" = "intel" ; then
2389 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2390 WARNFLAGS="-wd167 -wd556 -wd144"
2391 elif test "$cc_vendor" = "sun" ; then
2392 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2393 elif test "$cc_vendor" = "clang"; then
2394 CFLAGS="-O2 $_march $_pipe"
2395 elif test "$cc_vendor" != "gnu" ; then
2396 CFLAGS="-O2 $_march $_mcpu $_pipe"
2397 else
2398 CFLAGS="-O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2399 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2400 extra_ldflags="$extra_ldflags -ffast-math"
2402 else
2403 warn_cflags=yes
2406 if test "$cc_vendor" = "gnu" ; then
2407 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2408 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2409 # that's the only variable specific to C now, and this option is not valid
2410 # for C++.
2411 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2412 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2413 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2414 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2415 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2416 else
2417 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2420 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2421 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2424 if test -n "$LDFLAGS" ; then
2425 extra_ldflags="$extra_ldflags $LDFLAGS"
2426 warn_cflags=yes
2427 elif test "$cc_vendor" = "intel" ; then
2428 extra_ldflags="$extra_ldflags -i-static"
2430 if test -n "$CPPFLAGS" ; then
2431 extra_cflags="$extra_cflags $CPPFLAGS"
2432 warn_cflags=yes
2437 if x86_32 ; then
2438 # Checking assembler (_as) compatibility...
2439 # Added workaround for older as that reads from stdin by default - atmos
2440 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2441 echocheck "assembler ($_as $as_version)"
2443 _pref_as_version='2.9.1'
2444 echo 'nop' > $TMPS
2445 if test "$_mmx" = yes ; then
2446 echo 'emms' >> $TMPS
2448 if test "$_3dnow" = yes ; then
2449 _pref_as_version='2.10.1'
2450 echo 'femms' >> $TMPS
2452 if test "$_3dnowext" = yes ; then
2453 _pref_as_version='2.10.1'
2454 echo 'pswapd %mm0, %mm0' >> $TMPS
2456 if test "$_mmxext" = yes ; then
2457 _pref_as_version='2.10.1'
2458 echo 'movntq %mm0, (%eax)' >> $TMPS
2460 if test "$_sse" = yes ; then
2461 _pref_as_version='2.10.1'
2462 echo 'xorps %xmm0, %xmm0' >> $TMPS
2464 #if test "$_sse2" = yes ; then
2465 # _pref_as_version='2.11'
2466 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2468 if test "$_cmov" = yes ; then
2469 _pref_as_version='2.10.1'
2470 echo 'cmovb %eax, %ebx' >> $TMPS
2472 if test "$_ssse3" = yes ; then
2473 _pref_as_version='2.16.92'
2474 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2476 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2478 if test "$as_verc_fail" != yes ; then
2479 echores "ok"
2480 else
2481 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2482 echores "failed"
2483 die "obsolete binutils version"
2486 fi #if x86_32
2489 echocheck "PIC"
2490 pic=no
2491 cat > $TMPC << EOF
2492 int main(void) {
2493 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2494 #error PIC not enabled
2495 #endif
2496 return 0;
2499 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2500 echores $pic
2503 if x86 ; then
2505 echocheck ".align is a power of two"
2506 if test "$_asmalign_pot" = auto ; then
2507 _asmalign_pot=no
2508 inline_asm_check '".align 3"' && _asmalign_pot=yes
2510 if test "$_asmalign_pot" = "yes" ; then
2511 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2512 else
2513 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2515 echores $_asmalign_pot
2518 echocheck "10 assembler operands"
2519 ten_operands=no
2520 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2521 cat > $TMPC << EOF
2522 int main(void) {
2523 int x=0;
2524 __asm__ volatile(
2526 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2528 return 0;
2531 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2532 echores $ten_operands
2534 echocheck "ebx availability"
2535 ebx_available=no
2536 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2537 cat > $TMPC << EOF
2538 int main(void) {
2539 int x;
2540 __asm__ volatile(
2541 "xor %0, %0"
2542 :"=b"(x)
2543 // just adding ebx to clobber list seems unreliable with some
2544 // compilers, e.g. Haiku's gcc 2.95
2546 // and the above check does not work for OSX 64 bit...
2547 __asm__ volatile("":::"%ebx");
2548 return 0;
2551 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2552 echores $ebx_available
2555 echocheck "yasm"
2556 if test -z "$YASMFLAGS" ; then
2557 if darwin ; then
2558 x86_64 && objformat="macho64" || objformat="macho"
2559 elif win32 ; then
2560 objformat="win32"
2561 else
2562 objformat="elf"
2564 # currently tested for Linux x86, x86_64
2565 YASMFLAGS="-f $objformat"
2566 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2567 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2568 case "$objformat" in
2569 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2570 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2571 esac
2572 else
2573 warn_cflags=yes
2576 echo "pabsw xmm0, xmm0" > $TMPS
2577 yasm_check || _yasm=""
2578 if test $_yasm ; then
2579 def_yasm='#define HAVE_YASM 1'
2580 have_yasm="yes"
2581 echores "$_yasm"
2582 else
2583 def_yasm='#define HAVE_YASM 0'
2584 have_yasm="no"
2585 echores "no"
2588 echocheck "bswap"
2589 def_bswap='#define HAVE_BSWAP 0'
2590 echo 'bswap %eax' > $TMPS
2591 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2592 echores "$bswap"
2593 fi #if x86
2596 #FIXME: This should happen before the check for CFLAGS..
2597 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2598 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2600 # check if AltiVec is supported by the compiler, and how to enable it
2601 echocheck "GCC AltiVec flags"
2602 if $(cflag_check -maltivec -mabi=altivec) ; then
2603 _altivec_gcc_flags="-maltivec -mabi=altivec"
2604 # check if <altivec.h> should be included
2605 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2606 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2607 inc_altivec_h='#include <altivec.h>'
2608 else
2609 if $(cflag_check -faltivec) ; then
2610 _altivec_gcc_flags="-faltivec"
2611 else
2612 _altivec=no
2613 _altivec_gcc_flags="none, AltiVec disabled"
2617 echores "$_altivec_gcc_flags"
2619 # check if the compiler supports braces for vector declarations
2620 cat > $TMPC << EOF
2621 $inc_altivec_h
2622 int main(void) { (vector int) {1}; return 0; }
2624 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2626 # Disable runtime cpudetection if we cannot generate AltiVec code or
2627 # AltiVec is disabled by the user.
2628 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2629 && _runtime_cpudetection=no
2631 # Show that we are optimizing for AltiVec (if enabled and supported).
2632 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2633 && _optimizing="$_optimizing altivec"
2635 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2636 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2639 if ppc ; then
2640 def_xform_asm='#define HAVE_XFORM_ASM 0'
2641 xform_asm=no
2642 echocheck "XFORM ASM support"
2643 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2644 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2645 echores "$xform_asm"
2648 if arm ; then
2649 echocheck "ARM pld instruction"
2650 pld=no
2651 inline_asm_check '"pld [r0]"' && pld=yes
2652 echores "$pld"
2654 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2655 if test $_armv5te = "auto" ; then
2656 _armv5te=no
2657 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2659 echores "$_armv5te"
2661 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2663 echocheck "ARMv6 (SIMD instructions)"
2664 if test $_armv6 = "auto" ; then
2665 _armv6=no
2666 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2668 echores "$_armv6"
2670 echocheck "ARMv6t2 (SIMD instructions)"
2671 if test $_armv6t2 = "auto" ; then
2672 _armv6t2=no
2673 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2675 echores "$_armv6"
2677 echocheck "ARM VFP"
2678 if test $_armvfp = "auto" ; then
2679 _armvfp=no
2680 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2682 echores "$_armvfp"
2684 echocheck "ARM NEON"
2685 if test $neon = "auto" ; then
2686 neon=no
2687 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2689 echores "$neon"
2691 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2692 if test $_iwmmxt = "auto" ; then
2693 _iwmmxt=no
2694 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2696 echores "$_iwmmxt"
2699 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'
2700 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2701 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2702 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2703 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2704 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2705 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2706 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2707 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2708 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2709 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2710 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2711 test "$pld" = yes && cpuexts="PLD $cpuexts"
2712 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2713 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2714 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2715 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2716 test "$neon" = yes && cpuexts="NEON $cpuexts"
2717 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2718 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2719 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2721 # Checking kernel version...
2722 if x86_32 && linux ; then
2723 _k_verc_problem=no
2724 kernel_version=$(uname -r 2>&1)
2725 echocheck "$system_name kernel version"
2726 case "$kernel_version" in
2727 '') kernel_version="?.??"; _k_verc_fail=yes;;
2728 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2729 _k_verc_problem=yes;;
2730 esac
2731 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2732 _k_verc_fail=yes
2734 if test "$_k_verc_fail" ; then
2735 echores "$kernel_version, fail"
2736 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2737 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2738 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2739 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2740 echo "2.2.x you must upgrade it to get SSE support!"
2741 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2742 else
2743 echores "$kernel_version, ok"
2747 ######################
2748 # MAIN TESTS GO HERE #
2749 ######################
2752 echocheck "-lposix"
2753 if cflag_check -lposix ; then
2754 extra_ldflags="$extra_ldflags -lposix"
2755 echores "yes"
2756 else
2757 echores "no"
2760 echocheck "-lm"
2761 if cflag_check -lm ; then
2762 _ld_lm="-lm"
2763 echores "yes"
2764 else
2765 _ld_lm=""
2766 echores "no"
2770 echocheck "langinfo"
2771 if test "$_langinfo" = auto ; then
2772 _langinfo=no
2773 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2775 if test "$_langinfo" = yes ; then
2776 def_langinfo='#define HAVE_LANGINFO 1'
2777 else
2778 def_langinfo='#undef HAVE_LANGINFO'
2780 echores "$_langinfo"
2783 echocheck "translation support"
2784 if test "$_translation" = yes; then
2785 def_translation="#define CONFIG_TRANSLATION 1"
2786 else
2787 def_translation="#undef CONFIG_TRANSLATION"
2789 echores "$_translation"
2791 echocheck "language"
2792 # Set preferred languages, "all" uses English as main language.
2793 test -z "$language" && language=$LINGUAS
2794 test -z "$language_doc" && language_doc=$language
2795 test -z "$language_man" && language_man=$language
2796 test -z "$language_msg" && language_msg="all"
2797 language_doc=$(echo $language_doc | tr , " ")
2798 language_man=$(echo $language_man | tr , " ")
2799 language_msg=$(echo $language_msg | tr , " ")
2801 test "$language_doc" = "all" && language_doc=$doc_lang_all
2802 test "$language_man" = "all" && language_man=$man_lang_all
2803 test "$language_msg" = "all" && language_msg=$msg_lang_all
2805 if test "$_translation" != yes ; then
2806 language_msg=""
2809 # Prune non-existing translations from language lists.
2810 # Set message translation to the first available language.
2811 # Fall back on English.
2812 for lang in $language_doc ; do
2813 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2814 done
2815 language_doc=$tmp_language_doc
2816 test -z "$language_doc" && language_doc=en
2818 for lang in $language_man ; do
2819 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2820 done
2821 language_man=$tmp_language_man
2822 test -z "$language_man" && language_man=en
2824 for lang in $language_msg ; do
2825 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2826 done
2827 language_msg=$tmp_language_msg
2829 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2832 echocheck "enable sighandler"
2833 if test "$_sighandler" = yes ; then
2834 def_sighandler='#define CONFIG_SIGHANDLER 1'
2835 else
2836 def_sighandler='#undef CONFIG_SIGHANDLER'
2838 echores "$_sighandler"
2840 echocheck "runtime cpudetection"
2841 if test "$_runtime_cpudetection" = yes ; then
2842 _optimizing="Runtime CPU-Detection enabled"
2843 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2844 else
2845 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2847 echores "$_runtime_cpudetection"
2850 echocheck "restrict keyword"
2851 for restrict_keyword in restrict __restrict __restrict__ ; do
2852 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2853 if cc_check; then
2854 def_restrict_keyword=$restrict_keyword
2855 break;
2857 done
2858 if [ -n "$def_restrict_keyword" ]; then
2859 echores "$def_restrict_keyword"
2860 else
2861 echores "none"
2863 # Avoid infinite recursion loop ("#define restrict restrict")
2864 if [ "$def_restrict_keyword" != "restrict" ]; then
2865 def_restrict_keyword="#define restrict $def_restrict_keyword"
2866 else
2867 def_restrict_keyword=""
2871 echocheck "__builtin_expect"
2872 # GCC branch prediction hint
2873 cat > $TMPC << EOF
2874 static int foo(int a) {
2875 a = __builtin_expect(a, 10);
2876 return a == 10 ? 0 : 1;
2878 int main(void) { return foo(10) && foo(0); }
2880 _builtin_expect=no
2881 cc_check && _builtin_expect=yes
2882 if test "$_builtin_expect" = yes ; then
2883 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2884 else
2885 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2887 echores "$_builtin_expect"
2890 echocheck "kstat"
2891 _kstat=no
2892 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2893 if test "$_kstat" = yes ; then
2894 def_kstat="#define HAVE_LIBKSTAT 1"
2895 extra_ldflags="$extra_ldflags -lkstat"
2896 else
2897 def_kstat="#undef HAVE_LIBKSTAT"
2899 echores "$_kstat"
2902 echocheck "posix4"
2903 # required for nanosleep on some systems
2904 _posix4=no
2905 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2906 if test "$_posix4" = yes ; then
2907 extra_ldflags="$extra_ldflags -lposix4"
2909 echores "$_posix4"
2911 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2912 echocheck $func
2913 eval _$func=no
2914 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2915 if eval test "x\$_$func" = "xyes"; then
2916 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2917 echores yes
2918 else
2919 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2920 echores no
2922 done
2925 echocheck "mkstemp"
2926 cat > $TMPC << EOF
2927 #define _XOPEN_SOURCE 500
2928 #include <stdlib.h>
2929 int main(void) { mkstemp(""); return 0; }
2931 _mkstemp=no
2932 cc_check && _mkstemp=yes
2933 if test "$_mkstemp" = yes ; then
2934 def_mkstemp='#define HAVE_MKSTEMP 1'
2935 else
2936 def_mkstemp='#define HAVE_MKSTEMP 0'
2938 echores "$_mkstemp"
2941 echocheck "nanosleep"
2942 _nanosleep=no
2943 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2944 if test "$_nanosleep" = yes ; then
2945 def_nanosleep='#define HAVE_NANOSLEEP 1'
2946 else
2947 def_nanosleep='#undef HAVE_NANOSLEEP'
2949 echores "$_nanosleep"
2952 echocheck "socklib"
2953 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2954 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2955 cat > $TMPC << EOF
2956 #include <netdb.h>
2957 #include <sys/socket.h>
2958 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2960 _socklib=no
2961 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2962 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2963 done
2964 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2965 if test $_winsock2_h = auto ; then
2966 _winsock2_h=no
2967 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2969 test "$_ld_sock" && res_comment="using $_ld_sock"
2970 echores "$_socklib"
2973 if test $_winsock2_h = yes ; then
2974 _ld_sock="-lws2_32"
2975 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2976 else
2977 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2981 echocheck "arpa/inet.h"
2982 arpa_inet_h=no
2983 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2984 header_check arpa/inet.h && arpa_inet_h=yes &&
2985 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2986 echores "$arpa_inet_h"
2989 echocheck "inet_pton()"
2990 def_inet_pton='#define HAVE_INET_PTON 0'
2991 inet_pton=no
2992 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2993 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2994 done
2995 if test $inet_pton = yes ; then
2996 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2997 def_inet_pton='#define HAVE_INET_PTON 1'
2999 echores "$inet_pton"
3002 echocheck "inet_aton()"
3003 def_inet_aton='#define HAVE_INET_ATON 0'
3004 inet_aton=no
3005 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3006 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
3007 done
3008 if test $inet_aton = yes ; then
3009 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3010 def_inet_aton='#define HAVE_INET_ATON 1'
3012 echores "$inet_aton"
3015 echocheck "socklen_t"
3016 _socklen_t=no
3017 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3018 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
3019 done
3020 if test "$_socklen_t" = yes ; then
3021 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3022 else
3023 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3025 echores "$_socklen_t"
3028 echocheck "closesocket()"
3029 _closesocket=no
3030 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
3031 if test "$_closesocket" = yes ; then
3032 def_closesocket='#define HAVE_CLOSESOCKET 1'
3033 else
3034 def_closesocket='#define HAVE_CLOSESOCKET 0'
3036 echores "$_closesocket"
3039 echocheck "networking"
3040 test $_winsock2_h = no && test $inet_pton = no &&
3041 test $inet_aton = no && networking=no
3042 if test "$networking" = yes ; then
3043 def_network='#define CONFIG_NETWORK 1'
3044 def_networking='#define CONFIG_NETWORKING 1'
3045 extra_ldflags="$extra_ldflags $_ld_sock"
3046 inputmodules="networking $inputmodules"
3047 else
3048 noinputmodules="networking $noinputmodules"
3049 def_network='#define CONFIG_NETWORK 0'
3050 def_networking='#undef CONFIG_NETWORKING'
3052 echores "$networking"
3055 echocheck "inet6"
3056 if test "$_inet6" = auto ; then
3057 cat > $TMPC << EOF
3058 #include <sys/types.h>
3059 #if !defined(_WIN32) || defined(__CYGWIN__)
3060 #include <sys/socket.h>
3061 #include <netinet/in.h>
3062 #else
3063 #include <ws2tcpip.h>
3064 #endif
3065 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3067 _inet6=no
3068 if cc_check $_ld_sock ; then
3069 _inet6=yes
3072 if test "$_inet6" = yes ; then
3073 def_inet6='#define HAVE_AF_INET6 1'
3074 else
3075 def_inet6='#undef HAVE_AF_INET6'
3077 echores "$_inet6"
3080 echocheck "gethostbyname2"
3081 if test "$_gethostbyname2" = auto ; then
3082 cat > $TMPC << EOF
3083 #include <sys/types.h>
3084 #include <sys/socket.h>
3085 #include <netdb.h>
3086 int main(void) { gethostbyname2("", AF_INET); return 0; }
3088 _gethostbyname2=no
3089 if cc_check ; then
3090 _gethostbyname2=yes
3093 if test "$_gethostbyname2" = yes ; then
3094 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3095 else
3096 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3098 echores "$_gethostbyname2"
3101 echocheck "inttypes.h (required)"
3102 _inttypes=no
3103 header_check inttypes.h && _inttypes=yes
3104 echores "$_inttypes"
3106 if test "$_inttypes" = no ; then
3107 echocheck "sys/bitypes.h (inttypes.h predecessor)"
3108 header_check sys/bitypes.h && _inttypes=yes
3109 if test "$_inttypes" = yes ; then
3110 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."
3111 else
3112 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3117 echocheck "int_fastXY_t in inttypes.h"
3118 cat > $TMPC << EOF
3119 #include <inttypes.h>
3120 int main(void) { volatile int_fast16_t v = 0; return v; }
3122 _fast_inttypes=no
3123 cc_check && _fast_inttypes=yes
3124 if test "$_fast_inttypes" = no ; then
3125 def_fast_inttypes='
3126 typedef signed char int_fast8_t;
3127 typedef signed int int_fast16_t;
3128 typedef signed int int_fast32_t;
3129 typedef signed long long int_fast64_t;
3130 typedef unsigned char uint_fast8_t;
3131 typedef unsigned int uint_fast16_t;
3132 typedef unsigned int uint_fast32_t;
3133 typedef unsigned long long uint_fast64_t;'
3135 echores "$_fast_inttypes"
3138 echocheck "malloc.h"
3139 _malloc=no
3140 header_check malloc.h && _malloc=yes
3141 if test "$_malloc" = yes ; then
3142 def_malloc_h='#define HAVE_MALLOC_H 1'
3143 else
3144 def_malloc_h='#define HAVE_MALLOC_H 0'
3146 echores "$_malloc"
3149 echocheck "memalign()"
3150 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3151 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3152 _memalign=no
3153 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3154 if test "$_memalign" = yes ; then
3155 def_memalign='#define HAVE_MEMALIGN 1'
3156 else
3157 def_memalign='#define HAVE_MEMALIGN 0'
3158 def_map_memalign='#define memalign(a, b) malloc(b)'
3159 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3161 echores "$_memalign"
3164 echocheck "posix_memalign()"
3165 posix_memalign=no
3166 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3167 cat > $TMPC << EOF
3168 #define _XOPEN_SOURCE 600
3169 #include <stdlib.h>
3170 int main(void) { posix_memalign(NULL, 0, 0); }
3172 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3173 echores "$posix_memalign"
3176 echocheck "alloca.h"
3177 _alloca=no
3178 statement_check alloca.h 'alloca(0)' && _alloca=yes
3179 if cc_check ; then
3180 def_alloca_h='#define HAVE_ALLOCA_H 1'
3181 else
3182 def_alloca_h='#undef HAVE_ALLOCA_H'
3184 echores "$_alloca"
3187 echocheck "fastmemcpy"
3188 if test "$_fastmemcpy" = yes ; then
3189 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3190 else
3191 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3193 echores "$_fastmemcpy"
3196 echocheck "mman.h"
3197 _mman=no
3198 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3199 if test "$_mman" = yes ; then
3200 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3201 else
3202 def_mman_h='#undef HAVE_SYS_MMAN_H'
3203 os2 && _need_mmap=yes
3205 echores "$_mman"
3207 _mman_has_map_failed=no
3208 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
3209 if test "$_mman_has_map_failed" = yes ; then
3210 def_mman_has_map_failed=''
3211 else
3212 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3215 echocheck "dynamic loader"
3216 _dl=no
3217 for _ld_tmp in "" "-ldl"; do
3218 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3219 done
3220 if test "$_dl" = yes ; then
3221 def_dl='#define HAVE_LIBDL 1'
3222 else
3223 def_dl='#undef HAVE_LIBDL'
3225 echores "$_dl"
3228 echocheck "dynamic a/v plugins support"
3229 if test "$_dl" = no ; then
3230 _dynamic_plugins=no
3232 if test "$_dynamic_plugins" = yes ; then
3233 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3234 else
3235 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3237 echores "$_dynamic_plugins"
3240 def_threads='#define HAVE_THREADS 0'
3242 echocheck "pthread"
3243 if linux ; then
3244 THREAD_CFLAGS=-D_REENTRANT
3245 elif freebsd || netbsd || openbsd || bsdos ; then
3246 THREAD_CFLAGS=-D_THREAD_SAFE
3248 if test "$_pthreads" = auto ; then
3249 cat > $TMPC << EOF
3250 #include <pthread.h>
3251 static void *func(void *arg) { return arg; }
3252 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3254 _pthreads=no
3255 if ! hpux ; then
3256 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3257 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3258 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3259 done
3262 if test "$_pthreads" = yes ; then
3263 test $_ld_pthread && res_comment="using $_ld_pthread"
3264 def_pthreads='#define HAVE_PTHREADS 1'
3265 def_threads='#define HAVE_THREADS 1'
3266 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3267 else
3268 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3269 def_pthreads='#undef HAVE_PTHREADS'
3270 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3271 mingw32 || _win32dll=no
3273 echores "$_pthreads"
3275 if cygwin ; then
3276 if test "$_pthreads" = yes ; then
3277 def_pthread_cache="#define PTHREAD_CACHE 1"
3278 else
3279 _stream_cache=no
3280 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3284 echocheck "w32threads"
3285 if test "$_pthreads" = yes ; then
3286 res_comment="using pthread instead"
3287 _w32threads=no
3289 if test "$_w32threads" = auto ; then
3290 _w32threads=no
3291 mingw32 && _w32threads=yes
3293 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3294 echores "$_w32threads"
3296 echocheck "rpath"
3297 if test "$_rpath" = yes ; then
3298 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3299 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3300 done
3301 extra_ldflags=$tmp
3303 echores "$_rpath"
3305 echocheck "iconv"
3306 if test "$_iconv" = auto ; then
3307 cat > $TMPC << EOF
3308 #include <stdio.h>
3309 #include <unistd.h>
3310 #include <iconv.h>
3311 #define INBUFSIZE 1024
3312 #define OUTBUFSIZE 4096
3314 char inbuffer[INBUFSIZE];
3315 char outbuffer[OUTBUFSIZE];
3317 int main(void) {
3318 size_t numread;
3319 iconv_t icdsc;
3320 char *tocode="UTF-8";
3321 char *fromcode="cp1250";
3322 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3323 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3324 char *iptr=inbuffer;
3325 char *optr=outbuffer;
3326 size_t inleft=numread;
3327 size_t outleft=OUTBUFSIZE;
3328 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3329 != (size_t)(-1)) {
3330 write(1, outbuffer, OUTBUFSIZE - outleft);
3333 if (iconv_close(icdsc) == -1)
3336 return 0;
3339 _iconv=no
3340 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3341 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3342 _iconv=yes && break
3343 done
3345 if test "$_iconv" = yes ; then
3346 def_iconv='#define CONFIG_ICONV 1'
3347 else
3348 def_iconv='#undef CONFIG_ICONV'
3350 echores "$_iconv"
3353 echocheck "soundcard.h"
3354 _soundcard_h=no
3355 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3356 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3357 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3358 header_check $_soundcard_header && _soundcard_h=yes &&
3359 res_comment="$_soundcard_header" && break
3360 done
3362 if test "$_soundcard_h" = yes ; then
3363 if test $_soundcard_header = "sys/soundcard.h"; then
3364 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3365 else
3366 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3369 echores "$_soundcard_h"
3372 echocheck "sys/dvdio.h"
3373 _dvdio=no
3374 # FreeBSD 8.1 has broken dvdio.h
3375 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3376 if test "$_dvdio" = yes ; then
3377 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3378 else
3379 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3381 echores "$_dvdio"
3384 echocheck "sys/cdio.h"
3385 _cdio=no
3386 # at least OpenSolaris has a broken cdio.h
3387 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3388 if test "$_cdio" = yes ; then
3389 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3390 else
3391 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3393 echores "$_cdio"
3396 echocheck "linux/cdrom.h"
3397 _cdrom=no
3398 header_check linux/cdrom.h && _cdrom=yes
3399 if test "$_cdrom" = yes ; then
3400 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3401 else
3402 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3404 echores "$_cdrom"
3407 echocheck "dvd.h"
3408 _dvd=no
3409 header_check dvd.h && _dvd=yes
3410 if test "$_dvd" = yes ; then
3411 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3412 else
3413 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3415 echores "$_dvd"
3418 if bsdos; then
3419 echocheck "BSDI dvd.h"
3420 _bsdi_dvd=no
3421 header_check dvd.h && _bsdi_dvd=yes
3422 if test "$_bsdi_dvd" = yes ; then
3423 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3424 else
3425 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3427 echores "$_bsdi_dvd"
3428 fi #if bsdos
3431 if hpux; then
3432 # also used by AIX, but AIX does not support VCD and/or libdvdread
3433 echocheck "HP-UX SCSI header"
3434 _hpux_scsi_h=no
3435 header_check sys/scsi.h && _hpux_scsi_h=yes
3436 if test "$_hpux_scsi_h" = yes ; then
3437 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3438 else
3439 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3441 echores "$_hpux_scsi_h"
3442 fi #if hpux
3445 if sunos; then
3446 echocheck "userspace SCSI headers (Solaris)"
3447 _sol_scsi_h=no
3448 header_check sys/scsi/scsi_types.h &&
3449 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3450 _sol_scsi_h=yes
3451 if test "$_sol_scsi_h" = yes ; then
3452 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3453 else
3454 def_sol_scsi_h='#undef SOLARIS_USCSI'
3456 echores "$_sol_scsi_h"
3457 fi #if sunos
3460 echocheck "termcap"
3461 if test "$_termcap" = auto ; then
3462 _termcap=no
3463 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3464 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3465 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3466 done
3468 if test "$_termcap" = yes ; then
3469 def_termcap='#define HAVE_TERMCAP 1'
3470 test $_ld_tmp && res_comment="using $_ld_tmp"
3471 else
3472 def_termcap='#undef HAVE_TERMCAP'
3474 echores "$_termcap"
3477 echocheck "termios"
3478 def_termios='#undef HAVE_TERMIOS'
3479 def_termios_h='#undef HAVE_TERMIOS_H'
3480 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3481 if test "$_termios" = auto ; then
3482 _termios=no
3483 for _termios_header in "termios.h" "sys/termios.h"; do
3484 header_check $_termios_header && _termios=yes &&
3485 res_comment="using $_termios_header" && break
3486 done
3489 if test "$_termios" = yes ; then
3490 def_termios='#define HAVE_TERMIOS 1'
3491 if test "$_termios_header" = "termios.h" ; then
3492 def_termios_h='#define HAVE_TERMIOS_H 1'
3493 else
3494 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3497 echores "$_termios"
3500 echocheck "shm"
3501 if test "$_shm" = auto ; then
3502 cat > $TMPC << EOF
3503 #include <sys/shm.h>
3504 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3506 _shm=no
3507 cc_check && _shm=yes
3509 if test "$_shm" = yes ; then
3510 def_shm='#define HAVE_SHM 1'
3511 else
3512 def_shm='#undef HAVE_SHM'
3514 echores "$_shm"
3517 echocheck "strsep()"
3518 cat > $TMPC << EOF
3519 #include <string.h>
3520 int main(void) { char *s = "Hello, world!"; strsep(&s, ","); return 0; }
3522 _strsep=no
3523 cc_check && _strsep=yes
3524 if test "$_strsep" = yes ; then
3525 def_strsep='#define HAVE_STRSEP 1'
3526 _need_strsep=no
3527 else
3528 def_strsep='#undef HAVE_STRSEP'
3529 _need_strsep=yes
3531 echores "$_strsep"
3534 echocheck "vsscanf()"
3535 cat > $TMPC << EOF
3536 #define _ISOC99_SOURCE
3537 #include <stdarg.h>
3538 #include <stdio.h>
3539 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3541 _vsscanf=no
3542 cc_check && _vsscanf=yes
3543 if test "$_vsscanf" = yes ; then
3544 def_vsscanf='#define HAVE_VSSCANF 1'
3545 _need_vsscanf=no
3546 else
3547 def_vsscanf='#undef HAVE_VSSCANF'
3548 _need_vsscanf=yes
3550 echores "$_vsscanf"
3553 echocheck "swab()"
3554 cat > $TMPC << EOF
3555 #define _XOPEN_SOURCE 600
3556 #include <unistd.h>
3557 int main(void) { int a, b; swab(&a, &b, 0); return 0; }
3559 _swab=no
3560 cc_check && _swab=yes
3561 if test "$_swab" = yes ; then
3562 def_swab='#define HAVE_SWAB 1'
3563 _need_swab=no
3564 else
3565 def_swab='#undef HAVE_SWAB'
3566 _need_swab=yes
3568 echores "$_swab"
3570 echocheck "POSIX select()"
3571 cat > $TMPC << EOF
3572 #include <stdio.h>
3573 #include <stdlib.h>
3574 #include <sys/types.h>
3575 #include <string.h>
3576 #include <sys/time.h>
3577 #include <unistd.h>
3578 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3580 _posix_select=no
3581 def_posix_select='#undef HAVE_POSIX_SELECT'
3582 #select() of kLIBC (OS/2) supports socket only
3583 ! os2 && cc_check && _posix_select=yes \
3584 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3585 echores "$_posix_select"
3588 echocheck "audio select()"
3589 if test "$_select" = no ; then
3590 def_select='#undef HAVE_AUDIO_SELECT'
3591 elif test "$_select" = yes ; then
3592 def_select='#define HAVE_AUDIO_SELECT 1'
3594 echores "$_select"
3597 echocheck "gettimeofday()"
3598 cat > $TMPC << EOF
3599 #include <sys/time.h>
3600 int main(void) {struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz); return 0; }
3602 _gettimeofday=no
3603 cc_check && _gettimeofday=yes
3604 if test "$_gettimeofday" = yes ; then
3605 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3606 _need_gettimeofday=no
3607 else
3608 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3609 _need_gettimeofday=yes
3611 echores "$_gettimeofday"
3614 echocheck "glob()"
3615 _glob=no
3616 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3617 if test "$_glob" = yes ; then
3618 def_glob='#define HAVE_GLOB 1'
3619 _need_glob=no
3620 else
3621 def_glob='#undef HAVE_GLOB'
3622 _need_glob=yes
3624 echores "$_glob"
3627 echocheck "setenv()"
3628 _setenv=no
3629 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3630 if test "$_setenv" = yes ; then
3631 def_setenv='#define HAVE_SETENV 1'
3632 _need_setenv=no
3633 else
3634 def_setenv='#undef HAVE_SETENV'
3635 _need_setenv=yes
3637 echores "$_setenv"
3640 echocheck "setmode()"
3641 _setmode=no
3642 def_setmode='#define HAVE_SETMODE 0'
3643 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3644 echores "$_setmode"
3647 if sunos; then
3648 echocheck "sysi86()"
3649 _sysi86=no
3650 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3651 if test "$_sysi86" = yes ; then
3652 def_sysi86='#define HAVE_SYSI86 1'
3653 cat > $TMPC << EOF
3654 #include <sys/sysi86.h>
3655 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3657 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3658 else
3659 def_sysi86='#undef HAVE_SYSI86'
3661 echores "$_sysi86"
3662 fi #if sunos
3665 echocheck "sys/sysinfo.h"
3666 cat > $TMPC << EOF
3667 #include <sys/sysinfo.h>
3668 int main(void) { struct sysinfo s_info; sysinfo(&s_info); return 0; }
3670 _sys_sysinfo=no
3671 cc_check && _sys_sysinfo=yes
3672 if test "$_sys_sysinfo" = yes ; then
3673 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3674 else
3675 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3677 echores "$_sys_sysinfo"
3680 if darwin; then
3682 echocheck "Mac OS X Finder Support"
3683 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3684 if test "$_macosx_finder" = yes ; then
3685 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3686 extra_ldflags="$extra_ldflags -framework Carbon"
3688 echores "$_macosx_finder"
3690 echocheck "Mac OS X Bundle file locations"
3691 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3692 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3693 if test "$_macosx_bundle" = yes ; then
3694 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3695 extra_ldflags="$extra_ldflags -framework Carbon"
3697 echores "$_macosx_bundle"
3699 echocheck "Apple Remote"
3700 if test "$_apple_remote" = auto ; then
3701 _apple_remote=no
3702 cat > $TMPC <<EOF
3703 #include <stdio.h>
3704 #include <IOKit/IOCFPlugIn.h>
3705 int main(void) {
3706 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3707 CFMutableDictionaryRef hidMatchDictionary;
3708 IOReturn ioReturnValue;
3710 // Set up a matching dictionary to search the I/O Registry by class.
3711 // name for all HID class devices
3712 hidMatchDictionary = IOServiceMatching("AppleIRController");
3714 // Now search I/O Registry for matching devices.
3715 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3716 hidMatchDictionary, &hidObjectIterator);
3718 // If search is unsuccessful, return nonzero.
3719 if (ioReturnValue != kIOReturnSuccess ||
3720 !IOIteratorIsValid(hidObjectIterator)) {
3721 return 1;
3723 return 0;
3726 cc_check -framework IOKit && _apple_remote=yes
3728 if test "$_apple_remote" = yes ; then
3729 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3730 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3731 else
3732 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3734 echores "$_apple_remote"
3736 fi #if darwin
3738 if linux; then
3740 echocheck "Apple IR"
3741 if test "$_apple_ir" = auto ; then
3742 _apple_ir=no
3743 cat > $TMPC <<EOF
3744 #include <linux/input.h>
3745 int main(void) { struct input_event ev; struct input_id id; return 0; }
3747 cc_check && _apple_ir=yes
3749 if test "$_apple_ir" = yes ; then
3750 def_apple_ir='#define CONFIG_APPLE_IR 1'
3751 else
3752 def_apple_ir='#undef CONFIG_APPLE_IR'
3754 echores "$_apple_ir"
3755 fi #if linux
3757 echocheck "pkg-config"
3758 _pkg_config=pkg-config
3759 if $($_pkg_config --version > /dev/null 2>&1); then
3760 if test "$_ld_static"; then
3761 _pkg_config="$_pkg_config --static"
3763 echores "yes"
3764 else
3765 _pkg_config=false
3766 echores "no"
3770 echocheck "Samba support (libsmbclient)"
3771 if test "$_smb" = yes; then
3772 extra_ldflags="$extra_ldflags -lsmbclient"
3774 if test "$_smb" = auto; then
3775 _smb=no
3776 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3777 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3778 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3779 done
3782 if test "$_smb" = yes; then
3783 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3784 inputmodules="smb $inputmodules"
3785 else
3786 def_smb="#undef CONFIG_LIBSMBCLIENT"
3787 noinputmodules="smb $noinputmodules"
3789 echores "$_smb"
3792 #########
3793 # VIDEO #
3794 #########
3797 echocheck "tdfxfb"
3798 if test "$_tdfxfb" = yes ; then
3799 def_tdfxfb='#define CONFIG_TDFXFB 1'
3800 vomodules="tdfxfb $vomodules"
3801 else
3802 def_tdfxfb='#undef CONFIG_TDFXFB'
3803 novomodules="tdfxfb $novomodules"
3805 echores "$_tdfxfb"
3807 echocheck "s3fb"
3808 if test "$_s3fb" = yes ; then
3809 def_s3fb='#define CONFIG_S3FB 1'
3810 vomodules="s3fb $vomodules"
3811 else
3812 def_s3fb='#undef CONFIG_S3FB'
3813 novomodules="s3fb $novomodules"
3815 echores "$_s3fb"
3817 echocheck "wii"
3818 if test "$_wii" = yes ; then
3819 def_wii='#define CONFIG_WII 1'
3820 vomodules="wii $vomodules"
3821 else
3822 def_wii='#undef CONFIG_WII'
3823 novomodules="wii $novomodules"
3825 echores "$_wii"
3827 echocheck "tdfxvid"
3828 if test "$_tdfxvid" = yes ; then
3829 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3830 vomodules="tdfx_vid $vomodules"
3831 else
3832 def_tdfxvid='#undef CONFIG_TDFX_VID'
3833 novomodules="tdfx_vid $novomodules"
3835 echores "$_tdfxvid"
3837 echocheck "xvr100"
3838 if test "$_xvr100" = auto ; then
3839 cat > $TMPC << EOF
3840 #include <unistd.h>
3841 #include <sys/fbio.h>
3842 #include <sys/visual_io.h>
3843 int main(void) {
3844 struct vis_identifier ident;
3845 struct fbgattr attr;
3846 ioctl(0, VIS_GETIDENTIFIER, &ident);
3847 ioctl(0, FBIOGATTR, &attr);
3848 return 0;
3851 _xvr100=no
3852 cc_check && _xvr100=yes
3854 if test "$_xvr100" = yes ; then
3855 def_xvr100='#define CONFIG_XVR100 1'
3856 vomodules="xvr100 $vomodules"
3857 else
3858 def_tdfxvid='#undef CONFIG_XVR100'
3859 novomodules="xvr100 $novomodules"
3861 echores "$_xvr100"
3863 echocheck "tga"
3864 if test "$_tga" = yes ; then
3865 def_tga='#define CONFIG_TGA 1'
3866 vomodules="tga $vomodules"
3867 else
3868 def_tga='#undef CONFIG_TGA'
3869 novomodules="tga $novomodules"
3871 echores "$_tga"
3874 echocheck "md5sum support"
3875 if test "$_md5sum" = yes; then
3876 def_md5sum="#define CONFIG_MD5SUM 1"
3877 vomodules="md5sum $vomodules"
3878 else
3879 def_md5sum="#undef CONFIG_MD5SUM"
3880 novomodules="md5sum $novomodules"
3882 echores "$_md5sum"
3885 echocheck "yuv4mpeg support"
3886 if test "$_yuv4mpeg" = yes; then
3887 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3888 vomodules="yuv4mpeg $vomodules"
3889 else
3890 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3891 novomodules="yuv4mpeg $novomodules"
3893 echores "$_yuv4mpeg"
3896 echocheck "bl"
3897 if test "$_bl" = yes ; then
3898 def_bl='#define CONFIG_BL 1'
3899 vomodules="bl $vomodules"
3900 else
3901 def_bl='#undef CONFIG_BL'
3902 novomodules="bl $novomodules"
3904 echores "$_bl"
3907 echocheck "DirectFB"
3908 if test "$_directfb" = auto ; then
3909 _directfb=no
3910 cat > $TMPC << EOF
3911 #include <directfb.h>
3912 #include <directfb_version.h>
3913 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3914 #error "DirectFB version too old."
3915 #endif
3916 int main(void) { DirectFBInit(0, 0); return 0; }
3918 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3919 cc_check $_inc_tmp -ldirectfb &&
3920 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3921 done
3923 if test "$_directfb" = yes ; then
3924 def_directfb='#define CONFIG_DIRECTFB 1'
3925 vomodules="directfb dfbmga $vomodules"
3926 libs_mplayer="$libs_mplayer -ldirectfb"
3927 else
3928 def_directfb='#undef CONFIG_DIRECTFB'
3929 novomodules="directfb dfbmga $novomodules"
3931 echores "$_directfb"
3934 echocheck "X11 headers presence"
3935 _x11_headers="no"
3936 res_comment="check if the dev(el) packages are installed"
3937 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3938 if test -f "$I/X11/Xlib.h" ; then
3939 _x11_headers="yes"
3940 res_comment=""
3941 break
3943 done
3944 if test $_cross_compile = no; then
3945 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3946 /usr/include/X11R6 /usr/openwin/include ; do
3947 if test -f "$I/X11/Xlib.h" ; then
3948 extra_cflags="$extra_cflags -I$I"
3949 _x11_headers="yes"
3950 res_comment="using $I"
3951 break
3953 done
3955 echores "$_x11_headers"
3958 echocheck "X11"
3959 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3960 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3961 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3962 -L/usr/lib ; do
3963 if netbsd; then
3964 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3965 else
3966 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3968 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3969 libs_mplayer="$libs_mplayer $_ld_tmp" && _x11=yes && break
3970 done
3972 if test "$_x11" = yes ; then
3973 def_x11='#define CONFIG_X11 1'
3974 vomodules="x11 xover $vomodules"
3975 else
3976 _x11=no
3977 def_x11='#undef CONFIG_X11'
3978 novomodules="x11 $novomodules"
3979 res_comment="check if the dev(el) packages are installed"
3980 # disable stuff that depends on X
3981 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
3983 echores "$_x11"
3985 echocheck "Xss screensaver extensions"
3986 if test "$_xss" = auto ; then
3987 cat > $TMPC << EOF
3988 #include <X11/Xlib.h>
3989 #include <X11/extensions/scrnsaver.h>
3990 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
3992 _xss=no
3993 cc_check -lXss && _xss=yes
3995 if test "$_xss" = yes ; then
3996 def_xss='#define CONFIG_XSS 1'
3997 libs_mplayer="$libs_mplayer -lXss"
3998 else
3999 def_xss='#undef CONFIG_XSS'
4001 echores "$_xss"
4003 echocheck "DPMS"
4004 _xdpms3=no
4005 _xdpms4=no
4006 if test "$_x11" = yes ; then
4007 cat > $TMPC <<EOF
4008 #include <X11/Xmd.h>
4009 #include <X11/Xlib.h>
4010 #include <X11/Xutil.h>
4011 #include <X11/Xatom.h>
4012 #include <X11/extensions/dpms.h>
4013 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
4015 cc_check -lXdpms && _xdpms3=yes
4016 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
4018 if test "$_xdpms4" = yes ; then
4019 def_xdpms='#define CONFIG_XDPMS 1'
4020 res_comment="using Xdpms 4"
4021 echores "yes"
4022 elif test "$_xdpms3" = yes ; then
4023 def_xdpms='#define CONFIG_XDPMS 1'
4024 libs_mplayer="$libs_mplayer -lXdpms"
4025 res_comment="using Xdpms 3"
4026 echores "yes"
4027 else
4028 def_xdpms='#undef CONFIG_XDPMS'
4029 echores "no"
4033 echocheck "Xv"
4034 if test "$_xv" = auto ; then
4035 _xv=no
4036 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
4039 if test "$_xv" = yes ; then
4040 def_xv='#define CONFIG_XV 1'
4041 libs_mplayer="$libs_mplayer -lXv"
4042 vomodules="xv $vomodules"
4043 else
4044 def_xv='#undef CONFIG_XV'
4045 novomodules="xv $novomodules"
4047 echores "$_xv"
4050 echocheck "XvMC"
4051 if test "$_xv" = yes && test "$_xvmc" != no ; then
4052 _xvmc=no
4053 cat > $TMPC <<EOF
4054 #include <X11/Xlib.h>
4055 #include <X11/extensions/Xvlib.h>
4056 #include <X11/extensions/XvMClib.h>
4057 int main(void) {
4058 XvMCQueryExtension(0, 0, 0);
4059 XvMCCreateContext(0, 0, 0, 0, 0, 0, 0);
4060 return 0; }
4062 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4063 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4064 done
4066 if test "$_xvmc" = yes ; then
4067 def_xvmc='#define CONFIG_XVMC 1'
4068 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4069 vomodules="xvmc $vomodules"
4070 res_comment="using $_xvmclib"
4071 else
4072 def_xvmc='#define CONFIG_XVMC 0'
4073 novomodules="xvmc $novomodules"
4075 echores "$_xvmc"
4078 echocheck "VDPAU"
4079 if test "$_vdpau" = auto ; then
4080 _vdpau=no
4081 if test "$_dl" = yes ; then
4082 cat > $TMPC <<EOF
4083 #include <vdpau/vdpau_x11.h>
4084 int main(void) {
4085 vdp_device_create_x11(0, 0, 0, 0);
4086 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4088 cc_check -lvdpau && _vdpau=yes
4091 if test "$_vdpau" = yes ; then
4092 def_vdpau='#define CONFIG_VDPAU 1'
4093 libs_mplayer="$libs_mplayer -lvdpau"
4094 vomodules="vdpau $vomodules"
4095 else
4096 def_vdpau='#define CONFIG_VDPAU 0'
4097 novomodules="vdpau $novomodules"
4099 echores "$_vdpau"
4102 echocheck "Xinerama"
4103 if test "$_xinerama" = auto ; then
4104 _xinerama=no
4105 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
4108 if test "$_xinerama" = yes ; then
4109 def_xinerama='#define CONFIG_XINERAMA 1'
4110 libs_mplayer="$libs_mplayer -lXinerama"
4111 else
4112 def_xinerama='#undef CONFIG_XINERAMA'
4114 echores "$_xinerama"
4117 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4118 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4119 # named 'X extensions' or something similar.
4120 # This check may be useful for future mplayer versions (to change resolution)
4121 # If you run into problems, remove '-lXxf86vm'.
4122 echocheck "Xxf86vm"
4123 if test "$_vm" = auto ; then
4124 _vm=no
4125 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
4127 if test "$_vm" = yes ; then
4128 def_vm='#define CONFIG_XF86VM 1'
4129 libs_mplayer="$libs_mplayer -lXxf86vm"
4130 else
4131 def_vm='#undef CONFIG_XF86VM'
4133 echores "$_vm"
4135 # Check for the presence of special keycodes, like audio control buttons
4136 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4137 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4138 # have these new keycodes.
4139 echocheck "XF86keysym"
4140 if test "$_xf86keysym" = auto; then
4141 _xf86keysym=no
4142 cat > $TMPC <<EOF
4143 #include <X11/XF86keysym.h>
4144 int main(void) { return XF86XK_AudioPause; }
4146 cc_check && _xf86keysym=yes
4148 if test "$_xf86keysym" = yes ; then
4149 def_xf86keysym='#define CONFIG_XF86XK 1'
4150 else
4151 def_xf86keysym='#undef CONFIG_XF86XK'
4153 echores "$_xf86keysym"
4155 echocheck "DGA"
4156 if test "$_dga2" = auto && test "$_x11" = yes ; then
4157 _dga2=no
4158 statement_check_broken X11/Xlib.h X11/extensions/xf86dga.h 'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2=yes
4160 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4161 _dga1=no
4162 statement_check_broken X11/Xlib.h X11/extensions/xf86dga.h 'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1=yes
4165 _dga=no
4166 def_dga='#undef CONFIG_DGA'
4167 def_dga1='#undef CONFIG_DGA1'
4168 def_dga2='#undef CONFIG_DGA2'
4169 if test "$_dga1" = yes ; then
4170 _dga=yes
4171 def_dga1='#define CONFIG_DGA1 1'
4172 res_comment="using DGA 1.0"
4173 elif test "$_dga2" = yes ; then
4174 _dga=yes
4175 def_dga2='#define CONFIG_DGA2 1'
4176 res_comment="using DGA 2.0"
4178 if test "$_dga" = yes ; then
4179 def_dga='#define CONFIG_DGA 1'
4180 libs_mplayer="$libs_mplayer -lXxf86dga"
4181 vomodules="dga $vomodules"
4182 else
4183 novomodules="dga $novomodules"
4185 echores "$_dga"
4188 echocheck "3dfx"
4189 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4190 def_3dfx='#define CONFIG_3DFX 1'
4191 vomodules="3dfx $vomodules"
4192 else
4193 def_3dfx='#undef CONFIG_3DFX'
4194 novomodules="3dfx $novomodules"
4196 echores "$_3dfx"
4199 echocheck "VIDIX"
4200 def_vidix='#undef CONFIG_VIDIX'
4201 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4202 _vidix_drv_cyberblade=no
4203 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4204 _vidix_drv_ivtv=no
4205 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4206 _vidix_drv_mach64=no
4207 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4208 _vidix_drv_mga=no
4209 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4210 _vidix_drv_mga_crtc2=no
4211 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4212 _vidix_drv_nvidia=no
4213 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4214 _vidix_drv_pm2=no
4215 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4216 _vidix_drv_pm3=no
4217 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4218 _vidix_drv_radeon=no
4219 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4220 _vidix_drv_rage128=no
4221 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4222 _vidix_drv_s3=no
4223 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4224 _vidix_drv_sh_veu=no
4225 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4226 _vidix_drv_sis=no
4227 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4228 _vidix_drv_unichrome=no
4229 if test "$_vidix" = auto ; then
4230 _vidix=no
4231 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4232 && _vidix=yes
4233 x86_64 && ! linux && _vidix=no
4234 (ppc || alpha) && linux && _vidix=yes
4236 echores "$_vidix"
4238 if test "$_vidix" = yes ; then
4239 def_vidix='#define CONFIG_VIDIX 1'
4240 vomodules="cvidix $vomodules"
4241 # FIXME: ivtv driver temporarily disabled until we have a proper test
4242 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4243 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4245 # some vidix drivers are architecture and os specific, discard them elsewhere
4246 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4247 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4249 for driver in $_vidix_drivers ; do
4250 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4251 eval _vidix_drv_${driver}=yes
4252 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4253 done
4255 echocheck "VIDIX PCI device name database"
4256 echores "$_vidix_pcidb"
4257 if test "$_vidix_pcidb" = yes ; then
4258 _vidix_pcidb_val=1
4259 else
4260 _vidix_pcidb_val=0
4263 echocheck "VIDIX dhahelper support"
4264 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4265 echores "$_dhahelper"
4267 echocheck "VIDIX svgalib_helper support"
4268 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4269 echores "$_svgalib_helper"
4271 else
4272 novomodules="cvidix $novomodules"
4275 if test "$_vidix" = yes && win32; then
4276 winvidix=yes
4277 vomodules="winvidix $vomodules"
4278 libs_mplayer="$libs_mplayer -lgdi32"
4279 else
4280 novomodules="winvidix $novomodules"
4282 if test "$_vidix" = yes && test "$_x11" = yes; then
4283 xvidix=yes
4284 vomodules="xvidix $vomodules"
4285 else
4286 novomodules="xvidix $novomodules"
4289 echocheck "GGI"
4290 if test "$_ggi" = auto ; then
4291 _ggi=no
4292 statement_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4294 if test "$_ggi" = yes ; then
4295 def_ggi='#define CONFIG_GGI 1'
4296 libs_mplayer="$libs_mplayer -lggi"
4297 vomodules="ggi $vomodules"
4298 else
4299 def_ggi='#undef CONFIG_GGI'
4300 novomodules="ggi $novomodules"
4302 echores "$_ggi"
4304 echocheck "GGI extension: libggiwmh"
4305 if test "$_ggiwmh" = auto ; then
4306 _ggiwmh=no
4307 statement_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4309 # needed to get right output on obscure combination
4310 # like --disable-ggi --enable-ggiwmh
4311 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4312 def_ggiwmh='#define CONFIG_GGIWMH 1'
4313 libs_mplayer="$libs_mplayer -lggiwmh"
4314 else
4315 _ggiwmh=no
4316 def_ggiwmh='#undef CONFIG_GGIWMH'
4318 echores "$_ggiwmh"
4321 echocheck "AA"
4322 if test "$_aa" = auto ; then
4323 cat > $TMPC << EOF
4324 #include <aalib.h>
4325 int main(void) {
4326 aa_context *c;
4327 aa_renderparams *p;
4328 aa_init(0, 0, 0);
4329 c = aa_autoinit(&aa_defparams);
4330 p = aa_getrenderparams();
4331 aa_autoinitkbd(c, 0);
4332 return 0; }
4334 _aa=no
4335 for _ld_tmp in "-laa" ; do
4336 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4337 done
4339 if test "$_aa" = yes ; then
4340 def_aa='#define CONFIG_AA 1'
4341 if cygwin ; then
4342 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4344 vomodules="aa $vomodules"
4345 else
4346 def_aa='#undef CONFIG_AA'
4347 novomodules="aa $novomodules"
4349 echores "$_aa"
4352 echocheck "CACA"
4353 if test "$_caca" = auto ; then
4354 _caca=no
4355 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4356 cat > $TMPC << EOF
4357 #include <caca.h>
4358 #ifdef CACA_API_VERSION_1
4359 #include <caca0.h>
4360 #endif
4361 int main(void) { caca_init(); return 0; }
4363 cc_check $(caca-config --libs) && _caca=yes
4366 if test "$_caca" = yes ; then
4367 def_caca='#define CONFIG_CACA 1'
4368 extra_cflags="$extra_cflags $(caca-config --cflags)"
4369 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4370 vomodules="caca $vomodules"
4371 else
4372 def_caca='#undef CONFIG_CACA'
4373 novomodules="caca $novomodules"
4375 echores "$_caca"
4378 echocheck "SVGAlib"
4379 if test "$_svga" = auto ; then
4380 _svga=no
4381 header_check vga.h -lvga $_ld_lm && _svga=yes
4383 if test "$_svga" = yes ; then
4384 def_svga='#define CONFIG_SVGALIB 1'
4385 libs_mplayer="$libs_mplayer -lvga"
4386 vomodules="svga $vomodules"
4387 else
4388 def_svga='#undef CONFIG_SVGALIB'
4389 novomodules="svga $novomodules"
4391 echores "$_svga"
4394 echocheck "FBDev"
4395 if test "$_fbdev" = auto ; then
4396 _fbdev=no
4397 linux && _fbdev=yes
4399 if test "$_fbdev" = yes ; then
4400 def_fbdev='#define CONFIG_FBDEV 1'
4401 vomodules="fbdev $vomodules"
4402 else
4403 def_fbdev='#undef CONFIG_FBDEV'
4404 novomodules="fbdev $novomodules"
4406 echores "$_fbdev"
4410 echocheck "DVB"
4411 if test "$_dvb" = auto ; then
4412 _dvb=no
4413 cat >$TMPC << EOF
4414 #include <poll.h>
4415 #include <sys/ioctl.h>
4416 #include <stdio.h>
4417 #include <time.h>
4418 #include <unistd.h>
4419 #include <linux/dvb/dmx.h>
4420 #include <linux/dvb/frontend.h>
4421 #include <linux/dvb/video.h>
4422 #include <linux/dvb/audio.h>
4423 int main(void) {return 0;}
4425 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4426 cc_check $_inc_tmp && _dvb=yes && \
4427 extra_cflags="$extra_cflags $_inc_tmp" && break
4428 done
4430 echores "$_dvb"
4431 if test "$_dvb" = yes ; then
4432 _dvbin=yes
4433 inputmodules="dvb $inputmodules"
4434 def_dvb='#define CONFIG_DVB 1'
4435 def_dvbin='#define CONFIG_DVBIN 1'
4436 aomodules="mpegpes(dvb) $aomodules"
4437 vomodules="mpegpes(dvb) $vomodules"
4438 else
4439 _dvbin=no
4440 noinputmodules="dvb $noinputmodules"
4441 def_dvb='#undef CONFIG_DVB'
4442 def_dvbin='#undef CONFIG_DVBIN '
4443 aomodules="mpegpes(file) $aomodules"
4444 vomodules="mpegpes(file) $vomodules"
4448 if darwin; then
4450 echocheck "QuickTime"
4451 if test "$quicktime" = auto ; then
4452 cat > $TMPC <<EOF
4453 #include <QuickTime/QuickTime.h>
4454 int main(void) {
4455 ImageDescription *desc;
4456 EnterMovies();
4457 ExitMovies();
4458 return 0;
4461 quicktime=no
4462 cc_check -framework QuickTime && quicktime=yes
4464 if test "$quicktime" = yes ; then
4465 extra_ldflags="$extra_ldflags -framework QuickTime"
4466 def_quicktime='#define CONFIG_QUICKTIME 1'
4467 else
4468 def_quicktime='#undef CONFIG_QUICKTIME'
4469 _quartz=no
4471 echores $quicktime
4473 echocheck "Quartz"
4474 if test "$_quartz" = auto ; then
4475 _quartz=no
4476 statement_check Carbon/Carbon.h 'CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false)' -framework Carbon && _quartz=yes
4478 if test "$_quartz" = yes ; then
4479 libs_mplayer="$libs_mplayer -framework Carbon"
4480 def_quartz='#define CONFIG_QUARTZ 1'
4481 vomodules="quartz $vomodules"
4482 else
4483 def_quartz='#undef CONFIG_QUARTZ'
4484 novomodules="quartz $novomodules"
4486 echores $_quartz
4488 echocheck "CoreVideo"
4489 if test "$_corevideo" = auto ; then
4490 cat > $TMPC <<EOF
4491 #include <Carbon/Carbon.h>
4492 #include <CoreServices/CoreServices.h>
4493 #include <OpenGL/OpenGL.h>
4494 #include <QuartzCore/CoreVideo.h>
4495 int main(void) { return 0; }
4497 _corevideo=no
4498 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4500 if test "$_corevideo" = yes ; then
4501 vomodules="corevideo $vomodules"
4502 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4503 def_corevideo='#define CONFIG_COREVIDEO 1'
4504 else
4505 novomodules="corevideo $novomodules"
4506 def_corevideo='#undef CONFIG_COREVIDEO'
4508 echores "$_corevideo"
4510 fi #if darwin
4513 echocheck "PNG support"
4514 if test "$_png" = auto ; then
4515 _png=no
4516 if irix ; then
4517 # Don't check for -lpng on irix since it has its own libpng
4518 # incompatible with the GNU libpng
4519 res_comment="disabled on irix (not GNU libpng)"
4520 else
4521 cat > $TMPC << EOF
4522 #include <stdio.h>
4523 #include <string.h>
4524 #include <png.h>
4525 int main(void) {
4526 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4527 printf("libpng: %s\n", png_libpng_ver);
4528 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4531 cc_check -lpng -lz $_ld_lm && _png=yes
4534 echores "$_png"
4535 if test "$_png" = yes ; then
4536 def_png='#define CONFIG_PNG 1'
4537 extra_ldflags="$extra_ldflags -lpng -lz"
4538 else
4539 def_png='#undef CONFIG_PNG'
4542 echocheck "MNG support"
4543 if test "$_mng" = auto ; then
4544 _mng=no
4545 cat > $TMPC << EOF
4546 #include <libmng.h>
4547 int main(void) {
4548 const char * p_ver = mng_version_text();
4549 return !p_ver || p_ver[0] == 0;
4552 if cc_check -lmng -lz $_ld_lm ; then
4553 _mng=yes
4556 echores "$_mng"
4557 if test "$_mng" = yes ; then
4558 def_mng='#define CONFIG_MNG 1'
4559 extra_ldflags="$extra_ldflags -lmng -lz"
4560 else
4561 def_mng='#undef CONFIG_MNG'
4564 echocheck "JPEG support"
4565 if test "$_jpeg" = auto ; then
4566 _jpeg=no
4567 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
4569 echores "$_jpeg"
4571 if test "$_jpeg" = yes ; then
4572 def_jpeg='#define CONFIG_JPEG 1'
4573 vomodules="jpeg $vomodules"
4574 extra_ldflags="$extra_ldflags -ljpeg"
4575 else
4576 def_jpeg='#undef CONFIG_JPEG'
4577 novomodules="jpeg $novomodules"
4582 echocheck "PNM support"
4583 if test "$_pnm" = yes; then
4584 def_pnm="#define CONFIG_PNM 1"
4585 vomodules="pnm $vomodules"
4586 else
4587 def_pnm="#undef CONFIG_PNM"
4588 novomodules="pnm $novomodules"
4590 echores "$_pnm"
4594 echocheck "GIF support"
4595 # This is to appease people who want to force gif support.
4596 # If it is forced to yes, then we still do checks to determine
4597 # which gif library to use.
4598 if test "$_gif" = yes ; then
4599 _force_gif=yes
4600 _gif=auto
4603 if test "$_gif" = auto ; then
4604 _gif=no
4605 for _ld_gif in "-lungif" "-lgif" ; do
4606 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4607 done
4610 # If no library was found, and the user wants support forced,
4611 # then we force it on with libgif, as this is the safest
4612 # assumption IMHO. (libungif & libregif both create symbolic
4613 # links to libgif. We also assume that no x11 support is needed,
4614 # because if you are forcing this, then you _should_ know what
4615 # you are doing. [ Besides, package maintainers should never
4616 # have compiled x11 deps into libungif in the first place. ] )
4617 # </rant>
4618 # --Joey
4619 if test "$_force_gif" = yes && test "$_gif" = no ; then
4620 _gif=yes
4621 _ld_gif="-lgif"
4624 if test "$_gif" = yes ; then
4625 def_gif='#define CONFIG_GIF 1'
4626 codecmodules="gif $codecmodules"
4627 vomodules="gif89a $vomodules"
4628 res_comment="old version, some encoding functions disabled"
4629 def_gif_4='#undef CONFIG_GIF_4'
4630 extra_ldflags="$extra_ldflags $_ld_gif"
4632 cat > $TMPC << EOF
4633 #include <signal.h>
4634 #include <stdio.h>
4635 #include <stdlib.h>
4636 #include <gif_lib.h>
4637 static void catch(int sig) { exit(1); }
4638 int main(void) {
4639 signal(SIGSEGV, catch); // catch segfault
4640 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4641 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4642 return 0;
4645 if cc_check "$_ld_gif" ; then
4646 def_gif_4='#define CONFIG_GIF_4 1'
4647 res_comment=""
4649 else
4650 def_gif='#undef CONFIG_GIF'
4651 def_gif_4='#undef CONFIG_GIF_4'
4652 novomodules="gif89a $novomodules"
4653 nocodecmodules="gif $nocodecmodules"
4655 echores "$_gif"
4658 case "$_gif" in yes*)
4659 echocheck "broken giflib workaround"
4660 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4662 cat > $TMPC << EOF
4663 #include <stdio.h>
4664 #include <gif_lib.h>
4665 int main(void) {
4666 GifFileType gif = {.UserData = NULL};
4667 printf("UserData is at address %p\n", gif.UserData);
4668 return 0;
4671 if cc_check "$_ld_gif" ; then
4672 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4673 echores "disabled"
4674 else
4675 echores "enabled"
4678 esac
4681 echocheck "VESA support"
4682 if test "$_vesa" = auto ; then
4683 _vesa=no
4684 statement_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4686 if test "$_vesa" = yes ; then
4687 def_vesa='#define CONFIG_VESA 1'
4688 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4689 vomodules="vesa $vomodules"
4690 else
4691 def_vesa='#undef CONFIG_VESA'
4692 novomodules="vesa $novomodules"
4694 echores "$_vesa"
4696 #################
4697 # VIDEO + AUDIO #
4698 #################
4701 echocheck "SDL"
4702 _inc_tmp=""
4703 _ld_tmp=""
4704 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4705 if test -z "$_sdlconfig" ; then
4706 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4707 _sdlconfig="sdl-config"
4708 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4709 _sdlconfig="sdl11-config"
4710 else
4711 _sdlconfig=false
4714 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4715 cat > $TMPC << EOF
4716 #ifdef CONFIG_SDL_SDL_H
4717 #include <SDL/SDL.h>
4718 #else
4719 #include <SDL.h>
4720 #endif
4721 #ifndef __APPLE__
4722 // we allow SDL hacking our main() only on OSX
4723 #undef main
4724 #endif
4725 int main(int argc, char *argv[]) {
4726 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4727 return 0;
4730 _sdl=no
4731 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4732 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4733 _sdl=yes
4734 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4735 break
4737 done
4738 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4739 res_comment="using $_sdlconfig"
4740 if cygwin ; then
4741 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4742 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4743 elif mingw32 ; then
4744 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4745 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4746 else
4747 _inc_tmp="$($_sdlconfig --cflags)"
4748 _ld_tmp="$($_sdlconfig --libs)"
4750 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4751 _sdl=yes
4752 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4753 # HACK for BeOS/Haiku SDL
4754 _ld_tmp="$_ld_tmp -lstdc++"
4755 _sdl=yes
4759 if test "$_sdl" = yes ; then
4760 def_sdl='#define CONFIG_SDL 1'
4761 extra_cflags="$extra_cflags $_inc_tmp"
4762 libs_mplayer="$libs_mplayer $_ld_tmp"
4763 vomodules="sdl $vomodules"
4764 aomodules="sdl $aomodules"
4765 else
4766 def_sdl='#undef CONFIG_SDL'
4767 novomodules="sdl $novomodules"
4768 noaomodules="sdl $noaomodules"
4770 echores "$_sdl"
4773 # make sure this stays below CoreVideo to avoid issues due to namespace
4774 # conflicts between -lGL and -framework OpenGL
4775 echocheck "OpenGL"
4776 #Note: this test is run even with --enable-gl since we autodetect linker flags
4777 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
4778 cat > $TMPC << EOF
4779 #ifdef GL_WIN32
4780 #include <windows.h>
4781 #include <GL/gl.h>
4782 #elif defined(GL_SDL)
4783 #include <GL/gl.h>
4784 #ifdef CONFIG_SDL_SDL_H
4785 #include <SDL/SDL.h>
4786 #else
4787 #include <SDL.h>
4788 #endif
4789 #ifndef __APPLE__
4790 // we allow SDL hacking our main() only on OSX
4791 #undef main
4792 #endif
4793 #else
4794 #include <GL/gl.h>
4795 #include <X11/Xlib.h>
4796 #include <GL/glx.h>
4797 #endif
4798 int main(int argc, char *argv[]) {
4799 #ifdef GL_WIN32
4800 HDC dc;
4801 wglCreateContext(dc);
4802 #elif defined(GL_SDL)
4803 SDL_GL_SwapBuffers();
4804 #else
4805 glXCreateContext(NULL, NULL, NULL, True);
4806 #endif
4807 glFinish();
4808 return 0;
4811 _gl=no
4812 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4813 if cc_check $_ld_tmp $_ld_lm ; then
4814 _gl=yes
4815 _gl_x11=yes
4816 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4817 break
4819 done
4820 if cc_check -DGL_WIN32 -lopengl32 ; then
4821 _gl=yes
4822 _gl_win32=yes
4823 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4825 # last so it can reuse any linker etc. flags detected before
4826 if test "$_sdl" = yes ; then
4827 if cc_check -DGL_SDL ||
4828 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4829 _gl=yes
4830 _gl_sdl=yes
4831 elif cc_check -DGL_SDL -lGL ||
4832 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4833 _gl=yes
4834 _gl_sdl=yes
4835 libs_mplayer="$libs_mplayer -lGL"
4838 else
4839 _gl=no
4841 if test "$_gl" = yes ; then
4842 def_gl='#define CONFIG_GL 1'
4843 res_comment="backends:"
4844 if test "$_gl_win32" = yes ; then
4845 def_gl_win32='#define CONFIG_GL_WIN32 1'
4846 res_comment="$res_comment win32"
4848 if test "$_gl_x11" = yes ; then
4849 def_gl_x11='#define CONFIG_GL_X11 1'
4850 res_comment="$res_comment x11"
4852 if test "$_gl_sdl" = yes ; then
4853 def_gl_sdl='#define CONFIG_GL_SDL 1'
4854 res_comment="$res_comment sdl"
4856 vomodules="opengl $vomodules"
4857 else
4858 def_gl='#undef CONFIG_GL'
4859 def_gl_win32='#undef CONFIG_GL_WIN32'
4860 def_gl_x11='#undef CONFIG_GL_X11'
4861 def_gl_sdl='#undef CONFIG_GL_SDL'
4862 novomodules="opengl $novomodules"
4864 echores "$_gl"
4867 echocheck "MatrixView"
4868 if test "$_gl" = no ; then
4869 matrixview=no
4871 if test "$matrixview" = yes ; then
4872 vomodules="matrixview $vomodules"
4873 def_matrixview='#define CONFIG_MATRIXVIEW 1'
4874 else
4875 novomodules="matrixview $novomodules"
4876 def_matrixview='#undef CONFIG_MATRIXVIEW'
4878 echores "$matrixview"
4881 if os2 ; then
4882 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
4883 if test "$_kva" = auto; then
4884 _kva=no;
4885 header_check_broken os2.h kva.h -lkva && _kva=yes
4887 if test "$_kva" = yes ; then
4888 def_kva='#define CONFIG_KVA 1'
4889 libs_mplayer="$libs_mplayer -lkva"
4890 vomodules="kva $vomodules"
4891 else
4892 def_kva='#undef CONFIG_KVA'
4893 novomodules="kva $novomodules"
4895 echores "$_kva"
4896 fi #if os2
4899 if win32; then
4901 echocheck "Windows waveout"
4902 if test "$_win32waveout" = auto ; then
4903 _win32waveout=no
4904 header_check_broken windows.h mmsystem.h -lwinmm && _win32waveout=yes
4906 if test "$_win32waveout" = yes ; then
4907 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4908 libs_mplayer="$libs_mplayer -lwinmm"
4909 aomodules="win32 $aomodules"
4910 else
4911 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4912 noaomodules="win32 $noaomodules"
4914 echores "$_win32waveout"
4916 echocheck "Direct3D"
4917 if test "$_direct3d" = auto ; then
4918 _direct3d=no
4919 header_check d3d9.h && _direct3d=yes
4921 if test "$_direct3d" = yes ; then
4922 def_direct3d='#define CONFIG_DIRECT3D 1'
4923 vomodules="direct3d $vomodules"
4924 else
4925 def_direct3d='#undef CONFIG_DIRECT3D'
4926 novomodules="direct3d $novomodules"
4928 echores "$_direct3d"
4930 echocheck "Directx"
4931 if test "$_directx" = auto ; then
4932 cat > $TMPC << EOF
4933 #include <ddraw.h>
4934 #include <dsound.h>
4935 int main(void) { return 0; }
4937 _directx=no
4938 cc_check -lgdi32 && _directx=yes
4940 if test "$_directx" = yes ; then
4941 def_directx='#define CONFIG_DIRECTX 1'
4942 libs_mplayer="$libs_mplayer -lgdi32"
4943 vomodules="directx $vomodules"
4944 aomodules="dsound $aomodules"
4945 else
4946 def_directx='#undef CONFIG_DIRECTX'
4947 novomodules="directx $novomodules"
4948 noaomodules="dsound $noaomodules"
4950 echores "$_directx"
4952 fi #if win32; then
4955 echocheck "DXR2"
4956 if test "$_dxr2" = auto; then
4957 _dxr2=no
4958 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4959 header_check dxr2ioctl.h $_inc_tmp && _dxr2=yes &&
4960 extra_cflags="$extra_cflags $_inc_tmp" && break
4961 done
4963 if test "$_dxr2" = yes; then
4964 def_dxr2='#define CONFIG_DXR2 1'
4965 aomodules="dxr2 $aomodules"
4966 vomodules="dxr2 $vomodules"
4967 else
4968 def_dxr2='#undef CONFIG_DXR2'
4969 noaomodules="dxr2 $noaomodules"
4970 novomodules="dxr2 $novomodules"
4972 echores "$_dxr2"
4974 echocheck "DXR3/H+"
4975 if test "$_dxr3" = auto ; then
4976 _dxr3=no
4977 header_check linux/em8300.h && _dxr3=yes
4979 if test "$_dxr3" = yes ; then
4980 def_dxr3='#define CONFIG_DXR3 1'
4981 vomodules="dxr3 $vomodules"
4982 else
4983 def_dxr3='#undef CONFIG_DXR3'
4984 novomodules="dxr3 $novomodules"
4986 echores "$_dxr3"
4989 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4990 if test "$_ivtv" = auto ; then
4991 cat > $TMPC << EOF
4992 #include <linux/videodev2.h>
4993 #include <linux/ivtv.h>
4994 #include <sys/ioctl.h>
4995 int main(void) {
4996 struct ivtv_cfg_stop_decode sd;
4997 struct ivtv_cfg_start_decode sd1;
4998 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4999 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5000 return 0; }
5002 _ivtv=no
5003 cc_check && _ivtv=yes
5005 if test "$_ivtv" = yes ; then
5006 def_ivtv='#define CONFIG_IVTV 1'
5007 vomodules="ivtv $vomodules"
5008 aomodules="ivtv $aomodules"
5009 else
5010 def_ivtv='#undef CONFIG_IVTV'
5011 novomodules="ivtv $novomodules"
5012 noaomodules="ivtv $noaomodules"
5014 echores "$_ivtv"
5017 echocheck "V4L2 MPEG Decoder"
5018 if test "$_v4l2" = auto ; then
5019 cat > $TMPC << EOF
5020 #include <linux/videodev2.h>
5021 #include <linux/version.h>
5022 int main(void) {
5023 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5024 #error kernel headers too old, need 2.6.22
5025 #endif
5026 struct v4l2_ext_controls ctrls;
5027 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5028 return 0;
5031 _v4l2=no
5032 cc_check && _v4l2=yes
5034 if test "$_v4l2" = yes ; then
5035 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5036 vomodules="v4l2 $vomodules"
5037 aomodules="v4l2 $aomodules"
5038 else
5039 def_v4l2='#undef CONFIG_V4L2_DECODER'
5040 novomodules="v4l2 $novomodules"
5041 noaomodules="v4l2 $noaomodules"
5043 echores "$_v4l2"
5047 #########
5048 # AUDIO #
5049 #########
5052 echocheck "OSS Audio"
5053 if test "$_ossaudio" = auto ; then
5054 cat > $TMPC << EOF
5055 #include <$_soundcard_header>
5056 int main(void) { return SNDCTL_DSP_SETFRAGMENT; }
5058 _ossaudio=no
5059 cc_check && _ossaudio=yes
5061 if test "$_ossaudio" = yes ; then
5062 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5063 aomodules="oss $aomodules"
5064 cat > $TMPC << EOF
5065 #include <$_soundcard_header>
5066 #ifdef OPEN_SOUND_SYSTEM
5067 int main(void) { return 0; }
5068 #else
5069 #error Not the real thing
5070 #endif
5072 _real_ossaudio=no
5073 cc_check && _real_ossaudio=yes
5074 if test "$_real_ossaudio" = yes; then
5075 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5076 # Check for OSS4 headers (override default headers)
5077 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
5078 if test -f /etc/oss.conf; then
5079 . /etc/oss.conf
5080 _ossinc="$OSSLIBDIR/include"
5081 if test -f "$_ossinc/sys/soundcard.h"; then
5082 extra_cflags="-I$_ossinc $extra_cflags"
5085 elif netbsd || openbsd ; then
5086 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5087 extra_ldflags="$extra_ldflags -lossaudio"
5088 else
5089 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5091 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5092 else
5093 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5094 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5095 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5096 noaomodules="oss $noaomodules"
5098 echores "$_ossaudio"
5101 echocheck "aRts"
5102 if test "$_arts" = auto ; then
5103 _arts=no
5104 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5105 statement_check artsc.h 'arts_init()' $(artsc-config --libs) $(artsc-config --cflags) &&
5106 _arts=yes
5110 if test "$_arts" = yes ; then
5111 def_arts='#define CONFIG_ARTS 1'
5112 aomodules="arts $aomodules"
5113 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5114 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5115 else
5116 noaomodules="arts $noaomodules"
5118 echores "$_arts"
5121 echocheck "EsounD"
5122 if test "$_esd" = auto ; then
5123 _esd=no
5124 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5125 statement_check esd.h 'esd_open_sound("test")' $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5128 echores "$_esd"
5130 if test "$_esd" = yes ; then
5131 def_esd='#define CONFIG_ESD 1'
5132 aomodules="esd $aomodules"
5133 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5134 extra_cflags="$extra_cflags $(esd-config --cflags)"
5136 echocheck "esd_get_latency()"
5137 statement_check esd.h 'esd_get_latency(0)' $(esd-config --libs) $(esd-config --cflags) &&
5138 _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5139 echores "$_esd_latency"
5140 else
5141 def_esd='#undef CONFIG_ESD'
5142 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5143 noaomodules="esd $noaomodules"
5147 echocheck "NAS"
5148 if test "$_nas" = auto ; then
5149 _nas=no
5150 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
5152 if test "$_nas" = yes ; then
5153 def_nas='#define CONFIG_NAS 1'
5154 libs_mplayer="$libs_mplayer -laudio -lXt"
5155 aomodules="nas $aomodules"
5156 else
5157 noaomodules="nas $noaomodules"
5158 def_nas='#undef CONFIG_NAS'
5160 echores "$_nas"
5163 echocheck "pulse"
5164 if test "$_pulse" = auto ; then
5165 _pulse=no
5166 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5167 header_check pulse/pulseaudio.h $($_pkg_config --libs --cflags libpulse) &&
5168 _pulse=yes
5171 echores "$_pulse"
5173 if test "$_pulse" = yes ; then
5174 def_pulse='#define CONFIG_PULSE 1'
5175 aomodules="pulse $aomodules"
5176 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5177 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5178 else
5179 def_pulse='#undef CONFIG_PULSE'
5180 noaomodules="pulse $noaomodules"
5184 echocheck "JACK"
5185 if test "$_jack" = auto ; then
5186 _jack=yes
5187 if statement_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' -ljack ; then
5188 libs_mplayer="$libs_mplayer -ljack"
5189 elif statement_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' $($_pkg_config --libs --cflags --silence-errors jack) ; then
5190 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5191 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5192 else
5193 _jack=no
5197 if test "$_jack" = yes ; then
5198 def_jack='#define CONFIG_JACK 1'
5199 aomodules="jack $aomodules"
5200 else
5201 noaomodules="jack $noaomodules"
5203 echores "$_jack"
5205 echocheck "OpenAL"
5206 if test "$_openal" = auto ; then
5207 _openal=no
5208 cat > $TMPC << EOF
5209 #ifdef OPENAL_AL_H
5210 #include <OpenAL/al.h>
5211 #else
5212 #include <AL/al.h>
5213 #endif
5214 int main(void) {
5215 alSourceQueueBuffers(0, 0, 0);
5216 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5217 return 0;
5220 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5221 cc_check $I && _openal=yes && break
5222 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5223 done
5224 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5226 if test "$_openal" = yes ; then
5227 def_openal='#define CONFIG_OPENAL 1'
5228 aomodules="openal $aomodules"
5229 else
5230 noaomodules="openal $noaomodules"
5232 echores "$_openal"
5234 echocheck "ALSA audio"
5235 if test "$_alloca" != yes ; then
5236 _alsa=no
5237 res_comment="alloca missing"
5239 if test "$_alsa" != no ; then
5240 _alsa=no
5241 cat > $TMPC << EOF
5242 #include <sys/asoundlib.h>
5243 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5244 #error "alsa version != 0.5.x"
5245 #endif
5246 int main(void) { return 0; }
5248 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5250 cat > $TMPC << EOF
5251 #include <sys/asoundlib.h>
5252 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5253 #error "alsa version != 0.9.x"
5254 #endif
5255 int main(void) { return 0; }
5257 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5258 cat > $TMPC << EOF
5259 #include <alsa/asoundlib.h>
5260 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5261 #error "alsa version != 0.9.x"
5262 #endif
5263 int main(void) { return 0; }
5265 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5267 cat > $TMPC << EOF
5268 #include <sys/asoundlib.h>
5269 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5270 #error "alsa version != 1.0.x"
5271 #endif
5272 int main(void) { return 0; }
5274 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5275 cat > $TMPC << EOF
5276 #include <alsa/asoundlib.h>
5277 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5278 #error "alsa version != 1.0.x"
5279 #endif
5280 int main(void) { return 0; }
5282 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5284 def_alsa='#undef CONFIG_ALSA'
5285 def_alsa5='#undef CONFIG_ALSA5'
5286 def_alsa9='#undef CONFIG_ALSA9'
5287 def_alsa1x='#undef CONFIG_ALSA1X'
5288 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5289 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5290 if test "$_alsaver" ; then
5291 _alsa=yes
5292 if test "$_alsaver" = '0.5.x' ; then
5293 _alsa5=yes
5294 aomodules="alsa5 $aomodules"
5295 def_alsa5='#define CONFIG_ALSA5 1'
5296 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5297 res_comment="using alsa 0.5.x and sys/asoundlib.h"
5298 elif test "$_alsaver" = '0.9.x-sys' ; then
5299 _alsa9=yes
5300 aomodules="alsa $aomodules"
5301 def_alsa='#define CONFIG_ALSA 1'
5302 def_alsa9='#define CONFIG_ALSA9 1'
5303 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5304 res_comment="using alsa 0.9.x and sys/asoundlib.h"
5305 elif test "$_alsaver" = '0.9.x-alsa' ; then
5306 _alsa9=yes
5307 aomodules="alsa $aomodules"
5308 def_alsa='#define CONFIG_ALSA 1'
5309 def_alsa9='#define CONFIG_ALSA9 1'
5310 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5311 res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5312 elif test "$_alsaver" = '1.0.x-sys' ; then
5313 _alsa1x=yes
5314 aomodules="alsa $aomodules"
5315 def_alsa='#define CONFIG_ALSA 1'
5316 def_alsa1x="#define CONFIG_ALSA1X 1"
5317 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5318 res_comment="using alsa 1.0.x and sys/asoundlib.h"
5319 elif test "$_alsaver" = '1.0.x-alsa' ; then
5320 _alsa1x=yes
5321 aomodules="alsa $aomodules"
5322 def_alsa='#define CONFIG_ALSA 1'
5323 def_alsa1x="#define CONFIG_ALSA1X 1"
5324 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5325 res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5326 else
5327 _alsa=no
5328 res_comment="unknown version"
5330 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5331 else
5332 noaomodules="alsa $noaomodules"
5334 echores "$_alsa"
5337 echocheck "Sun audio"
5338 if test "$_sunaudio" = auto ; then
5339 cat > $TMPC << EOF
5340 #include <sys/types.h>
5341 #include <sys/audioio.h>
5342 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5344 _sunaudio=no
5345 cc_check && _sunaudio=yes
5347 if test "$_sunaudio" = yes ; then
5348 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5349 aomodules="sun $aomodules"
5350 else
5351 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5352 noaomodules="sun $noaomodules"
5354 echores "$_sunaudio"
5357 if darwin; then
5358 echocheck "CoreAudio"
5359 if test "$_coreaudio" = auto ; then
5360 cat > $TMPC <<EOF
5361 #include <CoreAudio/CoreAudio.h>
5362 #include <AudioToolbox/AudioToolbox.h>
5363 #include <AudioUnit/AudioUnit.h>
5364 int main(void) { return 0; }
5366 _coreaudio=no
5367 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5369 if test "$_coreaudio" = yes ; then
5370 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5371 def_coreaudio='#define CONFIG_COREAUDIO 1'
5372 aomodules="coreaudio $aomodules"
5373 else
5374 def_coreaudio='#undef CONFIG_COREAUDIO'
5375 noaomodules="coreaudio $noaomodules"
5377 echores $_coreaudio
5378 fi #if darwin
5381 if irix; then
5382 echocheck "SGI audio"
5383 if test "$_sgiaudio" = auto ; then
5384 _sgiaudio=no
5385 header_check dmedia/audio.h && _sgiaudio=yes
5387 if test "$_sgiaudio" = "yes" ; then
5388 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5389 libs_mplayer="$libs_mplayer -laudio"
5390 aomodules="sgi $aomodules"
5391 else
5392 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5393 noaomodules="sgi $noaomodules"
5395 echores "$_sgiaudio"
5396 fi #if irix
5399 if os2 ; then
5400 echocheck "KAI (UNIAUD/DART)"
5401 if test "$_kai" = auto; then
5402 _kai=no;
5403 header_check_broken os2.h kai.h -lkai && _kai=yes
5405 if test "$_kai" = yes ; then
5406 def_kai='#define CONFIG_KAI 1'
5407 libs_mplayer="$libs_mplayer -lkai"
5408 aomodules="kai $aomodules"
5409 else
5410 def_kai='#undef CONFIG_KAI'
5411 noaomodules="kai $noaomodules"
5413 echores "$_kai"
5415 echocheck "DART"
5416 if test "$_dart" = auto; then
5417 _dart=no;
5418 header_check_broken os2.h dart.h -ldart && _dart=yes
5420 if test "$_dart" = yes ; then
5421 def_dart='#define CONFIG_DART 1'
5422 libs_mplayer="$libs_mplayer -ldart"
5423 aomodules="dart $aomodules"
5424 else
5425 def_dart='#undef CONFIG_DART'
5426 noaomodules="dart $noaomodules"
5428 echores "$_dart"
5429 fi #if os2
5432 # set default CD/DVD devices
5433 if win32 || os2 ; then
5434 default_cdrom_device="D:"
5435 elif darwin ; then
5436 default_cdrom_device="/dev/disk1"
5437 elif dragonfly ; then
5438 default_cdrom_device="/dev/cd0"
5439 elif freebsd ; then
5440 default_cdrom_device="/dev/acd0"
5441 elif openbsd ; then
5442 default_cdrom_device="/dev/rcd0c"
5443 elif sunos ; then
5444 default_cdrom_device="/vol/dev/aliases/cdrom0"
5445 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5446 # file system and the volfs service.
5447 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5448 elif amigaos ; then
5449 default_cdrom_device="a1ide.device:2"
5450 else
5451 default_cdrom_device="/dev/cdrom"
5454 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5455 default_dvd_device=$default_cdrom_device
5456 elif darwin ; then
5457 default_dvd_device="/dev/rdiskN"
5458 else
5459 default_dvd_device="/dev/dvd"
5463 echocheck "VCD support"
5464 if test "$_vcd" = auto; then
5465 _vcd=no
5466 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
5467 _vcd=yes
5468 elif mingw32; then
5469 header_check ddk/ntddcdrm.h && _vcd=yes
5472 if test "$_vcd" = yes; then
5473 inputmodules="vcd $inputmodules"
5474 def_vcd='#define CONFIG_VCD 1'
5475 else
5476 def_vcd='#undef CONFIG_VCD'
5477 noinputmodules="vcd $noinputmodules"
5478 res_comment="not supported on this OS"
5480 echores "$_vcd"
5484 echocheck "Blu-ray support"
5485 if test "$_bluray" = auto ; then
5486 _bluray=no
5487 statement_check libbluray/bluray.h 'bd_get_title_info(0, 0)' -lbluray && _bluray=yes
5489 if test "$_bluray" = yes ; then
5490 def_bluray='#define CONFIG_LIBBLURAY 1'
5491 extra_ldflags="$extra_ldflags -lbluray"
5492 inputmodules="bluray $inputmodules"
5493 else
5494 def_bluray='#undef CONFIG_LIBBLURAY'
5495 noinputmodules="bluray $noinputmodules"
5497 echores "$_bluray"
5499 echocheck "dvdread"
5500 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5501 _dvdread_internal=no
5503 if test "$_dvdread_internal" = auto ; then
5504 _dvdread_internal=no
5505 _dvdread=no
5506 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5507 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5508 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5509 || darwin || win32 || os2; then
5510 _dvdread_internal=yes
5511 _dvdread=yes
5512 extra_cflags="-Ilibdvdread4 $extra_cflags"
5514 elif test "$_dvdread" = auto ; then
5515 _dvdread=no
5516 if test "$_dl" = yes; then
5517 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5518 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5519 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5520 _dvdread=yes
5521 extra_cflags="$extra_cflags $_dvdreadcflags"
5522 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5523 res_comment="external"
5528 if test "$_dvdread_internal" = yes; then
5529 def_dvdread='#define CONFIG_DVDREAD 1'
5530 inputmodules="dvdread(internal) $inputmodules"
5531 _largefiles=yes
5532 res_comment="internal"
5533 elif test "$_dvdread" = yes; then
5534 def_dvdread='#define CONFIG_DVDREAD 1'
5535 _largefiles=yes
5536 extra_ldflags="$extra_ldflags -ldvdread"
5537 inputmodules="dvdread(external) $inputmodules"
5538 res_comment="external"
5539 else
5540 def_dvdread='#undef CONFIG_DVDREAD'
5541 noinputmodules="dvdread $noinputmodules"
5543 echores "$_dvdread"
5546 echocheck "internal libdvdcss"
5547 if test "$_libdvdcss_internal" = auto ; then
5548 _libdvdcss_internal=no
5549 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
5550 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5552 if test "$_libdvdcss_internal" = yes ; then
5553 if linux || netbsd || openbsd || bsdos ; then
5554 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5555 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5556 elif freebsd || dragonfly ; then
5557 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5558 elif darwin ; then
5559 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5560 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5561 elif cygwin ; then
5562 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5563 elif beos ; then
5564 cflags_libdvdcss="-DSYS_BEOS"
5565 elif os2 ; then
5566 cflags_libdvdcss="-DSYS_OS2"
5568 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5569 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5570 inputmodules="libdvdcss(internal) $inputmodules"
5571 _largefiles=yes
5572 else
5573 noinputmodules="libdvdcss(internal) $noinputmodules"
5575 echores "$_libdvdcss_internal"
5578 echocheck "cdparanoia"
5579 if test "$_cdparanoia" = auto ; then
5580 cat > $TMPC <<EOF
5581 #include <cdda_interface.h>
5582 #include <cdda_paranoia.h>
5583 // This need a better test. How ?
5584 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5586 _cdparanoia=no
5587 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5588 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5589 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5590 done
5592 if test "$_cdparanoia" = yes ; then
5593 _cdda='yes'
5594 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5595 openbsd && extra_ldflags="$extra_ldflags -lutil"
5597 echores "$_cdparanoia"
5600 echocheck "libcdio"
5601 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5602 cat > $TMPC << EOF
5603 #include <stdio.h>
5604 #include <cdio/version.h>
5605 #include <cdio/cdda.h>
5606 #include <cdio/paranoia.h>
5607 int main(void) {
5608 void *test = cdda_verbose_set;
5609 printf("%s\n", CDIO_VERSION);
5610 return test == (void *)1;
5613 _libcdio=no
5614 for _ld_tmp in "" "-lwinmm" ; do
5615 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5616 cc_check $_ld_tmp $_ld_lm \
5617 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5618 done
5619 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5620 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
5621 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
5622 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5623 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5626 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5627 _cdda='yes'
5628 def_libcdio='#define CONFIG_LIBCDIO 1'
5629 def_havelibcdio='yes'
5630 else
5631 if test "$_cdparanoia" = yes ; then
5632 res_comment="using cdparanoia"
5634 def_libcdio='#undef CONFIG_LIBCDIO'
5635 def_havelibcdio='no'
5637 echores "$_libcdio"
5639 if test "$_cdda" = yes ; then
5640 test $_cddb = auto && test $networking = yes && _cddb=yes
5641 def_cdparanoia='#define CONFIG_CDDA 1'
5642 inputmodules="cdda $inputmodules"
5643 else
5644 def_cdparanoia='#undef CONFIG_CDDA'
5645 noinputmodules="cdda $noinputmodules"
5648 if test "$_cddb" = yes ; then
5649 def_cddb='#define CONFIG_CDDB 1'
5650 inputmodules="cddb $inputmodules"
5651 else
5652 _cddb=no
5653 def_cddb='#undef CONFIG_CDDB'
5654 noinputmodules="cddb $noinputmodules"
5657 echocheck "bitmap font support"
5658 if test "$_bitmap_font" = yes ; then
5659 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5660 else
5661 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5663 echores "$_bitmap_font"
5666 echocheck "freetype >= 2.0.9"
5668 # freetype depends on iconv
5669 if test "$_iconv" = no ; then
5670 _freetype=no
5671 res_comment="iconv support needed"
5674 if test "$_freetype" = auto ; then
5675 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5676 cat > $TMPC << EOF
5677 #include <stdio.h>
5678 #include <ft2build.h>
5679 #include FT_FREETYPE_H
5680 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5681 #error "Need FreeType 2.0.9 or newer"
5682 #endif
5683 int main(void) {
5684 FT_Library library;
5685 FT_Init_FreeType(&library);
5686 return 0;
5689 _freetype=no
5690 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
5691 else
5692 _freetype=no
5695 if test "$_freetype" = yes ; then
5696 def_freetype='#define CONFIG_FREETYPE 1'
5697 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
5698 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
5699 else
5700 def_freetype='#undef CONFIG_FREETYPE'
5702 echores "$_freetype"
5704 if test "$_freetype" = no ; then
5705 _fontconfig=no
5706 res_comment="FreeType support needed"
5708 echocheck "fontconfig"
5709 if test "$_fontconfig" = auto ; then
5710 cat > $TMPC << EOF
5711 #include <stdio.h>
5712 #include <stdlib.h>
5713 #include <fontconfig/fontconfig.h>
5714 #if FC_VERSION < 20402
5715 #error At least version 2.4.2 of fontconfig required
5716 #endif
5717 int main(void) {
5718 int err = FcInit();
5719 if (err == FcFalse) {
5720 printf("Couldn't initialize fontconfig lib\n");
5721 exit(err);
5723 return 0;
5726 _fontconfig=no
5727 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
5728 _ld_tmp="-lfontconfig $_ld_tmp"
5729 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5730 done
5731 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5732 _inc_tmp=$($_pkg_config --cflags fontconfig)
5733 _ld_tmp=$($_pkg_config --libs fontconfig)
5734 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5735 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5738 if test "$_fontconfig" = yes ; then
5739 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5740 else
5741 def_fontconfig='#undef CONFIG_FONTCONFIG'
5743 echores "$_fontconfig"
5746 echocheck "SSA/ASS support"
5747 if test "$_ass" = auto -o "$_ass" = yes ; then
5748 if $_pkg_config libass; then
5749 _ass=yes
5750 def_ass='#define CONFIG_ASS 1'
5751 extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
5752 extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
5753 else
5754 _ass=no
5755 def_ass='#undef CONFIG_ASS'
5757 else
5758 def_ass='#undef CONFIG_ASS'
5760 echores "$_ass"
5763 echocheck "fribidi with charsets"
5764 _inc_tmp=""
5765 _ld_tmp=""
5766 if test "$_fribidi" = auto ; then
5767 cat > $TMPC << EOF
5768 #include <stdlib.h>
5769 /* workaround for fribidi 0.10.4 and below */
5770 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5771 #include <fribidi/fribidi.h>
5772 int main(void) {
5773 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8)
5774 exit(1);
5775 return 0;
5778 _fribidi=no
5779 _inc_tmp=""
5780 _ld_tmp="-lfribidi"
5781 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5782 if $_pkg_config --exists fribidi > /dev/null 2>&1 &&
5783 test "$_fribidi" = no ; then
5784 _inc_tmp="$($_pkg_config --cflags)"
5785 _ld_tmp="$($_pkg_config --libs)"
5786 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5789 if test "$_fribidi" = yes ; then
5790 def_fribidi='#define CONFIG_FRIBIDI 1'
5791 extra_cflags="$extra_cflags $_inc_tmp"
5792 extra_ldflags="$extra_ldflags $_ld_tmp"
5793 else
5794 def_fribidi='#undef CONFIG_FRIBIDI'
5796 echores "$_fribidi"
5799 echocheck "ENCA"
5800 if test "$_enca" = auto ; then
5801 _enca=no
5802 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
5804 if test "$_enca" = yes ; then
5805 def_enca='#define CONFIG_ENCA 1'
5806 extra_ldflags="$extra_ldflags -lenca"
5807 else
5808 def_enca='#undef CONFIG_ENCA'
5810 echores "$_enca"
5813 echocheck "zlib"
5814 _zlib=no
5815 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5816 if test "$_zlib" = yes ; then
5817 def_zlib='#define CONFIG_ZLIB 1'
5818 extra_ldflags="$extra_ldflags -lz"
5819 else
5820 def_zlib='#define CONFIG_ZLIB 0'
5822 echores "$_zlib"
5825 echocheck "bzlib"
5826 bzlib=no
5827 def_bzlib='#define CONFIG_BZLIB 0'
5828 statement_check bzlib.h 'BZ2_bzlibVersion()' -lbz2 && bzlib=yes
5829 if test "$bzlib" = yes ; then
5830 def_bzlib='#define CONFIG_BZLIB 1'
5831 extra_ldflags="$extra_ldflags -lbz2"
5833 echores "$bzlib"
5836 echocheck "RTC"
5837 if test "$_rtc" = auto ; then
5838 cat > $TMPC << EOF
5839 #include <sys/ioctl.h>
5840 #ifdef __linux__
5841 #include <linux/rtc.h>
5842 #else
5843 #include <rtc.h>
5844 #define RTC_PIE_ON RTCIO_PIE_ON
5845 #endif
5846 int main(void) { return RTC_PIE_ON; }
5848 _rtc=no
5849 cc_check && _rtc=yes
5850 ppc && _rtc=no
5852 if test "$_rtc" = yes ; then
5853 def_rtc='#define HAVE_RTC 1'
5854 else
5855 def_rtc='#undef HAVE_RTC'
5857 echores "$_rtc"
5860 echocheck "liblzo2 support"
5861 if test "$_liblzo" = auto ; then
5862 _liblzo=no
5863 statement_check lzo/lzo1x.h 'lzo_init()' -llzo2 && _liblzo=yes
5865 if test "$_liblzo" = yes ; then
5866 def_liblzo='#define CONFIG_LIBLZO 1'
5867 extra_ldflags="$extra_ldflags -llzo2"
5868 codecmodules="liblzo $codecmodules"
5869 else
5870 def_liblzo='#undef CONFIG_LIBLZO'
5871 nocodecmodules="liblzo $nocodecmodules"
5873 echores "$_liblzo"
5876 echocheck "mad support"
5877 if test "$_mad" = auto ; then
5878 _mad=no
5879 header_check mad.h -lmad && _mad=yes
5881 if test "$_mad" = yes ; then
5882 def_mad='#define CONFIG_LIBMAD 1'
5883 extra_ldflags="$extra_ldflags -lmad"
5884 codecmodules="libmad $codecmodules"
5885 else
5886 def_mad='#undef CONFIG_LIBMAD'
5887 nocodecmodules="libmad $nocodecmodules"
5889 echores "$_mad"
5891 echocheck "OggVorbis support"
5892 if test "$_tremor_internal" = yes; then
5893 _libvorbis=no
5894 elif test "$_tremor" = auto; then
5895 _tremor=no
5896 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
5898 if test "$_libvorbis" = auto; then
5899 _libvorbis=no
5900 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes
5902 if test "$_tremor_internal" = yes ; then
5903 _vorbis=yes
5904 def_vorbis='#define CONFIG_OGGVORBIS 1'
5905 def_tremor='#define CONFIG_TREMOR 1'
5906 codecmodules="tremor(internal) $codecmodules"
5907 res_comment="internal Tremor"
5908 if test "$_tremor_low" = yes ; then
5909 cflags_tremor_low="-D_LOW_ACCURACY_"
5910 res_comment="internal low accuracy Tremor"
5912 elif test "$_tremor" = yes ; then
5913 _vorbis=yes
5914 def_vorbis='#define CONFIG_OGGVORBIS 1'
5915 def_tremor='#define CONFIG_TREMOR 1'
5916 codecmodules="tremor(external) $codecmodules"
5917 res_comment="external Tremor"
5918 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
5919 elif test "$_libvorbis" = yes ; then
5920 _vorbis=yes
5921 def_vorbis='#define CONFIG_OGGVORBIS 1'
5922 codecmodules="libvorbis $codecmodules"
5923 res_comment="libvorbis"
5924 extra_ldflags="$extra_ldflags -lvorbis -logg"
5925 else
5926 _vorbis=no
5927 nocodecmodules="libvorbis $nocodecmodules"
5929 echores "$_vorbis"
5931 echocheck "libspeex (version >= 1.1 required)"
5932 if test "$_speex" = auto ; then
5933 _speex=no
5934 cat > $TMPC << EOF
5935 #include <stddef.h>
5936 #include <speex/speex.h>
5937 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5939 cc_check -lspeex $_ld_lm && _speex=yes
5941 if test "$_speex" = yes ; then
5942 def_speex='#define CONFIG_SPEEX 1'
5943 extra_ldflags="$extra_ldflags -lspeex"
5944 codecmodules="speex $codecmodules"
5945 else
5946 def_speex='#undef CONFIG_SPEEX'
5947 nocodecmodules="speex $nocodecmodules"
5949 echores "$_speex"
5951 echocheck "OggTheora support"
5952 if test "$_theora" = auto ; then
5953 _theora=no
5954 cat > $TMPC << EOF
5955 #include <theora/theora.h>
5956 #include <string.h>
5957 int main(void) {
5958 /* Theora is in flux, make sure that all interface routines and datatypes
5959 * exist and work the way we expect it, so we don't break MPlayer. */
5960 ogg_packet op;
5961 theora_comment tc;
5962 theora_info inf;
5963 theora_state st;
5964 yuv_buffer yuv;
5965 int r;
5966 double t;
5968 theora_info_init(&inf);
5969 theora_comment_init(&tc);
5971 return 0;
5973 /* we don't want to execute this kind of nonsense; just for making sure
5974 * that compilation works... */
5975 memset(&op, 0, sizeof(op));
5976 r = theora_decode_header(&inf, &tc, &op);
5977 r = theora_decode_init(&st, &inf);
5978 t = theora_granule_time(&st, op.granulepos);
5979 r = theora_decode_packetin(&st, &op);
5980 r = theora_decode_YUVout(&st, &yuv);
5981 theora_clear(&st);
5983 return 0;
5986 _ld_theora=$($_pkg_config --silence-errors --libs theora)
5987 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
5988 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
5989 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
5990 if test _theora = no; then
5991 _ld_theora="-ltheora -logg"
5992 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
5994 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5995 _ld_theora=$($_pkg_config --silence-errors --libs theora)
5996 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
5997 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
5998 extra_ldflags="$extra_ldflags $_ld_theora" &&
5999 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6000 if test _theora = no; then
6001 _ld_theora="-ltheora -logg"
6002 cc_check tremor/bitwise.c $_ld_theora &&
6003 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6007 if test "$_theora" = yes ; then
6008 def_theora='#define CONFIG_OGGTHEORA 1'
6009 codecmodules="libtheora $codecmodules"
6010 # when --enable-theora is forced, we'd better provide a probably sane
6011 # $_ld_theora than nothing
6012 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6013 else
6014 def_theora='#undef CONFIG_OGGTHEORA'
6015 nocodecmodules="libtheora $nocodecmodules"
6017 echores "$_theora"
6019 echocheck "mp3lib support"
6020 if test "$_mp3lib" = auto ; then
6021 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6023 if test "$_mp3lib" = yes ; then
6024 def_mp3lib='#define CONFIG_MP3LIB 1'
6025 codecmodules="mp3lib(internal) $codecmodules"
6026 else
6027 def_mp3lib='#undef CONFIG_MP3LIB'
6028 nocodecmodules="mp3lib(internal) $nocodecmodules"
6030 echores "$_mp3lib"
6032 # Any version of libmpg123 shall be fine.
6033 echocheck "mpg123 support"
6034 def_mpg123='#undef CONFIG_MPG123'
6035 if test "$_mpg123" = auto; then
6036 _mpg123=no
6037 statement_check mpg123.h 'mpg123_init()' -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
6039 if test "$_mpg123" = yes ; then
6040 def_mpg123='#define CONFIG_MPG123 1'
6041 codecmodules="mpg123 $codecmodules"
6042 else
6043 nocodecmodules="mpg123 $nocodecmodules"
6045 echores "$_mpg123"
6047 echocheck "liba52 support"
6048 def_liba52='#undef CONFIG_LIBA52'
6049 if test "$_liba52" = auto ; then
6050 _liba52=no
6051 cat > $TMPC << EOF
6052 #include <inttypes.h>
6053 #include <a52dec/a52.h>
6054 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6056 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
6058 if test "$_liba52" = yes ; then
6059 def_liba52='#define CONFIG_LIBA52 1'
6060 codecmodules="liba52 $codecmodules"
6061 else
6062 nocodecmodules="liba52 $nocodecmodules"
6064 echores "$_liba52"
6066 echocheck "internal libmpeg2 support"
6067 if test "$_libmpeg2" = auto ; then
6068 _libmpeg2=yes
6069 if alpha && test cc_vendor=gnu; then
6070 case $cc_version in
6071 2*|3.0*|3.1*) # cannot compile MVI instructions
6072 _libmpeg2=no
6073 res_comment="broken gcc"
6075 esac
6078 if test "$_libmpeg2" = yes ; then
6079 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6080 codecmodules="libmpeg2(internal) $codecmodules"
6081 else
6082 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6083 nocodecmodules="libmpeg2(internal) $nocodecmodules"
6085 echores "$_libmpeg2"
6087 echocheck "libdca support"
6088 if test "$_libdca" = auto ; then
6089 _libdca=no
6090 for _ld_dca in -ldca -ldts ; do
6091 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
6092 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
6093 done
6095 if test "$_libdca" = yes ; then
6096 def_libdca='#define CONFIG_LIBDCA 1'
6097 codecmodules="libdca $codecmodules"
6098 else
6099 def_libdca='#undef CONFIG_LIBDCA'
6100 nocodecmodules="libdca $nocodecmodules"
6102 echores "$_libdca"
6104 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6105 if test "$_musepack" = auto ; then
6106 _musepack=no
6107 cat > $TMPC << EOF
6108 #include <stddef.h>
6109 #include <mpcdec/mpcdec.h>
6110 int main(void) {
6111 mpc_streaminfo info;
6112 mpc_decoder decoder;
6113 mpc_decoder_set_streaminfo(&decoder, &info);
6114 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6115 return 0;
6118 cc_check -lmpcdec $_ld_lm && _musepack=yes
6120 if test "$_musepack" = yes ; then
6121 def_musepack='#define CONFIG_MUSEPACK 1'
6122 extra_ldflags="$extra_ldflags -lmpcdec"
6123 codecmodules="musepack $codecmodules"
6124 else
6125 def_musepack='#undef CONFIG_MUSEPACK'
6126 nocodecmodules="musepack $nocodecmodules"
6128 echores "$_musepack"
6131 echocheck "FAAD2 support"
6132 if test "$_faad_internal" = auto ; then
6133 if x86_32 && test cc_vendor=gnu; then
6134 case $cc_version in
6135 3.1*|3.2) # ICE/insn with these versions
6136 _faad_internal=no
6137 res_comment="broken gcc"
6140 _faad=yes
6141 _faad_internal=yes
6143 esac
6144 else
6145 _faad=yes
6146 _faad_internal=yes
6149 if test "$_faad" = auto ; then
6150 cat > $TMPC << EOF
6151 #include <faad.h>
6152 #ifndef FAAD_MIN_STREAMSIZE
6153 #error Too old version
6154 #endif
6155 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6156 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6158 cc_check -lfaad $_ld_lm && _faad=yes
6161 def_faad='#undef CONFIG_FAAD'
6162 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6163 if test "$_faad_internal" = yes ; then
6164 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6165 res_comment="internal floating-point"
6166 if test "$_faad_fixed" = yes ; then
6167 # The FIXED_POINT implementation of FAAD2 improves performance
6168 # on some platforms, especially for SBR files.
6169 cflags_faad_fixed="-DFIXED_POINT"
6170 res_comment="internal fixed-point"
6172 elif test "$_faad" = yes ; then
6173 extra_ldflags="$extra_ldflags -lfaad"
6176 if test "$_faad" = yes ; then
6177 def_faad='#define CONFIG_FAAD 1'
6178 if test "$_faad_internal" = yes ; then
6179 codecmodules="faad2(internal) $codecmodules"
6180 else
6181 codecmodules="faad2 $codecmodules"
6183 else
6184 _faad=no
6185 nocodecmodules="faad2 $nocodecmodules"
6187 echores "$_faad"
6190 echocheck "LADSPA plugin support"
6191 if test "$_ladspa" = auto ; then
6192 _ladspa=no
6193 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
6195 if test "$_ladspa" = yes; then
6196 def_ladspa="#define CONFIG_LADSPA 1"
6197 else
6198 def_ladspa="#undef CONFIG_LADSPA"
6200 echores "$_ladspa"
6203 echocheck "libbs2b audio filter support"
6204 if test "$_libbs2b" = auto ; then
6205 cat > $TMPC <<EOF
6206 #include <bs2b.h>
6207 #if BS2B_VERSION_MAJOR < 3
6208 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6209 #endif
6210 int main(void) {
6211 t_bs2bdp filter;
6212 filter=bs2b_open();
6213 bs2b_close(filter);
6214 return 0;
6217 _libbs2b=no
6218 if $_pkg_config --exists libbs2b ; then
6219 _inc_tmp=$($_pkg_config --cflags libbs2b)
6220 _ld_tmp=$($_pkg_config --libs libbs2b)
6221 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6222 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6223 else
6224 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6225 -I/usr/local/include/bs2b ; do
6226 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6227 extra_ldflags="$extra_ldflags -lbs2b"
6228 extra_cflags="$extra_cflags $_inc_tmp"
6229 _libbs2b=yes
6230 break
6232 done
6235 def_libbs2b="#undef CONFIG_LIBBS2B"
6236 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6237 echores "$_libbs2b"
6240 if test -z "$_codecsdir" ; then
6241 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6242 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6243 if test -d "$dir" ; then
6244 _codecsdir="$dir"
6245 break;
6247 done
6249 # Fall back on default directory.
6250 if test -z "$_codecsdir" ; then
6251 _codecsdir="$_libdir/codecs"
6252 mingw32 || os2 && _codecsdir="codecs"
6256 echocheck "Win32 codecs"
6257 if test "$_win32dll" = auto ; then
6258 _win32dll=no
6259 if x86_32 && ! qnx; then
6260 _win32dll=yes
6263 if test "$_win32dll" = yes ; then
6264 def_win32dll='#define CONFIG_WIN32DLL 1'
6265 if ! win32 ; then
6266 def_win32_loader='#define WIN32_LOADER 1'
6267 _win32_emulation=yes
6268 else
6269 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6270 res_comment="using native windows"
6272 codecmodules="win32 $codecmodules"
6273 else
6274 def_win32dll='#undef CONFIG_WIN32DLL'
6275 def_win32_loader='#undef WIN32_LOADER'
6276 nocodecmodules="win32 $nocodecmodules"
6278 echores "$_win32dll"
6281 echocheck "XAnim codecs"
6282 if test "$_xanim" = auto ; then
6283 _xanim=no
6284 res_comment="dynamic loader support needed"
6285 if test "$_dl" = yes ; then
6286 _xanim=yes
6289 if test "$_xanim" = yes ; then
6290 def_xanim='#define CONFIG_XANIM 1'
6291 codecmodules="xanim $codecmodules"
6292 else
6293 def_xanim='#undef CONFIG_XANIM'
6294 nocodecmodules="xanim $nocodecmodules"
6296 echores "$_xanim"
6299 echocheck "RealPlayer codecs"
6300 if test "$_real" = auto ; then
6301 _real=no
6302 res_comment="dynamic loader support needed"
6303 if test "$_dl" = yes || test "$_win32dll" = yes &&
6304 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
6305 _real=yes
6308 if test "$_real" = yes ; then
6309 def_real='#define CONFIG_REALCODECS 1'
6310 codecmodules="real $codecmodules"
6311 else
6312 def_real='#undef CONFIG_REALCODECS'
6313 nocodecmodules="real $nocodecmodules"
6315 echores "$_real"
6318 echocheck "QuickTime codecs"
6319 _qtx_emulation=no
6320 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6321 if test "$_qtx" = auto ; then
6322 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6324 if test "$_qtx" = yes ; then
6325 def_qtx='#define CONFIG_QTX_CODECS 1'
6326 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6327 codecmodules="qtx $codecmodules"
6328 darwin || win32 || _qtx_emulation=yes
6329 else
6330 def_qtx='#undef CONFIG_QTX_CODECS'
6331 nocodecmodules="qtx $nocodecmodules"
6333 echores "$_qtx"
6335 echocheck "Nemesi Streaming Media libraries"
6336 if test "$_nemesi" = auto && test "$networking" = yes ; then
6337 _nemesi=no
6338 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6339 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6340 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6341 _nemesi=yes
6344 if test "$_nemesi" = yes; then
6345 _native_rtsp=no
6346 def_nemesi='#define CONFIG_LIBNEMESI 1'
6347 inputmodules="nemesi $inputmodules"
6348 else
6349 _native_rtsp="$networking"
6350 _nemesi=no
6351 def_nemesi='#undef CONFIG_LIBNEMESI'
6352 noinputmodules="nemesi $noinputmodules"
6354 echores "$_nemesi"
6356 echocheck "LIVE555 Streaming Media libraries"
6357 if test "$_live" = auto && test "$networking" = yes ; then
6358 cat > $TMPCPP << EOF
6359 #include <liveMedia.hh>
6360 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6361 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6362 #endif
6363 int main(void) { return 0; }
6366 _live=no
6367 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
6368 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6369 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
6370 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6371 $_livelibdir/groupsock/libgroupsock.a \
6372 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6373 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6374 $extra_ldflags -lstdc++" \
6375 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6376 -I$_livelibdir/UsageEnvironment/include \
6377 -I$_livelibdir/BasicUsageEnvironment/include \
6378 -I$_livelibdir/groupsock/include" && \
6379 _live=yes && break
6380 done
6381 if test "$_live" != yes ; then
6382 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6383 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
6384 _live_dist=yes
6388 if test "$_live" = yes && test "$networking" = yes; then
6389 test $_livelibdir && res_comment="using $_livelibdir"
6390 def_live='#define CONFIG_LIVE555 1'
6391 inputmodules="live555 $inputmodules"
6392 elif test "$_live_dist" = yes && test "$networking" = yes; then
6393 res_comment="using distribution version"
6394 _live="yes"
6395 def_live='#define CONFIG_LIVE555 1'
6396 extra_ldflags="$extra_ldflags $ld_tmp"
6397 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6398 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6399 inputmodules="live555 $inputmodules"
6400 else
6401 _live=no
6402 def_live='#undef CONFIG_LIVE555'
6403 noinputmodules="live555 $noinputmodules"
6405 echores "$_live"
6409 all_ffmpeg_libs="libavutil libavcodec libavformat libswscale libpostproc"
6410 echocheck "FFmpeg ($all_ffmpeg_libs)"
6411 if test "$ffmpeg" = auto ; then
6412 ffmpeg=no
6413 if $_pkg_config --exists $all_ffmpeg_libs ; then
6414 inc_ffmpeg=$($_pkg_config --cflags $all_ffmpeg_libs)
6415 _ld_tmp=$($_pkg_config --libs $all_ffmpeg_libs)
6416 extra_ldflags="$extra_ldflags $_ld_tmp"
6417 extra_cflags="$extra_cflags $inc_ffmpeg"
6418 ffmpeg=yes
6419 elif header_check libavcore/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil $_ld_lm ; then
6420 extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil -lavcore"
6421 ffmpeg=yes
6425 ffmpeg_eval_api=no
6426 def_ffmpeg_eval_api="#undef CONFIG_FFMPEG_EVAL_API"
6427 if test "$ffmpeg" = yes; then
6428 def_ffmpeg='#define CONFIG_FFMPEG 1'
6429 codecmodules="ffmpeg $codecmodules"
6430 if $_pkg_config --atleast-version=50.18.0 libavutil ; then
6431 ffmpeg_eval_api=yes
6432 def_ffmpeg_eval_api="#define CONFIG_FFMPEG_EVAL_API 1"
6434 else
6435 def_ffmpeg='#undef CONFIG_FFMPEG'
6436 nocodecmodules="ffmpeg $nocodecmodules"
6438 echores "$ffmpeg"
6440 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
6441 if ! test -z "$_ffmpeg_source" ; then
6442 test "$ffmpeg" = yes && def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
6447 echocheck "libdv-0.9.5+"
6448 if test "$_libdv" = auto ; then
6449 _libdv=no
6450 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
6452 if test "$_libdv" = yes ; then
6453 def_libdv='#define CONFIG_LIBDV095 1'
6454 extra_ldflags="$extra_ldflags -ldv"
6455 codecmodules="libdv $codecmodules"
6456 else
6457 def_libdv='#undef CONFIG_LIBDV095'
6458 nocodecmodules="libdv $nocodecmodules"
6460 echores "$_libdv"
6463 echocheck "Xvid"
6464 if test "$_xvid" = auto ; then
6465 _xvid=no
6466 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6467 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
6468 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
6469 done
6472 if test "$_xvid" = yes ; then
6473 def_xvid='#define CONFIG_XVID4 1'
6474 codecmodules="xvid $codecmodules"
6475 else
6476 def_xvid='#undef CONFIG_XVID4'
6477 nocodecmodules="xvid $nocodecmodules"
6479 echores "$_xvid"
6482 echocheck "libnut"
6483 if test "$_libnut" = auto ; then
6484 cat > $TMPC << EOF
6485 #include <libnut.h>
6486 nut_context_tt * nut;
6487 int main(void) { nut_error(0); return 0; }
6489 _libnut=no
6490 cc_check -lnut && _libnut=yes
6493 if test "$_libnut" = yes ; then
6494 def_libnut='#define CONFIG_LIBNUT 1'
6495 extra_ldflags="$extra_ldflags -lnut"
6496 else
6497 def_libnut='#undef CONFIG_LIBNUT'
6499 echores "$_libnut"
6501 # These VO checks must be done after the FFmpeg one
6502 echocheck "/dev/mga_vid"
6503 if test "$_mga" = auto ; then
6504 _mga=no
6505 test -c /dev/mga_vid && _mga=yes
6507 if test "$_mga" = yes ; then
6508 def_mga='#define CONFIG_MGA 1'
6509 vomodules="mga $vomodules"
6510 else
6511 def_mga='#undef CONFIG_MGA'
6512 novomodules="mga $novomodules"
6514 echores "$_mga"
6517 echocheck "xmga"
6518 if test "$_xmga" = auto ; then
6519 _xmga=no
6520 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
6522 if test "$_xmga" = yes ; then
6523 def_xmga='#define CONFIG_XMGA 1'
6524 vomodules="xmga $vomodules"
6525 else
6526 def_xmga='#undef CONFIG_XMGA'
6527 novomodules="xmga $novomodules"
6529 echores "$_xmga"
6531 echocheck "zr"
6532 if test "$_zr" = auto ; then
6533 #36067's seem to identify themselves as 36057PQC's, so the line
6534 #below should work for 36067's and 36057's.
6535 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
6536 _zr=yes
6537 else
6538 _zr=no
6541 if test "$_zr" = yes ; then
6542 if test "$ffmpeg_internals" = yes ; then
6543 def_zr='#define CONFIG_ZR 1'
6544 vomodules="zr zr2 $vomodules"
6545 else
6546 res_comment="FFmpeg internal headers are required by zr, sorry"
6547 novomodules="zr $novomodules"
6548 def_zr='#undef CONFIG_ZR'
6550 else
6551 def_zr='#undef CONFIG_ZR'
6552 novomodules="zr zr2 $novomodules"
6554 echores "$_zr"
6556 echocheck "glamo"
6557 if test "$_glamo" = yes ; then
6558 def_glamo='#define CONFIG_GLAMO 1'
6559 _vomodules="glamo $_vomodules"
6560 else
6561 def_glamo='#undef CONFIG_GLAMO'
6562 _novomodules="glamo $_novomodules"
6564 echores "$_glamo"
6566 echocheck "UnRAR executable"
6567 if test "$_unrar_exec" = auto ; then
6568 _unrar_exec="yes"
6569 mingw32 && _unrar_exec="no"
6571 if test "$_unrar_exec" = yes ; then
6572 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
6573 else
6574 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
6576 echores "$_unrar_exec"
6578 echocheck "TV interface"
6579 if test "$_tv" = yes ; then
6580 def_tv='#define CONFIG_TV 1'
6581 inputmodules="tv $inputmodules"
6582 else
6583 noinputmodules="tv $noinputmodules"
6584 def_tv='#undef CONFIG_TV'
6586 echores "$_tv"
6589 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
6590 echocheck "*BSD BT848 bt8xx header"
6591 _ioctl_bt848_h=no
6592 for file in "machine/ioctl_bt848.h" \
6593 "dev/bktr/ioctl_bt848.h" \
6594 "dev/video/bktr/ioctl_bt848.h" \
6595 "dev/ic/bt8xx.h" ; do
6596 cat > $TMPC <<EOF
6597 #include <sys/types.h>
6598 #include <sys/ioctl.h>
6599 #include <$file>
6600 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
6602 if cc_check ; then
6603 _ioctl_bt848_h=yes
6604 _ioctl_bt848_h_name="$file"
6605 break;
6607 done
6608 if test "$_ioctl_bt848_h" = yes ; then
6609 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6610 res_comment="using $_ioctl_bt848_h_name"
6611 else
6612 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6614 echores "$_ioctl_bt848_h"
6616 echocheck "*BSD ioctl_meteor.h"
6617 _ioctl_meteor_h=no
6618 for file in "machine/ioctl_meteor.h" \
6619 "dev/bktr/ioctl_meteor.h" \
6620 "dev/video/bktr/ioctl_meteor.h" ; do
6621 cat > $TMPC <<EOF
6622 #include <sys/types.h>
6623 #include <$file>
6624 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
6626 if cc_check ; then
6627 _ioctl_meteor_h=yes
6628 _ioctl_meteor_h_name="$file"
6629 break;
6631 done
6632 if test "$_ioctl_meteor_h" = yes ; then
6633 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6634 res_comment="using $_ioctl_meteor_h_name"
6635 else
6636 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6638 echores "$_ioctl_meteor_h"
6640 echocheck "*BSD BrookTree 848 TV interface"
6641 if test "$_tv_bsdbt848" = auto ; then
6642 _tv_bsdbt848=no
6643 if test "$_tv" = yes ; then
6644 cat > $TMPC <<EOF
6645 #include <sys/types.h>
6646 $def_ioctl_meteor_h_name
6647 $def_ioctl_bt848_h_name
6648 #ifdef IOCTL_METEOR_H_NAME
6649 #include IOCTL_METEOR_H_NAME
6650 #endif
6651 #ifdef IOCTL_BT848_H_NAME
6652 #include IOCTL_BT848_H_NAME
6653 #endif
6654 int main(void) {
6655 ioctl(0, METEORSINPUT, 0);
6656 ioctl(0, TVTUNER_GETFREQ, 0);
6657 return 0;
6660 cc_check && _tv_bsdbt848=yes
6663 if test "$_tv_bsdbt848" = yes ; then
6664 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
6665 inputmodules="tv-bsdbt848 $inputmodules"
6666 else
6667 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
6668 noinputmodules="tv-bsdbt848 $noinputmodules"
6670 echores "$_tv_bsdbt848"
6671 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
6674 echocheck "DirectShow TV interface"
6675 if test "$_tv_dshow" = auto ; then
6676 _tv_dshow=no
6677 if test "$_tv" = yes && win32 ; then
6678 cat > $TMPC <<EOF
6679 #include <ole2.h>
6680 int main(void) {
6681 void* p;
6682 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6683 return 0;
6686 cc_check -lole32 -luuid && _tv_dshow=yes
6689 if test "$_tv_dshow" = yes ; then
6690 inputmodules="tv-dshow $inputmodules"
6691 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
6692 extra_ldflags="$extra_ldflags -lole32 -luuid"
6693 else
6694 noinputmodules="tv-dshow $noinputmodules"
6695 def_tv_dshow='#undef CONFIG_TV_DSHOW'
6697 echores "$_tv_dshow"
6700 echocheck "Video 4 Linux TV interface"
6701 if test "$_tv_v4l1" = auto ; then
6702 _tv_v4l1=no
6703 if test "$_tv" = yes && linux ; then
6704 header_check linux/videodev.h && _tv_v4l1=yes
6707 if test "$_tv_v4l1" = yes ; then
6708 _audio_input=yes
6709 _tv_v4l=yes
6710 def_tv_v4l='#define CONFIG_TV_V4L 1'
6711 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
6712 inputmodules="tv-v4l $inputmodules"
6713 else
6714 noinputmodules="tv-v4l1 $noinputmodules"
6715 def_tv_v4l='#undef CONFIG_TV_V4L'
6717 echores "$_tv_v4l1"
6720 echocheck "Video 4 Linux 2 TV interface"
6721 if test "$_tv_v4l2" = auto ; then
6722 _tv_v4l2=no
6723 if test "$_tv" = yes && linux ; then
6724 header_check linux/videodev2.h && _tv_v4l2=yes
6727 if test "$_tv_v4l2" = yes ; then
6728 _audio_input=yes
6729 _tv_v4l=yes
6730 def_tv_v4l='#define CONFIG_TV_V4L 1'
6731 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
6732 inputmodules="tv-v4l2 $inputmodules"
6733 else
6734 noinputmodules="tv-v4l2 $noinputmodules"
6735 def_tv_v4l2='#undef CONFIG_TV_V4L2'
6737 echores "$_tv_v4l2"
6740 echocheck "Radio interface"
6741 if test "$_radio" = yes ; then
6742 def_radio='#define CONFIG_RADIO 1'
6743 inputmodules="radio $inputmodules"
6744 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6745 _radio_capture=no
6747 if test "$_radio_capture" = yes ; then
6748 _audio_input=yes
6749 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
6750 else
6751 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6753 else
6754 noinputmodules="radio $noinputmodules"
6755 def_radio='#undef CONFIG_RADIO'
6756 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6757 _radio_capture=no
6759 echores "$_radio"
6760 echocheck "Capture for Radio interface"
6761 echores "$_radio_capture"
6763 echocheck "Video 4 Linux 2 Radio interface"
6764 if test "$_radio_v4l2" = auto ; then
6765 _radio_v4l2=no
6766 if test "$_radio" = yes && linux ; then
6767 header_check linux/videodev2.h && _radio_v4l2=yes
6770 if test "$_radio_v4l2" = yes ; then
6771 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
6772 else
6773 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
6775 echores "$_radio_v4l2"
6777 echocheck "Video 4 Linux Radio interface"
6778 if test "$_radio_v4l" = auto ; then
6779 _radio_v4l=no
6780 if test "$_radio" = yes && linux ; then
6781 header_check linux/videodev.h && _radio_v4l=yes
6784 if test "$_radio_v4l" = yes ; then
6785 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
6786 else
6787 def_radio_v4l='#undef CONFIG_RADIO_V4L'
6789 echores "$_radio_v4l"
6791 if freebsd || netbsd || openbsd || dragonfly || bsdos \
6792 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6793 echocheck "*BSD BrookTree 848 Radio interface"
6794 _radio_bsdbt848=no
6795 cat > $TMPC <<EOF
6796 #include <sys/types.h>
6797 $def_ioctl_bt848_h_name
6798 #ifdef IOCTL_BT848_H_NAME
6799 #include IOCTL_BT848_H_NAME
6800 #endif
6801 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
6803 cc_check && _radio_bsdbt848=yes
6804 echores "$_radio_bsdbt848"
6805 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
6807 if test "$_radio_bsdbt848" = yes ; then
6808 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
6809 else
6810 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
6813 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6814 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6815 die "Radio driver requires BSD BT848, V4L or V4L2!"
6818 echocheck "Video 4 Linux 2 MPEG PVR interface"
6819 if test "$_pvr" = auto ; then
6820 _pvr=no
6821 if test "$_tv_v4l2" = yes && linux ; then
6822 cat > $TMPC <<EOF
6823 #include <linux/videodev2.h>
6824 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
6826 cc_check && _pvr=yes
6829 if test "$_pvr" = yes ; then
6830 def_pvr='#define CONFIG_PVR 1'
6831 inputmodules="pvr $inputmodules"
6832 else
6833 noinputmodules="pvr $noinputmodules"
6834 def_pvr='#undef CONFIG_PVR'
6836 echores "$_pvr"
6839 echocheck "ftp"
6840 if test "$_ftp" = "auto" ; then
6841 test "$networking" = "yes" && ! beos && _ftp=yes
6843 if test "$_ftp" = yes ; then
6844 def_ftp='#define CONFIG_FTP 1'
6845 inputmodules="ftp $inputmodules"
6846 else
6847 noinputmodules="ftp $noinputmodules"
6848 def_ftp='#undef CONFIG_FTP'
6850 echores "$_ftp"
6852 echocheck "vstream client"
6853 if test "$_vstream" = auto ; then
6854 _vstream=no
6855 cat > $TMPC <<EOF
6856 #include <vstream-client.h>
6857 void vstream_error(const char *format, ... ) {}
6858 int main(void) { vstream_start(); return 0; }
6860 cc_check -lvstream-client && _vstream=yes
6862 if test "$_vstream" = yes ; then
6863 def_vstream='#define CONFIG_VSTREAM 1'
6864 inputmodules="vstream $inputmodules"
6865 extra_ldflags="$extra_ldflags -lvstream-client"
6866 else
6867 noinputmodules="vstream $noinputmodules"
6868 def_vstream='#undef CONFIG_VSTREAM'
6870 echores "$_vstream"
6873 echocheck "OSD menu"
6874 if test "$_menu" = yes ; then
6875 def_menu='#define CONFIG_MENU 1'
6876 test $_dvbin = "yes" && _menu_dvbin=yes
6877 else
6878 def_menu='#undef CONFIG_MENU'
6879 _menu_dvbin=no
6881 echores "$_menu"
6884 echocheck "Subtitles sorting"
6885 if test "$_sortsub" = yes ; then
6886 def_sortsub='#define CONFIG_SORTSUB 1'
6887 else
6888 def_sortsub='#undef CONFIG_SORTSUB'
6890 echores "$_sortsub"
6893 echocheck "XMMS inputplugin support"
6894 if test "$_xmms" = yes ; then
6895 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6896 _xmmsplugindir=$(xmms-config --input-plugin-dir)
6897 _xmmslibdir=$(xmms-config --exec-prefix)/lib
6898 else
6899 _xmmsplugindir=/usr/lib/xmms/Input
6900 _xmmslibdir=/usr/lib
6903 def_xmms='#define CONFIG_XMMS 1'
6904 if darwin ; then
6905 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6906 else
6907 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6909 else
6910 def_xmms='#undef CONFIG_XMMS'
6912 echores "$_xmms"
6914 if test "$_charset" != "noconv" ; then
6915 def_charset="#define MSG_CHARSET \"$_charset\""
6916 else
6917 def_charset="#undef MSG_CHARSET"
6918 _charset="UTF-8"
6921 #############################################################################
6923 echocheck "automatic gdb attach"
6924 if test "$_crash_debug" = yes ; then
6925 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
6926 else
6927 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
6928 _crash_debug=no
6930 echores "$_crash_debug"
6932 echocheck "compiler support for noexecstack"
6933 if cflag_check -Wl,-z,noexecstack ; then
6934 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
6935 echores "yes"
6936 else
6937 echores "no"
6940 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
6941 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6942 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6943 echores "yes"
6944 else
6945 echores "no"
6949 # Dynamic linking flags
6950 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6951 _ld_dl_dynamic=''
6952 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
6953 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
6954 _ld_dl_dynamic='-rdynamic'
6957 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6958 bsdos && extra_ldflags="$extra_ldflags -ldvd"
6959 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
6961 def_debug='#undef MP_DEBUG'
6962 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
6965 echocheck "joystick"
6966 def_joystick='#undef CONFIG_JOYSTICK'
6967 if test "$_joystick" = yes ; then
6968 if linux || freebsd ; then
6969 # TODO add some check
6970 def_joystick='#define CONFIG_JOYSTICK 1'
6971 else
6972 _joystick="no"
6973 res_comment="unsupported under $system_name"
6976 echores "$_joystick"
6978 echocheck "lirc"
6979 if test "$_lirc" = auto ; then
6980 _lirc=no
6981 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
6983 if test "$_lirc" = yes ; then
6984 def_lirc='#define CONFIG_LIRC 1'
6985 libs_mplayer="$libs_mplayer -llirc_client"
6986 else
6987 def_lirc='#undef CONFIG_LIRC'
6989 echores "$_lirc"
6991 echocheck "lircc"
6992 if test "$_lircc" = auto ; then
6993 _lircc=no
6994 header_check lirc/lircc.h -llircc && _lircc=yes
6996 if test "$_lircc" = yes ; then
6997 def_lircc='#define CONFIG_LIRCC 1'
6998 libs_mplayer="$libs_mplayer -llircc"
6999 else
7000 def_lircc='#undef CONFIG_LIRCC'
7002 echores "$_lircc"
7004 if arm; then
7005 # Detect maemo development platform libraries availability (http://www.maemo.org),
7006 # they are used when run on Nokia 770|8x0
7007 echocheck "maemo (Nokia 770|8x0)"
7008 if test "$_maemo" = auto ; then
7009 _maemo=no
7010 statement_check libosso.h 'osso_initialize('', '', 0, NULL)' $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
7012 if test "$_maemo" = yes ; then
7013 def_maemo='#define CONFIG_MAEMO 1'
7014 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
7015 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
7016 else
7017 def_maemo='#undef CONFIG_MAEMO'
7019 echores "$_maemo"
7022 #############################################################################
7024 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7025 # the OMF format needs to come after the 'extern symbol prefix' check, which
7026 # uses nm.
7027 if os2 ; then
7028 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7031 #############################################################################
7032 # 64 bit file offsets?
7033 if test "$_largefiles" = yes || freebsd ; then
7034 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7035 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7036 # dvdread support requires this (for off64_t)
7037 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7041 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
7043 # This must be the last test to be performed. Any other tests following it
7044 # could fail due to linker errors. libdvdnavmini is intentionally not linked
7045 # against libdvdread (to permit MPlayer to use its own copy of the library).
7046 # So any compilation using the flags added here but not linking against
7047 # libdvdread can fail.
7048 echocheck "DVD support (libdvdnav)"
7049 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
7050 _dvdnav=no
7052 dvdnav_internal=no
7053 if test "$_dvdnav" = auto ; then
7054 if test "$_dvdread_internal" = yes ; then
7055 _dvdnav=yes
7056 dvdnav_internal=yes
7057 res_comment="internal"
7058 else
7059 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7062 if test "$_dvdnav" = auto ; then
7063 _dvdnav=no
7064 _dvdnavdir=$($_dvdnavconfig --cflags)
7065 _dvdnavlibs=$($_dvdnavconfig --libs)
7066 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7068 if test "$_dvdnav" = yes ; then
7069 _largefiles=yes
7070 def_dvdnav='#define CONFIG_DVDNAV 1'
7071 if test "$dvdnav_internal" = yes ; then
7072 cflags_libdvdnav="-Ilibdvdnav"
7073 inputmodules="dvdnav(internal) $inputmodules"
7074 else
7075 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
7076 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
7077 inputmodules="dvdnav $inputmodules"
7079 else
7080 def_dvdnav='#undef CONFIG_DVDNAV'
7081 noinputmodules="dvdnav $noinputmodules"
7083 echores "$_dvdnav"
7085 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
7086 # Read dvdnav comment above.
7088 mak_enable () {
7089 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7090 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7091 nprefix=$3;
7092 for part in $list; do
7093 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7094 echo "${nprefix}_$part = yes"
7096 done
7099 #############################################################################
7100 echo "Creating config.mak"
7101 cat > config.mak << EOF
7102 # -------- Generated by configure -----------
7104 # Ensure that locale settings do not interfere with shell commands.
7105 export LC_ALL = C
7107 CONFIGURATION = $configuration
7109 CHARSET = $_charset
7110 DOC_LANGS = $language_doc
7111 DOC_LANG_ALL = $doc_lang_all
7112 MAN_LANGS = $language_man
7113 MAN_LANG_ALL = $man_lang_all
7114 MSG_LANGS = $language_msg
7115 MSG_LANG_ALL = $msg_lang_all
7117 prefix = \$(DESTDIR)$_prefix
7118 BINDIR = \$(DESTDIR)$_bindir
7119 DATADIR = \$(DESTDIR)$_datadir
7120 LIBDIR = \$(DESTDIR)$_libdir
7121 MANDIR = \$(DESTDIR)$_mandir
7122 CONFDIR = \$(DESTDIR)$_confdir
7123 LOCALEDIR = \$(DESTDIR)$_localedir
7125 AR = $_ar
7126 AS = $_cc
7127 CC = $_cc
7128 CXX = $_cc
7129 HOST_CC = $_host_cc
7130 INSTALL = $_install
7131 INSTALLSTRIP = $_install_strip
7132 WINDRES = $_windres
7134 CFLAGS = $WARNFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
7135 CXXFLAGS = $WARNFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
7136 DEPFLAGS = $DEPFLAGS
7138 CFLAGS_DHAHELPER = $cflags_dhahelper
7139 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
7140 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
7141 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
7142 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
7143 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
7144 CFLAGS_STACKREALIGN = $cflags_stackrealign
7145 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
7146 CFLAGS_TREMOR_LOW = $cflags_tremor_low
7148 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
7149 EXTRALIBS_MPLAYER = $libs_mplayer
7151 GETCH = $_getch
7152 TIMER = $_timer
7154 EXESUF = $_exesuf
7155 EXESUFS_ALL = .exe
7157 ARCH = $arch
7158 $(mak_enable "$arch_all" "$arch" ARCH)
7159 $(mak_enable "$subarch_all" "$subarch" ARCH)
7160 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
7162 MPLAYER = $_mplayer
7164 NEED_GETTIMEOFDAY = $_need_gettimeofday
7165 NEED_GLOB = $_need_glob
7166 NEED_MMAP = $_need_mmap
7167 NEED_SETENV = $_need_setenv
7168 NEED_SHMEM = $_need_shmem
7169 NEED_STRSEP = $_need_strsep
7170 NEED_SWAB = $_need_swab
7171 NEED_VSSCANF = $_need_vsscanf
7173 # features
7174 3DFX = $_3dfx
7175 AA = $_aa
7176 ALSA1X = $_alsa1x
7177 ALSA9 = $_alsa9
7178 ALSA5 = $_alsa5
7179 APPLE_IR = $_apple_ir
7180 APPLE_REMOTE = $_apple_remote
7181 ARTS = $_arts
7182 AUDIO_INPUT = $_audio_input
7183 BITMAP_FONT = $_bitmap_font
7184 BL = $_bl
7185 CACA = $_caca
7186 CDDA = $_cdda
7187 CDDB = $_cddb
7188 COREAUDIO = $_coreaudio
7189 COREVIDEO = $_corevideo
7190 DART = $_dart
7191 DGA = $_dga
7192 DIRECT3D = $_direct3d
7193 DIRECTFB = $_directfb
7194 DIRECTX = $_directx
7195 DVBIN = $_dvbin
7196 DVDNAV = $_dvdnav
7197 DVDNAV_INTERNAL = $dvdnav_internal
7198 DVDREAD = $_dvdread
7199 DVDREAD_INTERNAL = $_dvdread_internal
7200 DXR2 = $_dxr2
7201 DXR3 = $_dxr3
7202 ESD = $_esd
7203 FAAD = $_faad
7204 FAAD_INTERNAL = $_faad_internal
7205 FASTMEMCPY = $_fastmemcpy
7206 FBDEV = $_fbdev
7207 GLAMO = $_glamo
7208 FREETYPE = $_freetype
7209 FTP = $_ftp
7210 GIF = $_gif
7211 GGI = $_ggi
7212 GL = $_gl
7213 GL_WIN32 = $_gl_win32
7214 GL_X11 = $_gl_x11
7215 GL_SDL = $_gl_sdl
7216 MATRIXVIEW = $matrixview
7217 HAVE_POSIX_SELECT = $_posix_select
7218 HAVE_SYS_MMAN_H = $_mman
7219 IVTV = $_ivtv
7220 JACK = $_jack
7221 JOYSTICK = $_joystick
7222 JPEG = $_jpeg
7223 KAI = $_kai
7224 KVA = $_kva
7225 LADSPA = $_ladspa
7226 LIBA52 = $_liba52
7227 LIBASS = $_ass
7228 LIBBLURAY = $_bluray
7229 LIBBS2B = $_libbs2b
7230 LIBDCA = $_libdca
7231 LIBDV = $_libdv
7232 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7233 LIBLZO = $_liblzo
7234 LIBMAD = $_mad
7235 LIBMENU = $_menu
7236 LIBMENU_DVBIN = $_menu_dvbin
7237 LIBMPEG2 = $_libmpeg2
7238 LIBNEMESI = $_nemesi
7239 LIBNUT = $_libnut
7240 LIBSMBCLIENT = $_smb
7241 LIBTHEORA = $_theora
7242 LIRC = $_lirc
7243 LIVE555 = $_live
7244 MACOSX_FINDER = $_macosx_finder
7245 MD5SUM = $_md5sum
7246 MGA = $_mga
7247 MNG = $_mng
7248 MP3LIB = $_mp3lib
7249 MPG123 = $_mpg123
7250 MUSEPACK = $_musepack
7251 NAS = $_nas
7252 NATIVE_RTSP = $_native_rtsp
7253 NETWORKING = $networking
7254 OPENAL = $_openal
7255 OSS = $_ossaudio
7256 PE_EXECUTABLE = $_pe_executable
7257 PNG = $_png
7258 PNM = $_pnm
7259 PRIORITY = $_priority
7260 PULSE = $_pulse
7261 PVR = $_pvr
7262 QTX_CODECS = $_qtx
7263 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7264 QTX_EMULATION = $_qtx_emulation
7265 QUARTZ = $_quartz
7266 RADIO=$_radio
7267 RADIO_CAPTURE=$_radio_capture
7268 REAL_CODECS = $_real
7269 S3FB = $_s3fb
7270 SDL = $_sdl
7271 SPEEX = $_speex
7272 STREAM_CACHE = $_stream_cache
7273 SGIAUDIO = $_sgiaudio
7274 SUNAUDIO = $_sunaudio
7275 SVGA = $_svga
7276 TDFXFB = $_tdfxfb
7277 TDFXVID = $_tdfxvid
7278 TGA = $_tga
7279 TREMOR_INTERNAL = $_tremor_internal
7280 TV = $_tv
7281 TV_BSDBT848 = $_tv_bsdbt848
7282 TV_DSHOW = $_tv_dshow
7283 TV_V4L = $_tv_v4l
7284 TV_V4L1 = $_tv_v4l1
7285 TV_V4L2 = $_tv_v4l2
7286 UNRAR_EXEC = $_unrar_exec
7287 V4L2 = $_v4l2
7288 VCD = $_vcd
7289 VDPAU = $_vdpau
7290 VESA = $_vesa
7291 VIDIX = $_vidix
7292 VIDIX_PCIDB = $_vidix_pcidb_val
7293 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7294 VIDIX_IVTV=$_vidix_drv_ivtv
7295 VIDIX_MACH64=$_vidix_drv_mach64
7296 VIDIX_MGA=$_vidix_drv_mga
7297 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7298 VIDIX_NVIDIA=$_vidix_drv_nvidia
7299 VIDIX_PM2=$_vidix_drv_pm2
7300 VIDIX_PM3=$_vidix_drv_pm3
7301 VIDIX_RADEON=$_vidix_drv_radeon
7302 VIDIX_RAGE128=$_vidix_drv_rage128
7303 VIDIX_S3=$_vidix_drv_s3
7304 VIDIX_SH_VEU=$_vidix_drv_sh_veu
7305 VIDIX_SIS=$_vidix_drv_sis
7306 VIDIX_UNICHROME=$_vidix_drv_unichrome
7307 VORBIS = $_vorbis
7308 VSTREAM = $_vstream
7309 WII = $_wii
7310 WIN32DLL = $_win32dll
7311 WIN32WAVEOUT = $_win32waveout
7312 WIN32_EMULATION = $_win32_emulation
7313 WINVIDIX = $winvidix
7314 X11 = $_x11
7315 XANIM_CODECS = $_xanim
7316 XMGA = $_xmga
7317 XMMS_PLUGINS = $_xmms
7318 XV = $_xv
7319 XVID4 = $_xvid
7320 XVIDIX = $xvidix
7321 XVMC = $_xvmc
7322 XVR100 = $_xvr100
7323 YUV4MPEG = $_yuv4mpeg
7324 ZR = $_zr
7326 # FFmpeg
7327 FFMPEG = $ffmpeg
7328 FFMPEG_EVAL_API = $ffmpeg_eval_api
7329 FFMPEG_INTERNALS = $ffmpeg_internals
7330 FFMPEG_SOURCE_PATH = $_ffmpeg_source
7332 RANLIB = $_ranlib
7333 YASM = $_yasm
7334 YASMFLAGS = $YASMFLAGS
7336 CONFIG_BZLIB = $bzlib
7337 CONFIG_VDPAU = $_vdpau
7338 CONFIG_XVMC = $_xvmc
7339 CONFIG_ZLIB = $_zlib
7341 HAVE_PTHREADS = $_pthreads
7342 HAVE_SHM = $_shm
7343 HAVE_W32THREADS = $_w32threads
7344 HAVE_YASM = $have_yasm
7348 #############################################################################
7350 ff_config_enable () {
7351 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7352 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7353 _nprefix=$3;
7354 test -z "$_nprefix" && _nprefix='CONFIG'
7355 for part in $list; do
7356 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7357 echo "#define ${_nprefix}_$part 1"
7358 else
7359 echo "#define ${_nprefix}_$part 0"
7361 done
7364 echo "Creating config.h"
7365 cat > $TMPH << EOF
7366 /*----------------------------------------------------------------------------
7367 ** This file has been automatically generated by configure any changes in it
7368 ** will be lost when you run configure again.
7369 ** Instead of modifying definitions here, use the --enable/--disable options
7370 ** of the configure script! See ./configure --help for details.
7371 *---------------------------------------------------------------------------*/
7373 #ifndef MPLAYER_CONFIG_H
7374 #define MPLAYER_CONFIG_H
7376 /* Undefine this if you do not want to select mono audio (left or right)
7377 with a stereo MPEG layer 2/3 audio stream. The command line option
7378 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7379 right-only), with 0 being the default.
7381 #define CONFIG_FAKE_MONO 1
7383 /* set up audio OUTBURST. Do not change this! */
7384 #define OUTBURST 512
7386 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7387 #undef FAST_OSD
7388 #undef FAST_OSD_TABLE
7390 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
7391 #define MPEG12_POSTPROC 1
7392 #define ATTRIBUTE_ALIGNED_MAX 16
7396 #define CONFIGURATION "$configuration"
7398 #define MPLAYER_DATADIR "$_datadir"
7399 #define MPLAYER_CONFDIR "$_confdir"
7400 #define MPLAYER_LIBDIR "$_libdir"
7401 #define MPLAYER_LOCALEDIR "$_localedir"
7403 $def_translation
7405 /* definitions needed by included libraries */
7406 #define HAVE_INTTYPES_H 1
7407 /* libmpeg2 + FFmpeg */
7408 $def_fast_inttypes
7409 /* libdvdcss */
7410 #define HAVE_ERRNO_H 1
7411 /* libdvdcss + libdvdread */
7412 #define HAVE_LIMITS_H 1
7413 /* libdvdcss + libfaad2 */
7414 #define HAVE_UNISTD_H 1
7415 /* libfaad2 + libdvdread */
7416 #define STDC_HEADERS 1
7417 #define HAVE_MEMCPY 1
7418 /* libfaad2 */
7419 #define HAVE_STDLIB_H 1
7420 #define HAVE_STRING_H 1
7421 #define HAVE_STRINGS_H 1
7422 #define HAVE_SYS_STAT_H 1
7423 #define HAVE_SYS_TYPES_H 1
7424 /* libdvdnav */
7425 #define READ_CACHE_TRACE 0
7426 /* libdvdread */
7427 #define HAVE_DLFCN_H 1
7428 $def_dvdcss
7431 /* system headers */
7432 $def_alloca_h
7433 $def_alsa_asoundlib_h
7434 $def_altivec_h
7435 $def_malloc_h
7436 $def_mman_h
7437 $def_mman_has_map_failed
7438 $def_soundcard_h
7439 $def_sys_asoundlib_h
7440 $def_sys_soundcard_h
7441 $def_sys_sysinfo_h
7442 $def_termios_h
7443 $def_termios_sys_h
7444 $def_winsock2_h
7447 /* system functions */
7448 $def_gethostbyname2
7449 $def_gettimeofday
7450 $def_glob
7451 $def_langinfo
7452 $def_lrintf
7453 $def_map_memalign
7454 $def_memalign
7455 $def_nanosleep
7456 $def_posix_select
7457 $def_select
7458 $def_setenv
7459 $def_setmode
7460 $def_shm
7461 $def_strsep
7462 $def_swab
7463 $def_sysi86
7464 $def_sysi86_iv
7465 $def_termcap
7466 $def_termios
7467 $def_vsscanf
7470 /* system-specific features */
7471 $def_asmalign_pot
7472 $def_builtin_expect
7473 $def_dl
7474 $def_dos_paths
7475 $def_extern_asm
7476 $def_extern_prefix
7477 $def_iconv
7478 $def_kstat
7479 $def_macosx_bundle
7480 $def_macosx_finder
7481 $def_maemo
7482 $def_named_asm_args
7483 $def_priority
7484 $def_quicktime
7485 $def_restrict_keyword
7486 $def_rtc
7487 $def_unrar_exec
7490 /* configurable options */
7491 $def_charset
7492 $def_crash_debug
7493 $def_debug
7494 $def_dynamic_plugins
7495 $def_fastmemcpy
7496 $def_menu
7497 $def_runtime_cpudetection
7498 $def_sighandler
7499 $def_sortsub
7500 $def_stream_cache
7501 $def_pthread_cache
7504 /* CPU stuff */
7505 #define __CPU__ $iproc
7506 $def_ebx_available
7507 $def_words_endian
7508 $def_bigendian
7509 $(ff_config_enable "$arch_all" "$arch" "ARCH")
7510 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
7511 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
7514 /* Blu-ray/DVD/VCD/CD */
7515 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
7516 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
7517 $def_bluray
7518 $def_bsdi_dvd
7519 $def_cddb
7520 $def_cdio
7521 $def_cdparanoia
7522 $def_cdrom
7523 $def_dvd
7524 $def_dvd_bsd
7525 $def_dvd_darwin
7526 $def_dvd_linux
7527 $def_dvd_openbsd
7528 $def_dvdio
7529 $def_dvdnav
7530 $def_dvdread
7531 $def_hpux_scsi_h
7532 $def_libcdio
7533 $def_sol_scsi_h
7534 $def_vcd
7537 /* codec libraries */
7538 $def_faad
7539 $def_faad_internal
7540 $def_liba52
7541 $def_libdca
7542 $def_libdv
7543 $def_liblzo
7544 $def_libmpeg2
7545 $def_mad
7546 $def_mp3lib
7547 $def_mpg123
7548 $def_musepack
7549 $def_speex
7550 $def_theora
7551 $def_tremor
7552 $def_vorbis
7553 $def_xvid
7554 $def_zlib
7556 $def_libnut
7559 /* binary codecs */
7560 $def_qtx
7561 $def_qtx_win32
7562 $def_real
7563 $def_win32_loader
7564 $def_win32dll
7565 $def_xanim
7566 $def_xmms
7567 #define BINARY_CODECS_PATH "$_codecsdir"
7568 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7571 /* Audio output drivers */
7572 $def_alsa
7573 $def_alsa1x
7574 $def_alsa5
7575 $def_alsa9
7576 $def_arts
7577 $def_coreaudio
7578 $def_dart
7579 $def_esd
7580 $def_esd_latency
7581 $def_jack
7582 $def_kai
7583 $def_nas
7584 $def_openal
7585 $def_openal_h
7586 $def_ossaudio
7587 $def_ossaudio_devdsp
7588 $def_ossaudio_devmixer
7589 $def_pulse
7590 $def_sgiaudio
7591 $def_sunaudio
7592 $def_win32waveout
7594 $def_ladspa
7595 $def_libbs2b
7598 /* input */
7599 $def_apple_ir
7600 $def_apple_remote
7601 $def_ioctl_bt848_h_name
7602 $def_ioctl_meteor_h_name
7603 $def_joystick
7604 $def_lirc
7605 $def_lircc
7606 $def_pvr
7607 $def_radio
7608 $def_radio_bsdbt848
7609 $def_radio_capture
7610 $def_radio_v4l
7611 $def_radio_v4l2
7612 $def_tv
7613 $def_tv_bsdbt848
7614 $def_tv_dshow
7615 $def_tv_v4l
7616 $def_tv_v4l1
7617 $def_tv_v4l2
7620 /* font stuff */
7621 $def_ass
7622 $def_bitmap_font
7623 $def_enca
7624 $def_fontconfig
7625 $def_freetype
7626 $def_fribidi
7629 /* networking */
7630 $def_closesocket
7631 $def_ftp
7632 $def_inet6
7633 $def_inet_aton
7634 $def_inet_pton
7635 $def_live
7636 $def_nemesi
7637 $def_networking
7638 $def_smb
7639 $def_socklen_t
7640 $def_vstream
7643 /* libvo options */
7644 $def_3dfx
7645 $def_aa
7646 $def_bl
7647 $def_caca
7648 $def_corevideo
7649 $def_dga
7650 $def_dga1
7651 $def_dga2
7652 $def_direct3d
7653 $def_directfb
7654 $def_directx
7655 $def_dvb
7656 $def_dvbin
7657 $def_dxr2
7658 $def_dxr3
7659 $def_fbdev
7660 $def_ggi
7661 $def_ggiwmh
7662 $def_gif
7663 $def_gif_4
7664 $def_gif_tvt_hack
7665 $def_gl
7666 $def_gl_win32
7667 $def_glamo
7668 $def_gl_x11
7669 $def_gl_sdl
7670 $def_matrixview
7671 $def_ivtv
7672 $def_jpeg
7673 $def_kva
7674 $def_md5sum
7675 $def_mga
7676 $def_mng
7677 $def_png
7678 $def_pnm
7679 $def_quartz
7680 $def_s3fb
7681 $def_sdl
7682 $def_sdl_sdl_h
7683 $def_svga
7684 $def_tdfxfb
7685 $def_tdfxvid
7686 $def_tga
7687 $def_v4l2
7688 $def_vdpau
7689 $def_vesa
7690 $def_vidix
7691 $def_vidix_drv_cyberblade
7692 $def_vidix_drv_ivtv
7693 $def_vidix_drv_mach64
7694 $def_vidix_drv_mga
7695 $def_vidix_drv_mga_crtc2
7696 $def_vidix_drv_nvidia
7697 $def_vidix_drv_pm3
7698 $def_vidix_drv_radeon
7699 $def_vidix_drv_rage128
7700 $def_vidix_drv_s3
7701 $def_vidix_drv_sh_veu
7702 $def_vidix_drv_sis
7703 $def_vidix_drv_unichrome
7704 $def_vidix_pfx
7705 $def_vm
7706 $def_wii
7707 $def_x11
7708 $def_xdpms
7709 $def_xf86keysym
7710 $def_xinerama
7711 $def_xmga
7712 $def_xss
7713 $def_xv
7714 $def_xvmc
7715 $def_xvr100
7716 $def_yuv4mpeg
7717 $def_zr
7720 /* FFmpeg */
7721 $def_ffmpeg
7722 $def_ffmpeg_eval_api
7723 $def_ffmpeg_internals
7725 $def_arpa_inet_h
7726 $def_bswap
7727 $def_bzlib
7728 $def_dcbzl
7729 $def_exp2
7730 $def_exp2f
7731 $def_fast_64bit
7732 $def_fast_unaligned
7733 $def_llrint
7734 $def_log2
7735 $def_log2f
7736 $def_lrint
7737 $def_memalign_hack
7738 $def_mkstemp
7739 $def_posix_memalign
7740 $def_pthreads
7741 $def_round
7742 $def_roundf
7743 $def_ten_operands
7744 $def_threads
7745 $def_truncf
7746 $def_xform_asm
7747 $def_yasm
7749 #define HAVE_INLINE_ASM 1
7751 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
7752 #ifndef MP_DEBUG
7753 #define HAVE_EBP_AVAILABLE 1
7754 #else
7755 #define HAVE_EBP_AVAILABLE 0
7756 #endif
7758 #endif /* MPLAYER_CONFIG_H */
7761 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
7762 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
7764 #############################################################################
7766 ./version.sh `$_cc -dumpversion`
7768 cat << EOF
7770 Config files successfully generated by ./configure $configuration !
7772 Install prefix: $_prefix
7773 Data directory: $_datadir
7774 Config direct.: $_confdir
7776 Byte order: $_byte_order
7777 Optimizing for: $_optimizing
7779 Languages:
7780 Messages (in addition to English): $language_msg
7781 Manual pages: $language_man
7782 Documentation: $language_doc
7784 Enabled optional drivers:
7785 Input: $inputmodules
7786 Codecs: $codecmodules
7787 Audio output: $aomodules
7788 Video output: $vomodules
7790 Disabled optional drivers:
7791 Input: $noinputmodules
7792 Codecs: $nocodecmodules
7793 Audio output: $noaomodules
7794 Video output: $novomodules
7796 'config.h' and 'config.mak' contain your configuration options.
7797 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7798 compile *** DO NOT REPORT BUGS if you tweak these files ***
7800 'make' will now compile MPlayer and 'make install' will install it.
7801 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7806 if test "$_mtrr" = yes ; then
7807 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$language_doc/video.html#mtrr)"
7808 echo
7811 if ! x86_32; then
7812 cat <<EOF
7813 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7814 operating system ($system_name). You may encounter a few files that cannot
7815 be played due to missing open source video/audio codec support.
7821 cat <<EOF
7822 Check $TMPLOG if you wonder why an autodetection failed (make sure
7823 development headers/packages are installed).
7825 NOTE: The --enable-* parameters unconditionally force options on, completely
7826 skipping autodetection. This behavior is unlike what you may be used to from
7827 autoconf-based configure scripts that can decide to override you. This greater
7828 level of control comes at a price. You may have to provide the correct compiler
7829 and linker flags yourself.
7830 If you used one of these options (except --enable-menu and similar ones that
7831 turn on internal features) and experience a compilation or linking failure,
7832 make sure you have passed the necessary compiler/linker flags to configure.
7834 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
7838 if test "$warn_cflags" = yes; then
7839 cat <<EOF
7841 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
7842 but:
7844 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
7846 It is strongly recommended to let MPlayer choose the correct CFLAGS!
7847 To do so, execute 'CFLAGS= ./configure <options>'
7852 # Last move:
7853 rm -rf "$mplayer_tmpdir"