Simplify the condition code.
[mplayer/greg.git] / configure
blob991fb6be7529ff642696e3615daef4f85a0f4812
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 $TMPEXE $@" >> "$TMPLOG"
66 rm -f "$TMPEXE"
67 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
68 TMP="$?"
69 echo >> "$TMPLOG"
70 echo >> "$TMPLOG"
71 return "$TMP"
74 cc_check() {
75 compile_check $TMPC $@
78 cxx_check() {
79 compile_check $TMPCPP $@ -lstdc++
82 tmp_run() {
83 "$TMPEXE" >> "$TMPLOG" 2>&1
86 # Display error message, flushes tempfile, exit
87 die () {
88 echo
89 echo "Error: $@" >&2
90 echo >&2
91 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
92 echo "Check \"$TMPLOG\" if you do not understand why it failed."
93 exit 1
96 # OS test booleans functions
97 issystem() {
98 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
100 linux() { issystem "Linux" || issystem "uClinux" ; return "$?" ; }
101 sunos() { issystem "SunOS" ; return "$?" ; }
102 hpux() { issystem "HP-UX" ; return "$?" ; }
103 irix() { issystem "IRIX" ; return "$?" ; }
104 aix() { issystem "AIX" ; return "$?" ; }
105 cygwin() { issystem "CYGWIN" ; return "$?" ; }
106 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; }
107 netbsd() { issystem "NetBSD" ; return "$?" ; }
108 bsdos() { issystem "BSD/OS" ; return "$?" ; }
109 openbsd() { issystem "OpenBSD" ; return "$?" ; }
110 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
111 qnx() { issystem "QNX" ; return "$?" ; }
112 darwin() { issystem "Darwin" ; return "$?" ; }
113 gnu() { issystem "GNU" ; return "$?" ; }
114 mingw32() { issystem "MINGW32" ; return "$?" ; }
115 morphos() { issystem "MorphOS" ; return "$?" ; }
116 amigaos() { issystem "AmigaOS" ; return "$?" ; }
117 win32() { cygwin || mingw32 ; return "$?" ; }
118 beos() { issystem "BEOS" ; return "$?" ; }
120 # arch test boolean functions
121 # x86/x86pc is used by QNX
122 x86_32() {
123 case "$host_arch" in
124 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
125 *) return 1 ;;
126 esac
129 x86_64() {
130 case "$host_arch" in
131 x86_64|amd64) return 0 ;;
132 *) return 1 ;;
133 esac
136 x86() {
137 x86_32 || x86_64
140 ppc() {
141 case "$host_arch" in
142 ppc|powerpc) return 0;;
143 *) return 1;;
144 esac
147 alpha() {
148 case "$host_arch" in
149 alpha) return 0;;
150 *) return 1;;
151 esac
154 arm() {
155 case "$host_arch" in
156 arm) return 0;;
157 *) return 1;;
158 esac
161 sh3() {
162 case "$host_arch" in
163 sh3) return 0;;
164 *) return 1;;
165 esac
168 # Use this before starting a check
169 echocheck() {
170 echo "============ Checking for $@ ============" >> "$TMPLOG"
171 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
174 # Use this to echo the results of a check
175 echores() {
176 if test "$_res_comment" ; then
177 _res_comment="($_res_comment)"
179 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
180 echo "##########################################" >> "$TMPLOG"
181 echo "" >> "$TMPLOG"
182 echo "$@ $_res_comment"
183 _res_comment=""
185 #############################################################################
187 # Check how echo works in this /bin/sh
188 case `echo -n` in
189 -n) _echo_n= _echo_c='\c' ;; # SysV echo
190 *) _echo_n='-n ' _echo_c= ;; # BSD echo
191 esac
193 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"`
195 show_help(){
196 cat << EOF
197 Usage: $0 [OPTIONS]...
199 Configuration:
200 -h, --help display this help and exit
202 Installation directories:
203 --prefix=DIR prefix directory for installation [/usr/local]
204 --bindir=DIR directory for installing binaries [PREFIX/bin]
205 --datadir=DIR directory for installing machine independent
206 data files (skins, etc) [PREFIX/share/mplayer]
207 --mandir=DIR directory for installing man pages [PREFIX/share/man]
208 --confdir=DIR directory for installing configuration files
209 [PREFIX/etc/mplayer]
210 --libdir=DIR directory for object code libraries [PREFIX/lib]
211 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
212 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
213 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
214 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
216 Optional features:
217 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
218 --disable-mplayer disable MPlayer compilation [enable]
219 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
220 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
221 --disable-largefiles disable support for files > 2GB [enable]
222 --enable-linux-devfs set default devices to devfs [disable]
223 --enable-termcap use termcap database for key codes [autodetect]
224 --enable-termios use termios database for key codes [autodetect]
225 --disable-iconv disable iconv for encoding conversion [autodetect]
226 --disable-langinfo do not use langinfo [autodetect]
227 --enable-lirc enable LIRC (remote control) support [autodetect]
228 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
229 --enable-joystick enable joystick support [disable]
230 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
231 --disable-vm disable X video mode extensions [autodetect]
232 --disable-xf86keysym disable support for multimedia keys [autodetect]
233 --enable-radio enable radio interface [disable]
234 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
235 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
236 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
237 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
238 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
239 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
240 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
241 --disable-tv-teletext disable TV teletext interface [autodetect]
242 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
243 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
244 --disable-network disable networking [enable]
245 --enable-winsock2 enable winsock2 [autodetect]
246 --enable-smb enable Samba (SMB) input [autodetect]
247 --enable-live enable LIVE555 Streaming Media [autodetect]
248 --enable-nemesi enable Nemesi 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-unrarexec disable using of UnRAR executable [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-w32threads disable Win32 threads support [autodetect]
274 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
275 --enable-rpath enable runtime linker path for extra libs [disabled]
277 Codecs:
278 --enable-gif enable GIF support [autodetect]
279 --enable-png enable PNG input/output support [autodetect]
280 --enable-jpeg enable JPEG input/output support [autodetect]
281 --enable-libcdio enable external libcdio [autodetect]
282 --enable-liblzo enable external liblzo [autodetect]
283 --disable-win32dll disable Win32 DLL support [enabled]
284 --disable-qtx disable QuickTime codecs support [enabled]
285 --disable-xanim disable XAnim codecs support [enabled]
286 --disable-real disable RealPlayer codecs support [enabled]
287 --disable-xvid disable XviD [autodetect]
288 --disable-x264 disable x264 [autodetect]
289 --disable-libnut disable libnut [autodetect]
290 --disable-libavutil_a disable static libavutil [autodetect]
291 --disable-libavcodec_a disable static libavcodec [autodetect]
292 --disable-libavformat_a disable static libavformat [autodetect]
293 --disable-libpostproc_a disable static libpostproc [autodetect]
294 --disable-libavutil_so disable shared libavutil [autodetect]
295 --disable-libavcodec_so disable shared libavcodec [autodetect]
296 --disable-libavformat_so disable shared libavformat [autodetect]
297 --disable-libpostproc_so disable shared libpostproc [autodetect]
298 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
299 in libavcodec [enabled]
300 --disable-tremor-internal disable internal Tremor [enabled]
301 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
302 --enable-tremor-external enable external Tremor [autodetect]
303 --disable-libvorbis disable libvorbis support [autodetect]
304 --disable-speex disable Speex support [autodetect]
305 --enable-theora enable OggTheora libraries [autodetect]
306 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
307 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
308 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
309 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
310 --disable-ladspa disable LADSPA plugin support [autodetect]
311 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
312 --disable-mad disable libmad (MPEG audio) support [autodetect]
313 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
314 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
315 --enable-xmms enable XMMS input plugin support [disabled]
316 --enable-libdca enable libdca support [autodetect]
317 --disable-mp3lib disable builtin mp3lib [enabled]
318 --disable-liba52 disable builtin liba52 [enabled]
319 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
320 --disable-musepack disable musepack support [autodetect]
321 --disable-libamr_nb disable libamr narrowband [autodetect]
322 --disable-libamr_wb disable libamr wideband [autodetect]
323 --disable-decoder=DECODER disable specified FFmpeg decoder
324 --enable-decoder=DECODER enable specified FFmpeg decoder
325 --disable-encoder=ENCODER disable specified FFmpeg encoder
326 --enable-encoder=ENCODER enable specified FFmpeg encoder
327 --disable-parser=PARSER disable specified FFmpeg parser
328 --enable-parser=PARSER enable specified FFmpeg parser
329 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
330 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
331 --disable-muxer=MUXER disable specified FFmpeg muxer
332 --enable-muxer=MUXER enable specified FFmpeg muxer
334 Video output:
335 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
336 --disable-vidix-external disable external VIDIX [for x86 *nix]
337 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
338 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
339 nvidia,pm2,pm3,radeon,rage128,savage,sis,unichrome
340 --disable-vidix-pcidb disable VIDIX PCI device name database
341 --enable-gl enable OpenGL video output [autodetect]
342 --enable-dga2 enable DGA 2 support [autodetect]
343 --enable-dga1 enable DGA 1 support [autodetect]
344 --enable-vesa enable VESA video output [autodetect]
345 --enable-svga enable SVGAlib video output [autodetect]
346 --enable-sdl enable SDL video output [autodetect]
347 --enable-aa enable AAlib video output [autodetect]
348 --enable-caca enable CACA video output [autodetect]
349 --enable-ggi enable GGI video output [autodetect]
350 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
351 --enable-directx enable DirectX video output [autodetect]
352 --enable-dxr2 enable DXR2 video output [autodetect]
353 --enable-dxr3 enable DXR3/H+ video output [autodetect]
354 --enable-ivtv enable IVTV TV-Out video output [autodetect]
355 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
356 --enable-dvb enable DVB video output [autodetect]
357 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
358 --enable-mga enable mga_vid video output [autodetect]
359 --enable-xmga enable mga_vid X11 video output [autodetect]
360 --enable-xv enable Xv video output [autodetect]
361 --enable-xvmc enable XvMC acceleration [disable]
362 --enable-vm enable XF86VidMode support [autodetect]
363 --enable-xinerama enable Xinerama support [autodetect]
364 --enable-x11 enable X11 video output [autodetect]
365 --enable-xshape enable XShape support [autodetect]
366 --disable-xss disable screensaver support via xss [autodetect]
367 --enable-fbdev enable FBDev video output [autodetect]
368 --enable-mlib enable mediaLib video output (Solaris) [disable]
369 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
370 --enable-tdfxfb enable tdfxfb video output [disable]
371 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
372 --enable-directfb enable DirectFB video output [autodetect]
373 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
374 --enable-bl enable Blinkenlights video output [disable]
375 --enable-tdfxvid enable tdfx_vid video output [disable]
376 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
377 --disable-tga disable Targa video output [enable]
378 --disable-pnm disable PNM video output [enable]
379 --disable-md5sum disable md5sum video output [enable]
381 Audio output:
382 --disable-alsa disable ALSA audio output [autodetect]
383 --disable-ossaudio disable OSS audio output [autodetect]
384 --disable-arts disable aRts audio output [autodetect]
385 --disable-esd disable esd audio output [autodetect]
386 --disable-pulse disable Pulseaudio audio output [autodetect]
387 --disable-jack disable JACK audio output [autodetect]
388 --disable-openal disable OpenAL audio output [autodetect]
389 --disable-nas disable NAS audio output [autodetect]
390 --disable-sgiaudio disable SGI audio output [autodetect]
391 --disable-sunaudio disable Sun audio output [autodetect]
392 --disable-win32waveout disable Windows waveout audio output [autodetect]
393 --disable-select disable using select() on the audio device [enable]
395 Miscellaneous options:
396 --enable-runtime-cpudetection enable runtime CPU detection [disable]
397 --enable-cross-compile enable cross-compilation [autodetect]
398 --cc=COMPILER C compiler to build MPlayer [gcc]
399 --host-cc=COMPILER C compiler for tools needed while building [gcc]
400 --as=ASSEMBLER assembler to build MPlayer [as]
401 --ar=AR librarian to build MPlayer [ar]
402 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
403 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
404 --enable-static build a statically linked binary
405 --charset=charset convert the console messages to this character set
406 --language=list a white space or comma separated list of languages for
407 translated man pages, the first language is used for
408 messages and the GUI (the environment variable
409 \$LINGUAS is also honored) [en]
410 (Available: $LANGUAGES all)
411 --with-install=PATH path to a custom install program
412 --enable-color-console enable color console output (UNSUPPORTED) [disable]
414 Advanced options:
415 --enable-mmx enable MMX [autodetect]
416 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
417 --enable-3dnow enable 3DNow! [autodetect]
418 --enable-3dnowext enable extended 3DNow! [autodetect]
419 --enable-sse enable SSE [autodetect]
420 --enable-sse2 enable SSE2 [autodetect]
421 --enable-ssse3 enable SSSE3 [autodetect]
422 --enable-shm enable shm [autodetect]
423 --enable-altivec enable AltiVec (PowerPC) [autodetect]
424 --enable-armv5te enable DSP extensions (ARM) [autodetect]
425 --enable-armv6 enable ARMv6 (ARM) [autodetect]
426 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
427 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
428 --enable-big-endian force byte order to big-endian [autodetect]
429 --enable-debug[=1-3] compile-in debugging information [disable]
430 --enable-profile compile-in profiling information [disable]
431 --disable-sighandler disable sighandler for crashes [enable]
432 --enable-crash-debug enable automatic gdb attach on crash [disable]
433 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
435 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
436 --disable-gcc-check disable gcc version checking [enable]
438 Use these options if autodetection fails (Options marked with (*) accept
439 multiple paths separated by ':'):
440 --extra-libs=FLAGS extra linker flags
441 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
442 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
443 --with-extraincdir=DIR extra header search paths in DIR (*)
444 --with-extralibdir=DIR extra linker search paths in DIR (*)
445 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
447 --with-freetype-config=PATH path to freetype-config
448 --with-fribidi-config=PATH path to fribidi-config
449 --with-glib-config=PATH path to glib*-config
450 --with-gtk-config=PATH path to gtk*-config
451 --with-sdl-config=PATH path to sdl*-config
452 --with-dvdnav-config=PATH path to dvdnav-config
454 This configure script is NOT autoconf-based, even though its output is similar.
455 It will try to autodetect all configuration options. If you --enable an option
456 it will be forcefully turned on, skipping autodetection. This can break
457 compilation, so you need to know what you are doing.
459 exit 0
460 } #show_help()
462 # GOTCHA: the variables below defines the default behavior for autodetection
463 # and have - unless stated otherwise - at least 2 states : yes no
464 # If autodetection is available then the third state is: auto
465 _mmx=auto
466 _3dnow=auto
467 _3dnowext=auto
468 _mmxext=auto
469 _sse=auto
470 _sse2=auto
471 _ssse3=auto
472 _cmov=auto
473 _fast_cmov=auto
474 _armv5te=auto
475 _armv6=auto
476 _iwmmxt=auto
477 _mtrr=auto
478 _altivec=auto
479 _install=install
480 _ranlib=ranlib
481 _ldconfig=ldconfig
482 _cc=cc
483 _ar=ar
484 test "$CC" && _cc="$CC"
485 _gcc_check=yes
486 _as=auto
487 _runtime_cpudetection=no
488 _cross_compile=auto
489 _prefix="/usr/local"
490 _libavutil_a=auto
491 _libavutil_so=auto
492 _libavcodec_a=auto
493 _libamr_nb=auto
494 _libamr_wb=auto
495 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
496 _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// `
497 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
498 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// -e s/LIBVORBIS_ENCODER// `
499 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
500 _libavparsers=$_libavparsers_all
501 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
502 _libavbsfs=$_libavbsfs_all
503 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
504 _libavdemuxers=`echo $_libavdemuxers_all | sed -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/LIBNUT_DEMUXER// -e s/AVISYNTH_DEMUXER// `
505 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
506 _libavmuxers=`echo $_libavmuxers_all | sed -e s/RTP_MUXER// `
507 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
508 _libavcodec_so=auto
509 _libavformat_a=auto
510 _libavformat_so=auto
511 _libpostproc_a=auto
512 _libpostproc_so=auto
513 _libavcodec_mpegaudio_hp=yes
514 _mencoder=yes
515 _mplayer=yes
516 _x11=auto
517 _xshape=auto
518 _xss=auto
519 _dga1=auto
520 _dga2=auto
521 _xv=auto
522 _xvmc=no #auto when complete
523 _sdl=auto
524 _directx=auto
525 _win32waveout=auto
526 _nas=auto
527 _png=auto
528 _jpeg=auto
529 _pnm=yes
530 _md5sum=yes
531 _gif=auto
532 _gl=auto
533 _ggi=auto
534 _ggiwmh=auto
535 _aa=auto
536 _caca=auto
537 _svga=auto
538 _vesa=auto
539 _fbdev=auto
540 _dvb=auto
541 _dvbhead=auto
542 _dxr2=auto
543 _dxr3=auto
544 _ivtv=auto
545 _v4l2=auto
546 _iconv=auto
547 _langinfo=auto
548 _rtc=auto
549 _ossaudio=auto
550 _arts=auto
551 _esd=auto
552 _pulse=auto
553 _jack=auto
554 _openal=auto
555 _libcdio=auto
556 _liblzo=auto
557 _mad=auto
558 _toolame=auto
559 _twolame=auto
560 _tremor_internal=yes
561 _tremor_low=no
562 _tremor_external=auto
563 _libvorbis=auto
564 _speex=auto
565 _theora=auto
566 _mp3lib=yes
567 _liba52=yes
568 _libdca=auto
569 _libmpeg2=yes
570 _faad_internal=auto
571 _faad_external=auto
572 _faad_fixed=no
573 _faac=auto
574 _ladspa=auto
575 _xmms=no
576 _dvdnav=auto
577 _dvdnavconfig=dvdnav-config
578 _dvdread=auto
579 _dvdread_internal=auto
580 _libdvdcss_internal=auto
581 _xanim=auto
582 _real=auto
583 _live=auto
584 _nemesi=auto
585 _native_rtsp=yes
586 _xinerama=auto
587 _mga=auto
588 _xmga=auto
589 _vm=auto
590 _xf86keysym=auto
591 _mlib=no #broken, thus disabled
592 _sgiaudio=auto
593 _sunaudio=auto
594 _alsa=auto
595 _fastmemcpy=yes
596 _unrar_exec=auto
597 _win32dll=auto
598 _select=yes
599 _radio=no
600 _radio_capture=no
601 _radio_v4l=auto
602 _radio_v4l2=auto
603 _radio_bsdbt848=auto
604 _tv=yes
605 _tv_v4l1=auto
606 _tv_v4l2=auto
607 _tv_bsdbt848=auto
608 _tv_dshow=auto
609 _tv_teletext=auto
610 _pvr=auto
611 _network=yes
612 _winsock2=auto
613 _smbsupport=auto
614 _vidix_internal=auto
615 _vidix_external=auto
616 _vidix_pcidb=yes
617 _joystick=no
618 _xvid=auto
619 _x264=auto
620 _libnut=auto
621 _lirc=auto
622 _lircc=auto
623 _apple_remote=auto
624 _gui=no
625 _gtk1=no
626 _termcap=auto
627 _termios=auto
628 _3dfx=no
629 _s3fb=no
630 _tdfxfb=no
631 _tdfxvid=no
632 _xvr100=auto
633 _tga=yes
634 _directfb=auto
635 _zr=auto
636 _bl=no
637 _largefiles=yes
638 #_language=en
639 _shm=auto
640 _linux_devfs=no
641 _charset="UTF-8"
642 _dynamic_plugins=no
643 _crash_debug=no
644 _sighandler=yes
645 _libdv=auto
646 _cdparanoia=auto
647 _cddb=auto
648 _big_endian=auto
649 _bitmap_font=yes
650 _freetype=auto
651 _fontconfig=auto
652 _menu=no
653 _qtx=auto
654 _macosx=auto
655 _maemo=auto
656 _macosx_finder_support=no
657 _macosx_bundle=auto
658 _sortsub=yes
659 _freetypeconfig='freetype-config'
660 _fribidi=auto
661 _fribidiconfig='fribidi-config'
662 _enca=auto
663 _inet6=auto
664 _gethostbyname2=auto
665 _ftp=yes
666 _musepack=auto
667 _vstream=auto
668 _pthreads=auto
669 _w32threads=auto
670 _ass=auto
671 _rpath=no
672 _asmalign_pot=auto
673 _color_console=no
674 _stream_cache=yes
675 _def_stream_cache="#define USE_STREAM_CACHE 1"
676 _need_shmem=yes
677 for ac_option do
678 case "$ac_option" in
679 --help|-help|-h)
680 show_help
682 --prefix=*)
683 _prefix=`echo $ac_option | cut -d '=' -f 2`
685 --bindir=*)
686 _bindir=`echo $ac_option | cut -d '=' -f 2`
688 --datadir=*)
689 _datadir=`echo $ac_option | cut -d '=' -f 2`
691 --mandir=*)
692 _mandir=`echo $ac_option | cut -d '=' -f 2`
694 --confdir=*)
695 _confdir=`echo $ac_option | cut -d '=' -f 2`
697 --libdir=*)
698 _libdir=`echo $ac_option | cut -d '=' -f 2`
700 --codecsdir=*)
701 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
703 --win32codecsdir=*)
704 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
706 --xanimcodecsdir=*)
707 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
709 --realcodecsdir=*)
710 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
712 --with-extraincdir=*)
713 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
715 --with-extralibdir=*)
716 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
719 --with-install=*)
720 _install=`echo $ac_option | cut -d '=' -f 2 `
722 --with-xvmclib=*)
723 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
726 --with-sdl-config=*)
727 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
729 --with-freetype-config=*)
730 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
732 --with-fribidi-config=*)
733 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
735 --with-gtk-config=*)
736 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
738 --with-glib-config=*)
739 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
741 --with-dvdnav-config=*)
742 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
745 --extra-libs=*)
746 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
748 --extra-libs-mplayer=*)
749 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
751 --extra-libs-mencoder=*)
752 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
755 --target=*)
756 _target=`echo $ac_option | cut -d '=' -f 2`
758 --cc=*)
759 _cc=`echo $ac_option | cut -d '=' -f 2`
761 --host-cc=*)
762 _host_cc=`echo $ac_option | cut -d '=' -f 2`
764 --as=*)
765 _as=`echo $ac_option | cut -d '=' -f 2`
767 --ar=*)
768 _ar=`echo $ac_option | cut -d '=' -f 2`
770 --ranlib=*)
771 _ranlib=`echo $ac_option | cut -d '=' -f 2`
773 --charset=*)
774 _charset=`echo $ac_option | cut -d '=' -f 2`
776 --language=*)
777 _language=`echo $ac_option | cut -d '=' -f 2`
780 --enable-static)
781 _ld_static='-static'
783 --disable-static)
784 _ld_static=''
786 --enable-profile)
787 _profile='-p'
789 --disable-profile)
790 _profile=
792 --enable-debug)
793 _debug='-g'
795 --enable-debug=*)
796 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
798 --disable-debug)
799 _debug=
801 --enable-gcc-check) _gcc_check=yes ;;
802 --disable-gcc-check) _gcc_check=no ;;
803 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
804 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
805 --enable-cross-compile) _cross_compile=yes ;;
806 --disable-cross-compile) _cross_compile=no ;;
807 --enable-mencoder) _mencoder=yes ;;
808 --disable-mencoder) _mencoder=no ;;
809 --enable-mplayer) _mplayer=yes ;;
810 --disable-mplayer) _mplayer=no ;;
811 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
812 --disable-dynamic-plugins) _dynamic_plugins=no ;;
813 --enable-x11) _x11=yes ;;
814 --disable-x11) _x11=no ;;
815 --enable-xshape) _xshape=yes ;;
816 --disable-xshape) _xshape=no ;;
817 --enable-xss) _xss=yes ;;
818 --disable-xss) _xss=no ;;
819 --enable-xv) _xv=yes ;;
820 --disable-xv) _xv=no ;;
821 --enable-xvmc) _xvmc=yes ;;
822 --disable-xvmc) _xvmc=no ;;
823 --enable-sdl) _sdl=yes ;;
824 --disable-sdl) _sdl=no ;;
825 --enable-directx) _directx=yes ;;
826 --disable-directx) _directx=no ;;
827 --enable-win32waveout) _win32waveout=yes ;;
828 --disable-win32waveout) _win32waveout=no ;;
829 --enable-nas) _nas=yes ;;
830 --disable-nas) _nas=no ;;
831 --enable-png) _png=yes ;;
832 --disable-png) _png=no ;;
833 --enable-jpeg) _jpeg=yes ;;
834 --disable-jpeg) _jpeg=no ;;
835 --enable-pnm) _pnm=yes ;;
836 --disable-pnm) _pnm=no ;;
837 --enable-md5sum) _md5sum=yes ;;
838 --disable-md5sum) _md5sum=no ;;
839 --enable-gif) _gif=yes ;;
840 --disable-gif) _gif=no ;;
841 --enable-gl) _gl=yes ;;
842 --disable-gl) _gl=no ;;
843 --enable-ggi) _ggi=yes ;;
844 --disable-ggi) _ggi=no ;;
845 --enable-ggiwmh) _ggiwmh=yes ;;
846 --disable-ggiwmh) _ggiwmh=no ;;
847 --enable-aa) _aa=yes ;;
848 --disable-aa) _aa=no ;;
849 --enable-caca) _caca=yes ;;
850 --disable-caca) _caca=no ;;
851 --enable-svga) _svga=yes ;;
852 --disable-svga) _svga=no ;;
853 --enable-vesa) _vesa=yes ;;
854 --disable-vesa) _vesa=no ;;
855 --enable-fbdev) _fbdev=yes ;;
856 --disable-fbdev) _fbdev=no ;;
857 --enable-dvb) _dvb=yes ;;
858 --disable-dvb) _dvb=no ;;
859 --enable-dvbhead) _dvbhead=yes ;;
860 --disable-dvbhead) _dvbhead=no ;;
861 --enable-dxr2) _dxr2=yes ;;
862 --disable-dxr2) _dxr2=no ;;
863 --enable-dxr3) _dxr3=yes ;;
864 --disable-dxr3) _dxr3=no ;;
865 --enable-ivtv) _ivtv=yes ;;
866 --disable-ivtv) _ivtv=no ;;
867 --enable-v4l2) _v4l2=yes ;;
868 --disable-v4l2) _v4l2=no ;;
869 --enable-iconv) _iconv=yes ;;
870 --disable-iconv) _iconv=no ;;
871 --enable-langinfo) _langinfo=yes ;;
872 --disable-langinfo) _langinfo=no ;;
873 --enable-rtc) _rtc=yes ;;
874 --disable-rtc) _rtc=no ;;
875 --enable-libdv) _libdv=yes ;;
876 --disable-libdv) _libdv=no ;;
877 --enable-ossaudio) _ossaudio=yes ;;
878 --disable-ossaudio) _ossaudio=no ;;
879 --enable-arts) _arts=yes ;;
880 --disable-arts) _arts=no ;;
881 --enable-esd) _esd=yes ;;
882 --disable-esd) _esd=no ;;
883 --enable-pulse) _pulse=yes ;;
884 --disable-pulse) _pulse=no ;;
885 --enable-jack) _jack=yes ;;
886 --disable-jack) _jack=no ;;
887 --enable-openal) _openal=yes ;;
888 --disable-openal) _openal=no ;;
889 --enable-mad) _mad=yes ;;
890 --disable-mad) _mad=no ;;
891 --enable-toolame) _toolame=yes ;;
892 --disable-toolame) _toolame=no ;;
893 --enable-twolame) _twolame=yes ;;
894 --disable-twolame) _twolame=no ;;
895 --enable-libcdio) _libcdio=yes ;;
896 --disable-libcdio) _libcdio=no ;;
897 --enable-liblzo) _liblzo=yes ;;
898 --disable-liblzo) _liblzo=no ;;
899 --enable-libvorbis) _libvorbis=yes ;;
900 --disable-libvorbis) _libvorbis=no ;;
901 --enable-speex) _speex=yes ;;
902 --disable-speex) _speex=no ;;
903 --enable-tremor-internal) _tremor_internal=yes ;;
904 --disable-tremor-internal) _tremor_internal=no ;;
905 --enable-tremor-low) _tremor_low=yes ;;
906 --disable-tremor-low) _tremor_low=no ;;
907 --enable-tremor-external) _tremor_external=yes ;;
908 --disable-tremor-external) _tremor_external=no ;;
909 --enable-theora) _theora=yes ;;
910 --disable-theora) _theora=no ;;
911 --enable-mp3lib) _mp3lib=yes ;;
912 --disable-mp3lib) _mp3lib=no ;;
913 --enable-liba52) _liba52=yes ;;
914 --disable-liba52) _liba52=no ;;
915 --enable-libdca) _libdca=yes ;;
916 --disable-libdca) _libdca=no ;;
917 --enable-libmpeg2) _libmpeg2=yes ;;
918 --disable-libmpeg2) _libmpeg2=no ;;
919 --enable-musepack) _musepack=yes ;;
920 --disable-musepack) _musepack=no ;;
921 --enable-faad-internal) _faad_internal=yes ;;
922 --disable-faad-internal) _faad_internal=no ;;
923 --enable-faad-external) _faad_external=yes ;;
924 --disable-faad-external) _faad_external=no ;;
925 --enable-faad-fixed) _faad_fixed=yes ;;
926 --disable-faad-fixed) _faad_fixed=no ;;
927 --enable-faac) _faac=yes ;;
928 --disable-faac) _faac=no ;;
929 --enable-ladspa) _ladspa=yes ;;
930 --disable-ladspa) _ladspa=no ;;
931 --enable-xmms) _xmms=yes ;;
932 --disable-xmms) _xmms=no ;;
933 --enable-dvdread) _dvdread=yes ;;
934 --disable-dvdread) _dvdread=no ;;
935 --enable-dvdread-internal) _dvdread_internal=yes ;;
936 --disable-dvdread-internal) _dvdread_internal=no ;;
937 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
938 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
939 --enable-dvdnav) _dvdnav=yes ;;
940 --disable-dvdnav) _dvdnav=no ;;
941 --enable-xanim) _xanim=yes ;;
942 --disable-xanim) _xanim=no ;;
943 --enable-real) _real=yes ;;
944 --disable-real) _real=no ;;
945 --enable-live) _live=yes ;;
946 --disable-live) _live=no ;;
947 --enable-nemesi) _nemesi=yes ;;
948 --disable-nemesi) _nemesi=no ;;
949 --enable-xinerama) _xinerama=yes ;;
950 --disable-xinerama) _xinerama=no ;;
951 --enable-mga) _mga=yes ;;
952 --disable-mga) _mga=no ;;
953 --enable-xmga) _xmga=yes ;;
954 --disable-xmga) _xmga=no ;;
955 --enable-vm) _vm=yes ;;
956 --disable-vm) _vm=no ;;
957 --enable-xf86keysym) _xf86keysym=yes ;;
958 --disable-xf86keysym) _xf86keysym=no ;;
959 --enable-mlib) _mlib=yes ;;
960 --disable-mlib) _mlib=no ;;
961 --enable-sunaudio) _sunaudio=yes ;;
962 --disable-sunaudio) _sunaudio=no ;;
963 --enable-sgiaudio) _sgiaudio=yes ;;
964 --disable-sgiaudio) _sgiaudio=no ;;
965 --enable-alsa) _alsa=yes ;;
966 --disable-alsa) _alsa=no ;;
967 --enable-tv) _tv=yes ;;
968 --disable-tv) _tv=no ;;
969 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
970 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
971 --enable-tv-v4l1) _tv_v4l1=yes ;;
972 --disable-tv-v4l1) _tv_v4l1=no ;;
973 --enable-tv-v4l2) _tv_v4l2=yes ;;
974 --disable-tv-v4l2) _tv_v4l2=no ;;
975 --enable-tv-dshow) _tv_dshow=yes ;;
976 --disable-tv-dshow) _tv_dshow=no ;;
977 --enable-tv-teletext) _tv_teletext=yes ;;
978 --disable-tv-teletext) _tv_teletext=no ;;
979 --enable-radio) _radio=yes ;;
980 --enable-radio-capture) _radio_capture=yes ;;
981 --disable-radio-capture) _radio_capture=no ;;
982 --disable-radio) _radio=no ;;
983 --enable-radio-v4l) _radio_v4l=yes ;;
984 --disable-radio-v4l) _radio_v4l=no ;;
985 --enable-radio-v4l2) _radio_v4l2=yes ;;
986 --disable-radio-v4l2) _radio_v4l2=no ;;
987 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
988 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
989 --enable-pvr) _pvr=yes ;;
990 --disable-pvr) _pvr=no ;;
991 --enable-fastmemcpy) _fastmemcpy=yes ;;
992 --disable-fastmemcpy) _fastmemcpy=no ;;
993 --enable-network) _network=yes ;;
994 --disable-network) _network=no ;;
995 --enable-winsock2) _winsock2=yes ;;
996 --disable-winsock2) _winsock2=no ;;
997 --enable-smb) _smbsupport=yes ;;
998 --disable-smb) _smbsupport=no ;;
999 --enable-vidix-internal) _vidix_internal=yes ;;
1000 --disable-vidix-internal) _vidix_internal=no ;;
1001 --enable-vidix-external) _vidix_external=yes ;;
1002 --disable-vidix-external) _vidix_external=no ;;
1003 --with-vidix-drivers=*)
1004 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
1006 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1007 --enable-joystick) _joystick=yes ;;
1008 --disable-joystick) _joystick=no ;;
1009 --enable-xvid) _xvid=yes ;;
1010 --disable-xvid) _xvid=no ;;
1011 --enable-x264) _x264=yes ;;
1012 --disable-x264) _x264=no ;;
1013 --enable-libnut) _libnut=yes ;;
1014 --disable-libnut) _libnut=no ;;
1015 --enable-libavutil_a) _libavutil_a=yes ;;
1016 --disable-libavutil_a) _libavutil_a=no ;;
1017 --enable-libavutil_so) _libavutil_so=yes ;;
1018 --disable-libavutil_so) _libavutil_so=no ;;
1019 --enable-libavcodec_a) _libavcodec_a=yes ;;
1020 --disable-libavcodec_a) _libavcodec_a=no ;;
1021 --enable-libavcodec_so) _libavcodec_so=yes ;;
1022 --disable-libavcodec_so) _libavcodec_so=no ;;
1023 --enable-libamr_nb) _libamr_nb=yes ;;
1024 --disable-libamr_nb) _libamr_nb=no ;;
1025 --enable-libamr_wb) _libamr_wb=yes ;;
1026 --disable-libamr_wb) _libamr_wb=no ;;
1027 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1028 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1029 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1030 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1031 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1032 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1033 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1034 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1035 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1036 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1037 --enable-libavformat_a) _libavformat_a=yes ;;
1038 --disable-libavformat_a) _libavformat_a=no ;;
1039 --enable-libavformat_so) _libavformat_so=yes ;;
1040 --disable-libavformat_so) _libavformat_so=no ;;
1041 --enable-libpostproc_a) _libpostproc_a=yes ;;
1042 --disable-libpostproc_a) _libpostproc_a=no ;;
1043 --enable-libpostproc_so) _libpostproc_so=yes ;;
1044 --disable-libpostproc_so) _libpostproc_so=no ;;
1045 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1046 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1048 --enable-lirc) _lirc=yes ;;
1049 --disable-lirc) _lirc=no ;;
1050 --enable-lircc) _lircc=yes ;;
1051 --disable-lircc) _lircc=no ;;
1052 --enable-apple-remote) _apple_remote=yes ;;
1053 --disable-apple-remote) _apple_remote=no ;;
1054 --enable-gui) _gui=yes ;;
1055 --disable-gui) _gui=no ;;
1056 --enable-gtk1) _gtk1=yes ;;
1057 --disable-gtk1) _gtk1=no ;;
1058 --enable-termcap) _termcap=yes ;;
1059 --disable-termcap) _termcap=no ;;
1060 --enable-termios) _termios=yes ;;
1061 --disable-termios) _termios=no ;;
1062 --enable-3dfx) _3dfx=yes ;;
1063 --disable-3dfx) _3dfx=no ;;
1064 --enable-s3fb) _s3fb=yes ;;
1065 --disable-s3fb) _s3fb=no ;;
1066 --enable-tdfxfb) _tdfxfb=yes ;;
1067 --disable-tdfxfb) _tdfxfb=no ;;
1068 --disable-tdfxvid) _tdfxvid=no ;;
1069 --enable-tdfxvid) _tdfxvid=yes ;;
1070 --disable-xvr100) _xvr100=no ;;
1071 --enable-xvr100) _xvr100=yes ;;
1072 --disable-tga) _tga=no ;;
1073 --enable-tga) _tga=yes ;;
1074 --enable-directfb) _directfb=yes ;;
1075 --disable-directfb) _directfb=no ;;
1076 --enable-zr) _zr=yes ;;
1077 --disable-zr) _zr=no ;;
1078 --enable-bl) _bl=yes ;;
1079 --disable-bl) _bl=no ;;
1080 --enable-mtrr) _mtrr=yes ;;
1081 --disable-mtrr) _mtrr=no ;;
1082 --enable-largefiles) _largefiles=yes ;;
1083 --disable-largefiles) _largefiles=no ;;
1084 --enable-shm) _shm=yes ;;
1085 --disable-shm) _shm=no ;;
1086 --enable-select) _select=yes ;;
1087 --disable-select) _select=no ;;
1088 --enable-linux-devfs) _linux_devfs=yes ;;
1089 --disable-linux-devfs) _linux_devfs=no ;;
1090 --enable-cdparanoia) _cdparanoia=yes ;;
1091 --disable-cdparanoia) _cdparanoia=no ;;
1092 --enable-cddb) _cddb=yes ;;
1093 --disable-cddb) _cddb=no ;;
1094 --enable-big-endian) _big_endian=yes ;;
1095 --disable-big-endian) _big_endian=no ;;
1096 --enable-bitmap-font) _bitmap_font=yes ;;
1097 --disable-bitmap-font) _bitmap_font=no ;;
1098 --enable-freetype) _freetype=yes ;;
1099 --disable-freetype) _freetype=no ;;
1100 --enable-fontconfig) _fontconfig=yes ;;
1101 --disable-fontconfig) _fontconfig=no ;;
1102 --enable-unrarexec) _unrar_exec=yes ;;
1103 --disable-unrarexec) _unrar_exec=no ;;
1104 --enable-ftp) _ftp=yes ;;
1105 --disable-ftp) _ftp=no ;;
1106 --enable-vstream) _vstream=yes ;;
1107 --disable-vstream) _vstream=no ;;
1108 --enable-pthreads) _pthreads=yes ;;
1109 --disable-pthreads) _pthreads=no ;;
1110 --enable-w32threads) _w32threads=yes ;;
1111 --disable-w32threads) _w32threads=no ;;
1112 --enable-ass) _ass=yes ;;
1113 --disable-ass) _ass=no ;;
1114 --enable-rpath) _rpath=yes ;;
1115 --disable-rpath) _rpath=no ;;
1116 --enable-color-console) _color_console=yes ;;
1117 --disable-color-console) _color_console=no ;;
1119 --enable-fribidi) _fribidi=yes ;;
1120 --disable-fribidi) _fribidi=no ;;
1122 --enable-enca) _enca=yes ;;
1123 --disable-enca) _enca=no ;;
1125 --enable-inet6) _inet6=yes ;;
1126 --disable-inet6) _inet6=no ;;
1128 --enable-gethostbyname2) _gethostbyname2=yes ;;
1129 --disable-gethostbyname2) _gethostbyname2=no ;;
1131 --enable-dga1) _dga1=yes ;;
1132 --disable-dga1) _dga1=no ;;
1133 --enable-dga2) _dga2=yes ;;
1134 --disable-dga2) _dga2=no ;;
1136 --enable-menu) _menu=yes ;;
1137 --disable-menu) _menu=no ;;
1139 --enable-qtx) _qtx=yes ;;
1140 --disable-qtx) _qtx=no ;;
1142 --enable-macosx) _macosx=yes ;;
1143 --disable-macosx) _macosx=no ;;
1144 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1145 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1146 --enable-macosx-bundle) _macosx_bundle=yes;;
1147 --disable-macosx-bundle) _macosx_bundle=no;;
1149 --enable-maemo) _maemo=yes ;;
1150 --disable-maemo) _maemo=no ;;
1152 --enable-sortsub) _sortsub=yes ;;
1153 --disable-sortsub) _sortsub=no ;;
1155 --enable-crash-debug) _crash_debug=yes ;;
1156 --disable-crash-debug) _crash_debug=no ;;
1157 --enable-sighandler) _sighandler=yes ;;
1158 --disable-sighandler) _sighandler=no ;;
1159 --enable-win32dll) _win32dll=yes ;;
1160 --disable-win32dll) _win32dll=no ;;
1162 --enable-sse) _sse=yes ;;
1163 --disable-sse) _sse=no ;;
1164 --enable-sse2) _sse2=yes ;;
1165 --disable-sse2) _sse2=no ;;
1166 --enable-ssse3) _ssse3=yes ;;
1167 --disable-ssse3) _ssse3=no ;;
1168 --enable-mmxext) _mmxext=yes ;;
1169 --disable-mmxext) _mmxext=no ;;
1170 --enable-3dnow) _3dnow=yes ;;
1171 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1172 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1173 --disable-3dnowext) _3dnowext=no ;;
1174 --enable-cmov) _cmov=yes ;;
1175 --disable-cmov) _cmov=no ;;
1176 --enable-fast-cmov) _fast_cmov=yes ;;
1177 --disable-fast-cmov) _fast_cmov=no ;;
1178 --enable-altivec) _altivec=yes ;;
1179 --disable-altivec) _altivec=no ;;
1180 --enable-armv5te) _armv5te=yes ;;
1181 --disable-armv5te) _armv5te=no ;;
1182 --enable-armv6) _armv6=yes ;;
1183 --disable-armv6) _armv6=no ;;
1184 --enable-iwmmxt) _iwmmxt=yes ;;
1185 --disable-iwmmxt) _iwmmxt=no ;;
1186 --enable-mmx) _mmx=yes ;;
1187 --disable-mmx) # 3Dnow! and MMX2 require MMX
1188 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1191 echo "Unknown parameter: $ac_option"
1192 exit 1
1195 esac
1196 done
1198 # Atmos: moved this here, to be correct, if --prefix is specified
1199 test -z "$_bindir" && _bindir="$_prefix/bin"
1200 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1201 test -z "$_mandir" && _mandir="$_prefix/share/man"
1202 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1203 test -z "$_libdir" && _libdir="$_prefix/lib"
1205 # Determine our OS name and CPU architecture
1206 if test -z "$_target" ; then
1207 # OS name
1208 system_name=`uname -s 2>&1`
1209 case "$system_name" in
1210 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX|AmigaOS)
1212 IRIX*)
1213 system_name=IRIX
1215 GNU/kFreeBSD)
1216 system_name=FreeBSD
1218 HP-UX*)
1219 system_name=HP-UX
1221 [cC][yY][gG][wW][iI][nN]*)
1222 system_name=CYGWIN
1224 MINGW32*)
1225 system_name=MINGW32
1228 system_name="$system_name-UNKNOWN"
1230 esac
1233 # host's CPU/instruction set
1234 host_arch=`uname -p 2>&1`
1235 case "$host_arch" in
1236 i386|sparc|ppc|alpha|arm|sh3|mips|vax)
1238 powerpc) # Darwin returns 'powerpc'
1239 host_arch=ppc
1241 *) # uname -p on Linux returns 'unknown' for the processor type,
1242 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1244 # Maybe uname -m (machine hardware name) returns something we
1245 # recognize.
1247 # x86/x86pc is used by QNX
1248 case "`uname -m 2>&1`" in
1249 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 ;;
1250 ia64) host_arch=ia64 ;;
1251 x86_64|amd64)
1252 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1253 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1254 host_arch=x86_64
1255 else
1256 host_arch=i386
1259 macppc|ppc|ppc64) host_arch=ppc ;;
1260 alpha) host_arch=alpha ;;
1261 sparc) host_arch=sparc ;;
1262 sparc64) host_arch=sparc64 ;;
1263 parisc*|hppa*|9000*) host_arch=hppa ;;
1264 arm*|zaurus|cats) host_arch=arm ;;
1265 sh3) host_arch=sh3 ;;
1266 s390) host_arch=s390 ;;
1267 s390x) host_arch=s390x ;;
1268 mips*) host_arch=mips ;;
1269 vax) host_arch=vax ;;
1270 xtensa*) host_arch=xtensa ;;
1271 *) host_arch=UNKNOWN ;;
1272 esac
1274 esac
1275 else # if test -z "$_target"
1276 system_name=`echo $_target | cut -d '-' -f 2`
1277 case "`echo $system_name | tr A-Z a-z`" in
1278 linux) system_name=Linux ;;
1279 freebsd) system_name=FreeBSD ;;
1280 gnu/kfreebsd) system_name=FreeBSD ;;
1281 netbsd) system_name=NetBSD ;;
1282 bsd/os) system_name=BSD/OS ;;
1283 openbsd) system_name=OpenBSD ;;
1284 sunos) system_name=SunOS ;;
1285 qnx) system_name=QNX ;;
1286 morphos) system_name=MorphOS ;;
1287 amigaos) system_name=AmigaOS ;;
1288 mingw32msvc) system_name=MINGW32 ;;
1289 esac
1290 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1291 host_arch=`echo $_target | cut -d '-' -f 1`
1292 if test `echo $host_arch` != "x86_64" ; then
1293 host_arch=`echo $host_arch | tr '_' '-'`
1297 echo "Detected operating system: $system_name"
1298 echo "Detected host architecture: $host_arch"
1300 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1301 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1305 if openbsd ; then
1306 _ldconfig="ldconfig -R"
1309 if freebsd ; then
1310 _ld_extra="$_ld_extra -L/usr/local/lib"
1311 _inc_extra="$_inc_extra -I/usr/local/include"
1314 if darwin; then
1315 _ld_extra="$_ld_extra -L/usr/local/lib"
1316 _inc_extra="$_inc_extra -I/usr/local/include"
1319 if aix ; then
1320 _ld_extra="$_ld_extra -lC"
1323 if irix ; then
1324 _ranlib='ar -r'
1325 elif linux ; then
1326 _ranlib='true'
1329 if win32 ; then
1330 _exesuf=".exe"
1331 # -lwinmm is always needed for osdep/timer-win2.c
1332 _ld_extra="$_ld_extra -lwinmm"
1333 _confwin32='TARGET_WIN32 = yes'
1334 else
1335 _confwin32='TARGET_WIN32 = no'
1338 if mingw32 ; then
1339 _need_shmem=no
1342 if cygwin ; then
1343 _def_confwin32='#define WIN32'
1346 if amigaos ; then
1347 _select=no
1348 _sighandler=no
1349 _stream_cache=no
1350 _def_stream_cache="#undef USE_STREAM_CACHE"
1353 if qnx ; then
1354 _ld_extra="$_ld_extra -lph"
1357 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1358 test "$I" && break
1359 done
1362 TMPLOG="configure.log"
1363 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1364 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1365 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1366 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1367 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1369 rm -f "$TMPLOG"
1370 echo configuration: $_configuration > "$TMPLOG"
1371 echo >> "$TMPLOG"
1374 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1375 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1376 # know about '-n'.
1377 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1378 _head() { head -$1 2>/dev/null ; }
1379 else
1380 _head() { head -n $1 2>/dev/null ; }
1382 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1383 _tail() { tail -$1 2>/dev/null ; }
1384 else
1385 _tail() { tail -n $1 2>/dev/null ; }
1388 # Checking CC version...
1389 if test "$_gcc_check" = yes ; then
1390 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1391 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1392 echocheck "$_cc version"
1393 cc_vendor=intel
1394 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1395 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1396 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1397 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1398 # TODO verify older icc/ecc compatibility
1399 case $cc_version in
1401 cc_version="v. ?.??, bad"
1402 cc_verc_fail=yes
1404 8.0|9.1|10.0|10.1)
1405 cc_version="$cc_version, ok"
1406 cc_verc_fail=no
1409 cc_version="$cc_version, bad"
1410 cc_verc_fail=yes
1412 esac
1413 echores "$cc_version"
1414 else
1415 for _cc in "$_cc" gcc cc ; do
1416 echocheck "$_cc version"
1417 cc_vendor=gnu
1418 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1419 cc_version=`$_cc -dumpversion 2>&1`
1420 if test "$?" -gt 0; then
1421 cc_version="not found"
1423 case $cc_version in
1425 cc_version="v. ?.??, bad"
1426 cc_verc_fail=yes
1428 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1429 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1430 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1431 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1432 cc_version="$cc_version, ok"
1433 cc_verc_fail=no
1435 'not found')
1436 cc_verc_fail=yes
1439 cc_version="$cc_version, bad"
1440 cc_verc_fail=yes
1442 esac
1443 echores "$cc_version"
1444 test "$cc_verc_fail" = "no" && break
1445 done
1446 fi # icc
1447 if test "$cc_verc_fail" = yes ; then
1448 cat <<EOF
1450 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1452 You are not using a supported compiler. We do not have the time to make sure
1453 everything works with compilers other than the ones we use. Use either the
1454 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1455 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1457 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1458 mplayer and lame (which is used for mencoder). If you get compile errors,
1459 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1460 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1461 bugs!
1463 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1466 die "Bad gcc version"
1468 else
1469 cat <<EOF
1471 ******************************************************************************
1473 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1474 Ok. You know. Do it.
1476 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1477 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1478 Lame which is used by mencoder produces weird errors, too.
1480 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1481 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1483 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1485 ******************************************************************************
1489 read _answer
1492 echocheck "host cc"
1493 test "$_host_cc" || _host_cc=$_cc
1494 echores $_host_cc
1496 echocheck "cross compilation"
1497 if test $_cross_compile = auto ; then
1498 cat > $TMPC << EOF
1499 int main(void) { return 0; }
1501 _cross_compile=yes
1502 cc_check && "$TMPEXE" && _cross_compile=no
1504 echores $_cross_compile
1506 if test $_cross_compile = yes; then
1507 tmp_run() {
1508 return 0
1512 # ---
1514 # now that we know what compiler should be used for compilation, try to find
1515 # out which assembler is used by the $_cc compiler
1516 if test "$_as" = auto ; then
1517 _as=`$_cc -print-prog-name=as`
1518 test -z "$_as" && _as=as
1521 # XXX: this should be ok..
1522 _cpuinfo="echo"
1524 if test "$_runtime_cpudetection" = no ; then
1526 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1527 # FIXME: Remove the cygwin check once AMD CPUs are supported
1528 if test -r /proc/cpuinfo && ! cygwin; then
1529 # Linux with /proc mounted, extract CPU information from it
1530 _cpuinfo="cat /proc/cpuinfo"
1531 elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then
1532 # FreeBSD with Linux emulation /proc mounted,
1533 # extract CPU information from it
1534 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1535 elif darwin && ! x86_32 ; then
1536 # use hostinfo on Darwin
1537 _cpuinfo="hostinfo"
1538 elif aix; then
1539 # use 'lsattr' on AIX
1540 _cpuinfo="lsattr -E -l proc0 -a type"
1541 elif x86; then
1542 # all other OSes try to extract CPU information from a small helper
1543 # program cpuinfo instead
1544 $_cc -o cpuinfo$_exesuf cpuinfo.c
1545 _cpuinfo="./cpuinfo$_exesuf"
1548 if x86 ; then
1549 # gather more CPU information
1550 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1551 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1552 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1553 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1554 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1556 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1558 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1559 -e s/xmm/sse/ -e s/kni/sse/`
1561 for ext in $pparam ; do
1562 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1563 done
1565 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1566 test $_sse = kernel_check && _mmxext=kernel_check
1568 echocheck "CPU vendor"
1569 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1571 echocheck "CPU type"
1572 echores "$pname"
1575 fi # test "$_runtime_cpudetection" = no
1577 if x86 && test "$_runtime_cpudetection" = no ; then
1578 extcheck() {
1579 if test "$1" = kernel_check ; then
1580 echocheck "kernel support of $2"
1581 cat > $TMPC <<EOF
1582 #include <signal.h>
1583 void catch() { exit(1); }
1584 int main(void){
1585 signal(SIGILL, catch);
1586 __asm__ __volatile__ ("$3":::"memory");return(0);
1590 if cc_check && tmp_run ; then
1591 eval _$2=yes
1592 echores "yes"
1593 _optimizing="$_optimizing $2"
1594 return 0
1595 else
1596 eval _$2=no
1597 echores "failed"
1598 echo "It seems that your kernel does not correctly support $2."
1599 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1600 return 1
1603 return 0
1606 extcheck $_mmx "mmx" "emms"
1607 extcheck $_mmxext "mmxext" "sfence"
1608 extcheck $_3dnow "3dnow" "femms"
1609 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1610 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1611 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1612 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1613 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1615 echocheck "mtrr support"
1616 if test "$_mtrr" = kernel_check ; then
1617 _mtrr="yes"
1618 _optimizing="$_optimizing mtrr"
1620 echores "$_mtrr"
1622 if test "$_gcc3_ext" != ""; then
1623 # if we had to disable sse/sse2 because the active kernel does not
1624 # support this instruction set extension, we also have to tell
1625 # gcc3 to not generate sse/sse2 instructions for normal C code
1626 cat > $TMPC << EOF
1627 int main(void) { return 0; }
1629 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1635 _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM ARMV4L SH3 POWERPC PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC'
1636 case "$host_arch" in
1637 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1638 _arch='X86 X86_32'
1639 _target_arch_x86="ARCH_X86 = yes"
1640 _target_arch="ARCH_X86_32 = yes"
1641 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1642 iproc=486
1643 proc=i486
1646 if test "$_runtime_cpudetection" = no ; then
1647 case "$pvendor" in
1648 AuthenticAMD)
1649 case "$pfamily" in
1650 3) proc=i386 iproc=386 ;;
1651 4) proc=i486 iproc=486 ;;
1652 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1653 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1654 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1655 proc=k6-3
1656 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1657 proc=geode
1658 elif test "$pmodel" -ge 8; then
1659 proc=k6-2
1660 elif test "$pmodel" -ge 6; then
1661 proc=k6
1662 else
1663 proc=i586
1666 6) iproc=686
1667 # It's a bit difficult to determine the correct type of Family 6
1668 # AMD CPUs just from their signature. Instead, we check directly
1669 # whether it supports SSE.
1670 if test "$_sse" = yes; then
1671 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1672 proc=athlon-xp
1673 else
1674 # Again, gcc treats athlon and athlon-tbird similarly.
1675 proc=athlon
1678 15) iproc=686
1679 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1680 # caught and remedied in the optimization tests below.
1681 proc=k8
1684 *) proc=k8 iproc=686 ;;
1685 esac
1687 GenuineIntel)
1688 case "$pfamily" in
1689 3) proc=i386 iproc=386 ;;
1690 4) proc=i486 iproc=486 ;;
1691 5) iproc=586
1692 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1693 proc=pentium-mmx # 4 is desktop, 8 is mobile
1694 else
1695 proc=i586
1698 6) iproc=686
1699 if test "$pmodel" -ge 15; then
1700 proc=core2
1701 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1702 proc=pentium-m
1703 elif test "$pmodel" -ge 7; then
1704 proc=pentium3
1705 elif test "$pmodel" -ge 3; then
1706 proc=pentium2
1707 else
1708 proc=i686
1711 15) iproc=686
1712 # A nocona in 32-bit mode has no more capabilities than a prescott.
1713 if test "$pmodel" -ge 3; then
1714 proc=prescott
1715 else
1716 proc=pentium4
1718 test $_fast_cmov = "auto" && _fast_cmov=no
1720 *) proc=prescott iproc=686 ;;
1721 esac
1723 CentaurHauls)
1724 case "$pfamily" in
1725 5) iproc=586
1726 if test "$pmodel" -ge 8; then
1727 proc=winchip2
1728 elif test "$pmodel" -ge 4; then
1729 proc=winchip-c6
1730 else
1731 proc=i586
1734 6) iproc=686
1735 if test "$pmodel" -ge 9; then
1736 proc=c3-2
1737 else
1738 proc=c3
1739 iproc=586
1742 *) proc=i686 iproc=i686 ;;
1743 esac
1745 unknown)
1746 case "$pfamily" in
1747 3) proc=i386 iproc=386 ;;
1748 4) proc=i486 iproc=486 ;;
1749 *) proc=i586 iproc=586 ;;
1750 esac
1753 proc=i586 iproc=586 ;;
1754 esac
1755 fi # test "$_runtime_cpudetection" = no
1758 # check that gcc supports our CPU, if not, fall back to earlier ones
1759 # LGB: check -mcpu and -march swithing step by step with enabling
1760 # to fall back till 386.
1762 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1764 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1765 cpuopt=-mtune
1766 else
1767 cpuopt=-mcpu
1770 echocheck "GCC & CPU optimization abilities"
1771 cat > $TMPC << EOF
1772 int main(void) { return 0; }
1774 if test "$_runtime_cpudetection" = no ; then
1775 cc_check -march=native && proc=native
1776 if test "$proc" = "k8"; then
1777 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1779 if test "$proc" = "athlon-xp"; then
1780 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1782 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1783 cc_check -march=$proc $cpuopt=$proc || proc=k6
1785 if test "$proc" = "k6" || test "$proc" = "c3"; then
1786 if ! cc_check -march=$proc $cpuopt=$proc; then
1787 if cc_check -march=i586 $cpuopt=i686; then
1788 proc=i586-i686
1789 else
1790 proc=i586
1794 if test "$proc" = "prescott" ; then
1795 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1797 if test "$proc" = "core2" ; then
1798 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1800 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
1801 cc_check -march=$proc $cpuopt=$proc || proc=i686
1803 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1804 cc_check -march=$proc $cpuopt=$proc || proc=i586
1806 if test "$proc" = "i586"; then
1807 cc_check -march=$proc $cpuopt=$proc || proc=i486
1809 if test "$proc" = "i486" ; then
1810 cc_check -march=$proc $cpuopt=$proc || proc=i386
1812 if test "$proc" = "i386" ; then
1813 cc_check -march=$proc $cpuopt=$proc || proc=error
1815 if test "$proc" = "error" ; then
1816 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1817 _mcpu=""
1818 _march=""
1819 _optimizing=""
1820 elif test "$proc" = "i586-i686"; then
1821 _march="-march=i586"
1822 _mcpu="$cpuopt=i686"
1823 _optimizing="$proc"
1824 else
1825 _march="-march=$proc"
1826 _mcpu="$cpuopt=$proc"
1827 _optimizing="$proc"
1829 else # if test "$_runtime_cpudetection" = no
1830 _mcpu="$cpuopt=generic"
1831 # at least i486 required, for bswap instruction
1832 _march="-march=i486"
1833 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1834 cc_check $_mcpu || _mcpu=""
1835 cc_check $_march $_mcpu || _march=""
1838 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1839 ## autodetected mcpu/march parameters
1840 if test "$_target" ; then
1841 # TODO: it may be a good idea to check GCC and fall back in all cases
1842 if test "$host_arch" = "i586-i686"; then
1843 _march="-march=i586"
1844 _mcpu="$cpuopt=i686"
1845 else
1846 _march="-march=$host_arch"
1847 _mcpu="$cpuopt=$host_arch"
1850 proc="$host_arch"
1852 case "$proc" in
1853 i386) iproc=386 ;;
1854 i486) iproc=486 ;;
1855 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1856 i686|athlon*|pentium*) iproc=686 ;;
1857 *) iproc=586 ;;
1858 esac
1861 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1862 _fast_cmov="yes"
1863 else
1864 _fast_cmov="no"
1867 echores "$proc"
1870 ia64)
1871 _arch='IA64'
1872 _target_arch='ARCH_IA64 = yes'
1873 iproc='ia64'
1874 proc=''
1875 _march=''
1876 _mcpu=''
1877 _optimizing=''
1880 x86_64|amd64)
1881 _arch='X86 X86_64'
1882 _target_arch='ARCH_X86_64 = yes'
1883 _target_arch_x86="ARCH_X86 = yes"
1884 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1885 iproc='x86_64'
1887 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1888 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1889 cpuopt=-mtune
1890 else
1891 cpuopt=-mcpu
1893 if test "$_runtime_cpudetection" = no ; then
1894 case "$pvendor" in
1895 AuthenticAMD)
1896 proc=k8;;
1897 GenuineIntel)
1898 case "$pfamily" in
1899 6) proc=core2;;
1901 # 64-bit prescotts exist, but as far as GCC is concerned they
1902 # have the same capabilities as a nocona.
1903 proc=nocona
1904 test $_fast_cmov = "auto" && _fast_cmov=no
1906 esac
1909 proc=error;;
1910 esac
1911 fi # test "$_runtime_cpudetection" = no
1913 echocheck "GCC & CPU optimization abilities"
1914 cat > $TMPC << EOF
1915 int main(void) { return 0; }
1917 # This is a stripped-down version of the i386 fallback.
1918 if test "$_runtime_cpudetection" = no ; then
1919 cc_check -march=native && proc=native
1920 # --- AMD processors ---
1921 if test "$proc" = "k8"; then
1922 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1924 # This will fail if gcc version < 3.3, which is ok because earlier
1925 # versions don't really support 64-bit on amd64.
1926 # Is this a valid assumption? -Corey
1927 if test "$proc" = "athlon-xp"; then
1928 cc_check -march=$proc $cpuopt=$proc || proc=error
1930 # --- Intel processors ---
1931 if test "$proc" = "core2"; then
1932 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1934 if test "$proc" = "nocona"; then
1935 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1937 if test "$proc" = "pentium4"; then
1938 cc_check -march=$proc $cpuopt=$proc || proc=error
1941 _march="-march=$proc"
1942 _mcpu="$cpuopt=$proc"
1943 if test "$proc" = "error" ; then
1944 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1945 _mcpu=""
1946 _march=""
1948 else # if test "$_runtime_cpudetection" = no
1949 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1950 _march="-march=x86-64"
1951 _mcpu="$cpuopt=generic"
1952 cc_check $_mcpu || _mcpu="x86-64"
1953 cc_check $_mcpu || _mcpu=""
1954 cc_check $_march $_mcpu || _march=""
1957 _optimizing=""
1959 echores "$proc"
1962 sparc)
1963 _arch='SPARC'
1964 _target_arch='ARCH_SPARC = yes'
1965 iproc='sparc'
1966 if sunos ; then
1967 echocheck "CPU type"
1968 karch=`uname -m`
1969 case "`echo $karch`" in
1970 sun4) proc=v7 ;;
1971 sun4c) proc=v7 ;;
1972 sun4d) proc=v8 ;;
1973 sun4m) proc=v8 ;;
1974 sun4u) proc=ultrasparc _vis='yes' ;;
1975 sun4v) proc=v9 ;;
1976 *) proc=v8 ;;
1977 esac
1978 echores "$proc"
1979 else
1980 proc=v8
1982 _march=''
1983 _mcpu="-mcpu=$proc"
1984 _optimizing="$proc"
1987 sparc64)
1988 _arch='SPARC'
1989 _target_arch='ARCH_SPARC = yes'
1990 _vis='yes'
1991 iproc='sparc'
1992 proc='ultrasparc'
1993 _march=''
1994 _mcpu="-mcpu=$proc"
1995 _optimizing="$proc"
1998 arm|armv4l|armv5tel)
1999 _arch='ARM ARMV4L'
2000 _target_arch='ARCH_ARMV4L = yes'
2001 iproc='arm'
2002 proc=''
2003 _march=''
2004 _mcpu=''
2005 _optimizing=''
2008 sh3)
2009 _arch='SH3'
2010 _target_arch='ARCH_SH3 = yes'
2011 iproc='sh3'
2012 proc=''
2013 _march='-m3'
2014 _mcpu='-ml'
2015 _optimizing=''
2018 ppc|powerpc)
2019 _arch='POWERPC PPC'
2020 _def_dcbzl='#undef HAVE_DCBZL'
2021 _target_arch='ARCH_POWERPC = yes'
2022 iproc='ppc'
2023 proc=''
2024 _march=''
2025 _mcpu=''
2026 _optimizing=''
2028 echocheck "CPU type"
2029 case $system_name in
2030 Linux)
2031 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2032 if test -n "`$_cpuinfo | grep altivec`"; then
2033 test $_altivec = auto && _altivec=yes
2036 Darwin)
2037 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2038 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2039 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2040 test $_altivec = auto && _altivec=yes
2043 NetBSD)
2044 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2045 case $cc_version in
2046 2*|3.0*|3.1*|3.2*|3.3*)
2049 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2050 test $_altivec = auto && _altivec=yes
2053 esac
2055 AIX)
2056 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2058 esac
2059 if test "$_altivec" = yes; then
2060 echores "$proc altivec"
2061 else
2062 _altivec=no
2063 echores "$proc"
2066 echocheck "GCC & CPU optimization abilities"
2068 if test -n "$proc"; then
2069 case "$proc" in
2070 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2071 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2072 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2073 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2074 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2075 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2076 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2077 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2078 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2079 *) ;;
2080 esac
2081 # gcc 3.1(.1) and up supports 7400 and 7450
2082 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2083 case "$proc" in
2084 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2085 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2086 *) ;;
2087 esac
2089 # gcc 3.2 and up supports 970
2090 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2091 case "$proc" in
2092 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2093 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2094 *) ;;
2095 esac
2097 # gcc 3.3 and up supports POWER4
2098 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2099 case "$proc" in
2100 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2101 *) ;;
2102 esac
2104 # gcc 3.4 and up supports 440*
2105 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2106 case "$proc" in
2107 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2108 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2109 *) ;;
2110 esac
2112 # gcc 4.0 and up supports POWER5
2113 if test "$_cc_major" -ge "4"; then
2114 case "$proc" in
2115 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2116 *) ;;
2117 esac
2121 if test -n "$_mcpu"; then
2122 _optimizing=`echo $_mcpu | cut -c 8-`
2123 echores "$_optimizing"
2124 else
2125 echores "none"
2130 alpha)
2131 _arch='ALPHA'
2132 _target_arch='ARCH_ALPHA = yes'
2133 iproc='alpha'
2134 _march=''
2136 echocheck "CPU type"
2137 cat > $TMPC << EOF
2138 int main(void) {
2139 unsigned long ver, mask;
2140 asm ("implver %0" : "=r" (ver));
2141 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2142 printf("%ld-%x\n", ver, ~mask);
2143 return 0;
2146 $_cc -o "$TMPEXE" "$TMPC"
2147 case `"$TMPEXE"` in
2149 0-0) proc="ev4"; _mvi="0";;
2150 1-0) proc="ev5"; _mvi="0";;
2151 1-1) proc="ev56"; _mvi="0";;
2152 1-101) proc="pca56"; _mvi="1";;
2153 2-303) proc="ev6"; _mvi="1";;
2154 2-307) proc="ev67"; _mvi="1";;
2155 2-1307) proc="ev68"; _mvi="1";;
2156 esac
2157 echores "$proc"
2159 echocheck "GCC & CPU optimization abilities"
2160 if test "$proc" = "ev68" ; then
2161 cc_check -mcpu=$proc || proc=ev67
2163 if test "$proc" = "ev67" ; then
2164 cc_check -mcpu=$proc || proc=ev6
2166 _mcpu="-mcpu=$proc"
2167 echores "$proc"
2169 _optimizing="$proc"
2171 echocheck "MVI instruction support in GCC"
2172 if test "$_cc_major" -ge "3" && test "$_mvi" = "1" ; then
2173 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2174 echores "yes"
2175 else
2176 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2177 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2181 mips)
2182 _arch='SGI_MIPS'
2183 _target_arch='ARCH_SGI_MIPS = yes'
2184 iproc='sgi-mips'
2185 proc=''
2186 _march=''
2187 _mcpu=''
2188 _optimizing=''
2190 if irix ; then
2191 echocheck "CPU type"
2192 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2193 case "`echo $proc`" in
2194 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2195 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2196 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2197 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2198 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2199 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2200 esac
2201 # gcc < 3.x does not support -mtune.
2202 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2203 _mcpu=''
2205 echores "$proc"
2210 hppa)
2211 _arch='PA_RISC'
2212 _target_arch='ARCH_PA_RISC = yes'
2213 iproc='PA-RISC'
2214 proc=''
2215 _march=''
2216 _mcpu=''
2217 _optimizing=''
2220 s390)
2221 _arch='S390'
2222 _target_arch='ARCH_S390 = yes'
2223 iproc='390'
2224 proc=''
2225 _march=''
2226 _mcpu=''
2227 _optimizing=''
2230 s390x)
2231 _arch='S390X'
2232 _target_arch='ARCH_S390X = yes'
2233 iproc='390x'
2234 proc=''
2235 _march=''
2236 _mcpu=''
2237 _optimizing=''
2240 vax)
2241 _arch='VAX'
2242 _target_arch='ARCH_VAX = yes'
2243 iproc='vax'
2244 proc=''
2245 _march=''
2246 _mcpu=''
2247 _optimizing=''
2250 xtensa)
2251 _arch='XTENSA'
2252 _target_arch='ARCH_XTENSA = yes'
2253 iproc='xtensa'
2254 proc=''
2255 _march=''
2256 _mcpu=''
2257 _optimizing=''
2260 generic)
2261 _arch='GENERIC'
2262 _target_arch='ARCH_GENERIC = yes'
2263 iproc=''
2264 proc=''
2265 _march=''
2266 _mcpu=''
2267 _optimizing=''
2271 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2272 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2273 die "unsupported architecture $host_arch"
2275 esac # case "$host_arch" in
2277 if test "$_runtime_cpudetection" = yes ; then
2278 if x86 ; then
2279 test "$_cmov" != no && _cmov=yes
2280 x86_32 && _cmov=no
2281 test "$_mmx" != no && _mmx=yes
2282 test "$_3dnow" != no && _3dnow=yes
2283 test "$_3dnowext" != no && _3dnowext=yes
2284 test "$_mmxext" != no && _mmxext=yes
2285 test "$_sse" != no && _sse=yes
2286 test "$_sse2" != no && _sse2=yes
2287 test "$_ssse3" != no && _ssse3=yes
2288 test "$_mtrr" != no && _mtrr=yes
2290 if ppc; then
2291 _altivec=yes
2297 echocheck "assembler support of -pipe option"
2298 cat > $TMPC << EOF
2299 int main(void) { return 0; }
2301 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2304 echocheck "compiler support of named assembler arguments"
2305 _named_asm_args=yes
2306 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2307 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2308 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2309 _named_asm_args=no
2310 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2312 echores $_named_asm_args
2315 if darwin && test "$cc_vendor" = "gnu" ; then
2316 echocheck "GCC support of -mstackrealign"
2317 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2318 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2319 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2320 # wrong code with this flag, but this can be worked around by adding
2321 # -fno-unit-at-a-time as described in the blog post at
2322 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2323 cat > $TMPC << EOF
2324 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2325 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2327 cc_check -O4 -mstackrealign && tmp_run && _stackrealign=-mstackrealign
2328 test -z "$_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2329 && tmp_run && _stackrealign="-mstackrealign -fno-unit-at-a-time"
2330 test -n "$_stackrealign" && echores "yes" || echores "no"
2331 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2334 # Checking for CFLAGS
2335 _install_strip="-s"
2336 if test "$_profile" != "" || test "$_debug" != "" ; then
2337 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2338 _install_strip=
2339 elif test -z "$CFLAGS" ; then
2340 if test "$cc_vendor" = "intel" ; then
2341 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2342 elif test "$cc_vendor" != "gnu" ; then
2343 CFLAGS="-O2 $_march $_mcpu $_pipe"
2344 else
2345 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2347 else
2348 _warn_CFLAGS=yes
2350 if test -n "$LDFLAGS" ; then
2351 _ld_extra="$_ld_extra $LDFLAGS"
2352 _warn_CFLAGS=yes
2353 elif test "$cc_vendor" = "intel" ; then
2354 _ld_extra="$_ld_extra -i-static"
2356 if test -n "$CPPFLAGS" ; then
2357 _inc_extra="$_inc_extra $CPPFLAGS"
2358 _warn_CFLAGS=yes
2363 if x86_32 ; then
2364 # Checking assembler (_as) compatibility...
2365 # Added workaround for older as that reads from stdin by default - atmos
2366 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2367 echocheck "assembler ($_as $as_version)"
2369 _pref_as_version='2.9.1'
2370 echo 'nop' > $TMPS
2371 if test "$_mmx" = yes ; then
2372 echo 'emms' >> $TMPS
2374 if test "$_3dnow" = yes ; then
2375 _pref_as_version='2.10.1'
2376 echo 'femms' >> $TMPS
2378 if test "$_3dnowext" = yes ; then
2379 _pref_as_version='2.10.1'
2380 echo 'pswapd %mm0, %mm0' >> $TMPS
2382 if test "$_mmxext" = yes ; then
2383 _pref_as_version='2.10.1'
2384 echo 'movntq %mm0, (%eax)' >> $TMPS
2386 if test "$_sse" = yes ; then
2387 _pref_as_version='2.10.1'
2388 echo 'xorps %xmm0, %xmm0' >> $TMPS
2390 #if test "$_sse2" = yes ; then
2391 # _pref_as_version='2.11'
2392 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2394 if test "$_cmov" = yes ; then
2395 _pref_as_version='2.10.1'
2396 echo 'cmovb %eax, %ebx' >> $TMPS
2398 if test "$_ssse3" = yes ; then
2399 _pref_as_version='2.16.92'
2400 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2402 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2404 if test "$as_verc_fail" != yes ; then
2405 echores "ok"
2406 else
2407 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2408 echores "failed"
2409 die "obsolete binutils version"
2412 fi #if x86_32
2414 echocheck ".align is a power of two"
2415 if test "$_asmalign_pot" = auto ; then
2416 _asmalign_pot=no
2417 cat > $TMPC << EOF
2418 main(void) { asm (".align 3"); }
2420 cc_check && _asmalign_pot=yes
2422 if test "$_asmalign_pot" = "yes" ; then
2423 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2424 else
2425 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2427 echores $_asmalign_pot
2430 #FIXME: This should happen before the check for CFLAGS..
2431 if ppc ; then
2433 # check if altivec is supported by the compiler, and how to enable it
2435 _altivec_gcc_flags=''
2437 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2438 echocheck "GCC altivec support"
2440 p=''
2441 cat > $TMPC << EOF
2442 int main(void) {
2443 return 0;
2446 FSF_flags='-maltivec -mabi=altivec'
2447 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2449 # check for Darwin-style flags first, since
2450 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2451 # accepts but ignores FSF-style flags...
2453 if test -z "$p"; then
2454 cc_check $Darwin_flags && p='Darwin'
2456 if test -z "$p"; then
2457 cc_check $FSF_flags && p='FSF'
2460 case $p in
2461 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2462 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2463 *) _altivec=no ;;
2464 esac
2466 if test -z "$p"; then
2467 p=none
2468 else
2469 p="$p-style ($_altivec_gcc_flags)"
2472 echores "$p"
2475 # check if <altivec.h> should be included
2477 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2479 if test "$_altivec" = yes ; then
2480 echocheck "altivec.h"
2481 cat > $TMPC << EOF
2482 #include <altivec.h>
2483 int main(void) { return 0; }
2485 _have_altivec_h=no
2486 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2487 if test "$_have_altivec_h" = yes ; then
2488 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2490 echores "$_have_altivec_h"
2493 # disable runtime cpudetection if
2494 # - we cannot generate altivec code
2495 # - altivec is disabled by the user
2497 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2498 _runtime_cpudetection=no
2501 # show that we are optimizing for altivec (if enabled and supported)
2503 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2504 _optimizing="$_optimizing altivec"
2507 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2509 if test "$_altivec" = yes ; then
2510 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2511 #_mcpu="$_mcpu $_altivec_gcc_flags"
2512 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2516 if arm ; then
2517 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2518 if test $_armv5te = "auto" ; then
2519 cat > $TMPC << EOF
2520 int main(void) {
2521 __asm__ __volatile__ ("qadd r0, r0, r0");
2524 _armv5te=no
2525 cc_check && _armv5te=yes
2527 echores "$_armv5te"
2529 echocheck "ARMv6 (SIMD instructions)"
2530 if test $_armv6 = "auto" ; then
2531 cat > $TMPC << EOF
2532 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2534 _armv6=no
2535 cc_check && _armv6=yes
2537 echores "$_armv6"
2539 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2540 if test $_iwmmxt = "auto" ; then
2541 cat > $TMPC << EOF
2542 int main(void) {
2543 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2546 _iwmmxt=no
2547 cc_check && _iwmmxt=yes
2549 echores "$_iwmmxt"
2552 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
2553 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2554 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2555 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2556 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2557 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2558 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2559 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2560 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2561 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2562 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2563 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2564 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2565 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2566 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2567 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2569 # Checking kernel version...
2570 if x86_32 && linux ; then
2571 _k_verc_problem=no
2572 kernel_version=`uname -r 2>&1`
2573 echocheck "$system_name kernel version"
2574 case "$kernel_version" in
2575 '') kernel_version="?.??"; _k_verc_fail=yes;;
2576 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2577 _k_verc_problem=yes;;
2578 esac
2579 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2580 _k_verc_fail=yes
2582 if test "$_k_verc_fail" ; then
2583 echores "$kernel_version, fail"
2584 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2585 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2586 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2587 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2588 echo "2.2.x you must upgrade it to get SSE support!"
2589 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2590 else
2591 echores "$kernel_version, ok"
2595 ######################
2596 # MAIN TESTS GO HERE #
2597 ######################
2600 echocheck "-lposix"
2601 cat > $TMPC <<EOF
2602 int main(void) { return 0; }
2604 if cc_check -lposix ; then
2605 _ld_extra="$_ld_extra -lposix"
2606 echores "yes"
2607 else
2608 echores "no"
2611 echocheck "-lm"
2612 cat > $TMPC <<EOF
2613 int main(void) { return 0; }
2615 if cc_check -lm ; then
2616 _ld_lm="-lm"
2617 echores "yes"
2618 else
2619 _ld_lm=""
2620 echores "no"
2624 echocheck "langinfo"
2625 if test "$_langinfo" = auto ; then
2626 cat > $TMPC <<EOF
2627 #include <langinfo.h>
2628 int main(void) { nl_langinfo(CODESET); return 0; }
2630 _langinfo=no
2631 cc_check && _langinfo=yes
2633 if test "$_langinfo" = yes ; then
2634 _def_langinfo='#define USE_LANGINFO 1'
2635 else
2636 _def_langinfo='#undef USE_LANGINFO'
2638 echores "$_langinfo"
2641 echocheck "language"
2642 test -z "$_language" && _language=$LINGUAS
2643 _language=`echo $_language | sed 's/,/ /g'`
2644 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2645 for lang in $_language ; do
2646 test "$lang" = all && lang=en
2647 if test -f "help/help_mp-${lang}.h" ; then
2648 _language=$lang
2649 break
2650 else
2651 echo ${_echo_n} "$lang not found, ${_echo_c}"
2652 _language=`echo $_language | sed "s/$lang *//"`
2654 done
2655 test -z "$_language" && _language=en
2656 _mp_help="help/help_mp-${_language}.h"
2657 test -f $_mp_help || die "$_mp_help not found"
2658 for lang in $LANGUAGES ; do
2659 if test -f "DOCS/man/$lang/mplayer.1" ; then
2660 MAN_LANG="$lang $MAN_LANG"
2662 done
2663 _doc_lang=$_language
2664 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2665 echores "using $_language (man pages: $MAN_LANG)"
2668 echocheck "enable sighandler"
2669 if test "$_sighandler" = yes ; then
2670 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2671 else
2672 _def_sighandler='#undef ENABLE_SIGHANDLER'
2674 echores "$_sighandler"
2676 echocheck "runtime cpudetection"
2677 if test "$_runtime_cpudetection" = yes ; then
2678 _optimizing="Runtime CPU-Detection enabled"
2679 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2680 else
2681 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2683 echores "$_runtime_cpudetection"
2686 echocheck "restrict keyword"
2687 for restrict_keyword in restrict __restrict __restrict__ ; do
2688 echo "void foo(char * $restrict_keyword p); int main(void){}" > $TMPC
2689 if cc_check; then
2690 _def_restrict_keyword=$restrict_keyword
2691 break;
2693 done
2694 if [ -n "$_def_restrict_keyword" ]; then
2695 echores "$_def_restrict_keyword"
2696 else
2697 echores "none"
2699 # Avoid infinite recursion loop ("#define restrict restrict")
2700 if [ "$_def_restrict_keyword" != "restrict" ]; then
2701 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2702 else
2703 _def_restrict_keyword=""
2707 echocheck "__builtin_expect"
2708 # GCC branch prediction hint
2709 cat > $TMPC << EOF
2710 int foo (int a) {
2711 a = __builtin_expect (a, 10);
2712 return a == 10 ? 0 : 1;
2714 int main(void) { return foo(10) && foo(0); }
2716 _builtin_expect=no
2717 cc_check && _builtin_expect=yes
2718 if test "$_builtin_expect" = yes ; then
2719 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2720 else
2721 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2723 echores "$_builtin_expect"
2726 echocheck "kstat"
2727 cat > $TMPC << EOF
2728 #include <kstat.h>
2729 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2731 _kstat=no
2732 cc_check -lkstat && _kstat=yes
2733 if test "$_kstat" = yes ; then
2734 _def_kstat="#define HAVE_LIBKSTAT 1"
2735 _ld_extra="$_ld_extra -lkstat"
2736 else
2737 _def_kstat="#undef HAVE_LIBKSTAT"
2739 echores "$_kstat"
2742 echocheck "posix4"
2743 # required for nanosleep on some systems
2744 cat > $TMPC << EOF
2745 #include <time.h>
2746 int main(void) { (void) nanosleep(0, 0); return 0; }
2748 _posix4=no
2749 cc_check -lposix4 && _posix4=yes
2750 if test "$_posix4" = yes ; then
2751 _ld_extra="$_ld_extra -lposix4"
2753 echores "$_posix4"
2755 echocheck "lrintf"
2756 cat > $TMPC << EOF
2757 #include <math.h>
2758 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2760 _lrintf=no
2761 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2762 if test "$_lrintf" = yes ; then
2763 _def_lrintf="#define HAVE_LRINTF 1"
2764 else
2765 _def_lrintf="#undef HAVE_LRINTF"
2767 echores "$_lrintf"
2770 echocheck "mkstemp"
2771 cat > $TMPC << EOF
2772 #include <stdlib.h>
2773 int main(void) { char a; mkstemp(&a); return 0; }
2775 _mkstemp=no
2776 cc_check && _mkstemp=yes
2777 if test "$_mkstemp" = yes ; then
2778 _def_mkstemp='#define HAVE_MKSTEMP 1'
2779 else
2780 _def_mkstemp='#undef HAVE_MKSTEMP'
2782 echores "$_mkstemp"
2785 echocheck "nanosleep"
2786 # also check for nanosleep
2787 cat > $TMPC << EOF
2788 #include <time.h>
2789 int main(void) { (void) nanosleep(0, 0); return 0; }
2791 _nanosleep=no
2792 cc_check && _nanosleep=yes
2793 if test "$_nanosleep" = yes ; then
2794 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2795 else
2796 _def_nanosleep='#undef HAVE_NANOSLEEP'
2798 echores "$_nanosleep"
2801 echocheck "socklib"
2802 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2803 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2804 cat > $TMPC << EOF
2805 #include <netdb.h>
2806 #include <sys/socket.h>
2807 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2809 _socklib=no
2810 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2811 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2812 done
2813 if test $_winsock2 = auto && ! cygwin ; then
2814 _winsock2=no
2815 cat > $TMPC << EOF
2816 #include <winsock2.h>
2817 int main(void) { (void) gethostbyname(0); return 0; }
2819 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2821 test "$_ld_sock" && _res_comment="using $_ld_sock"
2822 echores "$_socklib"
2825 if test $_winsock2 = yes ; then
2826 _ld_sock="-lws2_32"
2827 _def_winsock2='#define HAVE_WINSOCK2 1'
2828 else
2829 _def_winsock2='#undef HAVE_WINSOCK2'
2833 _use_aton=no
2834 echocheck "inet_pton()"
2835 cat > $TMPC << EOF
2836 #include <sys/types.h>
2837 #include <sys/socket.h>
2838 #include <arpa/inet.h>
2839 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2841 if test "$_winsock2" = yes ; then
2842 _res_comment="using winsock2 functions instead"
2843 echores "no"
2844 elif cc_check $_ld_sock ; then
2845 # NOTE: Linux has libresolv but does not need it
2847 _res_comment="using $_ld_sock"
2848 echores "yes"
2849 elif cc_check $_ld_sock -lresolv ; then
2850 # NOTE: needed for SunOS at least
2851 _ld_sock="$_ld_sock -lresolv"
2852 _res_comment="using $_ld_sock"
2853 echores "yes"
2854 else
2855 _res_comment="trying inet_aton next"
2856 echores "no"
2858 echocheck "inet_aton()"
2859 cat > $TMPC << EOF
2860 #include <sys/types.h>
2861 #include <sys/socket.h>
2862 #include <arpa/inet.h>
2863 int main(void) { (void) inet_aton(0, 0); return 0; }
2865 _use_aton=yes
2866 if cc_check $_ld_sock ; then
2867 # NOTE: Linux has libresolv but does not need it
2869 _res_comment="using $_ld_sock"
2870 elif cc_check $_ld_sock -lresolv ; then
2871 # NOTE: needed for SunOS at least
2872 _ld_sock="$_ld_sock -lresolv"
2873 _res_comment="using $_ld_sock"
2874 else
2875 _use_aton=no
2876 _network=no
2877 _res_comment="network support disabled"
2879 echores "$_use_aton"
2882 _def_use_aton='#undef USE_ATON'
2883 if test "$_use_aton" = yes; then
2884 _def_use_aton='#define USE_ATON 1'
2887 echocheck "network"
2888 # FIXME network check
2889 if test "$_network" = yes ; then
2890 _def_network='#define MPLAYER_NETWORK 1'
2891 _ld_extra="$_ld_extra $_ld_sock"
2892 _inputmodules="network $_inputmodules"
2893 else
2894 _noinputmodules="network $_noinputmodules"
2895 _def_network='#undef MPLAYER_NETWORK'
2896 _ftp=no
2898 echores "$_network"
2900 echocheck "inttypes.h (required)"
2901 cat > $TMPC << EOF
2902 #include <inttypes.h>
2903 int main(void) { return 0; }
2905 _inttypes=no
2906 cc_check && _inttypes=yes
2907 echores "$_inttypes"
2909 if test "$_inttypes" = no ; then
2910 echocheck "bitypes.h (inttypes.h predecessor)"
2911 cat > $TMPC << EOF
2912 #include <sys/bitypes.h>
2913 int main(void) { return 0; }
2915 cc_check && _inttypes=yes
2916 if test "$_inttypes" = yes ; then
2917 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."
2918 else
2919 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2924 echocheck "int_fastXY_t in inttypes.h"
2925 cat > $TMPC << EOF
2926 #include <inttypes.h>
2927 int main(void) {
2928 volatile int_fast16_t v= 0;
2929 return v; }
2931 _fast_inttypes=no
2932 cc_check && _fast_inttypes=yes
2933 if test "$_fast_inttypes" = no ; then
2934 _def_fast_inttypes='
2935 typedef signed char int_fast8_t;
2936 typedef signed int int_fast16_t;
2937 typedef signed int int_fast32_t;
2938 typedef signed long long int_fast64_t;
2939 typedef unsigned char uint_fast8_t;
2940 typedef unsigned int uint_fast16_t;
2941 typedef unsigned int uint_fast32_t;
2942 typedef unsigned long long uint_fast64_t;'
2944 echores "$_fast_inttypes"
2947 echocheck "word size"
2948 _mp_wordsize="#undef MP_WORDSIZE"
2949 cat > $TMPC << EOF
2950 #include <stdio.h>
2951 #include <sys/types.h>
2952 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2954 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2955 echores "$_wordsize"
2958 echocheck "malloc.h"
2959 cat > $TMPC << EOF
2960 #include <malloc.h>
2961 int main(void) { (void) malloc(0); return 0; }
2963 _malloc=no
2964 cc_check && _malloc=yes
2965 if test "$_malloc" = yes ; then
2966 _def_malloc='#define HAVE_MALLOC_H 1'
2967 else
2968 _def_malloc='#undef HAVE_MALLOC_H'
2970 # malloc.h emits a warning in FreeBSD and OpenBSD
2971 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2972 echores "$_malloc"
2975 echocheck "memalign()"
2976 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2977 cat > $TMPC << EOF
2978 #include <malloc.h>
2979 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2981 _memalign=no
2982 cc_check && _memalign=yes
2983 if test "$_memalign" = yes ; then
2984 _def_memalign='#define HAVE_MEMALIGN 1'
2985 else
2986 _def_memalign='#undef HAVE_MEMALIGN'
2987 _def_map_memalign='#define memalign(a,b) malloc(b)'
2988 darwin || _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2990 echores "$_memalign"
2993 echocheck "alloca.h"
2994 cat > $TMPC << EOF
2995 #include <alloca.h>
2996 int main(void) { (void) alloca(0); return 0; }
2998 _alloca=no
2999 cc_check && _alloca=yes
3000 if cc_check ; then
3001 _def_alloca='#define HAVE_ALLOCA_H 1'
3002 else
3003 _def_alloca='#undef HAVE_ALLOCA_H'
3005 echores "$_alloca"
3008 echocheck "mman.h"
3009 cat > $TMPC << EOF
3010 #include <sys/types.h>
3011 #include <sys/mman.h>
3012 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3014 _mman=no
3015 cc_check && _mman=yes
3016 if test "$_mman" = yes ; then
3017 _def_mman='#define HAVE_SYS_MMAN_H 1'
3018 else
3019 _def_mman='#undef HAVE_SYS_MMAN_H'
3021 echores "$_mman"
3023 cat > $TMPC << EOF
3024 #include <sys/types.h>
3025 #include <sys/mman.h>
3026 int main(void) { void *p = MAP_FAILED; return 0; }
3028 _mman_has_map_failed=no
3029 cc_check && _mman_has_map_failed=yes
3030 if test "$_mman_has_map_failed" = yes ; then
3031 _def_mman_has_map_failed=''
3032 else
3033 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3036 echocheck "dynamic loader"
3037 cat > $TMPC << EOF
3038 #include <dlfcn.h>
3039 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3041 _dl=no
3042 for _ld_tmp in "" "-ldl" ; do
3043 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3044 done
3045 if test "$_dl" = yes ; then
3046 _def_dl='#define HAVE_LIBDL 1'
3047 else
3048 _def_dl='#undef HAVE_LIBDL'
3050 echores "$_dl"
3053 echocheck "dynamic a/v plugins support"
3054 if test "$_dl" = no ; then
3055 _dynamic_plugins=no
3057 if test "$_dynamic_plugins" = yes ; then
3058 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3059 else
3060 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3062 echores "$_dynamic_plugins"
3065 _def_threads='#undef HAVE_THREADS'
3067 echocheck "pthread"
3068 if test "$_pthreads" = auto ; then
3069 cat > $TMPC << EOF
3070 #include <pthread.h>
3071 void* func(void *arg) { return arg; }
3072 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3074 _pthreads=no
3075 if ! hpux ; then
3076 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3077 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3078 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3079 done
3082 if test "$_pthreads" = yes ; then
3083 _res_comment="using $_ld_pthread"
3084 _def_pthreads='#define HAVE_PTHREADS 1'
3085 _def_threads='#define HAVE_THREADS 1'
3086 else
3087 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3088 _def_pthreads='#undef HAVE_PTHREADS'
3089 _nas=no ; _tv_v4l1=no ; _macosx=no
3090 mingw32 || _win32dll=no
3092 echores "$_pthreads"
3094 echocheck "w32threads"
3095 if test "$_pthreads" = yes ; then
3096 _res_comment="using pthread instead"
3097 _w32threads=no
3099 if test "$_w32threads" = auto ; then
3100 _w32threads=no
3101 mingw32 && _w32threads=yes
3103 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3104 echores "$_w32threads"
3106 echocheck "rpath"
3107 netbsd &&_rpath=yes
3108 if test "$_rpath" = yes ; then
3109 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3110 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3111 done
3112 _ld_extra=$tmp
3114 echores "$_rpath"
3116 echocheck "iconv"
3117 if test "$_iconv" = auto ; then
3118 cat > $TMPC << EOF
3119 #include <stdio.h>
3120 #include <unistd.h>
3121 #include <iconv.h>
3122 #define INBUFSIZE 1024
3123 #define OUTBUFSIZE 4096
3125 char inbuffer[INBUFSIZE];
3126 char outbuffer[OUTBUFSIZE];
3128 int main(void) {
3129 size_t numread;
3130 iconv_t icdsc;
3131 char *tocode="UTF-8";
3132 char *fromcode="cp1250";
3133 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3134 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3135 char *iptr=inbuffer;
3136 char *optr=outbuffer;
3137 size_t inleft=numread;
3138 size_t outleft=OUTBUFSIZE;
3139 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3140 != (size_t)(-1)) {
3141 write (1, outbuffer, OUTBUFSIZE - outleft);
3144 if (iconv_close(icdsc) == -1)
3149 _iconv=no
3150 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3151 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3152 _iconv=yes && break
3153 done
3155 if test "$_iconv" = yes ; then
3156 _def_iconv='#define USE_ICONV 1'
3157 else
3158 _def_iconv='#undef USE_ICONV'
3160 echores "$_iconv"
3163 echocheck "soundcard.h"
3164 _soundcard_h=no
3165 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3166 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3167 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3168 cat > $TMPC << EOF
3169 #include <$_soundcard_header>
3170 int main(void) { return 0; }
3172 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3173 done
3175 if test "$_soundcard_h" = yes ; then
3176 if test $_soundcard_header = "sys/soundcard.h"; then
3177 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3178 else
3179 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3182 echores "$_soundcard_h"
3185 echocheck "sys/dvdio.h"
3186 cat > $TMPC << EOF
3187 #include <unistd.h>
3188 #include <sys/dvdio.h>
3189 int main(void) { return 0; }
3191 _dvdio=no
3192 cc_check && _dvdio=yes
3193 if test "$_dvdio" = yes ; then
3194 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3195 else
3196 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3198 echores "$_dvdio"
3201 echocheck "sys/cdio.h"
3202 cat > $TMPC << EOF
3203 #include <unistd.h>
3204 #include <sys/cdio.h>
3205 int main(void) { return 0; }
3207 _cdio=no
3208 cc_check && _cdio=yes
3209 if test "$_cdio" = yes ; then
3210 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3211 else
3212 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3214 echores "$_cdio"
3217 echocheck "linux/cdrom.h"
3218 cat > $TMPC << EOF
3219 #include <sys/types.h>
3220 #include <linux/cdrom.h>
3221 int main(void) { return 0; }
3223 _cdrom=no
3224 cc_check && _cdrom=yes
3225 if test "$_cdrom" = yes ; then
3226 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3227 else
3228 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3230 echores "$_cdrom"
3233 echocheck "dvd.h"
3234 cat > $TMPC << EOF
3235 #include <dvd.h>
3236 int main(void) { return 0; }
3238 _dvd=no
3239 cc_check && _dvd=yes
3240 if test "$_dvd" = yes ; then
3241 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3242 else
3243 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3245 echores "$_dvd"
3248 if bsdos; then
3249 echocheck "BSDI dvd.h"
3250 cat > $TMPC << EOF
3251 #include <dvd.h>
3252 int main(void) { return 0; }
3254 _bsdi_dvd=no
3255 cc_check && _bsdi_dvd=yes
3256 if test "$_bsdi_dvd" = yes ; then
3257 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3258 else
3259 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3261 echores "$_bsdi_dvd"
3262 fi #if bsdos
3265 if hpux; then
3266 # also used by AIX, but AIX does not support VCD and/or libdvdread
3267 echocheck "HP-UX SCSI header"
3268 cat > $TMPC << EOF
3269 #include <sys/scsi.h>
3270 int main(void) { return 0; }
3272 _hpux_scsi_h=no
3273 cc_check && _hpux_scsi_h=yes
3274 if test "$_hpux_scsi_h" = yes ; then
3275 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3276 else
3277 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3279 echores "$_hpux_scsi_h"
3280 fi #if hpux
3283 if sunos; then
3284 echocheck "userspace SCSI headers (Solaris)"
3285 cat > $TMPC << EOF
3286 # include <unistd.h>
3287 # include <stropts.h>
3288 # include <sys/scsi/scsi_types.h>
3289 # include <sys/scsi/impl/uscsi.h>
3290 int main(void) { return 0; }
3292 _sol_scsi_h=no
3293 cc_check && _sol_scsi_h=yes
3294 if test "$_sol_scsi_h" = yes ; then
3295 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3296 else
3297 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3299 echores "$_sol_scsi_h"
3300 fi #if sunos
3303 echocheck "termcap"
3304 if test "$_termcap" = auto ; then
3305 cat > $TMPC <<EOF
3306 int main(void) { tgetent(); return 0; }
3308 _termcap=no
3309 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3310 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3311 && _termcap=yes && break
3312 done
3314 if test "$_termcap" = yes ; then
3315 _def_termcap='#define USE_TERMCAP 1'
3316 _res_comment="using $_ld_tmp"
3317 else
3318 _def_termcap='#undef USE_TERMCAP'
3320 echores "$_termcap"
3323 echocheck "termios"
3324 _def_termios='#undef HAVE_TERMIOS'
3325 _def_termios_h='#undef HAVE_TERMIOS_H'
3326 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3327 if test "$_termios" = auto ; then
3328 _termios=no
3329 for _termios_header in "sys/termios.h" "termios.h"; do
3330 cat > $TMPC <<EOF
3331 #include <$_termios_header>
3332 int main(void) { return 0; }
3334 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3335 done
3338 if test "$_termios" = yes ; then
3339 _def_termios='#define HAVE_TERMIOS 1'
3340 if test "$_termios_header" = "termios.h" ; then
3341 _def_termios_h='#define HAVE_TERMIOS_H 1'
3342 else
3343 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3346 echores "$_termios"
3349 echocheck "shm"
3350 if test "$_shm" = auto ; then
3351 cat > $TMPC << EOF
3352 #include <sys/types.h>
3353 #include <sys/shm.h>
3354 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3356 _shm=no
3357 cc_check && _shm=yes
3359 if test "$_shm" = yes ; then
3360 _def_shm='#define HAVE_SHM 1'
3361 else
3362 _def_shm='#undef HAVE_SHM'
3364 echores "$_shm"
3367 echocheck "strsep()"
3368 cat > $TMPC << EOF
3369 #include <string.h>
3370 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3372 _strsep=no
3373 cc_check && _strsep=yes
3374 if test "$_strsep" = yes ; then
3375 _def_strsep='#define HAVE_STRSEP 1'
3376 _need_strsep=no
3377 else
3378 _def_strsep='#undef HAVE_STRSEP'
3379 _need_strsep=yes
3381 echores "$_strsep"
3384 echocheck "vsscanf()"
3385 cat > $TMPC << EOF
3386 #include <stdarg.h>
3387 int main(void) { vsscanf(0, 0, 0); return 0; }
3389 _vsscanf=no
3390 cc_check && _vsscanf=yes
3391 if test "$_vsscanf" = yes ; then
3392 _def_vsscanf='#define HAVE_VSSCANF 1'
3393 _need_vsscanf=no
3394 else
3395 _def_vsscanf='#undef HAVE_VSSCANF'
3396 _need_vsscanf=yes
3398 echores "$_vsscanf"
3401 echocheck "swab()"
3402 cat > $TMPC << EOF
3403 #include <unistd.h>
3404 int main(void) { swab(0, 0, 0); return 0; }
3406 _swab=no
3407 cc_check && _swab=yes
3408 if test "$_swab" = yes ; then
3409 _def_swab='#define HAVE_SWAB 1'
3410 _need_swab=no
3411 else
3412 _def_swab='#undef HAVE_SWAB'
3413 _need_swab=yes
3415 echores "$_swab"
3417 echocheck "POSIX select()"
3418 cat > $TMPC << EOF
3419 #include <stdio.h>
3420 #include <stdlib.h>
3421 #include <sys/types.h>
3422 #include <string.h>
3423 #include <sys/time.h>
3424 #include <unistd.h>
3425 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3427 _posix_select=no
3428 _def_posix_select='#undef HAVE_POSIX_SELECT'
3429 cc_check && _posix_select=yes \
3430 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3431 echores "$_posix_select"
3434 echocheck "gettimeofday()"
3435 cat > $TMPC << EOF
3436 #include <stdio.h>
3437 #include <sys/time.h>
3438 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3440 _gettimeofday=no
3441 cc_check && _gettimeofday=yes
3442 if test "$_gettimeofday" = yes ; then
3443 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3444 _need_gettimeofday=no
3445 else
3446 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3447 _need_gettimeofday=yes
3449 echores "$_gettimeofday"
3452 echocheck "glob()"
3453 cat > $TMPC << EOF
3454 #include <stdio.h>
3455 #include <glob.h>
3456 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3458 _glob=no
3459 cc_check && _glob=yes
3460 if test "$_glob" = yes ; then
3461 _def_glob='#define HAVE_GLOB 1'
3462 _need_glob=no
3463 else
3464 _def_glob='#undef HAVE_GLOB'
3465 _need_glob=yes
3467 echores "$_glob"
3470 echocheck "setenv()"
3471 cat > $TMPC << EOF
3472 #include <stdlib.h>
3473 int main (void){ setenv("","",0); return 0; }
3475 _setenv=no
3476 cc_check && _setenv=yes
3477 if test "$_setenv" = yes ; then
3478 _def_setenv='#define HAVE_SETENV 1'
3479 _need_setenv=no
3480 else
3481 _def_setenv='#undef HAVE_SETENV'
3482 _need_setenv=yes
3484 echores "$_setenv"
3487 if sunos; then
3488 echocheck "sysi86()"
3489 cat > $TMPC << EOF
3490 #include <sys/sysi86.h>
3491 int main (void) { sysi86(0); return 0; }
3493 _sysi86=no
3494 cc_check && _sysi86=yes
3495 if test "$_sysi86" = yes ; then
3496 _def_sysi86='#define HAVE_SYSI86 1'
3497 cat > $TMPC << EOF
3498 #include <sys/sysi86.h>
3499 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3501 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3502 else
3503 _def_sysi86='#undef HAVE_SYSI86'
3505 echores "$_sysi86"
3506 fi #if sunos
3509 echocheck "sys/sysinfo.h"
3510 cat > $TMPC << EOF
3511 #include <sys/sysinfo.h>
3512 int main(void) {
3513 struct sysinfo s_info;
3514 sysinfo(&s_info);
3515 return 0;
3518 _sys_sysinfo=no
3519 cc_check && _sys_sysinfo=yes
3520 if test "$_sys_sysinfo" = yes ; then
3521 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3522 else
3523 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3525 echores "$_sys_sysinfo"
3528 if darwin; then
3530 echocheck "Mac OS X APIs"
3531 if test "$_macosx" = auto ; then
3532 productName=`/usr/bin/sw_vers -productName`
3533 if test "$productName" = "Mac OS X" ||
3534 test "$productName" = "Mac OS X Server" ; then
3535 _macosx=yes
3536 else
3537 _macosx=no
3538 _def_macosx='#undef MACOSX'
3539 _noaomodules="macosx $_noaomodules"
3540 _novomodules="quartz $_novomodules"
3543 if test "$_macosx" = yes ; then
3544 cat > $TMPC <<EOF
3545 #include <Carbon/Carbon.h>
3546 #include <QuickTime/QuickTime.h>
3547 #include <CoreAudio/CoreAudio.h>
3548 int main(void) {
3549 EnterMovies();
3550 ExitMovies();
3551 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3554 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3555 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3556 _def_macosx='#define MACOSX 1'
3557 _aosrc="$_aosrc ao_macosx.c"
3558 _aomodules="macosx $_aomodules"
3559 _vosrc="$_vosrc vo_quartz.c"
3560 _vomodules="quartz $_vomodules"
3561 else
3562 _macosx=no
3563 _def_macosx='#undef MACOSX'
3564 _noaomodules="macosx $_noaomodules"
3565 _novomodules="quartz $_novomodules"
3567 cat > $TMPC <<EOF
3568 #include <Carbon/Carbon.h>
3569 #include <QuartzCore/CoreVideo.h>
3570 int main(void) {}
3572 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3573 _vosrc="$_vosrc vo_macosx.m"
3574 _vomodules="macosx $_vomodules"
3575 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3576 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3577 _macosx_corevideo=yes
3578 else
3579 _novomodules="macosx $_novomodules"
3580 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3581 _macosx_corevideo=no
3584 echores "$_macosx"
3586 echocheck "Mac OS X Finder Support"
3587 if test "$_macosx_finder_support" = auto ; then
3588 _macosx_finder_support=$_macosx
3590 if test "$_macosx_finder_support" = yes; then
3591 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3592 _macosx_finder_support=yes
3593 else
3594 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3595 _macosx_finder_support=no
3597 echores "$_macosx_finder_support"
3599 echocheck "Mac OS X Bundle file locations"
3600 if test "$_macosx_bundle" = auto ; then
3601 _macosx_bundle=$_macosx_finder_support
3603 if test "$_macosx_bundle" = yes; then
3604 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3605 else
3606 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3607 _macosx_bundle=no
3609 echores "$_macosx_bundle"
3611 echocheck "Apple Remote"
3612 if test "$_apple_remote" = auto ; then
3613 _apple_remote=no
3614 cat > $TMPC <<EOF
3615 #include <stdio.h>
3616 #include <IOKit/IOCFPlugIn.h>
3617 int main (int argc, const char * argv[])
3619 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3620 CFMutableDictionaryRef hidMatchDictionary;
3621 IOReturn ioReturnValue;
3623 // Set up a matching dictionary to search the I/O Registry by class.
3624 // name for all HID class devices
3625 hidMatchDictionary = IOServiceMatching("AppleIRController");
3627 // Now search I/O Registry for matching devices.
3628 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3629 hidMatchDictionary, &hidObjectIterator);
3631 // If search is unsuccessful, return nonzero.
3632 if (ioReturnValue != kIOReturnSuccess ||
3633 !IOIteratorIsValid(hidObjectIterator)) {
3634 return 1;
3636 return 0;
3639 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3641 if test "$_apple_remote" = yes ; then
3642 _def_apple_remote='#define HAVE_APPLE_REMOTE 1'
3643 _ld_extra="$_ld_extra -framework IOKit"
3644 else
3645 _def_apple_remote='#undef HAVE_APPLE_REMOTE'
3647 echores "$_apple_remote"
3649 fi #if darwin
3652 echocheck "pkg-config"
3653 _pkg_config=pkg-config
3654 if `$_pkg_config --version > /dev/null 2>&1`; then
3655 if test "$_ld_static"; then
3656 _pkg_config="$_pkg_config --static"
3658 echores "yes"
3659 else
3660 _pkg_config=false
3661 echores "no"
3665 echocheck "Samba support (libsmbclient)"
3666 if test "$_smbsupport" = yes; then
3667 _ld_extra="$_ld_extra -lsmbclient"
3669 if test "$_smbsupport" = auto; then
3670 _smbsupport=no
3671 cat > $TMPC << EOF
3672 #include <libsmbclient.h>
3673 int main(void) { smbc_opendir("smb://"); return 0; }
3675 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3676 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3677 _smbsupport=yes && break
3678 done
3681 if test "$_smbsupport" = yes; then
3682 _def_smbsupport="#define LIBSMBCLIENT"
3683 _inputmodules="smb $_inputmodules"
3684 else
3685 _def_smbsupport="#undef LIBSMBCLIENT"
3686 _noinputmodules="smb $_noinputmodules"
3688 echores "$_smbsupport"
3691 #########
3692 # VIDEO #
3693 #########
3696 echocheck "tdfxfb"
3697 if test "$_tdfxfb" = yes ; then
3698 _def_tdfxfb='#define HAVE_TDFXFB 1'
3699 _vosrc="$_vosrc vo_tdfxfb.c"
3700 _vomodules="tdfxfb $_vomodules"
3701 else
3702 _def_tdfxfb='#undef HAVE_TDFXFB'
3703 _novomodules="tdfxfb $_novomodules"
3705 echores "$_tdfxfb"
3707 echocheck "s3fb"
3708 if test "$_s3fb" = yes ; then
3709 _def_s3fb='#define HAVE_S3FB 1'
3710 _vosrc="$_vosrc vo_s3fb.c"
3711 _vomodules="s3fb $_vomodules"
3712 else
3713 _def_s3fb='#undef HAVE_S3FB'
3714 _novomodules="s3fb $_novomodules"
3716 echores "$_s3fb"
3718 echocheck "tdfxvid"
3719 if test "$_tdfxvid" = yes ; then
3720 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3721 _vosrc="$_vosrc vo_tdfx_vid.c"
3722 _vomodules="tdfx_vid $_vomodules"
3723 else
3724 _def_tdfxvid='#undef HAVE_TDFX_VID'
3725 _novomodules="tdfx_vid $_novomodules"
3727 echores "$_tdfxvid"
3729 echocheck "xvr100"
3730 if test "$_xvr100" = auto ; then
3731 cat > $TMPC << EOF
3732 #include <unistd.h>
3733 #include <sys/fbio.h>
3734 #include <sys/visual_io.h>
3735 int main(void) {
3736 struct vis_identifier ident;
3737 struct fbgattr attr;
3739 ioctl(0, VIS_GETIDENTIFIER, &ident);
3740 ioctl(0, FBIOGATTR, &attr);
3743 _xvr100=no
3744 cc_check && _xvr100=yes
3746 if test "$_xvr100" = yes ; then
3747 _def_xvr100='#define HAVE_XVR100 1'
3748 _vosrc="$_vosrc vo_xvr100.c"
3749 _vomodules="xvr100 $_vomodules"
3750 else
3751 _def_tdfxvid='#undef HAVE_XVR100'
3752 _novomodules="xvr100 $_novomodules"
3754 echores "$_xvr100"
3756 echocheck "tga"
3757 if test "$_tga" = yes ; then
3758 _def_tga='#define HAVE_TGA 1'
3759 _vosrc="$_vosrc vo_tga.c"
3760 _vomodules="tga $_vomodules"
3761 else
3762 _def_tga='#undef HAVE_TGA'
3763 _novomodules="tga $_novomodules"
3765 echores "$_tga"
3768 echocheck "md5sum support"
3769 if test "$_md5sum" = yes; then
3770 _def_md5sum="#define HAVE_MD5SUM"
3771 _vosrc="$_vosrc vo_md5sum.c"
3772 _vomodules="md5sum $_vomodules"
3773 else
3774 _def_md5sum="#undef HAVE_MD5SUM"
3775 _novomodules="md5sum $_novomodules"
3777 echores "$_md5sum"
3780 echocheck "bl"
3781 if test "$_bl" = yes ; then
3782 _def_bl='#define HAVE_BL 1'
3783 _vosrc="$_vosrc vo_bl.c"
3784 _vomodules="bl $_vomodules"
3785 else
3786 _def_bl='#undef HAVE_BL'
3787 _novomodules="bl $_novomodules"
3789 echores "$_bl"
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; 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 > "$TMPEXE"; then
3818 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | 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 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3827 else
3828 _def_directfb_version='#undef DIRECTFBVERSION'
3829 _directfb=no
3830 _res_comment="version >=0.9.13 required"
3832 else
3833 _directfb=no
3834 _res_comment="failed to get version"
3837 echores "$_directfb"
3839 if test "$_directfb" = yes ; then
3840 _def_directfb='#define HAVE_DIRECTFB 1'
3841 _vosrc="$_vosrc vo_directfb2.c"
3842 _vomodules="directfb $_vomodules"
3843 _libs_mplayer="$_libs_mplayer -ldirectfb"
3844 else
3845 _def_directfb='#undef HAVE_DIRECTFB'
3846 _novomodules="directfb $_novomodules"
3848 if test "$_dfbmga" = yes; 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'
3858 echocheck "X11 headers presence"
3859 _x11_headers="no"
3860 _res_comment="check if the dev(el) packages are installed"
3861 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3862 if test -f "$I/X11/Xlib.h" ; then
3863 _x11_headers="yes"
3864 _res_comment=""
3865 break
3867 done
3868 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3869 if test -f "$I/X11/Xlib.h" ; then
3870 _inc_extra="$_inc_extra -I$I"
3871 _x11_headers="yes"
3872 _res_comment="using $I"
3873 break
3875 done
3876 echores "$_x11_headers"
3879 echocheck "X11"
3880 if test "$_x11" = auto && test "$_x11_headers" = yes ; 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 $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3894 && _x11=yes && break
3895 done
3897 if test "$_x11" = yes ; then
3898 _def_x11='#define HAVE_X11 1'
3899 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3900 _vomodules="x11 xover $_vomodules"
3901 else
3902 _x11=no
3903 _def_x11='#undef HAVE_X11'
3904 _novomodules="x11 $_novomodules"
3905 _res_comment="check if the dev(el) packages are installed"
3906 # disable stuff that depends on X
3907 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
3909 echores "$_x11"
3911 echocheck "Xss screensaver extensions"
3912 if test "$_xss" = auto ; then
3913 cat > $TMPC << EOF
3914 #include <X11/Xlib.h>
3915 #include <X11/extensions/scrnsaver.h>
3916 int main(void) {
3917 XScreenSaverSuspend(NULL, True);
3918 return 0;
3921 _xss=no
3922 cc_check -lXss && _xss=yes
3924 if test "$_xss" = yes ; then
3925 _def_xss='#define HAVE_XSS 1'
3926 _libs_mplayer="$_libs_mplayer -lXss"
3927 else
3928 _def_xss='#undef HAVE_XSS'
3930 echores "$_xss"
3932 echocheck "DPMS"
3933 _xdpms3=no
3934 _xdpms4=no
3935 if test "$_x11" = yes ; then
3936 cat > $TMPC <<EOF
3937 #include <X11/Xmd.h>
3938 #include <X11/Xlib.h>
3939 #include <X11/Xutil.h>
3940 #include <X11/Xatom.h>
3941 #include <X11/extensions/dpms.h>
3942 int main(void) {
3943 (void) DPMSQueryExtension(0, 0, 0);
3946 cc_check -lXdpms && _xdpms3=yes
3947 cat > $TMPC <<EOF
3948 #include <X11/Xlib.h>
3949 #include <X11/extensions/dpms.h>
3950 int main(void) {
3951 (void) DPMSQueryExtension(0, 0, 0);
3954 cc_check -lXext && _xdpms4=yes
3956 if test "$_xdpms4" = yes ; then
3957 _def_xdpms='#define HAVE_XDPMS 1'
3958 _res_comment="using Xdpms 4"
3959 echores "yes"
3960 elif test "$_xdpms3" = yes ; then
3961 _def_xdpms='#define HAVE_XDPMS 1'
3962 _libs_mplayer="$_libs_mplayer -lXdpms"
3963 _res_comment="using Xdpms 3"
3964 echores "yes"
3965 else
3966 _def_xdpms='#undef HAVE_XDPMS'
3967 echores "no"
3971 echocheck "Xv"
3972 if test "$_xv" = auto ; then
3973 cat > $TMPC <<EOF
3974 #include <X11/Xlib.h>
3975 #include <X11/extensions/Xvlib.h>
3976 int main(void) {
3977 (void) XvGetPortAttribute(0, 0, 0, 0);
3978 (void) XvQueryPortAttributes(0, 0, 0);
3979 return 0; }
3981 _xv=no
3982 cc_check -lXv && _xv=yes
3985 if test "$_xv" = yes ; then
3986 _def_xv='#define HAVE_XV 1'
3987 _libs_mplayer="$_libs_mplayer -lXv"
3988 _vosrc="$_vosrc vo_xv.c"
3989 _vomodules="xv $_vomodules"
3990 else
3991 _def_xv='#undef HAVE_XV'
3992 _novomodules="xv $_novomodules"
3994 echores "$_xv"
3997 echocheck "XvMC"
3998 if test "$_xv" = yes && test "$_xvmc" != no ; then
3999 _xvmc=no
4000 cat > $TMPC <<EOF
4001 #include <X11/Xlib.h>
4002 #include <X11/extensions/Xvlib.h>
4003 #include <X11/extensions/XvMClib.h>
4004 int main(void) {
4005 (void) XvMCQueryExtension(0,0,0);
4006 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4007 return 0; }
4009 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4010 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4011 done
4013 if test "$_xvmc" = yes ; then
4014 _def_xvmc='#define HAVE_XVMC 1'
4015 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
4016 _vosrc="$_vosrc vo_xvmc.c"
4017 _vomodules="xvmc $_vomodules"
4018 _res_comment="using $_xvmclib"
4019 else
4020 _def_xvmc='#undef HAVE_XVMC'
4021 _novomodules="xvmc $_novomodules"
4022 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4024 echores "$_xvmc"
4027 echocheck "Xinerama"
4028 if test "$_xinerama" = auto ; then
4029 cat > $TMPC <<EOF
4030 #include <X11/Xlib.h>
4031 #include <X11/extensions/Xinerama.h>
4032 int main(void) { (void) XineramaIsActive(0); return 0; }
4034 _xinerama=no
4035 cc_check -lXinerama && _xinerama=yes
4038 if test "$_xinerama" = yes ; then
4039 _def_xinerama='#define HAVE_XINERAMA 1'
4040 _libs_mplayer="$_libs_mplayer -lXinerama"
4041 else
4042 _def_xinerama='#undef HAVE_XINERAMA'
4044 echores "$_xinerama"
4047 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4048 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4049 # named 'X extensions' or something similar.
4050 # This check may be useful for future mplayer versions (to change resolution)
4051 # If you run into problems, remove '-lXxf86vm'.
4052 echocheck "Xxf86vm"
4053 if test "$_vm" = auto ; then
4054 cat > $TMPC <<EOF
4055 #include <X11/Xlib.h>
4056 #include <X11/extensions/xf86vmode.h>
4057 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4059 _vm=no
4060 cc_check -lXxf86vm && _vm=yes
4062 if test "$_vm" = yes ; then
4063 _def_vm='#define HAVE_XF86VM 1'
4064 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4065 else
4066 _def_vm='#undef HAVE_XF86VM'
4068 echores "$_vm"
4070 # Check for the presence of special keycodes, like audio control buttons
4071 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4072 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4073 # have these new keycodes.
4074 echocheck "XF86keysym"
4075 if test "$_xf86keysym" = auto; then
4076 _xf86keysym=no
4077 cat > $TMPC <<EOF
4078 #include <X11/Xlib.h>
4079 #include <X11/XF86keysym.h>
4080 int main(void) { return XF86XK_AudioPause; }
4082 cc_check && _xf86keysym=yes
4084 if test "$_xf86keysym" = yes ; then
4085 _def_xf86keysym='#define HAVE_XF86XK 1'
4086 else
4087 _def_xf86keysym='#undef HAVE_XF86XK'
4089 echores "$_xf86keysym"
4091 echocheck "DGA"
4092 if test "$_dga2" = auto && test "$_x11" = yes ; then
4093 cat > $TMPC << EOF
4094 #include <X11/Xlib.h>
4095 #include <X11/extensions/xf86dga.h>
4096 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4098 _dga2=no
4099 cc_check -lXxf86dga && _dga2=yes
4101 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4102 cat > $TMPC << EOF
4103 #include <X11/Xlib.h>
4104 #include <X11/extensions/xf86dga.h>
4105 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4107 _dga1=no
4108 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4111 _dga=no
4112 _def_dga='#undef HAVE_DGA'
4113 _def_dga1='#undef HAVE_DGA1'
4114 _def_dga2='#undef HAVE_DGA2'
4115 if test "$_dga1" = yes ; then
4116 _dga=yes
4117 _def_dga1='#define HAVE_DGA1 1'
4118 _res_comment="using DGA 1.0"
4119 elif test "$_dga2" = yes ; then
4120 _dga=yes
4121 _def_dga2='#define HAVE_DGA2 1'
4122 _res_comment="using DGA 2.0"
4124 if test "$_dga" = yes ; then
4125 _def_dga='#define HAVE_DGA 1'
4126 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4127 _vosrc="$_vosrc vo_dga.c"
4128 _vomodules="dga $_vomodules"
4129 else
4130 _novomodules="dga $_novomodules"
4132 echores "$_dga"
4135 echocheck "3dfx"
4136 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4137 _def_3dfx='#define HAVE_3DFX 1'
4138 _vosrc="$_vosrc vo_3dfx.c"
4139 _vomodules="3dfx $_vomodules"
4140 else
4141 _def_3dfx='#undef HAVE_3DFX'
4142 _novomodules="3dfx $_novomodules"
4144 echores "$_3dfx"
4147 echocheck "OpenGL"
4148 #Note: this test is run even with --enable-gl since we autodetect linker flags
4149 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4150 cat > $TMPC << EOF
4151 #include <GL/gl.h>
4152 #ifdef GL_WIN32
4153 #include <windows.h>
4154 #include <GL/glext.h>
4155 #else
4156 #include <X11/Xlib.h>
4157 #include <GL/glx.h>
4158 #endif
4159 int main(void) {
4160 #ifdef GL_WIN32
4161 HDC dc;
4162 wglCreateContext(dc);
4163 #else
4164 glXCreateContext(NULL, NULL, NULL, True);
4165 #endif
4166 glFinish();
4167 return 0;
4170 _gl=no
4171 if cc_check -lGL $_ld_lm ; then
4172 _gl=yes
4173 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4174 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4175 _gl=yes
4176 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4177 elif cc_check -DGL_WIN32 -lopengl32 ; then
4178 _gl=yes
4179 _gl_win32=yes
4180 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4182 else
4183 _gl=no
4185 if test "$_gl" = yes ; then
4186 _def_gl='#define HAVE_GL 1'
4187 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4188 if test "$_gl_win32" = yes ; then
4189 _def_gl_win32='#define GL_WIN32 1'
4190 _vosrc="$_vosrc w32_common.c"
4191 _res_comment="win32 version"
4193 _vomodules="opengl $_vomodules"
4194 else
4195 _def_gl='#undef HAVE_GL'
4196 _def_gl_win32='#undef GL_WIN32'
4197 _novomodules="opengl $_novomodules"
4199 echores "$_gl"
4202 echocheck "VIDIX"
4203 _vidix=no
4204 _def_vidix='#undef CONFIG_VIDIX'
4205 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4206 _vidix_drv_cyberblade=no
4207 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4208 _vidix_drv_ivtv=no
4209 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4210 _vidix_drv_ivtv=no
4211 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4212 _vidix_drv_mach64=no
4213 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4214 _vidix_drv_mga=no
4215 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4216 _vidix_drv_mga_crtc2=no
4217 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4218 _vidix_drv_nvidia=no
4219 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4220 _vidix_drv_pm2=no
4221 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4222 _vidix_drv_pm3=no
4223 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4224 _vidix_drv_radeon=no
4225 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4226 _vidix_drv_rage128=no
4227 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
4228 _vidix_drv_savage=no
4229 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4230 _vidix_drv_sis=no
4231 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4232 _vidix_drv_unichrome=no
4233 if test "$_vidix_internal" = auto ; then
4234 _vidix_internal=no
4235 x86 && _vidix_internal=yes
4236 ppc && linux && _vidix_internal=yes
4237 alpha && linux && _vidix_internal=yes
4238 qnx || beos || darwin && _vidix_internal=no
4240 if test "$_vidix_internal" = yes; then
4241 _res_comment="internal"
4242 _vidix_external=no
4243 _vidix=yes
4244 elif test "$_vidix_external" = auto; then
4245 _vidix_external=no
4246 cat > $TMPC <<EOF
4247 #include <vidix/vidix.h>
4248 int main(void) { return 0; }
4250 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
4251 && _vidix=yes
4253 echores "$_vidix"
4255 if test "$_vidix" = yes ; then
4256 _def_vidix='#define CONFIG_VIDIX 1'
4257 _vosrc="$_vosrc vo_cvidix.c"
4258 _vomodules="cvidix $_vomodules"
4259 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 savage sis unichrome"
4260 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4262 # some vidix drivers are meant to work on x86 only, discard them elsewhere
4263 x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome//`
4265 for driver in $_vidix_drivers ; do
4266 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4267 eval _vidix_drv_${driver}=yes
4268 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4269 done
4270 else
4271 _novomodules="cvidix $_novomodules"
4274 if test "$_vidix_internal" = yes ; then
4275 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
4276 elif test "$_vidix_external" = yes ; then
4277 _libs_mplayer="$_libs_mplayer -lvidix"
4278 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
4281 if test "$_vidix" = yes && win32; then
4282 _vosrc="$_vosrc vo_winvidix.c"
4283 _vomodules="winvidix $_vomodules"
4284 _libs_mplayer="$_libs_mplayer -lgdi32"
4285 else
4286 _novomodules="winvidix $_novomodules"
4288 if test "$_vidix" = yes && test "$_x11" = yes; then
4289 _vosrc="$_vosrc vo_xvidix.c"
4290 _vomodules="xvidix $_vomodules"
4291 else
4292 _novomodules="xvidix $_novomodules"
4295 echocheck "VIDIX PCI device name database"
4296 echores "$_vidix_pcidb"
4297 if test "$_vidix_pcidb" = yes ; then
4298 _vidix_pcidb_val=1
4299 else
4300 _vidix_pcidb_val=0
4303 echocheck "/dev/mga_vid"
4304 if test "$_mga" = auto ; then
4305 _mga=no
4306 test -c /dev/mga_vid && _mga=yes
4308 if test "$_mga" = yes ; then
4309 _def_mga='#define HAVE_MGA 1'
4310 _vosrc="$_vosrc vo_mga.c"
4311 _vomodules="mga $_vomodules"
4312 else
4313 _def_mga='#undef HAVE_MGA'
4314 _novomodules="mga $_novomodules"
4316 echores "$_mga"
4319 echocheck "xmga"
4320 if test "$_xmga" = auto ; then
4321 _xmga=no
4322 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4324 if test "$_xmga" = yes ; then
4325 _def_xmga='#define HAVE_XMGA 1'
4326 _vosrc="$_vosrc vo_xmga.c"
4327 _vomodules="xmga $_vomodules"
4328 else
4329 _def_xmga='#undef HAVE_XMGA'
4330 _novomodules="xmga $_novomodules"
4332 echores "$_xmga"
4335 echocheck "GGI"
4336 if test "$_ggi" = auto ; then
4337 cat > $TMPC << EOF
4338 #include <ggi/ggi.h>
4339 int main(void) { ggiInit(); return 0; }
4341 _ggi=no
4342 cc_check -lggi && _ggi=yes
4344 if test "$_ggi" = yes ; then
4345 _def_ggi='#define HAVE_GGI 1'
4346 _libs_mplayer="$_libs_mplayer -lggi"
4347 _vosrc="$_vosrc vo_ggi.c"
4348 _vomodules="ggi $_vomodules"
4349 else
4350 _def_ggi='#undef HAVE_GGI'
4351 _novomodules="ggi $_novomodules"
4353 echores "$_ggi"
4355 echocheck "GGI extension: libggiwmh"
4356 if test "$_ggiwmh" = auto ; then
4357 _ggiwmh=no
4358 cat > $TMPC << EOF
4359 #include <ggi/ggi.h>
4360 #include <ggi/wmh.h>
4361 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4363 cc_check -lggi -lggiwmh && _ggiwmh=yes
4365 # needed to get right output on obscure combination
4366 # like --disable-ggi --enable-ggiwmh
4367 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4368 _def_ggiwmh='#define HAVE_GGIWMH 1'
4369 _libs_mplayer="$_libs_mplayer -lggiwmh"
4370 else
4371 _ggiwmh=no
4372 _def_ggiwmh='#undef HAVE_GGIWMH'
4374 echores "$_ggiwmh"
4377 echocheck "AA"
4378 if test "$_aa" = auto ; then
4379 cat > $TMPC << EOF
4380 #include <aalib.h>
4381 extern struct aa_hardware_params aa_defparams;
4382 extern struct aa_renderparams aa_defrenderparams;
4383 int main(void) {
4384 aa_context *c;
4385 aa_renderparams *p;
4386 (void) aa_init(0, 0, 0);
4387 c = aa_autoinit(&aa_defparams);
4388 p = aa_getrenderparams();
4389 aa_autoinitkbd(c,0);
4390 return 0; }
4392 _aa=no
4393 for _ld_tmp in "-laa" ; do
4394 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4395 done
4397 if test "$_aa" = yes ; then
4398 _def_aa='#define HAVE_AA 1'
4399 if cygwin ; then
4400 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4402 _vosrc="$_vosrc vo_aa.c"
4403 _vomodules="aa $_vomodules"
4404 else
4405 _def_aa='#undef HAVE_AA'
4406 _novomodules="aa $_novomodules"
4408 echores "$_aa"
4411 echocheck "CACA"
4412 if test "$_caca" = auto ; then
4413 _caca=no
4414 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4415 cat > $TMPC << EOF
4416 #include <caca.h>
4417 #ifdef CACA_API_VERSION_1
4418 #include <caca0.h>
4419 #endif
4420 int main(void) { (void) caca_init(); return 0; }
4422 cc_check `caca-config --libs` && _caca=yes
4425 if test "$_caca" = yes ; then
4426 _def_caca='#define HAVE_CACA 1'
4427 _inc_extra="$_inc_extra `caca-config --cflags`"
4428 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4429 _vosrc="$_vosrc vo_caca.c"
4430 _vomodules="caca $_vomodules"
4431 else
4432 _def_caca='#undef HAVE_CACA'
4433 _novomodules="caca $_novomodules"
4435 echores "$_caca"
4438 echocheck "SVGAlib"
4439 if test "$_svga" = auto ; then
4440 cat > $TMPC << EOF
4441 #include <vga.h>
4442 int main(void) { return 0; }
4444 _svga=no
4445 cc_check -lvga $_ld_lm && _svga=yes
4447 if test "$_svga" = yes ; then
4448 _def_svga='#define HAVE_SVGALIB 1'
4449 _libs_mplayer="$_libs_mplayer -lvga"
4450 _vosrc="$_vosrc vo_svga.c"
4451 _vomodules="svga $_vomodules"
4452 else
4453 _def_svga='#undef HAVE_SVGALIB'
4454 _novomodules="svga $_novomodules"
4456 echores "$_svga"
4459 echocheck "FBDev"
4460 if test "$_fbdev" = auto ; then
4461 _fbdev=no
4462 linux && _fbdev=yes
4464 if test "$_fbdev" = yes ; then
4465 _def_fbdev='#define HAVE_FBDEV 1'
4466 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4467 _vomodules="fbdev $_vomodules"
4468 else
4469 _def_fbdev='#undef HAVE_FBDEV'
4470 _novomodules="fbdev $_novomodules"
4472 echores "$_fbdev"
4476 echocheck "DVB"
4477 if test "$_dvb" = auto ; then
4478 _dvb=no
4479 cat >$TMPC << EOF
4480 #include <sys/poll.h>
4481 #include <sys/ioctl.h>
4482 #include <stdio.h>
4483 #include <time.h>
4484 #include <unistd.h>
4486 #include <ost/dmx.h>
4487 #include <ost/frontend.h>
4488 #include <ost/sec.h>
4489 #include <ost/video.h>
4490 #include <ost/audio.h>
4491 int main(void) {return 0;}
4493 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4494 cc_check $_inc_tmp && _dvb=yes && \
4495 _inc_extra="$_inc_extra $_inc_tmp" && break
4496 done
4498 echores "$_dvb"
4499 if test "$_dvb" = yes ; then
4500 _def_dvb='#define HAVE_DVB 1'
4501 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4502 _aomodules="mpegpes(dvb) $_aomodules"
4503 _vomodules="mpegpes(dvb) $_vomodules"
4506 echocheck "DVB HEAD"
4507 if test "$_dvbhead" = auto ; then
4508 _dvbhead=no
4510 cat >$TMPC << EOF
4511 #include <sys/poll.h>
4512 #include <sys/ioctl.h>
4513 #include <stdio.h>
4514 #include <time.h>
4515 #include <unistd.h>
4517 #include <linux/dvb/dmx.h>
4518 #include <linux/dvb/frontend.h>
4519 #include <linux/dvb/video.h>
4520 #include <linux/dvb/audio.h>
4521 int main(void) {return 0;}
4523 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4524 cc_check $_inc_tmp && _dvbhead=yes && \
4525 _inc_extra="$_inc_extra $_inc_tmp" && break
4526 done
4528 echores "$_dvbhead"
4529 if test "$_dvbhead" = yes ; then
4530 _def_dvb='#define HAVE_DVB_HEAD 1'
4531 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4532 _aomodules="mpegpes(dvb) $_aomodules"
4533 _vomodules="mpegpes(dvb) $_vomodules"
4536 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4537 _def_dvb='#undef HAVE_DVB'
4538 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4539 _aomodules="mpegpes(file) $_aomodules"
4540 _vomodules="mpegpes(file) $_vomodules"
4543 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4544 _dvbin=yes
4545 _inputmodules="dvb $_inputmodules"
4546 else
4547 _dvbin=no
4548 _noinputmodules="dvb $_noinputmodules"
4552 echocheck "zr"
4553 if test "$_zr" = auto ; then
4554 #36067's seem to identify themselves as 36057PQC's, so the line
4555 #below should work for 36067's and 36057's.
4556 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
4557 _zr=yes
4558 else
4559 _zr=no
4562 if test "$_zr" = yes ; then
4563 if test "$_libavcodec_a" = yes ; then
4564 _def_zr='#define HAVE_ZR 1'
4565 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
4566 _vomodules="zr zr2 $_vomodules"
4567 else
4568 _res_comment="libavcodec (static) is required by zr, sorry"
4569 _novomodules="zr $_novomodules"
4570 _def_zr='#undef HAVE_ZR'
4572 else
4573 _def_zr='#undef HAVE_ZR'
4574 _novomodules="zr zr2 $_novomodules"
4576 echores "$_zr"
4579 echocheck "PNG support"
4580 if test "$_png" = auto ; then
4581 _png=no
4582 if irix ; then
4583 # Don't check for -lpng on irix since it has its own libpng
4584 # incompatible with the GNU libpng
4585 _res_comment="disabled on irix (not GNU libpng)"
4586 else
4587 cat > $TMPC << EOF
4588 #include <png.h>
4589 #include <string.h>
4590 int main(void) {
4591 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4592 printf("libpng: %s\n", png_libpng_ver);
4593 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4596 if cc_check -lpng -lz $_ld_lm ; then
4597 if tmp_run ; then
4598 _png=yes
4599 else
4600 _res_comment="mismatch of library and header versions"
4605 echores "$_png"
4606 if test "$_png" = yes ; then
4607 _def_png='#define HAVE_PNG 1'
4608 _ld_extra="$_ld_extra -lpng -lz"
4609 _vosrc="$_vosrc vo_png.c"
4610 _vomodules="png $_vomodules"
4611 else
4612 _def_png='#undef HAVE_PNG'
4613 _novomodules="png $_novomodules"
4616 echocheck "JPEG support"
4617 if test "$_jpeg" = auto ; then
4618 _jpeg=no
4619 cat > $TMPC << EOF
4620 #include <stdio.h>
4621 #include <stdlib.h>
4622 #include <setjmp.h>
4623 #include <string.h>
4624 #include <jpeglib.h>
4625 int main(void) {
4626 return 0;
4629 if cc_check -ljpeg $_ld_lm ; then
4630 if tmp_run ; then
4631 _jpeg=yes
4635 echores "$_jpeg"
4637 if test "$_jpeg" = yes ; then
4638 _def_jpeg='#define HAVE_JPEG 1'
4639 _vosrc="$_vosrc vo_jpeg.c"
4640 _vomodules="jpeg $_vomodules"
4641 _ld_extra="$_ld_extra -ljpeg"
4642 else
4643 _def_jpeg='#undef HAVE_JPEG'
4644 _novomodules="jpeg $_novomodules"
4649 echocheck "PNM support"
4650 if test "$_pnm" = yes; then
4651 _def_pnm="#define HAVE_PNM"
4652 _vosrc="$_vosrc vo_pnm.c"
4653 _vomodules="pnm $_vomodules"
4654 else
4655 _def_pnm="#undef HAVE_PNM"
4656 _novomodules="pnm $_novomodules"
4658 echores "$_pnm"
4662 echocheck "GIF support"
4663 # This is to appease people who want to force gif support.
4664 # If it is forced to yes, then we still do checks to determine
4665 # which gif library to use.
4666 if test "$_gif" = yes ; then
4667 _force_gif=yes
4668 _gif=auto
4671 if test "$_gif" = auto ; then
4672 _gif=no
4673 cat > $TMPC << EOF
4674 #include <gif_lib.h>
4675 int main(void) {
4676 return 0;
4679 for _ld_gif in "-lungif" "-lgif" ; do
4680 cc_check $_ld_gif && tmp_run && _gif=yes && break
4681 done
4684 # If no library was found, and the user wants support forced,
4685 # then we force it on with libgif, as this is the safest
4686 # assumption IMHO. (libungif & libregif both create symbolic
4687 # links to libgif. We also assume that no x11 support is needed,
4688 # because if you are forcing this, then you _should_ know what
4689 # you are doing. [ Besides, package maintainers should never
4690 # have compiled x11 deps into libungif in the first place. ] )
4691 # </rant>
4692 # --Joey
4693 if test "$_force_gif" = yes && test "$_gif" = no ; then
4694 _gif=yes
4695 _ld_gif="-lgif"
4698 if test "$_gif" = yes ; then
4699 _def_gif='#define HAVE_GIF 1'
4700 _vosrc="$_vosrc vo_gif89a.c"
4701 _codecmodules="gif $_codecmodules"
4702 _vomodules="gif89a $_vomodules"
4703 _res_comment="old version, some encoding functions disabled"
4704 _def_gif_4='#undef HAVE_GIF_4'
4705 _ld_extra="$_ld_extra $_ld_gif"
4707 cat > $TMPC << EOF
4708 #include <signal.h>
4709 #include <gif_lib.h>
4710 void catch() { exit(1); }
4711 int main(void) {
4712 signal(SIGSEGV, catch); // catch segfault
4713 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4714 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4715 return 0;
4718 if cc_check "$_ld_gif" && tmp_run ; then
4719 _def_gif_4='#define HAVE_GIF_4 1'
4720 _res_comment=""
4722 else
4723 _def_gif='#undef HAVE_GIF'
4724 _def_gif_4='#undef HAVE_GIF_4'
4725 _novomodules="gif89a $_novomodules"
4726 _nocodecmodules="gif $_nocodecmodules"
4728 echores "$_gif"
4731 case "$_gif" in yes*)
4732 echocheck "broken giflib workaround"
4733 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4735 cat > $TMPC << EOF
4736 #include <gif_lib.h>
4737 int main(void) {
4738 GifFileType gif;
4739 printf("UserData is at address %p\n", gif.UserData);
4740 return 0;
4743 if cc_check "$_ld_gif" && tmp_run ; then
4744 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4745 echores "disabled"
4746 else
4747 echores "enabled"
4750 esac
4753 echocheck "VESA support"
4754 if test "$_vesa" = auto ; then
4755 cat > $TMPC << EOF
4756 #include <vbe.h>
4757 int main(void) { vbeVersion(); return 0; }
4759 _vesa=no
4760 cc_check -lvbe -llrmi && _vesa=yes
4762 if test "$_vesa" = yes ; then
4763 _def_vesa='#define HAVE_VESA 1'
4764 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4765 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4766 _vomodules="vesa $_vomodules"
4767 else
4768 _def_vesa='#undef HAVE_VESA'
4769 _novomodules="vesa $_novomodules"
4771 echores "$_vesa"
4773 #################
4774 # VIDEO + AUDIO #
4775 #################
4778 echocheck "SDL"
4779 if test -z "$_sdlconfig" ; then
4780 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4781 _sdlconfig="sdl-config"
4782 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4783 _sdlconfig="sdl11-config"
4784 else
4785 _sdlconfig=false
4788 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4789 cat > $TMPC << EOF
4790 #include <SDL.h>
4791 int main(int argc, char *argv[]) {
4792 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4793 return 0;
4796 _sdl=no
4797 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4798 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4799 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4800 if test "$_sdlversion" -gt 116 ; then
4801 if test "$_sdlversion" -lt 121 ; then
4802 _def_sdlbuggy='#define BUGGY_SDL'
4803 else
4804 _def_sdlbuggy='#undef BUGGY_SDL'
4806 _sdl=yes
4811 if test "$_sdl" = yes ; then
4812 _def_sdl='#define HAVE_SDL 1'
4813 if cygwin ; then
4814 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4815 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4816 elif mingw32 ; then
4817 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4818 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4819 else
4820 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4821 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4823 _vosrc="$_vosrc vo_sdl.c"
4824 _vomodules="sdl $_vomodules"
4825 _aosrc="$_aosrc ao_sdl.c"
4826 _aomodules="sdl $_aomodules"
4827 _res_comment="using $_sdlconfig"
4828 else
4829 _def_sdl='#undef HAVE_SDL'
4830 _novomodules="sdl $_novomodules"
4831 _noaomodules="sdl $_noaomodules"
4833 echores "$_sdl"
4836 if win32; then
4838 echocheck "Windows waveout"
4839 if test "$_win32waveout" = auto ; then
4840 cat > $TMPC << EOF
4841 #include <windows.h>
4842 #include <mmsystem.h>
4843 int main(void) { return 0; }
4845 _win32waveout=no
4846 cc_check -lwinmm && _win32waveout=yes
4848 if test "$_win32waveout" = yes ; then
4849 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4850 _libs_mplayer="$_libs_mplayer -lwinmm"
4851 _aosrc="$_aosrc ao_win32.c"
4852 _aomodules="win32 $_aomodules"
4853 else
4854 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4855 _noaomodules="win32 $_noaomodules"
4857 echores "$_win32waveout"
4859 echocheck "Directx"
4860 if test "$_directx" = auto ; then
4861 cat > $TMPC << EOF
4862 #include <windows.h>
4863 #include <ddraw.h>
4864 #include <dsound.h>
4865 int main(void) { return 0; }
4867 _directx=no
4868 cc_check -lgdi32 && _directx=yes
4870 if test "$_directx" = yes ; then
4871 _def_directx='#define HAVE_DIRECTX 1'
4872 _libs_mplayer="$_libs_mplayer -lgdi32"
4873 _vosrc="$_vosrc vo_directx.c"
4874 _vomodules="directx $_vomodules"
4875 _aosrc="$_aosrc ao_dsound.c"
4876 _aomodules="dsound $_aomodules"
4877 else
4878 _def_directx='#undef HAVE_DIRECTX'
4879 _novomodules="directx $_novomodules"
4880 _noaomodules="dsound $_noaomodules"
4882 echores "$_directx"
4884 fi #if win32; then
4887 echocheck "NAS"
4888 if test "$_nas" = auto ; then
4889 cat > $TMPC << EOF
4890 #include <audio/audiolib.h>
4891 int main(void) { return 0; }
4893 _nas=no
4894 cc_check $_ld_lm -laudio -lXt && _nas=yes
4896 if test "$_nas" = yes ; then
4897 _def_nas='#define HAVE_NAS 1'
4898 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4899 _aosrc="$_aosrc ao_nas.c"
4900 _aomodules="nas $_aomodules"
4901 else
4902 _noaomodules="nas $_noaomodules"
4903 _def_nas='#undef HAVE_NAS'
4905 echores "$_nas"
4907 echocheck "DXR2"
4908 if test "$_dxr2" = auto; then
4909 _dxr2=no
4910 cat > $TMPC << EOF
4911 #include <dxr2ioctl.h>
4912 int main(void) { return 0; }
4914 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4915 cc_check $_inc_tmp && _dxr2=yes && \
4916 _inc_extra="$_inc_extra $_inc_tmp" && break
4917 done
4919 if test "$_dxr2" = yes; then
4920 _def_dxr2='#define HAVE_DXR2 1'
4921 _vosrc="$_vosrc vo_dxr2.c"
4922 _aosrc="$_aosrc ao_dxr2.c"
4923 _aomodules="dxr2 $_aomodules"
4924 _vomodules="dxr2 $_vomodules"
4925 else
4926 _def_dxr2='#undef HAVE_DXR2'
4927 _noaomodules="dxr2 $_noaomodules"
4928 _novomodules="dxr2 $_novomodules"
4930 echores "$_dxr2"
4932 echocheck "DXR3/H+"
4933 if test "$_dxr3" = auto ; then
4934 cat > $TMPC << EOF
4935 #include <linux/em8300.h>
4936 int main(void) { return 0; }
4938 _dxr3=no
4939 cc_check && _dxr3=yes
4941 if test "$_dxr3" = yes ; then
4942 _def_dxr3='#define HAVE_DXR3 1'
4943 _vosrc="$_vosrc vo_dxr3.c"
4944 _vomodules="dxr3 $_vomodules"
4945 else
4946 _def_dxr3='#undef HAVE_DXR3'
4947 _novomodules="dxr3 $_novomodules"
4949 echores "$_dxr3"
4952 echocheck "IVTV TV-Out"
4953 if test "$_ivtv" = auto ; then
4954 cat > $TMPC << EOF
4955 #include <stdlib.h>
4956 #include <inttypes.h>
4957 #include <linux/types.h>
4958 #include <linux/videodev2.h>
4959 #include <linux/ivtv.h>
4960 int main(void) { return 0; }
4962 _ivtv=no
4963 cc_check && _ivtv=yes
4965 if test "$_ivtv" = yes ; then
4966 _def_ivtv='#define HAVE_IVTV 1'
4967 _vosrc="$_vosrc vo_ivtv.c"
4968 _vomodules="ivtv $_vomodules"
4969 _aosrc="$_aosrc ao_ivtv.c"
4970 _aomodules="ivtv $_aomodules"
4971 else
4972 _def_ivtv='#undef HAVE_IVTV'
4973 _novomodules="ivtv $_novomodules"
4974 _noaomodules="ivtv $_noaomodules"
4976 echores "$_ivtv"
4979 echocheck "V4L2 MPEG Decoder"
4980 if test "$_v4l2" = auto ; then
4981 cat > $TMPC << EOF
4982 #include <stdlib.h>
4983 #include <inttypes.h>
4984 #include <linux/types.h>
4985 #include <linux/videodev2.h>
4986 #include <linux/version.h>
4987 int main(void) {
4988 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4989 #error kernel headers too old, need 2.6.22
4990 bad_kernel_version();
4991 #endif
4992 struct v4l2_ext_controls ctrls;
4993 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4994 return 0;
4997 _v4l2=no
4998 cc_check && _v4l2=yes
5000 if test "$_v4l2" = yes ; then
5001 _def_v4l2='#define HAVE_V4L2_DECODER 1'
5002 _vosrc="$_vosrc vo_v4l2.c"
5003 _vomodules="v4l2 $_vomodules"
5004 _aosrc="$_aosrc ao_v4l2.c"
5005 _aomodules="v4l2 $_aomodules"
5006 else
5007 _def_v4l2='#undef HAVE_V4L2_DECODER'
5008 _novomodules="v4l2 $_novomodules"
5009 _noaomodules="v4l2 $_noaomodules"
5011 echores "$_v4l2"
5015 #########
5016 # AUDIO #
5017 #########
5020 echocheck "OSS Audio"
5021 if test "$_ossaudio" = auto ; then
5022 cat > $TMPC << EOF
5023 #include <sys/ioctl.h>
5024 #include <$_soundcard_header>
5025 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5027 _ossaudio=no
5028 cc_check && _ossaudio=yes
5030 if test "$_ossaudio" = yes ; then
5031 _def_ossaudio='#define USE_OSS_AUDIO 1'
5032 _aosrc="$_aosrc ao_oss.c"
5033 _aomodules="oss $_aomodules"
5034 if test "$_linux_devfs" = yes; then
5035 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5036 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5037 else
5038 cat > $TMPC << EOF
5039 #include <sys/ioctl.h>
5040 #include <$_soundcard_header>
5041 #ifdef OPEN_SOUND_SYSTEM
5042 int main(void) { return 0; }
5043 #else
5044 #error Not the real thing
5045 #endif
5047 _real_ossaudio=no
5048 cc_check && _real_ossaudio=yes
5049 if test "$_real_ossaudio" = yes; then
5050 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5051 elif netbsd || openbsd ; then
5052 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5053 _ld_extra="$_ld_extra -lossaudio"
5054 else
5055 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5057 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5059 else
5060 _def_ossaudio='#undef USE_OSS_AUDIO'
5061 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5062 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5063 _noaomodules="oss $_noaomodules"
5065 echores "$_ossaudio"
5068 echocheck "aRts"
5069 if test "$_arts" = auto ; then
5070 _arts=no
5071 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5073 cat > $TMPC << EOF
5074 #include <artsc.h>
5075 int main(void) { return 0; }
5077 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5082 if test "$_arts" = yes ; then
5083 _def_arts='#define USE_ARTS 1'
5084 _aosrc="$_aosrc ao_arts.c"
5085 _aomodules="arts $_aomodules"
5086 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5087 _inc_extra="$_inc_extra `artsc-config --cflags`"
5088 else
5089 _noaomodules="arts $_noaomodules"
5091 echores "$_arts"
5094 echocheck "EsounD"
5095 if test "$_esd" = auto ; then
5096 _esd=no
5097 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5099 cat > $TMPC << EOF
5100 #include <esd.h>
5101 int main(void) { int fd = esd_open_sound("test"); return fd; }
5103 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5107 echores "$_esd"
5109 if test "$_esd" = yes ; then
5110 _def_esd='#define USE_ESD 1'
5111 _aosrc="$_aosrc ao_esd.c"
5112 _aomodules="esd $_aomodules"
5113 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5114 _inc_extra="$_inc_extra `esd-config --cflags`"
5116 echocheck "esd_get_latency()"
5117 cat > $TMPC << EOF
5118 #include <esd.h>
5119 int main(void) { return esd_get_latency(0); }
5121 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5122 echores "$_esd_latency"
5123 else
5124 _def_esd='#undef USE_ESD'
5125 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5126 _noaomodules="esd $_noaomodules"
5129 echocheck "pulse"
5130 if test "$_pulse" = auto ; then
5131 _pulse=no
5132 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5134 cat > $TMPC << EOF
5135 #include <pulse/pulseaudio.h>
5136 int main(void) { return 0; }
5138 cc_check `$_pkg_config --libs --cflags libpulse` && tmp_run && _pulse=yes
5142 echores "$_pulse"
5144 if test "$_pulse" = yes ; then
5145 _def_pulse='#define USE_PULSE 1'
5146 _aosrc="$_aosrc ao_pulse.c"
5147 _aomodules="pulse $_aomodules"
5148 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs libpulse`"
5149 _inc_extra="$_inc_extra `$_pkg_config --cflags libpulse`"
5150 else
5151 _def_pulse='#undef USE_PULSE'
5152 _noaomodules="pulse $_noaomodules"
5156 echocheck "JACK"
5157 if test "$_jack" = auto ; then
5158 _jack=yes
5160 cat > $TMPC << EOF
5161 #include <jack/jack.h>
5162 int main(void) { jack_client_new("test"); return 0; }
5164 if cc_check -ljack ; then
5165 _libs_mplayer="$_libs_mplayer -ljack"
5166 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5167 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5168 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5169 else
5170 _jack=no
5174 if test "$_jack" = yes ; then
5175 _def_jack='#define USE_JACK 1'
5176 _aosrc="$_aosrc ao_jack.c"
5177 _aomodules="jack $_aomodules"
5178 else
5179 _noaomodules="jack $_noaomodules"
5181 echores "$_jack"
5183 echocheck "OpenAL"
5184 if test "$_openal" = auto ; then
5185 _openal=no
5186 cat > $TMPC << EOF
5187 #ifdef OPENAL_AL_H
5188 #include <OpenAL/al.h>
5189 #else
5190 #include <AL/al.h>
5191 #endif
5192 int main(void) {
5193 alSourceQueueBuffers(0, 0, 0);
5194 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5195 return 0;
5198 for I in "-lopenal" "-framework OpenAL" ; do
5199 cc_check $I && _openal=yes && break
5200 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5201 done
5202 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5204 if test "$_openal" = yes ; then
5205 _def_openal='#define USE_OPENAL 1'
5206 _aosrc="$_aosrc ao_openal.c"
5207 _aomodules="openal $_aomodules"
5208 else
5209 _noaomodules="openal $_noaomodules"
5211 echores "$_openal"
5213 echocheck "ALSA audio"
5214 if test "$_alsa" != no ; then
5215 _alsa=no
5216 cat > $TMPC << EOF
5217 #include <sys/asoundlib.h>
5218 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5219 #error "alsa version != 0.5.x"
5220 #endif
5221 int main(void) { return 0; }
5223 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5225 cat > $TMPC << EOF
5226 #include <sys/asoundlib.h>
5227 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5228 #error "alsa version != 0.9.x"
5229 #endif
5230 int main(void) { return 0; }
5232 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5233 cat > $TMPC << EOF
5234 #include <alsa/asoundlib.h>
5235 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5236 #error "alsa version != 0.9.x"
5237 #endif
5238 int main(void) { return 0; }
5240 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5242 cat > $TMPC << EOF
5243 #include <sys/asoundlib.h>
5244 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5245 #error "alsa version != 1.0.x"
5246 #endif
5247 int main(void) { return 0; }
5249 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5250 cat > $TMPC << EOF
5251 #include <alsa/asoundlib.h>
5252 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5253 #error "alsa version != 1.0.x"
5254 #endif
5255 int main(void) { return 0; }
5257 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5259 _def_alsa5='#undef HAVE_ALSA5'
5260 _def_alsa9='#undef HAVE_ALSA9'
5261 _def_alsa1x='#undef HAVE_ALSA1X'
5262 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5263 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5264 if test "$_alsaver" ; then
5265 _alsa=yes
5266 if test "$_alsaver" = '0.5.x' ; then
5267 _alsa5=yes
5268 _aosrc="$_aosrc ao_alsa5.c"
5269 _aomodules="alsa5 $_aomodules"
5270 _def_alsa5='#define HAVE_ALSA5 1'
5271 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5272 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5273 elif test "$_alsaver" = '0.9.x-sys' ; then
5274 _alsa9=yes
5275 _aosrc="$_aosrc ao_alsa.c"
5276 _aomodules="alsa $_aomodules"
5277 _def_alsa9='#define HAVE_ALSA9 1'
5278 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5279 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5280 elif test "$_alsaver" = '0.9.x-alsa' ; then
5281 _alsa9=yes
5282 _aosrc="$_aosrc ao_alsa.c"
5283 _aomodules="alsa $_aomodules"
5284 _def_alsa9='#define HAVE_ALSA9 1'
5285 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5286 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5287 elif test "$_alsaver" = '1.0.x-sys' ; then
5288 _alsa1x=yes
5289 _aosrc="$_aosrc ao_alsa.c"
5290 _aomodules="alsa $_aomodules"
5291 _def_alsa1x="#define HAVE_ALSA1X 1"
5292 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5293 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5294 elif test "$_alsaver" = '1.0.x-alsa' ; then
5295 _alsa1x=yes
5296 _aosrc="$_aosrc ao_alsa.c"
5297 _aomodules="alsa $_aomodules"
5298 _def_alsa1x="#define HAVE_ALSA1X 1"
5299 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5300 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5301 else
5302 _alsa=no
5303 _res_comment="unknown version"
5305 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5306 else
5307 _noaomodules="alsa $_noaomodules"
5309 echores "$_alsa"
5312 echocheck "Sun audio"
5313 if test "$_sunaudio" = auto ; then
5314 cat > $TMPC << EOF
5315 #include <sys/types.h>
5316 #include <sys/audioio.h>
5317 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5319 _sunaudio=no
5320 cc_check && _sunaudio=yes
5322 if test "$_sunaudio" = yes ; then
5323 _def_sunaudio='#define USE_SUN_AUDIO 1'
5324 _aosrc="$_aosrc ao_sun.c"
5325 _aomodules="sun $_aomodules"
5326 else
5327 _def_sunaudio='#undef USE_SUN_AUDIO'
5328 _noaomodules="sun $_noaomodules"
5330 echores "$_sunaudio"
5333 if sunos; then
5334 echocheck "Sun mediaLib"
5335 if test "$_mlib" = auto ; then
5336 _mlib=no
5337 cat > $TMPC << EOF
5338 #include <mlib.h>
5339 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5341 cc_check -lmlib && _mlib=yes
5343 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5344 echores "$_mlib"
5345 fi #if sunos
5348 if irix; then
5349 echocheck "SGI audio"
5350 if test "$_sgiaudio" = auto ; then
5351 # check for SGI audio
5352 cat > $TMPC << EOF
5353 #include <dmedia/audio.h>
5354 int main(void) { return 0; }
5356 _sgiaudio=no
5357 cc_check && _sgiaudio=yes
5359 if test "$_sgiaudio" = "yes" ; then
5360 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5361 _libs_mplayer="$_libs_mplayer -laudio"
5362 _aosrc="$_aosrc ao_sgi.c"
5363 _aomodules="sgi $_aomodules"
5364 else
5365 _def_sgiaudio='#undef USE_SGI_AUDIO'
5366 _noaomodules="sgi $_noaomodules"
5368 echores "$_sgiaudio"
5369 fi #if irix
5372 echocheck "VCD support"
5373 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5374 _inputmodules="vcd $_inputmodules"
5375 _def_vcd='#define HAVE_VCD 1'
5376 _vcd="yes"
5377 else
5378 _def_vcd='#undef HAVE_VCD'
5379 _noinputmodules="vcd $_noinputmodules"
5380 _res_comment="not supported on this OS"
5381 _vcd="no"
5383 echores "$_vcd"
5387 echocheck "dvdread"
5388 if test "$_dvdread_internal" = auto ; then
5389 _dvdread_internal=no
5390 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5391 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5392 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5393 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5394 _dvdread_internal=yes
5395 _dvdread=yes
5397 elif test "$_dvdread" = auto ; then
5398 _dvdread=no
5399 if test "$_dl" = yes; then
5400 cat > $TMPC << EOF
5401 #include <inttypes.h>
5402 #include <dvdread/dvd_reader.h>
5403 #include <dvdread/ifo_types.h>
5404 #include <dvdread/ifo_read.h>
5405 #include <dvdread/nav_read.h>
5406 int main(void) { return 0; }
5408 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5409 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5413 if test "$_dvdread_internal" = yes; then
5414 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5415 _def_dvdread='#define USE_DVDREAD 1'
5416 _inputmodules="dvdread(internal) $_inputmodules"
5417 _largefiles=yes
5418 _res_comment="internal"
5419 elif test "$_dvdread" = yes; then
5420 _def_dvdread='#define USE_DVDREAD 1'
5421 _largefiles=yes
5422 _ld_extra="$_ld_extra -ldvdread"
5423 _inputmodules="dvdread(external) $_inputmodules"
5424 _res_comment="external"
5425 else
5426 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5427 _def_dvdread='#undef USE_DVDREAD'
5428 _noinputmodules="dvdread $_noinputmodules"
5430 echores "$_dvdread"
5433 echocheck "internal libdvdcss"
5434 if test "$_libdvdcss_internal" = auto ; then
5435 _libdvdcss_internal=no
5436 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5438 if test "$_libdvdcss_internal" = yes ; then
5439 if linux || netbsd || openbsd || bsdos ; then
5440 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5441 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5442 elif freebsd ; then
5443 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5444 elif darwin ; then
5445 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5446 _ld_extra="$_ld_extra -framework IOKit"
5448 _inputmodules="libdvdcss(internal) $_inputmodules"
5449 _largefiles=yes
5450 else
5451 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5453 echores "$_libdvdcss_internal"
5456 echocheck "cdparanoia"
5457 if test "$_cdparanoia" = auto ; then
5458 cat > $TMPC <<EOF
5459 #include <cdda_interface.h>
5460 #include <cdda_paranoia.h>
5461 // This need a better test. How ?
5462 int main(void) {
5463 void *test = cdda_verbose_set;
5464 return test == (void *)1;
5467 _cdparanoia=no
5468 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5469 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5470 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5471 done
5473 if test "$_cdparanoia" = yes ; then
5474 _cdda='yes'
5475 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5476 openbsd && _ld_extra="$_ld_extra -lutil"
5478 echores "$_cdparanoia"
5481 echocheck "libcdio"
5482 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5483 cat > $TMPC << EOF
5484 #include <stdio.h>
5485 #include <cdio/version.h>
5486 #include <cdio/cdda.h>
5487 #include <cdio/paranoia.h>
5488 int main(void)
5490 void *test = cdda_verbose_set;
5491 printf("%s\n", CDIO_VERSION);
5492 return test == (void *)1;
5496 _libcdio=no
5497 for _ld_tmp in "" "-lwinmm" ; do
5498 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5499 cc_check $_ld_tmp $_ld_lm \
5500 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5501 done
5502 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5503 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5504 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5505 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5506 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5509 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5510 _cdda='yes'
5511 _def_libcdio='#define HAVE_LIBCDIO'
5512 _def_havelibcdio='yes'
5513 else
5514 if test "$_cdparanoia" = yes ; then
5515 _res_comment="using cdparanoia"
5517 _def_libcdio='#undef HAVE_LIBCDIO'
5518 _def_havelibcdio='no'
5520 echores "$_libcdio"
5522 if test "$_cdda" = yes ; then
5523 test $_cddb = auto && test $_network = yes && _cddb=yes
5524 _def_cdparanoia='#define HAVE_CDDA'
5525 _inputmodules="cdda $_inputmodules"
5526 else
5527 _def_cdparanoia='#undef HAVE_CDDA'
5528 _noinputmodules="cdda $_noinputmodules"
5531 if test "$_cddb" = yes ; then
5532 _def_cddb='#define HAVE_CDDB'
5533 _inputmodules="cddb $_inputmodules"
5534 else
5535 _cddb=no
5536 _def_cddb='#undef HAVE_CDDB'
5537 _noinputmodules="cddb $_noinputmodules"
5540 echocheck "bitmap font support"
5541 if test "$_bitmap_font" = yes ; then
5542 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5543 else
5544 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5546 echores "$_bitmap_font"
5549 echocheck "freetype >= 2.0.9"
5551 # freetype depends on iconv
5552 if test "$_iconv" = no ; then
5553 _freetype=no
5554 _res_comment="iconv support needed"
5557 if test "$_freetype" = auto ; then
5558 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5559 cat > $TMPC << EOF
5560 #include <stdio.h>
5561 #include <ft2build.h>
5562 #include FT_FREETYPE_H
5563 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5564 #error "Need FreeType 2.0.9 or newer"
5565 #endif
5566 int main(void)
5568 FT_Library library;
5569 FT_Int major=-1,minor=-1,patch=-1;
5570 int err=FT_Init_FreeType(&library);
5571 if(err){
5572 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5573 exit(err);
5575 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5576 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5577 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5578 (int)major,(int)minor,(int)patch );
5579 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5580 printf("Library and header version mismatch! Fix it in your distribution!\n");
5581 exit(1);
5583 return 0;
5586 _freetype=no
5587 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5588 else
5589 _freetype=no
5592 if test "$_freetype" = yes ; then
5593 _def_freetype='#define HAVE_FREETYPE'
5594 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5595 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5596 else
5597 _def_freetype='#undef HAVE_FREETYPE'
5599 echores "$_freetype"
5601 if test "$_freetype" = no ; then
5602 _fontconfig=no
5603 _res_comment="freetype support needed"
5605 echocheck "fontconfig"
5606 if test "$_fontconfig" = auto ; then
5607 cat > $TMPC << EOF
5608 #include <stdio.h>
5609 #include <fontconfig/fontconfig.h>
5610 int main(void)
5612 int err = FcInit();
5613 if(err == FcFalse){
5614 printf("Couldn't initialize fontconfig lib\n");
5615 exit(err);
5617 return 0;
5621 _fontconfig=no
5622 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5623 _ld_tmp="-lfontconfig $_ld_tmp"
5624 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5625 done
5626 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5627 _inc_tmp=`$_pkg_config --cflags fontconfig`
5628 _ld_tmp=`$_pkg_config --libs fontconfig`
5629 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5630 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5633 if test "$_fontconfig" = yes ; then
5634 _def_fontconfig='#define HAVE_FONTCONFIG'
5635 else
5636 _def_fontconfig='#undef HAVE_FONTCONFIG'
5638 echores "$_fontconfig"
5641 echocheck "SSA/ASS support"
5642 # libass depends on FreeType
5643 if test "$_freetype" = no ; then
5644 _ass=no
5645 _res_comment="FreeType support needed"
5648 if test "$_ass" = auto ; then
5649 cat > $TMPC << EOF
5650 #include <ft2build.h>
5651 #include FT_FREETYPE_H
5652 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5653 #error "Need FreeType 2.1.8 or newer"
5654 #endif
5655 int main(void) { return 0; }
5657 _ass=no
5658 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5659 if test "$_ass" = no ; then
5660 _res_comment="FreeType >= 2.1.8 needed"
5663 if test "$_ass" = yes ; then
5664 _def_ass='#define USE_ASS'
5665 else
5666 _def_ass='#undef USE_ASS'
5668 echores "$_ass"
5671 echocheck "fribidi with charsets"
5672 if test "$_fribidi" = auto ; then
5673 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5674 cat > $TMPC << EOF
5675 #include <stdio.h>
5676 /* workaround for fribidi 0.10.4 and below */
5677 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5678 #include <fribidi/fribidi.h>
5679 int main(void)
5681 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5682 printf("Fribidi headers are not consistents with the library!\n");
5683 exit(1);
5685 return 0;
5688 _fribidi=no
5689 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5690 else
5691 _fribidi=no
5694 if test "$_fribidi" = yes ; then
5695 _def_fribidi='#define USE_FRIBIDI'
5696 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5697 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5698 else
5699 _def_fribidi='#undef USE_FRIBIDI'
5701 echores "$_fribidi"
5704 echocheck "ENCA"
5705 if test "$_enca" = auto ; then
5706 cat > $TMPC << EOF
5707 #include <enca.h>
5708 int main(void)
5710 const char **langs;
5711 size_t langcnt;
5712 langs = enca_get_languages(&langcnt);
5713 return 0;
5716 _enca=no
5717 cc_check -lenca $_ld_lm && _enca=yes
5719 if test "$_enca" = yes ; then
5720 _def_enca='#define HAVE_ENCA 1'
5721 _ld_extra="$_ld_extra -lenca"
5722 else
5723 _def_enca='#undef HAVE_ENCA'
5725 echores "$_enca"
5728 echocheck "zlib"
5729 cat > $TMPC << EOF
5730 #include <zlib.h>
5731 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5733 _zlib=no
5734 cc_check -lz && _zlib=yes
5735 if test "$_zlib" = yes ; then
5736 _def_zlib='#define HAVE_ZLIB 1'
5737 _ld_extra="$_ld_extra -lz"
5738 else
5739 _def_zlib='#undef HAVE_ZLIB'
5740 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5741 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5743 echores "$_zlib"
5746 echocheck "RTC"
5747 if test "$_rtc" = auto ; then
5748 cat > $TMPC << EOF
5749 #include <sys/ioctl.h>
5750 #ifdef __linux__
5751 #include <linux/rtc.h>
5752 #else
5753 #include <rtc.h>
5754 #define RTC_PIE_ON RTCIO_PIE_ON
5755 #endif
5756 int main(void) { return RTC_PIE_ON; }
5758 _rtc=no
5759 cc_check && _rtc=yes
5760 ppc && _rtc=no
5762 if test "$_rtc" = yes ; then
5763 _def_rtc='#define HAVE_RTC 1'
5764 else
5765 _def_rtc='#undef HAVE_RTC'
5767 echores "$_rtc"
5770 echocheck "liblzo2 support"
5771 if test "$_liblzo" = auto ; then
5772 _liblzo=no
5773 cat > $TMPC << EOF
5774 #include <lzo/lzo1x.h>
5775 int main(void) { lzo_init();return 0; }
5777 cc_check -llzo2 && _liblzo=yes
5779 if test "$_liblzo" = yes ; then
5780 _def_liblzo='#define USE_LIBLZO 1'
5781 _ld_extra="$_ld_extra -llzo2"
5782 _codecmodules="liblzo $_codecmodules"
5783 else
5784 _def_liblzo='#undef USE_LIBLZO'
5785 _nocodecmodules="liblzo $_nocodecmodules"
5787 echores "$_liblzo"
5790 echocheck "mad support"
5791 if test "$_mad" = auto ; then
5792 _mad=no
5793 cat > $TMPC << EOF
5794 #include <mad.h>
5795 int main(void) { return 0; }
5797 cc_check -lmad && _mad=yes
5799 if test "$_mad" = yes ; then
5800 _def_mad='#define USE_LIBMAD 1'
5801 _ld_extra="$_ld_extra -lmad"
5802 _codecmodules="libmad $_codecmodules"
5803 else
5804 _def_mad='#undef USE_LIBMAD'
5805 _nocodecmodules="libmad $_nocodecmodules"
5807 echores "$_mad"
5809 echocheck "Twolame"
5810 if test "$_twolame" = auto ; then
5811 cat > $TMPC <<EOF
5812 #include <twolame.h>
5813 int main(void) { twolame_init(); return 0; }
5815 _twolame=no
5816 cc_check -ltwolame $_ld_lm && _twolame=yes
5818 if test "$_twolame" = yes ; then
5819 _def_twolame='#define HAVE_TWOLAME 1'
5820 _libs_mencoder="$_libs_mencoder -ltwolame"
5821 _codecmodules="twolame $_codecmodules"
5822 else
5823 _def_twolame='#undef HAVE_TWOLAME'
5824 _nocodecmodules="twolame $_nocodecmodules"
5826 echores "$_twolame"
5828 echocheck "Toolame"
5829 if test "$_toolame" = auto ; then
5830 _toolame=no
5831 if test "$_twolame" = yes ; then
5832 _res_comment="disabled by twolame"
5833 else
5834 cat > $TMPC <<EOF
5835 #include <toolame.h>
5836 int main(void) { toolame_init(); return 0; }
5838 cc_check -ltoolame $_ld_lm && _toolame=yes
5841 if test "$_toolame" = yes ; then
5842 _def_toolame='#define HAVE_TOOLAME 1'
5843 _libs_mencoder="$_libs_mencoder -ltoolame"
5844 _codecmodules="toolame $_codecmodules"
5845 else
5846 _def_toolame='#undef HAVE_TOOLAME'
5847 _nocodecmodules="toolame $_nocodecmodules"
5849 if test "$_toolamedir" ; then
5850 _res_comment="using $_toolamedir"
5852 echores "$_toolame"
5854 echocheck "OggVorbis support"
5855 if test "$_tremor_internal" = yes; then
5856 _libvorbis=no
5857 elif test "$_tremor_external" = auto; then
5858 _tremor_external=no
5859 cat > $TMPC << EOF
5860 #include <tremor/ivorbiscodec.h>
5861 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5863 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5865 if test "$_libvorbis" = auto; then
5866 _libvorbis=no
5867 cat > $TMPC << EOF
5868 #include <vorbis/codec.h>
5869 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5871 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5873 if test "$_tremor_internal" = yes ; then
5874 _vorbis=yes
5875 _def_vorbis='#define HAVE_OGGVORBIS 1'
5876 _def_tremor='#define TREMOR 1'
5877 _codecmodules="tremor(internal) $_codecmodules"
5878 _res_comment="internal Tremor"
5879 if test "$_tremor_low" = yes ; then
5880 _res_comment="internal low accuracy Tremor"
5882 elif test "$_tremor_external" = yes ; then
5883 _vorbis=yes
5884 _def_vorbis='#define HAVE_OGGVORBIS 1'
5885 _def_tremor='#define TREMOR 1'
5886 _codecmodules="tremor(external) $_codecmodules"
5887 _res_comment="external Tremor"
5888 _ld_extra="$_ld_extra -logg -lvorbisidec"
5889 elif test "$_libvorbis" = yes ; then
5890 _vorbis=yes
5891 _def_vorbis='#define HAVE_OGGVORBIS 1'
5892 _codecmodules="libvorbis $_codecmodules"
5893 _res_comment="libvorbis"
5894 _ld_extra="$_ld_extra -lvorbis -logg"
5895 else
5896 _vorbis=no
5897 _nocodecmodules="libvorbis $_nocodecmodules"
5899 if test "$_libvorbis" = no ; then
5900 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5902 echores "$_vorbis"
5904 echocheck "libspeex (version >= 1.1 required)"
5905 if test "$_speex" = auto ; then
5906 _speex=no
5907 cat > $TMPC << EOF
5908 #include <speex/speex.h>
5909 int main(void) {
5910 SpeexBits bits;
5911 void *dec;
5912 speex_decode_int(dec, &bits, dec);
5915 cc_check -lspeex $_ld_lm && _speex=yes
5917 if test "$_speex" = yes ; then
5918 _def_speex='#define HAVE_SPEEX 1'
5919 _ld_extra="$_ld_extra -lspeex"
5920 _codecmodules="speex $_codecmodules"
5921 else
5922 _def_speex='#undef HAVE_SPEEX'
5923 _nocodecmodules="speex $_nocodecmodules"
5925 echores "$_speex"
5927 echocheck "OggTheora support"
5928 if test "$_theora" = auto ; then
5929 _theora=no
5930 cat > $TMPC << EOF
5931 #include <theora/theora.h>
5932 #include <string.h>
5933 int main(void)
5935 /* theora is in flux, make sure that all interface routines and
5936 * datatypes exist and work the way we expect it, so we don't break
5937 * mplayer */
5938 ogg_packet op;
5939 theora_comment tc;
5940 theora_info inf;
5941 theora_state st;
5942 yuv_buffer yuv;
5943 int r;
5944 double t;
5946 theora_info_init (&inf);
5947 theora_comment_init (&tc);
5949 return 0;
5951 /* we don't want to execute this kind of nonsense; just for making sure
5952 * that compilation works... */
5953 memset(&op, 0, sizeof(op));
5954 r = theora_decode_header (&inf, &tc, &op);
5955 r = theora_decode_init (&st, &inf);
5956 t = theora_granule_time (&st, op.granulepos);
5957 r = theora_decode_packetin (&st, &op);
5958 r = theora_decode_YUVout (&st, &yuv);
5959 theora_clear (&st);
5961 return 0;
5964 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5965 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5966 && _theora=yes && break
5967 done
5968 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5969 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5970 cc_check -I. tremor/bitwise.c $_ld_theora \
5971 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5972 done
5975 if test "$_theora" = yes ; then
5976 _def_theora='#define HAVE_OGGTHEORA 1'
5977 _codecmodules="libtheora $_codecmodules"
5978 # when --enable-theora is forced, we'd better provide a probably sane
5979 # $_ld_theora than nothing
5980 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5981 else
5982 _def_theora='#undef HAVE_OGGTHEORA'
5983 _nocodecmodules="libtheora $_nocodecmodules"
5985 echores "$_theora"
5987 echocheck "internal mp3lib support"
5988 if test "$_mp3lib" = yes ; then
5989 _def_mp3lib='#define USE_MP3LIB 1'
5990 _codecmodules="mp3lib $_codecmodules"
5991 else
5992 _def_mp3lib='#undef USE_MP3LIB'
5993 _nocodecmodules="mp3lib $_nocodecmodules"
5995 echores "$_mp3lib"
5997 echocheck "internal liba52 support"
5998 if test "$_liba52" = yes ; then
5999 _def_liba52='#define USE_LIBA52 1'
6000 _codecmodules="liba52 $_codecmodules"
6001 else
6002 _def_liba52='#undef USE_LIBA52'
6003 _nocodecmodules="liba52 $_nocodecmodules"
6005 echores "$_liba52"
6007 echocheck "libdca support"
6008 if test "$_libdca" = auto ; then
6009 _libdca=no
6010 cat > $TMPC << EOF
6011 #include <inttypes.h>
6012 #include <dts.h>
6013 int main(void) { dts_init (0); return 0; }
6015 for _ld_dca in -ldts -ldca ; do
6016 cc_check $_ld_dca $_ld_lm && _ld_extra="$_ld_extra $_ld_dca" \
6017 && _libdca=yes && break
6018 done
6020 if test "$_libdca" = yes ; then
6021 _def_libdca='#define USE_LIBDCA 1'
6022 _codecmodules="libdca $_codecmodules"
6023 else
6024 _def_libdca='#undef USE_LIBDCA'
6025 _nocodecmodules="libdca $_nocodecmodules"
6027 echores "$_libdca"
6029 echocheck "internal libmpeg2 support"
6030 if test "$_libmpeg2" = yes ; then
6031 _def_libmpeg2='#define USE_LIBMPEG2 1'
6032 _codecmodules="libmpeg2 $_codecmodules"
6033 else
6034 _def_libmpeg2='#undef USE_LIBMPEG2'
6035 _nocodecmodules="libmpeg2 $_nocodecmodules"
6037 echores "$_libmpeg2"
6039 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6040 if test "$_musepack" = auto ; then
6041 _musepack=no
6042 cat > $TMPC << EOF
6043 #include <mpcdec/mpcdec.h>
6044 int main(void) {
6045 mpc_streaminfo info;
6046 mpc_decoder decoder;
6047 mpc_decoder_set_streaminfo(&decoder, &info);
6048 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6051 cc_check -lmpcdec $_ld_lm && _musepack=yes
6053 if test "$_musepack" = yes ; then
6054 _def_musepack='#define HAVE_MUSEPACK 1'
6055 _ld_extra="$_ld_extra -lmpcdec"
6056 _codecmodules="musepack $_codecmodules"
6057 else
6058 _def_musepack='#undef HAVE_MUSEPACK'
6059 _nocodecmodules="musepack $_nocodecmodules"
6061 echores "$_musepack"
6064 echocheck "FAAC (AAC encoder) support"
6065 if test "$_faac" = auto ; then
6066 cat > $TMPC <<EOF
6067 #include <inttypes.h>
6068 #include <faac.h>
6069 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6071 _faac=no
6072 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6073 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6074 done
6076 if test "$_faac" = yes ; then
6077 _def_faac="#define HAVE_FAAC 1"
6078 if echo $_libavencoders | grep -q FAAC ; then
6079 _lavc_faac=yes
6080 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
6081 _libs_mplayer="$_libs_mplayer $_ld_faac"
6082 else
6083 _lavc_faac=no
6084 _def_lavc_faac="#undef CONFIG_LIBFAAC"
6086 _codecmodules="faac $_codecmodules"
6087 else
6088 _def_faac="#undef HAVE_FAAC"
6089 _nocodecmodules="faac $_nocodecmodules"
6090 _libavencoders=`echo $_libavencoders | sed -e s/LIBFAAC_ENCODER// `
6092 echores "$_faac (in libavcodec: $_lavc_faac)"
6095 echocheck "FAAD2 (AAC) support"
6096 if test "$_faad_internal" = auto ; then
6097 if x86_32 && test cc_vendor=gnu; then
6098 case $cc_version in
6099 3.1*|3.2) # ICE/insn with these versions
6100 _faad_internal=no
6101 _res_comment="broken gcc"
6104 _faad_internal=yes
6106 esac
6107 else
6108 _faad_internal=yes
6110 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6111 _faad_external=no
6112 cat > $TMPC << EOF
6113 #include <faad.h>
6114 #ifndef FAAD_MIN_STREAMSIZE
6115 #error Too old version
6116 #endif
6117 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6119 cc_check -lfaad $_ld_lm && _faad_external=yes
6122 if test "$_faad_internal" = yes ; then
6123 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6124 _faad=yes
6125 _res_comment="internal floating-point"
6126 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
6127 elif test "$_faad_external" = yes ; then
6128 _faad=yes
6129 _ld_extra="$_ld_extra -lfaad"
6130 else
6131 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6132 _faad=no
6135 if test "$_faad" = yes ; then
6136 _def_faad='#define HAVE_FAAD 1'
6137 _codecmodules="faad2 $_codecmodules"
6138 else
6139 _def_faad='#undef HAVE_FAAD'
6140 _nocodecmodules="faad2 $_nocodecmodules"
6142 echores "$_faad"
6145 echocheck "LADSPA plugin support"
6146 if test "$_ladspa" = auto ; then
6147 cat > $TMPC <<EOF
6148 #include <stdio.h>
6149 #include <ladspa.h>
6150 int main(void) {
6151 const LADSPA_Descriptor *ld = NULL;
6152 return 0;
6155 _ladspa=no
6156 cc_check && _ladspa=yes
6158 if test "$_ladspa" = yes; then
6159 _def_ladspa="#define HAVE_LADSPA"
6160 _afsrc="$_afsrc af_ladspa.c"
6161 _afmodules="ladspa $_afmodules"
6162 else
6163 _def_ladspa="#undef HAVE_LADSPA"
6164 _noafmodules="ladspa $_noafmodules"
6166 echores "$_ladspa"
6169 if test -z "$_codecsdir" ; then
6170 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6171 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6172 if test -d "$dir" ; then
6173 _codecsdir="$dir"
6174 break;
6176 done
6178 # Fall back on default directory.
6179 if test -z "$_codecsdir" ; then
6180 _codecsdir="$_libdir/codecs"
6181 mingw32 && _codecsdir="codecs"
6185 echocheck "Win32 codecs"
6186 if test "$_win32dll" = auto ; then
6187 _win32dll=no
6188 if x86_32 && ! qnx; then
6189 _win32dll=yes
6192 if test "$_win32dll" = yes ; then
6193 _def_win32dll='#define USE_WIN32DLL 1'
6194 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6195 _res_comment="using $_win32codecsdir"
6196 if ! win32 ; then
6197 _def_win32_loader='#define WIN32_LOADER 1'
6198 else
6199 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6200 _res_comment="using native windows"
6202 _codecmodules="win32 $_codecmodules"
6203 else
6204 _def_win32dll='#undef USE_WIN32DLL'
6205 _def_win32_loader='#undef WIN32_LOADER'
6206 _nocodecmodules="win32 $_nocodecmodules"
6208 echores "$_win32dll"
6211 echocheck "XAnim codecs"
6212 if test "$_xanim" = auto ; then
6213 _xanim=no
6214 _res_comment="dynamic loader support needed"
6215 if test "$_dl" = yes ; then
6216 _xanim=yes
6219 if test "$_xanim" = yes ; then
6220 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6221 _def_xanim='#define USE_XANIM 1'
6222 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6223 _codecmodules="xanim $_codecmodules"
6224 _res_comment="using $_xanimcodecsdir"
6225 else
6226 _def_xanim='#undef USE_XANIM'
6227 _def_xanim_path='#undef XACODEC_PATH'
6228 _nocodecmodules="xanim $_nocodecmodules"
6230 echores "$_xanim"
6233 echocheck "RealPlayer codecs"
6234 if test "$_real" = auto ; then
6235 _real=no
6236 _res_comment="dynamic loader support needed"
6237 if test "$_dl" = yes || test "$_win32dll" = yes &&
6238 (linux || freebsd || netbsd || win32 || darwin) ; then
6239 _real=yes
6242 if test "$_real" = yes ; then
6243 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6244 _def_real='#define USE_REALCODECS 1'
6245 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6246 _codecmodules="real $_codecmodules"
6247 _res_comment="using $_realcodecsdir"
6248 else
6249 _def_real='#undef USE_REALCODECS'
6250 _def_real_path="#undef REALCODEC_PATH"
6251 _nocodecmodules="real $_nocodecmodules"
6253 echores "$_real"
6256 echocheck "QuickTime codecs"
6257 if test "$_qtx" = auto ; then
6258 test "$_win32dll" = yes || darwin && _qtx=yes
6260 if test "$_qtx" = yes ; then
6261 _def_qtx='#define USE_QTX_CODECS 1'
6262 _codecmodules="qtx $_codecmodules"
6263 else
6264 _def_qtx='#undef USE_QTX_CODECS'
6265 _nocodecmodules="qtx $_nocodecmodules"
6267 echores "$_qtx"
6269 echocheck "Nemesi Streaming Media libraries"
6270 if test "$_nemesi" = auto && test "$_network" = yes ; then
6271 _nemesi=no
6272 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6273 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6274 _nemesi=yes
6277 if test "$_nemesi" = yes; then
6278 _native_rtsp=no
6279 _def_nemesi='#define LIBNEMESI 1'
6280 _inputmodules="nemesi $_inputmodules"
6281 else
6282 _native_rtsp="$_network"
6283 _nemesi=no
6284 _def_nemesi='#undef LIBNEMESI'
6285 _noinputmodules="nemesi $_noinputmodules"
6287 echores "$_nemesi"
6289 echocheck "LIVE555 Streaming Media libraries"
6290 if test "$_live" = auto && test "$_network" = yes ; then
6291 cat > $TMPCPP << EOF
6292 #include <liveMedia.hh>
6293 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6294 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6295 #endif
6296 int main(void) {}
6299 _live=no
6300 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6301 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6302 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6303 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6304 $_livelibdir/groupsock/libgroupsock.a \
6305 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6306 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6307 $_ld_extra -lstdc++" \
6308 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6309 -I$_livelibdir/UsageEnvironment/include \
6310 -I$_livelibdir/BasicUsageEnvironment/include \
6311 -I$_livelibdir/groupsock/include" && \
6312 _live=yes && break
6313 done
6314 if test "$_live" != yes ; then
6315 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6316 _live_dist=yes
6320 if test "$_live" = yes && test "$_network" = yes; then
6321 _res_comment="using $_livelibdir"
6322 _def_live='#define STREAMING_LIVE555 1'
6323 _inputmodules="live555 $_inputmodules"
6324 elif test "$_live_dist" = yes && test "$_network" = yes; then
6325 _res_comment="using distribution version"
6326 _live="yes"
6327 _def_live='#define STREAMING_LIVE555 1'
6328 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6329 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6330 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6331 _inputmodules="live555 $_inputmodules"
6332 else
6333 _live=no
6334 _def_live='#undef STREAMING_LIVE555'
6335 _noinputmodules="live555 $_noinputmodules"
6337 echores "$_live"
6340 echocheck "FFmpeg libavutil"
6341 if test "$_libavutil_a" = auto ; then
6342 if test -d libavutil ; then
6343 _libavutil_a=yes
6344 _res_comment="static"
6345 else
6346 die "MPlayer will not compile without libavutil in the source tree."
6348 elif test "$_libavutil_so" = auto ; then
6349 _libavutil_so=no
6350 cat > $TMPC << EOF
6351 #include <ffmpeg/common.h>
6352 int main(void) { ff_gcd(1,1); return 0; }
6354 if $_pkg_config --exists libavutil ; then
6355 _inc_libavutil=`$_pkg_config --cflags libavutil`
6356 _ld_tmp=`$_pkg_config --libs libavutil`
6357 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6358 && _libavutil_so=yes
6359 elif cc_check -lavutil $_ld_lm ; then
6360 _ld_extra="$_ld_extra -lavutil"
6361 _libavutil_so=yes
6362 _res_comment="using libavutil.so, but static libavutil is recommended"
6365 _libavutil=no
6366 _def_libavutil='#undef USE_LIBAVUTIL'
6367 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6368 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6369 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6370 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6371 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6372 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6373 # neither static nor shared libavutil is available, but it is mandatory ...
6374 if test "$_libavutil" = no ; then
6375 die "You need static or shared libavutil, MPlayer will not compile without!"
6377 echores "$_libavutil"
6379 echocheck "FFmpeg libavcodec"
6380 if test "$_libavcodec_a" = auto ; then
6381 _libavcodec_a=no
6382 if test -d libavcodec && test -f libavcodec/utils.c ; then
6383 _libavcodec_a="yes"
6384 _res_comment="static"
6386 elif test "$_libavcodec_so" = auto ; then
6387 _libavcodec_so=no
6388 _res_comment="libavcodec.so is discouraged over static libavcodec"
6389 cat > $TMPC << EOF
6390 #include <ffmpeg/avcodec.h>
6391 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6393 if $_pkg_config --exists libavcodec ; then
6394 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6395 _ld_tmp=`$_pkg_config --libs libavcodec`
6396 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6397 && _libavcodec_so=yes
6398 elif cc_check -lavcodec $_ld_lm ; then
6399 _ld_extra="$_ld_extra -lavcodec"
6400 _libavcodec_so=yes
6401 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6404 _libavcodec=no
6405 _def_libavcodec='#undef USE_LIBAVCODEC'
6406 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6407 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6408 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6409 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6410 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6411 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6412 test "$_libavcodec_mpegaudio_hp" = yes \
6413 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6414 if test "$_libavcodec_a" = yes ; then
6415 _codecmodules="libavcodec $_codecmodules"
6416 elif test "$_libavcodec_so" = yes ; then
6417 _codecmodules="libavcodec.so $_codecmodules"
6418 else
6419 _nocodecmodules="libavcodec $_nocodecmodules"
6421 echores "$_libavcodec"
6423 echocheck "FFmpeg libavformat"
6424 if test "$_libavformat_a" = auto ; then
6425 _libavformat_a=no
6426 if test -d libavformat && test -f libavformat/utils.c ; then
6427 _libavformat_a=yes
6428 _res_comment="static"
6430 elif test "$_libavformat_so" = auto ; then
6431 _libavformat_so=no
6432 cat > $TMPC <<EOF
6433 #include <ffmpeg/avformat.h>
6434 #include <ffmpeg/opt.h>
6435 int main(void) { av_alloc_format_context(); return 0; }
6437 if $_pkg_config --exists libavformat ; then
6438 _inc_libavformat=`$_pkg_config --cflags libavformat`
6439 _ld_tmp=`$_pkg_config --libs libavformat`
6440 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6441 && _libavformat_so=yes
6442 elif cc_check $_ld_lm -lavformat ; then
6443 _ld_extra="$_ld_extra -lavformat"
6444 _libavformat_so=yes
6445 _res_comment="using libavformat.so, but static libavformat is recommended"
6448 _libavformat=no
6449 _def_libavformat='#undef USE_LIBAVFORMAT'
6450 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6451 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6452 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6453 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6454 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6455 test "$_libavformat_so" = yes \
6456 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6457 echores "$_libavformat"
6459 echocheck "FFmpeg libpostproc"
6460 if test "$_libpostproc_a" = auto ; then
6461 _libpostproc_a=no
6462 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6463 _libpostproc_a='yes'
6464 _res_comment="static"
6466 elif test "$_libpostproc_so" = auto ; then
6467 _libpostproc_so=no
6468 cat > $TMPC << EOF
6469 #define USE_LIBPOSTPROC 1
6470 #include <inttypes.h>
6471 #include <postproc/postprocess.h>
6472 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6474 if cc_check -lpostproc $_ld_lm ; then
6475 _ld_extra="$_ld_extra -lpostproc"
6476 _libpostproc_so=yes
6477 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6480 _libpostproc=no
6481 _def_libpostproc='#undef USE_LIBPOSTPROC'
6482 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6483 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6484 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6485 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6486 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6487 test "$_libpostproc_so" = yes \
6488 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6489 echores "$_libpostproc"
6492 echocheck "libamr narrowband"
6493 if test "$_libamr_nb" = auto ; then
6494 _libamr_nb=no
6495 cat > $TMPC << EOF
6496 #include <amrnb/interf_dec.h>
6497 int main(void) { Speech_Decode_Frame_init(); return 0; }
6499 cc_check -lamrnb && _libamr_nb=yes
6500 if test "$_libavcodec_a" != yes ; then
6501 _libamr_nb=no
6502 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6505 if test "$_libamr_nb" = yes ; then
6506 _libamr=yes
6507 _ld_extra="$_ld_extra -lamrnb"
6508 _def_libamr='#define CONFIG_LIBAMR 1'
6509 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6510 _codecmodules="libamr_nb $_codecmodules"
6511 else
6512 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6513 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6514 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6515 _nocodecmodules="libamr_nb $_nocodecmodules"
6517 echores "$_libamr_nb"
6520 echocheck "libamr wideband"
6521 if test "$_libamr_wb" = auto ; then
6522 _libamr_wb=no
6523 cat > $TMPC << EOF
6524 #include <amrwb/dec_if.h>
6525 int main(void) { D_IF_init(); return 0; }
6527 cc_check -lamrwb && _libamr_wb=yes
6528 if test "$_libavcodec_a" != yes ; then
6529 _libamr_wb=no
6530 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6533 if test "$_libamr_wb" = yes ; then
6534 _libamr=yes
6535 _ld_extra="$_ld_extra -lamrwb"
6536 _def_libamr='#define CONFIG_LIBAMR 1'
6537 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6538 _codecmodules="libamr_wb $_codecmodules"
6539 else
6540 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6541 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6542 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6543 _nocodecmodules="libamr_wb $_nocodecmodules"
6545 echores "$_libamr_wb"
6547 echocheck "libdv-0.9.5+"
6548 if test "$_libdv" = auto ; then
6549 _libdv=no
6550 cat > $TMPC <<EOF
6551 #include <libdv/dv.h>
6552 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6554 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6556 if test "$_libdv" = yes ; then
6557 _def_libdv='#define HAVE_LIBDV095 1'
6558 _ld_extra="$_ld_extra -ldv"
6559 _codecmodules="libdv $_codecmodules"
6560 else
6561 _def_libdv='#undef HAVE_LIBDV095'
6562 _nocodecmodules="libdv $_nocodecmodules"
6564 echores "$_libdv"
6567 echocheck "XviD"
6568 if test "$_xvid" = auto ; then
6569 _xvid=no
6570 cat > $TMPC << EOF
6571 #include <xvid.h>
6572 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6574 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6575 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6576 done
6579 if test "$_xvid" = yes ; then
6580 _def_xvid='#define HAVE_XVID4 1'
6581 _codecmodules="xvid $_codecmodules"
6582 else
6583 _def_xvid='#undef HAVE_XVID4'
6584 _nocodecmodules="xvid $_nocodecmodules"
6585 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6587 echores "$_xvid"
6589 if test "$_xvid" = yes ; then
6590 echocheck "XviD two pass plugin"
6591 cat > $TMPC << EOF
6592 #include <xvid.h>
6593 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6595 if cc_check ; then
6596 _lavc_xvid=yes
6597 _def_lavc_xvid='#define CONFIG_LIBXVID 1'
6598 else
6599 _lavc_xvid=no
6600 _def_lavc_xvid='#undef CONFIG_LIBXVID'
6601 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6603 echores "$_lavc_xvid"
6607 echocheck "x264"
6608 if test "$_x264" = auto ; then
6609 cat > $TMPC << EOF
6610 #include <inttypes.h>
6611 #include <x264.h>
6612 #if X264_BUILD < 53
6613 #error We do not support old versions of x264. Get the latest from SVN.
6614 #endif
6615 int main(void) { x264_encoder_open((void*)0); return 0; }
6617 _x264=no
6618 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6619 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6620 done
6623 if test "$_x264" = yes ; then
6624 _def_x264='#define HAVE_X264 1'
6625 _codecmodules="x264 $_codecmodules"
6626 if echo $_libavencoders | grep -q X264 ; then
6627 _lavc_x264=yes
6628 _def_lavc_x264='#define CONFIG_LIBX264 1'
6629 _libs_mplayer="$_libs_mplayer $_ld_x264"
6630 else
6631 _lavc_x264=no
6632 _def_lavc_x264='#undef CONFIG_LIBX264'
6634 else
6635 _lavc_x264=no
6636 _def_x264='#undef HAVE_X264'
6637 _def_lavc_x264='#undef CONFIG_LIBX264'
6638 _nocodecmodules="x264 $_nocodecmodules"
6639 _libavencoders=`echo $_libavencoders | sed -e s/LIBX264_ENCODER// `
6641 echores "$_x264 (in libavcodec: $_lavc_x264)"
6644 echocheck "libnut"
6645 if test "$_libnut" = auto ; then
6646 cat > $TMPC << EOF
6647 #include <stdio.h>
6648 #include <stdlib.h>
6649 #include <inttypes.h>
6650 #include <libnut.h>
6651 int main(void) { (void)nut_error(0); return 0; }
6653 _libnut=no
6654 cc_check -lnut && _libnut=yes
6657 if test "$_libnut" = yes ; then
6658 _def_libnut='#define HAVE_LIBNUT 1'
6659 _ld_extra="$_ld_extra -lnut"
6660 else
6661 _def_libnut='#undef HAVE_LIBNUT'
6662 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6664 echores "$_libnut"
6667 # mencoder requires (optional) those libs: libmp3lame
6668 if test "$_mencoder" != no ; then
6670 echocheck "libmp3lame (for mencoder)"
6671 _mp3lame=no
6672 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6673 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6674 cat > $TMPC <<EOF
6675 #include <lame/lame.h>
6676 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; }
6678 # Note: libmp3lame usually depends on vorbis
6679 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6680 if test "$_mp3lame" = yes ; then
6681 _def_mp3lame="#define HAVE_MP3LAME"
6682 _ld_mp3lame=-lmp3lame
6683 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6684 cat > $TMPC << EOF
6685 #include <lame/lame.h>
6686 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6688 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6689 cat > $TMPC << EOF
6690 #include <lame/lame.h>
6691 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6693 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6694 if echo $_libavencoders | grep -q MP3LAME ; then
6695 _lavc_mp3lame=yes
6696 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6697 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6698 else
6699 _lavc_mp3lame=no
6700 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6702 else
6703 _def_mp3lame='#undef HAVE_MP3LAME'
6704 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6706 echores "$_mp3lame"
6710 echocheck "mencoder"
6711 _mencoder_flag='#undef HAVE_MENCODER'
6712 if test "$_mencoder" = yes ; then
6713 _mencoder_flag='#define HAVE_MENCODER'
6714 _def_muxers='#define CONFIG_MUXERS 1'
6715 else
6716 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6717 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6718 _libavmuxers=""
6720 echores "$_mencoder"
6722 echocheck "fastmemcpy"
6723 # fastmemcpy check is done earlier with tests of CPU & binutils features
6724 if test "$_fastmemcpy" = yes ; then
6725 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6726 else
6727 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6729 echores "$_fastmemcpy"
6732 echocheck "UnRAR executable"
6733 if test "$_unrar_exec" = auto ; then
6734 _unrar_exec="yes"
6735 mingw32 && _unrar_exec="no"
6737 if test "$_unrar_exec" = yes ; then
6738 _def_unrar_exec='#define USE_UNRAR_EXEC 1'
6739 else
6740 _def_unrar_exec='#undef USE_UNRAR_EXEC'
6742 echores "$_unrar_exec"
6744 echocheck "TV interface"
6745 if test "$_tv" = yes ; then
6746 _def_tv='#define USE_TV 1'
6747 _inputmodules="tv $_inputmodules"
6748 else
6749 _noinputmodules="tv $_noinputmodules"
6750 _def_tv='#undef USE_TV'
6752 echores "$_tv"
6755 if bsd; then
6756 echocheck "*BSD BT848 bt8xx header"
6757 _ioctl_bt848_h=no
6758 for file in "machine/ioctl_bt848.h" \
6759 "dev/bktr/ioctl_bt848.h" \
6760 "dev/video/bktr/ioctl_bt848.h" \
6761 "dev/ic/bt8xx.h" ; do
6762 cat > $TMPC <<EOF
6763 #include <sys/types.h>
6764 #include <sys/ioctl.h>
6765 #include <$file>
6766 int main(void) {
6767 ioctl(0, TVTUNER_GETFREQ, 0);
6768 return 0;
6771 if cc_check ; then
6772 _ioctl_bt848_h=yes
6773 _ioctl_bt848_h_name="$file"
6774 break;
6776 done
6777 if test "$_ioctl_bt848_h" = yes ; then
6778 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6779 _res_comment="using $_ioctl_bt848_h_name"
6780 else
6781 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6783 echores "$_ioctl_bt848_h"
6785 echocheck "*BSD ioctl_meteor.h"
6786 _ioctl_meteor_h=no
6787 for file in "machine/ioctl_meteor.h" \
6788 "dev/bktr/ioctl_meteor.h" \
6789 "dev/video/bktr/ioctl_meteor.h" ; do
6790 cat > $TMPC <<EOF
6791 #include <sys/types.h>
6792 #include <$file>
6793 int main(void) {
6794 ioctl(0, METEORSINPUT, 0);
6795 return 0;
6798 if cc_check ; then
6799 _ioctl_meteor_h=yes
6800 _ioctl_meteor_h_name="$file"
6801 break;
6803 done
6804 if test "$_ioctl_meteor_h" = yes ; then
6805 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6806 _res_comment="using $_ioctl_meteor_h_name"
6807 else
6808 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6810 echores "$_ioctl_meteor_h"
6812 echocheck "*BSD BrookTree 848 TV interface"
6813 if test "$_tv_bsdbt848" = auto ; then
6814 _tv_bsdbt848=no
6815 if test "$_tv" = yes ; then
6816 cat > $TMPC <<EOF
6817 #include <sys/types.h>
6818 $_def_ioctl_meteor_h_name
6819 $_def_ioctl_bt848_h_name
6820 #ifdef IOCTL_METEOR_H_NAME
6821 #include IOCTL_METEOR_H_NAME
6822 #endif
6823 #ifdef IOCTL_BT848_H_NAME
6824 #include IOCTL_BT848_H_NAME
6825 #endif
6826 int main(void){
6827 ioctl(0, METEORSINPUT, 0);
6828 ioctl(0, TVTUNER_GETFREQ, 0);
6829 return 0;
6832 cc_check && _tv_bsdbt848=yes
6835 if test "$_tv_bsdbt848" = yes ; then
6836 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6837 _inputmodules="tv-bsdbt848 $_inputmodules"
6838 else
6839 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6840 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6842 echores "$_tv_bsdbt848"
6843 fi #if bsd
6846 echocheck "DirectShow TV interface"
6847 if test "$_tv_dshow" = auto ; then
6848 _tv_dshow=no
6849 if test "$_tv" = yes && win32 ; then
6850 cat > $TMPC <<EOF
6851 #include <ole2.h>
6852 int main(void) {
6853 void* p;
6854 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6855 return 0;
6858 cc_check -lole32 -luuid && _tv_dshow=yes
6861 if test "$_tv_dshow" = yes ; then
6862 _inputmodules="tv-dshow $_inputmodules"
6863 _def_tv_dshow='#define HAVE_TV_DSHOW 1'
6864 _ld_extra="$_ld_extra -lole32 -luuid"
6865 else
6866 _noinputmodules="tv-dshow $_noinputmodules"
6867 _def_tv_dshow='#undef HAVE_TV_DSHOW'
6869 echores "$_tv_dshow"
6872 echocheck "Video 4 Linux TV interface"
6873 if test "$_tv_v4l1" = auto ; then
6874 _tv_v4l1=no
6875 if test "$_tv" = yes && linux ; then
6876 cat > $TMPC <<EOF
6877 #include <stdlib.h>
6878 #include <linux/videodev.h>
6879 int main(void) { return 0; }
6881 cc_check && _tv_v4l1=yes
6884 if test "$_tv_v4l1" = yes ; then
6885 _audio_input=yes
6886 _tv_v4l=yes
6887 _def_tv_v4l='#define HAVE_TV_V4L 1'
6888 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6889 _inputmodules="tv-v4l $_inputmodules"
6890 else
6891 _noinputmodules="tv-v4l1 $_noinputmodules"
6892 _def_tv_v4l='#undef HAVE_TV_V4L'
6894 echores "$_tv_v4l1"
6897 echocheck "Video 4 Linux 2 TV interface"
6898 if test "$_tv_v4l2" = auto ; then
6899 _tv_v4l2=no
6900 if test "$_tv" = yes && linux ; then
6901 cat > $TMPC <<EOF
6902 #include <stdlib.h>
6903 #include <linux/types.h>
6904 #include <linux/videodev2.h>
6905 int main(void) { return 0; }
6907 cc_check && _tv_v4l2=yes
6910 if test "$_tv_v4l2" = yes ; then
6911 _audio_input=yes
6912 _tv_v4l=yes
6913 _def_tv_v4l='#define HAVE_TV_V4L 1'
6914 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6915 _inputmodules="tv-v4l2 $_inputmodules"
6916 else
6917 _noinputmodules="tv-v4l2 $_noinputmodules"
6918 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6920 echores "$_tv_v4l2"
6923 echocheck "TV teletext interface"
6924 if test "$_tv_teletext" = auto ; then
6925 _tv_teletext=no
6926 if test "$_freetype" = yes && test "$_pthreads" = yes; then
6927 if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes; then
6928 _tv_teletext=yes
6932 if test "$_tv_teletext" = yes ; then
6933 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6934 _inputmodules="tv-teletext $_inputmodules"
6935 else
6936 _noinputmodules="tv-teletext $_noinputmodules"
6937 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6939 echores "$_tv_teletext"
6942 echocheck "Radio interface"
6943 if test "$_radio" = yes ; then
6944 _def_radio='#define USE_RADIO 1'
6945 _inputmodules="radio $_inputmodules"
6946 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6947 _radio_capture=no
6949 if test "$_radio_capture" = yes ; then
6950 _audio_input=yes
6951 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6952 else
6953 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6955 else
6956 _noinputmodules="radio $_noinputmodules"
6957 _def_radio='#undef USE_RADIO'
6958 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6959 _radio_capture=no
6961 echores "$_radio"
6962 echocheck "Capture for Radio interface"
6963 echores "$_radio_capture"
6965 echocheck "Video 4 Linux 2 Radio interface"
6966 if test "$_radio_v4l2" = auto ; then
6967 _radio_v4l2=no
6968 if test "$_radio" = yes && linux ; then
6969 cat > $TMPC <<EOF
6970 #include <stdlib.h>
6971 #include <linux/types.h>
6972 #include <linux/videodev2.h>
6973 int main(void) { return 0; }
6975 cc_check && _radio_v4l2=yes
6978 if test "$_radio_v4l2" = yes ; then
6979 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6980 else
6981 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6983 echores "$_radio_v4l2"
6985 echocheck "Video 4 Linux Radio interface"
6986 if test "$_radio_v4l" = auto ; then
6987 _radio_v4l=no
6988 if test "$_radio" = yes && linux ; then
6989 cat > $TMPC <<EOF
6990 #include <stdlib.h>
6991 #include <linux/videodev.h>
6992 int main(void) { return 0; }
6994 cc_check && _radio_v4l=yes
6997 if test "$_radio_v4l" = yes ; then
6998 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6999 else
7000 _def_radio_v4l='#undef HAVE_RADIO_V4L'
7002 echores "$_radio_v4l"
7004 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7005 echocheck "*BSD BrookTree 848 Radio interface"
7006 _radio_bsdbt848=no
7007 cat > $TMPC <<EOF
7008 #include <sys/types.h>
7009 $_def_ioctl_bt848_h_name
7010 #ifdef IOCTL_BT848_H_NAME
7011 #include IOCTL_BT848_H_NAME
7012 #endif
7013 int main(void){
7014 ioctl(0, RADIO_GETFREQ, 0);
7015 return 0;
7018 cc_check && _radio_bsdbt848=yes
7019 echores "$_radio_bsdbt848"
7020 fi #if bsd && radio && radio_bsdbt848
7022 if test "$_radio_bsdbt848" = yes ; then
7023 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
7024 else
7025 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
7028 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7029 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7030 die "Radio driver requires BSD BT848, V4L or V4L2!"
7033 echocheck "Video 4 Linux 2 MPEG PVR interface"
7034 if test "$_pvr" = auto ; then
7035 _pvr=no
7036 if test "$_tv_v4l2" = yes && linux ; then
7037 cat > $TMPC <<EOF
7038 #include <stdlib.h>
7039 #include <inttypes.h>
7040 #include <linux/types.h>
7041 #include <linux/videodev2.h>
7042 int main(void) { struct v4l2_ext_controls ext; return 0; }
7044 cc_check && _pvr=yes
7047 if test "$_pvr" = yes ; then
7048 _def_pvr='#define HAVE_PVR 1'
7049 _inputmodules="pvr $_inputmodules"
7050 else
7051 _noinputmodules="pvr $_noinputmodules"
7052 _def_pvr='#undef HAVE_PVR'
7054 echores "$_pvr"
7057 echocheck "audio select()"
7058 if test "$_select" = no ; then
7059 _def_select='#undef HAVE_AUDIO_SELECT'
7060 elif test "$_select" = yes ; then
7061 _def_select='#define HAVE_AUDIO_SELECT 1'
7063 echores "$_select"
7066 echocheck "ftp"
7067 if ! beos && test "$_ftp" = yes ; then
7068 _def_ftp='#define HAVE_FTP 1'
7069 _inputmodules="ftp $_inputmodules"
7070 else
7071 _noinputmodules="ftp $_noinputmodules"
7072 _def_ftp='#undef HAVE_FTP'
7074 echores "$_ftp"
7076 echocheck "vstream client"
7077 if test "$_vstream" = auto ; then
7078 _vstream=no
7079 cat > $TMPC <<EOF
7080 #include <vstream-client.h>
7081 void vstream_error(const char *format, ... ) {}
7082 int main(void) { vstream_start(); return 0; }
7084 cc_check -lvstream-client && _vstream=yes
7086 if test "$_vstream" = yes ; then
7087 _def_vstream='#define HAVE_VSTREAM 1'
7088 _inputmodules="vstream $_inputmodules"
7089 _ld_extra="$_ld_extra -lvstream-client"
7090 else
7091 _noinputmodules="vstream $_noinputmodules"
7092 _def_vstream='#undef HAVE_VSTREAM'
7094 echores "$_vstream"
7096 # endian testing
7097 echocheck "byte order"
7098 if test "$_big_endian" = auto ; then
7099 cat > $TMPC <<EOF
7100 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7101 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7102 int main(void){
7103 return (int)ascii_name;
7106 if cc_check ; then
7107 if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
7108 _big_endian=yes
7109 else
7110 _big_endian=no
7112 else
7113 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7116 if test "$_big_endian" = yes ; then
7117 _byte_order='big-endian'
7118 _def_words_endian='#define WORDS_BIGENDIAN 1'
7119 else
7120 _byte_order='little-endian'
7121 _def_words_endian='#undef WORDS_BIGENDIAN'
7123 echores "$_byte_order"
7125 echocheck "OSD menu"
7126 if test "$_menu" = yes ; then
7127 _def_menu='#define HAVE_MENU 1'
7128 else
7129 _def_menu='#undef HAVE_MENU'
7131 echores "$_menu"
7134 echocheck "Subtitles sorting"
7135 if test "$_sortsub" = yes ; then
7136 _def_sortsub='#define USE_SORTSUB 1'
7137 else
7138 _def_sortsub='#undef USE_SORTSUB'
7140 echores "$_sortsub"
7143 echocheck "XMMS inputplugin support"
7144 if test "$_xmms" = yes ; then
7145 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7146 _xmmsplugindir=`xmms-config --input-plugin-dir`
7147 _xmmslibdir=`xmms-config --exec-prefix`/lib
7148 else
7149 _xmmsplugindir=/usr/lib/xmms/Input
7150 _xmmslibdir=/usr/lib
7153 _def_xmms='#define HAVE_XMMS 1'
7154 if darwin ; then
7155 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7156 else
7157 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7159 else
7160 _def_xmms='#undef HAVE_XMMS'
7162 echores "$_xmms"
7164 echocheck "inet6"
7165 if test "$_inet6" = auto ; then
7166 cat > $TMPC << EOF
7167 #include <sys/types.h>
7168 #if !defined(_WIN32) || defined(__CYGWIN__)
7169 #include <sys/socket.h>
7170 #include <netinet/in.h>
7171 #else
7172 #include <ws2tcpip.h>
7173 #endif
7174 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7176 _inet6=no
7177 if cc_check $_ld_sock ; then
7178 _inet6=yes
7181 if test "$_inet6" = yes ; then
7182 _def_inet6='#define HAVE_AF_INET6 1'
7183 else
7184 _def_inet6='#undef HAVE_AF_INET6'
7186 echores "$_inet6"
7189 echocheck "gethostbyname2"
7190 if test "$_gethostbyname2" = auto ; then
7191 cat > $TMPC << EOF
7192 #include <sys/types.h>
7193 #include <sys/socket.h>
7194 #include <netdb.h>
7195 int main(void) { gethostbyname2("", AF_INET); }
7197 _gethostbyname2=no
7198 if cc_check ; then
7199 _gethostbyname2=yes
7203 if test "$_gethostbyname2" = yes ; then
7204 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7205 else
7206 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7208 echores "$_gethostbyname2"
7211 # --------------- GUI specific tests begin -------------------
7212 echocheck "GUI"
7213 echo "$_gui"
7214 if test "$_gui" = yes ; then
7216 # Required libraries
7217 if test "$_libavcodec" != yes ||
7218 ! echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1 ; then
7219 die "The GUI requires libavcodec with PNG support (needs zlib)."
7221 if ! win32 ; then
7222 test "$_x11" != yes && die "X11 support required for GUI compilation."
7224 echocheck "XShape extension"
7225 if test "$_xshape" = auto ; then
7226 _xshape=no
7227 cat > $TMPC << EOF
7228 #include <X11/Xlib.h>
7229 #include <X11/Xproto.h>
7230 #include <X11/Xutil.h>
7231 #include <X11/extensions/shape.h>
7232 #include <stdlib.h>
7233 int main(void) {
7234 char *name = ":0.0";
7235 Display *wsDisplay;
7236 int exitvar = 0;
7237 int eventbase, errorbase;
7238 if (getenv("DISPLAY"))
7239 name=getenv("DISPLAY");
7240 wsDisplay=XOpenDisplay(name);
7241 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7242 exitvar=1;
7243 XCloseDisplay(wsDisplay);
7244 return exitvar;
7247 cc_check -lXext && _xshape=yes
7249 if test "$_xshape" = yes ; then
7250 _def_xshape='#define HAVE_XSHAPE 1'
7251 else
7252 die "The GUI requires the X11 extension XShape (which was not found)."
7254 echores "$_xshape"
7256 #Check for GTK
7257 if test "$_gtk1" = no ; then
7258 #Check for GTK2 :
7259 echocheck "GTK+ version"
7261 if $_pkg_config gtk+-2.0 --exists ; then
7262 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7263 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7264 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7265 echores "$_gtk"
7267 # Check for GLIB2
7268 if $_pkg_config glib-2.0 --exists ; then
7269 echocheck "glib version"
7270 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7271 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7272 echores "$_glib"
7274 _def_gui='#define HAVE_NEW_GUI 1'
7275 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7276 else
7277 _gtk1=yes
7278 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7280 else
7281 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7282 _gtk1=yes
7286 if test "$_gtk1" = yes ; then
7287 # Check for old GTK (1.2.x)
7288 echocheck "GTK version"
7289 if test -z "$_gtkconfig" ; then
7290 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7291 _gtkconfig="gtk-config"
7292 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7293 _gtkconfig="gtk12-config"
7294 else
7295 die "The GUI requires GTK devel packages (which were not found)."
7298 _gtk=`$_gtkconfig --version 2>&1`
7299 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7300 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7301 echores "$_gtk (using $_gtkconfig)"
7303 # Check for GLIB
7304 echocheck "glib version"
7305 if test -z "$_glibconfig" ; then
7306 if ( glib-config --version ) >/dev/null 2>&1 ; then
7307 _glibconfig="glib-config"
7308 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7309 _glibconfig="glib12-config"
7310 else
7311 die "The GUI requires GLIB devel packages (which were not found)"
7314 _glib=`$_glibconfig --version 2>&1`
7315 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7316 echores "$_glib (using $_glibconfig)"
7318 _def_gui='#define HAVE_NEW_GUI 1'
7319 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7322 else #if ! win32
7323 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7324 _def_gui='#define HAVE_NEW_GUI 1'
7325 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7326 fi #if ! win32
7328 else #if test "$_gui"
7329 _def_gui='#undef HAVE_NEW_GUI'
7330 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7331 fi #if test "$_gui"
7332 # --------------- GUI specific tests end -------------------
7335 if test "$_charset" = "noconv" ; then
7336 _charset=""
7338 if test "$_charset" ; then
7339 _def_charset="#define MSG_CHARSET \"$_charset\""
7340 else
7341 _def_charset="#undef MSG_CHARSET"
7344 if test "$_charset" = "UTF-8" ; then
7345 # hack to disable conversion in the Makefile
7346 _charset=""
7349 if test "$_charset" ; then
7350 echocheck "iconv program"
7351 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7352 if test "$?" -ne 0 ; then
7353 echores "no"
7354 echo "No working iconv program found, use "
7355 echo "--charset=UTF-8 to continue anyway."
7356 echo "If you also have problems with iconv library functions use --charset=noconv."
7357 echo "Messages in the GTK-2 interface will be broken then."
7358 exit 1
7359 else
7360 echores "yes"
7364 #############################################################################
7366 echocheck "automatic gdb attach"
7367 if test "$_crash_debug" = yes ; then
7368 _def_crash_debug='#define CRASH_DEBUG 1'
7369 else
7370 _def_crash_debug='#undef CRASH_DEBUG'
7371 _crash_debug=no
7373 echores "$_crash_debug"
7375 echocheck "compiler support for noexecstack"
7376 cat > $TMPC <<EOF
7377 int main(void) { return 0; }
7379 if cc_check -Wl,-z,noexecstack ; then
7380 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7381 echores "yes"
7382 else
7383 echores "no"
7387 # Dynamic linking flags
7388 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7389 _ld_dl_dynamic=''
7390 bsd && _ld_dl_dynamic='-rdynamic'
7391 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin ; then
7392 _ld_dl_dynamic='-rdynamic'
7395 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7396 bsdos && _ld_extra="$_ld_extra -ldvd"
7397 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7398 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7400 _def_debug='#undef MP_DEBUG'
7401 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7403 _def_linux='#undef TARGET_LINUX'
7404 linux && _def_linux='#define TARGET_LINUX 1'
7407 echocheck "joystick"
7408 _def_joystick='#undef HAVE_JOYSTICK'
7409 if test "$_joystick" = yes ; then
7410 if linux ; then
7411 # TODO add some check
7412 _def_joystick='#define HAVE_JOYSTICK 1'
7413 else
7414 _joystick="no (unsupported under $system_name)"
7417 echores "$_joystick"
7419 echocheck "lirc"
7420 if test "$_lirc" = auto ; then
7421 _lirc=no
7422 cat > $TMPC <<EOF
7423 #include <lirc/lirc_client.h>
7424 int main(void) { return 0; }
7426 cc_check -llirc_client && _lirc=yes
7428 if test "$_lirc" = yes ; then
7429 _def_lirc='#define HAVE_LIRC 1'
7430 _ld_extra="$_ld_extra -llirc_client"
7431 else
7432 _def_lirc='#undef HAVE_LIRC'
7434 echores "$_lirc"
7436 echocheck "lircc"
7437 if test "$_lircc" = auto ; then
7438 _lircc=no
7439 cat > $TMPC <<EOF
7440 #include <lirc/lircc.h>
7441 int main(void) { return 0; }
7443 cc_check -llircc && _lircc=yes
7445 if test "$_lircc" = yes ; then
7446 _def_lircc='#define HAVE_LIRCC 1'
7447 _ld_extra="$_ld_extra -llircc"
7448 else
7449 _def_lircc='#undef HAVE_LIRCC'
7451 echores "$_lircc"
7453 if arm; then
7454 # Detect maemo development platform libraries availability (http://www.maemo.org),
7455 # they are used when run on Nokia 770
7456 echocheck "maemo (Nokia 770)"
7457 if test "$_maemo" = auto ; then
7458 _maemo=no
7459 cat > $TMPC << EOF
7460 #include <libosso.h>
7461 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7463 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7465 if test "$_maemo" = yes ; then
7466 _def_maemo='#define HAVE_MAEMO 1'
7467 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7468 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7469 else
7470 _def_maemo='#undef HAVE_MAEMO'
7472 echores "$_maemo"
7475 echocheck "color console output"
7476 if test "$_color_console" = yes ; then
7477 _def_color_console='#define MSG_USE_COLORS 1'
7478 else
7479 _def_color_console='#undef MSG_USE_COLORS'
7481 echores "$_color_console"
7483 # linker paths should be the same for mencoder and mplayer
7484 _ld_tmp=""
7485 for I in $_libs_mplayer ; do
7486 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7487 if test -z "$_tmp" ; then
7488 _ld_extra="$I $_ld_extra"
7489 else
7490 _ld_tmp="$_ld_tmp $I"
7492 done
7493 _libs_mplayer=$_ld_tmp
7496 #############################################################################
7497 if darwin ; then
7498 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
7499 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7500 CFLAGS="$CFLAGS -no-cpp-precomp"
7503 if amigaos ; then
7504 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__"
7506 if hpux ; then
7507 # use flag for HPUX missing setenv()
7508 CFLAGS="$CFLAGS -DHPUX"
7510 # Thread support
7511 if linux ; then
7512 CFLAGS="$CFLAGS -D_REENTRANT"
7513 elif bsd ; then
7514 # FIXME bsd needs this so maybe other OS'es
7515 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7517 if cygwin ; then
7518 CFLAGS="$CFLAGS -D__CYGWIN__"
7520 # 64 bit file offsets?
7521 if test "$_largefiles" = yes || freebsd ; then
7522 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7523 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7524 # dvdread support requires this (for off64_t)
7525 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7526 cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
7530 # Make sure config.h gets included.
7531 if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then
7532 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
7535 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7536 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7538 cat > $TMPC << EOF
7539 int main(void) { return 0; }
7541 if test "$cc_vendor" = "gnu" ; then
7542 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7543 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7544 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7548 #this must be the last test to be performed or the ones following it will likely fail
7549 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7550 # to use its own copy of the library)
7551 echocheck "DVD support (libdvdnav)"
7552 if test "$_dvdnav" = auto ; then
7553 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7555 if test "$_dvdnav" = auto ; then
7556 cat > $TMPC <<EOF
7557 #include <inttypes.h>
7558 #include <dvdnav.h>
7559 int main(void) { dvdnav_t *dvd=0; return 0; }
7561 _dvdnav=no
7562 _dvdnavdir=`$_dvdnavconfig --cflags`
7563 _dvdnavlibs=`$_dvdnavconfig --libs`
7564 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7566 if test "$_dvdnav" = yes ; then
7567 _largefiles=yes
7568 _def_dvdnav='#define USE_DVDNAV 1'
7569 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7570 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7571 _inputmodules="dvdnav $_inputmodules"
7572 else
7573 _def_dvdnav='#undef USE_DVDNAV'
7574 _noinputmodules="dvdnav $_noinputmodules"
7576 echores "$_dvdnav"
7578 #############################################################################
7579 echo "Creating config.mak"
7580 cat > config.mak << EOF
7581 # -------- Generated by configure -----------
7583 LANG = C
7584 MAN_LANG = $MAN_LANG
7585 TARGET_OS = $system_name
7586 DESTDIR =
7587 prefix = \$(DESTDIR)$_prefix
7588 BINDIR = \$(DESTDIR)$_bindir
7589 DATADIR = \$(DESTDIR)$_datadir
7590 MANDIR = \$(DESTDIR)$_mandir
7591 CONFDIR = \$(DESTDIR)$_confdir
7592 LIBDIR = \$(DESTDIR)$_libdir
7593 # FFmpeg uses libdir instead of LIBDIR
7594 libdir = \$(LIBDIR)
7595 AR = $_ar
7596 CC = $_cc
7597 CXX = $_cc
7598 HOST_CC = $_host_cc
7599 RANLIB = $_ranlib
7600 LDCONFIG = $_ldconfig
7601 INSTALL = $_install
7602 EXTRA_INC = $_inc_extra
7603 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7604 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7605 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7606 CFLAG_STACKREALIGN = $_stackrealign
7607 INSTALLSTRIP = $_install_strip
7608 CHARSET = $_charset
7609 HELP_FILE = $_mp_help
7611 EXESUF = $_exesuf
7613 MPLAYER_NETWORK = $_network
7614 FTP = $_ftp
7615 STREAMING_LIVE555 = $_live
7616 LIBNEMESI = $_nemesi
7617 NATIVE_RTSP = $_native_rtsp
7618 VSTREAM = $_vstream
7619 STREAM_CACHE = $_stream_cache
7620 DVBIN = $_dvbin
7621 VIDIX = $_vidix
7622 VIDIX_INTERNAL = $_vidix_internal
7623 VIDIX_EXTERNAL = $_vidix_external
7624 VIDIX_PCIDB = $_vidix_pcidb_val
7625 CONFIG_PP = yes
7626 MP3LAME = $_mp3lame
7627 LIBMENU = $_menu
7629 MP3LIB = $_mp3lib
7630 LIBA52 = $_liba52
7631 LIBMPEG2 = $_libmpeg2
7632 TREMOR_INTERNAL = $_tremor_internal
7633 TREMOR_LOW = $_tremor_low
7634 FAAD = $_faad
7636 SPEEX = $_speex
7637 MUSEPACK = $_musepack
7639 UNRAR_EXEC = $_unrar_exec
7640 PNG = $_png
7641 JPEG = $_jpeg
7642 GIF = $_gif
7644 EXTRALIBS = $_extra_libs
7645 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7646 EXTRALIBS_MPLAYER = $_libs_mplayer
7647 EXTRALIBS_MENCODER = $_libs_mencoder
7649 HAVE_MLIB = $_mlib
7650 HAVE_PTHREADS = $_pthreads
7651 HAVE_W32THREADS = $_w32threads
7653 HAVE_XVMC_ACCEL = $_xvmc
7655 HAVE_SYS_MMAN_H = $_mman
7656 HAVE_POSIX_SELECT = $_posix_select
7658 NEED_GETTIMEOFDAY = $_need_gettimeofday
7659 NEED_GLOB = $_need_glob
7660 NEED_SETENV = $_need_setenv
7661 NEED_SHMEM = $_need_shmem
7662 NEED_STRSEP = $_need_strsep
7663 NEED_SWAB = $_need_swab
7664 NEED_VSSCANF = $_need_vsscanf
7666 # for FFmpeg
7667 SRC_PATH=..
7668 BUILD_ROOT=..
7669 LIBPREF=lib
7670 LIBSUF=.a
7671 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7673 # audio output
7674 OSS = $_ossaudio
7675 ALSA = $_alsa
7676 ALSA5 = $_alsa5
7677 ALSA9 = $_alsa9
7678 ALSA1X = $_alsa1x
7680 # input/demuxer/codecs
7681 JOYSTICK = $_joystick
7682 LIRC = $_lirc
7683 APPLE_REMOTE = $_apple_remote
7684 TV = $_tv
7685 TV_V4L = $_tv_v4l
7686 TV_V4L1 = $_tv_v4l1
7687 TV_V4L2 = $_tv_v4l2
7688 TV_DSHOW = $_tv_dshow
7689 TV_BSDBT848 = $_tv_bsdbt848
7690 TV_TELETEXT = $_tv_teletext
7691 AUDIO_INPUT = $_audio_input
7692 PVR = $_pvr
7693 VCD = $_vcd
7694 DVDREAD = $_dvdread
7695 DVDREAD_INTERNAL = $_dvdread_internal
7696 DVDCSS_INTERNAL = $_libdvdcss_internal
7697 DVDNAV = $_dvdnav
7698 WIN32DLL = $_win32dll
7699 QTX_CODECS = $_qtx
7700 REAL_CODECS = $_real
7701 XANIM_CODECS = $_xanim
7702 LIBAVUTIL = $_libavutil
7703 LIBAVUTIL_A = $_libavutil_a
7704 LIBAVUTIL_SO = $_libavutil_so
7705 LIBAVCODEC = $_libavcodec
7706 LIBAVCODEC_A = $_libavcodec_a
7707 LIBAVCODEC_SO = $_libavcodec_so
7708 LIBAVFORMAT = $_libavformat
7709 LIBAVFORMAT_A = $_libavformat_a
7710 LIBAVFORMAT_SO = $_libavformat_so
7711 LIBPOSTPROC = $_libpostproc
7712 LIBPOSTPROC_A = $_libpostproc_a
7713 LIBPOSTPROC_SO = $_libpostproc_so
7714 ZORAN = $_zr
7715 LIBLZO = $_liblzo
7716 LIBDV = $_libdv
7717 XVID4 = $_xvid
7718 X264 = $_x264
7719 LIBNUT = $_libnut
7720 LIBDCA = $_libdca
7721 MPLAYER = $_mplayer
7722 MENCODER = $_mencoder
7723 CDDA = $_cdda
7724 CDDB = $_cddb
7725 BITMAP_FONT = $_bitmap_font
7726 FREETYPE = $_freetype
7727 ASS = $_ass
7728 LIBMAD = $_mad
7729 LIBVORBIS = $_vorbis
7730 LIBTHEORA = $_theora
7731 FAAD_INTERNAL = $_faad_internal
7732 FAAD_FIXED = $_faad_fixed
7733 LIBSMBCLIENT = $_smbsupport
7734 XMMS_PLUGINS = $_xmms
7735 MACOSX = $_macosx
7736 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7737 MACOSX_BUNDLE = $_macosx_bundle
7738 MACOSX_COREVIDEO = $_macosx_corevideo
7739 TOOLAME=$_toolame
7740 TWOLAME=$_twolame
7741 FAAC=$_faac
7742 CONFIG_LIBAMR=$_libamr
7743 CONFIG_LIBAMR_NB=$_libamr_nb
7744 CONFIG_LIBAMR_WB=$_libamr_wb
7745 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7746 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7747 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7748 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7749 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7750 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7751 CONFIG_LIBFAAC=$_lavc_faac
7752 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7753 CONFIG_LIBVORBIS=$_libvorbis
7754 CONFIG_LIBXVID=$_lavc_xvid
7755 CONFIG_LIBX264=$_lavc_x264
7756 CONFIG_ZLIB=$_zlib
7757 CONFIG_GPL=yes
7758 CONFIG_ENCODERS=$_mencoder
7759 CONFIG_MUXERS=$_mencoder
7760 RADIO=$_radio
7761 RADIO_CAPTURE=$_radio_capture
7762 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7763 VIDIX_IVTV=$_vidix_drv_ivtv
7764 VIDIX_MACH64=$_vidix_drv_mach64
7765 VIDIX_MGA=$_vidix_drv_mga
7766 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7767 VIDIX_NVIDIA=$_vidix_drv_nvidia
7768 VIDIX_PM2=$_vidix_drv_pm2
7769 VIDIX_PM3=$_vidix_drv_pm3
7770 VIDIX_RADEON=$_vidix_drv_radeon
7771 VIDIX_RAGE128=$_vidix_drv_rage128
7772 VIDIX_SAVAGE=$_vidix_drv_savage
7773 VIDIX_SIS=$_vidix_drv_sis
7774 VIDIX_UNICHROME=$_vidix_drv_unichrome
7776 # --- Some stuff for autoconfigure ----
7777 $_target_arch
7778 $_target_arch_x86
7779 $_confwin32
7780 TARGET_CPU=$iproc
7781 HAVE_MMX = $_mmx
7782 HAVE_MMX2 = $_mmxext
7783 HAVE_3DNOW = $_3dnow
7784 HAVE_3DNOWEX = $_3dnowext
7785 HAVE_SSE = $_sse
7786 HAVE_CMOV = $_cmov
7787 HAVE_ALTIVEC = $_altivec
7788 HAVE_ARMV5TE = $_armv5te
7789 HAVE_ARMV6 = $_armv6
7790 HAVE_IWMMXT = $_iwmmxt
7791 HAVE_VIS = $_vis
7793 # --- GUI stuff ---
7794 GUI = $_gui
7796 # --- libvo stuff ---
7797 VO_SRCS = $_vosrc
7799 # --- libao2 stuff ---
7800 AO_SRCS = $_aosrc
7802 # --- libaf stuff ---
7803 AF_SRCS = $_afsrc
7807 #############################################################################
7809 ff_config_enable () {
7810 _nprefix=$3;
7811 test -z "$_nprefix" && _nprefix='CONFIG'
7812 for part in $1; do
7813 if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
7814 echo "#define ${_nprefix}_$part 1"
7815 echo "#define ENABLE_$part 1"
7816 else
7817 echo "#define ENABLE_$part 0"
7819 done
7822 echo "Creating config.h"
7823 cat > $TMPH << EOF
7824 /* -------- This file has been automatically generated by configure ---------
7825 Note: Any changes in it will be lost when you run configure again. */
7827 /* Protect against multiple inclusion */
7828 #ifndef MPLAYER_CONFIG_H
7829 #define MPLAYER_CONFIG_H 1
7831 #define CONFIGURATION "$_configuration"
7833 /* make sure we never get lavformat's poll() emulation, the results are
7834 horrible if the X libs try to actually use it, see MPlayer-users
7835 Message-ID: <45D49541.8060101@infernix.net>
7836 Date: Thu, 15 Feb 2007 18:15:45 +0100
7837 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7839 #define HAVE_SYS_POLL_H 1
7841 /* yes, we have inttypes.h */
7842 #define HAVE_INTTYPES_H 1
7844 /* int_fastXY_t emulation */
7845 $_def_fast_inttypes
7847 /* libdvdcss */
7848 #define HAVE_ERRNO_H 1
7850 /* libdvdcss + libdvdread */
7851 #define HAVE_LIMITS_H 1
7853 /* libdvdcss + libfaad2 */
7854 #define HAVE_UNISTD_H 1
7856 /* libfaad2 + libdvdread */
7857 #define STDC_HEADERS 1
7859 /* libfaad2 */
7860 #define HAVE_MEMCPY 1
7861 #define HAVE_STRCHR 1
7863 /* libdvdread */
7864 #define HAVE_UINTPTR_T 1
7866 /* name of messages charset */
7867 $_def_charset
7869 /* Runtime CPU detection */
7870 $_def_runtime_cpudetection
7872 /* Dynamic a/v plugins */
7873 $_def_dynamic_plugins
7875 /* "restrict" keyword */
7876 $_def_restrict_keyword
7878 /* __builtin_expect branch prediction hint */
7879 $_def_builtin_expect
7880 #ifdef HAVE_BUILTIN_EXPECT
7881 #define likely(x) __builtin_expect ((x) != 0, 1)
7882 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7883 #else
7884 #define likely(x) (x)
7885 #define unlikely(x) (x)
7886 #endif
7888 /* attribute(used) as needed by some compilers */
7889 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7890 # define attribute_used __attribute__((used))
7891 #else
7892 # define attribute_used
7893 #endif
7895 /* compiler support for named assembler arguments */
7896 $_def_named_asm_args
7898 /* enable/disable SIGHANDLER */
7899 $_def_sighandler
7901 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7902 $_def_crash_debug
7904 /* Toggles debugging informations */
7905 $_def_debug
7907 /* Toggles color console output */
7908 $_def_color_console
7910 /* Indicates that libcdio is available for VCD and CD-DA playback */
7911 $_def_libcdio
7913 /* Indicates that Ogle's libdvdread is available for DVD playback */
7914 $_def_dvdread
7916 /* Indicates that dvdread is internal */
7917 $_def_dvdread_internal
7919 /* Additional options for libdvdread/libdvdcss */
7920 $_def_dvd
7921 $_def_cdrom
7922 $_def_cdio
7923 $_def_dvdio
7924 $_def_bsdi_dvd
7925 $_def_dvd_bsd
7926 $_def_dvd_linux
7927 $_dev_dvd_openbsd
7928 $_def_dvd_darwin
7929 $_def_sol_scsi_h
7930 $_def_hpux_scsi_h
7932 /* Common data directory (for fonts, etc) */
7933 #define MPLAYER_DATADIR "$_datadir"
7934 #define MPLAYER_CONFDIR "$_confdir"
7935 #define MPLAYER_LIBDIR "$_libdir"
7937 /* Define this to compile stream-caching support, it can be enabled via
7938 -cache <kilobytes> */
7939 $_def_stream_cache
7941 /* Define if you are using XviD library */
7942 $_def_xvid
7944 /* Define if you are using the X.264 library */
7945 $_def_x264
7947 /* Define if you are using libnut */
7948 $_def_libnut
7950 /* Define to include support for libdv-0.9.5 */
7951 $_def_libdv
7953 /* If build mencoder */
7954 $_mencoder_flag
7956 /* Indicates if libmp3lame is available
7957 Note: for mencoder */
7958 $_def_mp3lame
7959 $_def_mp3lame_preset
7960 $_def_mp3lame_preset_medium
7962 /* Undefine this if you do not want to select mono audio (left or right)
7963 with a stereo MPEG layer 2/3 audio stream. The command line option
7964 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7965 right-only), with 0 being the default.
7967 #define USE_FAKE_MONO 1
7969 /* Undefine this if your sound card driver has no working select().
7970 If you have kernel Oops, player hangups, or just no audio, you should
7971 try to recompile MPlayer with this option disabled! */
7972 $_def_select
7974 /* define this to use iconv(3) function to codepage conversions */
7975 $_def_iconv
7977 /* define this to use nl_langinfo function */
7978 $_def_langinfo
7980 /* define this to use RTC (/dev/rtc) for video timers */
7981 $_def_rtc
7983 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7984 #define MAX_OUTBURST 65536
7986 /* set up audio OUTBURST. Do not change this! */
7987 #define OUTBURST 512
7989 /* Define this if your system has the header file for the OSS sound interface */
7990 $_def_sys_soundcard
7992 /* Define this if your system has the header file for the OSS sound interface
7993 * in /usr/include */
7994 $_def_soundcard
7996 /* Define this if your system has the sysinfo header */
7997 $_def_sys_sysinfo
7999 /* Define this if your system has the "malloc.h" header file */
8000 $_def_malloc
8002 /* memalign is mapped to malloc if unsupported */
8003 $_def_memalign
8004 $_def_map_memalign
8005 $_def_memalign_hack
8007 /* assembler handling of .align */
8008 $_def_asmalign_pot
8010 /* Define this if your system has the "alloca.h" header file */
8011 $_def_alloca
8013 /* Define this if your system has the "sys/mman.h" header file */
8014 $_def_mman
8015 $_def_mman_has_map_failed
8017 /* Define this if you have the elf dynamic linker -ldl library */
8018 $_def_dl
8020 /* Define this if you have the kstat kernel statistics library */
8021 $_def_kstat
8023 /* Define this if you have zlib */
8024 $_def_zlib
8025 #ifdef HAVE_ZLIB
8026 #define CONFIG_ZLIB 1
8027 #endif
8029 /* Define this if you have shm support */
8030 $_def_shm
8032 /* Define this if your system has strsep */
8033 $_def_strsep
8035 /* Define this if your system has vsscanf */
8036 $_def_vsscanf
8038 /* Define this if your system has swab */
8039 $_def_swab
8041 /* Define this if your system has posix select */
8042 $_def_posix_select
8044 /* Define this if your system has gettimeofday */
8045 $_def_gettimeofday
8047 /* Define this if your system has glob */
8048 $_def_glob
8050 /* Define this if your system has setenv */
8051 $_def_setenv
8052 #ifndef HAVE_SETENV
8053 int setenv(const char *name, const char *val, int overwrite);
8054 #endif
8056 /* Define this if your system has sysi86 */
8057 $_def_sysi86
8058 $_def_sysi86_iv
8060 /* Define this if your system has pthreads */
8061 $_def_pthreads
8063 /* Define this if you enabled thread support for libavcodec */
8064 $_def_threads
8065 #ifdef HAVE_THREADS
8066 #define ENABLE_THREADS 1
8067 #else
8068 #define ENABLE_THREADS 0
8069 #endif
8071 /* LIRC (remote control, see www.lirc.org) support: */
8072 $_def_lirc
8074 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8075 $_def_apple_remote
8077 /* Support for maemo (http://www.maemo.org) */
8078 $_def_maemo
8081 * LIRCCD (LIRC client daemon)
8082 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8084 $_def_lircc
8086 /* DVD navigation support using libdvdnav */
8087 $_def_dvdnav
8089 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8090 #define MPEG12_POSTPROC 1
8092 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8093 $_def_libpostproc
8094 $_def_libpostproc_a
8095 $_def_libpostproc_so
8097 /* Win32 DLL support */
8098 $_def_win32dll
8099 #define WIN32_PATH "$_win32codecsdir"
8101 /* Mac OS X specific features */
8102 $_def_macosx
8103 $_def_macosx_finder_support
8104 $_def_macosx_bundle
8105 $_def_macosx_corevideo
8107 /* Build our Win32-loader */
8108 $_def_win32_loader
8110 /* ffmpeg's libavcodec support (requires libavcodec source) */
8111 $_def_libavcodec
8112 $_def_libavcodec_a
8113 $_def_libavcodec_so
8114 $_def_libavcodec_mpegaudio_hp
8116 /* ffmpeg's libavformat support (requires libavformat source) */
8117 $_def_libavformat
8118 $_def_libavformat_a
8119 $_def_libavformat_so
8121 $_def_libavutil
8122 $_def_libavutil_a
8123 $_def_libavutil_so
8125 /* Use libavcodec's decoders */
8126 #define CONFIG_DECODERS 1
8127 /* Use libavcodec's encoders */
8128 #define CONFIG_ENCODERS 1
8130 /* Use libavformat's demuxers */
8131 #define CONFIG_DEMUXERS 1
8132 /* Use libavformat's muxers */
8133 $_def_muxers
8135 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8136 #define HAVE_EBX_AVAILABLE 1
8137 #ifndef MP_DEBUG
8138 #define HAVE_EBP_AVAILABLE 1
8139 #endif
8141 #define CONFIG_GPL 1
8142 #define ENABLE_SMALL 0
8144 /* Support for grayscale encoding/decoding in FFmpeg (makes color slower) */
8145 #define ENABLE_GRAY 1
8147 /* Use AMR codecs from libavcodec. */
8148 $_def_libamr
8149 $_def_libamr_nb
8150 $_def_libamr_wb
8152 /* Use specific parts from FFmpeg. */
8153 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8154 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8155 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8156 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8157 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8158 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8159 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8161 $_def_lavc_faac
8162 $_def_lavc_xvid
8163 $_def_lavc_mp3lame
8164 $_def_lavc_x264
8166 /* Use codec libs included in mplayer CVS / source dist: */
8167 $_def_mp3lib
8168 $_def_liba52
8169 $_def_libdca
8170 $_def_libmpeg2
8172 /* XAnim DLL support */
8173 $_def_xanim
8174 /* Default search path */
8175 $_def_xanim_path
8177 /* RealPlayer DLL support */
8178 $_def_real
8179 /* Default search path */
8180 $_def_real_path
8182 /* LIVE555 Streaming Media library support */
8183 $_def_live
8185 /* libnemesi Streaming Media library support */
8186 $_def_nemesi
8188 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8189 $_def_fastmemcpy
8191 /* Use UnRAR executable for Vobsubs */
8192 $_def_unrar_exec
8194 /* gui support, please do not edit this option */
8195 $_def_gui
8196 $_def_gtk2_gui
8198 /* Audio output drivers */
8199 $_def_ossaudio
8200 $_def_ossaudio_devdsp
8201 $_def_ossaudio_devmixer
8202 $_def_alsa5
8203 $_def_alsa9
8204 $_def_alsa1x
8205 $_def_arts
8206 $_def_esd
8207 $_def_esd_latency
8208 $_def_pulse
8209 $_def_jack
8210 $_def_openal
8211 $_def_openal_h
8212 $_def_sys_asoundlib_h
8213 $_def_alsa_asoundlib_h
8214 $_def_sunaudio
8215 $_def_sgiaudio
8216 $_def_win32waveout
8217 $_def_nas
8219 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8220 #undef FAST_OSD
8221 #undef FAST_OSD_TABLE
8223 /* Enable TV Interface support */
8224 $_def_tv
8226 /* Enable Video 4 Linux TV interface support */
8227 $_def_tv_v4l
8229 /* Enable Video 4 Linux 1 TV interface support */
8230 $_def_tv_v4l1
8232 /* Enable Video 4 Linux 2 TV interface support */
8233 $_def_tv_v4l2
8235 /* Enable DirectShow TV interface support */
8236 $_def_tv_dshow
8238 /* *BSD BrookTree headers */
8239 $_def_ioctl_meteor_h_name
8240 $_def_ioctl_bt848_h_name
8242 /* Enable *BSD BrookTree TV interface support */
8243 $_def_tv_bsdbt848
8245 /* Enable TV Teletext Interface support */
8246 $_def_tv_teletext
8248 /* Enable Radio Interface support */
8249 $_def_radio
8251 /* Enable Capture for Radio Interface support */
8252 $_def_radio_capture
8254 /* Enable Video 4 Linux Radio interface support */
8255 $_def_radio_v4l
8257 /* Enable Video 4 Linux 2 Radio interface support */
8258 $_def_radio_v4l2
8260 /* Enable *BSD BrookTree Radio interface support */
8261 $_def_radio_bsdbt848
8263 /* Enable Video 4 Linux 2 MPEG PVR support */
8264 $_def_pvr
8266 /* Define if your processor stores words with the most significant
8267 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8268 $_def_words_endian
8270 /* Define if your processor can access unaligned data in a fast way */
8271 $_def_fast_unaligned
8273 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8275 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8276 have the instruction. */
8277 $_def_dcbzl
8279 /* only gcc3 can compile mvi instructions (libmpeg2) */
8280 $_def_gcc_mvi_support
8282 /* Define this for Cygwin build for win32 */
8283 $_def_confwin32
8285 /* Define this to any prefered value from 386 up to infinity with step 100 */
8286 #define __CPU__ $iproc
8288 $_mp_wordsize
8290 $_def_linux
8292 $_def_vcd
8294 #ifdef sun
8295 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8296 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8297 #elif defined(WIN32)
8298 #define DEFAULT_CDROM_DEVICE "D:"
8299 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8300 #elif defined(__APPLE__) || defined(__DARWIN__)
8301 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8302 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8303 #elif defined(__OpenBSD__)
8304 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8305 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8306 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8307 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8308 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8309 #elif defined(__AMIGAOS4__)
8310 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8311 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8312 #else
8313 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8314 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8315 #endif
8318 /*----------------------------------------------------------------------------
8320 ** NOTE: Instead of modifying these definitions here, use the
8321 ** --enable/--disable options of the ./configure script!
8322 ** See ./configure --help for details.
8324 *---------------------------------------------------------------------------*/
8326 /* C99 lrintf function available */
8327 $_def_lrintf
8329 /* mkstemp support */
8330 $_def_mkstemp
8332 /* nanosleep support */
8333 $_def_nanosleep
8335 /* SMB support */
8336 $_def_smbsupport
8338 /* termcap flag for getch2.c */
8339 $_def_termcap
8341 /* termios flag for getch2.c */
8342 $_def_termios
8343 $_def_termios_h
8344 $_def_termios_sys_h
8346 /* enable PNG support */
8347 $_def_png
8349 /* enable JPEG support */
8350 $_def_jpeg
8352 /* enable PNM support */
8353 $_def_pnm
8355 /* enable md5sum support */
8356 $_def_md5sum
8358 /* enable GIF support */
8359 $_def_gif
8360 $_def_gif_4
8361 $_def_gif_tvt_hack
8363 /* enable bitmap font support */
8364 $_def_bitmap_font
8366 /* enable FreeType support */
8367 $_def_freetype
8369 /* enable Fontconfig support */
8370 $_def_fontconfig
8372 /* enable SSA/ASS support */
8373 $_def_ass
8375 /* enable FriBiDi usage */
8376 $_def_fribidi
8378 /* enable ENCA usage */
8379 $_def_enca
8381 /* liblzo support */
8382 $_def_liblzo
8383 #ifdef USE_LIBLZO
8384 #define CONFIG_LZO 1
8385 #endif
8387 /* libmad support */
8388 $_def_mad
8390 /* enable OggVorbis support */
8391 $_def_vorbis
8392 $_def_tremor
8394 /* enable Speex support */
8395 $_def_speex
8397 /* enable musepack support */
8398 $_def_musepack
8400 /* enable OggTheora support */
8401 $_def_theora
8403 /* enable FAAD (AAC) support */
8404 $_def_faad
8405 $_def_faad_internal
8407 /* enable FAAC (AAC encoder) support */
8408 $_def_faac
8410 /* enable LADSPA plugin support */
8411 $_def_ladspa
8413 /* enable network */
8414 $_def_network
8416 /* enable ftp support */
8417 $_def_ftp
8419 /* enable vstream support */
8420 $_def_vstream
8422 /* enable winsock2 instead of Unix functions*/
8423 $_def_winsock2
8425 /* define this to use inet_aton() instead of inet_pton() */
8426 $_def_use_aton
8428 /* enables / disables cdparanoia support */
8429 $_def_cdparanoia
8430 $_def_cddb
8432 /* enables / disables VIDIX usage */
8433 $_def_vidix
8434 $_def_vidix_drv_cyberblade
8435 $_def_vidix_drv_ivtv
8436 $_def_vidix_drv_mach64
8437 $_def_vidix_drv_mga
8438 $_def_vidix_drv_mga_crtc2
8439 $_def_vidix_drv_nvidia
8440 $_def_vidix_drv_pm3
8441 $_def_vidix_drv_radeon
8442 $_def_vidix_drv_rage128
8443 $_def_vidix_drv_savage
8444 $_def_vidix_drv_sis
8445 $_def_vidix_drv_unichrome
8446 $_def_vidix_pfx
8448 /* enables / disables new input joystick support */
8449 $_def_joystick
8451 /* enables / disables QTX codecs */
8452 $_def_qtx
8454 /* enables / disables osd menu */
8455 $_def_menu
8457 /* enables / disables subtitles sorting */
8458 $_def_sortsub
8460 /* XMMS input plugin support */
8461 $_def_xmms
8462 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8464 /* enables inet6 support */
8465 $_def_inet6
8467 /* do we have gethostbyname2? */
8468 $_def_gethostbyname2
8470 /* Extension defines */
8471 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8473 $_def_altivec_h // enables usage of altivec.h
8475 /* libmpeg2 uses a different feature test macro for mediaLib */
8476 #ifdef HAVE_MLIB
8477 #define LIBMPEG2_MLIB 1
8478 #endif
8480 /* libvo options */
8481 #define SCREEN_SIZE_X 1
8482 #define SCREEN_SIZE_Y 1
8483 $_def_x11
8484 $_def_xv
8485 $_def_xvmc
8486 $_def_vm
8487 $_def_xf86keysym
8488 $_def_xinerama
8489 $_def_gl
8490 $_def_gl_win32
8491 $_def_dga
8492 $_def_dga1
8493 $_def_dga2
8494 $_def_sdl
8495 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8496 $_def_sdlbuggy
8497 $_def_directx
8498 $_def_ggi
8499 $_def_ggiwmh
8500 $_def_3dfx
8501 $_def_s3fb
8502 $_def_tdfxfb
8503 $_def_tdfxvid
8504 $_def_xvr100
8505 $_def_directfb
8506 $_def_directfb_version
8507 $_def_dfbmga
8508 $_def_zr
8509 $_def_bl
8510 $_def_mga
8511 $_def_xmga
8512 $_def_fbdev
8513 $_def_dxr2
8514 $_def_dxr3
8515 $_def_ivtv
8516 $_def_v4l2
8517 $_def_dvb
8518 $_def_dvb_in
8519 $_def_svga
8520 $_def_vesa
8521 $_def_xss
8522 $_def_xdpms
8523 $_def_aa
8524 $_def_caca
8525 $_def_tga
8526 $_def_toolame
8527 $_def_twolame
8529 /* used by GUI: */
8530 $_def_xshape
8532 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8533 #define X11_FULLSCREEN 1
8534 #endif
8536 #endif /* MPLAYER_CONFIG_H */
8539 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8540 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8542 #############################################################################
8544 cat << EOF
8546 Config files successfully generated by ./configure $_configuration !
8548 Install prefix: $_prefix
8549 Data directory: $_datadir
8550 Config direct.: $_confdir
8552 Byte order: $_byte_order
8553 Optimizing for: $_optimizing
8555 Languages:
8556 Messages/GUI: $_language
8559 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8560 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8561 echo
8563 cat << EOF
8565 Enabled optional drivers:
8566 Input: $_inputmodules
8567 Codecs: $_codecmodules
8568 Audio output: $_aomodules
8569 Video output: $_vomodules
8570 Audio filters: $_afmodules
8571 Disabled optional drivers:
8572 Input: $_noinputmodules
8573 Codecs: $_nocodecmodules
8574 Audio output: $_noaomodules
8575 Video output: $_novomodules
8576 Audio filters: $_noafmodules
8578 'config.h' and 'config.mak' contain your configuration options.
8579 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8580 compile *** DO NOT REPORT BUGS if you tweak these files ***
8582 'make' will now compile MPlayer and 'make install' will install it.
8583 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8588 if test "$_mtrr" = yes ; then
8589 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8590 echo
8593 if ! x86_32; then
8594 cat <<EOF
8595 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8596 operating system ($system_name). You may encounter a few files that cannot
8597 be played due to missing open source video/audio codec support.
8603 cat <<EOF
8604 Check $TMPLOG if you wonder why an autodetection failed (make sure
8605 development headers/packages are installed).
8607 NOTE: The --enable-* parameters unconditionally force options on, completely
8608 skipping autodetection. This behavior is unlike what you may be used to from
8609 autoconf-based configure scripts that can decide to override you. This greater
8610 level of control comes at a price. You may have to provide the correct compiler
8611 and linker flags yourself.
8612 If you used one of these options (except --enable-gui and similar ones that
8613 turn on internal features) and experience a compilation or linking failure,
8614 make sure you have passed the necessary compiler/linker flags to configure.
8616 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8620 if test "$_warn_CFLAGS" = yes; then
8621 cat <<EOF
8623 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8625 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8627 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8628 To do so, execute 'CFLAGS= ./configure <options>'
8633 # Last move:
8634 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"