Make up missing header update in r25326.
[mplayer/greg.git] / configure
blob0aa8cc7f5d6a09df99942da6438cce13838d5612
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 --enable-largefiles enable support for files > 2GB [disable]
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-unrarlib disable Unique RAR File Library [enabled]
259 --enable-menu enable OSD menu (not DVD menu) [disabled]
260 --disable-sortsub disable subtitle sorting [enabled]
261 --enable-fribidi enable the FriBiDi libs [autodetect]
262 --disable-enca disable ENCA charset oracle library [autodetect]
263 --disable-macosx disable Mac OS X specific features [autodetect]
264 --disable-maemo disable maemo specific features [autodetect]
265 --enable-macosx-finder-support enable Mac OS X Finder invocation
266 parameter parsing [disabled]
267 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
268 --disable-inet6 disable IPv6 support [autodetect]
269 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
270 --disable-ftp disable FTP support [enabled]
271 --disable-vstream disable TiVo vstream client support [autodetect]
272 --disable-pthreads disable Posix threads support [autodetect]
273 --disable-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 --enable-fbdev enable FBDev video output [autodetect]
367 --enable-mlib enable mediaLib video output (Solaris) [disable]
368 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
369 --enable-tdfxfb enable tdfxfb video output [disable]
370 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
371 --enable-directfb enable DirectFB video output [autodetect]
372 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
373 --enable-bl enable Blinkenlights video output [disable]
374 --enable-tdfxvid enable tdfx_vid video output [disable]
375 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
376 --disable-tga disable Targa video output [enable]
377 --disable-pnm disable PNM video output [enable]
378 --disable-md5sum disable md5sum video output [enable]
380 Audio output:
381 --disable-alsa disable ALSA audio output [autodetect]
382 --disable-ossaudio disable OSS audio output [autodetect]
383 --disable-arts disable aRts audio output [autodetect]
384 --disable-esd disable esd audio output [autodetect]
385 --disable-pulse disable Pulseaudio audio output [autodetect]
386 --disable-jack disable JACK audio output [autodetect]
387 --disable-openal disable OpenAL audio output [autodetect]
388 --disable-nas disable NAS audio output [autodetect]
389 --disable-sgiaudio disable SGI audio output [autodetect]
390 --disable-sunaudio disable Sun audio output [autodetect]
391 --disable-win32waveout disable Windows waveout audio output [autodetect]
392 --disable-select disable using select() on the audio device [enable]
394 Miscellaneous options:
395 --enable-runtime-cpudetection enable runtime CPU detection [disable]
396 --enable-cross-compile enable cross-compilation [autodetect]
397 --cc=COMPILER C compiler to build MPlayer [gcc]
398 --host-cc=COMPILER C compiler for tools needed while building [gcc]
399 --as=ASSEMBLER assembler to build MPlayer [as]
400 --ar=AR librarian to build MPlayer [ar]
401 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
402 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
403 --enable-static build a statically linked binary
404 --charset=charset convert the console messages to this character set
405 --language=list a white space or comma separated list of languages for
406 translated man pages, the first language is used for
407 messages and the GUI (the environment variable
408 \$LINGUAS is also honored) [en]
409 (Available: $LANGUAGES all)
410 --with-install=PATH path to a custom install program
411 --enable-color-console enable color console output (UNSUPPORTED) [disable]
413 Advanced options:
414 --enable-mmx enable MMX [autodetect]
415 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
416 --enable-3dnow enable 3DNow! [autodetect]
417 --enable-3dnowext enable extended 3DNow! [autodetect]
418 --enable-sse enable SSE [autodetect]
419 --enable-sse2 enable SSE2 [autodetect]
420 --enable-ssse3 enable SSSE3 [autodetect]
421 --enable-shm enable shm [autodetect]
422 --enable-altivec enable AltiVec (PowerPC) [autodetect]
423 --enable-armv5te enable DSP extensions (ARM) [autodetect]
424 --enable-armv6 enable ARMv6 (ARM) [autodetect]
425 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
426 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
427 --enable-big-endian force byte order to big-endian [autodetect]
428 --enable-debug[=1-3] compile-in debugging information [disable]
429 --enable-profile compile-in profiling information [disable]
430 --disable-sighandler disable sighandler for crashes [enable]
431 --enable-crash-debug enable automatic gdb attach on crash [disable]
432 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
434 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
435 --disable-gcc-check disable gcc version checking [enable]
437 Use these options if autodetection fails (Options marked with (*) accept
438 multiple paths separated by ':'):
439 --extra-libs=FLAGS extra linker flags
440 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
441 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
442 --with-extraincdir=DIR extra header search paths in DIR (*)
443 --with-extralibdir=DIR extra linker search paths in DIR (*)
444 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
446 --with-freetype-config=PATH path to freetype-config
447 --with-fribidi-config=PATH path to fribidi-config
448 --with-glib-config=PATH path to glib*-config
449 --with-gtk-config=PATH path to gtk*-config
450 --with-sdl-config=PATH path to sdl*-config
451 --with-dvdnav-config=PATH path to dvdnav-config
453 This configure script is NOT autoconf-based, even though its output is similar.
454 It will try to autodetect all configuration options. If you --enable an option
455 it will be forcefully turned on, skipping autodetection. This can break
456 compilation, so you need to know what you are doing.
458 exit 0
459 } #show_help()
461 # GOTCHA: the variables below defines the default behavior for autodetection
462 # and have - unless stated otherwise - at least 2 states : yes no
463 # If autodetection is available then the third state is: auto
464 _mmx=auto
465 _3dnow=auto
466 _3dnowext=auto
467 _mmxext=auto
468 _sse=auto
469 _sse2=auto
470 _ssse3=auto
471 _cmov=auto
472 _fast_cmov=auto
473 _armv5te=auto
474 _armv6=auto
475 _iwmmxt=auto
476 _mtrr=auto
477 _altivec=auto
478 _install=install
479 _ranlib=ranlib
480 _ldconfig=ldconfig
481 _cc=cc
482 _ar=ar
483 test "$CC" && _cc="$CC"
484 _gcc_check=yes
485 _as=auto
486 _runtime_cpudetection=no
487 _cross_compile=auto
488 _prefix="/usr/local"
489 _libavutil_a=auto
490 _libavutil_so=auto
491 _libavcodec_a=auto
492 _libamr_nb=auto
493 _libamr_wb=auto
494 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
495 _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// `
496 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
497 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// -e s/LIBVORBIS_ENCODER// `
498 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
499 _libavparsers=$_libavparsers_all
500 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
501 _libavbsfs=$_libavbsfs_all
502 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
503 _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// `
504 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
505 _libavmuxers=`echo $_libavmuxers_all | sed -e s/RTP_MUXER// `
506 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
507 _libavcodec_so=auto
508 _libavformat_a=auto
509 _libavformat_so=auto
510 _libpostproc_a=auto
511 _libpostproc_so=auto
512 _libavcodec_mpegaudio_hp=yes
513 _mencoder=yes
514 _mplayer=yes
515 _x11=auto
516 _xshape=auto
517 _dga1=auto
518 _dga2=auto
519 _xv=auto
520 _xvmc=no #auto when complete
521 _sdl=auto
522 _directx=auto
523 _win32waveout=auto
524 _nas=auto
525 _png=auto
526 _jpeg=auto
527 _pnm=yes
528 _md5sum=yes
529 _gif=auto
530 _gl=auto
531 _ggi=auto
532 _ggiwmh=auto
533 _aa=auto
534 _caca=auto
535 _svga=auto
536 _vesa=auto
537 _fbdev=auto
538 _dvb=auto
539 _dvbhead=auto
540 _dxr2=auto
541 _dxr3=auto
542 _ivtv=auto
543 _v4l2=auto
544 _iconv=auto
545 _langinfo=auto
546 _rtc=auto
547 _ossaudio=auto
548 _arts=auto
549 _esd=auto
550 _pulse=auto
551 _jack=auto
552 _openal=auto
553 _libcdio=auto
554 _liblzo=auto
555 _mad=auto
556 _toolame=auto
557 _twolame=auto
558 _tremor_internal=yes
559 _tremor_low=no
560 _tremor_external=auto
561 _libvorbis=auto
562 _speex=auto
563 _theora=auto
564 _mp3lib=yes
565 _liba52=yes
566 _libdca=auto
567 _libmpeg2=yes
568 _faad_internal=auto
569 _faad_external=auto
570 _faad_fixed=no
571 _faac=auto
572 _ladspa=auto
573 _xmms=no
574 _dvdnav=auto
575 _dvdnavconfig=dvdnav-config
576 _dvdread=auto
577 _dvdread_internal=auto
578 _libdvdcss_internal=auto
579 _xanim=auto
580 _real=auto
581 _live=auto
582 _nemesi=auto
583 _native_rtsp=yes
584 _xinerama=auto
585 _mga=auto
586 _xmga=auto
587 _vm=auto
588 _xf86keysym=auto
589 _mlib=no #broken, thus disabled
590 _sgiaudio=auto
591 _sunaudio=auto
592 _alsa=auto
593 _fastmemcpy=yes
594 _unrarlib=yes
595 _win32dll=auto
596 _select=yes
597 _radio=no
598 _radio_capture=no
599 _radio_v4l=auto
600 _radio_v4l2=auto
601 _radio_bsdbt848=auto
602 _tv=yes
603 _tv_v4l1=auto
604 _tv_v4l2=auto
605 _tv_bsdbt848=auto
606 _tv_dshow=auto
607 _tv_teletext=auto
608 _pvr=auto
609 _network=yes
610 _winsock2=auto
611 _smbsupport=auto
612 _vidix_internal=auto
613 _vidix_external=auto
614 _vidix_pcidb=yes
615 _joystick=no
616 _xvid=auto
617 _x264=auto
618 _libnut=auto
619 _lirc=auto
620 _lircc=auto
621 _apple_remote=auto
622 _gui=no
623 _gtk1=no
624 _termcap=auto
625 _termios=auto
626 _3dfx=no
627 _s3fb=no
628 _tdfxfb=no
629 _tdfxvid=no
630 _xvr100=auto
631 _tga=yes
632 _directfb=auto
633 _zr=auto
634 _bl=no
635 _largefiles=no
636 #_language=en
637 _shm=auto
638 _linux_devfs=no
639 _charset="UTF-8"
640 _dynamic_plugins=no
641 _crash_debug=no
642 _sighandler=yes
643 _libdv=auto
644 _cdparanoia=auto
645 _cddb=auto
646 _big_endian=auto
647 _bitmap_font=yes
648 _freetype=auto
649 _fontconfig=auto
650 _menu=no
651 _qtx=auto
652 _macosx=auto
653 _maemo=auto
654 _macosx_finder_support=no
655 _macosx_bundle=auto
656 _sortsub=yes
657 _freetypeconfig='freetype-config'
658 _fribidi=auto
659 _fribidiconfig='fribidi-config'
660 _enca=auto
661 _inet6=auto
662 _gethostbyname2=auto
663 _ftp=yes
664 _musepack=auto
665 _vstream=auto
666 _pthreads=auto
667 _w32threads=auto
668 _ass=auto
669 _rpath=no
670 _asmalign_pot=auto
671 _color_console=no
672 _stream_cache=yes
673 _def_stream_cache="#define USE_STREAM_CACHE 1"
674 _need_shmem=yes
675 for ac_option do
676 case "$ac_option" in
677 --help|-help|-h)
678 show_help
680 --prefix=*)
681 _prefix=`echo $ac_option | cut -d '=' -f 2`
683 --bindir=*)
684 _bindir=`echo $ac_option | cut -d '=' -f 2`
686 --datadir=*)
687 _datadir=`echo $ac_option | cut -d '=' -f 2`
689 --mandir=*)
690 _mandir=`echo $ac_option | cut -d '=' -f 2`
692 --confdir=*)
693 _confdir=`echo $ac_option | cut -d '=' -f 2`
695 --libdir=*)
696 _libdir=`echo $ac_option | cut -d '=' -f 2`
698 --codecsdir=*)
699 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
701 --win32codecsdir=*)
702 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
704 --xanimcodecsdir=*)
705 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
707 --realcodecsdir=*)
708 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
710 --with-extraincdir=*)
711 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
713 --with-extralibdir=*)
714 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
717 --with-install=*)
718 _install=`echo $ac_option | cut -d '=' -f 2 `
720 --with-xvmclib=*)
721 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
724 --with-sdl-config=*)
725 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
727 --with-freetype-config=*)
728 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
730 --with-fribidi-config=*)
731 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
733 --with-gtk-config=*)
734 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
736 --with-glib-config=*)
737 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
739 --with-dvdnav-config=*)
740 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
743 --extra-libs=*)
744 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
746 --extra-libs-mplayer=*)
747 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
749 --extra-libs-mencoder=*)
750 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
753 --target=*)
754 _target=`echo $ac_option | cut -d '=' -f 2`
756 --cc=*)
757 _cc=`echo $ac_option | cut -d '=' -f 2`
759 --host-cc=*)
760 _host_cc=`echo $ac_option | cut -d '=' -f 2`
762 --as=*)
763 _as=`echo $ac_option | cut -d '=' -f 2`
765 --ar=*)
766 _ar=`echo $ac_option | cut -d '=' -f 2`
768 --ranlib=*)
769 _ranlib=`echo $ac_option | cut -d '=' -f 2`
771 --charset=*)
772 _charset=`echo $ac_option | cut -d '=' -f 2`
774 --language=*)
775 _language=`echo $ac_option | cut -d '=' -f 2`
778 --enable-static)
779 _ld_static='-static'
781 --disable-static)
782 _ld_static=''
784 --enable-profile)
785 _profile='-p'
787 --disable-profile)
788 _profile=
790 --enable-debug)
791 _debug='-g'
793 --enable-debug=*)
794 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
796 --disable-debug)
797 _debug=
799 --enable-gcc-check) _gcc_check=yes ;;
800 --disable-gcc-check) _gcc_check=no ;;
801 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
802 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
803 --enable-cross-compile) _cross_compile=yes ;;
804 --disable-cross-compile) _cross_compile=no ;;
805 --enable-mencoder) _mencoder=yes ;;
806 --disable-mencoder) _mencoder=no ;;
807 --enable-mplayer) _mplayer=yes ;;
808 --disable-mplayer) _mplayer=no ;;
809 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
810 --disable-dynamic-plugins) _dynamic_plugins=no ;;
811 --enable-x11) _x11=yes ;;
812 --disable-x11) _x11=no ;;
813 --enable-xshape) _xshape=yes ;;
814 --disable-xshape) _xshape=no ;;
815 --enable-xv) _xv=yes ;;
816 --disable-xv) _xv=no ;;
817 --enable-xvmc) _xvmc=yes ;;
818 --disable-xvmc) _xvmc=no ;;
819 --enable-sdl) _sdl=yes ;;
820 --disable-sdl) _sdl=no ;;
821 --enable-directx) _directx=yes ;;
822 --disable-directx) _directx=no ;;
823 --enable-win32waveout) _win32waveout=yes ;;
824 --disable-win32waveout) _win32waveout=no ;;
825 --enable-nas) _nas=yes ;;
826 --disable-nas) _nas=no ;;
827 --enable-png) _png=yes ;;
828 --disable-png) _png=no ;;
829 --enable-jpeg) _jpeg=yes ;;
830 --disable-jpeg) _jpeg=no ;;
831 --enable-pnm) _pnm=yes ;;
832 --disable-pnm) _pnm=no ;;
833 --enable-md5sum) _md5sum=yes ;;
834 --disable-md5sum) _md5sum=no ;;
835 --enable-gif) _gif=yes ;;
836 --disable-gif) _gif=no ;;
837 --enable-gl) _gl=yes ;;
838 --disable-gl) _gl=no ;;
839 --enable-ggi) _ggi=yes ;;
840 --disable-ggi) _ggi=no ;;
841 --enable-ggiwmh) _ggiwmh=yes ;;
842 --disable-ggiwmh) _ggiwmh=no ;;
843 --enable-aa) _aa=yes ;;
844 --disable-aa) _aa=no ;;
845 --enable-caca) _caca=yes ;;
846 --disable-caca) _caca=no ;;
847 --enable-svga) _svga=yes ;;
848 --disable-svga) _svga=no ;;
849 --enable-vesa) _vesa=yes ;;
850 --disable-vesa) _vesa=no ;;
851 --enable-fbdev) _fbdev=yes ;;
852 --disable-fbdev) _fbdev=no ;;
853 --enable-dvb) _dvb=yes ;;
854 --disable-dvb) _dvb=no ;;
855 --enable-dvbhead) _dvbhead=yes ;;
856 --disable-dvbhead) _dvbhead=no ;;
857 --enable-dxr2) _dxr2=yes ;;
858 --disable-dxr2) _dxr2=no ;;
859 --enable-dxr3) _dxr3=yes ;;
860 --disable-dxr3) _dxr3=no ;;
861 --enable-ivtv) _ivtv=yes ;;
862 --disable-ivtv) _ivtv=no ;;
863 --enable-v4l2) _v4l2=yes ;;
864 --disable-v4l2) _v4l2=no ;;
865 --enable-iconv) _iconv=yes ;;
866 --disable-iconv) _iconv=no ;;
867 --enable-langinfo) _langinfo=yes ;;
868 --disable-langinfo) _langinfo=no ;;
869 --enable-rtc) _rtc=yes ;;
870 --disable-rtc) _rtc=no ;;
871 --enable-libdv) _libdv=yes ;;
872 --disable-libdv) _libdv=no ;;
873 --enable-ossaudio) _ossaudio=yes ;;
874 --disable-ossaudio) _ossaudio=no ;;
875 --enable-arts) _arts=yes ;;
876 --disable-arts) _arts=no ;;
877 --enable-esd) _esd=yes ;;
878 --disable-esd) _esd=no ;;
879 --enable-pulse) _pulse=yes ;;
880 --disable-pulse) _pulse=no ;;
881 --enable-jack) _jack=yes ;;
882 --disable-jack) _jack=no ;;
883 --enable-openal) _openal=yes ;;
884 --disable-openal) _openal=no ;;
885 --enable-mad) _mad=yes ;;
886 --disable-mad) _mad=no ;;
887 --enable-toolame) _toolame=yes ;;
888 --disable-toolame) _toolame=no ;;
889 --enable-twolame) _twolame=yes ;;
890 --disable-twolame) _twolame=no ;;
891 --enable-libcdio) _libcdio=yes ;;
892 --disable-libcdio) _libcdio=no ;;
893 --enable-liblzo) _liblzo=yes ;;
894 --disable-liblzo) _liblzo=no ;;
895 --enable-libvorbis) _libvorbis=yes ;;
896 --disable-libvorbis) _libvorbis=no ;;
897 --enable-speex) _speex=yes ;;
898 --disable-speex) _speex=no ;;
899 --enable-tremor-internal) _tremor_internal=yes ;;
900 --disable-tremor-internal) _tremor_internal=no ;;
901 --enable-tremor-low) _tremor_low=yes ;;
902 --disable-tremor-low) _tremor_low=no ;;
903 --enable-tremor-external) _tremor_external=yes ;;
904 --disable-tremor-external) _tremor_external=no ;;
905 --enable-theora) _theora=yes ;;
906 --disable-theora) _theora=no ;;
907 --enable-mp3lib) _mp3lib=yes ;;
908 --disable-mp3lib) _mp3lib=no ;;
909 --enable-liba52) _liba52=yes ;;
910 --disable-liba52) _liba52=no ;;
911 --enable-libdca) _libdca=yes ;;
912 --disable-libdca) _libdca=no ;;
913 --enable-libmpeg2) _libmpeg2=yes ;;
914 --disable-libmpeg2) _libmpeg2=no ;;
915 --enable-musepack) _musepack=yes ;;
916 --disable-musepack) _musepack=no ;;
917 --enable-faad-internal) _faad_internal=yes ;;
918 --disable-faad-internal) _faad_internal=no ;;
919 --enable-faad-external) _faad_external=yes ;;
920 --disable-faad-external) _faad_external=no ;;
921 --enable-faad-fixed) _faad_fixed=yes ;;
922 --disable-faad-fixed) _faad_fixed=no ;;
923 --enable-faac) _faac=yes ;;
924 --disable-faac) _faac=no ;;
925 --enable-ladspa) _ladspa=yes ;;
926 --disable-ladspa) _ladspa=no ;;
927 --enable-xmms) _xmms=yes ;;
928 --disable-xmms) _xmms=no ;;
929 --enable-dvdread) _dvdread=yes ;;
930 --disable-dvdread) _dvdread=no ;;
931 --enable-dvdread-internal) _dvdread_internal=yes ;;
932 --disable-dvdread-internal) _dvdread_internal=no ;;
933 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
934 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
935 --enable-dvdnav) _dvdnav=yes ;;
936 --disable-dvdnav) _dvdnav=no ;;
937 --enable-xanim) _xanim=yes ;;
938 --disable-xanim) _xanim=no ;;
939 --enable-real) _real=yes ;;
940 --disable-real) _real=no ;;
941 --enable-live) _live=yes ;;
942 --disable-live) _live=no ;;
943 --enable-nemesi) _nemesi=yes ;;
944 --disable-nemesi) _nemesi=no ;;
945 --enable-xinerama) _xinerama=yes ;;
946 --disable-xinerama) _xinerama=no ;;
947 --enable-mga) _mga=yes ;;
948 --disable-mga) _mga=no ;;
949 --enable-xmga) _xmga=yes ;;
950 --disable-xmga) _xmga=no ;;
951 --enable-vm) _vm=yes ;;
952 --disable-vm) _vm=no ;;
953 --enable-xf86keysym) _xf86keysym=yes ;;
954 --disable-xf86keysym) _xf86keysym=no ;;
955 --enable-mlib) _mlib=yes ;;
956 --disable-mlib) _mlib=no ;;
957 --enable-sunaudio) _sunaudio=yes ;;
958 --disable-sunaudio) _sunaudio=no ;;
959 --enable-sgiaudio) _sgiaudio=yes ;;
960 --disable-sgiaudio) _sgiaudio=no ;;
961 --enable-alsa) _alsa=yes ;;
962 --disable-alsa) _alsa=no ;;
963 --enable-tv) _tv=yes ;;
964 --disable-tv) _tv=no ;;
965 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
966 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
967 --enable-tv-v4l1) _tv_v4l1=yes ;;
968 --disable-tv-v4l1) _tv_v4l1=no ;;
969 --enable-tv-v4l2) _tv_v4l2=yes ;;
970 --disable-tv-v4l2) _tv_v4l2=no ;;
971 --enable-tv-dshow) _tv_dshow=yes ;;
972 --disable-tv-dshow) _tv_dshow=no ;;
973 --enable-tv-teletext) _tv_teletext=yes ;;
974 --disable-tv-teletext) _tv_teletext=no ;;
975 --enable-radio) _radio=yes ;;
976 --enable-radio-capture) _radio_capture=yes ;;
977 --disable-radio-capture) _radio_capture=no ;;
978 --disable-radio) _radio=no ;;
979 --enable-radio-v4l) _radio_v4l=yes ;;
980 --disable-radio-v4l) _radio_v4l=no ;;
981 --enable-radio-v4l2) _radio_v4l2=yes ;;
982 --disable-radio-v4l2) _radio_v4l2=no ;;
983 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
984 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
985 --enable-pvr) _pvr=yes ;;
986 --disable-pvr) _pvr=no ;;
987 --enable-fastmemcpy) _fastmemcpy=yes ;;
988 --disable-fastmemcpy) _fastmemcpy=no ;;
989 --enable-network) _network=yes ;;
990 --disable-network) _network=no ;;
991 --enable-winsock2) _winsock2=yes ;;
992 --disable-winsock2) _winsock2=no ;;
993 --enable-smb) _smbsupport=yes ;;
994 --disable-smb) _smbsupport=no ;;
995 --enable-vidix-internal) _vidix_internal=yes ;;
996 --disable-vidix-internal) _vidix_internal=no ;;
997 --enable-vidix-external) _vidix_external=yes ;;
998 --disable-vidix-external) _vidix_external=no ;;
999 --with-vidix-drivers=*)
1000 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
1002 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1003 --enable-joystick) _joystick=yes ;;
1004 --disable-joystick) _joystick=no ;;
1005 --enable-xvid) _xvid=yes ;;
1006 --disable-xvid) _xvid=no ;;
1007 --enable-x264) _x264=yes ;;
1008 --disable-x264) _x264=no ;;
1009 --enable-libnut) _libnut=yes ;;
1010 --disable-libnut) _libnut=no ;;
1011 --enable-libavutil_a) _libavutil_a=yes ;;
1012 --disable-libavutil_a) _libavutil_a=no ;;
1013 --enable-libavutil_so) _libavutil_so=yes ;;
1014 --disable-libavutil_so) _libavutil_so=no ;;
1015 --enable-libavcodec_a) _libavcodec_a=yes ;;
1016 --disable-libavcodec_a) _libavcodec_a=no ;;
1017 --enable-libavcodec_so) _libavcodec_so=yes ;;
1018 --disable-libavcodec_so) _libavcodec_so=no ;;
1019 --enable-libamr_nb) _libamr_nb=yes ;;
1020 --disable-libamr_nb) _libamr_nb=no ;;
1021 --enable-libamr_wb) _libamr_wb=yes ;;
1022 --disable-libamr_wb) _libamr_wb=no ;;
1023 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1024 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1025 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1026 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1027 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1028 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1029 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1030 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1031 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1032 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1033 --enable-libavformat_a) _libavformat_a=yes ;;
1034 --disable-libavformat_a) _libavformat_a=no ;;
1035 --enable-libavformat_so) _libavformat_so=yes ;;
1036 --disable-libavformat_so) _libavformat_so=no ;;
1037 --enable-libpostproc_a) _libpostproc_a=yes ;;
1038 --disable-libpostproc_a) _libpostproc_a=no ;;
1039 --enable-libpostproc_so) _libpostproc_so=yes ;;
1040 --disable-libpostproc_so) _libpostproc_so=no ;;
1041 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1042 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1044 --enable-lirc) _lirc=yes ;;
1045 --disable-lirc) _lirc=no ;;
1046 --enable-lircc) _lircc=yes ;;
1047 --disable-lircc) _lircc=no ;;
1048 --enable-apple-remote) _apple_remote=yes ;;
1049 --disable-apple-remote) _apple_remote=no ;;
1050 --enable-gui) _gui=yes ;;
1051 --disable-gui) _gui=no ;;
1052 --enable-gtk1) _gtk1=yes ;;
1053 --disable-gtk1) _gtk1=no ;;
1054 --enable-termcap) _termcap=yes ;;
1055 --disable-termcap) _termcap=no ;;
1056 --enable-termios) _termios=yes ;;
1057 --disable-termios) _termios=no ;;
1058 --enable-3dfx) _3dfx=yes ;;
1059 --disable-3dfx) _3dfx=no ;;
1060 --enable-s3fb) _s3fb=yes ;;
1061 --disable-s3fb) _s3fb=no ;;
1062 --enable-tdfxfb) _tdfxfb=yes ;;
1063 --disable-tdfxfb) _tdfxfb=no ;;
1064 --disable-tdfxvid) _tdfxvid=no ;;
1065 --enable-tdfxvid) _tdfxvid=yes ;;
1066 --disable-xvr100) _xvr100=no ;;
1067 --enable-xvr100) _xvr100=yes ;;
1068 --disable-tga) _tga=no ;;
1069 --enable-tga) _tga=yes ;;
1070 --enable-directfb) _directfb=yes ;;
1071 --disable-directfb) _directfb=no ;;
1072 --enable-zr) _zr=yes ;;
1073 --disable-zr) _zr=no ;;
1074 --enable-bl) _bl=yes ;;
1075 --disable-bl) _bl=no ;;
1076 --enable-mtrr) _mtrr=yes ;;
1077 --disable-mtrr) _mtrr=no ;;
1078 --enable-largefiles) _largefiles=yes ;;
1079 --disable-largefiles) _largefiles=no ;;
1080 --enable-shm) _shm=yes ;;
1081 --disable-shm) _shm=no ;;
1082 --enable-select) _select=yes ;;
1083 --disable-select) _select=no ;;
1084 --enable-linux-devfs) _linux_devfs=yes ;;
1085 --disable-linux-devfs) _linux_devfs=no ;;
1086 --enable-cdparanoia) _cdparanoia=yes ;;
1087 --disable-cdparanoia) _cdparanoia=no ;;
1088 --enable-cddb) _cddb=yes ;;
1089 --disable-cddb) _cddb=no ;;
1090 --enable-big-endian) _big_endian=yes ;;
1091 --disable-big-endian) _big_endian=no ;;
1092 --enable-bitmap-font) _bitmap_font=yes ;;
1093 --disable-bitmap-font) _bitmap_font=no ;;
1094 --enable-freetype) _freetype=yes ;;
1095 --disable-freetype) _freetype=no ;;
1096 --enable-fontconfig) _fontconfig=yes ;;
1097 --disable-fontconfig) _fontconfig=no ;;
1098 --enable-unrarlib) _unrarlib=yes ;;
1099 --disable-unrarlib) _unrarlib=no ;;
1100 --enable-ftp) _ftp=yes ;;
1101 --disable-ftp) _ftp=no ;;
1102 --enable-vstream) _vstream=yes ;;
1103 --disable-vstream) _vstream=no ;;
1104 --enable-pthreads) _pthreads=yes ;;
1105 --disable-pthreads) _pthreads=no ;;
1106 --enable-w32threads) _w32threads=yes ;;
1107 --disable-w32threads) _w32threads=no ;;
1108 --enable-ass) _ass=yes ;;
1109 --disable-ass) _ass=no ;;
1110 --enable-rpath) _rpath=yes ;;
1111 --disable-rpath) _rpath=no ;;
1112 --enable-color-console) _color_console=yes ;;
1113 --disable-color-console) _color_console=no ;;
1115 --enable-fribidi) _fribidi=yes ;;
1116 --disable-fribidi) _fribidi=no ;;
1118 --enable-enca) _enca=yes ;;
1119 --disable-enca) _enca=no ;;
1121 --enable-inet6) _inet6=yes ;;
1122 --disable-inet6) _inet6=no ;;
1124 --enable-gethostbyname2) _gethostbyname2=yes ;;
1125 --disable-gethostbyname2) _gethostbyname2=no ;;
1127 --enable-dga1) _dga1=yes ;;
1128 --disable-dga1) _dga1=no ;;
1129 --enable-dga2) _dga2=yes ;;
1130 --disable-dga2) _dga2=no ;;
1132 --enable-menu) _menu=yes ;;
1133 --disable-menu) _menu=no ;;
1135 --enable-qtx) _qtx=yes ;;
1136 --disable-qtx) _qtx=no ;;
1138 --enable-macosx) _macosx=yes ;;
1139 --disable-macosx) _macosx=no ;;
1140 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1141 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1142 --enable-macosx-bundle) _macosx_bundle=yes;;
1143 --disable-macosx-bundle) _macosx_bundle=no;;
1145 --enable-maemo) _maemo=yes ;;
1146 --disable-maemo) _maemo=no ;;
1148 --enable-sortsub) _sortsub=yes ;;
1149 --disable-sortsub) _sortsub=no ;;
1151 --enable-crash-debug) _crash_debug=yes ;;
1152 --disable-crash-debug) _crash_debug=no ;;
1153 --enable-sighandler) _sighandler=yes ;;
1154 --disable-sighandler) _sighandler=no ;;
1155 --enable-win32dll) _win32dll=yes ;;
1156 --disable-win32dll) _win32dll=no ;;
1158 --enable-sse) _sse=yes ;;
1159 --disable-sse) _sse=no ;;
1160 --enable-sse2) _sse2=yes ;;
1161 --disable-sse2) _sse2=no ;;
1162 --enable-ssse3) _ssse3=yes ;;
1163 --disable-ssse3) _ssse3=no ;;
1164 --enable-mmxext) _mmxext=yes ;;
1165 --disable-mmxext) _mmxext=no ;;
1166 --enable-3dnow) _3dnow=yes ;;
1167 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1168 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1169 --disable-3dnowext) _3dnowext=no ;;
1170 --enable-cmov) _cmov=yes ;;
1171 --disable-cmov) _cmov=no ;;
1172 --enable-fast-cmov) _fast_cmov=yes ;;
1173 --disable-fast-cmov) _fast_cmov=no ;;
1174 --enable-altivec) _altivec=yes ;;
1175 --disable-altivec) _altivec=no ;;
1176 --enable-armv5te) _armv5te=yes ;;
1177 --disable-armv5te) _armv5te=no ;;
1178 --enable-armv6) _armv6=yes ;;
1179 --disable-armv6) _armv6=no ;;
1180 --enable-iwmmxt) _iwmmxt=yes ;;
1181 --disable-iwmmxt) _iwmmxt=no ;;
1182 --enable-mmx) _mmx=yes ;;
1183 --disable-mmx) # 3Dnow! and MMX2 require MMX
1184 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1187 echo "Unknown parameter: $ac_option"
1188 exit 1
1191 esac
1192 done
1194 # Atmos: moved this here, to be correct, if --prefix is specified
1195 test -z "$_bindir" && _bindir="$_prefix/bin"
1196 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1197 test -z "$_mandir" && _mandir="$_prefix/share/man"
1198 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1199 test -z "$_libdir" && _libdir="$_prefix/lib"
1201 # Determine our OS name and CPU architecture
1202 if test -z "$_target" ; then
1203 # OS name
1204 system_name=`uname -s 2>&1`
1205 case "$system_name" in
1206 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX|AmigaOS)
1208 IRIX*)
1209 system_name=IRIX
1211 GNU/kFreeBSD)
1212 system_name=FreeBSD
1214 HP-UX*)
1215 system_name=HP-UX
1217 [cC][yY][gG][wW][iI][nN]*)
1218 system_name=CYGWIN
1220 MINGW32*)
1221 system_name=MINGW32
1224 system_name="$system_name-UNKNOWN"
1226 esac
1229 # host's CPU/instruction set
1230 host_arch=`uname -p 2>&1`
1231 case "$host_arch" in
1232 i386|sparc|ppc|alpha|arm|sh3|mips|vax)
1234 powerpc) # Darwin returns 'powerpc'
1235 host_arch=ppc
1237 *) # uname -p on Linux returns 'unknown' for the processor type,
1238 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1240 # Maybe uname -m (machine hardware name) returns something we
1241 # recognize.
1243 # x86/x86pc is used by QNX
1244 case "`uname -m 2>&1`" in
1245 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 ;;
1246 ia64) host_arch=ia64 ;;
1247 x86_64|amd64)
1248 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1249 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1250 host_arch=x86_64
1251 else
1252 host_arch=i386
1255 macppc|ppc|ppc64) host_arch=ppc ;;
1256 alpha) host_arch=alpha ;;
1257 sparc) host_arch=sparc ;;
1258 sparc64) host_arch=sparc64 ;;
1259 parisc*|hppa*|9000*) host_arch=hppa ;;
1260 arm*|zaurus|cats) host_arch=arm ;;
1261 sh3) host_arch=sh3 ;;
1262 s390) host_arch=s390 ;;
1263 s390x) host_arch=s390x ;;
1264 mips*) host_arch=mips ;;
1265 vax) host_arch=vax ;;
1266 *) host_arch=UNKNOWN ;;
1267 esac
1269 esac
1270 else # if test -z "$_target"
1271 system_name=`echo $_target | cut -d '-' -f 2`
1272 case "`echo $system_name | tr A-Z a-z`" in
1273 linux) system_name=Linux ;;
1274 freebsd) system_name=FreeBSD ;;
1275 gnu/kfreebsd) system_name=FreeBSD ;;
1276 netbsd) system_name=NetBSD ;;
1277 bsd/os) system_name=BSD/OS ;;
1278 openbsd) system_name=OpenBSD ;;
1279 sunos) system_name=SunOS ;;
1280 qnx) system_name=QNX ;;
1281 morphos) system_name=MorphOS ;;
1282 amigaos) system_name=AmigaOS ;;
1283 mingw32msvc) system_name=MINGW32 ;;
1284 esac
1285 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1286 host_arch=`echo $_target | cut -d '-' -f 1`
1287 if test `echo $host_arch` != "x86_64" ; then
1288 host_arch=`echo $host_arch | tr '_' '-'`
1292 echo "Detected operating system: $system_name"
1293 echo "Detected host architecture: $host_arch"
1295 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1296 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1300 if openbsd ; then
1301 _ldconfig="ldconfig -R"
1304 if freebsd ; then
1305 _ld_extra="$_ld_extra -L/usr/local/lib"
1306 _inc_extra="$_inc_extra -I/usr/local/include"
1309 if darwin; then
1310 _ld_extra="$_ld_extra -L/usr/local/lib"
1311 _inc_extra="$_inc_extra -I/usr/local/include"
1314 if aix ; then
1315 _ld_extra="$_ld_extra -lC"
1318 if irix ; then
1319 _ranlib='ar -r'
1320 elif linux ; then
1321 _ranlib='true'
1324 if win32 ; then
1325 _exesuf=".exe"
1326 # -lwinmm is always needed for osdep/timer-win2.c
1327 _ld_extra="$_ld_extra -lwinmm"
1328 _confwin32='TARGET_WIN32 = yes'
1329 else
1330 _confwin32='TARGET_WIN32 = no'
1333 if mingw32 ; then
1334 _need_shmem=no
1337 if cygwin ; then
1338 _def_confwin32='#define WIN32'
1341 if amigaos ; then
1342 _select=no
1343 _sighandler=no
1344 _stream_cache=no
1345 _def_stream_cache="#undef USE_STREAM_CACHE"
1348 if qnx ; then
1349 _ld_extra="$_ld_extra -lph"
1352 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1353 test "$I" && break
1354 done
1357 TMPLOG="configure.log"
1358 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1359 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1360 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1361 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1362 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1364 rm -f "$TMPLOG"
1365 echo configuration: $_configuration > "$TMPLOG"
1366 echo >> "$TMPLOG"
1369 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1370 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1371 # know about '-n'.
1372 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1373 _head() { head -$1 2>/dev/null ; }
1374 else
1375 _head() { head -n $1 2>/dev/null ; }
1377 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1378 _tail() { tail -$1 2>/dev/null ; }
1379 else
1380 _tail() { tail -n $1 2>/dev/null ; }
1383 # Checking CC version...
1384 if test "$_gcc_check" = yes ; then
1385 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1386 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1387 echocheck "$_cc version"
1388 cc_vendor=intel
1389 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1390 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1391 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1392 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1393 # TODO verify older icc/ecc compatibility
1394 case $cc_version in
1396 cc_version="v. ?.??, bad"
1397 cc_verc_fail=yes
1399 8.0|9.1|10.0|10.1)
1400 cc_version="$cc_version, ok"
1401 cc_verc_fail=no
1404 cc_version="$cc_version, bad"
1405 cc_verc_fail=yes
1407 esac
1408 echores "$cc_version"
1409 else
1410 for _cc in "$_cc" gcc cc ; do
1411 echocheck "$_cc version"
1412 cc_vendor=gnu
1413 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1414 cc_version=`$_cc -dumpversion 2>&1`
1415 if test "$?" -gt 0; then
1416 cc_version="not found"
1418 case $cc_version in
1420 cc_version="v. ?.??, bad"
1421 cc_verc_fail=yes
1423 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1424 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1425 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1426 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1427 cc_version="$cc_version, ok"
1428 cc_verc_fail=no
1430 'not found')
1431 cc_verc_fail=yes
1434 cc_version="$cc_version, bad"
1435 cc_verc_fail=yes
1437 esac
1438 echores "$cc_version"
1439 test "$cc_verc_fail" = "no" && break
1440 done
1441 fi # icc
1442 if test "$cc_verc_fail" = yes ; then
1443 cat <<EOF
1445 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1447 You are not using a supported compiler. We do not have the time to make sure
1448 everything works with compilers other than the ones we use. Use either the
1449 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1450 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1452 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1453 mplayer and lame (which is used for mencoder). If you get compile errors,
1454 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1455 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1456 bugs!
1458 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1461 die "Bad gcc version"
1463 else
1464 cat <<EOF
1466 ******************************************************************************
1468 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1469 Ok. You know. Do it.
1471 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1472 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1473 Lame which is used by mencoder produces weird errors, too.
1475 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1476 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1478 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1480 ******************************************************************************
1484 read _answer
1487 echocheck "host cc"
1488 test "$_host_cc" || _host_cc=$_cc
1489 echores $_host_cc
1491 echocheck "cross compilation"
1492 if test $_cross_compile = auto ; then
1493 cat > $TMPC << EOF
1494 int main(void) { return 0; }
1496 _cross_compile=yes
1497 cc_check && "$TMPEXE" && _cross_compile=no
1499 echores $_cross_compile
1501 if test $_cross_compile = yes; then
1502 tmp_run() {
1503 return 0
1507 # ---
1509 # now that we know what compiler should be used for compilation, try to find
1510 # out which assembler is used by the $_cc compiler
1511 if test "$_as" = auto ; then
1512 _as=`$_cc -print-prog-name=as`
1513 test -z "$_as" && _as=as
1516 # XXX: this should be ok..
1517 _cpuinfo="echo"
1519 if test "$_runtime_cpudetection" = no ; then
1521 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1522 # FIXME: Remove the cygwin check once AMD CPUs are supported
1523 if test -r /proc/cpuinfo && ! cygwin; then
1524 # Linux with /proc mounted, extract CPU information from it
1525 _cpuinfo="cat /proc/cpuinfo"
1526 elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then
1527 # FreeBSD with Linux emulation /proc mounted,
1528 # extract CPU information from it
1529 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1530 elif darwin && ! x86_32 ; then
1531 # use hostinfo on Darwin
1532 _cpuinfo="hostinfo"
1533 elif aix; then
1534 # use 'lsattr' on AIX
1535 _cpuinfo="lsattr -E -l proc0 -a type"
1536 elif x86; then
1537 # all other OSes try to extract CPU information from a small helper
1538 # program cpuinfo instead
1539 $_cc -o cpuinfo$_exesuf cpuinfo.c
1540 _cpuinfo="./cpuinfo$_exesuf"
1543 if x86 ; then
1544 # gather more CPU information
1545 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1546 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1547 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1548 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1549 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1551 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1553 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1554 -e s/xmm/sse/ -e s/kni/sse/`
1556 for ext in $pparam ; do
1557 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1558 done
1560 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1561 test $_sse = kernel_check && _mmxext=kernel_check
1563 echocheck "CPU vendor"
1564 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1566 echocheck "CPU type"
1567 echores "$pname"
1570 fi # test "$_runtime_cpudetection" = no
1572 if x86 && test "$_runtime_cpudetection" = no ; then
1573 extcheck() {
1574 if test "$1" = kernel_check ; then
1575 echocheck "kernel support of $2"
1576 cat > $TMPC <<EOF
1577 #include <signal.h>
1578 void catch() { exit(1); }
1579 int main(void){
1580 signal(SIGILL, catch);
1581 __asm__ __volatile__ ("$3":::"memory");return(0);
1585 if cc_check && tmp_run ; then
1586 eval _$2=yes
1587 echores "yes"
1588 _optimizing="$_optimizing $2"
1589 return 0
1590 else
1591 eval _$2=no
1592 echores "failed"
1593 echo "It seems that your kernel does not correctly support $2."
1594 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1595 return 1
1598 return 0
1601 extcheck $_mmx "mmx" "emms"
1602 extcheck $_mmxext "mmxext" "sfence"
1603 extcheck $_3dnow "3dnow" "femms"
1604 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1605 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1606 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1607 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1608 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1610 echocheck "mtrr support"
1611 if test "$_mtrr" = kernel_check ; then
1612 _mtrr="yes"
1613 _optimizing="$_optimizing mtrr"
1615 echores "$_mtrr"
1617 if test "$_gcc3_ext" != ""; then
1618 # if we had to disable sse/sse2 because the active kernel does not
1619 # support this instruction set extension, we also have to tell
1620 # gcc3 to not generate sse/sse2 instructions for normal C code
1621 cat > $TMPC << EOF
1622 int main(void) { return 0; }
1624 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1630 _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM ARMV4L SH3 POWERPC PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN GENERIC'
1631 case "$host_arch" in
1632 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1633 _arch='X86 X86_32'
1634 _target_arch_x86="ARCH_X86 = yes"
1635 _target_arch="ARCH_X86_32 = yes"
1636 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1637 iproc=486
1638 proc=i486
1641 if test "$_runtime_cpudetection" = no ; then
1642 case "$pvendor" in
1643 AuthenticAMD)
1644 case "$pfamily" in
1645 3) proc=i386 iproc=386 ;;
1646 4) proc=i486 iproc=486 ;;
1647 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1648 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1649 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1650 proc=k6-3
1651 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1652 proc=geode
1653 elif test "$pmodel" -ge 8; then
1654 proc=k6-2
1655 elif test "$pmodel" -ge 6; then
1656 proc=k6
1657 else
1658 proc=i586
1661 6) iproc=686
1662 # It's a bit difficult to determine the correct type of Family 6
1663 # AMD CPUs just from their signature. Instead, we check directly
1664 # whether it supports SSE.
1665 if test "$_sse" = yes; then
1666 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1667 proc=athlon-xp
1668 else
1669 # Again, gcc treats athlon and athlon-tbird similarly.
1670 proc=athlon
1673 15) iproc=686
1674 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1675 # caught and remedied in the optimization tests below.
1676 proc=k8
1679 *) proc=k8 iproc=686 ;;
1680 esac
1682 GenuineIntel)
1683 case "$pfamily" in
1684 3) proc=i386 iproc=386 ;;
1685 4) proc=i486 iproc=486 ;;
1686 5) iproc=586
1687 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1688 proc=pentium-mmx # 4 is desktop, 8 is mobile
1689 else
1690 proc=i586
1693 6) iproc=686
1694 if test "$pmodel" -ge 15; then
1695 proc=core2
1696 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1697 proc=pentium-m
1698 elif test "$pmodel" -ge 7; then
1699 proc=pentium3
1700 elif test "$pmodel" -ge 3; then
1701 proc=pentium2
1702 else
1703 proc=i686
1706 15) iproc=686
1707 # A nocona in 32-bit mode has no more capabilities than a prescott.
1708 if test "$pmodel" -ge 3; then
1709 proc=prescott
1710 else
1711 proc=pentium4
1713 test $_fast_cmov = "auto" && _fast_cmov=no
1715 *) proc=prescott iproc=686 ;;
1716 esac
1718 CentaurHauls)
1719 case "$pfamily" in
1720 5) iproc=586
1721 if test "$pmodel" -ge 8; then
1722 proc=winchip2
1723 elif test "$pmodel" -ge 4; then
1724 proc=winchip-c6
1725 else
1726 proc=i586
1729 6) iproc=686
1730 if test "$pmodel" -ge 9; then
1731 proc=c3-2
1732 else
1733 proc=c3
1734 iproc=586
1737 *) proc=i686 iproc=i686 ;;
1738 esac
1740 unknown)
1741 case "$pfamily" in
1742 3) proc=i386 iproc=386 ;;
1743 4) proc=i486 iproc=486 ;;
1744 *) proc=i586 iproc=586 ;;
1745 esac
1748 proc=i586 iproc=586 ;;
1749 esac
1750 fi # test "$_runtime_cpudetection" = no
1753 # check that gcc supports our CPU, if not, fall back to earlier ones
1754 # LGB: check -mcpu and -march swithing step by step with enabling
1755 # to fall back till 386.
1757 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1759 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1760 cpuopt=-mtune
1761 else
1762 cpuopt=-mcpu
1765 echocheck "GCC & CPU optimization abilities"
1766 cat > $TMPC << EOF
1767 int main(void) { return 0; }
1769 if test "$_runtime_cpudetection" = no ; then
1770 cc_check -march=native && proc=native
1771 if test "$proc" = "k8"; then
1772 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1774 if test "$proc" = "athlon-xp"; then
1775 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1777 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1778 cc_check -march=$proc $cpuopt=$proc || proc=k6
1780 if test "$proc" = "k6" || test "$proc" = "c3"; then
1781 if ! cc_check -march=$proc $cpuopt=$proc; then
1782 if cc_check -march=i586 $cpuopt=i686; then
1783 proc=i586-i686
1784 else
1785 proc=i586
1789 if test "$proc" = "prescott" ; then
1790 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1792 if test "$proc" = "core2" ; then
1793 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1795 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
1796 cc_check -march=$proc $cpuopt=$proc || proc=i686
1798 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1799 cc_check -march=$proc $cpuopt=$proc || proc=i586
1801 if test "$proc" = "i586"; then
1802 cc_check -march=$proc $cpuopt=$proc || proc=i486
1804 if test "$proc" = "i486" ; then
1805 cc_check -march=$proc $cpuopt=$proc || proc=i386
1807 if test "$proc" = "i386" ; then
1808 cc_check -march=$proc $cpuopt=$proc || proc=error
1810 if test "$proc" = "error" ; then
1811 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1812 _mcpu=""
1813 _march=""
1814 _optimizing=""
1815 elif test "$proc" = "i586-i686"; then
1816 _march="-march=i586"
1817 _mcpu="$cpuopt=i686"
1818 _optimizing="$proc"
1819 else
1820 _march="-march=$proc"
1821 _mcpu="$cpuopt=$proc"
1822 _optimizing="$proc"
1824 else # if test "$_runtime_cpudetection" = no
1825 _mcpu="$cpuopt=generic"
1826 # at least i486 required, for bswap instruction
1827 _march="-march=i486"
1828 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1829 cc_check $_mcpu || _mcpu=""
1830 cc_check $_march $_mcpu || _march=""
1833 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1834 ## autodetected mcpu/march parameters
1835 if test "$_target" ; then
1836 # TODO: it may be a good idea to check GCC and fall back in all cases
1837 if test "$host_arch" = "i586-i686"; then
1838 _march="-march=i586"
1839 _mcpu="$cpuopt=i686"
1840 else
1841 _march="-march=$host_arch"
1842 _mcpu="$cpuopt=$host_arch"
1845 proc="$host_arch"
1847 case "$proc" in
1848 i386) iproc=386 ;;
1849 i486) iproc=486 ;;
1850 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1851 i686|athlon*|pentium*) iproc=686 ;;
1852 *) iproc=586 ;;
1853 esac
1856 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1857 _fast_cmov="yes"
1858 else
1859 _fast_cmov="no"
1862 echores "$proc"
1865 ia64)
1866 _arch='IA64'
1867 _target_arch='ARCH_IA64 = yes'
1868 iproc='ia64'
1869 proc=''
1870 _march=''
1871 _mcpu=''
1872 _optimizing=''
1875 x86_64|amd64)
1876 _arch='X86 X86_64'
1877 _target_arch='ARCH_X86_64 = yes'
1878 _target_arch_x86="ARCH_X86 = yes"
1879 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1880 iproc='x86_64'
1882 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1883 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1884 cpuopt=-mtune
1885 else
1886 cpuopt=-mcpu
1888 if test "$_runtime_cpudetection" = no ; then
1889 case "$pvendor" in
1890 AuthenticAMD)
1891 proc=k8;;
1892 GenuineIntel)
1893 case "$pfamily" in
1894 6) proc=core2;;
1896 # 64-bit prescotts exist, but as far as GCC is concerned they
1897 # have the same capabilities as a nocona.
1898 proc=nocona
1899 test $_fast_cmov = "auto" && _fast_cmov=no
1901 esac
1904 proc=error;;
1905 esac
1906 fi # test "$_runtime_cpudetection" = no
1908 echocheck "GCC & CPU optimization abilities"
1909 cat > $TMPC << EOF
1910 int main(void) { return 0; }
1912 # This is a stripped-down version of the i386 fallback.
1913 if test "$_runtime_cpudetection" = no ; then
1914 cc_check -march=native && proc=native
1915 # --- AMD processors ---
1916 if test "$proc" = "k8"; then
1917 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1919 # This will fail if gcc version < 3.3, which is ok because earlier
1920 # versions don't really support 64-bit on amd64.
1921 # Is this a valid assumption? -Corey
1922 if test "$proc" = "athlon-xp"; then
1923 cc_check -march=$proc $cpuopt=$proc || proc=error
1925 # --- Intel processors ---
1926 if test "$proc" = "core2"; then
1927 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1929 if test "$proc" = "nocona"; then
1930 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1932 if test "$proc" = "pentium4"; then
1933 cc_check -march=$proc $cpuopt=$proc || proc=error
1936 _march="-march=$proc"
1937 _mcpu="$cpuopt=$proc"
1938 if test "$proc" = "error" ; then
1939 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1940 _mcpu=""
1941 _march=""
1943 else # if test "$_runtime_cpudetection" = no
1944 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1945 _march="-march=x86-64"
1946 _mcpu="$cpuopt=generic"
1947 cc_check $_mcpu || _mcpu="x86-64"
1948 cc_check $_mcpu || _mcpu=""
1949 cc_check $_march $_mcpu || _march=""
1952 _optimizing=""
1954 echores "$proc"
1957 sparc)
1958 _arch='SPARC'
1959 _target_arch='ARCH_SPARC = yes'
1960 iproc='sparc'
1961 if sunos ; then
1962 echocheck "CPU type"
1963 karch=`uname -m`
1964 case "`echo $karch`" in
1965 sun4) proc=v7 ;;
1966 sun4c) proc=v7 ;;
1967 sun4d) proc=v8 ;;
1968 sun4m) proc=v8 ;;
1969 sun4u) proc=ultrasparc _vis='yes' ;;
1970 sun4v) proc=v9 ;;
1971 *) proc=v8 ;;
1972 esac
1973 echores "$proc"
1974 else
1975 proc=v8
1977 _march=''
1978 _mcpu="-mcpu=$proc"
1979 _optimizing="$proc"
1982 sparc64)
1983 _arch='SPARC'
1984 _target_arch='ARCH_SPARC = yes'
1985 _vis='yes'
1986 iproc='sparc'
1987 proc='ultrasparc'
1988 _march=''
1989 _mcpu="-mcpu=$proc"
1990 _optimizing="$proc"
1993 arm|armv4l|armv5tel)
1994 _arch='ARM ARMV4L'
1995 _target_arch='ARCH_ARMV4L = yes'
1996 iproc='arm'
1997 proc=''
1998 _march=''
1999 _mcpu=''
2000 _optimizing=''
2003 sh3)
2004 _arch='SH3'
2005 _target_arch='ARCH_SH3 = yes'
2006 iproc='sh3'
2007 proc=''
2008 _march='-m3'
2009 _mcpu='-ml'
2010 _optimizing=''
2013 ppc|powerpc)
2014 _arch='POWERPC PPC'
2015 _def_dcbzl='#undef HAVE_DCBZL'
2016 _target_arch='ARCH_POWERPC = yes'
2017 iproc='ppc'
2018 proc=''
2019 _march=''
2020 _mcpu=''
2021 _optimizing=''
2023 echocheck "CPU type"
2024 case $system_name in
2025 Linux)
2026 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2027 if test -n "`$_cpuinfo | grep altivec`"; then
2028 test $_altivec = auto && _altivec=yes
2031 Darwin)
2032 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2033 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2034 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2035 test $_altivec = auto && _altivec=yes
2038 NetBSD)
2039 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2040 case $cc_version in
2041 2*|3.0*|3.1*|3.2*|3.3*)
2044 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2045 test $_altivec = auto && _altivec=yes
2048 esac
2050 AIX)
2051 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2053 esac
2054 if test "$_altivec" = yes; then
2055 echores "$proc altivec"
2056 else
2057 _altivec=no
2058 echores "$proc"
2061 echocheck "GCC & CPU optimization abilities"
2063 if test -n "$proc"; then
2064 case "$proc" in
2065 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2066 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2067 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2068 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2069 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2070 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2071 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2072 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2073 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2074 *) ;;
2075 esac
2076 # gcc 3.1(.1) and up supports 7400 and 7450
2077 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2078 case "$proc" in
2079 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2080 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2081 *) ;;
2082 esac
2084 # gcc 3.2 and up supports 970
2085 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2086 case "$proc" in
2087 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2088 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2089 *) ;;
2090 esac
2092 # gcc 3.3 and up supports POWER4
2093 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2094 case "$proc" in
2095 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2096 *) ;;
2097 esac
2099 # gcc 3.4 and up supports 440*
2100 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2101 case "$proc" in
2102 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2103 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2104 *) ;;
2105 esac
2107 # gcc 4.0 and up supports POWER5
2108 if test "$_cc_major" -ge "4"; then
2109 case "$proc" in
2110 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2111 *) ;;
2112 esac
2116 if test -n "$_mcpu"; then
2117 _optimizing=`echo $_mcpu | cut -c 8-`
2118 echores "$_optimizing"
2119 else
2120 echores "none"
2125 alpha)
2126 _arch='ALPHA'
2127 _target_arch='ARCH_ALPHA = yes'
2128 iproc='alpha'
2129 _march=''
2131 echocheck "CPU type"
2132 cat > $TMPC << EOF
2133 int main(void) {
2134 unsigned long ver, mask;
2135 asm ("implver %0" : "=r" (ver));
2136 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2137 printf("%ld-%x\n", ver, ~mask);
2138 return 0;
2141 $_cc -o "$TMPEXE" "$TMPC"
2142 case `"$TMPEXE"` in
2144 0-0) proc="ev4"; _mvi="0";;
2145 1-0) proc="ev5"; _mvi="0";;
2146 1-1) proc="ev56"; _mvi="0";;
2147 1-101) proc="pca56"; _mvi="1";;
2148 2-303) proc="ev6"; _mvi="1";;
2149 2-307) proc="ev67"; _mvi="1";;
2150 2-1307) proc="ev68"; _mvi="1";;
2151 esac
2152 echores "$proc"
2154 echocheck "GCC & CPU optimization abilities"
2155 if test "$proc" = "ev68" ; then
2156 cc_check -mcpu=$proc || proc=ev67
2158 if test "$proc" = "ev67" ; then
2159 cc_check -mcpu=$proc || proc=ev6
2161 _mcpu="-mcpu=$proc"
2162 echores "$proc"
2164 _optimizing="$proc"
2166 echocheck "MVI instruction support in GCC"
2167 if test "$_cc_major" -ge "3" && test "$_mvi" = "1" ; then
2168 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2169 echores "yes"
2170 else
2171 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2172 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2176 mips)
2177 _arch='SGI_MIPS'
2178 _target_arch='ARCH_SGI_MIPS = yes'
2179 iproc='sgi-mips'
2180 proc=''
2181 _march=''
2182 _mcpu=''
2183 _optimizing=''
2185 if irix ; then
2186 echocheck "CPU type"
2187 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2188 case "`echo $proc`" in
2189 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2190 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2191 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2192 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2193 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2194 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2195 esac
2196 # gcc < 3.x does not support -mtune.
2197 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2198 _mcpu=''
2200 echores "$proc"
2205 hppa)
2206 _arch='PA_RISC'
2207 _target_arch='ARCH_PA_RISC = yes'
2208 iproc='PA-RISC'
2209 proc=''
2210 _march=''
2211 _mcpu=''
2212 _optimizing=''
2215 s390)
2216 _arch='S390'
2217 _target_arch='ARCH_S390 = yes'
2218 iproc='390'
2219 proc=''
2220 _march=''
2221 _mcpu=''
2222 _optimizing=''
2225 s390x)
2226 _arch='S390X'
2227 _target_arch='ARCH_S390X = yes'
2228 iproc='390x'
2229 proc=''
2230 _march=''
2231 _mcpu=''
2232 _optimizing=''
2235 vax)
2236 _arch='VAX'
2237 _target_arch='ARCH_VAX = yes'
2238 iproc='vax'
2239 proc=''
2240 _march=''
2241 _mcpu=''
2242 _optimizing=''
2245 generic)
2246 _arch='GENERIC'
2247 _target_arch='ARCH_GENERIC = yes'
2248 iproc=''
2249 proc=''
2250 _march=''
2251 _mcpu=''
2252 _optimizing=''
2256 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2257 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2258 die "unsupported architecture $host_arch"
2260 esac # case "$host_arch" in
2262 if test "$_runtime_cpudetection" = yes ; then
2263 if x86 ; then
2264 test "$_cmov" != no && _cmov=yes
2265 x86_32 && _cmov=no
2266 test "$_mmx" != no && _mmx=yes
2267 test "$_3dnow" != no && _3dnow=yes
2268 test "$_3dnowext" != no && _3dnowext=yes
2269 test "$_mmxext" != no && _mmxext=yes
2270 test "$_sse" != no && _sse=yes
2271 test "$_sse2" != no && _sse2=yes
2272 test "$_ssse3" != no && _ssse3=yes
2273 test "$_mtrr" != no && _mtrr=yes
2275 if ppc; then
2276 _altivec=yes
2282 echocheck "assembler support of -pipe option"
2283 cat > $TMPC << EOF
2284 int main(void) { return 0; }
2286 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2289 echocheck "compiler support of named assembler arguments"
2290 _named_asm_args=yes
2291 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2292 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2293 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2294 _named_asm_args=no
2295 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2297 echores $_named_asm_args
2300 if darwin && test "$cc_vendor" = "gnu" ; then
2301 echocheck "GCC support of -mstackrealign"
2302 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2303 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2304 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2305 # wrong code with this flag, but this can be worked around by adding
2306 # -fno-unit-at-a-time as described in the blog post at
2307 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2308 cat > $TMPC << EOF
2309 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2310 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2312 cc_check -O4 -mstackrealign && tmp_run && _stackrealign=-mstackrealign
2313 test -z "$_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2314 && tmp_run && _stackrealign="-mstackrealign -fno-unit-at-a-time"
2315 test -n "$_stackrealign" && echores "yes" || echores "no"
2316 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2319 # Checking for CFLAGS
2320 _install_strip="-s"
2321 if test "$_profile" != "" || test "$_debug" != "" ; then
2322 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2323 _install_strip=
2324 elif test -z "$CFLAGS" ; then
2325 if test "$cc_vendor" = "intel" ; then
2326 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2327 elif test "$cc_vendor" != "gnu" ; then
2328 CFLAGS="-O2 $_march $_mcpu $_pipe"
2329 else
2330 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2332 else
2333 _warn_CFLAGS=yes
2335 if test -n "$LDFLAGS" ; then
2336 _ld_extra="$_ld_extra $LDFLAGS"
2337 _warn_CFLAGS=yes
2338 elif test "$cc_vendor" = "intel" ; then
2339 _ld_extra="$_ld_extra -i-static"
2341 if test -n "$CPPFLAGS" ; then
2342 _inc_extra="$_inc_extra $CPPFLAGS"
2343 _warn_CFLAGS=yes
2348 if x86_32 ; then
2349 # Checking assembler (_as) compatibility...
2350 # Added workaround for older as that reads from stdin by default - atmos
2351 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2352 echocheck "assembler ($_as $as_version)"
2354 _pref_as_version='2.9.1'
2355 echo 'nop' > $TMPS
2356 if test "$_mmx" = yes ; then
2357 echo 'emms' >> $TMPS
2359 if test "$_3dnow" = yes ; then
2360 _pref_as_version='2.10.1'
2361 echo 'femms' >> $TMPS
2363 if test "$_3dnowext" = yes ; then
2364 _pref_as_version='2.10.1'
2365 echo 'pswapd %mm0, %mm0' >> $TMPS
2367 if test "$_mmxext" = yes ; then
2368 _pref_as_version='2.10.1'
2369 echo 'movntq %mm0, (%eax)' >> $TMPS
2371 if test "$_sse" = yes ; then
2372 _pref_as_version='2.10.1'
2373 echo 'xorps %xmm0, %xmm0' >> $TMPS
2375 #if test "$_sse2" = yes ; then
2376 # _pref_as_version='2.11'
2377 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2379 if test "$_cmov" = yes ; then
2380 _pref_as_version='2.10.1'
2381 echo 'cmovb %eax, %ebx' >> $TMPS
2383 if test "$_ssse3" = yes ; then
2384 _pref_as_version='2.16.92'
2385 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2387 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2389 if test "$as_verc_fail" != yes ; then
2390 echores "ok"
2391 else
2392 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2393 echores "failed"
2394 die "obsolete binutils version"
2397 fi #if x86_32
2399 echocheck ".align is a power of two"
2400 if test "$_asmalign_pot" = auto ; then
2401 _asmalign_pot=no
2402 cat > $TMPC << EOF
2403 main(void) { asm (".align 3"); }
2405 cc_check && _asmalign_pot=yes
2407 if test "$_asmalign_pot" = "yes" ; then
2408 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2409 else
2410 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2412 echores $_asmalign_pot
2415 #FIXME: This should happen before the check for CFLAGS..
2416 if ppc ; then
2418 # check if altivec is supported by the compiler, and how to enable it
2420 _altivec_gcc_flags=''
2422 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2423 echocheck "GCC altivec support"
2425 p=''
2426 cat > $TMPC << EOF
2427 int main(void) {
2428 return 0;
2431 FSF_flags='-maltivec -mabi=altivec'
2432 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2434 # check for Darwin-style flags first, since
2435 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2436 # accepts but ignores FSF-style flags...
2438 if test -z "$p"; then
2439 cc_check $Darwin_flags && p='Darwin'
2441 if test -z "$p"; then
2442 cc_check $FSF_flags && p='FSF'
2445 case $p in
2446 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2447 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2448 *) _altivec=no ;;
2449 esac
2451 if test -z "$p"; then
2452 p=none
2453 else
2454 p="$p-style ($_altivec_gcc_flags)"
2457 echores "$p"
2460 # check if <altivec.h> should be included
2462 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2464 if test "$_altivec" = yes ; then
2465 echocheck "altivec.h"
2466 cat > $TMPC << EOF
2467 #include <altivec.h>
2468 int main(void) { return 0; }
2470 _have_altivec_h=no
2471 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2472 if test "$_have_altivec_h" = yes ; then
2473 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2475 echores "$_have_altivec_h"
2478 # disable runtime cpudetection if
2479 # - we cannot generate altivec code
2480 # - altivec is disabled by the user
2482 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2483 _runtime_cpudetection=no
2486 # show that we are optimizing for altivec (if enabled and supported)
2488 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2489 _optimizing="$_optimizing altivec"
2492 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2494 if test "$_altivec" = yes ; then
2495 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2496 #_mcpu="$_mcpu $_altivec_gcc_flags"
2497 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2501 if arm ; then
2502 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2503 if test $_armv5te = "auto" ; then
2504 cat > $TMPC << EOF
2505 int main(void) {
2506 __asm__ __volatile__ ("qadd r0, r0, r0");
2509 _armv5te=no
2510 cc_check && _armv5te=yes
2512 echores "$_armv5te"
2514 echocheck "ARMv6 (SIMD instructions)"
2515 if test $_armv6 = "auto" ; then
2516 cat > $TMPC << EOF
2517 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2519 _armv6=no
2520 cc_check && _armv6=yes
2522 echores "$_armv6"
2524 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2525 if test $_iwmmxt = "auto" ; then
2526 cat > $TMPC << EOF
2527 int main(void) {
2528 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2531 _iwmmxt=no
2532 cc_check && _iwmmxt=yes
2534 echores "$_iwmmxt"
2537 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
2538 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2539 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2540 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2541 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2542 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2543 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2544 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2545 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2546 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2547 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2548 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2549 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2550 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2551 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2552 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2554 # Checking kernel version...
2555 if x86_32 && linux ; then
2556 _k_verc_problem=no
2557 kernel_version=`uname -r 2>&1`
2558 echocheck "$system_name kernel version"
2559 case "$kernel_version" in
2560 '') kernel_version="?.??"; _k_verc_fail=yes;;
2561 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2562 _k_verc_problem=yes;;
2563 esac
2564 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2565 _k_verc_fail=yes
2567 if test "$_k_verc_fail" ; then
2568 echores "$kernel_version, fail"
2569 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2570 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2571 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2572 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2573 echo "2.2.x you must upgrade it to get SSE support!"
2574 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2575 else
2576 echores "$kernel_version, ok"
2580 ######################
2581 # MAIN TESTS GO HERE #
2582 ######################
2585 echocheck "-lposix"
2586 cat > $TMPC <<EOF
2587 int main(void) { return 0; }
2589 if cc_check -lposix ; then
2590 _ld_extra="$_ld_extra -lposix"
2591 echores "yes"
2592 else
2593 echores "no"
2596 echocheck "-lm"
2597 cat > $TMPC <<EOF
2598 int main(void) { return 0; }
2600 if cc_check -lm ; then
2601 _ld_lm="-lm"
2602 echores "yes"
2603 else
2604 _ld_lm=""
2605 echores "no"
2609 echocheck "langinfo"
2610 if test "$_langinfo" = auto ; then
2611 cat > $TMPC <<EOF
2612 #include <langinfo.h>
2613 int main(void) { nl_langinfo(CODESET); return 0; }
2615 _langinfo=no
2616 cc_check && _langinfo=yes
2618 if test "$_langinfo" = yes ; then
2619 _def_langinfo='#define USE_LANGINFO 1'
2620 else
2621 _def_langinfo='#undef USE_LANGINFO'
2623 echores "$_langinfo"
2626 echocheck "language"
2627 test -z "$_language" && _language=$LINGUAS
2628 _language=`echo $_language | sed 's/,/ /g'`
2629 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2630 for lang in $_language ; do
2631 test "$lang" = all && lang=en
2632 if test -f "help/help_mp-${lang}.h" ; then
2633 _language=$lang
2634 break
2635 else
2636 echo ${_echo_n} "$lang not found, ${_echo_c}"
2637 _language=`echo $_language | sed "s/$lang *//"`
2639 done
2640 test -z "$_language" && _language=en
2641 _mp_help="help/help_mp-${_language}.h"
2642 test -f $_mp_help || die "$_mp_help not found"
2643 for lang in $LANGUAGES ; do
2644 if test -f "DOCS/man/$lang/mplayer.1" ; then
2645 MAN_LANG="$lang $MAN_LANG"
2647 done
2648 _doc_lang=$_language
2649 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2650 echores "using $_language (man pages: $MAN_LANG)"
2653 echocheck "enable sighandler"
2654 if test "$_sighandler" = yes ; then
2655 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2656 else
2657 _def_sighandler='#undef ENABLE_SIGHANDLER'
2659 echores "$_sighandler"
2661 echocheck "runtime cpudetection"
2662 if test "$_runtime_cpudetection" = yes ; then
2663 _optimizing="Runtime CPU-Detection enabled"
2664 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2665 else
2666 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2668 echores "$_runtime_cpudetection"
2671 echocheck "restrict keyword"
2672 for restrict_keyword in restrict __restrict __restrict__ ; do
2673 echo "void foo(char * $restrict_keyword p); int main(void){}" > $TMPC
2674 if cc_check; then
2675 _def_restrict_keyword=$restrict_keyword
2676 break;
2678 done
2679 if [ -n "$_def_restrict_keyword" ]; then
2680 echores "$_def_restrict_keyword"
2681 else
2682 echores "none"
2684 # Avoid infinite recursion loop ("#define restrict restrict")
2685 if [ "$_def_restrict_keyword" != "restrict" ]; then
2686 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2687 else
2688 _def_restrict_keyword=""
2692 echocheck "__builtin_expect"
2693 # GCC branch prediction hint
2694 cat > $TMPC << EOF
2695 int foo (int a) {
2696 a = __builtin_expect (a, 10);
2697 return a == 10 ? 0 : 1;
2699 int main(void) { return foo(10) && foo(0); }
2701 _builtin_expect=no
2702 cc_check && _builtin_expect=yes
2703 if test "$_builtin_expect" = yes ; then
2704 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2705 else
2706 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2708 echores "$_builtin_expect"
2711 echocheck "kstat"
2712 cat > $TMPC << EOF
2713 #include <kstat.h>
2714 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2716 _kstat=no
2717 cc_check -lkstat && _kstat=yes
2718 if test "$_kstat" = yes ; then
2719 _def_kstat="#define HAVE_LIBKSTAT 1"
2720 _ld_extra="$_ld_extra -lkstat"
2721 else
2722 _def_kstat="#undef HAVE_LIBKSTAT"
2724 echores "$_kstat"
2727 echocheck "posix4"
2728 # required for nanosleep on some systems
2729 cat > $TMPC << EOF
2730 #include <time.h>
2731 int main(void) { (void) nanosleep(0, 0); return 0; }
2733 _posix4=no
2734 cc_check -lposix4 && _posix4=yes
2735 if test "$_posix4" = yes ; then
2736 _ld_extra="$_ld_extra -lposix4"
2738 echores "$_posix4"
2740 echocheck "lrintf"
2741 cat > $TMPC << EOF
2742 #include <math.h>
2743 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2745 _lrintf=no
2746 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2747 if test "$_lrintf" = yes ; then
2748 _def_lrintf="#define HAVE_LRINTF 1"
2749 else
2750 _def_lrintf="#undef HAVE_LRINTF"
2752 echores "$_lrintf"
2755 echocheck "mkstemp"
2756 cat > $TMPC << EOF
2757 #include <stdlib.h>
2758 int main(void) { char a; mkstemp(&a); return 0; }
2760 _mkstemp=no
2761 cc_check && _mkstemp=yes
2762 if test "$_mkstemp" = yes ; then
2763 _def_mkstemp='#define HAVE_MKSTEMP 1'
2764 else
2765 _def_mkstemp='#undef HAVE_MKSTEMP'
2767 echores "$_mkstemp"
2770 echocheck "nanosleep"
2771 # also check for nanosleep
2772 cat > $TMPC << EOF
2773 #include <time.h>
2774 int main(void) { (void) nanosleep(0, 0); return 0; }
2776 _nanosleep=no
2777 cc_check && _nanosleep=yes
2778 if test "$_nanosleep" = yes ; then
2779 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2780 else
2781 _def_nanosleep='#undef HAVE_NANOSLEEP'
2783 echores "$_nanosleep"
2786 echocheck "socklib"
2787 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2788 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2789 cat > $TMPC << EOF
2790 #include <netdb.h>
2791 #include <sys/socket.h>
2792 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2794 _socklib=no
2795 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2796 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2797 done
2798 if test $_winsock2 = auto && ! cygwin ; then
2799 _winsock2=no
2800 cat > $TMPC << EOF
2801 #include <winsock2.h>
2802 int main(void) { (void) gethostbyname(0); return 0; }
2804 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2806 test "$_ld_sock" && _res_comment="using $_ld_sock"
2807 echores "$_socklib"
2810 if test $_winsock2 = yes ; then
2811 _ld_sock="-lws2_32"
2812 _def_winsock2='#define HAVE_WINSOCK2 1'
2813 else
2814 _def_winsock2='#undef HAVE_WINSOCK2'
2818 _use_aton=no
2819 echocheck "inet_pton()"
2820 cat > $TMPC << EOF
2821 #include <sys/types.h>
2822 #include <sys/socket.h>
2823 #include <arpa/inet.h>
2824 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2826 if test "$_winsock2" = yes ; then
2827 _res_comment="using winsock2 functions instead"
2828 echores "no"
2829 elif cc_check $_ld_sock ; then
2830 # NOTE: Linux has libresolv but does not need it
2832 _res_comment="using $_ld_sock"
2833 echores "yes"
2834 elif cc_check $_ld_sock -lresolv ; then
2835 # NOTE: needed for SunOS at least
2836 _ld_sock="$_ld_sock -lresolv"
2837 _res_comment="using $_ld_sock"
2838 echores "yes"
2839 else
2840 _res_comment="trying inet_aton next"
2841 echores "no"
2843 echocheck "inet_aton()"
2844 cat > $TMPC << EOF
2845 #include <sys/types.h>
2846 #include <sys/socket.h>
2847 #include <arpa/inet.h>
2848 int main(void) { (void) inet_aton(0, 0); return 0; }
2850 _use_aton=yes
2851 if cc_check $_ld_sock ; then
2852 # NOTE: Linux has libresolv but does not need it
2854 _res_comment="using $_ld_sock"
2855 elif cc_check $_ld_sock -lresolv ; then
2856 # NOTE: needed for SunOS at least
2857 _ld_sock="$_ld_sock -lresolv"
2858 _res_comment="using $_ld_sock"
2859 else
2860 _use_aton=no
2861 _network=no
2862 _res_comment="network support disabled"
2864 echores "$_use_aton"
2867 _def_use_aton='#undef USE_ATON'
2868 if test "$_use_aton" = yes; then
2869 _def_use_aton='#define USE_ATON 1'
2872 echocheck "network"
2873 # FIXME network check
2874 if test "$_network" = yes ; then
2875 _def_network='#define MPLAYER_NETWORK 1'
2876 _ld_extra="$_ld_extra $_ld_sock"
2877 _inputmodules="network $_inputmodules"
2878 else
2879 _noinputmodules="network $_noinputmodules"
2880 _def_network='#undef MPLAYER_NETWORK'
2881 _ftp=no
2883 echores "$_network"
2885 echocheck "inttypes.h (required)"
2886 cat > $TMPC << EOF
2887 #include <inttypes.h>
2888 int main(void) { return 0; }
2890 _inttypes=no
2891 cc_check && _inttypes=yes
2892 echores "$_inttypes"
2894 if test "$_inttypes" = no ; then
2895 echocheck "bitypes.h (inttypes.h predecessor)"
2896 cat > $TMPC << EOF
2897 #include <sys/bitypes.h>
2898 int main(void) { return 0; }
2900 cc_check && _inttypes=yes
2901 if test "$_inttypes" = yes ; then
2902 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."
2903 else
2904 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2909 echocheck "int_fastXY_t in inttypes.h"
2910 cat > $TMPC << EOF
2911 #include <inttypes.h>
2912 int main(void) {
2913 volatile int_fast16_t v= 0;
2914 return v; }
2916 _fast_inttypes=no
2917 cc_check && _fast_inttypes=yes
2918 if test "$_fast_inttypes" = yes ; then
2919 # nothing to do
2921 else
2922 _def_fast_inttypes='
2923 typedef signed char int_fast8_t;
2924 typedef signed int int_fast16_t;
2925 typedef signed int int_fast32_t;
2926 typedef signed long long int_fast64_t;
2927 typedef unsigned char uint_fast8_t;
2928 typedef unsigned int uint_fast16_t;
2929 typedef unsigned int uint_fast32_t;
2930 typedef unsigned long long uint_fast64_t;'
2932 echores "$_fast_inttypes"
2935 echocheck "word size"
2936 _mp_wordsize="#undef MP_WORDSIZE"
2937 cat > $TMPC << EOF
2938 #include <stdio.h>
2939 #include <sys/types.h>
2940 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2942 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2943 echores "$_wordsize"
2946 echocheck "malloc.h"
2947 cat > $TMPC << EOF
2948 #include <malloc.h>
2949 int main(void) { (void) malloc(0); return 0; }
2951 _malloc=no
2952 cc_check && _malloc=yes
2953 if test "$_malloc" = yes ; then
2954 _def_malloc='#define HAVE_MALLOC_H 1'
2955 else
2956 _def_malloc='#undef HAVE_MALLOC_H'
2958 # malloc.h emits a warning in FreeBSD and OpenBSD
2959 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2960 echores "$_malloc"
2963 echocheck "memalign()"
2964 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2965 cat > $TMPC << EOF
2966 #include <malloc.h>
2967 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2969 _memalign=no
2970 cc_check && _memalign=yes
2971 if test "$_memalign" = yes ; then
2972 _def_memalign='#define HAVE_MEMALIGN 1'
2973 else
2974 _def_memalign='#undef HAVE_MEMALIGN'
2975 _def_map_memalign='#define memalign(a,b) malloc(b)'
2976 darwin || _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2978 echores "$_memalign"
2981 echocheck "alloca.h"
2982 cat > $TMPC << EOF
2983 #include <alloca.h>
2984 int main(void) { (void) alloca(0); return 0; }
2986 _alloca=no
2987 cc_check && _alloca=yes
2988 if cc_check ; then
2989 _def_alloca='#define HAVE_ALLOCA_H 1'
2990 else
2991 _def_alloca='#undef HAVE_ALLOCA_H'
2993 echores "$_alloca"
2996 echocheck "mman.h"
2997 cat > $TMPC << EOF
2998 #include <sys/types.h>
2999 #include <sys/mman.h>
3000 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3002 _mman=no
3003 cc_check && _mman=yes
3004 if test "$_mman" = yes ; then
3005 _def_mman='#define HAVE_SYS_MMAN_H 1'
3006 else
3007 _def_mman='#undef HAVE_SYS_MMAN_H'
3009 echores "$_mman"
3011 cat > $TMPC << EOF
3012 #include <sys/types.h>
3013 #include <sys/mman.h>
3014 int main(void) { void *p = MAP_FAILED; return 0; }
3016 _mman_has_map_failed=no
3017 cc_check && _mman_has_map_failed=yes
3018 if test "$_mman_has_map_failed" = yes ; then
3019 _def_mman_has_map_failed=''
3020 else
3021 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3024 echocheck "dynamic loader"
3025 cat > $TMPC << EOF
3026 #include <dlfcn.h>
3027 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3029 _dl=no
3030 for _ld_tmp in "" "-ldl" ; do
3031 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3032 done
3033 if test "$_dl" = yes ; then
3034 _def_dl='#define HAVE_LIBDL 1'
3035 else
3036 _def_dl='#undef HAVE_LIBDL'
3038 echores "$_dl"
3041 echocheck "dynamic a/v plugins support"
3042 if test "$_dl" = no ; then
3043 _dynamic_plugins=no
3045 if test "$_dynamic_plugins" = yes ; then
3046 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3047 else
3048 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3050 echores "$_dynamic_plugins"
3053 _def_threads='#undef HAVE_THREADS'
3055 echocheck "pthread"
3056 if test "$_pthreads" = auto ; then
3057 cat > $TMPC << EOF
3058 #include <pthread.h>
3059 void* func(void *arg) { return arg; }
3060 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3062 _pthreads=no
3063 if ! hpux ; then
3064 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3065 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3066 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3067 done
3070 if test "$_pthreads" = yes ; then
3071 _res_comment="using $_ld_pthread"
3072 _def_pthreads='#define HAVE_PTHREADS 1'
3073 _def_threads='#define HAVE_THREADS 1'
3074 else
3075 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3076 _def_pthreads='#undef HAVE_PTHREADS'
3077 _nas=no ; _tv_v4l1=no ; _macosx=no
3078 mingw32 || _win32dll=no
3080 echores "$_pthreads"
3082 echocheck "w32threads"
3083 if test "$_pthreads" = yes ; then
3084 _res_comment="using pthread instead"
3085 _w32threads=no
3087 if test "$_w32threads" = auto ; then
3088 _w32threads=no
3089 mingw32 && _w32threads=yes
3091 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3092 echores "$_w32threads"
3094 echocheck "rpath"
3095 netbsd &&_rpath=yes
3096 if test "$_rpath" = yes ; then
3097 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3098 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3099 done
3100 _ld_extra=$tmp
3102 echores "$_rpath"
3104 echocheck "iconv"
3105 if test "$_iconv" = auto ; then
3106 cat > $TMPC << EOF
3107 #include <stdio.h>
3108 #include <unistd.h>
3109 #include <iconv.h>
3110 #define INBUFSIZE 1024
3111 #define OUTBUFSIZE 4096
3113 char inbuffer[INBUFSIZE];
3114 char outbuffer[OUTBUFSIZE];
3116 int main(void) {
3117 size_t numread;
3118 iconv_t icdsc;
3119 char *tocode="UTF-8";
3120 char *fromcode="cp1250";
3121 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3122 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3123 char *iptr=inbuffer;
3124 char *optr=outbuffer;
3125 size_t inleft=numread;
3126 size_t outleft=OUTBUFSIZE;
3127 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3128 != (size_t)(-1)) {
3129 write (1, outbuffer, OUTBUFSIZE - outleft);
3132 if (iconv_close(icdsc) == -1)
3137 _iconv=no
3138 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3139 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3140 _iconv=yes && break
3141 done
3143 if test "$_iconv" = yes ; then
3144 _def_iconv='#define USE_ICONV 1'
3145 else
3146 _def_iconv='#undef USE_ICONV'
3148 echores "$_iconv"
3151 echocheck "soundcard.h"
3152 _soundcard_h=no
3153 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3154 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3155 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3156 cat > $TMPC << EOF
3157 #include <$_soundcard_header>
3158 int main(void) { return 0; }
3160 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3161 done
3163 if test "$_soundcard_h" = yes ; then
3164 if test $_soundcard_header = "sys/soundcard.h"; then
3165 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3166 else
3167 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3170 echores "$_soundcard_h"
3173 echocheck "sys/dvdio.h"
3174 cat > $TMPC << EOF
3175 #include <unistd.h>
3176 #include <sys/dvdio.h>
3177 int main(void) { return 0; }
3179 _dvdio=no
3180 cc_check && _dvdio=yes
3181 if test "$_dvdio" = yes ; then
3182 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3183 else
3184 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3186 echores "$_dvdio"
3189 echocheck "sys/cdio.h"
3190 cat > $TMPC << EOF
3191 #include <unistd.h>
3192 #include <sys/cdio.h>
3193 int main(void) { return 0; }
3195 _cdio=no
3196 cc_check && _cdio=yes
3197 if test "$_cdio" = yes ; then
3198 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3199 else
3200 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3202 echores "$_cdio"
3205 echocheck "linux/cdrom.h"
3206 cat > $TMPC << EOF
3207 #include <sys/types.h>
3208 #include <linux/cdrom.h>
3209 int main(void) { return 0; }
3211 _cdrom=no
3212 cc_check && _cdrom=yes
3213 if test "$_cdrom" = yes ; then
3214 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3215 else
3216 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3218 echores "$_cdrom"
3221 echocheck "dvd.h"
3222 cat > $TMPC << EOF
3223 #include <dvd.h>
3224 int main(void) { return 0; }
3226 _dvd=no
3227 cc_check && _dvd=yes
3228 if test "$_dvd" = yes ; then
3229 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3230 else
3231 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3233 echores "$_dvd"
3236 if bsdos; then
3237 echocheck "BSDI dvd.h"
3238 cat > $TMPC << EOF
3239 #include <dvd.h>
3240 int main(void) { return 0; }
3242 _bsdi_dvd=no
3243 cc_check && _bsdi_dvd=yes
3244 if test "$_bsdi_dvd" = yes ; then
3245 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3246 else
3247 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3249 echores "$_bsdi_dvd"
3250 fi #if bsdos
3253 if hpux; then
3254 # also used by AIX, but AIX does not support VCD and/or libdvdread
3255 echocheck "HP-UX SCSI header"
3256 cat > $TMPC << EOF
3257 #include <sys/scsi.h>
3258 int main(void) { return 0; }
3260 _hpux_scsi_h=no
3261 cc_check && _hpux_scsi_h=yes
3262 if test "$_hpux_scsi_h" = yes ; then
3263 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3264 else
3265 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3267 echores "$_hpux_scsi_h"
3268 fi #if hpux
3271 if sunos; then
3272 echocheck "userspace SCSI headers (Solaris)"
3273 cat > $TMPC << EOF
3274 # include <unistd.h>
3275 # include <stropts.h>
3276 # include <sys/scsi/scsi_types.h>
3277 # include <sys/scsi/impl/uscsi.h>
3278 int main(void) { return 0; }
3280 _sol_scsi_h=no
3281 cc_check && _sol_scsi_h=yes
3282 if test "$_sol_scsi_h" = yes ; then
3283 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3284 else
3285 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3287 echores "$_sol_scsi_h"
3288 fi #if sunos
3291 echocheck "termcap"
3292 if test "$_termcap" = auto ; then
3293 cat > $TMPC <<EOF
3294 int main(void) { tgetent(); return 0; }
3296 _termcap=no
3297 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3298 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3299 && _termcap=yes && break
3300 done
3302 if test "$_termcap" = yes ; then
3303 _def_termcap='#define USE_TERMCAP 1'
3304 _res_comment="using $_ld_tmp"
3305 else
3306 _def_termcap='#undef USE_TERMCAP'
3308 echores "$_termcap"
3311 echocheck "termios"
3312 _def_termios='#undef HAVE_TERMIOS'
3313 _def_termios_h='#undef HAVE_TERMIOS_H'
3314 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3315 if test "$_termios" = auto ; then
3316 _termios=no
3317 for _termios_header in "sys/termios.h" "termios.h"; do
3318 cat > $TMPC <<EOF
3319 #include <$_termios_header>
3320 int main(void) { return 0; }
3322 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3323 done
3326 if test "$_termios" = yes ; then
3327 _def_termios='#define HAVE_TERMIOS 1'
3328 if test "$_termios_header" = "termios.h" ; then
3329 _def_termios_h='#define HAVE_TERMIOS_H 1'
3330 else
3331 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3334 echores "$_termios"
3337 echocheck "shm"
3338 if test "$_shm" = auto ; then
3339 cat > $TMPC << EOF
3340 #include <sys/types.h>
3341 #include <sys/shm.h>
3342 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3344 _shm=no
3345 cc_check && _shm=yes
3347 if test "$_shm" = yes ; then
3348 _def_shm='#define HAVE_SHM 1'
3349 else
3350 _def_shm='#undef HAVE_SHM'
3352 echores "$_shm"
3355 echocheck "strsep()"
3356 cat > $TMPC << EOF
3357 #include <string.h>
3358 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3360 _strsep=no
3361 cc_check && _strsep=yes
3362 if test "$_strsep" = yes ; then
3363 _def_strsep='#define HAVE_STRSEP 1'
3364 _need_strsep=no
3365 else
3366 _def_strsep='#undef HAVE_STRSEP'
3367 _need_strsep=yes
3369 echores "$_strsep"
3372 echocheck "vsscanf()"
3373 cat > $TMPC << EOF
3374 #include <stdarg.h>
3375 int main(void) { vsscanf(0, 0, 0); return 0; }
3377 _vsscanf=no
3378 cc_check && _vsscanf=yes
3379 if test "$_vsscanf" = yes ; then
3380 _def_vsscanf='#define HAVE_VSSCANF 1'
3381 _need_vsscanf=no
3382 else
3383 _def_vsscanf='#undef HAVE_VSSCANF'
3384 _need_vsscanf=yes
3386 echores "$_vsscanf"
3389 echocheck "swab()"
3390 cat > $TMPC << EOF
3391 #include <unistd.h>
3392 int main(void) { swab(0, 0, 0); return 0; }
3394 _swab=no
3395 cc_check && _swab=yes
3396 if test "$_swab" = yes ; then
3397 _def_swab='#define HAVE_SWAB 1'
3398 _need_swab=no
3399 else
3400 _def_swab='#undef HAVE_SWAB'
3401 _need_swab=yes
3403 echores "$_swab"
3405 echocheck "POSIX select()"
3406 cat > $TMPC << EOF
3407 #include <stdio.h>
3408 #include <stdlib.h>
3409 #include <sys/types.h>
3410 #include <string.h>
3411 #include <sys/time.h>
3412 #include <unistd.h>
3413 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3415 _posix_select=no
3416 _def_posix_select='#undef HAVE_POSIX_SELECT'
3417 cc_check && _posix_select=yes \
3418 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3419 echores "$_posix_select"
3422 echocheck "gettimeofday()"
3423 cat > $TMPC << EOF
3424 #include <stdio.h>
3425 #include <sys/time.h>
3426 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3428 _gettimeofday=no
3429 cc_check && _gettimeofday=yes
3430 if test "$_gettimeofday" = yes ; then
3431 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3432 _need_gettimeofday=no
3433 else
3434 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3435 _need_gettimeofday=yes
3437 echores "$_gettimeofday"
3440 echocheck "glob()"
3441 cat > $TMPC << EOF
3442 #include <stdio.h>
3443 #include <glob.h>
3444 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3446 _glob=no
3447 cc_check && _glob=yes
3448 if test "$_glob" = yes ; then
3449 _def_glob='#define HAVE_GLOB 1'
3450 _need_glob=no
3451 else
3452 _def_glob='#undef HAVE_GLOB'
3453 _need_glob=yes
3455 echores "$_glob"
3458 echocheck "setenv()"
3459 cat > $TMPC << EOF
3460 #include <stdlib.h>
3461 int main (void){ setenv("","",0); return 0; }
3463 _setenv=no
3464 cc_check && _setenv=yes
3465 if test "$_setenv" = yes ; then
3466 _def_setenv='#define HAVE_SETENV 1'
3467 _need_setenv=no
3468 else
3469 _def_setenv='#undef HAVE_SETENV'
3470 _need_setenv=yes
3472 echores "$_setenv"
3475 if sunos; then
3476 echocheck "sysi86()"
3477 cat > $TMPC << EOF
3478 #include <sys/sysi86.h>
3479 int main (void) { sysi86(0); return 0; }
3481 _sysi86=no
3482 cc_check && _sysi86=yes
3483 if test "$_sysi86" = yes ; then
3484 _def_sysi86='#define HAVE_SYSI86 1'
3485 cat > $TMPC << EOF
3486 #include <sys/sysi86.h>
3487 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3489 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3490 else
3491 _def_sysi86='#undef HAVE_SYSI86'
3493 echores "$_sysi86"
3494 fi #if sunos
3497 echocheck "sys/sysinfo.h"
3498 cat > $TMPC << EOF
3499 #include <sys/sysinfo.h>
3500 int main(void) {
3501 struct sysinfo s_info;
3502 sysinfo(&s_info);
3503 return 0;
3506 _sys_sysinfo=no
3507 cc_check && _sys_sysinfo=yes
3508 if test "$_sys_sysinfo" = yes ; then
3509 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3510 else
3511 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3513 echores "$_sys_sysinfo"
3516 if darwin; then
3518 echocheck "Mac OS X APIs"
3519 if test "$_macosx" = auto ; then
3520 productName=`/usr/bin/sw_vers -productName`
3521 if test "$productName" = "Mac OS X" ||
3522 test "$productName" = "Mac OS X Server" ; then
3523 _macosx=yes
3524 else
3525 _macosx=no
3526 _def_macosx='#undef MACOSX'
3527 _noaomodules="macosx $_noaomodules"
3528 _novomodules="quartz $_novomodules"
3531 if test "$_macosx" = yes ; then
3532 cat > $TMPC <<EOF
3533 #include <Carbon/Carbon.h>
3534 #include <QuickTime/QuickTime.h>
3535 #include <CoreAudio/CoreAudio.h>
3536 int main(void) {
3537 EnterMovies();
3538 ExitMovies();
3539 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3542 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3543 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3544 _def_macosx='#define MACOSX 1'
3545 _aosrc="$_aosrc ao_macosx.c"
3546 _aomodules="macosx $_aomodules"
3547 _vosrc="$_vosrc vo_quartz.c"
3548 _vomodules="quartz $_vomodules"
3549 else
3550 _macosx=no
3551 _def_macosx='#undef MACOSX'
3552 _noaomodules="macosx $_noaomodules"
3553 _novomodules="quartz $_novomodules"
3555 cat > $TMPC <<EOF
3556 #include <Carbon/Carbon.h>
3557 #include <QuartzCore/CoreVideo.h>
3558 int main(void) {}
3560 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3561 _vosrc="$_vosrc vo_macosx.m"
3562 _vomodules="macosx $_vomodules"
3563 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3564 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3565 _macosx_corevideo=yes
3566 else
3567 _novomodules="macosx $_novomodules"
3568 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3569 _macosx_corevideo=no
3572 echores "$_macosx"
3574 echocheck "Mac OS X Finder Support"
3575 if test "$_macosx_finder_support" = auto ; then
3576 _macosx_finder_support=$_macosx
3578 if test "$_macosx_finder_support" = yes; then
3579 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3580 _macosx_finder_support=yes
3581 else
3582 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3583 _macosx_finder_support=no
3585 echores "$_macosx_finder_support"
3587 echocheck "Mac OS X Bundle file locations"
3588 if test "$_macosx_bundle" = auto ; then
3589 _macosx_bundle=$_macosx_finder_support
3591 if test "$_macosx_bundle" = yes; then
3592 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3593 else
3594 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3595 _macosx_bundle=no
3597 echores "$_macosx_bundle"
3599 echocheck "Apple Remote"
3600 if test "$_apple_remote" = auto ; then
3601 _apple_remote=no
3602 cat > $TMPC <<EOF
3603 #include <stdio.h>
3604 #include <IOKit/IOCFPlugIn.h>
3605 int main (int argc, const char * argv[])
3607 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3608 CFMutableDictionaryRef hidMatchDictionary;
3609 IOReturn ioReturnValue;
3611 // Set up a matching dictionary to search the I/O Registry by class.
3612 // name for all HID class devices
3613 hidMatchDictionary = IOServiceMatching("AppleIRController");
3615 // Now search I/O Registry for matching devices.
3616 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3617 hidMatchDictionary, &hidObjectIterator);
3619 // If search is unsuccessful, return nonzero.
3620 if (ioReturnValue != kIOReturnSuccess ||
3621 !IOIteratorIsValid(hidObjectIterator)) {
3622 return 1;
3624 return 0;
3627 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3629 if test "$_apple_remote" = yes ; then
3630 _def_apple_remote='#define HAVE_APPLE_REMOTE 1'
3631 _ld_extra="$_ld_extra -framework IOKit"
3632 else
3633 _def_apple_remote='#undef HAVE_APPLE_REMOTE'
3635 echores "$_apple_remote"
3637 fi #if darwin
3640 echocheck "pkg-config"
3641 _pkg_config=pkg-config
3642 if `$_pkg_config --version > /dev/null 2>&1`; then
3643 if test "$_ld_static"; then
3644 _pkg_config="$_pkg_config --static"
3646 echores "yes"
3647 else
3648 _pkg_config=false
3649 echores "no"
3653 echocheck "Samba support (libsmbclient)"
3654 if test "$_smbsupport" = yes; then
3655 _ld_extra="$_ld_extra -lsmbclient"
3657 if test "$_smbsupport" = auto; then
3658 _smbsupport=no
3659 cat > $TMPC << EOF
3660 #include <libsmbclient.h>
3661 int main(void) { smbc_opendir("smb://"); return 0; }
3663 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3664 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3665 _smbsupport=yes && break
3666 done
3669 if test "$_smbsupport" = yes; then
3670 _def_smbsupport="#define LIBSMBCLIENT"
3671 _inputmodules="smb $_inputmodules"
3672 else
3673 _def_smbsupport="#undef LIBSMBCLIENT"
3674 _noinputmodules="smb $_noinputmodules"
3676 echores "$_smbsupport"
3679 #########
3680 # VIDEO #
3681 #########
3684 echocheck "tdfxfb"
3685 if test "$_tdfxfb" = yes ; then
3686 _def_tdfxfb='#define HAVE_TDFXFB 1'
3687 _vosrc="$_vosrc vo_tdfxfb.c"
3688 _vomodules="tdfxfb $_vomodules"
3689 else
3690 _def_tdfxfb='#undef HAVE_TDFXFB'
3691 _novomodules="tdfxfb $_novomodules"
3693 echores "$_tdfxfb"
3695 echocheck "s3fb"
3696 if test "$_s3fb" = yes ; then
3697 _def_s3fb='#define HAVE_S3FB 1'
3698 _vosrc="$_vosrc vo_s3fb.c"
3699 _vomodules="s3fb $_vomodules"
3700 else
3701 _def_s3fb='#undef HAVE_S3FB'
3702 _novomodules="s3fb $_novomodules"
3704 echores "$_s3fb"
3706 echocheck "tdfxvid"
3707 if test "$_tdfxvid" = yes ; then
3708 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3709 _vosrc="$_vosrc vo_tdfx_vid.c"
3710 _vomodules="tdfx_vid $_vomodules"
3711 else
3712 _def_tdfxvid='#undef HAVE_TDFX_VID'
3713 _novomodules="tdfx_vid $_novomodules"
3715 echores "$_tdfxvid"
3717 echocheck "xvr100"
3718 if test "$_xvr100" = auto ; then
3719 cat > $TMPC << EOF
3720 #include <unistd.h>
3721 #include <sys/fbio.h>
3722 #include <sys/visual_io.h>
3723 int main(void) {
3724 struct vis_identifier ident;
3725 struct fbgattr attr;
3727 ioctl(0, VIS_GETIDENTIFIER, &ident);
3728 ioctl(0, FBIOGATTR, &attr);
3731 _xvr100=no
3732 cc_check && _xvr100=yes
3734 if test "$_xvr100" = yes ; then
3735 _def_xvr100='#define HAVE_XVR100 1'
3736 _vosrc="$_vosrc vo_xvr100.c"
3737 _vomodules="xvr100 $_vomodules"
3738 else
3739 _def_tdfxvid='#undef HAVE_XVR100'
3740 _novomodules="xvr100 $_novomodules"
3742 echores "$_xvr100"
3744 echocheck "tga"
3745 if test "$_tga" = yes ; then
3746 _def_tga='#define HAVE_TGA 1'
3747 _vosrc="$_vosrc vo_tga.c"
3748 _vomodules="tga $_vomodules"
3749 else
3750 _def_tga='#undef HAVE_TGA'
3751 _novomodules="tga $_novomodules"
3753 echores "$_tga"
3756 echocheck "md5sum support"
3757 if test "$_md5sum" = yes; then
3758 _def_md5sum="#define HAVE_MD5SUM"
3759 _vosrc="$_vosrc vo_md5sum.c"
3760 _vomodules="md5sum $_vomodules"
3761 else
3762 _def_md5sum="#undef HAVE_MD5SUM"
3763 _novomodules="md5sum $_novomodules"
3765 echores "$_md5sum"
3768 echocheck "bl"
3769 if test "$_bl" = yes ; then
3770 _def_bl='#define HAVE_BL 1'
3771 _vosrc="$_vosrc vo_bl.c"
3772 _vomodules="bl $_vomodules"
3773 else
3774 _def_bl='#undef HAVE_BL'
3775 _novomodules="bl $_novomodules"
3777 echores "$_bl"
3780 echocheck "DirectFB"
3781 if test "$_directfb" = auto ; then
3782 _directfb=no
3783 cat > $TMPC <<EOF
3784 #include <directfb.h>
3785 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3787 for _inc_tmp in "" -I/usr/local/include/directfb \
3788 -I/usr/include/directfb -I/usr/local/include; do
3789 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3790 _inc_extra="$_inc_extra $_inc_tmp" && break
3791 done
3794 dfb_version() {
3795 expr $1 \* 65536 + $2 \* 256 + $3
3798 if test "$_directfb" = yes; then
3799 cat > $TMPC << EOF
3800 #include <directfb_version.h>
3802 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3805 if $_cc -E $TMPC $_inc_extra > "$TMPEXE"; then
3806 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'`
3807 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3808 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3809 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3810 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3811 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3812 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3813 _res_comment="$_directfb_version"
3814 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3815 else
3816 _def_directfb_version='#undef DIRECTFBVERSION'
3817 _directfb=no
3818 _res_comment="version >=0.9.13 required"
3820 else
3821 _directfb=no
3822 _res_comment="failed to get version"
3825 echores "$_directfb"
3827 if test "$_directfb" = yes ; then
3828 _def_directfb='#define HAVE_DIRECTFB 1'
3829 _vosrc="$_vosrc vo_directfb2.c"
3830 _vomodules="directfb $_vomodules"
3831 _libs_mplayer="$_libs_mplayer -ldirectfb"
3832 else
3833 _def_directfb='#undef HAVE_DIRECTFB'
3834 _novomodules="directfb $_novomodules"
3836 if test "$_dfbmga" = yes; then
3837 _vosrc="$_vosrc vo_dfbmga.c"
3838 _vomodules="dfbmga $_vomodules"
3839 _def_dfbmga='#define HAVE_DFBMGA 1'
3840 else
3841 _novomodules="dfbmga $_novomodules"
3842 _def_dfbmga='#undef HAVE_DFBMGA'
3846 echocheck "X11 headers presence"
3847 _x11_headers="no"
3848 _res_comment="check if the dev(el) packages are installed"
3849 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3850 if test -f "$I/X11/Xlib.h" ; then
3851 _x11_headers="yes"
3852 _res_comment=""
3853 break
3855 done
3856 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3857 if test -f "$I/X11/Xlib.h" ; then
3858 _inc_extra="$_inc_extra -I$I"
3859 _x11_headers="yes"
3860 _res_comment="using $I"
3861 break
3863 done
3864 echores "$_x11_headers"
3867 echocheck "X11"
3868 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3869 cat > $TMPC <<EOF
3870 #include <X11/Xlib.h>
3871 #include <X11/Xutil.h>
3872 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3874 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3875 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3876 if netbsd; then
3877 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3878 else
3879 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3881 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3882 && _x11=yes && break
3883 done
3885 if test "$_x11" = yes ; then
3886 _def_x11='#define HAVE_X11 1'
3887 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3888 _vomodules="x11 xover $_vomodules"
3889 else
3890 _x11=no
3891 _def_x11='#undef HAVE_X11'
3892 _novomodules="x11 $_novomodules"
3893 _res_comment="check if the dev(el) packages are installed"
3894 # disable stuff that depends on X
3895 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
3897 echores "$_x11"
3900 echocheck "DPMS"
3901 _xdpms3=no
3902 _xdpms4=no
3903 if test "$_x11" = yes ; then
3904 cat > $TMPC <<EOF
3905 #include <X11/Xmd.h>
3906 #include <X11/Xlib.h>
3907 #include <X11/Xutil.h>
3908 #include <X11/Xatom.h>
3909 #include <X11/extensions/dpms.h>
3910 int main(void) {
3911 (void) DPMSQueryExtension(0, 0, 0);
3914 cc_check -lXdpms && _xdpms3=yes
3915 cat > $TMPC <<EOF
3916 #include <X11/Xlib.h>
3917 #include <X11/extensions/dpms.h>
3918 int main(void) {
3919 (void) DPMSQueryExtension(0, 0, 0);
3922 cc_check -lXext && _xdpms4=yes
3924 if test "$_xdpms4" = yes ; then
3925 _def_xdpms='#define HAVE_XDPMS 1'
3926 _res_comment="using Xdpms 4"
3927 echores "yes"
3928 elif test "$_xdpms3" = yes ; then
3929 _def_xdpms='#define HAVE_XDPMS 1'
3930 _libs_mplayer="$_libs_mplayer -lXdpms"
3931 _res_comment="using Xdpms 3"
3932 echores "yes"
3933 else
3934 _def_xdpms='#undef HAVE_XDPMS'
3935 echores "no"
3939 echocheck "Xv"
3940 if test "$_xv" = auto ; then
3941 cat > $TMPC <<EOF
3942 #include <X11/Xlib.h>
3943 #include <X11/extensions/Xvlib.h>
3944 int main(void) {
3945 (void) XvGetPortAttribute(0, 0, 0, 0);
3946 (void) XvQueryPortAttributes(0, 0, 0);
3947 return 0; }
3949 _xv=no
3950 cc_check -lXv && _xv=yes
3953 if test "$_xv" = yes ; then
3954 _def_xv='#define HAVE_XV 1'
3955 _libs_mplayer="$_libs_mplayer -lXv"
3956 _vosrc="$_vosrc vo_xv.c"
3957 _vomodules="xv $_vomodules"
3958 else
3959 _def_xv='#undef HAVE_XV'
3960 _novomodules="xv $_novomodules"
3962 echores "$_xv"
3965 echocheck "XvMC"
3966 if test "$_xv" = yes && test "$_xvmc" != no ; then
3967 _xvmc=no
3968 cat > $TMPC <<EOF
3969 #include <X11/Xlib.h>
3970 #include <X11/extensions/Xvlib.h>
3971 #include <X11/extensions/XvMClib.h>
3972 int main(void) {
3973 (void) XvMCQueryExtension(0,0,0);
3974 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3975 return 0; }
3977 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3978 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3979 done
3981 if test "$_xvmc" = yes ; then
3982 _def_xvmc='#define HAVE_XVMC 1'
3983 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
3984 _vosrc="$_vosrc vo_xvmc.c"
3985 _vomodules="xvmc $_vomodules"
3986 _res_comment="using $_xvmclib"
3987 else
3988 _def_xvmc='#undef HAVE_XVMC'
3989 _novomodules="xvmc $_novomodules"
3990 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
3992 echores "$_xvmc"
3995 echocheck "Xinerama"
3996 if test "$_xinerama" = auto ; then
3997 cat > $TMPC <<EOF
3998 #include <X11/Xlib.h>
3999 #include <X11/extensions/Xinerama.h>
4000 int main(void) { (void) XineramaIsActive(0); return 0; }
4002 _xinerama=no
4003 cc_check -lXinerama && _xinerama=yes
4006 if test "$_xinerama" = yes ; then
4007 _def_xinerama='#define HAVE_XINERAMA 1'
4008 _libs_mplayer="$_libs_mplayer -lXinerama"
4009 else
4010 _def_xinerama='#undef HAVE_XINERAMA'
4012 echores "$_xinerama"
4015 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4016 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4017 # named 'X extensions' or something similar.
4018 # This check may be useful for future mplayer versions (to change resolution)
4019 # If you run into problems, remove '-lXxf86vm'.
4020 echocheck "Xxf86vm"
4021 if test "$_vm" = auto ; then
4022 cat > $TMPC <<EOF
4023 #include <X11/Xlib.h>
4024 #include <X11/extensions/xf86vmode.h>
4025 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4027 _vm=no
4028 cc_check -lXxf86vm && _vm=yes
4030 if test "$_vm" = yes ; then
4031 _def_vm='#define HAVE_XF86VM 1'
4032 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4033 else
4034 _def_vm='#undef HAVE_XF86VM'
4036 echores "$_vm"
4038 # Check for the presence of special keycodes, like audio control buttons
4039 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4040 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4041 # have these new keycodes.
4042 echocheck "XF86keysym"
4043 if test "$_xf86keysym" = auto; then
4044 _xf86keysym=no
4045 cat > $TMPC <<EOF
4046 #include <X11/Xlib.h>
4047 #include <X11/XF86keysym.h>
4048 int main(void) { return XF86XK_AudioPause; }
4050 cc_check && _xf86keysym=yes
4052 if test "$_xf86keysym" = yes ; then
4053 _def_xf86keysym='#define HAVE_XF86XK 1'
4054 else
4055 _def_xf86keysym='#undef HAVE_XF86XK'
4057 echores "$_xf86keysym"
4059 echocheck "DGA"
4060 if test "$_dga2" = auto && test "$_x11" = yes ; then
4061 cat > $TMPC << EOF
4062 #include <X11/Xlib.h>
4063 #include <X11/extensions/xf86dga.h>
4064 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4066 _dga2=no
4067 cc_check -lXxf86dga && _dga2=yes
4069 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4070 cat > $TMPC << EOF
4071 #include <X11/Xlib.h>
4072 #include <X11/extensions/xf86dga.h>
4073 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4075 _dga1=no
4076 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4079 _dga=no
4080 _def_dga='#undef HAVE_DGA'
4081 _def_dga1='#undef HAVE_DGA1'
4082 _def_dga2='#undef HAVE_DGA2'
4083 if test "$_dga1" = yes ; then
4084 _dga=yes
4085 _def_dga1='#define HAVE_DGA1 1'
4086 _res_comment="using DGA 1.0"
4087 elif test "$_dga2" = yes ; then
4088 _dga=yes
4089 _def_dga2='#define HAVE_DGA2 1'
4090 _res_comment="using DGA 2.0"
4092 if test "$_dga" = yes ; then
4093 _def_dga='#define HAVE_DGA 1'
4094 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4095 _vosrc="$_vosrc vo_dga.c"
4096 _vomodules="dga $_vomodules"
4097 else
4098 _novomodules="dga $_novomodules"
4100 echores "$_dga"
4103 echocheck "3dfx"
4104 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4105 _def_3dfx='#define HAVE_3DFX 1'
4106 _vosrc="$_vosrc vo_3dfx.c"
4107 _vomodules="3dfx $_vomodules"
4108 else
4109 _def_3dfx='#undef HAVE_3DFX'
4110 _novomodules="3dfx $_novomodules"
4112 echores "$_3dfx"
4115 echocheck "OpenGL"
4116 #Note: this test is run even with --enable-gl since we autodetect linker flags
4117 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4118 cat > $TMPC << EOF
4119 #include <GL/gl.h>
4120 #ifdef GL_WIN32
4121 #include <windows.h>
4122 #include <GL/glext.h>
4123 #else
4124 #include <X11/Xlib.h>
4125 #include <GL/glx.h>
4126 #endif
4127 int main(void) {
4128 #ifdef GL_WIN32
4129 HDC dc;
4130 wglCreateContext(dc);
4131 #else
4132 glXCreateContext(NULL, NULL, NULL, True);
4133 #endif
4134 glFinish();
4135 return 0;
4138 _gl=no
4139 if cc_check -lGL $_ld_lm ; then
4140 _gl=yes
4141 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4142 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4143 _gl=yes
4144 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4145 elif cc_check -DGL_WIN32 -lopengl32 ; then
4146 _gl=yes
4147 _gl_win32=yes
4148 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4150 else
4151 _gl=no
4153 if test "$_gl" = yes ; then
4154 _def_gl='#define HAVE_GL 1'
4155 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4156 if test "$_gl_win32" = yes ; then
4157 _def_gl_win32='#define GL_WIN32 1'
4158 _vosrc="$_vosrc w32_common.c"
4159 _res_comment="win32 version"
4161 _vomodules="opengl $_vomodules"
4162 else
4163 _def_gl='#undef HAVE_GL'
4164 _def_gl_win32='#undef GL_WIN32'
4165 _novomodules="opengl $_novomodules"
4167 echores "$_gl"
4170 echocheck "VIDIX"
4171 _vidix=no
4172 _def_vidix='#undef CONFIG_VIDIX'
4173 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4174 _vidix_drv_cyberblade=no
4175 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4176 _vidix_drv_ivtv=no
4177 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4178 _vidix_drv_ivtv=no
4179 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4180 _vidix_drv_mach64=no
4181 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4182 _vidix_drv_mga=no
4183 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4184 _vidix_drv_mga_crtc2=no
4185 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4186 _vidix_drv_nvidia=no
4187 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4188 _vidix_drv_pm2=no
4189 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4190 _vidix_drv_pm3=no
4191 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4192 _vidix_drv_radeon=no
4193 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4194 _vidix_drv_rage128=no
4195 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
4196 _vidix_drv_savage=no
4197 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4198 _vidix_drv_sis=no
4199 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4200 _vidix_drv_unichrome=no
4201 if test "$_vidix_internal" = auto ; then
4202 _vidix_internal=no
4203 x86 && _vidix_internal=yes
4204 ppc && linux && _vidix_internal=yes
4205 alpha && linux && _vidix_internal=yes
4206 qnx || beos || darwin && _vidix_internal=no
4208 if test "$_vidix_internal" = yes; then
4209 _res_comment="internal"
4210 _vidix_external=no
4211 _vidix=yes
4212 elif test "$_vidix_external" = auto; then
4213 _vidix_external=no
4214 cat > $TMPC <<EOF
4215 #include <vidix/vidix.h>
4216 int main(void) { return 0; }
4218 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
4219 && _vidix=yes
4221 echores "$_vidix"
4223 if test "$_vidix" = yes ; then
4224 _def_vidix='#define CONFIG_VIDIX 1'
4225 _vosrc="$_vosrc vo_cvidix.c"
4226 _vomodules="cvidix $_vomodules"
4227 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 savage sis unichrome"
4228 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4230 # some vidix drivers are meant to work on x86 only, discard them elsewhere
4231 x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome//`
4233 for driver in $_vidix_drivers ; do
4234 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4235 eval _vidix_drv_${driver}=yes
4236 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4237 done
4238 else
4239 _novomodules="cvidix $_novomodules"
4242 if test "$_vidix_internal" = yes ; then
4243 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
4244 elif test "$_vidix_external" = yes ; then
4245 _libs_mplayer="$_libs_mplayer -lvidix"
4246 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
4249 if test "$_vidix" = yes && win32; then
4250 _vosrc="$_vosrc vo_winvidix.c"
4251 _vomodules="winvidix $_vomodules"
4252 _libs_mplayer="$_libs_mplayer -lgdi32"
4253 else
4254 _novomodules="winvidix $_novomodules"
4256 if test "$_vidix" = yes && test "$_x11" = yes; then
4257 _vosrc="$_vosrc vo_xvidix.c"
4258 _vomodules="xvidix $_vomodules"
4259 else
4260 _novomodules="xvidix $_novomodules"
4263 echocheck "VIDIX PCI device name database"
4264 echores "$_vidix_pcidb"
4265 if test "$_vidix_pcidb" = yes ; then
4266 _vidix_pcidb_val=1
4267 else
4268 _vidix_pcidb_val=0
4271 echocheck "/dev/mga_vid"
4272 if test "$_mga" = auto ; then
4273 _mga=no
4274 test -c /dev/mga_vid && _mga=yes
4276 if test "$_mga" = yes ; then
4277 _def_mga='#define HAVE_MGA 1'
4278 _vosrc="$_vosrc vo_mga.c"
4279 _vomodules="mga $_vomodules"
4280 else
4281 _def_mga='#undef HAVE_MGA'
4282 _novomodules="mga $_novomodules"
4284 echores "$_mga"
4287 echocheck "xmga"
4288 if test "$_xmga" = auto ; then
4289 _xmga=no
4290 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4292 if test "$_xmga" = yes ; then
4293 _def_xmga='#define HAVE_XMGA 1'
4294 _vosrc="$_vosrc vo_xmga.c"
4295 _vomodules="xmga $_vomodules"
4296 else
4297 _def_xmga='#undef HAVE_XMGA'
4298 _novomodules="xmga $_novomodules"
4300 echores "$_xmga"
4303 echocheck "GGI"
4304 if test "$_ggi" = auto ; then
4305 cat > $TMPC << EOF
4306 #include <ggi/ggi.h>
4307 int main(void) { ggiInit(); return 0; }
4309 _ggi=no
4310 cc_check -lggi && _ggi=yes
4312 if test "$_ggi" = yes ; then
4313 _def_ggi='#define HAVE_GGI 1'
4314 _libs_mplayer="$_libs_mplayer -lggi"
4315 _vosrc="$_vosrc vo_ggi.c"
4316 _vomodules="ggi $_vomodules"
4317 else
4318 _def_ggi='#undef HAVE_GGI'
4319 _novomodules="ggi $_novomodules"
4321 echores "$_ggi"
4323 echocheck "GGI extension: libggiwmh"
4324 if test "$_ggiwmh" = auto ; then
4325 _ggiwmh=no
4326 cat > $TMPC << EOF
4327 #include <ggi/ggi.h>
4328 #include <ggi/wmh.h>
4329 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4331 cc_check -lggi -lggiwmh && _ggiwmh=yes
4333 # needed to get right output on obscure combination
4334 # like --disable-ggi --enable-ggiwmh
4335 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4336 _def_ggiwmh='#define HAVE_GGIWMH 1'
4337 _libs_mplayer="$_libs_mplayer -lggiwmh"
4338 else
4339 _ggiwmh=no
4340 _def_ggiwmh='#undef HAVE_GGIWMH'
4342 echores "$_ggiwmh"
4345 echocheck "AA"
4346 if test "$_aa" = auto ; then
4347 cat > $TMPC << EOF
4348 #include <aalib.h>
4349 extern struct aa_hardware_params aa_defparams;
4350 extern struct aa_renderparams aa_defrenderparams;
4351 int main(void) {
4352 aa_context *c;
4353 aa_renderparams *p;
4354 (void) aa_init(0, 0, 0);
4355 c = aa_autoinit(&aa_defparams);
4356 p = aa_getrenderparams();
4357 aa_autoinitkbd(c,0);
4358 return 0; }
4360 _aa=no
4361 for _ld_tmp in "-laa" ; do
4362 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4363 done
4365 if test "$_aa" = yes ; then
4366 _def_aa='#define HAVE_AA 1'
4367 if cygwin ; then
4368 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4370 _vosrc="$_vosrc vo_aa.c"
4371 _vomodules="aa $_vomodules"
4372 else
4373 _def_aa='#undef HAVE_AA'
4374 _novomodules="aa $_novomodules"
4376 echores "$_aa"
4379 echocheck "CACA"
4380 if test "$_caca" = auto ; then
4381 _caca=no
4382 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4383 cat > $TMPC << EOF
4384 #include <caca.h>
4385 #ifdef CACA_API_VERSION_1
4386 #include <caca0.h>
4387 #endif
4388 int main(void) { (void) caca_init(); return 0; }
4390 cc_check `caca-config --libs` && _caca=yes
4393 if test "$_caca" = yes ; then
4394 _def_caca='#define HAVE_CACA 1'
4395 _inc_extra="$_inc_extra `caca-config --cflags`"
4396 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4397 _vosrc="$_vosrc vo_caca.c"
4398 _vomodules="caca $_vomodules"
4399 else
4400 _def_caca='#undef HAVE_CACA'
4401 _novomodules="caca $_novomodules"
4403 echores "$_caca"
4406 echocheck "SVGAlib"
4407 if test "$_svga" = auto ; then
4408 cat > $TMPC << EOF
4409 #include <vga.h>
4410 int main(void) { return 0; }
4412 _svga=no
4413 cc_check -lvga $_ld_lm && _svga=yes
4415 if test "$_svga" = yes ; then
4416 _def_svga='#define HAVE_SVGALIB 1'
4417 _libs_mplayer="$_libs_mplayer -lvga"
4418 _vosrc="$_vosrc vo_svga.c"
4419 _vomodules="svga $_vomodules"
4420 else
4421 _def_svga='#undef HAVE_SVGALIB'
4422 _novomodules="svga $_novomodules"
4424 echores "$_svga"
4427 echocheck "FBDev"
4428 if test "$_fbdev" = auto ; then
4429 _fbdev=no
4430 linux && _fbdev=yes
4432 if test "$_fbdev" = yes ; then
4433 _def_fbdev='#define HAVE_FBDEV 1'
4434 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4435 _vomodules="fbdev $_vomodules"
4436 else
4437 _def_fbdev='#undef HAVE_FBDEV'
4438 _novomodules="fbdev $_novomodules"
4440 echores "$_fbdev"
4444 echocheck "DVB"
4445 if test "$_dvb" = auto ; then
4446 _dvb=no
4447 cat >$TMPC << EOF
4448 #include <sys/poll.h>
4449 #include <sys/ioctl.h>
4450 #include <stdio.h>
4451 #include <time.h>
4452 #include <unistd.h>
4454 #include <ost/dmx.h>
4455 #include <ost/frontend.h>
4456 #include <ost/sec.h>
4457 #include <ost/video.h>
4458 #include <ost/audio.h>
4459 int main(void) {return 0;}
4461 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4462 cc_check $_inc_tmp && _dvb=yes && \
4463 _inc_extra="$_inc_extra $_inc_tmp" && break
4464 done
4466 echores "$_dvb"
4467 if test "$_dvb" = yes ; then
4468 _def_dvb='#define HAVE_DVB 1'
4469 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4470 _aomodules="mpegpes(dvb) $_aomodules"
4471 _vomodules="mpegpes(dvb) $_vomodules"
4474 echocheck "DVB HEAD"
4475 if test "$_dvbhead" = auto ; then
4476 _dvbhead=no
4478 cat >$TMPC << EOF
4479 #include <sys/poll.h>
4480 #include <sys/ioctl.h>
4481 #include <stdio.h>
4482 #include <time.h>
4483 #include <unistd.h>
4485 #include <linux/dvb/dmx.h>
4486 #include <linux/dvb/frontend.h>
4487 #include <linux/dvb/video.h>
4488 #include <linux/dvb/audio.h>
4489 int main(void) {return 0;}
4491 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4492 cc_check $_inc_tmp && _dvbhead=yes && \
4493 _inc_extra="$_inc_extra $_inc_tmp" && break
4494 done
4496 echores "$_dvbhead"
4497 if test "$_dvbhead" = yes ; then
4498 _def_dvb='#define HAVE_DVB_HEAD 1'
4499 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4500 _aomodules="mpegpes(dvb) $_aomodules"
4501 _vomodules="mpegpes(dvb) $_vomodules"
4504 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4505 _def_dvb='#undef HAVE_DVB'
4506 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4507 _aomodules="mpegpes(file) $_aomodules"
4508 _vomodules="mpegpes(file) $_vomodules"
4511 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4512 _dvbin=yes
4513 _inputmodules="dvb $_inputmodules"
4514 else
4515 _dvbin=no
4516 _noinputmodules="dvb $_noinputmodules"
4520 echocheck "zr"
4521 if test "$_zr" = auto ; then
4522 #36067's seem to identify themselves as 36057PQC's, so the line
4523 #below should work for 36067's and 36057's.
4524 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
4525 _zr=yes
4526 else
4527 _zr=no
4530 if test "$_zr" = yes ; then
4531 if test "$_libavcodec_a" = yes ; then
4532 _def_zr='#define HAVE_ZR 1'
4533 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
4534 _vomodules="zr zr2 $_vomodules"
4535 else
4536 _res_comment="libavcodec (static) is required by zr, sorry"
4537 _novomodules="zr $_novomodules"
4538 _def_zr='#undef HAVE_ZR'
4540 else
4541 _def_zr='#undef HAVE_ZR'
4542 _novomodules="zr zr2 $_novomodules"
4544 echores "$_zr"
4547 echocheck "PNG support"
4548 if test "$_png" = auto ; then
4549 _png=no
4550 if irix ; then
4551 # Don't check for -lpng on irix since it has its own libpng
4552 # incompatible with the GNU libpng
4553 _res_comment="disabled on irix (not GNU libpng)"
4554 else
4555 cat > $TMPC << EOF
4556 #include <png.h>
4557 #include <string.h>
4558 int main(void) {
4559 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4560 printf("libpng: %s\n", png_libpng_ver);
4561 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4564 if cc_check -lpng -lz $_ld_lm ; then
4565 if tmp_run ; then
4566 _png=yes
4567 else
4568 _res_comment="mismatch of library and header versions"
4573 echores "$_png"
4574 if test "$_png" = yes ; then
4575 _def_png='#define HAVE_PNG 1'
4576 _ld_extra="$_ld_extra -lpng -lz"
4577 _vosrc="$_vosrc vo_png.c"
4578 _vomodules="png $_vomodules"
4579 else
4580 _def_png='#undef HAVE_PNG'
4581 _novomodules="png $_novomodules"
4584 echocheck "JPEG support"
4585 if test "$_jpeg" = auto ; then
4586 _jpeg=no
4587 cat > $TMPC << EOF
4588 #include <stdio.h>
4589 #include <stdlib.h>
4590 #include <setjmp.h>
4591 #include <string.h>
4592 #include <jpeglib.h>
4593 int main(void) {
4594 return 0;
4597 if cc_check -ljpeg $_ld_lm ; then
4598 if tmp_run ; then
4599 _jpeg=yes
4603 echores "$_jpeg"
4605 if test "$_jpeg" = yes ; then
4606 _def_jpeg='#define HAVE_JPEG 1'
4607 _vosrc="$_vosrc vo_jpeg.c"
4608 _vomodules="jpeg $_vomodules"
4609 _ld_extra="$_ld_extra -ljpeg"
4610 else
4611 _def_jpeg='#undef HAVE_JPEG'
4612 _novomodules="jpeg $_novomodules"
4617 echocheck "PNM support"
4618 if test "$_pnm" = yes; then
4619 _def_pnm="#define HAVE_PNM"
4620 _vosrc="$_vosrc vo_pnm.c"
4621 _vomodules="pnm $_vomodules"
4622 else
4623 _def_pnm="#undef HAVE_PNM"
4624 _novomodules="pnm $_novomodules"
4626 echores "$_pnm"
4630 echocheck "GIF support"
4631 # This is to appease people who want to force gif support.
4632 # If it is forced to yes, then we still do checks to determine
4633 # which gif library to use.
4634 if test "$_gif" = yes ; then
4635 _force_gif=yes
4636 _gif=auto
4639 if test "$_gif" = auto ; then
4640 _gif=no
4641 cat > $TMPC << EOF
4642 #include <gif_lib.h>
4643 int main(void) {
4644 return 0;
4647 for _ld_gif in "-lungif" "-lgif" ; do
4648 cc_check $_ld_gif && tmp_run && _gif=yes && break
4649 done
4652 # If no library was found, and the user wants support forced,
4653 # then we force it on with libgif, as this is the safest
4654 # assumption IMHO. (libungif & libregif both create symbolic
4655 # links to libgif. We also assume that no x11 support is needed,
4656 # because if you are forcing this, then you _should_ know what
4657 # you are doing. [ Besides, package maintainers should never
4658 # have compiled x11 deps into libungif in the first place. ] )
4659 # </rant>
4660 # --Joey
4661 if test "$_force_gif" = yes && test "$_gif" = no ; then
4662 _gif=yes
4663 _ld_gif="-lgif"
4666 if test "$_gif" = yes ; then
4667 _def_gif='#define HAVE_GIF 1'
4668 _vosrc="$_vosrc vo_gif89a.c"
4669 _codecmodules="gif $_codecmodules"
4670 _vomodules="gif89a $_vomodules"
4671 _res_comment="old version, some encoding functions disabled"
4672 _def_gif_4='#undef HAVE_GIF_4'
4673 _ld_extra="$_ld_extra $_ld_gif"
4675 cat > $TMPC << EOF
4676 #include <signal.h>
4677 #include <gif_lib.h>
4678 void catch() { exit(1); }
4679 int main(void) {
4680 signal(SIGSEGV, catch); // catch segfault
4681 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4682 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4683 return 0;
4686 if cc_check "$_ld_gif" && tmp_run ; then
4687 _def_gif_4='#define HAVE_GIF_4 1'
4688 _res_comment=""
4690 else
4691 _def_gif='#undef HAVE_GIF'
4692 _def_gif_4='#undef HAVE_GIF_4'
4693 _novomodules="gif89a $_novomodules"
4694 _nocodecmodules="gif $_nocodecmodules"
4696 echores "$_gif"
4699 case "$_gif" in yes*)
4700 echocheck "broken giflib workaround"
4701 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4703 cat > $TMPC << EOF
4704 #include <gif_lib.h>
4705 int main(void) {
4706 GifFileType gif;
4707 printf("UserData is at address %p\n", gif.UserData);
4708 return 0;
4711 if cc_check "$_ld_gif" && tmp_run ; then
4712 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4713 echores "disabled"
4714 else
4715 echores "enabled"
4718 esac
4721 echocheck "VESA support"
4722 if test "$_vesa" = auto ; then
4723 cat > $TMPC << EOF
4724 #include <vbe.h>
4725 int main(void) { vbeVersion(); return 0; }
4727 _vesa=no
4728 cc_check -lvbe -llrmi && _vesa=yes
4730 if test "$_vesa" = yes ; then
4731 _def_vesa='#define HAVE_VESA 1'
4732 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4733 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4734 _vomodules="vesa $_vomodules"
4735 else
4736 _def_vesa='#undef HAVE_VESA'
4737 _novomodules="vesa $_novomodules"
4739 echores "$_vesa"
4741 #################
4742 # VIDEO + AUDIO #
4743 #################
4746 echocheck "SDL"
4747 if test -z "$_sdlconfig" ; then
4748 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4749 _sdlconfig="sdl-config"
4750 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4751 _sdlconfig="sdl11-config"
4752 else
4753 _sdlconfig=false
4756 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4757 cat > $TMPC << EOF
4758 #include <SDL.h>
4759 int main(int argc, char *argv[]) {
4760 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4761 return 0;
4764 _sdl=no
4765 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4766 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4767 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4768 if test "$_sdlversion" -gt 116 ; then
4769 if test "$_sdlversion" -lt 121 ; then
4770 _def_sdlbuggy='#define BUGGY_SDL'
4771 else
4772 _def_sdlbuggy='#undef BUGGY_SDL'
4774 _sdl=yes
4779 if test "$_sdl" = yes ; then
4780 _def_sdl='#define HAVE_SDL 1'
4781 if cygwin ; then
4782 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4783 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4784 elif mingw32 ; then
4785 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4786 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4787 else
4788 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4789 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4791 _vosrc="$_vosrc vo_sdl.c"
4792 _vomodules="sdl $_vomodules"
4793 _aosrc="$_aosrc ao_sdl.c"
4794 _aomodules="sdl $_aomodules"
4795 _res_comment="using $_sdlconfig"
4796 else
4797 _def_sdl='#undef HAVE_SDL'
4798 _novomodules="sdl $_novomodules"
4799 _noaomodules="sdl $_noaomodules"
4801 echores "$_sdl"
4804 if win32; then
4806 echocheck "Windows waveout"
4807 if test "$_win32waveout" = auto ; then
4808 cat > $TMPC << EOF
4809 #include <windows.h>
4810 #include <mmsystem.h>
4811 int main(void) { return 0; }
4813 _win32waveout=no
4814 cc_check -lwinmm && _win32waveout=yes
4816 if test "$_win32waveout" = yes ; then
4817 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4818 _libs_mplayer="$_libs_mplayer -lwinmm"
4819 _aosrc="$_aosrc ao_win32.c"
4820 _aomodules="win32 $_aomodules"
4821 else
4822 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4823 _noaomodules="win32 $_noaomodules"
4825 echores "$_win32waveout"
4827 echocheck "Directx"
4828 if test "$_directx" = auto ; then
4829 cat > $TMPC << EOF
4830 #include <windows.h>
4831 #include <ddraw.h>
4832 #include <dsound.h>
4833 int main(void) { return 0; }
4835 _directx=no
4836 cc_check -lgdi32 && _directx=yes
4838 if test "$_directx" = yes ; then
4839 _def_directx='#define HAVE_DIRECTX 1'
4840 _libs_mplayer="$_libs_mplayer -lgdi32"
4841 _vosrc="$_vosrc vo_directx.c"
4842 _vomodules="directx $_vomodules"
4843 _aosrc="$_aosrc ao_dsound.c"
4844 _aomodules="dsound $_aomodules"
4845 else
4846 _def_directx='#undef HAVE_DIRECTX'
4847 _novomodules="directx $_novomodules"
4848 _noaomodules="dsound $_noaomodules"
4850 echores "$_directx"
4852 fi #if win32; then
4855 echocheck "NAS"
4856 if test "$_nas" = auto ; then
4857 cat > $TMPC << EOF
4858 #include <audio/audiolib.h>
4859 int main(void) { return 0; }
4861 _nas=no
4862 cc_check $_ld_lm -laudio -lXt && _nas=yes
4864 if test "$_nas" = yes ; then
4865 _def_nas='#define HAVE_NAS 1'
4866 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4867 _aosrc="$_aosrc ao_nas.c"
4868 _aomodules="nas $_aomodules"
4869 else
4870 _noaomodules="nas $_noaomodules"
4871 _def_nas='#undef HAVE_NAS'
4873 echores "$_nas"
4875 echocheck "DXR2"
4876 if test "$_dxr2" = auto; then
4877 _dxr2=no
4878 cat > $TMPC << EOF
4879 #include <dxr2ioctl.h>
4880 int main(void) { return 0; }
4882 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4883 cc_check $_inc_tmp && _dxr2=yes && \
4884 _inc_extra="$_inc_extra $_inc_tmp" && break
4885 done
4887 if test "$_dxr2" = yes; then
4888 _def_dxr2='#define HAVE_DXR2 1'
4889 _vosrc="$_vosrc vo_dxr2.c"
4890 _aosrc="$_aosrc ao_dxr2.c"
4891 _aomodules="dxr2 $_aomodules"
4892 _vomodules="dxr2 $_vomodules"
4893 else
4894 _def_dxr2='#undef HAVE_DXR2'
4895 _noaomodules="dxr2 $_noaomodules"
4896 _novomodules="dxr2 $_novomodules"
4898 echores "$_dxr2"
4900 echocheck "DXR3/H+"
4901 if test "$_dxr3" = auto ; then
4902 cat > $TMPC << EOF
4903 #include <linux/em8300.h>
4904 int main(void) { return 0; }
4906 _dxr3=no
4907 cc_check && _dxr3=yes
4909 if test "$_dxr3" = yes ; then
4910 _def_dxr3='#define HAVE_DXR3 1'
4911 _vosrc="$_vosrc vo_dxr3.c"
4912 _vomodules="dxr3 $_vomodules"
4913 else
4914 _def_dxr3='#undef HAVE_DXR3'
4915 _novomodules="dxr3 $_novomodules"
4917 echores "$_dxr3"
4920 echocheck "IVTV TV-Out"
4921 if test "$_ivtv" = auto ; then
4922 cat > $TMPC << EOF
4923 #include <stdlib.h>
4924 #include <inttypes.h>
4925 #include <linux/types.h>
4926 #include <linux/videodev2.h>
4927 #include <linux/ivtv.h>
4928 int main(void) { return 0; }
4930 _ivtv=no
4931 cc_check && _ivtv=yes
4933 if test "$_ivtv" = yes ; then
4934 _def_ivtv='#define HAVE_IVTV 1'
4935 _vosrc="$_vosrc vo_ivtv.c"
4936 _vomodules="ivtv $_vomodules"
4937 _aosrc="$_aosrc ao_ivtv.c"
4938 _aomodules="ivtv $_aomodules"
4939 else
4940 _def_ivtv='#undef HAVE_IVTV'
4941 _novomodules="ivtv $_novomodules"
4942 _noaomodules="ivtv $_noaomodules"
4944 echores "$_ivtv"
4947 echocheck "V4L2 MPEG Decoder"
4948 if test "$_v4l2" = auto ; then
4949 cat > $TMPC << EOF
4950 #include <stdlib.h>
4951 #include <inttypes.h>
4952 #include <linux/types.h>
4953 #include <linux/videodev2.h>
4954 #include <linux/version.h>
4955 int main(void) {
4956 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4957 #error kernel headers too old, need 2.6.22
4958 bad_kernel_version();
4959 #endif
4960 struct v4l2_ext_controls ctrls;
4961 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4962 return 0;
4965 _v4l2=no
4966 cc_check && _v4l2=yes
4968 if test "$_v4l2" = yes ; then
4969 _def_v4l2='#define HAVE_V4L2_DECODER 1'
4970 _vosrc="$_vosrc vo_v4l2.c"
4971 _vomodules="v4l2 $_vomodules"
4972 _aosrc="$_aosrc ao_v4l2.c"
4973 _aomodules="v4l2 $_aomodules"
4974 else
4975 _def_v4l2='#undef HAVE_V4L2_DECODER'
4976 _novomodules="v4l2 $_novomodules"
4977 _noaomodules="v4l2 $_noaomodules"
4979 echores "$_v4l2"
4983 #########
4984 # AUDIO #
4985 #########
4988 echocheck "OSS Audio"
4989 if test "$_ossaudio" = auto ; then
4990 cat > $TMPC << EOF
4991 #include <sys/ioctl.h>
4992 #include <$_soundcard_header>
4993 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4995 _ossaudio=no
4996 cc_check && _ossaudio=yes
4998 if test "$_ossaudio" = yes ; then
4999 _def_ossaudio='#define USE_OSS_AUDIO 1'
5000 _aosrc="$_aosrc ao_oss.c"
5001 _aomodules="oss $_aomodules"
5002 if test "$_linux_devfs" = yes; then
5003 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5004 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5005 else
5006 cat > $TMPC << EOF
5007 #include <sys/ioctl.h>
5008 #include <$_soundcard_header>
5009 #ifdef OPEN_SOUND_SYSTEM
5010 int main(void) { return 0; }
5011 #else
5012 #error Not the real thing
5013 #endif
5015 _real_ossaudio=no
5016 cc_check && _real_ossaudio=yes
5017 if test "$_real_ossaudio" = yes; then
5018 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5019 elif netbsd || openbsd ; then
5020 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5021 _ld_extra="$_ld_extra -lossaudio"
5022 else
5023 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5025 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5027 else
5028 _def_ossaudio='#undef USE_OSS_AUDIO'
5029 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5030 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5031 _noaomodules="oss $_noaomodules"
5033 echores "$_ossaudio"
5036 echocheck "aRts"
5037 if test "$_arts" = auto ; then
5038 _arts=no
5039 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5041 cat > $TMPC << EOF
5042 #include <artsc.h>
5043 int main(void) { return 0; }
5045 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5050 if test "$_arts" = yes ; then
5051 _def_arts='#define USE_ARTS 1'
5052 _aosrc="$_aosrc ao_arts.c"
5053 _aomodules="arts $_aomodules"
5054 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5055 _inc_extra="$_inc_extra `artsc-config --cflags`"
5056 else
5057 _noaomodules="arts $_noaomodules"
5059 echores "$_arts"
5062 echocheck "EsounD"
5063 if test "$_esd" = auto ; then
5064 _esd=no
5065 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5067 cat > $TMPC << EOF
5068 #include <esd.h>
5069 int main(void) { int fd = esd_open_sound("test"); return fd; }
5071 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5075 echores "$_esd"
5077 if test "$_esd" = yes ; then
5078 _def_esd='#define USE_ESD 1'
5079 _aosrc="$_aosrc ao_esd.c"
5080 _aomodules="esd $_aomodules"
5081 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5082 _inc_extra="$_inc_extra `esd-config --cflags`"
5084 echocheck "esd_get_latency()"
5085 cat > $TMPC << EOF
5086 #include <esd.h>
5087 int main(void) { return esd_get_latency(0); }
5089 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5090 echores "$_esd_latency"
5091 else
5092 _def_esd='#undef USE_ESD'
5093 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5094 _noaomodules="esd $_noaomodules"
5097 echocheck "pulse"
5098 if test "$_pulse" = auto ; then
5099 _pulse=no
5100 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5102 cat > $TMPC << EOF
5103 #include <pulse/pulseaudio.h>
5104 int main(void) { return 0; }
5106 cc_check `$_pkg_config --libs --cflags libpulse` && tmp_run && _pulse=yes
5110 echores "$_pulse"
5112 if test "$_pulse" = yes ; then
5113 _def_pulse='#define USE_PULSE 1'
5114 _aosrc="$_aosrc ao_pulse.c"
5115 _aomodules="pulse $_aomodules"
5116 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs libpulse`"
5117 _inc_extra="$_inc_extra `$_pkg_config --cflags libpulse`"
5118 else
5119 _def_pulse='#undef USE_PULSE'
5120 _noaomodules="pulse $_noaomodules"
5124 echocheck "JACK"
5125 if test "$_jack" = auto ; then
5126 _jack=yes
5128 cat > $TMPC << EOF
5129 #include <jack/jack.h>
5130 int main(void) { jack_client_new("test"); return 0; }
5132 if cc_check -ljack ; then
5133 _libs_mplayer="$_libs_mplayer -ljack"
5134 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5135 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5136 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5137 else
5138 _jack=no
5142 if test "$_jack" = yes ; then
5143 _def_jack='#define USE_JACK 1'
5144 _aosrc="$_aosrc ao_jack.c"
5145 _aomodules="jack $_aomodules"
5146 else
5147 _noaomodules="jack $_noaomodules"
5149 echores "$_jack"
5151 echocheck "OpenAL"
5152 if test "$_openal" = auto ; then
5153 _openal=no
5154 cat > $TMPC << EOF
5155 #ifdef OPENAL_AL_H
5156 #include <OpenAL/al.h>
5157 #else
5158 #include <AL/al.h>
5159 #endif
5160 int main(void) {
5161 alSourceQueueBuffers(0, 0, 0);
5162 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5163 return 0;
5166 for I in "-lopenal" "-framework OpenAL" ; do
5167 cc_check $I && _openal=yes && break
5168 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5169 done
5170 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5172 if test "$_openal" = yes ; then
5173 _def_openal='#define USE_OPENAL 1'
5174 _aosrc="$_aosrc ao_openal.c"
5175 _aomodules="openal $_aomodules"
5176 else
5177 _noaomodules="openal $_noaomodules"
5179 echores "$_openal"
5181 echocheck "ALSA audio"
5182 if test "$_alsa" != no ; then
5183 _alsa=no
5184 cat > $TMPC << EOF
5185 #include <sys/asoundlib.h>
5186 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5187 #error "alsa version != 0.5.x"
5188 #endif
5189 int main(void) { return 0; }
5191 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5193 cat > $TMPC << EOF
5194 #include <sys/asoundlib.h>
5195 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5196 #error "alsa version != 0.9.x"
5197 #endif
5198 int main(void) { return 0; }
5200 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5201 cat > $TMPC << EOF
5202 #include <alsa/asoundlib.h>
5203 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5204 #error "alsa version != 0.9.x"
5205 #endif
5206 int main(void) { return 0; }
5208 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5210 cat > $TMPC << EOF
5211 #include <sys/asoundlib.h>
5212 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5213 #error "alsa version != 1.0.x"
5214 #endif
5215 int main(void) { return 0; }
5217 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5218 cat > $TMPC << EOF
5219 #include <alsa/asoundlib.h>
5220 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5221 #error "alsa version != 1.0.x"
5222 #endif
5223 int main(void) { return 0; }
5225 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5227 _def_alsa5='#undef HAVE_ALSA5'
5228 _def_alsa9='#undef HAVE_ALSA9'
5229 _def_alsa1x='#undef HAVE_ALSA1X'
5230 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5231 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5232 if test "$_alsaver" ; then
5233 _alsa=yes
5234 if test "$_alsaver" = '0.5.x' ; then
5235 _alsa5=yes
5236 _aosrc="$_aosrc ao_alsa5.c"
5237 _aomodules="alsa5 $_aomodules"
5238 _def_alsa5='#define HAVE_ALSA5 1'
5239 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5240 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5241 elif test "$_alsaver" = '0.9.x-sys' ; then
5242 _alsa9=yes
5243 _aosrc="$_aosrc ao_alsa.c"
5244 _aomodules="alsa $_aomodules"
5245 _def_alsa9='#define HAVE_ALSA9 1'
5246 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5247 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5248 elif test "$_alsaver" = '0.9.x-alsa' ; then
5249 _alsa9=yes
5250 _aosrc="$_aosrc ao_alsa.c"
5251 _aomodules="alsa $_aomodules"
5252 _def_alsa9='#define HAVE_ALSA9 1'
5253 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5254 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5255 elif test "$_alsaver" = '1.0.x-sys' ; then
5256 _alsa1x=yes
5257 _aosrc="$_aosrc ao_alsa.c"
5258 _aomodules="alsa $_aomodules"
5259 _def_alsa1x="#define HAVE_ALSA1X 1"
5260 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5261 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5262 elif test "$_alsaver" = '1.0.x-alsa' ; then
5263 _alsa1x=yes
5264 _aosrc="$_aosrc ao_alsa.c"
5265 _aomodules="alsa $_aomodules"
5266 _def_alsa1x="#define HAVE_ALSA1X 1"
5267 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5268 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5269 else
5270 _alsa=no
5271 _res_comment="unknown version"
5273 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5274 else
5275 _noaomodules="alsa $_noaomodules"
5277 echores "$_alsa"
5280 echocheck "Sun audio"
5281 if test "$_sunaudio" = auto ; then
5282 cat > $TMPC << EOF
5283 #include <sys/types.h>
5284 #include <sys/audioio.h>
5285 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5287 _sunaudio=no
5288 cc_check && _sunaudio=yes
5290 if test "$_sunaudio" = yes ; then
5291 _def_sunaudio='#define USE_SUN_AUDIO 1'
5292 _aosrc="$_aosrc ao_sun.c"
5293 _aomodules="sun $_aomodules"
5294 else
5295 _def_sunaudio='#undef USE_SUN_AUDIO'
5296 _noaomodules="sun $_noaomodules"
5298 echores "$_sunaudio"
5301 if sunos; then
5302 echocheck "Sun mediaLib"
5303 if test "$_mlib" = auto ; then
5304 _mlib=no
5305 cat > $TMPC << EOF
5306 #include <mlib.h>
5307 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5309 cc_check -lmlib && _mlib=yes
5311 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5312 echores "$_mlib"
5313 fi #if sunos
5316 if irix; then
5317 echocheck "SGI audio"
5318 if test "$_sgiaudio" = auto ; then
5319 # check for SGI audio
5320 cat > $TMPC << EOF
5321 #include <dmedia/audio.h>
5322 int main(void) { return 0; }
5324 _sgiaudio=no
5325 cc_check && _sgiaudio=yes
5327 if test "$_sgiaudio" = "yes" ; then
5328 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5329 _libs_mplayer="$_libs_mplayer -laudio"
5330 _aosrc="$_aosrc ao_sgi.c"
5331 _aomodules="sgi $_aomodules"
5332 else
5333 _def_sgiaudio='#undef USE_SGI_AUDIO'
5334 _noaomodules="sgi $_noaomodules"
5336 echores "$_sgiaudio"
5337 fi #if irix
5340 echocheck "VCD support"
5341 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5342 _inputmodules="vcd $_inputmodules"
5343 _def_vcd='#define HAVE_VCD 1'
5344 _vcd="yes"
5345 else
5346 _def_vcd='#undef HAVE_VCD'
5347 _noinputmodules="vcd $_noinputmodules"
5348 _res_comment="not supported on this OS"
5349 _vcd="no"
5351 echores "$_vcd"
5355 echocheck "dvdread"
5356 if test "$_dvdread_internal" = auto ; then
5357 _dvdread_internal=no
5358 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5359 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5360 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5361 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5362 _dvdread_internal=yes
5363 _dvdread=yes
5365 elif test "$_dvdread" = auto ; then
5366 _dvdread=no
5367 if test "$_dl" = yes; then
5368 cat > $TMPC << EOF
5369 #include <inttypes.h>
5370 #include <dvdread/dvd_reader.h>
5371 #include <dvdread/ifo_types.h>
5372 #include <dvdread/ifo_read.h>
5373 #include <dvdread/nav_read.h>
5374 int main(void) { return 0; }
5376 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5377 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5381 if test "$_dvdread_internal" = yes; then
5382 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5383 _def_dvdread='#define USE_DVDREAD 1'
5384 _inputmodules="dvdread(internal) $_inputmodules"
5385 _largefiles=yes
5386 _res_comment="internal"
5387 elif test "$_dvdread" = yes; then
5388 _def_dvdread='#define USE_DVDREAD 1'
5389 _largefiles=yes
5390 _ld_extra="$_ld_extra -ldvdread"
5391 _inputmodules="dvdread(external) $_inputmodules"
5392 _res_comment="external"
5393 else
5394 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5395 _def_dvdread='#undef USE_DVDREAD'
5396 _noinputmodules="dvdread $_noinputmodules"
5398 echores "$_dvdread"
5401 echocheck "internal libdvdcss"
5402 if test "$_libdvdcss_internal" = auto ; then
5403 _libdvdcss_internal=no
5404 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5406 if test "$_libdvdcss_internal" = yes ; then
5407 if linux || netbsd || openbsd || bsdos ; then
5408 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5409 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5410 elif freebsd ; then
5411 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5412 elif darwin ; then
5413 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5414 _ld_extra="$_ld_extra -framework IOKit"
5416 _inputmodules="libdvdcss(internal) $_inputmodules"
5417 _largefiles=yes
5418 else
5419 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5421 echores "$_libdvdcss_internal"
5424 echocheck "cdparanoia"
5425 if test "$_cdparanoia" = auto ; then
5426 cat > $TMPC <<EOF
5427 #include <cdda_interface.h>
5428 #include <cdda_paranoia.h>
5429 // This need a better test. How ?
5430 int main(void) {
5431 void *test = cdda_verbose_set;
5432 return test == (void *)1;
5435 _cdparanoia=no
5436 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5437 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5438 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5439 done
5441 if test "$_cdparanoia" = yes ; then
5442 _cdda='yes'
5443 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5444 openbsd && _ld_extra="$_ld_extra -lutil"
5446 echores "$_cdparanoia"
5449 echocheck "libcdio"
5450 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5451 cat > $TMPC << EOF
5452 #include <stdio.h>
5453 #include <cdio/version.h>
5454 #include <cdio/cdda.h>
5455 #include <cdio/paranoia.h>
5456 int main(void)
5458 void *test = cdda_verbose_set;
5459 printf("%s\n", CDIO_VERSION);
5460 return test == (void *)1;
5464 _libcdio=no
5465 for _ld_tmp in "" "-lwinmm" ; do
5466 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5467 cc_check $_ld_tmp $_ld_lm \
5468 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5469 done
5470 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5471 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5472 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5473 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5474 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5477 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5478 _cdda='yes'
5479 _def_libcdio='#define HAVE_LIBCDIO'
5480 _def_havelibcdio='yes'
5481 else
5482 if test "$_cdparanoia" = yes ; then
5483 _res_comment="using cdparanoia"
5485 _def_libcdio='#undef HAVE_LIBCDIO'
5486 _def_havelibcdio='no'
5488 echores "$_libcdio"
5490 if test "$_cdda" = yes ; then
5491 test $_cddb = auto && test $_network = yes && ! darwin && _cddb=yes
5492 _def_cdparanoia='#define HAVE_CDDA'
5493 _inputmodules="cdda $_inputmodules"
5494 else
5495 _def_cdparanoia='#undef HAVE_CDDA'
5496 _noinputmodules="cdda $_noinputmodules"
5499 if test "$_cddb" = yes ; then
5500 _def_cddb='#define HAVE_CDDB'
5501 _inputmodules="cddb $_inputmodules"
5502 else
5503 _cddb=no
5504 _def_cddb='#undef HAVE_CDDB'
5505 _noinputmodules="cddb $_noinputmodules"
5508 echocheck "bitmap font support"
5509 if test "$_bitmap_font" = yes ; then
5510 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5511 else
5512 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5514 echores "$_bitmap_font"
5517 echocheck "freetype >= 2.0.9"
5519 # freetype depends on iconv
5520 if test "$_iconv" = no ; then
5521 _freetype=no
5522 _res_comment="iconv support needed"
5525 if test "$_freetype" = auto ; then
5526 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5527 cat > $TMPC << EOF
5528 #include <stdio.h>
5529 #include <ft2build.h>
5530 #include FT_FREETYPE_H
5531 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5532 #error "Need FreeType 2.0.9 or newer"
5533 #endif
5534 int main(void)
5536 FT_Library library;
5537 FT_Int major=-1,minor=-1,patch=-1;
5538 int err=FT_Init_FreeType(&library);
5539 if(err){
5540 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5541 exit(err);
5543 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5544 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5545 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5546 (int)major,(int)minor,(int)patch );
5547 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5548 printf("Library and header version mismatch! Fix it in your distribution!\n");
5549 exit(1);
5551 return 0;
5554 _freetype=no
5555 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5556 else
5557 _freetype=no
5560 if test "$_freetype" = yes ; then
5561 _def_freetype='#define HAVE_FREETYPE'
5562 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5563 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5564 else
5565 _def_freetype='#undef HAVE_FREETYPE'
5567 echores "$_freetype"
5569 if test "$_freetype" = no ; then
5570 _fontconfig=no
5571 _res_comment="freetype support needed"
5573 echocheck "fontconfig"
5574 if test "$_fontconfig" = auto ; then
5575 cat > $TMPC << EOF
5576 #include <stdio.h>
5577 #include <fontconfig/fontconfig.h>
5578 int main(void)
5580 int err = FcInit();
5581 if(err == FcFalse){
5582 printf("Couldn't initialize fontconfig lib\n");
5583 exit(err);
5585 return 0;
5589 _fontconfig=no
5590 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5591 _ld_tmp="-lfontconfig $_ld_tmp"
5592 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5593 done
5594 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5595 _inc_tmp=`$_pkg_config --cflags fontconfig`
5596 _ld_tmp=`$_pkg_config --libs fontconfig`
5597 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5598 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5601 if test "$_fontconfig" = yes ; then
5602 _def_fontconfig='#define HAVE_FONTCONFIG'
5603 else
5604 _def_fontconfig='#undef HAVE_FONTCONFIG'
5606 echores "$_fontconfig"
5609 echocheck "SSA/ASS support"
5610 # libass depends on FreeType
5611 if test "$_freetype" = no ; then
5612 _ass=no
5613 _res_comment="FreeType support needed"
5616 if test "$_ass" = auto ; then
5617 cat > $TMPC << EOF
5618 #include <ft2build.h>
5619 #include FT_FREETYPE_H
5620 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5621 #error "Need FreeType 2.1.8 or newer"
5622 #endif
5623 int main(void) { return 0; }
5625 _ass=no
5626 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5627 if test "$_ass" = no ; then
5628 _res_comment="FreeType >= 2.1.8 needed"
5631 if test "$_ass" = yes ; then
5632 _def_ass='#define USE_ASS'
5633 else
5634 _def_ass='#undef USE_ASS'
5636 echores "$_ass"
5639 echocheck "fribidi with charsets"
5640 if test "$_fribidi" = auto ; then
5641 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5642 cat > $TMPC << EOF
5643 #include <stdio.h>
5644 /* workaround for fribidi 0.10.4 and below */
5645 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5646 #include <fribidi/fribidi.h>
5647 int main(void)
5649 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5650 printf("Fribidi headers are not consistents with the library!\n");
5651 exit(1);
5653 return 0;
5656 _fribidi=no
5657 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5658 else
5659 _fribidi=no
5662 if test "$_fribidi" = yes ; then
5663 _def_fribidi='#define USE_FRIBIDI'
5664 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5665 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5666 else
5667 _def_fribidi='#undef USE_FRIBIDI'
5669 echores "$_fribidi"
5672 echocheck "ENCA"
5673 if test "$_enca" = auto ; then
5674 cat > $TMPC << EOF
5675 #include <enca.h>
5676 int main(void)
5678 const char **langs;
5679 size_t langcnt;
5680 langs = enca_get_languages(&langcnt);
5681 return 0;
5684 _enca=no
5685 cc_check -lenca $_ld_lm && _enca=yes
5687 if test "$_enca" = yes ; then
5688 _def_enca='#define HAVE_ENCA 1'
5689 _ld_extra="$_ld_extra -lenca"
5690 else
5691 _def_enca='#undef HAVE_ENCA'
5693 echores "$_enca"
5696 echocheck "zlib"
5697 cat > $TMPC << EOF
5698 #include <zlib.h>
5699 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5701 _zlib=no
5702 cc_check -lz && _zlib=yes
5703 if test "$_zlib" = yes ; then
5704 _def_zlib='#define HAVE_ZLIB 1'
5705 _ld_extra="$_ld_extra -lz"
5706 else
5707 _def_zlib='#undef HAVE_ZLIB'
5708 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5709 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5711 echores "$_zlib"
5714 echocheck "RTC"
5715 if test "$_rtc" = auto ; then
5716 cat > $TMPC << EOF
5717 #include <sys/ioctl.h>
5718 #ifdef __linux__
5719 #include <linux/rtc.h>
5720 #else
5721 #include <rtc.h>
5722 #define RTC_PIE_ON RTCIO_PIE_ON
5723 #endif
5724 int main(void) { return RTC_PIE_ON; }
5726 _rtc=no
5727 cc_check && _rtc=yes
5728 ppc && _rtc=no
5730 if test "$_rtc" = yes ; then
5731 _def_rtc='#define HAVE_RTC 1'
5732 else
5733 _def_rtc='#undef HAVE_RTC'
5735 echores "$_rtc"
5738 echocheck "liblzo2 support"
5739 if test "$_liblzo" = auto ; then
5740 _liblzo=no
5741 cat > $TMPC << EOF
5742 #include <lzo/lzo1x.h>
5743 int main(void) { lzo_init();return 0; }
5745 cc_check -llzo2 && _liblzo=yes
5747 if test "$_liblzo" = yes ; then
5748 _def_liblzo='#define USE_LIBLZO 1'
5749 _ld_extra="$_ld_extra -llzo2"
5750 _codecmodules="liblzo $_codecmodules"
5751 else
5752 _def_liblzo='#undef USE_LIBLZO'
5753 _nocodecmodules="liblzo $_nocodecmodules"
5755 echores "$_liblzo"
5758 echocheck "mad support"
5759 if test "$_mad" = auto ; then
5760 _mad=no
5761 cat > $TMPC << EOF
5762 #include <mad.h>
5763 int main(void) { return 0; }
5765 cc_check -lmad && _mad=yes
5767 if test "$_mad" = yes ; then
5768 _def_mad='#define USE_LIBMAD 1'
5769 _ld_extra="$_ld_extra -lmad"
5770 _codecmodules="libmad $_codecmodules"
5771 else
5772 _def_mad='#undef USE_LIBMAD'
5773 _nocodecmodules="libmad $_nocodecmodules"
5775 echores "$_mad"
5777 echocheck "Twolame"
5778 if test "$_twolame" = auto ; then
5779 cat > $TMPC <<EOF
5780 #include <twolame.h>
5781 int main(void) { twolame_init(); return 0; }
5783 _twolame=no
5784 cc_check -ltwolame $_ld_lm && _twolame=yes
5786 if test "$_twolame" = yes ; then
5787 _def_twolame='#define HAVE_TWOLAME 1'
5788 _libs_mencoder="$_libs_mencoder -ltwolame"
5789 _codecmodules="twolame $_codecmodules"
5790 else
5791 _def_twolame='#undef HAVE_TWOLAME'
5792 _nocodecmodules="twolame $_nocodecmodules"
5794 echores "$_twolame"
5796 echocheck "Toolame"
5797 if test "$_toolame" = auto ; then
5798 _toolame=no
5799 if test "$_twolame" = yes ; then
5800 _res_comment="disabled by twolame"
5801 else
5802 cat > $TMPC <<EOF
5803 #include <toolame.h>
5804 int main(void) { toolame_init(); return 0; }
5806 cc_check -ltoolame $_ld_lm && _toolame=yes
5809 if test "$_toolame" = yes ; then
5810 _def_toolame='#define HAVE_TOOLAME 1'
5811 _libs_mencoder="$_libs_mencoder -ltoolame"
5812 _codecmodules="toolame $_codecmodules"
5813 else
5814 _def_toolame='#undef HAVE_TOOLAME'
5815 _nocodecmodules="toolame $_nocodecmodules"
5817 if test "$_toolamedir" ; then
5818 _res_comment="using $_toolamedir"
5820 echores "$_toolame"
5822 echocheck "OggVorbis support"
5823 if test "$_tremor_internal" = yes; then
5824 _libvorbis=no
5825 elif test "$_tremor_external" = auto; then
5826 _tremor_external=no
5827 cat > $TMPC << EOF
5828 #include <tremor/ivorbiscodec.h>
5829 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5831 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5833 if test "$_libvorbis" = auto; then
5834 _libvorbis=no
5835 cat > $TMPC << EOF
5836 #include <vorbis/codec.h>
5837 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5839 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5841 if test "$_tremor_internal" = yes ; then
5842 _vorbis=yes
5843 _def_vorbis='#define HAVE_OGGVORBIS 1'
5844 _def_tremor='#define TREMOR 1'
5845 _codecmodules="tremor(internal) $_codecmodules"
5846 _res_comment="internal Tremor"
5847 if test "$_tremor_low" = yes ; then
5848 _res_comment="internal low accuracy Tremor"
5850 elif test "$_tremor_external" = yes ; then
5851 _vorbis=yes
5852 _def_vorbis='#define HAVE_OGGVORBIS 1'
5853 _def_tremor='#define TREMOR 1'
5854 _codecmodules="tremor(external) $_codecmodules"
5855 _res_comment="external Tremor"
5856 _ld_extra="$_ld_extra -logg -lvorbisidec"
5857 elif test "$_libvorbis" = yes ; then
5858 _vorbis=yes
5859 _def_vorbis='#define HAVE_OGGVORBIS 1'
5860 _codecmodules="libvorbis $_codecmodules"
5861 _res_comment="libvorbis"
5862 _ld_extra="$_ld_extra -lvorbis -logg"
5863 else
5864 _vorbis=no
5865 _nocodecmodules="libvorbis $_nocodecmodules"
5867 if test "$_libvorbis" = no ; then
5868 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5870 echores "$_vorbis"
5872 echocheck "libspeex (version >= 1.1 required)"
5873 if test "$_speex" = auto ; then
5874 _speex=no
5875 cat > $TMPC << EOF
5876 #include <speex/speex.h>
5877 int main(void) {
5878 SpeexBits bits;
5879 void *dec;
5880 speex_decode_int(dec, &bits, dec);
5883 cc_check -lspeex $_ld_lm && _speex=yes
5885 if test "$_speex" = yes ; then
5886 _def_speex='#define HAVE_SPEEX 1'
5887 _ld_extra="$_ld_extra -lspeex"
5888 _codecmodules="speex $_codecmodules"
5889 else
5890 _def_speex='#undef HAVE_SPEEX'
5891 _nocodecmodules="speex $_nocodecmodules"
5893 echores "$_speex"
5895 echocheck "OggTheora support"
5896 if test "$_theora" = auto ; then
5897 _theora=no
5898 cat > $TMPC << EOF
5899 #include <theora/theora.h>
5900 #include <string.h>
5901 int main(void)
5903 /* theora is in flux, make sure that all interface routines and
5904 * datatypes exist and work the way we expect it, so we don't break
5905 * mplayer */
5906 ogg_packet op;
5907 theora_comment tc;
5908 theora_info inf;
5909 theora_state st;
5910 yuv_buffer yuv;
5911 int r;
5912 double t;
5914 theora_info_init (&inf);
5915 theora_comment_init (&tc);
5917 return 0;
5919 /* we don't want to execute this kind of nonsense; just for making sure
5920 * that compilation works... */
5921 memset(&op, 0, sizeof(op));
5922 r = theora_decode_header (&inf, &tc, &op);
5923 r = theora_decode_init (&st, &inf);
5924 t = theora_granule_time (&st, op.granulepos);
5925 r = theora_decode_packetin (&st, &op);
5926 r = theora_decode_YUVout (&st, &yuv);
5927 theora_clear (&st);
5929 return 0;
5932 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5933 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5934 && _theora=yes && break
5935 done
5936 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5937 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5938 cc_check -I. tremor/bitwise.c $_ld_theora \
5939 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5940 done
5943 if test "$_theora" = yes ; then
5944 _def_theora='#define HAVE_OGGTHEORA 1'
5945 _codecmodules="libtheora $_codecmodules"
5946 # when --enable-theora is forced, we'd better provide a probably sane
5947 # $_ld_theora than nothing
5948 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5949 else
5950 _def_theora='#undef HAVE_OGGTHEORA'
5951 _nocodecmodules="libtheora $_nocodecmodules"
5953 echores "$_theora"
5955 echocheck "internal mp3lib support"
5956 if test "$_mp3lib" = yes ; then
5957 _def_mp3lib='#define USE_MP3LIB 1'
5958 _codecmodules="mp3lib $_codecmodules"
5959 else
5960 _def_mp3lib='#undef USE_MP3LIB'
5961 _nocodecmodules="mp3lib $_nocodecmodules"
5963 echores "$_mp3lib"
5965 echocheck "internal liba52 support"
5966 if test "$_liba52" = yes ; then
5967 _def_liba52='#define USE_LIBA52 1'
5968 _codecmodules="liba52 $_codecmodules"
5969 else
5970 _def_liba52='#undef USE_LIBA52'
5971 _nocodecmodules="liba52 $_nocodecmodules"
5973 echores "$_liba52"
5975 echocheck "libdca support"
5976 if test "$_libdca" = auto ; then
5977 _libdca=no
5978 cat > $TMPC << EOF
5979 #include <inttypes.h>
5980 #include <dts.h>
5981 int main(void) { dts_init (0); return 0; }
5983 for _ld_dca in -ldts -ldca ; do
5984 cc_check $_ld_dca $_ld_lm && _ld_extra="$_ld_extra $_ld_dca" \
5985 && _libdca=yes && break
5986 done
5988 if test "$_libdca" = yes ; then
5989 _def_libdca='#define USE_LIBDCA 1'
5990 _codecmodules="libdca $_codecmodules"
5991 else
5992 _def_libdca='#undef USE_LIBDCA'
5993 _nocodecmodules="libdca $_nocodecmodules"
5995 echores "$_libdca"
5997 echocheck "internal libmpeg2 support"
5998 if test "$_libmpeg2" = yes ; then
5999 _def_libmpeg2='#define USE_LIBMPEG2 1'
6000 _codecmodules="libmpeg2 $_codecmodules"
6001 else
6002 _def_libmpeg2='#undef USE_LIBMPEG2'
6003 _nocodecmodules="libmpeg2 $_nocodecmodules"
6005 echores "$_libmpeg2"
6007 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6008 if test "$_musepack" = auto ; then
6009 _musepack=no
6010 cat > $TMPC << EOF
6011 #include <mpcdec/mpcdec.h>
6012 int main(void) {
6013 mpc_streaminfo info;
6014 mpc_decoder decoder;
6015 mpc_decoder_set_streaminfo(&decoder, &info);
6016 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6019 cc_check -lmpcdec $_ld_lm && _musepack=yes
6021 if test "$_musepack" = yes ; then
6022 _def_musepack='#define HAVE_MUSEPACK 1'
6023 _ld_extra="$_ld_extra -lmpcdec"
6024 _codecmodules="musepack $_codecmodules"
6025 else
6026 _def_musepack='#undef HAVE_MUSEPACK'
6027 _nocodecmodules="musepack $_nocodecmodules"
6029 echores "$_musepack"
6032 echocheck "FAAC (AAC encoder) support"
6033 if test "$_faac" = auto ; then
6034 cat > $TMPC <<EOF
6035 #include <inttypes.h>
6036 #include <faac.h>
6037 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6039 _faac=no
6040 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6041 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6042 done
6044 if test "$_faac" = yes ; then
6045 _def_faac="#define HAVE_FAAC 1"
6046 if echo $_libavencoders | grep -q FAAC ; then
6047 _lavc_faac=yes
6048 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
6049 _libs_mplayer="$_libs_mplayer $_ld_faac"
6050 else
6051 _lavc_faac=no
6052 _def_lavc_faac="#undef CONFIG_LIBFAAC"
6054 _codecmodules="faac $_codecmodules"
6055 else
6056 _def_faac="#undef HAVE_FAAC"
6057 _nocodecmodules="faac $_nocodecmodules"
6058 _libavencoders=`echo $_libavencoders | sed -e s/LIBFAAC_ENCODER// `
6060 echores "$_faac (in libavcodec: $_lavc_faac)"
6063 echocheck "FAAD2 (AAC) support"
6064 if test "$_faad_internal" = auto ; then
6065 if x86_32 && test cc_vendor=gnu; then
6066 case $cc_version in
6067 3.1*|3.2) # ICE/insn with these versions
6068 _faad_internal=no
6069 _res_comment="broken gcc"
6072 _faad_internal=yes
6074 esac
6075 else
6076 _faad_internal=yes
6078 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6079 _faad_external=no
6080 cat > $TMPC << EOF
6081 #include <faad.h>
6082 #ifndef FAAD_MIN_STREAMSIZE
6083 #error Too old version
6084 #endif
6085 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6087 cc_check -lfaad $_ld_lm && _faad_external=yes
6090 if test "$_faad_internal" = yes ; then
6091 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6092 _faad=yes
6093 _res_comment="internal floating-point"
6094 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
6095 elif test "$_faad_external" = yes ; then
6096 _faad=yes
6097 _ld_extra="$_ld_extra -lfaad"
6098 else
6099 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6100 _faad=no
6103 if test "$_faad" = yes ; then
6104 _def_faad='#define HAVE_FAAD 1'
6105 _codecmodules="faad2 $_codecmodules"
6106 else
6107 _def_faad='#undef HAVE_FAAD'
6108 _nocodecmodules="faad2 $_nocodecmodules"
6110 echores "$_faad"
6113 echocheck "LADSPA plugin support"
6114 if test "$_ladspa" = auto ; then
6115 cat > $TMPC <<EOF
6116 #include <stdio.h>
6117 #include <ladspa.h>
6118 int main(void) {
6119 const LADSPA_Descriptor *ld = NULL;
6120 return 0;
6123 _ladspa=no
6124 cc_check && _ladspa=yes
6126 if test "$_ladspa" = yes; then
6127 _def_ladspa="#define HAVE_LADSPA"
6128 _afsrc="$_afsrc af_ladspa.c"
6129 _afmodules="ladspa $_afmodules"
6130 else
6131 _def_ladspa="#undef HAVE_LADSPA"
6132 _noafmodules="ladspa $_noafmodules"
6134 echores "$_ladspa"
6137 if test -z "$_codecsdir" ; then
6138 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6139 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6140 if test -d "$dir" ; then
6141 _codecsdir="$dir"
6142 break;
6144 done
6146 # Fall back on default directory.
6147 if test -z "$_codecsdir" ; then
6148 _codecsdir="$_libdir/codecs"
6149 mingw32 && _codecsdir="codecs"
6153 echocheck "Win32 codecs"
6154 if test "$_win32dll" = auto ; then
6155 _win32dll=no
6156 if x86_32 && ! qnx; then
6157 _win32dll=yes
6160 if test "$_win32dll" = yes ; then
6161 _def_win32dll='#define USE_WIN32DLL 1'
6162 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6163 _res_comment="using $_win32codecsdir"
6164 if ! win32 ; then
6165 _def_win32_loader='#define WIN32_LOADER 1'
6166 else
6167 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6168 _res_comment="using native windows"
6170 _codecmodules="win32 $_codecmodules"
6171 else
6172 _def_win32dll='#undef USE_WIN32DLL'
6173 _def_win32_loader='#undef WIN32_LOADER'
6174 _nocodecmodules="win32 $_nocodecmodules"
6176 echores "$_win32dll"
6179 echocheck "XAnim codecs"
6180 if test "$_xanim" = auto ; then
6181 _xanim=no
6182 _res_comment="dynamic loader support needed"
6183 if test "$_dl" = yes ; then
6184 _xanim=yes
6187 if test "$_xanim" = yes ; then
6188 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6189 _def_xanim='#define USE_XANIM 1'
6190 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6191 _codecmodules="xanim $_codecmodules"
6192 _res_comment="using $_xanimcodecsdir"
6193 else
6194 _def_xanim='#undef USE_XANIM'
6195 _def_xanim_path='#undef XACODEC_PATH'
6196 _nocodecmodules="xanim $_nocodecmodules"
6198 echores "$_xanim"
6201 echocheck "RealPlayer codecs"
6202 if test "$_real" = auto ; then
6203 _real=no
6204 _res_comment="dynamic loader support needed"
6205 if test "$_dl" = yes || test "$_win32dll" = yes &&
6206 (linux || freebsd || netbsd || win32 || darwin) ; then
6207 _real=yes
6210 if test "$_real" = yes ; then
6211 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6212 _def_real='#define USE_REALCODECS 1'
6213 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6214 _codecmodules="real $_codecmodules"
6215 _res_comment="using $_realcodecsdir"
6216 else
6217 _def_real='#undef USE_REALCODECS'
6218 _def_real_path="#undef REALCODEC_PATH"
6219 _nocodecmodules="real $_nocodecmodules"
6221 echores "$_real"
6224 echocheck "QuickTime codecs"
6225 if test "$_qtx" = auto ; then
6226 test "$_win32dll" = yes || darwin && _qtx=yes
6228 if test "$_qtx" = yes ; then
6229 _def_qtx='#define USE_QTX_CODECS 1'
6230 _codecmodules="qtx $_codecmodules"
6231 else
6232 _def_qtx='#undef USE_QTX_CODECS'
6233 _nocodecmodules="qtx $_nocodecmodules"
6235 echores "$_qtx"
6237 echocheck "Nemesi Streaming Media libraries"
6238 if test "$_nemesi" = auto && test "$_network" = yes ; then
6239 _nemesi=no
6240 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6241 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6242 _nemesi=yes
6245 if test "$_nemesi" = yes; then
6246 _native_rtsp=no
6247 _def_nemesi='#define LIBNEMESI 1'
6248 _inputmodules="nemesi $_inputmodules"
6249 else
6250 _native_rtsp="$_network"
6251 _nemesi=no
6252 _def_nemesi='#undef LIBNEMESI'
6253 _noinputmodules="nemesi $_noinputmodules"
6255 echores "$_nemesi"
6257 echocheck "LIVE555 Streaming Media libraries"
6258 if test "$_live" = auto && test "$_network" = yes ; then
6259 cat > $TMPCPP << EOF
6260 #include <liveMedia.hh>
6261 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6262 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6263 #endif
6264 int main(void) {}
6267 _live=no
6268 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6269 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6270 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6271 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6272 $_livelibdir/groupsock/libgroupsock.a \
6273 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6274 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6275 $_ld_extra -lstdc++" \
6276 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6277 -I$_livelibdir/UsageEnvironment/include \
6278 -I$_livelibdir/BasicUsageEnvironment/include \
6279 -I$_livelibdir/groupsock/include" && \
6280 _live=yes && break
6281 done
6282 if test "$_live" != yes ; then
6283 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6284 _live_dist=yes
6288 if test "$_live" = yes && test "$_network" = yes; then
6289 _res_comment="using $_livelibdir"
6290 _def_live='#define STREAMING_LIVE555 1'
6291 _inputmodules="live555 $_inputmodules"
6292 elif test "$_live_dist" = yes && test "$_network" = yes; then
6293 _res_comment="using distribution version"
6294 _live="yes"
6295 _def_live='#define STREAMING_LIVE555 1'
6296 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6297 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6298 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6299 _inputmodules="live555 $_inputmodules"
6300 else
6301 _live=no
6302 _def_live='#undef STREAMING_LIVE555'
6303 _noinputmodules="live555 $_noinputmodules"
6305 echores "$_live"
6308 echocheck "FFmpeg libavutil"
6309 if test "$_libavutil_a" = auto ; then
6310 if test -d libavutil ; then
6311 _libavutil_a=yes
6312 _res_comment="static"
6313 else
6314 die "MPlayer will not compile without libavutil in the source tree."
6316 elif test "$_libavutil_so" = auto ; then
6317 _libavutil_so=no
6318 cat > $TMPC << EOF
6319 #include <ffmpeg/common.h>
6320 int main(void) { ff_gcd(1,1); return 0; }
6322 if $_pkg_config --exists libavutil ; then
6323 _inc_libavutil=`$_pkg_config --cflags libavutil`
6324 _ld_tmp=`$_pkg_config --libs libavutil`
6325 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6326 && _libavutil_so=yes
6327 elif cc_check -lavutil $_ld_lm ; then
6328 _ld_extra="$_ld_extra -lavutil"
6329 _libavutil_so=yes
6330 _res_comment="using libavutil.so, but static libavutil is recommended"
6333 _libavutil=no
6334 _def_libavutil='#undef USE_LIBAVUTIL'
6335 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6336 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6337 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6338 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6339 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6340 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6341 # neither static nor shared libavutil is available, but it is mandatory ...
6342 if test "$_libavutil" = no ; then
6343 die "You need static or shared libavutil, MPlayer will not compile without!"
6345 echores "$_libavutil"
6347 echocheck "FFmpeg libavcodec"
6348 if test "$_libavcodec_a" = auto ; then
6349 _libavcodec_a=no
6350 if test -d libavcodec && test -f libavcodec/utils.c ; then
6351 _libavcodec_a="yes"
6352 _res_comment="static"
6354 elif test "$_libavcodec_so" = auto ; then
6355 _libavcodec_so=no
6356 _res_comment="libavcodec.so is discouraged over static libavcodec"
6357 cat > $TMPC << EOF
6358 #include <ffmpeg/avcodec.h>
6359 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6361 if $_pkg_config --exists libavcodec ; then
6362 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6363 _ld_tmp=`$_pkg_config --libs libavcodec`
6364 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6365 && _libavcodec_so=yes
6366 elif cc_check -lavcodec $_ld_lm ; then
6367 _ld_extra="$_ld_extra -lavcodec"
6368 _libavcodec_so=yes
6369 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6372 _libavcodec=no
6373 _def_libavcodec='#undef USE_LIBAVCODEC'
6374 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6375 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6376 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6377 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6378 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6379 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6380 test "$_libavcodec_mpegaudio_hp" = yes \
6381 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6382 if test "$_libavcodec_a" = yes ; then
6383 _codecmodules="libavcodec $_codecmodules"
6384 elif test "$_libavcodec_so" = yes ; then
6385 _codecmodules="libavcodec.so $_codecmodules"
6386 else
6387 _nocodecmodules="libavcodec $_nocodecmodules"
6389 echores "$_libavcodec"
6391 echocheck "FFmpeg libavformat"
6392 if test "$_libavformat_a" = auto ; then
6393 _libavformat_a=no
6394 if test -d libavformat && test -f libavformat/utils.c ; then
6395 _libavformat_a=yes
6396 _res_comment="static"
6398 elif test "$_libavformat_so" = auto ; then
6399 _libavformat_so=no
6400 cat > $TMPC <<EOF
6401 #include <ffmpeg/avformat.h>
6402 #include <ffmpeg/opt.h>
6403 int main(void) { av_alloc_format_context(); return 0; }
6405 if $_pkg_config --exists libavformat ; then
6406 _inc_libavformat=`$_pkg_config --cflags libavformat`
6407 _ld_tmp=`$_pkg_config --libs libavformat`
6408 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6409 && _libavformat_so=yes
6410 elif cc_check $_ld_lm -lavformat ; then
6411 _ld_extra="$_ld_extra -lavformat"
6412 _libavformat_so=yes
6413 _res_comment="using libavformat.so, but static libavformat is recommended"
6416 _libavformat=no
6417 _def_libavformat='#undef USE_LIBAVFORMAT'
6418 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6419 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6420 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6421 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6422 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6423 test "$_libavformat_so" = yes \
6424 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6425 echores "$_libavformat"
6427 echocheck "FFmpeg libpostproc"
6428 if test "$_libpostproc_a" = auto ; then
6429 _libpostproc_a=no
6430 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6431 _libpostproc_a='yes'
6432 _res_comment="static"
6434 elif test "$_libpostproc_so" = auto ; then
6435 _libpostproc_so=no
6436 cat > $TMPC << EOF
6437 #define USE_LIBPOSTPROC 1
6438 #include <inttypes.h>
6439 #include <postproc/postprocess.h>
6440 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6442 if cc_check -lpostproc $_ld_lm ; then
6443 _ld_extra="$_ld_extra -lpostproc"
6444 _libpostproc_so=yes
6445 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6448 _libpostproc=no
6449 _def_libpostproc='#undef USE_LIBPOSTPROC'
6450 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6451 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6452 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6453 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6454 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6455 test "$_libpostproc_so" = yes \
6456 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6457 echores "$_libpostproc"
6460 echocheck "libamr narrowband"
6461 if test "$_libamr_nb" = auto ; then
6462 _libamr_nb=no
6463 cat > $TMPC << EOF
6464 #include <amrnb/interf_dec.h>
6465 int main(void) { Speech_Decode_Frame_init(); return 0; }
6467 cc_check -lamrnb && _libamr_nb=yes
6468 if test "$_libavcodec_a" != yes ; then
6469 _libamr_nb=no
6470 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6473 if test "$_libamr_nb" = yes ; then
6474 _libamr=yes
6475 _ld_extra="$_ld_extra -lamrnb"
6476 _def_libamr='#define CONFIG_LIBAMR 1'
6477 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6478 _codecmodules="libamr_nb $_codecmodules"
6479 else
6480 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6481 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6482 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6483 _nocodecmodules="libamr_nb $_nocodecmodules"
6485 echores "$_libamr_nb"
6488 echocheck "libamr wideband"
6489 if test "$_libamr_wb" = auto ; then
6490 _libamr_wb=no
6491 cat > $TMPC << EOF
6492 #include <amrwb/dec_if.h>
6493 int main(void) { D_IF_init(); return 0; }
6495 cc_check -lamrwb && _libamr_wb=yes
6496 if test "$_libavcodec_a" != yes ; then
6497 _libamr_wb=no
6498 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6501 if test "$_libamr_wb" = yes ; then
6502 _libamr=yes
6503 _ld_extra="$_ld_extra -lamrwb"
6504 _def_libamr='#define CONFIG_LIBAMR 1'
6505 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6506 _codecmodules="libamr_wb $_codecmodules"
6507 else
6508 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6509 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6510 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6511 _nocodecmodules="libamr_wb $_nocodecmodules"
6513 echores "$_libamr_wb"
6515 echocheck "libdv-0.9.5+"
6516 if test "$_libdv" = auto ; then
6517 _libdv=no
6518 cat > $TMPC <<EOF
6519 #include <libdv/dv.h>
6520 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6522 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6524 if test "$_libdv" = yes ; then
6525 _def_libdv='#define HAVE_LIBDV095 1'
6526 _ld_extra="$_ld_extra -ldv"
6527 _codecmodules="libdv $_codecmodules"
6528 else
6529 _def_libdv='#undef HAVE_LIBDV095'
6530 _nocodecmodules="libdv $_nocodecmodules"
6532 echores "$_libdv"
6535 echocheck "XviD"
6536 if test "$_xvid" = auto ; then
6537 _xvid=no
6538 cat > $TMPC << EOF
6539 #include <xvid.h>
6540 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6542 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6543 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6544 done
6547 if test "$_xvid" = yes ; then
6548 _def_xvid='#define HAVE_XVID4 1'
6549 _codecmodules="xvid $_codecmodules"
6550 else
6551 _def_xvid='#undef HAVE_XVID4'
6552 _nocodecmodules="xvid $_nocodecmodules"
6553 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6555 echores "$_xvid"
6557 if test "$_xvid" = yes ; then
6558 echocheck "XviD two pass plugin"
6559 cat > $TMPC << EOF
6560 #include <xvid.h>
6561 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6563 if cc_check ; then
6564 _lavc_xvid=yes
6565 _def_lavc_xvid='#define CONFIG_LIBXVID 1'
6566 else
6567 _lavc_xvid=no
6568 _def_lavc_xvid='#undef CONFIG_LIBXVID'
6569 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6571 echores "$_lavc_xvid"
6575 echocheck "x264"
6576 if test "$_x264" = auto ; then
6577 cat > $TMPC << EOF
6578 #include <inttypes.h>
6579 #include <x264.h>
6580 #if X264_BUILD < 53
6581 #error We do not support old versions of x264. Get the latest from SVN.
6582 #endif
6583 int main(void) { x264_encoder_open((void*)0); return 0; }
6585 _x264=no
6586 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6587 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6588 done
6591 if test "$_x264" = yes ; then
6592 _def_x264='#define HAVE_X264 1'
6593 _codecmodules="x264 $_codecmodules"
6594 if echo $_libavencoders | grep -q X264 ; then
6595 _lavc_x264=yes
6596 _def_lavc_x264='#define CONFIG_LIBX264 1'
6597 _libs_mplayer="$_libs_mplayer $_ld_x264"
6598 else
6599 _lavc_x264=no
6600 _def_lavc_x264='#undef CONFIG_LIBX264'
6602 else
6603 _lavc_x264=no
6604 _def_x264='#undef HAVE_X264'
6605 _def_lavc_x264='#undef CONFIG_LIBX264'
6606 _nocodecmodules="x264 $_nocodecmodules"
6607 _libavencoders=`echo $_libavencoders | sed -e s/LIBX264_ENCODER// `
6609 echores "$_x264 (in libavcodec: $_lavc_x264)"
6612 echocheck "libnut"
6613 if test "$_libnut" = auto ; then
6614 cat > $TMPC << EOF
6615 #include <stdio.h>
6616 #include <stdlib.h>
6617 #include <inttypes.h>
6618 #include <libnut.h>
6619 int main(void) { (void)nut_error(0); return 0; }
6621 _libnut=no
6622 cc_check -lnut && _libnut=yes
6625 if test "$_libnut" = yes ; then
6626 _def_libnut='#define HAVE_LIBNUT 1'
6627 _ld_extra="$_ld_extra -lnut"
6628 else
6629 _def_libnut='#undef HAVE_LIBNUT'
6630 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6632 echores "$_libnut"
6635 # mencoder requires (optional) those libs: libmp3lame
6636 if test "$_mencoder" != no ; then
6638 echocheck "libmp3lame (for mencoder)"
6639 _mp3lame=no
6640 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6641 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6642 cat > $TMPC <<EOF
6643 #include <lame/lame.h>
6644 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; }
6646 # Note: libmp3lame usually depends on vorbis
6647 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6648 if test "$_mp3lame" = yes ; then
6649 _def_mp3lame="#define HAVE_MP3LAME"
6650 _ld_mp3lame=-lmp3lame
6651 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6652 cat > $TMPC << EOF
6653 #include <lame/lame.h>
6654 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6656 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6657 cat > $TMPC << EOF
6658 #include <lame/lame.h>
6659 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6661 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6662 if echo $_libavencoders | grep -q MP3LAME ; then
6663 _lavc_mp3lame=yes
6664 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6665 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6666 else
6667 _lavc_mp3lame=no
6668 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6670 else
6671 _def_mp3lame='#undef HAVE_MP3LAME'
6672 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6674 echores "$_mp3lame"
6678 echocheck "mencoder"
6679 _mencoder_flag='#undef HAVE_MENCODER'
6680 if test "$_mencoder" = yes ; then
6681 _mencoder_flag='#define HAVE_MENCODER'
6682 _def_muxers='#define CONFIG_MUXERS 1'
6683 else
6684 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6685 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6686 _libavmuxers=""
6688 echores "$_mencoder"
6690 echocheck "fastmemcpy"
6691 # fastmemcpy check is done earlier with tests of CPU & binutils features
6692 if test "$_fastmemcpy" = yes ; then
6693 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6694 else
6695 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6697 echores "$_fastmemcpy"
6699 echocheck "UniquE RAR File Library"
6700 if test "$_unrarlib" = yes ; then
6701 _def_unrarlib='#define USE_UNRARLIB 1'
6702 else
6703 _def_unrarlib='#undef USE_UNRARLIB'
6705 echores "$_unrarlib"
6707 echocheck "TV interface"
6708 if test "$_tv" = yes ; then
6709 _def_tv='#define USE_TV 1'
6710 _inputmodules="tv $_inputmodules"
6711 else
6712 _noinputmodules="tv $_noinputmodules"
6713 _def_tv='#undef USE_TV'
6715 echores "$_tv"
6718 if bsd; then
6719 echocheck "*BSD BT848 bt8xx header"
6720 _ioctl_bt848_h=no
6721 for file in "machine/ioctl_bt848.h" \
6722 "dev/bktr/ioctl_bt848.h" \
6723 "dev/video/bktr/ioctl_bt848.h" \
6724 "dev/ic/bt8xx.h" ; do
6725 cat > $TMPC <<EOF
6726 #include <sys/types.h>
6727 #include <sys/ioctl.h>
6728 #include <$file>
6729 int main(void) {
6730 ioctl(0, TVTUNER_GETFREQ, 0);
6731 return 0;
6734 if cc_check ; then
6735 _ioctl_bt848_h=yes
6736 _ioctl_bt848_h_name="$file"
6737 break;
6739 done
6740 if test "$_ioctl_bt848_h" = yes ; then
6741 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6742 _res_comment="using $_ioctl_bt848_h_name"
6743 else
6744 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6746 echores "$_ioctl_bt848_h"
6748 echocheck "*BSD ioctl_meteor.h"
6749 _ioctl_meteor_h=no
6750 for file in "machine/ioctl_meteor.h" \
6751 "dev/bktr/ioctl_meteor.h" \
6752 "dev/video/bktr/ioctl_meteor.h" ; do
6753 cat > $TMPC <<EOF
6754 #include <sys/types.h>
6755 #include <$file>
6756 int main(void) {
6757 ioctl(0, METEORSINPUT, 0);
6758 return 0;
6761 if cc_check ; then
6762 _ioctl_meteor_h=yes
6763 _ioctl_meteor_h_name="$file"
6764 break;
6766 done
6767 if test "$_ioctl_meteor_h" = yes ; then
6768 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6769 _res_comment="using $_ioctl_meteor_h_name"
6770 else
6771 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6773 echores "$_ioctl_meteor_h"
6775 echocheck "*BSD BrookTree 848 TV interface"
6776 if test "$_tv_bsdbt848" = auto ; then
6777 _tv_bsdbt848=no
6778 if test "$_tv" = yes ; then
6779 cat > $TMPC <<EOF
6780 #include <sys/types.h>
6781 $_def_ioctl_meteor_h_name
6782 $_def_ioctl_bt848_h_name
6783 #ifdef IOCTL_METEOR_H_NAME
6784 #include IOCTL_METEOR_H_NAME
6785 #endif
6786 #ifdef IOCTL_BT848_H_NAME
6787 #include IOCTL_BT848_H_NAME
6788 #endif
6789 int main(void){
6790 ioctl(0, METEORSINPUT, 0);
6791 ioctl(0, TVTUNER_GETFREQ, 0);
6792 return 0;
6795 cc_check && _tv_bsdbt848=yes
6798 if test "$_tv_bsdbt848" = yes ; then
6799 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6800 _inputmodules="tv-bsdbt848 $_inputmodules"
6801 else
6802 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6803 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6805 echores "$_tv_bsdbt848"
6806 fi #if bsd
6809 echocheck "DirectShow TV interface"
6810 if test "$_tv_dshow" = auto ; then
6811 _tv_dshow=no
6812 if test "$_tv" = yes && win32 ; then
6813 cat > $TMPC <<EOF
6814 #include <ole2.h>
6815 int main(void) {
6816 void* p;
6817 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6818 return 0;
6821 cc_check -lole32 -luuid && _tv_dshow=yes
6824 if test "$_tv_dshow" = yes ; then
6825 _inputmodules="tv-dshow $_inputmodules"
6826 _def_tv_dshow='#define HAVE_TV_DSHOW 1'
6827 _ld_extra="$_ld_extra -lole32 -luuid"
6828 else
6829 _noinputmodules="tv-dshow $_noinputmodules"
6830 _def_tv_dshow='#undef HAVE_TV_DSHOW'
6832 echores "$_tv_dshow"
6835 echocheck "Video 4 Linux TV interface"
6836 if test "$_tv_v4l1" = auto ; then
6837 _tv_v4l1=no
6838 if test "$_tv" = yes && linux ; then
6839 cat > $TMPC <<EOF
6840 #include <stdlib.h>
6841 #include <linux/videodev.h>
6842 int main(void) { return 0; }
6844 cc_check && _tv_v4l1=yes
6847 if test "$_tv_v4l1" = yes ; then
6848 _audio_input=yes
6849 _tv_v4l=yes
6850 _def_tv_v4l='#define HAVE_TV_V4L 1'
6851 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6852 _inputmodules="tv-v4l $_inputmodules"
6853 else
6854 _noinputmodules="tv-v4l1 $_noinputmodules"
6855 _def_tv_v4l='#undef HAVE_TV_V4L'
6857 echores "$_tv_v4l1"
6860 echocheck "Video 4 Linux 2 TV interface"
6861 if test "$_tv_v4l2" = auto ; then
6862 _tv_v4l2=no
6863 if test "$_tv" = yes && linux ; then
6864 cat > $TMPC <<EOF
6865 #include <stdlib.h>
6866 #include <linux/types.h>
6867 #include <linux/videodev2.h>
6868 int main(void) { return 0; }
6870 cc_check && _tv_v4l2=yes
6873 if test "$_tv_v4l2" = yes ; then
6874 _audio_input=yes
6875 _tv_v4l=yes
6876 _def_tv_v4l='#define HAVE_TV_V4L 1'
6877 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6878 _inputmodules="tv-v4l2 $_inputmodules"
6879 else
6880 _noinputmodules="tv-v4l2 $_noinputmodules"
6881 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6883 echores "$_tv_v4l2"
6886 echocheck "TV teletext interface"
6887 if test "$_tv_teletext" = auto ; then
6888 _tv_teletext=no
6889 if test "$_freetype" = yes && test "$_pthreads" = yes; then
6890 if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes; then
6891 _tv_teletext=yes
6895 if test "$_tv_teletext" = yes ; then
6896 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6897 _inputmodules="tv-teletext $_inputmodules"
6898 else
6899 _noinputmodules="tv-teletext $_noinputmodules"
6900 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6902 echores "$_tv_teletext"
6905 echocheck "Radio interface"
6906 if test "$_radio" = yes ; then
6907 _def_radio='#define USE_RADIO 1'
6908 _inputmodules="radio $_inputmodules"
6909 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6910 _radio_capture=no
6912 if test "$_radio_capture" = yes ; then
6913 _audio_input=yes
6914 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6915 else
6916 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6918 else
6919 _noinputmodules="radio $_noinputmodules"
6920 _def_radio='#undef USE_RADIO'
6921 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6922 _radio_capture=no
6924 echores "$_radio"
6925 echocheck "Capture for Radio interface"
6926 echores "$_radio_capture"
6928 echocheck "Video 4 Linux 2 Radio interface"
6929 if test "$_radio_v4l2" = auto ; then
6930 _radio_v4l2=no
6931 if test "$_radio" = yes && linux ; then
6932 cat > $TMPC <<EOF
6933 #include <stdlib.h>
6934 #include <linux/types.h>
6935 #include <linux/videodev2.h>
6936 int main(void) { return 0; }
6938 cc_check && _radio_v4l2=yes
6941 if test "$_radio_v4l2" = yes ; then
6942 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6943 else
6944 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6946 echores "$_radio_v4l2"
6948 echocheck "Video 4 Linux Radio interface"
6949 if test "$_radio_v4l" = auto ; then
6950 _radio_v4l=no
6951 if test "$_radio" = yes && linux ; then
6952 cat > $TMPC <<EOF
6953 #include <stdlib.h>
6954 #include <linux/videodev.h>
6955 int main(void) { return 0; }
6957 cc_check && _radio_v4l=yes
6960 if test "$_radio_v4l" = yes ; then
6961 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6962 else
6963 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6965 echores "$_radio_v4l"
6967 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6968 echocheck "*BSD BrookTree 848 Radio interface"
6969 _radio_bsdbt848=no
6970 cat > $TMPC <<EOF
6971 #include <sys/types.h>
6972 $_def_ioctl_bt848_h_name
6973 #ifdef IOCTL_BT848_H_NAME
6974 #include IOCTL_BT848_H_NAME
6975 #endif
6976 int main(void){
6977 ioctl(0, RADIO_GETFREQ, 0);
6978 return 0;
6981 cc_check && _radio_bsdbt848=yes
6982 echores "$_radio_bsdbt848"
6983 fi #if bsd && radio && radio_bsdbt848
6985 if test "$_radio_bsdbt848" = yes ; then
6986 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
6987 else
6988 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
6991 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6992 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6993 die "Radio driver requires BSD BT848, V4L or V4L2!"
6996 echocheck "Video 4 Linux 2 MPEG PVR interface"
6997 if test "$_pvr" = auto ; then
6998 _pvr=no
6999 if test "$_tv_v4l2" = yes && linux ; then
7000 cat > $TMPC <<EOF
7001 #include <stdlib.h>
7002 #include <inttypes.h>
7003 #include <linux/types.h>
7004 #include <linux/videodev2.h>
7005 int main(void) { struct v4l2_ext_controls ext; return 0; }
7007 cc_check && _pvr=yes
7010 if test "$_pvr" = yes ; then
7011 _def_pvr='#define HAVE_PVR 1'
7012 _inputmodules="pvr $_inputmodules"
7013 else
7014 _noinputmodules="pvr $_noinputmodules"
7015 _def_pvr='#undef HAVE_PVR'
7017 echores "$_pvr"
7020 echocheck "audio select()"
7021 if test "$_select" = no ; then
7022 _def_select='#undef HAVE_AUDIO_SELECT'
7023 elif test "$_select" = yes ; then
7024 _def_select='#define HAVE_AUDIO_SELECT 1'
7026 echores "$_select"
7029 echocheck "ftp"
7030 if ! beos && test "$_ftp" = yes ; then
7031 _def_ftp='#define HAVE_FTP 1'
7032 _inputmodules="ftp $_inputmodules"
7033 else
7034 _noinputmodules="ftp $_noinputmodules"
7035 _def_ftp='#undef HAVE_FTP'
7037 echores "$_ftp"
7039 echocheck "vstream client"
7040 if test "$_vstream" = auto ; then
7041 _vstream=no
7042 cat > $TMPC <<EOF
7043 #include <vstream-client.h>
7044 void vstream_error(const char *format, ... ) {}
7045 int main(void) { vstream_start(); return 0; }
7047 cc_check -lvstream-client && _vstream=yes
7049 if test "$_vstream" = yes ; then
7050 _def_vstream='#define HAVE_VSTREAM 1'
7051 _inputmodules="vstream $_inputmodules"
7052 _ld_extra="$_ld_extra -lvstream-client"
7053 else
7054 _noinputmodules="vstream $_noinputmodules"
7055 _def_vstream='#undef HAVE_VSTREAM'
7057 echores "$_vstream"
7059 # endian testing
7060 echocheck "byte order"
7061 if test "$_big_endian" = auto ; then
7062 cat > $TMPC <<EOF
7063 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7064 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7065 int main(void){
7066 return (int)ascii_name;
7069 if cc_check ; then
7070 if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
7071 _big_endian=yes
7072 else
7073 _big_endian=no
7075 else
7076 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7079 if test "$_big_endian" = yes ; then
7080 _byte_order='big-endian'
7081 _def_words_endian='#define WORDS_BIGENDIAN 1'
7082 else
7083 _byte_order='little-endian'
7084 _def_words_endian='#undef WORDS_BIGENDIAN'
7086 echores "$_byte_order"
7088 echocheck "OSD menu"
7089 if test "$_menu" = yes ; then
7090 _def_menu='#define HAVE_MENU 1'
7091 else
7092 _def_menu='#undef HAVE_MENU'
7094 echores "$_menu"
7097 echocheck "Subtitles sorting"
7098 if test "$_sortsub" = yes ; then
7099 _def_sortsub='#define USE_SORTSUB 1'
7100 else
7101 _def_sortsub='#undef USE_SORTSUB'
7103 echores "$_sortsub"
7106 echocheck "XMMS inputplugin support"
7107 if test "$_xmms" = yes ; then
7108 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7109 _xmmsplugindir=`xmms-config --input-plugin-dir`
7110 _xmmslibdir=`xmms-config --exec-prefix`/lib
7111 else
7112 _xmmsplugindir=/usr/lib/xmms/Input
7113 _xmmslibdir=/usr/lib
7116 _def_xmms='#define HAVE_XMMS 1'
7117 if darwin ; then
7118 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7119 else
7120 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7122 else
7123 _def_xmms='#undef HAVE_XMMS'
7125 echores "$_xmms"
7127 echocheck "inet6"
7128 if test "$_inet6" = auto ; then
7129 cat > $TMPC << EOF
7130 #include <sys/types.h>
7131 #if !defined(_WIN32) || defined(__CYGWIN__)
7132 #include <sys/socket.h>
7133 #include <netinet/in.h>
7134 #else
7135 #include <ws2tcpip.h>
7136 #endif
7137 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7139 _inet6=no
7140 if cc_check $_ld_sock ; then
7141 _inet6=yes
7144 if test "$_inet6" = yes ; then
7145 _def_inet6='#define HAVE_AF_INET6 1'
7146 else
7147 _def_inet6='#undef HAVE_AF_INET6'
7149 echores "$_inet6"
7152 echocheck "gethostbyname2"
7153 if test "$_gethostbyname2" = auto ; then
7154 cat > $TMPC << EOF
7155 #include <sys/types.h>
7156 #include <sys/socket.h>
7157 #include <netdb.h>
7158 int main(void) { gethostbyname2("", AF_INET); }
7160 _gethostbyname2=no
7161 if cc_check ; then
7162 _gethostbyname2=yes
7166 if test "$_gethostbyname2" = yes ; then
7167 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7168 else
7169 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7171 echores "$_gethostbyname2"
7174 # --------------- GUI specific tests begin -------------------
7175 echocheck "GUI"
7176 echo "$_gui"
7177 if test "$_gui" = yes ; then
7179 # Required libraries
7180 if test "$_libavcodec" != yes ||
7181 ! echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1 ; then
7182 die "The GUI requires libavcodec with PNG support (needs zlib)."
7184 if ! win32 ; then
7185 test "$_x11" != yes && die "X11 support required for GUI compilation."
7187 echocheck "XShape extension"
7188 if test "$_xshape" = auto ; then
7189 _xshape=no
7190 cat > $TMPC << EOF
7191 #include <X11/Xlib.h>
7192 #include <X11/Xproto.h>
7193 #include <X11/Xutil.h>
7194 #include <X11/extensions/shape.h>
7195 #include <stdlib.h>
7196 int main(void) {
7197 char *name = ":0.0";
7198 Display *wsDisplay;
7199 int exitvar = 0;
7200 int eventbase, errorbase;
7201 if (getenv("DISPLAY"))
7202 name=getenv("DISPLAY");
7203 wsDisplay=XOpenDisplay(name);
7204 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7205 exitvar=1;
7206 XCloseDisplay(wsDisplay);
7207 return exitvar;
7210 cc_check -lXext && _xshape=yes
7212 if test "$_xshape" = yes ; then
7213 _def_xshape='#define HAVE_XSHAPE 1'
7214 else
7215 die "The GUI requires the X11 extension XShape (which was not found)."
7217 echores "$_xshape"
7219 #Check for GTK
7220 if test "$_gtk1" = no ; then
7221 #Check for GTK2 :
7222 echocheck "GTK+ version"
7224 if $_pkg_config gtk+-2.0 --exists ; then
7225 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7226 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7227 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7228 echores "$_gtk"
7230 # Check for GLIB2
7231 if $_pkg_config glib-2.0 --exists ; then
7232 echocheck "glib version"
7233 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7234 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7235 echores "$_glib"
7237 _def_gui='#define HAVE_NEW_GUI 1'
7238 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7239 else
7240 _gtk1=yes
7241 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7243 else
7244 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7245 _gtk1=yes
7249 if test "$_gtk1" = yes ; then
7250 # Check for old GTK (1.2.x)
7251 echocheck "GTK version"
7252 if test -z "$_gtkconfig" ; then
7253 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7254 _gtkconfig="gtk-config"
7255 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7256 _gtkconfig="gtk12-config"
7257 else
7258 die "The GUI requires GTK devel packages (which were not found)."
7261 _gtk=`$_gtkconfig --version 2>&1`
7262 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7263 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7264 echores "$_gtk (using $_gtkconfig)"
7266 # Check for GLIB
7267 echocheck "glib version"
7268 if test -z "$_glibconfig" ; then
7269 if ( glib-config --version ) >/dev/null 2>&1 ; then
7270 _glibconfig="glib-config"
7271 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7272 _glibconfig="glib12-config"
7273 else
7274 die "The GUI requires GLIB devel packages (which were not found)"
7277 _glib=`$_glibconfig --version 2>&1`
7278 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7279 echores "$_glib (using $_glibconfig)"
7281 _def_gui='#define HAVE_NEW_GUI 1'
7282 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7285 else #if ! win32
7286 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7287 _def_gui='#define HAVE_NEW_GUI 1'
7288 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7289 fi #if ! win32
7291 else #if test "$_gui"
7292 _def_gui='#undef HAVE_NEW_GUI'
7293 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7294 fi #if test "$_gui"
7295 # --------------- GUI specific tests end -------------------
7298 if test "$_charset" = "noconv" ; then
7299 _charset=""
7301 if test "$_charset" ; then
7302 _def_charset="#define MSG_CHARSET \"$_charset\""
7303 else
7304 _def_charset="#undef MSG_CHARSET"
7307 if test "$_charset" = "UTF-8" ; then
7308 # hack to disable conversion in the Makefile
7309 _charset=""
7312 if test "$_charset" ; then
7313 echocheck "iconv program"
7314 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7315 if test "$?" -ne 0 ; then
7316 echores "no"
7317 echo "No working iconv program found, use "
7318 echo "--charset=UTF-8 to continue anyway."
7319 echo "If you also have problems with iconv library functions use --charset=noconv."
7320 echo "Messages in the GTK-2 interface will be broken then."
7321 exit 1
7322 else
7323 echores "yes"
7327 #############################################################################
7329 echocheck "automatic gdb attach"
7330 if test "$_crash_debug" = yes ; then
7331 _def_crash_debug='#define CRASH_DEBUG 1'
7332 else
7333 _def_crash_debug='#undef CRASH_DEBUG'
7334 _crash_debug=no
7336 echores "$_crash_debug"
7338 echocheck "compiler support for noexecstack"
7339 cat > $TMPC <<EOF
7340 int main(void) { return 0; }
7342 if cc_check -Wl,-z,noexecstack ; then
7343 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7344 echores "yes"
7345 else
7346 echores "no"
7350 # Dynamic linking flags
7351 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7352 _ld_dl_dynamic=''
7353 bsd && _ld_dl_dynamic='-rdynamic'
7354 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin ; then
7355 _ld_dl_dynamic='-rdynamic'
7358 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7359 bsdos && _ld_extra="$_ld_extra -ldvd"
7360 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7361 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7363 _def_debug='#undef MP_DEBUG'
7364 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7366 _def_linux='#undef TARGET_LINUX'
7367 linux && _def_linux='#define TARGET_LINUX 1'
7370 echocheck "joystick"
7371 _def_joystick='#undef HAVE_JOYSTICK'
7372 if test "$_joystick" = yes ; then
7373 if linux ; then
7374 # TODO add some check
7375 _def_joystick='#define HAVE_JOYSTICK 1'
7376 else
7377 _joystick="no (unsupported under $system_name)"
7380 echores "$_joystick"
7382 echocheck "lirc"
7383 if test "$_lirc" = auto ; then
7384 _lirc=no
7385 cat > $TMPC <<EOF
7386 #include <lirc/lirc_client.h>
7387 int main(void) { return 0; }
7389 cc_check -llirc_client && _lirc=yes
7391 if test "$_lirc" = yes ; then
7392 _def_lirc='#define HAVE_LIRC 1'
7393 _ld_extra="$_ld_extra -llirc_client"
7394 else
7395 _def_lirc='#undef HAVE_LIRC'
7397 echores "$_lirc"
7399 echocheck "lircc"
7400 if test "$_lircc" = auto ; then
7401 _lircc=no
7402 cat > $TMPC <<EOF
7403 #include <lirc/lircc.h>
7404 int main(void) { return 0; }
7406 cc_check -llircc && _lircc=yes
7408 if test "$_lircc" = yes ; then
7409 _def_lircc='#define HAVE_LIRCC 1'
7410 _ld_extra="$_ld_extra -llircc"
7411 else
7412 _def_lircc='#undef HAVE_LIRCC'
7414 echores "$_lircc"
7416 if arm; then
7417 # Detect maemo development platform libraries availability (http://www.maemo.org),
7418 # they are used when run on Nokia 770
7419 echocheck "maemo (Nokia 770)"
7420 if test "$_maemo" = auto ; then
7421 _maemo=no
7422 cat > $TMPC << EOF
7423 #include <libosso.h>
7424 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7426 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7428 if test "$_maemo" = yes ; then
7429 _def_maemo='#define HAVE_MAEMO 1'
7430 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7431 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7432 else
7433 _def_maemo='#undef HAVE_MAEMO'
7435 echores "$_maemo"
7438 echocheck "color console output"
7439 if test "$_color_console" = yes ; then
7440 _def_color_console='#define MSG_USE_COLORS 1'
7441 else
7442 _def_color_console='#undef MSG_USE_COLORS'
7444 echores "$_color_console"
7446 # linker paths should be the same for mencoder and mplayer
7447 _ld_tmp=""
7448 for I in $_libs_mplayer ; do
7449 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7450 if test -z "$_tmp" ; then
7451 _ld_extra="$I $_ld_extra"
7452 else
7453 _ld_tmp="$_ld_tmp $I"
7455 done
7456 _libs_mplayer=$_ld_tmp
7459 #############################################################################
7460 if darwin ; then
7461 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -shared-libgcc"
7462 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7463 CFLAGS="$CFLAGS -no-cpp-precomp"
7466 if amigaos ; then
7467 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__ -DSYS_AMIGAOS4"
7469 if hpux ; then
7470 # use flag for HPUX missing setenv()
7471 CFLAGS="$CFLAGS -DHPUX"
7473 # Thread support
7474 if linux ; then
7475 CFLAGS="$CFLAGS -D_REENTRANT"
7476 elif bsd ; then
7477 # FIXME bsd needs this so maybe other OS'es
7478 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7480 if cygwin ; then
7481 CFLAGS="$CFLAGS -D__CYGWIN__"
7483 # 64 bit file offsets?
7484 if test "$_largefiles" = yes || freebsd ; then
7485 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7486 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7487 # dvdread support requires this (for off64_t)
7488 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7489 cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
7493 # Make sure config.h gets included.
7494 if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then
7495 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
7498 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7499 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7501 cat > $TMPC << EOF
7502 int main(void) { return 0; }
7504 if test "$cc_vendor" = "gnu" ; then
7505 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7506 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7507 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7511 #this must be the last test to be performed or the ones following it will likely fail
7512 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7513 # to use its own copy of the library)
7514 echocheck "DVD support (libdvdnav)"
7515 if test "$_dvdnav" = auto ; then
7516 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7518 if test "$_dvdnav" = auto ; then
7519 cat > $TMPC <<EOF
7520 #include <inttypes.h>
7521 #include <dvdnav.h>
7522 int main(void) { dvdnav_t *dvd=0; return 0; }
7524 _dvdnav=no
7525 _dvdnavdir=`$_dvdnavconfig --cflags`
7526 _dvdnavlibs=`$_dvdnavconfig --libs`
7527 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7529 if test "$_dvdnav" = yes ; then
7530 _largefiles=yes
7531 _def_dvdnav='#define USE_DVDNAV 1'
7532 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7533 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7534 _inputmodules="dvdnav $_inputmodules"
7535 else
7536 _def_dvdnav='#undef USE_DVDNAV'
7537 _noinputmodules="dvdnav $_noinputmodules"
7539 echores "$_dvdnav"
7541 #############################################################################
7542 echo "Creating config.mak"
7543 cat > config.mak << EOF
7544 # -------- Generated by configure -----------
7546 LANG = C
7547 MAN_LANG = $MAN_LANG
7548 TARGET_OS = $system_name
7549 DESTDIR =
7550 prefix = \$(DESTDIR)$_prefix
7551 BINDIR = \$(DESTDIR)$_bindir
7552 DATADIR = \$(DESTDIR)$_datadir
7553 MANDIR = \$(DESTDIR)$_mandir
7554 CONFDIR = \$(DESTDIR)$_confdir
7555 LIBDIR = \$(DESTDIR)$_libdir
7556 # FFmpeg uses libdir instead of LIBDIR
7557 libdir = \$(LIBDIR)
7558 AR = $_ar
7559 CC = $_cc
7560 CXX = $_cc
7561 HOST_CC = $_host_cc
7562 RANLIB = $_ranlib
7563 LDCONFIG = $_ldconfig
7564 INSTALL = $_install
7565 EXTRA_INC = $_inc_extra
7566 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7567 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7568 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7569 CFLAG_STACKREALIGN = $_stackrealign
7570 INSTALLSTRIP = $_install_strip
7571 CHARSET = $_charset
7572 HELP_FILE = $_mp_help
7574 EXESUF = $_exesuf
7576 MPLAYER_NETWORK = $_network
7577 FTP = $_ftp
7578 STREAMING_LIVE555 = $_live
7579 LIBNEMESI = $_nemesi
7580 NATIVE_RTSP = $_native_rtsp
7581 VSTREAM = $_vstream
7582 STREAM_CACHE = $_stream_cache
7583 DVBIN = $_dvbin
7584 VIDIX = $_vidix
7585 VIDIX_INTERNAL = $_vidix_internal
7586 VIDIX_EXTERNAL = $_vidix_external
7587 VIDIX_PCIDB = $_vidix_pcidb_val
7588 CONFIG_PP = yes
7589 MP3LAME = $_mp3lame
7590 LIBMENU = $_menu
7592 MP3LIB = $_mp3lib
7593 LIBA52 = $_liba52
7594 LIBMPEG2 = $_libmpeg2
7595 TREMOR_INTERNAL = $_tremor_internal
7596 TREMOR_LOW = $_tremor_low
7597 FAAD = $_faad
7599 SPEEX = $_speex
7600 MUSEPACK = $_musepack
7602 UNRARLIB = $_unrarlib
7603 PNG = $_png
7604 JPEG = $_jpeg
7605 GIF = $_gif
7607 EXTRALIBS = $_extra_libs
7608 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7609 EXTRALIBS_MPLAYER = $_libs_mplayer
7610 EXTRALIBS_MENCODER = $_libs_mencoder
7612 HAVE_MLIB = $_mlib
7613 HAVE_PTHREADS = $_pthreads
7614 HAVE_W32THREADS = $_w32threads
7616 HAVE_XVMC_ACCEL = $_xvmc
7618 HAVE_SYS_MMAN_H = $_mman
7619 HAVE_POSIX_SELECT = $_posix_select
7621 NEED_GETTIMEOFDAY = $_need_gettimeofday
7622 NEED_GLOB = $_need_glob
7623 NEED_SETENV = $_need_setenv
7624 NEED_SHMEM = $_need_shmem
7625 NEED_STRSEP = $_need_strsep
7626 NEED_SWAB = $_need_swab
7627 NEED_VSSCANF = $_need_vsscanf
7629 # for FFmpeg
7630 SRC_PATH=..
7631 BUILD_ROOT=..
7632 LIBPREF=lib
7633 LIBSUF=.a
7634 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7636 # audio output
7637 OSS = $_ossaudio
7638 ALSA = $_alsa
7639 ALSA5 = $_alsa5
7640 ALSA9 = $_alsa9
7641 ALSA1X = $_alsa1x
7643 # input/demuxer/codecs
7644 JOYSTICK = $_joystick
7645 LIRC = $_lirc
7646 APPLE_REMOTE = $_apple_remote
7647 TV = $_tv
7648 TV_V4L = $_tv_v4l
7649 TV_V4L1 = $_tv_v4l1
7650 TV_V4L2 = $_tv_v4l2
7651 TV_DSHOW = $_tv_dshow
7652 TV_BSDBT848 = $_tv_bsdbt848
7653 TV_TELETEXT = $_tv_teletext
7654 AUDIO_INPUT = $_audio_input
7655 PVR = $_pvr
7656 VCD = $_vcd
7657 DVDREAD = $_dvdread
7658 DVDREAD_INTERNAL = $_dvdread_internal
7659 DVDCSS_INTERNAL = $_libdvdcss_internal
7660 DVDNAV = $_dvdnav
7661 WIN32DLL = $_win32dll
7662 QTX_CODECS = $_qtx
7663 REAL_CODECS = $_real
7664 XANIM_CODECS = $_xanim
7665 LIBAVUTIL = $_libavutil
7666 LIBAVUTIL_A = $_libavutil_a
7667 LIBAVUTIL_SO = $_libavutil_so
7668 LIBAVCODEC = $_libavcodec
7669 LIBAVCODEC_A = $_libavcodec_a
7670 LIBAVCODEC_SO = $_libavcodec_so
7671 LIBAVFORMAT = $_libavformat
7672 LIBAVFORMAT_A = $_libavformat_a
7673 LIBAVFORMAT_SO = $_libavformat_so
7674 LIBPOSTPROC = $_libpostproc
7675 LIBPOSTPROC_A = $_libpostproc_a
7676 LIBPOSTPROC_SO = $_libpostproc_so
7677 ZORAN = $_zr
7678 LIBLZO = $_liblzo
7679 LIBDV = $_libdv
7680 XVID4 = $_xvid
7681 X264 = $_x264
7682 LIBNUT = $_libnut
7683 LIBDCA = $_libdca
7684 MPLAYER = $_mplayer
7685 MENCODER = $_mencoder
7686 CDDA = $_cdda
7687 CDDB = $_cddb
7688 BITMAP_FONT = $_bitmap_font
7689 FREETYPE = $_freetype
7690 ASS = $_ass
7691 LIBMAD = $_mad
7692 LIBVORBIS = $_vorbis
7693 LIBTHEORA = $_theora
7694 FAAD_INTERNAL = $_faad_internal
7695 FAAD_FIXED = $_faad_fixed
7696 LIBSMBCLIENT = $_smbsupport
7697 XMMS_PLUGINS = $_xmms
7698 MACOSX = $_macosx
7699 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7700 MACOSX_BUNDLE = $_macosx_bundle
7701 MACOSX_COREVIDEO = $_macosx_corevideo
7702 TOOLAME=$_toolame
7703 TWOLAME=$_twolame
7704 FAAC=$_faac
7705 CONFIG_LIBAMR=$_libamr
7706 CONFIG_LIBAMR_NB=$_libamr_nb
7707 CONFIG_LIBAMR_WB=$_libamr_wb
7708 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7709 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7710 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7711 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7712 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7713 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7714 CONFIG_LIBFAAC=$_lavc_faac
7715 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7716 CONFIG_LIBVORBIS=$_libvorbis
7717 CONFIG_LIBXVID=$_lavc_xvid
7718 CONFIG_LIBX264=$_lavc_x264
7719 CONFIG_ZLIB=$_zlib
7720 CONFIG_GPL=yes
7721 CONFIG_ENCODERS=$_mencoder
7722 CONFIG_MUXERS=$_mencoder
7723 RADIO=$_radio
7724 RADIO_CAPTURE=$_radio_capture
7725 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7726 VIDIX_IVTV=$_vidix_drv_ivtv
7727 VIDIX_MACH64=$_vidix_drv_mach64
7728 VIDIX_MGA=$_vidix_drv_mga
7729 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7730 VIDIX_NVIDIA=$_vidix_drv_nvidia
7731 VIDIX_PM2=$_vidix_drv_pm2
7732 VIDIX_PM3=$_vidix_drv_pm3
7733 VIDIX_RADEON=$_vidix_drv_radeon
7734 VIDIX_RAGE128=$_vidix_drv_rage128
7735 VIDIX_SAVAGE=$_vidix_drv_savage
7736 VIDIX_SIS=$_vidix_drv_sis
7737 VIDIX_UNICHROME=$_vidix_drv_unichrome
7739 # --- Some stuff for autoconfigure ----
7740 $_target_arch
7741 $_target_arch_x86
7742 $_confwin32
7743 TARGET_CPU=$iproc
7744 HAVE_MMX = $_mmx
7745 HAVE_MMX2 = $_mmxext
7746 HAVE_3DNOW = $_3dnow
7747 HAVE_3DNOWEX = $_3dnowext
7748 HAVE_SSE = $_sse
7749 HAVE_CMOV = $_cmov
7750 HAVE_ALTIVEC = $_altivec
7751 HAVE_ARMV5TE = $_armv5te
7752 HAVE_ARMV6 = $_armv6
7753 HAVE_IWMMXT = $_iwmmxt
7754 HAVE_VIS = $_vis
7756 # --- GUI stuff ---
7757 GUI = $_gui
7759 # --- libvo stuff ---
7760 VO_SRCS = $_vosrc
7762 # --- libao2 stuff ---
7763 AO_SRCS = $_aosrc
7765 # --- libaf stuff ---
7766 AF_SRCS = $_afsrc
7770 #############################################################################
7772 ff_config_enable () {
7773 _nprefix=$3;
7774 test -z "$_nprefix" && _nprefix='CONFIG'
7775 for part in $1; do
7776 if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
7777 echo "#define ${_nprefix}_$part 1"
7778 echo "#define ENABLE_$part 1"
7779 else
7780 echo "#define ENABLE_$part 0"
7782 done
7785 echo "Creating config.h"
7786 cat > $TMPH << EOF
7787 /* -------- This file has been automatically generated by configure ---------
7788 Note: Any changes in it will be lost when you run configure again. */
7790 /* Protect against multiple inclusion */
7791 #ifndef MPLAYER_CONFIG_H
7792 #define MPLAYER_CONFIG_H 1
7794 #define CONFIGURATION "$_configuration"
7796 /* make sure we never get lavformat's poll() emulation, the results are
7797 horrible if the X libs try to actually use it, see MPlayer-users
7798 Message-ID: <45D49541.8060101@infernix.net>
7799 Date: Thu, 15 Feb 2007 18:15:45 +0100
7800 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7802 #define HAVE_SYS_POLL_H 1
7804 /* yes, we have inttypes.h */
7805 #define HAVE_INTTYPES_H 1
7807 /* int_fastXY_t emulation */
7808 $_def_fast_inttypes
7810 /* libdvdcss */
7811 #define HAVE_ERRNO_H 1
7813 /* libdvdcss + libdvdread */
7814 #define HAVE_LIMITS_H 1
7816 /* libdvdcss + libfaad2 */
7817 #define HAVE_UNISTD_H 1
7819 /* libfaad2 + libdvdread */
7820 #define STDC_HEADERS 1
7822 /* libfaad2 */
7823 #define HAVE_MEMCPY 1
7824 #define HAVE_STRCHR 1
7826 /* libdvdread */
7827 #define HAVE_UINTPTR_T 1
7829 /* name of messages charset */
7830 $_def_charset
7832 /* Runtime CPU detection */
7833 $_def_runtime_cpudetection
7835 /* Dynamic a/v plugins */
7836 $_def_dynamic_plugins
7838 /* "restrict" keyword */
7839 $_def_restrict_keyword
7841 /* __builtin_expect branch prediction hint */
7842 $_def_builtin_expect
7843 #ifdef HAVE_BUILTIN_EXPECT
7844 #define likely(x) __builtin_expect ((x) != 0, 1)
7845 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7846 #else
7847 #define likely(x) (x)
7848 #define unlikely(x) (x)
7849 #endif
7851 /* attribute(used) as needed by some compilers */
7852 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7853 # define attribute_used __attribute__((used))
7854 #else
7855 # define attribute_used
7856 #endif
7858 /* compiler support for named assembler arguments */
7859 $_def_named_asm_args
7861 /* enable/disable SIGHANDLER */
7862 $_def_sighandler
7864 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7865 $_def_crash_debug
7867 /* Toggles debugging informations */
7868 $_def_debug
7870 /* Toggles color console output */
7871 $_def_color_console
7873 /* Indicates that libcdio is available for VCD and CD-DA playback */
7874 $_def_libcdio
7876 /* Indicates that Ogle's libdvdread is available for DVD playback */
7877 $_def_dvdread
7879 /* Indicates that dvdread is internal */
7880 $_def_dvdread_internal
7882 /* Additional options for libdvdread/libdvdcss */
7883 $_def_dvd
7884 $_def_cdrom
7885 $_def_cdio
7886 $_def_dvdio
7887 $_def_bsdi_dvd
7888 $_def_dvd_bsd
7889 $_def_dvd_linux
7890 $_dev_dvd_openbsd
7891 $_def_dvd_darwin
7892 $_def_sol_scsi_h
7893 $_def_hpux_scsi_h
7895 /* Common data directory (for fonts, etc) */
7896 #define MPLAYER_DATADIR "$_datadir"
7897 #define MPLAYER_CONFDIR "$_confdir"
7898 #define MPLAYER_LIBDIR "$_libdir"
7900 /* Define this to compile stream-caching support, it can be enabled via
7901 -cache <kilobytes> */
7902 $_def_stream_cache
7904 /* Define if you are using XviD library */
7905 $_def_xvid
7907 /* Define if you are using the X.264 library */
7908 $_def_x264
7910 /* Define if you are using libnut */
7911 $_def_libnut
7913 /* Define to include support for libdv-0.9.5 */
7914 $_def_libdv
7916 /* If build mencoder */
7917 $_mencoder_flag
7919 /* Indicates if libmp3lame is available
7920 Note: for mencoder */
7921 $_def_mp3lame
7922 $_def_mp3lame_preset
7923 $_def_mp3lame_preset_medium
7925 /* Undefine this if you do not want to select mono audio (left or right)
7926 with a stereo MPEG layer 2/3 audio stream. The command line option
7927 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7928 right-only), with 0 being the default.
7930 #define USE_FAKE_MONO 1
7932 /* Undefine this if your sound card driver has no working select().
7933 If you have kernel Oops, player hangups, or just no audio, you should
7934 try to recompile MPlayer with this option disabled! */
7935 $_def_select
7937 /* define this to use iconv(3) function to codepage conversions */
7938 $_def_iconv
7940 /* define this to use nl_langinfo function */
7941 $_def_langinfo
7943 /* define this to use RTC (/dev/rtc) for video timers */
7944 $_def_rtc
7946 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7947 #define MAX_OUTBURST 65536
7949 /* set up audio OUTBURST. Do not change this! */
7950 #define OUTBURST 512
7952 /* Define this if your system has the header file for the OSS sound interface */
7953 $_def_sys_soundcard
7955 /* Define this if your system has the header file for the OSS sound interface
7956 * in /usr/include */
7957 $_def_soundcard
7959 /* Define this if your system has the sysinfo header */
7960 $_def_sys_sysinfo
7962 /* Define this if your system has the "malloc.h" header file */
7963 $_def_malloc
7965 /* memalign is mapped to malloc if unsupported */
7966 $_def_memalign
7967 $_def_map_memalign
7968 $_def_memalign_hack
7970 /* assembler handling of .align */
7971 $_def_asmalign_pot
7973 /* Define this if your system has the "alloca.h" header file */
7974 $_def_alloca
7976 /* Define this if your system has the "sys/mman.h" header file */
7977 $_def_mman
7978 $_def_mman_has_map_failed
7980 /* Define this if you have the elf dynamic linker -ldl library */
7981 $_def_dl
7983 /* Define this if you have the kstat kernel statistics library */
7984 $_def_kstat
7986 /* Define this if you have zlib */
7987 $_def_zlib
7988 #ifdef HAVE_ZLIB
7989 #define CONFIG_ZLIB 1
7990 #endif
7992 /* Define this if you have shm support */
7993 $_def_shm
7995 /* Define this if your system has strsep */
7996 $_def_strsep
7998 /* Define this if your system has vsscanf */
7999 $_def_vsscanf
8001 /* Define this if your system has swab */
8002 $_def_swab
8004 /* Define this if your system has posix select */
8005 $_def_posix_select
8007 /* Define this if your system has gettimeofday */
8008 $_def_gettimeofday
8010 /* Define this if your system has glob */
8011 $_def_glob
8013 /* Define this if your system has setenv */
8014 $_def_setenv
8015 #ifndef HAVE_SETENV
8016 int setenv(const char *name, const char *val, int overwrite);
8017 #endif
8019 /* Define this if your system has sysi86 */
8020 $_def_sysi86
8021 $_def_sysi86_iv
8023 /* Define this if your system has pthreads */
8024 $_def_pthreads
8026 /* Define this if you enabled thread support for libavcodec */
8027 $_def_threads
8028 #ifdef HAVE_THREADS
8029 #define ENABLE_THREADS 1
8030 #else
8031 #define ENABLE_THREADS 0
8032 #endif
8034 /* LIRC (remote control, see www.lirc.org) support: */
8035 $_def_lirc
8037 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8038 $_def_apple_remote
8040 /* Support for maemo (http://www.maemo.org) */
8041 $_def_maemo
8044 * LIRCCD (LIRC client daemon)
8045 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8047 $_def_lircc
8049 /* DVD navigation support using libdvdnav */
8050 $_def_dvdnav
8052 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8053 #define MPEG12_POSTPROC 1
8055 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8056 $_def_libpostproc
8057 $_def_libpostproc_a
8058 $_def_libpostproc_so
8060 /* Win32 DLL support */
8061 $_def_win32dll
8062 #define WIN32_PATH "$_win32codecsdir"
8064 /* Mac OS X specific features */
8065 $_def_macosx
8066 $_def_macosx_finder_support
8067 $_def_macosx_bundle
8068 $_def_macosx_corevideo
8070 /* Build our Win32-loader */
8071 $_def_win32_loader
8073 /* ffmpeg's libavcodec support (requires libavcodec source) */
8074 $_def_libavcodec
8075 $_def_libavcodec_a
8076 $_def_libavcodec_so
8077 $_def_libavcodec_mpegaudio_hp
8079 /* ffmpeg's libavformat support (requires libavformat source) */
8080 $_def_libavformat
8081 $_def_libavformat_a
8082 $_def_libavformat_so
8084 $_def_libavutil
8085 $_def_libavutil_a
8086 $_def_libavutil_so
8088 /* Use libavcodec's decoders */
8089 #define CONFIG_DECODERS 1
8090 /* Use libavcodec's encoders */
8091 #define CONFIG_ENCODERS 1
8093 /* Use libavformat's demuxers */
8094 #define CONFIG_DEMUXERS 1
8095 /* Use libavformat's muxers */
8096 $_def_muxers
8098 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8099 #define HAVE_EBX_AVAILABLE 1
8100 #ifndef MP_DEBUG
8101 #define HAVE_EBP_AVAILABLE 1
8102 #endif
8104 #define CONFIG_GPL 1
8105 #define ENABLE_SMALL 0
8107 /* Support for grayscale encoding/decoding in FFmpeg (makes color slower) */
8108 #define ENABLE_GRAY 1
8110 /* Use AMR codecs from libavcodec. */
8111 $_def_libamr
8112 $_def_libamr_nb
8113 $_def_libamr_wb
8115 /* Use specific parts from FFmpeg. */
8116 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8117 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8118 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8119 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8120 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8121 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8122 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8124 $_def_lavc_faac
8125 $_def_lavc_xvid
8126 $_def_lavc_mp3lame
8127 $_def_lavc_x264
8129 /* Use codec libs included in mplayer CVS / source dist: */
8130 $_def_mp3lib
8131 $_def_liba52
8132 $_def_libdca
8133 $_def_libmpeg2
8135 /* XAnim DLL support */
8136 $_def_xanim
8137 /* Default search path */
8138 $_def_xanim_path
8140 /* RealPlayer DLL support */
8141 $_def_real
8142 /* Default search path */
8143 $_def_real_path
8145 /* LIVE555 Streaming Media library support */
8146 $_def_live
8148 /* libnemesi Streaming Media library support */
8149 $_def_nemesi
8151 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8152 $_def_fastmemcpy
8154 /* Use unrarlib for Vobsubs */
8155 $_def_unrarlib
8157 /* gui support, please do not edit this option */
8158 $_def_gui
8159 $_def_gtk2_gui
8161 /* Audio output drivers */
8162 $_def_ossaudio
8163 $_def_ossaudio_devdsp
8164 $_def_ossaudio_devmixer
8165 $_def_alsa5
8166 $_def_alsa9
8167 $_def_alsa1x
8168 $_def_arts
8169 $_def_esd
8170 $_def_esd_latency
8171 $_def_pulse
8172 $_def_jack
8173 $_def_openal
8174 $_def_openal_h
8175 $_def_sys_asoundlib_h
8176 $_def_alsa_asoundlib_h
8177 $_def_sunaudio
8178 $_def_sgiaudio
8179 $_def_win32waveout
8180 $_def_nas
8182 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8183 #undef FAST_OSD
8184 #undef FAST_OSD_TABLE
8186 /* Enable TV Interface support */
8187 $_def_tv
8189 /* Enable Video 4 Linux TV interface support */
8190 $_def_tv_v4l
8192 /* Enable Video 4 Linux 1 TV interface support */
8193 $_def_tv_v4l1
8195 /* Enable Video 4 Linux 2 TV interface support */
8196 $_def_tv_v4l2
8198 /* Enable DirectShow TV interface support */
8199 $_def_tv_dshow
8201 /* *BSD BrookTree headers */
8202 $_def_ioctl_meteor_h_name
8203 $_def_ioctl_bt848_h_name
8205 /* Enable *BSD BrookTree TV interface support */
8206 $_def_tv_bsdbt848
8208 /* Enable TV Teletext Interface support */
8209 $_def_tv_teletext
8211 /* Enable Radio Interface support */
8212 $_def_radio
8214 /* Enable Capture for Radio Interface support */
8215 $_def_radio_capture
8217 /* Enable Video 4 Linux Radio interface support */
8218 $_def_radio_v4l
8220 /* Enable Video 4 Linux 2 Radio interface support */
8221 $_def_radio_v4l2
8223 /* Enable *BSD BrookTree Radio interface support */
8224 $_def_radio_bsdbt848
8226 /* Enable Video 4 Linux 2 MPEG PVR support */
8227 $_def_pvr
8229 /* Define if your processor stores words with the most significant
8230 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8231 $_def_words_endian
8233 /* Define if your processor can access unaligned data in a fast way */
8234 $_def_fast_unaligned
8236 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8238 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8239 have the instruction. */
8240 $_def_dcbzl
8242 /* only gcc3 can compile mvi instructions (libmpeg2) */
8243 $_def_gcc_mvi_support
8245 /* Define this for Cygwin build for win32 */
8246 $_def_confwin32
8248 /* Define this to any prefered value from 386 up to infinity with step 100 */
8249 #define __CPU__ $iproc
8251 $_mp_wordsize
8253 $_def_linux
8255 $_def_vcd
8257 #ifdef sun
8258 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8259 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8260 #elif defined(HPUX)
8261 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8262 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8263 #elif defined(WIN32)
8264 #define DEFAULT_CDROM_DEVICE "D:"
8265 #define DEFAULT_DVD_DEVICE "D:"
8266 #elif defined(SYS_DARWIN)
8267 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8268 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8269 #elif defined(__OpenBSD__)
8270 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8271 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8272 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8273 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8274 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8275 #elif defined(SYS_AMIGAOS4)
8276 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8277 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8278 #else
8279 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8280 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8281 #endif
8284 /*----------------------------------------------------------------------------
8286 ** NOTE: Instead of modifying these definitions here, use the
8287 ** --enable/--disable options of the ./configure script!
8288 ** See ./configure --help for details.
8290 *---------------------------------------------------------------------------*/
8292 /* C99 lrintf function available */
8293 $_def_lrintf
8295 /* mkstemp support */
8296 $_def_mkstemp
8298 /* nanosleep support */
8299 $_def_nanosleep
8301 /* SMB support */
8302 $_def_smbsupport
8304 /* termcap flag for getch2.c */
8305 $_def_termcap
8307 /* termios flag for getch2.c */
8308 $_def_termios
8309 $_def_termios_h
8310 $_def_termios_sys_h
8312 /* enable PNG support */
8313 $_def_png
8315 /* enable JPEG support */
8316 $_def_jpeg
8318 /* enable PNM support */
8319 $_def_pnm
8321 /* enable md5sum support */
8322 $_def_md5sum
8324 /* enable GIF support */
8325 $_def_gif
8326 $_def_gif_4
8327 $_def_gif_tvt_hack
8329 /* enable bitmap font support */
8330 $_def_bitmap_font
8332 /* enable FreeType support */
8333 $_def_freetype
8335 /* enable Fontconfig support */
8336 $_def_fontconfig
8338 /* enable SSA/ASS support */
8339 $_def_ass
8341 /* enable FriBiDi usage */
8342 $_def_fribidi
8344 /* enable ENCA usage */
8345 $_def_enca
8347 /* liblzo support */
8348 $_def_liblzo
8349 #ifdef USE_LIBLZO
8350 #define CONFIG_LZO 1
8351 #endif
8353 /* libmad support */
8354 $_def_mad
8356 /* enable OggVorbis support */
8357 $_def_vorbis
8358 $_def_tremor
8360 /* enable Speex support */
8361 $_def_speex
8363 /* enable musepack support */
8364 $_def_musepack
8366 /* enable OggTheora support */
8367 $_def_theora
8369 /* enable FAAD (AAC) support */
8370 $_def_faad
8371 $_def_faad_internal
8373 /* enable FAAC (AAC encoder) support */
8374 $_def_faac
8376 /* enable LADSPA plugin support */
8377 $_def_ladspa
8379 /* enable network */
8380 $_def_network
8382 /* enable ftp support */
8383 $_def_ftp
8385 /* enable vstream support */
8386 $_def_vstream
8388 /* enable winsock2 instead of Unix functions*/
8389 $_def_winsock2
8391 /* define this to use inet_aton() instead of inet_pton() */
8392 $_def_use_aton
8394 /* enables / disables cdparanoia support */
8395 $_def_cdparanoia
8396 $_def_cddb
8398 /* enables / disables VIDIX usage */
8399 $_def_vidix
8400 $_def_vidix_drv_cyberblade
8401 $_def_vidix_drv_ivtv
8402 $_def_vidix_drv_mach64
8403 $_def_vidix_drv_mga
8404 $_def_vidix_drv_mga_crtc2
8405 $_def_vidix_drv_nvidia
8406 $_def_vidix_drv_pm3
8407 $_def_vidix_drv_radeon
8408 $_def_vidix_drv_rage128
8409 $_def_vidix_drv_savage
8410 $_def_vidix_drv_sis
8411 $_def_vidix_drv_unichrome
8412 $_def_vidix_pfx
8414 /* enables / disables new input joystick support */
8415 $_def_joystick
8417 /* enables / disables QTX codecs */
8418 $_def_qtx
8420 /* enables / disables osd menu */
8421 $_def_menu
8423 /* enables / disables subtitles sorting */
8424 $_def_sortsub
8426 /* XMMS input plugin support */
8427 $_def_xmms
8428 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8430 /* enables inet6 support */
8431 $_def_inet6
8433 /* do we have gethostbyname2? */
8434 $_def_gethostbyname2
8436 /* Extension defines */
8437 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8439 $_def_altivec_h // enables usage of altivec.h
8441 /* libmpeg2 uses a different feature test macro for mediaLib */
8442 #ifdef HAVE_MLIB
8443 #define LIBMPEG2_MLIB 1
8444 #endif
8446 /* libvo options */
8447 #define SCREEN_SIZE_X 1
8448 #define SCREEN_SIZE_Y 1
8449 $_def_x11
8450 $_def_xv
8451 $_def_xvmc
8452 $_def_vm
8453 $_def_xf86keysym
8454 $_def_xinerama
8455 $_def_gl
8456 $_def_gl_win32
8457 $_def_dga
8458 $_def_dga1
8459 $_def_dga2
8460 $_def_sdl
8461 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8462 $_def_sdlbuggy
8463 $_def_directx
8464 $_def_ggi
8465 $_def_ggiwmh
8466 $_def_3dfx
8467 $_def_s3fb
8468 $_def_tdfxfb
8469 $_def_tdfxvid
8470 $_def_xvr100
8471 $_def_directfb
8472 $_def_directfb_version
8473 $_def_dfbmga
8474 $_def_zr
8475 $_def_bl
8476 $_def_mga
8477 $_def_xmga
8478 $_def_fbdev
8479 $_def_dxr2
8480 $_def_dxr3
8481 $_def_ivtv
8482 $_def_v4l2
8483 $_def_dvb
8484 $_def_dvb_in
8485 $_def_svga
8486 $_def_vesa
8487 $_def_xdpms
8488 $_def_aa
8489 $_def_caca
8490 $_def_tga
8491 $_def_toolame
8492 $_def_twolame
8494 /* used by GUI: */
8495 $_def_xshape
8497 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8498 #define X11_FULLSCREEN 1
8499 #endif
8501 #endif /* MPLAYER_CONFIG_H */
8504 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8505 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8507 #############################################################################
8509 cat << EOF
8511 Config files successfully generated by ./configure $_configuration !
8513 Install prefix: $_prefix
8514 Data directory: $_datadir
8515 Config direct.: $_confdir
8517 Byte order: $_byte_order
8518 Optimizing for: $_optimizing
8520 Languages:
8521 Messages/GUI: $_language
8524 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8525 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8526 echo
8528 cat << EOF
8530 Enabled optional drivers:
8531 Input: $_inputmodules
8532 Codecs: $_codecmodules
8533 Audio output: $_aomodules
8534 Video output: $_vomodules
8535 Audio filters: $_afmodules
8536 Disabled optional drivers:
8537 Input: $_noinputmodules
8538 Codecs: $_nocodecmodules
8539 Audio output: $_noaomodules
8540 Video output: $_novomodules
8541 Audio filters: $_noafmodules
8543 'config.h' and 'config.mak' contain your configuration options.
8544 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8545 compile *** DO NOT REPORT BUGS if you tweak these files ***
8547 'make' will now compile MPlayer and 'make install' will install it.
8548 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8553 if test "$_mtrr" = yes ; then
8554 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8555 echo
8558 if ! x86_32; then
8559 cat <<EOF
8560 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8561 operating system ($system_name). You may encounter a few files that cannot
8562 be played due to missing open source video/audio codec support.
8568 cat <<EOF
8569 Check $TMPLOG if you wonder why an autodetection failed (make sure
8570 development headers/packages are installed).
8572 NOTE: The --enable-* parameters unconditionally force options on, completely
8573 skipping autodetection. This behavior is unlike what you may be used to from
8574 autoconf-based configure scripts that can decide to override you. This greater
8575 level of control comes at a price. You may have to provide the correct compiler
8576 and linker flags yourself.
8577 If you used one of these options (except --enable-gui and similar ones that
8578 turn on internal features) and experience a compilation or linking failure,
8579 make sure you have passed the necessary compiler/linker flags to configure.
8581 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8585 if test "$_warn_CFLAGS" = yes; then
8586 cat <<EOF
8588 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8590 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8592 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8593 To do so, execute 'CFLAGS= ./configure <options>'
8598 # Last move:
8599 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"