Fix bad uninit when switching DVB channels.
[mplayer/glamo.git] / configure
blobc95c9f055e7b673dfae42811f3f8313fe7845db4
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 "ldd $TMPO" >> "$TMPLOG"
71 $_ldd "$TMPO" >> "$TMPLOG" 2>&1
72 echo >> "$TMPLOG"
73 return "$TMP"
76 cc_check() {
77 compile_check $TMPC $@
80 cxx_check() {
81 compile_check $TMPCPP $@ -lstdc++
84 tmp_run() {
85 "$TMPO" >> "$TMPLOG" 2>&1
88 # Display error message, flushes tempfile, exit
89 die () {
90 echo
91 echo "Error: $@" >&2
92 echo >&2
93 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
94 echo "Check \"$TMPLOG\" if you do not understand why it failed."
95 exit 1
98 # OS test booleans functions
99 issystem() {
100 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
102 linux() { issystem "Linux" ; return "$?" ; }
103 sunos() { issystem "SunOS" ; return "$?" ; }
104 hpux() { issystem "HP-UX" ; return "$?" ; }
105 irix() { issystem "IRIX" ; return "$?" ; }
106 aix() { issystem "AIX" ; return "$?" ; }
107 cygwin() { issystem "CYGWIN" ; return "$?" ; }
108 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; }
109 netbsd() { issystem "NetBSD" ; return "$?" ; }
110 bsdos() { issystem "BSD/OS" ; return "$?" ; }
111 openbsd() { issystem "OpenBSD" ; return "$?" ; }
112 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
113 qnx() { issystem "QNX" ; return "$?" ; }
114 darwin() { issystem "Darwin" ; return "$?" ; }
115 gnu() { issystem "GNU" ; return "$?" ; }
116 mingw32() { issystem "MINGW32" ; return "$?" ; }
117 morphos() { issystem "MorphOS" ; return "$?" ; }
118 win32() { cygwin || mingw32 ; return "$?" ; }
119 beos() { issystem "BEOS" ; return "$?" ; }
121 # arch test boolean functions
122 # x86/x86pc is used by QNX
123 x86_32() {
124 case "$host_arch" in
125 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
126 *) return 1 ;;
127 esac
130 x86_64() {
131 case "$host_arch" in
132 x86_64|amd64) return 0 ;;
133 *) return 1 ;;
134 esac
137 x86() {
138 x86_32 || x86_64
141 ppc() {
142 case "$host_arch" in
143 ppc) return 0;;
144 *) return 1;;
145 esac
148 alpha() {
149 case "$host_arch" in
150 alpha) return 0;;
151 *) return 1;;
152 esac
155 arm() {
156 case "$host_arch" in
157 arm) return 0;;
158 *) return 1;;
159 esac
162 # not boolean test: implement the posix shell "!" operator for a
163 # non-posix /bin/sh.
164 # usage: not {command}
165 # returns exit status "success" when the execution of "command"
166 # fails.
167 not() {
168 eval "$@"
169 test $? -ne 0
172 # Use this before starting a check
173 echocheck() {
174 echo "============ Checking for $@ ============" >> "$TMPLOG"
175 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
178 # Use this to echo the results of a check
179 echores() {
180 if test "$_res_comment" ; then
181 _res_comment="($_res_comment)"
183 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
184 echo "##########################################" >> "$TMPLOG"
185 echo "" >> "$TMPLOG"
186 echo "$@ $_res_comment"
187 _res_comment=""
189 #############################################################################
191 # Check how echo works in this /bin/sh
192 case `echo -n` in
193 -n) _echo_n= _echo_c='\c' ;; # SysV echo
194 *) _echo_n='-n ' _echo_c= ;; # BSD echo
195 esac
197 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"`
199 show_help(){
200 cat << EOF
201 Usage: $0 [OPTIONS]...
203 Configuration:
204 -h, --help display this help and exit
206 Installation directories:
207 --prefix=DIR prefix directory for installation [/usr/local]
208 --bindir=DIR directory for installing binaries [PREFIX/bin]
209 --datadir=DIR directory for installing machine independent
210 data files (skins, etc) [PREFIX/share/mplayer]
211 --mandir=DIR directory for installing man pages [PREFIX/man]
212 --confdir=DIR directory for installing configuration files
213 [PREFIX/etc/mplayer]
214 --libdir=DIR directory for object code libraries [PREFIX/lib]
215 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
216 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
217 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
218 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
220 Optional features:
221 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
222 --disable-mplayer disable MPlayer compilation [enable]
223 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
224 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
225 --enable-largefiles enable support for files > 2GB [disable]
226 --enable-linux-devfs set default devices to devfs [disable]
227 --enable-termcap use termcap database for key codes [autodetect]
228 --enable-termios use termios database for key codes [autodetect]
229 --disable-iconv disable iconv for encoding conversion [autodetect]
230 --disable-langinfo do not use langinfo [autodetect]
231 --enable-lirc enable LIRC (remote control) support [autodetect]
232 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
233 --enable-joystick enable joystick support [disable]
234 --disable-vm disable X video mode extensions [autodetect]
235 --disable-xf86keysym disable support for multimedia keys [autodetect]
236 --enable-radio enable radio interface [disable]
237 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
238 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
239 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
240 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
241 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
242 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
243 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
244 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
245 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
246 --disable-network disable networking [enable]
247 --enable-winsock2 enable winsock2 [autodetect]
248 --enable-smb enable Samba (SMB) input [autodetect]
249 --enable-live enable LIVE555 Streaming Media [autodetect]
250 --disable-dvdnav disable libdvdnav [autodetect]
251 --disable-dvdread disable libdvdread [autodetect]
252 --disable-dvdread-internal disable internal libdvdread [autodetect]
253 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
254 --disable-cdparanoia disable cdparanoia [autodetect]
255 --disable-cddb disable cddb [autodetect]
256 --disable-bitmap-font disable bitmap font support [enable]
257 --disable-freetype disable FreeType 2 font rendering [autodetect]
258 --disable-fontconfig disable fontconfig font lookup [autodetect]
259 --disable-unrarlib disable Unique RAR File Library [enabled]
260 --enable-menu enable OSD menu (not DVD menu) [disabled]
261 --disable-sortsub disable subtitle sorting [enabled]
262 --enable-fribidi enable the FriBiDi libs [autodetect]
263 --disable-enca disable ENCA charset oracle library [autodetect]
264 --disable-macosx disable Mac OS X specific features [autodetect]
265 --disable-maemo disable maemo specific features [autodetect]
266 --enable-macosx-finder-support enable Mac OS X Finder invocation
267 parameter parsing [disabled]
268 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
269 --disable-inet6 disable IPv6 support [autodetect]
270 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
271 --disable-ftp disable FTP support [enabled]
272 --disable-vstream disable TiVo vstream client support [autodetect]
273 --disable-pthreads disable Posix threads support [autodetect]
274 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
275 --enable-rpath enable runtime linker path for extra libs [disabled]
277 Codecs:
278 --enable-gif enable GIF support [autodetect]
279 --enable-png enable PNG input/output support [autodetect]
280 --enable-jpeg enable JPEG input/output support [autodetect]
281 --enable-libcdio enable external libcdio [autodetect]
282 --enable-liblzo enable external liblzo [autodetect]
283 --disable-win32 disable Win32 DLL support [enabled]
284 --disable-qtx disable QuickTime codecs support [enabled]
285 --disable-xanim disable XAnim codecs support [enabled]
286 --disable-real disable RealPlayer codecs support [enabled]
287 --disable-xvid disable XviD [autodetect]
288 --disable-x264 disable x264 [autodetect]
289 --disable-nut disable libnut [autodetect]
290 --disable-libavutil disable libavutil [autodetect]
291 --disable-libavcodec disable libavcodec [autodetect]
292 --disable-libavformat disable libavformat [autodetect]
293 --disable-libpostproc disable libpostproc [autodetect]
294 --disable-libavutil_so disable shared libavutil [autodetect]
295 --disable-libavcodec_so disable shared libavcodec [autodetect]
296 --disable-libavformat_so disable shared libavformat [autodetect]
297 --disable-libpostproc_so disable shared libpostproc [autodetect]
298 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
299 in libavcodec [enabled]
300 --disable-tremor-internal disable internal Tremor [enabled]
301 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
302 --enable-tremor-external enable external Tremor [autodetect]
303 --disable-libvorbis disable libvorbis support [autodetect]
304 --disable-speex disable Speex support [autodetect]
305 --enable-theora enable OggTheora libraries [autodetect]
306 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
307 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
308 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
309 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
310 --disable-ladspa disable LADSPA plugin support [autodetect]
311 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
312 --disable-mad disable libmad (MPEG audio) support [autodetect]
313 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
314 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
315 --enable-xmms enable XMMS input plugin support [disabled]
316 --enable-libdts enable libdts support [autodetect]
317 --disable-mp3lib disable builtin mp3lib [enabled]
318 --disable-liba52 disable builtin liba52 [enabled]
319 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
320 --disable-musepack disable musepack support [autodetect]
321 --disable-amr_nb disable AMR narrowband, floating-point [autodetect]
322 --disable-amr_nb-fixed disable AMR narrowband, fixed-point [autodetect]
323 --disable-amr_wb disable AMR wideband, floating-point [autodetect]
324 --disable-decoder=DECODER disable specified FFmpeg decoder
325 --enable-decoder=DECODER enable specified FFmpeg decoder
326 --disable-encoder=ENCODER disable specified FFmpeg encoder
327 --enable-encoder=ENCODER enable specified FFmpeg encoder
328 --disable-parser=PARSER disable specified FFmpeg parser
329 --enable-parser=PARSER enable specified FFmpeg parser
330 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
331 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
332 --disable-muxer=MUXER disable specified FFmpeg muxer
333 --enable-muxer=MUXER enable specified FFmpeg muxer
335 Video output:
336 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
337 --disable-vidix-external disable external VIDIX [for x86 *nix]
338 --enable-gl enable OpenGL video output [autodetect]
339 --enable-dga[=n] enable DGA [n in {1, 2} ] support [autodetect]
340 --enable-vesa enable VESA video output [autodetect]
341 --enable-svga enable SVGAlib video output [autodetect]
342 --enable-sdl enable SDL video output [autodetect]
343 --enable-aa enable AAlib video output [autodetect]
344 --enable-caca enable CACA video output [autodetect]
345 --enable-ggi enable GGI video output [autodetect]
346 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
347 --enable-directx enable DirectX video output [autodetect]
348 --enable-dxr2 enable DXR2 video output [autodetect]
349 --enable-dxr3 enable DXR3/H+ video output [autodetect]
350 --enable-ivtv enable IVTV TV-Out video output [autodetect]
351 --enable-dvb enable DVB video output [autodetect]
352 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
353 --enable-mga enable mga_vid video output [autodetect]
354 --enable-xmga enable mga_vid X11 video output [autodetect]
355 --enable-xv enable Xv video output [autodetect]
356 --enable-xvmc enable XvMC acceleration [disable]
357 --enable-vm enable XF86VidMode support [autodetect]
358 --enable-xinerama enable Xinerama support [autodetect]
359 --enable-x11 enable X11 video output [autodetect]
360 --enable-xshape enable XShape support [autodetect]
361 --enable-fbdev enable FBDev video output [autodetect]
362 --enable-mlib enable mediaLib video output (Solaris) [disable]
363 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
364 --enable-tdfxfb enable tdfxfb video output [disable]
365 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
366 --enable-directfb enable DirectFB video output [autodetect]
367 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
368 --enable-bl enable Blinkenlights video output [disable]
369 --enable-tdfxvid enable tdfx_vid video output [disable]
370 --disable-tga disable Targa video output [enable]
371 --disable-pnm disable PNM video output [enable]
372 --disable-md5sum disable md5sum video output [enable]
374 Audio output:
375 --disable-alsa disable ALSA audio output [autodetect]
376 --disable-ossaudio disable OSS audio output [autodetect]
377 --disable-arts disable aRts audio output [autodetect]
378 --disable-esd disable esd audio output [autodetect]
379 --disable-polyp disable Polypaudio audio output [autodetect]
380 --disable-jack disable JACK audio output [autodetect]
381 --disable-openal disable OpenAL audio output [autodetect]
382 --disable-nas disable NAS audio output [autodetect]
383 --disable-sgiaudio disable SGI audio output [autodetect]
384 --disable-sunaudio disable Sun audio output [autodetect]
385 --disable-win32waveout disable Windows waveout audio output [autodetect]
386 --disable-select disable using select() on the audio device [enable]
388 Miscellaneous options:
389 --enable-runtime-cpudetection enable runtime CPU detection [disable]
390 --enable-cross-compile enable cross-compilation [autodetect]
391 --cc=COMPILER C compiler to build MPlayer [gcc]
392 --host-cc=COMPILER C compiler for tools needed while building [gcc]
393 --as=ASSEMBLER assembler to build MPlayer [as]
394 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
395 --enable-static build a statically linked binary
396 --charset=charset convert the console messages to this character set
397 --language=list a white space or comma separated list of languages for
398 translated man pages, the first language is used for
399 messages and the GUI (the environment variable
400 \$LINGUAS is also honored) [en]
401 (Available: $LANGUAGES all)
402 --with-install=PATH path to a custom install program
403 --enable-color-console enable color console output (UNSUPPORTED) [disable]
405 Advanced options:
406 --enable-mmx enable MMX [autodetect]
407 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
408 --enable-3dnow enable 3DNow! [autodetect]
409 --enable-3dnowext enable extended 3DNow! [autodetect]
410 --enable-sse enable SSE [autodetect]
411 --enable-sse2 enable SSE2 [autodetect]
412 --enable-shm enable shm [autodetect]
413 --enable-altivec enable AltiVec (PowerPC) [autodetect]
414 --enable-armv5te enable DSP extensions (ARM) [autodetect]
415 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
416 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
417 --enable-big-endian force byte order to big-endian [autodetect]
418 --enable-debug[=1-3] compile-in debugging information [disable]
419 --enable-profile compile-in profiling information [disable]
420 --disable-sighandler disable sighandler for crashes [enable]
421 --enable-crash-debug enable automatic gdb attach on crash [disable]
422 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
424 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
425 --disable-gcc-check disable gcc version checking [enable]
427 Use these options if autodetection fails (Options marked with (*) accept
428 multiple paths separated by ':'):
429 --extra-libs=FLAGS extra linker flags
430 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
431 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
432 --with-extraincdir=DIR extra header search paths in DIR (*)
433 --with-extralibdir=DIR extra linker search paths in DIR (*)
434 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
436 --with-freetype-config=PATH path to freetype-config
437 --with-fribidi-config=PATH path to fribidi-config
438 --with-glib-config=PATH path to glib*-config
439 --with-gtk-config=PATH path to gtk*-config
440 --with-sdl-config=PATH path to sdl*-config
441 --with-dvdnav-config=PATH path to dvdnav-config
443 This configure script is NOT autoconf-based, even though its output is similar.
444 It will try to autodetect all configuration options. If you --enable an option
445 it will be forcefully turned on, skipping autodetection. This can break
446 compilation, so you need to know what you are doing.
448 exit 0
449 } #show_help()
451 # GOTCHA: the variables below defines the default behavior for autodetection
452 # and have - unless stated otherwise - at least 2 states : yes no
453 # If autodetection is available then the third state is: auto
454 _mmx=auto
455 _3dnow=auto
456 _3dnowext=auto
457 _mmxext=auto
458 _sse=auto
459 _sse2=auto
460 _cmov=auto
461 _armv5te=auto
462 _iwmmxt=auto
463 _mtrr=auto
464 _install=install
465 _ranlib=ranlib
466 _ldconfig=ldconfig
467 _ldd=ldd
468 _cc=cc
469 test "$CC" && _cc="$CC"
470 _gcc_check=yes
471 _as=auto
472 _runtime_cpudetection=no
473 _cross_compile=auto
474 _prefix="/usr/local"
475 _libavutil=auto
476 _libavutil_so=auto
477 _libavcodec=auto
478 _amr_nb=auto
479 _amr_nb_fixed=auto
480 _amr_wb=auto
481 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
482 _libavdecoders=` echo $_libavdecoders_all | sed -e s/AAC_DECODER// -e s/MPEG4AAC_DECODER// -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// `
483 _libavencoders_all=`sed -n 's/^[^#]*ENC.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
484 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// `
485 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
486 _libavparsers=$_libavparsers_all
487 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
488 _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_DEVICE_DEMUXER// -e s/X11_GRAB_DEVICE_DEMUXER// -e s/V4L2_DEMUXER// -e s/LIBNUT_DEMUXER// `
489 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
490 _libavmuxers=`echo $_libavmuxers_all | sed -e s/AUDIO_MUXER// -e s/RTP_MUXER// `
491 _libavcodec_so=auto
492 _libavformat=auto
493 _libavformat_so=auto
494 _libpostproc=auto
495 _libpostproc_so=auto
496 _libavcodec_mpegaudio_hp=yes
497 _mencoder=yes
498 _mplayer=yes
499 _x11=auto
500 _xshape=auto
501 _dga=auto # 1 2 no auto
502 _xv=auto
503 _xvmc=no #auto when complete
504 _sdl=auto
505 _directx=auto
506 _win32waveout=auto
507 _nas=auto
508 _png=auto
509 _jpeg=auto
510 _pnm=yes
511 _md5sum=yes
512 _gif=auto
513 _gl=auto
514 _ggi=auto
515 _ggiwmh=auto
516 _aa=auto
517 _caca=auto
518 _svga=auto
519 _vesa=auto
520 _fbdev=auto
521 _dvb=auto
522 _dvbhead=auto
523 _dxr2=auto
524 _dxr3=auto
525 _ivtv=auto
526 _iconv=auto
527 _langinfo=auto
528 _rtc=auto
529 _ossaudio=auto
530 _arts=auto
531 _esd=auto
532 _polyp=auto
533 _jack=auto
534 _openal=auto
535 _libcdio=auto
536 _liblzo=auto
537 _mad=auto
538 _toolame=auto
539 _twolame=auto
540 _tremor_internal=yes
541 _tremor_low=no
542 _tremor_external=auto
543 _libvorbis=auto
544 _speex=auto
545 _theora=auto
546 _mp3lib=yes
547 _liba52=yes
548 _libdts=auto
549 _libmpeg2=yes
550 _faad_internal=auto
551 _faad_external=auto
552 _faad_fixed=no
553 _faac=auto
554 _ladspa=auto
555 _xmms=no
556 _dvdnav=auto
557 _dvdnavconfig=dvdnav-config
558 _dvdread=auto
559 _dvdread_internal=auto
560 _libdvdcss_internal=auto
561 _xanim=auto
562 _real=auto
563 _live=auto
564 _xinerama=auto
565 _mga=auto
566 _xmga=auto
567 _vm=auto
568 _xf86keysym=auto
569 _mlib=no #broken, thus disabled
570 _sgiaudio=auto
571 _sunaudio=auto
572 _alsa=auto
573 _fastmemcpy=yes
574 _unrarlib=yes
575 _win32=auto
576 _select=yes
577 _radio=no
578 _radio_capture=no
579 _radio_v4l=auto
580 _radio_v4l2=auto
581 _radio_bsdbt848=auto
582 _tv=yes
583 _tv_v4l1=auto
584 _tv_v4l2=auto
585 _tv_bsdbt848=auto
586 _pvr=auto
587 _network=yes
588 _winsock2=auto
589 _smbsupport=auto
590 _vidix_internal=auto
591 _vidix_external=auto
592 _joystick=no
593 _xvid=auto
594 _x264=auto
595 _nut=auto
596 _lirc=auto
597 _lircc=auto
598 _gui=no
599 _gtk1=no
600 _termcap=auto
601 _termios=auto
602 _3dfx=no
603 _s3fb=no
604 _tdfxfb=no
605 _tdfxvid=no
606 _tga=yes
607 _directfb=auto
608 _zr=auto
609 _bl=no
610 _largefiles=no
611 #_language=en
612 _shm=auto
613 _linux_devfs=no
614 _charset="UTF-8"
615 _dynamic_plugins=no
616 _crash_debug=no
617 _sighandler=yes
618 _libdv=auto
619 _cdparanoia=auto
620 _cddb=auto
621 _big_endian=auto
622 _bitmap_font=yes
623 _freetype=auto
624 _fontconfig=auto
625 _menu=no
626 _qtx=auto
627 _macosx=auto
628 _maemo=auto
629 _macosx_finder_support=no
630 _macosx_bundle=auto
631 _sortsub=yes
632 _freetypeconfig='freetype-config'
633 _fribidi=auto
634 _fribidiconfig='fribidi-config'
635 _enca=auto
636 _inet6=auto
637 _gethostbyname2=auto
638 _ftp=yes
639 _musepack=auto
640 _vstream=auto
641 _pthreads=auto
642 _ass=auto
643 _rpath=no
644 _asmalign_pot=auto
645 _color_console=no
646 _stream_cache=yes
647 _def_stream_cache="#define USE_STREAM_CACHE 1"
648 for ac_option do
649 case "$ac_option" in
650 --help|-help|-h)
651 show_help
653 --prefix=*)
654 _prefix=`echo $ac_option | cut -d '=' -f 2`
656 --bindir=*)
657 _bindir=`echo $ac_option | cut -d '=' -f 2`
659 --datadir=*)
660 _datadir=`echo $ac_option | cut -d '=' -f 2`
662 --mandir=*)
663 _mandir=`echo $ac_option | cut -d '=' -f 2`
665 --confdir=*)
666 _confdir=`echo $ac_option | cut -d '=' -f 2`
668 --libdir=*)
669 _libdir=`echo $ac_option | cut -d '=' -f 2`
671 --codecsdir=*)
672 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
674 --win32codecsdir=*)
675 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
677 --xanimcodecsdir=*)
678 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
680 --realcodecsdir=*)
681 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
683 --with-extraincdir=*)
684 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
686 --with-extralibdir=*)
687 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
690 --with-install=*)
691 _install=`echo $ac_option | cut -d '=' -f 2 `
693 --with-xvmclib=*)
694 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
697 --with-sdl-config=*)
698 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
700 --with-freetype-config=*)
701 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
703 --with-fribidi-config=*)
704 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
706 --with-gtk-config=*)
707 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
709 --with-glib-config=*)
710 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
712 --with-dvdnav-config=*)
713 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
716 --extra-libs=*)
717 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
719 --extra-libs-mplayer=*)
720 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
722 --extra-libs-mencoder=*)
723 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
726 --target=*)
727 _target=`echo $ac_option | cut -d '=' -f 2`
729 --cc=*)
730 _cc=`echo $ac_option | cut -d '=' -f 2`
732 --host-cc=*)
733 _host_cc=`echo $ac_option | cut -d '=' -f 2`
735 --as=*)
736 _as=`echo $ac_option | cut -d '=' -f 2`
738 --charset=*)
739 _charset=`echo $ac_option | cut -d '=' -f 2`
741 --language=*)
742 _language=`echo $ac_option | cut -d '=' -f 2`
745 --enable-static)
746 _ld_static='-static'
748 --disable-static)
749 _ld_static=''
751 --enable-profile)
752 _profile='-p'
754 --disable-profile)
755 _profile=
757 --enable-debug)
758 _debug='-g'
760 --enable-debug=*)
761 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
763 --disable-debug)
764 _debug=
766 --enable-gcc-check) _gcc_check=yes ;;
767 --disable-gcc-check) _gcc_check=no ;;
768 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
769 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
770 --enable-cross-compile) _cross_compile=yes ;;
771 --disable-cross-compile) _cross_compile=no ;;
772 --enable-mencoder) _mencoder=yes ;;
773 --disable-mencoder) _mencoder=no ;;
774 --enable-mplayer) _mplayer=yes ;;
775 --disable-mplayer) _mplayer=no ;;
776 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
777 --disable-dynamic-plugins) _dynamic_plugins=no ;;
778 --enable-x11) _x11=yes ;;
779 --disable-x11) _x11=no ;;
780 --enable-xshape) _xshape=yes ;;
781 --disable-xshape) _xshape=no ;;
782 --enable-xv) _xv=yes ;;
783 --disable-xv) _xv=no ;;
784 --enable-xvmc) _xvmc=yes ;;
785 --disable-xvmc) _xvmc=no ;;
786 --enable-sdl) _sdl=yes ;;
787 --disable-sdl) _sdl=no ;;
788 --enable-directx) _directx=yes ;;
789 --disable-directx) _directx=no ;;
790 --enable-win32waveout) _win32waveout=yes ;;
791 --disable-win32waveout) _win32waveout=no ;;
792 --enable-nas) _nas=yes ;;
793 --disable-nas) _nas=no ;;
794 --enable-png) _png=yes ;;
795 --disable-png) _png=no ;;
796 --enable-jpeg) _jpeg=yes ;;
797 --disable-jpeg) _jpeg=no ;;
798 --enable-pnm) _pnm=yes ;;
799 --disable-pnm) _pnm=no ;;
800 --enable-md5sum) _md5sum=yes ;;
801 --disable-md5sum) _md5sum=no ;;
802 --enable-gif) _gif=yes ;;
803 --disable-gif) _gif=no ;;
804 --enable-gl) _gl=yes ;;
805 --disable-gl) _gl=no ;;
806 --enable-ggi) _ggi=yes ;;
807 --disable-ggi) _ggi=no ;;
808 --enable-ggiwmh) _ggiwmh=yes ;;
809 --disable-ggiwmh) _ggiwmh=no ;;
810 --enable-aa) _aa=yes ;;
811 --disable-aa) _aa=no ;;
812 --enable-caca) _caca=yes ;;
813 --disable-caca) _caca=no ;;
814 --enable-svga) _svga=yes ;;
815 --disable-svga) _svga=no ;;
816 --enable-vesa) _vesa=yes ;;
817 --disable-vesa) _vesa=no ;;
818 --enable-fbdev) _fbdev=yes ;;
819 --disable-fbdev) _fbdev=no ;;
820 --enable-dvb) _dvb=yes ;;
821 --disable-dvb) _dvb=no ;;
822 --enable-dvbhead) _dvbhead=yes ;;
823 --disable-dvbhead) _dvbhead=no ;;
824 --enable-dxr2) _dxr2=yes ;;
825 --disable-dxr2) _dxr2=no ;;
826 --enable-dxr3) _dxr3=yes ;;
827 --disable-dxr3) _dxr3=no ;;
828 --enable-ivtv) _ivtv=yes ;;
829 --disable-ivtv) _ivtv=no ;;
830 --enable-iconv) _iconv=yes ;;
831 --disable-iconv) _iconv=no ;;
832 --enable-langinfo) _langinfo=yes ;;
833 --disable-langinfo) _langinfo=no ;;
834 --enable-rtc) _rtc=yes ;;
835 --disable-rtc) _rtc=no ;;
836 --enable-libdv) _libdv=yes ;;
837 --disable-libdv) _libdv=no ;;
838 --enable-ossaudio) _ossaudio=yes ;;
839 --disable-ossaudio) _ossaudio=no ;;
840 --enable-arts) _arts=yes ;;
841 --disable-arts) _arts=no ;;
842 --enable-esd) _esd=yes ;;
843 --disable-esd) _esd=no ;;
844 --enable-polyp) _polyp=yes ;;
845 --disable-polyp) _polyp=no ;;
846 --enable-jack) _jack=yes ;;
847 --disable-jack) _jack=no ;;
848 --enable-openal) _openal=yes ;;
849 --disable-openal) _openal=no ;;
850 --enable-mad) _mad=yes ;;
851 --disable-mad) _mad=no ;;
852 --enable-toolame) _toolame=yes ;;
853 --disable-toolame) _toolame=no ;;
854 --enable-twolame) _twolame=yes ;;
855 --disable-twolame) _twolame=no ;;
856 --enable-libcdio) _libcdio=yes ;;
857 --disable-libcdio) _libcdio=no ;;
858 --enable-liblzo) _liblzo=yes ;;
859 --disable-liblzo) _liblzo=no ;;
860 --enable-libvorbis) _libvorbis=yes ;;
861 --disable-libvorbis) _libvorbis=no ;;
862 --enable-speex) _speex=yes ;;
863 --disable-speex) _speex=no ;;
864 --enable-tremor-internal) _tremor_internal=yes ;;
865 --disable-tremor-internal) _tremor_internal=no ;;
866 --enable-tremor-low) _tremor_low=yes ;;
867 --disable-tremor-low) _tremor_low=no ;;
868 --enable-tremor-external) _tremor_external=yes ;;
869 --disable-tremor-external) _tremor_external=no ;;
870 --enable-theora) _theora=yes ;;
871 --disable-theora) _theora=no ;;
872 --enable-mp3lib) _mp3lib=yes ;;
873 --disable-mp3lib) _mp3lib=no ;;
874 --enable-liba52) _liba52=yes ;;
875 --disable-liba52) _liba52=no ;;
876 --enable-libdts) _libdts=yes ;;
877 --disable-libdts) _libdts=no ;;
878 --enable-libmpeg2) _libmpeg2=yes ;;
879 --disable-libmpeg2) _libmpeg2=no ;;
880 --enable-musepack) _musepack=yes ;;
881 --disable-musepack) _musepack=no ;;
882 --enable-faad-internal) _faad_internal=yes ;;
883 --disable-faad-internal) _faad_internal=no ;;
884 --enable-faad-external) _faad_external=yes ;;
885 --disable-faad-external) _faad_external=no ;;
886 --enable-faad-fixed) _faad_fixed=yes ;;
887 --disable-faad-fixed) _faad_fixed=no ;;
888 --enable-faac) _faac=yes ;;
889 --disable-faac) _faac=no ;;
890 --enable-ladspa) _ladspa=yes ;;
891 --disable-ladspa) _ladspa=no ;;
892 --enable-xmms) _xmms=yes ;;
893 --disable-xmms) _xmms=no ;;
894 --enable-dvdread) _dvdread=yes ;;
895 --disable-dvdread) _dvdread=no ;;
896 --enable-dvdread-internal) _dvdread_internal=yes ;;
897 --disable-dvdread-internal) _dvdread_internal=no ;;
898 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
899 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
900 --enable-dvdnav) _dvdnav=yes ;;
901 --disable-dvdnav) _dvdnav=no ;;
902 --enable-xanim) _xanim=yes ;;
903 --disable-xanim) _xanim=no ;;
904 --enable-real) _real=yes ;;
905 --disable-real) _real=no ;;
906 --enable-live) _live=yes ;;
907 --disable-live) _live=no ;;
908 --enable-xinerama) _xinerama=yes ;;
909 --disable-xinerama) _xinerama=no ;;
910 --enable-mga) _mga=yes ;;
911 --disable-mga) _mga=no ;;
912 --enable-xmga) _xmga=yes ;;
913 --disable-xmga) _xmga=no ;;
914 --enable-vm) _vm=yes ;;
915 --disable-vm) _vm=no ;;
916 --enable-xf86keysym) _xf86keysym=yes ;;
917 --disable-xf86keysym) _xf86keysym=no ;;
918 --enable-mlib) _mlib=yes ;;
919 --disable-mlib) _mlib=no ;;
920 --enable-sunaudio) _sunaudio=yes ;;
921 --disable-sunaudio) _sunaudio=no ;;
922 --enable-sgiaudio) _sgiaudio=yes ;;
923 --disable-sgiaudio) _sgiaudio=no ;;
924 --enable-alsa) _alsa=yes ;;
925 --disable-alsa) _alsa=no ;;
926 --enable-tv) _tv=yes ;;
927 --disable-tv) _tv=no ;;
928 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
929 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
930 --enable-tv-v4l1) _tv_v4l1=yes ;;
931 --disable-tv-v4l1) _tv_v4l1=no ;;
932 --enable-tv-v4l2) _tv_v4l2=yes ;;
933 --disable-tv-v4l2) _tv_v4l2=no ;;
934 --enable-radio) _radio=yes ;;
935 --enable-radio-capture) _radio_capture=yes ;;
936 --disable-radio-capture) _radio_capture=no ;;
937 --disable-radio) _radio=no ;;
938 --enable-radio-v4l) _radio_v4l=yes ;;
939 --disable-radio-v4l) _radio_v4l=no ;;
940 --enable-radio-v4l2) _radio_v4l2=yes ;;
941 --disable-radio-v4l2) _radio_v4l2=no ;;
942 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
943 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
944 --enable-pvr) _pvr=yes ;;
945 --disable-pvr) _pvr=no ;;
946 --enable-fastmemcpy) _fastmemcpy=yes ;;
947 --disable-fastmemcpy) _fastmemcpy=no ;;
948 --enable-network) _network=yes ;;
949 --disable-network) _network=no ;;
950 --enable-winsock2) _winsock2=yes ;;
951 --disable-winsock2) _winsock2=no ;;
952 --enable-smb) _smbsupport=yes ;;
953 --disable-smb) _smbsupport=no ;;
954 --enable-vidix-internal) _vidix_internal=yes ;;
955 --disable-vidix-internal) _vidix_internal=no ;;
956 --enable-vidix-external) _vidix_external=yes ;;
957 --disable-vidix-external) _vidix_external=no ;;
958 --enable-joystick) _joystick=yes ;;
959 --disable-joystick) _joystick=no ;;
960 --enable-xvid) _xvid=yes ;;
961 --disable-xvid) _xvid=no ;;
962 --enable-x264) _x264=yes ;;
963 --disable-x264) _x264=no ;;
964 --enable-nut) _nut=yes ;;
965 --disable-nut) _nut=no ;;
966 --enable-libavutil) _libavutil=yes ;;
967 --disable-libavutil) _libavutil=no ;;
968 --enable-libavutil_so) _libavutil_so=yes ;;
969 --disable-libavutil_so) _libavutil_so=no ;;
970 --enable-libavcodec) _libavcodec=yes ;;
971 --disable-libavcodec) _libavcodec=no ;;
972 --enable-libavcodec_so) _libavcodec_so=yes ;;
973 --disable-libavcodec_so) _libavcodec_so=no ;;
974 --enable-amr_nb) _amr_nb=yes ;;
975 --disable-amr_nb) _amr_nb=no ;;
976 --enable-amr_nb-fixed) _amr_nb_fixed=yes ;;
977 --disable-amr_nb-fixed) _amr_nb_fixed=no ;;
978 --enable-amr_wb) _amr_wb=yes ;;
979 --disable-amr_wb) _amr_wb=no ;;
980 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
981 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
982 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
983 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
984 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
985 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
986 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
987 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
988 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
989 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
990 --enable-libavformat) _libavformat=yes;;
991 --disable-libavformat) _libavformat=no ;;
992 --enable-libavformat_so) _libavformat_so=yes ;;
993 --disable-libavformat_so) _libavformat_so=no ;;
994 --enable-libpostproc) _libpostproc=yes ;;
995 --disable-libpostproc) _libpostproc=no ;;
996 --enable-libpostproc_so) _libpostproc_so=yes ;;
997 --disable-libpostproc_so) _libpostproc_so=no ;;
998 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
999 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1001 --enable-lirc) _lirc=yes ;;
1002 --disable-lirc) _lirc=no ;;
1003 --enable-lircc) _lircc=yes ;;
1004 --disable-lircc) _lircc=no ;;
1005 --enable-gui) _gui=yes ;;
1006 --disable-gui) _gui=no ;;
1007 --enable-gtk1) _gtk1=yes ;;
1008 --disable-gtk1) _gtk1=no ;;
1009 --enable-termcap) _termcap=yes ;;
1010 --disable-termcap) _termcap=no ;;
1011 --enable-termios) _termios=yes ;;
1012 --disable-termios) _termios=no ;;
1013 --enable-3dfx) _3dfx=yes ;;
1014 --disable-3dfx) _3dfx=no ;;
1015 --enable-s3fb) _s3fb=yes ;;
1016 --disable-s3fb) _s3fb=no ;;
1017 --enable-tdfxfb) _tdfxfb=yes ;;
1018 --disable-tdfxfb) _tdfxfb=no ;;
1019 --disable-tdfxvid) _tdfxvid=no ;;
1020 --enable-tdfxvid) _tdfxvid=yes ;;
1021 --disable-tga) _tga=no ;;
1022 --enable-tga) _tga=yes ;;
1023 --enable-directfb) _directfb=yes ;;
1024 --disable-directfb) _directfb=no ;;
1025 --enable-zr) _zr=yes ;;
1026 --disable-zr) _zr=no ;;
1027 --enable-bl) _bl=yes ;;
1028 --disable-bl) _bl=no ;;
1029 --enable-mtrr) _mtrr=yes ;;
1030 --disable-mtrr) _mtrr=no ;;
1031 --enable-largefiles) _largefiles=yes ;;
1032 --disable-largefiles) _largefiles=no ;;
1033 --enable-shm) _shm=yes ;;
1034 --disable-shm) _shm=no ;;
1035 --enable-select) _select=yes ;;
1036 --disable-select) _select=no ;;
1037 --enable-linux-devfs) _linux_devfs=yes ;;
1038 --disable-linux-devfs) _linux_devfs=no ;;
1039 --enable-cdparanoia) _cdparanoia=yes ;;
1040 --disable-cdparanoia) _cdparanoia=no ;;
1041 --enable-cddb) _cddb=yes ;;
1042 --disable-cddb) _cddb=no ;;
1043 --enable-big-endian) _big_endian=yes ;;
1044 --disable-big-endian) _big_endian=no ;;
1045 --enable-bitmap-font) _bitmap_font=yes ;;
1046 --disable-bitmap-font) _bitmap_font=no ;;
1047 --enable-freetype) _freetype=yes ;;
1048 --disable-freetype) _freetype=no ;;
1049 --enable-fontconfig) _fontconfig=yes ;;
1050 --disable-fontconfig) _fontconfig=no ;;
1051 --enable-unrarlib) _unrarlib=yes ;;
1052 --disable-unrarlib) _unrarlib=no ;;
1053 --enable-ftp) _ftp=yes ;;
1054 --disable-ftp) _ftp=no ;;
1055 --enable-vstream) _vstream=yes ;;
1056 --disable-vstream) _vstream=no ;;
1057 --enable-pthreads) _pthreads=yes ;;
1058 --disable-pthreads) _pthreads=no ;;
1059 --enable-ass) _ass=yes ;;
1060 --disable-ass) _ass=no ;;
1061 --enable-rpath) _rpath=yes ;;
1062 --disable-rpath) _rpath=no ;;
1063 --enable-color-console) _color_console=yes ;;
1064 --disable-color-console) _color_console=no ;;
1066 --enable-fribidi) _fribidi=yes ;;
1067 --disable-fribidi) _fribidi=no ;;
1069 --enable-enca) _enca=yes ;;
1070 --disable-enca) _enca=no ;;
1072 --enable-inet6) _inet6=yes ;;
1073 --disable-inet6) _inet6=no ;;
1075 --enable-gethostbyname2) _gethostbyname2=yes ;;
1076 --disable-gethostbyname2) _gethostbyname2=no ;;
1078 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1079 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1080 --disable-dga) _dga=no ;;
1082 --enable-menu) _menu=yes ;;
1083 --disable-menu) _menu=no ;;
1085 --enable-qtx) _qtx=yes ;;
1086 --disable-qtx) _qtx=no ;;
1088 --enable-macosx) _macosx=yes ;;
1089 --disable-macosx) _macosx=no ;;
1090 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1091 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1092 --enable-macosx-bundle) _macosx_bundle=yes;;
1093 --disable-macosx-bundle) _macosx_bundle=no;;
1095 --enable-maemo) _maemo=yes ;;
1096 --disable-maemo) _maemo=no ;;
1098 --enable-sortsub) _sortsub=yes ;;
1099 --disable-sortsub) _sortsub=no ;;
1101 --enable-crash-debug) _crash_debug=yes ;;
1102 --disable-crash-debug) _crash_debug=no ;;
1103 --enable-sighandler) _sighandler=yes ;;
1104 --disable-sighandler) _sighandler=no ;;
1105 --enable-win32) _win32=yes ;;
1106 --disable-win32) _win32=no ;;
1108 --enable-sse) _sse=yes ;;
1109 --disable-sse) _sse=no ;;
1110 --enable-sse2) _sse2=yes ;;
1111 --disable-sse2) _sse2=no ;;
1112 --enable-mmxext) _mmxext=yes ;;
1113 --disable-mmxext) _mmxext=no ;;
1114 --enable-3dnow) _3dnow=yes ;;
1115 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1116 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1117 --disable-3dnowext) _3dnowext=no ;;
1118 --enable-cmov) _cmov=yes ;;
1119 --disable-cmov) _cmov=no ;;
1120 --enable-altivec) _altivec=yes ;;
1121 --disable-altivec) _altivec=no ;;
1122 --enable-armv5te) _armv5te=yes ;;
1123 --disable-armv5te) _armv5te=no ;;
1124 --enable-iwmmxt) _iwmmxt=yes ;;
1125 --disable-iwmmxt) _iwmmxt=no ;;
1126 --enable-mmx) _mmx=yes ;;
1127 --disable-mmx) # 3Dnow! and MMX2 require MMX
1128 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1131 echo "Unknown parameter: $ac_option"
1132 exit 1
1135 esac
1136 done
1138 # Atmos: moved this here, to be correct, if --prefix is specified
1139 test -z "$_bindir" && _bindir="$_prefix/bin"
1140 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1141 test -z "$_mandir" && _mandir="$_prefix/man"
1142 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1143 test -z "$_libdir" && _libdir="$_prefix/lib"
1145 # Determine our OS name and CPU architecture
1146 if test -z "$_target" ; then
1147 # OS name
1148 system_name=`uname -s 2>&1`
1149 case "$system_name" in
1150 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX)
1152 IRIX*)
1153 system_name=IRIX
1155 GNU/kFreeBSD)
1156 system_name=FreeBSD
1158 HP-UX*)
1159 system_name=HP-UX
1161 [cC][yY][gG][wW][iI][nN]*)
1162 system_name=CYGWIN
1164 MINGW32*)
1165 system_name=MINGW32
1168 system_name="$system_name-UNKNOWN"
1170 esac
1173 # host's CPU/instruction set
1174 host_arch=`uname -p 2>&1`
1175 case "$host_arch" in
1176 i386|sparc|ppc|alpha|arm|mips|vax)
1178 powerpc) # Darwin returns 'powerpc'
1179 host_arch=ppc
1181 *) # uname -p on Linux returns 'unknown' for the processor type,
1182 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1184 # Maybe uname -m (machine hardware name) returns something we
1185 # recognize.
1187 # x86/x86pc is used by QNX
1188 case "`uname -m 2>&1`" in
1189 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 ;;
1190 ia64) host_arch=ia64 ;;
1191 x86_64|amd64)
1192 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1193 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1194 host_arch=x86_64
1195 else
1196 host_arch=i386
1199 macppc|ppc|ppc64) host_arch=ppc ;;
1200 alpha) host_arch=alpha ;;
1201 sparc) host_arch=sparc ;;
1202 sparc64) host_arch=sparc64 ;;
1203 parisc*|hppa*|9000*) host_arch=hppa ;;
1204 arm*|zaurus|cats) host_arch=arm ;;
1205 s390) host_arch=s390 ;;
1206 s390x) host_arch=s390x ;;
1207 mips*) host_arch=mips ;;
1208 vax) host_arch=vax ;;
1209 *) host_arch=UNKNOWN ;;
1210 esac
1212 esac
1213 else # if test -z "$_target"
1214 system_name=`echo $_target | cut -d '-' -f 2`
1215 case "`echo $system_name | tr A-Z a-z`" in
1216 linux) system_name=Linux ;;
1217 freebsd) system_name=FreeBSD ;;
1218 gnu/kfreebsd) system_name=FreeBSD ;;
1219 netbsd) system_name=NetBSD ;;
1220 bsd/os) system_name=BSD/OS ;;
1221 openbsd) system_name=OpenBSD ;;
1222 sunos) system_name=SunOS ;;
1223 qnx) system_name=QNX ;;
1224 morphos) system_name=MorphOS ;;
1225 mingw32msvc) system_name=MINGW32 ;;
1226 esac
1227 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1228 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
1231 echo "Detected operating system: $system_name"
1232 echo "Detected host architecture: $host_arch"
1234 if test "$_runtime_cpudetection" = yes && not x86 && not ppc; then
1235 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1238 # LGB: temporary files
1239 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1240 test "$I" && break
1241 done
1243 TMPLOG="configure.log"
1244 rm -f "$TMPLOG"
1245 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1246 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1247 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
1248 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1250 # config files
1252 # FIXME: A lot of stuff is installed under /usr/local
1253 # NK: But we should never use this stuff implicitly since we call compiler
1254 # from /usr we should be sure that there no effects from other compilers
1255 # (libraries) which might be installed into /usr/local. Let users use this
1256 # stuff explicitly as command line argument. In other words: It would be
1257 # resonable to have only /usr/include or only /usr/local/include.
1259 if openbsd ; then
1260 _ldconfig="ldconfig -R"
1263 if freebsd ; then
1264 _ld_extra="$_ld_extra -L/usr/local/lib"
1265 _inc_extra="$_inc_extra -I/usr/local/include"
1268 if darwin; then
1269 _ldd="otool -L"
1270 _ld_extra="$_ld_extra -L/usr/local/lib"
1271 _inc_extra="$_inc_extra -I/usr/local/include"
1274 if aix ; then
1275 _ld_extra="$_ld_extra -lC"
1278 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
1279 if irix ; then
1280 _ranlib='ar -r'
1281 elif linux ; then
1282 _ranlib='true'
1285 if win32 ; then
1286 _exesuf=".exe"
1287 # -lwinmm is always needed for osdep/timer-win2.c
1288 _ld_extra="$_ld_extra -lwinmm"
1291 if mingw32 ; then
1292 _stream_cache=no
1293 _def_stream_cache="#undef USE_STREAM_CACHE"
1296 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1297 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1298 # know about '-n'.
1299 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1300 _head() { head -$1 2>/dev/null ; }
1301 else
1302 _head() { head -n $1 2>/dev/null ; }
1304 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1305 _tail() { tail -$1 2>/dev/null ; }
1306 else
1307 _tail() { tail -n $1 2>/dev/null ; }
1310 # Checking CC version...
1311 if test "$_gcc_check" = yes ; then
1312 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1313 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1314 echocheck "$_cc version"
1315 cc_vendor=intel
1316 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1317 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1318 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1319 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1320 # TODO verify older icc/ecc compatibility
1321 case $cc_version in
1323 cc_version="v. ?.??, bad"
1324 cc_verc_fail=yes
1326 8.0|9.1)
1327 cc_version="$cc_version, ok"
1328 cc_verc_fail=no
1331 cc_version="$cc_version, bad"
1332 cc_verc_fail=yes
1334 esac
1335 echores "$cc_version"
1336 else
1337 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
1338 echocheck "$_cc version"
1339 cc_vendor=gnu
1340 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1341 cc_version=`$_cc -dumpversion 2>&1`
1342 if test "$?" -gt 0; then
1343 cc_version="not found"
1345 case $cc_version in
1347 cc_version="v. ?.??, bad"
1348 cc_verc_fail=yes
1350 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1351 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1352 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1353 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1354 cc_version="$cc_version, ok"
1355 cc_verc_fail=no
1357 'not found')
1358 cc_verc_fail=yes
1361 cc_version="$cc_version, bad"
1362 cc_verc_fail=yes
1364 esac
1365 echores "$cc_version"
1366 test "$cc_verc_fail" = "no" && break
1367 done
1368 fi # icc
1369 if test "$cc_verc_fail" = yes ; then
1370 cat <<EOF
1372 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1374 You are not using a supported compiler. We do not have the time to make sure
1375 everything works with compilers other than the ones we use. Use either the
1376 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1377 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1379 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1380 mplayer and lame (which is used for mencoder). If you get compile errors,
1381 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1382 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1383 bugs!
1385 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1388 die "Bad gcc version"
1390 else
1391 cat <<EOF
1393 ******************************************************************************
1395 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1396 Ok. You know. Do it.
1398 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1399 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1400 Lame which is used by mencoder produces weird errors, too.
1402 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1403 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1405 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1407 ******************************************************************************
1411 read _answer
1414 echocheck "host cc"
1415 test "$_host_cc" || _host_cc=$_cc
1416 echores $_host_cc
1418 echocheck "cross compilation"
1419 if test $_cross_compile = auto ; then
1420 cat > $TMPC << EOF
1421 int main() { return 0; }
1423 _cross_compile=yes
1424 cc_check && "$TMPO" && _cross_compile=no
1426 echores $_cross_compile
1428 if test $_cross_compile = yes; then
1429 tmp_run() {
1430 return 0
1434 # ---
1436 # now that we know what compiler should be used for compilation, try to find
1437 # out which assembler is used by the $_cc compiler
1438 if test "$_as" = auto ; then
1439 _as=`$_cc -print-prog-name=as`
1440 test -z "$_as" && _as=as
1443 # XXX: this should be ok..
1444 _cpuinfo="echo"
1446 if test "$_runtime_cpudetection" = no ; then
1448 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1449 # FIXME: Remove the cygwin check once AMD CPUs are supported
1450 if test -r /proc/cpuinfo && not cygwin; then
1451 # Linux with /proc mounted, extract CPU information from it
1452 _cpuinfo="cat /proc/cpuinfo"
1453 elif test -r /compat/linux/proc/cpuinfo && not x86_32 ; then
1454 # FreeBSD with Linux emulation /proc mounted,
1455 # extract CPU information from it
1456 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1457 elif darwin && not x86_32 ; then
1458 # use hostinfo on Darwin
1459 _cpuinfo="hostinfo"
1460 elif aix; then
1461 # use 'lsattr' on AIX
1462 _cpuinfo="lsattr -E -l proc0 -a type"
1463 elif x86; then
1464 # all other OSes try to extract CPU information from a small helper
1465 # program TOOLS/cpuinfo instead
1466 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
1467 _cpuinfo="TOOLS/cpuinfo"
1470 if x86 ; then
1471 # gather more CPU information
1472 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1473 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1474 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1475 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1476 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1478 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1480 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1481 -e s/xmm/sse/ -e s/kni/sse/`
1483 for ext in $pparam ; do
1484 eval test \$_$ext = auto 2>/dev/null && eval _$ext=kernel_check
1485 done
1487 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1488 test $_sse = kernel_check && _mmxext=kernel_check
1490 echocheck "CPU vendor"
1491 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1493 echocheck "CPU type"
1494 echores "$pname"
1497 fi # test "$_runtime_cpudetection" = no
1500 case "$host_arch" in
1501 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1502 _def_arch_x86="#define ARCH_X86 1"
1503 _target_arch_x86="TARGET_ARCH_X86 = yes"
1504 _def_arch="#define ARCH_X86_32 1"
1505 _target_arch="TARGET_ARCH_X86_32 = yes"
1506 iproc=486
1507 proc=i486
1510 if test "$_runtime_cpudetection" = no ; then
1511 case "$pvendor" in
1512 AuthenticAMD)
1513 case "$pfamily" in
1514 3) proc=i386 iproc=386 ;;
1515 4) proc=i486 iproc=486 ;;
1516 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1517 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1518 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1519 proc=k6-3
1520 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1521 proc=geode
1522 elif test "$pmodel" -ge 8; then
1523 proc=k6-2
1524 elif test "$pmodel" -ge 6; then
1525 proc=k6
1526 else
1527 proc=i586
1530 6) iproc=686
1531 # It's a bit difficult to determine the correct type of Family 6
1532 # AMD CPUs just from their signature. Instead, we check directly
1533 # whether it supports SSE.
1534 if test "$_sse" = yes; then
1535 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1536 proc=athlon-xp
1537 else
1538 # Again, gcc treats athlon and athlon-tbird similarly.
1539 proc=athlon
1542 15) iproc=686
1543 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1544 # caught and remedied in the optimization tests below.
1545 proc=k8
1548 *) proc=k8 iproc=686 ;;
1549 esac
1551 GenuineIntel)
1552 case "$pfamily" in
1553 3) proc=i386 iproc=386 ;;
1554 4) proc=i486 iproc=486 ;;
1555 5) iproc=586
1556 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1557 proc=pentium-mmx # 4 is desktop, 8 is mobile
1558 else
1559 proc=i586
1562 6) iproc=686
1563 if test "$pmodel" -eq 15; then
1564 proc=core2
1565 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1566 proc=pentium-m
1567 elif test "$pmodel" -ge 7; then
1568 proc=pentium3
1569 elif test "$pmodel" -ge 3; then
1570 proc=pentium2
1571 else
1572 proc=i686
1575 15) iproc=686
1576 # A nocona in 32-bit mode has no more capabilities than a prescott.
1577 if test "$pmodel" -ge 3; then
1578 proc=prescott
1579 else
1580 proc=pentium4
1583 *) proc=prescott iproc=686 ;;
1584 esac
1586 CentaurHauls)
1587 case "$pfamily" in
1588 5) iproc=586
1589 if test "$pmodel" -ge 8; then
1590 proc=winchip2
1591 elif test "$pmodel" -ge 4; then
1592 proc=winchip-c6
1593 else
1594 proc=i586
1597 6) iproc=686
1598 if test "$pmodel" -ge 9; then
1599 proc=c3-2
1600 else
1601 proc=c3
1602 iproc=586
1605 *) proc=i686 iproc=i686 ;;
1606 esac
1608 unknown)
1609 case "$pfamily" in
1610 3) proc=i386 iproc=386 ;;
1611 4) proc=i486 iproc=486 ;;
1612 *) proc=i586 iproc=586 ;;
1613 esac
1616 proc=i586 iproc=586 ;;
1617 esac
1618 fi # test "$_runtime_cpudetection" = no
1621 # check that gcc supports our CPU, if not, fall back to earlier ones
1622 # LGB: check -mcpu and -march swithing step by step with enabling
1623 # to fall back till 386.
1625 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1627 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1628 cpuopt=-mtune
1629 else
1630 cpuopt=-mcpu
1633 echocheck "GCC & CPU optimization abilities"
1634 cat > $TMPC << EOF
1635 int main(void) { return 0; }
1637 if test "$_runtime_cpudetection" = no ; then
1638 if test "$proc" = "k8"; then
1639 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1641 if test "$proc" = "athlon-xp"; then
1642 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1644 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1645 cc_check -march=$proc $cpuopt=$proc || proc=k6
1647 if test "$proc" = "k6" || test "$proc" = "c3"; then
1648 if not cc_check -march=$proc $cpuopt=$proc; then
1649 if cc_check -march=i586 $cpuopt=i686; then
1650 proc=i586-i686
1651 else
1652 proc=i586
1656 if test "$proc" = "prescott" ; then
1657 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1659 if test "$proc" = "core2" ; then
1660 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1662 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
1663 cc_check -march=$proc $cpuopt=$proc || proc=i686
1665 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1666 cc_check -march=$proc $cpuopt=$proc || proc=i586
1668 if test "$proc" = "i586"; then
1669 cc_check -march=$proc $cpuopt=$proc || proc=i486
1671 if test "$proc" = "i486" ; then
1672 cc_check -march=$proc $cpuopt=$proc || proc=i386
1674 if test "$proc" = "i386" ; then
1675 cc_check -march=$proc $cpuopt=$proc || proc=error
1677 if test "$proc" = "error" ; then
1678 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1679 _mcpu=""
1680 _march=""
1681 _optimizing=""
1682 elif test "$proc" = "i586-i686"; then
1683 _march="-march=i586"
1684 _mcpu="$cpuopt=i686"
1685 _optimizing="$proc"
1686 else
1687 _march="-march=$proc"
1688 _mcpu="$cpuopt=$proc"
1689 _optimizing="$proc"
1691 else # if test "$_runtime_cpudetection" = no
1692 # i686 is probably the most common CPU - optimize for it
1693 _mcpu="$cpuopt=i686"
1694 # at least i486 required, for bswap instruction
1695 _march="-march=i486"
1696 cc_check $_mcpu || _mcpu=""
1697 cc_check $_march $_mcpu || _march=""
1700 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1701 ## autodetected mcpu/march parameters
1702 if test "$_target" ; then
1703 # TODO: it may be a good idea to check GCC and fall back in all cases
1704 if test "$host_arch" = "i586-i686"; then
1705 _march="-march=i586"
1706 _mcpu="$cpuopt=i686"
1707 else
1708 _march="-march=$host_arch"
1709 _mcpu="$cpuopt=$host_arch"
1712 proc="$host_arch"
1714 case "$proc" in
1715 i386) iproc=386 ;;
1716 i486) iproc=486 ;;
1717 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1718 i686|athlon*|pentium*) iproc=686 ;;
1719 *) iproc=586 ;;
1720 esac
1723 echores "$proc"
1726 ia64)
1727 _def_arch='#define ARCH_IA64 1'
1728 _target_arch='TARGET_ARCH_IA64 = yes'
1729 iproc='ia64'
1730 proc=''
1731 _march=''
1732 _mcpu=''
1733 _optimizing=''
1736 x86_64|amd64)
1737 _def_arch='#define ARCH_X86_64 1'
1738 _target_arch='TARGET_ARCH_X86_64 = yes'
1739 _def_arch_x86="#define ARCH_X86 1"
1740 _target_arch_x86="TARGET_ARCH_X86 = yes"
1741 iproc='x86_64'
1743 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1744 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1745 cpuopt=-mtune
1746 else
1747 cpuopt=-mcpu
1749 if test "$_runtime_cpudetection" = no ; then
1750 case "$pvendor" in
1751 AuthenticAMD)
1752 proc=k8;;
1753 GenuineIntel)
1754 case "$pmodel" in
1755 6) proc=core2;;
1757 # 64-bit prescotts exist, but as far as GCC is concerned they
1758 # have the same capabilities as a nocona.
1759 proc=nocona;;
1760 esac
1763 proc=error;;
1764 esac
1765 fi # test "$_runtime_cpudetection" = no
1767 echocheck "GCC & CPU optimization abilities"
1768 cat > $TMPC << EOF
1769 int main(void) { return 0; }
1771 # This is a stripped-down version of the i386 fallback.
1772 if test "$_runtime_cpudetection" = no ; then
1773 # --- AMD processors ---
1774 if test "$proc" = "k8"; then
1775 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1777 # This will fail if gcc version < 3.3, which is ok because earlier
1778 # versions don't really support 64-bit on amd64.
1779 # Is this a valid assumption? -Corey
1780 if test "$proc" = "athlon-xp"; then
1781 cc_check -march=$proc $cpuopt=$proc || proc=error
1783 # --- Intel processors ---
1784 if test "$proc" = "core2"; then
1785 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1787 if test "$proc" = "nocona"; then
1788 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1790 if test "$proc" = "pentium4"; then
1791 cc_check -march=$proc $cpuopt=$proc || proc=error
1794 _march="-march=$proc"
1795 _mcpu="$cpuopt=$proc"
1796 if test "$proc" = "error" ; then
1797 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1798 _mcpu=""
1799 _march=""
1801 else # if test "$_runtime_cpudetection" = no
1802 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1803 _march="-march=x86-64"
1804 _mcpu="$cpuopt=x86-64"
1805 cc_check $_mcpu || _mcpu=""
1806 cc_check $_march $_mcpu || _march=""
1809 _optimizing=""
1811 echores "$proc"
1814 sparc)
1815 _def_arch='#define ARCH_SPARC 1'
1816 _target_arch='TARGET_ARCH_SPARC = yes'
1817 iproc='sparc'
1818 if sunos ; then
1819 echocheck "CPU type"
1820 karch=`uname -m`
1821 case "`echo $karch`" in
1822 sun4) proc=v7 ;;
1823 sun4c) proc=v7 ;;
1824 sun4d) proc=v8 ;;
1825 sun4m) proc=v8 ;;
1826 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1827 sun4v) proc=v9 ;;
1828 *) proc=v8 ;;
1829 esac
1830 echores "$proc"
1831 else
1832 proc=v8
1834 _march=''
1835 _mcpu="-mcpu=$proc"
1836 _optimizing="$proc"
1839 sparc64)
1840 _def_arch='#define ARCH_SPARC 1'
1841 _target_arch='TARGET_ARCH_SPARC = yes'
1842 _vis='yes'
1843 _def_vis='#define HAVE_VIS = yes'
1844 iproc='sparc'
1845 proc='v9'
1846 _march=''
1847 _mcpu="-mcpu=$proc"
1848 _optimizing="$proc"
1851 arm|armv4l|armv5tel)
1852 _def_arch='#define ARCH_ARMV4L 1'
1853 _target_arch='TARGET_ARCH_ARMV4L = yes'
1854 iproc='arm'
1855 proc=''
1856 _march=''
1857 _mcpu=''
1858 _optimizing=''
1861 ppc)
1862 _def_arch='#define ARCH_POWERPC 1'
1863 _def_dcbzl='#define NO_DCBZL 1'
1864 _target_arch='TARGET_ARCH_POWERPC = yes'
1865 iproc='ppc'
1866 proc=''
1867 _march=''
1868 _mcpu=''
1869 _optimizing=''
1870 _altivec=no
1872 echocheck "CPU type"
1873 case $system_name in
1874 Linux)
1875 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1876 if test -n "`$_cpuinfo | grep altivec`"; then
1877 _altivec=yes
1880 Darwin)
1881 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1882 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
1883 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
1884 _altivec=yes
1887 NetBSD)
1888 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1889 case $cc_version in
1890 2*|3.0*|3.1*|3.2*|3.3*)
1893 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1894 _altivec=yes
1897 esac
1899 AIX)
1900 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
1902 esac
1903 if test "$_altivec" = yes; then
1904 echores "$proc altivec"
1905 else
1906 echores "$proc"
1909 echocheck "GCC & CPU optimization abilities"
1911 if test -n "$proc"; then
1912 case "$proc" in
1913 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1914 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1915 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1916 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1917 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1918 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1919 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
1920 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
1921 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
1922 *) ;;
1923 esac
1924 # gcc 3.1(.1) and up supports 7400 and 7450
1925 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1926 case "$proc" in
1927 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1928 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1929 *) ;;
1930 esac
1932 # gcc 3.2 and up supports 970
1933 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1934 case "$proc" in
1935 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
1936 _def_dcbzl='#undef NO_DCBZL' ;;
1937 *) ;;
1938 esac
1940 # gcc 3.3 and up supports POWER4
1941 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1942 case "$proc" in
1943 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
1944 *) ;;
1945 esac
1947 # gcc 3.4 and up supports 440*
1948 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
1949 case "$proc" in
1950 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
1951 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
1952 *) ;;
1953 esac
1955 # gcc 4.0 and up supports POWER5
1956 if test "$_cc_major" -ge "4"; then
1957 case "$proc" in
1958 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
1959 *) ;;
1960 esac
1964 if test -n "$_mcpu"; then
1965 _optimizing=`echo $_mcpu | cut -c 8-`
1966 echores "$_optimizing"
1967 else
1968 echores "none"
1973 alpha)
1974 _def_arch='#define ARCH_ALPHA 1'
1975 _target_arch='TARGET_ARCH_ALPHA = yes'
1976 iproc='alpha'
1977 _march=''
1979 echocheck "CPU type"
1980 cat > $TMPC << EOF
1981 int main() {
1982 unsigned long ver, mask;
1983 asm ("implver %0" : "=r" (ver));
1984 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1985 printf("%ld-%x\n", ver, ~mask);
1986 return 0;
1989 $_cc -o "$TMPO" "$TMPC"
1990 case `"$TMPO"` in
1992 0-0) proc="ev4"; cpu_understands_mvi="0";;
1993 1-0) proc="ev5"; cpu_understands_mvi="0";;
1994 1-1) proc="ev56"; cpu_understands_mvi="0";;
1995 1-101) proc="pca56"; cpu_understands_mvi="1";;
1996 2-303) proc="ev6"; cpu_understands_mvi="1";;
1997 2-307) proc="ev67"; cpu_understands_mvi="1";;
1998 2-1307) proc="ev68"; cpu_understands_mvi="1";;
1999 esac
2000 echores "$proc"
2002 echocheck "GCC & CPU optimization abilities"
2003 if test "$proc" = "ev68" ; then
2004 cc_check -mcpu=$proc || proc=ev67
2006 if test "$proc" = "ev67" ; then
2007 cc_check -mcpu=$proc || proc=ev6
2009 _mcpu="-mcpu=$proc"
2010 echores "$proc"
2012 _optimizing="$proc"
2014 echocheck "MVI instruction support in GCC"
2015 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
2016 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2017 echores "yes"
2018 else
2019 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2020 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2024 mips)
2025 _def_arch='#define ARCH_SGI_MIPS 1'
2026 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
2027 iproc='sgi-mips'
2028 proc=''
2029 _march=''
2030 _mcpu=''
2031 _optimizing=''
2033 if irix ; then
2034 echocheck "CPU type"
2035 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2036 case "`echo $proc`" in
2037 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2038 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2039 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2040 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2041 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2042 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2043 esac
2044 # gcc < 3.x does not support -mtune.
2045 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2046 _mcpu=''
2048 echores "$proc"
2053 hppa)
2054 _def_arch='#define ARCH_PA_RISC 1'
2055 _target_arch='TARGET_ARCH_PA_RISC = yes'
2056 iproc='PA-RISC'
2057 proc=''
2058 _march=''
2059 _mcpu=''
2060 _optimizing=''
2063 s390)
2064 _def_arch='#define ARCH_S390 1'
2065 _target_arch='TARGET_ARCH_S390 = yes'
2066 iproc='390'
2067 proc=''
2068 _march=''
2069 _mcpu=''
2070 _optimizing=''
2073 s390x)
2074 _def_arch='#define ARCH_S390X 1'
2075 _target_arch='TARGET_ARCH_S390X = yes'
2076 iproc='390x'
2077 proc=''
2078 _march=''
2079 _mcpu=''
2080 _optimizing=''
2083 vax)
2084 _def_arch='#define ARCH_VAX 1'
2085 _target_arch='TARGET_ARCH_VAX = yes'
2086 iproc='vax'
2087 proc=''
2088 _march=''
2089 _mcpu=''
2090 _optimizing=''
2093 generic)
2094 _def_arch='#define ARCH_GENERIC 1'
2095 _target_arch='TARGET_ARCH_GENERIC = yes'
2096 iproc=''
2097 proc=''
2098 _march=''
2099 _mcpu=''
2100 _optimizing=''
2104 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2105 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2106 die "unsupported architecture $host_arch"
2108 esac # case "$host_arch" in
2110 if test "$_runtime_cpudetection" = yes ; then
2111 if x86 ; then
2112 _cmov=yes
2113 x86_32 && _cmov=no
2114 _mmx=yes
2115 _3dnow=yes
2116 _3dnowext=yes
2117 _mmxext=yes
2118 _sse=yes
2119 _sse2=yes
2120 _mtrr=yes
2122 if ppc; then
2123 _altivec=yes
2127 if x86 && test "$_runtime_cpudetection" = no ; then
2128 extcheck() {
2129 if test "$1" = kernel_check ; then
2130 echocheck "kernel support of $2"
2131 cat > $TMPC <<EOF
2132 #include <signal.h>
2133 void catch() { exit(1); }
2134 int main(void){
2135 signal(SIGILL, catch);
2136 __asm__ __volatile__ ("$3":::"memory");return(0);
2140 if cc_check && tmp_run ; then
2141 eval _$2=yes
2142 echores "yes"
2143 _optimizing="$_optimizing $2"
2144 return 0
2145 else
2146 eval _$2=no
2147 echores "failed"
2148 echo "It seems that your kernel does not correctly support $2."
2149 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
2150 return 1
2153 return 0
2156 extcheck $_mmx "mmx" "emms"
2157 extcheck $_mmxext "mmxext" "sfence"
2158 extcheck $_3dnow "3dnow" "femms"
2159 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
2160 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
2161 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
2162 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
2164 echocheck "mtrr support"
2165 if test "$_mtrr" = kernel_check ; then
2166 _mtrr="yes"
2167 _optimizing="$_optimizing mtrr"
2169 echores "$_mtrr"
2171 if test "$_gcc3_ext" != ""; then
2172 # if we had to disable sse/sse2 because the active kernel does not
2173 # support this instruction set extension, we also have to tell
2174 # gcc3 to not generate sse/sse2 instructions for normal C code
2175 cat > $TMPC << EOF
2176 int main(void) { return 0; }
2178 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
2184 echocheck "assembler support of -pipe option"
2185 cat > $TMPC << EOF
2186 int main(void) { return 0; }
2188 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2191 echocheck "compiler support of named assembler arguments"
2192 _named_asm_args=yes
2193 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2194 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2195 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2196 _named_asm_args=no
2197 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2199 echores $_named_asm_args
2202 # Checking for CFLAGS
2203 _install_strip="-s"
2204 if test "$_profile" != "" || test "$_debug" != "" ; then
2205 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
2206 if test "$_cc_major" -ge "3" ; then
2207 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
2209 _install_strip=
2210 elif test -z "$CFLAGS" ; then
2211 if test "$cc_vendor" = "intel" ; then
2212 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2213 elif test "$cc_vendor" != "gnu" ; then
2214 CFLAGS="-O2 $_march $_mcpu $_pipe"
2215 else
2216 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2218 else
2219 _warn_CFLAGS=yes
2221 if test -n "$LDFLAGS" ; then
2222 _ld_extra="$_ld_extra $LDFLAGS"
2223 _warn_CFLAGS=yes
2224 elif test "$cc_vendor" = "intel" ; then
2225 _ld_extra="$_ld_extra -i-static"
2227 if test -n "$CPPFLAGS" ; then
2228 _inc_extra="$_inc_extra $CPPFLAGS"
2229 _warn_CFLAGS=yes
2234 if x86_32 ; then
2235 # Checking assembler (_as) compatibility...
2236 # Added workaround for older as that reads from stdin by default - atmos
2237 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2238 echocheck "assembler ($_as $as_version)"
2240 _pref_as_version='2.9.1'
2241 echo 'nop' > $TMPS
2242 if test "$_mmx" = yes ; then
2243 echo 'emms' >> $TMPS
2245 if test "$_3dnow" = yes ; then
2246 _pref_as_version='2.10.1'
2247 echo 'femms' >> $TMPS
2249 if test "$_3dnowext" = yes ; then
2250 _pref_as_version='2.10.1'
2251 echo 'pswapd %mm0, %mm0' >> $TMPS
2253 if test "$_mmxext" = yes ; then
2254 _pref_as_version='2.10.1'
2255 echo 'movntq %mm0, (%eax)' >> $TMPS
2257 if test "$_sse" = yes ; then
2258 _pref_as_version='2.10.1'
2259 echo 'xorps %xmm0, %xmm0' >> $TMPS
2261 #if test "$_sse2" = yes ; then
2262 # _pref_as_version='2.11'
2263 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2265 if test "$_cmov" = yes ; then
2266 _pref_as_version='2.10.1'
2267 echo 'cmovb %eax, %ebx' >> $TMPS
2269 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2271 if test "$as_verc_fail" != yes ; then
2272 echores "ok"
2273 else
2274 _res_comment="Upgrade binutils to ${_pref_as_version} ..."
2275 echores "failed"
2276 die "obsolete binutils version"
2279 fi #if x86_32
2281 echocheck ".align is a power of two"
2282 if test "$_asmalign_pot" = auto ; then
2283 _asmalign_pot=no
2284 cat > $TMPC << EOF
2285 main() { asm (".align 3"); }
2287 cc_check && _asmalign_pot=yes
2289 if test "$_asmalign_pot" = "yes" ; then
2290 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2291 else
2292 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2294 echores $_asmalign_pot
2297 #FIXME: This should happen before the check for CFLAGS..
2298 if ppc ; then
2300 # check if altivec is supported by the compiler, and how to enable it
2302 _altivec_gcc_flags=''
2304 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2305 echocheck "GCC altivec support"
2307 p=''
2308 cat > $TMPC << EOF
2309 int main() {
2310 return 0;
2313 FSF_flags='-maltivec -mabi=altivec'
2314 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2316 # check for Darwin-style flags first, since
2317 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2318 # accepts but ignores FSF-style flags...
2320 if test -z "$p"; then
2321 cc_check $Darwin_flags && p='Darwin'
2323 if test -z "$p"; then
2324 cc_check $FSF_flags && p='FSF'
2327 case $p in
2328 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2329 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2330 *) _altivec=no ;;
2331 esac
2333 if test -z "$p"; then
2334 p=none
2335 else
2336 p="$p-style ($_altivec_gcc_flags)"
2339 echores "$p"
2342 # check if <altivec.h> should be included
2344 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2346 if test "$_altivec" = yes ; then
2347 echocheck "altivec.h"
2348 cat > $TMPC << EOF
2349 #include <altivec.h>
2350 int main(void) { return 0; }
2352 _have_altivec_h=no
2353 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2354 if test "$_have_altivec_h" = yes ; then
2355 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2357 echores "$_have_altivec_h"
2360 # disable runtime cpudetection if
2361 # - we cannot generate altivec code
2362 # - altivec is disabled by the user
2364 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2365 _runtime_cpudetection=no
2368 # show that we are optimizing for altivec (if enabled and supported)
2370 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2371 _optimizing="$_optimizing altivec"
2374 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2376 if test "$_altivec" = yes ; then
2377 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2378 #_mcpu="$_mcpu $_altivec_gcc_flags"
2379 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2382 # setup _def_altivec correctly
2384 if test "$_altivec" = yes ; then
2385 _def_altivec='#define HAVE_ALTIVEC 1'
2386 else
2387 _def_altivec='#undef HAVE_ALTIVEC'
2391 if arm ; then
2392 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2393 if test $_armv5te = "auto" ; then
2394 cat > $TMPC << EOF
2395 int main(void) {
2396 __asm__ __volatile__ ("qadd r0, r0, r0");
2399 _armv5te=no
2400 cc_check && _armv5te=yes
2402 echores "$_armv5te"
2404 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2405 if test $_iwmmxt = "auto" ; then
2406 cat > $TMPC << EOF
2407 int main(void) {
2408 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2411 _iwmmxt=no
2412 cc_check && _iwmmxt=yes
2414 echores "$_iwmmxt"
2417 _def_mmx='#undef HAVE_MMX'
2418 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2419 _def_mmxext='#undef HAVE_MMX2'
2420 test "$_mmxext" = yes && _def_mmxext='#define HAVE_MMX2 1'
2421 _def_3dnow='#undef HAVE_3DNOW'
2422 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2423 _def_3dnowext='#undef HAVE_3DNOWEX'
2424 test "$_3dnowext" = yes && _def_3dnowext='#define HAVE_3DNOWEX 1'
2425 _def_sse='#undef HAVE_SSE'
2426 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2427 _def_sse2='#undef HAVE_SSE2'
2428 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2429 _def_cmov='#undef HAVE_CMOV'
2430 test "$_cmov" = yes && _def_cmov='#define HAVE_CMOV 1'
2431 _def_armv5te='#undef HAVE_ARMV5TE'
2432 test "$_armv5te" = yes && _def_armv5te='#define HAVE_ARMV5TE 1'
2433 _def_iwmmxt='#undef HAVE_IWMMXT'
2434 test "$_iwmmxt" = yes && _def_iwmmxt='#define HAVE_IWMMXT 1'
2436 # Checking kernel version...
2437 if x86_32 && linux ; then
2438 _k_verc_problem=no
2439 kernel_version=`uname -r 2>&1`
2440 echocheck "$system_name kernel version"
2441 case "$kernel_version" in
2442 '') kernel_version="?.??"; _k_verc_fail=yes;;
2443 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2444 _k_verc_problem=yes;;
2445 esac
2446 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2447 _k_verc_fail=yes
2449 if test "$_k_verc_fail" ; then
2450 echores "$kernel_version, fail"
2451 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2452 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2453 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2454 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2455 echo "2.2.x you must upgrade it to get SSE support!"
2456 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2457 else
2458 echores "$kernel_version, ok"
2462 if test "$_vidix_internal" = auto ; then
2463 _vidix_internal=no
2464 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2465 x86 && _vidix_internal=yes
2466 ppc && linux && _vidix_internal=yes
2467 alpha && linux && _vidix_internal=yes
2468 qnx && _vidix_internal=no
2469 sunos && _vidix_internal=no
2470 beos && _vidix_internal=no
2471 darwin && _vidix_internal=no
2475 # On QNX we must link to libph - Gabucino
2476 if qnx ; then
2477 _ld_extra="$_ld_extra -lph"
2480 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2481 _awk=
2482 if test "$_vidix_internal" = yes ; then
2483 _awk_verc_fail=yes
2484 echocheck "awk"
2485 for _awk in mawk gawk nawk awk; do
2486 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2487 _awk_verc_fail=no
2488 break
2490 done
2491 test "$_awk_verc_fail" = yes && _awk=no
2492 echores "$_awk"
2493 if test "$_awk_verc_fail" = yes; then
2494 echo "VIDIX needs awk, but no working implementation was found!"
2495 echo "Try the GNU version, which can be downloaded from:"
2496 echo "ftp://ftp.gnu.org/gnu/gawk/"
2497 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2498 die "no awk"
2502 ######################
2503 # MAIN TESTS GO HERE #
2504 ######################
2507 echocheck "extra headers"
2508 if test "$_inc_extra" ; then
2509 echores "$_inc_extra"
2510 else
2511 echores "none"
2515 echocheck "extra libs"
2516 if test "$_ld_extra" ; then
2517 echores "$_ld_extra"
2518 else
2519 echores "none"
2522 echocheck "-lposix"
2523 cat > $TMPC <<EOF
2524 int main(void) { return 0; }
2526 if cc_check -lposix ; then
2527 _ld_extra="$_ld_extra -lposix"
2528 echores "yes"
2529 else
2530 echores "no"
2533 echocheck "-lm"
2534 cat > $TMPC <<EOF
2535 int main(void) { return 0; }
2537 if cc_check -lm ; then
2538 _ld_lm="-lm"
2539 echores "yes"
2540 else
2541 _ld_lm=""
2542 echores "no"
2546 echocheck "langinfo"
2547 if test "$_langinfo" = auto ; then
2548 cat > $TMPC <<EOF
2549 #include <langinfo.h>
2550 int main(void) { nl_langinfo(CODESET); return 0; }
2552 _langinfo=no
2553 cc_check && _langinfo=yes
2555 if test "$_langinfo" = yes ; then
2556 _def_langinfo='#define USE_LANGINFO 1'
2557 else
2558 _def_langinfo='#undef USE_LANGINFO'
2560 echores "$_langinfo"
2563 echocheck "language"
2564 test -z "$_language" && _language=$LINGUAS
2565 _language=`echo $_language | sed 's/,/ /g'`
2566 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2567 for lang in $_language ; do
2568 test "$lang" = all && lang=en
2569 if test -f "help/help_mp-${lang}.h" ; then
2570 _language=$lang
2571 break
2572 else
2573 echo ${_echo_n} "$lang not found, ${_echo_c}"
2574 _language=`echo $_language | sed "s/$lang *//"`
2576 done
2577 test -z "$_language" && _language=en
2578 _mp_help="help/help_mp-${_language}.h"
2579 test -f $_mp_help || die "$_mp_help not found"
2580 for lang in $LANGUAGES ; do
2581 if test -f "DOCS/man/$lang/mplayer.1" ; then
2582 MAN_LANG="$lang $MAN_LANG"
2584 done
2585 _doc_lang=$_language
2586 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2587 echores "using $_language (man pages: $MAN_LANG)"
2590 echocheck "enable sighandler"
2591 if test "$_sighandler" = yes ; then
2592 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2593 else
2594 _def_sighandler='#undef ENABLE_SIGHANDLER'
2596 echores "$_sighandler"
2598 echocheck "runtime cpudetection"
2599 if test "$_runtime_cpudetection" = yes ; then
2600 _optimizing="Runtime CPU-Detection enabled"
2601 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2602 else
2603 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2605 echores "$_runtime_cpudetection"
2608 echocheck "restrict keyword"
2609 for restrict_keyword in restrict __restrict __restrict__ ; do
2610 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2611 if cc_check; then
2612 _def_restrict_keyword=$restrict_keyword
2613 break;
2615 done
2616 if [ -n "$_def_restrict_keyword" ]; then
2617 echores "$_def_restrict_keyword"
2618 else
2619 echores "none"
2621 # Avoid infinite recursion loop ("#define restrict restrict")
2622 if [ "$_def_restrict_keyword" != "restrict" ]; then
2623 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2624 else
2625 _def_restrict_keyword=""
2629 echocheck "__builtin_expect"
2630 # GCC branch prediction hint
2631 cat > $TMPC << EOF
2632 int foo (int a) {
2633 a = __builtin_expect (a, 10);
2634 return a == 10 ? 0 : 1;
2636 int main() { return foo(10) && foo(0); }
2638 _builtin_expect=no
2639 cc_check && _builtin_expect=yes
2640 if test "$_builtin_expect" = yes ; then
2641 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2642 else
2643 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2645 echores "$_builtin_expect"
2648 echocheck "kstat"
2649 cat > $TMPC << EOF
2650 #include <kstat.h>
2651 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2653 _kstat=no
2654 cc_check -lkstat && _kstat=yes
2655 if test "$_kstat" = yes ; then
2656 _def_kstat="#define HAVE_LIBKSTAT 1"
2657 _ld_extra="$_ld_extra -lkstat"
2658 else
2659 _def_kstat="#undef HAVE_LIBKSTAT"
2661 echores "$_kstat"
2664 echocheck "posix4"
2665 # required for nanosleep on some systems
2666 cat > $TMPC << EOF
2667 #include <time.h>
2668 int main(void) { (void) nanosleep(0, 0); return 0; }
2670 _posix4=no
2671 cc_check -lposix4 && _posix4=yes
2672 if test "$_posix4" = yes ; then
2673 _ld_extra="$_ld_extra -lposix4"
2675 echores "$_posix4"
2677 echocheck "lrintf"
2678 cat > $TMPC << EOF
2679 #include <math.h>
2680 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2682 _lrintf=no
2683 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2684 if test "$_lrintf" = yes ; then
2685 _def_lrintf="#define HAVE_LRINTF 1"
2686 else
2687 _def_lrintf="#undef HAVE_LRINTF"
2689 echores "$_lrintf"
2691 echocheck "round"
2692 cat > $TMPC << EOF
2693 #include <math.h>
2694 int main(void) { (void) round(0.0); return 0; }
2696 _round=no
2697 cc_check $_ld_lm && _round=yes
2698 if test "$_round" = yes ; then
2699 _def_round="#define HAVE_ROUND 1"
2700 else
2701 _def_round="#undef HAVE_ROUND"
2703 echores "$_round"
2705 echocheck "nanosleep"
2706 # also check for nanosleep
2707 cat > $TMPC << EOF
2708 #include <time.h>
2709 int main(void) { (void) nanosleep(0, 0); return 0; }
2711 _nanosleep=no
2712 cc_check && _nanosleep=yes
2713 if test "$_nanosleep" = yes ; then
2714 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2715 else
2716 _def_nanosleep='#undef HAVE_NANOSLEEP'
2718 echores "$_nanosleep"
2721 echocheck "socklib"
2722 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2723 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2724 cat > $TMPC << EOF
2725 #include <netdb.h>
2726 #include <sys/socket.h>
2727 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2729 _socklib=no
2730 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2731 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2732 done
2733 if test $_winsock2 = auto && not cygwin ; then
2734 _winsock2=no
2735 cat > $TMPC << EOF
2736 #include <winsock2.h>
2737 int main(void) { (void) gethostbyname(0); return 0; }
2739 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2741 test "$_ld_sock" && _res_comment="using $_ld_sock"
2742 echores "$_socklib"
2745 if test $_winsock2 = yes ; then
2746 _ld_sock="-lws2_32"
2747 _def_winsock2='#define HAVE_WINSOCK2 1'
2748 else
2749 _def_winsock2='#undef HAVE_WINSOCK2'
2753 _use_aton=no
2754 echocheck "inet_pton()"
2755 cat > $TMPC << EOF
2756 #include <sys/types.h>
2757 #include <sys/socket.h>
2758 #include <arpa/inet.h>
2759 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2761 if test "$_winsock2" = yes ; then
2762 _res_comment="using winsock2 functions instead"
2763 echores "no"
2764 elif cc_check $_ld_sock ; then
2765 # NOTE: Linux has libresolv but does not need it
2767 _res_comment="using $_ld_sock"
2768 echores "yes"
2769 elif cc_check $_ld_sock -lresolv ; then
2770 # NOTE: needed for SunOS at least
2771 _ld_sock="$_ld_sock -lresolv"
2772 _res_comment="using $_ld_sock"
2773 echores "yes"
2774 else
2775 _res_comment="trying inet_aton next"
2776 echores "no"
2778 echocheck "inet_aton()"
2779 cat > $TMPC << EOF
2780 #include <sys/types.h>
2781 #include <sys/socket.h>
2782 #include <arpa/inet.h>
2783 int main(void) { (void) inet_aton(0, 0); return 0; }
2785 _use_aton=yes
2786 if cc_check $_ld_sock ; then
2787 # NOTE: Linux has libresolv but does not need it
2789 _res_comment="using $_ld_sock"
2790 elif cc_check $_ld_sock -lresolv ; then
2791 # NOTE: needed for SunOS at least
2792 _ld_sock="$_ld_sock -lresolv"
2793 _res_comment="using $_ld_sock"
2794 else
2795 _use_aton=no
2796 _network=no
2797 _res_comment="network support disabled"
2799 echores "$_use_aton"
2802 _def_use_aton='#undef USE_ATON'
2803 if test "$_use_aton" = yes; then
2804 _def_use_aton='#define USE_ATON 1'
2807 echocheck "network"
2808 # FIXME network check
2809 if test "$_network" = yes ; then
2810 _def_network='#define MPLAYER_NETWORK 1'
2811 _ld_extra="$_ld_extra $_ld_sock"
2812 _inputmodules="network $_inputmodules"
2813 else
2814 _noinputmodules="network $_noinputmodules"
2815 _def_network='#undef MPLAYER_NETWORK'
2816 _ftp=no
2818 echores "$_network"
2820 echocheck "inttypes.h (required)"
2821 cat > $TMPC << EOF
2822 #include <inttypes.h>
2823 int main(void) { return 0; }
2825 _inttypes=no
2826 cc_check && _inttypes=yes
2827 echores "$_inttypes"
2829 if test "$_inttypes" = no ; then
2830 echocheck "bitypes.h (inttypes.h predecessor)"
2831 cat > $TMPC << EOF
2832 #include <sys/bitypes.h>
2833 int main(void) { return 0; }
2835 cc_check && _inttypes=yes
2836 if test "$_inttypes" = yes ; then
2837 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."
2838 else
2839 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2844 echocheck "int_fastXY_t in inttypes.h"
2845 cat > $TMPC << EOF
2846 #include <inttypes.h>
2847 int main(void) {
2848 volatile int_fast16_t v= 0;
2849 return v; }
2851 _fast_inttypes=no
2852 cc_check && _fast_inttypes=yes
2853 if test "$_fast_inttypes" = yes ; then
2854 # nothing to do
2856 else
2857 _def_fast_inttypes='
2858 typedef signed char int_fast8_t;
2859 typedef signed int int_fast16_t;
2860 typedef signed int int_fast32_t;
2861 typedef signed long long int_fast64_t;
2862 typedef unsigned char uint_fast8_t;
2863 typedef unsigned int uint_fast16_t;
2864 typedef unsigned int uint_fast32_t;
2865 typedef unsigned long long uint_fast64_t;'
2867 echores "$_fast_inttypes"
2870 echocheck "word size"
2871 _mp_wordsize="#undef MP_WORDSIZE"
2872 cat > $TMPC << EOF
2873 #include <stdio.h>
2874 #include <sys/types.h>
2875 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2877 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2878 echores "$_wordsize"
2881 echocheck "stddef.h"
2882 cat > $TMPC << EOF
2883 #include <stddef.h>
2884 int main(void) { return 0; }
2886 _stddef=no
2887 cc_check && _stddef=yes
2888 if test "$_stddef" = yes ; then
2889 _def_stddef='#define HAVE_STDDEF_H 1'
2890 else
2891 _def_stddef='#undef HAVE_STDDEF_H'
2893 echores "$_stddef"
2896 echocheck "malloc.h"
2897 cat > $TMPC << EOF
2898 #include <malloc.h>
2899 int main(void) { (void) malloc(0); return 0; }
2901 _malloc=no
2902 cc_check && _malloc=yes
2903 if test "$_malloc" = yes ; then
2904 _def_malloc='#define HAVE_MALLOC_H 1'
2905 else
2906 _def_malloc='#undef HAVE_MALLOC_H'
2908 # malloc.h emits a warning in FreeBSD and OpenBSD
2909 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2910 echores "$_malloc"
2913 echocheck "memalign()"
2914 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2915 cat > $TMPC << EOF
2916 #include <malloc.h>
2917 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2919 _memalign=no
2920 cc_check && _memalign=yes
2921 if test "$_memalign" = yes ; then
2922 _def_memalign='#define HAVE_MEMALIGN 1'
2923 else
2924 _def_memalign='#undef HAVE_MEMALIGN'
2925 _def_map_memalign='#define memalign(a,b) malloc(b)'
2926 not darwin && _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2928 echores "$_memalign"
2931 echocheck "alloca.h"
2932 cat > $TMPC << EOF
2933 #include <alloca.h>
2934 int main(void) { (void) alloca(0); return 0; }
2936 _alloca=no
2937 cc_check && _alloca=yes
2938 if cc_check ; then
2939 _def_alloca='#define HAVE_ALLOCA_H 1'
2940 else
2941 _def_alloca='#undef HAVE_ALLOCA_H'
2943 echores "$_alloca"
2946 echocheck "mman.h"
2947 cat > $TMPC << EOF
2948 #include <sys/types.h>
2949 #include <sys/mman.h>
2950 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2952 _mman=no
2953 cc_check && _mman=yes
2954 if test "$_mman" = yes ; then
2955 _def_mman='#define HAVE_SYS_MMAN_H 1'
2956 else
2957 _def_mman='#undef HAVE_SYS_MMAN_H'
2959 echores "$_mman"
2961 cat > $TMPC << EOF
2962 #include <sys/types.h>
2963 #include <sys/mman.h>
2964 int main(void) { void *p = MAP_FAILED; return 0; }
2966 _mman_has_map_failed=no
2967 cc_check && _mman_has_map_failed=yes
2968 if test "$_mman_has_map_failed" = yes ; then
2969 _def_mman_has_map_failed=''
2970 else
2971 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2974 echocheck "dynamic loader"
2975 cat > $TMPC << EOF
2976 #include <dlfcn.h>
2977 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2979 _dl=no
2980 for _ld_tmp in "" "-ldl" ; do
2981 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2982 done
2983 if test "$_dl" = yes ; then
2984 _def_dl='#define HAVE_LIBDL 1'
2985 else
2986 _def_dl='#undef HAVE_LIBDL'
2988 echores "$_dl"
2991 echocheck "dynamic a/v plugins support"
2992 if test "$_dl" = no ; then
2993 _dynamic_plugins=no
2995 if test "$_dynamic_plugins" = yes ; then
2996 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
2997 else
2998 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3000 echores "$_dynamic_plugins"
3003 #echocheck "dynamic linking"
3004 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
3005 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
3006 #cat > $TMPC << EOF
3007 #int main(void) { return 0; }
3008 #EOF
3009 #if cc_check -rdynamic ; then
3010 # _ld_dl_dynamic='-rdynamic'
3011 #elif cc_check -Bdynamic ; then
3012 # _ld_dl_dynamic='-Bdynamic'
3013 #elif cc_check ; then
3014 # _ld_dl_dynamic=''
3016 #echores "using $_ld_dl_dynamic"
3018 _def_threads='#undef HAVE_THREADS'
3020 echocheck "pthread"
3021 if test "$_pthreads" = auto ; then
3022 cat > $TMPC << EOF
3023 #include <pthread.h>
3024 void* func(void *arg) { return arg; }
3025 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3027 _pthreads=no
3028 if not hpux ; then
3029 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3030 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3031 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3032 done
3035 if test "$_pthreads" = yes ; then
3036 _res_comment="using $_ld_pthread"
3037 _def_pthreads='#define HAVE_PTHREADS 1'
3038 _def_threads='#define HAVE_THREADS 1'
3039 else
3040 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3041 _def_pthreads='#undef HAVE_PTHREADS'
3042 _nas=no ; _tv_v4l1=no ; _macosx=no
3043 if not mingw32 ; then
3044 _win32=no
3047 echores "$_pthreads"
3049 echocheck "rpath"
3050 netbsd &&_rpath=yes
3051 if test "$_rpath" = yes ; then
3052 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3053 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3054 done
3055 _ld_extra=$tmp
3057 echores "$_rpath"
3059 echocheck "iconv"
3060 if test "$_iconv" = auto ; then
3061 _iconv_tmp='#include <iconv.h>'
3063 cat > $TMPC << EOF
3064 #include <stdio.h>
3065 #include <unistd.h>
3066 $_iconv_tmp
3067 #define INBUFSIZE 1024
3068 #define OUTBUFSIZE 4096
3070 char inbuffer[INBUFSIZE];
3071 char outbuffer[OUTBUFSIZE];
3073 int main(void) {
3074 size_t numread;
3075 iconv_t icdsc;
3076 char *tocode="UTF-8";
3077 char *fromcode="cp1250";
3078 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3079 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3080 char *iptr=inbuffer;
3081 char *optr=outbuffer;
3082 size_t inleft=numread;
3083 size_t outleft=OUTBUFSIZE;
3084 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3085 != (size_t)(-1)) {
3086 write (1, outbuffer, OUTBUFSIZE - outleft);
3089 if (iconv_close(icdsc) == -1)
3094 _iconv=no
3095 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3096 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3097 _iconv=yes && break
3098 done
3100 if test "$_iconv" = yes ; then
3101 _def_iconv='#define USE_ICONV 1'
3102 else
3103 _def_iconv='#undef USE_ICONV'
3105 echores "$_iconv"
3108 echocheck "sys/soundcard.h"
3109 cat > $TMPC << EOF
3110 #include <sys/soundcard.h>
3111 int main(void) { return 0; }
3113 _sys_soundcard=no
3114 cc_check && _sys_soundcard=yes
3115 if test "$_sys_soundcard" = yes ; then
3116 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3117 _include_soundcard='#include <sys/soundcard.h>'
3118 else
3119 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3121 echores "$_sys_soundcard"
3123 if test "$_sys_soundcard" != yes ; then
3124 echocheck "soundcard.h"
3125 cat > $TMPC << EOF
3126 #include <soundcard.h>
3127 int main(void) { return 0; }
3129 _soundcard=no
3130 cc_check && _soundcard=yes
3131 if linux || test "$_ossaudio" != no ; then
3132 # use soundcard.h on Linux, or when OSS support is enabled
3133 echores "$_soundcard"
3134 else
3135 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
3136 _res_comment= "but ignored!"
3137 echores "$_soundcard"
3138 _soundcard=no
3140 if test "$_soundcard" = yes ; then
3141 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3142 _include_soundcard='#include <soundcard.h>'
3143 else
3144 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3146 else
3147 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3151 echocheck "sys/dvdio.h"
3152 cat > $TMPC << EOF
3153 #include <unistd.h>
3154 #include <sys/dvdio.h>
3155 int main(void) { return 0; }
3157 _dvdio=no
3158 cc_check && _dvdio=yes
3159 if test "$_dvdio" = yes ; then
3160 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3161 else
3162 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3164 echores "$_dvdio"
3167 echocheck "sys/cdio.h"
3168 cat > $TMPC << EOF
3169 #include <unistd.h>
3170 #include <sys/cdio.h>
3171 int main(void) { return 0; }
3173 _cdio=no
3174 cc_check && _cdio=yes
3175 if test "$_cdio" = yes ; then
3176 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3177 else
3178 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3180 echores "$_cdio"
3183 echocheck "linux/cdrom.h"
3184 cat > $TMPC << EOF
3185 #include <sys/types.h>
3186 #include <linux/cdrom.h>
3187 int main(void) { return 0; }
3189 _cdrom=no
3190 cc_check && _cdrom=yes
3191 if test "$_cdrom" = yes ; then
3192 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3193 else
3194 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3196 echores "$_cdrom"
3199 echocheck "dvd.h"
3200 cat > $TMPC << EOF
3201 #include <dvd.h>
3202 int main(void) { return 0; }
3204 _dvd=no
3205 cc_check && _dvd=yes
3206 if test "$_dvd" = yes ; then
3207 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3208 else
3209 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3211 echores "$_dvd"
3214 if bsdos; then
3215 echocheck "BSDI dvd.h"
3216 cat > $TMPC << EOF
3217 #include <dvd.h>
3218 int main(void) { return 0; }
3220 _bsdi_dvd=no
3221 cc_check && _bsdi_dvd=yes
3222 if test "$_bsdi_dvd" = yes ; then
3223 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3224 else
3225 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3227 echores "$_bsdi_dvd"
3228 fi #if bsdos
3231 if hpux; then
3232 # also used by AIX, but AIX does not support VCD and/or libdvdread
3233 echocheck "HP-UX SCSI header"
3234 cat > $TMPC << EOF
3235 #include <sys/scsi.h>
3236 int main(void) { return 0; }
3238 _hpux_scsi_h=no
3239 cc_check && _hpux_scsi_h=yes
3240 if test "$_hpux_scsi_h" = yes ; then
3241 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3242 else
3243 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3245 echores "$_hpux_scsi_h"
3246 fi #if hpux
3249 if sunos; then
3250 echocheck "userspace SCSI headers (Solaris)"
3251 cat > $TMPC << EOF
3252 # include <unistd.h>
3253 # include <stropts.h>
3254 # include <sys/scsi/scsi_types.h>
3255 # include <sys/scsi/impl/uscsi.h>
3256 int main(void) { return 0; }
3258 _sol_scsi_h=no
3259 cc_check && _sol_scsi_h=yes
3260 if test "$_sol_scsi_h" = yes ; then
3261 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3262 else
3263 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3265 echores "$_sol_scsi_h"
3266 fi #if sunos
3269 echocheck "termcap"
3270 if test "$_termcap" = auto ; then
3271 cat > $TMPC <<EOF
3272 int main(void) { tgetent(); return 0; }
3274 _termcap=no
3275 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3276 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3277 && _termcap=yes && break
3278 done
3280 if test "$_termcap" = yes ; then
3281 _def_termcap='#define USE_TERMCAP 1'
3282 _res_comment="using $_ld_tmp"
3283 else
3284 _def_termcap='#undef USE_TERMCAP'
3286 echores "$_termcap"
3289 echocheck "termios"
3290 if test "$_termios" = auto ; then
3291 cat > $TMPC <<EOF
3292 #include <sys/termios.h>
3293 int main(void) { return 0; }
3295 _termios=auto
3296 cc_check && _termios=yes
3297 _def_termios_h_name='sys/termios.h'
3299 # second test:
3300 if test "$_termios" = auto ; then
3301 cat > $TMPC <<EOF
3302 #include <termios.h>
3303 int main(void) { return 0; }
3305 _termios=no
3306 cc_check && _termios=yes
3307 _def_termios_h_name='termios.h'
3310 if test "$_termios" = yes ; then
3311 _def_termios='#define HAVE_TERMIOS 1'
3312 _def_termios_h='#undef HAVE_TERMIOS_H'
3313 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3315 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3316 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3317 elif test "$_def_termios_h_name" = 'termios.h' ; then
3318 _def_termios_h='#define HAVE_TERMIOS_H 1'
3320 _res_comment="using $_def_termios_h_name"
3321 else
3322 _def_termios='#undef HAVE_TERMIOS'
3323 _def_termios_h_name=''
3324 _termios=no
3326 echores "$_termios"
3329 echocheck "shm"
3330 if test "$_shm" = auto ; then
3331 cat > $TMPC << EOF
3332 #include <sys/types.h>
3333 #include <sys/shm.h>
3334 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3336 _shm=no
3337 cc_check && _shm=yes
3339 if test "$_shm" = yes ; then
3340 _def_shm='#define HAVE_SHM 1'
3341 else
3342 _def_shm='#undef HAVE_SHM'
3344 echores "$_shm"
3347 # XXX: FIXME, add runtime checking
3348 echocheck "linux devfs"
3349 echores "$_linux_devfs"
3352 echocheck "scandir()"
3353 cat > $TMPC << EOF
3354 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3356 _scandir=no
3357 cc_check && _scandir=yes
3358 if test "$_scandir" = yes ; then
3359 _def_scandir='#define HAVE_SCANDIR 1'
3360 _need_scandir=no
3361 else
3362 _def_scandir='#undef HAVE_SCANDIR'
3363 _need_scandir=yes
3365 echores "$_scandir"
3368 echocheck "strsep()"
3369 cat > $TMPC << EOF
3370 #include <string.h>
3371 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3373 _strsep=no
3374 cc_check && _strsep=yes
3375 if test "$_strsep" = yes ; then
3376 _def_strsep='#define HAVE_STRSEP 1'
3377 _need_strsep=no
3378 else
3379 _def_strsep='#undef HAVE_STRSEP'
3380 _need_strsep=yes
3382 echores "$_strsep"
3384 echocheck "strlcpy()"
3385 cat > $TMPC << EOF
3386 #include <string.h>
3387 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3389 _strlcpy=no
3390 cc_check && _strlcpy=yes
3391 if test "$_strlcpy" = yes ; then
3392 _def_strlcpy='#define HAVE_STRLCPY 1'
3393 _need_strlcpy=no
3394 else
3395 _def_strlcpy='#undef HAVE_STRLCPY'
3396 _need_strlcpy=yes
3398 echores "$_strlcpy"
3400 echocheck "strlcat()"
3401 cat > $TMPC << EOF
3402 #include <string.h>
3403 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3405 _strlcat=no
3406 cc_check && _strlcat=yes
3407 if test "$_strlcat" = yes ; then
3408 _def_strlcat='#define HAVE_STRLCAT 1'
3409 _need_strlcat=no
3410 else
3411 _def_strlcat='#undef HAVE_STRLCAT'
3412 _need_strlcat=yes
3414 echores "$_strlcat"
3416 echocheck "fseeko()"
3417 cat > $TMPC << EOF
3418 #include <stdio.h>
3419 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3421 _fseeko=no
3422 cc_check && _fseeko=yes
3423 if test "$_fseeko" = yes ; then
3424 _def_fseeko='#define HAVE_FSEEKO 1'
3425 _need_fseeko=no
3426 else
3427 _def_fseeko='#undef HAVE_FSEEKO'
3428 _need_fseeko=yes
3430 echores "$_fseeko"
3432 echocheck "localtime_r()"
3433 cat > $TMPC << EOF
3434 #include <time.h>
3435 int main( void ) { localtime_r(NULL, NULL); }
3437 _localtime_r=no
3438 cc_check && _localtime_r=yes
3439 if test "$_localtime_r" = yes ; then
3440 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3441 else
3442 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3444 echores "$_localtime_r"
3446 echocheck "vsscanf()"
3447 cat > $TMPC << EOF
3448 #include <stdarg.h>
3449 int main(void) { vsscanf(0, 0, 0); return 0; }
3451 _vsscanf=no
3452 cc_check && _vsscanf=yes
3453 if test "$_vsscanf" = yes ; then
3454 _def_vsscanf='#define HAVE_VSSCANF 1'
3455 _need_vsscanf=no
3456 else
3457 _def_vsscanf='#undef HAVE_VSSCANF'
3458 _need_vsscanf=yes
3460 echores "$_vsscanf"
3463 echocheck "swab()"
3464 cat > $TMPC << EOF
3465 #include <unistd.h>
3466 int main(void) { swab(0, 0, 0); return 0; }
3468 _swab=no
3469 cc_check && _swab=yes
3470 if test "$_swab" = yes ; then
3471 _def_swab='#define HAVE_SWAB 1'
3472 _need_swab=no
3473 else
3474 _def_swab='#undef HAVE_SWAB'
3475 _need_swab=yes
3477 echores "$_swab"
3479 echocheck "POSIX select()"
3480 cat > $TMPC << EOF
3481 #include <stdio.h>
3482 #include <stdlib.h>
3483 #include <sys/types.h>
3484 #include <string.h>
3485 #include <sys/time.h>
3486 #include <unistd.h>
3487 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3489 _posix_select=no
3490 cc_check && _posix_select=yes
3491 if test "$_posix_select" = no ; then
3492 _def_no_posix_select='#define HAVE_NO_POSIX_SELECT 1'
3493 else
3494 _def_no_posix_select='#undef HAVE_NO_POSIX_SELECT'
3496 echores "$_posix_select"
3499 echocheck "gettimeofday()"
3500 cat > $TMPC << EOF
3501 #include <stdio.h>
3502 #include <sys/time.h>
3503 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3505 _gettimeofday=no
3506 cc_check && _gettimeofday=yes
3507 if test "$_gettimeofday" = yes ; then
3508 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3509 _need_gettimeofday=no
3510 else
3511 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3512 _need_gettimeofday=yes
3514 echores "$_gettimeofday"
3517 echocheck "glob()"
3518 cat > $TMPC << EOF
3519 #include <stdio.h>
3520 #include <glob.h>
3521 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3523 _glob=no
3524 cc_check && _glob=yes
3525 if test "$_glob" = yes ; then
3526 _def_glob='#define HAVE_GLOB 1'
3527 _need_glob=no
3528 else
3529 _def_glob='#undef HAVE_GLOB'
3530 _need_glob=yes
3532 echores "$_glob"
3535 echocheck "setenv()"
3536 cat > $TMPC << EOF
3537 #include <stdlib.h>
3538 int main (void){ setenv("","",0); return 0; }
3540 _setenv=no
3541 cc_check && _setenv=yes
3542 if test "$_setenv" = yes ; then
3543 _def_setenv='#define HAVE_SETENV 1'
3544 _need_setenv=no
3545 else
3546 _def_setenv='#undef HAVE_SETENV'
3547 _need_setenv=yes
3549 echores "$_setenv"
3552 if sunos; then
3553 echocheck "sysi86()"
3554 cat > $TMPC << EOF
3555 #include <sys/sysi86.h>
3556 int main (void) { sysi86(0); return 0; }
3558 _sysi86=no
3559 cc_check && _sysi86=yes
3560 if test "$_sysi86" = yes ; then
3561 _def_sysi86='#define HAVE_SYSI86 1'
3562 else
3563 _def_sysi86='#undef HAVE_SYSI86'
3565 echores "$_sysi86"
3566 fi #if sunos
3569 echocheck "sys/sysinfo.h"
3570 cat > $TMPC << EOF
3571 #include <sys/sysinfo.h>
3572 int main(void) {
3573 struct sysinfo s_info;
3574 sysinfo(&s_info);
3575 return 0;
3578 _sys_sysinfo=no
3579 cc_check && _sys_sysinfo=yes
3580 if test "$_sys_sysinfo" = yes ; then
3581 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3582 else
3583 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3585 echores "$_sys_sysinfo"
3588 if darwin; then
3590 echocheck "Mac OS X APIs"
3591 if test "$_macosx" = auto ; then
3592 productName=`/usr/bin/sw_vers -productName`
3593 if test "$productName" = "Mac OS X" ||
3594 test "$productName" = "Mac OS X Server" ; then
3595 _macosx=yes
3596 else
3597 _macosx=no
3598 _def_macosx='#undef MACOSX'
3599 _noaomodules="macosx $_noaomodules"
3600 _novomodules="quartz $_novomodules"
3603 if test "$_macosx" = yes ; then
3604 cat > $TMPC <<EOF
3605 #include <Carbon/Carbon.h>
3606 #include <QuickTime/QuickTime.h>
3607 #include <CoreAudio/CoreAudio.h>
3608 int main(void) {
3609 EnterMovies();
3610 ExitMovies();
3611 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3614 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3615 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3616 _def_macosx='#define MACOSX 1'
3617 _aosrc="$_aosrc ao_macosx.c"
3618 _aomodules="macosx $_aomodules"
3619 _vosrc="$_vosrc vo_quartz.c"
3620 _vomodules="quartz $_vomodules"
3621 else
3622 _macosx=no
3623 _def_macosx='#undef MACOSX'
3624 _noaomodules="macosx $_noaomodules"
3625 _novomodules="quartz $_novomodules"
3627 cat > $TMPC <<EOF
3628 #include <Carbon/Carbon.h>
3629 #include <QuartzCore/CoreVideo.h>
3630 int main(void) {}
3632 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3633 _vosrc="$_vosrc vo_macosx.m"
3634 _vomodules="macosx $_vomodules"
3635 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3636 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3637 _macosx_corevideo=yes
3638 else
3639 _novomodules="macosx $_novomodules"
3640 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3641 _macosx_corevideo=no
3644 echores "$_macosx"
3646 echocheck "Mac OS X Finder Support"
3647 if test "$_macosx_finder_support" = auto ; then
3648 _macosx_finder_support=$_macosx
3650 if test "$_macosx_finder_support" = yes; then
3651 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3652 _macosx_finder_support=yes
3653 else
3654 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3655 _macosx_finder_support=no
3657 echores "$_macosx_finder_support"
3659 echocheck "Mac OS X Bundle file locations"
3660 if test "$_macosx_bundle" = auto ; then
3661 _macosx_bundle=$_macosx_finder_support
3663 if test "$_macosx_bundle" = yes; then
3664 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3665 else
3666 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3667 _macosx_bundle=no
3669 echores "$_macosx_bundle"
3671 fi #if darwin
3674 echocheck "pkg-config"
3675 _pkg_config=pkg-config
3676 if `$_pkg_config --version > /dev/null 2>&1`; then
3677 echores "yes"
3678 else
3679 _pkg_config=false
3680 echores "no"
3684 echocheck "Samba support (libsmbclient)"
3685 if test "$_smbsupport" = yes; then
3686 _ld_extra="$_ld_extra -lsmbclient"
3688 if test "$_smbsupport" = auto; then
3689 _smbsupport=no
3690 cat > $TMPC << EOF
3691 #include <libsmbclient.h>
3692 int main(void) { smbc_opendir("smb://"); return 0; }
3694 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3695 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3696 _smbsupport=yes && break
3697 done
3700 if test "$_smbsupport" = yes; then
3701 _def_smbsupport="#define LIBSMBCLIENT"
3702 _inputmodules="smb $_inputmodules"
3703 else
3704 _def_smbsupport="#undef LIBSMBCLIENT"
3705 _noinputmodules="smb $_noinputmodules"
3707 echores "$_smbsupport"
3710 #########
3711 # VIDEO #
3712 #########
3715 echocheck "3dfx"
3716 if test "$_3dfx" = yes ; then
3717 _def_3dfx='#define HAVE_3DFX 1'
3718 _vosrc="$_vosrc vo_3dfx.c"
3719 _vomodules="3dfx $_vomodules"
3720 else
3721 _def_3dfx='#undef HAVE_3DFX'
3722 _novomodules="3dfx $_novomodules"
3724 echores "$_3dfx"
3727 echocheck "tdfxfb"
3728 if test "$_tdfxfb" = yes ; then
3729 _def_tdfxfb='#define HAVE_TDFXFB 1'
3730 _vosrc="$_vosrc vo_tdfxfb.c"
3731 _vomodules="tdfxfb $_vomodules"
3732 else
3733 _def_tdfxfb='#undef HAVE_TDFXFB'
3734 _novomodules="tdfxfb $_novomodules"
3736 echores "$_tdfxfb"
3738 echocheck "s3fb"
3739 if test "$_s3fb" = yes ; then
3740 _def_s3fb='#define HAVE_S3FB 1'
3741 _vosrc="$_vosrc vo_s3fb.c"
3742 _vomodules="s3fb $_vomodules"
3743 else
3744 _def_s3fb='#undef HAVE_S3FB'
3745 _novomodules="s3fb $_novomodules"
3747 echores "$_s3fb"
3749 echocheck "tdfxvid"
3750 if test "$_tdfxvid" = yes ; then
3751 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3752 _vosrc="$_vosrc vo_tdfx_vid.c"
3753 _vomodules="tdfx_vid $_vomodules"
3754 else
3755 _def_tdfxvid='#undef HAVE_TDFX_VID'
3756 _novomodules="tdfx_vid $_novomodules"
3758 echores "$_tdfxvid"
3760 echocheck "tga"
3761 if test "$_tga" = yes ; then
3762 _def_tga='#define HAVE_TGA 1'
3763 _vosrc="$_vosrc vo_tga.c"
3764 _vomodules="tga $_vomodules"
3765 else
3766 _def_tga='#undef HAVE_TGA'
3767 _novomodules="tga $_novomodules"
3769 echores "$_tga"
3772 echocheck "DirectFB"
3773 if test "$_directfb" = auto ; then
3774 _directfb=no
3775 cat > $TMPC <<EOF
3776 #include <directfb.h>
3777 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3779 for _inc_tmp in "" -I/usr/local/include/directfb \
3780 -I/usr/include/directfb -I/usr/local/include -I/usr/include; do
3781 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3782 _inc_extra="$_inc_extra $_inc_tmp" && break
3783 done
3786 dfb_version() {
3787 expr $1 \* 65536 + $2 \* 256 + $3
3790 if test "$_directfb" = yes; then
3791 cat > $TMPC << EOF
3792 #include <directfb_version.h>
3794 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3797 if $_cc -E $TMPC $_inc_extra > "$TMPO"; then
3798 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPO" | tr -d '()'`
3799 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3800 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3801 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3802 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3803 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3804 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3805 _res_comment="$_directfb_version"
3806 else
3807 _def_directfb_version='#undef DIRECTFBVERSION'
3808 _directfb=no
3809 _res_comment="version >=0.9.13 required"
3811 else
3812 _directfb=no
3813 _res_comment="failed to get version"
3816 echores "$_directfb"
3818 if test "$_directfb" = yes ; then
3819 _def_directfb='#define HAVE_DIRECTFB 1'
3820 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3821 _vosrc="$_vosrc vo_directfb2.c"
3822 _vomodules="directfb $_vomodules"
3823 _libs_mplayer="$_libs_mplayer -ldirectfb"
3824 else
3825 _novomodules="directfb $_novomodules"
3828 if test "$_dfb_version" -ge `dfb_version 0 9 15`; then
3829 _vosrc="$_vosrc vo_dfbmga.c"
3830 _vomodules="dfbmga $_vomodules"
3831 _def_dfbmga='#define HAVE_DFBMGA 1'
3832 else
3833 _novomodules="dfbmga $_novomodules"
3834 _def_dfbmga='#undef HAVE_DFBMGA'
3836 else
3837 _def_directfb='#undef HAVE_DIRECTFB'
3838 _novomodules="dfbmga directfb $_novomodules"
3842 echocheck "X11 headers presence"
3843 for I in `echo $_inc_extra | sed s/-I//g` /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3844 if test -f "$I/X11/Xlib.h" ; then
3845 _inc_x11="-I$I"
3846 _x11_headers="yes"
3847 _res_comment="using $I"
3848 break
3850 done
3851 if test -z "$_inc_x11" ; then
3852 _x11=no
3853 _x11_headers="no"
3854 _res_comment="check if the dev(el) packages are installed"
3856 echores "$_x11_headers"
3859 echocheck "X11"
3860 if test "$_x11" != no ; then
3861 cat > $TMPC <<EOF
3862 #include <X11/Xlib.h>
3863 #include <X11/Xutil.h>
3864 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3866 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3867 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3868 if netbsd; then
3869 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3870 else
3871 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3873 cc_check $_inc_x11 $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3874 && _x11=yes && break
3875 done
3877 if test "$_x11" = yes ; then
3878 #FIXME: This is ugly as it can duplicate a -I parameter..
3879 _inc_extra="$_inc_extra $_inc_x11"
3880 _def_x11='#define HAVE_X11 1'
3881 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3882 _vomodules="x11 xover $_vomodules"
3883 else
3884 _x11=no
3885 _def_x11='#undef HAVE_X11'
3886 _novomodules="x11 $_novomodules"
3887 _res_comment="check if the dev(el) packages are installed"
3888 # disable stuff that depends on X
3889 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _dga=no
3891 echores "$_x11"
3894 echocheck "DPMS"
3895 _xdpms3=no
3896 _xdpms4=no
3897 if test "$_x11" = yes ; then
3898 cat > $TMPC <<EOF
3899 #include <X11/Xmd.h>
3900 #include <X11/Xlib.h>
3901 #include <X11/Xutil.h>
3902 #include <X11/Xatom.h>
3903 #include <X11/extensions/dpms.h>
3904 int main(void) {
3905 (void) DPMSQueryExtension(0, 0, 0);
3908 cc_check -lXdpms && _xdpms3=yes
3909 cat > $TMPC <<EOF
3910 #include <X11/Xlib.h>
3911 #include <X11/extensions/dpms.h>
3912 int main(void) {
3913 (void) DPMSQueryExtension(0, 0, 0);
3916 cc_check && _xdpms4=yes
3918 if test "$_xdpms4" = yes ; then
3919 _def_xdpms='#define HAVE_XDPMS 1'
3920 _res_comment="using Xdpms 4"
3921 echores "yes"
3922 elif test "$_xdpms3" = yes ; then
3923 _def_xdpms='#define HAVE_XDPMS 1'
3924 _libs_mplayer="$_libs_mplayer -lXdpms"
3925 _res_comment="using Xdpms 3"
3926 echores "yes"
3927 else
3928 _def_xdpms='#undef HAVE_XDPMS'
3929 echores "no"
3933 echocheck "Xv"
3934 if test "$_xv" = auto ; then
3935 cat > $TMPC <<EOF
3936 #include <X11/Xlib.h>
3937 #include <X11/extensions/Xvlib.h>
3938 int main(void) {
3939 (void) XvGetPortAttribute(0, 0, 0, 0);
3940 (void) XvQueryPortAttributes(0, 0, 0);
3941 return 0; }
3943 _xv=no
3944 cc_check -lXv && _xv=yes
3947 if test "$_xv" = yes ; then
3948 _def_xv='#define HAVE_XV 1'
3949 _libs_mplayer="$_libs_mplayer -lXv"
3950 _vosrc="$_vosrc vo_xv.c"
3951 _vomodules="xv $_vomodules"
3952 else
3953 _def_xv='#undef HAVE_XV'
3954 _novomodules="xv $_novomodules"
3956 echores "$_xv"
3959 echocheck "XvMC"
3960 if test "$_xv" = yes && test "$_xvmc" != no ; then
3961 _xvmc=no
3962 cat > $TMPC <<EOF
3963 #include <X11/Xlib.h>
3964 #include <X11/extensions/Xvlib.h>
3965 #include <X11/extensions/XvMClib.h>
3966 int main(void) {
3967 (void) XvMCQueryExtension(0,0,0);
3968 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3969 return 0; }
3971 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3972 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3973 done
3975 if test "$_xvmc" = yes ; then
3976 _def_xvmc='#define HAVE_XVMC 1'
3977 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
3978 _vosrc="$_vosrc vo_xvmc.c"
3979 _vomodules="xvmc $_vomodules"
3980 _res_comment="using $_xvmclib"
3981 else
3982 _def_xvmc='#undef HAVE_XVMC'
3983 _novomodules="xvmc $_novomodules"
3985 echores "$_xvmc"
3988 echocheck "Xinerama"
3989 if test "$_xinerama" = auto ; then
3990 cat > $TMPC <<EOF
3991 #include <X11/Xlib.h>
3992 #include <X11/extensions/Xinerama.h>
3993 int main(void) { (void) XineramaIsActive(0); return 0; }
3995 _xinerama=no
3996 cc_check -lXinerama && _xinerama=yes
3999 if test "$_xinerama" = yes ; then
4000 _def_xinerama='#define HAVE_XINERAMA 1'
4001 _libs_mplayer="$_libs_mplayer -lXinerama"
4002 else
4003 _def_xinerama='#undef HAVE_XINERAMA'
4005 echores "$_xinerama"
4008 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4009 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4010 # named 'X extensions' or something similar.
4011 # This check may be useful for future mplayer versions (to change resolution)
4012 # If you run into problems, remove '-lXxf86vm'.
4013 echocheck "Xxf86vm"
4014 if test "$_vm" = auto ; then
4015 cat > $TMPC <<EOF
4016 #include <X11/Xlib.h>
4017 #include <X11/extensions/xf86vmode.h>
4018 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4020 _vm=no
4021 cc_check -lXxf86vm && _vm=yes
4023 if test "$_vm" = yes ; then
4024 _def_vm='#define HAVE_XF86VM 1'
4025 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4026 else
4027 _def_vm='#undef HAVE_XF86VM'
4029 echores "$_vm"
4031 # Check for the presence of special keycodes, like audio control buttons
4032 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4033 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4034 # have these new keycodes.
4035 echocheck "XF86keysym"
4036 if test "$_xf86keysym" = auto; then
4037 _xf86keysym=no
4038 cat > $TMPC <<EOF
4039 #include <X11/Xlib.h>
4040 #include <X11/XF86keysym.h>
4041 int main(void) { return XF86XK_AudioPause; }
4043 cc_check && _xf86keysym=yes
4045 if test "$_xf86keysym" = yes ; then
4046 _def_xf86keysym='#define HAVE_XF86XK 1'
4047 else
4048 _def_xf86keysym='#undef HAVE_XF86XK'
4050 echores "$_xf86keysym"
4052 echocheck "DGA"
4053 # Version 2 is preferred to version 1 if available
4054 if test "$_dga" = auto ; then
4055 cat > $TMPC << EOF
4056 #include <X11/Xlib.h>
4057 #include <X11/extensions/xf86dga.h>
4058 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4060 _dga=no
4061 cc_check -lXxf86dga -lXxf86vm && _dga=1
4063 cat > $TMPC << EOF
4064 #include <X11/Xlib.h>
4065 #include <X11/extensions/xf86dga.h>
4066 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4068 cc_check -lXxf86dga && _dga=2
4071 _def_dga='#undef HAVE_DGA'
4072 _def_dga2='#undef HAVE_DGA2'
4073 if test "$_dga" = 1 ; then
4074 _def_dga='#define HAVE_DGA 1'
4075 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4076 _vosrc="$_vosrc vo_dga.c"
4077 _vomodules="dga $_vomodules"
4078 _res_comment="using DGA 1.0"
4079 elif test "$_dga" = 2 ; then
4080 _def_dga='#define HAVE_DGA 1'
4081 _def_dga2='#define HAVE_DGA2 1'
4082 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4083 _vosrc="$_vosrc vo_dga.c"
4084 _vomodules="dga $_vomodules"
4085 _res_comment="using DGA 2.0"
4086 elif test "$_dga" = no ; then
4087 _novomodules="dga $_novomodules"
4088 else
4089 die "DGA version must be 1 or 2"
4091 echores "$_dga"
4094 echocheck "OpenGL"
4095 #Note: this test is run even with --enable-gl since we autodetect linker flags
4096 if (test "$_x11" = yes || win32 && test "$_macosx" != yes) && test "$_gl" != no ; then
4097 cat > $TMPC << EOF
4098 #include <GL/gl.h>
4099 int main(void) { return 0; }
4101 _gl=no
4102 if cc_check -lGL $_ld_lm ; then
4103 _gl=yes
4104 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4105 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4106 _gl=yes
4107 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4108 elif cc_check -lopengl32 ; then
4109 _gl=yes
4110 _gl_win32=yes
4111 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4113 else
4114 _gl=no
4116 if test "$_gl" = yes ; then
4117 _def_gl='#define HAVE_GL 1'
4118 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4119 if test "$_gl_win32" = yes ; then
4120 _def_gl_win32='#define GL_WIN32 1'
4121 _vosrc="$_vosrc w32_common.c"
4122 _res_comment="win32 version"
4124 _vomodules="opengl $_vomodules"
4125 else
4126 _def_gl='#undef HAVE_GL'
4127 _def_gl_win32='#undef GL_WIN32'
4128 _novomodules="opengl $_novomodules"
4130 echores "$_gl"
4133 echocheck "/dev/mga_vid"
4134 if test "$_mga" = auto ; then
4135 _mga=no
4136 test -c /dev/mga_vid && _mga=yes
4138 if test "$_mga" = yes ; then
4139 _def_mga='#define HAVE_MGA 1'
4140 _vosrc="$_vosrc vo_mga.c"
4141 _vomodules="mga $_vomodules"
4142 else
4143 _def_mga='#undef HAVE_MGA'
4144 _novomodules="mga $_novomodules"
4146 echores "$_mga"
4149 # echocheck "syncfb"
4150 # _syncfb=no
4151 # test "$_mga" = yes && _syncfb=yes
4152 # if test "$_syncfb" = yes ; then
4153 # _def_syncfb='#define HAVE_SYNCFB 1'
4154 # _vosrc="$_vosrc vo_syncfb.c"
4155 # else
4156 # _def_syncfb='#undef HAVE_SYNCFB'
4157 # fi
4158 # echores "$_syncfb"
4161 echocheck "xmga"
4162 if test "$_xmga" = auto ; then
4163 _xmga=no
4164 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4166 if test "$_xmga" = yes ; then
4167 _def_xmga='#define HAVE_XMGA 1'
4168 _vosrc="$_vosrc vo_xmga.c"
4169 _vomodules="xmga $_vomodules"
4170 else
4171 _def_xmga='#undef HAVE_XMGA'
4172 _novomodules="xmga $_novomodules"
4174 echores "$_xmga"
4177 echocheck "GGI"
4178 if test "$_ggi" = auto ; then
4179 cat > $TMPC << EOF
4180 #include <ggi/ggi.h>
4181 int main(void) { return 0; }
4183 _ggi=no
4184 cc_check -lggi && _ggi=yes
4186 if test "$_ggi" = yes ; then
4187 _def_ggi='#define HAVE_GGI 1'
4188 _libs_mplayer="$_libs_mplayer -lggi"
4189 _vosrc="$_vosrc vo_ggi.c"
4190 _vomodules="ggi $_vomodules"
4191 else
4192 _def_ggi='#undef HAVE_GGI'
4193 _novomodules="ggi $_novomodules"
4195 echores "$_ggi"
4197 echocheck "GGI extension: libggiwmh"
4198 if test "$_ggiwmh" = auto ; then
4199 _ggiwmh=no
4200 cat > $TMPC << EOF
4201 #include <ggi/ggi.h>
4202 #include <ggi/wmh.h>
4203 int main(void) { return 0; }
4205 cc_check -lggi -lggiwmh && _ggiwmh=yes
4207 # needed to get right output on obscure combination
4208 # like --disable-ggi --enable-ggiwmh
4209 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4210 _def_ggiwmh='#define HAVE_GGIWMH 1'
4211 _libs_mplayer="$_libs_mplayer -lggiwmh"
4212 else
4213 _ggiwmh=no
4214 _def_ggiwmh='#undef HAVE_GGIWMH'
4216 echores "$_ggiwmh"
4219 echocheck "AA"
4220 if test "$_aa" = auto ; then
4221 cat > $TMPC << EOF
4222 #include <aalib.h>
4223 extern struct aa_hardware_params aa_defparams;
4224 extern struct aa_renderparams aa_defrenderparams;
4225 int main(void) {
4226 aa_context *c;
4227 aa_renderparams *p;
4228 (void) aa_init(0, 0, 0);
4229 c = aa_autoinit(&aa_defparams);
4230 p = aa_getrenderparams();
4231 aa_autoinitkbd(c,0);
4232 return 0; }
4234 _aa=no
4235 for _ld_tmp in "-laa" ; do
4236 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4237 done
4239 if test "$_aa" = yes ; then
4240 _def_aa='#define HAVE_AA 1'
4241 if cygwin ; then
4242 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4244 _vosrc="$_vosrc vo_aa.c"
4245 _vomodules="aa $_vomodules"
4246 else
4247 _def_aa='#undef HAVE_AA'
4248 _novomodules="aa $_novomodules"
4250 echores "$_aa"
4253 echocheck "CACA"
4254 if test "$_caca" = auto ; then
4255 _caca=no
4256 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4257 cat > $TMPC << EOF
4258 #include <caca.h>
4259 #ifdef CACA_API_VERSION_1
4260 #include <caca0.h>
4261 #endif
4262 int main(void) { (void) caca_init(); return 0; }
4264 cc_check `caca-config --libs` && _caca=yes
4267 if test "$_caca" = yes ; then
4268 _def_caca='#define HAVE_CACA 1'
4269 _inc_extra="$_inc_extra `caca-config --cflags`"
4270 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4271 _vosrc="$_vosrc vo_caca.c"
4272 _vomodules="caca $_vomodules"
4273 else
4274 _def_caca='#undef HAVE_CACA'
4275 _novomodules="caca $_novomodules"
4277 echores "$_caca"
4280 echocheck "SVGAlib"
4281 if test "$_svga" = auto ; then
4282 cat > $TMPC << EOF
4283 #include <vga.h>
4284 int main(void) { return 0; }
4286 _svga=no
4287 cc_check -lvga $_ld_lm && _svga=yes
4289 if test "$_svga" = yes ; then
4290 _def_svga='#define HAVE_SVGALIB 1'
4291 _libs_mplayer="$_libs_mplayer -lvga"
4292 _vosrc="$_vosrc vo_svga.c"
4293 _vomodules="svga $_vomodules"
4294 else
4295 _def_svga='#undef HAVE_SVGALIB'
4296 _novomodules="svga $_novomodules"
4298 echores "$_svga"
4301 echocheck "FBDev"
4302 if test "$_fbdev" = auto ; then
4303 _fbdev=no
4304 linux && test -c /dev/fb0 && _fbdev=yes
4306 if test "$_fbdev" = yes ; then
4307 _def_fbdev='#define HAVE_FBDEV 1'
4308 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4309 _vomodules="fbdev $_vomodules"
4310 else
4311 _def_fbdev='#undef HAVE_FBDEV'
4312 _novomodules="fbdev $_novomodules"
4314 echores "$_fbdev"
4318 echocheck "DVB"
4319 if test "$_dvb" = auto ; then
4320 _dvb=no
4321 cat >$TMPC << EOF
4322 #include <sys/poll.h>
4323 #include <sys/ioctl.h>
4324 #include <stdio.h>
4325 #include <time.h>
4326 #include <unistd.h>
4328 #include <ost/dmx.h>
4329 #include <ost/frontend.h>
4330 #include <ost/sec.h>
4331 #include <ost/video.h>
4332 #include <ost/audio.h>
4333 int main(void) {return 0;}
4335 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4336 cc_check $_inc_tmp && _dvb=yes && \
4337 _inc_extra="$_inc_extra $_inc_tmp" && break
4338 done
4340 echores "$_dvb"
4341 if test "$_dvb" = yes ; then
4342 _def_dvb='#define HAVE_DVB 1'
4343 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4344 _aomodules="mpegpes(dvb) $_aomodules"
4345 _vomodules="mpegpes(dvb) $_vomodules"
4348 echocheck "DVB HEAD"
4349 if test "$_dvbhead" = auto ; then
4350 _dvbhead=no
4352 cat >$TMPC << EOF
4353 #include <sys/poll.h>
4354 #include <sys/ioctl.h>
4355 #include <stdio.h>
4356 #include <time.h>
4357 #include <unistd.h>
4359 #include <linux/dvb/dmx.h>
4360 #include <linux/dvb/frontend.h>
4361 #include <linux/dvb/video.h>
4362 #include <linux/dvb/audio.h>
4363 int main(void) {return 0;}
4365 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4366 cc_check $_inc_tmp && _dvbhead=yes && \
4367 _inc_extra="$_inc_extra $_inc_tmp" && break
4368 done
4370 echores "$_dvbhead"
4371 if test "$_dvbhead" = yes ; then
4372 _def_dvb='#define HAVE_DVB_HEAD 1'
4373 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4374 _aomodules="mpegpes(dvb) $_aomodules"
4375 _vomodules="mpegpes(dvb) $_vomodules"
4378 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4379 _def_dvb='#undef HAVE_DVB'
4380 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4381 _aomodules="mpegpes(file) $_aomodules"
4382 _vomodules="mpegpes(file) $_vomodules"
4385 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4386 _dvbin=yes
4387 _inputmodules="dvb $_inputmodules"
4388 else
4389 _dvbin=no
4390 _noinputmodules="dvb $_noinputmodules"
4393 echocheck "PNG support"
4394 if test "$_png" = auto ; then
4395 _png=no
4396 if irix ; then
4397 # Don't check for -lpng on irix since it has its own libpng
4398 # incompatible with the GNU libpng
4399 _res_comment="disabled on irix (not GNU libpng)"
4400 else
4401 cat > $TMPC << EOF
4402 #include <png.h>
4403 #include <string.h>
4404 int main(void) {
4405 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4406 printf("libpng: %s\n", png_libpng_ver);
4407 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4410 if cc_check -lpng -lz $_ld_lm ; then
4411 if tmp_run ; then
4412 _png=yes
4413 else
4414 _res_comment="mismatch of library and header versions"
4419 echores "$_png"
4420 if test "$_png" = yes ; then
4421 _def_png='#define HAVE_PNG 1'
4422 _ld_extra="$_ld_extra -lpng -lz"
4423 _vosrc="$_vosrc vo_png.c"
4424 _vomodules="png $_vomodules"
4425 else
4426 _def_png='#undef HAVE_PNG'
4427 _novomodules="png $_novomodules"
4430 echocheck "JPEG support"
4431 if test "$_jpeg" = auto ; then
4432 _jpeg=no
4433 cat > $TMPC << EOF
4434 #include <stdio.h>
4435 #include <stdlib.h>
4436 #include <setjmp.h>
4437 #include <string.h>
4438 #include <jpeglib.h>
4439 int main(void) {
4440 return 0;
4443 if cc_check -ljpeg $_ld_lm ; then
4444 if tmp_run ; then
4445 _jpeg=yes
4449 echores "$_jpeg"
4451 if test "$_jpeg" = yes ; then
4452 _def_jpeg='#define HAVE_JPEG 1'
4453 _vosrc="$_vosrc vo_jpeg.c"
4454 _vomodules="jpeg $_vomodules"
4455 _ld_extra="$_ld_extra -ljpeg"
4456 else
4457 _def_jpeg='#undef HAVE_JPEG'
4458 _novomodules="jpeg $_novomodules"
4463 echocheck "PNM support"
4464 if test "$_pnm" = yes; then
4465 _def_pnm="#define HAVE_PNM"
4466 _vosrc="$_vosrc vo_pnm.c"
4467 _vomodules="pnm $_vomodules"
4468 else
4469 _def_pnm="#undef HAVE_PNM"
4470 _novomodules="pnm $_novomodules"
4472 echores "$_pnm"
4476 echocheck "GIF support"
4477 # This is to appease people who want to force gif support.
4478 # If it is forced to yes, then we still do checks to determine
4479 # which gif library to use.
4480 if test "$_gif" = yes ; then
4481 _force_gif=yes
4482 _gif=auto
4485 if test "$_gif" = auto ; then
4486 _gif=no
4487 cat > $TMPC << EOF
4488 #include <gif_lib.h>
4489 int main(void) {
4490 return 0;
4493 for _ld_gif in "-lungif" "-lgif" ; do
4494 cc_check $_ld_gif && tmp_run && _gif=yes && break
4495 done
4498 # If no library was found, and the user wants support forced,
4499 # then we force it on with libgif, as this is the safest
4500 # assumption IMHO. (libungif & libregif both create symbolic
4501 # links to libgif. We also assume that no x11 support is needed,
4502 # because if you are forcing this, then you _should_ know what
4503 # you are doing. [ Besides, package maintainers should never
4504 # have compiled x11 deps into libungif in the first place. ] )
4505 # </rant>
4506 # --Joey
4507 if test "$_force_gif" = yes && test "$_gif" = no ; then
4508 _gif=yes
4509 _ld_gif="-lgif"
4512 if test "$_gif" = yes ; then
4513 _def_gif='#define HAVE_GIF 1'
4514 _vosrc="$_vosrc vo_gif89a.c"
4515 _codecmodules="gif $_codecmodules"
4516 _vomodules="gif89a $_vomodules"
4517 _res_comment="old version, some encoding functions disabled"
4518 _def_gif_4='#undef HAVE_GIF_4'
4519 _ld_extra="$_ld_extra $_ld_gif"
4521 cat > $TMPC << EOF
4522 #include <signal.h>
4523 #include <gif_lib.h>
4524 void catch() { exit(1); }
4525 int main(void) {
4526 signal(SIGSEGV, catch); // catch segfault
4527 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4528 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4529 return 0;
4532 if cc_check "$_ld_gif" && tmp_run ; then
4533 _def_gif_4='#define HAVE_GIF_4 1'
4534 _res_comment=""
4536 else
4537 _def_gif='#undef HAVE_GIF'
4538 _def_gif_4='#undef HAVE_GIF_4'
4539 _novomodules="gif89a $_novomodules"
4540 _nocodecmodules="gif $_nocodecmodules"
4542 echores "$_gif"
4545 case "$_gif" in yes*)
4546 echocheck "broken giflib workaround"
4547 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4549 cat > $TMPC << EOF
4550 #include <gif_lib.h>
4551 int main(void) {
4552 GifFileType gif;
4553 printf("UserData is at address %p\n", gif.UserData);
4554 return 0;
4557 if cc_check "$_ld_gif" && tmp_run ; then
4558 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4559 echores "disabled"
4560 else
4561 echores "enabled"
4564 esac
4567 echocheck "VESA support"
4568 if test "$_vesa" = auto ; then
4569 cat > $TMPC << EOF
4570 #include <vbe.h>
4571 int main(void) { vbeVersion(); return 0; }
4573 _vesa=no
4574 cc_check -lvbe -llrmi && _vesa=yes
4576 if test "$_vesa" = yes ; then
4577 _def_vesa='#define HAVE_VESA 1'
4578 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4579 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4580 _vomodules="vesa $_vomodules"
4581 else
4582 _def_vesa='#undef HAVE_VESA'
4583 _novomodules="vesa $_novomodules"
4585 echores "$_vesa"
4587 #################
4588 # VIDEO + AUDIO #
4589 #################
4592 echocheck "SDL"
4593 if test -z "$_sdlconfig" ; then
4594 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4595 _sdlconfig="sdl-config"
4596 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4597 _sdlconfig="sdl11-config"
4598 else
4599 _sdlconfig=false
4602 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4603 cat > $TMPC << EOF
4604 #include <SDL.h>
4605 int main(int argc, char *argv[]) { return 0; }
4607 _sdl=no
4608 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4609 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4610 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4611 if test "$_sdlversion" -gt 116 ; then
4612 if test "$_sdlversion" -lt 121 ; then
4613 _def_sdlbuggy='#define BUGGY_SDL'
4614 else
4615 _def_sdlbuggy='#undef BUGGY_SDL'
4617 _sdl=yes
4622 if test "$_sdl" = yes ; then
4623 _def_sdl='#define HAVE_SDL 1'
4624 if cygwin ; then
4625 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4626 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4627 elif mingw32 ; then
4628 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4629 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4630 else
4631 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4632 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4634 _vosrc="$_vosrc vo_sdl.c"
4635 _vomodules="sdl $_vomodules"
4636 _aosrc="$_aosrc ao_sdl.c"
4637 _aomodules="sdl $_aomodules"
4638 _res_comment="using $_sdlconfig"
4639 else
4640 _def_sdl='#undef HAVE_SDL'
4641 _novomodules="sdl $_novomodules"
4642 _noaomodules="sdl $_noaomodules"
4644 echores "$_sdl"
4647 if win32; then
4649 echocheck "Windows waveout"
4650 if test "$_win32waveout" = auto ; then
4651 cat > $TMPC << EOF
4652 #include <windows.h>
4653 #include <mmsystem.h>
4654 int main(void) { return 0; }
4656 _win32waveout=no
4657 cc_check -lwinmm && _win32waveout=yes
4659 if test "$_win32waveout" = yes ; then
4660 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4661 _libs_mplayer="$_libs_mplayer -lwinmm"
4662 _aosrc="$_aosrc ao_win32.c"
4663 _aomodules="win32 $_aomodules"
4664 else
4665 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4666 _noaomodules="win32 $_noaomodules"
4668 echores "$_win32waveout"
4670 echocheck "Directx"
4671 if test "$_directx" = auto ; then
4672 cat > $TMPC << EOF
4673 #include <windows.h>
4674 #include <ddraw.h>
4675 #include <dsound.h>
4676 int main(void) { return 0; }
4678 _directx=no
4679 cc_check -lgdi32 && _directx=yes
4681 if test "$_directx" = yes ; then
4682 _def_directx='#define HAVE_DIRECTX 1'
4683 _libs_mplayer="$_libs_mplayer -lgdi32"
4684 _vosrc="$_vosrc vo_directx.c"
4685 _vomodules="directx $_vomodules"
4686 _aosrc="$_aosrc ao_dsound.c"
4687 _aomodules="dsound $_aomodules"
4688 else
4689 _def_directx='#undef HAVE_DIRECTX'
4690 _novomodules="directx $_novomodules"
4691 _noaomodules="dsound $_noaomodules"
4693 echores "$_directx"
4695 fi #if win32; then
4698 echocheck "NAS"
4699 if test "$_nas" = auto ; then
4700 cat > $TMPC << EOF
4701 #include <audio/audiolib.h>
4702 int main(void) { return 0; }
4704 _nas=no
4705 cc_check $_ld_lm -laudio -lXt && _nas=yes
4707 if test "$_nas" = yes ; then
4708 _def_nas='#define HAVE_NAS 1'
4709 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4710 _aosrc="$_aosrc ao_nas.c"
4711 _aomodules="nas $_aomodules"
4712 else
4713 _noaomodules="nas $_noaomodules"
4714 _def_nas='#undef HAVE_NAS'
4716 echores "$_nas"
4718 echocheck "DXR2"
4719 if test "$_dxr2" = auto; then
4720 _dxr2=no
4721 cat > $TMPC << EOF
4722 #include <dxr2ioctl.h>
4723 int main(void) { return 0; }
4725 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4726 cc_check $_inc_tmp && _dxr2=yes && \
4727 _inc_extra="$_inc_extra $_inc_tmp" && break
4728 done
4730 if test "$_dxr2" = yes; then
4731 _def_dxr2='#define HAVE_DXR2 1'
4732 _vosrc="$_vosrc vo_dxr2.c"
4733 _aosrc="$_aosrc ao_dxr2.c"
4734 _aomodules="dxr2 $_aomodules"
4735 _vomodules="dxr2 $_vomodules"
4736 else
4737 _def_dxr2='#undef HAVE_DXR2'
4738 _noaomodules="dxr2 $_noaomodules"
4739 _novomodules="dxr2 $_novomodules"
4741 echores "$_dxr2"
4743 echocheck "DXR3/H+"
4744 if test "$_dxr3" = auto ; then
4745 cat > $TMPC << EOF
4746 #include <linux/em8300.h>
4747 int main(void) { return 0; }
4749 _dxr3=no
4750 cc_check && _dxr3=yes
4752 if test "$_dxr3" = yes ; then
4753 _def_dxr3='#define HAVE_DXR3 1'
4754 _vosrc="$_vosrc vo_dxr3.c"
4755 _vomodules="dxr3 $_vomodules"
4756 else
4757 _def_dxr3='#undef HAVE_DXR3'
4758 _novomodules="dxr3 $_novomodules"
4760 echores "$_dxr3"
4763 echocheck "IVTV TV-Out"
4764 if test "$_ivtv" = auto ; then
4765 cat > $TMPC << EOF
4766 #include <stdlib.h>
4767 #include <inttypes.h>
4768 #include <linux/types.h>
4769 #include <linux/videodev2.h>
4770 #include <linux/ivtv.h>
4771 int main(void) { return 0; }
4773 _ivtv=no
4774 cc_check && _ivtv=yes
4776 if test "$_ivtv" = yes ; then
4777 _def_ivtv='#define HAVE_IVTV 1'
4778 _vosrc="$_vosrc vo_ivtv.c"
4779 _vomodules="ivtv $_vomodules"
4780 _aosrc="$_aosrc ao_ivtv.c"
4781 _aomodules="ivtv $_aomodules"
4782 else
4783 _def_ivtv='#undef HAVE_IVTV'
4784 _novomodules="ivtv $_novomodules"
4785 _noaomodules="ivtv $_noaomodules"
4787 echores "$_ivtv"
4791 #########
4792 # AUDIO #
4793 #########
4796 echocheck "OSS Audio"
4797 if test "$_ossaudio" = auto ; then
4798 cat > $TMPC << EOF
4799 #include <sys/ioctl.h>
4800 $_include_soundcard
4801 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4803 _ossaudio=no
4804 cc_check && _ossaudio=yes
4806 if test "$_ossaudio" = yes ; then
4807 _def_ossaudio='#define USE_OSS_AUDIO 1'
4808 _aosrc="$_aosrc ao_oss.c"
4809 _aomodules="oss $_aomodules"
4810 if test "$_linux_devfs" = yes; then
4811 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4812 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4813 else
4814 cat > $TMPC << EOF
4815 #include <sys/ioctl.h>
4816 $_include_soundcard
4817 #ifdef OPEN_SOUND_SYSTEM
4818 int main(void) { return 0; }
4819 #else
4820 #error Not the real thing
4821 #endif
4823 _real_ossaudio=no
4824 cc_check && _real_ossaudio=yes
4825 if test "$_real_ossaudio" = yes; then
4826 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4827 elif netbsd || openbsd ; then
4828 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4829 _ld_extra="$_ld_extra -lossaudio"
4830 else
4831 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4833 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4835 else
4836 _def_ossaudio='#undef USE_OSS_AUDIO'
4837 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4838 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4839 _noaomodules="oss $_noaomodules"
4841 echores "$_ossaudio"
4844 echocheck "aRts"
4845 if test "$_arts" = auto ; then
4846 _arts=no
4847 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4849 cat > $TMPC << EOF
4850 #include <artsc.h>
4851 int main(void) { return 0; }
4853 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
4858 if test "$_arts" = yes ; then
4859 _def_arts='#define USE_ARTS 1'
4860 _aosrc="$_aosrc ao_arts.c"
4861 _aomodules="arts $_aomodules"
4862 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
4863 _inc_extra="$_inc_extra `artsc-config --cflags`"
4864 else
4865 _noaomodules="arts $_noaomodules"
4867 echores "$_arts"
4870 echocheck "EsounD"
4871 if test "$_esd" = auto ; then
4872 _esd=no
4873 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4875 cat > $TMPC << EOF
4876 #include <esd.h>
4877 int main(void) { return 0; }
4879 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes
4883 echores "$_esd"
4885 if test "$_esd" = yes ; then
4886 _def_esd='#define USE_ESD 1'
4887 _aosrc="$_aosrc ao_esd.c"
4888 _aomodules="esd $_aomodules"
4889 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
4890 _inc_extra="$_inc_extra `esd-config --cflags`"
4892 echocheck "esd_get_latency()"
4893 cat > $TMPC << EOF
4894 #include <esd.h>
4895 int main(void) { return esd_get_latency(0); }
4897 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4898 echores "$_esd_latency"
4899 else
4900 _def_esd='#undef USE_ESD'
4901 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4902 _noaomodules="esd $_noaomodules"
4905 echocheck "Polyp"
4906 if test "$_polyp" = auto ; then
4907 _polyp=no
4908 if $_pkg_config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
4910 cat > $TMPC << EOF
4911 #include <polyp/polyplib.h>
4912 #include <polyp/mainloop.h>
4913 #include <polyp/polyplib-error.h>
4914 int main(void) { return 0; }
4916 cc_check `$_pkg_config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
4920 echores "$_polyp"
4922 if test "$_polyp" = yes ; then
4923 _def_polyp='#define USE_POLYP 1'
4924 _aosrc="$_aosrc ao_polyp.c"
4925 _aomodules="polyp $_aomodules"
4926 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs polyplib polyplib-error polyplib-mainloop`"
4927 _inc_extra="$_inc_extra `$_pkg_config --cflags polyplib polyplib-error polyplib-mainloop`"
4928 else
4929 _def_polyp='#undef USE_POLYP'
4930 _noaomodules="polyp $_noaomodules"
4934 echocheck "JACK"
4935 if test "$_jack" = auto ; then
4936 _jack=yes
4938 cat > $TMPC << EOF
4939 #include <jack/jack.h>
4940 int main(void) { jack_client_new("test"); return 0; }
4942 if cc_check -ljack ; then
4943 _libs_mplayer="$_libs_mplayer -ljack"
4944 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
4945 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
4946 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
4947 else
4948 _jack=no
4952 if test "$_jack" = yes ; then
4953 _def_jack='#define USE_JACK 1'
4954 _aosrc="$_aosrc ao_jack.c"
4955 _aomodules="jack $_aomodules"
4956 else
4957 _noaomodules="jack $_noaomodules"
4959 echores "$_jack"
4961 echocheck "OpenAL"
4962 if test "$_openal" = auto ; then
4963 _openal=no
4964 cat > $TMPC << EOF
4965 #ifdef OPENAL_AL_H
4966 #include <OpenAL/al.h>
4967 #else
4968 #include <AL/al.h>
4969 #endif
4970 int main(void) {
4971 alSourceQueueBuffers(0, 0, 0);
4972 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4973 return 0;
4976 for I in "-lopenal" "-framework OpenAL" ; do
4977 cc_check $I && _openal=yes && break
4978 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
4979 done
4980 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
4982 if test "$_openal" = yes ; then
4983 _def_openal='#define USE_OPENAL 1'
4984 _aosrc="$_aosrc ao_openal.c"
4985 _aomodules="openal $_aomodules"
4986 else
4987 _noaomodules="openal $_noaomodules"
4989 echores "$_openal"
4991 echocheck "ALSA audio"
4992 if test "$_alsa" != no ; then
4993 _alsa=no
4994 cat > $TMPC << EOF
4995 #include <sys/asoundlib.h>
4996 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
4997 #error "alsa version != 0.5.x"
4998 #endif
4999 int main(void) { return 0; }
5001 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5003 cat > $TMPC << EOF
5004 #include <sys/asoundlib.h>
5005 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5006 #error "alsa version != 0.9.x"
5007 #endif
5008 int main(void) { return 0; }
5010 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5011 cat > $TMPC << EOF
5012 #include <alsa/asoundlib.h>
5013 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5014 #error "alsa version != 0.9.x"
5015 #endif
5016 int main(void) { return 0; }
5018 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5020 cat > $TMPC << EOF
5021 #include <sys/asoundlib.h>
5022 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5023 #error "alsa version != 1.0.x"
5024 #endif
5025 int main(void) { return 0; }
5027 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5028 cat > $TMPC << EOF
5029 #include <alsa/asoundlib.h>
5030 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5031 #error "alsa version != 1.0.x"
5032 #endif
5033 int main(void) { return 0; }
5035 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5037 _def_alsa5='#undef HAVE_ALSA5'
5038 _def_alsa9='#undef HAVE_ALSA9'
5039 _def_alsa1x='#undef HAVE_ALSA1X'
5040 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5041 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5042 if test "$_alsaver" ; then
5043 _alsa=yes
5044 if test "$_alsaver" = '0.5.x' ; then
5045 _alsa5=yes
5046 _aosrc="$_aosrc ao_alsa5.c"
5047 _aomodules="alsa5 $_aomodules"
5048 _def_alsa5='#define HAVE_ALSA5 1'
5049 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5050 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5051 elif test "$_alsaver" = '0.9.x-sys' ; then
5052 _alsa9=yes
5053 _aosrc="$_aosrc ao_alsa.c"
5054 _aomodules="alsa $_aomodules"
5055 _def_alsa9='#define HAVE_ALSA9 1'
5056 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5057 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5058 elif test "$_alsaver" = '0.9.x-alsa' ; then
5059 _alsa9=yes
5060 _aosrc="$_aosrc ao_alsa.c"
5061 _aomodules="alsa $_aomodules"
5062 _def_alsa9='#define HAVE_ALSA9 1'
5063 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5064 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5065 elif test "$_alsaver" = '1.0.x-sys' ; then
5066 _alsa1x=yes
5067 _aosrc="$_aosrc ao_alsa.c"
5068 _aomodules="alsa $_aomodules"
5069 _def_alsa1x="#define HAVE_ALSA1X 1"
5070 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5071 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5072 elif test "$_alsaver" = '1.0.x-alsa' ; then
5073 _alsa1x=yes
5074 _aosrc="$_aosrc ao_alsa.c"
5075 _aomodules="alsa $_aomodules"
5076 _def_alsa1x="#define HAVE_ALSA1X 1"
5077 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5078 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5079 else
5080 _alsa=no
5081 _res_comment="unknown version"
5083 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5084 else
5085 _noaomodules="alsa $_noaomodules"
5087 echores "$_alsa"
5090 echocheck "Sun audio"
5091 if test "$_sunaudio" = auto ; then
5092 cat > $TMPC << EOF
5093 #include <sys/types.h>
5094 #include <sys/audioio.h>
5095 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5097 _sunaudio=no
5098 cc_check && _sunaudio=yes
5100 if test "$_sunaudio" = yes ; then
5101 _def_sunaudio='#define USE_SUN_AUDIO 1'
5102 _aosrc="$_aosrc ao_sun.c"
5103 _aomodules="sun $_aomodules"
5104 else
5105 _def_sunaudio='#undef USE_SUN_AUDIO'
5106 _noaomodules="sun $_noaomodules"
5108 echores "$_sunaudio"
5111 if sunos; then
5112 echocheck "Sun mediaLib"
5113 if test "$_mlib" = auto ; then
5114 _mlib=no
5115 cat > $TMPC << EOF
5116 #include <mlib.h>
5117 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5119 cc_check -lmlib && _mlib=yes
5121 if test "$_mlib" = yes ; then
5122 _def_mlib='#define HAVE_MLIB 1'
5123 else
5124 _def_mlib='#undef HAVE_MLIB'
5126 echores "$_mlib"
5127 fi #if sunos
5130 if irix; then
5131 echocheck "SGI audio"
5132 if test "$_sgiaudio" = auto ; then
5133 # check for SGI audio
5134 cat > $TMPC << EOF
5135 #include <dmedia/audio.h>
5136 int main(void) { return 0; }
5138 _sgiaudio=no
5139 cc_check && _sgiaudio=yes
5141 if test "$_sgiaudio" = "yes" ; then
5142 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5143 _libs_mplayer="$_libs_mplayer -laudio"
5144 _aosrc="$_aosrc ao_sgi.c"
5145 _aomodules="sgi $_aomodules"
5146 else
5147 _def_sgiaudio='#undef USE_SGI_AUDIO'
5148 _noaomodules="sgi $_noaomodules"
5150 echores "$_sgiaudio"
5151 fi #if irix
5154 echocheck "VCD support"
5155 if linux || bsdos || freebsd || netbsd || sunos || darwin ; then
5156 _inputmodules="vcd $_inputmodules"
5157 _def_vcd='#define HAVE_VCD 1'
5158 _vcd="yes"
5159 else
5160 _def_vcd='#undef HAVE_VCD'
5161 _noinputmodules="vcd $_noinputmodules"
5162 _res_comment="not supported on this OS"
5163 _vcd="no"
5165 echores "$_vcd"
5167 echocheck "DVD support (libdvdnav)"
5168 if test "$_dvdnav" = auto ; then
5169 $_dvdnavconfig --version >> $TMPLOG 2>&1 || _dvdnav=no
5171 if test "$_dvdnav" = auto ; then
5172 cat > $TMPC <<EOF
5173 #include <dvdnav.h>
5174 int main(void) { dvdnav_t *dvd=0; return 0; }
5176 _dvdnav=no
5177 _dvdnavdir=`$_dvdnavconfig --cflags`
5178 _dvdnavlibs=`$_dvdnavconfig --libs`
5179 _dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
5180 _dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
5181 test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
5182 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
5184 if test "$_dvdnav" = yes ; then
5185 _largefiles=yes
5186 _def_dvdnav='#define USE_DVDNAV 1'
5187 _ld_extra="$_ld_extra `$_dvdnavconfig --libs`"
5188 _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
5189 _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
5190 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
5191 _inputmodules="dvdnav $_inputmodules"
5193 #disable dvdread checks: dvdread will be enabled using dvdnav's version of dvdread
5194 _dvdread_internal=no
5195 _dvdread=yes
5196 else
5197 _def_dvdnav='#undef USE_DVDNAV'
5198 _noinputmodules="dvdnav $_noinputmodules"
5200 echores "$_dvdnav"
5203 echocheck "dvdread"
5204 if test "$_dvdread_internal" = auto ; then
5205 _dvdread_internal=no
5206 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5207 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5208 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5209 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5210 _dvdread_internal=yes
5211 _dvdread=yes
5212 _res_comment="internal"
5214 elif test "$_dvdread" = auto ; then
5215 _dvdread=no
5216 if test "$_dl" = yes; then
5217 cat > $TMPC << EOF
5218 #include <inttypes.h>
5219 #include <dvdread/dvd_reader.h>
5220 #include <dvdread/ifo_types.h>
5221 #include <dvdread/ifo_read.h>
5222 #include <dvdread/nav_read.h>
5223 int main(void) { return 0; }
5225 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5226 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5230 if test "$_dvdread_internal" = yes; then
5231 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5232 _def_dvdread='#define USE_DVDREAD 1'
5233 _inputmodules="dvdread $_inputmodules"
5234 _largefiles=yes
5235 elif test "$_dvdread" = yes; then
5236 _def_dvdread='#define USE_DVDREAD 1'
5237 _inputmodules="dvdread $_inputmodules"
5238 _largefiles=yes
5239 test "$_dvdnav" != yes && _ld_extra="$_ld_extra -ldvdread"
5240 else
5241 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5242 _def_dvdread='#undef USE_DVDREAD'
5243 _noinputmodules="dvdread $_noinputmodules"
5245 echores "$_dvdread"
5248 echocheck "internal libdvdcss"
5249 if test "$_libdvdcss_internal" = auto ; then
5250 _libdvdcss_internal=no
5251 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5253 if test "$_libdvdcss_internal" = yes ; then
5254 if linux || netbsd || openbsd || bsdos ; then
5255 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5256 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5257 elif freebsd ; then
5258 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5259 elif darwin ; then
5260 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5261 _ld_extra="$_ld_extra -framework IOKit"
5263 _inputmodules="libdvdcss $_inputmodules"
5264 else
5265 _noinputmodules="libdvdcss $_noinputmodules"
5267 echores "$_libdvdcss_internal"
5270 echocheck "cdparanoia"
5271 if test "$_cdparanoia" = auto ; then
5272 cat > $TMPC <<EOF
5273 #include <cdda_interface.h>
5274 #include <cdda_paranoia.h>
5275 // This need a better test. How ?
5276 int main(void) {
5277 void *test = cdda_verbose_set;
5278 return test == (void *)1;
5281 _cdparanoia=no
5282 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5283 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5284 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5285 done
5287 if test "$_cdparanoia" = yes ; then
5288 _cdda='yes'
5289 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5290 openbsd && _ld_extra="$_ld_extra -lutil"
5292 echores "$_cdparanoia"
5295 echocheck "libcdio"
5296 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5297 cat > $TMPC << EOF
5298 #include <stdio.h>
5299 #include <cdio/version.h>
5300 #include <cdio/cdda.h>
5301 #include <cdio/paranoia.h>
5302 int main()
5304 void *test = cdda_verbose_set;
5305 printf("%s\n", CDIO_VERSION);
5306 return test == (void *)1;
5310 _libcdio=no
5311 for _ld_tmp in "" "-lwinmm" ; do
5312 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5313 cc_check $_ld_tmp $_ld_lm \
5314 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5315 done
5316 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5317 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5318 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5319 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5320 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5323 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5324 _cdda='yes'
5325 _def_libcdio='#define HAVE_LIBCDIO'
5326 _def_havelibcdio='yes'
5327 else
5328 if test "$_cdparanoia" = yes ; then
5329 _res_comment="using cdparanoia"
5331 _def_libcdio='#undef HAVE_LIBCDIO'
5332 _def_havelibcdio='no'
5334 echores "$_libcdio"
5336 if test "$_cdda" = yes ; then
5337 test $_cddb = auto && test $_network = yes && not darwin && _cddb=yes
5338 _def_cdparanoia='#define HAVE_CDDA'
5339 _inputmodules="cdda $_inputmodules"
5340 else
5341 _def_cdparanoia='#undef HAVE_CDDA'
5342 _noinputmodules="cdda $_noinputmodules"
5345 if test "$_cddb" = yes ; then
5346 _def_cddb='#define HAVE_CDDB'
5347 _inputmodules="cddb $_inputmodules"
5348 else
5349 _cddb=no
5350 _def_cddb='#undef HAVE_CDDB'
5351 _noinputmodules="cddb $_noinputmodules"
5354 echocheck "bitmap font support"
5355 if test "$_bitmap_font" = yes ; then
5356 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5357 else
5358 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5360 echores "$_bitmap_font"
5363 echocheck "freetype >= 2.0.9"
5365 # freetype depends on iconv
5366 if test "$_iconv" = no ; then
5367 _freetype=no
5368 _res_comment="iconv support needed"
5371 if test "$_freetype" = auto ; then
5372 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5373 cat > $TMPC << EOF
5374 #include <stdio.h>
5375 #include <ft2build.h>
5376 #include FT_FREETYPE_H
5377 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5378 #error "Need FreeType 2.0.9 or newer"
5379 #endif
5380 int main()
5382 FT_Library library;
5383 FT_Int major=-1,minor=-1,patch=-1;
5384 int err=FT_Init_FreeType(&library);
5385 if(err){
5386 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5387 exit(err);
5389 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5390 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5391 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5392 (int)major,(int)minor,(int)patch );
5393 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5394 printf("Library and header version mismatch! Fix it in your distribution!\n");
5395 exit(1);
5397 return 0;
5400 _freetype=no
5401 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5402 else
5403 _freetype=no
5406 if test "$_freetype" = yes ; then
5407 _def_freetype='#define HAVE_FREETYPE'
5408 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5409 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5410 else
5411 _def_freetype='#undef HAVE_FREETYPE'
5413 echores "$_freetype"
5415 if test "$_freetype" = no ; then
5416 _fontconfig=no
5417 _res_comment="freetype support needed"
5419 echocheck "fontconfig"
5420 if test "$_fontconfig" = auto ; then
5421 cat > $TMPC << EOF
5422 #include <stdio.h>
5423 #include <fontconfig/fontconfig.h>
5424 int main()
5426 int err = FcInit();
5427 if(err == FcFalse){
5428 printf("Couldn't initialize fontconfig lib\n");
5429 exit(err);
5431 return 0;
5435 _fontconfig=no
5436 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5437 _ld_tmp="-lfontconfig $_ld_tmp"
5438 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5439 done
5440 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5441 _inc_tmp=`$_pkg_config --cflags fontconfig`
5442 _ld_tmp=`$_pkg_config --libs fontconfig`
5443 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5444 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5447 if test "$_fontconfig" = yes ; then
5448 _def_fontconfig='#define HAVE_FONTCONFIG'
5449 else
5450 _def_fontconfig='#undef HAVE_FONTCONFIG'
5452 echores "$_fontconfig"
5455 echocheck "SSA/ASS support"
5456 # libass depends on FreeType
5457 if test "$_freetype" = no ; then
5458 _ass=no
5459 _res_comment="FreeType support needed"
5462 if test "$_ass" = auto ; then
5463 cat > $TMPC << EOF
5464 #include <ft2build.h>
5465 #include FT_FREETYPE_H
5466 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5467 #error "Need FreeType 2.1.8 or newer"
5468 #endif
5469 int main() { return 0; }
5471 _ass=no
5472 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5473 if test "$_ass" = no ; then
5474 _res_comment="FreeType >= 2.1.8 needed"
5477 if test "$_ass" = yes ; then
5478 _def_ass='#define USE_ASS'
5479 else
5480 _def_ass='#undef USE_ASS'
5482 echores "$_ass"
5485 echocheck "fribidi with charsets"
5486 if test "$_fribidi" = auto ; then
5487 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5488 cat > $TMPC << EOF
5489 #include <stdio.h>
5490 /* workaround for fribidi 0.10.4 and below */
5491 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5492 #include <fribidi/fribidi.h>
5493 int main()
5495 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5496 printf("Fribidi headers are not consistents with the library!\n");
5497 exit(1);
5499 return 0;
5502 _fribidi=no
5503 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5504 else
5505 _fribidi=no
5508 if test "$_fribidi" = yes ; then
5509 _def_fribidi='#define USE_FRIBIDI'
5510 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5511 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5512 else
5513 _def_fribidi='#undef USE_FRIBIDI'
5515 echores "$_fribidi"
5518 echocheck "ENCA"
5519 if test "$_enca" = auto ; then
5520 cat > $TMPC << EOF
5521 #include <enca.h>
5522 int main()
5524 const char **langs;
5525 size_t langcnt;
5526 langs = enca_get_languages(&langcnt);
5527 return 0;
5530 _enca=no
5531 cc_check -lenca $_ld_lm && _enca=yes
5533 if test "$_enca" = yes ; then
5534 _def_enca='#define HAVE_ENCA 1'
5535 _ld_extra="$_ld_extra -lenca"
5536 else
5537 _def_enca='#undef HAVE_ENCA'
5539 echores "$_enca"
5542 echocheck "zlib"
5543 cat > $TMPC << EOF
5544 #include <zlib.h>
5545 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5547 _zlib=no
5548 cc_check -lz && _zlib=yes
5549 if test "$_zlib" = yes ; then
5550 _def_zlib='#define HAVE_ZLIB 1'
5551 _ld_extra="$_ld_extra -lz"
5552 else
5553 _def_zlib='#undef HAVE_ZLIB'
5555 echores "$_zlib"
5558 echocheck "RTC"
5559 if test "$_rtc" = auto ; then
5560 cat > $TMPC << EOF
5561 #include <sys/ioctl.h>
5562 #ifdef __linux__
5563 #include <linux/rtc.h>
5564 #else
5565 #include <rtc.h>
5566 #define RTC_PIE_ON RTCIO_PIE_ON
5567 #endif
5568 int main(void) { return RTC_PIE_ON; }
5570 _rtc=no
5571 cc_check && _rtc=yes
5572 ppc && _rtc=no
5574 if test "$_rtc" = yes ; then
5575 _def_rtc='#define HAVE_RTC 1'
5576 else
5577 _def_rtc='#undef HAVE_RTC'
5579 echores "$_rtc"
5582 echocheck "liblzo2 support"
5583 if test "$_liblzo" = auto ; then
5584 _liblzo=no
5585 cat > $TMPC << EOF
5586 #include <lzo/lzo1x.h>
5587 int main(void) { lzo_init();return 0; }
5589 cc_check -llzo2 && _liblzo=yes
5591 if test "$_liblzo" = yes ; then
5592 _def_liblzo='#define USE_LIBLZO 1'
5593 _ld_extra="$_ld_extra -llzo2"
5594 _codecmodules="liblzo $_codecmodules"
5595 else
5596 _def_liblzo='#undef USE_LIBLZO'
5597 _nocodecmodules="liblzo $_nocodecmodules"
5599 echores "$_liblzo"
5602 echocheck "mad support"
5603 if test "$_mad" = auto ; then
5604 _mad=no
5605 cat > $TMPC << EOF
5606 #include <mad.h>
5607 int main(void) { return 0; }
5609 cc_check -lmad && _mad=yes
5611 if test "$_mad" = yes ; then
5612 _def_mad='#define USE_LIBMAD 1'
5613 _ld_extra="$_ld_extra -lmad"
5614 _codecmodules="libmad $_codecmodules"
5615 else
5616 _def_mad='#undef USE_LIBMAD'
5617 _nocodecmodules="libmad $_nocodecmodules"
5619 echores "$_mad"
5621 echocheck "Twolame"
5622 if test "$_twolame" = auto ; then
5623 cat > $TMPC <<EOF
5624 #include <twolame.h>
5625 int main(void) { twolame_init(); return 0; }
5627 _twolame=no
5628 cc_check -ltwolame $_ld_lm && _twolame=yes
5630 if test "$_twolame" = yes ; then
5631 _def_twolame='#define HAVE_TWOLAME 1'
5632 _libs_mencoder="$_libs_mencoder -ltwolame"
5633 _codecmodules="twolame $_codecmodules"
5634 else
5635 _def_twolame='#undef HAVE_TWOLAME'
5636 _nocodecmodules="twolame $_nocodecmodules"
5638 echores "$_twolame"
5640 echocheck "Toolame"
5641 if test "$_toolame" = auto ; then
5642 _toolame=no
5643 if test "$_twolame" = yes ; then
5644 _res_comment="disabled by twolame"
5645 else
5646 cat > $TMPC <<EOF
5647 #include <toolame.h>
5648 int main(void) { toolame_init(); return 0; }
5650 cc_check -ltoolame $_ld_lm && _toolame=yes
5653 if test "$_toolame" = yes ; then
5654 _def_toolame='#define HAVE_TOOLAME 1'
5655 _libs_mencoder="$_libs_mencoder -ltoolame"
5656 _codecmodules="toolame $_codecmodules"
5657 else
5658 _def_toolame='#undef HAVE_TOOLAME'
5659 _nocodecmodules="toolame $_nocodecmodules"
5661 if test "$_toolamedir" ; then
5662 _res_comment="using $_toolamedir"
5664 echores "$_toolame"
5666 echocheck "OggVorbis support"
5667 if test "$_tremor_internal" = yes; then
5668 _libvorbis=no
5669 elif test "$_tremor_external" = auto; then
5670 _tremor_external=no
5671 cat > $TMPC << EOF
5672 #include <tremor/ivorbiscodec.h>
5673 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5675 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5677 if test "$_libvorbis" = auto; then
5678 _libvorbis=no
5679 cat > $TMPC << EOF
5680 #include <vorbis/codec.h>
5681 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5683 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5685 if test "$_tremor_internal" = yes ; then
5686 _vorbis=yes
5687 _def_vorbis='#define HAVE_OGGVORBIS 1'
5688 _def_tremor='#define TREMOR 1'
5689 _codecmodules="tremor(internal) $_codecmodules"
5690 _res_comment="internal Tremor"
5691 if test "$_tremor_low" = yes ; then
5692 _tremor_flags='-D_LOW_ACCURACY_'
5693 _res_comment="internal low accuracy Tremor"
5695 elif test "$_tremor_external" = yes ; then
5696 _vorbis=yes
5697 _def_vorbis='#define HAVE_OGGVORBIS 1'
5698 _def_tremor='#define TREMOR 1'
5699 _codecmodules="tremor(external) $_codecmodules"
5700 _res_comment="external Tremor"
5701 _ld_extra="$_ld_extra -logg -lvorbisidec"
5702 elif test "$_libvorbis" = yes ; then
5703 _vorbis=yes
5704 _def_vorbis='#define HAVE_OGGVORBIS 1'
5705 _codecmodules="libvorbis $_codecmodules"
5706 _res_comment="libvorbis"
5707 _ld_extra="$_ld_extra -lvorbis -logg"
5708 else
5709 _vorbis=no
5710 _nocodecmodules="libvorbis $_nocodecmodules"
5712 echores "$_vorbis"
5714 echocheck "libspeex (version >= 1.1 required)"
5715 if test "$_speex" = auto ; then
5716 _speex=no
5717 cat > $TMPC << EOF
5718 #include <speex/speex.h>
5719 int main(void) {
5720 SpeexBits bits;
5721 void *dec;
5722 speex_decode_int(dec, &bits, dec);
5725 cc_check -lspeex $_ld_lm && _speex=yes
5727 if test "$_speex" = yes ; then
5728 _def_speex='#define HAVE_SPEEX 1'
5729 _ld_extra="$_ld_extra -lspeex"
5730 _codecmodules="speex $_codecmodules"
5731 else
5732 _def_speex='#undef HAVE_SPEEX'
5733 _nocodecmodules="speex $_nocodecmodules"
5735 echores "$_speex"
5737 echocheck "OggTheora support"
5738 if test "$_theora" = auto ; then
5739 _theora=no
5740 cat > $TMPC << EOF
5741 #include <theora/theora.h>
5742 #include <string.h>
5743 int main(void)
5745 /* theora is in flux, make sure that all interface routines and
5746 * datatypes exist and work the way we expect it, so we don't break
5747 * mplayer */
5748 ogg_packet op;
5749 theora_comment tc;
5750 theora_info inf;
5751 theora_state st;
5752 yuv_buffer yuv;
5753 int r;
5754 double t;
5756 theora_info_init (&inf);
5757 theora_comment_init (&tc);
5759 return 0;
5761 /* we don't want to execute this kind of nonsense; just for making sure
5762 * that compilation works... */
5763 memset(&op, 0, sizeof(op));
5764 r = theora_decode_header (&inf, &tc, &op);
5765 r = theora_decode_init (&st, &inf);
5766 t = theora_granule_time (&st, op.granulepos);
5767 r = theora_decode_packetin (&st, &op);
5768 r = theora_decode_YUVout (&st, &yuv);
5769 theora_clear (&st);
5771 return 0;
5774 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5775 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5776 && _theora=yes && break
5777 done
5778 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5779 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5780 cc_check -I. tremor/bitwise.c $_ld_theora \
5781 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5782 done
5785 if test "$_theora" = yes ; then
5786 _def_theora='#define HAVE_OGGTHEORA 1'
5787 _codecmodules="libtheora $_codecmodules"
5788 # when --enable-theora is forced, we'd better provide a probably sane
5789 # $_ld_theora than nothing
5790 test -z "$_ld_theora" && _ld_theora="-ltheora -logg"
5791 else
5792 _def_theora='#undef HAVE_OGGTHEORA'
5793 _nocodecmodules="libtheora $_nocodecmodules"
5795 echores "$_theora"
5797 echocheck "mp3lib support"
5798 if test "$_mp3lib" = yes ; then
5799 _def_mp3lib='#define USE_MP3LIB 1'
5800 _codecmodules="mp3lib $_codecmodules"
5801 else
5802 _def_mp3lib='#undef USE_MP3LIB'
5803 _nocodecmodules="mp3lib $_nocodecmodules"
5805 echores "$_mp3lib"
5807 echocheck "liba52 support"
5808 if test "$_liba52" = yes ; then
5809 _def_liba52='#define USE_LIBA52 1'
5810 _codecmodules="liba52 $_codecmodules"
5811 else
5812 _def_liba52='#undef USE_LIBA52'
5813 _nocodecmodules="liba52 $_nocodecmodules"
5815 echores "$_liba52"
5817 echocheck "libdts support"
5818 if test "$_libdts" = auto ; then
5819 _libdts=no
5820 cat > $TMPC << EOF
5821 #include <inttypes.h>
5822 #include <dts.h>
5823 int main(void) { dts_init (0); return 0; }
5825 cc_check -ldts $_ld_lm && _libdts=yes
5827 if test "$_libdts" = yes ; then
5828 _def_libdts='#define CONFIG_LIBDTS 1'
5829 _ld_extra="$_ld_extra -ldts"
5830 _codecmodules="libdts $_codecmodules"
5831 else
5832 _def_libdts='#undef CONFIG_LIBDTS'
5833 _nocodecmodules="libdts $_nocodecmodules"
5835 echores "$_libdts"
5837 echocheck "libmpeg2 support"
5838 if test "$_libmpeg2" = yes ; then
5839 _def_libmpeg2='#define USE_LIBMPEG2 1'
5840 _codecmodules="libmpeg2 $_codecmodules"
5841 else
5842 _def_libmpeg2='#undef USE_LIBMPEG2'
5843 _nocodecmodules="libmpeg2 $_nocodecmodules"
5845 echores "$_libmpeg2"
5847 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5848 if test "$_musepack" = auto ; then
5849 _musepack=no
5850 cat > $TMPC << EOF
5851 #include <mpcdec/mpcdec.h>
5852 int main(void) {
5853 mpc_streaminfo info;
5854 mpc_decoder decoder;
5855 mpc_decoder_set_streaminfo(&decoder, &info);
5856 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5859 cc_check -lmpcdec $_ld_lm && _musepack=yes
5861 if test "$_musepack" = yes ; then
5862 _def_musepack='#define HAVE_MUSEPACK 1'
5863 _ld_extra="$_ld_extra -lmpcdec"
5864 _codecmodules="musepack $_codecmodules"
5865 else
5866 _def_musepack='#undef HAVE_MUSEPACK'
5867 _nocodecmodules="musepack $_nocodecmodules"
5869 echores "$_musepack"
5872 echocheck "FAAC (AAC encoder) support"
5873 if test "$_faac" = auto ; then
5874 cat > $TMPC <<EOF
5875 #include <inttypes.h>
5876 #include <faac.h>
5877 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5879 _faac=no
5880 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5881 cc_check -O4 $_ld_faac $_ld_tmp $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
5882 done
5884 if test "$_faac" = yes ; then
5885 _def_faac="#define HAVE_FAAC 1"
5886 if echo $_libavencoders | grep -q FAAC ; then
5887 _lavc_faac=yes
5888 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
5889 _libs_mplayer="$_libs_mplayer $_ld_faac"
5890 else
5891 _lavc_faac=no
5892 _def_lavc_faac="#undef CONFIG_LIBFAAC"
5894 _codecmodules="faac $_codecmodules"
5895 else
5896 _def_faac="#undef HAVE_FAAC"
5897 _nocodecmodules="faac $_nocodecmodules"
5899 echores "$_faac (in libavcodec: $_lavc_faac)"
5902 echocheck "FAAD2 (AAC) support"
5903 if test "$_faad_internal" = auto ; then
5904 if x86_32 && test cc_vendor=gnu; then
5905 case $cc_version in
5906 3.1*|3.2) # ICE/insn with these versions
5907 _faad_internal=no
5908 _res_comment="broken gcc"
5911 _faad_internal=yes
5913 esac
5914 else
5915 _faad_internal=yes
5917 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
5918 _faad_external=no
5919 cat > $TMPC << EOF
5920 #include <faad.h>
5921 #ifndef FAAD_MIN_STREAMSIZE
5922 #error Too old version
5923 #endif
5924 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5926 cc_check -lfaad $_ld_lm && _faad_external=yes
5929 if test "$_faad_internal" = yes ; then
5930 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
5931 _faad=yes
5932 _res_comment="internal floating-point"
5933 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
5934 elif test "$_faad_external" = yes ; then
5935 _faad=yes
5936 _ld_extra="$_ld_extra -lfaad"
5937 else
5938 _def_faad_internal="#undef USE_FAAD_INTERNAL"
5939 _faad=no
5942 if test "$_faad" = yes ; then
5943 _def_faad='#define HAVE_FAAD 1'
5944 _codecmodules="faad2 $_codecmodules"
5945 else
5946 _def_faad='#undef HAVE_FAAD'
5947 _nocodecmodules="faad2 $_nocodecmodules"
5949 echores "$_faad"
5952 echocheck "LADSPA plugin support"
5953 if test "$_ladspa" = auto ; then
5954 cat > $TMPC <<EOF
5955 #include <stdio.h>
5956 #include <ladspa.h>
5957 int main(void) {
5958 const LADSPA_Descriptor *ld = NULL;
5959 return 0;
5962 _ladspa=no
5963 cc_check && _ladspa=yes
5965 if test "$_ladspa" = yes; then
5966 _def_ladspa="#define HAVE_LADSPA"
5967 _afsrc="$_afsrc af_ladspa.c"
5968 _afmodules="ladspa $_afmodules"
5969 else
5970 _def_ladspa="#undef HAVE_LADSPA"
5971 _noafmodules="ladspa $_noafmodules"
5973 echores "$_ladspa"
5976 if test -z "$_codecsdir" ; then
5977 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5978 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5979 if test -d "$dir" ; then
5980 _codecsdir="$dir"
5981 break;
5983 done
5985 # Fall back on default directory.
5986 if test -z "$_codecsdir" ; then
5987 _codecsdir="$_libdir/codecs"
5988 mingw32 && _codecsdir="codecs"
5992 echocheck "Win32 codecs"
5993 if test "$_win32" = auto ; then
5994 _win32=no
5995 if x86_32 && not qnx; then
5996 _win32=yes
5999 if test "$_win32" = yes ; then
6000 _def_win32='#define USE_WIN32DLL 1'
6001 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6002 _res_comment="using $_win32codecsdir"
6003 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
6004 if not win32 ; then
6005 _def_win32_loader='#define WIN32_LOADER 1'
6006 else
6007 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6008 _res_comment="using native windows"
6010 _codecmodules="win32 $_codecmodules"
6011 else
6012 _def_win32='#undef USE_WIN32DLL'
6013 _def_win32_loader='#undef WIN32_LOADER'
6014 _nocodecmodules="win32 $_nocodecmodules"
6016 echores "$_win32"
6019 echocheck "XAnim codecs"
6020 if test "$_xanim" = auto ; then
6021 _xanim=no
6022 _res_comment="dynamic loader support needed"
6023 if test "$_dl" = yes ; then
6024 _xanim=yes
6027 if test "$_xanim" = yes ; then
6028 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6029 _def_xanim='#define USE_XANIM 1'
6030 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6031 _codecmodules="xanim $_codecmodules"
6032 _res_comment="using $_xanimcodecsdir"
6033 else
6034 _def_xanim='#undef USE_XANIM'
6035 _def_xanim_path='#undef XACODEC_PATH'
6036 _nocodecmodules="xanim $_nocodecmodules"
6038 echores "$_xanim"
6041 echocheck "RealPlayer codecs"
6042 if test "$_real" = auto ; then
6043 _real=no
6044 _res_comment="dynamic loader support needed"
6045 if test "$_dl" = yes || test "$_win32" = yes &&
6046 (linux || freebsd || netbsd || win32 || darwin) ; then
6047 _real=yes
6050 if test "$_real" = yes ; then
6051 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6052 _def_real='#define USE_REALCODECS 1'
6053 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6054 _codecmodules="real $_codecmodules"
6055 _res_comment="using $_realcodecsdir"
6056 else
6057 _def_real='#undef USE_REALCODECS'
6058 _def_real_path="#undef REALCODEC_PATH"
6059 _nocodecmodules="real $_nocodecmodules"
6061 echores "$_real"
6064 echocheck "LIVE555 Streaming Media libraries"
6065 if test "$_live" = auto && test "$_network" = yes ; then
6066 cat > $TMPCPP << EOF
6067 #include <liveMedia.hh>
6068 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6069 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6070 #endif
6071 int main(void) {}
6074 _live=no
6075 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6076 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6077 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6078 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6079 $_livelibdir/groupsock/libgroupsock.a \
6080 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6081 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6082 $_ld_extra -lstdc++" \
6083 _inc_extra="$_inc_extra -I$_livelibdir/liveMedia/include \
6084 -I$_livelibdir/UsageEnvironment/include \
6085 -I$_livelibdir/BasicUsageEnvironment/include \
6086 -I$_livelibdir/groupsock/include" && \
6087 _live=yes && break
6088 done
6089 if test "$_live" != yes ; then
6090 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6091 _live_dist=yes
6095 if test "$_live" = yes && test "$_network" = yes ; then
6096 _res_comment="using $_livelibdir"
6097 _def_live='#define STREAMING_LIVE555 1'
6098 _inputmodules="live555 $_inputmodules"
6099 elif test "$_live_dist" = yes && test "$_network" = yes ; then
6100 _res_comment="using distribution version"
6101 _live="yes"
6102 _def_live='#define STREAMING_LIVE555 1'
6103 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6104 _inc_extra="$_inc_extra -I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6105 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6106 _inputmodules="live555 $_inputmodules"
6107 else
6108 _def_live='#undef STREAMING_LIVE555'
6109 _noinputmodules="live555 $_noinputmodules"
6111 echores "$_live"
6114 echocheck "FFmpeg libavutil (static)"
6115 if test "$_libavutil" = auto ; then
6116 if test -d libavutil ; then
6117 _libavutil=yes
6118 else
6119 _libavutil=no
6122 echores "$_libavutil"
6124 echocheck "FFmpeg libavcodec (static)"
6125 if test "$_libavcodec" = auto ; then
6126 # Note: static linking is preferred to dynamic linking
6127 _libavcodec=no
6128 _res_comment="see DOCS/HTML/$_doc_lang/codecs.html"
6129 if test -d libavcodec && test -f libavcodec/utils.c ; then
6130 _res_comment="old ffmpeg version, use CVS !"
6131 if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
6132 # check if libavutil is a required
6133 cat > $TMPC << EOF
6134 #include "libavcodec/avcodec.h"
6135 #if LIBAVCODEC_BUILD >= 3211265
6136 #error We need libavutil!
6137 #endif
6138 int main(void) { return 0; }
6141 if cc_check -I. -I./libavutil; then
6142 _libavutil_required="no"
6143 else
6144 _libavutil_required="yes"
6146 _res_comment="libavutil availability does not fit libavcodec version"
6147 if test "$_libavutil_required" = "$_libavutil"; then
6148 _libavcodec="yes"
6149 _res_comment=""
6154 echores "$_libavcodec"
6156 echocheck "FFmpeg libavformat (static)"
6157 if test "$_libavformat" = auto ; then
6158 # Note: static linking is preferred to dynamic linking
6159 _libavformat=no
6160 if test -d libavformat && test -f libavformat/utils.c ; then
6161 _libavformat=yes
6164 echores "$_libavformat"
6166 echocheck "FFmpeg libpostproc (static)"
6167 if test "$_libpostproc" = auto ; then
6168 _libpostproc=no
6169 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6170 _libpostproc='yes'
6173 echores "$_libpostproc"
6176 if test "$_libavutil" != yes ; then
6177 echocheck "FFmpeg libavutil (dynamic)"
6178 if test "$_libavutil_so" = auto ; then
6179 _libavutil_so=no
6180 cat > $TMPC << EOF
6181 #include <ffmpeg/common.h>
6182 int main(void) { ff_gcd(1,1); return 0; }
6184 if $_pkg_config --exists libavutil ; then
6185 _inc_libavutil=`$_pkg_config --cflags libavutil`
6186 _ld_tmp=`$_pkg_config --libs libavutil`
6187 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6188 && _libavutil_so=yes
6189 elif cc_check -lavutil $_ld_lm ; then
6190 _ld_extra="$_ld_extra -lavutil"
6191 _libavutil_so=yes
6192 _res_comment="using libavutil.so, but static libavutil is recommended"
6195 # neither static nor shared libavutil is available, but it is mandatory ...
6196 if test "$_libavutil_so" = no ; then
6197 die "You need static or shared libavutil, MPlayer will not compile without!"
6199 echores "$_libavutil_so"
6200 fi #if test "$_libavutil" != yes ; then
6202 if test "$_libavcodec" != yes ; then
6203 echocheck "FFmpeg libavcodec (dynamic)"
6204 if test "$_libavcodec_so" = auto ; then
6205 _libavcodec_so=no
6206 _res_comment="libavcodec.so is broken/obsolete"
6207 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
6208 cat > $TMPC << EOF
6209 #include <ffmpeg/avcodec.h>
6210 int main(void) {
6211 avcodec_find_encoder_by_name("");
6212 return 0;
6215 if $_pkg_config --exists libavcodec ; then
6216 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6217 _ld_tmp=`$_pkg_config --libs libavcodec`
6218 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6219 && _libavcodec_so=yes
6220 elif cc_check -lavcodec $_ld_lm ; then
6221 _ld_extra="$_ld_extra -lavcodec"
6222 _libavcodec_so=yes
6223 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6226 echores "$_libavcodec_so"
6227 fi #if test "$_libavcodec" != yes ; then
6229 if test "$_libavformat" != yes ; then
6230 echocheck "FFmpeg libavformat (dynamic)"
6231 if test "$_libavformat_so" = auto ; then
6232 _libavformat_so=no
6233 cat > $TMPC <<EOF
6234 #include <ffmpeg/avformat.h>
6235 #include <ffmpeg/opt.h>
6236 int main(void) { av_alloc_format_context(); return 0; }
6238 if $_pkg_config --exists libavformat ; then
6239 _inc_libavformat=`$_pkg_config --cflags libavformat`
6240 _ld_tmp=`$_pkg_config --libs libavformat`
6241 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6242 && _libavformat_so=yes
6243 elif cc_check $_ld_lm -lavformat ; then
6244 _ld_extra="$_ld_extra -lavformat"
6245 _libavformat_so=yes
6246 _res_comment="using libavformat.so, but static libavformat is recommended"
6249 echores "$_libavformat_so"
6250 fi #if test "$_libavformat" != yes ; then
6252 if test "$_libpostproc" != yes ; then
6253 echocheck "FFmpeg libpostproc (dynamic)"
6254 if test "$_libpostproc_so" = auto ; then
6255 _libpostproc_so=no
6256 cat > $TMPC << EOF
6257 #define USE_LIBPOSTPROC 1
6258 #include <inttypes.h>
6259 #include <postproc/postprocess.h>
6260 int main(void) {
6261 pp_get_mode_by_name_and_quality("de", 0);
6262 return 0;}
6264 if cc_check -lpostproc $_ld_lm ; then
6265 _ld_extra="$_ld_extra -lpostproc"
6266 _libpostproc_so=yes
6267 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6270 echores "$_libpostproc_so"
6271 fi #if test "$_libpostproc" != yes ; then
6273 _def_libavutil='#undef USE_LIBAVUTIL'
6274 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6275 if test "$_libavutil" = yes ; then
6276 _def_libavutil='#define USE_LIBAVUTIL 1'
6277 elif test "$_libavutil_so" = yes ; then
6278 _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6281 _def_libavcodec='#undef USE_LIBAVCODEC'
6282 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6283 _def_lavc_dsputil='#undef USE_LIBAVCODEC_DSPUTIL'
6284 if test "$_libavcodec_mpegaudio_hp" = yes ; then
6285 _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6287 if test "$_libavcodec" = yes ; then
6288 _def_libavcodec='#define USE_LIBAVCODEC 1'
6289 _def_lavc_dsputil='#define USE_LIBAVCODEC_DSPUTIL'
6290 _codecmodules="libavcodec $_codecmodules"
6291 elif test "$_libavcodec_so" = yes ; then
6292 _def_libavcodec='#define USE_LIBAVCODEC 1'
6293 _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6294 _codecmodules="libavcodec.so $_codecmodules"
6295 else
6296 _nocodecmodules="libavcodec $_nocodecmodules"
6299 _def_libavformat='#undef USE_LIBAVFORMAT'
6300 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6301 _def_libavformat_win32='#undef CONFIG_WIN32'
6302 if test "$_libavformat" = yes ; then
6303 _def_libavformat='#define USE_LIBAVFORMAT 1'
6304 if win32 ; then
6305 _def_libavformat_win32='#define CONFIG_WIN32 1'
6307 else
6308 if test "$_libavformat_so" = yes ; then
6309 _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6310 if win32 ; then
6311 _def_libavformat_win32='#define CONFIG_WIN32 1'
6316 _def_libpostproc='#undef USE_LIBPOSTPROC'
6317 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6318 if test "$_libpostproc" = yes ; then
6319 _def_libpostproc='#define USE_LIBPOSTPROC 1'
6320 else
6321 if test "$_libpostproc_so" = yes ; then
6322 _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6326 echocheck "md5sum support"
6327 if test "$_md5sum" = yes; then
6328 _def_md5sum="#define HAVE_MD5SUM"
6329 _vosrc="$_vosrc vo_md5sum.c"
6330 _vomodules="md5sum $_vomodules"
6331 else
6332 _def_md5sum="#undef HAVE_MD5SUM"
6333 _novomodules="md5sum $_novomodules"
6335 echores "$_md5sum"
6337 echocheck "AMR narrowband"
6338 if test "$_amr_nb" = auto ; then
6339 _amr_nb=no
6340 if test -f libavcodec/amr_float/sp_dec.c ; then
6341 if test "$_libavcodec" = yes ; then
6342 _amr_nb=yes
6343 else
6344 _res_comment="libavcodec (static) is required by amr_nb, sorry"
6348 if test "$_amr_nb" = yes ; then
6349 _amr=yes
6350 _def_amr='#define CONFIG_AMR 1'
6351 _def_amr_nb='#define CONFIG_AMR_NB 1'
6352 else
6353 _def_amr_nb='#undef CONFIG_AMR_NB'
6355 echores "$_amr_nb"
6357 echocheck "AMR narrowband, fixed point"
6358 if test "$_amr_nb_fixed" = auto ; then
6359 _amr_nb_fixed=no
6360 if test -f libavcodec/amr/dtx_dec.c ; then
6361 if test "$_libavcodec" = yes ; then
6362 if test "$_amr_nb" = no ; then
6363 _amr_nb_fixed=yes
6364 else
6365 _res_comment="disabled by amr_nb"
6367 else
6368 _res_comment="libavcodec (static) is required by amr_nb-fixed, sorry"
6372 if test "$_amr_nb_fixed" = yes ; then
6373 _amr=yes
6374 _def_amr='#define CONFIG_AMR 1'
6375 _def_amr_nb_fixed='#define CONFIG_AMR_NB_FIXED 1'
6376 else
6377 _def_amr_nb_fixed='#undef CONFIG_AMR_NB_FIXED'
6379 echores "$_amr_nb_fixed"
6381 if test "$_amr_nb" = yes || test "$_amr_nb_fixed" = yes ; then
6382 _codecmodules="amr_nb $_codecmodules"
6383 else
6384 _nocodecmodules="amr_nb $_nocodecmodules"
6387 echocheck "AMR wideband"
6388 if test "$_amr_wb" = auto ; then
6389 _amr_wb=no
6390 if test -f libavcodec/amrwb_float/dec_dtx.c ; then
6391 if test "$_libavcodec" = yes ; then
6392 _amr_wb=yes
6393 else
6394 _res_comment="libavcodec (static) is required by amr_wb, sorry"
6398 if test "$_amr_wb" = yes ; then
6399 _amr=yes
6400 _def_amr='#define CONFIG_AMR 1'
6401 _def_amr_wb='#define CONFIG_AMR_WB 1'
6402 _codecmodules="amr_wb $_codecmodules"
6403 else
6404 _def_amr_wb='#undef CONFIG_AMR_WB'
6405 _nocodecmodules="amr_wb $_nocodecmodules"
6407 echores "$_amr_wb"
6409 echocheck "libdv-0.9.5+"
6410 if test "$_libdv" = auto ; then
6411 _libdv=no
6412 cat > $TMPC <<EOF
6413 #include <libdv/dv.h>
6414 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6416 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6418 if test "$_libdv" = yes ; then
6419 _def_libdv='#define HAVE_LIBDV095 1'
6420 _ld_extra="$_ld_extra -ldv"
6421 _codecmodules="libdv $_codecmodules"
6422 else
6423 _def_libdv='#undef HAVE_LIBDV095'
6424 _nocodecmodules="libdv $_nocodecmodules"
6426 echores "$_libdv"
6428 echocheck "zr"
6429 if test "$_zr" = auto ; then
6430 #36067's seem to identify themselves as 36057PQC's, so the line
6431 #below should work for 36067's and 36057's.
6432 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6433 _zr=yes
6434 else
6435 _zr=no
6438 if test "$_zr" = yes ; then
6439 if test "$_libavcodec" = yes ; then
6440 _def_zr='#define HAVE_ZR 1'
6441 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6442 _vomodules="zr zr2 $_vomodules"
6443 else
6444 _res_comment="libavcodec (static) is required by zr, sorry"
6445 _novomodules="zr $_novomodules"
6446 _def_zr='#undef HAVE_ZR'
6448 else
6449 _def_zr='#undef HAVE_ZR'
6450 _novomodules="zr zr2 $_novomodules"
6452 echores "$_zr"
6454 echocheck "bl"
6455 if test "$_bl" = yes ; then
6456 _def_bl='#define HAVE_BL 1'
6457 _vosrc="$_vosrc vo_bl.c"
6458 _vomodules="bl $_vomodules"
6459 else
6460 _def_bl='#undef HAVE_BL'
6461 _novomodules="bl $_novomodules"
6463 echores "$_bl"
6466 echocheck "XviD"
6467 if test "$_xvid" = auto ; then
6468 _xvid=no
6469 cat > $TMPC << EOF
6470 #include <xvid.h>
6471 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6473 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6474 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6475 done
6478 if test "$_xvid" = yes ; then
6479 _def_xvid='#define HAVE_XVID4 1'
6480 _codecmodules="xvid $_codecmodules"
6481 else
6482 _def_xvid='#undef HAVE_XVID4'
6483 _nocodecmodules="xvid $_nocodecmodules"
6485 echores "$_xvid"
6487 if test "$_xvid" = yes ; then
6488 echocheck "XviD two pass plugin"
6489 cat > $TMPC << EOF
6490 #include <xvid.h>
6491 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6493 if cc_check ; then
6494 _lavc_xvid=yes
6495 _def_lavc_xvid='#define CONFIG_XVID 1'
6496 else
6497 _lavc_xvid=no
6498 _def_lavc_xvid='#undef CONFIG_XVID'
6500 echores "$_lavc_xvid"
6504 echocheck "x264"
6505 if test "$_x264" = auto ; then
6506 cat > $TMPC << EOF
6507 #include <inttypes.h>
6508 #include <x264.h>
6509 #if X264_BUILD < 53
6510 #error We do not support old versions of x264. Get the latest from SVN.
6511 #endif
6512 int main(void) { x264_encoder_open((void*)0); return 0; }
6514 _x264=no
6515 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6516 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6517 done
6520 if test "$_x264" = yes ; then
6521 _x264=yes
6522 _def_x264='#define HAVE_X264 1'
6523 _codecmodules="x264 $_codecmodules"
6524 if echo $_libavencoders | grep -q X264 ; then
6525 _lavc_x264=yes
6526 _def_lavc_x264='#define CONFIG_X264 1'
6527 _libs_mplayer="$_libs_mplayer $_ld_x264"
6528 else
6529 _lavc_x264=no
6530 _def_lavc_x264='#undef CONFIG_X264'
6532 else
6533 _x264=no
6534 _lavc_x264=no
6535 _def_x264='#undef HAVE_X264'
6536 _def_lavc_x264='#undef CONFIG_X264'
6537 _nocodecmodules="x264 $_nocodecmodules"
6539 echores "$_x264 (in libavcodec: $_lavc_x264)"
6542 echocheck "nut"
6543 if test "$_nut" = auto ; then
6544 cat > $TMPC << EOF
6545 #include <stdio.h>
6546 #include <stdlib.h>
6547 #include <inttypes.h>
6548 #include <libnut.h>
6549 int main(void) { (void)nut_error(0); return 0; }
6551 _nut=no
6552 cc_check -lnut && _nut=yes
6555 if test "$_nut" = yes ; then
6556 _def_nut='#define HAVE_LIBNUT 1'
6557 _ld_extra="$_ld_extra -lnut"
6558 else
6559 _def_nut='#undef HAVE_LIBNUT'
6561 echores "$_nut"
6564 # mencoder requires (optional) those libs: libmp3lame
6565 if test "$_mencoder" != no ; then
6567 echocheck "libmp3lame (for mencoder)"
6568 _mp3lame=no
6569 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6570 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6571 cat > $TMPC <<EOF
6572 #include <lame/lame.h>
6573 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; }
6575 # Note: libmp3lame usually depends on vorbis
6576 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6577 if test "$_mp3lame" = yes ; then
6578 _def_mp3lame="#define HAVE_MP3LAME"
6579 _ld_mp3lame=-lmp3lame
6580 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6581 cat > $TMPC << EOF
6582 #include <lame/lame.h>
6583 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6585 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6586 cat > $TMPC << EOF
6587 #include <lame/lame.h>
6588 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6590 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6591 if echo $_libavencoders | grep -q MP3LAME ; then
6592 _lavc_mp3lame=yes
6593 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6594 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6595 else
6596 _lavc_mp3lame=no
6597 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6599 else
6600 _def_mp3lame='#undef HAVE_MP3LAME'
6602 echores "$_mp3lame"
6606 echocheck "mencoder"
6607 _mencoder_flag='#undef HAVE_MENCODER'
6608 if test "$_mencoder" = yes ; then
6609 _mencoder_flag='#define HAVE_MENCODER'
6610 _def_muxers='#define CONFIG_MUXERS 1'
6611 else
6612 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6613 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6614 _libavmuxers=""
6616 echores "$_mencoder"
6618 echocheck "fastmemcpy"
6619 # fastmemcpy check is done earlier with tests of CPU & binutils features
6620 if test "$_fastmemcpy" = yes ; then
6621 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6622 else
6623 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6625 echores "$_fastmemcpy"
6627 echocheck "UniquE RAR File Library"
6628 if test "$_unrarlib" = yes ; then
6629 _def_unrarlib='#define USE_UNRARLIB 1'
6630 else
6631 _def_unrarlib='#undef USE_UNRARLIB'
6633 echores "$_unrarlib"
6635 echocheck "TV interface"
6636 if test "$_tv" = yes ; then
6637 _def_tv='#define USE_TV 1'
6638 _inputmodules="tv $_inputmodules"
6639 else
6640 _noinputmodules="tv $_noinputmodules"
6641 _def_tv='#undef USE_TV'
6643 echores "$_tv"
6646 if bsd; then
6647 echocheck "*BSD BrookTree 848 TV interface"
6648 if test "$_tv_bsdbt848" = auto ; then
6649 _tv_bsdbt848=no
6650 if test "$_tv" = yes ; then
6651 cat > $TMPC <<EOF
6652 #include <sys/types.h>
6653 #if defined(__NetBSD__)
6654 #include <dev/ic/bt8xx.h>
6655 #else
6656 #include <machine/ioctl_bt848.h>
6657 #endif
6658 int main(void) { return 0; }
6660 cc_check && _tv_bsdbt848=yes
6663 if test "$_tv_bsdbt848" = yes ; then
6664 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6665 _inputmodules="tv-bsdbt848 $_inputmodules"
6666 else
6667 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6668 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6670 echores "$_tv_bsdbt848"
6671 fi #if bsd
6674 echocheck "Video 4 Linux TV interface"
6675 if test "$_tv_v4l1" = auto ; then
6676 _tv_v4l1=no
6677 if test "$_tv" = yes && linux ; then
6678 cat > $TMPC <<EOF
6679 #include <stdlib.h>
6680 #include <linux/videodev.h>
6681 int main(void) { return 0; }
6683 cc_check && _tv_v4l1=yes
6686 if test "$_tv_v4l1" = yes ; then
6687 _tv_v4l=yes
6688 _def_tv_v4l='#define HAVE_TV_V4L 1'
6689 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6690 _inputmodules="tv-v4l $_inputmodules"
6691 else
6692 _noinputmodules="tv-v4l1 $_noinputmodules"
6693 _def_tv_v4l='#undef HAVE_TV_V4L'
6695 echores "$_tv_v4l1"
6698 echocheck "Video 4 Linux 2 TV interface"
6699 if test "$_tv_v4l2" = auto ; then
6700 _tv_v4l2=no
6701 if test "$_tv" = yes && linux ; then
6702 cat > $TMPC <<EOF
6703 #include <stdlib.h>
6704 #include <linux/types.h>
6705 #include <linux/videodev2.h>
6706 int main(void) { return 0; }
6708 cc_check && _tv_v4l2=yes
6711 if test "$_tv_v4l2" = yes ; then
6712 _tv_v4l=yes
6713 _def_tv_v4l='#define HAVE_TV_V4L 1'
6714 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6715 _inputmodules="tv-v4l2 $_inputmodules"
6716 else
6717 _noinputmodules="tv-v4l2 $_noinputmodules"
6718 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6720 echores "$_tv_v4l2"
6723 echocheck "Radio interface"
6724 if test "$_radio" = yes ; then
6725 _def_radio='#define USE_RADIO 1'
6726 _inputmodules="radio $_inputmodules"
6727 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6728 _radio_capture=no
6730 if test "$_radio_capture" = yes ; then
6731 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6732 else
6733 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6735 else
6736 _noinputmodules="radio $_noinputmodules"
6737 _def_radio='#undef USE_RADIO'
6738 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6739 _radio_capture=no
6741 echores "$_radio"
6742 echocheck "Capture for Radio interface"
6743 echores "$_radio_capture"
6745 echocheck "Video 4 Linux 2 Radio interface"
6746 if test "$_radio_v4l2" = auto ; then
6747 _radio_v4l2=no
6748 if test "$_radio" = yes && linux ; then
6749 cat > $TMPC <<EOF
6750 #include <stdlib.h>
6751 #include <linux/types.h>
6752 #include <linux/videodev2.h>
6753 int main(void) { return 0; }
6755 cc_check && _radio_v4l2=yes
6758 if test "$_radio_v4l2" = yes ; then
6759 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6760 else
6761 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6763 echores "$_radio_v4l2"
6765 echocheck "Video 4 Linux Radio interface"
6766 if test "$_radio_v4l" = auto ; then
6767 _radio_v4l=no
6768 if test "$_radio" = yes && linux ; then
6769 cat > $TMPC <<EOF
6770 #include <stdlib.h>
6771 #include <linux/videodev.h>
6772 int main(void) { return 0; }
6774 cc_check && _radio_v4l=yes
6777 if test "$_radio_v4l" = yes ; then
6778 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6779 else
6780 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6782 echores "$_radio_v4l"
6784 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6785 echocheck "*BSD BrookTree 848 Radio interface header"
6786 for file in "dev/ic/bt8xx.h" \
6787 "machine/ioctl_bt848.h" \
6788 "dev/bktr/ioctl_bt848.h" \
6789 "dev/video/bktr/ioctl_bt848.h" ; do
6790 cat > $TMPC <<EOF
6791 #include <sys/types.h>
6792 #include <$file>
6793 int main(void) { return 0; }
6795 cc_check && _radio_bsdbt848_hdr=$file
6796 done
6797 echores "$_radio_bsdbt848_hdr"
6798 fi #if bsd && radio && radio_bsdbt848
6800 if test -n "$_radio_bsdbt848_hdr" ; then
6801 _def_radio_bsdbt848="#define RADIO_BSDBT848_HDR <$_radio_bsdbt848_hdr>"
6802 else
6803 _def_radio_bsdbt848='#undef RADIO_BSDBT848_HDR '
6806 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6807 test -z "$_radio_bsdbt848_hdr" && test "$_radio" = yes ; then
6808 die "Radio driver requires BSD BT848, V4L or V4L2!"
6811 echocheck "Video 4 Linux 2 MPEG PVR interface"
6812 if test "$_pvr" = auto ; then
6813 _pvr=no
6814 if test "$_tv_v4l2" = yes && linux ; then
6815 cat > $TMPC <<EOF
6816 #include <stdlib.h>
6817 #include <inttypes.h>
6818 #include <linux/types.h>
6819 #include <linux/videodev2.h>
6820 int main(void) { struct v4l2_ext_controls ext; return 0; }
6822 cc_check && _pvr=yes
6825 if test "$_pvr" = yes ; then
6826 _def_pvr='#define HAVE_PVR 1'
6827 _inputmodules="pvr $_inputmodules"
6828 else
6829 _noinputmodules="pvr $_noinputmodules"
6830 _def_pvr='#undef HAVE_PVR'
6832 echores "$_pvr"
6835 echocheck "audio select()"
6836 if test "$_select" = no ; then
6837 _def_select='#undef HAVE_AUDIO_SELECT'
6838 elif test "$_select" = yes ; then
6839 _def_select='#define HAVE_AUDIO_SELECT 1'
6841 echores "$_select"
6844 echocheck "ftp"
6845 if not beos && test "$_ftp" = yes ; then
6846 _def_ftp='#define HAVE_FTP 1'
6847 _inputmodules="ftp $_inputmodules"
6848 else
6849 _noinputmodules="ftp $_noinputmodules"
6850 _def_ftp='#undef HAVE_FTP'
6852 echores "$_ftp"
6854 echocheck "vstream client"
6855 if test "$_vstream" = auto ; then
6856 _vstream=no
6857 cat > $TMPC <<EOF
6858 #include <vstream-client.h>
6859 void vstream_error(const char *format, ... ) {}
6860 int main(void) { vstream_start(); return 0; }
6862 cc_check -lvstream-client && _vstream=yes
6864 if test "$_vstream" = yes ; then
6865 _def_vstream='#define HAVE_VSTREAM 1'
6866 _inputmodules="vstream $_inputmodules"
6867 _ld_extra="$_ld_extra -lvstream-client"
6868 else
6869 _noinputmodules="vstream $_noinputmodules"
6870 _def_vstream='#undef HAVE_VSTREAM'
6872 echores "$_vstream"
6874 # endian testing
6875 echocheck "byte order"
6876 if test "$_big_endian" = auto ; then
6877 cat > $TMPC <<EOF
6878 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6879 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6880 int main(){
6881 return (int)ascii_name;
6884 if cc_check ; then
6885 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6886 _big_endian=yes
6887 else
6888 _big_endian=no
6890 else
6891 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
6894 if test "$_big_endian" = yes ; then
6895 _byte_order='big-endian'
6896 _def_words_endian='#define WORDS_BIGENDIAN 1'
6897 else
6898 _byte_order='little-endian'
6899 _def_words_endian='#undef WORDS_BIGENDIAN'
6901 echores "$_byte_order"
6903 echocheck "OSD menu"
6904 if test "$_menu" = yes ; then
6905 _def_menu='#define HAVE_MENU 1'
6906 else
6907 _def_menu='#undef HAVE_MENU'
6909 echores "$_menu"
6912 echocheck "QuickTime codecs"
6913 if test "$_qtx" = auto ; then
6914 test "$_win32" = yes || darwin && _qtx=yes
6916 if test "$_qtx" = yes ; then
6917 _def_qtx='#define USE_QTX_CODECS 1'
6918 _codecmodules="qtx $_codecmodules"
6919 else
6920 _def_qtx='#undef USE_QTX_CODECS'
6921 _nocodecmodules="qtx $_nocodecmodules"
6923 echores "$_qtx"
6926 echocheck "Subtitles sorting"
6927 if test "$_sortsub" = yes ; then
6928 _def_sortsub='#define USE_SORTSUB 1'
6929 else
6930 _def_sortsub='#undef USE_SORTSUB'
6932 echores "$_sortsub"
6935 echocheck "XMMS inputplugin support"
6936 if test "$_xmms" = yes ; then
6937 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6938 _xmmsplugindir=`xmms-config --input-plugin-dir`
6939 _xmmslibdir=`xmms-config --exec-prefix`/lib
6940 else
6941 _xmmsplugindir=/usr/lib/xmms/Input
6942 _xmmslibdir=/usr/lib
6945 _def_xmms='#define HAVE_XMMS 1'
6946 if darwin ; then
6947 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
6948 else
6949 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6951 else
6952 _def_xmms='#undef HAVE_XMMS'
6954 echores "$_xmms"
6956 echocheck "inet6"
6957 if test "$_inet6" = auto ; then
6958 cat > $TMPC << EOF
6959 #include <sys/types.h>
6960 #include <sys/socket.h>
6961 #include <netinet/in.h>
6962 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6964 _inet6=no
6965 if cc_check ; then
6966 _inet6=yes
6969 if test "$_inet6" = yes ; then
6970 _def_inet6='#define HAVE_AF_INET6 1'
6971 else
6972 _def_inet6='#undef HAVE_AF_INET6'
6974 echores "$_inet6"
6977 echocheck "gethostbyname2"
6978 if test "$_gethostbyname2" = auto ; then
6979 cat > $TMPC << EOF
6980 #include <sys/types.h>
6981 #include <sys/socket.h>
6982 #include <netdb.h>
6983 int main(void) { gethostbyname2("", AF_INET); }
6985 _gethostbyname2=no
6986 if cc_check ; then
6987 _gethostbyname2=yes
6991 if test "$_gethostbyname2" = yes ; then
6992 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6993 else
6994 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6996 echores "$_gethostbyname2"
6999 # --------------- GUI specific tests begin -------------------
7000 echocheck "GUI"
7001 echo "$_gui"
7002 if test "$_gui" = yes ; then
7004 # Required libraries
7005 test "$_png" != yes && die "The GUI requires PNG support, please install libpng and libpng-dev packages."
7006 if not win32 ; then
7007 test "$_x11" != yes && die "X11 support required for GUI compilation."
7009 echocheck "XShape extension"
7010 if test "$_xshape" = auto ; then
7011 _xshape=no
7012 cat > $TMPC << EOF
7013 #include <X11/Xlib.h>
7014 #include <X11/Xproto.h>
7015 #include <X11/Xutil.h>
7016 #include <X11/extensions/shape.h>
7017 #include <stdlib.h>
7018 int main(void) {
7019 char *name = ":0.0";
7020 Display *wsDisplay;
7021 int exitvar = 0;
7022 int eventbase, errorbase;
7023 if (getenv("DISPLAY"))
7024 name=getenv("DISPLAY");
7025 wsDisplay=XOpenDisplay(name);
7026 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7027 exitvar=1;
7028 XCloseDisplay(wsDisplay);
7029 return exitvar;
7032 cc_check && _xshape=yes
7034 if test "$_xshape" = yes ; then
7035 _def_xshape='#define HAVE_XSHAPE 1'
7036 else
7037 die "The GUI requires the X11 extension XShape (which was not found)."
7039 echores "$_xshape"
7041 #Check for GTK
7042 if test "$_gtk1" = no ; then
7043 #Check for GTK2 :
7044 echocheck "GTK+ version"
7046 if $_pkg_config gtk+-2.0 --exists ; then
7047 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7048 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7049 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7050 echores "$_gtk"
7052 # Check for GLIB2
7053 if $_pkg_config glib-2.0 --exists ; then
7054 echocheck "glib version"
7055 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7056 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7057 echores "$_glib"
7059 _def_gui='#define HAVE_NEW_GUI 1'
7060 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7061 else
7062 _gtk1=yes
7063 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7065 else
7066 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7067 _gtk1=yes
7071 if test "$_gtk1" = yes ; then
7072 # Check for old GTK (1.2.x)
7073 echocheck "GTK version"
7074 if test -z "$_gtkconfig" ; then
7075 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7076 _gtkconfig="gtk-config"
7077 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7078 _gtkconfig="gtk12-config"
7079 else
7080 die "The GUI requires GTK devel packages (which were not found)."
7083 _gtk=`$_gtkconfig --version 2>&1`
7084 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7085 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7086 echores "$_gtk (using $_gtkconfig)"
7088 # Check for GLIB
7089 echocheck "glib version"
7090 if test -z "$_glibconfig" ; then
7091 if ( glib-config --version ) >/dev/null 2>&1 ; then
7092 _glibconfig="glib-config"
7093 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7094 _glibconfig="glib12-config"
7095 else
7096 die "The GUI requires GLIB devel packages (which were not found)"
7099 _glib=`$_glibconfig --version 2>&1`
7100 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7101 echores "$_glib (using $_glibconfig)"
7103 _def_gui='#define HAVE_NEW_GUI 1'
7104 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7107 else #if not win32
7108 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7109 _def_gui='#define HAVE_NEW_GUI 1'
7110 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7111 fi #if not win32
7113 else #if test "$_gui"
7114 _def_gui='#undef HAVE_NEW_GUI'
7115 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7116 fi #if test "$_gui"
7117 # --------------- GUI specific tests end -------------------
7120 if test "$_charset" = "noconv" ; then
7121 _charset=""
7123 if test "$_charset" ; then
7124 _def_charset="#define MSG_CHARSET \"$_charset\""
7125 else
7126 _def_charset="#undef MSG_CHARSET"
7129 if test "$_charset" = "UTF-8" ; then
7130 # hack to disable conversion in the Makefile
7131 _charset=""
7134 if test "$_charset" ; then
7135 echocheck "iconv program"
7136 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7137 if test "$?" -ne 0 ; then
7138 echores "no"
7139 echo "No working iconv program found, use "
7140 echo "--charset=UTF-8 to continue anyway."
7141 echo "If you also have problems with iconv library functions use --charset=noconv."
7142 echo "Messages in the GTK-2 interface will be broken then."
7143 exit 1
7144 else
7145 echores "yes"
7149 #############################################################################
7151 echocheck "automatic gdb attach"
7152 if test "$_crash_debug" = yes ; then
7153 _def_crash_debug='#define CRASH_DEBUG 1'
7154 else
7155 _def_crash_debug='#undef CRASH_DEBUG'
7156 _crash_debug=no
7158 echores "$_crash_debug"
7160 if darwin ; then
7161 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN -shared-libgcc"
7162 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7163 CFLAGS="$CFLAGS -no-cpp-precomp"
7166 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
7167 test "$_altivec" = yes && CFLAGS="$CFLAGS -DCONFIG_DARWIN"
7169 if hpux ; then
7170 # use flag for HPUX missing setenv()
7171 CFLAGS="$CFLAGS -DHPUX"
7173 # Thread support
7174 if linux ; then
7175 CFLAGS="$CFLAGS -D_REENTRANT"
7176 elif bsd ; then
7177 # FIXME bsd needs this so maybe other OS'es
7178 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7180 # 64 bit file offsets?
7181 if test "$_largefiles" = yes || freebsd ; then
7182 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7183 if test "$_dvdread" = yes ; then
7184 # dvdread support requires this (for off64_t)
7185 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7189 echocheck "compiler support for noexecstack"
7190 cat > $TMPC <<EOF
7191 int main(void) { return 0; }
7193 if cc_check -Wl,-z,noexecstack ; then
7194 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7195 echores "yes"
7196 else
7197 echores "no"
7200 if cc_check -Wdeclaration-after-statement ; then
7201 CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7204 echocheck "ftello()"
7205 # if we don't have ftello use the osdep/ compatibility module
7206 cat > $TMPC << EOF
7207 #include <stdio.h>
7208 #include <sys/types.h>
7209 int main (void) { ftello(stdin); return 0; }
7211 _ftello=no
7212 cc_check && _ftello=yes
7213 if test "$_ftello" = yes ; then
7214 _def_ftello='#define HAVE_FTELLO 1'
7215 _need_ftello=no
7216 else
7217 _def_ftello='#undef HAVE_FTELLO'
7218 _need_ftello=yes
7220 echores "$_ftello"
7222 # Determine OS dependent libs
7223 if cygwin ; then
7224 _def_confwin32='#define WIN32'
7225 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
7226 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
7227 CFLAGS="$CFLAGS -D__CYGWIN__"
7230 if win32 ; then
7231 _confwin32='TARGET_WIN32 = yes'
7232 else
7233 _confwin32='TARGET_WIN32 = no'
7236 # Dynamic linking flags
7237 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7238 _ld_dl_dynamic=''
7239 bsd && _ld_dl_dynamic='-rdynamic'
7240 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7241 _ld_dl_dynamic='-rdynamic'
7244 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7245 bsdos && _ld_extra="$_ld_extra -ldvd"
7246 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7248 _def_debug='#undef MP_DEBUG'
7249 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7251 _def_linux='#undef TARGET_LINUX'
7252 linux && _def_linux='#define TARGET_LINUX 1'
7254 # TODO cleanup the VIDIX stuff here
7255 echocheck "VIDIX (internal)"
7256 echores "$_vidix_internal"
7258 echocheck "VIDIX (external)"
7259 if test "$_vidix_external" = auto; then
7260 _vidix_external=no
7261 cat > $TMPC <<EOF
7262 #include <vidix/vidix.h>
7263 int main(void) { return 0; }
7265 cc_check -lvidix && _vidix_external=yes
7267 echores "$_vidix_external"
7269 if test "$_vidix_internal" = yes || test "$_vidix_external" = yes ; then
7270 _vidix=yes
7271 _def_vidix='#define CONFIG_VIDIX 1'
7272 else
7273 _vidix=no
7274 _def_vidix='#undef CONFIG_VIDIX'
7277 if test "$_vidix_internal" = yes ; then
7278 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
7279 elif test "$_vidix_external" = yes ; then
7280 _libs_mplayer="$_libs_mplayer -lvidix"
7281 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
7284 if test "$_vidix" = yes; then
7285 _vosrc="$_vosrc vo_cvidix.c"
7286 _vomodules="cvidix $_vomodules"
7287 else
7288 _novomodules="cvidix $_novomodules"
7290 if test "$_vidix" = yes && win32; then
7291 _vosrc="$_vosrc vo_winvidix.c"
7292 _vomodules="winvidix $_vomodules"
7293 _libs_mplayer="$_libs_mplayer -lgdi32"
7294 else
7295 _novomodules="winvidix $_novomodules"
7297 if test "$_vidix" = yes && test "$_x11" = yes; then
7298 _vosrc="$_vosrc vo_xvidix.c"
7299 _vomodules="xvidix $_vomodules"
7300 else
7301 _novomodules="xvidix $_novomodules"
7304 echocheck "joystick"
7305 _def_joystick='#undef HAVE_JOYSTICK'
7306 if test "$_joystick" = yes ; then
7307 if linux ; then
7308 # TODO add some check
7309 _def_joystick='#define HAVE_JOYSTICK 1'
7310 else
7311 _joystick="no (unsupported under $system_name)"
7314 echores "$_joystick"
7316 echocheck "lirc"
7317 if test "$_lirc" = auto ; then
7318 _lirc=no
7319 cat > $TMPC <<EOF
7320 #include <lirc/lirc_client.h>
7321 int main(void) { return 0; }
7323 cc_check -llirc_client && _lirc=yes
7325 if test "$_lirc" = yes ; then
7326 _def_lirc='#define HAVE_LIRC 1'
7327 _ld_extra="$_ld_extra -llirc_client"
7328 else
7329 _def_lirc='#undef HAVE_LIRC'
7331 echores "$_lirc"
7333 echocheck "lircc"
7334 if test "$_lircc" = auto ; then
7335 _lircc=no
7336 cat > $TMPC <<EOF
7337 #include <lirc/lircc.h>
7338 int main(void) { return 0; }
7340 cc_check -llircc && _lircc=yes
7342 if test "$_lircc" = yes ; then
7343 _def_lircc='#define HAVE_LIRCC 1'
7344 _ld_extra="$_ld_extra -llircc"
7345 else
7346 _def_lircc='#undef HAVE_LIRCC'
7348 echores "$_lircc"
7350 if arm; then
7351 # Detect maemo development platform libraries availability (http://www.maemo.org),
7352 # they are used when run on Nokia 770
7353 echocheck "maemo (Nokia 770)"
7354 if test "$_maemo" = auto ; then
7355 _maemo=no
7356 cat > $TMPC << EOF
7357 #include <libosso.h>
7358 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7360 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7362 if test "$_maemo" = yes ; then
7363 _def_maemo='#define HAVE_MAEMO 1'
7364 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7365 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7366 else
7367 _def_maemo='#undef HAVE_MAEMO'
7369 echores "$_maemo"
7372 echocheck "color console output"
7373 if test "$_color_console" = yes ; then
7374 _def_color_console='#define MSG_USE_COLORS 1'
7375 else
7376 _def_color_console='#undef MSG_USE_COLORS'
7378 echores "$_color_console"
7380 # linker paths should be the same for mencoder and mplayer
7381 _ld_tmp=""
7382 for I in $_libs_mplayer ; do
7383 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7384 if test -z "$_tmp" ; then
7385 _ld_extra="$I $_ld_extra"
7386 else
7387 _ld_tmp="$_ld_tmp $I"
7389 done
7390 _libs_mplayer=$_ld_tmp
7392 #############################################################################
7393 # Take care of ffmpeg dependencies
7394 if test "$_zlib" = no ; then
7395 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// `
7396 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
7398 if test "$_amr_nb" = no && test "$_amr_nb_fixed" = no ; then
7399 _libavdecoders=`echo $_libavdecoders | sed -e s/AMR_NB_DECODER// `
7400 _libavencoders=`echo $_libavencoders | sed -e s/AMR_NB_ENCODER// `
7402 if test "$_amr_wb" = no ; then
7403 _libavdecoders=`echo $_libavdecoders | sed -e s/AMR_WB_DECODER// `
7404 _libavencoders=`echo $_libavencoders | sed -e s/AMR_WB_ENCODER// `
7406 if test "$_libdts" = no ; then
7407 _libavdecoders=`echo $_libavdecoders | sed -e s/DTS_DECODER// `
7409 if test "$_xvmc" = no ; then
7410 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
7412 if test "$_x264" = no || test "$_lavc_x264" = no ; then
7413 _libavencoders=`echo $_libavencoders | sed -e s/X264_ENCODER// `
7415 if test "$_xvid" = no || test "$_lavc_xvid" = no ; then
7416 _libavencoders=`echo $_libavencoders | sed -e s/XVID_ENCODER// `
7418 if test "$_faac" = no || test "$_lavc_faac" = no ; then
7419 _libavencoders=`echo $_libavencoders | sed -e s/FAAC_ENCODER// `
7421 if test "$_mp3lame" = no || test "$_lavc_mp3lame" = no ; then
7422 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
7424 if test "$_libvorbis" = no ; then
7425 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
7426 _libavmuxers=`echo $_libavmuxers | sed -e s/OGG_MUXER// `
7428 if test "$_nut" = no ; then
7429 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
7432 #############################################################################
7433 echo "Creating config.mak"
7434 cat > config.mak << EOF
7435 # -------- Generated by configure -----------
7437 LANG = C
7438 MAN_LANG = $MAN_LANG
7439 TARGET_OS = $system_name
7440 DESTDIR =
7441 prefix = \$(DESTDIR)$_prefix
7442 BINDIR = \$(DESTDIR)$_bindir
7443 DATADIR = \$(DESTDIR)$_datadir
7444 MANDIR = \$(DESTDIR)$_mandir
7445 CONFDIR = \$(DESTDIR)$_confdir
7446 LIBDIR = \$(DESTDIR)$_libdir
7447 # FFmpeg uses libdir instead of LIBDIR
7448 libdir = \$(LIBDIR)
7449 #AR = ar
7450 CC = $_cc
7451 HOST_CC = $_host_cc
7452 AWK = $_awk
7453 RANLIB = $_ranlib
7454 LDCONFIG = $_ldconfig
7455 INSTALL = $_install
7456 EXTRA_INC = $_inc_extra
7457 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7458 INSTALLSTRIP = $_install_strip
7459 CHARSET = $_charset
7460 HELP_FILE = $_mp_help
7462 EXESUF = $_exesuf
7464 MPLAYER_NETWORK = $_network
7465 FTP = $_ftp
7466 STREAMING_LIVE555 = $_live
7467 VSTREAM = $_vstream
7468 STREAM_CACHE = $_stream_cache
7469 DVBIN = $_dvbin
7470 VIDIX = $_vidix_internal
7471 EXTERNAL_VIDIX = $_vidix_external
7472 CONFIG_PP = yes
7473 MP3LAME = $_mp3lame
7474 LIBMENU = $_menu
7476 MP3LIB = $_mp3lib
7477 LIBA52 = $_liba52
7478 LIBMPEG2 = $_libmpeg2
7479 TREMOR_INTERNAL = $_tremor_internal
7480 TREMOR_FLAGS = $_tremor_flags
7481 FAAD = $_faad
7483 SPEEX = $_speex
7484 MUSEPACK = $_musepack
7486 UNRARLIB = $_unrarlib
7487 PNG = $_png
7488 JPEG = $_jpeg
7489 GIF = $_gif
7491 EXTRALIBS = $_extra_libs
7492 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7493 EXTRALIBS_MPLAYER = $_libs_mplayer
7494 EXTRALIBS_MENCODER = $_libs_mencoder
7496 HAVE_MLIB = $_mlib
7497 HAVE_PTHREADS = $_pthreads
7499 HAVE_XVMC_ACCEL = $_xvmc
7501 HAVE_SYS_MMAN_H = $_mman
7503 NEED_FSEEKO = $_need_fseeko
7504 NEED_FTELLO = $_need_ftello
7505 NEED_GETTIMEOFDAY = $_need_gettimeofday
7506 NEED_GLOB = $_need_glob
7507 NEED_SCANDIR = $_need_scandir
7508 NEED_SETENV = $_need_setenv
7509 NEED_STRLCAT = $_need_strlcat
7510 NEED_STRLCPY = $_need_strlcpy
7511 NEED_STRSEP = $_need_strsep
7512 NEED_SWAB = $_need_swab
7513 NEED_VSSCANF = $_need_vsscanf
7515 # for FFmpeg
7516 SRC_PATH=..
7517 BUILD_ROOT=..
7518 LIBPREF=lib
7519 LIBSUF=.a
7520 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7522 # audio output
7523 OSS = $_ossaudio
7524 ALSA = $_alsa
7525 ALSA5 = $_alsa5
7526 ALSA9 = $_alsa9
7527 ALSA1X = $_alsa1x
7529 # input/demuxer/codecs
7530 JOYSTICK = $_joystick
7531 LIRC = $_lirc
7532 TV = $_tv
7533 TV_V4L = $_tv_v4l
7534 TV_V4L1 = $_tv_v4l1
7535 TV_V4L2 = $_tv_v4l2
7536 TV_BSDBT848 = $_tv_bsdbt848
7537 PVR = $_pvr
7538 VCD = $_vcd
7539 DVDREAD = $_dvdread
7540 DVDREAD_INTERNAL = $_dvdread_internal
7541 DVDCSS_INTERNAL = $_libdvdcss_internal
7542 DVDNAV = $_dvdnav
7543 WIN32DLL = $_win32
7544 QTX_CODECS = $_qtx
7545 REAL_CODECS = $_real
7546 XANIM_CODECS = $_xanim
7547 CONFIG_LIBAVUTIL = $_libavutil
7548 CONFIG_LIBAVUTIL_SO = $_libavutil_so
7549 CONFIG_LIBAVCODEC = $_libavcodec
7550 CONFIG_LIBAVCODEC_SO = $_libavcodec_so
7551 CONFIG_LIBAVFORMAT = $_libavformat
7552 CONFIG_LIBAVFORMAT_SO = $_libavformat_so
7553 CONFIG_LIBPOSTPROC = $_libpostproc
7554 CONFIG_LIBPOSTPROC_SO = $_libpostproc_so
7555 ZORAN = $_zr
7556 LIBLZO = $_liblzo
7557 LIBDV = $_libdv
7558 XVID4 = $_xvid
7559 X264 = $_x264
7560 LIBNUT = $_nut
7561 CONFIG_LIBDTS = $_libdts
7562 MPLAYER = $_mplayer
7563 MENCODER = $_mencoder
7564 CDDA = $_cdda
7565 CDDB = $_cddb
7566 BITMAP_FONT = $_bitmap_font
7567 FREETYPE = $_freetype
7568 CONFIG_ASS = $_ass
7569 LIBMAD = $_mad
7570 LIBVORBIS = $_vorbis
7571 LIBTHEORA = $_theora
7572 FAAD_INTERNAL = $_faad_internal
7573 FAAD_FIXED = $_faad_fixed
7574 LIBSMBCLIENT = $_smbsupport
7575 XMMS_PLUGINS = $_xmms
7576 MACOSX = $_macosx
7577 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7578 MACOSX_BUNDLE = $_macosx_bundle
7579 MACOSX_COREVIDEO = $_macosx_corevideo
7580 TOOLAME=$_toolame
7581 TWOLAME=$_twolame
7582 FAAC=$_faac
7583 CONFIG_AMR=$_amr
7584 CONFIG_AMR_NB=$_amr_nb
7585 CONFIG_AMR_NB_FIXED=$_amr_nb_fixed
7586 CONFIG_AMR_WB=$_amr_wb
7587 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7588 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7589 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7590 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7591 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7592 CONFIG_LIBFAAC=$_lavc_faac
7593 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7594 CONFIG_XVID=$_lavc_xvid
7595 CONFIG_X264=$_lavc_x264
7596 CONFIG_ZLIB=$_zlib
7597 CONFIG_GPL=yes
7598 CONFIG_ENCODERS=$_mencoder
7599 CONFIG_MUXERS=$_mencoder
7600 RADIO=$_radio
7601 RADIO_CAPTURE=$_radio_capture
7603 # --- Some stuff for autoconfigure ----
7604 $_target_arch
7605 $_target_arch_x86
7606 $_confwin32
7607 TARGET_CPU=$iproc
7608 TARGET_MMX = $_mmx
7609 TARGET_MMX2 = $_mmxext
7610 TARGET_3DNOW = $_3dnow
7611 TARGET_3DNOWEX = $_3dnowext
7612 TARGET_SSE = $_sse
7613 TARGET_CMOV = $_cmov
7614 TARGET_ALTIVEC = $_altivec
7615 TARGET_ARMV5TE = $_armv5te
7616 TARGET_IWMMXT = $_iwmmxt
7617 TARGET_VIS = $_vis
7618 TARGET_BUILTIN_VECTOR = $_builtin_vector
7619 TARGET_BUILTIN_3DNOW = $_mm3dnow
7621 # --- GUI stuff ---
7622 GUI = $_gui
7624 # --- libvo stuff ---
7625 VO_SRCS = $_vosrc
7627 # --- libao2 stuff ---
7628 AO_SRCS = $_aosrc
7630 # --- libaf stuff ---
7631 AF_SRCS = $_afsrc
7635 #############################################################################
7637 ff_config_enable () {
7638 for part in $1; do
7639 if ` echo $2 | grep $part > /dev/null `; then
7640 echo "#define CONFIG_$part 1"
7641 echo "#define ENABLE_$part 1"
7642 else
7643 echo "#define ENABLE_$part 0"
7645 done
7648 echo "Creating config.h"
7649 cat > config.h << EOF
7650 /* -------- This file has been automatically generated by configure ---------
7651 Note: Any changes in it will be lost when you run configure again. */
7653 /* Protect against multiple inclusion */
7654 #ifndef MPLAYER_CONFIG_H
7655 #define MPLAYER_CONFIG_H 1
7657 #define CONFIGURATION "$_configuration"
7659 /* make sure we never get lavformat's poll() emulation, the results are
7660 horrible if the X libs try to actually use it, see MPlayer-users
7661 Message-ID: <45D49541.8060101@infernix.net>
7662 Date: Thu, 15 Feb 2007 18:15:45 +0100
7663 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7665 #define HAVE_SYS_POLL_H 1
7667 /* use GNU internationalization */
7668 $_def_i18n
7670 /* name of messages charset */
7671 $_def_charset
7673 /* Runtime CPU detection */
7674 $_def_runtime_cpudetection
7676 /* Dynamic a/v plugins */
7677 $_def_dynamic_plugins
7679 /* "restrict" keyword */
7680 $_def_restrict_keyword
7682 /* __builtin_expect branch prediction hint */
7683 $_def_builtin_expect
7684 #ifdef HAVE_BUILTIN_EXPECT
7685 #define likely(x) __builtin_expect ((x) != 0, 1)
7686 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7687 #else
7688 #define likely(x) (x)
7689 #define unlikely(x) (x)
7690 #endif
7692 /* attribute(used) as needed by some compilers */
7693 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7694 # define attribute_used __attribute__((used))
7695 #else
7696 # define attribute_used
7697 #endif
7699 /* compiler support for named assembler arguments */
7700 $_def_named_asm_args
7702 #define PREFIX "$_prefix"
7704 /* enable/disable SIGHANDLER */
7705 $_def_sighandler
7707 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7708 $_def_crash_debug
7710 /* Toggles debugging informations */
7711 $_def_debug
7713 /* Toggles color console output */
7714 $_def_color_console
7716 /* Indicates that libcdio is available for VCD and CD-DA playback */
7717 $_def_libcdio
7719 /* Indicates that Ogle's libdvdread is available for DVD playback */
7720 $_def_dvdread
7722 /* Indicates that dvdread is internal */
7723 $_def_dvdread_internal
7725 /* Additional options for libdvdread/libdvdcss */
7726 $_def_dvd
7727 $_def_cdrom
7728 $_def_cdio
7729 $_def_dvdio
7730 $_def_bsdi_dvd
7731 $_def_dvd_bsd
7732 $_def_dvd_linux
7733 $_dev_dvd_openbsd
7734 $_def_dvd_darwin
7735 $_def_sol_scsi_h
7736 $_def_hpux_scsi_h
7737 $_def_stddef
7739 /* Common data directory (for fonts, etc) */
7740 #define MPLAYER_DATADIR "$_datadir"
7741 #define MPLAYER_CONFDIR "$_confdir"
7742 #define MPLAYER_LIBDIR "$_libdir"
7744 /* Define this to compile stream-caching support, it can be enabled via
7745 -cache <kilobytes> */
7746 $_def_stream_cache
7748 /* Define if you are using XviD library */
7749 $_def_xvid
7751 /* Define if you are using the X.264 library */
7752 $_def_x264
7754 /* Define if you are using libnut */
7755 $_def_nut
7757 /* Define to include support for libdv-0.9.5 */
7758 $_def_libdv
7760 /* If build mencoder */
7761 $_mencoder_flag
7763 /* Indicates if libmp3lame is available
7764 Note: for mencoder */
7765 $_def_mp3lame
7766 $_def_mp3lame_preset
7767 $_def_mp3lame_preset_medium
7769 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7770 (use -bps or -nobps commandline option for run-time method selection)
7771 -bps gives better sync for vbr mp3 audio, it is now default */
7772 #define AVI_SYNC_BPS 1
7774 /* Undefine this if you do not want to select mono audio (left or right)
7775 with a stereo MPEG layer 2/3 audio stream. The command line option
7776 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7777 right-only), with 0 being the default.
7779 #define USE_FAKE_MONO 1
7781 /* Undefine this if your sound card driver has no working select().
7782 If you have kernel Oops, player hangups, or just no audio, you should
7783 try to recompile MPlayer with this option disabled! */
7784 $_def_select
7786 /* define this to use iconv(3) function to codepage conversions */
7787 $_def_iconv
7789 /* define this to use nl_langinfo function */
7790 $_def_langinfo
7792 /* define this to use RTC (/dev/rtc) for video timers */
7793 $_def_rtc
7795 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7796 #define MAX_OUTBURST 65536
7798 /* set up audio OUTBURST. Do not change this! */
7799 #define OUTBURST 512
7801 /* Define this if your system has the header file for the OSS sound interface */
7802 $_def_sys_soundcard
7804 /* Define this if your system has the header file for the OSS sound interface
7805 * in /usr/include */
7806 $_def_soundcard
7808 /* Define this if your system has the sysinfo header */
7809 $_def_sys_sysinfo
7811 /* Define this if your system has ftello() */
7813 $_def_ftello
7814 #ifndef HAVE_FTELLO
7815 /* Need these for FILE and off_t an config.h is usually before other includes*/
7816 #include <stdio.h>
7817 #include <sys/types.h>
7818 off_t ftello(FILE *);
7819 #endif
7821 /* Define this if your system has the "malloc.h" header file */
7822 $_def_malloc
7824 /* memalign is mapped to malloc if unsupported */
7825 $_def_memalign
7826 $_def_map_memalign
7827 $_def_memalign_hack
7829 /* assembler handling of .align */
7830 $_def_asmalign_pot
7832 /* Define this if your system has the "alloca.h" header file */
7833 $_def_alloca
7835 /* Define this if your system has the "sys/mman.h" header file */
7836 $_def_mman
7837 $_def_mman_has_map_failed
7839 /* Define this if you have the elf dynamic linker -ldl library */
7840 $_def_dl
7842 /* Define this if you have the kstat kernel statistics library */
7843 $_def_kstat
7845 /* Define this if you have zlib */
7846 $_def_zlib
7847 #ifdef HAVE_ZLIB
7848 #define CONFIG_ZLIB 1
7849 #endif
7851 /* Define this if you have shm support */
7852 $_def_shm
7854 /* Define this if your system has scandir & alphasort */
7855 $_def_scandir
7857 /* Define this if your system has strsep */
7858 $_def_strsep
7860 /* Define this if your system has strlcpy */
7861 $_def_strlcpy
7862 #ifndef HAVE_STRLCPY
7863 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7864 #endif
7866 /* Define this if your system has strlcat */
7867 $_def_strlcat
7868 #ifndef HAVE_STRLCAT
7869 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7870 #endif
7872 /* Define this if your system has fseeko */
7873 $_def_fseeko
7874 #ifndef HAVE_FSEEKO
7875 /* Need these for FILE and off_t an config.h is usually before other includes*/
7876 #include <stdio.h>
7877 #include <sys/types.h>
7878 int fseeko(FILE *, off_t, int);
7879 #endif
7881 $_def_localtime_r
7883 /* Define this if your system has vsscanf */
7884 $_def_vsscanf
7886 /* Define this if your system has swab */
7887 $_def_swab
7889 /* Define this if your system has no posix select */
7890 $_def_no_posix_select
7892 /* Define this if your system has gettimeofday */
7893 $_def_gettimeofday
7895 /* Define this if your system has glob */
7896 $_def_glob
7898 /* Define this if your system has setenv */
7899 $_def_setenv
7900 #ifndef HAVE_SETENV
7901 int setenv(const char *name, const char *val, int overwrite);
7902 #endif
7904 /* Define this if your system has sysi86 */
7905 $_def_sysi86
7907 /* Define this if your system has pthreads */
7908 $_def_pthreads
7910 /* Define this if you enabled thread support for libavcodec */
7911 $_def_threads
7913 /* LIRC (remote control, see www.lirc.org) support: */
7914 $_def_lirc
7916 /* Support for maemo (http://www.maemo.org) */
7917 $_def_maemo
7920 * LIRCCD (LIRC client daemon)
7921 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7923 $_def_lircc
7925 /* DVD navigation support using libdvdnav */
7926 $_def_dvdnav
7927 $_def_dvdnav_version
7929 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7930 #define MPEG12_POSTPROC 1
7932 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7933 $_def_libpostproc
7934 $_def_libpostproc_so
7936 /* Win32 DLL support */
7937 $_def_win32
7938 #define WIN32_PATH "$_win32codecsdir"
7940 /* Mac OS X specific features */
7941 $_def_macosx
7942 $_def_macosx_finder_support
7943 $_def_macosx_bundle
7944 $_def_macosx_corevideo
7946 /* Build our Win32-loader */
7947 $_def_win32_loader
7949 /* ffmpeg's libavcodec support (requires libavcodec source) */
7950 $_def_libavcodec
7951 $_def_libavcodec_so
7952 $_def_lavc_dsputil
7953 $_def_libavcodec_mpegaudio_hp
7955 /* ffmpeg's libavformat support (requires libavformat source) */
7956 $_def_libavformat
7957 $_def_libavformat_so
7958 $_def_libavformat_win32
7960 $_def_libavutil
7961 $_def_libavutil_so
7963 /* Use libavcodec's decoders */
7964 #define CONFIG_DECODERS 1
7965 /* Use libavcodec's encoders */
7966 #define CONFIG_ENCODERS 1
7968 /* Use libavformat's demuxers */
7969 #define CONFIG_DEMUXERS 1
7970 /* Use libavformat's muxers */
7971 $_def_muxers
7973 #define CONFIG_GPL 1
7975 /* Use amr codecs from libavcodec (requires amr sources) */
7976 $_def_amr
7977 $_def_amr_nb
7978 $_def_amr_nb_fixed
7979 $_def_amr_wb
7981 /* Use specific parts from FFmpeg. */
7982 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
7983 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
7984 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
7985 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
7986 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
7988 $_def_lavc_faac
7989 $_def_lavc_xvid
7990 $_def_lavc_mp3lame
7991 $_def_lavc_x264
7993 /* Use codec libs included in mplayer CVS / source dist: */
7994 $_def_mp3lib
7995 $_def_liba52
7996 $_def_libdts
7997 $_def_libmpeg2
7999 /* XAnim DLL support */
8000 $_def_xanim
8001 /* Default search path */
8002 $_def_xanim_path
8004 /* RealPlayer DLL support */
8005 $_def_real
8006 /* Default search path */
8007 $_def_real_path
8009 /* LIVE555 Streaming Media library support */
8010 $_def_live
8012 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8013 $_def_fastmemcpy
8015 /* Use unrarlib for Vobsubs */
8016 $_def_unrarlib
8018 /* gui support, please do not edit this option */
8019 $_def_gui
8020 $_def_gtk2_gui
8022 /* Audio output drivers */
8023 $_def_ossaudio
8024 $_def_ossaudio_devdsp
8025 $_def_ossaudio_devmixer
8026 $_def_alsa5
8027 $_def_alsa9
8028 $_def_alsa1x
8029 $_def_arts
8030 $_def_esd
8031 $_def_esd_latency
8032 $_def_polyp
8033 $_def_jack
8034 $_def_openal
8035 $_def_openal_h
8036 $_def_sys_asoundlib_h
8037 $_def_alsa_asoundlib_h
8038 $_def_sunaudio
8039 $_def_sgiaudio
8040 $_def_win32waveout
8041 $_def_nas
8043 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8044 #undef FAST_OSD
8045 #undef FAST_OSD_TABLE
8047 /* Enable TV Interface support */
8048 $_def_tv
8050 /* Enable Video 4 Linux TV interface support */
8051 $_def_tv_v4l
8053 /* Enable Video 4 Linux 1 TV interface support */
8054 $_def_tv_v4l1
8056 /* Enable Video 4 Linux 2 TV interface support */
8057 $_def_tv_v4l2
8059 /* Enable *BSD BrookTree TV interface support */
8060 $_def_tv_bsdbt848
8062 /* Enable Radio Interface support */
8063 $_def_radio
8065 /* Enable Capture for Radio Interface support */
8066 $_def_radio_capture
8068 /* Enable Video 4 Linux Radio interface support */
8069 $_def_radio_v4l
8071 /* Enable Video 4 Linux 2 Radio interface support */
8072 $_def_radio_v4l2
8074 /* Enable *BSD BrookTree Radio interface support */
8075 $_def_radio_bsdbt848
8077 /* Enable Video 4 Linux 2 MPEG PVR support */
8078 $_def_pvr
8080 /* Define if your processor stores words with the most significant
8081 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8082 $_def_words_endian
8084 $_def_arch
8085 $_def_arch_x86
8087 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8088 have the instruction. */
8089 $_def_dcbzl
8091 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
8092 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
8094 #ifdef ARCH_POWERPC
8095 #define ARCH_PPC 1
8096 #endif
8098 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
8099 #ifdef ARCH_ARMV4L
8100 #define ARCH_ARM 1
8101 #endif
8103 /* only gcc3 can compile mvi instructions */
8104 $_def_gcc_mvi_support
8106 /* Define this for Cygwin build for win32 */
8107 $_def_confwin32
8109 /* Define this to any prefered value from 386 up to infinity with step 100 */
8110 #define __CPU__ $iproc
8112 $_mp_wordsize
8114 $_def_linux
8116 $_def_vcd
8118 #ifdef sun
8119 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8120 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8121 #elif defined(HPUX)
8122 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8123 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8124 #elif defined(WIN32)
8125 #define DEFAULT_CDROM_DEVICE "D:"
8126 #define DEFAULT_DVD_DEVICE "D:"
8127 #elif defined(SYS_DARWIN)
8128 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8129 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8130 #elif defined(__OpenBSD__)
8131 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8132 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8133 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8134 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8135 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8136 #else
8137 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8138 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8139 #endif
8142 /*----------------------------------------------------------------------------
8144 ** NOTE: Instead of modifying these definitions here, use the
8145 ** --enable/--disable options of the ./configure script!
8146 ** See ./configure --help for details.
8148 *---------------------------------------------------------------------------*/
8150 /* C99 lrintf function available */
8151 $_def_lrintf
8153 /* round function is available */
8154 $_def_round
8156 /* yes, we have inttypes.h */
8157 #define HAVE_INTTYPES_H 1
8159 /* int_fastXY_t emulation */
8160 $_def_fast_inttypes
8162 /* nanosleep support */
8163 $_def_nanosleep
8165 /* SMB support */
8166 $_def_smbsupport
8168 /* termcap flag for getch2.c */
8169 $_def_termcap
8171 /* termios flag for getch2.c */
8172 $_def_termios
8173 $_def_termios_h
8174 $_def_termios_sys_h
8176 /* enable PNG support */
8177 $_def_png
8179 /* enable JPEG support */
8180 $_def_jpeg
8182 /* enable PNM support */
8183 $_def_pnm
8185 /* enable md5sum support */
8186 $_def_md5sum
8188 /* enable GIF support */
8189 $_def_gif
8190 $_def_gif_4
8191 $_def_gif_tvt_hack
8193 /* enable bitmap font support */
8194 $_def_bitmap_font
8196 /* enable FreeType support */
8197 $_def_freetype
8199 /* enable Fontconfig support */
8200 $_def_fontconfig
8202 /* enable SSA/ASS support */
8203 $_def_ass
8205 /* enable FriBiDi usage */
8206 $_def_fribidi
8208 /* enable ENCA usage */
8209 $_def_enca
8211 /* liblzo support */
8212 $_def_liblzo
8213 #ifdef USE_LIBLZO
8214 #define CONFIG_LZO 1
8215 #endif
8217 /* libmad support */
8218 $_def_mad
8220 /* enable OggVorbis support */
8221 $_def_vorbis
8222 $_def_tremor
8224 /* enable Speex support */
8225 $_def_speex
8227 /* enable musepack support */
8228 $_def_musepack
8230 /* enable OggTheora support */
8231 $_def_theora
8233 /* enable FAAD (AAC) support */
8234 $_def_faad
8235 $_def_faad_internal
8237 /* enable FAAC (AAC encoder) support */
8238 $_def_faac
8240 /* enable LADSPA plugin support */
8241 $_def_ladspa
8243 /* enable network */
8244 $_def_network
8246 /* enable ftp support */
8247 $_def_ftp
8249 /* enable vstream support */
8250 $_def_vstream
8252 /* enable winsock2 instead of Unix functions*/
8253 $_def_winsock2
8255 /* define this to use inet_aton() instead of inet_pton() */
8256 $_def_use_aton
8258 /* enables / disables cdparanoia support */
8259 $_def_cdparanoia
8260 $_def_cddb
8262 /* enables / disables VIDIX usage */
8263 $_def_vidix
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 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
8290 $_def_3dnowext // only define if you have 3DNOWEXT (AMD Athlon, etc.)
8291 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
8292 $_def_mmxext // only define if you have MMX2 (Athlon/PIII/4/CelII)
8293 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
8294 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
8295 $_def_cmov // only define if you have CMOV (i686+, without VIA C3)
8296 $_def_altivec // only define if you have Altivec (G4)
8297 $_def_armv5te // only define if you have Enhanced DSP Extensions (ARM)
8298 $_def_iwmmxt // only define if you have XScale IWMMX (ARM)
8300 $_def_altivec_h // enables usage of altivec.h
8302 $_def_mlib // Sun mediaLib, available only on solaris
8303 $_def_vis // only define if you have VIS ( ultrasparc )
8305 /* libmpeg2 uses a different feature test macro for mediaLib */
8306 #ifdef HAVE_MLIB
8307 #define LIBMPEG2_MLIB 1
8308 #endif
8310 /* libvo options */
8311 #define SCREEN_SIZE_X 1
8312 #define SCREEN_SIZE_Y 1
8313 $_def_x11
8314 $_def_xv
8315 $_def_xvmc
8316 $_def_vm
8317 $_def_xf86keysym
8318 $_def_xinerama
8319 $_def_gl
8320 $_def_gl_win32
8321 $_def_dga
8322 $_def_dga2
8323 $_def_sdl
8324 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8325 $_def_sdlbuggy
8326 $_def_directx
8327 $_def_ggi
8328 $_def_ggiwmh
8329 $_def_3dfx
8330 $_def_s3fb
8331 $_def_tdfxfb
8332 $_def_tdfxvid
8333 $_def_directfb
8334 $_def_directfb_version
8335 $_def_dfbmga
8336 $_def_zr
8337 $_def_bl
8338 $_def_mga
8339 $_def_xmga
8340 $_def_syncfb
8341 $_def_fbdev
8342 $_def_dxr2
8343 $_def_dxr3
8344 $_def_ivtv
8345 $_def_dvb
8346 $_def_dvb_in
8347 $_def_svga
8348 $_def_vesa
8349 $_def_xdpms
8350 $_def_aa
8351 $_def_caca
8352 $_def_tga
8353 $_def_toolame
8354 $_def_twolame
8356 /* used by GUI: */
8357 $_def_xshape
8359 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8360 #define X11_FULLSCREEN 1
8361 #endif
8363 #endif /* MPLAYER_CONFIG_H */
8366 #############################################################################
8368 cat << EOF
8370 Config files successfully generated by ./configure !
8372 Install prefix: $_prefix
8373 Data directory: $_datadir
8374 Config direct.: $_confdir
8376 Byte order: $_byte_order
8377 Optimizing for: $_optimizing
8379 Languages:
8380 Messages/GUI: $_language
8383 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8384 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8385 echo
8387 cat << EOF
8389 Enabled optional drivers:
8390 Input: $_inputmodules
8391 Codecs: $_codecmodules
8392 Audio output: $_aomodules
8393 Video output: $_vomodules
8394 Audio filters: $_afmodules
8395 Disabled optional drivers:
8396 Input: $_noinputmodules
8397 Codecs: $_nocodecmodules
8398 Audio output: $_noaomodules
8399 Video output: $_novomodules
8400 Audio filters: $_noafmodules
8402 'config.h' and 'config.mak' contain your configuration options.
8403 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8404 compile *** DO NOT REPORT BUGS if you tweak these files ***
8406 'make' will now compile MPlayer and 'make install' will install it.
8407 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8412 if test "$_mtrr" = yes ; then
8413 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8414 echo
8417 if not x86_32; then
8418 cat <<EOF
8419 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8420 operating system ($system_name). You may encounter a few files that cannot
8421 be played due to missing open source video/audio codec support.
8427 cat <<EOF
8428 Check $TMPLOG if you wonder why an autodetection failed (make sure
8429 development headers/packages are installed).
8431 NOTE: The --enable-* parameters unconditionally force options on, completely
8432 skipping autodetection. This behavior is unlike what you may be used to from
8433 autoconf-based configure scripts that can decide to override you. This greater
8434 level of control comes at a price. You may have to provide the correct compiler
8435 and linker flags yourself.
8436 If you used one of these options (except --enable-gui and similar ones that
8437 turn on internal features) and experience a compilation or linking failure,
8438 make sure you have passed the necessary compiler/linker flags to configure.
8440 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8444 if test "$_warn_CFLAGS" = yes; then
8445 cat <<EOF
8447 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8449 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8451 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8452 To do so, execute 'CFLAGS= ./configure <options>'
8457 # Last move:
8458 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"