bbox[n] and spu->scaled_start_row are unsigned, comparison with 0 is pointless.
[mplayer/glamo.git] / configure
blob92520ff5c95590131fca51ae625bc24181a2ca9e
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 HAVE_FEATURE 1'
34 # else
35 # _def_feature='#undef HAVE_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 $TMPO $@" >> "$TMPLOG"
66 rm -f "$TMPO"
67 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPO" "$@" >> "$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 "$TMPO" >> "$TMPLOG" 2>&1
86 # Display error message, flushes tempfile, exit
87 die () {
88 echo
89 echo "Error: $@" >&2
90 echo >&2
91 rm -f "$TMPO" "$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 bsd() { freebsd || netbsd || bsdos || openbsd ; 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 "$?" ; }
120 # arch test boolean functions
121 # x86/x86pc is used by QNX
122 x86_32() {
123 case "$host_arch" in
124 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
125 *) return 1 ;;
126 esac
129 x86_64() {
130 case "$host_arch" in
131 x86_64|amd64) return 0 ;;
132 *) return 1 ;;
133 esac
136 x86() {
137 x86_32 || x86_64
140 ppc() {
141 case "$host_arch" in
142 ppc|powerpc) return 0;;
143 *) return 1;;
144 esac
147 alpha() {
148 case "$host_arch" in
149 alpha) return 0;;
150 *) return 1;;
151 esac
154 arm() {
155 case "$host_arch" in
156 arm) return 0;;
157 *) return 1;;
158 esac
161 sh3() {
162 case "$host_arch" in
163 sh3) return 0;;
164 *) return 1;;
165 esac
168 # not boolean test: implement the posix shell "!" operator for a
169 # non-posix /bin/sh.
170 # usage: not {command}
171 # returns exit status "success" when the execution of "command"
172 # fails.
173 not() {
174 eval "$@"
175 test $? -ne 0
178 # Use this before starting a check
179 echocheck() {
180 echo "============ Checking for $@ ============" >> "$TMPLOG"
181 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
184 # Use this to echo the results of a check
185 echores() {
186 if test "$_res_comment" ; then
187 _res_comment="($_res_comment)"
189 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
190 echo "##########################################" >> "$TMPLOG"
191 echo "" >> "$TMPLOG"
192 echo "$@ $_res_comment"
193 _res_comment=""
195 #############################################################################
197 # Check how echo works in this /bin/sh
198 case `echo -n` in
199 -n) _echo_n= _echo_c='\c' ;; # SysV echo
200 *) _echo_n='-n ' _echo_c= ;; # BSD echo
201 esac
203 LANGUAGES=`echo help/help_mp-??.h help/help_mp-??_??.h | sed "s:help/help_mp-\(..\).h:\1:g" | sed "s:help/help_mp-\(.....\).h:\1:g"`
205 show_help(){
206 cat << EOF
207 Usage: $0 [OPTIONS]...
209 Configuration:
210 -h, --help display this help and exit
212 Installation directories:
213 --prefix=DIR prefix directory for installation [/usr/local]
214 --bindir=DIR directory for installing binaries [PREFIX/bin]
215 --datadir=DIR directory for installing machine independent
216 data files (skins, etc) [PREFIX/share/mplayer]
217 --mandir=DIR directory for installing man pages [PREFIX/man]
218 --confdir=DIR directory for installing configuration files
219 [PREFIX/etc/mplayer]
220 --libdir=DIR directory for object code libraries [PREFIX/lib]
221 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
222 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
223 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
224 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
226 Optional features:
227 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
228 --disable-mplayer disable MPlayer compilation [enable]
229 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
230 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
231 --enable-largefiles enable support for files > 2GB [disable]
232 --enable-linux-devfs set default devices to devfs [disable]
233 --enable-termcap use termcap database for key codes [autodetect]
234 --enable-termios use termios database for key codes [autodetect]
235 --disable-iconv disable iconv for encoding conversion [autodetect]
236 --disable-langinfo do not use langinfo [autodetect]
237 --enable-lirc enable LIRC (remote control) support [autodetect]
238 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
239 --enable-joystick enable joystick support [disable]
240 --disable-vm disable X video mode extensions [autodetect]
241 --disable-xf86keysym disable support for multimedia keys [autodetect]
242 --enable-radio enable radio interface [disable]
243 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
244 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
245 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
246 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
247 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
248 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
249 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
250 --disable-tv-teletext disable TV teletext interface [autodetect]
251 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
252 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
253 --disable-network disable networking [enable]
254 --enable-winsock2 enable winsock2 [autodetect]
255 --enable-smb enable Samba (SMB) input [autodetect]
256 --enable-live enable LIVE555 Streaming Media [autodetect]
257 --disable-dvdnav disable libdvdnav [autodetect]
258 --disable-dvdread disable libdvdread [autodetect]
259 --disable-dvdread-internal disable internal libdvdread [autodetect]
260 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
261 --disable-cdparanoia disable cdparanoia [autodetect]
262 --disable-cddb disable cddb [autodetect]
263 --disable-bitmap-font disable bitmap font support [enable]
264 --disable-freetype disable FreeType 2 font rendering [autodetect]
265 --disable-fontconfig disable fontconfig font lookup [autodetect]
266 --disable-unrarlib disable Unique RAR File Library [enabled]
267 --enable-menu enable OSD menu (not DVD menu) [disabled]
268 --disable-sortsub disable subtitle sorting [enabled]
269 --enable-fribidi enable the FriBiDi libs [autodetect]
270 --disable-enca disable ENCA charset oracle library [autodetect]
271 --disable-macosx disable Mac OS X specific features [autodetect]
272 --disable-maemo disable maemo specific features [autodetect]
273 --enable-macosx-finder-support enable Mac OS X Finder invocation
274 parameter parsing [disabled]
275 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
276 --disable-inet6 disable IPv6 support [autodetect]
277 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
278 --disable-ftp disable FTP support [enabled]
279 --disable-vstream disable TiVo vstream client support [autodetect]
280 --disable-pthreads disable Posix threads support [autodetect]
281 --disable-w32threads disable Win32 threads support [autodetect]
282 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
283 --enable-rpath enable runtime linker path for extra libs [disabled]
285 Codecs:
286 --enable-gif enable GIF support [autodetect]
287 --enable-png enable PNG input/output support [autodetect]
288 --enable-jpeg enable JPEG input/output support [autodetect]
289 --enable-libcdio enable external libcdio [autodetect]
290 --enable-liblzo enable external liblzo [autodetect]
291 --disable-win32dll disable Win32 DLL support [enabled]
292 --disable-qtx disable QuickTime codecs support [enabled]
293 --disable-xanim disable XAnim codecs support [enabled]
294 --disable-real disable RealPlayer codecs support [enabled]
295 --disable-xvid disable XviD [autodetect]
296 --disable-x264 disable x264 [autodetect]
297 --disable-libnut disable libnut [autodetect]
298 --disable-libavutil_a disable static libavutil [autodetect]
299 --disable-libavcodec_a disable static libavcodec [autodetect]
300 --disable-libavformat_a disable static libavformat [autodetect]
301 --disable-libpostproc_a disable static libpostproc [autodetect]
302 --disable-libavutil_so disable shared libavutil [autodetect]
303 --disable-libavcodec_so disable shared libavcodec [autodetect]
304 --disable-libavformat_so disable shared libavformat [autodetect]
305 --disable-libpostproc_so disable shared libpostproc [autodetect]
306 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
307 in libavcodec [enabled]
308 --disable-tremor-internal disable internal Tremor [enabled]
309 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
310 --enable-tremor-external enable external Tremor [autodetect]
311 --disable-libvorbis disable libvorbis support [autodetect]
312 --disable-speex disable Speex support [autodetect]
313 --enable-theora enable OggTheora libraries [autodetect]
314 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
315 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
316 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
317 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
318 --disable-ladspa disable LADSPA plugin support [autodetect]
319 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
320 --disable-mad disable libmad (MPEG audio) support [autodetect]
321 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
322 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
323 --enable-xmms enable XMMS input plugin support [disabled]
324 --enable-libdca enable libdca support [autodetect]
325 --disable-mp3lib disable builtin mp3lib [enabled]
326 --disable-liba52 disable builtin liba52 [enabled]
327 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
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-internal disable internal VIDIX [for x86 *nix]
344 --disable-vidix-external disable external VIDIX [for x86 *nix]
345 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
346 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
347 nvidia,pm2,pm3,radeon,rage128,savage,sis,unichrome
348 --enable-gl enable OpenGL video output [autodetect]
349 --enable-dga[=n] enable DGA [n in {1, 2} ] support [autodetect]
350 --enable-vesa enable VESA video output [autodetect]
351 --enable-svga enable SVGAlib video output [autodetect]
352 --enable-sdl enable SDL video output [autodetect]
353 --enable-aa enable AAlib video output [autodetect]
354 --enable-caca enable CACA video output [autodetect]
355 --enable-ggi enable GGI video output [autodetect]
356 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
357 --enable-directx enable DirectX video output [autodetect]
358 --enable-dxr2 enable DXR2 video output [autodetect]
359 --enable-dxr3 enable DXR3/H+ video output [autodetect]
360 --enable-ivtv enable IVTV TV-Out video output [autodetect]
361 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
362 --enable-dvb enable DVB video output [autodetect]
363 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
364 --enable-mga enable mga_vid video output [disable]
365 --enable-xmga enable mga_vid X11 video output [autodetect]
366 --enable-xv enable Xv video output [autodetect]
367 --enable-xvmc enable XvMC acceleration [disable]
368 --enable-vm enable XF86VidMode support [autodetect]
369 --enable-xinerama enable Xinerama support [autodetect]
370 --enable-x11 enable X11 video output [autodetect]
371 --enable-xshape enable XShape support [autodetect]
372 --enable-fbdev enable FBDev video output [autodetect]
373 --enable-mlib enable mediaLib video output (Solaris) [disable]
374 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
375 --enable-tdfxfb enable tdfxfb video output [disable]
376 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
377 --enable-directfb enable DirectFB video output [autodetect]
378 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
379 --enable-bl enable Blinkenlights video output [disable]
380 --enable-tdfxvid enable tdfx_vid video output [disable]
381 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
382 --disable-tga disable Targa video output [enable]
383 --disable-pnm disable PNM video output [enable]
384 --disable-md5sum disable md5sum video output [enable]
386 Audio output:
387 --disable-alsa disable ALSA audio output [autodetect]
388 --disable-ossaudio disable OSS audio output [autodetect]
389 --disable-arts disable aRts audio output [autodetect]
390 --disable-esd disable esd audio output [autodetect]
391 --disable-polyp disable Polypaudio audio output [autodetect]
392 --disable-jack disable JACK audio output [autodetect]
393 --disable-openal disable OpenAL audio output [autodetect]
394 --disable-nas disable NAS audio output [autodetect]
395 --disable-sgiaudio disable SGI audio output [autodetect]
396 --disable-sunaudio disable Sun audio output [autodetect]
397 --disable-win32waveout disable Windows waveout audio output [autodetect]
398 --disable-select disable using select() on the audio device [enable]
400 Miscellaneous options:
401 --enable-runtime-cpudetection enable runtime CPU detection [disable]
402 --enable-cross-compile enable cross-compilation [autodetect]
403 --cc=COMPILER C compiler to build MPlayer [gcc]
404 --host-cc=COMPILER C compiler for tools needed while building [gcc]
405 --as=ASSEMBLER assembler to build MPlayer [as]
406 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
407 --enable-static build a statically linked binary
408 --charset=charset convert the console messages to this character set
409 --language=list a white space or comma separated list of languages for
410 translated man pages, the first language is used for
411 messages and the GUI (the environment variable
412 \$LINGUAS is also honored) [en]
413 (Available: $LANGUAGES all)
414 --with-install=PATH path to a custom install program
415 --enable-color-console enable color console output (UNSUPPORTED) [disable]
417 Advanced options:
418 --enable-mmx enable MMX [autodetect]
419 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
420 --enable-3dnow enable 3DNow! [autodetect]
421 --enable-3dnowext enable extended 3DNow! [autodetect]
422 --enable-sse enable SSE [autodetect]
423 --enable-sse2 enable SSE2 [autodetect]
424 --enable-ssse3 enable SSSE3 [autodetect]
425 --enable-shm enable shm [autodetect]
426 --enable-altivec enable AltiVec (PowerPC) [autodetect]
427 --enable-armv5te enable DSP extensions (ARM) [autodetect]
428 --enable-armv6 enable ARMv6 (ARM) [autodetect]
429 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
430 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
431 --enable-big-endian force byte order to big-endian [autodetect]
432 --enable-debug[=1-3] compile-in debugging information [disable]
433 --enable-profile compile-in profiling information [disable]
434 --disable-sighandler disable sighandler for crashes [enable]
435 --enable-crash-debug enable automatic gdb attach on crash [disable]
436 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
438 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
439 --disable-gcc-check disable gcc version checking [enable]
441 Use these options if autodetection fails (Options marked with (*) accept
442 multiple paths separated by ':'):
443 --extra-libs=FLAGS extra linker flags
444 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
445 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
446 --with-extraincdir=DIR extra header search paths in DIR (*)
447 --with-extralibdir=DIR extra linker search paths in DIR (*)
448 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
450 --with-freetype-config=PATH path to freetype-config
451 --with-fribidi-config=PATH path to fribidi-config
452 --with-glib-config=PATH path to glib*-config
453 --with-gtk-config=PATH path to gtk*-config
454 --with-sdl-config=PATH path to sdl*-config
455 --with-dvdnav-config=PATH path to dvdnav-config
457 This configure script is NOT autoconf-based, even though its output is similar.
458 It will try to autodetect all configuration options. If you --enable an option
459 it will be forcefully turned on, skipping autodetection. This can break
460 compilation, so you need to know what you are doing.
462 exit 0
463 } #show_help()
465 # GOTCHA: the variables below defines the default behavior for autodetection
466 # and have - unless stated otherwise - at least 2 states : yes no
467 # If autodetection is available then the third state is: auto
468 _mmx=auto
469 _3dnow=auto
470 _3dnowext=auto
471 _mmxext=auto
472 _sse=auto
473 _sse2=auto
474 _ssse3=auto
475 _cmov=auto
476 _fast_cmov=auto
477 _armv5te=auto
478 _armv6=auto
479 _iwmmxt=auto
480 _mtrr=auto
481 _install=install
482 _ranlib=ranlib
483 _ldconfig=ldconfig
484 _cc=cc
485 test "$CC" && _cc="$CC"
486 _gcc_check=yes
487 _as=auto
488 _runtime_cpudetection=no
489 _cross_compile=auto
490 _prefix="/usr/local"
491 _libavutil_a=auto
492 _libavutil_so=auto
493 _libavcodec_a=auto
494 _libamr_nb=auto
495 _libamr_wb=auto
496 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
497 _libavdecoders=` echo $_libavdecoders_all | sed -e s/LIBFAAD_DECODER// -e s/MPEG4AAC_DECODER// -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// `
498 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
499 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// `
500 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
501 _libavparsers=$_libavparsers_all
502 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
503 _libavbsfs=$_libavbsfs_all
504 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
505 _libavdemuxers=`echo $_libavdemuxers_all | sed -e s/AUDIO_DEMUXER// -e s/DC1394_DEMUXER// -e s/DV1394_DEMUXER// -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/VIDEO_GRAB_V4L_DEMUXER// -e s/VIDEO_GRAB_BKTR_DEMUXER// -e s/X11_GRAB_DEVICE_DEMUXER// -e s/V4L2_DEMUXER// -e s/LIBNUT_DEMUXER// `
506 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
507 _libavmuxers=`echo $_libavmuxers_all | sed -e s/AUDIO_MUXER// -e s/RTP_MUXER// `
508 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
509 _libavcodec_so=auto
510 _libavformat_a=auto
511 _libavformat_so=auto
512 _libpostproc_a=auto
513 _libpostproc_so=auto
514 _libavcodec_mpegaudio_hp=yes
515 _mencoder=yes
516 _mplayer=yes
517 _x11=auto
518 _xshape=auto
519 _dga=auto # 1 2 no auto
520 _xv=auto
521 _xvmc=no #auto when complete
522 _sdl=auto
523 _directx=auto
524 _win32waveout=auto
525 _nas=auto
526 _png=auto
527 _jpeg=auto
528 _pnm=yes
529 _md5sum=yes
530 _gif=auto
531 _gl=auto
532 _ggi=auto
533 _ggiwmh=auto
534 _aa=auto
535 _caca=auto
536 _svga=auto
537 _vesa=auto
538 _fbdev=auto
539 _dvb=auto
540 _dvbhead=auto
541 _dxr2=auto
542 _dxr3=auto
543 _ivtv=auto
544 _v4l2=auto
545 _iconv=auto
546 _langinfo=auto
547 _rtc=auto
548 _ossaudio=auto
549 _arts=auto
550 _esd=auto
551 _polyp=auto
552 _jack=auto
553 _openal=auto
554 _libcdio=auto
555 _liblzo=auto
556 _mad=auto
557 _toolame=auto
558 _twolame=auto
559 _tremor_internal=yes
560 _tremor_low=no
561 _tremor_external=auto
562 _libvorbis=auto
563 _speex=auto
564 _theora=auto
565 _mp3lib=yes
566 _liba52=yes
567 _libdca=auto
568 _libmpeg2=yes
569 _faad_internal=auto
570 _faad_external=auto
571 _faad_fixed=no
572 _faac=auto
573 _ladspa=auto
574 _xmms=no
575 _dvdnav=auto
576 _dvdnavconfig=dvdnav-config
577 _dvdread=auto
578 _dvdread_internal=auto
579 _libdvdcss_internal=auto
580 _xanim=auto
581 _real=auto
582 _live=auto
583 _xinerama=auto
584 _mga=no
585 _xmga=auto
586 _vm=auto
587 _xf86keysym=auto
588 _mlib=no #broken, thus disabled
589 _sgiaudio=auto
590 _sunaudio=auto
591 _alsa=auto
592 _fastmemcpy=yes
593 _unrarlib=yes
594 _win32dll=auto
595 _select=yes
596 _radio=no
597 _radio_capture=no
598 _radio_v4l=auto
599 _radio_v4l2=auto
600 _radio_bsdbt848=auto
601 _tv=yes
602 _tv_v4l1=auto
603 _tv_v4l2=auto
604 _tv_bsdbt848=auto
605 _tv_teletext=auto
606 _pvr=auto
607 _network=yes
608 _winsock2=auto
609 _smbsupport=auto
610 _vidix_internal=auto
611 _vidix_external=auto
612 _joystick=no
613 _xvid=auto
614 _x264=auto
615 _libnut=auto
616 _lirc=auto
617 _lircc=auto
618 _gui=no
619 _gtk1=no
620 _termcap=auto
621 _termios=auto
622 _3dfx=no
623 _s3fb=no
624 _tdfxfb=no
625 _tdfxvid=no
626 _xvr100=auto
627 _tga=yes
628 _directfb=auto
629 _zr=auto
630 _bl=no
631 _largefiles=no
632 #_language=en
633 _shm=auto
634 _linux_devfs=no
635 _charset="UTF-8"
636 _dynamic_plugins=no
637 _crash_debug=no
638 _sighandler=yes
639 _libdv=auto
640 _cdparanoia=auto
641 _cddb=auto
642 _big_endian=auto
643 _bitmap_font=yes
644 _freetype=auto
645 _fontconfig=auto
646 _menu=no
647 _qtx=auto
648 _macosx=auto
649 _maemo=auto
650 _macosx_finder_support=no
651 _macosx_bundle=auto
652 _sortsub=yes
653 _freetypeconfig='freetype-config'
654 _fribidi=auto
655 _fribidiconfig='fribidi-config'
656 _enca=auto
657 _inet6=auto
658 _gethostbyname2=auto
659 _ftp=yes
660 _musepack=auto
661 _vstream=auto
662 _pthreads=auto
663 _w32threads=auto
664 _ass=auto
665 _rpath=no
666 _asmalign_pot=auto
667 _color_console=no
668 _stream_cache=yes
669 _def_stream_cache="#define USE_STREAM_CACHE 1"
670 _need_shmem=yes
671 for ac_option do
672 case "$ac_option" in
673 --help|-help|-h)
674 show_help
676 --prefix=*)
677 _prefix=`echo $ac_option | cut -d '=' -f 2`
679 --bindir=*)
680 _bindir=`echo $ac_option | cut -d '=' -f 2`
682 --datadir=*)
683 _datadir=`echo $ac_option | cut -d '=' -f 2`
685 --mandir=*)
686 _mandir=`echo $ac_option | cut -d '=' -f 2`
688 --confdir=*)
689 _confdir=`echo $ac_option | cut -d '=' -f 2`
691 --libdir=*)
692 _libdir=`echo $ac_option | cut -d '=' -f 2`
694 --codecsdir=*)
695 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
697 --win32codecsdir=*)
698 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
700 --xanimcodecsdir=*)
701 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
703 --realcodecsdir=*)
704 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
706 --with-extraincdir=*)
707 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
709 --with-extralibdir=*)
710 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
713 --with-install=*)
714 _install=`echo $ac_option | cut -d '=' -f 2 `
716 --with-xvmclib=*)
717 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
720 --with-sdl-config=*)
721 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
723 --with-freetype-config=*)
724 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
726 --with-fribidi-config=*)
727 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
729 --with-gtk-config=*)
730 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
732 --with-glib-config=*)
733 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
735 --with-dvdnav-config=*)
736 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
739 --extra-libs=*)
740 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
742 --extra-libs-mplayer=*)
743 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
745 --extra-libs-mencoder=*)
746 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
749 --target=*)
750 _target=`echo $ac_option | cut -d '=' -f 2`
752 --cc=*)
753 _cc=`echo $ac_option | cut -d '=' -f 2`
755 --host-cc=*)
756 _host_cc=`echo $ac_option | cut -d '=' -f 2`
758 --as=*)
759 _as=`echo $ac_option | cut -d '=' -f 2`
761 --charset=*)
762 _charset=`echo $ac_option | cut -d '=' -f 2`
764 --language=*)
765 _language=`echo $ac_option | cut -d '=' -f 2`
768 --enable-static)
769 _ld_static='-static'
771 --disable-static)
772 _ld_static=''
774 --enable-profile)
775 _profile='-p'
777 --disable-profile)
778 _profile=
780 --enable-debug)
781 _debug='-g'
783 --enable-debug=*)
784 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
786 --disable-debug)
787 _debug=
789 --enable-gcc-check) _gcc_check=yes ;;
790 --disable-gcc-check) _gcc_check=no ;;
791 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
792 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
793 --enable-cross-compile) _cross_compile=yes ;;
794 --disable-cross-compile) _cross_compile=no ;;
795 --enable-mencoder) _mencoder=yes ;;
796 --disable-mencoder) _mencoder=no ;;
797 --enable-mplayer) _mplayer=yes ;;
798 --disable-mplayer) _mplayer=no ;;
799 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
800 --disable-dynamic-plugins) _dynamic_plugins=no ;;
801 --enable-x11) _x11=yes ;;
802 --disable-x11) _x11=no ;;
803 --enable-xshape) _xshape=yes ;;
804 --disable-xshape) _xshape=no ;;
805 --enable-xv) _xv=yes ;;
806 --disable-xv) _xv=no ;;
807 --enable-xvmc) _xvmc=yes ;;
808 --disable-xvmc) _xvmc=no ;;
809 --enable-sdl) _sdl=yes ;;
810 --disable-sdl) _sdl=no ;;
811 --enable-directx) _directx=yes ;;
812 --disable-directx) _directx=no ;;
813 --enable-win32waveout) _win32waveout=yes ;;
814 --disable-win32waveout) _win32waveout=no ;;
815 --enable-nas) _nas=yes ;;
816 --disable-nas) _nas=no ;;
817 --enable-png) _png=yes ;;
818 --disable-png) _png=no ;;
819 --enable-jpeg) _jpeg=yes ;;
820 --disable-jpeg) _jpeg=no ;;
821 --enable-pnm) _pnm=yes ;;
822 --disable-pnm) _pnm=no ;;
823 --enable-md5sum) _md5sum=yes ;;
824 --disable-md5sum) _md5sum=no ;;
825 --enable-gif) _gif=yes ;;
826 --disable-gif) _gif=no ;;
827 --enable-gl) _gl=yes ;;
828 --disable-gl) _gl=no ;;
829 --enable-ggi) _ggi=yes ;;
830 --disable-ggi) _ggi=no ;;
831 --enable-ggiwmh) _ggiwmh=yes ;;
832 --disable-ggiwmh) _ggiwmh=no ;;
833 --enable-aa) _aa=yes ;;
834 --disable-aa) _aa=no ;;
835 --enable-caca) _caca=yes ;;
836 --disable-caca) _caca=no ;;
837 --enable-svga) _svga=yes ;;
838 --disable-svga) _svga=no ;;
839 --enable-vesa) _vesa=yes ;;
840 --disable-vesa) _vesa=no ;;
841 --enable-fbdev) _fbdev=yes ;;
842 --disable-fbdev) _fbdev=no ;;
843 --enable-dvb) _dvb=yes ;;
844 --disable-dvb) _dvb=no ;;
845 --enable-dvbhead) _dvbhead=yes ;;
846 --disable-dvbhead) _dvbhead=no ;;
847 --enable-dxr2) _dxr2=yes ;;
848 --disable-dxr2) _dxr2=no ;;
849 --enable-dxr3) _dxr3=yes ;;
850 --disable-dxr3) _dxr3=no ;;
851 --enable-ivtv) _ivtv=yes ;;
852 --disable-ivtv) _ivtv=no ;;
853 --enable-v4l2) _v4l2=yes ;;
854 --disable-v4l2) _v4l2=no ;;
855 --enable-iconv) _iconv=yes ;;
856 --disable-iconv) _iconv=no ;;
857 --enable-langinfo) _langinfo=yes ;;
858 --disable-langinfo) _langinfo=no ;;
859 --enable-rtc) _rtc=yes ;;
860 --disable-rtc) _rtc=no ;;
861 --enable-libdv) _libdv=yes ;;
862 --disable-libdv) _libdv=no ;;
863 --enable-ossaudio) _ossaudio=yes ;;
864 --disable-ossaudio) _ossaudio=no ;;
865 --enable-arts) _arts=yes ;;
866 --disable-arts) _arts=no ;;
867 --enable-esd) _esd=yes ;;
868 --disable-esd) _esd=no ;;
869 --enable-polyp) _polyp=yes ;;
870 --disable-polyp) _polyp=no ;;
871 --enable-jack) _jack=yes ;;
872 --disable-jack) _jack=no ;;
873 --enable-openal) _openal=yes ;;
874 --disable-openal) _openal=no ;;
875 --enable-mad) _mad=yes ;;
876 --disable-mad) _mad=no ;;
877 --enable-toolame) _toolame=yes ;;
878 --disable-toolame) _toolame=no ;;
879 --enable-twolame) _twolame=yes ;;
880 --disable-twolame) _twolame=no ;;
881 --enable-libcdio) _libcdio=yes ;;
882 --disable-libcdio) _libcdio=no ;;
883 --enable-liblzo) _liblzo=yes ;;
884 --disable-liblzo) _liblzo=no ;;
885 --enable-libvorbis) _libvorbis=yes ;;
886 --disable-libvorbis) _libvorbis=no ;;
887 --enable-speex) _speex=yes ;;
888 --disable-speex) _speex=no ;;
889 --enable-tremor-internal) _tremor_internal=yes ;;
890 --disable-tremor-internal) _tremor_internal=no ;;
891 --enable-tremor-low) _tremor_low=yes ;;
892 --disable-tremor-low) _tremor_low=no ;;
893 --enable-tremor-external) _tremor_external=yes ;;
894 --disable-tremor-external) _tremor_external=no ;;
895 --enable-theora) _theora=yes ;;
896 --disable-theora) _theora=no ;;
897 --enable-mp3lib) _mp3lib=yes ;;
898 --disable-mp3lib) _mp3lib=no ;;
899 --enable-liba52) _liba52=yes ;;
900 --disable-liba52) _liba52=no ;;
901 --enable-libdca) _libdca=yes ;;
902 --disable-libdca) _libdca=no ;;
903 --enable-libmpeg2) _libmpeg2=yes ;;
904 --disable-libmpeg2) _libmpeg2=no ;;
905 --enable-musepack) _musepack=yes ;;
906 --disable-musepack) _musepack=no ;;
907 --enable-faad-internal) _faad_internal=yes ;;
908 --disable-faad-internal) _faad_internal=no ;;
909 --enable-faad-external) _faad_external=yes ;;
910 --disable-faad-external) _faad_external=no ;;
911 --enable-faad-fixed) _faad_fixed=yes ;;
912 --disable-faad-fixed) _faad_fixed=no ;;
913 --enable-faac) _faac=yes ;;
914 --disable-faac) _faac=no ;;
915 --enable-ladspa) _ladspa=yes ;;
916 --disable-ladspa) _ladspa=no ;;
917 --enable-xmms) _xmms=yes ;;
918 --disable-xmms) _xmms=no ;;
919 --enable-dvdread) _dvdread=yes ;;
920 --disable-dvdread) _dvdread=no ;;
921 --enable-dvdread-internal) _dvdread_internal=yes ;;
922 --disable-dvdread-internal) _dvdread_internal=no ;;
923 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
924 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
925 --enable-dvdnav) _dvdnav=yes ;;
926 --disable-dvdnav) _dvdnav=no ;;
927 --enable-xanim) _xanim=yes ;;
928 --disable-xanim) _xanim=no ;;
929 --enable-real) _real=yes ;;
930 --disable-real) _real=no ;;
931 --enable-live) _live=yes ;;
932 --disable-live) _live=no ;;
933 --enable-xinerama) _xinerama=yes ;;
934 --disable-xinerama) _xinerama=no ;;
935 --enable-mga) _mga=yes ;;
936 --disable-mga) _mga=no ;;
937 --enable-xmga) _xmga=yes ;;
938 --disable-xmga) _xmga=no ;;
939 --enable-vm) _vm=yes ;;
940 --disable-vm) _vm=no ;;
941 --enable-xf86keysym) _xf86keysym=yes ;;
942 --disable-xf86keysym) _xf86keysym=no ;;
943 --enable-mlib) _mlib=yes ;;
944 --disable-mlib) _mlib=no ;;
945 --enable-sunaudio) _sunaudio=yes ;;
946 --disable-sunaudio) _sunaudio=no ;;
947 --enable-sgiaudio) _sgiaudio=yes ;;
948 --disable-sgiaudio) _sgiaudio=no ;;
949 --enable-alsa) _alsa=yes ;;
950 --disable-alsa) _alsa=no ;;
951 --enable-tv) _tv=yes ;;
952 --disable-tv) _tv=no ;;
953 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
954 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
955 --enable-tv-v4l1) _tv_v4l1=yes ;;
956 --disable-tv-v4l1) _tv_v4l1=no ;;
957 --enable-tv-v4l2) _tv_v4l2=yes ;;
958 --disable-tv-v4l2) _tv_v4l2=no ;;
959 --enable-tv-teletext) _tv_teletext=yes ;;
960 --disable-tv-teletext) _tv_teletext=no ;;
961 --enable-radio) _radio=yes ;;
962 --enable-radio-capture) _radio_capture=yes ;;
963 --disable-radio-capture) _radio_capture=no ;;
964 --disable-radio) _radio=no ;;
965 --enable-radio-v4l) _radio_v4l=yes ;;
966 --disable-radio-v4l) _radio_v4l=no ;;
967 --enable-radio-v4l2) _radio_v4l2=yes ;;
968 --disable-radio-v4l2) _radio_v4l2=no ;;
969 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
970 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
971 --enable-pvr) _pvr=yes ;;
972 --disable-pvr) _pvr=no ;;
973 --enable-fastmemcpy) _fastmemcpy=yes ;;
974 --disable-fastmemcpy) _fastmemcpy=no ;;
975 --enable-network) _network=yes ;;
976 --disable-network) _network=no ;;
977 --enable-winsock2) _winsock2=yes ;;
978 --disable-winsock2) _winsock2=no ;;
979 --enable-smb) _smbsupport=yes ;;
980 --disable-smb) _smbsupport=no ;;
981 --enable-vidix-internal) _vidix_internal=yes ;;
982 --disable-vidix-internal) _vidix_internal=no ;;
983 --enable-vidix-external) _vidix_external=yes ;;
984 --disable-vidix-external) _vidix_external=no ;;
985 --with-vidix-drivers=*)
986 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
988 --enable-joystick) _joystick=yes ;;
989 --disable-joystick) _joystick=no ;;
990 --enable-xvid) _xvid=yes ;;
991 --disable-xvid) _xvid=no ;;
992 --enable-x264) _x264=yes ;;
993 --disable-x264) _x264=no ;;
994 --enable-libnut) _libnut=yes ;;
995 --disable-libnut) _libnut=no ;;
996 --enable-libavutil_a) _libavutil_a=yes ;;
997 --disable-libavutil_a) _libavutil_a=no ;;
998 --enable-libavutil_so) _libavutil_so=yes ;;
999 --disable-libavutil_so) _libavutil_so=no ;;
1000 --enable-libavcodec_a) _libavcodec_a=yes ;;
1001 --disable-libavcodec_a) _libavcodec_a=no ;;
1002 --enable-libavcodec_so) _libavcodec_so=yes ;;
1003 --disable-libavcodec_so) _libavcodec_so=no ;;
1004 --enable-libamr_nb) _libamr_nb=yes ;;
1005 --disable-libamr_nb) _libamr_nb=no ;;
1006 --enable-libamr_wb) _libamr_wb=yes ;;
1007 --disable-libamr_wb) _libamr_wb=no ;;
1008 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1009 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1010 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1011 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1012 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1013 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1014 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1015 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1016 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1017 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1018 --enable-libavformat_a) _libavformat_a=yes ;;
1019 --disable-libavformat_a) _libavformat_a=no ;;
1020 --enable-libavformat_so) _libavformat_so=yes ;;
1021 --disable-libavformat_so) _libavformat_so=no ;;
1022 --enable-libpostproc_a) _libpostproc_a=yes ;;
1023 --disable-libpostproc_a) _libpostproc_a=no ;;
1024 --enable-libpostproc_so) _libpostproc_so=yes ;;
1025 --disable-libpostproc_so) _libpostproc_so=no ;;
1026 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1027 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1029 --enable-lirc) _lirc=yes ;;
1030 --disable-lirc) _lirc=no ;;
1031 --enable-lircc) _lircc=yes ;;
1032 --disable-lircc) _lircc=no ;;
1033 --enable-gui) _gui=yes ;;
1034 --disable-gui) _gui=no ;;
1035 --enable-gtk1) _gtk1=yes ;;
1036 --disable-gtk1) _gtk1=no ;;
1037 --enable-termcap) _termcap=yes ;;
1038 --disable-termcap) _termcap=no ;;
1039 --enable-termios) _termios=yes ;;
1040 --disable-termios) _termios=no ;;
1041 --enable-3dfx) _3dfx=yes ;;
1042 --disable-3dfx) _3dfx=no ;;
1043 --enable-s3fb) _s3fb=yes ;;
1044 --disable-s3fb) _s3fb=no ;;
1045 --enable-tdfxfb) _tdfxfb=yes ;;
1046 --disable-tdfxfb) _tdfxfb=no ;;
1047 --disable-tdfxvid) _tdfxvid=no ;;
1048 --enable-tdfxvid) _tdfxvid=yes ;;
1049 --disable-xvr100) _xvr100=no ;;
1050 --enable-xvr100) _xvr100=yes ;;
1051 --disable-tga) _tga=no ;;
1052 --enable-tga) _tga=yes ;;
1053 --enable-directfb) _directfb=yes ;;
1054 --disable-directfb) _directfb=no ;;
1055 --enable-zr) _zr=yes ;;
1056 --disable-zr) _zr=no ;;
1057 --enable-bl) _bl=yes ;;
1058 --disable-bl) _bl=no ;;
1059 --enable-mtrr) _mtrr=yes ;;
1060 --disable-mtrr) _mtrr=no ;;
1061 --enable-largefiles) _largefiles=yes ;;
1062 --disable-largefiles) _largefiles=no ;;
1063 --enable-shm) _shm=yes ;;
1064 --disable-shm) _shm=no ;;
1065 --enable-select) _select=yes ;;
1066 --disable-select) _select=no ;;
1067 --enable-linux-devfs) _linux_devfs=yes ;;
1068 --disable-linux-devfs) _linux_devfs=no ;;
1069 --enable-cdparanoia) _cdparanoia=yes ;;
1070 --disable-cdparanoia) _cdparanoia=no ;;
1071 --enable-cddb) _cddb=yes ;;
1072 --disable-cddb) _cddb=no ;;
1073 --enable-big-endian) _big_endian=yes ;;
1074 --disable-big-endian) _big_endian=no ;;
1075 --enable-bitmap-font) _bitmap_font=yes ;;
1076 --disable-bitmap-font) _bitmap_font=no ;;
1077 --enable-freetype) _freetype=yes ;;
1078 --disable-freetype) _freetype=no ;;
1079 --enable-fontconfig) _fontconfig=yes ;;
1080 --disable-fontconfig) _fontconfig=no ;;
1081 --enable-unrarlib) _unrarlib=yes ;;
1082 --disable-unrarlib) _unrarlib=no ;;
1083 --enable-ftp) _ftp=yes ;;
1084 --disable-ftp) _ftp=no ;;
1085 --enable-vstream) _vstream=yes ;;
1086 --disable-vstream) _vstream=no ;;
1087 --enable-pthreads) _pthreads=yes ;;
1088 --disable-pthreads) _pthreads=no ;;
1089 --enable-w32threads) _w32threads=yes ;;
1090 --disable-w32threads) _w32threads=no ;;
1091 --enable-ass) _ass=yes ;;
1092 --disable-ass) _ass=no ;;
1093 --enable-rpath) _rpath=yes ;;
1094 --disable-rpath) _rpath=no ;;
1095 --enable-color-console) _color_console=yes ;;
1096 --disable-color-console) _color_console=no ;;
1098 --enable-fribidi) _fribidi=yes ;;
1099 --disable-fribidi) _fribidi=no ;;
1101 --enable-enca) _enca=yes ;;
1102 --disable-enca) _enca=no ;;
1104 --enable-inet6) _inet6=yes ;;
1105 --disable-inet6) _inet6=no ;;
1107 --enable-gethostbyname2) _gethostbyname2=yes ;;
1108 --disable-gethostbyname2) _gethostbyname2=no ;;
1110 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1111 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1112 --disable-dga) _dga=no ;;
1114 --enable-menu) _menu=yes ;;
1115 --disable-menu) _menu=no ;;
1117 --enable-qtx) _qtx=yes ;;
1118 --disable-qtx) _qtx=no ;;
1120 --enable-macosx) _macosx=yes ;;
1121 --disable-macosx) _macosx=no ;;
1122 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1123 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1124 --enable-macosx-bundle) _macosx_bundle=yes;;
1125 --disable-macosx-bundle) _macosx_bundle=no;;
1127 --enable-maemo) _maemo=yes ;;
1128 --disable-maemo) _maemo=no ;;
1130 --enable-sortsub) _sortsub=yes ;;
1131 --disable-sortsub) _sortsub=no ;;
1133 --enable-crash-debug) _crash_debug=yes ;;
1134 --disable-crash-debug) _crash_debug=no ;;
1135 --enable-sighandler) _sighandler=yes ;;
1136 --disable-sighandler) _sighandler=no ;;
1137 --enable-win32dll) _win32dll=yes ;;
1138 --disable-win32dll) _win32dll=no ;;
1140 --enable-sse) _sse=yes ;;
1141 --disable-sse) _sse=no ;;
1142 --enable-sse2) _sse2=yes ;;
1143 --disable-sse2) _sse2=no ;;
1144 --enable-ssse3) _ssse3=yes ;;
1145 --disable-ssse3) _ssse3=no ;;
1146 --enable-mmxext) _mmxext=yes ;;
1147 --disable-mmxext) _mmxext=no ;;
1148 --enable-3dnow) _3dnow=yes ;;
1149 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1150 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1151 --disable-3dnowext) _3dnowext=no ;;
1152 --enable-cmov) _cmov=yes ;;
1153 --disable-cmov) _cmov=no ;;
1154 --enable-fast-cmov) _fast_cmov=yes ;;
1155 --disable-fast-cmov) _fast_cmov=no ;;
1156 --enable-altivec) _altivec=yes ;;
1157 --disable-altivec) _altivec=no ;;
1158 --enable-armv5te) _armv5te=yes ;;
1159 --disable-armv5te) _armv5te=no ;;
1160 --enable-armv6) _armv6=yes ;;
1161 --disable-armv6) _armv6=no ;;
1162 --enable-iwmmxt) _iwmmxt=yes ;;
1163 --disable-iwmmxt) _iwmmxt=no ;;
1164 --enable-mmx) _mmx=yes ;;
1165 --disable-mmx) # 3Dnow! and MMX2 require MMX
1166 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1169 echo "Unknown parameter: $ac_option"
1170 exit 1
1173 esac
1174 done
1176 # Atmos: moved this here, to be correct, if --prefix is specified
1177 test -z "$_bindir" && _bindir="$_prefix/bin"
1178 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1179 test -z "$_mandir" && _mandir="$_prefix/man"
1180 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1181 test -z "$_libdir" && _libdir="$_prefix/lib"
1183 # Determine our OS name and CPU architecture
1184 if test -z "$_target" ; then
1185 # OS name
1186 system_name=`uname -s 2>&1`
1187 case "$system_name" in
1188 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX|AmigaOS)
1190 IRIX*)
1191 system_name=IRIX
1193 GNU/kFreeBSD)
1194 system_name=FreeBSD
1196 HP-UX*)
1197 system_name=HP-UX
1199 [cC][yY][gG][wW][iI][nN]*)
1200 system_name=CYGWIN
1202 MINGW32*)
1203 system_name=MINGW32
1206 system_name="$system_name-UNKNOWN"
1208 esac
1211 # host's CPU/instruction set
1212 host_arch=`uname -p 2>&1`
1213 case "$host_arch" in
1214 i386|sparc|ppc|alpha|arm|sh3|mips|vax)
1216 powerpc) # Darwin returns 'powerpc'
1217 host_arch=ppc
1219 *) # uname -p on Linux returns 'unknown' for the processor type,
1220 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1222 # Maybe uname -m (machine hardware name) returns something we
1223 # recognize.
1225 # x86/x86pc is used by QNX
1226 case "`uname -m 2>&1`" in
1227 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 ;;
1228 ia64) host_arch=ia64 ;;
1229 x86_64|amd64)
1230 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1231 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1232 host_arch=x86_64
1233 else
1234 host_arch=i386
1237 macppc|ppc|ppc64) host_arch=ppc ;;
1238 alpha) host_arch=alpha ;;
1239 sparc) host_arch=sparc ;;
1240 sparc64) host_arch=sparc64 ;;
1241 parisc*|hppa*|9000*) host_arch=hppa ;;
1242 arm*|zaurus|cats) host_arch=arm ;;
1243 sh3) host_arch=sh3 ;;
1244 s390) host_arch=s390 ;;
1245 s390x) host_arch=s390x ;;
1246 mips*) host_arch=mips ;;
1247 vax) host_arch=vax ;;
1248 *) host_arch=UNKNOWN ;;
1249 esac
1251 esac
1252 else # if test -z "$_target"
1253 system_name=`echo $_target | cut -d '-' -f 2`
1254 case "`echo $system_name | tr A-Z a-z`" in
1255 linux) system_name=Linux ;;
1256 freebsd) system_name=FreeBSD ;;
1257 gnu/kfreebsd) system_name=FreeBSD ;;
1258 netbsd) system_name=NetBSD ;;
1259 bsd/os) system_name=BSD/OS ;;
1260 openbsd) system_name=OpenBSD ;;
1261 sunos) system_name=SunOS ;;
1262 qnx) system_name=QNX ;;
1263 morphos) system_name=MorphOS ;;
1264 amigaos) system_name=AmigaOS ;;
1265 mingw32msvc) system_name=MINGW32 ;;
1266 esac
1267 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1268 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
1271 echo "Detected operating system: $system_name"
1272 echo "Detected host architecture: $host_arch"
1274 if test "$_runtime_cpudetection" = yes && not x86 && not ppc; then
1275 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1278 # LGB: temporary files
1279 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1280 test "$I" && break
1281 done
1283 TMPLOG="configure.log"
1284 rm -f "$TMPLOG"
1285 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1286 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1287 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
1288 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1290 echo configuration: $_configuration > "$TMPLOG"
1291 echo >> "$TMPLOG"
1293 # config files
1295 # FIXME: A lot of stuff is installed under /usr/local
1296 # NK: But we should never use this stuff implicitly since we call compiler
1297 # from /usr we should be sure that there no effects from other compilers
1298 # (libraries) which might be installed into /usr/local. Let users use this
1299 # stuff explicitly as command line argument. In other words: It would be
1300 # resonable to have only /usr/include or only /usr/local/include.
1302 if openbsd ; then
1303 _ldconfig="ldconfig -R"
1306 if freebsd ; then
1307 _ld_extra="$_ld_extra -L/usr/local/lib"
1308 _inc_extra="$_inc_extra -I/usr/local/include"
1311 if darwin; then
1312 _ld_extra="$_ld_extra -L/usr/local/lib"
1313 _inc_extra="$_inc_extra -I/usr/local/include"
1316 if aix ; then
1317 _ld_extra="$_ld_extra -lC"
1320 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
1321 if irix ; then
1322 _ranlib='ar -r'
1323 elif linux ; then
1324 _ranlib='true'
1327 if win32 ; then
1328 _exesuf=".exe"
1329 # -lwinmm is always needed for osdep/timer-win2.c
1330 _ld_extra="$_ld_extra -lwinmm"
1331 _confwin32='TARGET_WIN32 = yes'
1332 else
1333 _confwin32='TARGET_WIN32 = no'
1336 if mingw32 ; then
1337 _need_shmem=no
1340 if cygwin ; then
1341 _def_confwin32='#define WIN32'
1344 if amigaos ; then
1345 _select=no
1346 _sighandler=no
1347 _stream_cache=no
1348 _def_stream_cache="#undef USE_STREAM_CACHE"
1351 if qnx ; then
1352 _ld_extra="$_ld_extra -lph"
1355 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1356 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1357 # know about '-n'.
1358 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1359 _head() { head -$1 2>/dev/null ; }
1360 else
1361 _head() { head -n $1 2>/dev/null ; }
1363 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1364 _tail() { tail -$1 2>/dev/null ; }
1365 else
1366 _tail() { tail -n $1 2>/dev/null ; }
1369 # Checking CC version...
1370 if test "$_gcc_check" = yes ; then
1371 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1372 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1373 echocheck "$_cc version"
1374 cc_vendor=intel
1375 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1376 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1377 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1378 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1379 # TODO verify older icc/ecc compatibility
1380 case $cc_version in
1382 cc_version="v. ?.??, bad"
1383 cc_verc_fail=yes
1385 8.0|9.1|10.0)
1386 cc_version="$cc_version, ok"
1387 cc_verc_fail=no
1390 cc_version="$cc_version, bad"
1391 cc_verc_fail=yes
1393 esac
1394 echores "$cc_version"
1395 else
1396 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
1397 echocheck "$_cc version"
1398 cc_vendor=gnu
1399 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1400 cc_version=`$_cc -dumpversion 2>&1`
1401 if test "$?" -gt 0; then
1402 cc_version="not found"
1404 case $cc_version in
1406 cc_version="v. ?.??, bad"
1407 cc_verc_fail=yes
1409 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1410 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1411 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1412 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1413 cc_version="$cc_version, ok"
1414 cc_verc_fail=no
1416 'not found')
1417 cc_verc_fail=yes
1420 cc_version="$cc_version, bad"
1421 cc_verc_fail=yes
1423 esac
1424 echores "$cc_version"
1425 test "$cc_verc_fail" = "no" && break
1426 done
1427 fi # icc
1428 if test "$cc_verc_fail" = yes ; then
1429 cat <<EOF
1431 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1433 You are not using a supported compiler. We do not have the time to make sure
1434 everything works with compilers other than the ones we use. Use either the
1435 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1436 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1438 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1439 mplayer and lame (which is used for mencoder). If you get compile errors,
1440 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1441 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1442 bugs!
1444 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1447 die "Bad gcc version"
1449 else
1450 cat <<EOF
1452 ******************************************************************************
1454 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1455 Ok. You know. Do it.
1457 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1458 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1459 Lame which is used by mencoder produces weird errors, too.
1461 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1462 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1464 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1466 ******************************************************************************
1470 read _answer
1473 echocheck "host cc"
1474 test "$_host_cc" || _host_cc=$_cc
1475 echores $_host_cc
1477 echocheck "cross compilation"
1478 if test $_cross_compile = auto ; then
1479 cat > $TMPC << EOF
1480 int main() { return 0; }
1482 _cross_compile=yes
1483 cc_check && "$TMPO" && _cross_compile=no
1485 echores $_cross_compile
1487 if test $_cross_compile = yes; then
1488 tmp_run() {
1489 return 0
1493 # ---
1495 # now that we know what compiler should be used for compilation, try to find
1496 # out which assembler is used by the $_cc compiler
1497 if test "$_as" = auto ; then
1498 _as=`$_cc -print-prog-name=as`
1499 test -z "$_as" && _as=as
1502 # XXX: this should be ok..
1503 _cpuinfo="echo"
1505 if test "$_runtime_cpudetection" = no ; then
1507 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1508 # FIXME: Remove the cygwin check once AMD CPUs are supported
1509 if test -r /proc/cpuinfo && not cygwin; then
1510 # Linux with /proc mounted, extract CPU information from it
1511 _cpuinfo="cat /proc/cpuinfo"
1512 elif test -r /compat/linux/proc/cpuinfo && not x86_32 ; then
1513 # FreeBSD with Linux emulation /proc mounted,
1514 # extract CPU information from it
1515 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1516 elif darwin && not x86_32 ; then
1517 # use hostinfo on Darwin
1518 _cpuinfo="hostinfo"
1519 elif aix; then
1520 # use 'lsattr' on AIX
1521 _cpuinfo="lsattr -E -l proc0 -a type"
1522 elif x86; then
1523 # all other OSes try to extract CPU information from a small helper
1524 # program cpuinfo instead
1525 $_cc -o cpuinfo$_exesuf cpuinfo.c
1526 _cpuinfo="./cpuinfo$_exesuf"
1529 if x86 ; then
1530 # gather more CPU information
1531 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1532 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1533 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1534 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1535 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1537 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1539 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1540 -e s/xmm/sse/ -e s/kni/sse/`
1542 for ext in $pparam ; do
1543 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1544 done
1546 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1547 test $_sse = kernel_check && _mmxext=kernel_check
1549 echocheck "CPU vendor"
1550 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1552 echocheck "CPU type"
1553 echores "$pname"
1556 fi # test "$_runtime_cpudetection" = no
1558 if x86 && test "$_runtime_cpudetection" = no ; then
1559 extcheck() {
1560 if test "$1" = kernel_check ; then
1561 echocheck "kernel support of $2"
1562 cat > $TMPC <<EOF
1563 #include <signal.h>
1564 void catch() { exit(1); }
1565 int main(void){
1566 signal(SIGILL, catch);
1567 __asm__ __volatile__ ("$3":::"memory");return(0);
1571 if cc_check && tmp_run ; then
1572 eval _$2=yes
1573 echores "yes"
1574 _optimizing="$_optimizing $2"
1575 return 0
1576 else
1577 eval _$2=no
1578 echores "failed"
1579 echo "It seems that your kernel does not correctly support $2."
1580 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1581 return 1
1584 return 0
1587 extcheck $_mmx "mmx" "emms"
1588 extcheck $_mmxext "mmxext" "sfence"
1589 extcheck $_3dnow "3dnow" "femms"
1590 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1591 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1592 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1593 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1594 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1596 echocheck "mtrr support"
1597 if test "$_mtrr" = kernel_check ; then
1598 _mtrr="yes"
1599 _optimizing="$_optimizing mtrr"
1601 echores "$_mtrr"
1603 if test "$_gcc3_ext" != ""; then
1604 # if we had to disable sse/sse2 because the active kernel does not
1605 # support this instruction set extension, we also have to tell
1606 # gcc3 to not generate sse/sse2 instructions for normal C code
1607 cat > $TMPC << EOF
1608 int main(void) { return 0; }
1610 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1616 _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM ARMV4L SH3 POWERPC PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX GENERIC'
1617 case "$host_arch" in
1618 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1619 _arch='X86 X86_32'
1620 _target_arch_x86="ARCH_X86 = yes"
1621 _target_arch="ARCH_X86_32 = yes"
1622 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1623 iproc=486
1624 proc=i486
1627 if test "$_runtime_cpudetection" = no ; then
1628 case "$pvendor" in
1629 AuthenticAMD)
1630 case "$pfamily" in
1631 3) proc=i386 iproc=386 ;;
1632 4) proc=i486 iproc=486 ;;
1633 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1634 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1635 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1636 proc=k6-3
1637 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1638 proc=geode
1639 elif test "$pmodel" -ge 8; then
1640 proc=k6-2
1641 elif test "$pmodel" -ge 6; then
1642 proc=k6
1643 else
1644 proc=i586
1647 6) iproc=686
1648 # It's a bit difficult to determine the correct type of Family 6
1649 # AMD CPUs just from their signature. Instead, we check directly
1650 # whether it supports SSE.
1651 if test "$_sse" = yes; then
1652 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1653 proc=athlon-xp
1654 else
1655 # Again, gcc treats athlon and athlon-tbird similarly.
1656 proc=athlon
1659 15) iproc=686
1660 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1661 # caught and remedied in the optimization tests below.
1662 proc=k8
1665 *) proc=k8 iproc=686 ;;
1666 esac
1668 GenuineIntel)
1669 case "$pfamily" in
1670 3) proc=i386 iproc=386 ;;
1671 4) proc=i486 iproc=486 ;;
1672 5) iproc=586
1673 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1674 proc=pentium-mmx # 4 is desktop, 8 is mobile
1675 else
1676 proc=i586
1679 6) iproc=686
1680 if test "$pmodel" -ge 15; then
1681 proc=core2
1682 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1683 proc=pentium-m
1684 elif test "$pmodel" -ge 7; then
1685 proc=pentium3
1686 elif test "$pmodel" -ge 3; then
1687 proc=pentium2
1688 else
1689 proc=i686
1692 15) iproc=686
1693 # A nocona in 32-bit mode has no more capabilities than a prescott.
1694 if test "$pmodel" -ge 3; then
1695 proc=prescott
1696 else
1697 proc=pentium4
1700 *) proc=prescott iproc=686 ;;
1701 esac
1703 CentaurHauls)
1704 case "$pfamily" in
1705 5) iproc=586
1706 if test "$pmodel" -ge 8; then
1707 proc=winchip2
1708 elif test "$pmodel" -ge 4; then
1709 proc=winchip-c6
1710 else
1711 proc=i586
1714 6) iproc=686
1715 if test "$pmodel" -ge 9; then
1716 proc=c3-2
1717 else
1718 proc=c3
1719 iproc=586
1722 *) proc=i686 iproc=i686 ;;
1723 esac
1725 unknown)
1726 case "$pfamily" in
1727 3) proc=i386 iproc=386 ;;
1728 4) proc=i486 iproc=486 ;;
1729 *) proc=i586 iproc=586 ;;
1730 esac
1733 proc=i586 iproc=586 ;;
1734 esac
1735 fi # test "$_runtime_cpudetection" = no
1738 # check that gcc supports our CPU, if not, fall back to earlier ones
1739 # LGB: check -mcpu and -march swithing step by step with enabling
1740 # to fall back till 386.
1742 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1744 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1745 cpuopt=-mtune
1746 else
1747 cpuopt=-mcpu
1750 echocheck "GCC & CPU optimization abilities"
1751 cat > $TMPC << EOF
1752 int main(void) { return 0; }
1754 if test "$_runtime_cpudetection" = no ; then
1755 if test "$proc" = "k8"; then
1756 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1758 if test "$proc" = "athlon-xp"; then
1759 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1761 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1762 cc_check -march=$proc $cpuopt=$proc || proc=k6
1764 if test "$proc" = "k6" || test "$proc" = "c3"; then
1765 if not cc_check -march=$proc $cpuopt=$proc; then
1766 if cc_check -march=i586 $cpuopt=i686; then
1767 proc=i586-i686
1768 else
1769 proc=i586
1773 if test "$proc" = "prescott" ; then
1774 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1776 if test "$proc" = "core2" ; then
1777 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1779 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
1780 cc_check -march=$proc $cpuopt=$proc || proc=i686
1782 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1783 cc_check -march=$proc $cpuopt=$proc || proc=i586
1785 if test "$proc" = "i586"; then
1786 cc_check -march=$proc $cpuopt=$proc || proc=i486
1788 if test "$proc" = "i486" ; then
1789 cc_check -march=$proc $cpuopt=$proc || proc=i386
1791 if test "$proc" = "i386" ; then
1792 cc_check -march=$proc $cpuopt=$proc || proc=error
1794 if test "$proc" = "error" ; then
1795 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1796 _mcpu=""
1797 _march=""
1798 _optimizing=""
1799 elif test "$proc" = "i586-i686"; then
1800 _march="-march=i586"
1801 _mcpu="$cpuopt=i686"
1802 _optimizing="$proc"
1803 else
1804 _march="-march=$proc"
1805 _mcpu="$cpuopt=$proc"
1806 _optimizing="$proc"
1808 else # if test "$_runtime_cpudetection" = no
1809 _mcpu="$cpuopt=generic"
1810 # at least i486 required, for bswap instruction
1811 _march="-march=i486"
1812 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1813 cc_check $_mcpu || _mcpu=""
1814 cc_check $_march $_mcpu || _march=""
1817 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1818 ## autodetected mcpu/march parameters
1819 if test "$_target" ; then
1820 # TODO: it may be a good idea to check GCC and fall back in all cases
1821 if test "$host_arch" = "i586-i686"; then
1822 _march="-march=i586"
1823 _mcpu="$cpuopt=i686"
1824 else
1825 _march="-march=$host_arch"
1826 _mcpu="$cpuopt=$host_arch"
1829 proc="$host_arch"
1831 case "$proc" in
1832 i386) iproc=386 ;;
1833 i486) iproc=486 ;;
1834 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1835 i686|athlon*|pentium*) iproc=686 ;;
1836 *) iproc=586 ;;
1837 esac
1840 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1841 _fast_cmov="yes"
1842 case "$proc" in
1843 pentium4|prescott|nocona)
1844 _fast_cmov="no"
1845 esac
1846 else
1847 _fast_cmov="no"
1850 echores "$proc"
1853 ia64)
1854 _arch='IA64'
1855 _target_arch='ARCH_IA64 = yes'
1856 iproc='ia64'
1857 proc=''
1858 _march=''
1859 _mcpu=''
1860 _optimizing=''
1863 x86_64|amd64)
1864 _arch='X86 X86_64'
1865 _target_arch='ARCH_X86_64 = yes'
1866 _target_arch_x86="ARCH_X86 = yes"
1867 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1868 iproc='x86_64'
1870 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1871 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1872 cpuopt=-mtune
1873 else
1874 cpuopt=-mcpu
1876 if test "$_runtime_cpudetection" = no ; then
1877 case "$pvendor" in
1878 AuthenticAMD)
1879 proc=k8;;
1880 GenuineIntel)
1881 case "$pfamily" in
1882 6) proc=core2;;
1884 # 64-bit prescotts exist, but as far as GCC is concerned they
1885 # have the same capabilities as a nocona.
1886 proc=nocona;;
1887 esac
1890 proc=error;;
1891 esac
1892 fi # test "$_runtime_cpudetection" = no
1894 echocheck "GCC & CPU optimization abilities"
1895 cat > $TMPC << EOF
1896 int main(void) { return 0; }
1898 # This is a stripped-down version of the i386 fallback.
1899 if test "$_runtime_cpudetection" = no ; then
1900 # --- AMD processors ---
1901 if test "$proc" = "k8"; then
1902 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1904 # This will fail if gcc version < 3.3, which is ok because earlier
1905 # versions don't really support 64-bit on amd64.
1906 # Is this a valid assumption? -Corey
1907 if test "$proc" = "athlon-xp"; then
1908 cc_check -march=$proc $cpuopt=$proc || proc=error
1910 # --- Intel processors ---
1911 if test "$proc" = "core2"; then
1912 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1914 if test "$proc" = "nocona"; then
1915 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1917 if test "$proc" = "pentium4"; then
1918 cc_check -march=$proc $cpuopt=$proc || proc=error
1921 _march="-march=$proc"
1922 _mcpu="$cpuopt=$proc"
1923 if test "$proc" = "error" ; then
1924 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1925 _mcpu=""
1926 _march=""
1928 else # if test "$_runtime_cpudetection" = no
1929 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1930 _march="-march=x86-64"
1931 _mcpu="$cpuopt=generic"
1932 cc_check $_mcpu || _mcpu="x86-64"
1933 cc_check $_mcpu || _mcpu=""
1934 cc_check $_march $_mcpu || _march=""
1937 _optimizing=""
1939 echores "$proc"
1942 sparc)
1943 _arch='SPARC'
1944 _target_arch='ARCH_SPARC = yes'
1945 iproc='sparc'
1946 if sunos ; then
1947 echocheck "CPU type"
1948 karch=`uname -m`
1949 case "`echo $karch`" in
1950 sun4) proc=v7 ;;
1951 sun4c) proc=v7 ;;
1952 sun4d) proc=v8 ;;
1953 sun4m) proc=v8 ;;
1954 sun4u) proc=ultrasparc _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1955 sun4v) proc=v9 ;;
1956 *) proc=v8 ;;
1957 esac
1958 echores "$proc"
1959 else
1960 proc=v8
1962 _march=''
1963 _mcpu="-mcpu=$proc"
1964 _optimizing="$proc"
1967 sparc64)
1968 _arch='SPARC'
1969 _target_arch='ARCH_SPARC = yes'
1970 _vis='yes'
1971 _def_vis='#define HAVE_VIS = yes'
1972 iproc='sparc'
1973 proc='v9'
1974 _march=''
1975 _mcpu="-mcpu=$proc"
1976 _optimizing="$proc"
1979 arm|armv4l|armv5tel)
1980 _arch='ARM ARMV4L'
1981 _target_arch='ARCH_ARMV4L = yes'
1982 iproc='arm'
1983 proc=''
1984 _march=''
1985 _mcpu=''
1986 _optimizing=''
1989 sh3)
1990 _arch='SH3'
1991 _target_arch='ARCH_SH3 = yes'
1992 iproc='sh3'
1993 proc=''
1994 _march='-m3'
1995 _mcpu='-ml'
1996 _optimizing=''
1999 ppc|powerpc)
2000 _arch='POWERPC PPC'
2001 _def_dcbzl='#define NO_DCBZL 1'
2002 _target_arch='ARCH_POWERPC = yes'
2003 iproc='ppc'
2004 proc=''
2005 _march=''
2006 _mcpu=''
2007 _optimizing=''
2008 _altivec=no
2010 echocheck "CPU type"
2011 case $system_name in
2012 Linux)
2013 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2014 if test -n "`$_cpuinfo | grep altivec`"; then
2015 _altivec=yes
2018 Darwin)
2019 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2020 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2021 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2022 _altivec=yes
2025 NetBSD)
2026 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2027 case $cc_version in
2028 2*|3.0*|3.1*|3.2*|3.3*)
2031 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2032 _altivec=yes
2035 esac
2037 AIX)
2038 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2040 esac
2041 if test "$_altivec" = yes; then
2042 echores "$proc altivec"
2043 else
2044 echores "$proc"
2047 echocheck "GCC & CPU optimization abilities"
2049 if test -n "$proc"; then
2050 case "$proc" in
2051 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2052 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2053 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2054 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2055 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2056 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2057 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2058 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2059 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2060 *) ;;
2061 esac
2062 # gcc 3.1(.1) and up supports 7400 and 7450
2063 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2064 case "$proc" in
2065 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2066 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2067 *) ;;
2068 esac
2070 # gcc 3.2 and up supports 970
2071 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2072 case "$proc" in
2073 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2074 _def_dcbzl='#undef NO_DCBZL' ;;
2075 *) ;;
2076 esac
2078 # gcc 3.3 and up supports POWER4
2079 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2080 case "$proc" in
2081 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2082 *) ;;
2083 esac
2085 # gcc 3.4 and up supports 440*
2086 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2087 case "$proc" in
2088 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2089 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2090 *) ;;
2091 esac
2093 # gcc 4.0 and up supports POWER5
2094 if test "$_cc_major" -ge "4"; then
2095 case "$proc" in
2096 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2097 *) ;;
2098 esac
2102 if test -n "$_mcpu"; then
2103 _optimizing=`echo $_mcpu | cut -c 8-`
2104 echores "$_optimizing"
2105 else
2106 echores "none"
2111 alpha)
2112 _arch='ALPHA'
2113 _target_arch='ARCH_ALPHA = yes'
2114 iproc='alpha'
2115 _march=''
2117 echocheck "CPU type"
2118 cat > $TMPC << EOF
2119 int main() {
2120 unsigned long ver, mask;
2121 asm ("implver %0" : "=r" (ver));
2122 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2123 printf("%ld-%x\n", ver, ~mask);
2124 return 0;
2127 $_cc -o "$TMPO" "$TMPC"
2128 case `"$TMPO"` in
2130 0-0) proc="ev4"; cpu_understands_mvi="0";;
2131 1-0) proc="ev5"; cpu_understands_mvi="0";;
2132 1-1) proc="ev56"; cpu_understands_mvi="0";;
2133 1-101) proc="pca56"; cpu_understands_mvi="1";;
2134 2-303) proc="ev6"; cpu_understands_mvi="1";;
2135 2-307) proc="ev67"; cpu_understands_mvi="1";;
2136 2-1307) proc="ev68"; cpu_understands_mvi="1";;
2137 esac
2138 echores "$proc"
2140 echocheck "GCC & CPU optimization abilities"
2141 if test "$proc" = "ev68" ; then
2142 cc_check -mcpu=$proc || proc=ev67
2144 if test "$proc" = "ev67" ; then
2145 cc_check -mcpu=$proc || proc=ev6
2147 _mcpu="-mcpu=$proc"
2148 echores "$proc"
2150 _optimizing="$proc"
2152 echocheck "MVI instruction support in GCC"
2153 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
2154 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2155 echores "yes"
2156 else
2157 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2158 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2162 mips)
2163 _arch='SGI_MIPS'
2164 _target_arch='ARCH_SGI_MIPS = yes'
2165 iproc='sgi-mips'
2166 proc=''
2167 _march=''
2168 _mcpu=''
2169 _optimizing=''
2171 if irix ; then
2172 echocheck "CPU type"
2173 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2174 case "`echo $proc`" in
2175 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2176 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2177 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2178 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2179 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2180 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2181 esac
2182 # gcc < 3.x does not support -mtune.
2183 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2184 _mcpu=''
2186 echores "$proc"
2191 hppa)
2192 _arch='PA_RISC'
2193 _target_arch='ARCH_PA_RISC = yes'
2194 iproc='PA-RISC'
2195 proc=''
2196 _march=''
2197 _mcpu=''
2198 _optimizing=''
2201 s390)
2202 _arch='S390'
2203 _target_arch='ARCH_S390 = yes'
2204 iproc='390'
2205 proc=''
2206 _march=''
2207 _mcpu=''
2208 _optimizing=''
2211 s390x)
2212 _arch='S390X'
2213 _target_arch='ARCH_S390X = yes'
2214 iproc='390x'
2215 proc=''
2216 _march=''
2217 _mcpu=''
2218 _optimizing=''
2221 vax)
2222 _arch='VAX'
2223 _target_arch='ARCH_VAX = yes'
2224 iproc='vax'
2225 proc=''
2226 _march=''
2227 _mcpu=''
2228 _optimizing=''
2231 generic)
2232 _arch='GENERIC'
2233 _target_arch='ARCH_GENERIC = yes'
2234 iproc=''
2235 proc=''
2236 _march=''
2237 _mcpu=''
2238 _optimizing=''
2242 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2243 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2244 die "unsupported architecture $host_arch"
2246 esac # case "$host_arch" in
2248 if test "$_runtime_cpudetection" = yes ; then
2249 if x86 ; then
2250 test "$_cmov" != no && _cmov=yes
2251 x86_32 && _cmov=no
2252 test "$_mmx" != no && _mmx=yes
2253 test "$_3dnow" != no && _3dnow=yes
2254 test "$_3dnowext" != no && _3dnowext=yes
2255 test "$_mmxext" != no && _mmxext=yes
2256 test "$_sse" != no && _sse=yes
2257 test "$_sse2" != no && _sse2=yes
2258 test "$_ssse3" != no && _ssse3=yes
2259 test "$_mtrr" != no && _mtrr=yes
2261 if ppc; then
2262 _altivec=yes
2268 echocheck "assembler support of -pipe option"
2269 cat > $TMPC << EOF
2270 int main(void) { return 0; }
2272 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2275 echocheck "compiler support of named assembler arguments"
2276 _named_asm_args=yes
2277 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2278 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2279 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2280 _named_asm_args=no
2281 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2283 echores $_named_asm_args
2286 # Checking for CFLAGS
2287 _install_strip="-s"
2288 if test "$_profile" != "" || test "$_debug" != "" ; then
2289 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2290 _install_strip=
2291 elif test -z "$CFLAGS" ; then
2292 if test "$cc_vendor" = "intel" ; then
2293 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167"
2294 elif test "$cc_vendor" != "gnu" ; then
2295 CFLAGS="-O2 $_march $_mcpu $_pipe"
2296 else
2297 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2299 else
2300 _warn_CFLAGS=yes
2302 if test -n "$LDFLAGS" ; then
2303 _ld_extra="$_ld_extra $LDFLAGS"
2304 _warn_CFLAGS=yes
2305 elif test "$cc_vendor" = "intel" ; then
2306 _ld_extra="$_ld_extra -i-static"
2308 if test -n "$CPPFLAGS" ; then
2309 _inc_extra="$_inc_extra $CPPFLAGS"
2310 _warn_CFLAGS=yes
2315 if x86_32 ; then
2316 # Checking assembler (_as) compatibility...
2317 # Added workaround for older as that reads from stdin by default - atmos
2318 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2319 echocheck "assembler ($_as $as_version)"
2321 _pref_as_version='2.9.1'
2322 echo 'nop' > $TMPS
2323 if test "$_mmx" = yes ; then
2324 echo 'emms' >> $TMPS
2326 if test "$_3dnow" = yes ; then
2327 _pref_as_version='2.10.1'
2328 echo 'femms' >> $TMPS
2330 if test "$_3dnowext" = yes ; then
2331 _pref_as_version='2.10.1'
2332 echo 'pswapd %mm0, %mm0' >> $TMPS
2334 if test "$_mmxext" = yes ; then
2335 _pref_as_version='2.10.1'
2336 echo 'movntq %mm0, (%eax)' >> $TMPS
2338 if test "$_sse" = yes ; then
2339 _pref_as_version='2.10.1'
2340 echo 'xorps %xmm0, %xmm0' >> $TMPS
2342 #if test "$_sse2" = yes ; then
2343 # _pref_as_version='2.11'
2344 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2346 if test "$_cmov" = yes ; then
2347 _pref_as_version='2.10.1'
2348 echo 'cmovb %eax, %ebx' >> $TMPS
2350 if test "$_ssse3" = yes ; then
2351 _pref_as_version='2.16.92'
2352 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2354 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2356 if test "$as_verc_fail" != yes ; then
2357 echores "ok"
2358 else
2359 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2360 echores "failed"
2361 die "obsolete binutils version"
2364 fi #if x86_32
2366 echocheck ".align is a power of two"
2367 if test "$_asmalign_pot" = auto ; then
2368 _asmalign_pot=no
2369 cat > $TMPC << EOF
2370 main() { asm (".align 3"); }
2372 cc_check && _asmalign_pot=yes
2374 if test "$_asmalign_pot" = "yes" ; then
2375 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2376 else
2377 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2379 echores $_asmalign_pot
2382 #FIXME: This should happen before the check for CFLAGS..
2383 if ppc ; then
2385 # check if altivec is supported by the compiler, and how to enable it
2387 _altivec_gcc_flags=''
2389 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2390 echocheck "GCC altivec support"
2392 p=''
2393 cat > $TMPC << EOF
2394 int main() {
2395 return 0;
2398 FSF_flags='-maltivec -mabi=altivec'
2399 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2401 # check for Darwin-style flags first, since
2402 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2403 # accepts but ignores FSF-style flags...
2405 if test -z "$p"; then
2406 cc_check $Darwin_flags && p='Darwin'
2408 if test -z "$p"; then
2409 cc_check $FSF_flags && p='FSF'
2412 case $p in
2413 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2414 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2415 *) _altivec=no ;;
2416 esac
2418 if test -z "$p"; then
2419 p=none
2420 else
2421 p="$p-style ($_altivec_gcc_flags)"
2424 echores "$p"
2427 # check if <altivec.h> should be included
2429 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2431 if test "$_altivec" = yes ; then
2432 echocheck "altivec.h"
2433 cat > $TMPC << EOF
2434 #include <altivec.h>
2435 int main(void) { return 0; }
2437 _have_altivec_h=no
2438 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2439 if test "$_have_altivec_h" = yes ; then
2440 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2442 echores "$_have_altivec_h"
2445 # disable runtime cpudetection if
2446 # - we cannot generate altivec code
2447 # - altivec is disabled by the user
2449 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2450 _runtime_cpudetection=no
2453 # show that we are optimizing for altivec (if enabled and supported)
2455 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2456 _optimizing="$_optimizing altivec"
2459 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2461 if test "$_altivec" = yes ; then
2462 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2463 #_mcpu="$_mcpu $_altivec_gcc_flags"
2464 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2467 # setup _def_altivec correctly
2469 if test "$_altivec" = yes ; then
2470 _def_altivec='#define HAVE_ALTIVEC 1'
2471 else
2472 _def_altivec='#undef HAVE_ALTIVEC'
2476 if arm ; then
2477 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2478 if test $_armv5te = "auto" ; then
2479 cat > $TMPC << EOF
2480 int main(void) {
2481 __asm__ __volatile__ ("qadd r0, r0, r0");
2484 _armv5te=no
2485 cc_check && _armv5te=yes
2487 echores "$_armv5te"
2489 echocheck "ARMv6 (SIMD instructions)"
2490 if test $_armv6 = "auto" ; then
2491 cat > $TMPC << EOF
2492 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2494 _armv6=no
2495 cc_check && _armv6=yes
2497 echores "$_armv6"
2499 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2500 if test $_iwmmxt = "auto" ; then
2501 cat > $TMPC << EOF
2502 int main(void) {
2503 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2506 _iwmmxt=no
2507 cc_check && _iwmmxt=yes
2509 echores "$_iwmmxt"
2512 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 BFIN'
2513 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2514 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2515 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2516 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2517 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2518 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2519 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2520 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2521 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2522 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2523 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2524 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2525 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2527 # Checking kernel version...
2528 if x86_32 && linux ; then
2529 _k_verc_problem=no
2530 kernel_version=`uname -r 2>&1`
2531 echocheck "$system_name kernel version"
2532 case "$kernel_version" in
2533 '') kernel_version="?.??"; _k_verc_fail=yes;;
2534 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2535 _k_verc_problem=yes;;
2536 esac
2537 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2538 _k_verc_fail=yes
2540 if test "$_k_verc_fail" ; then
2541 echores "$kernel_version, fail"
2542 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2543 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2544 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2545 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2546 echo "2.2.x you must upgrade it to get SSE support!"
2547 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2548 else
2549 echores "$kernel_version, ok"
2553 ######################
2554 # MAIN TESTS GO HERE #
2555 ######################
2558 echocheck "-lposix"
2559 cat > $TMPC <<EOF
2560 int main(void) { return 0; }
2562 if cc_check -lposix ; then
2563 _ld_extra="$_ld_extra -lposix"
2564 echores "yes"
2565 else
2566 echores "no"
2569 echocheck "-lm"
2570 cat > $TMPC <<EOF
2571 int main(void) { return 0; }
2573 if cc_check -lm ; then
2574 _ld_lm="-lm"
2575 echores "yes"
2576 else
2577 _ld_lm=""
2578 echores "no"
2582 echocheck "langinfo"
2583 if test "$_langinfo" = auto ; then
2584 cat > $TMPC <<EOF
2585 #include <langinfo.h>
2586 int main(void) { nl_langinfo(CODESET); return 0; }
2588 _langinfo=no
2589 cc_check && _langinfo=yes
2591 if test "$_langinfo" = yes ; then
2592 _def_langinfo='#define USE_LANGINFO 1'
2593 else
2594 _def_langinfo='#undef USE_LANGINFO'
2596 echores "$_langinfo"
2599 echocheck "language"
2600 test -z "$_language" && _language=$LINGUAS
2601 _language=`echo $_language | sed 's/,/ /g'`
2602 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2603 for lang in $_language ; do
2604 test "$lang" = all && lang=en
2605 if test -f "help/help_mp-${lang}.h" ; then
2606 _language=$lang
2607 break
2608 else
2609 echo ${_echo_n} "$lang not found, ${_echo_c}"
2610 _language=`echo $_language | sed "s/$lang *//"`
2612 done
2613 test -z "$_language" && _language=en
2614 _mp_help="help/help_mp-${_language}.h"
2615 test -f $_mp_help || die "$_mp_help not found"
2616 for lang in $LANGUAGES ; do
2617 if test -f "DOCS/man/$lang/mplayer.1" ; then
2618 MAN_LANG="$lang $MAN_LANG"
2620 done
2621 _doc_lang=$_language
2622 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2623 echores "using $_language (man pages: $MAN_LANG)"
2626 echocheck "enable sighandler"
2627 if test "$_sighandler" = yes ; then
2628 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2629 else
2630 _def_sighandler='#undef ENABLE_SIGHANDLER'
2632 echores "$_sighandler"
2634 echocheck "runtime cpudetection"
2635 if test "$_runtime_cpudetection" = yes ; then
2636 _optimizing="Runtime CPU-Detection enabled"
2637 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2638 else
2639 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2641 echores "$_runtime_cpudetection"
2644 echocheck "restrict keyword"
2645 for restrict_keyword in restrict __restrict __restrict__ ; do
2646 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2647 if cc_check; then
2648 _def_restrict_keyword=$restrict_keyword
2649 break;
2651 done
2652 if [ -n "$_def_restrict_keyword" ]; then
2653 echores "$_def_restrict_keyword"
2654 else
2655 echores "none"
2657 # Avoid infinite recursion loop ("#define restrict restrict")
2658 if [ "$_def_restrict_keyword" != "restrict" ]; then
2659 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2660 else
2661 _def_restrict_keyword=""
2665 echocheck "__builtin_expect"
2666 # GCC branch prediction hint
2667 cat > $TMPC << EOF
2668 int foo (int a) {
2669 a = __builtin_expect (a, 10);
2670 return a == 10 ? 0 : 1;
2672 int main() { return foo(10) && foo(0); }
2674 _builtin_expect=no
2675 cc_check && _builtin_expect=yes
2676 if test "$_builtin_expect" = yes ; then
2677 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2678 else
2679 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2681 echores "$_builtin_expect"
2684 echocheck "kstat"
2685 cat > $TMPC << EOF
2686 #include <kstat.h>
2687 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2689 _kstat=no
2690 cc_check -lkstat && _kstat=yes
2691 if test "$_kstat" = yes ; then
2692 _def_kstat="#define HAVE_LIBKSTAT 1"
2693 _ld_extra="$_ld_extra -lkstat"
2694 else
2695 _def_kstat="#undef HAVE_LIBKSTAT"
2697 echores "$_kstat"
2700 echocheck "posix4"
2701 # required for nanosleep on some systems
2702 cat > $TMPC << EOF
2703 #include <time.h>
2704 int main(void) { (void) nanosleep(0, 0); return 0; }
2706 _posix4=no
2707 cc_check -lposix4 && _posix4=yes
2708 if test "$_posix4" = yes ; then
2709 _ld_extra="$_ld_extra -lposix4"
2711 echores "$_posix4"
2713 echocheck "lrintf"
2714 cat > $TMPC << EOF
2715 #include <math.h>
2716 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2718 _lrintf=no
2719 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2720 if test "$_lrintf" = yes ; then
2721 _def_lrintf="#define HAVE_LRINTF 1"
2722 else
2723 _def_lrintf="#undef HAVE_LRINTF"
2725 echores "$_lrintf"
2728 echocheck "mkstemp"
2729 cat > $TMPC << EOF
2730 #include <stdlib.h>
2731 int main(void) { char a; mkstemp(&a); return 0; }
2733 _mkstemp=no
2734 cc_check && _mkstemp=yes
2735 if test "$_mkstemp" = yes ; then
2736 _def_mkstemp='#define HAVE_MKSTEMP 1'
2737 else
2738 _def_mkstemp='#undef HAVE_MKSTEMP'
2740 echores "$_mkstemp"
2743 echocheck "nanosleep"
2744 # also check for nanosleep
2745 cat > $TMPC << EOF
2746 #include <time.h>
2747 int main(void) { (void) nanosleep(0, 0); return 0; }
2749 _nanosleep=no
2750 cc_check && _nanosleep=yes
2751 if test "$_nanosleep" = yes ; then
2752 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2753 else
2754 _def_nanosleep='#undef HAVE_NANOSLEEP'
2756 echores "$_nanosleep"
2759 echocheck "socklib"
2760 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2761 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2762 cat > $TMPC << EOF
2763 #include <netdb.h>
2764 #include <sys/socket.h>
2765 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2767 _socklib=no
2768 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2769 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2770 done
2771 if test $_winsock2 = auto && not cygwin ; then
2772 _winsock2=no
2773 cat > $TMPC << EOF
2774 #include <winsock2.h>
2775 int main(void) { (void) gethostbyname(0); return 0; }
2777 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2779 test "$_ld_sock" && _res_comment="using $_ld_sock"
2780 echores "$_socklib"
2783 if test $_winsock2 = yes ; then
2784 _ld_sock="-lws2_32"
2785 _def_winsock2='#define HAVE_WINSOCK2 1'
2786 else
2787 _def_winsock2='#undef HAVE_WINSOCK2'
2791 _use_aton=no
2792 echocheck "inet_pton()"
2793 cat > $TMPC << EOF
2794 #include <sys/types.h>
2795 #include <sys/socket.h>
2796 #include <arpa/inet.h>
2797 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2799 if test "$_winsock2" = yes ; then
2800 _res_comment="using winsock2 functions instead"
2801 echores "no"
2802 elif cc_check $_ld_sock ; then
2803 # NOTE: Linux has libresolv but does not need it
2805 _res_comment="using $_ld_sock"
2806 echores "yes"
2807 elif cc_check $_ld_sock -lresolv ; then
2808 # NOTE: needed for SunOS at least
2809 _ld_sock="$_ld_sock -lresolv"
2810 _res_comment="using $_ld_sock"
2811 echores "yes"
2812 else
2813 _res_comment="trying inet_aton next"
2814 echores "no"
2816 echocheck "inet_aton()"
2817 cat > $TMPC << EOF
2818 #include <sys/types.h>
2819 #include <sys/socket.h>
2820 #include <arpa/inet.h>
2821 int main(void) { (void) inet_aton(0, 0); return 0; }
2823 _use_aton=yes
2824 if cc_check $_ld_sock ; then
2825 # NOTE: Linux has libresolv but does not need it
2827 _res_comment="using $_ld_sock"
2828 elif cc_check $_ld_sock -lresolv ; then
2829 # NOTE: needed for SunOS at least
2830 _ld_sock="$_ld_sock -lresolv"
2831 _res_comment="using $_ld_sock"
2832 else
2833 _use_aton=no
2834 _network=no
2835 _res_comment="network support disabled"
2837 echores "$_use_aton"
2840 _def_use_aton='#undef USE_ATON'
2841 if test "$_use_aton" = yes; then
2842 _def_use_aton='#define USE_ATON 1'
2845 echocheck "network"
2846 # FIXME network check
2847 if test "$_network" = yes ; then
2848 _def_network='#define MPLAYER_NETWORK 1'
2849 _ld_extra="$_ld_extra $_ld_sock"
2850 _inputmodules="network $_inputmodules"
2851 else
2852 _noinputmodules="network $_noinputmodules"
2853 _def_network='#undef MPLAYER_NETWORK'
2854 _ftp=no
2856 echores "$_network"
2858 echocheck "inttypes.h (required)"
2859 cat > $TMPC << EOF
2860 #include <inttypes.h>
2861 int main(void) { return 0; }
2863 _inttypes=no
2864 cc_check && _inttypes=yes
2865 echores "$_inttypes"
2867 if test "$_inttypes" = no ; then
2868 echocheck "bitypes.h (inttypes.h predecessor)"
2869 cat > $TMPC << EOF
2870 #include <sys/bitypes.h>
2871 int main(void) { return 0; }
2873 cc_check && _inttypes=yes
2874 if test "$_inttypes" = yes ; then
2875 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."
2876 else
2877 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2882 echocheck "int_fastXY_t in inttypes.h"
2883 cat > $TMPC << EOF
2884 #include <inttypes.h>
2885 int main(void) {
2886 volatile int_fast16_t v= 0;
2887 return v; }
2889 _fast_inttypes=no
2890 cc_check && _fast_inttypes=yes
2891 if test "$_fast_inttypes" = yes ; then
2892 # nothing to do
2894 else
2895 _def_fast_inttypes='
2896 typedef signed char int_fast8_t;
2897 typedef signed int int_fast16_t;
2898 typedef signed int int_fast32_t;
2899 typedef signed long long int_fast64_t;
2900 typedef unsigned char uint_fast8_t;
2901 typedef unsigned int uint_fast16_t;
2902 typedef unsigned int uint_fast32_t;
2903 typedef unsigned long long uint_fast64_t;'
2905 echores "$_fast_inttypes"
2908 echocheck "word size"
2909 _mp_wordsize="#undef MP_WORDSIZE"
2910 cat > $TMPC << EOF
2911 #include <stdio.h>
2912 #include <sys/types.h>
2913 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2915 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2916 echores "$_wordsize"
2919 echocheck "malloc.h"
2920 cat > $TMPC << EOF
2921 #include <malloc.h>
2922 int main(void) { (void) malloc(0); return 0; }
2924 _malloc=no
2925 cc_check && _malloc=yes
2926 if test "$_malloc" = yes ; then
2927 _def_malloc='#define HAVE_MALLOC_H 1'
2928 else
2929 _def_malloc='#undef HAVE_MALLOC_H'
2931 # malloc.h emits a warning in FreeBSD and OpenBSD
2932 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2933 echores "$_malloc"
2936 echocheck "memalign()"
2937 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2938 cat > $TMPC << EOF
2939 #include <malloc.h>
2940 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2942 _memalign=no
2943 cc_check && _memalign=yes
2944 if test "$_memalign" = yes ; then
2945 _def_memalign='#define HAVE_MEMALIGN 1'
2946 else
2947 _def_memalign='#undef HAVE_MEMALIGN'
2948 _def_map_memalign='#define memalign(a,b) malloc(b)'
2949 not darwin && _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2951 echores "$_memalign"
2954 echocheck "alloca.h"
2955 cat > $TMPC << EOF
2956 #include <alloca.h>
2957 int main(void) { (void) alloca(0); return 0; }
2959 _alloca=no
2960 cc_check && _alloca=yes
2961 if cc_check ; then
2962 _def_alloca='#define HAVE_ALLOCA_H 1'
2963 else
2964 _def_alloca='#undef HAVE_ALLOCA_H'
2966 echores "$_alloca"
2969 echocheck "mman.h"
2970 cat > $TMPC << EOF
2971 #include <sys/types.h>
2972 #include <sys/mman.h>
2973 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2975 _mman=no
2976 cc_check && _mman=yes
2977 if test "$_mman" = yes ; then
2978 _def_mman='#define HAVE_SYS_MMAN_H 1'
2979 else
2980 _def_mman='#undef HAVE_SYS_MMAN_H'
2982 echores "$_mman"
2984 cat > $TMPC << EOF
2985 #include <sys/types.h>
2986 #include <sys/mman.h>
2987 int main(void) { void *p = MAP_FAILED; return 0; }
2989 _mman_has_map_failed=no
2990 cc_check && _mman_has_map_failed=yes
2991 if test "$_mman_has_map_failed" = yes ; then
2992 _def_mman_has_map_failed=''
2993 else
2994 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2997 echocheck "dynamic loader"
2998 cat > $TMPC << EOF
2999 #include <dlfcn.h>
3000 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3002 _dl=no
3003 for _ld_tmp in "" "-ldl" ; do
3004 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3005 done
3006 if test "$_dl" = yes ; then
3007 _def_dl='#define HAVE_LIBDL 1'
3008 else
3009 _def_dl='#undef HAVE_LIBDL'
3011 echores "$_dl"
3014 echocheck "dynamic a/v plugins support"
3015 if test "$_dl" = no ; then
3016 _dynamic_plugins=no
3018 if test "$_dynamic_plugins" = yes ; then
3019 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3020 else
3021 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3023 echores "$_dynamic_plugins"
3026 _def_threads='#undef HAVE_THREADS'
3028 echocheck "pthread"
3029 if test "$_pthreads" = auto ; then
3030 cat > $TMPC << EOF
3031 #include <pthread.h>
3032 void* func(void *arg) { return arg; }
3033 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3035 _pthreads=no
3036 if not hpux ; then
3037 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3038 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3039 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3040 done
3043 if test "$_pthreads" = yes ; then
3044 _res_comment="using $_ld_pthread"
3045 _def_pthreads='#define HAVE_PTHREADS 1'
3046 _def_threads='#define HAVE_THREADS 1'
3047 else
3048 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3049 _def_pthreads='#undef HAVE_PTHREADS'
3050 _nas=no ; _tv_v4l1=no ; _macosx=no
3051 if not mingw32 ; then
3052 _win32dll=no
3055 echores "$_pthreads"
3057 echocheck "w32threads"
3058 if test "$_pthreads" = yes ; then
3059 _res_comment="using pthread instead"
3060 _w32threads=no
3062 if test "$_w32threads" = auto ; then
3063 _w32threads=no
3064 mingw32 && _w32threads=yes
3066 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3067 echores "$_w32threads"
3069 echocheck "rpath"
3070 netbsd &&_rpath=yes
3071 if test "$_rpath" = yes ; then
3072 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3073 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3074 done
3075 _ld_extra=$tmp
3077 echores "$_rpath"
3079 echocheck "iconv"
3080 if test "$_iconv" = auto ; then
3081 cat > $TMPC << EOF
3082 #include <stdio.h>
3083 #include <unistd.h>
3084 #include <iconv.h>
3085 #define INBUFSIZE 1024
3086 #define OUTBUFSIZE 4096
3088 char inbuffer[INBUFSIZE];
3089 char outbuffer[OUTBUFSIZE];
3091 int main(void) {
3092 size_t numread;
3093 iconv_t icdsc;
3094 char *tocode="UTF-8";
3095 char *fromcode="cp1250";
3096 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3097 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3098 char *iptr=inbuffer;
3099 char *optr=outbuffer;
3100 size_t inleft=numread;
3101 size_t outleft=OUTBUFSIZE;
3102 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3103 != (size_t)(-1)) {
3104 write (1, outbuffer, OUTBUFSIZE - outleft);
3107 if (iconv_close(icdsc) == -1)
3112 _iconv=no
3113 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3114 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3115 _iconv=yes && break
3116 done
3118 if test "$_iconv" = yes ; then
3119 _def_iconv='#define USE_ICONV 1'
3120 else
3121 _def_iconv='#undef USE_ICONV'
3123 echores "$_iconv"
3126 echocheck "soundcard.h"
3127 _soundcard_h=no
3128 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3129 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3130 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3131 cat > $TMPC << EOF
3132 #include <$_soundcard_header>
3133 int main(void) { return 0; }
3135 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3136 done
3138 if test "$_soundcard_h" = yes ; then
3139 if test $_soundcard_header = "sys/soundcard.h"; then
3140 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3141 else
3142 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3145 echores "$_soundcard_h"
3148 echocheck "sys/dvdio.h"
3149 cat > $TMPC << EOF
3150 #include <unistd.h>
3151 #include <sys/dvdio.h>
3152 int main(void) { return 0; }
3154 _dvdio=no
3155 cc_check && _dvdio=yes
3156 if test "$_dvdio" = yes ; then
3157 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3158 else
3159 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3161 echores "$_dvdio"
3164 echocheck "sys/cdio.h"
3165 cat > $TMPC << EOF
3166 #include <unistd.h>
3167 #include <sys/cdio.h>
3168 int main(void) { return 0; }
3170 _cdio=no
3171 cc_check && _cdio=yes
3172 if test "$_cdio" = yes ; then
3173 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3174 else
3175 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3177 echores "$_cdio"
3180 echocheck "linux/cdrom.h"
3181 cat > $TMPC << EOF
3182 #include <sys/types.h>
3183 #include <linux/cdrom.h>
3184 int main(void) { return 0; }
3186 _cdrom=no
3187 cc_check && _cdrom=yes
3188 if test "$_cdrom" = yes ; then
3189 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3190 else
3191 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3193 echores "$_cdrom"
3196 echocheck "dvd.h"
3197 cat > $TMPC << EOF
3198 #include <dvd.h>
3199 int main(void) { return 0; }
3201 _dvd=no
3202 cc_check && _dvd=yes
3203 if test "$_dvd" = yes ; then
3204 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3205 else
3206 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3208 echores "$_dvd"
3211 if bsdos; then
3212 echocheck "BSDI dvd.h"
3213 cat > $TMPC << EOF
3214 #include <dvd.h>
3215 int main(void) { return 0; }
3217 _bsdi_dvd=no
3218 cc_check && _bsdi_dvd=yes
3219 if test "$_bsdi_dvd" = yes ; then
3220 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3221 else
3222 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3224 echores "$_bsdi_dvd"
3225 fi #if bsdos
3228 if hpux; then
3229 # also used by AIX, but AIX does not support VCD and/or libdvdread
3230 echocheck "HP-UX SCSI header"
3231 cat > $TMPC << EOF
3232 #include <sys/scsi.h>
3233 int main(void) { return 0; }
3235 _hpux_scsi_h=no
3236 cc_check && _hpux_scsi_h=yes
3237 if test "$_hpux_scsi_h" = yes ; then
3238 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3239 else
3240 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3242 echores "$_hpux_scsi_h"
3243 fi #if hpux
3246 if sunos; then
3247 echocheck "userspace SCSI headers (Solaris)"
3248 cat > $TMPC << EOF
3249 # include <unistd.h>
3250 # include <stropts.h>
3251 # include <sys/scsi/scsi_types.h>
3252 # include <sys/scsi/impl/uscsi.h>
3253 int main(void) { return 0; }
3255 _sol_scsi_h=no
3256 cc_check && _sol_scsi_h=yes
3257 if test "$_sol_scsi_h" = yes ; then
3258 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3259 else
3260 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3262 echores "$_sol_scsi_h"
3263 fi #if sunos
3266 echocheck "termcap"
3267 if test "$_termcap" = auto ; then
3268 cat > $TMPC <<EOF
3269 int main(void) { tgetent(); return 0; }
3271 _termcap=no
3272 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3273 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3274 && _termcap=yes && break
3275 done
3277 if test "$_termcap" = yes ; then
3278 _def_termcap='#define USE_TERMCAP 1'
3279 _res_comment="using $_ld_tmp"
3280 else
3281 _def_termcap='#undef USE_TERMCAP'
3283 echores "$_termcap"
3286 echocheck "termios"
3287 _def_termios='#undef HAVE_TERMIOS'
3288 _def_termios_h='#undef HAVE_TERMIOS_H'
3289 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3290 if test "$_termios" = auto ; then
3291 _termios=no
3292 for _termios_header in "sys/termios.h" "termios.h"; do
3293 cat > $TMPC <<EOF
3294 #include <$_termios_header>
3295 int main(void) { return 0; }
3297 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3298 done
3301 if test "$_termios" = yes ; then
3302 _def_termios='#define HAVE_TERMIOS 1'
3303 if test "$_termios_header" = "termios.h" ; then
3304 _def_termios_h='#define HAVE_TERMIOS_H 1'
3305 else
3306 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3309 echores "$_termios"
3312 echocheck "shm"
3313 if test "$_shm" = auto ; then
3314 cat > $TMPC << EOF
3315 #include <sys/types.h>
3316 #include <sys/shm.h>
3317 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3319 _shm=no
3320 cc_check && _shm=yes
3322 if test "$_shm" = yes ; then
3323 _def_shm='#define HAVE_SHM 1'
3324 else
3325 _def_shm='#undef HAVE_SHM'
3327 echores "$_shm"
3330 echocheck "strsep()"
3331 cat > $TMPC << EOF
3332 #include <string.h>
3333 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3335 _strsep=no
3336 cc_check && _strsep=yes
3337 if test "$_strsep" = yes ; then
3338 _def_strsep='#define HAVE_STRSEP 1'
3339 _need_strsep=no
3340 else
3341 _def_strsep='#undef HAVE_STRSEP'
3342 _need_strsep=yes
3344 echores "$_strsep"
3347 echocheck "vsscanf()"
3348 cat > $TMPC << EOF
3349 #include <stdarg.h>
3350 int main(void) { vsscanf(0, 0, 0); return 0; }
3352 _vsscanf=no
3353 cc_check && _vsscanf=yes
3354 if test "$_vsscanf" = yes ; then
3355 _def_vsscanf='#define HAVE_VSSCANF 1'
3356 _need_vsscanf=no
3357 else
3358 _def_vsscanf='#undef HAVE_VSSCANF'
3359 _need_vsscanf=yes
3361 echores "$_vsscanf"
3364 echocheck "swab()"
3365 cat > $TMPC << EOF
3366 #include <unistd.h>
3367 int main(void) { swab(0, 0, 0); return 0; }
3369 _swab=no
3370 cc_check && _swab=yes
3371 if test "$_swab" = yes ; then
3372 _def_swab='#define HAVE_SWAB 1'
3373 _need_swab=no
3374 else
3375 _def_swab='#undef HAVE_SWAB'
3376 _need_swab=yes
3378 echores "$_swab"
3380 echocheck "POSIX select()"
3381 cat > $TMPC << EOF
3382 #include <stdio.h>
3383 #include <stdlib.h>
3384 #include <sys/types.h>
3385 #include <string.h>
3386 #include <sys/time.h>
3387 #include <unistd.h>
3388 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3390 _posix_select=no
3391 _def_posix_select='#undef HAVE_POSIX_SELECT'
3392 cc_check && _posix_select=yes \
3393 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3394 echores "$_posix_select"
3397 echocheck "gettimeofday()"
3398 cat > $TMPC << EOF
3399 #include <stdio.h>
3400 #include <sys/time.h>
3401 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3403 _gettimeofday=no
3404 cc_check && _gettimeofday=yes
3405 if test "$_gettimeofday" = yes ; then
3406 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3407 _need_gettimeofday=no
3408 else
3409 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3410 _need_gettimeofday=yes
3412 echores "$_gettimeofday"
3415 echocheck "glob()"
3416 cat > $TMPC << EOF
3417 #include <stdio.h>
3418 #include <glob.h>
3419 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3421 _glob=no
3422 cc_check && _glob=yes
3423 if test "$_glob" = yes ; then
3424 _def_glob='#define HAVE_GLOB 1'
3425 _need_glob=no
3426 else
3427 _def_glob='#undef HAVE_GLOB'
3428 _need_glob=yes
3430 echores "$_glob"
3433 echocheck "setenv()"
3434 cat > $TMPC << EOF
3435 #include <stdlib.h>
3436 int main (void){ setenv("","",0); return 0; }
3438 _setenv=no
3439 cc_check && _setenv=yes
3440 if test "$_setenv" = yes ; then
3441 _def_setenv='#define HAVE_SETENV 1'
3442 _need_setenv=no
3443 else
3444 _def_setenv='#undef HAVE_SETENV'
3445 _need_setenv=yes
3447 echores "$_setenv"
3450 if sunos; then
3451 echocheck "sysi86()"
3452 cat > $TMPC << EOF
3453 #include <sys/sysi86.h>
3454 int main (void) { sysi86(0); return 0; }
3456 _sysi86=no
3457 cc_check && _sysi86=yes
3458 if test "$_sysi86" = yes ; then
3459 _def_sysi86='#define HAVE_SYSI86 1'
3460 cat > $TMPC << EOF
3461 #include <sys/sysi86.h>
3462 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3464 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3465 else
3466 _def_sysi86='#undef HAVE_SYSI86'
3468 echores "$_sysi86"
3469 fi #if sunos
3472 echocheck "sys/sysinfo.h"
3473 cat > $TMPC << EOF
3474 #include <sys/sysinfo.h>
3475 int main(void) {
3476 struct sysinfo s_info;
3477 sysinfo(&s_info);
3478 return 0;
3481 _sys_sysinfo=no
3482 cc_check && _sys_sysinfo=yes
3483 if test "$_sys_sysinfo" = yes ; then
3484 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3485 else
3486 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3488 echores "$_sys_sysinfo"
3491 if darwin; then
3493 echocheck "Mac OS X APIs"
3494 if test "$_macosx" = auto ; then
3495 productName=`/usr/bin/sw_vers -productName`
3496 if test "$productName" = "Mac OS X" ||
3497 test "$productName" = "Mac OS X Server" ; then
3498 _macosx=yes
3499 else
3500 _macosx=no
3501 _def_macosx='#undef MACOSX'
3502 _noaomodules="macosx $_noaomodules"
3503 _novomodules="quartz $_novomodules"
3506 if test "$_macosx" = yes ; then
3507 cat > $TMPC <<EOF
3508 #include <Carbon/Carbon.h>
3509 #include <QuickTime/QuickTime.h>
3510 #include <CoreAudio/CoreAudio.h>
3511 int main(void) {
3512 EnterMovies();
3513 ExitMovies();
3514 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3517 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3518 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3519 _def_macosx='#define MACOSX 1'
3520 _aosrc="$_aosrc ao_macosx.c"
3521 _aomodules="macosx $_aomodules"
3522 _vosrc="$_vosrc vo_quartz.c"
3523 _vomodules="quartz $_vomodules"
3524 else
3525 _macosx=no
3526 _def_macosx='#undef MACOSX'
3527 _noaomodules="macosx $_noaomodules"
3528 _novomodules="quartz $_novomodules"
3530 cat > $TMPC <<EOF
3531 #include <Carbon/Carbon.h>
3532 #include <QuartzCore/CoreVideo.h>
3533 int main(void) {}
3535 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3536 _vosrc="$_vosrc vo_macosx.m"
3537 _vomodules="macosx $_vomodules"
3538 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3539 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3540 _macosx_corevideo=yes
3541 else
3542 _novomodules="macosx $_novomodules"
3543 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3544 _macosx_corevideo=no
3547 echores "$_macosx"
3549 echocheck "Mac OS X Finder Support"
3550 if test "$_macosx_finder_support" = auto ; then
3551 _macosx_finder_support=$_macosx
3553 if test "$_macosx_finder_support" = yes; then
3554 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3555 _macosx_finder_support=yes
3556 else
3557 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3558 _macosx_finder_support=no
3560 echores "$_macosx_finder_support"
3562 echocheck "Mac OS X Bundle file locations"
3563 if test "$_macosx_bundle" = auto ; then
3564 _macosx_bundle=$_macosx_finder_support
3566 if test "$_macosx_bundle" = yes; then
3567 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3568 else
3569 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3570 _macosx_bundle=no
3572 echores "$_macosx_bundle"
3574 fi #if darwin
3577 echocheck "pkg-config"
3578 _pkg_config=pkg-config
3579 if `$_pkg_config --version > /dev/null 2>&1`; then
3580 if test "$_ld_static"; then
3581 _pkg_config="$_pkg_config --static"
3583 echores "yes"
3584 else
3585 _pkg_config=false
3586 echores "no"
3590 echocheck "Samba support (libsmbclient)"
3591 if test "$_smbsupport" = yes; then
3592 _ld_extra="$_ld_extra -lsmbclient"
3594 if test "$_smbsupport" = auto; then
3595 _smbsupport=no
3596 cat > $TMPC << EOF
3597 #include <libsmbclient.h>
3598 int main(void) { smbc_opendir("smb://"); return 0; }
3600 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3601 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3602 _smbsupport=yes && break
3603 done
3606 if test "$_smbsupport" = yes; then
3607 _def_smbsupport="#define LIBSMBCLIENT"
3608 _inputmodules="smb $_inputmodules"
3609 else
3610 _def_smbsupport="#undef LIBSMBCLIENT"
3611 _noinputmodules="smb $_noinputmodules"
3613 echores "$_smbsupport"
3616 #########
3617 # VIDEO #
3618 #########
3621 echocheck "3dfx"
3622 if test "$_3dfx" = yes ; then
3623 _def_3dfx='#define HAVE_3DFX 1'
3624 _vosrc="$_vosrc vo_3dfx.c"
3625 _vomodules="3dfx $_vomodules"
3626 else
3627 _def_3dfx='#undef HAVE_3DFX'
3628 _novomodules="3dfx $_novomodules"
3630 echores "$_3dfx"
3633 echocheck "tdfxfb"
3634 if test "$_tdfxfb" = yes ; then
3635 _def_tdfxfb='#define HAVE_TDFXFB 1'
3636 _vosrc="$_vosrc vo_tdfxfb.c"
3637 _vomodules="tdfxfb $_vomodules"
3638 else
3639 _def_tdfxfb='#undef HAVE_TDFXFB'
3640 _novomodules="tdfxfb $_novomodules"
3642 echores "$_tdfxfb"
3644 echocheck "s3fb"
3645 if test "$_s3fb" = yes ; then
3646 _def_s3fb='#define HAVE_S3FB 1'
3647 _vosrc="$_vosrc vo_s3fb.c"
3648 _vomodules="s3fb $_vomodules"
3649 else
3650 _def_s3fb='#undef HAVE_S3FB'
3651 _novomodules="s3fb $_novomodules"
3653 echores "$_s3fb"
3655 echocheck "tdfxvid"
3656 if test "$_tdfxvid" = yes ; then
3657 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3658 _vosrc="$_vosrc vo_tdfx_vid.c"
3659 _vomodules="tdfx_vid $_vomodules"
3660 else
3661 _def_tdfxvid='#undef HAVE_TDFX_VID'
3662 _novomodules="tdfx_vid $_novomodules"
3664 echores "$_tdfxvid"
3666 echocheck "xvr100"
3667 if test "$_xvr100" = auto ; then
3668 cat > $TMPC << EOF
3669 #include <unistd.h>
3670 #include <sys/fbio.h>
3671 #include <sys/visual_io.h>
3672 int main(void) {
3673 struct vis_identifier ident;
3674 struct fbgattr attr;
3676 ioctl(0, VIS_GETIDENTIFIER, &ident);
3677 ioctl(0, FBIOGATTR, &attr);
3680 _xvr100=no
3681 cc_check && _xvr100=yes
3683 if test "$_xvr100" = yes ; then
3684 _def_xvr100='#define HAVE_XVR100 1'
3685 _vosrc="$_vosrc vo_xvr100.c"
3686 _vomodules="xvr100 $_vomodules"
3687 else
3688 _def_tdfxvid='#undef HAVE_XVR100'
3689 _novomodules="xvr100 $_novomodules"
3691 echores "$_xvr100"
3693 echocheck "tga"
3694 if test "$_tga" = yes ; then
3695 _def_tga='#define HAVE_TGA 1'
3696 _vosrc="$_vosrc vo_tga.c"
3697 _vomodules="tga $_vomodules"
3698 else
3699 _def_tga='#undef HAVE_TGA'
3700 _novomodules="tga $_novomodules"
3702 echores "$_tga"
3705 echocheck "md5sum support"
3706 if test "$_md5sum" = yes; then
3707 _def_md5sum="#define HAVE_MD5SUM"
3708 _vosrc="$_vosrc vo_md5sum.c"
3709 _vomodules="md5sum $_vomodules"
3710 else
3711 _def_md5sum="#undef HAVE_MD5SUM"
3712 _novomodules="md5sum $_novomodules"
3714 echores "$_md5sum"
3717 echocheck "bl"
3718 if test "$_bl" = yes ; then
3719 _def_bl='#define HAVE_BL 1'
3720 _vosrc="$_vosrc vo_bl.c"
3721 _vomodules="bl $_vomodules"
3722 else
3723 _def_bl='#undef HAVE_BL'
3724 _novomodules="bl $_novomodules"
3726 echores "$_bl"
3729 echocheck "DirectFB"
3730 if test "$_directfb" = auto ; then
3731 _directfb=no
3732 cat > $TMPC <<EOF
3733 #include <directfb.h>
3734 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3736 for _inc_tmp in "" -I/usr/local/include/directfb \
3737 -I/usr/include/directfb -I/usr/local/include; do
3738 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3739 _inc_extra="$_inc_extra $_inc_tmp" && break
3740 done
3743 dfb_version() {
3744 expr $1 \* 65536 + $2 \* 256 + $3
3747 if test "$_directfb" = yes; then
3748 cat > $TMPC << EOF
3749 #include <directfb_version.h>
3751 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3754 if $_cc -E $TMPC $_inc_extra > "$TMPO"; then
3755 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPO" | tr -d '()'`
3756 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3757 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3758 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3759 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3760 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3761 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3762 _res_comment="$_directfb_version"
3763 else
3764 _def_directfb_version='#undef DIRECTFBVERSION'
3765 _directfb=no
3766 _res_comment="version >=0.9.13 required"
3768 else
3769 _directfb=no
3770 _res_comment="failed to get version"
3773 echores "$_directfb"
3775 if test "$_directfb" = yes ; then
3776 _def_directfb='#define HAVE_DIRECTFB 1'
3777 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3778 _vosrc="$_vosrc vo_directfb2.c"
3779 _vomodules="directfb $_vomodules"
3780 _libs_mplayer="$_libs_mplayer -ldirectfb"
3781 else
3782 _novomodules="directfb $_novomodules"
3785 if test "$_dfb_version" -ge `dfb_version 0 9 15`; then
3786 _vosrc="$_vosrc vo_dfbmga.c"
3787 _vomodules="dfbmga $_vomodules"
3788 _def_dfbmga='#define HAVE_DFBMGA 1'
3789 else
3790 _novomodules="dfbmga $_novomodules"
3791 _def_dfbmga='#undef HAVE_DFBMGA'
3793 else
3794 _def_directfb='#undef HAVE_DIRECTFB'
3795 _novomodules="dfbmga directfb $_novomodules"
3799 echocheck "X11 headers presence"
3800 _x11_headers="no"
3801 _res_comment="check if the dev(el) packages are installed"
3802 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3803 if test -f "$I/X11/Xlib.h" ; then
3804 _x11_headers="yes"
3805 _res_comment=""
3806 break
3808 done
3809 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3810 if test -f "$I/X11/Xlib.h" ; then
3811 _inc_extra="$_inc_extra -I$I"
3812 _x11_headers="yes"
3813 _res_comment="using $I"
3814 break
3816 done
3817 echores "$_x11_headers"
3820 echocheck "X11"
3821 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3822 cat > $TMPC <<EOF
3823 #include <X11/Xlib.h>
3824 #include <X11/Xutil.h>
3825 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3827 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3828 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3829 if netbsd; then
3830 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3831 else
3832 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3834 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3835 && _x11=yes && break
3836 done
3838 if test "$_x11" = yes ; then
3839 _def_x11='#define HAVE_X11 1'
3840 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3841 _vomodules="x11 xover $_vomodules"
3842 else
3843 _x11=no
3844 _def_x11='#undef HAVE_X11'
3845 _novomodules="x11 $_novomodules"
3846 _res_comment="check if the dev(el) packages are installed"
3847 # disable stuff that depends on X
3848 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _dga=no
3850 echores "$_x11"
3853 echocheck "DPMS"
3854 _xdpms3=no
3855 _xdpms4=no
3856 if test "$_x11" = yes ; then
3857 cat > $TMPC <<EOF
3858 #include <X11/Xmd.h>
3859 #include <X11/Xlib.h>
3860 #include <X11/Xutil.h>
3861 #include <X11/Xatom.h>
3862 #include <X11/extensions/dpms.h>
3863 int main(void) {
3864 (void) DPMSQueryExtension(0, 0, 0);
3867 cc_check -lXdpms && _xdpms3=yes
3868 cat > $TMPC <<EOF
3869 #include <X11/Xlib.h>
3870 #include <X11/extensions/dpms.h>
3871 int main(void) {
3872 (void) DPMSQueryExtension(0, 0, 0);
3875 cc_check && _xdpms4=yes
3877 if test "$_xdpms4" = yes ; then
3878 _def_xdpms='#define HAVE_XDPMS 1'
3879 _res_comment="using Xdpms 4"
3880 echores "yes"
3881 elif test "$_xdpms3" = yes ; then
3882 _def_xdpms='#define HAVE_XDPMS 1'
3883 _libs_mplayer="$_libs_mplayer -lXdpms"
3884 _res_comment="using Xdpms 3"
3885 echores "yes"
3886 else
3887 _def_xdpms='#undef HAVE_XDPMS'
3888 echores "no"
3892 echocheck "Xv"
3893 if test "$_xv" = auto ; then
3894 cat > $TMPC <<EOF
3895 #include <X11/Xlib.h>
3896 #include <X11/extensions/Xvlib.h>
3897 int main(void) {
3898 (void) XvGetPortAttribute(0, 0, 0, 0);
3899 (void) XvQueryPortAttributes(0, 0, 0);
3900 return 0; }
3902 _xv=no
3903 cc_check -lXv && _xv=yes
3906 if test "$_xv" = yes ; then
3907 _def_xv='#define HAVE_XV 1'
3908 _libs_mplayer="$_libs_mplayer -lXv"
3909 _vosrc="$_vosrc vo_xv.c"
3910 _vomodules="xv $_vomodules"
3911 else
3912 _def_xv='#undef HAVE_XV'
3913 _novomodules="xv $_novomodules"
3915 echores "$_xv"
3918 echocheck "XvMC"
3919 if test "$_xv" = yes && test "$_xvmc" != no ; then
3920 _xvmc=no
3921 cat > $TMPC <<EOF
3922 #include <X11/Xlib.h>
3923 #include <X11/extensions/Xvlib.h>
3924 #include <X11/extensions/XvMClib.h>
3925 int main(void) {
3926 (void) XvMCQueryExtension(0,0,0);
3927 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3928 return 0; }
3930 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3931 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3932 done
3934 if test "$_xvmc" = yes ; then
3935 _def_xvmc='#define HAVE_XVMC 1'
3936 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
3937 _vosrc="$_vosrc vo_xvmc.c"
3938 _vomodules="xvmc $_vomodules"
3939 _res_comment="using $_xvmclib"
3940 else
3941 _def_xvmc='#undef HAVE_XVMC'
3942 _novomodules="xvmc $_novomodules"
3943 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
3945 echores "$_xvmc"
3948 echocheck "Xinerama"
3949 if test "$_xinerama" = auto ; then
3950 cat > $TMPC <<EOF
3951 #include <X11/Xlib.h>
3952 #include <X11/extensions/Xinerama.h>
3953 int main(void) { (void) XineramaIsActive(0); return 0; }
3955 _xinerama=no
3956 cc_check -lXinerama && _xinerama=yes
3959 if test "$_xinerama" = yes ; then
3960 _def_xinerama='#define HAVE_XINERAMA 1'
3961 _libs_mplayer="$_libs_mplayer -lXinerama"
3962 else
3963 _def_xinerama='#undef HAVE_XINERAMA'
3965 echores "$_xinerama"
3968 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3969 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3970 # named 'X extensions' or something similar.
3971 # This check may be useful for future mplayer versions (to change resolution)
3972 # If you run into problems, remove '-lXxf86vm'.
3973 echocheck "Xxf86vm"
3974 if test "$_vm" = auto ; then
3975 cat > $TMPC <<EOF
3976 #include <X11/Xlib.h>
3977 #include <X11/extensions/xf86vmode.h>
3978 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3980 _vm=no
3981 cc_check -lXxf86vm && _vm=yes
3983 if test "$_vm" = yes ; then
3984 _def_vm='#define HAVE_XF86VM 1'
3985 _libs_mplayer="$_libs_mplayer -lXxf86vm"
3986 else
3987 _def_vm='#undef HAVE_XF86VM'
3989 echores "$_vm"
3991 # Check for the presence of special keycodes, like audio control buttons
3992 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3993 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3994 # have these new keycodes.
3995 echocheck "XF86keysym"
3996 if test "$_xf86keysym" = auto; then
3997 _xf86keysym=no
3998 cat > $TMPC <<EOF
3999 #include <X11/Xlib.h>
4000 #include <X11/XF86keysym.h>
4001 int main(void) { return XF86XK_AudioPause; }
4003 cc_check && _xf86keysym=yes
4005 if test "$_xf86keysym" = yes ; then
4006 _def_xf86keysym='#define HAVE_XF86XK 1'
4007 else
4008 _def_xf86keysym='#undef HAVE_XF86XK'
4010 echores "$_xf86keysym"
4012 echocheck "DGA"
4013 # Version 2 is preferred to version 1 if available
4014 if test "$_dga" = auto ; then
4015 cat > $TMPC << EOF
4016 #include <X11/Xlib.h>
4017 #include <X11/extensions/xf86dga.h>
4018 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4020 _dga=no
4021 cc_check -lXxf86dga -lXxf86vm && _dga=1
4023 cat > $TMPC << EOF
4024 #include <X11/Xlib.h>
4025 #include <X11/extensions/xf86dga.h>
4026 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4028 cc_check -lXxf86dga && _dga=2
4031 _def_dga='#undef HAVE_DGA'
4032 _def_dga2='#undef HAVE_DGA2'
4033 if test "$_dga" = 1 ; then
4034 _def_dga='#define HAVE_DGA 1'
4035 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4036 _vosrc="$_vosrc vo_dga.c"
4037 _vomodules="dga $_vomodules"
4038 _res_comment="using DGA 1.0"
4039 elif test "$_dga" = 2 ; then
4040 _def_dga='#define HAVE_DGA 1'
4041 _def_dga2='#define HAVE_DGA2 1'
4042 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4043 _vosrc="$_vosrc vo_dga.c"
4044 _vomodules="dga $_vomodules"
4045 _res_comment="using DGA 2.0"
4046 elif test "$_dga" = no ; then
4047 _novomodules="dga $_novomodules"
4048 else
4049 die "DGA version must be 1 or 2"
4051 echores "$_dga"
4054 echocheck "OpenGL"
4055 #Note: this test is run even with --enable-gl since we autodetect linker flags
4056 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4057 cat > $TMPC << EOF
4058 #include <GL/gl.h>
4059 #ifdef GL_WIN32
4060 #include <windows.h>
4061 #include <GL/glext.h>
4062 #else
4063 #include <X11/Xlib.h>
4064 #include <GL/glx.h>
4065 #endif
4066 int main(void) {
4067 #ifdef GL_WIN32
4068 HDC dc;
4069 wglCreateContext(dc);
4070 #else
4071 glXCreateContext(NULL, NULL, NULL, True);
4072 #endif
4073 glFinish();
4074 return 0;
4077 _gl=no
4078 if cc_check -lGL $_ld_lm ; then
4079 _gl=yes
4080 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4081 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4082 _gl=yes
4083 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4084 elif cc_check -DGL_WIN32 -lopengl32 ; then
4085 _gl=yes
4086 _gl_win32=yes
4087 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4089 else
4090 _gl=no
4092 if test "$_gl" = yes ; then
4093 _def_gl='#define HAVE_GL 1'
4094 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4095 if test "$_gl_win32" = yes ; then
4096 _def_gl_win32='#define GL_WIN32 1'
4097 _vosrc="$_vosrc w32_common.c"
4098 _res_comment="win32 version"
4100 _vomodules="opengl $_vomodules"
4101 else
4102 _def_gl='#undef HAVE_GL'
4103 _def_gl_win32='#undef GL_WIN32'
4104 _novomodules="opengl $_novomodules"
4106 echores "$_gl"
4109 echocheck "VIDIX"
4110 _vidix=no
4111 _def_vidix='#undef CONFIG_VIDIX'
4112 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4113 _vidix_drv_cyberblade=no
4114 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4115 _vidix_drv_ivtv=no
4116 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4117 _vidix_drv_ivtv=no
4118 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4119 _vidix_drv_mach64=no
4120 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4121 _vidix_drv_mga=no
4122 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4123 _vidix_drv_mga_crtc2=no
4124 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4125 _vidix_drv_nvidia=no
4126 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4127 _vidix_drv_pm2=no
4128 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4129 _vidix_drv_pm3=no
4130 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4131 _vidix_drv_radeon=no
4132 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4133 _vidix_drv_rage128=no
4134 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
4135 _vidix_drv_savage=no
4136 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4137 _vidix_drv_sis=no
4138 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4139 _vidix_drv_unichrome=no
4140 if test "$_vidix_internal" = auto ; then
4141 _vidix_internal=no
4142 x86 && _vidix_internal=yes
4143 # this is broken currently, undefined references to inw, outw etc.
4144 #ppc && linux && _vidix_internal=yes
4145 alpha && linux && _vidix_internal=yes
4146 qnx || beos || darwin && _vidix_internal=no
4148 if test "$_vidix_internal" = yes; then
4149 _res_comment="internal"
4150 _vidix_external=no
4151 _vidix=yes
4152 elif test "$_vidix_external" = auto; then
4153 _vidix_external=no
4154 cat > $TMPC <<EOF
4155 #include <vidix/vidix.h>
4156 int main(void) { return 0; }
4158 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
4159 && _vidix=yes
4161 echores "$_vidix"
4163 if test "$_vidix" = yes ; then
4164 _def_vidix='#define CONFIG_VIDIX 1'
4165 _vosrc="$_vosrc vo_cvidix.c"
4166 _vomodules="cvidix $_vomodules"
4167 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 savage sis unichrome"
4168 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4170 for driver in $_vidix_drivers ; do
4171 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4172 eval _vidix_drv_${driver}=yes
4173 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4174 done
4175 else
4176 _novomodules="cvidix $_novomodules"
4179 if test "$_vidix_internal" = yes ; then
4180 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
4181 elif test "$_vidix_external" = yes ; then
4182 _libs_mplayer="$_libs_mplayer -lvidix"
4183 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
4186 if test "$_vidix" = yes && win32; then
4187 _vosrc="$_vosrc vo_winvidix.c"
4188 _vomodules="winvidix $_vomodules"
4189 _libs_mplayer="$_libs_mplayer -lgdi32"
4190 else
4191 _novomodules="winvidix $_novomodules"
4193 if test "$_vidix" = yes && test "$_x11" = yes; then
4194 _vosrc="$_vosrc vo_xvidix.c"
4195 _vomodules="xvidix $_vomodules"
4196 else
4197 _novomodules="xvidix $_novomodules"
4201 echocheck "mga_vid"
4202 if test "$_mga" = auto ; then
4203 _mga=no
4204 linux && _mga=yes
4206 if test "$_mga" = yes ; then
4207 _def_mga='#define HAVE_MGA 1'
4208 _vosrc="$_vosrc vo_mga.c"
4209 _vomodules="mga $_vomodules"
4210 else
4211 _def_mga='#undef HAVE_MGA'
4212 _novomodules="mga $_novomodules"
4214 echores "$_mga"
4217 echocheck "xmga"
4218 if test "$_xmga" = auto ; then
4219 _xmga=no
4220 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4222 if test "$_xmga" = yes ; then
4223 _def_xmga='#define HAVE_XMGA 1'
4224 _vosrc="$_vosrc vo_xmga.c"
4225 _vomodules="xmga $_vomodules"
4226 else
4227 _def_xmga='#undef HAVE_XMGA'
4228 _novomodules="xmga $_novomodules"
4230 echores "$_xmga"
4233 echocheck "GGI"
4234 if test "$_ggi" = auto ; then
4235 cat > $TMPC << EOF
4236 #include <ggi/ggi.h>
4237 int main(void) { ggiInit(); return 0; }
4239 _ggi=no
4240 cc_check -lggi && _ggi=yes
4242 if test "$_ggi" = yes ; then
4243 _def_ggi='#define HAVE_GGI 1'
4244 _libs_mplayer="$_libs_mplayer -lggi"
4245 _vosrc="$_vosrc vo_ggi.c"
4246 _vomodules="ggi $_vomodules"
4247 else
4248 _def_ggi='#undef HAVE_GGI'
4249 _novomodules="ggi $_novomodules"
4251 echores "$_ggi"
4253 echocheck "GGI extension: libggiwmh"
4254 if test "$_ggiwmh" = auto ; then
4255 _ggiwmh=no
4256 cat > $TMPC << EOF
4257 #include <ggi/ggi.h>
4258 #include <ggi/wmh.h>
4259 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4261 cc_check -lggi -lggiwmh && _ggiwmh=yes
4263 # needed to get right output on obscure combination
4264 # like --disable-ggi --enable-ggiwmh
4265 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4266 _def_ggiwmh='#define HAVE_GGIWMH 1'
4267 _libs_mplayer="$_libs_mplayer -lggiwmh"
4268 else
4269 _ggiwmh=no
4270 _def_ggiwmh='#undef HAVE_GGIWMH'
4272 echores "$_ggiwmh"
4275 echocheck "AA"
4276 if test "$_aa" = auto ; then
4277 cat > $TMPC << EOF
4278 #include <aalib.h>
4279 extern struct aa_hardware_params aa_defparams;
4280 extern struct aa_renderparams aa_defrenderparams;
4281 int main(void) {
4282 aa_context *c;
4283 aa_renderparams *p;
4284 (void) aa_init(0, 0, 0);
4285 c = aa_autoinit(&aa_defparams);
4286 p = aa_getrenderparams();
4287 aa_autoinitkbd(c,0);
4288 return 0; }
4290 _aa=no
4291 for _ld_tmp in "-laa" ; do
4292 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4293 done
4295 if test "$_aa" = yes ; then
4296 _def_aa='#define HAVE_AA 1'
4297 if cygwin ; then
4298 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4300 _vosrc="$_vosrc vo_aa.c"
4301 _vomodules="aa $_vomodules"
4302 else
4303 _def_aa='#undef HAVE_AA'
4304 _novomodules="aa $_novomodules"
4306 echores "$_aa"
4309 echocheck "CACA"
4310 if test "$_caca" = auto ; then
4311 _caca=no
4312 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4313 cat > $TMPC << EOF
4314 #include <caca.h>
4315 #ifdef CACA_API_VERSION_1
4316 #include <caca0.h>
4317 #endif
4318 int main(void) { (void) caca_init(); return 0; }
4320 cc_check `caca-config --libs` && _caca=yes
4323 if test "$_caca" = yes ; then
4324 _def_caca='#define HAVE_CACA 1'
4325 _inc_extra="$_inc_extra `caca-config --cflags`"
4326 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4327 _vosrc="$_vosrc vo_caca.c"
4328 _vomodules="caca $_vomodules"
4329 else
4330 _def_caca='#undef HAVE_CACA'
4331 _novomodules="caca $_novomodules"
4333 echores "$_caca"
4336 echocheck "SVGAlib"
4337 if test "$_svga" = auto ; then
4338 cat > $TMPC << EOF
4339 #include <vga.h>
4340 int main(void) { return 0; }
4342 _svga=no
4343 cc_check -lvga $_ld_lm && _svga=yes
4345 if test "$_svga" = yes ; then
4346 _def_svga='#define HAVE_SVGALIB 1'
4347 _libs_mplayer="$_libs_mplayer -lvga"
4348 _vosrc="$_vosrc vo_svga.c"
4349 _vomodules="svga $_vomodules"
4350 else
4351 _def_svga='#undef HAVE_SVGALIB'
4352 _novomodules="svga $_novomodules"
4354 echores "$_svga"
4357 echocheck "FBDev"
4358 if test "$_fbdev" = auto ; then
4359 _fbdev=no
4360 linux && _fbdev=yes
4362 if test "$_fbdev" = yes ; then
4363 _def_fbdev='#define HAVE_FBDEV 1'
4364 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4365 _vomodules="fbdev $_vomodules"
4366 else
4367 _def_fbdev='#undef HAVE_FBDEV'
4368 _novomodules="fbdev $_novomodules"
4370 echores "$_fbdev"
4374 echocheck "DVB"
4375 if test "$_dvb" = auto ; then
4376 _dvb=no
4377 cat >$TMPC << EOF
4378 #include <sys/poll.h>
4379 #include <sys/ioctl.h>
4380 #include <stdio.h>
4381 #include <time.h>
4382 #include <unistd.h>
4384 #include <ost/dmx.h>
4385 #include <ost/frontend.h>
4386 #include <ost/sec.h>
4387 #include <ost/video.h>
4388 #include <ost/audio.h>
4389 int main(void) {return 0;}
4391 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4392 cc_check $_inc_tmp && _dvb=yes && \
4393 _inc_extra="$_inc_extra $_inc_tmp" && break
4394 done
4396 echores "$_dvb"
4397 if test "$_dvb" = yes ; then
4398 _def_dvb='#define HAVE_DVB 1'
4399 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4400 _aomodules="mpegpes(dvb) $_aomodules"
4401 _vomodules="mpegpes(dvb) $_vomodules"
4404 echocheck "DVB HEAD"
4405 if test "$_dvbhead" = auto ; then
4406 _dvbhead=no
4408 cat >$TMPC << EOF
4409 #include <sys/poll.h>
4410 #include <sys/ioctl.h>
4411 #include <stdio.h>
4412 #include <time.h>
4413 #include <unistd.h>
4415 #include <linux/dvb/dmx.h>
4416 #include <linux/dvb/frontend.h>
4417 #include <linux/dvb/video.h>
4418 #include <linux/dvb/audio.h>
4419 int main(void) {return 0;}
4421 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4422 cc_check $_inc_tmp && _dvbhead=yes && \
4423 _inc_extra="$_inc_extra $_inc_tmp" && break
4424 done
4426 echores "$_dvbhead"
4427 if test "$_dvbhead" = yes ; then
4428 _def_dvb='#define HAVE_DVB_HEAD 1'
4429 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4430 _aomodules="mpegpes(dvb) $_aomodules"
4431 _vomodules="mpegpes(dvb) $_vomodules"
4434 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4435 _def_dvb='#undef HAVE_DVB'
4436 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4437 _aomodules="mpegpes(file) $_aomodules"
4438 _vomodules="mpegpes(file) $_vomodules"
4441 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4442 _dvbin=yes
4443 _inputmodules="dvb $_inputmodules"
4444 else
4445 _dvbin=no
4446 _noinputmodules="dvb $_noinputmodules"
4450 echocheck "zr"
4451 if test "$_zr" = auto ; then
4452 #36067's seem to identify themselves as 36057PQC's, so the line
4453 #below should work for 36067's and 36057's.
4454 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
4455 _zr=yes
4456 else
4457 _zr=no
4460 if test "$_zr" = yes ; then
4461 if test "$_libavcodec_a" = yes ; then
4462 _def_zr='#define HAVE_ZR 1'
4463 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
4464 _vomodules="zr zr2 $_vomodules"
4465 else
4466 _res_comment="libavcodec (static) is required by zr, sorry"
4467 _novomodules="zr $_novomodules"
4468 _def_zr='#undef HAVE_ZR'
4470 else
4471 _def_zr='#undef HAVE_ZR'
4472 _novomodules="zr zr2 $_novomodules"
4474 echores "$_zr"
4477 echocheck "PNG support"
4478 if test "$_png" = auto ; then
4479 _png=no
4480 if irix ; then
4481 # Don't check for -lpng on irix since it has its own libpng
4482 # incompatible with the GNU libpng
4483 _res_comment="disabled on irix (not GNU libpng)"
4484 else
4485 cat > $TMPC << EOF
4486 #include <png.h>
4487 #include <string.h>
4488 int main(void) {
4489 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4490 printf("libpng: %s\n", png_libpng_ver);
4491 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4494 if cc_check -lpng -lz $_ld_lm ; then
4495 if tmp_run ; then
4496 _png=yes
4497 else
4498 _res_comment="mismatch of library and header versions"
4503 echores "$_png"
4504 if test "$_png" = yes ; then
4505 _def_png='#define HAVE_PNG 1'
4506 _ld_extra="$_ld_extra -lpng -lz"
4507 _vosrc="$_vosrc vo_png.c"
4508 _vomodules="png $_vomodules"
4509 else
4510 _def_png='#undef HAVE_PNG'
4511 _novomodules="png $_novomodules"
4514 echocheck "JPEG support"
4515 if test "$_jpeg" = auto ; then
4516 _jpeg=no
4517 cat > $TMPC << EOF
4518 #include <stdio.h>
4519 #include <stdlib.h>
4520 #include <setjmp.h>
4521 #include <string.h>
4522 #include <jpeglib.h>
4523 int main(void) {
4524 return 0;
4527 if cc_check -ljpeg $_ld_lm ; then
4528 if tmp_run ; then
4529 _jpeg=yes
4533 echores "$_jpeg"
4535 if test "$_jpeg" = yes ; then
4536 _def_jpeg='#define HAVE_JPEG 1'
4537 _vosrc="$_vosrc vo_jpeg.c"
4538 _vomodules="jpeg $_vomodules"
4539 _ld_extra="$_ld_extra -ljpeg"
4540 else
4541 _def_jpeg='#undef HAVE_JPEG'
4542 _novomodules="jpeg $_novomodules"
4547 echocheck "PNM support"
4548 if test "$_pnm" = yes; then
4549 _def_pnm="#define HAVE_PNM"
4550 _vosrc="$_vosrc vo_pnm.c"
4551 _vomodules="pnm $_vomodules"
4552 else
4553 _def_pnm="#undef HAVE_PNM"
4554 _novomodules="pnm $_novomodules"
4556 echores "$_pnm"
4560 echocheck "GIF support"
4561 # This is to appease people who want to force gif support.
4562 # If it is forced to yes, then we still do checks to determine
4563 # which gif library to use.
4564 if test "$_gif" = yes ; then
4565 _force_gif=yes
4566 _gif=auto
4569 if test "$_gif" = auto ; then
4570 _gif=no
4571 cat > $TMPC << EOF
4572 #include <gif_lib.h>
4573 int main(void) {
4574 return 0;
4577 for _ld_gif in "-lungif" "-lgif" ; do
4578 cc_check $_ld_gif && tmp_run && _gif=yes && break
4579 done
4582 # If no library was found, and the user wants support forced,
4583 # then we force it on with libgif, as this is the safest
4584 # assumption IMHO. (libungif & libregif both create symbolic
4585 # links to libgif. We also assume that no x11 support is needed,
4586 # because if you are forcing this, then you _should_ know what
4587 # you are doing. [ Besides, package maintainers should never
4588 # have compiled x11 deps into libungif in the first place. ] )
4589 # </rant>
4590 # --Joey
4591 if test "$_force_gif" = yes && test "$_gif" = no ; then
4592 _gif=yes
4593 _ld_gif="-lgif"
4596 if test "$_gif" = yes ; then
4597 _def_gif='#define HAVE_GIF 1'
4598 _vosrc="$_vosrc vo_gif89a.c"
4599 _codecmodules="gif $_codecmodules"
4600 _vomodules="gif89a $_vomodules"
4601 _res_comment="old version, some encoding functions disabled"
4602 _def_gif_4='#undef HAVE_GIF_4'
4603 _ld_extra="$_ld_extra $_ld_gif"
4605 cat > $TMPC << EOF
4606 #include <signal.h>
4607 #include <gif_lib.h>
4608 void catch() { exit(1); }
4609 int main(void) {
4610 signal(SIGSEGV, catch); // catch segfault
4611 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4612 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4613 return 0;
4616 if cc_check "$_ld_gif" && tmp_run ; then
4617 _def_gif_4='#define HAVE_GIF_4 1'
4618 _res_comment=""
4620 else
4621 _def_gif='#undef HAVE_GIF'
4622 _def_gif_4='#undef HAVE_GIF_4'
4623 _novomodules="gif89a $_novomodules"
4624 _nocodecmodules="gif $_nocodecmodules"
4626 echores "$_gif"
4629 case "$_gif" in yes*)
4630 echocheck "broken giflib workaround"
4631 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4633 cat > $TMPC << EOF
4634 #include <gif_lib.h>
4635 int main(void) {
4636 GifFileType gif;
4637 printf("UserData is at address %p\n", gif.UserData);
4638 return 0;
4641 if cc_check "$_ld_gif" && tmp_run ; then
4642 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4643 echores "disabled"
4644 else
4645 echores "enabled"
4648 esac
4651 echocheck "VESA support"
4652 if test "$_vesa" = auto ; then
4653 cat > $TMPC << EOF
4654 #include <vbe.h>
4655 int main(void) { vbeVersion(); return 0; }
4657 _vesa=no
4658 cc_check -lvbe -llrmi && _vesa=yes
4660 if test "$_vesa" = yes ; then
4661 _def_vesa='#define HAVE_VESA 1'
4662 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4663 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4664 _vomodules="vesa $_vomodules"
4665 else
4666 _def_vesa='#undef HAVE_VESA'
4667 _novomodules="vesa $_novomodules"
4669 echores "$_vesa"
4671 #################
4672 # VIDEO + AUDIO #
4673 #################
4676 echocheck "SDL"
4677 if test -z "$_sdlconfig" ; then
4678 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4679 _sdlconfig="sdl-config"
4680 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4681 _sdlconfig="sdl11-config"
4682 else
4683 _sdlconfig=false
4686 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4687 cat > $TMPC << EOF
4688 #include <SDL.h>
4689 int main(int argc, char *argv[]) {
4690 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4691 return 0;
4694 _sdl=no
4695 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4696 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4697 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4698 if test "$_sdlversion" -gt 116 ; then
4699 if test "$_sdlversion" -lt 121 ; then
4700 _def_sdlbuggy='#define BUGGY_SDL'
4701 else
4702 _def_sdlbuggy='#undef BUGGY_SDL'
4704 _sdl=yes
4709 if test "$_sdl" = yes ; then
4710 _def_sdl='#define HAVE_SDL 1'
4711 if cygwin ; then
4712 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4713 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4714 elif mingw32 ; then
4715 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4716 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4717 else
4718 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4719 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4721 _vosrc="$_vosrc vo_sdl.c"
4722 _vomodules="sdl $_vomodules"
4723 _aosrc="$_aosrc ao_sdl.c"
4724 _aomodules="sdl $_aomodules"
4725 _res_comment="using $_sdlconfig"
4726 else
4727 _def_sdl='#undef HAVE_SDL'
4728 _novomodules="sdl $_novomodules"
4729 _noaomodules="sdl $_noaomodules"
4731 echores "$_sdl"
4734 if win32; then
4736 echocheck "Windows waveout"
4737 if test "$_win32waveout" = auto ; then
4738 cat > $TMPC << EOF
4739 #include <windows.h>
4740 #include <mmsystem.h>
4741 int main(void) { return 0; }
4743 _win32waveout=no
4744 cc_check -lwinmm && _win32waveout=yes
4746 if test "$_win32waveout" = yes ; then
4747 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4748 _libs_mplayer="$_libs_mplayer -lwinmm"
4749 _aosrc="$_aosrc ao_win32.c"
4750 _aomodules="win32 $_aomodules"
4751 else
4752 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4753 _noaomodules="win32 $_noaomodules"
4755 echores "$_win32waveout"
4757 echocheck "Directx"
4758 if test "$_directx" = auto ; then
4759 cat > $TMPC << EOF
4760 #include <windows.h>
4761 #include <ddraw.h>
4762 #include <dsound.h>
4763 int main(void) { return 0; }
4765 _directx=no
4766 cc_check -lgdi32 && _directx=yes
4768 if test "$_directx" = yes ; then
4769 _def_directx='#define HAVE_DIRECTX 1'
4770 _libs_mplayer="$_libs_mplayer -lgdi32"
4771 _vosrc="$_vosrc vo_directx.c"
4772 _vomodules="directx $_vomodules"
4773 _aosrc="$_aosrc ao_dsound.c"
4774 _aomodules="dsound $_aomodules"
4775 else
4776 _def_directx='#undef HAVE_DIRECTX'
4777 _novomodules="directx $_novomodules"
4778 _noaomodules="dsound $_noaomodules"
4780 echores "$_directx"
4782 fi #if win32; then
4785 echocheck "NAS"
4786 if test "$_nas" = auto ; then
4787 cat > $TMPC << EOF
4788 #include <audio/audiolib.h>
4789 int main(void) { return 0; }
4791 _nas=no
4792 cc_check $_ld_lm -laudio -lXt && _nas=yes
4794 if test "$_nas" = yes ; then
4795 _def_nas='#define HAVE_NAS 1'
4796 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4797 _aosrc="$_aosrc ao_nas.c"
4798 _aomodules="nas $_aomodules"
4799 else
4800 _noaomodules="nas $_noaomodules"
4801 _def_nas='#undef HAVE_NAS'
4803 echores "$_nas"
4805 echocheck "DXR2"
4806 if test "$_dxr2" = auto; then
4807 _dxr2=no
4808 cat > $TMPC << EOF
4809 #include <dxr2ioctl.h>
4810 int main(void) { return 0; }
4812 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4813 cc_check $_inc_tmp && _dxr2=yes && \
4814 _inc_extra="$_inc_extra $_inc_tmp" && break
4815 done
4817 if test "$_dxr2" = yes; then
4818 _def_dxr2='#define HAVE_DXR2 1'
4819 _vosrc="$_vosrc vo_dxr2.c"
4820 _aosrc="$_aosrc ao_dxr2.c"
4821 _aomodules="dxr2 $_aomodules"
4822 _vomodules="dxr2 $_vomodules"
4823 else
4824 _def_dxr2='#undef HAVE_DXR2'
4825 _noaomodules="dxr2 $_noaomodules"
4826 _novomodules="dxr2 $_novomodules"
4828 echores "$_dxr2"
4830 echocheck "DXR3/H+"
4831 if test "$_dxr3" = auto ; then
4832 cat > $TMPC << EOF
4833 #include <linux/em8300.h>
4834 int main(void) { return 0; }
4836 _dxr3=no
4837 cc_check && _dxr3=yes
4839 if test "$_dxr3" = yes ; then
4840 _def_dxr3='#define HAVE_DXR3 1'
4841 _vosrc="$_vosrc vo_dxr3.c"
4842 _vomodules="dxr3 $_vomodules"
4843 else
4844 _def_dxr3='#undef HAVE_DXR3'
4845 _novomodules="dxr3 $_novomodules"
4847 echores "$_dxr3"
4850 echocheck "IVTV TV-Out"
4851 if test "$_ivtv" = auto ; then
4852 cat > $TMPC << EOF
4853 #include <stdlib.h>
4854 #include <inttypes.h>
4855 #include <linux/types.h>
4856 #include <linux/videodev2.h>
4857 #include <linux/ivtv.h>
4858 int main(void) { return 0; }
4860 _ivtv=no
4861 cc_check && _ivtv=yes
4863 if test "$_ivtv" = yes ; then
4864 _def_ivtv='#define HAVE_IVTV 1'
4865 _vosrc="$_vosrc vo_ivtv.c"
4866 _vomodules="ivtv $_vomodules"
4867 _aosrc="$_aosrc ao_ivtv.c"
4868 _aomodules="ivtv $_aomodules"
4869 else
4870 _def_ivtv='#undef HAVE_IVTV'
4871 _novomodules="ivtv $_novomodules"
4872 _noaomodules="ivtv $_noaomodules"
4874 echores "$_ivtv"
4877 echocheck "V4L2 MPEG Decoder"
4878 if test "$_v4l2" = auto ; then
4879 cat > $TMPC << EOF
4880 #include <stdlib.h>
4881 #include <inttypes.h>
4882 #include <linux/types.h>
4883 #include <linux/videodev2.h>
4884 #include <linux/version.h>
4885 int main(void) {
4886 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4887 #error kernel headers too old, need 2.6.22
4888 bad_kernel_version();
4889 #endif
4890 struct v4l2_ext_controls ctrls;
4891 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4892 return 0;
4895 _v4l2=no
4896 cc_check && _v4l2=yes
4898 if test "$_v4l2" = yes ; then
4899 _def_v4l2='#define HAVE_V4L2_DECODER 1'
4900 _vosrc="$_vosrc vo_v4l2.c"
4901 _vomodules="v4l2 $_vomodules"
4902 _aosrc="$_aosrc ao_v4l2.c"
4903 _aomodules="v4l2 $_aomodules"
4904 else
4905 _def_v4l2='#undef HAVE_V4L2_DECODER'
4906 _novomodules="v4l2 $_novomodules"
4907 _noaomodules="v4l2 $_noaomodules"
4909 echores "$_v4l2"
4913 #########
4914 # AUDIO #
4915 #########
4918 echocheck "OSS Audio"
4919 if test "$_ossaudio" = auto ; then
4920 cat > $TMPC << EOF
4921 #include <sys/ioctl.h>
4922 #include <$_soundcard_header>
4923 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4925 _ossaudio=no
4926 cc_check && _ossaudio=yes
4928 if test "$_ossaudio" = yes ; then
4929 _def_ossaudio='#define USE_OSS_AUDIO 1'
4930 _aosrc="$_aosrc ao_oss.c"
4931 _aomodules="oss $_aomodules"
4932 if test "$_linux_devfs" = yes; then
4933 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4934 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4935 else
4936 cat > $TMPC << EOF
4937 #include <sys/ioctl.h>
4938 #include <$_soundcard_header>
4939 #ifdef OPEN_SOUND_SYSTEM
4940 int main(void) { return 0; }
4941 #else
4942 #error Not the real thing
4943 #endif
4945 _real_ossaudio=no
4946 cc_check && _real_ossaudio=yes
4947 if test "$_real_ossaudio" = yes; then
4948 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4949 elif netbsd || openbsd ; then
4950 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4951 _ld_extra="$_ld_extra -lossaudio"
4952 else
4953 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4955 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4957 else
4958 _def_ossaudio='#undef USE_OSS_AUDIO'
4959 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4960 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4961 _noaomodules="oss $_noaomodules"
4963 echores "$_ossaudio"
4966 echocheck "aRts"
4967 if test "$_arts" = auto ; then
4968 _arts=no
4969 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4971 cat > $TMPC << EOF
4972 #include <artsc.h>
4973 int main(void) { return 0; }
4975 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
4980 if test "$_arts" = yes ; then
4981 _def_arts='#define USE_ARTS 1'
4982 _aosrc="$_aosrc ao_arts.c"
4983 _aomodules="arts $_aomodules"
4984 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
4985 _inc_extra="$_inc_extra `artsc-config --cflags`"
4986 else
4987 _noaomodules="arts $_noaomodules"
4989 echores "$_arts"
4992 echocheck "EsounD"
4993 if test "$_esd" = auto ; then
4994 _esd=no
4995 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4997 cat > $TMPC << EOF
4998 #include <esd.h>
4999 int main(void) { return 0; }
5001 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes
5005 echores "$_esd"
5007 if test "$_esd" = yes ; then
5008 _def_esd='#define USE_ESD 1'
5009 _aosrc="$_aosrc ao_esd.c"
5010 _aomodules="esd $_aomodules"
5011 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5012 _inc_extra="$_inc_extra `esd-config --cflags`"
5014 echocheck "esd_get_latency()"
5015 cat > $TMPC << EOF
5016 #include <esd.h>
5017 int main(void) { return esd_get_latency(0); }
5019 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5020 echores "$_esd_latency"
5021 else
5022 _def_esd='#undef USE_ESD'
5023 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5024 _noaomodules="esd $_noaomodules"
5027 echocheck "Polyp"
5028 if test "$_polyp" = auto ; then
5029 _polyp=no
5030 if $_pkg_config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
5032 cat > $TMPC << EOF
5033 #include <polyp/polyplib.h>
5034 #include <polyp/mainloop.h>
5035 #include <polyp/polyplib-error.h>
5036 int main(void) { return 0; }
5038 cc_check `$_pkg_config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
5042 echores "$_polyp"
5044 if test "$_polyp" = yes ; then
5045 _def_polyp='#define USE_POLYP 1'
5046 _aosrc="$_aosrc ao_polyp.c"
5047 _aomodules="polyp $_aomodules"
5048 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs polyplib polyplib-error polyplib-mainloop`"
5049 _inc_extra="$_inc_extra `$_pkg_config --cflags polyplib polyplib-error polyplib-mainloop`"
5050 else
5051 _def_polyp='#undef USE_POLYP'
5052 _noaomodules="polyp $_noaomodules"
5056 echocheck "JACK"
5057 if test "$_jack" = auto ; then
5058 _jack=yes
5060 cat > $TMPC << EOF
5061 #include <jack/jack.h>
5062 int main(void) { jack_client_new("test"); return 0; }
5064 if cc_check -ljack ; then
5065 _libs_mplayer="$_libs_mplayer -ljack"
5066 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5067 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5068 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5069 else
5070 _jack=no
5074 if test "$_jack" = yes ; then
5075 _def_jack='#define USE_JACK 1'
5076 _aosrc="$_aosrc ao_jack.c"
5077 _aomodules="jack $_aomodules"
5078 else
5079 _noaomodules="jack $_noaomodules"
5081 echores "$_jack"
5083 echocheck "OpenAL"
5084 if test "$_openal" = auto ; then
5085 _openal=no
5086 cat > $TMPC << EOF
5087 #ifdef OPENAL_AL_H
5088 #include <OpenAL/al.h>
5089 #else
5090 #include <AL/al.h>
5091 #endif
5092 int main(void) {
5093 alSourceQueueBuffers(0, 0, 0);
5094 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5095 return 0;
5098 for I in "-lopenal" "-framework OpenAL" ; do
5099 cc_check $I && _openal=yes && break
5100 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5101 done
5102 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5104 if test "$_openal" = yes ; then
5105 _def_openal='#define USE_OPENAL 1'
5106 _aosrc="$_aosrc ao_openal.c"
5107 _aomodules="openal $_aomodules"
5108 else
5109 _noaomodules="openal $_noaomodules"
5111 echores "$_openal"
5113 echocheck "ALSA audio"
5114 if test "$_alsa" != no ; then
5115 _alsa=no
5116 cat > $TMPC << EOF
5117 #include <sys/asoundlib.h>
5118 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5119 #error "alsa version != 0.5.x"
5120 #endif
5121 int main(void) { return 0; }
5123 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5125 cat > $TMPC << EOF
5126 #include <sys/asoundlib.h>
5127 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5128 #error "alsa version != 0.9.x"
5129 #endif
5130 int main(void) { return 0; }
5132 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5133 cat > $TMPC << EOF
5134 #include <alsa/asoundlib.h>
5135 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5136 #error "alsa version != 0.9.x"
5137 #endif
5138 int main(void) { return 0; }
5140 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5142 cat > $TMPC << EOF
5143 #include <sys/asoundlib.h>
5144 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5145 #error "alsa version != 1.0.x"
5146 #endif
5147 int main(void) { return 0; }
5149 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5150 cat > $TMPC << EOF
5151 #include <alsa/asoundlib.h>
5152 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5153 #error "alsa version != 1.0.x"
5154 #endif
5155 int main(void) { return 0; }
5157 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5159 _def_alsa5='#undef HAVE_ALSA5'
5160 _def_alsa9='#undef HAVE_ALSA9'
5161 _def_alsa1x='#undef HAVE_ALSA1X'
5162 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5163 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5164 if test "$_alsaver" ; then
5165 _alsa=yes
5166 if test "$_alsaver" = '0.5.x' ; then
5167 _alsa5=yes
5168 _aosrc="$_aosrc ao_alsa5.c"
5169 _aomodules="alsa5 $_aomodules"
5170 _def_alsa5='#define HAVE_ALSA5 1'
5171 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5172 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5173 elif test "$_alsaver" = '0.9.x-sys' ; then
5174 _alsa9=yes
5175 _aosrc="$_aosrc ao_alsa.c"
5176 _aomodules="alsa $_aomodules"
5177 _def_alsa9='#define HAVE_ALSA9 1'
5178 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5179 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5180 elif test "$_alsaver" = '0.9.x-alsa' ; then
5181 _alsa9=yes
5182 _aosrc="$_aosrc ao_alsa.c"
5183 _aomodules="alsa $_aomodules"
5184 _def_alsa9='#define HAVE_ALSA9 1'
5185 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5186 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5187 elif test "$_alsaver" = '1.0.x-sys' ; then
5188 _alsa1x=yes
5189 _aosrc="$_aosrc ao_alsa.c"
5190 _aomodules="alsa $_aomodules"
5191 _def_alsa1x="#define HAVE_ALSA1X 1"
5192 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5193 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5194 elif test "$_alsaver" = '1.0.x-alsa' ; then
5195 _alsa1x=yes
5196 _aosrc="$_aosrc ao_alsa.c"
5197 _aomodules="alsa $_aomodules"
5198 _def_alsa1x="#define HAVE_ALSA1X 1"
5199 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5200 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5201 else
5202 _alsa=no
5203 _res_comment="unknown version"
5205 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5206 else
5207 _noaomodules="alsa $_noaomodules"
5209 echores "$_alsa"
5212 echocheck "Sun audio"
5213 if test "$_sunaudio" = auto ; then
5214 cat > $TMPC << EOF
5215 #include <sys/types.h>
5216 #include <sys/audioio.h>
5217 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5219 _sunaudio=no
5220 cc_check && _sunaudio=yes
5222 if test "$_sunaudio" = yes ; then
5223 _def_sunaudio='#define USE_SUN_AUDIO 1'
5224 _aosrc="$_aosrc ao_sun.c"
5225 _aomodules="sun $_aomodules"
5226 else
5227 _def_sunaudio='#undef USE_SUN_AUDIO'
5228 _noaomodules="sun $_noaomodules"
5230 echores "$_sunaudio"
5233 if sunos; then
5234 echocheck "Sun mediaLib"
5235 if test "$_mlib" = auto ; then
5236 _mlib=no
5237 cat > $TMPC << EOF
5238 #include <mlib.h>
5239 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5241 cc_check -lmlib && _mlib=yes
5243 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5244 echores "$_mlib"
5245 fi #if sunos
5248 if irix; then
5249 echocheck "SGI audio"
5250 if test "$_sgiaudio" = auto ; then
5251 # check for SGI audio
5252 cat > $TMPC << EOF
5253 #include <dmedia/audio.h>
5254 int main(void) { return 0; }
5256 _sgiaudio=no
5257 cc_check && _sgiaudio=yes
5259 if test "$_sgiaudio" = "yes" ; then
5260 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5261 _libs_mplayer="$_libs_mplayer -laudio"
5262 _aosrc="$_aosrc ao_sgi.c"
5263 _aomodules="sgi $_aomodules"
5264 else
5265 _def_sgiaudio='#undef USE_SGI_AUDIO'
5266 _noaomodules="sgi $_noaomodules"
5268 echores "$_sgiaudio"
5269 fi #if irix
5272 echocheck "VCD support"
5273 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5274 _inputmodules="vcd $_inputmodules"
5275 _def_vcd='#define HAVE_VCD 1'
5276 _vcd="yes"
5277 else
5278 _def_vcd='#undef HAVE_VCD'
5279 _noinputmodules="vcd $_noinputmodules"
5280 _res_comment="not supported on this OS"
5281 _vcd="no"
5283 echores "$_vcd"
5287 echocheck "dvdread"
5288 if test "$_dvdread_internal" = auto ; then
5289 _dvdread_internal=no
5290 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5291 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5292 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5293 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5294 _dvdread_internal=yes
5295 _dvdread=yes
5296 _res_comment="internal"
5298 elif test "$_dvdread" = auto ; then
5299 _dvdread=no
5300 if test "$_dl" = yes; then
5301 cat > $TMPC << EOF
5302 #include <inttypes.h>
5303 #include <dvdread/dvd_reader.h>
5304 #include <dvdread/ifo_types.h>
5305 #include <dvdread/ifo_read.h>
5306 #include <dvdread/nav_read.h>
5307 int main(void) { return 0; }
5309 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5310 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5314 if test "$_dvdread_internal" = yes; then
5315 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5316 _def_dvdread='#define USE_DVDREAD 1'
5317 _inputmodules="dvdread(internal) $_inputmodules"
5318 _largefiles=yes
5319 elif test "$_dvdread" = yes; then
5320 _def_dvdread='#define USE_DVDREAD 1'
5321 _largefiles=yes
5322 _ld_extra="$_ld_extra -ldvdread"
5323 _inputmodules="dvdread(external) $_inputmodules"
5324 _res_comment="external"
5325 else
5326 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5327 _def_dvdread='#undef USE_DVDREAD'
5328 _noinputmodules="dvdread $_noinputmodules"
5330 echores "$_dvdread"
5333 echocheck "internal libdvdcss"
5334 if test "$_libdvdcss_internal" = auto ; then
5335 _libdvdcss_internal=no
5336 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5338 if test "$_libdvdcss_internal" = yes ; then
5339 if linux || netbsd || openbsd || bsdos ; then
5340 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5341 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5342 elif freebsd ; then
5343 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5344 elif darwin ; then
5345 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5346 _ld_extra="$_ld_extra -framework IOKit"
5348 _inputmodules="libdvdcss(internal) $_inputmodules"
5349 _largefiles=yes
5350 else
5351 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5353 echores "$_libdvdcss_internal"
5356 echocheck "cdparanoia"
5357 if test "$_cdparanoia" = auto ; then
5358 cat > $TMPC <<EOF
5359 #include <cdda_interface.h>
5360 #include <cdda_paranoia.h>
5361 // This need a better test. How ?
5362 int main(void) {
5363 void *test = cdda_verbose_set;
5364 return test == (void *)1;
5367 _cdparanoia=no
5368 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5369 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5370 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5371 done
5373 if test "$_cdparanoia" = yes ; then
5374 _cdda='yes'
5375 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5376 openbsd && _ld_extra="$_ld_extra -lutil"
5378 echores "$_cdparanoia"
5381 echocheck "libcdio"
5382 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5383 cat > $TMPC << EOF
5384 #include <stdio.h>
5385 #include <cdio/version.h>
5386 #include <cdio/cdda.h>
5387 #include <cdio/paranoia.h>
5388 int main()
5390 void *test = cdda_verbose_set;
5391 printf("%s\n", CDIO_VERSION);
5392 return test == (void *)1;
5396 _libcdio=no
5397 for _ld_tmp in "" "-lwinmm" ; do
5398 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5399 cc_check $_ld_tmp $_ld_lm \
5400 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5401 done
5402 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5403 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5404 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5405 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5406 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5409 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5410 _cdda='yes'
5411 _def_libcdio='#define HAVE_LIBCDIO'
5412 _def_havelibcdio='yes'
5413 else
5414 if test "$_cdparanoia" = yes ; then
5415 _res_comment="using cdparanoia"
5417 _def_libcdio='#undef HAVE_LIBCDIO'
5418 _def_havelibcdio='no'
5420 echores "$_libcdio"
5422 if test "$_cdda" = yes ; then
5423 test $_cddb = auto && test $_network = yes && not darwin && _cddb=yes
5424 _def_cdparanoia='#define HAVE_CDDA'
5425 _inputmodules="cdda $_inputmodules"
5426 else
5427 _def_cdparanoia='#undef HAVE_CDDA'
5428 _noinputmodules="cdda $_noinputmodules"
5431 if test "$_cddb" = yes ; then
5432 _def_cddb='#define HAVE_CDDB'
5433 _inputmodules="cddb $_inputmodules"
5434 else
5435 _cddb=no
5436 _def_cddb='#undef HAVE_CDDB'
5437 _noinputmodules="cddb $_noinputmodules"
5440 echocheck "bitmap font support"
5441 if test "$_bitmap_font" = yes ; then
5442 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5443 else
5444 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5446 echores "$_bitmap_font"
5449 echocheck "freetype >= 2.0.9"
5451 # freetype depends on iconv
5452 if test "$_iconv" = no ; then
5453 _freetype=no
5454 _res_comment="iconv support needed"
5457 if test "$_freetype" = auto ; then
5458 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5459 cat > $TMPC << EOF
5460 #include <stdio.h>
5461 #include <ft2build.h>
5462 #include FT_FREETYPE_H
5463 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5464 #error "Need FreeType 2.0.9 or newer"
5465 #endif
5466 int main()
5468 FT_Library library;
5469 FT_Int major=-1,minor=-1,patch=-1;
5470 int err=FT_Init_FreeType(&library);
5471 if(err){
5472 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5473 exit(err);
5475 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5476 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5477 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5478 (int)major,(int)minor,(int)patch );
5479 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5480 printf("Library and header version mismatch! Fix it in your distribution!\n");
5481 exit(1);
5483 return 0;
5486 _freetype=no
5487 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5488 else
5489 _freetype=no
5492 if test "$_freetype" = yes ; then
5493 _def_freetype='#define HAVE_FREETYPE'
5494 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5495 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5496 else
5497 _def_freetype='#undef HAVE_FREETYPE'
5499 echores "$_freetype"
5501 if test "$_freetype" = no ; then
5502 _fontconfig=no
5503 _res_comment="freetype support needed"
5505 echocheck "fontconfig"
5506 if test "$_fontconfig" = auto ; then
5507 cat > $TMPC << EOF
5508 #include <stdio.h>
5509 #include <fontconfig/fontconfig.h>
5510 int main()
5512 int err = FcInit();
5513 if(err == FcFalse){
5514 printf("Couldn't initialize fontconfig lib\n");
5515 exit(err);
5517 return 0;
5521 _fontconfig=no
5522 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5523 _ld_tmp="-lfontconfig $_ld_tmp"
5524 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5525 done
5526 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5527 _inc_tmp=`$_pkg_config --cflags fontconfig`
5528 _ld_tmp=`$_pkg_config --libs fontconfig`
5529 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5530 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5533 if test "$_fontconfig" = yes ; then
5534 _def_fontconfig='#define HAVE_FONTCONFIG'
5535 else
5536 _def_fontconfig='#undef HAVE_FONTCONFIG'
5538 echores "$_fontconfig"
5541 echocheck "SSA/ASS support"
5542 # libass depends on FreeType
5543 if test "$_freetype" = no ; then
5544 _ass=no
5545 _res_comment="FreeType support needed"
5548 if test "$_ass" = auto ; then
5549 cat > $TMPC << EOF
5550 #include <ft2build.h>
5551 #include FT_FREETYPE_H
5552 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5553 #error "Need FreeType 2.1.8 or newer"
5554 #endif
5555 int main() { return 0; }
5557 _ass=no
5558 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5559 if test "$_ass" = no ; then
5560 _res_comment="FreeType >= 2.1.8 needed"
5563 if test "$_ass" = yes ; then
5564 _def_ass='#define USE_ASS'
5565 else
5566 _def_ass='#undef USE_ASS'
5568 echores "$_ass"
5571 echocheck "fribidi with charsets"
5572 if test "$_fribidi" = auto ; then
5573 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5574 cat > $TMPC << EOF
5575 #include <stdio.h>
5576 /* workaround for fribidi 0.10.4 and below */
5577 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5578 #include <fribidi/fribidi.h>
5579 int main()
5581 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5582 printf("Fribidi headers are not consistents with the library!\n");
5583 exit(1);
5585 return 0;
5588 _fribidi=no
5589 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5590 else
5591 _fribidi=no
5594 if test "$_fribidi" = yes ; then
5595 _def_fribidi='#define USE_FRIBIDI'
5596 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5597 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5598 else
5599 _def_fribidi='#undef USE_FRIBIDI'
5601 echores "$_fribidi"
5604 echocheck "ENCA"
5605 if test "$_enca" = auto ; then
5606 cat > $TMPC << EOF
5607 #include <enca.h>
5608 int main()
5610 const char **langs;
5611 size_t langcnt;
5612 langs = enca_get_languages(&langcnt);
5613 return 0;
5616 _enca=no
5617 cc_check -lenca $_ld_lm && _enca=yes
5619 if test "$_enca" = yes ; then
5620 _def_enca='#define HAVE_ENCA 1'
5621 _ld_extra="$_ld_extra -lenca"
5622 else
5623 _def_enca='#undef HAVE_ENCA'
5625 echores "$_enca"
5628 echocheck "zlib"
5629 cat > $TMPC << EOF
5630 #include <zlib.h>
5631 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5633 _zlib=no
5634 cc_check -lz && _zlib=yes
5635 if test "$_zlib" = yes ; then
5636 _def_zlib='#define HAVE_ZLIB 1'
5637 _ld_extra="$_ld_extra -lz"
5638 else
5639 _def_zlib='#undef HAVE_ZLIB'
5640 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5641 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5643 echores "$_zlib"
5646 echocheck "RTC"
5647 if test "$_rtc" = auto ; then
5648 cat > $TMPC << EOF
5649 #include <sys/ioctl.h>
5650 #ifdef __linux__
5651 #include <linux/rtc.h>
5652 #else
5653 #include <rtc.h>
5654 #define RTC_PIE_ON RTCIO_PIE_ON
5655 #endif
5656 int main(void) { return RTC_PIE_ON; }
5658 _rtc=no
5659 cc_check && _rtc=yes
5660 ppc && _rtc=no
5662 if test "$_rtc" = yes ; then
5663 _def_rtc='#define HAVE_RTC 1'
5664 else
5665 _def_rtc='#undef HAVE_RTC'
5667 echores "$_rtc"
5670 echocheck "liblzo2 support"
5671 if test "$_liblzo" = auto ; then
5672 _liblzo=no
5673 cat > $TMPC << EOF
5674 #include <lzo/lzo1x.h>
5675 int main(void) { lzo_init();return 0; }
5677 cc_check -llzo2 && _liblzo=yes
5679 if test "$_liblzo" = yes ; then
5680 _def_liblzo='#define USE_LIBLZO 1'
5681 _ld_extra="$_ld_extra -llzo2"
5682 _codecmodules="liblzo $_codecmodules"
5683 else
5684 _def_liblzo='#undef USE_LIBLZO'
5685 _nocodecmodules="liblzo $_nocodecmodules"
5687 echores "$_liblzo"
5690 echocheck "mad support"
5691 if test "$_mad" = auto ; then
5692 _mad=no
5693 cat > $TMPC << EOF
5694 #include <mad.h>
5695 int main(void) { return 0; }
5697 cc_check -lmad && _mad=yes
5699 if test "$_mad" = yes ; then
5700 _def_mad='#define USE_LIBMAD 1'
5701 _ld_extra="$_ld_extra -lmad"
5702 _codecmodules="libmad $_codecmodules"
5703 else
5704 _def_mad='#undef USE_LIBMAD'
5705 _nocodecmodules="libmad $_nocodecmodules"
5707 echores "$_mad"
5709 echocheck "Twolame"
5710 if test "$_twolame" = auto ; then
5711 cat > $TMPC <<EOF
5712 #include <twolame.h>
5713 int main(void) { twolame_init(); return 0; }
5715 _twolame=no
5716 cc_check -ltwolame $_ld_lm && _twolame=yes
5718 if test "$_twolame" = yes ; then
5719 _def_twolame='#define HAVE_TWOLAME 1'
5720 _libs_mencoder="$_libs_mencoder -ltwolame"
5721 _codecmodules="twolame $_codecmodules"
5722 else
5723 _def_twolame='#undef HAVE_TWOLAME'
5724 _nocodecmodules="twolame $_nocodecmodules"
5726 echores "$_twolame"
5728 echocheck "Toolame"
5729 if test "$_toolame" = auto ; then
5730 _toolame=no
5731 if test "$_twolame" = yes ; then
5732 _res_comment="disabled by twolame"
5733 else
5734 cat > $TMPC <<EOF
5735 #include <toolame.h>
5736 int main(void) { toolame_init(); return 0; }
5738 cc_check -ltoolame $_ld_lm && _toolame=yes
5741 if test "$_toolame" = yes ; then
5742 _def_toolame='#define HAVE_TOOLAME 1'
5743 _libs_mencoder="$_libs_mencoder -ltoolame"
5744 _codecmodules="toolame $_codecmodules"
5745 else
5746 _def_toolame='#undef HAVE_TOOLAME'
5747 _nocodecmodules="toolame $_nocodecmodules"
5749 if test "$_toolamedir" ; then
5750 _res_comment="using $_toolamedir"
5752 echores "$_toolame"
5754 echocheck "OggVorbis support"
5755 if test "$_tremor_internal" = yes; then
5756 _libvorbis=no
5757 elif test "$_tremor_external" = auto; then
5758 _tremor_external=no
5759 cat > $TMPC << EOF
5760 #include <tremor/ivorbiscodec.h>
5761 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5763 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5765 if test "$_libvorbis" = auto; then
5766 _libvorbis=no
5767 cat > $TMPC << EOF
5768 #include <vorbis/codec.h>
5769 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5771 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5773 if test "$_tremor_internal" = yes ; then
5774 _vorbis=yes
5775 _def_vorbis='#define HAVE_OGGVORBIS 1'
5776 _def_tremor='#define TREMOR 1'
5777 _codecmodules="tremor(internal) $_codecmodules"
5778 _res_comment="internal Tremor"
5779 if test "$_tremor_low" = yes ; then
5780 _res_comment="internal low accuracy Tremor"
5782 elif test "$_tremor_external" = yes ; then
5783 _vorbis=yes
5784 _def_vorbis='#define HAVE_OGGVORBIS 1'
5785 _def_tremor='#define TREMOR 1'
5786 _codecmodules="tremor(external) $_codecmodules"
5787 _res_comment="external Tremor"
5788 _ld_extra="$_ld_extra -logg -lvorbisidec"
5789 elif test "$_libvorbis" = yes ; then
5790 _vorbis=yes
5791 _def_vorbis='#define HAVE_OGGVORBIS 1'
5792 _codecmodules="libvorbis $_codecmodules"
5793 _res_comment="libvorbis"
5794 _ld_extra="$_ld_extra -lvorbis -logg"
5795 else
5796 _vorbis=no
5797 _nocodecmodules="libvorbis $_nocodecmodules"
5799 if test "$_libvorbis" = no ; then
5800 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5801 _libavmuxers=`echo $_libavmuxers | sed -e s/OGG_MUXER// `
5803 echores "$_vorbis"
5805 echocheck "libspeex (version >= 1.1 required)"
5806 if test "$_speex" = auto ; then
5807 _speex=no
5808 cat > $TMPC << EOF
5809 #include <speex/speex.h>
5810 int main(void) {
5811 SpeexBits bits;
5812 void *dec;
5813 speex_decode_int(dec, &bits, dec);
5816 cc_check -lspeex $_ld_lm && _speex=yes
5818 if test "$_speex" = yes ; then
5819 _def_speex='#define HAVE_SPEEX 1'
5820 _ld_extra="$_ld_extra -lspeex"
5821 _codecmodules="speex $_codecmodules"
5822 else
5823 _def_speex='#undef HAVE_SPEEX'
5824 _nocodecmodules="speex $_nocodecmodules"
5826 echores "$_speex"
5828 echocheck "OggTheora support"
5829 if test "$_theora" = auto ; then
5830 _theora=no
5831 cat > $TMPC << EOF
5832 #include <theora/theora.h>
5833 #include <string.h>
5834 int main(void)
5836 /* theora is in flux, make sure that all interface routines and
5837 * datatypes exist and work the way we expect it, so we don't break
5838 * mplayer */
5839 ogg_packet op;
5840 theora_comment tc;
5841 theora_info inf;
5842 theora_state st;
5843 yuv_buffer yuv;
5844 int r;
5845 double t;
5847 theora_info_init (&inf);
5848 theora_comment_init (&tc);
5850 return 0;
5852 /* we don't want to execute this kind of nonsense; just for making sure
5853 * that compilation works... */
5854 memset(&op, 0, sizeof(op));
5855 r = theora_decode_header (&inf, &tc, &op);
5856 r = theora_decode_init (&st, &inf);
5857 t = theora_granule_time (&st, op.granulepos);
5858 r = theora_decode_packetin (&st, &op);
5859 r = theora_decode_YUVout (&st, &yuv);
5860 theora_clear (&st);
5862 return 0;
5865 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5866 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5867 && _theora=yes && break
5868 done
5869 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5870 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5871 cc_check -I. tremor/bitwise.c $_ld_theora \
5872 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5873 done
5876 if test "$_theora" = yes ; then
5877 _def_theora='#define HAVE_OGGTHEORA 1'
5878 _codecmodules="libtheora $_codecmodules"
5879 # when --enable-theora is forced, we'd better provide a probably sane
5880 # $_ld_theora than nothing
5881 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5882 else
5883 _def_theora='#undef HAVE_OGGTHEORA'
5884 _nocodecmodules="libtheora $_nocodecmodules"
5886 echores "$_theora"
5888 echocheck "internal mp3lib support"
5889 if test "$_mp3lib" = yes ; then
5890 _def_mp3lib='#define USE_MP3LIB 1'
5891 _codecmodules="mp3lib $_codecmodules"
5892 else
5893 _def_mp3lib='#undef USE_MP3LIB'
5894 _nocodecmodules="mp3lib $_nocodecmodules"
5896 echores "$_mp3lib"
5898 echocheck "internal liba52 support"
5899 if test "$_liba52" = yes ; then
5900 _def_liba52='#define USE_LIBA52 1'
5901 _codecmodules="liba52 $_codecmodules"
5902 else
5903 _def_liba52='#undef USE_LIBA52'
5904 _nocodecmodules="liba52 $_nocodecmodules"
5906 echores "$_liba52"
5908 echocheck "libdca support"
5909 if test "$_libdca" = auto ; then
5910 _libdca=no
5911 cat > $TMPC << EOF
5912 #include <inttypes.h>
5913 #include <dts.h>
5914 int main(void) { dts_init (0); return 0; }
5916 cc_check -ldts $_ld_lm && _libdca=yes
5918 if test "$_libdca" = yes ; then
5919 _def_libdca='#define USE_LIBDCA 1'
5920 _ld_extra="$_ld_extra -ldts"
5921 _codecmodules="libdca $_codecmodules"
5922 else
5923 _def_libdca='#undef USE_LIBDCA'
5924 _nocodecmodules="libdca $_nocodecmodules"
5926 echores "$_libdca"
5928 echocheck "internal libmpeg2 support"
5929 if test "$_libmpeg2" = yes ; then
5930 _def_libmpeg2='#define USE_LIBMPEG2 1'
5931 _codecmodules="libmpeg2 $_codecmodules"
5932 else
5933 _def_libmpeg2='#undef USE_LIBMPEG2'
5934 _nocodecmodules="libmpeg2 $_nocodecmodules"
5936 echores "$_libmpeg2"
5938 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5939 if test "$_musepack" = auto ; then
5940 _musepack=no
5941 cat > $TMPC << EOF
5942 #include <mpcdec/mpcdec.h>
5943 int main(void) {
5944 mpc_streaminfo info;
5945 mpc_decoder decoder;
5946 mpc_decoder_set_streaminfo(&decoder, &info);
5947 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5950 cc_check -lmpcdec $_ld_lm && _musepack=yes
5952 if test "$_musepack" = yes ; then
5953 _def_musepack='#define HAVE_MUSEPACK 1'
5954 _ld_extra="$_ld_extra -lmpcdec"
5955 _codecmodules="musepack $_codecmodules"
5956 else
5957 _def_musepack='#undef HAVE_MUSEPACK'
5958 _nocodecmodules="musepack $_nocodecmodules"
5960 echores "$_musepack"
5963 echocheck "FAAC (AAC encoder) support"
5964 if test "$_faac" = auto ; then
5965 cat > $TMPC <<EOF
5966 #include <inttypes.h>
5967 #include <faac.h>
5968 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5970 _faac=no
5971 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5972 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
5973 done
5975 if test "$_faac" = yes ; then
5976 _def_faac="#define HAVE_FAAC 1"
5977 if echo $_libavencoders | grep -q FAAC ; then
5978 _lavc_faac=yes
5979 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
5980 _libs_mplayer="$_libs_mplayer $_ld_faac"
5981 else
5982 _lavc_faac=no
5983 _def_lavc_faac="#undef CONFIG_LIBFAAC"
5985 _codecmodules="faac $_codecmodules"
5986 else
5987 _def_faac="#undef HAVE_FAAC"
5988 _nocodecmodules="faac $_nocodecmodules"
5989 _libavencoders=`echo $_libavencoders | sed -e s/LIBFAAC_ENCODER// `
5991 echores "$_faac (in libavcodec: $_lavc_faac)"
5994 echocheck "FAAD2 (AAC) support"
5995 if test "$_faad_internal" = auto ; then
5996 if x86_32 && test cc_vendor=gnu; then
5997 case $cc_version in
5998 3.1*|3.2) # ICE/insn with these versions
5999 _faad_internal=no
6000 _res_comment="broken gcc"
6003 _faad_internal=yes
6005 esac
6006 else
6007 _faad_internal=yes
6009 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6010 _faad_external=no
6011 cat > $TMPC << EOF
6012 #include <faad.h>
6013 #ifndef FAAD_MIN_STREAMSIZE
6014 #error Too old version
6015 #endif
6016 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6018 cc_check -lfaad $_ld_lm && _faad_external=yes
6021 if test "$_faad_internal" = yes ; then
6022 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6023 _faad=yes
6024 _res_comment="internal floating-point"
6025 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
6026 elif test "$_faad_external" = yes ; then
6027 _faad=yes
6028 _ld_extra="$_ld_extra -lfaad"
6029 else
6030 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6031 _faad=no
6034 if test "$_faad" = yes ; then
6035 _def_faad='#define HAVE_FAAD 1'
6036 _codecmodules="faad2 $_codecmodules"
6037 else
6038 _def_faad='#undef HAVE_FAAD'
6039 _nocodecmodules="faad2 $_nocodecmodules"
6041 echores "$_faad"
6044 echocheck "LADSPA plugin support"
6045 if test "$_ladspa" = auto ; then
6046 cat > $TMPC <<EOF
6047 #include <stdio.h>
6048 #include <ladspa.h>
6049 int main(void) {
6050 const LADSPA_Descriptor *ld = NULL;
6051 return 0;
6054 _ladspa=no
6055 cc_check && _ladspa=yes
6057 if test "$_ladspa" = yes; then
6058 _def_ladspa="#define HAVE_LADSPA"
6059 _afsrc="$_afsrc af_ladspa.c"
6060 _afmodules="ladspa $_afmodules"
6061 else
6062 _def_ladspa="#undef HAVE_LADSPA"
6063 _noafmodules="ladspa $_noafmodules"
6065 echores "$_ladspa"
6068 if test -z "$_codecsdir" ; then
6069 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6070 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6071 if test -d "$dir" ; then
6072 _codecsdir="$dir"
6073 break;
6075 done
6077 # Fall back on default directory.
6078 if test -z "$_codecsdir" ; then
6079 _codecsdir="$_libdir/codecs"
6080 mingw32 && _codecsdir="codecs"
6084 echocheck "Win32 codecs"
6085 if test "$_win32dll" = auto ; then
6086 _win32dll=no
6087 if x86_32 && not qnx; then
6088 _win32dll=yes
6091 if test "$_win32dll" = yes ; then
6092 _def_win32dll='#define USE_WIN32DLL 1'
6093 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6094 _res_comment="using $_win32codecsdir"
6095 if not win32 ; then
6096 _def_win32_loader='#define WIN32_LOADER 1'
6097 else
6098 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6099 _res_comment="using native windows"
6101 _codecmodules="win32 $_codecmodules"
6102 else
6103 _def_win32dll='#undef USE_WIN32DLL'
6104 _def_win32_loader='#undef WIN32_LOADER'
6105 _nocodecmodules="win32 $_nocodecmodules"
6107 echores "$_win32dll"
6110 echocheck "XAnim codecs"
6111 if test "$_xanim" = auto ; then
6112 _xanim=no
6113 _res_comment="dynamic loader support needed"
6114 if test "$_dl" = yes ; then
6115 _xanim=yes
6118 if test "$_xanim" = yes ; then
6119 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6120 _def_xanim='#define USE_XANIM 1'
6121 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6122 _codecmodules="xanim $_codecmodules"
6123 _res_comment="using $_xanimcodecsdir"
6124 else
6125 _def_xanim='#undef USE_XANIM'
6126 _def_xanim_path='#undef XACODEC_PATH'
6127 _nocodecmodules="xanim $_nocodecmodules"
6129 echores "$_xanim"
6132 echocheck "RealPlayer codecs"
6133 if test "$_real" = auto ; then
6134 _real=no
6135 _res_comment="dynamic loader support needed"
6136 if test "$_dl" = yes || test "$_win32dll" = yes &&
6137 (linux || freebsd || netbsd || win32 || darwin) ; then
6138 _real=yes
6141 if test "$_real" = yes ; then
6142 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6143 _def_real='#define USE_REALCODECS 1'
6144 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6145 _codecmodules="real $_codecmodules"
6146 _res_comment="using $_realcodecsdir"
6147 else
6148 _def_real='#undef USE_REALCODECS'
6149 _def_real_path="#undef REALCODEC_PATH"
6150 _nocodecmodules="real $_nocodecmodules"
6152 echores "$_real"
6155 echocheck "QuickTime codecs"
6156 if test "$_qtx" = auto ; then
6157 test "$_win32dll" = yes || darwin && _qtx=yes
6159 if test "$_qtx" = yes ; then
6160 _def_qtx='#define USE_QTX_CODECS 1'
6161 _codecmodules="qtx $_codecmodules"
6162 else
6163 _def_qtx='#undef USE_QTX_CODECS'
6164 _nocodecmodules="qtx $_nocodecmodules"
6166 echores "$_qtx"
6169 echocheck "LIVE555 Streaming Media libraries"
6170 if test "$_live" = auto && test "$_network" = yes ; then
6171 cat > $TMPCPP << EOF
6172 #include <liveMedia.hh>
6173 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6174 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6175 #endif
6176 int main(void) {}
6179 _live=no
6180 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6181 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6182 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6183 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6184 $_livelibdir/groupsock/libgroupsock.a \
6185 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6186 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6187 $_ld_extra -lstdc++" \
6188 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6189 -I$_livelibdir/UsageEnvironment/include \
6190 -I$_livelibdir/BasicUsageEnvironment/include \
6191 -I$_livelibdir/groupsock/include" && \
6192 _live=yes && break
6193 done
6194 if test "$_live" != yes ; then
6195 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6196 _live_dist=yes
6200 if test "$_live" = yes && test "$_network" = yes ; then
6201 _res_comment="using $_livelibdir"
6202 _def_live='#define STREAMING_LIVE555 1'
6203 _inputmodules="live555 $_inputmodules"
6204 elif test "$_live_dist" = yes && test "$_network" = yes ; then
6205 _res_comment="using distribution version"
6206 _live="yes"
6207 _def_live='#define STREAMING_LIVE555 1'
6208 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6209 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6210 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6211 _inputmodules="live555 $_inputmodules"
6212 else
6213 _def_live='#undef STREAMING_LIVE555'
6214 _noinputmodules="live555 $_noinputmodules"
6216 echores "$_live"
6219 echocheck "FFmpeg libavutil"
6220 if test "$_libavutil_a" = auto ; then
6221 if test -d libavutil ; then
6222 _libavutil_a=yes
6223 _res_comment="static"
6224 else
6225 die "MPlayer will not compile without libavutil in the source tree."
6227 elif test "$_libavutil_so" = auto ; then
6228 _libavutil_so=no
6229 cat > $TMPC << EOF
6230 #include <ffmpeg/common.h>
6231 int main(void) { ff_gcd(1,1); return 0; }
6233 if $_pkg_config --exists libavutil ; then
6234 _inc_libavutil=`$_pkg_config --cflags libavutil`
6235 _ld_tmp=`$_pkg_config --libs libavutil`
6236 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6237 && _libavutil_so=yes
6238 elif cc_check -lavutil $_ld_lm ; then
6239 _ld_extra="$_ld_extra -lavutil"
6240 _libavutil_so=yes
6241 _res_comment="using libavutil.so, but static libavutil is recommended"
6244 _libavutil=no
6245 _def_libavutil='#undef USE_LIBAVUTIL'
6246 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6247 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6248 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6249 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6250 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6251 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6252 # neither static nor shared libavutil is available, but it is mandatory ...
6253 if test "$_libavutil" = no ; then
6254 die "You need static or shared libavutil, MPlayer will not compile without!"
6256 echores "$_libavutil"
6258 echocheck "FFmpeg libavcodec"
6259 if test "$_libavcodec_a" = auto ; then
6260 _libavcodec_a=no
6261 if test -d libavcodec && test -f libavcodec/utils.c ; then
6262 _libavcodec_a="yes"
6263 _res_comment="static"
6265 elif test "$_libavcodec_so" = auto ; then
6266 _libavcodec_so=no
6267 _res_comment="libavcodec.so is discouraged over static libavcodec"
6268 cat > $TMPC << EOF
6269 #include <ffmpeg/avcodec.h>
6270 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6272 if $_pkg_config --exists libavcodec ; then
6273 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6274 _ld_tmp=`$_pkg_config --libs libavcodec`
6275 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6276 && _libavcodec_so=yes
6277 elif cc_check -lavcodec $_ld_lm ; then
6278 _ld_extra="$_ld_extra -lavcodec"
6279 _libavcodec_so=yes
6280 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6283 _libavcodec=no
6284 _def_libavcodec='#undef USE_LIBAVCODEC'
6285 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6286 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6287 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6288 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6289 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6290 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6291 test "$_libavcodec_mpegaudio_hp" = yes \
6292 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6293 if test "$_libavcodec_a" = yes ; then
6294 _codecmodules="libavcodec $_codecmodules"
6295 elif test "$_libavcodec_so" = yes ; then
6296 _codecmodules="libavcodec.so $_codecmodules"
6297 else
6298 _nocodecmodules="libavcodec $_nocodecmodules"
6300 echores "$_libavcodec"
6302 echocheck "FFmpeg libavformat"
6303 if test "$_libavformat_a" = auto ; then
6304 _libavformat_a=no
6305 if test -d libavformat && test -f libavformat/utils.c ; then
6306 _libavformat_a=yes
6307 _res_comment="static"
6309 elif test "$_libavformat_so" = auto ; then
6310 _libavformat_so=no
6311 cat > $TMPC <<EOF
6312 #include <ffmpeg/avformat.h>
6313 #include <ffmpeg/opt.h>
6314 int main(void) { av_alloc_format_context(); return 0; }
6316 if $_pkg_config --exists libavformat ; then
6317 _inc_libavformat=`$_pkg_config --cflags libavformat`
6318 _ld_tmp=`$_pkg_config --libs libavformat`
6319 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6320 && _libavformat_so=yes
6321 elif cc_check $_ld_lm -lavformat ; then
6322 _ld_extra="$_ld_extra -lavformat"
6323 _libavformat_so=yes
6324 _res_comment="using libavformat.so, but static libavformat is recommended"
6327 _libavformat=no
6328 _def_libavformat='#undef USE_LIBAVFORMAT'
6329 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6330 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6331 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6332 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6333 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6334 test "$_libavformat_so" = yes \
6335 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6336 echores "$_libavformat"
6338 echocheck "FFmpeg libpostproc"
6339 if test "$_libpostproc_a" = auto ; then
6340 _libpostproc_a=no
6341 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6342 _libpostproc_a='yes'
6343 _res_comment="static"
6345 elif test "$_libpostproc_so" = auto ; then
6346 _libpostproc_so=no
6347 cat > $TMPC << EOF
6348 #define USE_LIBPOSTPROC 1
6349 #include <inttypes.h>
6350 #include <postproc/postprocess.h>
6351 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6353 if cc_check -lpostproc $_ld_lm ; then
6354 _ld_extra="$_ld_extra -lpostproc"
6355 _libpostproc_so=yes
6356 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6359 _libpostproc=no
6360 _def_libpostproc='#undef USE_LIBPOSTPROC'
6361 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6362 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6363 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6364 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6365 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6366 test "$_libpostproc_so" = yes \
6367 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6368 echores "$_libpostproc"
6371 echocheck "libamr narrowband"
6372 if test "$_libamr_nb" = auto ; then
6373 _libamr_nb=no
6374 cat > $TMPC << EOF
6375 #include <amrnb/interf_dec.h>
6376 int main(void) { Speech_Decode_Frame_init(); return 0; }
6378 cc_check -lamrnb && _libamr_nb=yes
6379 if test "$_libavcodec_a" != yes ; then
6380 _libamr_nb=no
6381 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6384 if test "$_libamr_nb" = yes ; then
6385 _libamr=yes
6386 _ld_extra="$_ld_extra -lamrnb"
6387 _def_libamr='#define CONFIG_LIBAMR 1'
6388 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6389 _codecmodules="libamr_nb $_codecmodules"
6390 else
6391 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6392 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6393 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6394 _nocodecmodules="libamr_nb $_nocodecmodules"
6396 echores "$_libamr_nb"
6399 echocheck "libamr wideband"
6400 if test "$_libamr_wb" = auto ; then
6401 _libamr_wb=no
6402 cat > $TMPC << EOF
6403 #include <amrwb/dec_if.h>
6404 int main(void) { D_IF_init(); return 0; }
6406 cc_check -lamrwb && _libamr_wb=yes
6407 if test "$_libavcodec_a" != yes ; then
6408 _libamr_wb=no
6409 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6412 if test "$_libamr_wb" = yes ; then
6413 _libamr=yes
6414 _ld_extra="$_ld_extra -lamrwb"
6415 _def_libamr='#define CONFIG_LIBAMR 1'
6416 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6417 _codecmodules="libamr_wb $_codecmodules"
6418 else
6419 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6420 _nocodecmodules="libamr_wb $_nocodecmodules"
6421 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6422 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6424 echores "$_libamr_wb"
6426 echocheck "libdv-0.9.5+"
6427 if test "$_libdv" = auto ; then
6428 _libdv=no
6429 cat > $TMPC <<EOF
6430 #include <libdv/dv.h>
6431 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6433 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6435 if test "$_libdv" = yes ; then
6436 _def_libdv='#define HAVE_LIBDV095 1'
6437 _ld_extra="$_ld_extra -ldv"
6438 _codecmodules="libdv $_codecmodules"
6439 else
6440 _def_libdv='#undef HAVE_LIBDV095'
6441 _nocodecmodules="libdv $_nocodecmodules"
6443 echores "$_libdv"
6446 echocheck "XviD"
6447 if test "$_xvid" = auto ; then
6448 _xvid=no
6449 cat > $TMPC << EOF
6450 #include <xvid.h>
6451 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6453 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6454 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6455 done
6458 if test "$_xvid" = yes ; then
6459 _def_xvid='#define HAVE_XVID4 1'
6460 _codecmodules="xvid $_codecmodules"
6461 else
6462 _def_xvid='#undef HAVE_XVID4'
6463 _nocodecmodules="xvid $_nocodecmodules"
6464 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6466 echores "$_xvid"
6468 if test "$_xvid" = yes ; then
6469 echocheck "XviD two pass plugin"
6470 cat > $TMPC << EOF
6471 #include <xvid.h>
6472 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6474 if cc_check ; then
6475 _lavc_xvid=yes
6476 _def_lavc_xvid='#define CONFIG_LIBXVID 1'
6477 else
6478 _lavc_xvid=no
6479 _def_lavc_xvid='#undef CONFIG_LIBXVID'
6480 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6482 echores "$_lavc_xvid"
6486 echocheck "x264"
6487 if test "$_x264" = auto ; then
6488 cat > $TMPC << EOF
6489 #include <inttypes.h>
6490 #include <x264.h>
6491 #if X264_BUILD < 53
6492 #error We do not support old versions of x264. Get the latest from SVN.
6493 #endif
6494 int main(void) { x264_encoder_open((void*)0); return 0; }
6496 _x264=no
6497 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6498 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6499 done
6502 if test "$_x264" = yes ; then
6503 _x264=yes
6504 _def_x264='#define HAVE_X264 1'
6505 _codecmodules="x264 $_codecmodules"
6506 if echo $_libavencoders | grep -q X264 ; then
6507 _lavc_x264=yes
6508 _def_lavc_x264='#define CONFIG_LIBX264 1'
6509 _libs_mplayer="$_libs_mplayer $_ld_x264"
6510 else
6511 _lavc_x264=no
6512 _def_lavc_x264='#undef CONFIG_LIBX264'
6514 else
6515 _x264=no
6516 _lavc_x264=no
6517 _def_x264='#undef HAVE_X264'
6518 _def_lavc_x264='#undef CONFIG_LIBX264'
6519 _nocodecmodules="x264 $_nocodecmodules"
6520 _libavencoders=`echo $_libavencoders | sed -e s/LIBX264_ENCODER// `
6522 echores "$_x264 (in libavcodec: $_lavc_x264)"
6525 echocheck "libnut"
6526 if test "$_libnut" = auto ; then
6527 cat > $TMPC << EOF
6528 #include <stdio.h>
6529 #include <stdlib.h>
6530 #include <inttypes.h>
6531 #include <libnut.h>
6532 int main(void) { (void)nut_error(0); return 0; }
6534 _libnut=no
6535 cc_check -lnut && _libnut=yes
6538 if test "$_libnut" = yes ; then
6539 _def_libnut='#define HAVE_LIBNUT 1'
6540 _ld_extra="$_ld_extra -lnut"
6541 else
6542 _def_libnut='#undef HAVE_LIBNUT'
6543 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6545 echores "$_libnut"
6548 # mencoder requires (optional) those libs: libmp3lame
6549 if test "$_mencoder" != no ; then
6551 echocheck "libmp3lame (for mencoder)"
6552 _mp3lame=no
6553 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6554 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6555 cat > $TMPC <<EOF
6556 #include <lame/lame.h>
6557 int main(void) { lame_version_t lv; (void) lame_init(); get_lame_version_numerical(&lv); printf("%d%d\n",lv.major,lv.minor); return 0; }
6559 # Note: libmp3lame usually depends on vorbis
6560 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6561 if test "$_mp3lame" = yes ; then
6562 _def_mp3lame="#define HAVE_MP3LAME"
6563 _ld_mp3lame=-lmp3lame
6564 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6565 cat > $TMPC << EOF
6566 #include <lame/lame.h>
6567 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6569 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6570 cat > $TMPC << EOF
6571 #include <lame/lame.h>
6572 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6574 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6575 if echo $_libavencoders | grep -q MP3LAME ; then
6576 _lavc_mp3lame=yes
6577 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6578 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6579 else
6580 _lavc_mp3lame=no
6581 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6583 else
6584 _def_mp3lame='#undef HAVE_MP3LAME'
6585 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6587 echores "$_mp3lame"
6591 echocheck "mencoder"
6592 _mencoder_flag='#undef HAVE_MENCODER'
6593 if test "$_mencoder" = yes ; then
6594 _mencoder_flag='#define HAVE_MENCODER'
6595 _def_muxers='#define CONFIG_MUXERS 1'
6596 else
6597 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6598 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6599 _libavmuxers=""
6601 echores "$_mencoder"
6603 echocheck "fastmemcpy"
6604 # fastmemcpy check is done earlier with tests of CPU & binutils features
6605 if test "$_fastmemcpy" = yes ; then
6606 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6607 else
6608 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6610 echores "$_fastmemcpy"
6612 echocheck "UniquE RAR File Library"
6613 if test "$_unrarlib" = yes ; then
6614 _def_unrarlib='#define USE_UNRARLIB 1'
6615 else
6616 _def_unrarlib='#undef USE_UNRARLIB'
6618 echores "$_unrarlib"
6620 echocheck "TV interface"
6621 if test "$_tv" = yes ; then
6622 _def_tv='#define USE_TV 1'
6623 _inputmodules="tv $_inputmodules"
6624 else
6625 _noinputmodules="tv $_noinputmodules"
6626 _def_tv='#undef USE_TV'
6628 echores "$_tv"
6631 if bsd; then
6632 echocheck "*BSD BT848 bt8xx header"
6633 _ioctl_bt848_h=no
6634 for file in "machine/ioctl_bt848.h" \
6635 "dev/bktr/ioctl_bt848.h" \
6636 "dev/video/bktr/ioctl_bt848.h" \
6637 "dev/ic/bt8xx.h" ; do
6638 cat > $TMPC <<EOF
6639 #include <sys/types.h>
6640 #include <$file>
6641 int main(void) {
6642 ioctl(0, TVTUNER_GETFREQ, 0);
6643 return 0;
6646 if cc_check ; then
6647 _ioctl_bt848_h=yes
6648 _ioctl_bt848_h_name="$file"
6649 break;
6651 done
6652 if test "$_ioctl_bt848_h" = yes ; then
6653 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6654 _res_comment="using $_ioctl_bt848_h_name"
6655 else
6656 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6658 echores "$_ioctl_bt848_h"
6660 echocheck "*BSD ioctl_meteor.h"
6661 _ioctl_meteor_h=no
6662 for file in "machine/ioctl_meteor.h" \
6663 "dev/bktr/ioctl_meteor.h" \
6664 "dev/video/bktr/ioctl_meteor.h" ; do
6665 cat > $TMPC <<EOF
6666 #include <sys/types.h>
6667 #include <$file>
6668 int main(void) {
6669 ioctl(0, METEORSINPUT, 0);
6670 return 0;
6673 if cc_check ; then
6674 _ioctl_meteor_h=yes
6675 _ioctl_meteor_h_name="$file"
6676 break;
6678 done
6679 if test "$_ioctl_meteor_h" = yes ; then
6680 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6681 _res_comment="using $_ioctl_meteor_h_name"
6682 else
6683 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6685 echores "$_ioctl_meteor_h"
6687 echocheck "*BSD BrookTree 848 TV interface"
6688 if test "$_tv_bsdbt848" = auto ; then
6689 _tv_bsdbt848=no
6690 if test "$_tv" = yes ; then
6691 cat > $TMPC <<EOF
6692 #include <sys/types.h>
6693 $_def_ioctl_meteor_h_name
6694 $_def_ioctl_bt848_h_name
6695 #ifdef IOCTL_METEOR_H_NAME
6696 #include IOCTL_METEOR_H_NAME
6697 #endif
6698 #ifdef IOCTL_BT848_H_NAME
6699 #include IOCTL_BT848_H_NAME
6700 #endif
6701 int main(void){
6702 ioctl(0, METEORSINPUT, 0);
6703 ioctl(0, TVTUNER_GETFREQ, 0);
6704 return 0;
6707 cc_check && _tv_bsdbt848=yes
6710 if test "$_tv_bsdbt848" = yes ; then
6711 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6712 _inputmodules="tv-bsdbt848 $_inputmodules"
6713 else
6714 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6715 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6717 echores "$_tv_bsdbt848"
6718 fi #if bsd
6721 echocheck "Video 4 Linux TV interface"
6722 if test "$_tv_v4l1" = auto ; then
6723 _tv_v4l1=no
6724 if test "$_tv" = yes && linux ; then
6725 cat > $TMPC <<EOF
6726 #include <stdlib.h>
6727 #include <linux/videodev.h>
6728 int main(void) { return 0; }
6730 cc_check && _tv_v4l1=yes
6733 if test "$_tv_v4l1" = yes ; then
6734 _audio_input=yes
6735 _tv_v4l=yes
6736 _def_tv_v4l='#define HAVE_TV_V4L 1'
6737 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6738 _inputmodules="tv-v4l $_inputmodules"
6739 else
6740 _noinputmodules="tv-v4l1 $_noinputmodules"
6741 _def_tv_v4l='#undef HAVE_TV_V4L'
6743 echores "$_tv_v4l1"
6746 echocheck "Video 4 Linux 2 TV interface"
6747 if test "$_tv_v4l2" = auto ; then
6748 _tv_v4l2=no
6749 if test "$_tv" = yes && linux ; then
6750 cat > $TMPC <<EOF
6751 #include <stdlib.h>
6752 #include <linux/types.h>
6753 #include <linux/videodev2.h>
6754 int main(void) { return 0; }
6756 cc_check && _tv_v4l2=yes
6759 if test "$_tv_v4l2" = yes ; then
6760 _audio_input=yes
6761 _tv_v4l=yes
6762 _def_tv_v4l='#define HAVE_TV_V4L 1'
6763 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6764 _inputmodules="tv-v4l2 $_inputmodules"
6765 else
6766 _noinputmodules="tv-v4l2 $_noinputmodules"
6767 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6769 echores "$_tv_v4l2"
6772 echocheck "TV teletext interface"
6773 if test "$_tv_teletext" = auto ; then
6774 _tv_teletext=no
6775 if test "$_freetype" = yes ; then
6776 if test "$_tv_v4l2" = yes || test "$_v4l" = yes ; then
6777 _tv_teletext=yes
6781 if test "$_tv_teletext" = yes ; then
6782 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6783 _inputmodules="tv-teletext $_inputmodules"
6784 else
6785 _noinputmodules="tv-teletext $_noinputmodules"
6786 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6788 echores "$_tv_teletext"
6791 echocheck "Radio interface"
6792 if test "$_radio" = yes ; then
6793 _def_radio='#define USE_RADIO 1'
6794 _inputmodules="radio $_inputmodules"
6795 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6796 _radio_capture=no
6798 if test "$_radio_capture" = yes ; then
6799 _audio_input=yes
6800 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6801 else
6802 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6804 else
6805 _noinputmodules="radio $_noinputmodules"
6806 _def_radio='#undef USE_RADIO'
6807 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6808 _radio_capture=no
6810 echores "$_radio"
6811 echocheck "Capture for Radio interface"
6812 echores "$_radio_capture"
6814 echocheck "Video 4 Linux 2 Radio interface"
6815 if test "$_radio_v4l2" = auto ; then
6816 _radio_v4l2=no
6817 if test "$_radio" = yes && linux ; then
6818 cat > $TMPC <<EOF
6819 #include <stdlib.h>
6820 #include <linux/types.h>
6821 #include <linux/videodev2.h>
6822 int main(void) { return 0; }
6824 cc_check && _radio_v4l2=yes
6827 if test "$_radio_v4l2" = yes ; then
6828 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6829 else
6830 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6832 echores "$_radio_v4l2"
6834 echocheck "Video 4 Linux Radio interface"
6835 if test "$_radio_v4l" = auto ; then
6836 _radio_v4l=no
6837 if test "$_radio" = yes && linux ; then
6838 cat > $TMPC <<EOF
6839 #include <stdlib.h>
6840 #include <linux/videodev.h>
6841 int main(void) { return 0; }
6843 cc_check && _radio_v4l=yes
6846 if test "$_radio_v4l" = yes ; then
6847 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6848 else
6849 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6851 echores "$_radio_v4l"
6853 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6854 echocheck "*BSD BrookTree 848 Radio interface"
6855 _radio_bsdbt848=no
6856 cat > $TMPC <<EOF
6857 #include <sys/types.h>
6858 $_def_ioctl_bt848_h_name
6859 #ifdef IOCTL_BT848_H_NAME
6860 #include IOCTL_BT848_H_NAME
6861 #endif
6862 int main(void){
6863 ioctl(0, RADIO_GETFREQ, 0);
6864 return 0;
6867 cc_check && _radio_bsdbt848=yes
6868 echores "$_radio_bsdbt848"
6869 fi #if bsd && radio && radio_bsdbt848
6871 if test "$_radio_bsdbt848" = yes ; then
6872 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
6873 else
6874 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
6877 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6878 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6879 die "Radio driver requires BSD BT848, V4L or V4L2!"
6882 echocheck "Video 4 Linux 2 MPEG PVR interface"
6883 if test "$_pvr" = auto ; then
6884 _pvr=no
6885 if test "$_tv_v4l2" = yes && linux ; then
6886 cat > $TMPC <<EOF
6887 #include <stdlib.h>
6888 #include <inttypes.h>
6889 #include <linux/types.h>
6890 #include <linux/videodev2.h>
6891 int main(void) { struct v4l2_ext_controls ext; return 0; }
6893 cc_check && _pvr=yes
6896 if test "$_pvr" = yes ; then
6897 _def_pvr='#define HAVE_PVR 1'
6898 _inputmodules="pvr $_inputmodules"
6899 else
6900 _noinputmodules="pvr $_noinputmodules"
6901 _def_pvr='#undef HAVE_PVR'
6903 echores "$_pvr"
6906 echocheck "audio select()"
6907 if test "$_select" = no ; then
6908 _def_select='#undef HAVE_AUDIO_SELECT'
6909 elif test "$_select" = yes ; then
6910 _def_select='#define HAVE_AUDIO_SELECT 1'
6912 echores "$_select"
6915 echocheck "ftp"
6916 if not beos && test "$_ftp" = yes ; then
6917 _def_ftp='#define HAVE_FTP 1'
6918 _inputmodules="ftp $_inputmodules"
6919 else
6920 _noinputmodules="ftp $_noinputmodules"
6921 _def_ftp='#undef HAVE_FTP'
6923 echores "$_ftp"
6925 echocheck "vstream client"
6926 if test "$_vstream" = auto ; then
6927 _vstream=no
6928 cat > $TMPC <<EOF
6929 #include <vstream-client.h>
6930 void vstream_error(const char *format, ... ) {}
6931 int main(void) { vstream_start(); return 0; }
6933 cc_check -lvstream-client && _vstream=yes
6935 if test "$_vstream" = yes ; then
6936 _def_vstream='#define HAVE_VSTREAM 1'
6937 _inputmodules="vstream $_inputmodules"
6938 _ld_extra="$_ld_extra -lvstream-client"
6939 else
6940 _noinputmodules="vstream $_noinputmodules"
6941 _def_vstream='#undef HAVE_VSTREAM'
6943 echores "$_vstream"
6945 # endian testing
6946 echocheck "byte order"
6947 if test "$_big_endian" = auto ; then
6948 cat > $TMPC <<EOF
6949 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6950 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6951 int main(){
6952 return (int)ascii_name;
6955 if cc_check ; then
6956 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6957 _big_endian=yes
6958 else
6959 _big_endian=no
6961 else
6962 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
6965 if test "$_big_endian" = yes ; then
6966 _byte_order='big-endian'
6967 _def_words_endian='#define WORDS_BIGENDIAN 1'
6968 else
6969 _byte_order='little-endian'
6970 _def_words_endian='#undef WORDS_BIGENDIAN'
6972 echores "$_byte_order"
6974 echocheck "OSD menu"
6975 if test "$_menu" = yes ; then
6976 _def_menu='#define HAVE_MENU 1'
6977 else
6978 _def_menu='#undef HAVE_MENU'
6980 echores "$_menu"
6983 echocheck "Subtitles sorting"
6984 if test "$_sortsub" = yes ; then
6985 _def_sortsub='#define USE_SORTSUB 1'
6986 else
6987 _def_sortsub='#undef USE_SORTSUB'
6989 echores "$_sortsub"
6992 echocheck "XMMS inputplugin support"
6993 if test "$_xmms" = yes ; then
6994 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6995 _xmmsplugindir=`xmms-config --input-plugin-dir`
6996 _xmmslibdir=`xmms-config --exec-prefix`/lib
6997 else
6998 _xmmsplugindir=/usr/lib/xmms/Input
6999 _xmmslibdir=/usr/lib
7002 _def_xmms='#define HAVE_XMMS 1'
7003 if darwin ; then
7004 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7005 else
7006 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7008 else
7009 _def_xmms='#undef HAVE_XMMS'
7011 echores "$_xmms"
7013 echocheck "inet6"
7014 if test "$_inet6" = auto ; then
7015 cat > $TMPC << EOF
7016 #include <sys/types.h>
7017 #include <sys/socket.h>
7018 #include <netinet/in.h>
7019 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7021 _inet6=no
7022 if cc_check ; then
7023 _inet6=yes
7026 if test "$_inet6" = yes ; then
7027 _def_inet6='#define HAVE_AF_INET6 1'
7028 else
7029 _def_inet6='#undef HAVE_AF_INET6'
7031 echores "$_inet6"
7034 echocheck "gethostbyname2"
7035 if test "$_gethostbyname2" = auto ; then
7036 cat > $TMPC << EOF
7037 #include <sys/types.h>
7038 #include <sys/socket.h>
7039 #include <netdb.h>
7040 int main(void) { gethostbyname2("", AF_INET); }
7042 _gethostbyname2=no
7043 if cc_check ; then
7044 _gethostbyname2=yes
7048 if test "$_gethostbyname2" = yes ; then
7049 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7050 else
7051 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7053 echores "$_gethostbyname2"
7056 # --------------- GUI specific tests begin -------------------
7057 echocheck "GUI"
7058 echo "$_gui"
7059 if test "$_gui" = yes ; then
7061 # Required libraries
7062 if test "$_libavcodec" != yes ||
7063 not "echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1" ; then
7064 die "The GUI requires libavcodec with PNG support."
7066 if not win32 ; then
7067 test "$_x11" != yes && die "X11 support required for GUI compilation."
7069 echocheck "XShape extension"
7070 if test "$_xshape" = auto ; then
7071 _xshape=no
7072 cat > $TMPC << EOF
7073 #include <X11/Xlib.h>
7074 #include <X11/Xproto.h>
7075 #include <X11/Xutil.h>
7076 #include <X11/extensions/shape.h>
7077 #include <stdlib.h>
7078 int main(void) {
7079 char *name = ":0.0";
7080 Display *wsDisplay;
7081 int exitvar = 0;
7082 int eventbase, errorbase;
7083 if (getenv("DISPLAY"))
7084 name=getenv("DISPLAY");
7085 wsDisplay=XOpenDisplay(name);
7086 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7087 exitvar=1;
7088 XCloseDisplay(wsDisplay);
7089 return exitvar;
7092 cc_check && _xshape=yes
7094 if test "$_xshape" = yes ; then
7095 _def_xshape='#define HAVE_XSHAPE 1'
7096 else
7097 die "The GUI requires the X11 extension XShape (which was not found)."
7099 echores "$_xshape"
7101 #Check for GTK
7102 if test "$_gtk1" = no ; then
7103 #Check for GTK2 :
7104 echocheck "GTK+ version"
7106 if $_pkg_config gtk+-2.0 --exists ; then
7107 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7108 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7109 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7110 echores "$_gtk"
7112 # Check for GLIB2
7113 if $_pkg_config glib-2.0 --exists ; then
7114 echocheck "glib version"
7115 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7116 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7117 echores "$_glib"
7119 _def_gui='#define HAVE_NEW_GUI 1'
7120 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7121 else
7122 _gtk1=yes
7123 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7125 else
7126 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7127 _gtk1=yes
7131 if test "$_gtk1" = yes ; then
7132 # Check for old GTK (1.2.x)
7133 echocheck "GTK version"
7134 if test -z "$_gtkconfig" ; then
7135 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7136 _gtkconfig="gtk-config"
7137 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7138 _gtkconfig="gtk12-config"
7139 else
7140 die "The GUI requires GTK devel packages (which were not found)."
7143 _gtk=`$_gtkconfig --version 2>&1`
7144 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7145 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7146 echores "$_gtk (using $_gtkconfig)"
7148 # Check for GLIB
7149 echocheck "glib version"
7150 if test -z "$_glibconfig" ; then
7151 if ( glib-config --version ) >/dev/null 2>&1 ; then
7152 _glibconfig="glib-config"
7153 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7154 _glibconfig="glib12-config"
7155 else
7156 die "The GUI requires GLIB devel packages (which were not found)"
7159 _glib=`$_glibconfig --version 2>&1`
7160 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7161 echores "$_glib (using $_glibconfig)"
7163 _def_gui='#define HAVE_NEW_GUI 1'
7164 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7167 else #if not win32
7168 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7169 _def_gui='#define HAVE_NEW_GUI 1'
7170 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7171 fi #if not win32
7173 else #if test "$_gui"
7174 _def_gui='#undef HAVE_NEW_GUI'
7175 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7176 fi #if test "$_gui"
7177 # --------------- GUI specific tests end -------------------
7180 if test "$_charset" = "noconv" ; then
7181 _charset=""
7183 if test "$_charset" ; then
7184 _def_charset="#define MSG_CHARSET \"$_charset\""
7185 else
7186 _def_charset="#undef MSG_CHARSET"
7189 if test "$_charset" = "UTF-8" ; then
7190 # hack to disable conversion in the Makefile
7191 _charset=""
7194 if test "$_charset" ; then
7195 echocheck "iconv program"
7196 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7197 if test "$?" -ne 0 ; then
7198 echores "no"
7199 echo "No working iconv program found, use "
7200 echo "--charset=UTF-8 to continue anyway."
7201 echo "If you also have problems with iconv library functions use --charset=noconv."
7202 echo "Messages in the GTK-2 interface will be broken then."
7203 exit 1
7204 else
7205 echores "yes"
7209 #############################################################################
7211 echocheck "automatic gdb attach"
7212 if test "$_crash_debug" = yes ; then
7213 _def_crash_debug='#define CRASH_DEBUG 1'
7214 else
7215 _def_crash_debug='#undef CRASH_DEBUG'
7216 _crash_debug=no
7218 echores "$_crash_debug"
7220 echocheck "compiler support for noexecstack"
7221 cat > $TMPC <<EOF
7222 int main(void) { return 0; }
7224 if cc_check -Wl,-z,noexecstack ; then
7225 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7226 echores "yes"
7227 else
7228 echores "no"
7232 # Dynamic linking flags
7233 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7234 _ld_dl_dynamic=''
7235 bsd && _ld_dl_dynamic='-rdynamic'
7236 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7237 _ld_dl_dynamic='-rdynamic'
7240 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7241 bsdos && _ld_extra="$_ld_extra -ldvd"
7242 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7243 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7245 _def_debug='#undef MP_DEBUG'
7246 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7248 _def_linux='#undef TARGET_LINUX'
7249 linux && _def_linux='#define TARGET_LINUX 1'
7252 echocheck "joystick"
7253 _def_joystick='#undef HAVE_JOYSTICK'
7254 if test "$_joystick" = yes ; then
7255 if linux ; then
7256 # TODO add some check
7257 _def_joystick='#define HAVE_JOYSTICK 1'
7258 else
7259 _joystick="no (unsupported under $system_name)"
7262 echores "$_joystick"
7264 echocheck "lirc"
7265 if test "$_lirc" = auto ; then
7266 _lirc=no
7267 cat > $TMPC <<EOF
7268 #include <lirc/lirc_client.h>
7269 int main(void) { return 0; }
7271 cc_check -llirc_client && _lirc=yes
7273 if test "$_lirc" = yes ; then
7274 _def_lirc='#define HAVE_LIRC 1'
7275 _ld_extra="$_ld_extra -llirc_client"
7276 else
7277 _def_lirc='#undef HAVE_LIRC'
7279 echores "$_lirc"
7281 echocheck "lircc"
7282 if test "$_lircc" = auto ; then
7283 _lircc=no
7284 cat > $TMPC <<EOF
7285 #include <lirc/lircc.h>
7286 int main(void) { return 0; }
7288 cc_check -llircc && _lircc=yes
7290 if test "$_lircc" = yes ; then
7291 _def_lircc='#define HAVE_LIRCC 1'
7292 _ld_extra="$_ld_extra -llircc"
7293 else
7294 _def_lircc='#undef HAVE_LIRCC'
7296 echores "$_lircc"
7298 if arm; then
7299 # Detect maemo development platform libraries availability (http://www.maemo.org),
7300 # they are used when run on Nokia 770
7301 echocheck "maemo (Nokia 770)"
7302 if test "$_maemo" = auto ; then
7303 _maemo=no
7304 cat > $TMPC << EOF
7305 #include <libosso.h>
7306 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7308 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7310 if test "$_maemo" = yes ; then
7311 _def_maemo='#define HAVE_MAEMO 1'
7312 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7313 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7314 else
7315 _def_maemo='#undef HAVE_MAEMO'
7317 echores "$_maemo"
7320 echocheck "color console output"
7321 if test "$_color_console" = yes ; then
7322 _def_color_console='#define MSG_USE_COLORS 1'
7323 else
7324 _def_color_console='#undef MSG_USE_COLORS'
7326 echores "$_color_console"
7328 # linker paths should be the same for mencoder and mplayer
7329 _ld_tmp=""
7330 for I in $_libs_mplayer ; do
7331 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7332 if test -z "$_tmp" ; then
7333 _ld_extra="$I $_ld_extra"
7334 else
7335 _ld_tmp="$_ld_tmp $I"
7337 done
7338 _libs_mplayer=$_ld_tmp
7341 #############################################################################
7342 if darwin ; then
7343 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN -shared-libgcc"
7344 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7345 CFLAGS="$CFLAGS -no-cpp-precomp"
7348 if amigaos ; then
7349 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__ -DSYS_AMIGAOS4"
7351 if hpux ; then
7352 # use flag for HPUX missing setenv()
7353 CFLAGS="$CFLAGS -DHPUX"
7355 # Thread support
7356 if linux ; then
7357 CFLAGS="$CFLAGS -D_REENTRANT"
7358 elif bsd ; then
7359 # FIXME bsd needs this so maybe other OS'es
7360 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7362 if cygwin ; then
7363 CFLAGS="$CFLAGS -D__CYGWIN__ -DSYS_CYGWIN"
7365 # 64 bit file offsets?
7366 if test "$_largefiles" = yes || freebsd ; then
7367 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7368 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7369 # dvdread support requires this (for off64_t)
7370 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7374 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7375 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7377 cat > $TMPC << EOF
7378 int main() { return 0; }
7380 if test "$cc_vendor" = "gnu" ; then
7381 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7382 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7383 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7387 #this must be the last test to be performed or the ones following it will likely fail
7388 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7389 # to use its own copy of the library)
7390 echocheck "DVD support (libdvdnav)"
7391 if test "$_dvdnav" = auto ; then
7392 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7394 if test "$_dvdnav" = auto ; then
7395 cat > $TMPC <<EOF
7396 #include <inttypes.h>
7397 #include <dvdnav.h>
7398 int main(void) { dvdnav_t *dvd=0; return 0; }
7400 _dvdnav=no
7401 _dvdnavdir=`$_dvdnavconfig --cflags`
7402 _dvdnavlibs=`$_dvdnavconfig --libs`
7403 _dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
7404 _dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
7405 test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
7406 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7408 if test "$_dvdnav" = yes ; then
7409 _largefiles=yes
7410 _def_dvdnav='#define USE_DVDNAV 1'
7411 _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
7412 _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
7413 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7414 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7415 _inputmodules="dvdnav $_inputmodules"
7416 else
7417 _def_dvdnav='#undef USE_DVDNAV'
7418 _noinputmodules="dvdnav $_noinputmodules"
7420 echores "$_dvdnav"
7422 #############################################################################
7423 echo "Creating config.mak"
7424 cat > config.mak << EOF
7425 # -------- Generated by configure -----------
7427 LANG = C
7428 MAN_LANG = $MAN_LANG
7429 TARGET_OS = $system_name
7430 DESTDIR =
7431 prefix = \$(DESTDIR)$_prefix
7432 BINDIR = \$(DESTDIR)$_bindir
7433 DATADIR = \$(DESTDIR)$_datadir
7434 MANDIR = \$(DESTDIR)$_mandir
7435 CONFDIR = \$(DESTDIR)$_confdir
7436 LIBDIR = \$(DESTDIR)$_libdir
7437 # FFmpeg uses libdir instead of LIBDIR
7438 libdir = \$(LIBDIR)
7439 CC = $_cc
7440 CXX = $_cc
7441 HOST_CC = $_host_cc
7442 RANLIB = $_ranlib
7443 LDCONFIG = $_ldconfig
7444 INSTALL = $_install
7445 EXTRA_INC = $_inc_extra
7446 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7447 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7448 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7449 INSTALLSTRIP = $_install_strip
7450 CHARSET = $_charset
7451 HELP_FILE = $_mp_help
7453 EXESUF = $_exesuf
7455 MPLAYER_NETWORK = $_network
7456 FTP = $_ftp
7457 STREAMING_LIVE555 = $_live
7458 VSTREAM = $_vstream
7459 STREAM_CACHE = $_stream_cache
7460 DVBIN = $_dvbin
7461 VIDIX = $_vidix
7462 VIDIX_INTERNAL = $_vidix_internal
7463 VIDIX_EXTERNAL = $_vidix_external
7464 CONFIG_PP = yes
7465 MP3LAME = $_mp3lame
7466 LIBMENU = $_menu
7468 MP3LIB = $_mp3lib
7469 LIBA52 = $_liba52
7470 LIBMPEG2 = $_libmpeg2
7471 TREMOR_INTERNAL = $_tremor_internal
7472 TREMOR_LOW = $_tremor_low
7473 FAAD = $_faad
7475 SPEEX = $_speex
7476 MUSEPACK = $_musepack
7478 UNRARLIB = $_unrarlib
7479 PNG = $_png
7480 JPEG = $_jpeg
7481 GIF = $_gif
7483 EXTRALIBS = $_extra_libs
7484 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7485 EXTRALIBS_MPLAYER = $_libs_mplayer
7486 EXTRALIBS_MENCODER = $_libs_mencoder
7488 HAVE_MLIB = $_mlib
7489 HAVE_PTHREADS = $_pthreads
7490 HAVE_W32THREADS = $_w32threads
7492 HAVE_XVMC_ACCEL = $_xvmc
7494 HAVE_SYS_MMAN_H = $_mman
7495 HAVE_POSIX_SELECT = $_posix_select
7497 NEED_GETTIMEOFDAY = $_need_gettimeofday
7498 NEED_GLOB = $_need_glob
7499 NEED_SETENV = $_need_setenv
7500 NEED_SHMEM = $_need_shmem
7501 NEED_STRSEP = $_need_strsep
7502 NEED_SWAB = $_need_swab
7503 NEED_VSSCANF = $_need_vsscanf
7505 # for FFmpeg
7506 SRC_PATH=..
7507 BUILD_ROOT=..
7508 LIBPREF=lib
7509 LIBSUF=.a
7510 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7512 # audio output
7513 OSS = $_ossaudio
7514 ALSA = $_alsa
7515 ALSA5 = $_alsa5
7516 ALSA9 = $_alsa9
7517 ALSA1X = $_alsa1x
7519 # input/demuxer/codecs
7520 JOYSTICK = $_joystick
7521 LIRC = $_lirc
7522 TV = $_tv
7523 TV_V4L = $_tv_v4l
7524 TV_V4L1 = $_tv_v4l1
7525 TV_V4L2 = $_tv_v4l2
7526 TV_BSDBT848 = $_tv_bsdbt848
7527 TV_TELETEXT = $_tv_teletext
7528 AUDIO_INPUT = $_audio_input
7529 PVR = $_pvr
7530 VCD = $_vcd
7531 DVDREAD = $_dvdread
7532 DVDREAD_INTERNAL = $_dvdread_internal
7533 DVDCSS_INTERNAL = $_libdvdcss_internal
7534 DVDNAV = $_dvdnav
7535 WIN32DLL = $_win32dll
7536 QTX_CODECS = $_qtx
7537 REAL_CODECS = $_real
7538 XANIM_CODECS = $_xanim
7539 LIBAVUTIL = $_libavutil
7540 LIBAVUTIL_A = $_libavutil_a
7541 LIBAVUTIL_SO = $_libavutil_so
7542 LIBAVCODEC = $_libavcodec
7543 LIBAVCODEC_A = $_libavcodec_a
7544 LIBAVCODEC_SO = $_libavcodec_so
7545 LIBAVFORMAT = $_libavformat
7546 LIBAVFORMAT_A = $_libavformat_a
7547 LIBAVFORMAT_SO = $_libavformat_so
7548 LIBPOSTPROC = $_libpostproc
7549 LIBPOSTPROC_A = $_libpostproc_a
7550 LIBPOSTPROC_SO = $_libpostproc_so
7551 ZORAN = $_zr
7552 LIBLZO = $_liblzo
7553 LIBDV = $_libdv
7554 XVID4 = $_xvid
7555 X264 = $_x264
7556 LIBNUT = $_libnut
7557 LIBDCA = $_libdca
7558 MPLAYER = $_mplayer
7559 MENCODER = $_mencoder
7560 CDDA = $_cdda
7561 CDDB = $_cddb
7562 BITMAP_FONT = $_bitmap_font
7563 FREETYPE = $_freetype
7564 ASS = $_ass
7565 LIBMAD = $_mad
7566 LIBVORBIS = $_vorbis
7567 LIBTHEORA = $_theora
7568 FAAD_INTERNAL = $_faad_internal
7569 FAAD_FIXED = $_faad_fixed
7570 LIBSMBCLIENT = $_smbsupport
7571 XMMS_PLUGINS = $_xmms
7572 MACOSX = $_macosx
7573 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7574 MACOSX_BUNDLE = $_macosx_bundle
7575 MACOSX_COREVIDEO = $_macosx_corevideo
7576 TOOLAME=$_toolame
7577 TWOLAME=$_twolame
7578 FAAC=$_faac
7579 CONFIG_LIBAMR=$_libamr
7580 CONFIG_LIBAMR_NB=$_libamr_nb
7581 CONFIG_LIBAMR_WB=$_libamr_wb
7582 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7583 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7584 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7585 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7586 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7587 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7588 CONFIG_LIBFAAC=$_lavc_faac
7589 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7590 CONFIG_LIBXVID=$_lavc_xvid
7591 CONFIG_LIBX264=$_lavc_x264
7592 CONFIG_ZLIB=$_zlib
7593 CONFIG_GPL=yes
7594 CONFIG_ENCODERS=$_mencoder
7595 CONFIG_MUXERS=$_mencoder
7596 RADIO=$_radio
7597 RADIO_CAPTURE=$_radio_capture
7598 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7599 VIDIX_IVTV=$_vidix_drv_ivtv
7600 VIDIX_MACH64=$_vidix_drv_mach64
7601 VIDIX_MGA=$_vidix_drv_mga
7602 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7603 VIDIX_NVIDIA=$_vidix_drv_nvidia
7604 VIDIX_PM2=$_vidix_drv_pm2
7605 VIDIX_PM3=$_vidix_drv_pm3
7606 VIDIX_RADEON=$_vidix_drv_radeon
7607 VIDIX_RAGE128=$_vidix_drv_rage128
7608 VIDIX_SAVAGE=$_vidix_drv_savage
7609 VIDIX_SIS=$_vidix_drv_sis
7610 VIDIX_UNICHROME=$_vidix_drv_unichrome
7612 # --- Some stuff for autoconfigure ----
7613 $_target_arch
7614 $_target_arch_x86
7615 $_confwin32
7616 TARGET_CPU=$iproc
7617 HAVE_MMX = $_mmx
7618 HAVE_MMX2 = $_mmxext
7619 HAVE_3DNOW = $_3dnow
7620 HAVE_3DNOWEX = $_3dnowext
7621 HAVE_SSE = $_sse
7622 HAVE_CMOV = $_cmov
7623 HAVE_ALTIVEC = $_altivec
7624 HAVE_ARMV5TE = $_armv5te
7625 HAVE_ARMV6 = $_armv6
7626 HAVE_IWMMXT = $_iwmmxt
7627 HAVE_VIS = $_vis
7629 # --- GUI stuff ---
7630 GUI = $_gui
7632 # --- libvo stuff ---
7633 VO_SRCS = $_vosrc
7635 # --- libao2 stuff ---
7636 AO_SRCS = $_aosrc
7638 # --- libaf stuff ---
7639 AF_SRCS = $_afsrc
7643 #############################################################################
7645 ff_config_enable () {
7646 _nprefix=$3;
7647 test -z "$_nprefix" && _nprefix='CONFIG'
7648 for part in $1; do
7649 if ` echo $2 | grep "\<$part\>" > /dev/null `; then
7650 echo "#define ${_nprefix}_$part 1"
7651 echo "#define ENABLE_$part 1"
7652 else
7653 echo "#define ENABLE_$part 0"
7655 done
7658 echo "Creating config.h"
7659 cat > config.h << EOF
7660 /* -------- This file has been automatically generated by configure ---------
7661 Note: Any changes in it will be lost when you run configure again. */
7663 /* Protect against multiple inclusion */
7664 #ifndef MPLAYER_CONFIG_H
7665 #define MPLAYER_CONFIG_H 1
7667 #define CONFIGURATION "$_configuration"
7669 /* make sure we never get lavformat's poll() emulation, the results are
7670 horrible if the X libs try to actually use it, see MPlayer-users
7671 Message-ID: <45D49541.8060101@infernix.net>
7672 Date: Thu, 15 Feb 2007 18:15:45 +0100
7673 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7675 #define HAVE_SYS_POLL_H 1
7677 /* yes, we have inttypes.h */
7678 #define HAVE_INTTYPES_H 1
7680 /* int_fastXY_t emulation */
7681 $_def_fast_inttypes
7683 /* use GNU internationalization */
7684 $_def_i18n
7686 /* name of messages charset */
7687 $_def_charset
7689 /* Runtime CPU detection */
7690 $_def_runtime_cpudetection
7692 /* Dynamic a/v plugins */
7693 $_def_dynamic_plugins
7695 /* "restrict" keyword */
7696 $_def_restrict_keyword
7698 /* __builtin_expect branch prediction hint */
7699 $_def_builtin_expect
7700 #ifdef HAVE_BUILTIN_EXPECT
7701 #define likely(x) __builtin_expect ((x) != 0, 1)
7702 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7703 #else
7704 #define likely(x) (x)
7705 #define unlikely(x) (x)
7706 #endif
7708 /* attribute(used) as needed by some compilers */
7709 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7710 # define attribute_used __attribute__((used))
7711 #else
7712 # define attribute_used
7713 #endif
7715 /* compiler support for named assembler arguments */
7716 $_def_named_asm_args
7718 /* enable/disable SIGHANDLER */
7719 $_def_sighandler
7721 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7722 $_def_crash_debug
7724 /* Toggles debugging informations */
7725 $_def_debug
7727 /* Toggles color console output */
7728 $_def_color_console
7730 /* Indicates that libcdio is available for VCD and CD-DA playback */
7731 $_def_libcdio
7733 /* Indicates that Ogle's libdvdread is available for DVD playback */
7734 $_def_dvdread
7736 /* Indicates that dvdread is internal */
7737 $_def_dvdread_internal
7739 /* Additional options for libdvdread/libdvdcss */
7740 $_def_dvd
7741 $_def_cdrom
7742 $_def_cdio
7743 $_def_dvdio
7744 $_def_bsdi_dvd
7745 $_def_dvd_bsd
7746 $_def_dvd_linux
7747 $_dev_dvd_openbsd
7748 $_def_dvd_darwin
7749 $_def_sol_scsi_h
7750 $_def_hpux_scsi_h
7752 /* Common data directory (for fonts, etc) */
7753 #define MPLAYER_DATADIR "$_datadir"
7754 #define MPLAYER_CONFDIR "$_confdir"
7755 #define MPLAYER_LIBDIR "$_libdir"
7757 /* Define this to compile stream-caching support, it can be enabled via
7758 -cache <kilobytes> */
7759 $_def_stream_cache
7761 /* Define if you are using XviD library */
7762 $_def_xvid
7764 /* Define if you are using the X.264 library */
7765 $_def_x264
7767 /* Define if you are using libnut */
7768 $_def_libnut
7770 /* Define to include support for libdv-0.9.5 */
7771 $_def_libdv
7773 /* If build mencoder */
7774 $_mencoder_flag
7776 /* Indicates if libmp3lame is available
7777 Note: for mencoder */
7778 $_def_mp3lame
7779 $_def_mp3lame_preset
7780 $_def_mp3lame_preset_medium
7782 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7783 (use -bps or -nobps commandline option for run-time method selection)
7784 -bps gives better sync for vbr mp3 audio, it is now default */
7785 #define AVI_SYNC_BPS 1
7787 /* Undefine this if you do not want to select mono audio (left or right)
7788 with a stereo MPEG layer 2/3 audio stream. The command line option
7789 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7790 right-only), with 0 being the default.
7792 #define USE_FAKE_MONO 1
7794 /* Undefine this if your sound card driver has no working select().
7795 If you have kernel Oops, player hangups, or just no audio, you should
7796 try to recompile MPlayer with this option disabled! */
7797 $_def_select
7799 /* define this to use iconv(3) function to codepage conversions */
7800 $_def_iconv
7802 /* define this to use nl_langinfo function */
7803 $_def_langinfo
7805 /* define this to use RTC (/dev/rtc) for video timers */
7806 $_def_rtc
7808 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7809 #define MAX_OUTBURST 65536
7811 /* set up audio OUTBURST. Do not change this! */
7812 #define OUTBURST 512
7814 /* Define this if your system has the header file for the OSS sound interface */
7815 $_def_sys_soundcard
7817 /* Define this if your system has the header file for the OSS sound interface
7818 * in /usr/include */
7819 $_def_soundcard
7821 /* Define this if your system has the sysinfo header */
7822 $_def_sys_sysinfo
7824 /* Define this if your system has the "malloc.h" header file */
7825 $_def_malloc
7827 /* memalign is mapped to malloc if unsupported */
7828 $_def_memalign
7829 $_def_map_memalign
7830 $_def_memalign_hack
7832 /* assembler handling of .align */
7833 $_def_asmalign_pot
7835 /* Define this if your system has the "alloca.h" header file */
7836 $_def_alloca
7838 /* Define this if your system has the "sys/mman.h" header file */
7839 $_def_mman
7840 $_def_mman_has_map_failed
7842 /* Define this if you have the elf dynamic linker -ldl library */
7843 $_def_dl
7845 /* Define this if you have the kstat kernel statistics library */
7846 $_def_kstat
7848 /* Define this if you have zlib */
7849 $_def_zlib
7850 #ifdef HAVE_ZLIB
7851 #define CONFIG_ZLIB 1
7852 #endif
7854 /* Define this if you have shm support */
7855 $_def_shm
7857 /* Define this if your system has strsep */
7858 $_def_strsep
7860 /* Define this if your system has vsscanf */
7861 $_def_vsscanf
7863 /* Define this if your system has swab */
7864 $_def_swab
7866 /* Define this if your system has posix select */
7867 $_def_posix_select
7869 /* Define this if your system has gettimeofday */
7870 $_def_gettimeofday
7872 /* Define this if your system has glob */
7873 $_def_glob
7875 /* Define this if your system has setenv */
7876 $_def_setenv
7877 #ifndef HAVE_SETENV
7878 int setenv(const char *name, const char *val, int overwrite);
7879 #endif
7881 /* Define this if your system has sysi86 */
7882 $_def_sysi86
7883 $_def_sysi86_iv
7885 /* Define this if your system has pthreads */
7886 $_def_pthreads
7888 /* Define this if you enabled thread support for libavcodec */
7889 $_def_threads
7890 #ifdef HAVE_THREADS
7891 #define ENABLE_THREADS 1
7892 #else
7893 #define ENABLE_THREADS 0
7894 #endif
7896 /* LIRC (remote control, see www.lirc.org) support: */
7897 $_def_lirc
7899 /* Support for maemo (http://www.maemo.org) */
7900 $_def_maemo
7903 * LIRCCD (LIRC client daemon)
7904 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7906 $_def_lircc
7908 /* DVD navigation support using libdvdnav */
7909 $_def_dvdnav
7910 $_def_dvdnav_version
7912 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7913 #define MPEG12_POSTPROC 1
7915 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7916 $_def_libpostproc
7917 $_def_libpostproc_a
7918 $_def_libpostproc_so
7920 /* Win32 DLL support */
7921 $_def_win32dll
7922 #define WIN32_PATH "$_win32codecsdir"
7924 /* Mac OS X specific features */
7925 $_def_macosx
7926 $_def_macosx_finder_support
7927 $_def_macosx_bundle
7928 $_def_macosx_corevideo
7930 /* Build our Win32-loader */
7931 $_def_win32_loader
7933 /* ffmpeg's libavcodec support (requires libavcodec source) */
7934 $_def_libavcodec
7935 $_def_libavcodec_a
7936 $_def_libavcodec_so
7937 $_def_libavcodec_mpegaudio_hp
7939 /* ffmpeg's libavformat support (requires libavformat source) */
7940 $_def_libavformat
7941 $_def_libavformat_a
7942 $_def_libavformat_so
7944 $_def_libavutil
7945 $_def_libavutil_a
7946 $_def_libavutil_so
7948 /* Use libavcodec's decoders */
7949 #define CONFIG_DECODERS 1
7950 /* Use libavcodec's encoders */
7951 #define CONFIG_ENCODERS 1
7953 /* Use libavformat's demuxers */
7954 #define CONFIG_DEMUXERS 1
7955 /* Use libavformat's muxers */
7956 $_def_muxers
7958 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
7959 #define HAVE_EBX_AVAILABLE 1
7960 #define HAVE_EBP_AVAILABLE 1
7962 #define CONFIG_GPL 1
7963 #define ENABLE_SMALL 0
7965 /* Support for grayscale encoding/decoding in FFmpeg (makes color slower) */
7966 #define ENABLE_GRAY 1
7968 /* Use AMR codecs from libavcodec. */
7969 $_def_libamr
7970 $_def_libamr_nb
7971 $_def_libamr_wb
7973 /* Use specific parts from FFmpeg. */
7974 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
7975 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
7976 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
7977 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
7978 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
7979 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
7980 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
7982 $_def_lavc_faac
7983 $_def_lavc_xvid
7984 $_def_lavc_mp3lame
7985 $_def_lavc_x264
7987 /* Use codec libs included in mplayer CVS / source dist: */
7988 $_def_mp3lib
7989 $_def_liba52
7990 $_def_libdca
7991 $_def_libmpeg2
7993 /* XAnim DLL support */
7994 $_def_xanim
7995 /* Default search path */
7996 $_def_xanim_path
7998 /* RealPlayer DLL support */
7999 $_def_real
8000 /* Default search path */
8001 $_def_real_path
8003 /* LIVE555 Streaming Media library support */
8004 $_def_live
8006 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8007 $_def_fastmemcpy
8009 /* Use unrarlib for Vobsubs */
8010 $_def_unrarlib
8012 /* gui support, please do not edit this option */
8013 $_def_gui
8014 $_def_gtk2_gui
8016 /* Audio output drivers */
8017 $_def_ossaudio
8018 $_def_ossaudio_devdsp
8019 $_def_ossaudio_devmixer
8020 $_def_alsa5
8021 $_def_alsa9
8022 $_def_alsa1x
8023 $_def_arts
8024 $_def_esd
8025 $_def_esd_latency
8026 $_def_polyp
8027 $_def_jack
8028 $_def_openal
8029 $_def_openal_h
8030 $_def_sys_asoundlib_h
8031 $_def_alsa_asoundlib_h
8032 $_def_sunaudio
8033 $_def_sgiaudio
8034 $_def_win32waveout
8035 $_def_nas
8037 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8038 #undef FAST_OSD
8039 #undef FAST_OSD_TABLE
8041 /* Enable TV Interface support */
8042 $_def_tv
8044 /* Enable Video 4 Linux TV interface support */
8045 $_def_tv_v4l
8047 /* Enable Video 4 Linux 1 TV interface support */
8048 $_def_tv_v4l1
8050 /* Enable Video 4 Linux 2 TV interface support */
8051 $_def_tv_v4l2
8053 /* *BSD BrookTree headers */
8054 $_def_ioctl_meteor_h_name
8055 $_def_ioctl_bt848_h_name
8057 /* Enable *BSD BrookTree TV interface support */
8058 $_def_tv_bsdbt848
8060 /* Enable TV Teletext Interface support */
8061 $_def_tv_teletext
8063 /* Enable Radio Interface support */
8064 $_def_radio
8066 /* Enable Capture for Radio Interface support */
8067 $_def_radio_capture
8069 /* Enable Video 4 Linux Radio interface support */
8070 $_def_radio_v4l
8072 /* Enable Video 4 Linux 2 Radio interface support */
8073 $_def_radio_v4l2
8075 /* Enable *BSD BrookTree Radio interface support */
8076 $_def_radio_bsdbt848
8078 /* Enable Video 4 Linux 2 MPEG PVR support */
8079 $_def_pvr
8081 /* Define if your processor stores words with the most significant
8082 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8083 $_def_words_endian
8085 /* Define if your processor can access unaligned data in a fast way */
8086 $_def_fast_unaligned
8088 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8090 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8091 have the instruction. */
8092 $_def_dcbzl
8094 /* only gcc3 can compile mvi instructions */
8095 $_def_gcc_mvi_support
8097 /* Define this for Cygwin build for win32 */
8098 $_def_confwin32
8100 /* Define this to any prefered value from 386 up to infinity with step 100 */
8101 #define __CPU__ $iproc
8103 $_mp_wordsize
8105 $_def_linux
8107 $_def_vcd
8109 #ifdef sun
8110 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8111 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8112 #elif defined(HPUX)
8113 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8114 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8115 #elif defined(WIN32)
8116 #define DEFAULT_CDROM_DEVICE "D:"
8117 #define DEFAULT_DVD_DEVICE "D:"
8118 #elif defined(SYS_DARWIN)
8119 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8120 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8121 #elif defined(__OpenBSD__)
8122 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8123 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8124 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8125 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8126 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8127 #elif defined(SYS_AMIGAOS4)
8128 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8129 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8130 #else
8131 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8132 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8133 #endif
8136 /*----------------------------------------------------------------------------
8138 ** NOTE: Instead of modifying these definitions here, use the
8139 ** --enable/--disable options of the ./configure script!
8140 ** See ./configure --help for details.
8142 *---------------------------------------------------------------------------*/
8144 /* C99 lrintf function available */
8145 $_def_lrintf
8147 /* mkstemp support */
8148 $_def_mkstemp
8150 /* nanosleep support */
8151 $_def_nanosleep
8153 /* SMB support */
8154 $_def_smbsupport
8156 /* termcap flag for getch2.c */
8157 $_def_termcap
8159 /* termios flag for getch2.c */
8160 $_def_termios
8161 $_def_termios_h
8162 $_def_termios_sys_h
8164 /* enable PNG support */
8165 $_def_png
8167 /* enable JPEG support */
8168 $_def_jpeg
8170 /* enable PNM support */
8171 $_def_pnm
8173 /* enable md5sum support */
8174 $_def_md5sum
8176 /* enable GIF support */
8177 $_def_gif
8178 $_def_gif_4
8179 $_def_gif_tvt_hack
8181 /* enable bitmap font support */
8182 $_def_bitmap_font
8184 /* enable FreeType support */
8185 $_def_freetype
8187 /* enable Fontconfig support */
8188 $_def_fontconfig
8190 /* enable SSA/ASS support */
8191 $_def_ass
8193 /* enable FriBiDi usage */
8194 $_def_fribidi
8196 /* enable ENCA usage */
8197 $_def_enca
8199 /* liblzo support */
8200 $_def_liblzo
8201 #ifdef USE_LIBLZO
8202 #define CONFIG_LZO 1
8203 #endif
8205 /* libmad support */
8206 $_def_mad
8208 /* enable OggVorbis support */
8209 $_def_vorbis
8210 $_def_tremor
8212 /* enable Speex support */
8213 $_def_speex
8215 /* enable musepack support */
8216 $_def_musepack
8218 /* enable OggTheora support */
8219 $_def_theora
8221 /* enable FAAD (AAC) support */
8222 $_def_faad
8223 $_def_faad_internal
8225 /* enable FAAC (AAC encoder) support */
8226 $_def_faac
8228 /* enable LADSPA plugin support */
8229 $_def_ladspa
8231 /* enable network */
8232 $_def_network
8234 /* enable ftp support */
8235 $_def_ftp
8237 /* enable vstream support */
8238 $_def_vstream
8240 /* enable winsock2 instead of Unix functions*/
8241 $_def_winsock2
8243 /* define this to use inet_aton() instead of inet_pton() */
8244 $_def_use_aton
8246 /* enables / disables cdparanoia support */
8247 $_def_cdparanoia
8248 $_def_cddb
8250 /* enables / disables VIDIX usage */
8251 $_def_vidix
8252 $_def_vidix_drv_cyberblade
8253 $_def_vidix_drv_ivtv
8254 $_def_vidix_drv_mach64
8255 $_def_vidix_drv_mga
8256 $_def_vidix_drv_mga_crtc2
8257 $_def_vidix_drv_nvidia
8258 $_def_vidix_drv_pm3
8259 $_def_vidix_drv_radeon
8260 $_def_vidix_drv_rage128
8261 $_def_vidix_drv_savage
8262 $_def_vidix_drv_sis
8263 $_def_vidix_drv_unichrome
8264 $_def_vidix_pfx
8266 /* enables / disables new input joystick support */
8267 $_def_joystick
8269 /* enables / disables QTX codecs */
8270 $_def_qtx
8272 /* enables / disables osd menu */
8273 $_def_menu
8275 /* enables / disables subtitles sorting */
8276 $_def_sortsub
8278 /* XMMS input plugin support */
8279 $_def_xmms
8280 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8282 /* enables inet6 support */
8283 $_def_inet6
8285 /* do we have gethostbyname2? */
8286 $_def_gethostbyname2
8288 /* Extension defines */
8289 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8291 $_def_altivec_h // enables usage of altivec.h
8293 $_def_vis // only define if you have VIS ( ultrasparc )
8295 /* libmpeg2 uses a different feature test macro for mediaLib */
8296 #ifdef HAVE_MLIB
8297 #define LIBMPEG2_MLIB 1
8298 #endif
8300 /* libvo options */
8301 #define SCREEN_SIZE_X 1
8302 #define SCREEN_SIZE_Y 1
8303 $_def_x11
8304 $_def_xv
8305 $_def_xvmc
8306 $_def_vm
8307 $_def_xf86keysym
8308 $_def_xinerama
8309 $_def_gl
8310 $_def_gl_win32
8311 $_def_dga
8312 $_def_dga2
8313 $_def_sdl
8314 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8315 $_def_sdlbuggy
8316 $_def_directx
8317 $_def_ggi
8318 $_def_ggiwmh
8319 $_def_3dfx
8320 $_def_s3fb
8321 $_def_tdfxfb
8322 $_def_tdfxvid
8323 $_def_xvr100
8324 $_def_directfb
8325 $_def_directfb_version
8326 $_def_dfbmga
8327 $_def_zr
8328 $_def_bl
8329 $_def_mga
8330 $_def_xmga
8331 $_def_fbdev
8332 $_def_dxr2
8333 $_def_dxr3
8334 $_def_ivtv
8335 $_def_v4l2
8336 $_def_dvb
8337 $_def_dvb_in
8338 $_def_svga
8339 $_def_vesa
8340 $_def_xdpms
8341 $_def_aa
8342 $_def_caca
8343 $_def_tga
8344 $_def_toolame
8345 $_def_twolame
8347 /* used by GUI: */
8348 $_def_xshape
8350 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8351 #define X11_FULLSCREEN 1
8352 #endif
8354 #endif /* MPLAYER_CONFIG_H */
8357 #############################################################################
8359 cat << EOF
8361 Config files successfully generated by ./configure $_configuration !
8363 Install prefix: $_prefix
8364 Data directory: $_datadir
8365 Config direct.: $_confdir
8367 Byte order: $_byte_order
8368 Optimizing for: $_optimizing
8370 Languages:
8371 Messages/GUI: $_language
8374 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8375 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8376 echo
8378 cat << EOF
8380 Enabled optional drivers:
8381 Input: $_inputmodules
8382 Codecs: $_codecmodules
8383 Audio output: $_aomodules
8384 Video output: $_vomodules
8385 Audio filters: $_afmodules
8386 Disabled optional drivers:
8387 Input: $_noinputmodules
8388 Codecs: $_nocodecmodules
8389 Audio output: $_noaomodules
8390 Video output: $_novomodules
8391 Audio filters: $_noafmodules
8393 'config.h' and 'config.mak' contain your configuration options.
8394 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8395 compile *** DO NOT REPORT BUGS if you tweak these files ***
8397 'make' will now compile MPlayer and 'make install' will install it.
8398 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8403 if test "$_mtrr" = yes ; then
8404 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8405 echo
8408 if not x86_32; then
8409 cat <<EOF
8410 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8411 operating system ($system_name). You may encounter a few files that cannot
8412 be played due to missing open source video/audio codec support.
8418 cat <<EOF
8419 Check $TMPLOG if you wonder why an autodetection failed (make sure
8420 development headers/packages are installed).
8422 NOTE: The --enable-* parameters unconditionally force options on, completely
8423 skipping autodetection. This behavior is unlike what you may be used to from
8424 autoconf-based configure scripts that can decide to override you. This greater
8425 level of control comes at a price. You may have to provide the correct compiler
8426 and linker flags yourself.
8427 If you used one of these options (except --enable-gui and similar ones that
8428 turn on internal features) and experience a compilation or linking failure,
8429 make sure you have passed the necessary compiler/linker flags to configure.
8431 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8435 if test "$_warn_CFLAGS" = yes; then
8436 cat <<EOF
8438 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8440 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8442 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8443 To do so, execute 'CFLAGS= ./configure <options>'
8448 # Last move:
8449 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"