configure: update documentation comments about adding checks
[mplayer.git] / configure
blob8916cedc6f9c0f6ea097f037d93fe17a3f85f401
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 $libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
53 rm -f "$TMPEXE"
54 $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -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 function_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 function_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-x264 disable x264 [autodetect]
340 --disable-libnut disable libnut [autodetect]
341 --disable-ffmpeg_a disable static FFmpeg [autodetect]
342 --disable-ffmpeg_so disable shared FFmpeg [autodetect]
343 --disable-tremor-internal disable internal Tremor [enabled]
344 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
345 --enable-tremor enable external Tremor [autodetect]
346 --disable-libvorbis disable libvorbis support [autodetect]
347 --disable-speex disable Speex support [autodetect]
348 --enable-theora enable OggTheora libraries [autodetect]
349 --enable-faad enable external FAAD2 (AAC) [autodetect]
350 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
351 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
352 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
353 --disable-ladspa disable LADSPA plugin support [autodetect]
354 --disable-libbs2b disable libbs2b audio filter support [autodetect]
355 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
356 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
357 --disable-mad disable libmad (MPEG audio) support [autodetect]
358 --disable-mp3lame disable LAME MP3 encoding support [autodetect]
359 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
360 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
361 --enable-xmms enable XMMS input plugin support [disabled]
362 --enable-libdca enable libdca support [autodetect]
363 --disable-mp3lib disable builtin mp3lib [autodetect]
364 --disable-liba52 disable liba52 [autodetect]
365 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
366 --disable-musepack disable musepack support [autodetect]
368 Video output:
369 --disable-vidix disable VIDIX [for x86 *nix]
370 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
371 Available: cyberblade, ivtv, mach64, mga, mga_crtc2,
372 nvidia, pm2, pm3, radeon, rage128, s3, sis, unichrome
373 --disable-vidix-pcidb disable VIDIX PCI device name database
374 --enable-dhahelper enable VIDIX dhahelper support
375 --enable-svgalib_helper enable VIDIX svgalib_helper support
376 --enable-gl enable OpenGL video output [autodetect]
377 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
378 --enable-dga2 enable DGA 2 support [autodetect]
379 --enable-dga1 enable DGA 1 support [autodetect]
380 --enable-vesa enable VESA video output [autodetect]
381 --enable-svga enable SVGAlib video output [autodetect]
382 --enable-sdl enable SDL video output [autodetect]
383 --enable-kva enable KVA video output [autodetect]
384 --enable-aa enable AAlib video output [autodetect]
385 --enable-caca enable CACA video output [autodetect]
386 --enable-ggi enable GGI video output [autodetect]
387 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
388 --enable-direct3d enable Direct3D video output [autodetect]
389 --enable-directx enable DirectX video output [autodetect]
390 --enable-dxr2 enable DXR2 video output [autodetect]
391 --enable-dxr3 enable DXR3/H+ video output [autodetect]
392 --enable-ivtv enable IVTV TV-Out video output [autodetect]
393 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
394 --enable-dvb enable DVB video output [autodetect]
395 --enable-mga enable mga_vid video output [autodetect]
396 --enable-xmga enable mga_vid X11 video output [autodetect]
397 --enable-xv enable Xv video output [autodetect]
398 --enable-xvmc enable XvMC acceleration [disable]
399 --enable-vdpau enable VDPAU acceleration [autodetect]
400 --enable-vm enable XF86VidMode support [autodetect]
401 --enable-xinerama enable Xinerama support [autodetect]
402 --enable-x11 enable X11 video output [autodetect]
403 --enable-xshape enable XShape support [autodetect]
404 --disable-xss disable screensaver support via xss [autodetect]
405 --enable-fbdev enable FBDev video output [autodetect]
406 --enable-mlib enable mediaLib video output (Solaris) [disable]
407 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
408 --enable-tdfxfb enable tdfxfb video output [disable]
409 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
410 --enable-wii enable Nintendo Wii/GameCube video output [disable]
411 --enable-directfb enable DirectFB video output [autodetect]
412 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
413 --enable-bl enable Blinkenlights video output [disable]
414 --enable-tdfxvid enable tdfx_vid video output [disable]
415 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
416 --disable-tga disable Targa video output [enable]
417 --disable-pnm disable PNM video output [enable]
418 --disable-md5sum disable md5sum video output [enable]
419 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
420 --disable-corevideo disable CoreVideo video output [autodetect]
421 --disable-quartz disable Quartz video output [autodetect]
423 Audio output:
424 --disable-alsa disable ALSA audio output [autodetect]
425 --disable-ossaudio disable OSS audio output [autodetect]
426 --disable-arts disable aRts audio output [autodetect]
427 --disable-esd disable esd audio output [autodetect]
428 --disable-pulse disable Pulseaudio audio output [autodetect]
429 --disable-jack disable JACK audio output [autodetect]
430 --enable-openal enable OpenAL audio output [disable]
431 --disable-nas disable NAS audio output [autodetect]
432 --disable-sgiaudio disable SGI audio output [autodetect]
433 --disable-sunaudio disable Sun audio output [autodetect]
434 --disable-kai disable KAI audio output [autodetect]
435 --disable-dart disable DART audio output [autodetect]
436 --disable-win32waveout disable Windows waveout audio output [autodetect]
437 --disable-coreaudio disable CoreAudio audio output [autodetect]
438 --disable-select disable using select() on the audio device [enable]
440 Language options:
441 --enable-translation enable support for translated output [disable]
442 --charset=charset convert the console messages to this character set
443 --language-doc=lang language to use for the documentation [en]
444 --language-man=lang language to use for the man pages [en]
445 --language-msg=lang extra languages for program messages [all]
446 --language=lang default language to use [en]
447 Specific options override --language. You can pass a list of languages separated
448 by whitespace or commas instead of a single language. Nonexisting translations
449 will be dropped from each list. All translations available in the list will be
450 installed. The value "all" will activate all translations. The LINGUAS
451 environment variable is honored. In all cases the fallback is English.
452 The program always supports English-language output; additional message
453 languages are only installed if --enable-translation is also specified.
454 Available values for --language-doc are: all $doc_lang_all
455 Available values for --language-man are: all $man_lang_all
456 Available values for --language-msg are: all $msg_lang_all
458 Miscellaneous options:
459 --enable-runtime-cpudetection enable runtime CPU detection [disable]
460 --enable-cross-compile enable cross-compilation [autodetect]
461 --cc=COMPILER C compiler to build MPlayer [gcc]
462 --host-cc=COMPILER C compiler for tools needed while building [gcc]
463 --as=ASSEMBLER assembler to build MPlayer [as]
464 --nm=NM nm tool to build MPlayer [nm]
465 --yasm=YASM Yasm assembler to build MPlayer [yasm]
466 --ar=AR librarian to build MPlayer [ar]
467 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
468 --windres=WINDRES windres to build MPlayer [windres]
469 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
470 --enable-static build a statically linked binary
471 --with-install=PATH path to a custom install program
473 Advanced options:
474 --enable-mmx enable MMX [autodetect]
475 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
476 --enable-3dnow enable 3DNow! [autodetect]
477 --enable-3dnowext enable extended 3DNow! [autodetect]
478 --enable-sse enable SSE [autodetect]
479 --enable-sse2 enable SSE2 [autodetect]
480 --enable-ssse3 enable SSSE3 [autodetect]
481 --enable-shm enable shm [autodetect]
482 --enable-altivec enable AltiVec (PowerPC) [autodetect]
483 --enable-armv5te enable DSP extensions (ARM) [autodetect]
484 --enable-armv6 enable ARMv6 (ARM) [autodetect]
485 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
486 --enable-armvfp enable ARM VFP (ARM) [autodetect]
487 --enable-neon enable NEON (ARM) [autodetect]
488 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
489 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
490 --enable-big-endian force byte order to big-endian [autodetect]
491 --enable-debug[=1-3] compile-in debugging information [disable]
492 --enable-profile compile-in profiling information [disable]
493 --disable-sighandler disable sighandler for crashes [enable]
494 --enable-crash-debug enable automatic gdb attach on crash [disable]
495 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
496 --ffmpeg-source-dir=PATH enable features requiring internal FFmpeg headers
498 Use these options if autodetection fails:
499 --extra-cflags=FLAGS extra CFLAGS
500 --extra-ldflags=FLAGS extra LDFLAGS
501 --extra-libs=FLAGS extra linker flags
502 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
503 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
505 --with-freetype-config=PATH path to freetype-config
506 --with-glib-config=PATH path to glib*-config
507 --with-gtk-config=PATH path to gtk*-config
508 --with-sdl-config=PATH path to sdl*-config
509 --with-dvdnav-config=PATH path to dvdnav-config
510 --with-dvdread-config=PATH path to dvdread-config
512 This configure script is NOT autoconf-based, even though its output is similar.
513 It will try to autodetect all configuration options. If you --enable an option
514 it will be forcefully turned on, skipping autodetection. This can break
515 compilation, so you need to know what you are doing.
517 exit 0
518 } #show_help()
520 # GOTCHA: the variables below defines the default behavior for autodetection
521 # and have - unless stated otherwise - at least 2 states : yes no
522 # If autodetection is available then the third state is: auto
523 _mmx=auto
524 _3dnow=auto
525 _3dnowext=auto
526 _mmxext=auto
527 _sse=auto
528 _sse2=auto
529 _ssse3=auto
530 _cmov=auto
531 _fast_cmov=auto
532 _fast_clz=auto
533 _armv5te=auto
534 _armv6=auto
535 _armv6t2=auto
536 _armvfp=auto
537 neon=auto
538 _iwmmxt=auto
539 _mtrr=auto
540 _altivec=auto
541 _install=install
542 _ranlib=ranlib
543 _windres=windres
544 _cc=cc
545 _ar=ar
546 test "$CC" && _cc="$CC"
547 _as=auto
548 _nm=auto
549 _yasm=yasm
550 _runtime_cpudetection=no
551 _cross_compile=auto
552 _prefix="/usr/local"
553 ffmpeg=auto
554 ffmpeg_internals=no
555 _mencoder=no
556 _mplayer=yes
557 _x11=auto
558 _xshape=auto
559 _xss=auto
560 _dga1=auto
561 _dga2=auto
562 _xv=auto
563 _xvmc=no #auto when complete
564 _vdpau=auto
565 _sdl=auto
566 _kva=auto
567 _direct3d=auto
568 _directx=auto
569 _win32waveout=auto
570 _nas=auto
571 _png=auto
572 _mng=auto
573 _jpeg=auto
574 _pnm=yes
575 _md5sum=yes
576 _yuv4mpeg=yes
577 _gif=auto
578 _gl=auto
579 matrixview=yes
580 _ggi=auto
581 _ggiwmh=auto
582 _aa=auto
583 _caca=auto
584 _svga=auto
585 _vesa=auto
586 _fbdev=auto
587 _dvb=auto
588 _dxr2=auto
589 _dxr3=auto
590 _ivtv=auto
591 _v4l2=auto
592 _iconv=auto
593 _langinfo=auto
594 _rtc=auto
595 _ossaudio=auto
596 _arts=auto
597 _esd=auto
598 _pulse=auto
599 _jack=auto
600 _kai=auto
601 _dart=auto
602 _openal=no
603 _libcdio=auto
604 _liblzo=auto
605 _mad=auto
606 _mp3lame=auto
607 _toolame=auto
608 _twolame=auto
609 _tremor=auto
610 _tremor_internal=yes
611 _tremor_low=no
612 _libvorbis=auto
613 _speex=auto
614 _theora=auto
615 _mpg123=auto
616 _mp3lib=auto
617 _liba52=auto
618 _libdca=auto
619 _libmpeg2=auto
620 _faad=auto
621 _faad_internal=auto
622 _faad_fixed=no
623 _faac=auto
624 _ladspa=auto
625 _libbs2b=auto
626 _xmms=no
627 _vcd=auto
628 _bluray=auto
629 _dvdnav=auto
630 _dvdnavconfig=dvdnav-config
631 _dvdreadconfig=dvdread-config
632 _dvdread=auto
633 _dvdread_internal=auto
634 _libdvdcss_internal=auto
635 _xanim=auto
636 _real=auto
637 _live=auto
638 _nemesi=auto
639 _native_rtsp=yes
640 _xinerama=auto
641 _mga=auto
642 _xmga=auto
643 _vm=auto
644 _xf86keysym=auto
645 _mlib=no #broken, thus disabled
646 _sgiaudio=auto
647 _sunaudio=auto
648 _alsa=auto
649 _fastmemcpy=yes
650 _unrar_exec=auto
651 _win32dll=auto
652 _select=yes
653 _radio=no
654 _radio_capture=no
655 _radio_v4l=auto
656 _radio_v4l2=auto
657 _radio_bsdbt848=auto
658 _tv=yes
659 _tv_v4l1=auto
660 _tv_v4l2=auto
661 _tv_bsdbt848=auto
662 _tv_dshow=auto
663 _pvr=auto
664 networking=yes
665 _winsock2_h=auto
666 _smb=auto
667 _vidix=auto
668 _vidix_pcidb=yes
669 _dhahelper=no
670 _svgalib_helper=no
671 _joystick=no
672 _xvid=auto
673 _x264=auto
674 _libnut=auto
675 _lirc=auto
676 _lircc=auto
677 _apple_remote=auto
678 _apple_ir=auto
679 _gui=no
680 _gtk1=no
681 _termcap=auto
682 _termios=auto
683 _3dfx=no
684 _s3fb=no
685 _wii=no
686 _tdfxfb=no
687 _tdfxvid=no
688 _xvr100=auto
689 _tga=yes
690 _directfb=auto
691 _zr=auto
692 _bl=no
693 _largefiles=yes
694 #language=en
695 _shm=auto
696 _translation=no
697 _charset="UTF-8"
698 _dynamic_plugins=no
699 _crash_debug=no
700 _sighandler=yes
701 _libdv=auto
702 _cdparanoia=auto
703 _cddb=auto
704 _big_endian=auto
705 _bitmap_font=yes
706 _freetype=auto
707 _fontconfig=auto
708 _menu=no
709 _qtx=auto
710 _maemo=auto
711 _coreaudio=auto
712 _corevideo=auto
713 _quartz=auto
714 quicktime=auto
715 _macosx_finder=no
716 _macosx_bundle=auto
717 _sortsub=yes
718 _freetypeconfig='freetype-config'
719 _fribidi=auto
720 _enca=auto
721 _inet6=auto
722 _gethostbyname2=auto
723 _ftp=auto
724 _musepack=auto
725 _vstream=auto
726 _pthreads=auto
727 _w32threads=auto
728 _ass=auto
729 _rpath=no
730 _asmalign_pot=auto
731 _stream_cache=yes
732 _priority=no
733 def_dos_paths="#define HAVE_DOS_PATHS 0"
734 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
735 def_priority="#undef CONFIG_PRIORITY"
736 def_pthread_cache="#undef PTHREAD_CACHE"
737 _need_shmem=yes
738 for ac_option do
739 case "$ac_option" in
740 --help|-help|-h)
741 show_help
743 --prefix=*)
744 _prefix=$(echo $ac_option | cut -d '=' -f 2)
746 --bindir=*)
747 _bindir=$(echo $ac_option | cut -d '=' -f 2)
749 --datadir=*)
750 _datadir=$(echo $ac_option | cut -d '=' -f 2)
752 --mandir=*)
753 _mandir=$(echo $ac_option | cut -d '=' -f 2)
755 --confdir=*)
756 _confdir=$(echo $ac_option | cut -d '=' -f 2)
758 --libdir=*)
759 _libdir=$(echo $ac_option | cut -d '=' -f 2)
761 --codecsdir=*)
762 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
764 --localedir=*)
765 _localedir=$(echo $ac_option | cut -d '=' -f 2)
768 --with-install=*)
769 _install=$(echo $ac_option | cut -d '=' -f 2 )
771 --with-xvmclib=*)
772 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
775 --with-sdl-config=*)
776 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
778 --with-freetype-config=*)
779 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
781 --with-gtk-config=*)
782 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
784 --with-glib-config=*)
785 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
787 --with-dvdnav-config=*)
788 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
790 --with-dvdread-config=*)
791 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
794 --extra-cflags=*)
795 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
797 --extra-ldflags=*)
798 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
800 --extra-libs=*)
801 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
803 --extra-libs-mplayer=*)
804 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
807 --target=*)
808 _target=$(echo $ac_option | cut -d '=' -f 2)
810 --cc=*)
811 _cc=$(echo $ac_option | cut -d '=' -f 2)
813 --host-cc=*)
814 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
816 --as=*)
817 _as=$(echo $ac_option | cut -d '=' -f 2)
819 --nm=*)
820 _nm=$(echo $ac_option | cut -d '=' -f 2)
822 --yasm=*)
823 _yasm=$(echo $ac_option | cut -d '=' -f 2)
825 --ar=*)
826 _ar=$(echo $ac_option | cut -d '=' -f 2)
828 --ranlib=*)
829 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
831 --windres=*)
832 _windres=$(echo $ac_option | cut -d '=' -f 2)
834 --charset=*)
835 _charset=$(echo $ac_option | cut -d '=' -f 2)
837 --language-doc=*)
838 language_doc=$(echo $ac_option | cut -d '=' -f 2)
840 --language-man=*)
841 language_man=$(echo $ac_option | cut -d '=' -f 2)
843 --language-msg=*)
844 language_msg=$(echo $ac_option | cut -d '=' -f 2)
846 --language=*)
847 language=$(echo $ac_option | cut -d '=' -f 2)
850 --enable-static)
851 _ld_static='-static'
853 --disable-static)
854 _ld_static=''
856 --enable-profile)
857 _profile='-p'
859 --disable-profile)
860 _profile=
862 --enable-debug)
863 _debug='-g'
865 --enable-debug=*)
866 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
868 --disable-debug)
869 _debug=
871 --enable-translation) _translation=yes ;;
872 --disable-translation) _translation=no ;;
873 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
874 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
875 --enable-cross-compile) _cross_compile=yes ;;
876 --disable-cross-compile) _cross_compile=no ;;
877 --enable-mplayer) _mplayer=yes ;;
878 --disable-mplayer) _mplayer=no ;;
879 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
880 --disable-dynamic-plugins) _dynamic_plugins=no ;;
881 --enable-x11) _x11=yes ;;
882 --disable-x11) _x11=no ;;
883 --enable-xshape) _xshape=yes ;;
884 --disable-xshape) _xshape=no ;;
885 --enable-xss) _xss=yes ;;
886 --disable-xss) _xss=no ;;
887 --enable-xv) _xv=yes ;;
888 --disable-xv) _xv=no ;;
889 --enable-xvmc) _xvmc=yes ;;
890 --disable-xvmc) _xvmc=no ;;
891 --enable-vdpau) _vdpau=yes ;;
892 --disable-vdpau) _vdpau=no ;;
893 --enable-sdl) _sdl=yes ;;
894 --disable-sdl) _sdl=no ;;
895 --enable-kva) _kva=yes ;;
896 --disable-kva) _kva=no ;;
897 --enable-direct3d) _direct3d=yes ;;
898 --disable-direct3d) _direct3d=no ;;
899 --enable-directx) _directx=yes ;;
900 --disable-directx) _directx=no ;;
901 --enable-win32waveout) _win32waveout=yes ;;
902 --disable-win32waveout) _win32waveout=no ;;
903 --enable-nas) _nas=yes ;;
904 --disable-nas) _nas=no ;;
905 --enable-png) _png=yes ;;
906 --disable-png) _png=no ;;
907 --enable-mng) _mng=yes ;;
908 --disable-mng) _mng=no ;;
909 --enable-jpeg) _jpeg=yes ;;
910 --disable-jpeg) _jpeg=no ;;
911 --enable-pnm) _pnm=yes ;;
912 --disable-pnm) _pnm=no ;;
913 --enable-md5sum) _md5sum=yes ;;
914 --disable-md5sum) _md5sum=no ;;
915 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
916 --disable-yuv4mpeg) _yuv4mpeg=no ;;
917 --enable-gif) _gif=yes ;;
918 --disable-gif) _gif=no ;;
919 --enable-gl) _gl=yes ;;
920 --disable-gl) _gl=no ;;
921 --enable-matrixview) matrixview=yes ;;
922 --disable-matrixview) matrixview=no ;;
923 --enable-ggi) _ggi=yes ;;
924 --disable-ggi) _ggi=no ;;
925 --enable-ggiwmh) _ggiwmh=yes ;;
926 --disable-ggiwmh) _ggiwmh=no ;;
927 --enable-aa) _aa=yes ;;
928 --disable-aa) _aa=no ;;
929 --enable-caca) _caca=yes ;;
930 --disable-caca) _caca=no ;;
931 --enable-svga) _svga=yes ;;
932 --disable-svga) _svga=no ;;
933 --enable-vesa) _vesa=yes ;;
934 --disable-vesa) _vesa=no ;;
935 --enable-fbdev) _fbdev=yes ;;
936 --disable-fbdev) _fbdev=no ;;
937 --enable-dvb) _dvb=yes ;;
938 --disable-dvb) _dvb=no ;;
939 --enable-dxr2) _dxr2=yes ;;
940 --disable-dxr2) _dxr2=no ;;
941 --enable-dxr3) _dxr3=yes ;;
942 --disable-dxr3) _dxr3=no ;;
943 --enable-ivtv) _ivtv=yes ;;
944 --disable-ivtv) _ivtv=no ;;
945 --enable-v4l2) _v4l2=yes ;;
946 --disable-v4l2) _v4l2=no ;;
947 --enable-iconv) _iconv=yes ;;
948 --disable-iconv) _iconv=no ;;
949 --enable-langinfo) _langinfo=yes ;;
950 --disable-langinfo) _langinfo=no ;;
951 --enable-rtc) _rtc=yes ;;
952 --disable-rtc) _rtc=no ;;
953 --enable-libdv) _libdv=yes ;;
954 --disable-libdv) _libdv=no ;;
955 --enable-ossaudio) _ossaudio=yes ;;
956 --disable-ossaudio) _ossaudio=no ;;
957 --enable-arts) _arts=yes ;;
958 --disable-arts) _arts=no ;;
959 --enable-esd) _esd=yes ;;
960 --disable-esd) _esd=no ;;
961 --enable-pulse) _pulse=yes ;;
962 --disable-pulse) _pulse=no ;;
963 --enable-jack) _jack=yes ;;
964 --disable-jack) _jack=no ;;
965 --enable-openal) _openal=yes ;;
966 --disable-openal) _openal=no ;;
967 --enable-kai) _kai=yes ;;
968 --disable-kai) _kai=no ;;
969 --enable-dart) _dart=yes ;;
970 --disable-dart) _dart=no ;;
971 --enable-mad) _mad=yes ;;
972 --disable-mad) _mad=no ;;
973 --enable-mp3lame) _mp3lame=yes ;;
974 --disable-mp3lame) _mp3lame=no ;;
975 --enable-toolame) _toolame=yes ;;
976 --disable-toolame) _toolame=no ;;
977 --enable-twolame) _twolame=yes ;;
978 --disable-twolame) _twolame=no ;;
979 --enable-libcdio) _libcdio=yes ;;
980 --disable-libcdio) _libcdio=no ;;
981 --enable-liblzo) _liblzo=yes ;;
982 --disable-liblzo) _liblzo=no ;;
983 --enable-libvorbis) _libvorbis=yes ;;
984 --disable-libvorbis) _libvorbis=no ;;
985 --enable-speex) _speex=yes ;;
986 --disable-speex) _speex=no ;;
987 --enable-tremor) _tremor=yes ;;
988 --disable-tremor) _tremor=no ;;
989 --enable-tremor-internal) _tremor_internal=yes ;;
990 --disable-tremor-internal) _tremor_internal=no ;;
991 --enable-tremor-low) _tremor_low=yes ;;
992 --disable-tremor-low) _tremor_low=no ;;
993 --enable-theora) _theora=yes ;;
994 --disable-theora) _theora=no ;;
995 --enable-mpg123) _mpg123=yes ;;
996 --disable-mpg123) _mpg123=no ;;
997 --enable-mp3lib) _mp3lib=yes ;;
998 --disable-mp3lib) _mp3lib=no ;;
999 --enable-liba52) _liba52=yes ;;
1000 --disable-liba52) _liba52=no ;;
1001 --enable-libdca) _libdca=yes ;;
1002 --disable-libdca) _libdca=no ;;
1003 --enable-libmpeg2) _libmpeg2=yes ;;
1004 --disable-libmpeg2) _libmpeg2=no ;;
1005 --enable-musepack) _musepack=yes ;;
1006 --disable-musepack) _musepack=no ;;
1007 --enable-faad) _faad=yes ;;
1008 --disable-faad) _faad=no ;;
1009 --enable-faad-internal) _faad_internal=yes ;;
1010 --disable-faad-internal) _faad_internal=no ;;
1011 --enable-faad-fixed) _faad_fixed=yes ;;
1012 --disable-faad-fixed) _faad_fixed=no ;;
1013 --enable-faac) _faac=yes ;;
1014 --disable-faac) _faac=no ;;
1015 --enable-ladspa) _ladspa=yes ;;
1016 --disable-ladspa) _ladspa=no ;;
1017 --enable-libbs2b) _libbs2b=yes ;;
1018 --disable-libbs2b) _libbs2b=no ;;
1019 --enable-xmms) _xmms=yes ;;
1020 --disable-xmms) _xmms=no ;;
1021 --enable-vcd) _vcd=yes ;;
1022 --disable-vcd) _vcd=no ;;
1023 --enable-bluray) _bluray=yes ;;
1024 --disable-bluray) _bluray=no ;;
1025 --enable-dvdread) _dvdread=yes ;;
1026 --disable-dvdread) _dvdread=no ;;
1027 --enable-dvdread-internal) _dvdread_internal=yes ;;
1028 --disable-dvdread-internal) _dvdread_internal=no ;;
1029 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1030 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1031 --enable-dvdnav) _dvdnav=yes ;;
1032 --disable-dvdnav) _dvdnav=no ;;
1033 --enable-xanim) _xanim=yes ;;
1034 --disable-xanim) _xanim=no ;;
1035 --enable-real) _real=yes ;;
1036 --disable-real) _real=no ;;
1037 --enable-live) _live=yes ;;
1038 --disable-live) _live=no ;;
1039 --enable-nemesi) _nemesi=yes ;;
1040 --disable-nemesi) _nemesi=no ;;
1041 --enable-xinerama) _xinerama=yes ;;
1042 --disable-xinerama) _xinerama=no ;;
1043 --enable-mga) _mga=yes ;;
1044 --disable-mga) _mga=no ;;
1045 --enable-xmga) _xmga=yes ;;
1046 --disable-xmga) _xmga=no ;;
1047 --enable-vm) _vm=yes ;;
1048 --disable-vm) _vm=no ;;
1049 --enable-xf86keysym) _xf86keysym=yes ;;
1050 --disable-xf86keysym) _xf86keysym=no ;;
1051 --enable-mlib) _mlib=yes ;;
1052 --disable-mlib) _mlib=no ;;
1053 --enable-sunaudio) _sunaudio=yes ;;
1054 --disable-sunaudio) _sunaudio=no ;;
1055 --enable-sgiaudio) _sgiaudio=yes ;;
1056 --disable-sgiaudio) _sgiaudio=no ;;
1057 --enable-alsa) _alsa=yes ;;
1058 --disable-alsa) _alsa=no ;;
1059 --enable-tv) _tv=yes ;;
1060 --disable-tv) _tv=no ;;
1061 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1062 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1063 --enable-tv-v4l1) _tv_v4l1=yes ;;
1064 --disable-tv-v4l1) _tv_v4l1=no ;;
1065 --enable-tv-v4l2) _tv_v4l2=yes ;;
1066 --disable-tv-v4l2) _tv_v4l2=no ;;
1067 --enable-tv-dshow) _tv_dshow=yes ;;
1068 --disable-tv-dshow) _tv_dshow=no ;;
1069 --enable-radio) _radio=yes ;;
1070 --enable-radio-capture) _radio_capture=yes ;;
1071 --disable-radio-capture) _radio_capture=no ;;
1072 --disable-radio) _radio=no ;;
1073 --enable-radio-v4l) _radio_v4l=yes ;;
1074 --disable-radio-v4l) _radio_v4l=no ;;
1075 --enable-radio-v4l2) _radio_v4l2=yes ;;
1076 --disable-radio-v4l2) _radio_v4l2=no ;;
1077 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1078 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1079 --enable-pvr) _pvr=yes ;;
1080 --disable-pvr) _pvr=no ;;
1081 --enable-fastmemcpy) _fastmemcpy=yes ;;
1082 --disable-fastmemcpy) _fastmemcpy=no ;;
1083 --enable-networking) networking=yes ;;
1084 --disable-networking) networking=no ;;
1085 --enable-winsock2_h) _winsock2_h=yes ;;
1086 --disable-winsock2_h) _winsock2_h=no ;;
1087 --enable-smb) _smb=yes ;;
1088 --disable-smb) _smb=no ;;
1089 --enable-vidix) _vidix=yes ;;
1090 --disable-vidix) _vidix=no ;;
1091 --with-vidix-drivers=*)
1092 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1094 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1095 --enable-dhahelper) _dhahelper=yes ;;
1096 --disable-dhahelper) _dhahelper=no ;;
1097 --enable-svgalib_helper) _svgalib_helper=yes ;;
1098 --disable-svgalib_helper) _svgalib_helper=no ;;
1099 --enable-joystick) _joystick=yes ;;
1100 --disable-joystick) _joystick=no ;;
1101 --enable-xvid) _xvid=yes ;;
1102 --disable-xvid) _xvid=no ;;
1103 --enable-x264) _x264=yes ;;
1104 --disable-x264) _x264=no ;;
1105 --enable-libnut) _libnut=yes ;;
1106 --disable-libnut) _libnut=no ;;
1107 --enable-ffmpeg) ffmpeg=yes ;;
1108 --disable-ffmpeg) ffmpeg=no ;;
1109 --ffmpeg-source-dir=*)
1110 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1112 --enable-lirc) _lirc=yes ;;
1113 --disable-lirc) _lirc=no ;;
1114 --enable-lircc) _lircc=yes ;;
1115 --disable-lircc) _lircc=no ;;
1116 --enable-apple-remote) _apple_remote=yes ;;
1117 --disable-apple-remote) _apple_remote=no ;;
1118 --enable-apple-ir) _apple_ir=yes ;;
1119 --disable-apple-ir) _apple_ir=no ;;
1120 --enable-gui) _gui=yes ;;
1121 --disable-gui) _gui=no ;;
1122 --enable-gtk1) _gtk1=yes ;;
1123 --disable-gtk1) _gtk1=no ;;
1124 --enable-termcap) _termcap=yes ;;
1125 --disable-termcap) _termcap=no ;;
1126 --enable-termios) _termios=yes ;;
1127 --disable-termios) _termios=no ;;
1128 --enable-3dfx) _3dfx=yes ;;
1129 --disable-3dfx) _3dfx=no ;;
1130 --enable-s3fb) _s3fb=yes ;;
1131 --disable-s3fb) _s3fb=no ;;
1132 --enable-wii) _wii=yes ;;
1133 --disable-wii) _wii=no ;;
1134 --enable-tdfxfb) _tdfxfb=yes ;;
1135 --disable-tdfxfb) _tdfxfb=no ;;
1136 --disable-tdfxvid) _tdfxvid=no ;;
1137 --enable-tdfxvid) _tdfxvid=yes ;;
1138 --disable-xvr100) _xvr100=no ;;
1139 --enable-xvr100) _xvr100=yes ;;
1140 --disable-tga) _tga=no ;;
1141 --enable-tga) _tga=yes ;;
1142 --enable-directfb) _directfb=yes ;;
1143 --disable-directfb) _directfb=no ;;
1144 --enable-zr) _zr=yes ;;
1145 --disable-zr) _zr=no ;;
1146 --enable-bl) _bl=yes ;;
1147 --disable-bl) _bl=no ;;
1148 --enable-mtrr) _mtrr=yes ;;
1149 --disable-mtrr) _mtrr=no ;;
1150 --enable-largefiles) _largefiles=yes ;;
1151 --disable-largefiles) _largefiles=no ;;
1152 --enable-shm) _shm=yes ;;
1153 --disable-shm) _shm=no ;;
1154 --enable-select) _select=yes ;;
1155 --disable-select) _select=no ;;
1156 --enable-cdparanoia) _cdparanoia=yes ;;
1157 --disable-cdparanoia) _cdparanoia=no ;;
1158 --enable-cddb) _cddb=yes ;;
1159 --disable-cddb) _cddb=no ;;
1160 --enable-big-endian) _big_endian=yes ;;
1161 --disable-big-endian) _big_endian=no ;;
1162 --enable-bitmap-font) _bitmap_font=yes ;;
1163 --disable-bitmap-font) _bitmap_font=no ;;
1164 --enable-freetype) _freetype=yes ;;
1165 --disable-freetype) _freetype=no ;;
1166 --enable-fontconfig) _fontconfig=yes ;;
1167 --disable-fontconfig) _fontconfig=no ;;
1168 --enable-unrarexec) _unrar_exec=yes ;;
1169 --disable-unrarexec) _unrar_exec=no ;;
1170 --enable-ftp) _ftp=yes ;;
1171 --disable-ftp) _ftp=no ;;
1172 --enable-vstream) _vstream=yes ;;
1173 --disable-vstream) _vstream=no ;;
1174 --enable-pthreads) _pthreads=yes ;;
1175 --disable-pthreads) _pthreads=no ;;
1176 --enable-w32threads) _w32threads=yes ;;
1177 --disable-w32threads) _w32threads=no ;;
1178 --enable-ass) _ass=yes ;;
1179 --disable-ass) _ass=no ;;
1180 --enable-rpath) _rpath=yes ;;
1181 --disable-rpath) _rpath=no ;;
1183 --enable-fribidi) _fribidi=yes ;;
1184 --disable-fribidi) _fribidi=no ;;
1186 --enable-enca) _enca=yes ;;
1187 --disable-enca) _enca=no ;;
1189 --enable-inet6) _inet6=yes ;;
1190 --disable-inet6) _inet6=no ;;
1192 --enable-gethostbyname2) _gethostbyname2=yes ;;
1193 --disable-gethostbyname2) _gethostbyname2=no ;;
1195 --enable-dga1) _dga1=yes ;;
1196 --disable-dga1) _dga1=no ;;
1197 --enable-dga2) _dga2=yes ;;
1198 --disable-dga2) _dga2=no ;;
1200 --enable-menu) _menu=yes ;;
1201 --disable-menu) _menu=no ;;
1203 --enable-qtx) _qtx=yes ;;
1204 --disable-qtx) _qtx=no ;;
1206 --enable-coreaudio) _coreaudio=yes ;;
1207 --disable-coreaudio) _coreaudio=no ;;
1208 --enable-corevideo) _corevideo=yes ;;
1209 --disable-corevideo) _corevideo=no ;;
1210 --enable-quartz) _quartz=yes ;;
1211 --disable-quartz) _quartz=no ;;
1212 --enable-macosx-finder) _macosx_finder=yes ;;
1213 --disable-macosx-finder) _macosx_finder=no ;;
1214 --enable-macosx-bundle) _macosx_bundle=yes ;;
1215 --disable-macosx-bundle) _macosx_bundle=no ;;
1217 --enable-maemo) _maemo=yes ;;
1218 --disable-maemo) _maemo=no ;;
1220 --enable-sortsub) _sortsub=yes ;;
1221 --disable-sortsub) _sortsub=no ;;
1223 --enable-crash-debug) _crash_debug=yes ;;
1224 --disable-crash-debug) _crash_debug=no ;;
1225 --enable-sighandler) _sighandler=yes ;;
1226 --disable-sighandler) _sighandler=no ;;
1227 --enable-win32dll) _win32dll=yes ;;
1228 --disable-win32dll) _win32dll=no ;;
1230 --enable-sse) _sse=yes ;;
1231 --disable-sse) _sse=no ;;
1232 --enable-sse2) _sse2=yes ;;
1233 --disable-sse2) _sse2=no ;;
1234 --enable-ssse3) _ssse3=yes ;;
1235 --disable-ssse3) _ssse3=no ;;
1236 --enable-mmxext) _mmxext=yes ;;
1237 --disable-mmxext) _mmxext=no ;;
1238 --enable-3dnow) _3dnow=yes ;;
1239 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1240 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1241 --disable-3dnowext) _3dnowext=no ;;
1242 --enable-cmov) _cmov=yes ;;
1243 --disable-cmov) _cmov=no ;;
1244 --enable-fast-cmov) _fast_cmov=yes ;;
1245 --disable-fast-cmov) _fast_cmov=no ;;
1246 --enable-fast-clz) _fast_clz=yes ;;
1247 --disable-fast-clz) _fast_clz=no ;;
1248 --enable-altivec) _altivec=yes ;;
1249 --disable-altivec) _altivec=no ;;
1250 --enable-armv5te) _armv5te=yes ;;
1251 --disable-armv5te) _armv5te=no ;;
1252 --enable-armv6) _armv6=yes ;;
1253 --disable-armv6) _armv6=no ;;
1254 --enable-armv6t2) _armv6t2=yes ;;
1255 --disable-armv6t2) _armv6t2=no ;;
1256 --enable-armvfp) _armvfp=yes ;;
1257 --disable-armvfp) _armvfp=no ;;
1258 --enable-neon) neon=yes ;;
1259 --disable-neon) neon=no ;;
1260 --enable-iwmmxt) _iwmmxt=yes ;;
1261 --disable-iwmmxt) _iwmmxt=no ;;
1262 --enable-mmx) _mmx=yes ;;
1263 --disable-mmx) # 3Dnow! and MMX2 require MMX
1264 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1267 echo "Unknown parameter: $ac_option"
1268 exit 1
1271 esac
1272 done
1274 if test "$_gui" = yes ; then
1275 die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
1276 (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
1279 # Atmos: moved this here, to be correct, if --prefix is specified
1280 test -z "$_bindir" && _bindir="$_prefix/bin"
1281 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1282 test -z "$_mandir" && _mandir="$_prefix/share/man"
1283 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1284 test -z "$_libdir" && _libdir="$_prefix/lib"
1285 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1287 # Determine our OS name and CPU architecture
1288 if test -z "$_target" ; then
1289 # OS name
1290 system_name=$(uname -s 2>&1)
1291 case "$system_name" in
1292 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1294 Haiku)
1295 system_name=BeOS
1297 IRIX*)
1298 system_name=IRIX
1300 GNU/kFreeBSD)
1301 system_name=FreeBSD
1303 HP-UX*)
1304 system_name=HP-UX
1306 [cC][yY][gG][wW][iI][nN]*)
1307 system_name=CYGWIN
1309 MINGW32*)
1310 system_name=MINGW32
1312 OS/2*)
1313 system_name=OS/2
1316 system_name="$system_name-UNKNOWN"
1318 esac
1321 # host's CPU/instruction set
1322 host_arch=$(uname -p 2>&1)
1323 case "$host_arch" in
1324 i386|sparc|ppc|alpha|arm|mips|vax)
1326 powerpc) # Darwin returns 'powerpc'
1327 host_arch=ppc
1329 *) # uname -p on Linux returns 'unknown' for the processor type,
1330 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1332 # Maybe uname -m (machine hardware name) returns something we
1333 # recognize.
1335 # x86/x86pc is used by QNX
1336 case "$(uname -m 2>&1)" in
1337 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 ;;
1338 ia64) host_arch=ia64 ;;
1339 macppc|ppc) host_arch=ppc ;;
1340 ppc64) host_arch=ppc64 ;;
1341 alpha) host_arch=alpha ;;
1342 sparc) host_arch=sparc ;;
1343 sparc64) host_arch=sparc64 ;;
1344 parisc*|hppa*|9000*) host_arch=hppa ;;
1345 arm*|zaurus|cats) host_arch=arm ;;
1346 sh3|sh4|sh4a) host_arch=sh ;;
1347 s390) host_arch=s390 ;;
1348 s390x) host_arch=s390x ;;
1349 *mips*) host_arch=mips ;;
1350 vax) host_arch=vax ;;
1351 xtensa*) host_arch=xtensa ;;
1352 *) host_arch=UNKNOWN ;;
1353 esac
1355 esac
1356 else # if test -z "$_target"
1357 system_name=$(echo $_target | cut -d '-' -f 2)
1358 case "$(echo $system_name | tr A-Z a-z)" in
1359 linux) system_name=Linux ;;
1360 freebsd) system_name=FreeBSD ;;
1361 gnu/kfreebsd) system_name=FreeBSD ;;
1362 netbsd) system_name=NetBSD ;;
1363 bsd/os) system_name=BSD/OS ;;
1364 openbsd) system_name=OpenBSD ;;
1365 dragonfly) system_name=DragonFly ;;
1366 sunos) system_name=SunOS ;;
1367 qnx) system_name=QNX ;;
1368 morphos) system_name=MorphOS ;;
1369 amigaos) system_name=AmigaOS ;;
1370 mingw32*) system_name=MINGW32 ;;
1371 esac
1372 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1373 host_arch=$(echo $_target | cut -d '-' -f 1)
1374 if test $(echo $host_arch) != "x86_64" ; then
1375 host_arch=$(echo $host_arch | tr '_' '-')
1379 extra_cflags="-I. $extra_cflags"
1380 _timer=timer-linux.c
1381 _getch=getch2.c
1382 if freebsd ; then
1383 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1384 extra_cflags="$extra_cflags -I/usr/local/include"
1387 if netbsd || dragonfly ; then
1388 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1389 extra_cflags="$extra_cflags -I/usr/pkg/include"
1392 if darwin; then
1393 extra_cflags="-mdynamic-no-pic $extra_cflags"
1394 if test "$(basename $_cc)" != "clang" ; then
1395 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
1397 _timer=timer-darwin.c
1400 if aix ; then
1401 extra_ldflags="$extra_ldflags -lC"
1404 if irix ; then
1405 _ranlib='ar -r'
1406 elif linux ; then
1407 _ranlib='true'
1410 if win32 ; then
1411 _exesuf=".exe"
1412 extra_cflags="$extra_cflags -fno-common"
1413 # -lwinmm is always needed for osdep/timer-win2.c
1414 extra_ldflags="$extra_ldflags -lwinmm"
1415 _pe_executable=yes
1416 _timer=timer-win2.c
1417 _priority=yes
1418 def_dos_paths="#define HAVE_DOS_PATHS 1"
1419 def_priority="#define CONFIG_PRIORITY 1"
1422 if mingw32 ; then
1423 _getch=getch2-win.c
1424 _need_shmem=no
1427 if amigaos ; then
1428 _select=no
1429 _sighandler=no
1430 _stream_cache=no
1431 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1432 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1435 if qnx ; then
1436 extra_ldflags="$extra_ldflags -lph"
1439 if os2 ; then
1440 _exesuf=".exe"
1441 _getch=getch2-os2.c
1442 _need_shmem=no
1443 _priority=yes
1444 def_dos_paths="#define HAVE_DOS_PATHS 1"
1445 def_priority="#define CONFIG_PRIORITY 1"
1448 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1449 test "$tmpdir" && break
1450 done
1452 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1453 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1455 TMPLOG="config.log"
1456 TMPC="$mplayer_tmpdir/tmp.c"
1457 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1458 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1459 TMPH="$mplayer_tmpdir/tmp.h"
1460 TMPS="$mplayer_tmpdir/tmp.S"
1462 rm -f "$TMPLOG"
1463 echo configuration: $configuration > "$TMPLOG"
1464 echo >> "$TMPLOG"
1467 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1468 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1472 # Checking CC version...
1473 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1474 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1475 echocheck "$_cc version"
1476 cc_vendor=intel
1477 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1478 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1479 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1480 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1481 # TODO verify older icc/ecc compatibility
1482 case $cc_version in
1484 cc_version="v. ?.??, bad"
1485 cc_fail=yes
1487 10.1|11.0|11.1)
1488 cc_version="$cc_version, ok"
1491 cc_version="$cc_version, bad"
1492 cc_fail=yes
1494 esac
1495 echores "$cc_version"
1496 else
1497 for _cc in "$_cc" gcc cc ; do
1498 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1499 if test "$cc_name_tmp" = "gcc"; then
1500 cc_name=$cc_name_tmp
1501 echocheck "$_cc version"
1502 cc_vendor=gnu
1503 cc_version=$($_cc -dumpversion 2>&1)
1504 case $cc_version in
1505 2.96*)
1506 cc_fail=yes
1509 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1510 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1511 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1513 esac
1514 echores "$cc_version"
1515 break
1517 cc_name_tmp=$($_cc -v 2>&1 | head -n 1 | cut -d ' ' -f 1)
1518 if test "$cc_name_tmp" = "clang"; then
1519 echocheck "$_cc version"
1520 cc_vendor=clang
1521 cc_version=$($_cc -dumpversion 2>&1)
1522 res_comment="experimental support only"
1523 echores "clang $cc_version"
1524 break
1526 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1527 if test "$cc_name_tmp" = "Sun C"; then
1528 echocheck "$_cc version"
1529 cc_vendor=sun
1530 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1531 res_comment="experimental support only"
1532 echores "Sun C $cc_version"
1533 break
1535 done
1536 fi # icc
1537 test "$cc_fail" = yes && die "unsupported compiler version"
1539 if test -z "$_target" && x86 ; then
1540 cat > $TMPC << EOF
1541 int main(void) {
1542 int test[(int)sizeof(char *)-7];
1543 return 0;
1546 cc_check && host_arch=x86_64 || host_arch=i386
1549 echo "Detected operating system: $system_name"
1550 echo "Detected host architecture: $host_arch"
1552 echocheck "host cc"
1553 test "$_host_cc" || _host_cc=$_cc
1554 echores $_host_cc
1556 echocheck "cross compilation"
1557 if test $_cross_compile = auto ; then
1558 _cross_compile=yes
1559 cflag_check "" && "$TMPEXE" && _cross_compile=no
1561 echores $_cross_compile
1563 if test $_cross_compile = yes; then
1564 tmp_run() {
1565 return 0
1569 # ---
1571 # now that we know what compiler should be used for compilation, try to find
1572 # out which assembler is used by the $_cc compiler
1573 if test "$_as" = auto ; then
1574 _as=$($_cc -print-prog-name=as)
1575 test -z "$_as" && _as=as
1578 if test "$_nm" = auto ; then
1579 _nm=$($_cc -print-prog-name=nm)
1580 test -z "$_nm" && _nm=nm
1583 # XXX: this should be ok..
1584 _cpuinfo="echo"
1586 if test "$_runtime_cpudetection" = no ; then
1588 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1589 # FIXME: Remove the cygwin check once AMD CPUs are supported
1590 if test -r /proc/cpuinfo && ! cygwin; then
1591 # Linux with /proc mounted, extract CPU information from it
1592 _cpuinfo="cat /proc/cpuinfo"
1593 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1594 # FreeBSD with Linux emulation /proc mounted,
1595 # extract CPU information from it
1596 # Don't use it on x86 though, it never reports 3Dnow
1597 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1598 elif darwin && ! x86 ; then
1599 # use hostinfo on Darwin
1600 _cpuinfo="hostinfo"
1601 elif aix; then
1602 # use 'lsattr' on AIX
1603 _cpuinfo="lsattr -E -l proc0 -a type"
1604 elif x86; then
1605 # all other OSes try to extract CPU information from a small helper
1606 # program cpuinfo instead
1607 $_cc -o cpuinfo$_exesuf cpuinfo.c
1608 _cpuinfo="./cpuinfo$_exesuf"
1611 if x86 ; then
1612 # gather more CPU information
1613 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1614 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1615 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1616 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1617 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1619 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1621 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1622 -e s/xmm/sse/ -e s/kni/sse/)
1624 for ext in $pparam ; do
1625 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1626 done
1628 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1629 test $_sse = kernel_check && _mmxext=kernel_check
1631 echocheck "CPU vendor"
1632 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1634 echocheck "CPU type"
1635 echores "$pname"
1638 fi # test "$_runtime_cpudetection" = no
1640 if x86 && test "$_runtime_cpudetection" = no ; then
1641 extcheck() {
1642 if test "$1" = kernel_check ; then
1643 echocheck "kernel support of $2"
1644 cat > $TMPC <<EOF
1645 #include <stdlib.h>
1646 #include <signal.h>
1647 static void catch(int sig) { exit(1); }
1648 int main(void) {
1649 signal(SIGILL, catch);
1650 __asm__ volatile ("$3":::"memory"); return 0;
1654 if cc_check && tmp_run ; then
1655 eval _$2=yes
1656 echores "yes"
1657 _optimizing="$_optimizing $2"
1658 return 0
1659 else
1660 eval _$2=no
1661 echores "failed"
1662 echo "It seems that your kernel does not correctly support $2."
1663 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1664 return 1
1667 return 0
1670 extcheck $_mmx "mmx" "emms"
1671 extcheck $_mmxext "mmxext" "sfence"
1672 extcheck $_3dnow "3dnow" "femms"
1673 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1674 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1675 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1676 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1677 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1679 echocheck "mtrr support"
1680 if test "$_mtrr" = kernel_check ; then
1681 _mtrr="yes"
1682 _optimizing="$_optimizing mtrr"
1684 echores "$_mtrr"
1686 if test "$_gcc3_ext" != ""; then
1687 # if we had to disable sse/sse2 because the active kernel does not
1688 # support this instruction set extension, we also have to tell
1689 # gcc3 to not generate sse/sse2 instructions for normal C code
1690 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1696 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1697 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1698 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1699 subarch_all='X86_32 X86_64 PPC64'
1700 case "$host_arch" in
1701 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1702 arch='x86'
1703 subarch='x86_32'
1704 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1705 iproc=486
1706 proc=i486
1709 if test "$_runtime_cpudetection" = no ; then
1710 case "$pvendor" in
1711 AuthenticAMD)
1712 case "$pfamily" in
1713 3) proc=i386 iproc=386 ;;
1714 4) proc=i486 iproc=486 ;;
1715 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1716 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1717 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1718 proc=k6-3
1719 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1720 proc=geode
1721 elif test "$pmodel" -ge 8; then
1722 proc=k6-2
1723 elif test "$pmodel" -ge 6; then
1724 proc=k6
1725 else
1726 proc=i586
1729 6) iproc=686
1730 # It's a bit difficult to determine the correct type of Family 6
1731 # AMD CPUs just from their signature. Instead, we check directly
1732 # whether it supports SSE.
1733 if test "$_sse" = yes; then
1734 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1735 proc=athlon-xp
1736 else
1737 # Again, gcc treats athlon and athlon-tbird similarly.
1738 proc=athlon
1741 15) iproc=686
1742 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1743 # caught and remedied in the optimization tests below.
1744 proc=k8
1747 *) proc=amdfam10 iproc=686
1748 test $_fast_clz = "auto" && _fast_clz=yes
1750 esac
1752 GenuineIntel)
1753 case "$pfamily" in
1754 3) proc=i386 iproc=386 ;;
1755 4) proc=i486 iproc=486 ;;
1756 5) iproc=586
1757 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1758 proc=pentium-mmx # 4 is desktop, 8 is mobile
1759 else
1760 proc=i586
1763 6) iproc=686
1764 if test "$pmodel" -ge 15; then
1765 proc=core2
1766 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1767 proc=pentium-m
1768 elif test "$pmodel" -ge 7; then
1769 proc=pentium3
1770 elif test "$pmodel" -ge 3; then
1771 proc=pentium2
1772 else
1773 proc=i686
1775 test $_fast_clz = "auto" && _fast_clz=yes
1777 15) iproc=686
1778 # A nocona in 32-bit mode has no more capabilities than a prescott.
1779 if test "$pmodel" -ge 3; then
1780 proc=prescott
1781 else
1782 proc=pentium4
1783 test $_fast_clz = "auto" && _fast_clz=yes
1785 test $_fast_cmov = "auto" && _fast_cmov=no
1787 *) proc=prescott iproc=686 ;;
1788 esac
1790 CentaurHauls)
1791 case "$pfamily" in
1792 5) iproc=586
1793 if test "$pmodel" -ge 8; then
1794 proc=winchip2
1795 elif test "$pmodel" -ge 4; then
1796 proc=winchip-c6
1797 else
1798 proc=i586
1801 6) iproc=686
1802 if test "$pmodel" -ge 9; then
1803 proc=c3-2
1804 else
1805 proc=c3
1806 iproc=586
1809 *) proc=i686 iproc=i686 ;;
1810 esac
1812 unknown)
1813 case "$pfamily" in
1814 3) proc=i386 iproc=386 ;;
1815 4) proc=i486 iproc=486 ;;
1816 *) proc=i586 iproc=586 ;;
1817 esac
1820 proc=i586 iproc=586 ;;
1821 esac
1822 test $_fast_clz = "auto" && _fast_clz=no
1823 fi # test "$_runtime_cpudetection" = no
1826 # check that gcc supports our CPU, if not, fall back to earlier ones
1827 # LGB: check -mcpu and -march swithing step by step with enabling
1828 # to fall back till 386.
1830 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1832 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1833 cpuopt=-mtune
1834 else
1835 cpuopt=-mcpu
1838 echocheck "GCC & CPU optimization abilities"
1839 if test "$_runtime_cpudetection" = no ; then
1840 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1841 cflag_check -march=native && proc=native
1843 if test "$proc" = "amdfam10"; then
1844 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1846 if test "$proc" = "k8"; then
1847 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1849 if test "$proc" = "athlon-xp"; then
1850 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1852 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1853 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1855 if test "$proc" = "k6" || test "$proc" = "c3"; then
1856 if ! cflag_check -march=$proc $cpuopt=$proc; then
1857 if cflag_check -march=i586 $cpuopt=i686; then
1858 proc=i586-i686
1859 else
1860 proc=i586
1864 if test "$proc" = "prescott" ; then
1865 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1867 if test "$proc" = "core2" ; then
1868 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1870 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
1871 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1873 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1874 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1876 if test "$proc" = "i586"; then
1877 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1879 if test "$proc" = "i486" ; then
1880 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1882 if test "$proc" = "i386" ; then
1883 cflag_check -march=$proc $cpuopt=$proc || proc=error
1885 if test "$proc" = "error" ; then
1886 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1887 _mcpu=""
1888 _march=""
1889 _optimizing=""
1890 elif test "$proc" = "i586-i686"; then
1891 _march="-march=i586"
1892 _mcpu="$cpuopt=i686"
1893 _optimizing="$proc"
1894 else
1895 _march="-march=$proc"
1896 _mcpu="$cpuopt=$proc"
1897 _optimizing="$proc"
1899 else # if test "$_runtime_cpudetection" = no
1900 _mcpu="$cpuopt=generic"
1901 # at least i486 required, for bswap instruction
1902 _march="-march=i486"
1903 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1904 cflag_check $_mcpu || _mcpu=""
1905 cflag_check $_march $_mcpu || _march=""
1908 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1909 ## autodetected mcpu/march parameters
1910 if test "$_target" ; then
1911 # TODO: it may be a good idea to check GCC and fall back in all cases
1912 if test "$host_arch" = "i586-i686"; then
1913 _march="-march=i586"
1914 _mcpu="$cpuopt=i686"
1915 else
1916 _march="-march=$host_arch"
1917 _mcpu="$cpuopt=$host_arch"
1920 proc="$host_arch"
1922 case "$proc" in
1923 i386) iproc=386 ;;
1924 i486) iproc=486 ;;
1925 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1926 i686|athlon*|pentium*) iproc=686 ;;
1927 *) iproc=586 ;;
1928 esac
1931 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1932 _fast_cmov="yes"
1933 else
1934 _fast_cmov="no"
1936 test $_fast_clz = "auto" && _fast_clz=yes
1938 echores "$proc"
1941 ia64)
1942 arch='ia64'
1943 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1944 iproc='ia64'
1947 x86_64|amd64)
1948 arch='x86'
1949 subarch='x86_64'
1950 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1951 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1952 iproc='x86_64'
1954 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1955 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1956 cpuopt=-mtune
1957 else
1958 cpuopt=-mcpu
1960 if test "$_runtime_cpudetection" = no ; then
1961 case "$pvendor" in
1962 AuthenticAMD)
1963 case "$pfamily" in
1964 15) proc=k8
1965 test $_fast_clz = "auto" && _fast_clz=no
1967 *) proc=amdfam10;;
1968 esac
1970 GenuineIntel)
1971 case "$pfamily" in
1972 6) proc=core2;;
1974 # 64-bit prescotts exist, but as far as GCC is concerned they
1975 # have the same capabilities as a nocona.
1976 proc=nocona
1977 test $_fast_cmov = "auto" && _fast_cmov=no
1978 test $_fast_clz = "auto" && _fast_clz=no
1980 esac
1983 proc=error;;
1984 esac
1985 fi # test "$_runtime_cpudetection" = no
1987 echocheck "GCC & CPU optimization abilities"
1988 # This is a stripped-down version of the i386 fallback.
1989 if test "$_runtime_cpudetection" = no ; then
1990 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1991 cflag_check -march=native && proc=native
1993 # --- AMD processors ---
1994 if test "$proc" = "amdfam10"; then
1995 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1997 if test "$proc" = "k8"; then
1998 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
2000 # This will fail if gcc version < 3.3, which is ok because earlier
2001 # versions don't really support 64-bit on amd64.
2002 # Is this a valid assumption? -Corey
2003 if test "$proc" = "athlon-xp"; then
2004 cflag_check -march=$proc $cpuopt=$proc || proc=error
2006 # --- Intel processors ---
2007 if test "$proc" = "core2"; then
2008 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
2010 if test "$proc" = "x86-64"; then
2011 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
2013 if test "$proc" = "nocona"; then
2014 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
2016 if test "$proc" = "pentium4"; then
2017 cflag_check -march=$proc $cpuopt=$proc || proc=error
2020 _march="-march=$proc"
2021 _mcpu="$cpuopt=$proc"
2022 if test "$proc" = "error" ; then
2023 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2024 _mcpu=""
2025 _march=""
2027 else # if test "$_runtime_cpudetection" = no
2028 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2029 _march="-march=x86-64"
2030 _mcpu="$cpuopt=generic"
2031 cflag_check $_mcpu || _mcpu="x86-64"
2032 cflag_check $_mcpu || _mcpu=""
2033 cflag_check $_march $_mcpu || _march=""
2036 _optimizing="$proc"
2037 test $_fast_cmov = "auto" && _fast_cmov=yes
2038 test $_fast_clz = "auto" && _fast_clz=yes
2040 echores "$proc"
2043 sparc|sparc64)
2044 arch='sparc'
2045 iproc='sparc'
2046 if test "$host_arch" = "sparc64" ; then
2047 _vis='yes'
2048 proc='ultrasparc'
2049 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2050 elif sunos ; then
2051 echocheck "CPU type"
2052 karch=$(uname -m)
2053 case "$(echo $karch)" in
2054 sun4) proc=v7 ;;
2055 sun4c) proc=v7 ;;
2056 sun4d) proc=v8 ;;
2057 sun4m) proc=v8 ;;
2058 sun4u) proc=ultrasparc _vis='yes' ;;
2059 sun4v) proc=v9 ;;
2060 *) proc=v8 ;;
2061 esac
2062 echores "$proc"
2063 else
2064 proc=v8
2066 _mcpu="-mcpu=$proc"
2067 _optimizing="$proc"
2070 arm*)
2071 arch='arm'
2072 iproc='arm'
2075 avr32)
2076 arch='avr32'
2077 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2078 iproc='avr32'
2079 test $_fast_clz = "auto" && _fast_clz=yes
2082 sh|sh4)
2083 arch='sh4'
2084 iproc='sh4'
2087 ppc|ppc64|powerpc|powerpc64)
2088 arch='ppc'
2089 def_dcbzl='#define HAVE_DCBZL 0'
2090 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2091 iproc='ppc'
2093 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2094 subarch='ppc64'
2095 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2097 echocheck "CPU type"
2098 case $system_name in
2099 Linux)
2100 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2101 if test -n "$($_cpuinfo | grep altivec)"; then
2102 test $_altivec = auto && _altivec=yes
2105 Darwin)
2106 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2107 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2108 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2109 test $_altivec = auto && _altivec=yes
2112 NetBSD)
2113 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2114 case $cc_version in
2115 2*|3.0*|3.1*|3.2*|3.3*)
2118 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2119 test $_altivec = auto && _altivec=yes
2122 esac
2124 AIX)
2125 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2127 esac
2128 if test "$_altivec" = yes; then
2129 echores "$proc altivec"
2130 else
2131 _altivec=no
2132 echores "$proc"
2135 echocheck "GCC & CPU optimization abilities"
2137 if test -n "$proc"; then
2138 case "$proc" in
2139 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2140 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2141 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2142 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2143 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2144 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2145 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2146 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2147 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2148 *) ;;
2149 esac
2150 # gcc 3.1(.1) and up supports 7400 and 7450
2151 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2152 case "$proc" in
2153 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2154 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2155 *) ;;
2156 esac
2158 # gcc 3.2 and up supports 970
2159 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2160 case "$proc" in
2161 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2162 def_dcbzl='#define HAVE_DCBZL 1' ;;
2163 *) ;;
2164 esac
2166 # gcc 3.3 and up supports POWER4
2167 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2168 case "$proc" in
2169 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2170 *) ;;
2171 esac
2173 # gcc 3.4 and up supports 440*
2174 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2175 case "$proc" in
2176 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2177 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2178 *) ;;
2179 esac
2181 # gcc 4.0 and up supports POWER5
2182 if test "$_cc_major" -ge "4"; then
2183 case "$proc" in
2184 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2185 *) ;;
2186 esac
2190 if test -n "$_mcpu"; then
2191 _optimizing=$(echo $_mcpu | cut -c 8-)
2192 echores "$_optimizing"
2193 else
2194 echores "none"
2197 test $_fast_clz = "auto" && _fast_clz=yes
2201 alpha*)
2202 arch='alpha'
2203 iproc='alpha'
2204 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2206 echocheck "CPU type"
2207 cat > $TMPC << EOF
2208 int main(void) {
2209 unsigned long ver, mask;
2210 __asm__ ("implver %0" : "=r" (ver));
2211 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2212 printf("%ld-%x\n", ver, ~mask);
2213 return 0;
2216 $_cc -o "$TMPEXE" "$TMPC"
2217 case $("$TMPEXE") in
2219 0-0) proc="ev4"; _mvi="0";;
2220 1-0) proc="ev5"; _mvi="0";;
2221 1-1) proc="ev56"; _mvi="0";;
2222 1-101) proc="pca56"; _mvi="1";;
2223 2-303) proc="ev6"; _mvi="1";;
2224 2-307) proc="ev67"; _mvi="1";;
2225 2-1307) proc="ev68"; _mvi="1";;
2226 esac
2227 echores "$proc"
2229 echocheck "GCC & CPU optimization abilities"
2230 if test "$proc" = "ev68" ; then
2231 cc_check -mcpu=$proc || proc=ev67
2233 if test "$proc" = "ev67" ; then
2234 cc_check -mcpu=$proc || proc=ev6
2236 _mcpu="-mcpu=$proc"
2237 echores "$proc"
2239 test $_fast_clz = "auto" && _fast_clz=yes
2241 _optimizing="$proc"
2244 mips)
2245 arch='mips'
2246 iproc='mips'
2248 if irix ; then
2249 echocheck "CPU type"
2250 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2251 case "$(echo $proc)" in
2252 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2253 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2254 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2255 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2256 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2257 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2258 esac
2259 # gcc < 3.x does not support -mtune.
2260 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2261 _mcpu=''
2263 echores "$proc"
2266 test $_fast_clz = "auto" && _fast_clz=yes
2270 hppa)
2271 arch='pa_risc'
2272 iproc='PA-RISC'
2275 s390)
2276 arch='s390'
2277 iproc='390'
2280 s390x)
2281 arch='s390x'
2282 iproc='390x'
2285 vax)
2286 arch='vax'
2287 iproc='vax'
2290 xtensa)
2291 arch='xtensa'
2292 iproc='xtensa'
2295 generic)
2296 arch='generic'
2300 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2301 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2302 die "unsupported architecture $host_arch"
2304 esac # case "$host_arch" in
2306 if test "$_runtime_cpudetection" = yes ; then
2307 if x86 ; then
2308 test "$_cmov" != no && _cmov=yes
2309 x86_32 && _cmov=no
2310 test "$_mmx" != no && _mmx=yes
2311 test "$_3dnow" != no && _3dnow=yes
2312 test "$_3dnowext" != no && _3dnowext=yes
2313 test "$_mmxext" != no && _mmxext=yes
2314 test "$_sse" != no && _sse=yes
2315 test "$_sse2" != no && _sse2=yes
2316 test "$_ssse3" != no && _ssse3=yes
2317 test "$_mtrr" != no && _mtrr=yes
2319 if ppc; then
2320 _altivec=yes
2325 # endian testing
2326 echocheck "byte order"
2327 if test "$_big_endian" = auto ; then
2328 cat > $TMPC <<EOF
2329 short ascii_name[] = {
2330 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2331 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2332 int main(void) { return (long)ascii_name; }
2334 if cc_check ; then
2335 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2336 _big_endian=yes
2337 else
2338 _big_endian=no
2340 else
2341 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2344 if test "$_big_endian" = yes ; then
2345 _byte_order='big-endian'
2346 def_words_endian='#define WORDS_BIGENDIAN 1'
2347 def_bigendian='#define HAVE_BIGENDIAN 1'
2348 else
2349 _byte_order='little-endian'
2350 def_words_endian='#undef WORDS_BIGENDIAN'
2351 def_bigendian='#define HAVE_BIGENDIAN 0'
2353 echores "$_byte_order"
2356 echocheck "extern symbol prefix"
2357 cat > $TMPC << EOF
2358 int ff_extern;
2360 cc_check -c || die "Symbol mangling check failed."
2361 sym=$($_nm -P -g $TMPEXE)
2362 extern_prefix=${sym%%ff_extern*}
2363 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2364 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2365 echores $extern_prefix
2368 echocheck "assembler support of -pipe option"
2369 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2370 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2373 echocheck "compiler support of named assembler arguments"
2374 _named_asm_args=yes
2375 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2376 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2377 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2378 _named_asm_args=no
2379 def_named_asm_args="#undef NAMED_ASM_ARGS"
2381 echores $_named_asm_args
2384 if darwin && test "$cc_vendor" = "gnu" ; then
2385 echocheck "GCC support of -mstackrealign"
2386 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2387 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2388 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2389 # wrong code with this flag, but this can be worked around by adding
2390 # -fno-unit-at-a-time as described in the blog post at
2391 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2392 cat > $TMPC << EOF
2393 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2394 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2396 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2397 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time \
2398 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2399 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2400 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2403 # Checking for CFLAGS
2404 _install_strip="-s"
2405 if test "$_profile" != "" || test "$_debug" != "" ; then
2406 CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
2407 WARNFLAGS="-W -Wall"
2408 _install_strip=
2409 elif test -z "$CFLAGS" ; then
2410 if test "$cc_vendor" = "intel" ; then
2411 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2412 WARNFLAGS="-wd167 -wd556 -wd144"
2413 elif test "$cc_vendor" = "sun" ; then
2414 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2415 elif test "$cc_vendor" = "clang"; then
2416 CFLAGS="-O2 $_march $_pipe"
2417 elif test "$cc_vendor" != "gnu" ; then
2418 CFLAGS="-O2 $_march $_mcpu $_pipe"
2419 else
2420 CFLAGS="-O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2421 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2422 extra_ldflags="$extra_ldflags -ffast-math"
2424 else
2425 warn_cflags=yes
2428 if test "$cc_vendor" = "gnu" ; then
2429 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2430 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2431 # that's the only variable specific to C now, and this option is not valid
2432 # for C++.
2433 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2434 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2435 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2436 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2437 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2438 else
2439 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2442 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2443 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2446 if test -n "$LDFLAGS" ; then
2447 extra_ldflags="$extra_ldflags $LDFLAGS"
2448 warn_cflags=yes
2449 elif test "$cc_vendor" = "intel" ; then
2450 extra_ldflags="$extra_ldflags -i-static"
2452 if test -n "$CPPFLAGS" ; then
2453 extra_cflags="$extra_cflags $CPPFLAGS"
2454 warn_cflags=yes
2459 if x86_32 ; then
2460 # Checking assembler (_as) compatibility...
2461 # Added workaround for older as that reads from stdin by default - atmos
2462 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2463 echocheck "assembler ($_as $as_version)"
2465 _pref_as_version='2.9.1'
2466 echo 'nop' > $TMPS
2467 if test "$_mmx" = yes ; then
2468 echo 'emms' >> $TMPS
2470 if test "$_3dnow" = yes ; then
2471 _pref_as_version='2.10.1'
2472 echo 'femms' >> $TMPS
2474 if test "$_3dnowext" = yes ; then
2475 _pref_as_version='2.10.1'
2476 echo 'pswapd %mm0, %mm0' >> $TMPS
2478 if test "$_mmxext" = yes ; then
2479 _pref_as_version='2.10.1'
2480 echo 'movntq %mm0, (%eax)' >> $TMPS
2482 if test "$_sse" = yes ; then
2483 _pref_as_version='2.10.1'
2484 echo 'xorps %xmm0, %xmm0' >> $TMPS
2486 #if test "$_sse2" = yes ; then
2487 # _pref_as_version='2.11'
2488 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2490 if test "$_cmov" = yes ; then
2491 _pref_as_version='2.10.1'
2492 echo 'cmovb %eax, %ebx' >> $TMPS
2494 if test "$_ssse3" = yes ; then
2495 _pref_as_version='2.16.92'
2496 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2498 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2500 if test "$as_verc_fail" != yes ; then
2501 echores "ok"
2502 else
2503 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2504 echores "failed"
2505 die "obsolete binutils version"
2508 fi #if x86_32
2511 echocheck "PIC"
2512 pic=no
2513 cat > $TMPC << EOF
2514 int main(void) {
2515 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2516 #error PIC not enabled
2517 #endif
2518 return 0;
2521 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2522 echores $pic
2525 if x86 ; then
2527 echocheck ".align is a power of two"
2528 if test "$_asmalign_pot" = auto ; then
2529 _asmalign_pot=no
2530 inline_asm_check '".align 3"' && _asmalign_pot=yes
2532 if test "$_asmalign_pot" = "yes" ; then
2533 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2534 else
2535 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2537 echores $_asmalign_pot
2540 echocheck "10 assembler operands"
2541 ten_operands=no
2542 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2543 cat > $TMPC << EOF
2544 int main(void) {
2545 int x=0;
2546 __asm__ volatile(
2548 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2550 return 0;
2553 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2554 echores $ten_operands
2556 echocheck "ebx availability"
2557 ebx_available=no
2558 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2559 cat > $TMPC << EOF
2560 int main(void) {
2561 int x;
2562 __asm__ volatile(
2563 "xor %0, %0"
2564 :"=b"(x)
2565 // just adding ebx to clobber list seems unreliable with some
2566 // compilers, e.g. Haiku's gcc 2.95
2568 // and the above check does not work for OSX 64 bit...
2569 __asm__ volatile("":::"%ebx");
2570 return 0;
2573 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2574 echores $ebx_available
2577 echocheck "yasm"
2578 if test -z "$YASMFLAGS" ; then
2579 if darwin ; then
2580 x86_64 && objformat="macho64" || objformat="macho"
2581 elif win32 ; then
2582 objformat="win32"
2583 else
2584 objformat="elf"
2586 # currently tested for Linux x86, x86_64
2587 YASMFLAGS="-f $objformat"
2588 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2589 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2590 case "$objformat" in
2591 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2592 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2593 esac
2594 else
2595 warn_cflags=yes
2598 echo "pabsw xmm0, xmm0" > $TMPS
2599 yasm_check || _yasm=""
2600 if test $_yasm ; then
2601 def_yasm='#define HAVE_YASM 1'
2602 have_yasm="yes"
2603 echores "$_yasm"
2604 else
2605 def_yasm='#define HAVE_YASM 0'
2606 have_yasm="no"
2607 echores "no"
2610 echocheck "bswap"
2611 def_bswap='#define HAVE_BSWAP 0'
2612 echo 'bswap %eax' > $TMPS
2613 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2614 echores "$bswap"
2615 fi #if x86
2618 #FIXME: This should happen before the check for CFLAGS..
2619 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2620 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2622 # check if AltiVec is supported by the compiler, and how to enable it
2623 echocheck "GCC AltiVec flags"
2624 if $(cflag_check -maltivec -mabi=altivec) ; then
2625 _altivec_gcc_flags="-maltivec -mabi=altivec"
2626 # check if <altivec.h> should be included
2627 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2628 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2629 inc_altivec_h='#include <altivec.h>'
2630 else
2631 if $(cflag_check -faltivec) ; then
2632 _altivec_gcc_flags="-faltivec"
2633 else
2634 _altivec=no
2635 _altivec_gcc_flags="none, AltiVec disabled"
2639 echores "$_altivec_gcc_flags"
2641 # check if the compiler supports braces for vector declarations
2642 cat > $TMPC << EOF
2643 $inc_altivec_h
2644 int main(void) { (vector int) {1}; return 0; }
2646 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2648 # Disable runtime cpudetection if we cannot generate AltiVec code or
2649 # AltiVec is disabled by the user.
2650 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2651 && _runtime_cpudetection=no
2653 # Show that we are optimizing for AltiVec (if enabled and supported).
2654 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2655 && _optimizing="$_optimizing altivec"
2657 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2658 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2661 if ppc ; then
2662 def_xform_asm='#define HAVE_XFORM_ASM 0'
2663 xform_asm=no
2664 echocheck "XFORM ASM support"
2665 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2666 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2667 echores "$xform_asm"
2670 if arm ; then
2671 echocheck "ARM pld instruction"
2672 pld=no
2673 inline_asm_check '"pld [r0]"' && pld=yes
2674 echores "$pld"
2676 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2677 if test $_armv5te = "auto" ; then
2678 _armv5te=no
2679 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2681 echores "$_armv5te"
2683 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2685 echocheck "ARMv6 (SIMD instructions)"
2686 if test $_armv6 = "auto" ; then
2687 _armv6=no
2688 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2690 echores "$_armv6"
2692 echocheck "ARMv6t2 (SIMD instructions)"
2693 if test $_armv6t2 = "auto" ; then
2694 _armv6t2=no
2695 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2697 echores "$_armv6"
2699 echocheck "ARM VFP"
2700 if test $_armvfp = "auto" ; then
2701 _armvfp=no
2702 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2704 echores "$_armvfp"
2706 echocheck "ARM NEON"
2707 if test $neon = "auto" ; then
2708 neon=no
2709 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2711 echores "$neon"
2713 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2714 if test $_iwmmxt = "auto" ; then
2715 _iwmmxt=no
2716 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2718 echores "$_iwmmxt"
2721 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'
2722 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2723 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2724 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2725 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2726 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2727 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2728 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2729 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2730 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2731 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2732 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2733 test "$pld" = yes && cpuexts="PLD $cpuexts"
2734 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2735 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2736 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2737 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2738 test "$neon" = yes && cpuexts="NEON $cpuexts"
2739 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2740 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2741 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2743 # Checking kernel version...
2744 if x86_32 && linux ; then
2745 _k_verc_problem=no
2746 kernel_version=$(uname -r 2>&1)
2747 echocheck "$system_name kernel version"
2748 case "$kernel_version" in
2749 '') kernel_version="?.??"; _k_verc_fail=yes;;
2750 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2751 _k_verc_problem=yes;;
2752 esac
2753 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2754 _k_verc_fail=yes
2756 if test "$_k_verc_fail" ; then
2757 echores "$kernel_version, fail"
2758 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2759 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2760 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2761 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2762 echo "2.2.x you must upgrade it to get SSE support!"
2763 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2764 else
2765 echores "$kernel_version, ok"
2769 ######################
2770 # MAIN TESTS GO HERE #
2771 ######################
2774 echocheck "-lposix"
2775 if cflag_check -lposix ; then
2776 extra_ldflags="$extra_ldflags -lposix"
2777 echores "yes"
2778 else
2779 echores "no"
2782 echocheck "-lm"
2783 if cflag_check -lm ; then
2784 _ld_lm="-lm"
2785 echores "yes"
2786 else
2787 _ld_lm=""
2788 echores "no"
2792 echocheck "langinfo"
2793 if test "$_langinfo" = auto ; then
2794 _langinfo=no
2795 function_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2797 if test "$_langinfo" = yes ; then
2798 def_langinfo='#define HAVE_LANGINFO 1'
2799 else
2800 def_langinfo='#undef HAVE_LANGINFO'
2802 echores "$_langinfo"
2805 echocheck "translation support"
2806 if test "$_translation" = yes; then
2807 def_translation="#define CONFIG_TRANSLATION 1"
2808 else
2809 def_translation="#undef CONFIG_TRANSLATION"
2811 echores "$_translation"
2813 echocheck "language"
2814 # Set preferred languages, "all" uses English as main language.
2815 test -z "$language" && language=$LINGUAS
2816 test -z "$language_doc" && language_doc=$language
2817 test -z "$language_man" && language_man=$language
2818 test -z "$language_msg" && language_msg="all"
2819 language_doc=$(echo $language_doc | tr , " ")
2820 language_man=$(echo $language_man | tr , " ")
2821 language_msg=$(echo $language_msg | tr , " ")
2823 test "$language_doc" = "all" && language_doc=$doc_lang_all
2824 test "$language_man" = "all" && language_man=$man_lang_all
2825 test "$language_msg" = "all" && language_msg=$msg_lang_all
2827 if test "$_translation" != yes ; then
2828 language_msg=""
2831 # Prune non-existing translations from language lists.
2832 # Set message translation to the first available language.
2833 # Fall back on English.
2834 for lang in $language_doc ; do
2835 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2836 done
2837 language_doc=$tmp_language_doc
2838 test -z "$language_doc" && language_doc=en
2840 for lang in $language_man ; do
2841 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2842 done
2843 language_man=$tmp_language_man
2844 test -z "$language_man" && language_man=en
2846 for lang in $language_msg ; do
2847 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2848 done
2849 language_msg=$tmp_language_msg
2851 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2854 echocheck "enable sighandler"
2855 if test "$_sighandler" = yes ; then
2856 def_sighandler='#define CONFIG_SIGHANDLER 1'
2857 else
2858 def_sighandler='#undef CONFIG_SIGHANDLER'
2860 echores "$_sighandler"
2862 echocheck "runtime cpudetection"
2863 if test "$_runtime_cpudetection" = yes ; then
2864 _optimizing="Runtime CPU-Detection enabled"
2865 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2866 else
2867 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2869 echores "$_runtime_cpudetection"
2872 echocheck "restrict keyword"
2873 for restrict_keyword in restrict __restrict __restrict__ ; do
2874 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2875 if cc_check; then
2876 def_restrict_keyword=$restrict_keyword
2877 break;
2879 done
2880 if [ -n "$def_restrict_keyword" ]; then
2881 echores "$def_restrict_keyword"
2882 else
2883 echores "none"
2885 # Avoid infinite recursion loop ("#define restrict restrict")
2886 if [ "$def_restrict_keyword" != "restrict" ]; then
2887 def_restrict_keyword="#define restrict $def_restrict_keyword"
2888 else
2889 def_restrict_keyword=""
2893 echocheck "__builtin_expect"
2894 # GCC branch prediction hint
2895 cat > $TMPC << EOF
2896 static int foo(int a) {
2897 a = __builtin_expect(a, 10);
2898 return a == 10 ? 0 : 1;
2900 int main(void) { return foo(10) && foo(0); }
2902 _builtin_expect=no
2903 cc_check && _builtin_expect=yes
2904 if test "$_builtin_expect" = yes ; then
2905 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2906 else
2907 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2909 echores "$_builtin_expect"
2912 echocheck "kstat"
2913 _kstat=no
2914 function_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2915 if test "$_kstat" = yes ; then
2916 def_kstat="#define HAVE_LIBKSTAT 1"
2917 extra_ldflags="$extra_ldflags -lkstat"
2918 else
2919 def_kstat="#undef HAVE_LIBKSTAT"
2921 echores "$_kstat"
2924 echocheck "posix4"
2925 # required for nanosleep on some systems
2926 _posix4=no
2927 function_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2928 if test "$_posix4" = yes ; then
2929 extra_ldflags="$extra_ldflags -lposix4"
2931 echores "$_posix4"
2933 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2934 echocheck $func
2935 eval _$func=no
2936 function_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2937 if eval test "x\$_$func" = "xyes"; then
2938 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2939 echores yes
2940 else
2941 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2942 echores no
2944 done
2947 echocheck "mkstemp"
2948 cat > $TMPC << EOF
2949 #define _XOPEN_SOURCE 500
2950 #include <stdlib.h>
2951 int main(void) { mkstemp(""); return 0; }
2953 _mkstemp=no
2954 cc_check && _mkstemp=yes
2955 if test "$_mkstemp" = yes ; then
2956 def_mkstemp='#define HAVE_MKSTEMP 1'
2957 else
2958 def_mkstemp='#define HAVE_MKSTEMP 0'
2960 echores "$_mkstemp"
2963 echocheck "nanosleep"
2964 _nanosleep=no
2965 function_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2966 if test "$_nanosleep" = yes ; then
2967 def_nanosleep='#define HAVE_NANOSLEEP 1'
2968 else
2969 def_nanosleep='#undef HAVE_NANOSLEEP'
2971 echores "$_nanosleep"
2974 echocheck "socklib"
2975 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2976 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2977 cat > $TMPC << EOF
2978 #include <netdb.h>
2979 #include <sys/socket.h>
2980 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2982 _socklib=no
2983 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2984 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2985 done
2986 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2987 if test $_winsock2_h = auto ; then
2988 _winsock2_h=no
2989 function_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2991 test "$_ld_sock" && res_comment="using $_ld_sock"
2992 echores "$_socklib"
2995 if test $_winsock2_h = yes ; then
2996 _ld_sock="-lws2_32"
2997 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2998 else
2999 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3003 echocheck "arpa/inet.h"
3004 arpa_inet_h=no
3005 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3006 header_check arpa/inet.h && arpa_inet_h=yes &&
3007 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3008 echores "$arpa_inet_h"
3011 echocheck "inet_pton()"
3012 def_inet_pton='#define HAVE_INET_PTON 0'
3013 inet_pton=no
3014 cat > $TMPC << EOF
3015 #include <sys/types.h>
3016 #include <sys/socket.h>
3017 #include <arpa/inet.h>
3018 int main(void) { inet_pton(0, 0, 0); return 0; }
3020 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3021 cc_check $_ld_tmp && inet_pton=yes && break
3022 done
3023 if test $inet_pton = yes ; then
3024 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3025 def_inet_pton='#define HAVE_INET_PTON 1'
3027 echores "$inet_pton"
3030 echocheck "inet_aton()"
3031 def_inet_aton='#define HAVE_INET_ATON 0'
3032 inet_aton=no
3033 cat > $TMPC << EOF
3034 #include <sys/types.h>
3035 #include <sys/socket.h>
3036 #include <arpa/inet.h>
3037 int main(void) { inet_aton(0, 0); return 0; }
3039 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3040 cc_check $_ld_tmp && inet_aton=yes && break
3041 done
3042 if test $inet_aton = yes ; then
3043 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3044 def_inet_aton='#define HAVE_INET_ATON 1'
3046 echores "$inet_aton"
3049 echocheck "socklen_t"
3050 _socklen_t=no
3051 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3052 cat > $TMPC << EOF
3053 #include <$header>
3054 int main(void) { socklen_t v = 0; return v; }
3056 cc_check && _socklen_t=yes && break
3057 done
3058 if test "$_socklen_t" = yes ; then
3059 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3060 else
3061 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3063 echores "$_socklen_t"
3066 echocheck "closesocket()"
3067 _closesocket=no
3068 function_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
3069 if test "$_closesocket" = yes ; then
3070 def_closesocket='#define HAVE_CLOSESOCKET 1'
3071 else
3072 def_closesocket='#define HAVE_CLOSESOCKET 0'
3074 echores "$_closesocket"
3077 echocheck "networking"
3078 test $_winsock2_h = no && test $inet_pton = no &&
3079 test $inet_aton = no && networking=no
3080 if test "$networking" = yes ; then
3081 def_network='#define CONFIG_NETWORK 1'
3082 def_networking='#define CONFIG_NETWORKING 1'
3083 extra_ldflags="$extra_ldflags $_ld_sock"
3084 inputmodules="networking $inputmodules"
3085 else
3086 noinputmodules="networking $noinputmodules"
3087 def_network='#undef CONFIG_NETWORK'
3088 def_networking='#undef CONFIG_NETWORKING'
3090 echores "$networking"
3093 echocheck "inet6"
3094 if test "$_inet6" = auto ; then
3095 cat > $TMPC << EOF
3096 #include <sys/types.h>
3097 #if !defined(_WIN32) || defined(__CYGWIN__)
3098 #include <sys/socket.h>
3099 #include <netinet/in.h>
3100 #else
3101 #include <ws2tcpip.h>
3102 #endif
3103 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3105 _inet6=no
3106 if cc_check $_ld_sock ; then
3107 _inet6=yes
3110 if test "$_inet6" = yes ; then
3111 def_inet6='#define HAVE_AF_INET6 1'
3112 else
3113 def_inet6='#undef HAVE_AF_INET6'
3115 echores "$_inet6"
3118 echocheck "gethostbyname2"
3119 if test "$_gethostbyname2" = auto ; then
3120 cat > $TMPC << EOF
3121 #include <sys/types.h>
3122 #include <sys/socket.h>
3123 #include <netdb.h>
3124 int main(void) { gethostbyname2("", AF_INET); return 0; }
3126 _gethostbyname2=no
3127 if cc_check ; then
3128 _gethostbyname2=yes
3131 if test "$_gethostbyname2" = yes ; then
3132 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3133 else
3134 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3136 echores "$_gethostbyname2"
3139 echocheck "inttypes.h (required)"
3140 _inttypes=no
3141 header_check inttypes.h && _inttypes=yes
3142 echores "$_inttypes"
3144 if test "$_inttypes" = no ; then
3145 echocheck "sys/bitypes.h (inttypes.h predecessor)"
3146 header_check sys/bitypes.h && _inttypes=yes
3147 if test "$_inttypes" = yes ; then
3148 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."
3149 else
3150 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3155 echocheck "int_fastXY_t in inttypes.h"
3156 cat > $TMPC << EOF
3157 #include <inttypes.h>
3158 int main(void) { volatile int_fast16_t v = 0; return v; }
3160 _fast_inttypes=no
3161 cc_check && _fast_inttypes=yes
3162 if test "$_fast_inttypes" = no ; then
3163 def_fast_inttypes='
3164 typedef signed char int_fast8_t;
3165 typedef signed int int_fast16_t;
3166 typedef signed int int_fast32_t;
3167 typedef signed long long int_fast64_t;
3168 typedef unsigned char uint_fast8_t;
3169 typedef unsigned int uint_fast16_t;
3170 typedef unsigned int uint_fast32_t;
3171 typedef unsigned long long uint_fast64_t;'
3173 echores "$_fast_inttypes"
3176 echocheck "malloc.h"
3177 _malloc=no
3178 header_check malloc.h && _malloc=yes
3179 if test "$_malloc" = yes ; then
3180 def_malloc_h='#define HAVE_MALLOC_H 1'
3181 else
3182 def_malloc_h='#define HAVE_MALLOC_H 0'
3184 echores "$_malloc"
3187 echocheck "memalign()"
3188 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3189 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3190 _memalign=no
3191 function_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3192 if test "$_memalign" = yes ; then
3193 def_memalign='#define HAVE_MEMALIGN 1'
3194 else
3195 def_memalign='#define HAVE_MEMALIGN 0'
3196 def_map_memalign='#define memalign(a, b) malloc(b)'
3197 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3199 echores "$_memalign"
3202 echocheck "posix_memalign()"
3203 posix_memalign=no
3204 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3205 cat > $TMPC << EOF
3206 #define _XOPEN_SOURCE 600
3207 #include <stdlib.h>
3208 int main(void) { posix_memalign(NULL, 0, 0); }
3210 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3211 echores "$posix_memalign"
3214 echocheck "alloca.h"
3215 _alloca=no
3216 function_check alloca.h 'alloca(0)' && _alloca=yes
3217 if cc_check ; then
3218 def_alloca_h='#define HAVE_ALLOCA_H 1'
3219 else
3220 def_alloca_h='#undef HAVE_ALLOCA_H'
3222 echores "$_alloca"
3225 echocheck "fastmemcpy"
3226 if test "$_fastmemcpy" = yes ; then
3227 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3228 else
3229 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3231 echores "$_fastmemcpy"
3234 echocheck "mman.h"
3235 _mman=no
3236 function_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3237 if test "$_mman" = yes ; then
3238 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3239 else
3240 def_mman_h='#undef HAVE_SYS_MMAN_H'
3241 os2 && _need_mmap=yes
3243 echores "$_mman"
3245 cat > $TMPC << EOF
3246 #include <sys/mman.h>
3247 int main(void) { void *p = MAP_FAILED; return 0; }
3249 _mman_has_map_failed=no
3250 cc_check && _mman_has_map_failed=yes
3251 if test "$_mman_has_map_failed" = yes ; then
3252 def_mman_has_map_failed=''
3253 else
3254 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3257 echocheck "dynamic loader"
3258 _dl=no
3259 for _ld_tmp in "" "-ldl"; do
3260 function_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3261 done
3262 if test "$_dl" = yes ; then
3263 def_dl='#define HAVE_LIBDL 1'
3264 else
3265 def_dl='#undef HAVE_LIBDL'
3267 echores "$_dl"
3270 echocheck "dynamic a/v plugins support"
3271 if test "$_dl" = no ; then
3272 _dynamic_plugins=no
3274 if test "$_dynamic_plugins" = yes ; then
3275 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3276 else
3277 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3279 echores "$_dynamic_plugins"
3282 def_threads='#define HAVE_THREADS 0'
3284 echocheck "pthread"
3285 if linux ; then
3286 THREAD_CFLAGS=-D_REENTRANT
3287 elif freebsd || netbsd || openbsd || bsdos ; then
3288 THREAD_CFLAGS=-D_THREAD_SAFE
3290 if test "$_pthreads" = auto ; then
3291 cat > $TMPC << EOF
3292 #include <pthread.h>
3293 static void *func(void *arg) { return arg; }
3294 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3296 _pthreads=no
3297 if ! hpux ; then
3298 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3299 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3300 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3301 done
3304 if test "$_pthreads" = yes ; then
3305 test $_ld_pthread && res_comment="using $_ld_pthread"
3306 def_pthreads='#define HAVE_PTHREADS 1'
3307 def_threads='#define HAVE_THREADS 1'
3308 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3309 else
3310 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3311 def_pthreads='#undef HAVE_PTHREADS'
3312 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3313 mingw32 || _win32dll=no
3315 echores "$_pthreads"
3317 if cygwin ; then
3318 if test "$_pthreads" = yes ; then
3319 def_pthread_cache="#define PTHREAD_CACHE 1"
3320 else
3321 _stream_cache=no
3322 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3326 echocheck "w32threads"
3327 if test "$_pthreads" = yes ; then
3328 res_comment="using pthread instead"
3329 _w32threads=no
3331 if test "$_w32threads" = auto ; then
3332 _w32threads=no
3333 mingw32 && _w32threads=yes
3335 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3336 echores "$_w32threads"
3338 echocheck "rpath"
3339 netbsd &&_rpath=yes
3340 if test "$_rpath" = yes ; then
3341 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3342 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3343 done
3344 extra_ldflags=$tmp
3346 echores "$_rpath"
3348 echocheck "iconv"
3349 if test "$_iconv" = auto ; then
3350 cat > $TMPC << EOF
3351 #include <stdio.h>
3352 #include <unistd.h>
3353 #include <iconv.h>
3354 #define INBUFSIZE 1024
3355 #define OUTBUFSIZE 4096
3357 char inbuffer[INBUFSIZE];
3358 char outbuffer[OUTBUFSIZE];
3360 int main(void) {
3361 size_t numread;
3362 iconv_t icdsc;
3363 char *tocode="UTF-8";
3364 char *fromcode="cp1250";
3365 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3366 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3367 char *iptr=inbuffer;
3368 char *optr=outbuffer;
3369 size_t inleft=numread;
3370 size_t outleft=OUTBUFSIZE;
3371 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3372 != (size_t)(-1)) {
3373 write(1, outbuffer, OUTBUFSIZE - outleft);
3376 if (iconv_close(icdsc) == -1)
3379 return 0;
3382 _iconv=no
3383 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3384 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3385 _iconv=yes && break
3386 done
3388 if test "$_iconv" = yes ; then
3389 def_iconv='#define CONFIG_ICONV 1'
3390 else
3391 def_iconv='#undef CONFIG_ICONV'
3393 echores "$_iconv"
3396 echocheck "soundcard.h"
3397 _soundcard_h=no
3398 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3399 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3400 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3401 header_check $_soundcard_header && _soundcard_h=yes &&
3402 res_comment="$_soundcard_header" && break
3403 done
3405 if test "$_soundcard_h" = yes ; then
3406 if test $_soundcard_header = "sys/soundcard.h"; then
3407 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3408 else
3409 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3412 echores "$_soundcard_h"
3415 echocheck "sys/dvdio.h"
3416 _dvdio=no
3417 # FreeBSD 8.1 has broken dvdio.h
3418 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3419 if test "$_dvdio" = yes ; then
3420 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3421 else
3422 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3424 echores "$_dvdio"
3427 echocheck "sys/cdio.h"
3428 _cdio=no
3429 # at least OpenSolaris has a broken cdio.h
3430 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3431 if test "$_cdio" = yes ; then
3432 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3433 else
3434 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3436 echores "$_cdio"
3439 echocheck "linux/cdrom.h"
3440 _cdrom=no
3441 header_check linux/cdrom.h && _cdrom=yes
3442 if test "$_cdrom" = yes ; then
3443 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3444 else
3445 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3447 echores "$_cdrom"
3450 echocheck "dvd.h"
3451 _dvd=no
3452 header_check dvd.h && _dvd=yes
3453 if test "$_dvd" = yes ; then
3454 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3455 else
3456 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3458 echores "$_dvd"
3461 if bsdos; then
3462 echocheck "BSDI dvd.h"
3463 _bsdi_dvd=no
3464 header_check dvd.h && _bsdi_dvd=yes
3465 if test "$_bsdi_dvd" = yes ; then
3466 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3467 else
3468 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3470 echores "$_bsdi_dvd"
3471 fi #if bsdos
3474 if hpux; then
3475 # also used by AIX, but AIX does not support VCD and/or libdvdread
3476 echocheck "HP-UX SCSI header"
3477 _hpux_scsi_h=no
3478 header_check sys/scsi.h && _hpux_scsi_h=yes
3479 if test "$_hpux_scsi_h" = yes ; then
3480 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3481 else
3482 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3484 echores "$_hpux_scsi_h"
3485 fi #if hpux
3488 if sunos; then
3489 echocheck "userspace SCSI headers (Solaris)"
3490 _sol_scsi_h=no
3491 header_check sys/scsi/scsi_types.h &&
3492 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3493 _sol_scsi_h=yes
3494 if test "$_sol_scsi_h" = yes ; then
3495 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3496 else
3497 def_sol_scsi_h='#undef SOLARIS_USCSI'
3499 echores "$_sol_scsi_h"
3500 fi #if sunos
3503 echocheck "termcap"
3504 if test "$_termcap" = auto ; then
3505 _termcap=no
3506 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3507 function_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3508 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3509 done
3511 if test "$_termcap" = yes ; then
3512 def_termcap='#define HAVE_TERMCAP 1'
3513 test $_ld_tmp && res_comment="using $_ld_tmp"
3514 else
3515 def_termcap='#undef HAVE_TERMCAP'
3517 echores "$_termcap"
3520 echocheck "termios"
3521 def_termios='#undef HAVE_TERMIOS'
3522 def_termios_h='#undef HAVE_TERMIOS_H'
3523 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3524 if test "$_termios" = auto ; then
3525 _termios=no
3526 for _termios_header in "termios.h" "sys/termios.h"; do
3527 header_check $_termios_header && _termios=yes &&
3528 res_comment="using $_termios_header" && break
3529 done
3532 if test "$_termios" = yes ; then
3533 def_termios='#define HAVE_TERMIOS 1'
3534 if test "$_termios_header" = "termios.h" ; then
3535 def_termios_h='#define HAVE_TERMIOS_H 1'
3536 else
3537 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3540 echores "$_termios"
3543 echocheck "shm"
3544 if test "$_shm" = auto ; then
3545 cat > $TMPC << EOF
3546 #include <sys/types.h>
3547 #include <sys/shm.h>
3548 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3550 _shm=no
3551 cc_check && _shm=yes
3553 if test "$_shm" = yes ; then
3554 def_shm='#define HAVE_SHM 1'
3555 else
3556 def_shm='#undef HAVE_SHM'
3558 echores "$_shm"
3561 echocheck "strsep()"
3562 cat > $TMPC << EOF
3563 #include <string.h>
3564 int main(void) { char *s = "Hello, world!"; strsep(&s, ","); return 0; }
3566 _strsep=no
3567 cc_check && _strsep=yes
3568 if test "$_strsep" = yes ; then
3569 def_strsep='#define HAVE_STRSEP 1'
3570 _need_strsep=no
3571 else
3572 def_strsep='#undef HAVE_STRSEP'
3573 _need_strsep=yes
3575 echores "$_strsep"
3578 echocheck "vsscanf()"
3579 cat > $TMPC << EOF
3580 #define _ISOC99_SOURCE
3581 #include <stdarg.h>
3582 #include <stdio.h>
3583 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3585 _vsscanf=no
3586 cc_check && _vsscanf=yes
3587 if test "$_vsscanf" = yes ; then
3588 def_vsscanf='#define HAVE_VSSCANF 1'
3589 _need_vsscanf=no
3590 else
3591 def_vsscanf='#undef HAVE_VSSCANF'
3592 _need_vsscanf=yes
3594 echores "$_vsscanf"
3597 echocheck "swab()"
3598 cat > $TMPC << EOF
3599 #define _XOPEN_SOURCE 600
3600 #include <unistd.h>
3601 int main(void) { int a, b; swab(&a, &b, 0); return 0; }
3603 _swab=no
3604 cc_check && _swab=yes
3605 if test "$_swab" = yes ; then
3606 def_swab='#define HAVE_SWAB 1'
3607 _need_swab=no
3608 else
3609 def_swab='#undef HAVE_SWAB'
3610 _need_swab=yes
3612 echores "$_swab"
3614 echocheck "POSIX select()"
3615 cat > $TMPC << EOF
3616 #include <stdio.h>
3617 #include <stdlib.h>
3618 #include <sys/types.h>
3619 #include <string.h>
3620 #include <sys/time.h>
3621 #include <unistd.h>
3622 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3624 _posix_select=no
3625 def_posix_select='#undef HAVE_POSIX_SELECT'
3626 #select() of kLIBC (OS/2) supports socket only
3627 ! os2 && cc_check && _posix_select=yes \
3628 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3629 echores "$_posix_select"
3632 echocheck "audio select()"
3633 if test "$_select" = no ; then
3634 def_select='#undef HAVE_AUDIO_SELECT'
3635 elif test "$_select" = yes ; then
3636 def_select='#define HAVE_AUDIO_SELECT 1'
3638 echores "$_select"
3641 echocheck "gettimeofday()"
3642 cat > $TMPC << EOF
3643 #include <sys/time.h>
3644 int main(void) {struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz); return 0; }
3646 _gettimeofday=no
3647 cc_check && _gettimeofday=yes
3648 if test "$_gettimeofday" = yes ; then
3649 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3650 _need_gettimeofday=no
3651 else
3652 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3653 _need_gettimeofday=yes
3655 echores "$_gettimeofday"
3658 echocheck "glob()"
3659 _glob=no
3660 function_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3661 if test "$_glob" = yes ; then
3662 def_glob='#define HAVE_GLOB 1'
3663 _need_glob=no
3664 else
3665 def_glob='#undef HAVE_GLOB'
3666 _need_glob=yes
3668 echores "$_glob"
3671 echocheck "setenv()"
3672 _setenv=no
3673 function_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3674 if test "$_setenv" = yes ; then
3675 def_setenv='#define HAVE_SETENV 1'
3676 _need_setenv=no
3677 else
3678 def_setenv='#undef HAVE_SETENV'
3679 _need_setenv=yes
3681 echores "$_setenv"
3684 echocheck "setmode()"
3685 _setmode=no
3686 def_setmode='#define HAVE_SETMODE 0'
3687 function_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3688 echores "$_setmode"
3691 if sunos; then
3692 echocheck "sysi86()"
3693 _sysi86=no
3694 function_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3695 if test "$_sysi86" = yes ; then
3696 def_sysi86='#define HAVE_SYSI86 1'
3697 cat > $TMPC << EOF
3698 #include <sys/sysi86.h>
3699 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3701 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3702 else
3703 def_sysi86='#undef HAVE_SYSI86'
3705 echores "$_sysi86"
3706 fi #if sunos
3709 echocheck "sys/sysinfo.h"
3710 cat > $TMPC << EOF
3711 #include <sys/sysinfo.h>
3712 int main(void) { struct sysinfo s_info; sysinfo(&s_info); return 0; }
3714 _sys_sysinfo=no
3715 cc_check && _sys_sysinfo=yes
3716 if test "$_sys_sysinfo" = yes ; then
3717 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3718 else
3719 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3721 echores "$_sys_sysinfo"
3724 if darwin; then
3726 echocheck "Mac OS X Finder Support"
3727 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3728 if test "$_macosx_finder" = yes ; then
3729 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3730 extra_ldflags="$extra_ldflags -framework Carbon"
3732 echores "$_macosx_finder"
3734 echocheck "Mac OS X Bundle file locations"
3735 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3736 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3737 if test "$_macosx_bundle" = yes ; then
3738 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3739 extra_ldflags="$extra_ldflags -framework Carbon"
3741 echores "$_macosx_bundle"
3743 echocheck "Apple Remote"
3744 if test "$_apple_remote" = auto ; then
3745 _apple_remote=no
3746 cat > $TMPC <<EOF
3747 #include <stdio.h>
3748 #include <IOKit/IOCFPlugIn.h>
3749 int main(void) {
3750 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3751 CFMutableDictionaryRef hidMatchDictionary;
3752 IOReturn ioReturnValue;
3754 // Set up a matching dictionary to search the I/O Registry by class.
3755 // name for all HID class devices
3756 hidMatchDictionary = IOServiceMatching("AppleIRController");
3758 // Now search I/O Registry for matching devices.
3759 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3760 hidMatchDictionary, &hidObjectIterator);
3762 // If search is unsuccessful, return nonzero.
3763 if (ioReturnValue != kIOReturnSuccess ||
3764 !IOIteratorIsValid(hidObjectIterator)) {
3765 return 1;
3767 return 0;
3770 cc_check -framework IOKit && _apple_remote=yes
3772 if test "$_apple_remote" = yes ; then
3773 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3774 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3775 else
3776 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3778 echores "$_apple_remote"
3780 fi #if darwin
3782 if linux; then
3784 echocheck "Apple IR"
3785 if test "$_apple_ir" = auto ; then
3786 _apple_ir=no
3787 cat > $TMPC <<EOF
3788 #include <linux/types.h>
3789 #include <linux/input.h>
3790 int main(void) { struct input_event ev; struct input_id id; return 0; }
3792 cc_check && _apple_ir=yes
3794 if test "$_apple_ir" = yes ; then
3795 def_apple_ir='#define CONFIG_APPLE_IR 1'
3796 else
3797 def_apple_ir='#undef CONFIG_APPLE_IR'
3799 echores "$_apple_ir"
3800 fi #if linux
3802 echocheck "pkg-config"
3803 _pkg_config=pkg-config
3804 if $($_pkg_config --version > /dev/null 2>&1); then
3805 if test "$_ld_static"; then
3806 _pkg_config="$_pkg_config --static"
3808 echores "yes"
3809 else
3810 _pkg_config=false
3811 echores "no"
3815 echocheck "Samba support (libsmbclient)"
3816 if test "$_smb" = yes; then
3817 extra_ldflags="$extra_ldflags -lsmbclient"
3819 if test "$_smb" = auto; then
3820 _smb=no
3821 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3822 function_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3823 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3824 done
3827 if test "$_smb" = yes; then
3828 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3829 inputmodules="smb $inputmodules"
3830 else
3831 def_smb="#undef CONFIG_LIBSMBCLIENT"
3832 noinputmodules="smb $noinputmodules"
3834 echores "$_smb"
3837 #########
3838 # VIDEO #
3839 #########
3842 echocheck "tdfxfb"
3843 if test "$_tdfxfb" = yes ; then
3844 def_tdfxfb='#define CONFIG_TDFXFB 1'
3845 vomodules="tdfxfb $vomodules"
3846 else
3847 def_tdfxfb='#undef CONFIG_TDFXFB'
3848 novomodules="tdfxfb $novomodules"
3850 echores "$_tdfxfb"
3852 echocheck "s3fb"
3853 if test "$_s3fb" = yes ; then
3854 def_s3fb='#define CONFIG_S3FB 1'
3855 vomodules="s3fb $vomodules"
3856 else
3857 def_s3fb='#undef CONFIG_S3FB'
3858 novomodules="s3fb $novomodules"
3860 echores "$_s3fb"
3862 echocheck "wii"
3863 if test "$_wii" = yes ; then
3864 def_wii='#define CONFIG_WII 1'
3865 vomodules="wii $vomodules"
3866 else
3867 def_wii='#undef CONFIG_WII'
3868 novomodules="wii $novomodules"
3870 echores "$_wii"
3872 echocheck "tdfxvid"
3873 if test "$_tdfxvid" = yes ; then
3874 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3875 vomodules="tdfx_vid $vomodules"
3876 else
3877 def_tdfxvid='#undef CONFIG_TDFX_VID'
3878 novomodules="tdfx_vid $novomodules"
3880 echores "$_tdfxvid"
3882 echocheck "xvr100"
3883 if test "$_xvr100" = auto ; then
3884 cat > $TMPC << EOF
3885 #include <unistd.h>
3886 #include <sys/fbio.h>
3887 #include <sys/visual_io.h>
3888 int main(void) {
3889 struct vis_identifier ident;
3890 struct fbgattr attr;
3891 ioctl(0, VIS_GETIDENTIFIER, &ident);
3892 ioctl(0, FBIOGATTR, &attr);
3893 return 0;
3896 _xvr100=no
3897 cc_check && _xvr100=yes
3899 if test "$_xvr100" = yes ; then
3900 def_xvr100='#define CONFIG_XVR100 1'
3901 vomodules="xvr100 $vomodules"
3902 else
3903 def_tdfxvid='#undef CONFIG_XVR100'
3904 novomodules="xvr100 $novomodules"
3906 echores "$_xvr100"
3908 echocheck "tga"
3909 if test "$_tga" = yes ; then
3910 def_tga='#define CONFIG_TGA 1'
3911 vomodules="tga $vomodules"
3912 else
3913 def_tga='#undef CONFIG_TGA'
3914 novomodules="tga $novomodules"
3916 echores "$_tga"
3919 echocheck "md5sum support"
3920 if test "$_md5sum" = yes; then
3921 def_md5sum="#define CONFIG_MD5SUM 1"
3922 vomodules="md5sum $vomodules"
3923 else
3924 def_md5sum="#undef CONFIG_MD5SUM"
3925 novomodules="md5sum $novomodules"
3927 echores "$_md5sum"
3930 echocheck "yuv4mpeg support"
3931 if test "$_yuv4mpeg" = yes; then
3932 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3933 vomodules="yuv4mpeg $vomodules"
3934 else
3935 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3936 novomodules="yuv4mpeg $novomodules"
3938 echores "$_yuv4mpeg"
3941 echocheck "bl"
3942 if test "$_bl" = yes ; then
3943 def_bl='#define CONFIG_BL 1'
3944 vomodules="bl $vomodules"
3945 else
3946 def_bl='#undef CONFIG_BL'
3947 novomodules="bl $novomodules"
3949 echores "$_bl"
3952 echocheck "DirectFB"
3953 if test "$_directfb" = auto ; then
3954 _directfb=no
3955 cat > $TMPC << EOF
3956 #include <directfb.h>
3957 #include <directfb_version.h>
3958 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3959 #error "DirectFB version too old."
3960 #endif
3961 int main(void) { DirectFBInit(0, 0); return 0; }
3963 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3964 cc_check $_inc_tmp -ldirectfb &&
3965 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3966 done
3968 if test "$_directfb" = yes ; then
3969 def_directfb='#define CONFIG_DIRECTFB 1'
3970 vomodules="directfb dfbmga $vomodules"
3971 libs_mplayer="$libs_mplayer -ldirectfb"
3972 else
3973 def_directfb='#undef CONFIG_DIRECTFB'
3974 novomodules="directfb dfbmga $novomodules"
3976 echores "$_directfb"
3979 echocheck "X11 headers presence"
3980 _x11_headers="no"
3981 res_comment="check if the dev(el) packages are installed"
3982 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3983 if test -f "$I/X11/Xlib.h" ; then
3984 _x11_headers="yes"
3985 res_comment=""
3986 break
3988 done
3989 if test $_cross_compile = no; then
3990 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3991 /usr/include/X11R6 /usr/openwin/include ; do
3992 if test -f "$I/X11/Xlib.h" ; then
3993 extra_cflags="$extra_cflags -I$I"
3994 _x11_headers="yes"
3995 res_comment="using $I"
3996 break
3998 done
4000 echores "$_x11_headers"
4003 echocheck "X11"
4004 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4005 cat > $TMPC <<EOF
4006 #include <X11/Xlib.h>
4007 #include <X11/Xutil.h>
4008 int main(void) { XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return 0; }
4010 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4011 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
4012 -L/usr/lib ; do
4013 if netbsd; then
4014 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4015 else
4016 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4018 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4019 && _x11=yes && break
4020 done
4022 if test "$_x11" = yes ; then
4023 def_x11='#define CONFIG_X11 1'
4024 vomodules="x11 xover $vomodules"
4025 else
4026 _x11=no
4027 def_x11='#undef CONFIG_X11'
4028 novomodules="x11 $novomodules"
4029 res_comment="check if the dev(el) packages are installed"
4030 # disable stuff that depends on X
4031 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4033 echores "$_x11"
4035 echocheck "Xss screensaver extensions"
4036 if test "$_xss" = auto ; then
4037 cat > $TMPC << EOF
4038 #include <X11/Xlib.h>
4039 #include <X11/extensions/scrnsaver.h>
4040 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4042 _xss=no
4043 cc_check -lXss && _xss=yes
4045 if test "$_xss" = yes ; then
4046 def_xss='#define CONFIG_XSS 1'
4047 libs_mplayer="$libs_mplayer -lXss"
4048 else
4049 def_xss='#undef CONFIG_XSS'
4051 echores "$_xss"
4053 echocheck "DPMS"
4054 _xdpms3=no
4055 _xdpms4=no
4056 if test "$_x11" = yes ; then
4057 cat > $TMPC <<EOF
4058 #include <X11/Xmd.h>
4059 #include <X11/Xlib.h>
4060 #include <X11/Xutil.h>
4061 #include <X11/Xatom.h>
4062 #include <X11/extensions/dpms.h>
4063 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
4065 cc_check -lXdpms && _xdpms3=yes
4066 cat > $TMPC <<EOF
4067 #include <X11/Xlib.h>
4068 #include <X11/extensions/dpms.h>
4069 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
4071 cc_check -lXext && _xdpms4=yes
4073 if test "$_xdpms4" = yes ; then
4074 def_xdpms='#define CONFIG_XDPMS 1'
4075 res_comment="using Xdpms 4"
4076 echores "yes"
4077 elif test "$_xdpms3" = yes ; then
4078 def_xdpms='#define CONFIG_XDPMS 1'
4079 libs_mplayer="$libs_mplayer -lXdpms"
4080 res_comment="using Xdpms 3"
4081 echores "yes"
4082 else
4083 def_xdpms='#undef CONFIG_XDPMS'
4084 echores "no"
4088 echocheck "Xv"
4089 if test "$_xv" = auto ; then
4090 cat > $TMPC <<EOF
4091 #include <X11/Xlib.h>
4092 #include <X11/extensions/Xvlib.h>
4093 int main(void) {
4094 XvGetPortAttribute(0, 0, 0, 0);
4095 XvQueryPortAttributes(0, 0, 0);
4096 return 0; }
4098 _xv=no
4099 cc_check -lXv && _xv=yes
4102 if test "$_xv" = yes ; then
4103 def_xv='#define CONFIG_XV 1'
4104 libs_mplayer="$libs_mplayer -lXv"
4105 vomodules="xv $vomodules"
4106 else
4107 def_xv='#undef CONFIG_XV'
4108 novomodules="xv $novomodules"
4110 echores "$_xv"
4113 echocheck "XvMC"
4114 if test "$_xv" = yes && test "$_xvmc" != no ; then
4115 _xvmc=no
4116 cat > $TMPC <<EOF
4117 #include <X11/Xlib.h>
4118 #include <X11/extensions/Xvlib.h>
4119 #include <X11/extensions/XvMClib.h>
4120 int main(void) {
4121 XvMCQueryExtension(0, 0, 0);
4122 XvMCCreateContext(0, 0, 0, 0, 0, 0, 0);
4123 return 0; }
4125 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4126 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4127 done
4129 if test "$_xvmc" = yes ; then
4130 def_xvmc='#define CONFIG_XVMC 1'
4131 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4132 vomodules="xvmc $vomodules"
4133 res_comment="using $_xvmclib"
4134 else
4135 def_xvmc='#define CONFIG_XVMC 0'
4136 novomodules="xvmc $novomodules"
4138 echores "$_xvmc"
4141 echocheck "VDPAU"
4142 if test "$_vdpau" = auto ; then
4143 _vdpau=no
4144 if test "$_dl" = yes ; then
4145 cat > $TMPC <<EOF
4146 #include <vdpau/vdpau_x11.h>
4147 int main(void) {
4148 vdp_device_create_x11(0, 0, 0, 0);
4149 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4151 cc_check -lvdpau && _vdpau=yes
4154 if test "$_vdpau" = yes ; then
4155 def_vdpau='#define CONFIG_VDPAU 1'
4156 libs_mplayer="$libs_mplayer -lvdpau"
4157 vomodules="vdpau $vomodules"
4158 else
4159 def_vdpau='#define CONFIG_VDPAU 0'
4160 novomodules="vdpau $novomodules"
4162 echores "$_vdpau"
4165 echocheck "Xinerama"
4166 if test "$_xinerama" = auto ; then
4167 cat > $TMPC <<EOF
4168 #include <X11/Xlib.h>
4169 #include <X11/extensions/Xinerama.h>
4170 int main(void) { XineramaIsActive(0); return 0; }
4172 _xinerama=no
4173 cc_check -lXinerama && _xinerama=yes
4176 if test "$_xinerama" = yes ; then
4177 def_xinerama='#define CONFIG_XINERAMA 1'
4178 libs_mplayer="$libs_mplayer -lXinerama"
4179 else
4180 def_xinerama='#undef CONFIG_XINERAMA'
4182 echores "$_xinerama"
4185 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4186 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4187 # named 'X extensions' or something similar.
4188 # This check may be useful for future mplayer versions (to change resolution)
4189 # If you run into problems, remove '-lXxf86vm'.
4190 echocheck "Xxf86vm"
4191 if test "$_vm" = auto ; then
4192 cat > $TMPC <<EOF
4193 #include <X11/Xlib.h>
4194 #include <X11/extensions/xf86vmode.h>
4195 int main(void) { XF86VidModeQueryExtension(0, 0, 0); return 0; }
4197 _vm=no
4198 cc_check -lXxf86vm && _vm=yes
4200 if test "$_vm" = yes ; then
4201 def_vm='#define CONFIG_XF86VM 1'
4202 libs_mplayer="$libs_mplayer -lXxf86vm"
4203 else
4204 def_vm='#undef CONFIG_XF86VM'
4206 echores "$_vm"
4208 # Check for the presence of special keycodes, like audio control buttons
4209 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4210 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4211 # have these new keycodes.
4212 echocheck "XF86keysym"
4213 if test "$_xf86keysym" = auto; then
4214 _xf86keysym=no
4215 cat > $TMPC <<EOF
4216 #include <X11/Xlib.h>
4217 #include <X11/XF86keysym.h>
4218 int main(void) { return XF86XK_AudioPause; }
4220 cc_check && _xf86keysym=yes
4222 if test "$_xf86keysym" = yes ; then
4223 def_xf86keysym='#define CONFIG_XF86XK 1'
4224 else
4225 def_xf86keysym='#undef CONFIG_XF86XK'
4227 echores "$_xf86keysym"
4229 echocheck "DGA"
4230 if test "$_dga2" = auto && test "$_x11" = yes ; then
4231 cat > $TMPC << EOF
4232 #include <X11/Xlib.h>
4233 #include <X11/extensions/xf86dga.h>
4234 int main(void) { XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4236 _dga2=no
4237 cc_check -lXxf86dga && _dga2=yes
4239 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4240 cat > $TMPC << EOF
4241 #include <X11/Xlib.h>
4242 #include <X11/extensions/xf86dga.h>
4243 int main(void) { XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4245 _dga1=no
4246 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4249 _dga=no
4250 def_dga='#undef CONFIG_DGA'
4251 def_dga1='#undef CONFIG_DGA1'
4252 def_dga2='#undef CONFIG_DGA2'
4253 if test "$_dga1" = yes ; then
4254 _dga=yes
4255 def_dga1='#define CONFIG_DGA1 1'
4256 res_comment="using DGA 1.0"
4257 elif test "$_dga2" = yes ; then
4258 _dga=yes
4259 def_dga2='#define CONFIG_DGA2 1'
4260 res_comment="using DGA 2.0"
4262 if test "$_dga" = yes ; then
4263 def_dga='#define CONFIG_DGA 1'
4264 libs_mplayer="$libs_mplayer -lXxf86dga"
4265 vomodules="dga $vomodules"
4266 else
4267 novomodules="dga $novomodules"
4269 echores "$_dga"
4272 echocheck "3dfx"
4273 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4274 def_3dfx='#define CONFIG_3DFX 1'
4275 vomodules="3dfx $vomodules"
4276 else
4277 def_3dfx='#undef CONFIG_3DFX'
4278 novomodules="3dfx $novomodules"
4280 echores "$_3dfx"
4283 echocheck "VIDIX"
4284 def_vidix='#undef CONFIG_VIDIX'
4285 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4286 _vidix_drv_cyberblade=no
4287 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4288 _vidix_drv_ivtv=no
4289 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4290 _vidix_drv_mach64=no
4291 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4292 _vidix_drv_mga=no
4293 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4294 _vidix_drv_mga_crtc2=no
4295 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4296 _vidix_drv_nvidia=no
4297 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4298 _vidix_drv_pm2=no
4299 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4300 _vidix_drv_pm3=no
4301 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4302 _vidix_drv_radeon=no
4303 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4304 _vidix_drv_rage128=no
4305 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4306 _vidix_drv_s3=no
4307 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4308 _vidix_drv_sh_veu=no
4309 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4310 _vidix_drv_sis=no
4311 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4312 _vidix_drv_unichrome=no
4313 if test "$_vidix" = auto ; then
4314 _vidix=no
4315 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4316 && _vidix=yes
4317 x86_64 && ! linux && _vidix=no
4318 (ppc || alpha) && linux && _vidix=yes
4320 echores "$_vidix"
4322 if test "$_vidix" = yes ; then
4323 def_vidix='#define CONFIG_VIDIX 1'
4324 vomodules="cvidix $vomodules"
4325 # FIXME: ivtv driver temporarily disabled until we have a proper test
4326 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4327 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4329 # some vidix drivers are architecture and os specific, discard them elsewhere
4330 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4331 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4333 for driver in $_vidix_drivers ; do
4334 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4335 eval _vidix_drv_${driver}=yes
4336 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4337 done
4339 echocheck "VIDIX PCI device name database"
4340 echores "$_vidix_pcidb"
4341 if test "$_vidix_pcidb" = yes ; then
4342 _vidix_pcidb_val=1
4343 else
4344 _vidix_pcidb_val=0
4347 echocheck "VIDIX dhahelper support"
4348 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4349 echores "$_dhahelper"
4351 echocheck "VIDIX svgalib_helper support"
4352 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4353 echores "$_svgalib_helper"
4355 else
4356 novomodules="cvidix $novomodules"
4359 if test "$_vidix" = yes && win32; then
4360 winvidix=yes
4361 vomodules="winvidix $vomodules"
4362 libs_mplayer="$libs_mplayer -lgdi32"
4363 else
4364 novomodules="winvidix $novomodules"
4366 if test "$_vidix" = yes && test "$_x11" = yes; then
4367 xvidix=yes
4368 vomodules="xvidix $vomodules"
4369 else
4370 novomodules="xvidix $novomodules"
4373 echocheck "GGI"
4374 if test "$_ggi" = auto ; then
4375 _ggi=no
4376 function_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4378 if test "$_ggi" = yes ; then
4379 def_ggi='#define CONFIG_GGI 1'
4380 libs_mplayer="$libs_mplayer -lggi"
4381 vomodules="ggi $vomodules"
4382 else
4383 def_ggi='#undef CONFIG_GGI'
4384 novomodules="ggi $novomodules"
4386 echores "$_ggi"
4388 echocheck "GGI extension: libggiwmh"
4389 if test "$_ggiwmh" = auto ; then
4390 _ggiwmh=no
4391 function_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4393 # needed to get right output on obscure combination
4394 # like --disable-ggi --enable-ggiwmh
4395 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4396 def_ggiwmh='#define CONFIG_GGIWMH 1'
4397 libs_mplayer="$libs_mplayer -lggiwmh"
4398 else
4399 _ggiwmh=no
4400 def_ggiwmh='#undef CONFIG_GGIWMH'
4402 echores "$_ggiwmh"
4405 echocheck "AA"
4406 if test "$_aa" = auto ; then
4407 cat > $TMPC << EOF
4408 #include <aalib.h>
4409 int main(void) {
4410 aa_context *c;
4411 aa_renderparams *p;
4412 aa_init(0, 0, 0);
4413 c = aa_autoinit(&aa_defparams);
4414 p = aa_getrenderparams();
4415 aa_autoinitkbd(c, 0);
4416 return 0; }
4418 _aa=no
4419 for _ld_tmp in "-laa" ; do
4420 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4421 done
4423 if test "$_aa" = yes ; then
4424 def_aa='#define CONFIG_AA 1'
4425 if cygwin ; then
4426 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4428 vomodules="aa $vomodules"
4429 else
4430 def_aa='#undef CONFIG_AA'
4431 novomodules="aa $novomodules"
4433 echores "$_aa"
4436 echocheck "CACA"
4437 if test "$_caca" = auto ; then
4438 _caca=no
4439 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4440 cat > $TMPC << EOF
4441 #include <caca.h>
4442 #ifdef CACA_API_VERSION_1
4443 #include <caca0.h>
4444 #endif
4445 int main(void) { caca_init(); return 0; }
4447 cc_check $(caca-config --libs) && _caca=yes
4450 if test "$_caca" = yes ; then
4451 def_caca='#define CONFIG_CACA 1'
4452 extra_cflags="$extra_cflags $(caca-config --cflags)"
4453 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4454 vomodules="caca $vomodules"
4455 else
4456 def_caca='#undef CONFIG_CACA'
4457 novomodules="caca $novomodules"
4459 echores "$_caca"
4462 echocheck "SVGAlib"
4463 if test "$_svga" = auto ; then
4464 _svga=no
4465 header_check vga.h -lvga $_ld_lm && _svga=yes
4467 if test "$_svga" = yes ; then
4468 def_svga='#define CONFIG_SVGALIB 1'
4469 libs_mplayer="$libs_mplayer -lvga"
4470 vomodules="svga $vomodules"
4471 else
4472 def_svga='#undef CONFIG_SVGALIB'
4473 novomodules="svga $novomodules"
4475 echores "$_svga"
4478 echocheck "FBDev"
4479 if test "$_fbdev" = auto ; then
4480 _fbdev=no
4481 linux && _fbdev=yes
4483 if test "$_fbdev" = yes ; then
4484 def_fbdev='#define CONFIG_FBDEV 1'
4485 vomodules="fbdev $vomodules"
4486 else
4487 def_fbdev='#undef CONFIG_FBDEV'
4488 novomodules="fbdev $novomodules"
4490 echores "$_fbdev"
4494 echocheck "DVB"
4495 if test "$_dvb" = auto ; then
4496 _dvb=no
4497 cat >$TMPC << EOF
4498 #include <poll.h>
4499 #include <sys/ioctl.h>
4500 #include <stdio.h>
4501 #include <time.h>
4502 #include <unistd.h>
4503 #include <linux/dvb/dmx.h>
4504 #include <linux/dvb/frontend.h>
4505 #include <linux/dvb/video.h>
4506 #include <linux/dvb/audio.h>
4507 int main(void) {return 0;}
4509 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4510 cc_check $_inc_tmp && _dvb=yes && \
4511 extra_cflags="$extra_cflags $_inc_tmp" && break
4512 done
4514 echores "$_dvb"
4515 if test "$_dvb" = yes ; then
4516 _dvbin=yes
4517 inputmodules="dvb $inputmodules"
4518 def_dvb='#define CONFIG_DVB 1'
4519 def_dvbin='#define CONFIG_DVBIN 1'
4520 aomodules="mpegpes(dvb) $aomodules"
4521 vomodules="mpegpes(dvb) $vomodules"
4522 else
4523 _dvbin=no
4524 noinputmodules="dvb $noinputmodules"
4525 def_dvb='#undef CONFIG_DVB'
4526 def_dvbin='#undef CONFIG_DVBIN '
4527 aomodules="mpegpes(file) $aomodules"
4528 vomodules="mpegpes(file) $vomodules"
4532 if darwin; then
4534 echocheck "QuickTime"
4535 if test "$quicktime" = auto ; then
4536 cat > $TMPC <<EOF
4537 #include <QuickTime/QuickTime.h>
4538 int main(void) {
4539 ImageDescription *desc;
4540 EnterMovies();
4541 ExitMovies();
4542 return 0;
4545 quicktime=no
4546 cc_check -framework QuickTime && quicktime=yes
4548 if test "$quicktime" = yes ; then
4549 extra_ldflags="$extra_ldflags -framework QuickTime"
4550 def_quicktime='#define CONFIG_QUICKTIME 1'
4551 else
4552 def_quicktime='#undef CONFIG_QUICKTIME'
4553 _quartz=no
4555 echores $quicktime
4557 echocheck "Quartz"
4558 if test "$_quartz" = auto ; then
4559 _quartz=no
4560 function_check Carbon/Carbon.h 'CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false)' -framework Carbon && _quartz=yes
4562 if test "$_quartz" = yes ; then
4563 libs_mplayer="$libs_mplayer -framework Carbon"
4564 def_quartz='#define CONFIG_QUARTZ 1'
4565 vomodules="quartz $vomodules"
4566 else
4567 def_quartz='#undef CONFIG_QUARTZ'
4568 novomodules="quartz $novomodules"
4570 echores $_quartz
4572 echocheck "CoreVideo"
4573 if test "$_corevideo" = auto ; then
4574 cat > $TMPC <<EOF
4575 #include <Carbon/Carbon.h>
4576 #include <CoreServices/CoreServices.h>
4577 #include <OpenGL/OpenGL.h>
4578 #include <QuartzCore/CoreVideo.h>
4579 int main(void) { return 0; }
4581 _corevideo=no
4582 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4584 if test "$_corevideo" = yes ; then
4585 vomodules="corevideo $vomodules"
4586 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4587 def_corevideo='#define CONFIG_COREVIDEO 1'
4588 else
4589 novomodules="corevideo $novomodules"
4590 def_corevideo='#undef CONFIG_COREVIDEO'
4592 echores "$_corevideo"
4594 fi #if darwin
4597 echocheck "PNG support"
4598 if test "$_png" = auto ; then
4599 _png=no
4600 if irix ; then
4601 # Don't check for -lpng on irix since it has its own libpng
4602 # incompatible with the GNU libpng
4603 res_comment="disabled on irix (not GNU libpng)"
4604 else
4605 cat > $TMPC << EOF
4606 #include <stdio.h>
4607 #include <string.h>
4608 #include <png.h>
4609 int main(void) {
4610 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4611 printf("libpng: %s\n", png_libpng_ver);
4612 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4615 cc_check -lpng -lz $_ld_lm && _png=yes
4618 echores "$_png"
4619 if test "$_png" = yes ; then
4620 def_png='#define CONFIG_PNG 1'
4621 extra_ldflags="$extra_ldflags -lpng -lz"
4622 else
4623 def_png='#undef CONFIG_PNG'
4626 echocheck "MNG support"
4627 if test "$_mng" = auto ; then
4628 _mng=no
4629 cat > $TMPC << EOF
4630 #include <libmng.h>
4631 int main(void) {
4632 const char * p_ver = mng_version_text();
4633 return !p_ver || p_ver[0] == 0;
4636 if cc_check -lmng -lz $_ld_lm ; then
4637 _mng=yes
4640 echores "$_mng"
4641 if test "$_mng" = yes ; then
4642 def_mng='#define CONFIG_MNG 1'
4643 extra_ldflags="$extra_ldflags -lmng -lz"
4644 else
4645 def_mng='#undef CONFIG_MNG'
4648 echocheck "JPEG support"
4649 if test "$_jpeg" = auto ; then
4650 _jpeg=no
4651 cat > $TMPC << EOF
4652 #include <stdio.h>
4653 #include <stdlib.h>
4654 #include <setjmp.h>
4655 #include <string.h>
4656 #include <jpeglib.h>
4657 int main(void) { return 0; }
4659 cc_check -ljpeg $_ld_lm && _jpeg=yes
4661 echores "$_jpeg"
4663 if test "$_jpeg" = yes ; then
4664 def_jpeg='#define CONFIG_JPEG 1'
4665 vomodules="jpeg $vomodules"
4666 extra_ldflags="$extra_ldflags -ljpeg"
4667 else
4668 def_jpeg='#undef CONFIG_JPEG'
4669 novomodules="jpeg $novomodules"
4674 echocheck "PNM support"
4675 if test "$_pnm" = yes; then
4676 def_pnm="#define CONFIG_PNM 1"
4677 vomodules="pnm $vomodules"
4678 else
4679 def_pnm="#undef CONFIG_PNM"
4680 novomodules="pnm $novomodules"
4682 echores "$_pnm"
4686 echocheck "GIF support"
4687 # This is to appease people who want to force gif support.
4688 # If it is forced to yes, then we still do checks to determine
4689 # which gif library to use.
4690 if test "$_gif" = yes ; then
4691 _force_gif=yes
4692 _gif=auto
4695 if test "$_gif" = auto ; then
4696 _gif=no
4697 for _ld_gif in "-lungif" "-lgif" ; do
4698 function_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4699 done
4702 # If no library was found, and the user wants support forced,
4703 # then we force it on with libgif, as this is the safest
4704 # assumption IMHO. (libungif & libregif both create symbolic
4705 # links to libgif. We also assume that no x11 support is needed,
4706 # because if you are forcing this, then you _should_ know what
4707 # you are doing. [ Besides, package maintainers should never
4708 # have compiled x11 deps into libungif in the first place. ] )
4709 # </rant>
4710 # --Joey
4711 if test "$_force_gif" = yes && test "$_gif" = no ; then
4712 _gif=yes
4713 _ld_gif="-lgif"
4716 if test "$_gif" = yes ; then
4717 def_gif='#define CONFIG_GIF 1'
4718 codecmodules="gif $codecmodules"
4719 vomodules="gif89a $vomodules"
4720 res_comment="old version, some encoding functions disabled"
4721 def_gif_4='#undef CONFIG_GIF_4'
4722 extra_ldflags="$extra_ldflags $_ld_gif"
4724 cat > $TMPC << EOF
4725 #include <signal.h>
4726 #include <stdio.h>
4727 #include <stdlib.h>
4728 #include <gif_lib.h>
4729 static void catch(int sig) { exit(1); }
4730 int main(void) {
4731 signal(SIGSEGV, catch); // catch segfault
4732 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4733 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4734 return 0;
4737 if cc_check "$_ld_gif" ; then
4738 def_gif_4='#define CONFIG_GIF_4 1'
4739 res_comment=""
4741 else
4742 def_gif='#undef CONFIG_GIF'
4743 def_gif_4='#undef CONFIG_GIF_4'
4744 novomodules="gif89a $novomodules"
4745 nocodecmodules="gif $nocodecmodules"
4747 echores "$_gif"
4750 case "$_gif" in yes*)
4751 echocheck "broken giflib workaround"
4752 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4754 cat > $TMPC << EOF
4755 #include <stdio.h>
4756 #include <gif_lib.h>
4757 int main(void) {
4758 GifFileType gif = {.UserData = NULL};
4759 printf("UserData is at address %p\n", gif.UserData);
4760 return 0;
4763 if cc_check "$_ld_gif" ; then
4764 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4765 echores "disabled"
4766 else
4767 echores "enabled"
4770 esac
4773 echocheck "VESA support"
4774 if test "$_vesa" = auto ; then
4775 _vesa=no
4776 function_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4778 if test "$_vesa" = yes ; then
4779 def_vesa='#define CONFIG_VESA 1'
4780 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4781 vomodules="vesa $vomodules"
4782 else
4783 def_vesa='#undef CONFIG_VESA'
4784 novomodules="vesa $novomodules"
4786 echores "$_vesa"
4788 #################
4789 # VIDEO + AUDIO #
4790 #################
4793 echocheck "SDL"
4794 _inc_tmp=""
4795 _ld_tmp=""
4796 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4797 if test -z "$_sdlconfig" ; then
4798 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4799 _sdlconfig="sdl-config"
4800 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4801 _sdlconfig="sdl11-config"
4802 else
4803 _sdlconfig=false
4806 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4807 cat > $TMPC << EOF
4808 #ifdef CONFIG_SDL_SDL_H
4809 #include <SDL/SDL.h>
4810 #else
4811 #include <SDL.h>
4812 #endif
4813 #ifndef __APPLE__
4814 // we allow SDL hacking our main() only on OSX
4815 #undef main
4816 #endif
4817 int main(int argc, char *argv[]) {
4818 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4819 return 0;
4822 _sdl=no
4823 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4824 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4825 _sdl=yes
4826 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4827 break
4829 done
4830 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4831 res_comment="using $_sdlconfig"
4832 if cygwin ; then
4833 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4834 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4835 elif mingw32 ; then
4836 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4837 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4838 else
4839 _inc_tmp="$($_sdlconfig --cflags)"
4840 _ld_tmp="$($_sdlconfig --libs)"
4842 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4843 _sdl=yes
4844 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4845 # HACK for BeOS/Haiku SDL
4846 _ld_tmp="$_ld_tmp -lstdc++"
4847 _sdl=yes
4851 if test "$_sdl" = yes ; then
4852 def_sdl='#define CONFIG_SDL 1'
4853 extra_cflags="$extra_cflags $_inc_tmp"
4854 libs_mplayer="$libs_mplayer $_ld_tmp"
4855 vomodules="sdl $vomodules"
4856 aomodules="sdl $aomodules"
4857 else
4858 def_sdl='#undef CONFIG_SDL'
4859 novomodules="sdl $novomodules"
4860 noaomodules="sdl $noaomodules"
4862 echores "$_sdl"
4865 # make sure this stays below CoreVideo to avoid issues due to namespace
4866 # conflicts between -lGL and -framework OpenGL
4867 echocheck "OpenGL"
4868 #Note: this test is run even with --enable-gl since we autodetect linker flags
4869 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
4870 cat > $TMPC << EOF
4871 #ifdef GL_WIN32
4872 #include <windows.h>
4873 #include <GL/gl.h>
4874 #elif defined(GL_SDL)
4875 #include <GL/gl.h>
4876 #ifdef CONFIG_SDL_SDL_H
4877 #include <SDL/SDL.h>
4878 #else
4879 #include <SDL.h>
4880 #endif
4881 #ifndef __APPLE__
4882 // we allow SDL hacking our main() only on OSX
4883 #undef main
4884 #endif
4885 #else
4886 #include <GL/gl.h>
4887 #include <X11/Xlib.h>
4888 #include <GL/glx.h>
4889 #endif
4890 int main(int argc, char *argv[]) {
4891 #ifdef GL_WIN32
4892 HDC dc;
4893 wglCreateContext(dc);
4894 #elif defined(GL_SDL)
4895 SDL_GL_SwapBuffers();
4896 #else
4897 glXCreateContext(NULL, NULL, NULL, True);
4898 #endif
4899 glFinish();
4900 return 0;
4903 _gl=no
4904 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4905 if cc_check $_ld_tmp $_ld_lm ; then
4906 _gl=yes
4907 _gl_x11=yes
4908 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4909 break
4911 done
4912 if cc_check -DGL_WIN32 -lopengl32 ; then
4913 _gl=yes
4914 _gl_win32=yes
4915 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4917 # last so it can reuse any linker etc. flags detected before
4918 if test "$_sdl" = yes ; then
4919 if cc_check -DGL_SDL ||
4920 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4921 _gl=yes
4922 _gl_sdl=yes
4923 elif cc_check -DGL_SDL -lGL ||
4924 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4925 _gl=yes
4926 _gl_sdl=yes
4927 libs_mplayer="$libs_mplayer -lGL"
4930 else
4931 _gl=no
4933 if test "$_gl" = yes ; then
4934 def_gl='#define CONFIG_GL 1'
4935 res_comment="backends:"
4936 if test "$_gl_win32" = yes ; then
4937 def_gl_win32='#define CONFIG_GL_WIN32 1'
4938 res_comment="$res_comment win32"
4940 if test "$_gl_x11" = yes ; then
4941 def_gl_x11='#define CONFIG_GL_X11 1'
4942 res_comment="$res_comment x11"
4944 if test "$_gl_sdl" = yes ; then
4945 def_gl_sdl='#define CONFIG_GL_SDL 1'
4946 res_comment="$res_comment sdl"
4948 vomodules="opengl $vomodules"
4949 else
4950 def_gl='#undef CONFIG_GL'
4951 def_gl_win32='#undef CONFIG_GL_WIN32'
4952 def_gl_x11='#undef CONFIG_GL_X11'
4953 def_gl_sdl='#undef CONFIG_GL_SDL'
4954 novomodules="opengl $novomodules"
4956 echores "$_gl"
4959 echocheck "MatrixView"
4960 if test "$_gl" = no ; then
4961 matrixview=no
4963 if test "$matrixview" = yes ; then
4964 vomodules="matrixview $vomodules"
4965 def_matrixview='#define CONFIG_MATRIXVIEW 1'
4966 else
4967 novomodules="matrixview $novomodules"
4968 def_matrixview='#undef CONFIG_MATRIXVIEW'
4970 echores "$matrixview"
4973 if os2 ; then
4974 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
4975 if test "$_kva" = auto; then
4976 _kva=no;
4977 header_check_broken os2.h kva.h -lkva && _kva=yes
4979 if test "$_kva" = yes ; then
4980 def_kva='#define CONFIG_KVA 1'
4981 libs_mplayer="$libs_mplayer -lkva"
4982 vomodules="kva $vomodules"
4983 else
4984 def_kva='#undef CONFIG_KVA'
4985 novomodules="kva $novomodules"
4987 echores "$_kva"
4988 fi #if os2
4991 if win32; then
4993 echocheck "Windows waveout"
4994 if test "$_win32waveout" = auto ; then
4995 cat > $TMPC << EOF
4996 #include <windows.h>
4997 #include <mmsystem.h>
4998 int main(void) { return 0; }
5000 _win32waveout=no
5001 cc_check -lwinmm && _win32waveout=yes
5003 if test "$_win32waveout" = yes ; then
5004 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5005 libs_mplayer="$libs_mplayer -lwinmm"
5006 aomodules="win32 $aomodules"
5007 else
5008 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5009 noaomodules="win32 $noaomodules"
5011 echores "$_win32waveout"
5013 echocheck "Direct3D"
5014 if test "$_direct3d" = auto ; then
5015 cat > $TMPC << EOF
5016 #include <windows.h>
5017 #include <d3d9.h>
5018 int main(void) { return 0; }
5020 _direct3d=no
5021 cc_check && _direct3d=yes
5023 if test "$_direct3d" = yes ; then
5024 def_direct3d='#define CONFIG_DIRECT3D 1'
5025 vomodules="direct3d $vomodules"
5026 else
5027 def_direct3d='#undef CONFIG_DIRECT3D'
5028 novomodules="direct3d $novomodules"
5030 echores "$_direct3d"
5032 echocheck "Directx"
5033 if test "$_directx" = auto ; then
5034 cat > $TMPC << EOF
5035 #include <windows.h>
5036 #include <ddraw.h>
5037 #include <dsound.h>
5038 int main(void) { return 0; }
5040 _directx=no
5041 cc_check -lgdi32 && _directx=yes
5043 if test "$_directx" = yes ; then
5044 def_directx='#define CONFIG_DIRECTX 1'
5045 libs_mplayer="$libs_mplayer -lgdi32"
5046 vomodules="directx $vomodules"
5047 aomodules="dsound $aomodules"
5048 else
5049 def_directx='#undef CONFIG_DIRECTX'
5050 novomodules="directx $novomodules"
5051 noaomodules="dsound $noaomodules"
5053 echores "$_directx"
5055 fi #if win32; then
5058 echocheck "DXR2"
5059 if test "$_dxr2" = auto; then
5060 _dxr2=no
5061 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5062 header_check dxr2ioctl.h $_inc_tmp && _dxr2=yes &&
5063 extra_cflags="$extra_cflags $_inc_tmp" && break
5064 done
5066 if test "$_dxr2" = yes; then
5067 def_dxr2='#define CONFIG_DXR2 1'
5068 aomodules="dxr2 $aomodules"
5069 vomodules="dxr2 $vomodules"
5070 else
5071 def_dxr2='#undef CONFIG_DXR2'
5072 noaomodules="dxr2 $noaomodules"
5073 novomodules="dxr2 $novomodules"
5075 echores "$_dxr2"
5077 echocheck "DXR3/H+"
5078 if test "$_dxr3" = auto ; then
5079 _dxr3=no
5080 header_check linux/em8300.h && _dxr3=yes
5082 if test "$_dxr3" = yes ; then
5083 def_dxr3='#define CONFIG_DXR3 1'
5084 vomodules="dxr3 $vomodules"
5085 else
5086 def_dxr3='#undef CONFIG_DXR3'
5087 novomodules="dxr3 $novomodules"
5089 echores "$_dxr3"
5092 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5093 if test "$_ivtv" = auto ; then
5094 cat > $TMPC << EOF
5095 #include <stdlib.h>
5096 #include <inttypes.h>
5097 #include <linux/types.h>
5098 #include <linux/videodev2.h>
5099 #include <linux/ivtv.h>
5100 #include <sys/ioctl.h>
5101 int main(void) {
5102 struct ivtv_cfg_stop_decode sd;
5103 struct ivtv_cfg_start_decode sd1;
5104 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5105 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5106 return 0; }
5108 _ivtv=no
5109 cc_check && _ivtv=yes
5111 if test "$_ivtv" = yes ; then
5112 def_ivtv='#define CONFIG_IVTV 1'
5113 vomodules="ivtv $vomodules"
5114 aomodules="ivtv $aomodules"
5115 else
5116 def_ivtv='#undef CONFIG_IVTV'
5117 novomodules="ivtv $novomodules"
5118 noaomodules="ivtv $noaomodules"
5120 echores "$_ivtv"
5123 echocheck "V4L2 MPEG Decoder"
5124 if test "$_v4l2" = auto ; then
5125 cat > $TMPC << EOF
5126 #include <stdlib.h>
5127 #include <inttypes.h>
5128 #include <linux/types.h>
5129 #include <linux/videodev2.h>
5130 #include <linux/version.h>
5131 int main(void) {
5132 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5133 #error kernel headers too old, need 2.6.22
5134 #endif
5135 struct v4l2_ext_controls ctrls;
5136 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5137 return 0;
5140 _v4l2=no
5141 cc_check && _v4l2=yes
5143 if test "$_v4l2" = yes ; then
5144 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5145 vomodules="v4l2 $vomodules"
5146 aomodules="v4l2 $aomodules"
5147 else
5148 def_v4l2='#undef CONFIG_V4L2_DECODER'
5149 novomodules="v4l2 $novomodules"
5150 noaomodules="v4l2 $noaomodules"
5152 echores "$_v4l2"
5156 #########
5157 # AUDIO #
5158 #########
5161 echocheck "OSS Audio"
5162 if test "$_ossaudio" = auto ; then
5163 cat > $TMPC << EOF
5164 #include <$_soundcard_header>
5165 int main(void) { return SNDCTL_DSP_SETFRAGMENT; }
5167 _ossaudio=no
5168 cc_check && _ossaudio=yes
5170 if test "$_ossaudio" = yes ; then
5171 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5172 aomodules="oss $aomodules"
5173 cat > $TMPC << EOF
5174 #include <$_soundcard_header>
5175 #ifdef OPEN_SOUND_SYSTEM
5176 int main(void) { return 0; }
5177 #else
5178 #error Not the real thing
5179 #endif
5181 _real_ossaudio=no
5182 cc_check && _real_ossaudio=yes
5183 if test "$_real_ossaudio" = yes; then
5184 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5185 # Check for OSS4 headers (override default headers)
5186 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
5187 if test -f /etc/oss.conf; then
5188 . /etc/oss.conf
5189 _ossinc="$OSSLIBDIR/include"
5190 if test -f "$_ossinc/sys/soundcard.h"; then
5191 extra_cflags="-I$_ossinc $extra_cflags"
5194 elif netbsd || openbsd ; then
5195 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5196 extra_ldflags="$extra_ldflags -lossaudio"
5197 else
5198 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5200 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5201 else
5202 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5203 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5204 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5205 noaomodules="oss $noaomodules"
5207 echores "$_ossaudio"
5210 echocheck "aRts"
5211 if test "$_arts" = auto ; then
5212 _arts=no
5213 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5214 function_check artsc.h 'arts_init()' $(artsc-config --libs) $(artsc-config --cflags) &&
5215 _arts=yes
5219 if test "$_arts" = yes ; then
5220 def_arts='#define CONFIG_ARTS 1'
5221 aomodules="arts $aomodules"
5222 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5223 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5224 else
5225 noaomodules="arts $noaomodules"
5227 echores "$_arts"
5230 echocheck "EsounD"
5231 if test "$_esd" = auto ; then
5232 _esd=no
5233 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5234 function_check esd.h 'esd_open_sound("test")' $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5237 echores "$_esd"
5239 if test "$_esd" = yes ; then
5240 def_esd='#define CONFIG_ESD 1'
5241 aomodules="esd $aomodules"
5242 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5243 extra_cflags="$extra_cflags $(esd-config --cflags)"
5245 echocheck "esd_get_latency()"
5246 function_check esd.h 'esd_get_latency(0)' $(esd-config --libs) $(esd-config --cflags) &&
5247 _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5248 echores "$_esd_latency"
5249 else
5250 def_esd='#undef CONFIG_ESD'
5251 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5252 noaomodules="esd $noaomodules"
5256 echocheck "NAS"
5257 if test "$_nas" = auto ; then
5258 _nas=no
5259 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
5261 if test "$_nas" = yes ; then
5262 def_nas='#define CONFIG_NAS 1'
5263 libs_mplayer="$libs_mplayer -laudio -lXt"
5264 aomodules="nas $aomodules"
5265 else
5266 noaomodules="nas $noaomodules"
5267 def_nas='#undef CONFIG_NAS'
5269 echores "$_nas"
5272 echocheck "pulse"
5273 if test "$_pulse" = auto ; then
5274 _pulse=no
5275 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5276 header_check pulse/pulseaudio.h $($_pkg_config --libs --cflags libpulse) &&
5277 _pulse=yes
5280 echores "$_pulse"
5282 if test "$_pulse" = yes ; then
5283 def_pulse='#define CONFIG_PULSE 1'
5284 aomodules="pulse $aomodules"
5285 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5286 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5287 else
5288 def_pulse='#undef CONFIG_PULSE'
5289 noaomodules="pulse $noaomodules"
5293 echocheck "JACK"
5294 if test "$_jack" = auto ; then
5295 _jack=yes
5296 if function_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' -ljack ; then
5297 libs_mplayer="$libs_mplayer -ljack"
5298 elif function_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' $($_pkg_config --libs --cflags --silence-errors jack) ; then
5299 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5300 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5301 else
5302 _jack=no
5306 if test "$_jack" = yes ; then
5307 def_jack='#define CONFIG_JACK 1'
5308 aomodules="jack $aomodules"
5309 else
5310 noaomodules="jack $noaomodules"
5312 echores "$_jack"
5314 echocheck "OpenAL"
5315 if test "$_openal" = auto ; then
5316 _openal=no
5317 cat > $TMPC << EOF
5318 #ifdef OPENAL_AL_H
5319 #include <OpenAL/al.h>
5320 #else
5321 #include <AL/al.h>
5322 #endif
5323 int main(void) {
5324 alSourceQueueBuffers(0, 0, 0);
5325 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5326 return 0;
5329 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5330 cc_check $I && _openal=yes && break
5331 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5332 done
5333 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5335 if test "$_openal" = yes ; then
5336 def_openal='#define CONFIG_OPENAL 1'
5337 aomodules="openal $aomodules"
5338 else
5339 noaomodules="openal $noaomodules"
5341 echores "$_openal"
5343 echocheck "ALSA audio"
5344 if test "$_alloca" != yes ; then
5345 _alsa=no
5346 res_comment="alloca missing"
5348 if test "$_alsa" != no ; then
5349 _alsa=no
5350 cat > $TMPC << EOF
5351 #include <sys/asoundlib.h>
5352 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5353 #error "alsa version != 0.5.x"
5354 #endif
5355 int main(void) { return 0; }
5357 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5359 cat > $TMPC << EOF
5360 #include <sys/asoundlib.h>
5361 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5362 #error "alsa version != 0.9.x"
5363 #endif
5364 int main(void) { return 0; }
5366 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5367 cat > $TMPC << EOF
5368 #include <alsa/asoundlib.h>
5369 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5370 #error "alsa version != 0.9.x"
5371 #endif
5372 int main(void) { return 0; }
5374 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5376 cat > $TMPC << EOF
5377 #include <sys/asoundlib.h>
5378 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5379 #error "alsa version != 1.0.x"
5380 #endif
5381 int main(void) { return 0; }
5383 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5384 cat > $TMPC << EOF
5385 #include <alsa/asoundlib.h>
5386 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5387 #error "alsa version != 1.0.x"
5388 #endif
5389 int main(void) { return 0; }
5391 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5393 def_alsa='#undef CONFIG_ALSA'
5394 def_alsa5='#undef CONFIG_ALSA5'
5395 def_alsa9='#undef CONFIG_ALSA9'
5396 def_alsa1x='#undef CONFIG_ALSA1X'
5397 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5398 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5399 if test "$_alsaver" ; then
5400 _alsa=yes
5401 if test "$_alsaver" = '0.5.x' ; then
5402 _alsa5=yes
5403 aomodules="alsa5 $aomodules"
5404 def_alsa5='#define CONFIG_ALSA5 1'
5405 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5406 res_comment="using alsa 0.5.x and sys/asoundlib.h"
5407 elif test "$_alsaver" = '0.9.x-sys' ; then
5408 _alsa9=yes
5409 aomodules="alsa $aomodules"
5410 def_alsa='#define CONFIG_ALSA 1'
5411 def_alsa9='#define CONFIG_ALSA9 1'
5412 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5413 res_comment="using alsa 0.9.x and sys/asoundlib.h"
5414 elif test "$_alsaver" = '0.9.x-alsa' ; then
5415 _alsa9=yes
5416 aomodules="alsa $aomodules"
5417 def_alsa='#define CONFIG_ALSA 1'
5418 def_alsa9='#define CONFIG_ALSA9 1'
5419 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5420 res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5421 elif test "$_alsaver" = '1.0.x-sys' ; then
5422 _alsa1x=yes
5423 aomodules="alsa $aomodules"
5424 def_alsa='#define CONFIG_ALSA 1'
5425 def_alsa1x="#define CONFIG_ALSA1X 1"
5426 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5427 res_comment="using alsa 1.0.x and sys/asoundlib.h"
5428 elif test "$_alsaver" = '1.0.x-alsa' ; then
5429 _alsa1x=yes
5430 aomodules="alsa $aomodules"
5431 def_alsa='#define CONFIG_ALSA 1'
5432 def_alsa1x="#define CONFIG_ALSA1X 1"
5433 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5434 res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5435 else
5436 _alsa=no
5437 res_comment="unknown version"
5439 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5440 else
5441 noaomodules="alsa $noaomodules"
5443 echores "$_alsa"
5446 echocheck "Sun audio"
5447 if test "$_sunaudio" = auto ; then
5448 cat > $TMPC << EOF
5449 #include <sys/types.h>
5450 #include <sys/audioio.h>
5451 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5453 _sunaudio=no
5454 cc_check && _sunaudio=yes
5456 if test "$_sunaudio" = yes ; then
5457 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5458 aomodules="sun $aomodules"
5459 else
5460 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5461 noaomodules="sun $noaomodules"
5463 echores "$_sunaudio"
5466 def_mlib='#define CONFIG_MLIB 0'
5467 if sunos; then
5468 echocheck "Sun mediaLib"
5469 if test "$_mlib" = auto ; then
5470 _mlib=no
5471 cc_check mlib.h "mlib_VideoColorYUV2ABGR420(0, 0, 0, 0, 0, 0, 0, 0, 0)" -lmlib &&
5472 _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5474 echores "$_mlib"
5475 fi #if sunos
5478 if darwin; then
5479 echocheck "CoreAudio"
5480 if test "$_coreaudio" = auto ; then
5481 cat > $TMPC <<EOF
5482 #include <CoreAudio/CoreAudio.h>
5483 #include <AudioToolbox/AudioToolbox.h>
5484 #include <AudioUnit/AudioUnit.h>
5485 int main(void) { return 0; }
5487 _coreaudio=no
5488 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5490 if test "$_coreaudio" = yes ; then
5491 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5492 def_coreaudio='#define CONFIG_COREAUDIO 1'
5493 aomodules="coreaudio $aomodules"
5494 else
5495 def_coreaudio='#undef CONFIG_COREAUDIO'
5496 noaomodules="coreaudio $noaomodules"
5498 echores $_coreaudio
5499 fi #if darwin
5502 if irix; then
5503 echocheck "SGI audio"
5504 if test "$_sgiaudio" = auto ; then
5505 _sgiaudio=no
5506 header_check dmedia/audio.h && _sgiaudio=yes
5508 if test "$_sgiaudio" = "yes" ; then
5509 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5510 libs_mplayer="$libs_mplayer -laudio"
5511 aomodules="sgi $aomodules"
5512 else
5513 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5514 noaomodules="sgi $noaomodules"
5516 echores "$_sgiaudio"
5517 fi #if irix
5520 if os2 ; then
5521 echocheck "KAI (UNIAUD/DART)"
5522 if test "$_kai" = auto; then
5523 _kai=no;
5524 header_check_broken os2.h kai.h -lkai && _kai=yes
5526 if test "$_kai" = yes ; then
5527 def_kai='#define CONFIG_KAI 1'
5528 libs_mplayer="$libs_mplayer -lkai"
5529 aomodules="kai $aomodules"
5530 else
5531 def_kai='#undef CONFIG_KAI'
5532 noaomodules="kai $noaomodules"
5534 echores "$_kai"
5536 echocheck "DART"
5537 if test "$_dart" = auto; then
5538 _dart=no;
5539 header_check_broken os2.h dart.h -ldart && _dart=yes
5541 if test "$_dart" = yes ; then
5542 def_dart='#define CONFIG_DART 1'
5543 libs_mplayer="$libs_mplayer -ldart"
5544 aomodules="dart $aomodules"
5545 else
5546 def_dart='#undef CONFIG_DART'
5547 noaomodules="dart $noaomodules"
5549 echores "$_dart"
5550 fi #if os2
5553 # set default CD/DVD devices
5554 if win32 || os2 ; then
5555 default_cdrom_device="D:"
5556 elif darwin ; then
5557 default_cdrom_device="/dev/disk1"
5558 elif dragonfly ; then
5559 default_cdrom_device="/dev/cd0"
5560 elif freebsd ; then
5561 default_cdrom_device="/dev/acd0"
5562 elif openbsd ; then
5563 default_cdrom_device="/dev/rcd0c"
5564 elif sunos ; then
5565 default_cdrom_device="/vol/dev/aliases/cdrom0"
5566 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5567 # file system and the volfs service.
5568 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5569 elif amigaos ; then
5570 default_cdrom_device="a1ide.device:2"
5571 else
5572 default_cdrom_device="/dev/cdrom"
5575 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5576 default_dvd_device=$default_cdrom_device
5577 elif darwin ; then
5578 default_dvd_device="/dev/rdiskN"
5579 else
5580 default_dvd_device="/dev/dvd"
5584 echocheck "VCD support"
5585 if test "$_vcd" = auto; then
5586 _vcd=no
5587 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
5588 _vcd=yes
5589 elif mingw32; then
5590 header_check ddk/ntddcdrm.h && _vcd=yes
5593 if test "$_vcd" = yes; then
5594 inputmodules="vcd $inputmodules"
5595 def_vcd='#define CONFIG_VCD 1'
5596 else
5597 def_vcd='#undef CONFIG_VCD'
5598 noinputmodules="vcd $noinputmodules"
5599 res_comment="not supported on this OS"
5601 echores "$_vcd"
5605 echocheck "Blu-ray support"
5606 if test "$_bluray" = auto ; then
5607 _bluray=no
5608 function_check libbluray/bluray.h 'bd_get_title_info(0, 0)' -lbluray && _bluray=yes
5610 if test "$_bluray" = yes ; then
5611 def_bluray='#define CONFIG_LIBBLURAY 1'
5612 extra_ldflags="$extra_ldflags -lbluray"
5613 inputmodules="bluray $inputmodules"
5614 else
5615 def_bluray='#undef CONFIG_LIBBLURAY'
5616 noinputmodules="bluray $noinputmodules"
5618 echores "$_bluray"
5620 echocheck "dvdread"
5621 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5622 _dvdread_internal=no
5624 if test "$_dvdread_internal" = auto ; then
5625 _dvdread_internal=no
5626 _dvdread=no
5627 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5628 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5629 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5630 || darwin || win32 || os2; then
5631 _dvdread_internal=yes
5632 _dvdread=yes
5633 extra_cflags="-Ilibdvdread4 $extra_cflags"
5635 elif test "$_dvdread" = auto ; then
5636 _dvdread=no
5637 if test "$_dl" = yes; then
5638 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5639 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5640 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5641 _dvdread=yes
5642 extra_cflags="$extra_cflags $_dvdreadcflags"
5643 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5644 res_comment="external"
5649 if test "$_dvdread_internal" = yes; then
5650 def_dvdread='#define CONFIG_DVDREAD 1'
5651 inputmodules="dvdread(internal) $inputmodules"
5652 _largefiles=yes
5653 res_comment="internal"
5654 elif test "$_dvdread" = yes; then
5655 def_dvdread='#define CONFIG_DVDREAD 1'
5656 _largefiles=yes
5657 extra_ldflags="$extra_ldflags -ldvdread"
5658 inputmodules="dvdread(external) $inputmodules"
5659 res_comment="external"
5660 else
5661 def_dvdread='#undef CONFIG_DVDREAD'
5662 noinputmodules="dvdread $noinputmodules"
5664 echores "$_dvdread"
5667 echocheck "internal libdvdcss"
5668 if test "$_libdvdcss_internal" = auto ; then
5669 _libdvdcss_internal=no
5670 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5671 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5673 if test "$_libdvdcss_internal" = yes ; then
5674 if linux || netbsd || openbsd || bsdos ; then
5675 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5676 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5677 elif freebsd || dragonfly ; then
5678 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5679 elif darwin ; then
5680 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5681 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5682 elif cygwin ; then
5683 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5684 elif beos ; then
5685 cflags_libdvdcss="-DSYS_BEOS"
5686 elif os2 ; then
5687 cflags_libdvdcss="-DSYS_OS2"
5689 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5690 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5691 inputmodules="libdvdcss(internal) $inputmodules"
5692 _largefiles=yes
5693 else
5694 noinputmodules="libdvdcss(internal) $noinputmodules"
5696 echores "$_libdvdcss_internal"
5699 echocheck "cdparanoia"
5700 if test "$_cdparanoia" = auto ; then
5701 cat > $TMPC <<EOF
5702 #include <cdda_interface.h>
5703 #include <cdda_paranoia.h>
5704 // This need a better test. How ?
5705 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5707 _cdparanoia=no
5708 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5709 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5710 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5711 done
5713 if test "$_cdparanoia" = yes ; then
5714 _cdda='yes'
5715 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5716 openbsd && extra_ldflags="$extra_ldflags -lutil"
5718 echores "$_cdparanoia"
5721 echocheck "libcdio"
5722 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5723 cat > $TMPC << EOF
5724 #include <stdio.h>
5725 #include <cdio/version.h>
5726 #include <cdio/cdda.h>
5727 #include <cdio/paranoia.h>
5728 int main(void) {
5729 void *test = cdda_verbose_set;
5730 printf("%s\n", CDIO_VERSION);
5731 return test == (void *)1;
5734 _libcdio=no
5735 for _ld_tmp in "" "-lwinmm" ; do
5736 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5737 cc_check $_ld_tmp $_ld_lm \
5738 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5739 done
5740 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5741 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
5742 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
5743 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5744 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5747 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5748 _cdda='yes'
5749 def_libcdio='#define CONFIG_LIBCDIO 1'
5750 def_havelibcdio='yes'
5751 else
5752 if test "$_cdparanoia" = yes ; then
5753 res_comment="using cdparanoia"
5755 def_libcdio='#undef CONFIG_LIBCDIO'
5756 def_havelibcdio='no'
5758 echores "$_libcdio"
5760 if test "$_cdda" = yes ; then
5761 test $_cddb = auto && test $networking = yes && _cddb=yes
5762 def_cdparanoia='#define CONFIG_CDDA 1'
5763 inputmodules="cdda $inputmodules"
5764 else
5765 def_cdparanoia='#undef CONFIG_CDDA'
5766 noinputmodules="cdda $noinputmodules"
5769 if test "$_cddb" = yes ; then
5770 def_cddb='#define CONFIG_CDDB 1'
5771 inputmodules="cddb $inputmodules"
5772 else
5773 _cddb=no
5774 def_cddb='#undef CONFIG_CDDB'
5775 noinputmodules="cddb $noinputmodules"
5778 echocheck "bitmap font support"
5779 if test "$_bitmap_font" = yes ; then
5780 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5781 else
5782 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5784 echores "$_bitmap_font"
5787 echocheck "freetype >= 2.0.9"
5789 # freetype depends on iconv
5790 if test "$_iconv" = no ; then
5791 _freetype=no
5792 res_comment="iconv support needed"
5795 if test "$_freetype" = auto ; then
5796 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5797 cat > $TMPC << EOF
5798 #include <stdio.h>
5799 #include <ft2build.h>
5800 #include FT_FREETYPE_H
5801 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5802 #error "Need FreeType 2.0.9 or newer"
5803 #endif
5804 int main(void) {
5805 FT_Library library;
5806 FT_Init_FreeType(&library);
5807 return 0;
5810 _freetype=no
5811 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
5812 else
5813 _freetype=no
5816 if test "$_freetype" = yes ; then
5817 def_freetype='#define CONFIG_FREETYPE 1'
5818 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
5819 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
5820 else
5821 def_freetype='#undef CONFIG_FREETYPE'
5823 echores "$_freetype"
5825 if test "$_freetype" = no ; then
5826 _fontconfig=no
5827 res_comment="FreeType support needed"
5829 echocheck "fontconfig"
5830 if test "$_fontconfig" = auto ; then
5831 cat > $TMPC << EOF
5832 #include <stdio.h>
5833 #include <stdlib.h>
5834 #include <fontconfig/fontconfig.h>
5835 #if FC_VERSION < 20402
5836 #error At least version 2.4.2 of fontconfig required
5837 #endif
5838 int main(void) {
5839 int err = FcInit();
5840 if (err == FcFalse) {
5841 printf("Couldn't initialize fontconfig lib\n");
5842 exit(err);
5844 return 0;
5847 _fontconfig=no
5848 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
5849 _ld_tmp="-lfontconfig $_ld_tmp"
5850 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5851 done
5852 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5853 _inc_tmp=$($_pkg_config --cflags fontconfig)
5854 _ld_tmp=$($_pkg_config --libs fontconfig)
5855 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5856 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5859 if test "$_fontconfig" = yes ; then
5860 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5861 else
5862 def_fontconfig='#undef CONFIG_FONTCONFIG'
5864 echores "$_fontconfig"
5867 echocheck "SSA/ASS support"
5868 if test "$_ass" = auto -o "$_ass" = yes ; then
5869 if $_pkg_config libass; then
5870 _ass=yes
5871 def_ass='#define CONFIG_ASS 1'
5872 extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
5873 extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
5874 else
5875 _ass=no
5876 def_ass='#undef CONFIG_ASS'
5878 else
5879 def_ass='#undef CONFIG_ASS'
5881 echores "$_ass"
5884 echocheck "fribidi with charsets"
5885 _inc_tmp=""
5886 _ld_tmp=""
5887 if test "$_fribidi" = auto ; then
5888 cat > $TMPC << EOF
5889 #include <stdlib.h>
5890 /* workaround for fribidi 0.10.4 and below */
5891 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5892 #include <fribidi/fribidi.h>
5893 int main(void) {
5894 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8)
5895 exit(1);
5896 return 0;
5899 _fribidi=no
5900 _inc_tmp=""
5901 _ld_tmp="-lfribidi"
5902 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5903 if $_pkg_config --exists fribidi > /dev/null 2>&1 &&
5904 test "$_fribidi" = no ; then
5905 _inc_tmp="$($_pkg_config --cflags)"
5906 _ld_tmp="$($_pkg_config --libs)"
5907 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5910 if test "$_fribidi" = yes ; then
5911 def_fribidi='#define CONFIG_FRIBIDI 1'
5912 extra_cflags="$extra_cflags $_inc_tmp"
5913 extra_ldflags="$extra_ldflags $_ld_tmp"
5914 else
5915 def_fribidi='#undef CONFIG_FRIBIDI'
5917 echores "$_fribidi"
5920 echocheck "ENCA"
5921 if test "$_enca" = auto ; then
5922 cat > $TMPC << EOF
5923 #include <sys/types.h>
5924 #include <enca.h>
5925 int main(void) {
5926 const char **langs;
5927 size_t langcnt;
5928 langs = enca_get_languages(&langcnt);
5929 return 0;
5932 _enca=no
5933 cc_check -lenca $_ld_lm && _enca=yes
5935 if test "$_enca" = yes ; then
5936 def_enca='#define CONFIG_ENCA 1'
5937 extra_ldflags="$extra_ldflags -lenca"
5938 else
5939 def_enca='#undef CONFIG_ENCA'
5941 echores "$_enca"
5944 echocheck "zlib"
5945 _zlib=no
5946 function_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5947 if test "$_zlib" = yes ; then
5948 def_zlib='#define CONFIG_ZLIB 1'
5949 extra_ldflags="$extra_ldflags -lz"
5950 else
5951 def_zlib='#define CONFIG_ZLIB 0'
5953 echores "$_zlib"
5956 echocheck "bzlib"
5957 bzlib=no
5958 def_bzlib='#define CONFIG_BZLIB 0'
5959 function_check bzlib.h 'BZ2_bzlibVersion()' -lbz2 && bzlib=yes
5960 if test "$bzlib" = yes ; then
5961 def_bzlib='#define CONFIG_BZLIB 1'
5962 extra_ldflags="$extra_ldflags -lbz2"
5964 echores "$bzlib"
5967 echocheck "RTC"
5968 if test "$_rtc" = auto ; then
5969 cat > $TMPC << EOF
5970 #include <sys/ioctl.h>
5971 #ifdef __linux__
5972 #include <linux/rtc.h>
5973 #else
5974 #include <rtc.h>
5975 #define RTC_PIE_ON RTCIO_PIE_ON
5976 #endif
5977 int main(void) { return RTC_PIE_ON; }
5979 _rtc=no
5980 cc_check && _rtc=yes
5981 ppc && _rtc=no
5983 if test "$_rtc" = yes ; then
5984 def_rtc='#define HAVE_RTC 1'
5985 else
5986 def_rtc='#undef HAVE_RTC'
5988 echores "$_rtc"
5991 echocheck "liblzo2 support"
5992 if test "$_liblzo" = auto ; then
5993 _liblzo=no
5994 function_check lzo/lzo1x.h 'lzo_init()' -llzo2 && _liblzo=yes
5996 if test "$_liblzo" = yes ; then
5997 def_liblzo='#define CONFIG_LIBLZO 1'
5998 extra_ldflags="$extra_ldflags -llzo2"
5999 codecmodules="liblzo $codecmodules"
6000 else
6001 def_liblzo='#undef CONFIG_LIBLZO'
6002 nocodecmodules="liblzo $nocodecmodules"
6004 echores "$_liblzo"
6007 echocheck "mad support"
6008 if test "$_mad" = auto ; then
6009 _mad=no
6010 header_check mad.h -lmad && _mad=yes
6012 if test "$_mad" = yes ; then
6013 def_mad='#define CONFIG_LIBMAD 1'
6014 extra_ldflags="$extra_ldflags -lmad"
6015 codecmodules="libmad $codecmodules"
6016 else
6017 def_mad='#undef CONFIG_LIBMAD'
6018 nocodecmodules="libmad $nocodecmodules"
6020 echores "$_mad"
6022 echocheck "Twolame"
6023 if test "$_twolame" = auto ; then
6024 _twolame=no
6025 function_check twolame.h 'twolame_init()' -ltwolame $_ld_lm && _twolame=yes
6027 if test "$_twolame" = yes ; then
6028 def_twolame='#define CONFIG_TWOLAME 1'
6029 libs_mencoder="$libs_mencoder -ltwolame"
6030 codecmodules="twolame $codecmodules"
6031 else
6032 def_twolame='#undef CONFIG_TWOLAME'
6033 nocodecmodules="twolame $nocodecmodules"
6035 echores "$_twolame"
6037 echocheck "Toolame"
6038 if test "$_toolame" = auto ; then
6039 _toolame=no
6040 if test "$_twolame" = yes ; then
6041 res_comment="disabled by twolame"
6042 else
6043 function_check toolame.h 'toolame_init()' -ltoolame $_ld_lm && _toolame=yes
6046 if test "$_toolame" = yes ; then
6047 def_toolame='#define CONFIG_TOOLAME 1'
6048 libs_mencoder="$libs_mencoder -ltoolame"
6049 codecmodules="toolame $codecmodules"
6050 else
6051 def_toolame='#undef CONFIG_TOOLAME'
6052 nocodecmodules="toolame $nocodecmodules"
6054 if test "$_toolamedir" ; then
6055 res_comment="using $_toolamedir"
6057 echores "$_toolame"
6059 echocheck "OggVorbis support"
6060 if test "$_tremor_internal" = yes; then
6061 _libvorbis=no
6062 elif test "$_tremor" = auto; then
6063 _tremor=no
6064 function_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6066 if test "$_libvorbis" = auto; then
6067 _libvorbis=no
6068 function_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes
6070 if test "$_tremor_internal" = yes ; then
6071 _vorbis=yes
6072 def_vorbis='#define CONFIG_OGGVORBIS 1'
6073 def_tremor='#define CONFIG_TREMOR 1'
6074 codecmodules="tremor(internal) $codecmodules"
6075 res_comment="internal Tremor"
6076 if test "$_tremor_low" = yes ; then
6077 cflags_tremor_low="-D_LOW_ACCURACY_"
6078 res_comment="internal low accuracy Tremor"
6080 elif test "$_tremor" = yes ; then
6081 _vorbis=yes
6082 def_vorbis='#define CONFIG_OGGVORBIS 1'
6083 def_tremor='#define CONFIG_TREMOR 1'
6084 codecmodules="tremor(external) $codecmodules"
6085 res_comment="external Tremor"
6086 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6087 elif test "$_libvorbis" = yes ; then
6088 _vorbis=yes
6089 def_vorbis='#define CONFIG_OGGVORBIS 1'
6090 codecmodules="libvorbis $codecmodules"
6091 res_comment="libvorbis"
6092 extra_ldflags="$extra_ldflags -lvorbis -logg"
6093 else
6094 _vorbis=no
6095 nocodecmodules="libvorbis $nocodecmodules"
6097 echores "$_vorbis"
6099 echocheck "libspeex (version >= 1.1 required)"
6100 if test "$_speex" = auto ; then
6101 _speex=no
6102 cat > $TMPC << EOF
6103 #include <stddef.h>
6104 #include <speex/speex.h>
6105 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
6107 cc_check -lspeex $_ld_lm && _speex=yes
6109 if test "$_speex" = yes ; then
6110 def_speex='#define CONFIG_SPEEX 1'
6111 extra_ldflags="$extra_ldflags -lspeex"
6112 codecmodules="speex $codecmodules"
6113 else
6114 def_speex='#undef CONFIG_SPEEX'
6115 nocodecmodules="speex $nocodecmodules"
6117 echores "$_speex"
6119 echocheck "OggTheora support"
6120 if test "$_theora" = auto ; then
6121 _theora=no
6122 cat > $TMPC << EOF
6123 #include <theora/theora.h>
6124 #include <string.h>
6125 int main(void) {
6126 /* Theora is in flux, make sure that all interface routines and datatypes
6127 * exist and work the way we expect it, so we don't break MPlayer. */
6128 ogg_packet op;
6129 theora_comment tc;
6130 theora_info inf;
6131 theora_state st;
6132 yuv_buffer yuv;
6133 int r;
6134 double t;
6136 theora_info_init(&inf);
6137 theora_comment_init(&tc);
6139 return 0;
6141 /* we don't want to execute this kind of nonsense; just for making sure
6142 * that compilation works... */
6143 memset(&op, 0, sizeof(op));
6144 r = theora_decode_header(&inf, &tc, &op);
6145 r = theora_decode_init(&st, &inf);
6146 t = theora_granule_time(&st, op.granulepos);
6147 r = theora_decode_packetin(&st, &op);
6148 r = theora_decode_YUVout(&st, &yuv);
6149 theora_clear(&st);
6151 return 0;
6154 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6155 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6156 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6157 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6158 if test _theora = no; then
6159 _ld_theora="-ltheora -logg"
6160 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6162 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6163 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6164 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6165 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6166 extra_ldflags="$extra_ldflags $_ld_theora" &&
6167 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6168 if test _theora = no; then
6169 _ld_theora="-ltheora -logg"
6170 cc_check tremor/bitwise.c $_ld_theora &&
6171 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6175 if test "$_theora" = yes ; then
6176 def_theora='#define CONFIG_OGGTHEORA 1'
6177 codecmodules="libtheora $codecmodules"
6178 # when --enable-theora is forced, we'd better provide a probably sane
6179 # $_ld_theora than nothing
6180 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6181 else
6182 def_theora='#undef CONFIG_OGGTHEORA'
6183 nocodecmodules="libtheora $nocodecmodules"
6185 echores "$_theora"
6187 echocheck "mp3lib support"
6188 if test "$_mp3lib" = auto ; then
6189 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6191 if test "$_mp3lib" = yes ; then
6192 def_mp3lib='#define CONFIG_MP3LIB 1'
6193 codecmodules="mp3lib(internal) $codecmodules"
6194 else
6195 def_mp3lib='#undef CONFIG_MP3LIB'
6196 nocodecmodules="mp3lib(internal) $nocodecmodules"
6198 echores "$_mp3lib"
6200 # Any version of libmpg123 shall be fine.
6201 echocheck "mpg123 support"
6202 def_mpg123='#undef CONFIG_MPG123'
6203 if test "$_mpg123" = auto; then
6204 _mpg123=no
6205 function_check mpg123.h 'mpg123_init()' -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
6207 if test "$_mpg123" = yes ; then
6208 def_mpg123='#define CONFIG_MPG123 1'
6209 codecmodules="mpg123 $codecmodules"
6210 else
6211 nocodecmodules="mpg123 $nocodecmodules"
6213 echores "$_mpg123"
6215 echocheck "liba52 support"
6216 def_liba52='#undef CONFIG_LIBA52'
6217 if test "$_liba52" = auto ; then
6218 _liba52=no
6219 cat > $TMPC << EOF
6220 #include <inttypes.h>
6221 #include <a52dec/a52.h>
6222 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6224 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
6226 if test "$_liba52" = yes ; then
6227 def_liba52='#define CONFIG_LIBA52 1'
6228 codecmodules="liba52 $codecmodules"
6229 else
6230 nocodecmodules="liba52 $nocodecmodules"
6232 echores "$_liba52"
6234 echocheck "internal libmpeg2 support"
6235 if test "$_libmpeg2" = auto ; then
6236 _libmpeg2=yes
6237 if alpha && test cc_vendor=gnu; then
6238 case $cc_version in
6239 2*|3.0*|3.1*) # cannot compile MVI instructions
6240 _libmpeg2=no
6241 res_comment="broken gcc"
6243 esac
6246 if test "$_libmpeg2" = yes ; then
6247 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6248 codecmodules="libmpeg2(internal) $codecmodules"
6249 else
6250 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6251 nocodecmodules="libmpeg2(internal) $nocodecmodules"
6253 echores "$_libmpeg2"
6255 echocheck "libdca support"
6256 if test "$_libdca" = auto ; then
6257 _libdca=no
6258 for _ld_dca in -ldca -ldts ; do
6259 function_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
6260 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
6261 done
6263 if test "$_libdca" = yes ; then
6264 def_libdca='#define CONFIG_LIBDCA 1'
6265 codecmodules="libdca $codecmodules"
6266 else
6267 def_libdca='#undef CONFIG_LIBDCA'
6268 nocodecmodules="libdca $nocodecmodules"
6270 echores "$_libdca"
6272 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6273 if test "$_musepack" = auto ; then
6274 _musepack=no
6275 cat > $TMPC << EOF
6276 #include <stddef.h>
6277 #include <mpcdec/mpcdec.h>
6278 int main(void) {
6279 mpc_streaminfo info;
6280 mpc_decoder decoder;
6281 mpc_decoder_set_streaminfo(&decoder, &info);
6282 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6283 return 0;
6286 cc_check -lmpcdec $_ld_lm && _musepack=yes
6288 if test "$_musepack" = yes ; then
6289 def_musepack='#define CONFIG_MUSEPACK 1'
6290 extra_ldflags="$extra_ldflags -lmpcdec"
6291 codecmodules="musepack $codecmodules"
6292 else
6293 def_musepack='#undef CONFIG_MUSEPACK'
6294 nocodecmodules="musepack $nocodecmodules"
6296 echores "$_musepack"
6299 echocheck "FAAC support"
6300 if test "$_faac" = auto ; then
6301 cat > $TMPC <<EOF
6302 #include <inttypes.h>
6303 #include <faac.h>
6304 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6306 _faac=no
6307 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6308 cc_check $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6309 done
6311 if test "$_faac" = yes ; then
6312 def_faac="#define CONFIG_FAAC 1"
6313 codecmodules="faac $codecmodules"
6314 else
6315 def_faac="#undef CONFIG_FAAC"
6316 nocodecmodules="faac $nocodecmodules"
6318 echores "$_faac"
6321 echocheck "FAAD2 support"
6322 if test "$_faad_internal" = auto ; then
6323 if x86_32 && test cc_vendor=gnu; then
6324 case $cc_version in
6325 3.1*|3.2) # ICE/insn with these versions
6326 _faad_internal=no
6327 res_comment="broken gcc"
6330 _faad=yes
6331 _faad_internal=yes
6333 esac
6334 else
6335 _faad=yes
6336 _faad_internal=yes
6339 if test "$_faad" = auto ; then
6340 cat > $TMPC << EOF
6341 #include <faad.h>
6342 #ifndef FAAD_MIN_STREAMSIZE
6343 #error Too old version
6344 #endif
6345 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6346 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6348 cc_check -lfaad $_ld_lm && _faad=yes
6351 def_faad='#undef CONFIG_FAAD'
6352 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6353 if test "$_faad_internal" = yes ; then
6354 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6355 res_comment="internal floating-point"
6356 if test "$_faad_fixed" = yes ; then
6357 # The FIXED_POINT implementation of FAAD2 improves performance
6358 # on some platforms, especially for SBR files.
6359 cflags_faad_fixed="-DFIXED_POINT"
6360 res_comment="internal fixed-point"
6362 elif test "$_faad" = yes ; then
6363 extra_ldflags="$extra_ldflags -lfaad"
6366 if test "$_faad" = yes ; then
6367 def_faad='#define CONFIG_FAAD 1'
6368 if test "$_faad_internal" = yes ; then
6369 codecmodules="faad2(internal) $codecmodules"
6370 else
6371 codecmodules="faad2 $codecmodules"
6373 else
6374 _faad=no
6375 nocodecmodules="faad2 $nocodecmodules"
6377 echores "$_faad"
6380 echocheck "LADSPA plugin support"
6381 if test "$_ladspa" = auto ; then
6382 cat > $TMPC <<EOF
6383 #include <ladspa.h>
6384 int main(void) { LADSPA_Descriptor ld = {0}; return 0; }
6386 _ladspa=no
6387 cc_check && _ladspa=yes
6389 if test "$_ladspa" = yes; then
6390 def_ladspa="#define CONFIG_LADSPA 1"
6391 else
6392 def_ladspa="#undef CONFIG_LADSPA"
6394 echores "$_ladspa"
6397 echocheck "libbs2b audio filter support"
6398 if test "$_libbs2b" = auto ; then
6399 cat > $TMPC <<EOF
6400 #include <bs2b.h>
6401 #if BS2B_VERSION_MAJOR < 3
6402 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6403 #endif
6404 int main(void) {
6405 t_bs2bdp filter;
6406 filter=bs2b_open();
6407 bs2b_close(filter);
6408 return 0;
6411 _libbs2b=no
6412 if $_pkg_config --exists libbs2b ; then
6413 _inc_tmp=$($_pkg_config --cflags libbs2b)
6414 _ld_tmp=$($_pkg_config --libs libbs2b)
6415 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6416 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6417 else
6418 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6419 -I/usr/local/include/bs2b ; do
6420 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6421 extra_ldflags="$extra_ldflags -lbs2b"
6422 extra_cflags="$extra_cflags $_inc_tmp"
6423 _libbs2b=yes
6424 break
6426 done
6429 def_libbs2b="#undef CONFIG_LIBBS2B"
6430 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6431 echores "$_libbs2b"
6434 if test -z "$_codecsdir" ; then
6435 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6436 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6437 if test -d "$dir" ; then
6438 _codecsdir="$dir"
6439 break;
6441 done
6443 # Fall back on default directory.
6444 if test -z "$_codecsdir" ; then
6445 _codecsdir="$_libdir/codecs"
6446 mingw32 || os2 && _codecsdir="codecs"
6450 echocheck "Win32 codecs"
6451 if test "$_win32dll" = auto ; then
6452 _win32dll=no
6453 if x86_32 && ! qnx; then
6454 _win32dll=yes
6457 if test "$_win32dll" = yes ; then
6458 def_win32dll='#define CONFIG_WIN32DLL 1'
6459 if ! win32 ; then
6460 def_win32_loader='#define WIN32_LOADER 1'
6461 _win32_emulation=yes
6462 else
6463 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6464 res_comment="using native windows"
6466 codecmodules="win32 $codecmodules"
6467 else
6468 def_win32dll='#undef CONFIG_WIN32DLL'
6469 def_win32_loader='#undef WIN32_LOADER'
6470 nocodecmodules="win32 $nocodecmodules"
6472 echores "$_win32dll"
6475 echocheck "XAnim codecs"
6476 if test "$_xanim" = auto ; then
6477 _xanim=no
6478 res_comment="dynamic loader support needed"
6479 if test "$_dl" = yes ; then
6480 _xanim=yes
6483 if test "$_xanim" = yes ; then
6484 def_xanim='#define CONFIG_XANIM 1'
6485 codecmodules="xanim $codecmodules"
6486 else
6487 def_xanim='#undef CONFIG_XANIM'
6488 nocodecmodules="xanim $nocodecmodules"
6490 echores "$_xanim"
6493 echocheck "RealPlayer codecs"
6494 if test "$_real" = auto ; then
6495 _real=no
6496 res_comment="dynamic loader support needed"
6497 if test "$_dl" = yes || test "$_win32dll" = yes &&
6498 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
6499 _real=yes
6502 if test "$_real" = yes ; then
6503 def_real='#define CONFIG_REALCODECS 1'
6504 codecmodules="real $codecmodules"
6505 else
6506 def_real='#undef CONFIG_REALCODECS'
6507 nocodecmodules="real $nocodecmodules"
6509 echores "$_real"
6512 echocheck "QuickTime codecs"
6513 _qtx_emulation=no
6514 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6515 if test "$_qtx" = auto ; then
6516 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6518 if test "$_qtx" = yes ; then
6519 def_qtx='#define CONFIG_QTX_CODECS 1'
6520 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6521 codecmodules="qtx $codecmodules"
6522 darwin || win32 || _qtx_emulation=yes
6523 else
6524 def_qtx='#undef CONFIG_QTX_CODECS'
6525 nocodecmodules="qtx $nocodecmodules"
6527 echores "$_qtx"
6529 echocheck "Nemesi Streaming Media libraries"
6530 if test "$_nemesi" = auto && test "$networking" = yes ; then
6531 _nemesi=no
6532 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6533 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6534 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6535 _nemesi=yes
6538 if test "$_nemesi" = yes; then
6539 _native_rtsp=no
6540 def_nemesi='#define CONFIG_LIBNEMESI 1'
6541 inputmodules="nemesi $inputmodules"
6542 else
6543 _native_rtsp="$networking"
6544 _nemesi=no
6545 def_nemesi='#undef CONFIG_LIBNEMESI'
6546 noinputmodules="nemesi $noinputmodules"
6548 echores "$_nemesi"
6550 echocheck "LIVE555 Streaming Media libraries"
6551 if test "$_live" = auto && test "$networking" = yes ; then
6552 cat > $TMPCPP << EOF
6553 #include <liveMedia.hh>
6554 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6555 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6556 #endif
6557 int main(void) { return 0; }
6560 _live=no
6561 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
6562 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6563 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
6564 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6565 $_livelibdir/groupsock/libgroupsock.a \
6566 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6567 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6568 $extra_ldflags -lstdc++" \
6569 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6570 -I$_livelibdir/UsageEnvironment/include \
6571 -I$_livelibdir/BasicUsageEnvironment/include \
6572 -I$_livelibdir/groupsock/include" && \
6573 _live=yes && break
6574 done
6575 if test "$_live" != yes ; then
6576 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6577 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
6578 _live_dist=yes
6582 if test "$_live" = yes && test "$networking" = yes; then
6583 test $_livelibdir && res_comment="using $_livelibdir"
6584 def_live='#define CONFIG_LIVE555 1'
6585 inputmodules="live555 $inputmodules"
6586 elif test "$_live_dist" = yes && test "$networking" = yes; then
6587 res_comment="using distribution version"
6588 _live="yes"
6589 def_live='#define CONFIG_LIVE555 1'
6590 extra_ldflags="$extra_ldflags $ld_tmp"
6591 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6592 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6593 inputmodules="live555 $inputmodules"
6594 else
6595 _live=no
6596 def_live='#undef CONFIG_LIVE555'
6597 noinputmodules="live555 $noinputmodules"
6599 echores "$_live"
6603 all_ffmpeg_libs="libavutil libavcodec libavformat libswscale libpostproc"
6604 echocheck "FFmpeg ($all_ffmpeg_libs)"
6605 if test "$ffmpeg" = auto ; then
6606 ffmpeg=no
6607 if $_pkg_config --exists $all_ffmpeg_libs ; then
6608 inc_ffmpeg=$($_pkg_config --cflags $all_ffmpeg_libs)
6609 _ld_tmp=$($_pkg_config --libs $all_ffmpeg_libs)
6610 extra_ldflags="$extra_ldflags $_ld_tmp"
6611 extra_cflags="$extra_cflags $inc_ffmpeg"
6612 ffmpeg=yes
6613 elif header_check libavcore/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil $_ld_lm ; then
6614 extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil -lavcore"
6615 ffmpeg=yes
6619 if test "$ffmpeg" = yes; then
6620 def_ffmpeg='#define CONFIG_FFMPEG 1'
6621 codecmodules="ffmpeg $codecmodules"
6622 else
6623 def_ffmpeg='#undef CONFIG_FFMPEG'
6624 nocodecmodules="ffmpeg $nocodecmodules"
6626 echores "$ffmpeg"
6628 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
6629 if ! test -z "$_ffmpeg_source" ; then
6630 test "$ffmpeg" = yes && def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
6635 echocheck "libdv-0.9.5+"
6636 if test "$_libdv" = auto ; then
6637 _libdv=no
6638 function_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
6640 if test "$_libdv" = yes ; then
6641 def_libdv='#define CONFIG_LIBDV095 1'
6642 extra_ldflags="$extra_ldflags -ldv"
6643 codecmodules="libdv $codecmodules"
6644 else
6645 def_libdv='#undef CONFIG_LIBDV095'
6646 nocodecmodules="libdv $nocodecmodules"
6648 echores "$_libdv"
6651 echocheck "Xvid"
6652 if test "$_xvid" = auto ; then
6653 _xvid=no
6654 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6655 function_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
6656 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
6657 done
6660 if test "$_xvid" = yes ; then
6661 def_xvid='#define CONFIG_XVID4 1'
6662 codecmodules="xvid $codecmodules"
6663 else
6664 def_xvid='#undef CONFIG_XVID4'
6665 nocodecmodules="xvid $nocodecmodules"
6667 echores "$_xvid"
6669 echocheck "x264"
6670 if test "$_x264" = auto ; then
6671 cat > $TMPC << EOF
6672 #include <inttypes.h>
6673 #include <x264.h>
6674 #if X264_BUILD < 98
6675 #error We do not support old versions of x264. Get the latest from git.
6676 #endif
6677 int main(void) { x264_encoder_open((void*)0); return 0; }
6679 _x264=no
6680 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6681 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
6682 done
6685 if test "$_x264" = yes ; then
6686 def_x264='#define CONFIG_X264 1'
6687 codecmodules="x264 $codecmodules"
6688 else
6689 def_x264='#undef CONFIG_X264'
6690 nocodecmodules="x264 $nocodecmodules"
6692 echores "$_x264"
6694 echocheck "libnut"
6695 if test "$_libnut" = auto ; then
6696 cat > $TMPC << EOF
6697 #include <libnut.h>
6698 nut_context_tt * nut;
6699 int main(void) { nut_error(0); return 0; }
6701 _libnut=no
6702 cc_check -lnut && _libnut=yes
6705 if test "$_libnut" = yes ; then
6706 def_libnut='#define CONFIG_LIBNUT 1'
6707 extra_ldflags="$extra_ldflags -lnut"
6708 else
6709 def_libnut='#undef CONFIG_LIBNUT'
6711 echores "$_libnut"
6713 # These VO checks must be done after the FFmpeg one
6714 echocheck "/dev/mga_vid"
6715 if test "$_mga" = auto ; then
6716 _mga=no
6717 test -c /dev/mga_vid && _mga=yes
6719 if test "$_mga" = yes ; then
6720 def_mga='#define CONFIG_MGA 1'
6721 vomodules="mga $vomodules"
6722 else
6723 def_mga='#undef CONFIG_MGA'
6724 novomodules="mga $novomodules"
6726 echores "$_mga"
6729 echocheck "xmga"
6730 if test "$_xmga" = auto ; then
6731 _xmga=no
6732 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
6734 if test "$_xmga" = yes ; then
6735 def_xmga='#define CONFIG_XMGA 1'
6736 vomodules="xmga $vomodules"
6737 else
6738 def_xmga='#undef CONFIG_XMGA'
6739 novomodules="xmga $novomodules"
6741 echores "$_xmga"
6743 echocheck "zr"
6744 if test "$_zr" = auto ; then
6745 #36067's seem to identify themselves as 36057PQC's, so the line
6746 #below should work for 36067's and 36057's.
6747 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
6748 _zr=yes
6749 else
6750 _zr=no
6753 if test "$_zr" = yes ; then
6754 if test "$ffmpeg_internals" = yes ; then
6755 def_zr='#define CONFIG_ZR 1'
6756 vomodules="zr zr2 $vomodules"
6757 else
6758 res_comment="FFmpeg internal headers are required by zr, sorry"
6759 novomodules="zr $novomodules"
6760 def_zr='#undef CONFIG_ZR'
6762 else
6763 def_zr='#undef CONFIG_ZR'
6764 novomodules="zr zr2 $novomodules"
6766 echores "$_zr"
6768 # mencoder requires (optional) those libs: libmp3lame
6769 if test "$_mencoder" != no ; then
6771 echocheck "libmp3lame"
6772 def_mp3lame='#undef CONFIG_MP3LAME'
6773 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
6774 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
6775 if test "$_mp3lame" = auto ; then
6776 _mp3lame=no
6777 cat > $TMPC <<EOF
6778 #include <lame/lame.h>
6779 int main(void) { lame_version_t lv; lame_init();
6780 get_lame_version_numerical(&lv);
6781 return 0; }
6783 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
6785 if test "$_mp3lame" = yes ; then
6786 def_mp3lame="#define CONFIG_MP3LAME 1"
6787 _ld_mp3lame=-lmp3lame
6788 libs_mencoder="$libs_mencoder $_ld_mp3lame"
6789 function_check lame/lame.h 'lame_set_preset(NULL, STANDARD_FAST)' $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
6790 function_check lame/lame.h 'lame_set_preset(NULL, MEDIUM_FAST)' $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
6792 echores "$_mp3lame"
6794 fi # test "$_mencoder" != no
6796 echocheck "mencoder"
6797 if test "$_mencoder" = yes ; then
6798 def_muxers='#define CONFIG_MUXERS 1'
6799 else
6800 def_muxers='#define CONFIG_MUXERS 0'
6802 echores "$_mencoder"
6805 echocheck "UnRAR executable"
6806 if test "$_unrar_exec" = auto ; then
6807 _unrar_exec="yes"
6808 mingw32 && _unrar_exec="no"
6810 if test "$_unrar_exec" = yes ; then
6811 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
6812 else
6813 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
6815 echores "$_unrar_exec"
6817 echocheck "TV interface"
6818 if test "$_tv" = yes ; then
6819 def_tv='#define CONFIG_TV 1'
6820 inputmodules="tv $inputmodules"
6821 else
6822 noinputmodules="tv $noinputmodules"
6823 def_tv='#undef CONFIG_TV'
6825 echores "$_tv"
6828 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
6829 echocheck "*BSD BT848 bt8xx header"
6830 _ioctl_bt848_h=no
6831 for file in "machine/ioctl_bt848.h" \
6832 "dev/bktr/ioctl_bt848.h" \
6833 "dev/video/bktr/ioctl_bt848.h" \
6834 "dev/ic/bt8xx.h" ; do
6835 cat > $TMPC <<EOF
6836 #include <sys/types.h>
6837 #include <sys/ioctl.h>
6838 #include <$file>
6839 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
6841 if cc_check ; then
6842 _ioctl_bt848_h=yes
6843 _ioctl_bt848_h_name="$file"
6844 break;
6846 done
6847 if test "$_ioctl_bt848_h" = yes ; then
6848 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6849 res_comment="using $_ioctl_bt848_h_name"
6850 else
6851 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6853 echores "$_ioctl_bt848_h"
6855 echocheck "*BSD ioctl_meteor.h"
6856 _ioctl_meteor_h=no
6857 for file in "machine/ioctl_meteor.h" \
6858 "dev/bktr/ioctl_meteor.h" \
6859 "dev/video/bktr/ioctl_meteor.h" ; do
6860 cat > $TMPC <<EOF
6861 #include <sys/types.h>
6862 #include <$file>
6863 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
6865 if cc_check ; then
6866 _ioctl_meteor_h=yes
6867 _ioctl_meteor_h_name="$file"
6868 break;
6870 done
6871 if test "$_ioctl_meteor_h" = yes ; then
6872 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6873 res_comment="using $_ioctl_meteor_h_name"
6874 else
6875 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6877 echores "$_ioctl_meteor_h"
6879 echocheck "*BSD BrookTree 848 TV interface"
6880 if test "$_tv_bsdbt848" = auto ; then
6881 _tv_bsdbt848=no
6882 if test "$_tv" = yes ; then
6883 cat > $TMPC <<EOF
6884 #include <sys/types.h>
6885 $def_ioctl_meteor_h_name
6886 $def_ioctl_bt848_h_name
6887 #ifdef IOCTL_METEOR_H_NAME
6888 #include IOCTL_METEOR_H_NAME
6889 #endif
6890 #ifdef IOCTL_BT848_H_NAME
6891 #include IOCTL_BT848_H_NAME
6892 #endif
6893 int main(void) {
6894 ioctl(0, METEORSINPUT, 0);
6895 ioctl(0, TVTUNER_GETFREQ, 0);
6896 return 0;
6899 cc_check && _tv_bsdbt848=yes
6902 if test "$_tv_bsdbt848" = yes ; then
6903 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
6904 inputmodules="tv-bsdbt848 $inputmodules"
6905 else
6906 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
6907 noinputmodules="tv-bsdbt848 $noinputmodules"
6909 echores "$_tv_bsdbt848"
6910 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
6913 echocheck "DirectShow TV interface"
6914 if test "$_tv_dshow" = auto ; then
6915 _tv_dshow=no
6916 if test "$_tv" = yes && win32 ; then
6917 cat > $TMPC <<EOF
6918 #include <ole2.h>
6919 int main(void) {
6920 void* p;
6921 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6922 return 0;
6925 cc_check -lole32 -luuid && _tv_dshow=yes
6928 if test "$_tv_dshow" = yes ; then
6929 inputmodules="tv-dshow $inputmodules"
6930 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
6931 extra_ldflags="$extra_ldflags -lole32 -luuid"
6932 else
6933 noinputmodules="tv-dshow $noinputmodules"
6934 def_tv_dshow='#undef CONFIG_TV_DSHOW'
6936 echores "$_tv_dshow"
6939 echocheck "Video 4 Linux TV interface"
6940 if test "$_tv_v4l1" = auto ; then
6941 _tv_v4l1=no
6942 if test "$_tv" = yes && linux ; then
6943 header_check linux/videodev.h && _tv_v4l1=yes
6946 if test "$_tv_v4l1" = yes ; then
6947 _audio_input=yes
6948 _tv_v4l=yes
6949 def_tv_v4l='#define CONFIG_TV_V4L 1'
6950 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
6951 inputmodules="tv-v4l $inputmodules"
6952 else
6953 noinputmodules="tv-v4l1 $noinputmodules"
6954 def_tv_v4l='#undef CONFIG_TV_V4L'
6956 echores "$_tv_v4l1"
6959 echocheck "Video 4 Linux 2 TV interface"
6960 if test "$_tv_v4l2" = auto ; then
6961 _tv_v4l2=no
6962 if test "$_tv" = yes && linux ; then
6963 header_check linux/videodev2.h && _tv_v4l2=yes
6966 if test "$_tv_v4l2" = yes ; then
6967 _audio_input=yes
6968 _tv_v4l=yes
6969 def_tv_v4l='#define CONFIG_TV_V4L 1'
6970 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
6971 inputmodules="tv-v4l2 $inputmodules"
6972 else
6973 noinputmodules="tv-v4l2 $noinputmodules"
6974 def_tv_v4l2='#undef CONFIG_TV_V4L2'
6976 echores "$_tv_v4l2"
6979 echocheck "Radio interface"
6980 if test "$_radio" = yes ; then
6981 def_radio='#define CONFIG_RADIO 1'
6982 inputmodules="radio $inputmodules"
6983 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6984 _radio_capture=no
6986 if test "$_radio_capture" = yes ; then
6987 _audio_input=yes
6988 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
6989 else
6990 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6992 else
6993 noinputmodules="radio $noinputmodules"
6994 def_radio='#undef CONFIG_RADIO'
6995 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6996 _radio_capture=no
6998 echores "$_radio"
6999 echocheck "Capture for Radio interface"
7000 echores "$_radio_capture"
7002 echocheck "Video 4 Linux 2 Radio interface"
7003 if test "$_radio_v4l2" = auto ; then
7004 _radio_v4l2=no
7005 if test "$_radio" = yes && linux ; then
7006 header_check linux/videodev2.h && _radio_v4l2=yes
7009 if test "$_radio_v4l2" = yes ; then
7010 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7011 else
7012 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7014 echores "$_radio_v4l2"
7016 echocheck "Video 4 Linux Radio interface"
7017 if test "$_radio_v4l" = auto ; then
7018 _radio_v4l=no
7019 if test "$_radio" = yes && linux ; then
7020 header_check linux/videodev.h && _radio_v4l=yes
7023 if test "$_radio_v4l" = yes ; then
7024 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7025 else
7026 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7028 echores "$_radio_v4l"
7030 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7031 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7032 echocheck "*BSD BrookTree 848 Radio interface"
7033 _radio_bsdbt848=no
7034 cat > $TMPC <<EOF
7035 #include <sys/types.h>
7036 $def_ioctl_bt848_h_name
7037 #ifdef IOCTL_BT848_H_NAME
7038 #include IOCTL_BT848_H_NAME
7039 #endif
7040 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7042 cc_check && _radio_bsdbt848=yes
7043 echores "$_radio_bsdbt848"
7044 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7046 if test "$_radio_bsdbt848" = yes ; then
7047 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7048 else
7049 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7052 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7053 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7054 die "Radio driver requires BSD BT848, V4L or V4L2!"
7057 echocheck "Video 4 Linux 2 MPEG PVR interface"
7058 if test "$_pvr" = auto ; then
7059 _pvr=no
7060 if test "$_tv_v4l2" = yes && linux ; then
7061 cat > $TMPC <<EOF
7062 #include <linux/videodev2.h>
7063 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
7065 cc_check && _pvr=yes
7068 if test "$_pvr" = yes ; then
7069 def_pvr='#define CONFIG_PVR 1'
7070 inputmodules="pvr $inputmodules"
7071 else
7072 noinputmodules="pvr $noinputmodules"
7073 def_pvr='#undef CONFIG_PVR'
7075 echores "$_pvr"
7078 echocheck "ftp"
7079 if test "$_ftp" = "auto" ; then
7080 test "$networking" = "yes" && ! beos && _ftp=yes
7082 if test "$_ftp" = yes ; then
7083 def_ftp='#define CONFIG_FTP 1'
7084 inputmodules="ftp $inputmodules"
7085 else
7086 noinputmodules="ftp $noinputmodules"
7087 def_ftp='#undef CONFIG_FTP'
7089 echores "$_ftp"
7091 echocheck "vstream client"
7092 if test "$_vstream" = auto ; then
7093 _vstream=no
7094 cat > $TMPC <<EOF
7095 #include <vstream-client.h>
7096 void vstream_error(const char *format, ... ) {}
7097 int main(void) { vstream_start(); return 0; }
7099 cc_check -lvstream-client && _vstream=yes
7101 if test "$_vstream" = yes ; then
7102 def_vstream='#define CONFIG_VSTREAM 1'
7103 inputmodules="vstream $inputmodules"
7104 extra_ldflags="$extra_ldflags -lvstream-client"
7105 else
7106 noinputmodules="vstream $noinputmodules"
7107 def_vstream='#undef CONFIG_VSTREAM'
7109 echores "$_vstream"
7112 echocheck "OSD menu"
7113 if test "$_menu" = yes ; then
7114 def_menu='#define CONFIG_MENU 1'
7115 test $_dvbin = "yes" && _menu_dvbin=yes
7116 else
7117 def_menu='#undef CONFIG_MENU'
7118 _menu_dvbin=no
7120 echores "$_menu"
7123 echocheck "Subtitles sorting"
7124 if test "$_sortsub" = yes ; then
7125 def_sortsub='#define CONFIG_SORTSUB 1'
7126 else
7127 def_sortsub='#undef CONFIG_SORTSUB'
7129 echores "$_sortsub"
7132 echocheck "XMMS inputplugin support"
7133 if test "$_xmms" = yes ; then
7134 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7135 _xmmsplugindir=$(xmms-config --input-plugin-dir)
7136 _xmmslibdir=$(xmms-config --exec-prefix)/lib
7137 else
7138 _xmmsplugindir=/usr/lib/xmms/Input
7139 _xmmslibdir=/usr/lib
7142 def_xmms='#define CONFIG_XMMS 1'
7143 if darwin ; then
7144 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
7145 else
7146 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7148 else
7149 def_xmms='#undef CONFIG_XMMS'
7151 echores "$_xmms"
7153 if test "$_charset" != "noconv" ; then
7154 def_charset="#define MSG_CHARSET \"$_charset\""
7155 else
7156 def_charset="#undef MSG_CHARSET"
7157 _charset="UTF-8"
7160 #############################################################################
7162 echocheck "automatic gdb attach"
7163 if test "$_crash_debug" = yes ; then
7164 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
7165 else
7166 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
7167 _crash_debug=no
7169 echores "$_crash_debug"
7171 echocheck "compiler support for noexecstack"
7172 if cflag_check -Wl,-z,noexecstack ; then
7173 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
7174 echores "yes"
7175 else
7176 echores "no"
7179 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
7180 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
7181 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
7182 echores "yes"
7183 else
7184 echores "no"
7188 # Dynamic linking flags
7189 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7190 _ld_dl_dynamic=''
7191 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
7192 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
7193 _ld_dl_dynamic='-rdynamic'
7196 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7197 bsdos && extra_ldflags="$extra_ldflags -ldvd"
7198 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
7200 def_debug='#undef MP_DEBUG'
7201 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
7204 echocheck "joystick"
7205 def_joystick='#undef CONFIG_JOYSTICK'
7206 if test "$_joystick" = yes ; then
7207 if linux ; then
7208 # TODO add some check
7209 def_joystick='#define CONFIG_JOYSTICK 1'
7210 else
7211 _joystick="no"
7212 res_comment="unsupported under $system_name"
7215 echores "$_joystick"
7217 echocheck "lirc"
7218 if test "$_lirc" = auto ; then
7219 _lirc=no
7220 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
7222 if test "$_lirc" = yes ; then
7223 def_lirc='#define CONFIG_LIRC 1'
7224 libs_mplayer="$libs_mplayer -llirc_client"
7225 else
7226 def_lirc='#undef CONFIG_LIRC'
7228 echores "$_lirc"
7230 echocheck "lircc"
7231 if test "$_lircc" = auto ; then
7232 _lircc=no
7233 header_check lirc/lircc.h -llircc && _lircc=yes
7235 if test "$_lircc" = yes ; then
7236 def_lircc='#define CONFIG_LIRCC 1'
7237 libs_mplayer="$libs_mplayer -llircc"
7238 else
7239 def_lircc='#undef CONFIG_LIRCC'
7241 echores "$_lircc"
7243 if arm; then
7244 # Detect maemo development platform libraries availability (http://www.maemo.org),
7245 # they are used when run on Nokia 770|8x0
7246 echocheck "maemo (Nokia 770|8x0)"
7247 if test "$_maemo" = auto ; then
7248 _maemo=no
7249 function_check libosso.h 'osso_initialize('', '', 0, NULL)' $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
7251 if test "$_maemo" = yes ; then
7252 def_maemo='#define CONFIG_MAEMO 1'
7253 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
7254 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
7255 else
7256 def_maemo='#undef CONFIG_MAEMO'
7258 echores "$_maemo"
7261 #############################################################################
7263 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7264 # the OMF format needs to come after the 'extern symbol prefix' check, which
7265 # uses nm.
7266 if os2 ; then
7267 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7270 # linker paths should be the same for mencoder and mplayer
7271 _ld_tmp=""
7272 for I in $libs_mplayer ; do
7273 _tmp=$(echo $I | sed -e 's/^-L.*$//')
7274 if test -z "$_tmp" ; then
7275 extra_ldflags="$extra_ldflags $I"
7276 else
7277 _ld_tmp="$_ld_tmp $I"
7279 done
7280 libs_mplayer=$_ld_tmp
7283 #############################################################################
7284 # 64 bit file offsets?
7285 if test "$_largefiles" = yes || freebsd ; then
7286 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7287 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7288 # dvdread support requires this (for off64_t)
7289 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7293 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
7295 # This must be the last test to be performed. Any other tests following it
7296 # could fail due to linker errors. libdvdnavmini is intentionally not linked
7297 # against libdvdread (to permit MPlayer to use its own copy of the library).
7298 # So any compilation using the flags added here but not linking against
7299 # libdvdread can fail.
7300 echocheck "DVD support (libdvdnav)"
7301 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
7302 _dvdnav=no
7304 dvdnav_internal=no
7305 if test "$_dvdnav" = auto ; then
7306 if test "$_dvdread_internal" = yes ; then
7307 _dvdnav=yes
7308 dvdnav_internal=yes
7309 res_comment="internal"
7310 else
7311 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7314 if test "$_dvdnav" = auto ; then
7315 cat > $TMPC <<EOF
7316 #include <inttypes.h>
7317 #include <dvdnav/dvdnav.h>
7318 int main(void) { dvdnav_t *dvd=0; return 0; }
7320 _dvdnav=no
7321 _dvdnavdir=$($_dvdnavconfig --cflags)
7322 _dvdnavlibs=$($_dvdnavconfig --libs)
7323 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7325 if test "$_dvdnav" = yes ; then
7326 _largefiles=yes
7327 def_dvdnav='#define CONFIG_DVDNAV 1'
7328 if test "$dvdnav_internal" = yes ; then
7329 cflags_libdvdnav="-Ilibdvdnav"
7330 inputmodules="dvdnav(internal) $inputmodules"
7331 else
7332 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
7333 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
7334 inputmodules="dvdnav $inputmodules"
7336 else
7337 def_dvdnav='#undef CONFIG_DVDNAV'
7338 noinputmodules="dvdnav $noinputmodules"
7340 echores "$_dvdnav"
7342 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
7343 # Read dvdnav comment above.
7345 mak_enable () {
7346 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7347 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7348 nprefix=$3;
7349 for part in $list; do
7350 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7351 echo "${nprefix}_$part = yes"
7353 done
7356 #############################################################################
7357 echo "Creating config.mak"
7358 cat > config.mak << EOF
7359 # -------- Generated by configure -----------
7361 # Ensure that locale settings do not interfere with shell commands.
7362 export LC_ALL = C
7364 CONFIGURATION = $configuration
7366 CHARSET = $_charset
7367 DOC_LANGS = $language_doc
7368 DOC_LANG_ALL = $doc_lang_all
7369 MAN_LANGS = $language_man
7370 MAN_LANG_ALL = $man_lang_all
7371 MSG_LANGS = $language_msg
7372 MSG_LANG_ALL = $msg_lang_all
7374 prefix = \$(DESTDIR)$_prefix
7375 BINDIR = \$(DESTDIR)$_bindir
7376 DATADIR = \$(DESTDIR)$_datadir
7377 LIBDIR = \$(DESTDIR)$_libdir
7378 MANDIR = \$(DESTDIR)$_mandir
7379 CONFDIR = \$(DESTDIR)$_confdir
7380 LOCALEDIR = \$(DESTDIR)$_localedir
7382 AR = $_ar
7383 AS = $_cc
7384 CC = $_cc
7385 CXX = $_cc
7386 HOST_CC = $_host_cc
7387 INSTALL = $_install
7388 INSTALLSTRIP = $_install_strip
7389 WINDRES = $_windres
7391 CFLAGS = $WARNFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
7392 CXXFLAGS = $WARNFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
7393 DEPFLAGS = $DEPFLAGS
7395 CFLAGS_DHAHELPER = $cflags_dhahelper
7396 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
7397 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
7398 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
7399 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
7400 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
7401 CFLAGS_STACKREALIGN = $cflags_stackrealign
7402 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
7403 CFLAGS_TREMOR_LOW = $cflags_tremor_low
7405 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
7406 EXTRALIBS_MPLAYER = $libs_mplayer
7407 EXTRALIBS_MENCODER = $libs_mencoder
7409 GETCH = $_getch
7410 TIMER = $_timer
7412 EXESUF = $_exesuf
7413 EXESUFS_ALL = .exe
7415 ARCH = $arch
7416 $(mak_enable "$arch_all" "$arch" ARCH)
7417 $(mak_enable "$subarch_all" "$subarch" ARCH)
7418 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
7420 MENCODER = $_mencoder
7421 MPLAYER = $_mplayer
7423 NEED_GETTIMEOFDAY = $_need_gettimeofday
7424 NEED_GLOB = $_need_glob
7425 NEED_MMAP = $_need_mmap
7426 NEED_SETENV = $_need_setenv
7427 NEED_SHMEM = $_need_shmem
7428 NEED_STRSEP = $_need_strsep
7429 NEED_SWAB = $_need_swab
7430 NEED_VSSCANF = $_need_vsscanf
7432 # features
7433 3DFX = $_3dfx
7434 AA = $_aa
7435 ALSA1X = $_alsa1x
7436 ALSA9 = $_alsa9
7437 ALSA5 = $_alsa5
7438 APPLE_IR = $_apple_ir
7439 APPLE_REMOTE = $_apple_remote
7440 ARTS = $_arts
7441 AUDIO_INPUT = $_audio_input
7442 BITMAP_FONT = $_bitmap_font
7443 BL = $_bl
7444 CACA = $_caca
7445 CDDA = $_cdda
7446 CDDB = $_cddb
7447 COREAUDIO = $_coreaudio
7448 COREVIDEO = $_corevideo
7449 DART = $_dart
7450 DGA = $_dga
7451 DIRECT3D = $_direct3d
7452 DIRECTFB = $_directfb
7453 DIRECTX = $_directx
7454 DVBIN = $_dvbin
7455 DVDNAV = $_dvdnav
7456 DVDNAV_INTERNAL = $dvdnav_internal
7457 DVDREAD = $_dvdread
7458 DVDREAD_INTERNAL = $_dvdread_internal
7459 DXR2 = $_dxr2
7460 DXR3 = $_dxr3
7461 ESD = $_esd
7462 FAAC=$_faac
7463 FAAD = $_faad
7464 FAAD_INTERNAL = $_faad_internal
7465 FASTMEMCPY = $_fastmemcpy
7466 FBDEV = $_fbdev
7467 FREETYPE = $_freetype
7468 FTP = $_ftp
7469 GIF = $_gif
7470 GGI = $_ggi
7471 GL = $_gl
7472 GL_WIN32 = $_gl_win32
7473 GL_X11 = $_gl_x11
7474 GL_SDL = $_gl_sdl
7475 MATRIXVIEW = $matrixview
7476 HAVE_POSIX_SELECT = $_posix_select
7477 HAVE_SYS_MMAN_H = $_mman
7478 IVTV = $_ivtv
7479 JACK = $_jack
7480 JOYSTICK = $_joystick
7481 JPEG = $_jpeg
7482 KAI = $_kai
7483 KVA = $_kva
7484 LADSPA = $_ladspa
7485 LIBA52 = $_liba52
7486 LIBASS = $_ass
7487 LIBBLURAY = $_bluray
7488 LIBBS2B = $_libbs2b
7489 LIBDCA = $_libdca
7490 LIBDV = $_libdv
7491 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7492 LIBLZO = $_liblzo
7493 LIBMAD = $_mad
7494 LIBMENU = $_menu
7495 LIBMENU_DVBIN = $_menu_dvbin
7496 LIBMPEG2 = $_libmpeg2
7497 LIBNEMESI = $_nemesi
7498 LIBNUT = $_libnut
7499 LIBSMBCLIENT = $_smb
7500 LIBTHEORA = $_theora
7501 LIRC = $_lirc
7502 LIVE555 = $_live
7503 MACOSX_FINDER = $_macosx_finder
7504 MD5SUM = $_md5sum
7505 MGA = $_mga
7506 MNG = $_mng
7507 MP3LAME = $_mp3lame
7508 MP3LIB = $_mp3lib
7509 MPG123 = $_mpg123
7510 MUSEPACK = $_musepack
7511 NAS = $_nas
7512 NATIVE_RTSP = $_native_rtsp
7513 NETWORKING = $networking
7514 OPENAL = $_openal
7515 OSS = $_ossaudio
7516 PE_EXECUTABLE = $_pe_executable
7517 PNG = $_png
7518 PNM = $_pnm
7519 PRIORITY = $_priority
7520 PULSE = $_pulse
7521 PVR = $_pvr
7522 QTX_CODECS = $_qtx
7523 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7524 QTX_EMULATION = $_qtx_emulation
7525 QUARTZ = $_quartz
7526 RADIO=$_radio
7527 RADIO_CAPTURE=$_radio_capture
7528 REAL_CODECS = $_real
7529 S3FB = $_s3fb
7530 SDL = $_sdl
7531 SPEEX = $_speex
7532 STREAM_CACHE = $_stream_cache
7533 SGIAUDIO = $_sgiaudio
7534 SUNAUDIO = $_sunaudio
7535 SVGA = $_svga
7536 TDFXFB = $_tdfxfb
7537 TDFXVID = $_tdfxvid
7538 TGA = $_tga
7539 TOOLAME=$_toolame
7540 TREMOR_INTERNAL = $_tremor_internal
7541 TV = $_tv
7542 TV_BSDBT848 = $_tv_bsdbt848
7543 TV_DSHOW = $_tv_dshow
7544 TV_V4L = $_tv_v4l
7545 TV_V4L1 = $_tv_v4l1
7546 TV_V4L2 = $_tv_v4l2
7547 TWOLAME=$_twolame
7548 UNRAR_EXEC = $_unrar_exec
7549 V4L2 = $_v4l2
7550 VCD = $_vcd
7551 VDPAU = $_vdpau
7552 VESA = $_vesa
7553 VIDIX = $_vidix
7554 VIDIX_PCIDB = $_vidix_pcidb_val
7555 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7556 VIDIX_IVTV=$_vidix_drv_ivtv
7557 VIDIX_MACH64=$_vidix_drv_mach64
7558 VIDIX_MGA=$_vidix_drv_mga
7559 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7560 VIDIX_NVIDIA=$_vidix_drv_nvidia
7561 VIDIX_PM2=$_vidix_drv_pm2
7562 VIDIX_PM3=$_vidix_drv_pm3
7563 VIDIX_RADEON=$_vidix_drv_radeon
7564 VIDIX_RAGE128=$_vidix_drv_rage128
7565 VIDIX_S3=$_vidix_drv_s3
7566 VIDIX_SH_VEU=$_vidix_drv_sh_veu
7567 VIDIX_SIS=$_vidix_drv_sis
7568 VIDIX_UNICHROME=$_vidix_drv_unichrome
7569 VORBIS = $_vorbis
7570 VSTREAM = $_vstream
7571 WII = $_wii
7572 WIN32DLL = $_win32dll
7573 WIN32WAVEOUT = $_win32waveout
7574 WIN32_EMULATION = $_win32_emulation
7575 WINVIDIX = $winvidix
7576 X11 = $_x11
7577 X264 = $_x264
7578 XANIM_CODECS = $_xanim
7579 XMGA = $_xmga
7580 XMMS_PLUGINS = $_xmms
7581 XV = $_xv
7582 XVID4 = $_xvid
7583 XVIDIX = $xvidix
7584 XVMC = $_xvmc
7585 XVR100 = $_xvr100
7586 YUV4MPEG = $_yuv4mpeg
7587 ZR = $_zr
7589 # FFmpeg
7590 FFMPEG = $ffmpeg
7591 FFMPEG_INTERNALS = $ffmpeg_internals
7592 FFMPEG_SOURCE_PATH = $_ffmpeg_source
7594 RANLIB = $_ranlib
7595 YASM = $_yasm
7596 YASMFLAGS = $YASMFLAGS
7598 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
7599 CONFIG_AANDCT = yes
7600 CONFIG_FFT = yes
7601 CONFIG_GOLOMB = yes
7602 CONFIG_H264DSP = yes
7603 CONFIG_LPC = yes
7604 CONFIG_MDCT = yes
7605 CONFIG_RDFT = yes
7607 CONFIG_BZLIB = $bzlib
7608 CONFIG_ENCODERS = yes
7609 CONFIG_GPL = yes
7610 CONFIG_MLIB = $_mlib
7611 CONFIG_MUXERS = $_mencoder
7612 CONFIG_VDPAU = $_vdpau
7613 CONFIG_XVMC = $_xvmc
7614 CONFIG_ZLIB = $_zlib
7616 HAVE_PTHREADS = $_pthreads
7617 HAVE_SHM = $_shm
7618 HAVE_W32THREADS = $_w32threads
7619 HAVE_YASM = $have_yasm
7623 #############################################################################
7625 ff_config_enable () {
7626 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7627 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7628 _nprefix=$3;
7629 test -z "$_nprefix" && _nprefix='CONFIG'
7630 for part in $list; do
7631 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7632 echo "#define ${_nprefix}_$part 1"
7633 else
7634 echo "#define ${_nprefix}_$part 0"
7636 done
7639 echo "Creating config.h"
7640 cat > $TMPH << EOF
7641 /*----------------------------------------------------------------------------
7642 ** This file has been automatically generated by configure any changes in it
7643 ** will be lost when you run configure again.
7644 ** Instead of modifying definitions here, use the --enable/--disable options
7645 ** of the configure script! See ./configure --help for details.
7646 *---------------------------------------------------------------------------*/
7648 #ifndef MPLAYER_CONFIG_H
7649 #define MPLAYER_CONFIG_H
7651 /* Undefine this if you do not want to select mono audio (left or right)
7652 with a stereo MPEG layer 2/3 audio stream. The command line option
7653 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7654 right-only), with 0 being the default.
7656 #define CONFIG_FAKE_MONO 1
7658 /* set up audio OUTBURST. Do not change this! */
7659 #define OUTBURST 512
7661 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7662 #undef FAST_OSD
7663 #undef FAST_OSD_TABLE
7665 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
7666 #define MPEG12_POSTPROC 1
7667 #define ATTRIBUTE_ALIGNED_MAX 16
7671 #define CONFIGURATION "$configuration"
7673 #define MPLAYER_DATADIR "$_datadir"
7674 #define MPLAYER_CONFDIR "$_confdir"
7675 #define MPLAYER_LIBDIR "$_libdir"
7676 #define MPLAYER_LOCALEDIR "$_localedir"
7678 $def_translation
7680 /* definitions needed by included libraries */
7681 #define HAVE_INTTYPES_H 1
7682 /* libmpeg2 + FFmpeg */
7683 $def_fast_inttypes
7684 /* libdvdcss */
7685 #define HAVE_ERRNO_H 1
7686 /* libdvdcss + libdvdread */
7687 #define HAVE_LIMITS_H 1
7688 /* libdvdcss + libfaad2 */
7689 #define HAVE_UNISTD_H 1
7690 /* libfaad2 + libdvdread */
7691 #define STDC_HEADERS 1
7692 #define HAVE_MEMCPY 1
7693 /* libfaad2 */
7694 #define HAVE_STDLIB_H 1
7695 #define HAVE_STRING_H 1
7696 #define HAVE_STRINGS_H 1
7697 #define HAVE_SYS_STAT_H 1
7698 #define HAVE_SYS_TYPES_H 1
7699 /* libdvdnav */
7700 #define READ_CACHE_TRACE 0
7701 /* libdvdread */
7702 #define HAVE_DLFCN_H 1
7703 $def_dvdcss
7706 /* system headers */
7707 $def_alloca_h
7708 $def_alsa_asoundlib_h
7709 $def_altivec_h
7710 $def_malloc_h
7711 $def_mman_h
7712 $def_mman_has_map_failed
7713 $def_soundcard_h
7714 $def_sys_asoundlib_h
7715 $def_sys_soundcard_h
7716 $def_sys_sysinfo_h
7717 $def_termios_h
7718 $def_termios_sys_h
7719 $def_winsock2_h
7722 /* system functions */
7723 $def_gethostbyname2
7724 $def_gettimeofday
7725 $def_glob
7726 $def_langinfo
7727 $def_lrintf
7728 $def_map_memalign
7729 $def_memalign
7730 $def_nanosleep
7731 $def_posix_select
7732 $def_select
7733 $def_setenv
7734 $def_setmode
7735 $def_shm
7736 $def_strsep
7737 $def_swab
7738 $def_sysi86
7739 $def_sysi86_iv
7740 $def_termcap
7741 $def_termios
7742 $def_vsscanf
7745 /* system-specific features */
7746 $def_asmalign_pot
7747 $def_builtin_expect
7748 $def_dl
7749 $def_dos_paths
7750 $def_extern_asm
7751 $def_extern_prefix
7752 $def_iconv
7753 $def_kstat
7754 $def_macosx_bundle
7755 $def_macosx_finder
7756 $def_maemo
7757 $def_named_asm_args
7758 $def_priority
7759 $def_quicktime
7760 $def_restrict_keyword
7761 $def_rtc
7762 $def_unrar_exec
7765 /* configurable options */
7766 $def_charset
7767 $def_crash_debug
7768 $def_debug
7769 $def_dynamic_plugins
7770 $def_fastmemcpy
7771 $def_menu
7772 $def_runtime_cpudetection
7773 $def_sighandler
7774 $def_sortsub
7775 $def_stream_cache
7776 $def_pthread_cache
7779 /* CPU stuff */
7780 #define __CPU__ $iproc
7781 $def_ebx_available
7782 $def_words_endian
7783 $def_bigendian
7784 $(ff_config_enable "$arch_all" "$arch" "ARCH")
7785 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
7786 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
7789 /* Blu-ray/DVD/VCD/CD */
7790 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
7791 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
7792 $def_bluray
7793 $def_bsdi_dvd
7794 $def_cddb
7795 $def_cdio
7796 $def_cdparanoia
7797 $def_cdrom
7798 $def_dvd
7799 $def_dvd_bsd
7800 $def_dvd_darwin
7801 $def_dvd_linux
7802 $def_dvd_openbsd
7803 $def_dvdio
7804 $def_dvdnav
7805 $def_dvdread
7806 $def_hpux_scsi_h
7807 $def_libcdio
7808 $def_sol_scsi_h
7809 $def_vcd
7812 /* codec libraries */
7813 $def_faac
7814 $def_faad
7815 $def_faad_internal
7816 $def_liba52
7817 $def_libdca
7818 $def_libdv
7819 $def_liblzo
7820 $def_libmpeg2
7821 $def_mad
7822 $def_mp3lame
7823 $def_mp3lame_preset
7824 $def_mp3lame_preset_medium
7825 $def_mp3lib
7826 $def_mpg123
7827 $def_musepack
7828 $def_speex
7829 $def_theora
7830 $def_toolame
7831 $def_tremor
7832 $def_twolame
7833 $def_vorbis
7834 $def_x264
7835 $def_xvid
7836 $def_zlib
7838 $def_libnut
7841 /* binary codecs */
7842 $def_qtx
7843 $def_qtx_win32
7844 $def_real
7845 $def_win32_loader
7846 $def_win32dll
7847 $def_xanim
7848 $def_xmms
7849 #define BINARY_CODECS_PATH "$_codecsdir"
7850 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7853 /* Audio output drivers */
7854 $def_alsa
7855 $def_alsa1x
7856 $def_alsa5
7857 $def_alsa9
7858 $def_arts
7859 $def_coreaudio
7860 $def_dart
7861 $def_esd
7862 $def_esd_latency
7863 $def_jack
7864 $def_kai
7865 $def_nas
7866 $def_openal
7867 $def_openal_h
7868 $def_ossaudio
7869 $def_ossaudio_devdsp
7870 $def_ossaudio_devmixer
7871 $def_pulse
7872 $def_sgiaudio
7873 $def_sunaudio
7874 $def_win32waveout
7876 $def_ladspa
7877 $def_libbs2b
7880 /* input */
7881 $def_apple_ir
7882 $def_apple_remote
7883 $def_ioctl_bt848_h_name
7884 $def_ioctl_meteor_h_name
7885 $def_joystick
7886 $def_lirc
7887 $def_lircc
7888 $def_pvr
7889 $def_radio
7890 $def_radio_bsdbt848
7891 $def_radio_capture
7892 $def_radio_v4l
7893 $def_radio_v4l2
7894 $def_tv
7895 $def_tv_bsdbt848
7896 $def_tv_dshow
7897 $def_tv_v4l
7898 $def_tv_v4l1
7899 $def_tv_v4l2
7902 /* font stuff */
7903 $def_ass
7904 $def_bitmap_font
7905 $def_enca
7906 $def_fontconfig
7907 $def_freetype
7908 $def_fribidi
7911 /* networking */
7912 $def_closesocket
7913 $def_ftp
7914 $def_inet6
7915 $def_inet_aton
7916 $def_inet_pton
7917 $def_live
7918 $def_nemesi
7919 $def_networking
7920 $def_smb
7921 $def_socklen_t
7922 $def_vstream
7925 /* libvo options */
7926 $def_3dfx
7927 $def_aa
7928 $def_bl
7929 $def_caca
7930 $def_corevideo
7931 $def_dga
7932 $def_dga1
7933 $def_dga2
7934 $def_direct3d
7935 $def_directfb
7936 $def_directx
7937 $def_dvb
7938 $def_dvbin
7939 $def_dxr2
7940 $def_dxr3
7941 $def_fbdev
7942 $def_ggi
7943 $def_ggiwmh
7944 $def_gif
7945 $def_gif_4
7946 $def_gif_tvt_hack
7947 $def_gl
7948 $def_gl_win32
7949 $def_gl_x11
7950 $def_gl_sdl
7951 $def_matrixview
7952 $def_ivtv
7953 $def_jpeg
7954 $def_kva
7955 $def_md5sum
7956 $def_mga
7957 $def_mng
7958 $def_png
7959 $def_pnm
7960 $def_quartz
7961 $def_s3fb
7962 $def_sdl
7963 $def_sdl_sdl_h
7964 $def_svga
7965 $def_tdfxfb
7966 $def_tdfxvid
7967 $def_tga
7968 $def_v4l2
7969 $def_vdpau
7970 $def_vesa
7971 $def_vidix
7972 $def_vidix_drv_cyberblade
7973 $def_vidix_drv_ivtv
7974 $def_vidix_drv_mach64
7975 $def_vidix_drv_mga
7976 $def_vidix_drv_mga_crtc2
7977 $def_vidix_drv_nvidia
7978 $def_vidix_drv_pm3
7979 $def_vidix_drv_radeon
7980 $def_vidix_drv_rage128
7981 $def_vidix_drv_s3
7982 $def_vidix_drv_sh_veu
7983 $def_vidix_drv_sis
7984 $def_vidix_drv_unichrome
7985 $def_vidix_pfx
7986 $def_vm
7987 $def_wii
7988 $def_x11
7989 $def_xdpms
7990 $def_xf86keysym
7991 $def_xinerama
7992 $def_xmga
7993 $def_xss
7994 $def_xv
7995 $def_xvmc
7996 $def_xvr100
7997 $def_yuv4mpeg
7998 $def_zr
8001 /* FFmpeg */
8002 $def_ffmpeg
8003 $def_ffmpeg_internals
8005 #define CONFIG_DECODERS 1
8006 #define CONFIG_ENCODERS 1
8007 #define CONFIG_DEMUXERS 1
8008 $def_muxers
8010 $def_arpa_inet_h
8011 $def_bswap
8012 $def_bzlib
8013 $def_dcbzl
8014 $def_exp2
8015 $def_exp2f
8016 $def_fast_64bit
8017 $def_fast_unaligned
8018 $def_llrint
8019 $def_log2
8020 $def_log2f
8021 $def_lrint
8022 $def_memalign_hack
8023 $def_mlib
8024 $def_mkstemp
8025 $def_posix_memalign
8026 $def_pthreads
8027 $def_round
8028 $def_roundf
8029 $def_ten_operands
8030 $def_threads
8031 $def_truncf
8032 $def_xform_asm
8033 $def_yasm
8035 #define CONFIG_FASTDIV 0
8036 #define CONFIG_FFSERVER 0
8037 #define CONFIG_GPL 1
8038 #define CONFIG_GRAY 0
8039 #define CONFIG_HARDCODED_TABLES 0
8040 #define CONFIG_LIBVORBIS 0
8041 #define CONFIG_POWERPC_PERF 0
8042 #define CONFIG_SMALL 0
8043 #define CONFIG_SWSCALE_ALPHA 1
8045 #define HAVE_ATTRIBUTE_PACKED 1
8046 #define HAVE_GETHRTIME 0
8047 #define HAVE_INLINE_ASM 1
8048 #define HAVE_LDBRX 0
8049 #define HAVE_POLL_H 1
8050 #define HAVE_PPC4XX 0
8051 #define HAVE_VFP_ARGS 1
8052 #define HAVE_VIRTUALALLOC 0
8054 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
8055 #define CONFIG_AANDCT 1
8056 #define CONFIG_DCT 1
8057 #define CONFIG_DWT 1
8058 #define CONFIG_FFT 1
8059 #define CONFIG_GOLOMB 1
8060 #define CONFIG_H264DSP 1
8061 #define CONFIG_LPC 1
8062 #define CONFIG_MDCT 1
8063 #define CONFIG_RDFT 1
8065 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8066 #ifndef MP_DEBUG
8067 #define HAVE_EBP_AVAILABLE 1
8068 #else
8069 #define HAVE_EBP_AVAILABLE 0
8070 #endif
8072 #endif /* MPLAYER_CONFIG_H */
8075 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8076 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8078 #############################################################################
8080 ./version.sh `$_cc -dumpversion`
8082 cat << EOF
8084 Config files successfully generated by ./configure $configuration !
8086 Install prefix: $_prefix
8087 Data directory: $_datadir
8088 Config direct.: $_confdir
8090 Byte order: $_byte_order
8091 Optimizing for: $_optimizing
8093 Languages:
8094 Messages (in addition to English): $language_msg
8095 Manual pages: $language_man
8096 Documentation: $language_doc
8098 Enabled optional drivers:
8099 Input: $inputmodules
8100 Codecs: $codecmodules
8101 Audio output: $aomodules
8102 Video output: $vomodules
8104 Disabled optional drivers:
8105 Input: $noinputmodules
8106 Codecs: $nocodecmodules
8107 Audio output: $noaomodules
8108 Video output: $novomodules
8110 'config.h' and 'config.mak' contain your configuration options.
8111 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8112 compile *** DO NOT REPORT BUGS if you tweak these files ***
8114 'make' will now compile MPlayer and 'make install' will install it.
8115 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8120 if test "$_mtrr" = yes ; then
8121 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$language_doc/video.html#mtrr)"
8122 echo
8125 if ! x86_32; then
8126 cat <<EOF
8127 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8128 operating system ($system_name). You may encounter a few files that cannot
8129 be played due to missing open source video/audio codec support.
8135 cat <<EOF
8136 Check $TMPLOG if you wonder why an autodetection failed (make sure
8137 development headers/packages are installed).
8139 NOTE: The --enable-* parameters unconditionally force options on, completely
8140 skipping autodetection. This behavior is unlike what you may be used to from
8141 autoconf-based configure scripts that can decide to override you. This greater
8142 level of control comes at a price. You may have to provide the correct compiler
8143 and linker flags yourself.
8144 If you used one of these options (except --enable-menu and similar ones that
8145 turn on internal features) and experience a compilation or linking failure,
8146 make sure you have passed the necessary compiler/linker flags to configure.
8148 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
8152 if test "$warn_cflags" = yes; then
8153 cat <<EOF
8155 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
8156 but:
8158 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8160 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8161 To do so, execute 'CFLAGS= ./configure <options>'
8166 # Last move:
8167 rm -rf "$mplayer_tmpdir"