rpm: Remove MEncoder from rpm packaging
[mplayer/glamo.git] / configure
blob1f350beecbef735dfc9a8aac8f4dd2ebd5c68598
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_a disable static FFmpeg [autodetect]
341 --disable-ffmpeg_so disable shared FFmpeg [autodetect]
342 --disable-tremor-internal disable internal Tremor [enabled]
343 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
344 --enable-tremor enable external Tremor [autodetect]
345 --disable-libvorbis disable libvorbis support [autodetect]
346 --disable-speex disable Speex support [autodetect]
347 --enable-theora enable OggTheora libraries [autodetect]
348 --enable-faad enable external FAAD2 (AAC) [autodetect]
349 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
350 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
351 --disable-ladspa disable LADSPA plugin support [autodetect]
352 --disable-libbs2b disable libbs2b audio filter support [autodetect]
353 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
354 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
355 --disable-mad disable libmad (MPEG audio) support [autodetect]
356 --enable-xmms enable XMMS input plugin support [disabled]
357 --enable-libdca enable libdca support [autodetect]
358 --disable-mp3lib disable builtin mp3lib [autodetect]
359 --disable-liba52 disable liba52 [autodetect]
360 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
361 --disable-musepack disable musepack support [autodetect]
363 Video output:
364 --disable-vidix disable VIDIX [for x86 *nix]
365 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
366 Available: cyberblade, ivtv, mach64, mga, mga_crtc2,
367 nvidia, pm2, pm3, radeon, rage128, s3, sis, unichrome
368 --disable-vidix-pcidb disable VIDIX PCI device name database
369 --enable-dhahelper enable VIDIX dhahelper support
370 --enable-svgalib_helper enable VIDIX svgalib_helper support
371 --enable-gl enable OpenGL video output [autodetect]
372 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
373 --enable-dga2 enable DGA 2 support [autodetect]
374 --enable-dga1 enable DGA 1 support [autodetect]
375 --enable-vesa enable VESA video output [autodetect]
376 --enable-svga enable SVGAlib video output [autodetect]
377 --enable-sdl enable SDL video output [autodetect]
378 --enable-kva enable KVA video output [autodetect]
379 --enable-aa enable AAlib video output [autodetect]
380 --enable-caca enable CACA video output [autodetect]
381 --enable-ggi enable GGI video output [autodetect]
382 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
383 --enable-direct3d enable Direct3D video output [autodetect]
384 --enable-directx enable DirectX video output [autodetect]
385 --enable-dxr2 enable DXR2 video output [autodetect]
386 --enable-dxr3 enable DXR3/H+ video output [autodetect]
387 --enable-ivtv enable IVTV TV-Out video output [autodetect]
388 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
389 --enable-dvb enable DVB video output [autodetect]
390 --enable-mga enable mga_vid video output [autodetect]
391 --enable-xmga enable mga_vid X11 video output [autodetect]
392 --enable-xv enable Xv video output [autodetect]
393 --enable-xvmc enable XvMC acceleration [disable]
394 --enable-vdpau enable VDPAU acceleration [autodetect]
395 --enable-vm enable XF86VidMode support [autodetect]
396 --enable-xinerama enable Xinerama support [autodetect]
397 --enable-x11 enable X11 video output [autodetect]
398 --enable-xshape enable XShape support [autodetect]
399 --disable-xss disable screensaver support via xss [autodetect]
400 --enable-fbdev enable FBDev video output [autodetect]
401 --enable-mlib enable mediaLib video output (Solaris) [disable]
402 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
403 --enable-tdfxfb enable tdfxfb video output [disable]
404 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
405 --enable-wii enable Nintendo Wii/GameCube video output [disable]
406 --enable-directfb enable DirectFB video output [autodetect]
407 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
408 --enable-bl enable Blinkenlights video output [disable]
409 --enable-tdfxvid enable tdfx_vid video output [disable]
410 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
411 --disable-tga disable Targa video output [enable]
412 --disable-pnm disable PNM video output [enable]
413 --disable-md5sum disable md5sum video output [enable]
414 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
415 --disable-corevideo disable CoreVideo video output [autodetect]
416 --disable-quartz disable Quartz video output [autodetect]
418 Audio output:
419 --disable-alsa disable ALSA audio output [autodetect]
420 --disable-ossaudio disable OSS audio output [autodetect]
421 --disable-arts disable aRts audio output [autodetect]
422 --disable-esd disable esd audio output [autodetect]
423 --disable-pulse disable Pulseaudio audio output [autodetect]
424 --disable-jack disable JACK audio output [autodetect]
425 --enable-openal enable OpenAL audio output [disable]
426 --disable-nas disable NAS audio output [autodetect]
427 --disable-sgiaudio disable SGI audio output [autodetect]
428 --disable-sunaudio disable Sun audio output [autodetect]
429 --disable-kai disable KAI audio output [autodetect]
430 --disable-dart disable DART audio output [autodetect]
431 --disable-win32waveout disable Windows waveout audio output [autodetect]
432 --disable-coreaudio disable CoreAudio audio output [autodetect]
433 --disable-select disable using select() on the audio device [enable]
435 Language options:
436 --enable-translation enable support for translated output [disable]
437 --charset=charset convert the console messages to this character set
438 --language-doc=lang language to use for the documentation [en]
439 --language-man=lang language to use for the man pages [en]
440 --language-msg=lang extra languages for program messages [all]
441 --language=lang default language to use [en]
442 Specific options override --language. You can pass a list of languages separated
443 by whitespace or commas instead of a single language. Nonexisting translations
444 will be dropped from each list. All translations available in the list will be
445 installed. The value "all" will activate all translations. The LINGUAS
446 environment variable is honored. In all cases the fallback is English.
447 The program always supports English-language output; additional message
448 languages are only installed if --enable-translation is also specified.
449 Available values for --language-doc are: all $doc_lang_all
450 Available values for --language-man are: all $man_lang_all
451 Available values for --language-msg are: all $msg_lang_all
453 Miscellaneous options:
454 --enable-runtime-cpudetection enable runtime CPU detection [disable]
455 --enable-cross-compile enable cross-compilation [autodetect]
456 --cc=COMPILER C compiler to build MPlayer [gcc]
457 --host-cc=COMPILER C compiler for tools needed while building [gcc]
458 --as=ASSEMBLER assembler to build MPlayer [as]
459 --nm=NM nm tool to build MPlayer [nm]
460 --yasm=YASM Yasm assembler to build MPlayer [yasm]
461 --ar=AR librarian to build MPlayer [ar]
462 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
463 --windres=WINDRES windres to build MPlayer [windres]
464 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
465 --enable-static build a statically linked binary
466 --with-install=PATH path to a custom install program
468 Advanced options:
469 --enable-mmx enable MMX [autodetect]
470 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
471 --enable-3dnow enable 3DNow! [autodetect]
472 --enable-3dnowext enable extended 3DNow! [autodetect]
473 --enable-sse enable SSE [autodetect]
474 --enable-sse2 enable SSE2 [autodetect]
475 --enable-ssse3 enable SSSE3 [autodetect]
476 --enable-shm enable shm [autodetect]
477 --enable-altivec enable AltiVec (PowerPC) [autodetect]
478 --enable-armv5te enable DSP extensions (ARM) [autodetect]
479 --enable-armv6 enable ARMv6 (ARM) [autodetect]
480 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
481 --enable-armvfp enable ARM VFP (ARM) [autodetect]
482 --enable-neon enable NEON (ARM) [autodetect]
483 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
484 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
485 --enable-big-endian force byte order to big-endian [autodetect]
486 --enable-debug[=1-3] compile-in debugging information [disable]
487 --enable-profile compile-in profiling information [disable]
488 --disable-sighandler disable sighandler for crashes [enable]
489 --enable-crash-debug enable automatic gdb attach on crash [disable]
490 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
491 --ffmpeg-source-dir=PATH enable features requiring internal FFmpeg headers
493 Use these options if autodetection fails:
494 --extra-cflags=FLAGS extra CFLAGS
495 --extra-ldflags=FLAGS extra LDFLAGS
496 --extra-libs=FLAGS extra linker flags
497 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
498 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
500 --with-freetype-config=PATH path to freetype-config
501 --with-glib-config=PATH path to glib*-config
502 --with-gtk-config=PATH path to gtk*-config
503 --with-sdl-config=PATH path to sdl*-config
504 --with-dvdnav-config=PATH path to dvdnav-config
505 --with-dvdread-config=PATH path to dvdread-config
507 This configure script is NOT autoconf-based, even though its output is similar.
508 It will try to autodetect all configuration options. If you --enable an option
509 it will be forcefully turned on, skipping autodetection. This can break
510 compilation, so you need to know what you are doing.
512 exit 0
513 } #show_help()
515 # GOTCHA: the variables below defines the default behavior for autodetection
516 # and have - unless stated otherwise - at least 2 states : yes no
517 # If autodetection is available then the third state is: auto
518 _mmx=auto
519 _3dnow=auto
520 _3dnowext=auto
521 _mmxext=auto
522 _sse=auto
523 _sse2=auto
524 _ssse3=auto
525 _cmov=auto
526 _fast_cmov=auto
527 _fast_clz=auto
528 _armv5te=auto
529 _armv6=auto
530 _armv6t2=auto
531 _armvfp=auto
532 neon=auto
533 _iwmmxt=auto
534 _mtrr=auto
535 _altivec=auto
536 _install=install
537 _ranlib=ranlib
538 _windres=windres
539 _cc=cc
540 _ar=ar
541 test "$CC" && _cc="$CC"
542 _as=auto
543 _nm=auto
544 _yasm=yasm
545 _runtime_cpudetection=no
546 _cross_compile=auto
547 _prefix="/usr/local"
548 ffmpeg=auto
549 ffmpeg_internals=no
550 _mplayer=yes
551 _x11=auto
552 _xshape=auto
553 _xss=auto
554 _dga1=auto
555 _dga2=auto
556 _xv=auto
557 _xvmc=no #auto when complete
558 _vdpau=auto
559 _sdl=auto
560 _kva=auto
561 _direct3d=auto
562 _directx=auto
563 _win32waveout=auto
564 _nas=auto
565 _png=auto
566 _mng=auto
567 _jpeg=auto
568 _pnm=yes
569 _md5sum=yes
570 _yuv4mpeg=yes
571 _gif=auto
572 _gl=auto
573 matrixview=yes
574 _ggi=auto
575 _ggiwmh=auto
576 _aa=auto
577 _caca=auto
578 _svga=auto
579 _vesa=auto
580 _fbdev=auto
581 _dvb=auto
582 _dxr2=auto
583 _dxr3=auto
584 _ivtv=auto
585 _v4l2=auto
586 _iconv=auto
587 _langinfo=auto
588 _rtc=auto
589 _ossaudio=auto
590 _arts=auto
591 _esd=auto
592 _pulse=auto
593 _jack=auto
594 _kai=auto
595 _dart=auto
596 _openal=no
597 _libcdio=auto
598 _liblzo=auto
599 _mad=auto
600 _tremor=auto
601 _tremor_internal=yes
602 _tremor_low=no
603 _libvorbis=auto
604 _speex=auto
605 _theora=auto
606 _mpg123=auto
607 _mp3lib=auto
608 _liba52=auto
609 _libdca=auto
610 _libmpeg2=auto
611 _faad=auto
612 _faad_internal=auto
613 _faad_fixed=no
614 _ladspa=auto
615 _libbs2b=auto
616 _xmms=no
617 _vcd=auto
618 _bluray=auto
619 _dvdnav=auto
620 _dvdnavconfig=dvdnav-config
621 _dvdreadconfig=dvdread-config
622 _dvdread=auto
623 _dvdread_internal=auto
624 _libdvdcss_internal=auto
625 _xanim=auto
626 _real=auto
627 _live=auto
628 _nemesi=auto
629 _native_rtsp=yes
630 _xinerama=auto
631 _mga=auto
632 _xmga=auto
633 _vm=auto
634 _xf86keysym=auto
635 _mlib=no #broken, thus disabled
636 _sgiaudio=auto
637 _sunaudio=auto
638 _alsa=auto
639 _fastmemcpy=yes
640 _unrar_exec=auto
641 _win32dll=auto
642 _select=yes
643 _radio=no
644 _radio_capture=no
645 _radio_v4l=auto
646 _radio_v4l2=auto
647 _radio_bsdbt848=auto
648 _tv=yes
649 _tv_v4l1=auto
650 _tv_v4l2=auto
651 _tv_bsdbt848=auto
652 _tv_dshow=auto
653 _pvr=auto
654 networking=yes
655 _winsock2_h=auto
656 _smb=auto
657 _vidix=auto
658 _vidix_pcidb=yes
659 _dhahelper=no
660 _svgalib_helper=no
661 _joystick=no
662 _xvid=auto
663 _libnut=auto
664 _lirc=auto
665 _lircc=auto
666 _apple_remote=auto
667 _apple_ir=auto
668 _gui=no
669 _gtk1=no
670 _termcap=auto
671 _termios=auto
672 _3dfx=no
673 _s3fb=no
674 _wii=no
675 _tdfxfb=no
676 _tdfxvid=no
677 _xvr100=auto
678 _tga=yes
679 _directfb=auto
680 _zr=auto
681 _bl=no
682 _largefiles=yes
683 #language=en
684 _shm=auto
685 _translation=no
686 _charset="UTF-8"
687 _dynamic_plugins=no
688 _crash_debug=no
689 _sighandler=yes
690 _libdv=auto
691 _cdparanoia=auto
692 _cddb=auto
693 _big_endian=auto
694 _bitmap_font=yes
695 _freetype=auto
696 _fontconfig=auto
697 _menu=no
698 _qtx=auto
699 _maemo=auto
700 _coreaudio=auto
701 _corevideo=auto
702 _quartz=auto
703 quicktime=auto
704 _macosx_finder=no
705 _macosx_bundle=auto
706 _sortsub=yes
707 _freetypeconfig='freetype-config'
708 _fribidi=auto
709 _enca=auto
710 _inet6=auto
711 _gethostbyname2=auto
712 _ftp=auto
713 _musepack=auto
714 _vstream=auto
715 _pthreads=auto
716 _w32threads=auto
717 _ass=auto
718 _rpath=no
719 _asmalign_pot=auto
720 _stream_cache=yes
721 _priority=no
722 def_dos_paths="#define HAVE_DOS_PATHS 0"
723 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
724 def_priority="#undef CONFIG_PRIORITY"
725 def_pthread_cache="#undef PTHREAD_CACHE"
726 _need_shmem=yes
727 for ac_option do
728 case "$ac_option" in
729 --help|-help|-h)
730 show_help
732 --prefix=*)
733 _prefix=$(echo $ac_option | cut -d '=' -f 2)
735 --bindir=*)
736 _bindir=$(echo $ac_option | cut -d '=' -f 2)
738 --datadir=*)
739 _datadir=$(echo $ac_option | cut -d '=' -f 2)
741 --mandir=*)
742 _mandir=$(echo $ac_option | cut -d '=' -f 2)
744 --confdir=*)
745 _confdir=$(echo $ac_option | cut -d '=' -f 2)
747 --libdir=*)
748 _libdir=$(echo $ac_option | cut -d '=' -f 2)
750 --codecsdir=*)
751 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
753 --localedir=*)
754 _localedir=$(echo $ac_option | cut -d '=' -f 2)
757 --with-install=*)
758 _install=$(echo $ac_option | cut -d '=' -f 2 )
760 --with-xvmclib=*)
761 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
764 --with-sdl-config=*)
765 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
767 --with-freetype-config=*)
768 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
770 --with-gtk-config=*)
771 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
773 --with-glib-config=*)
774 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
776 --with-dvdnav-config=*)
777 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
779 --with-dvdread-config=*)
780 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
783 --extra-cflags=*)
784 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
786 --extra-ldflags=*)
787 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
789 --extra-libs=*)
790 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
792 --extra-libs-mplayer=*)
793 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
796 --target=*)
797 _target=$(echo $ac_option | cut -d '=' -f 2)
799 --cc=*)
800 _cc=$(echo $ac_option | cut -d '=' -f 2)
802 --host-cc=*)
803 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
805 --as=*)
806 _as=$(echo $ac_option | cut -d '=' -f 2)
808 --nm=*)
809 _nm=$(echo $ac_option | cut -d '=' -f 2)
811 --yasm=*)
812 _yasm=$(echo $ac_option | cut -d '=' -f 2)
814 --ar=*)
815 _ar=$(echo $ac_option | cut -d '=' -f 2)
817 --ranlib=*)
818 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
820 --windres=*)
821 _windres=$(echo $ac_option | cut -d '=' -f 2)
823 --charset=*)
824 _charset=$(echo $ac_option | cut -d '=' -f 2)
826 --language-doc=*)
827 language_doc=$(echo $ac_option | cut -d '=' -f 2)
829 --language-man=*)
830 language_man=$(echo $ac_option | cut -d '=' -f 2)
832 --language-msg=*)
833 language_msg=$(echo $ac_option | cut -d '=' -f 2)
835 --language=*)
836 language=$(echo $ac_option | cut -d '=' -f 2)
839 --enable-static)
840 _ld_static='-static'
842 --disable-static)
843 _ld_static=''
845 --enable-profile)
846 _profile='-p'
848 --disable-profile)
849 _profile=
851 --enable-debug)
852 _debug='-g'
854 --enable-debug=*)
855 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
857 --disable-debug)
858 _debug=
860 --enable-translation) _translation=yes ;;
861 --disable-translation) _translation=no ;;
862 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
863 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
864 --enable-cross-compile) _cross_compile=yes ;;
865 --disable-cross-compile) _cross_compile=no ;;
866 --enable-mplayer) _mplayer=yes ;;
867 --disable-mplayer) _mplayer=no ;;
868 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
869 --disable-dynamic-plugins) _dynamic_plugins=no ;;
870 --enable-x11) _x11=yes ;;
871 --disable-x11) _x11=no ;;
872 --enable-xshape) _xshape=yes ;;
873 --disable-xshape) _xshape=no ;;
874 --enable-xss) _xss=yes ;;
875 --disable-xss) _xss=no ;;
876 --enable-xv) _xv=yes ;;
877 --disable-xv) _xv=no ;;
878 --enable-xvmc) _xvmc=yes ;;
879 --disable-xvmc) _xvmc=no ;;
880 --enable-vdpau) _vdpau=yes ;;
881 --disable-vdpau) _vdpau=no ;;
882 --enable-sdl) _sdl=yes ;;
883 --disable-sdl) _sdl=no ;;
884 --enable-kva) _kva=yes ;;
885 --disable-kva) _kva=no ;;
886 --enable-direct3d) _direct3d=yes ;;
887 --disable-direct3d) _direct3d=no ;;
888 --enable-directx) _directx=yes ;;
889 --disable-directx) _directx=no ;;
890 --enable-win32waveout) _win32waveout=yes ;;
891 --disable-win32waveout) _win32waveout=no ;;
892 --enable-nas) _nas=yes ;;
893 --disable-nas) _nas=no ;;
894 --enable-png) _png=yes ;;
895 --disable-png) _png=no ;;
896 --enable-mng) _mng=yes ;;
897 --disable-mng) _mng=no ;;
898 --enable-jpeg) _jpeg=yes ;;
899 --disable-jpeg) _jpeg=no ;;
900 --enable-pnm) _pnm=yes ;;
901 --disable-pnm) _pnm=no ;;
902 --enable-md5sum) _md5sum=yes ;;
903 --disable-md5sum) _md5sum=no ;;
904 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
905 --disable-yuv4mpeg) _yuv4mpeg=no ;;
906 --enable-gif) _gif=yes ;;
907 --disable-gif) _gif=no ;;
908 --enable-gl) _gl=yes ;;
909 --disable-gl) _gl=no ;;
910 --enable-matrixview) matrixview=yes ;;
911 --disable-matrixview) matrixview=no ;;
912 --enable-ggi) _ggi=yes ;;
913 --disable-ggi) _ggi=no ;;
914 --enable-ggiwmh) _ggiwmh=yes ;;
915 --disable-ggiwmh) _ggiwmh=no ;;
916 --enable-aa) _aa=yes ;;
917 --disable-aa) _aa=no ;;
918 --enable-caca) _caca=yes ;;
919 --disable-caca) _caca=no ;;
920 --enable-svga) _svga=yes ;;
921 --disable-svga) _svga=no ;;
922 --enable-vesa) _vesa=yes ;;
923 --disable-vesa) _vesa=no ;;
924 --enable-fbdev) _fbdev=yes ;;
925 --disable-fbdev) _fbdev=no ;;
926 --enable-dvb) _dvb=yes ;;
927 --disable-dvb) _dvb=no ;;
928 --enable-dxr2) _dxr2=yes ;;
929 --disable-dxr2) _dxr2=no ;;
930 --enable-dxr3) _dxr3=yes ;;
931 --disable-dxr3) _dxr3=no ;;
932 --enable-ivtv) _ivtv=yes ;;
933 --disable-ivtv) _ivtv=no ;;
934 --enable-v4l2) _v4l2=yes ;;
935 --disable-v4l2) _v4l2=no ;;
936 --enable-iconv) _iconv=yes ;;
937 --disable-iconv) _iconv=no ;;
938 --enable-langinfo) _langinfo=yes ;;
939 --disable-langinfo) _langinfo=no ;;
940 --enable-rtc) _rtc=yes ;;
941 --disable-rtc) _rtc=no ;;
942 --enable-libdv) _libdv=yes ;;
943 --disable-libdv) _libdv=no ;;
944 --enable-ossaudio) _ossaudio=yes ;;
945 --disable-ossaudio) _ossaudio=no ;;
946 --enable-arts) _arts=yes ;;
947 --disable-arts) _arts=no ;;
948 --enable-esd) _esd=yes ;;
949 --disable-esd) _esd=no ;;
950 --enable-pulse) _pulse=yes ;;
951 --disable-pulse) _pulse=no ;;
952 --enable-jack) _jack=yes ;;
953 --disable-jack) _jack=no ;;
954 --enable-openal) _openal=yes ;;
955 --disable-openal) _openal=no ;;
956 --enable-kai) _kai=yes ;;
957 --disable-kai) _kai=no ;;
958 --enable-dart) _dart=yes ;;
959 --disable-dart) _dart=no ;;
960 --enable-mad) _mad=yes ;;
961 --disable-mad) _mad=no ;;
962 --enable-libcdio) _libcdio=yes ;;
963 --disable-libcdio) _libcdio=no ;;
964 --enable-liblzo) _liblzo=yes ;;
965 --disable-liblzo) _liblzo=no ;;
966 --enable-libvorbis) _libvorbis=yes ;;
967 --disable-libvorbis) _libvorbis=no ;;
968 --enable-speex) _speex=yes ;;
969 --disable-speex) _speex=no ;;
970 --enable-tremor) _tremor=yes ;;
971 --disable-tremor) _tremor=no ;;
972 --enable-tremor-internal) _tremor_internal=yes ;;
973 --disable-tremor-internal) _tremor_internal=no ;;
974 --enable-tremor-low) _tremor_low=yes ;;
975 --disable-tremor-low) _tremor_low=no ;;
976 --enable-theora) _theora=yes ;;
977 --disable-theora) _theora=no ;;
978 --enable-mpg123) _mpg123=yes ;;
979 --disable-mpg123) _mpg123=no ;;
980 --enable-mp3lib) _mp3lib=yes ;;
981 --disable-mp3lib) _mp3lib=no ;;
982 --enable-liba52) _liba52=yes ;;
983 --disable-liba52) _liba52=no ;;
984 --enable-libdca) _libdca=yes ;;
985 --disable-libdca) _libdca=no ;;
986 --enable-libmpeg2) _libmpeg2=yes ;;
987 --disable-libmpeg2) _libmpeg2=no ;;
988 --enable-musepack) _musepack=yes ;;
989 --disable-musepack) _musepack=no ;;
990 --enable-faad) _faad=yes ;;
991 --disable-faad) _faad=no ;;
992 --enable-faad-internal) _faad_internal=yes ;;
993 --disable-faad-internal) _faad_internal=no ;;
994 --enable-faad-fixed) _faad_fixed=yes ;;
995 --disable-faad-fixed) _faad_fixed=no ;;
996 --enable-ladspa) _ladspa=yes ;;
997 --disable-ladspa) _ladspa=no ;;
998 --enable-libbs2b) _libbs2b=yes ;;
999 --disable-libbs2b) _libbs2b=no ;;
1000 --enable-xmms) _xmms=yes ;;
1001 --disable-xmms) _xmms=no ;;
1002 --enable-vcd) _vcd=yes ;;
1003 --disable-vcd) _vcd=no ;;
1004 --enable-bluray) _bluray=yes ;;
1005 --disable-bluray) _bluray=no ;;
1006 --enable-dvdread) _dvdread=yes ;;
1007 --disable-dvdread) _dvdread=no ;;
1008 --enable-dvdread-internal) _dvdread_internal=yes ;;
1009 --disable-dvdread-internal) _dvdread_internal=no ;;
1010 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1011 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1012 --enable-dvdnav) _dvdnav=yes ;;
1013 --disable-dvdnav) _dvdnav=no ;;
1014 --enable-xanim) _xanim=yes ;;
1015 --disable-xanim) _xanim=no ;;
1016 --enable-real) _real=yes ;;
1017 --disable-real) _real=no ;;
1018 --enable-live) _live=yes ;;
1019 --disable-live) _live=no ;;
1020 --enable-nemesi) _nemesi=yes ;;
1021 --disable-nemesi) _nemesi=no ;;
1022 --enable-xinerama) _xinerama=yes ;;
1023 --disable-xinerama) _xinerama=no ;;
1024 --enable-mga) _mga=yes ;;
1025 --disable-mga) _mga=no ;;
1026 --enable-xmga) _xmga=yes ;;
1027 --disable-xmga) _xmga=no ;;
1028 --enable-vm) _vm=yes ;;
1029 --disable-vm) _vm=no ;;
1030 --enable-xf86keysym) _xf86keysym=yes ;;
1031 --disable-xf86keysym) _xf86keysym=no ;;
1032 --enable-mlib) _mlib=yes ;;
1033 --disable-mlib) _mlib=no ;;
1034 --enable-sunaudio) _sunaudio=yes ;;
1035 --disable-sunaudio) _sunaudio=no ;;
1036 --enable-sgiaudio) _sgiaudio=yes ;;
1037 --disable-sgiaudio) _sgiaudio=no ;;
1038 --enable-alsa) _alsa=yes ;;
1039 --disable-alsa) _alsa=no ;;
1040 --enable-tv) _tv=yes ;;
1041 --disable-tv) _tv=no ;;
1042 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1043 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1044 --enable-tv-v4l1) _tv_v4l1=yes ;;
1045 --disable-tv-v4l1) _tv_v4l1=no ;;
1046 --enable-tv-v4l2) _tv_v4l2=yes ;;
1047 --disable-tv-v4l2) _tv_v4l2=no ;;
1048 --enable-tv-dshow) _tv_dshow=yes ;;
1049 --disable-tv-dshow) _tv_dshow=no ;;
1050 --enable-radio) _radio=yes ;;
1051 --enable-radio-capture) _radio_capture=yes ;;
1052 --disable-radio-capture) _radio_capture=no ;;
1053 --disable-radio) _radio=no ;;
1054 --enable-radio-v4l) _radio_v4l=yes ;;
1055 --disable-radio-v4l) _radio_v4l=no ;;
1056 --enable-radio-v4l2) _radio_v4l2=yes ;;
1057 --disable-radio-v4l2) _radio_v4l2=no ;;
1058 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1059 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1060 --enable-pvr) _pvr=yes ;;
1061 --disable-pvr) _pvr=no ;;
1062 --enable-fastmemcpy) _fastmemcpy=yes ;;
1063 --disable-fastmemcpy) _fastmemcpy=no ;;
1064 --enable-networking) networking=yes ;;
1065 --disable-networking) networking=no ;;
1066 --enable-winsock2_h) _winsock2_h=yes ;;
1067 --disable-winsock2_h) _winsock2_h=no ;;
1068 --enable-smb) _smb=yes ;;
1069 --disable-smb) _smb=no ;;
1070 --enable-vidix) _vidix=yes ;;
1071 --disable-vidix) _vidix=no ;;
1072 --with-vidix-drivers=*)
1073 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1075 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1076 --enable-dhahelper) _dhahelper=yes ;;
1077 --disable-dhahelper) _dhahelper=no ;;
1078 --enable-svgalib_helper) _svgalib_helper=yes ;;
1079 --disable-svgalib_helper) _svgalib_helper=no ;;
1080 --enable-joystick) _joystick=yes ;;
1081 --disable-joystick) _joystick=no ;;
1082 --enable-xvid) _xvid=yes ;;
1083 --disable-xvid) _xvid=no ;;
1084 --enable-libnut) _libnut=yes ;;
1085 --disable-libnut) _libnut=no ;;
1086 --enable-ffmpeg) ffmpeg=yes ;;
1087 --disable-ffmpeg) ffmpeg=no ;;
1088 --ffmpeg-source-dir=*)
1089 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1091 --enable-lirc) _lirc=yes ;;
1092 --disable-lirc) _lirc=no ;;
1093 --enable-lircc) _lircc=yes ;;
1094 --disable-lircc) _lircc=no ;;
1095 --enable-apple-remote) _apple_remote=yes ;;
1096 --disable-apple-remote) _apple_remote=no ;;
1097 --enable-apple-ir) _apple_ir=yes ;;
1098 --disable-apple-ir) _apple_ir=no ;;
1099 --enable-gui) _gui=yes ;;
1100 --disable-gui) _gui=no ;;
1101 --enable-gtk1) _gtk1=yes ;;
1102 --disable-gtk1) _gtk1=no ;;
1103 --enable-termcap) _termcap=yes ;;
1104 --disable-termcap) _termcap=no ;;
1105 --enable-termios) _termios=yes ;;
1106 --disable-termios) _termios=no ;;
1107 --enable-3dfx) _3dfx=yes ;;
1108 --disable-3dfx) _3dfx=no ;;
1109 --enable-s3fb) _s3fb=yes ;;
1110 --disable-s3fb) _s3fb=no ;;
1111 --enable-wii) _wii=yes ;;
1112 --disable-wii) _wii=no ;;
1113 --enable-tdfxfb) _tdfxfb=yes ;;
1114 --disable-tdfxfb) _tdfxfb=no ;;
1115 --disable-tdfxvid) _tdfxvid=no ;;
1116 --enable-tdfxvid) _tdfxvid=yes ;;
1117 --disable-xvr100) _xvr100=no ;;
1118 --enable-xvr100) _xvr100=yes ;;
1119 --disable-tga) _tga=no ;;
1120 --enable-tga) _tga=yes ;;
1121 --enable-directfb) _directfb=yes ;;
1122 --disable-directfb) _directfb=no ;;
1123 --enable-zr) _zr=yes ;;
1124 --disable-zr) _zr=no ;;
1125 --enable-bl) _bl=yes ;;
1126 --disable-bl) _bl=no ;;
1127 --enable-mtrr) _mtrr=yes ;;
1128 --disable-mtrr) _mtrr=no ;;
1129 --enable-largefiles) _largefiles=yes ;;
1130 --disable-largefiles) _largefiles=no ;;
1131 --enable-shm) _shm=yes ;;
1132 --disable-shm) _shm=no ;;
1133 --enable-select) _select=yes ;;
1134 --disable-select) _select=no ;;
1135 --enable-cdparanoia) _cdparanoia=yes ;;
1136 --disable-cdparanoia) _cdparanoia=no ;;
1137 --enable-cddb) _cddb=yes ;;
1138 --disable-cddb) _cddb=no ;;
1139 --enable-big-endian) _big_endian=yes ;;
1140 --disable-big-endian) _big_endian=no ;;
1141 --enable-bitmap-font) _bitmap_font=yes ;;
1142 --disable-bitmap-font) _bitmap_font=no ;;
1143 --enable-freetype) _freetype=yes ;;
1144 --disable-freetype) _freetype=no ;;
1145 --enable-fontconfig) _fontconfig=yes ;;
1146 --disable-fontconfig) _fontconfig=no ;;
1147 --enable-unrarexec) _unrar_exec=yes ;;
1148 --disable-unrarexec) _unrar_exec=no ;;
1149 --enable-ftp) _ftp=yes ;;
1150 --disable-ftp) _ftp=no ;;
1151 --enable-vstream) _vstream=yes ;;
1152 --disable-vstream) _vstream=no ;;
1153 --enable-pthreads) _pthreads=yes ;;
1154 --disable-pthreads) _pthreads=no ;;
1155 --enable-w32threads) _w32threads=yes ;;
1156 --disable-w32threads) _w32threads=no ;;
1157 --enable-ass) _ass=yes ;;
1158 --disable-ass) _ass=no ;;
1159 --enable-rpath) _rpath=yes ;;
1160 --disable-rpath) _rpath=no ;;
1162 --enable-fribidi) _fribidi=yes ;;
1163 --disable-fribidi) _fribidi=no ;;
1165 --enable-enca) _enca=yes ;;
1166 --disable-enca) _enca=no ;;
1168 --enable-inet6) _inet6=yes ;;
1169 --disable-inet6) _inet6=no ;;
1171 --enable-gethostbyname2) _gethostbyname2=yes ;;
1172 --disable-gethostbyname2) _gethostbyname2=no ;;
1174 --enable-dga1) _dga1=yes ;;
1175 --disable-dga1) _dga1=no ;;
1176 --enable-dga2) _dga2=yes ;;
1177 --disable-dga2) _dga2=no ;;
1179 --enable-menu) _menu=yes ;;
1180 --disable-menu) _menu=no ;;
1182 --enable-qtx) _qtx=yes ;;
1183 --disable-qtx) _qtx=no ;;
1185 --enable-coreaudio) _coreaudio=yes ;;
1186 --disable-coreaudio) _coreaudio=no ;;
1187 --enable-corevideo) _corevideo=yes ;;
1188 --disable-corevideo) _corevideo=no ;;
1189 --enable-quartz) _quartz=yes ;;
1190 --disable-quartz) _quartz=no ;;
1191 --enable-macosx-finder) _macosx_finder=yes ;;
1192 --disable-macosx-finder) _macosx_finder=no ;;
1193 --enable-macosx-bundle) _macosx_bundle=yes ;;
1194 --disable-macosx-bundle) _macosx_bundle=no ;;
1196 --enable-maemo) _maemo=yes ;;
1197 --disable-maemo) _maemo=no ;;
1199 --enable-sortsub) _sortsub=yes ;;
1200 --disable-sortsub) _sortsub=no ;;
1202 --enable-crash-debug) _crash_debug=yes ;;
1203 --disable-crash-debug) _crash_debug=no ;;
1204 --enable-sighandler) _sighandler=yes ;;
1205 --disable-sighandler) _sighandler=no ;;
1206 --enable-win32dll) _win32dll=yes ;;
1207 --disable-win32dll) _win32dll=no ;;
1209 --enable-sse) _sse=yes ;;
1210 --disable-sse) _sse=no ;;
1211 --enable-sse2) _sse2=yes ;;
1212 --disable-sse2) _sse2=no ;;
1213 --enable-ssse3) _ssse3=yes ;;
1214 --disable-ssse3) _ssse3=no ;;
1215 --enable-mmxext) _mmxext=yes ;;
1216 --disable-mmxext) _mmxext=no ;;
1217 --enable-3dnow) _3dnow=yes ;;
1218 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1219 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1220 --disable-3dnowext) _3dnowext=no ;;
1221 --enable-cmov) _cmov=yes ;;
1222 --disable-cmov) _cmov=no ;;
1223 --enable-fast-cmov) _fast_cmov=yes ;;
1224 --disable-fast-cmov) _fast_cmov=no ;;
1225 --enable-fast-clz) _fast_clz=yes ;;
1226 --disable-fast-clz) _fast_clz=no ;;
1227 --enable-altivec) _altivec=yes ;;
1228 --disable-altivec) _altivec=no ;;
1229 --enable-armv5te) _armv5te=yes ;;
1230 --disable-armv5te) _armv5te=no ;;
1231 --enable-armv6) _armv6=yes ;;
1232 --disable-armv6) _armv6=no ;;
1233 --enable-armv6t2) _armv6t2=yes ;;
1234 --disable-armv6t2) _armv6t2=no ;;
1235 --enable-armvfp) _armvfp=yes ;;
1236 --disable-armvfp) _armvfp=no ;;
1237 --enable-neon) neon=yes ;;
1238 --disable-neon) neon=no ;;
1239 --enable-iwmmxt) _iwmmxt=yes ;;
1240 --disable-iwmmxt) _iwmmxt=no ;;
1241 --enable-mmx) _mmx=yes ;;
1242 --disable-mmx) # 3Dnow! and MMX2 require MMX
1243 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1246 echo "Unknown parameter: $ac_option"
1247 exit 1
1250 esac
1251 done
1253 if test "$_gui" = yes ; then
1254 die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
1255 (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
1258 # Atmos: moved this here, to be correct, if --prefix is specified
1259 test -z "$_bindir" && _bindir="$_prefix/bin"
1260 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1261 test -z "$_mandir" && _mandir="$_prefix/share/man"
1262 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1263 test -z "$_libdir" && _libdir="$_prefix/lib"
1264 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1266 # Determine our OS name and CPU architecture
1267 if test -z "$_target" ; then
1268 # OS name
1269 system_name=$(uname -s 2>&1)
1270 case "$system_name" in
1271 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1273 Haiku)
1274 system_name=BeOS
1276 IRIX*)
1277 system_name=IRIX
1279 GNU/kFreeBSD)
1280 system_name=FreeBSD
1282 HP-UX*)
1283 system_name=HP-UX
1285 [cC][yY][gG][wW][iI][nN]*)
1286 system_name=CYGWIN
1288 MINGW32*)
1289 system_name=MINGW32
1291 OS/2*)
1292 system_name=OS/2
1295 system_name="$system_name-UNKNOWN"
1297 esac
1300 # host's CPU/instruction set
1301 host_arch=$(uname -p 2>&1)
1302 case "$host_arch" in
1303 i386|sparc|ppc|alpha|arm|mips|vax)
1305 powerpc) # Darwin returns 'powerpc'
1306 host_arch=ppc
1308 *) # uname -p on Linux returns 'unknown' for the processor type,
1309 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1311 # Maybe uname -m (machine hardware name) returns something we
1312 # recognize.
1314 # x86/x86pc is used by QNX
1315 case "$(uname -m 2>&1)" in
1316 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 ;;
1317 ia64) host_arch=ia64 ;;
1318 macppc|ppc) host_arch=ppc ;;
1319 ppc64) host_arch=ppc64 ;;
1320 alpha) host_arch=alpha ;;
1321 sparc) host_arch=sparc ;;
1322 sparc64) host_arch=sparc64 ;;
1323 parisc*|hppa*|9000*) host_arch=hppa ;;
1324 arm*|zaurus|cats) host_arch=arm ;;
1325 sh3|sh4|sh4a) host_arch=sh ;;
1326 s390) host_arch=s390 ;;
1327 s390x) host_arch=s390x ;;
1328 *mips*) host_arch=mips ;;
1329 vax) host_arch=vax ;;
1330 xtensa*) host_arch=xtensa ;;
1331 *) host_arch=UNKNOWN ;;
1332 esac
1334 esac
1335 else # if test -z "$_target"
1336 system_name=$(echo $_target | cut -d '-' -f 2)
1337 case "$(echo $system_name | tr A-Z a-z)" in
1338 linux) system_name=Linux ;;
1339 freebsd) system_name=FreeBSD ;;
1340 gnu/kfreebsd) system_name=FreeBSD ;;
1341 netbsd) system_name=NetBSD ;;
1342 bsd/os) system_name=BSD/OS ;;
1343 openbsd) system_name=OpenBSD ;;
1344 dragonfly) system_name=DragonFly ;;
1345 sunos) system_name=SunOS ;;
1346 qnx) system_name=QNX ;;
1347 morphos) system_name=MorphOS ;;
1348 amigaos) system_name=AmigaOS ;;
1349 mingw32*) system_name=MINGW32 ;;
1350 esac
1351 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1352 host_arch=$(echo $_target | cut -d '-' -f 1)
1353 if test $(echo $host_arch) != "x86_64" ; then
1354 host_arch=$(echo $host_arch | tr '_' '-')
1358 extra_cflags="-I. $extra_cflags"
1359 _timer=timer-linux.c
1360 _getch=getch2.c
1361 if freebsd ; then
1362 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1363 extra_cflags="$extra_cflags -I/usr/local/include"
1366 if netbsd || dragonfly ; then
1367 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1368 extra_cflags="$extra_cflags -I/usr/pkg/include"
1371 if darwin; then
1372 extra_cflags="-mdynamic-no-pic $extra_cflags"
1373 if test "$(basename $_cc)" != "clang" ; then
1374 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
1376 _timer=timer-darwin.c
1379 if aix ; then
1380 extra_ldflags="$extra_ldflags -lC"
1383 if irix ; then
1384 _ranlib='ar -r'
1385 elif linux ; then
1386 _ranlib='true'
1389 if win32 ; then
1390 _exesuf=".exe"
1391 extra_cflags="$extra_cflags -fno-common"
1392 # -lwinmm is always needed for osdep/timer-win2.c
1393 extra_ldflags="$extra_ldflags -lwinmm"
1394 _pe_executable=yes
1395 _timer=timer-win2.c
1396 _priority=yes
1397 def_dos_paths="#define HAVE_DOS_PATHS 1"
1398 def_priority="#define CONFIG_PRIORITY 1"
1401 if mingw32 ; then
1402 _getch=getch2-win.c
1403 _need_shmem=no
1406 if amigaos ; then
1407 _select=no
1408 _sighandler=no
1409 _stream_cache=no
1410 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1411 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1414 if qnx ; then
1415 extra_ldflags="$extra_ldflags -lph"
1418 if os2 ; then
1419 _exesuf=".exe"
1420 _getch=getch2-os2.c
1421 _need_shmem=no
1422 _priority=yes
1423 def_dos_paths="#define HAVE_DOS_PATHS 1"
1424 def_priority="#define CONFIG_PRIORITY 1"
1427 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1428 test "$tmpdir" && break
1429 done
1431 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1432 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1434 TMPLOG="config.log"
1435 TMPC="$mplayer_tmpdir/tmp.c"
1436 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1437 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1438 TMPH="$mplayer_tmpdir/tmp.h"
1439 TMPS="$mplayer_tmpdir/tmp.S"
1441 rm -f "$TMPLOG"
1442 echo configuration: $configuration > "$TMPLOG"
1443 echo >> "$TMPLOG"
1446 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1447 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1451 # Checking CC version...
1452 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1453 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1454 echocheck "$_cc version"
1455 cc_vendor=intel
1456 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1457 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1458 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1459 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1460 # TODO verify older icc/ecc compatibility
1461 case $cc_version in
1463 cc_version="v. ?.??, bad"
1464 cc_fail=yes
1466 10.1|11.0|11.1)
1467 cc_version="$cc_version, ok"
1470 cc_version="$cc_version, bad"
1471 cc_fail=yes
1473 esac
1474 echores "$cc_version"
1475 else
1476 for _cc in "$_cc" gcc cc ; do
1477 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1478 if test "$cc_name_tmp" = "gcc"; then
1479 cc_name=$cc_name_tmp
1480 echocheck "$_cc version"
1481 cc_vendor=gnu
1482 cc_version=$($_cc -dumpversion 2>&1)
1483 case $cc_version in
1484 2.96*)
1485 cc_fail=yes
1488 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1489 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1490 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1492 esac
1493 echores "$cc_version"
1494 break
1496 cc_name_tmp=$($_cc -v 2>&1 | head -n 1 | cut -d ' ' -f 1)
1497 if test "$cc_name_tmp" = "clang"; then
1498 echocheck "$_cc version"
1499 cc_vendor=clang
1500 cc_version=$($_cc -dumpversion 2>&1)
1501 res_comment="experimental support only"
1502 echores "clang $cc_version"
1503 break
1505 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1506 if test "$cc_name_tmp" = "Sun C"; then
1507 echocheck "$_cc version"
1508 cc_vendor=sun
1509 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1510 res_comment="experimental support only"
1511 echores "Sun C $cc_version"
1512 break
1514 done
1515 fi # icc
1516 test "$cc_fail" = yes && die "unsupported compiler version"
1518 if test -z "$_target" && x86 ; then
1519 cat > $TMPC << EOF
1520 int main(void) {
1521 int test[(int)sizeof(char *)-7];
1522 return 0;
1525 cc_check && host_arch=x86_64 || host_arch=i386
1528 echo "Detected operating system: $system_name"
1529 echo "Detected host architecture: $host_arch"
1531 echocheck "host cc"
1532 test "$_host_cc" || _host_cc=$_cc
1533 echores $_host_cc
1535 echocheck "cross compilation"
1536 if test $_cross_compile = auto ; then
1537 _cross_compile=yes
1538 cflag_check "" && "$TMPEXE" && _cross_compile=no
1540 echores $_cross_compile
1542 if test $_cross_compile = yes; then
1543 tmp_run() {
1544 return 0
1548 # ---
1550 # now that we know what compiler should be used for compilation, try to find
1551 # out which assembler is used by the $_cc compiler
1552 if test "$_as" = auto ; then
1553 _as=$($_cc -print-prog-name=as)
1554 test -z "$_as" && _as=as
1557 if test "$_nm" = auto ; then
1558 _nm=$($_cc -print-prog-name=nm)
1559 test -z "$_nm" && _nm=nm
1562 # XXX: this should be ok..
1563 _cpuinfo="echo"
1565 if test "$_runtime_cpudetection" = no ; then
1567 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1568 # FIXME: Remove the cygwin check once AMD CPUs are supported
1569 if test -r /proc/cpuinfo && ! cygwin; then
1570 # Linux with /proc mounted, extract CPU information from it
1571 _cpuinfo="cat /proc/cpuinfo"
1572 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1573 # FreeBSD with Linux emulation /proc mounted,
1574 # extract CPU information from it
1575 # Don't use it on x86 though, it never reports 3Dnow
1576 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1577 elif darwin && ! x86 ; then
1578 # use hostinfo on Darwin
1579 _cpuinfo="hostinfo"
1580 elif aix; then
1581 # use 'lsattr' on AIX
1582 _cpuinfo="lsattr -E -l proc0 -a type"
1583 elif x86; then
1584 # all other OSes try to extract CPU information from a small helper
1585 # program cpuinfo instead
1586 $_cc -o cpuinfo$_exesuf cpuinfo.c
1587 _cpuinfo="./cpuinfo$_exesuf"
1590 if x86 ; then
1591 # gather more CPU information
1592 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1593 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1594 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1595 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1596 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1598 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1600 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1601 -e s/xmm/sse/ -e s/kni/sse/)
1603 for ext in $pparam ; do
1604 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1605 done
1607 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1608 test $_sse = kernel_check && _mmxext=kernel_check
1610 echocheck "CPU vendor"
1611 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1613 echocheck "CPU type"
1614 echores "$pname"
1617 fi # test "$_runtime_cpudetection" = no
1619 if x86 && test "$_runtime_cpudetection" = no ; then
1620 extcheck() {
1621 if test "$1" = kernel_check ; then
1622 echocheck "kernel support of $2"
1623 cat > $TMPC <<EOF
1624 #include <stdlib.h>
1625 #include <signal.h>
1626 static void catch(int sig) { exit(1); }
1627 int main(void) {
1628 signal(SIGILL, catch);
1629 __asm__ volatile ("$3":::"memory"); return 0;
1633 if cc_check && tmp_run ; then
1634 eval _$2=yes
1635 echores "yes"
1636 _optimizing="$_optimizing $2"
1637 return 0
1638 else
1639 eval _$2=no
1640 echores "failed"
1641 echo "It seems that your kernel does not correctly support $2."
1642 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1643 return 1
1646 return 0
1649 extcheck $_mmx "mmx" "emms"
1650 extcheck $_mmxext "mmxext" "sfence"
1651 extcheck $_3dnow "3dnow" "femms"
1652 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1653 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1654 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1655 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1656 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1658 echocheck "mtrr support"
1659 if test "$_mtrr" = kernel_check ; then
1660 _mtrr="yes"
1661 _optimizing="$_optimizing mtrr"
1663 echores "$_mtrr"
1665 if test "$_gcc3_ext" != ""; then
1666 # if we had to disable sse/sse2 because the active kernel does not
1667 # support this instruction set extension, we also have to tell
1668 # gcc3 to not generate sse/sse2 instructions for normal C code
1669 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1675 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1676 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1677 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1678 subarch_all='X86_32 X86_64 PPC64'
1679 case "$host_arch" in
1680 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1681 arch='x86'
1682 subarch='x86_32'
1683 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1684 iproc=486
1685 proc=i486
1688 if test "$_runtime_cpudetection" = no ; then
1689 case "$pvendor" in
1690 AuthenticAMD)
1691 case "$pfamily" in
1692 3) proc=i386 iproc=386 ;;
1693 4) proc=i486 iproc=486 ;;
1694 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1695 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1696 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1697 proc=k6-3
1698 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1699 proc=geode
1700 elif test "$pmodel" -ge 8; then
1701 proc=k6-2
1702 elif test "$pmodel" -ge 6; then
1703 proc=k6
1704 else
1705 proc=i586
1708 6) iproc=686
1709 # It's a bit difficult to determine the correct type of Family 6
1710 # AMD CPUs just from their signature. Instead, we check directly
1711 # whether it supports SSE.
1712 if test "$_sse" = yes; then
1713 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1714 proc=athlon-xp
1715 else
1716 # Again, gcc treats athlon and athlon-tbird similarly.
1717 proc=athlon
1720 15) iproc=686
1721 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1722 # caught and remedied in the optimization tests below.
1723 proc=k8
1726 *) proc=amdfam10 iproc=686
1727 test $_fast_clz = "auto" && _fast_clz=yes
1729 esac
1731 GenuineIntel)
1732 case "$pfamily" in
1733 3) proc=i386 iproc=386 ;;
1734 4) proc=i486 iproc=486 ;;
1735 5) iproc=586
1736 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1737 proc=pentium-mmx # 4 is desktop, 8 is mobile
1738 else
1739 proc=i586
1742 6) iproc=686
1743 if test "$pmodel" -ge 15; then
1744 proc=core2
1745 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1746 proc=pentium-m
1747 elif test "$pmodel" -ge 7; then
1748 proc=pentium3
1749 elif test "$pmodel" -ge 3; then
1750 proc=pentium2
1751 else
1752 proc=i686
1754 test $_fast_clz = "auto" && _fast_clz=yes
1756 15) iproc=686
1757 # A nocona in 32-bit mode has no more capabilities than a prescott.
1758 if test "$pmodel" -ge 3; then
1759 proc=prescott
1760 else
1761 proc=pentium4
1762 test $_fast_clz = "auto" && _fast_clz=yes
1764 test $_fast_cmov = "auto" && _fast_cmov=no
1766 *) proc=prescott iproc=686 ;;
1767 esac
1769 CentaurHauls)
1770 case "$pfamily" in
1771 5) iproc=586
1772 if test "$pmodel" -ge 8; then
1773 proc=winchip2
1774 elif test "$pmodel" -ge 4; then
1775 proc=winchip-c6
1776 else
1777 proc=i586
1780 6) iproc=686
1781 if test "$pmodel" -ge 9; then
1782 proc=c3-2
1783 else
1784 proc=c3
1785 iproc=586
1788 *) proc=i686 iproc=i686 ;;
1789 esac
1791 unknown)
1792 case "$pfamily" in
1793 3) proc=i386 iproc=386 ;;
1794 4) proc=i486 iproc=486 ;;
1795 *) proc=i586 iproc=586 ;;
1796 esac
1799 proc=i586 iproc=586 ;;
1800 esac
1801 test $_fast_clz = "auto" && _fast_clz=no
1802 fi # test "$_runtime_cpudetection" = no
1805 # check that gcc supports our CPU, if not, fall back to earlier ones
1806 # LGB: check -mcpu and -march swithing step by step with enabling
1807 # to fall back till 386.
1809 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1811 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1812 cpuopt=-mtune
1813 else
1814 cpuopt=-mcpu
1817 echocheck "GCC & CPU optimization abilities"
1818 if test "$_runtime_cpudetection" = no ; then
1819 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1820 cflag_check -march=native && proc=native
1822 if test "$proc" = "amdfam10"; then
1823 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1825 if test "$proc" = "k8"; then
1826 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1828 if test "$proc" = "athlon-xp"; then
1829 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1831 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1832 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1834 if test "$proc" = "k6" || test "$proc" = "c3"; then
1835 if ! cflag_check -march=$proc $cpuopt=$proc; then
1836 if cflag_check -march=i586 $cpuopt=i686; then
1837 proc=i586-i686
1838 else
1839 proc=i586
1843 if test "$proc" = "prescott" ; then
1844 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1846 if test "$proc" = "core2" ; then
1847 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1849 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
1850 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1852 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1853 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1855 if test "$proc" = "i586"; then
1856 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1858 if test "$proc" = "i486" ; then
1859 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1861 if test "$proc" = "i386" ; then
1862 cflag_check -march=$proc $cpuopt=$proc || proc=error
1864 if test "$proc" = "error" ; then
1865 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1866 _mcpu=""
1867 _march=""
1868 _optimizing=""
1869 elif test "$proc" = "i586-i686"; then
1870 _march="-march=i586"
1871 _mcpu="$cpuopt=i686"
1872 _optimizing="$proc"
1873 else
1874 _march="-march=$proc"
1875 _mcpu="$cpuopt=$proc"
1876 _optimizing="$proc"
1878 else # if test "$_runtime_cpudetection" = no
1879 _mcpu="$cpuopt=generic"
1880 # at least i486 required, for bswap instruction
1881 _march="-march=i486"
1882 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1883 cflag_check $_mcpu || _mcpu=""
1884 cflag_check $_march $_mcpu || _march=""
1887 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1888 ## autodetected mcpu/march parameters
1889 if test "$_target" ; then
1890 # TODO: it may be a good idea to check GCC and fall back in all cases
1891 if test "$host_arch" = "i586-i686"; then
1892 _march="-march=i586"
1893 _mcpu="$cpuopt=i686"
1894 else
1895 _march="-march=$host_arch"
1896 _mcpu="$cpuopt=$host_arch"
1899 proc="$host_arch"
1901 case "$proc" in
1902 i386) iproc=386 ;;
1903 i486) iproc=486 ;;
1904 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1905 i686|athlon*|pentium*) iproc=686 ;;
1906 *) iproc=586 ;;
1907 esac
1910 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1911 _fast_cmov="yes"
1912 else
1913 _fast_cmov="no"
1915 test $_fast_clz = "auto" && _fast_clz=yes
1917 echores "$proc"
1920 ia64)
1921 arch='ia64'
1922 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1923 iproc='ia64'
1926 x86_64|amd64)
1927 arch='x86'
1928 subarch='x86_64'
1929 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1930 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1931 iproc='x86_64'
1933 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1934 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1935 cpuopt=-mtune
1936 else
1937 cpuopt=-mcpu
1939 if test "$_runtime_cpudetection" = no ; then
1940 case "$pvendor" in
1941 AuthenticAMD)
1942 case "$pfamily" in
1943 15) proc=k8
1944 test $_fast_clz = "auto" && _fast_clz=no
1946 *) proc=amdfam10;;
1947 esac
1949 GenuineIntel)
1950 case "$pfamily" in
1951 6) proc=core2;;
1953 # 64-bit prescotts exist, but as far as GCC is concerned they
1954 # have the same capabilities as a nocona.
1955 proc=nocona
1956 test $_fast_cmov = "auto" && _fast_cmov=no
1957 test $_fast_clz = "auto" && _fast_clz=no
1959 esac
1962 proc=error;;
1963 esac
1964 fi # test "$_runtime_cpudetection" = no
1966 echocheck "GCC & CPU optimization abilities"
1967 # This is a stripped-down version of the i386 fallback.
1968 if test "$_runtime_cpudetection" = no ; then
1969 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1970 cflag_check -march=native && proc=native
1972 # --- AMD processors ---
1973 if test "$proc" = "amdfam10"; then
1974 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1976 if test "$proc" = "k8"; then
1977 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1979 # This will fail if gcc version < 3.3, which is ok because earlier
1980 # versions don't really support 64-bit on amd64.
1981 # Is this a valid assumption? -Corey
1982 if test "$proc" = "athlon-xp"; then
1983 cflag_check -march=$proc $cpuopt=$proc || proc=error
1985 # --- Intel processors ---
1986 if test "$proc" = "core2"; then
1987 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1989 if test "$proc" = "x86-64"; then
1990 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1992 if test "$proc" = "nocona"; then
1993 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1995 if test "$proc" = "pentium4"; then
1996 cflag_check -march=$proc $cpuopt=$proc || proc=error
1999 _march="-march=$proc"
2000 _mcpu="$cpuopt=$proc"
2001 if test "$proc" = "error" ; then
2002 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2003 _mcpu=""
2004 _march=""
2006 else # if test "$_runtime_cpudetection" = no
2007 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2008 _march="-march=x86-64"
2009 _mcpu="$cpuopt=generic"
2010 cflag_check $_mcpu || _mcpu="x86-64"
2011 cflag_check $_mcpu || _mcpu=""
2012 cflag_check $_march $_mcpu || _march=""
2015 _optimizing="$proc"
2016 test $_fast_cmov = "auto" && _fast_cmov=yes
2017 test $_fast_clz = "auto" && _fast_clz=yes
2019 echores "$proc"
2022 sparc|sparc64)
2023 arch='sparc'
2024 iproc='sparc'
2025 if test "$host_arch" = "sparc64" ; then
2026 _vis='yes'
2027 proc='ultrasparc'
2028 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2029 elif sunos ; then
2030 echocheck "CPU type"
2031 karch=$(uname -m)
2032 case "$(echo $karch)" in
2033 sun4) proc=v7 ;;
2034 sun4c) proc=v7 ;;
2035 sun4d) proc=v8 ;;
2036 sun4m) proc=v8 ;;
2037 sun4u) proc=ultrasparc _vis='yes' ;;
2038 sun4v) proc=v9 ;;
2039 *) proc=v8 ;;
2040 esac
2041 echores "$proc"
2042 else
2043 proc=v8
2045 _mcpu="-mcpu=$proc"
2046 _optimizing="$proc"
2049 arm*)
2050 arch='arm'
2051 iproc='arm'
2054 avr32)
2055 arch='avr32'
2056 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2057 iproc='avr32'
2058 test $_fast_clz = "auto" && _fast_clz=yes
2061 sh|sh4)
2062 arch='sh4'
2063 iproc='sh4'
2066 ppc|ppc64|powerpc|powerpc64)
2067 arch='ppc'
2068 def_dcbzl='#define HAVE_DCBZL 0'
2069 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2070 iproc='ppc'
2072 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2073 subarch='ppc64'
2074 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2076 echocheck "CPU type"
2077 case $system_name in
2078 Linux)
2079 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2080 if test -n "$($_cpuinfo | grep altivec)"; then
2081 test $_altivec = auto && _altivec=yes
2084 Darwin)
2085 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2086 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2087 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2088 test $_altivec = auto && _altivec=yes
2091 NetBSD)
2092 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2093 case $cc_version in
2094 2*|3.0*|3.1*|3.2*|3.3*)
2097 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2098 test $_altivec = auto && _altivec=yes
2101 esac
2103 AIX)
2104 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2106 esac
2107 if test "$_altivec" = yes; then
2108 echores "$proc altivec"
2109 else
2110 _altivec=no
2111 echores "$proc"
2114 echocheck "GCC & CPU optimization abilities"
2116 if test -n "$proc"; then
2117 case "$proc" in
2118 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2119 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2120 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2121 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2122 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2123 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2124 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2125 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2126 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2127 *) ;;
2128 esac
2129 # gcc 3.1(.1) and up supports 7400 and 7450
2130 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2131 case "$proc" in
2132 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2133 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2134 *) ;;
2135 esac
2137 # gcc 3.2 and up supports 970
2138 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2139 case "$proc" in
2140 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2141 def_dcbzl='#define HAVE_DCBZL 1' ;;
2142 *) ;;
2143 esac
2145 # gcc 3.3 and up supports POWER4
2146 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2147 case "$proc" in
2148 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2149 *) ;;
2150 esac
2152 # gcc 3.4 and up supports 440*
2153 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2154 case "$proc" in
2155 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2156 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2157 *) ;;
2158 esac
2160 # gcc 4.0 and up supports POWER5
2161 if test "$_cc_major" -ge "4"; then
2162 case "$proc" in
2163 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2164 *) ;;
2165 esac
2169 if test -n "$_mcpu"; then
2170 _optimizing=$(echo $_mcpu | cut -c 8-)
2171 echores "$_optimizing"
2172 else
2173 echores "none"
2176 test $_fast_clz = "auto" && _fast_clz=yes
2180 alpha*)
2181 arch='alpha'
2182 iproc='alpha'
2183 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2185 echocheck "CPU type"
2186 cat > $TMPC << EOF
2187 int main(void) {
2188 unsigned long ver, mask;
2189 __asm__ ("implver %0" : "=r" (ver));
2190 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2191 printf("%ld-%x\n", ver, ~mask);
2192 return 0;
2195 $_cc -o "$TMPEXE" "$TMPC"
2196 case $("$TMPEXE") in
2198 0-0) proc="ev4"; _mvi="0";;
2199 1-0) proc="ev5"; _mvi="0";;
2200 1-1) proc="ev56"; _mvi="0";;
2201 1-101) proc="pca56"; _mvi="1";;
2202 2-303) proc="ev6"; _mvi="1";;
2203 2-307) proc="ev67"; _mvi="1";;
2204 2-1307) proc="ev68"; _mvi="1";;
2205 esac
2206 echores "$proc"
2208 echocheck "GCC & CPU optimization abilities"
2209 if test "$proc" = "ev68" ; then
2210 cc_check -mcpu=$proc || proc=ev67
2212 if test "$proc" = "ev67" ; then
2213 cc_check -mcpu=$proc || proc=ev6
2215 _mcpu="-mcpu=$proc"
2216 echores "$proc"
2218 test $_fast_clz = "auto" && _fast_clz=yes
2220 _optimizing="$proc"
2223 mips*)
2224 arch='mips'
2225 iproc='mips'
2227 if irix ; then
2228 echocheck "CPU type"
2229 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2230 case "$(echo $proc)" in
2231 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2232 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2233 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2234 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2235 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2236 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2237 esac
2238 # gcc < 3.x does not support -mtune.
2239 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2240 _mcpu=''
2242 echores "$proc"
2245 test $_fast_clz = "auto" && _fast_clz=yes
2249 hppa)
2250 arch='pa_risc'
2251 iproc='PA-RISC'
2254 s390)
2255 arch='s390'
2256 iproc='390'
2259 s390x)
2260 arch='s390x'
2261 iproc='390x'
2264 vax)
2265 arch='vax'
2266 iproc='vax'
2269 xtensa)
2270 arch='xtensa'
2271 iproc='xtensa'
2274 generic)
2275 arch='generic'
2279 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2280 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2281 die "unsupported architecture $host_arch"
2283 esac # case "$host_arch" in
2285 if test "$_runtime_cpudetection" = yes ; then
2286 if x86 ; then
2287 test "$_cmov" != no && _cmov=yes
2288 x86_32 && _cmov=no
2289 test "$_mmx" != no && _mmx=yes
2290 test "$_3dnow" != no && _3dnow=yes
2291 test "$_3dnowext" != no && _3dnowext=yes
2292 test "$_mmxext" != no && _mmxext=yes
2293 test "$_sse" != no && _sse=yes
2294 test "$_sse2" != no && _sse2=yes
2295 test "$_ssse3" != no && _ssse3=yes
2296 test "$_mtrr" != no && _mtrr=yes
2298 if ppc; then
2299 _altivec=yes
2304 # endian testing
2305 echocheck "byte order"
2306 if test "$_big_endian" = auto ; then
2307 cat > $TMPC <<EOF
2308 short ascii_name[] = {
2309 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2310 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2311 int main(void) { return (long)ascii_name; }
2313 if cc_check ; then
2314 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2315 _big_endian=yes
2316 else
2317 _big_endian=no
2319 else
2320 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2323 if test "$_big_endian" = yes ; then
2324 _byte_order='big-endian'
2325 def_words_endian='#define WORDS_BIGENDIAN 1'
2326 def_bigendian='#define HAVE_BIGENDIAN 1'
2327 else
2328 _byte_order='little-endian'
2329 def_words_endian='#undef WORDS_BIGENDIAN'
2330 def_bigendian='#define HAVE_BIGENDIAN 0'
2332 echores "$_byte_order"
2335 echocheck "extern symbol prefix"
2336 cat > $TMPC << EOF
2337 int ff_extern;
2339 cc_check -c || die "Symbol mangling check failed."
2340 sym=$($_nm -P -g $TMPEXE)
2341 extern_prefix=${sym%%ff_extern*}
2342 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2343 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2344 echores $extern_prefix
2347 echocheck "assembler support of -pipe option"
2348 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2349 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2352 echocheck "compiler support of named assembler arguments"
2353 _named_asm_args=yes
2354 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2355 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2356 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2357 _named_asm_args=no
2358 def_named_asm_args="#undef NAMED_ASM_ARGS"
2360 echores $_named_asm_args
2363 if darwin && test "$cc_vendor" = "gnu" ; then
2364 echocheck "GCC support of -mstackrealign"
2365 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2366 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2367 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2368 # wrong code with this flag, but this can be worked around by adding
2369 # -fno-unit-at-a-time as described in the blog post at
2370 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2371 cat > $TMPC << EOF
2372 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2373 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2375 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2376 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time \
2377 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2378 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2379 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2382 # Checking for CFLAGS
2383 _install_strip="-s"
2384 if test "$_profile" != "" || test "$_debug" != "" ; then
2385 CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
2386 WARNFLAGS="-W -Wall"
2387 _install_strip=
2388 elif test -z "$CFLAGS" ; then
2389 if test "$cc_vendor" = "intel" ; then
2390 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2391 WARNFLAGS="-wd167 -wd556 -wd144"
2392 elif test "$cc_vendor" = "sun" ; then
2393 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2394 elif test "$cc_vendor" = "clang"; then
2395 CFLAGS="-O2 $_march $_pipe"
2396 elif test "$cc_vendor" != "gnu" ; then
2397 CFLAGS="-O2 $_march $_mcpu $_pipe"
2398 else
2399 CFLAGS="-O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2400 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2401 extra_ldflags="$extra_ldflags -ffast-math"
2403 else
2404 warn_cflags=yes
2407 if test "$cc_vendor" = "gnu" ; then
2408 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2409 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2410 # that's the only variable specific to C now, and this option is not valid
2411 # for C++.
2412 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2413 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2414 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2415 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2416 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2417 else
2418 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2421 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2422 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2425 if test -n "$LDFLAGS" ; then
2426 extra_ldflags="$extra_ldflags $LDFLAGS"
2427 warn_cflags=yes
2428 elif test "$cc_vendor" = "intel" ; then
2429 extra_ldflags="$extra_ldflags -i-static"
2431 if test -n "$CPPFLAGS" ; then
2432 extra_cflags="$extra_cflags $CPPFLAGS"
2433 warn_cflags=yes
2438 if x86_32 ; then
2439 # Checking assembler (_as) compatibility...
2440 # Added workaround for older as that reads from stdin by default - atmos
2441 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2442 echocheck "assembler ($_as $as_version)"
2444 _pref_as_version='2.9.1'
2445 echo 'nop' > $TMPS
2446 if test "$_mmx" = yes ; then
2447 echo 'emms' >> $TMPS
2449 if test "$_3dnow" = yes ; then
2450 _pref_as_version='2.10.1'
2451 echo 'femms' >> $TMPS
2453 if test "$_3dnowext" = yes ; then
2454 _pref_as_version='2.10.1'
2455 echo 'pswapd %mm0, %mm0' >> $TMPS
2457 if test "$_mmxext" = yes ; then
2458 _pref_as_version='2.10.1'
2459 echo 'movntq %mm0, (%eax)' >> $TMPS
2461 if test "$_sse" = yes ; then
2462 _pref_as_version='2.10.1'
2463 echo 'xorps %xmm0, %xmm0' >> $TMPS
2465 #if test "$_sse2" = yes ; then
2466 # _pref_as_version='2.11'
2467 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2469 if test "$_cmov" = yes ; then
2470 _pref_as_version='2.10.1'
2471 echo 'cmovb %eax, %ebx' >> $TMPS
2473 if test "$_ssse3" = yes ; then
2474 _pref_as_version='2.16.92'
2475 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2477 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2479 if test "$as_verc_fail" != yes ; then
2480 echores "ok"
2481 else
2482 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2483 echores "failed"
2484 die "obsolete binutils version"
2487 fi #if x86_32
2490 echocheck "PIC"
2491 pic=no
2492 cat > $TMPC << EOF
2493 int main(void) {
2494 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2495 #error PIC not enabled
2496 #endif
2497 return 0;
2500 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2501 echores $pic
2504 if x86 ; then
2506 echocheck ".align is a power of two"
2507 if test "$_asmalign_pot" = auto ; then
2508 _asmalign_pot=no
2509 inline_asm_check '".align 3"' && _asmalign_pot=yes
2511 if test "$_asmalign_pot" = "yes" ; then
2512 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2513 else
2514 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2516 echores $_asmalign_pot
2519 echocheck "10 assembler operands"
2520 ten_operands=no
2521 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2522 cat > $TMPC << EOF
2523 int main(void) {
2524 int x=0;
2525 __asm__ volatile(
2527 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2529 return 0;
2532 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2533 echores $ten_operands
2535 echocheck "ebx availability"
2536 ebx_available=no
2537 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2538 cat > $TMPC << EOF
2539 int main(void) {
2540 int x;
2541 __asm__ volatile(
2542 "xor %0, %0"
2543 :"=b"(x)
2544 // just adding ebx to clobber list seems unreliable with some
2545 // compilers, e.g. Haiku's gcc 2.95
2547 // and the above check does not work for OSX 64 bit...
2548 __asm__ volatile("":::"%ebx");
2549 return 0;
2552 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2553 echores $ebx_available
2556 echocheck "yasm"
2557 if test -z "$YASMFLAGS" ; then
2558 if darwin ; then
2559 x86_64 && objformat="macho64" || objformat="macho"
2560 elif win32 ; then
2561 objformat="win32"
2562 else
2563 objformat="elf"
2565 # currently tested for Linux x86, x86_64
2566 YASMFLAGS="-f $objformat"
2567 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2568 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2569 case "$objformat" in
2570 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2571 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2572 esac
2573 else
2574 warn_cflags=yes
2577 echo "pabsw xmm0, xmm0" > $TMPS
2578 yasm_check || _yasm=""
2579 if test $_yasm ; then
2580 def_yasm='#define HAVE_YASM 1'
2581 have_yasm="yes"
2582 echores "$_yasm"
2583 else
2584 def_yasm='#define HAVE_YASM 0'
2585 have_yasm="no"
2586 echores "no"
2589 echocheck "bswap"
2590 def_bswap='#define HAVE_BSWAP 0'
2591 echo 'bswap %eax' > $TMPS
2592 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2593 echores "$bswap"
2594 fi #if x86
2597 #FIXME: This should happen before the check for CFLAGS..
2598 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2599 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2601 # check if AltiVec is supported by the compiler, and how to enable it
2602 echocheck "GCC AltiVec flags"
2603 if $(cflag_check -maltivec -mabi=altivec) ; then
2604 _altivec_gcc_flags="-maltivec -mabi=altivec"
2605 # check if <altivec.h> should be included
2606 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2607 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2608 inc_altivec_h='#include <altivec.h>'
2609 else
2610 if $(cflag_check -faltivec) ; then
2611 _altivec_gcc_flags="-faltivec"
2612 else
2613 _altivec=no
2614 _altivec_gcc_flags="none, AltiVec disabled"
2618 echores "$_altivec_gcc_flags"
2620 # check if the compiler supports braces for vector declarations
2621 cat > $TMPC << EOF
2622 $inc_altivec_h
2623 int main(void) { (vector int) {1}; return 0; }
2625 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2627 # Disable runtime cpudetection if we cannot generate AltiVec code or
2628 # AltiVec is disabled by the user.
2629 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2630 && _runtime_cpudetection=no
2632 # Show that we are optimizing for AltiVec (if enabled and supported).
2633 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2634 && _optimizing="$_optimizing altivec"
2636 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2637 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2640 if ppc ; then
2641 def_xform_asm='#define HAVE_XFORM_ASM 0'
2642 xform_asm=no
2643 echocheck "XFORM ASM support"
2644 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2645 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2646 echores "$xform_asm"
2649 if arm ; then
2650 echocheck "ARM pld instruction"
2651 pld=no
2652 inline_asm_check '"pld [r0]"' && pld=yes
2653 echores "$pld"
2655 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2656 if test $_armv5te = "auto" ; then
2657 _armv5te=no
2658 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2660 echores "$_armv5te"
2662 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2664 echocheck "ARMv6 (SIMD instructions)"
2665 if test $_armv6 = "auto" ; then
2666 _armv6=no
2667 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2669 echores "$_armv6"
2671 echocheck "ARMv6t2 (SIMD instructions)"
2672 if test $_armv6t2 = "auto" ; then
2673 _armv6t2=no
2674 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2676 echores "$_armv6"
2678 echocheck "ARM VFP"
2679 if test $_armvfp = "auto" ; then
2680 _armvfp=no
2681 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2683 echores "$_armvfp"
2685 echocheck "ARM NEON"
2686 if test $neon = "auto" ; then
2687 neon=no
2688 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2690 echores "$neon"
2692 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2693 if test $_iwmmxt = "auto" ; then
2694 _iwmmxt=no
2695 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2697 echores "$_iwmmxt"
2700 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'
2701 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2702 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2703 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2704 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2705 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2706 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2707 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2708 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2709 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2710 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2711 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2712 test "$pld" = yes && cpuexts="PLD $cpuexts"
2713 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2714 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2715 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2716 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2717 test "$neon" = yes && cpuexts="NEON $cpuexts"
2718 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2719 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2720 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2722 # Checking kernel version...
2723 if x86_32 && linux ; then
2724 _k_verc_problem=no
2725 kernel_version=$(uname -r 2>&1)
2726 echocheck "$system_name kernel version"
2727 case "$kernel_version" in
2728 '') kernel_version="?.??"; _k_verc_fail=yes;;
2729 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2730 _k_verc_problem=yes;;
2731 esac
2732 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2733 _k_verc_fail=yes
2735 if test "$_k_verc_fail" ; then
2736 echores "$kernel_version, fail"
2737 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2738 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2739 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2740 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2741 echo "2.2.x you must upgrade it to get SSE support!"
2742 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2743 else
2744 echores "$kernel_version, ok"
2748 ######################
2749 # MAIN TESTS GO HERE #
2750 ######################
2753 echocheck "-lposix"
2754 if cflag_check -lposix ; then
2755 extra_ldflags="$extra_ldflags -lposix"
2756 echores "yes"
2757 else
2758 echores "no"
2761 echocheck "-lm"
2762 if cflag_check -lm ; then
2763 _ld_lm="-lm"
2764 echores "yes"
2765 else
2766 _ld_lm=""
2767 echores "no"
2771 echocheck "langinfo"
2772 if test "$_langinfo" = auto ; then
2773 _langinfo=no
2774 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2776 if test "$_langinfo" = yes ; then
2777 def_langinfo='#define HAVE_LANGINFO 1'
2778 else
2779 def_langinfo='#undef HAVE_LANGINFO'
2781 echores "$_langinfo"
2784 echocheck "translation support"
2785 if test "$_translation" = yes; then
2786 def_translation="#define CONFIG_TRANSLATION 1"
2787 else
2788 def_translation="#undef CONFIG_TRANSLATION"
2790 echores "$_translation"
2792 echocheck "language"
2793 # Set preferred languages, "all" uses English as main language.
2794 test -z "$language" && language=$LINGUAS
2795 test -z "$language_doc" && language_doc=$language
2796 test -z "$language_man" && language_man=$language
2797 test -z "$language_msg" && language_msg="all"
2798 language_doc=$(echo $language_doc | tr , " ")
2799 language_man=$(echo $language_man | tr , " ")
2800 language_msg=$(echo $language_msg | tr , " ")
2802 test "$language_doc" = "all" && language_doc=$doc_lang_all
2803 test "$language_man" = "all" && language_man=$man_lang_all
2804 test "$language_msg" = "all" && language_msg=$msg_lang_all
2806 if test "$_translation" != yes ; then
2807 language_msg=""
2810 # Prune non-existing translations from language lists.
2811 # Set message translation to the first available language.
2812 # Fall back on English.
2813 for lang in $language_doc ; do
2814 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2815 done
2816 language_doc=$tmp_language_doc
2817 test -z "$language_doc" && language_doc=en
2819 for lang in $language_man ; do
2820 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2821 done
2822 language_man=$tmp_language_man
2823 test -z "$language_man" && language_man=en
2825 for lang in $language_msg ; do
2826 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2827 done
2828 language_msg=$tmp_language_msg
2830 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2833 echocheck "enable sighandler"
2834 if test "$_sighandler" = yes ; then
2835 def_sighandler='#define CONFIG_SIGHANDLER 1'
2836 else
2837 def_sighandler='#undef CONFIG_SIGHANDLER'
2839 echores "$_sighandler"
2841 echocheck "runtime cpudetection"
2842 if test "$_runtime_cpudetection" = yes ; then
2843 _optimizing="Runtime CPU-Detection enabled"
2844 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2845 else
2846 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2848 echores "$_runtime_cpudetection"
2851 echocheck "restrict keyword"
2852 for restrict_keyword in restrict __restrict __restrict__ ; do
2853 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2854 if cc_check; then
2855 def_restrict_keyword=$restrict_keyword
2856 break;
2858 done
2859 if [ -n "$def_restrict_keyword" ]; then
2860 echores "$def_restrict_keyword"
2861 else
2862 echores "none"
2864 # Avoid infinite recursion loop ("#define restrict restrict")
2865 if [ "$def_restrict_keyword" != "restrict" ]; then
2866 def_restrict_keyword="#define restrict $def_restrict_keyword"
2867 else
2868 def_restrict_keyword=""
2872 echocheck "__builtin_expect"
2873 # GCC branch prediction hint
2874 cat > $TMPC << EOF
2875 static int foo(int a) {
2876 a = __builtin_expect(a, 10);
2877 return a == 10 ? 0 : 1;
2879 int main(void) { return foo(10) && foo(0); }
2881 _builtin_expect=no
2882 cc_check && _builtin_expect=yes
2883 if test "$_builtin_expect" = yes ; then
2884 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2885 else
2886 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2888 echores "$_builtin_expect"
2891 echocheck "kstat"
2892 _kstat=no
2893 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2894 if test "$_kstat" = yes ; then
2895 def_kstat="#define HAVE_LIBKSTAT 1"
2896 extra_ldflags="$extra_ldflags -lkstat"
2897 else
2898 def_kstat="#undef HAVE_LIBKSTAT"
2900 echores "$_kstat"
2903 echocheck "posix4"
2904 # required for nanosleep on some systems
2905 _posix4=no
2906 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2907 if test "$_posix4" = yes ; then
2908 extra_ldflags="$extra_ldflags -lposix4"
2910 echores "$_posix4"
2912 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2913 echocheck $func
2914 eval _$func=no
2915 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2916 if eval test "x\$_$func" = "xyes"; then
2917 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2918 echores yes
2919 else
2920 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2921 echores no
2923 done
2926 echocheck "mkstemp"
2927 cat > $TMPC << EOF
2928 #define _XOPEN_SOURCE 500
2929 #include <stdlib.h>
2930 int main(void) { mkstemp(""); return 0; }
2932 _mkstemp=no
2933 cc_check && _mkstemp=yes
2934 if test "$_mkstemp" = yes ; then
2935 def_mkstemp='#define HAVE_MKSTEMP 1'
2936 else
2937 def_mkstemp='#define HAVE_MKSTEMP 0'
2939 echores "$_mkstemp"
2942 echocheck "nanosleep"
2943 _nanosleep=no
2944 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2945 if test "$_nanosleep" = yes ; then
2946 def_nanosleep='#define HAVE_NANOSLEEP 1'
2947 else
2948 def_nanosleep='#undef HAVE_NANOSLEEP'
2950 echores "$_nanosleep"
2953 echocheck "socklib"
2954 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2955 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2956 cat > $TMPC << EOF
2957 #include <netdb.h>
2958 #include <sys/socket.h>
2959 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2961 _socklib=no
2962 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2963 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2964 done
2965 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2966 if test $_winsock2_h = auto ; then
2967 _winsock2_h=no
2968 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2970 test "$_ld_sock" && res_comment="using $_ld_sock"
2971 echores "$_socklib"
2974 if test $_winsock2_h = yes ; then
2975 _ld_sock="-lws2_32"
2976 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2977 else
2978 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2982 echocheck "arpa/inet.h"
2983 arpa_inet_h=no
2984 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2985 header_check arpa/inet.h && arpa_inet_h=yes &&
2986 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2987 echores "$arpa_inet_h"
2990 echocheck "inet_pton()"
2991 def_inet_pton='#define HAVE_INET_PTON 0'
2992 inet_pton=no
2993 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2994 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2995 done
2996 if test $inet_pton = yes ; then
2997 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2998 def_inet_pton='#define HAVE_INET_PTON 1'
3000 echores "$inet_pton"
3003 echocheck "inet_aton()"
3004 def_inet_aton='#define HAVE_INET_ATON 0'
3005 inet_aton=no
3006 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3007 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
3008 done
3009 if test $inet_aton = yes ; then
3010 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3011 def_inet_aton='#define HAVE_INET_ATON 1'
3013 echores "$inet_aton"
3016 echocheck "socklen_t"
3017 _socklen_t=no
3018 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3019 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
3020 done
3021 if test "$_socklen_t" = yes ; then
3022 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3023 else
3024 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3026 echores "$_socklen_t"
3029 echocheck "closesocket()"
3030 _closesocket=no
3031 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
3032 if test "$_closesocket" = yes ; then
3033 def_closesocket='#define HAVE_CLOSESOCKET 1'
3034 else
3035 def_closesocket='#define HAVE_CLOSESOCKET 0'
3037 echores "$_closesocket"
3040 echocheck "networking"
3041 test $_winsock2_h = no && test $inet_pton = no &&
3042 test $inet_aton = no && networking=no
3043 if test "$networking" = yes ; then
3044 def_network='#define CONFIG_NETWORK 1'
3045 def_networking='#define CONFIG_NETWORKING 1'
3046 extra_ldflags="$extra_ldflags $_ld_sock"
3047 inputmodules="networking $inputmodules"
3048 else
3049 noinputmodules="networking $noinputmodules"
3050 def_network='#define CONFIG_NETWORK 0'
3051 def_networking='#undef CONFIG_NETWORKING'
3053 echores "$networking"
3056 echocheck "inet6"
3057 if test "$_inet6" = auto ; then
3058 cat > $TMPC << EOF
3059 #include <sys/types.h>
3060 #if !defined(_WIN32) || defined(__CYGWIN__)
3061 #include <sys/socket.h>
3062 #include <netinet/in.h>
3063 #else
3064 #include <ws2tcpip.h>
3065 #endif
3066 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3068 _inet6=no
3069 if cc_check $_ld_sock ; then
3070 _inet6=yes
3073 if test "$_inet6" = yes ; then
3074 def_inet6='#define HAVE_AF_INET6 1'
3075 else
3076 def_inet6='#undef HAVE_AF_INET6'
3078 echores "$_inet6"
3081 echocheck "gethostbyname2"
3082 if test "$_gethostbyname2" = auto ; then
3083 cat > $TMPC << EOF
3084 #include <sys/types.h>
3085 #include <sys/socket.h>
3086 #include <netdb.h>
3087 int main(void) { gethostbyname2("", AF_INET); return 0; }
3089 _gethostbyname2=no
3090 if cc_check ; then
3091 _gethostbyname2=yes
3094 if test "$_gethostbyname2" = yes ; then
3095 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3096 else
3097 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3099 echores "$_gethostbyname2"
3102 echocheck "inttypes.h (required)"
3103 _inttypes=no
3104 header_check inttypes.h && _inttypes=yes
3105 echores "$_inttypes"
3107 if test "$_inttypes" = no ; then
3108 echocheck "sys/bitypes.h (inttypes.h predecessor)"
3109 header_check sys/bitypes.h && _inttypes=yes
3110 if test "$_inttypes" = yes ; then
3111 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."
3112 else
3113 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3118 echocheck "int_fastXY_t in inttypes.h"
3119 cat > $TMPC << EOF
3120 #include <inttypes.h>
3121 int main(void) { volatile int_fast16_t v = 0; return v; }
3123 _fast_inttypes=no
3124 cc_check && _fast_inttypes=yes
3125 if test "$_fast_inttypes" = no ; then
3126 def_fast_inttypes='
3127 typedef signed char int_fast8_t;
3128 typedef signed int int_fast16_t;
3129 typedef signed int int_fast32_t;
3130 typedef signed long long int_fast64_t;
3131 typedef unsigned char uint_fast8_t;
3132 typedef unsigned int uint_fast16_t;
3133 typedef unsigned int uint_fast32_t;
3134 typedef unsigned long long uint_fast64_t;'
3136 echores "$_fast_inttypes"
3139 echocheck "malloc.h"
3140 _malloc=no
3141 header_check malloc.h && _malloc=yes
3142 if test "$_malloc" = yes ; then
3143 def_malloc_h='#define HAVE_MALLOC_H 1'
3144 else
3145 def_malloc_h='#define HAVE_MALLOC_H 0'
3147 echores "$_malloc"
3150 echocheck "memalign()"
3151 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3152 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3153 _memalign=no
3154 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3155 if test "$_memalign" = yes ; then
3156 def_memalign='#define HAVE_MEMALIGN 1'
3157 else
3158 def_memalign='#define HAVE_MEMALIGN 0'
3159 def_map_memalign='#define memalign(a, b) malloc(b)'
3160 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3162 echores "$_memalign"
3165 echocheck "posix_memalign()"
3166 posix_memalign=no
3167 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3168 cat > $TMPC << EOF
3169 #define _XOPEN_SOURCE 600
3170 #include <stdlib.h>
3171 int main(void) { posix_memalign(NULL, 0, 0); }
3173 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3174 echores "$posix_memalign"
3177 echocheck "alloca.h"
3178 _alloca=no
3179 statement_check alloca.h 'alloca(0)' && _alloca=yes
3180 if cc_check ; then
3181 def_alloca_h='#define HAVE_ALLOCA_H 1'
3182 else
3183 def_alloca_h='#undef HAVE_ALLOCA_H'
3185 echores "$_alloca"
3188 echocheck "fastmemcpy"
3189 if test "$_fastmemcpy" = yes ; then
3190 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3191 else
3192 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3194 echores "$_fastmemcpy"
3197 echocheck "mman.h"
3198 _mman=no
3199 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3200 if test "$_mman" = yes ; then
3201 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3202 else
3203 def_mman_h='#undef HAVE_SYS_MMAN_H'
3204 os2 && _need_mmap=yes
3206 echores "$_mman"
3208 _mman_has_map_failed=no
3209 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
3210 if test "$_mman_has_map_failed" = yes ; then
3211 def_mman_has_map_failed=''
3212 else
3213 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3216 echocheck "dynamic loader"
3217 _dl=no
3218 for _ld_tmp in "" "-ldl"; do
3219 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3220 done
3221 if test "$_dl" = yes ; then
3222 def_dl='#define HAVE_LIBDL 1'
3223 else
3224 def_dl='#undef HAVE_LIBDL'
3226 echores "$_dl"
3229 echocheck "dynamic a/v plugins support"
3230 if test "$_dl" = no ; then
3231 _dynamic_plugins=no
3233 if test "$_dynamic_plugins" = yes ; then
3234 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3235 else
3236 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3238 echores "$_dynamic_plugins"
3241 def_threads='#define HAVE_THREADS 0'
3243 echocheck "pthread"
3244 if linux ; then
3245 THREAD_CFLAGS=-D_REENTRANT
3246 elif freebsd || netbsd || openbsd || bsdos ; then
3247 THREAD_CFLAGS=-D_THREAD_SAFE
3249 if test "$_pthreads" = auto ; then
3250 cat > $TMPC << EOF
3251 #include <pthread.h>
3252 static void *func(void *arg) { return arg; }
3253 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3255 _pthreads=no
3256 if ! hpux ; then
3257 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3258 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3259 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3260 done
3263 if test "$_pthreads" = yes ; then
3264 test $_ld_pthread && res_comment="using $_ld_pthread"
3265 def_pthreads='#define HAVE_PTHREADS 1'
3266 def_threads='#define HAVE_THREADS 1'
3267 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3268 else
3269 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3270 def_pthreads='#undef HAVE_PTHREADS'
3271 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3272 mingw32 || _win32dll=no
3274 echores "$_pthreads"
3276 if cygwin ; then
3277 if test "$_pthreads" = yes ; then
3278 def_pthread_cache="#define PTHREAD_CACHE 1"
3279 else
3280 _stream_cache=no
3281 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3285 echocheck "w32threads"
3286 if test "$_pthreads" = yes ; then
3287 res_comment="using pthread instead"
3288 _w32threads=no
3290 if test "$_w32threads" = auto ; then
3291 _w32threads=no
3292 mingw32 && _w32threads=yes
3294 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3295 echores "$_w32threads"
3297 echocheck "rpath"
3298 if test "$_rpath" = yes ; then
3299 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3300 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3301 done
3302 extra_ldflags=$tmp
3304 echores "$_rpath"
3306 echocheck "iconv"
3307 if test "$_iconv" = auto ; then
3308 cat > $TMPC << EOF
3309 #include <stdio.h>
3310 #include <unistd.h>
3311 #include <iconv.h>
3312 #define INBUFSIZE 1024
3313 #define OUTBUFSIZE 4096
3315 char inbuffer[INBUFSIZE];
3316 char outbuffer[OUTBUFSIZE];
3318 int main(void) {
3319 size_t numread;
3320 iconv_t icdsc;
3321 char *tocode="UTF-8";
3322 char *fromcode="cp1250";
3323 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3324 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3325 char *iptr=inbuffer;
3326 char *optr=outbuffer;
3327 size_t inleft=numread;
3328 size_t outleft=OUTBUFSIZE;
3329 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3330 != (size_t)(-1)) {
3331 write(1, outbuffer, OUTBUFSIZE - outleft);
3334 if (iconv_close(icdsc) == -1)
3337 return 0;
3340 _iconv=no
3341 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3342 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3343 _iconv=yes && break
3344 done
3346 if test "$_iconv" = yes ; then
3347 def_iconv='#define CONFIG_ICONV 1'
3348 else
3349 def_iconv='#undef CONFIG_ICONV'
3351 echores "$_iconv"
3354 echocheck "soundcard.h"
3355 _soundcard_h=no
3356 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3357 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3358 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3359 header_check $_soundcard_header && _soundcard_h=yes &&
3360 res_comment="$_soundcard_header" && break
3361 done
3363 if test "$_soundcard_h" = yes ; then
3364 if test $_soundcard_header = "sys/soundcard.h"; then
3365 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3366 else
3367 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3370 echores "$_soundcard_h"
3373 echocheck "sys/dvdio.h"
3374 _dvdio=no
3375 # FreeBSD 8.1 has broken dvdio.h
3376 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3377 if test "$_dvdio" = yes ; then
3378 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3379 else
3380 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3382 echores "$_dvdio"
3385 echocheck "sys/cdio.h"
3386 _cdio=no
3387 # at least OpenSolaris has a broken cdio.h
3388 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3389 if test "$_cdio" = yes ; then
3390 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3391 else
3392 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3394 echores "$_cdio"
3397 echocheck "linux/cdrom.h"
3398 _cdrom=no
3399 header_check linux/cdrom.h && _cdrom=yes
3400 if test "$_cdrom" = yes ; then
3401 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3402 else
3403 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3405 echores "$_cdrom"
3408 echocheck "dvd.h"
3409 _dvd=no
3410 header_check dvd.h && _dvd=yes
3411 if test "$_dvd" = yes ; then
3412 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3413 else
3414 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3416 echores "$_dvd"
3419 if bsdos; then
3420 echocheck "BSDI dvd.h"
3421 _bsdi_dvd=no
3422 header_check dvd.h && _bsdi_dvd=yes
3423 if test "$_bsdi_dvd" = yes ; then
3424 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3425 else
3426 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3428 echores "$_bsdi_dvd"
3429 fi #if bsdos
3432 if hpux; then
3433 # also used by AIX, but AIX does not support VCD and/or libdvdread
3434 echocheck "HP-UX SCSI header"
3435 _hpux_scsi_h=no
3436 header_check sys/scsi.h && _hpux_scsi_h=yes
3437 if test "$_hpux_scsi_h" = yes ; then
3438 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3439 else
3440 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3442 echores "$_hpux_scsi_h"
3443 fi #if hpux
3446 if sunos; then
3447 echocheck "userspace SCSI headers (Solaris)"
3448 _sol_scsi_h=no
3449 header_check sys/scsi/scsi_types.h &&
3450 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3451 _sol_scsi_h=yes
3452 if test "$_sol_scsi_h" = yes ; then
3453 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3454 else
3455 def_sol_scsi_h='#undef SOLARIS_USCSI'
3457 echores "$_sol_scsi_h"
3458 fi #if sunos
3461 echocheck "termcap"
3462 if test "$_termcap" = auto ; then
3463 _termcap=no
3464 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3465 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3466 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3467 done
3469 if test "$_termcap" = yes ; then
3470 def_termcap='#define HAVE_TERMCAP 1'
3471 test $_ld_tmp && res_comment="using $_ld_tmp"
3472 else
3473 def_termcap='#undef HAVE_TERMCAP'
3475 echores "$_termcap"
3478 echocheck "termios"
3479 def_termios='#undef HAVE_TERMIOS'
3480 def_termios_h='#undef HAVE_TERMIOS_H'
3481 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3482 if test "$_termios" = auto ; then
3483 _termios=no
3484 for _termios_header in "termios.h" "sys/termios.h"; do
3485 header_check $_termios_header && _termios=yes &&
3486 res_comment="using $_termios_header" && break
3487 done
3490 if test "$_termios" = yes ; then
3491 def_termios='#define HAVE_TERMIOS 1'
3492 if test "$_termios_header" = "termios.h" ; then
3493 def_termios_h='#define HAVE_TERMIOS_H 1'
3494 else
3495 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3498 echores "$_termios"
3501 echocheck "shm"
3502 if test "$_shm" = auto ; then
3503 cat > $TMPC << EOF
3504 #include <sys/shm.h>
3505 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3507 _shm=no
3508 cc_check && _shm=yes
3510 if test "$_shm" = yes ; then
3511 def_shm='#define HAVE_SHM 1'
3512 else
3513 def_shm='#undef HAVE_SHM'
3515 echores "$_shm"
3518 echocheck "strsep()"
3519 cat > $TMPC << EOF
3520 #include <string.h>
3521 int main(void) { char *s = "Hello, world!"; strsep(&s, ","); return 0; }
3523 _strsep=no
3524 cc_check && _strsep=yes
3525 if test "$_strsep" = yes ; then
3526 def_strsep='#define HAVE_STRSEP 1'
3527 _need_strsep=no
3528 else
3529 def_strsep='#undef HAVE_STRSEP'
3530 _need_strsep=yes
3532 echores "$_strsep"
3535 echocheck "vsscanf()"
3536 cat > $TMPC << EOF
3537 #define _ISOC99_SOURCE
3538 #include <stdarg.h>
3539 #include <stdio.h>
3540 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3542 _vsscanf=no
3543 cc_check && _vsscanf=yes
3544 if test "$_vsscanf" = yes ; then
3545 def_vsscanf='#define HAVE_VSSCANF 1'
3546 _need_vsscanf=no
3547 else
3548 def_vsscanf='#undef HAVE_VSSCANF'
3549 _need_vsscanf=yes
3551 echores "$_vsscanf"
3554 echocheck "swab()"
3555 cat > $TMPC << EOF
3556 #define _XOPEN_SOURCE 600
3557 #include <unistd.h>
3558 int main(void) { int a, b; swab(&a, &b, 0); return 0; }
3560 _swab=no
3561 cc_check && _swab=yes
3562 if test "$_swab" = yes ; then
3563 def_swab='#define HAVE_SWAB 1'
3564 _need_swab=no
3565 else
3566 def_swab='#undef HAVE_SWAB'
3567 _need_swab=yes
3569 echores "$_swab"
3571 echocheck "POSIX select()"
3572 cat > $TMPC << EOF
3573 #include <stdio.h>
3574 #include <stdlib.h>
3575 #include <sys/types.h>
3576 #include <string.h>
3577 #include <sys/time.h>
3578 #include <unistd.h>
3579 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3581 _posix_select=no
3582 def_posix_select='#undef HAVE_POSIX_SELECT'
3583 #select() of kLIBC (OS/2) supports socket only
3584 ! os2 && cc_check && _posix_select=yes \
3585 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3586 echores "$_posix_select"
3589 echocheck "audio select()"
3590 if test "$_select" = no ; then
3591 def_select='#undef HAVE_AUDIO_SELECT'
3592 elif test "$_select" = yes ; then
3593 def_select='#define HAVE_AUDIO_SELECT 1'
3595 echores "$_select"
3598 echocheck "gettimeofday()"
3599 cat > $TMPC << EOF
3600 #include <sys/time.h>
3601 int main(void) {struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz); return 0; }
3603 _gettimeofday=no
3604 cc_check && _gettimeofday=yes
3605 if test "$_gettimeofday" = yes ; then
3606 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3607 _need_gettimeofday=no
3608 else
3609 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3610 _need_gettimeofday=yes
3612 echores "$_gettimeofday"
3615 echocheck "glob()"
3616 _glob=no
3617 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3618 if test "$_glob" = yes ; then
3619 def_glob='#define HAVE_GLOB 1'
3620 _need_glob=no
3621 else
3622 def_glob='#undef HAVE_GLOB'
3623 _need_glob=yes
3625 echores "$_glob"
3628 echocheck "setenv()"
3629 _setenv=no
3630 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3631 if test "$_setenv" = yes ; then
3632 def_setenv='#define HAVE_SETENV 1'
3633 _need_setenv=no
3634 else
3635 def_setenv='#undef HAVE_SETENV'
3636 _need_setenv=yes
3638 echores "$_setenv"
3641 echocheck "setmode()"
3642 _setmode=no
3643 def_setmode='#define HAVE_SETMODE 0'
3644 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3645 echores "$_setmode"
3648 if sunos; then
3649 echocheck "sysi86()"
3650 _sysi86=no
3651 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3652 if test "$_sysi86" = yes ; then
3653 def_sysi86='#define HAVE_SYSI86 1'
3654 cat > $TMPC << EOF
3655 #include <sys/sysi86.h>
3656 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3658 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3659 else
3660 def_sysi86='#undef HAVE_SYSI86'
3662 echores "$_sysi86"
3663 fi #if sunos
3666 echocheck "sys/sysinfo.h"
3667 cat > $TMPC << EOF
3668 #include <sys/sysinfo.h>
3669 int main(void) { struct sysinfo s_info; sysinfo(&s_info); return 0; }
3671 _sys_sysinfo=no
3672 cc_check && _sys_sysinfo=yes
3673 if test "$_sys_sysinfo" = yes ; then
3674 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3675 else
3676 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3678 echores "$_sys_sysinfo"
3681 if darwin; then
3683 echocheck "Mac OS X Finder Support"
3684 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3685 if test "$_macosx_finder" = yes ; then
3686 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3687 extra_ldflags="$extra_ldflags -framework Carbon"
3689 echores "$_macosx_finder"
3691 echocheck "Mac OS X Bundle file locations"
3692 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3693 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3694 if test "$_macosx_bundle" = yes ; then
3695 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3696 extra_ldflags="$extra_ldflags -framework Carbon"
3698 echores "$_macosx_bundle"
3700 echocheck "Apple Remote"
3701 if test "$_apple_remote" = auto ; then
3702 _apple_remote=no
3703 cat > $TMPC <<EOF
3704 #include <stdio.h>
3705 #include <IOKit/IOCFPlugIn.h>
3706 int main(void) {
3707 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3708 CFMutableDictionaryRef hidMatchDictionary;
3709 IOReturn ioReturnValue;
3711 // Set up a matching dictionary to search the I/O Registry by class.
3712 // name for all HID class devices
3713 hidMatchDictionary = IOServiceMatching("AppleIRController");
3715 // Now search I/O Registry for matching devices.
3716 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3717 hidMatchDictionary, &hidObjectIterator);
3719 // If search is unsuccessful, return nonzero.
3720 if (ioReturnValue != kIOReturnSuccess ||
3721 !IOIteratorIsValid(hidObjectIterator)) {
3722 return 1;
3724 return 0;
3727 cc_check -framework IOKit && _apple_remote=yes
3729 if test "$_apple_remote" = yes ; then
3730 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3731 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3732 else
3733 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3735 echores "$_apple_remote"
3737 fi #if darwin
3739 if linux; then
3741 echocheck "Apple IR"
3742 if test "$_apple_ir" = auto ; then
3743 _apple_ir=no
3744 cat > $TMPC <<EOF
3745 #include <linux/input.h>
3746 int main(void) { struct input_event ev; struct input_id id; return 0; }
3748 cc_check && _apple_ir=yes
3750 if test "$_apple_ir" = yes ; then
3751 def_apple_ir='#define CONFIG_APPLE_IR 1'
3752 else
3753 def_apple_ir='#undef CONFIG_APPLE_IR'
3755 echores "$_apple_ir"
3756 fi #if linux
3758 echocheck "pkg-config"
3759 _pkg_config=pkg-config
3760 if $($_pkg_config --version > /dev/null 2>&1); then
3761 if test "$_ld_static"; then
3762 _pkg_config="$_pkg_config --static"
3764 echores "yes"
3765 else
3766 _pkg_config=false
3767 echores "no"
3771 echocheck "Samba support (libsmbclient)"
3772 if test "$_smb" = yes; then
3773 extra_ldflags="$extra_ldflags -lsmbclient"
3775 if test "$_smb" = auto; then
3776 _smb=no
3777 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3778 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3779 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3780 done
3783 if test "$_smb" = yes; then
3784 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3785 inputmodules="smb $inputmodules"
3786 else
3787 def_smb="#undef CONFIG_LIBSMBCLIENT"
3788 noinputmodules="smb $noinputmodules"
3790 echores "$_smb"
3793 #########
3794 # VIDEO #
3795 #########
3798 echocheck "tdfxfb"
3799 if test "$_tdfxfb" = yes ; then
3800 def_tdfxfb='#define CONFIG_TDFXFB 1'
3801 vomodules="tdfxfb $vomodules"
3802 else
3803 def_tdfxfb='#undef CONFIG_TDFXFB'
3804 novomodules="tdfxfb $novomodules"
3806 echores "$_tdfxfb"
3808 echocheck "s3fb"
3809 if test "$_s3fb" = yes ; then
3810 def_s3fb='#define CONFIG_S3FB 1'
3811 vomodules="s3fb $vomodules"
3812 else
3813 def_s3fb='#undef CONFIG_S3FB'
3814 novomodules="s3fb $novomodules"
3816 echores "$_s3fb"
3818 echocheck "wii"
3819 if test "$_wii" = yes ; then
3820 def_wii='#define CONFIG_WII 1'
3821 vomodules="wii $vomodules"
3822 else
3823 def_wii='#undef CONFIG_WII'
3824 novomodules="wii $novomodules"
3826 echores "$_wii"
3828 echocheck "tdfxvid"
3829 if test "$_tdfxvid" = yes ; then
3830 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3831 vomodules="tdfx_vid $vomodules"
3832 else
3833 def_tdfxvid='#undef CONFIG_TDFX_VID'
3834 novomodules="tdfx_vid $novomodules"
3836 echores "$_tdfxvid"
3838 echocheck "xvr100"
3839 if test "$_xvr100" = auto ; then
3840 cat > $TMPC << EOF
3841 #include <unistd.h>
3842 #include <sys/fbio.h>
3843 #include <sys/visual_io.h>
3844 int main(void) {
3845 struct vis_identifier ident;
3846 struct fbgattr attr;
3847 ioctl(0, VIS_GETIDENTIFIER, &ident);
3848 ioctl(0, FBIOGATTR, &attr);
3849 return 0;
3852 _xvr100=no
3853 cc_check && _xvr100=yes
3855 if test "$_xvr100" = yes ; then
3856 def_xvr100='#define CONFIG_XVR100 1'
3857 vomodules="xvr100 $vomodules"
3858 else
3859 def_tdfxvid='#undef CONFIG_XVR100'
3860 novomodules="xvr100 $novomodules"
3862 echores "$_xvr100"
3864 echocheck "tga"
3865 if test "$_tga" = yes ; then
3866 def_tga='#define CONFIG_TGA 1'
3867 vomodules="tga $vomodules"
3868 else
3869 def_tga='#undef CONFIG_TGA'
3870 novomodules="tga $novomodules"
3872 echores "$_tga"
3875 echocheck "md5sum support"
3876 if test "$_md5sum" = yes; then
3877 def_md5sum="#define CONFIG_MD5SUM 1"
3878 vomodules="md5sum $vomodules"
3879 else
3880 def_md5sum="#undef CONFIG_MD5SUM"
3881 novomodules="md5sum $novomodules"
3883 echores "$_md5sum"
3886 echocheck "yuv4mpeg support"
3887 if test "$_yuv4mpeg" = yes; then
3888 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3889 vomodules="yuv4mpeg $vomodules"
3890 else
3891 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3892 novomodules="yuv4mpeg $novomodules"
3894 echores "$_yuv4mpeg"
3897 echocheck "bl"
3898 if test "$_bl" = yes ; then
3899 def_bl='#define CONFIG_BL 1'
3900 vomodules="bl $vomodules"
3901 else
3902 def_bl='#undef CONFIG_BL'
3903 novomodules="bl $novomodules"
3905 echores "$_bl"
3908 echocheck "DirectFB"
3909 if test "$_directfb" = auto ; then
3910 _directfb=no
3911 cat > $TMPC << EOF
3912 #include <directfb.h>
3913 #include <directfb_version.h>
3914 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3915 #error "DirectFB version too old."
3916 #endif
3917 int main(void) { DirectFBInit(0, 0); return 0; }
3919 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3920 cc_check $_inc_tmp -ldirectfb &&
3921 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3922 done
3924 if test "$_directfb" = yes ; then
3925 def_directfb='#define CONFIG_DIRECTFB 1'
3926 vomodules="directfb dfbmga $vomodules"
3927 libs_mplayer="$libs_mplayer -ldirectfb"
3928 else
3929 def_directfb='#undef CONFIG_DIRECTFB'
3930 novomodules="directfb dfbmga $novomodules"
3932 echores "$_directfb"
3935 echocheck "X11 headers presence"
3936 _x11_headers="no"
3937 res_comment="check if the dev(el) packages are installed"
3938 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3939 if test -f "$I/X11/Xlib.h" ; then
3940 _x11_headers="yes"
3941 res_comment=""
3942 break
3944 done
3945 if test $_cross_compile = no; then
3946 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3947 /usr/include/X11R6 /usr/openwin/include ; do
3948 if test -f "$I/X11/Xlib.h" ; then
3949 extra_cflags="$extra_cflags -I$I"
3950 _x11_headers="yes"
3951 res_comment="using $I"
3952 break
3954 done
3956 echores "$_x11_headers"
3959 echocheck "X11"
3960 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3961 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3962 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3963 -L/usr/lib ; do
3964 if netbsd; then
3965 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3966 else
3967 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3969 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3970 libs_mplayer="$libs_mplayer $_ld_tmp" && _x11=yes && break
3971 done
3973 if test "$_x11" = yes ; then
3974 def_x11='#define CONFIG_X11 1'
3975 vomodules="x11 xover $vomodules"
3976 else
3977 _x11=no
3978 def_x11='#undef CONFIG_X11'
3979 novomodules="x11 $novomodules"
3980 res_comment="check if the dev(el) packages are installed"
3981 # disable stuff that depends on X
3982 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
3984 echores "$_x11"
3986 echocheck "Xss screensaver extensions"
3987 if test "$_xss" = auto ; then
3988 cat > $TMPC << EOF
3989 #include <X11/Xlib.h>
3990 #include <X11/extensions/scrnsaver.h>
3991 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
3993 _xss=no
3994 cc_check -lXss && _xss=yes
3996 if test "$_xss" = yes ; then
3997 def_xss='#define CONFIG_XSS 1'
3998 libs_mplayer="$libs_mplayer -lXss"
3999 else
4000 def_xss='#undef CONFIG_XSS'
4002 echores "$_xss"
4004 echocheck "DPMS"
4005 _xdpms3=no
4006 _xdpms4=no
4007 if test "$_x11" = yes ; then
4008 cat > $TMPC <<EOF
4009 #include <X11/Xmd.h>
4010 #include <X11/Xlib.h>
4011 #include <X11/Xutil.h>
4012 #include <X11/Xatom.h>
4013 #include <X11/extensions/dpms.h>
4014 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
4016 cc_check -lXdpms && _xdpms3=yes
4017 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
4019 if test "$_xdpms4" = yes ; then
4020 def_xdpms='#define CONFIG_XDPMS 1'
4021 res_comment="using Xdpms 4"
4022 echores "yes"
4023 elif test "$_xdpms3" = yes ; then
4024 def_xdpms='#define CONFIG_XDPMS 1'
4025 libs_mplayer="$libs_mplayer -lXdpms"
4026 res_comment="using Xdpms 3"
4027 echores "yes"
4028 else
4029 def_xdpms='#undef CONFIG_XDPMS'
4030 echores "no"
4034 echocheck "Xv"
4035 if test "$_xv" = auto ; then
4036 _xv=no
4037 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
4040 if test "$_xv" = yes ; then
4041 def_xv='#define CONFIG_XV 1'
4042 libs_mplayer="$libs_mplayer -lXv"
4043 vomodules="xv $vomodules"
4044 else
4045 def_xv='#undef CONFIG_XV'
4046 novomodules="xv $novomodules"
4048 echores "$_xv"
4051 echocheck "XvMC"
4052 if test "$_xv" = yes && test "$_xvmc" != no ; then
4053 _xvmc=no
4054 cat > $TMPC <<EOF
4055 #include <X11/Xlib.h>
4056 #include <X11/extensions/Xvlib.h>
4057 #include <X11/extensions/XvMClib.h>
4058 int main(void) {
4059 XvMCQueryExtension(0, 0, 0);
4060 XvMCCreateContext(0, 0, 0, 0, 0, 0, 0);
4061 return 0; }
4063 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4064 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4065 done
4067 if test "$_xvmc" = yes ; then
4068 def_xvmc='#define CONFIG_XVMC 1'
4069 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4070 vomodules="xvmc $vomodules"
4071 res_comment="using $_xvmclib"
4072 else
4073 def_xvmc='#define CONFIG_XVMC 0'
4074 novomodules="xvmc $novomodules"
4076 echores "$_xvmc"
4079 echocheck "VDPAU"
4080 if test "$_vdpau" = auto ; then
4081 _vdpau=no
4082 if test "$_dl" = yes ; then
4083 cat > $TMPC <<EOF
4084 #include <vdpau/vdpau_x11.h>
4085 int main(void) {
4086 vdp_device_create_x11(0, 0, 0, 0);
4087 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4089 cc_check -lvdpau && _vdpau=yes
4092 if test "$_vdpau" = yes ; then
4093 def_vdpau='#define CONFIG_VDPAU 1'
4094 libs_mplayer="$libs_mplayer -lvdpau"
4095 vomodules="vdpau $vomodules"
4096 else
4097 def_vdpau='#define CONFIG_VDPAU 0'
4098 novomodules="vdpau $novomodules"
4100 echores "$_vdpau"
4103 echocheck "Xinerama"
4104 if test "$_xinerama" = auto ; then
4105 _xinerama=no
4106 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
4109 if test "$_xinerama" = yes ; then
4110 def_xinerama='#define CONFIG_XINERAMA 1'
4111 libs_mplayer="$libs_mplayer -lXinerama"
4112 else
4113 def_xinerama='#undef CONFIG_XINERAMA'
4115 echores "$_xinerama"
4118 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4119 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4120 # named 'X extensions' or something similar.
4121 # This check may be useful for future mplayer versions (to change resolution)
4122 # If you run into problems, remove '-lXxf86vm'.
4123 echocheck "Xxf86vm"
4124 if test "$_vm" = auto ; then
4125 _vm=no
4126 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
4128 if test "$_vm" = yes ; then
4129 def_vm='#define CONFIG_XF86VM 1'
4130 libs_mplayer="$libs_mplayer -lXxf86vm"
4131 else
4132 def_vm='#undef CONFIG_XF86VM'
4134 echores "$_vm"
4136 # Check for the presence of special keycodes, like audio control buttons
4137 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4138 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4139 # have these new keycodes.
4140 echocheck "XF86keysym"
4141 if test "$_xf86keysym" = auto; then
4142 _xf86keysym=no
4143 cat > $TMPC <<EOF
4144 #include <X11/XF86keysym.h>
4145 int main(void) { return XF86XK_AudioPause; }
4147 cc_check && _xf86keysym=yes
4149 if test "$_xf86keysym" = yes ; then
4150 def_xf86keysym='#define CONFIG_XF86XK 1'
4151 else
4152 def_xf86keysym='#undef CONFIG_XF86XK'
4154 echores "$_xf86keysym"
4156 echocheck "DGA"
4157 if test "$_dga2" = auto && test "$_x11" = yes ; then
4158 _dga2=no
4159 statement_check_broken X11/Xlib.h X11/extensions/xf86dga.h 'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2=yes
4161 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4162 _dga1=no
4163 statement_check_broken X11/Xlib.h X11/extensions/xf86dga.h 'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1=yes
4166 _dga=no
4167 def_dga='#undef CONFIG_DGA'
4168 def_dga1='#undef CONFIG_DGA1'
4169 def_dga2='#undef CONFIG_DGA2'
4170 if test "$_dga1" = yes ; then
4171 _dga=yes
4172 def_dga1='#define CONFIG_DGA1 1'
4173 res_comment="using DGA 1.0"
4174 elif test "$_dga2" = yes ; then
4175 _dga=yes
4176 def_dga2='#define CONFIG_DGA2 1'
4177 res_comment="using DGA 2.0"
4179 if test "$_dga" = yes ; then
4180 def_dga='#define CONFIG_DGA 1'
4181 libs_mplayer="$libs_mplayer -lXxf86dga"
4182 vomodules="dga $vomodules"
4183 else
4184 novomodules="dga $novomodules"
4186 echores "$_dga"
4189 echocheck "3dfx"
4190 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4191 def_3dfx='#define CONFIG_3DFX 1'
4192 vomodules="3dfx $vomodules"
4193 else
4194 def_3dfx='#undef CONFIG_3DFX'
4195 novomodules="3dfx $novomodules"
4197 echores "$_3dfx"
4200 echocheck "VIDIX"
4201 def_vidix='#undef CONFIG_VIDIX'
4202 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4203 _vidix_drv_cyberblade=no
4204 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4205 _vidix_drv_ivtv=no
4206 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4207 _vidix_drv_mach64=no
4208 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4209 _vidix_drv_mga=no
4210 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4211 _vidix_drv_mga_crtc2=no
4212 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4213 _vidix_drv_nvidia=no
4214 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4215 _vidix_drv_pm2=no
4216 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4217 _vidix_drv_pm3=no
4218 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4219 _vidix_drv_radeon=no
4220 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4221 _vidix_drv_rage128=no
4222 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4223 _vidix_drv_s3=no
4224 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4225 _vidix_drv_sh_veu=no
4226 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4227 _vidix_drv_sis=no
4228 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4229 _vidix_drv_unichrome=no
4230 if test "$_vidix" = auto ; then
4231 _vidix=no
4232 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4233 && _vidix=yes
4234 x86_64 && ! linux && _vidix=no
4235 (ppc || alpha) && linux && _vidix=yes
4237 echores "$_vidix"
4239 if test "$_vidix" = yes ; then
4240 def_vidix='#define CONFIG_VIDIX 1'
4241 vomodules="cvidix $vomodules"
4242 # FIXME: ivtv driver temporarily disabled until we have a proper test
4243 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4244 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4246 # some vidix drivers are architecture and os specific, discard them elsewhere
4247 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4248 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4250 for driver in $_vidix_drivers ; do
4251 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4252 eval _vidix_drv_${driver}=yes
4253 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4254 done
4256 echocheck "VIDIX PCI device name database"
4257 echores "$_vidix_pcidb"
4258 if test "$_vidix_pcidb" = yes ; then
4259 _vidix_pcidb_val=1
4260 else
4261 _vidix_pcidb_val=0
4264 echocheck "VIDIX dhahelper support"
4265 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4266 echores "$_dhahelper"
4268 echocheck "VIDIX svgalib_helper support"
4269 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4270 echores "$_svgalib_helper"
4272 else
4273 novomodules="cvidix $novomodules"
4276 if test "$_vidix" = yes && win32; then
4277 winvidix=yes
4278 vomodules="winvidix $vomodules"
4279 libs_mplayer="$libs_mplayer -lgdi32"
4280 else
4281 novomodules="winvidix $novomodules"
4283 if test "$_vidix" = yes && test "$_x11" = yes; then
4284 xvidix=yes
4285 vomodules="xvidix $vomodules"
4286 else
4287 novomodules="xvidix $novomodules"
4290 echocheck "GGI"
4291 if test "$_ggi" = auto ; then
4292 _ggi=no
4293 statement_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4295 if test "$_ggi" = yes ; then
4296 def_ggi='#define CONFIG_GGI 1'
4297 libs_mplayer="$libs_mplayer -lggi"
4298 vomodules="ggi $vomodules"
4299 else
4300 def_ggi='#undef CONFIG_GGI'
4301 novomodules="ggi $novomodules"
4303 echores "$_ggi"
4305 echocheck "GGI extension: libggiwmh"
4306 if test "$_ggiwmh" = auto ; then
4307 _ggiwmh=no
4308 statement_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4310 # needed to get right output on obscure combination
4311 # like --disable-ggi --enable-ggiwmh
4312 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4313 def_ggiwmh='#define CONFIG_GGIWMH 1'
4314 libs_mplayer="$libs_mplayer -lggiwmh"
4315 else
4316 _ggiwmh=no
4317 def_ggiwmh='#undef CONFIG_GGIWMH'
4319 echores "$_ggiwmh"
4322 echocheck "AA"
4323 if test "$_aa" = auto ; then
4324 cat > $TMPC << EOF
4325 #include <aalib.h>
4326 int main(void) {
4327 aa_context *c;
4328 aa_renderparams *p;
4329 aa_init(0, 0, 0);
4330 c = aa_autoinit(&aa_defparams);
4331 p = aa_getrenderparams();
4332 aa_autoinitkbd(c, 0);
4333 return 0; }
4335 _aa=no
4336 for _ld_tmp in "-laa" ; do
4337 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4338 done
4340 if test "$_aa" = yes ; then
4341 def_aa='#define CONFIG_AA 1'
4342 if cygwin ; then
4343 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4345 vomodules="aa $vomodules"
4346 else
4347 def_aa='#undef CONFIG_AA'
4348 novomodules="aa $novomodules"
4350 echores "$_aa"
4353 echocheck "CACA"
4354 if test "$_caca" = auto ; then
4355 _caca=no
4356 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4357 cat > $TMPC << EOF
4358 #include <caca.h>
4359 #ifdef CACA_API_VERSION_1
4360 #include <caca0.h>
4361 #endif
4362 int main(void) { caca_init(); return 0; }
4364 cc_check $(caca-config --libs) && _caca=yes
4367 if test "$_caca" = yes ; then
4368 def_caca='#define CONFIG_CACA 1'
4369 extra_cflags="$extra_cflags $(caca-config --cflags)"
4370 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4371 vomodules="caca $vomodules"
4372 else
4373 def_caca='#undef CONFIG_CACA'
4374 novomodules="caca $novomodules"
4376 echores "$_caca"
4379 echocheck "SVGAlib"
4380 if test "$_svga" = auto ; then
4381 _svga=no
4382 header_check vga.h -lvga $_ld_lm && _svga=yes
4384 if test "$_svga" = yes ; then
4385 def_svga='#define CONFIG_SVGALIB 1'
4386 libs_mplayer="$libs_mplayer -lvga"
4387 vomodules="svga $vomodules"
4388 else
4389 def_svga='#undef CONFIG_SVGALIB'
4390 novomodules="svga $novomodules"
4392 echores "$_svga"
4395 echocheck "FBDev"
4396 if test "$_fbdev" = auto ; then
4397 _fbdev=no
4398 linux && _fbdev=yes
4400 if test "$_fbdev" = yes ; then
4401 def_fbdev='#define CONFIG_FBDEV 1'
4402 vomodules="fbdev $vomodules"
4403 else
4404 def_fbdev='#undef CONFIG_FBDEV'
4405 novomodules="fbdev $novomodules"
4407 echores "$_fbdev"
4411 echocheck "DVB"
4412 if test "$_dvb" = auto ; then
4413 _dvb=no
4414 cat >$TMPC << EOF
4415 #include <poll.h>
4416 #include <sys/ioctl.h>
4417 #include <stdio.h>
4418 #include <time.h>
4419 #include <unistd.h>
4420 #include <linux/dvb/dmx.h>
4421 #include <linux/dvb/frontend.h>
4422 #include <linux/dvb/video.h>
4423 #include <linux/dvb/audio.h>
4424 int main(void) {return 0;}
4426 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4427 cc_check $_inc_tmp && _dvb=yes && \
4428 extra_cflags="$extra_cflags $_inc_tmp" && break
4429 done
4431 echores "$_dvb"
4432 if test "$_dvb" = yes ; then
4433 _dvbin=yes
4434 inputmodules="dvb $inputmodules"
4435 def_dvb='#define CONFIG_DVB 1'
4436 def_dvbin='#define CONFIG_DVBIN 1'
4437 aomodules="mpegpes(dvb) $aomodules"
4438 vomodules="mpegpes(dvb) $vomodules"
4439 else
4440 _dvbin=no
4441 noinputmodules="dvb $noinputmodules"
4442 def_dvb='#undef CONFIG_DVB'
4443 def_dvbin='#undef CONFIG_DVBIN '
4444 aomodules="mpegpes(file) $aomodules"
4445 vomodules="mpegpes(file) $vomodules"
4449 if darwin; then
4451 echocheck "QuickTime"
4452 if test "$quicktime" = auto ; then
4453 cat > $TMPC <<EOF
4454 #include <QuickTime/QuickTime.h>
4455 int main(void) {
4456 ImageDescription *desc;
4457 EnterMovies();
4458 ExitMovies();
4459 return 0;
4462 quicktime=no
4463 cc_check -framework QuickTime && quicktime=yes
4465 if test "$quicktime" = yes ; then
4466 extra_ldflags="$extra_ldflags -framework QuickTime"
4467 def_quicktime='#define CONFIG_QUICKTIME 1'
4468 else
4469 def_quicktime='#undef CONFIG_QUICKTIME'
4470 _quartz=no
4472 echores $quicktime
4474 echocheck "Quartz"
4475 if test "$_quartz" = auto ; then
4476 _quartz=no
4477 statement_check Carbon/Carbon.h 'CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false)' -framework Carbon && _quartz=yes
4479 if test "$_quartz" = yes ; then
4480 libs_mplayer="$libs_mplayer -framework Carbon"
4481 def_quartz='#define CONFIG_QUARTZ 1'
4482 vomodules="quartz $vomodules"
4483 else
4484 def_quartz='#undef CONFIG_QUARTZ'
4485 novomodules="quartz $novomodules"
4487 echores $_quartz
4489 echocheck "CoreVideo"
4490 if test "$_corevideo" = auto ; then
4491 cat > $TMPC <<EOF
4492 #include <Carbon/Carbon.h>
4493 #include <CoreServices/CoreServices.h>
4494 #include <OpenGL/OpenGL.h>
4495 #include <QuartzCore/CoreVideo.h>
4496 int main(void) { return 0; }
4498 _corevideo=no
4499 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4501 if test "$_corevideo" = yes ; then
4502 vomodules="corevideo $vomodules"
4503 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4504 def_corevideo='#define CONFIG_COREVIDEO 1'
4505 else
4506 novomodules="corevideo $novomodules"
4507 def_corevideo='#undef CONFIG_COREVIDEO'
4509 echores "$_corevideo"
4511 fi #if darwin
4514 echocheck "PNG support"
4515 if test "$_png" = auto ; then
4516 _png=no
4517 if irix ; then
4518 # Don't check for -lpng on irix since it has its own libpng
4519 # incompatible with the GNU libpng
4520 res_comment="disabled on irix (not GNU libpng)"
4521 else
4522 cat > $TMPC << EOF
4523 #include <stdio.h>
4524 #include <string.h>
4525 #include <png.h>
4526 int main(void) {
4527 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4528 printf("libpng: %s\n", png_libpng_ver);
4529 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4532 cc_check -lpng -lz $_ld_lm && _png=yes
4535 echores "$_png"
4536 if test "$_png" = yes ; then
4537 def_png='#define CONFIG_PNG 1'
4538 extra_ldflags="$extra_ldflags -lpng -lz"
4539 else
4540 def_png='#undef CONFIG_PNG'
4543 echocheck "MNG support"
4544 if test "$_mng" = auto ; then
4545 _mng=no
4546 cat > $TMPC << EOF
4547 #include <libmng.h>
4548 int main(void) {
4549 const char * p_ver = mng_version_text();
4550 return !p_ver || p_ver[0] == 0;
4553 if cc_check -lmng -lz $_ld_lm ; then
4554 _mng=yes
4557 echores "$_mng"
4558 if test "$_mng" = yes ; then
4559 def_mng='#define CONFIG_MNG 1'
4560 extra_ldflags="$extra_ldflags -lmng -lz"
4561 else
4562 def_mng='#undef CONFIG_MNG'
4565 echocheck "JPEG support"
4566 if test "$_jpeg" = auto ; then
4567 _jpeg=no
4568 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
4570 echores "$_jpeg"
4572 if test "$_jpeg" = yes ; then
4573 def_jpeg='#define CONFIG_JPEG 1'
4574 vomodules="jpeg $vomodules"
4575 extra_ldflags="$extra_ldflags -ljpeg"
4576 else
4577 def_jpeg='#undef CONFIG_JPEG'
4578 novomodules="jpeg $novomodules"
4583 echocheck "PNM support"
4584 if test "$_pnm" = yes; then
4585 def_pnm="#define CONFIG_PNM 1"
4586 vomodules="pnm $vomodules"
4587 else
4588 def_pnm="#undef CONFIG_PNM"
4589 novomodules="pnm $novomodules"
4591 echores "$_pnm"
4595 echocheck "GIF support"
4596 # This is to appease people who want to force gif support.
4597 # If it is forced to yes, then we still do checks to determine
4598 # which gif library to use.
4599 if test "$_gif" = yes ; then
4600 _force_gif=yes
4601 _gif=auto
4604 if test "$_gif" = auto ; then
4605 _gif=no
4606 for _ld_gif in "-lungif" "-lgif" ; do
4607 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4608 done
4611 # If no library was found, and the user wants support forced,
4612 # then we force it on with libgif, as this is the safest
4613 # assumption IMHO. (libungif & libregif both create symbolic
4614 # links to libgif. We also assume that no x11 support is needed,
4615 # because if you are forcing this, then you _should_ know what
4616 # you are doing. [ Besides, package maintainers should never
4617 # have compiled x11 deps into libungif in the first place. ] )
4618 # </rant>
4619 # --Joey
4620 if test "$_force_gif" = yes && test "$_gif" = no ; then
4621 _gif=yes
4622 _ld_gif="-lgif"
4625 if test "$_gif" = yes ; then
4626 def_gif='#define CONFIG_GIF 1'
4627 codecmodules="gif $codecmodules"
4628 vomodules="gif89a $vomodules"
4629 res_comment="old version, some encoding functions disabled"
4630 def_gif_4='#undef CONFIG_GIF_4'
4631 extra_ldflags="$extra_ldflags $_ld_gif"
4633 cat > $TMPC << EOF
4634 #include <signal.h>
4635 #include <stdio.h>
4636 #include <stdlib.h>
4637 #include <gif_lib.h>
4638 static void catch(int sig) { exit(1); }
4639 int main(void) {
4640 signal(SIGSEGV, catch); // catch segfault
4641 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4642 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4643 return 0;
4646 if cc_check "$_ld_gif" ; then
4647 def_gif_4='#define CONFIG_GIF_4 1'
4648 res_comment=""
4650 else
4651 def_gif='#undef CONFIG_GIF'
4652 def_gif_4='#undef CONFIG_GIF_4'
4653 novomodules="gif89a $novomodules"
4654 nocodecmodules="gif $nocodecmodules"
4656 echores "$_gif"
4659 case "$_gif" in yes*)
4660 echocheck "broken giflib workaround"
4661 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4663 cat > $TMPC << EOF
4664 #include <stdio.h>
4665 #include <gif_lib.h>
4666 int main(void) {
4667 GifFileType gif = {.UserData = NULL};
4668 printf("UserData is at address %p\n", gif.UserData);
4669 return 0;
4672 if cc_check "$_ld_gif" ; then
4673 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4674 echores "disabled"
4675 else
4676 echores "enabled"
4679 esac
4682 echocheck "VESA support"
4683 if test "$_vesa" = auto ; then
4684 _vesa=no
4685 statement_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4687 if test "$_vesa" = yes ; then
4688 def_vesa='#define CONFIG_VESA 1'
4689 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4690 vomodules="vesa $vomodules"
4691 else
4692 def_vesa='#undef CONFIG_VESA'
4693 novomodules="vesa $novomodules"
4695 echores "$_vesa"
4697 #################
4698 # VIDEO + AUDIO #
4699 #################
4702 echocheck "SDL"
4703 _inc_tmp=""
4704 _ld_tmp=""
4705 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4706 if test -z "$_sdlconfig" ; then
4707 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4708 _sdlconfig="sdl-config"
4709 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4710 _sdlconfig="sdl11-config"
4711 else
4712 _sdlconfig=false
4715 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4716 cat > $TMPC << EOF
4717 #ifdef CONFIG_SDL_SDL_H
4718 #include <SDL/SDL.h>
4719 #else
4720 #include <SDL.h>
4721 #endif
4722 #ifndef __APPLE__
4723 // we allow SDL hacking our main() only on OSX
4724 #undef main
4725 #endif
4726 int main(int argc, char *argv[]) {
4727 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4728 return 0;
4731 _sdl=no
4732 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4733 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4734 _sdl=yes
4735 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4736 break
4738 done
4739 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4740 res_comment="using $_sdlconfig"
4741 if cygwin ; then
4742 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4743 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4744 elif mingw32 ; then
4745 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4746 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4747 else
4748 _inc_tmp="$($_sdlconfig --cflags)"
4749 _ld_tmp="$($_sdlconfig --libs)"
4751 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4752 _sdl=yes
4753 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4754 # HACK for BeOS/Haiku SDL
4755 _ld_tmp="$_ld_tmp -lstdc++"
4756 _sdl=yes
4760 if test "$_sdl" = yes ; then
4761 def_sdl='#define CONFIG_SDL 1'
4762 extra_cflags="$extra_cflags $_inc_tmp"
4763 libs_mplayer="$libs_mplayer $_ld_tmp"
4764 vomodules="sdl $vomodules"
4765 aomodules="sdl $aomodules"
4766 else
4767 def_sdl='#undef CONFIG_SDL'
4768 novomodules="sdl $novomodules"
4769 noaomodules="sdl $noaomodules"
4771 echores "$_sdl"
4774 # make sure this stays below CoreVideo to avoid issues due to namespace
4775 # conflicts between -lGL and -framework OpenGL
4776 echocheck "OpenGL"
4777 #Note: this test is run even with --enable-gl since we autodetect linker flags
4778 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
4779 cat > $TMPC << EOF
4780 #ifdef GL_WIN32
4781 #include <windows.h>
4782 #include <GL/gl.h>
4783 #elif defined(GL_SDL)
4784 #include <GL/gl.h>
4785 #ifdef CONFIG_SDL_SDL_H
4786 #include <SDL/SDL.h>
4787 #else
4788 #include <SDL.h>
4789 #endif
4790 #ifndef __APPLE__
4791 // we allow SDL hacking our main() only on OSX
4792 #undef main
4793 #endif
4794 #else
4795 #include <GL/gl.h>
4796 #include <X11/Xlib.h>
4797 #include <GL/glx.h>
4798 #endif
4799 int main(int argc, char *argv[]) {
4800 #ifdef GL_WIN32
4801 HDC dc;
4802 wglCreateContext(dc);
4803 #elif defined(GL_SDL)
4804 SDL_GL_SwapBuffers();
4805 #else
4806 glXCreateContext(NULL, NULL, NULL, True);
4807 #endif
4808 glFinish();
4809 return 0;
4812 _gl=no
4813 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4814 if cc_check $_ld_tmp $_ld_lm ; then
4815 _gl=yes
4816 _gl_x11=yes
4817 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4818 break
4820 done
4821 if cc_check -DGL_WIN32 -lopengl32 ; then
4822 _gl=yes
4823 _gl_win32=yes
4824 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4826 # last so it can reuse any linker etc. flags detected before
4827 if test "$_sdl" = yes ; then
4828 if cc_check -DGL_SDL ||
4829 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4830 _gl=yes
4831 _gl_sdl=yes
4832 elif cc_check -DGL_SDL -lGL ||
4833 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4834 _gl=yes
4835 _gl_sdl=yes
4836 libs_mplayer="$libs_mplayer -lGL"
4839 else
4840 _gl=no
4842 if test "$_gl" = yes ; then
4843 def_gl='#define CONFIG_GL 1'
4844 res_comment="backends:"
4845 if test "$_gl_win32" = yes ; then
4846 def_gl_win32='#define CONFIG_GL_WIN32 1'
4847 res_comment="$res_comment win32"
4849 if test "$_gl_x11" = yes ; then
4850 def_gl_x11='#define CONFIG_GL_X11 1'
4851 res_comment="$res_comment x11"
4853 if test "$_gl_sdl" = yes ; then
4854 def_gl_sdl='#define CONFIG_GL_SDL 1'
4855 res_comment="$res_comment sdl"
4857 vomodules="opengl $vomodules"
4858 else
4859 def_gl='#undef CONFIG_GL'
4860 def_gl_win32='#undef CONFIG_GL_WIN32'
4861 def_gl_x11='#undef CONFIG_GL_X11'
4862 def_gl_sdl='#undef CONFIG_GL_SDL'
4863 novomodules="opengl $novomodules"
4865 echores "$_gl"
4868 echocheck "MatrixView"
4869 if test "$_gl" = no ; then
4870 matrixview=no
4872 if test "$matrixview" = yes ; then
4873 vomodules="matrixview $vomodules"
4874 def_matrixview='#define CONFIG_MATRIXVIEW 1'
4875 else
4876 novomodules="matrixview $novomodules"
4877 def_matrixview='#undef CONFIG_MATRIXVIEW'
4879 echores "$matrixview"
4882 if os2 ; then
4883 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
4884 if test "$_kva" = auto; then
4885 _kva=no;
4886 header_check_broken os2.h kva.h -lkva && _kva=yes
4888 if test "$_kva" = yes ; then
4889 def_kva='#define CONFIG_KVA 1'
4890 libs_mplayer="$libs_mplayer -lkva"
4891 vomodules="kva $vomodules"
4892 else
4893 def_kva='#undef CONFIG_KVA'
4894 novomodules="kva $novomodules"
4896 echores "$_kva"
4897 fi #if os2
4900 if win32; then
4902 echocheck "Windows waveout"
4903 if test "$_win32waveout" = auto ; then
4904 _win32waveout=no
4905 header_check_broken windows.h mmsystem.h -lwinmm && _win32waveout=yes
4907 if test "$_win32waveout" = yes ; then
4908 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4909 libs_mplayer="$libs_mplayer -lwinmm"
4910 aomodules="win32 $aomodules"
4911 else
4912 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4913 noaomodules="win32 $noaomodules"
4915 echores "$_win32waveout"
4917 echocheck "Direct3D"
4918 if test "$_direct3d" = auto ; then
4919 _direct3d=no
4920 header_check d3d9.h && _direct3d=yes
4922 if test "$_direct3d" = yes ; then
4923 def_direct3d='#define CONFIG_DIRECT3D 1'
4924 vomodules="direct3d $vomodules"
4925 else
4926 def_direct3d='#undef CONFIG_DIRECT3D'
4927 novomodules="direct3d $novomodules"
4929 echores "$_direct3d"
4931 echocheck "Directx"
4932 if test "$_directx" = auto ; then
4933 cat > $TMPC << EOF
4934 #include <ddraw.h>
4935 #include <dsound.h>
4936 int main(void) { return 0; }
4938 _directx=no
4939 cc_check -lgdi32 && _directx=yes
4941 if test "$_directx" = yes ; then
4942 def_directx='#define CONFIG_DIRECTX 1'
4943 libs_mplayer="$libs_mplayer -lgdi32"
4944 vomodules="directx $vomodules"
4945 aomodules="dsound $aomodules"
4946 else
4947 def_directx='#undef CONFIG_DIRECTX'
4948 novomodules="directx $novomodules"
4949 noaomodules="dsound $noaomodules"
4951 echores "$_directx"
4953 fi #if win32; then
4956 echocheck "DXR2"
4957 if test "$_dxr2" = auto; then
4958 _dxr2=no
4959 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4960 header_check dxr2ioctl.h $_inc_tmp && _dxr2=yes &&
4961 extra_cflags="$extra_cflags $_inc_tmp" && break
4962 done
4964 if test "$_dxr2" = yes; then
4965 def_dxr2='#define CONFIG_DXR2 1'
4966 aomodules="dxr2 $aomodules"
4967 vomodules="dxr2 $vomodules"
4968 else
4969 def_dxr2='#undef CONFIG_DXR2'
4970 noaomodules="dxr2 $noaomodules"
4971 novomodules="dxr2 $novomodules"
4973 echores "$_dxr2"
4975 echocheck "DXR3/H+"
4976 if test "$_dxr3" = auto ; then
4977 _dxr3=no
4978 header_check linux/em8300.h && _dxr3=yes
4980 if test "$_dxr3" = yes ; then
4981 def_dxr3='#define CONFIG_DXR3 1'
4982 vomodules="dxr3 $vomodules"
4983 else
4984 def_dxr3='#undef CONFIG_DXR3'
4985 novomodules="dxr3 $novomodules"
4987 echores "$_dxr3"
4990 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4991 if test "$_ivtv" = auto ; then
4992 cat > $TMPC << EOF
4993 #include <linux/videodev2.h>
4994 #include <linux/ivtv.h>
4995 #include <sys/ioctl.h>
4996 int main(void) {
4997 struct ivtv_cfg_stop_decode sd;
4998 struct ivtv_cfg_start_decode sd1;
4999 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5000 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5001 return 0; }
5003 _ivtv=no
5004 cc_check && _ivtv=yes
5006 if test "$_ivtv" = yes ; then
5007 def_ivtv='#define CONFIG_IVTV 1'
5008 vomodules="ivtv $vomodules"
5009 aomodules="ivtv $aomodules"
5010 else
5011 def_ivtv='#undef CONFIG_IVTV'
5012 novomodules="ivtv $novomodules"
5013 noaomodules="ivtv $noaomodules"
5015 echores "$_ivtv"
5018 echocheck "V4L2 MPEG Decoder"
5019 if test "$_v4l2" = auto ; then
5020 cat > $TMPC << EOF
5021 #include <linux/videodev2.h>
5022 #include <linux/version.h>
5023 int main(void) {
5024 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5025 #error kernel headers too old, need 2.6.22
5026 #endif
5027 struct v4l2_ext_controls ctrls;
5028 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5029 return 0;
5032 _v4l2=no
5033 cc_check && _v4l2=yes
5035 if test "$_v4l2" = yes ; then
5036 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5037 vomodules="v4l2 $vomodules"
5038 aomodules="v4l2 $aomodules"
5039 else
5040 def_v4l2='#undef CONFIG_V4L2_DECODER'
5041 novomodules="v4l2 $novomodules"
5042 noaomodules="v4l2 $noaomodules"
5044 echores "$_v4l2"
5048 #########
5049 # AUDIO #
5050 #########
5053 echocheck "OSS Audio"
5054 if test "$_ossaudio" = auto ; then
5055 cat > $TMPC << EOF
5056 #include <$_soundcard_header>
5057 int main(void) { return SNDCTL_DSP_SETFRAGMENT; }
5059 _ossaudio=no
5060 cc_check && _ossaudio=yes
5062 if test "$_ossaudio" = yes ; then
5063 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5064 aomodules="oss $aomodules"
5065 cat > $TMPC << EOF
5066 #include <$_soundcard_header>
5067 #ifdef OPEN_SOUND_SYSTEM
5068 int main(void) { return 0; }
5069 #else
5070 #error Not the real thing
5071 #endif
5073 _real_ossaudio=no
5074 cc_check && _real_ossaudio=yes
5075 if test "$_real_ossaudio" = yes; then
5076 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5077 # Check for OSS4 headers (override default headers)
5078 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
5079 if test -f /etc/oss.conf; then
5080 . /etc/oss.conf
5081 _ossinc="$OSSLIBDIR/include"
5082 if test -f "$_ossinc/sys/soundcard.h"; then
5083 extra_cflags="-I$_ossinc $extra_cflags"
5086 elif netbsd || openbsd ; then
5087 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5088 extra_ldflags="$extra_ldflags -lossaudio"
5089 else
5090 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5092 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5093 else
5094 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5095 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5096 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5097 noaomodules="oss $noaomodules"
5099 echores "$_ossaudio"
5102 echocheck "aRts"
5103 if test "$_arts" = auto ; then
5104 _arts=no
5105 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5106 statement_check artsc.h 'arts_init()' $(artsc-config --libs) $(artsc-config --cflags) &&
5107 _arts=yes
5111 if test "$_arts" = yes ; then
5112 def_arts='#define CONFIG_ARTS 1'
5113 aomodules="arts $aomodules"
5114 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5115 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5116 else
5117 noaomodules="arts $noaomodules"
5119 echores "$_arts"
5122 echocheck "EsounD"
5123 if test "$_esd" = auto ; then
5124 _esd=no
5125 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5126 statement_check esd.h 'esd_open_sound("test")' $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5129 echores "$_esd"
5131 if test "$_esd" = yes ; then
5132 def_esd='#define CONFIG_ESD 1'
5133 aomodules="esd $aomodules"
5134 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5135 extra_cflags="$extra_cflags $(esd-config --cflags)"
5137 echocheck "esd_get_latency()"
5138 statement_check esd.h 'esd_get_latency(0)' $(esd-config --libs) $(esd-config --cflags) &&
5139 _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5140 echores "$_esd_latency"
5141 else
5142 def_esd='#undef CONFIG_ESD'
5143 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5144 noaomodules="esd $noaomodules"
5148 echocheck "NAS"
5149 if test "$_nas" = auto ; then
5150 _nas=no
5151 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
5153 if test "$_nas" = yes ; then
5154 def_nas='#define CONFIG_NAS 1'
5155 libs_mplayer="$libs_mplayer -laudio -lXt"
5156 aomodules="nas $aomodules"
5157 else
5158 noaomodules="nas $noaomodules"
5159 def_nas='#undef CONFIG_NAS'
5161 echores "$_nas"
5164 echocheck "pulse"
5165 if test "$_pulse" = auto ; then
5166 _pulse=no
5167 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5168 header_check pulse/pulseaudio.h $($_pkg_config --libs --cflags libpulse) &&
5169 _pulse=yes
5172 echores "$_pulse"
5174 if test "$_pulse" = yes ; then
5175 def_pulse='#define CONFIG_PULSE 1'
5176 aomodules="pulse $aomodules"
5177 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5178 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5179 else
5180 def_pulse='#undef CONFIG_PULSE'
5181 noaomodules="pulse $noaomodules"
5185 echocheck "JACK"
5186 if test "$_jack" = auto ; then
5187 _jack=yes
5188 if statement_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' -ljack ; then
5189 libs_mplayer="$libs_mplayer -ljack"
5190 elif statement_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' $($_pkg_config --libs --cflags --silence-errors jack) ; then
5191 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5192 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5193 else
5194 _jack=no
5198 if test "$_jack" = yes ; then
5199 def_jack='#define CONFIG_JACK 1'
5200 aomodules="jack $aomodules"
5201 else
5202 noaomodules="jack $noaomodules"
5204 echores "$_jack"
5206 echocheck "OpenAL"
5207 if test "$_openal" = auto ; then
5208 _openal=no
5209 cat > $TMPC << EOF
5210 #ifdef OPENAL_AL_H
5211 #include <OpenAL/al.h>
5212 #else
5213 #include <AL/al.h>
5214 #endif
5215 int main(void) {
5216 alSourceQueueBuffers(0, 0, 0);
5217 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5218 return 0;
5221 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5222 cc_check $I && _openal=yes && break
5223 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5224 done
5225 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5227 if test "$_openal" = yes ; then
5228 def_openal='#define CONFIG_OPENAL 1'
5229 aomodules="openal $aomodules"
5230 else
5231 noaomodules="openal $noaomodules"
5233 echores "$_openal"
5235 echocheck "ALSA audio"
5236 if test "$_alloca" != yes ; then
5237 _alsa=no
5238 res_comment="alloca missing"
5240 if test "$_alsa" != no ; then
5241 _alsa=no
5242 cat > $TMPC << EOF
5243 #include <sys/asoundlib.h>
5244 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5245 #error "alsa version != 0.5.x"
5246 #endif
5247 int main(void) { return 0; }
5249 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5251 cat > $TMPC << EOF
5252 #include <sys/asoundlib.h>
5253 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5254 #error "alsa version != 0.9.x"
5255 #endif
5256 int main(void) { return 0; }
5258 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5259 cat > $TMPC << EOF
5260 #include <alsa/asoundlib.h>
5261 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5262 #error "alsa version != 0.9.x"
5263 #endif
5264 int main(void) { return 0; }
5266 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5268 cat > $TMPC << EOF
5269 #include <sys/asoundlib.h>
5270 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5271 #error "alsa version != 1.0.x"
5272 #endif
5273 int main(void) { return 0; }
5275 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5276 cat > $TMPC << EOF
5277 #include <alsa/asoundlib.h>
5278 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5279 #error "alsa version != 1.0.x"
5280 #endif
5281 int main(void) { return 0; }
5283 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5285 def_alsa='#undef CONFIG_ALSA'
5286 def_alsa5='#undef CONFIG_ALSA5'
5287 def_alsa9='#undef CONFIG_ALSA9'
5288 def_alsa1x='#undef CONFIG_ALSA1X'
5289 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5290 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5291 if test "$_alsaver" ; then
5292 _alsa=yes
5293 if test "$_alsaver" = '0.5.x' ; then
5294 _alsa5=yes
5295 aomodules="alsa5 $aomodules"
5296 def_alsa5='#define CONFIG_ALSA5 1'
5297 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5298 res_comment="using alsa 0.5.x and sys/asoundlib.h"
5299 elif test "$_alsaver" = '0.9.x-sys' ; then
5300 _alsa9=yes
5301 aomodules="alsa $aomodules"
5302 def_alsa='#define CONFIG_ALSA 1'
5303 def_alsa9='#define CONFIG_ALSA9 1'
5304 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5305 res_comment="using alsa 0.9.x and sys/asoundlib.h"
5306 elif test "$_alsaver" = '0.9.x-alsa' ; then
5307 _alsa9=yes
5308 aomodules="alsa $aomodules"
5309 def_alsa='#define CONFIG_ALSA 1'
5310 def_alsa9='#define CONFIG_ALSA9 1'
5311 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5312 res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5313 elif test "$_alsaver" = '1.0.x-sys' ; then
5314 _alsa1x=yes
5315 aomodules="alsa $aomodules"
5316 def_alsa='#define CONFIG_ALSA 1'
5317 def_alsa1x="#define CONFIG_ALSA1X 1"
5318 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5319 res_comment="using alsa 1.0.x and sys/asoundlib.h"
5320 elif test "$_alsaver" = '1.0.x-alsa' ; then
5321 _alsa1x=yes
5322 aomodules="alsa $aomodules"
5323 def_alsa='#define CONFIG_ALSA 1'
5324 def_alsa1x="#define CONFIG_ALSA1X 1"
5325 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5326 res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5327 else
5328 _alsa=no
5329 res_comment="unknown version"
5331 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5332 else
5333 noaomodules="alsa $noaomodules"
5335 echores "$_alsa"
5338 echocheck "Sun audio"
5339 if test "$_sunaudio" = auto ; then
5340 cat > $TMPC << EOF
5341 #include <sys/types.h>
5342 #include <sys/audioio.h>
5343 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5345 _sunaudio=no
5346 cc_check && _sunaudio=yes
5348 if test "$_sunaudio" = yes ; then
5349 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5350 aomodules="sun $aomodules"
5351 else
5352 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5353 noaomodules="sun $noaomodules"
5355 echores "$_sunaudio"
5358 def_mlib='#define CONFIG_MLIB 0'
5359 if sunos; then
5360 echocheck "Sun mediaLib"
5361 if test "$_mlib" = auto ; then
5362 _mlib=no
5363 cc_check mlib.h "mlib_VideoColorYUV2ABGR420(0, 0, 0, 0, 0, 0, 0, 0, 0)" -lmlib &&
5364 _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5366 echores "$_mlib"
5367 fi #if sunos
5370 if darwin; then
5371 echocheck "CoreAudio"
5372 if test "$_coreaudio" = auto ; then
5373 cat > $TMPC <<EOF
5374 #include <CoreAudio/CoreAudio.h>
5375 #include <AudioToolbox/AudioToolbox.h>
5376 #include <AudioUnit/AudioUnit.h>
5377 int main(void) { return 0; }
5379 _coreaudio=no
5380 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5382 if test "$_coreaudio" = yes ; then
5383 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5384 def_coreaudio='#define CONFIG_COREAUDIO 1'
5385 aomodules="coreaudio $aomodules"
5386 else
5387 def_coreaudio='#undef CONFIG_COREAUDIO'
5388 noaomodules="coreaudio $noaomodules"
5390 echores $_coreaudio
5391 fi #if darwin
5394 if irix; then
5395 echocheck "SGI audio"
5396 if test "$_sgiaudio" = auto ; then
5397 _sgiaudio=no
5398 header_check dmedia/audio.h && _sgiaudio=yes
5400 if test "$_sgiaudio" = "yes" ; then
5401 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5402 libs_mplayer="$libs_mplayer -laudio"
5403 aomodules="sgi $aomodules"
5404 else
5405 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5406 noaomodules="sgi $noaomodules"
5408 echores "$_sgiaudio"
5409 fi #if irix
5412 if os2 ; then
5413 echocheck "KAI (UNIAUD/DART)"
5414 if test "$_kai" = auto; then
5415 _kai=no;
5416 header_check_broken os2.h kai.h -lkai && _kai=yes
5418 if test "$_kai" = yes ; then
5419 def_kai='#define CONFIG_KAI 1'
5420 libs_mplayer="$libs_mplayer -lkai"
5421 aomodules="kai $aomodules"
5422 else
5423 def_kai='#undef CONFIG_KAI'
5424 noaomodules="kai $noaomodules"
5426 echores "$_kai"
5428 echocheck "DART"
5429 if test "$_dart" = auto; then
5430 _dart=no;
5431 header_check_broken os2.h dart.h -ldart && _dart=yes
5433 if test "$_dart" = yes ; then
5434 def_dart='#define CONFIG_DART 1'
5435 libs_mplayer="$libs_mplayer -ldart"
5436 aomodules="dart $aomodules"
5437 else
5438 def_dart='#undef CONFIG_DART'
5439 noaomodules="dart $noaomodules"
5441 echores "$_dart"
5442 fi #if os2
5445 # set default CD/DVD devices
5446 if win32 || os2 ; then
5447 default_cdrom_device="D:"
5448 elif darwin ; then
5449 default_cdrom_device="/dev/disk1"
5450 elif dragonfly ; then
5451 default_cdrom_device="/dev/cd0"
5452 elif freebsd ; then
5453 default_cdrom_device="/dev/acd0"
5454 elif openbsd ; then
5455 default_cdrom_device="/dev/rcd0c"
5456 elif sunos ; then
5457 default_cdrom_device="/vol/dev/aliases/cdrom0"
5458 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5459 # file system and the volfs service.
5460 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5461 elif amigaos ; then
5462 default_cdrom_device="a1ide.device:2"
5463 else
5464 default_cdrom_device="/dev/cdrom"
5467 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5468 default_dvd_device=$default_cdrom_device
5469 elif darwin ; then
5470 default_dvd_device="/dev/rdiskN"
5471 else
5472 default_dvd_device="/dev/dvd"
5476 echocheck "VCD support"
5477 if test "$_vcd" = auto; then
5478 _vcd=no
5479 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
5480 _vcd=yes
5481 elif mingw32; then
5482 header_check ddk/ntddcdrm.h && _vcd=yes
5485 if test "$_vcd" = yes; then
5486 inputmodules="vcd $inputmodules"
5487 def_vcd='#define CONFIG_VCD 1'
5488 else
5489 def_vcd='#undef CONFIG_VCD'
5490 noinputmodules="vcd $noinputmodules"
5491 res_comment="not supported on this OS"
5493 echores "$_vcd"
5497 echocheck "Blu-ray support"
5498 if test "$_bluray" = auto ; then
5499 _bluray=no
5500 statement_check libbluray/bluray.h 'bd_get_title_info(0, 0)' -lbluray && _bluray=yes
5502 if test "$_bluray" = yes ; then
5503 def_bluray='#define CONFIG_LIBBLURAY 1'
5504 extra_ldflags="$extra_ldflags -lbluray"
5505 inputmodules="bluray $inputmodules"
5506 else
5507 def_bluray='#undef CONFIG_LIBBLURAY'
5508 noinputmodules="bluray $noinputmodules"
5510 echores "$_bluray"
5512 echocheck "dvdread"
5513 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5514 _dvdread_internal=no
5516 if test "$_dvdread_internal" = auto ; then
5517 _dvdread_internal=no
5518 _dvdread=no
5519 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5520 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5521 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5522 || darwin || win32 || os2; then
5523 _dvdread_internal=yes
5524 _dvdread=yes
5525 extra_cflags="-Ilibdvdread4 $extra_cflags"
5527 elif test "$_dvdread" = auto ; then
5528 _dvdread=no
5529 if test "$_dl" = yes; then
5530 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5531 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5532 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5533 _dvdread=yes
5534 extra_cflags="$extra_cflags $_dvdreadcflags"
5535 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5536 res_comment="external"
5541 if test "$_dvdread_internal" = yes; then
5542 def_dvdread='#define CONFIG_DVDREAD 1'
5543 inputmodules="dvdread(internal) $inputmodules"
5544 _largefiles=yes
5545 res_comment="internal"
5546 elif test "$_dvdread" = yes; then
5547 def_dvdread='#define CONFIG_DVDREAD 1'
5548 _largefiles=yes
5549 extra_ldflags="$extra_ldflags -ldvdread"
5550 inputmodules="dvdread(external) $inputmodules"
5551 res_comment="external"
5552 else
5553 def_dvdread='#undef CONFIG_DVDREAD'
5554 noinputmodules="dvdread $noinputmodules"
5556 echores "$_dvdread"
5559 echocheck "internal libdvdcss"
5560 if test "$_libdvdcss_internal" = auto ; then
5561 _libdvdcss_internal=no
5562 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
5563 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5565 if test "$_libdvdcss_internal" = yes ; then
5566 if linux || netbsd || openbsd || bsdos ; then
5567 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5568 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5569 elif freebsd || dragonfly ; then
5570 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5571 elif darwin ; then
5572 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5573 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5574 elif cygwin ; then
5575 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5576 elif beos ; then
5577 cflags_libdvdcss="-DSYS_BEOS"
5578 elif os2 ; then
5579 cflags_libdvdcss="-DSYS_OS2"
5581 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5582 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5583 inputmodules="libdvdcss(internal) $inputmodules"
5584 _largefiles=yes
5585 else
5586 noinputmodules="libdvdcss(internal) $noinputmodules"
5588 echores "$_libdvdcss_internal"
5591 echocheck "cdparanoia"
5592 if test "$_cdparanoia" = auto ; then
5593 cat > $TMPC <<EOF
5594 #include <cdda_interface.h>
5595 #include <cdda_paranoia.h>
5596 // This need a better test. How ?
5597 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5599 _cdparanoia=no
5600 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5601 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5602 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5603 done
5605 if test "$_cdparanoia" = yes ; then
5606 _cdda='yes'
5607 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5608 openbsd && extra_ldflags="$extra_ldflags -lutil"
5610 echores "$_cdparanoia"
5613 echocheck "libcdio"
5614 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5615 cat > $TMPC << EOF
5616 #include <stdio.h>
5617 #include <cdio/version.h>
5618 #include <cdio/cdda.h>
5619 #include <cdio/paranoia.h>
5620 int main(void) {
5621 void *test = cdda_verbose_set;
5622 printf("%s\n", CDIO_VERSION);
5623 return test == (void *)1;
5626 _libcdio=no
5627 for _ld_tmp in "" "-lwinmm" ; do
5628 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5629 cc_check $_ld_tmp $_ld_lm \
5630 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5631 done
5632 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5633 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
5634 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
5635 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5636 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5639 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5640 _cdda='yes'
5641 def_libcdio='#define CONFIG_LIBCDIO 1'
5642 def_havelibcdio='yes'
5643 else
5644 if test "$_cdparanoia" = yes ; then
5645 res_comment="using cdparanoia"
5647 def_libcdio='#undef CONFIG_LIBCDIO'
5648 def_havelibcdio='no'
5650 echores "$_libcdio"
5652 if test "$_cdda" = yes ; then
5653 test $_cddb = auto && test $networking = yes && _cddb=yes
5654 def_cdparanoia='#define CONFIG_CDDA 1'
5655 inputmodules="cdda $inputmodules"
5656 else
5657 def_cdparanoia='#undef CONFIG_CDDA'
5658 noinputmodules="cdda $noinputmodules"
5661 if test "$_cddb" = yes ; then
5662 def_cddb='#define CONFIG_CDDB 1'
5663 inputmodules="cddb $inputmodules"
5664 else
5665 _cddb=no
5666 def_cddb='#undef CONFIG_CDDB'
5667 noinputmodules="cddb $noinputmodules"
5670 echocheck "bitmap font support"
5671 if test "$_bitmap_font" = yes ; then
5672 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5673 else
5674 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5676 echores "$_bitmap_font"
5679 echocheck "freetype >= 2.0.9"
5681 # freetype depends on iconv
5682 if test "$_iconv" = no ; then
5683 _freetype=no
5684 res_comment="iconv support needed"
5687 if test "$_freetype" = auto ; then
5688 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5689 cat > $TMPC << EOF
5690 #include <stdio.h>
5691 #include <ft2build.h>
5692 #include FT_FREETYPE_H
5693 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5694 #error "Need FreeType 2.0.9 or newer"
5695 #endif
5696 int main(void) {
5697 FT_Library library;
5698 FT_Init_FreeType(&library);
5699 return 0;
5702 _freetype=no
5703 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
5704 else
5705 _freetype=no
5708 if test "$_freetype" = yes ; then
5709 def_freetype='#define CONFIG_FREETYPE 1'
5710 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
5711 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
5712 else
5713 def_freetype='#undef CONFIG_FREETYPE'
5715 echores "$_freetype"
5717 if test "$_freetype" = no ; then
5718 _fontconfig=no
5719 res_comment="FreeType support needed"
5721 echocheck "fontconfig"
5722 if test "$_fontconfig" = auto ; then
5723 cat > $TMPC << EOF
5724 #include <stdio.h>
5725 #include <stdlib.h>
5726 #include <fontconfig/fontconfig.h>
5727 #if FC_VERSION < 20402
5728 #error At least version 2.4.2 of fontconfig required
5729 #endif
5730 int main(void) {
5731 int err = FcInit();
5732 if (err == FcFalse) {
5733 printf("Couldn't initialize fontconfig lib\n");
5734 exit(err);
5736 return 0;
5739 _fontconfig=no
5740 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
5741 _ld_tmp="-lfontconfig $_ld_tmp"
5742 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5743 done
5744 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5745 _inc_tmp=$($_pkg_config --cflags fontconfig)
5746 _ld_tmp=$($_pkg_config --libs fontconfig)
5747 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5748 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5751 if test "$_fontconfig" = yes ; then
5752 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5753 else
5754 def_fontconfig='#undef CONFIG_FONTCONFIG'
5756 echores "$_fontconfig"
5759 echocheck "SSA/ASS support"
5760 if test "$_ass" = auto -o "$_ass" = yes ; then
5761 if $_pkg_config libass; then
5762 _ass=yes
5763 def_ass='#define CONFIG_ASS 1'
5764 extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
5765 extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
5766 else
5767 _ass=no
5768 def_ass='#undef CONFIG_ASS'
5770 else
5771 def_ass='#undef CONFIG_ASS'
5773 echores "$_ass"
5776 echocheck "fribidi with charsets"
5777 _inc_tmp=""
5778 _ld_tmp=""
5779 if test "$_fribidi" = auto ; then
5780 cat > $TMPC << EOF
5781 #include <stdlib.h>
5782 /* workaround for fribidi 0.10.4 and below */
5783 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5784 #include <fribidi/fribidi.h>
5785 int main(void) {
5786 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8)
5787 exit(1);
5788 return 0;
5791 _fribidi=no
5792 _inc_tmp=""
5793 _ld_tmp="-lfribidi"
5794 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5795 if $_pkg_config --exists fribidi > /dev/null 2>&1 &&
5796 test "$_fribidi" = no ; then
5797 _inc_tmp="$($_pkg_config --cflags)"
5798 _ld_tmp="$($_pkg_config --libs)"
5799 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5802 if test "$_fribidi" = yes ; then
5803 def_fribidi='#define CONFIG_FRIBIDI 1'
5804 extra_cflags="$extra_cflags $_inc_tmp"
5805 extra_ldflags="$extra_ldflags $_ld_tmp"
5806 else
5807 def_fribidi='#undef CONFIG_FRIBIDI'
5809 echores "$_fribidi"
5812 echocheck "ENCA"
5813 if test "$_enca" = auto ; then
5814 _enca=no
5815 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
5817 if test "$_enca" = yes ; then
5818 def_enca='#define CONFIG_ENCA 1'
5819 extra_ldflags="$extra_ldflags -lenca"
5820 else
5821 def_enca='#undef CONFIG_ENCA'
5823 echores "$_enca"
5826 echocheck "zlib"
5827 _zlib=no
5828 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5829 if test "$_zlib" = yes ; then
5830 def_zlib='#define CONFIG_ZLIB 1'
5831 extra_ldflags="$extra_ldflags -lz"
5832 else
5833 def_zlib='#define CONFIG_ZLIB 0'
5835 echores "$_zlib"
5838 echocheck "bzlib"
5839 bzlib=no
5840 def_bzlib='#define CONFIG_BZLIB 0'
5841 statement_check bzlib.h 'BZ2_bzlibVersion()' -lbz2 && bzlib=yes
5842 if test "$bzlib" = yes ; then
5843 def_bzlib='#define CONFIG_BZLIB 1'
5844 extra_ldflags="$extra_ldflags -lbz2"
5846 echores "$bzlib"
5849 echocheck "RTC"
5850 if test "$_rtc" = auto ; then
5851 cat > $TMPC << EOF
5852 #include <sys/ioctl.h>
5853 #ifdef __linux__
5854 #include <linux/rtc.h>
5855 #else
5856 #include <rtc.h>
5857 #define RTC_PIE_ON RTCIO_PIE_ON
5858 #endif
5859 int main(void) { return RTC_PIE_ON; }
5861 _rtc=no
5862 cc_check && _rtc=yes
5863 ppc && _rtc=no
5865 if test "$_rtc" = yes ; then
5866 def_rtc='#define HAVE_RTC 1'
5867 else
5868 def_rtc='#undef HAVE_RTC'
5870 echores "$_rtc"
5873 echocheck "liblzo2 support"
5874 if test "$_liblzo" = auto ; then
5875 _liblzo=no
5876 statement_check lzo/lzo1x.h 'lzo_init()' -llzo2 && _liblzo=yes
5878 if test "$_liblzo" = yes ; then
5879 def_liblzo='#define CONFIG_LIBLZO 1'
5880 extra_ldflags="$extra_ldflags -llzo2"
5881 codecmodules="liblzo $codecmodules"
5882 else
5883 def_liblzo='#undef CONFIG_LIBLZO'
5884 nocodecmodules="liblzo $nocodecmodules"
5886 echores "$_liblzo"
5889 echocheck "mad support"
5890 if test "$_mad" = auto ; then
5891 _mad=no
5892 header_check mad.h -lmad && _mad=yes
5894 if test "$_mad" = yes ; then
5895 def_mad='#define CONFIG_LIBMAD 1'
5896 extra_ldflags="$extra_ldflags -lmad"
5897 codecmodules="libmad $codecmodules"
5898 else
5899 def_mad='#undef CONFIG_LIBMAD'
5900 nocodecmodules="libmad $nocodecmodules"
5902 echores "$_mad"
5904 echocheck "OggVorbis support"
5905 if test "$_tremor_internal" = yes; then
5906 _libvorbis=no
5907 elif test "$_tremor" = auto; then
5908 _tremor=no
5909 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
5911 if test "$_libvorbis" = auto; then
5912 _libvorbis=no
5913 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes
5915 if test "$_tremor_internal" = yes ; then
5916 _vorbis=yes
5917 def_vorbis='#define CONFIG_OGGVORBIS 1'
5918 def_tremor='#define CONFIG_TREMOR 1'
5919 codecmodules="tremor(internal) $codecmodules"
5920 res_comment="internal Tremor"
5921 if test "$_tremor_low" = yes ; then
5922 cflags_tremor_low="-D_LOW_ACCURACY_"
5923 res_comment="internal low accuracy Tremor"
5925 elif test "$_tremor" = yes ; then
5926 _vorbis=yes
5927 def_vorbis='#define CONFIG_OGGVORBIS 1'
5928 def_tremor='#define CONFIG_TREMOR 1'
5929 codecmodules="tremor(external) $codecmodules"
5930 res_comment="external Tremor"
5931 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
5932 elif test "$_libvorbis" = yes ; then
5933 _vorbis=yes
5934 def_vorbis='#define CONFIG_OGGVORBIS 1'
5935 codecmodules="libvorbis $codecmodules"
5936 res_comment="libvorbis"
5937 extra_ldflags="$extra_ldflags -lvorbis -logg"
5938 else
5939 _vorbis=no
5940 nocodecmodules="libvorbis $nocodecmodules"
5942 echores "$_vorbis"
5944 echocheck "libspeex (version >= 1.1 required)"
5945 if test "$_speex" = auto ; then
5946 _speex=no
5947 cat > $TMPC << EOF
5948 #include <stddef.h>
5949 #include <speex/speex.h>
5950 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5952 cc_check -lspeex $_ld_lm && _speex=yes
5954 if test "$_speex" = yes ; then
5955 def_speex='#define CONFIG_SPEEX 1'
5956 extra_ldflags="$extra_ldflags -lspeex"
5957 codecmodules="speex $codecmodules"
5958 else
5959 def_speex='#undef CONFIG_SPEEX'
5960 nocodecmodules="speex $nocodecmodules"
5962 echores "$_speex"
5964 echocheck "OggTheora support"
5965 if test "$_theora" = auto ; then
5966 _theora=no
5967 cat > $TMPC << EOF
5968 #include <theora/theora.h>
5969 #include <string.h>
5970 int main(void) {
5971 /* Theora is in flux, make sure that all interface routines and datatypes
5972 * exist and work the way we expect it, so we don't break MPlayer. */
5973 ogg_packet op;
5974 theora_comment tc;
5975 theora_info inf;
5976 theora_state st;
5977 yuv_buffer yuv;
5978 int r;
5979 double t;
5981 theora_info_init(&inf);
5982 theora_comment_init(&tc);
5984 return 0;
5986 /* we don't want to execute this kind of nonsense; just for making sure
5987 * that compilation works... */
5988 memset(&op, 0, sizeof(op));
5989 r = theora_decode_header(&inf, &tc, &op);
5990 r = theora_decode_init(&st, &inf);
5991 t = theora_granule_time(&st, op.granulepos);
5992 r = theora_decode_packetin(&st, &op);
5993 r = theora_decode_YUVout(&st, &yuv);
5994 theora_clear(&st);
5996 return 0;
5999 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6000 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6001 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6002 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6003 if test _theora = no; then
6004 _ld_theora="-ltheora -logg"
6005 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6007 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6008 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6009 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6010 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6011 extra_ldflags="$extra_ldflags $_ld_theora" &&
6012 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6013 if test _theora = no; then
6014 _ld_theora="-ltheora -logg"
6015 cc_check tremor/bitwise.c $_ld_theora &&
6016 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6020 if test "$_theora" = yes ; then
6021 def_theora='#define CONFIG_OGGTHEORA 1'
6022 codecmodules="libtheora $codecmodules"
6023 # when --enable-theora is forced, we'd better provide a probably sane
6024 # $_ld_theora than nothing
6025 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6026 else
6027 def_theora='#undef CONFIG_OGGTHEORA'
6028 nocodecmodules="libtheora $nocodecmodules"
6030 echores "$_theora"
6032 echocheck "mp3lib support"
6033 if test "$_mp3lib" = auto ; then
6034 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6036 if test "$_mp3lib" = yes ; then
6037 def_mp3lib='#define CONFIG_MP3LIB 1'
6038 codecmodules="mp3lib(internal) $codecmodules"
6039 else
6040 def_mp3lib='#undef CONFIG_MP3LIB'
6041 nocodecmodules="mp3lib(internal) $nocodecmodules"
6043 echores "$_mp3lib"
6045 # Any version of libmpg123 shall be fine.
6046 echocheck "mpg123 support"
6047 def_mpg123='#undef CONFIG_MPG123'
6048 if test "$_mpg123" = auto; then
6049 _mpg123=no
6050 statement_check mpg123.h 'mpg123_init()' -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
6052 if test "$_mpg123" = yes ; then
6053 def_mpg123='#define CONFIG_MPG123 1'
6054 codecmodules="mpg123 $codecmodules"
6055 else
6056 nocodecmodules="mpg123 $nocodecmodules"
6058 echores "$_mpg123"
6060 echocheck "liba52 support"
6061 def_liba52='#undef CONFIG_LIBA52'
6062 if test "$_liba52" = auto ; then
6063 _liba52=no
6064 cat > $TMPC << EOF
6065 #include <inttypes.h>
6066 #include <a52dec/a52.h>
6067 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6069 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
6071 if test "$_liba52" = yes ; then
6072 def_liba52='#define CONFIG_LIBA52 1'
6073 codecmodules="liba52 $codecmodules"
6074 else
6075 nocodecmodules="liba52 $nocodecmodules"
6077 echores "$_liba52"
6079 echocheck "internal libmpeg2 support"
6080 if test "$_libmpeg2" = auto ; then
6081 _libmpeg2=yes
6082 if alpha && test cc_vendor=gnu; then
6083 case $cc_version in
6084 2*|3.0*|3.1*) # cannot compile MVI instructions
6085 _libmpeg2=no
6086 res_comment="broken gcc"
6088 esac
6091 if test "$_libmpeg2" = yes ; then
6092 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6093 codecmodules="libmpeg2(internal) $codecmodules"
6094 else
6095 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6096 nocodecmodules="libmpeg2(internal) $nocodecmodules"
6098 echores "$_libmpeg2"
6100 echocheck "libdca support"
6101 if test "$_libdca" = auto ; then
6102 _libdca=no
6103 for _ld_dca in -ldca -ldts ; do
6104 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
6105 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
6106 done
6108 if test "$_libdca" = yes ; then
6109 def_libdca='#define CONFIG_LIBDCA 1'
6110 codecmodules="libdca $codecmodules"
6111 else
6112 def_libdca='#undef CONFIG_LIBDCA'
6113 nocodecmodules="libdca $nocodecmodules"
6115 echores "$_libdca"
6117 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6118 if test "$_musepack" = auto ; then
6119 _musepack=no
6120 cat > $TMPC << EOF
6121 #include <stddef.h>
6122 #include <mpcdec/mpcdec.h>
6123 int main(void) {
6124 mpc_streaminfo info;
6125 mpc_decoder decoder;
6126 mpc_decoder_set_streaminfo(&decoder, &info);
6127 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6128 return 0;
6131 cc_check -lmpcdec $_ld_lm && _musepack=yes
6133 if test "$_musepack" = yes ; then
6134 def_musepack='#define CONFIG_MUSEPACK 1'
6135 extra_ldflags="$extra_ldflags -lmpcdec"
6136 codecmodules="musepack $codecmodules"
6137 else
6138 def_musepack='#undef CONFIG_MUSEPACK'
6139 nocodecmodules="musepack $nocodecmodules"
6141 echores "$_musepack"
6144 echocheck "FAAD2 support"
6145 if test "$_faad_internal" = auto ; then
6146 if x86_32 && test cc_vendor=gnu; then
6147 case $cc_version in
6148 3.1*|3.2) # ICE/insn with these versions
6149 _faad_internal=no
6150 res_comment="broken gcc"
6153 _faad=yes
6154 _faad_internal=yes
6156 esac
6157 else
6158 _faad=yes
6159 _faad_internal=yes
6162 if test "$_faad" = auto ; then
6163 cat > $TMPC << EOF
6164 #include <faad.h>
6165 #ifndef FAAD_MIN_STREAMSIZE
6166 #error Too old version
6167 #endif
6168 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6169 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6171 cc_check -lfaad $_ld_lm && _faad=yes
6174 def_faad='#undef CONFIG_FAAD'
6175 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6176 if test "$_faad_internal" = yes ; then
6177 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6178 res_comment="internal floating-point"
6179 if test "$_faad_fixed" = yes ; then
6180 # The FIXED_POINT implementation of FAAD2 improves performance
6181 # on some platforms, especially for SBR files.
6182 cflags_faad_fixed="-DFIXED_POINT"
6183 res_comment="internal fixed-point"
6185 elif test "$_faad" = yes ; then
6186 extra_ldflags="$extra_ldflags -lfaad"
6189 if test "$_faad" = yes ; then
6190 def_faad='#define CONFIG_FAAD 1'
6191 if test "$_faad_internal" = yes ; then
6192 codecmodules="faad2(internal) $codecmodules"
6193 else
6194 codecmodules="faad2 $codecmodules"
6196 else
6197 _faad=no
6198 nocodecmodules="faad2 $nocodecmodules"
6200 echores "$_faad"
6203 echocheck "LADSPA plugin support"
6204 if test "$_ladspa" = auto ; then
6205 _ladspa=no
6206 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
6208 if test "$_ladspa" = yes; then
6209 def_ladspa="#define CONFIG_LADSPA 1"
6210 else
6211 def_ladspa="#undef CONFIG_LADSPA"
6213 echores "$_ladspa"
6216 echocheck "libbs2b audio filter support"
6217 if test "$_libbs2b" = auto ; then
6218 cat > $TMPC <<EOF
6219 #include <bs2b.h>
6220 #if BS2B_VERSION_MAJOR < 3
6221 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6222 #endif
6223 int main(void) {
6224 t_bs2bdp filter;
6225 filter=bs2b_open();
6226 bs2b_close(filter);
6227 return 0;
6230 _libbs2b=no
6231 if $_pkg_config --exists libbs2b ; then
6232 _inc_tmp=$($_pkg_config --cflags libbs2b)
6233 _ld_tmp=$($_pkg_config --libs libbs2b)
6234 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6235 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6236 else
6237 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6238 -I/usr/local/include/bs2b ; do
6239 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6240 extra_ldflags="$extra_ldflags -lbs2b"
6241 extra_cflags="$extra_cflags $_inc_tmp"
6242 _libbs2b=yes
6243 break
6245 done
6248 def_libbs2b="#undef CONFIG_LIBBS2B"
6249 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6250 echores "$_libbs2b"
6253 if test -z "$_codecsdir" ; then
6254 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6255 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6256 if test -d "$dir" ; then
6257 _codecsdir="$dir"
6258 break;
6260 done
6262 # Fall back on default directory.
6263 if test -z "$_codecsdir" ; then
6264 _codecsdir="$_libdir/codecs"
6265 mingw32 || os2 && _codecsdir="codecs"
6269 echocheck "Win32 codecs"
6270 if test "$_win32dll" = auto ; then
6271 _win32dll=no
6272 if x86_32 && ! qnx; then
6273 _win32dll=yes
6276 if test "$_win32dll" = yes ; then
6277 def_win32dll='#define CONFIG_WIN32DLL 1'
6278 if ! win32 ; then
6279 def_win32_loader='#define WIN32_LOADER 1'
6280 _win32_emulation=yes
6281 else
6282 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6283 res_comment="using native windows"
6285 codecmodules="win32 $codecmodules"
6286 else
6287 def_win32dll='#undef CONFIG_WIN32DLL'
6288 def_win32_loader='#undef WIN32_LOADER'
6289 nocodecmodules="win32 $nocodecmodules"
6291 echores "$_win32dll"
6294 echocheck "XAnim codecs"
6295 if test "$_xanim" = auto ; then
6296 _xanim=no
6297 res_comment="dynamic loader support needed"
6298 if test "$_dl" = yes ; then
6299 _xanim=yes
6302 if test "$_xanim" = yes ; then
6303 def_xanim='#define CONFIG_XANIM 1'
6304 codecmodules="xanim $codecmodules"
6305 else
6306 def_xanim='#undef CONFIG_XANIM'
6307 nocodecmodules="xanim $nocodecmodules"
6309 echores "$_xanim"
6312 echocheck "RealPlayer codecs"
6313 if test "$_real" = auto ; then
6314 _real=no
6315 res_comment="dynamic loader support needed"
6316 if test "$_dl" = yes || test "$_win32dll" = yes &&
6317 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
6318 _real=yes
6321 if test "$_real" = yes ; then
6322 def_real='#define CONFIG_REALCODECS 1'
6323 codecmodules="real $codecmodules"
6324 else
6325 def_real='#undef CONFIG_REALCODECS'
6326 nocodecmodules="real $nocodecmodules"
6328 echores "$_real"
6331 echocheck "QuickTime codecs"
6332 _qtx_emulation=no
6333 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6334 if test "$_qtx" = auto ; then
6335 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6337 if test "$_qtx" = yes ; then
6338 def_qtx='#define CONFIG_QTX_CODECS 1'
6339 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6340 codecmodules="qtx $codecmodules"
6341 darwin || win32 || _qtx_emulation=yes
6342 else
6343 def_qtx='#undef CONFIG_QTX_CODECS'
6344 nocodecmodules="qtx $nocodecmodules"
6346 echores "$_qtx"
6348 echocheck "Nemesi Streaming Media libraries"
6349 if test "$_nemesi" = auto && test "$networking" = yes ; then
6350 _nemesi=no
6351 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6352 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6353 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6354 _nemesi=yes
6357 if test "$_nemesi" = yes; then
6358 _native_rtsp=no
6359 def_nemesi='#define CONFIG_LIBNEMESI 1'
6360 inputmodules="nemesi $inputmodules"
6361 else
6362 _native_rtsp="$networking"
6363 _nemesi=no
6364 def_nemesi='#undef CONFIG_LIBNEMESI'
6365 noinputmodules="nemesi $noinputmodules"
6367 echores "$_nemesi"
6369 echocheck "LIVE555 Streaming Media libraries"
6370 if test "$_live" = auto && test "$networking" = yes ; then
6371 cat > $TMPCPP << EOF
6372 #include <liveMedia.hh>
6373 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6374 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6375 #endif
6376 int main(void) { return 0; }
6379 _live=no
6380 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
6381 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6382 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
6383 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6384 $_livelibdir/groupsock/libgroupsock.a \
6385 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6386 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6387 $extra_ldflags -lstdc++" \
6388 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6389 -I$_livelibdir/UsageEnvironment/include \
6390 -I$_livelibdir/BasicUsageEnvironment/include \
6391 -I$_livelibdir/groupsock/include" && \
6392 _live=yes && break
6393 done
6394 if test "$_live" != yes ; then
6395 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6396 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
6397 _live_dist=yes
6401 if test "$_live" = yes && test "$networking" = yes; then
6402 test $_livelibdir && res_comment="using $_livelibdir"
6403 def_live='#define CONFIG_LIVE555 1'
6404 inputmodules="live555 $inputmodules"
6405 elif test "$_live_dist" = yes && test "$networking" = yes; then
6406 res_comment="using distribution version"
6407 _live="yes"
6408 def_live='#define CONFIG_LIVE555 1'
6409 extra_ldflags="$extra_ldflags $ld_tmp"
6410 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6411 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6412 inputmodules="live555 $inputmodules"
6413 else
6414 _live=no
6415 def_live='#undef CONFIG_LIVE555'
6416 noinputmodules="live555 $noinputmodules"
6418 echores "$_live"
6422 all_ffmpeg_libs="libavutil libavcodec libavformat libswscale libpostproc"
6423 echocheck "FFmpeg ($all_ffmpeg_libs)"
6424 if test "$ffmpeg" = auto ; then
6425 ffmpeg=no
6426 if $_pkg_config --exists $all_ffmpeg_libs ; then
6427 inc_ffmpeg=$($_pkg_config --cflags $all_ffmpeg_libs)
6428 _ld_tmp=$($_pkg_config --libs $all_ffmpeg_libs)
6429 extra_ldflags="$extra_ldflags $_ld_tmp"
6430 extra_cflags="$extra_cflags $inc_ffmpeg"
6431 ffmpeg=yes
6432 elif header_check libavcore/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil $_ld_lm ; then
6433 extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil -lavcore"
6434 ffmpeg=yes
6438 ffmpeg_eval_api=no
6439 def_ffmpeg_eval_api="#undef CONFIG_FFMPEG_EVAL_API"
6440 if test "$ffmpeg" = yes; then
6441 def_ffmpeg='#define CONFIG_FFMPEG 1'
6442 codecmodules="ffmpeg $codecmodules"
6443 if $_pkg_config --atleast-version=50.18.0 libavutil ; then
6444 ffmpeg_eval_api=yes
6445 def_ffmpeg_eval_api="#define CONFIG_FFMPEG_EVAL_API 1"
6447 else
6448 def_ffmpeg='#undef CONFIG_FFMPEG'
6449 nocodecmodules="ffmpeg $nocodecmodules"
6451 echores "$ffmpeg"
6453 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
6454 if ! test -z "$_ffmpeg_source" ; then
6455 test "$ffmpeg" = yes && def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
6460 echocheck "libdv-0.9.5+"
6461 if test "$_libdv" = auto ; then
6462 _libdv=no
6463 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
6465 if test "$_libdv" = yes ; then
6466 def_libdv='#define CONFIG_LIBDV095 1'
6467 extra_ldflags="$extra_ldflags -ldv"
6468 codecmodules="libdv $codecmodules"
6469 else
6470 def_libdv='#undef CONFIG_LIBDV095'
6471 nocodecmodules="libdv $nocodecmodules"
6473 echores "$_libdv"
6476 echocheck "Xvid"
6477 if test "$_xvid" = auto ; then
6478 _xvid=no
6479 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6480 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
6481 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
6482 done
6485 if test "$_xvid" = yes ; then
6486 def_xvid='#define CONFIG_XVID4 1'
6487 codecmodules="xvid $codecmodules"
6488 else
6489 def_xvid='#undef CONFIG_XVID4'
6490 nocodecmodules="xvid $nocodecmodules"
6492 echores "$_xvid"
6495 echocheck "libnut"
6496 if test "$_libnut" = auto ; then
6497 cat > $TMPC << EOF
6498 #include <libnut.h>
6499 nut_context_tt * nut;
6500 int main(void) { nut_error(0); return 0; }
6502 _libnut=no
6503 cc_check -lnut && _libnut=yes
6506 if test "$_libnut" = yes ; then
6507 def_libnut='#define CONFIG_LIBNUT 1'
6508 extra_ldflags="$extra_ldflags -lnut"
6509 else
6510 def_libnut='#undef CONFIG_LIBNUT'
6512 echores "$_libnut"
6514 # These VO checks must be done after the FFmpeg one
6515 echocheck "/dev/mga_vid"
6516 if test "$_mga" = auto ; then
6517 _mga=no
6518 test -c /dev/mga_vid && _mga=yes
6520 if test "$_mga" = yes ; then
6521 def_mga='#define CONFIG_MGA 1'
6522 vomodules="mga $vomodules"
6523 else
6524 def_mga='#undef CONFIG_MGA'
6525 novomodules="mga $novomodules"
6527 echores "$_mga"
6530 echocheck "xmga"
6531 if test "$_xmga" = auto ; then
6532 _xmga=no
6533 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
6535 if test "$_xmga" = yes ; then
6536 def_xmga='#define CONFIG_XMGA 1'
6537 vomodules="xmga $vomodules"
6538 else
6539 def_xmga='#undef CONFIG_XMGA'
6540 novomodules="xmga $novomodules"
6542 echores "$_xmga"
6544 echocheck "zr"
6545 if test "$_zr" = auto ; then
6546 #36067's seem to identify themselves as 36057PQC's, so the line
6547 #below should work for 36067's and 36057's.
6548 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
6549 _zr=yes
6550 else
6551 _zr=no
6554 if test "$_zr" = yes ; then
6555 if test "$ffmpeg_internals" = yes ; then
6556 def_zr='#define CONFIG_ZR 1'
6557 vomodules="zr zr2 $vomodules"
6558 else
6559 res_comment="FFmpeg internal headers are required by zr, sorry"
6560 novomodules="zr $novomodules"
6561 def_zr='#undef CONFIG_ZR'
6563 else
6564 def_zr='#undef CONFIG_ZR'
6565 novomodules="zr zr2 $novomodules"
6567 echores "$_zr"
6570 echocheck "UnRAR executable"
6571 if test "$_unrar_exec" = auto ; then
6572 _unrar_exec="yes"
6573 mingw32 && _unrar_exec="no"
6575 if test "$_unrar_exec" = yes ; then
6576 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
6577 else
6578 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
6580 echores "$_unrar_exec"
6582 echocheck "TV interface"
6583 if test "$_tv" = yes ; then
6584 def_tv='#define CONFIG_TV 1'
6585 inputmodules="tv $inputmodules"
6586 else
6587 noinputmodules="tv $noinputmodules"
6588 def_tv='#undef CONFIG_TV'
6590 echores "$_tv"
6593 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
6594 echocheck "*BSD BT848 bt8xx header"
6595 _ioctl_bt848_h=no
6596 for file in "machine/ioctl_bt848.h" \
6597 "dev/bktr/ioctl_bt848.h" \
6598 "dev/video/bktr/ioctl_bt848.h" \
6599 "dev/ic/bt8xx.h" ; do
6600 cat > $TMPC <<EOF
6601 #include <sys/types.h>
6602 #include <sys/ioctl.h>
6603 #include <$file>
6604 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
6606 if cc_check ; then
6607 _ioctl_bt848_h=yes
6608 _ioctl_bt848_h_name="$file"
6609 break;
6611 done
6612 if test "$_ioctl_bt848_h" = yes ; then
6613 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6614 res_comment="using $_ioctl_bt848_h_name"
6615 else
6616 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6618 echores "$_ioctl_bt848_h"
6620 echocheck "*BSD ioctl_meteor.h"
6621 _ioctl_meteor_h=no
6622 for file in "machine/ioctl_meteor.h" \
6623 "dev/bktr/ioctl_meteor.h" \
6624 "dev/video/bktr/ioctl_meteor.h" ; do
6625 cat > $TMPC <<EOF
6626 #include <sys/types.h>
6627 #include <$file>
6628 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
6630 if cc_check ; then
6631 _ioctl_meteor_h=yes
6632 _ioctl_meteor_h_name="$file"
6633 break;
6635 done
6636 if test "$_ioctl_meteor_h" = yes ; then
6637 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6638 res_comment="using $_ioctl_meteor_h_name"
6639 else
6640 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6642 echores "$_ioctl_meteor_h"
6644 echocheck "*BSD BrookTree 848 TV interface"
6645 if test "$_tv_bsdbt848" = auto ; then
6646 _tv_bsdbt848=no
6647 if test "$_tv" = yes ; then
6648 cat > $TMPC <<EOF
6649 #include <sys/types.h>
6650 $def_ioctl_meteor_h_name
6651 $def_ioctl_bt848_h_name
6652 #ifdef IOCTL_METEOR_H_NAME
6653 #include IOCTL_METEOR_H_NAME
6654 #endif
6655 #ifdef IOCTL_BT848_H_NAME
6656 #include IOCTL_BT848_H_NAME
6657 #endif
6658 int main(void) {
6659 ioctl(0, METEORSINPUT, 0);
6660 ioctl(0, TVTUNER_GETFREQ, 0);
6661 return 0;
6664 cc_check && _tv_bsdbt848=yes
6667 if test "$_tv_bsdbt848" = yes ; then
6668 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
6669 inputmodules="tv-bsdbt848 $inputmodules"
6670 else
6671 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
6672 noinputmodules="tv-bsdbt848 $noinputmodules"
6674 echores "$_tv_bsdbt848"
6675 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
6678 echocheck "DirectShow TV interface"
6679 if test "$_tv_dshow" = auto ; then
6680 _tv_dshow=no
6681 if test "$_tv" = yes && win32 ; then
6682 cat > $TMPC <<EOF
6683 #include <ole2.h>
6684 int main(void) {
6685 void* p;
6686 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6687 return 0;
6690 cc_check -lole32 -luuid && _tv_dshow=yes
6693 if test "$_tv_dshow" = yes ; then
6694 inputmodules="tv-dshow $inputmodules"
6695 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
6696 extra_ldflags="$extra_ldflags -lole32 -luuid"
6697 else
6698 noinputmodules="tv-dshow $noinputmodules"
6699 def_tv_dshow='#undef CONFIG_TV_DSHOW'
6701 echores "$_tv_dshow"
6704 echocheck "Video 4 Linux TV interface"
6705 if test "$_tv_v4l1" = auto ; then
6706 _tv_v4l1=no
6707 if test "$_tv" = yes && linux ; then
6708 header_check linux/videodev.h && _tv_v4l1=yes
6711 if test "$_tv_v4l1" = yes ; then
6712 _audio_input=yes
6713 _tv_v4l=yes
6714 def_tv_v4l='#define CONFIG_TV_V4L 1'
6715 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
6716 inputmodules="tv-v4l $inputmodules"
6717 else
6718 noinputmodules="tv-v4l1 $noinputmodules"
6719 def_tv_v4l='#undef CONFIG_TV_V4L'
6721 echores "$_tv_v4l1"
6724 echocheck "Video 4 Linux 2 TV interface"
6725 if test "$_tv_v4l2" = auto ; then
6726 _tv_v4l2=no
6727 if test "$_tv" = yes && linux ; then
6728 header_check linux/videodev2.h && _tv_v4l2=yes
6731 if test "$_tv_v4l2" = yes ; then
6732 _audio_input=yes
6733 _tv_v4l=yes
6734 def_tv_v4l='#define CONFIG_TV_V4L 1'
6735 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
6736 inputmodules="tv-v4l2 $inputmodules"
6737 else
6738 noinputmodules="tv-v4l2 $noinputmodules"
6739 def_tv_v4l2='#undef CONFIG_TV_V4L2'
6741 echores "$_tv_v4l2"
6744 echocheck "Radio interface"
6745 if test "$_radio" = yes ; then
6746 def_radio='#define CONFIG_RADIO 1'
6747 inputmodules="radio $inputmodules"
6748 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6749 _radio_capture=no
6751 if test "$_radio_capture" = yes ; then
6752 _audio_input=yes
6753 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
6754 else
6755 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6757 else
6758 noinputmodules="radio $noinputmodules"
6759 def_radio='#undef CONFIG_RADIO'
6760 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6761 _radio_capture=no
6763 echores "$_radio"
6764 echocheck "Capture for Radio interface"
6765 echores "$_radio_capture"
6767 echocheck "Video 4 Linux 2 Radio interface"
6768 if test "$_radio_v4l2" = auto ; then
6769 _radio_v4l2=no
6770 if test "$_radio" = yes && linux ; then
6771 header_check linux/videodev2.h && _radio_v4l2=yes
6774 if test "$_radio_v4l2" = yes ; then
6775 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
6776 else
6777 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
6779 echores "$_radio_v4l2"
6781 echocheck "Video 4 Linux Radio interface"
6782 if test "$_radio_v4l" = auto ; then
6783 _radio_v4l=no
6784 if test "$_radio" = yes && linux ; then
6785 header_check linux/videodev.h && _radio_v4l=yes
6788 if test "$_radio_v4l" = yes ; then
6789 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
6790 else
6791 def_radio_v4l='#undef CONFIG_RADIO_V4L'
6793 echores "$_radio_v4l"
6795 if freebsd || netbsd || openbsd || dragonfly || bsdos \
6796 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6797 echocheck "*BSD BrookTree 848 Radio interface"
6798 _radio_bsdbt848=no
6799 cat > $TMPC <<EOF
6800 #include <sys/types.h>
6801 $def_ioctl_bt848_h_name
6802 #ifdef IOCTL_BT848_H_NAME
6803 #include IOCTL_BT848_H_NAME
6804 #endif
6805 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
6807 cc_check && _radio_bsdbt848=yes
6808 echores "$_radio_bsdbt848"
6809 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
6811 if test "$_radio_bsdbt848" = yes ; then
6812 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
6813 else
6814 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
6817 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6818 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6819 die "Radio driver requires BSD BT848, V4L or V4L2!"
6822 echocheck "Video 4 Linux 2 MPEG PVR interface"
6823 if test "$_pvr" = auto ; then
6824 _pvr=no
6825 if test "$_tv_v4l2" = yes && linux ; then
6826 cat > $TMPC <<EOF
6827 #include <linux/videodev2.h>
6828 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
6830 cc_check && _pvr=yes
6833 if test "$_pvr" = yes ; then
6834 def_pvr='#define CONFIG_PVR 1'
6835 inputmodules="pvr $inputmodules"
6836 else
6837 noinputmodules="pvr $noinputmodules"
6838 def_pvr='#undef CONFIG_PVR'
6840 echores "$_pvr"
6843 echocheck "ftp"
6844 if test "$_ftp" = "auto" ; then
6845 test "$networking" = "yes" && ! beos && _ftp=yes
6847 if test "$_ftp" = yes ; then
6848 def_ftp='#define CONFIG_FTP 1'
6849 inputmodules="ftp $inputmodules"
6850 else
6851 noinputmodules="ftp $noinputmodules"
6852 def_ftp='#undef CONFIG_FTP'
6854 echores "$_ftp"
6856 echocheck "vstream client"
6857 if test "$_vstream" = auto ; then
6858 _vstream=no
6859 cat > $TMPC <<EOF
6860 #include <vstream-client.h>
6861 void vstream_error(const char *format, ... ) {}
6862 int main(void) { vstream_start(); return 0; }
6864 cc_check -lvstream-client && _vstream=yes
6866 if test "$_vstream" = yes ; then
6867 def_vstream='#define CONFIG_VSTREAM 1'
6868 inputmodules="vstream $inputmodules"
6869 extra_ldflags="$extra_ldflags -lvstream-client"
6870 else
6871 noinputmodules="vstream $noinputmodules"
6872 def_vstream='#undef CONFIG_VSTREAM'
6874 echores "$_vstream"
6877 echocheck "OSD menu"
6878 if test "$_menu" = yes ; then
6879 def_menu='#define CONFIG_MENU 1'
6880 test $_dvbin = "yes" && _menu_dvbin=yes
6881 else
6882 def_menu='#undef CONFIG_MENU'
6883 _menu_dvbin=no
6885 echores "$_menu"
6888 echocheck "Subtitles sorting"
6889 if test "$_sortsub" = yes ; then
6890 def_sortsub='#define CONFIG_SORTSUB 1'
6891 else
6892 def_sortsub='#undef CONFIG_SORTSUB'
6894 echores "$_sortsub"
6897 echocheck "XMMS inputplugin support"
6898 if test "$_xmms" = yes ; then
6899 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6900 _xmmsplugindir=$(xmms-config --input-plugin-dir)
6901 _xmmslibdir=$(xmms-config --exec-prefix)/lib
6902 else
6903 _xmmsplugindir=/usr/lib/xmms/Input
6904 _xmmslibdir=/usr/lib
6907 def_xmms='#define CONFIG_XMMS 1'
6908 if darwin ; then
6909 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6910 else
6911 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6913 else
6914 def_xmms='#undef CONFIG_XMMS'
6916 echores "$_xmms"
6918 if test "$_charset" != "noconv" ; then
6919 def_charset="#define MSG_CHARSET \"$_charset\""
6920 else
6921 def_charset="#undef MSG_CHARSET"
6922 _charset="UTF-8"
6925 #############################################################################
6927 echocheck "automatic gdb attach"
6928 if test "$_crash_debug" = yes ; then
6929 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
6930 else
6931 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
6932 _crash_debug=no
6934 echores "$_crash_debug"
6936 echocheck "compiler support for noexecstack"
6937 if cflag_check -Wl,-z,noexecstack ; then
6938 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
6939 echores "yes"
6940 else
6941 echores "no"
6944 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
6945 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6946 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6947 echores "yes"
6948 else
6949 echores "no"
6953 # Dynamic linking flags
6954 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6955 _ld_dl_dynamic=''
6956 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
6957 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
6958 _ld_dl_dynamic='-rdynamic'
6961 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6962 bsdos && extra_ldflags="$extra_ldflags -ldvd"
6963 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
6965 def_debug='#undef MP_DEBUG'
6966 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
6969 echocheck "joystick"
6970 def_joystick='#undef CONFIG_JOYSTICK'
6971 if test "$_joystick" = yes ; then
6972 if linux || freebsd ; then
6973 # TODO add some check
6974 def_joystick='#define CONFIG_JOYSTICK 1'
6975 else
6976 _joystick="no"
6977 res_comment="unsupported under $system_name"
6980 echores "$_joystick"
6982 echocheck "lirc"
6983 if test "$_lirc" = auto ; then
6984 _lirc=no
6985 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
6987 if test "$_lirc" = yes ; then
6988 def_lirc='#define CONFIG_LIRC 1'
6989 libs_mplayer="$libs_mplayer -llirc_client"
6990 else
6991 def_lirc='#undef CONFIG_LIRC'
6993 echores "$_lirc"
6995 echocheck "lircc"
6996 if test "$_lircc" = auto ; then
6997 _lircc=no
6998 header_check lirc/lircc.h -llircc && _lircc=yes
7000 if test "$_lircc" = yes ; then
7001 def_lircc='#define CONFIG_LIRCC 1'
7002 libs_mplayer="$libs_mplayer -llircc"
7003 else
7004 def_lircc='#undef CONFIG_LIRCC'
7006 echores "$_lircc"
7008 if arm; then
7009 # Detect maemo development platform libraries availability (http://www.maemo.org),
7010 # they are used when run on Nokia 770|8x0
7011 echocheck "maemo (Nokia 770|8x0)"
7012 if test "$_maemo" = auto ; then
7013 _maemo=no
7014 statement_check libosso.h 'osso_initialize('', '', 0, NULL)' $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
7016 if test "$_maemo" = yes ; then
7017 def_maemo='#define CONFIG_MAEMO 1'
7018 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
7019 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
7020 else
7021 def_maemo='#undef CONFIG_MAEMO'
7023 echores "$_maemo"
7026 #############################################################################
7028 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7029 # the OMF format needs to come after the 'extern symbol prefix' check, which
7030 # uses nm.
7031 if os2 ; then
7032 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7035 #############################################################################
7036 # 64 bit file offsets?
7037 if test "$_largefiles" = yes || freebsd ; then
7038 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7039 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7040 # dvdread support requires this (for off64_t)
7041 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7045 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
7047 # This must be the last test to be performed. Any other tests following it
7048 # could fail due to linker errors. libdvdnavmini is intentionally not linked
7049 # against libdvdread (to permit MPlayer to use its own copy of the library).
7050 # So any compilation using the flags added here but not linking against
7051 # libdvdread can fail.
7052 echocheck "DVD support (libdvdnav)"
7053 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
7054 _dvdnav=no
7056 dvdnav_internal=no
7057 if test "$_dvdnav" = auto ; then
7058 if test "$_dvdread_internal" = yes ; then
7059 _dvdnav=yes
7060 dvdnav_internal=yes
7061 res_comment="internal"
7062 else
7063 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7066 if test "$_dvdnav" = auto ; then
7067 _dvdnav=no
7068 _dvdnavdir=$($_dvdnavconfig --cflags)
7069 _dvdnavlibs=$($_dvdnavconfig --libs)
7070 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7072 if test "$_dvdnav" = yes ; then
7073 _largefiles=yes
7074 def_dvdnav='#define CONFIG_DVDNAV 1'
7075 if test "$dvdnav_internal" = yes ; then
7076 cflags_libdvdnav="-Ilibdvdnav"
7077 inputmodules="dvdnav(internal) $inputmodules"
7078 else
7079 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
7080 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
7081 inputmodules="dvdnav $inputmodules"
7083 else
7084 def_dvdnav='#undef CONFIG_DVDNAV'
7085 noinputmodules="dvdnav $noinputmodules"
7087 echores "$_dvdnav"
7089 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
7090 # Read dvdnav comment above.
7092 mak_enable () {
7093 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7094 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7095 nprefix=$3;
7096 for part in $list; do
7097 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7098 echo "${nprefix}_$part = yes"
7100 done
7103 #############################################################################
7104 echo "Creating config.mak"
7105 cat > config.mak << EOF
7106 # -------- Generated by configure -----------
7108 # Ensure that locale settings do not interfere with shell commands.
7109 export LC_ALL = C
7111 CONFIGURATION = $configuration
7113 CHARSET = $_charset
7114 DOC_LANGS = $language_doc
7115 DOC_LANG_ALL = $doc_lang_all
7116 MAN_LANGS = $language_man
7117 MAN_LANG_ALL = $man_lang_all
7118 MSG_LANGS = $language_msg
7119 MSG_LANG_ALL = $msg_lang_all
7121 prefix = \$(DESTDIR)$_prefix
7122 BINDIR = \$(DESTDIR)$_bindir
7123 DATADIR = \$(DESTDIR)$_datadir
7124 LIBDIR = \$(DESTDIR)$_libdir
7125 MANDIR = \$(DESTDIR)$_mandir
7126 CONFDIR = \$(DESTDIR)$_confdir
7127 LOCALEDIR = \$(DESTDIR)$_localedir
7129 AR = $_ar
7130 AS = $_cc
7131 CC = $_cc
7132 CXX = $_cc
7133 HOST_CC = $_host_cc
7134 INSTALL = $_install
7135 INSTALLSTRIP = $_install_strip
7136 WINDRES = $_windres
7138 CFLAGS = $WARNFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
7139 CXXFLAGS = $WARNFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
7140 DEPFLAGS = $DEPFLAGS
7142 CFLAGS_DHAHELPER = $cflags_dhahelper
7143 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
7144 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
7145 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
7146 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
7147 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
7148 CFLAGS_STACKREALIGN = $cflags_stackrealign
7149 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
7150 CFLAGS_TREMOR_LOW = $cflags_tremor_low
7152 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
7153 EXTRALIBS_MPLAYER = $libs_mplayer
7155 GETCH = $_getch
7156 TIMER = $_timer
7158 EXESUF = $_exesuf
7159 EXESUFS_ALL = .exe
7161 ARCH = $arch
7162 $(mak_enable "$arch_all" "$arch" ARCH)
7163 $(mak_enable "$subarch_all" "$subarch" ARCH)
7164 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
7166 MPLAYER = $_mplayer
7168 NEED_GETTIMEOFDAY = $_need_gettimeofday
7169 NEED_GLOB = $_need_glob
7170 NEED_MMAP = $_need_mmap
7171 NEED_SETENV = $_need_setenv
7172 NEED_SHMEM = $_need_shmem
7173 NEED_STRSEP = $_need_strsep
7174 NEED_SWAB = $_need_swab
7175 NEED_VSSCANF = $_need_vsscanf
7177 # features
7178 3DFX = $_3dfx
7179 AA = $_aa
7180 ALSA1X = $_alsa1x
7181 ALSA9 = $_alsa9
7182 ALSA5 = $_alsa5
7183 APPLE_IR = $_apple_ir
7184 APPLE_REMOTE = $_apple_remote
7185 ARTS = $_arts
7186 AUDIO_INPUT = $_audio_input
7187 BITMAP_FONT = $_bitmap_font
7188 BL = $_bl
7189 CACA = $_caca
7190 CDDA = $_cdda
7191 CDDB = $_cddb
7192 COREAUDIO = $_coreaudio
7193 COREVIDEO = $_corevideo
7194 DART = $_dart
7195 DGA = $_dga
7196 DIRECT3D = $_direct3d
7197 DIRECTFB = $_directfb
7198 DIRECTX = $_directx
7199 DVBIN = $_dvbin
7200 DVDNAV = $_dvdnav
7201 DVDNAV_INTERNAL = $dvdnav_internal
7202 DVDREAD = $_dvdread
7203 DVDREAD_INTERNAL = $_dvdread_internal
7204 DXR2 = $_dxr2
7205 DXR3 = $_dxr3
7206 ESD = $_esd
7207 FAAD = $_faad
7208 FAAD_INTERNAL = $_faad_internal
7209 FASTMEMCPY = $_fastmemcpy
7210 FBDEV = $_fbdev
7211 FREETYPE = $_freetype
7212 FTP = $_ftp
7213 GIF = $_gif
7214 GGI = $_ggi
7215 GL = $_gl
7216 GL_WIN32 = $_gl_win32
7217 GL_X11 = $_gl_x11
7218 GL_SDL = $_gl_sdl
7219 MATRIXVIEW = $matrixview
7220 HAVE_POSIX_SELECT = $_posix_select
7221 HAVE_SYS_MMAN_H = $_mman
7222 IVTV = $_ivtv
7223 JACK = $_jack
7224 JOYSTICK = $_joystick
7225 JPEG = $_jpeg
7226 KAI = $_kai
7227 KVA = $_kva
7228 LADSPA = $_ladspa
7229 LIBA52 = $_liba52
7230 LIBASS = $_ass
7231 LIBBLURAY = $_bluray
7232 LIBBS2B = $_libbs2b
7233 LIBDCA = $_libdca
7234 LIBDV = $_libdv
7235 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7236 LIBLZO = $_liblzo
7237 LIBMAD = $_mad
7238 LIBMENU = $_menu
7239 LIBMENU_DVBIN = $_menu_dvbin
7240 LIBMPEG2 = $_libmpeg2
7241 LIBNEMESI = $_nemesi
7242 LIBNUT = $_libnut
7243 LIBSMBCLIENT = $_smb
7244 LIBTHEORA = $_theora
7245 LIRC = $_lirc
7246 LIVE555 = $_live
7247 MACOSX_FINDER = $_macosx_finder
7248 MD5SUM = $_md5sum
7249 MGA = $_mga
7250 MNG = $_mng
7251 MP3LIB = $_mp3lib
7252 MPG123 = $_mpg123
7253 MUSEPACK = $_musepack
7254 NAS = $_nas
7255 NATIVE_RTSP = $_native_rtsp
7256 NETWORKING = $networking
7257 OPENAL = $_openal
7258 OSS = $_ossaudio
7259 PE_EXECUTABLE = $_pe_executable
7260 PNG = $_png
7261 PNM = $_pnm
7262 PRIORITY = $_priority
7263 PULSE = $_pulse
7264 PVR = $_pvr
7265 QTX_CODECS = $_qtx
7266 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7267 QTX_EMULATION = $_qtx_emulation
7268 QUARTZ = $_quartz
7269 RADIO=$_radio
7270 RADIO_CAPTURE=$_radio_capture
7271 REAL_CODECS = $_real
7272 S3FB = $_s3fb
7273 SDL = $_sdl
7274 SPEEX = $_speex
7275 STREAM_CACHE = $_stream_cache
7276 SGIAUDIO = $_sgiaudio
7277 SUNAUDIO = $_sunaudio
7278 SVGA = $_svga
7279 TDFXFB = $_tdfxfb
7280 TDFXVID = $_tdfxvid
7281 TGA = $_tga
7282 TREMOR_INTERNAL = $_tremor_internal
7283 TV = $_tv
7284 TV_BSDBT848 = $_tv_bsdbt848
7285 TV_DSHOW = $_tv_dshow
7286 TV_V4L = $_tv_v4l
7287 TV_V4L1 = $_tv_v4l1
7288 TV_V4L2 = $_tv_v4l2
7289 UNRAR_EXEC = $_unrar_exec
7290 V4L2 = $_v4l2
7291 VCD = $_vcd
7292 VDPAU = $_vdpau
7293 VESA = $_vesa
7294 VIDIX = $_vidix
7295 VIDIX_PCIDB = $_vidix_pcidb_val
7296 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7297 VIDIX_IVTV=$_vidix_drv_ivtv
7298 VIDIX_MACH64=$_vidix_drv_mach64
7299 VIDIX_MGA=$_vidix_drv_mga
7300 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7301 VIDIX_NVIDIA=$_vidix_drv_nvidia
7302 VIDIX_PM2=$_vidix_drv_pm2
7303 VIDIX_PM3=$_vidix_drv_pm3
7304 VIDIX_RADEON=$_vidix_drv_radeon
7305 VIDIX_RAGE128=$_vidix_drv_rage128
7306 VIDIX_S3=$_vidix_drv_s3
7307 VIDIX_SH_VEU=$_vidix_drv_sh_veu
7308 VIDIX_SIS=$_vidix_drv_sis
7309 VIDIX_UNICHROME=$_vidix_drv_unichrome
7310 VORBIS = $_vorbis
7311 VSTREAM = $_vstream
7312 WII = $_wii
7313 WIN32DLL = $_win32dll
7314 WIN32WAVEOUT = $_win32waveout
7315 WIN32_EMULATION = $_win32_emulation
7316 WINVIDIX = $winvidix
7317 X11 = $_x11
7318 XANIM_CODECS = $_xanim
7319 XMGA = $_xmga
7320 XMMS_PLUGINS = $_xmms
7321 XV = $_xv
7322 XVID4 = $_xvid
7323 XVIDIX = $xvidix
7324 XVMC = $_xvmc
7325 XVR100 = $_xvr100
7326 YUV4MPEG = $_yuv4mpeg
7327 ZR = $_zr
7329 # FFmpeg
7330 FFMPEG = $ffmpeg
7331 FFMPEG_EVAL_API = $ffmpeg_eval_api
7332 FFMPEG_INTERNALS = $ffmpeg_internals
7333 FFMPEG_SOURCE_PATH = $_ffmpeg_source
7335 RANLIB = $_ranlib
7336 YASM = $_yasm
7337 YASMFLAGS = $YASMFLAGS
7339 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
7340 CONFIG_AANDCT = yes
7341 CONFIG_FFT = yes
7342 CONFIG_GOLOMB = yes
7343 CONFIG_H264DSP = yes
7344 CONFIG_LPC = yes
7345 CONFIG_MDCT = yes
7346 CONFIG_RDFT = yes
7348 CONFIG_BZLIB = $bzlib
7349 CONFIG_ENCODERS = yes
7350 CONFIG_GPL = yes
7351 CONFIG_MLIB = $_mlib
7352 CONFIG_VDPAU = $_vdpau
7353 CONFIG_XVMC = $_xvmc
7354 CONFIG_ZLIB = $_zlib
7356 HAVE_PTHREADS = $_pthreads
7357 HAVE_SHM = $_shm
7358 HAVE_W32THREADS = $_w32threads
7359 HAVE_YASM = $have_yasm
7363 #############################################################################
7365 ff_config_enable () {
7366 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7367 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7368 _nprefix=$3;
7369 test -z "$_nprefix" && _nprefix='CONFIG'
7370 for part in $list; do
7371 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7372 echo "#define ${_nprefix}_$part 1"
7373 else
7374 echo "#define ${_nprefix}_$part 0"
7376 done
7379 echo "Creating config.h"
7380 cat > $TMPH << EOF
7381 /*----------------------------------------------------------------------------
7382 ** This file has been automatically generated by configure any changes in it
7383 ** will be lost when you run configure again.
7384 ** Instead of modifying definitions here, use the --enable/--disable options
7385 ** of the configure script! See ./configure --help for details.
7386 *---------------------------------------------------------------------------*/
7388 #ifndef MPLAYER_CONFIG_H
7389 #define MPLAYER_CONFIG_H
7391 /* Undefine this if you do not want to select mono audio (left or right)
7392 with a stereo MPEG layer 2/3 audio stream. The command line option
7393 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7394 right-only), with 0 being the default.
7396 #define CONFIG_FAKE_MONO 1
7398 /* set up audio OUTBURST. Do not change this! */
7399 #define OUTBURST 512
7401 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7402 #undef FAST_OSD
7403 #undef FAST_OSD_TABLE
7405 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
7406 #define MPEG12_POSTPROC 1
7407 #define ATTRIBUTE_ALIGNED_MAX 16
7411 #define CONFIGURATION "$configuration"
7413 #define MPLAYER_DATADIR "$_datadir"
7414 #define MPLAYER_CONFDIR "$_confdir"
7415 #define MPLAYER_LIBDIR "$_libdir"
7416 #define MPLAYER_LOCALEDIR "$_localedir"
7418 $def_translation
7420 /* definitions needed by included libraries */
7421 #define HAVE_INTTYPES_H 1
7422 /* libmpeg2 + FFmpeg */
7423 $def_fast_inttypes
7424 /* libdvdcss */
7425 #define HAVE_ERRNO_H 1
7426 /* libdvdcss + libdvdread */
7427 #define HAVE_LIMITS_H 1
7428 /* libdvdcss + libfaad2 */
7429 #define HAVE_UNISTD_H 1
7430 /* libfaad2 + libdvdread */
7431 #define STDC_HEADERS 1
7432 #define HAVE_MEMCPY 1
7433 /* libfaad2 */
7434 #define HAVE_STDLIB_H 1
7435 #define HAVE_STRING_H 1
7436 #define HAVE_STRINGS_H 1
7437 #define HAVE_SYS_STAT_H 1
7438 #define HAVE_SYS_TYPES_H 1
7439 /* libdvdnav */
7440 #define READ_CACHE_TRACE 0
7441 /* libdvdread */
7442 #define HAVE_DLFCN_H 1
7443 $def_dvdcss
7446 /* system headers */
7447 $def_alloca_h
7448 $def_alsa_asoundlib_h
7449 $def_altivec_h
7450 $def_malloc_h
7451 $def_mman_h
7452 $def_mman_has_map_failed
7453 $def_soundcard_h
7454 $def_sys_asoundlib_h
7455 $def_sys_soundcard_h
7456 $def_sys_sysinfo_h
7457 $def_termios_h
7458 $def_termios_sys_h
7459 $def_winsock2_h
7462 /* system functions */
7463 $def_gethostbyname2
7464 $def_gettimeofday
7465 $def_glob
7466 $def_langinfo
7467 $def_lrintf
7468 $def_map_memalign
7469 $def_memalign
7470 $def_nanosleep
7471 $def_posix_select
7472 $def_select
7473 $def_setenv
7474 $def_setmode
7475 $def_shm
7476 $def_strsep
7477 $def_swab
7478 $def_sysi86
7479 $def_sysi86_iv
7480 $def_termcap
7481 $def_termios
7482 $def_vsscanf
7485 /* system-specific features */
7486 $def_asmalign_pot
7487 $def_builtin_expect
7488 $def_dl
7489 $def_dos_paths
7490 $def_extern_asm
7491 $def_extern_prefix
7492 $def_iconv
7493 $def_kstat
7494 $def_macosx_bundle
7495 $def_macosx_finder
7496 $def_maemo
7497 $def_named_asm_args
7498 $def_priority
7499 $def_quicktime
7500 $def_restrict_keyword
7501 $def_rtc
7502 $def_unrar_exec
7505 /* configurable options */
7506 $def_charset
7507 $def_crash_debug
7508 $def_debug
7509 $def_dynamic_plugins
7510 $def_fastmemcpy
7511 $def_menu
7512 $def_runtime_cpudetection
7513 $def_sighandler
7514 $def_sortsub
7515 $def_stream_cache
7516 $def_pthread_cache
7519 /* CPU stuff */
7520 #define __CPU__ $iproc
7521 $def_ebx_available
7522 $def_words_endian
7523 $def_bigendian
7524 $(ff_config_enable "$arch_all" "$arch" "ARCH")
7525 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
7526 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
7529 /* Blu-ray/DVD/VCD/CD */
7530 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
7531 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
7532 $def_bluray
7533 $def_bsdi_dvd
7534 $def_cddb
7535 $def_cdio
7536 $def_cdparanoia
7537 $def_cdrom
7538 $def_dvd
7539 $def_dvd_bsd
7540 $def_dvd_darwin
7541 $def_dvd_linux
7542 $def_dvd_openbsd
7543 $def_dvdio
7544 $def_dvdnav
7545 $def_dvdread
7546 $def_hpux_scsi_h
7547 $def_libcdio
7548 $def_sol_scsi_h
7549 $def_vcd
7552 /* codec libraries */
7553 $def_faad
7554 $def_faad_internal
7555 $def_liba52
7556 $def_libdca
7557 $def_libdv
7558 $def_liblzo
7559 $def_libmpeg2
7560 $def_mad
7561 $def_mp3lib
7562 $def_mpg123
7563 $def_musepack
7564 $def_speex
7565 $def_theora
7566 $def_tremor
7567 $def_vorbis
7568 $def_xvid
7569 $def_zlib
7571 $def_libnut
7574 /* binary codecs */
7575 $def_qtx
7576 $def_qtx_win32
7577 $def_real
7578 $def_win32_loader
7579 $def_win32dll
7580 $def_xanim
7581 $def_xmms
7582 #define BINARY_CODECS_PATH "$_codecsdir"
7583 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7586 /* Audio output drivers */
7587 $def_alsa
7588 $def_alsa1x
7589 $def_alsa5
7590 $def_alsa9
7591 $def_arts
7592 $def_coreaudio
7593 $def_dart
7594 $def_esd
7595 $def_esd_latency
7596 $def_jack
7597 $def_kai
7598 $def_nas
7599 $def_openal
7600 $def_openal_h
7601 $def_ossaudio
7602 $def_ossaudio_devdsp
7603 $def_ossaudio_devmixer
7604 $def_pulse
7605 $def_sgiaudio
7606 $def_sunaudio
7607 $def_win32waveout
7609 $def_ladspa
7610 $def_libbs2b
7613 /* input */
7614 $def_apple_ir
7615 $def_apple_remote
7616 $def_ioctl_bt848_h_name
7617 $def_ioctl_meteor_h_name
7618 $def_joystick
7619 $def_lirc
7620 $def_lircc
7621 $def_pvr
7622 $def_radio
7623 $def_radio_bsdbt848
7624 $def_radio_capture
7625 $def_radio_v4l
7626 $def_radio_v4l2
7627 $def_tv
7628 $def_tv_bsdbt848
7629 $def_tv_dshow
7630 $def_tv_v4l
7631 $def_tv_v4l1
7632 $def_tv_v4l2
7635 /* font stuff */
7636 $def_ass
7637 $def_bitmap_font
7638 $def_enca
7639 $def_fontconfig
7640 $def_freetype
7641 $def_fribidi
7644 /* networking */
7645 $def_closesocket
7646 $def_ftp
7647 $def_inet6
7648 $def_inet_aton
7649 $def_inet_pton
7650 $def_live
7651 $def_nemesi
7652 $def_networking
7653 $def_smb
7654 $def_socklen_t
7655 $def_vstream
7658 /* libvo options */
7659 $def_3dfx
7660 $def_aa
7661 $def_bl
7662 $def_caca
7663 $def_corevideo
7664 $def_dga
7665 $def_dga1
7666 $def_dga2
7667 $def_direct3d
7668 $def_directfb
7669 $def_directx
7670 $def_dvb
7671 $def_dvbin
7672 $def_dxr2
7673 $def_dxr3
7674 $def_fbdev
7675 $def_ggi
7676 $def_ggiwmh
7677 $def_gif
7678 $def_gif_4
7679 $def_gif_tvt_hack
7680 $def_gl
7681 $def_gl_win32
7682 $def_gl_x11
7683 $def_gl_sdl
7684 $def_matrixview
7685 $def_ivtv
7686 $def_jpeg
7687 $def_kva
7688 $def_md5sum
7689 $def_mga
7690 $def_mng
7691 $def_png
7692 $def_pnm
7693 $def_quartz
7694 $def_s3fb
7695 $def_sdl
7696 $def_sdl_sdl_h
7697 $def_svga
7698 $def_tdfxfb
7699 $def_tdfxvid
7700 $def_tga
7701 $def_v4l2
7702 $def_vdpau
7703 $def_vesa
7704 $def_vidix
7705 $def_vidix_drv_cyberblade
7706 $def_vidix_drv_ivtv
7707 $def_vidix_drv_mach64
7708 $def_vidix_drv_mga
7709 $def_vidix_drv_mga_crtc2
7710 $def_vidix_drv_nvidia
7711 $def_vidix_drv_pm3
7712 $def_vidix_drv_radeon
7713 $def_vidix_drv_rage128
7714 $def_vidix_drv_s3
7715 $def_vidix_drv_sh_veu
7716 $def_vidix_drv_sis
7717 $def_vidix_drv_unichrome
7718 $def_vidix_pfx
7719 $def_vm
7720 $def_wii
7721 $def_x11
7722 $def_xdpms
7723 $def_xf86keysym
7724 $def_xinerama
7725 $def_xmga
7726 $def_xss
7727 $def_xv
7728 $def_xvmc
7729 $def_xvr100
7730 $def_yuv4mpeg
7731 $def_zr
7734 /* FFmpeg */
7735 $def_ffmpeg
7736 $def_ffmpeg_eval_api
7737 $def_ffmpeg_internals
7739 #define CONFIG_DECODERS 1
7740 #define CONFIG_ENCODERS 1
7741 #define CONFIG_DEMUXERS 1
7743 $def_arpa_inet_h
7744 $def_bswap
7745 $def_bzlib
7746 $def_dcbzl
7747 $def_exp2
7748 $def_exp2f
7749 $def_fast_64bit
7750 $def_fast_unaligned
7751 $def_llrint
7752 $def_log2
7753 $def_log2f
7754 $def_lrint
7755 $def_memalign_hack
7756 $def_mlib
7757 $def_mkstemp
7758 $def_posix_memalign
7759 $def_pthreads
7760 $def_round
7761 $def_roundf
7762 $def_ten_operands
7763 $def_threads
7764 $def_truncf
7765 $def_xform_asm
7766 $def_yasm
7768 #define CONFIG_FASTDIV 0
7769 #define CONFIG_FFSERVER 0
7770 #define CONFIG_GPL 1
7771 #define CONFIG_GRAY 0
7772 #define CONFIG_HARDCODED_TABLES 0
7773 #define CONFIG_LIBVORBIS 0
7774 #define CONFIG_POWERPC_PERF 0
7775 #define CONFIG_SMALL 0
7776 #define CONFIG_SWSCALE_ALPHA 1
7778 #define HAVE_ATTRIBUTE_PACKED 1
7779 #define HAVE_GETHRTIME 0
7780 #define HAVE_INLINE_ASM 1
7781 #define HAVE_LDBRX 0
7782 #define HAVE_POLL_H 1
7783 #define HAVE_PPC4XX 0
7784 #define HAVE_VFP_ARGS 1
7785 #define HAVE_VIRTUALALLOC 0
7787 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
7788 #define CONFIG_AANDCT 1
7789 #define CONFIG_DCT 1
7790 #define CONFIG_DWT 1
7791 #define CONFIG_FFT 1
7792 #define CONFIG_GOLOMB 1
7793 #define CONFIG_H264DSP 1
7794 #define CONFIG_LPC 1
7795 #define CONFIG_MDCT 1
7796 #define CONFIG_RDFT 1
7798 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
7799 #ifndef MP_DEBUG
7800 #define HAVE_EBP_AVAILABLE 1
7801 #else
7802 #define HAVE_EBP_AVAILABLE 0
7803 #endif
7805 #endif /* MPLAYER_CONFIG_H */
7808 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
7809 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
7811 #############################################################################
7813 ./version.sh `$_cc -dumpversion`
7815 cat << EOF
7817 Config files successfully generated by ./configure $configuration !
7819 Install prefix: $_prefix
7820 Data directory: $_datadir
7821 Config direct.: $_confdir
7823 Byte order: $_byte_order
7824 Optimizing for: $_optimizing
7826 Languages:
7827 Messages (in addition to English): $language_msg
7828 Manual pages: $language_man
7829 Documentation: $language_doc
7831 Enabled optional drivers:
7832 Input: $inputmodules
7833 Codecs: $codecmodules
7834 Audio output: $aomodules
7835 Video output: $vomodules
7837 Disabled optional drivers:
7838 Input: $noinputmodules
7839 Codecs: $nocodecmodules
7840 Audio output: $noaomodules
7841 Video output: $novomodules
7843 'config.h' and 'config.mak' contain your configuration options.
7844 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7845 compile *** DO NOT REPORT BUGS if you tweak these files ***
7847 'make' will now compile MPlayer and 'make install' will install it.
7848 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7853 if test "$_mtrr" = yes ; then
7854 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$language_doc/video.html#mtrr)"
7855 echo
7858 if ! x86_32; then
7859 cat <<EOF
7860 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7861 operating system ($system_name). You may encounter a few files that cannot
7862 be played due to missing open source video/audio codec support.
7868 cat <<EOF
7869 Check $TMPLOG if you wonder why an autodetection failed (make sure
7870 development headers/packages are installed).
7872 NOTE: The --enable-* parameters unconditionally force options on, completely
7873 skipping autodetection. This behavior is unlike what you may be used to from
7874 autoconf-based configure scripts that can decide to override you. This greater
7875 level of control comes at a price. You may have to provide the correct compiler
7876 and linker flags yourself.
7877 If you used one of these options (except --enable-menu and similar ones that
7878 turn on internal features) and experience a compilation or linking failure,
7879 make sure you have passed the necessary compiler/linker flags to configure.
7881 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
7885 if test "$warn_cflags" = yes; then
7886 cat <<EOF
7888 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
7889 but:
7891 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
7893 It is strongly recommended to let MPlayer choose the correct CFLAGS!
7894 To do so, execute 'CFLAGS= ./configure <options>'
7899 # Last move:
7900 rm -rf "$mplayer_tmpdir"