Merge branch 'sub'
[mplayer/glamo.git] / configure
blobae0447bd50eea6da6f820c14f4f2da80665ba5ff
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: Check the Subversion log.
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, look at the existing checks
23 # and try to use helper functions where you can.
25 # Furthermore you need to add the variable _feature to the list of default
26 # settings and set it to one of yes/no/auto. Also add appropriate
27 # --enable-feature/--disable-feature command line options.
28 # The results of the check should be written to config.h and config.mak
29 # at the end of this script. The variable names used for this should be
30 # uniform, i.e. if the option is named 'feature':
32 # _feature : should have a value of yes/no/auto
33 # def_feature : '#define ... 1' or '#undef ...' for conditional compilation
34 # _ld_feature : '-L/path/dir -lfeature' GCC options
36 #############################################################################
38 # Prevent locale nonsense from breaking basic text processing utils
39 export LC_ALL=C
41 # Store the configure line that was used
42 configuration="$*"
44 # Prefer these macros to full length text !
45 # These macros only return an error code - NO display is done
46 compile_check() {
47 source="$1"
48 shift
49 echo >> "$TMPLOG"
50 cat "$source" >> "$TMPLOG"
51 echo >> "$TMPLOG"
52 echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
53 rm -f "$TMPEXE"
54 $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
55 TMPRES="$?"
56 echo >> "$TMPLOG"
57 echo >> "$TMPLOG"
58 return "$TMPRES"
61 cc_check() {
62 compile_check $TMPC $@
65 cxx_check() {
66 compile_check $TMPCPP $@ -lstdc++
69 cflag_check() {
70 cat > $TMPC << EOF
71 int main(void) { return 0; }
72 EOF
73 compile_check $TMPC $@
76 statement_check() {
77 cat > $TMPC << EOF
78 #include <$1>
79 int main(void) { $2; return 0; }
80 EOF
81 shift
82 shift
83 compile_check $TMPC $@
86 header_check() {
87 cat > $TMPC << EOF
88 #include <$1>
89 int main(void) { return 0; }
90 EOF
91 shift
92 compile_check $TMPC $@
95 inline_asm_check() {
96 cat > $TMPC << EOF
97 int main(void) { __asm__ volatile ($1); return 0; }
98 EOF
99 shift
100 compile_check $TMPC $@
103 # The following checks are special and should only be used with broken and
104 # non-selfsufficient headers that do not include all of their dependencies.
106 header_check_broken() {
107 cat > $TMPC << EOF
108 #include <$1>
109 #include <$2>
110 int main(void) { return 0; }
112 shift
113 shift
114 compile_check $TMPC $@
117 statement_check_broken() {
118 cat > $TMPC << EOF
119 #include <$1>
120 #include <$2>
121 int main(void) { $3; return 0; }
123 shift 3
124 compile_check $TMPC $@
127 yasm_check() {
128 echo >> "$TMPLOG"
129 cat "$TMPS" >> "$TMPLOG"
130 echo >> "$TMPLOG"
131 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
132 rm -f "$TMPEXE"
133 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
134 TMPRES="$?"
135 echo >> "$TMPLOG"
136 echo >> "$TMPLOG"
137 return "$TMPRES"
140 tmp_run() {
141 "$TMPEXE" >> "$TMPLOG" 2>&1
144 # Display error message, flushes tempfile, exit
145 die () {
146 echo
147 echo "Error: $@" >&2
148 echo >&2
149 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
150 echo "Check \"$TMPLOG\" if you do not understand why it failed."
151 exit 1
154 # OS test booleans functions
155 issystem() {
156 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
158 aix() { issystem "AIX"; }
159 amigaos() { issystem "AmigaOS"; }
160 beos() { issystem "BEOS"; }
161 bsdos() { issystem "BSD/OS"; }
162 cygwin() { issystem "CYGWIN"; }
163 darwin() { issystem "Darwin"; }
164 dragonfly() { issystem "DragonFly"; }
165 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
166 gnu() { issystem "GNU"; }
167 hpux() { issystem "HP-UX"; }
168 irix() { issystem "IRIX"; }
169 linux() { issystem "Linux"; }
170 mingw32() { issystem "MINGW32"; }
171 morphos() { issystem "MorphOS"; }
172 netbsd() { issystem "NetBSD"; }
173 openbsd() { issystem "OpenBSD"; }
174 os2() { issystem "OS/2"; }
175 qnx() { issystem "QNX"; }
176 sunos() { issystem "SunOS"; }
177 win32() { cygwin || mingw32; }
179 # arch test boolean functions
180 # x86/x86pc is used by QNX
181 x86_32() {
182 case "$host_arch" in
183 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
184 *) return 1 ;;
185 esac
188 x86_64() {
189 case "$host_arch" in
190 x86_64|amd64) return 0 ;;
191 *) return 1 ;;
192 esac
195 x86() {
196 x86_32 || x86_64
199 ppc() {
200 case "$host_arch" in
201 ppc|ppc64|powerpc|powerpc64) return 0;;
202 *) return 1;;
203 esac
206 alpha() {
207 case "$host_arch" in
208 alpha*) return 0;;
209 *) return 1;;
210 esac
213 arm() {
214 case "$host_arch" in
215 arm*) return 0;;
216 *) return 1;;
217 esac
220 # Use this before starting a check
221 echocheck() {
222 echo "============ Checking for $@ ============" >> "$TMPLOG"
223 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
226 # Use this to echo the results of a check
227 echores() {
228 if test "$res_comment" ; then
229 res_comment="($res_comment)"
231 echo "Result is: $@ $res_comment" >> "$TMPLOG"
232 echo "##########################################" >> "$TMPLOG"
233 echo "" >> "$TMPLOG"
234 echo "$@ $res_comment"
235 res_comment=""
237 #############################################################################
239 # Check how echo works in this /bin/sh
240 case $(echo -n) in
241 -n) _echo_n= _echo_c='\c' ;; # SysV echo
242 *) _echo_n='-n ' _echo_c= ;; # BSD echo
243 esac
245 msg_lang_all=''
246 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
247 man_lang_all=$(echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g")
248 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
250 show_help(){
251 cat << EOF
252 Usage: $0 [OPTIONS]...
254 Configuration:
255 -h, --help display this help and exit
257 Installation directories:
258 --prefix=DIR prefix directory for installation [/usr/local]
259 --bindir=DIR directory for installing binaries [PREFIX/bin]
260 --datadir=DIR directory for installing machine independent
261 data files (skins, etc) [PREFIX/share/mplayer]
262 --mandir=DIR directory for installing man pages [PREFIX/share/man]
263 --confdir=DIR directory for installing configuration files
264 [PREFIX/etc/mplayer]
265 --localedir=DIR directory for locale tree [PREFIX/share/locale]
266 --libdir=DIR directory for object code libraries [PREFIX/lib]
267 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
269 Optional features:
270 --disable-mplayer disable MPlayer compilation [enable]
271 --disable-largefiles disable support for files > 2GB [enable]
272 --enable-termcap use termcap database for key codes [autodetect]
273 --enable-termios use termios database for key codes [autodetect]
274 --disable-iconv disable iconv for encoding conversion [autodetect]
275 --disable-langinfo do not use langinfo [autodetect]
276 --enable-lirc enable LIRC (remote control) support [autodetect]
277 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
278 --enable-joystick enable joystick support [disable]
279 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
280 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
281 --disable-vm disable X video mode extensions [autodetect]
282 --disable-xf86keysym disable support for multimedia keys [autodetect]
283 --enable-radio enable radio interface [disable]
284 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
285 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
286 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
287 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
288 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
289 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
290 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
291 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
292 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
293 --disable-networking disable networking [enable]
294 --enable-winsock2_h enable winsock2_h [autodetect]
295 --enable-smb enable Samba (SMB) input [autodetect]
296 --enable-live enable LIVE555 Streaming Media [autodetect]
297 --enable-nemesi enable Nemesi Streaming Media [autodetect]
298 --disable-vcd disable VCD support [autodetect]
299 --disable-bluray disable Blu-ray support [autodetect]
300 --disable-dvdnav disable libdvdnav [autodetect]
301 --disable-dvdread disable libdvdread [autodetect]
302 --disable-dvdread-internal disable internal libdvdread [autodetect]
303 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
304 --disable-cdparanoia disable cdparanoia [autodetect]
305 --disable-cddb disable cddb [autodetect]
306 --disable-bitmap-font disable bitmap font support [enable]
307 --disable-freetype disable FreeType 2 font rendering [autodetect]
308 --disable-fontconfig disable fontconfig font lookup [autodetect]
309 --disable-unrarexec disable using of UnRAR executable [enabled]
310 --enable-menu enable OSD menu (not DVD menu) [disabled]
311 --disable-sortsub disable subtitle sorting [enabled]
312 --enable-fribidi enable the FriBiDi libs [autodetect]
313 --disable-enca disable ENCA charset oracle library [autodetect]
314 --disable-maemo disable maemo specific features [autodetect]
315 --enable-macosx-finder enable Mac OS X Finder invocation parameter
316 parsing [disabled]
317 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
318 --disable-inet6 disable IPv6 support [autodetect]
319 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
320 --disable-ftp disable FTP support [enabled]
321 --disable-vstream disable TiVo vstream client support [autodetect]
322 --disable-pthreads disable Posix threads support [autodetect]
323 --disable-w32threads disable Win32 threads support [autodetect]
324 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
325 --enable-rpath enable runtime linker path for extra libs [disabled]
327 Codecs:
328 --enable-gif enable GIF support [autodetect]
329 --enable-png enable PNG input/output support [autodetect]
330 --enable-mng enable MNG input support [autodetect]
331 --enable-jpeg enable JPEG input/output support [autodetect]
332 --enable-libcdio enable libcdio support [autodetect]
333 --enable-liblzo enable liblzo support [autodetect]
334 --disable-win32dll disable Win32 DLL support [autodetect]
335 --disable-qtx disable QuickTime codecs support [enabled]
336 --disable-xanim disable XAnim codecs support [enabled]
337 --disable-real disable RealPlayer codecs support [enabled]
338 --disable-xvid disable Xvid [autodetect]
339 --disable-libnut disable libnut [autodetect]
340 --disable-ffmpeg disable FFmpeg [autodetect]
341 --disable-tremor-internal disable internal Tremor [enabled]
342 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
343 --enable-tremor enable external Tremor [autodetect]
344 --disable-libvorbis disable libvorbis support [autodetect]
345 --disable-speex disable Speex support [autodetect]
346 --enable-theora enable OggTheora libraries [autodetect]
347 --enable-faad enable external FAAD2 (AAC) [autodetect]
348 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
349 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
350 --disable-ladspa disable LADSPA plugin support [autodetect]
351 --disable-libbs2b disable libbs2b audio filter support [autodetect]
352 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
353 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
354 --disable-mad disable libmad (MPEG audio) support [autodetect]
355 --enable-xmms enable XMMS input plugin support [disabled]
356 --enable-libdca enable libdca support [autodetect]
357 --disable-mp3lib disable builtin mp3lib [autodetect]
358 --disable-liba52 disable liba52 [autodetect]
359 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
360 --disable-musepack disable musepack support [autodetect]
362 Video output:
363 --disable-vidix disable VIDIX [for x86 *nix]
364 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
365 Available: cyberblade, ivtv, mach64, mga, mga_crtc2,
366 nvidia, pm2, pm3, radeon, rage128, s3, sis, unichrome
367 --disable-vidix-pcidb disable VIDIX PCI device name database
368 --enable-dhahelper enable VIDIX dhahelper support
369 --enable-svgalib_helper enable VIDIX svgalib_helper support
370 --enable-gl enable OpenGL video output [autodetect]
371 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
372 --enable-dga2 enable DGA 2 support [autodetect]
373 --enable-dga1 enable DGA 1 support [autodetect]
374 --enable-vesa enable VESA video output [autodetect]
375 --enable-svga enable SVGAlib video output [autodetect]
376 --enable-sdl enable SDL video output [autodetect]
377 --enable-kva enable KVA video output [autodetect]
378 --enable-aa enable AAlib video output [autodetect]
379 --enable-caca enable CACA video output [autodetect]
380 --enable-ggi enable GGI video output [autodetect]
381 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
382 --enable-direct3d enable Direct3D video output [autodetect]
383 --enable-directx enable DirectX video output [autodetect]
384 --enable-dxr2 enable DXR2 video output [autodetect]
385 --enable-dxr3 enable DXR3/H+ video output [autodetect]
386 --enable-ivtv enable IVTV TV-Out video output [autodetect]
387 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
388 --enable-dvb enable DVB video output [autodetect]
389 --enable-mga enable mga_vid video output [autodetect]
390 --enable-xmga enable mga_vid X11 video output [autodetect]
391 --enable-xv enable Xv video output [autodetect]
392 --enable-xvmc enable XvMC acceleration [disable]
393 --enable-vdpau enable VDPAU acceleration [autodetect]
394 --enable-vm enable XF86VidMode support [autodetect]
395 --enable-xinerama enable Xinerama support [autodetect]
396 --enable-x11 enable X11 video output [autodetect]
397 --enable-xshape enable XShape support [autodetect]
398 --disable-xss disable screensaver support via xss [autodetect]
399 --enable-fbdev enable FBDev video output [autodetect]
400 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
401 --enable-tdfxfb enable tdfxfb video output [disable]
402 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
403 --enable-wii enable Nintendo Wii/GameCube video output [disable]
404 --enable-directfb enable DirectFB video output [autodetect]
405 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
406 --enable-bl enable Blinkenlights video output [disable]
407 --enable-tdfxvid enable tdfx_vid video output [disable]
408 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
409 --disable-tga disable Targa video output [enable]
410 --disable-pnm disable PNM video output [enable]
411 --disable-md5sum disable md5sum video output [enable]
412 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
413 --disable-corevideo disable CoreVideo video output [autodetect]
414 --disable-quartz disable Quartz video output [autodetect]
416 Audio output:
417 --disable-alsa disable ALSA audio output [autodetect]
418 --disable-ossaudio disable OSS audio output [autodetect]
419 --disable-arts disable aRts audio output [autodetect]
420 --disable-esd disable esd audio output [autodetect]
421 --disable-pulse disable Pulseaudio audio output [autodetect]
422 --disable-jack disable JACK audio output [autodetect]
423 --enable-openal enable OpenAL audio output [disable]
424 --disable-nas disable NAS audio output [autodetect]
425 --disable-sgiaudio disable SGI audio output [autodetect]
426 --disable-sunaudio disable Sun audio output [autodetect]
427 --disable-kai disable KAI audio output [autodetect]
428 --disable-dart disable DART audio output [autodetect]
429 --disable-win32waveout disable Windows waveout audio output [autodetect]
430 --disable-coreaudio disable CoreAudio audio output [autodetect]
431 --disable-select disable using select() on the audio device [enable]
433 Language options:
434 --enable-translation enable support for translated output [disable]
435 --charset=charset convert the console messages to this character set
436 --language-doc=lang language to use for the documentation [en]
437 --language-man=lang language to use for the man pages [en]
438 --language-msg=lang extra languages for program messages [all]
439 --language=lang default language to use [en]
440 Specific options override --language. You can pass a list of languages separated
441 by whitespace or commas instead of a single language. Nonexisting translations
442 will be dropped from each list. All translations available in the list will be
443 installed. The value "all" will activate all translations. The LINGUAS
444 environment variable is honored. In all cases the fallback is English.
445 The program always supports English-language output; additional message
446 languages are only installed if --enable-translation is also specified.
447 Available values for --language-doc are: all $doc_lang_all
448 Available values for --language-man are: all $man_lang_all
449 Available values for --language-msg are: all $msg_lang_all
451 Miscellaneous options:
452 --enable-runtime-cpudetection enable runtime CPU detection [disable]
453 --enable-cross-compile enable cross-compilation [autodetect]
454 --cc=COMPILER C compiler to build MPlayer [gcc]
455 --host-cc=COMPILER C compiler for tools needed while building [gcc]
456 --as=ASSEMBLER assembler to build MPlayer [as]
457 --nm=NM nm tool to build MPlayer [nm]
458 --yasm=YASM Yasm assembler to build MPlayer [yasm]
459 --ar=AR librarian to build MPlayer [ar]
460 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
461 --windres=WINDRES windres to build MPlayer [windres]
462 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
463 --enable-static build a statically linked binary
464 --with-install=PATH path to a custom install program
466 Advanced options:
467 --enable-mmx enable MMX [autodetect]
468 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
469 --enable-3dnow enable 3DNow! [autodetect]
470 --enable-3dnowext enable extended 3DNow! [autodetect]
471 --enable-sse enable SSE [autodetect]
472 --enable-sse2 enable SSE2 [autodetect]
473 --enable-ssse3 enable SSSE3 [autodetect]
474 --enable-shm enable shm [autodetect]
475 --enable-altivec enable AltiVec (PowerPC) [autodetect]
476 --enable-armv5te enable DSP extensions (ARM) [autodetect]
477 --enable-armv6 enable ARMv6 (ARM) [autodetect]
478 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
479 --enable-armvfp enable ARM VFP (ARM) [autodetect]
480 --enable-neon enable NEON (ARM) [autodetect]
481 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
482 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
483 --enable-big-endian force byte order to big-endian [autodetect]
484 --enable-debug[=1-3] compile-in debugging information [disable]
485 --enable-profile compile-in profiling information [disable]
486 --disable-sighandler disable sighandler for crashes [enable]
487 --enable-crash-debug enable automatic gdb attach on crash [disable]
488 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
489 --ffmpeg-source-dir=PATH enable features requiring internal FFmpeg headers
491 Use these options if autodetection fails:
492 --extra-cflags=FLAGS extra CFLAGS
493 --extra-ldflags=FLAGS extra LDFLAGS
494 --extra-libs=FLAGS extra linker flags
495 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
496 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
498 --with-freetype-config=PATH path to freetype-config
499 --with-glib-config=PATH path to glib*-config
500 --with-gtk-config=PATH path to gtk*-config
501 --with-sdl-config=PATH path to sdl*-config
502 --with-dvdnav-config=PATH path to dvdnav-config
503 --with-dvdread-config=PATH path to dvdread-config
505 This configure script is NOT autoconf-based, even though its output is similar.
506 It will try to autodetect all configuration options. If you --enable an option
507 it will be forcefully turned on, skipping autodetection. This can break
508 compilation, so you need to know what you are doing.
510 exit 0
511 } #show_help()
513 # GOTCHA: the variables below defines the default behavior for autodetection
514 # and have - unless stated otherwise - at least 2 states : yes no
515 # If autodetection is available then the third state is: auto
516 _mmx=auto
517 _3dnow=auto
518 _3dnowext=auto
519 _mmxext=auto
520 _sse=auto
521 _sse2=auto
522 _ssse3=auto
523 _cmov=auto
524 _fast_cmov=auto
525 _fast_clz=auto
526 _armv5te=auto
527 _armv6=auto
528 _armv6t2=auto
529 _armvfp=auto
530 neon=auto
531 _iwmmxt=auto
532 _mtrr=auto
533 _altivec=auto
534 _install=install
535 _ranlib=ranlib
536 _windres=windres
537 _cc=cc
538 _ar=ar
539 test "$CC" && _cc="$CC"
540 _as=auto
541 _nm=auto
542 _yasm=yasm
543 _runtime_cpudetection=no
544 _cross_compile=auto
545 _prefix="/usr/local"
546 ffmpeg=auto
547 ffmpeg_internals=no
548 _mplayer=yes
549 _x11=auto
550 _xshape=auto
551 _xss=auto
552 _dga1=auto
553 _dga2=auto
554 _xv=auto
555 _xvmc=no #auto when complete
556 _vdpau=auto
557 _sdl=auto
558 _kva=auto
559 _direct3d=auto
560 _directx=auto
561 _win32waveout=auto
562 _nas=auto
563 _png=auto
564 _mng=auto
565 _jpeg=auto
566 _pnm=yes
567 _md5sum=yes
568 _yuv4mpeg=yes
569 _gif=auto
570 _gl=auto
571 matrixview=yes
572 _ggi=auto
573 _ggiwmh=auto
574 _aa=auto
575 _caca=auto
576 _svga=auto
577 _vesa=auto
578 _fbdev=auto
579 _dvb=auto
580 _dxr2=auto
581 _dxr3=auto
582 _ivtv=auto
583 _v4l2=auto
584 _iconv=auto
585 _langinfo=auto
586 _rtc=auto
587 _ossaudio=auto
588 _arts=auto
589 _esd=auto
590 _pulse=auto
591 _jack=auto
592 _kai=auto
593 _dart=auto
594 _openal=no
595 _libcdio=auto
596 _liblzo=auto
597 _mad=auto
598 _tremor=auto
599 _tremor_internal=yes
600 _tremor_low=no
601 _libvorbis=auto
602 _speex=auto
603 _theora=auto
604 _mpg123=auto
605 _mp3lib=auto
606 _liba52=auto
607 _libdca=auto
608 _libmpeg2=auto
609 _faad=auto
610 _faad_internal=auto
611 _faad_fixed=no
612 _ladspa=auto
613 _libbs2b=auto
614 _xmms=no
615 _vcd=auto
616 _bluray=auto
617 _dvdnav=auto
618 _dvdnavconfig=dvdnav-config
619 _dvdreadconfig=dvdread-config
620 _dvdread=auto
621 _dvdread_internal=auto
622 _libdvdcss_internal=auto
623 _xanim=auto
624 _real=auto
625 _live=auto
626 _nemesi=auto
627 _native_rtsp=yes
628 _xinerama=auto
629 _mga=auto
630 _xmga=auto
631 _vm=auto
632 _xf86keysym=auto
633 _sgiaudio=auto
634 _sunaudio=auto
635 _alsa=auto
636 _fastmemcpy=yes
637 _unrar_exec=auto
638 _win32dll=auto
639 _select=yes
640 _radio=no
641 _radio_capture=no
642 _radio_v4l=auto
643 _radio_v4l2=auto
644 _radio_bsdbt848=auto
645 _tv=yes
646 _tv_v4l1=auto
647 _tv_v4l2=auto
648 _tv_bsdbt848=auto
649 _tv_dshow=auto
650 _pvr=auto
651 networking=yes
652 _winsock2_h=auto
653 _smb=auto
654 _vidix=auto
655 _vidix_pcidb=yes
656 _dhahelper=no
657 _svgalib_helper=no
658 _joystick=no
659 _xvid=auto
660 _libnut=auto
661 _lirc=auto
662 _lircc=auto
663 _apple_remote=auto
664 _apple_ir=auto
665 _gui=no
666 _gtk1=no
667 _termcap=auto
668 _termios=auto
669 _3dfx=no
670 _s3fb=no
671 _wii=no
672 _tdfxfb=no
673 _tdfxvid=no
674 _xvr100=auto
675 _tga=yes
676 _directfb=auto
677 _zr=auto
678 _bl=no
679 _largefiles=yes
680 #language=en
681 _shm=auto
682 _translation=no
683 _charset="UTF-8"
684 _dynamic_plugins=no
685 _crash_debug=no
686 _sighandler=yes
687 _libdv=auto
688 _cdparanoia=auto
689 _cddb=auto
690 _big_endian=auto
691 _bitmap_font=yes
692 _freetype=auto
693 _fontconfig=auto
694 _menu=no
695 _qtx=auto
696 _maemo=auto
697 _coreaudio=auto
698 _corevideo=auto
699 _quartz=auto
700 quicktime=auto
701 _macosx_finder=no
702 _macosx_bundle=auto
703 _sortsub=yes
704 _freetypeconfig='freetype-config'
705 _fribidi=auto
706 _enca=auto
707 _inet6=auto
708 _gethostbyname2=auto
709 _ftp=auto
710 _musepack=auto
711 _vstream=auto
712 _pthreads=auto
713 _w32threads=auto
714 _ass=auto
715 _rpath=no
716 _asmalign_pot=auto
717 _stream_cache=yes
718 _priority=no
719 def_dos_paths="#define HAVE_DOS_PATHS 0"
720 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
721 def_priority="#undef CONFIG_PRIORITY"
722 def_pthread_cache="#undef PTHREAD_CACHE"
723 _need_shmem=yes
724 for ac_option do
725 case "$ac_option" in
726 --help|-help|-h)
727 show_help
729 --prefix=*)
730 _prefix=$(echo $ac_option | cut -d '=' -f 2)
732 --bindir=*)
733 _bindir=$(echo $ac_option | cut -d '=' -f 2)
735 --datadir=*)
736 _datadir=$(echo $ac_option | cut -d '=' -f 2)
738 --mandir=*)
739 _mandir=$(echo $ac_option | cut -d '=' -f 2)
741 --confdir=*)
742 _confdir=$(echo $ac_option | cut -d '=' -f 2)
744 --libdir=*)
745 _libdir=$(echo $ac_option | cut -d '=' -f 2)
747 --codecsdir=*)
748 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
750 --localedir=*)
751 _localedir=$(echo $ac_option | cut -d '=' -f 2)
754 --with-install=*)
755 _install=$(echo $ac_option | cut -d '=' -f 2 )
757 --with-xvmclib=*)
758 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
761 --with-sdl-config=*)
762 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
764 --with-freetype-config=*)
765 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
767 --with-gtk-config=*)
768 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
770 --with-glib-config=*)
771 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
773 --with-dvdnav-config=*)
774 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
776 --with-dvdread-config=*)
777 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
780 --extra-cflags=*)
781 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
783 --extra-ldflags=*)
784 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
786 --extra-libs=*)
787 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
789 --extra-libs-mplayer=*)
790 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
793 --target=*)
794 _target=$(echo $ac_option | cut -d '=' -f 2)
796 --cc=*)
797 _cc=$(echo $ac_option | cut -d '=' -f 2)
799 --host-cc=*)
800 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
802 --as=*)
803 _as=$(echo $ac_option | cut -d '=' -f 2)
805 --nm=*)
806 _nm=$(echo $ac_option | cut -d '=' -f 2)
808 --yasm=*)
809 _yasm=$(echo $ac_option | cut -d '=' -f 2)
811 --ar=*)
812 _ar=$(echo $ac_option | cut -d '=' -f 2)
814 --ranlib=*)
815 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
817 --windres=*)
818 _windres=$(echo $ac_option | cut -d '=' -f 2)
820 --charset=*)
821 _charset=$(echo $ac_option | cut -d '=' -f 2)
823 --language-doc=*)
824 language_doc=$(echo $ac_option | cut -d '=' -f 2)
826 --language-man=*)
827 language_man=$(echo $ac_option | cut -d '=' -f 2)
829 --language-msg=*)
830 language_msg=$(echo $ac_option | cut -d '=' -f 2)
832 --language=*)
833 language=$(echo $ac_option | cut -d '=' -f 2)
836 --enable-static)
837 _ld_static='-static'
839 --disable-static)
840 _ld_static=''
842 --enable-profile)
843 _profile='-p'
845 --disable-profile)
846 _profile=
848 --enable-debug)
849 _debug='-g'
851 --enable-debug=*)
852 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
854 --disable-debug)
855 _debug=
857 --enable-translation) _translation=yes ;;
858 --disable-translation) _translation=no ;;
859 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
860 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
861 --enable-cross-compile) _cross_compile=yes ;;
862 --disable-cross-compile) _cross_compile=no ;;
863 --enable-mplayer) _mplayer=yes ;;
864 --disable-mplayer) _mplayer=no ;;
865 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
866 --disable-dynamic-plugins) _dynamic_plugins=no ;;
867 --enable-x11) _x11=yes ;;
868 --disable-x11) _x11=no ;;
869 --enable-xshape) _xshape=yes ;;
870 --disable-xshape) _xshape=no ;;
871 --enable-xss) _xss=yes ;;
872 --disable-xss) _xss=no ;;
873 --enable-xv) _xv=yes ;;
874 --disable-xv) _xv=no ;;
875 --enable-xvmc) _xvmc=yes ;;
876 --disable-xvmc) _xvmc=no ;;
877 --enable-vdpau) _vdpau=yes ;;
878 --disable-vdpau) _vdpau=no ;;
879 --enable-sdl) _sdl=yes ;;
880 --disable-sdl) _sdl=no ;;
881 --enable-kva) _kva=yes ;;
882 --disable-kva) _kva=no ;;
883 --enable-direct3d) _direct3d=yes ;;
884 --disable-direct3d) _direct3d=no ;;
885 --enable-directx) _directx=yes ;;
886 --disable-directx) _directx=no ;;
887 --enable-win32waveout) _win32waveout=yes ;;
888 --disable-win32waveout) _win32waveout=no ;;
889 --enable-nas) _nas=yes ;;
890 --disable-nas) _nas=no ;;
891 --enable-png) _png=yes ;;
892 --disable-png) _png=no ;;
893 --enable-mng) _mng=yes ;;
894 --disable-mng) _mng=no ;;
895 --enable-jpeg) _jpeg=yes ;;
896 --disable-jpeg) _jpeg=no ;;
897 --enable-pnm) _pnm=yes ;;
898 --disable-pnm) _pnm=no ;;
899 --enable-md5sum) _md5sum=yes ;;
900 --disable-md5sum) _md5sum=no ;;
901 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
902 --disable-yuv4mpeg) _yuv4mpeg=no ;;
903 --enable-gif) _gif=yes ;;
904 --disable-gif) _gif=no ;;
905 --enable-gl) _gl=yes ;;
906 --disable-gl) _gl=no ;;
907 --enable-matrixview) matrixview=yes ;;
908 --disable-matrixview) matrixview=no ;;
909 --enable-ggi) _ggi=yes ;;
910 --disable-ggi) _ggi=no ;;
911 --enable-ggiwmh) _ggiwmh=yes ;;
912 --disable-ggiwmh) _ggiwmh=no ;;
913 --enable-aa) _aa=yes ;;
914 --disable-aa) _aa=no ;;
915 --enable-caca) _caca=yes ;;
916 --disable-caca) _caca=no ;;
917 --enable-svga) _svga=yes ;;
918 --disable-svga) _svga=no ;;
919 --enable-vesa) _vesa=yes ;;
920 --disable-vesa) _vesa=no ;;
921 --enable-fbdev) _fbdev=yes ;;
922 --disable-fbdev) _fbdev=no ;;
923 --enable-dvb) _dvb=yes ;;
924 --disable-dvb) _dvb=no ;;
925 --enable-dxr2) _dxr2=yes ;;
926 --disable-dxr2) _dxr2=no ;;
927 --enable-dxr3) _dxr3=yes ;;
928 --disable-dxr3) _dxr3=no ;;
929 --enable-ivtv) _ivtv=yes ;;
930 --disable-ivtv) _ivtv=no ;;
931 --enable-v4l2) _v4l2=yes ;;
932 --disable-v4l2) _v4l2=no ;;
933 --enable-iconv) _iconv=yes ;;
934 --disable-iconv) _iconv=no ;;
935 --enable-langinfo) _langinfo=yes ;;
936 --disable-langinfo) _langinfo=no ;;
937 --enable-rtc) _rtc=yes ;;
938 --disable-rtc) _rtc=no ;;
939 --enable-libdv) _libdv=yes ;;
940 --disable-libdv) _libdv=no ;;
941 --enable-ossaudio) _ossaudio=yes ;;
942 --disable-ossaudio) _ossaudio=no ;;
943 --enable-arts) _arts=yes ;;
944 --disable-arts) _arts=no ;;
945 --enable-esd) _esd=yes ;;
946 --disable-esd) _esd=no ;;
947 --enable-pulse) _pulse=yes ;;
948 --disable-pulse) _pulse=no ;;
949 --enable-jack) _jack=yes ;;
950 --disable-jack) _jack=no ;;
951 --enable-openal) _openal=yes ;;
952 --disable-openal) _openal=no ;;
953 --enable-kai) _kai=yes ;;
954 --disable-kai) _kai=no ;;
955 --enable-dart) _dart=yes ;;
956 --disable-dart) _dart=no ;;
957 --enable-mad) _mad=yes ;;
958 --disable-mad) _mad=no ;;
959 --enable-libcdio) _libcdio=yes ;;
960 --disable-libcdio) _libcdio=no ;;
961 --enable-liblzo) _liblzo=yes ;;
962 --disable-liblzo) _liblzo=no ;;
963 --enable-libvorbis) _libvorbis=yes ;;
964 --disable-libvorbis) _libvorbis=no ;;
965 --enable-speex) _speex=yes ;;
966 --disable-speex) _speex=no ;;
967 --enable-tremor) _tremor=yes ;;
968 --disable-tremor) _tremor=no ;;
969 --enable-tremor-internal) _tremor_internal=yes ;;
970 --disable-tremor-internal) _tremor_internal=no ;;
971 --enable-tremor-low) _tremor_low=yes ;;
972 --disable-tremor-low) _tremor_low=no ;;
973 --enable-theora) _theora=yes ;;
974 --disable-theora) _theora=no ;;
975 --enable-mpg123) _mpg123=yes ;;
976 --disable-mpg123) _mpg123=no ;;
977 --enable-mp3lib) _mp3lib=yes ;;
978 --disable-mp3lib) _mp3lib=no ;;
979 --enable-liba52) _liba52=yes ;;
980 --disable-liba52) _liba52=no ;;
981 --enable-libdca) _libdca=yes ;;
982 --disable-libdca) _libdca=no ;;
983 --enable-libmpeg2) _libmpeg2=yes ;;
984 --disable-libmpeg2) _libmpeg2=no ;;
985 --enable-musepack) _musepack=yes ;;
986 --disable-musepack) _musepack=no ;;
987 --enable-faad) _faad=yes ;;
988 --disable-faad) _faad=no ;;
989 --enable-faad-internal) _faad_internal=yes ;;
990 --disable-faad-internal) _faad_internal=no ;;
991 --enable-faad-fixed) _faad_fixed=yes ;;
992 --disable-faad-fixed) _faad_fixed=no ;;
993 --enable-ladspa) _ladspa=yes ;;
994 --disable-ladspa) _ladspa=no ;;
995 --enable-libbs2b) _libbs2b=yes ;;
996 --disable-libbs2b) _libbs2b=no ;;
997 --enable-xmms) _xmms=yes ;;
998 --disable-xmms) _xmms=no ;;
999 --enable-vcd) _vcd=yes ;;
1000 --disable-vcd) _vcd=no ;;
1001 --enable-bluray) _bluray=yes ;;
1002 --disable-bluray) _bluray=no ;;
1003 --enable-dvdread) _dvdread=yes ;;
1004 --disable-dvdread) _dvdread=no ;;
1005 --enable-dvdread-internal) _dvdread_internal=yes ;;
1006 --disable-dvdread-internal) _dvdread_internal=no ;;
1007 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1008 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1009 --enable-dvdnav) _dvdnav=yes ;;
1010 --disable-dvdnav) _dvdnav=no ;;
1011 --enable-xanim) _xanim=yes ;;
1012 --disable-xanim) _xanim=no ;;
1013 --enable-real) _real=yes ;;
1014 --disable-real) _real=no ;;
1015 --enable-live) _live=yes ;;
1016 --disable-live) _live=no ;;
1017 --enable-nemesi) _nemesi=yes ;;
1018 --disable-nemesi) _nemesi=no ;;
1019 --enable-xinerama) _xinerama=yes ;;
1020 --disable-xinerama) _xinerama=no ;;
1021 --enable-mga) _mga=yes ;;
1022 --disable-mga) _mga=no ;;
1023 --enable-xmga) _xmga=yes ;;
1024 --disable-xmga) _xmga=no ;;
1025 --enable-vm) _vm=yes ;;
1026 --disable-vm) _vm=no ;;
1027 --enable-xf86keysym) _xf86keysym=yes ;;
1028 --disable-xf86keysym) _xf86keysym=no ;;
1029 --enable-sunaudio) _sunaudio=yes ;;
1030 --disable-sunaudio) _sunaudio=no ;;
1031 --enable-sgiaudio) _sgiaudio=yes ;;
1032 --disable-sgiaudio) _sgiaudio=no ;;
1033 --enable-alsa) _alsa=yes ;;
1034 --disable-alsa) _alsa=no ;;
1035 --enable-tv) _tv=yes ;;
1036 --disable-tv) _tv=no ;;
1037 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1038 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1039 --enable-tv-v4l1) _tv_v4l1=yes ;;
1040 --disable-tv-v4l1) _tv_v4l1=no ;;
1041 --enable-tv-v4l2) _tv_v4l2=yes ;;
1042 --disable-tv-v4l2) _tv_v4l2=no ;;
1043 --enable-tv-dshow) _tv_dshow=yes ;;
1044 --disable-tv-dshow) _tv_dshow=no ;;
1045 --enable-radio) _radio=yes ;;
1046 --enable-radio-capture) _radio_capture=yes ;;
1047 --disable-radio-capture) _radio_capture=no ;;
1048 --disable-radio) _radio=no ;;
1049 --enable-radio-v4l) _radio_v4l=yes ;;
1050 --disable-radio-v4l) _radio_v4l=no ;;
1051 --enable-radio-v4l2) _radio_v4l2=yes ;;
1052 --disable-radio-v4l2) _radio_v4l2=no ;;
1053 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1054 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1055 --enable-pvr) _pvr=yes ;;
1056 --disable-pvr) _pvr=no ;;
1057 --enable-fastmemcpy) _fastmemcpy=yes ;;
1058 --disable-fastmemcpy) _fastmemcpy=no ;;
1059 --enable-networking) networking=yes ;;
1060 --disable-networking) networking=no ;;
1061 --enable-winsock2_h) _winsock2_h=yes ;;
1062 --disable-winsock2_h) _winsock2_h=no ;;
1063 --enable-smb) _smb=yes ;;
1064 --disable-smb) _smb=no ;;
1065 --enable-vidix) _vidix=yes ;;
1066 --disable-vidix) _vidix=no ;;
1067 --with-vidix-drivers=*)
1068 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1070 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1071 --enable-dhahelper) _dhahelper=yes ;;
1072 --disable-dhahelper) _dhahelper=no ;;
1073 --enable-svgalib_helper) _svgalib_helper=yes ;;
1074 --disable-svgalib_helper) _svgalib_helper=no ;;
1075 --enable-joystick) _joystick=yes ;;
1076 --disable-joystick) _joystick=no ;;
1077 --enable-xvid) _xvid=yes ;;
1078 --disable-xvid) _xvid=no ;;
1079 --enable-libnut) _libnut=yes ;;
1080 --disable-libnut) _libnut=no ;;
1081 --enable-ffmpeg) ffmpeg=yes ;;
1082 --disable-ffmpeg) ffmpeg=no ;;
1083 --ffmpeg-source-dir=*)
1084 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1086 --enable-lirc) _lirc=yes ;;
1087 --disable-lirc) _lirc=no ;;
1088 --enable-lircc) _lircc=yes ;;
1089 --disable-lircc) _lircc=no ;;
1090 --enable-apple-remote) _apple_remote=yes ;;
1091 --disable-apple-remote) _apple_remote=no ;;
1092 --enable-apple-ir) _apple_ir=yes ;;
1093 --disable-apple-ir) _apple_ir=no ;;
1094 --enable-gui) _gui=yes ;;
1095 --disable-gui) _gui=no ;;
1096 --enable-gtk1) _gtk1=yes ;;
1097 --disable-gtk1) _gtk1=no ;;
1098 --enable-termcap) _termcap=yes ;;
1099 --disable-termcap) _termcap=no ;;
1100 --enable-termios) _termios=yes ;;
1101 --disable-termios) _termios=no ;;
1102 --enable-3dfx) _3dfx=yes ;;
1103 --disable-3dfx) _3dfx=no ;;
1104 --enable-s3fb) _s3fb=yes ;;
1105 --disable-s3fb) _s3fb=no ;;
1106 --enable-wii) _wii=yes ;;
1107 --disable-wii) _wii=no ;;
1108 --enable-tdfxfb) _tdfxfb=yes ;;
1109 --disable-tdfxfb) _tdfxfb=no ;;
1110 --disable-tdfxvid) _tdfxvid=no ;;
1111 --enable-tdfxvid) _tdfxvid=yes ;;
1112 --disable-xvr100) _xvr100=no ;;
1113 --enable-xvr100) _xvr100=yes ;;
1114 --disable-tga) _tga=no ;;
1115 --enable-tga) _tga=yes ;;
1116 --enable-directfb) _directfb=yes ;;
1117 --disable-directfb) _directfb=no ;;
1118 --enable-zr) _zr=yes ;;
1119 --disable-zr) _zr=no ;;
1120 --enable-bl) _bl=yes ;;
1121 --disable-bl) _bl=no ;;
1122 --enable-mtrr) _mtrr=yes ;;
1123 --disable-mtrr) _mtrr=no ;;
1124 --enable-largefiles) _largefiles=yes ;;
1125 --disable-largefiles) _largefiles=no ;;
1126 --enable-shm) _shm=yes ;;
1127 --disable-shm) _shm=no ;;
1128 --enable-select) _select=yes ;;
1129 --disable-select) _select=no ;;
1130 --enable-cdparanoia) _cdparanoia=yes ;;
1131 --disable-cdparanoia) _cdparanoia=no ;;
1132 --enable-cddb) _cddb=yes ;;
1133 --disable-cddb) _cddb=no ;;
1134 --enable-big-endian) _big_endian=yes ;;
1135 --disable-big-endian) _big_endian=no ;;
1136 --enable-bitmap-font) _bitmap_font=yes ;;
1137 --disable-bitmap-font) _bitmap_font=no ;;
1138 --enable-freetype) _freetype=yes ;;
1139 --disable-freetype) _freetype=no ;;
1140 --enable-fontconfig) _fontconfig=yes ;;
1141 --disable-fontconfig) _fontconfig=no ;;
1142 --enable-unrarexec) _unrar_exec=yes ;;
1143 --disable-unrarexec) _unrar_exec=no ;;
1144 --enable-ftp) _ftp=yes ;;
1145 --disable-ftp) _ftp=no ;;
1146 --enable-vstream) _vstream=yes ;;
1147 --disable-vstream) _vstream=no ;;
1148 --enable-pthreads) _pthreads=yes ;;
1149 --disable-pthreads) _pthreads=no ;;
1150 --enable-w32threads) _w32threads=yes ;;
1151 --disable-w32threads) _w32threads=no ;;
1152 --enable-ass) _ass=yes ;;
1153 --disable-ass) _ass=no ;;
1154 --enable-rpath) _rpath=yes ;;
1155 --disable-rpath) _rpath=no ;;
1157 --enable-fribidi) _fribidi=yes ;;
1158 --disable-fribidi) _fribidi=no ;;
1160 --enable-enca) _enca=yes ;;
1161 --disable-enca) _enca=no ;;
1163 --enable-inet6) _inet6=yes ;;
1164 --disable-inet6) _inet6=no ;;
1166 --enable-gethostbyname2) _gethostbyname2=yes ;;
1167 --disable-gethostbyname2) _gethostbyname2=no ;;
1169 --enable-dga1) _dga1=yes ;;
1170 --disable-dga1) _dga1=no ;;
1171 --enable-dga2) _dga2=yes ;;
1172 --disable-dga2) _dga2=no ;;
1174 --enable-menu) _menu=yes ;;
1175 --disable-menu) _menu=no ;;
1177 --enable-qtx) _qtx=yes ;;
1178 --disable-qtx) _qtx=no ;;
1180 --enable-coreaudio) _coreaudio=yes ;;
1181 --disable-coreaudio) _coreaudio=no ;;
1182 --enable-corevideo) _corevideo=yes ;;
1183 --disable-corevideo) _corevideo=no ;;
1184 --enable-quartz) _quartz=yes ;;
1185 --disable-quartz) _quartz=no ;;
1186 --enable-macosx-finder) _macosx_finder=yes ;;
1187 --disable-macosx-finder) _macosx_finder=no ;;
1188 --enable-macosx-bundle) _macosx_bundle=yes ;;
1189 --disable-macosx-bundle) _macosx_bundle=no ;;
1191 --enable-maemo) _maemo=yes ;;
1192 --disable-maemo) _maemo=no ;;
1194 --enable-sortsub) _sortsub=yes ;;
1195 --disable-sortsub) _sortsub=no ;;
1197 --enable-crash-debug) _crash_debug=yes ;;
1198 --disable-crash-debug) _crash_debug=no ;;
1199 --enable-sighandler) _sighandler=yes ;;
1200 --disable-sighandler) _sighandler=no ;;
1201 --enable-win32dll) _win32dll=yes ;;
1202 --disable-win32dll) _win32dll=no ;;
1204 --enable-sse) _sse=yes ;;
1205 --disable-sse) _sse=no ;;
1206 --enable-sse2) _sse2=yes ;;
1207 --disable-sse2) _sse2=no ;;
1208 --enable-ssse3) _ssse3=yes ;;
1209 --disable-ssse3) _ssse3=no ;;
1210 --enable-mmxext) _mmxext=yes ;;
1211 --disable-mmxext) _mmxext=no ;;
1212 --enable-3dnow) _3dnow=yes ;;
1213 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1214 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1215 --disable-3dnowext) _3dnowext=no ;;
1216 --enable-cmov) _cmov=yes ;;
1217 --disable-cmov) _cmov=no ;;
1218 --enable-fast-cmov) _fast_cmov=yes ;;
1219 --disable-fast-cmov) _fast_cmov=no ;;
1220 --enable-fast-clz) _fast_clz=yes ;;
1221 --disable-fast-clz) _fast_clz=no ;;
1222 --enable-altivec) _altivec=yes ;;
1223 --disable-altivec) _altivec=no ;;
1224 --enable-armv5te) _armv5te=yes ;;
1225 --disable-armv5te) _armv5te=no ;;
1226 --enable-armv6) _armv6=yes ;;
1227 --disable-armv6) _armv6=no ;;
1228 --enable-armv6t2) _armv6t2=yes ;;
1229 --disable-armv6t2) _armv6t2=no ;;
1230 --enable-armvfp) _armvfp=yes ;;
1231 --disable-armvfp) _armvfp=no ;;
1232 --enable-neon) neon=yes ;;
1233 --disable-neon) neon=no ;;
1234 --enable-iwmmxt) _iwmmxt=yes ;;
1235 --disable-iwmmxt) _iwmmxt=no ;;
1236 --enable-mmx) _mmx=yes ;;
1237 --disable-mmx) # 3Dnow! and MMX2 require MMX
1238 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1241 echo "Unknown parameter: $ac_option"
1242 exit 1
1245 esac
1246 done
1248 if test "$_gui" = yes ; then
1249 die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
1250 (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
1253 # Atmos: moved this here, to be correct, if --prefix is specified
1254 test -z "$_bindir" && _bindir="$_prefix/bin"
1255 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1256 test -z "$_mandir" && _mandir="$_prefix/share/man"
1257 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1258 test -z "$_libdir" && _libdir="$_prefix/lib"
1259 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1261 # Determine our OS name and CPU architecture
1262 if test -z "$_target" ; then
1263 # OS name
1264 system_name=$(uname -s 2>&1)
1265 case "$system_name" in
1266 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1268 Haiku)
1269 system_name=BeOS
1271 IRIX*)
1272 system_name=IRIX
1274 GNU/kFreeBSD)
1275 system_name=FreeBSD
1277 HP-UX*)
1278 system_name=HP-UX
1280 [cC][yY][gG][wW][iI][nN]*)
1281 system_name=CYGWIN
1283 MINGW32*)
1284 system_name=MINGW32
1286 OS/2*)
1287 system_name=OS/2
1290 system_name="$system_name-UNKNOWN"
1292 esac
1295 # host's CPU/instruction set
1296 host_arch=$(uname -p 2>&1)
1297 case "$host_arch" in
1298 i386|sparc|ppc|alpha|arm|mips|vax)
1300 powerpc) # Darwin returns 'powerpc'
1301 host_arch=ppc
1303 *) # uname -p on Linux returns 'unknown' for the processor type,
1304 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1306 # Maybe uname -m (machine hardware name) returns something we
1307 # recognize.
1309 # x86/x86pc is used by QNX
1310 case "$(uname -m 2>&1)" in
1311 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 ;;
1312 ia64) host_arch=ia64 ;;
1313 macppc|ppc) host_arch=ppc ;;
1314 ppc64) host_arch=ppc64 ;;
1315 alpha) host_arch=alpha ;;
1316 sparc) host_arch=sparc ;;
1317 sparc64) host_arch=sparc64 ;;
1318 parisc*|hppa*|9000*) host_arch=hppa ;;
1319 arm*|zaurus|cats) host_arch=arm ;;
1320 sh3|sh4|sh4a) host_arch=sh ;;
1321 s390) host_arch=s390 ;;
1322 s390x) host_arch=s390x ;;
1323 *mips*) host_arch=mips ;;
1324 vax) host_arch=vax ;;
1325 xtensa*) host_arch=xtensa ;;
1326 *) host_arch=UNKNOWN ;;
1327 esac
1329 esac
1330 else # if test -z "$_target"
1331 system_name=$(echo $_target | cut -d '-' -f 2)
1332 case "$(echo $system_name | tr A-Z a-z)" in
1333 linux) system_name=Linux ;;
1334 freebsd) system_name=FreeBSD ;;
1335 gnu/kfreebsd) system_name=FreeBSD ;;
1336 netbsd) system_name=NetBSD ;;
1337 bsd/os) system_name=BSD/OS ;;
1338 openbsd) system_name=OpenBSD ;;
1339 dragonfly) system_name=DragonFly ;;
1340 sunos) system_name=SunOS ;;
1341 qnx) system_name=QNX ;;
1342 morphos) system_name=MorphOS ;;
1343 amigaos) system_name=AmigaOS ;;
1344 mingw32*) system_name=MINGW32 ;;
1345 esac
1346 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1347 host_arch=$(echo $_target | cut -d '-' -f 1)
1348 if test $(echo $host_arch) != "x86_64" ; then
1349 host_arch=$(echo $host_arch | tr '_' '-')
1353 extra_cflags="-I. $extra_cflags"
1354 _timer=timer-linux.c
1355 _getch=getch2.c
1356 if freebsd ; then
1357 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1358 extra_cflags="$extra_cflags -I/usr/local/include"
1361 if netbsd || dragonfly ; then
1362 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1363 extra_cflags="$extra_cflags -I/usr/pkg/include"
1366 if darwin; then
1367 extra_cflags="-mdynamic-no-pic $extra_cflags"
1368 if test "$(basename $_cc)" != "clang" ; then
1369 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
1371 _timer=timer-darwin.c
1374 if aix ; then
1375 extra_ldflags="$extra_ldflags -lC"
1378 if irix ; then
1379 _ranlib='ar -r'
1380 elif linux ; then
1381 _ranlib='true'
1384 if win32 ; then
1385 _exesuf=".exe"
1386 extra_cflags="$extra_cflags -fno-common"
1387 # -lwinmm is always needed for osdep/timer-win2.c
1388 extra_ldflags="$extra_ldflags -lwinmm"
1389 _pe_executable=yes
1390 _timer=timer-win2.c
1391 _priority=yes
1392 def_dos_paths="#define HAVE_DOS_PATHS 1"
1393 def_priority="#define CONFIG_PRIORITY 1"
1396 if mingw32 ; then
1397 _getch=getch2-win.c
1398 _need_shmem=no
1401 if amigaos ; then
1402 _select=no
1403 _sighandler=no
1404 _stream_cache=no
1405 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1406 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1409 if qnx ; then
1410 extra_ldflags="$extra_ldflags -lph"
1413 if os2 ; then
1414 _exesuf=".exe"
1415 _getch=getch2-os2.c
1416 _need_shmem=no
1417 _priority=yes
1418 def_dos_paths="#define HAVE_DOS_PATHS 1"
1419 def_priority="#define CONFIG_PRIORITY 1"
1422 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1423 test "$tmpdir" && break
1424 done
1426 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1427 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1429 TMPLOG="config.log"
1430 TMPC="$mplayer_tmpdir/tmp.c"
1431 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1432 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1433 TMPH="$mplayer_tmpdir/tmp.h"
1434 TMPS="$mplayer_tmpdir/tmp.S"
1436 rm -f "$TMPLOG"
1437 echo configuration: $configuration > "$TMPLOG"
1438 echo >> "$TMPLOG"
1441 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1442 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1446 # Checking CC version...
1447 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1448 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1449 echocheck "$_cc version"
1450 cc_vendor=intel
1451 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1452 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1453 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1454 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1455 # TODO verify older icc/ecc compatibility
1456 case $cc_version in
1458 cc_version="v. ?.??, bad"
1459 cc_fail=yes
1461 10.1|11.0|11.1)
1462 cc_version="$cc_version, ok"
1465 cc_version="$cc_version, bad"
1466 cc_fail=yes
1468 esac
1469 echores "$cc_version"
1470 else
1471 for _cc in "$_cc" gcc cc ; do
1472 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1473 if test "$cc_name_tmp" = "gcc"; then
1474 cc_name=$cc_name_tmp
1475 echocheck "$_cc version"
1476 cc_vendor=gnu
1477 cc_version=$($_cc -dumpversion 2>&1)
1478 case $cc_version in
1479 2.96*)
1480 cc_fail=yes
1483 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1484 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1485 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1487 esac
1488 echores "$cc_version"
1489 break
1491 cc_name_tmp=$($_cc -v 2>&1 | head -n 1 | cut -d ' ' -f 1)
1492 if test "$cc_name_tmp" = "clang"; then
1493 echocheck "$_cc version"
1494 cc_vendor=clang
1495 cc_version=$($_cc -dumpversion 2>&1)
1496 res_comment="experimental support only"
1497 echores "clang $cc_version"
1498 break
1500 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1501 if test "$cc_name_tmp" = "Sun C"; then
1502 echocheck "$_cc version"
1503 cc_vendor=sun
1504 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1505 res_comment="experimental support only"
1506 echores "Sun C $cc_version"
1507 break
1509 done
1510 fi # icc
1511 test "$cc_fail" = yes && die "unsupported compiler version"
1513 if test -z "$_target" && x86 ; then
1514 cat > $TMPC << EOF
1515 int main(void) {
1516 int test[(int)sizeof(char *)-7];
1517 return 0;
1520 cc_check && host_arch=x86_64 || host_arch=i386
1523 echo "Detected operating system: $system_name"
1524 echo "Detected host architecture: $host_arch"
1526 echocheck "host cc"
1527 test "$_host_cc" || _host_cc=$_cc
1528 echores $_host_cc
1530 echocheck "cross compilation"
1531 if test $_cross_compile = auto ; then
1532 _cross_compile=yes
1533 cflag_check "" && "$TMPEXE" && _cross_compile=no
1535 echores $_cross_compile
1537 if test $_cross_compile = yes; then
1538 tmp_run() {
1539 return 0
1543 # ---
1545 # now that we know what compiler should be used for compilation, try to find
1546 # out which assembler is used by the $_cc compiler
1547 if test "$_as" = auto ; then
1548 _as=$($_cc -print-prog-name=as)
1549 test -z "$_as" && _as=as
1552 if test "$_nm" = auto ; then
1553 _nm=$($_cc -print-prog-name=nm)
1554 test -z "$_nm" && _nm=nm
1557 # XXX: this should be ok..
1558 _cpuinfo="echo"
1560 if test "$_runtime_cpudetection" = no ; then
1562 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1563 # FIXME: Remove the cygwin check once AMD CPUs are supported
1564 if test -r /proc/cpuinfo && ! cygwin; then
1565 # Linux with /proc mounted, extract CPU information from it
1566 _cpuinfo="cat /proc/cpuinfo"
1567 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1568 # FreeBSD with Linux emulation /proc mounted,
1569 # extract CPU information from it
1570 # Don't use it on x86 though, it never reports 3Dnow
1571 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1572 elif darwin && ! x86 ; then
1573 # use hostinfo on Darwin
1574 _cpuinfo="hostinfo"
1575 elif aix; then
1576 # use 'lsattr' on AIX
1577 _cpuinfo="lsattr -E -l proc0 -a type"
1578 elif x86; then
1579 # all other OSes try to extract CPU information from a small helper
1580 # program cpuinfo instead
1581 $_cc -o cpuinfo$_exesuf cpuinfo.c
1582 _cpuinfo="./cpuinfo$_exesuf"
1585 if x86 ; then
1586 # gather more CPU information
1587 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1588 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1589 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1590 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1591 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1593 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1595 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1596 -e s/xmm/sse/ -e s/kni/sse/)
1598 for ext in $pparam ; do
1599 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1600 done
1602 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1603 test $_sse = kernel_check && _mmxext=kernel_check
1605 echocheck "CPU vendor"
1606 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1608 echocheck "CPU type"
1609 echores "$pname"
1612 fi # test "$_runtime_cpudetection" = no
1614 if x86 && test "$_runtime_cpudetection" = no ; then
1615 extcheck() {
1616 if test "$1" = kernel_check ; then
1617 echocheck "kernel support of $2"
1618 cat > $TMPC <<EOF
1619 #include <stdlib.h>
1620 #include <signal.h>
1621 static void catch(int sig) { exit(1); }
1622 int main(void) {
1623 signal(SIGILL, catch);
1624 __asm__ volatile ("$3":::"memory"); return 0;
1628 if cc_check && tmp_run ; then
1629 eval _$2=yes
1630 echores "yes"
1631 _optimizing="$_optimizing $2"
1632 return 0
1633 else
1634 eval _$2=no
1635 echores "failed"
1636 echo "It seems that your kernel does not correctly support $2."
1637 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1638 return 1
1641 return 0
1644 extcheck $_mmx "mmx" "emms"
1645 extcheck $_mmxext "mmxext" "sfence"
1646 extcheck $_3dnow "3dnow" "femms"
1647 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1648 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1649 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1650 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1651 extcheck $_cmov "cmov" "cmovb %%eax, %%ebx"
1653 echocheck "mtrr support"
1654 if test "$_mtrr" = kernel_check ; then
1655 _mtrr="yes"
1656 _optimizing="$_optimizing mtrr"
1658 echores "$_mtrr"
1660 if test "$_gcc3_ext" != ""; then
1661 # if we had to disable sse/sse2 because the active kernel does not
1662 # support this instruction set extension, we also have to tell
1663 # gcc3 to not generate sse/sse2 instructions for normal C code
1664 cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1670 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1671 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1672 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1673 subarch_all='X86_32 X86_64 PPC64'
1674 case "$host_arch" in
1675 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1676 arch='x86'
1677 subarch='x86_32'
1678 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1679 iproc=486
1680 proc=i486
1683 if test "$_runtime_cpudetection" = no ; then
1684 case "$pvendor" in
1685 AuthenticAMD)
1686 case "$pfamily" in
1687 3) proc=i386 iproc=386 ;;
1688 4) proc=i486 iproc=486 ;;
1689 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1690 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1691 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1692 proc=k6-3
1693 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1694 proc=geode
1695 elif test "$pmodel" -ge 8; then
1696 proc=k6-2
1697 elif test "$pmodel" -ge 6; then
1698 proc=k6
1699 else
1700 proc=i586
1703 6) iproc=686
1704 # It's a bit difficult to determine the correct type of Family 6
1705 # AMD CPUs just from their signature. Instead, we check directly
1706 # whether it supports SSE.
1707 if test "$_sse" = yes; then
1708 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1709 proc=athlon-xp
1710 else
1711 # Again, gcc treats athlon and athlon-tbird similarly.
1712 proc=athlon
1715 15) iproc=686
1716 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1717 # caught and remedied in the optimization tests below.
1718 proc=k8
1721 *) proc=amdfam10 iproc=686
1722 test $_fast_clz = "auto" && _fast_clz=yes
1724 esac
1726 GenuineIntel)
1727 case "$pfamily" in
1728 3) proc=i386 iproc=386 ;;
1729 4) proc=i486 iproc=486 ;;
1730 5) iproc=586
1731 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1732 proc=pentium-mmx # 4 is desktop, 8 is mobile
1733 else
1734 proc=i586
1737 6) iproc=686
1738 if test "$pmodel" -ge 15; then
1739 proc=core2
1740 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1741 proc=pentium-m
1742 elif test "$pmodel" -ge 7; then
1743 proc=pentium3
1744 elif test "$pmodel" -ge 3; then
1745 proc=pentium2
1746 else
1747 proc=i686
1749 test $_fast_clz = "auto" && _fast_clz=yes
1751 15) iproc=686
1752 # A nocona in 32-bit mode has no more capabilities than a prescott.
1753 if test "$pmodel" -ge 3; then
1754 proc=prescott
1755 else
1756 proc=pentium4
1757 test $_fast_clz = "auto" && _fast_clz=yes
1759 test $_fast_cmov = "auto" && _fast_cmov=no
1761 *) proc=prescott iproc=686 ;;
1762 esac
1764 CentaurHauls)
1765 case "$pfamily" in
1766 5) iproc=586
1767 if test "$pmodel" -ge 8; then
1768 proc=winchip2
1769 elif test "$pmodel" -ge 4; then
1770 proc=winchip-c6
1771 else
1772 proc=i586
1775 6) iproc=686
1776 if test "$pmodel" -ge 9; then
1777 proc=c3-2
1778 else
1779 proc=c3
1780 iproc=586
1783 *) proc=i686 iproc=i686 ;;
1784 esac
1786 unknown)
1787 case "$pfamily" in
1788 3) proc=i386 iproc=386 ;;
1789 4) proc=i486 iproc=486 ;;
1790 *) proc=i586 iproc=586 ;;
1791 esac
1794 proc=i586 iproc=586 ;;
1795 esac
1796 test $_fast_clz = "auto" && _fast_clz=no
1797 fi # test "$_runtime_cpudetection" = no
1800 # check that gcc supports our CPU, if not, fall back to earlier ones
1801 # LGB: check -mcpu and -march swithing step by step with enabling
1802 # to fall back till 386.
1804 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1806 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1807 cpuopt=-mtune
1808 else
1809 cpuopt=-mcpu
1812 echocheck "GCC & CPU optimization abilities"
1813 if test "$_runtime_cpudetection" = no ; then
1814 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1815 cflag_check -march=native && proc=native
1817 if test "$proc" = "amdfam10"; then
1818 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1820 if test "$proc" = "k8"; then
1821 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1823 if test "$proc" = "athlon-xp"; then
1824 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1826 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1827 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1829 if test "$proc" = "k6" || test "$proc" = "c3"; then
1830 if ! cflag_check -march=$proc $cpuopt=$proc; then
1831 if cflag_check -march=i586 $cpuopt=i686; then
1832 proc=i586-i686
1833 else
1834 proc=i586
1838 if test "$proc" = "prescott" ; then
1839 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1841 if test "$proc" = "core2" ; then
1842 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1844 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
1845 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1847 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1848 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1850 if test "$proc" = "i586"; then
1851 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1853 if test "$proc" = "i486" ; then
1854 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1856 if test "$proc" = "i386" ; then
1857 cflag_check -march=$proc $cpuopt=$proc || proc=error
1859 if test "$proc" = "error" ; then
1860 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1861 _mcpu=""
1862 _march=""
1863 _optimizing=""
1864 elif test "$proc" = "i586-i686"; then
1865 _march="-march=i586"
1866 _mcpu="$cpuopt=i686"
1867 _optimizing="$proc"
1868 else
1869 _march="-march=$proc"
1870 _mcpu="$cpuopt=$proc"
1871 _optimizing="$proc"
1873 else # if test "$_runtime_cpudetection" = no
1874 _mcpu="$cpuopt=generic"
1875 # at least i486 required, for bswap instruction
1876 _march="-march=i486"
1877 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1878 cflag_check $_mcpu || _mcpu=""
1879 cflag_check $_march $_mcpu || _march=""
1882 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1883 ## autodetected mcpu/march parameters
1884 if test "$_target" ; then
1885 # TODO: it may be a good idea to check GCC and fall back in all cases
1886 if test "$host_arch" = "i586-i686"; then
1887 _march="-march=i586"
1888 _mcpu="$cpuopt=i686"
1889 else
1890 _march="-march=$host_arch"
1891 _mcpu="$cpuopt=$host_arch"
1894 proc="$host_arch"
1896 case "$proc" in
1897 i386) iproc=386 ;;
1898 i486) iproc=486 ;;
1899 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1900 i686|athlon*|pentium*) iproc=686 ;;
1901 *) iproc=586 ;;
1902 esac
1905 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1906 _fast_cmov="yes"
1907 else
1908 _fast_cmov="no"
1910 test $_fast_clz = "auto" && _fast_clz=yes
1912 echores "$proc"
1915 ia64)
1916 arch='ia64'
1917 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1918 iproc='ia64'
1921 x86_64|amd64)
1922 arch='x86'
1923 subarch='x86_64'
1924 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1925 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1926 iproc='x86_64'
1928 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1929 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1930 cpuopt=-mtune
1931 else
1932 cpuopt=-mcpu
1934 if test "$_runtime_cpudetection" = no ; then
1935 case "$pvendor" in
1936 AuthenticAMD)
1937 case "$pfamily" in
1938 15) proc=k8
1939 test $_fast_clz = "auto" && _fast_clz=no
1941 *) proc=amdfam10;;
1942 esac
1944 GenuineIntel)
1945 case "$pfamily" in
1946 6) proc=core2;;
1948 # 64-bit prescotts exist, but as far as GCC is concerned they
1949 # have the same capabilities as a nocona.
1950 proc=nocona
1951 test $_fast_cmov = "auto" && _fast_cmov=no
1952 test $_fast_clz = "auto" && _fast_clz=no
1954 esac
1957 proc=error;;
1958 esac
1959 fi # test "$_runtime_cpudetection" = no
1961 echocheck "GCC & CPU optimization abilities"
1962 # This is a stripped-down version of the i386 fallback.
1963 if test "$_runtime_cpudetection" = no ; then
1964 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1965 cflag_check -march=native && proc=native
1967 # --- AMD processors ---
1968 if test "$proc" = "amdfam10"; then
1969 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1971 if test "$proc" = "k8"; then
1972 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1974 # This will fail if gcc version < 3.3, which is ok because earlier
1975 # versions don't really support 64-bit on amd64.
1976 # Is this a valid assumption? -Corey
1977 if test "$proc" = "athlon-xp"; then
1978 cflag_check -march=$proc $cpuopt=$proc || proc=error
1980 # --- Intel processors ---
1981 if test "$proc" = "core2"; then
1982 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
1984 if test "$proc" = "x86-64"; then
1985 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
1987 if test "$proc" = "nocona"; then
1988 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1990 if test "$proc" = "pentium4"; then
1991 cflag_check -march=$proc $cpuopt=$proc || proc=error
1994 _march="-march=$proc"
1995 _mcpu="$cpuopt=$proc"
1996 if test "$proc" = "error" ; then
1997 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1998 _mcpu=""
1999 _march=""
2001 else # if test "$_runtime_cpudetection" = no
2002 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2003 _march="-march=x86-64"
2004 _mcpu="$cpuopt=generic"
2005 cflag_check $_mcpu || _mcpu="x86-64"
2006 cflag_check $_mcpu || _mcpu=""
2007 cflag_check $_march $_mcpu || _march=""
2010 _optimizing="$proc"
2011 test $_fast_cmov = "auto" && _fast_cmov=yes
2012 test $_fast_clz = "auto" && _fast_clz=yes
2014 echores "$proc"
2017 sparc|sparc64)
2018 arch='sparc'
2019 iproc='sparc'
2020 if test "$host_arch" = "sparc64" ; then
2021 _vis='yes'
2022 proc='ultrasparc'
2023 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2024 elif sunos ; then
2025 echocheck "CPU type"
2026 karch=$(uname -m)
2027 case "$(echo $karch)" in
2028 sun4) proc=v7 ;;
2029 sun4c) proc=v7 ;;
2030 sun4d) proc=v8 ;;
2031 sun4m) proc=v8 ;;
2032 sun4u) proc=ultrasparc _vis='yes' ;;
2033 sun4v) proc=v9 ;;
2034 *) proc=v8 ;;
2035 esac
2036 echores "$proc"
2037 else
2038 proc=v8
2040 _mcpu="-mcpu=$proc"
2041 _optimizing="$proc"
2044 arm*)
2045 arch='arm'
2046 iproc='arm'
2049 avr32)
2050 arch='avr32'
2051 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2052 iproc='avr32'
2053 test $_fast_clz = "auto" && _fast_clz=yes
2056 sh|sh4)
2057 arch='sh4'
2058 iproc='sh4'
2061 ppc|ppc64|powerpc|powerpc64)
2062 arch='ppc'
2063 def_dcbzl='#define HAVE_DCBZL 0'
2064 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2065 iproc='ppc'
2067 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2068 subarch='ppc64'
2069 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2071 echocheck "CPU type"
2072 case $system_name in
2073 Linux)
2074 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2075 if test -n "$($_cpuinfo | grep altivec)"; then
2076 test $_altivec = auto && _altivec=yes
2079 Darwin)
2080 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2081 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2082 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2083 test $_altivec = auto && _altivec=yes
2086 NetBSD)
2087 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2088 case $cc_version in
2089 2*|3.0*|3.1*|3.2*|3.3*)
2092 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2093 test $_altivec = auto && _altivec=yes
2096 esac
2098 AIX)
2099 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2101 esac
2102 if test "$_altivec" = yes; then
2103 echores "$proc altivec"
2104 else
2105 _altivec=no
2106 echores "$proc"
2109 echocheck "GCC & CPU optimization abilities"
2111 if test -n "$proc"; then
2112 case "$proc" in
2113 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2114 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2115 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2116 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2117 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2118 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2119 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2120 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2121 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2122 *) ;;
2123 esac
2124 # gcc 3.1(.1) and up supports 7400 and 7450
2125 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2126 case "$proc" in
2127 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2128 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2129 *) ;;
2130 esac
2132 # gcc 3.2 and up supports 970
2133 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2134 case "$proc" in
2135 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2136 def_dcbzl='#define HAVE_DCBZL 1' ;;
2137 *) ;;
2138 esac
2140 # gcc 3.3 and up supports POWER4
2141 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2142 case "$proc" in
2143 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2144 *) ;;
2145 esac
2147 # gcc 3.4 and up supports 440*
2148 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2149 case "$proc" in
2150 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2151 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2152 *) ;;
2153 esac
2155 # gcc 4.0 and up supports POWER5
2156 if test "$_cc_major" -ge "4"; then
2157 case "$proc" in
2158 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2159 *) ;;
2160 esac
2164 if test -n "$_mcpu"; then
2165 _optimizing=$(echo $_mcpu | cut -c 8-)
2166 echores "$_optimizing"
2167 else
2168 echores "none"
2171 test $_fast_clz = "auto" && _fast_clz=yes
2175 alpha*)
2176 arch='alpha'
2177 iproc='alpha'
2178 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2180 echocheck "CPU type"
2181 cat > $TMPC << EOF
2182 int main(void) {
2183 unsigned long ver, mask;
2184 __asm__ ("implver %0" : "=r" (ver));
2185 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2186 printf("%ld-%x\n", ver, ~mask);
2187 return 0;
2190 $_cc -o "$TMPEXE" "$TMPC"
2191 case $("$TMPEXE") in
2193 0-0) proc="ev4"; _mvi="0";;
2194 1-0) proc="ev5"; _mvi="0";;
2195 1-1) proc="ev56"; _mvi="0";;
2196 1-101) proc="pca56"; _mvi="1";;
2197 2-303) proc="ev6"; _mvi="1";;
2198 2-307) proc="ev67"; _mvi="1";;
2199 2-1307) proc="ev68"; _mvi="1";;
2200 esac
2201 echores "$proc"
2203 echocheck "GCC & CPU optimization abilities"
2204 if test "$proc" = "ev68" ; then
2205 cc_check -mcpu=$proc || proc=ev67
2207 if test "$proc" = "ev67" ; then
2208 cc_check -mcpu=$proc || proc=ev6
2210 _mcpu="-mcpu=$proc"
2211 echores "$proc"
2213 test $_fast_clz = "auto" && _fast_clz=yes
2215 _optimizing="$proc"
2218 mips*)
2219 arch='mips'
2220 iproc='mips'
2222 if irix ; then
2223 echocheck "CPU type"
2224 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2225 case "$(echo $proc)" in
2226 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2227 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2228 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2229 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2230 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2231 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2232 esac
2233 # gcc < 3.x does not support -mtune.
2234 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2235 _mcpu=''
2237 echores "$proc"
2240 test $_fast_clz = "auto" && _fast_clz=yes
2244 hppa)
2245 arch='pa_risc'
2246 iproc='PA-RISC'
2249 s390)
2250 arch='s390'
2251 iproc='390'
2254 s390x)
2255 arch='s390x'
2256 iproc='390x'
2259 vax)
2260 arch='vax'
2261 iproc='vax'
2264 xtensa)
2265 arch='xtensa'
2266 iproc='xtensa'
2269 generic)
2270 arch='generic'
2274 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2275 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2276 die "unsupported architecture $host_arch"
2278 esac # case "$host_arch" in
2280 if test "$_runtime_cpudetection" = yes ; then
2281 if x86 ; then
2282 test "$_cmov" != no && _cmov=yes
2283 x86_32 && _cmov=no
2284 test "$_mmx" != no && _mmx=yes
2285 test "$_3dnow" != no && _3dnow=yes
2286 test "$_3dnowext" != no && _3dnowext=yes
2287 test "$_mmxext" != no && _mmxext=yes
2288 test "$_sse" != no && _sse=yes
2289 test "$_sse2" != no && _sse2=yes
2290 test "$_ssse3" != no && _ssse3=yes
2291 test "$_mtrr" != no && _mtrr=yes
2293 if ppc; then
2294 _altivec=yes
2299 # endian testing
2300 echocheck "byte order"
2301 if test "$_big_endian" = auto ; then
2302 cat > $TMPC <<EOF
2303 short ascii_name[] = {
2304 'M' << 8 | 'P', 'l' << 8 | 'a', 'y' << 8 | 'e', 'r' << 8 | 'B',
2305 'i' << 8 | 'g', 'E' << 8 | 'n', 'd' << 8 | 'i', 'a' << 8 | 'n', 0 };
2306 int main(void) { return (long)ascii_name; }
2308 if cc_check ; then
2309 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2310 _big_endian=yes
2311 else
2312 _big_endian=no
2314 else
2315 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2318 if test "$_big_endian" = yes ; then
2319 _byte_order='big-endian'
2320 def_words_endian='#define WORDS_BIGENDIAN 1'
2321 def_bigendian='#define HAVE_BIGENDIAN 1'
2322 else
2323 _byte_order='little-endian'
2324 def_words_endian='#undef WORDS_BIGENDIAN'
2325 def_bigendian='#define HAVE_BIGENDIAN 0'
2327 echores "$_byte_order"
2330 echocheck "extern symbol prefix"
2331 cat > $TMPC << EOF
2332 int ff_extern;
2334 cc_check -c || die "Symbol mangling check failed."
2335 sym=$($_nm -P -g $TMPEXE)
2336 extern_prefix=${sym%%ff_extern*}
2337 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2338 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2339 echores $extern_prefix
2342 echocheck "assembler support of -pipe option"
2343 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2344 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2347 echocheck "compiler support of named assembler arguments"
2348 _named_asm_args=yes
2349 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2350 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2351 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2352 _named_asm_args=no
2353 def_named_asm_args="#undef NAMED_ASM_ARGS"
2355 echores $_named_asm_args
2358 if darwin && test "$cc_vendor" = "gnu" ; then
2359 echocheck "GCC support of -mstackrealign"
2360 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2361 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2362 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2363 # wrong code with this flag, but this can be worked around by adding
2364 # -fno-unit-at-a-time as described in the blog post at
2365 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2366 cat > $TMPC << EOF
2367 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2368 int main(void) { return foo3(1, 2, 3) == 3 ? 0 : 1; }
2370 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2371 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time \
2372 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2373 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2374 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2377 # Checking for CFLAGS
2378 _install_strip="-s"
2379 if test "$_profile" != "" || test "$_debug" != "" ; then
2380 CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
2381 WARNFLAGS="-W -Wall"
2382 _install_strip=
2383 elif test -z "$CFLAGS" ; then
2384 if test "$cc_vendor" = "intel" ; then
2385 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2386 WARNFLAGS="-wd167 -wd556 -wd144"
2387 elif test "$cc_vendor" = "sun" ; then
2388 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2389 elif test "$cc_vendor" = "clang"; then
2390 CFLAGS="-O2 $_march $_pipe"
2391 elif test "$cc_vendor" != "gnu" ; then
2392 CFLAGS="-O2 $_march $_mcpu $_pipe"
2393 else
2394 CFLAGS="-O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2395 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2396 extra_ldflags="$extra_ldflags -ffast-math"
2398 else
2399 warn_cflags=yes
2402 if test "$cc_vendor" = "gnu" ; then
2403 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2404 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2405 # that's the only variable specific to C now, and this option is not valid
2406 # for C++.
2407 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2408 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2409 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2410 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2411 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2412 else
2413 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2416 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2417 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2420 if test -n "$LDFLAGS" ; then
2421 extra_ldflags="$extra_ldflags $LDFLAGS"
2422 warn_cflags=yes
2423 elif test "$cc_vendor" = "intel" ; then
2424 extra_ldflags="$extra_ldflags -i-static"
2426 if test -n "$CPPFLAGS" ; then
2427 extra_cflags="$extra_cflags $CPPFLAGS"
2428 warn_cflags=yes
2433 if x86_32 ; then
2434 # Checking assembler (_as) compatibility...
2435 # Added workaround for older as that reads from stdin by default - atmos
2436 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2437 echocheck "assembler ($_as $as_version)"
2439 _pref_as_version='2.9.1'
2440 echo 'nop' > $TMPS
2441 if test "$_mmx" = yes ; then
2442 echo 'emms' >> $TMPS
2444 if test "$_3dnow" = yes ; then
2445 _pref_as_version='2.10.1'
2446 echo 'femms' >> $TMPS
2448 if test "$_3dnowext" = yes ; then
2449 _pref_as_version='2.10.1'
2450 echo 'pswapd %mm0, %mm0' >> $TMPS
2452 if test "$_mmxext" = yes ; then
2453 _pref_as_version='2.10.1'
2454 echo 'movntq %mm0, (%eax)' >> $TMPS
2456 if test "$_sse" = yes ; then
2457 _pref_as_version='2.10.1'
2458 echo 'xorps %xmm0, %xmm0' >> $TMPS
2460 #if test "$_sse2" = yes ; then
2461 # _pref_as_version='2.11'
2462 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2464 if test "$_cmov" = yes ; then
2465 _pref_as_version='2.10.1'
2466 echo 'cmovb %eax, %ebx' >> $TMPS
2468 if test "$_ssse3" = yes ; then
2469 _pref_as_version='2.16.92'
2470 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2472 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2474 if test "$as_verc_fail" != yes ; then
2475 echores "ok"
2476 else
2477 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2478 echores "failed"
2479 die "obsolete binutils version"
2482 fi #if x86_32
2485 echocheck "PIC"
2486 pic=no
2487 cat > $TMPC << EOF
2488 int main(void) {
2489 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2490 #error PIC not enabled
2491 #endif
2492 return 0;
2495 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2496 echores $pic
2499 if x86 ; then
2501 echocheck ".align is a power of two"
2502 if test "$_asmalign_pot" = auto ; then
2503 _asmalign_pot=no
2504 inline_asm_check '".align 3"' && _asmalign_pot=yes
2506 if test "$_asmalign_pot" = "yes" ; then
2507 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2508 else
2509 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2511 echores $_asmalign_pot
2514 echocheck "10 assembler operands"
2515 ten_operands=no
2516 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2517 cat > $TMPC << EOF
2518 int main(void) {
2519 int x=0;
2520 __asm__ volatile(
2522 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2524 return 0;
2527 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2528 echores $ten_operands
2530 echocheck "ebx availability"
2531 ebx_available=no
2532 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2533 cat > $TMPC << EOF
2534 int main(void) {
2535 int x;
2536 __asm__ volatile(
2537 "xor %0, %0"
2538 :"=b"(x)
2539 // just adding ebx to clobber list seems unreliable with some
2540 // compilers, e.g. Haiku's gcc 2.95
2542 // and the above check does not work for OSX 64 bit...
2543 __asm__ volatile("":::"%ebx");
2544 return 0;
2547 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2548 echores $ebx_available
2551 echocheck "yasm"
2552 if test -z "$YASMFLAGS" ; then
2553 if darwin ; then
2554 x86_64 && objformat="macho64" || objformat="macho"
2555 elif win32 ; then
2556 objformat="win32"
2557 else
2558 objformat="elf"
2560 # currently tested for Linux x86, x86_64
2561 YASMFLAGS="-f $objformat"
2562 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2563 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2564 case "$objformat" in
2565 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2566 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2567 esac
2568 else
2569 warn_cflags=yes
2572 echo "pabsw xmm0, xmm0" > $TMPS
2573 yasm_check || _yasm=""
2574 if test $_yasm ; then
2575 def_yasm='#define HAVE_YASM 1'
2576 have_yasm="yes"
2577 echores "$_yasm"
2578 else
2579 def_yasm='#define HAVE_YASM 0'
2580 have_yasm="no"
2581 echores "no"
2584 echocheck "bswap"
2585 def_bswap='#define HAVE_BSWAP 0'
2586 echo 'bswap %eax' > $TMPS
2587 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2588 echores "$bswap"
2589 fi #if x86
2592 #FIXME: This should happen before the check for CFLAGS..
2593 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2594 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2596 # check if AltiVec is supported by the compiler, and how to enable it
2597 echocheck "GCC AltiVec flags"
2598 if $(cflag_check -maltivec -mabi=altivec) ; then
2599 _altivec_gcc_flags="-maltivec -mabi=altivec"
2600 # check if <altivec.h> should be included
2601 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2602 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2603 inc_altivec_h='#include <altivec.h>'
2604 else
2605 if $(cflag_check -faltivec) ; then
2606 _altivec_gcc_flags="-faltivec"
2607 else
2608 _altivec=no
2609 _altivec_gcc_flags="none, AltiVec disabled"
2613 echores "$_altivec_gcc_flags"
2615 # check if the compiler supports braces for vector declarations
2616 cat > $TMPC << EOF
2617 $inc_altivec_h
2618 int main(void) { (vector int) {1}; return 0; }
2620 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2622 # Disable runtime cpudetection if we cannot generate AltiVec code or
2623 # AltiVec is disabled by the user.
2624 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2625 && _runtime_cpudetection=no
2627 # Show that we are optimizing for AltiVec (if enabled and supported).
2628 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2629 && _optimizing="$_optimizing altivec"
2631 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2632 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2635 if ppc ; then
2636 def_xform_asm='#define HAVE_XFORM_ASM 0'
2637 xform_asm=no
2638 echocheck "XFORM ASM support"
2639 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2640 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2641 echores "$xform_asm"
2644 if arm ; then
2645 echocheck "ARM pld instruction"
2646 pld=no
2647 inline_asm_check '"pld [r0]"' && pld=yes
2648 echores "$pld"
2650 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2651 if test $_armv5te = "auto" ; then
2652 _armv5te=no
2653 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2655 echores "$_armv5te"
2657 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2659 echocheck "ARMv6 (SIMD instructions)"
2660 if test $_armv6 = "auto" ; then
2661 _armv6=no
2662 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2664 echores "$_armv6"
2666 echocheck "ARMv6t2 (SIMD instructions)"
2667 if test $_armv6t2 = "auto" ; then
2668 _armv6t2=no
2669 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2671 echores "$_armv6"
2673 echocheck "ARM VFP"
2674 if test $_armvfp = "auto" ; then
2675 _armvfp=no
2676 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2678 echores "$_armvfp"
2680 echocheck "ARM NEON"
2681 if test $neon = "auto" ; then
2682 neon=no
2683 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2685 echores "$neon"
2687 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2688 if test $_iwmmxt = "auto" ; then
2689 _iwmmxt=no
2690 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2692 echores "$_iwmmxt"
2695 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'
2696 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2697 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2698 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2699 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2700 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2701 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2702 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2703 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2704 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2705 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2706 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2707 test "$pld" = yes && cpuexts="PLD $cpuexts"
2708 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2709 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2710 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2711 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2712 test "$neon" = yes && cpuexts="NEON $cpuexts"
2713 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2714 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2715 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2717 # Checking kernel version...
2718 if x86_32 && linux ; then
2719 _k_verc_problem=no
2720 kernel_version=$(uname -r 2>&1)
2721 echocheck "$system_name kernel version"
2722 case "$kernel_version" in
2723 '') kernel_version="?.??"; _k_verc_fail=yes;;
2724 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2725 _k_verc_problem=yes;;
2726 esac
2727 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2728 _k_verc_fail=yes
2730 if test "$_k_verc_fail" ; then
2731 echores "$kernel_version, fail"
2732 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2733 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2734 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2735 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2736 echo "2.2.x you must upgrade it to get SSE support!"
2737 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2738 else
2739 echores "$kernel_version, ok"
2743 ######################
2744 # MAIN TESTS GO HERE #
2745 ######################
2748 echocheck "-lposix"
2749 if cflag_check -lposix ; then
2750 extra_ldflags="$extra_ldflags -lposix"
2751 echores "yes"
2752 else
2753 echores "no"
2756 echocheck "-lm"
2757 if cflag_check -lm ; then
2758 _ld_lm="-lm"
2759 echores "yes"
2760 else
2761 _ld_lm=""
2762 echores "no"
2766 echocheck "langinfo"
2767 if test "$_langinfo" = auto ; then
2768 _langinfo=no
2769 statement_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2771 if test "$_langinfo" = yes ; then
2772 def_langinfo='#define HAVE_LANGINFO 1'
2773 else
2774 def_langinfo='#undef HAVE_LANGINFO'
2776 echores "$_langinfo"
2779 echocheck "translation support"
2780 if test "$_translation" = yes; then
2781 def_translation="#define CONFIG_TRANSLATION 1"
2782 else
2783 def_translation="#undef CONFIG_TRANSLATION"
2785 echores "$_translation"
2787 echocheck "language"
2788 # Set preferred languages, "all" uses English as main language.
2789 test -z "$language" && language=$LINGUAS
2790 test -z "$language_doc" && language_doc=$language
2791 test -z "$language_man" && language_man=$language
2792 test -z "$language_msg" && language_msg="all"
2793 language_doc=$(echo $language_doc | tr , " ")
2794 language_man=$(echo $language_man | tr , " ")
2795 language_msg=$(echo $language_msg | tr , " ")
2797 test "$language_doc" = "all" && language_doc=$doc_lang_all
2798 test "$language_man" = "all" && language_man=$man_lang_all
2799 test "$language_msg" = "all" && language_msg=$msg_lang_all
2801 if test "$_translation" != yes ; then
2802 language_msg=""
2805 # Prune non-existing translations from language lists.
2806 # Set message translation to the first available language.
2807 # Fall back on English.
2808 for lang in $language_doc ; do
2809 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2810 done
2811 language_doc=$tmp_language_doc
2812 test -z "$language_doc" && language_doc=en
2814 for lang in $language_man ; do
2815 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2816 done
2817 language_man=$tmp_language_man
2818 test -z "$language_man" && language_man=en
2820 for lang in $language_msg ; do
2821 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2822 done
2823 language_msg=$tmp_language_msg
2825 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2828 echocheck "enable sighandler"
2829 if test "$_sighandler" = yes ; then
2830 def_sighandler='#define CONFIG_SIGHANDLER 1'
2831 else
2832 def_sighandler='#undef CONFIG_SIGHANDLER'
2834 echores "$_sighandler"
2836 echocheck "runtime cpudetection"
2837 if test "$_runtime_cpudetection" = yes ; then
2838 _optimizing="Runtime CPU-Detection enabled"
2839 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2840 else
2841 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2843 echores "$_runtime_cpudetection"
2846 echocheck "restrict keyword"
2847 for restrict_keyword in restrict __restrict __restrict__ ; do
2848 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2849 if cc_check; then
2850 def_restrict_keyword=$restrict_keyword
2851 break;
2853 done
2854 if [ -n "$def_restrict_keyword" ]; then
2855 echores "$def_restrict_keyword"
2856 else
2857 echores "none"
2859 # Avoid infinite recursion loop ("#define restrict restrict")
2860 if [ "$def_restrict_keyword" != "restrict" ]; then
2861 def_restrict_keyword="#define restrict $def_restrict_keyword"
2862 else
2863 def_restrict_keyword=""
2867 echocheck "__builtin_expect"
2868 # GCC branch prediction hint
2869 cat > $TMPC << EOF
2870 static int foo(int a) {
2871 a = __builtin_expect(a, 10);
2872 return a == 10 ? 0 : 1;
2874 int main(void) { return foo(10) && foo(0); }
2876 _builtin_expect=no
2877 cc_check && _builtin_expect=yes
2878 if test "$_builtin_expect" = yes ; then
2879 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2880 else
2881 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2883 echores "$_builtin_expect"
2886 echocheck "kstat"
2887 _kstat=no
2888 statement_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2889 if test "$_kstat" = yes ; then
2890 def_kstat="#define HAVE_LIBKSTAT 1"
2891 extra_ldflags="$extra_ldflags -lkstat"
2892 else
2893 def_kstat="#undef HAVE_LIBKSTAT"
2895 echores "$_kstat"
2898 echocheck "posix4"
2899 # required for nanosleep on some systems
2900 _posix4=no
2901 statement_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2902 if test "$_posix4" = yes ; then
2903 extra_ldflags="$extra_ldflags -lposix4"
2905 echores "$_posix4"
2907 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2908 echocheck $func
2909 eval _$func=no
2910 statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2911 if eval test "x\$_$func" = "xyes"; then
2912 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2913 echores yes
2914 else
2915 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2916 echores no
2918 done
2921 echocheck "mkstemp"
2922 cat > $TMPC << EOF
2923 #define _XOPEN_SOURCE 500
2924 #include <stdlib.h>
2925 int main(void) { mkstemp(""); return 0; }
2927 _mkstemp=no
2928 cc_check && _mkstemp=yes
2929 if test "$_mkstemp" = yes ; then
2930 def_mkstemp='#define HAVE_MKSTEMP 1'
2931 else
2932 def_mkstemp='#define HAVE_MKSTEMP 0'
2934 echores "$_mkstemp"
2937 echocheck "nanosleep"
2938 _nanosleep=no
2939 statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2940 if test "$_nanosleep" = yes ; then
2941 def_nanosleep='#define HAVE_NANOSLEEP 1'
2942 else
2943 def_nanosleep='#undef HAVE_NANOSLEEP'
2945 echores "$_nanosleep"
2948 echocheck "socklib"
2949 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2950 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2951 cat > $TMPC << EOF
2952 #include <netdb.h>
2953 #include <sys/socket.h>
2954 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2956 _socklib=no
2957 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2958 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2959 done
2960 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2961 if test $_winsock2_h = auto ; then
2962 _winsock2_h=no
2963 statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2965 test "$_ld_sock" && res_comment="using $_ld_sock"
2966 echores "$_socklib"
2969 if test $_winsock2_h = yes ; then
2970 _ld_sock="-lws2_32"
2971 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2972 else
2973 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2977 echocheck "arpa/inet.h"
2978 arpa_inet_h=no
2979 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
2980 header_check arpa/inet.h && arpa_inet_h=yes &&
2981 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
2982 echores "$arpa_inet_h"
2985 echocheck "inet_pton()"
2986 def_inet_pton='#define HAVE_INET_PTON 0'
2987 inet_pton=no
2988 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2989 statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2990 done
2991 if test $inet_pton = yes ; then
2992 test "$_ld_tmp" && res_comment="using $_ld_tmp"
2993 def_inet_pton='#define HAVE_INET_PTON 1'
2995 echores "$inet_pton"
2998 echocheck "inet_aton()"
2999 def_inet_aton='#define HAVE_INET_ATON 0'
3000 inet_aton=no
3001 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3002 statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
3003 done
3004 if test $inet_aton = yes ; then
3005 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3006 def_inet_aton='#define HAVE_INET_ATON 1'
3008 echores "$inet_aton"
3011 echocheck "socklen_t"
3012 _socklen_t=no
3013 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3014 statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
3015 done
3016 if test "$_socklen_t" = yes ; then
3017 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3018 else
3019 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3021 echores "$_socklen_t"
3024 echocheck "closesocket()"
3025 _closesocket=no
3026 statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
3027 if test "$_closesocket" = yes ; then
3028 def_closesocket='#define HAVE_CLOSESOCKET 1'
3029 else
3030 def_closesocket='#define HAVE_CLOSESOCKET 0'
3032 echores "$_closesocket"
3035 echocheck "networking"
3036 test $_winsock2_h = no && test $inet_pton = no &&
3037 test $inet_aton = no && networking=no
3038 if test "$networking" = yes ; then
3039 def_network='#define CONFIG_NETWORK 1'
3040 def_networking='#define CONFIG_NETWORKING 1'
3041 extra_ldflags="$extra_ldflags $_ld_sock"
3042 inputmodules="networking $inputmodules"
3043 else
3044 noinputmodules="networking $noinputmodules"
3045 def_network='#define CONFIG_NETWORK 0'
3046 def_networking='#undef CONFIG_NETWORKING'
3048 echores "$networking"
3051 echocheck "inet6"
3052 if test "$_inet6" = auto ; then
3053 cat > $TMPC << EOF
3054 #include <sys/types.h>
3055 #if !defined(_WIN32) || defined(__CYGWIN__)
3056 #include <sys/socket.h>
3057 #include <netinet/in.h>
3058 #else
3059 #include <ws2tcpip.h>
3060 #endif
3061 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3063 _inet6=no
3064 if cc_check $_ld_sock ; then
3065 _inet6=yes
3068 if test "$_inet6" = yes ; then
3069 def_inet6='#define HAVE_AF_INET6 1'
3070 else
3071 def_inet6='#undef HAVE_AF_INET6'
3073 echores "$_inet6"
3076 echocheck "gethostbyname2"
3077 if test "$_gethostbyname2" = auto ; then
3078 cat > $TMPC << EOF
3079 #include <sys/types.h>
3080 #include <sys/socket.h>
3081 #include <netdb.h>
3082 int main(void) { gethostbyname2("", AF_INET); return 0; }
3084 _gethostbyname2=no
3085 if cc_check ; then
3086 _gethostbyname2=yes
3089 if test "$_gethostbyname2" = yes ; then
3090 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3091 else
3092 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3094 echores "$_gethostbyname2"
3097 echocheck "inttypes.h (required)"
3098 _inttypes=no
3099 header_check inttypes.h && _inttypes=yes
3100 echores "$_inttypes"
3102 if test "$_inttypes" = no ; then
3103 echocheck "sys/bitypes.h (inttypes.h predecessor)"
3104 header_check sys/bitypes.h && _inttypes=yes
3105 if test "$_inttypes" = yes ; then
3106 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."
3107 else
3108 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3113 echocheck "int_fastXY_t in inttypes.h"
3114 cat > $TMPC << EOF
3115 #include <inttypes.h>
3116 int main(void) { volatile int_fast16_t v = 0; return v; }
3118 _fast_inttypes=no
3119 cc_check && _fast_inttypes=yes
3120 if test "$_fast_inttypes" = no ; then
3121 def_fast_inttypes='
3122 typedef signed char int_fast8_t;
3123 typedef signed int int_fast16_t;
3124 typedef signed int int_fast32_t;
3125 typedef signed long long int_fast64_t;
3126 typedef unsigned char uint_fast8_t;
3127 typedef unsigned int uint_fast16_t;
3128 typedef unsigned int uint_fast32_t;
3129 typedef unsigned long long uint_fast64_t;'
3131 echores "$_fast_inttypes"
3134 echocheck "malloc.h"
3135 _malloc=no
3136 header_check malloc.h && _malloc=yes
3137 if test "$_malloc" = yes ; then
3138 def_malloc_h='#define HAVE_MALLOC_H 1'
3139 else
3140 def_malloc_h='#define HAVE_MALLOC_H 0'
3142 echores "$_malloc"
3145 echocheck "memalign()"
3146 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3147 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3148 _memalign=no
3149 statement_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3150 if test "$_memalign" = yes ; then
3151 def_memalign='#define HAVE_MEMALIGN 1'
3152 else
3153 def_memalign='#define HAVE_MEMALIGN 0'
3154 def_map_memalign='#define memalign(a, b) malloc(b)'
3155 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3157 echores "$_memalign"
3160 echocheck "posix_memalign()"
3161 posix_memalign=no
3162 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3163 cat > $TMPC << EOF
3164 #define _XOPEN_SOURCE 600
3165 #include <stdlib.h>
3166 int main(void) { posix_memalign(NULL, 0, 0); }
3168 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3169 echores "$posix_memalign"
3172 echocheck "alloca.h"
3173 _alloca=no
3174 statement_check alloca.h 'alloca(0)' && _alloca=yes
3175 if cc_check ; then
3176 def_alloca_h='#define HAVE_ALLOCA_H 1'
3177 else
3178 def_alloca_h='#undef HAVE_ALLOCA_H'
3180 echores "$_alloca"
3183 echocheck "fastmemcpy"
3184 if test "$_fastmemcpy" = yes ; then
3185 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3186 else
3187 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3189 echores "$_fastmemcpy"
3192 echocheck "mman.h"
3193 _mman=no
3194 statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
3195 if test "$_mman" = yes ; then
3196 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3197 else
3198 def_mman_h='#undef HAVE_SYS_MMAN_H'
3199 os2 && _need_mmap=yes
3201 echores "$_mman"
3203 _mman_has_map_failed=no
3204 statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
3205 if test "$_mman_has_map_failed" = yes ; then
3206 def_mman_has_map_failed=''
3207 else
3208 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3211 echocheck "dynamic loader"
3212 _dl=no
3213 for _ld_tmp in "" "-ldl"; do
3214 statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3215 done
3216 if test "$_dl" = yes ; then
3217 def_dl='#define HAVE_LIBDL 1'
3218 else
3219 def_dl='#undef HAVE_LIBDL'
3221 echores "$_dl"
3224 echocheck "dynamic a/v plugins support"
3225 if test "$_dl" = no ; then
3226 _dynamic_plugins=no
3228 if test "$_dynamic_plugins" = yes ; then
3229 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3230 else
3231 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3233 echores "$_dynamic_plugins"
3236 def_threads='#define HAVE_THREADS 0'
3238 echocheck "pthread"
3239 if linux ; then
3240 THREAD_CFLAGS=-D_REENTRANT
3241 elif freebsd || netbsd || openbsd || bsdos ; then
3242 THREAD_CFLAGS=-D_THREAD_SAFE
3244 if test "$_pthreads" = auto ; then
3245 cat > $TMPC << EOF
3246 #include <pthread.h>
3247 static void *func(void *arg) { return arg; }
3248 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3250 _pthreads=no
3251 if ! hpux ; then
3252 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3253 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3254 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3255 done
3258 if test "$_pthreads" = yes ; then
3259 test $_ld_pthread && res_comment="using $_ld_pthread"
3260 def_pthreads='#define HAVE_PTHREADS 1'
3261 def_threads='#define HAVE_THREADS 1'
3262 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3263 else
3264 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3265 def_pthreads='#undef HAVE_PTHREADS'
3266 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3267 mingw32 || _win32dll=no
3269 echores "$_pthreads"
3271 if cygwin ; then
3272 if test "$_pthreads" = yes ; then
3273 def_pthread_cache="#define PTHREAD_CACHE 1"
3274 else
3275 _stream_cache=no
3276 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3280 echocheck "w32threads"
3281 if test "$_pthreads" = yes ; then
3282 res_comment="using pthread instead"
3283 _w32threads=no
3285 if test "$_w32threads" = auto ; then
3286 _w32threads=no
3287 mingw32 && _w32threads=yes
3289 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3290 echores "$_w32threads"
3292 echocheck "rpath"
3293 if test "$_rpath" = yes ; then
3294 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3295 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3296 done
3297 extra_ldflags=$tmp
3299 echores "$_rpath"
3301 echocheck "iconv"
3302 if test "$_iconv" = auto ; then
3303 cat > $TMPC << EOF
3304 #include <stdio.h>
3305 #include <unistd.h>
3306 #include <iconv.h>
3307 #define INBUFSIZE 1024
3308 #define OUTBUFSIZE 4096
3310 char inbuffer[INBUFSIZE];
3311 char outbuffer[OUTBUFSIZE];
3313 int main(void) {
3314 size_t numread;
3315 iconv_t icdsc;
3316 char *tocode="UTF-8";
3317 char *fromcode="cp1250";
3318 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3319 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3320 char *iptr=inbuffer;
3321 char *optr=outbuffer;
3322 size_t inleft=numread;
3323 size_t outleft=OUTBUFSIZE;
3324 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3325 != (size_t)(-1)) {
3326 write(1, outbuffer, OUTBUFSIZE - outleft);
3329 if (iconv_close(icdsc) == -1)
3332 return 0;
3335 _iconv=no
3336 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3337 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3338 _iconv=yes && break
3339 done
3341 if test "$_iconv" = yes ; then
3342 def_iconv='#define CONFIG_ICONV 1'
3343 else
3344 def_iconv='#undef CONFIG_ICONV'
3346 echores "$_iconv"
3349 echocheck "soundcard.h"
3350 _soundcard_h=no
3351 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3352 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3353 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3354 header_check $_soundcard_header && _soundcard_h=yes &&
3355 res_comment="$_soundcard_header" && break
3356 done
3358 if test "$_soundcard_h" = yes ; then
3359 if test $_soundcard_header = "sys/soundcard.h"; then
3360 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3361 else
3362 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3365 echores "$_soundcard_h"
3368 echocheck "sys/dvdio.h"
3369 _dvdio=no
3370 # FreeBSD 8.1 has broken dvdio.h
3371 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3372 if test "$_dvdio" = yes ; then
3373 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3374 else
3375 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3377 echores "$_dvdio"
3380 echocheck "sys/cdio.h"
3381 _cdio=no
3382 # at least OpenSolaris has a broken cdio.h
3383 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3384 if test "$_cdio" = yes ; then
3385 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3386 else
3387 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3389 echores "$_cdio"
3392 echocheck "linux/cdrom.h"
3393 _cdrom=no
3394 header_check linux/cdrom.h && _cdrom=yes
3395 if test "$_cdrom" = yes ; then
3396 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3397 else
3398 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3400 echores "$_cdrom"
3403 echocheck "dvd.h"
3404 _dvd=no
3405 header_check dvd.h && _dvd=yes
3406 if test "$_dvd" = yes ; then
3407 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3408 else
3409 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3411 echores "$_dvd"
3414 if bsdos; then
3415 echocheck "BSDI dvd.h"
3416 _bsdi_dvd=no
3417 header_check dvd.h && _bsdi_dvd=yes
3418 if test "$_bsdi_dvd" = yes ; then
3419 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3420 else
3421 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3423 echores "$_bsdi_dvd"
3424 fi #if bsdos
3427 if hpux; then
3428 # also used by AIX, but AIX does not support VCD and/or libdvdread
3429 echocheck "HP-UX SCSI header"
3430 _hpux_scsi_h=no
3431 header_check sys/scsi.h && _hpux_scsi_h=yes
3432 if test "$_hpux_scsi_h" = yes ; then
3433 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3434 else
3435 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3437 echores "$_hpux_scsi_h"
3438 fi #if hpux
3441 if sunos; then
3442 echocheck "userspace SCSI headers (Solaris)"
3443 _sol_scsi_h=no
3444 header_check sys/scsi/scsi_types.h &&
3445 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3446 _sol_scsi_h=yes
3447 if test "$_sol_scsi_h" = yes ; then
3448 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3449 else
3450 def_sol_scsi_h='#undef SOLARIS_USCSI'
3452 echores "$_sol_scsi_h"
3453 fi #if sunos
3456 echocheck "termcap"
3457 if test "$_termcap" = auto ; then
3458 _termcap=no
3459 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3460 statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
3461 extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
3462 done
3464 if test "$_termcap" = yes ; then
3465 def_termcap='#define HAVE_TERMCAP 1'
3466 test $_ld_tmp && res_comment="using $_ld_tmp"
3467 else
3468 def_termcap='#undef HAVE_TERMCAP'
3470 echores "$_termcap"
3473 echocheck "termios"
3474 def_termios='#undef HAVE_TERMIOS'
3475 def_termios_h='#undef HAVE_TERMIOS_H'
3476 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3477 if test "$_termios" = auto ; then
3478 _termios=no
3479 for _termios_header in "termios.h" "sys/termios.h"; do
3480 header_check $_termios_header && _termios=yes &&
3481 res_comment="using $_termios_header" && break
3482 done
3485 if test "$_termios" = yes ; then
3486 def_termios='#define HAVE_TERMIOS 1'
3487 if test "$_termios_header" = "termios.h" ; then
3488 def_termios_h='#define HAVE_TERMIOS_H 1'
3489 else
3490 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3493 echores "$_termios"
3496 echocheck "shm"
3497 if test "$_shm" = auto ; then
3498 cat > $TMPC << EOF
3499 #include <sys/shm.h>
3500 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3502 _shm=no
3503 cc_check && _shm=yes
3505 if test "$_shm" = yes ; then
3506 def_shm='#define HAVE_SHM 1'
3507 else
3508 def_shm='#undef HAVE_SHM'
3510 echores "$_shm"
3513 echocheck "strsep()"
3514 cat > $TMPC << EOF
3515 #include <string.h>
3516 int main(void) { char *s = "Hello, world!"; strsep(&s, ","); return 0; }
3518 _strsep=no
3519 cc_check && _strsep=yes
3520 if test "$_strsep" = yes ; then
3521 def_strsep='#define HAVE_STRSEP 1'
3522 _need_strsep=no
3523 else
3524 def_strsep='#undef HAVE_STRSEP'
3525 _need_strsep=yes
3527 echores "$_strsep"
3530 echocheck "vsscanf()"
3531 cat > $TMPC << EOF
3532 #define _ISOC99_SOURCE
3533 #include <stdarg.h>
3534 #include <stdio.h>
3535 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3537 _vsscanf=no
3538 cc_check && _vsscanf=yes
3539 if test "$_vsscanf" = yes ; then
3540 def_vsscanf='#define HAVE_VSSCANF 1'
3541 _need_vsscanf=no
3542 else
3543 def_vsscanf='#undef HAVE_VSSCANF'
3544 _need_vsscanf=yes
3546 echores "$_vsscanf"
3549 echocheck "swab()"
3550 cat > $TMPC << EOF
3551 #define _XOPEN_SOURCE 600
3552 #include <unistd.h>
3553 int main(void) { int a, b; swab(&a, &b, 0); return 0; }
3555 _swab=no
3556 cc_check && _swab=yes
3557 if test "$_swab" = yes ; then
3558 def_swab='#define HAVE_SWAB 1'
3559 _need_swab=no
3560 else
3561 def_swab='#undef HAVE_SWAB'
3562 _need_swab=yes
3564 echores "$_swab"
3566 echocheck "POSIX select()"
3567 cat > $TMPC << EOF
3568 #include <stdio.h>
3569 #include <stdlib.h>
3570 #include <sys/types.h>
3571 #include <string.h>
3572 #include <sys/time.h>
3573 #include <unistd.h>
3574 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
3576 _posix_select=no
3577 def_posix_select='#undef HAVE_POSIX_SELECT'
3578 #select() of kLIBC (OS/2) supports socket only
3579 ! os2 && cc_check && _posix_select=yes \
3580 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3581 echores "$_posix_select"
3584 echocheck "audio select()"
3585 if test "$_select" = no ; then
3586 def_select='#undef HAVE_AUDIO_SELECT'
3587 elif test "$_select" = yes ; then
3588 def_select='#define HAVE_AUDIO_SELECT 1'
3590 echores "$_select"
3593 echocheck "gettimeofday()"
3594 cat > $TMPC << EOF
3595 #include <sys/time.h>
3596 int main(void) {struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz); return 0; }
3598 _gettimeofday=no
3599 cc_check && _gettimeofday=yes
3600 if test "$_gettimeofday" = yes ; then
3601 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3602 _need_gettimeofday=no
3603 else
3604 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3605 _need_gettimeofday=yes
3607 echores "$_gettimeofday"
3610 echocheck "glob()"
3611 _glob=no
3612 statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
3613 if test "$_glob" = yes ; then
3614 def_glob='#define HAVE_GLOB 1'
3615 _need_glob=no
3616 else
3617 def_glob='#undef HAVE_GLOB'
3618 _need_glob=yes
3620 echores "$_glob"
3623 echocheck "setenv()"
3624 _setenv=no
3625 statement_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3626 if test "$_setenv" = yes ; then
3627 def_setenv='#define HAVE_SETENV 1'
3628 _need_setenv=no
3629 else
3630 def_setenv='#undef HAVE_SETENV'
3631 _need_setenv=yes
3633 echores "$_setenv"
3636 echocheck "setmode()"
3637 _setmode=no
3638 def_setmode='#define HAVE_SETMODE 0'
3639 statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3640 echores "$_setmode"
3643 if sunos; then
3644 echocheck "sysi86()"
3645 _sysi86=no
3646 statement_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3647 if test "$_sysi86" = yes ; then
3648 def_sysi86='#define HAVE_SYSI86 1'
3649 cat > $TMPC << EOF
3650 #include <sys/sysi86.h>
3651 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3653 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3654 else
3655 def_sysi86='#undef HAVE_SYSI86'
3657 echores "$_sysi86"
3658 fi #if sunos
3661 echocheck "sys/sysinfo.h"
3662 cat > $TMPC << EOF
3663 #include <sys/sysinfo.h>
3664 int main(void) { struct sysinfo s_info; sysinfo(&s_info); return 0; }
3666 _sys_sysinfo=no
3667 cc_check && _sys_sysinfo=yes
3668 if test "$_sys_sysinfo" = yes ; then
3669 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3670 else
3671 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3673 echores "$_sys_sysinfo"
3676 if darwin; then
3678 echocheck "Mac OS X Finder Support"
3679 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3680 if test "$_macosx_finder" = yes ; then
3681 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3682 extra_ldflags="$extra_ldflags -framework Carbon"
3684 echores "$_macosx_finder"
3686 echocheck "Mac OS X Bundle file locations"
3687 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3688 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3689 if test "$_macosx_bundle" = yes ; then
3690 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3691 extra_ldflags="$extra_ldflags -framework Carbon"
3693 echores "$_macosx_bundle"
3695 echocheck "Apple Remote"
3696 if test "$_apple_remote" = auto ; then
3697 _apple_remote=no
3698 cat > $TMPC <<EOF
3699 #include <stdio.h>
3700 #include <IOKit/IOCFPlugIn.h>
3701 int main(void) {
3702 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3703 CFMutableDictionaryRef hidMatchDictionary;
3704 IOReturn ioReturnValue;
3706 // Set up a matching dictionary to search the I/O Registry by class.
3707 // name for all HID class devices
3708 hidMatchDictionary = IOServiceMatching("AppleIRController");
3710 // Now search I/O Registry for matching devices.
3711 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3712 hidMatchDictionary, &hidObjectIterator);
3714 // If search is unsuccessful, return nonzero.
3715 if (ioReturnValue != kIOReturnSuccess ||
3716 !IOIteratorIsValid(hidObjectIterator)) {
3717 return 1;
3719 return 0;
3722 cc_check -framework IOKit && _apple_remote=yes
3724 if test "$_apple_remote" = yes ; then
3725 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3726 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3727 else
3728 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3730 echores "$_apple_remote"
3732 fi #if darwin
3734 if linux; then
3736 echocheck "Apple IR"
3737 if test "$_apple_ir" = auto ; then
3738 _apple_ir=no
3739 cat > $TMPC <<EOF
3740 #include <linux/input.h>
3741 int main(void) { struct input_event ev; struct input_id id; return 0; }
3743 cc_check && _apple_ir=yes
3745 if test "$_apple_ir" = yes ; then
3746 def_apple_ir='#define CONFIG_APPLE_IR 1'
3747 else
3748 def_apple_ir='#undef CONFIG_APPLE_IR'
3750 echores "$_apple_ir"
3751 fi #if linux
3753 echocheck "pkg-config"
3754 _pkg_config=pkg-config
3755 if $($_pkg_config --version > /dev/null 2>&1); then
3756 if test "$_ld_static"; then
3757 _pkg_config="$_pkg_config --static"
3759 echores "yes"
3760 else
3761 _pkg_config=false
3762 echores "no"
3766 echocheck "Samba support (libsmbclient)"
3767 if test "$_smb" = yes; then
3768 extra_ldflags="$extra_ldflags -lsmbclient"
3770 if test "$_smb" = auto; then
3771 _smb=no
3772 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3773 statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3774 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3775 done
3778 if test "$_smb" = yes; then
3779 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3780 inputmodules="smb $inputmodules"
3781 else
3782 def_smb="#undef CONFIG_LIBSMBCLIENT"
3783 noinputmodules="smb $noinputmodules"
3785 echores "$_smb"
3788 #########
3789 # VIDEO #
3790 #########
3793 echocheck "tdfxfb"
3794 if test "$_tdfxfb" = yes ; then
3795 def_tdfxfb='#define CONFIG_TDFXFB 1'
3796 vomodules="tdfxfb $vomodules"
3797 else
3798 def_tdfxfb='#undef CONFIG_TDFXFB'
3799 novomodules="tdfxfb $novomodules"
3801 echores "$_tdfxfb"
3803 echocheck "s3fb"
3804 if test "$_s3fb" = yes ; then
3805 def_s3fb='#define CONFIG_S3FB 1'
3806 vomodules="s3fb $vomodules"
3807 else
3808 def_s3fb='#undef CONFIG_S3FB'
3809 novomodules="s3fb $novomodules"
3811 echores "$_s3fb"
3813 echocheck "wii"
3814 if test "$_wii" = yes ; then
3815 def_wii='#define CONFIG_WII 1'
3816 vomodules="wii $vomodules"
3817 else
3818 def_wii='#undef CONFIG_WII'
3819 novomodules="wii $novomodules"
3821 echores "$_wii"
3823 echocheck "tdfxvid"
3824 if test "$_tdfxvid" = yes ; then
3825 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3826 vomodules="tdfx_vid $vomodules"
3827 else
3828 def_tdfxvid='#undef CONFIG_TDFX_VID'
3829 novomodules="tdfx_vid $novomodules"
3831 echores "$_tdfxvid"
3833 echocheck "xvr100"
3834 if test "$_xvr100" = auto ; then
3835 cat > $TMPC << EOF
3836 #include <unistd.h>
3837 #include <sys/fbio.h>
3838 #include <sys/visual_io.h>
3839 int main(void) {
3840 struct vis_identifier ident;
3841 struct fbgattr attr;
3842 ioctl(0, VIS_GETIDENTIFIER, &ident);
3843 ioctl(0, FBIOGATTR, &attr);
3844 return 0;
3847 _xvr100=no
3848 cc_check && _xvr100=yes
3850 if test "$_xvr100" = yes ; then
3851 def_xvr100='#define CONFIG_XVR100 1'
3852 vomodules="xvr100 $vomodules"
3853 else
3854 def_tdfxvid='#undef CONFIG_XVR100'
3855 novomodules="xvr100 $novomodules"
3857 echores "$_xvr100"
3859 echocheck "tga"
3860 if test "$_tga" = yes ; then
3861 def_tga='#define CONFIG_TGA 1'
3862 vomodules="tga $vomodules"
3863 else
3864 def_tga='#undef CONFIG_TGA'
3865 novomodules="tga $novomodules"
3867 echores "$_tga"
3870 echocheck "md5sum support"
3871 if test "$_md5sum" = yes; then
3872 def_md5sum="#define CONFIG_MD5SUM 1"
3873 vomodules="md5sum $vomodules"
3874 else
3875 def_md5sum="#undef CONFIG_MD5SUM"
3876 novomodules="md5sum $novomodules"
3878 echores "$_md5sum"
3881 echocheck "yuv4mpeg support"
3882 if test "$_yuv4mpeg" = yes; then
3883 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3884 vomodules="yuv4mpeg $vomodules"
3885 else
3886 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3887 novomodules="yuv4mpeg $novomodules"
3889 echores "$_yuv4mpeg"
3892 echocheck "bl"
3893 if test "$_bl" = yes ; then
3894 def_bl='#define CONFIG_BL 1'
3895 vomodules="bl $vomodules"
3896 else
3897 def_bl='#undef CONFIG_BL'
3898 novomodules="bl $novomodules"
3900 echores "$_bl"
3903 echocheck "DirectFB"
3904 if test "$_directfb" = auto ; then
3905 _directfb=no
3906 cat > $TMPC << EOF
3907 #include <directfb.h>
3908 #include <directfb_version.h>
3909 #if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
3910 #error "DirectFB version too old."
3911 #endif
3912 int main(void) { DirectFBInit(0, 0); return 0; }
3914 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3915 cc_check $_inc_tmp -ldirectfb &&
3916 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3917 done
3919 if test "$_directfb" = yes ; then
3920 def_directfb='#define CONFIG_DIRECTFB 1'
3921 vomodules="directfb dfbmga $vomodules"
3922 libs_mplayer="$libs_mplayer -ldirectfb"
3923 else
3924 def_directfb='#undef CONFIG_DIRECTFB'
3925 novomodules="directfb dfbmga $novomodules"
3927 echores "$_directfb"
3930 echocheck "X11 headers presence"
3931 _x11_headers="no"
3932 res_comment="check if the dev(el) packages are installed"
3933 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
3934 if test -f "$I/X11/Xlib.h" ; then
3935 _x11_headers="yes"
3936 res_comment=""
3937 break
3939 done
3940 if test $_cross_compile = no; then
3941 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
3942 /usr/include/X11R6 /usr/openwin/include ; do
3943 if test -f "$I/X11/Xlib.h" ; then
3944 extra_cflags="$extra_cflags -I$I"
3945 _x11_headers="yes"
3946 res_comment="using $I"
3947 break
3949 done
3951 echores "$_x11_headers"
3954 echocheck "X11"
3955 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3956 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
3957 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
3958 -L/usr/lib ; do
3959 if netbsd; then
3960 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
3961 else
3962 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3964 statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
3965 libs_mplayer="$libs_mplayer $_ld_tmp" && _x11=yes && break
3966 done
3968 if test "$_x11" = yes ; then
3969 def_x11='#define CONFIG_X11 1'
3970 vomodules="x11 xover $vomodules"
3971 else
3972 _x11=no
3973 def_x11='#undef CONFIG_X11'
3974 novomodules="x11 $novomodules"
3975 res_comment="check if the dev(el) packages are installed"
3976 # disable stuff that depends on X
3977 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
3979 echores "$_x11"
3981 echocheck "Xss screensaver extensions"
3982 if test "$_xss" = auto ; then
3983 cat > $TMPC << EOF
3984 #include <X11/Xlib.h>
3985 #include <X11/extensions/scrnsaver.h>
3986 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
3988 _xss=no
3989 cc_check -lXss && _xss=yes
3991 if test "$_xss" = yes ; then
3992 def_xss='#define CONFIG_XSS 1'
3993 libs_mplayer="$libs_mplayer -lXss"
3994 else
3995 def_xss='#undef CONFIG_XSS'
3997 echores "$_xss"
3999 echocheck "DPMS"
4000 _xdpms3=no
4001 _xdpms4=no
4002 if test "$_x11" = yes ; then
4003 cat > $TMPC <<EOF
4004 #include <X11/Xmd.h>
4005 #include <X11/Xlib.h>
4006 #include <X11/Xutil.h>
4007 #include <X11/Xatom.h>
4008 #include <X11/extensions/dpms.h>
4009 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
4011 cc_check -lXdpms && _xdpms3=yes
4012 statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
4014 if test "$_xdpms4" = yes ; then
4015 def_xdpms='#define CONFIG_XDPMS 1'
4016 res_comment="using Xdpms 4"
4017 echores "yes"
4018 elif test "$_xdpms3" = yes ; then
4019 def_xdpms='#define CONFIG_XDPMS 1'
4020 libs_mplayer="$libs_mplayer -lXdpms"
4021 res_comment="using Xdpms 3"
4022 echores "yes"
4023 else
4024 def_xdpms='#undef CONFIG_XDPMS'
4025 echores "no"
4029 echocheck "Xv"
4030 if test "$_xv" = auto ; then
4031 _xv=no
4032 statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
4035 if test "$_xv" = yes ; then
4036 def_xv='#define CONFIG_XV 1'
4037 libs_mplayer="$libs_mplayer -lXv"
4038 vomodules="xv $vomodules"
4039 else
4040 def_xv='#undef CONFIG_XV'
4041 novomodules="xv $novomodules"
4043 echores "$_xv"
4046 echocheck "XvMC"
4047 if test "$_xv" = yes && test "$_xvmc" != no ; then
4048 _xvmc=no
4049 cat > $TMPC <<EOF
4050 #include <X11/Xlib.h>
4051 #include <X11/extensions/Xvlib.h>
4052 #include <X11/extensions/XvMClib.h>
4053 int main(void) {
4054 XvMCQueryExtension(0, 0, 0);
4055 XvMCCreateContext(0, 0, 0, 0, 0, 0, 0);
4056 return 0; }
4058 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4059 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4060 done
4062 if test "$_xvmc" = yes ; then
4063 def_xvmc='#define CONFIG_XVMC 1'
4064 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4065 vomodules="xvmc $vomodules"
4066 res_comment="using $_xvmclib"
4067 else
4068 def_xvmc='#define CONFIG_XVMC 0'
4069 novomodules="xvmc $novomodules"
4071 echores "$_xvmc"
4074 echocheck "VDPAU"
4075 if test "$_vdpau" = auto ; then
4076 _vdpau=no
4077 if test "$_dl" = yes ; then
4078 cat > $TMPC <<EOF
4079 #include <vdpau/vdpau_x11.h>
4080 int main(void) {
4081 vdp_device_create_x11(0, 0, 0, 0);
4082 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4084 cc_check -lvdpau && _vdpau=yes
4087 if test "$_vdpau" = yes ; then
4088 def_vdpau='#define CONFIG_VDPAU 1'
4089 libs_mplayer="$libs_mplayer -lvdpau"
4090 vomodules="vdpau $vomodules"
4091 else
4092 def_vdpau='#define CONFIG_VDPAU 0'
4093 novomodules="vdpau $novomodules"
4095 echores "$_vdpau"
4098 echocheck "Xinerama"
4099 if test "$_xinerama" = auto ; then
4100 _xinerama=no
4101 statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
4104 if test "$_xinerama" = yes ; then
4105 def_xinerama='#define CONFIG_XINERAMA 1'
4106 libs_mplayer="$libs_mplayer -lXinerama"
4107 else
4108 def_xinerama='#undef CONFIG_XINERAMA'
4110 echores "$_xinerama"
4113 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4114 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4115 # named 'X extensions' or something similar.
4116 # This check may be useful for future mplayer versions (to change resolution)
4117 # If you run into problems, remove '-lXxf86vm'.
4118 echocheck "Xxf86vm"
4119 if test "$_vm" = auto ; then
4120 _vm=no
4121 statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
4123 if test "$_vm" = yes ; then
4124 def_vm='#define CONFIG_XF86VM 1'
4125 libs_mplayer="$libs_mplayer -lXxf86vm"
4126 else
4127 def_vm='#undef CONFIG_XF86VM'
4129 echores "$_vm"
4131 # Check for the presence of special keycodes, like audio control buttons
4132 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4133 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4134 # have these new keycodes.
4135 echocheck "XF86keysym"
4136 if test "$_xf86keysym" = auto; then
4137 _xf86keysym=no
4138 cat > $TMPC <<EOF
4139 #include <X11/XF86keysym.h>
4140 int main(void) { return XF86XK_AudioPause; }
4142 cc_check && _xf86keysym=yes
4144 if test "$_xf86keysym" = yes ; then
4145 def_xf86keysym='#define CONFIG_XF86XK 1'
4146 else
4147 def_xf86keysym='#undef CONFIG_XF86XK'
4149 echores "$_xf86keysym"
4151 echocheck "DGA"
4152 if test "$_dga2" = auto && test "$_x11" = yes ; then
4153 _dga2=no
4154 statement_check_broken X11/Xlib.h X11/extensions/xf86dga.h 'XDGASetViewport(0, 0, 0, 0, 0)' -lXxf86dga && _dga2=yes
4156 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4157 _dga1=no
4158 statement_check_broken X11/Xlib.h X11/extensions/xf86dga.h 'XF86DGASetViewPort(0, 0, 0, 0)' -lXxf86dga -lXxf86vm && _dga1=yes
4161 _dga=no
4162 def_dga='#undef CONFIG_DGA'
4163 def_dga1='#undef CONFIG_DGA1'
4164 def_dga2='#undef CONFIG_DGA2'
4165 if test "$_dga1" = yes ; then
4166 _dga=yes
4167 def_dga1='#define CONFIG_DGA1 1'
4168 res_comment="using DGA 1.0"
4169 elif test "$_dga2" = yes ; then
4170 _dga=yes
4171 def_dga2='#define CONFIG_DGA2 1'
4172 res_comment="using DGA 2.0"
4174 if test "$_dga" = yes ; then
4175 def_dga='#define CONFIG_DGA 1'
4176 libs_mplayer="$libs_mplayer -lXxf86dga"
4177 vomodules="dga $vomodules"
4178 else
4179 novomodules="dga $novomodules"
4181 echores "$_dga"
4184 echocheck "3dfx"
4185 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4186 def_3dfx='#define CONFIG_3DFX 1'
4187 vomodules="3dfx $vomodules"
4188 else
4189 def_3dfx='#undef CONFIG_3DFX'
4190 novomodules="3dfx $novomodules"
4192 echores "$_3dfx"
4195 echocheck "VIDIX"
4196 def_vidix='#undef CONFIG_VIDIX'
4197 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4198 _vidix_drv_cyberblade=no
4199 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4200 _vidix_drv_ivtv=no
4201 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4202 _vidix_drv_mach64=no
4203 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4204 _vidix_drv_mga=no
4205 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4206 _vidix_drv_mga_crtc2=no
4207 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4208 _vidix_drv_nvidia=no
4209 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4210 _vidix_drv_pm2=no
4211 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4212 _vidix_drv_pm3=no
4213 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4214 _vidix_drv_radeon=no
4215 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4216 _vidix_drv_rage128=no
4217 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4218 _vidix_drv_s3=no
4219 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4220 _vidix_drv_sh_veu=no
4221 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4222 _vidix_drv_sis=no
4223 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4224 _vidix_drv_unichrome=no
4225 if test "$_vidix" = auto ; then
4226 _vidix=no
4227 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4228 && _vidix=yes
4229 x86_64 && ! linux && _vidix=no
4230 (ppc || alpha) && linux && _vidix=yes
4232 echores "$_vidix"
4234 if test "$_vidix" = yes ; then
4235 def_vidix='#define CONFIG_VIDIX 1'
4236 vomodules="cvidix $vomodules"
4237 # FIXME: ivtv driver temporarily disabled until we have a proper test
4238 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4239 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4241 # some vidix drivers are architecture and os specific, discard them elsewhere
4242 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4243 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4245 for driver in $_vidix_drivers ; do
4246 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4247 eval _vidix_drv_${driver}=yes
4248 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4249 done
4251 echocheck "VIDIX PCI device name database"
4252 echores "$_vidix_pcidb"
4253 if test "$_vidix_pcidb" = yes ; then
4254 _vidix_pcidb_val=1
4255 else
4256 _vidix_pcidb_val=0
4259 echocheck "VIDIX dhahelper support"
4260 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4261 echores "$_dhahelper"
4263 echocheck "VIDIX svgalib_helper support"
4264 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4265 echores "$_svgalib_helper"
4267 else
4268 novomodules="cvidix $novomodules"
4271 if test "$_vidix" = yes && win32; then
4272 winvidix=yes
4273 vomodules="winvidix $vomodules"
4274 libs_mplayer="$libs_mplayer -lgdi32"
4275 else
4276 novomodules="winvidix $novomodules"
4278 if test "$_vidix" = yes && test "$_x11" = yes; then
4279 xvidix=yes
4280 vomodules="xvidix $vomodules"
4281 else
4282 novomodules="xvidix $novomodules"
4285 echocheck "GGI"
4286 if test "$_ggi" = auto ; then
4287 _ggi=no
4288 statement_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4290 if test "$_ggi" = yes ; then
4291 def_ggi='#define CONFIG_GGI 1'
4292 libs_mplayer="$libs_mplayer -lggi"
4293 vomodules="ggi $vomodules"
4294 else
4295 def_ggi='#undef CONFIG_GGI'
4296 novomodules="ggi $novomodules"
4298 echores "$_ggi"
4300 echocheck "GGI extension: libggiwmh"
4301 if test "$_ggiwmh" = auto ; then
4302 _ggiwmh=no
4303 statement_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4305 # needed to get right output on obscure combination
4306 # like --disable-ggi --enable-ggiwmh
4307 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4308 def_ggiwmh='#define CONFIG_GGIWMH 1'
4309 libs_mplayer="$libs_mplayer -lggiwmh"
4310 else
4311 _ggiwmh=no
4312 def_ggiwmh='#undef CONFIG_GGIWMH'
4314 echores "$_ggiwmh"
4317 echocheck "AA"
4318 if test "$_aa" = auto ; then
4319 cat > $TMPC << EOF
4320 #include <aalib.h>
4321 int main(void) {
4322 aa_context *c;
4323 aa_renderparams *p;
4324 aa_init(0, 0, 0);
4325 c = aa_autoinit(&aa_defparams);
4326 p = aa_getrenderparams();
4327 aa_autoinitkbd(c, 0);
4328 return 0; }
4330 _aa=no
4331 for _ld_tmp in "-laa" ; do
4332 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4333 done
4335 if test "$_aa" = yes ; then
4336 def_aa='#define CONFIG_AA 1'
4337 if cygwin ; then
4338 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4340 vomodules="aa $vomodules"
4341 else
4342 def_aa='#undef CONFIG_AA'
4343 novomodules="aa $novomodules"
4345 echores "$_aa"
4348 echocheck "CACA"
4349 if test "$_caca" = auto ; then
4350 _caca=no
4351 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4352 cat > $TMPC << EOF
4353 #include <caca.h>
4354 #ifdef CACA_API_VERSION_1
4355 #include <caca0.h>
4356 #endif
4357 int main(void) { caca_init(); return 0; }
4359 cc_check $(caca-config --libs) && _caca=yes
4362 if test "$_caca" = yes ; then
4363 def_caca='#define CONFIG_CACA 1'
4364 extra_cflags="$extra_cflags $(caca-config --cflags)"
4365 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4366 vomodules="caca $vomodules"
4367 else
4368 def_caca='#undef CONFIG_CACA'
4369 novomodules="caca $novomodules"
4371 echores "$_caca"
4374 echocheck "SVGAlib"
4375 if test "$_svga" = auto ; then
4376 _svga=no
4377 header_check vga.h -lvga $_ld_lm && _svga=yes
4379 if test "$_svga" = yes ; then
4380 def_svga='#define CONFIG_SVGALIB 1'
4381 libs_mplayer="$libs_mplayer -lvga"
4382 vomodules="svga $vomodules"
4383 else
4384 def_svga='#undef CONFIG_SVGALIB'
4385 novomodules="svga $novomodules"
4387 echores "$_svga"
4390 echocheck "FBDev"
4391 if test "$_fbdev" = auto ; then
4392 _fbdev=no
4393 linux && _fbdev=yes
4395 if test "$_fbdev" = yes ; then
4396 def_fbdev='#define CONFIG_FBDEV 1'
4397 vomodules="fbdev $vomodules"
4398 else
4399 def_fbdev='#undef CONFIG_FBDEV'
4400 novomodules="fbdev $novomodules"
4402 echores "$_fbdev"
4406 echocheck "DVB"
4407 if test "$_dvb" = auto ; then
4408 _dvb=no
4409 cat >$TMPC << EOF
4410 #include <poll.h>
4411 #include <sys/ioctl.h>
4412 #include <stdio.h>
4413 #include <time.h>
4414 #include <unistd.h>
4415 #include <linux/dvb/dmx.h>
4416 #include <linux/dvb/frontend.h>
4417 #include <linux/dvb/video.h>
4418 #include <linux/dvb/audio.h>
4419 int main(void) {return 0;}
4421 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4422 cc_check $_inc_tmp && _dvb=yes && \
4423 extra_cflags="$extra_cflags $_inc_tmp" && break
4424 done
4426 echores "$_dvb"
4427 if test "$_dvb" = yes ; then
4428 _dvbin=yes
4429 inputmodules="dvb $inputmodules"
4430 def_dvb='#define CONFIG_DVB 1'
4431 def_dvbin='#define CONFIG_DVBIN 1'
4432 aomodules="mpegpes(dvb) $aomodules"
4433 vomodules="mpegpes(dvb) $vomodules"
4434 else
4435 _dvbin=no
4436 noinputmodules="dvb $noinputmodules"
4437 def_dvb='#undef CONFIG_DVB'
4438 def_dvbin='#undef CONFIG_DVBIN '
4439 aomodules="mpegpes(file) $aomodules"
4440 vomodules="mpegpes(file) $vomodules"
4444 if darwin; then
4446 echocheck "QuickTime"
4447 if test "$quicktime" = auto ; then
4448 cat > $TMPC <<EOF
4449 #include <QuickTime/QuickTime.h>
4450 int main(void) {
4451 ImageDescription *desc;
4452 EnterMovies();
4453 ExitMovies();
4454 return 0;
4457 quicktime=no
4458 cc_check -framework QuickTime && quicktime=yes
4460 if test "$quicktime" = yes ; then
4461 extra_ldflags="$extra_ldflags -framework QuickTime"
4462 def_quicktime='#define CONFIG_QUICKTIME 1'
4463 else
4464 def_quicktime='#undef CONFIG_QUICKTIME'
4465 _quartz=no
4467 echores $quicktime
4469 echocheck "Quartz"
4470 if test "$_quartz" = auto ; then
4471 _quartz=no
4472 statement_check Carbon/Carbon.h 'CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false)' -framework Carbon && _quartz=yes
4474 if test "$_quartz" = yes ; then
4475 libs_mplayer="$libs_mplayer -framework Carbon"
4476 def_quartz='#define CONFIG_QUARTZ 1'
4477 vomodules="quartz $vomodules"
4478 else
4479 def_quartz='#undef CONFIG_QUARTZ'
4480 novomodules="quartz $novomodules"
4482 echores $_quartz
4484 echocheck "CoreVideo"
4485 if test "$_corevideo" = auto ; then
4486 cat > $TMPC <<EOF
4487 #include <Carbon/Carbon.h>
4488 #include <CoreServices/CoreServices.h>
4489 #include <OpenGL/OpenGL.h>
4490 #include <QuartzCore/CoreVideo.h>
4491 int main(void) { return 0; }
4493 _corevideo=no
4494 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4496 if test "$_corevideo" = yes ; then
4497 vomodules="corevideo $vomodules"
4498 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4499 def_corevideo='#define CONFIG_COREVIDEO 1'
4500 else
4501 novomodules="corevideo $novomodules"
4502 def_corevideo='#undef CONFIG_COREVIDEO'
4504 echores "$_corevideo"
4506 fi #if darwin
4509 echocheck "PNG support"
4510 if test "$_png" = auto ; then
4511 _png=no
4512 if irix ; then
4513 # Don't check for -lpng on irix since it has its own libpng
4514 # incompatible with the GNU libpng
4515 res_comment="disabled on irix (not GNU libpng)"
4516 else
4517 cat > $TMPC << EOF
4518 #include <stdio.h>
4519 #include <string.h>
4520 #include <png.h>
4521 int main(void) {
4522 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4523 printf("libpng: %s\n", png_libpng_ver);
4524 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4527 cc_check -lpng -lz $_ld_lm && _png=yes
4530 echores "$_png"
4531 if test "$_png" = yes ; then
4532 def_png='#define CONFIG_PNG 1'
4533 extra_ldflags="$extra_ldflags -lpng -lz"
4534 else
4535 def_png='#undef CONFIG_PNG'
4538 echocheck "MNG support"
4539 if test "$_mng" = auto ; then
4540 _mng=no
4541 cat > $TMPC << EOF
4542 #include <libmng.h>
4543 int main(void) {
4544 const char * p_ver = mng_version_text();
4545 return !p_ver || p_ver[0] == 0;
4548 if cc_check -lmng -lz $_ld_lm ; then
4549 _mng=yes
4552 echores "$_mng"
4553 if test "$_mng" = yes ; then
4554 def_mng='#define CONFIG_MNG 1'
4555 extra_ldflags="$extra_ldflags -lmng -lz"
4556 else
4557 def_mng='#undef CONFIG_MNG'
4560 echocheck "JPEG support"
4561 if test "$_jpeg" = auto ; then
4562 _jpeg=no
4563 header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
4565 echores "$_jpeg"
4567 if test "$_jpeg" = yes ; then
4568 def_jpeg='#define CONFIG_JPEG 1'
4569 vomodules="jpeg $vomodules"
4570 extra_ldflags="$extra_ldflags -ljpeg"
4571 else
4572 def_jpeg='#undef CONFIG_JPEG'
4573 novomodules="jpeg $novomodules"
4578 echocheck "PNM support"
4579 if test "$_pnm" = yes; then
4580 def_pnm="#define CONFIG_PNM 1"
4581 vomodules="pnm $vomodules"
4582 else
4583 def_pnm="#undef CONFIG_PNM"
4584 novomodules="pnm $novomodules"
4586 echores "$_pnm"
4590 echocheck "GIF support"
4591 # This is to appease people who want to force gif support.
4592 # If it is forced to yes, then we still do checks to determine
4593 # which gif library to use.
4594 if test "$_gif" = yes ; then
4595 _force_gif=yes
4596 _gif=auto
4599 if test "$_gif" = auto ; then
4600 _gif=no
4601 for _ld_gif in "-lungif" "-lgif" ; do
4602 statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4603 done
4606 # If no library was found, and the user wants support forced,
4607 # then we force it on with libgif, as this is the safest
4608 # assumption IMHO. (libungif & libregif both create symbolic
4609 # links to libgif. We also assume that no x11 support is needed,
4610 # because if you are forcing this, then you _should_ know what
4611 # you are doing. [ Besides, package maintainers should never
4612 # have compiled x11 deps into libungif in the first place. ] )
4613 # </rant>
4614 # --Joey
4615 if test "$_force_gif" = yes && test "$_gif" = no ; then
4616 _gif=yes
4617 _ld_gif="-lgif"
4620 if test "$_gif" = yes ; then
4621 def_gif='#define CONFIG_GIF 1'
4622 codecmodules="gif $codecmodules"
4623 vomodules="gif89a $vomodules"
4624 res_comment="old version, some encoding functions disabled"
4625 def_gif_4='#undef CONFIG_GIF_4'
4626 extra_ldflags="$extra_ldflags $_ld_gif"
4628 cat > $TMPC << EOF
4629 #include <signal.h>
4630 #include <stdio.h>
4631 #include <stdlib.h>
4632 #include <gif_lib.h>
4633 static void catch(int sig) { exit(1); }
4634 int main(void) {
4635 signal(SIGSEGV, catch); // catch segfault
4636 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4637 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4638 return 0;
4641 if cc_check "$_ld_gif" ; then
4642 def_gif_4='#define CONFIG_GIF_4 1'
4643 res_comment=""
4645 else
4646 def_gif='#undef CONFIG_GIF'
4647 def_gif_4='#undef CONFIG_GIF_4'
4648 novomodules="gif89a $novomodules"
4649 nocodecmodules="gif $nocodecmodules"
4651 echores "$_gif"
4654 case "$_gif" in yes*)
4655 echocheck "broken giflib workaround"
4656 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4658 cat > $TMPC << EOF
4659 #include <stdio.h>
4660 #include <gif_lib.h>
4661 int main(void) {
4662 GifFileType gif = {.UserData = NULL};
4663 printf("UserData is at address %p\n", gif.UserData);
4664 return 0;
4667 if cc_check "$_ld_gif" ; then
4668 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4669 echores "disabled"
4670 else
4671 echores "enabled"
4674 esac
4677 echocheck "VESA support"
4678 if test "$_vesa" = auto ; then
4679 _vesa=no
4680 statement_check vbe.h 'vbeInit()' -lvbe -llrmi && _vesa=yes
4682 if test "$_vesa" = yes ; then
4683 def_vesa='#define CONFIG_VESA 1'
4684 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4685 vomodules="vesa $vomodules"
4686 else
4687 def_vesa='#undef CONFIG_VESA'
4688 novomodules="vesa $novomodules"
4690 echores "$_vesa"
4692 #################
4693 # VIDEO + AUDIO #
4694 #################
4697 echocheck "SDL"
4698 _inc_tmp=""
4699 _ld_tmp=""
4700 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4701 if test -z "$_sdlconfig" ; then
4702 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4703 _sdlconfig="sdl-config"
4704 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4705 _sdlconfig="sdl11-config"
4706 else
4707 _sdlconfig=false
4710 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4711 cat > $TMPC << EOF
4712 #ifdef CONFIG_SDL_SDL_H
4713 #include <SDL/SDL.h>
4714 #else
4715 #include <SDL.h>
4716 #endif
4717 #ifndef __APPLE__
4718 // we allow SDL hacking our main() only on OSX
4719 #undef main
4720 #endif
4721 int main(int argc, char *argv[]) {
4722 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4723 return 0;
4726 _sdl=no
4727 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4728 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4729 _sdl=yes
4730 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4731 break
4733 done
4734 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4735 res_comment="using $_sdlconfig"
4736 if cygwin ; then
4737 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4738 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4739 elif mingw32 ; then
4740 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4741 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4742 else
4743 _inc_tmp="$($_sdlconfig --cflags)"
4744 _ld_tmp="$($_sdlconfig --libs)"
4746 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4747 _sdl=yes
4748 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4749 # HACK for BeOS/Haiku SDL
4750 _ld_tmp="$_ld_tmp -lstdc++"
4751 _sdl=yes
4755 if test "$_sdl" = yes ; then
4756 def_sdl='#define CONFIG_SDL 1'
4757 extra_cflags="$extra_cflags $_inc_tmp"
4758 libs_mplayer="$libs_mplayer $_ld_tmp"
4759 vomodules="sdl $vomodules"
4760 aomodules="sdl $aomodules"
4761 else
4762 def_sdl='#undef CONFIG_SDL'
4763 novomodules="sdl $novomodules"
4764 noaomodules="sdl $noaomodules"
4766 echores "$_sdl"
4769 # make sure this stays below CoreVideo to avoid issues due to namespace
4770 # conflicts between -lGL and -framework OpenGL
4771 echocheck "OpenGL"
4772 #Note: this test is run even with --enable-gl since we autodetect linker flags
4773 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
4774 cat > $TMPC << EOF
4775 #ifdef GL_WIN32
4776 #include <windows.h>
4777 #include <GL/gl.h>
4778 #elif defined(GL_SDL)
4779 #include <GL/gl.h>
4780 #ifdef CONFIG_SDL_SDL_H
4781 #include <SDL/SDL.h>
4782 #else
4783 #include <SDL.h>
4784 #endif
4785 #ifndef __APPLE__
4786 // we allow SDL hacking our main() only on OSX
4787 #undef main
4788 #endif
4789 #else
4790 #include <GL/gl.h>
4791 #include <X11/Xlib.h>
4792 #include <GL/glx.h>
4793 #endif
4794 int main(int argc, char *argv[]) {
4795 #ifdef GL_WIN32
4796 HDC dc;
4797 wglCreateContext(dc);
4798 #elif defined(GL_SDL)
4799 SDL_GL_SwapBuffers();
4800 #else
4801 glXCreateContext(NULL, NULL, NULL, True);
4802 #endif
4803 glFinish();
4804 return 0;
4807 _gl=no
4808 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4809 if cc_check $_ld_tmp $_ld_lm ; then
4810 _gl=yes
4811 _gl_x11=yes
4812 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4813 break
4815 done
4816 if cc_check -DGL_WIN32 -lopengl32 ; then
4817 _gl=yes
4818 _gl_win32=yes
4819 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4821 # last so it can reuse any linker etc. flags detected before
4822 if test "$_sdl" = yes ; then
4823 if cc_check -DGL_SDL ||
4824 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4825 _gl=yes
4826 _gl_sdl=yes
4827 elif cc_check -DGL_SDL -lGL ||
4828 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
4829 _gl=yes
4830 _gl_sdl=yes
4831 libs_mplayer="$libs_mplayer -lGL"
4834 else
4835 _gl=no
4837 if test "$_gl" = yes ; then
4838 def_gl='#define CONFIG_GL 1'
4839 res_comment="backends:"
4840 if test "$_gl_win32" = yes ; then
4841 def_gl_win32='#define CONFIG_GL_WIN32 1'
4842 res_comment="$res_comment win32"
4844 if test "$_gl_x11" = yes ; then
4845 def_gl_x11='#define CONFIG_GL_X11 1'
4846 res_comment="$res_comment x11"
4848 if test "$_gl_sdl" = yes ; then
4849 def_gl_sdl='#define CONFIG_GL_SDL 1'
4850 res_comment="$res_comment sdl"
4852 vomodules="opengl $vomodules"
4853 else
4854 def_gl='#undef CONFIG_GL'
4855 def_gl_win32='#undef CONFIG_GL_WIN32'
4856 def_gl_x11='#undef CONFIG_GL_X11'
4857 def_gl_sdl='#undef CONFIG_GL_SDL'
4858 novomodules="opengl $novomodules"
4860 echores "$_gl"
4863 echocheck "MatrixView"
4864 if test "$_gl" = no ; then
4865 matrixview=no
4867 if test "$matrixview" = yes ; then
4868 vomodules="matrixview $vomodules"
4869 def_matrixview='#define CONFIG_MATRIXVIEW 1'
4870 else
4871 novomodules="matrixview $novomodules"
4872 def_matrixview='#undef CONFIG_MATRIXVIEW'
4874 echores "$matrixview"
4877 if os2 ; then
4878 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
4879 if test "$_kva" = auto; then
4880 _kva=no;
4881 header_check_broken os2.h kva.h -lkva && _kva=yes
4883 if test "$_kva" = yes ; then
4884 def_kva='#define CONFIG_KVA 1'
4885 libs_mplayer="$libs_mplayer -lkva"
4886 vomodules="kva $vomodules"
4887 else
4888 def_kva='#undef CONFIG_KVA'
4889 novomodules="kva $novomodules"
4891 echores "$_kva"
4892 fi #if os2
4895 if win32; then
4897 echocheck "Windows waveout"
4898 if test "$_win32waveout" = auto ; then
4899 _win32waveout=no
4900 header_check_broken windows.h mmsystem.h -lwinmm && _win32waveout=yes
4902 if test "$_win32waveout" = yes ; then
4903 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4904 libs_mplayer="$libs_mplayer -lwinmm"
4905 aomodules="win32 $aomodules"
4906 else
4907 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4908 noaomodules="win32 $noaomodules"
4910 echores "$_win32waveout"
4912 echocheck "Direct3D"
4913 if test "$_direct3d" = auto ; then
4914 _direct3d=no
4915 header_check d3d9.h && _direct3d=yes
4917 if test "$_direct3d" = yes ; then
4918 def_direct3d='#define CONFIG_DIRECT3D 1'
4919 vomodules="direct3d $vomodules"
4920 else
4921 def_direct3d='#undef CONFIG_DIRECT3D'
4922 novomodules="direct3d $novomodules"
4924 echores "$_direct3d"
4926 echocheck "Directx"
4927 if test "$_directx" = auto ; then
4928 cat > $TMPC << EOF
4929 #include <ddraw.h>
4930 #include <dsound.h>
4931 int main(void) { return 0; }
4933 _directx=no
4934 cc_check -lgdi32 && _directx=yes
4936 if test "$_directx" = yes ; then
4937 def_directx='#define CONFIG_DIRECTX 1'
4938 libs_mplayer="$libs_mplayer -lgdi32"
4939 vomodules="directx $vomodules"
4940 aomodules="dsound $aomodules"
4941 else
4942 def_directx='#undef CONFIG_DIRECTX'
4943 novomodules="directx $novomodules"
4944 noaomodules="dsound $noaomodules"
4946 echores "$_directx"
4948 fi #if win32; then
4951 echocheck "DXR2"
4952 if test "$_dxr2" = auto; then
4953 _dxr2=no
4954 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4955 header_check dxr2ioctl.h $_inc_tmp && _dxr2=yes &&
4956 extra_cflags="$extra_cflags $_inc_tmp" && break
4957 done
4959 if test "$_dxr2" = yes; then
4960 def_dxr2='#define CONFIG_DXR2 1'
4961 aomodules="dxr2 $aomodules"
4962 vomodules="dxr2 $vomodules"
4963 else
4964 def_dxr2='#undef CONFIG_DXR2'
4965 noaomodules="dxr2 $noaomodules"
4966 novomodules="dxr2 $novomodules"
4968 echores "$_dxr2"
4970 echocheck "DXR3/H+"
4971 if test "$_dxr3" = auto ; then
4972 _dxr3=no
4973 header_check linux/em8300.h && _dxr3=yes
4975 if test "$_dxr3" = yes ; then
4976 def_dxr3='#define CONFIG_DXR3 1'
4977 vomodules="dxr3 $vomodules"
4978 else
4979 def_dxr3='#undef CONFIG_DXR3'
4980 novomodules="dxr3 $novomodules"
4982 echores "$_dxr3"
4985 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4986 if test "$_ivtv" = auto ; then
4987 cat > $TMPC << EOF
4988 #include <linux/videodev2.h>
4989 #include <linux/ivtv.h>
4990 #include <sys/ioctl.h>
4991 int main(void) {
4992 struct ivtv_cfg_stop_decode sd;
4993 struct ivtv_cfg_start_decode sd1;
4994 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
4995 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
4996 return 0; }
4998 _ivtv=no
4999 cc_check && _ivtv=yes
5001 if test "$_ivtv" = yes ; then
5002 def_ivtv='#define CONFIG_IVTV 1'
5003 vomodules="ivtv $vomodules"
5004 aomodules="ivtv $aomodules"
5005 else
5006 def_ivtv='#undef CONFIG_IVTV'
5007 novomodules="ivtv $novomodules"
5008 noaomodules="ivtv $noaomodules"
5010 echores "$_ivtv"
5013 echocheck "V4L2 MPEG Decoder"
5014 if test "$_v4l2" = auto ; then
5015 cat > $TMPC << EOF
5016 #include <linux/videodev2.h>
5017 #include <linux/version.h>
5018 int main(void) {
5019 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5020 #error kernel headers too old, need 2.6.22
5021 #endif
5022 struct v4l2_ext_controls ctrls;
5023 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5024 return 0;
5027 _v4l2=no
5028 cc_check && _v4l2=yes
5030 if test "$_v4l2" = yes ; then
5031 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5032 vomodules="v4l2 $vomodules"
5033 aomodules="v4l2 $aomodules"
5034 else
5035 def_v4l2='#undef CONFIG_V4L2_DECODER'
5036 novomodules="v4l2 $novomodules"
5037 noaomodules="v4l2 $noaomodules"
5039 echores "$_v4l2"
5043 #########
5044 # AUDIO #
5045 #########
5048 echocheck "OSS Audio"
5049 if test "$_ossaudio" = auto ; then
5050 cat > $TMPC << EOF
5051 #include <$_soundcard_header>
5052 int main(void) { return SNDCTL_DSP_SETFRAGMENT; }
5054 _ossaudio=no
5055 cc_check && _ossaudio=yes
5057 if test "$_ossaudio" = yes ; then
5058 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5059 aomodules="oss $aomodules"
5060 cat > $TMPC << EOF
5061 #include <$_soundcard_header>
5062 #ifdef OPEN_SOUND_SYSTEM
5063 int main(void) { return 0; }
5064 #else
5065 #error Not the real thing
5066 #endif
5068 _real_ossaudio=no
5069 cc_check && _real_ossaudio=yes
5070 if test "$_real_ossaudio" = yes; then
5071 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5072 # Check for OSS4 headers (override default headers)
5073 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
5074 if test -f /etc/oss.conf; then
5075 . /etc/oss.conf
5076 _ossinc="$OSSLIBDIR/include"
5077 if test -f "$_ossinc/sys/soundcard.h"; then
5078 extra_cflags="-I$_ossinc $extra_cflags"
5081 elif netbsd || openbsd ; then
5082 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5083 extra_ldflags="$extra_ldflags -lossaudio"
5084 else
5085 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5087 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5088 else
5089 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5090 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5091 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5092 noaomodules="oss $noaomodules"
5094 echores "$_ossaudio"
5097 echocheck "aRts"
5098 if test "$_arts" = auto ; then
5099 _arts=no
5100 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5101 statement_check artsc.h 'arts_init()' $(artsc-config --libs) $(artsc-config --cflags) &&
5102 _arts=yes
5106 if test "$_arts" = yes ; then
5107 def_arts='#define CONFIG_ARTS 1'
5108 aomodules="arts $aomodules"
5109 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5110 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5111 else
5112 noaomodules="arts $noaomodules"
5114 echores "$_arts"
5117 echocheck "EsounD"
5118 if test "$_esd" = auto ; then
5119 _esd=no
5120 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5121 statement_check esd.h 'esd_open_sound("test")' $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5124 echores "$_esd"
5126 if test "$_esd" = yes ; then
5127 def_esd='#define CONFIG_ESD 1'
5128 aomodules="esd $aomodules"
5129 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5130 extra_cflags="$extra_cflags $(esd-config --cflags)"
5132 echocheck "esd_get_latency()"
5133 statement_check esd.h 'esd_get_latency(0)' $(esd-config --libs) $(esd-config --cflags) &&
5134 _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5135 echores "$_esd_latency"
5136 else
5137 def_esd='#undef CONFIG_ESD'
5138 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5139 noaomodules="esd $noaomodules"
5143 echocheck "NAS"
5144 if test "$_nas" = auto ; then
5145 _nas=no
5146 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
5148 if test "$_nas" = yes ; then
5149 def_nas='#define CONFIG_NAS 1'
5150 libs_mplayer="$libs_mplayer -laudio -lXt"
5151 aomodules="nas $aomodules"
5152 else
5153 noaomodules="nas $noaomodules"
5154 def_nas='#undef CONFIG_NAS'
5156 echores "$_nas"
5159 echocheck "pulse"
5160 if test "$_pulse" = auto ; then
5161 _pulse=no
5162 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5163 header_check pulse/pulseaudio.h $($_pkg_config --libs --cflags libpulse) &&
5164 _pulse=yes
5167 echores "$_pulse"
5169 if test "$_pulse" = yes ; then
5170 def_pulse='#define CONFIG_PULSE 1'
5171 aomodules="pulse $aomodules"
5172 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5173 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5174 else
5175 def_pulse='#undef CONFIG_PULSE'
5176 noaomodules="pulse $noaomodules"
5180 echocheck "JACK"
5181 if test "$_jack" = auto ; then
5182 _jack=yes
5183 if statement_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' -ljack ; then
5184 libs_mplayer="$libs_mplayer -ljack"
5185 elif statement_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' $($_pkg_config --libs --cflags --silence-errors jack) ; then
5186 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5187 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5188 else
5189 _jack=no
5193 if test "$_jack" = yes ; then
5194 def_jack='#define CONFIG_JACK 1'
5195 aomodules="jack $aomodules"
5196 else
5197 noaomodules="jack $noaomodules"
5199 echores "$_jack"
5201 echocheck "OpenAL"
5202 if test "$_openal" = auto ; then
5203 _openal=no
5204 cat > $TMPC << EOF
5205 #ifdef OPENAL_AL_H
5206 #include <OpenAL/al.h>
5207 #else
5208 #include <AL/al.h>
5209 #endif
5210 int main(void) {
5211 alSourceQueueBuffers(0, 0, 0);
5212 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5213 return 0;
5216 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5217 cc_check $I && _openal=yes && break
5218 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5219 done
5220 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5222 if test "$_openal" = yes ; then
5223 def_openal='#define CONFIG_OPENAL 1'
5224 aomodules="openal $aomodules"
5225 else
5226 noaomodules="openal $noaomodules"
5228 echores "$_openal"
5230 echocheck "ALSA audio"
5231 if test "$_alloca" != yes ; then
5232 _alsa=no
5233 res_comment="alloca missing"
5235 if test "$_alsa" != no ; then
5236 _alsa=no
5237 cat > $TMPC << EOF
5238 #include <sys/asoundlib.h>
5239 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5240 #error "alsa version != 0.5.x"
5241 #endif
5242 int main(void) { return 0; }
5244 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5246 cat > $TMPC << EOF
5247 #include <sys/asoundlib.h>
5248 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5249 #error "alsa version != 0.9.x"
5250 #endif
5251 int main(void) { return 0; }
5253 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5254 cat > $TMPC << EOF
5255 #include <alsa/asoundlib.h>
5256 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5257 #error "alsa version != 0.9.x"
5258 #endif
5259 int main(void) { return 0; }
5261 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5263 cat > $TMPC << EOF
5264 #include <sys/asoundlib.h>
5265 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5266 #error "alsa version != 1.0.x"
5267 #endif
5268 int main(void) { return 0; }
5270 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5271 cat > $TMPC << EOF
5272 #include <alsa/asoundlib.h>
5273 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5274 #error "alsa version != 1.0.x"
5275 #endif
5276 int main(void) { return 0; }
5278 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5280 def_alsa='#undef CONFIG_ALSA'
5281 def_alsa5='#undef CONFIG_ALSA5'
5282 def_alsa9='#undef CONFIG_ALSA9'
5283 def_alsa1x='#undef CONFIG_ALSA1X'
5284 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5285 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5286 if test "$_alsaver" ; then
5287 _alsa=yes
5288 if test "$_alsaver" = '0.5.x' ; then
5289 _alsa5=yes
5290 aomodules="alsa5 $aomodules"
5291 def_alsa5='#define CONFIG_ALSA5 1'
5292 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5293 res_comment="using alsa 0.5.x and sys/asoundlib.h"
5294 elif test "$_alsaver" = '0.9.x-sys' ; then
5295 _alsa9=yes
5296 aomodules="alsa $aomodules"
5297 def_alsa='#define CONFIG_ALSA 1'
5298 def_alsa9='#define CONFIG_ALSA9 1'
5299 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5300 res_comment="using alsa 0.9.x and sys/asoundlib.h"
5301 elif test "$_alsaver" = '0.9.x-alsa' ; then
5302 _alsa9=yes
5303 aomodules="alsa $aomodules"
5304 def_alsa='#define CONFIG_ALSA 1'
5305 def_alsa9='#define CONFIG_ALSA9 1'
5306 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5307 res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5308 elif test "$_alsaver" = '1.0.x-sys' ; then
5309 _alsa1x=yes
5310 aomodules="alsa $aomodules"
5311 def_alsa='#define CONFIG_ALSA 1'
5312 def_alsa1x="#define CONFIG_ALSA1X 1"
5313 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5314 res_comment="using alsa 1.0.x and sys/asoundlib.h"
5315 elif test "$_alsaver" = '1.0.x-alsa' ; then
5316 _alsa1x=yes
5317 aomodules="alsa $aomodules"
5318 def_alsa='#define CONFIG_ALSA 1'
5319 def_alsa1x="#define CONFIG_ALSA1X 1"
5320 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5321 res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5322 else
5323 _alsa=no
5324 res_comment="unknown version"
5326 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5327 else
5328 noaomodules="alsa $noaomodules"
5330 echores "$_alsa"
5333 echocheck "Sun audio"
5334 if test "$_sunaudio" = auto ; then
5335 cat > $TMPC << EOF
5336 #include <sys/types.h>
5337 #include <sys/audioio.h>
5338 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5340 _sunaudio=no
5341 cc_check && _sunaudio=yes
5343 if test "$_sunaudio" = yes ; then
5344 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5345 aomodules="sun $aomodules"
5346 else
5347 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5348 noaomodules="sun $noaomodules"
5350 echores "$_sunaudio"
5353 if darwin; then
5354 echocheck "CoreAudio"
5355 if test "$_coreaudio" = auto ; then
5356 cat > $TMPC <<EOF
5357 #include <CoreAudio/CoreAudio.h>
5358 #include <AudioToolbox/AudioToolbox.h>
5359 #include <AudioUnit/AudioUnit.h>
5360 int main(void) { return 0; }
5362 _coreaudio=no
5363 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5365 if test "$_coreaudio" = yes ; then
5366 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5367 def_coreaudio='#define CONFIG_COREAUDIO 1'
5368 aomodules="coreaudio $aomodules"
5369 else
5370 def_coreaudio='#undef CONFIG_COREAUDIO'
5371 noaomodules="coreaudio $noaomodules"
5373 echores $_coreaudio
5374 fi #if darwin
5377 if irix; then
5378 echocheck "SGI audio"
5379 if test "$_sgiaudio" = auto ; then
5380 _sgiaudio=no
5381 header_check dmedia/audio.h && _sgiaudio=yes
5383 if test "$_sgiaudio" = "yes" ; then
5384 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5385 libs_mplayer="$libs_mplayer -laudio"
5386 aomodules="sgi $aomodules"
5387 else
5388 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5389 noaomodules="sgi $noaomodules"
5391 echores "$_sgiaudio"
5392 fi #if irix
5395 if os2 ; then
5396 echocheck "KAI (UNIAUD/DART)"
5397 if test "$_kai" = auto; then
5398 _kai=no;
5399 header_check_broken os2.h kai.h -lkai && _kai=yes
5401 if test "$_kai" = yes ; then
5402 def_kai='#define CONFIG_KAI 1'
5403 libs_mplayer="$libs_mplayer -lkai"
5404 aomodules="kai $aomodules"
5405 else
5406 def_kai='#undef CONFIG_KAI'
5407 noaomodules="kai $noaomodules"
5409 echores "$_kai"
5411 echocheck "DART"
5412 if test "$_dart" = auto; then
5413 _dart=no;
5414 header_check_broken os2.h dart.h -ldart && _dart=yes
5416 if test "$_dart" = yes ; then
5417 def_dart='#define CONFIG_DART 1'
5418 libs_mplayer="$libs_mplayer -ldart"
5419 aomodules="dart $aomodules"
5420 else
5421 def_dart='#undef CONFIG_DART'
5422 noaomodules="dart $noaomodules"
5424 echores "$_dart"
5425 fi #if os2
5428 # set default CD/DVD devices
5429 if win32 || os2 ; then
5430 default_cdrom_device="D:"
5431 elif darwin ; then
5432 default_cdrom_device="/dev/disk1"
5433 elif dragonfly ; then
5434 default_cdrom_device="/dev/cd0"
5435 elif freebsd ; then
5436 default_cdrom_device="/dev/acd0"
5437 elif openbsd ; then
5438 default_cdrom_device="/dev/rcd0c"
5439 elif sunos ; then
5440 default_cdrom_device="/vol/dev/aliases/cdrom0"
5441 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5442 # file system and the volfs service.
5443 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5444 elif amigaos ; then
5445 default_cdrom_device="a1ide.device:2"
5446 else
5447 default_cdrom_device="/dev/cdrom"
5450 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5451 default_dvd_device=$default_cdrom_device
5452 elif darwin ; then
5453 default_dvd_device="/dev/rdiskN"
5454 else
5455 default_dvd_device="/dev/dvd"
5459 echocheck "VCD support"
5460 if test "$_vcd" = auto; then
5461 _vcd=no
5462 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
5463 _vcd=yes
5464 elif mingw32; then
5465 header_check ddk/ntddcdrm.h && _vcd=yes
5468 if test "$_vcd" = yes; then
5469 inputmodules="vcd $inputmodules"
5470 def_vcd='#define CONFIG_VCD 1'
5471 else
5472 def_vcd='#undef CONFIG_VCD'
5473 noinputmodules="vcd $noinputmodules"
5474 res_comment="not supported on this OS"
5476 echores "$_vcd"
5480 echocheck "Blu-ray support"
5481 if test "$_bluray" = auto ; then
5482 _bluray=no
5483 statement_check libbluray/bluray.h 'bd_get_title_info(0, 0)' -lbluray && _bluray=yes
5485 if test "$_bluray" = yes ; then
5486 def_bluray='#define CONFIG_LIBBLURAY 1'
5487 extra_ldflags="$extra_ldflags -lbluray"
5488 inputmodules="bluray $inputmodules"
5489 else
5490 def_bluray='#undef CONFIG_LIBBLURAY'
5491 noinputmodules="bluray $noinputmodules"
5493 echores "$_bluray"
5495 echocheck "dvdread"
5496 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5497 _dvdread_internal=no
5499 if test "$_dvdread_internal" = auto ; then
5500 _dvdread_internal=no
5501 _dvdread=no
5502 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5503 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5504 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5505 || darwin || win32 || os2; then
5506 _dvdread_internal=yes
5507 _dvdread=yes
5508 extra_cflags="-Ilibdvdread4 $extra_cflags"
5510 elif test "$_dvdread" = auto ; then
5511 _dvdread=no
5512 if test "$_dl" = yes; then
5513 _dvdreadcflags=$($_dvdreadconfig --cflags 2> /dev/null)
5514 _dvdreadlibs=$($_dvdreadconfig --libs 2> /dev/null)
5515 if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5516 _dvdread=yes
5517 extra_cflags="$extra_cflags $_dvdreadcflags"
5518 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5519 res_comment="external"
5524 if test "$_dvdread_internal" = yes; then
5525 def_dvdread='#define CONFIG_DVDREAD 1'
5526 inputmodules="dvdread(internal) $inputmodules"
5527 _largefiles=yes
5528 res_comment="internal"
5529 elif test "$_dvdread" = yes; then
5530 def_dvdread='#define CONFIG_DVDREAD 1'
5531 _largefiles=yes
5532 extra_ldflags="$extra_ldflags -ldvdread"
5533 inputmodules="dvdread(external) $inputmodules"
5534 res_comment="external"
5535 else
5536 def_dvdread='#undef CONFIG_DVDREAD'
5537 noinputmodules="dvdread $noinputmodules"
5539 echores "$_dvdread"
5542 echocheck "internal libdvdcss"
5543 if test "$_libdvdcss_internal" = auto ; then
5544 _libdvdcss_internal=no
5545 test "$_dvdread_internal" = yes && test -d libdvdcss && _libdvdcss_internal=yes
5546 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5548 if test "$_libdvdcss_internal" = yes ; then
5549 if linux || netbsd || openbsd || bsdos ; then
5550 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5551 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5552 elif freebsd || dragonfly ; then
5553 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5554 elif darwin ; then
5555 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5556 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5557 elif cygwin ; then
5558 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5559 elif beos ; then
5560 cflags_libdvdcss="-DSYS_BEOS"
5561 elif os2 ; then
5562 cflags_libdvdcss="-DSYS_OS2"
5564 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5565 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5566 inputmodules="libdvdcss(internal) $inputmodules"
5567 _largefiles=yes
5568 else
5569 noinputmodules="libdvdcss(internal) $noinputmodules"
5571 echores "$_libdvdcss_internal"
5574 echocheck "cdparanoia"
5575 if test "$_cdparanoia" = auto ; then
5576 cat > $TMPC <<EOF
5577 #include <cdda_interface.h>
5578 #include <cdda_paranoia.h>
5579 // This need a better test. How ?
5580 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5582 _cdparanoia=no
5583 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5584 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5585 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5586 done
5588 if test "$_cdparanoia" = yes ; then
5589 _cdda='yes'
5590 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5591 openbsd && extra_ldflags="$extra_ldflags -lutil"
5593 echores "$_cdparanoia"
5596 echocheck "libcdio"
5597 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5598 cat > $TMPC << EOF
5599 #include <stdio.h>
5600 #include <cdio/version.h>
5601 #include <cdio/cdda.h>
5602 #include <cdio/paranoia.h>
5603 int main(void) {
5604 void *test = cdda_verbose_set;
5605 printf("%s\n", CDIO_VERSION);
5606 return test == (void *)1;
5609 _libcdio=no
5610 for _ld_tmp in "" "-lwinmm" ; do
5611 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5612 cc_check $_ld_tmp $_ld_lm \
5613 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5614 done
5615 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5616 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
5617 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
5618 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5619 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5622 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5623 _cdda='yes'
5624 def_libcdio='#define CONFIG_LIBCDIO 1'
5625 def_havelibcdio='yes'
5626 else
5627 if test "$_cdparanoia" = yes ; then
5628 res_comment="using cdparanoia"
5630 def_libcdio='#undef CONFIG_LIBCDIO'
5631 def_havelibcdio='no'
5633 echores "$_libcdio"
5635 if test "$_cdda" = yes ; then
5636 test $_cddb = auto && test $networking = yes && _cddb=yes
5637 def_cdparanoia='#define CONFIG_CDDA 1'
5638 inputmodules="cdda $inputmodules"
5639 else
5640 def_cdparanoia='#undef CONFIG_CDDA'
5641 noinputmodules="cdda $noinputmodules"
5644 if test "$_cddb" = yes ; then
5645 def_cddb='#define CONFIG_CDDB 1'
5646 inputmodules="cddb $inputmodules"
5647 else
5648 _cddb=no
5649 def_cddb='#undef CONFIG_CDDB'
5650 noinputmodules="cddb $noinputmodules"
5653 echocheck "bitmap font support"
5654 if test "$_bitmap_font" = yes ; then
5655 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5656 else
5657 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5659 echores "$_bitmap_font"
5662 echocheck "freetype >= 2.0.9"
5664 # freetype depends on iconv
5665 if test "$_iconv" = no ; then
5666 _freetype=no
5667 res_comment="iconv support needed"
5670 if test "$_freetype" = auto ; then
5671 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5672 cat > $TMPC << EOF
5673 #include <stdio.h>
5674 #include <ft2build.h>
5675 #include FT_FREETYPE_H
5676 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5677 #error "Need FreeType 2.0.9 or newer"
5678 #endif
5679 int main(void) {
5680 FT_Library library;
5681 FT_Init_FreeType(&library);
5682 return 0;
5685 _freetype=no
5686 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
5687 else
5688 _freetype=no
5691 if test "$_freetype" = yes ; then
5692 def_freetype='#define CONFIG_FREETYPE 1'
5693 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
5694 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
5695 else
5696 def_freetype='#undef CONFIG_FREETYPE'
5698 echores "$_freetype"
5700 if test "$_freetype" = no ; then
5701 _fontconfig=no
5702 res_comment="FreeType support needed"
5704 echocheck "fontconfig"
5705 if test "$_fontconfig" = auto ; then
5706 cat > $TMPC << EOF
5707 #include <stdio.h>
5708 #include <stdlib.h>
5709 #include <fontconfig/fontconfig.h>
5710 #if FC_VERSION < 20402
5711 #error At least version 2.4.2 of fontconfig required
5712 #endif
5713 int main(void) {
5714 int err = FcInit();
5715 if (err == FcFalse) {
5716 printf("Couldn't initialize fontconfig lib\n");
5717 exit(err);
5719 return 0;
5722 _fontconfig=no
5723 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
5724 _ld_tmp="-lfontconfig $_ld_tmp"
5725 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5726 done
5727 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5728 _inc_tmp=$($_pkg_config --cflags fontconfig)
5729 _ld_tmp=$($_pkg_config --libs fontconfig)
5730 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5731 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5734 if test "$_fontconfig" = yes ; then
5735 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5736 else
5737 def_fontconfig='#undef CONFIG_FONTCONFIG'
5739 echores "$_fontconfig"
5742 echocheck "SSA/ASS support"
5743 if test "$_ass" = auto -o "$_ass" = yes ; then
5744 if $_pkg_config libass; then
5745 _ass=yes
5746 def_ass='#define CONFIG_ASS 1'
5747 extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
5748 extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
5749 else
5750 _ass=no
5751 def_ass='#undef CONFIG_ASS'
5753 else
5754 def_ass='#undef CONFIG_ASS'
5756 echores "$_ass"
5759 echocheck "fribidi with charsets"
5760 _inc_tmp=""
5761 _ld_tmp=""
5762 if test "$_fribidi" = auto ; then
5763 cat > $TMPC << EOF
5764 #include <stdlib.h>
5765 /* workaround for fribidi 0.10.4 and below */
5766 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5767 #include <fribidi/fribidi.h>
5768 int main(void) {
5769 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8)
5770 exit(1);
5771 return 0;
5774 _fribidi=no
5775 _inc_tmp=""
5776 _ld_tmp="-lfribidi"
5777 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5778 if $_pkg_config --exists fribidi > /dev/null 2>&1 &&
5779 test "$_fribidi" = no ; then
5780 _inc_tmp="$($_pkg_config --cflags)"
5781 _ld_tmp="$($_pkg_config --libs)"
5782 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
5785 if test "$_fribidi" = yes ; then
5786 def_fribidi='#define CONFIG_FRIBIDI 1'
5787 extra_cflags="$extra_cflags $_inc_tmp"
5788 extra_ldflags="$extra_ldflags $_ld_tmp"
5789 else
5790 def_fribidi='#undef CONFIG_FRIBIDI'
5792 echores "$_fribidi"
5795 echocheck "ENCA"
5796 if test "$_enca" = auto ; then
5797 _enca=no
5798 statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
5800 if test "$_enca" = yes ; then
5801 def_enca='#define CONFIG_ENCA 1'
5802 extra_ldflags="$extra_ldflags -lenca"
5803 else
5804 def_enca='#undef CONFIG_ENCA'
5806 echores "$_enca"
5809 echocheck "zlib"
5810 _zlib=no
5811 statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
5812 if test "$_zlib" = yes ; then
5813 def_zlib='#define CONFIG_ZLIB 1'
5814 extra_ldflags="$extra_ldflags -lz"
5815 else
5816 def_zlib='#define CONFIG_ZLIB 0'
5818 echores "$_zlib"
5821 echocheck "bzlib"
5822 bzlib=no
5823 def_bzlib='#define CONFIG_BZLIB 0'
5824 statement_check bzlib.h 'BZ2_bzlibVersion()' -lbz2 && bzlib=yes
5825 if test "$bzlib" = yes ; then
5826 def_bzlib='#define CONFIG_BZLIB 1'
5827 extra_ldflags="$extra_ldflags -lbz2"
5829 echores "$bzlib"
5832 echocheck "RTC"
5833 if test "$_rtc" = auto ; then
5834 cat > $TMPC << EOF
5835 #include <sys/ioctl.h>
5836 #ifdef __linux__
5837 #include <linux/rtc.h>
5838 #else
5839 #include <rtc.h>
5840 #define RTC_PIE_ON RTCIO_PIE_ON
5841 #endif
5842 int main(void) { return RTC_PIE_ON; }
5844 _rtc=no
5845 cc_check && _rtc=yes
5846 ppc && _rtc=no
5848 if test "$_rtc" = yes ; then
5849 def_rtc='#define HAVE_RTC 1'
5850 else
5851 def_rtc='#undef HAVE_RTC'
5853 echores "$_rtc"
5856 echocheck "liblzo2 support"
5857 if test "$_liblzo" = auto ; then
5858 _liblzo=no
5859 statement_check lzo/lzo1x.h 'lzo_init()' -llzo2 && _liblzo=yes
5861 if test "$_liblzo" = yes ; then
5862 def_liblzo='#define CONFIG_LIBLZO 1'
5863 extra_ldflags="$extra_ldflags -llzo2"
5864 codecmodules="liblzo $codecmodules"
5865 else
5866 def_liblzo='#undef CONFIG_LIBLZO'
5867 nocodecmodules="liblzo $nocodecmodules"
5869 echores "$_liblzo"
5872 echocheck "mad support"
5873 if test "$_mad" = auto ; then
5874 _mad=no
5875 header_check mad.h -lmad && _mad=yes
5877 if test "$_mad" = yes ; then
5878 def_mad='#define CONFIG_LIBMAD 1'
5879 extra_ldflags="$extra_ldflags -lmad"
5880 codecmodules="libmad $codecmodules"
5881 else
5882 def_mad='#undef CONFIG_LIBMAD'
5883 nocodecmodules="libmad $nocodecmodules"
5885 echores "$_mad"
5887 echocheck "OggVorbis support"
5888 if test "$_tremor_internal" = yes; then
5889 _libvorbis=no
5890 elif test "$_tremor" = auto; then
5891 _tremor=no
5892 statement_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
5894 if test "$_libvorbis" = auto; then
5895 _libvorbis=no
5896 statement_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes
5898 if test "$_tremor_internal" = yes ; then
5899 _vorbis=yes
5900 def_vorbis='#define CONFIG_OGGVORBIS 1'
5901 def_tremor='#define CONFIG_TREMOR 1'
5902 codecmodules="tremor(internal) $codecmodules"
5903 res_comment="internal Tremor"
5904 if test "$_tremor_low" = yes ; then
5905 cflags_tremor_low="-D_LOW_ACCURACY_"
5906 res_comment="internal low accuracy Tremor"
5908 elif test "$_tremor" = yes ; then
5909 _vorbis=yes
5910 def_vorbis='#define CONFIG_OGGVORBIS 1'
5911 def_tremor='#define CONFIG_TREMOR 1'
5912 codecmodules="tremor(external) $codecmodules"
5913 res_comment="external Tremor"
5914 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
5915 elif test "$_libvorbis" = yes ; then
5916 _vorbis=yes
5917 def_vorbis='#define CONFIG_OGGVORBIS 1'
5918 codecmodules="libvorbis $codecmodules"
5919 res_comment="libvorbis"
5920 extra_ldflags="$extra_ldflags -lvorbis -logg"
5921 else
5922 _vorbis=no
5923 nocodecmodules="libvorbis $nocodecmodules"
5925 echores "$_vorbis"
5927 echocheck "libspeex (version >= 1.1 required)"
5928 if test "$_speex" = auto ; then
5929 _speex=no
5930 cat > $TMPC << EOF
5931 #include <stddef.h>
5932 #include <speex/speex.h>
5933 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
5935 cc_check -lspeex $_ld_lm && _speex=yes
5937 if test "$_speex" = yes ; then
5938 def_speex='#define CONFIG_SPEEX 1'
5939 extra_ldflags="$extra_ldflags -lspeex"
5940 codecmodules="speex $codecmodules"
5941 else
5942 def_speex='#undef CONFIG_SPEEX'
5943 nocodecmodules="speex $nocodecmodules"
5945 echores "$_speex"
5947 echocheck "OggTheora support"
5948 if test "$_theora" = auto ; then
5949 _theora=no
5950 cat > $TMPC << EOF
5951 #include <theora/theora.h>
5952 #include <string.h>
5953 int main(void) {
5954 /* Theora is in flux, make sure that all interface routines and datatypes
5955 * exist and work the way we expect it, so we don't break MPlayer. */
5956 ogg_packet op;
5957 theora_comment tc;
5958 theora_info inf;
5959 theora_state st;
5960 yuv_buffer yuv;
5961 int r;
5962 double t;
5964 theora_info_init(&inf);
5965 theora_comment_init(&tc);
5967 return 0;
5969 /* we don't want to execute this kind of nonsense; just for making sure
5970 * that compilation works... */
5971 memset(&op, 0, sizeof(op));
5972 r = theora_decode_header(&inf, &tc, &op);
5973 r = theora_decode_init(&st, &inf);
5974 t = theora_granule_time(&st, op.granulepos);
5975 r = theora_decode_packetin(&st, &op);
5976 r = theora_decode_YUVout(&st, &yuv);
5977 theora_clear(&st);
5979 return 0;
5982 _ld_theora=$($_pkg_config --silence-errors --libs theora)
5983 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
5984 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
5985 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
5986 if test _theora = no; then
5987 _ld_theora="-ltheora -logg"
5988 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
5990 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5991 _ld_theora=$($_pkg_config --silence-errors --libs theora)
5992 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
5993 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
5994 extra_ldflags="$extra_ldflags $_ld_theora" &&
5995 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
5996 if test _theora = no; then
5997 _ld_theora="-ltheora -logg"
5998 cc_check tremor/bitwise.c $_ld_theora &&
5999 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6003 if test "$_theora" = yes ; then
6004 def_theora='#define CONFIG_OGGTHEORA 1'
6005 codecmodules="libtheora $codecmodules"
6006 # when --enable-theora is forced, we'd better provide a probably sane
6007 # $_ld_theora than nothing
6008 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6009 else
6010 def_theora='#undef CONFIG_OGGTHEORA'
6011 nocodecmodules="libtheora $nocodecmodules"
6013 echores "$_theora"
6015 echocheck "mp3lib support"
6016 if test "$_mp3lib" = auto ; then
6017 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6019 if test "$_mp3lib" = yes ; then
6020 def_mp3lib='#define CONFIG_MP3LIB 1'
6021 codecmodules="mp3lib(internal) $codecmodules"
6022 else
6023 def_mp3lib='#undef CONFIG_MP3LIB'
6024 nocodecmodules="mp3lib(internal) $nocodecmodules"
6026 echores "$_mp3lib"
6028 # Any version of libmpg123 shall be fine.
6029 echocheck "mpg123 support"
6030 def_mpg123='#undef CONFIG_MPG123'
6031 if test "$_mpg123" = auto; then
6032 _mpg123=no
6033 statement_check mpg123.h 'mpg123_init()' -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
6035 if test "$_mpg123" = yes ; then
6036 def_mpg123='#define CONFIG_MPG123 1'
6037 codecmodules="mpg123 $codecmodules"
6038 else
6039 nocodecmodules="mpg123 $nocodecmodules"
6041 echores "$_mpg123"
6043 echocheck "liba52 support"
6044 def_liba52='#undef CONFIG_LIBA52'
6045 if test "$_liba52" = auto ; then
6046 _liba52=no
6047 cat > $TMPC << EOF
6048 #include <inttypes.h>
6049 #include <a52dec/a52.h>
6050 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6052 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
6054 if test "$_liba52" = yes ; then
6055 def_liba52='#define CONFIG_LIBA52 1'
6056 codecmodules="liba52 $codecmodules"
6057 else
6058 nocodecmodules="liba52 $nocodecmodules"
6060 echores "$_liba52"
6062 echocheck "internal libmpeg2 support"
6063 if test "$_libmpeg2" = auto ; then
6064 _libmpeg2=yes
6065 if alpha && test cc_vendor=gnu; then
6066 case $cc_version in
6067 2*|3.0*|3.1*) # cannot compile MVI instructions
6068 _libmpeg2=no
6069 res_comment="broken gcc"
6071 esac
6074 if test "$_libmpeg2" = yes ; then
6075 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6076 codecmodules="libmpeg2(internal) $codecmodules"
6077 else
6078 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6079 nocodecmodules="libmpeg2(internal) $nocodecmodules"
6081 echores "$_libmpeg2"
6083 echocheck "libdca support"
6084 if test "$_libdca" = auto ; then
6085 _libdca=no
6086 for _ld_dca in -ldca -ldts ; do
6087 statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
6088 extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
6089 done
6091 if test "$_libdca" = yes ; then
6092 def_libdca='#define CONFIG_LIBDCA 1'
6093 codecmodules="libdca $codecmodules"
6094 else
6095 def_libdca='#undef CONFIG_LIBDCA'
6096 nocodecmodules="libdca $nocodecmodules"
6098 echores "$_libdca"
6100 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6101 if test "$_musepack" = auto ; then
6102 _musepack=no
6103 cat > $TMPC << EOF
6104 #include <stddef.h>
6105 #include <mpcdec/mpcdec.h>
6106 int main(void) {
6107 mpc_streaminfo info;
6108 mpc_decoder decoder;
6109 mpc_decoder_set_streaminfo(&decoder, &info);
6110 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6111 return 0;
6114 cc_check -lmpcdec $_ld_lm && _musepack=yes
6116 if test "$_musepack" = yes ; then
6117 def_musepack='#define CONFIG_MUSEPACK 1'
6118 extra_ldflags="$extra_ldflags -lmpcdec"
6119 codecmodules="musepack $codecmodules"
6120 else
6121 def_musepack='#undef CONFIG_MUSEPACK'
6122 nocodecmodules="musepack $nocodecmodules"
6124 echores "$_musepack"
6127 echocheck "FAAD2 support"
6128 if test "$_faad_internal" = auto ; then
6129 if x86_32 && test cc_vendor=gnu; then
6130 case $cc_version in
6131 3.1*|3.2) # ICE/insn with these versions
6132 _faad_internal=no
6133 res_comment="broken gcc"
6136 _faad=yes
6137 _faad_internal=yes
6139 esac
6140 else
6141 _faad=yes
6142 _faad_internal=yes
6145 if test "$_faad" = auto ; then
6146 cat > $TMPC << EOF
6147 #include <faad.h>
6148 #ifndef FAAD_MIN_STREAMSIZE
6149 #error Too old version
6150 #endif
6151 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6152 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6154 cc_check -lfaad $_ld_lm && _faad=yes
6157 def_faad='#undef CONFIG_FAAD'
6158 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6159 if test "$_faad_internal" = yes ; then
6160 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6161 res_comment="internal floating-point"
6162 if test "$_faad_fixed" = yes ; then
6163 # The FIXED_POINT implementation of FAAD2 improves performance
6164 # on some platforms, especially for SBR files.
6165 cflags_faad_fixed="-DFIXED_POINT"
6166 res_comment="internal fixed-point"
6168 elif test "$_faad" = yes ; then
6169 extra_ldflags="$extra_ldflags -lfaad"
6172 if test "$_faad" = yes ; then
6173 def_faad='#define CONFIG_FAAD 1'
6174 if test "$_faad_internal" = yes ; then
6175 codecmodules="faad2(internal) $codecmodules"
6176 else
6177 codecmodules="faad2 $codecmodules"
6179 else
6180 _faad=no
6181 nocodecmodules="faad2 $nocodecmodules"
6183 echores "$_faad"
6186 echocheck "LADSPA plugin support"
6187 if test "$_ladspa" = auto ; then
6188 _ladspa=no
6189 statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
6191 if test "$_ladspa" = yes; then
6192 def_ladspa="#define CONFIG_LADSPA 1"
6193 else
6194 def_ladspa="#undef CONFIG_LADSPA"
6196 echores "$_ladspa"
6199 echocheck "libbs2b audio filter support"
6200 if test "$_libbs2b" = auto ; then
6201 cat > $TMPC <<EOF
6202 #include <bs2b.h>
6203 #if BS2B_VERSION_MAJOR < 3
6204 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6205 #endif
6206 int main(void) {
6207 t_bs2bdp filter;
6208 filter=bs2b_open();
6209 bs2b_close(filter);
6210 return 0;
6213 _libbs2b=no
6214 if $_pkg_config --exists libbs2b ; then
6215 _inc_tmp=$($_pkg_config --cflags libbs2b)
6216 _ld_tmp=$($_pkg_config --libs libbs2b)
6217 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6218 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6219 else
6220 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6221 -I/usr/local/include/bs2b ; do
6222 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6223 extra_ldflags="$extra_ldflags -lbs2b"
6224 extra_cflags="$extra_cflags $_inc_tmp"
6225 _libbs2b=yes
6226 break
6228 done
6231 def_libbs2b="#undef CONFIG_LIBBS2B"
6232 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6233 echores "$_libbs2b"
6236 if test -z "$_codecsdir" ; then
6237 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6238 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6239 if test -d "$dir" ; then
6240 _codecsdir="$dir"
6241 break;
6243 done
6245 # Fall back on default directory.
6246 if test -z "$_codecsdir" ; then
6247 _codecsdir="$_libdir/codecs"
6248 mingw32 || os2 && _codecsdir="codecs"
6252 echocheck "Win32 codecs"
6253 if test "$_win32dll" = auto ; then
6254 _win32dll=no
6255 if x86_32 && ! qnx; then
6256 _win32dll=yes
6259 if test "$_win32dll" = yes ; then
6260 def_win32dll='#define CONFIG_WIN32DLL 1'
6261 if ! win32 ; then
6262 def_win32_loader='#define WIN32_LOADER 1'
6263 _win32_emulation=yes
6264 else
6265 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6266 res_comment="using native windows"
6268 codecmodules="win32 $codecmodules"
6269 else
6270 def_win32dll='#undef CONFIG_WIN32DLL'
6271 def_win32_loader='#undef WIN32_LOADER'
6272 nocodecmodules="win32 $nocodecmodules"
6274 echores "$_win32dll"
6277 echocheck "XAnim codecs"
6278 if test "$_xanim" = auto ; then
6279 _xanim=no
6280 res_comment="dynamic loader support needed"
6281 if test "$_dl" = yes ; then
6282 _xanim=yes
6285 if test "$_xanim" = yes ; then
6286 def_xanim='#define CONFIG_XANIM 1'
6287 codecmodules="xanim $codecmodules"
6288 else
6289 def_xanim='#undef CONFIG_XANIM'
6290 nocodecmodules="xanim $nocodecmodules"
6292 echores "$_xanim"
6295 echocheck "RealPlayer codecs"
6296 if test "$_real" = auto ; then
6297 _real=no
6298 res_comment="dynamic loader support needed"
6299 if test "$_dl" = yes || test "$_win32dll" = yes &&
6300 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
6301 _real=yes
6304 if test "$_real" = yes ; then
6305 def_real='#define CONFIG_REALCODECS 1'
6306 codecmodules="real $codecmodules"
6307 else
6308 def_real='#undef CONFIG_REALCODECS'
6309 nocodecmodules="real $nocodecmodules"
6311 echores "$_real"
6314 echocheck "QuickTime codecs"
6315 _qtx_emulation=no
6316 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6317 if test "$_qtx" = auto ; then
6318 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6320 if test "$_qtx" = yes ; then
6321 def_qtx='#define CONFIG_QTX_CODECS 1'
6322 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6323 codecmodules="qtx $codecmodules"
6324 darwin || win32 || _qtx_emulation=yes
6325 else
6326 def_qtx='#undef CONFIG_QTX_CODECS'
6327 nocodecmodules="qtx $nocodecmodules"
6329 echores "$_qtx"
6331 echocheck "Nemesi Streaming Media libraries"
6332 if test "$_nemesi" = auto && test "$networking" = yes ; then
6333 _nemesi=no
6334 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6335 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6336 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6337 _nemesi=yes
6340 if test "$_nemesi" = yes; then
6341 _native_rtsp=no
6342 def_nemesi='#define CONFIG_LIBNEMESI 1'
6343 inputmodules="nemesi $inputmodules"
6344 else
6345 _native_rtsp="$networking"
6346 _nemesi=no
6347 def_nemesi='#undef CONFIG_LIBNEMESI'
6348 noinputmodules="nemesi $noinputmodules"
6350 echores "$_nemesi"
6352 echocheck "LIVE555 Streaming Media libraries"
6353 if test "$_live" = auto && test "$networking" = yes ; then
6354 cat > $TMPCPP << EOF
6355 #include <liveMedia.hh>
6356 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6357 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6358 #endif
6359 int main(void) { return 0; }
6362 _live=no
6363 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
6364 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6365 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
6366 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6367 $_livelibdir/groupsock/libgroupsock.a \
6368 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6369 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6370 $extra_ldflags -lstdc++" \
6371 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6372 -I$_livelibdir/UsageEnvironment/include \
6373 -I$_livelibdir/BasicUsageEnvironment/include \
6374 -I$_livelibdir/groupsock/include" && \
6375 _live=yes && break
6376 done
6377 if test "$_live" != yes ; then
6378 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6379 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
6380 _live_dist=yes
6384 if test "$_live" = yes && test "$networking" = yes; then
6385 test $_livelibdir && res_comment="using $_livelibdir"
6386 def_live='#define CONFIG_LIVE555 1'
6387 inputmodules="live555 $inputmodules"
6388 elif test "$_live_dist" = yes && test "$networking" = yes; then
6389 res_comment="using distribution version"
6390 _live="yes"
6391 def_live='#define CONFIG_LIVE555 1'
6392 extra_ldflags="$extra_ldflags $ld_tmp"
6393 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6394 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6395 inputmodules="live555 $inputmodules"
6396 else
6397 _live=no
6398 def_live='#undef CONFIG_LIVE555'
6399 noinputmodules="live555 $noinputmodules"
6401 echores "$_live"
6405 all_ffmpeg_libs="libavutil libavcodec libavformat libswscale libpostproc"
6406 echocheck "FFmpeg ($all_ffmpeg_libs)"
6407 if test "$ffmpeg" = auto ; then
6408 ffmpeg=no
6409 if $_pkg_config --exists $all_ffmpeg_libs ; then
6410 inc_ffmpeg=$($_pkg_config --cflags $all_ffmpeg_libs)
6411 _ld_tmp=$($_pkg_config --libs $all_ffmpeg_libs)
6412 extra_ldflags="$extra_ldflags $_ld_tmp"
6413 extra_cflags="$extra_cflags $inc_ffmpeg"
6414 ffmpeg=yes
6415 elif header_check libavcore/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil $_ld_lm ; then
6416 extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil -lavcore"
6417 ffmpeg=yes
6421 ffmpeg_eval_api=no
6422 def_ffmpeg_eval_api="#undef CONFIG_FFMPEG_EVAL_API"
6423 if test "$ffmpeg" = yes; then
6424 def_ffmpeg='#define CONFIG_FFMPEG 1'
6425 codecmodules="ffmpeg $codecmodules"
6426 if $_pkg_config --atleast-version=50.18.0 libavutil ; then
6427 ffmpeg_eval_api=yes
6428 def_ffmpeg_eval_api="#define CONFIG_FFMPEG_EVAL_API 1"
6430 else
6431 def_ffmpeg='#undef CONFIG_FFMPEG'
6432 nocodecmodules="ffmpeg $nocodecmodules"
6434 echores "$ffmpeg"
6436 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
6437 if ! test -z "$_ffmpeg_source" ; then
6438 test "$ffmpeg" = yes && def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
6443 echocheck "libdv-0.9.5+"
6444 if test "$_libdv" = auto ; then
6445 _libdv=no
6446 statement_check libdv/dv.h 'dv_encoder_new(1, 1, 1)' -ldv $_ld_pthread $_ld_lm && _libdv=yes
6448 if test "$_libdv" = yes ; then
6449 def_libdv='#define CONFIG_LIBDV095 1'
6450 extra_ldflags="$extra_ldflags -ldv"
6451 codecmodules="libdv $codecmodules"
6452 else
6453 def_libdv='#undef CONFIG_LIBDV095'
6454 nocodecmodules="libdv $nocodecmodules"
6456 echores "$_libdv"
6459 echocheck "Xvid"
6460 if test "$_xvid" = auto ; then
6461 _xvid=no
6462 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6463 statement_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
6464 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
6465 done
6468 if test "$_xvid" = yes ; then
6469 def_xvid='#define CONFIG_XVID4 1'
6470 codecmodules="xvid $codecmodules"
6471 else
6472 def_xvid='#undef CONFIG_XVID4'
6473 nocodecmodules="xvid $nocodecmodules"
6475 echores "$_xvid"
6478 echocheck "libnut"
6479 if test "$_libnut" = auto ; then
6480 cat > $TMPC << EOF
6481 #include <libnut.h>
6482 nut_context_tt * nut;
6483 int main(void) { nut_error(0); return 0; }
6485 _libnut=no
6486 cc_check -lnut && _libnut=yes
6489 if test "$_libnut" = yes ; then
6490 def_libnut='#define CONFIG_LIBNUT 1'
6491 extra_ldflags="$extra_ldflags -lnut"
6492 else
6493 def_libnut='#undef CONFIG_LIBNUT'
6495 echores "$_libnut"
6497 # These VO checks must be done after the FFmpeg one
6498 echocheck "/dev/mga_vid"
6499 if test "$_mga" = auto ; then
6500 _mga=no
6501 test -c /dev/mga_vid && _mga=yes
6503 if test "$_mga" = yes ; then
6504 def_mga='#define CONFIG_MGA 1'
6505 vomodules="mga $vomodules"
6506 else
6507 def_mga='#undef CONFIG_MGA'
6508 novomodules="mga $novomodules"
6510 echores "$_mga"
6513 echocheck "xmga"
6514 if test "$_xmga" = auto ; then
6515 _xmga=no
6516 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
6518 if test "$_xmga" = yes ; then
6519 def_xmga='#define CONFIG_XMGA 1'
6520 vomodules="xmga $vomodules"
6521 else
6522 def_xmga='#undef CONFIG_XMGA'
6523 novomodules="xmga $novomodules"
6525 echores "$_xmga"
6527 echocheck "zr"
6528 if test "$_zr" = auto ; then
6529 #36067's seem to identify themselves as 36057PQC's, so the line
6530 #below should work for 36067's and 36057's.
6531 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
6532 _zr=yes
6533 else
6534 _zr=no
6537 if test "$_zr" = yes ; then
6538 if test "$ffmpeg_internals" = yes ; then
6539 def_zr='#define CONFIG_ZR 1'
6540 vomodules="zr zr2 $vomodules"
6541 else
6542 res_comment="FFmpeg internal headers are required by zr, sorry"
6543 novomodules="zr $novomodules"
6544 def_zr='#undef CONFIG_ZR'
6546 else
6547 def_zr='#undef CONFIG_ZR'
6548 novomodules="zr zr2 $novomodules"
6550 echores "$_zr"
6553 echocheck "UnRAR executable"
6554 if test "$_unrar_exec" = auto ; then
6555 _unrar_exec="yes"
6556 mingw32 && _unrar_exec="no"
6558 if test "$_unrar_exec" = yes ; then
6559 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
6560 else
6561 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
6563 echores "$_unrar_exec"
6565 echocheck "TV interface"
6566 if test "$_tv" = yes ; then
6567 def_tv='#define CONFIG_TV 1'
6568 inputmodules="tv $inputmodules"
6569 else
6570 noinputmodules="tv $noinputmodules"
6571 def_tv='#undef CONFIG_TV'
6573 echores "$_tv"
6576 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
6577 echocheck "*BSD BT848 bt8xx header"
6578 _ioctl_bt848_h=no
6579 for file in "machine/ioctl_bt848.h" \
6580 "dev/bktr/ioctl_bt848.h" \
6581 "dev/video/bktr/ioctl_bt848.h" \
6582 "dev/ic/bt8xx.h" ; do
6583 cat > $TMPC <<EOF
6584 #include <sys/types.h>
6585 #include <sys/ioctl.h>
6586 #include <$file>
6587 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
6589 if cc_check ; then
6590 _ioctl_bt848_h=yes
6591 _ioctl_bt848_h_name="$file"
6592 break;
6594 done
6595 if test "$_ioctl_bt848_h" = yes ; then
6596 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6597 res_comment="using $_ioctl_bt848_h_name"
6598 else
6599 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6601 echores "$_ioctl_bt848_h"
6603 echocheck "*BSD ioctl_meteor.h"
6604 _ioctl_meteor_h=no
6605 for file in "machine/ioctl_meteor.h" \
6606 "dev/bktr/ioctl_meteor.h" \
6607 "dev/video/bktr/ioctl_meteor.h" ; do
6608 cat > $TMPC <<EOF
6609 #include <sys/types.h>
6610 #include <$file>
6611 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
6613 if cc_check ; then
6614 _ioctl_meteor_h=yes
6615 _ioctl_meteor_h_name="$file"
6616 break;
6618 done
6619 if test "$_ioctl_meteor_h" = yes ; then
6620 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6621 res_comment="using $_ioctl_meteor_h_name"
6622 else
6623 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6625 echores "$_ioctl_meteor_h"
6627 echocheck "*BSD BrookTree 848 TV interface"
6628 if test "$_tv_bsdbt848" = auto ; then
6629 _tv_bsdbt848=no
6630 if test "$_tv" = yes ; then
6631 cat > $TMPC <<EOF
6632 #include <sys/types.h>
6633 $def_ioctl_meteor_h_name
6634 $def_ioctl_bt848_h_name
6635 #ifdef IOCTL_METEOR_H_NAME
6636 #include IOCTL_METEOR_H_NAME
6637 #endif
6638 #ifdef IOCTL_BT848_H_NAME
6639 #include IOCTL_BT848_H_NAME
6640 #endif
6641 int main(void) {
6642 ioctl(0, METEORSINPUT, 0);
6643 ioctl(0, TVTUNER_GETFREQ, 0);
6644 return 0;
6647 cc_check && _tv_bsdbt848=yes
6650 if test "$_tv_bsdbt848" = yes ; then
6651 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
6652 inputmodules="tv-bsdbt848 $inputmodules"
6653 else
6654 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
6655 noinputmodules="tv-bsdbt848 $noinputmodules"
6657 echores "$_tv_bsdbt848"
6658 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
6661 echocheck "DirectShow TV interface"
6662 if test "$_tv_dshow" = auto ; then
6663 _tv_dshow=no
6664 if test "$_tv" = yes && win32 ; then
6665 cat > $TMPC <<EOF
6666 #include <ole2.h>
6667 int main(void) {
6668 void* p;
6669 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6670 return 0;
6673 cc_check -lole32 -luuid && _tv_dshow=yes
6676 if test "$_tv_dshow" = yes ; then
6677 inputmodules="tv-dshow $inputmodules"
6678 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
6679 extra_ldflags="$extra_ldflags -lole32 -luuid"
6680 else
6681 noinputmodules="tv-dshow $noinputmodules"
6682 def_tv_dshow='#undef CONFIG_TV_DSHOW'
6684 echores "$_tv_dshow"
6687 echocheck "Video 4 Linux TV interface"
6688 if test "$_tv_v4l1" = auto ; then
6689 _tv_v4l1=no
6690 if test "$_tv" = yes && linux ; then
6691 header_check linux/videodev.h && _tv_v4l1=yes
6694 if test "$_tv_v4l1" = yes ; then
6695 _audio_input=yes
6696 _tv_v4l=yes
6697 def_tv_v4l='#define CONFIG_TV_V4L 1'
6698 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
6699 inputmodules="tv-v4l $inputmodules"
6700 else
6701 noinputmodules="tv-v4l1 $noinputmodules"
6702 def_tv_v4l='#undef CONFIG_TV_V4L'
6704 echores "$_tv_v4l1"
6707 echocheck "Video 4 Linux 2 TV interface"
6708 if test "$_tv_v4l2" = auto ; then
6709 _tv_v4l2=no
6710 if test "$_tv" = yes && linux ; then
6711 header_check linux/videodev2.h && _tv_v4l2=yes
6714 if test "$_tv_v4l2" = yes ; then
6715 _audio_input=yes
6716 _tv_v4l=yes
6717 def_tv_v4l='#define CONFIG_TV_V4L 1'
6718 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
6719 inputmodules="tv-v4l2 $inputmodules"
6720 else
6721 noinputmodules="tv-v4l2 $noinputmodules"
6722 def_tv_v4l2='#undef CONFIG_TV_V4L2'
6724 echores "$_tv_v4l2"
6727 echocheck "Radio interface"
6728 if test "$_radio" = yes ; then
6729 def_radio='#define CONFIG_RADIO 1'
6730 inputmodules="radio $inputmodules"
6731 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6732 _radio_capture=no
6734 if test "$_radio_capture" = yes ; then
6735 _audio_input=yes
6736 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
6737 else
6738 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6740 else
6741 noinputmodules="radio $noinputmodules"
6742 def_radio='#undef CONFIG_RADIO'
6743 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
6744 _radio_capture=no
6746 echores "$_radio"
6747 echocheck "Capture for Radio interface"
6748 echores "$_radio_capture"
6750 echocheck "Video 4 Linux 2 Radio interface"
6751 if test "$_radio_v4l2" = auto ; then
6752 _radio_v4l2=no
6753 if test "$_radio" = yes && linux ; then
6754 header_check linux/videodev2.h && _radio_v4l2=yes
6757 if test "$_radio_v4l2" = yes ; then
6758 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
6759 else
6760 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
6762 echores "$_radio_v4l2"
6764 echocheck "Video 4 Linux Radio interface"
6765 if test "$_radio_v4l" = auto ; then
6766 _radio_v4l=no
6767 if test "$_radio" = yes && linux ; then
6768 header_check linux/videodev.h && _radio_v4l=yes
6771 if test "$_radio_v4l" = yes ; then
6772 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
6773 else
6774 def_radio_v4l='#undef CONFIG_RADIO_V4L'
6776 echores "$_radio_v4l"
6778 if freebsd || netbsd || openbsd || dragonfly || bsdos \
6779 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6780 echocheck "*BSD BrookTree 848 Radio interface"
6781 _radio_bsdbt848=no
6782 cat > $TMPC <<EOF
6783 #include <sys/types.h>
6784 $def_ioctl_bt848_h_name
6785 #ifdef IOCTL_BT848_H_NAME
6786 #include IOCTL_BT848_H_NAME
6787 #endif
6788 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
6790 cc_check && _radio_bsdbt848=yes
6791 echores "$_radio_bsdbt848"
6792 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
6794 if test "$_radio_bsdbt848" = yes ; then
6795 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
6796 else
6797 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
6800 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6801 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6802 die "Radio driver requires BSD BT848, V4L or V4L2!"
6805 echocheck "Video 4 Linux 2 MPEG PVR interface"
6806 if test "$_pvr" = auto ; then
6807 _pvr=no
6808 if test "$_tv_v4l2" = yes && linux ; then
6809 cat > $TMPC <<EOF
6810 #include <linux/videodev2.h>
6811 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
6813 cc_check && _pvr=yes
6816 if test "$_pvr" = yes ; then
6817 def_pvr='#define CONFIG_PVR 1'
6818 inputmodules="pvr $inputmodules"
6819 else
6820 noinputmodules="pvr $noinputmodules"
6821 def_pvr='#undef CONFIG_PVR'
6823 echores "$_pvr"
6826 echocheck "ftp"
6827 if test "$_ftp" = "auto" ; then
6828 test "$networking" = "yes" && ! beos && _ftp=yes
6830 if test "$_ftp" = yes ; then
6831 def_ftp='#define CONFIG_FTP 1'
6832 inputmodules="ftp $inputmodules"
6833 else
6834 noinputmodules="ftp $noinputmodules"
6835 def_ftp='#undef CONFIG_FTP'
6837 echores "$_ftp"
6839 echocheck "vstream client"
6840 if test "$_vstream" = auto ; then
6841 _vstream=no
6842 cat > $TMPC <<EOF
6843 #include <vstream-client.h>
6844 void vstream_error(const char *format, ... ) {}
6845 int main(void) { vstream_start(); return 0; }
6847 cc_check -lvstream-client && _vstream=yes
6849 if test "$_vstream" = yes ; then
6850 def_vstream='#define CONFIG_VSTREAM 1'
6851 inputmodules="vstream $inputmodules"
6852 extra_ldflags="$extra_ldflags -lvstream-client"
6853 else
6854 noinputmodules="vstream $noinputmodules"
6855 def_vstream='#undef CONFIG_VSTREAM'
6857 echores "$_vstream"
6860 echocheck "OSD menu"
6861 if test "$_menu" = yes ; then
6862 def_menu='#define CONFIG_MENU 1'
6863 test $_dvbin = "yes" && _menu_dvbin=yes
6864 else
6865 def_menu='#undef CONFIG_MENU'
6866 _menu_dvbin=no
6868 echores "$_menu"
6871 echocheck "Subtitles sorting"
6872 if test "$_sortsub" = yes ; then
6873 def_sortsub='#define CONFIG_SORTSUB 1'
6874 else
6875 def_sortsub='#undef CONFIG_SORTSUB'
6877 echores "$_sortsub"
6880 echocheck "XMMS inputplugin support"
6881 if test "$_xmms" = yes ; then
6882 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6883 _xmmsplugindir=$(xmms-config --input-plugin-dir)
6884 _xmmslibdir=$(xmms-config --exec-prefix)/lib
6885 else
6886 _xmmsplugindir=/usr/lib/xmms/Input
6887 _xmmslibdir=/usr/lib
6890 def_xmms='#define CONFIG_XMMS 1'
6891 if darwin ; then
6892 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
6893 else
6894 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6896 else
6897 def_xmms='#undef CONFIG_XMMS'
6899 echores "$_xmms"
6901 if test "$_charset" != "noconv" ; then
6902 def_charset="#define MSG_CHARSET \"$_charset\""
6903 else
6904 def_charset="#undef MSG_CHARSET"
6905 _charset="UTF-8"
6908 #############################################################################
6910 echocheck "automatic gdb attach"
6911 if test "$_crash_debug" = yes ; then
6912 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
6913 else
6914 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
6915 _crash_debug=no
6917 echores "$_crash_debug"
6919 echocheck "compiler support for noexecstack"
6920 if cflag_check -Wl,-z,noexecstack ; then
6921 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
6922 echores "yes"
6923 else
6924 echores "no"
6927 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
6928 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
6929 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
6930 echores "yes"
6931 else
6932 echores "no"
6936 # Dynamic linking flags
6937 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6938 _ld_dl_dynamic=''
6939 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
6940 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
6941 _ld_dl_dynamic='-rdynamic'
6944 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6945 bsdos && extra_ldflags="$extra_ldflags -ldvd"
6946 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
6948 def_debug='#undef MP_DEBUG'
6949 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
6952 echocheck "joystick"
6953 def_joystick='#undef CONFIG_JOYSTICK'
6954 if test "$_joystick" = yes ; then
6955 if linux || freebsd ; then
6956 # TODO add some check
6957 def_joystick='#define CONFIG_JOYSTICK 1'
6958 else
6959 _joystick="no"
6960 res_comment="unsupported under $system_name"
6963 echores "$_joystick"
6965 echocheck "lirc"
6966 if test "$_lirc" = auto ; then
6967 _lirc=no
6968 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
6970 if test "$_lirc" = yes ; then
6971 def_lirc='#define CONFIG_LIRC 1'
6972 libs_mplayer="$libs_mplayer -llirc_client"
6973 else
6974 def_lirc='#undef CONFIG_LIRC'
6976 echores "$_lirc"
6978 echocheck "lircc"
6979 if test "$_lircc" = auto ; then
6980 _lircc=no
6981 header_check lirc/lircc.h -llircc && _lircc=yes
6983 if test "$_lircc" = yes ; then
6984 def_lircc='#define CONFIG_LIRCC 1'
6985 libs_mplayer="$libs_mplayer -llircc"
6986 else
6987 def_lircc='#undef CONFIG_LIRCC'
6989 echores "$_lircc"
6991 if arm; then
6992 # Detect maemo development platform libraries availability (http://www.maemo.org),
6993 # they are used when run on Nokia 770|8x0
6994 echocheck "maemo (Nokia 770|8x0)"
6995 if test "$_maemo" = auto ; then
6996 _maemo=no
6997 statement_check libosso.h 'osso_initialize('', '', 0, NULL)' $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
6999 if test "$_maemo" = yes ; then
7000 def_maemo='#define CONFIG_MAEMO 1'
7001 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
7002 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
7003 else
7004 def_maemo='#undef CONFIG_MAEMO'
7006 echores "$_maemo"
7009 #############################################################################
7011 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7012 # the OMF format needs to come after the 'extern symbol prefix' check, which
7013 # uses nm.
7014 if os2 ; then
7015 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7018 #############################################################################
7019 # 64 bit file offsets?
7020 if test "$_largefiles" = yes || freebsd ; then
7021 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7022 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7023 # dvdread support requires this (for off64_t)
7024 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7028 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
7030 # This must be the last test to be performed. Any other tests following it
7031 # could fail due to linker errors. libdvdnavmini is intentionally not linked
7032 # against libdvdread (to permit MPlayer to use its own copy of the library).
7033 # So any compilation using the flags added here but not linking against
7034 # libdvdread can fail.
7035 echocheck "DVD support (libdvdnav)"
7036 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
7037 _dvdnav=no
7039 dvdnav_internal=no
7040 if test "$_dvdnav" = auto ; then
7041 if test "$_dvdread_internal" = yes ; then
7042 _dvdnav=yes
7043 dvdnav_internal=yes
7044 res_comment="internal"
7045 else
7046 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7049 if test "$_dvdnav" = auto ; then
7050 _dvdnav=no
7051 _dvdnavdir=$($_dvdnavconfig --cflags)
7052 _dvdnavlibs=$($_dvdnavconfig --libs)
7053 statement_check_broken stdint.h dvdnav/dvdnav.h 'dvdnav_t *dvd = 0' $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7055 if test "$_dvdnav" = yes ; then
7056 _largefiles=yes
7057 def_dvdnav='#define CONFIG_DVDNAV 1'
7058 if test "$dvdnav_internal" = yes ; then
7059 cflags_libdvdnav="-Ilibdvdnav"
7060 inputmodules="dvdnav(internal) $inputmodules"
7061 else
7062 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
7063 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
7064 inputmodules="dvdnav $inputmodules"
7066 else
7067 def_dvdnav='#undef CONFIG_DVDNAV'
7068 noinputmodules="dvdnav $noinputmodules"
7070 echores "$_dvdnav"
7072 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
7073 # Read dvdnav comment above.
7075 mak_enable () {
7076 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7077 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7078 nprefix=$3;
7079 for part in $list; do
7080 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7081 echo "${nprefix}_$part = yes"
7083 done
7086 #############################################################################
7087 echo "Creating config.mak"
7088 cat > config.mak << EOF
7089 # -------- Generated by configure -----------
7091 # Ensure that locale settings do not interfere with shell commands.
7092 export LC_ALL = C
7094 CONFIGURATION = $configuration
7096 CHARSET = $_charset
7097 DOC_LANGS = $language_doc
7098 DOC_LANG_ALL = $doc_lang_all
7099 MAN_LANGS = $language_man
7100 MAN_LANG_ALL = $man_lang_all
7101 MSG_LANGS = $language_msg
7102 MSG_LANG_ALL = $msg_lang_all
7104 prefix = \$(DESTDIR)$_prefix
7105 BINDIR = \$(DESTDIR)$_bindir
7106 DATADIR = \$(DESTDIR)$_datadir
7107 LIBDIR = \$(DESTDIR)$_libdir
7108 MANDIR = \$(DESTDIR)$_mandir
7109 CONFDIR = \$(DESTDIR)$_confdir
7110 LOCALEDIR = \$(DESTDIR)$_localedir
7112 AR = $_ar
7113 AS = $_cc
7114 CC = $_cc
7115 CXX = $_cc
7116 HOST_CC = $_host_cc
7117 INSTALL = $_install
7118 INSTALLSTRIP = $_install_strip
7119 WINDRES = $_windres
7121 CFLAGS = $WARNFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
7122 CXXFLAGS = $WARNFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
7123 DEPFLAGS = $DEPFLAGS
7125 CFLAGS_DHAHELPER = $cflags_dhahelper
7126 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
7127 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
7128 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
7129 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
7130 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
7131 CFLAGS_STACKREALIGN = $cflags_stackrealign
7132 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
7133 CFLAGS_TREMOR_LOW = $cflags_tremor_low
7135 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
7136 EXTRALIBS_MPLAYER = $libs_mplayer
7138 GETCH = $_getch
7139 TIMER = $_timer
7141 EXESUF = $_exesuf
7142 EXESUFS_ALL = .exe
7144 ARCH = $arch
7145 $(mak_enable "$arch_all" "$arch" ARCH)
7146 $(mak_enable "$subarch_all" "$subarch" ARCH)
7147 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
7149 MPLAYER = $_mplayer
7151 NEED_GETTIMEOFDAY = $_need_gettimeofday
7152 NEED_GLOB = $_need_glob
7153 NEED_MMAP = $_need_mmap
7154 NEED_SETENV = $_need_setenv
7155 NEED_SHMEM = $_need_shmem
7156 NEED_STRSEP = $_need_strsep
7157 NEED_SWAB = $_need_swab
7158 NEED_VSSCANF = $_need_vsscanf
7160 # features
7161 3DFX = $_3dfx
7162 AA = $_aa
7163 ALSA1X = $_alsa1x
7164 ALSA9 = $_alsa9
7165 ALSA5 = $_alsa5
7166 APPLE_IR = $_apple_ir
7167 APPLE_REMOTE = $_apple_remote
7168 ARTS = $_arts
7169 AUDIO_INPUT = $_audio_input
7170 BITMAP_FONT = $_bitmap_font
7171 BL = $_bl
7172 CACA = $_caca
7173 CDDA = $_cdda
7174 CDDB = $_cddb
7175 COREAUDIO = $_coreaudio
7176 COREVIDEO = $_corevideo
7177 DART = $_dart
7178 DGA = $_dga
7179 DIRECT3D = $_direct3d
7180 DIRECTFB = $_directfb
7181 DIRECTX = $_directx
7182 DVBIN = $_dvbin
7183 DVDNAV = $_dvdnav
7184 DVDNAV_INTERNAL = $dvdnav_internal
7185 DVDREAD = $_dvdread
7186 DVDREAD_INTERNAL = $_dvdread_internal
7187 DXR2 = $_dxr2
7188 DXR3 = $_dxr3
7189 ESD = $_esd
7190 FAAD = $_faad
7191 FAAD_INTERNAL = $_faad_internal
7192 FASTMEMCPY = $_fastmemcpy
7193 FBDEV = $_fbdev
7194 FREETYPE = $_freetype
7195 FTP = $_ftp
7196 GIF = $_gif
7197 GGI = $_ggi
7198 GL = $_gl
7199 GL_WIN32 = $_gl_win32
7200 GL_X11 = $_gl_x11
7201 GL_SDL = $_gl_sdl
7202 MATRIXVIEW = $matrixview
7203 HAVE_POSIX_SELECT = $_posix_select
7204 HAVE_SYS_MMAN_H = $_mman
7205 IVTV = $_ivtv
7206 JACK = $_jack
7207 JOYSTICK = $_joystick
7208 JPEG = $_jpeg
7209 KAI = $_kai
7210 KVA = $_kva
7211 LADSPA = $_ladspa
7212 LIBA52 = $_liba52
7213 LIBASS = $_ass
7214 LIBBLURAY = $_bluray
7215 LIBBS2B = $_libbs2b
7216 LIBDCA = $_libdca
7217 LIBDV = $_libdv
7218 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7219 LIBLZO = $_liblzo
7220 LIBMAD = $_mad
7221 LIBMENU = $_menu
7222 LIBMENU_DVBIN = $_menu_dvbin
7223 LIBMPEG2 = $_libmpeg2
7224 LIBNEMESI = $_nemesi
7225 LIBNUT = $_libnut
7226 LIBSMBCLIENT = $_smb
7227 LIBTHEORA = $_theora
7228 LIRC = $_lirc
7229 LIVE555 = $_live
7230 MACOSX_FINDER = $_macosx_finder
7231 MD5SUM = $_md5sum
7232 MGA = $_mga
7233 MNG = $_mng
7234 MP3LIB = $_mp3lib
7235 MPG123 = $_mpg123
7236 MUSEPACK = $_musepack
7237 NAS = $_nas
7238 NATIVE_RTSP = $_native_rtsp
7239 NETWORKING = $networking
7240 OPENAL = $_openal
7241 OSS = $_ossaudio
7242 PE_EXECUTABLE = $_pe_executable
7243 PNG = $_png
7244 PNM = $_pnm
7245 PRIORITY = $_priority
7246 PULSE = $_pulse
7247 PVR = $_pvr
7248 QTX_CODECS = $_qtx
7249 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7250 QTX_EMULATION = $_qtx_emulation
7251 QUARTZ = $_quartz
7252 RADIO=$_radio
7253 RADIO_CAPTURE=$_radio_capture
7254 REAL_CODECS = $_real
7255 S3FB = $_s3fb
7256 SDL = $_sdl
7257 SPEEX = $_speex
7258 STREAM_CACHE = $_stream_cache
7259 SGIAUDIO = $_sgiaudio
7260 SUNAUDIO = $_sunaudio
7261 SVGA = $_svga
7262 TDFXFB = $_tdfxfb
7263 TDFXVID = $_tdfxvid
7264 TGA = $_tga
7265 TREMOR_INTERNAL = $_tremor_internal
7266 TV = $_tv
7267 TV_BSDBT848 = $_tv_bsdbt848
7268 TV_DSHOW = $_tv_dshow
7269 TV_V4L = $_tv_v4l
7270 TV_V4L1 = $_tv_v4l1
7271 TV_V4L2 = $_tv_v4l2
7272 UNRAR_EXEC = $_unrar_exec
7273 V4L2 = $_v4l2
7274 VCD = $_vcd
7275 VDPAU = $_vdpau
7276 VESA = $_vesa
7277 VIDIX = $_vidix
7278 VIDIX_PCIDB = $_vidix_pcidb_val
7279 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7280 VIDIX_IVTV=$_vidix_drv_ivtv
7281 VIDIX_MACH64=$_vidix_drv_mach64
7282 VIDIX_MGA=$_vidix_drv_mga
7283 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7284 VIDIX_NVIDIA=$_vidix_drv_nvidia
7285 VIDIX_PM2=$_vidix_drv_pm2
7286 VIDIX_PM3=$_vidix_drv_pm3
7287 VIDIX_RADEON=$_vidix_drv_radeon
7288 VIDIX_RAGE128=$_vidix_drv_rage128
7289 VIDIX_S3=$_vidix_drv_s3
7290 VIDIX_SH_VEU=$_vidix_drv_sh_veu
7291 VIDIX_SIS=$_vidix_drv_sis
7292 VIDIX_UNICHROME=$_vidix_drv_unichrome
7293 VORBIS = $_vorbis
7294 VSTREAM = $_vstream
7295 WII = $_wii
7296 WIN32DLL = $_win32dll
7297 WIN32WAVEOUT = $_win32waveout
7298 WIN32_EMULATION = $_win32_emulation
7299 WINVIDIX = $winvidix
7300 X11 = $_x11
7301 XANIM_CODECS = $_xanim
7302 XMGA = $_xmga
7303 XMMS_PLUGINS = $_xmms
7304 XV = $_xv
7305 XVID4 = $_xvid
7306 XVIDIX = $xvidix
7307 XVMC = $_xvmc
7308 XVR100 = $_xvr100
7309 YUV4MPEG = $_yuv4mpeg
7310 ZR = $_zr
7312 # FFmpeg
7313 FFMPEG = $ffmpeg
7314 FFMPEG_EVAL_API = $ffmpeg_eval_api
7315 FFMPEG_INTERNALS = $ffmpeg_internals
7316 FFMPEG_SOURCE_PATH = $_ffmpeg_source
7318 RANLIB = $_ranlib
7319 YASM = $_yasm
7320 YASMFLAGS = $YASMFLAGS
7322 CONFIG_BZLIB = $bzlib
7323 CONFIG_VDPAU = $_vdpau
7324 CONFIG_XVMC = $_xvmc
7325 CONFIG_ZLIB = $_zlib
7327 HAVE_PTHREADS = $_pthreads
7328 HAVE_SHM = $_shm
7329 HAVE_W32THREADS = $_w32threads
7330 HAVE_YASM = $have_yasm
7334 #############################################################################
7336 ff_config_enable () {
7337 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7338 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7339 _nprefix=$3;
7340 test -z "$_nprefix" && _nprefix='CONFIG'
7341 for part in $list; do
7342 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7343 echo "#define ${_nprefix}_$part 1"
7344 else
7345 echo "#define ${_nprefix}_$part 0"
7347 done
7350 echo "Creating config.h"
7351 cat > $TMPH << EOF
7352 /*----------------------------------------------------------------------------
7353 ** This file has been automatically generated by configure any changes in it
7354 ** will be lost when you run configure again.
7355 ** Instead of modifying definitions here, use the --enable/--disable options
7356 ** of the configure script! See ./configure --help for details.
7357 *---------------------------------------------------------------------------*/
7359 #ifndef MPLAYER_CONFIG_H
7360 #define MPLAYER_CONFIG_H
7362 /* Undefine this if you do not want to select mono audio (left or right)
7363 with a stereo MPEG layer 2/3 audio stream. The command line option
7364 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7365 right-only), with 0 being the default.
7367 #define CONFIG_FAKE_MONO 1
7369 /* set up audio OUTBURST. Do not change this! */
7370 #define OUTBURST 512
7372 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7373 #undef FAST_OSD
7374 #undef FAST_OSD_TABLE
7376 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
7377 #define MPEG12_POSTPROC 1
7378 #define ATTRIBUTE_ALIGNED_MAX 16
7382 #define CONFIGURATION "$configuration"
7384 #define MPLAYER_DATADIR "$_datadir"
7385 #define MPLAYER_CONFDIR "$_confdir"
7386 #define MPLAYER_LIBDIR "$_libdir"
7387 #define MPLAYER_LOCALEDIR "$_localedir"
7389 $def_translation
7391 /* definitions needed by included libraries */
7392 #define HAVE_INTTYPES_H 1
7393 /* libmpeg2 + FFmpeg */
7394 $def_fast_inttypes
7395 /* libdvdcss */
7396 #define HAVE_ERRNO_H 1
7397 /* libdvdcss + libdvdread */
7398 #define HAVE_LIMITS_H 1
7399 /* libdvdcss + libfaad2 */
7400 #define HAVE_UNISTD_H 1
7401 /* libfaad2 + libdvdread */
7402 #define STDC_HEADERS 1
7403 #define HAVE_MEMCPY 1
7404 /* libfaad2 */
7405 #define HAVE_STDLIB_H 1
7406 #define HAVE_STRING_H 1
7407 #define HAVE_STRINGS_H 1
7408 #define HAVE_SYS_STAT_H 1
7409 #define HAVE_SYS_TYPES_H 1
7410 /* libdvdnav */
7411 #define READ_CACHE_TRACE 0
7412 /* libdvdread */
7413 #define HAVE_DLFCN_H 1
7414 $def_dvdcss
7417 /* system headers */
7418 $def_alloca_h
7419 $def_alsa_asoundlib_h
7420 $def_altivec_h
7421 $def_malloc_h
7422 $def_mman_h
7423 $def_mman_has_map_failed
7424 $def_soundcard_h
7425 $def_sys_asoundlib_h
7426 $def_sys_soundcard_h
7427 $def_sys_sysinfo_h
7428 $def_termios_h
7429 $def_termios_sys_h
7430 $def_winsock2_h
7433 /* system functions */
7434 $def_gethostbyname2
7435 $def_gettimeofday
7436 $def_glob
7437 $def_langinfo
7438 $def_lrintf
7439 $def_map_memalign
7440 $def_memalign
7441 $def_nanosleep
7442 $def_posix_select
7443 $def_select
7444 $def_setenv
7445 $def_setmode
7446 $def_shm
7447 $def_strsep
7448 $def_swab
7449 $def_sysi86
7450 $def_sysi86_iv
7451 $def_termcap
7452 $def_termios
7453 $def_vsscanf
7456 /* system-specific features */
7457 $def_asmalign_pot
7458 $def_builtin_expect
7459 $def_dl
7460 $def_dos_paths
7461 $def_extern_asm
7462 $def_extern_prefix
7463 $def_iconv
7464 $def_kstat
7465 $def_macosx_bundle
7466 $def_macosx_finder
7467 $def_maemo
7468 $def_named_asm_args
7469 $def_priority
7470 $def_quicktime
7471 $def_restrict_keyword
7472 $def_rtc
7473 $def_unrar_exec
7476 /* configurable options */
7477 $def_charset
7478 $def_crash_debug
7479 $def_debug
7480 $def_dynamic_plugins
7481 $def_fastmemcpy
7482 $def_menu
7483 $def_runtime_cpudetection
7484 $def_sighandler
7485 $def_sortsub
7486 $def_stream_cache
7487 $def_pthread_cache
7490 /* CPU stuff */
7491 #define __CPU__ $iproc
7492 $def_ebx_available
7493 $def_words_endian
7494 $def_bigendian
7495 $(ff_config_enable "$arch_all" "$arch" "ARCH")
7496 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
7497 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
7500 /* Blu-ray/DVD/VCD/CD */
7501 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
7502 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
7503 $def_bluray
7504 $def_bsdi_dvd
7505 $def_cddb
7506 $def_cdio
7507 $def_cdparanoia
7508 $def_cdrom
7509 $def_dvd
7510 $def_dvd_bsd
7511 $def_dvd_darwin
7512 $def_dvd_linux
7513 $def_dvd_openbsd
7514 $def_dvdio
7515 $def_dvdnav
7516 $def_dvdread
7517 $def_hpux_scsi_h
7518 $def_libcdio
7519 $def_sol_scsi_h
7520 $def_vcd
7523 /* codec libraries */
7524 $def_faad
7525 $def_faad_internal
7526 $def_liba52
7527 $def_libdca
7528 $def_libdv
7529 $def_liblzo
7530 $def_libmpeg2
7531 $def_mad
7532 $def_mp3lib
7533 $def_mpg123
7534 $def_musepack
7535 $def_speex
7536 $def_theora
7537 $def_tremor
7538 $def_vorbis
7539 $def_xvid
7540 $def_zlib
7542 $def_libnut
7545 /* binary codecs */
7546 $def_qtx
7547 $def_qtx_win32
7548 $def_real
7549 $def_win32_loader
7550 $def_win32dll
7551 $def_xanim
7552 $def_xmms
7553 #define BINARY_CODECS_PATH "$_codecsdir"
7554 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7557 /* Audio output drivers */
7558 $def_alsa
7559 $def_alsa1x
7560 $def_alsa5
7561 $def_alsa9
7562 $def_arts
7563 $def_coreaudio
7564 $def_dart
7565 $def_esd
7566 $def_esd_latency
7567 $def_jack
7568 $def_kai
7569 $def_nas
7570 $def_openal
7571 $def_openal_h
7572 $def_ossaudio
7573 $def_ossaudio_devdsp
7574 $def_ossaudio_devmixer
7575 $def_pulse
7576 $def_sgiaudio
7577 $def_sunaudio
7578 $def_win32waveout
7580 $def_ladspa
7581 $def_libbs2b
7584 /* input */
7585 $def_apple_ir
7586 $def_apple_remote
7587 $def_ioctl_bt848_h_name
7588 $def_ioctl_meteor_h_name
7589 $def_joystick
7590 $def_lirc
7591 $def_lircc
7592 $def_pvr
7593 $def_radio
7594 $def_radio_bsdbt848
7595 $def_radio_capture
7596 $def_radio_v4l
7597 $def_radio_v4l2
7598 $def_tv
7599 $def_tv_bsdbt848
7600 $def_tv_dshow
7601 $def_tv_v4l
7602 $def_tv_v4l1
7603 $def_tv_v4l2
7606 /* font stuff */
7607 $def_ass
7608 $def_bitmap_font
7609 $def_enca
7610 $def_fontconfig
7611 $def_freetype
7612 $def_fribidi
7615 /* networking */
7616 $def_closesocket
7617 $def_ftp
7618 $def_inet6
7619 $def_inet_aton
7620 $def_inet_pton
7621 $def_live
7622 $def_nemesi
7623 $def_networking
7624 $def_smb
7625 $def_socklen_t
7626 $def_vstream
7629 /* libvo options */
7630 $def_3dfx
7631 $def_aa
7632 $def_bl
7633 $def_caca
7634 $def_corevideo
7635 $def_dga
7636 $def_dga1
7637 $def_dga2
7638 $def_direct3d
7639 $def_directfb
7640 $def_directx
7641 $def_dvb
7642 $def_dvbin
7643 $def_dxr2
7644 $def_dxr3
7645 $def_fbdev
7646 $def_ggi
7647 $def_ggiwmh
7648 $def_gif
7649 $def_gif_4
7650 $def_gif_tvt_hack
7651 $def_gl
7652 $def_gl_win32
7653 $def_gl_x11
7654 $def_gl_sdl
7655 $def_matrixview
7656 $def_ivtv
7657 $def_jpeg
7658 $def_kva
7659 $def_md5sum
7660 $def_mga
7661 $def_mng
7662 $def_png
7663 $def_pnm
7664 $def_quartz
7665 $def_s3fb
7666 $def_sdl
7667 $def_sdl_sdl_h
7668 $def_svga
7669 $def_tdfxfb
7670 $def_tdfxvid
7671 $def_tga
7672 $def_v4l2
7673 $def_vdpau
7674 $def_vesa
7675 $def_vidix
7676 $def_vidix_drv_cyberblade
7677 $def_vidix_drv_ivtv
7678 $def_vidix_drv_mach64
7679 $def_vidix_drv_mga
7680 $def_vidix_drv_mga_crtc2
7681 $def_vidix_drv_nvidia
7682 $def_vidix_drv_pm3
7683 $def_vidix_drv_radeon
7684 $def_vidix_drv_rage128
7685 $def_vidix_drv_s3
7686 $def_vidix_drv_sh_veu
7687 $def_vidix_drv_sis
7688 $def_vidix_drv_unichrome
7689 $def_vidix_pfx
7690 $def_vm
7691 $def_wii
7692 $def_x11
7693 $def_xdpms
7694 $def_xf86keysym
7695 $def_xinerama
7696 $def_xmga
7697 $def_xss
7698 $def_xv
7699 $def_xvmc
7700 $def_xvr100
7701 $def_yuv4mpeg
7702 $def_zr
7705 /* FFmpeg */
7706 $def_ffmpeg
7707 $def_ffmpeg_eval_api
7708 $def_ffmpeg_internals
7710 $def_arpa_inet_h
7711 $def_bswap
7712 $def_bzlib
7713 $def_dcbzl
7714 $def_exp2
7715 $def_exp2f
7716 $def_fast_64bit
7717 $def_fast_unaligned
7718 $def_llrint
7719 $def_log2
7720 $def_log2f
7721 $def_lrint
7722 $def_memalign_hack
7723 $def_mkstemp
7724 $def_posix_memalign
7725 $def_pthreads
7726 $def_round
7727 $def_roundf
7728 $def_ten_operands
7729 $def_threads
7730 $def_truncf
7731 $def_xform_asm
7732 $def_yasm
7734 #define HAVE_INLINE_ASM 1
7736 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
7737 #ifndef MP_DEBUG
7738 #define HAVE_EBP_AVAILABLE 1
7739 #else
7740 #define HAVE_EBP_AVAILABLE 0
7741 #endif
7743 #endif /* MPLAYER_CONFIG_H */
7746 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
7747 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
7749 #############################################################################
7751 ./version.sh `$_cc -dumpversion`
7753 cat << EOF
7755 Config files successfully generated by ./configure $configuration !
7757 Install prefix: $_prefix
7758 Data directory: $_datadir
7759 Config direct.: $_confdir
7761 Byte order: $_byte_order
7762 Optimizing for: $_optimizing
7764 Languages:
7765 Messages (in addition to English): $language_msg
7766 Manual pages: $language_man
7767 Documentation: $language_doc
7769 Enabled optional drivers:
7770 Input: $inputmodules
7771 Codecs: $codecmodules
7772 Audio output: $aomodules
7773 Video output: $vomodules
7775 Disabled optional drivers:
7776 Input: $noinputmodules
7777 Codecs: $nocodecmodules
7778 Audio output: $noaomodules
7779 Video output: $novomodules
7781 'config.h' and 'config.mak' contain your configuration options.
7782 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7783 compile *** DO NOT REPORT BUGS if you tweak these files ***
7785 'make' will now compile MPlayer and 'make install' will install it.
7786 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7791 if test "$_mtrr" = yes ; then
7792 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$language_doc/video.html#mtrr)"
7793 echo
7796 if ! x86_32; then
7797 cat <<EOF
7798 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7799 operating system ($system_name). You may encounter a few files that cannot
7800 be played due to missing open source video/audio codec support.
7806 cat <<EOF
7807 Check $TMPLOG if you wonder why an autodetection failed (make sure
7808 development headers/packages are installed).
7810 NOTE: The --enable-* parameters unconditionally force options on, completely
7811 skipping autodetection. This behavior is unlike what you may be used to from
7812 autoconf-based configure scripts that can decide to override you. This greater
7813 level of control comes at a price. You may have to provide the correct compiler
7814 and linker flags yourself.
7815 If you used one of these options (except --enable-menu and similar ones that
7816 turn on internal features) and experience a compilation or linking failure,
7817 make sure you have passed the necessary compiler/linker flags to configure.
7819 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
7823 if test "$warn_cflags" = yes; then
7824 cat <<EOF
7826 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
7827 but:
7829 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
7831 It is strongly recommended to let MPlayer choose the correct CFLAGS!
7832 To do so, execute 'CFLAGS= ./configure <options>'
7837 # Last move:
7838 rm -rf "$mplayer_tmpdir"