Remove some useless code
[mplayer/glamo.git] / configure
blobfd32e03539b328105cb02b00d04e853585b2036e
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: check the cvs log !
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, here is a simple skeleton:
24 # echocheck "$feature"
25 # if "$_feature" = auto; then
26 # cat > $TMPC << EOF
27 # #include <feature.h>
28 # int main(void) { return 0; }
29 # EOF
30 # _feature=no
31 # cc_check && _feature=yes
32 # if test "$_feature" = yes ; then
33 # _def_feature='#define HAVE_FEATURE 1'
34 # else
35 # _def_feature='#undef HAVE_FEATURE'
36 # fi
37 # echores "$_feature"
39 # Furthermore you need to add the variable _feature to the list of default
40 # settings and set it to one of yes/no/auto. Also add appropriate
41 # --enable-feature/--disable-feature command line options.
42 # The results of the check should be written to config.h and config.mak
43 # at the end of this script. The variable names used for this should be
44 # uniform, i.e. if the option is named 'feature':
46 # _feature : should have a value of yes/no/auto
47 # _def_feature : '#define ... 1' or '#undef ...' for conditional compilation
48 # _ld_feature : '-L/path/dir -lfeature' GCC options
50 #############################################################################
52 # Prevent locale nonsense from breaking basic text processing utils
53 LC_ALL=C
54 export LC_ALL
56 # Store the configure line that was used
57 _configuration="$*"
59 # Prefer these macros to full length text !
60 # These macros only return an error code - NO display is done
61 compile_check() {
62 echo >> "$TMPLOG"
63 cat "$1" >> "$TMPLOG"
64 echo >> "$TMPLOG"
65 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o $TMPO $@" >> "$TMPLOG"
66 rm -f "$TMPO"
67 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPO" "$@" >> "$TMPLOG" 2>&1
68 TMP="$?"
69 echo >> "$TMPLOG"
70 echo >> "$TMPLOG"
71 return "$TMP"
74 cc_check() {
75 compile_check $TMPC $@
78 cxx_check() {
79 compile_check $TMPCPP $@ -lstdc++
82 tmp_run() {
83 "$TMPO" >> "$TMPLOG" 2>&1
86 # Display error message, flushes tempfile, exit
87 die () {
88 echo
89 echo "Error: $@" >&2
90 echo >&2
91 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
92 echo "Check \"$TMPLOG\" if you do not understand why it failed."
93 exit 1
96 # OS test booleans functions
97 issystem() {
98 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
100 linux() { issystem "Linux" || issystem "uClinux" ; return "$?" ; }
101 sunos() { issystem "SunOS" ; return "$?" ; }
102 hpux() { issystem "HP-UX" ; return "$?" ; }
103 irix() { issystem "IRIX" ; return "$?" ; }
104 aix() { issystem "AIX" ; return "$?" ; }
105 cygwin() { issystem "CYGWIN" ; return "$?" ; }
106 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; }
107 netbsd() { issystem "NetBSD" ; return "$?" ; }
108 bsdos() { issystem "BSD/OS" ; return "$?" ; }
109 openbsd() { issystem "OpenBSD" ; return "$?" ; }
110 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
111 qnx() { issystem "QNX" ; return "$?" ; }
112 darwin() { issystem "Darwin" ; return "$?" ; }
113 gnu() { issystem "GNU" ; return "$?" ; }
114 mingw32() { issystem "MINGW32" ; return "$?" ; }
115 morphos() { issystem "MorphOS" ; return "$?" ; }
116 amigaos() { issystem "AmigaOS" ; return "$?" ; }
117 win32() { cygwin || mingw32 ; return "$?" ; }
118 beos() { issystem "BEOS" ; return "$?" ; }
120 # arch test boolean functions
121 # x86/x86pc is used by QNX
122 x86_32() {
123 case "$host_arch" in
124 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
125 *) return 1 ;;
126 esac
129 x86_64() {
130 case "$host_arch" in
131 x86_64|amd64) return 0 ;;
132 *) return 1 ;;
133 esac
136 x86() {
137 x86_32 || x86_64
140 ppc() {
141 case "$host_arch" in
142 ppc|powerpc) return 0;;
143 *) return 1;;
144 esac
147 alpha() {
148 case "$host_arch" in
149 alpha) return 0;;
150 *) return 1;;
151 esac
154 arm() {
155 case "$host_arch" in
156 arm) return 0;;
157 *) return 1;;
158 esac
161 # not boolean test: implement the posix shell "!" operator for a
162 # non-posix /bin/sh.
163 # usage: not {command}
164 # returns exit status "success" when the execution of "command"
165 # fails.
166 not() {
167 eval "$@"
168 test $? -ne 0
171 # Use this before starting a check
172 echocheck() {
173 echo "============ Checking for $@ ============" >> "$TMPLOG"
174 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
177 # Use this to echo the results of a check
178 echores() {
179 if test "$_res_comment" ; then
180 _res_comment="($_res_comment)"
182 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
183 echo "##########################################" >> "$TMPLOG"
184 echo "" >> "$TMPLOG"
185 echo "$@ $_res_comment"
186 _res_comment=""
188 #############################################################################
190 # Check how echo works in this /bin/sh
191 case `echo -n` in
192 -n) _echo_n= _echo_c='\c' ;; # SysV echo
193 *) _echo_n='-n ' _echo_c= ;; # BSD echo
194 esac
196 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"`
198 show_help(){
199 cat << EOF
200 Usage: $0 [OPTIONS]...
202 Configuration:
203 -h, --help display this help and exit
205 Installation directories:
206 --prefix=DIR prefix directory for installation [/usr/local]
207 --bindir=DIR directory for installing binaries [PREFIX/bin]
208 --datadir=DIR directory for installing machine independent
209 data files (skins, etc) [PREFIX/share/mplayer]
210 --mandir=DIR directory for installing man pages [PREFIX/man]
211 --confdir=DIR directory for installing configuration files
212 [PREFIX/etc/mplayer]
213 --libdir=DIR directory for object code libraries [PREFIX/lib]
214 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
215 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
216 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
217 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
219 Optional features:
220 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
221 --disable-mplayer disable MPlayer compilation [enable]
222 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
223 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
224 --enable-largefiles enable support for files > 2GB [disable]
225 --enable-linux-devfs set default devices to devfs [disable]
226 --enable-termcap use termcap database for key codes [autodetect]
227 --enable-termios use termios database for key codes [autodetect]
228 --disable-iconv disable iconv for encoding conversion [autodetect]
229 --disable-langinfo do not use langinfo [autodetect]
230 --enable-lirc enable LIRC (remote control) support [autodetect]
231 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
232 --enable-joystick enable joystick support [disable]
233 --disable-vm disable X video mode extensions [autodetect]
234 --disable-xf86keysym disable support for multimedia keys [autodetect]
235 --enable-radio enable radio interface [disable]
236 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
237 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
238 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
239 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
240 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
241 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
242 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
243 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
244 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
245 --disable-network disable networking [enable]
246 --enable-winsock2 enable winsock2 [autodetect]
247 --enable-smb enable Samba (SMB) input [autodetect]
248 --enable-live enable LIVE555 Streaming Media [autodetect]
249 --disable-dvdnav disable libdvdnav [autodetect]
250 --disable-dvdread disable libdvdread [autodetect]
251 --disable-dvdread-internal disable internal libdvdread [autodetect]
252 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
253 --disable-cdparanoia disable cdparanoia [autodetect]
254 --disable-cddb disable cddb [autodetect]
255 --disable-bitmap-font disable bitmap font support [enable]
256 --disable-freetype disable FreeType 2 font rendering [autodetect]
257 --disable-fontconfig disable fontconfig font lookup [autodetect]
258 --disable-unrarlib disable Unique RAR File Library [enabled]
259 --enable-menu enable OSD menu (not DVD menu) [disabled]
260 --disable-sortsub disable subtitle sorting [enabled]
261 --enable-fribidi enable the FriBiDi libs [autodetect]
262 --disable-enca disable ENCA charset oracle library [autodetect]
263 --disable-macosx disable Mac OS X specific features [autodetect]
264 --disable-maemo disable maemo specific features [autodetect]
265 --enable-macosx-finder-support enable Mac OS X Finder invocation
266 parameter parsing [disabled]
267 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
268 --disable-inet6 disable IPv6 support [autodetect]
269 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
270 --disable-ftp disable FTP support [enabled]
271 --disable-vstream disable TiVo vstream client support [autodetect]
272 --disable-pthreads disable Posix threads support [autodetect]
273 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
274 --enable-rpath enable runtime linker path for extra libs [disabled]
276 Codecs:
277 --enable-gif enable GIF support [autodetect]
278 --enable-png enable PNG input/output support [autodetect]
279 --enable-jpeg enable JPEG input/output support [autodetect]
280 --enable-libcdio enable external libcdio [autodetect]
281 --enable-liblzo enable external liblzo [autodetect]
282 --disable-win32dll disable Win32 DLL support [enabled]
283 --disable-qtx disable QuickTime codecs support [enabled]
284 --disable-xanim disable XAnim codecs support [enabled]
285 --disable-real disable RealPlayer codecs support [enabled]
286 --disable-xvid disable XviD [autodetect]
287 --disable-x264 disable x264 [autodetect]
288 --disable-nut disable libnut [autodetect]
289 --disable-libavutil_a disable static libavutil [autodetect]
290 --disable-libavcodec_a disable static libavcodec [autodetect]
291 --disable-libavformat_a disable static libavformat [autodetect]
292 --disable-libpostproc_a disable static libpostproc [autodetect]
293 --disable-libavutil_so disable shared libavutil [autodetect]
294 --disable-libavcodec_so disable shared libavcodec [autodetect]
295 --disable-libavformat_so disable shared libavformat [autodetect]
296 --disable-libpostproc_so disable shared libpostproc [autodetect]
297 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
298 in libavcodec [enabled]
299 --disable-tremor-internal disable internal Tremor [enabled]
300 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
301 --enable-tremor-external enable external Tremor [autodetect]
302 --disable-libvorbis disable libvorbis support [autodetect]
303 --disable-speex disable Speex support [autodetect]
304 --enable-theora enable OggTheora libraries [autodetect]
305 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
306 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
307 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
308 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
309 --disable-ladspa disable LADSPA plugin support [autodetect]
310 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
311 --disable-mad disable libmad (MPEG audio) support [autodetect]
312 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
313 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
314 --enable-xmms enable XMMS input plugin support [disabled]
315 --disable-mp3lib disable builtin mp3lib [enabled]
316 --disable-liba52 disable builtin liba52 [enabled]
317 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
318 --disable-musepack disable musepack support [autodetect]
319 --disable-libamr_nb disable libamr narrowband [autodetect]
320 --disable-libamr_wb disable libamr wideband [autodetect]
321 --disable-decoder=DECODER disable specified FFmpeg decoder
322 --enable-decoder=DECODER enable specified FFmpeg decoder
323 --disable-encoder=ENCODER disable specified FFmpeg encoder
324 --enable-encoder=ENCODER enable specified FFmpeg encoder
325 --disable-parser=PARSER disable specified FFmpeg parser
326 --enable-parser=PARSER enable specified FFmpeg parser
327 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
328 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
329 --disable-muxer=MUXER disable specified FFmpeg muxer
330 --enable-muxer=MUXER enable specified FFmpeg muxer
332 Video output:
333 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
334 --disable-vidix-external disable external VIDIX [for x86 *nix]
335 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
336 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
337 nvidia,pm2,pm3,radeon,rage128,savage,sis,unichrome
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-ssse3 enable SSSE3 [autodetect]
413 --enable-shm enable shm [autodetect]
414 --enable-altivec enable AltiVec (PowerPC) [autodetect]
415 --enable-armv5te enable DSP extensions (ARM) [autodetect]
416 --enable-armv6 enable ARMv6 (ARM) [autodetect]
417 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
418 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
419 --enable-big-endian force byte order to big-endian [autodetect]
420 --enable-debug[=1-3] compile-in debugging information [disable]
421 --enable-profile compile-in profiling information [disable]
422 --disable-sighandler disable sighandler for crashes [enable]
423 --enable-crash-debug enable automatic gdb attach on crash [disable]
424 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
426 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
427 --disable-gcc-check disable gcc version checking [enable]
429 Use these options if autodetection fails (Options marked with (*) accept
430 multiple paths separated by ':'):
431 --extra-libs=FLAGS extra linker flags
432 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
433 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
434 --with-extraincdir=DIR extra header search paths in DIR (*)
435 --with-extralibdir=DIR extra linker search paths in DIR (*)
436 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
438 --with-freetype-config=PATH path to freetype-config
439 --with-fribidi-config=PATH path to fribidi-config
440 --with-glib-config=PATH path to glib*-config
441 --with-gtk-config=PATH path to gtk*-config
442 --with-sdl-config=PATH path to sdl*-config
443 --with-dvdnav-config=PATH path to dvdnav-config
445 This configure script is NOT autoconf-based, even though its output is similar.
446 It will try to autodetect all configuration options. If you --enable an option
447 it will be forcefully turned on, skipping autodetection. This can break
448 compilation, so you need to know what you are doing.
450 exit 0
451 } #show_help()
453 # GOTCHA: the variables below defines the default behavior for autodetection
454 # and have - unless stated otherwise - at least 2 states : yes no
455 # If autodetection is available then the third state is: auto
456 _mmx=auto
457 _3dnow=auto
458 _3dnowext=auto
459 _mmxext=auto
460 _sse=auto
461 _sse2=auto
462 _ssse3=auto
463 _cmov=auto
464 _fast_cmov=auto
465 _armv5te=auto
466 _armv6=auto
467 _iwmmxt=auto
468 _mtrr=auto
469 _install=install
470 _ranlib=ranlib
471 _ldconfig=ldconfig
472 _cc=cc
473 test "$CC" && _cc="$CC"
474 _gcc_check=yes
475 _as=auto
476 _runtime_cpudetection=no
477 _cross_compile=auto
478 _prefix="/usr/local"
479 _libavutil_a=auto
480 _libavutil_so=auto
481 _libavcodec_a=auto
482 _libamr_nb=auto
483 _libamr_wb=auto
484 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
485 _libavdecoders=` echo $_libavdecoders_all | sed -e s/LIBFAAD_DECODER// -e s/MPEG4AAC_DECODER// -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// `
486 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
487 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// `
488 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
489 _libavparsers=$_libavparsers_all
490 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
491 _libavbsfs=$_libavbsfs_all
492 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
493 _libavdemuxers=`echo $_libavdemuxers_all | sed -e s/AUDIO_DEMUXER// -e s/DC1394_DEMUXER// -e s/DV1394_DEMUXER// -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/VIDEO_GRAB_V4L_DEMUXER// -e s/VIDEO_GRAB_BKTR_DEMUXER// -e s/X11_GRAB_DEVICE_DEMUXER// -e s/V4L2_DEMUXER// -e s/LIBNUT_DEMUXER// `
494 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
495 _libavmuxers=`echo $_libavmuxers_all | sed -e s/AUDIO_MUXER// -e s/RTP_MUXER// `
496 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
497 _libavcodec_so=auto
498 _libavformat_a=auto
499 _libavformat_so=auto
500 _libpostproc_a=auto
501 _libpostproc_so=auto
502 _libavcodec_mpegaudio_hp=yes
503 _mencoder=yes
504 _mplayer=yes
505 _x11=auto
506 _xshape=auto
507 _dga=auto # 1 2 no auto
508 _xv=auto
509 _xvmc=no #auto when complete
510 _sdl=auto
511 _directx=auto
512 _win32waveout=auto
513 _nas=auto
514 _png=auto
515 _jpeg=auto
516 _pnm=yes
517 _md5sum=yes
518 _gif=auto
519 _gl=auto
520 _ggi=auto
521 _ggiwmh=auto
522 _aa=auto
523 _caca=auto
524 _svga=auto
525 _vesa=auto
526 _fbdev=auto
527 _dvb=auto
528 _dvbhead=auto
529 _dxr2=auto
530 _dxr3=auto
531 _ivtv=auto
532 _iconv=auto
533 _langinfo=auto
534 _rtc=auto
535 _ossaudio=auto
536 _arts=auto
537 _esd=auto
538 _polyp=auto
539 _jack=auto
540 _openal=auto
541 _libcdio=auto
542 _liblzo=auto
543 _mad=auto
544 _toolame=auto
545 _twolame=auto
546 _tremor_internal=yes
547 _tremor_low=no
548 _tremor_external=auto
549 _libvorbis=auto
550 _speex=auto
551 _theora=auto
552 _mp3lib=yes
553 _liba52=yes
554 _libmpeg2=yes
555 _faad_internal=auto
556 _faad_external=auto
557 _faad_fixed=no
558 _faac=auto
559 _ladspa=auto
560 _xmms=no
561 _dvdnav=auto
562 _dvdnavconfig=dvdnav-config
563 _dvdread=auto
564 _dvdread_internal=auto
565 _libdvdcss_internal=auto
566 _xanim=auto
567 _real=auto
568 _live=auto
569 _xinerama=auto
570 _mga=auto
571 _xmga=auto
572 _vm=auto
573 _xf86keysym=auto
574 _mlib=no #broken, thus disabled
575 _sgiaudio=auto
576 _sunaudio=auto
577 _alsa=auto
578 _fastmemcpy=yes
579 _unrarlib=yes
580 _win32dll=auto
581 _select=yes
582 _radio=no
583 _radio_capture=no
584 _radio_v4l=auto
585 _radio_v4l2=auto
586 _radio_bsdbt848=auto
587 _tv=yes
588 _tv_v4l1=auto
589 _tv_v4l2=auto
590 _tv_bsdbt848=auto
591 _pvr=auto
592 _network=yes
593 _winsock2=auto
594 _smbsupport=auto
595 _vidix_internal=auto
596 _vidix_external=auto
597 _joystick=no
598 _xvid=auto
599 _x264=auto
600 _nut=auto
601 _lirc=auto
602 _lircc=auto
603 _gui=no
604 _gtk1=no
605 _termcap=auto
606 _termios=auto
607 _3dfx=no
608 _s3fb=no
609 _tdfxfb=no
610 _tdfxvid=no
611 _tga=yes
612 _directfb=auto
613 _zr=auto
614 _bl=no
615 _largefiles=no
616 #_language=en
617 _shm=auto
618 _linux_devfs=no
619 _charset="UTF-8"
620 _dynamic_plugins=no
621 _crash_debug=no
622 _sighandler=yes
623 _libdv=auto
624 _cdparanoia=auto
625 _cddb=auto
626 _big_endian=auto
627 _bitmap_font=yes
628 _freetype=auto
629 _fontconfig=auto
630 _menu=no
631 _qtx=auto
632 _macosx=auto
633 _maemo=auto
634 _macosx_finder_support=no
635 _macosx_bundle=auto
636 _sortsub=yes
637 _freetypeconfig='freetype-config'
638 _fribidi=auto
639 _fribidiconfig='fribidi-config'
640 _enca=auto
641 _inet6=auto
642 _gethostbyname2=auto
643 _ftp=yes
644 _musepack=auto
645 _vstream=auto
646 _pthreads=auto
647 _ass=auto
648 _rpath=no
649 _asmalign_pot=auto
650 _color_console=no
651 _stream_cache=yes
652 _def_stream_cache="#define USE_STREAM_CACHE 1"
653 _need_shmem=yes
654 for ac_option do
655 case "$ac_option" in
656 --help|-help|-h)
657 show_help
659 --prefix=*)
660 _prefix=`echo $ac_option | cut -d '=' -f 2`
662 --bindir=*)
663 _bindir=`echo $ac_option | cut -d '=' -f 2`
665 --datadir=*)
666 _datadir=`echo $ac_option | cut -d '=' -f 2`
668 --mandir=*)
669 _mandir=`echo $ac_option | cut -d '=' -f 2`
671 --confdir=*)
672 _confdir=`echo $ac_option | cut -d '=' -f 2`
674 --libdir=*)
675 _libdir=`echo $ac_option | cut -d '=' -f 2`
677 --codecsdir=*)
678 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
680 --win32codecsdir=*)
681 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
683 --xanimcodecsdir=*)
684 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
686 --realcodecsdir=*)
687 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
689 --with-extraincdir=*)
690 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
692 --with-extralibdir=*)
693 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
696 --with-install=*)
697 _install=`echo $ac_option | cut -d '=' -f 2 `
699 --with-xvmclib=*)
700 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
703 --with-sdl-config=*)
704 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
706 --with-freetype-config=*)
707 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
709 --with-fribidi-config=*)
710 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
712 --with-gtk-config=*)
713 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
715 --with-glib-config=*)
716 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
718 --with-dvdnav-config=*)
719 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
722 --extra-libs=*)
723 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
725 --extra-libs-mplayer=*)
726 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
728 --extra-libs-mencoder=*)
729 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
732 --target=*)
733 _target=`echo $ac_option | cut -d '=' -f 2`
735 --cc=*)
736 _cc=`echo $ac_option | cut -d '=' -f 2`
738 --host-cc=*)
739 _host_cc=`echo $ac_option | cut -d '=' -f 2`
741 --as=*)
742 _as=`echo $ac_option | cut -d '=' -f 2`
744 --charset=*)
745 _charset=`echo $ac_option | cut -d '=' -f 2`
747 --language=*)
748 _language=`echo $ac_option | cut -d '=' -f 2`
751 --enable-static)
752 _ld_static='-static'
754 --disable-static)
755 _ld_static=''
757 --enable-profile)
758 _profile='-p'
760 --disable-profile)
761 _profile=
763 --enable-debug)
764 _debug='-g'
766 --enable-debug=*)
767 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
769 --disable-debug)
770 _debug=
772 --enable-gcc-check) _gcc_check=yes ;;
773 --disable-gcc-check) _gcc_check=no ;;
774 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
775 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
776 --enable-cross-compile) _cross_compile=yes ;;
777 --disable-cross-compile) _cross_compile=no ;;
778 --enable-mencoder) _mencoder=yes ;;
779 --disable-mencoder) _mencoder=no ;;
780 --enable-mplayer) _mplayer=yes ;;
781 --disable-mplayer) _mplayer=no ;;
782 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
783 --disable-dynamic-plugins) _dynamic_plugins=no ;;
784 --enable-x11) _x11=yes ;;
785 --disable-x11) _x11=no ;;
786 --enable-xshape) _xshape=yes ;;
787 --disable-xshape) _xshape=no ;;
788 --enable-xv) _xv=yes ;;
789 --disable-xv) _xv=no ;;
790 --enable-xvmc) _xvmc=yes ;;
791 --disable-xvmc) _xvmc=no ;;
792 --enable-sdl) _sdl=yes ;;
793 --disable-sdl) _sdl=no ;;
794 --enable-directx) _directx=yes ;;
795 --disable-directx) _directx=no ;;
796 --enable-win32waveout) _win32waveout=yes ;;
797 --disable-win32waveout) _win32waveout=no ;;
798 --enable-nas) _nas=yes ;;
799 --disable-nas) _nas=no ;;
800 --enable-png) _png=yes ;;
801 --disable-png) _png=no ;;
802 --enable-jpeg) _jpeg=yes ;;
803 --disable-jpeg) _jpeg=no ;;
804 --enable-pnm) _pnm=yes ;;
805 --disable-pnm) _pnm=no ;;
806 --enable-md5sum) _md5sum=yes ;;
807 --disable-md5sum) _md5sum=no ;;
808 --enable-gif) _gif=yes ;;
809 --disable-gif) _gif=no ;;
810 --enable-gl) _gl=yes ;;
811 --disable-gl) _gl=no ;;
812 --enable-ggi) _ggi=yes ;;
813 --disable-ggi) _ggi=no ;;
814 --enable-ggiwmh) _ggiwmh=yes ;;
815 --disable-ggiwmh) _ggiwmh=no ;;
816 --enable-aa) _aa=yes ;;
817 --disable-aa) _aa=no ;;
818 --enable-caca) _caca=yes ;;
819 --disable-caca) _caca=no ;;
820 --enable-svga) _svga=yes ;;
821 --disable-svga) _svga=no ;;
822 --enable-vesa) _vesa=yes ;;
823 --disable-vesa) _vesa=no ;;
824 --enable-fbdev) _fbdev=yes ;;
825 --disable-fbdev) _fbdev=no ;;
826 --enable-dvb) _dvb=yes ;;
827 --disable-dvb) _dvb=no ;;
828 --enable-dvbhead) _dvbhead=yes ;;
829 --disable-dvbhead) _dvbhead=no ;;
830 --enable-dxr2) _dxr2=yes ;;
831 --disable-dxr2) _dxr2=no ;;
832 --enable-dxr3) _dxr3=yes ;;
833 --disable-dxr3) _dxr3=no ;;
834 --enable-ivtv) _ivtv=yes ;;
835 --disable-ivtv) _ivtv=no ;;
836 --enable-iconv) _iconv=yes ;;
837 --disable-iconv) _iconv=no ;;
838 --enable-langinfo) _langinfo=yes ;;
839 --disable-langinfo) _langinfo=no ;;
840 --enable-rtc) _rtc=yes ;;
841 --disable-rtc) _rtc=no ;;
842 --enable-libdv) _libdv=yes ;;
843 --disable-libdv) _libdv=no ;;
844 --enable-ossaudio) _ossaudio=yes ;;
845 --disable-ossaudio) _ossaudio=no ;;
846 --enable-arts) _arts=yes ;;
847 --disable-arts) _arts=no ;;
848 --enable-esd) _esd=yes ;;
849 --disable-esd) _esd=no ;;
850 --enable-polyp) _polyp=yes ;;
851 --disable-polyp) _polyp=no ;;
852 --enable-jack) _jack=yes ;;
853 --disable-jack) _jack=no ;;
854 --enable-openal) _openal=yes ;;
855 --disable-openal) _openal=no ;;
856 --enable-mad) _mad=yes ;;
857 --disable-mad) _mad=no ;;
858 --enable-toolame) _toolame=yes ;;
859 --disable-toolame) _toolame=no ;;
860 --enable-twolame) _twolame=yes ;;
861 --disable-twolame) _twolame=no ;;
862 --enable-libcdio) _libcdio=yes ;;
863 --disable-libcdio) _libcdio=no ;;
864 --enable-liblzo) _liblzo=yes ;;
865 --disable-liblzo) _liblzo=no ;;
866 --enable-libvorbis) _libvorbis=yes ;;
867 --disable-libvorbis) _libvorbis=no ;;
868 --enable-speex) _speex=yes ;;
869 --disable-speex) _speex=no ;;
870 --enable-tremor-internal) _tremor_internal=yes ;;
871 --disable-tremor-internal) _tremor_internal=no ;;
872 --enable-tremor-low) _tremor_low=yes ;;
873 --disable-tremor-low) _tremor_low=no ;;
874 --enable-tremor-external) _tremor_external=yes ;;
875 --disable-tremor-external) _tremor_external=no ;;
876 --enable-theora) _theora=yes ;;
877 --disable-theora) _theora=no ;;
878 --enable-mp3lib) _mp3lib=yes ;;
879 --disable-mp3lib) _mp3lib=no ;;
880 --enable-liba52) _liba52=yes ;;
881 --disable-liba52) _liba52=no ;;
882 --enable-libmpeg2) _libmpeg2=yes ;;
883 --disable-libmpeg2) _libmpeg2=no ;;
884 --enable-musepack) _musepack=yes ;;
885 --disable-musepack) _musepack=no ;;
886 --enable-faad-internal) _faad_internal=yes ;;
887 --disable-faad-internal) _faad_internal=no ;;
888 --enable-faad-external) _faad_external=yes ;;
889 --disable-faad-external) _faad_external=no ;;
890 --enable-faad-fixed) _faad_fixed=yes ;;
891 --disable-faad-fixed) _faad_fixed=no ;;
892 --enable-faac) _faac=yes ;;
893 --disable-faac) _faac=no ;;
894 --enable-ladspa) _ladspa=yes ;;
895 --disable-ladspa) _ladspa=no ;;
896 --enable-xmms) _xmms=yes ;;
897 --disable-xmms) _xmms=no ;;
898 --enable-dvdread) _dvdread=yes ;;
899 --disable-dvdread) _dvdread=no ;;
900 --enable-dvdread-internal) _dvdread_internal=yes ;;
901 --disable-dvdread-internal) _dvdread_internal=no ;;
902 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
903 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
904 --enable-dvdnav) _dvdnav=yes ;;
905 --disable-dvdnav) _dvdnav=no ;;
906 --enable-xanim) _xanim=yes ;;
907 --disable-xanim) _xanim=no ;;
908 --enable-real) _real=yes ;;
909 --disable-real) _real=no ;;
910 --enable-live) _live=yes ;;
911 --disable-live) _live=no ;;
912 --enable-xinerama) _xinerama=yes ;;
913 --disable-xinerama) _xinerama=no ;;
914 --enable-mga) _mga=yes ;;
915 --disable-mga) _mga=no ;;
916 --enable-xmga) _xmga=yes ;;
917 --disable-xmga) _xmga=no ;;
918 --enable-vm) _vm=yes ;;
919 --disable-vm) _vm=no ;;
920 --enable-xf86keysym) _xf86keysym=yes ;;
921 --disable-xf86keysym) _xf86keysym=no ;;
922 --enable-mlib) _mlib=yes ;;
923 --disable-mlib) _mlib=no ;;
924 --enable-sunaudio) _sunaudio=yes ;;
925 --disable-sunaudio) _sunaudio=no ;;
926 --enable-sgiaudio) _sgiaudio=yes ;;
927 --disable-sgiaudio) _sgiaudio=no ;;
928 --enable-alsa) _alsa=yes ;;
929 --disable-alsa) _alsa=no ;;
930 --enable-tv) _tv=yes ;;
931 --disable-tv) _tv=no ;;
932 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
933 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
934 --enable-tv-v4l1) _tv_v4l1=yes ;;
935 --disable-tv-v4l1) _tv_v4l1=no ;;
936 --enable-tv-v4l2) _tv_v4l2=yes ;;
937 --disable-tv-v4l2) _tv_v4l2=no ;;
938 --enable-radio) _radio=yes ;;
939 --enable-radio-capture) _radio_capture=yes ;;
940 --disable-radio-capture) _radio_capture=no ;;
941 --disable-radio) _radio=no ;;
942 --enable-radio-v4l) _radio_v4l=yes ;;
943 --disable-radio-v4l) _radio_v4l=no ;;
944 --enable-radio-v4l2) _radio_v4l2=yes ;;
945 --disable-radio-v4l2) _radio_v4l2=no ;;
946 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
947 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
948 --enable-pvr) _pvr=yes ;;
949 --disable-pvr) _pvr=no ;;
950 --enable-fastmemcpy) _fastmemcpy=yes ;;
951 --disable-fastmemcpy) _fastmemcpy=no ;;
952 --enable-network) _network=yes ;;
953 --disable-network) _network=no ;;
954 --enable-winsock2) _winsock2=yes ;;
955 --disable-winsock2) _winsock2=no ;;
956 --enable-smb) _smbsupport=yes ;;
957 --disable-smb) _smbsupport=no ;;
958 --enable-vidix-internal) _vidix_internal=yes ;;
959 --disable-vidix-internal) _vidix_internal=no ;;
960 --enable-vidix-external) _vidix_external=yes ;;
961 --disable-vidix-external) _vidix_external=no ;;
962 --with-vidix-drivers=*)
963 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
965 --enable-joystick) _joystick=yes ;;
966 --disable-joystick) _joystick=no ;;
967 --enable-xvid) _xvid=yes ;;
968 --disable-xvid) _xvid=no ;;
969 --enable-x264) _x264=yes ;;
970 --disable-x264) _x264=no ;;
971 --enable-nut) _nut=yes ;;
972 --disable-nut) _nut=no ;;
973 --enable-libavutil_a) _libavutil_a=yes ;;
974 --disable-libavutil_a) _libavutil_a=no ;;
975 --enable-libavutil_so) _libavutil_so=yes ;;
976 --disable-libavutil_so) _libavutil_so=no ;;
977 --enable-libavcodec_a) _libavcodec_a=yes ;;
978 --disable-libavcodec_a) _libavcodec_a=no ;;
979 --enable-libavcodec_so) _libavcodec_so=yes ;;
980 --disable-libavcodec_so) _libavcodec_so=no ;;
981 --enable-libamr_nb) _libamr_nb=yes ;;
982 --disable-libamr_nb) _libamr_nb=no ;;
983 --enable-libamr_wb) _libamr_wb=yes ;;
984 --disable-libamr_wb) _libamr_wb=no ;;
985 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
986 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
987 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
988 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
989 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
990 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
991 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
992 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
993 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
994 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
995 --enable-libavformat_a) _libavformat_a=yes ;;
996 --disable-libavformat_a) _libavformat_a=no ;;
997 --enable-libavformat_so) _libavformat_so=yes ;;
998 --disable-libavformat_so) _libavformat_so=no ;;
999 --enable-libpostproc_a) _libpostproc_a=yes ;;
1000 --disable-libpostproc_a) _libpostproc_a=no ;;
1001 --enable-libpostproc_so) _libpostproc_so=yes ;;
1002 --disable-libpostproc_so) _libpostproc_so=no ;;
1003 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1004 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1006 --enable-lirc) _lirc=yes ;;
1007 --disable-lirc) _lirc=no ;;
1008 --enable-lircc) _lircc=yes ;;
1009 --disable-lircc) _lircc=no ;;
1010 --enable-gui) _gui=yes ;;
1011 --disable-gui) _gui=no ;;
1012 --enable-gtk1) _gtk1=yes ;;
1013 --disable-gtk1) _gtk1=no ;;
1014 --enable-termcap) _termcap=yes ;;
1015 --disable-termcap) _termcap=no ;;
1016 --enable-termios) _termios=yes ;;
1017 --disable-termios) _termios=no ;;
1018 --enable-3dfx) _3dfx=yes ;;
1019 --disable-3dfx) _3dfx=no ;;
1020 --enable-s3fb) _s3fb=yes ;;
1021 --disable-s3fb) _s3fb=no ;;
1022 --enable-tdfxfb) _tdfxfb=yes ;;
1023 --disable-tdfxfb) _tdfxfb=no ;;
1024 --disable-tdfxvid) _tdfxvid=no ;;
1025 --enable-tdfxvid) _tdfxvid=yes ;;
1026 --disable-tga) _tga=no ;;
1027 --enable-tga) _tga=yes ;;
1028 --enable-directfb) _directfb=yes ;;
1029 --disable-directfb) _directfb=no ;;
1030 --enable-zr) _zr=yes ;;
1031 --disable-zr) _zr=no ;;
1032 --enable-bl) _bl=yes ;;
1033 --disable-bl) _bl=no ;;
1034 --enable-mtrr) _mtrr=yes ;;
1035 --disable-mtrr) _mtrr=no ;;
1036 --enable-largefiles) _largefiles=yes ;;
1037 --disable-largefiles) _largefiles=no ;;
1038 --enable-shm) _shm=yes ;;
1039 --disable-shm) _shm=no ;;
1040 --enable-select) _select=yes ;;
1041 --disable-select) _select=no ;;
1042 --enable-linux-devfs) _linux_devfs=yes ;;
1043 --disable-linux-devfs) _linux_devfs=no ;;
1044 --enable-cdparanoia) _cdparanoia=yes ;;
1045 --disable-cdparanoia) _cdparanoia=no ;;
1046 --enable-cddb) _cddb=yes ;;
1047 --disable-cddb) _cddb=no ;;
1048 --enable-big-endian) _big_endian=yes ;;
1049 --disable-big-endian) _big_endian=no ;;
1050 --enable-bitmap-font) _bitmap_font=yes ;;
1051 --disable-bitmap-font) _bitmap_font=no ;;
1052 --enable-freetype) _freetype=yes ;;
1053 --disable-freetype) _freetype=no ;;
1054 --enable-fontconfig) _fontconfig=yes ;;
1055 --disable-fontconfig) _fontconfig=no ;;
1056 --enable-unrarlib) _unrarlib=yes ;;
1057 --disable-unrarlib) _unrarlib=no ;;
1058 --enable-ftp) _ftp=yes ;;
1059 --disable-ftp) _ftp=no ;;
1060 --enable-vstream) _vstream=yes ;;
1061 --disable-vstream) _vstream=no ;;
1062 --enable-pthreads) _pthreads=yes ;;
1063 --disable-pthreads) _pthreads=no ;;
1064 --enable-ass) _ass=yes ;;
1065 --disable-ass) _ass=no ;;
1066 --enable-rpath) _rpath=yes ;;
1067 --disable-rpath) _rpath=no ;;
1068 --enable-color-console) _color_console=yes ;;
1069 --disable-color-console) _color_console=no ;;
1071 --enable-fribidi) _fribidi=yes ;;
1072 --disable-fribidi) _fribidi=no ;;
1074 --enable-enca) _enca=yes ;;
1075 --disable-enca) _enca=no ;;
1077 --enable-inet6) _inet6=yes ;;
1078 --disable-inet6) _inet6=no ;;
1080 --enable-gethostbyname2) _gethostbyname2=yes ;;
1081 --disable-gethostbyname2) _gethostbyname2=no ;;
1083 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1084 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1085 --disable-dga) _dga=no ;;
1087 --enable-menu) _menu=yes ;;
1088 --disable-menu) _menu=no ;;
1090 --enable-qtx) _qtx=yes ;;
1091 --disable-qtx) _qtx=no ;;
1093 --enable-macosx) _macosx=yes ;;
1094 --disable-macosx) _macosx=no ;;
1095 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1096 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1097 --enable-macosx-bundle) _macosx_bundle=yes;;
1098 --disable-macosx-bundle) _macosx_bundle=no;;
1100 --enable-maemo) _maemo=yes ;;
1101 --disable-maemo) _maemo=no ;;
1103 --enable-sortsub) _sortsub=yes ;;
1104 --disable-sortsub) _sortsub=no ;;
1106 --enable-crash-debug) _crash_debug=yes ;;
1107 --disable-crash-debug) _crash_debug=no ;;
1108 --enable-sighandler) _sighandler=yes ;;
1109 --disable-sighandler) _sighandler=no ;;
1110 --enable-win32dll) _win32dll=yes ;;
1111 --disable-win32dll) _win32dll=no ;;
1113 --enable-sse) _sse=yes ;;
1114 --disable-sse) _sse=no ;;
1115 --enable-sse2) _sse2=yes ;;
1116 --disable-sse2) _sse2=no ;;
1117 --enable-ssse3) _ssse3=yes ;;
1118 --disable-ssse3) _ssse3=no ;;
1119 --enable-mmxext) _mmxext=yes ;;
1120 --disable-mmxext) _mmxext=no ;;
1121 --enable-3dnow) _3dnow=yes ;;
1122 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1123 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1124 --disable-3dnowext) _3dnowext=no ;;
1125 --enable-cmov) _cmov=yes ;;
1126 --disable-cmov) _cmov=no ;;
1127 --enable-fast-cmov) _fast_cmov=yes ;;
1128 --disable-fast-cmov) _fast_cmov=no ;;
1129 --enable-altivec) _altivec=yes ;;
1130 --disable-altivec) _altivec=no ;;
1131 --enable-armv5te) _armv5te=yes ;;
1132 --disable-armv5te) _armv5te=no ;;
1133 --enable-armv6) _armv6=yes ;;
1134 --disable-armv6) _armv6=no ;;
1135 --enable-iwmmxt) _iwmmxt=yes ;;
1136 --disable-iwmmxt) _iwmmxt=no ;;
1137 --enable-mmx) _mmx=yes ;;
1138 --disable-mmx) # 3Dnow! and MMX2 require MMX
1139 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1142 echo "Unknown parameter: $ac_option"
1143 exit 1
1146 esac
1147 done
1149 # Atmos: moved this here, to be correct, if --prefix is specified
1150 test -z "$_bindir" && _bindir="$_prefix/bin"
1151 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1152 test -z "$_mandir" && _mandir="$_prefix/man"
1153 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1154 test -z "$_libdir" && _libdir="$_prefix/lib"
1156 # Determine our OS name and CPU architecture
1157 if test -z "$_target" ; then
1158 # OS name
1159 system_name=`uname -s 2>&1`
1160 case "$system_name" in
1161 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX|AmigaOS)
1163 IRIX*)
1164 system_name=IRIX
1166 GNU/kFreeBSD)
1167 system_name=FreeBSD
1169 HP-UX*)
1170 system_name=HP-UX
1172 [cC][yY][gG][wW][iI][nN]*)
1173 system_name=CYGWIN
1175 MINGW32*)
1176 system_name=MINGW32
1179 system_name="$system_name-UNKNOWN"
1181 esac
1184 # host's CPU/instruction set
1185 host_arch=`uname -p 2>&1`
1186 case "$host_arch" in
1187 i386|sparc|ppc|alpha|arm|mips|vax)
1189 powerpc) # Darwin returns 'powerpc'
1190 host_arch=ppc
1192 *) # uname -p on Linux returns 'unknown' for the processor type,
1193 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1195 # Maybe uname -m (machine hardware name) returns something we
1196 # recognize.
1198 # x86/x86pc is used by QNX
1199 case "`uname -m 2>&1`" in
1200 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 ;;
1201 ia64) host_arch=ia64 ;;
1202 x86_64|amd64)
1203 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1204 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1205 host_arch=x86_64
1206 else
1207 host_arch=i386
1210 macppc|ppc|ppc64) host_arch=ppc ;;
1211 alpha) host_arch=alpha ;;
1212 sparc) host_arch=sparc ;;
1213 sparc64) host_arch=sparc64 ;;
1214 parisc*|hppa*|9000*) host_arch=hppa ;;
1215 arm*|zaurus|cats) host_arch=arm ;;
1216 s390) host_arch=s390 ;;
1217 s390x) host_arch=s390x ;;
1218 mips*) host_arch=mips ;;
1219 vax) host_arch=vax ;;
1220 *) host_arch=UNKNOWN ;;
1221 esac
1223 esac
1224 else # if test -z "$_target"
1225 system_name=`echo $_target | cut -d '-' -f 2`
1226 case "`echo $system_name | tr A-Z a-z`" in
1227 linux) system_name=Linux ;;
1228 freebsd) system_name=FreeBSD ;;
1229 gnu/kfreebsd) system_name=FreeBSD ;;
1230 netbsd) system_name=NetBSD ;;
1231 bsd/os) system_name=BSD/OS ;;
1232 openbsd) system_name=OpenBSD ;;
1233 sunos) system_name=SunOS ;;
1234 qnx) system_name=QNX ;;
1235 morphos) system_name=MorphOS ;;
1236 amigaos) system_name=AmigaOS ;;
1237 mingw32msvc) system_name=MINGW32 ;;
1238 esac
1239 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1240 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
1243 echo "Detected operating system: $system_name"
1244 echo "Detected host architecture: $host_arch"
1246 if test "$_runtime_cpudetection" = yes && not x86 && not ppc; then
1247 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1250 # LGB: temporary files
1251 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1252 test "$I" && break
1253 done
1255 TMPLOG="configure.log"
1256 rm -f "$TMPLOG"
1257 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1258 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1259 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
1260 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1262 # config files
1264 # FIXME: A lot of stuff is installed under /usr/local
1265 # NK: But we should never use this stuff implicitly since we call compiler
1266 # from /usr we should be sure that there no effects from other compilers
1267 # (libraries) which might be installed into /usr/local. Let users use this
1268 # stuff explicitly as command line argument. In other words: It would be
1269 # resonable to have only /usr/include or only /usr/local/include.
1271 if openbsd ; then
1272 _ldconfig="ldconfig -R"
1275 if freebsd ; then
1276 _ld_extra="$_ld_extra -L/usr/local/lib"
1277 _inc_extra="$_inc_extra -I/usr/local/include"
1280 if darwin; then
1281 _ld_extra="$_ld_extra -L/usr/local/lib"
1282 _inc_extra="$_inc_extra -I/usr/local/include"
1285 if aix ; then
1286 _ld_extra="$_ld_extra -lC"
1289 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
1290 if irix ; then
1291 _ranlib='ar -r'
1292 elif linux ; then
1293 _ranlib='true'
1296 if win32 ; then
1297 _exesuf=".exe"
1298 # -lwinmm is always needed for osdep/timer-win2.c
1299 _ld_extra="$_ld_extra -lwinmm"
1300 _confwin32='TARGET_WIN32 = yes'
1301 else
1302 _confwin32='TARGET_WIN32 = no'
1305 if mingw32 ; then
1306 _need_shmem=no
1309 if cygwin ; then
1310 _def_confwin32='#define WIN32'
1313 if amigaos ; then
1314 _select=no
1315 _sighandler=no
1316 _stream_cache=no
1317 _def_stream_cache="#undef USE_STREAM_CACHE"
1320 if qnx ; then
1321 _ld_extra="$_ld_extra -lph"
1324 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1325 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1326 # know about '-n'.
1327 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1328 _head() { head -$1 2>/dev/null ; }
1329 else
1330 _head() { head -n $1 2>/dev/null ; }
1332 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1333 _tail() { tail -$1 2>/dev/null ; }
1334 else
1335 _tail() { tail -n $1 2>/dev/null ; }
1338 # Checking CC version...
1339 if test "$_gcc_check" = yes ; then
1340 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1341 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1342 echocheck "$_cc version"
1343 cc_vendor=intel
1344 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1345 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1346 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1347 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1348 # TODO verify older icc/ecc compatibility
1349 case $cc_version in
1351 cc_version="v. ?.??, bad"
1352 cc_verc_fail=yes
1354 8.0|9.1)
1355 cc_version="$cc_version, ok"
1356 cc_verc_fail=no
1359 cc_version="$cc_version, bad"
1360 cc_verc_fail=yes
1362 esac
1363 echores "$cc_version"
1364 else
1365 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
1366 echocheck "$_cc version"
1367 cc_vendor=gnu
1368 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1369 cc_version=`$_cc -dumpversion 2>&1`
1370 if test "$?" -gt 0; then
1371 cc_version="not found"
1373 case $cc_version in
1375 cc_version="v. ?.??, bad"
1376 cc_verc_fail=yes
1378 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1379 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1380 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1381 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1382 cc_version="$cc_version, ok"
1383 cc_verc_fail=no
1385 'not found')
1386 cc_verc_fail=yes
1389 cc_version="$cc_version, bad"
1390 cc_verc_fail=yes
1392 esac
1393 echores "$cc_version"
1394 test "$cc_verc_fail" = "no" && break
1395 done
1396 fi # icc
1397 if test "$cc_verc_fail" = yes ; then
1398 cat <<EOF
1400 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1402 You are not using a supported compiler. We do not have the time to make sure
1403 everything works with compilers other than the ones we use. Use either the
1404 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1405 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1407 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1408 mplayer and lame (which is used for mencoder). If you get compile errors,
1409 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1410 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1411 bugs!
1413 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1416 die "Bad gcc version"
1418 else
1419 cat <<EOF
1421 ******************************************************************************
1423 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1424 Ok. You know. Do it.
1426 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1427 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1428 Lame which is used by mencoder produces weird errors, too.
1430 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1431 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1433 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1435 ******************************************************************************
1439 read _answer
1442 echocheck "host cc"
1443 test "$_host_cc" || _host_cc=$_cc
1444 echores $_host_cc
1446 echocheck "cross compilation"
1447 if test $_cross_compile = auto ; then
1448 cat > $TMPC << EOF
1449 int main() { return 0; }
1451 _cross_compile=yes
1452 cc_check && "$TMPO" && _cross_compile=no
1454 echores $_cross_compile
1456 if test $_cross_compile = yes; then
1457 tmp_run() {
1458 return 0
1462 # ---
1464 # now that we know what compiler should be used for compilation, try to find
1465 # out which assembler is used by the $_cc compiler
1466 if test "$_as" = auto ; then
1467 _as=`$_cc -print-prog-name=as`
1468 test -z "$_as" && _as=as
1471 # XXX: this should be ok..
1472 _cpuinfo="echo"
1474 if test "$_runtime_cpudetection" = no ; then
1476 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1477 # FIXME: Remove the cygwin check once AMD CPUs are supported
1478 if test -r /proc/cpuinfo && not cygwin; then
1479 # Linux with /proc mounted, extract CPU information from it
1480 _cpuinfo="cat /proc/cpuinfo"
1481 elif test -r /compat/linux/proc/cpuinfo && not x86_32 ; then
1482 # FreeBSD with Linux emulation /proc mounted,
1483 # extract CPU information from it
1484 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1485 elif darwin && not x86_32 ; then
1486 # use hostinfo on Darwin
1487 _cpuinfo="hostinfo"
1488 elif aix; then
1489 # use 'lsattr' on AIX
1490 _cpuinfo="lsattr -E -l proc0 -a type"
1491 elif x86; then
1492 # all other OSes try to extract CPU information from a small helper
1493 # program cpuinfo instead
1494 $_cc -o cpuinfo cpuinfo.c
1495 _cpuinfo="./cpuinfo"
1498 if x86 ; then
1499 # gather more CPU information
1500 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1501 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1502 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1503 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1504 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1506 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1508 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1509 -e s/xmm/sse/ -e s/kni/sse/`
1511 for ext in $pparam ; do
1512 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1513 done
1515 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1516 test $_sse = kernel_check && _mmxext=kernel_check
1518 echocheck "CPU vendor"
1519 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1521 echocheck "CPU type"
1522 echores "$pname"
1525 fi # test "$_runtime_cpudetection" = no
1527 if x86 && test "$_runtime_cpudetection" = no ; then
1528 extcheck() {
1529 if test "$1" = kernel_check ; then
1530 echocheck "kernel support of $2"
1531 cat > $TMPC <<EOF
1532 #include <signal.h>
1533 void catch() { exit(1); }
1534 int main(void){
1535 signal(SIGILL, catch);
1536 __asm__ __volatile__ ("$3":::"memory");return(0);
1540 if cc_check && tmp_run ; then
1541 eval _$2=yes
1542 echores "yes"
1543 _optimizing="$_optimizing $2"
1544 return 0
1545 else
1546 eval _$2=no
1547 echores "failed"
1548 echo "It seems that your kernel does not correctly support $2."
1549 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1550 return 1
1553 return 0
1556 extcheck $_mmx "mmx" "emms"
1557 extcheck $_mmxext "mmxext" "sfence"
1558 extcheck $_3dnow "3dnow" "femms"
1559 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1560 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1561 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1562 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1563 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1565 echocheck "mtrr support"
1566 if test "$_mtrr" = kernel_check ; then
1567 _mtrr="yes"
1568 _optimizing="$_optimizing mtrr"
1570 echores "$_mtrr"
1572 if test "$_gcc3_ext" != ""; then
1573 # if we had to disable sse/sse2 because the active kernel does not
1574 # support this instruction set extension, we also have to tell
1575 # gcc3 to not generate sse/sse2 instructions for normal C code
1576 cat > $TMPC << EOF
1577 int main(void) { return 0; }
1579 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1584 case "$host_arch" in
1585 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1586 _def_arch_x86="#define ARCH_X86 1"
1587 _target_arch_x86="TARGET_ARCH_X86 = yes"
1588 _def_arch="#define ARCH_X86_32 1"
1589 _target_arch="TARGET_ARCH_X86_32 = yes"
1590 iproc=486
1591 proc=i486
1594 if test "$_runtime_cpudetection" = no ; then
1595 case "$pvendor" in
1596 AuthenticAMD)
1597 case "$pfamily" in
1598 3) proc=i386 iproc=386 ;;
1599 4) proc=i486 iproc=486 ;;
1600 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1601 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1602 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1603 proc=k6-3
1604 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1605 proc=geode
1606 elif test "$pmodel" -ge 8; then
1607 proc=k6-2
1608 elif test "$pmodel" -ge 6; then
1609 proc=k6
1610 else
1611 proc=i586
1614 6) iproc=686
1615 # It's a bit difficult to determine the correct type of Family 6
1616 # AMD CPUs just from their signature. Instead, we check directly
1617 # whether it supports SSE.
1618 if test "$_sse" = yes; then
1619 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1620 proc=athlon-xp
1621 else
1622 # Again, gcc treats athlon and athlon-tbird similarly.
1623 proc=athlon
1626 15) iproc=686
1627 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1628 # caught and remedied in the optimization tests below.
1629 proc=k8
1632 *) proc=k8 iproc=686 ;;
1633 esac
1635 GenuineIntel)
1636 case "$pfamily" in
1637 3) proc=i386 iproc=386 ;;
1638 4) proc=i486 iproc=486 ;;
1639 5) iproc=586
1640 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1641 proc=pentium-mmx # 4 is desktop, 8 is mobile
1642 else
1643 proc=i586
1646 6) iproc=686
1647 if test "$pmodel" -ge 15; then
1648 proc=core2
1649 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1650 proc=pentium-m
1651 elif test "$pmodel" -ge 7; then
1652 proc=pentium3
1653 elif test "$pmodel" -ge 3; then
1654 proc=pentium2
1655 else
1656 proc=i686
1659 15) iproc=686
1660 # A nocona in 32-bit mode has no more capabilities than a prescott.
1661 if test "$pmodel" -ge 3; then
1662 proc=prescott
1663 else
1664 proc=pentium4
1667 *) proc=prescott iproc=686 ;;
1668 esac
1670 CentaurHauls)
1671 case "$pfamily" in
1672 5) iproc=586
1673 if test "$pmodel" -ge 8; then
1674 proc=winchip2
1675 elif test "$pmodel" -ge 4; then
1676 proc=winchip-c6
1677 else
1678 proc=i586
1681 6) iproc=686
1682 if test "$pmodel" -ge 9; then
1683 proc=c3-2
1684 else
1685 proc=c3
1686 iproc=586
1689 *) proc=i686 iproc=i686 ;;
1690 esac
1692 unknown)
1693 case "$pfamily" in
1694 3) proc=i386 iproc=386 ;;
1695 4) proc=i486 iproc=486 ;;
1696 *) proc=i586 iproc=586 ;;
1697 esac
1700 proc=i586 iproc=586 ;;
1701 esac
1702 fi # test "$_runtime_cpudetection" = no
1705 # check that gcc supports our CPU, if not, fall back to earlier ones
1706 # LGB: check -mcpu and -march swithing step by step with enabling
1707 # to fall back till 386.
1709 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1711 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1712 cpuopt=-mtune
1713 else
1714 cpuopt=-mcpu
1717 echocheck "GCC & CPU optimization abilities"
1718 cat > $TMPC << EOF
1719 int main(void) { return 0; }
1721 if test "$_runtime_cpudetection" = no ; then
1722 if test "$proc" = "k8"; then
1723 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1725 if test "$proc" = "athlon-xp"; then
1726 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1728 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1729 cc_check -march=$proc $cpuopt=$proc || proc=k6
1731 if test "$proc" = "k6" || test "$proc" = "c3"; then
1732 if not cc_check -march=$proc $cpuopt=$proc; then
1733 if cc_check -march=i586 $cpuopt=i686; then
1734 proc=i586-i686
1735 else
1736 proc=i586
1740 if test "$proc" = "prescott" ; then
1741 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1743 if test "$proc" = "core2" ; then
1744 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1746 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
1747 cc_check -march=$proc $cpuopt=$proc || proc=i686
1749 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1750 cc_check -march=$proc $cpuopt=$proc || proc=i586
1752 if test "$proc" = "i586"; then
1753 cc_check -march=$proc $cpuopt=$proc || proc=i486
1755 if test "$proc" = "i486" ; then
1756 cc_check -march=$proc $cpuopt=$proc || proc=i386
1758 if test "$proc" = "i386" ; then
1759 cc_check -march=$proc $cpuopt=$proc || proc=error
1761 if test "$proc" = "error" ; then
1762 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1763 _mcpu=""
1764 _march=""
1765 _optimizing=""
1766 elif test "$proc" = "i586-i686"; then
1767 _march="-march=i586"
1768 _mcpu="$cpuopt=i686"
1769 _optimizing="$proc"
1770 else
1771 _march="-march=$proc"
1772 _mcpu="$cpuopt=$proc"
1773 _optimizing="$proc"
1775 else # if test "$_runtime_cpudetection" = no
1776 _mcpu="$cpuopt=generic"
1777 # at least i486 required, for bswap instruction
1778 _march="-march=i486"
1779 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1780 cc_check $_mcpu || _mcpu=""
1781 cc_check $_march $_mcpu || _march=""
1784 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1785 ## autodetected mcpu/march parameters
1786 if test "$_target" ; then
1787 # TODO: it may be a good idea to check GCC and fall back in all cases
1788 if test "$host_arch" = "i586-i686"; then
1789 _march="-march=i586"
1790 _mcpu="$cpuopt=i686"
1791 else
1792 _march="-march=$host_arch"
1793 _mcpu="$cpuopt=$host_arch"
1796 proc="$host_arch"
1798 case "$proc" in
1799 i386) iproc=386 ;;
1800 i486) iproc=486 ;;
1801 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1802 i686|athlon*|pentium*) iproc=686 ;;
1803 *) iproc=586 ;;
1804 esac
1807 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1808 _fast_cmov="yes"
1809 case "$proc" in
1810 pentium4|prescott|nocona)
1811 _fast_cmov="no"
1812 esac
1813 else
1814 _fast_cmov="no"
1817 echores "$proc"
1820 ia64)
1821 _def_arch='#define ARCH_IA64 1'
1822 _target_arch='TARGET_ARCH_IA64 = yes'
1823 iproc='ia64'
1824 proc=''
1825 _march=''
1826 _mcpu=''
1827 _optimizing=''
1830 x86_64|amd64)
1831 _def_arch='#define ARCH_X86_64 1'
1832 _target_arch='TARGET_ARCH_X86_64 = yes'
1833 _def_arch_x86="#define ARCH_X86 1"
1834 _target_arch_x86="TARGET_ARCH_X86 = yes"
1835 iproc='x86_64'
1837 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1838 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1839 cpuopt=-mtune
1840 else
1841 cpuopt=-mcpu
1843 if test "$_runtime_cpudetection" = no ; then
1844 case "$pvendor" in
1845 AuthenticAMD)
1846 proc=k8;;
1847 GenuineIntel)
1848 case "$pmodel" in
1849 6) proc=core2;;
1851 # 64-bit prescotts exist, but as far as GCC is concerned they
1852 # have the same capabilities as a nocona.
1853 proc=nocona;;
1854 esac
1857 proc=error;;
1858 esac
1859 fi # test "$_runtime_cpudetection" = no
1861 echocheck "GCC & CPU optimization abilities"
1862 cat > $TMPC << EOF
1863 int main(void) { return 0; }
1865 # This is a stripped-down version of the i386 fallback.
1866 if test "$_runtime_cpudetection" = no ; then
1867 # --- AMD processors ---
1868 if test "$proc" = "k8"; then
1869 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1871 # This will fail if gcc version < 3.3, which is ok because earlier
1872 # versions don't really support 64-bit on amd64.
1873 # Is this a valid assumption? -Corey
1874 if test "$proc" = "athlon-xp"; then
1875 cc_check -march=$proc $cpuopt=$proc || proc=error
1877 # --- Intel processors ---
1878 if test "$proc" = "core2"; then
1879 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1881 if test "$proc" = "nocona"; then
1882 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1884 if test "$proc" = "pentium4"; then
1885 cc_check -march=$proc $cpuopt=$proc || proc=error
1888 _march="-march=$proc"
1889 _mcpu="$cpuopt=$proc"
1890 if test "$proc" = "error" ; then
1891 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1892 _mcpu=""
1893 _march=""
1895 else # if test "$_runtime_cpudetection" = no
1896 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1897 _march="-march=x86-64"
1898 _mcpu="$cpuopt=generic"
1899 cc_check $_mcpu || _mcpu="x86-64"
1900 cc_check $_mcpu || _mcpu=""
1901 cc_check $_march $_mcpu || _march=""
1904 _optimizing=""
1906 echores "$proc"
1909 sparc)
1910 _def_arch='#define ARCH_SPARC 1'
1911 _target_arch='TARGET_ARCH_SPARC = yes'
1912 iproc='sparc'
1913 if sunos ; then
1914 echocheck "CPU type"
1915 karch=`uname -m`
1916 case "`echo $karch`" in
1917 sun4) proc=v7 ;;
1918 sun4c) proc=v7 ;;
1919 sun4d) proc=v8 ;;
1920 sun4m) proc=v8 ;;
1921 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1922 sun4v) proc=v9 ;;
1923 *) proc=v8 ;;
1924 esac
1925 echores "$proc"
1926 else
1927 proc=v8
1929 _march=''
1930 _mcpu="-mcpu=$proc"
1931 _optimizing="$proc"
1934 sparc64)
1935 _def_arch='#define ARCH_SPARC 1'
1936 _target_arch='TARGET_ARCH_SPARC = yes'
1937 _vis='yes'
1938 _def_vis='#define HAVE_VIS = yes'
1939 iproc='sparc'
1940 proc='v9'
1941 _march=''
1942 _mcpu="-mcpu=$proc"
1943 _optimizing="$proc"
1946 arm|armv4l|armv5tel)
1947 _def_arch='#define ARCH_ARMV4L 1'
1948 _target_arch='TARGET_ARCH_ARMV4L = yes'
1949 iproc='arm'
1950 proc=''
1951 _march=''
1952 _mcpu=''
1953 _optimizing=''
1956 ppc|powerpc)
1957 _def_arch='#define ARCH_POWERPC 1'
1958 _def_dcbzl='#define NO_DCBZL 1'
1959 _target_arch='TARGET_ARCH_POWERPC = yes'
1960 iproc='ppc'
1961 proc=''
1962 _march=''
1963 _mcpu=''
1964 _optimizing=''
1965 _altivec=no
1967 echocheck "CPU type"
1968 case $system_name in
1969 Linux)
1970 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1971 if test -n "`$_cpuinfo | grep altivec`"; then
1972 _altivec=yes
1975 Darwin)
1976 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1977 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
1978 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
1979 _altivec=yes
1982 NetBSD)
1983 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1984 case $cc_version in
1985 2*|3.0*|3.1*|3.2*|3.3*)
1988 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1989 _altivec=yes
1992 esac
1994 AIX)
1995 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
1997 esac
1998 if test "$_altivec" = yes; then
1999 echores "$proc altivec"
2000 else
2001 echores "$proc"
2004 echocheck "GCC & CPU optimization abilities"
2006 if test -n "$proc"; then
2007 case "$proc" in
2008 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2009 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2010 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2011 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2012 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2013 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2014 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2015 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2016 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2017 *) ;;
2018 esac
2019 # gcc 3.1(.1) and up supports 7400 and 7450
2020 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2021 case "$proc" in
2022 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2023 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2024 *) ;;
2025 esac
2027 # gcc 3.2 and up supports 970
2028 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2029 case "$proc" in
2030 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2031 _def_dcbzl='#undef NO_DCBZL' ;;
2032 *) ;;
2033 esac
2035 # gcc 3.3 and up supports POWER4
2036 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2037 case "$proc" in
2038 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2039 *) ;;
2040 esac
2042 # gcc 3.4 and up supports 440*
2043 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2044 case "$proc" in
2045 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2046 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2047 *) ;;
2048 esac
2050 # gcc 4.0 and up supports POWER5
2051 if test "$_cc_major" -ge "4"; then
2052 case "$proc" in
2053 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2054 *) ;;
2055 esac
2059 if test -n "$_mcpu"; then
2060 _optimizing=`echo $_mcpu | cut -c 8-`
2061 echores "$_optimizing"
2062 else
2063 echores "none"
2068 alpha)
2069 _def_arch='#define ARCH_ALPHA 1'
2070 _target_arch='TARGET_ARCH_ALPHA = yes'
2071 iproc='alpha'
2072 _march=''
2074 echocheck "CPU type"
2075 cat > $TMPC << EOF
2076 int main() {
2077 unsigned long ver, mask;
2078 asm ("implver %0" : "=r" (ver));
2079 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2080 printf("%ld-%x\n", ver, ~mask);
2081 return 0;
2084 $_cc -o "$TMPO" "$TMPC"
2085 case `"$TMPO"` in
2087 0-0) proc="ev4"; cpu_understands_mvi="0";;
2088 1-0) proc="ev5"; cpu_understands_mvi="0";;
2089 1-1) proc="ev56"; cpu_understands_mvi="0";;
2090 1-101) proc="pca56"; cpu_understands_mvi="1";;
2091 2-303) proc="ev6"; cpu_understands_mvi="1";;
2092 2-307) proc="ev67"; cpu_understands_mvi="1";;
2093 2-1307) proc="ev68"; cpu_understands_mvi="1";;
2094 esac
2095 echores "$proc"
2097 echocheck "GCC & CPU optimization abilities"
2098 if test "$proc" = "ev68" ; then
2099 cc_check -mcpu=$proc || proc=ev67
2101 if test "$proc" = "ev67" ; then
2102 cc_check -mcpu=$proc || proc=ev6
2104 _mcpu="-mcpu=$proc"
2105 echores "$proc"
2107 _optimizing="$proc"
2109 echocheck "MVI instruction support in GCC"
2110 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
2111 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2112 echores "yes"
2113 else
2114 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2115 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2119 mips)
2120 _def_arch='#define ARCH_SGI_MIPS 1'
2121 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
2122 iproc='sgi-mips'
2123 proc=''
2124 _march=''
2125 _mcpu=''
2126 _optimizing=''
2128 if irix ; then
2129 echocheck "CPU type"
2130 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2131 case "`echo $proc`" in
2132 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2133 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2134 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2135 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2136 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2137 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2138 esac
2139 # gcc < 3.x does not support -mtune.
2140 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2141 _mcpu=''
2143 echores "$proc"
2148 hppa)
2149 _def_arch='#define ARCH_PA_RISC 1'
2150 _target_arch='TARGET_ARCH_PA_RISC = yes'
2151 iproc='PA-RISC'
2152 proc=''
2153 _march=''
2154 _mcpu=''
2155 _optimizing=''
2158 s390)
2159 _def_arch='#define ARCH_S390 1'
2160 _target_arch='TARGET_ARCH_S390 = yes'
2161 iproc='390'
2162 proc=''
2163 _march=''
2164 _mcpu=''
2165 _optimizing=''
2168 s390x)
2169 _def_arch='#define ARCH_S390X 1'
2170 _target_arch='TARGET_ARCH_S390X = yes'
2171 iproc='390x'
2172 proc=''
2173 _march=''
2174 _mcpu=''
2175 _optimizing=''
2178 vax)
2179 _def_arch='#define ARCH_VAX 1'
2180 _target_arch='TARGET_ARCH_VAX = yes'
2181 iproc='vax'
2182 proc=''
2183 _march=''
2184 _mcpu=''
2185 _optimizing=''
2188 generic)
2189 _def_arch='#define ARCH_GENERIC 1'
2190 _target_arch='TARGET_ARCH_GENERIC = yes'
2191 iproc=''
2192 proc=''
2193 _march=''
2194 _mcpu=''
2195 _optimizing=''
2199 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2200 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2201 die "unsupported architecture $host_arch"
2203 esac # case "$host_arch" in
2205 if test "$_runtime_cpudetection" = yes ; then
2206 if x86 ; then
2207 _cmov=yes
2208 x86_32 && _cmov=no
2209 _mmx=yes
2210 _3dnow=yes
2211 _3dnowext=yes
2212 _mmxext=yes
2213 _sse=yes
2214 _sse2=yes
2215 _ssse3=yes
2216 _mtrr=yes
2218 if ppc; then
2219 _altivec=yes
2225 echocheck "assembler support of -pipe option"
2226 cat > $TMPC << EOF
2227 int main(void) { return 0; }
2229 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2232 echocheck "compiler support of named assembler arguments"
2233 _named_asm_args=yes
2234 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2235 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2236 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2237 _named_asm_args=no
2238 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2240 echores $_named_asm_args
2243 # Checking for CFLAGS
2244 _install_strip="-s"
2245 if test "$_profile" != "" || test "$_debug" != "" ; then
2246 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
2247 if test "$_cc_major" -ge "3" ; then
2248 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
2250 _install_strip=
2251 elif test -z "$CFLAGS" ; then
2252 if test "$cc_vendor" = "intel" ; then
2253 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2254 elif test "$cc_vendor" != "gnu" ; then
2255 CFLAGS="-O2 $_march $_mcpu $_pipe"
2256 else
2257 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2259 else
2260 _warn_CFLAGS=yes
2262 if test -n "$LDFLAGS" ; then
2263 _ld_extra="$_ld_extra $LDFLAGS"
2264 _warn_CFLAGS=yes
2265 elif test "$cc_vendor" = "intel" ; then
2266 _ld_extra="$_ld_extra -i-static"
2268 if test -n "$CPPFLAGS" ; then
2269 _inc_extra="$_inc_extra $CPPFLAGS"
2270 _warn_CFLAGS=yes
2275 if x86_32 ; then
2276 # Checking assembler (_as) compatibility...
2277 # Added workaround for older as that reads from stdin by default - atmos
2278 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2279 echocheck "assembler ($_as $as_version)"
2281 _pref_as_version='2.9.1'
2282 echo 'nop' > $TMPS
2283 if test "$_mmx" = yes ; then
2284 echo 'emms' >> $TMPS
2286 if test "$_3dnow" = yes ; then
2287 _pref_as_version='2.10.1'
2288 echo 'femms' >> $TMPS
2290 if test "$_3dnowext" = yes ; then
2291 _pref_as_version='2.10.1'
2292 echo 'pswapd %mm0, %mm0' >> $TMPS
2294 if test "$_mmxext" = yes ; then
2295 _pref_as_version='2.10.1'
2296 echo 'movntq %mm0, (%eax)' >> $TMPS
2298 if test "$_sse" = yes ; then
2299 _pref_as_version='2.10.1'
2300 echo 'xorps %xmm0, %xmm0' >> $TMPS
2302 #if test "$_sse2" = yes ; then
2303 # _pref_as_version='2.11'
2304 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2306 if test "$_cmov" = yes ; then
2307 _pref_as_version='2.10.1'
2308 echo 'cmovb %eax, %ebx' >> $TMPS
2310 if test "$_ssse3" = yes ; then
2311 _pref_as_version='2.16.92'
2312 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2314 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2316 if test "$as_verc_fail" != yes ; then
2317 echores "ok"
2318 else
2319 _res_comment="Upgrade binutils to ${_pref_as_version} ..."
2320 echores "failed"
2321 die "obsolete binutils version"
2324 fi #if x86_32
2326 echocheck ".align is a power of two"
2327 if test "$_asmalign_pot" = auto ; then
2328 _asmalign_pot=no
2329 cat > $TMPC << EOF
2330 main() { asm (".align 3"); }
2332 cc_check && _asmalign_pot=yes
2334 if test "$_asmalign_pot" = "yes" ; then
2335 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2336 else
2337 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2339 echores $_asmalign_pot
2342 #FIXME: This should happen before the check for CFLAGS..
2343 if ppc ; then
2345 # check if altivec is supported by the compiler, and how to enable it
2347 _altivec_gcc_flags=''
2349 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2350 echocheck "GCC altivec support"
2352 p=''
2353 cat > $TMPC << EOF
2354 int main() {
2355 return 0;
2358 FSF_flags='-maltivec -mabi=altivec'
2359 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2361 # check for Darwin-style flags first, since
2362 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2363 # accepts but ignores FSF-style flags...
2365 if test -z "$p"; then
2366 cc_check $Darwin_flags && p='Darwin'
2368 if test -z "$p"; then
2369 cc_check $FSF_flags && p='FSF'
2372 case $p in
2373 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2374 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2375 *) _altivec=no ;;
2376 esac
2378 if test -z "$p"; then
2379 p=none
2380 else
2381 p="$p-style ($_altivec_gcc_flags)"
2384 echores "$p"
2387 # check if <altivec.h> should be included
2389 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2391 if test "$_altivec" = yes ; then
2392 echocheck "altivec.h"
2393 cat > $TMPC << EOF
2394 #include <altivec.h>
2395 int main(void) { return 0; }
2397 _have_altivec_h=no
2398 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2399 if test "$_have_altivec_h" = yes ; then
2400 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2402 echores "$_have_altivec_h"
2405 # disable runtime cpudetection if
2406 # - we cannot generate altivec code
2407 # - altivec is disabled by the user
2409 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2410 _runtime_cpudetection=no
2413 # show that we are optimizing for altivec (if enabled and supported)
2415 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2416 _optimizing="$_optimizing altivec"
2419 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2421 if test "$_altivec" = yes ; then
2422 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2423 #_mcpu="$_mcpu $_altivec_gcc_flags"
2424 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2427 # setup _def_altivec correctly
2429 if test "$_altivec" = yes ; then
2430 _def_altivec='#define HAVE_ALTIVEC 1'
2431 else
2432 _def_altivec='#undef HAVE_ALTIVEC'
2436 if arm ; then
2437 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2438 if test $_armv5te = "auto" ; then
2439 cat > $TMPC << EOF
2440 int main(void) {
2441 __asm__ __volatile__ ("qadd r0, r0, r0");
2444 _armv5te=no
2445 cc_check && _armv5te=yes
2447 echores "$_armv5te"
2449 echocheck "ARMv6 (SIMD instructions)"
2450 if test $_armv6 = "auto" ; then
2451 cat > $TMPC << EOF
2452 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2454 _armv6=no
2455 cc_check && _armv6=yes
2457 echores "$_armv6"
2459 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2460 if test $_iwmmxt = "auto" ; then
2461 cat > $TMPC << EOF
2462 int main(void) {
2463 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2466 _iwmmxt=no
2467 cc_check && _iwmmxt=yes
2469 echores "$_iwmmxt"
2472 _def_mmx='#undef HAVE_MMX'
2473 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2474 _def_mmxext='#undef HAVE_MMX2'
2475 test "$_mmxext" = yes && _def_mmxext='#define HAVE_MMX2 1'
2476 _def_3dnow='#undef HAVE_3DNOW'
2477 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2478 _def_3dnowext='#undef HAVE_3DNOWEX'
2479 test "$_3dnowext" = yes && _def_3dnowext='#define HAVE_3DNOWEX 1'
2480 _def_sse='#undef HAVE_SSE'
2481 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2482 _def_sse2='#undef HAVE_SSE2'
2483 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2484 _def_ssse3='#undef HAVE_SSSE3'
2485 test "$_ssse3" = yes && _def_ssse3='#define HAVE_SSSE3 1'
2486 _def_cmov='#undef HAVE_CMOV'
2487 test "$_cmov" = yes && _def_cmov='#define HAVE_CMOV 1'
2488 _def_fast_cmov='#undef HAVE_FAST_CMOV'
2489 test "$_fast_cmov" = yes && _def_fast_cmov='#define HAVE_FAST_CMOV 1'
2490 _def_armv5te='#undef HAVE_ARMV5TE'
2491 test "$_armv5te" = yes && _def_armv5te='#define HAVE_ARMV5TE 1'
2492 _def_armv6='#undef HAVE_ARMV6'
2493 test "$_armv6" = yes && _def_armv6='#define HAVE_ARMV6 1'
2494 _def_iwmmxt='#undef HAVE_IWMMXT'
2495 test "$_iwmmxt" = yes && _def_iwmmxt='#define HAVE_IWMMXT 1'
2497 # Checking kernel version...
2498 if x86_32 && linux ; then
2499 _k_verc_problem=no
2500 kernel_version=`uname -r 2>&1`
2501 echocheck "$system_name kernel version"
2502 case "$kernel_version" in
2503 '') kernel_version="?.??"; _k_verc_fail=yes;;
2504 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2505 _k_verc_problem=yes;;
2506 esac
2507 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2508 _k_verc_fail=yes
2510 if test "$_k_verc_fail" ; then
2511 echores "$kernel_version, fail"
2512 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2513 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2514 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2515 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2516 echo "2.2.x you must upgrade it to get SSE support!"
2517 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2518 else
2519 echores "$kernel_version, ok"
2523 ######################
2524 # MAIN TESTS GO HERE #
2525 ######################
2528 echocheck "extra headers"
2529 if test "$_inc_extra" ; then
2530 echores "$_inc_extra"
2531 else
2532 echores "none"
2536 echocheck "extra libs"
2537 if test "$_ld_extra" ; then
2538 echores "$_ld_extra"
2539 else
2540 echores "none"
2543 echocheck "-lposix"
2544 cat > $TMPC <<EOF
2545 int main(void) { return 0; }
2547 if cc_check -lposix ; then
2548 _ld_extra="$_ld_extra -lposix"
2549 echores "yes"
2550 else
2551 echores "no"
2554 echocheck "-lm"
2555 cat > $TMPC <<EOF
2556 int main(void) { return 0; }
2558 if cc_check -lm ; then
2559 _ld_lm="-lm"
2560 echores "yes"
2561 else
2562 _ld_lm=""
2563 echores "no"
2567 echocheck "langinfo"
2568 if test "$_langinfo" = auto ; then
2569 cat > $TMPC <<EOF
2570 #include <langinfo.h>
2571 int main(void) { nl_langinfo(CODESET); return 0; }
2573 _langinfo=no
2574 cc_check && _langinfo=yes
2576 if test "$_langinfo" = yes ; then
2577 _def_langinfo='#define USE_LANGINFO 1'
2578 else
2579 _def_langinfo='#undef USE_LANGINFO'
2581 echores "$_langinfo"
2584 echocheck "language"
2585 test -z "$_language" && _language=$LINGUAS
2586 _language=`echo $_language | sed 's/,/ /g'`
2587 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2588 for lang in $_language ; do
2589 test "$lang" = all && lang=en
2590 if test -f "help/help_mp-${lang}.h" ; then
2591 _language=$lang
2592 break
2593 else
2594 echo ${_echo_n} "$lang not found, ${_echo_c}"
2595 _language=`echo $_language | sed "s/$lang *//"`
2597 done
2598 test -z "$_language" && _language=en
2599 _mp_help="help/help_mp-${_language}.h"
2600 test -f $_mp_help || die "$_mp_help not found"
2601 for lang in $LANGUAGES ; do
2602 if test -f "DOCS/man/$lang/mplayer.1" ; then
2603 MAN_LANG="$lang $MAN_LANG"
2605 done
2606 _doc_lang=$_language
2607 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2608 echores "using $_language (man pages: $MAN_LANG)"
2611 echocheck "enable sighandler"
2612 if test "$_sighandler" = yes ; then
2613 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2614 else
2615 _def_sighandler='#undef ENABLE_SIGHANDLER'
2617 echores "$_sighandler"
2619 echocheck "runtime cpudetection"
2620 if test "$_runtime_cpudetection" = yes ; then
2621 _optimizing="Runtime CPU-Detection enabled"
2622 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2623 else
2624 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2626 echores "$_runtime_cpudetection"
2629 echocheck "restrict keyword"
2630 for restrict_keyword in restrict __restrict __restrict__ ; do
2631 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2632 if cc_check; then
2633 _def_restrict_keyword=$restrict_keyword
2634 break;
2636 done
2637 if [ -n "$_def_restrict_keyword" ]; then
2638 echores "$_def_restrict_keyword"
2639 else
2640 echores "none"
2642 # Avoid infinite recursion loop ("#define restrict restrict")
2643 if [ "$_def_restrict_keyword" != "restrict" ]; then
2644 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2645 else
2646 _def_restrict_keyword=""
2650 echocheck "__builtin_expect"
2651 # GCC branch prediction hint
2652 cat > $TMPC << EOF
2653 int foo (int a) {
2654 a = __builtin_expect (a, 10);
2655 return a == 10 ? 0 : 1;
2657 int main() { return foo(10) && foo(0); }
2659 _builtin_expect=no
2660 cc_check && _builtin_expect=yes
2661 if test "$_builtin_expect" = yes ; then
2662 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2663 else
2664 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2666 echores "$_builtin_expect"
2669 echocheck "kstat"
2670 cat > $TMPC << EOF
2671 #include <kstat.h>
2672 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2674 _kstat=no
2675 cc_check -lkstat && _kstat=yes
2676 if test "$_kstat" = yes ; then
2677 _def_kstat="#define HAVE_LIBKSTAT 1"
2678 _ld_extra="$_ld_extra -lkstat"
2679 else
2680 _def_kstat="#undef HAVE_LIBKSTAT"
2682 echores "$_kstat"
2685 echocheck "posix4"
2686 # required for nanosleep on some systems
2687 cat > $TMPC << EOF
2688 #include <time.h>
2689 int main(void) { (void) nanosleep(0, 0); return 0; }
2691 _posix4=no
2692 cc_check -lposix4 && _posix4=yes
2693 if test "$_posix4" = yes ; then
2694 _ld_extra="$_ld_extra -lposix4"
2696 echores "$_posix4"
2698 echocheck "lrintf"
2699 cat > $TMPC << EOF
2700 #include <math.h>
2701 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2703 _lrintf=no
2704 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2705 if test "$_lrintf" = yes ; then
2706 _def_lrintf="#define HAVE_LRINTF 1"
2707 else
2708 _def_lrintf="#undef HAVE_LRINTF"
2710 echores "$_lrintf"
2712 echocheck "round"
2713 cat > $TMPC << EOF
2714 #include <math.h>
2715 int main(void) { (void) round(0.0); return 0; }
2717 _round=no
2718 cc_check $_ld_lm && _round=yes
2719 if test "$_round" = yes ; then
2720 _def_round="#define HAVE_ROUND 1"
2721 else
2722 _def_round="#undef HAVE_ROUND"
2724 echores "$_round"
2726 echocheck "nanosleep"
2727 # also check for nanosleep
2728 cat > $TMPC << EOF
2729 #include <time.h>
2730 int main(void) { (void) nanosleep(0, 0); return 0; }
2732 _nanosleep=no
2733 cc_check && _nanosleep=yes
2734 if test "$_nanosleep" = yes ; then
2735 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2736 else
2737 _def_nanosleep='#undef HAVE_NANOSLEEP'
2739 echores "$_nanosleep"
2742 echocheck "socklib"
2743 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2744 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2745 cat > $TMPC << EOF
2746 #include <netdb.h>
2747 #include <sys/socket.h>
2748 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2750 _socklib=no
2751 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2752 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2753 done
2754 if test $_winsock2 = auto && not cygwin ; then
2755 _winsock2=no
2756 cat > $TMPC << EOF
2757 #include <winsock2.h>
2758 int main(void) { (void) gethostbyname(0); return 0; }
2760 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2762 test "$_ld_sock" && _res_comment="using $_ld_sock"
2763 echores "$_socklib"
2766 if test $_winsock2 = yes ; then
2767 _ld_sock="-lws2_32"
2768 _def_winsock2='#define HAVE_WINSOCK2 1'
2769 else
2770 _def_winsock2='#undef HAVE_WINSOCK2'
2774 _use_aton=no
2775 echocheck "inet_pton()"
2776 cat > $TMPC << EOF
2777 #include <sys/types.h>
2778 #include <sys/socket.h>
2779 #include <arpa/inet.h>
2780 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2782 if test "$_winsock2" = yes ; then
2783 _res_comment="using winsock2 functions instead"
2784 echores "no"
2785 elif cc_check $_ld_sock ; then
2786 # NOTE: Linux has libresolv but does not need it
2788 _res_comment="using $_ld_sock"
2789 echores "yes"
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 echores "yes"
2795 else
2796 _res_comment="trying inet_aton next"
2797 echores "no"
2799 echocheck "inet_aton()"
2800 cat > $TMPC << EOF
2801 #include <sys/types.h>
2802 #include <sys/socket.h>
2803 #include <arpa/inet.h>
2804 int main(void) { (void) inet_aton(0, 0); return 0; }
2806 _use_aton=yes
2807 if cc_check $_ld_sock ; then
2808 # NOTE: Linux has libresolv but does not need it
2810 _res_comment="using $_ld_sock"
2811 elif cc_check $_ld_sock -lresolv ; then
2812 # NOTE: needed for SunOS at least
2813 _ld_sock="$_ld_sock -lresolv"
2814 _res_comment="using $_ld_sock"
2815 else
2816 _use_aton=no
2817 _network=no
2818 _res_comment="network support disabled"
2820 echores "$_use_aton"
2823 _def_use_aton='#undef USE_ATON'
2824 if test "$_use_aton" = yes; then
2825 _def_use_aton='#define USE_ATON 1'
2828 echocheck "network"
2829 # FIXME network check
2830 if test "$_network" = yes ; then
2831 _def_network='#define MPLAYER_NETWORK 1'
2832 _ld_extra="$_ld_extra $_ld_sock"
2833 _inputmodules="network $_inputmodules"
2834 else
2835 _noinputmodules="network $_noinputmodules"
2836 _def_network='#undef MPLAYER_NETWORK'
2837 _ftp=no
2839 echores "$_network"
2841 echocheck "inttypes.h (required)"
2842 cat > $TMPC << EOF
2843 #include <inttypes.h>
2844 int main(void) { return 0; }
2846 _inttypes=no
2847 cc_check && _inttypes=yes
2848 echores "$_inttypes"
2850 if test "$_inttypes" = no ; then
2851 echocheck "bitypes.h (inttypes.h predecessor)"
2852 cat > $TMPC << EOF
2853 #include <sys/bitypes.h>
2854 int main(void) { return 0; }
2856 cc_check && _inttypes=yes
2857 if test "$_inttypes" = yes ; then
2858 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."
2859 else
2860 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2865 echocheck "int_fastXY_t in inttypes.h"
2866 cat > $TMPC << EOF
2867 #include <inttypes.h>
2868 int main(void) {
2869 volatile int_fast16_t v= 0;
2870 return v; }
2872 _fast_inttypes=no
2873 cc_check && _fast_inttypes=yes
2874 if test "$_fast_inttypes" = yes ; then
2875 # nothing to do
2877 else
2878 _def_fast_inttypes='
2879 typedef signed char int_fast8_t;
2880 typedef signed int int_fast16_t;
2881 typedef signed int int_fast32_t;
2882 typedef signed long long int_fast64_t;
2883 typedef unsigned char uint_fast8_t;
2884 typedef unsigned int uint_fast16_t;
2885 typedef unsigned int uint_fast32_t;
2886 typedef unsigned long long uint_fast64_t;'
2888 echores "$_fast_inttypes"
2891 echocheck "word size"
2892 _mp_wordsize="#undef MP_WORDSIZE"
2893 cat > $TMPC << EOF
2894 #include <stdio.h>
2895 #include <sys/types.h>
2896 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2898 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2899 echores "$_wordsize"
2902 echocheck "stddef.h"
2903 cat > $TMPC << EOF
2904 #include <stddef.h>
2905 int main(void) { return 0; }
2907 _stddef=no
2908 cc_check && _stddef=yes
2909 if test "$_stddef" = yes ; then
2910 _def_stddef='#define HAVE_STDDEF_H 1'
2911 else
2912 _def_stddef='#undef HAVE_STDDEF_H'
2914 echores "$_stddef"
2917 echocheck "malloc.h"
2918 cat > $TMPC << EOF
2919 #include <malloc.h>
2920 int main(void) { (void) malloc(0); return 0; }
2922 _malloc=no
2923 cc_check && _malloc=yes
2924 if test "$_malloc" = yes ; then
2925 _def_malloc='#define HAVE_MALLOC_H 1'
2926 else
2927 _def_malloc='#undef HAVE_MALLOC_H'
2929 # malloc.h emits a warning in FreeBSD and OpenBSD
2930 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2931 echores "$_malloc"
2934 echocheck "memalign()"
2935 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2936 cat > $TMPC << EOF
2937 #include <malloc.h>
2938 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2940 _memalign=no
2941 cc_check && _memalign=yes
2942 if test "$_memalign" = yes ; then
2943 _def_memalign='#define HAVE_MEMALIGN 1'
2944 else
2945 _def_memalign='#undef HAVE_MEMALIGN'
2946 _def_map_memalign='#define memalign(a,b) malloc(b)'
2947 not darwin && _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2949 echores "$_memalign"
2952 echocheck "alloca.h"
2953 cat > $TMPC << EOF
2954 #include <alloca.h>
2955 int main(void) { (void) alloca(0); return 0; }
2957 _alloca=no
2958 cc_check && _alloca=yes
2959 if cc_check ; then
2960 _def_alloca='#define HAVE_ALLOCA_H 1'
2961 else
2962 _def_alloca='#undef HAVE_ALLOCA_H'
2964 echores "$_alloca"
2967 echocheck "mman.h"
2968 cat > $TMPC << EOF
2969 #include <sys/types.h>
2970 #include <sys/mman.h>
2971 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2973 _mman=no
2974 cc_check && _mman=yes
2975 if test "$_mman" = yes ; then
2976 _def_mman='#define HAVE_SYS_MMAN_H 1'
2977 else
2978 _def_mman='#undef HAVE_SYS_MMAN_H'
2980 echores "$_mman"
2982 cat > $TMPC << EOF
2983 #include <sys/types.h>
2984 #include <sys/mman.h>
2985 int main(void) { void *p = MAP_FAILED; return 0; }
2987 _mman_has_map_failed=no
2988 cc_check && _mman_has_map_failed=yes
2989 if test "$_mman_has_map_failed" = yes ; then
2990 _def_mman_has_map_failed=''
2991 else
2992 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2995 echocheck "dynamic loader"
2996 cat > $TMPC << EOF
2997 #include <dlfcn.h>
2998 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3000 _dl=no
3001 for _ld_tmp in "" "-ldl" ; do
3002 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3003 done
3004 if test "$_dl" = yes ; then
3005 _def_dl='#define HAVE_LIBDL 1'
3006 else
3007 _def_dl='#undef HAVE_LIBDL'
3009 echores "$_dl"
3012 echocheck "dynamic a/v plugins support"
3013 if test "$_dl" = no ; then
3014 _dynamic_plugins=no
3016 if test "$_dynamic_plugins" = yes ; then
3017 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3018 else
3019 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3021 echores "$_dynamic_plugins"
3024 #echocheck "dynamic linking"
3025 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
3026 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
3027 #cat > $TMPC << EOF
3028 #int main(void) { return 0; }
3029 #EOF
3030 #if cc_check -rdynamic ; then
3031 # _ld_dl_dynamic='-rdynamic'
3032 #elif cc_check -Bdynamic ; then
3033 # _ld_dl_dynamic='-Bdynamic'
3034 #elif cc_check ; then
3035 # _ld_dl_dynamic=''
3037 #echores "using $_ld_dl_dynamic"
3039 _def_threads='#undef HAVE_THREADS'
3041 echocheck "pthread"
3042 if test "$_pthreads" = auto ; then
3043 cat > $TMPC << EOF
3044 #include <pthread.h>
3045 void* func(void *arg) { return arg; }
3046 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3048 _pthreads=no
3049 if not hpux ; then
3050 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3051 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3052 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3053 done
3056 if test "$_pthreads" = yes ; then
3057 _res_comment="using $_ld_pthread"
3058 _def_pthreads='#define HAVE_PTHREADS 1'
3059 _def_threads='#define HAVE_THREADS 1'
3060 else
3061 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3062 _def_pthreads='#undef HAVE_PTHREADS'
3063 _nas=no ; _tv_v4l1=no ; _macosx=no
3064 if not mingw32 ; then
3065 _win32dll=no
3068 echores "$_pthreads"
3070 echocheck "rpath"
3071 netbsd &&_rpath=yes
3072 if test "$_rpath" = yes ; then
3073 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3074 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3075 done
3076 _ld_extra=$tmp
3078 echores "$_rpath"
3080 echocheck "iconv"
3081 if test "$_iconv" = auto ; then
3082 _iconv_tmp='#include <iconv.h>'
3084 cat > $TMPC << EOF
3085 #include <stdio.h>
3086 #include <unistd.h>
3087 $_iconv_tmp
3088 #define INBUFSIZE 1024
3089 #define OUTBUFSIZE 4096
3091 char inbuffer[INBUFSIZE];
3092 char outbuffer[OUTBUFSIZE];
3094 int main(void) {
3095 size_t numread;
3096 iconv_t icdsc;
3097 char *tocode="UTF-8";
3098 char *fromcode="cp1250";
3099 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3100 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3101 char *iptr=inbuffer;
3102 char *optr=outbuffer;
3103 size_t inleft=numread;
3104 size_t outleft=OUTBUFSIZE;
3105 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3106 != (size_t)(-1)) {
3107 write (1, outbuffer, OUTBUFSIZE - outleft);
3110 if (iconv_close(icdsc) == -1)
3115 _iconv=no
3116 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3117 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3118 _iconv=yes && break
3119 done
3121 if test "$_iconv" = yes ; then
3122 _def_iconv='#define USE_ICONV 1'
3123 else
3124 _def_iconv='#undef USE_ICONV'
3126 echores "$_iconv"
3129 echocheck "sys/soundcard.h"
3130 cat > $TMPC << EOF
3131 #include <sys/soundcard.h>
3132 int main(void) { return 0; }
3134 _sys_soundcard=no
3135 cc_check && _sys_soundcard=yes
3136 if test "$_sys_soundcard" = yes ; then
3137 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3138 _include_soundcard='#include <sys/soundcard.h>'
3139 else
3140 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3142 echores "$_sys_soundcard"
3144 if test "$_sys_soundcard" != yes ; then
3145 echocheck "soundcard.h"
3146 cat > $TMPC << EOF
3147 #include <soundcard.h>
3148 int main(void) { return 0; }
3150 _soundcard=no
3151 cc_check && _soundcard=yes
3152 if linux || test "$_ossaudio" != no ; then
3153 # use soundcard.h on Linux, or when OSS support is enabled
3154 echores "$_soundcard"
3155 else
3156 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
3157 _res_comment= "but ignored!"
3158 echores "$_soundcard"
3159 _soundcard=no
3161 if test "$_soundcard" = yes ; then
3162 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3163 _include_soundcard='#include <soundcard.h>'
3164 else
3165 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3167 else
3168 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3172 echocheck "sys/dvdio.h"
3173 cat > $TMPC << EOF
3174 #include <unistd.h>
3175 #include <sys/dvdio.h>
3176 int main(void) { return 0; }
3178 _dvdio=no
3179 cc_check && _dvdio=yes
3180 if test "$_dvdio" = yes ; then
3181 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3182 else
3183 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3185 echores "$_dvdio"
3188 echocheck "sys/cdio.h"
3189 cat > $TMPC << EOF
3190 #include <unistd.h>
3191 #include <sys/cdio.h>
3192 int main(void) { return 0; }
3194 _cdio=no
3195 cc_check && _cdio=yes
3196 if test "$_cdio" = yes ; then
3197 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3198 else
3199 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3201 echores "$_cdio"
3204 echocheck "linux/cdrom.h"
3205 cat > $TMPC << EOF
3206 #include <sys/types.h>
3207 #include <linux/cdrom.h>
3208 int main(void) { return 0; }
3210 _cdrom=no
3211 cc_check && _cdrom=yes
3212 if test "$_cdrom" = yes ; then
3213 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3214 else
3215 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3217 echores "$_cdrom"
3220 echocheck "dvd.h"
3221 cat > $TMPC << EOF
3222 #include <dvd.h>
3223 int main(void) { return 0; }
3225 _dvd=no
3226 cc_check && _dvd=yes
3227 if test "$_dvd" = yes ; then
3228 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3229 else
3230 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3232 echores "$_dvd"
3235 if bsdos; then
3236 echocheck "BSDI dvd.h"
3237 cat > $TMPC << EOF
3238 #include <dvd.h>
3239 int main(void) { return 0; }
3241 _bsdi_dvd=no
3242 cc_check && _bsdi_dvd=yes
3243 if test "$_bsdi_dvd" = yes ; then
3244 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3245 else
3246 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3248 echores "$_bsdi_dvd"
3249 fi #if bsdos
3252 if hpux; then
3253 # also used by AIX, but AIX does not support VCD and/or libdvdread
3254 echocheck "HP-UX SCSI header"
3255 cat > $TMPC << EOF
3256 #include <sys/scsi.h>
3257 int main(void) { return 0; }
3259 _hpux_scsi_h=no
3260 cc_check && _hpux_scsi_h=yes
3261 if test "$_hpux_scsi_h" = yes ; then
3262 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3263 else
3264 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3266 echores "$_hpux_scsi_h"
3267 fi #if hpux
3270 if sunos; then
3271 echocheck "userspace SCSI headers (Solaris)"
3272 cat > $TMPC << EOF
3273 # include <unistd.h>
3274 # include <stropts.h>
3275 # include <sys/scsi/scsi_types.h>
3276 # include <sys/scsi/impl/uscsi.h>
3277 int main(void) { return 0; }
3279 _sol_scsi_h=no
3280 cc_check && _sol_scsi_h=yes
3281 if test "$_sol_scsi_h" = yes ; then
3282 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3283 else
3284 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3286 echores "$_sol_scsi_h"
3287 fi #if sunos
3290 echocheck "termcap"
3291 if test "$_termcap" = auto ; then
3292 cat > $TMPC <<EOF
3293 int main(void) { tgetent(); return 0; }
3295 _termcap=no
3296 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3297 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3298 && _termcap=yes && break
3299 done
3301 if test "$_termcap" = yes ; then
3302 _def_termcap='#define USE_TERMCAP 1'
3303 _res_comment="using $_ld_tmp"
3304 else
3305 _def_termcap='#undef USE_TERMCAP'
3307 echores "$_termcap"
3310 echocheck "termios"
3311 if test "$_termios" = auto ; then
3312 cat > $TMPC <<EOF
3313 #include <sys/termios.h>
3314 int main(void) { return 0; }
3316 _termios=auto
3317 cc_check && _termios=yes
3318 _def_termios_h_name='sys/termios.h'
3320 # second test:
3321 if test "$_termios" = auto ; then
3322 cat > $TMPC <<EOF
3323 #include <termios.h>
3324 int main(void) { return 0; }
3326 _termios=no
3327 cc_check && _termios=yes
3328 _def_termios_h_name='termios.h'
3331 if test "$_termios" = yes ; then
3332 _def_termios='#define HAVE_TERMIOS 1'
3333 _def_termios_h='#undef HAVE_TERMIOS_H'
3334 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3336 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3337 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3338 elif test "$_def_termios_h_name" = 'termios.h' ; then
3339 _def_termios_h='#define HAVE_TERMIOS_H 1'
3341 _res_comment="using $_def_termios_h_name"
3342 else
3343 _def_termios='#undef HAVE_TERMIOS'
3344 _def_termios_h_name=''
3345 _termios=no
3347 echores "$_termios"
3350 echocheck "shm"
3351 if test "$_shm" = auto ; then
3352 cat > $TMPC << EOF
3353 #include <sys/types.h>
3354 #include <sys/shm.h>
3355 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3357 _shm=no
3358 cc_check && _shm=yes
3360 if test "$_shm" = yes ; then
3361 _def_shm='#define HAVE_SHM 1'
3362 else
3363 _def_shm='#undef HAVE_SHM'
3365 echores "$_shm"
3368 # XXX: FIXME, add runtime checking
3369 echocheck "linux devfs"
3370 echores "$_linux_devfs"
3373 echocheck "scandir()"
3374 cat > $TMPC << EOF
3375 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3377 _scandir=no
3378 cc_check && _scandir=yes
3379 if test "$_scandir" = yes ; then
3380 _def_scandir='#define HAVE_SCANDIR 1'
3381 _need_scandir=no
3382 else
3383 _def_scandir='#undef HAVE_SCANDIR'
3384 _need_scandir=yes
3386 echores "$_scandir"
3389 echocheck "strsep()"
3390 cat > $TMPC << EOF
3391 #include <string.h>
3392 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3394 _strsep=no
3395 cc_check && _strsep=yes
3396 if test "$_strsep" = yes ; then
3397 _def_strsep='#define HAVE_STRSEP 1'
3398 _need_strsep=no
3399 else
3400 _def_strsep='#undef HAVE_STRSEP'
3401 _need_strsep=yes
3403 echores "$_strsep"
3405 echocheck "strlcpy()"
3406 cat > $TMPC << EOF
3407 #include <string.h>
3408 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3410 _strlcpy=no
3411 cc_check && _strlcpy=yes
3412 if test "$_strlcpy" = yes ; then
3413 _def_strlcpy='#define HAVE_STRLCPY 1'
3414 _need_strlcpy=no
3415 else
3416 _def_strlcpy='#undef HAVE_STRLCPY'
3417 _need_strlcpy=yes
3419 echores "$_strlcpy"
3421 echocheck "strlcat()"
3422 cat > $TMPC << EOF
3423 #include <string.h>
3424 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3426 _strlcat=no
3427 cc_check && _strlcat=yes
3428 if test "$_strlcat" = yes ; then
3429 _def_strlcat='#define HAVE_STRLCAT 1'
3430 _need_strlcat=no
3431 else
3432 _def_strlcat='#undef HAVE_STRLCAT'
3433 _need_strlcat=yes
3435 echores "$_strlcat"
3437 echocheck "fseeko()"
3438 cat > $TMPC << EOF
3439 #include <stdio.h>
3440 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3442 _fseeko=no
3443 cc_check && _fseeko=yes
3444 if test "$_fseeko" = yes ; then
3445 _def_fseeko='#define HAVE_FSEEKO 1'
3446 _need_fseeko=no
3447 else
3448 _def_fseeko='#undef HAVE_FSEEKO'
3449 _need_fseeko=yes
3451 echores "$_fseeko"
3453 echocheck "localtime_r()"
3454 cat > $TMPC << EOF
3455 #include <time.h>
3456 int main( void ) { localtime_r(NULL, NULL); }
3458 _localtime_r=no
3459 cc_check && _localtime_r=yes
3460 if test "$_localtime_r" = yes ; then
3461 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3462 else
3463 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3465 echores "$_localtime_r"
3467 echocheck "vsscanf()"
3468 cat > $TMPC << EOF
3469 #include <stdarg.h>
3470 int main(void) { vsscanf(0, 0, 0); return 0; }
3472 _vsscanf=no
3473 cc_check && _vsscanf=yes
3474 if test "$_vsscanf" = yes ; then
3475 _def_vsscanf='#define HAVE_VSSCANF 1'
3476 _need_vsscanf=no
3477 else
3478 _def_vsscanf='#undef HAVE_VSSCANF'
3479 _need_vsscanf=yes
3481 echores "$_vsscanf"
3484 echocheck "swab()"
3485 cat > $TMPC << EOF
3486 #include <unistd.h>
3487 int main(void) { swab(0, 0, 0); return 0; }
3489 _swab=no
3490 cc_check && _swab=yes
3491 if test "$_swab" = yes ; then
3492 _def_swab='#define HAVE_SWAB 1'
3493 _need_swab=no
3494 else
3495 _def_swab='#undef HAVE_SWAB'
3496 _need_swab=yes
3498 echores "$_swab"
3500 echocheck "POSIX select()"
3501 cat > $TMPC << EOF
3502 #include <stdio.h>
3503 #include <stdlib.h>
3504 #include <sys/types.h>
3505 #include <string.h>
3506 #include <sys/time.h>
3507 #include <unistd.h>
3508 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3510 _posix_select=no
3511 _def_posix_select='#undef HAVE_POSIX_SELECT'
3512 cc_check && _posix_select=yes \
3513 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3514 echores "$_posix_select"
3517 echocheck "gettimeofday()"
3518 cat > $TMPC << EOF
3519 #include <stdio.h>
3520 #include <sys/time.h>
3521 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3523 _gettimeofday=no
3524 cc_check && _gettimeofday=yes
3525 if test "$_gettimeofday" = yes ; then
3526 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3527 _need_gettimeofday=no
3528 else
3529 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3530 _need_gettimeofday=yes
3532 echores "$_gettimeofday"
3535 echocheck "glob()"
3536 cat > $TMPC << EOF
3537 #include <stdio.h>
3538 #include <glob.h>
3539 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3541 _glob=no
3542 cc_check && _glob=yes
3543 if test "$_glob" = yes ; then
3544 _def_glob='#define HAVE_GLOB 1'
3545 _need_glob=no
3546 else
3547 _def_glob='#undef HAVE_GLOB'
3548 _need_glob=yes
3550 echores "$_glob"
3553 echocheck "setenv()"
3554 cat > $TMPC << EOF
3555 #include <stdlib.h>
3556 int main (void){ setenv("","",0); return 0; }
3558 _setenv=no
3559 cc_check && _setenv=yes
3560 if test "$_setenv" = yes ; then
3561 _def_setenv='#define HAVE_SETENV 1'
3562 _need_setenv=no
3563 else
3564 _def_setenv='#undef HAVE_SETENV'
3565 _need_setenv=yes
3567 echores "$_setenv"
3570 if sunos; then
3571 echocheck "sysi86()"
3572 cat > $TMPC << EOF
3573 #include <sys/sysi86.h>
3574 int main (void) { sysi86(0); return 0; }
3576 _sysi86=no
3577 cc_check && _sysi86=yes
3578 if test "$_sysi86" = yes ; then
3579 _def_sysi86='#define HAVE_SYSI86 1'
3580 cat > $TMPC << EOF
3581 #include <sys/sysi86.h>
3582 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3584 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3585 else
3586 _def_sysi86='#undef HAVE_SYSI86'
3588 echores "$_sysi86"
3589 fi #if sunos
3592 echocheck "sys/sysinfo.h"
3593 cat > $TMPC << EOF
3594 #include <sys/sysinfo.h>
3595 int main(void) {
3596 struct sysinfo s_info;
3597 sysinfo(&s_info);
3598 return 0;
3601 _sys_sysinfo=no
3602 cc_check && _sys_sysinfo=yes
3603 if test "$_sys_sysinfo" = yes ; then
3604 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3605 else
3606 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3608 echores "$_sys_sysinfo"
3611 if darwin; then
3613 echocheck "Mac OS X APIs"
3614 if test "$_macosx" = auto ; then
3615 productName=`/usr/bin/sw_vers -productName`
3616 if test "$productName" = "Mac OS X" ||
3617 test "$productName" = "Mac OS X Server" ; then
3618 _macosx=yes
3619 else
3620 _macosx=no
3621 _def_macosx='#undef MACOSX'
3622 _noaomodules="macosx $_noaomodules"
3623 _novomodules="quartz $_novomodules"
3626 if test "$_macosx" = yes ; then
3627 cat > $TMPC <<EOF
3628 #include <Carbon/Carbon.h>
3629 #include <QuickTime/QuickTime.h>
3630 #include <CoreAudio/CoreAudio.h>
3631 int main(void) {
3632 EnterMovies();
3633 ExitMovies();
3634 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3637 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3638 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3639 _def_macosx='#define MACOSX 1'
3640 _aosrc="$_aosrc ao_macosx.c"
3641 _aomodules="macosx $_aomodules"
3642 _vosrc="$_vosrc vo_quartz.c"
3643 _vomodules="quartz $_vomodules"
3644 else
3645 _macosx=no
3646 _def_macosx='#undef MACOSX'
3647 _noaomodules="macosx $_noaomodules"
3648 _novomodules="quartz $_novomodules"
3650 cat > $TMPC <<EOF
3651 #include <Carbon/Carbon.h>
3652 #include <QuartzCore/CoreVideo.h>
3653 int main(void) {}
3655 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3656 _vosrc="$_vosrc vo_macosx.m"
3657 _vomodules="macosx $_vomodules"
3658 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3659 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3660 _macosx_corevideo=yes
3661 else
3662 _novomodules="macosx $_novomodules"
3663 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3664 _macosx_corevideo=no
3667 echores "$_macosx"
3669 echocheck "Mac OS X Finder Support"
3670 if test "$_macosx_finder_support" = auto ; then
3671 _macosx_finder_support=$_macosx
3673 if test "$_macosx_finder_support" = yes; then
3674 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3675 _macosx_finder_support=yes
3676 else
3677 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3678 _macosx_finder_support=no
3680 echores "$_macosx_finder_support"
3682 echocheck "Mac OS X Bundle file locations"
3683 if test "$_macosx_bundle" = auto ; then
3684 _macosx_bundle=$_macosx_finder_support
3686 if test "$_macosx_bundle" = yes; then
3687 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3688 else
3689 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3690 _macosx_bundle=no
3692 echores "$_macosx_bundle"
3694 fi #if darwin
3697 echocheck "pkg-config"
3698 _pkg_config=pkg-config
3699 if `$_pkg_config --version > /dev/null 2>&1`; then
3700 echores "yes"
3701 else
3702 _pkg_config=false
3703 echores "no"
3707 echocheck "Samba support (libsmbclient)"
3708 if test "$_smbsupport" = yes; then
3709 _ld_extra="$_ld_extra -lsmbclient"
3711 if test "$_smbsupport" = auto; then
3712 _smbsupport=no
3713 cat > $TMPC << EOF
3714 #include <libsmbclient.h>
3715 int main(void) { smbc_opendir("smb://"); return 0; }
3717 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3718 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3719 _smbsupport=yes && break
3720 done
3723 if test "$_smbsupport" = yes; then
3724 _def_smbsupport="#define LIBSMBCLIENT"
3725 _inputmodules="smb $_inputmodules"
3726 else
3727 _def_smbsupport="#undef LIBSMBCLIENT"
3728 _noinputmodules="smb $_noinputmodules"
3730 echores "$_smbsupport"
3733 #########
3734 # VIDEO #
3735 #########
3738 echocheck "3dfx"
3739 if test "$_3dfx" = yes ; then
3740 _def_3dfx='#define HAVE_3DFX 1'
3741 _vosrc="$_vosrc vo_3dfx.c"
3742 _vomodules="3dfx $_vomodules"
3743 else
3744 _def_3dfx='#undef HAVE_3DFX'
3745 _novomodules="3dfx $_novomodules"
3747 echores "$_3dfx"
3750 echocheck "tdfxfb"
3751 if test "$_tdfxfb" = yes ; then
3752 _def_tdfxfb='#define HAVE_TDFXFB 1'
3753 _vosrc="$_vosrc vo_tdfxfb.c"
3754 _vomodules="tdfxfb $_vomodules"
3755 else
3756 _def_tdfxfb='#undef HAVE_TDFXFB'
3757 _novomodules="tdfxfb $_novomodules"
3759 echores "$_tdfxfb"
3761 echocheck "s3fb"
3762 if test "$_s3fb" = yes ; then
3763 _def_s3fb='#define HAVE_S3FB 1'
3764 _vosrc="$_vosrc vo_s3fb.c"
3765 _vomodules="s3fb $_vomodules"
3766 else
3767 _def_s3fb='#undef HAVE_S3FB'
3768 _novomodules="s3fb $_novomodules"
3770 echores "$_s3fb"
3772 echocheck "tdfxvid"
3773 if test "$_tdfxvid" = yes ; then
3774 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3775 _vosrc="$_vosrc vo_tdfx_vid.c"
3776 _vomodules="tdfx_vid $_vomodules"
3777 else
3778 _def_tdfxvid='#undef HAVE_TDFX_VID'
3779 _novomodules="tdfx_vid $_novomodules"
3781 echores "$_tdfxvid"
3783 echocheck "tga"
3784 if test "$_tga" = yes ; then
3785 _def_tga='#define HAVE_TGA 1'
3786 _vosrc="$_vosrc vo_tga.c"
3787 _vomodules="tga $_vomodules"
3788 else
3789 _def_tga='#undef HAVE_TGA'
3790 _novomodules="tga $_novomodules"
3792 echores "$_tga"
3795 echocheck "DirectFB"
3796 if test "$_directfb" = auto ; then
3797 _directfb=no
3798 cat > $TMPC <<EOF
3799 #include <directfb.h>
3800 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3802 for _inc_tmp in "" -I/usr/local/include/directfb \
3803 -I/usr/include/directfb -I/usr/local/include -I/usr/include; do
3804 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3805 _inc_extra="$_inc_extra $_inc_tmp" && break
3806 done
3809 dfb_version() {
3810 expr $1 \* 65536 + $2 \* 256 + $3
3813 if test "$_directfb" = yes; then
3814 cat > $TMPC << EOF
3815 #include <directfb_version.h>
3817 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3820 if $_cc -E $TMPC $_inc_extra > "$TMPO"; then
3821 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPO" | tr -d '()'`
3822 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3823 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3824 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3825 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3826 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3827 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3828 _res_comment="$_directfb_version"
3829 else
3830 _def_directfb_version='#undef DIRECTFBVERSION'
3831 _directfb=no
3832 _res_comment="version >=0.9.13 required"
3834 else
3835 _directfb=no
3836 _res_comment="failed to get version"
3839 echores "$_directfb"
3841 if test "$_directfb" = yes ; then
3842 _def_directfb='#define HAVE_DIRECTFB 1'
3843 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3844 _vosrc="$_vosrc vo_directfb2.c"
3845 _vomodules="directfb $_vomodules"
3846 _libs_mplayer="$_libs_mplayer -ldirectfb"
3847 else
3848 _novomodules="directfb $_novomodules"
3851 if test "$_dfb_version" -ge `dfb_version 0 9 15`; then
3852 _vosrc="$_vosrc vo_dfbmga.c"
3853 _vomodules="dfbmga $_vomodules"
3854 _def_dfbmga='#define HAVE_DFBMGA 1'
3855 else
3856 _novomodules="dfbmga $_novomodules"
3857 _def_dfbmga='#undef HAVE_DFBMGA'
3859 else
3860 _def_directfb='#undef HAVE_DIRECTFB'
3861 _novomodules="dfbmga directfb $_novomodules"
3865 echocheck "X11 headers presence"
3866 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
3867 if test -f "$I/X11/Xlib.h" ; then
3868 _inc_x11="-I$I"
3869 _x11_headers="yes"
3870 _res_comment="using $I"
3871 break
3873 done
3874 if test -z "$_inc_x11" ; then
3875 _x11=no
3876 _x11_headers="no"
3877 _res_comment="check if the dev(el) packages are installed"
3879 echores "$_x11_headers"
3882 echocheck "X11"
3883 if test "$_x11" != no ; then
3884 cat > $TMPC <<EOF
3885 #include <X11/Xlib.h>
3886 #include <X11/Xutil.h>
3887 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3889 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3890 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3891 if netbsd; then
3892 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3893 else
3894 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3896 cc_check $_inc_x11 $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3897 && _x11=yes && break
3898 done
3900 if test "$_x11" = yes ; then
3901 #FIXME: This is ugly as it can duplicate a -I parameter..
3902 _inc_extra="$_inc_extra $_inc_x11"
3903 _def_x11='#define HAVE_X11 1'
3904 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3905 _vomodules="x11 xover $_vomodules"
3906 else
3907 _x11=no
3908 _def_x11='#undef HAVE_X11'
3909 _novomodules="x11 $_novomodules"
3910 _res_comment="check if the dev(el) packages are installed"
3911 # disable stuff that depends on X
3912 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _dga=no
3914 echores "$_x11"
3917 echocheck "DPMS"
3918 _xdpms3=no
3919 _xdpms4=no
3920 if test "$_x11" = yes ; then
3921 cat > $TMPC <<EOF
3922 #include <X11/Xmd.h>
3923 #include <X11/Xlib.h>
3924 #include <X11/Xutil.h>
3925 #include <X11/Xatom.h>
3926 #include <X11/extensions/dpms.h>
3927 int main(void) {
3928 (void) DPMSQueryExtension(0, 0, 0);
3931 cc_check -lXdpms && _xdpms3=yes
3932 cat > $TMPC <<EOF
3933 #include <X11/Xlib.h>
3934 #include <X11/extensions/dpms.h>
3935 int main(void) {
3936 (void) DPMSQueryExtension(0, 0, 0);
3939 cc_check && _xdpms4=yes
3941 if test "$_xdpms4" = yes ; then
3942 _def_xdpms='#define HAVE_XDPMS 1'
3943 _res_comment="using Xdpms 4"
3944 echores "yes"
3945 elif test "$_xdpms3" = yes ; then
3946 _def_xdpms='#define HAVE_XDPMS 1'
3947 _libs_mplayer="$_libs_mplayer -lXdpms"
3948 _res_comment="using Xdpms 3"
3949 echores "yes"
3950 else
3951 _def_xdpms='#undef HAVE_XDPMS'
3952 echores "no"
3956 echocheck "Xv"
3957 if test "$_xv" = auto ; then
3958 cat > $TMPC <<EOF
3959 #include <X11/Xlib.h>
3960 #include <X11/extensions/Xvlib.h>
3961 int main(void) {
3962 (void) XvGetPortAttribute(0, 0, 0, 0);
3963 (void) XvQueryPortAttributes(0, 0, 0);
3964 return 0; }
3966 _xv=no
3967 cc_check -lXv && _xv=yes
3970 if test "$_xv" = yes ; then
3971 _def_xv='#define HAVE_XV 1'
3972 _libs_mplayer="$_libs_mplayer -lXv"
3973 _vosrc="$_vosrc vo_xv.c"
3974 _vomodules="xv $_vomodules"
3975 else
3976 _def_xv='#undef HAVE_XV'
3977 _novomodules="xv $_novomodules"
3979 echores "$_xv"
3982 echocheck "XvMC"
3983 if test "$_xv" = yes && test "$_xvmc" != no ; then
3984 _xvmc=no
3985 cat > $TMPC <<EOF
3986 #include <X11/Xlib.h>
3987 #include <X11/extensions/Xvlib.h>
3988 #include <X11/extensions/XvMClib.h>
3989 int main(void) {
3990 (void) XvMCQueryExtension(0,0,0);
3991 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3992 return 0; }
3994 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3995 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3996 done
3998 if test "$_xvmc" = yes ; then
3999 _def_xvmc='#define HAVE_XVMC 1'
4000 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
4001 _vosrc="$_vosrc vo_xvmc.c"
4002 _vomodules="xvmc $_vomodules"
4003 _res_comment="using $_xvmclib"
4004 else
4005 _def_xvmc='#undef HAVE_XVMC'
4006 _novomodules="xvmc $_novomodules"
4007 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4009 echores "$_xvmc"
4012 echocheck "Xinerama"
4013 if test "$_xinerama" = auto ; then
4014 cat > $TMPC <<EOF
4015 #include <X11/Xlib.h>
4016 #include <X11/extensions/Xinerama.h>
4017 int main(void) { (void) XineramaIsActive(0); return 0; }
4019 _xinerama=no
4020 cc_check -lXinerama && _xinerama=yes
4023 if test "$_xinerama" = yes ; then
4024 _def_xinerama='#define HAVE_XINERAMA 1'
4025 _libs_mplayer="$_libs_mplayer -lXinerama"
4026 else
4027 _def_xinerama='#undef HAVE_XINERAMA'
4029 echores "$_xinerama"
4032 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4033 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4034 # named 'X extensions' or something similar.
4035 # This check may be useful for future mplayer versions (to change resolution)
4036 # If you run into problems, remove '-lXxf86vm'.
4037 echocheck "Xxf86vm"
4038 if test "$_vm" = auto ; then
4039 cat > $TMPC <<EOF
4040 #include <X11/Xlib.h>
4041 #include <X11/extensions/xf86vmode.h>
4042 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4044 _vm=no
4045 cc_check -lXxf86vm && _vm=yes
4047 if test "$_vm" = yes ; then
4048 _def_vm='#define HAVE_XF86VM 1'
4049 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4050 else
4051 _def_vm='#undef HAVE_XF86VM'
4053 echores "$_vm"
4055 # Check for the presence of special keycodes, like audio control buttons
4056 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4057 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4058 # have these new keycodes.
4059 echocheck "XF86keysym"
4060 if test "$_xf86keysym" = auto; then
4061 _xf86keysym=no
4062 cat > $TMPC <<EOF
4063 #include <X11/Xlib.h>
4064 #include <X11/XF86keysym.h>
4065 int main(void) { return XF86XK_AudioPause; }
4067 cc_check && _xf86keysym=yes
4069 if test "$_xf86keysym" = yes ; then
4070 _def_xf86keysym='#define HAVE_XF86XK 1'
4071 else
4072 _def_xf86keysym='#undef HAVE_XF86XK'
4074 echores "$_xf86keysym"
4076 echocheck "DGA"
4077 # Version 2 is preferred to version 1 if available
4078 if test "$_dga" = auto ; then
4079 cat > $TMPC << EOF
4080 #include <X11/Xlib.h>
4081 #include <X11/extensions/xf86dga.h>
4082 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4084 _dga=no
4085 cc_check -lXxf86dga -lXxf86vm && _dga=1
4087 cat > $TMPC << EOF
4088 #include <X11/Xlib.h>
4089 #include <X11/extensions/xf86dga.h>
4090 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4092 cc_check -lXxf86dga && _dga=2
4095 _def_dga='#undef HAVE_DGA'
4096 _def_dga2='#undef HAVE_DGA2'
4097 if test "$_dga" = 1 ; then
4098 _def_dga='#define HAVE_DGA 1'
4099 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4100 _vosrc="$_vosrc vo_dga.c"
4101 _vomodules="dga $_vomodules"
4102 _res_comment="using DGA 1.0"
4103 elif test "$_dga" = 2 ; then
4104 _def_dga='#define HAVE_DGA 1'
4105 _def_dga2='#define HAVE_DGA2 1'
4106 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4107 _vosrc="$_vosrc vo_dga.c"
4108 _vomodules="dga $_vomodules"
4109 _res_comment="using DGA 2.0"
4110 elif test "$_dga" = no ; then
4111 _novomodules="dga $_novomodules"
4112 else
4113 die "DGA version must be 1 or 2"
4115 echores "$_dga"
4118 echocheck "OpenGL"
4119 #Note: this test is run even with --enable-gl since we autodetect linker flags
4120 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4121 cat > $TMPC << EOF
4122 #include <GL/gl.h>
4123 int main(void) { return 0; }
4125 _gl=no
4126 if cc_check -lGL $_ld_lm ; then
4127 _gl=yes
4128 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4129 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4130 _gl=yes
4131 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4132 elif cc_check -lopengl32 ; then
4133 _gl=yes
4134 _gl_win32=yes
4135 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4137 else
4138 _gl=no
4140 if test "$_gl" = yes ; then
4141 _def_gl='#define HAVE_GL 1'
4142 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4143 if test "$_gl_win32" = yes ; then
4144 _def_gl_win32='#define GL_WIN32 1'
4145 _vosrc="$_vosrc w32_common.c"
4146 _res_comment="win32 version"
4148 _vomodules="opengl $_vomodules"
4149 else
4150 _def_gl='#undef HAVE_GL'
4151 _def_gl_win32='#undef GL_WIN32'
4152 _novomodules="opengl $_novomodules"
4154 echores "$_gl"
4157 echocheck "/dev/mga_vid"
4158 if test "$_mga" = auto ; then
4159 _mga=no
4160 test -c /dev/mga_vid && _mga=yes
4162 if test "$_mga" = yes ; then
4163 _def_mga='#define HAVE_MGA 1'
4164 _vosrc="$_vosrc vo_mga.c"
4165 _vomodules="mga $_vomodules"
4166 else
4167 _def_mga='#undef HAVE_MGA'
4168 _novomodules="mga $_novomodules"
4170 echores "$_mga"
4173 # echocheck "syncfb"
4174 # _syncfb=no
4175 # test "$_mga" = yes && _syncfb=yes
4176 # if test "$_syncfb" = yes ; then
4177 # _def_syncfb='#define HAVE_SYNCFB 1'
4178 # _vosrc="$_vosrc vo_syncfb.c"
4179 # else
4180 # _def_syncfb='#undef HAVE_SYNCFB'
4181 # fi
4182 # echores "$_syncfb"
4185 echocheck "xmga"
4186 if test "$_xmga" = auto ; then
4187 _xmga=no
4188 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4190 if test "$_xmga" = yes ; then
4191 _def_xmga='#define HAVE_XMGA 1'
4192 _vosrc="$_vosrc vo_xmga.c"
4193 _vomodules="xmga $_vomodules"
4194 else
4195 _def_xmga='#undef HAVE_XMGA'
4196 _novomodules="xmga $_novomodules"
4198 echores "$_xmga"
4201 echocheck "GGI"
4202 if test "$_ggi" = auto ; then
4203 cat > $TMPC << EOF
4204 #include <ggi/ggi.h>
4205 int main(void) { return 0; }
4207 _ggi=no
4208 cc_check -lggi && _ggi=yes
4210 if test "$_ggi" = yes ; then
4211 _def_ggi='#define HAVE_GGI 1'
4212 _libs_mplayer="$_libs_mplayer -lggi"
4213 _vosrc="$_vosrc vo_ggi.c"
4214 _vomodules="ggi $_vomodules"
4215 else
4216 _def_ggi='#undef HAVE_GGI'
4217 _novomodules="ggi $_novomodules"
4219 echores "$_ggi"
4221 echocheck "GGI extension: libggiwmh"
4222 if test "$_ggiwmh" = auto ; then
4223 _ggiwmh=no
4224 cat > $TMPC << EOF
4225 #include <ggi/ggi.h>
4226 #include <ggi/wmh.h>
4227 int main(void) { return 0; }
4229 cc_check -lggi -lggiwmh && _ggiwmh=yes
4231 # needed to get right output on obscure combination
4232 # like --disable-ggi --enable-ggiwmh
4233 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4234 _def_ggiwmh='#define HAVE_GGIWMH 1'
4235 _libs_mplayer="$_libs_mplayer -lggiwmh"
4236 else
4237 _ggiwmh=no
4238 _def_ggiwmh='#undef HAVE_GGIWMH'
4240 echores "$_ggiwmh"
4243 echocheck "AA"
4244 if test "$_aa" = auto ; then
4245 cat > $TMPC << EOF
4246 #include <aalib.h>
4247 extern struct aa_hardware_params aa_defparams;
4248 extern struct aa_renderparams aa_defrenderparams;
4249 int main(void) {
4250 aa_context *c;
4251 aa_renderparams *p;
4252 (void) aa_init(0, 0, 0);
4253 c = aa_autoinit(&aa_defparams);
4254 p = aa_getrenderparams();
4255 aa_autoinitkbd(c,0);
4256 return 0; }
4258 _aa=no
4259 for _ld_tmp in "-laa" ; do
4260 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4261 done
4263 if test "$_aa" = yes ; then
4264 _def_aa='#define HAVE_AA 1'
4265 if cygwin ; then
4266 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4268 _vosrc="$_vosrc vo_aa.c"
4269 _vomodules="aa $_vomodules"
4270 else
4271 _def_aa='#undef HAVE_AA'
4272 _novomodules="aa $_novomodules"
4274 echores "$_aa"
4277 echocheck "CACA"
4278 if test "$_caca" = auto ; then
4279 _caca=no
4280 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4281 cat > $TMPC << EOF
4282 #include <caca.h>
4283 #ifdef CACA_API_VERSION_1
4284 #include <caca0.h>
4285 #endif
4286 int main(void) { (void) caca_init(); return 0; }
4288 cc_check `caca-config --libs` && _caca=yes
4291 if test "$_caca" = yes ; then
4292 _def_caca='#define HAVE_CACA 1'
4293 _inc_extra="$_inc_extra `caca-config --cflags`"
4294 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4295 _vosrc="$_vosrc vo_caca.c"
4296 _vomodules="caca $_vomodules"
4297 else
4298 _def_caca='#undef HAVE_CACA'
4299 _novomodules="caca $_novomodules"
4301 echores "$_caca"
4304 echocheck "SVGAlib"
4305 if test "$_svga" = auto ; then
4306 cat > $TMPC << EOF
4307 #include <vga.h>
4308 int main(void) { return 0; }
4310 _svga=no
4311 cc_check -lvga $_ld_lm && _svga=yes
4313 if test "$_svga" = yes ; then
4314 _def_svga='#define HAVE_SVGALIB 1'
4315 _libs_mplayer="$_libs_mplayer -lvga"
4316 _vosrc="$_vosrc vo_svga.c"
4317 _vomodules="svga $_vomodules"
4318 else
4319 _def_svga='#undef HAVE_SVGALIB'
4320 _novomodules="svga $_novomodules"
4322 echores "$_svga"
4325 echocheck "FBDev"
4326 if test "$_fbdev" = auto ; then
4327 _fbdev=no
4328 linux && test -c /dev/fb0 && _fbdev=yes
4330 if test "$_fbdev" = yes ; then
4331 _def_fbdev='#define HAVE_FBDEV 1'
4332 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4333 _vomodules="fbdev $_vomodules"
4334 else
4335 _def_fbdev='#undef HAVE_FBDEV'
4336 _novomodules="fbdev $_novomodules"
4338 echores "$_fbdev"
4342 echocheck "DVB"
4343 if test "$_dvb" = auto ; then
4344 _dvb=no
4345 cat >$TMPC << EOF
4346 #include <sys/poll.h>
4347 #include <sys/ioctl.h>
4348 #include <stdio.h>
4349 #include <time.h>
4350 #include <unistd.h>
4352 #include <ost/dmx.h>
4353 #include <ost/frontend.h>
4354 #include <ost/sec.h>
4355 #include <ost/video.h>
4356 #include <ost/audio.h>
4357 int main(void) {return 0;}
4359 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4360 cc_check $_inc_tmp && _dvb=yes && \
4361 _inc_extra="$_inc_extra $_inc_tmp" && break
4362 done
4364 echores "$_dvb"
4365 if test "$_dvb" = yes ; then
4366 _def_dvb='#define HAVE_DVB 1'
4367 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4368 _aomodules="mpegpes(dvb) $_aomodules"
4369 _vomodules="mpegpes(dvb) $_vomodules"
4372 echocheck "DVB HEAD"
4373 if test "$_dvbhead" = auto ; then
4374 _dvbhead=no
4376 cat >$TMPC << EOF
4377 #include <sys/poll.h>
4378 #include <sys/ioctl.h>
4379 #include <stdio.h>
4380 #include <time.h>
4381 #include <unistd.h>
4383 #include <linux/dvb/dmx.h>
4384 #include <linux/dvb/frontend.h>
4385 #include <linux/dvb/video.h>
4386 #include <linux/dvb/audio.h>
4387 int main(void) {return 0;}
4389 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4390 cc_check $_inc_tmp && _dvbhead=yes && \
4391 _inc_extra="$_inc_extra $_inc_tmp" && break
4392 done
4394 echores "$_dvbhead"
4395 if test "$_dvbhead" = yes ; then
4396 _def_dvb='#define HAVE_DVB_HEAD 1'
4397 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4398 _aomodules="mpegpes(dvb) $_aomodules"
4399 _vomodules="mpegpes(dvb) $_vomodules"
4402 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4403 _def_dvb='#undef HAVE_DVB'
4404 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4405 _aomodules="mpegpes(file) $_aomodules"
4406 _vomodules="mpegpes(file) $_vomodules"
4409 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4410 _dvbin=yes
4411 _inputmodules="dvb $_inputmodules"
4412 else
4413 _dvbin=no
4414 _noinputmodules="dvb $_noinputmodules"
4417 echocheck "PNG support"
4418 if test "$_png" = auto ; then
4419 _png=no
4420 if irix ; then
4421 # Don't check for -lpng on irix since it has its own libpng
4422 # incompatible with the GNU libpng
4423 _res_comment="disabled on irix (not GNU libpng)"
4424 else
4425 cat > $TMPC << EOF
4426 #include <png.h>
4427 #include <string.h>
4428 int main(void) {
4429 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4430 printf("libpng: %s\n", png_libpng_ver);
4431 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4434 if cc_check -lpng -lz $_ld_lm ; then
4435 if tmp_run ; then
4436 _png=yes
4437 else
4438 _res_comment="mismatch of library and header versions"
4443 echores "$_png"
4444 if test "$_png" = yes ; then
4445 _def_png='#define HAVE_PNG 1'
4446 _ld_extra="$_ld_extra -lpng -lz"
4447 _vosrc="$_vosrc vo_png.c"
4448 _vomodules="png $_vomodules"
4449 else
4450 _def_png='#undef HAVE_PNG'
4451 _novomodules="png $_novomodules"
4454 echocheck "JPEG support"
4455 if test "$_jpeg" = auto ; then
4456 _jpeg=no
4457 cat > $TMPC << EOF
4458 #include <stdio.h>
4459 #include <stdlib.h>
4460 #include <setjmp.h>
4461 #include <string.h>
4462 #include <jpeglib.h>
4463 int main(void) {
4464 return 0;
4467 if cc_check -ljpeg $_ld_lm ; then
4468 if tmp_run ; then
4469 _jpeg=yes
4473 echores "$_jpeg"
4475 if test "$_jpeg" = yes ; then
4476 _def_jpeg='#define HAVE_JPEG 1'
4477 _vosrc="$_vosrc vo_jpeg.c"
4478 _vomodules="jpeg $_vomodules"
4479 _ld_extra="$_ld_extra -ljpeg"
4480 else
4481 _def_jpeg='#undef HAVE_JPEG'
4482 _novomodules="jpeg $_novomodules"
4487 echocheck "PNM support"
4488 if test "$_pnm" = yes; then
4489 _def_pnm="#define HAVE_PNM"
4490 _vosrc="$_vosrc vo_pnm.c"
4491 _vomodules="pnm $_vomodules"
4492 else
4493 _def_pnm="#undef HAVE_PNM"
4494 _novomodules="pnm $_novomodules"
4496 echores "$_pnm"
4500 echocheck "GIF support"
4501 # This is to appease people who want to force gif support.
4502 # If it is forced to yes, then we still do checks to determine
4503 # which gif library to use.
4504 if test "$_gif" = yes ; then
4505 _force_gif=yes
4506 _gif=auto
4509 if test "$_gif" = auto ; then
4510 _gif=no
4511 cat > $TMPC << EOF
4512 #include <gif_lib.h>
4513 int main(void) {
4514 return 0;
4517 for _ld_gif in "-lungif" "-lgif" ; do
4518 cc_check $_ld_gif && tmp_run && _gif=yes && break
4519 done
4522 # If no library was found, and the user wants support forced,
4523 # then we force it on with libgif, as this is the safest
4524 # assumption IMHO. (libungif & libregif both create symbolic
4525 # links to libgif. We also assume that no x11 support is needed,
4526 # because if you are forcing this, then you _should_ know what
4527 # you are doing. [ Besides, package maintainers should never
4528 # have compiled x11 deps into libungif in the first place. ] )
4529 # </rant>
4530 # --Joey
4531 if test "$_force_gif" = yes && test "$_gif" = no ; then
4532 _gif=yes
4533 _ld_gif="-lgif"
4536 if test "$_gif" = yes ; then
4537 _def_gif='#define HAVE_GIF 1'
4538 _vosrc="$_vosrc vo_gif89a.c"
4539 _codecmodules="gif $_codecmodules"
4540 _vomodules="gif89a $_vomodules"
4541 _res_comment="old version, some encoding functions disabled"
4542 _def_gif_4='#undef HAVE_GIF_4'
4543 _ld_extra="$_ld_extra $_ld_gif"
4545 cat > $TMPC << EOF
4546 #include <signal.h>
4547 #include <gif_lib.h>
4548 void catch() { exit(1); }
4549 int main(void) {
4550 signal(SIGSEGV, catch); // catch segfault
4551 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4552 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4553 return 0;
4556 if cc_check "$_ld_gif" && tmp_run ; then
4557 _def_gif_4='#define HAVE_GIF_4 1'
4558 _res_comment=""
4560 else
4561 _def_gif='#undef HAVE_GIF'
4562 _def_gif_4='#undef HAVE_GIF_4'
4563 _novomodules="gif89a $_novomodules"
4564 _nocodecmodules="gif $_nocodecmodules"
4566 echores "$_gif"
4569 case "$_gif" in yes*)
4570 echocheck "broken giflib workaround"
4571 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4573 cat > $TMPC << EOF
4574 #include <gif_lib.h>
4575 int main(void) {
4576 GifFileType gif;
4577 printf("UserData is at address %p\n", gif.UserData);
4578 return 0;
4581 if cc_check "$_ld_gif" && tmp_run ; then
4582 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4583 echores "disabled"
4584 else
4585 echores "enabled"
4588 esac
4591 echocheck "VESA support"
4592 if test "$_vesa" = auto ; then
4593 cat > $TMPC << EOF
4594 #include <vbe.h>
4595 int main(void) { vbeVersion(); return 0; }
4597 _vesa=no
4598 cc_check -lvbe -llrmi && _vesa=yes
4600 if test "$_vesa" = yes ; then
4601 _def_vesa='#define HAVE_VESA 1'
4602 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4603 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4604 _vomodules="vesa $_vomodules"
4605 else
4606 _def_vesa='#undef HAVE_VESA'
4607 _novomodules="vesa $_novomodules"
4609 echores "$_vesa"
4611 #################
4612 # VIDEO + AUDIO #
4613 #################
4616 echocheck "SDL"
4617 if test -z "$_sdlconfig" ; then
4618 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4619 _sdlconfig="sdl-config"
4620 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4621 _sdlconfig="sdl11-config"
4622 else
4623 _sdlconfig=false
4626 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4627 cat > $TMPC << EOF
4628 #include <SDL.h>
4629 int main(int argc, char *argv[]) { return 0; }
4631 _sdl=no
4632 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4633 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4634 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4635 if test "$_sdlversion" -gt 116 ; then
4636 if test "$_sdlversion" -lt 121 ; then
4637 _def_sdlbuggy='#define BUGGY_SDL'
4638 else
4639 _def_sdlbuggy='#undef BUGGY_SDL'
4641 _sdl=yes
4646 if test "$_sdl" = yes ; then
4647 _def_sdl='#define HAVE_SDL 1'
4648 if cygwin ; then
4649 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4650 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4651 elif mingw32 ; then
4652 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4653 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4654 else
4655 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4656 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4658 _vosrc="$_vosrc vo_sdl.c"
4659 _vomodules="sdl $_vomodules"
4660 _aosrc="$_aosrc ao_sdl.c"
4661 _aomodules="sdl $_aomodules"
4662 _res_comment="using $_sdlconfig"
4663 else
4664 _def_sdl='#undef HAVE_SDL'
4665 _novomodules="sdl $_novomodules"
4666 _noaomodules="sdl $_noaomodules"
4668 echores "$_sdl"
4671 if win32; then
4673 echocheck "Windows waveout"
4674 if test "$_win32waveout" = auto ; then
4675 cat > $TMPC << EOF
4676 #include <windows.h>
4677 #include <mmsystem.h>
4678 int main(void) { return 0; }
4680 _win32waveout=no
4681 cc_check -lwinmm && _win32waveout=yes
4683 if test "$_win32waveout" = yes ; then
4684 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4685 _libs_mplayer="$_libs_mplayer -lwinmm"
4686 _aosrc="$_aosrc ao_win32.c"
4687 _aomodules="win32 $_aomodules"
4688 else
4689 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4690 _noaomodules="win32 $_noaomodules"
4692 echores "$_win32waveout"
4694 echocheck "Directx"
4695 if test "$_directx" = auto ; then
4696 cat > $TMPC << EOF
4697 #include <windows.h>
4698 #include <ddraw.h>
4699 #include <dsound.h>
4700 int main(void) { return 0; }
4702 _directx=no
4703 cc_check -lgdi32 && _directx=yes
4705 if test "$_directx" = yes ; then
4706 _def_directx='#define HAVE_DIRECTX 1'
4707 _libs_mplayer="$_libs_mplayer -lgdi32"
4708 _vosrc="$_vosrc vo_directx.c"
4709 _vomodules="directx $_vomodules"
4710 _aosrc="$_aosrc ao_dsound.c"
4711 _aomodules="dsound $_aomodules"
4712 else
4713 _def_directx='#undef HAVE_DIRECTX'
4714 _novomodules="directx $_novomodules"
4715 _noaomodules="dsound $_noaomodules"
4717 echores "$_directx"
4719 fi #if win32; then
4722 echocheck "NAS"
4723 if test "$_nas" = auto ; then
4724 cat > $TMPC << EOF
4725 #include <audio/audiolib.h>
4726 int main(void) { return 0; }
4728 _nas=no
4729 cc_check $_ld_lm -laudio -lXt && _nas=yes
4731 if test "$_nas" = yes ; then
4732 _def_nas='#define HAVE_NAS 1'
4733 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4734 _aosrc="$_aosrc ao_nas.c"
4735 _aomodules="nas $_aomodules"
4736 else
4737 _noaomodules="nas $_noaomodules"
4738 _def_nas='#undef HAVE_NAS'
4740 echores "$_nas"
4742 echocheck "DXR2"
4743 if test "$_dxr2" = auto; then
4744 _dxr2=no
4745 cat > $TMPC << EOF
4746 #include <dxr2ioctl.h>
4747 int main(void) { return 0; }
4749 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4750 cc_check $_inc_tmp && _dxr2=yes && \
4751 _inc_extra="$_inc_extra $_inc_tmp" && break
4752 done
4754 if test "$_dxr2" = yes; then
4755 _def_dxr2='#define HAVE_DXR2 1'
4756 _vosrc="$_vosrc vo_dxr2.c"
4757 _aosrc="$_aosrc ao_dxr2.c"
4758 _aomodules="dxr2 $_aomodules"
4759 _vomodules="dxr2 $_vomodules"
4760 else
4761 _def_dxr2='#undef HAVE_DXR2'
4762 _noaomodules="dxr2 $_noaomodules"
4763 _novomodules="dxr2 $_novomodules"
4765 echores "$_dxr2"
4767 echocheck "DXR3/H+"
4768 if test "$_dxr3" = auto ; then
4769 cat > $TMPC << EOF
4770 #include <linux/em8300.h>
4771 int main(void) { return 0; }
4773 _dxr3=no
4774 cc_check && _dxr3=yes
4776 if test "$_dxr3" = yes ; then
4777 _def_dxr3='#define HAVE_DXR3 1'
4778 _vosrc="$_vosrc vo_dxr3.c"
4779 _vomodules="dxr3 $_vomodules"
4780 else
4781 _def_dxr3='#undef HAVE_DXR3'
4782 _novomodules="dxr3 $_novomodules"
4784 echores "$_dxr3"
4787 echocheck "IVTV TV-Out"
4788 if test "$_ivtv" = auto ; then
4789 cat > $TMPC << EOF
4790 #include <stdlib.h>
4791 #include <inttypes.h>
4792 #include <linux/types.h>
4793 #include <linux/videodev2.h>
4794 #include <linux/ivtv.h>
4795 int main(void) { return 0; }
4797 _ivtv=no
4798 cc_check && _ivtv=yes
4800 if test "$_ivtv" = yes ; then
4801 _def_ivtv='#define HAVE_IVTV 1'
4802 _vosrc="$_vosrc vo_ivtv.c"
4803 _vomodules="ivtv $_vomodules"
4804 _aosrc="$_aosrc ao_ivtv.c"
4805 _aomodules="ivtv $_aomodules"
4806 else
4807 _def_ivtv='#undef HAVE_IVTV'
4808 _novomodules="ivtv $_novomodules"
4809 _noaomodules="ivtv $_noaomodules"
4811 echores "$_ivtv"
4815 #########
4816 # AUDIO #
4817 #########
4820 echocheck "OSS Audio"
4821 if test "$_ossaudio" = auto ; then
4822 cat > $TMPC << EOF
4823 #include <sys/ioctl.h>
4824 $_include_soundcard
4825 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4827 _ossaudio=no
4828 cc_check && _ossaudio=yes
4830 if test "$_ossaudio" = yes ; then
4831 _def_ossaudio='#define USE_OSS_AUDIO 1'
4832 _aosrc="$_aosrc ao_oss.c"
4833 _aomodules="oss $_aomodules"
4834 if test "$_linux_devfs" = yes; then
4835 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4836 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4837 else
4838 cat > $TMPC << EOF
4839 #include <sys/ioctl.h>
4840 $_include_soundcard
4841 #ifdef OPEN_SOUND_SYSTEM
4842 int main(void) { return 0; }
4843 #else
4844 #error Not the real thing
4845 #endif
4847 _real_ossaudio=no
4848 cc_check && _real_ossaudio=yes
4849 if test "$_real_ossaudio" = yes; then
4850 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4851 elif netbsd || openbsd ; then
4852 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4853 _ld_extra="$_ld_extra -lossaudio"
4854 else
4855 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4857 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4859 else
4860 _def_ossaudio='#undef USE_OSS_AUDIO'
4861 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4862 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4863 _noaomodules="oss $_noaomodules"
4865 echores "$_ossaudio"
4868 echocheck "aRts"
4869 if test "$_arts" = auto ; then
4870 _arts=no
4871 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4873 cat > $TMPC << EOF
4874 #include <artsc.h>
4875 int main(void) { return 0; }
4877 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
4882 if test "$_arts" = yes ; then
4883 _def_arts='#define USE_ARTS 1'
4884 _aosrc="$_aosrc ao_arts.c"
4885 _aomodules="arts $_aomodules"
4886 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
4887 _inc_extra="$_inc_extra `artsc-config --cflags`"
4888 else
4889 _noaomodules="arts $_noaomodules"
4891 echores "$_arts"
4894 echocheck "EsounD"
4895 if test "$_esd" = auto ; then
4896 _esd=no
4897 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4899 cat > $TMPC << EOF
4900 #include <esd.h>
4901 int main(void) { return 0; }
4903 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes
4907 echores "$_esd"
4909 if test "$_esd" = yes ; then
4910 _def_esd='#define USE_ESD 1'
4911 _aosrc="$_aosrc ao_esd.c"
4912 _aomodules="esd $_aomodules"
4913 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
4914 _inc_extra="$_inc_extra `esd-config --cflags`"
4916 echocheck "esd_get_latency()"
4917 cat > $TMPC << EOF
4918 #include <esd.h>
4919 int main(void) { return esd_get_latency(0); }
4921 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4922 echores "$_esd_latency"
4923 else
4924 _def_esd='#undef USE_ESD'
4925 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4926 _noaomodules="esd $_noaomodules"
4929 echocheck "Polyp"
4930 if test "$_polyp" = auto ; then
4931 _polyp=no
4932 if $_pkg_config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
4934 cat > $TMPC << EOF
4935 #include <polyp/polyplib.h>
4936 #include <polyp/mainloop.h>
4937 #include <polyp/polyplib-error.h>
4938 int main(void) { return 0; }
4940 cc_check `$_pkg_config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
4944 echores "$_polyp"
4946 if test "$_polyp" = yes ; then
4947 _def_polyp='#define USE_POLYP 1'
4948 _aosrc="$_aosrc ao_polyp.c"
4949 _aomodules="polyp $_aomodules"
4950 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs polyplib polyplib-error polyplib-mainloop`"
4951 _inc_extra="$_inc_extra `$_pkg_config --cflags polyplib polyplib-error polyplib-mainloop`"
4952 else
4953 _def_polyp='#undef USE_POLYP'
4954 _noaomodules="polyp $_noaomodules"
4958 echocheck "JACK"
4959 if test "$_jack" = auto ; then
4960 _jack=yes
4962 cat > $TMPC << EOF
4963 #include <jack/jack.h>
4964 int main(void) { jack_client_new("test"); return 0; }
4966 if cc_check -ljack ; then
4967 _libs_mplayer="$_libs_mplayer -ljack"
4968 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
4969 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
4970 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
4971 else
4972 _jack=no
4976 if test "$_jack" = yes ; then
4977 _def_jack='#define USE_JACK 1'
4978 _aosrc="$_aosrc ao_jack.c"
4979 _aomodules="jack $_aomodules"
4980 else
4981 _noaomodules="jack $_noaomodules"
4983 echores "$_jack"
4985 echocheck "OpenAL"
4986 if test "$_openal" = auto ; then
4987 _openal=no
4988 cat > $TMPC << EOF
4989 #ifdef OPENAL_AL_H
4990 #include <OpenAL/al.h>
4991 #else
4992 #include <AL/al.h>
4993 #endif
4994 int main(void) {
4995 alSourceQueueBuffers(0, 0, 0);
4996 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4997 return 0;
5000 for I in "-lopenal" "-framework OpenAL" ; do
5001 cc_check $I && _openal=yes && break
5002 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5003 done
5004 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5006 if test "$_openal" = yes ; then
5007 _def_openal='#define USE_OPENAL 1'
5008 _aosrc="$_aosrc ao_openal.c"
5009 _aomodules="openal $_aomodules"
5010 else
5011 _noaomodules="openal $_noaomodules"
5013 echores "$_openal"
5015 echocheck "ALSA audio"
5016 if test "$_alsa" != no ; then
5017 _alsa=no
5018 cat > $TMPC << EOF
5019 #include <sys/asoundlib.h>
5020 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5021 #error "alsa version != 0.5.x"
5022 #endif
5023 int main(void) { return 0; }
5025 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5027 cat > $TMPC << EOF
5028 #include <sys/asoundlib.h>
5029 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5030 #error "alsa version != 0.9.x"
5031 #endif
5032 int main(void) { return 0; }
5034 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5035 cat > $TMPC << EOF
5036 #include <alsa/asoundlib.h>
5037 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5038 #error "alsa version != 0.9.x"
5039 #endif
5040 int main(void) { return 0; }
5042 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5044 cat > $TMPC << EOF
5045 #include <sys/asoundlib.h>
5046 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5047 #error "alsa version != 1.0.x"
5048 #endif
5049 int main(void) { return 0; }
5051 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5052 cat > $TMPC << EOF
5053 #include <alsa/asoundlib.h>
5054 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5055 #error "alsa version != 1.0.x"
5056 #endif
5057 int main(void) { return 0; }
5059 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5061 _def_alsa5='#undef HAVE_ALSA5'
5062 _def_alsa9='#undef HAVE_ALSA9'
5063 _def_alsa1x='#undef HAVE_ALSA1X'
5064 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5065 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5066 if test "$_alsaver" ; then
5067 _alsa=yes
5068 if test "$_alsaver" = '0.5.x' ; then
5069 _alsa5=yes
5070 _aosrc="$_aosrc ao_alsa5.c"
5071 _aomodules="alsa5 $_aomodules"
5072 _def_alsa5='#define HAVE_ALSA5 1'
5073 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5074 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5075 elif test "$_alsaver" = '0.9.x-sys' ; then
5076 _alsa9=yes
5077 _aosrc="$_aosrc ao_alsa.c"
5078 _aomodules="alsa $_aomodules"
5079 _def_alsa9='#define HAVE_ALSA9 1'
5080 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5081 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5082 elif test "$_alsaver" = '0.9.x-alsa' ; then
5083 _alsa9=yes
5084 _aosrc="$_aosrc ao_alsa.c"
5085 _aomodules="alsa $_aomodules"
5086 _def_alsa9='#define HAVE_ALSA9 1'
5087 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5088 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5089 elif test "$_alsaver" = '1.0.x-sys' ; then
5090 _alsa1x=yes
5091 _aosrc="$_aosrc ao_alsa.c"
5092 _aomodules="alsa $_aomodules"
5093 _def_alsa1x="#define HAVE_ALSA1X 1"
5094 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5095 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5096 elif test "$_alsaver" = '1.0.x-alsa' ; then
5097 _alsa1x=yes
5098 _aosrc="$_aosrc ao_alsa.c"
5099 _aomodules="alsa $_aomodules"
5100 _def_alsa1x="#define HAVE_ALSA1X 1"
5101 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5102 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5103 else
5104 _alsa=no
5105 _res_comment="unknown version"
5107 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5108 else
5109 _noaomodules="alsa $_noaomodules"
5111 echores "$_alsa"
5114 echocheck "Sun audio"
5115 if test "$_sunaudio" = auto ; then
5116 cat > $TMPC << EOF
5117 #include <sys/types.h>
5118 #include <sys/audioio.h>
5119 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5121 _sunaudio=no
5122 cc_check && _sunaudio=yes
5124 if test "$_sunaudio" = yes ; then
5125 _def_sunaudio='#define USE_SUN_AUDIO 1'
5126 _aosrc="$_aosrc ao_sun.c"
5127 _aomodules="sun $_aomodules"
5128 else
5129 _def_sunaudio='#undef USE_SUN_AUDIO'
5130 _noaomodules="sun $_noaomodules"
5132 echores "$_sunaudio"
5135 if sunos; then
5136 echocheck "Sun mediaLib"
5137 if test "$_mlib" = auto ; then
5138 _mlib=no
5139 cat > $TMPC << EOF
5140 #include <mlib.h>
5141 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5143 cc_check -lmlib && _mlib=yes
5145 if test "$_mlib" = yes ; then
5146 _def_mlib='#define HAVE_MLIB 1'
5147 else
5148 _def_mlib='#undef HAVE_MLIB'
5150 echores "$_mlib"
5151 fi #if sunos
5154 if irix; then
5155 echocheck "SGI audio"
5156 if test "$_sgiaudio" = auto ; then
5157 # check for SGI audio
5158 cat > $TMPC << EOF
5159 #include <dmedia/audio.h>
5160 int main(void) { return 0; }
5162 _sgiaudio=no
5163 cc_check && _sgiaudio=yes
5165 if test "$_sgiaudio" = "yes" ; then
5166 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5167 _libs_mplayer="$_libs_mplayer -laudio"
5168 _aosrc="$_aosrc ao_sgi.c"
5169 _aomodules="sgi $_aomodules"
5170 else
5171 _def_sgiaudio='#undef USE_SGI_AUDIO'
5172 _noaomodules="sgi $_noaomodules"
5174 echores "$_sgiaudio"
5175 fi #if irix
5178 echocheck "VCD support"
5179 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5180 _inputmodules="vcd $_inputmodules"
5181 _def_vcd='#define HAVE_VCD 1'
5182 _vcd="yes"
5183 else
5184 _def_vcd='#undef HAVE_VCD'
5185 _noinputmodules="vcd $_noinputmodules"
5186 _res_comment="not supported on this OS"
5187 _vcd="no"
5189 echores "$_vcd"
5193 echocheck "dvdread"
5194 if test "$_dvdread_internal" = auto ; then
5195 _dvdread_internal=no
5196 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5197 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5198 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5199 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5200 _dvdread_internal=yes
5201 _dvdread=yes
5202 _res_comment="internal"
5204 elif test "$_dvdread" = auto ; then
5205 _dvdread=no
5206 if test "$_dl" = yes; then
5207 cat > $TMPC << EOF
5208 #include <inttypes.h>
5209 #include <dvdread/dvd_reader.h>
5210 #include <dvdread/ifo_types.h>
5211 #include <dvdread/ifo_read.h>
5212 #include <dvdread/nav_read.h>
5213 int main(void) { return 0; }
5215 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5216 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5220 if test "$_dvdread_internal" = yes; then
5221 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5222 _def_dvdread='#define USE_DVDREAD 1'
5223 _inputmodules="dvdread(internal) $_inputmodules"
5224 _largefiles=yes
5225 elif test "$_dvdread" = yes; then
5226 _def_dvdread='#define USE_DVDREAD 1'
5227 _largefiles=yes
5228 _ld_extra="$_ld_extra -ldvdread"
5229 _inputmodules="dvdread(external) $_inputmodules"
5230 _res_comment="external"
5231 else
5232 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5233 _def_dvdread='#undef USE_DVDREAD'
5234 _noinputmodules="dvdread $_noinputmodules"
5236 echores "$_dvdread"
5239 echocheck "internal libdvdcss"
5240 if test "$_libdvdcss_internal" = auto ; then
5241 _libdvdcss_internal=no
5242 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5244 if test "$_libdvdcss_internal" = yes ; then
5245 if linux || netbsd || openbsd || bsdos ; then
5246 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5247 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5248 elif freebsd ; then
5249 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5250 elif darwin ; then
5251 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5252 _ld_extra="$_ld_extra -framework IOKit"
5254 _inputmodules="libdvdcss(internal) $_inputmodules"
5255 _largefiles=yes
5256 else
5257 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5259 echores "$_libdvdcss_internal"
5262 echocheck "cdparanoia"
5263 if test "$_cdparanoia" = auto ; then
5264 cat > $TMPC <<EOF
5265 #include <cdda_interface.h>
5266 #include <cdda_paranoia.h>
5267 // This need a better test. How ?
5268 int main(void) {
5269 void *test = cdda_verbose_set;
5270 return test == (void *)1;
5273 _cdparanoia=no
5274 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5275 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5276 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5277 done
5279 if test "$_cdparanoia" = yes ; then
5280 _cdda='yes'
5281 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5282 openbsd && _ld_extra="$_ld_extra -lutil"
5284 echores "$_cdparanoia"
5287 echocheck "libcdio"
5288 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5289 cat > $TMPC << EOF
5290 #include <stdio.h>
5291 #include <cdio/version.h>
5292 #include <cdio/cdda.h>
5293 #include <cdio/paranoia.h>
5294 int main()
5296 void *test = cdda_verbose_set;
5297 printf("%s\n", CDIO_VERSION);
5298 return test == (void *)1;
5302 _libcdio=no
5303 for _ld_tmp in "" "-lwinmm" ; do
5304 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5305 cc_check $_ld_tmp $_ld_lm \
5306 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5307 done
5308 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5309 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5310 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5311 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5312 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5315 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5316 _cdda='yes'
5317 _def_libcdio='#define HAVE_LIBCDIO'
5318 _def_havelibcdio='yes'
5319 else
5320 if test "$_cdparanoia" = yes ; then
5321 _res_comment="using cdparanoia"
5323 _def_libcdio='#undef HAVE_LIBCDIO'
5324 _def_havelibcdio='no'
5326 echores "$_libcdio"
5328 if test "$_cdda" = yes ; then
5329 test $_cddb = auto && test $_network = yes && not darwin && _cddb=yes
5330 _def_cdparanoia='#define HAVE_CDDA'
5331 _inputmodules="cdda $_inputmodules"
5332 else
5333 _def_cdparanoia='#undef HAVE_CDDA'
5334 _noinputmodules="cdda $_noinputmodules"
5337 if test "$_cddb" = yes ; then
5338 _def_cddb='#define HAVE_CDDB'
5339 _inputmodules="cddb $_inputmodules"
5340 else
5341 _cddb=no
5342 _def_cddb='#undef HAVE_CDDB'
5343 _noinputmodules="cddb $_noinputmodules"
5346 echocheck "bitmap font support"
5347 if test "$_bitmap_font" = yes ; then
5348 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5349 else
5350 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5352 echores "$_bitmap_font"
5355 echocheck "freetype >= 2.0.9"
5357 # freetype depends on iconv
5358 if test "$_iconv" = no ; then
5359 _freetype=no
5360 _res_comment="iconv support needed"
5363 if test "$_freetype" = auto ; then
5364 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5365 cat > $TMPC << EOF
5366 #include <stdio.h>
5367 #include <ft2build.h>
5368 #include FT_FREETYPE_H
5369 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5370 #error "Need FreeType 2.0.9 or newer"
5371 #endif
5372 int main()
5374 FT_Library library;
5375 FT_Int major=-1,minor=-1,patch=-1;
5376 int err=FT_Init_FreeType(&library);
5377 if(err){
5378 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5379 exit(err);
5381 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5382 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5383 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5384 (int)major,(int)minor,(int)patch );
5385 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5386 printf("Library and header version mismatch! Fix it in your distribution!\n");
5387 exit(1);
5389 return 0;
5392 _freetype=no
5393 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5394 else
5395 _freetype=no
5398 if test "$_freetype" = yes ; then
5399 _def_freetype='#define HAVE_FREETYPE'
5400 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5401 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5402 else
5403 _def_freetype='#undef HAVE_FREETYPE'
5405 echores "$_freetype"
5407 if test "$_freetype" = no ; then
5408 _fontconfig=no
5409 _res_comment="freetype support needed"
5411 echocheck "fontconfig"
5412 if test "$_fontconfig" = auto ; then
5413 cat > $TMPC << EOF
5414 #include <stdio.h>
5415 #include <fontconfig/fontconfig.h>
5416 int main()
5418 int err = FcInit();
5419 if(err == FcFalse){
5420 printf("Couldn't initialize fontconfig lib\n");
5421 exit(err);
5423 return 0;
5427 _fontconfig=no
5428 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5429 _ld_tmp="-lfontconfig $_ld_tmp"
5430 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5431 done
5432 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5433 _inc_tmp=`$_pkg_config --cflags fontconfig`
5434 _ld_tmp=`$_pkg_config --libs fontconfig`
5435 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5436 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5439 if test "$_fontconfig" = yes ; then
5440 _def_fontconfig='#define HAVE_FONTCONFIG'
5441 else
5442 _def_fontconfig='#undef HAVE_FONTCONFIG'
5444 echores "$_fontconfig"
5447 echocheck "SSA/ASS support"
5448 # libass depends on FreeType
5449 if test "$_freetype" = no ; then
5450 _ass=no
5451 _res_comment="FreeType support needed"
5454 if test "$_ass" = auto ; then
5455 cat > $TMPC << EOF
5456 #include <ft2build.h>
5457 #include FT_FREETYPE_H
5458 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5459 #error "Need FreeType 2.1.8 or newer"
5460 #endif
5461 int main() { return 0; }
5463 _ass=no
5464 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5465 if test "$_ass" = no ; then
5466 _res_comment="FreeType >= 2.1.8 needed"
5469 if test "$_ass" = yes ; then
5470 _def_ass='#define USE_ASS'
5471 else
5472 _def_ass='#undef USE_ASS'
5474 echores "$_ass"
5477 echocheck "fribidi with charsets"
5478 if test "$_fribidi" = auto ; then
5479 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5480 cat > $TMPC << EOF
5481 #include <stdio.h>
5482 /* workaround for fribidi 0.10.4 and below */
5483 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5484 #include <fribidi/fribidi.h>
5485 int main()
5487 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5488 printf("Fribidi headers are not consistents with the library!\n");
5489 exit(1);
5491 return 0;
5494 _fribidi=no
5495 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5496 else
5497 _fribidi=no
5500 if test "$_fribidi" = yes ; then
5501 _def_fribidi='#define USE_FRIBIDI'
5502 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5503 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5504 else
5505 _def_fribidi='#undef USE_FRIBIDI'
5507 echores "$_fribidi"
5510 echocheck "ENCA"
5511 if test "$_enca" = auto ; then
5512 cat > $TMPC << EOF
5513 #include <enca.h>
5514 int main()
5516 const char **langs;
5517 size_t langcnt;
5518 langs = enca_get_languages(&langcnt);
5519 return 0;
5522 _enca=no
5523 cc_check -lenca $_ld_lm && _enca=yes
5525 if test "$_enca" = yes ; then
5526 _def_enca='#define HAVE_ENCA 1'
5527 _ld_extra="$_ld_extra -lenca"
5528 else
5529 _def_enca='#undef HAVE_ENCA'
5531 echores "$_enca"
5534 echocheck "zlib"
5535 cat > $TMPC << EOF
5536 #include <zlib.h>
5537 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5539 _zlib=no
5540 cc_check -lz && _zlib=yes
5541 if test "$_zlib" = yes ; then
5542 _def_zlib='#define HAVE_ZLIB 1'
5543 _ld_extra="$_ld_extra -lz"
5544 else
5545 _def_zlib='#undef HAVE_ZLIB'
5546 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5547 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5549 echores "$_zlib"
5552 echocheck "RTC"
5553 if test "$_rtc" = auto ; then
5554 cat > $TMPC << EOF
5555 #include <sys/ioctl.h>
5556 #ifdef __linux__
5557 #include <linux/rtc.h>
5558 #else
5559 #include <rtc.h>
5560 #define RTC_PIE_ON RTCIO_PIE_ON
5561 #endif
5562 int main(void) { return RTC_PIE_ON; }
5564 _rtc=no
5565 cc_check && _rtc=yes
5566 ppc && _rtc=no
5568 if test "$_rtc" = yes ; then
5569 _def_rtc='#define HAVE_RTC 1'
5570 else
5571 _def_rtc='#undef HAVE_RTC'
5573 echores "$_rtc"
5576 echocheck "liblzo2 support"
5577 if test "$_liblzo" = auto ; then
5578 _liblzo=no
5579 cat > $TMPC << EOF
5580 #include <lzo/lzo1x.h>
5581 int main(void) { lzo_init();return 0; }
5583 cc_check -llzo2 && _liblzo=yes
5585 if test "$_liblzo" = yes ; then
5586 _def_liblzo='#define USE_LIBLZO 1'
5587 _ld_extra="$_ld_extra -llzo2"
5588 _codecmodules="liblzo $_codecmodules"
5589 else
5590 _def_liblzo='#undef USE_LIBLZO'
5591 _nocodecmodules="liblzo $_nocodecmodules"
5593 echores "$_liblzo"
5596 echocheck "mad support"
5597 if test "$_mad" = auto ; then
5598 _mad=no
5599 cat > $TMPC << EOF
5600 #include <mad.h>
5601 int main(void) { return 0; }
5603 cc_check -lmad && _mad=yes
5605 if test "$_mad" = yes ; then
5606 _def_mad='#define USE_LIBMAD 1'
5607 _ld_extra="$_ld_extra -lmad"
5608 _codecmodules="libmad $_codecmodules"
5609 else
5610 _def_mad='#undef USE_LIBMAD'
5611 _nocodecmodules="libmad $_nocodecmodules"
5613 echores "$_mad"
5615 echocheck "Twolame"
5616 if test "$_twolame" = auto ; then
5617 cat > $TMPC <<EOF
5618 #include <twolame.h>
5619 int main(void) { twolame_init(); return 0; }
5621 _twolame=no
5622 cc_check -ltwolame $_ld_lm && _twolame=yes
5624 if test "$_twolame" = yes ; then
5625 _def_twolame='#define HAVE_TWOLAME 1'
5626 _libs_mencoder="$_libs_mencoder -ltwolame"
5627 _codecmodules="twolame $_codecmodules"
5628 else
5629 _def_twolame='#undef HAVE_TWOLAME'
5630 _nocodecmodules="twolame $_nocodecmodules"
5632 echores "$_twolame"
5634 echocheck "Toolame"
5635 if test "$_toolame" = auto ; then
5636 _toolame=no
5637 if test "$_twolame" = yes ; then
5638 _res_comment="disabled by twolame"
5639 else
5640 cat > $TMPC <<EOF
5641 #include <toolame.h>
5642 int main(void) { toolame_init(); return 0; }
5644 cc_check -ltoolame $_ld_lm && _toolame=yes
5647 if test "$_toolame" = yes ; then
5648 _def_toolame='#define HAVE_TOOLAME 1'
5649 _libs_mencoder="$_libs_mencoder -ltoolame"
5650 _codecmodules="toolame $_codecmodules"
5651 else
5652 _def_toolame='#undef HAVE_TOOLAME'
5653 _nocodecmodules="toolame $_nocodecmodules"
5655 if test "$_toolamedir" ; then
5656 _res_comment="using $_toolamedir"
5658 echores "$_toolame"
5660 echocheck "OggVorbis support"
5661 if test "$_tremor_internal" = yes; then
5662 _libvorbis=no
5663 elif test "$_tremor_external" = auto; then
5664 _tremor_external=no
5665 cat > $TMPC << EOF
5666 #include <tremor/ivorbiscodec.h>
5667 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5669 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5671 if test "$_libvorbis" = auto; then
5672 _libvorbis=no
5673 cat > $TMPC << EOF
5674 #include <vorbis/codec.h>
5675 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5677 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5679 if test "$_tremor_internal" = yes ; then
5680 _vorbis=yes
5681 _def_vorbis='#define HAVE_OGGVORBIS 1'
5682 _def_tremor='#define TREMOR 1'
5683 _codecmodules="tremor(internal) $_codecmodules"
5684 _res_comment="internal Tremor"
5685 if test "$_tremor_low" = yes ; then
5686 _res_comment="internal low accuracy Tremor"
5688 elif test "$_tremor_external" = yes ; then
5689 _vorbis=yes
5690 _def_vorbis='#define HAVE_OGGVORBIS 1'
5691 _def_tremor='#define TREMOR 1'
5692 _codecmodules="tremor(external) $_codecmodules"
5693 _res_comment="external Tremor"
5694 _ld_extra="$_ld_extra -logg -lvorbisidec"
5695 elif test "$_libvorbis" = yes ; then
5696 _vorbis=yes
5697 _def_vorbis='#define HAVE_OGGVORBIS 1'
5698 _codecmodules="libvorbis $_codecmodules"
5699 _res_comment="libvorbis"
5700 _ld_extra="$_ld_extra -lvorbis -logg"
5701 else
5702 _vorbis=no
5703 _nocodecmodules="libvorbis $_nocodecmodules"
5705 if test "$_libvorbis" = no ; then
5706 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5707 _libavmuxers=`echo $_libavmuxers | sed -e s/OGG_MUXER// `
5709 echores "$_vorbis"
5711 echocheck "libspeex (version >= 1.1 required)"
5712 if test "$_speex" = auto ; then
5713 _speex=no
5714 cat > $TMPC << EOF
5715 #include <speex/speex.h>
5716 int main(void) {
5717 SpeexBits bits;
5718 void *dec;
5719 speex_decode_int(dec, &bits, dec);
5722 cc_check -lspeex $_ld_lm && _speex=yes
5724 if test "$_speex" = yes ; then
5725 _def_speex='#define HAVE_SPEEX 1'
5726 _ld_extra="$_ld_extra -lspeex"
5727 _codecmodules="speex $_codecmodules"
5728 else
5729 _def_speex='#undef HAVE_SPEEX'
5730 _nocodecmodules="speex $_nocodecmodules"
5732 echores "$_speex"
5734 echocheck "OggTheora support"
5735 if test "$_theora" = auto ; then
5736 _theora=no
5737 cat > $TMPC << EOF
5738 #include <theora/theora.h>
5739 #include <string.h>
5740 int main(void)
5742 /* theora is in flux, make sure that all interface routines and
5743 * datatypes exist and work the way we expect it, so we don't break
5744 * mplayer */
5745 ogg_packet op;
5746 theora_comment tc;
5747 theora_info inf;
5748 theora_state st;
5749 yuv_buffer yuv;
5750 int r;
5751 double t;
5753 theora_info_init (&inf);
5754 theora_comment_init (&tc);
5756 return 0;
5758 /* we don't want to execute this kind of nonsense; just for making sure
5759 * that compilation works... */
5760 memset(&op, 0, sizeof(op));
5761 r = theora_decode_header (&inf, &tc, &op);
5762 r = theora_decode_init (&st, &inf);
5763 t = theora_granule_time (&st, op.granulepos);
5764 r = theora_decode_packetin (&st, &op);
5765 r = theora_decode_YUVout (&st, &yuv);
5766 theora_clear (&st);
5768 return 0;
5771 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5772 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5773 && _theora=yes && break
5774 done
5775 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5776 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5777 cc_check -I. tremor/bitwise.c $_ld_theora \
5778 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5779 done
5782 if test "$_theora" = yes ; then
5783 _def_theora='#define HAVE_OGGTHEORA 1'
5784 _codecmodules="libtheora $_codecmodules"
5785 # when --enable-theora is forced, we'd better provide a probably sane
5786 # $_ld_theora than nothing
5787 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5788 else
5789 _def_theora='#undef HAVE_OGGTHEORA'
5790 _nocodecmodules="libtheora $_nocodecmodules"
5792 echores "$_theora"
5794 echocheck "mp3lib support"
5795 if test "$_mp3lib" = yes ; then
5796 _def_mp3lib='#define USE_MP3LIB 1'
5797 _codecmodules="mp3lib $_codecmodules"
5798 else
5799 _def_mp3lib='#undef USE_MP3LIB'
5800 _nocodecmodules="mp3lib $_nocodecmodules"
5802 echores "$_mp3lib"
5804 echocheck "liba52 support"
5805 if test "$_liba52" = yes ; then
5806 _def_liba52='#define USE_LIBA52 1'
5807 _codecmodules="liba52 $_codecmodules"
5808 else
5809 _def_liba52='#undef USE_LIBA52'
5810 _nocodecmodules="liba52 $_nocodecmodules"
5812 echores "$_liba52"
5815 echocheck "libmpeg2 support"
5816 if test "$_libmpeg2" = yes ; then
5817 _def_libmpeg2='#define USE_LIBMPEG2 1'
5818 _codecmodules="libmpeg2 $_codecmodules"
5819 else
5820 _def_libmpeg2='#undef USE_LIBMPEG2'
5821 _nocodecmodules="libmpeg2 $_nocodecmodules"
5823 echores "$_libmpeg2"
5825 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5826 if test "$_musepack" = auto ; then
5827 _musepack=no
5828 cat > $TMPC << EOF
5829 #include <mpcdec/mpcdec.h>
5830 int main(void) {
5831 mpc_streaminfo info;
5832 mpc_decoder decoder;
5833 mpc_decoder_set_streaminfo(&decoder, &info);
5834 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5837 cc_check -lmpcdec $_ld_lm && _musepack=yes
5839 if test "$_musepack" = yes ; then
5840 _def_musepack='#define HAVE_MUSEPACK 1'
5841 _ld_extra="$_ld_extra -lmpcdec"
5842 _codecmodules="musepack $_codecmodules"
5843 else
5844 _def_musepack='#undef HAVE_MUSEPACK'
5845 _nocodecmodules="musepack $_nocodecmodules"
5847 echores "$_musepack"
5850 echocheck "FAAC (AAC encoder) support"
5851 if test "$_faac" = auto ; then
5852 cat > $TMPC <<EOF
5853 #include <inttypes.h>
5854 #include <faac.h>
5855 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5857 _faac=no
5858 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5859 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
5860 done
5862 if test "$_faac" = yes ; then
5863 _def_faac="#define HAVE_FAAC 1"
5864 if echo $_libavencoders | grep -q FAAC ; then
5865 _lavc_faac=yes
5866 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
5867 _libs_mplayer="$_libs_mplayer $_ld_faac"
5868 else
5869 _lavc_faac=no
5870 _def_lavc_faac="#undef CONFIG_LIBFAAC"
5872 _codecmodules="faac $_codecmodules"
5873 else
5874 _def_faac="#undef HAVE_FAAC"
5875 _nocodecmodules="faac $_nocodecmodules"
5876 _libavencoders=`echo $_libavencoders | sed -e s/FAAC_ENCODER// `
5878 echores "$_faac (in libavcodec: $_lavc_faac)"
5881 echocheck "FAAD2 (AAC) support"
5882 if test "$_faad_internal" = auto ; then
5883 if x86_32 && test cc_vendor=gnu; then
5884 case $cc_version in
5885 3.1*|3.2) # ICE/insn with these versions
5886 _faad_internal=no
5887 _res_comment="broken gcc"
5890 _faad_internal=yes
5892 esac
5893 else
5894 _faad_internal=yes
5896 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
5897 _faad_external=no
5898 cat > $TMPC << EOF
5899 #include <faad.h>
5900 #ifndef FAAD_MIN_STREAMSIZE
5901 #error Too old version
5902 #endif
5903 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5905 cc_check -lfaad $_ld_lm && _faad_external=yes
5908 if test "$_faad_internal" = yes ; then
5909 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
5910 _faad=yes
5911 _res_comment="internal floating-point"
5912 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
5913 elif test "$_faad_external" = yes ; then
5914 _faad=yes
5915 _ld_extra="$_ld_extra -lfaad"
5916 else
5917 _def_faad_internal="#undef USE_FAAD_INTERNAL"
5918 _faad=no
5921 if test "$_faad" = yes ; then
5922 _def_faad='#define HAVE_FAAD 1'
5923 _codecmodules="faad2 $_codecmodules"
5924 else
5925 _def_faad='#undef HAVE_FAAD'
5926 _nocodecmodules="faad2 $_nocodecmodules"
5928 echores "$_faad"
5931 echocheck "LADSPA plugin support"
5932 if test "$_ladspa" = auto ; then
5933 cat > $TMPC <<EOF
5934 #include <stdio.h>
5935 #include <ladspa.h>
5936 int main(void) {
5937 const LADSPA_Descriptor *ld = NULL;
5938 return 0;
5941 _ladspa=no
5942 cc_check && _ladspa=yes
5944 if test "$_ladspa" = yes; then
5945 _def_ladspa="#define HAVE_LADSPA"
5946 _afsrc="$_afsrc af_ladspa.c"
5947 _afmodules="ladspa $_afmodules"
5948 else
5949 _def_ladspa="#undef HAVE_LADSPA"
5950 _noafmodules="ladspa $_noafmodules"
5952 echores "$_ladspa"
5955 if test -z "$_codecsdir" ; then
5956 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5957 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5958 if test -d "$dir" ; then
5959 _codecsdir="$dir"
5960 break;
5962 done
5964 # Fall back on default directory.
5965 if test -z "$_codecsdir" ; then
5966 _codecsdir="$_libdir/codecs"
5967 mingw32 && _codecsdir="codecs"
5971 echocheck "Win32 codecs"
5972 if test "$_win32dll" = auto ; then
5973 _win32dll=no
5974 if x86_32 && not qnx; then
5975 _win32dll=yes
5978 if test "$_win32dll" = yes ; then
5979 _def_win32dll='#define USE_WIN32DLL 1'
5980 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
5981 _res_comment="using $_win32codecsdir"
5982 if not win32 ; then
5983 _def_win32_loader='#define WIN32_LOADER 1'
5984 else
5985 _ld_extra="$_ld_extra -ladvapi32 -lole32"
5986 _res_comment="using native windows"
5988 _codecmodules="win32 $_codecmodules"
5989 else
5990 _def_win32dll='#undef USE_WIN32DLL'
5991 _def_win32_loader='#undef WIN32_LOADER'
5992 _nocodecmodules="win32 $_nocodecmodules"
5994 echores "$_win32dll"
5997 echocheck "XAnim codecs"
5998 if test "$_xanim" = auto ; then
5999 _xanim=no
6000 _res_comment="dynamic loader support needed"
6001 if test "$_dl" = yes ; then
6002 _xanim=yes
6005 if test "$_xanim" = yes ; then
6006 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6007 _def_xanim='#define USE_XANIM 1'
6008 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6009 _codecmodules="xanim $_codecmodules"
6010 _res_comment="using $_xanimcodecsdir"
6011 else
6012 _def_xanim='#undef USE_XANIM'
6013 _def_xanim_path='#undef XACODEC_PATH'
6014 _nocodecmodules="xanim $_nocodecmodules"
6016 echores "$_xanim"
6019 echocheck "RealPlayer codecs"
6020 if test "$_real" = auto ; then
6021 _real=no
6022 _res_comment="dynamic loader support needed"
6023 if test "$_dl" = yes || test "$_win32dll" = yes &&
6024 (linux || freebsd || netbsd || win32 || darwin) ; then
6025 _real=yes
6028 if test "$_real" = yes ; then
6029 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6030 _def_real='#define USE_REALCODECS 1'
6031 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6032 _codecmodules="real $_codecmodules"
6033 _res_comment="using $_realcodecsdir"
6034 else
6035 _def_real='#undef USE_REALCODECS'
6036 _def_real_path="#undef REALCODEC_PATH"
6037 _nocodecmodules="real $_nocodecmodules"
6039 echores "$_real"
6042 echocheck "LIVE555 Streaming Media libraries"
6043 if test "$_live" = auto && test "$_network" = yes ; then
6044 cat > $TMPCPP << EOF
6045 #include <liveMedia.hh>
6046 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6047 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6048 #endif
6049 int main(void) {}
6052 _live=no
6053 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6054 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6055 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6056 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6057 $_livelibdir/groupsock/libgroupsock.a \
6058 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6059 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6060 $_ld_extra -lstdc++" \
6061 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6062 -I$_livelibdir/UsageEnvironment/include \
6063 -I$_livelibdir/BasicUsageEnvironment/include \
6064 -I$_livelibdir/groupsock/include" && \
6065 _live=yes && break
6066 done
6067 if test "$_live" != yes ; then
6068 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6069 _live_dist=yes
6073 if test "$_live" = yes && test "$_network" = yes ; then
6074 _res_comment="using $_livelibdir"
6075 _def_live='#define STREAMING_LIVE555 1'
6076 _inputmodules="live555 $_inputmodules"
6077 elif test "$_live_dist" = yes && test "$_network" = yes ; then
6078 _res_comment="using distribution version"
6079 _live="yes"
6080 _def_live='#define STREAMING_LIVE555 1'
6081 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6082 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6083 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6084 _inputmodules="live555 $_inputmodules"
6085 else
6086 _def_live='#undef STREAMING_LIVE555'
6087 _noinputmodules="live555 $_noinputmodules"
6089 echores "$_live"
6092 echocheck "FFmpeg libavutil"
6093 if test "$_libavutil_a" = auto ; then
6094 if test -d libavutil ; then
6095 _libavutil_a=yes
6096 _res_comment="static"
6097 else
6098 die "MPlayer will not compile without libavutil in the source tree."
6100 elif test "$_libavutil_so" = auto ; then
6101 _libavutil_so=no
6102 cat > $TMPC << EOF
6103 #include <ffmpeg/common.h>
6104 int main(void) { ff_gcd(1,1); return 0; }
6106 if $_pkg_config --exists libavutil ; then
6107 _inc_libavutil=`$_pkg_config --cflags libavutil`
6108 _ld_tmp=`$_pkg_config --libs libavutil`
6109 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6110 && _libavutil_so=yes
6111 elif cc_check -lavutil $_ld_lm ; then
6112 _ld_extra="$_ld_extra -lavutil"
6113 _libavutil_so=yes
6114 _res_comment="using libavutil.so, but static libavutil is recommended"
6117 _libavutil=no
6118 _def_libavutil='#undef USE_LIBAVUTIL'
6119 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6120 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6121 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6122 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6123 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6124 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6125 # neither static nor shared libavutil is available, but it is mandatory ...
6126 if test "$_libavutil" = no ; then
6127 die "You need static or shared libavutil, MPlayer will not compile without!"
6129 echores "$_libavutil"
6131 echocheck "FFmpeg libavcodec"
6132 if test "$_libavcodec_a" = auto ; then
6133 _libavcodec_a=no
6134 if test -d libavcodec && test -f libavcodec/utils.c ; then
6135 _libavcodec_a="yes"
6136 _res_comment="static"
6138 elif test "$_libavcodec_so" = auto ; then
6139 _libavcodec_so=no
6140 _res_comment="libavcodec.so is discouraged over static libavcodec"
6141 cat > $TMPC << EOF
6142 #include <ffmpeg/avcodec.h>
6143 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6145 if $_pkg_config --exists libavcodec ; then
6146 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6147 _ld_tmp=`$_pkg_config --libs libavcodec`
6148 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6149 && _libavcodec_so=yes
6150 elif cc_check -lavcodec $_ld_lm ; then
6151 _ld_extra="$_ld_extra -lavcodec"
6152 _libavcodec_so=yes
6153 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6156 _libavcodec=no
6157 _def_libavcodec='#undef USE_LIBAVCODEC'
6158 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6159 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6160 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6161 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6162 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6163 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6164 test "$_libavcodec_mpegaudio_hp" = yes \
6165 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6166 if test "$_libavcodec_a" = yes ; then
6167 _codecmodules="libavcodec $_codecmodules"
6168 elif test "$_libavcodec_so" = yes ; then
6169 _codecmodules="libavcodec.so $_codecmodules"
6170 else
6171 _nocodecmodules="libavcodec $_nocodecmodules"
6173 echores "$_libavcodec"
6175 echocheck "FFmpeg libavformat"
6176 if test "$_libavformat_a" = auto ; then
6177 _libavformat_a=no
6178 if test -d libavformat && test -f libavformat/utils.c ; then
6179 _libavformat_a=yes
6180 _res_comment="static"
6182 elif test "$_libavformat_so" = auto ; then
6183 _libavformat_so=no
6184 cat > $TMPC <<EOF
6185 #include <ffmpeg/avformat.h>
6186 #include <ffmpeg/opt.h>
6187 int main(void) { av_alloc_format_context(); return 0; }
6189 if $_pkg_config --exists libavformat ; then
6190 _inc_libavformat=`$_pkg_config --cflags libavformat`
6191 _ld_tmp=`$_pkg_config --libs libavformat`
6192 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6193 && _libavformat_so=yes
6194 elif cc_check $_ld_lm -lavformat ; then
6195 _ld_extra="$_ld_extra -lavformat"
6196 _libavformat_so=yes
6197 _res_comment="using libavformat.so, but static libavformat is recommended"
6200 _libavformat=no
6201 _def_libavformat='#undef USE_LIBAVFORMAT'
6202 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6203 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6204 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6205 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6206 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6207 test "$_libavformat_so" = yes \
6208 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6209 echores "$_libavformat"
6211 echocheck "FFmpeg libpostproc"
6212 if test "$_libpostproc_a" = auto ; then
6213 _libpostproc_a=no
6214 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6215 _libpostproc_a='yes'
6216 _res_comment="static"
6218 elif test "$_libpostproc_so" = auto ; then
6219 _libpostproc_so=no
6220 cat > $TMPC << EOF
6221 #define USE_LIBPOSTPROC 1
6222 #include <inttypes.h>
6223 #include <postproc/postprocess.h>
6224 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6226 if cc_check -lpostproc $_ld_lm ; then
6227 _ld_extra="$_ld_extra -lpostproc"
6228 _libpostproc_so=yes
6229 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6232 _libpostproc=no
6233 _def_libpostproc='#undef USE_LIBPOSTPROC'
6234 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6235 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6236 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6237 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6238 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6239 test "$_libpostproc_so" = yes \
6240 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6241 echores "$_libpostproc"
6244 echocheck "md5sum support"
6245 if test "$_md5sum" = yes; then
6246 _def_md5sum="#define HAVE_MD5SUM"
6247 _vosrc="$_vosrc vo_md5sum.c"
6248 _vomodules="md5sum $_vomodules"
6249 else
6250 _def_md5sum="#undef HAVE_MD5SUM"
6251 _novomodules="md5sum $_novomodules"
6253 echores "$_md5sum"
6255 echocheck "libamr narrowband"
6256 if test "$_libamr_nb" = auto ; then
6257 _libamr_nb=no
6258 cat > $TMPC << EOF
6259 #include <amrnb/interf_dec.h>
6260 int main(void) { Speech_Decode_Frame_init(); return 0; }
6262 cc_check -lamrnb && _libamr_nb=yes
6263 if test "$_libavcodec_a" != yes ; then
6264 _libamr_nb=no
6265 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6268 if test "$_libamr_nb" = yes ; then
6269 _libamr=yes
6270 _ld_extra="$_ld_extra -lamrnb"
6271 _def_libamr='#define CONFIG_LIBAMR 1'
6272 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6273 _codecmodules="libamr_nb $_codecmodules"
6274 else
6275 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6276 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6277 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6278 _nocodecmodules="libamr_nb $_nocodecmodules"
6280 echores "$_libamr_nb"
6283 echocheck "libamr wideband"
6284 if test "$_libamr_wb" = auto ; then
6285 _libamr_wb=no
6286 cat > $TMPC << EOF
6287 #include <amrwb/dec_if.h>
6288 int main(void) { D_IF_init(); return 0; }
6290 cc_check -lamrwb && _libamr_wb=yes
6291 if test "$_libavcodec_a" != yes ; then
6292 _libamr_wb=no
6293 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6296 if test "$_libamr_wb" = yes ; then
6297 _libamr=yes
6298 _ld_extra="$_ld_extra -lamrwb"
6299 _def_libamr='#define CONFIG_LIBAMR 1'
6300 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6301 _codecmodules="libamr_wb $_codecmodules"
6302 else
6303 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6304 _nocodecmodules="libamr_wb $_nocodecmodules"
6305 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6306 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6308 echores "$_libamr_wb"
6310 echocheck "libdv-0.9.5+"
6311 if test "$_libdv" = auto ; then
6312 _libdv=no
6313 cat > $TMPC <<EOF
6314 #include <libdv/dv.h>
6315 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6317 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6319 if test "$_libdv" = yes ; then
6320 _def_libdv='#define HAVE_LIBDV095 1'
6321 _ld_extra="$_ld_extra -ldv"
6322 _codecmodules="libdv $_codecmodules"
6323 else
6324 _def_libdv='#undef HAVE_LIBDV095'
6325 _nocodecmodules="libdv $_nocodecmodules"
6327 echores "$_libdv"
6329 echocheck "zr"
6330 if test "$_zr" = auto ; then
6331 #36067's seem to identify themselves as 36057PQC's, so the line
6332 #below should work for 36067's and 36057's.
6333 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6334 _zr=yes
6335 else
6336 _zr=no
6339 if test "$_zr" = yes ; then
6340 if test "$_libavcodec_a" = yes ; then
6341 _def_zr='#define HAVE_ZR 1'
6342 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6343 _vomodules="zr zr2 $_vomodules"
6344 else
6345 _res_comment="libavcodec (static) is required by zr, sorry"
6346 _novomodules="zr $_novomodules"
6347 _def_zr='#undef HAVE_ZR'
6349 else
6350 _def_zr='#undef HAVE_ZR'
6351 _novomodules="zr zr2 $_novomodules"
6353 echores "$_zr"
6355 echocheck "bl"
6356 if test "$_bl" = yes ; then
6357 _def_bl='#define HAVE_BL 1'
6358 _vosrc="$_vosrc vo_bl.c"
6359 _vomodules="bl $_vomodules"
6360 else
6361 _def_bl='#undef HAVE_BL'
6362 _novomodules="bl $_novomodules"
6364 echores "$_bl"
6367 echocheck "XviD"
6368 if test "$_xvid" = auto ; then
6369 _xvid=no
6370 cat > $TMPC << EOF
6371 #include <xvid.h>
6372 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6374 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6375 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6376 done
6379 if test "$_xvid" = yes ; then
6380 _def_xvid='#define HAVE_XVID4 1'
6381 _codecmodules="xvid $_codecmodules"
6382 else
6383 _def_xvid='#undef HAVE_XVID4'
6384 _nocodecmodules="xvid $_nocodecmodules"
6385 _libavencoders=`echo $_libavencoders | sed -e s/XVID_ENCODER// `
6387 echores "$_xvid"
6389 if test "$_xvid" = yes ; then
6390 echocheck "XviD two pass plugin"
6391 cat > $TMPC << EOF
6392 #include <xvid.h>
6393 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6395 if cc_check ; then
6396 _lavc_xvid=yes
6397 _def_lavc_xvid='#define CONFIG_XVID 1'
6398 else
6399 _lavc_xvid=no
6400 _def_lavc_xvid='#undef CONFIG_XVID'
6402 echores "$_lavc_xvid"
6406 echocheck "x264"
6407 if test "$_x264" = auto ; then
6408 cat > $TMPC << EOF
6409 #include <inttypes.h>
6410 #include <x264.h>
6411 #if X264_BUILD < 53
6412 #error We do not support old versions of x264. Get the latest from SVN.
6413 #endif
6414 int main(void) { x264_encoder_open((void*)0); return 0; }
6416 _x264=no
6417 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6418 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6419 done
6422 if test "$_x264" = yes ; then
6423 _x264=yes
6424 _def_x264='#define HAVE_X264 1'
6425 _codecmodules="x264 $_codecmodules"
6426 if echo $_libavencoders | grep -q X264 ; then
6427 _lavc_x264=yes
6428 _def_lavc_x264='#define CONFIG_X264 1'
6429 _libs_mplayer="$_libs_mplayer $_ld_x264"
6430 else
6431 _lavc_x264=no
6432 _def_lavc_x264='#undef CONFIG_X264'
6434 else
6435 _x264=no
6436 _lavc_x264=no
6437 _def_x264='#undef HAVE_X264'
6438 _def_lavc_x264='#undef CONFIG_X264'
6439 _nocodecmodules="x264 $_nocodecmodules"
6440 _libavencoders=`echo $_libavencoders | sed -e s/X264_ENCODER// `
6442 echores "$_x264 (in libavcodec: $_lavc_x264)"
6445 echocheck "nut"
6446 if test "$_nut" = auto ; then
6447 cat > $TMPC << EOF
6448 #include <stdio.h>
6449 #include <stdlib.h>
6450 #include <inttypes.h>
6451 #include <libnut.h>
6452 int main(void) { (void)nut_error(0); return 0; }
6454 _nut=no
6455 cc_check -lnut && _nut=yes
6458 if test "$_nut" = yes ; then
6459 _def_nut='#define HAVE_LIBNUT 1'
6460 _ld_extra="$_ld_extra -lnut"
6461 else
6462 _def_nut='#undef HAVE_LIBNUT'
6463 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6465 echores "$_nut"
6468 # mencoder requires (optional) those libs: libmp3lame
6469 if test "$_mencoder" != no ; then
6471 echocheck "libmp3lame (for mencoder)"
6472 _mp3lame=no
6473 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6474 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6475 cat > $TMPC <<EOF
6476 #include <lame/lame.h>
6477 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; }
6479 # Note: libmp3lame usually depends on vorbis
6480 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6481 if test "$_mp3lame" = yes ; then
6482 _def_mp3lame="#define HAVE_MP3LAME"
6483 _ld_mp3lame=-lmp3lame
6484 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6485 cat > $TMPC << EOF
6486 #include <lame/lame.h>
6487 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6489 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6490 cat > $TMPC << EOF
6491 #include <lame/lame.h>
6492 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6494 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6495 if echo $_libavencoders | grep -q MP3LAME ; then
6496 _lavc_mp3lame=yes
6497 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6498 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6499 else
6500 _lavc_mp3lame=no
6501 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6503 else
6504 _def_mp3lame='#undef HAVE_MP3LAME'
6505 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6507 echores "$_mp3lame"
6511 echocheck "mencoder"
6512 _mencoder_flag='#undef HAVE_MENCODER'
6513 if test "$_mencoder" = yes ; then
6514 _mencoder_flag='#define HAVE_MENCODER'
6515 _def_muxers='#define CONFIG_MUXERS 1'
6516 else
6517 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6518 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6519 _libavmuxers=""
6521 echores "$_mencoder"
6523 echocheck "fastmemcpy"
6524 # fastmemcpy check is done earlier with tests of CPU & binutils features
6525 if test "$_fastmemcpy" = yes ; then
6526 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6527 else
6528 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6530 echores "$_fastmemcpy"
6532 echocheck "UniquE RAR File Library"
6533 if test "$_unrarlib" = yes ; then
6534 _def_unrarlib='#define USE_UNRARLIB 1'
6535 else
6536 _def_unrarlib='#undef USE_UNRARLIB'
6538 echores "$_unrarlib"
6540 echocheck "TV interface"
6541 if test "$_tv" = yes ; then
6542 _def_tv='#define USE_TV 1'
6543 _inputmodules="tv $_inputmodules"
6544 else
6545 _noinputmodules="tv $_noinputmodules"
6546 _def_tv='#undef USE_TV'
6548 echores "$_tv"
6551 if bsd; then
6552 echocheck "*BSD BT848 bt8xx header"
6553 _ioctl_bt848_h=no
6554 for file in "machine/ioctl_bt848.h" \
6555 "dev/bktr/ioctl_bt848.h" \
6556 "dev/video/bktr/ioctl_bt848.h" \
6557 "dev/ic/bt8xx.h" ; do
6558 cat > $TMPC <<EOF
6559 #include <sys/types.h>
6560 #include <$file>
6561 int main(void) {
6562 ioctl(0, TVTUNER_GETFREQ, 0);
6563 return 0;
6566 if cc_check ; then
6567 _ioctl_bt848_h=yes
6568 _ioctl_bt848_h_name="$file"
6569 break;
6571 done
6572 if test "$_ioctl_bt848_h" = yes ; then
6573 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6574 _res_comment="using $_ioctl_bt848_h_name"
6575 else
6576 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6578 echores "$_ioctl_bt848_h"
6580 echocheck "*BSD ioctl_meteor.h"
6581 _ioctl_meteor_h=no
6582 for file in "machine/ioctl_meteor.h" \
6583 "dev/bktr/ioctl_meteor.h" \
6584 "dev/video/bktr/ioctl_meteor.h" ; do
6585 cat > $TMPC <<EOF
6586 #include <sys/types.h>
6587 #include <$file>
6588 int main(void) {
6589 ioctl(0, METEORSINPUT, 0);
6590 return 0;
6593 if cc_check ; then
6594 _ioctl_meteor_h=yes
6595 _ioctl_meteor_h_name="$file"
6596 break;
6598 done
6599 if test "$_ioctl_meteor_h" = yes ; then
6600 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6601 _res_comment="using $_ioctl_meteor_h_name"
6602 else
6603 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6605 echores "$_ioctl_meteor_h"
6607 echocheck "*BSD BrookTree 848 TV interface"
6608 if test "$_tv_bsdbt848" = auto ; then
6609 _tv_bsdbt848=no
6610 if test "$_tv" = yes ; then
6611 cat > $TMPC <<EOF
6612 #include <sys/types.h>
6613 $_def_ioctl_meteor_h_name
6614 $_def_ioctl_bt848_h_name
6615 #ifdef IOCTL_METEOR_H_NAME
6616 #include IOCTL_METEOR_H_NAME
6617 #endif
6618 #ifdef IOCTL_BT848_H_NAME
6619 #include IOCTL_BT848_H_NAME
6620 #endif
6621 int main(void){
6622 ioctl(0, METEORSINPUT, 0);
6623 ioctl(0, TVTUNER_GETFREQ, 0);
6624 return 0;
6627 cc_check && _tv_bsdbt848=yes
6630 if test "$_tv_bsdbt848" = yes ; then
6631 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6632 _inputmodules="tv-bsdbt848 $_inputmodules"
6633 else
6634 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6635 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6637 echores "$_tv_bsdbt848"
6638 fi #if bsd
6641 echocheck "Video 4 Linux TV interface"
6642 if test "$_tv_v4l1" = auto ; then
6643 _tv_v4l1=no
6644 if test "$_tv" = yes && linux ; then
6645 cat > $TMPC <<EOF
6646 #include <stdlib.h>
6647 #include <linux/videodev.h>
6648 int main(void) { return 0; }
6650 cc_check && _tv_v4l1=yes
6653 if test "$_tv_v4l1" = yes ; then
6654 _audio_input=yes
6655 _tv_v4l=yes
6656 _def_tv_v4l='#define HAVE_TV_V4L 1'
6657 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6658 _inputmodules="tv-v4l $_inputmodules"
6659 else
6660 _noinputmodules="tv-v4l1 $_noinputmodules"
6661 _def_tv_v4l='#undef HAVE_TV_V4L'
6663 echores "$_tv_v4l1"
6666 echocheck "Video 4 Linux 2 TV interface"
6667 if test "$_tv_v4l2" = auto ; then
6668 _tv_v4l2=no
6669 if test "$_tv" = yes && linux ; then
6670 cat > $TMPC <<EOF
6671 #include <stdlib.h>
6672 #include <linux/types.h>
6673 #include <linux/videodev2.h>
6674 int main(void) { return 0; }
6676 cc_check && _tv_v4l2=yes
6679 if test "$_tv_v4l2" = yes ; then
6680 _audio_input=yes
6681 _tv_v4l=yes
6682 _def_tv_v4l='#define HAVE_TV_V4L 1'
6683 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6684 _inputmodules="tv-v4l2 $_inputmodules"
6685 else
6686 _noinputmodules="tv-v4l2 $_noinputmodules"
6687 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6689 echores "$_tv_v4l2"
6692 echocheck "Radio interface"
6693 if test "$_radio" = yes ; then
6694 _def_radio='#define USE_RADIO 1'
6695 _inputmodules="radio $_inputmodules"
6696 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6697 _radio_capture=no
6699 if test "$_radio_capture" = yes ; then
6700 _audio_input=yes
6701 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6702 else
6703 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6705 else
6706 _noinputmodules="radio $_noinputmodules"
6707 _def_radio='#undef USE_RADIO'
6708 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6709 _radio_capture=no
6711 echores "$_radio"
6712 echocheck "Capture for Radio interface"
6713 echores "$_radio_capture"
6715 echocheck "Video 4 Linux 2 Radio interface"
6716 if test "$_radio_v4l2" = auto ; then
6717 _radio_v4l2=no
6718 if test "$_radio" = yes && linux ; then
6719 cat > $TMPC <<EOF
6720 #include <stdlib.h>
6721 #include <linux/types.h>
6722 #include <linux/videodev2.h>
6723 int main(void) { return 0; }
6725 cc_check && _radio_v4l2=yes
6728 if test "$_radio_v4l2" = yes ; then
6729 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6730 else
6731 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6733 echores "$_radio_v4l2"
6735 echocheck "Video 4 Linux Radio interface"
6736 if test "$_radio_v4l" = auto ; then
6737 _radio_v4l=no
6738 if test "$_radio" = yes && linux ; then
6739 cat > $TMPC <<EOF
6740 #include <stdlib.h>
6741 #include <linux/videodev.h>
6742 int main(void) { return 0; }
6744 cc_check && _radio_v4l=yes
6747 if test "$_radio_v4l" = yes ; then
6748 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6749 else
6750 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6752 echores "$_radio_v4l"
6754 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6755 echocheck "*BSD BrookTree 848 Radio interface"
6756 _radio_bsdbt848=no
6757 cat > $TMPC <<EOF
6758 #include <sys/types.h>
6759 $_def_ioctl_bt848_h_name
6760 #ifdef IOCTL_BT848_H_NAME
6761 #include IOCTL_BT848_H_NAME
6762 #endif
6763 int main(void){
6764 ioctl(0, RADIO_GETFREQ, 0);
6765 return 0;
6768 cc_check && _radio_bsdbt848=yes
6769 echores "$_radio_bsdbt848"
6770 fi #if bsd && radio && radio_bsdbt848
6772 if test "$_radio_bsdbt848" = yes ; then
6773 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
6774 else
6775 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
6778 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6779 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6780 die "Radio driver requires BSD BT848, V4L or V4L2!"
6783 echocheck "Video 4 Linux 2 MPEG PVR interface"
6784 if test "$_pvr" = auto ; then
6785 _pvr=no
6786 if test "$_tv_v4l2" = yes && linux ; then
6787 cat > $TMPC <<EOF
6788 #include <stdlib.h>
6789 #include <inttypes.h>
6790 #include <linux/types.h>
6791 #include <linux/videodev2.h>
6792 int main(void) { struct v4l2_ext_controls ext; return 0; }
6794 cc_check && _pvr=yes
6797 if test "$_pvr" = yes ; then
6798 _def_pvr='#define HAVE_PVR 1'
6799 _inputmodules="pvr $_inputmodules"
6800 else
6801 _noinputmodules="pvr $_noinputmodules"
6802 _def_pvr='#undef HAVE_PVR'
6804 echores "$_pvr"
6807 echocheck "audio select()"
6808 if test "$_select" = no ; then
6809 _def_select='#undef HAVE_AUDIO_SELECT'
6810 elif test "$_select" = yes ; then
6811 _def_select='#define HAVE_AUDIO_SELECT 1'
6813 echores "$_select"
6816 echocheck "ftp"
6817 if not beos && test "$_ftp" = yes ; then
6818 _def_ftp='#define HAVE_FTP 1'
6819 _inputmodules="ftp $_inputmodules"
6820 else
6821 _noinputmodules="ftp $_noinputmodules"
6822 _def_ftp='#undef HAVE_FTP'
6824 echores "$_ftp"
6826 echocheck "vstream client"
6827 if test "$_vstream" = auto ; then
6828 _vstream=no
6829 cat > $TMPC <<EOF
6830 #include <vstream-client.h>
6831 void vstream_error(const char *format, ... ) {}
6832 int main(void) { vstream_start(); return 0; }
6834 cc_check -lvstream-client && _vstream=yes
6836 if test "$_vstream" = yes ; then
6837 _def_vstream='#define HAVE_VSTREAM 1'
6838 _inputmodules="vstream $_inputmodules"
6839 _ld_extra="$_ld_extra -lvstream-client"
6840 else
6841 _noinputmodules="vstream $_noinputmodules"
6842 _def_vstream='#undef HAVE_VSTREAM'
6844 echores "$_vstream"
6846 # endian testing
6847 echocheck "byte order"
6848 if test "$_big_endian" = auto ; then
6849 cat > $TMPC <<EOF
6850 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6851 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6852 int main(){
6853 return (int)ascii_name;
6856 if cc_check ; then
6857 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6858 _big_endian=yes
6859 else
6860 _big_endian=no
6862 else
6863 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
6866 if test "$_big_endian" = yes ; then
6867 _byte_order='big-endian'
6868 _def_words_endian='#define WORDS_BIGENDIAN 1'
6869 else
6870 _byte_order='little-endian'
6871 _def_words_endian='#undef WORDS_BIGENDIAN'
6873 echores "$_byte_order"
6875 echocheck "OSD menu"
6876 if test "$_menu" = yes ; then
6877 _def_menu='#define HAVE_MENU 1'
6878 else
6879 _def_menu='#undef HAVE_MENU'
6881 echores "$_menu"
6884 echocheck "QuickTime codecs"
6885 if test "$_qtx" = auto ; then
6886 test "$_win32dll" = yes || darwin && _qtx=yes
6888 if test "$_qtx" = yes ; then
6889 _def_qtx='#define USE_QTX_CODECS 1'
6890 _codecmodules="qtx $_codecmodules"
6891 else
6892 _def_qtx='#undef USE_QTX_CODECS'
6893 _nocodecmodules="qtx $_nocodecmodules"
6895 echores "$_qtx"
6898 echocheck "Subtitles sorting"
6899 if test "$_sortsub" = yes ; then
6900 _def_sortsub='#define USE_SORTSUB 1'
6901 else
6902 _def_sortsub='#undef USE_SORTSUB'
6904 echores "$_sortsub"
6907 echocheck "XMMS inputplugin support"
6908 if test "$_xmms" = yes ; then
6909 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6910 _xmmsplugindir=`xmms-config --input-plugin-dir`
6911 _xmmslibdir=`xmms-config --exec-prefix`/lib
6912 else
6913 _xmmsplugindir=/usr/lib/xmms/Input
6914 _xmmslibdir=/usr/lib
6917 _def_xmms='#define HAVE_XMMS 1'
6918 if darwin ; then
6919 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
6920 else
6921 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6923 else
6924 _def_xmms='#undef HAVE_XMMS'
6926 echores "$_xmms"
6928 echocheck "inet6"
6929 if test "$_inet6" = auto ; then
6930 cat > $TMPC << EOF
6931 #include <sys/types.h>
6932 #include <sys/socket.h>
6933 #include <netinet/in.h>
6934 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6936 _inet6=no
6937 if cc_check ; then
6938 _inet6=yes
6941 if test "$_inet6" = yes ; then
6942 _def_inet6='#define HAVE_AF_INET6 1'
6943 else
6944 _def_inet6='#undef HAVE_AF_INET6'
6946 echores "$_inet6"
6949 echocheck "gethostbyname2"
6950 if test "$_gethostbyname2" = auto ; then
6951 cat > $TMPC << EOF
6952 #include <sys/types.h>
6953 #include <sys/socket.h>
6954 #include <netdb.h>
6955 int main(void) { gethostbyname2("", AF_INET); }
6957 _gethostbyname2=no
6958 if cc_check ; then
6959 _gethostbyname2=yes
6963 if test "$_gethostbyname2" = yes ; then
6964 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6965 else
6966 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6968 echores "$_gethostbyname2"
6971 # --------------- GUI specific tests begin -------------------
6972 echocheck "GUI"
6973 echo "$_gui"
6974 if test "$_gui" = yes ; then
6976 # Required libraries
6977 test "$_libavcodec" != yes && die "The GUI requires libavcodec with PNG support."
6978 if not win32 ; then
6979 test "$_x11" != yes && die "X11 support required for GUI compilation."
6981 echocheck "XShape extension"
6982 if test "$_xshape" = auto ; then
6983 _xshape=no
6984 cat > $TMPC << EOF
6985 #include <X11/Xlib.h>
6986 #include <X11/Xproto.h>
6987 #include <X11/Xutil.h>
6988 #include <X11/extensions/shape.h>
6989 #include <stdlib.h>
6990 int main(void) {
6991 char *name = ":0.0";
6992 Display *wsDisplay;
6993 int exitvar = 0;
6994 int eventbase, errorbase;
6995 if (getenv("DISPLAY"))
6996 name=getenv("DISPLAY");
6997 wsDisplay=XOpenDisplay(name);
6998 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6999 exitvar=1;
7000 XCloseDisplay(wsDisplay);
7001 return exitvar;
7004 cc_check && _xshape=yes
7006 if test "$_xshape" = yes ; then
7007 _def_xshape='#define HAVE_XSHAPE 1'
7008 else
7009 die "The GUI requires the X11 extension XShape (which was not found)."
7011 echores "$_xshape"
7013 #Check for GTK
7014 if test "$_gtk1" = no ; then
7015 #Check for GTK2 :
7016 echocheck "GTK+ version"
7018 if $_pkg_config gtk+-2.0 --exists ; then
7019 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7020 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7021 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7022 echores "$_gtk"
7024 # Check for GLIB2
7025 if $_pkg_config glib-2.0 --exists ; then
7026 echocheck "glib version"
7027 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7028 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7029 echores "$_glib"
7031 _def_gui='#define HAVE_NEW_GUI 1'
7032 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7033 else
7034 _gtk1=yes
7035 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7037 else
7038 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7039 _gtk1=yes
7043 if test "$_gtk1" = yes ; then
7044 # Check for old GTK (1.2.x)
7045 echocheck "GTK version"
7046 if test -z "$_gtkconfig" ; then
7047 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7048 _gtkconfig="gtk-config"
7049 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7050 _gtkconfig="gtk12-config"
7051 else
7052 die "The GUI requires GTK devel packages (which were not found)."
7055 _gtk=`$_gtkconfig --version 2>&1`
7056 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7057 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7058 echores "$_gtk (using $_gtkconfig)"
7060 # Check for GLIB
7061 echocheck "glib version"
7062 if test -z "$_glibconfig" ; then
7063 if ( glib-config --version ) >/dev/null 2>&1 ; then
7064 _glibconfig="glib-config"
7065 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7066 _glibconfig="glib12-config"
7067 else
7068 die "The GUI requires GLIB devel packages (which were not found)"
7071 _glib=`$_glibconfig --version 2>&1`
7072 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7073 echores "$_glib (using $_glibconfig)"
7075 _def_gui='#define HAVE_NEW_GUI 1'
7076 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7079 else #if not win32
7080 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7081 _def_gui='#define HAVE_NEW_GUI 1'
7082 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7083 fi #if not win32
7085 else #if test "$_gui"
7086 _def_gui='#undef HAVE_NEW_GUI'
7087 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7088 fi #if test "$_gui"
7089 # --------------- GUI specific tests end -------------------
7092 if test "$_charset" = "noconv" ; then
7093 _charset=""
7095 if test "$_charset" ; then
7096 _def_charset="#define MSG_CHARSET \"$_charset\""
7097 else
7098 _def_charset="#undef MSG_CHARSET"
7101 if test "$_charset" = "UTF-8" ; then
7102 # hack to disable conversion in the Makefile
7103 _charset=""
7106 if test "$_charset" ; then
7107 echocheck "iconv program"
7108 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7109 if test "$?" -ne 0 ; then
7110 echores "no"
7111 echo "No working iconv program found, use "
7112 echo "--charset=UTF-8 to continue anyway."
7113 echo "If you also have problems with iconv library functions use --charset=noconv."
7114 echo "Messages in the GTK-2 interface will be broken then."
7115 exit 1
7116 else
7117 echores "yes"
7121 #############################################################################
7123 echocheck "automatic gdb attach"
7124 if test "$_crash_debug" = yes ; then
7125 _def_crash_debug='#define CRASH_DEBUG 1'
7126 else
7127 _def_crash_debug='#undef CRASH_DEBUG'
7128 _crash_debug=no
7130 echores "$_crash_debug"
7132 echocheck "compiler support for noexecstack"
7133 cat > $TMPC <<EOF
7134 int main(void) { return 0; }
7136 if cc_check -Wl,-z,noexecstack ; then
7137 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7138 echores "yes"
7139 else
7140 echores "no"
7143 echocheck "ftello()"
7144 # if we don't have ftello use the osdep/ compatibility module
7145 cat > $TMPC << EOF
7146 #include <stdio.h>
7147 #include <sys/types.h>
7148 int main (void) { ftello(stdin); return 0; }
7150 _ftello=no
7151 cc_check && _ftello=yes
7152 if test "$_ftello" = yes ; then
7153 _def_ftello='#define HAVE_FTELLO 1'
7154 _need_ftello=no
7155 else
7156 _def_ftello='#undef HAVE_FTELLO'
7157 _need_ftello=yes
7159 echores "$_ftello"
7161 # Dynamic linking flags
7162 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7163 _ld_dl_dynamic=''
7164 bsd && _ld_dl_dynamic='-rdynamic'
7165 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7166 _ld_dl_dynamic='-rdynamic'
7169 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7170 bsdos && _ld_extra="$_ld_extra -ldvd"
7171 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7172 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7174 _def_debug='#undef MP_DEBUG'
7175 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7177 _def_linux='#undef TARGET_LINUX'
7178 linux && _def_linux='#define TARGET_LINUX 1'
7181 echocheck "VIDIX"
7182 _vidix=no
7183 _def_vidix='#undef CONFIG_VIDIX'
7184 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
7185 _vidix_drv_cyberblade=no
7186 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
7187 _vidix_drv_ivtv=no
7188 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
7189 _vidix_drv_ivtv=no
7190 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
7191 _vidix_drv_mach64=no
7192 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
7193 _vidix_drv_mga=no
7194 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
7195 _vidix_drv_mga_crtc2=no
7196 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
7197 _vidix_drv_nvidia=no
7198 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
7199 _vidix_drv_pm2=no
7200 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
7201 _vidix_drv_pm3=no
7202 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
7203 _vidix_drv_radeon=no
7204 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
7205 _vidix_drv_rage128=no
7206 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
7207 _vidix_drv_savage=no
7208 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
7209 _vidix_drv_sis=no
7210 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
7211 _vidix_drv_unichrome=no
7212 if test "$_vidix_internal" = auto ; then
7213 _vidix_internal=no
7214 x86 && _vidix_internal=yes
7215 # this is broken currently, undefined references to inw, outw etc.
7216 #ppc && linux && _vidix_internal=yes
7217 alpha && linux && _vidix_internal=yes
7218 qnx || beos || darwin && _vidix_internal=no
7220 if test "$_vidix_internal" = yes; then
7221 _res_comment="internal"
7222 _vidix_external=no
7223 _vidix=yes
7224 elif test "$_vidix_external" = auto; then
7225 _vidix_external=no
7226 cat > $TMPC <<EOF
7227 #include <vidix/vidix.h>
7228 int main(void) { return 0; }
7230 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
7231 && _vidix=yes
7233 echores "$_vidix"
7235 if test "$_vidix" = yes ; then
7236 _def_vidix='#define CONFIG_VIDIX 1'
7237 _vosrc="$_vosrc vo_cvidix.c"
7238 _vomodules="cvidix $_vomodules"
7239 test $_vidix_drivers || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 savage sis unichrome"
7240 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
7242 for driver in $_vidix_drivers ; do
7243 uc_driver=`echo $driver | tr [a-z] [A-Z]`
7244 eval _vidix_drv_${driver}=yes
7245 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
7246 done
7247 else
7248 _novomodules="cvidix $_novomodules"
7251 if test "$_vidix_internal" = yes ; then
7252 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
7253 elif test "$_vidix_external" = yes ; then
7254 _libs_mplayer="$_libs_mplayer -lvidix"
7255 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
7258 if test "$_vidix" = yes && win32; then
7259 _vosrc="$_vosrc vo_winvidix.c"
7260 _vomodules="winvidix $_vomodules"
7261 _libs_mplayer="$_libs_mplayer -lgdi32"
7262 else
7263 _novomodules="winvidix $_novomodules"
7265 if test "$_vidix" = yes && test "$_x11" = yes; then
7266 _vosrc="$_vosrc vo_xvidix.c"
7267 _vomodules="xvidix $_vomodules"
7268 else
7269 _novomodules="xvidix $_novomodules"
7272 echocheck "joystick"
7273 _def_joystick='#undef HAVE_JOYSTICK'
7274 if test "$_joystick" = yes ; then
7275 if linux ; then
7276 # TODO add some check
7277 _def_joystick='#define HAVE_JOYSTICK 1'
7278 else
7279 _joystick="no (unsupported under $system_name)"
7282 echores "$_joystick"
7284 echocheck "lirc"
7285 if test "$_lirc" = auto ; then
7286 _lirc=no
7287 cat > $TMPC <<EOF
7288 #include <lirc/lirc_client.h>
7289 int main(void) { return 0; }
7291 cc_check -llirc_client && _lirc=yes
7293 if test "$_lirc" = yes ; then
7294 _def_lirc='#define HAVE_LIRC 1'
7295 _ld_extra="$_ld_extra -llirc_client"
7296 else
7297 _def_lirc='#undef HAVE_LIRC'
7299 echores "$_lirc"
7301 echocheck "lircc"
7302 if test "$_lircc" = auto ; then
7303 _lircc=no
7304 cat > $TMPC <<EOF
7305 #include <lirc/lircc.h>
7306 int main(void) { return 0; }
7308 cc_check -llircc && _lircc=yes
7310 if test "$_lircc" = yes ; then
7311 _def_lircc='#define HAVE_LIRCC 1'
7312 _ld_extra="$_ld_extra -llircc"
7313 else
7314 _def_lircc='#undef HAVE_LIRCC'
7316 echores "$_lircc"
7318 if arm; then
7319 # Detect maemo development platform libraries availability (http://www.maemo.org),
7320 # they are used when run on Nokia 770
7321 echocheck "maemo (Nokia 770)"
7322 if test "$_maemo" = auto ; then
7323 _maemo=no
7324 cat > $TMPC << EOF
7325 #include <libosso.h>
7326 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7328 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7330 if test "$_maemo" = yes ; then
7331 _def_maemo='#define HAVE_MAEMO 1'
7332 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7333 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7334 else
7335 _def_maemo='#undef HAVE_MAEMO'
7337 echores "$_maemo"
7340 echocheck "color console output"
7341 if test "$_color_console" = yes ; then
7342 _def_color_console='#define MSG_USE_COLORS 1'
7343 else
7344 _def_color_console='#undef MSG_USE_COLORS'
7346 echores "$_color_console"
7348 # linker paths should be the same for mencoder and mplayer
7349 _ld_tmp=""
7350 for I in $_libs_mplayer ; do
7351 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7352 if test -z "$_tmp" ; then
7353 _ld_extra="$I $_ld_extra"
7354 else
7355 _ld_tmp="$_ld_tmp $I"
7357 done
7358 _libs_mplayer=$_ld_tmp
7361 #############################################################################
7362 if darwin ; then
7363 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN -shared-libgcc"
7364 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7365 CFLAGS="$CFLAGS -no-cpp-precomp"
7368 if amigaos ; then
7369 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__ -DSYS_AMIGAOS4"
7371 if hpux ; then
7372 # use flag for HPUX missing setenv()
7373 CFLAGS="$CFLAGS -DHPUX"
7375 # Thread support
7376 if linux ; then
7377 CFLAGS="$CFLAGS -D_REENTRANT"
7378 elif bsd ; then
7379 # FIXME bsd needs this so maybe other OS'es
7380 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7382 if cygwin ; then
7383 CFLAGS="$CFLAGS -D__CYGWIN__ -DSYS_CYGWIN"
7385 # 64 bit file offsets?
7386 if test "$_largefiles" = yes || freebsd ; then
7387 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7388 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7389 # dvdread support requires this (for off64_t)
7390 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7394 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7395 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7397 cat > $TMPC << EOF
7398 int main() { return 0; }
7400 if cc_check -Wdeclaration-after-statement ; then
7401 CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7405 #this must be the last test to be performed or the ones following it will likely fail
7406 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7407 # to use its own copy of the library)
7408 echocheck "DVD support (libdvdnav)"
7409 if test "$_dvdnav" = auto ; then
7410 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7412 if test "$_dvdnav" = auto ; then
7413 cat > $TMPC <<EOF
7414 #include <inttypes.h>
7415 #include <dvdnav.h>
7416 int main(void) { dvdnav_t *dvd=0; return 0; }
7418 _dvdnav=no
7419 _dvdnavdir=`$_dvdnavconfig --cflags`
7420 _dvdnavlibs=`$_dvdnavconfig --libs`
7421 _dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
7422 _dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
7423 test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
7424 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7426 if test "$_dvdnav" = yes ; then
7427 _largefiles=yes
7428 _def_dvdnav='#define USE_DVDNAV 1'
7429 _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
7430 _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
7431 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7432 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7433 _inputmodules="dvdnav $_inputmodules"
7434 else
7435 _def_dvdnav='#undef USE_DVDNAV'
7436 _noinputmodules="dvdnav $_noinputmodules"
7438 echores "$_dvdnav"
7440 #############################################################################
7441 echo "Creating config.mak"
7442 cat > config.mak << EOF
7443 # -------- Generated by configure -----------
7445 LANG = C
7446 MAN_LANG = $MAN_LANG
7447 TARGET_OS = $system_name
7448 DESTDIR =
7449 prefix = \$(DESTDIR)$_prefix
7450 BINDIR = \$(DESTDIR)$_bindir
7451 DATADIR = \$(DESTDIR)$_datadir
7452 MANDIR = \$(DESTDIR)$_mandir
7453 CONFDIR = \$(DESTDIR)$_confdir
7454 LIBDIR = \$(DESTDIR)$_libdir
7455 # FFmpeg uses libdir instead of LIBDIR
7456 libdir = \$(LIBDIR)
7457 #AR = ar
7458 CC = $_cc
7459 HOST_CC = $_host_cc
7460 RANLIB = $_ranlib
7461 LDCONFIG = $_ldconfig
7462 INSTALL = $_install
7463 EXTRA_INC = $_inc_extra
7464 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7465 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7466 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7467 INSTALLSTRIP = $_install_strip
7468 CHARSET = $_charset
7469 HELP_FILE = $_mp_help
7471 EXESUF = $_exesuf
7473 MPLAYER_NETWORK = $_network
7474 FTP = $_ftp
7475 STREAMING_LIVE555 = $_live
7476 VSTREAM = $_vstream
7477 STREAM_CACHE = $_stream_cache
7478 DVBIN = $_dvbin
7479 VIDIX = $_vidix
7480 VIDIX_INTERNAL = $_vidix_internal
7481 VIDIX_EXTERNAL = $_vidix_external
7482 CONFIG_PP = yes
7483 MP3LAME = $_mp3lame
7484 LIBMENU = $_menu
7486 MP3LIB = $_mp3lib
7487 LIBA52 = $_liba52
7488 LIBMPEG2 = $_libmpeg2
7489 TREMOR_INTERNAL = $_tremor_internal
7490 TREMOR_LOW = $_tremor_low
7491 FAAD = $_faad
7493 SPEEX = $_speex
7494 MUSEPACK = $_musepack
7496 UNRARLIB = $_unrarlib
7497 PNG = $_png
7498 JPEG = $_jpeg
7499 GIF = $_gif
7501 EXTRALIBS = $_extra_libs
7502 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7503 EXTRALIBS_MPLAYER = $_libs_mplayer
7504 EXTRALIBS_MENCODER = $_libs_mencoder
7506 HAVE_MLIB = $_mlib
7507 HAVE_PTHREADS = $_pthreads
7509 HAVE_XVMC_ACCEL = $_xvmc
7511 HAVE_SYS_MMAN_H = $_mman
7512 HAVE_POSIX_SELECT = $_posix_select
7514 NEED_FSEEKO = $_need_fseeko
7515 NEED_FTELLO = $_need_ftello
7516 NEED_GETTIMEOFDAY = $_need_gettimeofday
7517 NEED_GLOB = $_need_glob
7518 NEED_SCANDIR = $_need_scandir
7519 NEED_SETENV = $_need_setenv
7520 NEED_SHMEM = $_need_shmem
7521 NEED_STRLCAT = $_need_strlcat
7522 NEED_STRLCPY = $_need_strlcpy
7523 NEED_STRSEP = $_need_strsep
7524 NEED_SWAB = $_need_swab
7525 NEED_VSSCANF = $_need_vsscanf
7527 # for FFmpeg
7528 SRC_PATH=..
7529 BUILD_ROOT=..
7530 LIBPREF=lib
7531 LIBSUF=.a
7532 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7534 # audio output
7535 OSS = $_ossaudio
7536 ALSA = $_alsa
7537 ALSA5 = $_alsa5
7538 ALSA9 = $_alsa9
7539 ALSA1X = $_alsa1x
7541 # input/demuxer/codecs
7542 JOYSTICK = $_joystick
7543 LIRC = $_lirc
7544 TV = $_tv
7545 TV_V4L = $_tv_v4l
7546 TV_V4L1 = $_tv_v4l1
7547 TV_V4L2 = $_tv_v4l2
7548 TV_BSDBT848 = $_tv_bsdbt848
7549 AUDIO_INPUT = $_audio_input
7550 PVR = $_pvr
7551 VCD = $_vcd
7552 DVDREAD = $_dvdread
7553 DVDREAD_INTERNAL = $_dvdread_internal
7554 DVDCSS_INTERNAL = $_libdvdcss_internal
7555 DVDNAV = $_dvdnav
7556 WIN32DLL = $_win32dll
7557 QTX_CODECS = $_qtx
7558 REAL_CODECS = $_real
7559 XANIM_CODECS = $_xanim
7560 LIBAVUTIL = $_libavutil
7561 LIBAVUTIL_A = $_libavutil_a
7562 LIBAVUTIL_SO = $_libavutil_so
7563 LIBAVCODEC = $_libavcodec
7564 LIBAVCODEC_A = $_libavcodec_a
7565 LIBAVCODEC_SO = $_libavcodec_so
7566 LIBAVFORMAT = $_libavformat
7567 LIBAVFORMAT_A = $_libavformat_a
7568 LIBAVFORMAT_SO = $_libavformat_so
7569 LIBPOSTPROC = $_libpostproc
7570 LIBPOSTPROC_A = $_libpostproc_a
7571 LIBPOSTPROC_SO = $_libpostproc_so
7572 ZORAN = $_zr
7573 LIBLZO = $_liblzo
7574 LIBDV = $_libdv
7575 XVID4 = $_xvid
7576 X264 = $_x264
7577 LIBNUT = $_nut
7578 MPLAYER = $_mplayer
7579 MENCODER = $_mencoder
7580 CDDA = $_cdda
7581 CDDB = $_cddb
7582 BITMAP_FONT = $_bitmap_font
7583 FREETYPE = $_freetype
7584 ASS = $_ass
7585 LIBMAD = $_mad
7586 LIBVORBIS = $_vorbis
7587 LIBTHEORA = $_theora
7588 FAAD_INTERNAL = $_faad_internal
7589 FAAD_FIXED = $_faad_fixed
7590 LIBSMBCLIENT = $_smbsupport
7591 XMMS_PLUGINS = $_xmms
7592 MACOSX = $_macosx
7593 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7594 MACOSX_BUNDLE = $_macosx_bundle
7595 MACOSX_COREVIDEO = $_macosx_corevideo
7596 TOOLAME=$_toolame
7597 TWOLAME=$_twolame
7598 FAAC=$_faac
7599 CONFIG_LIBAMR=$_libamr
7600 CONFIG_LIBAMR_NB=$_libamr_nb
7601 CONFIG_LIBAMR_WB=$_libamr_wb
7602 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7603 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7604 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7605 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7606 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7607 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7608 CONFIG_LIBFAAC=$_lavc_faac
7609 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7610 CONFIG_XVID=$_lavc_xvid
7611 CONFIG_X264=$_lavc_x264
7612 CONFIG_ZLIB=$_zlib
7613 CONFIG_GPL=yes
7614 CONFIG_ENCODERS=$_mencoder
7615 CONFIG_MUXERS=$_mencoder
7616 RADIO=$_radio
7617 RADIO_CAPTURE=$_radio_capture
7618 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7619 VIDIX_IVTV=$_vidix_drv_ivtv
7620 VIDIX_MACH64=$_vidix_drv_mach64
7621 VIDIX_MGA=$_vidix_drv_mga
7622 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7623 VIDIX_NVIDIA=$_vidix_drv_nvidia
7624 VIDIX_PM2=$_vidix_drv_pm2
7625 VIDIX_PM3=$_vidix_drv_pm3
7626 VIDIX_RADEON=$_vidix_drv_radeon
7627 VIDIX_RAGE128=$_vidix_drv_rage128
7628 VIDIX_SAVAGE=$_vidix_drv_savage
7629 VIDIX_SIS=$_vidix_drv_sis
7630 VIDIX_UNICHROME=$_vidix_drv_unichrome
7632 # --- Some stuff for autoconfigure ----
7633 $_target_arch
7634 $_target_arch_x86
7635 $_confwin32
7636 TARGET_CPU=$iproc
7637 TARGET_MMX = $_mmx
7638 TARGET_MMX2 = $_mmxext
7639 TARGET_3DNOW = $_3dnow
7640 TARGET_3DNOWEX = $_3dnowext
7641 TARGET_SSE = $_sse
7642 TARGET_CMOV = $_cmov
7643 TARGET_ALTIVEC = $_altivec
7644 TARGET_ARMV5TE = $_armv5te
7645 TARGET_ARMV6 = $_armv6
7646 TARGET_IWMMXT = $_iwmmxt
7647 TARGET_VIS = $_vis
7649 # --- GUI stuff ---
7650 GUI = $_gui
7652 # --- libvo stuff ---
7653 VO_SRCS = $_vosrc
7655 # --- libao2 stuff ---
7656 AO_SRCS = $_aosrc
7658 # --- libaf stuff ---
7659 AF_SRCS = $_afsrc
7663 #############################################################################
7665 ff_config_enable () {
7666 for part in $1; do
7667 if ` echo $2 | grep $part > /dev/null `; then
7668 echo "#define CONFIG_$part 1"
7669 echo "#define ENABLE_$part 1"
7670 else
7671 echo "#define ENABLE_$part 0"
7673 done
7676 echo "Creating config.h"
7677 cat > config.h << EOF
7678 /* -------- This file has been automatically generated by configure ---------
7679 Note: Any changes in it will be lost when you run configure again. */
7681 /* Protect against multiple inclusion */
7682 #ifndef MPLAYER_CONFIG_H
7683 #define MPLAYER_CONFIG_H 1
7685 #define CONFIGURATION "$_configuration"
7687 /* make sure we never get lavformat's poll() emulation, the results are
7688 horrible if the X libs try to actually use it, see MPlayer-users
7689 Message-ID: <45D49541.8060101@infernix.net>
7690 Date: Thu, 15 Feb 2007 18:15:45 +0100
7691 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7693 #define HAVE_SYS_POLL_H 1
7695 /* use GNU internationalization */
7696 $_def_i18n
7698 /* name of messages charset */
7699 $_def_charset
7701 /* Runtime CPU detection */
7702 $_def_runtime_cpudetection
7704 /* Dynamic a/v plugins */
7705 $_def_dynamic_plugins
7707 /* "restrict" keyword */
7708 $_def_restrict_keyword
7710 /* __builtin_expect branch prediction hint */
7711 $_def_builtin_expect
7712 #ifdef HAVE_BUILTIN_EXPECT
7713 #define likely(x) __builtin_expect ((x) != 0, 1)
7714 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7715 #else
7716 #define likely(x) (x)
7717 #define unlikely(x) (x)
7718 #endif
7720 /* attribute(used) as needed by some compilers */
7721 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7722 # define attribute_used __attribute__((used))
7723 #else
7724 # define attribute_used
7725 #endif
7727 /* compiler support for named assembler arguments */
7728 $_def_named_asm_args
7730 #define PREFIX "$_prefix"
7732 /* enable/disable SIGHANDLER */
7733 $_def_sighandler
7735 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7736 $_def_crash_debug
7738 /* Toggles debugging informations */
7739 $_def_debug
7741 /* Toggles color console output */
7742 $_def_color_console
7744 /* Indicates that libcdio is available for VCD and CD-DA playback */
7745 $_def_libcdio
7747 /* Indicates that Ogle's libdvdread is available for DVD playback */
7748 $_def_dvdread
7750 /* Indicates that dvdread is internal */
7751 $_def_dvdread_internal
7753 /* Additional options for libdvdread/libdvdcss */
7754 $_def_dvd
7755 $_def_cdrom
7756 $_def_cdio
7757 $_def_dvdio
7758 $_def_bsdi_dvd
7759 $_def_dvd_bsd
7760 $_def_dvd_linux
7761 $_dev_dvd_openbsd
7762 $_def_dvd_darwin
7763 $_def_sol_scsi_h
7764 $_def_hpux_scsi_h
7765 $_def_stddef
7767 /* Common data directory (for fonts, etc) */
7768 #define MPLAYER_DATADIR "$_datadir"
7769 #define MPLAYER_CONFDIR "$_confdir"
7770 #define MPLAYER_LIBDIR "$_libdir"
7772 /* Define this to compile stream-caching support, it can be enabled via
7773 -cache <kilobytes> */
7774 $_def_stream_cache
7776 /* Define if you are using XviD library */
7777 $_def_xvid
7779 /* Define if you are using the X.264 library */
7780 $_def_x264
7782 /* Define if you are using libnut */
7783 $_def_nut
7785 /* Define to include support for libdv-0.9.5 */
7786 $_def_libdv
7788 /* If build mencoder */
7789 $_mencoder_flag
7791 /* Indicates if libmp3lame is available
7792 Note: for mencoder */
7793 $_def_mp3lame
7794 $_def_mp3lame_preset
7795 $_def_mp3lame_preset_medium
7797 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7798 (use -bps or -nobps commandline option for run-time method selection)
7799 -bps gives better sync for vbr mp3 audio, it is now default */
7800 #define AVI_SYNC_BPS 1
7802 /* Undefine this if you do not want to select mono audio (left or right)
7803 with a stereo MPEG layer 2/3 audio stream. The command line option
7804 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7805 right-only), with 0 being the default.
7807 #define USE_FAKE_MONO 1
7809 /* Undefine this if your sound card driver has no working select().
7810 If you have kernel Oops, player hangups, or just no audio, you should
7811 try to recompile MPlayer with this option disabled! */
7812 $_def_select
7814 /* define this to use iconv(3) function to codepage conversions */
7815 $_def_iconv
7817 /* define this to use nl_langinfo function */
7818 $_def_langinfo
7820 /* define this to use RTC (/dev/rtc) for video timers */
7821 $_def_rtc
7823 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7824 #define MAX_OUTBURST 65536
7826 /* set up audio OUTBURST. Do not change this! */
7827 #define OUTBURST 512
7829 /* Define this if your system has the header file for the OSS sound interface */
7830 $_def_sys_soundcard
7832 /* Define this if your system has the header file for the OSS sound interface
7833 * in /usr/include */
7834 $_def_soundcard
7836 /* Define this if your system has the sysinfo header */
7837 $_def_sys_sysinfo
7839 /* Define this if your system has ftello() */
7841 $_def_ftello
7842 #ifndef HAVE_FTELLO
7843 /* Need these for FILE and off_t an config.h is usually before other includes*/
7844 #include <stdio.h>
7845 #include <sys/types.h>
7846 off_t ftello(FILE *);
7847 #endif
7849 /* Define this if your system has the "malloc.h" header file */
7850 $_def_malloc
7852 /* memalign is mapped to malloc if unsupported */
7853 $_def_memalign
7854 $_def_map_memalign
7855 $_def_memalign_hack
7857 /* assembler handling of .align */
7858 $_def_asmalign_pot
7860 /* Define this if your system has the "alloca.h" header file */
7861 $_def_alloca
7863 /* Define this if your system has the "sys/mman.h" header file */
7864 $_def_mman
7865 $_def_mman_has_map_failed
7867 /* Define this if you have the elf dynamic linker -ldl library */
7868 $_def_dl
7870 /* Define this if you have the kstat kernel statistics library */
7871 $_def_kstat
7873 /* Define this if you have zlib */
7874 $_def_zlib
7875 #ifdef HAVE_ZLIB
7876 #define CONFIG_ZLIB 1
7877 #endif
7879 /* Define this if you have shm support */
7880 $_def_shm
7882 /* Define this if your system has scandir & alphasort */
7883 $_def_scandir
7885 /* Define this if your system has strsep */
7886 $_def_strsep
7888 /* Define this if your system has strlcpy */
7889 $_def_strlcpy
7890 #ifndef HAVE_STRLCPY
7891 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7892 #endif
7894 /* Define this if your system has strlcat */
7895 $_def_strlcat
7896 #ifndef HAVE_STRLCAT
7897 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7898 #endif
7900 /* Define this if your system has fseeko */
7901 $_def_fseeko
7902 #ifndef HAVE_FSEEKO
7903 /* Need these for FILE and off_t an config.h is usually before other includes*/
7904 #include <stdio.h>
7905 #include <sys/types.h>
7906 int fseeko(FILE *, off_t, int);
7907 #endif
7909 $_def_localtime_r
7911 /* Define this if your system has vsscanf */
7912 $_def_vsscanf
7914 /* Define this if your system has swab */
7915 $_def_swab
7917 /* Define this if your system has posix select */
7918 $_def_posix_select
7920 /* Define this if your system has gettimeofday */
7921 $_def_gettimeofday
7923 /* Define this if your system has glob */
7924 $_def_glob
7926 /* Define this if your system has setenv */
7927 $_def_setenv
7928 #ifndef HAVE_SETENV
7929 int setenv(const char *name, const char *val, int overwrite);
7930 #endif
7932 /* Define this if your system has sysi86 */
7933 $_def_sysi86
7934 $_def_sysi86_iv
7936 /* Define this if your system has pthreads */
7937 $_def_pthreads
7939 /* Define this if you enabled thread support for libavcodec */
7940 $_def_threads
7942 /* LIRC (remote control, see www.lirc.org) support: */
7943 $_def_lirc
7945 /* Support for maemo (http://www.maemo.org) */
7946 $_def_maemo
7949 * LIRCCD (LIRC client daemon)
7950 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7952 $_def_lircc
7954 /* DVD navigation support using libdvdnav */
7955 $_def_dvdnav
7956 $_def_dvdnav_version
7958 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7959 #define MPEG12_POSTPROC 1
7961 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7962 $_def_libpostproc
7963 $_def_libpostproc_a
7964 $_def_libpostproc_so
7966 /* Win32 DLL support */
7967 $_def_win32dll
7968 #define WIN32_PATH "$_win32codecsdir"
7970 /* Mac OS X specific features */
7971 $_def_macosx
7972 $_def_macosx_finder_support
7973 $_def_macosx_bundle
7974 $_def_macosx_corevideo
7976 /* Build our Win32-loader */
7977 $_def_win32_loader
7979 /* ffmpeg's libavcodec support (requires libavcodec source) */
7980 $_def_libavcodec
7981 $_def_libavcodec_a
7982 $_def_libavcodec_so
7983 $_def_libavcodec_mpegaudio_hp
7985 /* ffmpeg's libavformat support (requires libavformat source) */
7986 $_def_libavformat
7987 $_def_libavformat_a
7988 $_def_libavformat_so
7990 $_def_libavutil
7991 $_def_libavutil_a
7992 $_def_libavutil_so
7994 /* Use libavcodec's decoders */
7995 #define CONFIG_DECODERS 1
7996 /* Use libavcodec's encoders */
7997 #define CONFIG_ENCODERS 1
7999 /* Use libavformat's demuxers */
8000 #define CONFIG_DEMUXERS 1
8001 /* Use libavformat's muxers */
8002 $_def_muxers
8004 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8005 #define HAVE_EBX_AVAILABLE 1
8006 #define HAVE_EBP_AVAILABLE 1
8008 #define CONFIG_GPL 1
8010 /* Use AMR codecs from libavcodec. */
8011 $_def_libamr
8012 $_def_libamr_nb
8013 $_def_libamr_wb
8015 /* Use specific parts from FFmpeg. */
8016 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8017 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8018 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8019 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8020 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8021 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8022 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8024 $_def_lavc_faac
8025 $_def_lavc_xvid
8026 $_def_lavc_mp3lame
8027 $_def_lavc_x264
8029 /* Use codec libs included in mplayer CVS / source dist: */
8030 $_def_mp3lib
8031 $_def_liba52
8032 $_def_libmpeg2
8034 /* XAnim DLL support */
8035 $_def_xanim
8036 /* Default search path */
8037 $_def_xanim_path
8039 /* RealPlayer DLL support */
8040 $_def_real
8041 /* Default search path */
8042 $_def_real_path
8044 /* LIVE555 Streaming Media library support */
8045 $_def_live
8047 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8048 $_def_fastmemcpy
8050 /* Use unrarlib for Vobsubs */
8051 $_def_unrarlib
8053 /* gui support, please do not edit this option */
8054 $_def_gui
8055 $_def_gtk2_gui
8057 /* Audio output drivers */
8058 $_def_ossaudio
8059 $_def_ossaudio_devdsp
8060 $_def_ossaudio_devmixer
8061 $_def_alsa5
8062 $_def_alsa9
8063 $_def_alsa1x
8064 $_def_arts
8065 $_def_esd
8066 $_def_esd_latency
8067 $_def_polyp
8068 $_def_jack
8069 $_def_openal
8070 $_def_openal_h
8071 $_def_sys_asoundlib_h
8072 $_def_alsa_asoundlib_h
8073 $_def_sunaudio
8074 $_def_sgiaudio
8075 $_def_win32waveout
8076 $_def_nas
8078 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8079 #undef FAST_OSD
8080 #undef FAST_OSD_TABLE
8082 /* Enable TV Interface support */
8083 $_def_tv
8085 /* Enable Video 4 Linux TV interface support */
8086 $_def_tv_v4l
8088 /* Enable Video 4 Linux 1 TV interface support */
8089 $_def_tv_v4l1
8091 /* Enable Video 4 Linux 2 TV interface support */
8092 $_def_tv_v4l2
8094 /* *BSD BrookTree headers */
8095 $_def_ioctl_meteor_h_name
8096 $_def_ioctl_bt848_h_name
8098 /* Enable *BSD BrookTree TV interface support */
8099 $_def_tv_bsdbt848
8101 /* Enable Radio Interface support */
8102 $_def_radio
8104 /* Enable Capture for Radio Interface support */
8105 $_def_radio_capture
8107 /* Enable Video 4 Linux Radio interface support */
8108 $_def_radio_v4l
8110 /* Enable Video 4 Linux 2 Radio interface support */
8111 $_def_radio_v4l2
8113 /* Enable *BSD BrookTree Radio interface support */
8114 $_def_radio_bsdbt848
8116 /* Enable Video 4 Linux 2 MPEG PVR support */
8117 $_def_pvr
8119 /* Define if your processor stores words with the most significant
8120 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8121 $_def_words_endian
8123 $_def_arch
8124 $_def_arch_x86
8126 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8127 have the instruction. */
8128 $_def_dcbzl
8130 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
8131 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
8133 #ifdef ARCH_POWERPC
8134 #define ARCH_PPC 1
8135 #endif
8137 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
8138 #ifdef ARCH_ARMV4L
8139 #define ARCH_ARM 1
8140 #endif
8142 /* only gcc3 can compile mvi instructions */
8143 $_def_gcc_mvi_support
8145 /* Define this for Cygwin build for win32 */
8146 $_def_confwin32
8148 /* Define this to any prefered value from 386 up to infinity with step 100 */
8149 #define __CPU__ $iproc
8151 $_mp_wordsize
8153 $_def_linux
8155 $_def_vcd
8157 #ifdef sun
8158 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8159 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8160 #elif defined(HPUX)
8161 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8162 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8163 #elif defined(WIN32)
8164 #define DEFAULT_CDROM_DEVICE "D:"
8165 #define DEFAULT_DVD_DEVICE "D:"
8166 #elif defined(SYS_DARWIN)
8167 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8168 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8169 #elif defined(__OpenBSD__)
8170 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8171 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8172 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8173 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8174 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8175 #elif defined(SYS_AMIGAOS4)
8176 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8177 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8178 #else
8179 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8180 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8181 #endif
8184 /*----------------------------------------------------------------------------
8186 ** NOTE: Instead of modifying these definitions here, use the
8187 ** --enable/--disable options of the ./configure script!
8188 ** See ./configure --help for details.
8190 *---------------------------------------------------------------------------*/
8192 /* C99 lrintf function available */
8193 $_def_lrintf
8195 /* round function is available */
8196 $_def_round
8198 /* yes, we have inttypes.h */
8199 #define HAVE_INTTYPES_H 1
8201 /* int_fastXY_t emulation */
8202 $_def_fast_inttypes
8204 /* nanosleep support */
8205 $_def_nanosleep
8207 /* SMB support */
8208 $_def_smbsupport
8210 /* termcap flag for getch2.c */
8211 $_def_termcap
8213 /* termios flag for getch2.c */
8214 $_def_termios
8215 $_def_termios_h
8216 $_def_termios_sys_h
8218 /* enable PNG support */
8219 $_def_png
8221 /* enable JPEG support */
8222 $_def_jpeg
8224 /* enable PNM support */
8225 $_def_pnm
8227 /* enable md5sum support */
8228 $_def_md5sum
8230 /* enable GIF support */
8231 $_def_gif
8232 $_def_gif_4
8233 $_def_gif_tvt_hack
8235 /* enable bitmap font support */
8236 $_def_bitmap_font
8238 /* enable FreeType support */
8239 $_def_freetype
8241 /* enable Fontconfig support */
8242 $_def_fontconfig
8244 /* enable SSA/ASS support */
8245 $_def_ass
8247 /* enable FriBiDi usage */
8248 $_def_fribidi
8250 /* enable ENCA usage */
8251 $_def_enca
8253 /* liblzo support */
8254 $_def_liblzo
8255 #ifdef USE_LIBLZO
8256 #define CONFIG_LZO 1
8257 #endif
8259 /* libmad support */
8260 $_def_mad
8262 /* enable OggVorbis support */
8263 $_def_vorbis
8264 $_def_tremor
8266 /* enable Speex support */
8267 $_def_speex
8269 /* enable musepack support */
8270 $_def_musepack
8272 /* enable OggTheora support */
8273 $_def_theora
8275 /* enable FAAD (AAC) support */
8276 $_def_faad
8277 $_def_faad_internal
8279 /* enable FAAC (AAC encoder) support */
8280 $_def_faac
8282 /* enable LADSPA plugin support */
8283 $_def_ladspa
8285 /* enable network */
8286 $_def_network
8288 /* enable ftp support */
8289 $_def_ftp
8291 /* enable vstream support */
8292 $_def_vstream
8294 /* enable winsock2 instead of Unix functions*/
8295 $_def_winsock2
8297 /* define this to use inet_aton() instead of inet_pton() */
8298 $_def_use_aton
8300 /* enables / disables cdparanoia support */
8301 $_def_cdparanoia
8302 $_def_cddb
8304 /* enables / disables VIDIX usage */
8305 $_def_vidix
8306 $_def_vidix_drv_cyberblade
8307 $_def_vidix_drv_ivtv
8308 $_def_vidix_drv_mach64
8309 $_def_vidix_drv_mga
8310 $_def_vidix_drv_mga_crtc2
8311 $_def_vidix_drv_nvidia
8312 $_def_vidix_drv_pm3
8313 $_def_vidix_drv_radeon
8314 $_def_vidix_drv_rage128
8315 $_def_vidix_drv_savage
8316 $_def_vidix_drv_sis
8317 $_def_vidix_drv_unichrome
8318 $_def_vidix_pfx
8320 /* enables / disables new input joystick support */
8321 $_def_joystick
8323 /* enables / disables QTX codecs */
8324 $_def_qtx
8326 /* enables / disables osd menu */
8327 $_def_menu
8329 /* enables / disables subtitles sorting */
8330 $_def_sortsub
8332 /* XMMS input plugin support */
8333 $_def_xmms
8334 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8336 /* enables inet6 support */
8337 $_def_inet6
8339 /* do we have gethostbyname2? */
8340 $_def_gethostbyname2
8342 /* Extension defines */
8343 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
8344 $_def_3dnowext // only define if you have 3DNOWEXT (AMD Athlon, etc.)
8345 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
8346 $_def_mmxext // only define if you have MMX2 (Athlon/PIII/4/CelII)
8347 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
8348 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
8349 $_def_ssse3 // only define if you have SSSE3 (Intel Core 2)
8350 $_def_cmov // only define if you have CMOV (i686+, without VIA C3)
8351 $_def_fast_cmov // only define if CMOV is fast
8352 $_def_altivec // only define if you have Altivec (G4)
8353 $_def_armv5te // only define if you have Enhanced DSP Extensions (ARM)
8354 $_def_armv6 // only define if you have ARMv6
8355 $_def_iwmmxt // only define if you have XScale IWMMX (ARM)
8357 $_def_altivec_h // enables usage of altivec.h
8359 $_def_mlib // Sun mediaLib, available only on solaris
8360 $_def_vis // only define if you have VIS ( ultrasparc )
8362 /* libmpeg2 uses a different feature test macro for mediaLib */
8363 #ifdef HAVE_MLIB
8364 #define LIBMPEG2_MLIB 1
8365 #endif
8367 /* libvo options */
8368 #define SCREEN_SIZE_X 1
8369 #define SCREEN_SIZE_Y 1
8370 $_def_x11
8371 $_def_xv
8372 $_def_xvmc
8373 $_def_vm
8374 $_def_xf86keysym
8375 $_def_xinerama
8376 $_def_gl
8377 $_def_gl_win32
8378 $_def_dga
8379 $_def_dga2
8380 $_def_sdl
8381 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8382 $_def_sdlbuggy
8383 $_def_directx
8384 $_def_ggi
8385 $_def_ggiwmh
8386 $_def_3dfx
8387 $_def_s3fb
8388 $_def_tdfxfb
8389 $_def_tdfxvid
8390 $_def_directfb
8391 $_def_directfb_version
8392 $_def_dfbmga
8393 $_def_zr
8394 $_def_bl
8395 $_def_mga
8396 $_def_xmga
8397 $_def_syncfb
8398 $_def_fbdev
8399 $_def_dxr2
8400 $_def_dxr3
8401 $_def_ivtv
8402 $_def_dvb
8403 $_def_dvb_in
8404 $_def_svga
8405 $_def_vesa
8406 $_def_xdpms
8407 $_def_aa
8408 $_def_caca
8409 $_def_tga
8410 $_def_toolame
8411 $_def_twolame
8413 /* used by GUI: */
8414 $_def_xshape
8416 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8417 #define X11_FULLSCREEN 1
8418 #endif
8420 #endif /* MPLAYER_CONFIG_H */
8423 #############################################################################
8425 cat << EOF
8427 Config files successfully generated by ./configure $_configuration !
8429 Install prefix: $_prefix
8430 Data directory: $_datadir
8431 Config direct.: $_confdir
8433 Byte order: $_byte_order
8434 Optimizing for: $_optimizing
8436 Languages:
8437 Messages/GUI: $_language
8440 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8441 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8442 echo
8444 cat << EOF
8446 Enabled optional drivers:
8447 Input: $_inputmodules
8448 Codecs: $_codecmodules
8449 Audio output: $_aomodules
8450 Video output: $_vomodules
8451 Audio filters: $_afmodules
8452 Disabled optional drivers:
8453 Input: $_noinputmodules
8454 Codecs: $_nocodecmodules
8455 Audio output: $_noaomodules
8456 Video output: $_novomodules
8457 Audio filters: $_noafmodules
8459 'config.h' and 'config.mak' contain your configuration options.
8460 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8461 compile *** DO NOT REPORT BUGS if you tweak these files ***
8463 'make' will now compile MPlayer and 'make install' will install it.
8464 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8469 if test "$_mtrr" = yes ; then
8470 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8471 echo
8474 if not x86_32; then
8475 cat <<EOF
8476 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8477 operating system ($system_name). You may encounter a few files that cannot
8478 be played due to missing open source video/audio codec support.
8484 cat <<EOF
8485 Check $TMPLOG if you wonder why an autodetection failed (make sure
8486 development headers/packages are installed).
8488 NOTE: The --enable-* parameters unconditionally force options on, completely
8489 skipping autodetection. This behavior is unlike what you may be used to from
8490 autoconf-based configure scripts that can decide to override you. This greater
8491 level of control comes at a price. You may have to provide the correct compiler
8492 and linker flags yourself.
8493 If you used one of these options (except --enable-gui and similar ones that
8494 turn on internal features) and experience a compilation or linking failure,
8495 make sure you have passed the necessary compiler/linker flags to configure.
8497 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8501 if test "$_warn_CFLAGS" = yes; then
8502 cat <<EOF
8504 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8506 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8508 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8509 To do so, execute 'CFLAGS= ./configure <options>'
8514 # Last move:
8515 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"