Apply patch for oCERT #2008-013 / CVE-2008-3827
[mplayer/glamo.git] / configure
blob1eefd2080b340dcab1a5bfae1a709ef83ee129bc
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: check the cvs 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, here is a simple skeleton:
24 # echocheck "$feature"
25 # if "$_feature" = auto; then
26 # cat > $TMPC << EOF
27 # #include <feature.h>
28 # int main(void) { return 0; }
29 # EOF
30 # _feature=no
31 # cc_check && _feature=yes
32 # if test "$_feature" = yes ; then
33 # _def_feature='#define CONFIG_FEATURE 1'
34 # else
35 # _def_feature='#undef CONFIG_FEATURE'
36 # fi
37 # echores "$_feature"
39 # Furthermore you need to add the variable _feature to the list of default
40 # settings and set it to one of yes/no/auto. Also add appropriate
41 # --enable-feature/--disable-feature command line options.
42 # The results of the check should be written to config.h and config.mak
43 # at the end of this script. The variable names used for this should be
44 # uniform, i.e. if the option is named 'feature':
46 # _feature : should have a value of yes/no/auto
47 # _def_feature : '#define ... 1' or '#undef ...' for conditional compilation
48 # _ld_feature : '-L/path/dir -lfeature' GCC options
50 #############################################################################
52 # Prevent locale nonsense from breaking basic text processing utils
53 LC_ALL=C
54 export LC_ALL
56 # Store the configure line that was used
57 _configuration="$*"
59 # Prefer these macros to full length text !
60 # These macros only return an error code - NO display is done
61 compile_check() {
62 echo >> "$TMPLOG"
63 cat "$1" >> "$TMPLOG"
64 echo >> "$TMPLOG"
65 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
66 rm -f "$TMPEXE"
67 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
68 TMP="$?"
69 echo >> "$TMPLOG"
70 echo >> "$TMPLOG"
71 return "$TMP"
74 cc_check() {
75 compile_check $TMPC $@
78 cxx_check() {
79 compile_check $TMPCPP $@ -lstdc++
82 tmp_run() {
83 "$TMPEXE" >> "$TMPLOG" 2>&1
86 # Display error message, flushes tempfile, exit
87 die () {
88 echo
89 echo "Error: $@" >&2
90 echo >&2
91 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
92 echo "Check \"$TMPLOG\" if you do not understand why it failed."
93 exit 1
96 # OS test booleans functions
97 issystem() {
98 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
100 linux() { issystem "Linux" || issystem "uClinux" ; return "$?" ; }
101 sunos() { issystem "SunOS" ; return "$?" ; }
102 hpux() { issystem "HP-UX" ; return "$?" ; }
103 irix() { issystem "IRIX" ; return "$?" ; }
104 aix() { issystem "AIX" ; return "$?" ; }
105 cygwin() { issystem "CYGWIN" ; return "$?" ; }
106 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; }
107 netbsd() { issystem "NetBSD" ; return "$?" ; }
108 bsdos() { issystem "BSD/OS" ; return "$?" ; }
109 openbsd() { issystem "OpenBSD" ; return "$?" ; }
110 dragonfly() { issystem "DragonFly" ; return "$?" ; }
111 qnx() { issystem "QNX" ; return "$?" ; }
112 darwin() { issystem "Darwin" ; return "$?" ; }
113 gnu() { issystem "GNU" ; return "$?" ; }
114 mingw32() { issystem "MINGW32" ; return "$?" ; }
115 morphos() { issystem "MorphOS" ; return "$?" ; }
116 amigaos() { issystem "AmigaOS" ; return "$?" ; }
117 win32() { cygwin || mingw32 ; return "$?" ; }
118 beos() { issystem "BEOS" ; return "$?" ; }
119 os2() { issystem "OS/2" ; return "$?" ; }
121 # arch test boolean functions
122 # x86/x86pc is used by QNX
123 x86_32() {
124 case "$host_arch" in
125 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
126 *) return 1 ;;
127 esac
130 x86_64() {
131 case "$host_arch" in
132 x86_64|amd64) return 0 ;;
133 *) return 1 ;;
134 esac
137 x86() {
138 x86_32 || x86_64
141 ppc() {
142 case "$host_arch" in
143 ppc|ppc64|powerpc|powerpc64) return 0;;
144 *) return 1;;
145 esac
148 alpha() {
149 case "$host_arch" in
150 alpha) return 0;;
151 *) return 1;;
152 esac
155 arm() {
156 case "$host_arch" in
157 arm) return 0;;
158 *) return 1;;
159 esac
162 # Use this before starting a check
163 echocheck() {
164 echo "============ Checking for $@ ============" >> "$TMPLOG"
165 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
168 # Use this to echo the results of a check
169 echores() {
170 if test "$_res_comment" ; then
171 _res_comment="($_res_comment)"
173 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
174 echo "##########################################" >> "$TMPLOG"
175 echo "" >> "$TMPLOG"
176 echo "$@ $_res_comment"
177 _res_comment=""
179 #############################################################################
181 # Check how echo works in this /bin/sh
182 case `echo -n` in
183 -n) _echo_n= _echo_c='\c' ;; # SysV echo
184 *) _echo_n='-n ' _echo_c= ;; # BSD echo
185 esac
187 msg_lang_all=`echo help/help_mp-??.h help/help_mp-??_??.h | sed -e "s:help/help_mp-\(..\).h:\1:g" -e "s:help/help_mp-\(.....\).h:\1:g"`
188 man_lang_all=`echo DOCS/man/??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g"`
189 doc_lang_all=`echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g"`
191 show_help(){
192 cat << EOF
193 Usage: $0 [OPTIONS]...
195 Configuration:
196 -h, --help display this help and exit
198 Installation directories:
199 --prefix=DIR prefix directory for installation [/usr/local]
200 --bindir=DIR directory for installing binaries [PREFIX/bin]
201 --datadir=DIR directory for installing machine independent
202 data files (skins, etc) [PREFIX/share/mplayer]
203 --mandir=DIR directory for installing man pages [PREFIX/share/man]
204 --confdir=DIR directory for installing configuration files
205 [PREFIX/etc/mplayer]
206 --libdir=DIR directory for object code libraries [PREFIX/lib]
207 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
208 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
209 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
210 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
212 Optional features:
213 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
214 --disable-mplayer disable MPlayer compilation [enable]
215 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
216 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
217 --disable-largefiles disable support for files > 2GB [enable]
218 --enable-linux-devfs set default devices to devfs [disable]
219 --enable-termcap use termcap database for key codes [autodetect]
220 --enable-termios use termios database for key codes [autodetect]
221 --disable-iconv disable iconv for encoding conversion [autodetect]
222 --disable-langinfo do not use langinfo [autodetect]
223 --enable-lirc enable LIRC (remote control) support [autodetect]
224 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
225 --enable-joystick enable joystick support [disable]
226 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
227 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
228 --disable-vm disable X video mode extensions [autodetect]
229 --disable-xf86keysym disable support for multimedia keys [autodetect]
230 --enable-radio enable radio interface [disable]
231 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
232 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
233 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
234 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
235 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
236 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
237 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
238 --disable-tv-teletext disable TV teletext interface [autodetect]
239 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
240 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
241 --disable-network disable networking [enable]
242 --enable-winsock2_h enable winsock2_h [autodetect]
243 --enable-smb enable Samba (SMB) input [autodetect]
244 --enable-live enable LIVE555 Streaming Media [autodetect]
245 --enable-nemesi enable Nemesi Streaming Media [autodetect]
246 --disable-dvdnav disable libdvdnav [autodetect]
247 --disable-dvdread disable libdvdread [autodetect]
248 --disable-dvdread-internal disable internal libdvdread [autodetect]
249 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
250 --disable-cdparanoia disable cdparanoia [autodetect]
251 --disable-cddb disable cddb [autodetect]
252 --disable-bitmap-font disable bitmap font support [enable]
253 --disable-freetype disable FreeType 2 font rendering [autodetect]
254 --disable-fontconfig disable fontconfig font lookup [autodetect]
255 --disable-unrarexec disable using of UnRAR executable [enabled]
256 --enable-menu enable OSD menu (not DVD menu) [disabled]
257 --disable-sortsub disable subtitle sorting [enabled]
258 --enable-fribidi enable the FriBiDi libs [autodetect]
259 --disable-enca disable ENCA charset oracle library [autodetect]
260 --disable-macosx disable Mac OS X specific features [autodetect]
261 --disable-maemo disable maemo specific features [autodetect]
262 --enable-macosx-finder enable Mac OS X Finder invocation parameter
263 parsing [disabled]
264 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
265 --disable-inet6 disable IPv6 support [autodetect]
266 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
267 --disable-ftp disable FTP support [enabled]
268 --disable-vstream disable TiVo vstream client support [autodetect]
269 --disable-pthreads disable Posix threads support [autodetect]
270 --disable-w32threads disable Win32 threads support [autodetect]
271 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
272 --enable-rpath enable runtime linker path for extra libs [disabled]
274 Codecs:
275 --enable-gif enable GIF support [autodetect]
276 --enable-png enable PNG input/output support [autodetect]
277 --enable-jpeg enable JPEG input/output support [autodetect]
278 --enable-libcdio enable libcdio support [autodetect]
279 --enable-liblzo enable liblzo support [autodetect]
280 --disable-win32dll disable Win32 DLL support [enabled]
281 --disable-qtx disable QuickTime codecs support [enabled]
282 --disable-xanim disable XAnim codecs support [enabled]
283 --disable-real disable RealPlayer codecs support [enabled]
284 --disable-xvid disable Xvid [autodetect]
285 --disable-xvid-lavc disable Xvid in libavcodec [autodetect]
286 --disable-x264 disable x264 [autodetect]
287 --disable-x264-lavc disable x264 in libavcodec [autodetect]
288 --disable-libdirac-lavc disable Dirac in libavcodec [autodetect]
289 --disable-libschroedinger-lavc disable Dirac in libavcodec (Schroedinger
290 decoder) [autodetect]
291 --disable-libnut disable libnut [autodetect]
292 --disable-libavutil_a disable static libavutil [autodetect]
293 --disable-libavcodec_a disable static libavcodec [autodetect]
294 --disable-libavformat_a disable static libavformat [autodetect]
295 --disable-libpostproc_a disable static libpostproc [autodetect]
296 --disable-libswscale_a disable static libswscale [autodetect]
297 --disable-libavutil_so disable shared libavutil [autodetect]
298 --disable-libavcodec_so disable shared libavcodec [autodetect]
299 --disable-libavformat_so disable shared libavformat [autodetect]
300 --disable-libpostproc_so disable shared libpostproc [autodetect]
301 --disable-libswscale_so disable shared libswscale [autodetect]
302 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
303 in libavcodec [enabled]
304 --disable-tremor-internal disable internal Tremor [enabled]
305 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
306 --enable-tremor enable external Tremor [autodetect]
307 --disable-libvorbis disable libvorbis support [autodetect]
308 --disable-speex disable Speex support [autodetect]
309 --enable-theora enable OggTheora libraries [autodetect]
310 --enable-faad enable external FAAD2 (AAC) [autodetect]
311 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
312 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
313 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
314 --disable-faac-lavc disable support for FAAC in libavcodec [autodetect]
315 --disable-ladspa disable LADSPA plugin support [autodetect]
316 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
317 --disable-mad disable libmad (MPEG audio) support [autodetect]
318 --disable-mp3lame disable LAME MP3 encoding support [autodetect]
319 --disable-mp3lame-lavc disable LAME in libavcodec [autodetect]
320 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
321 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
322 --enable-xmms enable XMMS input plugin support [disabled]
323 --enable-libdca enable libdca support [autodetect]
324 --disable-mp3lib disable builtin mp3lib [enabled]
325 --disable-liba52 disable liba52 [autodetect]
326 --disable-liba52-internal disable builtin liba52 [autodetect]
327 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
328 --disable-musepack disable musepack support [autodetect]
329 --disable-libamr_nb disable libamr narrowband [autodetect]
330 --disable-libamr_wb disable libamr wideband [autodetect]
331 --disable-decoder=DECODER disable specified FFmpeg decoder
332 --enable-decoder=DECODER enable specified FFmpeg decoder
333 --disable-encoder=ENCODER disable specified FFmpeg encoder
334 --enable-encoder=ENCODER enable specified FFmpeg encoder
335 --disable-parser=PARSER disable specified FFmpeg parser
336 --enable-parser=PARSER enable specified FFmpeg parser
337 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
338 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
339 --disable-muxer=MUXER disable specified FFmpeg muxer
340 --enable-muxer=MUXER enable specified FFmpeg muxer
342 Video output:
343 --disable-vidix disable VIDIX [for x86 *nix]
344 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
345 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
346 nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome
347 --disable-vidix-pcidb disable VIDIX PCI device name database
348 --enable-dhahelper enable VIDIX dhahelper support
349 --enable-svgalib_helper enable VIDIX svgalib_helper support
350 --enable-gl enable OpenGL video output [autodetect]
351 --enable-dga2 enable DGA 2 support [autodetect]
352 --enable-dga1 enable DGA 1 support [autodetect]
353 --enable-vesa enable VESA video output [autodetect]
354 --enable-svga enable SVGAlib video output [autodetect]
355 --enable-sdl enable SDL video output [autodetect]
356 --enable-aa enable AAlib video output [autodetect]
357 --enable-caca enable CACA video output [autodetect]
358 --enable-ggi enable GGI video output [autodetect]
359 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
360 --enable-directx enable DirectX video output [autodetect]
361 --enable-dxr2 enable DXR2 video output [autodetect]
362 --enable-dxr3 enable DXR3/H+ video output [autodetect]
363 --enable-ivtv enable IVTV TV-Out video output [autodetect]
364 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
365 --enable-dvb enable DVB video output [autodetect]
366 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
367 --enable-mga enable mga_vid video output [autodetect]
368 --enable-xmga enable mga_vid X11 video output [autodetect]
369 --enable-xv enable Xv video output [autodetect]
370 --enable-xvmc enable XvMC acceleration [disable]
371 --enable-vm enable XF86VidMode support [autodetect]
372 --enable-xinerama enable Xinerama support [autodetect]
373 --enable-x11 enable X11 video output [autodetect]
374 --enable-xshape enable XShape support [autodetect]
375 --disable-xss disable screensaver support via xss [autodetect]
376 --enable-fbdev enable FBDev video output [autodetect]
377 --enable-mlib enable mediaLib video output (Solaris) [disable]
378 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
379 --enable-tdfxfb enable tdfxfb video output [disable]
380 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
381 --enable-wii enable Nintendo Wii/GameCube video output [disable]
382 --enable-directfb enable DirectFB video output [autodetect]
383 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
384 --enable-bl enable Blinkenlights video output [disable]
385 --enable-tdfxvid enable tdfx_vid video output [disable]
386 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
387 --disable-tga disable Targa video output [enable]
388 --disable-pnm disable PNM video output [enable]
389 --disable-md5sum disable md5sum video output [enable]
390 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
392 Audio output:
393 --disable-alsa disable ALSA audio output [autodetect]
394 --disable-ossaudio disable OSS audio output [autodetect]
395 --disable-arts disable aRts audio output [autodetect]
396 --disable-esd disable esd audio output [autodetect]
397 --disable-pulse disable Pulseaudio audio output [autodetect]
398 --disable-jack disable JACK audio output [autodetect]
399 --disable-openal disable OpenAL audio output [autodetect]
400 --disable-nas disable NAS audio output [autodetect]
401 --disable-sgiaudio disable SGI audio output [autodetect]
402 --disable-sunaudio disable Sun audio output [autodetect]
403 --disable-win32waveout disable Windows waveout audio output [autodetect]
404 --disable-select disable using select() on the audio device [enable]
406 Miscellaneous options:
407 --enable-runtime-cpudetection enable runtime CPU detection [disable]
408 --enable-cross-compile enable cross-compilation [autodetect]
409 --cc=COMPILER C compiler to build MPlayer [gcc]
410 --host-cc=COMPILER C compiler for tools needed while building [gcc]
411 --as=ASSEMBLER assembler to build MPlayer [as]
412 --ar=AR librarian to build MPlayer [ar]
413 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
414 --windres=WINDRES windres to build MPlayer [windres]
415 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
416 --enable-static build a statically linked binary
417 --charset=charset convert the console messages to this character set
418 --language=list a white space or comma separated list of languages for
419 translated man pages, the first language is used for
420 messages and the GUI (the environment variable
421 \$LINGUAS is also honored) [en]
422 (Available: all $msg_lang_all)
423 --with-install=PATH path to a custom install program
425 Advanced options:
426 --enable-mmx enable MMX [autodetect]
427 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
428 --enable-3dnow enable 3DNow! [autodetect]
429 --enable-3dnowext enable extended 3DNow! [autodetect]
430 --enable-sse enable SSE [autodetect]
431 --enable-sse2 enable SSE2 [autodetect]
432 --enable-ssse3 enable SSSE3 [autodetect]
433 --enable-shm enable shm [autodetect]
434 --enable-altivec enable AltiVec (PowerPC) [autodetect]
435 --enable-armv5te enable DSP extensions (ARM) [autodetect]
436 --enable-armv6 enable ARMv6 (ARM) [autodetect]
437 --enable-armvfp enable ARM VFP (ARM) [autodetect]
438 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
439 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
440 --enable-big-endian force byte order to big-endian [autodetect]
441 --enable-debug[=1-3] compile-in debugging information [disable]
442 --enable-profile compile-in profiling information [disable]
443 --disable-sighandler disable sighandler for crashes [enable]
444 --enable-crash-debug enable automatic gdb attach on crash [disable]
445 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
447 Use these options if autodetection fails (Options marked with (*) accept
448 multiple paths separated by ':'):
449 --extra-libs=FLAGS extra linker flags
450 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
451 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
452 --with-extraincdir=DIR extra header search paths in DIR (*)
453 --with-extralibdir=DIR extra linker search paths in DIR (*)
454 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
456 --with-freetype-config=PATH path to freetype-config
457 --with-fribidi-config=PATH path to fribidi-config
458 --with-glib-config=PATH path to glib*-config
459 --with-gtk-config=PATH path to gtk*-config
460 --with-sdl-config=PATH path to sdl*-config
461 --with-dvdnav-config=PATH path to dvdnav-config
462 --with-dvdread-config=PATH path to dvdread-config
464 This configure script is NOT autoconf-based, even though its output is similar.
465 It will try to autodetect all configuration options. If you --enable an option
466 it will be forcefully turned on, skipping autodetection. This can break
467 compilation, so you need to know what you are doing.
469 exit 0
470 } #show_help()
472 # GOTCHA: the variables below defines the default behavior for autodetection
473 # and have - unless stated otherwise - at least 2 states : yes no
474 # If autodetection is available then the third state is: auto
475 _mmx=auto
476 _3dnow=auto
477 _3dnowext=auto
478 _mmxext=auto
479 _sse=auto
480 _sse2=auto
481 _ssse3=auto
482 _cmov=auto
483 _fast_cmov=auto
484 _armv5te=auto
485 _armv6=auto
486 _armvfp=auto
487 _iwmmxt=auto
488 _mtrr=auto
489 _altivec=auto
490 _install=install
491 _ranlib=ranlib
492 _windres=windres
493 _cc=cc
494 _ar=ar
495 test "$CC" && _cc="$CC"
496 _as=auto
497 _runtime_cpudetection=no
498 _cross_compile=auto
499 _prefix="/usr/local"
500 _libavutil_a=auto
501 _libavutil_so=auto
502 _libavcodec_a=auto
503 _libamr_nb=auto
504 _libamr_wb=auto
505 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
506 _libavdecoders=` echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER// `
507 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
508 _libavencoders=` echo $_libavencoders_all | sed 's/ LIB[A-Z0-9_]*_ENCODER//g'`
509 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
510 _libavparsers=$_libavparsers_all
511 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
512 _libavbsfs=$_libavbsfs_all
513 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
514 _libavdemuxers=`echo $_libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/AVISYNTH_DEMUXER// `
515 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
516 _libavmuxers=`echo $_libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER// `
517 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
518 _libavcodec_so=auto
519 _libavformat_a=auto
520 _libavformat_so=auto
521 _libpostproc_a=auto
522 _libpostproc_so=auto
523 _libswscale_a=auto
524 _libswscale_so=auto
525 _libavcodec_mpegaudio_hp=yes
526 _mencoder=yes
527 _mplayer=yes
528 _x11=auto
529 _xshape=auto
530 _xss=auto
531 _dga1=auto
532 _dga2=auto
533 _xv=auto
534 _xvmc=no #auto when complete
535 _sdl=auto
536 _directx=auto
537 _win32waveout=auto
538 _nas=auto
539 _png=auto
540 _jpeg=auto
541 _pnm=yes
542 _md5sum=yes
543 _yuv4mpeg=yes
544 _gif=auto
545 _gl=auto
546 _ggi=auto
547 _ggiwmh=auto
548 _aa=auto
549 _caca=auto
550 _svga=auto
551 _vesa=auto
552 _fbdev=auto
553 _dvb=auto
554 _dvbhead=auto
555 _dxr2=auto
556 _dxr3=auto
557 _ivtv=auto
558 _v4l2=auto
559 _iconv=auto
560 _langinfo=auto
561 _rtc=auto
562 _ossaudio=auto
563 _arts=auto
564 _esd=auto
565 _pulse=auto
566 _jack=auto
567 _openal=auto
568 _libcdio=auto
569 _liblzo=auto
570 _mad=auto
571 _mp3lame=auto
572 _mp3lame_lavc=auto
573 _toolame=auto
574 _twolame=auto
575 _tremor=auto
576 _tremor_internal=yes
577 _tremor_low=no
578 _libvorbis=auto
579 _speex=auto
580 _theora=auto
581 _mp3lib=yes
582 _liba52=auto
583 _liba52_internal=auto
584 _libdca=auto
585 _libmpeg2=auto
586 _faad=auto
587 _faad_internal=auto
588 _faad_fixed=no
589 _faac=auto
590 _faac_lavc=auto
591 _ladspa=auto
592 _xmms=no
593 _dvdnav=auto
594 _dvdnavconfig=dvdnav-config
595 _dvdreadconfig=dvdread-config
596 _dvdread=auto
597 _dvdread_internal=auto
598 _libdvdcss_internal=auto
599 _xanim=auto
600 _real=auto
601 _live=auto
602 _nemesi=auto
603 _native_rtsp=yes
604 _xinerama=auto
605 _mga=auto
606 _xmga=auto
607 _vm=auto
608 _xf86keysym=auto
609 _mlib=no #broken, thus disabled
610 _sgiaudio=auto
611 _sunaudio=auto
612 _alsa=auto
613 _fastmemcpy=yes
614 _unrar_exec=auto
615 _win32dll=auto
616 _select=yes
617 _radio=no
618 _radio_capture=no
619 _radio_v4l=auto
620 _radio_v4l2=auto
621 _radio_bsdbt848=auto
622 _tv=yes
623 _tv_v4l1=auto
624 _tv_v4l2=auto
625 _tv_bsdbt848=auto
626 _tv_dshow=auto
627 _tv_teletext=auto
628 _pvr=auto
629 _network=yes
630 _winsock2_h=auto
631 _smb=auto
632 _vidix=auto
633 _vidix_pcidb=yes
634 _dhahelper=no
635 _svgalib_helper=no
636 _joystick=no
637 _xvid=auto
638 _xvid_lavc=auto
639 _x264=auto
640 _x264_lavc=auto
641 _libdirac_lavc=auto
642 _libschroedinger_lavc=auto
643 _libnut=auto
644 _lirc=auto
645 _lircc=auto
646 _apple_remote=auto
647 _apple_ir=auto
648 _gui=no
649 _gtk1=no
650 _termcap=auto
651 _termios=auto
652 _3dfx=no
653 _s3fb=no
654 _wii=no
655 _tdfxfb=no
656 _tdfxvid=no
657 _xvr100=auto
658 _tga=yes
659 _directfb=auto
660 _zr=auto
661 _bl=no
662 _largefiles=yes
663 #_language=en
664 _shm=auto
665 _linux_devfs=no
666 _charset="UTF-8"
667 _dynamic_plugins=no
668 _crash_debug=no
669 _sighandler=yes
670 _libdv=auto
671 _cdparanoia=auto
672 _cddb=auto
673 _big_endian=auto
674 _bitmap_font=yes
675 _freetype=auto
676 _fontconfig=auto
677 _menu=no
678 _qtx=auto
679 _macosx=auto
680 _maemo=auto
681 _macosx_finder=no
682 _macosx_bundle=auto
683 _sortsub=yes
684 _freetypeconfig='freetype-config'
685 _fribidi=auto
686 _fribidiconfig='fribidi-config'
687 _enca=auto
688 _inet6=auto
689 _gethostbyname2=auto
690 _ftp=yes
691 _musepack=auto
692 _vstream=auto
693 _pthreads=auto
694 _w32threads=auto
695 _ass=auto
696 _rpath=no
697 _asmalign_pot=auto
698 _stream_cache=yes
699 _def_stream_cache="#define CONFIG_STREAM_CACHE 1"
700 _need_shmem=yes
701 for ac_option do
702 case "$ac_option" in
703 --help|-help|-h)
704 show_help
706 --prefix=*)
707 _prefix=`echo $ac_option | cut -d '=' -f 2`
709 --bindir=*)
710 _bindir=`echo $ac_option | cut -d '=' -f 2`
712 --datadir=*)
713 _datadir=`echo $ac_option | cut -d '=' -f 2`
715 --mandir=*)
716 _mandir=`echo $ac_option | cut -d '=' -f 2`
718 --confdir=*)
719 _confdir=`echo $ac_option | cut -d '=' -f 2`
721 --libdir=*)
722 _libdir=`echo $ac_option | cut -d '=' -f 2`
724 --codecsdir=*)
725 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
727 --win32codecsdir=*)
728 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
730 --xanimcodecsdir=*)
731 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
733 --realcodecsdir=*)
734 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
736 --with-extraincdir=*)
737 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
739 --with-extralibdir=*)
740 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
743 --with-install=*)
744 _install=`echo $ac_option | cut -d '=' -f 2 `
746 --with-xvmclib=*)
747 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
750 --with-sdl-config=*)
751 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
753 --with-freetype-config=*)
754 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
756 --with-fribidi-config=*)
757 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
759 --with-gtk-config=*)
760 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
762 --with-glib-config=*)
763 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
765 --with-dvdnav-config=*)
766 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
768 --with-dvdread-config=*)
769 _dvdreadconfig=`echo $ac_option | cut -d '=' -f 2`
772 --extra-libs=*)
773 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
775 --extra-libs-mplayer=*)
776 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
778 --extra-libs-mencoder=*)
779 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
782 --target=*)
783 _target=`echo $ac_option | cut -d '=' -f 2`
785 --cc=*)
786 _cc=`echo $ac_option | cut -d '=' -f 2`
788 --host-cc=*)
789 _host_cc=`echo $ac_option | cut -d '=' -f 2`
791 --as=*)
792 _as=`echo $ac_option | cut -d '=' -f 2`
794 --ar=*)
795 _ar=`echo $ac_option | cut -d '=' -f 2`
797 --ranlib=*)
798 _ranlib=`echo $ac_option | cut -d '=' -f 2`
800 --windres=*)
801 _windres=`echo $ac_option | cut -d '=' -f 2`
803 --charset=*)
804 _charset=`echo $ac_option | cut -d '=' -f 2`
806 --language=*)
807 _language=`echo $ac_option | cut -d '=' -f 2`
810 --enable-static)
811 _ld_static='-static'
813 --disable-static)
814 _ld_static=''
816 --enable-profile)
817 _profile='-p'
819 --disable-profile)
820 _profile=
822 --enable-debug)
823 _debug='-g'
825 --enable-debug=*)
826 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
828 --disable-debug)
829 _debug=
831 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
832 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
833 --enable-cross-compile) _cross_compile=yes ;;
834 --disable-cross-compile) _cross_compile=no ;;
835 --enable-mencoder) _mencoder=yes ;;
836 --disable-mencoder) _mencoder=no ;;
837 --enable-mplayer) _mplayer=yes ;;
838 --disable-mplayer) _mplayer=no ;;
839 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
840 --disable-dynamic-plugins) _dynamic_plugins=no ;;
841 --enable-x11) _x11=yes ;;
842 --disable-x11) _x11=no ;;
843 --enable-xshape) _xshape=yes ;;
844 --disable-xshape) _xshape=no ;;
845 --enable-xss) _xss=yes ;;
846 --disable-xss) _xss=no ;;
847 --enable-xv) _xv=yes ;;
848 --disable-xv) _xv=no ;;
849 --enable-xvmc) _xvmc=yes ;;
850 --disable-xvmc) _xvmc=no ;;
851 --enable-sdl) _sdl=yes ;;
852 --disable-sdl) _sdl=no ;;
853 --enable-directx) _directx=yes ;;
854 --disable-directx) _directx=no ;;
855 --enable-win32waveout) _win32waveout=yes ;;
856 --disable-win32waveout) _win32waveout=no ;;
857 --enable-nas) _nas=yes ;;
858 --disable-nas) _nas=no ;;
859 --enable-png) _png=yes ;;
860 --disable-png) _png=no ;;
861 --enable-jpeg) _jpeg=yes ;;
862 --disable-jpeg) _jpeg=no ;;
863 --enable-pnm) _pnm=yes ;;
864 --disable-pnm) _pnm=no ;;
865 --enable-md5sum) _md5sum=yes ;;
866 --disable-md5sum) _md5sum=no ;;
867 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
868 --disable-yuv4mpeg) _yuv4mpeg=no ;;
869 --enable-gif) _gif=yes ;;
870 --disable-gif) _gif=no ;;
871 --enable-gl) _gl=yes ;;
872 --disable-gl) _gl=no ;;
873 --enable-ggi) _ggi=yes ;;
874 --disable-ggi) _ggi=no ;;
875 --enable-ggiwmh) _ggiwmh=yes ;;
876 --disable-ggiwmh) _ggiwmh=no ;;
877 --enable-aa) _aa=yes ;;
878 --disable-aa) _aa=no ;;
879 --enable-caca) _caca=yes ;;
880 --disable-caca) _caca=no ;;
881 --enable-svga) _svga=yes ;;
882 --disable-svga) _svga=no ;;
883 --enable-vesa) _vesa=yes ;;
884 --disable-vesa) _vesa=no ;;
885 --enable-fbdev) _fbdev=yes ;;
886 --disable-fbdev) _fbdev=no ;;
887 --enable-dvb) _dvb=yes ;;
888 --disable-dvb) _dvb=no ;;
889 --enable-dvbhead) _dvbhead=yes ;;
890 --disable-dvbhead) _dvbhead=no ;;
891 --enable-dxr2) _dxr2=yes ;;
892 --disable-dxr2) _dxr2=no ;;
893 --enable-dxr3) _dxr3=yes ;;
894 --disable-dxr3) _dxr3=no ;;
895 --enable-ivtv) _ivtv=yes ;;
896 --disable-ivtv) _ivtv=no ;;
897 --enable-v4l2) _v4l2=yes ;;
898 --disable-v4l2) _v4l2=no ;;
899 --enable-iconv) _iconv=yes ;;
900 --disable-iconv) _iconv=no ;;
901 --enable-langinfo) _langinfo=yes ;;
902 --disable-langinfo) _langinfo=no ;;
903 --enable-rtc) _rtc=yes ;;
904 --disable-rtc) _rtc=no ;;
905 --enable-libdv) _libdv=yes ;;
906 --disable-libdv) _libdv=no ;;
907 --enable-ossaudio) _ossaudio=yes ;;
908 --disable-ossaudio) _ossaudio=no ;;
909 --enable-arts) _arts=yes ;;
910 --disable-arts) _arts=no ;;
911 --enable-esd) _esd=yes ;;
912 --disable-esd) _esd=no ;;
913 --enable-pulse) _pulse=yes ;;
914 --disable-pulse) _pulse=no ;;
915 --enable-jack) _jack=yes ;;
916 --disable-jack) _jack=no ;;
917 --enable-openal) _openal=yes ;;
918 --disable-openal) _openal=no ;;
919 --enable-mad) _mad=yes ;;
920 --disable-mad) _mad=no ;;
921 --enable-mp3lame) _mp3lame=yes ;;
922 --disable-mp3lame) _mp3lame=no ;;
923 --enable-mp3lame-lavc) _mp3lame_lavc=yes ;;
924 --disable-mp3lame-lavc) _mp3lame_lavc=no ;;
925 --enable-toolame) _toolame=yes ;;
926 --disable-toolame) _toolame=no ;;
927 --enable-twolame) _twolame=yes ;;
928 --disable-twolame) _twolame=no ;;
929 --enable-libcdio) _libcdio=yes ;;
930 --disable-libcdio) _libcdio=no ;;
931 --enable-liblzo) _liblzo=yes ;;
932 --disable-liblzo) _liblzo=no ;;
933 --enable-libvorbis) _libvorbis=yes ;;
934 --disable-libvorbis) _libvorbis=no ;;
935 --enable-speex) _speex=yes ;;
936 --disable-speex) _speex=no ;;
937 --enable-tremor) _tremor=yes ;;
938 --disable-tremor) _tremor=no ;;
939 --enable-tremor-internal) _tremor_internal=yes ;;
940 --disable-tremor-internal) _tremor_internal=no ;;
941 --enable-tremor-low) _tremor_low=yes ;;
942 --disable-tremor-low) _tremor_low=no ;;
943 --enable-theora) _theora=yes ;;
944 --disable-theora) _theora=no ;;
945 --enable-mp3lib) _mp3lib=yes ;;
946 --disable-mp3lib) _mp3lib=no ;;
947 --enable-liba52-internal) _liba52_internal=yes ;;
948 --disable-liba52-internal) _liba52_internal=no ;;
949 --enable-liba52) _liba52=yes ;;
950 --disable-liba52) _liba52=no ;;
951 --enable-libdca) _libdca=yes ;;
952 --disable-libdca) _libdca=no ;;
953 --enable-libmpeg2) _libmpeg2=yes ;;
954 --disable-libmpeg2) _libmpeg2=no ;;
955 --enable-musepack) _musepack=yes ;;
956 --disable-musepack) _musepack=no ;;
957 --enable-faad) _faad=yes ;;
958 --disable-faad) _faad=no ;;
959 --enable-faad-internal) _faad_internal=yes ;;
960 --disable-faad-internal) _faad_internal=no ;;
961 --enable-faad-fixed) _faad_fixed=yes ;;
962 --disable-faad-fixed) _faad_fixed=no ;;
963 --enable-faac) _faac=yes ;;
964 --disable-faac) _faac=no ;;
965 --enable-faac-lavc) _faac_lavc=yes ;;
966 --disable-faac-lavc) _faac_lavc=no ;;
967 --enable-ladspa) _ladspa=yes ;;
968 --disable-ladspa) _ladspa=no ;;
969 --enable-xmms) _xmms=yes ;;
970 --disable-xmms) _xmms=no ;;
971 --enable-dvdread) _dvdread=yes ;;
972 --disable-dvdread) _dvdread=no ;;
973 --enable-dvdread-internal) _dvdread_internal=yes ;;
974 --disable-dvdread-internal) _dvdread_internal=no ;;
975 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
976 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
977 --enable-dvdnav) _dvdnav=yes ;;
978 --disable-dvdnav) _dvdnav=no ;;
979 --enable-xanim) _xanim=yes ;;
980 --disable-xanim) _xanim=no ;;
981 --enable-real) _real=yes ;;
982 --disable-real) _real=no ;;
983 --enable-live) _live=yes ;;
984 --disable-live) _live=no ;;
985 --enable-nemesi) _nemesi=yes ;;
986 --disable-nemesi) _nemesi=no ;;
987 --enable-xinerama) _xinerama=yes ;;
988 --disable-xinerama) _xinerama=no ;;
989 --enable-mga) _mga=yes ;;
990 --disable-mga) _mga=no ;;
991 --enable-xmga) _xmga=yes ;;
992 --disable-xmga) _xmga=no ;;
993 --enable-vm) _vm=yes ;;
994 --disable-vm) _vm=no ;;
995 --enable-xf86keysym) _xf86keysym=yes ;;
996 --disable-xf86keysym) _xf86keysym=no ;;
997 --enable-mlib) _mlib=yes ;;
998 --disable-mlib) _mlib=no ;;
999 --enable-sunaudio) _sunaudio=yes ;;
1000 --disable-sunaudio) _sunaudio=no ;;
1001 --enable-sgiaudio) _sgiaudio=yes ;;
1002 --disable-sgiaudio) _sgiaudio=no ;;
1003 --enable-alsa) _alsa=yes ;;
1004 --disable-alsa) _alsa=no ;;
1005 --enable-tv) _tv=yes ;;
1006 --disable-tv) _tv=no ;;
1007 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1008 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1009 --enable-tv-v4l1) _tv_v4l1=yes ;;
1010 --disable-tv-v4l1) _tv_v4l1=no ;;
1011 --enable-tv-v4l2) _tv_v4l2=yes ;;
1012 --disable-tv-v4l2) _tv_v4l2=no ;;
1013 --enable-tv-dshow) _tv_dshow=yes ;;
1014 --disable-tv-dshow) _tv_dshow=no ;;
1015 --enable-tv-teletext) _tv_teletext=yes ;;
1016 --disable-tv-teletext) _tv_teletext=no ;;
1017 --enable-radio) _radio=yes ;;
1018 --enable-radio-capture) _radio_capture=yes ;;
1019 --disable-radio-capture) _radio_capture=no ;;
1020 --disable-radio) _radio=no ;;
1021 --enable-radio-v4l) _radio_v4l=yes ;;
1022 --disable-radio-v4l) _radio_v4l=no ;;
1023 --enable-radio-v4l2) _radio_v4l2=yes ;;
1024 --disable-radio-v4l2) _radio_v4l2=no ;;
1025 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1026 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1027 --enable-pvr) _pvr=yes ;;
1028 --disable-pvr) _pvr=no ;;
1029 --enable-fastmemcpy) _fastmemcpy=yes ;;
1030 --disable-fastmemcpy) _fastmemcpy=no ;;
1031 --enable-network) _network=yes ;;
1032 --disable-network) _network=no ;;
1033 --enable-winsock2_h) _winsock2_h=yes ;;
1034 --disable-winsock2_h) _winsock2_h=no ;;
1035 --enable-smb) _smb=yes ;;
1036 --disable-smb) _smb=no ;;
1037 --enable-vidix) _vidix=yes ;;
1038 --disable-vidix) _vidix=no ;;
1039 --with-vidix-drivers=*)
1040 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
1042 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1043 --enable-dhahelper) _dhahelper=yes ;;
1044 --disable-dhahelper) _dhahelper=no ;;
1045 --enable-svgalib_helper) _svgalib_helper=yes ;;
1046 --disable-svgalib_helper) _svgalib_helper=no ;;
1047 --enable-joystick) _joystick=yes ;;
1048 --disable-joystick) _joystick=no ;;
1049 --enable-xvid) _xvid=yes ;;
1050 --disable-xvid) _xvid=no ;;
1051 --enable-xvid-lavc) _xvid_lavc=yes ;;
1052 --disable-xvid-lavc) _xvid_lavc=no ;;
1053 --enable-x264) _x264=yes ;;
1054 --disable-x264) _x264=no ;;
1055 --enable-x264-lavc) _x264_lavc=yes ;;
1056 --disable-x264-lavc) _x264_lavc=no ;;
1057 --enable-libdirac-lavc) _libdirac_lavc=yes ;;
1058 --disable-libdirac-lavc) _libdirac_lavc=no ;;
1059 --enable-libschroedinger-lavc) _libschroedinger_lavc=yes ;;
1060 --disable-libschroedinger-lavc) _libschroedinger_lavc=no ;;
1061 --enable-libnut) _libnut=yes ;;
1062 --disable-libnut) _libnut=no ;;
1063 --enable-libavutil_a) _libavutil_a=yes ;;
1064 --disable-libavutil_a) _libavutil_a=no ;;
1065 --enable-libavutil_so) _libavutil_so=yes ;;
1066 --disable-libavutil_so) _libavutil_so=no ;;
1067 --enable-libavcodec_a) _libavcodec_a=yes ;;
1068 --disable-libavcodec_a) _libavcodec_a=no ;;
1069 --enable-libavcodec_so) _libavcodec_so=yes ;;
1070 --disable-libavcodec_so) _libavcodec_so=no ;;
1071 --enable-libamr_nb) _libamr_nb=yes ;;
1072 --disable-libamr_nb) _libamr_nb=no ;;
1073 --enable-libamr_wb) _libamr_wb=yes ;;
1074 --disable-libamr_wb) _libamr_wb=no ;;
1075 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1076 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1077 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1078 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1079 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1080 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1081 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1082 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1083 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1084 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1085 --enable-libavformat_a) _libavformat_a=yes ;;
1086 --disable-libavformat_a) _libavformat_a=no ;;
1087 --enable-libavformat_so) _libavformat_so=yes ;;
1088 --disable-libavformat_so) _libavformat_so=no ;;
1089 --enable-libpostproc_a) _libpostproc_a=yes ;;
1090 --disable-libpostproc_a) _libpostproc_a=no ;;
1091 --enable-libpostproc_so) _libpostproc_so=yes ;;
1092 --disable-libpostproc_so) _libpostproc_so=no ;;
1093 --enable-libswscale_a) _libswscale_a=yes ;;
1094 --disable-libswscale_a) _libswscale_a=no ;;
1095 --enable-libswscale_so) _libswscale_so=yes ;;
1096 --disable-libswscale_so) _libswscale_so=no ;;
1097 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1098 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1100 --enable-lirc) _lirc=yes ;;
1101 --disable-lirc) _lirc=no ;;
1102 --enable-lircc) _lircc=yes ;;
1103 --disable-lircc) _lircc=no ;;
1104 --enable-apple-remote) _apple_remote=yes ;;
1105 --disable-apple-remote) _apple_remote=no ;;
1106 --enable-apple-ir) _apple_ir=yes ;;
1107 --disable-apple-ir) _apple_ir=no ;;
1108 --enable-gui) _gui=yes ;;
1109 --disable-gui) _gui=no ;;
1110 --enable-gtk1) _gtk1=yes ;;
1111 --disable-gtk1) _gtk1=no ;;
1112 --enable-termcap) _termcap=yes ;;
1113 --disable-termcap) _termcap=no ;;
1114 --enable-termios) _termios=yes ;;
1115 --disable-termios) _termios=no ;;
1116 --enable-3dfx) _3dfx=yes ;;
1117 --disable-3dfx) _3dfx=no ;;
1118 --enable-s3fb) _s3fb=yes ;;
1119 --disable-s3fb) _s3fb=no ;;
1120 --enable-wii) _wii=yes ;;
1121 --disable-wii) _wii=no ;;
1122 --enable-tdfxfb) _tdfxfb=yes ;;
1123 --disable-tdfxfb) _tdfxfb=no ;;
1124 --disable-tdfxvid) _tdfxvid=no ;;
1125 --enable-tdfxvid) _tdfxvid=yes ;;
1126 --disable-xvr100) _xvr100=no ;;
1127 --enable-xvr100) _xvr100=yes ;;
1128 --disable-tga) _tga=no ;;
1129 --enable-tga) _tga=yes ;;
1130 --enable-directfb) _directfb=yes ;;
1131 --disable-directfb) _directfb=no ;;
1132 --enable-zr) _zr=yes ;;
1133 --disable-zr) _zr=no ;;
1134 --enable-bl) _bl=yes ;;
1135 --disable-bl) _bl=no ;;
1136 --enable-mtrr) _mtrr=yes ;;
1137 --disable-mtrr) _mtrr=no ;;
1138 --enable-largefiles) _largefiles=yes ;;
1139 --disable-largefiles) _largefiles=no ;;
1140 --enable-shm) _shm=yes ;;
1141 --disable-shm) _shm=no ;;
1142 --enable-select) _select=yes ;;
1143 --disable-select) _select=no ;;
1144 --enable-linux-devfs) _linux_devfs=yes ;;
1145 --disable-linux-devfs) _linux_devfs=no ;;
1146 --enable-cdparanoia) _cdparanoia=yes ;;
1147 --disable-cdparanoia) _cdparanoia=no ;;
1148 --enable-cddb) _cddb=yes ;;
1149 --disable-cddb) _cddb=no ;;
1150 --enable-big-endian) _big_endian=yes ;;
1151 --disable-big-endian) _big_endian=no ;;
1152 --enable-bitmap-font) _bitmap_font=yes ;;
1153 --disable-bitmap-font) _bitmap_font=no ;;
1154 --enable-freetype) _freetype=yes ;;
1155 --disable-freetype) _freetype=no ;;
1156 --enable-fontconfig) _fontconfig=yes ;;
1157 --disable-fontconfig) _fontconfig=no ;;
1158 --enable-unrarexec) _unrar_exec=yes ;;
1159 --disable-unrarexec) _unrar_exec=no ;;
1160 --enable-ftp) _ftp=yes ;;
1161 --disable-ftp) _ftp=no ;;
1162 --enable-vstream) _vstream=yes ;;
1163 --disable-vstream) _vstream=no ;;
1164 --enable-pthreads) _pthreads=yes ;;
1165 --disable-pthreads) _pthreads=no ;;
1166 --enable-w32threads) _w32threads=yes ;;
1167 --disable-w32threads) _w32threads=no ;;
1168 --enable-ass) _ass=yes ;;
1169 --disable-ass) _ass=no ;;
1170 --enable-rpath) _rpath=yes ;;
1171 --disable-rpath) _rpath=no ;;
1173 --enable-fribidi) _fribidi=yes ;;
1174 --disable-fribidi) _fribidi=no ;;
1176 --enable-enca) _enca=yes ;;
1177 --disable-enca) _enca=no ;;
1179 --enable-inet6) _inet6=yes ;;
1180 --disable-inet6) _inet6=no ;;
1182 --enable-gethostbyname2) _gethostbyname2=yes ;;
1183 --disable-gethostbyname2) _gethostbyname2=no ;;
1185 --enable-dga1) _dga1=yes ;;
1186 --disable-dga1) _dga1=no ;;
1187 --enable-dga2) _dga2=yes ;;
1188 --disable-dga2) _dga2=no ;;
1190 --enable-menu) _menu=yes ;;
1191 --disable-menu) _menu=no ;;
1193 --enable-qtx) _qtx=yes ;;
1194 --disable-qtx) _qtx=no ;;
1196 --enable-macosx) _macosx=yes ;;
1197 --disable-macosx) _macosx=no ;;
1198 --enable-macosx-finder) _macosx_finder=yes ;;
1199 --disable-macosx-finder) _macosx_finder=no ;;
1200 --enable-macosx-bundle) _macosx_bundle=yes;;
1201 --disable-macosx-bundle) _macosx_bundle=no;;
1203 --enable-maemo) _maemo=yes ;;
1204 --disable-maemo) _maemo=no ;;
1206 --enable-sortsub) _sortsub=yes ;;
1207 --disable-sortsub) _sortsub=no ;;
1209 --enable-crash-debug) _crash_debug=yes ;;
1210 --disable-crash-debug) _crash_debug=no ;;
1211 --enable-sighandler) _sighandler=yes ;;
1212 --disable-sighandler) _sighandler=no ;;
1213 --enable-win32dll) _win32dll=yes ;;
1214 --disable-win32dll) _win32dll=no ;;
1216 --enable-sse) _sse=yes ;;
1217 --disable-sse) _sse=no ;;
1218 --enable-sse2) _sse2=yes ;;
1219 --disable-sse2) _sse2=no ;;
1220 --enable-ssse3) _ssse3=yes ;;
1221 --disable-ssse3) _ssse3=no ;;
1222 --enable-mmxext) _mmxext=yes ;;
1223 --disable-mmxext) _mmxext=no ;;
1224 --enable-3dnow) _3dnow=yes ;;
1225 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1226 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1227 --disable-3dnowext) _3dnowext=no ;;
1228 --enable-cmov) _cmov=yes ;;
1229 --disable-cmov) _cmov=no ;;
1230 --enable-fast-cmov) _fast_cmov=yes ;;
1231 --disable-fast-cmov) _fast_cmov=no ;;
1232 --enable-altivec) _altivec=yes ;;
1233 --disable-altivec) _altivec=no ;;
1234 --enable-armv5te) _armv5te=yes ;;
1235 --disable-armv5te) _armv5te=no ;;
1236 --enable-armv6) _armv6=yes ;;
1237 --disable-armv6) _armv6=no ;;
1238 --enable-armvfp) _armvfp=yes ;;
1239 --disable-armvfp) _armvfp=no ;;
1240 --enable-iwmmxt) _iwmmxt=yes ;;
1241 --disable-iwmmxt) _iwmmxt=no ;;
1242 --enable-mmx) _mmx=yes ;;
1243 --disable-mmx) # 3Dnow! and MMX2 require MMX
1244 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1247 echo "Unknown parameter: $ac_option"
1248 exit 1
1251 esac
1252 done
1254 # Atmos: moved this here, to be correct, if --prefix is specified
1255 test -z "$_bindir" && _bindir="$_prefix/bin"
1256 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1257 test -z "$_mandir" && _mandir="$_prefix/share/man"
1258 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1259 test -z "$_libdir" && _libdir="$_prefix/lib"
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 IRIX*)
1269 system_name=IRIX
1271 GNU/kFreeBSD)
1272 system_name=FreeBSD
1274 HP-UX*)
1275 system_name=HP-UX
1277 [cC][yY][gG][wW][iI][nN]*)
1278 system_name=CYGWIN
1280 MINGW32*)
1281 system_name=MINGW32
1283 OS/2*)
1284 system_name=OS/2
1287 system_name="$system_name-UNKNOWN"
1289 esac
1292 # host's CPU/instruction set
1293 host_arch=`uname -p 2>&1`
1294 case "$host_arch" in
1295 i386|sparc|ppc|alpha|arm|mips|vax)
1297 powerpc) # Darwin returns 'powerpc'
1298 host_arch=ppc
1300 *) # uname -p on Linux returns 'unknown' for the processor type,
1301 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1303 # Maybe uname -m (machine hardware name) returns something we
1304 # recognize.
1306 # x86/x86pc is used by QNX
1307 case "`uname -m 2>&1`" in
1308 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 ;;
1309 ia64) host_arch=ia64 ;;
1310 x86_64|amd64)
1311 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1312 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1313 host_arch=x86_64
1314 else
1315 host_arch=i386
1318 macppc|ppc|ppc64) host_arch=ppc ;;
1319 alpha) host_arch=alpha ;;
1320 sparc) host_arch=sparc ;;
1321 sparc64) host_arch=sparc64 ;;
1322 parisc*|hppa*|9000*) host_arch=hppa ;;
1323 arm*|zaurus|cats) host_arch=arm ;;
1324 sh3|sh4|sh4a) host_arch=sh ;;
1325 s390) host_arch=s390 ;;
1326 s390x) host_arch=s390x ;;
1327 mips*) host_arch=mips ;;
1328 vax) host_arch=vax ;;
1329 xtensa*) host_arch=xtensa ;;
1330 *) host_arch=UNKNOWN ;;
1331 esac
1333 esac
1334 else # if test -z "$_target"
1335 system_name=`echo $_target | cut -d '-' -f 2`
1336 case "`echo $system_name | tr A-Z a-z`" in
1337 linux) system_name=Linux ;;
1338 freebsd) system_name=FreeBSD ;;
1339 gnu/kfreebsd) system_name=FreeBSD ;;
1340 netbsd) system_name=NetBSD ;;
1341 bsd/os) system_name=BSD/OS ;;
1342 openbsd) system_name=OpenBSD ;;
1343 dragonfly) system_name=DragonFly ;;
1344 sunos) system_name=SunOS ;;
1345 qnx) system_name=QNX ;;
1346 morphos) system_name=MorphOS ;;
1347 amigaos) system_name=AmigaOS ;;
1348 mingw32msvc) system_name=MINGW32 ;;
1349 esac
1350 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1351 host_arch=`echo $_target | cut -d '-' -f 1`
1352 if test `echo $host_arch` != "x86_64" ; then
1353 host_arch=`echo $host_arch | tr '_' '-'`
1357 echo "Detected operating system: $system_name"
1358 echo "Detected host architecture: $host_arch"
1360 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1361 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1365 _inc_extra="-I. $_inc_extra"
1366 _timer=timer-linux.c
1367 _getch=getch2.c
1368 if freebsd ; then
1369 _ld_extra="$_ld_extra -L/usr/local/lib"
1370 _inc_extra="$_inc_extra -I/usr/local/include"
1373 if netbsd || dragonfly ; then
1374 _ld_extra="$_ld_extra -L/usr/pkg/lib"
1375 _inc_extra="$_inc_extra -I/usr/pkg/include"
1378 if darwin; then
1379 _ld_extra="$_ld_extra -L/usr/local/lib"
1380 _inc_extra="$_inc_extra -I/usr/local/include"
1381 _timer=timer-darwin.c
1384 if aix ; then
1385 _ld_extra="$_ld_extra -lC"
1388 if irix ; then
1389 _ranlib='ar -r'
1390 elif linux ; then
1391 _ranlib='true'
1394 if win32 ; then
1395 _exesuf=".exe"
1396 # -lwinmm is always needed for osdep/timer-win2.c
1397 _ld_extra="$_ld_extra -lwinmm"
1398 _pe_executable=yes
1399 _timer=timer-win2.c
1402 if mingw32 ; then
1403 _getch=getch2-win.c
1404 _need_shmem=no
1407 if cygwin ; then
1408 _def_confwin32='#define WIN32'
1411 if amigaos ; then
1412 _select=no
1413 _sighandler=no
1414 _stream_cache=no
1415 _def_stream_cache="#undef CONFIG_STREAM_CACHE"
1418 if qnx ; then
1419 _ld_extra="$_ld_extra -lph"
1422 if os2 ; then
1423 _exesuf=".exe"
1424 _getch=getch2-os2.c
1425 _need_shmem=no
1428 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1429 test "$I" && break
1430 done
1433 TMPLOG="configure.log"
1434 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1435 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1436 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1437 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1438 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1440 rm -f "$TMPLOG"
1441 echo configuration: $_configuration > "$TMPLOG"
1442 echo >> "$TMPLOG"
1445 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1446 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1447 # know about '-n'.
1448 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1449 _head() { head -$1 2>/dev/null ; }
1450 else
1451 _head() { head -n $1 2>/dev/null ; }
1453 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1454 _tail() { tail -$1 2>/dev/null ; }
1455 else
1456 _tail() { tail -n $1 2>/dev/null ; }
1459 # Checking CC version...
1460 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1461 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1462 echocheck "$_cc version"
1463 cc_vendor=intel
1464 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1465 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1466 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1467 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1468 # TODO verify older icc/ecc compatibility
1469 case $cc_version in
1471 cc_version="v. ?.??, bad"
1472 cc_fail=yes
1474 10.1)
1475 cc_version="$cc_version, ok"
1478 cc_version="$cc_version, bad"
1479 cc_fail=yes
1481 esac
1482 echores "$cc_version"
1483 else
1484 for _cc in "$_cc" cc gcc ; do
1485 cc_name_tmp=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1486 if test "$cc_name_tmp" = "gcc"; then
1487 cc_name=$cc_name_tmp
1488 echocheck "$_cc version"
1489 cc_vendor=gnu
1490 cc_version=`$_cc -dumpversion 2>&1`
1491 case $cc_version in
1492 2.96*)
1493 cc_fail=yes
1496 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1497 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1498 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1500 esac
1501 echores "$cc_version"
1502 break
1504 done
1505 fi # icc
1506 test "$cc_fail" = yes && die "unsupported compiler version"
1508 echocheck "host cc"
1509 test "$_host_cc" || _host_cc=$_cc
1510 echores $_host_cc
1512 echocheck "cross compilation"
1513 if test $_cross_compile = auto ; then
1514 cat > $TMPC << EOF
1515 int main(void) { return 0; }
1517 _cross_compile=yes
1518 cc_check && "$TMPEXE" && _cross_compile=no
1520 echores $_cross_compile
1522 if test $_cross_compile = yes; then
1523 tmp_run() {
1524 return 0
1528 # ---
1530 # now that we know what compiler should be used for compilation, try to find
1531 # out which assembler is used by the $_cc compiler
1532 if test "$_as" = auto ; then
1533 _as=`$_cc -print-prog-name=as`
1534 test -z "$_as" && _as=as
1537 # XXX: this should be ok..
1538 _cpuinfo="echo"
1540 if test "$_runtime_cpudetection" = no ; then
1542 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1543 # FIXME: Remove the cygwin check once AMD CPUs are supported
1544 if test -r /proc/cpuinfo && ! cygwin; then
1545 # Linux with /proc mounted, extract CPU information from it
1546 _cpuinfo="cat /proc/cpuinfo"
1547 elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then
1548 # FreeBSD with Linux emulation /proc mounted,
1549 # extract CPU information from it
1550 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1551 elif darwin && ! x86_32 ; then
1552 # use hostinfo on Darwin
1553 _cpuinfo="hostinfo"
1554 elif aix; then
1555 # use 'lsattr' on AIX
1556 _cpuinfo="lsattr -E -l proc0 -a type"
1557 elif x86; then
1558 # all other OSes try to extract CPU information from a small helper
1559 # program cpuinfo instead
1560 $_cc -o cpuinfo$_exesuf cpuinfo.c
1561 _cpuinfo="./cpuinfo$_exesuf"
1564 if x86 ; then
1565 # gather more CPU information
1566 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1567 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1568 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1569 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1570 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1572 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1574 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1575 -e s/xmm/sse/ -e s/kni/sse/`
1577 for ext in $pparam ; do
1578 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1579 done
1581 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1582 test $_sse = kernel_check && _mmxext=kernel_check
1584 echocheck "CPU vendor"
1585 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1587 echocheck "CPU type"
1588 echores "$pname"
1591 fi # test "$_runtime_cpudetection" = no
1593 if x86 && test "$_runtime_cpudetection" = no ; then
1594 extcheck() {
1595 if test "$1" = kernel_check ; then
1596 echocheck "kernel support of $2"
1597 cat > $TMPC <<EOF
1598 #include <stdlib.h>
1599 #include <signal.h>
1600 void catch() { exit(1); }
1601 int main(void) {
1602 signal(SIGILL, catch);
1603 __asm__ __volatile__ ("$3":::"memory"); return 0;
1607 if cc_check && tmp_run ; then
1608 eval _$2=yes
1609 echores "yes"
1610 _optimizing="$_optimizing $2"
1611 return 0
1612 else
1613 eval _$2=no
1614 echores "failed"
1615 echo "It seems that your kernel does not correctly support $2."
1616 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1617 return 1
1620 return 0
1623 extcheck $_mmx "mmx" "emms"
1624 extcheck $_mmxext "mmxext" "sfence"
1625 extcheck $_3dnow "3dnow" "femms"
1626 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1627 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1628 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1629 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1630 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1632 echocheck "mtrr support"
1633 if test "$_mtrr" = kernel_check ; then
1634 _mtrr="yes"
1635 _optimizing="$_optimizing mtrr"
1637 echores "$_mtrr"
1639 if test "$_gcc3_ext" != ""; then
1640 # if we had to disable sse/sse2 because the active kernel does not
1641 # support this instruction set extension, we also have to tell
1642 # gcc3 to not generate sse/sse2 instructions for normal C code
1643 cat > $TMPC << EOF
1644 int main(void) { return 0; }
1646 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1652 _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM ARMV4L SH POWERPC PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC'
1653 case "$host_arch" in
1654 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1655 _arch='X86 X86_32'
1656 _target_arch_x86="ARCH_X86 = yes"
1657 _target_arch="ARCH_X86_32 = yes"
1658 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1659 iproc=486
1660 proc=i486
1663 if test "$_runtime_cpudetection" = no ; then
1664 case "$pvendor" in
1665 AuthenticAMD)
1666 case "$pfamily" in
1667 3) proc=i386 iproc=386 ;;
1668 4) proc=i486 iproc=486 ;;
1669 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1670 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1671 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1672 proc=k6-3
1673 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1674 proc=geode
1675 elif test "$pmodel" -ge 8; then
1676 proc=k6-2
1677 elif test "$pmodel" -ge 6; then
1678 proc=k6
1679 else
1680 proc=i586
1683 6) iproc=686
1684 # It's a bit difficult to determine the correct type of Family 6
1685 # AMD CPUs just from their signature. Instead, we check directly
1686 # whether it supports SSE.
1687 if test "$_sse" = yes; then
1688 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1689 proc=athlon-xp
1690 else
1691 # Again, gcc treats athlon and athlon-tbird similarly.
1692 proc=athlon
1695 15) iproc=686
1696 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1697 # caught and remedied in the optimization tests below.
1698 proc=k8
1701 *) proc=k8 iproc=686 ;;
1702 esac
1704 GenuineIntel)
1705 case "$pfamily" in
1706 3) proc=i386 iproc=386 ;;
1707 4) proc=i486 iproc=486 ;;
1708 5) iproc=586
1709 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1710 proc=pentium-mmx # 4 is desktop, 8 is mobile
1711 else
1712 proc=i586
1715 6) iproc=686
1716 if test "$pmodel" -ge 15; then
1717 proc=core2
1718 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1719 proc=pentium-m
1720 elif test "$pmodel" -ge 7; then
1721 proc=pentium3
1722 elif test "$pmodel" -ge 3; then
1723 proc=pentium2
1724 else
1725 proc=i686
1728 15) iproc=686
1729 # A nocona in 32-bit mode has no more capabilities than a prescott.
1730 if test "$pmodel" -ge 3; then
1731 proc=prescott
1732 else
1733 proc=pentium4
1735 test $_fast_cmov = "auto" && _fast_cmov=no
1737 *) proc=prescott iproc=686 ;;
1738 esac
1740 CentaurHauls)
1741 case "$pfamily" in
1742 5) iproc=586
1743 if test "$pmodel" -ge 8; then
1744 proc=winchip2
1745 elif test "$pmodel" -ge 4; then
1746 proc=winchip-c6
1747 else
1748 proc=i586
1751 6) iproc=686
1752 if test "$pmodel" -ge 9; then
1753 proc=c3-2
1754 else
1755 proc=c3
1756 iproc=586
1759 *) proc=i686 iproc=i686 ;;
1760 esac
1762 unknown)
1763 case "$pfamily" in
1764 3) proc=i386 iproc=386 ;;
1765 4) proc=i486 iproc=486 ;;
1766 *) proc=i586 iproc=586 ;;
1767 esac
1770 proc=i586 iproc=586 ;;
1771 esac
1772 fi # test "$_runtime_cpudetection" = no
1775 # check that gcc supports our CPU, if not, fall back to earlier ones
1776 # LGB: check -mcpu and -march swithing step by step with enabling
1777 # to fall back till 386.
1779 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1781 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1782 cpuopt=-mtune
1783 else
1784 cpuopt=-mcpu
1787 echocheck "GCC & CPU optimization abilities"
1788 cat > $TMPC << EOF
1789 int main(void) { return 0; }
1791 if test "$_runtime_cpudetection" = no ; then
1792 cc_check -march=native && proc=native
1793 if test "$proc" = "k8"; then
1794 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1796 if test "$proc" = "athlon-xp"; then
1797 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1799 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1800 cc_check -march=$proc $cpuopt=$proc || proc=k6
1802 if test "$proc" = "k6" || test "$proc" = "c3"; then
1803 if ! cc_check -march=$proc $cpuopt=$proc; then
1804 if cc_check -march=i586 $cpuopt=i686; then
1805 proc=i586-i686
1806 else
1807 proc=i586
1811 if test "$proc" = "prescott" ; then
1812 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1814 if test "$proc" = "core2" ; then
1815 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1817 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
1818 cc_check -march=$proc $cpuopt=$proc || proc=i686
1820 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1821 cc_check -march=$proc $cpuopt=$proc || proc=i586
1823 if test "$proc" = "i586"; then
1824 cc_check -march=$proc $cpuopt=$proc || proc=i486
1826 if test "$proc" = "i486" ; then
1827 cc_check -march=$proc $cpuopt=$proc || proc=i386
1829 if test "$proc" = "i386" ; then
1830 cc_check -march=$proc $cpuopt=$proc || proc=error
1832 if test "$proc" = "error" ; then
1833 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1834 _mcpu=""
1835 _march=""
1836 _optimizing=""
1837 elif test "$proc" = "i586-i686"; then
1838 _march="-march=i586"
1839 _mcpu="$cpuopt=i686"
1840 _optimizing="$proc"
1841 else
1842 _march="-march=$proc"
1843 _mcpu="$cpuopt=$proc"
1844 _optimizing="$proc"
1846 else # if test "$_runtime_cpudetection" = no
1847 _mcpu="$cpuopt=generic"
1848 # at least i486 required, for bswap instruction
1849 _march="-march=i486"
1850 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1851 cc_check $_mcpu || _mcpu=""
1852 cc_check $_march $_mcpu || _march=""
1855 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1856 ## autodetected mcpu/march parameters
1857 if test "$_target" ; then
1858 # TODO: it may be a good idea to check GCC and fall back in all cases
1859 if test "$host_arch" = "i586-i686"; then
1860 _march="-march=i586"
1861 _mcpu="$cpuopt=i686"
1862 else
1863 _march="-march=$host_arch"
1864 _mcpu="$cpuopt=$host_arch"
1867 proc="$host_arch"
1869 case "$proc" in
1870 i386) iproc=386 ;;
1871 i486) iproc=486 ;;
1872 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1873 i686|athlon*|pentium*) iproc=686 ;;
1874 *) iproc=586 ;;
1875 esac
1878 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1879 _fast_cmov="yes"
1880 else
1881 _fast_cmov="no"
1884 echores "$proc"
1887 ia64)
1888 _arch='IA64'
1889 _target_arch='ARCH_IA64 = yes'
1890 iproc='ia64'
1891 proc=''
1892 _march=''
1893 _mcpu=''
1894 _optimizing=''
1897 x86_64|amd64)
1898 _arch='X86 X86_64'
1899 _target_arch='ARCH_X86_64 = yes'
1900 _target_arch_x86="ARCH_X86 = yes"
1901 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1902 iproc='x86_64'
1904 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1905 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1906 cpuopt=-mtune
1907 else
1908 cpuopt=-mcpu
1910 if test "$_runtime_cpudetection" = no ; then
1911 case "$pvendor" in
1912 AuthenticAMD)
1913 proc=k8;;
1914 GenuineIntel)
1915 case "$pfamily" in
1916 6) proc=core2;;
1918 # 64-bit prescotts exist, but as far as GCC is concerned they
1919 # have the same capabilities as a nocona.
1920 proc=nocona
1921 test $_fast_cmov = "auto" && _fast_cmov=no
1923 esac
1926 proc=error;;
1927 esac
1928 fi # test "$_runtime_cpudetection" = no
1930 echocheck "GCC & CPU optimization abilities"
1931 cat > $TMPC << EOF
1932 int main(void) { return 0; }
1934 # This is a stripped-down version of the i386 fallback.
1935 if test "$_runtime_cpudetection" = no ; then
1936 cc_check -march=native && proc=native
1937 # --- AMD processors ---
1938 if test "$proc" = "k8"; then
1939 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1941 # This will fail if gcc version < 3.3, which is ok because earlier
1942 # versions don't really support 64-bit on amd64.
1943 # Is this a valid assumption? -Corey
1944 if test "$proc" = "athlon-xp"; then
1945 cc_check -march=$proc $cpuopt=$proc || proc=error
1947 # --- Intel processors ---
1948 if test "$proc" = "core2"; then
1949 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1951 if test "$proc" = "nocona"; then
1952 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1954 if test "$proc" = "pentium4"; then
1955 cc_check -march=$proc $cpuopt=$proc || proc=error
1958 _march="-march=$proc"
1959 _mcpu="$cpuopt=$proc"
1960 if test "$proc" = "error" ; then
1961 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1962 _mcpu=""
1963 _march=""
1965 else # if test "$_runtime_cpudetection" = no
1966 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1967 _march="-march=x86-64"
1968 _mcpu="$cpuopt=generic"
1969 cc_check $_mcpu || _mcpu="x86-64"
1970 cc_check $_mcpu || _mcpu=""
1971 cc_check $_march $_mcpu || _march=""
1974 _optimizing=""
1976 echores "$proc"
1979 sparc)
1980 _arch='SPARC'
1981 _target_arch='ARCH_SPARC = yes'
1982 iproc='sparc'
1983 if sunos ; then
1984 echocheck "CPU type"
1985 karch=`uname -m`
1986 case "`echo $karch`" in
1987 sun4) proc=v7 ;;
1988 sun4c) proc=v7 ;;
1989 sun4d) proc=v8 ;;
1990 sun4m) proc=v8 ;;
1991 sun4u) proc=ultrasparc _vis='yes' ;;
1992 sun4v) proc=v9 ;;
1993 *) proc=v8 ;;
1994 esac
1995 echores "$proc"
1996 else
1997 proc=v8
1999 _march=''
2000 _mcpu="-mcpu=$proc"
2001 _optimizing="$proc"
2004 sparc64)
2005 _arch='SPARC'
2006 _target_arch='ARCH_SPARC = yes'
2007 _vis='yes'
2008 iproc='sparc'
2009 proc='ultrasparc'
2010 _march=''
2011 _mcpu="-mcpu=$proc"
2012 _optimizing="$proc"
2015 arm|armv4l|armv5tel)
2016 _arch='ARM ARMV4L'
2017 _target_arch='ARCH_ARMV4L = yes'
2018 iproc='arm'
2019 proc=''
2020 _march=''
2021 _mcpu=''
2022 _optimizing=''
2026 _arch='SH'
2027 _target_arch='ARCH_SH = yes'
2028 iproc='sh'
2029 proc=''
2030 _march=''
2031 _mcpu=''
2032 _optimizing=''
2035 ppc|ppc64|powerpc|powerpc64)
2036 _arch='POWERPC PPC'
2037 _def_dcbzl='#undef HAVE_DCBZL'
2038 _target_arch='ARCH_POWERPC = yes'
2039 iproc='ppc'
2040 proc=''
2041 _march=''
2042 _mcpu=''
2043 _optimizing=''
2045 echocheck "CPU type"
2046 case $system_name in
2047 Linux)
2048 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2049 if test -n "`$_cpuinfo | grep altivec`"; then
2050 test $_altivec = auto && _altivec=yes
2053 Darwin)
2054 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2055 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2056 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2057 test $_altivec = auto && _altivec=yes
2060 NetBSD)
2061 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2062 case $cc_version in
2063 2*|3.0*|3.1*|3.2*|3.3*)
2066 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2067 test $_altivec = auto && _altivec=yes
2070 esac
2072 AIX)
2073 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2075 esac
2076 if test "$_altivec" = yes; then
2077 echores "$proc altivec"
2078 else
2079 _altivec=no
2080 echores "$proc"
2083 echocheck "GCC & CPU optimization abilities"
2085 if test -n "$proc"; then
2086 case "$proc" in
2087 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2088 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2089 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2090 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2091 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2092 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2093 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2094 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2095 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2096 *) ;;
2097 esac
2098 # gcc 3.1(.1) and up supports 7400 and 7450
2099 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2100 case "$proc" in
2101 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2102 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2103 *) ;;
2104 esac
2106 # gcc 3.2 and up supports 970
2107 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2108 case "$proc" in
2109 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2110 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2111 *) ;;
2112 esac
2114 # gcc 3.3 and up supports POWER4
2115 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2116 case "$proc" in
2117 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2118 *) ;;
2119 esac
2121 # gcc 3.4 and up supports 440*
2122 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2123 case "$proc" in
2124 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2125 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2126 *) ;;
2127 esac
2129 # gcc 4.0 and up supports POWER5
2130 if test "$_cc_major" -ge "4"; then
2131 case "$proc" in
2132 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2133 *) ;;
2134 esac
2138 if test -n "$_mcpu"; then
2139 _optimizing=`echo $_mcpu | cut -c 8-`
2140 echores "$_optimizing"
2141 else
2142 echores "none"
2147 alpha)
2148 _arch='ALPHA'
2149 _target_arch='ARCH_ALPHA = yes'
2150 iproc='alpha'
2151 _march=''
2153 echocheck "CPU type"
2154 cat > $TMPC << EOF
2155 int main(void) {
2156 unsigned long ver, mask;
2157 asm ("implver %0" : "=r" (ver));
2158 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2159 printf("%ld-%x\n", ver, ~mask);
2160 return 0;
2163 $_cc -o "$TMPEXE" "$TMPC"
2164 case `"$TMPEXE"` in
2166 0-0) proc="ev4"; _mvi="0";;
2167 1-0) proc="ev5"; _mvi="0";;
2168 1-1) proc="ev56"; _mvi="0";;
2169 1-101) proc="pca56"; _mvi="1";;
2170 2-303) proc="ev6"; _mvi="1";;
2171 2-307) proc="ev67"; _mvi="1";;
2172 2-1307) proc="ev68"; _mvi="1";;
2173 esac
2174 echores "$proc"
2176 echocheck "GCC & CPU optimization abilities"
2177 if test "$proc" = "ev68" ; then
2178 cc_check -mcpu=$proc || proc=ev67
2180 if test "$proc" = "ev67" ; then
2181 cc_check -mcpu=$proc || proc=ev6
2183 _mcpu="-mcpu=$proc"
2184 echores "$proc"
2186 _optimizing="$proc"
2189 mips)
2190 _arch='SGI_MIPS'
2191 _target_arch='ARCH_SGI_MIPS = yes'
2192 iproc='sgi-mips'
2193 proc=''
2194 _march=''
2195 _mcpu=''
2196 _optimizing=''
2198 if irix ; then
2199 echocheck "CPU type"
2200 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2201 case "`echo $proc`" in
2202 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2203 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2204 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2205 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2206 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2207 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2208 esac
2209 # gcc < 3.x does not support -mtune.
2210 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2211 _mcpu=''
2213 echores "$proc"
2218 hppa)
2219 _arch='PA_RISC'
2220 _target_arch='ARCH_PA_RISC = yes'
2221 iproc='PA-RISC'
2222 proc=''
2223 _march=''
2224 _mcpu=''
2225 _optimizing=''
2228 s390)
2229 _arch='S390'
2230 _target_arch='ARCH_S390 = yes'
2231 iproc='390'
2232 proc=''
2233 _march=''
2234 _mcpu=''
2235 _optimizing=''
2238 s390x)
2239 _arch='S390X'
2240 _target_arch='ARCH_S390X = yes'
2241 iproc='390x'
2242 proc=''
2243 _march=''
2244 _mcpu=''
2245 _optimizing=''
2248 vax)
2249 _arch='VAX'
2250 _target_arch='ARCH_VAX = yes'
2251 iproc='vax'
2252 proc=''
2253 _march=''
2254 _mcpu=''
2255 _optimizing=''
2258 xtensa)
2259 _arch='XTENSA'
2260 _target_arch='ARCH_XTENSA = yes'
2261 iproc='xtensa'
2262 proc=''
2263 _march=''
2264 _mcpu=''
2265 _optimizing=''
2268 generic)
2269 _arch='GENERIC'
2270 _target_arch='ARCH_GENERIC = yes'
2271 iproc=''
2272 proc=''
2273 _march=''
2274 _mcpu=''
2275 _optimizing=''
2279 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2280 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2281 die "unsupported architecture $host_arch"
2283 esac # case "$host_arch" in
2285 if test "$_runtime_cpudetection" = yes ; then
2286 if x86 ; then
2287 test "$_cmov" != no && _cmov=yes
2288 x86_32 && _cmov=no
2289 test "$_mmx" != no && _mmx=yes
2290 test "$_3dnow" != no && _3dnow=yes
2291 test "$_3dnowext" != no && _3dnowext=yes
2292 test "$_mmxext" != no && _mmxext=yes
2293 test "$_sse" != no && _sse=yes
2294 test "$_sse2" != no && _sse2=yes
2295 test "$_ssse3" != no && _ssse3=yes
2296 test "$_mtrr" != no && _mtrr=yes
2298 if ppc; then
2299 _altivec=yes
2304 echocheck "extern symbol prefix"
2305 cat > $TMPC << EOF
2306 int ff_extern;
2308 cc_check -c || die "Symbol mangling check failed."
2309 sym=$(nm -P -g $TMPEXE)
2310 extern_prefix=${sym%%ff_extern*}
2311 _def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2312 echores $extern_prefix
2315 echocheck "assembler support of -pipe option"
2316 cat > $TMPC << EOF
2317 int main(void) { return 0; }
2319 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2322 echocheck "compiler support of named assembler arguments"
2323 _named_asm_args=yes
2324 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2325 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2326 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2327 _named_asm_args=no
2328 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2330 echores $_named_asm_args
2333 if darwin && test "$cc_vendor" = "gnu" ; then
2334 echocheck "GCC support of -mstackrealign"
2335 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2336 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2337 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2338 # wrong code with this flag, but this can be worked around by adding
2339 # -fno-unit-at-a-time as described in the blog post at
2340 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2341 cat > $TMPC << EOF
2342 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2343 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2345 cc_check -O4 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2346 test -z "$cflags_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2347 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2348 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2349 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2352 # Checking for CFLAGS
2353 _install_strip="-s"
2354 if test "$_profile" != "" || test "$_debug" != "" ; then
2355 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2356 _install_strip=
2357 elif test -z "$CFLAGS" ; then
2358 if test "$cc_vendor" = "intel" ; then
2359 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2360 elif test "$cc_vendor" != "gnu" ; then
2361 CFLAGS="-O2 $_march $_mcpu $_pipe"
2362 else
2363 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2365 else
2366 _warn_CFLAGS=yes
2368 if test -n "$LDFLAGS" ; then
2369 _ld_extra="$_ld_extra $LDFLAGS"
2370 _warn_CFLAGS=yes
2371 elif test "$cc_vendor" = "intel" ; then
2372 _ld_extra="$_ld_extra -i-static"
2374 if test -n "$CPPFLAGS" ; then
2375 _inc_extra="$_inc_extra $CPPFLAGS"
2376 _warn_CFLAGS=yes
2381 if x86_32 ; then
2382 # Checking assembler (_as) compatibility...
2383 # Added workaround for older as that reads from stdin by default - atmos
2384 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2385 echocheck "assembler ($_as $as_version)"
2387 _pref_as_version='2.9.1'
2388 echo 'nop' > $TMPS
2389 if test "$_mmx" = yes ; then
2390 echo 'emms' >> $TMPS
2392 if test "$_3dnow" = yes ; then
2393 _pref_as_version='2.10.1'
2394 echo 'femms' >> $TMPS
2396 if test "$_3dnowext" = yes ; then
2397 _pref_as_version='2.10.1'
2398 echo 'pswapd %mm0, %mm0' >> $TMPS
2400 if test "$_mmxext" = yes ; then
2401 _pref_as_version='2.10.1'
2402 echo 'movntq %mm0, (%eax)' >> $TMPS
2404 if test "$_sse" = yes ; then
2405 _pref_as_version='2.10.1'
2406 echo 'xorps %xmm0, %xmm0' >> $TMPS
2408 #if test "$_sse2" = yes ; then
2409 # _pref_as_version='2.11'
2410 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2412 if test "$_cmov" = yes ; then
2413 _pref_as_version='2.10.1'
2414 echo 'cmovb %eax, %ebx' >> $TMPS
2416 if test "$_ssse3" = yes ; then
2417 _pref_as_version='2.16.92'
2418 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2420 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2422 if test "$as_verc_fail" != yes ; then
2423 echores "ok"
2424 else
2425 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2426 echores "failed"
2427 die "obsolete binutils version"
2430 fi #if x86_32
2432 echocheck ".align is a power of two"
2433 if test "$_asmalign_pot" = auto ; then
2434 _asmalign_pot=no
2435 cat > $TMPC << EOF
2436 int main(void) { asm (".align 3"); return 0; }
2438 cc_check && _asmalign_pot=yes
2440 if test "$_asmalign_pot" = "yes" ; then
2441 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2442 else
2443 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2445 echores $_asmalign_pot
2448 #FIXME: This should happen before the check for CFLAGS..
2449 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2451 # check if AltiVec is supported by the compiler, and how to enable it
2452 echocheck "GCC AltiVec flags"
2453 cat > $TMPC << EOF
2454 int main(void) { return 0; }
2456 if $(cc_check -maltivec -mabi=altivec) ; then
2457 _altivec_gcc_flags="-maltivec -mabi=altivec"
2458 # check if <altivec.h> should be included
2459 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2460 cat > $TMPC << EOF
2461 #include <altivec.h>
2462 int main(void) { return 0; }
2464 if $(cc_check $_altivec_gcc_flags) ; then
2465 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2466 inc_altivec_h='#include <altivec.h>'
2467 else
2468 cat > $TMPC << EOF
2469 int main(void) { return 0; }
2471 if $(cc_check -faltivec) ; then
2472 _altivec_gcc_flags="-faltivec"
2473 else
2474 _altivec=no
2475 _altivec_gcc_flags="none, AltiVec disabled"
2479 echores "$_altivec_gcc_flags"
2481 # check if the compiler supports braces for vector declarations
2482 cat > $TMPC << EOF
2483 $inc_altivec_h
2484 int main(void) { (vector int) {1}; return 0; }
2486 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2488 # Disable runtime cpudetection if we cannot generate AltiVec code or
2489 # AltiVec is disabled by the user.
2490 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2491 && _runtime_cpudetection=no
2493 # Show that we are optimizing for AltiVec (if enabled and supported).
2494 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2495 && _optimizing="$_optimizing altivec"
2497 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2498 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2501 if arm ; then
2502 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2503 if test $_armv5te = "auto" ; then
2504 cat > $TMPC << EOF
2505 int main(void) { __asm__ __volatile__ ("qadd r0, r0, r0"); return 0; }
2507 _armv5te=no
2508 cc_check && _armv5te=yes
2510 echores "$_armv5te"
2512 echocheck "ARMv6 (SIMD instructions)"
2513 if test $_armv6 = "auto" ; then
2514 cat > $TMPC << EOF
2515 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); return 0; }
2517 _armv6=no
2518 cc_check && _armv6=yes
2520 echores "$_armv6"
2522 echocheck "ARM VFP"
2523 if test $_armvfp = "auto" ; then
2524 cat > $TMPC << EOF
2525 int main(void) { __asm__ __volatile__ ("fadds s0, s0, s0"); return 0; }
2527 _armvfp=no
2528 cc_check && _armvfp=yes
2530 echores "$_armvfp"
2532 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2533 if test $_iwmmxt = "auto" ; then
2534 cat > $TMPC << EOF
2535 int main(void) { __asm__ __volatile__ ("wunpckelub wr6, wr4"); return 0; }
2537 _iwmmxt=no
2538 cc_check && _iwmmxt=yes
2540 echores "$_iwmmxt"
2543 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 ARMVFP IWMMXT MLIB MMI SH4 VIS MVI'
2544 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2545 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2546 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2547 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2548 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2549 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2550 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2551 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2552 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2553 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2554 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2555 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2556 test "$_armvfp" = yes && _cpuexts="ARMVFP $_cpuexts"
2557 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2558 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2559 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2561 # Checking kernel version...
2562 if x86_32 && linux ; then
2563 _k_verc_problem=no
2564 kernel_version=`uname -r 2>&1`
2565 echocheck "$system_name kernel version"
2566 case "$kernel_version" in
2567 '') kernel_version="?.??"; _k_verc_fail=yes;;
2568 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2569 _k_verc_problem=yes;;
2570 esac
2571 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2572 _k_verc_fail=yes
2574 if test "$_k_verc_fail" ; then
2575 echores "$kernel_version, fail"
2576 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2577 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2578 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2579 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2580 echo "2.2.x you must upgrade it to get SSE support!"
2581 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2582 else
2583 echores "$kernel_version, ok"
2587 ######################
2588 # MAIN TESTS GO HERE #
2589 ######################
2592 echocheck "-lposix"
2593 cat > $TMPC <<EOF
2594 int main(void) { return 0; }
2596 if cc_check -lposix ; then
2597 _ld_extra="$_ld_extra -lposix"
2598 echores "yes"
2599 else
2600 echores "no"
2603 echocheck "-lm"
2604 cat > $TMPC <<EOF
2605 int main(void) { return 0; }
2607 if cc_check -lm ; then
2608 _ld_lm="-lm"
2609 echores "yes"
2610 else
2611 _ld_lm=""
2612 echores "no"
2616 echocheck "langinfo"
2617 if test "$_langinfo" = auto ; then
2618 cat > $TMPC <<EOF
2619 #include <langinfo.h>
2620 int main(void) { nl_langinfo(CODESET); return 0; }
2622 _langinfo=no
2623 cc_check && _langinfo=yes
2625 if test "$_langinfo" = yes ; then
2626 _def_langinfo='#define HAVE_LANGINFO 1'
2627 else
2628 _def_langinfo='#undef HAVE_LANGINFO'
2630 echores "$_langinfo"
2633 echocheck "language"
2634 test -z "$_language" && _language=$LINGUAS
2635 _language=`echo $_language | tr , " "`
2636 if $(echo $_language | grep -q all) ; then
2637 doc_lang=en ; doc_langs=$doc_lang_all
2638 man_lang=en ; man_langs=$man_lang_all
2639 msg_lang=en
2640 else
2641 for lang in $_language ; do
2642 if test -d DOCS/man/$lang ; then
2643 tmp_man_langs="$tmp_man_langs $lang"
2645 if test -d DOCS/xml/$lang ; then
2646 tmp_doc_langs="$tmp_doc_langs $lang"
2648 done
2649 man_langs=$tmp_man_langs
2650 doc_langs=$tmp_man_langs
2651 for lang in $_language ; do
2652 if test -f "help/help_mp-${lang}.h" ; then
2653 msg_lang=$lang
2654 break
2655 else
2656 echo ${_echo_n} "$lang not found, ${_echo_c}"
2657 _language=`echo $_language | sed "s/$lang *//"`
2659 done
2661 test -z "$doc_langs" && doc_langs=en
2662 test -z "$man_langs" && man_langs=en
2663 test -z "$doc_lang" && doc_lang=$(echo $doc_langs | cut -f1 -d" ")
2664 test -z "$man_lang" && man_lang=$(echo $man_langs | cut -f1 -d" ")
2665 test -z "$msg_lang" && msg_lang=en
2666 _mp_help="help/help_mp-${msg_lang}.h"
2667 echores "messages: $msg_lang - man pages: $man_langs - documentation: $doc_langs"
2670 echocheck "enable sighandler"
2671 if test "$_sighandler" = yes ; then
2672 _def_sighandler='#define CONFIG_SIGHANDLER 1'
2673 else
2674 _def_sighandler='#undef CONFIG_SIGHANDLER'
2676 echores "$_sighandler"
2678 echocheck "runtime cpudetection"
2679 if test "$_runtime_cpudetection" = yes ; then
2680 _optimizing="Runtime CPU-Detection enabled"
2681 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2682 else
2683 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2685 echores "$_runtime_cpudetection"
2688 echocheck "restrict keyword"
2689 for restrict_keyword in restrict __restrict __restrict__ ; do
2690 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2691 if cc_check; then
2692 _def_restrict_keyword=$restrict_keyword
2693 break;
2695 done
2696 if [ -n "$_def_restrict_keyword" ]; then
2697 echores "$_def_restrict_keyword"
2698 else
2699 echores "none"
2701 # Avoid infinite recursion loop ("#define restrict restrict")
2702 if [ "$_def_restrict_keyword" != "restrict" ]; then
2703 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2704 else
2705 _def_restrict_keyword=""
2709 echocheck "__builtin_expect"
2710 # GCC branch prediction hint
2711 cat > $TMPC << EOF
2712 int foo (int a) {
2713 a = __builtin_expect (a, 10);
2714 return a == 10 ? 0 : 1;
2716 int main(void) { return foo(10) && foo(0); }
2718 _builtin_expect=no
2719 cc_check && _builtin_expect=yes
2720 if test "$_builtin_expect" = yes ; then
2721 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2722 else
2723 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2725 echores "$_builtin_expect"
2728 echocheck "kstat"
2729 cat > $TMPC << EOF
2730 #include <kstat.h>
2731 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2733 _kstat=no
2734 cc_check -lkstat && _kstat=yes
2735 if test "$_kstat" = yes ; then
2736 _def_kstat="#define HAVE_LIBKSTAT 1"
2737 _ld_extra="$_ld_extra -lkstat"
2738 else
2739 _def_kstat="#undef HAVE_LIBKSTAT"
2741 echores "$_kstat"
2744 echocheck "posix4"
2745 # required for nanosleep on some systems
2746 cat > $TMPC << EOF
2747 #include <time.h>
2748 int main(void) { (void) nanosleep(0, 0); return 0; }
2750 _posix4=no
2751 cc_check -lposix4 && _posix4=yes
2752 if test "$_posix4" = yes ; then
2753 _ld_extra="$_ld_extra -lposix4"
2755 echores "$_posix4"
2757 for func in llrint lrint lrintf round roundf; do
2758 echocheck $func
2759 cat > $TMPC << EOF
2760 #include <math.h>
2761 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
2763 eval _$func=no
2764 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2765 if eval test "x\$_$func" = "xyes"; then
2766 eval _def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 1\""
2767 echores yes
2768 else
2769 eval _def_$func="\"#undef HAVE_`echo $func | tr '[a-z]' '[A-Z]'`\""
2770 echores no
2772 done
2775 echocheck "mkstemp"
2776 cat > $TMPC << EOF
2777 #include <stdlib.h>
2778 int main(void) { char a; mkstemp(&a); return 0; }
2780 _mkstemp=no
2781 cc_check && _mkstemp=yes
2782 if test "$_mkstemp" = yes ; then
2783 _def_mkstemp='#define HAVE_MKSTEMP 1'
2784 else
2785 _def_mkstemp='#undef HAVE_MKSTEMP'
2787 echores "$_mkstemp"
2790 echocheck "nanosleep"
2791 # also check for nanosleep
2792 cat > $TMPC << EOF
2793 #include <time.h>
2794 int main(void) { (void) nanosleep(0, 0); return 0; }
2796 _nanosleep=no
2797 cc_check && _nanosleep=yes
2798 if test "$_nanosleep" = yes ; then
2799 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2800 else
2801 _def_nanosleep='#undef HAVE_NANOSLEEP'
2803 echores "$_nanosleep"
2806 echocheck "socklib"
2807 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2808 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2809 cat > $TMPC << EOF
2810 #include <netdb.h>
2811 #include <sys/socket.h>
2812 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2814 _socklib=no
2815 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2816 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2817 done
2818 if test $_winsock2_h = auto && ! cygwin ; then
2819 _winsock2_h=no
2820 cat > $TMPC << EOF
2821 #include <winsock2.h>
2822 int main(void) { (void) gethostbyname(0); return 0; }
2824 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2826 test "$_ld_sock" && _res_comment="using $_ld_sock"
2827 echores "$_socklib"
2830 if test $_winsock2_h = yes ; then
2831 _ld_sock="-lws2_32"
2832 _def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2833 else
2834 _def_winsock2_h='#undef HAVE_WINSOCK2_H'
2838 _use_aton=no
2839 echocheck "inet_pton()"
2840 cat > $TMPC << EOF
2841 #include <sys/types.h>
2842 #include <sys/socket.h>
2843 #include <arpa/inet.h>
2844 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2846 if test "$_winsock2_h" = yes ; then
2847 _res_comment="using winsock2 functions instead"
2848 echores "no"
2849 elif cc_check $_ld_sock ; then
2850 # NOTE: Linux has libresolv but does not need it
2852 _res_comment="using $_ld_sock"
2853 echores "yes"
2854 elif cc_check $_ld_sock -lresolv ; then
2855 # NOTE: needed for SunOS at least
2856 _ld_sock="$_ld_sock -lresolv"
2857 _res_comment="using $_ld_sock"
2858 echores "yes"
2859 else
2860 _res_comment="trying inet_aton next"
2861 echores "no"
2863 echocheck "inet_aton()"
2864 cat > $TMPC << EOF
2865 #include <sys/types.h>
2866 #include <sys/socket.h>
2867 #include <arpa/inet.h>
2868 int main(void) { (void) inet_aton(0, 0); return 0; }
2870 _use_aton=yes
2871 if cc_check $_ld_sock ; then
2872 # NOTE: Linux has libresolv but does not need it
2874 _res_comment="using $_ld_sock"
2875 elif cc_check $_ld_sock -lresolv ; then
2876 # NOTE: needed for SunOS at least
2877 _ld_sock="$_ld_sock -lresolv"
2878 _res_comment="using $_ld_sock"
2879 else
2880 _use_aton=no
2881 _network=no
2882 _res_comment="network support disabled"
2884 echores "$_use_aton"
2887 _def_use_aton='#undef HAVE_ATON'
2888 if test "$_use_aton" = yes; then
2889 _def_use_aton='#define HAVE_ATON 1'
2893 echocheck "socklen_t"
2894 _socklen_t=no
2895 for header in "sys/socket.h" "ws2tcpip.h" ; do
2896 cat > $TMPC << EOF
2897 #include <$header>
2898 int main(void) { socklen_t v = 0; return v; }
2900 cc_check && _socklen_t=yes && break
2901 done
2902 if test "$_socklen_t" = yes ; then
2903 _def_socklen_t='#define HAVE_SOCKLEN_T 1'
2904 else
2905 _def_socklen_t='#undef HAVE_SOCKLEN_T'
2907 echores "$_socklen_t"
2910 echocheck "closesocket()"
2911 _closesocket=no
2912 cat > $TMPC << EOF
2913 #include <winsock2.h>
2914 int main(void) { closesocket(~0); return 0; }
2916 cc_check $_ld_sock && _closesocket=yes
2917 if test "$_closesocket" = yes ; then
2918 _def_closesocket='#define HAVE_CLOSESOCKET 1'
2919 else
2920 _def_closesocket='#undef HAVE_CLOSESOCKET'
2922 echores "$_closesocket"
2925 echocheck "network"
2926 # FIXME network check
2927 if test "$_network" = yes ; then
2928 _def_network='#define CONFIG_NETWORK 1'
2929 _ld_extra="$_ld_extra $_ld_sock"
2930 _inputmodules="network $_inputmodules"
2931 else
2932 _noinputmodules="network $_noinputmodules"
2933 _def_network='#undef CONFIG_NETWORK'
2934 _ftp=no
2936 echores "$_network"
2938 echocheck "inttypes.h (required)"
2939 cat > $TMPC << EOF
2940 #include <inttypes.h>
2941 int main(void) { return 0; }
2943 _inttypes=no
2944 cc_check && _inttypes=yes
2945 echores "$_inttypes"
2947 if test "$_inttypes" = no ; then
2948 echocheck "bitypes.h (inttypes.h predecessor)"
2949 cat > $TMPC << EOF
2950 #include <sys/bitypes.h>
2951 int main(void) { return 0; }
2953 cc_check && _inttypes=yes
2954 if test "$_inttypes" = yes ; then
2955 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."
2956 else
2957 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2962 echocheck "int_fastXY_t in inttypes.h"
2963 cat > $TMPC << EOF
2964 #include <inttypes.h>
2965 int main(void) {
2966 volatile int_fast16_t v= 0;
2967 return v; }
2969 _fast_inttypes=no
2970 cc_check && _fast_inttypes=yes
2971 if test "$_fast_inttypes" = no ; then
2972 _def_fast_inttypes='
2973 typedef signed char int_fast8_t;
2974 typedef signed int int_fast16_t;
2975 typedef signed int int_fast32_t;
2976 typedef signed long long int_fast64_t;
2977 typedef unsigned char uint_fast8_t;
2978 typedef unsigned int uint_fast16_t;
2979 typedef unsigned int uint_fast32_t;
2980 typedef unsigned long long uint_fast64_t;'
2982 echores "$_fast_inttypes"
2985 echocheck "word size"
2986 _mp_wordsize="#undef MP_WORDSIZE"
2987 cat > $TMPC << EOF
2988 #include <stdio.h>
2989 #include <sys/types.h>
2990 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2992 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2993 echores "$_wordsize"
2996 echocheck "malloc.h"
2997 cat > $TMPC << EOF
2998 #include <malloc.h>
2999 int main(void) { (void) malloc(0); return 0; }
3001 _malloc=no
3002 cc_check && _malloc=yes
3003 if test "$_malloc" = yes ; then
3004 _def_malloc='#define HAVE_MALLOC_H 1'
3005 else
3006 _def_malloc='#undef HAVE_MALLOC_H'
3008 # malloc.h emits a warning in FreeBSD and OpenBSD
3009 freebsd || openbsd || dragonfly && _def_malloc='#undef HAVE_MALLOC_H'
3010 echores "$_malloc"
3013 echocheck "memalign()"
3014 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3015 cat > $TMPC << EOF
3016 #include <malloc.h>
3017 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
3019 _memalign=no
3020 cc_check && _memalign=yes
3021 if test "$_memalign" = yes ; then
3022 _def_memalign='#define HAVE_MEMALIGN 1'
3023 else
3024 _def_memalign='#undef HAVE_MEMALIGN'
3025 _def_map_memalign='#define memalign(a,b) malloc(b)'
3026 darwin || _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3028 echores "$_memalign"
3031 echocheck "alloca.h"
3032 cat > $TMPC << EOF
3033 #include <alloca.h>
3034 int main(void) { (void) alloca(0); return 0; }
3036 _alloca=no
3037 cc_check && _alloca=yes
3038 if cc_check ; then
3039 _def_alloca='#define HAVE_ALLOCA_H 1'
3040 else
3041 _def_alloca='#undef HAVE_ALLOCA_H'
3043 echores "$_alloca"
3046 echocheck "byteswap.h"
3047 cat > $TMPC << EOF
3048 #include <byteswap.h>
3049 int main(void) { bswap_16(0); return 0; }
3051 _byteswap_h=no
3052 cc_check && _byteswap_h=yes
3053 if cc_check ; then
3054 _def_byteswap_h='#define HAVE_BYTESWAP_H 1'
3055 else
3056 _def_byteswap_h='#undef HAVE_BYTESWAP_H'
3058 echores "$_byteswap_h"
3061 echocheck "mman.h"
3062 cat > $TMPC << EOF
3063 #include <sys/types.h>
3064 #include <sys/mman.h>
3065 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3067 _mman=no
3068 cc_check && _mman=yes
3069 if test "$_mman" = yes ; then
3070 _def_mman='#define HAVE_SYS_MMAN_H 1'
3071 else
3072 _def_mman='#undef HAVE_SYS_MMAN_H'
3073 os2 && _need_mmap=yes
3075 echores "$_mman"
3077 cat > $TMPC << EOF
3078 #include <sys/types.h>
3079 #include <sys/mman.h>
3080 int main(void) { void *p = MAP_FAILED; return 0; }
3082 _mman_has_map_failed=no
3083 cc_check && _mman_has_map_failed=yes
3084 if test "$_mman_has_map_failed" = yes ; then
3085 _def_mman_has_map_failed=''
3086 else
3087 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3090 echocheck "dynamic loader"
3091 cat > $TMPC << EOF
3092 #include <stddef.h>
3093 #include <dlfcn.h>
3094 int main(void) { dlopen(NULL, 0); dlclose(NULL); dlsym(NULL, NULL); return 0; }
3096 _dl=no
3097 for _ld_tmp in "" "-ldl" ; do
3098 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3099 done
3100 if test "$_dl" = yes ; then
3101 _def_dl='#define HAVE_LIBDL 1'
3102 else
3103 _def_dl='#undef HAVE_LIBDL'
3105 echores "$_dl"
3108 echocheck "dynamic a/v plugins support"
3109 if test "$_dl" = no ; then
3110 _dynamic_plugins=no
3112 if test "$_dynamic_plugins" = yes ; then
3113 _def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3114 else
3115 _def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3117 echores "$_dynamic_plugins"
3120 _def_threads='#undef HAVE_THREADS'
3122 echocheck "pthread"
3123 if test "$_pthreads" = auto ; then
3124 cat > $TMPC << EOF
3125 #include <pthread.h>
3126 void* func(void *arg) { return arg; }
3127 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3129 _pthreads=no
3130 if ! hpux ; then
3131 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3132 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3133 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3134 done
3137 if test "$_pthreads" = yes ; then
3138 _res_comment="using $_ld_pthread"
3139 _def_pthreads='#define HAVE_PTHREADS 1'
3140 _def_threads='#define HAVE_THREADS 1'
3141 else
3142 _res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3143 _def_pthreads='#undef HAVE_PTHREADS'
3144 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3145 mingw32 || _win32dll=no
3147 echores "$_pthreads"
3149 echocheck "w32threads"
3150 if test "$_pthreads" = yes ; then
3151 _res_comment="using pthread instead"
3152 _w32threads=no
3154 if test "$_w32threads" = auto ; then
3155 _w32threads=no
3156 mingw32 && _w32threads=yes
3158 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3159 echores "$_w32threads"
3161 echocheck "rpath"
3162 netbsd &&_rpath=yes
3163 if test "$_rpath" = yes ; then
3164 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3165 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3166 done
3167 _ld_extra=$tmp
3169 echores "$_rpath"
3171 echocheck "iconv"
3172 if test "$_iconv" = auto ; then
3173 cat > $TMPC << EOF
3174 #include <stdio.h>
3175 #include <unistd.h>
3176 #include <iconv.h>
3177 #define INBUFSIZE 1024
3178 #define OUTBUFSIZE 4096
3180 char inbuffer[INBUFSIZE];
3181 char outbuffer[OUTBUFSIZE];
3183 int main(void) {
3184 size_t numread;
3185 iconv_t icdsc;
3186 char *tocode="UTF-8";
3187 char *fromcode="cp1250";
3188 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3189 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3190 char *iptr=inbuffer;
3191 char *optr=outbuffer;
3192 size_t inleft=numread;
3193 size_t outleft=OUTBUFSIZE;
3194 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3195 != (size_t)(-1)) {
3196 write (1, outbuffer, OUTBUFSIZE - outleft);
3199 if (iconv_close(icdsc) == -1)
3202 return 0;
3205 _iconv=no
3206 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3207 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3208 _iconv=yes && break
3209 done
3211 if test "$_iconv" = yes ; then
3212 _def_iconv='#define CONFIG_ICONV 1'
3213 else
3214 _def_iconv='#undef CONFIG_ICONV'
3216 echores "$_iconv"
3219 echocheck "soundcard.h"
3220 _soundcard_h=no
3221 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3222 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3223 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3224 cat > $TMPC << EOF
3225 #include <$_soundcard_header>
3226 int main(void) { return 0; }
3228 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3229 done
3231 if test "$_soundcard_h" = yes ; then
3232 if test $_soundcard_header = "sys/soundcard.h"; then
3233 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3234 else
3235 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3238 echores "$_soundcard_h"
3241 echocheck "sys/dvdio.h"
3242 cat > $TMPC << EOF
3243 #include <unistd.h>
3244 #include <sys/dvdio.h>
3245 int main(void) { return 0; }
3247 _dvdio=no
3248 cc_check && _dvdio=yes
3249 if test "$_dvdio" = yes ; then
3250 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3251 else
3252 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3254 echores "$_dvdio"
3257 echocheck "sys/cdio.h"
3258 cat > $TMPC << EOF
3259 #include <unistd.h>
3260 #include <sys/cdio.h>
3261 int main(void) { return 0; }
3263 _cdio=no
3264 cc_check && _cdio=yes
3265 if test "$_cdio" = yes ; then
3266 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3267 else
3268 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3270 echores "$_cdio"
3273 echocheck "linux/cdrom.h"
3274 cat > $TMPC << EOF
3275 #include <sys/types.h>
3276 #include <linux/cdrom.h>
3277 int main(void) { return 0; }
3279 _cdrom=no
3280 cc_check && _cdrom=yes
3281 if test "$_cdrom" = yes ; then
3282 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3283 else
3284 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3286 echores "$_cdrom"
3289 echocheck "dvd.h"
3290 cat > $TMPC << EOF
3291 #include <dvd.h>
3292 int main(void) { return 0; }
3294 _dvd=no
3295 cc_check && _dvd=yes
3296 if test "$_dvd" = yes ; then
3297 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3298 else
3299 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3301 echores "$_dvd"
3304 if bsdos; then
3305 echocheck "BSDI dvd.h"
3306 cat > $TMPC << EOF
3307 #include <dvd.h>
3308 int main(void) { return 0; }
3310 _bsdi_dvd=no
3311 cc_check && _bsdi_dvd=yes
3312 if test "$_bsdi_dvd" = yes ; then
3313 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3314 else
3315 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3317 echores "$_bsdi_dvd"
3318 fi #if bsdos
3321 if hpux; then
3322 # also used by AIX, but AIX does not support VCD and/or libdvdread
3323 echocheck "HP-UX SCSI header"
3324 cat > $TMPC << EOF
3325 #include <sys/scsi.h>
3326 int main(void) { return 0; }
3328 _hpux_scsi_h=no
3329 cc_check && _hpux_scsi_h=yes
3330 if test "$_hpux_scsi_h" = yes ; then
3331 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3332 else
3333 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3335 echores "$_hpux_scsi_h"
3336 fi #if hpux
3339 if sunos; then
3340 echocheck "userspace SCSI headers (Solaris)"
3341 cat > $TMPC << EOF
3342 #include <unistd.h>
3343 #include <stropts.h>
3344 #include <sys/scsi/scsi_types.h>
3345 #include <sys/scsi/impl/uscsi.h>
3346 int main(void) { return 0; }
3348 _sol_scsi_h=no
3349 cc_check && _sol_scsi_h=yes
3350 if test "$_sol_scsi_h" = yes ; then
3351 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3352 else
3353 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3355 echores "$_sol_scsi_h"
3356 fi #if sunos
3359 echocheck "termcap"
3360 if test "$_termcap" = auto ; then
3361 cat > $TMPC <<EOF
3362 #include <stddef.h>
3363 #include <term.h>
3364 int main(void) { tgetent(NULL, NULL); return 0; }
3366 _termcap=no
3367 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3368 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3369 && _termcap=yes && break
3370 done
3372 if test "$_termcap" = yes ; then
3373 _def_termcap='#define HAVE_TERMCAP 1'
3374 _res_comment="using $_ld_tmp"
3375 else
3376 _def_termcap='#undef HAVE_TERMCAP'
3378 echores "$_termcap"
3381 echocheck "termios"
3382 _def_termios='#undef HAVE_TERMIOS'
3383 _def_termios_h='#undef HAVE_TERMIOS_H'
3384 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3385 if test "$_termios" = auto ; then
3386 _termios=no
3387 for _termios_header in "sys/termios.h" "termios.h"; do
3388 cat > $TMPC <<EOF
3389 #include <$_termios_header>
3390 int main(void) { return 0; }
3392 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3393 done
3396 if test "$_termios" = yes ; then
3397 _def_termios='#define HAVE_TERMIOS 1'
3398 if test "$_termios_header" = "termios.h" ; then
3399 _def_termios_h='#define HAVE_TERMIOS_H 1'
3400 else
3401 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3404 echores "$_termios"
3407 echocheck "shm"
3408 if test "$_shm" = auto ; then
3409 cat > $TMPC << EOF
3410 #include <sys/types.h>
3411 #include <sys/shm.h>
3412 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3414 _shm=no
3415 cc_check && _shm=yes
3417 if test "$_shm" = yes ; then
3418 _def_shm='#define HAVE_SHM 1'
3419 else
3420 _def_shm='#undef HAVE_SHM'
3422 echores "$_shm"
3425 echocheck "strsep()"
3426 cat > $TMPC << EOF
3427 #include <string.h>
3428 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3430 _strsep=no
3431 cc_check && _strsep=yes
3432 if test "$_strsep" = yes ; then
3433 _def_strsep='#define HAVE_STRSEP 1'
3434 _need_strsep=no
3435 else
3436 _def_strsep='#undef HAVE_STRSEP'
3437 _need_strsep=yes
3439 echores "$_strsep"
3442 echocheck "vsscanf()"
3443 cat > $TMPC << EOF
3444 #include <stdarg.h>
3445 int main(void) { vsscanf(0, 0, 0); return 0; }
3447 _vsscanf=no
3448 cc_check && _vsscanf=yes
3449 if test "$_vsscanf" = yes ; then
3450 _def_vsscanf='#define HAVE_VSSCANF 1'
3451 _need_vsscanf=no
3452 else
3453 _def_vsscanf='#undef HAVE_VSSCANF'
3454 _need_vsscanf=yes
3456 echores "$_vsscanf"
3459 echocheck "swab()"
3460 cat > $TMPC << EOF
3461 #include <unistd.h>
3462 int main(void) { swab(0, 0, 0); return 0; }
3464 _swab=no
3465 cc_check && _swab=yes
3466 if test "$_swab" = yes ; then
3467 _def_swab='#define HAVE_SWAB 1'
3468 _need_swab=no
3469 else
3470 _def_swab='#undef HAVE_SWAB'
3471 _need_swab=yes
3473 echores "$_swab"
3475 echocheck "POSIX select()"
3476 cat > $TMPC << EOF
3477 #include <stdio.h>
3478 #include <stdlib.h>
3479 #include <sys/types.h>
3480 #include <string.h>
3481 #include <sys/time.h>
3482 #include <unistd.h>
3483 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3485 _posix_select=no
3486 _def_posix_select='#undef HAVE_POSIX_SELECT'
3487 #select() of kLIBC (OS/2) supports socket only
3488 ! os2 && cc_check && _posix_select=yes \
3489 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3490 echores "$_posix_select"
3493 echocheck "gettimeofday()"
3494 cat > $TMPC << EOF
3495 #include <stdio.h>
3496 #include <sys/time.h>
3497 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3499 _gettimeofday=no
3500 cc_check && _gettimeofday=yes
3501 if test "$_gettimeofday" = yes ; then
3502 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3503 _need_gettimeofday=no
3504 else
3505 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3506 _need_gettimeofday=yes
3508 echores "$_gettimeofday"
3511 echocheck "glob()"
3512 cat > $TMPC << EOF
3513 #include <stdio.h>
3514 #include <glob.h>
3515 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3517 _glob=no
3518 cc_check && _glob=yes
3519 if test "$_glob" = yes ; then
3520 _def_glob='#define HAVE_GLOB 1'
3521 _need_glob=no
3522 else
3523 _def_glob='#undef HAVE_GLOB'
3524 _need_glob=yes
3526 echores "$_glob"
3529 echocheck "setenv()"
3530 cat > $TMPC << EOF
3531 #include <stdlib.h>
3532 int main(void) { setenv("","",0); return 0; }
3534 _setenv=no
3535 cc_check && _setenv=yes
3536 if test "$_setenv" = yes ; then
3537 _def_setenv='#define HAVE_SETENV 1'
3538 _need_setenv=no
3539 else
3540 _def_setenv='#undef HAVE_SETENV'
3541 _need_setenv=yes
3543 echores "$_setenv"
3546 if sunos; then
3547 echocheck "sysi86()"
3548 cat > $TMPC << EOF
3549 #include <sys/sysi86.h>
3550 int main(void) { sysi86(0); return 0; }
3552 _sysi86=no
3553 cc_check && _sysi86=yes
3554 if test "$_sysi86" = yes ; then
3555 _def_sysi86='#define HAVE_SYSI86 1'
3556 cat > $TMPC << EOF
3557 #include <sys/sysi86.h>
3558 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3560 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3561 else
3562 _def_sysi86='#undef HAVE_SYSI86'
3564 echores "$_sysi86"
3565 fi #if sunos
3568 echocheck "sys/sysinfo.h"
3569 cat > $TMPC << EOF
3570 #include <sys/sysinfo.h>
3571 int main(void) {
3572 struct sysinfo s_info;
3573 sysinfo(&s_info);
3574 return 0;
3577 _sys_sysinfo=no
3578 cc_check && _sys_sysinfo=yes
3579 if test "$_sys_sysinfo" = yes ; then
3580 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3581 else
3582 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3584 echores "$_sys_sysinfo"
3587 if darwin; then
3589 echocheck "Mac OS X APIs"
3590 if test "$_macosx" = auto ; then
3591 productName=`/usr/bin/sw_vers -productName`
3592 if test "$productName" = "Mac OS X" ||
3593 test "$productName" = "Mac OS X Server" ; then
3594 _macosx=yes
3595 else
3596 _macosx=no
3597 _noaomodules="macosx $_noaomodules"
3598 _novomodules="quartz $_novomodules"
3601 if test "$_macosx" = yes ; then
3602 cat > $TMPC <<EOF
3603 #include <Carbon/Carbon.h>
3604 #include <QuickTime/QuickTime.h>
3605 #include <CoreAudio/CoreAudio.h>
3606 int main(void) {
3607 EnterMovies();
3608 ExitMovies();
3609 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3610 return 0;
3613 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3614 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3615 _coreaudio=yes
3616 _def_coreaudio='#define CONFIG_COREAUDIO 1'
3617 _aosrc="$_aosrc ao_macosx.c"
3618 _aomodules="macosx $_aomodules"
3619 _def_quartz='#define CONFIG_QUARTZ 1'
3620 _vosrc="$_vosrc vo_quartz.c"
3621 _vomodules="quartz $_vomodules"
3622 _def_quicktime='#define CONFIG_QUICKTIME 1'
3623 else
3624 _macosx=no
3625 _coreaudio=no
3626 _def_coreaudio='#undef CONFIG_COREAUDIO'
3627 _noaomodules="macosx $_noaomodules"
3628 _def_quartz='#undef CONFIG_QUARTZ'
3629 _novomodules="quartz $_novomodules"
3630 _def_quicktime='#undef CONFIG_QUICKTIME'
3632 cat > $TMPC <<EOF
3633 #include <Carbon/Carbon.h>
3634 #include <QuartzCore/CoreVideo.h>
3635 int main(void) { return 0; }
3637 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3638 _vosrc="$_vosrc vo_macosx.m"
3639 _vomodules="macosx $_vomodules"
3640 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3641 _def_corevideo='#define CONFIG_COREVIDEO 1'
3642 _corevideo=yes
3643 else
3644 _novomodules="macosx $_novomodules"
3645 _def_corevideo='#undef CONFIG_COREVIDEO'
3646 _corevideo=no
3649 echores "$_macosx"
3651 echocheck "Mac OS X Finder Support"
3652 if test "$_macosx_finder" = auto ; then
3653 _macosx_finder=$_macosx
3655 if test "$_macosx_finder" = yes; then
3656 _def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3657 _macosx_finder=yes
3658 else
3659 _def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3660 _macosx_finder=no
3662 echores "$_macosx_finder"
3664 echocheck "Mac OS X Bundle file locations"
3665 if test "$_macosx_bundle" = auto ; then
3666 _macosx_bundle=$_macosx_finder
3668 if test "$_macosx_bundle" = yes; then
3669 _def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3670 else
3671 _def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3672 _macosx_bundle=no
3674 echores "$_macosx_bundle"
3676 echocheck "Apple Remote"
3677 if test "$_apple_remote" = auto ; then
3678 _apple_remote=no
3679 cat > $TMPC <<EOF
3680 #include <stdio.h>
3681 #include <IOKit/IOCFPlugIn.h>
3682 int main(void) {
3683 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3684 CFMutableDictionaryRef hidMatchDictionary;
3685 IOReturn ioReturnValue;
3687 // Set up a matching dictionary to search the I/O Registry by class.
3688 // name for all HID class devices
3689 hidMatchDictionary = IOServiceMatching("AppleIRController");
3691 // Now search I/O Registry for matching devices.
3692 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3693 hidMatchDictionary, &hidObjectIterator);
3695 // If search is unsuccessful, return nonzero.
3696 if (ioReturnValue != kIOReturnSuccess ||
3697 !IOIteratorIsValid(hidObjectIterator)) {
3698 return 1;
3700 return 0;
3703 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3705 if test "$_apple_remote" = yes ; then
3706 _def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3707 _ld_extra="$_ld_extra -framework IOKit"
3708 else
3709 _def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3711 echores "$_apple_remote"
3713 fi #if darwin
3715 if linux; then
3717 echocheck "Apple IR"
3718 if test "$_apple_ir" = auto ; then
3719 _apple_ir=no
3720 cat > $TMPC <<EOF
3721 #include <linux/types.h>
3722 #include <linux/input.h>
3723 int main(void) {
3724 struct input_event ev;
3725 struct input_id id;
3726 return 0;
3729 cc_check && tmp_run && _apple_ir=yes
3731 if test "$_apple_ir" = yes ; then
3732 _def_apple_ir='#define CONFIG_APPLE_IR 1'
3733 else
3734 _def_apple_ir='#undef CONFIG_APPLE_IR'
3736 echores "$_apple_ir"
3737 fi #if linux
3739 echocheck "pkg-config"
3740 _pkg_config=pkg-config
3741 if `$_pkg_config --version > /dev/null 2>&1`; then
3742 if test "$_ld_static"; then
3743 _pkg_config="$_pkg_config --static"
3745 echores "yes"
3746 else
3747 _pkg_config=false
3748 echores "no"
3752 echocheck "Samba support (libsmbclient)"
3753 if test "$_smb" = yes; then
3754 _ld_extra="$_ld_extra -lsmbclient"
3756 if test "$_smb" = auto; then
3757 _smb=no
3758 cat > $TMPC << EOF
3759 #include <libsmbclient.h>
3760 int main(void) { smbc_opendir("smb://"); return 0; }
3762 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3763 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3764 _smb=yes && break
3765 done
3768 if test "$_smb" = yes; then
3769 _def_smb="#define CONFIG_LIBSMBCLIENT"
3770 _inputmodules="smb $_inputmodules"
3771 else
3772 _def_smb="#undef CONFIG_LIBSMBCLIENT"
3773 _noinputmodules="smb $_noinputmodules"
3775 echores "$_smb"
3778 #########
3779 # VIDEO #
3780 #########
3783 echocheck "tdfxfb"
3784 if test "$_tdfxfb" = yes ; then
3785 _def_tdfxfb='#define CONFIG_TDFXFB 1'
3786 _vosrc="$_vosrc vo_tdfxfb.c"
3787 _vomodules="tdfxfb $_vomodules"
3788 else
3789 _def_tdfxfb='#undef CONFIG_TDFXFB'
3790 _novomodules="tdfxfb $_novomodules"
3792 echores "$_tdfxfb"
3794 echocheck "s3fb"
3795 if test "$_s3fb" = yes ; then
3796 _def_s3fb='#define CONFIG_S3FB 1'
3797 _vosrc="$_vosrc vo_s3fb.c"
3798 _vomodules="s3fb $_vomodules"
3799 else
3800 _def_s3fb='#undef CONFIG_S3FB'
3801 _novomodules="s3fb $_novomodules"
3803 echores "$_s3fb"
3805 echocheck "wii"
3806 if test "$_wii" = yes ; then
3807 _def_wii='#define CONFIG_WII 1'
3808 _vosrc="$_vosrc vo_wii.c"
3809 _vomodules="wii $_vomodules"
3810 else
3811 _def_wii='#undef CONFIG_WII'
3812 _novomodules="wii $_novomodules"
3814 echores "$_wii"
3816 echocheck "tdfxvid"
3817 if test "$_tdfxvid" = yes ; then
3818 _def_tdfxvid='#define CONFIG_TDFX_VID 1'
3819 _vosrc="$_vosrc vo_tdfx_vid.c"
3820 _vomodules="tdfx_vid $_vomodules"
3821 else
3822 _def_tdfxvid='#undef CONFIG_TDFX_VID'
3823 _novomodules="tdfx_vid $_novomodules"
3825 echores "$_tdfxvid"
3827 echocheck "xvr100"
3828 if test "$_xvr100" = auto ; then
3829 cat > $TMPC << EOF
3830 #include <unistd.h>
3831 #include <sys/fbio.h>
3832 #include <sys/visual_io.h>
3833 int main(void) {
3834 struct vis_identifier ident;
3835 struct fbgattr attr;
3836 ioctl(0, VIS_GETIDENTIFIER, &ident);
3837 ioctl(0, FBIOGATTR, &attr);
3838 return 0;
3841 _xvr100=no
3842 cc_check && _xvr100=yes
3844 if test "$_xvr100" = yes ; then
3845 _def_xvr100='#define CONFIG_XVR100 1'
3846 _vosrc="$_vosrc vo_xvr100.c"
3847 _vomodules="xvr100 $_vomodules"
3848 else
3849 _def_tdfxvid='#undef CONFIG_XVR100'
3850 _novomodules="xvr100 $_novomodules"
3852 echores "$_xvr100"
3854 echocheck "tga"
3855 if test "$_tga" = yes ; then
3856 _def_tga='#define CONFIG_TGA 1'
3857 _vosrc="$_vosrc vo_tga.c"
3858 _vomodules="tga $_vomodules"
3859 else
3860 _def_tga='#undef CONFIG_TGA'
3861 _novomodules="tga $_novomodules"
3863 echores "$_tga"
3866 echocheck "md5sum support"
3867 if test "$_md5sum" = yes; then
3868 _def_md5sum="#define CONFIG_MD5SUM"
3869 _vosrc="$_vosrc vo_md5sum.c"
3870 _vomodules="md5sum $_vomodules"
3871 else
3872 _def_md5sum="#undef CONFIG_MD5SUM"
3873 _novomodules="md5sum $_novomodules"
3875 echores "$_md5sum"
3878 echocheck "yuv4mpeg support"
3879 if test "$_yuv4mpeg" = yes; then
3880 _def_yuv4mpeg="#define CONFIG_YUV4MPEG"
3881 _vosrc="$_vosrc vo_yuv4mpeg.c"
3882 _vomodules="yuv4mpeg $_vomodules"
3883 else
3884 _def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3885 _novomodules="yuv4mpeg $_novomodules"
3887 echores "$_yuv4mpeg"
3890 echocheck "bl"
3891 if test "$_bl" = yes ; then
3892 _def_bl='#define CONFIG_BL 1'
3893 _vosrc="$_vosrc vo_bl.c"
3894 _vomodules="bl $_vomodules"
3895 else
3896 _def_bl='#undef CONFIG_BL'
3897 _novomodules="bl $_novomodules"
3899 echores "$_bl"
3902 echocheck "DirectFB"
3903 if test "$_directfb" = auto ; then
3904 _directfb=no
3905 cat > $TMPC <<EOF
3906 #include <directfb.h>
3907 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3909 for _inc_tmp in "" -I/usr/local/include/directfb \
3910 -I/usr/include/directfb -I/usr/local/include; do
3911 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3912 _inc_extra="$_inc_extra $_inc_tmp" && break
3913 done
3916 dfb_version() {
3917 expr $1 \* 65536 + $2 \* 256 + $3
3920 if test "$_directfb" = yes; then
3921 cat > $TMPC << EOF
3922 #include <directfb_version.h>
3924 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3927 if $_cc -E $TMPC $_inc_extra > "$TMPEXE"; then
3928 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'`
3929 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3930 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3931 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3932 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3933 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3934 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3935 _res_comment="$_directfb_version"
3936 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3937 else
3938 _def_directfb_version='#undef DIRECTFBVERSION'
3939 _directfb=no
3940 _res_comment="version >=0.9.13 required"
3942 else
3943 _directfb=no
3944 _res_comment="failed to get version"
3947 echores "$_directfb"
3949 if test "$_directfb" = yes ; then
3950 _def_directfb='#define CONFIG_DIRECTFB 1'
3951 _vosrc="$_vosrc vo_directfb2.c"
3952 _vomodules="directfb $_vomodules"
3953 _libs_mplayer="$_libs_mplayer -ldirectfb"
3954 else
3955 _def_directfb='#undef CONFIG_DIRECTFB'
3956 _novomodules="directfb $_novomodules"
3958 if test "$_dfbmga" = yes; then
3959 _vosrc="$_vosrc vo_dfbmga.c"
3960 _vomodules="dfbmga $_vomodules"
3961 _def_dfbmga='#define CONFIG_DFBMGA 1'
3962 else
3963 _novomodules="dfbmga $_novomodules"
3964 _def_dfbmga='#undef CONFIG_DFBMGA'
3968 echocheck "X11 headers presence"
3969 _x11_headers="no"
3970 _res_comment="check if the dev(el) packages are installed"
3971 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3972 if test -f "$I/X11/Xlib.h" ; then
3973 _x11_headers="yes"
3974 _res_comment=""
3975 break
3977 done
3978 if test $_cross_compile = no; then
3979 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3980 if test -f "$I/X11/Xlib.h" ; then
3981 _inc_extra="$_inc_extra -I$I"
3982 _x11_headers="yes"
3983 _res_comment="using $I"
3984 break
3986 done
3988 echores "$_x11_headers"
3991 echocheck "X11"
3992 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3993 cat > $TMPC <<EOF
3994 #include <X11/Xlib.h>
3995 #include <X11/Xutil.h>
3996 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3998 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3999 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
4000 if netbsd; then
4001 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
4002 else
4003 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4005 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
4006 && _x11=yes && break
4007 done
4009 if test "$_x11" = yes ; then
4010 _def_x11='#define CONFIG_X11 1'
4011 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
4012 _vomodules="x11 xover $_vomodules"
4013 else
4014 _x11=no
4015 _def_x11='#undef CONFIG_X11'
4016 _novomodules="x11 $_novomodules"
4017 _res_comment="check if the dev(el) packages are installed"
4018 # disable stuff that depends on X
4019 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
4021 echores "$_x11"
4023 echocheck "Xss screensaver extensions"
4024 if test "$_xss" = auto ; then
4025 cat > $TMPC << EOF
4026 #include <X11/Xlib.h>
4027 #include <X11/extensions/scrnsaver.h>
4028 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4030 _xss=no
4031 cc_check -lXss && _xss=yes
4033 if test "$_xss" = yes ; then
4034 _def_xss='#define CONFIG_XSS 1'
4035 _libs_mplayer="$_libs_mplayer -lXss"
4036 else
4037 _def_xss='#undef CONFIG_XSS'
4039 echores "$_xss"
4041 echocheck "DPMS"
4042 _xdpms3=no
4043 _xdpms4=no
4044 if test "$_x11" = yes ; then
4045 cat > $TMPC <<EOF
4046 #include <X11/Xmd.h>
4047 #include <X11/Xlib.h>
4048 #include <X11/Xutil.h>
4049 #include <X11/Xatom.h>
4050 #include <X11/extensions/dpms.h>
4051 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4053 cc_check -lXdpms && _xdpms3=yes
4054 cat > $TMPC <<EOF
4055 #include <X11/Xlib.h>
4056 #include <X11/extensions/dpms.h>
4057 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4059 cc_check -lXext && _xdpms4=yes
4061 if test "$_xdpms4" = yes ; then
4062 _def_xdpms='#define CONFIG_XDPMS 1'
4063 _res_comment="using Xdpms 4"
4064 echores "yes"
4065 elif test "$_xdpms3" = yes ; then
4066 _def_xdpms='#define CONFIG_XDPMS 1'
4067 _libs_mplayer="$_libs_mplayer -lXdpms"
4068 _res_comment="using Xdpms 3"
4069 echores "yes"
4070 else
4071 _def_xdpms='#undef CONFIG_XDPMS'
4072 echores "no"
4076 echocheck "Xv"
4077 if test "$_xv" = auto ; then
4078 cat > $TMPC <<EOF
4079 #include <X11/Xlib.h>
4080 #include <X11/extensions/Xvlib.h>
4081 int main(void) {
4082 (void) XvGetPortAttribute(0, 0, 0, 0);
4083 (void) XvQueryPortAttributes(0, 0, 0);
4084 return 0; }
4086 _xv=no
4087 cc_check -lXv && _xv=yes
4090 if test "$_xv" = yes ; then
4091 _def_xv='#define CONFIG_XV 1'
4092 _libs_mplayer="$_libs_mplayer -lXv"
4093 _vosrc="$_vosrc vo_xv.c"
4094 _vomodules="xv $_vomodules"
4095 else
4096 _def_xv='#undef CONFIG_XV'
4097 _novomodules="xv $_novomodules"
4099 echores "$_xv"
4102 echocheck "XvMC"
4103 if test "$_xv" = yes && test "$_xvmc" != no ; then
4104 _xvmc=no
4105 cat > $TMPC <<EOF
4106 #include <X11/Xlib.h>
4107 #include <X11/extensions/Xvlib.h>
4108 #include <X11/extensions/XvMClib.h>
4109 int main(void) {
4110 (void) XvMCQueryExtension(0,0,0);
4111 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4112 return 0; }
4114 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4115 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4116 done
4118 if test "$_xvmc" = yes ; then
4119 _def_xvmc='#define HAVE_XVMC 1'
4120 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
4121 _vosrc="$_vosrc vo_xvmc.c"
4122 _vomodules="xvmc $_vomodules"
4123 _res_comment="using $_xvmclib"
4124 else
4125 _def_xvmc='#undef HAVE_XVMC'
4126 _novomodules="xvmc $_novomodules"
4127 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4129 echores "$_xvmc"
4132 echocheck "Xinerama"
4133 if test "$_xinerama" = auto ; then
4134 cat > $TMPC <<EOF
4135 #include <X11/Xlib.h>
4136 #include <X11/extensions/Xinerama.h>
4137 int main(void) { (void) XineramaIsActive(0); return 0; }
4139 _xinerama=no
4140 cc_check -lXinerama && _xinerama=yes
4143 if test "$_xinerama" = yes ; then
4144 _def_xinerama='#define CONFIG_XINERAMA 1'
4145 _libs_mplayer="$_libs_mplayer -lXinerama"
4146 else
4147 _def_xinerama='#undef CONFIG_XINERAMA'
4149 echores "$_xinerama"
4152 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4153 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4154 # named 'X extensions' or something similar.
4155 # This check may be useful for future mplayer versions (to change resolution)
4156 # If you run into problems, remove '-lXxf86vm'.
4157 echocheck "Xxf86vm"
4158 if test "$_vm" = auto ; then
4159 cat > $TMPC <<EOF
4160 #include <X11/Xlib.h>
4161 #include <X11/extensions/xf86vmode.h>
4162 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4164 _vm=no
4165 cc_check -lXxf86vm && _vm=yes
4167 if test "$_vm" = yes ; then
4168 _def_vm='#define CONFIG_XF86VM 1'
4169 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4170 else
4171 _def_vm='#undef CONFIG_XF86VM'
4173 echores "$_vm"
4175 # Check for the presence of special keycodes, like audio control buttons
4176 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4177 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4178 # have these new keycodes.
4179 echocheck "XF86keysym"
4180 if test "$_xf86keysym" = auto; then
4181 _xf86keysym=no
4182 cat > $TMPC <<EOF
4183 #include <X11/Xlib.h>
4184 #include <X11/XF86keysym.h>
4185 int main(void) { return XF86XK_AudioPause; }
4187 cc_check && _xf86keysym=yes
4189 if test "$_xf86keysym" = yes ; then
4190 _def_xf86keysym='#define CONFIG_XF86XK 1'
4191 else
4192 _def_xf86keysym='#undef CONFIG_XF86XK'
4194 echores "$_xf86keysym"
4196 echocheck "DGA"
4197 if test "$_dga2" = auto && test "$_x11" = yes ; then
4198 cat > $TMPC << EOF
4199 #include <X11/Xlib.h>
4200 #include <X11/extensions/xf86dga.h>
4201 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4203 _dga2=no
4204 cc_check -lXxf86dga && _dga2=yes
4206 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4207 cat > $TMPC << EOF
4208 #include <X11/Xlib.h>
4209 #include <X11/extensions/xf86dga.h>
4210 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4212 _dga1=no
4213 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4216 _dga=no
4217 _def_dga='#undef CONFIG_DGA'
4218 _def_dga1='#undef CONFIG_DGA1'
4219 _def_dga2='#undef CONFIG_DGA2'
4220 if test "$_dga1" = yes ; then
4221 _dga=yes
4222 _def_dga1='#define CONFIG_DGA1 1'
4223 _res_comment="using DGA 1.0"
4224 elif test "$_dga2" = yes ; then
4225 _dga=yes
4226 _def_dga2='#define CONFIG_DGA2 1'
4227 _res_comment="using DGA 2.0"
4229 if test "$_dga" = yes ; then
4230 _def_dga='#define CONFIG_DGA 1'
4231 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4232 _vosrc="$_vosrc vo_dga.c"
4233 _vomodules="dga $_vomodules"
4234 else
4235 _novomodules="dga $_novomodules"
4237 echores "$_dga"
4240 echocheck "3dfx"
4241 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4242 _def_3dfx='#define CONFIG_3DFX 1'
4243 _vosrc="$_vosrc vo_3dfx.c"
4244 _vomodules="3dfx $_vomodules"
4245 else
4246 _def_3dfx='#undef CONFIG_3DFX'
4247 _novomodules="3dfx $_novomodules"
4249 echores "$_3dfx"
4252 echocheck "OpenGL"
4253 #Note: this test is run even with --enable-gl since we autodetect linker flags
4254 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4255 cat > $TMPC << EOF
4256 #include <GL/gl.h>
4257 #ifdef GL_WIN32
4258 #include <windows.h>
4259 #include <GL/glext.h>
4260 #else
4261 #include <X11/Xlib.h>
4262 #include <GL/glx.h>
4263 #endif
4264 int main(void) {
4265 #ifdef GL_WIN32
4266 HDC dc;
4267 wglCreateContext(dc);
4268 #else
4269 glXCreateContext(NULL, NULL, NULL, True);
4270 #endif
4271 glFinish();
4272 return 0;
4275 _gl=no
4276 if cc_check -lGL $_ld_lm ; then
4277 _gl=yes
4278 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4279 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4280 _gl=yes
4281 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4282 elif cc_check -DGL_WIN32 -lopengl32 ; then
4283 _gl=yes
4284 _gl_win32=yes
4285 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4287 else
4288 _gl=no
4290 if test "$_gl" = yes ; then
4291 _def_gl='#define CONFIG_GL 1'
4292 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4293 if test "$_gl_win32" = yes ; then
4294 _def_gl_win32='#define GL_WIN32 1'
4295 _vosrc="$_vosrc w32_common.c"
4296 _res_comment="win32 version"
4298 _vomodules="opengl $_vomodules"
4299 else
4300 _def_gl='#undef CONFIG_GL'
4301 _def_gl_win32='#undef GL_WIN32'
4302 _novomodules="opengl $_novomodules"
4304 echores "$_gl"
4307 echocheck "VIDIX"
4308 _def_vidix='#undef CONFIG_VIDIX'
4309 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4310 _vidix_drv_cyberblade=no
4311 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4312 _vidix_drv_ivtv=no
4313 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4314 _vidix_drv_ivtv=no
4315 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4316 _vidix_drv_mach64=no
4317 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4318 _vidix_drv_mga=no
4319 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4320 _vidix_drv_mga_crtc2=no
4321 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4322 _vidix_drv_nvidia=no
4323 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4324 _vidix_drv_pm2=no
4325 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4326 _vidix_drv_pm3=no
4327 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4328 _vidix_drv_radeon=no
4329 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4330 _vidix_drv_rage128=no
4331 _def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4332 _vidix_drv_s3=no
4333 _def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4334 _vidix_drv_sh_veu=no
4335 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4336 _vidix_drv_sis=no
4337 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4338 _vidix_drv_unichrome=no
4339 if test "$_vidix" = auto ; then
4340 _vidix=no
4341 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4342 && _vidix=yes
4343 (ppc || alpha) && linux && _vidix=yes
4345 echores "$_vidix"
4347 if test "$_vidix" = yes ; then
4348 _def_vidix='#define CONFIG_VIDIX 1'
4349 _vosrc="$_vosrc vo_cvidix.c"
4350 _vomodules="cvidix $_vomodules"
4351 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4352 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4354 # some vidix drivers are architecture and os specific, discard them elsewhere
4355 x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//`
4356 (test $host_arch = "sh" && linux) || _vidix_drivers=`echo $_vidix_drivers | sed s/sh_veu//`
4358 for driver in $_vidix_drivers ; do
4359 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4360 eval _vidix_drv_${driver}=yes
4361 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4362 done
4364 echocheck "VIDIX PCI device name database"
4365 echores "$_vidix_pcidb"
4366 if test "$_vidix_pcidb" = yes ; then
4367 _vidix_pcidb_val=1
4368 else
4369 _vidix_pcidb_val=0
4372 echocheck "VIDIX dhahelper support"
4373 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4374 echores "$_dhahelper"
4376 echocheck "VIDIX svgalib_helper support"
4377 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4378 echores "$_svgalib_helper"
4380 else
4381 _novomodules="cvidix $_novomodules"
4384 if test "$_vidix" = yes && win32; then
4385 _vosrc="$_vosrc vo_winvidix.c"
4386 _vomodules="winvidix $_vomodules"
4387 _libs_mplayer="$_libs_mplayer -lgdi32"
4388 else
4389 _novomodules="winvidix $_novomodules"
4391 if test "$_vidix" = yes && test "$_x11" = yes; then
4392 _vosrc="$_vosrc vo_xvidix.c"
4393 _vomodules="xvidix $_vomodules"
4394 else
4395 _novomodules="xvidix $_novomodules"
4398 echocheck "/dev/mga_vid"
4399 if test "$_mga" = auto ; then
4400 _mga=no
4401 test -c /dev/mga_vid && _mga=yes
4403 if test "$_mga" = yes ; then
4404 _def_mga='#define CONFIG_MGA 1'
4405 _vosrc="$_vosrc vo_mga.c"
4406 _vomodules="mga $_vomodules"
4407 else
4408 _def_mga='#undef CONFIG_MGA'
4409 _novomodules="mga $_novomodules"
4411 echores "$_mga"
4414 echocheck "xmga"
4415 if test "$_xmga" = auto ; then
4416 _xmga=no
4417 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4419 if test "$_xmga" = yes ; then
4420 _def_xmga='#define CONFIG_XMGA 1'
4421 _vosrc="$_vosrc vo_xmga.c"
4422 _vomodules="xmga $_vomodules"
4423 else
4424 _def_xmga='#undef CONFIG_XMGA'
4425 _novomodules="xmga $_novomodules"
4427 echores "$_xmga"
4430 echocheck "GGI"
4431 if test "$_ggi" = auto ; then
4432 cat > $TMPC << EOF
4433 #include <ggi/ggi.h>
4434 int main(void) { ggiInit(); return 0; }
4436 _ggi=no
4437 cc_check -lggi && _ggi=yes
4439 if test "$_ggi" = yes ; then
4440 _def_ggi='#define CONFIG_GGI 1'
4441 _libs_mplayer="$_libs_mplayer -lggi"
4442 _vosrc="$_vosrc vo_ggi.c"
4443 _vomodules="ggi $_vomodules"
4444 else
4445 _def_ggi='#undef CONFIG_GGI'
4446 _novomodules="ggi $_novomodules"
4448 echores "$_ggi"
4450 echocheck "GGI extension: libggiwmh"
4451 if test "$_ggiwmh" = auto ; then
4452 _ggiwmh=no
4453 cat > $TMPC << EOF
4454 #include <ggi/ggi.h>
4455 #include <ggi/wmh.h>
4456 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4458 cc_check -lggi -lggiwmh && _ggiwmh=yes
4460 # needed to get right output on obscure combination
4461 # like --disable-ggi --enable-ggiwmh
4462 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4463 _def_ggiwmh='#define CONFIG_GGIWMH 1'
4464 _libs_mplayer="$_libs_mplayer -lggiwmh"
4465 else
4466 _ggiwmh=no
4467 _def_ggiwmh='#undef CONFIG_GGIWMH'
4469 echores "$_ggiwmh"
4472 echocheck "AA"
4473 if test "$_aa" = auto ; then
4474 cat > $TMPC << EOF
4475 #include <aalib.h>
4476 extern struct aa_hardware_params aa_defparams;
4477 extern struct aa_renderparams aa_defrenderparams;
4478 int main(void) {
4479 aa_context *c;
4480 aa_renderparams *p;
4481 (void) aa_init(0, 0, 0);
4482 c = aa_autoinit(&aa_defparams);
4483 p = aa_getrenderparams();
4484 aa_autoinitkbd(c,0);
4485 return 0; }
4487 _aa=no
4488 for _ld_tmp in "-laa" ; do
4489 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4490 done
4492 if test "$_aa" = yes ; then
4493 _def_aa='#define CONFIG_AA 1'
4494 if cygwin ; then
4495 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4497 _vosrc="$_vosrc vo_aa.c"
4498 _vomodules="aa $_vomodules"
4499 else
4500 _def_aa='#undef CONFIG_AA'
4501 _novomodules="aa $_novomodules"
4503 echores "$_aa"
4506 echocheck "CACA"
4507 if test "$_caca" = auto ; then
4508 _caca=no
4509 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4510 cat > $TMPC << EOF
4511 #include <caca.h>
4512 #ifdef CACA_API_VERSION_1
4513 #include <caca0.h>
4514 #endif
4515 int main(void) { (void) caca_init(); return 0; }
4517 cc_check `caca-config --libs` && _caca=yes
4520 if test "$_caca" = yes ; then
4521 _def_caca='#define CONFIG_CACA 1'
4522 _inc_extra="$_inc_extra `caca-config --cflags`"
4523 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4524 _vosrc="$_vosrc vo_caca.c"
4525 _vomodules="caca $_vomodules"
4526 else
4527 _def_caca='#undef CONFIG_CACA'
4528 _novomodules="caca $_novomodules"
4530 echores "$_caca"
4533 echocheck "SVGAlib"
4534 if test "$_svga" = auto ; then
4535 cat > $TMPC << EOF
4536 #include <vga.h>
4537 int main(void) { return 0; }
4539 _svga=no
4540 cc_check -lvga $_ld_lm && _svga=yes
4542 if test "$_svga" = yes ; then
4543 _def_svga='#define CONFIG_SVGALIB 1'
4544 _libs_mplayer="$_libs_mplayer -lvga"
4545 _vosrc="$_vosrc vo_svga.c"
4546 _vomodules="svga $_vomodules"
4547 else
4548 _def_svga='#undef CONFIG_SVGALIB'
4549 _novomodules="svga $_novomodules"
4551 echores "$_svga"
4554 echocheck "FBDev"
4555 if test "$_fbdev" = auto ; then
4556 _fbdev=no
4557 linux && _fbdev=yes
4559 if test "$_fbdev" = yes ; then
4560 _def_fbdev='#define CONFIG_FBDEV 1'
4561 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4562 _vomodules="fbdev $_vomodules"
4563 else
4564 _def_fbdev='#undef CONFIG_FBDEV'
4565 _novomodules="fbdev $_novomodules"
4567 echores "$_fbdev"
4571 echocheck "DVB"
4572 if test "$_dvb" = auto ; then
4573 _dvb=no
4574 cat >$TMPC << EOF
4575 #include <poll.h>
4576 #include <sys/ioctl.h>
4577 #include <stdio.h>
4578 #include <time.h>
4579 #include <unistd.h>
4580 #include <ost/dmx.h>
4581 #include <ost/frontend.h>
4582 #include <ost/sec.h>
4583 #include <ost/video.h>
4584 #include <ost/audio.h>
4585 int main(void) {return 0;}
4587 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4588 cc_check $_inc_tmp && _dvb=yes && \
4589 _inc_extra="$_inc_extra $_inc_tmp" && break
4590 done
4592 echores "$_dvb"
4593 if test "$_dvb" = yes ; then
4594 _def_dvb='#define CONFIG_DVB 1'
4595 _def_dvbin='#define CONFIG_DVBIN 1'
4596 _aomodules="mpegpes(dvb) $_aomodules"
4597 _vomodules="mpegpes(dvb) $_vomodules"
4600 echocheck "DVB HEAD"
4601 if test "$_dvbhead" = auto ; then
4602 _dvbhead=no
4604 cat >$TMPC << EOF
4605 #include <poll.h>
4606 #include <sys/ioctl.h>
4607 #include <stdio.h>
4608 #include <time.h>
4609 #include <unistd.h>
4610 #include <linux/dvb/dmx.h>
4611 #include <linux/dvb/frontend.h>
4612 #include <linux/dvb/video.h>
4613 #include <linux/dvb/audio.h>
4614 int main(void) {return 0;}
4616 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4617 cc_check $_inc_tmp && _dvbhead=yes && \
4618 _inc_extra="$_inc_extra $_inc_tmp" && break
4619 done
4621 echores "$_dvbhead"
4622 if test "$_dvbhead" = yes ; then
4623 _def_dvb='#define CONFIG_DVB 1'
4624 _def_dvb_head='#define CONFIG_DVB_HEAD 1'
4625 _def_dvbin='#define CONFIG_DVBIN 1'
4626 _aomodules="mpegpes(dvb) $_aomodules"
4627 _vomodules="mpegpes(dvb) $_vomodules"
4630 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4631 _def_dvb='#undef CONFIG_DVB'
4632 _def_dvb_head='#undef CONFIG_DVB_HEAD'
4633 _def_dvbin='#undef CONFIG_DVBIN '
4634 _aomodules="mpegpes(file) $_aomodules"
4635 _vomodules="mpegpes(file) $_vomodules"
4638 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4639 _dvbin=yes
4640 _inputmodules="dvb $_inputmodules"
4641 else
4642 _dvbin=no
4643 _noinputmodules="dvb $_noinputmodules"
4649 echocheck "PNG support"
4650 if test "$_png" = auto ; then
4651 _png=no
4652 if irix ; then
4653 # Don't check for -lpng on irix since it has its own libpng
4654 # incompatible with the GNU libpng
4655 _res_comment="disabled on irix (not GNU libpng)"
4656 else
4657 cat > $TMPC << EOF
4658 #include <png.h>
4659 #include <string.h>
4660 int main(void) {
4661 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4662 printf("libpng: %s\n", png_libpng_ver);
4663 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4666 if cc_check -lpng -lz $_ld_lm ; then
4667 if tmp_run ; then
4668 _png=yes
4669 else
4670 _res_comment="mismatch of library and header versions"
4675 echores "$_png"
4676 if test "$_png" = yes ; then
4677 _def_png='#define CONFIG_PNG 1'
4678 _ld_extra="$_ld_extra -lpng -lz"
4679 _vosrc="$_vosrc vo_png.c"
4680 _vomodules="png $_vomodules"
4681 else
4682 _def_png='#undef CONFIG_PNG'
4683 _novomodules="png $_novomodules"
4686 echocheck "JPEG support"
4687 if test "$_jpeg" = auto ; then
4688 _jpeg=no
4689 cat > $TMPC << EOF
4690 #include <stdio.h>
4691 #include <stdlib.h>
4692 #include <setjmp.h>
4693 #include <string.h>
4694 #include <jpeglib.h>
4695 int main(void) { return 0; }
4697 if cc_check -ljpeg $_ld_lm ; then
4698 if tmp_run ; then
4699 _jpeg=yes
4703 echores "$_jpeg"
4705 if test "$_jpeg" = yes ; then
4706 _def_jpeg='#define CONFIG_JPEG 1'
4707 _vosrc="$_vosrc vo_jpeg.c"
4708 _vomodules="jpeg $_vomodules"
4709 _ld_extra="$_ld_extra -ljpeg"
4710 else
4711 _def_jpeg='#undef CONFIG_JPEG'
4712 _novomodules="jpeg $_novomodules"
4717 echocheck "PNM support"
4718 if test "$_pnm" = yes; then
4719 _def_pnm="#define CONFIG_PNM"
4720 _vosrc="$_vosrc vo_pnm.c"
4721 _vomodules="pnm $_vomodules"
4722 else
4723 _def_pnm="#undef CONFIG_PNM"
4724 _novomodules="pnm $_novomodules"
4726 echores "$_pnm"
4730 echocheck "GIF support"
4731 # This is to appease people who want to force gif support.
4732 # If it is forced to yes, then we still do checks to determine
4733 # which gif library to use.
4734 if test "$_gif" = yes ; then
4735 _force_gif=yes
4736 _gif=auto
4739 if test "$_gif" = auto ; then
4740 _gif=no
4741 cat > $TMPC << EOF
4742 #include <gif_lib.h>
4743 int main(void) { return 0; }
4745 for _ld_gif in "-lungif" "-lgif" ; do
4746 cc_check $_ld_gif && tmp_run && _gif=yes && break
4747 done
4750 # If no library was found, and the user wants support forced,
4751 # then we force it on with libgif, as this is the safest
4752 # assumption IMHO. (libungif & libregif both create symbolic
4753 # links to libgif. We also assume that no x11 support is needed,
4754 # because if you are forcing this, then you _should_ know what
4755 # you are doing. [ Besides, package maintainers should never
4756 # have compiled x11 deps into libungif in the first place. ] )
4757 # </rant>
4758 # --Joey
4759 if test "$_force_gif" = yes && test "$_gif" = no ; then
4760 _gif=yes
4761 _ld_gif="-lgif"
4764 if test "$_gif" = yes ; then
4765 _def_gif='#define CONFIG_GIF 1'
4766 _vosrc="$_vosrc vo_gif89a.c"
4767 _codecmodules="gif $_codecmodules"
4768 _vomodules="gif89a $_vomodules"
4769 _res_comment="old version, some encoding functions disabled"
4770 _def_gif_4='#undef CONFIG_GIF_4'
4771 _ld_extra="$_ld_extra $_ld_gif"
4773 cat > $TMPC << EOF
4774 #include <signal.h>
4775 #include <gif_lib.h>
4776 void catch() { exit(1); }
4777 int main(void) {
4778 signal(SIGSEGV, catch); // catch segfault
4779 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4780 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4781 return 0;
4784 if cc_check "$_ld_gif" && tmp_run ; then
4785 _def_gif_4='#define CONFIG_GIF_4 1'
4786 _res_comment=""
4788 else
4789 _def_gif='#undef CONFIG_GIF'
4790 _def_gif_4='#undef CONFIG_GIF_4'
4791 _novomodules="gif89a $_novomodules"
4792 _nocodecmodules="gif $_nocodecmodules"
4794 echores "$_gif"
4797 case "$_gif" in yes*)
4798 echocheck "broken giflib workaround"
4799 _def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4801 cat > $TMPC << EOF
4802 #include <gif_lib.h>
4803 int main(void) {
4804 GifFileType gif;
4805 printf("UserData is at address %p\n", gif.UserData);
4806 return 0;
4809 if cc_check "$_ld_gif" && tmp_run ; then
4810 _def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4811 echores "disabled"
4812 else
4813 echores "enabled"
4816 esac
4819 echocheck "VESA support"
4820 if test "$_vesa" = auto ; then
4821 cat > $TMPC << EOF
4822 #include <vbe.h>
4823 int main(void) { vbeVersion(); return 0; }
4825 _vesa=no
4826 cc_check -lvbe -llrmi && _vesa=yes
4828 if test "$_vesa" = yes ; then
4829 _def_vesa='#define CONFIG_VESA 1'
4830 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4831 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4832 _vomodules="vesa $_vomodules"
4833 else
4834 _def_vesa='#undef CONFIG_VESA'
4835 _novomodules="vesa $_novomodules"
4837 echores "$_vesa"
4839 #################
4840 # VIDEO + AUDIO #
4841 #################
4844 echocheck "SDL"
4845 if test -z "$_sdlconfig" ; then
4846 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4847 _sdlconfig="sdl-config"
4848 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4849 _sdlconfig="sdl11-config"
4850 else
4851 _sdlconfig=false
4854 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4855 cat > $TMPC << EOF
4856 #include <SDL.h>
4857 int main(void) {
4858 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4859 return 0;
4862 _sdl=no
4863 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4864 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4865 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4866 if test "$_sdlversion" -gt 116 ; then
4867 if test "$_sdlversion" -lt 121 ; then
4868 _def_sdlbuggy='#define BUGGY_SDL'
4869 else
4870 _def_sdlbuggy='#undef BUGGY_SDL'
4872 _sdl=yes
4877 if test "$_sdl" = yes ; then
4878 _def_sdl='#define CONFIG_SDL 1'
4879 if cygwin ; then
4880 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4881 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4882 elif mingw32 ; then
4883 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4884 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4885 else
4886 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4887 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4889 _vosrc="$_vosrc vo_sdl.c"
4890 _vomodules="sdl $_vomodules"
4891 _aosrc="$_aosrc ao_sdl.c"
4892 _aomodules="sdl $_aomodules"
4893 _res_comment="using $_sdlconfig"
4894 else
4895 _def_sdl='#undef CONFIG_SDL'
4896 _novomodules="sdl $_novomodules"
4897 _noaomodules="sdl $_noaomodules"
4899 echores "$_sdl"
4902 if win32; then
4904 echocheck "Windows waveout"
4905 if test "$_win32waveout" = auto ; then
4906 cat > $TMPC << EOF
4907 #include <windows.h>
4908 #include <mmsystem.h>
4909 int main(void) { return 0; }
4911 _win32waveout=no
4912 cc_check -lwinmm && _win32waveout=yes
4914 if test "$_win32waveout" = yes ; then
4915 _def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
4916 _libs_mplayer="$_libs_mplayer -lwinmm"
4917 _aosrc="$_aosrc ao_win32.c"
4918 _aomodules="win32 $_aomodules"
4919 else
4920 _def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
4921 _noaomodules="win32 $_noaomodules"
4923 echores "$_win32waveout"
4925 echocheck "Directx"
4926 if test "$_directx" = auto ; then
4927 cat > $TMPC << EOF
4928 #include <windows.h>
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 _vosrc="$_vosrc vo_directx.c"
4940 _vomodules="directx $_vomodules"
4941 _aosrc="$_aosrc ao_dsound.c"
4942 _aomodules="dsound $_aomodules"
4943 else
4944 _def_directx='#undef CONFIG_DIRECTX'
4945 _novomodules="directx $_novomodules"
4946 _noaomodules="dsound $_noaomodules"
4948 echores "$_directx"
4950 fi #if win32; then
4953 echocheck "NAS"
4954 if test "$_nas" = auto ; then
4955 cat > $TMPC << EOF
4956 #include <audio/audiolib.h>
4957 int main(void) { return 0; }
4959 _nas=no
4960 cc_check $_ld_lm -laudio -lXt && _nas=yes
4962 if test "$_nas" = yes ; then
4963 _def_nas='#define CONFIG_NAS 1'
4964 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4965 _aosrc="$_aosrc ao_nas.c"
4966 _aomodules="nas $_aomodules"
4967 else
4968 _noaomodules="nas $_noaomodules"
4969 _def_nas='#undef CONFIG_NAS'
4971 echores "$_nas"
4973 echocheck "DXR2"
4974 if test "$_dxr2" = auto; then
4975 _dxr2=no
4976 cat > $TMPC << EOF
4977 #include <dxr2ioctl.h>
4978 int main(void) { return 0; }
4980 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4981 cc_check $_inc_tmp && _dxr2=yes && \
4982 _inc_extra="$_inc_extra $_inc_tmp" && break
4983 done
4985 if test "$_dxr2" = yes; then
4986 _def_dxr2='#define CONFIG_DXR2 1'
4987 _vosrc="$_vosrc vo_dxr2.c"
4988 _aosrc="$_aosrc ao_dxr2.c"
4989 _aomodules="dxr2 $_aomodules"
4990 _vomodules="dxr2 $_vomodules"
4991 else
4992 _def_dxr2='#undef CONFIG_DXR2'
4993 _noaomodules="dxr2 $_noaomodules"
4994 _novomodules="dxr2 $_novomodules"
4996 echores "$_dxr2"
4998 echocheck "DXR3/H+"
4999 if test "$_dxr3" = auto ; then
5000 cat > $TMPC << EOF
5001 #include <linux/em8300.h>
5002 int main(void) { return 0; }
5004 _dxr3=no
5005 cc_check && _dxr3=yes
5007 if test "$_dxr3" = yes ; then
5008 _def_dxr3='#define CONFIG_DXR3 1'
5009 _vosrc="$_vosrc vo_dxr3.c"
5010 _vomodules="dxr3 $_vomodules"
5011 else
5012 _def_dxr3='#undef CONFIG_DXR3'
5013 _novomodules="dxr3 $_novomodules"
5015 echores "$_dxr3"
5018 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5019 if test "$_ivtv" = auto ; then
5020 cat > $TMPC << EOF
5021 #include <stdlib.h>
5022 #include <inttypes.h>
5023 #include <linux/types.h>
5024 #include <linux/videodev2.h>
5025 #include <linux/ivtv.h>
5026 #include <sys/ioctl.h>
5027 int main(void) {
5028 struct ivtv_cfg_stop_decode sd;
5029 struct ivtv_cfg_start_decode sd1;
5030 ioctl (0, IVTV_IOC_START_DECODE, &sd1);
5031 ioctl (0, IVTV_IOC_STOP_DECODE, &sd);
5032 return 0; }
5034 _ivtv=no
5035 cc_check && _ivtv=yes
5037 if test "$_ivtv" = yes ; then
5038 _def_ivtv='#define CONFIG_IVTV 1'
5039 _vosrc="$_vosrc vo_ivtv.c"
5040 _vomodules="ivtv $_vomodules"
5041 _aosrc="$_aosrc ao_ivtv.c"
5042 _aomodules="ivtv $_aomodules"
5043 else
5044 _def_ivtv='#undef CONFIG_IVTV'
5045 _novomodules="ivtv $_novomodules"
5046 _noaomodules="ivtv $_noaomodules"
5048 echores "$_ivtv"
5051 echocheck "V4L2 MPEG Decoder"
5052 if test "$_v4l2" = auto ; then
5053 cat > $TMPC << EOF
5054 #include <stdlib.h>
5055 #include <inttypes.h>
5056 #include <linux/types.h>
5057 #include <linux/videodev2.h>
5058 #include <linux/version.h>
5059 int main(void) {
5060 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5061 #error kernel headers too old, need 2.6.22
5062 bad_kernel_version();
5063 #endif
5064 struct v4l2_ext_controls ctrls;
5065 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5066 return 0;
5069 _v4l2=no
5070 cc_check && _v4l2=yes
5072 if test "$_v4l2" = yes ; then
5073 _def_v4l2='#define CONFIG_V4L2_DECODER 1'
5074 _vosrc="$_vosrc vo_v4l2.c"
5075 _vomodules="v4l2 $_vomodules"
5076 _aosrc="$_aosrc ao_v4l2.c"
5077 _aomodules="v4l2 $_aomodules"
5078 else
5079 _def_v4l2='#undef CONFIG_V4L2_DECODER'
5080 _novomodules="v4l2 $_novomodules"
5081 _noaomodules="v4l2 $_noaomodules"
5083 echores "$_v4l2"
5087 #########
5088 # AUDIO #
5089 #########
5092 echocheck "OSS Audio"
5093 if test "$_ossaudio" = auto ; then
5094 cat > $TMPC << EOF
5095 #include <sys/ioctl.h>
5096 #include <$_soundcard_header>
5097 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5099 _ossaudio=no
5100 cc_check && _ossaudio=yes
5102 if test "$_ossaudio" = yes ; then
5103 _def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5104 _aosrc="$_aosrc ao_oss.c"
5105 _aomodules="oss $_aomodules"
5106 if test "$_linux_devfs" = yes; then
5107 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5108 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5109 else
5110 cat > $TMPC << EOF
5111 #include <sys/ioctl.h>
5112 #include <$_soundcard_header>
5113 #ifdef OPEN_SOUND_SYSTEM
5114 int main(void) { return 0; }
5115 #else
5116 #error Not the real thing
5117 #endif
5119 _real_ossaudio=no
5120 cc_check && _real_ossaudio=yes
5121 if test "$_real_ossaudio" = yes; then
5122 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5123 elif netbsd || openbsd ; then
5124 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5125 _ld_extra="$_ld_extra -lossaudio"
5126 else
5127 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5129 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5131 else
5132 _def_ossaudio='#undef CONFIG_OSS_AUDIO'
5133 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5134 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5135 _noaomodules="oss $_noaomodules"
5137 echores "$_ossaudio"
5140 echocheck "aRts"
5141 if test "$_arts" = auto ; then
5142 _arts=no
5143 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5145 cat > $TMPC << EOF
5146 #include <artsc.h>
5147 int main(void) { return 0; }
5149 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5154 if test "$_arts" = yes ; then
5155 _def_arts='#define CONFIG_ARTS 1'
5156 _aosrc="$_aosrc ao_arts.c"
5157 _aomodules="arts $_aomodules"
5158 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5159 _inc_extra="$_inc_extra `artsc-config --cflags`"
5160 else
5161 _noaomodules="arts $_noaomodules"
5163 echores "$_arts"
5166 echocheck "EsounD"
5167 if test "$_esd" = auto ; then
5168 _esd=no
5169 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5171 cat > $TMPC << EOF
5172 #include <esd.h>
5173 int main(void) { int fd = esd_open_sound("test"); return fd; }
5175 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5179 echores "$_esd"
5181 if test "$_esd" = yes ; then
5182 _def_esd='#define CONFIG_ESD 1'
5183 _aosrc="$_aosrc ao_esd.c"
5184 _aomodules="esd $_aomodules"
5185 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5186 _inc_extra="$_inc_extra `esd-config --cflags`"
5188 echocheck "esd_get_latency()"
5189 cat > $TMPC << EOF
5190 #include <esd.h>
5191 int main(void) { return esd_get_latency(0); }
5193 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define CONFIG_ESD_LATENCY'
5194 echores "$_esd_latency"
5195 else
5196 _def_esd='#undef CONFIG_ESD'
5197 _def_esd_latency='#undef CONFIG_ESD_LATENCY'
5198 _noaomodules="esd $_noaomodules"
5201 echocheck "pulse"
5202 if test "$_pulse" = auto ; then
5203 _pulse=no
5204 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5206 cat > $TMPC << EOF
5207 #include <pulse/pulseaudio.h>
5208 int main(void) { return 0; }
5210 cc_check `$_pkg_config --libs --cflags libpulse` && tmp_run && _pulse=yes
5214 echores "$_pulse"
5216 if test "$_pulse" = yes ; then
5217 _def_pulse='#define CONFIG_PULSE 1'
5218 _aosrc="$_aosrc ao_pulse.c"
5219 _aomodules="pulse $_aomodules"
5220 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs libpulse`"
5221 _inc_extra="$_inc_extra `$_pkg_config --cflags libpulse`"
5222 else
5223 _def_pulse='#undef CONFIG_PULSE'
5224 _noaomodules="pulse $_noaomodules"
5228 echocheck "JACK"
5229 if test "$_jack" = auto ; then
5230 _jack=yes
5232 cat > $TMPC << EOF
5233 #include <jack/jack.h>
5234 int main(void) { jack_client_new("test"); return 0; }
5236 if cc_check -ljack ; then
5237 _libs_mplayer="$_libs_mplayer -ljack"
5238 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5239 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5240 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5241 else
5242 _jack=no
5246 if test "$_jack" = yes ; then
5247 _def_jack='#define CONFIG_JACK 1'
5248 _aosrc="$_aosrc ao_jack.c"
5249 _aomodules="jack $_aomodules"
5250 else
5251 _noaomodules="jack $_noaomodules"
5253 echores "$_jack"
5255 echocheck "OpenAL"
5256 if test "$_openal" = auto ; then
5257 _openal=no
5258 cat > $TMPC << EOF
5259 #ifdef OPENAL_AL_H
5260 #include <OpenAL/al.h>
5261 #else
5262 #include <AL/al.h>
5263 #endif
5264 int main(void) {
5265 alSourceQueueBuffers(0, 0, 0);
5266 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5267 return 0;
5270 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5271 cc_check $I && _openal=yes && break
5272 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5273 done
5274 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5276 if test "$_openal" = yes ; then
5277 _def_openal='#define CONFIG_OPENAL 1'
5278 _aosrc="$_aosrc ao_openal.c"
5279 _aomodules="openal $_aomodules"
5280 else
5281 _noaomodules="openal $_noaomodules"
5283 echores "$_openal"
5285 echocheck "ALSA audio"
5286 if test "$_alloca" != yes ; then
5287 _alsa=no
5288 _res_comment="alloca missing"
5290 if test "$_alsa" != no ; then
5291 _alsa=no
5292 cat > $TMPC << EOF
5293 #include <sys/time.h>
5294 #include <sys/asoundlib.h>
5295 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5296 #error "alsa version != 0.5.x"
5297 #endif
5298 int main(void) { return 0; }
5300 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5302 cat > $TMPC << EOF
5303 #include <sys/time.h>
5304 #include <sys/asoundlib.h>
5305 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5306 #error "alsa version != 0.9.x"
5307 #endif
5308 int main(void) { return 0; }
5310 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5311 cat > $TMPC << EOF
5312 #include <sys/time.h>
5313 #include <alsa/asoundlib.h>
5314 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5315 #error "alsa version != 0.9.x"
5316 #endif
5317 int main(void) { return 0; }
5319 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5321 cat > $TMPC << EOF
5322 #include <sys/time.h>
5323 #include <sys/asoundlib.h>
5324 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5325 #error "alsa version != 1.0.x"
5326 #endif
5327 int main(void) { return 0; }
5329 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5330 cat > $TMPC << EOF
5331 #include <sys/time.h>
5332 #include <alsa/asoundlib.h>
5333 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5334 #error "alsa version != 1.0.x"
5335 #endif
5336 int main(void) { return 0; }
5338 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5340 _def_alsa='#undef CONFIG_ALSA'
5341 _def_alsa5='#undef CONFIG_ALSA5'
5342 _def_alsa9='#undef CONFIG_ALSA9'
5343 _def_alsa1x='#undef CONFIG_ALSA1X'
5344 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5345 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5346 if test "$_alsaver" ; then
5347 _alsa=yes
5348 if test "$_alsaver" = '0.5.x' ; then
5349 _alsa5=yes
5350 _aosrc="$_aosrc ao_alsa5.c"
5351 _aomodules="alsa5 $_aomodules"
5352 _def_alsa5='#define CONFIG_ALSA5 1'
5353 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5354 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5355 elif test "$_alsaver" = '0.9.x-sys' ; then
5356 _alsa9=yes
5357 _aosrc="$_aosrc ao_alsa.c"
5358 _aomodules="alsa $_aomodules"
5359 _def_alsa='#define CONFIG_ALSA 1'
5360 _def_alsa9='#define CONFIG_ALSA9 1'
5361 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5362 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5363 elif test "$_alsaver" = '0.9.x-alsa' ; then
5364 _alsa9=yes
5365 _aosrc="$_aosrc ao_alsa.c"
5366 _aomodules="alsa $_aomodules"
5367 _def_alsa='#define CONFIG_ALSA 1'
5368 _def_alsa9='#define CONFIG_ALSA9 1'
5369 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5370 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5371 elif test "$_alsaver" = '1.0.x-sys' ; then
5372 _alsa1x=yes
5373 _aosrc="$_aosrc ao_alsa.c"
5374 _aomodules="alsa $_aomodules"
5375 _def_alsa='#define CONFIG_ALSA 1'
5376 _def_alsa1x="#define CONFIG_ALSA1X 1"
5377 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5378 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5379 elif test "$_alsaver" = '1.0.x-alsa' ; then
5380 _alsa1x=yes
5381 _aosrc="$_aosrc ao_alsa.c"
5382 _aomodules="alsa $_aomodules"
5383 _def_alsa='#define CONFIG_ALSA 1'
5384 _def_alsa1x="#define CONFIG_ALSA1X 1"
5385 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5386 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5387 else
5388 _alsa=no
5389 _res_comment="unknown version"
5391 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5392 else
5393 _noaomodules="alsa $_noaomodules"
5395 echores "$_alsa"
5398 echocheck "Sun audio"
5399 if test "$_sunaudio" = auto ; then
5400 cat > $TMPC << EOF
5401 #include <sys/types.h>
5402 #include <sys/audioio.h>
5403 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5405 _sunaudio=no
5406 cc_check && _sunaudio=yes
5408 if test "$_sunaudio" = yes ; then
5409 _def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5410 _aosrc="$_aosrc ao_sun.c"
5411 _aomodules="sun $_aomodules"
5412 else
5413 _def_sunaudio='#undef CONFIG_SUN_AUDIO'
5414 _noaomodules="sun $_noaomodules"
5416 echores "$_sunaudio"
5419 if sunos; then
5420 echocheck "Sun mediaLib"
5421 if test "$_mlib" = auto ; then
5422 _mlib=no
5423 cat > $TMPC << EOF
5424 #include <mlib.h>
5425 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5427 cc_check -lmlib && _mlib=yes
5429 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5430 echores "$_mlib"
5431 fi #if sunos
5434 if irix; then
5435 echocheck "SGI audio"
5436 if test "$_sgiaudio" = auto ; then
5437 # check for SGI audio
5438 cat > $TMPC << EOF
5439 #include <dmedia/audio.h>
5440 int main(void) { return 0; }
5442 _sgiaudio=no
5443 cc_check && _sgiaudio=yes
5445 if test "$_sgiaudio" = "yes" ; then
5446 _def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5447 _libs_mplayer="$_libs_mplayer -laudio"
5448 _aosrc="$_aosrc ao_sgi.c"
5449 _aomodules="sgi $_aomodules"
5450 else
5451 _def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5452 _noaomodules="sgi $_noaomodules"
5454 echores "$_sgiaudio"
5455 fi #if irix
5458 echocheck "VCD support"
5459 if linux || freebsd || netbsd || dragonfly || bsdos || darwin || sunos || mingw32; then
5460 _inputmodules="vcd $_inputmodules"
5461 _def_vcd='#define CONFIG_VCD 1'
5462 _vcd="yes"
5463 else
5464 _def_vcd='#undef CONFIG_VCD'
5465 _noinputmodules="vcd $_noinputmodules"
5466 _res_comment="not supported on this OS"
5467 _vcd="no"
5469 echores "$_vcd"
5473 echocheck "dvdread"
5474 if test "$_dvdread_internal" = auto ; then
5475 _dvdread_internal=no
5476 _dvdread=no
5477 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5478 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5479 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5480 || darwin || win32; then
5481 _dvdread_internal=yes
5482 _dvdread=yes
5484 elif test "$_dvdread" = auto ; then
5485 _dvdread=no
5486 if test "$_dl" = yes; then
5487 cat > $TMPC << EOF
5488 #include <inttypes.h>
5489 #include <dvdread/dvd_reader.h>
5490 #include <dvdread/ifo_types.h>
5491 #include <dvdread/ifo_read.h>
5492 #include <dvdread/nav_read.h>
5493 int main(void) { return 0; }
5496 _dvdreadcflags=`$_dvdreadconfig --cflags`
5497 _dvdreadlibs=`$_dvdreadconfig --libs`
5498 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5499 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5500 _dvdread=yes
5501 _inc_extra="$_inc_extra $_dvdreadcflags"
5502 _ld_extra="$_ld_extra $_dvdreadlibs"
5503 _res_comment="external"
5507 if test "$_dvdread_internal" = yes; then
5508 _def_dvdread_internal="#define CONFIG_DVDREAD_INTERNAL 1"
5509 _def_dvdread='#define CONFIG_DVDREAD 1'
5510 _inputmodules="dvdread(internal) $_inputmodules"
5511 _largefiles=yes
5512 _res_comment="internal"
5513 elif test "$_dvdread" = yes; then
5514 _def_dvdread='#define CONFIG_DVDREAD 1'
5515 _largefiles=yes
5516 _ld_extra="$_ld_extra -ldvdread"
5517 _inputmodules="dvdread(external) $_inputmodules"
5518 _res_comment="external"
5519 else
5520 _def_dvdread_internal="#undef CONFIG_DVDREAD_INTERNAL"
5521 _def_dvdread='#undef CONFIG_DVDREAD'
5522 _noinputmodules="dvdread $_noinputmodules"
5524 echores "$_dvdread"
5527 echocheck "internal libdvdcss"
5528 if test "$_libdvdcss_internal" = auto ; then
5529 _libdvdcss_internal=no
5530 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5531 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5533 if test "$_libdvdcss_internal" = yes ; then
5534 if linux || netbsd || openbsd || bsdos ; then
5535 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5536 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5537 elif freebsd || dragonfly ; then
5538 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5539 elif darwin ; then
5540 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5541 _ld_extra="$_ld_extra -framework IOKit"
5542 elif cygwin ; then
5543 cflags_libdvdcss="-DSYS_CYGWIN"
5544 elif beos ; then
5545 cflags_libdvdcss="-DSYS_BEOS"
5546 elif os2 ; then
5547 cflags_libdvdcss="-DSYS_OS2"
5549 cflags_libdvdcss_dvdread="-Ilibdvdcss -DHAVE_DVDCSS_DVDCSS_H"
5550 _inputmodules="libdvdcss(internal) $_inputmodules"
5551 _largefiles=yes
5552 else
5553 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5555 echores "$_libdvdcss_internal"
5558 echocheck "cdparanoia"
5559 if test "$_cdparanoia" = auto ; then
5560 cat > $TMPC <<EOF
5561 #include <cdda_interface.h>
5562 #include <cdda_paranoia.h>
5563 // This need a better test. How ?
5564 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5566 _cdparanoia=no
5567 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5568 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5569 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5570 done
5572 if test "$_cdparanoia" = yes ; then
5573 _cdda='yes'
5574 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5575 openbsd && _ld_extra="$_ld_extra -lutil"
5577 echores "$_cdparanoia"
5580 echocheck "libcdio"
5581 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5582 cat > $TMPC << EOF
5583 #include <stdio.h>
5584 #include <cdio/version.h>
5585 #include <cdio/cdda.h>
5586 #include <cdio/paranoia.h>
5587 int main(void) {
5588 void *test = cdda_verbose_set;
5589 printf("%s\n", CDIO_VERSION);
5590 return test == (void *)1;
5593 _libcdio=no
5594 for _ld_tmp in "" "-lwinmm" ; do
5595 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5596 cc_check $_ld_tmp $_ld_lm \
5597 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5598 done
5599 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5600 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5601 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5602 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5603 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5606 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5607 _cdda='yes'
5608 _def_libcdio='#define CONFIG_LIBCDIO'
5609 _def_havelibcdio='yes'
5610 else
5611 if test "$_cdparanoia" = yes ; then
5612 _res_comment="using cdparanoia"
5614 _def_libcdio='#undef CONFIG_LIBCDIO'
5615 _def_havelibcdio='no'
5617 echores "$_libcdio"
5619 if test "$_cdda" = yes ; then
5620 test $_cddb = auto && test $_network = yes && _cddb=yes
5621 _def_cdparanoia='#define CONFIG_CDDA'
5622 _inputmodules="cdda $_inputmodules"
5623 else
5624 _def_cdparanoia='#undef CONFIG_CDDA'
5625 _noinputmodules="cdda $_noinputmodules"
5628 if test "$_cddb" = yes ; then
5629 _def_cddb='#define CONFIG_CDDB'
5630 _inputmodules="cddb $_inputmodules"
5631 else
5632 _cddb=no
5633 _def_cddb='#undef CONFIG_CDDB'
5634 _noinputmodules="cddb $_noinputmodules"
5637 echocheck "bitmap font support"
5638 if test "$_bitmap_font" = yes ; then
5639 _def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5640 else
5641 _def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5643 echores "$_bitmap_font"
5646 echocheck "freetype >= 2.0.9"
5648 # freetype depends on iconv
5649 if test "$_iconv" = no ; then
5650 _freetype=no
5651 _res_comment="iconv support needed"
5654 if test "$_freetype" = auto ; then
5655 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5656 cat > $TMPC << EOF
5657 #include <stdio.h>
5658 #include <ft2build.h>
5659 #include FT_FREETYPE_H
5660 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5661 #error "Need FreeType 2.0.9 or newer"
5662 #endif
5663 int main(void) {
5664 FT_Library library;
5665 FT_Int major=-1,minor=-1,patch=-1;
5666 int err=FT_Init_FreeType(&library);
5667 if(err){
5668 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5669 exit(err);
5671 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5672 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5673 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5674 (int)major,(int)minor,(int)patch );
5675 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5676 printf("Library and header version mismatch! Fix it in your distribution!\n");
5677 exit(1);
5679 return 0;
5682 _freetype=no
5683 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5684 else
5685 _freetype=no
5688 if test "$_freetype" = yes ; then
5689 _def_freetype='#define CONFIG_FREETYPE'
5690 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5691 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5692 else
5693 _def_freetype='#undef CONFIG_FREETYPE'
5695 echores "$_freetype"
5697 if test "$_freetype" = no ; then
5698 _fontconfig=no
5699 _res_comment="freetype support needed"
5701 echocheck "fontconfig"
5702 if test "$_fontconfig" = auto ; then
5703 cat > $TMPC << EOF
5704 #include <stdio.h>
5705 #include <stdlib.h>
5706 #include <fontconfig/fontconfig.h>
5707 int main(void) {
5708 int err = FcInit();
5709 if(err == FcFalse){
5710 printf("Couldn't initialize fontconfig lib\n");
5711 exit(err);
5713 return 0;
5716 _fontconfig=no
5717 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5718 _ld_tmp="-lfontconfig $_ld_tmp"
5719 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5720 done
5721 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5722 _inc_tmp=`$_pkg_config --cflags fontconfig`
5723 _ld_tmp=`$_pkg_config --libs fontconfig`
5724 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5725 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5728 if test "$_fontconfig" = yes ; then
5729 _def_fontconfig='#define CONFIG_FONTCONFIG'
5730 else
5731 _def_fontconfig='#undef CONFIG_FONTCONFIG'
5733 echores "$_fontconfig"
5736 echocheck "SSA/ASS support"
5737 # libass depends on FreeType
5738 if test "$_freetype" = no ; then
5739 _ass=no
5740 _res_comment="FreeType support needed"
5743 if test "$_ass" = auto ; then
5744 cat > $TMPC << EOF
5745 #include <ft2build.h>
5746 #include FT_FREETYPE_H
5747 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5748 #error "Need FreeType 2.1.8 or newer"
5749 #endif
5750 int main(void) { return 0; }
5752 _ass=no
5753 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5754 if test "$_ass" = no ; then
5755 _res_comment="FreeType >= 2.1.8 needed"
5758 if test "$_ass" = yes ; then
5759 _def_ass='#define CONFIG_ASS'
5760 else
5761 _def_ass='#undef CONFIG_ASS'
5763 echores "$_ass"
5766 echocheck "fribidi with charsets"
5767 if test "$_fribidi" = auto ; then
5768 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5769 cat > $TMPC << EOF
5770 #include <stdio.h>
5771 /* workaround for fribidi 0.10.4 and below */
5772 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5773 #include <fribidi/fribidi.h>
5774 int main(void) {
5775 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5776 printf("Fribidi headers are not consistents with the library!\n");
5777 exit(1);
5779 return 0;
5782 _fribidi=no
5783 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5784 else
5785 _fribidi=no
5788 if test "$_fribidi" = yes ; then
5789 _def_fribidi='#define CONFIG_FRIBIDI'
5790 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5791 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5792 else
5793 _def_fribidi='#undef CONFIG_FRIBIDI'
5795 echores "$_fribidi"
5798 echocheck "ENCA"
5799 if test "$_enca" = auto ; then
5800 cat > $TMPC << EOF
5801 #include <sys/types.h>
5802 #include <enca.h>
5803 int main(void) {
5804 const char **langs;
5805 size_t langcnt;
5806 langs = enca_get_languages(&langcnt);
5807 return 0;
5810 _enca=no
5811 cc_check -lenca $_ld_lm && _enca=yes
5813 if test "$_enca" = yes ; then
5814 _def_enca='#define CONFIG_ENCA 1'
5815 _ld_extra="$_ld_extra -lenca"
5816 else
5817 _def_enca='#undef CONFIG_ENCA'
5819 echores "$_enca"
5822 echocheck "zlib"
5823 cat > $TMPC << EOF
5824 #include <zlib.h>
5825 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5827 _zlib=no
5828 cc_check -lz && _zlib=yes
5829 if test "$_zlib" = yes ; then
5830 _def_zlib='#define CONFIG_ZLIB 1'
5831 _ld_extra="$_ld_extra -lz"
5832 else
5833 _def_zlib='#undef CONFIG_ZLIB'
5834 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5835 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5837 echores "$_zlib"
5840 echocheck "RTC"
5841 if test "$_rtc" = auto ; then
5842 cat > $TMPC << EOF
5843 #include <sys/ioctl.h>
5844 #ifdef __linux__
5845 #include <linux/rtc.h>
5846 #else
5847 #include <rtc.h>
5848 #define RTC_PIE_ON RTCIO_PIE_ON
5849 #endif
5850 int main(void) { return RTC_PIE_ON; }
5852 _rtc=no
5853 cc_check && _rtc=yes
5854 ppc && _rtc=no
5856 if test "$_rtc" = yes ; then
5857 _def_rtc='#define HAVE_RTC 1'
5858 else
5859 _def_rtc='#undef HAVE_RTC'
5861 echores "$_rtc"
5864 echocheck "liblzo2 support"
5865 if test "$_liblzo" = auto ; then
5866 _liblzo=no
5867 cat > $TMPC << EOF
5868 #include <lzo/lzo1x.h>
5869 int main(void) { lzo_init();return 0; }
5871 cc_check -llzo2 && _liblzo=yes
5873 if test "$_liblzo" = yes ; then
5874 _def_liblzo='#define CONFIG_LIBLZO 1'
5875 _ld_extra="$_ld_extra -llzo2"
5876 _codecmodules="liblzo $_codecmodules"
5877 else
5878 _def_liblzo='#undef CONFIG_LIBLZO'
5879 _nocodecmodules="liblzo $_nocodecmodules"
5881 echores "$_liblzo"
5884 echocheck "mad support"
5885 if test "$_mad" = auto ; then
5886 _mad=no
5887 cat > $TMPC << EOF
5888 #include <mad.h>
5889 int main(void) { return 0; }
5891 cc_check -lmad && _mad=yes
5893 if test "$_mad" = yes ; then
5894 _def_mad='#define CONFIG_LIBMAD 1'
5895 _ld_extra="$_ld_extra -lmad"
5896 _codecmodules="libmad $_codecmodules"
5897 else
5898 _def_mad='#undef CONFIG_LIBMAD'
5899 _nocodecmodules="libmad $_nocodecmodules"
5901 echores "$_mad"
5903 echocheck "Twolame"
5904 if test "$_twolame" = auto ; then
5905 cat > $TMPC <<EOF
5906 #include <twolame.h>
5907 int main(void) { twolame_init(); return 0; }
5909 _twolame=no
5910 cc_check -ltwolame $_ld_lm && _twolame=yes
5912 if test "$_twolame" = yes ; then
5913 _def_twolame='#define CONFIG_TWOLAME 1'
5914 _libs_mencoder="$_libs_mencoder -ltwolame"
5915 _codecmodules="twolame $_codecmodules"
5916 else
5917 _def_twolame='#undef CONFIG_TWOLAME'
5918 _nocodecmodules="twolame $_nocodecmodules"
5920 echores "$_twolame"
5922 echocheck "Toolame"
5923 if test "$_toolame" = auto ; then
5924 _toolame=no
5925 if test "$_twolame" = yes ; then
5926 _res_comment="disabled by twolame"
5927 else
5928 cat > $TMPC <<EOF
5929 #include <toolame.h>
5930 int main(void) { toolame_init(); return 0; }
5932 cc_check -ltoolame $_ld_lm && _toolame=yes
5935 if test "$_toolame" = yes ; then
5936 _def_toolame='#define CONFIG_TOOLAME 1'
5937 _libs_mencoder="$_libs_mencoder -ltoolame"
5938 _codecmodules="toolame $_codecmodules"
5939 else
5940 _def_toolame='#undef CONFIG_TOOLAME'
5941 _nocodecmodules="toolame $_nocodecmodules"
5943 if test "$_toolamedir" ; then
5944 _res_comment="using $_toolamedir"
5946 echores "$_toolame"
5948 echocheck "OggVorbis support"
5949 if test "$_tremor_internal" = yes; then
5950 _libvorbis=no
5951 elif test "$_tremor" = auto; then
5952 _tremor=no
5953 cat > $TMPC << EOF
5954 #include <tremor/ivorbiscodec.h>
5955 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5957 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
5959 if test "$_libvorbis" = auto; then
5960 _libvorbis=no
5961 cat > $TMPC << EOF
5962 #include <vorbis/codec.h>
5963 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5965 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5967 if test "$_tremor_internal" = yes ; then
5968 _vorbis=yes
5969 _def_vorbis='#define CONFIG_OGGVORBIS 1'
5970 _def_tremor='#define CONFIG_TREMOR 1'
5971 _codecmodules="tremor(internal) $_codecmodules"
5972 _res_comment="internal Tremor"
5973 if test "$_tremor_low" = yes ; then
5974 cflags_tremor_low="-D_LOW_ACCURACY_"
5975 _res_comment="internal low accuracy Tremor"
5977 elif test "$_tremor" = yes ; then
5978 _vorbis=yes
5979 _def_vorbis='#define CONFIG_OGGVORBIS 1'
5980 _def_tremor='#define CONFIG_TREMOR 1'
5981 _codecmodules="tremor(external) $_codecmodules"
5982 _res_comment="external Tremor"
5983 _ld_extra="$_ld_extra -logg -lvorbisidec"
5984 elif test "$_libvorbis" = yes ; then
5985 _vorbis=yes
5986 _def_vorbis='#define CONFIG_OGGVORBIS 1'
5987 _codecmodules="libvorbis $_codecmodules"
5988 _res_comment="libvorbis"
5989 _ld_extra="$_ld_extra -lvorbis -logg"
5990 else
5991 _vorbis=no
5992 _nocodecmodules="libvorbis $_nocodecmodules"
5994 echores "$_vorbis"
5996 echocheck "libspeex (version >= 1.1 required)"
5997 if test "$_speex" = auto ; then
5998 _speex=no
5999 cat > $TMPC << EOF
6000 #include <speex/speex.h>
6001 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); return 0; }
6003 cc_check -lspeex $_ld_lm && _speex=yes
6005 if test "$_speex" = yes ; then
6006 _def_speex='#define CONFIG_SPEEX 1'
6007 _ld_extra="$_ld_extra -lspeex"
6008 _codecmodules="speex $_codecmodules"
6009 else
6010 _def_speex='#undef CONFIG_SPEEX'
6011 _nocodecmodules="speex $_nocodecmodules"
6013 echores "$_speex"
6015 echocheck "OggTheora support"
6016 if test "$_theora" = auto ; then
6017 _theora=no
6018 cat > $TMPC << EOF
6019 #include <theora/theora.h>
6020 #include <string.h>
6021 int main(void) {
6022 /* theora is in flux, make sure that all interface routines and
6023 * datatypes exist and work the way we expect it, so we don't break
6024 * mplayer */
6025 ogg_packet op;
6026 theora_comment tc;
6027 theora_info inf;
6028 theora_state st;
6029 yuv_buffer yuv;
6030 int r;
6031 double t;
6033 theora_info_init (&inf);
6034 theora_comment_init (&tc);
6036 return 0;
6038 /* we don't want to execute this kind of nonsense; just for making sure
6039 * that compilation works... */
6040 memset(&op, 0, sizeof(op));
6041 r = theora_decode_header (&inf, &tc, &op);
6042 r = theora_decode_init (&st, &inf);
6043 t = theora_granule_time (&st, op.granulepos);
6044 r = theora_decode_packetin (&st, &op);
6045 r = theora_decode_YUVout (&st, &yuv);
6046 theora_clear (&st);
6048 return 0;
6051 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
6052 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
6053 && _theora=yes && break
6054 done
6055 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6056 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
6057 cc_check tremor/bitwise.c $_ld_theora \
6058 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
6059 done
6062 if test "$_theora" = yes ; then
6063 _def_theora='#define CONFIG_OGGTHEORA 1'
6064 _codecmodules="libtheora $_codecmodules"
6065 # when --enable-theora is forced, we'd better provide a probably sane
6066 # $_ld_theora than nothing
6067 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
6068 else
6069 _def_theora='#undef CONFIG_OGGTHEORA'
6070 _nocodecmodules="libtheora $_nocodecmodules"
6072 echores "$_theora"
6074 echocheck "internal mp3lib support"
6075 if test "$_mp3lib" = yes ; then
6076 _def_mp3lib='#define CONFIG_MP3LIB 1'
6077 _codecmodules="mp3lib $_codecmodules"
6078 else
6079 _def_mp3lib='#undef CONFIG_MP3LIB'
6080 _nocodecmodules="mp3lib $_nocodecmodules"
6082 echores "$_mp3lib"
6084 echocheck "liba52 support"
6085 _def_liba52='#undef CONFIG_LIBA52'
6086 _def_liba52_internal="#undef CONFIG_LIBA52_INTERNAL"
6087 if test "$_liba52_internal" = auto ; then
6088 _liba52=yes
6089 _liba52_internal=yes
6090 _def_liba52_internal="#define CONFIG_LIBA52_INTERNAL 1"
6091 _res_comment="internal"
6092 elif test "$_liba52_internal" = no && test "$_liba52" = auto ; then
6093 _liba52=no
6094 cat > $TMPC << EOF
6095 #include <inttypes.h>
6096 #include <a52dec/a52.h>
6097 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6099 cc_check -la52 && _liba52=yes
6100 _ld_extra="$_ld_extra -la52"
6101 _res_comment="external"
6103 if test "$_liba52" = yes ; then
6104 _def_liba52='#define CONFIG_LIBA52 1'
6105 _codecmodules="liba52($_res_comment) $_codecmodules"
6106 else
6107 _nocodecmodules="liba52 $_nocodecmodules"
6109 echores "$_liba52"
6111 echocheck "internal libmpeg2 support"
6112 if test "$_libmpeg2" = auto ; then
6113 _libmpeg2=yes
6114 if alpha && test cc_vendor=gnu; then
6115 case $cc_version in
6116 2*|3.0*|3.1*) # cannot compile MVI instructions
6117 _libmpeg2=no
6118 _res_comment="broken gcc"
6120 esac
6123 if test "$_libmpeg2" = yes ; then
6124 _def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6125 _codecmodules="libmpeg2 $_codecmodules"
6126 else
6127 _def_libmpeg2='#undef CONFIG_LIBMPEG2'
6128 _nocodecmodules="libmpeg2 $_nocodecmodules"
6130 echores "$_libmpeg2"
6132 echocheck "libdca support"
6133 if test "$_libdca" = auto ; then
6134 _libdca=no
6135 cat > $TMPC << EOF
6136 #include <inttypes.h>
6137 #include <dts.h>
6138 int main(void) { dts_init (0); return 0; }
6140 for _ld_dca in -ldts -ldca ; do
6141 cc_check $_ld_dca $_ld_lm && _ld_extra="$_ld_extra $_ld_dca" \
6142 && _libdca=yes && break
6143 done
6145 if test "$_libdca" = yes ; then
6146 _def_libdca='#define CONFIG_LIBDCA 1'
6147 _codecmodules="libdca $_codecmodules"
6148 else
6149 _def_libdca='#undef CONFIG_LIBDCA'
6150 _nocodecmodules="libdca $_nocodecmodules"
6152 echores "$_libdca"
6154 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6155 if test "$_musepack" = auto ; then
6156 _musepack=no
6157 cat > $TMPC << EOF
6158 #include <stddef.h>
6159 #include <mpcdec/mpcdec.h>
6160 int main(void) {
6161 mpc_streaminfo info;
6162 mpc_decoder decoder;
6163 mpc_decoder_set_streaminfo(&decoder, &info);
6164 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6165 return 0;
6168 cc_check -lmpcdec $_ld_lm && _musepack=yes
6170 if test "$_musepack" = yes ; then
6171 _def_musepack='#define CONFIG_MUSEPACK 1'
6172 _ld_extra="$_ld_extra -lmpcdec"
6173 _codecmodules="musepack $_codecmodules"
6174 else
6175 _def_musepack='#undef CONFIG_MUSEPACK'
6176 _nocodecmodules="musepack $_nocodecmodules"
6178 echores "$_musepack"
6181 echocheck "FAAC (AAC encoder) support"
6182 if test "$_faac" = auto ; then
6183 cat > $TMPC <<EOF
6184 #include <inttypes.h>
6185 #include <faac.h>
6186 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6188 _faac=no
6189 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6190 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6191 done
6193 if test "$_faac" = yes ; then
6194 _def_faac="#define CONFIG_FAAC 1"
6195 test "$_faac_lavc" = auto && _faac_lavc=yes
6196 if test "$_faac_lavc" = yes ; then
6197 _def_faac_lavc="#define CONFIG_LIBFAAC 1"
6198 _libs_mplayer="$_libs_mplayer $_ld_faac"
6199 _libavencoders="$_libavencoders LIBFAAC_ENCODER"
6201 _codecmodules="faac $_codecmodules"
6202 else
6203 _faac_lavc=no
6204 _def_faac="#undef CONFIG_FAAC"
6205 _def_faac_lavc="#undef CONFIG_LIBFAAC"
6206 _nocodecmodules="faac $_nocodecmodules"
6208 _res_comment="in libavcodec: $_faac_lavc"
6209 echores "$_faac"
6212 echocheck "FAAD2 (AAC) support"
6213 if test "$_faad_internal" = auto ; then
6214 if x86_32 && test cc_vendor=gnu; then
6215 case $cc_version in
6216 3.1*|3.2) # ICE/insn with these versions
6217 _faad_internal=no
6218 _res_comment="broken gcc"
6221 _faad=yes
6222 _faad_internal=yes
6224 esac
6225 else
6226 _faad=yes
6227 _faad_internal=yes
6230 if test "$_faad" = auto ; then
6231 cat > $TMPC << EOF
6232 #include <faad.h>
6233 #ifndef FAAD_MIN_STREAMSIZE
6234 #error Too old version
6235 #endif
6236 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6237 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6239 cc_check -lfaad $_ld_lm && _faad=yes
6242 _def_faad='#undef CONFIG_FAAD'
6243 _def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6244 if test "$_faad_internal" = yes ; then
6245 _def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6246 _res_comment="internal floating-point"
6247 if test "$_faad_fixed" = yes ; then
6248 # The FIXED_POINT implementation of FAAD2 improves performance
6249 # on some platforms, especially for SBR files.
6250 cflags_faad_fixed="-DFIXED_POINT"
6251 _res_comment="internal fixed-point"
6253 elif test "$_faad" = yes ; then
6254 _ld_extra="$_ld_extra -lfaad"
6257 if test "$_faad" = yes ; then
6258 _def_faad='#define CONFIG_FAAD 1'
6259 _codecmodules="faad2 $_codecmodules"
6260 else
6261 _faad=no
6262 _nocodecmodules="faad2 $_nocodecmodules"
6264 echores "$_faad"
6267 echocheck "LADSPA plugin support"
6268 if test "$_ladspa" = auto ; then
6269 cat > $TMPC <<EOF
6270 #include <stdio.h>
6271 #include <ladspa.h>
6272 int main(void) {
6273 const LADSPA_Descriptor *ld = NULL;
6274 return 0;
6277 _ladspa=no
6278 cc_check && _ladspa=yes
6280 if test "$_ladspa" = yes; then
6281 _def_ladspa="#define CONFIG_LADSPA"
6282 else
6283 _def_ladspa="#undef CONFIG_LADSPA"
6285 echores "$_ladspa"
6288 if test -z "$_codecsdir" ; then
6289 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6290 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6291 if test -d "$dir" ; then
6292 _codecsdir="$dir"
6293 break;
6295 done
6297 # Fall back on default directory.
6298 if test -z "$_codecsdir" ; then
6299 _codecsdir="$_libdir/codecs"
6300 mingw32 && _codecsdir="codecs"
6301 os2 && _codecsdir="codecs"
6305 echocheck "Win32 codecs"
6306 if test "$_win32dll" = auto ; then
6307 _win32dll=no
6308 if x86_32 && ! qnx; then
6309 _win32dll=yes
6312 if test "$_win32dll" = yes ; then
6313 _def_win32dll='#define CONFIG_WIN32DLL 1'
6314 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6315 _res_comment="using $_win32codecsdir"
6316 if ! win32 ; then
6317 _def_win32_loader='#define WIN32_LOADER 1'
6318 _win32_emulation=yes
6319 else
6320 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6321 _res_comment="using native windows"
6323 _codecmodules="win32 $_codecmodules"
6324 else
6325 _def_win32dll='#undef CONFIG_WIN32DLL'
6326 _def_win32_loader='#undef WIN32_LOADER'
6327 _nocodecmodules="win32 $_nocodecmodules"
6329 echores "$_win32dll"
6332 echocheck "XAnim codecs"
6333 if test "$_xanim" = auto ; then
6334 _xanim=no
6335 _res_comment="dynamic loader support needed"
6336 if test "$_dl" = yes ; then
6337 _xanim=yes
6340 if test "$_xanim" = yes ; then
6341 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6342 _def_xanim='#define CONFIG_XANIM 1'
6343 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6344 _codecmodules="xanim $_codecmodules"
6345 _res_comment="using $_xanimcodecsdir"
6346 else
6347 _def_xanim='#undef CONFIG_XANIM'
6348 _def_xanim_path='#undef XACODEC_PATH'
6349 _nocodecmodules="xanim $_nocodecmodules"
6351 echores "$_xanim"
6354 echocheck "RealPlayer codecs"
6355 if test "$_real" = auto ; then
6356 _real=no
6357 _res_comment="dynamic loader support needed"
6358 if test "$_dl" = yes || test "$_win32dll" = yes &&
6359 (linux || freebsd || netbsd || dragonfly || darwin || win32) ; then
6360 _real=yes
6363 if test "$_real" = yes ; then
6364 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6365 _def_real='#define CONFIG_REALCODECS 1'
6366 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6367 _codecmodules="real $_codecmodules"
6368 _res_comment="using $_realcodecsdir"
6369 else
6370 _def_real='#undef CONFIG_REALCODECS'
6371 _def_real_path="#undef REALCODEC_PATH"
6372 _nocodecmodules="real $_nocodecmodules"
6374 echores "$_real"
6377 echocheck "QuickTime codecs"
6378 _qtx_emulation=no
6379 _def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6380 if test "$_qtx" = auto ; then
6381 test "$_win32dll" = yes || darwin && _qtx=yes
6383 if test "$_qtx" = yes ; then
6384 _def_qtx='#define CONFIG_QTX_CODECS 1'
6385 win32 && _qtx_codecs_win32=yes && _def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6386 _codecmodules="qtx $_codecmodules"
6387 darwin || win32 || _qtx_emulation=yes
6388 else
6389 _def_qtx='#undef CONFIG_QTX_CODECS'
6390 _nocodecmodules="qtx $_nocodecmodules"
6392 echores "$_qtx"
6394 echocheck "Nemesi Streaming Media libraries"
6395 if test "$_nemesi" = auto && test "$_network" = yes ; then
6396 _nemesi=no
6397 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6398 _inc_extra="$_inc_extra `$_pkg_config --cflags libnemesi`"
6399 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6400 _nemesi=yes
6403 if test "$_nemesi" = yes; then
6404 _native_rtsp=no
6405 _def_nemesi='#define CONFIG_LIBNEMESI 1'
6406 _inputmodules="nemesi $_inputmodules"
6407 else
6408 _native_rtsp="$_network"
6409 _nemesi=no
6410 _def_nemesi='#undef CONFIG_LIBNEMESI'
6411 _noinputmodules="nemesi $_noinputmodules"
6413 echores "$_nemesi"
6415 echocheck "LIVE555 Streaming Media libraries"
6416 if test "$_live" = auto && test "$_network" = yes ; then
6417 cat > $TMPCPP << EOF
6418 #include <liveMedia.hh>
6419 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6420 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6421 #endif
6422 int main(void) { return 0; }
6425 _live=no
6426 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6427 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6428 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6429 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6430 $_livelibdir/groupsock/libgroupsock.a \
6431 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6432 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6433 $_ld_extra -lstdc++" \
6434 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6435 -I$_livelibdir/UsageEnvironment/include \
6436 -I$_livelibdir/BasicUsageEnvironment/include \
6437 -I$_livelibdir/groupsock/include" && \
6438 _live=yes && break
6439 done
6440 if test "$_live" != yes ; then
6441 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6442 _live_dist=yes
6446 if test "$_live" = yes && test "$_network" = yes; then
6447 _res_comment="using $_livelibdir"
6448 _def_live='#define CONFIG_LIVE555 1'
6449 _inputmodules="live555 $_inputmodules"
6450 elif test "$_live_dist" = yes && test "$_network" = yes; then
6451 _res_comment="using distribution version"
6452 _live="yes"
6453 _def_live='#define CONFIG_LIVE555 1'
6454 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6455 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6456 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6457 _inputmodules="live555 $_inputmodules"
6458 else
6459 _live=no
6460 _def_live='#undef CONFIG_LIVE555'
6461 _noinputmodules="live555 $_noinputmodules"
6463 echores "$_live"
6466 echocheck "FFmpeg libavutil"
6467 if test "$_libavutil_a" = auto ; then
6468 if test -d libavutil ; then
6469 _libavutil_a=yes
6470 _res_comment="static"
6471 else
6472 die "MPlayer will not compile without libavutil in the source tree."
6474 elif test "$_libavutil_so" = auto ; then
6475 _libavutil_so=no
6476 cat > $TMPC << EOF
6477 #include <libavutil/common.h>
6478 int main(void) { ff_gcd(1,1); return 0; }
6480 if $_pkg_config --exists libavutil ; then
6481 _inc_libavutil=`$_pkg_config --cflags libavutil`
6482 _ld_tmp=`$_pkg_config --libs libavutil`
6483 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6484 && _libavutil_so=yes
6485 elif cc_check -lavutil $_ld_lm ; then
6486 _ld_extra="$_ld_extra -lavutil"
6487 _libavutil_so=yes
6488 _res_comment="using libavutil.so, but static libavutil is recommended"
6491 _libavutil=no
6492 _def_libavutil='#undef CONFIG_LIBAVUTIL'
6493 _def_libavutil_a='#undef CONFIG_LIBAVUTIL_A'
6494 _def_libavutil_so='#undef CONFIG_LIBAVUTIL_SO'
6495 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6496 test "$_libavutil" = yes && _def_libavutil='#define CONFIG_LIBAVUTIL 1'
6497 test "$_libavutil_a" = yes && _def_libavutil_a='#define CONFIG_LIBAVUTIL_A 1'
6498 test "$_libavutil_so" = yes && _def_libavutil_so='#define CONFIG_LIBAVUTIL_SO 1'
6499 # neither static nor shared libavutil is available, but it is mandatory ...
6500 if test "$_libavutil" = no ; then
6501 die "You need static or shared libavutil, MPlayer will not compile without!"
6503 echores "$_libavutil"
6505 echocheck "FFmpeg libavcodec"
6506 if test "$_libavcodec_a" = auto ; then
6507 _libavcodec_a=no
6508 if test -d libavcodec && test -f libavcodec/utils.c ; then
6509 _libavcodec_a="yes"
6510 _res_comment="static"
6512 elif test "$_libavcodec_so" = auto ; then
6513 _libavcodec_so=no
6514 _res_comment="libavcodec.so is discouraged over static libavcodec"
6515 cat > $TMPC << EOF
6516 #include <libavcodec/avcodec.h>
6517 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6519 if $_pkg_config --exists libavcodec ; then
6520 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6521 _ld_tmp=`$_pkg_config --libs libavcodec`
6522 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6523 && _libavcodec_so=yes
6524 elif cc_check -lavcodec $_ld_lm ; then
6525 _ld_extra="$_ld_extra -lavcodec"
6526 _libavcodec_so=yes
6527 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6530 _libavcodec=no
6531 _def_libavcodec='#undef CONFIG_LIBAVCODEC'
6532 _def_libavcodec_a='#undef CONFIG_LIBAVCODEC_A'
6533 _def_libavcodec_so='#undef CONFIG_LIBAVCODEC_SO'
6534 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6535 test "$_libavcodec" = yes && _def_libavcodec='#define CONFIG_LIBAVCODEC 1'
6536 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define CONFIG_LIBAVCODEC_A 1'
6537 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define CONFIG_LIBAVCODEC_SO 1'
6538 test "$_libavcodec_mpegaudio_hp" = yes \
6539 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6540 if test "$_libavcodec_a" = yes ; then
6541 _codecmodules="libavcodec $_codecmodules"
6542 elif test "$_libavcodec_so" = yes ; then
6543 _codecmodules="libavcodec.so $_codecmodules"
6544 else
6545 _nocodecmodules="libavcodec $_nocodecmodules"
6547 echores "$_libavcodec"
6549 echocheck "FFmpeg libavformat"
6550 if test "$_libavformat_a" = auto ; then
6551 _libavformat_a=no
6552 if test -d libavformat && test -f libavformat/utils.c ; then
6553 _libavformat_a=yes
6554 _res_comment="static"
6556 elif test "$_libavformat_so" = auto ; then
6557 _libavformat_so=no
6558 cat > $TMPC <<EOF
6559 #include <libavformat/avformat.h>
6560 #include <libavcodec/opt.h>
6561 int main(void) { av_alloc_format_context(); return 0; }
6563 if $_pkg_config --exists libavformat ; then
6564 _inc_libavformat=`$_pkg_config --cflags libavformat`
6565 _ld_tmp=`$_pkg_config --libs libavformat`
6566 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6567 && _libavformat_so=yes
6568 elif cc_check $_ld_lm -lavformat ; then
6569 _ld_extra="$_ld_extra -lavformat"
6570 _libavformat_so=yes
6571 _res_comment="using libavformat.so, but static libavformat is recommended"
6574 _libavformat=no
6575 _def_libavformat='#undef CONFIG_LIBAVFORMAT'
6576 _def_libavformat_a='#undef CONFIG_LIBAVFORMAT_A'
6577 _def_libavformat_so='#undef CONFIG_LIBAVFORMAT_SO'
6578 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6579 test "$_libavformat" = yes && _def_libavformat='#define CONFIG_LIBAVFORMAT 1'
6580 test "$_libavformat_a" = yes && _def_libavformat_a='#define CONFIG_LIBAVFORMAT_A 1'
6581 test "$_libavformat_so" = yes \
6582 && _def_libavformat_so='#define CONFIG_LIBAVFORMAT_SO 1'
6583 echores "$_libavformat"
6585 echocheck "FFmpeg libpostproc"
6586 if test "$_libpostproc_a" = auto ; then
6587 _libpostproc_a=no
6588 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6589 _libpostproc_a='yes'
6590 _res_comment="static"
6592 elif test "$_libpostproc_so" = auto ; then
6593 _libpostproc_so=no
6594 cat > $TMPC << EOF
6595 #include <inttypes.h>
6596 #include <libpostproc/postprocess.h>
6597 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6599 if cc_check -lpostproc $_ld_lm ; then
6600 _ld_extra="$_ld_extra -lpostproc"
6601 _libpostproc_so=yes
6602 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6605 _libpostproc=no
6606 _def_libpostproc='#undef CONFIG_LIBPOSTPROC'
6607 _def_libpostproc_a='#undef CONFIG_LIBPOSTPROC_A'
6608 _def_libpostproc_so='#undef CONFIG_LIBPOSTPROC_SO'
6609 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6610 test "$_libpostproc" = yes && _def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
6611 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define CONFIG_LIBPOSTPROC_A 1'
6612 test "$_libpostproc_so" = yes \
6613 && _def_libpostproc_so='#define CONFIG_LIBPOSTPROC_SO 1'
6614 echores "$_libpostproc"
6616 echocheck "FFmpeg libswscale"
6617 if test "$_libswscale_a" = auto ; then
6618 _libswscale_a=no
6619 if test -d libswscale && test -f libswscale/swscale.h ; then
6620 _libswscale_a='yes'
6621 _res_comment="static"
6623 elif test "$_libswscale_so" = auto ; then
6624 _libswscale_so=no
6625 _res_comment="using libswscale.so, but static libswscale is recommended"
6626 cat > $TMPC << EOF
6627 #include <libswscale/swscale.h>
6628 int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
6630 if $_pkg_config --exists libswscale ; then
6631 _inc_libswscale=`$_pkg_config --cflags libswscale`
6632 _ld_tmp=`$_pkg_config --libs libswscale`
6633 cc_check $_inc_libswscale $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6634 && _libswscale_so=yes
6635 elif cc_check -lswscale ; then
6636 _ld_extra="$_ld_extra -lswscale"
6637 _libswscale_so=yes
6640 _libswscale=no
6641 _def_libswscale='#undef CONFIG_LIBSWSCALE'
6642 _def_libswscale_a='#undef CONFIG_LIBSWSCALE_A'
6643 _def_libswscale_so='#undef CONFIG_LIBSWSCALE_SO'
6644 test "$_libswscale_a" = yes || test "$_libswscale_so" = yes && _libswscale=yes
6645 test "$_libswscale" = yes && _def_libswscale='#define CONFIG_LIBSWSCALE 1'
6646 test "$_libswscale_a" = yes && _def_libswscale_a='#define CONFIG_LIBSWSCALE_A 1'
6647 test "$_libswscale_so" = yes \
6648 && _def_libswscale_so='#define CONFIG_LIBSWSCALE_SO 1'
6649 echores "$_libswscale"
6651 echocheck "libamr narrowband"
6652 if test "$_libamr_nb" = auto ; then
6653 _libamr_nb=no
6654 cat > $TMPC << EOF
6655 #include <amrnb/sp_dec.h>
6656 int main(void) { Speech_Decode_Frame_init(); return 0; }
6658 cc_check -lamrnb && _libamr_nb=yes
6659 if test "$_libavcodec_a" != yes ; then
6660 _libamr_nb=no
6661 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6664 if test "$_libamr_nb" = yes ; then
6665 _libamr=yes
6666 _ld_extra="$_ld_extra -lamrnb"
6667 _def_libamr='#define CONFIG_LIBAMR 1'
6668 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6669 _libavdecoders="$_libavdecoders LIBAMR_NB_DECODER"
6670 _libavencoders="$_libavencoders LIBAMR_NB_ENCODER"
6671 _codecmodules="libamr_nb $_codecmodules"
6672 else
6673 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6674 _nocodecmodules="libamr_nb $_nocodecmodules"
6676 echores "$_libamr_nb"
6679 echocheck "libamr wideband"
6680 if test "$_libamr_wb" = auto ; then
6681 _libamr_wb=no
6682 cat > $TMPC << EOF
6683 #include <amrwb/dec_if.h>
6684 int main(void) { D_IF_init(); return 0; }
6686 cc_check -lamrwb && _libamr_wb=yes
6687 if test "$_libavcodec_a" != yes ; then
6688 _libamr_wb=no
6689 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6692 if test "$_libamr_wb" = yes ; then
6693 _libamr=yes
6694 _ld_extra="$_ld_extra -lamrwb"
6695 _def_libamr='#define CONFIG_LIBAMR 1'
6696 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6697 _libavdecoders="$_libavdecoders LIBAMR_WB_DECODER"
6698 _libavencoders="$_libavencoders LIBAMR_WB_ENCODER"
6699 _codecmodules="libamr_wb $_codecmodules"
6700 else
6701 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6702 _nocodecmodules="libamr_wb $_nocodecmodules"
6704 echores "$_libamr_wb"
6706 echocheck "libdv-0.9.5+"
6707 if test "$_libdv" = auto ; then
6708 _libdv=no
6709 cat > $TMPC <<EOF
6710 #include <libdv/dv.h>
6711 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6713 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6715 if test "$_libdv" = yes ; then
6716 _def_libdv='#define CONFIG_LIBDV095 1'
6717 _ld_extra="$_ld_extra -ldv"
6718 _codecmodules="libdv $_codecmodules"
6719 else
6720 _def_libdv='#undef CONFIG_LIBDV095'
6721 _nocodecmodules="libdv $_nocodecmodules"
6723 echores "$_libdv"
6726 echocheck "Xvid"
6727 if test "$_xvid" = auto ; then
6728 _xvid=no
6729 cat > $TMPC << EOF
6730 #include <xvid.h>
6731 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6733 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6734 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6735 done
6738 if test "$_xvid" = yes ; then
6739 _def_xvid='#define CONFIG_XVID4 1'
6740 _codecmodules="xvid $_codecmodules"
6741 else
6742 _def_xvid='#undef CONFIG_XVID4'
6743 _nocodecmodules="xvid $_nocodecmodules"
6745 echores "$_xvid"
6747 echocheck "Xvid two pass plugin"
6748 if test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
6749 cat > $TMPC << EOF
6750 #include <xvid.h>
6751 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6753 cc_check && _xvid_lavc=yes
6755 if test "$_xvid_lavc" = yes ; then
6756 _def_xvid_lavc='#define CONFIG_LIBXVID 1'
6757 _libavencoders="$_libavencoders LIBXVID_ENCODER"
6758 else
6759 _xvid_lavc=no
6760 _def_xvid_lavc='#undef CONFIG_LIBXVID'
6762 echores "$_xvid_lavc"
6765 echocheck "x264"
6766 if test "$_x264" = auto ; then
6767 cat > $TMPC << EOF
6768 #include <inttypes.h>
6769 #include <x264.h>
6770 #if X264_BUILD < 59
6771 #error We do not support old versions of x264. Get the latest from SVN.
6772 #endif
6773 int main(void) { x264_encoder_open((void*)0); return 0; }
6775 _x264=no
6776 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6777 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6778 done
6781 if test "$_x264" = yes ; then
6782 _def_x264='#define CONFIG_X264 1'
6783 _codecmodules="x264 $_codecmodules"
6784 test "$_x264_lavc" = auto && _x264_lavc=yes
6785 if test "$_x264_lavc" = yes ; then
6786 _def_x264_lavc='#define CONFIG_LIBX264 1'
6787 _libs_mplayer="$_libs_mplayer $_ld_x264"
6788 _libavencoders="$_libavencoders LIBX264_ENCODER"
6790 else
6791 _x264_lavc=no
6792 _def_x264='#undef CONFIG_X264'
6793 _def_x264_lavc='#undef CONFIG_LIBX264'
6794 _nocodecmodules="x264 $_nocodecmodules"
6796 _res_comment="in libavcodec: $_x264_lavc"
6797 echores "$_x264"
6800 echocheck "libdirac"
6801 if test "$_libdirac_lavc" = auto; then
6802 _libdirac_lavc=no
6803 if test "$_libavcodec_a" != yes; then
6804 _res_comment="libavcodec (static) is required by libdirac, sorry"
6805 else
6806 cat > $TMPC << EOF
6807 #include <libdirac_encoder/dirac_encoder.h>
6808 #include <libdirac_decoder/dirac_parser.h>
6809 int main(void)
6811 dirac_encoder_context_t enc_ctx;
6812 dirac_decoder_t *dec_handle;
6813 dirac_encoder_context_init(&enc_ctx, VIDEO_FORMAT_SD_576I50);
6814 dec_handle = dirac_decoder_init(0);
6815 if (dec_handle)
6816 dirac_decoder_close(dec_handle);
6817 return 0;
6820 if $_pkg_config --exists dirac ; then
6821 _inc_dirac=`$_pkg_config --silence-errors --cflags dirac`
6822 _ld_dirac=`$_pkg_config --silence-errors --libs dirac`
6823 cc_check $_inc_dirac $_ld_dirac &&
6824 _libdirac_lavc=yes &&
6825 _inc_extra="$_inc_extra $_inc_dirac" &&
6826 _ld_extra="$_ld_extra $_ld_dirac"
6830 if test "$_libdirac_lavc" = yes ; then
6831 _def_libdirac_lavc='#define CONFIG_LIBDIRAC 1'
6832 _libavencoders="$_libavencoders LIBDIRAC_ENCODER"
6833 _libavdecoders="$_libavdecoders LIBDIRAC_DECODER"
6834 _codecmodules="libdirac $_codecmodules"
6835 else
6836 _def_libdirac_lavc='#undef CONFIG_LIBDIRAC'
6837 _nocodecmodules="libdirac $_nocodecmodules"
6839 echores "$_libdirac_lavc"
6842 echocheck "libschroedinger"
6843 if test "$_libschroedinger_lavc" = auto ; then
6844 _libschroedinger_lavc=no
6845 if test "$_libavcodec_a" != yes; then
6846 _res_comment="libavcodec (static) is required by libschroedinger, sorry"
6847 else
6848 cat > $TMPC << EOF
6849 #include <schroedinger/schro.h>
6850 int main(void) { schro_init(); return 0; }
6852 if $_pkg_config --exists schroedinger-1.0 ; then
6853 _inc_schroedinger=`$_pkg_config --silence-errors --cflags schroedinger-1.0`
6854 _ld_schroedinger=`$_pkg_config --silence-errors --libs schroedinger-1.0`
6855 cc_check $_inc_schroedinger $_ld_schroedinger &&
6856 _libschroedinger_lavc=yes &&
6857 _inc_extra="$_inc_extra $_inc_schroedinger" &&
6858 _ld_extra="$_ld_extra $_ld_schroedinger"
6862 if test "$_libschroedinger_lavc" = yes ; then
6863 _def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 1'
6864 _libavencoders="$_libavencoders LIBSCHROEDINGER_ENCODER"
6865 _libavdecoders="$_libavdecoders LIBSCHROEDINGER_DECODER"
6866 _codecmodules="libschroedinger $_codecmodules"
6867 else
6868 _def_libschroedinger_lavc='#undef CONFIG_LIBSCHROEDINGER'
6869 _nocodecmodules="libschroedinger $_nocodecmodules"
6871 echores "$_libschroedinger_lavc"
6873 echocheck "libnut"
6874 if test "$_libnut" = auto ; then
6875 cat > $TMPC << EOF
6876 #include <stdio.h>
6877 #include <stdlib.h>
6878 #include <inttypes.h>
6879 #include <libnut.h>
6880 int main(void) { (void)nut_error(0); return 0; }
6882 _libnut=no
6883 cc_check -lnut && _libnut=yes
6886 if test "$_libnut" = yes ; then
6887 _def_libnut='#define CONFIG_LIBNUT 1'
6888 _ld_extra="$_ld_extra -lnut"
6889 else
6890 _def_libnut='#undef CONFIG_LIBNUT'
6892 echores "$_libnut"
6894 #check must be done after libavcodec one
6895 echocheck "zr"
6896 if test "$_zr" = auto ; then
6897 #36067's seem to identify themselves as 36057PQC's, so the line
6898 #below should work for 36067's and 36057's.
6899 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
6900 _zr=yes
6901 else
6902 _zr=no
6905 if test "$_zr" = yes ; then
6906 if test "$_libavcodec_a" = yes ; then
6907 _def_zr='#define CONFIG_ZR 1'
6908 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6909 _vomodules="zr zr2 $_vomodules"
6910 else
6911 _res_comment="libavcodec (static) is required by zr, sorry"
6912 _novomodules="zr $_novomodules"
6913 _def_zr='#undef CONFIG_ZR'
6915 else
6916 _def_zr='#undef CONFIG_ZR'
6917 _novomodules="zr zr2 $_novomodules"
6919 echores "$_zr"
6921 # mencoder requires (optional) those libs: libmp3lame
6922 if test "$_mencoder" != no ; then
6924 echocheck "libmp3lame (for mencoder)"
6925 _def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
6926 _def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
6927 if test "$_mp3lame" = auto ; then
6928 _mp3lame=no
6929 cat > $TMPC <<EOF
6930 #include <lame/lame.h>
6931 int main(void) { lame_version_t lv; (void) lame_init();
6932 get_lame_version_numerical(&lv); printf("%d%d\n",lv.major,lv.minor);
6933 return 0; }
6935 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6937 if test "$_mp3lame" = yes ; then
6938 _def_mp3lame="#define CONFIG_MP3LAME"
6939 _ld_mp3lame=-lmp3lame
6940 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6941 cat > $TMPC << EOF
6942 #include <lame/lame.h>
6943 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6945 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET"
6946 cat > $TMPC << EOF
6947 #include <lame/lame.h>
6948 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6950 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM"
6951 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
6952 if test "$_mp3lame_lavc" = yes ; then
6953 _def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
6954 _libavencoders="$_libavencoders LIBMP3LAME_ENCODER"
6955 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6957 else
6958 _mp3lame_lavc=no
6959 _def_mp3lame='#undef CONFIG_MP3LAME'
6960 _def_mp3lame_lavc="#undef CONFIG_LIBMP3LAME"
6962 _res_comment="in libavcodec: $_mp3lame_lavc"
6963 echores "$_mp3lame"
6967 echocheck "mencoder"
6968 if test "$_mencoder" = yes ; then
6969 _def_muxers='#define CONFIG_MUXERS 1'
6970 else
6971 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint, png for vf_screenshot
6972 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6973 test "$_zlib" = yes && _libavencoders="$_libavencoders PNG_ENCODER"
6974 _libavmuxers=""
6976 echores "$_mencoder"
6978 echocheck "fastmemcpy"
6979 # fastmemcpy check is done earlier with tests of CPU & binutils features
6980 if test "$_fastmemcpy" = yes ; then
6981 _def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
6982 else
6983 _def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
6985 echores "$_fastmemcpy"
6988 echocheck "UnRAR executable"
6989 if test "$_unrar_exec" = auto ; then
6990 _unrar_exec="yes"
6991 mingw32 && _unrar_exec="no"
6993 if test "$_unrar_exec" = yes ; then
6994 _def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
6995 else
6996 _def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
6998 echores "$_unrar_exec"
7000 echocheck "TV interface"
7001 if test "$_tv" = yes ; then
7002 _def_tv='#define CONFIG_TV 1'
7003 _inputmodules="tv $_inputmodules"
7004 else
7005 _noinputmodules="tv $_noinputmodules"
7006 _def_tv='#undef CONFIG_TV'
7008 echores "$_tv"
7011 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
7012 echocheck "*BSD BT848 bt8xx header"
7013 _ioctl_bt848_h=no
7014 for file in "machine/ioctl_bt848.h" \
7015 "dev/bktr/ioctl_bt848.h" \
7016 "dev/video/bktr/ioctl_bt848.h" \
7017 "dev/ic/bt8xx.h" ; do
7018 cat > $TMPC <<EOF
7019 #include <sys/types.h>
7020 #include <sys/ioctl.h>
7021 #include <$file>
7022 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
7024 if cc_check ; then
7025 _ioctl_bt848_h=yes
7026 _ioctl_bt848_h_name="$file"
7027 break;
7029 done
7030 if test "$_ioctl_bt848_h" = yes ; then
7031 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
7032 _res_comment="using $_ioctl_bt848_h_name"
7033 else
7034 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
7036 echores "$_ioctl_bt848_h"
7038 echocheck "*BSD ioctl_meteor.h"
7039 _ioctl_meteor_h=no
7040 for file in "machine/ioctl_meteor.h" \
7041 "dev/bktr/ioctl_meteor.h" \
7042 "dev/video/bktr/ioctl_meteor.h" ; do
7043 cat > $TMPC <<EOF
7044 #include <sys/types.h>
7045 #include <$file>
7046 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
7048 if cc_check ; then
7049 _ioctl_meteor_h=yes
7050 _ioctl_meteor_h_name="$file"
7051 break;
7053 done
7054 if test "$_ioctl_meteor_h" = yes ; then
7055 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7056 _res_comment="using $_ioctl_meteor_h_name"
7057 else
7058 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7060 echores "$_ioctl_meteor_h"
7062 echocheck "*BSD BrookTree 848 TV interface"
7063 if test "$_tv_bsdbt848" = auto ; then
7064 _tv_bsdbt848=no
7065 if test "$_tv" = yes ; then
7066 cat > $TMPC <<EOF
7067 #include <sys/types.h>
7068 $_def_ioctl_meteor_h_name
7069 $_def_ioctl_bt848_h_name
7070 #ifdef IOCTL_METEOR_H_NAME
7071 #include IOCTL_METEOR_H_NAME
7072 #endif
7073 #ifdef IOCTL_BT848_H_NAME
7074 #include IOCTL_BT848_H_NAME
7075 #endif
7076 int main(void) {
7077 ioctl(0, METEORSINPUT, 0);
7078 ioctl(0, TVTUNER_GETFREQ, 0);
7079 return 0;
7082 cc_check && _tv_bsdbt848=yes
7085 if test "$_tv_bsdbt848" = yes ; then
7086 _def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7087 _inputmodules="tv-bsdbt848 $_inputmodules"
7088 else
7089 _def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7090 _noinputmodules="tv-bsdbt848 $_noinputmodules"
7092 echores "$_tv_bsdbt848"
7093 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7096 echocheck "DirectShow TV interface"
7097 if test "$_tv_dshow" = auto ; then
7098 _tv_dshow=no
7099 if test "$_tv" = yes && win32 ; then
7100 cat > $TMPC <<EOF
7101 #include <ole2.h>
7102 int main(void) {
7103 void* p;
7104 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7105 return 0;
7108 cc_check -lole32 -luuid && _tv_dshow=yes
7111 if test "$_tv_dshow" = yes ; then
7112 _inputmodules="tv-dshow $_inputmodules"
7113 _def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7114 _ld_extra="$_ld_extra -lole32 -luuid"
7115 else
7116 _noinputmodules="tv-dshow $_noinputmodules"
7117 _def_tv_dshow='#undef CONFIG_TV_DSHOW'
7119 echores "$_tv_dshow"
7122 echocheck "Video 4 Linux TV interface"
7123 if test "$_tv_v4l1" = auto ; then
7124 _tv_v4l1=no
7125 if test "$_tv" = yes && linux ; then
7126 cat > $TMPC <<EOF
7127 #include <stdlib.h>
7128 #include <linux/videodev.h>
7129 int main(void) { return 0; }
7131 cc_check && _tv_v4l1=yes
7134 if test "$_tv_v4l1" = yes ; then
7135 _audio_input=yes
7136 _tv_v4l=yes
7137 _def_tv_v4l='#define CONFIG_TV_V4L 1'
7138 _def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7139 _inputmodules="tv-v4l $_inputmodules"
7140 else
7141 _noinputmodules="tv-v4l1 $_noinputmodules"
7142 _def_tv_v4l='#undef CONFIG_TV_V4L'
7144 echores "$_tv_v4l1"
7147 echocheck "Video 4 Linux 2 TV interface"
7148 if test "$_tv_v4l2" = auto ; then
7149 _tv_v4l2=no
7150 if test "$_tv" = yes && linux ; then
7151 cat > $TMPC <<EOF
7152 #include <stdlib.h>
7153 #include <linux/types.h>
7154 #include <linux/videodev2.h>
7155 int main(void) { return 0; }
7157 cc_check && _tv_v4l2=yes
7160 if test "$_tv_v4l2" = yes ; then
7161 _audio_input=yes
7162 _tv_v4l=yes
7163 _def_tv_v4l='#define CONFIG_TV_V4L 1'
7164 _def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7165 _inputmodules="tv-v4l2 $_inputmodules"
7166 else
7167 _noinputmodules="tv-v4l2 $_noinputmodules"
7168 _def_tv_v4l2='#undef CONFIG_TV_V4L2'
7170 echores "$_tv_v4l2"
7173 echocheck "TV teletext interface"
7174 if test "$_tv_teletext" = auto ; then
7175 _tv_teletext=no
7176 if test "$_freetype" = yes && test "$_pthreads" = yes; then
7177 if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes; then
7178 _tv_teletext=yes
7182 if test "$_tv_teletext" = yes ; then
7183 _def_tv_teletext='#define CONFIG_TV_TELETEXT 1'
7184 _inputmodules="tv-teletext $_inputmodules"
7185 else
7186 _noinputmodules="tv-teletext $_noinputmodules"
7187 _def_tv_teletext='#undef CONFIG_TV_TELETEXT'
7189 echores "$_tv_teletext"
7192 echocheck "Radio interface"
7193 if test "$_radio" = yes ; then
7194 _def_radio='#define CONFIG_RADIO 1'
7195 _inputmodules="radio $_inputmodules"
7196 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7197 _radio_capture=no
7199 if test "$_radio_capture" = yes ; then
7200 _audio_input=yes
7201 _def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7202 else
7203 _def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7205 else
7206 _noinputmodules="radio $_noinputmodules"
7207 _def_radio='#undef CONFIG_RADIO'
7208 _def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7209 _radio_capture=no
7211 echores "$_radio"
7212 echocheck "Capture for Radio interface"
7213 echores "$_radio_capture"
7215 echocheck "Video 4 Linux 2 Radio interface"
7216 if test "$_radio_v4l2" = auto ; then
7217 _radio_v4l2=no
7218 if test "$_radio" = yes && linux ; then
7219 cat > $TMPC <<EOF
7220 #include <stdlib.h>
7221 #include <linux/types.h>
7222 #include <linux/videodev2.h>
7223 int main(void) { return 0; }
7225 cc_check && _radio_v4l2=yes
7228 if test "$_radio_v4l2" = yes ; then
7229 _def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7230 else
7231 _def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7233 echores "$_radio_v4l2"
7235 echocheck "Video 4 Linux Radio interface"
7236 if test "$_radio_v4l" = auto ; then
7237 _radio_v4l=no
7238 if test "$_radio" = yes && linux ; then
7239 cat > $TMPC <<EOF
7240 #include <stdlib.h>
7241 #include <linux/videodev.h>
7242 int main(void) { return 0; }
7244 cc_check && _radio_v4l=yes
7247 if test "$_radio_v4l" = yes ; then
7248 _def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7249 else
7250 _def_radio_v4l='#undef CONFIG_RADIO_V4L'
7252 echores "$_radio_v4l"
7254 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7255 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7256 echocheck "*BSD BrookTree 848 Radio interface"
7257 _radio_bsdbt848=no
7258 cat > $TMPC <<EOF
7259 #include <sys/types.h>
7260 $_def_ioctl_bt848_h_name
7261 #ifdef IOCTL_BT848_H_NAME
7262 #include IOCTL_BT848_H_NAME
7263 #endif
7264 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7266 cc_check && _radio_bsdbt848=yes
7267 echores "$_radio_bsdbt848"
7268 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7270 if test "$_radio_bsdbt848" = yes ; then
7271 _def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7272 else
7273 _def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7276 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7277 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7278 die "Radio driver requires BSD BT848, V4L or V4L2!"
7281 echocheck "Video 4 Linux 2 MPEG PVR interface"
7282 if test "$_pvr" = auto ; then
7283 _pvr=no
7284 if test "$_tv_v4l2" = yes && linux ; then
7285 cat > $TMPC <<EOF
7286 #include <stdlib.h>
7287 #include <inttypes.h>
7288 #include <linux/types.h>
7289 #include <linux/videodev2.h>
7290 int main(void) { struct v4l2_ext_controls ext; return 0; }
7292 cc_check && _pvr=yes
7295 if test "$_pvr" = yes ; then
7296 _def_pvr='#define CONFIG_PVR 1'
7297 _inputmodules="pvr $_inputmodules"
7298 else
7299 _noinputmodules="pvr $_noinputmodules"
7300 _def_pvr='#undef CONFIG_PVR'
7302 echores "$_pvr"
7305 echocheck "audio select()"
7306 if test "$_select" = no ; then
7307 _def_select='#undef HAVE_AUDIO_SELECT'
7308 elif test "$_select" = yes ; then
7309 _def_select='#define HAVE_AUDIO_SELECT 1'
7311 echores "$_select"
7314 echocheck "ftp"
7315 if ! beos && test "$_ftp" = yes ; then
7316 _def_ftp='#define CONFIG_FTP 1'
7317 _inputmodules="ftp $_inputmodules"
7318 else
7319 _noinputmodules="ftp $_noinputmodules"
7320 _def_ftp='#undef CONFIG_FTP'
7322 echores "$_ftp"
7324 echocheck "vstream client"
7325 if test "$_vstream" = auto ; then
7326 _vstream=no
7327 cat > $TMPC <<EOF
7328 #include <vstream-client.h>
7329 void vstream_error(const char *format, ... ) {}
7330 int main(void) { vstream_start(); return 0; }
7332 cc_check -lvstream-client && _vstream=yes
7334 if test "$_vstream" = yes ; then
7335 _def_vstream='#define CONFIG_VSTREAM 1'
7336 _inputmodules="vstream $_inputmodules"
7337 _ld_extra="$_ld_extra -lvstream-client"
7338 else
7339 _noinputmodules="vstream $_noinputmodules"
7340 _def_vstream='#undef CONFIG_VSTREAM'
7342 echores "$_vstream"
7344 # endian testing
7345 echocheck "byte order"
7346 if test "$_big_endian" = auto ; then
7347 cat > $TMPC <<EOF
7348 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7349 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7350 int main(void) { return (int)ascii_name; }
7352 if cc_check ; then
7353 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
7354 _big_endian=yes
7355 else
7356 _big_endian=no
7358 else
7359 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7362 if test "$_big_endian" = yes ; then
7363 _byte_order='big-endian'
7364 _def_words_endian='#define WORDS_BIGENDIAN 1'
7365 else
7366 _byte_order='little-endian'
7367 _def_words_endian='#undef WORDS_BIGENDIAN'
7369 echores "$_byte_order"
7371 echocheck "OSD menu"
7372 if test "$_menu" = yes ; then
7373 _def_menu='#define CONFIG_MENU 1'
7374 test $_dvbin = "yes" && _menu_dvbin=yes
7375 else
7376 _def_menu='#undef CONFIG_MENU'
7377 _menu_dvbin=no
7379 echores "$_menu"
7382 echocheck "Subtitles sorting"
7383 if test "$_sortsub" = yes ; then
7384 _def_sortsub='#define CONFIG_SORTSUB 1'
7385 else
7386 _def_sortsub='#undef CONFIG_SORTSUB'
7388 echores "$_sortsub"
7391 echocheck "XMMS inputplugin support"
7392 if test "$_xmms" = yes ; then
7393 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7394 _xmmsplugindir=`xmms-config --input-plugin-dir`
7395 _xmmslibdir=`xmms-config --exec-prefix`/lib
7396 else
7397 _xmmsplugindir=/usr/lib/xmms/Input
7398 _xmmslibdir=/usr/lib
7401 _def_xmms='#define CONFIG_XMMS 1'
7402 if darwin ; then
7403 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7404 else
7405 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7407 else
7408 _def_xmms='#undef CONFIG_XMMS'
7410 echores "$_xmms"
7412 echocheck "inet6"
7413 if test "$_inet6" = auto ; then
7414 cat > $TMPC << EOF
7415 #include <sys/types.h>
7416 #if !defined(_WIN32) || defined(__CYGWIN__)
7417 #include <sys/socket.h>
7418 #include <netinet/in.h>
7419 #else
7420 #include <ws2tcpip.h>
7421 #endif
7422 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
7424 _inet6=no
7425 if cc_check $_ld_sock ; then
7426 _inet6=yes
7429 if test "$_inet6" = yes ; then
7430 _def_inet6='#define HAVE_AF_INET6 1'
7431 else
7432 _def_inet6='#undef HAVE_AF_INET6'
7434 echores "$_inet6"
7437 echocheck "gethostbyname2"
7438 if test "$_gethostbyname2" = auto ; then
7439 cat > $TMPC << EOF
7440 #include <sys/types.h>
7441 #include <sys/socket.h>
7442 #include <netdb.h>
7443 int main(void) { gethostbyname2("", AF_INET); return 0; }
7445 _gethostbyname2=no
7446 if cc_check ; then
7447 _gethostbyname2=yes
7451 if test "$_gethostbyname2" = yes ; then
7452 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7453 else
7454 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7456 echores "$_gethostbyname2"
7459 # --------------- GUI specific tests begin -------------------
7460 echocheck "GUI"
7461 echo "$_gui"
7462 if test "$_gui" = yes ; then
7464 # Required libraries
7465 if test "$_libavcodec" != yes ||
7466 ! echo $_libavdecoders | grep -q PNG_DECODER ; then
7467 die "The GUI requires libavcodec with PNG support (needs zlib)."
7469 test "$_freetype" = no && test "$_bitmap_font" = no && \
7470 die "The GUI requires either FreeType or bitmap font support."
7471 if ! win32 ; then
7472 _gui_gtk=yes
7473 test "$_x11" != yes && die "X11 support required for GUI compilation."
7475 echocheck "XShape extension"
7476 if test "$_xshape" = auto ; then
7477 _xshape=no
7478 cat > $TMPC << EOF
7479 #include <X11/Xlib.h>
7480 #include <X11/Xproto.h>
7481 #include <X11/Xutil.h>
7482 #include <X11/extensions/shape.h>
7483 #include <stdlib.h>
7484 int main(void) {
7485 char *name = ":0.0";
7486 Display *wsDisplay;
7487 int exitvar = 0;
7488 int eventbase, errorbase;
7489 if (getenv("DISPLAY"))
7490 name=getenv("DISPLAY");
7491 wsDisplay=XOpenDisplay(name);
7492 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7493 exitvar=1;
7494 XCloseDisplay(wsDisplay);
7495 return exitvar;
7498 cc_check -lXext && _xshape=yes
7500 if test "$_xshape" = yes ; then
7501 _def_xshape='#define CONFIG_XSHAPE 1'
7502 else
7503 die "The GUI requires the X11 extension XShape (which was not found)."
7505 echores "$_xshape"
7507 #Check for GTK
7508 if test "$_gtk1" = no ; then
7509 #Check for GTK2 :
7510 echocheck "GTK+ version"
7512 if $_pkg_config gtk+-2.0 --exists ; then
7513 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7514 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7515 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7516 echores "$_gtk"
7518 # Check for GLIB2
7519 if $_pkg_config glib-2.0 --exists ; then
7520 echocheck "glib version"
7521 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7522 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7523 echores "$_glib"
7525 _def_gui='#define CONFIG_GUI 1'
7526 _def_gtk2='#define CONFIG_GTK2 1'
7527 else
7528 _gtk1=yes
7529 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7531 else
7532 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7533 _gtk1=yes
7537 if test "$_gtk1" = yes ; then
7538 # Check for old GTK (1.2.x)
7539 echocheck "GTK version"
7540 if test -z "$_gtkconfig" ; then
7541 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7542 _gtkconfig="gtk-config"
7543 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7544 _gtkconfig="gtk12-config"
7545 else
7546 die "The GUI requires GTK devel packages (which were not found)."
7549 _gtk=`$_gtkconfig --version 2>&1`
7550 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7551 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7552 echores "$_gtk (using $_gtkconfig)"
7554 # Check for GLIB
7555 echocheck "glib version"
7556 if test -z "$_glibconfig" ; then
7557 if ( glib-config --version ) >/dev/null 2>&1 ; then
7558 _glibconfig="glib-config"
7559 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7560 _glibconfig="glib12-config"
7561 else
7562 die "The GUI requires GLIB devel packages (which were not found)"
7565 _glib=`$_glibconfig --version 2>&1`
7566 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7567 echores "$_glib (using $_glibconfig)"
7569 _def_gui='#define CONFIG_GUI 1'
7570 _def_gtk2='#undef CONFIG_GTK2'
7573 else #if ! win32
7574 _gui_win32=yes
7575 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7576 _def_gui='#define CONFIG_GUI 1'
7577 _def_gtk2='#undef CONFIG_GTK2'
7578 fi #if ! win32
7580 else #if test "$_gui"
7581 _def_gui='#undef CONFIG_GUI'
7582 _def_gtk2='#undef CONFIG_GTK2'
7583 fi #if test "$_gui"
7584 # --------------- GUI specific tests end -------------------
7587 if test "$_charset" = "noconv" ; then
7588 _charset=""
7590 if test "$_charset" ; then
7591 _def_charset="#define MSG_CHARSET \"$_charset\""
7592 else
7593 _def_charset="#undef MSG_CHARSET"
7596 if test -n "$_charset" && test "$_charset" != "UTF-8" ; then
7597 echocheck "iconv program"
7598 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7599 if test "$?" -ne 0 ; then
7600 echores "no"
7601 echo "No working iconv program found, use "
7602 echo "--charset=UTF-8 to continue anyway."
7603 echo "If you also have problems with iconv library functions use --charset=noconv."
7604 echo "Messages in the GTK-2 interface will be broken then."
7605 exit 1
7606 else
7607 echores "yes"
7611 #############################################################################
7613 echocheck "automatic gdb attach"
7614 if test "$_crash_debug" = yes ; then
7615 _def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
7616 else
7617 _def_crash_debug='#undef CONFIG_CRASH_DEBUG'
7618 _crash_debug=no
7620 echores "$_crash_debug"
7622 echocheck "compiler support for noexecstack"
7623 cat > $TMPC <<EOF
7624 int main(void) { return 0; }
7626 if cc_check -Wl,-z,noexecstack ; then
7627 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7628 echores "yes"
7629 else
7630 echores "no"
7634 # Dynamic linking flags
7635 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7636 _ld_dl_dynamic=''
7637 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
7638 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 ; then
7639 _ld_dl_dynamic='-rdynamic'
7642 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7643 bsdos && _ld_extra="$_ld_extra -ldvd"
7644 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7645 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7647 _def_debug='#undef MP_DEBUG'
7648 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7651 echocheck "joystick"
7652 _def_joystick='#undef CONFIG_JOYSTICK'
7653 if test "$_joystick" = yes ; then
7654 if linux ; then
7655 # TODO add some check
7656 _def_joystick='#define CONFIG_JOYSTICK 1'
7657 else
7658 _joystick="no"
7659 _res_comment="unsupported under $system_name"
7662 echores "$_joystick"
7664 echocheck "lirc"
7665 if test "$_lirc" = auto ; then
7666 _lirc=no
7667 cat > $TMPC <<EOF
7668 #include <lirc/lirc_client.h>
7669 int main(void) { return 0; }
7671 cc_check -llirc_client && _lirc=yes
7673 if test "$_lirc" = yes ; then
7674 _def_lirc='#define CONFIG_LIRC 1'
7675 _ld_extra="$_ld_extra -llirc_client"
7676 else
7677 _def_lirc='#undef CONFIG_LIRC'
7679 echores "$_lirc"
7681 echocheck "lircc"
7682 if test "$_lircc" = auto ; then
7683 _lircc=no
7684 cat > $TMPC <<EOF
7685 #include <lirc/lircc.h>
7686 int main(void) { return 0; }
7688 cc_check -llircc && _lircc=yes
7690 if test "$_lircc" = yes ; then
7691 _def_lircc='#define CONFIG_LIRCC 1'
7692 _ld_extra="$_ld_extra -llircc"
7693 else
7694 _def_lircc='#undef CONFIG_LIRCC'
7696 echores "$_lircc"
7698 if arm; then
7699 # Detect maemo development platform libraries availability (http://www.maemo.org),
7700 # they are used when run on Nokia 770|8x0
7701 echocheck "maemo (Nokia 770|8x0)"
7702 if test "$_maemo" = auto ; then
7703 _maemo=no
7704 cat > $TMPC << EOF
7705 #include <libosso.h>
7706 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7708 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7710 if test "$_maemo" = yes ; then
7711 _def_maemo='#define CONFIG_MAEMO 1'
7712 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7713 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7714 else
7715 _def_maemo='#undef CONFIG_MAEMO'
7717 echores "$_maemo"
7720 #this must be the last test to be performed or the ones following it will likely fail
7721 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7722 # to use its own copy of the library)
7723 echocheck "DVD support (libdvdnav)"
7724 if test "$_dvdnav" = auto ; then
7725 if test "$_dvdread_internal" = yes ; then
7726 _dvdnav=no
7727 _res_comment="Disabled in favor of the internal copy of dvdread. Append --disable-dvdread-internal."
7728 else
7729 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7732 if test "$_dvdnav" = auto ; then
7733 cat > $TMPC <<EOF
7734 #include <inttypes.h>
7735 #include <dvdnav/dvdnav.h>
7736 int main(void) { dvdnav_t *dvd=0; return 0; }
7738 _dvdnav=no
7739 _dvdnavdir=`$_dvdnavconfig --cflags`
7740 _dvdnavlibs=`$_dvdnavconfig --libs`
7741 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7743 if test "$_dvdnav" = yes ; then
7744 _largefiles=yes
7745 _def_dvdnav='#define CONFIG_DVDNAV 1'
7746 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7747 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7748 _inputmodules="dvdnav $_inputmodules"
7749 else
7750 _def_dvdnav='#undef CONFIG_DVDNAV'
7751 _noinputmodules="dvdnav $_noinputmodules"
7753 echores "$_dvdnav"
7756 #############################################################################
7758 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7759 # the OMF format needs to come after the 'extern symbol prefix' check, which
7760 # uses nm.
7761 if os2 ; then
7762 _ld_extra="$_ld_extra -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7765 # linker paths should be the same for mencoder and mplayer
7766 _ld_tmp=""
7767 for I in $_libs_mplayer ; do
7768 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7769 if test -z "$_tmp" ; then
7770 _ld_extra="$I $_ld_extra"
7771 else
7772 _ld_tmp="$_ld_tmp $I"
7774 done
7775 _libs_mplayer=$_ld_tmp
7778 #############################################################################
7779 if darwin ; then
7780 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
7781 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7782 CFLAGS="$CFLAGS -no-cpp-precomp"
7785 if amigaos ; then
7786 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__"
7788 # Thread support
7789 if linux ; then
7790 CFLAGS="$CFLAGS -D_REENTRANT"
7791 elif freebsd || netbsd || openbsd || bsdos ; then
7792 # FIXME bsd needs this so maybe other OS'es
7793 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7795 # 64 bit file offsets?
7796 if test "$_largefiles" = yes || freebsd ; then
7797 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7798 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7799 # dvdread support requires this (for off64_t)
7800 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7804 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7806 cat > $TMPC << EOF
7807 int main(void) { return 0; }
7809 if test "$cc_vendor" = "gnu" ; then
7810 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
7811 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7812 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7813 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7816 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
7818 #############################################################################
7819 echo "Creating config.mak"
7820 cat > config.mak << EOF
7821 # -------- Generated by configure -----------
7823 # Ensure that locale settings do not interfere with shell commands.
7824 export LC_ALL = C
7826 DOC_LANG = $doc_lang
7827 DOC_LANGS = $doc_langs
7828 DOC_LANG_ALL = $doc_lang_all
7829 MAN_LANG = $man_lang
7830 MAN_LANGS = $man_langs
7831 MAN_LANG_ALL = $man_lang_all
7833 DESTDIR =
7834 prefix = \$(DESTDIR)$_prefix
7835 BINDIR = \$(DESTDIR)$_bindir
7836 DATADIR = \$(DESTDIR)$_datadir
7837 MANDIR = \$(DESTDIR)$_mandir
7838 CONFDIR = \$(DESTDIR)$_confdir
7839 LIBDIR = \$(DESTDIR)$_libdir
7841 AR = $_ar
7842 CC = $_cc
7843 CXX = $_cc
7844 HOST_CC = $_host_cc
7845 RANLIB = $_ranlib
7846 WINDRES = $_windres
7847 INSTALL = $_install
7848 INSTALLSTRIP = $_install_strip
7850 EXTRA_INC = $_inc_extra
7851 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7852 CFLAGS = $CFLAGS \$(EXTRA_INC)
7853 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7854 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7855 CFLAGS_DHAHELPER = $cflags_dhahelper
7856 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
7857 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
7858 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
7859 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
7860 CFLAGS_STACKREALIGN = $cflags_stackrealign
7861 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
7862 CFLAGS_TREMOR_LOW = $cflags_tremor_low
7864 EXTRALIBS = $_extra_libs
7865 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7866 EXTRALIBS_MPLAYER = $_libs_mplayer
7867 EXTRALIBS_MENCODER = $_libs_mencoder
7869 CHARSET = $_charset
7870 HELP_FILE = $_mp_help
7872 EXESUF = $_exesuf
7874 $_target_arch
7875 $_target_arch_x86
7876 `echo $_cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/'`
7878 GETCH = $_getch
7879 TIMER = $_timer
7881 AO_SRCS = $_aosrc
7882 VO_SRCS = $_vosrc
7884 MENCODER = $_mencoder
7885 MPLAYER = $_mplayer
7887 #internal libraries
7888 LIBA52 = $_liba52
7889 LIBA52_INTERNAL = $_liba52_internal
7890 LIBMPEG2 = $_libmpeg2
7891 MP3LIB = $_mp3lib
7892 TREMOR_INTERNAL = $_tremor_internal
7894 HAVE_SYS_MMAN_H = $_mman
7895 HAVE_POSIX_SELECT = $_posix_select
7897 NEED_GETTIMEOFDAY = $_need_gettimeofday
7898 NEED_GLOB = $_need_glob
7899 NEED_MMAP = $_need_mmap
7900 NEED_SETENV = $_need_setenv
7901 NEED_SHMEM = $_need_shmem
7902 NEED_STRSEP = $_need_strsep
7903 NEED_SWAB = $_need_swab
7904 NEED_VSSCANF = $_need_vsscanf
7906 # audio output
7907 OSS = $_ossaudio
7908 ALSA9 = $_alsa9
7909 ALSA1X = $_alsa1x
7911 # features
7912 APPLE_IR = $_apple_ir
7913 APPLE_REMOTE = $_apple_remote
7914 AUDIO_INPUT = $_audio_input
7915 BITMAP_FONT = $_bitmap_font
7916 CDDA = $_cdda
7917 CDDB = $_cddb
7918 COREAUDIO = $_coreaudio
7919 COREVIDEO = $_corevideo
7920 DVBIN = $_dvbin
7921 DVDNAV = $_dvdnav
7922 DVDREAD = $_dvdread
7923 DVDREAD_INTERNAL = $_dvdread_internal
7924 FAAC=$_faac
7925 FAAD = $_faad
7926 FAAD_INTERNAL = $_faad_internal
7927 FREETYPE = $_freetype
7928 FTP = $_ftp
7929 GIF = $_gif
7930 GUI = $_gui
7931 GUI_GTK = $_gui_gtk
7932 GUI_WIN32 = $_gui_win32
7933 JOYSTICK = $_joystick
7934 JPEG = $_jpeg
7935 LADSPA = $_ladspa
7936 LIBASS = $_ass
7937 LIBDCA = $_libdca
7938 LIBDV = $_libdv
7939 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7940 LIBLZO = $_liblzo
7941 LIBMAD = $_mad
7942 LIBMENU = $_menu
7943 LIBMENU_DVBIN = $_menu_dvbin
7944 LIBNEMESI = $_nemesi
7945 LIBNUT = $_libnut
7946 LIBSMBCLIENT = $_smb
7947 LIBTHEORA = $_theora
7948 LIBVORBIS = $_vorbis
7949 LIRC = $_lirc
7950 LIVE555 = $_live
7951 MACOSX_BUNDLE = $_macosx_bundle
7952 MACOSX_FINDER = $_macosx_finder
7953 MP3LAME = $_mp3lame
7954 MUSEPACK = $_musepack
7955 NATIVE_RTSP = $_native_rtsp
7956 NETWORK = $_network
7957 PE_EXECUTABLE = $_pe_executable
7958 PNG = $_png
7959 PVR = $_pvr
7960 QTX_CODECS = $_qtx
7961 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7962 QTX_EMULATION = $_qtx_emulation
7963 QUARTZ = $_quartz
7964 RADIO=$_radio
7965 RADIO_CAPTURE=$_radio_capture
7966 REAL_CODECS = $_real
7967 SPEEX = $_speex
7968 STREAM_CACHE = $_stream_cache
7969 TOOLAME=$_toolame
7970 TV = $_tv
7971 TV_BSDBT848 = $_tv_bsdbt848
7972 TV_DSHOW = $_tv_dshow
7973 TV_TELETEXT = $_tv_teletext
7974 TV_V4L = $_tv_v4l
7975 TV_V4L1 = $_tv_v4l1
7976 TV_V4L2 = $_tv_v4l2
7977 TWOLAME=$_twolame
7978 UNRAR_EXEC = $_unrar_exec
7979 VCD = $_vcd
7980 VIDIX = $_vidix
7981 VIDIX_PCIDB = $_vidix_pcidb_val
7982 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7983 VIDIX_IVTV=$_vidix_drv_ivtv
7984 VIDIX_MACH64=$_vidix_drv_mach64
7985 VIDIX_MGA=$_vidix_drv_mga
7986 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7987 VIDIX_NVIDIA=$_vidix_drv_nvidia
7988 VIDIX_PM2=$_vidix_drv_pm2
7989 VIDIX_PM3=$_vidix_drv_pm3
7990 VIDIX_RADEON=$_vidix_drv_radeon
7991 VIDIX_RAGE128=$_vidix_drv_rage128
7992 VIDIX_S3=$_vidix_drv_s3
7993 VIDIX_SH_VEU=$_vidix_drv_sh_veu
7994 VIDIX_SIS=$_vidix_drv_sis
7995 VIDIX_UNICHROME=$_vidix_drv_unichrome
7996 VSTREAM = $_vstream
7997 WIN32DLL = $_win32dll
7998 WIN32_EMULATION = $_win32_emulation
7999 X264 = $_x264
8000 XANIM_CODECS = $_xanim
8001 XMMS_PLUGINS = $_xmms
8002 XVID4 = $_xvid
8003 ZORAN = $_zr
8005 # FFmpeg
8006 LIBAVUTIL = $_libavutil
8007 LIBAVUTIL_A = $_libavutil_a
8008 LIBAVUTIL_SO = $_libavutil_so
8009 LIBAVCODEC = $_libavcodec
8010 LIBAVCODEC_A = $_libavcodec_a
8011 LIBAVCODEC_SO = $_libavcodec_so
8012 LIBAVFORMAT = $_libavformat
8013 LIBAVFORMAT_A = $_libavformat_a
8014 LIBAVFORMAT_SO = $_libavformat_so
8015 LIBPOSTPROC = $_libpostproc
8016 LIBPOSTPROC_A = $_libpostproc_a
8017 LIBPOSTPROC_SO = $_libpostproc_so
8018 LIBSWSCALE = $_libswscale
8019 LIBSWSCALE_A = $_libswscale_a
8020 LIBSWSCALE_SO = $_libswscale_so
8022 BUILD_STATIC=yes
8023 SRC_PATH=..
8024 BUILD_ROOT=..
8025 LIBPREF=lib
8026 LIBSUF=.a
8027 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
8029 CONFIG_ENCODERS=yes
8030 CONFIG_GPL=yes
8031 CONFIG_MUXERS=$_mencoder
8032 CONFIG_LIBAMR=$_libamr
8033 CONFIG_LIBAMR_NB=$_libamr_nb
8034 CONFIG_LIBAMR_WB=$_libamr_wb
8035 CONFIG_LIBDIRAC=$_libdirac_lavc
8036 CONFIG_LIBFAAC=$_faac_lavc
8037 CONFIG_LIBMP3LAME=$_mp3lame_lavc
8038 CONFIG_LIBSCHROEDINGER=$_libschroedinger_lavc
8039 CONFIG_LIBVORBIS=$_libvorbis
8040 CONFIG_LIBX264=$_x264_lavc
8041 CONFIG_LIBXVID=$_xvid_lavc
8042 CONFIG_MLIB = $_mlib
8043 CONFIG_POSTPROC = yes
8044 # Prevent building libavcodec/imgresample.c with conflicting symbols
8045 CONFIG_SWSCALE=yes
8046 CONFIG_ZLIB=$_zlib
8048 HAVE_PTHREADS = $_pthreads
8049 HAVE_W32THREADS = $_w32threads
8050 HAVE_XVMC = $_xvmc
8052 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
8053 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
8054 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
8055 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
8056 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
8057 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
8059 DEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,\$^) | sed "s,[0-9a-z._-]*: \(\$(SRC_DIR)/\)*\([a-z0-9]*/\)[^/]* ,\\2&,"
8061 MPDEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,$^) | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &,"
8062 MPDEPEND_CMD_CXX = \$(CC) -MM \$(CXXFLAGS) \$(filter-out %.h,$^) | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &,"
8066 #############################################################################
8068 ff_config_enable () {
8069 _nprefix=$3;
8070 test -z "$_nprefix" && _nprefix='CONFIG'
8071 for part in $1; do
8072 if ` echo $2 | grep -q -E "(^| )$part($| )" `; then
8073 echo "#define ${_nprefix}_$part 1"
8074 echo "#define ENABLE_$part 1"
8075 else
8076 echo "#define ENABLE_$part 0"
8078 done
8081 echo "Creating config.h"
8082 cat > $TMPH << EOF
8083 /* -------- This file has been automatically generated by configure ---------
8084 Note: Any changes in it will be lost when you run configure again. */
8086 /* Protect against multiple inclusion */
8087 #ifndef MPLAYER_CONFIG_H
8088 #define MPLAYER_CONFIG_H
8090 #define CONFIGURATION "$_configuration"
8092 /* make sure we never get lavformat's poll() emulation, the results are
8093 horrible if the X libs try to actually use it, see MPlayer-users
8094 Message-ID: <45D49541.8060101@infernix.net>
8095 Date: Thu, 15 Feb 2007 18:15:45 +0100
8096 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
8098 #define HAVE_SYS_POLL_H 1
8100 /* yes, we have inttypes.h */
8101 #define HAVE_INTTYPES_H 1
8103 /* int_fastXY_t emulation */
8104 $_def_fast_inttypes
8106 /* libdvdcss */
8107 #define HAVE_ERRNO_H 1
8109 /* libdvdcss + libdvdread */
8110 #define HAVE_LIMITS_H 1
8112 /* libdvdcss + libfaad2 */
8113 #define HAVE_UNISTD_H 1
8115 /* libfaad2 + libdvdread */
8116 #define STDC_HEADERS 1
8118 /* libfaad2 */
8119 #define HAVE_MEMCPY 1
8120 #define HAVE_STRCHR 1
8122 /* libdvdread */
8123 #define HAVE_UINTPTR_T 1
8125 /* name of messages charset */
8126 $_def_charset
8128 /* Runtime CPU detection */
8129 $_def_runtime_cpudetection
8131 /* Dynamic a/v plugins */
8132 $_def_dynamic_plugins
8134 /* "restrict" keyword */
8135 $_def_restrict_keyword
8137 /* __builtin_expect branch prediction hint */
8138 $_def_builtin_expect
8139 #ifdef HAVE_BUILTIN_EXPECT
8140 #define likely(x) __builtin_expect ((x) != 0, 1)
8141 #define unlikely(x) __builtin_expect ((x) != 0, 0)
8142 #else
8143 #define likely(x) (x)
8144 #define unlikely(x) (x)
8145 #endif
8147 /* attribute(used) as needed by some compilers */
8148 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
8149 # define attribute_used __attribute__((used))
8150 #else
8151 # define attribute_used
8152 #endif
8154 /* extern symbol prefix */
8155 $_def_extern_prefix
8157 /* compiler support for named assembler arguments */
8158 $_def_named_asm_args
8160 /* enable/disable SIGHANDLER */
8161 $_def_sighandler
8163 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
8164 $_def_crash_debug
8166 /* Toggles debugging informations */
8167 $_def_debug
8169 /* Indicates that libcdio is available for VCD and CD-DA playback */
8170 $_def_libcdio
8172 /* Indicates that Ogle's libdvdread is available for DVD playback */
8173 $_def_dvdread
8175 /* Indicates that dvdread is internal */
8176 $_def_dvdread_internal
8178 /* Additional options for libdvdread/libdvdcss */
8179 $_def_dvd
8180 $_def_cdrom
8181 $_def_cdio
8182 $_def_dvdio
8183 $_def_bsdi_dvd
8184 $_def_dvd_bsd
8185 $_def_dvd_linux
8186 $_dev_dvd_openbsd
8187 $_def_dvd_darwin
8188 $_def_sol_scsi_h
8189 $_def_hpux_scsi_h
8191 /* Common data directory (for fonts, etc) */
8192 #define MPLAYER_DATADIR "$_datadir"
8193 #define MPLAYER_CONFDIR "$_confdir"
8194 #define MPLAYER_LIBDIR "$_libdir"
8196 /* Define this to compile stream-caching support, it can be enabled via
8197 -cache <kilobytes> */
8198 $_def_stream_cache
8200 /* Define if you are using Xvid library */
8201 $_def_xvid
8203 /* Define if you are using the X.264 library */
8204 $_def_x264
8206 /* Define if you are using libnut */
8207 $_def_libnut
8209 /* Define to include support for libdv-0.9.5 */
8210 $_def_libdv
8212 /* Indicates if libmp3lame is available
8213 Note: for mencoder */
8214 $_def_mp3lame
8215 $_def_mp3lame_preset
8216 $_def_mp3lame_preset_medium
8218 /* Undefine this if you do not want to select mono audio (left or right)
8219 with a stereo MPEG layer 2/3 audio stream. The command line option
8220 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8221 right-only), with 0 being the default.
8223 #define CONFIG_FAKE_MONO 1
8225 /* Undefine this if your sound card driver has no working select().
8226 If you have kernel Oops, player hangups, or just no audio, you should
8227 try to recompile MPlayer with this option disabled! */
8228 $_def_select
8230 /* define this to use iconv(3) function to codepage conversions */
8231 $_def_iconv
8233 /* define this to use nl_langinfo function */
8234 $_def_langinfo
8236 /* define this to use RTC (/dev/rtc) for video timers */
8237 $_def_rtc
8239 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
8240 #define MAX_OUTBURST 65536
8242 /* set up audio OUTBURST. Do not change this! */
8243 #define OUTBURST 512
8245 /* Define this if your system has the header file for the OSS sound interface */
8246 $_def_sys_soundcard
8248 /* Define this if your system has the header file for the OSS sound interface
8249 * in /usr/include */
8250 $_def_soundcard
8252 /* Define this if your system has the sysinfo header */
8253 $_def_sys_sysinfo
8255 /* Define this if your system has the "malloc.h" header file */
8256 $_def_malloc
8258 /* memalign is mapped to malloc if unsupported */
8259 $_def_memalign
8260 $_def_map_memalign
8261 $_def_memalign_hack
8263 /* assembler handling of .align */
8264 $_def_asmalign_pot
8266 /* Define this if your system has the "alloca.h" header file */
8267 $_def_alloca
8269 /* Define this if your system has the "byteswap.h" header file */
8270 $_def_byteswap_h
8272 /* Define this if your system has the "sys/mman.h" header file */
8273 $_def_mman
8274 $_def_mman_has_map_failed
8276 /* Define this if you have the elf dynamic linker -ldl library */
8277 $_def_dl
8279 /* Define this if you have the kstat kernel statistics library */
8280 $_def_kstat
8282 /* Define this if you have zlib */
8283 $_def_zlib
8285 /* Define this if you have shm support */
8286 $_def_shm
8288 /* Define this if your system has strsep */
8289 $_def_strsep
8291 /* Define this if your system has vsscanf */
8292 $_def_vsscanf
8294 /* Define this if your system has swab */
8295 $_def_swab
8297 /* Define this if your system has posix select */
8298 $_def_posix_select
8300 /* Define this if your system has gettimeofday */
8301 $_def_gettimeofday
8303 /* Define this if your system has glob */
8304 $_def_glob
8306 /* Define this if your system has setenv */
8307 $_def_setenv
8308 #ifndef HAVE_SETENV
8309 int setenv(const char *name, const char *val, int overwrite);
8310 #endif
8312 /* Define this if your system has sysi86 */
8313 $_def_sysi86
8314 $_def_sysi86_iv
8316 /* Define this if your system has pthreads */
8317 $_def_pthreads
8319 /* LIRC (remote control, see www.lirc.org) support: */
8320 $_def_lirc
8322 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8323 $_def_apple_remote
8325 /* Apple IR Remote (Linux remote control driver) */
8326 $_def_apple_ir
8328 /* Support for maemo (http://www.maemo.org) */
8329 $_def_maemo
8332 * LIRCCD (LIRC client daemon)
8333 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8335 $_def_lircc
8337 /* DVD navigation support using libdvdnav */
8338 $_def_dvdnav
8340 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8341 #define MPEG12_POSTPROC 1
8343 /* maximum alignment used by libmpeg2 */
8344 #define ATTRIBUTE_ALIGNED_MAX 16
8346 /* Win32 DLL support */
8347 $_def_win32dll
8348 #define WIN32_PATH "$_win32codecsdir"
8350 /* Mac OS X specific features */
8351 $_def_macosx_finder
8352 $_def_macosx_bundle
8353 $_def_coreaudio
8354 $_def_corevideo
8355 $_def_quartz
8356 $_def_quicktime
8358 /* Build our Win32-loader */
8359 $_def_win32_loader
8361 /* FFmpeg */
8362 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8363 $_def_libpostproc
8364 $_def_libpostproc_a
8365 $_def_libpostproc_so
8367 /* Define this if you enabled thread support for libavcodec */
8368 $_def_threads
8369 #ifdef HAVE_THREADS
8370 #define ENABLE_THREADS 1
8371 #else
8372 #define ENABLE_THREADS 0
8373 #endif
8375 /* ffmpeg's libavcodec support (requires libavcodec source) */
8376 $_def_libavcodec
8377 $_def_libavcodec_a
8378 $_def_libavcodec_so
8379 $_def_libavcodec_mpegaudio_hp
8381 /* ffmpeg's libavformat support (requires libavformat source) */
8382 $_def_libavformat
8383 $_def_libavformat_a
8384 $_def_libavformat_so
8386 $_def_libavutil
8387 $_def_libavutil_a
8388 $_def_libavutil_so
8390 $_def_libswscale
8391 $_def_libswscale_a
8392 $_def_libswscale_so
8394 /* Use libavcodec's decoders */
8395 #define CONFIG_DECODERS 1
8396 #define ENABLE_DECODERS 1
8397 /* Use libavcodec's encoders */
8398 #define CONFIG_ENCODERS 1
8399 #define ENABLE_ENCODERS 1
8401 /* Use libavformat's demuxers */
8402 #define CONFIG_DEMUXERS 1
8403 #define ENABLE_DEMUXERS 1
8404 /* Use libavformat's muxers */
8405 $_def_muxers
8407 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8408 #define HAVE_EBX_AVAILABLE 1
8409 #ifndef MP_DEBUG
8410 #define HAVE_EBP_AVAILABLE 1
8411 #endif
8413 #define CONFIG_GPL 1
8414 #define ENABLE_SMALL 0
8415 #define ENABLE_GRAY 0
8417 /* Use AMR codecs from libavcodec. */
8418 $_def_libamr
8419 $_def_libamr_nb
8420 $_def_libamr_wb
8422 /* Use specific parts from FFmpeg. */
8423 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8424 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8425 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8426 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8427 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8428 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8429 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8431 $_def_libdirac_lavc
8432 $_def_faac_lavc
8433 $_def_mp3lame_lavc
8434 $_def_libschroedinger_lavc
8435 $_def_x264_lavc
8436 $_def_xvid_lavc
8438 /* Use codec libs included in mplayer CVS / source dist: */
8439 $_def_mp3lib
8441 /* enable liba52 support */
8442 $_def_liba52_internal
8443 $_def_liba52
8444 $_def_libmpeg2
8446 /* XAnim DLL support */
8447 $_def_xanim
8448 /* Default search path */
8449 $_def_xanim_path
8451 /* RealPlayer DLL support */
8452 $_def_real
8453 /* Default search path */
8454 $_def_real_path
8456 /* LIVE555 Streaming Media library support */
8457 $_def_live
8459 /* libnemesi Streaming Media library support */
8460 $_def_nemesi
8462 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8463 $_def_fastmemcpy
8465 /* Use UnRAR executable for Vobsubs */
8466 $_def_unrar_exec
8468 /* gui support, please do not edit this option */
8469 $_def_gui
8470 $_def_gtk2
8472 /* Audio output drivers */
8473 $_def_ossaudio
8474 $_def_ossaudio_devdsp
8475 $_def_ossaudio_devmixer
8476 $_def_alsa
8477 $_def_alsa5
8478 $_def_alsa9
8479 $_def_alsa1x
8480 $_def_arts
8481 $_def_esd
8482 $_def_esd_latency
8483 $_def_pulse
8484 $_def_jack
8485 $_def_openal
8486 $_def_openal_h
8487 $_def_sys_asoundlib_h
8488 $_def_alsa_asoundlib_h
8489 $_def_sunaudio
8490 $_def_sgiaudio
8491 $_def_win32waveout
8492 $_def_nas
8494 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8495 #undef FAST_OSD
8496 #undef FAST_OSD_TABLE
8498 /* Enable TV Interface support */
8499 $_def_tv
8501 /* Enable Video 4 Linux TV interface support */
8502 $_def_tv_v4l
8504 /* Enable Video 4 Linux 1 TV interface support */
8505 $_def_tv_v4l1
8507 /* Enable Video 4 Linux 2 TV interface support */
8508 $_def_tv_v4l2
8510 /* Enable DirectShow TV interface support */
8511 $_def_tv_dshow
8513 /* *BSD BrookTree headers */
8514 $_def_ioctl_meteor_h_name
8515 $_def_ioctl_bt848_h_name
8517 /* Enable *BSD BrookTree TV interface support */
8518 $_def_tv_bsdbt848
8520 /* Enable TV Teletext Interface support */
8521 $_def_tv_teletext
8523 /* Enable Radio Interface support */
8524 $_def_radio
8526 /* Enable Capture for Radio Interface support */
8527 $_def_radio_capture
8529 /* Enable Video 4 Linux Radio interface support */
8530 $_def_radio_v4l
8532 /* Enable Video 4 Linux 2 Radio interface support */
8533 $_def_radio_v4l2
8535 /* Enable *BSD BrookTree Radio interface support */
8536 $_def_radio_bsdbt848
8538 /* Enable Video 4 Linux 2 MPEG PVR support */
8539 $_def_pvr
8541 /* Define if your processor stores words with the most significant
8542 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8543 $_def_words_endian
8545 /* Define if your processor can access unaligned data in a fast way */
8546 $_def_fast_unaligned
8548 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8550 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8551 have the instruction. */
8552 $_def_dcbzl
8554 /* Define this for Cygwin build for win32 */
8555 $_def_confwin32
8557 /* Define this to any prefered value from 386 up to infinity with step 100 */
8558 #define __CPU__ $iproc
8560 $_mp_wordsize
8562 $_def_vcd
8564 #ifdef sun
8565 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8566 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8567 #elif defined(WIN32) || defined(__OS2__)
8568 #define DEFAULT_CDROM_DEVICE "D:"
8569 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8570 #elif defined(__APPLE__) || defined(__DARWIN__)
8571 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8572 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8573 #elif defined(__OpenBSD__)
8574 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8575 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8576 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8577 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8578 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8579 #elif defined(__DragonFly__)
8580 #define DEFAULT_CDROM_DEVICE "/dev/cd0"
8581 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8582 #elif defined(__AMIGAOS4__)
8583 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8584 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8585 #else
8586 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8587 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8588 #endif
8591 /*----------------------------------------------------------------------------
8593 ** NOTE: Instead of modifying these definitions here, use the
8594 ** --enable/--disable options of the ./configure script!
8595 ** See ./configure --help for details.
8597 *---------------------------------------------------------------------------*/
8599 /* C99 *lrint* and round* functions available */
8600 $_def_llrint
8601 $_def_lrint
8602 $_def_lrintf
8603 $_def_round
8604 $_def_roundf
8606 /* mkstemp support */
8607 $_def_mkstemp
8609 /* nanosleep support */
8610 $_def_nanosleep
8612 /* SMB support */
8613 $_def_smb
8615 /* termcap flag for getch2.c */
8616 $_def_termcap
8618 /* termios flag for getch2.c */
8619 $_def_termios
8620 $_def_termios_h
8621 $_def_termios_sys_h
8623 /* enable PNG support */
8624 $_def_png
8626 /* enable JPEG support */
8627 $_def_jpeg
8629 /* enable PNM support */
8630 $_def_pnm
8632 /* enable md5sum support */
8633 $_def_md5sum
8635 /* enable yuv4mpeg support */
8636 $_def_yuv4mpeg
8638 /* enable GIF support */
8639 $_def_gif
8640 $_def_gif_4
8641 $_def_gif_tvt_hack
8643 /* enable bitmap font support */
8644 $_def_bitmap_font
8646 /* enable FreeType support */
8647 $_def_freetype
8649 /* enable Fontconfig support */
8650 $_def_fontconfig
8652 /* enable SSA/ASS support */
8653 $_def_ass
8655 /* enable FriBiDi usage */
8656 $_def_fribidi
8658 /* enable ENCA usage */
8659 $_def_enca
8661 /* liblzo support */
8662 $_def_liblzo
8664 /* libmad support */
8665 $_def_mad
8667 /* enable OggVorbis support */
8668 $_def_vorbis
8669 $_def_tremor
8671 /* enable Speex support */
8672 $_def_speex
8674 /* enable musepack support */
8675 $_def_musepack
8677 /* enable OggTheora support */
8678 $_def_theora
8680 /* enable FAAD (AAC) support */
8681 $_def_faad
8682 $_def_faad_internal
8684 /* enable FAAC (AAC encoder) support */
8685 $_def_faac
8687 /* enable libdca support */
8688 $_def_libdca
8690 /* enable LADSPA plugin support */
8691 $_def_ladspa
8693 /* enable network */
8694 $_def_network
8696 /* enable ftp support */
8697 $_def_ftp
8699 /* enable vstream support */
8700 $_def_vstream
8702 /* enable winsock2 instead of Unix functions*/
8703 $_def_winsock2_h
8705 /* define this to use inet_aton() instead of inet_pton() */
8706 $_def_use_aton
8708 /* socklen_t support */
8709 $_def_socklen_t
8710 #ifndef HAVE_SOCKLEN_T
8711 #define HAVE_SOCKLEN_T 1
8712 typedef int socklen_t;
8713 #endif
8715 /* closesocket() support */
8716 $_def_closesocket
8718 /* enables / disables cdparanoia support */
8719 $_def_cdparanoia
8720 $_def_cddb
8722 /* enables / disables VIDIX usage */
8723 $_def_vidix
8724 $_def_vidix_drv_cyberblade
8725 $_def_vidix_drv_ivtv
8726 $_def_vidix_drv_mach64
8727 $_def_vidix_drv_mga
8728 $_def_vidix_drv_mga_crtc2
8729 $_def_vidix_drv_nvidia
8730 $_def_vidix_drv_pm3
8731 $_def_vidix_drv_radeon
8732 $_def_vidix_drv_rage128
8733 $_def_vidix_drv_s3
8734 $_def_vidix_drv_sh_veu
8735 $_def_vidix_drv_sis
8736 $_def_vidix_drv_unichrome
8737 $_def_vidix_pfx
8739 /* enables / disables new input joystick support */
8740 $_def_joystick
8742 /* enables / disables QTX codecs */
8743 $_def_qtx
8744 $_def_qtx_win32
8746 /* enables / disables osd menu */
8747 $_def_menu
8749 /* enables / disables subtitles sorting */
8750 $_def_sortsub
8752 /* XMMS input plugin support */
8753 $_def_xmms
8754 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8756 /* enables inet6 support */
8757 $_def_inet6
8759 /* do we have gethostbyname2? */
8760 $_def_gethostbyname2
8762 /* Extension defines */
8763 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8765 $_def_altivec_h // enables usage of altivec.h
8767 /* libvo options */
8768 #define SCREEN_SIZE_X 1
8769 #define SCREEN_SIZE_Y 1
8770 $_def_x11
8771 $_def_xv
8772 $_def_xvmc
8773 $_def_vm
8774 $_def_xf86keysym
8775 $_def_xinerama
8776 $_def_gl
8777 $_def_gl_win32
8778 $_def_dga
8779 $_def_dga1
8780 $_def_dga2
8781 $_def_sdl
8782 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8783 $_def_sdlbuggy
8784 $_def_directx
8785 $_def_ggi
8786 $_def_ggiwmh
8787 $_def_3dfx
8788 $_def_s3fb
8789 $_def_wii
8790 $_def_tdfxfb
8791 $_def_tdfxvid
8792 $_def_xvr100
8793 $_def_directfb
8794 $_def_directfb_version
8795 $_def_dfbmga
8796 $_def_zr
8797 $_def_bl
8798 $_def_mga
8799 $_def_xmga
8800 $_def_fbdev
8801 $_def_dxr2
8802 $_def_dxr3
8803 $_def_ivtv
8804 $_def_v4l2
8805 $_def_dvb
8806 $_def_dvb_head
8807 $_def_dvbin
8808 $_def_svga
8809 $_def_vesa
8810 $_def_xss
8811 $_def_xdpms
8812 $_def_aa
8813 $_def_caca
8814 $_def_tga
8815 $_def_toolame
8816 $_def_twolame
8818 /* used by GUI: */
8819 $_def_xshape
8821 #if defined(CONFIG_GL) || defined(CONFIG_X11) || defined(CONFIG_XV)
8822 #define X11_FULLSCREEN 1
8823 #endif
8825 #endif /* MPLAYER_CONFIG_H */
8828 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8829 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8831 #############################################################################
8833 cat << EOF
8835 Config files successfully generated by ./configure $_configuration !
8837 Install prefix: $_prefix
8838 Data directory: $_datadir
8839 Config direct.: $_confdir
8841 Byte order: $_byte_order
8842 Optimizing for: $_optimizing
8844 Languages:
8845 Messages/GUI: $msg_lang
8846 Manual pages: $man_langs
8848 Enabled optional drivers:
8849 Input: $_inputmodules
8850 Codecs: $_codecmodules
8851 Audio output: $_aomodules
8852 Video output: $_vomodules
8854 Disabled optional drivers:
8855 Input: $_noinputmodules
8856 Codecs: $_nocodecmodules
8857 Audio output: $_noaomodules
8858 Video output: $_novomodules
8860 'config.h' and 'config.mak' contain your configuration options.
8861 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8862 compile *** DO NOT REPORT BUGS if you tweak these files ***
8864 'make' will now compile MPlayer and 'make install' will install it.
8865 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8870 if test "$_mtrr" = yes ; then
8871 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$doc_lang/video.html#mtrr)"
8872 echo
8875 if ! x86_32; then
8876 cat <<EOF
8877 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8878 operating system ($system_name). You may encounter a few files that cannot
8879 be played due to missing open source video/audio codec support.
8885 cat <<EOF
8886 Check $TMPLOG if you wonder why an autodetection failed (make sure
8887 development headers/packages are installed).
8889 NOTE: The --enable-* parameters unconditionally force options on, completely
8890 skipping autodetection. This behavior is unlike what you may be used to from
8891 autoconf-based configure scripts that can decide to override you. This greater
8892 level of control comes at a price. You may have to provide the correct compiler
8893 and linker flags yourself.
8894 If you used one of these options (except --enable-gui and similar ones that
8895 turn on internal features) and experience a compilation or linking failure,
8896 make sure you have passed the necessary compiler/linker flags to configure.
8898 If you suspect a bug, please read DOCS/HTML/$doc_lang/bugreports.html.
8902 if test "$_warn_CFLAGS" = yes; then
8903 cat <<EOF
8905 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8907 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8909 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8910 To do so, execute 'CFLAGS= ./configure <options>'
8915 # Last move:
8916 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"