Use avcodec_decode_audio2 in ad_ffmpeg.c
[mplayer/glamo.git] / configure
blob22ec65c3636d09d0c0a94df6430e1f73ed1edfb2
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 $_pipe $_debug $_profile"
2247 _install_strip=
2248 elif test -z "$CFLAGS" ; then
2249 if test "$cc_vendor" = "intel" ; then
2250 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2251 elif test "$cc_vendor" != "gnu" ; then
2252 CFLAGS="-O2 $_march $_mcpu $_pipe"
2253 else
2254 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2256 else
2257 _warn_CFLAGS=yes
2259 if test -n "$LDFLAGS" ; then
2260 _ld_extra="$_ld_extra $LDFLAGS"
2261 _warn_CFLAGS=yes
2262 elif test "$cc_vendor" = "intel" ; then
2263 _ld_extra="$_ld_extra -i-static"
2265 if test -n "$CPPFLAGS" ; then
2266 _inc_extra="$_inc_extra $CPPFLAGS"
2267 _warn_CFLAGS=yes
2272 if x86_32 ; then
2273 # Checking assembler (_as) compatibility...
2274 # Added workaround for older as that reads from stdin by default - atmos
2275 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2276 echocheck "assembler ($_as $as_version)"
2278 _pref_as_version='2.9.1'
2279 echo 'nop' > $TMPS
2280 if test "$_mmx" = yes ; then
2281 echo 'emms' >> $TMPS
2283 if test "$_3dnow" = yes ; then
2284 _pref_as_version='2.10.1'
2285 echo 'femms' >> $TMPS
2287 if test "$_3dnowext" = yes ; then
2288 _pref_as_version='2.10.1'
2289 echo 'pswapd %mm0, %mm0' >> $TMPS
2291 if test "$_mmxext" = yes ; then
2292 _pref_as_version='2.10.1'
2293 echo 'movntq %mm0, (%eax)' >> $TMPS
2295 if test "$_sse" = yes ; then
2296 _pref_as_version='2.10.1'
2297 echo 'xorps %xmm0, %xmm0' >> $TMPS
2299 #if test "$_sse2" = yes ; then
2300 # _pref_as_version='2.11'
2301 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2303 if test "$_cmov" = yes ; then
2304 _pref_as_version='2.10.1'
2305 echo 'cmovb %eax, %ebx' >> $TMPS
2307 if test "$_ssse3" = yes ; then
2308 _pref_as_version='2.16.92'
2309 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2311 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2313 if test "$as_verc_fail" != yes ; then
2314 echores "ok"
2315 else
2316 _res_comment="Upgrade binutils to ${_pref_as_version} ..."
2317 echores "failed"
2318 die "obsolete binutils version"
2321 fi #if x86_32
2323 echocheck ".align is a power of two"
2324 if test "$_asmalign_pot" = auto ; then
2325 _asmalign_pot=no
2326 cat > $TMPC << EOF
2327 main() { asm (".align 3"); }
2329 cc_check && _asmalign_pot=yes
2331 if test "$_asmalign_pot" = "yes" ; then
2332 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2333 else
2334 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2336 echores $_asmalign_pot
2339 #FIXME: This should happen before the check for CFLAGS..
2340 if ppc ; then
2342 # check if altivec is supported by the compiler, and how to enable it
2344 _altivec_gcc_flags=''
2346 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2347 echocheck "GCC altivec support"
2349 p=''
2350 cat > $TMPC << EOF
2351 int main() {
2352 return 0;
2355 FSF_flags='-maltivec -mabi=altivec'
2356 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2358 # check for Darwin-style flags first, since
2359 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2360 # accepts but ignores FSF-style flags...
2362 if test -z "$p"; then
2363 cc_check $Darwin_flags && p='Darwin'
2365 if test -z "$p"; then
2366 cc_check $FSF_flags && p='FSF'
2369 case $p in
2370 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2371 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2372 *) _altivec=no ;;
2373 esac
2375 if test -z "$p"; then
2376 p=none
2377 else
2378 p="$p-style ($_altivec_gcc_flags)"
2381 echores "$p"
2384 # check if <altivec.h> should be included
2386 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2388 if test "$_altivec" = yes ; then
2389 echocheck "altivec.h"
2390 cat > $TMPC << EOF
2391 #include <altivec.h>
2392 int main(void) { return 0; }
2394 _have_altivec_h=no
2395 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2396 if test "$_have_altivec_h" = yes ; then
2397 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2399 echores "$_have_altivec_h"
2402 # disable runtime cpudetection if
2403 # - we cannot generate altivec code
2404 # - altivec is disabled by the user
2406 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2407 _runtime_cpudetection=no
2410 # show that we are optimizing for altivec (if enabled and supported)
2412 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2413 _optimizing="$_optimizing altivec"
2416 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2418 if test "$_altivec" = yes ; then
2419 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2420 #_mcpu="$_mcpu $_altivec_gcc_flags"
2421 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2424 # setup _def_altivec correctly
2426 if test "$_altivec" = yes ; then
2427 _def_altivec='#define HAVE_ALTIVEC 1'
2428 else
2429 _def_altivec='#undef HAVE_ALTIVEC'
2433 if arm ; then
2434 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2435 if test $_armv5te = "auto" ; then
2436 cat > $TMPC << EOF
2437 int main(void) {
2438 __asm__ __volatile__ ("qadd r0, r0, r0");
2441 _armv5te=no
2442 cc_check && _armv5te=yes
2444 echores "$_armv5te"
2446 echocheck "ARMv6 (SIMD instructions)"
2447 if test $_armv6 = "auto" ; then
2448 cat > $TMPC << EOF
2449 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2451 _armv6=no
2452 cc_check && _armv6=yes
2454 echores "$_armv6"
2456 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2457 if test $_iwmmxt = "auto" ; then
2458 cat > $TMPC << EOF
2459 int main(void) {
2460 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2463 _iwmmxt=no
2464 cc_check && _iwmmxt=yes
2466 echores "$_iwmmxt"
2469 _def_mmx='#undef HAVE_MMX'
2470 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2471 _def_mmxext='#undef HAVE_MMX2'
2472 test "$_mmxext" = yes && _def_mmxext='#define HAVE_MMX2 1'
2473 _def_3dnow='#undef HAVE_3DNOW'
2474 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2475 _def_3dnowext='#undef HAVE_3DNOWEX'
2476 test "$_3dnowext" = yes && _def_3dnowext='#define HAVE_3DNOWEX 1'
2477 _def_sse='#undef HAVE_SSE'
2478 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2479 _def_sse2='#undef HAVE_SSE2'
2480 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2481 _def_ssse3='#undef HAVE_SSSE3'
2482 test "$_ssse3" = yes && _def_ssse3='#define HAVE_SSSE3 1'
2483 _def_cmov='#undef HAVE_CMOV'
2484 test "$_cmov" = yes && _def_cmov='#define HAVE_CMOV 1'
2485 _def_fast_cmov='#undef HAVE_FAST_CMOV'
2486 test "$_fast_cmov" = yes && _def_fast_cmov='#define HAVE_FAST_CMOV 1'
2487 _def_armv5te='#undef HAVE_ARMV5TE'
2488 test "$_armv5te" = yes && _def_armv5te='#define HAVE_ARMV5TE 1'
2489 _def_armv6='#undef HAVE_ARMV6'
2490 test "$_armv6" = yes && _def_armv6='#define HAVE_ARMV6 1'
2491 _def_iwmmxt='#undef HAVE_IWMMXT'
2492 test "$_iwmmxt" = yes && _def_iwmmxt='#define HAVE_IWMMXT 1'
2494 # Checking kernel version...
2495 if x86_32 && linux ; then
2496 _k_verc_problem=no
2497 kernel_version=`uname -r 2>&1`
2498 echocheck "$system_name kernel version"
2499 case "$kernel_version" in
2500 '') kernel_version="?.??"; _k_verc_fail=yes;;
2501 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2502 _k_verc_problem=yes;;
2503 esac
2504 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2505 _k_verc_fail=yes
2507 if test "$_k_verc_fail" ; then
2508 echores "$kernel_version, fail"
2509 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2510 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2511 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2512 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2513 echo "2.2.x you must upgrade it to get SSE support!"
2514 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2515 else
2516 echores "$kernel_version, ok"
2520 ######################
2521 # MAIN TESTS GO HERE #
2522 ######################
2525 echocheck "extra headers"
2526 if test "$_inc_extra" ; then
2527 echores "$_inc_extra"
2528 else
2529 echores "none"
2533 echocheck "extra libs"
2534 if test "$_ld_extra" ; then
2535 echores "$_ld_extra"
2536 else
2537 echores "none"
2540 echocheck "-lposix"
2541 cat > $TMPC <<EOF
2542 int main(void) { return 0; }
2544 if cc_check -lposix ; then
2545 _ld_extra="$_ld_extra -lposix"
2546 echores "yes"
2547 else
2548 echores "no"
2551 echocheck "-lm"
2552 cat > $TMPC <<EOF
2553 int main(void) { return 0; }
2555 if cc_check -lm ; then
2556 _ld_lm="-lm"
2557 echores "yes"
2558 else
2559 _ld_lm=""
2560 echores "no"
2564 echocheck "langinfo"
2565 if test "$_langinfo" = auto ; then
2566 cat > $TMPC <<EOF
2567 #include <langinfo.h>
2568 int main(void) { nl_langinfo(CODESET); return 0; }
2570 _langinfo=no
2571 cc_check && _langinfo=yes
2573 if test "$_langinfo" = yes ; then
2574 _def_langinfo='#define USE_LANGINFO 1'
2575 else
2576 _def_langinfo='#undef USE_LANGINFO'
2578 echores "$_langinfo"
2581 echocheck "language"
2582 test -z "$_language" && _language=$LINGUAS
2583 _language=`echo $_language | sed 's/,/ /g'`
2584 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2585 for lang in $_language ; do
2586 test "$lang" = all && lang=en
2587 if test -f "help/help_mp-${lang}.h" ; then
2588 _language=$lang
2589 break
2590 else
2591 echo ${_echo_n} "$lang not found, ${_echo_c}"
2592 _language=`echo $_language | sed "s/$lang *//"`
2594 done
2595 test -z "$_language" && _language=en
2596 _mp_help="help/help_mp-${_language}.h"
2597 test -f $_mp_help || die "$_mp_help not found"
2598 for lang in $LANGUAGES ; do
2599 if test -f "DOCS/man/$lang/mplayer.1" ; then
2600 MAN_LANG="$lang $MAN_LANG"
2602 done
2603 _doc_lang=$_language
2604 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2605 echores "using $_language (man pages: $MAN_LANG)"
2608 echocheck "enable sighandler"
2609 if test "$_sighandler" = yes ; then
2610 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2611 else
2612 _def_sighandler='#undef ENABLE_SIGHANDLER'
2614 echores "$_sighandler"
2616 echocheck "runtime cpudetection"
2617 if test "$_runtime_cpudetection" = yes ; then
2618 _optimizing="Runtime CPU-Detection enabled"
2619 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2620 else
2621 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2623 echores "$_runtime_cpudetection"
2626 echocheck "restrict keyword"
2627 for restrict_keyword in restrict __restrict __restrict__ ; do
2628 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2629 if cc_check; then
2630 _def_restrict_keyword=$restrict_keyword
2631 break;
2633 done
2634 if [ -n "$_def_restrict_keyword" ]; then
2635 echores "$_def_restrict_keyword"
2636 else
2637 echores "none"
2639 # Avoid infinite recursion loop ("#define restrict restrict")
2640 if [ "$_def_restrict_keyword" != "restrict" ]; then
2641 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2642 else
2643 _def_restrict_keyword=""
2647 echocheck "__builtin_expect"
2648 # GCC branch prediction hint
2649 cat > $TMPC << EOF
2650 int foo (int a) {
2651 a = __builtin_expect (a, 10);
2652 return a == 10 ? 0 : 1;
2654 int main() { return foo(10) && foo(0); }
2656 _builtin_expect=no
2657 cc_check && _builtin_expect=yes
2658 if test "$_builtin_expect" = yes ; then
2659 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2660 else
2661 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2663 echores "$_builtin_expect"
2666 echocheck "kstat"
2667 cat > $TMPC << EOF
2668 #include <kstat.h>
2669 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2671 _kstat=no
2672 cc_check -lkstat && _kstat=yes
2673 if test "$_kstat" = yes ; then
2674 _def_kstat="#define HAVE_LIBKSTAT 1"
2675 _ld_extra="$_ld_extra -lkstat"
2676 else
2677 _def_kstat="#undef HAVE_LIBKSTAT"
2679 echores "$_kstat"
2682 echocheck "posix4"
2683 # required for nanosleep on some systems
2684 cat > $TMPC << EOF
2685 #include <time.h>
2686 int main(void) { (void) nanosleep(0, 0); return 0; }
2688 _posix4=no
2689 cc_check -lposix4 && _posix4=yes
2690 if test "$_posix4" = yes ; then
2691 _ld_extra="$_ld_extra -lposix4"
2693 echores "$_posix4"
2695 echocheck "lrintf"
2696 cat > $TMPC << EOF
2697 #include <math.h>
2698 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2700 _lrintf=no
2701 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2702 if test "$_lrintf" = yes ; then
2703 _def_lrintf="#define HAVE_LRINTF 1"
2704 else
2705 _def_lrintf="#undef HAVE_LRINTF"
2707 echores "$_lrintf"
2709 echocheck "round"
2710 cat > $TMPC << EOF
2711 #include <math.h>
2712 int main(void) { (void) round(0.0); return 0; }
2714 _round=no
2715 cc_check $_ld_lm && _round=yes
2716 if test "$_round" = yes ; then
2717 _def_round="#define HAVE_ROUND 1"
2718 else
2719 _def_round="#undef HAVE_ROUND"
2721 echores "$_round"
2723 echocheck "nanosleep"
2724 # also check for nanosleep
2725 cat > $TMPC << EOF
2726 #include <time.h>
2727 int main(void) { (void) nanosleep(0, 0); return 0; }
2729 _nanosleep=no
2730 cc_check && _nanosleep=yes
2731 if test "$_nanosleep" = yes ; then
2732 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2733 else
2734 _def_nanosleep='#undef HAVE_NANOSLEEP'
2736 echores "$_nanosleep"
2739 echocheck "socklib"
2740 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2741 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2742 cat > $TMPC << EOF
2743 #include <netdb.h>
2744 #include <sys/socket.h>
2745 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2747 _socklib=no
2748 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2749 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2750 done
2751 if test $_winsock2 = auto && not cygwin ; then
2752 _winsock2=no
2753 cat > $TMPC << EOF
2754 #include <winsock2.h>
2755 int main(void) { (void) gethostbyname(0); return 0; }
2757 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2759 test "$_ld_sock" && _res_comment="using $_ld_sock"
2760 echores "$_socklib"
2763 if test $_winsock2 = yes ; then
2764 _ld_sock="-lws2_32"
2765 _def_winsock2='#define HAVE_WINSOCK2 1'
2766 else
2767 _def_winsock2='#undef HAVE_WINSOCK2'
2771 _use_aton=no
2772 echocheck "inet_pton()"
2773 cat > $TMPC << EOF
2774 #include <sys/types.h>
2775 #include <sys/socket.h>
2776 #include <arpa/inet.h>
2777 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2779 if test "$_winsock2" = yes ; then
2780 _res_comment="using winsock2 functions instead"
2781 echores "no"
2782 elif cc_check $_ld_sock ; then
2783 # NOTE: Linux has libresolv but does not need it
2785 _res_comment="using $_ld_sock"
2786 echores "yes"
2787 elif cc_check $_ld_sock -lresolv ; then
2788 # NOTE: needed for SunOS at least
2789 _ld_sock="$_ld_sock -lresolv"
2790 _res_comment="using $_ld_sock"
2791 echores "yes"
2792 else
2793 _res_comment="trying inet_aton next"
2794 echores "no"
2796 echocheck "inet_aton()"
2797 cat > $TMPC << EOF
2798 #include <sys/types.h>
2799 #include <sys/socket.h>
2800 #include <arpa/inet.h>
2801 int main(void) { (void) inet_aton(0, 0); return 0; }
2803 _use_aton=yes
2804 if cc_check $_ld_sock ; then
2805 # NOTE: Linux has libresolv but does not need it
2807 _res_comment="using $_ld_sock"
2808 elif cc_check $_ld_sock -lresolv ; then
2809 # NOTE: needed for SunOS at least
2810 _ld_sock="$_ld_sock -lresolv"
2811 _res_comment="using $_ld_sock"
2812 else
2813 _use_aton=no
2814 _network=no
2815 _res_comment="network support disabled"
2817 echores "$_use_aton"
2820 _def_use_aton='#undef USE_ATON'
2821 if test "$_use_aton" = yes; then
2822 _def_use_aton='#define USE_ATON 1'
2825 echocheck "network"
2826 # FIXME network check
2827 if test "$_network" = yes ; then
2828 _def_network='#define MPLAYER_NETWORK 1'
2829 _ld_extra="$_ld_extra $_ld_sock"
2830 _inputmodules="network $_inputmodules"
2831 else
2832 _noinputmodules="network $_noinputmodules"
2833 _def_network='#undef MPLAYER_NETWORK'
2834 _ftp=no
2836 echores "$_network"
2838 echocheck "inttypes.h (required)"
2839 cat > $TMPC << EOF
2840 #include <inttypes.h>
2841 int main(void) { return 0; }
2843 _inttypes=no
2844 cc_check && _inttypes=yes
2845 echores "$_inttypes"
2847 if test "$_inttypes" = no ; then
2848 echocheck "bitypes.h (inttypes.h predecessor)"
2849 cat > $TMPC << EOF
2850 #include <sys/bitypes.h>
2851 int main(void) { return 0; }
2853 cc_check && _inttypes=yes
2854 if test "$_inttypes" = yes ; then
2855 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."
2856 else
2857 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2862 echocheck "int_fastXY_t in inttypes.h"
2863 cat > $TMPC << EOF
2864 #include <inttypes.h>
2865 int main(void) {
2866 volatile int_fast16_t v= 0;
2867 return v; }
2869 _fast_inttypes=no
2870 cc_check && _fast_inttypes=yes
2871 if test "$_fast_inttypes" = yes ; then
2872 # nothing to do
2874 else
2875 _def_fast_inttypes='
2876 typedef signed char int_fast8_t;
2877 typedef signed int int_fast16_t;
2878 typedef signed int int_fast32_t;
2879 typedef signed long long int_fast64_t;
2880 typedef unsigned char uint_fast8_t;
2881 typedef unsigned int uint_fast16_t;
2882 typedef unsigned int uint_fast32_t;
2883 typedef unsigned long long uint_fast64_t;'
2885 echores "$_fast_inttypes"
2888 echocheck "word size"
2889 _mp_wordsize="#undef MP_WORDSIZE"
2890 cat > $TMPC << EOF
2891 #include <stdio.h>
2892 #include <sys/types.h>
2893 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2895 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2896 echores "$_wordsize"
2899 echocheck "stddef.h"
2900 cat > $TMPC << EOF
2901 #include <stddef.h>
2902 int main(void) { return 0; }
2904 _stddef=no
2905 cc_check && _stddef=yes
2906 if test "$_stddef" = yes ; then
2907 _def_stddef='#define HAVE_STDDEF_H 1'
2908 else
2909 _def_stddef='#undef HAVE_STDDEF_H'
2911 echores "$_stddef"
2914 echocheck "malloc.h"
2915 cat > $TMPC << EOF
2916 #include <malloc.h>
2917 int main(void) { (void) malloc(0); return 0; }
2919 _malloc=no
2920 cc_check && _malloc=yes
2921 if test "$_malloc" = yes ; then
2922 _def_malloc='#define HAVE_MALLOC_H 1'
2923 else
2924 _def_malloc='#undef HAVE_MALLOC_H'
2926 # malloc.h emits a warning in FreeBSD and OpenBSD
2927 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2928 echores "$_malloc"
2931 echocheck "memalign()"
2932 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2933 cat > $TMPC << EOF
2934 #include <malloc.h>
2935 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2937 _memalign=no
2938 cc_check && _memalign=yes
2939 if test "$_memalign" = yes ; then
2940 _def_memalign='#define HAVE_MEMALIGN 1'
2941 else
2942 _def_memalign='#undef HAVE_MEMALIGN'
2943 _def_map_memalign='#define memalign(a,b) malloc(b)'
2944 not darwin && _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2946 echores "$_memalign"
2949 echocheck "alloca.h"
2950 cat > $TMPC << EOF
2951 #include <alloca.h>
2952 int main(void) { (void) alloca(0); return 0; }
2954 _alloca=no
2955 cc_check && _alloca=yes
2956 if cc_check ; then
2957 _def_alloca='#define HAVE_ALLOCA_H 1'
2958 else
2959 _def_alloca='#undef HAVE_ALLOCA_H'
2961 echores "$_alloca"
2964 echocheck "mman.h"
2965 cat > $TMPC << EOF
2966 #include <sys/types.h>
2967 #include <sys/mman.h>
2968 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2970 _mman=no
2971 cc_check && _mman=yes
2972 if test "$_mman" = yes ; then
2973 _def_mman='#define HAVE_SYS_MMAN_H 1'
2974 else
2975 _def_mman='#undef HAVE_SYS_MMAN_H'
2977 echores "$_mman"
2979 cat > $TMPC << EOF
2980 #include <sys/types.h>
2981 #include <sys/mman.h>
2982 int main(void) { void *p = MAP_FAILED; return 0; }
2984 _mman_has_map_failed=no
2985 cc_check && _mman_has_map_failed=yes
2986 if test "$_mman_has_map_failed" = yes ; then
2987 _def_mman_has_map_failed=''
2988 else
2989 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2992 echocheck "dynamic loader"
2993 cat > $TMPC << EOF
2994 #include <dlfcn.h>
2995 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2997 _dl=no
2998 for _ld_tmp in "" "-ldl" ; do
2999 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3000 done
3001 if test "$_dl" = yes ; then
3002 _def_dl='#define HAVE_LIBDL 1'
3003 else
3004 _def_dl='#undef HAVE_LIBDL'
3006 echores "$_dl"
3009 echocheck "dynamic a/v plugins support"
3010 if test "$_dl" = no ; then
3011 _dynamic_plugins=no
3013 if test "$_dynamic_plugins" = yes ; then
3014 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3015 else
3016 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3018 echores "$_dynamic_plugins"
3021 #echocheck "dynamic linking"
3022 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
3023 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
3024 #cat > $TMPC << EOF
3025 #int main(void) { return 0; }
3026 #EOF
3027 #if cc_check -rdynamic ; then
3028 # _ld_dl_dynamic='-rdynamic'
3029 #elif cc_check -Bdynamic ; then
3030 # _ld_dl_dynamic='-Bdynamic'
3031 #elif cc_check ; then
3032 # _ld_dl_dynamic=''
3034 #echores "using $_ld_dl_dynamic"
3036 _def_threads='#undef HAVE_THREADS'
3038 echocheck "pthread"
3039 if test "$_pthreads" = auto ; then
3040 cat > $TMPC << EOF
3041 #include <pthread.h>
3042 void* func(void *arg) { return arg; }
3043 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3045 _pthreads=no
3046 if not hpux ; then
3047 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3048 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3049 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3050 done
3053 if test "$_pthreads" = yes ; then
3054 _res_comment="using $_ld_pthread"
3055 _def_pthreads='#define HAVE_PTHREADS 1'
3056 _def_threads='#define HAVE_THREADS 1'
3057 else
3058 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3059 _def_pthreads='#undef HAVE_PTHREADS'
3060 _nas=no ; _tv_v4l1=no ; _macosx=no
3061 if not mingw32 ; then
3062 _win32dll=no
3065 echores "$_pthreads"
3067 echocheck "rpath"
3068 netbsd &&_rpath=yes
3069 if test "$_rpath" = yes ; then
3070 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3071 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3072 done
3073 _ld_extra=$tmp
3075 echores "$_rpath"
3077 echocheck "iconv"
3078 if test "$_iconv" = auto ; then
3079 _iconv_tmp='#include <iconv.h>'
3081 cat > $TMPC << EOF
3082 #include <stdio.h>
3083 #include <unistd.h>
3084 $_iconv_tmp
3085 #define INBUFSIZE 1024
3086 #define OUTBUFSIZE 4096
3088 char inbuffer[INBUFSIZE];
3089 char outbuffer[OUTBUFSIZE];
3091 int main(void) {
3092 size_t numread;
3093 iconv_t icdsc;
3094 char *tocode="UTF-8";
3095 char *fromcode="cp1250";
3096 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3097 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3098 char *iptr=inbuffer;
3099 char *optr=outbuffer;
3100 size_t inleft=numread;
3101 size_t outleft=OUTBUFSIZE;
3102 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3103 != (size_t)(-1)) {
3104 write (1, outbuffer, OUTBUFSIZE - outleft);
3107 if (iconv_close(icdsc) == -1)
3112 _iconv=no
3113 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3114 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3115 _iconv=yes && break
3116 done
3118 if test "$_iconv" = yes ; then
3119 _def_iconv='#define USE_ICONV 1'
3120 else
3121 _def_iconv='#undef USE_ICONV'
3123 echores "$_iconv"
3126 echocheck "sys/soundcard.h"
3127 cat > $TMPC << EOF
3128 #include <sys/soundcard.h>
3129 int main(void) { return 0; }
3131 _sys_soundcard=no
3132 cc_check && _sys_soundcard=yes
3133 if test "$_sys_soundcard" = yes ; then
3134 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3135 _include_soundcard='#include <sys/soundcard.h>'
3136 else
3137 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3139 echores "$_sys_soundcard"
3141 if test "$_sys_soundcard" != yes ; then
3142 echocheck "soundcard.h"
3143 cat > $TMPC << EOF
3144 #include <soundcard.h>
3145 int main(void) { return 0; }
3147 _soundcard=no
3148 cc_check && _soundcard=yes
3149 if linux || test "$_ossaudio" != no ; then
3150 # use soundcard.h on Linux, or when OSS support is enabled
3151 echores "$_soundcard"
3152 else
3153 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
3154 _res_comment= "but ignored!"
3155 echores "$_soundcard"
3156 _soundcard=no
3158 if test "$_soundcard" = yes ; then
3159 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3160 _include_soundcard='#include <soundcard.h>'
3161 else
3162 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3164 else
3165 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3169 echocheck "sys/dvdio.h"
3170 cat > $TMPC << EOF
3171 #include <unistd.h>
3172 #include <sys/dvdio.h>
3173 int main(void) { return 0; }
3175 _dvdio=no
3176 cc_check && _dvdio=yes
3177 if test "$_dvdio" = yes ; then
3178 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3179 else
3180 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3182 echores "$_dvdio"
3185 echocheck "sys/cdio.h"
3186 cat > $TMPC << EOF
3187 #include <unistd.h>
3188 #include <sys/cdio.h>
3189 int main(void) { return 0; }
3191 _cdio=no
3192 cc_check && _cdio=yes
3193 if test "$_cdio" = yes ; then
3194 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3195 else
3196 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3198 echores "$_cdio"
3201 echocheck "linux/cdrom.h"
3202 cat > $TMPC << EOF
3203 #include <sys/types.h>
3204 #include <linux/cdrom.h>
3205 int main(void) { return 0; }
3207 _cdrom=no
3208 cc_check && _cdrom=yes
3209 if test "$_cdrom" = yes ; then
3210 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3211 else
3212 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3214 echores "$_cdrom"
3217 echocheck "dvd.h"
3218 cat > $TMPC << EOF
3219 #include <dvd.h>
3220 int main(void) { return 0; }
3222 _dvd=no
3223 cc_check && _dvd=yes
3224 if test "$_dvd" = yes ; then
3225 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3226 else
3227 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3229 echores "$_dvd"
3232 if bsdos; then
3233 echocheck "BSDI dvd.h"
3234 cat > $TMPC << EOF
3235 #include <dvd.h>
3236 int main(void) { return 0; }
3238 _bsdi_dvd=no
3239 cc_check && _bsdi_dvd=yes
3240 if test "$_bsdi_dvd" = yes ; then
3241 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3242 else
3243 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3245 echores "$_bsdi_dvd"
3246 fi #if bsdos
3249 if hpux; then
3250 # also used by AIX, but AIX does not support VCD and/or libdvdread
3251 echocheck "HP-UX SCSI header"
3252 cat > $TMPC << EOF
3253 #include <sys/scsi.h>
3254 int main(void) { return 0; }
3256 _hpux_scsi_h=no
3257 cc_check && _hpux_scsi_h=yes
3258 if test "$_hpux_scsi_h" = yes ; then
3259 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3260 else
3261 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3263 echores "$_hpux_scsi_h"
3264 fi #if hpux
3267 if sunos; then
3268 echocheck "userspace SCSI headers (Solaris)"
3269 cat > $TMPC << EOF
3270 # include <unistd.h>
3271 # include <stropts.h>
3272 # include <sys/scsi/scsi_types.h>
3273 # include <sys/scsi/impl/uscsi.h>
3274 int main(void) { return 0; }
3276 _sol_scsi_h=no
3277 cc_check && _sol_scsi_h=yes
3278 if test "$_sol_scsi_h" = yes ; then
3279 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3280 else
3281 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3283 echores "$_sol_scsi_h"
3284 fi #if sunos
3287 echocheck "termcap"
3288 if test "$_termcap" = auto ; then
3289 cat > $TMPC <<EOF
3290 int main(void) { tgetent(); return 0; }
3292 _termcap=no
3293 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3294 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3295 && _termcap=yes && break
3296 done
3298 if test "$_termcap" = yes ; then
3299 _def_termcap='#define USE_TERMCAP 1'
3300 _res_comment="using $_ld_tmp"
3301 else
3302 _def_termcap='#undef USE_TERMCAP'
3304 echores "$_termcap"
3307 echocheck "termios"
3308 if test "$_termios" = auto ; then
3309 cat > $TMPC <<EOF
3310 #include <sys/termios.h>
3311 int main(void) { return 0; }
3313 _termios=auto
3314 cc_check && _termios=yes
3315 _def_termios_h_name='sys/termios.h'
3317 # second test:
3318 if test "$_termios" = auto ; then
3319 cat > $TMPC <<EOF
3320 #include <termios.h>
3321 int main(void) { return 0; }
3323 _termios=no
3324 cc_check && _termios=yes
3325 _def_termios_h_name='termios.h'
3328 if test "$_termios" = yes ; then
3329 _def_termios='#define HAVE_TERMIOS 1'
3330 _def_termios_h='#undef HAVE_TERMIOS_H'
3331 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3333 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3334 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3335 elif test "$_def_termios_h_name" = 'termios.h' ; then
3336 _def_termios_h='#define HAVE_TERMIOS_H 1'
3338 _res_comment="using $_def_termios_h_name"
3339 else
3340 _def_termios='#undef HAVE_TERMIOS'
3341 _def_termios_h_name=''
3342 _termios=no
3344 echores "$_termios"
3347 echocheck "shm"
3348 if test "$_shm" = auto ; then
3349 cat > $TMPC << EOF
3350 #include <sys/types.h>
3351 #include <sys/shm.h>
3352 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3354 _shm=no
3355 cc_check && _shm=yes
3357 if test "$_shm" = yes ; then
3358 _def_shm='#define HAVE_SHM 1'
3359 else
3360 _def_shm='#undef HAVE_SHM'
3362 echores "$_shm"
3365 # XXX: FIXME, add runtime checking
3366 echocheck "linux devfs"
3367 echores "$_linux_devfs"
3370 echocheck "scandir()"
3371 cat > $TMPC << EOF
3372 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3374 _scandir=no
3375 cc_check && _scandir=yes
3376 if test "$_scandir" = yes ; then
3377 _def_scandir='#define HAVE_SCANDIR 1'
3378 _need_scandir=no
3379 else
3380 _def_scandir='#undef HAVE_SCANDIR'
3381 _need_scandir=yes
3383 echores "$_scandir"
3386 echocheck "strsep()"
3387 cat > $TMPC << EOF
3388 #include <string.h>
3389 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3391 _strsep=no
3392 cc_check && _strsep=yes
3393 if test "$_strsep" = yes ; then
3394 _def_strsep='#define HAVE_STRSEP 1'
3395 _need_strsep=no
3396 else
3397 _def_strsep='#undef HAVE_STRSEP'
3398 _need_strsep=yes
3400 echores "$_strsep"
3402 echocheck "strlcpy()"
3403 cat > $TMPC << EOF
3404 #include <string.h>
3405 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3407 _strlcpy=no
3408 cc_check && _strlcpy=yes
3409 if test "$_strlcpy" = yes ; then
3410 _def_strlcpy='#define HAVE_STRLCPY 1'
3411 _need_strlcpy=no
3412 else
3413 _def_strlcpy='#undef HAVE_STRLCPY'
3414 _need_strlcpy=yes
3416 echores "$_strlcpy"
3418 echocheck "strlcat()"
3419 cat > $TMPC << EOF
3420 #include <string.h>
3421 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3423 _strlcat=no
3424 cc_check && _strlcat=yes
3425 if test "$_strlcat" = yes ; then
3426 _def_strlcat='#define HAVE_STRLCAT 1'
3427 _need_strlcat=no
3428 else
3429 _def_strlcat='#undef HAVE_STRLCAT'
3430 _need_strlcat=yes
3432 echores "$_strlcat"
3434 echocheck "fseeko()"
3435 cat > $TMPC << EOF
3436 #include <stdio.h>
3437 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3439 _fseeko=no
3440 cc_check && _fseeko=yes
3441 if test "$_fseeko" = yes ; then
3442 _def_fseeko='#define HAVE_FSEEKO 1'
3443 _need_fseeko=no
3444 else
3445 _def_fseeko='#undef HAVE_FSEEKO'
3446 _need_fseeko=yes
3448 echores "$_fseeko"
3450 echocheck "localtime_r()"
3451 cat > $TMPC << EOF
3452 #include <time.h>
3453 int main( void ) { localtime_r(NULL, NULL); }
3455 _localtime_r=no
3456 cc_check && _localtime_r=yes
3457 if test "$_localtime_r" = yes ; then
3458 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3459 else
3460 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3462 echores "$_localtime_r"
3464 echocheck "vsscanf()"
3465 cat > $TMPC << EOF
3466 #include <stdarg.h>
3467 int main(void) { vsscanf(0, 0, 0); return 0; }
3469 _vsscanf=no
3470 cc_check && _vsscanf=yes
3471 if test "$_vsscanf" = yes ; then
3472 _def_vsscanf='#define HAVE_VSSCANF 1'
3473 _need_vsscanf=no
3474 else
3475 _def_vsscanf='#undef HAVE_VSSCANF'
3476 _need_vsscanf=yes
3478 echores "$_vsscanf"
3481 echocheck "swab()"
3482 cat > $TMPC << EOF
3483 #include <unistd.h>
3484 int main(void) { swab(0, 0, 0); return 0; }
3486 _swab=no
3487 cc_check && _swab=yes
3488 if test "$_swab" = yes ; then
3489 _def_swab='#define HAVE_SWAB 1'
3490 _need_swab=no
3491 else
3492 _def_swab='#undef HAVE_SWAB'
3493 _need_swab=yes
3495 echores "$_swab"
3497 echocheck "POSIX select()"
3498 cat > $TMPC << EOF
3499 #include <stdio.h>
3500 #include <stdlib.h>
3501 #include <sys/types.h>
3502 #include <string.h>
3503 #include <sys/time.h>
3504 #include <unistd.h>
3505 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3507 _posix_select=no
3508 _def_posix_select='#undef HAVE_POSIX_SELECT'
3509 cc_check && _posix_select=yes \
3510 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3511 echores "$_posix_select"
3514 echocheck "gettimeofday()"
3515 cat > $TMPC << EOF
3516 #include <stdio.h>
3517 #include <sys/time.h>
3518 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3520 _gettimeofday=no
3521 cc_check && _gettimeofday=yes
3522 if test "$_gettimeofday" = yes ; then
3523 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3524 _need_gettimeofday=no
3525 else
3526 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3527 _need_gettimeofday=yes
3529 echores "$_gettimeofday"
3532 echocheck "glob()"
3533 cat > $TMPC << EOF
3534 #include <stdio.h>
3535 #include <glob.h>
3536 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3538 _glob=no
3539 cc_check && _glob=yes
3540 if test "$_glob" = yes ; then
3541 _def_glob='#define HAVE_GLOB 1'
3542 _need_glob=no
3543 else
3544 _def_glob='#undef HAVE_GLOB'
3545 _need_glob=yes
3547 echores "$_glob"
3550 echocheck "setenv()"
3551 cat > $TMPC << EOF
3552 #include <stdlib.h>
3553 int main (void){ setenv("","",0); return 0; }
3555 _setenv=no
3556 cc_check && _setenv=yes
3557 if test "$_setenv" = yes ; then
3558 _def_setenv='#define HAVE_SETENV 1'
3559 _need_setenv=no
3560 else
3561 _def_setenv='#undef HAVE_SETENV'
3562 _need_setenv=yes
3564 echores "$_setenv"
3567 if sunos; then
3568 echocheck "sysi86()"
3569 cat > $TMPC << EOF
3570 #include <sys/sysi86.h>
3571 int main (void) { sysi86(0); return 0; }
3573 _sysi86=no
3574 cc_check && _sysi86=yes
3575 if test "$_sysi86" = yes ; then
3576 _def_sysi86='#define HAVE_SYSI86 1'
3577 cat > $TMPC << EOF
3578 #include <sys/sysi86.h>
3579 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3581 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3582 else
3583 _def_sysi86='#undef HAVE_SYSI86'
3585 echores "$_sysi86"
3586 fi #if sunos
3589 echocheck "sys/sysinfo.h"
3590 cat > $TMPC << EOF
3591 #include <sys/sysinfo.h>
3592 int main(void) {
3593 struct sysinfo s_info;
3594 sysinfo(&s_info);
3595 return 0;
3598 _sys_sysinfo=no
3599 cc_check && _sys_sysinfo=yes
3600 if test "$_sys_sysinfo" = yes ; then
3601 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3602 else
3603 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3605 echores "$_sys_sysinfo"
3608 if darwin; then
3610 echocheck "Mac OS X APIs"
3611 if test "$_macosx" = auto ; then
3612 productName=`/usr/bin/sw_vers -productName`
3613 if test "$productName" = "Mac OS X" ||
3614 test "$productName" = "Mac OS X Server" ; then
3615 _macosx=yes
3616 else
3617 _macosx=no
3618 _def_macosx='#undef MACOSX'
3619 _noaomodules="macosx $_noaomodules"
3620 _novomodules="quartz $_novomodules"
3623 if test "$_macosx" = yes ; then
3624 cat > $TMPC <<EOF
3625 #include <Carbon/Carbon.h>
3626 #include <QuickTime/QuickTime.h>
3627 #include <CoreAudio/CoreAudio.h>
3628 int main(void) {
3629 EnterMovies();
3630 ExitMovies();
3631 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3634 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3635 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3636 _def_macosx='#define MACOSX 1'
3637 _aosrc="$_aosrc ao_macosx.c"
3638 _aomodules="macosx $_aomodules"
3639 _vosrc="$_vosrc vo_quartz.c"
3640 _vomodules="quartz $_vomodules"
3641 else
3642 _macosx=no
3643 _def_macosx='#undef MACOSX'
3644 _noaomodules="macosx $_noaomodules"
3645 _novomodules="quartz $_novomodules"
3647 cat > $TMPC <<EOF
3648 #include <Carbon/Carbon.h>
3649 #include <QuartzCore/CoreVideo.h>
3650 int main(void) {}
3652 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3653 _vosrc="$_vosrc vo_macosx.m"
3654 _vomodules="macosx $_vomodules"
3655 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3656 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3657 _macosx_corevideo=yes
3658 else
3659 _novomodules="macosx $_novomodules"
3660 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3661 _macosx_corevideo=no
3664 echores "$_macosx"
3666 echocheck "Mac OS X Finder Support"
3667 if test "$_macosx_finder_support" = auto ; then
3668 _macosx_finder_support=$_macosx
3670 if test "$_macosx_finder_support" = yes; then
3671 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3672 _macosx_finder_support=yes
3673 else
3674 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3675 _macosx_finder_support=no
3677 echores "$_macosx_finder_support"
3679 echocheck "Mac OS X Bundle file locations"
3680 if test "$_macosx_bundle" = auto ; then
3681 _macosx_bundle=$_macosx_finder_support
3683 if test "$_macosx_bundle" = yes; then
3684 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3685 else
3686 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3687 _macosx_bundle=no
3689 echores "$_macosx_bundle"
3691 fi #if darwin
3694 echocheck "pkg-config"
3695 _pkg_config=pkg-config
3696 if `$_pkg_config --version > /dev/null 2>&1`; then
3697 echores "yes"
3698 else
3699 _pkg_config=false
3700 echores "no"
3704 echocheck "Samba support (libsmbclient)"
3705 if test "$_smbsupport" = yes; then
3706 _ld_extra="$_ld_extra -lsmbclient"
3708 if test "$_smbsupport" = auto; then
3709 _smbsupport=no
3710 cat > $TMPC << EOF
3711 #include <libsmbclient.h>
3712 int main(void) { smbc_opendir("smb://"); return 0; }
3714 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3715 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3716 _smbsupport=yes && break
3717 done
3720 if test "$_smbsupport" = yes; then
3721 _def_smbsupport="#define LIBSMBCLIENT"
3722 _inputmodules="smb $_inputmodules"
3723 else
3724 _def_smbsupport="#undef LIBSMBCLIENT"
3725 _noinputmodules="smb $_noinputmodules"
3727 echores "$_smbsupport"
3730 #########
3731 # VIDEO #
3732 #########
3735 echocheck "3dfx"
3736 if test "$_3dfx" = yes ; then
3737 _def_3dfx='#define HAVE_3DFX 1'
3738 _vosrc="$_vosrc vo_3dfx.c"
3739 _vomodules="3dfx $_vomodules"
3740 else
3741 _def_3dfx='#undef HAVE_3DFX'
3742 _novomodules="3dfx $_novomodules"
3744 echores "$_3dfx"
3747 echocheck "tdfxfb"
3748 if test "$_tdfxfb" = yes ; then
3749 _def_tdfxfb='#define HAVE_TDFXFB 1'
3750 _vosrc="$_vosrc vo_tdfxfb.c"
3751 _vomodules="tdfxfb $_vomodules"
3752 else
3753 _def_tdfxfb='#undef HAVE_TDFXFB'
3754 _novomodules="tdfxfb $_novomodules"
3756 echores "$_tdfxfb"
3758 echocheck "s3fb"
3759 if test "$_s3fb" = yes ; then
3760 _def_s3fb='#define HAVE_S3FB 1'
3761 _vosrc="$_vosrc vo_s3fb.c"
3762 _vomodules="s3fb $_vomodules"
3763 else
3764 _def_s3fb='#undef HAVE_S3FB'
3765 _novomodules="s3fb $_novomodules"
3767 echores "$_s3fb"
3769 echocheck "tdfxvid"
3770 if test "$_tdfxvid" = yes ; then
3771 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3772 _vosrc="$_vosrc vo_tdfx_vid.c"
3773 _vomodules="tdfx_vid $_vomodules"
3774 else
3775 _def_tdfxvid='#undef HAVE_TDFX_VID'
3776 _novomodules="tdfx_vid $_novomodules"
3778 echores "$_tdfxvid"
3780 echocheck "tga"
3781 if test "$_tga" = yes ; then
3782 _def_tga='#define HAVE_TGA 1'
3783 _vosrc="$_vosrc vo_tga.c"
3784 _vomodules="tga $_vomodules"
3785 else
3786 _def_tga='#undef HAVE_TGA'
3787 _novomodules="tga $_novomodules"
3789 echores "$_tga"
3792 echocheck "DirectFB"
3793 if test "$_directfb" = auto ; then
3794 _directfb=no
3795 cat > $TMPC <<EOF
3796 #include <directfb.h>
3797 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3799 for _inc_tmp in "" -I/usr/local/include/directfb \
3800 -I/usr/include/directfb -I/usr/local/include -I/usr/include; do
3801 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3802 _inc_extra="$_inc_extra $_inc_tmp" && break
3803 done
3806 dfb_version() {
3807 expr $1 \* 65536 + $2 \* 256 + $3
3810 if test "$_directfb" = yes; then
3811 cat > $TMPC << EOF
3812 #include <directfb_version.h>
3814 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3817 if $_cc -E $TMPC $_inc_extra > "$TMPO"; then
3818 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPO" | tr -d '()'`
3819 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3820 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3821 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3822 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3823 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3824 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3825 _res_comment="$_directfb_version"
3826 else
3827 _def_directfb_version='#undef DIRECTFBVERSION'
3828 _directfb=no
3829 _res_comment="version >=0.9.13 required"
3831 else
3832 _directfb=no
3833 _res_comment="failed to get version"
3836 echores "$_directfb"
3838 if test "$_directfb" = yes ; then
3839 _def_directfb='#define HAVE_DIRECTFB 1'
3840 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3841 _vosrc="$_vosrc vo_directfb2.c"
3842 _vomodules="directfb $_vomodules"
3843 _libs_mplayer="$_libs_mplayer -ldirectfb"
3844 else
3845 _novomodules="directfb $_novomodules"
3848 if test "$_dfb_version" -ge `dfb_version 0 9 15`; then
3849 _vosrc="$_vosrc vo_dfbmga.c"
3850 _vomodules="dfbmga $_vomodules"
3851 _def_dfbmga='#define HAVE_DFBMGA 1'
3852 else
3853 _novomodules="dfbmga $_novomodules"
3854 _def_dfbmga='#undef HAVE_DFBMGA'
3856 else
3857 _def_directfb='#undef HAVE_DIRECTFB'
3858 _novomodules="dfbmga directfb $_novomodules"
3862 echocheck "X11 headers presence"
3863 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
3864 if test -f "$I/X11/Xlib.h" ; then
3865 _inc_x11="-I$I"
3866 _x11_headers="yes"
3867 _res_comment="using $I"
3868 break
3870 done
3871 if test -z "$_inc_x11" ; then
3872 _x11=no
3873 _x11_headers="no"
3874 _res_comment="check if the dev(el) packages are installed"
3876 echores "$_x11_headers"
3879 echocheck "X11"
3880 if test "$_x11" != no ; then
3881 cat > $TMPC <<EOF
3882 #include <X11/Xlib.h>
3883 #include <X11/Xutil.h>
3884 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3886 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3887 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3888 if netbsd; then
3889 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3890 else
3891 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3893 cc_check $_inc_x11 $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3894 && _x11=yes && break
3895 done
3897 if test "$_x11" = yes ; then
3898 #FIXME: This is ugly as it can duplicate a -I parameter..
3899 _inc_extra="$_inc_extra $_inc_x11"
3900 _def_x11='#define HAVE_X11 1'
3901 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3902 _vomodules="x11 xover $_vomodules"
3903 else
3904 _x11=no
3905 _def_x11='#undef HAVE_X11'
3906 _novomodules="x11 $_novomodules"
3907 _res_comment="check if the dev(el) packages are installed"
3908 # disable stuff that depends on X
3909 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _dga=no
3911 echores "$_x11"
3914 echocheck "DPMS"
3915 _xdpms3=no
3916 _xdpms4=no
3917 if test "$_x11" = yes ; then
3918 cat > $TMPC <<EOF
3919 #include <X11/Xmd.h>
3920 #include <X11/Xlib.h>
3921 #include <X11/Xutil.h>
3922 #include <X11/Xatom.h>
3923 #include <X11/extensions/dpms.h>
3924 int main(void) {
3925 (void) DPMSQueryExtension(0, 0, 0);
3928 cc_check -lXdpms && _xdpms3=yes
3929 cat > $TMPC <<EOF
3930 #include <X11/Xlib.h>
3931 #include <X11/extensions/dpms.h>
3932 int main(void) {
3933 (void) DPMSQueryExtension(0, 0, 0);
3936 cc_check && _xdpms4=yes
3938 if test "$_xdpms4" = yes ; then
3939 _def_xdpms='#define HAVE_XDPMS 1'
3940 _res_comment="using Xdpms 4"
3941 echores "yes"
3942 elif test "$_xdpms3" = yes ; then
3943 _def_xdpms='#define HAVE_XDPMS 1'
3944 _libs_mplayer="$_libs_mplayer -lXdpms"
3945 _res_comment="using Xdpms 3"
3946 echores "yes"
3947 else
3948 _def_xdpms='#undef HAVE_XDPMS'
3949 echores "no"
3953 echocheck "Xv"
3954 if test "$_xv" = auto ; then
3955 cat > $TMPC <<EOF
3956 #include <X11/Xlib.h>
3957 #include <X11/extensions/Xvlib.h>
3958 int main(void) {
3959 (void) XvGetPortAttribute(0, 0, 0, 0);
3960 (void) XvQueryPortAttributes(0, 0, 0);
3961 return 0; }
3963 _xv=no
3964 cc_check -lXv && _xv=yes
3967 if test "$_xv" = yes ; then
3968 _def_xv='#define HAVE_XV 1'
3969 _libs_mplayer="$_libs_mplayer -lXv"
3970 _vosrc="$_vosrc vo_xv.c"
3971 _vomodules="xv $_vomodules"
3972 else
3973 _def_xv='#undef HAVE_XV'
3974 _novomodules="xv $_novomodules"
3976 echores "$_xv"
3979 echocheck "XvMC"
3980 if test "$_xv" = yes && test "$_xvmc" != no ; then
3981 _xvmc=no
3982 cat > $TMPC <<EOF
3983 #include <X11/Xlib.h>
3984 #include <X11/extensions/Xvlib.h>
3985 #include <X11/extensions/XvMClib.h>
3986 int main(void) {
3987 (void) XvMCQueryExtension(0,0,0);
3988 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3989 return 0; }
3991 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3992 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3993 done
3995 if test "$_xvmc" = yes ; then
3996 _def_xvmc='#define HAVE_XVMC 1'
3997 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
3998 _vosrc="$_vosrc vo_xvmc.c"
3999 _vomodules="xvmc $_vomodules"
4000 _res_comment="using $_xvmclib"
4001 else
4002 _def_xvmc='#undef HAVE_XVMC'
4003 _novomodules="xvmc $_novomodules"
4004 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4006 echores "$_xvmc"
4009 echocheck "Xinerama"
4010 if test "$_xinerama" = auto ; then
4011 cat > $TMPC <<EOF
4012 #include <X11/Xlib.h>
4013 #include <X11/extensions/Xinerama.h>
4014 int main(void) { (void) XineramaIsActive(0); return 0; }
4016 _xinerama=no
4017 cc_check -lXinerama && _xinerama=yes
4020 if test "$_xinerama" = yes ; then
4021 _def_xinerama='#define HAVE_XINERAMA 1'
4022 _libs_mplayer="$_libs_mplayer -lXinerama"
4023 else
4024 _def_xinerama='#undef HAVE_XINERAMA'
4026 echores "$_xinerama"
4029 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4030 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4031 # named 'X extensions' or something similar.
4032 # This check may be useful for future mplayer versions (to change resolution)
4033 # If you run into problems, remove '-lXxf86vm'.
4034 echocheck "Xxf86vm"
4035 if test "$_vm" = auto ; then
4036 cat > $TMPC <<EOF
4037 #include <X11/Xlib.h>
4038 #include <X11/extensions/xf86vmode.h>
4039 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4041 _vm=no
4042 cc_check -lXxf86vm && _vm=yes
4044 if test "$_vm" = yes ; then
4045 _def_vm='#define HAVE_XF86VM 1'
4046 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4047 else
4048 _def_vm='#undef HAVE_XF86VM'
4050 echores "$_vm"
4052 # Check for the presence of special keycodes, like audio control buttons
4053 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4054 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4055 # have these new keycodes.
4056 echocheck "XF86keysym"
4057 if test "$_xf86keysym" = auto; then
4058 _xf86keysym=no
4059 cat > $TMPC <<EOF
4060 #include <X11/Xlib.h>
4061 #include <X11/XF86keysym.h>
4062 int main(void) { return XF86XK_AudioPause; }
4064 cc_check && _xf86keysym=yes
4066 if test "$_xf86keysym" = yes ; then
4067 _def_xf86keysym='#define HAVE_XF86XK 1'
4068 else
4069 _def_xf86keysym='#undef HAVE_XF86XK'
4071 echores "$_xf86keysym"
4073 echocheck "DGA"
4074 # Version 2 is preferred to version 1 if available
4075 if test "$_dga" = auto ; then
4076 cat > $TMPC << EOF
4077 #include <X11/Xlib.h>
4078 #include <X11/extensions/xf86dga.h>
4079 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4081 _dga=no
4082 cc_check -lXxf86dga -lXxf86vm && _dga=1
4084 cat > $TMPC << EOF
4085 #include <X11/Xlib.h>
4086 #include <X11/extensions/xf86dga.h>
4087 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4089 cc_check -lXxf86dga && _dga=2
4092 _def_dga='#undef HAVE_DGA'
4093 _def_dga2='#undef HAVE_DGA2'
4094 if test "$_dga" = 1 ; then
4095 _def_dga='#define HAVE_DGA 1'
4096 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4097 _vosrc="$_vosrc vo_dga.c"
4098 _vomodules="dga $_vomodules"
4099 _res_comment="using DGA 1.0"
4100 elif test "$_dga" = 2 ; then
4101 _def_dga='#define HAVE_DGA 1'
4102 _def_dga2='#define HAVE_DGA2 1'
4103 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4104 _vosrc="$_vosrc vo_dga.c"
4105 _vomodules="dga $_vomodules"
4106 _res_comment="using DGA 2.0"
4107 elif test "$_dga" = no ; then
4108 _novomodules="dga $_novomodules"
4109 else
4110 die "DGA version must be 1 or 2"
4112 echores "$_dga"
4115 echocheck "OpenGL"
4116 #Note: this test is run even with --enable-gl since we autodetect linker flags
4117 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4118 cat > $TMPC << EOF
4119 #include <GL/gl.h>
4120 int main(void) { return 0; }
4122 _gl=no
4123 if cc_check -lGL $_ld_lm ; then
4124 _gl=yes
4125 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4126 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4127 _gl=yes
4128 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4129 elif cc_check -lopengl32 ; then
4130 _gl=yes
4131 _gl_win32=yes
4132 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4134 else
4135 _gl=no
4137 if test "$_gl" = yes ; then
4138 _def_gl='#define HAVE_GL 1'
4139 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4140 if test "$_gl_win32" = yes ; then
4141 _def_gl_win32='#define GL_WIN32 1'
4142 _vosrc="$_vosrc w32_common.c"
4143 _res_comment="win32 version"
4145 _vomodules="opengl $_vomodules"
4146 else
4147 _def_gl='#undef HAVE_GL'
4148 _def_gl_win32='#undef GL_WIN32'
4149 _novomodules="opengl $_novomodules"
4151 echores "$_gl"
4154 echocheck "/dev/mga_vid"
4155 if test "$_mga" = auto ; then
4156 _mga=no
4157 test -c /dev/mga_vid && _mga=yes
4159 if test "$_mga" = yes ; then
4160 _def_mga='#define HAVE_MGA 1'
4161 _vosrc="$_vosrc vo_mga.c"
4162 _vomodules="mga $_vomodules"
4163 else
4164 _def_mga='#undef HAVE_MGA'
4165 _novomodules="mga $_novomodules"
4167 echores "$_mga"
4170 # echocheck "syncfb"
4171 # _syncfb=no
4172 # test "$_mga" = yes && _syncfb=yes
4173 # if test "$_syncfb" = yes ; then
4174 # _def_syncfb='#define HAVE_SYNCFB 1'
4175 # _vosrc="$_vosrc vo_syncfb.c"
4176 # else
4177 # _def_syncfb='#undef HAVE_SYNCFB'
4178 # fi
4179 # echores "$_syncfb"
4182 echocheck "xmga"
4183 if test "$_xmga" = auto ; then
4184 _xmga=no
4185 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4187 if test "$_xmga" = yes ; then
4188 _def_xmga='#define HAVE_XMGA 1'
4189 _vosrc="$_vosrc vo_xmga.c"
4190 _vomodules="xmga $_vomodules"
4191 else
4192 _def_xmga='#undef HAVE_XMGA'
4193 _novomodules="xmga $_novomodules"
4195 echores "$_xmga"
4198 echocheck "GGI"
4199 if test "$_ggi" = auto ; then
4200 cat > $TMPC << EOF
4201 #include <ggi/ggi.h>
4202 int main(void) { return 0; }
4204 _ggi=no
4205 cc_check -lggi && _ggi=yes
4207 if test "$_ggi" = yes ; then
4208 _def_ggi='#define HAVE_GGI 1'
4209 _libs_mplayer="$_libs_mplayer -lggi"
4210 _vosrc="$_vosrc vo_ggi.c"
4211 _vomodules="ggi $_vomodules"
4212 else
4213 _def_ggi='#undef HAVE_GGI'
4214 _novomodules="ggi $_novomodules"
4216 echores "$_ggi"
4218 echocheck "GGI extension: libggiwmh"
4219 if test "$_ggiwmh" = auto ; then
4220 _ggiwmh=no
4221 cat > $TMPC << EOF
4222 #include <ggi/ggi.h>
4223 #include <ggi/wmh.h>
4224 int main(void) { return 0; }
4226 cc_check -lggi -lggiwmh && _ggiwmh=yes
4228 # needed to get right output on obscure combination
4229 # like --disable-ggi --enable-ggiwmh
4230 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4231 _def_ggiwmh='#define HAVE_GGIWMH 1'
4232 _libs_mplayer="$_libs_mplayer -lggiwmh"
4233 else
4234 _ggiwmh=no
4235 _def_ggiwmh='#undef HAVE_GGIWMH'
4237 echores "$_ggiwmh"
4240 echocheck "AA"
4241 if test "$_aa" = auto ; then
4242 cat > $TMPC << EOF
4243 #include <aalib.h>
4244 extern struct aa_hardware_params aa_defparams;
4245 extern struct aa_renderparams aa_defrenderparams;
4246 int main(void) {
4247 aa_context *c;
4248 aa_renderparams *p;
4249 (void) aa_init(0, 0, 0);
4250 c = aa_autoinit(&aa_defparams);
4251 p = aa_getrenderparams();
4252 aa_autoinitkbd(c,0);
4253 return 0; }
4255 _aa=no
4256 for _ld_tmp in "-laa" ; do
4257 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4258 done
4260 if test "$_aa" = yes ; then
4261 _def_aa='#define HAVE_AA 1'
4262 if cygwin ; then
4263 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4265 _vosrc="$_vosrc vo_aa.c"
4266 _vomodules="aa $_vomodules"
4267 else
4268 _def_aa='#undef HAVE_AA'
4269 _novomodules="aa $_novomodules"
4271 echores "$_aa"
4274 echocheck "CACA"
4275 if test "$_caca" = auto ; then
4276 _caca=no
4277 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4278 cat > $TMPC << EOF
4279 #include <caca.h>
4280 #ifdef CACA_API_VERSION_1
4281 #include <caca0.h>
4282 #endif
4283 int main(void) { (void) caca_init(); return 0; }
4285 cc_check `caca-config --libs` && _caca=yes
4288 if test "$_caca" = yes ; then
4289 _def_caca='#define HAVE_CACA 1'
4290 _inc_extra="$_inc_extra `caca-config --cflags`"
4291 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4292 _vosrc="$_vosrc vo_caca.c"
4293 _vomodules="caca $_vomodules"
4294 else
4295 _def_caca='#undef HAVE_CACA'
4296 _novomodules="caca $_novomodules"
4298 echores "$_caca"
4301 echocheck "SVGAlib"
4302 if test "$_svga" = auto ; then
4303 cat > $TMPC << EOF
4304 #include <vga.h>
4305 int main(void) { return 0; }
4307 _svga=no
4308 cc_check -lvga $_ld_lm && _svga=yes
4310 if test "$_svga" = yes ; then
4311 _def_svga='#define HAVE_SVGALIB 1'
4312 _libs_mplayer="$_libs_mplayer -lvga"
4313 _vosrc="$_vosrc vo_svga.c"
4314 _vomodules="svga $_vomodules"
4315 else
4316 _def_svga='#undef HAVE_SVGALIB'
4317 _novomodules="svga $_novomodules"
4319 echores "$_svga"
4322 echocheck "FBDev"
4323 if test "$_fbdev" = auto ; then
4324 _fbdev=no
4325 linux && test -c /dev/fb0 && _fbdev=yes
4327 if test "$_fbdev" = yes ; then
4328 _def_fbdev='#define HAVE_FBDEV 1'
4329 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4330 _vomodules="fbdev $_vomodules"
4331 else
4332 _def_fbdev='#undef HAVE_FBDEV'
4333 _novomodules="fbdev $_novomodules"
4335 echores "$_fbdev"
4339 echocheck "DVB"
4340 if test "$_dvb" = auto ; then
4341 _dvb=no
4342 cat >$TMPC << EOF
4343 #include <sys/poll.h>
4344 #include <sys/ioctl.h>
4345 #include <stdio.h>
4346 #include <time.h>
4347 #include <unistd.h>
4349 #include <ost/dmx.h>
4350 #include <ost/frontend.h>
4351 #include <ost/sec.h>
4352 #include <ost/video.h>
4353 #include <ost/audio.h>
4354 int main(void) {return 0;}
4356 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4357 cc_check $_inc_tmp && _dvb=yes && \
4358 _inc_extra="$_inc_extra $_inc_tmp" && break
4359 done
4361 echores "$_dvb"
4362 if test "$_dvb" = yes ; then
4363 _def_dvb='#define HAVE_DVB 1'
4364 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4365 _aomodules="mpegpes(dvb) $_aomodules"
4366 _vomodules="mpegpes(dvb) $_vomodules"
4369 echocheck "DVB HEAD"
4370 if test "$_dvbhead" = auto ; then
4371 _dvbhead=no
4373 cat >$TMPC << EOF
4374 #include <sys/poll.h>
4375 #include <sys/ioctl.h>
4376 #include <stdio.h>
4377 #include <time.h>
4378 #include <unistd.h>
4380 #include <linux/dvb/dmx.h>
4381 #include <linux/dvb/frontend.h>
4382 #include <linux/dvb/video.h>
4383 #include <linux/dvb/audio.h>
4384 int main(void) {return 0;}
4386 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4387 cc_check $_inc_tmp && _dvbhead=yes && \
4388 _inc_extra="$_inc_extra $_inc_tmp" && break
4389 done
4391 echores "$_dvbhead"
4392 if test "$_dvbhead" = yes ; then
4393 _def_dvb='#define HAVE_DVB_HEAD 1'
4394 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4395 _aomodules="mpegpes(dvb) $_aomodules"
4396 _vomodules="mpegpes(dvb) $_vomodules"
4399 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4400 _def_dvb='#undef HAVE_DVB'
4401 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4402 _aomodules="mpegpes(file) $_aomodules"
4403 _vomodules="mpegpes(file) $_vomodules"
4406 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4407 _dvbin=yes
4408 _inputmodules="dvb $_inputmodules"
4409 else
4410 _dvbin=no
4411 _noinputmodules="dvb $_noinputmodules"
4414 echocheck "PNG support"
4415 if test "$_png" = auto ; then
4416 _png=no
4417 if irix ; then
4418 # Don't check for -lpng on irix since it has its own libpng
4419 # incompatible with the GNU libpng
4420 _res_comment="disabled on irix (not GNU libpng)"
4421 else
4422 cat > $TMPC << EOF
4423 #include <png.h>
4424 #include <string.h>
4425 int main(void) {
4426 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4427 printf("libpng: %s\n", png_libpng_ver);
4428 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4431 if cc_check -lpng -lz $_ld_lm ; then
4432 if tmp_run ; then
4433 _png=yes
4434 else
4435 _res_comment="mismatch of library and header versions"
4440 echores "$_png"
4441 if test "$_png" = yes ; then
4442 _def_png='#define HAVE_PNG 1'
4443 _ld_extra="$_ld_extra -lpng -lz"
4444 _vosrc="$_vosrc vo_png.c"
4445 _vomodules="png $_vomodules"
4446 else
4447 _def_png='#undef HAVE_PNG'
4448 _novomodules="png $_novomodules"
4451 echocheck "JPEG support"
4452 if test "$_jpeg" = auto ; then
4453 _jpeg=no
4454 cat > $TMPC << EOF
4455 #include <stdio.h>
4456 #include <stdlib.h>
4457 #include <setjmp.h>
4458 #include <string.h>
4459 #include <jpeglib.h>
4460 int main(void) {
4461 return 0;
4464 if cc_check -ljpeg $_ld_lm ; then
4465 if tmp_run ; then
4466 _jpeg=yes
4470 echores "$_jpeg"
4472 if test "$_jpeg" = yes ; then
4473 _def_jpeg='#define HAVE_JPEG 1'
4474 _vosrc="$_vosrc vo_jpeg.c"
4475 _vomodules="jpeg $_vomodules"
4476 _ld_extra="$_ld_extra -ljpeg"
4477 else
4478 _def_jpeg='#undef HAVE_JPEG'
4479 _novomodules="jpeg $_novomodules"
4484 echocheck "PNM support"
4485 if test "$_pnm" = yes; then
4486 _def_pnm="#define HAVE_PNM"
4487 _vosrc="$_vosrc vo_pnm.c"
4488 _vomodules="pnm $_vomodules"
4489 else
4490 _def_pnm="#undef HAVE_PNM"
4491 _novomodules="pnm $_novomodules"
4493 echores "$_pnm"
4497 echocheck "GIF support"
4498 # This is to appease people who want to force gif support.
4499 # If it is forced to yes, then we still do checks to determine
4500 # which gif library to use.
4501 if test "$_gif" = yes ; then
4502 _force_gif=yes
4503 _gif=auto
4506 if test "$_gif" = auto ; then
4507 _gif=no
4508 cat > $TMPC << EOF
4509 #include <gif_lib.h>
4510 int main(void) {
4511 return 0;
4514 for _ld_gif in "-lungif" "-lgif" ; do
4515 cc_check $_ld_gif && tmp_run && _gif=yes && break
4516 done
4519 # If no library was found, and the user wants support forced,
4520 # then we force it on with libgif, as this is the safest
4521 # assumption IMHO. (libungif & libregif both create symbolic
4522 # links to libgif. We also assume that no x11 support is needed,
4523 # because if you are forcing this, then you _should_ know what
4524 # you are doing. [ Besides, package maintainers should never
4525 # have compiled x11 deps into libungif in the first place. ] )
4526 # </rant>
4527 # --Joey
4528 if test "$_force_gif" = yes && test "$_gif" = no ; then
4529 _gif=yes
4530 _ld_gif="-lgif"
4533 if test "$_gif" = yes ; then
4534 _def_gif='#define HAVE_GIF 1'
4535 _vosrc="$_vosrc vo_gif89a.c"
4536 _codecmodules="gif $_codecmodules"
4537 _vomodules="gif89a $_vomodules"
4538 _res_comment="old version, some encoding functions disabled"
4539 _def_gif_4='#undef HAVE_GIF_4'
4540 _ld_extra="$_ld_extra $_ld_gif"
4542 cat > $TMPC << EOF
4543 #include <signal.h>
4544 #include <gif_lib.h>
4545 void catch() { exit(1); }
4546 int main(void) {
4547 signal(SIGSEGV, catch); // catch segfault
4548 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4549 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4550 return 0;
4553 if cc_check "$_ld_gif" && tmp_run ; then
4554 _def_gif_4='#define HAVE_GIF_4 1'
4555 _res_comment=""
4557 else
4558 _def_gif='#undef HAVE_GIF'
4559 _def_gif_4='#undef HAVE_GIF_4'
4560 _novomodules="gif89a $_novomodules"
4561 _nocodecmodules="gif $_nocodecmodules"
4563 echores "$_gif"
4566 case "$_gif" in yes*)
4567 echocheck "broken giflib workaround"
4568 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4570 cat > $TMPC << EOF
4571 #include <gif_lib.h>
4572 int main(void) {
4573 GifFileType gif;
4574 printf("UserData is at address %p\n", gif.UserData);
4575 return 0;
4578 if cc_check "$_ld_gif" && tmp_run ; then
4579 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4580 echores "disabled"
4581 else
4582 echores "enabled"
4585 esac
4588 echocheck "VESA support"
4589 if test "$_vesa" = auto ; then
4590 cat > $TMPC << EOF
4591 #include <vbe.h>
4592 int main(void) { vbeVersion(); return 0; }
4594 _vesa=no
4595 cc_check -lvbe -llrmi && _vesa=yes
4597 if test "$_vesa" = yes ; then
4598 _def_vesa='#define HAVE_VESA 1'
4599 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4600 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4601 _vomodules="vesa $_vomodules"
4602 else
4603 _def_vesa='#undef HAVE_VESA'
4604 _novomodules="vesa $_novomodules"
4606 echores "$_vesa"
4608 #################
4609 # VIDEO + AUDIO #
4610 #################
4613 echocheck "SDL"
4614 if test -z "$_sdlconfig" ; then
4615 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4616 _sdlconfig="sdl-config"
4617 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4618 _sdlconfig="sdl11-config"
4619 else
4620 _sdlconfig=false
4623 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4624 cat > $TMPC << EOF
4625 #include <SDL.h>
4626 int main(int argc, char *argv[]) { return 0; }
4628 _sdl=no
4629 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4630 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4631 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4632 if test "$_sdlversion" -gt 116 ; then
4633 if test "$_sdlversion" -lt 121 ; then
4634 _def_sdlbuggy='#define BUGGY_SDL'
4635 else
4636 _def_sdlbuggy='#undef BUGGY_SDL'
4638 _sdl=yes
4643 if test "$_sdl" = yes ; then
4644 _def_sdl='#define HAVE_SDL 1'
4645 if cygwin ; then
4646 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4647 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4648 elif mingw32 ; then
4649 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4650 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4651 else
4652 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4653 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4655 _vosrc="$_vosrc vo_sdl.c"
4656 _vomodules="sdl $_vomodules"
4657 _aosrc="$_aosrc ao_sdl.c"
4658 _aomodules="sdl $_aomodules"
4659 _res_comment="using $_sdlconfig"
4660 else
4661 _def_sdl='#undef HAVE_SDL'
4662 _novomodules="sdl $_novomodules"
4663 _noaomodules="sdl $_noaomodules"
4665 echores "$_sdl"
4668 if win32; then
4670 echocheck "Windows waveout"
4671 if test "$_win32waveout" = auto ; then
4672 cat > $TMPC << EOF
4673 #include <windows.h>
4674 #include <mmsystem.h>
4675 int main(void) { return 0; }
4677 _win32waveout=no
4678 cc_check -lwinmm && _win32waveout=yes
4680 if test "$_win32waveout" = yes ; then
4681 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4682 _libs_mplayer="$_libs_mplayer -lwinmm"
4683 _aosrc="$_aosrc ao_win32.c"
4684 _aomodules="win32 $_aomodules"
4685 else
4686 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4687 _noaomodules="win32 $_noaomodules"
4689 echores "$_win32waveout"
4691 echocheck "Directx"
4692 if test "$_directx" = auto ; then
4693 cat > $TMPC << EOF
4694 #include <windows.h>
4695 #include <ddraw.h>
4696 #include <dsound.h>
4697 int main(void) { return 0; }
4699 _directx=no
4700 cc_check -lgdi32 && _directx=yes
4702 if test "$_directx" = yes ; then
4703 _def_directx='#define HAVE_DIRECTX 1'
4704 _libs_mplayer="$_libs_mplayer -lgdi32"
4705 _vosrc="$_vosrc vo_directx.c"
4706 _vomodules="directx $_vomodules"
4707 _aosrc="$_aosrc ao_dsound.c"
4708 _aomodules="dsound $_aomodules"
4709 else
4710 _def_directx='#undef HAVE_DIRECTX'
4711 _novomodules="directx $_novomodules"
4712 _noaomodules="dsound $_noaomodules"
4714 echores "$_directx"
4716 fi #if win32; then
4719 echocheck "NAS"
4720 if test "$_nas" = auto ; then
4721 cat > $TMPC << EOF
4722 #include <audio/audiolib.h>
4723 int main(void) { return 0; }
4725 _nas=no
4726 cc_check $_ld_lm -laudio -lXt && _nas=yes
4728 if test "$_nas" = yes ; then
4729 _def_nas='#define HAVE_NAS 1'
4730 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4731 _aosrc="$_aosrc ao_nas.c"
4732 _aomodules="nas $_aomodules"
4733 else
4734 _noaomodules="nas $_noaomodules"
4735 _def_nas='#undef HAVE_NAS'
4737 echores "$_nas"
4739 echocheck "DXR2"
4740 if test "$_dxr2" = auto; then
4741 _dxr2=no
4742 cat > $TMPC << EOF
4743 #include <dxr2ioctl.h>
4744 int main(void) { return 0; }
4746 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4747 cc_check $_inc_tmp && _dxr2=yes && \
4748 _inc_extra="$_inc_extra $_inc_tmp" && break
4749 done
4751 if test "$_dxr2" = yes; then
4752 _def_dxr2='#define HAVE_DXR2 1'
4753 _vosrc="$_vosrc vo_dxr2.c"
4754 _aosrc="$_aosrc ao_dxr2.c"
4755 _aomodules="dxr2 $_aomodules"
4756 _vomodules="dxr2 $_vomodules"
4757 else
4758 _def_dxr2='#undef HAVE_DXR2'
4759 _noaomodules="dxr2 $_noaomodules"
4760 _novomodules="dxr2 $_novomodules"
4762 echores "$_dxr2"
4764 echocheck "DXR3/H+"
4765 if test "$_dxr3" = auto ; then
4766 cat > $TMPC << EOF
4767 #include <linux/em8300.h>
4768 int main(void) { return 0; }
4770 _dxr3=no
4771 cc_check && _dxr3=yes
4773 if test "$_dxr3" = yes ; then
4774 _def_dxr3='#define HAVE_DXR3 1'
4775 _vosrc="$_vosrc vo_dxr3.c"
4776 _vomodules="dxr3 $_vomodules"
4777 else
4778 _def_dxr3='#undef HAVE_DXR3'
4779 _novomodules="dxr3 $_novomodules"
4781 echores "$_dxr3"
4784 echocheck "IVTV TV-Out"
4785 if test "$_ivtv" = auto ; then
4786 cat > $TMPC << EOF
4787 #include <stdlib.h>
4788 #include <inttypes.h>
4789 #include <linux/types.h>
4790 #include <linux/videodev2.h>
4791 #include <linux/ivtv.h>
4792 int main(void) { return 0; }
4794 _ivtv=no
4795 cc_check && _ivtv=yes
4797 if test "$_ivtv" = yes ; then
4798 _def_ivtv='#define HAVE_IVTV 1'
4799 _vosrc="$_vosrc vo_ivtv.c"
4800 _vomodules="ivtv $_vomodules"
4801 _aosrc="$_aosrc ao_ivtv.c"
4802 _aomodules="ivtv $_aomodules"
4803 else
4804 _def_ivtv='#undef HAVE_IVTV'
4805 _novomodules="ivtv $_novomodules"
4806 _noaomodules="ivtv $_noaomodules"
4808 echores "$_ivtv"
4812 #########
4813 # AUDIO #
4814 #########
4817 echocheck "OSS Audio"
4818 if test "$_ossaudio" = auto ; then
4819 cat > $TMPC << EOF
4820 #include <sys/ioctl.h>
4821 $_include_soundcard
4822 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4824 _ossaudio=no
4825 cc_check && _ossaudio=yes
4827 if test "$_ossaudio" = yes ; then
4828 _def_ossaudio='#define USE_OSS_AUDIO 1'
4829 _aosrc="$_aosrc ao_oss.c"
4830 _aomodules="oss $_aomodules"
4831 if test "$_linux_devfs" = yes; then
4832 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4833 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4834 else
4835 cat > $TMPC << EOF
4836 #include <sys/ioctl.h>
4837 $_include_soundcard
4838 #ifdef OPEN_SOUND_SYSTEM
4839 int main(void) { return 0; }
4840 #else
4841 #error Not the real thing
4842 #endif
4844 _real_ossaudio=no
4845 cc_check && _real_ossaudio=yes
4846 if test "$_real_ossaudio" = yes; then
4847 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4848 elif netbsd || openbsd ; then
4849 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4850 _ld_extra="$_ld_extra -lossaudio"
4851 else
4852 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4854 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4856 else
4857 _def_ossaudio='#undef USE_OSS_AUDIO'
4858 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4859 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4860 _noaomodules="oss $_noaomodules"
4862 echores "$_ossaudio"
4865 echocheck "aRts"
4866 if test "$_arts" = auto ; then
4867 _arts=no
4868 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4870 cat > $TMPC << EOF
4871 #include <artsc.h>
4872 int main(void) { return 0; }
4874 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
4879 if test "$_arts" = yes ; then
4880 _def_arts='#define USE_ARTS 1'
4881 _aosrc="$_aosrc ao_arts.c"
4882 _aomodules="arts $_aomodules"
4883 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
4884 _inc_extra="$_inc_extra `artsc-config --cflags`"
4885 else
4886 _noaomodules="arts $_noaomodules"
4888 echores "$_arts"
4891 echocheck "EsounD"
4892 if test "$_esd" = auto ; then
4893 _esd=no
4894 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4896 cat > $TMPC << EOF
4897 #include <esd.h>
4898 int main(void) { return 0; }
4900 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes
4904 echores "$_esd"
4906 if test "$_esd" = yes ; then
4907 _def_esd='#define USE_ESD 1'
4908 _aosrc="$_aosrc ao_esd.c"
4909 _aomodules="esd $_aomodules"
4910 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
4911 _inc_extra="$_inc_extra `esd-config --cflags`"
4913 echocheck "esd_get_latency()"
4914 cat > $TMPC << EOF
4915 #include <esd.h>
4916 int main(void) { return esd_get_latency(0); }
4918 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4919 echores "$_esd_latency"
4920 else
4921 _def_esd='#undef USE_ESD'
4922 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4923 _noaomodules="esd $_noaomodules"
4926 echocheck "Polyp"
4927 if test "$_polyp" = auto ; then
4928 _polyp=no
4929 if $_pkg_config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
4931 cat > $TMPC << EOF
4932 #include <polyp/polyplib.h>
4933 #include <polyp/mainloop.h>
4934 #include <polyp/polyplib-error.h>
4935 int main(void) { return 0; }
4937 cc_check `$_pkg_config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
4941 echores "$_polyp"
4943 if test "$_polyp" = yes ; then
4944 _def_polyp='#define USE_POLYP 1'
4945 _aosrc="$_aosrc ao_polyp.c"
4946 _aomodules="polyp $_aomodules"
4947 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs polyplib polyplib-error polyplib-mainloop`"
4948 _inc_extra="$_inc_extra `$_pkg_config --cflags polyplib polyplib-error polyplib-mainloop`"
4949 else
4950 _def_polyp='#undef USE_POLYP'
4951 _noaomodules="polyp $_noaomodules"
4955 echocheck "JACK"
4956 if test "$_jack" = auto ; then
4957 _jack=yes
4959 cat > $TMPC << EOF
4960 #include <jack/jack.h>
4961 int main(void) { jack_client_new("test"); return 0; }
4963 if cc_check -ljack ; then
4964 _libs_mplayer="$_libs_mplayer -ljack"
4965 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
4966 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
4967 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
4968 else
4969 _jack=no
4973 if test "$_jack" = yes ; then
4974 _def_jack='#define USE_JACK 1'
4975 _aosrc="$_aosrc ao_jack.c"
4976 _aomodules="jack $_aomodules"
4977 else
4978 _noaomodules="jack $_noaomodules"
4980 echores "$_jack"
4982 echocheck "OpenAL"
4983 if test "$_openal" = auto ; then
4984 _openal=no
4985 cat > $TMPC << EOF
4986 #ifdef OPENAL_AL_H
4987 #include <OpenAL/al.h>
4988 #else
4989 #include <AL/al.h>
4990 #endif
4991 int main(void) {
4992 alSourceQueueBuffers(0, 0, 0);
4993 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4994 return 0;
4997 for I in "-lopenal" "-framework OpenAL" ; do
4998 cc_check $I && _openal=yes && break
4999 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5000 done
5001 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5003 if test "$_openal" = yes ; then
5004 _def_openal='#define USE_OPENAL 1'
5005 _aosrc="$_aosrc ao_openal.c"
5006 _aomodules="openal $_aomodules"
5007 else
5008 _noaomodules="openal $_noaomodules"
5010 echores "$_openal"
5012 echocheck "ALSA audio"
5013 if test "$_alsa" != no ; then
5014 _alsa=no
5015 cat > $TMPC << EOF
5016 #include <sys/asoundlib.h>
5017 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5018 #error "alsa version != 0.5.x"
5019 #endif
5020 int main(void) { return 0; }
5022 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5024 cat > $TMPC << EOF
5025 #include <sys/asoundlib.h>
5026 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5027 #error "alsa version != 0.9.x"
5028 #endif
5029 int main(void) { return 0; }
5031 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5032 cat > $TMPC << EOF
5033 #include <alsa/asoundlib.h>
5034 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5035 #error "alsa version != 0.9.x"
5036 #endif
5037 int main(void) { return 0; }
5039 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5041 cat > $TMPC << EOF
5042 #include <sys/asoundlib.h>
5043 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5044 #error "alsa version != 1.0.x"
5045 #endif
5046 int main(void) { return 0; }
5048 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5049 cat > $TMPC << EOF
5050 #include <alsa/asoundlib.h>
5051 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5052 #error "alsa version != 1.0.x"
5053 #endif
5054 int main(void) { return 0; }
5056 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5058 _def_alsa5='#undef HAVE_ALSA5'
5059 _def_alsa9='#undef HAVE_ALSA9'
5060 _def_alsa1x='#undef HAVE_ALSA1X'
5061 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5062 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5063 if test "$_alsaver" ; then
5064 _alsa=yes
5065 if test "$_alsaver" = '0.5.x' ; then
5066 _alsa5=yes
5067 _aosrc="$_aosrc ao_alsa5.c"
5068 _aomodules="alsa5 $_aomodules"
5069 _def_alsa5='#define HAVE_ALSA5 1'
5070 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5071 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5072 elif test "$_alsaver" = '0.9.x-sys' ; then
5073 _alsa9=yes
5074 _aosrc="$_aosrc ao_alsa.c"
5075 _aomodules="alsa $_aomodules"
5076 _def_alsa9='#define HAVE_ALSA9 1'
5077 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5078 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5079 elif test "$_alsaver" = '0.9.x-alsa' ; then
5080 _alsa9=yes
5081 _aosrc="$_aosrc ao_alsa.c"
5082 _aomodules="alsa $_aomodules"
5083 _def_alsa9='#define HAVE_ALSA9 1'
5084 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5085 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5086 elif test "$_alsaver" = '1.0.x-sys' ; then
5087 _alsa1x=yes
5088 _aosrc="$_aosrc ao_alsa.c"
5089 _aomodules="alsa $_aomodules"
5090 _def_alsa1x="#define HAVE_ALSA1X 1"
5091 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5092 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5093 elif test "$_alsaver" = '1.0.x-alsa' ; then
5094 _alsa1x=yes
5095 _aosrc="$_aosrc ao_alsa.c"
5096 _aomodules="alsa $_aomodules"
5097 _def_alsa1x="#define HAVE_ALSA1X 1"
5098 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5099 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5100 else
5101 _alsa=no
5102 _res_comment="unknown version"
5104 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5105 else
5106 _noaomodules="alsa $_noaomodules"
5108 echores "$_alsa"
5111 echocheck "Sun audio"
5112 if test "$_sunaudio" = auto ; then
5113 cat > $TMPC << EOF
5114 #include <sys/types.h>
5115 #include <sys/audioio.h>
5116 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5118 _sunaudio=no
5119 cc_check && _sunaudio=yes
5121 if test "$_sunaudio" = yes ; then
5122 _def_sunaudio='#define USE_SUN_AUDIO 1'
5123 _aosrc="$_aosrc ao_sun.c"
5124 _aomodules="sun $_aomodules"
5125 else
5126 _def_sunaudio='#undef USE_SUN_AUDIO'
5127 _noaomodules="sun $_noaomodules"
5129 echores "$_sunaudio"
5132 if sunos; then
5133 echocheck "Sun mediaLib"
5134 if test "$_mlib" = auto ; then
5135 _mlib=no
5136 cat > $TMPC << EOF
5137 #include <mlib.h>
5138 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5140 cc_check -lmlib && _mlib=yes
5142 if test "$_mlib" = yes ; then
5143 _def_mlib='#define HAVE_MLIB 1'
5144 else
5145 _def_mlib='#undef HAVE_MLIB'
5147 echores "$_mlib"
5148 fi #if sunos
5151 if irix; then
5152 echocheck "SGI audio"
5153 if test "$_sgiaudio" = auto ; then
5154 # check for SGI audio
5155 cat > $TMPC << EOF
5156 #include <dmedia/audio.h>
5157 int main(void) { return 0; }
5159 _sgiaudio=no
5160 cc_check && _sgiaudio=yes
5162 if test "$_sgiaudio" = "yes" ; then
5163 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5164 _libs_mplayer="$_libs_mplayer -laudio"
5165 _aosrc="$_aosrc ao_sgi.c"
5166 _aomodules="sgi $_aomodules"
5167 else
5168 _def_sgiaudio='#undef USE_SGI_AUDIO'
5169 _noaomodules="sgi $_noaomodules"
5171 echores "$_sgiaudio"
5172 fi #if irix
5175 echocheck "VCD support"
5176 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5177 _inputmodules="vcd $_inputmodules"
5178 _def_vcd='#define HAVE_VCD 1'
5179 _vcd="yes"
5180 else
5181 _def_vcd='#undef HAVE_VCD'
5182 _noinputmodules="vcd $_noinputmodules"
5183 _res_comment="not supported on this OS"
5184 _vcd="no"
5186 echores "$_vcd"
5190 echocheck "dvdread"
5191 if test "$_dvdread_internal" = auto ; then
5192 _dvdread_internal=no
5193 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5194 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5195 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5196 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5197 _dvdread_internal=yes
5198 _dvdread=yes
5199 _res_comment="internal"
5201 elif test "$_dvdread" = auto ; then
5202 _dvdread=no
5203 if test "$_dl" = yes; then
5204 cat > $TMPC << EOF
5205 #include <inttypes.h>
5206 #include <dvdread/dvd_reader.h>
5207 #include <dvdread/ifo_types.h>
5208 #include <dvdread/ifo_read.h>
5209 #include <dvdread/nav_read.h>
5210 int main(void) { return 0; }
5212 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5213 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5217 if test "$_dvdread_internal" = yes; then
5218 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5219 _def_dvdread='#define USE_DVDREAD 1'
5220 _inputmodules="dvdread(internal) $_inputmodules"
5221 _largefiles=yes
5222 elif test "$_dvdread" = yes; then
5223 _def_dvdread='#define USE_DVDREAD 1'
5224 _largefiles=yes
5225 _ld_extra="$_ld_extra -ldvdread"
5226 _inputmodules="dvdread(external) $_inputmodules"
5227 _res_comment="external"
5228 else
5229 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5230 _def_dvdread='#undef USE_DVDREAD'
5231 _noinputmodules="dvdread $_noinputmodules"
5233 echores "$_dvdread"
5236 echocheck "internal libdvdcss"
5237 if test "$_libdvdcss_internal" = auto ; then
5238 _libdvdcss_internal=no
5239 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5241 if test "$_libdvdcss_internal" = yes ; then
5242 if linux || netbsd || openbsd || bsdos ; then
5243 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5244 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5245 elif freebsd ; then
5246 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5247 elif darwin ; then
5248 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5249 _ld_extra="$_ld_extra -framework IOKit"
5251 _inputmodules="libdvdcss(internal) $_inputmodules"
5252 _largefiles=yes
5253 else
5254 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5256 echores "$_libdvdcss_internal"
5259 echocheck "cdparanoia"
5260 if test "$_cdparanoia" = auto ; then
5261 cat > $TMPC <<EOF
5262 #include <cdda_interface.h>
5263 #include <cdda_paranoia.h>
5264 // This need a better test. How ?
5265 int main(void) {
5266 void *test = cdda_verbose_set;
5267 return test == (void *)1;
5270 _cdparanoia=no
5271 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5272 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5273 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5274 done
5276 if test "$_cdparanoia" = yes ; then
5277 _cdda='yes'
5278 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5279 openbsd && _ld_extra="$_ld_extra -lutil"
5281 echores "$_cdparanoia"
5284 echocheck "libcdio"
5285 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5286 cat > $TMPC << EOF
5287 #include <stdio.h>
5288 #include <cdio/version.h>
5289 #include <cdio/cdda.h>
5290 #include <cdio/paranoia.h>
5291 int main()
5293 void *test = cdda_verbose_set;
5294 printf("%s\n", CDIO_VERSION);
5295 return test == (void *)1;
5299 _libcdio=no
5300 for _ld_tmp in "" "-lwinmm" ; do
5301 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5302 cc_check $_ld_tmp $_ld_lm \
5303 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5304 done
5305 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5306 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5307 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5308 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5309 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5312 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5313 _cdda='yes'
5314 _def_libcdio='#define HAVE_LIBCDIO'
5315 _def_havelibcdio='yes'
5316 else
5317 if test "$_cdparanoia" = yes ; then
5318 _res_comment="using cdparanoia"
5320 _def_libcdio='#undef HAVE_LIBCDIO'
5321 _def_havelibcdio='no'
5323 echores "$_libcdio"
5325 if test "$_cdda" = yes ; then
5326 test $_cddb = auto && test $_network = yes && not darwin && _cddb=yes
5327 _def_cdparanoia='#define HAVE_CDDA'
5328 _inputmodules="cdda $_inputmodules"
5329 else
5330 _def_cdparanoia='#undef HAVE_CDDA'
5331 _noinputmodules="cdda $_noinputmodules"
5334 if test "$_cddb" = yes ; then
5335 _def_cddb='#define HAVE_CDDB'
5336 _inputmodules="cddb $_inputmodules"
5337 else
5338 _cddb=no
5339 _def_cddb='#undef HAVE_CDDB'
5340 _noinputmodules="cddb $_noinputmodules"
5343 echocheck "bitmap font support"
5344 if test "$_bitmap_font" = yes ; then
5345 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5346 else
5347 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5349 echores "$_bitmap_font"
5352 echocheck "freetype >= 2.0.9"
5354 # freetype depends on iconv
5355 if test "$_iconv" = no ; then
5356 _freetype=no
5357 _res_comment="iconv support needed"
5360 if test "$_freetype" = auto ; then
5361 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5362 cat > $TMPC << EOF
5363 #include <stdio.h>
5364 #include <ft2build.h>
5365 #include FT_FREETYPE_H
5366 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5367 #error "Need FreeType 2.0.9 or newer"
5368 #endif
5369 int main()
5371 FT_Library library;
5372 FT_Int major=-1,minor=-1,patch=-1;
5373 int err=FT_Init_FreeType(&library);
5374 if(err){
5375 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5376 exit(err);
5378 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5379 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5380 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5381 (int)major,(int)minor,(int)patch );
5382 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5383 printf("Library and header version mismatch! Fix it in your distribution!\n");
5384 exit(1);
5386 return 0;
5389 _freetype=no
5390 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5391 else
5392 _freetype=no
5395 if test "$_freetype" = yes ; then
5396 _def_freetype='#define HAVE_FREETYPE'
5397 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5398 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5399 else
5400 _def_freetype='#undef HAVE_FREETYPE'
5402 echores "$_freetype"
5404 if test "$_freetype" = no ; then
5405 _fontconfig=no
5406 _res_comment="freetype support needed"
5408 echocheck "fontconfig"
5409 if test "$_fontconfig" = auto ; then
5410 cat > $TMPC << EOF
5411 #include <stdio.h>
5412 #include <fontconfig/fontconfig.h>
5413 int main()
5415 int err = FcInit();
5416 if(err == FcFalse){
5417 printf("Couldn't initialize fontconfig lib\n");
5418 exit(err);
5420 return 0;
5424 _fontconfig=no
5425 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5426 _ld_tmp="-lfontconfig $_ld_tmp"
5427 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5428 done
5429 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5430 _inc_tmp=`$_pkg_config --cflags fontconfig`
5431 _ld_tmp=`$_pkg_config --libs fontconfig`
5432 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5433 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5436 if test "$_fontconfig" = yes ; then
5437 _def_fontconfig='#define HAVE_FONTCONFIG'
5438 else
5439 _def_fontconfig='#undef HAVE_FONTCONFIG'
5441 echores "$_fontconfig"
5444 echocheck "SSA/ASS support"
5445 # libass depends on FreeType
5446 if test "$_freetype" = no ; then
5447 _ass=no
5448 _res_comment="FreeType support needed"
5451 if test "$_ass" = auto ; then
5452 cat > $TMPC << EOF
5453 #include <ft2build.h>
5454 #include FT_FREETYPE_H
5455 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5456 #error "Need FreeType 2.1.8 or newer"
5457 #endif
5458 int main() { return 0; }
5460 _ass=no
5461 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5462 if test "$_ass" = no ; then
5463 _res_comment="FreeType >= 2.1.8 needed"
5466 if test "$_ass" = yes ; then
5467 _def_ass='#define USE_ASS'
5468 else
5469 _def_ass='#undef USE_ASS'
5471 echores "$_ass"
5474 echocheck "fribidi with charsets"
5475 if test "$_fribidi" = auto ; then
5476 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5477 cat > $TMPC << EOF
5478 #include <stdio.h>
5479 /* workaround for fribidi 0.10.4 and below */
5480 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5481 #include <fribidi/fribidi.h>
5482 int main()
5484 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5485 printf("Fribidi headers are not consistents with the library!\n");
5486 exit(1);
5488 return 0;
5491 _fribidi=no
5492 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5493 else
5494 _fribidi=no
5497 if test "$_fribidi" = yes ; then
5498 _def_fribidi='#define USE_FRIBIDI'
5499 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5500 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5501 else
5502 _def_fribidi='#undef USE_FRIBIDI'
5504 echores "$_fribidi"
5507 echocheck "ENCA"
5508 if test "$_enca" = auto ; then
5509 cat > $TMPC << EOF
5510 #include <enca.h>
5511 int main()
5513 const char **langs;
5514 size_t langcnt;
5515 langs = enca_get_languages(&langcnt);
5516 return 0;
5519 _enca=no
5520 cc_check -lenca $_ld_lm && _enca=yes
5522 if test "$_enca" = yes ; then
5523 _def_enca='#define HAVE_ENCA 1'
5524 _ld_extra="$_ld_extra -lenca"
5525 else
5526 _def_enca='#undef HAVE_ENCA'
5528 echores "$_enca"
5531 echocheck "zlib"
5532 cat > $TMPC << EOF
5533 #include <zlib.h>
5534 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5536 _zlib=no
5537 cc_check -lz && _zlib=yes
5538 if test "$_zlib" = yes ; then
5539 _def_zlib='#define HAVE_ZLIB 1'
5540 _ld_extra="$_ld_extra -lz"
5541 else
5542 _def_zlib='#undef HAVE_ZLIB'
5543 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5544 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5546 echores "$_zlib"
5549 echocheck "RTC"
5550 if test "$_rtc" = auto ; then
5551 cat > $TMPC << EOF
5552 #include <sys/ioctl.h>
5553 #ifdef __linux__
5554 #include <linux/rtc.h>
5555 #else
5556 #include <rtc.h>
5557 #define RTC_PIE_ON RTCIO_PIE_ON
5558 #endif
5559 int main(void) { return RTC_PIE_ON; }
5561 _rtc=no
5562 cc_check && _rtc=yes
5563 ppc && _rtc=no
5565 if test "$_rtc" = yes ; then
5566 _def_rtc='#define HAVE_RTC 1'
5567 else
5568 _def_rtc='#undef HAVE_RTC'
5570 echores "$_rtc"
5573 echocheck "liblzo2 support"
5574 if test "$_liblzo" = auto ; then
5575 _liblzo=no
5576 cat > $TMPC << EOF
5577 #include <lzo/lzo1x.h>
5578 int main(void) { lzo_init();return 0; }
5580 cc_check -llzo2 && _liblzo=yes
5582 if test "$_liblzo" = yes ; then
5583 _def_liblzo='#define USE_LIBLZO 1'
5584 _ld_extra="$_ld_extra -llzo2"
5585 _codecmodules="liblzo $_codecmodules"
5586 else
5587 _def_liblzo='#undef USE_LIBLZO'
5588 _nocodecmodules="liblzo $_nocodecmodules"
5590 echores "$_liblzo"
5593 echocheck "mad support"
5594 if test "$_mad" = auto ; then
5595 _mad=no
5596 cat > $TMPC << EOF
5597 #include <mad.h>
5598 int main(void) { return 0; }
5600 cc_check -lmad && _mad=yes
5602 if test "$_mad" = yes ; then
5603 _def_mad='#define USE_LIBMAD 1'
5604 _ld_extra="$_ld_extra -lmad"
5605 _codecmodules="libmad $_codecmodules"
5606 else
5607 _def_mad='#undef USE_LIBMAD'
5608 _nocodecmodules="libmad $_nocodecmodules"
5610 echores "$_mad"
5612 echocheck "Twolame"
5613 if test "$_twolame" = auto ; then
5614 cat > $TMPC <<EOF
5615 #include <twolame.h>
5616 int main(void) { twolame_init(); return 0; }
5618 _twolame=no
5619 cc_check -ltwolame $_ld_lm && _twolame=yes
5621 if test "$_twolame" = yes ; then
5622 _def_twolame='#define HAVE_TWOLAME 1'
5623 _libs_mencoder="$_libs_mencoder -ltwolame"
5624 _codecmodules="twolame $_codecmodules"
5625 else
5626 _def_twolame='#undef HAVE_TWOLAME'
5627 _nocodecmodules="twolame $_nocodecmodules"
5629 echores "$_twolame"
5631 echocheck "Toolame"
5632 if test "$_toolame" = auto ; then
5633 _toolame=no
5634 if test "$_twolame" = yes ; then
5635 _res_comment="disabled by twolame"
5636 else
5637 cat > $TMPC <<EOF
5638 #include <toolame.h>
5639 int main(void) { toolame_init(); return 0; }
5641 cc_check -ltoolame $_ld_lm && _toolame=yes
5644 if test "$_toolame" = yes ; then
5645 _def_toolame='#define HAVE_TOOLAME 1'
5646 _libs_mencoder="$_libs_mencoder -ltoolame"
5647 _codecmodules="toolame $_codecmodules"
5648 else
5649 _def_toolame='#undef HAVE_TOOLAME'
5650 _nocodecmodules="toolame $_nocodecmodules"
5652 if test "$_toolamedir" ; then
5653 _res_comment="using $_toolamedir"
5655 echores "$_toolame"
5657 echocheck "OggVorbis support"
5658 if test "$_tremor_internal" = yes; then
5659 _libvorbis=no
5660 elif test "$_tremor_external" = auto; then
5661 _tremor_external=no
5662 cat > $TMPC << EOF
5663 #include <tremor/ivorbiscodec.h>
5664 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5666 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5668 if test "$_libvorbis" = auto; then
5669 _libvorbis=no
5670 cat > $TMPC << EOF
5671 #include <vorbis/codec.h>
5672 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5674 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5676 if test "$_tremor_internal" = yes ; then
5677 _vorbis=yes
5678 _def_vorbis='#define HAVE_OGGVORBIS 1'
5679 _def_tremor='#define TREMOR 1'
5680 _codecmodules="tremor(internal) $_codecmodules"
5681 _res_comment="internal Tremor"
5682 if test "$_tremor_low" = yes ; then
5683 _res_comment="internal low accuracy Tremor"
5685 elif test "$_tremor_external" = yes ; then
5686 _vorbis=yes
5687 _def_vorbis='#define HAVE_OGGVORBIS 1'
5688 _def_tremor='#define TREMOR 1'
5689 _codecmodules="tremor(external) $_codecmodules"
5690 _res_comment="external Tremor"
5691 _ld_extra="$_ld_extra -logg -lvorbisidec"
5692 elif test "$_libvorbis" = yes ; then
5693 _vorbis=yes
5694 _def_vorbis='#define HAVE_OGGVORBIS 1'
5695 _codecmodules="libvorbis $_codecmodules"
5696 _res_comment="libvorbis"
5697 _ld_extra="$_ld_extra -lvorbis -logg"
5698 else
5699 _vorbis=no
5700 _nocodecmodules="libvorbis $_nocodecmodules"
5702 if test "$_libvorbis" = no ; then
5703 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5704 _libavmuxers=`echo $_libavmuxers | sed -e s/OGG_MUXER// `
5706 echores "$_vorbis"
5708 echocheck "libspeex (version >= 1.1 required)"
5709 if test "$_speex" = auto ; then
5710 _speex=no
5711 cat > $TMPC << EOF
5712 #include <speex/speex.h>
5713 int main(void) {
5714 SpeexBits bits;
5715 void *dec;
5716 speex_decode_int(dec, &bits, dec);
5719 cc_check -lspeex $_ld_lm && _speex=yes
5721 if test "$_speex" = yes ; then
5722 _def_speex='#define HAVE_SPEEX 1'
5723 _ld_extra="$_ld_extra -lspeex"
5724 _codecmodules="speex $_codecmodules"
5725 else
5726 _def_speex='#undef HAVE_SPEEX'
5727 _nocodecmodules="speex $_nocodecmodules"
5729 echores "$_speex"
5731 echocheck "OggTheora support"
5732 if test "$_theora" = auto ; then
5733 _theora=no
5734 cat > $TMPC << EOF
5735 #include <theora/theora.h>
5736 #include <string.h>
5737 int main(void)
5739 /* theora is in flux, make sure that all interface routines and
5740 * datatypes exist and work the way we expect it, so we don't break
5741 * mplayer */
5742 ogg_packet op;
5743 theora_comment tc;
5744 theora_info inf;
5745 theora_state st;
5746 yuv_buffer yuv;
5747 int r;
5748 double t;
5750 theora_info_init (&inf);
5751 theora_comment_init (&tc);
5753 return 0;
5755 /* we don't want to execute this kind of nonsense; just for making sure
5756 * that compilation works... */
5757 memset(&op, 0, sizeof(op));
5758 r = theora_decode_header (&inf, &tc, &op);
5759 r = theora_decode_init (&st, &inf);
5760 t = theora_granule_time (&st, op.granulepos);
5761 r = theora_decode_packetin (&st, &op);
5762 r = theora_decode_YUVout (&st, &yuv);
5763 theora_clear (&st);
5765 return 0;
5768 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5769 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5770 && _theora=yes && break
5771 done
5772 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5773 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5774 cc_check -I. tremor/bitwise.c $_ld_theora \
5775 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5776 done
5779 if test "$_theora" = yes ; then
5780 _def_theora='#define HAVE_OGGTHEORA 1'
5781 _codecmodules="libtheora $_codecmodules"
5782 # when --enable-theora is forced, we'd better provide a probably sane
5783 # $_ld_theora than nothing
5784 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5785 else
5786 _def_theora='#undef HAVE_OGGTHEORA'
5787 _nocodecmodules="libtheora $_nocodecmodules"
5789 echores "$_theora"
5791 echocheck "mp3lib support"
5792 if test "$_mp3lib" = yes ; then
5793 _def_mp3lib='#define USE_MP3LIB 1'
5794 _codecmodules="mp3lib $_codecmodules"
5795 else
5796 _def_mp3lib='#undef USE_MP3LIB'
5797 _nocodecmodules="mp3lib $_nocodecmodules"
5799 echores "$_mp3lib"
5801 echocheck "liba52 support"
5802 if test "$_liba52" = yes ; then
5803 _def_liba52='#define USE_LIBA52 1'
5804 _codecmodules="liba52 $_codecmodules"
5805 else
5806 _def_liba52='#undef USE_LIBA52'
5807 _nocodecmodules="liba52 $_nocodecmodules"
5809 echores "$_liba52"
5812 echocheck "libmpeg2 support"
5813 if test "$_libmpeg2" = yes ; then
5814 _def_libmpeg2='#define USE_LIBMPEG2 1'
5815 _codecmodules="libmpeg2 $_codecmodules"
5816 else
5817 _def_libmpeg2='#undef USE_LIBMPEG2'
5818 _nocodecmodules="libmpeg2 $_nocodecmodules"
5820 echores "$_libmpeg2"
5822 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5823 if test "$_musepack" = auto ; then
5824 _musepack=no
5825 cat > $TMPC << EOF
5826 #include <mpcdec/mpcdec.h>
5827 int main(void) {
5828 mpc_streaminfo info;
5829 mpc_decoder decoder;
5830 mpc_decoder_set_streaminfo(&decoder, &info);
5831 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5834 cc_check -lmpcdec $_ld_lm && _musepack=yes
5836 if test "$_musepack" = yes ; then
5837 _def_musepack='#define HAVE_MUSEPACK 1'
5838 _ld_extra="$_ld_extra -lmpcdec"
5839 _codecmodules="musepack $_codecmodules"
5840 else
5841 _def_musepack='#undef HAVE_MUSEPACK'
5842 _nocodecmodules="musepack $_nocodecmodules"
5844 echores "$_musepack"
5847 echocheck "FAAC (AAC encoder) support"
5848 if test "$_faac" = auto ; then
5849 cat > $TMPC <<EOF
5850 #include <inttypes.h>
5851 #include <faac.h>
5852 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5854 _faac=no
5855 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5856 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
5857 done
5859 if test "$_faac" = yes ; then
5860 _def_faac="#define HAVE_FAAC 1"
5861 if echo $_libavencoders | grep -q FAAC ; then
5862 _lavc_faac=yes
5863 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
5864 _libs_mplayer="$_libs_mplayer $_ld_faac"
5865 else
5866 _lavc_faac=no
5867 _def_lavc_faac="#undef CONFIG_LIBFAAC"
5869 _codecmodules="faac $_codecmodules"
5870 else
5871 _def_faac="#undef HAVE_FAAC"
5872 _nocodecmodules="faac $_nocodecmodules"
5873 _libavencoders=`echo $_libavencoders | sed -e s/FAAC_ENCODER// `
5875 echores "$_faac (in libavcodec: $_lavc_faac)"
5878 echocheck "FAAD2 (AAC) support"
5879 if test "$_faad_internal" = auto ; then
5880 if x86_32 && test cc_vendor=gnu; then
5881 case $cc_version in
5882 3.1*|3.2) # ICE/insn with these versions
5883 _faad_internal=no
5884 _res_comment="broken gcc"
5887 _faad_internal=yes
5889 esac
5890 else
5891 _faad_internal=yes
5893 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
5894 _faad_external=no
5895 cat > $TMPC << EOF
5896 #include <faad.h>
5897 #ifndef FAAD_MIN_STREAMSIZE
5898 #error Too old version
5899 #endif
5900 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5902 cc_check -lfaad $_ld_lm && _faad_external=yes
5905 if test "$_faad_internal" = yes ; then
5906 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
5907 _faad=yes
5908 _res_comment="internal floating-point"
5909 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
5910 elif test "$_faad_external" = yes ; then
5911 _faad=yes
5912 _ld_extra="$_ld_extra -lfaad"
5913 else
5914 _def_faad_internal="#undef USE_FAAD_INTERNAL"
5915 _faad=no
5918 if test "$_faad" = yes ; then
5919 _def_faad='#define HAVE_FAAD 1'
5920 _codecmodules="faad2 $_codecmodules"
5921 else
5922 _def_faad='#undef HAVE_FAAD'
5923 _nocodecmodules="faad2 $_nocodecmodules"
5925 echores "$_faad"
5928 echocheck "LADSPA plugin support"
5929 if test "$_ladspa" = auto ; then
5930 cat > $TMPC <<EOF
5931 #include <stdio.h>
5932 #include <ladspa.h>
5933 int main(void) {
5934 const LADSPA_Descriptor *ld = NULL;
5935 return 0;
5938 _ladspa=no
5939 cc_check && _ladspa=yes
5941 if test "$_ladspa" = yes; then
5942 _def_ladspa="#define HAVE_LADSPA"
5943 _afsrc="$_afsrc af_ladspa.c"
5944 _afmodules="ladspa $_afmodules"
5945 else
5946 _def_ladspa="#undef HAVE_LADSPA"
5947 _noafmodules="ladspa $_noafmodules"
5949 echores "$_ladspa"
5952 if test -z "$_codecsdir" ; then
5953 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5954 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5955 if test -d "$dir" ; then
5956 _codecsdir="$dir"
5957 break;
5959 done
5961 # Fall back on default directory.
5962 if test -z "$_codecsdir" ; then
5963 _codecsdir="$_libdir/codecs"
5964 mingw32 && _codecsdir="codecs"
5968 echocheck "Win32 codecs"
5969 if test "$_win32dll" = auto ; then
5970 _win32dll=no
5971 if x86_32 && not qnx; then
5972 _win32dll=yes
5975 if test "$_win32dll" = yes ; then
5976 _def_win32dll='#define USE_WIN32DLL 1'
5977 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
5978 _res_comment="using $_win32codecsdir"
5979 if not win32 ; then
5980 _def_win32_loader='#define WIN32_LOADER 1'
5981 else
5982 _ld_extra="$_ld_extra -ladvapi32 -lole32"
5983 _res_comment="using native windows"
5985 _codecmodules="win32 $_codecmodules"
5986 else
5987 _def_win32dll='#undef USE_WIN32DLL'
5988 _def_win32_loader='#undef WIN32_LOADER'
5989 _nocodecmodules="win32 $_nocodecmodules"
5991 echores "$_win32dll"
5994 echocheck "XAnim codecs"
5995 if test "$_xanim" = auto ; then
5996 _xanim=no
5997 _res_comment="dynamic loader support needed"
5998 if test "$_dl" = yes ; then
5999 _xanim=yes
6002 if test "$_xanim" = yes ; then
6003 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6004 _def_xanim='#define USE_XANIM 1'
6005 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6006 _codecmodules="xanim $_codecmodules"
6007 _res_comment="using $_xanimcodecsdir"
6008 else
6009 _def_xanim='#undef USE_XANIM'
6010 _def_xanim_path='#undef XACODEC_PATH'
6011 _nocodecmodules="xanim $_nocodecmodules"
6013 echores "$_xanim"
6016 echocheck "RealPlayer codecs"
6017 if test "$_real" = auto ; then
6018 _real=no
6019 _res_comment="dynamic loader support needed"
6020 if test "$_dl" = yes || test "$_win32dll" = yes &&
6021 (linux || freebsd || netbsd || win32 || darwin) ; then
6022 _real=yes
6025 if test "$_real" = yes ; then
6026 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6027 _def_real='#define USE_REALCODECS 1'
6028 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6029 _codecmodules="real $_codecmodules"
6030 _res_comment="using $_realcodecsdir"
6031 else
6032 _def_real='#undef USE_REALCODECS'
6033 _def_real_path="#undef REALCODEC_PATH"
6034 _nocodecmodules="real $_nocodecmodules"
6036 echores "$_real"
6039 echocheck "LIVE555 Streaming Media libraries"
6040 if test "$_live" = auto && test "$_network" = yes ; then
6041 cat > $TMPCPP << EOF
6042 #include <liveMedia.hh>
6043 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6044 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6045 #endif
6046 int main(void) {}
6049 _live=no
6050 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6051 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6052 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6053 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6054 $_livelibdir/groupsock/libgroupsock.a \
6055 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6056 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6057 $_ld_extra -lstdc++" \
6058 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6059 -I$_livelibdir/UsageEnvironment/include \
6060 -I$_livelibdir/BasicUsageEnvironment/include \
6061 -I$_livelibdir/groupsock/include" && \
6062 _live=yes && break
6063 done
6064 if test "$_live" != yes ; then
6065 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6066 _live_dist=yes
6070 if test "$_live" = yes && test "$_network" = yes ; then
6071 _res_comment="using $_livelibdir"
6072 _def_live='#define STREAMING_LIVE555 1'
6073 _inputmodules="live555 $_inputmodules"
6074 elif test "$_live_dist" = yes && test "$_network" = yes ; then
6075 _res_comment="using distribution version"
6076 _live="yes"
6077 _def_live='#define STREAMING_LIVE555 1'
6078 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6079 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6080 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6081 _inputmodules="live555 $_inputmodules"
6082 else
6083 _def_live='#undef STREAMING_LIVE555'
6084 _noinputmodules="live555 $_noinputmodules"
6086 echores "$_live"
6089 echocheck "FFmpeg libavutil"
6090 if test "$_libavutil_a" = auto ; then
6091 if test -d libavutil ; then
6092 _libavutil_a=yes
6093 _res_comment="static"
6094 else
6095 die "MPlayer will not compile without libavutil in the source tree."
6097 elif test "$_libavutil_so" = auto ; then
6098 _libavutil_so=no
6099 cat > $TMPC << EOF
6100 #include <ffmpeg/common.h>
6101 int main(void) { ff_gcd(1,1); return 0; }
6103 if $_pkg_config --exists libavutil ; then
6104 _inc_libavutil=`$_pkg_config --cflags libavutil`
6105 _ld_tmp=`$_pkg_config --libs libavutil`
6106 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6107 && _libavutil_so=yes
6108 elif cc_check -lavutil $_ld_lm ; then
6109 _ld_extra="$_ld_extra -lavutil"
6110 _libavutil_so=yes
6111 _res_comment="using libavutil.so, but static libavutil is recommended"
6114 _libavutil=no
6115 _def_libavutil='#undef USE_LIBAVUTIL'
6116 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6117 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6118 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6119 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6120 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6121 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6122 # neither static nor shared libavutil is available, but it is mandatory ...
6123 if test "$_libavutil" = no ; then
6124 die "You need static or shared libavutil, MPlayer will not compile without!"
6126 echores "$_libavutil"
6128 echocheck "FFmpeg libavcodec"
6129 if test "$_libavcodec_a" = auto ; then
6130 _libavcodec_a=no
6131 if test -d libavcodec && test -f libavcodec/utils.c ; then
6132 _libavcodec_a="yes"
6133 _res_comment="static"
6135 elif test "$_libavcodec_so" = auto ; then
6136 _libavcodec_so=no
6137 _res_comment="libavcodec.so is discouraged over static libavcodec"
6138 cat > $TMPC << EOF
6139 #include <ffmpeg/avcodec.h>
6140 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6142 if $_pkg_config --exists libavcodec ; then
6143 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6144 _ld_tmp=`$_pkg_config --libs libavcodec`
6145 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6146 && _libavcodec_so=yes
6147 elif cc_check -lavcodec $_ld_lm ; then
6148 _ld_extra="$_ld_extra -lavcodec"
6149 _libavcodec_so=yes
6150 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6153 _libavcodec=no
6154 _def_libavcodec='#undef USE_LIBAVCODEC'
6155 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6156 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6157 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6158 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6159 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6160 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6161 test "$_libavcodec_mpegaudio_hp" = yes \
6162 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6163 if test "$_libavcodec_a" = yes ; then
6164 _codecmodules="libavcodec $_codecmodules"
6165 elif test "$_libavcodec_so" = yes ; then
6166 _codecmodules="libavcodec.so $_codecmodules"
6167 else
6168 _nocodecmodules="libavcodec $_nocodecmodules"
6170 echores "$_libavcodec"
6172 echocheck "FFmpeg libavformat"
6173 if test "$_libavformat_a" = auto ; then
6174 _libavformat_a=no
6175 if test -d libavformat && test -f libavformat/utils.c ; then
6176 _libavformat_a=yes
6177 _res_comment="static"
6179 elif test "$_libavformat_so" = auto ; then
6180 _libavformat_so=no
6181 cat > $TMPC <<EOF
6182 #include <ffmpeg/avformat.h>
6183 #include <ffmpeg/opt.h>
6184 int main(void) { av_alloc_format_context(); return 0; }
6186 if $_pkg_config --exists libavformat ; then
6187 _inc_libavformat=`$_pkg_config --cflags libavformat`
6188 _ld_tmp=`$_pkg_config --libs libavformat`
6189 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6190 && _libavformat_so=yes
6191 elif cc_check $_ld_lm -lavformat ; then
6192 _ld_extra="$_ld_extra -lavformat"
6193 _libavformat_so=yes
6194 _res_comment="using libavformat.so, but static libavformat is recommended"
6197 _libavformat=no
6198 _def_libavformat='#undef USE_LIBAVFORMAT'
6199 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6200 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6201 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6202 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6203 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6204 test "$_libavformat_so" = yes \
6205 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6206 echores "$_libavformat"
6208 echocheck "FFmpeg libpostproc"
6209 if test "$_libpostproc_a" = auto ; then
6210 _libpostproc_a=no
6211 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6212 _libpostproc_a='yes'
6213 _res_comment="static"
6215 elif test "$_libpostproc_so" = auto ; then
6216 _libpostproc_so=no
6217 cat > $TMPC << EOF
6218 #define USE_LIBPOSTPROC 1
6219 #include <inttypes.h>
6220 #include <postproc/postprocess.h>
6221 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6223 if cc_check -lpostproc $_ld_lm ; then
6224 _ld_extra="$_ld_extra -lpostproc"
6225 _libpostproc_so=yes
6226 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6229 _libpostproc=no
6230 _def_libpostproc='#undef USE_LIBPOSTPROC'
6231 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6232 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6233 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6234 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6235 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6236 test "$_libpostproc_so" = yes \
6237 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6238 echores "$_libpostproc"
6241 echocheck "md5sum support"
6242 if test "$_md5sum" = yes; then
6243 _def_md5sum="#define HAVE_MD5SUM"
6244 _vosrc="$_vosrc vo_md5sum.c"
6245 _vomodules="md5sum $_vomodules"
6246 else
6247 _def_md5sum="#undef HAVE_MD5SUM"
6248 _novomodules="md5sum $_novomodules"
6250 echores "$_md5sum"
6252 echocheck "libamr narrowband"
6253 if test "$_libamr_nb" = auto ; then
6254 _libamr_nb=no
6255 cat > $TMPC << EOF
6256 #include <amrnb/interf_dec.h>
6257 int main(void) { Speech_Decode_Frame_init(); return 0; }
6259 cc_check -lamrnb && _libamr_nb=yes
6260 if test "$_libavcodec_a" != yes ; then
6261 _libamr_nb=no
6262 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6265 if test "$_libamr_nb" = yes ; then
6266 _libamr=yes
6267 _ld_extra="$_ld_extra -lamrnb"
6268 _def_libamr='#define CONFIG_LIBAMR 1'
6269 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6270 _codecmodules="libamr_nb $_codecmodules"
6271 else
6272 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6273 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6274 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6275 _nocodecmodules="libamr_nb $_nocodecmodules"
6277 echores "$_libamr_nb"
6280 echocheck "libamr wideband"
6281 if test "$_libamr_wb" = auto ; then
6282 _libamr_wb=no
6283 cat > $TMPC << EOF
6284 #include <amrwb/dec_if.h>
6285 int main(void) { D_IF_init(); return 0; }
6287 cc_check -lamrwb && _libamr_wb=yes
6288 if test "$_libavcodec_a" != yes ; then
6289 _libamr_wb=no
6290 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6293 if test "$_libamr_wb" = yes ; then
6294 _libamr=yes
6295 _ld_extra="$_ld_extra -lamrwb"
6296 _def_libamr='#define CONFIG_LIBAMR 1'
6297 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6298 _codecmodules="libamr_wb $_codecmodules"
6299 else
6300 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6301 _nocodecmodules="libamr_wb $_nocodecmodules"
6302 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6303 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6305 echores "$_libamr_wb"
6307 echocheck "libdv-0.9.5+"
6308 if test "$_libdv" = auto ; then
6309 _libdv=no
6310 cat > $TMPC <<EOF
6311 #include <libdv/dv.h>
6312 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6314 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6316 if test "$_libdv" = yes ; then
6317 _def_libdv='#define HAVE_LIBDV095 1'
6318 _ld_extra="$_ld_extra -ldv"
6319 _codecmodules="libdv $_codecmodules"
6320 else
6321 _def_libdv='#undef HAVE_LIBDV095'
6322 _nocodecmodules="libdv $_nocodecmodules"
6324 echores "$_libdv"
6326 echocheck "zr"
6327 if test "$_zr" = auto ; then
6328 #36067's seem to identify themselves as 36057PQC's, so the line
6329 #below should work for 36067's and 36057's.
6330 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6331 _zr=yes
6332 else
6333 _zr=no
6336 if test "$_zr" = yes ; then
6337 if test "$_libavcodec_a" = yes ; then
6338 _def_zr='#define HAVE_ZR 1'
6339 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6340 _vomodules="zr zr2 $_vomodules"
6341 else
6342 _res_comment="libavcodec (static) is required by zr, sorry"
6343 _novomodules="zr $_novomodules"
6344 _def_zr='#undef HAVE_ZR'
6346 else
6347 _def_zr='#undef HAVE_ZR'
6348 _novomodules="zr zr2 $_novomodules"
6350 echores "$_zr"
6352 echocheck "bl"
6353 if test "$_bl" = yes ; then
6354 _def_bl='#define HAVE_BL 1'
6355 _vosrc="$_vosrc vo_bl.c"
6356 _vomodules="bl $_vomodules"
6357 else
6358 _def_bl='#undef HAVE_BL'
6359 _novomodules="bl $_novomodules"
6361 echores "$_bl"
6364 echocheck "XviD"
6365 if test "$_xvid" = auto ; then
6366 _xvid=no
6367 cat > $TMPC << EOF
6368 #include <xvid.h>
6369 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6371 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6372 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6373 done
6376 if test "$_xvid" = yes ; then
6377 _def_xvid='#define HAVE_XVID4 1'
6378 _codecmodules="xvid $_codecmodules"
6379 else
6380 _def_xvid='#undef HAVE_XVID4'
6381 _nocodecmodules="xvid $_nocodecmodules"
6382 _libavencoders=`echo $_libavencoders | sed -e s/XVID_ENCODER// `
6384 echores "$_xvid"
6386 if test "$_xvid" = yes ; then
6387 echocheck "XviD two pass plugin"
6388 cat > $TMPC << EOF
6389 #include <xvid.h>
6390 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6392 if cc_check ; then
6393 _lavc_xvid=yes
6394 _def_lavc_xvid='#define CONFIG_XVID 1'
6395 else
6396 _lavc_xvid=no
6397 _def_lavc_xvid='#undef CONFIG_XVID'
6399 echores "$_lavc_xvid"
6403 echocheck "x264"
6404 if test "$_x264" = auto ; then
6405 cat > $TMPC << EOF
6406 #include <inttypes.h>
6407 #include <x264.h>
6408 #if X264_BUILD < 53
6409 #error We do not support old versions of x264. Get the latest from SVN.
6410 #endif
6411 int main(void) { x264_encoder_open((void*)0); return 0; }
6413 _x264=no
6414 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6415 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6416 done
6419 if test "$_x264" = yes ; then
6420 _x264=yes
6421 _def_x264='#define HAVE_X264 1'
6422 _codecmodules="x264 $_codecmodules"
6423 if echo $_libavencoders | grep -q X264 ; then
6424 _lavc_x264=yes
6425 _def_lavc_x264='#define CONFIG_X264 1'
6426 _libs_mplayer="$_libs_mplayer $_ld_x264"
6427 else
6428 _lavc_x264=no
6429 _def_lavc_x264='#undef CONFIG_X264'
6431 else
6432 _x264=no
6433 _lavc_x264=no
6434 _def_x264='#undef HAVE_X264'
6435 _def_lavc_x264='#undef CONFIG_X264'
6436 _nocodecmodules="x264 $_nocodecmodules"
6437 _libavencoders=`echo $_libavencoders | sed -e s/X264_ENCODER// `
6439 echores "$_x264 (in libavcodec: $_lavc_x264)"
6442 echocheck "nut"
6443 if test "$_nut" = auto ; then
6444 cat > $TMPC << EOF
6445 #include <stdio.h>
6446 #include <stdlib.h>
6447 #include <inttypes.h>
6448 #include <libnut.h>
6449 int main(void) { (void)nut_error(0); return 0; }
6451 _nut=no
6452 cc_check -lnut && _nut=yes
6455 if test "$_nut" = yes ; then
6456 _def_nut='#define HAVE_LIBNUT 1'
6457 _ld_extra="$_ld_extra -lnut"
6458 else
6459 _def_nut='#undef HAVE_LIBNUT'
6460 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6462 echores "$_nut"
6465 # mencoder requires (optional) those libs: libmp3lame
6466 if test "$_mencoder" != no ; then
6468 echocheck "libmp3lame (for mencoder)"
6469 _mp3lame=no
6470 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6471 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6472 cat > $TMPC <<EOF
6473 #include <lame/lame.h>
6474 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; }
6476 # Note: libmp3lame usually depends on vorbis
6477 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6478 if test "$_mp3lame" = yes ; then
6479 _def_mp3lame="#define HAVE_MP3LAME"
6480 _ld_mp3lame=-lmp3lame
6481 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6482 cat > $TMPC << EOF
6483 #include <lame/lame.h>
6484 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6486 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6487 cat > $TMPC << EOF
6488 #include <lame/lame.h>
6489 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6491 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6492 if echo $_libavencoders | grep -q MP3LAME ; then
6493 _lavc_mp3lame=yes
6494 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6495 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6496 else
6497 _lavc_mp3lame=no
6498 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6500 else
6501 _def_mp3lame='#undef HAVE_MP3LAME'
6502 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6504 echores "$_mp3lame"
6508 echocheck "mencoder"
6509 _mencoder_flag='#undef HAVE_MENCODER'
6510 if test "$_mencoder" = yes ; then
6511 _mencoder_flag='#define HAVE_MENCODER'
6512 _def_muxers='#define CONFIG_MUXERS 1'
6513 else
6514 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6515 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6516 _libavmuxers=""
6518 echores "$_mencoder"
6520 echocheck "fastmemcpy"
6521 # fastmemcpy check is done earlier with tests of CPU & binutils features
6522 if test "$_fastmemcpy" = yes ; then
6523 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6524 else
6525 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6527 echores "$_fastmemcpy"
6529 echocheck "UniquE RAR File Library"
6530 if test "$_unrarlib" = yes ; then
6531 _def_unrarlib='#define USE_UNRARLIB 1'
6532 else
6533 _def_unrarlib='#undef USE_UNRARLIB'
6535 echores "$_unrarlib"
6537 echocheck "TV interface"
6538 if test "$_tv" = yes ; then
6539 _def_tv='#define USE_TV 1'
6540 _inputmodules="tv $_inputmodules"
6541 else
6542 _noinputmodules="tv $_noinputmodules"
6543 _def_tv='#undef USE_TV'
6545 echores "$_tv"
6548 if bsd; then
6549 echocheck "*BSD BT848 bt8xx header"
6550 _ioctl_bt848_h=no
6551 for file in "machine/ioctl_bt848.h" \
6552 "dev/bktr/ioctl_bt848.h" \
6553 "dev/video/bktr/ioctl_bt848.h" \
6554 "dev/ic/bt8xx.h" ; do
6555 cat > $TMPC <<EOF
6556 #include <sys/types.h>
6557 #include <$file>
6558 int main(void) {
6559 ioctl(0, TVTUNER_GETFREQ, 0);
6560 return 0;
6563 if cc_check ; then
6564 _ioctl_bt848_h=yes
6565 _ioctl_bt848_h_name="$file"
6566 break;
6568 done
6569 if test "$_ioctl_bt848_h" = yes ; then
6570 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6571 _res_comment="using $_ioctl_bt848_h_name"
6572 else
6573 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6575 echores "$_ioctl_bt848_h"
6577 echocheck "*BSD ioctl_meteor.h"
6578 _ioctl_meteor_h=no
6579 for file in "machine/ioctl_meteor.h" \
6580 "dev/bktr/ioctl_meteor.h" \
6581 "dev/video/bktr/ioctl_meteor.h" ; do
6582 cat > $TMPC <<EOF
6583 #include <sys/types.h>
6584 #include <$file>
6585 int main(void) {
6586 ioctl(0, METEORSINPUT, 0);
6587 return 0;
6590 if cc_check ; then
6591 _ioctl_meteor_h=yes
6592 _ioctl_meteor_h_name="$file"
6593 break;
6595 done
6596 if test "$_ioctl_meteor_h" = yes ; then
6597 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6598 _res_comment="using $_ioctl_meteor_h_name"
6599 else
6600 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6602 echores "$_ioctl_meteor_h"
6604 echocheck "*BSD BrookTree 848 TV interface"
6605 if test "$_tv_bsdbt848" = auto ; then
6606 _tv_bsdbt848=no
6607 if test "$_tv" = yes ; then
6608 cat > $TMPC <<EOF
6609 #include <sys/types.h>
6610 $_def_ioctl_meteor_h_name
6611 $_def_ioctl_bt848_h_name
6612 #ifdef IOCTL_METEOR_H_NAME
6613 #include IOCTL_METEOR_H_NAME
6614 #endif
6615 #ifdef IOCTL_BT848_H_NAME
6616 #include IOCTL_BT848_H_NAME
6617 #endif
6618 int main(void){
6619 ioctl(0, METEORSINPUT, 0);
6620 ioctl(0, TVTUNER_GETFREQ, 0);
6621 return 0;
6624 cc_check && _tv_bsdbt848=yes
6627 if test "$_tv_bsdbt848" = yes ; then
6628 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6629 _inputmodules="tv-bsdbt848 $_inputmodules"
6630 else
6631 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6632 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6634 echores "$_tv_bsdbt848"
6635 fi #if bsd
6638 echocheck "Video 4 Linux TV interface"
6639 if test "$_tv_v4l1" = auto ; then
6640 _tv_v4l1=no
6641 if test "$_tv" = yes && linux ; then
6642 cat > $TMPC <<EOF
6643 #include <stdlib.h>
6644 #include <linux/videodev.h>
6645 int main(void) { return 0; }
6647 cc_check && _tv_v4l1=yes
6650 if test "$_tv_v4l1" = yes ; then
6651 _audio_input=yes
6652 _tv_v4l=yes
6653 _def_tv_v4l='#define HAVE_TV_V4L 1'
6654 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6655 _inputmodules="tv-v4l $_inputmodules"
6656 else
6657 _noinputmodules="tv-v4l1 $_noinputmodules"
6658 _def_tv_v4l='#undef HAVE_TV_V4L'
6660 echores "$_tv_v4l1"
6663 echocheck "Video 4 Linux 2 TV interface"
6664 if test "$_tv_v4l2" = auto ; then
6665 _tv_v4l2=no
6666 if test "$_tv" = yes && linux ; then
6667 cat > $TMPC <<EOF
6668 #include <stdlib.h>
6669 #include <linux/types.h>
6670 #include <linux/videodev2.h>
6671 int main(void) { return 0; }
6673 cc_check && _tv_v4l2=yes
6676 if test "$_tv_v4l2" = yes ; then
6677 _audio_input=yes
6678 _tv_v4l=yes
6679 _def_tv_v4l='#define HAVE_TV_V4L 1'
6680 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6681 _inputmodules="tv-v4l2 $_inputmodules"
6682 else
6683 _noinputmodules="tv-v4l2 $_noinputmodules"
6684 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6686 echores "$_tv_v4l2"
6689 echocheck "Radio interface"
6690 if test "$_radio" = yes ; then
6691 _def_radio='#define USE_RADIO 1'
6692 _inputmodules="radio $_inputmodules"
6693 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6694 _radio_capture=no
6696 if test "$_radio_capture" = yes ; then
6697 _audio_input=yes
6698 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6699 else
6700 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6702 else
6703 _noinputmodules="radio $_noinputmodules"
6704 _def_radio='#undef USE_RADIO'
6705 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6706 _radio_capture=no
6708 echores "$_radio"
6709 echocheck "Capture for Radio interface"
6710 echores "$_radio_capture"
6712 echocheck "Video 4 Linux 2 Radio interface"
6713 if test "$_radio_v4l2" = auto ; then
6714 _radio_v4l2=no
6715 if test "$_radio" = yes && linux ; then
6716 cat > $TMPC <<EOF
6717 #include <stdlib.h>
6718 #include <linux/types.h>
6719 #include <linux/videodev2.h>
6720 int main(void) { return 0; }
6722 cc_check && _radio_v4l2=yes
6725 if test "$_radio_v4l2" = yes ; then
6726 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6727 else
6728 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6730 echores "$_radio_v4l2"
6732 echocheck "Video 4 Linux Radio interface"
6733 if test "$_radio_v4l" = auto ; then
6734 _radio_v4l=no
6735 if test "$_radio" = yes && linux ; then
6736 cat > $TMPC <<EOF
6737 #include <stdlib.h>
6738 #include <linux/videodev.h>
6739 int main(void) { return 0; }
6741 cc_check && _radio_v4l=yes
6744 if test "$_radio_v4l" = yes ; then
6745 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6746 else
6747 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6749 echores "$_radio_v4l"
6751 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6752 echocheck "*BSD BrookTree 848 Radio interface"
6753 _radio_bsdbt848=no
6754 cat > $TMPC <<EOF
6755 #include <sys/types.h>
6756 $_def_ioctl_bt848_h_name
6757 #ifdef IOCTL_BT848_H_NAME
6758 #include IOCTL_BT848_H_NAME
6759 #endif
6760 int main(void){
6761 ioctl(0, RADIO_GETFREQ, 0);
6762 return 0;
6765 cc_check && _radio_bsdbt848=yes
6766 echores "$_radio_bsdbt848"
6767 fi #if bsd && radio && radio_bsdbt848
6769 if test "$_radio_bsdbt848" = yes ; then
6770 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
6771 else
6772 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
6775 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6776 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6777 die "Radio driver requires BSD BT848, V4L or V4L2!"
6780 echocheck "Video 4 Linux 2 MPEG PVR interface"
6781 if test "$_pvr" = auto ; then
6782 _pvr=no
6783 if test "$_tv_v4l2" = yes && linux ; then
6784 cat > $TMPC <<EOF
6785 #include <stdlib.h>
6786 #include <inttypes.h>
6787 #include <linux/types.h>
6788 #include <linux/videodev2.h>
6789 int main(void) { struct v4l2_ext_controls ext; return 0; }
6791 cc_check && _pvr=yes
6794 if test "$_pvr" = yes ; then
6795 _def_pvr='#define HAVE_PVR 1'
6796 _inputmodules="pvr $_inputmodules"
6797 else
6798 _noinputmodules="pvr $_noinputmodules"
6799 _def_pvr='#undef HAVE_PVR'
6801 echores "$_pvr"
6804 echocheck "audio select()"
6805 if test "$_select" = no ; then
6806 _def_select='#undef HAVE_AUDIO_SELECT'
6807 elif test "$_select" = yes ; then
6808 _def_select='#define HAVE_AUDIO_SELECT 1'
6810 echores "$_select"
6813 echocheck "ftp"
6814 if not beos && test "$_ftp" = yes ; then
6815 _def_ftp='#define HAVE_FTP 1'
6816 _inputmodules="ftp $_inputmodules"
6817 else
6818 _noinputmodules="ftp $_noinputmodules"
6819 _def_ftp='#undef HAVE_FTP'
6821 echores "$_ftp"
6823 echocheck "vstream client"
6824 if test "$_vstream" = auto ; then
6825 _vstream=no
6826 cat > $TMPC <<EOF
6827 #include <vstream-client.h>
6828 void vstream_error(const char *format, ... ) {}
6829 int main(void) { vstream_start(); return 0; }
6831 cc_check -lvstream-client && _vstream=yes
6833 if test "$_vstream" = yes ; then
6834 _def_vstream='#define HAVE_VSTREAM 1'
6835 _inputmodules="vstream $_inputmodules"
6836 _ld_extra="$_ld_extra -lvstream-client"
6837 else
6838 _noinputmodules="vstream $_noinputmodules"
6839 _def_vstream='#undef HAVE_VSTREAM'
6841 echores "$_vstream"
6843 # endian testing
6844 echocheck "byte order"
6845 if test "$_big_endian" = auto ; then
6846 cat > $TMPC <<EOF
6847 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6848 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6849 int main(){
6850 return (int)ascii_name;
6853 if cc_check ; then
6854 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6855 _big_endian=yes
6856 else
6857 _big_endian=no
6859 else
6860 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
6863 if test "$_big_endian" = yes ; then
6864 _byte_order='big-endian'
6865 _def_words_endian='#define WORDS_BIGENDIAN 1'
6866 else
6867 _byte_order='little-endian'
6868 _def_words_endian='#undef WORDS_BIGENDIAN'
6870 echores "$_byte_order"
6872 echocheck "OSD menu"
6873 if test "$_menu" = yes ; then
6874 _def_menu='#define HAVE_MENU 1'
6875 else
6876 _def_menu='#undef HAVE_MENU'
6878 echores "$_menu"
6881 echocheck "QuickTime codecs"
6882 if test "$_qtx" = auto ; then
6883 test "$_win32dll" = yes || darwin && _qtx=yes
6885 if test "$_qtx" = yes ; then
6886 _def_qtx='#define USE_QTX_CODECS 1'
6887 _codecmodules="qtx $_codecmodules"
6888 else
6889 _def_qtx='#undef USE_QTX_CODECS'
6890 _nocodecmodules="qtx $_nocodecmodules"
6892 echores "$_qtx"
6895 echocheck "Subtitles sorting"
6896 if test "$_sortsub" = yes ; then
6897 _def_sortsub='#define USE_SORTSUB 1'
6898 else
6899 _def_sortsub='#undef USE_SORTSUB'
6901 echores "$_sortsub"
6904 echocheck "XMMS inputplugin support"
6905 if test "$_xmms" = yes ; then
6906 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6907 _xmmsplugindir=`xmms-config --input-plugin-dir`
6908 _xmmslibdir=`xmms-config --exec-prefix`/lib
6909 else
6910 _xmmsplugindir=/usr/lib/xmms/Input
6911 _xmmslibdir=/usr/lib
6914 _def_xmms='#define HAVE_XMMS 1'
6915 if darwin ; then
6916 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
6917 else
6918 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6920 else
6921 _def_xmms='#undef HAVE_XMMS'
6923 echores "$_xmms"
6925 echocheck "inet6"
6926 if test "$_inet6" = auto ; then
6927 cat > $TMPC << EOF
6928 #include <sys/types.h>
6929 #include <sys/socket.h>
6930 #include <netinet/in.h>
6931 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6933 _inet6=no
6934 if cc_check ; then
6935 _inet6=yes
6938 if test "$_inet6" = yes ; then
6939 _def_inet6='#define HAVE_AF_INET6 1'
6940 else
6941 _def_inet6='#undef HAVE_AF_INET6'
6943 echores "$_inet6"
6946 echocheck "gethostbyname2"
6947 if test "$_gethostbyname2" = auto ; then
6948 cat > $TMPC << EOF
6949 #include <sys/types.h>
6950 #include <sys/socket.h>
6951 #include <netdb.h>
6952 int main(void) { gethostbyname2("", AF_INET); }
6954 _gethostbyname2=no
6955 if cc_check ; then
6956 _gethostbyname2=yes
6960 if test "$_gethostbyname2" = yes ; then
6961 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6962 else
6963 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6965 echores "$_gethostbyname2"
6968 # --------------- GUI specific tests begin -------------------
6969 echocheck "GUI"
6970 echo "$_gui"
6971 if test "$_gui" = yes ; then
6973 # Required libraries
6974 test "$_libavcodec" != yes && die "The GUI requires libavcodec with PNG support."
6975 if not win32 ; then
6976 test "$_x11" != yes && die "X11 support required for GUI compilation."
6978 echocheck "XShape extension"
6979 if test "$_xshape" = auto ; then
6980 _xshape=no
6981 cat > $TMPC << EOF
6982 #include <X11/Xlib.h>
6983 #include <X11/Xproto.h>
6984 #include <X11/Xutil.h>
6985 #include <X11/extensions/shape.h>
6986 #include <stdlib.h>
6987 int main(void) {
6988 char *name = ":0.0";
6989 Display *wsDisplay;
6990 int exitvar = 0;
6991 int eventbase, errorbase;
6992 if (getenv("DISPLAY"))
6993 name=getenv("DISPLAY");
6994 wsDisplay=XOpenDisplay(name);
6995 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6996 exitvar=1;
6997 XCloseDisplay(wsDisplay);
6998 return exitvar;
7001 cc_check && _xshape=yes
7003 if test "$_xshape" = yes ; then
7004 _def_xshape='#define HAVE_XSHAPE 1'
7005 else
7006 die "The GUI requires the X11 extension XShape (which was not found)."
7008 echores "$_xshape"
7010 #Check for GTK
7011 if test "$_gtk1" = no ; then
7012 #Check for GTK2 :
7013 echocheck "GTK+ version"
7015 if $_pkg_config gtk+-2.0 --exists ; then
7016 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7017 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7018 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7019 echores "$_gtk"
7021 # Check for GLIB2
7022 if $_pkg_config glib-2.0 --exists ; then
7023 echocheck "glib version"
7024 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7025 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7026 echores "$_glib"
7028 _def_gui='#define HAVE_NEW_GUI 1'
7029 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7030 else
7031 _gtk1=yes
7032 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7034 else
7035 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7036 _gtk1=yes
7040 if test "$_gtk1" = yes ; then
7041 # Check for old GTK (1.2.x)
7042 echocheck "GTK version"
7043 if test -z "$_gtkconfig" ; then
7044 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7045 _gtkconfig="gtk-config"
7046 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7047 _gtkconfig="gtk12-config"
7048 else
7049 die "The GUI requires GTK devel packages (which were not found)."
7052 _gtk=`$_gtkconfig --version 2>&1`
7053 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7054 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7055 echores "$_gtk (using $_gtkconfig)"
7057 # Check for GLIB
7058 echocheck "glib version"
7059 if test -z "$_glibconfig" ; then
7060 if ( glib-config --version ) >/dev/null 2>&1 ; then
7061 _glibconfig="glib-config"
7062 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7063 _glibconfig="glib12-config"
7064 else
7065 die "The GUI requires GLIB devel packages (which were not found)"
7068 _glib=`$_glibconfig --version 2>&1`
7069 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7070 echores "$_glib (using $_glibconfig)"
7072 _def_gui='#define HAVE_NEW_GUI 1'
7073 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7076 else #if not win32
7077 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7078 _def_gui='#define HAVE_NEW_GUI 1'
7079 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7080 fi #if not win32
7082 else #if test "$_gui"
7083 _def_gui='#undef HAVE_NEW_GUI'
7084 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7085 fi #if test "$_gui"
7086 # --------------- GUI specific tests end -------------------
7089 if test "$_charset" = "noconv" ; then
7090 _charset=""
7092 if test "$_charset" ; then
7093 _def_charset="#define MSG_CHARSET \"$_charset\""
7094 else
7095 _def_charset="#undef MSG_CHARSET"
7098 if test "$_charset" = "UTF-8" ; then
7099 # hack to disable conversion in the Makefile
7100 _charset=""
7103 if test "$_charset" ; then
7104 echocheck "iconv program"
7105 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7106 if test "$?" -ne 0 ; then
7107 echores "no"
7108 echo "No working iconv program found, use "
7109 echo "--charset=UTF-8 to continue anyway."
7110 echo "If you also have problems with iconv library functions use --charset=noconv."
7111 echo "Messages in the GTK-2 interface will be broken then."
7112 exit 1
7113 else
7114 echores "yes"
7118 #############################################################################
7120 echocheck "automatic gdb attach"
7121 if test "$_crash_debug" = yes ; then
7122 _def_crash_debug='#define CRASH_DEBUG 1'
7123 else
7124 _def_crash_debug='#undef CRASH_DEBUG'
7125 _crash_debug=no
7127 echores "$_crash_debug"
7129 echocheck "compiler support for noexecstack"
7130 cat > $TMPC <<EOF
7131 int main(void) { return 0; }
7133 if cc_check -Wl,-z,noexecstack ; then
7134 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7135 echores "yes"
7136 else
7137 echores "no"
7140 echocheck "ftello()"
7141 # if we don't have ftello use the osdep/ compatibility module
7142 cat > $TMPC << EOF
7143 #include <stdio.h>
7144 #include <sys/types.h>
7145 int main (void) { ftello(stdin); return 0; }
7147 _ftello=no
7148 cc_check && _ftello=yes
7149 if test "$_ftello" = yes ; then
7150 _def_ftello='#define HAVE_FTELLO 1'
7151 _need_ftello=no
7152 else
7153 _def_ftello='#undef HAVE_FTELLO'
7154 _need_ftello=yes
7156 echores "$_ftello"
7158 # Dynamic linking flags
7159 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7160 _ld_dl_dynamic=''
7161 bsd && _ld_dl_dynamic='-rdynamic'
7162 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7163 _ld_dl_dynamic='-rdynamic'
7166 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7167 bsdos && _ld_extra="$_ld_extra -ldvd"
7168 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7169 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7171 _def_debug='#undef MP_DEBUG'
7172 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7174 _def_linux='#undef TARGET_LINUX'
7175 linux && _def_linux='#define TARGET_LINUX 1'
7178 echocheck "VIDIX"
7179 _vidix=no
7180 _def_vidix='#undef CONFIG_VIDIX'
7181 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
7182 _vidix_drv_cyberblade=no
7183 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
7184 _vidix_drv_ivtv=no
7185 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
7186 _vidix_drv_ivtv=no
7187 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
7188 _vidix_drv_mach64=no
7189 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
7190 _vidix_drv_mga=no
7191 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
7192 _vidix_drv_mga_crtc2=no
7193 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
7194 _vidix_drv_nvidia=no
7195 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
7196 _vidix_drv_pm2=no
7197 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
7198 _vidix_drv_pm3=no
7199 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
7200 _vidix_drv_radeon=no
7201 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
7202 _vidix_drv_rage128=no
7203 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
7204 _vidix_drv_savage=no
7205 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
7206 _vidix_drv_sis=no
7207 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
7208 _vidix_drv_unichrome=no
7209 if test "$_vidix_internal" = auto ; then
7210 _vidix_internal=no
7211 x86 && _vidix_internal=yes
7212 # this is broken currently, undefined references to inw, outw etc.
7213 #ppc && linux && _vidix_internal=yes
7214 alpha && linux && _vidix_internal=yes
7215 qnx || beos || darwin && _vidix_internal=no
7217 if test "$_vidix_internal" = yes; then
7218 _res_comment="internal"
7219 _vidix_external=no
7220 _vidix=yes
7221 elif test "$_vidix_external" = auto; then
7222 _vidix_external=no
7223 cat > $TMPC <<EOF
7224 #include <vidix/vidix.h>
7225 int main(void) { return 0; }
7227 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
7228 && _vidix=yes
7230 echores "$_vidix"
7232 if test "$_vidix" = yes ; then
7233 _def_vidix='#define CONFIG_VIDIX 1'
7234 _vosrc="$_vosrc vo_cvidix.c"
7235 _vomodules="cvidix $_vomodules"
7236 test $_vidix_drivers || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 savage sis unichrome"
7237 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
7239 for driver in $_vidix_drivers ; do
7240 uc_driver=`echo $driver | tr [a-z] [A-Z]`
7241 eval _vidix_drv_${driver}=yes
7242 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
7243 done
7244 else
7245 _novomodules="cvidix $_novomodules"
7248 if test "$_vidix_internal" = yes ; then
7249 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
7250 elif test "$_vidix_external" = yes ; then
7251 _libs_mplayer="$_libs_mplayer -lvidix"
7252 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
7255 if test "$_vidix" = yes && win32; then
7256 _vosrc="$_vosrc vo_winvidix.c"
7257 _vomodules="winvidix $_vomodules"
7258 _libs_mplayer="$_libs_mplayer -lgdi32"
7259 else
7260 _novomodules="winvidix $_novomodules"
7262 if test "$_vidix" = yes && test "$_x11" = yes; then
7263 _vosrc="$_vosrc vo_xvidix.c"
7264 _vomodules="xvidix $_vomodules"
7265 else
7266 _novomodules="xvidix $_novomodules"
7269 echocheck "joystick"
7270 _def_joystick='#undef HAVE_JOYSTICK'
7271 if test "$_joystick" = yes ; then
7272 if linux ; then
7273 # TODO add some check
7274 _def_joystick='#define HAVE_JOYSTICK 1'
7275 else
7276 _joystick="no (unsupported under $system_name)"
7279 echores "$_joystick"
7281 echocheck "lirc"
7282 if test "$_lirc" = auto ; then
7283 _lirc=no
7284 cat > $TMPC <<EOF
7285 #include <lirc/lirc_client.h>
7286 int main(void) { return 0; }
7288 cc_check -llirc_client && _lirc=yes
7290 if test "$_lirc" = yes ; then
7291 _def_lirc='#define HAVE_LIRC 1'
7292 _ld_extra="$_ld_extra -llirc_client"
7293 else
7294 _def_lirc='#undef HAVE_LIRC'
7296 echores "$_lirc"
7298 echocheck "lircc"
7299 if test "$_lircc" = auto ; then
7300 _lircc=no
7301 cat > $TMPC <<EOF
7302 #include <lirc/lircc.h>
7303 int main(void) { return 0; }
7305 cc_check -llircc && _lircc=yes
7307 if test "$_lircc" = yes ; then
7308 _def_lircc='#define HAVE_LIRCC 1'
7309 _ld_extra="$_ld_extra -llircc"
7310 else
7311 _def_lircc='#undef HAVE_LIRCC'
7313 echores "$_lircc"
7315 if arm; then
7316 # Detect maemo development platform libraries availability (http://www.maemo.org),
7317 # they are used when run on Nokia 770
7318 echocheck "maemo (Nokia 770)"
7319 if test "$_maemo" = auto ; then
7320 _maemo=no
7321 cat > $TMPC << EOF
7322 #include <libosso.h>
7323 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7325 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7327 if test "$_maemo" = yes ; then
7328 _def_maemo='#define HAVE_MAEMO 1'
7329 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7330 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7331 else
7332 _def_maemo='#undef HAVE_MAEMO'
7334 echores "$_maemo"
7337 echocheck "color console output"
7338 if test "$_color_console" = yes ; then
7339 _def_color_console='#define MSG_USE_COLORS 1'
7340 else
7341 _def_color_console='#undef MSG_USE_COLORS'
7343 echores "$_color_console"
7345 # linker paths should be the same for mencoder and mplayer
7346 _ld_tmp=""
7347 for I in $_libs_mplayer ; do
7348 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7349 if test -z "$_tmp" ; then
7350 _ld_extra="$I $_ld_extra"
7351 else
7352 _ld_tmp="$_ld_tmp $I"
7354 done
7355 _libs_mplayer=$_ld_tmp
7358 #############################################################################
7359 if darwin ; then
7360 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN -shared-libgcc"
7361 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7362 CFLAGS="$CFLAGS -no-cpp-precomp"
7365 if amigaos ; then
7366 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__ -DSYS_AMIGAOS4"
7368 if hpux ; then
7369 # use flag for HPUX missing setenv()
7370 CFLAGS="$CFLAGS -DHPUX"
7372 # Thread support
7373 if linux ; then
7374 CFLAGS="$CFLAGS -D_REENTRANT"
7375 elif bsd ; then
7376 # FIXME bsd needs this so maybe other OS'es
7377 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7379 if cygwin ; then
7380 CFLAGS="$CFLAGS -D__CYGWIN__ -DSYS_CYGWIN"
7382 # 64 bit file offsets?
7383 if test "$_largefiles" = yes || freebsd ; then
7384 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7385 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7386 # dvdread support requires this (for off64_t)
7387 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7391 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7392 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7394 cat > $TMPC << EOF
7395 int main() { return 0; }
7397 if cc_check -Wdeclaration-after-statement ; then
7398 CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7402 #this must be the last test to be performed or the ones following it will likely fail
7403 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7404 # to use its own copy of the library)
7405 echocheck "DVD support (libdvdnav)"
7406 if test "$_dvdnav" = auto ; then
7407 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7409 if test "$_dvdnav" = auto ; then
7410 cat > $TMPC <<EOF
7411 #include <inttypes.h>
7412 #include <dvdnav.h>
7413 int main(void) { dvdnav_t *dvd=0; return 0; }
7415 _dvdnav=no
7416 _dvdnavdir=`$_dvdnavconfig --cflags`
7417 _dvdnavlibs=`$_dvdnavconfig --libs`
7418 _dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
7419 _dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
7420 test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
7421 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7423 if test "$_dvdnav" = yes ; then
7424 _largefiles=yes
7425 _def_dvdnav='#define USE_DVDNAV 1'
7426 _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
7427 _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
7428 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7429 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7430 _inputmodules="dvdnav $_inputmodules"
7431 else
7432 _def_dvdnav='#undef USE_DVDNAV'
7433 _noinputmodules="dvdnav $_noinputmodules"
7435 echores "$_dvdnav"
7437 #############################################################################
7438 echo "Creating config.mak"
7439 cat > config.mak << EOF
7440 # -------- Generated by configure -----------
7442 LANG = C
7443 MAN_LANG = $MAN_LANG
7444 TARGET_OS = $system_name
7445 DESTDIR =
7446 prefix = \$(DESTDIR)$_prefix
7447 BINDIR = \$(DESTDIR)$_bindir
7448 DATADIR = \$(DESTDIR)$_datadir
7449 MANDIR = \$(DESTDIR)$_mandir
7450 CONFDIR = \$(DESTDIR)$_confdir
7451 LIBDIR = \$(DESTDIR)$_libdir
7452 # FFmpeg uses libdir instead of LIBDIR
7453 libdir = \$(LIBDIR)
7454 #AR = ar
7455 CC = $_cc
7456 HOST_CC = $_host_cc
7457 RANLIB = $_ranlib
7458 LDCONFIG = $_ldconfig
7459 INSTALL = $_install
7460 EXTRA_INC = $_inc_extra
7461 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7462 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7463 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7464 INSTALLSTRIP = $_install_strip
7465 CHARSET = $_charset
7466 HELP_FILE = $_mp_help
7468 EXESUF = $_exesuf
7470 MPLAYER_NETWORK = $_network
7471 FTP = $_ftp
7472 STREAMING_LIVE555 = $_live
7473 VSTREAM = $_vstream
7474 STREAM_CACHE = $_stream_cache
7475 DVBIN = $_dvbin
7476 VIDIX = $_vidix
7477 VIDIX_INTERNAL = $_vidix_internal
7478 VIDIX_EXTERNAL = $_vidix_external
7479 CONFIG_PP = yes
7480 MP3LAME = $_mp3lame
7481 LIBMENU = $_menu
7483 MP3LIB = $_mp3lib
7484 LIBA52 = $_liba52
7485 LIBMPEG2 = $_libmpeg2
7486 TREMOR_INTERNAL = $_tremor_internal
7487 TREMOR_LOW = $_tremor_low
7488 FAAD = $_faad
7490 SPEEX = $_speex
7491 MUSEPACK = $_musepack
7493 UNRARLIB = $_unrarlib
7494 PNG = $_png
7495 JPEG = $_jpeg
7496 GIF = $_gif
7498 EXTRALIBS = $_extra_libs
7499 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7500 EXTRALIBS_MPLAYER = $_libs_mplayer
7501 EXTRALIBS_MENCODER = $_libs_mencoder
7503 HAVE_MLIB = $_mlib
7504 HAVE_PTHREADS = $_pthreads
7506 HAVE_XVMC_ACCEL = $_xvmc
7508 HAVE_SYS_MMAN_H = $_mman
7509 HAVE_POSIX_SELECT = $_posix_select
7511 NEED_FSEEKO = $_need_fseeko
7512 NEED_FTELLO = $_need_ftello
7513 NEED_GETTIMEOFDAY = $_need_gettimeofday
7514 NEED_GLOB = $_need_glob
7515 NEED_SCANDIR = $_need_scandir
7516 NEED_SETENV = $_need_setenv
7517 NEED_SHMEM = $_need_shmem
7518 NEED_STRLCAT = $_need_strlcat
7519 NEED_STRLCPY = $_need_strlcpy
7520 NEED_STRSEP = $_need_strsep
7521 NEED_SWAB = $_need_swab
7522 NEED_VSSCANF = $_need_vsscanf
7524 # for FFmpeg
7525 SRC_PATH=..
7526 BUILD_ROOT=..
7527 LIBPREF=lib
7528 LIBSUF=.a
7529 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7531 # audio output
7532 OSS = $_ossaudio
7533 ALSA = $_alsa
7534 ALSA5 = $_alsa5
7535 ALSA9 = $_alsa9
7536 ALSA1X = $_alsa1x
7538 # input/demuxer/codecs
7539 JOYSTICK = $_joystick
7540 LIRC = $_lirc
7541 TV = $_tv
7542 TV_V4L = $_tv_v4l
7543 TV_V4L1 = $_tv_v4l1
7544 TV_V4L2 = $_tv_v4l2
7545 TV_BSDBT848 = $_tv_bsdbt848
7546 AUDIO_INPUT = $_audio_input
7547 PVR = $_pvr
7548 VCD = $_vcd
7549 DVDREAD = $_dvdread
7550 DVDREAD_INTERNAL = $_dvdread_internal
7551 DVDCSS_INTERNAL = $_libdvdcss_internal
7552 DVDNAV = $_dvdnav
7553 WIN32DLL = $_win32dll
7554 QTX_CODECS = $_qtx
7555 REAL_CODECS = $_real
7556 XANIM_CODECS = $_xanim
7557 LIBAVUTIL = $_libavutil
7558 LIBAVUTIL_A = $_libavutil_a
7559 LIBAVUTIL_SO = $_libavutil_so
7560 LIBAVCODEC = $_libavcodec
7561 LIBAVCODEC_A = $_libavcodec_a
7562 LIBAVCODEC_SO = $_libavcodec_so
7563 LIBAVFORMAT = $_libavformat
7564 LIBAVFORMAT_A = $_libavformat_a
7565 LIBAVFORMAT_SO = $_libavformat_so
7566 LIBPOSTPROC = $_libpostproc
7567 LIBPOSTPROC_A = $_libpostproc_a
7568 LIBPOSTPROC_SO = $_libpostproc_so
7569 ZORAN = $_zr
7570 LIBLZO = $_liblzo
7571 LIBDV = $_libdv
7572 XVID4 = $_xvid
7573 X264 = $_x264
7574 LIBNUT = $_nut
7575 MPLAYER = $_mplayer
7576 MENCODER = $_mencoder
7577 CDDA = $_cdda
7578 CDDB = $_cddb
7579 BITMAP_FONT = $_bitmap_font
7580 FREETYPE = $_freetype
7581 ASS = $_ass
7582 LIBMAD = $_mad
7583 LIBVORBIS = $_vorbis
7584 LIBTHEORA = $_theora
7585 FAAD_INTERNAL = $_faad_internal
7586 FAAD_FIXED = $_faad_fixed
7587 LIBSMBCLIENT = $_smbsupport
7588 XMMS_PLUGINS = $_xmms
7589 MACOSX = $_macosx
7590 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7591 MACOSX_BUNDLE = $_macosx_bundle
7592 MACOSX_COREVIDEO = $_macosx_corevideo
7593 TOOLAME=$_toolame
7594 TWOLAME=$_twolame
7595 FAAC=$_faac
7596 CONFIG_LIBAMR=$_libamr
7597 CONFIG_LIBAMR_NB=$_libamr_nb
7598 CONFIG_LIBAMR_WB=$_libamr_wb
7599 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7600 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7601 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7602 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7603 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7604 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7605 CONFIG_LIBFAAC=$_lavc_faac
7606 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7607 CONFIG_XVID=$_lavc_xvid
7608 CONFIG_X264=$_lavc_x264
7609 CONFIG_ZLIB=$_zlib
7610 CONFIG_GPL=yes
7611 CONFIG_ENCODERS=$_mencoder
7612 CONFIG_MUXERS=$_mencoder
7613 RADIO=$_radio
7614 RADIO_CAPTURE=$_radio_capture
7615 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7616 VIDIX_IVTV=$_vidix_drv_ivtv
7617 VIDIX_MACH64=$_vidix_drv_mach64
7618 VIDIX_MGA=$_vidix_drv_mga
7619 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7620 VIDIX_NVIDIA=$_vidix_drv_nvidia
7621 VIDIX_PM2=$_vidix_drv_pm2
7622 VIDIX_PM3=$_vidix_drv_pm3
7623 VIDIX_RADEON=$_vidix_drv_radeon
7624 VIDIX_RAGE128=$_vidix_drv_rage128
7625 VIDIX_SAVAGE=$_vidix_drv_savage
7626 VIDIX_SIS=$_vidix_drv_sis
7627 VIDIX_UNICHROME=$_vidix_drv_unichrome
7629 # --- Some stuff for autoconfigure ----
7630 $_target_arch
7631 $_target_arch_x86
7632 $_confwin32
7633 TARGET_CPU=$iproc
7634 TARGET_MMX = $_mmx
7635 TARGET_MMX2 = $_mmxext
7636 TARGET_3DNOW = $_3dnow
7637 TARGET_3DNOWEX = $_3dnowext
7638 TARGET_SSE = $_sse
7639 TARGET_CMOV = $_cmov
7640 TARGET_ALTIVEC = $_altivec
7641 TARGET_ARMV5TE = $_armv5te
7642 TARGET_ARMV6 = $_armv6
7643 TARGET_IWMMXT = $_iwmmxt
7644 TARGET_VIS = $_vis
7646 # --- GUI stuff ---
7647 GUI = $_gui
7649 # --- libvo stuff ---
7650 VO_SRCS = $_vosrc
7652 # --- libao2 stuff ---
7653 AO_SRCS = $_aosrc
7655 # --- libaf stuff ---
7656 AF_SRCS = $_afsrc
7660 #############################################################################
7662 ff_config_enable () {
7663 for part in $1; do
7664 if ` echo $2 | grep $part > /dev/null `; then
7665 echo "#define CONFIG_$part 1"
7666 echo "#define ENABLE_$part 1"
7667 else
7668 echo "#define ENABLE_$part 0"
7670 done
7673 echo "Creating config.h"
7674 cat > config.h << EOF
7675 /* -------- This file has been automatically generated by configure ---------
7676 Note: Any changes in it will be lost when you run configure again. */
7678 /* Protect against multiple inclusion */
7679 #ifndef MPLAYER_CONFIG_H
7680 #define MPLAYER_CONFIG_H 1
7682 #define CONFIGURATION "$_configuration"
7684 /* make sure we never get lavformat's poll() emulation, the results are
7685 horrible if the X libs try to actually use it, see MPlayer-users
7686 Message-ID: <45D49541.8060101@infernix.net>
7687 Date: Thu, 15 Feb 2007 18:15:45 +0100
7688 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7690 #define HAVE_SYS_POLL_H 1
7692 /* use GNU internationalization */
7693 $_def_i18n
7695 /* name of messages charset */
7696 $_def_charset
7698 /* Runtime CPU detection */
7699 $_def_runtime_cpudetection
7701 /* Dynamic a/v plugins */
7702 $_def_dynamic_plugins
7704 /* "restrict" keyword */
7705 $_def_restrict_keyword
7707 /* __builtin_expect branch prediction hint */
7708 $_def_builtin_expect
7709 #ifdef HAVE_BUILTIN_EXPECT
7710 #define likely(x) __builtin_expect ((x) != 0, 1)
7711 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7712 #else
7713 #define likely(x) (x)
7714 #define unlikely(x) (x)
7715 #endif
7717 /* attribute(used) as needed by some compilers */
7718 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7719 # define attribute_used __attribute__((used))
7720 #else
7721 # define attribute_used
7722 #endif
7724 /* compiler support for named assembler arguments */
7725 $_def_named_asm_args
7727 #define PREFIX "$_prefix"
7729 /* enable/disable SIGHANDLER */
7730 $_def_sighandler
7732 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7733 $_def_crash_debug
7735 /* Toggles debugging informations */
7736 $_def_debug
7738 /* Toggles color console output */
7739 $_def_color_console
7741 /* Indicates that libcdio is available for VCD and CD-DA playback */
7742 $_def_libcdio
7744 /* Indicates that Ogle's libdvdread is available for DVD playback */
7745 $_def_dvdread
7747 /* Indicates that dvdread is internal */
7748 $_def_dvdread_internal
7750 /* Additional options for libdvdread/libdvdcss */
7751 $_def_dvd
7752 $_def_cdrom
7753 $_def_cdio
7754 $_def_dvdio
7755 $_def_bsdi_dvd
7756 $_def_dvd_bsd
7757 $_def_dvd_linux
7758 $_dev_dvd_openbsd
7759 $_def_dvd_darwin
7760 $_def_sol_scsi_h
7761 $_def_hpux_scsi_h
7762 $_def_stddef
7764 /* Common data directory (for fonts, etc) */
7765 #define MPLAYER_DATADIR "$_datadir"
7766 #define MPLAYER_CONFDIR "$_confdir"
7767 #define MPLAYER_LIBDIR "$_libdir"
7769 /* Define this to compile stream-caching support, it can be enabled via
7770 -cache <kilobytes> */
7771 $_def_stream_cache
7773 /* Define if you are using XviD library */
7774 $_def_xvid
7776 /* Define if you are using the X.264 library */
7777 $_def_x264
7779 /* Define if you are using libnut */
7780 $_def_nut
7782 /* Define to include support for libdv-0.9.5 */
7783 $_def_libdv
7785 /* If build mencoder */
7786 $_mencoder_flag
7788 /* Indicates if libmp3lame is available
7789 Note: for mencoder */
7790 $_def_mp3lame
7791 $_def_mp3lame_preset
7792 $_def_mp3lame_preset_medium
7794 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7795 (use -bps or -nobps commandline option for run-time method selection)
7796 -bps gives better sync for vbr mp3 audio, it is now default */
7797 #define AVI_SYNC_BPS 1
7799 /* Undefine this if you do not want to select mono audio (left or right)
7800 with a stereo MPEG layer 2/3 audio stream. The command line option
7801 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7802 right-only), with 0 being the default.
7804 #define USE_FAKE_MONO 1
7806 /* Undefine this if your sound card driver has no working select().
7807 If you have kernel Oops, player hangups, or just no audio, you should
7808 try to recompile MPlayer with this option disabled! */
7809 $_def_select
7811 /* define this to use iconv(3) function to codepage conversions */
7812 $_def_iconv
7814 /* define this to use nl_langinfo function */
7815 $_def_langinfo
7817 /* define this to use RTC (/dev/rtc) for video timers */
7818 $_def_rtc
7820 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7821 #define MAX_OUTBURST 65536
7823 /* set up audio OUTBURST. Do not change this! */
7824 #define OUTBURST 512
7826 /* Define this if your system has the header file for the OSS sound interface */
7827 $_def_sys_soundcard
7829 /* Define this if your system has the header file for the OSS sound interface
7830 * in /usr/include */
7831 $_def_soundcard
7833 /* Define this if your system has the sysinfo header */
7834 $_def_sys_sysinfo
7836 /* Define this if your system has ftello() */
7838 $_def_ftello
7839 #ifndef HAVE_FTELLO
7840 /* Need these for FILE and off_t an config.h is usually before other includes*/
7841 #include <stdio.h>
7842 #include <sys/types.h>
7843 off_t ftello(FILE *);
7844 #endif
7846 /* Define this if your system has the "malloc.h" header file */
7847 $_def_malloc
7849 /* memalign is mapped to malloc if unsupported */
7850 $_def_memalign
7851 $_def_map_memalign
7852 $_def_memalign_hack
7854 /* assembler handling of .align */
7855 $_def_asmalign_pot
7857 /* Define this if your system has the "alloca.h" header file */
7858 $_def_alloca
7860 /* Define this if your system has the "sys/mman.h" header file */
7861 $_def_mman
7862 $_def_mman_has_map_failed
7864 /* Define this if you have the elf dynamic linker -ldl library */
7865 $_def_dl
7867 /* Define this if you have the kstat kernel statistics library */
7868 $_def_kstat
7870 /* Define this if you have zlib */
7871 $_def_zlib
7872 #ifdef HAVE_ZLIB
7873 #define CONFIG_ZLIB 1
7874 #endif
7876 /* Define this if you have shm support */
7877 $_def_shm
7879 /* Define this if your system has scandir & alphasort */
7880 $_def_scandir
7882 /* Define this if your system has strsep */
7883 $_def_strsep
7885 /* Define this if your system has strlcpy */
7886 $_def_strlcpy
7887 #ifndef HAVE_STRLCPY
7888 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7889 #endif
7891 /* Define this if your system has strlcat */
7892 $_def_strlcat
7893 #ifndef HAVE_STRLCAT
7894 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7895 #endif
7897 /* Define this if your system has fseeko */
7898 $_def_fseeko
7899 #ifndef HAVE_FSEEKO
7900 /* Need these for FILE and off_t an config.h is usually before other includes*/
7901 #include <stdio.h>
7902 #include <sys/types.h>
7903 int fseeko(FILE *, off_t, int);
7904 #endif
7906 $_def_localtime_r
7908 /* Define this if your system has vsscanf */
7909 $_def_vsscanf
7911 /* Define this if your system has swab */
7912 $_def_swab
7914 /* Define this if your system has posix select */
7915 $_def_posix_select
7917 /* Define this if your system has gettimeofday */
7918 $_def_gettimeofday
7920 /* Define this if your system has glob */
7921 $_def_glob
7923 /* Define this if your system has setenv */
7924 $_def_setenv
7925 #ifndef HAVE_SETENV
7926 int setenv(const char *name, const char *val, int overwrite);
7927 #endif
7929 /* Define this if your system has sysi86 */
7930 $_def_sysi86
7931 $_def_sysi86_iv
7933 /* Define this if your system has pthreads */
7934 $_def_pthreads
7936 /* Define this if you enabled thread support for libavcodec */
7937 $_def_threads
7939 /* LIRC (remote control, see www.lirc.org) support: */
7940 $_def_lirc
7942 /* Support for maemo (http://www.maemo.org) */
7943 $_def_maemo
7946 * LIRCCD (LIRC client daemon)
7947 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7949 $_def_lircc
7951 /* DVD navigation support using libdvdnav */
7952 $_def_dvdnav
7953 $_def_dvdnav_version
7955 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7956 #define MPEG12_POSTPROC 1
7958 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7959 $_def_libpostproc
7960 $_def_libpostproc_a
7961 $_def_libpostproc_so
7963 /* Win32 DLL support */
7964 $_def_win32dll
7965 #define WIN32_PATH "$_win32codecsdir"
7967 /* Mac OS X specific features */
7968 $_def_macosx
7969 $_def_macosx_finder_support
7970 $_def_macosx_bundle
7971 $_def_macosx_corevideo
7973 /* Build our Win32-loader */
7974 $_def_win32_loader
7976 /* ffmpeg's libavcodec support (requires libavcodec source) */
7977 $_def_libavcodec
7978 $_def_libavcodec_a
7979 $_def_libavcodec_so
7980 $_def_libavcodec_mpegaudio_hp
7982 /* ffmpeg's libavformat support (requires libavformat source) */
7983 $_def_libavformat
7984 $_def_libavformat_a
7985 $_def_libavformat_so
7987 $_def_libavutil
7988 $_def_libavutil_a
7989 $_def_libavutil_so
7991 /* Use libavcodec's decoders */
7992 #define CONFIG_DECODERS 1
7993 /* Use libavcodec's encoders */
7994 #define CONFIG_ENCODERS 1
7996 /* Use libavformat's demuxers */
7997 #define CONFIG_DEMUXERS 1
7998 /* Use libavformat's muxers */
7999 $_def_muxers
8001 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8002 #define HAVE_EBX_AVAILABLE 1
8003 #define HAVE_EBP_AVAILABLE 1
8005 #define CONFIG_GPL 1
8007 /* Use AMR codecs from libavcodec. */
8008 $_def_libamr
8009 $_def_libamr_nb
8010 $_def_libamr_wb
8012 /* Use specific parts from FFmpeg. */
8013 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8014 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8015 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8016 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8017 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8018 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8019 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8021 $_def_lavc_faac
8022 $_def_lavc_xvid
8023 $_def_lavc_mp3lame
8024 $_def_lavc_x264
8026 /* Use codec libs included in mplayer CVS / source dist: */
8027 $_def_mp3lib
8028 $_def_liba52
8029 $_def_libmpeg2
8031 /* XAnim DLL support */
8032 $_def_xanim
8033 /* Default search path */
8034 $_def_xanim_path
8036 /* RealPlayer DLL support */
8037 $_def_real
8038 /* Default search path */
8039 $_def_real_path
8041 /* LIVE555 Streaming Media library support */
8042 $_def_live
8044 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8045 $_def_fastmemcpy
8047 /* Use unrarlib for Vobsubs */
8048 $_def_unrarlib
8050 /* gui support, please do not edit this option */
8051 $_def_gui
8052 $_def_gtk2_gui
8054 /* Audio output drivers */
8055 $_def_ossaudio
8056 $_def_ossaudio_devdsp
8057 $_def_ossaudio_devmixer
8058 $_def_alsa5
8059 $_def_alsa9
8060 $_def_alsa1x
8061 $_def_arts
8062 $_def_esd
8063 $_def_esd_latency
8064 $_def_polyp
8065 $_def_jack
8066 $_def_openal
8067 $_def_openal_h
8068 $_def_sys_asoundlib_h
8069 $_def_alsa_asoundlib_h
8070 $_def_sunaudio
8071 $_def_sgiaudio
8072 $_def_win32waveout
8073 $_def_nas
8075 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8076 #undef FAST_OSD
8077 #undef FAST_OSD_TABLE
8079 /* Enable TV Interface support */
8080 $_def_tv
8082 /* Enable Video 4 Linux TV interface support */
8083 $_def_tv_v4l
8085 /* Enable Video 4 Linux 1 TV interface support */
8086 $_def_tv_v4l1
8088 /* Enable Video 4 Linux 2 TV interface support */
8089 $_def_tv_v4l2
8091 /* *BSD BrookTree headers */
8092 $_def_ioctl_meteor_h_name
8093 $_def_ioctl_bt848_h_name
8095 /* Enable *BSD BrookTree TV interface support */
8096 $_def_tv_bsdbt848
8098 /* Enable Radio Interface support */
8099 $_def_radio
8101 /* Enable Capture for Radio Interface support */
8102 $_def_radio_capture
8104 /* Enable Video 4 Linux Radio interface support */
8105 $_def_radio_v4l
8107 /* Enable Video 4 Linux 2 Radio interface support */
8108 $_def_radio_v4l2
8110 /* Enable *BSD BrookTree Radio interface support */
8111 $_def_radio_bsdbt848
8113 /* Enable Video 4 Linux 2 MPEG PVR support */
8114 $_def_pvr
8116 /* Define if your processor stores words with the most significant
8117 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8118 $_def_words_endian
8120 $_def_arch
8121 $_def_arch_x86
8123 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8124 have the instruction. */
8125 $_def_dcbzl
8127 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
8128 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
8130 #ifdef ARCH_POWERPC
8131 #define ARCH_PPC 1
8132 #endif
8134 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
8135 #ifdef ARCH_ARMV4L
8136 #define ARCH_ARM 1
8137 #endif
8139 /* only gcc3 can compile mvi instructions */
8140 $_def_gcc_mvi_support
8142 /* Define this for Cygwin build for win32 */
8143 $_def_confwin32
8145 /* Define this to any prefered value from 386 up to infinity with step 100 */
8146 #define __CPU__ $iproc
8148 $_mp_wordsize
8150 $_def_linux
8152 $_def_vcd
8154 #ifdef sun
8155 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8156 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8157 #elif defined(HPUX)
8158 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8159 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8160 #elif defined(WIN32)
8161 #define DEFAULT_CDROM_DEVICE "D:"
8162 #define DEFAULT_DVD_DEVICE "D:"
8163 #elif defined(SYS_DARWIN)
8164 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8165 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8166 #elif defined(__OpenBSD__)
8167 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8168 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8169 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8170 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8171 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8172 #elif defined(SYS_AMIGAOS4)
8173 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8174 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8175 #else
8176 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8177 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8178 #endif
8181 /*----------------------------------------------------------------------------
8183 ** NOTE: Instead of modifying these definitions here, use the
8184 ** --enable/--disable options of the ./configure script!
8185 ** See ./configure --help for details.
8187 *---------------------------------------------------------------------------*/
8189 /* C99 lrintf function available */
8190 $_def_lrintf
8192 /* round function is available */
8193 $_def_round
8195 /* yes, we have inttypes.h */
8196 #define HAVE_INTTYPES_H 1
8198 /* int_fastXY_t emulation */
8199 $_def_fast_inttypes
8201 /* nanosleep support */
8202 $_def_nanosleep
8204 /* SMB support */
8205 $_def_smbsupport
8207 /* termcap flag for getch2.c */
8208 $_def_termcap
8210 /* termios flag for getch2.c */
8211 $_def_termios
8212 $_def_termios_h
8213 $_def_termios_sys_h
8215 /* enable PNG support */
8216 $_def_png
8218 /* enable JPEG support */
8219 $_def_jpeg
8221 /* enable PNM support */
8222 $_def_pnm
8224 /* enable md5sum support */
8225 $_def_md5sum
8227 /* enable GIF support */
8228 $_def_gif
8229 $_def_gif_4
8230 $_def_gif_tvt_hack
8232 /* enable bitmap font support */
8233 $_def_bitmap_font
8235 /* enable FreeType support */
8236 $_def_freetype
8238 /* enable Fontconfig support */
8239 $_def_fontconfig
8241 /* enable SSA/ASS support */
8242 $_def_ass
8244 /* enable FriBiDi usage */
8245 $_def_fribidi
8247 /* enable ENCA usage */
8248 $_def_enca
8250 /* liblzo support */
8251 $_def_liblzo
8252 #ifdef USE_LIBLZO
8253 #define CONFIG_LZO 1
8254 #endif
8256 /* libmad support */
8257 $_def_mad
8259 /* enable OggVorbis support */
8260 $_def_vorbis
8261 $_def_tremor
8263 /* enable Speex support */
8264 $_def_speex
8266 /* enable musepack support */
8267 $_def_musepack
8269 /* enable OggTheora support */
8270 $_def_theora
8272 /* enable FAAD (AAC) support */
8273 $_def_faad
8274 $_def_faad_internal
8276 /* enable FAAC (AAC encoder) support */
8277 $_def_faac
8279 /* enable LADSPA plugin support */
8280 $_def_ladspa
8282 /* enable network */
8283 $_def_network
8285 /* enable ftp support */
8286 $_def_ftp
8288 /* enable vstream support */
8289 $_def_vstream
8291 /* enable winsock2 instead of Unix functions*/
8292 $_def_winsock2
8294 /* define this to use inet_aton() instead of inet_pton() */
8295 $_def_use_aton
8297 /* enables / disables cdparanoia support */
8298 $_def_cdparanoia
8299 $_def_cddb
8301 /* enables / disables VIDIX usage */
8302 $_def_vidix
8303 $_def_vidix_drv_cyberblade
8304 $_def_vidix_drv_ivtv
8305 $_def_vidix_drv_mach64
8306 $_def_vidix_drv_mga
8307 $_def_vidix_drv_mga_crtc2
8308 $_def_vidix_drv_nvidia
8309 $_def_vidix_drv_pm3
8310 $_def_vidix_drv_radeon
8311 $_def_vidix_drv_rage128
8312 $_def_vidix_drv_savage
8313 $_def_vidix_drv_sis
8314 $_def_vidix_drv_unichrome
8315 $_def_vidix_pfx
8317 /* enables / disables new input joystick support */
8318 $_def_joystick
8320 /* enables / disables QTX codecs */
8321 $_def_qtx
8323 /* enables / disables osd menu */
8324 $_def_menu
8326 /* enables / disables subtitles sorting */
8327 $_def_sortsub
8329 /* XMMS input plugin support */
8330 $_def_xmms
8331 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8333 /* enables inet6 support */
8334 $_def_inet6
8336 /* do we have gethostbyname2? */
8337 $_def_gethostbyname2
8339 /* Extension defines */
8340 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
8341 $_def_3dnowext // only define if you have 3DNOWEXT (AMD Athlon, etc.)
8342 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
8343 $_def_mmxext // only define if you have MMX2 (Athlon/PIII/4/CelII)
8344 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
8345 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
8346 $_def_ssse3 // only define if you have SSSE3 (Intel Core 2)
8347 $_def_cmov // only define if you have CMOV (i686+, without VIA C3)
8348 $_def_fast_cmov // only define if CMOV is fast
8349 $_def_altivec // only define if you have Altivec (G4)
8350 $_def_armv5te // only define if you have Enhanced DSP Extensions (ARM)
8351 $_def_armv6 // only define if you have ARMv6
8352 $_def_iwmmxt // only define if you have XScale IWMMX (ARM)
8354 $_def_altivec_h // enables usage of altivec.h
8356 $_def_mlib // Sun mediaLib, available only on solaris
8357 $_def_vis // only define if you have VIS ( ultrasparc )
8359 /* libmpeg2 uses a different feature test macro for mediaLib */
8360 #ifdef HAVE_MLIB
8361 #define LIBMPEG2_MLIB 1
8362 #endif
8364 /* libvo options */
8365 #define SCREEN_SIZE_X 1
8366 #define SCREEN_SIZE_Y 1
8367 $_def_x11
8368 $_def_xv
8369 $_def_xvmc
8370 $_def_vm
8371 $_def_xf86keysym
8372 $_def_xinerama
8373 $_def_gl
8374 $_def_gl_win32
8375 $_def_dga
8376 $_def_dga2
8377 $_def_sdl
8378 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8379 $_def_sdlbuggy
8380 $_def_directx
8381 $_def_ggi
8382 $_def_ggiwmh
8383 $_def_3dfx
8384 $_def_s3fb
8385 $_def_tdfxfb
8386 $_def_tdfxvid
8387 $_def_directfb
8388 $_def_directfb_version
8389 $_def_dfbmga
8390 $_def_zr
8391 $_def_bl
8392 $_def_mga
8393 $_def_xmga
8394 $_def_syncfb
8395 $_def_fbdev
8396 $_def_dxr2
8397 $_def_dxr3
8398 $_def_ivtv
8399 $_def_dvb
8400 $_def_dvb_in
8401 $_def_svga
8402 $_def_vesa
8403 $_def_xdpms
8404 $_def_aa
8405 $_def_caca
8406 $_def_tga
8407 $_def_toolame
8408 $_def_twolame
8410 /* used by GUI: */
8411 $_def_xshape
8413 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8414 #define X11_FULLSCREEN 1
8415 #endif
8417 #endif /* MPLAYER_CONFIG_H */
8420 #############################################################################
8422 cat << EOF
8424 Config files successfully generated by ./configure $_configuration !
8426 Install prefix: $_prefix
8427 Data directory: $_datadir
8428 Config direct.: $_confdir
8430 Byte order: $_byte_order
8431 Optimizing for: $_optimizing
8433 Languages:
8434 Messages/GUI: $_language
8437 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8438 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8439 echo
8441 cat << EOF
8443 Enabled optional drivers:
8444 Input: $_inputmodules
8445 Codecs: $_codecmodules
8446 Audio output: $_aomodules
8447 Video output: $_vomodules
8448 Audio filters: $_afmodules
8449 Disabled optional drivers:
8450 Input: $_noinputmodules
8451 Codecs: $_nocodecmodules
8452 Audio output: $_noaomodules
8453 Video output: $_novomodules
8454 Audio filters: $_noafmodules
8456 'config.h' and 'config.mak' contain your configuration options.
8457 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8458 compile *** DO NOT REPORT BUGS if you tweak these files ***
8460 'make' will now compile MPlayer and 'make install' will install it.
8461 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8466 if test "$_mtrr" = yes ; then
8467 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8468 echo
8471 if not x86_32; then
8472 cat <<EOF
8473 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8474 operating system ($system_name). You may encounter a few files that cannot
8475 be played due to missing open source video/audio codec support.
8481 cat <<EOF
8482 Check $TMPLOG if you wonder why an autodetection failed (make sure
8483 development headers/packages are installed).
8485 NOTE: The --enable-* parameters unconditionally force options on, completely
8486 skipping autodetection. This behavior is unlike what you may be used to from
8487 autoconf-based configure scripts that can decide to override you. This greater
8488 level of control comes at a price. You may have to provide the correct compiler
8489 and linker flags yourself.
8490 If you used one of these options (except --enable-gui and similar ones that
8491 turn on internal features) and experience a compilation or linking failure,
8492 make sure you have passed the necessary compiler/linker flags to configure.
8494 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8498 if test "$_warn_CFLAGS" = yes; then
8499 cat <<EOF
8501 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8503 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8505 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8506 To do so, execute 'CFLAGS= ./configure <options>'
8511 # Last move:
8512 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"