Support send mouse movements commands to mplayer.
[mplayer/greg.git] / configure
blob1be83af62c5677eab4bd2bca5ab70aed6029c118
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: check the cvs log !
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, here is a simple skeleton:
24 # echocheck "$feature"
25 # if "$_feature" = auto; then
26 # cat > $TMPC << EOF
27 # #include <feature.h>
28 # int main(void) { return 0; }
29 # EOF
30 # _feature=no
31 # cc_check && _feature=yes
32 # if test "$_feature" = yes ; then
33 # _def_feature='#define HAVE_FEATURE 1'
34 # else
35 # _def_feature='#undef HAVE_FEATURE'
36 # fi
37 # echores "$_feature"
39 # Furthermore you need to add the variable _feature to the list of default
40 # settings and set it to one of yes/no/auto. Also add appropriate
41 # --enable-feature/--disable-feature command line options.
42 # The results of the check should be written to config.h and config.mak
43 # at the end of this script. The variable names used for this should be
44 # uniform, i.e. if the option is named 'feature':
46 # _feature : should have a value of yes/no/auto
47 # _def_feature : '#define ... 1' or '#undef ...' for conditional compilation
48 # _ld_feature : '-L/path/dir -lfeature' GCC options
50 #############################################################################
52 # Prevent locale nonsense from breaking basic text processing utils
53 LC_ALL=C
54 export LC_ALL
56 # Store the configure line that was used
57 _configuration="$*"
59 # Prefer these macros to full length text !
60 # These macros only return an error code - NO display is done
61 compile_check() {
62 echo >> "$TMPLOG"
63 cat "$1" >> "$TMPLOG"
64 echo >> "$TMPLOG"
65 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
66 rm -f "$TMPEXE"
67 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
68 TMP="$?"
69 echo >> "$TMPLOG"
70 echo >> "$TMPLOG"
71 return "$TMP"
74 cc_check() {
75 compile_check $TMPC $@
78 cxx_check() {
79 compile_check $TMPCPP $@ -lstdc++
82 tmp_run() {
83 "$TMPEXE" >> "$TMPLOG" 2>&1
86 # Display error message, flushes tempfile, exit
87 die () {
88 echo
89 echo "Error: $@" >&2
90 echo >&2
91 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
92 echo "Check \"$TMPLOG\" if you do not understand why it failed."
93 exit 1
96 # OS test booleans functions
97 issystem() {
98 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
100 linux() { issystem "Linux" || issystem "uClinux" ; return "$?" ; }
101 sunos() { issystem "SunOS" ; return "$?" ; }
102 hpux() { issystem "HP-UX" ; return "$?" ; }
103 irix() { issystem "IRIX" ; return "$?" ; }
104 aix() { issystem "AIX" ; return "$?" ; }
105 cygwin() { issystem "CYGWIN" ; return "$?" ; }
106 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; }
107 netbsd() { issystem "NetBSD" ; return "$?" ; }
108 bsdos() { issystem "BSD/OS" ; return "$?" ; }
109 openbsd() { issystem "OpenBSD" ; return "$?" ; }
110 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
111 qnx() { issystem "QNX" ; return "$?" ; }
112 darwin() { issystem "Darwin" ; return "$?" ; }
113 gnu() { issystem "GNU" ; return "$?" ; }
114 mingw32() { issystem "MINGW32" ; return "$?" ; }
115 morphos() { issystem "MorphOS" ; return "$?" ; }
116 amigaos() { issystem "AmigaOS" ; return "$?" ; }
117 win32() { cygwin || mingw32 ; return "$?" ; }
118 beos() { issystem "BEOS" ; return "$?" ; }
120 # arch test boolean functions
121 # x86/x86pc is used by QNX
122 x86_32() {
123 case "$host_arch" in
124 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
125 *) return 1 ;;
126 esac
129 x86_64() {
130 case "$host_arch" in
131 x86_64|amd64) return 0 ;;
132 *) return 1 ;;
133 esac
136 x86() {
137 x86_32 || x86_64
140 ppc() {
141 case "$host_arch" in
142 ppc|powerpc) return 0;;
143 *) return 1;;
144 esac
147 alpha() {
148 case "$host_arch" in
149 alpha) return 0;;
150 *) return 1;;
151 esac
154 arm() {
155 case "$host_arch" in
156 arm) return 0;;
157 *) return 1;;
158 esac
161 sh3() {
162 case "$host_arch" in
163 sh3) return 0;;
164 *) return 1;;
165 esac
168 # Use this before starting a check
169 echocheck() {
170 echo "============ Checking for $@ ============" >> "$TMPLOG"
171 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
174 # Use this to echo the results of a check
175 echores() {
176 if test "$_res_comment" ; then
177 _res_comment="($_res_comment)"
179 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
180 echo "##########################################" >> "$TMPLOG"
181 echo "" >> "$TMPLOG"
182 echo "$@ $_res_comment"
183 _res_comment=""
185 #############################################################################
187 # Check how echo works in this /bin/sh
188 case `echo -n` in
189 -n) _echo_n= _echo_c='\c' ;; # SysV echo
190 *) _echo_n='-n ' _echo_c= ;; # BSD echo
191 esac
193 LANGUAGES=`echo help/help_mp-??.h help/help_mp-??_??.h | sed "s:help/help_mp-\(..\).h:\1:g" | sed "s:help/help_mp-\(.....\).h:\1:g"`
195 show_help(){
196 cat << EOF
197 Usage: $0 [OPTIONS]...
199 Configuration:
200 -h, --help display this help and exit
202 Installation directories:
203 --prefix=DIR prefix directory for installation [/usr/local]
204 --bindir=DIR directory for installing binaries [PREFIX/bin]
205 --datadir=DIR directory for installing machine independent
206 data files (skins, etc) [PREFIX/share/mplayer]
207 --mandir=DIR directory for installing man pages [PREFIX/share/man]
208 --confdir=DIR directory for installing configuration files
209 [PREFIX/etc/mplayer]
210 --libdir=DIR directory for object code libraries [PREFIX/lib]
211 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
212 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
213 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
214 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
216 Optional features:
217 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
218 --disable-mplayer disable MPlayer compilation [enable]
219 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
220 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
221 --disable-largefiles disable support for files > 2GB [enable]
222 --enable-linux-devfs set default devices to devfs [disable]
223 --enable-termcap use termcap database for key codes [autodetect]
224 --enable-termios use termios database for key codes [autodetect]
225 --disable-iconv disable iconv for encoding conversion [autodetect]
226 --disable-langinfo do not use langinfo [autodetect]
227 --enable-lirc enable LIRC (remote control) support [autodetect]
228 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
229 --enable-joystick enable joystick support [disable]
230 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
231 --disable-vm disable X video mode extensions [autodetect]
232 --disable-xf86keysym disable support for multimedia keys [autodetect]
233 --enable-radio enable radio interface [disable]
234 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
235 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
236 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
237 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
238 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
239 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
240 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
241 --disable-tv-teletext disable TV teletext interface [autodetect]
242 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
243 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
244 --disable-network disable networking [enable]
245 --enable-winsock2 enable winsock2 [autodetect]
246 --enable-smb enable Samba (SMB) input [autodetect]
247 --enable-live enable LIVE555 Streaming Media [autodetect]
248 --enable-nemesi enable Nemesi Streaming Media [autodetect]
249 --disable-dvdnav disable libdvdnav [autodetect]
250 --disable-dvdread disable libdvdread [autodetect]
251 --disable-dvdread-internal disable internal libdvdread [autodetect]
252 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
253 --disable-cdparanoia disable cdparanoia [autodetect]
254 --disable-cddb disable cddb [autodetect]
255 --disable-bitmap-font disable bitmap font support [enable]
256 --disable-freetype disable FreeType 2 font rendering [autodetect]
257 --disable-fontconfig disable fontconfig font lookup [autodetect]
258 --disable-unrarexec disable using of UnRAR executable [enabled]
259 --enable-menu enable OSD menu (not DVD menu) [disabled]
260 --disable-sortsub disable subtitle sorting [enabled]
261 --enable-fribidi enable the FriBiDi libs [autodetect]
262 --disable-enca disable ENCA charset oracle library [autodetect]
263 --disable-macosx disable Mac OS X specific features [autodetect]
264 --disable-maemo disable maemo specific features [autodetect]
265 --enable-macosx-finder-support enable Mac OS X Finder invocation
266 parameter parsing [disabled]
267 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
268 --disable-inet6 disable IPv6 support [autodetect]
269 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
270 --disable-ftp disable FTP support [enabled]
271 --disable-vstream disable TiVo vstream client support [autodetect]
272 --disable-pthreads disable Posix threads support [autodetect]
273 --disable-w32threads disable Win32 threads support [autodetect]
274 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
275 --enable-rpath enable runtime linker path for extra libs [disabled]
277 Codecs:
278 --enable-gif enable GIF support [autodetect]
279 --enable-png enable PNG input/output support [autodetect]
280 --enable-jpeg enable JPEG input/output support [autodetect]
281 --enable-libcdio enable external libcdio [autodetect]
282 --enable-liblzo enable external liblzo [autodetect]
283 --disable-win32dll disable Win32 DLL support [enabled]
284 --disable-qtx disable QuickTime codecs support [enabled]
285 --disable-xanim disable XAnim codecs support [enabled]
286 --disable-real disable RealPlayer codecs support [enabled]
287 --disable-xvid disable XviD [autodetect]
288 --disable-x264 disable x264 [autodetect]
289 --disable-libnut disable libnut [autodetect]
290 --disable-libavutil_a disable static libavutil [autodetect]
291 --disable-libavcodec_a disable static libavcodec [autodetect]
292 --disable-libavformat_a disable static libavformat [autodetect]
293 --disable-libpostproc_a disable static libpostproc [autodetect]
294 --disable-libavutil_so disable shared libavutil [autodetect]
295 --disable-libavcodec_so disable shared libavcodec [autodetect]
296 --disable-libavformat_so disable shared libavformat [autodetect]
297 --disable-libpostproc_so disable shared libpostproc [autodetect]
298 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
299 in libavcodec [enabled]
300 --disable-tremor-internal disable internal Tremor [enabled]
301 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
302 --enable-tremor-external enable external Tremor [autodetect]
303 --disable-libvorbis disable libvorbis support [autodetect]
304 --disable-speex disable Speex support [autodetect]
305 --enable-theora enable OggTheora libraries [autodetect]
306 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
307 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
308 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
309 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
310 --disable-ladspa disable LADSPA plugin support [autodetect]
311 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
312 --disable-mad disable libmad (MPEG audio) support [autodetect]
313 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
314 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
315 --enable-xmms enable XMMS input plugin support [disabled]
316 --enable-libdca enable libdca support [autodetect]
317 --disable-mp3lib disable builtin mp3lib [enabled]
318 --disable-liba52 disable builtin liba52 [enabled]
319 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
320 --disable-musepack disable musepack support [autodetect]
321 --disable-libamr_nb disable libamr narrowband [autodetect]
322 --disable-libamr_wb disable libamr wideband [autodetect]
323 --disable-decoder=DECODER disable specified FFmpeg decoder
324 --enable-decoder=DECODER enable specified FFmpeg decoder
325 --disable-encoder=ENCODER disable specified FFmpeg encoder
326 --enable-encoder=ENCODER enable specified FFmpeg encoder
327 --disable-parser=PARSER disable specified FFmpeg parser
328 --enable-parser=PARSER enable specified FFmpeg parser
329 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
330 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
331 --disable-muxer=MUXER disable specified FFmpeg muxer
332 --enable-muxer=MUXER enable specified FFmpeg muxer
334 Video output:
335 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
336 --disable-vidix-external disable external VIDIX [for x86 *nix]
337 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
338 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
339 nvidia,pm2,pm3,radeon,rage128,savage,sis,unichrome
340 --disable-vidix-pcidb disable VIDIX PCI device name database
341 --enable-gl enable OpenGL video output [autodetect]
342 --enable-dga2 enable DGA 2 support [autodetect]
343 --enable-dga1 enable DGA 1 support [autodetect]
344 --enable-vesa enable VESA video output [autodetect]
345 --enable-svga enable SVGAlib video output [autodetect]
346 --enable-sdl enable SDL video output [autodetect]
347 --enable-aa enable AAlib video output [autodetect]
348 --enable-caca enable CACA video output [autodetect]
349 --enable-ggi enable GGI video output [autodetect]
350 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
351 --enable-directx enable DirectX video output [autodetect]
352 --enable-dxr2 enable DXR2 video output [autodetect]
353 --enable-dxr3 enable DXR3/H+ video output [autodetect]
354 --enable-ivtv enable IVTV TV-Out video output [autodetect]
355 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
356 --enable-dvb enable DVB video output [autodetect]
357 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
358 --enable-mga enable mga_vid video output [autodetect]
359 --enable-xmga enable mga_vid X11 video output [autodetect]
360 --enable-xv enable Xv video output [autodetect]
361 --enable-xvmc enable XvMC acceleration [disable]
362 --enable-vm enable XF86VidMode support [autodetect]
363 --enable-xinerama enable Xinerama support [autodetect]
364 --enable-x11 enable X11 video output [autodetect]
365 --enable-xshape enable XShape support [autodetect]
366 --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 _unrar_exec=auto
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=yes
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-unrarexec) _unrar_exec=yes ;;
1099 --disable-unrarexec) _unrar_exec=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 xtensa*) host_arch=xtensa ;;
1267 *) host_arch=UNKNOWN ;;
1268 esac
1270 esac
1271 else # if test -z "$_target"
1272 system_name=`echo $_target | cut -d '-' -f 2`
1273 case "`echo $system_name | tr A-Z a-z`" in
1274 linux) system_name=Linux ;;
1275 freebsd) system_name=FreeBSD ;;
1276 gnu/kfreebsd) system_name=FreeBSD ;;
1277 netbsd) system_name=NetBSD ;;
1278 bsd/os) system_name=BSD/OS ;;
1279 openbsd) system_name=OpenBSD ;;
1280 sunos) system_name=SunOS ;;
1281 qnx) system_name=QNX ;;
1282 morphos) system_name=MorphOS ;;
1283 amigaos) system_name=AmigaOS ;;
1284 mingw32msvc) system_name=MINGW32 ;;
1285 esac
1286 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1287 host_arch=`echo $_target | cut -d '-' -f 1`
1288 if test `echo $host_arch` != "x86_64" ; then
1289 host_arch=`echo $host_arch | tr '_' '-'`
1293 echo "Detected operating system: $system_name"
1294 echo "Detected host architecture: $host_arch"
1296 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1297 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1301 if openbsd ; then
1302 _ldconfig="ldconfig -R"
1305 if freebsd ; then
1306 _ld_extra="$_ld_extra -L/usr/local/lib"
1307 _inc_extra="$_inc_extra -I/usr/local/include"
1310 if darwin; then
1311 _ld_extra="$_ld_extra -L/usr/local/lib"
1312 _inc_extra="$_inc_extra -I/usr/local/include"
1315 if aix ; then
1316 _ld_extra="$_ld_extra -lC"
1319 if irix ; then
1320 _ranlib='ar -r'
1321 elif linux ; then
1322 _ranlib='true'
1325 if win32 ; then
1326 _exesuf=".exe"
1327 # -lwinmm is always needed for osdep/timer-win2.c
1328 _ld_extra="$_ld_extra -lwinmm"
1329 _confwin32='TARGET_WIN32 = yes'
1330 else
1331 _confwin32='TARGET_WIN32 = no'
1334 if mingw32 ; then
1335 _need_shmem=no
1338 if cygwin ; then
1339 _def_confwin32='#define WIN32'
1342 if amigaos ; then
1343 _select=no
1344 _sighandler=no
1345 _stream_cache=no
1346 _def_stream_cache="#undef USE_STREAM_CACHE"
1349 if qnx ; then
1350 _ld_extra="$_ld_extra -lph"
1353 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1354 test "$I" && break
1355 done
1358 TMPLOG="configure.log"
1359 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1360 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1361 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1362 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1363 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1365 rm -f "$TMPLOG"
1366 echo configuration: $_configuration > "$TMPLOG"
1367 echo >> "$TMPLOG"
1370 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1371 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1372 # know about '-n'.
1373 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1374 _head() { head -$1 2>/dev/null ; }
1375 else
1376 _head() { head -n $1 2>/dev/null ; }
1378 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1379 _tail() { tail -$1 2>/dev/null ; }
1380 else
1381 _tail() { tail -n $1 2>/dev/null ; }
1384 # Checking CC version...
1385 if test "$_gcc_check" = yes ; then
1386 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1387 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1388 echocheck "$_cc version"
1389 cc_vendor=intel
1390 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1391 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1392 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1393 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1394 # TODO verify older icc/ecc compatibility
1395 case $cc_version in
1397 cc_version="v. ?.??, bad"
1398 cc_verc_fail=yes
1400 8.0|9.1|10.0|10.1)
1401 cc_version="$cc_version, ok"
1402 cc_verc_fail=no
1405 cc_version="$cc_version, bad"
1406 cc_verc_fail=yes
1408 esac
1409 echores "$cc_version"
1410 else
1411 for _cc in "$_cc" gcc cc ; do
1412 echocheck "$_cc version"
1413 cc_vendor=gnu
1414 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1415 cc_version=`$_cc -dumpversion 2>&1`
1416 if test "$?" -gt 0; then
1417 cc_version="not found"
1419 case $cc_version in
1421 cc_version="v. ?.??, bad"
1422 cc_verc_fail=yes
1424 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1425 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1426 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1427 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1428 cc_version="$cc_version, ok"
1429 cc_verc_fail=no
1431 'not found')
1432 cc_verc_fail=yes
1435 cc_version="$cc_version, bad"
1436 cc_verc_fail=yes
1438 esac
1439 echores "$cc_version"
1440 test "$cc_verc_fail" = "no" && break
1441 done
1442 fi # icc
1443 if test "$cc_verc_fail" = yes ; then
1444 cat <<EOF
1446 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1448 You are not using a supported compiler. We do not have the time to make sure
1449 everything works with compilers other than the ones we use. Use either the
1450 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1451 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1453 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1454 mplayer and lame (which is used for mencoder). If you get compile errors,
1455 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1456 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1457 bugs!
1459 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1462 die "Bad gcc version"
1464 else
1465 cat <<EOF
1467 ******************************************************************************
1469 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1470 Ok. You know. Do it.
1472 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1473 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1474 Lame which is used by mencoder produces weird errors, too.
1476 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1477 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1479 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1481 ******************************************************************************
1485 read _answer
1488 echocheck "host cc"
1489 test "$_host_cc" || _host_cc=$_cc
1490 echores $_host_cc
1492 echocheck "cross compilation"
1493 if test $_cross_compile = auto ; then
1494 cat > $TMPC << EOF
1495 int main(void) { return 0; }
1497 _cross_compile=yes
1498 cc_check && "$TMPEXE" && _cross_compile=no
1500 echores $_cross_compile
1502 if test $_cross_compile = yes; then
1503 tmp_run() {
1504 return 0
1508 # ---
1510 # now that we know what compiler should be used for compilation, try to find
1511 # out which assembler is used by the $_cc compiler
1512 if test "$_as" = auto ; then
1513 _as=`$_cc -print-prog-name=as`
1514 test -z "$_as" && _as=as
1517 # XXX: this should be ok..
1518 _cpuinfo="echo"
1520 if test "$_runtime_cpudetection" = no ; then
1522 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1523 # FIXME: Remove the cygwin check once AMD CPUs are supported
1524 if test -r /proc/cpuinfo && ! cygwin; then
1525 # Linux with /proc mounted, extract CPU information from it
1526 _cpuinfo="cat /proc/cpuinfo"
1527 elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then
1528 # FreeBSD with Linux emulation /proc mounted,
1529 # extract CPU information from it
1530 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1531 elif darwin && ! x86_32 ; then
1532 # use hostinfo on Darwin
1533 _cpuinfo="hostinfo"
1534 elif aix; then
1535 # use 'lsattr' on AIX
1536 _cpuinfo="lsattr -E -l proc0 -a type"
1537 elif x86; then
1538 # all other OSes try to extract CPU information from a small helper
1539 # program cpuinfo instead
1540 $_cc -o cpuinfo$_exesuf cpuinfo.c
1541 _cpuinfo="./cpuinfo$_exesuf"
1544 if x86 ; then
1545 # gather more CPU information
1546 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1547 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1548 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1549 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1550 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1552 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1554 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1555 -e s/xmm/sse/ -e s/kni/sse/`
1557 for ext in $pparam ; do
1558 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1559 done
1561 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1562 test $_sse = kernel_check && _mmxext=kernel_check
1564 echocheck "CPU vendor"
1565 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1567 echocheck "CPU type"
1568 echores "$pname"
1571 fi # test "$_runtime_cpudetection" = no
1573 if x86 && test "$_runtime_cpudetection" = no ; then
1574 extcheck() {
1575 if test "$1" = kernel_check ; then
1576 echocheck "kernel support of $2"
1577 cat > $TMPC <<EOF
1578 #include <signal.h>
1579 void catch() { exit(1); }
1580 int main(void){
1581 signal(SIGILL, catch);
1582 __asm__ __volatile__ ("$3":::"memory");return(0);
1586 if cc_check && tmp_run ; then
1587 eval _$2=yes
1588 echores "yes"
1589 _optimizing="$_optimizing $2"
1590 return 0
1591 else
1592 eval _$2=no
1593 echores "failed"
1594 echo "It seems that your kernel does not correctly support $2."
1595 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1596 return 1
1599 return 0
1602 extcheck $_mmx "mmx" "emms"
1603 extcheck $_mmxext "mmxext" "sfence"
1604 extcheck $_3dnow "3dnow" "femms"
1605 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1606 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1607 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1608 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1609 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1611 echocheck "mtrr support"
1612 if test "$_mtrr" = kernel_check ; then
1613 _mtrr="yes"
1614 _optimizing="$_optimizing mtrr"
1616 echores "$_mtrr"
1618 if test "$_gcc3_ext" != ""; then
1619 # if we had to disable sse/sse2 because the active kernel does not
1620 # support this instruction set extension, we also have to tell
1621 # gcc3 to not generate sse/sse2 instructions for normal C code
1622 cat > $TMPC << EOF
1623 int main(void) { return 0; }
1625 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1631 _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM ARMV4L SH3 POWERPC PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC'
1632 case "$host_arch" in
1633 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1634 _arch='X86 X86_32'
1635 _target_arch_x86="ARCH_X86 = yes"
1636 _target_arch="ARCH_X86_32 = yes"
1637 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1638 iproc=486
1639 proc=i486
1642 if test "$_runtime_cpudetection" = no ; then
1643 case "$pvendor" in
1644 AuthenticAMD)
1645 case "$pfamily" in
1646 3) proc=i386 iproc=386 ;;
1647 4) proc=i486 iproc=486 ;;
1648 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1649 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1650 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1651 proc=k6-3
1652 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1653 proc=geode
1654 elif test "$pmodel" -ge 8; then
1655 proc=k6-2
1656 elif test "$pmodel" -ge 6; then
1657 proc=k6
1658 else
1659 proc=i586
1662 6) iproc=686
1663 # It's a bit difficult to determine the correct type of Family 6
1664 # AMD CPUs just from their signature. Instead, we check directly
1665 # whether it supports SSE.
1666 if test "$_sse" = yes; then
1667 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1668 proc=athlon-xp
1669 else
1670 # Again, gcc treats athlon and athlon-tbird similarly.
1671 proc=athlon
1674 15) iproc=686
1675 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1676 # caught and remedied in the optimization tests below.
1677 proc=k8
1680 *) proc=k8 iproc=686 ;;
1681 esac
1683 GenuineIntel)
1684 case "$pfamily" in
1685 3) proc=i386 iproc=386 ;;
1686 4) proc=i486 iproc=486 ;;
1687 5) iproc=586
1688 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1689 proc=pentium-mmx # 4 is desktop, 8 is mobile
1690 else
1691 proc=i586
1694 6) iproc=686
1695 if test "$pmodel" -ge 15; then
1696 proc=core2
1697 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1698 proc=pentium-m
1699 elif test "$pmodel" -ge 7; then
1700 proc=pentium3
1701 elif test "$pmodel" -ge 3; then
1702 proc=pentium2
1703 else
1704 proc=i686
1707 15) iproc=686
1708 # A nocona in 32-bit mode has no more capabilities than a prescott.
1709 if test "$pmodel" -ge 3; then
1710 proc=prescott
1711 else
1712 proc=pentium4
1714 test $_fast_cmov = "auto" && _fast_cmov=no
1716 *) proc=prescott iproc=686 ;;
1717 esac
1719 CentaurHauls)
1720 case "$pfamily" in
1721 5) iproc=586
1722 if test "$pmodel" -ge 8; then
1723 proc=winchip2
1724 elif test "$pmodel" -ge 4; then
1725 proc=winchip-c6
1726 else
1727 proc=i586
1730 6) iproc=686
1731 if test "$pmodel" -ge 9; then
1732 proc=c3-2
1733 else
1734 proc=c3
1735 iproc=586
1738 *) proc=i686 iproc=i686 ;;
1739 esac
1741 unknown)
1742 case "$pfamily" in
1743 3) proc=i386 iproc=386 ;;
1744 4) proc=i486 iproc=486 ;;
1745 *) proc=i586 iproc=586 ;;
1746 esac
1749 proc=i586 iproc=586 ;;
1750 esac
1751 fi # test "$_runtime_cpudetection" = no
1754 # check that gcc supports our CPU, if not, fall back to earlier ones
1755 # LGB: check -mcpu and -march swithing step by step with enabling
1756 # to fall back till 386.
1758 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1760 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1761 cpuopt=-mtune
1762 else
1763 cpuopt=-mcpu
1766 echocheck "GCC & CPU optimization abilities"
1767 cat > $TMPC << EOF
1768 int main(void) { return 0; }
1770 if test "$_runtime_cpudetection" = no ; then
1771 cc_check -march=native && proc=native
1772 if test "$proc" = "k8"; then
1773 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1775 if test "$proc" = "athlon-xp"; then
1776 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1778 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1779 cc_check -march=$proc $cpuopt=$proc || proc=k6
1781 if test "$proc" = "k6" || test "$proc" = "c3"; then
1782 if ! cc_check -march=$proc $cpuopt=$proc; then
1783 if cc_check -march=i586 $cpuopt=i686; then
1784 proc=i586-i686
1785 else
1786 proc=i586
1790 if test "$proc" = "prescott" ; then
1791 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1793 if test "$proc" = "core2" ; then
1794 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1796 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
1797 cc_check -march=$proc $cpuopt=$proc || proc=i686
1799 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1800 cc_check -march=$proc $cpuopt=$proc || proc=i586
1802 if test "$proc" = "i586"; then
1803 cc_check -march=$proc $cpuopt=$proc || proc=i486
1805 if test "$proc" = "i486" ; then
1806 cc_check -march=$proc $cpuopt=$proc || proc=i386
1808 if test "$proc" = "i386" ; then
1809 cc_check -march=$proc $cpuopt=$proc || proc=error
1811 if test "$proc" = "error" ; then
1812 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1813 _mcpu=""
1814 _march=""
1815 _optimizing=""
1816 elif test "$proc" = "i586-i686"; then
1817 _march="-march=i586"
1818 _mcpu="$cpuopt=i686"
1819 _optimizing="$proc"
1820 else
1821 _march="-march=$proc"
1822 _mcpu="$cpuopt=$proc"
1823 _optimizing="$proc"
1825 else # if test "$_runtime_cpudetection" = no
1826 _mcpu="$cpuopt=generic"
1827 # at least i486 required, for bswap instruction
1828 _march="-march=i486"
1829 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1830 cc_check $_mcpu || _mcpu=""
1831 cc_check $_march $_mcpu || _march=""
1834 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1835 ## autodetected mcpu/march parameters
1836 if test "$_target" ; then
1837 # TODO: it may be a good idea to check GCC and fall back in all cases
1838 if test "$host_arch" = "i586-i686"; then
1839 _march="-march=i586"
1840 _mcpu="$cpuopt=i686"
1841 else
1842 _march="-march=$host_arch"
1843 _mcpu="$cpuopt=$host_arch"
1846 proc="$host_arch"
1848 case "$proc" in
1849 i386) iproc=386 ;;
1850 i486) iproc=486 ;;
1851 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1852 i686|athlon*|pentium*) iproc=686 ;;
1853 *) iproc=586 ;;
1854 esac
1857 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1858 _fast_cmov="yes"
1859 else
1860 _fast_cmov="no"
1863 echores "$proc"
1866 ia64)
1867 _arch='IA64'
1868 _target_arch='ARCH_IA64 = yes'
1869 iproc='ia64'
1870 proc=''
1871 _march=''
1872 _mcpu=''
1873 _optimizing=''
1876 x86_64|amd64)
1877 _arch='X86 X86_64'
1878 _target_arch='ARCH_X86_64 = yes'
1879 _target_arch_x86="ARCH_X86 = yes"
1880 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1881 iproc='x86_64'
1883 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1884 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1885 cpuopt=-mtune
1886 else
1887 cpuopt=-mcpu
1889 if test "$_runtime_cpudetection" = no ; then
1890 case "$pvendor" in
1891 AuthenticAMD)
1892 proc=k8;;
1893 GenuineIntel)
1894 case "$pfamily" in
1895 6) proc=core2;;
1897 # 64-bit prescotts exist, but as far as GCC is concerned they
1898 # have the same capabilities as a nocona.
1899 proc=nocona
1900 test $_fast_cmov = "auto" && _fast_cmov=no
1902 esac
1905 proc=error;;
1906 esac
1907 fi # test "$_runtime_cpudetection" = no
1909 echocheck "GCC & CPU optimization abilities"
1910 cat > $TMPC << EOF
1911 int main(void) { return 0; }
1913 # This is a stripped-down version of the i386 fallback.
1914 if test "$_runtime_cpudetection" = no ; then
1915 cc_check -march=native && proc=native
1916 # --- AMD processors ---
1917 if test "$proc" = "k8"; then
1918 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1920 # This will fail if gcc version < 3.3, which is ok because earlier
1921 # versions don't really support 64-bit on amd64.
1922 # Is this a valid assumption? -Corey
1923 if test "$proc" = "athlon-xp"; then
1924 cc_check -march=$proc $cpuopt=$proc || proc=error
1926 # --- Intel processors ---
1927 if test "$proc" = "core2"; then
1928 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1930 if test "$proc" = "nocona"; then
1931 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1933 if test "$proc" = "pentium4"; then
1934 cc_check -march=$proc $cpuopt=$proc || proc=error
1937 _march="-march=$proc"
1938 _mcpu="$cpuopt=$proc"
1939 if test "$proc" = "error" ; then
1940 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1941 _mcpu=""
1942 _march=""
1944 else # if test "$_runtime_cpudetection" = no
1945 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1946 _march="-march=x86-64"
1947 _mcpu="$cpuopt=generic"
1948 cc_check $_mcpu || _mcpu="x86-64"
1949 cc_check $_mcpu || _mcpu=""
1950 cc_check $_march $_mcpu || _march=""
1953 _optimizing=""
1955 echores "$proc"
1958 sparc)
1959 _arch='SPARC'
1960 _target_arch='ARCH_SPARC = yes'
1961 iproc='sparc'
1962 if sunos ; then
1963 echocheck "CPU type"
1964 karch=`uname -m`
1965 case "`echo $karch`" in
1966 sun4) proc=v7 ;;
1967 sun4c) proc=v7 ;;
1968 sun4d) proc=v8 ;;
1969 sun4m) proc=v8 ;;
1970 sun4u) proc=ultrasparc _vis='yes' ;;
1971 sun4v) proc=v9 ;;
1972 *) proc=v8 ;;
1973 esac
1974 echores "$proc"
1975 else
1976 proc=v8
1978 _march=''
1979 _mcpu="-mcpu=$proc"
1980 _optimizing="$proc"
1983 sparc64)
1984 _arch='SPARC'
1985 _target_arch='ARCH_SPARC = yes'
1986 _vis='yes'
1987 iproc='sparc'
1988 proc='ultrasparc'
1989 _march=''
1990 _mcpu="-mcpu=$proc"
1991 _optimizing="$proc"
1994 arm|armv4l|armv5tel)
1995 _arch='ARM ARMV4L'
1996 _target_arch='ARCH_ARMV4L = yes'
1997 iproc='arm'
1998 proc=''
1999 _march=''
2000 _mcpu=''
2001 _optimizing=''
2004 sh3)
2005 _arch='SH3'
2006 _target_arch='ARCH_SH3 = yes'
2007 iproc='sh3'
2008 proc=''
2009 _march='-m3'
2010 _mcpu='-ml'
2011 _optimizing=''
2014 ppc|powerpc)
2015 _arch='POWERPC PPC'
2016 _def_dcbzl='#undef HAVE_DCBZL'
2017 _target_arch='ARCH_POWERPC = yes'
2018 iproc='ppc'
2019 proc=''
2020 _march=''
2021 _mcpu=''
2022 _optimizing=''
2024 echocheck "CPU type"
2025 case $system_name in
2026 Linux)
2027 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2028 if test -n "`$_cpuinfo | grep altivec`"; then
2029 test $_altivec = auto && _altivec=yes
2032 Darwin)
2033 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2034 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2035 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2036 test $_altivec = auto && _altivec=yes
2039 NetBSD)
2040 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2041 case $cc_version in
2042 2*|3.0*|3.1*|3.2*|3.3*)
2045 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2046 test $_altivec = auto && _altivec=yes
2049 esac
2051 AIX)
2052 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2054 esac
2055 if test "$_altivec" = yes; then
2056 echores "$proc altivec"
2057 else
2058 _altivec=no
2059 echores "$proc"
2062 echocheck "GCC & CPU optimization abilities"
2064 if test -n "$proc"; then
2065 case "$proc" in
2066 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2067 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2068 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2069 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2070 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2071 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2072 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2073 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2074 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2075 *) ;;
2076 esac
2077 # gcc 3.1(.1) and up supports 7400 and 7450
2078 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2079 case "$proc" in
2080 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2081 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2082 *) ;;
2083 esac
2085 # gcc 3.2 and up supports 970
2086 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2087 case "$proc" in
2088 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2089 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2090 *) ;;
2091 esac
2093 # gcc 3.3 and up supports POWER4
2094 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2095 case "$proc" in
2096 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2097 *) ;;
2098 esac
2100 # gcc 3.4 and up supports 440*
2101 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2102 case "$proc" in
2103 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2104 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2105 *) ;;
2106 esac
2108 # gcc 4.0 and up supports POWER5
2109 if test "$_cc_major" -ge "4"; then
2110 case "$proc" in
2111 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2112 *) ;;
2113 esac
2117 if test -n "$_mcpu"; then
2118 _optimizing=`echo $_mcpu | cut -c 8-`
2119 echores "$_optimizing"
2120 else
2121 echores "none"
2126 alpha)
2127 _arch='ALPHA'
2128 _target_arch='ARCH_ALPHA = yes'
2129 iproc='alpha'
2130 _march=''
2132 echocheck "CPU type"
2133 cat > $TMPC << EOF
2134 int main(void) {
2135 unsigned long ver, mask;
2136 asm ("implver %0" : "=r" (ver));
2137 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2138 printf("%ld-%x\n", ver, ~mask);
2139 return 0;
2142 $_cc -o "$TMPEXE" "$TMPC"
2143 case `"$TMPEXE"` in
2145 0-0) proc="ev4"; _mvi="0";;
2146 1-0) proc="ev5"; _mvi="0";;
2147 1-1) proc="ev56"; _mvi="0";;
2148 1-101) proc="pca56"; _mvi="1";;
2149 2-303) proc="ev6"; _mvi="1";;
2150 2-307) proc="ev67"; _mvi="1";;
2151 2-1307) proc="ev68"; _mvi="1";;
2152 esac
2153 echores "$proc"
2155 echocheck "GCC & CPU optimization abilities"
2156 if test "$proc" = "ev68" ; then
2157 cc_check -mcpu=$proc || proc=ev67
2159 if test "$proc" = "ev67" ; then
2160 cc_check -mcpu=$proc || proc=ev6
2162 _mcpu="-mcpu=$proc"
2163 echores "$proc"
2165 _optimizing="$proc"
2167 echocheck "MVI instruction support in GCC"
2168 if test "$_cc_major" -ge "3" && test "$_mvi" = "1" ; then
2169 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2170 echores "yes"
2171 else
2172 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2173 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2177 mips)
2178 _arch='SGI_MIPS'
2179 _target_arch='ARCH_SGI_MIPS = yes'
2180 iproc='sgi-mips'
2181 proc=''
2182 _march=''
2183 _mcpu=''
2184 _optimizing=''
2186 if irix ; then
2187 echocheck "CPU type"
2188 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2189 case "`echo $proc`" in
2190 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2191 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2192 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2193 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2194 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2195 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2196 esac
2197 # gcc < 3.x does not support -mtune.
2198 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2199 _mcpu=''
2201 echores "$proc"
2206 hppa)
2207 _arch='PA_RISC'
2208 _target_arch='ARCH_PA_RISC = yes'
2209 iproc='PA-RISC'
2210 proc=''
2211 _march=''
2212 _mcpu=''
2213 _optimizing=''
2216 s390)
2217 _arch='S390'
2218 _target_arch='ARCH_S390 = yes'
2219 iproc='390'
2220 proc=''
2221 _march=''
2222 _mcpu=''
2223 _optimizing=''
2226 s390x)
2227 _arch='S390X'
2228 _target_arch='ARCH_S390X = yes'
2229 iproc='390x'
2230 proc=''
2231 _march=''
2232 _mcpu=''
2233 _optimizing=''
2236 vax)
2237 _arch='VAX'
2238 _target_arch='ARCH_VAX = yes'
2239 iproc='vax'
2240 proc=''
2241 _march=''
2242 _mcpu=''
2243 _optimizing=''
2246 xtensa)
2247 _arch='XTENSA'
2248 _target_arch='ARCH_XTENSA = yes'
2249 iproc='xtensa'
2250 proc=''
2251 _march=''
2252 _mcpu=''
2253 _optimizing=''
2256 generic)
2257 _arch='GENERIC'
2258 _target_arch='ARCH_GENERIC = yes'
2259 iproc=''
2260 proc=''
2261 _march=''
2262 _mcpu=''
2263 _optimizing=''
2267 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2268 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2269 die "unsupported architecture $host_arch"
2271 esac # case "$host_arch" in
2273 if test "$_runtime_cpudetection" = yes ; then
2274 if x86 ; then
2275 test "$_cmov" != no && _cmov=yes
2276 x86_32 && _cmov=no
2277 test "$_mmx" != no && _mmx=yes
2278 test "$_3dnow" != no && _3dnow=yes
2279 test "$_3dnowext" != no && _3dnowext=yes
2280 test "$_mmxext" != no && _mmxext=yes
2281 test "$_sse" != no && _sse=yes
2282 test "$_sse2" != no && _sse2=yes
2283 test "$_ssse3" != no && _ssse3=yes
2284 test "$_mtrr" != no && _mtrr=yes
2286 if ppc; then
2287 _altivec=yes
2293 echocheck "assembler support of -pipe option"
2294 cat > $TMPC << EOF
2295 int main(void) { return 0; }
2297 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2300 echocheck "compiler support of named assembler arguments"
2301 _named_asm_args=yes
2302 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2303 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2304 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2305 _named_asm_args=no
2306 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2308 echores $_named_asm_args
2311 if darwin && test "$cc_vendor" = "gnu" ; then
2312 echocheck "GCC support of -mstackrealign"
2313 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2314 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2315 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2316 # wrong code with this flag, but this can be worked around by adding
2317 # -fno-unit-at-a-time as described in the blog post at
2318 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2319 cat > $TMPC << EOF
2320 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2321 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2323 cc_check -O4 -mstackrealign && tmp_run && _stackrealign=-mstackrealign
2324 test -z "$_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2325 && tmp_run && _stackrealign="-mstackrealign -fno-unit-at-a-time"
2326 test -n "$_stackrealign" && echores "yes" || echores "no"
2327 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2330 # Checking for CFLAGS
2331 _install_strip="-s"
2332 if test "$_profile" != "" || test "$_debug" != "" ; then
2333 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2334 _install_strip=
2335 elif test -z "$CFLAGS" ; then
2336 if test "$cc_vendor" = "intel" ; then
2337 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2338 elif test "$cc_vendor" != "gnu" ; then
2339 CFLAGS="-O2 $_march $_mcpu $_pipe"
2340 else
2341 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2343 else
2344 _warn_CFLAGS=yes
2346 if test -n "$LDFLAGS" ; then
2347 _ld_extra="$_ld_extra $LDFLAGS"
2348 _warn_CFLAGS=yes
2349 elif test "$cc_vendor" = "intel" ; then
2350 _ld_extra="$_ld_extra -i-static"
2352 if test -n "$CPPFLAGS" ; then
2353 _inc_extra="$_inc_extra $CPPFLAGS"
2354 _warn_CFLAGS=yes
2359 if x86_32 ; then
2360 # Checking assembler (_as) compatibility...
2361 # Added workaround for older as that reads from stdin by default - atmos
2362 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2363 echocheck "assembler ($_as $as_version)"
2365 _pref_as_version='2.9.1'
2366 echo 'nop' > $TMPS
2367 if test "$_mmx" = yes ; then
2368 echo 'emms' >> $TMPS
2370 if test "$_3dnow" = yes ; then
2371 _pref_as_version='2.10.1'
2372 echo 'femms' >> $TMPS
2374 if test "$_3dnowext" = yes ; then
2375 _pref_as_version='2.10.1'
2376 echo 'pswapd %mm0, %mm0' >> $TMPS
2378 if test "$_mmxext" = yes ; then
2379 _pref_as_version='2.10.1'
2380 echo 'movntq %mm0, (%eax)' >> $TMPS
2382 if test "$_sse" = yes ; then
2383 _pref_as_version='2.10.1'
2384 echo 'xorps %xmm0, %xmm0' >> $TMPS
2386 #if test "$_sse2" = yes ; then
2387 # _pref_as_version='2.11'
2388 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2390 if test "$_cmov" = yes ; then
2391 _pref_as_version='2.10.1'
2392 echo 'cmovb %eax, %ebx' >> $TMPS
2394 if test "$_ssse3" = yes ; then
2395 _pref_as_version='2.16.92'
2396 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2398 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2400 if test "$as_verc_fail" != yes ; then
2401 echores "ok"
2402 else
2403 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2404 echores "failed"
2405 die "obsolete binutils version"
2408 fi #if x86_32
2410 echocheck ".align is a power of two"
2411 if test "$_asmalign_pot" = auto ; then
2412 _asmalign_pot=no
2413 cat > $TMPC << EOF
2414 main(void) { asm (".align 3"); }
2416 cc_check && _asmalign_pot=yes
2418 if test "$_asmalign_pot" = "yes" ; then
2419 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2420 else
2421 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2423 echores $_asmalign_pot
2426 #FIXME: This should happen before the check for CFLAGS..
2427 if ppc ; then
2429 # check if altivec is supported by the compiler, and how to enable it
2431 _altivec_gcc_flags=''
2433 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2434 echocheck "GCC altivec support"
2436 p=''
2437 cat > $TMPC << EOF
2438 int main(void) {
2439 return 0;
2442 FSF_flags='-maltivec -mabi=altivec'
2443 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2445 # check for Darwin-style flags first, since
2446 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2447 # accepts but ignores FSF-style flags...
2449 if test -z "$p"; then
2450 cc_check $Darwin_flags && p='Darwin'
2452 if test -z "$p"; then
2453 cc_check $FSF_flags && p='FSF'
2456 case $p in
2457 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2458 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2459 *) _altivec=no ;;
2460 esac
2462 if test -z "$p"; then
2463 p=none
2464 else
2465 p="$p-style ($_altivec_gcc_flags)"
2468 echores "$p"
2471 # check if <altivec.h> should be included
2473 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2475 if test "$_altivec" = yes ; then
2476 echocheck "altivec.h"
2477 cat > $TMPC << EOF
2478 #include <altivec.h>
2479 int main(void) { return 0; }
2481 _have_altivec_h=no
2482 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2483 if test "$_have_altivec_h" = yes ; then
2484 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2486 echores "$_have_altivec_h"
2489 # disable runtime cpudetection if
2490 # - we cannot generate altivec code
2491 # - altivec is disabled by the user
2493 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2494 _runtime_cpudetection=no
2497 # show that we are optimizing for altivec (if enabled and supported)
2499 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2500 _optimizing="$_optimizing altivec"
2503 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2505 if test "$_altivec" = yes ; then
2506 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2507 #_mcpu="$_mcpu $_altivec_gcc_flags"
2508 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2512 if arm ; then
2513 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2514 if test $_armv5te = "auto" ; then
2515 cat > $TMPC << EOF
2516 int main(void) {
2517 __asm__ __volatile__ ("qadd r0, r0, r0");
2520 _armv5te=no
2521 cc_check && _armv5te=yes
2523 echores "$_armv5te"
2525 echocheck "ARMv6 (SIMD instructions)"
2526 if test $_armv6 = "auto" ; then
2527 cat > $TMPC << EOF
2528 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2530 _armv6=no
2531 cc_check && _armv6=yes
2533 echores "$_armv6"
2535 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2536 if test $_iwmmxt = "auto" ; then
2537 cat > $TMPC << EOF
2538 int main(void) {
2539 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2542 _iwmmxt=no
2543 cc_check && _iwmmxt=yes
2545 echores "$_iwmmxt"
2548 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
2549 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2550 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2551 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2552 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2553 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2554 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2555 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2556 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2557 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2558 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2559 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2560 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2561 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2562 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2563 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2565 # Checking kernel version...
2566 if x86_32 && linux ; then
2567 _k_verc_problem=no
2568 kernel_version=`uname -r 2>&1`
2569 echocheck "$system_name kernel version"
2570 case "$kernel_version" in
2571 '') kernel_version="?.??"; _k_verc_fail=yes;;
2572 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2573 _k_verc_problem=yes;;
2574 esac
2575 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2576 _k_verc_fail=yes
2578 if test "$_k_verc_fail" ; then
2579 echores "$kernel_version, fail"
2580 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2581 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2582 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2583 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2584 echo "2.2.x you must upgrade it to get SSE support!"
2585 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2586 else
2587 echores "$kernel_version, ok"
2591 ######################
2592 # MAIN TESTS GO HERE #
2593 ######################
2596 echocheck "-lposix"
2597 cat > $TMPC <<EOF
2598 int main(void) { return 0; }
2600 if cc_check -lposix ; then
2601 _ld_extra="$_ld_extra -lposix"
2602 echores "yes"
2603 else
2604 echores "no"
2607 echocheck "-lm"
2608 cat > $TMPC <<EOF
2609 int main(void) { return 0; }
2611 if cc_check -lm ; then
2612 _ld_lm="-lm"
2613 echores "yes"
2614 else
2615 _ld_lm=""
2616 echores "no"
2620 echocheck "langinfo"
2621 if test "$_langinfo" = auto ; then
2622 cat > $TMPC <<EOF
2623 #include <langinfo.h>
2624 int main(void) { nl_langinfo(CODESET); return 0; }
2626 _langinfo=no
2627 cc_check && _langinfo=yes
2629 if test "$_langinfo" = yes ; then
2630 _def_langinfo='#define USE_LANGINFO 1'
2631 else
2632 _def_langinfo='#undef USE_LANGINFO'
2634 echores "$_langinfo"
2637 echocheck "language"
2638 test -z "$_language" && _language=$LINGUAS
2639 _language=`echo $_language | sed 's/,/ /g'`
2640 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2641 for lang in $_language ; do
2642 test "$lang" = all && lang=en
2643 if test -f "help/help_mp-${lang}.h" ; then
2644 _language=$lang
2645 break
2646 else
2647 echo ${_echo_n} "$lang not found, ${_echo_c}"
2648 _language=`echo $_language | sed "s/$lang *//"`
2650 done
2651 test -z "$_language" && _language=en
2652 _mp_help="help/help_mp-${_language}.h"
2653 test -f $_mp_help || die "$_mp_help not found"
2654 for lang in $LANGUAGES ; do
2655 if test -f "DOCS/man/$lang/mplayer.1" ; then
2656 MAN_LANG="$lang $MAN_LANG"
2658 done
2659 _doc_lang=$_language
2660 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2661 echores "using $_language (man pages: $MAN_LANG)"
2664 echocheck "enable sighandler"
2665 if test "$_sighandler" = yes ; then
2666 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2667 else
2668 _def_sighandler='#undef ENABLE_SIGHANDLER'
2670 echores "$_sighandler"
2672 echocheck "runtime cpudetection"
2673 if test "$_runtime_cpudetection" = yes ; then
2674 _optimizing="Runtime CPU-Detection enabled"
2675 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2676 else
2677 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2679 echores "$_runtime_cpudetection"
2682 echocheck "restrict keyword"
2683 for restrict_keyword in restrict __restrict __restrict__ ; do
2684 echo "void foo(char * $restrict_keyword p); int main(void){}" > $TMPC
2685 if cc_check; then
2686 _def_restrict_keyword=$restrict_keyword
2687 break;
2689 done
2690 if [ -n "$_def_restrict_keyword" ]; then
2691 echores "$_def_restrict_keyword"
2692 else
2693 echores "none"
2695 # Avoid infinite recursion loop ("#define restrict restrict")
2696 if [ "$_def_restrict_keyword" != "restrict" ]; then
2697 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2698 else
2699 _def_restrict_keyword=""
2703 echocheck "__builtin_expect"
2704 # GCC branch prediction hint
2705 cat > $TMPC << EOF
2706 int foo (int a) {
2707 a = __builtin_expect (a, 10);
2708 return a == 10 ? 0 : 1;
2710 int main(void) { return foo(10) && foo(0); }
2712 _builtin_expect=no
2713 cc_check && _builtin_expect=yes
2714 if test "$_builtin_expect" = yes ; then
2715 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2716 else
2717 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2719 echores "$_builtin_expect"
2722 echocheck "kstat"
2723 cat > $TMPC << EOF
2724 #include <kstat.h>
2725 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2727 _kstat=no
2728 cc_check -lkstat && _kstat=yes
2729 if test "$_kstat" = yes ; then
2730 _def_kstat="#define HAVE_LIBKSTAT 1"
2731 _ld_extra="$_ld_extra -lkstat"
2732 else
2733 _def_kstat="#undef HAVE_LIBKSTAT"
2735 echores "$_kstat"
2738 echocheck "posix4"
2739 # required for nanosleep on some systems
2740 cat > $TMPC << EOF
2741 #include <time.h>
2742 int main(void) { (void) nanosleep(0, 0); return 0; }
2744 _posix4=no
2745 cc_check -lposix4 && _posix4=yes
2746 if test "$_posix4" = yes ; then
2747 _ld_extra="$_ld_extra -lposix4"
2749 echores "$_posix4"
2751 echocheck "lrintf"
2752 cat > $TMPC << EOF
2753 #include <math.h>
2754 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2756 _lrintf=no
2757 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2758 if test "$_lrintf" = yes ; then
2759 _def_lrintf="#define HAVE_LRINTF 1"
2760 else
2761 _def_lrintf="#undef HAVE_LRINTF"
2763 echores "$_lrintf"
2766 echocheck "mkstemp"
2767 cat > $TMPC << EOF
2768 #include <stdlib.h>
2769 int main(void) { char a; mkstemp(&a); return 0; }
2771 _mkstemp=no
2772 cc_check && _mkstemp=yes
2773 if test "$_mkstemp" = yes ; then
2774 _def_mkstemp='#define HAVE_MKSTEMP 1'
2775 else
2776 _def_mkstemp='#undef HAVE_MKSTEMP'
2778 echores "$_mkstemp"
2781 echocheck "nanosleep"
2782 # also check for nanosleep
2783 cat > $TMPC << EOF
2784 #include <time.h>
2785 int main(void) { (void) nanosleep(0, 0); return 0; }
2787 _nanosleep=no
2788 cc_check && _nanosleep=yes
2789 if test "$_nanosleep" = yes ; then
2790 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2791 else
2792 _def_nanosleep='#undef HAVE_NANOSLEEP'
2794 echores "$_nanosleep"
2797 echocheck "socklib"
2798 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2799 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2800 cat > $TMPC << EOF
2801 #include <netdb.h>
2802 #include <sys/socket.h>
2803 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2805 _socklib=no
2806 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2807 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2808 done
2809 if test $_winsock2 = auto && ! cygwin ; then
2810 _winsock2=no
2811 cat > $TMPC << EOF
2812 #include <winsock2.h>
2813 int main(void) { (void) gethostbyname(0); return 0; }
2815 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2817 test "$_ld_sock" && _res_comment="using $_ld_sock"
2818 echores "$_socklib"
2821 if test $_winsock2 = yes ; then
2822 _ld_sock="-lws2_32"
2823 _def_winsock2='#define HAVE_WINSOCK2 1'
2824 else
2825 _def_winsock2='#undef HAVE_WINSOCK2'
2829 _use_aton=no
2830 echocheck "inet_pton()"
2831 cat > $TMPC << EOF
2832 #include <sys/types.h>
2833 #include <sys/socket.h>
2834 #include <arpa/inet.h>
2835 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2837 if test "$_winsock2" = yes ; then
2838 _res_comment="using winsock2 functions instead"
2839 echores "no"
2840 elif cc_check $_ld_sock ; then
2841 # NOTE: Linux has libresolv but does not need it
2843 _res_comment="using $_ld_sock"
2844 echores "yes"
2845 elif cc_check $_ld_sock -lresolv ; then
2846 # NOTE: needed for SunOS at least
2847 _ld_sock="$_ld_sock -lresolv"
2848 _res_comment="using $_ld_sock"
2849 echores "yes"
2850 else
2851 _res_comment="trying inet_aton next"
2852 echores "no"
2854 echocheck "inet_aton()"
2855 cat > $TMPC << EOF
2856 #include <sys/types.h>
2857 #include <sys/socket.h>
2858 #include <arpa/inet.h>
2859 int main(void) { (void) inet_aton(0, 0); return 0; }
2861 _use_aton=yes
2862 if cc_check $_ld_sock ; then
2863 # NOTE: Linux has libresolv but does not need it
2865 _res_comment="using $_ld_sock"
2866 elif cc_check $_ld_sock -lresolv ; then
2867 # NOTE: needed for SunOS at least
2868 _ld_sock="$_ld_sock -lresolv"
2869 _res_comment="using $_ld_sock"
2870 else
2871 _use_aton=no
2872 _network=no
2873 _res_comment="network support disabled"
2875 echores "$_use_aton"
2878 _def_use_aton='#undef USE_ATON'
2879 if test "$_use_aton" = yes; then
2880 _def_use_aton='#define USE_ATON 1'
2883 echocheck "network"
2884 # FIXME network check
2885 if test "$_network" = yes ; then
2886 _def_network='#define MPLAYER_NETWORK 1'
2887 _ld_extra="$_ld_extra $_ld_sock"
2888 _inputmodules="network $_inputmodules"
2889 else
2890 _noinputmodules="network $_noinputmodules"
2891 _def_network='#undef MPLAYER_NETWORK'
2892 _ftp=no
2894 echores "$_network"
2896 echocheck "inttypes.h (required)"
2897 cat > $TMPC << EOF
2898 #include <inttypes.h>
2899 int main(void) { return 0; }
2901 _inttypes=no
2902 cc_check && _inttypes=yes
2903 echores "$_inttypes"
2905 if test "$_inttypes" = no ; then
2906 echocheck "bitypes.h (inttypes.h predecessor)"
2907 cat > $TMPC << EOF
2908 #include <sys/bitypes.h>
2909 int main(void) { return 0; }
2911 cc_check && _inttypes=yes
2912 if test "$_inttypes" = yes ; then
2913 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."
2914 else
2915 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2920 echocheck "int_fastXY_t in inttypes.h"
2921 cat > $TMPC << EOF
2922 #include <inttypes.h>
2923 int main(void) {
2924 volatile int_fast16_t v= 0;
2925 return v; }
2927 _fast_inttypes=no
2928 cc_check && _fast_inttypes=yes
2929 if test "$_fast_inttypes" = yes ; then
2930 # nothing to do
2932 else
2933 _def_fast_inttypes='
2934 typedef signed char int_fast8_t;
2935 typedef signed int int_fast16_t;
2936 typedef signed int int_fast32_t;
2937 typedef signed long long int_fast64_t;
2938 typedef unsigned char uint_fast8_t;
2939 typedef unsigned int uint_fast16_t;
2940 typedef unsigned int uint_fast32_t;
2941 typedef unsigned long long uint_fast64_t;'
2943 echores "$_fast_inttypes"
2946 echocheck "word size"
2947 _mp_wordsize="#undef MP_WORDSIZE"
2948 cat > $TMPC << EOF
2949 #include <stdio.h>
2950 #include <sys/types.h>
2951 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2953 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2954 echores "$_wordsize"
2957 echocheck "malloc.h"
2958 cat > $TMPC << EOF
2959 #include <malloc.h>
2960 int main(void) { (void) malloc(0); return 0; }
2962 _malloc=no
2963 cc_check && _malloc=yes
2964 if test "$_malloc" = yes ; then
2965 _def_malloc='#define HAVE_MALLOC_H 1'
2966 else
2967 _def_malloc='#undef HAVE_MALLOC_H'
2969 # malloc.h emits a warning in FreeBSD and OpenBSD
2970 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2971 echores "$_malloc"
2974 echocheck "memalign()"
2975 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2976 cat > $TMPC << EOF
2977 #include <malloc.h>
2978 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2980 _memalign=no
2981 cc_check && _memalign=yes
2982 if test "$_memalign" = yes ; then
2983 _def_memalign='#define HAVE_MEMALIGN 1'
2984 else
2985 _def_memalign='#undef HAVE_MEMALIGN'
2986 _def_map_memalign='#define memalign(a,b) malloc(b)'
2987 darwin || _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2989 echores "$_memalign"
2992 echocheck "alloca.h"
2993 cat > $TMPC << EOF
2994 #include <alloca.h>
2995 int main(void) { (void) alloca(0); return 0; }
2997 _alloca=no
2998 cc_check && _alloca=yes
2999 if cc_check ; then
3000 _def_alloca='#define HAVE_ALLOCA_H 1'
3001 else
3002 _def_alloca='#undef HAVE_ALLOCA_H'
3004 echores "$_alloca"
3007 echocheck "mman.h"
3008 cat > $TMPC << EOF
3009 #include <sys/types.h>
3010 #include <sys/mman.h>
3011 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3013 _mman=no
3014 cc_check && _mman=yes
3015 if test "$_mman" = yes ; then
3016 _def_mman='#define HAVE_SYS_MMAN_H 1'
3017 else
3018 _def_mman='#undef HAVE_SYS_MMAN_H'
3020 echores "$_mman"
3022 cat > $TMPC << EOF
3023 #include <sys/types.h>
3024 #include <sys/mman.h>
3025 int main(void) { void *p = MAP_FAILED; return 0; }
3027 _mman_has_map_failed=no
3028 cc_check && _mman_has_map_failed=yes
3029 if test "$_mman_has_map_failed" = yes ; then
3030 _def_mman_has_map_failed=''
3031 else
3032 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3035 echocheck "dynamic loader"
3036 cat > $TMPC << EOF
3037 #include <dlfcn.h>
3038 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3040 _dl=no
3041 for _ld_tmp in "" "-ldl" ; do
3042 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3043 done
3044 if test "$_dl" = yes ; then
3045 _def_dl='#define HAVE_LIBDL 1'
3046 else
3047 _def_dl='#undef HAVE_LIBDL'
3049 echores "$_dl"
3052 echocheck "dynamic a/v plugins support"
3053 if test "$_dl" = no ; then
3054 _dynamic_plugins=no
3056 if test "$_dynamic_plugins" = yes ; then
3057 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3058 else
3059 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3061 echores "$_dynamic_plugins"
3064 _def_threads='#undef HAVE_THREADS'
3066 echocheck "pthread"
3067 if test "$_pthreads" = auto ; then
3068 cat > $TMPC << EOF
3069 #include <pthread.h>
3070 void* func(void *arg) { return arg; }
3071 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3073 _pthreads=no
3074 if ! hpux ; then
3075 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3076 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3077 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3078 done
3081 if test "$_pthreads" = yes ; then
3082 _res_comment="using $_ld_pthread"
3083 _def_pthreads='#define HAVE_PTHREADS 1'
3084 _def_threads='#define HAVE_THREADS 1'
3085 else
3086 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3087 _def_pthreads='#undef HAVE_PTHREADS'
3088 _nas=no ; _tv_v4l1=no ; _macosx=no
3089 mingw32 || _win32dll=no
3091 echores "$_pthreads"
3093 echocheck "w32threads"
3094 if test "$_pthreads" = yes ; then
3095 _res_comment="using pthread instead"
3096 _w32threads=no
3098 if test "$_w32threads" = auto ; then
3099 _w32threads=no
3100 mingw32 && _w32threads=yes
3102 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3103 echores "$_w32threads"
3105 echocheck "rpath"
3106 netbsd &&_rpath=yes
3107 if test "$_rpath" = yes ; then
3108 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3109 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3110 done
3111 _ld_extra=$tmp
3113 echores "$_rpath"
3115 echocheck "iconv"
3116 if test "$_iconv" = auto ; then
3117 cat > $TMPC << EOF
3118 #include <stdio.h>
3119 #include <unistd.h>
3120 #include <iconv.h>
3121 #define INBUFSIZE 1024
3122 #define OUTBUFSIZE 4096
3124 char inbuffer[INBUFSIZE];
3125 char outbuffer[OUTBUFSIZE];
3127 int main(void) {
3128 size_t numread;
3129 iconv_t icdsc;
3130 char *tocode="UTF-8";
3131 char *fromcode="cp1250";
3132 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3133 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3134 char *iptr=inbuffer;
3135 char *optr=outbuffer;
3136 size_t inleft=numread;
3137 size_t outleft=OUTBUFSIZE;
3138 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3139 != (size_t)(-1)) {
3140 write (1, outbuffer, OUTBUFSIZE - outleft);
3143 if (iconv_close(icdsc) == -1)
3148 _iconv=no
3149 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3150 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3151 _iconv=yes && break
3152 done
3154 if test "$_iconv" = yes ; then
3155 _def_iconv='#define USE_ICONV 1'
3156 else
3157 _def_iconv='#undef USE_ICONV'
3159 echores "$_iconv"
3162 echocheck "soundcard.h"
3163 _soundcard_h=no
3164 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3165 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3166 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3167 cat > $TMPC << EOF
3168 #include <$_soundcard_header>
3169 int main(void) { return 0; }
3171 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3172 done
3174 if test "$_soundcard_h" = yes ; then
3175 if test $_soundcard_header = "sys/soundcard.h"; then
3176 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3177 else
3178 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3181 echores "$_soundcard_h"
3184 echocheck "sys/dvdio.h"
3185 cat > $TMPC << EOF
3186 #include <unistd.h>
3187 #include <sys/dvdio.h>
3188 int main(void) { return 0; }
3190 _dvdio=no
3191 cc_check && _dvdio=yes
3192 if test "$_dvdio" = yes ; then
3193 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3194 else
3195 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3197 echores "$_dvdio"
3200 echocheck "sys/cdio.h"
3201 cat > $TMPC << EOF
3202 #include <unistd.h>
3203 #include <sys/cdio.h>
3204 int main(void) { return 0; }
3206 _cdio=no
3207 cc_check && _cdio=yes
3208 if test "$_cdio" = yes ; then
3209 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3210 else
3211 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3213 echores "$_cdio"
3216 echocheck "linux/cdrom.h"
3217 cat > $TMPC << EOF
3218 #include <sys/types.h>
3219 #include <linux/cdrom.h>
3220 int main(void) { return 0; }
3222 _cdrom=no
3223 cc_check && _cdrom=yes
3224 if test "$_cdrom" = yes ; then
3225 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3226 else
3227 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3229 echores "$_cdrom"
3232 echocheck "dvd.h"
3233 cat > $TMPC << EOF
3234 #include <dvd.h>
3235 int main(void) { return 0; }
3237 _dvd=no
3238 cc_check && _dvd=yes
3239 if test "$_dvd" = yes ; then
3240 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3241 else
3242 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3244 echores "$_dvd"
3247 if bsdos; then
3248 echocheck "BSDI dvd.h"
3249 cat > $TMPC << EOF
3250 #include <dvd.h>
3251 int main(void) { return 0; }
3253 _bsdi_dvd=no
3254 cc_check && _bsdi_dvd=yes
3255 if test "$_bsdi_dvd" = yes ; then
3256 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3257 else
3258 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3260 echores "$_bsdi_dvd"
3261 fi #if bsdos
3264 if hpux; then
3265 # also used by AIX, but AIX does not support VCD and/or libdvdread
3266 echocheck "HP-UX SCSI header"
3267 cat > $TMPC << EOF
3268 #include <sys/scsi.h>
3269 int main(void) { return 0; }
3271 _hpux_scsi_h=no
3272 cc_check && _hpux_scsi_h=yes
3273 if test "$_hpux_scsi_h" = yes ; then
3274 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3275 else
3276 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3278 echores "$_hpux_scsi_h"
3279 fi #if hpux
3282 if sunos; then
3283 echocheck "userspace SCSI headers (Solaris)"
3284 cat > $TMPC << EOF
3285 # include <unistd.h>
3286 # include <stropts.h>
3287 # include <sys/scsi/scsi_types.h>
3288 # include <sys/scsi/impl/uscsi.h>
3289 int main(void) { return 0; }
3291 _sol_scsi_h=no
3292 cc_check && _sol_scsi_h=yes
3293 if test "$_sol_scsi_h" = yes ; then
3294 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3295 else
3296 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3298 echores "$_sol_scsi_h"
3299 fi #if sunos
3302 echocheck "termcap"
3303 if test "$_termcap" = auto ; then
3304 cat > $TMPC <<EOF
3305 int main(void) { tgetent(); return 0; }
3307 _termcap=no
3308 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3309 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3310 && _termcap=yes && break
3311 done
3313 if test "$_termcap" = yes ; then
3314 _def_termcap='#define USE_TERMCAP 1'
3315 _res_comment="using $_ld_tmp"
3316 else
3317 _def_termcap='#undef USE_TERMCAP'
3319 echores "$_termcap"
3322 echocheck "termios"
3323 _def_termios='#undef HAVE_TERMIOS'
3324 _def_termios_h='#undef HAVE_TERMIOS_H'
3325 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3326 if test "$_termios" = auto ; then
3327 _termios=no
3328 for _termios_header in "sys/termios.h" "termios.h"; do
3329 cat > $TMPC <<EOF
3330 #include <$_termios_header>
3331 int main(void) { return 0; }
3333 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3334 done
3337 if test "$_termios" = yes ; then
3338 _def_termios='#define HAVE_TERMIOS 1'
3339 if test "$_termios_header" = "termios.h" ; then
3340 _def_termios_h='#define HAVE_TERMIOS_H 1'
3341 else
3342 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3345 echores "$_termios"
3348 echocheck "shm"
3349 if test "$_shm" = auto ; then
3350 cat > $TMPC << EOF
3351 #include <sys/types.h>
3352 #include <sys/shm.h>
3353 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3355 _shm=no
3356 cc_check && _shm=yes
3358 if test "$_shm" = yes ; then
3359 _def_shm='#define HAVE_SHM 1'
3360 else
3361 _def_shm='#undef HAVE_SHM'
3363 echores "$_shm"
3366 echocheck "strsep()"
3367 cat > $TMPC << EOF
3368 #include <string.h>
3369 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3371 _strsep=no
3372 cc_check && _strsep=yes
3373 if test "$_strsep" = yes ; then
3374 _def_strsep='#define HAVE_STRSEP 1'
3375 _need_strsep=no
3376 else
3377 _def_strsep='#undef HAVE_STRSEP'
3378 _need_strsep=yes
3380 echores "$_strsep"
3383 echocheck "vsscanf()"
3384 cat > $TMPC << EOF
3385 #include <stdarg.h>
3386 int main(void) { vsscanf(0, 0, 0); return 0; }
3388 _vsscanf=no
3389 cc_check && _vsscanf=yes
3390 if test "$_vsscanf" = yes ; then
3391 _def_vsscanf='#define HAVE_VSSCANF 1'
3392 _need_vsscanf=no
3393 else
3394 _def_vsscanf='#undef HAVE_VSSCANF'
3395 _need_vsscanf=yes
3397 echores "$_vsscanf"
3400 echocheck "swab()"
3401 cat > $TMPC << EOF
3402 #include <unistd.h>
3403 int main(void) { swab(0, 0, 0); return 0; }
3405 _swab=no
3406 cc_check && _swab=yes
3407 if test "$_swab" = yes ; then
3408 _def_swab='#define HAVE_SWAB 1'
3409 _need_swab=no
3410 else
3411 _def_swab='#undef HAVE_SWAB'
3412 _need_swab=yes
3414 echores "$_swab"
3416 echocheck "POSIX select()"
3417 cat > $TMPC << EOF
3418 #include <stdio.h>
3419 #include <stdlib.h>
3420 #include <sys/types.h>
3421 #include <string.h>
3422 #include <sys/time.h>
3423 #include <unistd.h>
3424 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3426 _posix_select=no
3427 _def_posix_select='#undef HAVE_POSIX_SELECT'
3428 cc_check && _posix_select=yes \
3429 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3430 echores "$_posix_select"
3433 echocheck "gettimeofday()"
3434 cat > $TMPC << EOF
3435 #include <stdio.h>
3436 #include <sys/time.h>
3437 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3439 _gettimeofday=no
3440 cc_check && _gettimeofday=yes
3441 if test "$_gettimeofday" = yes ; then
3442 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3443 _need_gettimeofday=no
3444 else
3445 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3446 _need_gettimeofday=yes
3448 echores "$_gettimeofday"
3451 echocheck "glob()"
3452 cat > $TMPC << EOF
3453 #include <stdio.h>
3454 #include <glob.h>
3455 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3457 _glob=no
3458 cc_check && _glob=yes
3459 if test "$_glob" = yes ; then
3460 _def_glob='#define HAVE_GLOB 1'
3461 _need_glob=no
3462 else
3463 _def_glob='#undef HAVE_GLOB'
3464 _need_glob=yes
3466 echores "$_glob"
3469 echocheck "setenv()"
3470 cat > $TMPC << EOF
3471 #include <stdlib.h>
3472 int main (void){ setenv("","",0); return 0; }
3474 _setenv=no
3475 cc_check && _setenv=yes
3476 if test "$_setenv" = yes ; then
3477 _def_setenv='#define HAVE_SETENV 1'
3478 _need_setenv=no
3479 else
3480 _def_setenv='#undef HAVE_SETENV'
3481 _need_setenv=yes
3483 echores "$_setenv"
3486 if sunos; then
3487 echocheck "sysi86()"
3488 cat > $TMPC << EOF
3489 #include <sys/sysi86.h>
3490 int main (void) { sysi86(0); return 0; }
3492 _sysi86=no
3493 cc_check && _sysi86=yes
3494 if test "$_sysi86" = yes ; then
3495 _def_sysi86='#define HAVE_SYSI86 1'
3496 cat > $TMPC << EOF
3497 #include <sys/sysi86.h>
3498 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3500 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3501 else
3502 _def_sysi86='#undef HAVE_SYSI86'
3504 echores "$_sysi86"
3505 fi #if sunos
3508 echocheck "sys/sysinfo.h"
3509 cat > $TMPC << EOF
3510 #include <sys/sysinfo.h>
3511 int main(void) {
3512 struct sysinfo s_info;
3513 sysinfo(&s_info);
3514 return 0;
3517 _sys_sysinfo=no
3518 cc_check && _sys_sysinfo=yes
3519 if test "$_sys_sysinfo" = yes ; then
3520 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3521 else
3522 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3524 echores "$_sys_sysinfo"
3527 if darwin; then
3529 echocheck "Mac OS X APIs"
3530 if test "$_macosx" = auto ; then
3531 productName=`/usr/bin/sw_vers -productName`
3532 if test "$productName" = "Mac OS X" ||
3533 test "$productName" = "Mac OS X Server" ; then
3534 _macosx=yes
3535 else
3536 _macosx=no
3537 _def_macosx='#undef MACOSX'
3538 _noaomodules="macosx $_noaomodules"
3539 _novomodules="quartz $_novomodules"
3542 if test "$_macosx" = yes ; then
3543 cat > $TMPC <<EOF
3544 #include <Carbon/Carbon.h>
3545 #include <QuickTime/QuickTime.h>
3546 #include <CoreAudio/CoreAudio.h>
3547 int main(void) {
3548 EnterMovies();
3549 ExitMovies();
3550 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3553 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3554 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3555 _def_macosx='#define MACOSX 1'
3556 _aosrc="$_aosrc ao_macosx.c"
3557 _aomodules="macosx $_aomodules"
3558 _vosrc="$_vosrc vo_quartz.c"
3559 _vomodules="quartz $_vomodules"
3560 else
3561 _macosx=no
3562 _def_macosx='#undef MACOSX'
3563 _noaomodules="macosx $_noaomodules"
3564 _novomodules="quartz $_novomodules"
3566 cat > $TMPC <<EOF
3567 #include <Carbon/Carbon.h>
3568 #include <QuartzCore/CoreVideo.h>
3569 int main(void) {}
3571 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3572 _vosrc="$_vosrc vo_macosx.m"
3573 _vomodules="macosx $_vomodules"
3574 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3575 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3576 _macosx_corevideo=yes
3577 else
3578 _novomodules="macosx $_novomodules"
3579 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3580 _macosx_corevideo=no
3583 echores "$_macosx"
3585 echocheck "Mac OS X Finder Support"
3586 if test "$_macosx_finder_support" = auto ; then
3587 _macosx_finder_support=$_macosx
3589 if test "$_macosx_finder_support" = yes; then
3590 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3591 _macosx_finder_support=yes
3592 else
3593 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3594 _macosx_finder_support=no
3596 echores "$_macosx_finder_support"
3598 echocheck "Mac OS X Bundle file locations"
3599 if test "$_macosx_bundle" = auto ; then
3600 _macosx_bundle=$_macosx_finder_support
3602 if test "$_macosx_bundle" = yes; then
3603 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3604 else
3605 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3606 _macosx_bundle=no
3608 echores "$_macosx_bundle"
3610 echocheck "Apple Remote"
3611 if test "$_apple_remote" = auto ; then
3612 _apple_remote=no
3613 cat > $TMPC <<EOF
3614 #include <stdio.h>
3615 #include <IOKit/IOCFPlugIn.h>
3616 int main (int argc, const char * argv[])
3618 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3619 CFMutableDictionaryRef hidMatchDictionary;
3620 IOReturn ioReturnValue;
3622 // Set up a matching dictionary to search the I/O Registry by class.
3623 // name for all HID class devices
3624 hidMatchDictionary = IOServiceMatching("AppleIRController");
3626 // Now search I/O Registry for matching devices.
3627 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3628 hidMatchDictionary, &hidObjectIterator);
3630 // If search is unsuccessful, return nonzero.
3631 if (ioReturnValue != kIOReturnSuccess ||
3632 !IOIteratorIsValid(hidObjectIterator)) {
3633 return 1;
3635 return 0;
3638 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3640 if test "$_apple_remote" = yes ; then
3641 _def_apple_remote='#define HAVE_APPLE_REMOTE 1'
3642 _ld_extra="$_ld_extra -framework IOKit"
3643 else
3644 _def_apple_remote='#undef HAVE_APPLE_REMOTE'
3646 echores "$_apple_remote"
3648 fi #if darwin
3651 echocheck "pkg-config"
3652 _pkg_config=pkg-config
3653 if `$_pkg_config --version > /dev/null 2>&1`; then
3654 if test "$_ld_static"; then
3655 _pkg_config="$_pkg_config --static"
3657 echores "yes"
3658 else
3659 _pkg_config=false
3660 echores "no"
3664 echocheck "Samba support (libsmbclient)"
3665 if test "$_smbsupport" = yes; then
3666 _ld_extra="$_ld_extra -lsmbclient"
3668 if test "$_smbsupport" = auto; then
3669 _smbsupport=no
3670 cat > $TMPC << EOF
3671 #include <libsmbclient.h>
3672 int main(void) { smbc_opendir("smb://"); return 0; }
3674 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3675 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3676 _smbsupport=yes && break
3677 done
3680 if test "$_smbsupport" = yes; then
3681 _def_smbsupport="#define LIBSMBCLIENT"
3682 _inputmodules="smb $_inputmodules"
3683 else
3684 _def_smbsupport="#undef LIBSMBCLIENT"
3685 _noinputmodules="smb $_noinputmodules"
3687 echores "$_smbsupport"
3690 #########
3691 # VIDEO #
3692 #########
3695 echocheck "tdfxfb"
3696 if test "$_tdfxfb" = yes ; then
3697 _def_tdfxfb='#define HAVE_TDFXFB 1'
3698 _vosrc="$_vosrc vo_tdfxfb.c"
3699 _vomodules="tdfxfb $_vomodules"
3700 else
3701 _def_tdfxfb='#undef HAVE_TDFXFB'
3702 _novomodules="tdfxfb $_novomodules"
3704 echores "$_tdfxfb"
3706 echocheck "s3fb"
3707 if test "$_s3fb" = yes ; then
3708 _def_s3fb='#define HAVE_S3FB 1'
3709 _vosrc="$_vosrc vo_s3fb.c"
3710 _vomodules="s3fb $_vomodules"
3711 else
3712 _def_s3fb='#undef HAVE_S3FB'
3713 _novomodules="s3fb $_novomodules"
3715 echores "$_s3fb"
3717 echocheck "tdfxvid"
3718 if test "$_tdfxvid" = yes ; then
3719 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3720 _vosrc="$_vosrc vo_tdfx_vid.c"
3721 _vomodules="tdfx_vid $_vomodules"
3722 else
3723 _def_tdfxvid='#undef HAVE_TDFX_VID'
3724 _novomodules="tdfx_vid $_novomodules"
3726 echores "$_tdfxvid"
3728 echocheck "xvr100"
3729 if test "$_xvr100" = auto ; then
3730 cat > $TMPC << EOF
3731 #include <unistd.h>
3732 #include <sys/fbio.h>
3733 #include <sys/visual_io.h>
3734 int main(void) {
3735 struct vis_identifier ident;
3736 struct fbgattr attr;
3738 ioctl(0, VIS_GETIDENTIFIER, &ident);
3739 ioctl(0, FBIOGATTR, &attr);
3742 _xvr100=no
3743 cc_check && _xvr100=yes
3745 if test "$_xvr100" = yes ; then
3746 _def_xvr100='#define HAVE_XVR100 1'
3747 _vosrc="$_vosrc vo_xvr100.c"
3748 _vomodules="xvr100 $_vomodules"
3749 else
3750 _def_tdfxvid='#undef HAVE_XVR100'
3751 _novomodules="xvr100 $_novomodules"
3753 echores "$_xvr100"
3755 echocheck "tga"
3756 if test "$_tga" = yes ; then
3757 _def_tga='#define HAVE_TGA 1'
3758 _vosrc="$_vosrc vo_tga.c"
3759 _vomodules="tga $_vomodules"
3760 else
3761 _def_tga='#undef HAVE_TGA'
3762 _novomodules="tga $_novomodules"
3764 echores "$_tga"
3767 echocheck "md5sum support"
3768 if test "$_md5sum" = yes; then
3769 _def_md5sum="#define HAVE_MD5SUM"
3770 _vosrc="$_vosrc vo_md5sum.c"
3771 _vomodules="md5sum $_vomodules"
3772 else
3773 _def_md5sum="#undef HAVE_MD5SUM"
3774 _novomodules="md5sum $_novomodules"
3776 echores "$_md5sum"
3779 echocheck "bl"
3780 if test "$_bl" = yes ; then
3781 _def_bl='#define HAVE_BL 1'
3782 _vosrc="$_vosrc vo_bl.c"
3783 _vomodules="bl $_vomodules"
3784 else
3785 _def_bl='#undef HAVE_BL'
3786 _novomodules="bl $_novomodules"
3788 echores "$_bl"
3791 echocheck "DirectFB"
3792 if test "$_directfb" = auto ; then
3793 _directfb=no
3794 cat > $TMPC <<EOF
3795 #include <directfb.h>
3796 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3798 for _inc_tmp in "" -I/usr/local/include/directfb \
3799 -I/usr/include/directfb -I/usr/local/include; do
3800 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3801 _inc_extra="$_inc_extra $_inc_tmp" && break
3802 done
3805 dfb_version() {
3806 expr $1 \* 65536 + $2 \* 256 + $3
3809 if test "$_directfb" = yes; then
3810 cat > $TMPC << EOF
3811 #include <directfb_version.h>
3813 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3816 if $_cc -E $TMPC $_inc_extra > "$TMPEXE"; then
3817 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'`
3818 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3819 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3820 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3821 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3822 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3823 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3824 _res_comment="$_directfb_version"
3825 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3826 else
3827 _def_directfb_version='#undef DIRECTFBVERSION'
3828 _directfb=no
3829 _res_comment="version >=0.9.13 required"
3831 else
3832 _directfb=no
3833 _res_comment="failed to get version"
3836 echores "$_directfb"
3838 if test "$_directfb" = yes ; then
3839 _def_directfb='#define HAVE_DIRECTFB 1'
3840 _vosrc="$_vosrc vo_directfb2.c"
3841 _vomodules="directfb $_vomodules"
3842 _libs_mplayer="$_libs_mplayer -ldirectfb"
3843 else
3844 _def_directfb='#undef HAVE_DIRECTFB'
3845 _novomodules="directfb $_novomodules"
3847 if test "$_dfbmga" = yes; then
3848 _vosrc="$_vosrc vo_dfbmga.c"
3849 _vomodules="dfbmga $_vomodules"
3850 _def_dfbmga='#define HAVE_DFBMGA 1'
3851 else
3852 _novomodules="dfbmga $_novomodules"
3853 _def_dfbmga='#undef HAVE_DFBMGA'
3857 echocheck "X11 headers presence"
3858 _x11_headers="no"
3859 _res_comment="check if the dev(el) packages are installed"
3860 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3861 if test -f "$I/X11/Xlib.h" ; then
3862 _x11_headers="yes"
3863 _res_comment=""
3864 break
3866 done
3867 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3868 if test -f "$I/X11/Xlib.h" ; then
3869 _inc_extra="$_inc_extra -I$I"
3870 _x11_headers="yes"
3871 _res_comment="using $I"
3872 break
3874 done
3875 echores "$_x11_headers"
3878 echocheck "X11"
3879 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3880 cat > $TMPC <<EOF
3881 #include <X11/Xlib.h>
3882 #include <X11/Xutil.h>
3883 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3885 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3886 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3887 if netbsd; then
3888 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3889 else
3890 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3892 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3893 && _x11=yes && break
3894 done
3896 if test "$_x11" = yes ; then
3897 _def_x11='#define HAVE_X11 1'
3898 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3899 _vomodules="x11 xover $_vomodules"
3900 else
3901 _x11=no
3902 _def_x11='#undef HAVE_X11'
3903 _novomodules="x11 $_novomodules"
3904 _res_comment="check if the dev(el) packages are installed"
3905 # disable stuff that depends on X
3906 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
3908 echores "$_x11"
3911 echocheck "DPMS"
3912 _xdpms3=no
3913 _xdpms4=no
3914 if test "$_x11" = yes ; then
3915 cat > $TMPC <<EOF
3916 #include <X11/Xmd.h>
3917 #include <X11/Xlib.h>
3918 #include <X11/Xutil.h>
3919 #include <X11/Xatom.h>
3920 #include <X11/extensions/dpms.h>
3921 int main(void) {
3922 (void) DPMSQueryExtension(0, 0, 0);
3925 cc_check -lXdpms && _xdpms3=yes
3926 cat > $TMPC <<EOF
3927 #include <X11/Xlib.h>
3928 #include <X11/extensions/dpms.h>
3929 int main(void) {
3930 (void) DPMSQueryExtension(0, 0, 0);
3933 cc_check -lXext && _xdpms4=yes
3935 if test "$_xdpms4" = yes ; then
3936 _def_xdpms='#define HAVE_XDPMS 1'
3937 _res_comment="using Xdpms 4"
3938 echores "yes"
3939 elif test "$_xdpms3" = yes ; then
3940 _def_xdpms='#define HAVE_XDPMS 1'
3941 _libs_mplayer="$_libs_mplayer -lXdpms"
3942 _res_comment="using Xdpms 3"
3943 echores "yes"
3944 else
3945 _def_xdpms='#undef HAVE_XDPMS'
3946 echores "no"
3950 echocheck "Xv"
3951 if test "$_xv" = auto ; then
3952 cat > $TMPC <<EOF
3953 #include <X11/Xlib.h>
3954 #include <X11/extensions/Xvlib.h>
3955 int main(void) {
3956 (void) XvGetPortAttribute(0, 0, 0, 0);
3957 (void) XvQueryPortAttributes(0, 0, 0);
3958 return 0; }
3960 _xv=no
3961 cc_check -lXv && _xv=yes
3964 if test "$_xv" = yes ; then
3965 _def_xv='#define HAVE_XV 1'
3966 _libs_mplayer="$_libs_mplayer -lXv"
3967 _vosrc="$_vosrc vo_xv.c"
3968 _vomodules="xv $_vomodules"
3969 else
3970 _def_xv='#undef HAVE_XV'
3971 _novomodules="xv $_novomodules"
3973 echores "$_xv"
3976 echocheck "XvMC"
3977 if test "$_xv" = yes && test "$_xvmc" != no ; then
3978 _xvmc=no
3979 cat > $TMPC <<EOF
3980 #include <X11/Xlib.h>
3981 #include <X11/extensions/Xvlib.h>
3982 #include <X11/extensions/XvMClib.h>
3983 int main(void) {
3984 (void) XvMCQueryExtension(0,0,0);
3985 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3986 return 0; }
3988 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3989 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3990 done
3992 if test "$_xvmc" = yes ; then
3993 _def_xvmc='#define HAVE_XVMC 1'
3994 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
3995 _vosrc="$_vosrc vo_xvmc.c"
3996 _vomodules="xvmc $_vomodules"
3997 _res_comment="using $_xvmclib"
3998 else
3999 _def_xvmc='#undef HAVE_XVMC'
4000 _novomodules="xvmc $_novomodules"
4001 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4003 echores "$_xvmc"
4006 echocheck "Xinerama"
4007 if test "$_xinerama" = auto ; then
4008 cat > $TMPC <<EOF
4009 #include <X11/Xlib.h>
4010 #include <X11/extensions/Xinerama.h>
4011 int main(void) { (void) XineramaIsActive(0); return 0; }
4013 _xinerama=no
4014 cc_check -lXinerama && _xinerama=yes
4017 if test "$_xinerama" = yes ; then
4018 _def_xinerama='#define HAVE_XINERAMA 1'
4019 _libs_mplayer="$_libs_mplayer -lXinerama"
4020 else
4021 _def_xinerama='#undef HAVE_XINERAMA'
4023 echores "$_xinerama"
4026 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4027 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4028 # named 'X extensions' or something similar.
4029 # This check may be useful for future mplayer versions (to change resolution)
4030 # If you run into problems, remove '-lXxf86vm'.
4031 echocheck "Xxf86vm"
4032 if test "$_vm" = auto ; then
4033 cat > $TMPC <<EOF
4034 #include <X11/Xlib.h>
4035 #include <X11/extensions/xf86vmode.h>
4036 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4038 _vm=no
4039 cc_check -lXxf86vm && _vm=yes
4041 if test "$_vm" = yes ; then
4042 _def_vm='#define HAVE_XF86VM 1'
4043 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4044 else
4045 _def_vm='#undef HAVE_XF86VM'
4047 echores "$_vm"
4049 # Check for the presence of special keycodes, like audio control buttons
4050 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4051 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4052 # have these new keycodes.
4053 echocheck "XF86keysym"
4054 if test "$_xf86keysym" = auto; then
4055 _xf86keysym=no
4056 cat > $TMPC <<EOF
4057 #include <X11/Xlib.h>
4058 #include <X11/XF86keysym.h>
4059 int main(void) { return XF86XK_AudioPause; }
4061 cc_check && _xf86keysym=yes
4063 if test "$_xf86keysym" = yes ; then
4064 _def_xf86keysym='#define HAVE_XF86XK 1'
4065 else
4066 _def_xf86keysym='#undef HAVE_XF86XK'
4068 echores "$_xf86keysym"
4070 echocheck "DGA"
4071 if test "$_dga2" = auto && test "$_x11" = yes ; then
4072 cat > $TMPC << EOF
4073 #include <X11/Xlib.h>
4074 #include <X11/extensions/xf86dga.h>
4075 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4077 _dga2=no
4078 cc_check -lXxf86dga && _dga2=yes
4080 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4081 cat > $TMPC << EOF
4082 #include <X11/Xlib.h>
4083 #include <X11/extensions/xf86dga.h>
4084 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4086 _dga1=no
4087 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4090 _dga=no
4091 _def_dga='#undef HAVE_DGA'
4092 _def_dga1='#undef HAVE_DGA1'
4093 _def_dga2='#undef HAVE_DGA2'
4094 if test "$_dga1" = yes ; then
4095 _dga=yes
4096 _def_dga1='#define HAVE_DGA1 1'
4097 _res_comment="using DGA 1.0"
4098 elif test "$_dga2" = yes ; then
4099 _dga=yes
4100 _def_dga2='#define HAVE_DGA2 1'
4101 _res_comment="using DGA 2.0"
4103 if test "$_dga" = yes ; then
4104 _def_dga='#define HAVE_DGA 1'
4105 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4106 _vosrc="$_vosrc vo_dga.c"
4107 _vomodules="dga $_vomodules"
4108 else
4109 _novomodules="dga $_novomodules"
4111 echores "$_dga"
4114 echocheck "3dfx"
4115 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4116 _def_3dfx='#define HAVE_3DFX 1'
4117 _vosrc="$_vosrc vo_3dfx.c"
4118 _vomodules="3dfx $_vomodules"
4119 else
4120 _def_3dfx='#undef HAVE_3DFX'
4121 _novomodules="3dfx $_novomodules"
4123 echores "$_3dfx"
4126 echocheck "OpenGL"
4127 #Note: this test is run even with --enable-gl since we autodetect linker flags
4128 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4129 cat > $TMPC << EOF
4130 #include <GL/gl.h>
4131 #ifdef GL_WIN32
4132 #include <windows.h>
4133 #include <GL/glext.h>
4134 #else
4135 #include <X11/Xlib.h>
4136 #include <GL/glx.h>
4137 #endif
4138 int main(void) {
4139 #ifdef GL_WIN32
4140 HDC dc;
4141 wglCreateContext(dc);
4142 #else
4143 glXCreateContext(NULL, NULL, NULL, True);
4144 #endif
4145 glFinish();
4146 return 0;
4149 _gl=no
4150 if cc_check -lGL $_ld_lm ; then
4151 _gl=yes
4152 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4153 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4154 _gl=yes
4155 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4156 elif cc_check -DGL_WIN32 -lopengl32 ; then
4157 _gl=yes
4158 _gl_win32=yes
4159 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4161 else
4162 _gl=no
4164 if test "$_gl" = yes ; then
4165 _def_gl='#define HAVE_GL 1'
4166 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4167 if test "$_gl_win32" = yes ; then
4168 _def_gl_win32='#define GL_WIN32 1'
4169 _vosrc="$_vosrc w32_common.c"
4170 _res_comment="win32 version"
4172 _vomodules="opengl $_vomodules"
4173 else
4174 _def_gl='#undef HAVE_GL'
4175 _def_gl_win32='#undef GL_WIN32'
4176 _novomodules="opengl $_novomodules"
4178 echores "$_gl"
4181 echocheck "VIDIX"
4182 _vidix=no
4183 _def_vidix='#undef CONFIG_VIDIX'
4184 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4185 _vidix_drv_cyberblade=no
4186 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4187 _vidix_drv_ivtv=no
4188 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4189 _vidix_drv_ivtv=no
4190 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4191 _vidix_drv_mach64=no
4192 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4193 _vidix_drv_mga=no
4194 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4195 _vidix_drv_mga_crtc2=no
4196 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4197 _vidix_drv_nvidia=no
4198 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4199 _vidix_drv_pm2=no
4200 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4201 _vidix_drv_pm3=no
4202 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4203 _vidix_drv_radeon=no
4204 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4205 _vidix_drv_rage128=no
4206 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
4207 _vidix_drv_savage=no
4208 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4209 _vidix_drv_sis=no
4210 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4211 _vidix_drv_unichrome=no
4212 if test "$_vidix_internal" = auto ; then
4213 _vidix_internal=no
4214 x86 && _vidix_internal=yes
4215 ppc && linux && _vidix_internal=yes
4216 alpha && linux && _vidix_internal=yes
4217 qnx || beos || darwin && _vidix_internal=no
4219 if test "$_vidix_internal" = yes; then
4220 _res_comment="internal"
4221 _vidix_external=no
4222 _vidix=yes
4223 elif test "$_vidix_external" = auto; then
4224 _vidix_external=no
4225 cat > $TMPC <<EOF
4226 #include <vidix/vidix.h>
4227 int main(void) { return 0; }
4229 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
4230 && _vidix=yes
4232 echores "$_vidix"
4234 if test "$_vidix" = yes ; then
4235 _def_vidix='#define CONFIG_VIDIX 1'
4236 _vosrc="$_vosrc vo_cvidix.c"
4237 _vomodules="cvidix $_vomodules"
4238 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 savage sis unichrome"
4239 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4241 # some vidix drivers are meant to work on x86 only, discard them elsewhere
4242 x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome//`
4244 for driver in $_vidix_drivers ; do
4245 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4246 eval _vidix_drv_${driver}=yes
4247 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4248 done
4249 else
4250 _novomodules="cvidix $_novomodules"
4253 if test "$_vidix_internal" = yes ; then
4254 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
4255 elif test "$_vidix_external" = yes ; then
4256 _libs_mplayer="$_libs_mplayer -lvidix"
4257 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
4260 if test "$_vidix" = yes && win32; then
4261 _vosrc="$_vosrc vo_winvidix.c"
4262 _vomodules="winvidix $_vomodules"
4263 _libs_mplayer="$_libs_mplayer -lgdi32"
4264 else
4265 _novomodules="winvidix $_novomodules"
4267 if test "$_vidix" = yes && test "$_x11" = yes; then
4268 _vosrc="$_vosrc vo_xvidix.c"
4269 _vomodules="xvidix $_vomodules"
4270 else
4271 _novomodules="xvidix $_novomodules"
4274 echocheck "VIDIX PCI device name database"
4275 echores "$_vidix_pcidb"
4276 if test "$_vidix_pcidb" = yes ; then
4277 _vidix_pcidb_val=1
4278 else
4279 _vidix_pcidb_val=0
4282 echocheck "/dev/mga_vid"
4283 if test "$_mga" = auto ; then
4284 _mga=no
4285 test -c /dev/mga_vid && _mga=yes
4287 if test "$_mga" = yes ; then
4288 _def_mga='#define HAVE_MGA 1'
4289 _vosrc="$_vosrc vo_mga.c"
4290 _vomodules="mga $_vomodules"
4291 else
4292 _def_mga='#undef HAVE_MGA'
4293 _novomodules="mga $_novomodules"
4295 echores "$_mga"
4298 echocheck "xmga"
4299 if test "$_xmga" = auto ; then
4300 _xmga=no
4301 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4303 if test "$_xmga" = yes ; then
4304 _def_xmga='#define HAVE_XMGA 1'
4305 _vosrc="$_vosrc vo_xmga.c"
4306 _vomodules="xmga $_vomodules"
4307 else
4308 _def_xmga='#undef HAVE_XMGA'
4309 _novomodules="xmga $_novomodules"
4311 echores "$_xmga"
4314 echocheck "GGI"
4315 if test "$_ggi" = auto ; then
4316 cat > $TMPC << EOF
4317 #include <ggi/ggi.h>
4318 int main(void) { ggiInit(); return 0; }
4320 _ggi=no
4321 cc_check -lggi && _ggi=yes
4323 if test "$_ggi" = yes ; then
4324 _def_ggi='#define HAVE_GGI 1'
4325 _libs_mplayer="$_libs_mplayer -lggi"
4326 _vosrc="$_vosrc vo_ggi.c"
4327 _vomodules="ggi $_vomodules"
4328 else
4329 _def_ggi='#undef HAVE_GGI'
4330 _novomodules="ggi $_novomodules"
4332 echores "$_ggi"
4334 echocheck "GGI extension: libggiwmh"
4335 if test "$_ggiwmh" = auto ; then
4336 _ggiwmh=no
4337 cat > $TMPC << EOF
4338 #include <ggi/ggi.h>
4339 #include <ggi/wmh.h>
4340 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4342 cc_check -lggi -lggiwmh && _ggiwmh=yes
4344 # needed to get right output on obscure combination
4345 # like --disable-ggi --enable-ggiwmh
4346 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4347 _def_ggiwmh='#define HAVE_GGIWMH 1'
4348 _libs_mplayer="$_libs_mplayer -lggiwmh"
4349 else
4350 _ggiwmh=no
4351 _def_ggiwmh='#undef HAVE_GGIWMH'
4353 echores "$_ggiwmh"
4356 echocheck "AA"
4357 if test "$_aa" = auto ; then
4358 cat > $TMPC << EOF
4359 #include <aalib.h>
4360 extern struct aa_hardware_params aa_defparams;
4361 extern struct aa_renderparams aa_defrenderparams;
4362 int main(void) {
4363 aa_context *c;
4364 aa_renderparams *p;
4365 (void) aa_init(0, 0, 0);
4366 c = aa_autoinit(&aa_defparams);
4367 p = aa_getrenderparams();
4368 aa_autoinitkbd(c,0);
4369 return 0; }
4371 _aa=no
4372 for _ld_tmp in "-laa" ; do
4373 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4374 done
4376 if test "$_aa" = yes ; then
4377 _def_aa='#define HAVE_AA 1'
4378 if cygwin ; then
4379 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4381 _vosrc="$_vosrc vo_aa.c"
4382 _vomodules="aa $_vomodules"
4383 else
4384 _def_aa='#undef HAVE_AA'
4385 _novomodules="aa $_novomodules"
4387 echores "$_aa"
4390 echocheck "CACA"
4391 if test "$_caca" = auto ; then
4392 _caca=no
4393 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4394 cat > $TMPC << EOF
4395 #include <caca.h>
4396 #ifdef CACA_API_VERSION_1
4397 #include <caca0.h>
4398 #endif
4399 int main(void) { (void) caca_init(); return 0; }
4401 cc_check `caca-config --libs` && _caca=yes
4404 if test "$_caca" = yes ; then
4405 _def_caca='#define HAVE_CACA 1'
4406 _inc_extra="$_inc_extra `caca-config --cflags`"
4407 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4408 _vosrc="$_vosrc vo_caca.c"
4409 _vomodules="caca $_vomodules"
4410 else
4411 _def_caca='#undef HAVE_CACA'
4412 _novomodules="caca $_novomodules"
4414 echores "$_caca"
4417 echocheck "SVGAlib"
4418 if test "$_svga" = auto ; then
4419 cat > $TMPC << EOF
4420 #include <vga.h>
4421 int main(void) { return 0; }
4423 _svga=no
4424 cc_check -lvga $_ld_lm && _svga=yes
4426 if test "$_svga" = yes ; then
4427 _def_svga='#define HAVE_SVGALIB 1'
4428 _libs_mplayer="$_libs_mplayer -lvga"
4429 _vosrc="$_vosrc vo_svga.c"
4430 _vomodules="svga $_vomodules"
4431 else
4432 _def_svga='#undef HAVE_SVGALIB'
4433 _novomodules="svga $_novomodules"
4435 echores "$_svga"
4438 echocheck "FBDev"
4439 if test "$_fbdev" = auto ; then
4440 _fbdev=no
4441 linux && _fbdev=yes
4443 if test "$_fbdev" = yes ; then
4444 _def_fbdev='#define HAVE_FBDEV 1'
4445 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4446 _vomodules="fbdev $_vomodules"
4447 else
4448 _def_fbdev='#undef HAVE_FBDEV'
4449 _novomodules="fbdev $_novomodules"
4451 echores "$_fbdev"
4455 echocheck "DVB"
4456 if test "$_dvb" = auto ; then
4457 _dvb=no
4458 cat >$TMPC << EOF
4459 #include <sys/poll.h>
4460 #include <sys/ioctl.h>
4461 #include <stdio.h>
4462 #include <time.h>
4463 #include <unistd.h>
4465 #include <ost/dmx.h>
4466 #include <ost/frontend.h>
4467 #include <ost/sec.h>
4468 #include <ost/video.h>
4469 #include <ost/audio.h>
4470 int main(void) {return 0;}
4472 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4473 cc_check $_inc_tmp && _dvb=yes && \
4474 _inc_extra="$_inc_extra $_inc_tmp" && break
4475 done
4477 echores "$_dvb"
4478 if test "$_dvb" = yes ; then
4479 _def_dvb='#define HAVE_DVB 1'
4480 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4481 _aomodules="mpegpes(dvb) $_aomodules"
4482 _vomodules="mpegpes(dvb) $_vomodules"
4485 echocheck "DVB HEAD"
4486 if test "$_dvbhead" = auto ; then
4487 _dvbhead=no
4489 cat >$TMPC << EOF
4490 #include <sys/poll.h>
4491 #include <sys/ioctl.h>
4492 #include <stdio.h>
4493 #include <time.h>
4494 #include <unistd.h>
4496 #include <linux/dvb/dmx.h>
4497 #include <linux/dvb/frontend.h>
4498 #include <linux/dvb/video.h>
4499 #include <linux/dvb/audio.h>
4500 int main(void) {return 0;}
4502 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4503 cc_check $_inc_tmp && _dvbhead=yes && \
4504 _inc_extra="$_inc_extra $_inc_tmp" && break
4505 done
4507 echores "$_dvbhead"
4508 if test "$_dvbhead" = yes ; then
4509 _def_dvb='#define HAVE_DVB_HEAD 1'
4510 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4511 _aomodules="mpegpes(dvb) $_aomodules"
4512 _vomodules="mpegpes(dvb) $_vomodules"
4515 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4516 _def_dvb='#undef HAVE_DVB'
4517 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4518 _aomodules="mpegpes(file) $_aomodules"
4519 _vomodules="mpegpes(file) $_vomodules"
4522 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4523 _dvbin=yes
4524 _inputmodules="dvb $_inputmodules"
4525 else
4526 _dvbin=no
4527 _noinputmodules="dvb $_noinputmodules"
4531 echocheck "zr"
4532 if test "$_zr" = auto ; then
4533 #36067's seem to identify themselves as 36057PQC's, so the line
4534 #below should work for 36067's and 36057's.
4535 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
4536 _zr=yes
4537 else
4538 _zr=no
4541 if test "$_zr" = yes ; then
4542 if test "$_libavcodec_a" = yes ; then
4543 _def_zr='#define HAVE_ZR 1'
4544 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
4545 _vomodules="zr zr2 $_vomodules"
4546 else
4547 _res_comment="libavcodec (static) is required by zr, sorry"
4548 _novomodules="zr $_novomodules"
4549 _def_zr='#undef HAVE_ZR'
4551 else
4552 _def_zr='#undef HAVE_ZR'
4553 _novomodules="zr zr2 $_novomodules"
4555 echores "$_zr"
4558 echocheck "PNG support"
4559 if test "$_png" = auto ; then
4560 _png=no
4561 if irix ; then
4562 # Don't check for -lpng on irix since it has its own libpng
4563 # incompatible with the GNU libpng
4564 _res_comment="disabled on irix (not GNU libpng)"
4565 else
4566 cat > $TMPC << EOF
4567 #include <png.h>
4568 #include <string.h>
4569 int main(void) {
4570 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4571 printf("libpng: %s\n", png_libpng_ver);
4572 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4575 if cc_check -lpng -lz $_ld_lm ; then
4576 if tmp_run ; then
4577 _png=yes
4578 else
4579 _res_comment="mismatch of library and header versions"
4584 echores "$_png"
4585 if test "$_png" = yes ; then
4586 _def_png='#define HAVE_PNG 1'
4587 _ld_extra="$_ld_extra -lpng -lz"
4588 _vosrc="$_vosrc vo_png.c"
4589 _vomodules="png $_vomodules"
4590 else
4591 _def_png='#undef HAVE_PNG'
4592 _novomodules="png $_novomodules"
4595 echocheck "JPEG support"
4596 if test "$_jpeg" = auto ; then
4597 _jpeg=no
4598 cat > $TMPC << EOF
4599 #include <stdio.h>
4600 #include <stdlib.h>
4601 #include <setjmp.h>
4602 #include <string.h>
4603 #include <jpeglib.h>
4604 int main(void) {
4605 return 0;
4608 if cc_check -ljpeg $_ld_lm ; then
4609 if tmp_run ; then
4610 _jpeg=yes
4614 echores "$_jpeg"
4616 if test "$_jpeg" = yes ; then
4617 _def_jpeg='#define HAVE_JPEG 1'
4618 _vosrc="$_vosrc vo_jpeg.c"
4619 _vomodules="jpeg $_vomodules"
4620 _ld_extra="$_ld_extra -ljpeg"
4621 else
4622 _def_jpeg='#undef HAVE_JPEG'
4623 _novomodules="jpeg $_novomodules"
4628 echocheck "PNM support"
4629 if test "$_pnm" = yes; then
4630 _def_pnm="#define HAVE_PNM"
4631 _vosrc="$_vosrc vo_pnm.c"
4632 _vomodules="pnm $_vomodules"
4633 else
4634 _def_pnm="#undef HAVE_PNM"
4635 _novomodules="pnm $_novomodules"
4637 echores "$_pnm"
4641 echocheck "GIF support"
4642 # This is to appease people who want to force gif support.
4643 # If it is forced to yes, then we still do checks to determine
4644 # which gif library to use.
4645 if test "$_gif" = yes ; then
4646 _force_gif=yes
4647 _gif=auto
4650 if test "$_gif" = auto ; then
4651 _gif=no
4652 cat > $TMPC << EOF
4653 #include <gif_lib.h>
4654 int main(void) {
4655 return 0;
4658 for _ld_gif in "-lungif" "-lgif" ; do
4659 cc_check $_ld_gif && tmp_run && _gif=yes && break
4660 done
4663 # If no library was found, and the user wants support forced,
4664 # then we force it on with libgif, as this is the safest
4665 # assumption IMHO. (libungif & libregif both create symbolic
4666 # links to libgif. We also assume that no x11 support is needed,
4667 # because if you are forcing this, then you _should_ know what
4668 # you are doing. [ Besides, package maintainers should never
4669 # have compiled x11 deps into libungif in the first place. ] )
4670 # </rant>
4671 # --Joey
4672 if test "$_force_gif" = yes && test "$_gif" = no ; then
4673 _gif=yes
4674 _ld_gif="-lgif"
4677 if test "$_gif" = yes ; then
4678 _def_gif='#define HAVE_GIF 1'
4679 _vosrc="$_vosrc vo_gif89a.c"
4680 _codecmodules="gif $_codecmodules"
4681 _vomodules="gif89a $_vomodules"
4682 _res_comment="old version, some encoding functions disabled"
4683 _def_gif_4='#undef HAVE_GIF_4'
4684 _ld_extra="$_ld_extra $_ld_gif"
4686 cat > $TMPC << EOF
4687 #include <signal.h>
4688 #include <gif_lib.h>
4689 void catch() { exit(1); }
4690 int main(void) {
4691 signal(SIGSEGV, catch); // catch segfault
4692 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4693 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4694 return 0;
4697 if cc_check "$_ld_gif" && tmp_run ; then
4698 _def_gif_4='#define HAVE_GIF_4 1'
4699 _res_comment=""
4701 else
4702 _def_gif='#undef HAVE_GIF'
4703 _def_gif_4='#undef HAVE_GIF_4'
4704 _novomodules="gif89a $_novomodules"
4705 _nocodecmodules="gif $_nocodecmodules"
4707 echores "$_gif"
4710 case "$_gif" in yes*)
4711 echocheck "broken giflib workaround"
4712 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4714 cat > $TMPC << EOF
4715 #include <gif_lib.h>
4716 int main(void) {
4717 GifFileType gif;
4718 printf("UserData is at address %p\n", gif.UserData);
4719 return 0;
4722 if cc_check "$_ld_gif" && tmp_run ; then
4723 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4724 echores "disabled"
4725 else
4726 echores "enabled"
4729 esac
4732 echocheck "VESA support"
4733 if test "$_vesa" = auto ; then
4734 cat > $TMPC << EOF
4735 #include <vbe.h>
4736 int main(void) { vbeVersion(); return 0; }
4738 _vesa=no
4739 cc_check -lvbe -llrmi && _vesa=yes
4741 if test "$_vesa" = yes ; then
4742 _def_vesa='#define HAVE_VESA 1'
4743 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4744 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4745 _vomodules="vesa $_vomodules"
4746 else
4747 _def_vesa='#undef HAVE_VESA'
4748 _novomodules="vesa $_novomodules"
4750 echores "$_vesa"
4752 #################
4753 # VIDEO + AUDIO #
4754 #################
4757 echocheck "SDL"
4758 if test -z "$_sdlconfig" ; then
4759 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4760 _sdlconfig="sdl-config"
4761 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4762 _sdlconfig="sdl11-config"
4763 else
4764 _sdlconfig=false
4767 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4768 cat > $TMPC << EOF
4769 #include <SDL.h>
4770 int main(int argc, char *argv[]) {
4771 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4772 return 0;
4775 _sdl=no
4776 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4777 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4778 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4779 if test "$_sdlversion" -gt 116 ; then
4780 if test "$_sdlversion" -lt 121 ; then
4781 _def_sdlbuggy='#define BUGGY_SDL'
4782 else
4783 _def_sdlbuggy='#undef BUGGY_SDL'
4785 _sdl=yes
4790 if test "$_sdl" = yes ; then
4791 _def_sdl='#define HAVE_SDL 1'
4792 if cygwin ; then
4793 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4794 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4795 elif mingw32 ; then
4796 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4797 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4798 else
4799 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4800 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4802 _vosrc="$_vosrc vo_sdl.c"
4803 _vomodules="sdl $_vomodules"
4804 _aosrc="$_aosrc ao_sdl.c"
4805 _aomodules="sdl $_aomodules"
4806 _res_comment="using $_sdlconfig"
4807 else
4808 _def_sdl='#undef HAVE_SDL'
4809 _novomodules="sdl $_novomodules"
4810 _noaomodules="sdl $_noaomodules"
4812 echores "$_sdl"
4815 if win32; then
4817 echocheck "Windows waveout"
4818 if test "$_win32waveout" = auto ; then
4819 cat > $TMPC << EOF
4820 #include <windows.h>
4821 #include <mmsystem.h>
4822 int main(void) { return 0; }
4824 _win32waveout=no
4825 cc_check -lwinmm && _win32waveout=yes
4827 if test "$_win32waveout" = yes ; then
4828 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4829 _libs_mplayer="$_libs_mplayer -lwinmm"
4830 _aosrc="$_aosrc ao_win32.c"
4831 _aomodules="win32 $_aomodules"
4832 else
4833 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4834 _noaomodules="win32 $_noaomodules"
4836 echores "$_win32waveout"
4838 echocheck "Directx"
4839 if test "$_directx" = auto ; then
4840 cat > $TMPC << EOF
4841 #include <windows.h>
4842 #include <ddraw.h>
4843 #include <dsound.h>
4844 int main(void) { return 0; }
4846 _directx=no
4847 cc_check -lgdi32 && _directx=yes
4849 if test "$_directx" = yes ; then
4850 _def_directx='#define HAVE_DIRECTX 1'
4851 _libs_mplayer="$_libs_mplayer -lgdi32"
4852 _vosrc="$_vosrc vo_directx.c"
4853 _vomodules="directx $_vomodules"
4854 _aosrc="$_aosrc ao_dsound.c"
4855 _aomodules="dsound $_aomodules"
4856 else
4857 _def_directx='#undef HAVE_DIRECTX'
4858 _novomodules="directx $_novomodules"
4859 _noaomodules="dsound $_noaomodules"
4861 echores "$_directx"
4863 fi #if win32; then
4866 echocheck "NAS"
4867 if test "$_nas" = auto ; then
4868 cat > $TMPC << EOF
4869 #include <audio/audiolib.h>
4870 int main(void) { return 0; }
4872 _nas=no
4873 cc_check $_ld_lm -laudio -lXt && _nas=yes
4875 if test "$_nas" = yes ; then
4876 _def_nas='#define HAVE_NAS 1'
4877 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4878 _aosrc="$_aosrc ao_nas.c"
4879 _aomodules="nas $_aomodules"
4880 else
4881 _noaomodules="nas $_noaomodules"
4882 _def_nas='#undef HAVE_NAS'
4884 echores "$_nas"
4886 echocheck "DXR2"
4887 if test "$_dxr2" = auto; then
4888 _dxr2=no
4889 cat > $TMPC << EOF
4890 #include <dxr2ioctl.h>
4891 int main(void) { return 0; }
4893 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4894 cc_check $_inc_tmp && _dxr2=yes && \
4895 _inc_extra="$_inc_extra $_inc_tmp" && break
4896 done
4898 if test "$_dxr2" = yes; then
4899 _def_dxr2='#define HAVE_DXR2 1'
4900 _vosrc="$_vosrc vo_dxr2.c"
4901 _aosrc="$_aosrc ao_dxr2.c"
4902 _aomodules="dxr2 $_aomodules"
4903 _vomodules="dxr2 $_vomodules"
4904 else
4905 _def_dxr2='#undef HAVE_DXR2'
4906 _noaomodules="dxr2 $_noaomodules"
4907 _novomodules="dxr2 $_novomodules"
4909 echores "$_dxr2"
4911 echocheck "DXR3/H+"
4912 if test "$_dxr3" = auto ; then
4913 cat > $TMPC << EOF
4914 #include <linux/em8300.h>
4915 int main(void) { return 0; }
4917 _dxr3=no
4918 cc_check && _dxr3=yes
4920 if test "$_dxr3" = yes ; then
4921 _def_dxr3='#define HAVE_DXR3 1'
4922 _vosrc="$_vosrc vo_dxr3.c"
4923 _vomodules="dxr3 $_vomodules"
4924 else
4925 _def_dxr3='#undef HAVE_DXR3'
4926 _novomodules="dxr3 $_novomodules"
4928 echores "$_dxr3"
4931 echocheck "IVTV TV-Out"
4932 if test "$_ivtv" = auto ; then
4933 cat > $TMPC << EOF
4934 #include <stdlib.h>
4935 #include <inttypes.h>
4936 #include <linux/types.h>
4937 #include <linux/videodev2.h>
4938 #include <linux/ivtv.h>
4939 int main(void) { return 0; }
4941 _ivtv=no
4942 cc_check && _ivtv=yes
4944 if test "$_ivtv" = yes ; then
4945 _def_ivtv='#define HAVE_IVTV 1'
4946 _vosrc="$_vosrc vo_ivtv.c"
4947 _vomodules="ivtv $_vomodules"
4948 _aosrc="$_aosrc ao_ivtv.c"
4949 _aomodules="ivtv $_aomodules"
4950 else
4951 _def_ivtv='#undef HAVE_IVTV'
4952 _novomodules="ivtv $_novomodules"
4953 _noaomodules="ivtv $_noaomodules"
4955 echores "$_ivtv"
4958 echocheck "V4L2 MPEG Decoder"
4959 if test "$_v4l2" = auto ; then
4960 cat > $TMPC << EOF
4961 #include <stdlib.h>
4962 #include <inttypes.h>
4963 #include <linux/types.h>
4964 #include <linux/videodev2.h>
4965 #include <linux/version.h>
4966 int main(void) {
4967 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4968 #error kernel headers too old, need 2.6.22
4969 bad_kernel_version();
4970 #endif
4971 struct v4l2_ext_controls ctrls;
4972 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4973 return 0;
4976 _v4l2=no
4977 cc_check && _v4l2=yes
4979 if test "$_v4l2" = yes ; then
4980 _def_v4l2='#define HAVE_V4L2_DECODER 1'
4981 _vosrc="$_vosrc vo_v4l2.c"
4982 _vomodules="v4l2 $_vomodules"
4983 _aosrc="$_aosrc ao_v4l2.c"
4984 _aomodules="v4l2 $_aomodules"
4985 else
4986 _def_v4l2='#undef HAVE_V4L2_DECODER'
4987 _novomodules="v4l2 $_novomodules"
4988 _noaomodules="v4l2 $_noaomodules"
4990 echores "$_v4l2"
4994 #########
4995 # AUDIO #
4996 #########
4999 echocheck "OSS Audio"
5000 if test "$_ossaudio" = auto ; then
5001 cat > $TMPC << EOF
5002 #include <sys/ioctl.h>
5003 #include <$_soundcard_header>
5004 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5006 _ossaudio=no
5007 cc_check && _ossaudio=yes
5009 if test "$_ossaudio" = yes ; then
5010 _def_ossaudio='#define USE_OSS_AUDIO 1'
5011 _aosrc="$_aosrc ao_oss.c"
5012 _aomodules="oss $_aomodules"
5013 if test "$_linux_devfs" = yes; then
5014 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5015 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5016 else
5017 cat > $TMPC << EOF
5018 #include <sys/ioctl.h>
5019 #include <$_soundcard_header>
5020 #ifdef OPEN_SOUND_SYSTEM
5021 int main(void) { return 0; }
5022 #else
5023 #error Not the real thing
5024 #endif
5026 _real_ossaudio=no
5027 cc_check && _real_ossaudio=yes
5028 if test "$_real_ossaudio" = yes; then
5029 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5030 elif netbsd || openbsd ; then
5031 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5032 _ld_extra="$_ld_extra -lossaudio"
5033 else
5034 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5036 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5038 else
5039 _def_ossaudio='#undef USE_OSS_AUDIO'
5040 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5041 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5042 _noaomodules="oss $_noaomodules"
5044 echores "$_ossaudio"
5047 echocheck "aRts"
5048 if test "$_arts" = auto ; then
5049 _arts=no
5050 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5052 cat > $TMPC << EOF
5053 #include <artsc.h>
5054 int main(void) { return 0; }
5056 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5061 if test "$_arts" = yes ; then
5062 _def_arts='#define USE_ARTS 1'
5063 _aosrc="$_aosrc ao_arts.c"
5064 _aomodules="arts $_aomodules"
5065 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5066 _inc_extra="$_inc_extra `artsc-config --cflags`"
5067 else
5068 _noaomodules="arts $_noaomodules"
5070 echores "$_arts"
5073 echocheck "EsounD"
5074 if test "$_esd" = auto ; then
5075 _esd=no
5076 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5078 cat > $TMPC << EOF
5079 #include <esd.h>
5080 int main(void) { int fd = esd_open_sound("test"); return fd; }
5082 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5086 echores "$_esd"
5088 if test "$_esd" = yes ; then
5089 _def_esd='#define USE_ESD 1'
5090 _aosrc="$_aosrc ao_esd.c"
5091 _aomodules="esd $_aomodules"
5092 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5093 _inc_extra="$_inc_extra `esd-config --cflags`"
5095 echocheck "esd_get_latency()"
5096 cat > $TMPC << EOF
5097 #include <esd.h>
5098 int main(void) { return esd_get_latency(0); }
5100 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5101 echores "$_esd_latency"
5102 else
5103 _def_esd='#undef USE_ESD'
5104 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5105 _noaomodules="esd $_noaomodules"
5108 echocheck "pulse"
5109 if test "$_pulse" = auto ; then
5110 _pulse=no
5111 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5113 cat > $TMPC << EOF
5114 #include <pulse/pulseaudio.h>
5115 int main(void) { return 0; }
5117 cc_check `$_pkg_config --libs --cflags libpulse` && tmp_run && _pulse=yes
5121 echores "$_pulse"
5123 if test "$_pulse" = yes ; then
5124 _def_pulse='#define USE_PULSE 1'
5125 _aosrc="$_aosrc ao_pulse.c"
5126 _aomodules="pulse $_aomodules"
5127 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs libpulse`"
5128 _inc_extra="$_inc_extra `$_pkg_config --cflags libpulse`"
5129 else
5130 _def_pulse='#undef USE_PULSE'
5131 _noaomodules="pulse $_noaomodules"
5135 echocheck "JACK"
5136 if test "$_jack" = auto ; then
5137 _jack=yes
5139 cat > $TMPC << EOF
5140 #include <jack/jack.h>
5141 int main(void) { jack_client_new("test"); return 0; }
5143 if cc_check -ljack ; then
5144 _libs_mplayer="$_libs_mplayer -ljack"
5145 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5146 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5147 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5148 else
5149 _jack=no
5153 if test "$_jack" = yes ; then
5154 _def_jack='#define USE_JACK 1'
5155 _aosrc="$_aosrc ao_jack.c"
5156 _aomodules="jack $_aomodules"
5157 else
5158 _noaomodules="jack $_noaomodules"
5160 echores "$_jack"
5162 echocheck "OpenAL"
5163 if test "$_openal" = auto ; then
5164 _openal=no
5165 cat > $TMPC << EOF
5166 #ifdef OPENAL_AL_H
5167 #include <OpenAL/al.h>
5168 #else
5169 #include <AL/al.h>
5170 #endif
5171 int main(void) {
5172 alSourceQueueBuffers(0, 0, 0);
5173 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5174 return 0;
5177 for I in "-lopenal" "-framework OpenAL" ; do
5178 cc_check $I && _openal=yes && break
5179 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5180 done
5181 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5183 if test "$_openal" = yes ; then
5184 _def_openal='#define USE_OPENAL 1'
5185 _aosrc="$_aosrc ao_openal.c"
5186 _aomodules="openal $_aomodules"
5187 else
5188 _noaomodules="openal $_noaomodules"
5190 echores "$_openal"
5192 echocheck "ALSA audio"
5193 if test "$_alsa" != no ; then
5194 _alsa=no
5195 cat > $TMPC << EOF
5196 #include <sys/asoundlib.h>
5197 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5198 #error "alsa version != 0.5.x"
5199 #endif
5200 int main(void) { return 0; }
5202 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5204 cat > $TMPC << EOF
5205 #include <sys/asoundlib.h>
5206 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5207 #error "alsa version != 0.9.x"
5208 #endif
5209 int main(void) { return 0; }
5211 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5212 cat > $TMPC << EOF
5213 #include <alsa/asoundlib.h>
5214 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5215 #error "alsa version != 0.9.x"
5216 #endif
5217 int main(void) { return 0; }
5219 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5221 cat > $TMPC << EOF
5222 #include <sys/asoundlib.h>
5223 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5224 #error "alsa version != 1.0.x"
5225 #endif
5226 int main(void) { return 0; }
5228 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5229 cat > $TMPC << EOF
5230 #include <alsa/asoundlib.h>
5231 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5232 #error "alsa version != 1.0.x"
5233 #endif
5234 int main(void) { return 0; }
5236 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5238 _def_alsa5='#undef HAVE_ALSA5'
5239 _def_alsa9='#undef HAVE_ALSA9'
5240 _def_alsa1x='#undef HAVE_ALSA1X'
5241 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5242 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5243 if test "$_alsaver" ; then
5244 _alsa=yes
5245 if test "$_alsaver" = '0.5.x' ; then
5246 _alsa5=yes
5247 _aosrc="$_aosrc ao_alsa5.c"
5248 _aomodules="alsa5 $_aomodules"
5249 _def_alsa5='#define HAVE_ALSA5 1'
5250 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5251 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5252 elif test "$_alsaver" = '0.9.x-sys' ; then
5253 _alsa9=yes
5254 _aosrc="$_aosrc ao_alsa.c"
5255 _aomodules="alsa $_aomodules"
5256 _def_alsa9='#define HAVE_ALSA9 1'
5257 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5258 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5259 elif test "$_alsaver" = '0.9.x-alsa' ; then
5260 _alsa9=yes
5261 _aosrc="$_aosrc ao_alsa.c"
5262 _aomodules="alsa $_aomodules"
5263 _def_alsa9='#define HAVE_ALSA9 1'
5264 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5265 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5266 elif test "$_alsaver" = '1.0.x-sys' ; then
5267 _alsa1x=yes
5268 _aosrc="$_aosrc ao_alsa.c"
5269 _aomodules="alsa $_aomodules"
5270 _def_alsa1x="#define HAVE_ALSA1X 1"
5271 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5272 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5273 elif test "$_alsaver" = '1.0.x-alsa' ; then
5274 _alsa1x=yes
5275 _aosrc="$_aosrc ao_alsa.c"
5276 _aomodules="alsa $_aomodules"
5277 _def_alsa1x="#define HAVE_ALSA1X 1"
5278 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5279 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5280 else
5281 _alsa=no
5282 _res_comment="unknown version"
5284 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5285 else
5286 _noaomodules="alsa $_noaomodules"
5288 echores "$_alsa"
5291 echocheck "Sun audio"
5292 if test "$_sunaudio" = auto ; then
5293 cat > $TMPC << EOF
5294 #include <sys/types.h>
5295 #include <sys/audioio.h>
5296 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5298 _sunaudio=no
5299 cc_check && _sunaudio=yes
5301 if test "$_sunaudio" = yes ; then
5302 _def_sunaudio='#define USE_SUN_AUDIO 1'
5303 _aosrc="$_aosrc ao_sun.c"
5304 _aomodules="sun $_aomodules"
5305 else
5306 _def_sunaudio='#undef USE_SUN_AUDIO'
5307 _noaomodules="sun $_noaomodules"
5309 echores "$_sunaudio"
5312 if sunos; then
5313 echocheck "Sun mediaLib"
5314 if test "$_mlib" = auto ; then
5315 _mlib=no
5316 cat > $TMPC << EOF
5317 #include <mlib.h>
5318 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5320 cc_check -lmlib && _mlib=yes
5322 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5323 echores "$_mlib"
5324 fi #if sunos
5327 if irix; then
5328 echocheck "SGI audio"
5329 if test "$_sgiaudio" = auto ; then
5330 # check for SGI audio
5331 cat > $TMPC << EOF
5332 #include <dmedia/audio.h>
5333 int main(void) { return 0; }
5335 _sgiaudio=no
5336 cc_check && _sgiaudio=yes
5338 if test "$_sgiaudio" = "yes" ; then
5339 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5340 _libs_mplayer="$_libs_mplayer -laudio"
5341 _aosrc="$_aosrc ao_sgi.c"
5342 _aomodules="sgi $_aomodules"
5343 else
5344 _def_sgiaudio='#undef USE_SGI_AUDIO'
5345 _noaomodules="sgi $_noaomodules"
5347 echores "$_sgiaudio"
5348 fi #if irix
5351 echocheck "VCD support"
5352 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5353 _inputmodules="vcd $_inputmodules"
5354 _def_vcd='#define HAVE_VCD 1'
5355 _vcd="yes"
5356 else
5357 _def_vcd='#undef HAVE_VCD'
5358 _noinputmodules="vcd $_noinputmodules"
5359 _res_comment="not supported on this OS"
5360 _vcd="no"
5362 echores "$_vcd"
5366 echocheck "dvdread"
5367 if test "$_dvdread_internal" = auto ; then
5368 _dvdread_internal=no
5369 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5370 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5371 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5372 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5373 _dvdread_internal=yes
5374 _dvdread=yes
5376 elif test "$_dvdread" = auto ; then
5377 _dvdread=no
5378 if test "$_dl" = yes; then
5379 cat > $TMPC << EOF
5380 #include <inttypes.h>
5381 #include <dvdread/dvd_reader.h>
5382 #include <dvdread/ifo_types.h>
5383 #include <dvdread/ifo_read.h>
5384 #include <dvdread/nav_read.h>
5385 int main(void) { return 0; }
5387 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5388 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5392 if test "$_dvdread_internal" = yes; then
5393 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5394 _def_dvdread='#define USE_DVDREAD 1'
5395 _inputmodules="dvdread(internal) $_inputmodules"
5396 _largefiles=yes
5397 _res_comment="internal"
5398 elif test "$_dvdread" = yes; then
5399 _def_dvdread='#define USE_DVDREAD 1'
5400 _largefiles=yes
5401 _ld_extra="$_ld_extra -ldvdread"
5402 _inputmodules="dvdread(external) $_inputmodules"
5403 _res_comment="external"
5404 else
5405 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5406 _def_dvdread='#undef USE_DVDREAD'
5407 _noinputmodules="dvdread $_noinputmodules"
5409 echores "$_dvdread"
5412 echocheck "internal libdvdcss"
5413 if test "$_libdvdcss_internal" = auto ; then
5414 _libdvdcss_internal=no
5415 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5417 if test "$_libdvdcss_internal" = yes ; then
5418 if linux || netbsd || openbsd || bsdos ; then
5419 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5420 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5421 elif freebsd ; then
5422 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5423 elif darwin ; then
5424 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5425 _ld_extra="$_ld_extra -framework IOKit"
5427 _inputmodules="libdvdcss(internal) $_inputmodules"
5428 _largefiles=yes
5429 else
5430 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5432 echores "$_libdvdcss_internal"
5435 echocheck "cdparanoia"
5436 if test "$_cdparanoia" = auto ; then
5437 cat > $TMPC <<EOF
5438 #include <cdda_interface.h>
5439 #include <cdda_paranoia.h>
5440 // This need a better test. How ?
5441 int main(void) {
5442 void *test = cdda_verbose_set;
5443 return test == (void *)1;
5446 _cdparanoia=no
5447 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5448 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5449 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5450 done
5452 if test "$_cdparanoia" = yes ; then
5453 _cdda='yes'
5454 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5455 openbsd && _ld_extra="$_ld_extra -lutil"
5457 echores "$_cdparanoia"
5460 echocheck "libcdio"
5461 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5462 cat > $TMPC << EOF
5463 #include <stdio.h>
5464 #include <cdio/version.h>
5465 #include <cdio/cdda.h>
5466 #include <cdio/paranoia.h>
5467 int main(void)
5469 void *test = cdda_verbose_set;
5470 printf("%s\n", CDIO_VERSION);
5471 return test == (void *)1;
5475 _libcdio=no
5476 for _ld_tmp in "" "-lwinmm" ; do
5477 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5478 cc_check $_ld_tmp $_ld_lm \
5479 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5480 done
5481 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5482 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5483 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5484 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5485 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5488 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5489 _cdda='yes'
5490 _def_libcdio='#define HAVE_LIBCDIO'
5491 _def_havelibcdio='yes'
5492 else
5493 if test "$_cdparanoia" = yes ; then
5494 _res_comment="using cdparanoia"
5496 _def_libcdio='#undef HAVE_LIBCDIO'
5497 _def_havelibcdio='no'
5499 echores "$_libcdio"
5501 if test "$_cdda" = yes ; then
5502 test $_cddb = auto && test $_network = yes && _cddb=yes
5503 _def_cdparanoia='#define HAVE_CDDA'
5504 _inputmodules="cdda $_inputmodules"
5505 else
5506 _def_cdparanoia='#undef HAVE_CDDA'
5507 _noinputmodules="cdda $_noinputmodules"
5510 if test "$_cddb" = yes ; then
5511 _def_cddb='#define HAVE_CDDB'
5512 _inputmodules="cddb $_inputmodules"
5513 else
5514 _cddb=no
5515 _def_cddb='#undef HAVE_CDDB'
5516 _noinputmodules="cddb $_noinputmodules"
5519 echocheck "bitmap font support"
5520 if test "$_bitmap_font" = yes ; then
5521 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5522 else
5523 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5525 echores "$_bitmap_font"
5528 echocheck "freetype >= 2.0.9"
5530 # freetype depends on iconv
5531 if test "$_iconv" = no ; then
5532 _freetype=no
5533 _res_comment="iconv support needed"
5536 if test "$_freetype" = auto ; then
5537 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5538 cat > $TMPC << EOF
5539 #include <stdio.h>
5540 #include <ft2build.h>
5541 #include FT_FREETYPE_H
5542 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5543 #error "Need FreeType 2.0.9 or newer"
5544 #endif
5545 int main(void)
5547 FT_Library library;
5548 FT_Int major=-1,minor=-1,patch=-1;
5549 int err=FT_Init_FreeType(&library);
5550 if(err){
5551 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5552 exit(err);
5554 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5555 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5556 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5557 (int)major,(int)minor,(int)patch );
5558 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5559 printf("Library and header version mismatch! Fix it in your distribution!\n");
5560 exit(1);
5562 return 0;
5565 _freetype=no
5566 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5567 else
5568 _freetype=no
5571 if test "$_freetype" = yes ; then
5572 _def_freetype='#define HAVE_FREETYPE'
5573 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5574 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5575 else
5576 _def_freetype='#undef HAVE_FREETYPE'
5578 echores "$_freetype"
5580 if test "$_freetype" = no ; then
5581 _fontconfig=no
5582 _res_comment="freetype support needed"
5584 echocheck "fontconfig"
5585 if test "$_fontconfig" = auto ; then
5586 cat > $TMPC << EOF
5587 #include <stdio.h>
5588 #include <fontconfig/fontconfig.h>
5589 int main(void)
5591 int err = FcInit();
5592 if(err == FcFalse){
5593 printf("Couldn't initialize fontconfig lib\n");
5594 exit(err);
5596 return 0;
5600 _fontconfig=no
5601 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5602 _ld_tmp="-lfontconfig $_ld_tmp"
5603 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5604 done
5605 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5606 _inc_tmp=`$_pkg_config --cflags fontconfig`
5607 _ld_tmp=`$_pkg_config --libs fontconfig`
5608 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5609 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5612 if test "$_fontconfig" = yes ; then
5613 _def_fontconfig='#define HAVE_FONTCONFIG'
5614 else
5615 _def_fontconfig='#undef HAVE_FONTCONFIG'
5617 echores "$_fontconfig"
5620 echocheck "SSA/ASS support"
5621 # libass depends on FreeType
5622 if test "$_freetype" = no ; then
5623 _ass=no
5624 _res_comment="FreeType support needed"
5627 if test "$_ass" = auto ; then
5628 cat > $TMPC << EOF
5629 #include <ft2build.h>
5630 #include FT_FREETYPE_H
5631 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5632 #error "Need FreeType 2.1.8 or newer"
5633 #endif
5634 int main(void) { return 0; }
5636 _ass=no
5637 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5638 if test "$_ass" = no ; then
5639 _res_comment="FreeType >= 2.1.8 needed"
5642 if test "$_ass" = yes ; then
5643 _def_ass='#define USE_ASS'
5644 else
5645 _def_ass='#undef USE_ASS'
5647 echores "$_ass"
5650 echocheck "fribidi with charsets"
5651 if test "$_fribidi" = auto ; then
5652 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5653 cat > $TMPC << EOF
5654 #include <stdio.h>
5655 /* workaround for fribidi 0.10.4 and below */
5656 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5657 #include <fribidi/fribidi.h>
5658 int main(void)
5660 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5661 printf("Fribidi headers are not consistents with the library!\n");
5662 exit(1);
5664 return 0;
5667 _fribidi=no
5668 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5669 else
5670 _fribidi=no
5673 if test "$_fribidi" = yes ; then
5674 _def_fribidi='#define USE_FRIBIDI'
5675 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5676 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5677 else
5678 _def_fribidi='#undef USE_FRIBIDI'
5680 echores "$_fribidi"
5683 echocheck "ENCA"
5684 if test "$_enca" = auto ; then
5685 cat > $TMPC << EOF
5686 #include <enca.h>
5687 int main(void)
5689 const char **langs;
5690 size_t langcnt;
5691 langs = enca_get_languages(&langcnt);
5692 return 0;
5695 _enca=no
5696 cc_check -lenca $_ld_lm && _enca=yes
5698 if test "$_enca" = yes ; then
5699 _def_enca='#define HAVE_ENCA 1'
5700 _ld_extra="$_ld_extra -lenca"
5701 else
5702 _def_enca='#undef HAVE_ENCA'
5704 echores "$_enca"
5707 echocheck "zlib"
5708 cat > $TMPC << EOF
5709 #include <zlib.h>
5710 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5712 _zlib=no
5713 cc_check -lz && _zlib=yes
5714 if test "$_zlib" = yes ; then
5715 _def_zlib='#define HAVE_ZLIB 1'
5716 _ld_extra="$_ld_extra -lz"
5717 else
5718 _def_zlib='#undef HAVE_ZLIB'
5719 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5720 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5722 echores "$_zlib"
5725 echocheck "RTC"
5726 if test "$_rtc" = auto ; then
5727 cat > $TMPC << EOF
5728 #include <sys/ioctl.h>
5729 #ifdef __linux__
5730 #include <linux/rtc.h>
5731 #else
5732 #include <rtc.h>
5733 #define RTC_PIE_ON RTCIO_PIE_ON
5734 #endif
5735 int main(void) { return RTC_PIE_ON; }
5737 _rtc=no
5738 cc_check && _rtc=yes
5739 ppc && _rtc=no
5741 if test "$_rtc" = yes ; then
5742 _def_rtc='#define HAVE_RTC 1'
5743 else
5744 _def_rtc='#undef HAVE_RTC'
5746 echores "$_rtc"
5749 echocheck "liblzo2 support"
5750 if test "$_liblzo" = auto ; then
5751 _liblzo=no
5752 cat > $TMPC << EOF
5753 #include <lzo/lzo1x.h>
5754 int main(void) { lzo_init();return 0; }
5756 cc_check -llzo2 && _liblzo=yes
5758 if test "$_liblzo" = yes ; then
5759 _def_liblzo='#define USE_LIBLZO 1'
5760 _ld_extra="$_ld_extra -llzo2"
5761 _codecmodules="liblzo $_codecmodules"
5762 else
5763 _def_liblzo='#undef USE_LIBLZO'
5764 _nocodecmodules="liblzo $_nocodecmodules"
5766 echores "$_liblzo"
5769 echocheck "mad support"
5770 if test "$_mad" = auto ; then
5771 _mad=no
5772 cat > $TMPC << EOF
5773 #include <mad.h>
5774 int main(void) { return 0; }
5776 cc_check -lmad && _mad=yes
5778 if test "$_mad" = yes ; then
5779 _def_mad='#define USE_LIBMAD 1'
5780 _ld_extra="$_ld_extra -lmad"
5781 _codecmodules="libmad $_codecmodules"
5782 else
5783 _def_mad='#undef USE_LIBMAD'
5784 _nocodecmodules="libmad $_nocodecmodules"
5786 echores "$_mad"
5788 echocheck "Twolame"
5789 if test "$_twolame" = auto ; then
5790 cat > $TMPC <<EOF
5791 #include <twolame.h>
5792 int main(void) { twolame_init(); return 0; }
5794 _twolame=no
5795 cc_check -ltwolame $_ld_lm && _twolame=yes
5797 if test "$_twolame" = yes ; then
5798 _def_twolame='#define HAVE_TWOLAME 1'
5799 _libs_mencoder="$_libs_mencoder -ltwolame"
5800 _codecmodules="twolame $_codecmodules"
5801 else
5802 _def_twolame='#undef HAVE_TWOLAME'
5803 _nocodecmodules="twolame $_nocodecmodules"
5805 echores "$_twolame"
5807 echocheck "Toolame"
5808 if test "$_toolame" = auto ; then
5809 _toolame=no
5810 if test "$_twolame" = yes ; then
5811 _res_comment="disabled by twolame"
5812 else
5813 cat > $TMPC <<EOF
5814 #include <toolame.h>
5815 int main(void) { toolame_init(); return 0; }
5817 cc_check -ltoolame $_ld_lm && _toolame=yes
5820 if test "$_toolame" = yes ; then
5821 _def_toolame='#define HAVE_TOOLAME 1'
5822 _libs_mencoder="$_libs_mencoder -ltoolame"
5823 _codecmodules="toolame $_codecmodules"
5824 else
5825 _def_toolame='#undef HAVE_TOOLAME'
5826 _nocodecmodules="toolame $_nocodecmodules"
5828 if test "$_toolamedir" ; then
5829 _res_comment="using $_toolamedir"
5831 echores "$_toolame"
5833 echocheck "OggVorbis support"
5834 if test "$_tremor_internal" = yes; then
5835 _libvorbis=no
5836 elif test "$_tremor_external" = auto; then
5837 _tremor_external=no
5838 cat > $TMPC << EOF
5839 #include <tremor/ivorbiscodec.h>
5840 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5842 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5844 if test "$_libvorbis" = auto; then
5845 _libvorbis=no
5846 cat > $TMPC << EOF
5847 #include <vorbis/codec.h>
5848 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5850 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5852 if test "$_tremor_internal" = yes ; then
5853 _vorbis=yes
5854 _def_vorbis='#define HAVE_OGGVORBIS 1'
5855 _def_tremor='#define TREMOR 1'
5856 _codecmodules="tremor(internal) $_codecmodules"
5857 _res_comment="internal Tremor"
5858 if test "$_tremor_low" = yes ; then
5859 _res_comment="internal low accuracy Tremor"
5861 elif test "$_tremor_external" = yes ; then
5862 _vorbis=yes
5863 _def_vorbis='#define HAVE_OGGVORBIS 1'
5864 _def_tremor='#define TREMOR 1'
5865 _codecmodules="tremor(external) $_codecmodules"
5866 _res_comment="external Tremor"
5867 _ld_extra="$_ld_extra -logg -lvorbisidec"
5868 elif test "$_libvorbis" = yes ; then
5869 _vorbis=yes
5870 _def_vorbis='#define HAVE_OGGVORBIS 1'
5871 _codecmodules="libvorbis $_codecmodules"
5872 _res_comment="libvorbis"
5873 _ld_extra="$_ld_extra -lvorbis -logg"
5874 else
5875 _vorbis=no
5876 _nocodecmodules="libvorbis $_nocodecmodules"
5878 if test "$_libvorbis" = no ; then
5879 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5881 echores "$_vorbis"
5883 echocheck "libspeex (version >= 1.1 required)"
5884 if test "$_speex" = auto ; then
5885 _speex=no
5886 cat > $TMPC << EOF
5887 #include <speex/speex.h>
5888 int main(void) {
5889 SpeexBits bits;
5890 void *dec;
5891 speex_decode_int(dec, &bits, dec);
5894 cc_check -lspeex $_ld_lm && _speex=yes
5896 if test "$_speex" = yes ; then
5897 _def_speex='#define HAVE_SPEEX 1'
5898 _ld_extra="$_ld_extra -lspeex"
5899 _codecmodules="speex $_codecmodules"
5900 else
5901 _def_speex='#undef HAVE_SPEEX'
5902 _nocodecmodules="speex $_nocodecmodules"
5904 echores "$_speex"
5906 echocheck "OggTheora support"
5907 if test "$_theora" = auto ; then
5908 _theora=no
5909 cat > $TMPC << EOF
5910 #include <theora/theora.h>
5911 #include <string.h>
5912 int main(void)
5914 /* theora is in flux, make sure that all interface routines and
5915 * datatypes exist and work the way we expect it, so we don't break
5916 * mplayer */
5917 ogg_packet op;
5918 theora_comment tc;
5919 theora_info inf;
5920 theora_state st;
5921 yuv_buffer yuv;
5922 int r;
5923 double t;
5925 theora_info_init (&inf);
5926 theora_comment_init (&tc);
5928 return 0;
5930 /* we don't want to execute this kind of nonsense; just for making sure
5931 * that compilation works... */
5932 memset(&op, 0, sizeof(op));
5933 r = theora_decode_header (&inf, &tc, &op);
5934 r = theora_decode_init (&st, &inf);
5935 t = theora_granule_time (&st, op.granulepos);
5936 r = theora_decode_packetin (&st, &op);
5937 r = theora_decode_YUVout (&st, &yuv);
5938 theora_clear (&st);
5940 return 0;
5943 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5944 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5945 && _theora=yes && break
5946 done
5947 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5948 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5949 cc_check -I. tremor/bitwise.c $_ld_theora \
5950 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5951 done
5954 if test "$_theora" = yes ; then
5955 _def_theora='#define HAVE_OGGTHEORA 1'
5956 _codecmodules="libtheora $_codecmodules"
5957 # when --enable-theora is forced, we'd better provide a probably sane
5958 # $_ld_theora than nothing
5959 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5960 else
5961 _def_theora='#undef HAVE_OGGTHEORA'
5962 _nocodecmodules="libtheora $_nocodecmodules"
5964 echores "$_theora"
5966 echocheck "internal mp3lib support"
5967 if test "$_mp3lib" = yes ; then
5968 _def_mp3lib='#define USE_MP3LIB 1'
5969 _codecmodules="mp3lib $_codecmodules"
5970 else
5971 _def_mp3lib='#undef USE_MP3LIB'
5972 _nocodecmodules="mp3lib $_nocodecmodules"
5974 echores "$_mp3lib"
5976 echocheck "internal liba52 support"
5977 if test "$_liba52" = yes ; then
5978 _def_liba52='#define USE_LIBA52 1'
5979 _codecmodules="liba52 $_codecmodules"
5980 else
5981 _def_liba52='#undef USE_LIBA52'
5982 _nocodecmodules="liba52 $_nocodecmodules"
5984 echores "$_liba52"
5986 echocheck "libdca support"
5987 if test "$_libdca" = auto ; then
5988 _libdca=no
5989 cat > $TMPC << EOF
5990 #include <inttypes.h>
5991 #include <dts.h>
5992 int main(void) { dts_init (0); return 0; }
5994 for _ld_dca in -ldts -ldca ; do
5995 cc_check $_ld_dca $_ld_lm && _ld_extra="$_ld_extra $_ld_dca" \
5996 && _libdca=yes && break
5997 done
5999 if test "$_libdca" = yes ; then
6000 _def_libdca='#define USE_LIBDCA 1'
6001 _codecmodules="libdca $_codecmodules"
6002 else
6003 _def_libdca='#undef USE_LIBDCA'
6004 _nocodecmodules="libdca $_nocodecmodules"
6006 echores "$_libdca"
6008 echocheck "internal libmpeg2 support"
6009 if test "$_libmpeg2" = yes ; then
6010 _def_libmpeg2='#define USE_LIBMPEG2 1'
6011 _codecmodules="libmpeg2 $_codecmodules"
6012 else
6013 _def_libmpeg2='#undef USE_LIBMPEG2'
6014 _nocodecmodules="libmpeg2 $_nocodecmodules"
6016 echores "$_libmpeg2"
6018 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6019 if test "$_musepack" = auto ; then
6020 _musepack=no
6021 cat > $TMPC << EOF
6022 #include <mpcdec/mpcdec.h>
6023 int main(void) {
6024 mpc_streaminfo info;
6025 mpc_decoder decoder;
6026 mpc_decoder_set_streaminfo(&decoder, &info);
6027 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6030 cc_check -lmpcdec $_ld_lm && _musepack=yes
6032 if test "$_musepack" = yes ; then
6033 _def_musepack='#define HAVE_MUSEPACK 1'
6034 _ld_extra="$_ld_extra -lmpcdec"
6035 _codecmodules="musepack $_codecmodules"
6036 else
6037 _def_musepack='#undef HAVE_MUSEPACK'
6038 _nocodecmodules="musepack $_nocodecmodules"
6040 echores "$_musepack"
6043 echocheck "FAAC (AAC encoder) support"
6044 if test "$_faac" = auto ; then
6045 cat > $TMPC <<EOF
6046 #include <inttypes.h>
6047 #include <faac.h>
6048 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6050 _faac=no
6051 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6052 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6053 done
6055 if test "$_faac" = yes ; then
6056 _def_faac="#define HAVE_FAAC 1"
6057 if echo $_libavencoders | grep -q FAAC ; then
6058 _lavc_faac=yes
6059 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
6060 _libs_mplayer="$_libs_mplayer $_ld_faac"
6061 else
6062 _lavc_faac=no
6063 _def_lavc_faac="#undef CONFIG_LIBFAAC"
6065 _codecmodules="faac $_codecmodules"
6066 else
6067 _def_faac="#undef HAVE_FAAC"
6068 _nocodecmodules="faac $_nocodecmodules"
6069 _libavencoders=`echo $_libavencoders | sed -e s/LIBFAAC_ENCODER// `
6071 echores "$_faac (in libavcodec: $_lavc_faac)"
6074 echocheck "FAAD2 (AAC) support"
6075 if test "$_faad_internal" = auto ; then
6076 if x86_32 && test cc_vendor=gnu; then
6077 case $cc_version in
6078 3.1*|3.2) # ICE/insn with these versions
6079 _faad_internal=no
6080 _res_comment="broken gcc"
6083 _faad_internal=yes
6085 esac
6086 else
6087 _faad_internal=yes
6089 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6090 _faad_external=no
6091 cat > $TMPC << EOF
6092 #include <faad.h>
6093 #ifndef FAAD_MIN_STREAMSIZE
6094 #error Too old version
6095 #endif
6096 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6098 cc_check -lfaad $_ld_lm && _faad_external=yes
6101 if test "$_faad_internal" = yes ; then
6102 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6103 _faad=yes
6104 _res_comment="internal floating-point"
6105 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
6106 elif test "$_faad_external" = yes ; then
6107 _faad=yes
6108 _ld_extra="$_ld_extra -lfaad"
6109 else
6110 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6111 _faad=no
6114 if test "$_faad" = yes ; then
6115 _def_faad='#define HAVE_FAAD 1'
6116 _codecmodules="faad2 $_codecmodules"
6117 else
6118 _def_faad='#undef HAVE_FAAD'
6119 _nocodecmodules="faad2 $_nocodecmodules"
6121 echores "$_faad"
6124 echocheck "LADSPA plugin support"
6125 if test "$_ladspa" = auto ; then
6126 cat > $TMPC <<EOF
6127 #include <stdio.h>
6128 #include <ladspa.h>
6129 int main(void) {
6130 const LADSPA_Descriptor *ld = NULL;
6131 return 0;
6134 _ladspa=no
6135 cc_check && _ladspa=yes
6137 if test "$_ladspa" = yes; then
6138 _def_ladspa="#define HAVE_LADSPA"
6139 _afsrc="$_afsrc af_ladspa.c"
6140 _afmodules="ladspa $_afmodules"
6141 else
6142 _def_ladspa="#undef HAVE_LADSPA"
6143 _noafmodules="ladspa $_noafmodules"
6145 echores "$_ladspa"
6148 if test -z "$_codecsdir" ; then
6149 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6150 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6151 if test -d "$dir" ; then
6152 _codecsdir="$dir"
6153 break;
6155 done
6157 # Fall back on default directory.
6158 if test -z "$_codecsdir" ; then
6159 _codecsdir="$_libdir/codecs"
6160 mingw32 && _codecsdir="codecs"
6164 echocheck "Win32 codecs"
6165 if test "$_win32dll" = auto ; then
6166 _win32dll=no
6167 if x86_32 && ! qnx; then
6168 _win32dll=yes
6171 if test "$_win32dll" = yes ; then
6172 _def_win32dll='#define USE_WIN32DLL 1'
6173 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6174 _res_comment="using $_win32codecsdir"
6175 if ! win32 ; then
6176 _def_win32_loader='#define WIN32_LOADER 1'
6177 else
6178 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6179 _res_comment="using native windows"
6181 _codecmodules="win32 $_codecmodules"
6182 else
6183 _def_win32dll='#undef USE_WIN32DLL'
6184 _def_win32_loader='#undef WIN32_LOADER'
6185 _nocodecmodules="win32 $_nocodecmodules"
6187 echores "$_win32dll"
6190 echocheck "XAnim codecs"
6191 if test "$_xanim" = auto ; then
6192 _xanim=no
6193 _res_comment="dynamic loader support needed"
6194 if test "$_dl" = yes ; then
6195 _xanim=yes
6198 if test "$_xanim" = yes ; then
6199 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6200 _def_xanim='#define USE_XANIM 1'
6201 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6202 _codecmodules="xanim $_codecmodules"
6203 _res_comment="using $_xanimcodecsdir"
6204 else
6205 _def_xanim='#undef USE_XANIM'
6206 _def_xanim_path='#undef XACODEC_PATH'
6207 _nocodecmodules="xanim $_nocodecmodules"
6209 echores "$_xanim"
6212 echocheck "RealPlayer codecs"
6213 if test "$_real" = auto ; then
6214 _real=no
6215 _res_comment="dynamic loader support needed"
6216 if test "$_dl" = yes || test "$_win32dll" = yes &&
6217 (linux || freebsd || netbsd || win32 || darwin) ; then
6218 _real=yes
6221 if test "$_real" = yes ; then
6222 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6223 _def_real='#define USE_REALCODECS 1'
6224 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6225 _codecmodules="real $_codecmodules"
6226 _res_comment="using $_realcodecsdir"
6227 else
6228 _def_real='#undef USE_REALCODECS'
6229 _def_real_path="#undef REALCODEC_PATH"
6230 _nocodecmodules="real $_nocodecmodules"
6232 echores "$_real"
6235 echocheck "QuickTime codecs"
6236 if test "$_qtx" = auto ; then
6237 test "$_win32dll" = yes || darwin && _qtx=yes
6239 if test "$_qtx" = yes ; then
6240 _def_qtx='#define USE_QTX_CODECS 1'
6241 _codecmodules="qtx $_codecmodules"
6242 else
6243 _def_qtx='#undef USE_QTX_CODECS'
6244 _nocodecmodules="qtx $_nocodecmodules"
6246 echores "$_qtx"
6248 echocheck "Nemesi Streaming Media libraries"
6249 if test "$_nemesi" = auto && test "$_network" = yes ; then
6250 _nemesi=no
6251 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6252 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6253 _nemesi=yes
6256 if test "$_nemesi" = yes; then
6257 _native_rtsp=no
6258 _def_nemesi='#define LIBNEMESI 1'
6259 _inputmodules="nemesi $_inputmodules"
6260 else
6261 _native_rtsp="$_network"
6262 _nemesi=no
6263 _def_nemesi='#undef LIBNEMESI'
6264 _noinputmodules="nemesi $_noinputmodules"
6266 echores "$_nemesi"
6268 echocheck "LIVE555 Streaming Media libraries"
6269 if test "$_live" = auto && test "$_network" = yes ; then
6270 cat > $TMPCPP << EOF
6271 #include <liveMedia.hh>
6272 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6273 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6274 #endif
6275 int main(void) {}
6278 _live=no
6279 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6280 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6281 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6282 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6283 $_livelibdir/groupsock/libgroupsock.a \
6284 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6285 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6286 $_ld_extra -lstdc++" \
6287 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6288 -I$_livelibdir/UsageEnvironment/include \
6289 -I$_livelibdir/BasicUsageEnvironment/include \
6290 -I$_livelibdir/groupsock/include" && \
6291 _live=yes && break
6292 done
6293 if test "$_live" != yes ; then
6294 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6295 _live_dist=yes
6299 if test "$_live" = yes && test "$_network" = yes; then
6300 _res_comment="using $_livelibdir"
6301 _def_live='#define STREAMING_LIVE555 1'
6302 _inputmodules="live555 $_inputmodules"
6303 elif test "$_live_dist" = yes && test "$_network" = yes; then
6304 _res_comment="using distribution version"
6305 _live="yes"
6306 _def_live='#define STREAMING_LIVE555 1'
6307 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6308 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6309 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6310 _inputmodules="live555 $_inputmodules"
6311 else
6312 _live=no
6313 _def_live='#undef STREAMING_LIVE555'
6314 _noinputmodules="live555 $_noinputmodules"
6316 echores "$_live"
6319 echocheck "FFmpeg libavutil"
6320 if test "$_libavutil_a" = auto ; then
6321 if test -d libavutil ; then
6322 _libavutil_a=yes
6323 _res_comment="static"
6324 else
6325 die "MPlayer will not compile without libavutil in the source tree."
6327 elif test "$_libavutil_so" = auto ; then
6328 _libavutil_so=no
6329 cat > $TMPC << EOF
6330 #include <ffmpeg/common.h>
6331 int main(void) { ff_gcd(1,1); return 0; }
6333 if $_pkg_config --exists libavutil ; then
6334 _inc_libavutil=`$_pkg_config --cflags libavutil`
6335 _ld_tmp=`$_pkg_config --libs libavutil`
6336 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6337 && _libavutil_so=yes
6338 elif cc_check -lavutil $_ld_lm ; then
6339 _ld_extra="$_ld_extra -lavutil"
6340 _libavutil_so=yes
6341 _res_comment="using libavutil.so, but static libavutil is recommended"
6344 _libavutil=no
6345 _def_libavutil='#undef USE_LIBAVUTIL'
6346 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6347 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6348 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6349 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6350 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6351 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6352 # neither static nor shared libavutil is available, but it is mandatory ...
6353 if test "$_libavutil" = no ; then
6354 die "You need static or shared libavutil, MPlayer will not compile without!"
6356 echores "$_libavutil"
6358 echocheck "FFmpeg libavcodec"
6359 if test "$_libavcodec_a" = auto ; then
6360 _libavcodec_a=no
6361 if test -d libavcodec && test -f libavcodec/utils.c ; then
6362 _libavcodec_a="yes"
6363 _res_comment="static"
6365 elif test "$_libavcodec_so" = auto ; then
6366 _libavcodec_so=no
6367 _res_comment="libavcodec.so is discouraged over static libavcodec"
6368 cat > $TMPC << EOF
6369 #include <ffmpeg/avcodec.h>
6370 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6372 if $_pkg_config --exists libavcodec ; then
6373 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6374 _ld_tmp=`$_pkg_config --libs libavcodec`
6375 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6376 && _libavcodec_so=yes
6377 elif cc_check -lavcodec $_ld_lm ; then
6378 _ld_extra="$_ld_extra -lavcodec"
6379 _libavcodec_so=yes
6380 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6383 _libavcodec=no
6384 _def_libavcodec='#undef USE_LIBAVCODEC'
6385 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6386 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6387 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6388 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6389 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6390 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6391 test "$_libavcodec_mpegaudio_hp" = yes \
6392 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6393 if test "$_libavcodec_a" = yes ; then
6394 _codecmodules="libavcodec $_codecmodules"
6395 elif test "$_libavcodec_so" = yes ; then
6396 _codecmodules="libavcodec.so $_codecmodules"
6397 else
6398 _nocodecmodules="libavcodec $_nocodecmodules"
6400 echores "$_libavcodec"
6402 echocheck "FFmpeg libavformat"
6403 if test "$_libavformat_a" = auto ; then
6404 _libavformat_a=no
6405 if test -d libavformat && test -f libavformat/utils.c ; then
6406 _libavformat_a=yes
6407 _res_comment="static"
6409 elif test "$_libavformat_so" = auto ; then
6410 _libavformat_so=no
6411 cat > $TMPC <<EOF
6412 #include <ffmpeg/avformat.h>
6413 #include <ffmpeg/opt.h>
6414 int main(void) { av_alloc_format_context(); return 0; }
6416 if $_pkg_config --exists libavformat ; then
6417 _inc_libavformat=`$_pkg_config --cflags libavformat`
6418 _ld_tmp=`$_pkg_config --libs libavformat`
6419 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6420 && _libavformat_so=yes
6421 elif cc_check $_ld_lm -lavformat ; then
6422 _ld_extra="$_ld_extra -lavformat"
6423 _libavformat_so=yes
6424 _res_comment="using libavformat.so, but static libavformat is recommended"
6427 _libavformat=no
6428 _def_libavformat='#undef USE_LIBAVFORMAT'
6429 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6430 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6431 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6432 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6433 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6434 test "$_libavformat_so" = yes \
6435 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6436 echores "$_libavformat"
6438 echocheck "FFmpeg libpostproc"
6439 if test "$_libpostproc_a" = auto ; then
6440 _libpostproc_a=no
6441 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6442 _libpostproc_a='yes'
6443 _res_comment="static"
6445 elif test "$_libpostproc_so" = auto ; then
6446 _libpostproc_so=no
6447 cat > $TMPC << EOF
6448 #define USE_LIBPOSTPROC 1
6449 #include <inttypes.h>
6450 #include <postproc/postprocess.h>
6451 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6453 if cc_check -lpostproc $_ld_lm ; then
6454 _ld_extra="$_ld_extra -lpostproc"
6455 _libpostproc_so=yes
6456 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6459 _libpostproc=no
6460 _def_libpostproc='#undef USE_LIBPOSTPROC'
6461 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6462 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6463 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6464 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6465 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6466 test "$_libpostproc_so" = yes \
6467 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6468 echores "$_libpostproc"
6471 echocheck "libamr narrowband"
6472 if test "$_libamr_nb" = auto ; then
6473 _libamr_nb=no
6474 cat > $TMPC << EOF
6475 #include <amrnb/interf_dec.h>
6476 int main(void) { Speech_Decode_Frame_init(); return 0; }
6478 cc_check -lamrnb && _libamr_nb=yes
6479 if test "$_libavcodec_a" != yes ; then
6480 _libamr_nb=no
6481 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6484 if test "$_libamr_nb" = yes ; then
6485 _libamr=yes
6486 _ld_extra="$_ld_extra -lamrnb"
6487 _def_libamr='#define CONFIG_LIBAMR 1'
6488 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6489 _codecmodules="libamr_nb $_codecmodules"
6490 else
6491 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6492 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6493 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6494 _nocodecmodules="libamr_nb $_nocodecmodules"
6496 echores "$_libamr_nb"
6499 echocheck "libamr wideband"
6500 if test "$_libamr_wb" = auto ; then
6501 _libamr_wb=no
6502 cat > $TMPC << EOF
6503 #include <amrwb/dec_if.h>
6504 int main(void) { D_IF_init(); return 0; }
6506 cc_check -lamrwb && _libamr_wb=yes
6507 if test "$_libavcodec_a" != yes ; then
6508 _libamr_wb=no
6509 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6512 if test "$_libamr_wb" = yes ; then
6513 _libamr=yes
6514 _ld_extra="$_ld_extra -lamrwb"
6515 _def_libamr='#define CONFIG_LIBAMR 1'
6516 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6517 _codecmodules="libamr_wb $_codecmodules"
6518 else
6519 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6520 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6521 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6522 _nocodecmodules="libamr_wb $_nocodecmodules"
6524 echores "$_libamr_wb"
6526 echocheck "libdv-0.9.5+"
6527 if test "$_libdv" = auto ; then
6528 _libdv=no
6529 cat > $TMPC <<EOF
6530 #include <libdv/dv.h>
6531 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6533 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6535 if test "$_libdv" = yes ; then
6536 _def_libdv='#define HAVE_LIBDV095 1'
6537 _ld_extra="$_ld_extra -ldv"
6538 _codecmodules="libdv $_codecmodules"
6539 else
6540 _def_libdv='#undef HAVE_LIBDV095'
6541 _nocodecmodules="libdv $_nocodecmodules"
6543 echores "$_libdv"
6546 echocheck "XviD"
6547 if test "$_xvid" = auto ; then
6548 _xvid=no
6549 cat > $TMPC << EOF
6550 #include <xvid.h>
6551 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6553 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6554 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6555 done
6558 if test "$_xvid" = yes ; then
6559 _def_xvid='#define HAVE_XVID4 1'
6560 _codecmodules="xvid $_codecmodules"
6561 else
6562 _def_xvid='#undef HAVE_XVID4'
6563 _nocodecmodules="xvid $_nocodecmodules"
6564 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6566 echores "$_xvid"
6568 if test "$_xvid" = yes ; then
6569 echocheck "XviD two pass plugin"
6570 cat > $TMPC << EOF
6571 #include <xvid.h>
6572 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6574 if cc_check ; then
6575 _lavc_xvid=yes
6576 _def_lavc_xvid='#define CONFIG_LIBXVID 1'
6577 else
6578 _lavc_xvid=no
6579 _def_lavc_xvid='#undef CONFIG_LIBXVID'
6580 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6582 echores "$_lavc_xvid"
6586 echocheck "x264"
6587 if test "$_x264" = auto ; then
6588 cat > $TMPC << EOF
6589 #include <inttypes.h>
6590 #include <x264.h>
6591 #if X264_BUILD < 53
6592 #error We do not support old versions of x264. Get the latest from SVN.
6593 #endif
6594 int main(void) { x264_encoder_open((void*)0); return 0; }
6596 _x264=no
6597 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6598 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6599 done
6602 if test "$_x264" = yes ; then
6603 _def_x264='#define HAVE_X264 1'
6604 _codecmodules="x264 $_codecmodules"
6605 if echo $_libavencoders | grep -q X264 ; then
6606 _lavc_x264=yes
6607 _def_lavc_x264='#define CONFIG_LIBX264 1'
6608 _libs_mplayer="$_libs_mplayer $_ld_x264"
6609 else
6610 _lavc_x264=no
6611 _def_lavc_x264='#undef CONFIG_LIBX264'
6613 else
6614 _lavc_x264=no
6615 _def_x264='#undef HAVE_X264'
6616 _def_lavc_x264='#undef CONFIG_LIBX264'
6617 _nocodecmodules="x264 $_nocodecmodules"
6618 _libavencoders=`echo $_libavencoders | sed -e s/LIBX264_ENCODER// `
6620 echores "$_x264 (in libavcodec: $_lavc_x264)"
6623 echocheck "libnut"
6624 if test "$_libnut" = auto ; then
6625 cat > $TMPC << EOF
6626 #include <stdio.h>
6627 #include <stdlib.h>
6628 #include <inttypes.h>
6629 #include <libnut.h>
6630 int main(void) { (void)nut_error(0); return 0; }
6632 _libnut=no
6633 cc_check -lnut && _libnut=yes
6636 if test "$_libnut" = yes ; then
6637 _def_libnut='#define HAVE_LIBNUT 1'
6638 _ld_extra="$_ld_extra -lnut"
6639 else
6640 _def_libnut='#undef HAVE_LIBNUT'
6641 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6643 echores "$_libnut"
6646 # mencoder requires (optional) those libs: libmp3lame
6647 if test "$_mencoder" != no ; then
6649 echocheck "libmp3lame (for mencoder)"
6650 _mp3lame=no
6651 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6652 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6653 cat > $TMPC <<EOF
6654 #include <lame/lame.h>
6655 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; }
6657 # Note: libmp3lame usually depends on vorbis
6658 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6659 if test "$_mp3lame" = yes ; then
6660 _def_mp3lame="#define HAVE_MP3LAME"
6661 _ld_mp3lame=-lmp3lame
6662 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6663 cat > $TMPC << EOF
6664 #include <lame/lame.h>
6665 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6667 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6668 cat > $TMPC << EOF
6669 #include <lame/lame.h>
6670 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6672 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6673 if echo $_libavencoders | grep -q MP3LAME ; then
6674 _lavc_mp3lame=yes
6675 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6676 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6677 else
6678 _lavc_mp3lame=no
6679 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6681 else
6682 _def_mp3lame='#undef HAVE_MP3LAME'
6683 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6685 echores "$_mp3lame"
6689 echocheck "mencoder"
6690 _mencoder_flag='#undef HAVE_MENCODER'
6691 if test "$_mencoder" = yes ; then
6692 _mencoder_flag='#define HAVE_MENCODER'
6693 _def_muxers='#define CONFIG_MUXERS 1'
6694 else
6695 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6696 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6697 _libavmuxers=""
6699 echores "$_mencoder"
6701 echocheck "fastmemcpy"
6702 # fastmemcpy check is done earlier with tests of CPU & binutils features
6703 if test "$_fastmemcpy" = yes ; then
6704 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6705 else
6706 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6708 echores "$_fastmemcpy"
6711 echocheck "UnRAR executable"
6712 if test "$_unrar_exec" = auto ; then
6713 _unrar_exec="yes"
6714 mingw32 && _unrar_exec="no"
6716 if test "$_unrar_exec" = yes ; then
6717 _def_unrar_exec='#define USE_UNRAR_EXEC 1'
6718 else
6719 _def_unrar_exec='#undef USE_UNRAR_EXEC'
6721 echores "$_unrar_exec"
6723 echocheck "TV interface"
6724 if test "$_tv" = yes ; then
6725 _def_tv='#define USE_TV 1'
6726 _inputmodules="tv $_inputmodules"
6727 else
6728 _noinputmodules="tv $_noinputmodules"
6729 _def_tv='#undef USE_TV'
6731 echores "$_tv"
6734 if bsd; then
6735 echocheck "*BSD BT848 bt8xx header"
6736 _ioctl_bt848_h=no
6737 for file in "machine/ioctl_bt848.h" \
6738 "dev/bktr/ioctl_bt848.h" \
6739 "dev/video/bktr/ioctl_bt848.h" \
6740 "dev/ic/bt8xx.h" ; do
6741 cat > $TMPC <<EOF
6742 #include <sys/types.h>
6743 #include <sys/ioctl.h>
6744 #include <$file>
6745 int main(void) {
6746 ioctl(0, TVTUNER_GETFREQ, 0);
6747 return 0;
6750 if cc_check ; then
6751 _ioctl_bt848_h=yes
6752 _ioctl_bt848_h_name="$file"
6753 break;
6755 done
6756 if test "$_ioctl_bt848_h" = yes ; then
6757 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6758 _res_comment="using $_ioctl_bt848_h_name"
6759 else
6760 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6762 echores "$_ioctl_bt848_h"
6764 echocheck "*BSD ioctl_meteor.h"
6765 _ioctl_meteor_h=no
6766 for file in "machine/ioctl_meteor.h" \
6767 "dev/bktr/ioctl_meteor.h" \
6768 "dev/video/bktr/ioctl_meteor.h" ; do
6769 cat > $TMPC <<EOF
6770 #include <sys/types.h>
6771 #include <$file>
6772 int main(void) {
6773 ioctl(0, METEORSINPUT, 0);
6774 return 0;
6777 if cc_check ; then
6778 _ioctl_meteor_h=yes
6779 _ioctl_meteor_h_name="$file"
6780 break;
6782 done
6783 if test "$_ioctl_meteor_h" = yes ; then
6784 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6785 _res_comment="using $_ioctl_meteor_h_name"
6786 else
6787 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6789 echores "$_ioctl_meteor_h"
6791 echocheck "*BSD BrookTree 848 TV interface"
6792 if test "$_tv_bsdbt848" = auto ; then
6793 _tv_bsdbt848=no
6794 if test "$_tv" = yes ; then
6795 cat > $TMPC <<EOF
6796 #include <sys/types.h>
6797 $_def_ioctl_meteor_h_name
6798 $_def_ioctl_bt848_h_name
6799 #ifdef IOCTL_METEOR_H_NAME
6800 #include IOCTL_METEOR_H_NAME
6801 #endif
6802 #ifdef IOCTL_BT848_H_NAME
6803 #include IOCTL_BT848_H_NAME
6804 #endif
6805 int main(void){
6806 ioctl(0, METEORSINPUT, 0);
6807 ioctl(0, TVTUNER_GETFREQ, 0);
6808 return 0;
6811 cc_check && _tv_bsdbt848=yes
6814 if test "$_tv_bsdbt848" = yes ; then
6815 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6816 _inputmodules="tv-bsdbt848 $_inputmodules"
6817 else
6818 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6819 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6821 echores "$_tv_bsdbt848"
6822 fi #if bsd
6825 echocheck "DirectShow TV interface"
6826 if test "$_tv_dshow" = auto ; then
6827 _tv_dshow=no
6828 if test "$_tv" = yes && win32 ; then
6829 cat > $TMPC <<EOF
6830 #include <ole2.h>
6831 int main(void) {
6832 void* p;
6833 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6834 return 0;
6837 cc_check -lole32 -luuid && _tv_dshow=yes
6840 if test "$_tv_dshow" = yes ; then
6841 _inputmodules="tv-dshow $_inputmodules"
6842 _def_tv_dshow='#define HAVE_TV_DSHOW 1'
6843 _ld_extra="$_ld_extra -lole32 -luuid"
6844 else
6845 _noinputmodules="tv-dshow $_noinputmodules"
6846 _def_tv_dshow='#undef HAVE_TV_DSHOW'
6848 echores "$_tv_dshow"
6851 echocheck "Video 4 Linux TV interface"
6852 if test "$_tv_v4l1" = auto ; then
6853 _tv_v4l1=no
6854 if test "$_tv" = yes && linux ; then
6855 cat > $TMPC <<EOF
6856 #include <stdlib.h>
6857 #include <linux/videodev.h>
6858 int main(void) { return 0; }
6860 cc_check && _tv_v4l1=yes
6863 if test "$_tv_v4l1" = yes ; then
6864 _audio_input=yes
6865 _tv_v4l=yes
6866 _def_tv_v4l='#define HAVE_TV_V4L 1'
6867 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6868 _inputmodules="tv-v4l $_inputmodules"
6869 else
6870 _noinputmodules="tv-v4l1 $_noinputmodules"
6871 _def_tv_v4l='#undef HAVE_TV_V4L'
6873 echores "$_tv_v4l1"
6876 echocheck "Video 4 Linux 2 TV interface"
6877 if test "$_tv_v4l2" = auto ; then
6878 _tv_v4l2=no
6879 if test "$_tv" = yes && linux ; then
6880 cat > $TMPC <<EOF
6881 #include <stdlib.h>
6882 #include <linux/types.h>
6883 #include <linux/videodev2.h>
6884 int main(void) { return 0; }
6886 cc_check && _tv_v4l2=yes
6889 if test "$_tv_v4l2" = yes ; then
6890 _audio_input=yes
6891 _tv_v4l=yes
6892 _def_tv_v4l='#define HAVE_TV_V4L 1'
6893 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6894 _inputmodules="tv-v4l2 $_inputmodules"
6895 else
6896 _noinputmodules="tv-v4l2 $_noinputmodules"
6897 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6899 echores "$_tv_v4l2"
6902 echocheck "TV teletext interface"
6903 if test "$_tv_teletext" = auto ; then
6904 _tv_teletext=no
6905 if test "$_freetype" = yes && test "$_pthreads" = yes; then
6906 if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes; then
6907 _tv_teletext=yes
6911 if test "$_tv_teletext" = yes ; then
6912 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6913 _inputmodules="tv-teletext $_inputmodules"
6914 else
6915 _noinputmodules="tv-teletext $_noinputmodules"
6916 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6918 echores "$_tv_teletext"
6921 echocheck "Radio interface"
6922 if test "$_radio" = yes ; then
6923 _def_radio='#define USE_RADIO 1'
6924 _inputmodules="radio $_inputmodules"
6925 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6926 _radio_capture=no
6928 if test "$_radio_capture" = yes ; then
6929 _audio_input=yes
6930 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6931 else
6932 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6934 else
6935 _noinputmodules="radio $_noinputmodules"
6936 _def_radio='#undef USE_RADIO'
6937 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6938 _radio_capture=no
6940 echores "$_radio"
6941 echocheck "Capture for Radio interface"
6942 echores "$_radio_capture"
6944 echocheck "Video 4 Linux 2 Radio interface"
6945 if test "$_radio_v4l2" = auto ; then
6946 _radio_v4l2=no
6947 if test "$_radio" = yes && linux ; then
6948 cat > $TMPC <<EOF
6949 #include <stdlib.h>
6950 #include <linux/types.h>
6951 #include <linux/videodev2.h>
6952 int main(void) { return 0; }
6954 cc_check && _radio_v4l2=yes
6957 if test "$_radio_v4l2" = yes ; then
6958 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6959 else
6960 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6962 echores "$_radio_v4l2"
6964 echocheck "Video 4 Linux Radio interface"
6965 if test "$_radio_v4l" = auto ; then
6966 _radio_v4l=no
6967 if test "$_radio" = yes && linux ; then
6968 cat > $TMPC <<EOF
6969 #include <stdlib.h>
6970 #include <linux/videodev.h>
6971 int main(void) { return 0; }
6973 cc_check && _radio_v4l=yes
6976 if test "$_radio_v4l" = yes ; then
6977 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6978 else
6979 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6981 echores "$_radio_v4l"
6983 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6984 echocheck "*BSD BrookTree 848 Radio interface"
6985 _radio_bsdbt848=no
6986 cat > $TMPC <<EOF
6987 #include <sys/types.h>
6988 $_def_ioctl_bt848_h_name
6989 #ifdef IOCTL_BT848_H_NAME
6990 #include IOCTL_BT848_H_NAME
6991 #endif
6992 int main(void){
6993 ioctl(0, RADIO_GETFREQ, 0);
6994 return 0;
6997 cc_check && _radio_bsdbt848=yes
6998 echores "$_radio_bsdbt848"
6999 fi #if bsd && radio && radio_bsdbt848
7001 if test "$_radio_bsdbt848" = yes ; then
7002 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
7003 else
7004 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
7007 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7008 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7009 die "Radio driver requires BSD BT848, V4L or V4L2!"
7012 echocheck "Video 4 Linux 2 MPEG PVR interface"
7013 if test "$_pvr" = auto ; then
7014 _pvr=no
7015 if test "$_tv_v4l2" = yes && linux ; then
7016 cat > $TMPC <<EOF
7017 #include <stdlib.h>
7018 #include <inttypes.h>
7019 #include <linux/types.h>
7020 #include <linux/videodev2.h>
7021 int main(void) { struct v4l2_ext_controls ext; return 0; }
7023 cc_check && _pvr=yes
7026 if test "$_pvr" = yes ; then
7027 _def_pvr='#define HAVE_PVR 1'
7028 _inputmodules="pvr $_inputmodules"
7029 else
7030 _noinputmodules="pvr $_noinputmodules"
7031 _def_pvr='#undef HAVE_PVR'
7033 echores "$_pvr"
7036 echocheck "audio select()"
7037 if test "$_select" = no ; then
7038 _def_select='#undef HAVE_AUDIO_SELECT'
7039 elif test "$_select" = yes ; then
7040 _def_select='#define HAVE_AUDIO_SELECT 1'
7042 echores "$_select"
7045 echocheck "ftp"
7046 if ! beos && test "$_ftp" = yes ; then
7047 _def_ftp='#define HAVE_FTP 1'
7048 _inputmodules="ftp $_inputmodules"
7049 else
7050 _noinputmodules="ftp $_noinputmodules"
7051 _def_ftp='#undef HAVE_FTP'
7053 echores "$_ftp"
7055 echocheck "vstream client"
7056 if test "$_vstream" = auto ; then
7057 _vstream=no
7058 cat > $TMPC <<EOF
7059 #include <vstream-client.h>
7060 void vstream_error(const char *format, ... ) {}
7061 int main(void) { vstream_start(); return 0; }
7063 cc_check -lvstream-client && _vstream=yes
7065 if test "$_vstream" = yes ; then
7066 _def_vstream='#define HAVE_VSTREAM 1'
7067 _inputmodules="vstream $_inputmodules"
7068 _ld_extra="$_ld_extra -lvstream-client"
7069 else
7070 _noinputmodules="vstream $_noinputmodules"
7071 _def_vstream='#undef HAVE_VSTREAM'
7073 echores "$_vstream"
7075 # endian testing
7076 echocheck "byte order"
7077 if test "$_big_endian" = auto ; then
7078 cat > $TMPC <<EOF
7079 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7080 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7081 int main(void){
7082 return (int)ascii_name;
7085 if cc_check ; then
7086 if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
7087 _big_endian=yes
7088 else
7089 _big_endian=no
7091 else
7092 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7095 if test "$_big_endian" = yes ; then
7096 _byte_order='big-endian'
7097 _def_words_endian='#define WORDS_BIGENDIAN 1'
7098 else
7099 _byte_order='little-endian'
7100 _def_words_endian='#undef WORDS_BIGENDIAN'
7102 echores "$_byte_order"
7104 echocheck "OSD menu"
7105 if test "$_menu" = yes ; then
7106 _def_menu='#define HAVE_MENU 1'
7107 else
7108 _def_menu='#undef HAVE_MENU'
7110 echores "$_menu"
7113 echocheck "Subtitles sorting"
7114 if test "$_sortsub" = yes ; then
7115 _def_sortsub='#define USE_SORTSUB 1'
7116 else
7117 _def_sortsub='#undef USE_SORTSUB'
7119 echores "$_sortsub"
7122 echocheck "XMMS inputplugin support"
7123 if test "$_xmms" = yes ; then
7124 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7125 _xmmsplugindir=`xmms-config --input-plugin-dir`
7126 _xmmslibdir=`xmms-config --exec-prefix`/lib
7127 else
7128 _xmmsplugindir=/usr/lib/xmms/Input
7129 _xmmslibdir=/usr/lib
7132 _def_xmms='#define HAVE_XMMS 1'
7133 if darwin ; then
7134 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7135 else
7136 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7138 else
7139 _def_xmms='#undef HAVE_XMMS'
7141 echores "$_xmms"
7143 echocheck "inet6"
7144 if test "$_inet6" = auto ; then
7145 cat > $TMPC << EOF
7146 #include <sys/types.h>
7147 #if !defined(_WIN32) || defined(__CYGWIN__)
7148 #include <sys/socket.h>
7149 #include <netinet/in.h>
7150 #else
7151 #include <ws2tcpip.h>
7152 #endif
7153 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7155 _inet6=no
7156 if cc_check $_ld_sock ; then
7157 _inet6=yes
7160 if test "$_inet6" = yes ; then
7161 _def_inet6='#define HAVE_AF_INET6 1'
7162 else
7163 _def_inet6='#undef HAVE_AF_INET6'
7165 echores "$_inet6"
7168 echocheck "gethostbyname2"
7169 if test "$_gethostbyname2" = auto ; then
7170 cat > $TMPC << EOF
7171 #include <sys/types.h>
7172 #include <sys/socket.h>
7173 #include <netdb.h>
7174 int main(void) { gethostbyname2("", AF_INET); }
7176 _gethostbyname2=no
7177 if cc_check ; then
7178 _gethostbyname2=yes
7182 if test "$_gethostbyname2" = yes ; then
7183 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7184 else
7185 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7187 echores "$_gethostbyname2"
7190 # --------------- GUI specific tests begin -------------------
7191 echocheck "GUI"
7192 echo "$_gui"
7193 if test "$_gui" = yes ; then
7195 # Required libraries
7196 if test "$_libavcodec" != yes ||
7197 ! echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1 ; then
7198 die "The GUI requires libavcodec with PNG support (needs zlib)."
7200 if ! win32 ; then
7201 test "$_x11" != yes && die "X11 support required for GUI compilation."
7203 echocheck "XShape extension"
7204 if test "$_xshape" = auto ; then
7205 _xshape=no
7206 cat > $TMPC << EOF
7207 #include <X11/Xlib.h>
7208 #include <X11/Xproto.h>
7209 #include <X11/Xutil.h>
7210 #include <X11/extensions/shape.h>
7211 #include <stdlib.h>
7212 int main(void) {
7213 char *name = ":0.0";
7214 Display *wsDisplay;
7215 int exitvar = 0;
7216 int eventbase, errorbase;
7217 if (getenv("DISPLAY"))
7218 name=getenv("DISPLAY");
7219 wsDisplay=XOpenDisplay(name);
7220 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7221 exitvar=1;
7222 XCloseDisplay(wsDisplay);
7223 return exitvar;
7226 cc_check -lXext && _xshape=yes
7228 if test "$_xshape" = yes ; then
7229 _def_xshape='#define HAVE_XSHAPE 1'
7230 else
7231 die "The GUI requires the X11 extension XShape (which was not found)."
7233 echores "$_xshape"
7235 #Check for GTK
7236 if test "$_gtk1" = no ; then
7237 #Check for GTK2 :
7238 echocheck "GTK+ version"
7240 if $_pkg_config gtk+-2.0 --exists ; then
7241 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7242 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7243 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7244 echores "$_gtk"
7246 # Check for GLIB2
7247 if $_pkg_config glib-2.0 --exists ; then
7248 echocheck "glib version"
7249 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7250 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7251 echores "$_glib"
7253 _def_gui='#define HAVE_NEW_GUI 1'
7254 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7255 else
7256 _gtk1=yes
7257 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7259 else
7260 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7261 _gtk1=yes
7265 if test "$_gtk1" = yes ; then
7266 # Check for old GTK (1.2.x)
7267 echocheck "GTK version"
7268 if test -z "$_gtkconfig" ; then
7269 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7270 _gtkconfig="gtk-config"
7271 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7272 _gtkconfig="gtk12-config"
7273 else
7274 die "The GUI requires GTK devel packages (which were not found)."
7277 _gtk=`$_gtkconfig --version 2>&1`
7278 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7279 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7280 echores "$_gtk (using $_gtkconfig)"
7282 # Check for GLIB
7283 echocheck "glib version"
7284 if test -z "$_glibconfig" ; then
7285 if ( glib-config --version ) >/dev/null 2>&1 ; then
7286 _glibconfig="glib-config"
7287 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7288 _glibconfig="glib12-config"
7289 else
7290 die "The GUI requires GLIB devel packages (which were not found)"
7293 _glib=`$_glibconfig --version 2>&1`
7294 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7295 echores "$_glib (using $_glibconfig)"
7297 _def_gui='#define HAVE_NEW_GUI 1'
7298 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7301 else #if ! win32
7302 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7303 _def_gui='#define HAVE_NEW_GUI 1'
7304 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7305 fi #if ! win32
7307 else #if test "$_gui"
7308 _def_gui='#undef HAVE_NEW_GUI'
7309 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7310 fi #if test "$_gui"
7311 # --------------- GUI specific tests end -------------------
7314 if test "$_charset" = "noconv" ; then
7315 _charset=""
7317 if test "$_charset" ; then
7318 _def_charset="#define MSG_CHARSET \"$_charset\""
7319 else
7320 _def_charset="#undef MSG_CHARSET"
7323 if test "$_charset" = "UTF-8" ; then
7324 # hack to disable conversion in the Makefile
7325 _charset=""
7328 if test "$_charset" ; then
7329 echocheck "iconv program"
7330 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7331 if test "$?" -ne 0 ; then
7332 echores "no"
7333 echo "No working iconv program found, use "
7334 echo "--charset=UTF-8 to continue anyway."
7335 echo "If you also have problems with iconv library functions use --charset=noconv."
7336 echo "Messages in the GTK-2 interface will be broken then."
7337 exit 1
7338 else
7339 echores "yes"
7343 #############################################################################
7345 echocheck "automatic gdb attach"
7346 if test "$_crash_debug" = yes ; then
7347 _def_crash_debug='#define CRASH_DEBUG 1'
7348 else
7349 _def_crash_debug='#undef CRASH_DEBUG'
7350 _crash_debug=no
7352 echores "$_crash_debug"
7354 echocheck "compiler support for noexecstack"
7355 cat > $TMPC <<EOF
7356 int main(void) { return 0; }
7358 if cc_check -Wl,-z,noexecstack ; then
7359 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7360 echores "yes"
7361 else
7362 echores "no"
7366 # Dynamic linking flags
7367 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7368 _ld_dl_dynamic=''
7369 bsd && _ld_dl_dynamic='-rdynamic'
7370 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin ; then
7371 _ld_dl_dynamic='-rdynamic'
7374 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7375 bsdos && _ld_extra="$_ld_extra -ldvd"
7376 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7377 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7379 _def_debug='#undef MP_DEBUG'
7380 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7382 _def_linux='#undef TARGET_LINUX'
7383 linux && _def_linux='#define TARGET_LINUX 1'
7386 echocheck "joystick"
7387 _def_joystick='#undef HAVE_JOYSTICK'
7388 if test "$_joystick" = yes ; then
7389 if linux ; then
7390 # TODO add some check
7391 _def_joystick='#define HAVE_JOYSTICK 1'
7392 else
7393 _joystick="no (unsupported under $system_name)"
7396 echores "$_joystick"
7398 echocheck "lirc"
7399 if test "$_lirc" = auto ; then
7400 _lirc=no
7401 cat > $TMPC <<EOF
7402 #include <lirc/lirc_client.h>
7403 int main(void) { return 0; }
7405 cc_check -llirc_client && _lirc=yes
7407 if test "$_lirc" = yes ; then
7408 _def_lirc='#define HAVE_LIRC 1'
7409 _ld_extra="$_ld_extra -llirc_client"
7410 else
7411 _def_lirc='#undef HAVE_LIRC'
7413 echores "$_lirc"
7415 echocheck "lircc"
7416 if test "$_lircc" = auto ; then
7417 _lircc=no
7418 cat > $TMPC <<EOF
7419 #include <lirc/lircc.h>
7420 int main(void) { return 0; }
7422 cc_check -llircc && _lircc=yes
7424 if test "$_lircc" = yes ; then
7425 _def_lircc='#define HAVE_LIRCC 1'
7426 _ld_extra="$_ld_extra -llircc"
7427 else
7428 _def_lircc='#undef HAVE_LIRCC'
7430 echores "$_lircc"
7432 if arm; then
7433 # Detect maemo development platform libraries availability (http://www.maemo.org),
7434 # they are used when run on Nokia 770
7435 echocheck "maemo (Nokia 770)"
7436 if test "$_maemo" = auto ; then
7437 _maemo=no
7438 cat > $TMPC << EOF
7439 #include <libosso.h>
7440 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7442 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7444 if test "$_maemo" = yes ; then
7445 _def_maemo='#define HAVE_MAEMO 1'
7446 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7447 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7448 else
7449 _def_maemo='#undef HAVE_MAEMO'
7451 echores "$_maemo"
7454 echocheck "color console output"
7455 if test "$_color_console" = yes ; then
7456 _def_color_console='#define MSG_USE_COLORS 1'
7457 else
7458 _def_color_console='#undef MSG_USE_COLORS'
7460 echores "$_color_console"
7462 # linker paths should be the same for mencoder and mplayer
7463 _ld_tmp=""
7464 for I in $_libs_mplayer ; do
7465 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7466 if test -z "$_tmp" ; then
7467 _ld_extra="$I $_ld_extra"
7468 else
7469 _ld_tmp="$_ld_tmp $I"
7471 done
7472 _libs_mplayer=$_ld_tmp
7475 #############################################################################
7476 if darwin ; then
7477 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
7478 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7479 CFLAGS="$CFLAGS -no-cpp-precomp"
7482 if amigaos ; then
7483 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__"
7485 if hpux ; then
7486 # use flag for HPUX missing setenv()
7487 CFLAGS="$CFLAGS -DHPUX"
7489 # Thread support
7490 if linux ; then
7491 CFLAGS="$CFLAGS -D_REENTRANT"
7492 elif bsd ; then
7493 # FIXME bsd needs this so maybe other OS'es
7494 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7496 if cygwin ; then
7497 CFLAGS="$CFLAGS -D__CYGWIN__"
7499 # 64 bit file offsets?
7500 if test "$_largefiles" = yes || freebsd ; then
7501 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7502 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7503 # dvdread support requires this (for off64_t)
7504 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7505 cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
7509 # Make sure config.h gets included.
7510 if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then
7511 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
7514 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7515 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7517 cat > $TMPC << EOF
7518 int main(void) { return 0; }
7520 if test "$cc_vendor" = "gnu" ; then
7521 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7522 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7523 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7527 #this must be the last test to be performed or the ones following it will likely fail
7528 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7529 # to use its own copy of the library)
7530 echocheck "DVD support (libdvdnav)"
7531 if test "$_dvdnav" = auto ; then
7532 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7534 if test "$_dvdnav" = auto ; then
7535 cat > $TMPC <<EOF
7536 #include <inttypes.h>
7537 #include <dvdnav.h>
7538 int main(void) { dvdnav_t *dvd=0; return 0; }
7540 _dvdnav=no
7541 _dvdnavdir=`$_dvdnavconfig --cflags`
7542 _dvdnavlibs=`$_dvdnavconfig --libs`
7543 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7545 if test "$_dvdnav" = yes ; then
7546 _largefiles=yes
7547 _def_dvdnav='#define USE_DVDNAV 1'
7548 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7549 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7550 _inputmodules="dvdnav $_inputmodules"
7551 else
7552 _def_dvdnav='#undef USE_DVDNAV'
7553 _noinputmodules="dvdnav $_noinputmodules"
7555 echores "$_dvdnav"
7557 #############################################################################
7558 echo "Creating config.mak"
7559 cat > config.mak << EOF
7560 # -------- Generated by configure -----------
7562 LANG = C
7563 MAN_LANG = $MAN_LANG
7564 TARGET_OS = $system_name
7565 DESTDIR =
7566 prefix = \$(DESTDIR)$_prefix
7567 BINDIR = \$(DESTDIR)$_bindir
7568 DATADIR = \$(DESTDIR)$_datadir
7569 MANDIR = \$(DESTDIR)$_mandir
7570 CONFDIR = \$(DESTDIR)$_confdir
7571 LIBDIR = \$(DESTDIR)$_libdir
7572 # FFmpeg uses libdir instead of LIBDIR
7573 libdir = \$(LIBDIR)
7574 AR = $_ar
7575 CC = $_cc
7576 CXX = $_cc
7577 HOST_CC = $_host_cc
7578 RANLIB = $_ranlib
7579 LDCONFIG = $_ldconfig
7580 INSTALL = $_install
7581 EXTRA_INC = $_inc_extra
7582 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7583 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7584 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7585 CFLAG_STACKREALIGN = $_stackrealign
7586 INSTALLSTRIP = $_install_strip
7587 CHARSET = $_charset
7588 HELP_FILE = $_mp_help
7590 EXESUF = $_exesuf
7592 MPLAYER_NETWORK = $_network
7593 FTP = $_ftp
7594 STREAMING_LIVE555 = $_live
7595 LIBNEMESI = $_nemesi
7596 NATIVE_RTSP = $_native_rtsp
7597 VSTREAM = $_vstream
7598 STREAM_CACHE = $_stream_cache
7599 DVBIN = $_dvbin
7600 VIDIX = $_vidix
7601 VIDIX_INTERNAL = $_vidix_internal
7602 VIDIX_EXTERNAL = $_vidix_external
7603 VIDIX_PCIDB = $_vidix_pcidb_val
7604 CONFIG_PP = yes
7605 MP3LAME = $_mp3lame
7606 LIBMENU = $_menu
7608 MP3LIB = $_mp3lib
7609 LIBA52 = $_liba52
7610 LIBMPEG2 = $_libmpeg2
7611 TREMOR_INTERNAL = $_tremor_internal
7612 TREMOR_LOW = $_tremor_low
7613 FAAD = $_faad
7615 SPEEX = $_speex
7616 MUSEPACK = $_musepack
7618 UNRAR_EXEC = $_unrar_exec
7619 PNG = $_png
7620 JPEG = $_jpeg
7621 GIF = $_gif
7623 EXTRALIBS = $_extra_libs
7624 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7625 EXTRALIBS_MPLAYER = $_libs_mplayer
7626 EXTRALIBS_MENCODER = $_libs_mencoder
7628 HAVE_MLIB = $_mlib
7629 HAVE_PTHREADS = $_pthreads
7630 HAVE_W32THREADS = $_w32threads
7632 HAVE_XVMC_ACCEL = $_xvmc
7634 HAVE_SYS_MMAN_H = $_mman
7635 HAVE_POSIX_SELECT = $_posix_select
7637 NEED_GETTIMEOFDAY = $_need_gettimeofday
7638 NEED_GLOB = $_need_glob
7639 NEED_SETENV = $_need_setenv
7640 NEED_SHMEM = $_need_shmem
7641 NEED_STRSEP = $_need_strsep
7642 NEED_SWAB = $_need_swab
7643 NEED_VSSCANF = $_need_vsscanf
7645 # for FFmpeg
7646 SRC_PATH=..
7647 BUILD_ROOT=..
7648 LIBPREF=lib
7649 LIBSUF=.a
7650 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7652 # audio output
7653 OSS = $_ossaudio
7654 ALSA = $_alsa
7655 ALSA5 = $_alsa5
7656 ALSA9 = $_alsa9
7657 ALSA1X = $_alsa1x
7659 # input/demuxer/codecs
7660 JOYSTICK = $_joystick
7661 LIRC = $_lirc
7662 APPLE_REMOTE = $_apple_remote
7663 TV = $_tv
7664 TV_V4L = $_tv_v4l
7665 TV_V4L1 = $_tv_v4l1
7666 TV_V4L2 = $_tv_v4l2
7667 TV_DSHOW = $_tv_dshow
7668 TV_BSDBT848 = $_tv_bsdbt848
7669 TV_TELETEXT = $_tv_teletext
7670 AUDIO_INPUT = $_audio_input
7671 PVR = $_pvr
7672 VCD = $_vcd
7673 DVDREAD = $_dvdread
7674 DVDREAD_INTERNAL = $_dvdread_internal
7675 DVDCSS_INTERNAL = $_libdvdcss_internal
7676 DVDNAV = $_dvdnav
7677 WIN32DLL = $_win32dll
7678 QTX_CODECS = $_qtx
7679 REAL_CODECS = $_real
7680 XANIM_CODECS = $_xanim
7681 LIBAVUTIL = $_libavutil
7682 LIBAVUTIL_A = $_libavutil_a
7683 LIBAVUTIL_SO = $_libavutil_so
7684 LIBAVCODEC = $_libavcodec
7685 LIBAVCODEC_A = $_libavcodec_a
7686 LIBAVCODEC_SO = $_libavcodec_so
7687 LIBAVFORMAT = $_libavformat
7688 LIBAVFORMAT_A = $_libavformat_a
7689 LIBAVFORMAT_SO = $_libavformat_so
7690 LIBPOSTPROC = $_libpostproc
7691 LIBPOSTPROC_A = $_libpostproc_a
7692 LIBPOSTPROC_SO = $_libpostproc_so
7693 ZORAN = $_zr
7694 LIBLZO = $_liblzo
7695 LIBDV = $_libdv
7696 XVID4 = $_xvid
7697 X264 = $_x264
7698 LIBNUT = $_libnut
7699 LIBDCA = $_libdca
7700 MPLAYER = $_mplayer
7701 MENCODER = $_mencoder
7702 CDDA = $_cdda
7703 CDDB = $_cddb
7704 BITMAP_FONT = $_bitmap_font
7705 FREETYPE = $_freetype
7706 ASS = $_ass
7707 LIBMAD = $_mad
7708 LIBVORBIS = $_vorbis
7709 LIBTHEORA = $_theora
7710 FAAD_INTERNAL = $_faad_internal
7711 FAAD_FIXED = $_faad_fixed
7712 LIBSMBCLIENT = $_smbsupport
7713 XMMS_PLUGINS = $_xmms
7714 MACOSX = $_macosx
7715 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7716 MACOSX_BUNDLE = $_macosx_bundle
7717 MACOSX_COREVIDEO = $_macosx_corevideo
7718 TOOLAME=$_toolame
7719 TWOLAME=$_twolame
7720 FAAC=$_faac
7721 CONFIG_LIBAMR=$_libamr
7722 CONFIG_LIBAMR_NB=$_libamr_nb
7723 CONFIG_LIBAMR_WB=$_libamr_wb
7724 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7725 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7726 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7727 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7728 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7729 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7730 CONFIG_LIBFAAC=$_lavc_faac
7731 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7732 CONFIG_LIBVORBIS=$_libvorbis
7733 CONFIG_LIBXVID=$_lavc_xvid
7734 CONFIG_LIBX264=$_lavc_x264
7735 CONFIG_ZLIB=$_zlib
7736 CONFIG_GPL=yes
7737 CONFIG_ENCODERS=$_mencoder
7738 CONFIG_MUXERS=$_mencoder
7739 RADIO=$_radio
7740 RADIO_CAPTURE=$_radio_capture
7741 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7742 VIDIX_IVTV=$_vidix_drv_ivtv
7743 VIDIX_MACH64=$_vidix_drv_mach64
7744 VIDIX_MGA=$_vidix_drv_mga
7745 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7746 VIDIX_NVIDIA=$_vidix_drv_nvidia
7747 VIDIX_PM2=$_vidix_drv_pm2
7748 VIDIX_PM3=$_vidix_drv_pm3
7749 VIDIX_RADEON=$_vidix_drv_radeon
7750 VIDIX_RAGE128=$_vidix_drv_rage128
7751 VIDIX_SAVAGE=$_vidix_drv_savage
7752 VIDIX_SIS=$_vidix_drv_sis
7753 VIDIX_UNICHROME=$_vidix_drv_unichrome
7755 # --- Some stuff for autoconfigure ----
7756 $_target_arch
7757 $_target_arch_x86
7758 $_confwin32
7759 TARGET_CPU=$iproc
7760 HAVE_MMX = $_mmx
7761 HAVE_MMX2 = $_mmxext
7762 HAVE_3DNOW = $_3dnow
7763 HAVE_3DNOWEX = $_3dnowext
7764 HAVE_SSE = $_sse
7765 HAVE_CMOV = $_cmov
7766 HAVE_ALTIVEC = $_altivec
7767 HAVE_ARMV5TE = $_armv5te
7768 HAVE_ARMV6 = $_armv6
7769 HAVE_IWMMXT = $_iwmmxt
7770 HAVE_VIS = $_vis
7772 # --- GUI stuff ---
7773 GUI = $_gui
7775 # --- libvo stuff ---
7776 VO_SRCS = $_vosrc
7778 # --- libao2 stuff ---
7779 AO_SRCS = $_aosrc
7781 # --- libaf stuff ---
7782 AF_SRCS = $_afsrc
7786 #############################################################################
7788 ff_config_enable () {
7789 _nprefix=$3;
7790 test -z "$_nprefix" && _nprefix='CONFIG'
7791 for part in $1; do
7792 if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
7793 echo "#define ${_nprefix}_$part 1"
7794 echo "#define ENABLE_$part 1"
7795 else
7796 echo "#define ENABLE_$part 0"
7798 done
7801 echo "Creating config.h"
7802 cat > $TMPH << EOF
7803 /* -------- This file has been automatically generated by configure ---------
7804 Note: Any changes in it will be lost when you run configure again. */
7806 /* Protect against multiple inclusion */
7807 #ifndef MPLAYER_CONFIG_H
7808 #define MPLAYER_CONFIG_H 1
7810 #define CONFIGURATION "$_configuration"
7812 /* make sure we never get lavformat's poll() emulation, the results are
7813 horrible if the X libs try to actually use it, see MPlayer-users
7814 Message-ID: <45D49541.8060101@infernix.net>
7815 Date: Thu, 15 Feb 2007 18:15:45 +0100
7816 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7818 #define HAVE_SYS_POLL_H 1
7820 /* yes, we have inttypes.h */
7821 #define HAVE_INTTYPES_H 1
7823 /* int_fastXY_t emulation */
7824 $_def_fast_inttypes
7826 /* libdvdcss */
7827 #define HAVE_ERRNO_H 1
7829 /* libdvdcss + libdvdread */
7830 #define HAVE_LIMITS_H 1
7832 /* libdvdcss + libfaad2 */
7833 #define HAVE_UNISTD_H 1
7835 /* libfaad2 + libdvdread */
7836 #define STDC_HEADERS 1
7838 /* libfaad2 */
7839 #define HAVE_MEMCPY 1
7840 #define HAVE_STRCHR 1
7842 /* libdvdread */
7843 #define HAVE_UINTPTR_T 1
7845 /* name of messages charset */
7846 $_def_charset
7848 /* Runtime CPU detection */
7849 $_def_runtime_cpudetection
7851 /* Dynamic a/v plugins */
7852 $_def_dynamic_plugins
7854 /* "restrict" keyword */
7855 $_def_restrict_keyword
7857 /* __builtin_expect branch prediction hint */
7858 $_def_builtin_expect
7859 #ifdef HAVE_BUILTIN_EXPECT
7860 #define likely(x) __builtin_expect ((x) != 0, 1)
7861 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7862 #else
7863 #define likely(x) (x)
7864 #define unlikely(x) (x)
7865 #endif
7867 /* attribute(used) as needed by some compilers */
7868 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7869 # define attribute_used __attribute__((used))
7870 #else
7871 # define attribute_used
7872 #endif
7874 /* compiler support for named assembler arguments */
7875 $_def_named_asm_args
7877 /* enable/disable SIGHANDLER */
7878 $_def_sighandler
7880 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7881 $_def_crash_debug
7883 /* Toggles debugging informations */
7884 $_def_debug
7886 /* Toggles color console output */
7887 $_def_color_console
7889 /* Indicates that libcdio is available for VCD and CD-DA playback */
7890 $_def_libcdio
7892 /* Indicates that Ogle's libdvdread is available for DVD playback */
7893 $_def_dvdread
7895 /* Indicates that dvdread is internal */
7896 $_def_dvdread_internal
7898 /* Additional options for libdvdread/libdvdcss */
7899 $_def_dvd
7900 $_def_cdrom
7901 $_def_cdio
7902 $_def_dvdio
7903 $_def_bsdi_dvd
7904 $_def_dvd_bsd
7905 $_def_dvd_linux
7906 $_dev_dvd_openbsd
7907 $_def_dvd_darwin
7908 $_def_sol_scsi_h
7909 $_def_hpux_scsi_h
7911 /* Common data directory (for fonts, etc) */
7912 #define MPLAYER_DATADIR "$_datadir"
7913 #define MPLAYER_CONFDIR "$_confdir"
7914 #define MPLAYER_LIBDIR "$_libdir"
7916 /* Define this to compile stream-caching support, it can be enabled via
7917 -cache <kilobytes> */
7918 $_def_stream_cache
7920 /* Define if you are using XviD library */
7921 $_def_xvid
7923 /* Define if you are using the X.264 library */
7924 $_def_x264
7926 /* Define if you are using libnut */
7927 $_def_libnut
7929 /* Define to include support for libdv-0.9.5 */
7930 $_def_libdv
7932 /* If build mencoder */
7933 $_mencoder_flag
7935 /* Indicates if libmp3lame is available
7936 Note: for mencoder */
7937 $_def_mp3lame
7938 $_def_mp3lame_preset
7939 $_def_mp3lame_preset_medium
7941 /* Undefine this if you do not want to select mono audio (left or right)
7942 with a stereo MPEG layer 2/3 audio stream. The command line option
7943 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7944 right-only), with 0 being the default.
7946 #define USE_FAKE_MONO 1
7948 /* Undefine this if your sound card driver has no working select().
7949 If you have kernel Oops, player hangups, or just no audio, you should
7950 try to recompile MPlayer with this option disabled! */
7951 $_def_select
7953 /* define this to use iconv(3) function to codepage conversions */
7954 $_def_iconv
7956 /* define this to use nl_langinfo function */
7957 $_def_langinfo
7959 /* define this to use RTC (/dev/rtc) for video timers */
7960 $_def_rtc
7962 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7963 #define MAX_OUTBURST 65536
7965 /* set up audio OUTBURST. Do not change this! */
7966 #define OUTBURST 512
7968 /* Define this if your system has the header file for the OSS sound interface */
7969 $_def_sys_soundcard
7971 /* Define this if your system has the header file for the OSS sound interface
7972 * in /usr/include */
7973 $_def_soundcard
7975 /* Define this if your system has the sysinfo header */
7976 $_def_sys_sysinfo
7978 /* Define this if your system has the "malloc.h" header file */
7979 $_def_malloc
7981 /* memalign is mapped to malloc if unsupported */
7982 $_def_memalign
7983 $_def_map_memalign
7984 $_def_memalign_hack
7986 /* assembler handling of .align */
7987 $_def_asmalign_pot
7989 /* Define this if your system has the "alloca.h" header file */
7990 $_def_alloca
7992 /* Define this if your system has the "sys/mman.h" header file */
7993 $_def_mman
7994 $_def_mman_has_map_failed
7996 /* Define this if you have the elf dynamic linker -ldl library */
7997 $_def_dl
7999 /* Define this if you have the kstat kernel statistics library */
8000 $_def_kstat
8002 /* Define this if you have zlib */
8003 $_def_zlib
8004 #ifdef HAVE_ZLIB
8005 #define CONFIG_ZLIB 1
8006 #endif
8008 /* Define this if you have shm support */
8009 $_def_shm
8011 /* Define this if your system has strsep */
8012 $_def_strsep
8014 /* Define this if your system has vsscanf */
8015 $_def_vsscanf
8017 /* Define this if your system has swab */
8018 $_def_swab
8020 /* Define this if your system has posix select */
8021 $_def_posix_select
8023 /* Define this if your system has gettimeofday */
8024 $_def_gettimeofday
8026 /* Define this if your system has glob */
8027 $_def_glob
8029 /* Define this if your system has setenv */
8030 $_def_setenv
8031 #ifndef HAVE_SETENV
8032 int setenv(const char *name, const char *val, int overwrite);
8033 #endif
8035 /* Define this if your system has sysi86 */
8036 $_def_sysi86
8037 $_def_sysi86_iv
8039 /* Define this if your system has pthreads */
8040 $_def_pthreads
8042 /* Define this if you enabled thread support for libavcodec */
8043 $_def_threads
8044 #ifdef HAVE_THREADS
8045 #define ENABLE_THREADS 1
8046 #else
8047 #define ENABLE_THREADS 0
8048 #endif
8050 /* LIRC (remote control, see www.lirc.org) support: */
8051 $_def_lirc
8053 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8054 $_def_apple_remote
8056 /* Support for maemo (http://www.maemo.org) */
8057 $_def_maemo
8060 * LIRCCD (LIRC client daemon)
8061 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8063 $_def_lircc
8065 /* DVD navigation support using libdvdnav */
8066 $_def_dvdnav
8068 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8069 #define MPEG12_POSTPROC 1
8071 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8072 $_def_libpostproc
8073 $_def_libpostproc_a
8074 $_def_libpostproc_so
8076 /* Win32 DLL support */
8077 $_def_win32dll
8078 #define WIN32_PATH "$_win32codecsdir"
8080 /* Mac OS X specific features */
8081 $_def_macosx
8082 $_def_macosx_finder_support
8083 $_def_macosx_bundle
8084 $_def_macosx_corevideo
8086 /* Build our Win32-loader */
8087 $_def_win32_loader
8089 /* ffmpeg's libavcodec support (requires libavcodec source) */
8090 $_def_libavcodec
8091 $_def_libavcodec_a
8092 $_def_libavcodec_so
8093 $_def_libavcodec_mpegaudio_hp
8095 /* ffmpeg's libavformat support (requires libavformat source) */
8096 $_def_libavformat
8097 $_def_libavformat_a
8098 $_def_libavformat_so
8100 $_def_libavutil
8101 $_def_libavutil_a
8102 $_def_libavutil_so
8104 /* Use libavcodec's decoders */
8105 #define CONFIG_DECODERS 1
8106 /* Use libavcodec's encoders */
8107 #define CONFIG_ENCODERS 1
8109 /* Use libavformat's demuxers */
8110 #define CONFIG_DEMUXERS 1
8111 /* Use libavformat's muxers */
8112 $_def_muxers
8114 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8115 #define HAVE_EBX_AVAILABLE 1
8116 #ifndef MP_DEBUG
8117 #define HAVE_EBP_AVAILABLE 1
8118 #endif
8120 #define CONFIG_GPL 1
8121 #define ENABLE_SMALL 0
8123 /* Support for grayscale encoding/decoding in FFmpeg (makes color slower) */
8124 #define ENABLE_GRAY 1
8126 /* Use AMR codecs from libavcodec. */
8127 $_def_libamr
8128 $_def_libamr_nb
8129 $_def_libamr_wb
8131 /* Use specific parts from FFmpeg. */
8132 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8133 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8134 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8135 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8136 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8137 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8138 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8140 $_def_lavc_faac
8141 $_def_lavc_xvid
8142 $_def_lavc_mp3lame
8143 $_def_lavc_x264
8145 /* Use codec libs included in mplayer CVS / source dist: */
8146 $_def_mp3lib
8147 $_def_liba52
8148 $_def_libdca
8149 $_def_libmpeg2
8151 /* XAnim DLL support */
8152 $_def_xanim
8153 /* Default search path */
8154 $_def_xanim_path
8156 /* RealPlayer DLL support */
8157 $_def_real
8158 /* Default search path */
8159 $_def_real_path
8161 /* LIVE555 Streaming Media library support */
8162 $_def_live
8164 /* libnemesi Streaming Media library support */
8165 $_def_nemesi
8167 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8168 $_def_fastmemcpy
8170 /* Use UnRAR executable for Vobsubs */
8171 $_def_unrar_exec
8173 /* gui support, please do not edit this option */
8174 $_def_gui
8175 $_def_gtk2_gui
8177 /* Audio output drivers */
8178 $_def_ossaudio
8179 $_def_ossaudio_devdsp
8180 $_def_ossaudio_devmixer
8181 $_def_alsa5
8182 $_def_alsa9
8183 $_def_alsa1x
8184 $_def_arts
8185 $_def_esd
8186 $_def_esd_latency
8187 $_def_pulse
8188 $_def_jack
8189 $_def_openal
8190 $_def_openal_h
8191 $_def_sys_asoundlib_h
8192 $_def_alsa_asoundlib_h
8193 $_def_sunaudio
8194 $_def_sgiaudio
8195 $_def_win32waveout
8196 $_def_nas
8198 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8199 #undef FAST_OSD
8200 #undef FAST_OSD_TABLE
8202 /* Enable TV Interface support */
8203 $_def_tv
8205 /* Enable Video 4 Linux TV interface support */
8206 $_def_tv_v4l
8208 /* Enable Video 4 Linux 1 TV interface support */
8209 $_def_tv_v4l1
8211 /* Enable Video 4 Linux 2 TV interface support */
8212 $_def_tv_v4l2
8214 /* Enable DirectShow TV interface support */
8215 $_def_tv_dshow
8217 /* *BSD BrookTree headers */
8218 $_def_ioctl_meteor_h_name
8219 $_def_ioctl_bt848_h_name
8221 /* Enable *BSD BrookTree TV interface support */
8222 $_def_tv_bsdbt848
8224 /* Enable TV Teletext Interface support */
8225 $_def_tv_teletext
8227 /* Enable Radio Interface support */
8228 $_def_radio
8230 /* Enable Capture for Radio Interface support */
8231 $_def_radio_capture
8233 /* Enable Video 4 Linux Radio interface support */
8234 $_def_radio_v4l
8236 /* Enable Video 4 Linux 2 Radio interface support */
8237 $_def_radio_v4l2
8239 /* Enable *BSD BrookTree Radio interface support */
8240 $_def_radio_bsdbt848
8242 /* Enable Video 4 Linux 2 MPEG PVR support */
8243 $_def_pvr
8245 /* Define if your processor stores words with the most significant
8246 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8247 $_def_words_endian
8249 /* Define if your processor can access unaligned data in a fast way */
8250 $_def_fast_unaligned
8252 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8254 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8255 have the instruction. */
8256 $_def_dcbzl
8258 /* only gcc3 can compile mvi instructions (libmpeg2) */
8259 $_def_gcc_mvi_support
8261 /* Define this for Cygwin build for win32 */
8262 $_def_confwin32
8264 /* Define this to any prefered value from 386 up to infinity with step 100 */
8265 #define __CPU__ $iproc
8267 $_mp_wordsize
8269 $_def_linux
8271 $_def_vcd
8273 #ifdef sun
8274 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8275 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8276 #elif defined(WIN32)
8277 #define DEFAULT_CDROM_DEVICE "D:"
8278 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8279 #elif defined(__APPLE__) || defined(__DARWIN__)
8280 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8281 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8282 #elif defined(__OpenBSD__)
8283 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8284 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8285 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8286 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8287 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8288 #elif defined(__AMIGAOS4__)
8289 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8290 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8291 #else
8292 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8293 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8294 #endif
8297 /*----------------------------------------------------------------------------
8299 ** NOTE: Instead of modifying these definitions here, use the
8300 ** --enable/--disable options of the ./configure script!
8301 ** See ./configure --help for details.
8303 *---------------------------------------------------------------------------*/
8305 /* C99 lrintf function available */
8306 $_def_lrintf
8308 /* mkstemp support */
8309 $_def_mkstemp
8311 /* nanosleep support */
8312 $_def_nanosleep
8314 /* SMB support */
8315 $_def_smbsupport
8317 /* termcap flag for getch2.c */
8318 $_def_termcap
8320 /* termios flag for getch2.c */
8321 $_def_termios
8322 $_def_termios_h
8323 $_def_termios_sys_h
8325 /* enable PNG support */
8326 $_def_png
8328 /* enable JPEG support */
8329 $_def_jpeg
8331 /* enable PNM support */
8332 $_def_pnm
8334 /* enable md5sum support */
8335 $_def_md5sum
8337 /* enable GIF support */
8338 $_def_gif
8339 $_def_gif_4
8340 $_def_gif_tvt_hack
8342 /* enable bitmap font support */
8343 $_def_bitmap_font
8345 /* enable FreeType support */
8346 $_def_freetype
8348 /* enable Fontconfig support */
8349 $_def_fontconfig
8351 /* enable SSA/ASS support */
8352 $_def_ass
8354 /* enable FriBiDi usage */
8355 $_def_fribidi
8357 /* enable ENCA usage */
8358 $_def_enca
8360 /* liblzo support */
8361 $_def_liblzo
8362 #ifdef USE_LIBLZO
8363 #define CONFIG_LZO 1
8364 #endif
8366 /* libmad support */
8367 $_def_mad
8369 /* enable OggVorbis support */
8370 $_def_vorbis
8371 $_def_tremor
8373 /* enable Speex support */
8374 $_def_speex
8376 /* enable musepack support */
8377 $_def_musepack
8379 /* enable OggTheora support */
8380 $_def_theora
8382 /* enable FAAD (AAC) support */
8383 $_def_faad
8384 $_def_faad_internal
8386 /* enable FAAC (AAC encoder) support */
8387 $_def_faac
8389 /* enable LADSPA plugin support */
8390 $_def_ladspa
8392 /* enable network */
8393 $_def_network
8395 /* enable ftp support */
8396 $_def_ftp
8398 /* enable vstream support */
8399 $_def_vstream
8401 /* enable winsock2 instead of Unix functions*/
8402 $_def_winsock2
8404 /* define this to use inet_aton() instead of inet_pton() */
8405 $_def_use_aton
8407 /* enables / disables cdparanoia support */
8408 $_def_cdparanoia
8409 $_def_cddb
8411 /* enables / disables VIDIX usage */
8412 $_def_vidix
8413 $_def_vidix_drv_cyberblade
8414 $_def_vidix_drv_ivtv
8415 $_def_vidix_drv_mach64
8416 $_def_vidix_drv_mga
8417 $_def_vidix_drv_mga_crtc2
8418 $_def_vidix_drv_nvidia
8419 $_def_vidix_drv_pm3
8420 $_def_vidix_drv_radeon
8421 $_def_vidix_drv_rage128
8422 $_def_vidix_drv_savage
8423 $_def_vidix_drv_sis
8424 $_def_vidix_drv_unichrome
8425 $_def_vidix_pfx
8427 /* enables / disables new input joystick support */
8428 $_def_joystick
8430 /* enables / disables QTX codecs */
8431 $_def_qtx
8433 /* enables / disables osd menu */
8434 $_def_menu
8436 /* enables / disables subtitles sorting */
8437 $_def_sortsub
8439 /* XMMS input plugin support */
8440 $_def_xmms
8441 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8443 /* enables inet6 support */
8444 $_def_inet6
8446 /* do we have gethostbyname2? */
8447 $_def_gethostbyname2
8449 /* Extension defines */
8450 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8452 $_def_altivec_h // enables usage of altivec.h
8454 /* libmpeg2 uses a different feature test macro for mediaLib */
8455 #ifdef HAVE_MLIB
8456 #define LIBMPEG2_MLIB 1
8457 #endif
8459 /* libvo options */
8460 #define SCREEN_SIZE_X 1
8461 #define SCREEN_SIZE_Y 1
8462 $_def_x11
8463 $_def_xv
8464 $_def_xvmc
8465 $_def_vm
8466 $_def_xf86keysym
8467 $_def_xinerama
8468 $_def_gl
8469 $_def_gl_win32
8470 $_def_dga
8471 $_def_dga1
8472 $_def_dga2
8473 $_def_sdl
8474 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8475 $_def_sdlbuggy
8476 $_def_directx
8477 $_def_ggi
8478 $_def_ggiwmh
8479 $_def_3dfx
8480 $_def_s3fb
8481 $_def_tdfxfb
8482 $_def_tdfxvid
8483 $_def_xvr100
8484 $_def_directfb
8485 $_def_directfb_version
8486 $_def_dfbmga
8487 $_def_zr
8488 $_def_bl
8489 $_def_mga
8490 $_def_xmga
8491 $_def_fbdev
8492 $_def_dxr2
8493 $_def_dxr3
8494 $_def_ivtv
8495 $_def_v4l2
8496 $_def_dvb
8497 $_def_dvb_in
8498 $_def_svga
8499 $_def_vesa
8500 $_def_xdpms
8501 $_def_aa
8502 $_def_caca
8503 $_def_tga
8504 $_def_toolame
8505 $_def_twolame
8507 /* used by GUI: */
8508 $_def_xshape
8510 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8511 #define X11_FULLSCREEN 1
8512 #endif
8514 #endif /* MPLAYER_CONFIG_H */
8517 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8518 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8520 #############################################################################
8522 cat << EOF
8524 Config files successfully generated by ./configure $_configuration !
8526 Install prefix: $_prefix
8527 Data directory: $_datadir
8528 Config direct.: $_confdir
8530 Byte order: $_byte_order
8531 Optimizing for: $_optimizing
8533 Languages:
8534 Messages/GUI: $_language
8537 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8538 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8539 echo
8541 cat << EOF
8543 Enabled optional drivers:
8544 Input: $_inputmodules
8545 Codecs: $_codecmodules
8546 Audio output: $_aomodules
8547 Video output: $_vomodules
8548 Audio filters: $_afmodules
8549 Disabled optional drivers:
8550 Input: $_noinputmodules
8551 Codecs: $_nocodecmodules
8552 Audio output: $_noaomodules
8553 Video output: $_novomodules
8554 Audio filters: $_noafmodules
8556 'config.h' and 'config.mak' contain your configuration options.
8557 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8558 compile *** DO NOT REPORT BUGS if you tweak these files ***
8560 'make' will now compile MPlayer and 'make install' will install it.
8561 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8566 if test "$_mtrr" = yes ; then
8567 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8568 echo
8571 if ! x86_32; then
8572 cat <<EOF
8573 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8574 operating system ($system_name). You may encounter a few files that cannot
8575 be played due to missing open source video/audio codec support.
8581 cat <<EOF
8582 Check $TMPLOG if you wonder why an autodetection failed (make sure
8583 development headers/packages are installed).
8585 NOTE: The --enable-* parameters unconditionally force options on, completely
8586 skipping autodetection. This behavior is unlike what you may be used to from
8587 autoconf-based configure scripts that can decide to override you. This greater
8588 level of control comes at a price. You may have to provide the correct compiler
8589 and linker flags yourself.
8590 If you used one of these options (except --enable-gui and similar ones that
8591 turn on internal features) and experience a compilation or linking failure,
8592 make sure you have passed the necessary compiler/linker flags to configure.
8594 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8598 if test "$_warn_CFLAGS" = yes; then
8599 cat <<EOF
8601 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8603 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8605 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8606 To do so, execute 'CFLAGS= ./configure <options>'
8611 # Last move:
8612 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"