Fix crash during early exit
[mplayer.git] / configure
blob177bd282079daab442963bfc4fdfc2a40569195f
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 dragonfly() { issystem "DragonFly" ; 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 "$?" ; }
119 os2() { issystem "OS/2" ; return "$?" ; }
121 # arch test boolean functions
122 # x86/x86pc is used by QNX
123 x86_32() {
124 case "$host_arch" in
125 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
126 *) return 1 ;;
127 esac
130 x86_64() {
131 case "$host_arch" in
132 x86_64|amd64) return 0 ;;
133 *) return 1 ;;
134 esac
137 x86() {
138 x86_32 || x86_64
141 ppc() {
142 case "$host_arch" in
143 ppc|powerpc) return 0;;
144 *) return 1;;
145 esac
148 alpha() {
149 case "$host_arch" in
150 alpha) return 0;;
151 *) return 1;;
152 esac
155 arm() {
156 case "$host_arch" in
157 arm) return 0;;
158 *) return 1;;
159 esac
162 sh3() {
163 case "$host_arch" in
164 sh3) return 0;;
165 *) return 1;;
166 esac
169 # Use this before starting a check
170 echocheck() {
171 echo "============ Checking for $@ ============" >> "$TMPLOG"
172 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
175 # Use this to echo the results of a check
176 echores() {
177 if test "$_res_comment" ; then
178 _res_comment="($_res_comment)"
180 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
181 echo "##########################################" >> "$TMPLOG"
182 echo "" >> "$TMPLOG"
183 echo "$@ $_res_comment"
184 _res_comment=""
186 #############################################################################
188 # Check how echo works in this /bin/sh
189 case `echo -n` in
190 -n) _echo_n= _echo_c='\c' ;; # SysV echo
191 *) _echo_n='-n ' _echo_c= ;; # BSD echo
192 esac
194 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"`
196 show_help(){
197 cat << EOF
198 Usage: $0 [OPTIONS]...
200 Configuration:
201 -h, --help display this help and exit
203 Installation directories:
204 --prefix=DIR prefix directory for installation [/usr/local]
205 --bindir=DIR directory for installing binaries [PREFIX/bin]
206 --datadir=DIR directory for installing machine independent
207 data files (skins, etc) [PREFIX/share/mplayer]
208 --mandir=DIR directory for installing man pages [PREFIX/share/man]
209 --confdir=DIR directory for installing configuration files
210 [PREFIX/etc/mplayer]
211 --libdir=DIR directory for object code libraries [PREFIX/lib]
212 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
213 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
214 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
215 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
217 Optional features:
218 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
219 --disable-mplayer disable MPlayer compilation [enable]
220 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
221 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
222 --disable-largefiles disable support for files > 2GB [enable]
223 --enable-linux-devfs set default devices to devfs [disable]
224 --enable-termcap use termcap database for key codes [autodetect]
225 --enable-termios use termios database for key codes [autodetect]
226 --disable-iconv disable iconv for encoding conversion [autodetect]
227 --disable-langinfo do not use langinfo [autodetect]
228 --enable-lirc enable LIRC (remote control) support [autodetect]
229 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
230 --enable-joystick enable joystick support [disable]
231 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
232 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
233 --disable-vm disable X video mode extensions [autodetect]
234 --disable-xf86keysym disable support for multimedia keys [autodetect]
235 --enable-radio enable radio interface [disable]
236 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
237 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
238 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
239 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
240 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
241 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
242 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
243 --disable-tv-teletext disable TV teletext interface [autodetect]
244 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
245 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
246 --disable-network disable networking [enable]
247 --enable-winsock2 enable winsock2 [autodetect]
248 --enable-smb enable Samba (SMB) input [autodetect]
249 --enable-live enable LIVE555 Streaming Media [autodetect]
250 --enable-nemesi enable Nemesi Streaming Media [autodetect]
251 --disable-dvdnav disable libdvdnav [autodetect]
252 --disable-dvdread disable libdvdread [autodetect]
253 --disable-dvdread-internal disable internal libdvdread [autodetect]
254 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
255 --disable-cdparanoia disable cdparanoia [autodetect]
256 --disable-cddb disable cddb [autodetect]
257 --disable-bitmap-font disable bitmap font support [enable]
258 --disable-freetype disable FreeType 2 font rendering [autodetect]
259 --disable-fontconfig disable fontconfig font lookup [autodetect]
260 --disable-unrarexec disable using of UnRAR executable [enabled]
261 --enable-menu enable OSD menu (not DVD menu) [disabled]
262 --disable-sortsub disable subtitle sorting [enabled]
263 --enable-fribidi enable the FriBiDi libs [autodetect]
264 --disable-enca disable ENCA charset oracle library [autodetect]
265 --disable-macosx disable Mac OS X specific features [autodetect]
266 --disable-maemo disable maemo specific features [autodetect]
267 --enable-macosx-finder-support enable Mac OS X Finder invocation
268 parameter parsing [disabled]
269 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
270 --disable-inet6 disable IPv6 support [autodetect]
271 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
272 --disable-ftp disable FTP support [enabled]
273 --disable-vstream disable TiVo vstream client support [autodetect]
274 --disable-pthreads disable Posix threads support [autodetect]
275 --disable-w32threads disable Win32 threads support [autodetect]
276 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
277 --enable-rpath enable runtime linker path for extra libs [disabled]
279 Codecs:
280 --enable-gif enable GIF support [autodetect]
281 --enable-png enable PNG input/output support [autodetect]
282 --enable-jpeg enable JPEG input/output support [autodetect]
283 --enable-libcdio enable external libcdio [autodetect]
284 --enable-liblzo enable external liblzo [autodetect]
285 --disable-win32dll disable Win32 DLL support [enabled]
286 --disable-qtx disable QuickTime codecs support [enabled]
287 --disable-xanim disable XAnim codecs support [enabled]
288 --disable-real disable RealPlayer codecs support [enabled]
289 --disable-xvid disable Xvid [autodetect]
290 --disable-xvid-lavc disable Xvid in libavcodec [autodetect]
291 --disable-x264 disable x264 [autodetect]
292 --disable-x264-lavc disable x264 in libavcodec [autodetect]
293 --disable-libnut disable libnut [autodetect]
294 --disable-libavutil_a disable static libavutil [autodetect]
295 --disable-libavcodec_a disable static libavcodec [autodetect]
296 --disable-libavformat_a disable static libavformat [autodetect]
297 --disable-libpostproc_a disable static libpostproc [autodetect]
298 --disable-libavutil_so disable shared libavutil [autodetect]
299 --disable-libavcodec_so disable shared libavcodec [autodetect]
300 --disable-libavformat_so disable shared libavformat [autodetect]
301 --disable-libpostproc_so disable shared libpostproc [autodetect]
302 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
303 in libavcodec [enabled]
304 --disable-tremor-internal disable internal Tremor [enabled]
305 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
306 --enable-tremor-external enable external Tremor [autodetect]
307 --disable-libvorbis disable libvorbis support [autodetect]
308 --disable-speex disable Speex support [autodetect]
309 --enable-theora enable OggTheora libraries [autodetect]
310 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
311 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
312 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
313 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
314 --disable-faac-lavc disable support for FAAC in libavcodec [autodetect]
315 --disable-ladspa disable LADSPA plugin support [autodetect]
316 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
317 --disable-mad disable libmad (MPEG audio) support [autodetect]
318 --disable-mp3lame disable LAME MP3 encoding support [autodetect]
319 --disable-mp3lame-lavc disable LAME in libavcodec [autodetect]
320 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
321 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
322 --enable-xmms enable XMMS input plugin support [disabled]
323 --enable-libdca enable libdca support [autodetect]
324 --disable-mp3lib disable builtin mp3lib [enabled]
325 --disable-liba52 disable builtin liba52 [enabled]
326 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
327 --disable-musepack disable musepack support [autodetect]
328 --disable-libamr_nb disable libamr narrowband [autodetect]
329 --disable-libamr_wb disable libamr wideband [autodetect]
330 --disable-decoder=DECODER disable specified FFmpeg decoder
331 --enable-decoder=DECODER enable specified FFmpeg decoder
332 --disable-encoder=ENCODER disable specified FFmpeg encoder
333 --enable-encoder=ENCODER enable specified FFmpeg encoder
334 --disable-parser=PARSER disable specified FFmpeg parser
335 --enable-parser=PARSER enable specified FFmpeg parser
336 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
337 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
338 --disable-muxer=MUXER disable specified FFmpeg muxer
339 --enable-muxer=MUXER enable specified FFmpeg muxer
341 Video output:
342 --disable-vidix disable VIDIX [for x86 *nix]
343 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
344 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
345 nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome
346 --disable-vidix-pcidb disable VIDIX PCI device name database
347 --enable-dhahelper enable VIDIX dhahelper support
348 --enable-svgalib_helper enable VIDIX svgalib_helper support
349 --enable-gl enable OpenGL video output [autodetect]
350 --enable-dga2 enable DGA 2 support [autodetect]
351 --enable-dga1 enable DGA 1 support [autodetect]
352 --enable-vesa enable VESA video output [autodetect]
353 --enable-svga enable SVGAlib video output [autodetect]
354 --enable-sdl enable SDL video output [autodetect]
355 --enable-aa enable AAlib video output [autodetect]
356 --enable-caca enable CACA video output [autodetect]
357 --enable-ggi enable GGI video output [autodetect]
358 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
359 --enable-directx enable DirectX video output [autodetect]
360 --enable-dxr2 enable DXR2 video output [autodetect]
361 --enable-dxr3 enable DXR3/H+ video output [autodetect]
362 --enable-ivtv enable IVTV TV-Out video output [autodetect]
363 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
364 --enable-dvb enable DVB video output [autodetect]
365 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
366 --enable-mga enable mga_vid video output [autodetect]
367 --enable-xmga enable mga_vid X11 video output [autodetect]
368 --enable-xv enable Xv video output [autodetect]
369 --enable-xvmc enable XvMC acceleration [disable]
370 --enable-vm enable XF86VidMode support [autodetect]
371 --enable-xinerama enable Xinerama support [autodetect]
372 --enable-x11 enable X11 video output [autodetect]
373 --enable-xshape enable XShape support [autodetect]
374 --disable-xss disable screensaver support via xss [autodetect]
375 --enable-fbdev enable FBDev video output [autodetect]
376 --enable-mlib enable mediaLib video output (Solaris) [disable]
377 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
378 --enable-tdfxfb enable tdfxfb video output [disable]
379 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
380 --enable-directfb enable DirectFB video output [autodetect]
381 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
382 --enable-bl enable Blinkenlights video output [disable]
383 --enable-tdfxvid enable tdfx_vid video output [disable]
384 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
385 --disable-tga disable Targa video output [enable]
386 --disable-pnm disable PNM video output [enable]
387 --disable-md5sum disable md5sum video output [enable]
388 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
390 Audio output:
391 --disable-alsa disable ALSA audio output [autodetect]
392 --disable-ossaudio disable OSS audio output [autodetect]
393 --disable-arts disable aRts audio output [autodetect]
394 --disable-esd disable esd audio output [autodetect]
395 --disable-pulse disable Pulseaudio audio output [autodetect]
396 --disable-jack disable JACK audio output [autodetect]
397 --disable-openal disable OpenAL audio output [autodetect]
398 --disable-nas disable NAS audio output [autodetect]
399 --disable-sgiaudio disable SGI audio output [autodetect]
400 --disable-sunaudio disable Sun audio output [autodetect]
401 --disable-win32waveout disable Windows waveout audio output [autodetect]
402 --disable-select disable using select() on the audio device [enable]
404 Miscellaneous options:
405 --enable-runtime-cpudetection enable runtime CPU detection [disable]
406 --enable-cross-compile enable cross-compilation [autodetect]
407 --cc=COMPILER C compiler to build MPlayer [gcc]
408 --host-cc=COMPILER C compiler for tools needed while building [gcc]
409 --as=ASSEMBLER assembler to build MPlayer [as]
410 --ar=AR librarian to build MPlayer [ar]
411 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
412 --windres=WINDRES windres to build MPlayer [windres]
413 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
414 --enable-static build a statically linked binary
415 --charset=charset convert the console messages to this character set
416 --language=list a white space or comma separated list of languages for
417 translated man pages, the first language is used for
418 messages and the GUI (the environment variable
419 \$LINGUAS is also honored) [en]
420 (Available: $LANGUAGES all)
421 --with-install=PATH path to a custom install program
423 Advanced options:
424 --enable-mmx enable MMX [autodetect]
425 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
426 --enable-3dnow enable 3DNow! [autodetect]
427 --enable-3dnowext enable extended 3DNow! [autodetect]
428 --enable-sse enable SSE [autodetect]
429 --enable-sse2 enable SSE2 [autodetect]
430 --enable-ssse3 enable SSSE3 [autodetect]
431 --enable-shm enable shm [autodetect]
432 --enable-altivec enable AltiVec (PowerPC) [autodetect]
433 --enable-armv5te enable DSP extensions (ARM) [autodetect]
434 --enable-armv6 enable ARMv6 (ARM) [autodetect]
435 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
436 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
437 --enable-big-endian force byte order to big-endian [autodetect]
438 --enable-debug[=1-3] compile-in debugging information [disable]
439 --enable-profile compile-in profiling information [disable]
440 --disable-sighandler disable sighandler for crashes [enable]
441 --enable-crash-debug enable automatic gdb attach on crash [disable]
442 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
444 Use these options if autodetection fails (Options marked with (*) accept
445 multiple paths separated by ':'):
446 --extra-libs=FLAGS extra linker flags
447 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
448 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
449 --with-extraincdir=DIR extra header search paths in DIR (*)
450 --with-extralibdir=DIR extra linker search paths in DIR (*)
451 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
453 --with-freetype-config=PATH path to freetype-config
454 --with-fribidi-config=PATH path to fribidi-config
455 --with-glib-config=PATH path to glib*-config
456 --with-gtk-config=PATH path to gtk*-config
457 --with-sdl-config=PATH path to sdl*-config
458 --with-dvdnav-config=PATH path to dvdnav-config
459 --with-dvdread-config=PATH path to dvdread-config
461 This configure script is NOT autoconf-based, even though its output is similar.
462 It will try to autodetect all configuration options. If you --enable an option
463 it will be forcefully turned on, skipping autodetection. This can break
464 compilation, so you need to know what you are doing.
466 exit 0
467 } #show_help()
469 # GOTCHA: the variables below defines the default behavior for autodetection
470 # and have - unless stated otherwise - at least 2 states : yes no
471 # If autodetection is available then the third state is: auto
472 _mmx=auto
473 _3dnow=auto
474 _3dnowext=auto
475 _mmxext=auto
476 _sse=auto
477 _sse2=auto
478 _ssse3=auto
479 _cmov=auto
480 _fast_cmov=auto
481 _armv5te=auto
482 _armv6=auto
483 _iwmmxt=auto
484 _mtrr=auto
485 _altivec=auto
486 _install=install
487 _ranlib=ranlib
488 _windres=windres
489 _cc=cc
490 _ar=ar
491 test "$CC" && _cc="$CC"
492 _as=auto
493 _runtime_cpudetection=no
494 _cross_compile=auto
495 _prefix="/usr/local"
496 _libavutil_a=auto
497 _libavutil_so=auto
498 _libavcodec_a=auto
499 _libamr_nb=auto
500 _libamr_wb=auto
501 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
502 _libavdecoders=` echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER// `
503 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
504 _libavencoders=` echo $_libavencoders_all | sed 's/ LIB[A-Z0-9_]*_ENCODER//g'`
505 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
506 _libavparsers=$_libavparsers_all
507 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
508 _libavbsfs=$_libavbsfs_all
509 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' ffmpeg/libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
510 _libavdemuxers=`echo $_libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/AVISYNTH_DEMUXER// `
511 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' ffmpeg/libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
512 _libavmuxers=`echo $_libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER// `
513 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' ffmpeg/libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
514 _libavcodec_so=auto
515 _libavformat_a=auto
516 _libavformat_so=auto
517 _libpostproc_a=auto
518 _libpostproc_so=auto
519 _libavcodec_mpegaudio_hp=yes
520 _mencoder=yes
521 _mplayer=yes
522 _x11=auto
523 _xshape=auto
524 _xss=auto
525 _dga1=auto
526 _dga2=auto
527 _xv=auto
528 _xvmc=no #auto when complete
529 _sdl=auto
530 _directx=auto
531 _win32waveout=auto
532 _nas=auto
533 _png=auto
534 _jpeg=auto
535 _pnm=yes
536 _md5sum=yes
537 _yuv4mpeg=yes
538 _gif=auto
539 _gl=auto
540 _ggi=auto
541 _ggiwmh=auto
542 _aa=auto
543 _caca=auto
544 _svga=auto
545 _vesa=auto
546 _fbdev=auto
547 _dvb=auto
548 _dvbhead=auto
549 _dxr2=auto
550 _dxr3=auto
551 _ivtv=auto
552 _v4l2=auto
553 _iconv=auto
554 _langinfo=auto
555 _rtc=auto
556 _ossaudio=auto
557 _arts=auto
558 _esd=auto
559 _pulse=auto
560 _jack=auto
561 _openal=auto
562 _libcdio=auto
563 _liblzo=auto
564 _mad=auto
565 _mp3lame=auto
566 _mp3lame_lavc=auto
567 _toolame=auto
568 _twolame=auto
569 _tremor_internal=yes
570 _tremor_low=no
571 _tremor_external=auto
572 _libvorbis=auto
573 _speex=auto
574 _theora=auto
575 _mp3lib=yes
576 _liba52=yes
577 _libdca=auto
578 _libmpeg2=auto
579 _faad_internal=auto
580 _faad_external=auto
581 _faad_fixed=no
582 _faac=auto
583 _faac_lavc=auto
584 _ladspa=auto
585 _xmms=no
586 _dvdnav=auto
587 _dvdnavconfig=dvdnav-config
588 _dvdreadconfig=dvdread-config
589 _dvdread=auto
590 _dvdread_internal=auto
591 _libdvdcss_internal=auto
592 _xanim=auto
593 _real=auto
594 _live=auto
595 _nemesi=auto
596 _native_rtsp=yes
597 _xinerama=auto
598 _mga=auto
599 _xmga=auto
600 _vm=auto
601 _xf86keysym=auto
602 _mlib=no #broken, thus disabled
603 _sgiaudio=auto
604 _sunaudio=auto
605 _alsa=auto
606 _fastmemcpy=yes
607 _unrar_exec=auto
608 _win32dll=auto
609 _select=yes
610 _radio=no
611 _radio_capture=no
612 _radio_v4l=auto
613 _radio_v4l2=auto
614 _radio_bsdbt848=auto
615 _tv=yes
616 _tv_v4l1=auto
617 _tv_v4l2=auto
618 _tv_bsdbt848=auto
619 _tv_dshow=auto
620 _tv_teletext=auto
621 _pvr=auto
622 _network=yes
623 _winsock2=auto
624 _smbsupport=auto
625 _vidix=auto
626 _vidix_pcidb=yes
627 _dhahelper=no
628 _svgalib_helper=no
629 _joystick=no
630 _xvid=auto
631 _xvid_lavc=auto
632 _x264=auto
633 _x264_lavc=auto
634 _libnut=auto
635 _lirc=auto
636 _lircc=auto
637 _apple_remote=auto
638 _apple_ir=auto
639 _gui=no
640 _gtk1=no
641 _termcap=auto
642 _termios=auto
643 _3dfx=no
644 _s3fb=no
645 _tdfxfb=no
646 _tdfxvid=no
647 _xvr100=auto
648 _tga=yes
649 _directfb=auto
650 _zr=auto
651 _bl=no
652 _largefiles=yes
653 #_language=en
654 _shm=auto
655 _linux_devfs=no
656 _charset="UTF-8"
657 _dynamic_plugins=no
658 _crash_debug=no
659 _sighandler=yes
660 _libdv=auto
661 _cdparanoia=auto
662 _cddb=auto
663 _big_endian=auto
664 _bitmap_font=yes
665 _freetype=auto
666 _fontconfig=auto
667 _menu=no
668 _qtx=auto
669 _macosx=auto
670 _maemo=auto
671 _macosx_finder_support=no
672 _macosx_bundle=auto
673 _sortsub=yes
674 _freetypeconfig='freetype-config'
675 _fribidi=auto
676 _fribidiconfig='fribidi-config'
677 _enca=auto
678 _inet6=auto
679 _gethostbyname2=auto
680 _ftp=yes
681 _musepack=auto
682 _vstream=auto
683 _pthreads=auto
684 _w32threads=auto
685 _ass=auto
686 _rpath=no
687 _asmalign_pot=auto
688 _stream_cache=yes
689 _def_stream_cache="#define USE_STREAM_CACHE 1"
690 _need_shmem=yes
691 for ac_option do
692 case "$ac_option" in
693 --help|-help|-h)
694 show_help
696 --prefix=*)
697 _prefix=`echo $ac_option | cut -d '=' -f 2`
699 --bindir=*)
700 _bindir=`echo $ac_option | cut -d '=' -f 2`
702 --datadir=*)
703 _datadir=`echo $ac_option | cut -d '=' -f 2`
705 --mandir=*)
706 _mandir=`echo $ac_option | cut -d '=' -f 2`
708 --confdir=*)
709 _confdir=`echo $ac_option | cut -d '=' -f 2`
711 --libdir=*)
712 _libdir=`echo $ac_option | cut -d '=' -f 2`
714 --codecsdir=*)
715 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
717 --win32codecsdir=*)
718 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
720 --xanimcodecsdir=*)
721 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
723 --realcodecsdir=*)
724 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
726 --with-extraincdir=*)
727 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
729 --with-extralibdir=*)
730 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
733 --with-install=*)
734 _install=`echo $ac_option | cut -d '=' -f 2 `
736 --with-xvmclib=*)
737 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
740 --with-sdl-config=*)
741 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
743 --with-freetype-config=*)
744 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
746 --with-fribidi-config=*)
747 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
749 --with-gtk-config=*)
750 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
752 --with-glib-config=*)
753 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
755 --with-dvdnav-config=*)
756 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
758 --with-dvdread-config=*)
759 _dvdreadconfig=`echo $ac_option | cut -d '=' -f 2`
762 --extra-libs=*)
763 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
765 --extra-libs-mplayer=*)
766 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
768 --extra-libs-mencoder=*)
769 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
772 --target=*)
773 _target=`echo $ac_option | cut -d '=' -f 2`
775 --cc=*)
776 _cc=`echo $ac_option | cut -d '=' -f 2`
778 --host-cc=*)
779 _host_cc=`echo $ac_option | cut -d '=' -f 2`
781 --as=*)
782 _as=`echo $ac_option | cut -d '=' -f 2`
784 --ar=*)
785 _ar=`echo $ac_option | cut -d '=' -f 2`
787 --ranlib=*)
788 _ranlib=`echo $ac_option | cut -d '=' -f 2`
790 --windres=*)
791 _windres=`echo $ac_option | cut -d '=' -f 2`
793 --charset=*)
794 _charset=`echo $ac_option | cut -d '=' -f 2`
796 --language=*)
797 _language=`echo $ac_option | cut -d '=' -f 2`
800 --enable-static)
801 _ld_static='-static'
803 --disable-static)
804 _ld_static=''
806 --enable-profile)
807 _profile='-p'
809 --disable-profile)
810 _profile=
812 --enable-debug)
813 _debug='-g'
815 --enable-debug=*)
816 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
818 --disable-debug)
819 _debug=
821 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
822 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
823 --enable-cross-compile) _cross_compile=yes ;;
824 --disable-cross-compile) _cross_compile=no ;;
825 --enable-mencoder) _mencoder=yes ;;
826 --disable-mencoder) _mencoder=no ;;
827 --enable-mplayer) _mplayer=yes ;;
828 --disable-mplayer) _mplayer=no ;;
829 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
830 --disable-dynamic-plugins) _dynamic_plugins=no ;;
831 --enable-x11) _x11=yes ;;
832 --disable-x11) _x11=no ;;
833 --enable-xshape) _xshape=yes ;;
834 --disable-xshape) _xshape=no ;;
835 --enable-xss) _xss=yes ;;
836 --disable-xss) _xss=no ;;
837 --enable-xv) _xv=yes ;;
838 --disable-xv) _xv=no ;;
839 --enable-xvmc) _xvmc=yes ;;
840 --disable-xvmc) _xvmc=no ;;
841 --enable-sdl) _sdl=yes ;;
842 --disable-sdl) _sdl=no ;;
843 --enable-directx) _directx=yes ;;
844 --disable-directx) _directx=no ;;
845 --enable-win32waveout) _win32waveout=yes ;;
846 --disable-win32waveout) _win32waveout=no ;;
847 --enable-nas) _nas=yes ;;
848 --disable-nas) _nas=no ;;
849 --enable-png) _png=yes ;;
850 --disable-png) _png=no ;;
851 --enable-jpeg) _jpeg=yes ;;
852 --disable-jpeg) _jpeg=no ;;
853 --enable-pnm) _pnm=yes ;;
854 --disable-pnm) _pnm=no ;;
855 --enable-md5sum) _md5sum=yes ;;
856 --disable-md5sum) _md5sum=no ;;
857 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
858 --disable-yuv4mpeg) _yuv4mpeg=no ;;
859 --enable-gif) _gif=yes ;;
860 --disable-gif) _gif=no ;;
861 --enable-gl) _gl=yes ;;
862 --disable-gl) _gl=no ;;
863 --enable-ggi) _ggi=yes ;;
864 --disable-ggi) _ggi=no ;;
865 --enable-ggiwmh) _ggiwmh=yes ;;
866 --disable-ggiwmh) _ggiwmh=no ;;
867 --enable-aa) _aa=yes ;;
868 --disable-aa) _aa=no ;;
869 --enable-caca) _caca=yes ;;
870 --disable-caca) _caca=no ;;
871 --enable-svga) _svga=yes ;;
872 --disable-svga) _svga=no ;;
873 --enable-vesa) _vesa=yes ;;
874 --disable-vesa) _vesa=no ;;
875 --enable-fbdev) _fbdev=yes ;;
876 --disable-fbdev) _fbdev=no ;;
877 --enable-dvb) _dvb=yes ;;
878 --disable-dvb) _dvb=no ;;
879 --enable-dvbhead) _dvbhead=yes ;;
880 --disable-dvbhead) _dvbhead=no ;;
881 --enable-dxr2) _dxr2=yes ;;
882 --disable-dxr2) _dxr2=no ;;
883 --enable-dxr3) _dxr3=yes ;;
884 --disable-dxr3) _dxr3=no ;;
885 --enable-ivtv) _ivtv=yes ;;
886 --disable-ivtv) _ivtv=no ;;
887 --enable-v4l2) _v4l2=yes ;;
888 --disable-v4l2) _v4l2=no ;;
889 --enable-iconv) _iconv=yes ;;
890 --disable-iconv) _iconv=no ;;
891 --enable-langinfo) _langinfo=yes ;;
892 --disable-langinfo) _langinfo=no ;;
893 --enable-rtc) _rtc=yes ;;
894 --disable-rtc) _rtc=no ;;
895 --enable-libdv) _libdv=yes ;;
896 --disable-libdv) _libdv=no ;;
897 --enable-ossaudio) _ossaudio=yes ;;
898 --disable-ossaudio) _ossaudio=no ;;
899 --enable-arts) _arts=yes ;;
900 --disable-arts) _arts=no ;;
901 --enable-esd) _esd=yes ;;
902 --disable-esd) _esd=no ;;
903 --enable-pulse) _pulse=yes ;;
904 --disable-pulse) _pulse=no ;;
905 --enable-jack) _jack=yes ;;
906 --disable-jack) _jack=no ;;
907 --enable-openal) _openal=yes ;;
908 --disable-openal) _openal=no ;;
909 --enable-mad) _mad=yes ;;
910 --disable-mad) _mad=no ;;
911 --enable-mp3lame) _mp3lame=yes ;;
912 --disable-mp3lame) _mp3lame=no ;;
913 --enable-mp3lame-lavc) _mp3lame_lavc=yes ;;
914 --disable-mp3lame-lavc) _mp3lame_lavc=no ;;
915 --enable-toolame) _toolame=yes ;;
916 --disable-toolame) _toolame=no ;;
917 --enable-twolame) _twolame=yes ;;
918 --disable-twolame) _twolame=no ;;
919 --enable-libcdio) _libcdio=yes ;;
920 --disable-libcdio) _libcdio=no ;;
921 --enable-liblzo) _liblzo=yes ;;
922 --disable-liblzo) _liblzo=no ;;
923 --enable-libvorbis) _libvorbis=yes ;;
924 --disable-libvorbis) _libvorbis=no ;;
925 --enable-speex) _speex=yes ;;
926 --disable-speex) _speex=no ;;
927 --enable-tremor-internal) _tremor_internal=yes ;;
928 --disable-tremor-internal) _tremor_internal=no ;;
929 --enable-tremor-low) _tremor_low=yes ;;
930 --disable-tremor-low) _tremor_low=no ;;
931 --enable-tremor-external) _tremor_external=yes ;;
932 --disable-tremor-external) _tremor_external=no ;;
933 --enable-theora) _theora=yes ;;
934 --disable-theora) _theora=no ;;
935 --enable-mp3lib) _mp3lib=yes ;;
936 --disable-mp3lib) _mp3lib=no ;;
937 --enable-liba52) _liba52=yes ;;
938 --disable-liba52) _liba52=no ;;
939 --enable-libdca) _libdca=yes ;;
940 --disable-libdca) _libdca=no ;;
941 --enable-libmpeg2) _libmpeg2=yes ;;
942 --disable-libmpeg2) _libmpeg2=no ;;
943 --enable-musepack) _musepack=yes ;;
944 --disable-musepack) _musepack=no ;;
945 --enable-faad-internal) _faad_internal=yes ;;
946 --disable-faad-internal) _faad_internal=no ;;
947 --enable-faad-external) _faad_external=yes ;;
948 --disable-faad-external) _faad_external=no ;;
949 --enable-faad-fixed) _faad_fixed=yes ;;
950 --disable-faad-fixed) _faad_fixed=no ;;
951 --enable-faac) _faac=yes ;;
952 --disable-faac) _faac=no ;;
953 --enable-faac-lavc) _faac_lavc=yes ;;
954 --disable-faac-lavc) _faac_lavc=no ;;
955 --enable-ladspa) _ladspa=yes ;;
956 --disable-ladspa) _ladspa=no ;;
957 --enable-xmms) _xmms=yes ;;
958 --disable-xmms) _xmms=no ;;
959 --enable-dvdread) _dvdread=yes ;;
960 --disable-dvdread) _dvdread=no ;;
961 --enable-dvdread-internal) _dvdread_internal=yes ;;
962 --disable-dvdread-internal) _dvdread_internal=no ;;
963 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
964 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
965 --enable-dvdnav) _dvdnav=yes ;;
966 --disable-dvdnav) _dvdnav=no ;;
967 --enable-xanim) _xanim=yes ;;
968 --disable-xanim) _xanim=no ;;
969 --enable-real) _real=yes ;;
970 --disable-real) _real=no ;;
971 --enable-live) _live=yes ;;
972 --disable-live) _live=no ;;
973 --enable-nemesi) _nemesi=yes ;;
974 --disable-nemesi) _nemesi=no ;;
975 --enable-xinerama) _xinerama=yes ;;
976 --disable-xinerama) _xinerama=no ;;
977 --enable-mga) _mga=yes ;;
978 --disable-mga) _mga=no ;;
979 --enable-xmga) _xmga=yes ;;
980 --disable-xmga) _xmga=no ;;
981 --enable-vm) _vm=yes ;;
982 --disable-vm) _vm=no ;;
983 --enable-xf86keysym) _xf86keysym=yes ;;
984 --disable-xf86keysym) _xf86keysym=no ;;
985 --enable-mlib) _mlib=yes ;;
986 --disable-mlib) _mlib=no ;;
987 --enable-sunaudio) _sunaudio=yes ;;
988 --disable-sunaudio) _sunaudio=no ;;
989 --enable-sgiaudio) _sgiaudio=yes ;;
990 --disable-sgiaudio) _sgiaudio=no ;;
991 --enable-alsa) _alsa=yes ;;
992 --disable-alsa) _alsa=no ;;
993 --enable-tv) _tv=yes ;;
994 --disable-tv) _tv=no ;;
995 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
996 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
997 --enable-tv-v4l1) _tv_v4l1=yes ;;
998 --disable-tv-v4l1) _tv_v4l1=no ;;
999 --enable-tv-v4l2) _tv_v4l2=yes ;;
1000 --disable-tv-v4l2) _tv_v4l2=no ;;
1001 --enable-tv-dshow) _tv_dshow=yes ;;
1002 --disable-tv-dshow) _tv_dshow=no ;;
1003 --enable-tv-teletext) _tv_teletext=yes ;;
1004 --disable-tv-teletext) _tv_teletext=no ;;
1005 --enable-radio) _radio=yes ;;
1006 --enable-radio-capture) _radio_capture=yes ;;
1007 --disable-radio-capture) _radio_capture=no ;;
1008 --disable-radio) _radio=no ;;
1009 --enable-radio-v4l) _radio_v4l=yes ;;
1010 --disable-radio-v4l) _radio_v4l=no ;;
1011 --enable-radio-v4l2) _radio_v4l2=yes ;;
1012 --disable-radio-v4l2) _radio_v4l2=no ;;
1013 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1014 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1015 --enable-pvr) _pvr=yes ;;
1016 --disable-pvr) _pvr=no ;;
1017 --enable-fastmemcpy) _fastmemcpy=yes ;;
1018 --disable-fastmemcpy) _fastmemcpy=no ;;
1019 --enable-network) _network=yes ;;
1020 --disable-network) _network=no ;;
1021 --enable-winsock2) _winsock2=yes ;;
1022 --disable-winsock2) _winsock2=no ;;
1023 --enable-smb) _smbsupport=yes ;;
1024 --disable-smb) _smbsupport=no ;;
1025 --enable-vidix) _vidix=yes ;;
1026 --disable-vidix) _vidix=no ;;
1027 --with-vidix-drivers=*)
1028 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
1030 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1031 --enable-dhahelper) _dhahelper=yes ;;
1032 --disable-dhahelper) _dhahelper=no ;;
1033 --enable-svgalib_helper) _svgalib_helper=yes ;;
1034 --disable-svgalib_helper) _svgalib_helper=no ;;
1035 --enable-joystick) _joystick=yes ;;
1036 --disable-joystick) _joystick=no ;;
1037 --enable-xvid) _xvid=yes ;;
1038 --disable-xvid) _xvid=no ;;
1039 --enable-xvid-lavc) _xvid_lavc=yes ;;
1040 --disable-xvid-lavc) _xvid_lavc=no ;;
1041 --enable-x264) _x264=yes ;;
1042 --disable-x264) _x264=no ;;
1043 --enable-x264-lavc) _x264_lavc=yes ;;
1044 --disable-x264-lavc) _x264_lavc=no ;;
1045 --enable-libnut) _libnut=yes ;;
1046 --disable-libnut) _libnut=no ;;
1047 --enable-libavutil_a) _libavutil_a=yes ;;
1048 --disable-libavutil_a) _libavutil_a=no ;;
1049 --enable-libavutil_so) _libavutil_so=yes ;;
1050 --disable-libavutil_so) _libavutil_so=no ;;
1051 --enable-libavcodec_a) _libavcodec_a=yes ;;
1052 --disable-libavcodec_a) _libavcodec_a=no ;;
1053 --enable-libavcodec_so) _libavcodec_so=yes ;;
1054 --disable-libavcodec_so) _libavcodec_so=no ;;
1055 --enable-libamr_nb) _libamr_nb=yes ;;
1056 --disable-libamr_nb) _libamr_nb=no ;;
1057 --enable-libamr_wb) _libamr_wb=yes ;;
1058 --disable-libamr_wb) _libamr_wb=no ;;
1059 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1060 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1061 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1062 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1063 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1064 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1065 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1066 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1067 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1068 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1069 --enable-libavformat_a) _libavformat_a=yes ;;
1070 --disable-libavformat_a) _libavformat_a=no ;;
1071 --enable-libavformat_so) _libavformat_so=yes ;;
1072 --disable-libavformat_so) _libavformat_so=no ;;
1073 --enable-libpostproc_a) _libpostproc_a=yes ;;
1074 --disable-libpostproc_a) _libpostproc_a=no ;;
1075 --enable-libpostproc_so) _libpostproc_so=yes ;;
1076 --disable-libpostproc_so) _libpostproc_so=no ;;
1077 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1078 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1080 --enable-lirc) _lirc=yes ;;
1081 --disable-lirc) _lirc=no ;;
1082 --enable-lircc) _lircc=yes ;;
1083 --disable-lircc) _lircc=no ;;
1084 --enable-apple-remote) _apple_remote=yes ;;
1085 --disable-apple-remote) _apple_remote=no ;;
1086 --enable-apple-ir) _apple_ir=yes ;;
1087 --disable-apple-ir) _apple_ir=no ;;
1088 --enable-gui) _gui=yes ;;
1089 --disable-gui) _gui=no ;;
1090 --enable-gtk1) _gtk1=yes ;;
1091 --disable-gtk1) _gtk1=no ;;
1092 --enable-termcap) _termcap=yes ;;
1093 --disable-termcap) _termcap=no ;;
1094 --enable-termios) _termios=yes ;;
1095 --disable-termios) _termios=no ;;
1096 --enable-3dfx) _3dfx=yes ;;
1097 --disable-3dfx) _3dfx=no ;;
1098 --enable-s3fb) _s3fb=yes ;;
1099 --disable-s3fb) _s3fb=no ;;
1100 --enable-tdfxfb) _tdfxfb=yes ;;
1101 --disable-tdfxfb) _tdfxfb=no ;;
1102 --disable-tdfxvid) _tdfxvid=no ;;
1103 --enable-tdfxvid) _tdfxvid=yes ;;
1104 --disable-xvr100) _xvr100=no ;;
1105 --enable-xvr100) _xvr100=yes ;;
1106 --disable-tga) _tga=no ;;
1107 --enable-tga) _tga=yes ;;
1108 --enable-directfb) _directfb=yes ;;
1109 --disable-directfb) _directfb=no ;;
1110 --enable-zr) _zr=yes ;;
1111 --disable-zr) _zr=no ;;
1112 --enable-bl) _bl=yes ;;
1113 --disable-bl) _bl=no ;;
1114 --enable-mtrr) _mtrr=yes ;;
1115 --disable-mtrr) _mtrr=no ;;
1116 --enable-largefiles) _largefiles=yes ;;
1117 --disable-largefiles) _largefiles=no ;;
1118 --enable-shm) _shm=yes ;;
1119 --disable-shm) _shm=no ;;
1120 --enable-select) _select=yes ;;
1121 --disable-select) _select=no ;;
1122 --enable-linux-devfs) _linux_devfs=yes ;;
1123 --disable-linux-devfs) _linux_devfs=no ;;
1124 --enable-cdparanoia) _cdparanoia=yes ;;
1125 --disable-cdparanoia) _cdparanoia=no ;;
1126 --enable-cddb) _cddb=yes ;;
1127 --disable-cddb) _cddb=no ;;
1128 --enable-big-endian) _big_endian=yes ;;
1129 --disable-big-endian) _big_endian=no ;;
1130 --enable-bitmap-font) _bitmap_font=yes ;;
1131 --disable-bitmap-font) _bitmap_font=no ;;
1132 --enable-freetype) _freetype=yes ;;
1133 --disable-freetype) _freetype=no ;;
1134 --enable-fontconfig) _fontconfig=yes ;;
1135 --disable-fontconfig) _fontconfig=no ;;
1136 --enable-unrarexec) _unrar_exec=yes ;;
1137 --disable-unrarexec) _unrar_exec=no ;;
1138 --enable-ftp) _ftp=yes ;;
1139 --disable-ftp) _ftp=no ;;
1140 --enable-vstream) _vstream=yes ;;
1141 --disable-vstream) _vstream=no ;;
1142 --enable-pthreads) _pthreads=yes ;;
1143 --disable-pthreads) _pthreads=no ;;
1144 --enable-w32threads) _w32threads=yes ;;
1145 --disable-w32threads) _w32threads=no ;;
1146 --enable-ass) _ass=yes ;;
1147 --disable-ass) _ass=no ;;
1148 --enable-rpath) _rpath=yes ;;
1149 --disable-rpath) _rpath=no ;;
1151 --enable-fribidi) _fribidi=yes ;;
1152 --disable-fribidi) _fribidi=no ;;
1154 --enable-enca) _enca=yes ;;
1155 --disable-enca) _enca=no ;;
1157 --enable-inet6) _inet6=yes ;;
1158 --disable-inet6) _inet6=no ;;
1160 --enable-gethostbyname2) _gethostbyname2=yes ;;
1161 --disable-gethostbyname2) _gethostbyname2=no ;;
1163 --enable-dga1) _dga1=yes ;;
1164 --disable-dga1) _dga1=no ;;
1165 --enable-dga2) _dga2=yes ;;
1166 --disable-dga2) _dga2=no ;;
1168 --enable-menu) _menu=yes ;;
1169 --disable-menu) _menu=no ;;
1171 --enable-qtx) _qtx=yes ;;
1172 --disable-qtx) _qtx=no ;;
1174 --enable-macosx) _macosx=yes ;;
1175 --disable-macosx) _macosx=no ;;
1176 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1177 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1178 --enable-macosx-bundle) _macosx_bundle=yes;;
1179 --disable-macosx-bundle) _macosx_bundle=no;;
1181 --enable-maemo) _maemo=yes ;;
1182 --disable-maemo) _maemo=no ;;
1184 --enable-sortsub) _sortsub=yes ;;
1185 --disable-sortsub) _sortsub=no ;;
1187 --enable-crash-debug) _crash_debug=yes ;;
1188 --disable-crash-debug) _crash_debug=no ;;
1189 --enable-sighandler) _sighandler=yes ;;
1190 --disable-sighandler) _sighandler=no ;;
1191 --enable-win32dll) _win32dll=yes ;;
1192 --disable-win32dll) _win32dll=no ;;
1194 --enable-sse) _sse=yes ;;
1195 --disable-sse) _sse=no ;;
1196 --enable-sse2) _sse2=yes ;;
1197 --disable-sse2) _sse2=no ;;
1198 --enable-ssse3) _ssse3=yes ;;
1199 --disable-ssse3) _ssse3=no ;;
1200 --enable-mmxext) _mmxext=yes ;;
1201 --disable-mmxext) _mmxext=no ;;
1202 --enable-3dnow) _3dnow=yes ;;
1203 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1204 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1205 --disable-3dnowext) _3dnowext=no ;;
1206 --enable-cmov) _cmov=yes ;;
1207 --disable-cmov) _cmov=no ;;
1208 --enable-fast-cmov) _fast_cmov=yes ;;
1209 --disable-fast-cmov) _fast_cmov=no ;;
1210 --enable-altivec) _altivec=yes ;;
1211 --disable-altivec) _altivec=no ;;
1212 --enable-armv5te) _armv5te=yes ;;
1213 --disable-armv5te) _armv5te=no ;;
1214 --enable-armv6) _armv6=yes ;;
1215 --disable-armv6) _armv6=no ;;
1216 --enable-iwmmxt) _iwmmxt=yes ;;
1217 --disable-iwmmxt) _iwmmxt=no ;;
1218 --enable-mmx) _mmx=yes ;;
1219 --disable-mmx) # 3Dnow! and MMX2 require MMX
1220 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1223 echo "Unknown parameter: $ac_option"
1224 exit 1
1227 esac
1228 done
1230 # Atmos: moved this here, to be correct, if --prefix is specified
1231 test -z "$_bindir" && _bindir="$_prefix/bin"
1232 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1233 test -z "$_mandir" && _mandir="$_prefix/share/man"
1234 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1235 test -z "$_libdir" && _libdir="$_prefix/lib"
1237 # Determine our OS name and CPU architecture
1238 if test -z "$_target" ; then
1239 # OS name
1240 system_name=`uname -s 2>&1`
1241 case "$system_name" in
1242 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1244 IRIX*)
1245 system_name=IRIX
1247 GNU/kFreeBSD)
1248 system_name=FreeBSD
1250 HP-UX*)
1251 system_name=HP-UX
1253 [cC][yY][gG][wW][iI][nN]*)
1254 system_name=CYGWIN
1256 MINGW32*)
1257 system_name=MINGW32
1259 OS/2*)
1260 system_name=OS/2
1263 system_name="$system_name-UNKNOWN"
1265 esac
1268 # host's CPU/instruction set
1269 host_arch=`uname -p 2>&1`
1270 case "$host_arch" in
1271 i386|sparc|ppc|alpha|arm|sh3|mips|vax)
1273 powerpc) # Darwin returns 'powerpc'
1274 host_arch=ppc
1276 *) # uname -p on Linux returns 'unknown' for the processor type,
1277 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1279 # Maybe uname -m (machine hardware name) returns something we
1280 # recognize.
1282 # x86/x86pc is used by QNX
1283 case "`uname -m 2>&1`" in
1284 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 ;;
1285 ia64) host_arch=ia64 ;;
1286 x86_64|amd64)
1287 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1288 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1289 host_arch=x86_64
1290 else
1291 host_arch=i386
1294 macppc|ppc|ppc64) host_arch=ppc ;;
1295 alpha) host_arch=alpha ;;
1296 sparc) host_arch=sparc ;;
1297 sparc64) host_arch=sparc64 ;;
1298 parisc*|hppa*|9000*) host_arch=hppa ;;
1299 arm*|zaurus|cats) host_arch=arm ;;
1300 sh3) host_arch=sh3 ;;
1301 s390) host_arch=s390 ;;
1302 s390x) host_arch=s390x ;;
1303 mips*) host_arch=mips ;;
1304 vax) host_arch=vax ;;
1305 xtensa*) host_arch=xtensa ;;
1306 *) host_arch=UNKNOWN ;;
1307 esac
1309 esac
1310 else # if test -z "$_target"
1311 system_name=`echo $_target | cut -d '-' -f 2`
1312 case "`echo $system_name | tr A-Z a-z`" in
1313 linux) system_name=Linux ;;
1314 freebsd) system_name=FreeBSD ;;
1315 gnu/kfreebsd) system_name=FreeBSD ;;
1316 netbsd) system_name=NetBSD ;;
1317 bsd/os) system_name=BSD/OS ;;
1318 openbsd) system_name=OpenBSD ;;
1319 dragonfly) system_name=DragonFly ;;
1320 sunos) system_name=SunOS ;;
1321 qnx) system_name=QNX ;;
1322 morphos) system_name=MorphOS ;;
1323 amigaos) system_name=AmigaOS ;;
1324 mingw32msvc) system_name=MINGW32 ;;
1325 esac
1326 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1327 host_arch=`echo $_target | cut -d '-' -f 1`
1328 if test `echo $host_arch` != "x86_64" ; then
1329 host_arch=`echo $host_arch | tr '_' '-'`
1333 echo "Detected operating system: $system_name"
1334 echo "Detected host architecture: $host_arch"
1336 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1337 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1341 _timer=timer-linux.c
1342 _getch=getch2.c
1343 if freebsd ; then
1344 _ld_extra="$_ld_extra -L/usr/local/lib"
1345 _inc_extra="$_inc_extra -I/usr/local/include"
1348 if netbsd || dragonfly ; then
1349 _ld_extra="$_ld_extra -L/usr/pkg/lib"
1350 _inc_extra="$_inc_extra -I/usr/pkg/include"
1353 if darwin; then
1354 _ld_extra="$_ld_extra -L/usr/local/lib"
1355 _inc_extra="$_inc_extra -I/usr/local/include"
1356 _timer=timer-darwin.c
1359 if aix ; then
1360 _ld_extra="$_ld_extra -lC"
1363 if irix ; then
1364 _ranlib='ar -r'
1365 elif linux ; then
1366 _ranlib='true'
1369 if win32 ; then
1370 _exesuf=".exe"
1371 # -lwinmm is always needed for osdep/timer-win2.c
1372 _ld_extra="$_ld_extra -lwinmm"
1373 _pe_executable=yes
1374 _timer=timer-win2.c
1377 if mingw32 ; then
1378 _getch=getch2-win.c
1379 _need_shmem=no
1382 if cygwin ; then
1383 _def_confwin32='#define WIN32'
1386 if amigaos ; then
1387 _select=no
1388 _sighandler=no
1389 _stream_cache=no
1390 _def_stream_cache="#undef USE_STREAM_CACHE"
1393 if qnx ; then
1394 _ld_extra="$_ld_extra -lph"
1397 if os2 ; then
1398 _exesuf=".exe"
1399 _getch=getch2-os2.c
1400 _need_shmem=no
1401 _ar="emxomfar -p256"
1402 _ranlib="echo ignoring ranlib"
1403 _ld_extra="$_ld_extra -Zomf -Zstack 16384 -Zbin-files -Zargs-wild -lmmpm2"
1406 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1407 test "$I" && break
1408 done
1411 TMPLOG="configure.log"
1412 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1413 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1414 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1415 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1416 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1418 rm -f "$TMPLOG"
1419 echo configuration: $_configuration > "$TMPLOG"
1420 echo >> "$TMPLOG"
1423 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1424 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1425 # know about '-n'.
1426 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1427 _head() { head -$1 2>/dev/null ; }
1428 else
1429 _head() { head -n $1 2>/dev/null ; }
1431 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1432 _tail() { tail -$1 2>/dev/null ; }
1433 else
1434 _tail() { tail -n $1 2>/dev/null ; }
1437 # Checking CC version...
1438 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1439 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1440 echocheck "$_cc version"
1441 cc_vendor=intel
1442 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1443 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1444 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1445 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1446 # TODO verify older icc/ecc compatibility
1447 case $cc_version in
1449 cc_version="v. ?.??, bad"
1450 cc_fail=yes
1452 10.1)
1453 cc_version="$cc_version, ok"
1456 cc_version="$cc_version, bad"
1457 cc_fail=yes
1459 esac
1460 echores "$cc_version"
1461 else
1462 for _cc in "$_cc" cc gcc ; do
1463 cc_name_tmp=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1464 if test "$cc_name_tmp" = "gcc"; then
1465 cc_name=$cc_name_tmp
1466 echocheck "$_cc version"
1467 cc_vendor=gnu
1468 cc_version=`$_cc -dumpversion 2>&1`
1469 case $cc_version in
1470 2.96*)
1471 cc_fail=yes
1474 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1475 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1476 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1478 esac
1479 echores "$cc_version"
1480 break
1482 done
1483 fi # icc
1484 test "$cc_fail" = yes && die "unsupported compiler version"
1486 echocheck "host cc"
1487 test "$_host_cc" || _host_cc=$_cc
1488 echores $_host_cc
1490 echocheck "cross compilation"
1491 if test $_cross_compile = auto ; then
1492 cat > $TMPC << EOF
1493 int main(void) { return 0; }
1495 _cross_compile=yes
1496 cc_check && "$TMPEXE" && _cross_compile=no
1498 echores $_cross_compile
1500 if test $_cross_compile = yes; then
1501 tmp_run() {
1502 return 0
1506 # ---
1508 # now that we know what compiler should be used for compilation, try to find
1509 # out which assembler is used by the $_cc compiler
1510 if test "$_as" = auto ; then
1511 _as=`$_cc -print-prog-name=as`
1512 test -z "$_as" && _as=as
1515 # XXX: this should be ok..
1516 _cpuinfo="echo"
1518 if test "$_runtime_cpudetection" = no ; then
1520 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1521 # FIXME: Remove the cygwin check once AMD CPUs are supported
1522 if test -r /proc/cpuinfo && ! cygwin; then
1523 # Linux with /proc mounted, extract CPU information from it
1524 _cpuinfo="cat /proc/cpuinfo"
1525 elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then
1526 # FreeBSD with Linux emulation /proc mounted,
1527 # extract CPU information from it
1528 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1529 elif darwin && ! x86_32 ; then
1530 # use hostinfo on Darwin
1531 _cpuinfo="hostinfo"
1532 elif aix; then
1533 # use 'lsattr' on AIX
1534 _cpuinfo="lsattr -E -l proc0 -a type"
1535 elif x86; then
1536 # all other OSes try to extract CPU information from a small helper
1537 # program cpuinfo instead
1538 $_cc -o cpuinfo$_exesuf cpuinfo.c
1539 _cpuinfo="./cpuinfo$_exesuf"
1542 if x86 ; then
1543 # gather more CPU information
1544 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1545 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1546 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1547 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1548 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1550 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1552 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1553 -e s/xmm/sse/ -e s/kni/sse/`
1555 for ext in $pparam ; do
1556 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1557 done
1559 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1560 test $_sse = kernel_check && _mmxext=kernel_check
1562 echocheck "CPU vendor"
1563 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1565 echocheck "CPU type"
1566 echores "$pname"
1569 fi # test "$_runtime_cpudetection" = no
1571 if x86 && test "$_runtime_cpudetection" = no ; then
1572 extcheck() {
1573 if test "$1" = kernel_check ; then
1574 echocheck "kernel support of $2"
1575 cat > $TMPC <<EOF
1576 #include <signal.h>
1577 void catch() { exit(1); }
1578 int main(void) {
1579 signal(SIGILL, catch);
1580 __asm__ __volatile__ ("$3":::"memory"); return 0;
1584 if cc_check && tmp_run ; then
1585 eval _$2=yes
1586 echores "yes"
1587 _optimizing="$_optimizing $2"
1588 return 0
1589 else
1590 eval _$2=no
1591 echores "failed"
1592 echo "It seems that your kernel does not correctly support $2."
1593 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1594 return 1
1597 return 0
1600 extcheck $_mmx "mmx" "emms"
1601 extcheck $_mmxext "mmxext" "sfence"
1602 extcheck $_3dnow "3dnow" "femms"
1603 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1604 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1605 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1606 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1607 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1609 echocheck "mtrr support"
1610 if test "$_mtrr" = kernel_check ; then
1611 _mtrr="yes"
1612 _optimizing="$_optimizing mtrr"
1614 echores "$_mtrr"
1616 if test "$_gcc3_ext" != ""; then
1617 # if we had to disable sse/sse2 because the active kernel does not
1618 # support this instruction set extension, we also have to tell
1619 # gcc3 to not generate sse/sse2 instructions for normal C code
1620 cat > $TMPC << EOF
1621 int main(void) { return 0; }
1623 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1629 _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'
1630 case "$host_arch" in
1631 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1632 _arch='X86 X86_32'
1633 _target_arch_x86="ARCH_X86 = yes"
1634 _target_arch="ARCH_X86_32 = yes"
1635 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1636 iproc=486
1637 proc=i486
1640 if test "$_runtime_cpudetection" = no ; then
1641 case "$pvendor" in
1642 AuthenticAMD)
1643 case "$pfamily" in
1644 3) proc=i386 iproc=386 ;;
1645 4) proc=i486 iproc=486 ;;
1646 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1647 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1648 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1649 proc=k6-3
1650 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1651 proc=geode
1652 elif test "$pmodel" -ge 8; then
1653 proc=k6-2
1654 elif test "$pmodel" -ge 6; then
1655 proc=k6
1656 else
1657 proc=i586
1660 6) iproc=686
1661 # It's a bit difficult to determine the correct type of Family 6
1662 # AMD CPUs just from their signature. Instead, we check directly
1663 # whether it supports SSE.
1664 if test "$_sse" = yes; then
1665 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1666 proc=athlon-xp
1667 else
1668 # Again, gcc treats athlon and athlon-tbird similarly.
1669 proc=athlon
1672 15) iproc=686
1673 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1674 # caught and remedied in the optimization tests below.
1675 proc=k8
1678 *) proc=k8 iproc=686 ;;
1679 esac
1681 GenuineIntel)
1682 case "$pfamily" in
1683 3) proc=i386 iproc=386 ;;
1684 4) proc=i486 iproc=486 ;;
1685 5) iproc=586
1686 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1687 proc=pentium-mmx # 4 is desktop, 8 is mobile
1688 else
1689 proc=i586
1692 6) iproc=686
1693 if test "$pmodel" -ge 15; then
1694 proc=core2
1695 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1696 proc=pentium-m
1697 elif test "$pmodel" -ge 7; then
1698 proc=pentium3
1699 elif test "$pmodel" -ge 3; then
1700 proc=pentium2
1701 else
1702 proc=i686
1705 15) iproc=686
1706 # A nocona in 32-bit mode has no more capabilities than a prescott.
1707 if test "$pmodel" -ge 3; then
1708 proc=prescott
1709 else
1710 proc=pentium4
1712 test $_fast_cmov = "auto" && _fast_cmov=no
1714 *) proc=prescott iproc=686 ;;
1715 esac
1717 CentaurHauls)
1718 case "$pfamily" in
1719 5) iproc=586
1720 if test "$pmodel" -ge 8; then
1721 proc=winchip2
1722 elif test "$pmodel" -ge 4; then
1723 proc=winchip-c6
1724 else
1725 proc=i586
1728 6) iproc=686
1729 if test "$pmodel" -ge 9; then
1730 proc=c3-2
1731 else
1732 proc=c3
1733 iproc=586
1736 *) proc=i686 iproc=i686 ;;
1737 esac
1739 unknown)
1740 case "$pfamily" in
1741 3) proc=i386 iproc=386 ;;
1742 4) proc=i486 iproc=486 ;;
1743 *) proc=i586 iproc=586 ;;
1744 esac
1747 proc=i586 iproc=586 ;;
1748 esac
1749 fi # test "$_runtime_cpudetection" = no
1752 # check that gcc supports our CPU, if not, fall back to earlier ones
1753 # LGB: check -mcpu and -march swithing step by step with enabling
1754 # to fall back till 386.
1756 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1758 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1759 cpuopt=-mtune
1760 else
1761 cpuopt=-mcpu
1764 echocheck "GCC & CPU optimization abilities"
1765 cat > $TMPC << EOF
1766 int main(void) { return 0; }
1768 if test "$_runtime_cpudetection" = no ; then
1769 cc_check -march=native && proc=native
1770 if test "$proc" = "k8"; then
1771 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1773 if test "$proc" = "athlon-xp"; then
1774 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1776 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1777 cc_check -march=$proc $cpuopt=$proc || proc=k6
1779 if test "$proc" = "k6" || test "$proc" = "c3"; then
1780 if ! cc_check -march=$proc $cpuopt=$proc; then
1781 if cc_check -march=i586 $cpuopt=i686; then
1782 proc=i586-i686
1783 else
1784 proc=i586
1788 if test "$proc" = "prescott" ; then
1789 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1791 if test "$proc" = "core2" ; then
1792 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1794 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
1795 cc_check -march=$proc $cpuopt=$proc || proc=i686
1797 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1798 cc_check -march=$proc $cpuopt=$proc || proc=i586
1800 if test "$proc" = "i586"; then
1801 cc_check -march=$proc $cpuopt=$proc || proc=i486
1803 if test "$proc" = "i486" ; then
1804 cc_check -march=$proc $cpuopt=$proc || proc=i386
1806 if test "$proc" = "i386" ; then
1807 cc_check -march=$proc $cpuopt=$proc || proc=error
1809 if test "$proc" = "error" ; then
1810 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1811 _mcpu=""
1812 _march=""
1813 _optimizing=""
1814 elif test "$proc" = "i586-i686"; then
1815 _march="-march=i586"
1816 _mcpu="$cpuopt=i686"
1817 _optimizing="$proc"
1818 else
1819 _march="-march=$proc"
1820 _mcpu="$cpuopt=$proc"
1821 _optimizing="$proc"
1823 else # if test "$_runtime_cpudetection" = no
1824 _mcpu="$cpuopt=generic"
1825 # at least i486 required, for bswap instruction
1826 _march="-march=i486"
1827 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1828 cc_check $_mcpu || _mcpu=""
1829 cc_check $_march $_mcpu || _march=""
1832 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1833 ## autodetected mcpu/march parameters
1834 if test "$_target" ; then
1835 # TODO: it may be a good idea to check GCC and fall back in all cases
1836 if test "$host_arch" = "i586-i686"; then
1837 _march="-march=i586"
1838 _mcpu="$cpuopt=i686"
1839 else
1840 _march="-march=$host_arch"
1841 _mcpu="$cpuopt=$host_arch"
1844 proc="$host_arch"
1846 case "$proc" in
1847 i386) iproc=386 ;;
1848 i486) iproc=486 ;;
1849 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1850 i686|athlon*|pentium*) iproc=686 ;;
1851 *) iproc=586 ;;
1852 esac
1855 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1856 _fast_cmov="yes"
1857 else
1858 _fast_cmov="no"
1861 echores "$proc"
1864 ia64)
1865 _arch='IA64'
1866 _target_arch='ARCH_IA64 = yes'
1867 iproc='ia64'
1868 proc=''
1869 _march=''
1870 _mcpu=''
1871 _optimizing=''
1874 x86_64|amd64)
1875 _arch='X86 X86_64'
1876 _target_arch='ARCH_X86_64 = yes'
1877 _target_arch_x86="ARCH_X86 = yes"
1878 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1879 iproc='x86_64'
1881 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1882 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1883 cpuopt=-mtune
1884 else
1885 cpuopt=-mcpu
1887 if test "$_runtime_cpudetection" = no ; then
1888 case "$pvendor" in
1889 AuthenticAMD)
1890 proc=k8;;
1891 GenuineIntel)
1892 case "$pfamily" in
1893 6) proc=core2;;
1895 # 64-bit prescotts exist, but as far as GCC is concerned they
1896 # have the same capabilities as a nocona.
1897 proc=nocona
1898 test $_fast_cmov = "auto" && _fast_cmov=no
1900 esac
1903 proc=error;;
1904 esac
1905 fi # test "$_runtime_cpudetection" = no
1907 echocheck "GCC & CPU optimization abilities"
1908 cat > $TMPC << EOF
1909 int main(void) { return 0; }
1911 # This is a stripped-down version of the i386 fallback.
1912 if test "$_runtime_cpudetection" = no ; then
1913 cc_check -march=native && proc=native
1914 # --- AMD processors ---
1915 if test "$proc" = "k8"; then
1916 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1918 # This will fail if gcc version < 3.3, which is ok because earlier
1919 # versions don't really support 64-bit on amd64.
1920 # Is this a valid assumption? -Corey
1921 if test "$proc" = "athlon-xp"; then
1922 cc_check -march=$proc $cpuopt=$proc || proc=error
1924 # --- Intel processors ---
1925 if test "$proc" = "core2"; then
1926 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1928 if test "$proc" = "nocona"; then
1929 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1931 if test "$proc" = "pentium4"; then
1932 cc_check -march=$proc $cpuopt=$proc || proc=error
1935 _march="-march=$proc"
1936 _mcpu="$cpuopt=$proc"
1937 if test "$proc" = "error" ; then
1938 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1939 _mcpu=""
1940 _march=""
1942 else # if test "$_runtime_cpudetection" = no
1943 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1944 _march="-march=x86-64"
1945 _mcpu="$cpuopt=generic"
1946 cc_check $_mcpu || _mcpu="x86-64"
1947 cc_check $_mcpu || _mcpu=""
1948 cc_check $_march $_mcpu || _march=""
1951 _optimizing=""
1953 echores "$proc"
1956 sparc)
1957 _arch='SPARC'
1958 _target_arch='ARCH_SPARC = yes'
1959 iproc='sparc'
1960 if sunos ; then
1961 echocheck "CPU type"
1962 karch=`uname -m`
1963 case "`echo $karch`" in
1964 sun4) proc=v7 ;;
1965 sun4c) proc=v7 ;;
1966 sun4d) proc=v8 ;;
1967 sun4m) proc=v8 ;;
1968 sun4u) proc=ultrasparc _vis='yes' ;;
1969 sun4v) proc=v9 ;;
1970 *) proc=v8 ;;
1971 esac
1972 echores "$proc"
1973 else
1974 proc=v8
1976 _march=''
1977 _mcpu="-mcpu=$proc"
1978 _optimizing="$proc"
1981 sparc64)
1982 _arch='SPARC'
1983 _target_arch='ARCH_SPARC = yes'
1984 _vis='yes'
1985 iproc='sparc'
1986 proc='ultrasparc'
1987 _march=''
1988 _mcpu="-mcpu=$proc"
1989 _optimizing="$proc"
1992 arm|armv4l|armv5tel)
1993 _arch='ARM ARMV4L'
1994 _target_arch='ARCH_ARMV4L = yes'
1995 iproc='arm'
1996 proc=''
1997 _march=''
1998 _mcpu=''
1999 _optimizing=''
2002 sh3)
2003 _arch='SH3'
2004 _target_arch='ARCH_SH3 = yes'
2005 iproc='sh3'
2006 proc=''
2007 _march='-m3'
2008 _mcpu='-ml'
2009 _optimizing=''
2012 ppc|powerpc)
2013 _arch='POWERPC PPC'
2014 _def_dcbzl='#undef HAVE_DCBZL'
2015 _target_arch='ARCH_POWERPC = yes'
2016 iproc='ppc'
2017 proc=''
2018 _march=''
2019 _mcpu=''
2020 _optimizing=''
2022 echocheck "CPU type"
2023 case $system_name in
2024 Linux)
2025 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2026 if test -n "`$_cpuinfo | grep altivec`"; then
2027 test $_altivec = auto && _altivec=yes
2030 Darwin)
2031 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2032 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2033 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2034 test $_altivec = auto && _altivec=yes
2037 NetBSD)
2038 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2039 case $cc_version in
2040 2*|3.0*|3.1*|3.2*|3.3*)
2043 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2044 test $_altivec = auto && _altivec=yes
2047 esac
2049 AIX)
2050 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2052 esac
2053 if test "$_altivec" = yes; then
2054 echores "$proc altivec"
2055 else
2056 _altivec=no
2057 echores "$proc"
2060 echocheck "GCC & CPU optimization abilities"
2062 if test -n "$proc"; then
2063 case "$proc" in
2064 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2065 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2066 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2067 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2068 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2069 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2070 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2071 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2072 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2073 *) ;;
2074 esac
2075 # gcc 3.1(.1) and up supports 7400 and 7450
2076 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2077 case "$proc" in
2078 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2079 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2080 *) ;;
2081 esac
2083 # gcc 3.2 and up supports 970
2084 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2085 case "$proc" in
2086 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2087 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2088 *) ;;
2089 esac
2091 # gcc 3.3 and up supports POWER4
2092 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2093 case "$proc" in
2094 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2095 *) ;;
2096 esac
2098 # gcc 3.4 and up supports 440*
2099 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2100 case "$proc" in
2101 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2102 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2103 *) ;;
2104 esac
2106 # gcc 4.0 and up supports POWER5
2107 if test "$_cc_major" -ge "4"; then
2108 case "$proc" in
2109 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2110 *) ;;
2111 esac
2115 if test -n "$_mcpu"; then
2116 _optimizing=`echo $_mcpu | cut -c 8-`
2117 echores "$_optimizing"
2118 else
2119 echores "none"
2124 alpha)
2125 _arch='ALPHA'
2126 _target_arch='ARCH_ALPHA = yes'
2127 iproc='alpha'
2128 _march=''
2130 echocheck "CPU type"
2131 cat > $TMPC << EOF
2132 int main(void) {
2133 unsigned long ver, mask;
2134 asm ("implver %0" : "=r" (ver));
2135 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2136 printf("%ld-%x\n", ver, ~mask);
2137 return 0;
2140 $_cc -o "$TMPEXE" "$TMPC"
2141 case `"$TMPEXE"` in
2143 0-0) proc="ev4"; _mvi="0";;
2144 1-0) proc="ev5"; _mvi="0";;
2145 1-1) proc="ev56"; _mvi="0";;
2146 1-101) proc="pca56"; _mvi="1";;
2147 2-303) proc="ev6"; _mvi="1";;
2148 2-307) proc="ev67"; _mvi="1";;
2149 2-1307) proc="ev68"; _mvi="1";;
2150 esac
2151 echores "$proc"
2153 echocheck "GCC & CPU optimization abilities"
2154 if test "$proc" = "ev68" ; then
2155 cc_check -mcpu=$proc || proc=ev67
2157 if test "$proc" = "ev67" ; then
2158 cc_check -mcpu=$proc || proc=ev6
2160 _mcpu="-mcpu=$proc"
2161 echores "$proc"
2163 _optimizing="$proc"
2166 mips)
2167 _arch='SGI_MIPS'
2168 _target_arch='ARCH_SGI_MIPS = yes'
2169 iproc='sgi-mips'
2170 proc=''
2171 _march=''
2172 _mcpu=''
2173 _optimizing=''
2175 if irix ; then
2176 echocheck "CPU type"
2177 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2178 case "`echo $proc`" in
2179 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2180 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2181 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2182 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2183 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2184 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2185 esac
2186 # gcc < 3.x does not support -mtune.
2187 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2188 _mcpu=''
2190 echores "$proc"
2195 hppa)
2196 _arch='PA_RISC'
2197 _target_arch='ARCH_PA_RISC = yes'
2198 iproc='PA-RISC'
2199 proc=''
2200 _march=''
2201 _mcpu=''
2202 _optimizing=''
2205 s390)
2206 _arch='S390'
2207 _target_arch='ARCH_S390 = yes'
2208 iproc='390'
2209 proc=''
2210 _march=''
2211 _mcpu=''
2212 _optimizing=''
2215 s390x)
2216 _arch='S390X'
2217 _target_arch='ARCH_S390X = yes'
2218 iproc='390x'
2219 proc=''
2220 _march=''
2221 _mcpu=''
2222 _optimizing=''
2225 vax)
2226 _arch='VAX'
2227 _target_arch='ARCH_VAX = yes'
2228 iproc='vax'
2229 proc=''
2230 _march=''
2231 _mcpu=''
2232 _optimizing=''
2235 xtensa)
2236 _arch='XTENSA'
2237 _target_arch='ARCH_XTENSA = yes'
2238 iproc='xtensa'
2239 proc=''
2240 _march=''
2241 _mcpu=''
2242 _optimizing=''
2245 generic)
2246 _arch='GENERIC'
2247 _target_arch='ARCH_GENERIC = yes'
2248 iproc=''
2249 proc=''
2250 _march=''
2251 _mcpu=''
2252 _optimizing=''
2256 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2257 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2258 die "unsupported architecture $host_arch"
2260 esac # case "$host_arch" in
2262 if test "$_runtime_cpudetection" = yes ; then
2263 if x86 ; then
2264 test "$_cmov" != no && _cmov=yes
2265 x86_32 && _cmov=no
2266 test "$_mmx" != no && _mmx=yes
2267 test "$_3dnow" != no && _3dnow=yes
2268 test "$_3dnowext" != no && _3dnowext=yes
2269 test "$_mmxext" != no && _mmxext=yes
2270 test "$_sse" != no && _sse=yes
2271 test "$_sse2" != no && _sse2=yes
2272 test "$_ssse3" != no && _ssse3=yes
2273 test "$_mtrr" != no && _mtrr=yes
2275 if ppc; then
2276 _altivec=yes
2281 echocheck "extern symbol prefix"
2282 cat > $TMPC << EOF
2283 int ff_extern;
2285 cc_check -c || die "Symbol mangling check failed."
2286 sym=$(nm -P -g $TMPEXE)
2287 extern_prefix=${sym%%ff_extern*}
2288 _def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2289 echores $extern_prefix
2292 echocheck "assembler support of -pipe option"
2293 cat > $TMPC << EOF
2294 int main(void) { return 0; }
2296 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2299 echocheck "compiler support of named assembler arguments"
2300 _named_asm_args=yes
2301 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2302 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2303 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2304 _named_asm_args=no
2305 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2307 echores $_named_asm_args
2310 if darwin && test "$cc_vendor" = "gnu" ; then
2311 echocheck "GCC support of -mstackrealign"
2312 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2313 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2314 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2315 # wrong code with this flag, but this can be worked around by adding
2316 # -fno-unit-at-a-time as described in the blog post at
2317 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2318 cat > $TMPC << EOF
2319 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2320 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2322 cc_check -O4 -mstackrealign && tmp_run && _stackrealign=-mstackrealign
2323 test -z "$_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2324 && tmp_run && _stackrealign="-mstackrealign -fno-unit-at-a-time"
2325 test -n "$_stackrealign" && echores "yes" || echores "no"
2326 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2329 # Checking for CFLAGS
2330 _install_strip="-s"
2331 if test "$_profile" != "" || test "$_debug" != "" ; then
2332 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2333 _install_strip=
2334 elif test -z "$CFLAGS" ; then
2335 if test "$cc_vendor" = "intel" ; then
2336 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2337 elif test "$cc_vendor" != "gnu" ; then
2338 CFLAGS="-O2 $_march $_mcpu $_pipe"
2339 else
2340 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2342 else
2343 _warn_CFLAGS=yes
2345 if test -n "$LDFLAGS" ; then
2346 _ld_extra="$_ld_extra $LDFLAGS"
2347 _warn_CFLAGS=yes
2348 elif test "$cc_vendor" = "intel" ; then
2349 _ld_extra="$_ld_extra -i-static"
2351 if test -n "$CPPFLAGS" ; then
2352 _inc_extra="$_inc_extra $CPPFLAGS"
2353 _warn_CFLAGS=yes
2358 if x86_32 ; then
2359 # Checking assembler (_as) compatibility...
2360 # Added workaround for older as that reads from stdin by default - atmos
2361 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2362 echocheck "assembler ($_as $as_version)"
2364 _pref_as_version='2.9.1'
2365 echo 'nop' > $TMPS
2366 if test "$_mmx" = yes ; then
2367 echo 'emms' >> $TMPS
2369 if test "$_3dnow" = yes ; then
2370 _pref_as_version='2.10.1'
2371 echo 'femms' >> $TMPS
2373 if test "$_3dnowext" = yes ; then
2374 _pref_as_version='2.10.1'
2375 echo 'pswapd %mm0, %mm0' >> $TMPS
2377 if test "$_mmxext" = yes ; then
2378 _pref_as_version='2.10.1'
2379 echo 'movntq %mm0, (%eax)' >> $TMPS
2381 if test "$_sse" = yes ; then
2382 _pref_as_version='2.10.1'
2383 echo 'xorps %xmm0, %xmm0' >> $TMPS
2385 #if test "$_sse2" = yes ; then
2386 # _pref_as_version='2.11'
2387 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2389 if test "$_cmov" = yes ; then
2390 _pref_as_version='2.10.1'
2391 echo 'cmovb %eax, %ebx' >> $TMPS
2393 if test "$_ssse3" = yes ; then
2394 _pref_as_version='2.16.92'
2395 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2397 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2399 if test "$as_verc_fail" != yes ; then
2400 echores "ok"
2401 else
2402 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2403 echores "failed"
2404 die "obsolete binutils version"
2407 fi #if x86_32
2409 echocheck ".align is a power of two"
2410 if test "$_asmalign_pot" = auto ; then
2411 _asmalign_pot=no
2412 cat > $TMPC << EOF
2413 main(void) { asm (".align 3"); }
2415 cc_check && _asmalign_pot=yes
2417 if test "$_asmalign_pot" = "yes" ; then
2418 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2419 else
2420 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2422 echores $_asmalign_pot
2425 #FIXME: This should happen before the check for CFLAGS..
2426 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2428 # check if AltiVec is supported by the compiler, and how to enable it
2429 echocheck "GCC AltiVec flags"
2430 cat > $TMPC << EOF
2431 int main(void) { return 0; }
2433 if $(cc_check -maltivec -mabi=altivec) ; then
2434 _altivec_gcc_flags="-maltivec -mabi=altivec"
2435 # check if <altivec.h> should be included
2436 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2437 cat > $TMPC << EOF
2438 #include <altivec.h>
2439 int main(void) { return 0; }
2441 if $(cc_check $_altivec_gcc_flags) ; then
2442 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2443 inc_altivec_h='#include <altivec.h>'
2444 else
2445 cat > $TMPC << EOF
2446 int main(void) { return 0; }
2448 if $(cc_check -faltivec) ; then
2449 _altivec_gcc_flags="-faltivec"
2450 else
2451 _altivec=no
2452 _altivec_gcc_flags="none, AltiVec disabled"
2456 echores "$_altivec_gcc_flags"
2458 # check if the compiler supports braces for vector declarations
2459 cat > $TMPC << EOF
2460 $inc_altivec_h
2461 #define AVV(x...) {x}
2462 int main (void) { (vector int) AVV(1); return 0; }
2464 cc_check $_altivec_gcc_flags &&
2465 _def_altivec_vector_braces='#define HAVE_ALTIVEC_VECTOR_BRACES 1'
2467 # Disable runtime cpudetection if we cannot generate AltiVec code or
2468 # AltiVec is disabled by the user.
2469 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2470 && _runtime_cpudetection=no
2472 # Show that we are optimizing for AltiVec (if enabled and supported).
2473 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2474 && _optimizing="$_optimizing altivec"
2476 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2477 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2480 if arm ; then
2481 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2482 if test $_armv5te = "auto" ; then
2483 cat > $TMPC << EOF
2484 int main(void) { __asm__ __volatile__ ("qadd r0, r0, r0"); }
2486 _armv5te=no
2487 cc_check && _armv5te=yes
2489 echores "$_armv5te"
2491 echocheck "ARMv6 (SIMD instructions)"
2492 if test $_armv6 = "auto" ; then
2493 cat > $TMPC << EOF
2494 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2496 _armv6=no
2497 cc_check && _armv6=yes
2499 echores "$_armv6"
2501 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2502 if test $_iwmmxt = "auto" ; then
2503 cat > $TMPC << EOF
2504 int main(void) { __asm__ __volatile__ ("wunpckelub wr6, wr4"); }
2506 _iwmmxt=no
2507 cc_check && _iwmmxt=yes
2509 echores "$_iwmmxt"
2512 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
2513 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2514 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2515 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2516 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2517 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2518 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2519 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2520 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2521 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2522 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2523 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2524 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2525 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2526 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2527 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2529 # Checking kernel version...
2530 if x86_32 && linux ; then
2531 _k_verc_problem=no
2532 kernel_version=`uname -r 2>&1`
2533 echocheck "$system_name kernel version"
2534 case "$kernel_version" in
2535 '') kernel_version="?.??"; _k_verc_fail=yes;;
2536 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2537 _k_verc_problem=yes;;
2538 esac
2539 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2540 _k_verc_fail=yes
2542 if test "$_k_verc_fail" ; then
2543 echores "$kernel_version, fail"
2544 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2545 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2546 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2547 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2548 echo "2.2.x you must upgrade it to get SSE support!"
2549 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2550 else
2551 echores "$kernel_version, ok"
2555 ######################
2556 # MAIN TESTS GO HERE #
2557 ######################
2560 echocheck "-lposix"
2561 cat > $TMPC <<EOF
2562 int main(void) { return 0; }
2564 if cc_check -lposix ; then
2565 _ld_extra="$_ld_extra -lposix"
2566 echores "yes"
2567 else
2568 echores "no"
2571 echocheck "-lm"
2572 cat > $TMPC <<EOF
2573 int main(void) { return 0; }
2575 if cc_check -lm ; then
2576 _ld_lm="-lm"
2577 echores "yes"
2578 else
2579 _ld_lm=""
2580 echores "no"
2584 echocheck "langinfo"
2585 if test "$_langinfo" = auto ; then
2586 cat > $TMPC <<EOF
2587 #include <langinfo.h>
2588 int main(void) { nl_langinfo(CODESET); return 0; }
2590 _langinfo=no
2591 cc_check && _langinfo=yes
2593 if test "$_langinfo" = yes ; then
2594 _def_langinfo='#define USE_LANGINFO 1'
2595 else
2596 _def_langinfo='#undef USE_LANGINFO'
2598 echores "$_langinfo"
2601 echocheck "language"
2602 test -z "$_language" && _language=$LINGUAS
2603 _language=`echo $_language | sed 's/,/ /g'`
2604 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2605 for lang in $_language ; do
2606 test "$lang" = all && lang=en
2607 if test -f "help/help_mp-${lang}.h" ; then
2608 _language=$lang
2609 break
2610 else
2611 echo ${_echo_n} "$lang not found, ${_echo_c}"
2612 _language=`echo $_language | sed "s/$lang *//"`
2614 done
2615 test -z "$_language" && _language=en
2616 _mp_help="help/help_mp-${_language}.h"
2617 test -f $_mp_help || die "$_mp_help not found"
2618 for lang in $LANGUAGES ; do
2619 if test -f "DOCS/man/$lang/mplayer.1" ; then
2620 MAN_LANG_ALL="$lang $MAN_LANG_ALL"
2622 done
2623 MAN_LANG="$(echo $MAN_LANG_ALL | sed 's/en//')"
2624 _doc_lang=$_language
2625 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2626 echores "using $_language (man pages: $MAN_LANG_ALL)"
2629 echocheck "enable sighandler"
2630 if test "$_sighandler" = yes ; then
2631 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2632 else
2633 _def_sighandler='#undef ENABLE_SIGHANDLER'
2635 echores "$_sighandler"
2637 echocheck "runtime cpudetection"
2638 if test "$_runtime_cpudetection" = yes ; then
2639 _optimizing="Runtime CPU-Detection enabled"
2640 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2641 else
2642 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2644 echores "$_runtime_cpudetection"
2647 echocheck "restrict keyword"
2648 for restrict_keyword in restrict __restrict __restrict__ ; do
2649 echo "void foo(char * $restrict_keyword p); int main(void) {}" > $TMPC
2650 if cc_check; then
2651 _def_restrict_keyword=$restrict_keyword
2652 break;
2654 done
2655 if [ -n "$_def_restrict_keyword" ]; then
2656 echores "$_def_restrict_keyword"
2657 else
2658 echores "none"
2660 # Avoid infinite recursion loop ("#define restrict restrict")
2661 if [ "$_def_restrict_keyword" != "restrict" ]; then
2662 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2663 else
2664 _def_restrict_keyword=""
2668 echocheck "__builtin_expect"
2669 # GCC branch prediction hint
2670 cat > $TMPC << EOF
2671 int foo (int a) {
2672 a = __builtin_expect (a, 10);
2673 return a == 10 ? 0 : 1;
2675 int main(void) { return foo(10) && foo(0); }
2677 _builtin_expect=no
2678 cc_check && _builtin_expect=yes
2679 if test "$_builtin_expect" = yes ; then
2680 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2681 else
2682 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2684 echores "$_builtin_expect"
2687 echocheck "kstat"
2688 cat > $TMPC << EOF
2689 #include <kstat.h>
2690 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2692 _kstat=no
2693 cc_check -lkstat && _kstat=yes
2694 if test "$_kstat" = yes ; then
2695 _def_kstat="#define HAVE_LIBKSTAT 1"
2696 _ld_extra="$_ld_extra -lkstat"
2697 else
2698 _def_kstat="#undef HAVE_LIBKSTAT"
2700 echores "$_kstat"
2703 echocheck "posix4"
2704 # required for nanosleep on some systems
2705 cat > $TMPC << EOF
2706 #include <time.h>
2707 int main(void) { (void) nanosleep(0, 0); return 0; }
2709 _posix4=no
2710 cc_check -lposix4 && _posix4=yes
2711 if test "$_posix4" = yes ; then
2712 _ld_extra="$_ld_extra -lposix4"
2714 echores "$_posix4"
2716 for func in llrint lrint lrintf round roundf; do
2717 echocheck $func
2718 cat > $TMPC << EOF
2719 #include <math.h>
2720 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
2722 eval _$func=no
2723 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2724 if eval test "x\$_$func" = "xyes"; then
2725 eval _def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 1\""
2726 echores yes
2727 else
2728 eval _def_$func="\"#undef HAVE_`echo $func | tr '[a-z]' '[A-Z]'`\""
2729 echores no
2731 done
2734 echocheck "mkstemp"
2735 cat > $TMPC << EOF
2736 #include <stdlib.h>
2737 int main(void) { char a; mkstemp(&a); return 0; }
2739 _mkstemp=no
2740 cc_check && _mkstemp=yes
2741 if test "$_mkstemp" = yes ; then
2742 _def_mkstemp='#define HAVE_MKSTEMP 1'
2743 else
2744 _def_mkstemp='#undef HAVE_MKSTEMP'
2746 echores "$_mkstemp"
2749 echocheck "nanosleep"
2750 # also check for nanosleep
2751 cat > $TMPC << EOF
2752 #include <time.h>
2753 int main(void) { (void) nanosleep(0, 0); return 0; }
2755 _nanosleep=no
2756 cc_check && _nanosleep=yes
2757 if test "$_nanosleep" = yes ; then
2758 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2759 else
2760 _def_nanosleep='#undef HAVE_NANOSLEEP'
2762 echores "$_nanosleep"
2765 echocheck "socklib"
2766 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2767 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2768 cat > $TMPC << EOF
2769 #include <netdb.h>
2770 #include <sys/socket.h>
2771 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2773 _socklib=no
2774 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2775 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2776 done
2777 if test $_winsock2 = auto && ! cygwin ; then
2778 _winsock2=no
2779 cat > $TMPC << EOF
2780 #include <winsock2.h>
2781 int main(void) { (void) gethostbyname(0); return 0; }
2783 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2785 test "$_ld_sock" && _res_comment="using $_ld_sock"
2786 echores "$_socklib"
2789 if test $_winsock2 = yes ; then
2790 _ld_sock="-lws2_32"
2791 _def_winsock2='#define HAVE_WINSOCK2 1'
2792 else
2793 _def_winsock2='#undef HAVE_WINSOCK2'
2797 _use_aton=no
2798 echocheck "inet_pton()"
2799 cat > $TMPC << EOF
2800 #include <sys/types.h>
2801 #include <sys/socket.h>
2802 #include <arpa/inet.h>
2803 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2805 if test "$_winsock2" = yes ; then
2806 _res_comment="using winsock2 functions instead"
2807 echores "no"
2808 elif cc_check $_ld_sock ; then
2809 # NOTE: Linux has libresolv but does not need it
2811 _res_comment="using $_ld_sock"
2812 echores "yes"
2813 elif cc_check $_ld_sock -lresolv ; then
2814 # NOTE: needed for SunOS at least
2815 _ld_sock="$_ld_sock -lresolv"
2816 _res_comment="using $_ld_sock"
2817 echores "yes"
2818 else
2819 _res_comment="trying inet_aton next"
2820 echores "no"
2822 echocheck "inet_aton()"
2823 cat > $TMPC << EOF
2824 #include <sys/types.h>
2825 #include <sys/socket.h>
2826 #include <arpa/inet.h>
2827 int main(void) { (void) inet_aton(0, 0); return 0; }
2829 _use_aton=yes
2830 if cc_check $_ld_sock ; then
2831 # NOTE: Linux has libresolv but does not need it
2833 _res_comment="using $_ld_sock"
2834 elif cc_check $_ld_sock -lresolv ; then
2835 # NOTE: needed for SunOS at least
2836 _ld_sock="$_ld_sock -lresolv"
2837 _res_comment="using $_ld_sock"
2838 else
2839 _use_aton=no
2840 _network=no
2841 _res_comment="network support disabled"
2843 echores "$_use_aton"
2846 _def_use_aton='#undef USE_ATON'
2847 if test "$_use_aton" = yes; then
2848 _def_use_aton='#define USE_ATON 1'
2851 echocheck "network"
2852 # FIXME network check
2853 if test "$_network" = yes ; then
2854 _def_network='#define MPLAYER_NETWORK 1'
2855 _ld_extra="$_ld_extra $_ld_sock"
2856 _inputmodules="network $_inputmodules"
2857 else
2858 _noinputmodules="network $_noinputmodules"
2859 _def_network='#undef MPLAYER_NETWORK'
2860 _ftp=no
2862 echores "$_network"
2864 echocheck "inttypes.h (required)"
2865 cat > $TMPC << EOF
2866 #include <inttypes.h>
2867 int main(void) { return 0; }
2869 _inttypes=no
2870 cc_check && _inttypes=yes
2871 echores "$_inttypes"
2873 if test "$_inttypes" = no ; then
2874 echocheck "bitypes.h (inttypes.h predecessor)"
2875 cat > $TMPC << EOF
2876 #include <sys/bitypes.h>
2877 int main(void) { return 0; }
2879 cc_check && _inttypes=yes
2880 if test "$_inttypes" = yes ; then
2881 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."
2882 else
2883 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2888 echocheck "int_fastXY_t in inttypes.h"
2889 cat > $TMPC << EOF
2890 #include <inttypes.h>
2891 int main(void) {
2892 volatile int_fast16_t v= 0;
2893 return v; }
2895 _fast_inttypes=no
2896 cc_check && _fast_inttypes=yes
2897 if test "$_fast_inttypes" = no ; then
2898 _def_fast_inttypes='
2899 typedef signed char int_fast8_t;
2900 typedef signed int int_fast16_t;
2901 typedef signed int int_fast32_t;
2902 typedef signed long long int_fast64_t;
2903 typedef unsigned char uint_fast8_t;
2904 typedef unsigned int uint_fast16_t;
2905 typedef unsigned int uint_fast32_t;
2906 typedef unsigned long long uint_fast64_t;'
2908 echores "$_fast_inttypes"
2911 echocheck "word size"
2912 _mp_wordsize="#undef MP_WORDSIZE"
2913 cat > $TMPC << EOF
2914 #include <stdio.h>
2915 #include <sys/types.h>
2916 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2918 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2919 echores "$_wordsize"
2922 echocheck "malloc.h"
2923 cat > $TMPC << EOF
2924 #include <malloc.h>
2925 int main(void) { (void) malloc(0); return 0; }
2927 _malloc=no
2928 cc_check && _malloc=yes
2929 if test "$_malloc" = yes ; then
2930 _def_malloc='#define HAVE_MALLOC_H 1'
2931 else
2932 _def_malloc='#undef HAVE_MALLOC_H'
2934 # malloc.h emits a warning in FreeBSD and OpenBSD
2935 freebsd || openbsd || dragonfly && _def_malloc='#undef HAVE_MALLOC_H'
2936 echores "$_malloc"
2939 echocheck "memalign()"
2940 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2941 cat > $TMPC << EOF
2942 #include <malloc.h>
2943 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
2945 _memalign=no
2946 cc_check && _memalign=yes
2947 if test "$_memalign" = yes ; then
2948 _def_memalign='#define HAVE_MEMALIGN 1'
2949 else
2950 _def_memalign='#undef HAVE_MEMALIGN'
2951 _def_map_memalign='#define memalign(a,b) malloc(b)'
2952 darwin || _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2954 echores "$_memalign"
2957 echocheck "alloca.h"
2958 cat > $TMPC << EOF
2959 #include <alloca.h>
2960 int main(void) { (void) alloca(0); return 0; }
2962 _alloca=no
2963 cc_check && _alloca=yes
2964 if cc_check ; then
2965 _def_alloca='#define HAVE_ALLOCA_H 1'
2966 else
2967 _def_alloca='#undef HAVE_ALLOCA_H'
2969 echores "$_alloca"
2972 echocheck "byteswap.h"
2973 cat > $TMPC << EOF
2974 #include <byteswap.h>
2975 int main(void) { bswap_16(0); return 0; }
2977 _byteswap_h=no
2978 cc_check && _byteswap_h=yes
2979 if cc_check ; then
2980 _def_byteswap_h='#define HAVE_BYTESWAP_H 1'
2981 else
2982 _def_byteswap_h='#undef HAVE_BYTESWAP_H'
2984 echores "$_byteswap_h"
2987 echocheck "mman.h"
2988 cat > $TMPC << EOF
2989 #include <sys/types.h>
2990 #include <sys/mman.h>
2991 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2993 _mman=no
2994 cc_check && _mman=yes
2995 if test "$_mman" = yes ; then
2996 _def_mman='#define HAVE_SYS_MMAN_H 1'
2997 else
2998 _def_mman='#undef HAVE_SYS_MMAN_H'
2999 os2 && _need_mmap=yes
3001 echores "$_mman"
3003 cat > $TMPC << EOF
3004 #include <sys/types.h>
3005 #include <sys/mman.h>
3006 int main(void) { void *p = MAP_FAILED; return 0; }
3008 _mman_has_map_failed=no
3009 cc_check && _mman_has_map_failed=yes
3010 if test "$_mman_has_map_failed" = yes ; then
3011 _def_mman_has_map_failed=''
3012 else
3013 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3016 echocheck "dynamic loader"
3017 cat > $TMPC << EOF
3018 #include <dlfcn.h>
3019 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3021 _dl=no
3022 for _ld_tmp in "" "-ldl" ; do
3023 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3024 done
3025 if test "$_dl" = yes ; then
3026 _def_dl='#define HAVE_LIBDL 1'
3027 else
3028 _def_dl='#undef HAVE_LIBDL'
3030 echores "$_dl"
3033 echocheck "dynamic a/v plugins support"
3034 if test "$_dl" = no ; then
3035 _dynamic_plugins=no
3037 if test "$_dynamic_plugins" = yes ; then
3038 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3039 else
3040 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3042 echores "$_dynamic_plugins"
3045 _def_threads='#undef HAVE_THREADS'
3047 echocheck "pthread"
3048 if test "$_pthreads" = auto ; then
3049 cat > $TMPC << EOF
3050 #include <pthread.h>
3051 void* func(void *arg) { return arg; }
3052 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3054 _pthreads=no
3055 if ! hpux ; then
3056 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3057 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3058 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3059 done
3062 if test "$_pthreads" = yes ; then
3063 _res_comment="using $_ld_pthread"
3064 _def_pthreads='#define HAVE_PTHREADS 1'
3065 _def_threads='#define HAVE_THREADS 1'
3066 else
3067 _res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3068 _def_pthreads='#undef HAVE_PTHREADS'
3069 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3070 mingw32 || _win32dll=no
3072 echores "$_pthreads"
3074 echocheck "w32threads"
3075 if test "$_pthreads" = yes ; then
3076 _res_comment="using pthread instead"
3077 _w32threads=no
3079 if test "$_w32threads" = auto ; then
3080 _w32threads=no
3081 mingw32 && _w32threads=yes
3083 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3084 echores "$_w32threads"
3086 echocheck "rpath"
3087 netbsd &&_rpath=yes
3088 if test "$_rpath" = yes ; then
3089 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3090 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3091 done
3092 _ld_extra=$tmp
3094 echores "$_rpath"
3096 echocheck "iconv"
3097 if test "$_iconv" = auto ; then
3098 cat > $TMPC << EOF
3099 #include <stdio.h>
3100 #include <unistd.h>
3101 #include <iconv.h>
3102 #define INBUFSIZE 1024
3103 #define OUTBUFSIZE 4096
3105 char inbuffer[INBUFSIZE];
3106 char outbuffer[OUTBUFSIZE];
3108 int main(void) {
3109 size_t numread;
3110 iconv_t icdsc;
3111 char *tocode="UTF-8";
3112 char *fromcode="cp1250";
3113 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3114 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3115 char *iptr=inbuffer;
3116 char *optr=outbuffer;
3117 size_t inleft=numread;
3118 size_t outleft=OUTBUFSIZE;
3119 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3120 != (size_t)(-1)) {
3121 write (1, outbuffer, OUTBUFSIZE - outleft);
3124 if (iconv_close(icdsc) == -1)
3129 _iconv=no
3130 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3131 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3132 _iconv=yes && break
3133 done
3135 if test "$_iconv" = yes ; then
3136 _def_iconv='#define USE_ICONV 1'
3137 else
3138 _def_iconv='#undef USE_ICONV'
3140 echores "$_iconv"
3143 echocheck "soundcard.h"
3144 _soundcard_h=no
3145 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3146 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3147 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3148 cat > $TMPC << EOF
3149 #include <$_soundcard_header>
3150 int main(void) { return 0; }
3152 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3153 done
3155 if test "$_soundcard_h" = yes ; then
3156 if test $_soundcard_header = "sys/soundcard.h"; then
3157 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3158 else
3159 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3162 echores "$_soundcard_h"
3165 echocheck "sys/dvdio.h"
3166 cat > $TMPC << EOF
3167 #include <unistd.h>
3168 #include <sys/dvdio.h>
3169 int main(void) { return 0; }
3171 _dvdio=no
3172 cc_check && _dvdio=yes
3173 if test "$_dvdio" = yes ; then
3174 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3175 else
3176 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3178 echores "$_dvdio"
3181 echocheck "sys/cdio.h"
3182 cat > $TMPC << EOF
3183 #include <unistd.h>
3184 #include <sys/cdio.h>
3185 int main(void) { return 0; }
3187 _cdio=no
3188 cc_check && _cdio=yes
3189 if test "$_cdio" = yes ; then
3190 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3191 else
3192 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3194 echores "$_cdio"
3197 echocheck "linux/cdrom.h"
3198 cat > $TMPC << EOF
3199 #include <sys/types.h>
3200 #include <linux/cdrom.h>
3201 int main(void) { return 0; }
3203 _cdrom=no
3204 cc_check && _cdrom=yes
3205 if test "$_cdrom" = yes ; then
3206 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3207 else
3208 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3210 echores "$_cdrom"
3213 echocheck "dvd.h"
3214 cat > $TMPC << EOF
3215 #include <dvd.h>
3216 int main(void) { return 0; }
3218 _dvd=no
3219 cc_check && _dvd=yes
3220 if test "$_dvd" = yes ; then
3221 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3222 else
3223 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3225 echores "$_dvd"
3228 if bsdos; then
3229 echocheck "BSDI dvd.h"
3230 cat > $TMPC << EOF
3231 #include <dvd.h>
3232 int main(void) { return 0; }
3234 _bsdi_dvd=no
3235 cc_check && _bsdi_dvd=yes
3236 if test "$_bsdi_dvd" = yes ; then
3237 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3238 else
3239 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3241 echores "$_bsdi_dvd"
3242 fi #if bsdos
3245 if hpux; then
3246 # also used by AIX, but AIX does not support VCD and/or libdvdread
3247 echocheck "HP-UX SCSI header"
3248 cat > $TMPC << EOF
3249 #include <sys/scsi.h>
3250 int main(void) { return 0; }
3252 _hpux_scsi_h=no
3253 cc_check && _hpux_scsi_h=yes
3254 if test "$_hpux_scsi_h" = yes ; then
3255 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3256 else
3257 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3259 echores "$_hpux_scsi_h"
3260 fi #if hpux
3263 if sunos; then
3264 echocheck "userspace SCSI headers (Solaris)"
3265 cat > $TMPC << EOF
3266 #include <unistd.h>
3267 #include <stropts.h>
3268 #include <sys/scsi/scsi_types.h>
3269 #include <sys/scsi/impl/uscsi.h>
3270 int main(void) { return 0; }
3272 _sol_scsi_h=no
3273 cc_check && _sol_scsi_h=yes
3274 if test "$_sol_scsi_h" = yes ; then
3275 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3276 else
3277 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3279 echores "$_sol_scsi_h"
3280 fi #if sunos
3283 echocheck "termcap"
3284 if test "$_termcap" = auto ; then
3285 cat > $TMPC <<EOF
3286 int main(void) { tgetent(); return 0; }
3288 _termcap=no
3289 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3290 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3291 && _termcap=yes && break
3292 done
3294 if test "$_termcap" = yes ; then
3295 _def_termcap='#define USE_TERMCAP 1'
3296 _res_comment="using $_ld_tmp"
3297 else
3298 _def_termcap='#undef USE_TERMCAP'
3300 echores "$_termcap"
3303 echocheck "termios"
3304 _def_termios='#undef HAVE_TERMIOS'
3305 _def_termios_h='#undef HAVE_TERMIOS_H'
3306 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3307 if test "$_termios" = auto ; then
3308 _termios=no
3309 for _termios_header in "sys/termios.h" "termios.h"; do
3310 cat > $TMPC <<EOF
3311 #include <$_termios_header>
3312 int main(void) { return 0; }
3314 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3315 done
3318 if test "$_termios" = yes ; then
3319 _def_termios='#define HAVE_TERMIOS 1'
3320 if test "$_termios_header" = "termios.h" ; then
3321 _def_termios_h='#define HAVE_TERMIOS_H 1'
3322 else
3323 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3326 echores "$_termios"
3329 echocheck "shm"
3330 if test "$_shm" = auto ; then
3331 cat > $TMPC << EOF
3332 #include <sys/types.h>
3333 #include <sys/shm.h>
3334 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3336 _shm=no
3337 cc_check && _shm=yes
3339 if test "$_shm" = yes ; then
3340 _def_shm='#define HAVE_SHM 1'
3341 else
3342 _def_shm='#undef HAVE_SHM'
3344 echores "$_shm"
3347 echocheck "strsep()"
3348 cat > $TMPC << EOF
3349 #include <string.h>
3350 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3352 _strsep=no
3353 cc_check && _strsep=yes
3354 if test "$_strsep" = yes ; then
3355 _def_strsep='#define HAVE_STRSEP 1'
3356 _need_strsep=no
3357 else
3358 _def_strsep='#undef HAVE_STRSEP'
3359 _need_strsep=yes
3361 echores "$_strsep"
3364 echocheck "vsscanf()"
3365 cat > $TMPC << EOF
3366 #include <stdarg.h>
3367 int main(void) { vsscanf(0, 0, 0); return 0; }
3369 _vsscanf=no
3370 cc_check && _vsscanf=yes
3371 if test "$_vsscanf" = yes ; then
3372 _def_vsscanf='#define HAVE_VSSCANF 1'
3373 _need_vsscanf=no
3374 else
3375 _def_vsscanf='#undef HAVE_VSSCANF'
3376 _need_vsscanf=yes
3378 echores "$_vsscanf"
3381 echocheck "swab()"
3382 cat > $TMPC << EOF
3383 #include <unistd.h>
3384 int main(void) { swab(0, 0, 0); return 0; }
3386 _swab=no
3387 cc_check && _swab=yes
3388 if test "$_swab" = yes ; then
3389 _def_swab='#define HAVE_SWAB 1'
3390 _need_swab=no
3391 else
3392 _def_swab='#undef HAVE_SWAB'
3393 _need_swab=yes
3395 echores "$_swab"
3397 echocheck "POSIX select()"
3398 cat > $TMPC << EOF
3399 #include <stdio.h>
3400 #include <stdlib.h>
3401 #include <sys/types.h>
3402 #include <string.h>
3403 #include <sys/time.h>
3404 #include <unistd.h>
3405 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3407 _posix_select=no
3408 _def_posix_select='#undef HAVE_POSIX_SELECT'
3409 #select() of kLIBC (OS/2) supports socket only
3410 ! os2 && cc_check && _posix_select=yes \
3411 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3412 echores "$_posix_select"
3415 echocheck "gettimeofday()"
3416 cat > $TMPC << EOF
3417 #include <stdio.h>
3418 #include <sys/time.h>
3419 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3421 _gettimeofday=no
3422 cc_check && _gettimeofday=yes
3423 if test "$_gettimeofday" = yes ; then
3424 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3425 _need_gettimeofday=no
3426 else
3427 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3428 _need_gettimeofday=yes
3430 echores "$_gettimeofday"
3433 echocheck "glob()"
3434 cat > $TMPC << EOF
3435 #include <stdio.h>
3436 #include <glob.h>
3437 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3439 _glob=no
3440 cc_check && _glob=yes
3441 if test "$_glob" = yes ; then
3442 _def_glob='#define HAVE_GLOB 1'
3443 _need_glob=no
3444 else
3445 _def_glob='#undef HAVE_GLOB'
3446 _need_glob=yes
3448 echores "$_glob"
3451 echocheck "setenv()"
3452 cat > $TMPC << EOF
3453 #include <stdlib.h>
3454 int main(void) { setenv("","",0); return 0; }
3456 _setenv=no
3457 cc_check && _setenv=yes
3458 if test "$_setenv" = yes ; then
3459 _def_setenv='#define HAVE_SETENV 1'
3460 _need_setenv=no
3461 else
3462 _def_setenv='#undef HAVE_SETENV'
3463 _need_setenv=yes
3465 echores "$_setenv"
3468 if sunos; then
3469 echocheck "sysi86()"
3470 cat > $TMPC << EOF
3471 #include <sys/sysi86.h>
3472 int main(void) { sysi86(0); return 0; }
3474 _sysi86=no
3475 cc_check && _sysi86=yes
3476 if test "$_sysi86" = yes ; then
3477 _def_sysi86='#define HAVE_SYSI86 1'
3478 cat > $TMPC << EOF
3479 #include <sys/sysi86.h>
3480 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3482 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3483 else
3484 _def_sysi86='#undef HAVE_SYSI86'
3486 echores "$_sysi86"
3487 fi #if sunos
3490 echocheck "sys/sysinfo.h"
3491 cat > $TMPC << EOF
3492 #include <sys/sysinfo.h>
3493 int main(void) {
3494 struct sysinfo s_info;
3495 sysinfo(&s_info);
3496 return 0;
3499 _sys_sysinfo=no
3500 cc_check && _sys_sysinfo=yes
3501 if test "$_sys_sysinfo" = yes ; then
3502 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3503 else
3504 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3506 echores "$_sys_sysinfo"
3509 if darwin; then
3511 echocheck "Mac OS X APIs"
3512 if test "$_macosx" = auto ; then
3513 productName=`/usr/bin/sw_vers -productName`
3514 if test "$productName" = "Mac OS X" ||
3515 test "$productName" = "Mac OS X Server" ; then
3516 _macosx=yes
3517 else
3518 _macosx=no
3519 _noaomodules="macosx $_noaomodules"
3520 _novomodules="quartz $_novomodules"
3523 if test "$_macosx" = yes ; then
3524 cat > $TMPC <<EOF
3525 #include <Carbon/Carbon.h>
3526 #include <QuickTime/QuickTime.h>
3527 #include <CoreAudio/CoreAudio.h>
3528 int main(void) {
3529 EnterMovies();
3530 ExitMovies();
3531 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3534 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3535 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3536 _coreaudio=yes
3537 _def_coreaudio='#define HAVE_COREAUDIO 1'
3538 _aosrc="$_aosrc ao_macosx.c"
3539 _aomodules="macosx $_aomodules"
3540 _def_quartz='#define HAVE_QUARTZ 1'
3541 _vosrc="$_vosrc vo_quartz.c"
3542 _vomodules="quartz $_vomodules"
3543 _def_quicktime='#define HAVE_QUICKTIME 1'
3544 else
3545 _macosx=no
3546 _coreaudio=no
3547 _def_coreaudio='#undef HAVE_COREAUDIO'
3548 _noaomodules="macosx $_noaomodules"
3549 _def_quartz='#undef HAVE_QUARTZ'
3550 _novomodules="quartz $_novomodules"
3551 _def_quicktime='#undef HAVE_QUICKTIME'
3553 cat > $TMPC <<EOF
3554 #include <Carbon/Carbon.h>
3555 #include <QuartzCore/CoreVideo.h>
3556 int main(void) {}
3558 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3559 _vosrc="$_vosrc vo_macosx.m"
3560 _vomodules="macosx $_vomodules"
3561 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3562 _def_corevideo='#define HAVE_COREVIDEO 1'
3563 _corevideo=yes
3564 else
3565 _novomodules="macosx $_novomodules"
3566 _def_corevideo='#undef HAVE_COREVIDEO'
3567 _corevideo=no
3570 echores "$_macosx"
3572 echocheck "Mac OS X Finder Support"
3573 if test "$_macosx_finder_support" = auto ; then
3574 _macosx_finder_support=$_macosx
3576 if test "$_macosx_finder_support" = yes; then
3577 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3578 _macosx_finder_support=yes
3579 else
3580 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3581 _macosx_finder_support=no
3583 echores "$_macosx_finder_support"
3585 echocheck "Mac OS X Bundle file locations"
3586 if test "$_macosx_bundle" = auto ; then
3587 _macosx_bundle=$_macosx_finder_support
3589 if test "$_macosx_bundle" = yes; then
3590 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3591 else
3592 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3593 _macosx_bundle=no
3595 echores "$_macosx_bundle"
3597 echocheck "Apple Remote"
3598 if test "$_apple_remote" = auto ; then
3599 _apple_remote=no
3600 cat > $TMPC <<EOF
3601 #include <stdio.h>
3602 #include <IOKit/IOCFPlugIn.h>
3603 int main(void) {
3604 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3605 CFMutableDictionaryRef hidMatchDictionary;
3606 IOReturn ioReturnValue;
3608 // Set up a matching dictionary to search the I/O Registry by class.
3609 // name for all HID class devices
3610 hidMatchDictionary = IOServiceMatching("AppleIRController");
3612 // Now search I/O Registry for matching devices.
3613 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3614 hidMatchDictionary, &hidObjectIterator);
3616 // If search is unsuccessful, return nonzero.
3617 if (ioReturnValue != kIOReturnSuccess ||
3618 !IOIteratorIsValid(hidObjectIterator)) {
3619 return 1;
3621 return 0;
3624 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3626 if test "$_apple_remote" = yes ; then
3627 _def_apple_remote='#define HAVE_APPLE_REMOTE 1'
3628 _ld_extra="$_ld_extra -framework IOKit"
3629 else
3630 _def_apple_remote='#undef HAVE_APPLE_REMOTE'
3632 echores "$_apple_remote"
3634 fi #if darwin
3636 if linux; then
3638 echocheck "Apple IR"
3639 if test "$_apple_ir" = auto ; then
3640 _apple_ir=no
3641 cat > $TMPC <<EOF
3642 #include <linux/types.h>
3643 #include <linux/input.h>
3644 int main(void) {
3645 struct input_event ev;
3646 struct input_id id;
3647 return 0;
3650 cc_check && tmp_run && _apple_ir=yes
3652 if test "$_apple_ir" = yes ; then
3653 _def_apple_ir='#define HAVE_APPLE_IR 1'
3654 else
3655 _def_apple_ir='#undef HAVE_APPLE_IR'
3657 echores "$_apple_ir"
3658 fi #if linux
3660 echocheck "pkg-config"
3661 _pkg_config=pkg-config
3662 if `$_pkg_config --version > /dev/null 2>&1`; then
3663 if test "$_ld_static"; then
3664 _pkg_config="$_pkg_config --static"
3666 echores "yes"
3667 else
3668 _pkg_config=false
3669 echores "no"
3673 echocheck "Samba support (libsmbclient)"
3674 if test "$_smbsupport" = yes; then
3675 _ld_extra="$_ld_extra -lsmbclient"
3677 if test "$_smbsupport" = auto; then
3678 _smbsupport=no
3679 cat > $TMPC << EOF
3680 #include <libsmbclient.h>
3681 int main(void) { smbc_opendir("smb://"); return 0; }
3683 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3684 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3685 _smbsupport=yes && break
3686 done
3689 if test "$_smbsupport" = yes; then
3690 _def_smbsupport="#define LIBSMBCLIENT"
3691 _inputmodules="smb $_inputmodules"
3692 else
3693 _def_smbsupport="#undef LIBSMBCLIENT"
3694 _noinputmodules="smb $_noinputmodules"
3696 echores "$_smbsupport"
3699 #########
3700 # VIDEO #
3701 #########
3704 echocheck "tdfxfb"
3705 if test "$_tdfxfb" = yes ; then
3706 _def_tdfxfb='#define HAVE_TDFXFB 1'
3707 _vosrc="$_vosrc vo_tdfxfb.c"
3708 _vomodules="tdfxfb $_vomodules"
3709 else
3710 _def_tdfxfb='#undef HAVE_TDFXFB'
3711 _novomodules="tdfxfb $_novomodules"
3713 echores "$_tdfxfb"
3715 echocheck "s3fb"
3716 if test "$_s3fb" = yes ; then
3717 _def_s3fb='#define HAVE_S3FB 1'
3718 _vosrc="$_vosrc vo_s3fb.c"
3719 _vomodules="s3fb $_vomodules"
3720 else
3721 _def_s3fb='#undef HAVE_S3FB'
3722 _novomodules="s3fb $_novomodules"
3724 echores "$_s3fb"
3726 echocheck "tdfxvid"
3727 if test "$_tdfxvid" = yes ; then
3728 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3729 _vosrc="$_vosrc vo_tdfx_vid.c"
3730 _vomodules="tdfx_vid $_vomodules"
3731 else
3732 _def_tdfxvid='#undef HAVE_TDFX_VID'
3733 _novomodules="tdfx_vid $_novomodules"
3735 echores "$_tdfxvid"
3737 echocheck "xvr100"
3738 if test "$_xvr100" = auto ; then
3739 cat > $TMPC << EOF
3740 #include <unistd.h>
3741 #include <sys/fbio.h>
3742 #include <sys/visual_io.h>
3743 int main(void) {
3744 struct vis_identifier ident;
3745 struct fbgattr attr;
3746 ioctl(0, VIS_GETIDENTIFIER, &ident);
3747 ioctl(0, FBIOGATTR, &attr);
3750 _xvr100=no
3751 cc_check && _xvr100=yes
3753 if test "$_xvr100" = yes ; then
3754 _def_xvr100='#define HAVE_XVR100 1'
3755 _vosrc="$_vosrc vo_xvr100.c"
3756 _vomodules="xvr100 $_vomodules"
3757 else
3758 _def_tdfxvid='#undef HAVE_XVR100'
3759 _novomodules="xvr100 $_novomodules"
3761 echores "$_xvr100"
3763 echocheck "tga"
3764 if test "$_tga" = yes ; then
3765 _def_tga='#define HAVE_TGA 1'
3766 _vosrc="$_vosrc vo_tga.c"
3767 _vomodules="tga $_vomodules"
3768 else
3769 _def_tga='#undef HAVE_TGA'
3770 _novomodules="tga $_novomodules"
3772 echores "$_tga"
3775 echocheck "md5sum support"
3776 if test "$_md5sum" = yes; then
3777 _def_md5sum="#define HAVE_MD5SUM"
3778 _vosrc="$_vosrc vo_md5sum.c"
3779 _vomodules="md5sum $_vomodules"
3780 else
3781 _def_md5sum="#undef HAVE_MD5SUM"
3782 _novomodules="md5sum $_novomodules"
3784 echores "$_md5sum"
3787 echocheck "yuv4mpeg support"
3788 if test "$_yuv4mpeg" = yes; then
3789 _def_yuv4mpeg="#define HAVE_YUV4MPEG"
3790 _vosrc="$_vosrc vo_yuv4mpeg.c"
3791 _vomodules="yuv4mpeg $_vomodules"
3792 else
3793 _def_yuv4mpeg="#undef HAVE_YUV4MPEG"
3794 _novomodules="yuv4mpeg $_novomodules"
3796 echores "$_yuv4mpeg"
3799 echocheck "bl"
3800 if test "$_bl" = yes ; then
3801 _def_bl='#define HAVE_BL 1'
3802 _vosrc="$_vosrc vo_bl.c"
3803 _vomodules="bl $_vomodules"
3804 else
3805 _def_bl='#undef HAVE_BL'
3806 _novomodules="bl $_novomodules"
3808 echores "$_bl"
3811 echocheck "DirectFB"
3812 if test "$_directfb" = auto ; then
3813 _directfb=no
3814 cat > $TMPC <<EOF
3815 #include <directfb.h>
3816 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3818 for _inc_tmp in "" -I/usr/local/include/directfb \
3819 -I/usr/include/directfb -I/usr/local/include; do
3820 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3821 _inc_extra="$_inc_extra $_inc_tmp" && break
3822 done
3825 dfb_version() {
3826 expr $1 \* 65536 + $2 \* 256 + $3
3829 if test "$_directfb" = yes; then
3830 cat > $TMPC << EOF
3831 #include <directfb_version.h>
3833 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3836 if $_cc -E $TMPC $_inc_extra > "$TMPEXE"; then
3837 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'`
3838 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3839 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3840 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3841 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3842 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3843 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3844 _res_comment="$_directfb_version"
3845 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3846 else
3847 _def_directfb_version='#undef DIRECTFBVERSION'
3848 _directfb=no
3849 _res_comment="version >=0.9.13 required"
3851 else
3852 _directfb=no
3853 _res_comment="failed to get version"
3856 echores "$_directfb"
3858 if test "$_directfb" = yes ; then
3859 _def_directfb='#define HAVE_DIRECTFB 1'
3860 _vosrc="$_vosrc vo_directfb2.c"
3861 _vomodules="directfb $_vomodules"
3862 _libs_mplayer="$_libs_mplayer -ldirectfb"
3863 else
3864 _def_directfb='#undef HAVE_DIRECTFB'
3865 _novomodules="directfb $_novomodules"
3867 if test "$_dfbmga" = yes; then
3868 _vosrc="$_vosrc vo_dfbmga.c"
3869 _vomodules="dfbmga $_vomodules"
3870 _def_dfbmga='#define HAVE_DFBMGA 1'
3871 else
3872 _novomodules="dfbmga $_novomodules"
3873 _def_dfbmga='#undef HAVE_DFBMGA'
3877 echocheck "X11 headers presence"
3878 _x11_headers="no"
3879 _res_comment="check if the dev(el) packages are installed"
3880 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3881 if test -f "$I/X11/Xlib.h" ; then
3882 _x11_headers="yes"
3883 _res_comment=""
3884 break
3886 done
3887 if test $_cross_compile = no; then
3888 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3889 if test -f "$I/X11/Xlib.h" ; then
3890 _inc_extra="$_inc_extra -I$I"
3891 _x11_headers="yes"
3892 _res_comment="using $I"
3893 break
3895 done
3897 echores "$_x11_headers"
3900 echocheck "X11"
3901 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3902 cat > $TMPC <<EOF
3903 #include <X11/Xlib.h>
3904 #include <X11/Xutil.h>
3905 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3907 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3908 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3909 if netbsd; then
3910 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3911 else
3912 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3914 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3915 && _x11=yes && break
3916 done
3918 if test "$_x11" = yes ; then
3919 _def_x11='#define HAVE_X11 1'
3920 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3921 _vomodules="x11 xover $_vomodules"
3922 else
3923 _x11=no
3924 _def_x11='#undef HAVE_X11'
3925 _novomodules="x11 $_novomodules"
3926 _res_comment="check if the dev(el) packages are installed"
3927 # disable stuff that depends on X
3928 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
3930 echores "$_x11"
3932 echocheck "Xss screensaver extensions"
3933 if test "$_xss" = auto ; then
3934 cat > $TMPC << EOF
3935 #include <X11/Xlib.h>
3936 #include <X11/extensions/scrnsaver.h>
3937 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
3939 _xss=no
3940 cc_check -lXss && _xss=yes
3942 if test "$_xss" = yes ; then
3943 _def_xss='#define HAVE_XSS 1'
3944 _libs_mplayer="$_libs_mplayer -lXss"
3945 else
3946 _def_xss='#undef HAVE_XSS'
3948 echores "$_xss"
3950 echocheck "DPMS"
3951 _xdpms3=no
3952 _xdpms4=no
3953 if test "$_x11" = yes ; then
3954 cat > $TMPC <<EOF
3955 #include <X11/Xmd.h>
3956 #include <X11/Xlib.h>
3957 #include <X11/Xutil.h>
3958 #include <X11/Xatom.h>
3959 #include <X11/extensions/dpms.h>
3960 int main(void) { (void) DPMSQueryExtension(0, 0, 0); }
3962 cc_check -lXdpms && _xdpms3=yes
3963 cat > $TMPC <<EOF
3964 #include <X11/Xlib.h>
3965 #include <X11/extensions/dpms.h>
3966 int main(void) { (void) DPMSQueryExtension(0, 0, 0); }
3968 cc_check -lXext && _xdpms4=yes
3970 if test "$_xdpms4" = yes ; then
3971 _def_xdpms='#define HAVE_XDPMS 1'
3972 _res_comment="using Xdpms 4"
3973 echores "yes"
3974 elif test "$_xdpms3" = yes ; then
3975 _def_xdpms='#define HAVE_XDPMS 1'
3976 _libs_mplayer="$_libs_mplayer -lXdpms"
3977 _res_comment="using Xdpms 3"
3978 echores "yes"
3979 else
3980 _def_xdpms='#undef HAVE_XDPMS'
3981 echores "no"
3985 echocheck "Xv"
3986 if test "$_xv" = auto ; then
3987 cat > $TMPC <<EOF
3988 #include <X11/Xlib.h>
3989 #include <X11/extensions/Xvlib.h>
3990 int main(void) {
3991 (void) XvGetPortAttribute(0, 0, 0, 0);
3992 (void) XvQueryPortAttributes(0, 0, 0);
3993 return 0; }
3995 _xv=no
3996 cc_check -lXv && _xv=yes
3999 if test "$_xv" = yes ; then
4000 _def_xv='#define HAVE_XV 1'
4001 _libs_mplayer="$_libs_mplayer -lXv"
4002 _vosrc="$_vosrc vo_xv.c"
4003 _vomodules="xv $_vomodules"
4004 else
4005 _def_xv='#undef HAVE_XV'
4006 _novomodules="xv $_novomodules"
4008 echores "$_xv"
4011 echocheck "XvMC"
4012 if test "$_xv" = yes && test "$_xvmc" != no ; then
4013 _xvmc=no
4014 cat > $TMPC <<EOF
4015 #include <X11/Xlib.h>
4016 #include <X11/extensions/Xvlib.h>
4017 #include <X11/extensions/XvMClib.h>
4018 int main(void) {
4019 (void) XvMCQueryExtension(0,0,0);
4020 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4021 return 0; }
4023 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4024 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4025 done
4027 if test "$_xvmc" = yes ; then
4028 _def_xvmc='#define HAVE_XVMC 1'
4029 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
4030 _vosrc="$_vosrc vo_xvmc.c"
4031 _vomodules="xvmc $_vomodules"
4032 _res_comment="using $_xvmclib"
4033 else
4034 _def_xvmc='#undef HAVE_XVMC'
4035 _novomodules="xvmc $_novomodules"
4036 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4038 echores "$_xvmc"
4041 echocheck "Xinerama"
4042 if test "$_xinerama" = auto ; then
4043 cat > $TMPC <<EOF
4044 #include <X11/Xlib.h>
4045 #include <X11/extensions/Xinerama.h>
4046 int main(void) { (void) XineramaIsActive(0); return 0; }
4048 _xinerama=no
4049 cc_check -lXinerama && _xinerama=yes
4052 if test "$_xinerama" = yes ; then
4053 _def_xinerama='#define HAVE_XINERAMA 1'
4054 _libs_mplayer="$_libs_mplayer -lXinerama"
4055 else
4056 _def_xinerama='#undef HAVE_XINERAMA'
4058 echores "$_xinerama"
4061 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4062 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4063 # named 'X extensions' or something similar.
4064 # This check may be useful for future mplayer versions (to change resolution)
4065 # If you run into problems, remove '-lXxf86vm'.
4066 echocheck "Xxf86vm"
4067 if test "$_vm" = auto ; then
4068 cat > $TMPC <<EOF
4069 #include <X11/Xlib.h>
4070 #include <X11/extensions/xf86vmode.h>
4071 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4073 _vm=no
4074 cc_check -lXxf86vm && _vm=yes
4076 if test "$_vm" = yes ; then
4077 _def_vm='#define HAVE_XF86VM 1'
4078 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4079 else
4080 _def_vm='#undef HAVE_XF86VM'
4082 echores "$_vm"
4084 # Check for the presence of special keycodes, like audio control buttons
4085 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4086 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4087 # have these new keycodes.
4088 echocheck "XF86keysym"
4089 if test "$_xf86keysym" = auto; then
4090 _xf86keysym=no
4091 cat > $TMPC <<EOF
4092 #include <X11/Xlib.h>
4093 #include <X11/XF86keysym.h>
4094 int main(void) { return XF86XK_AudioPause; }
4096 cc_check && _xf86keysym=yes
4098 if test "$_xf86keysym" = yes ; then
4099 _def_xf86keysym='#define HAVE_XF86XK 1'
4100 else
4101 _def_xf86keysym='#undef HAVE_XF86XK'
4103 echores "$_xf86keysym"
4105 echocheck "DGA"
4106 if test "$_dga2" = auto && test "$_x11" = yes ; then
4107 cat > $TMPC << EOF
4108 #include <X11/Xlib.h>
4109 #include <X11/extensions/xf86dga.h>
4110 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4112 _dga2=no
4113 cc_check -lXxf86dga && _dga2=yes
4115 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4116 cat > $TMPC << EOF
4117 #include <X11/Xlib.h>
4118 #include <X11/extensions/xf86dga.h>
4119 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4121 _dga1=no
4122 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4125 _dga=no
4126 _def_dga='#undef HAVE_DGA'
4127 _def_dga1='#undef HAVE_DGA1'
4128 _def_dga2='#undef HAVE_DGA2'
4129 if test "$_dga1" = yes ; then
4130 _dga=yes
4131 _def_dga1='#define HAVE_DGA1 1'
4132 _res_comment="using DGA 1.0"
4133 elif test "$_dga2" = yes ; then
4134 _dga=yes
4135 _def_dga2='#define HAVE_DGA2 1'
4136 _res_comment="using DGA 2.0"
4138 if test "$_dga" = yes ; then
4139 _def_dga='#define HAVE_DGA 1'
4140 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4141 _vosrc="$_vosrc vo_dga.c"
4142 _vomodules="dga $_vomodules"
4143 else
4144 _novomodules="dga $_novomodules"
4146 echores "$_dga"
4149 echocheck "3dfx"
4150 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4151 _def_3dfx='#define HAVE_3DFX 1'
4152 _vosrc="$_vosrc vo_3dfx.c"
4153 _vomodules="3dfx $_vomodules"
4154 else
4155 _def_3dfx='#undef HAVE_3DFX'
4156 _novomodules="3dfx $_novomodules"
4158 echores "$_3dfx"
4161 echocheck "OpenGL"
4162 #Note: this test is run even with --enable-gl since we autodetect linker flags
4163 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4164 cat > $TMPC << EOF
4165 #include <GL/gl.h>
4166 #ifdef GL_WIN32
4167 #include <windows.h>
4168 #include <GL/glext.h>
4169 #else
4170 #include <X11/Xlib.h>
4171 #include <GL/glx.h>
4172 #endif
4173 int main(void) {
4174 #ifdef GL_WIN32
4175 HDC dc;
4176 wglCreateContext(dc);
4177 #else
4178 glXCreateContext(NULL, NULL, NULL, True);
4179 #endif
4180 glFinish();
4181 return 0;
4184 _gl=no
4185 if cc_check -lGL $_ld_lm ; then
4186 _gl=yes
4187 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4188 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4189 _gl=yes
4190 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4191 elif cc_check -DGL_WIN32 -lopengl32 ; then
4192 _gl=yes
4193 _gl_win32=yes
4194 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4196 else
4197 _gl=no
4199 if test "$_gl" = yes ; then
4200 _def_gl='#define HAVE_GL 1'
4201 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4202 if test "$_gl_win32" = yes ; then
4203 _def_gl_win32='#define GL_WIN32 1'
4204 _vosrc="$_vosrc w32_common.c"
4205 _res_comment="win32 version"
4207 _vomodules="opengl $_vomodules"
4208 else
4209 _def_gl='#undef HAVE_GL'
4210 _def_gl_win32='#undef GL_WIN32'
4211 _novomodules="opengl $_novomodules"
4213 echores "$_gl"
4216 echocheck "VIDIX"
4217 _def_vidix='#undef CONFIG_VIDIX'
4218 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4219 _vidix_drv_cyberblade=no
4220 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4221 _vidix_drv_ivtv=no
4222 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4223 _vidix_drv_ivtv=no
4224 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4225 _vidix_drv_mach64=no
4226 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4227 _vidix_drv_mga=no
4228 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4229 _vidix_drv_mga_crtc2=no
4230 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4231 _vidix_drv_nvidia=no
4232 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4233 _vidix_drv_pm2=no
4234 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4235 _vidix_drv_pm3=no
4236 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4237 _vidix_drv_radeon=no
4238 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4239 _vidix_drv_rage128=no
4240 _def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4241 _vidix_drv_s3=no
4242 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4243 _vidix_drv_sis=no
4244 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4245 _vidix_drv_unichrome=no
4246 if test "$_vidix" = auto ; then
4247 _vidix=no
4248 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4249 && _vidix=yes
4250 (ppc || alpha) && linux && _vidix=yes
4252 echores "$_vidix"
4254 if test "$_vidix" = yes ; then
4255 _def_vidix='#define CONFIG_VIDIX 1'
4256 _vosrc="$_vosrc vo_cvidix.c"
4257 _vomodules="cvidix $_vomodules"
4258 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sis unichrome"
4259 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4261 # some vidix drivers are meant to work on x86 only, discard them elsewhere
4262 x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//`
4264 for driver in $_vidix_drivers ; do
4265 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4266 eval _vidix_drv_${driver}=yes
4267 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4268 done
4270 echocheck "VIDIX PCI device name database"
4271 echores "$_vidix_pcidb"
4272 if test "$_vidix_pcidb" = yes ; then
4273 _vidix_pcidb_val=1
4274 else
4275 _vidix_pcidb_val=0
4278 echocheck "VIDIX dhahelper support"
4279 test "$_dhahelper" = yes && cflag_dhahelper=-DCONFIG_DHAHELPER
4280 echores "$_dhahelper"
4282 echocheck "VIDIX svgalib_helper support"
4283 test "$_svgalib_helper" = yes && cflag_svgalib_helper=-DCONFIG_SVGAHELPER
4284 echores "$_svgalib_helper"
4286 else
4287 _novomodules="cvidix $_novomodules"
4290 if test "$_vidix" = yes && win32; then
4291 _vosrc="$_vosrc vo_winvidix.c"
4292 _vomodules="winvidix $_vomodules"
4293 _libs_mplayer="$_libs_mplayer -lgdi32"
4294 else
4295 _novomodules="winvidix $_novomodules"
4297 if test "$_vidix" = yes && test "$_x11" = yes; then
4298 _vosrc="$_vosrc vo_xvidix.c"
4299 _vomodules="xvidix $_vomodules"
4300 else
4301 _novomodules="xvidix $_novomodules"
4304 echocheck "/dev/mga_vid"
4305 if test "$_mga" = auto ; then
4306 _mga=no
4307 test -c /dev/mga_vid && _mga=yes
4309 if test "$_mga" = yes ; then
4310 _def_mga='#define HAVE_MGA 1'
4311 _vosrc="$_vosrc vo_mga.c"
4312 _vomodules="mga $_vomodules"
4313 else
4314 _def_mga='#undef HAVE_MGA'
4315 _novomodules="mga $_novomodules"
4317 echores "$_mga"
4320 echocheck "xmga"
4321 if test "$_xmga" = auto ; then
4322 _xmga=no
4323 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4325 if test "$_xmga" = yes ; then
4326 _def_xmga='#define HAVE_XMGA 1'
4327 _vosrc="$_vosrc vo_xmga.c"
4328 _vomodules="xmga $_vomodules"
4329 else
4330 _def_xmga='#undef HAVE_XMGA'
4331 _novomodules="xmga $_novomodules"
4333 echores "$_xmga"
4336 echocheck "GGI"
4337 if test "$_ggi" = auto ; then
4338 cat > $TMPC << EOF
4339 #include <ggi/ggi.h>
4340 int main(void) { ggiInit(); return 0; }
4342 _ggi=no
4343 cc_check -lggi && _ggi=yes
4345 if test "$_ggi" = yes ; then
4346 _def_ggi='#define HAVE_GGI 1'
4347 _libs_mplayer="$_libs_mplayer -lggi"
4348 _vosrc="$_vosrc vo_ggi.c"
4349 _vomodules="ggi $_vomodules"
4350 else
4351 _def_ggi='#undef HAVE_GGI'
4352 _novomodules="ggi $_novomodules"
4354 echores "$_ggi"
4356 echocheck "GGI extension: libggiwmh"
4357 if test "$_ggiwmh" = auto ; then
4358 _ggiwmh=no
4359 cat > $TMPC << EOF
4360 #include <ggi/ggi.h>
4361 #include <ggi/wmh.h>
4362 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4364 cc_check -lggi -lggiwmh && _ggiwmh=yes
4366 # needed to get right output on obscure combination
4367 # like --disable-ggi --enable-ggiwmh
4368 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4369 _def_ggiwmh='#define HAVE_GGIWMH 1'
4370 _libs_mplayer="$_libs_mplayer -lggiwmh"
4371 else
4372 _ggiwmh=no
4373 _def_ggiwmh='#undef HAVE_GGIWMH'
4375 echores "$_ggiwmh"
4378 echocheck "AA"
4379 if test "$_aa" = auto ; then
4380 cat > $TMPC << EOF
4381 #include <aalib.h>
4382 extern struct aa_hardware_params aa_defparams;
4383 extern struct aa_renderparams aa_defrenderparams;
4384 int main(void) {
4385 aa_context *c;
4386 aa_renderparams *p;
4387 (void) aa_init(0, 0, 0);
4388 c = aa_autoinit(&aa_defparams);
4389 p = aa_getrenderparams();
4390 aa_autoinitkbd(c,0);
4391 return 0; }
4393 _aa=no
4394 for _ld_tmp in "-laa" ; do
4395 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4396 done
4398 if test "$_aa" = yes ; then
4399 _def_aa='#define HAVE_AA 1'
4400 if cygwin ; then
4401 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4403 _vosrc="$_vosrc vo_aa.c"
4404 _vomodules="aa $_vomodules"
4405 else
4406 _def_aa='#undef HAVE_AA'
4407 _novomodules="aa $_novomodules"
4409 echores "$_aa"
4412 echocheck "CACA"
4413 if test "$_caca" = auto ; then
4414 _caca=no
4415 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4416 cat > $TMPC << EOF
4417 #include <caca.h>
4418 #ifdef CACA_API_VERSION_1
4419 #include <caca0.h>
4420 #endif
4421 int main(void) { (void) caca_init(); return 0; }
4423 cc_check `caca-config --libs` && _caca=yes
4426 if test "$_caca" = yes ; then
4427 _def_caca='#define HAVE_CACA 1'
4428 _inc_extra="$_inc_extra `caca-config --cflags`"
4429 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4430 _vosrc="$_vosrc vo_caca.c"
4431 _vomodules="caca $_vomodules"
4432 else
4433 _def_caca='#undef HAVE_CACA'
4434 _novomodules="caca $_novomodules"
4436 echores "$_caca"
4439 echocheck "SVGAlib"
4440 if test "$_svga" = auto ; then
4441 cat > $TMPC << EOF
4442 #include <vga.h>
4443 int main(void) { return 0; }
4445 _svga=no
4446 cc_check -lvga $_ld_lm && _svga=yes
4448 if test "$_svga" = yes ; then
4449 _def_svga='#define HAVE_SVGALIB 1'
4450 _libs_mplayer="$_libs_mplayer -lvga"
4451 _vosrc="$_vosrc vo_svga.c"
4452 _vomodules="svga $_vomodules"
4453 else
4454 _def_svga='#undef HAVE_SVGALIB'
4455 _novomodules="svga $_novomodules"
4457 echores "$_svga"
4460 echocheck "FBDev"
4461 if test "$_fbdev" = auto ; then
4462 _fbdev=no
4463 linux && _fbdev=yes
4465 if test "$_fbdev" = yes ; then
4466 _def_fbdev='#define HAVE_FBDEV 1'
4467 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4468 _vomodules="fbdev $_vomodules"
4469 else
4470 _def_fbdev='#undef HAVE_FBDEV'
4471 _novomodules="fbdev $_novomodules"
4473 echores "$_fbdev"
4477 echocheck "DVB"
4478 if test "$_dvb" = auto ; then
4479 _dvb=no
4480 cat >$TMPC << EOF
4481 #include <sys/poll.h>
4482 #include <sys/ioctl.h>
4483 #include <stdio.h>
4484 #include <time.h>
4485 #include <unistd.h>
4486 #include <ost/dmx.h>
4487 #include <ost/frontend.h>
4488 #include <ost/sec.h>
4489 #include <ost/video.h>
4490 #include <ost/audio.h>
4491 int main(void) {return 0;}
4493 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4494 cc_check $_inc_tmp && _dvb=yes && \
4495 _inc_extra="$_inc_extra $_inc_tmp" && break
4496 done
4498 echores "$_dvb"
4499 if test "$_dvb" = yes ; then
4500 _def_dvb='#define HAVE_DVB 1'
4501 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4502 _aomodules="mpegpes(dvb) $_aomodules"
4503 _vomodules="mpegpes(dvb) $_vomodules"
4506 echocheck "DVB HEAD"
4507 if test "$_dvbhead" = auto ; then
4508 _dvbhead=no
4510 cat >$TMPC << EOF
4511 #include <sys/poll.h>
4512 #include <sys/ioctl.h>
4513 #include <stdio.h>
4514 #include <time.h>
4515 #include <unistd.h>
4516 #include <linux/dvb/dmx.h>
4517 #include <linux/dvb/frontend.h>
4518 #include <linux/dvb/video.h>
4519 #include <linux/dvb/audio.h>
4520 int main(void) {return 0;}
4522 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4523 cc_check $_inc_tmp && _dvbhead=yes && \
4524 _inc_extra="$_inc_extra $_inc_tmp" && break
4525 done
4527 echores "$_dvbhead"
4528 if test "$_dvbhead" = yes ; then
4529 _def_dvb='#define HAVE_DVB_HEAD 1'
4530 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4531 _aomodules="mpegpes(dvb) $_aomodules"
4532 _vomodules="mpegpes(dvb) $_vomodules"
4535 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4536 _def_dvb='#undef HAVE_DVB'
4537 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4538 _aomodules="mpegpes(file) $_aomodules"
4539 _vomodules="mpegpes(file) $_vomodules"
4542 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4543 _dvbin=yes
4544 _inputmodules="dvb $_inputmodules"
4545 else
4546 _dvbin=no
4547 _noinputmodules="dvb $_noinputmodules"
4553 echocheck "PNG support"
4554 if test "$_png" = auto ; then
4555 _png=no
4556 if irix ; then
4557 # Don't check for -lpng on irix since it has its own libpng
4558 # incompatible with the GNU libpng
4559 _res_comment="disabled on irix (not GNU libpng)"
4560 else
4561 cat > $TMPC << EOF
4562 #include <png.h>
4563 #include <string.h>
4564 int main(void) {
4565 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4566 printf("libpng: %s\n", png_libpng_ver);
4567 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4570 if cc_check -lpng -lz $_ld_lm ; then
4571 if tmp_run ; then
4572 _png=yes
4573 else
4574 _res_comment="mismatch of library and header versions"
4579 echores "$_png"
4580 if test "$_png" = yes ; then
4581 _def_png='#define HAVE_PNG 1'
4582 _ld_extra="$_ld_extra -lpng -lz"
4583 _vosrc="$_vosrc vo_png.c"
4584 _vomodules="png $_vomodules"
4585 else
4586 _def_png='#undef HAVE_PNG'
4587 _novomodules="png $_novomodules"
4590 echocheck "JPEG support"
4591 if test "$_jpeg" = auto ; then
4592 _jpeg=no
4593 cat > $TMPC << EOF
4594 #include <stdio.h>
4595 #include <stdlib.h>
4596 #include <setjmp.h>
4597 #include <string.h>
4598 #include <jpeglib.h>
4599 int main(void) { return 0; }
4601 if cc_check -ljpeg $_ld_lm ; then
4602 if tmp_run ; then
4603 _jpeg=yes
4607 echores "$_jpeg"
4609 if test "$_jpeg" = yes ; then
4610 _def_jpeg='#define HAVE_JPEG 1'
4611 _vosrc="$_vosrc vo_jpeg.c"
4612 _vomodules="jpeg $_vomodules"
4613 _ld_extra="$_ld_extra -ljpeg"
4614 else
4615 _def_jpeg='#undef HAVE_JPEG'
4616 _novomodules="jpeg $_novomodules"
4621 echocheck "PNM support"
4622 if test "$_pnm" = yes; then
4623 _def_pnm="#define HAVE_PNM"
4624 _vosrc="$_vosrc vo_pnm.c"
4625 _vomodules="pnm $_vomodules"
4626 else
4627 _def_pnm="#undef HAVE_PNM"
4628 _novomodules="pnm $_novomodules"
4630 echores "$_pnm"
4634 echocheck "GIF support"
4635 # This is to appease people who want to force gif support.
4636 # If it is forced to yes, then we still do checks to determine
4637 # which gif library to use.
4638 if test "$_gif" = yes ; then
4639 _force_gif=yes
4640 _gif=auto
4643 if test "$_gif" = auto ; then
4644 _gif=no
4645 cat > $TMPC << EOF
4646 #include <gif_lib.h>
4647 int main(void) { return 0; }
4649 for _ld_gif in "-lungif" "-lgif" ; do
4650 cc_check $_ld_gif && tmp_run && _gif=yes && break
4651 done
4654 # If no library was found, and the user wants support forced,
4655 # then we force it on with libgif, as this is the safest
4656 # assumption IMHO. (libungif & libregif both create symbolic
4657 # links to libgif. We also assume that no x11 support is needed,
4658 # because if you are forcing this, then you _should_ know what
4659 # you are doing. [ Besides, package maintainers should never
4660 # have compiled x11 deps into libungif in the first place. ] )
4661 # </rant>
4662 # --Joey
4663 if test "$_force_gif" = yes && test "$_gif" = no ; then
4664 _gif=yes
4665 _ld_gif="-lgif"
4668 if test "$_gif" = yes ; then
4669 _def_gif='#define HAVE_GIF 1'
4670 _vosrc="$_vosrc vo_gif89a.c"
4671 _codecmodules="gif $_codecmodules"
4672 _vomodules="gif89a $_vomodules"
4673 _res_comment="old version, some encoding functions disabled"
4674 _def_gif_4='#undef HAVE_GIF_4'
4675 _ld_extra="$_ld_extra $_ld_gif"
4677 cat > $TMPC << EOF
4678 #include <signal.h>
4679 #include <gif_lib.h>
4680 void catch() { exit(1); }
4681 int main(void) {
4682 signal(SIGSEGV, catch); // catch segfault
4683 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4684 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4685 return 0;
4688 if cc_check "$_ld_gif" && tmp_run ; then
4689 _def_gif_4='#define HAVE_GIF_4 1'
4690 _res_comment=""
4692 else
4693 _def_gif='#undef HAVE_GIF'
4694 _def_gif_4='#undef HAVE_GIF_4'
4695 _novomodules="gif89a $_novomodules"
4696 _nocodecmodules="gif $_nocodecmodules"
4698 echores "$_gif"
4701 case "$_gif" in yes*)
4702 echocheck "broken giflib workaround"
4703 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4705 cat > $TMPC << EOF
4706 #include <gif_lib.h>
4707 int main(void) {
4708 GifFileType gif;
4709 printf("UserData is at address %p\n", gif.UserData);
4710 return 0;
4713 if cc_check "$_ld_gif" && tmp_run ; then
4714 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4715 echores "disabled"
4716 else
4717 echores "enabled"
4720 esac
4723 echocheck "VESA support"
4724 if test "$_vesa" = auto ; then
4725 cat > $TMPC << EOF
4726 #include <vbe.h>
4727 int main(void) { vbeVersion(); return 0; }
4729 _vesa=no
4730 cc_check -lvbe -llrmi && _vesa=yes
4732 if test "$_vesa" = yes ; then
4733 _def_vesa='#define HAVE_VESA 1'
4734 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4735 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4736 _vomodules="vesa $_vomodules"
4737 else
4738 _def_vesa='#undef HAVE_VESA'
4739 _novomodules="vesa $_novomodules"
4741 echores "$_vesa"
4743 #################
4744 # VIDEO + AUDIO #
4745 #################
4748 echocheck "SDL"
4749 if test -z "$_sdlconfig" ; then
4750 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4751 _sdlconfig="sdl-config"
4752 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4753 _sdlconfig="sdl11-config"
4754 else
4755 _sdlconfig=false
4758 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4759 cat > $TMPC << EOF
4760 #include <SDL.h>
4761 int main(void) {
4762 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4763 return 0;
4766 _sdl=no
4767 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4768 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4769 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4770 if test "$_sdlversion" -gt 116 ; then
4771 if test "$_sdlversion" -lt 121 ; then
4772 _def_sdlbuggy='#define BUGGY_SDL'
4773 else
4774 _def_sdlbuggy='#undef BUGGY_SDL'
4776 _sdl=yes
4781 if test "$_sdl" = yes ; then
4782 _def_sdl='#define HAVE_SDL 1'
4783 if cygwin ; then
4784 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4785 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4786 elif mingw32 ; then
4787 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4788 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4789 else
4790 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4791 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4793 _vosrc="$_vosrc vo_sdl.c"
4794 _vomodules="sdl $_vomodules"
4795 _aosrc="$_aosrc ao_sdl.c"
4796 _aomodules="sdl $_aomodules"
4797 _res_comment="using $_sdlconfig"
4798 else
4799 _def_sdl='#undef HAVE_SDL'
4800 _novomodules="sdl $_novomodules"
4801 _noaomodules="sdl $_noaomodules"
4803 echores "$_sdl"
4806 if win32; then
4808 echocheck "Windows waveout"
4809 if test "$_win32waveout" = auto ; then
4810 cat > $TMPC << EOF
4811 #include <windows.h>
4812 #include <mmsystem.h>
4813 int main(void) { return 0; }
4815 _win32waveout=no
4816 cc_check -lwinmm && _win32waveout=yes
4818 if test "$_win32waveout" = yes ; then
4819 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4820 _libs_mplayer="$_libs_mplayer -lwinmm"
4821 _aosrc="$_aosrc ao_win32.c"
4822 _aomodules="win32 $_aomodules"
4823 else
4824 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4825 _noaomodules="win32 $_noaomodules"
4827 echores "$_win32waveout"
4829 echocheck "Directx"
4830 if test "$_directx" = auto ; then
4831 cat > $TMPC << EOF
4832 #include <windows.h>
4833 #include <ddraw.h>
4834 #include <dsound.h>
4835 int main(void) { return 0; }
4837 _directx=no
4838 cc_check -lgdi32 && _directx=yes
4840 if test "$_directx" = yes ; then
4841 _def_directx='#define HAVE_DIRECTX 1'
4842 _libs_mplayer="$_libs_mplayer -lgdi32"
4843 _vosrc="$_vosrc vo_directx.c"
4844 _vomodules="directx $_vomodules"
4845 _aosrc="$_aosrc ao_dsound.c"
4846 _aomodules="dsound $_aomodules"
4847 else
4848 _def_directx='#undef HAVE_DIRECTX'
4849 _novomodules="directx $_novomodules"
4850 _noaomodules="dsound $_noaomodules"
4852 echores "$_directx"
4854 fi #if win32; then
4857 echocheck "NAS"
4858 if test "$_nas" = auto ; then
4859 cat > $TMPC << EOF
4860 #include <audio/audiolib.h>
4861 int main(void) { return 0; }
4863 _nas=no
4864 cc_check $_ld_lm -laudio -lXt && _nas=yes
4866 if test "$_nas" = yes ; then
4867 _def_nas='#define HAVE_NAS 1'
4868 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4869 _aosrc="$_aosrc ao_nas.c"
4870 _aomodules="nas $_aomodules"
4871 else
4872 _noaomodules="nas $_noaomodules"
4873 _def_nas='#undef HAVE_NAS'
4875 echores "$_nas"
4877 echocheck "DXR2"
4878 if test "$_dxr2" = auto; then
4879 _dxr2=no
4880 cat > $TMPC << EOF
4881 #include <dxr2ioctl.h>
4882 int main(void) { return 0; }
4884 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4885 cc_check $_inc_tmp && _dxr2=yes && \
4886 _inc_extra="$_inc_extra $_inc_tmp" && break
4887 done
4889 if test "$_dxr2" = yes; then
4890 _def_dxr2='#define HAVE_DXR2 1'
4891 _vosrc="$_vosrc vo_dxr2.c"
4892 _aosrc="$_aosrc ao_dxr2.c"
4893 _aomodules="dxr2 $_aomodules"
4894 _vomodules="dxr2 $_vomodules"
4895 else
4896 _def_dxr2='#undef HAVE_DXR2'
4897 _noaomodules="dxr2 $_noaomodules"
4898 _novomodules="dxr2 $_novomodules"
4900 echores "$_dxr2"
4902 echocheck "DXR3/H+"
4903 if test "$_dxr3" = auto ; then
4904 cat > $TMPC << EOF
4905 #include <linux/em8300.h>
4906 int main(void) { return 0; }
4908 _dxr3=no
4909 cc_check && _dxr3=yes
4911 if test "$_dxr3" = yes ; then
4912 _def_dxr3='#define HAVE_DXR3 1'
4913 _vosrc="$_vosrc vo_dxr3.c"
4914 _vomodules="dxr3 $_vomodules"
4915 else
4916 _def_dxr3='#undef HAVE_DXR3'
4917 _novomodules="dxr3 $_novomodules"
4919 echores "$_dxr3"
4922 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4923 if test "$_ivtv" = auto ; then
4924 cat > $TMPC << EOF
4925 #include <stdlib.h>
4926 #include <inttypes.h>
4927 #include <linux/types.h>
4928 #include <linux/videodev2.h>
4929 #include <linux/ivtv.h>
4930 #include <sys/ioctl.h>
4931 int main(void) {
4932 struct ivtv_cfg_stop_decode sd;
4933 struct ivtv_cfg_start_decode sd1;
4934 ioctl (0, IVTV_IOC_START_DECODE, &sd1);
4935 ioctl (0, IVTV_IOC_STOP_DECODE, &sd);
4936 return 0; }
4938 _ivtv=no
4939 cc_check && _ivtv=yes
4941 if test "$_ivtv" = yes ; then
4942 _def_ivtv='#define HAVE_IVTV 1'
4943 _vosrc="$_vosrc vo_ivtv.c"
4944 _vomodules="ivtv $_vomodules"
4945 _aosrc="$_aosrc ao_ivtv.c"
4946 _aomodules="ivtv $_aomodules"
4947 else
4948 _def_ivtv='#undef HAVE_IVTV'
4949 _novomodules="ivtv $_novomodules"
4950 _noaomodules="ivtv $_noaomodules"
4952 echores "$_ivtv"
4955 echocheck "V4L2 MPEG Decoder"
4956 if test "$_v4l2" = auto ; then
4957 cat > $TMPC << EOF
4958 #include <stdlib.h>
4959 #include <inttypes.h>
4960 #include <linux/types.h>
4961 #include <linux/videodev2.h>
4962 #include <linux/version.h>
4963 int main(void) {
4964 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4965 #error kernel headers too old, need 2.6.22
4966 bad_kernel_version();
4967 #endif
4968 struct v4l2_ext_controls ctrls;
4969 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4970 return 0;
4973 _v4l2=no
4974 cc_check && _v4l2=yes
4976 if test "$_v4l2" = yes ; then
4977 _def_v4l2='#define HAVE_V4L2_DECODER 1'
4978 _vosrc="$_vosrc vo_v4l2.c"
4979 _vomodules="v4l2 $_vomodules"
4980 _aosrc="$_aosrc ao_v4l2.c"
4981 _aomodules="v4l2 $_aomodules"
4982 else
4983 _def_v4l2='#undef HAVE_V4L2_DECODER'
4984 _novomodules="v4l2 $_novomodules"
4985 _noaomodules="v4l2 $_noaomodules"
4987 echores "$_v4l2"
4991 #########
4992 # AUDIO #
4993 #########
4996 echocheck "OSS Audio"
4997 if test "$_ossaudio" = auto ; then
4998 cat > $TMPC << EOF
4999 #include <sys/ioctl.h>
5000 #include <$_soundcard_header>
5001 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5003 _ossaudio=no
5004 cc_check && _ossaudio=yes
5006 if test "$_ossaudio" = yes ; then
5007 _def_ossaudio='#define USE_OSS_AUDIO 1'
5008 _aosrc="$_aosrc ao_oss.c"
5009 _aomodules="oss $_aomodules"
5010 if test "$_linux_devfs" = yes; then
5011 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5012 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5013 else
5014 cat > $TMPC << EOF
5015 #include <sys/ioctl.h>
5016 #include <$_soundcard_header>
5017 #ifdef OPEN_SOUND_SYSTEM
5018 int main(void) { return 0; }
5019 #else
5020 #error Not the real thing
5021 #endif
5023 _real_ossaudio=no
5024 cc_check && _real_ossaudio=yes
5025 if test "$_real_ossaudio" = yes; then
5026 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5027 elif netbsd || openbsd ; then
5028 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5029 _ld_extra="$_ld_extra -lossaudio"
5030 else
5031 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5033 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5035 else
5036 _def_ossaudio='#undef USE_OSS_AUDIO'
5037 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5038 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5039 _noaomodules="oss $_noaomodules"
5041 echores "$_ossaudio"
5044 echocheck "aRts"
5045 if test "$_arts" = auto ; then
5046 _arts=no
5047 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5049 cat > $TMPC << EOF
5050 #include <artsc.h>
5051 int main(void) { return 0; }
5053 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5058 if test "$_arts" = yes ; then
5059 _def_arts='#define USE_ARTS 1'
5060 _aosrc="$_aosrc ao_arts.c"
5061 _aomodules="arts $_aomodules"
5062 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5063 _inc_extra="$_inc_extra `artsc-config --cflags`"
5064 else
5065 _noaomodules="arts $_noaomodules"
5067 echores "$_arts"
5070 echocheck "EsounD"
5071 if test "$_esd" = auto ; then
5072 _esd=no
5073 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5075 cat > $TMPC << EOF
5076 #include <esd.h>
5077 int main(void) { int fd = esd_open_sound("test"); return fd; }
5079 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5083 echores "$_esd"
5085 if test "$_esd" = yes ; then
5086 _def_esd='#define USE_ESD 1'
5087 _aosrc="$_aosrc ao_esd.c"
5088 _aomodules="esd $_aomodules"
5089 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5090 _inc_extra="$_inc_extra `esd-config --cflags`"
5092 echocheck "esd_get_latency()"
5093 cat > $TMPC << EOF
5094 #include <esd.h>
5095 int main(void) { return esd_get_latency(0); }
5097 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5098 echores "$_esd_latency"
5099 else
5100 _def_esd='#undef USE_ESD'
5101 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5102 _noaomodules="esd $_noaomodules"
5105 echocheck "pulse"
5106 if test "$_pulse" = auto ; then
5107 _pulse=no
5108 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5110 cat > $TMPC << EOF
5111 #include <pulse/pulseaudio.h>
5112 int main(void) { return 0; }
5114 cc_check `$_pkg_config --libs --cflags libpulse` && tmp_run && _pulse=yes
5118 echores "$_pulse"
5120 if test "$_pulse" = yes ; then
5121 _def_pulse='#define USE_PULSE 1'
5122 _aosrc="$_aosrc ao_pulse.c"
5123 _aomodules="pulse $_aomodules"
5124 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs libpulse`"
5125 _inc_extra="$_inc_extra `$_pkg_config --cflags libpulse`"
5126 else
5127 _def_pulse='#undef USE_PULSE'
5128 _noaomodules="pulse $_noaomodules"
5132 echocheck "JACK"
5133 if test "$_jack" = auto ; then
5134 _jack=yes
5136 cat > $TMPC << EOF
5137 #include <jack/jack.h>
5138 int main(void) { jack_client_new("test"); return 0; }
5140 if cc_check -ljack ; then
5141 _libs_mplayer="$_libs_mplayer -ljack"
5142 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5143 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5144 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5145 else
5146 _jack=no
5150 if test "$_jack" = yes ; then
5151 _def_jack='#define USE_JACK 1'
5152 _aosrc="$_aosrc ao_jack.c"
5153 _aomodules="jack $_aomodules"
5154 else
5155 _noaomodules="jack $_noaomodules"
5157 echores "$_jack"
5159 echocheck "OpenAL"
5160 if test "$_openal" = auto ; then
5161 _openal=no
5162 cat > $TMPC << EOF
5163 #ifdef OPENAL_AL_H
5164 #include <OpenAL/al.h>
5165 #else
5166 #include <AL/al.h>
5167 #endif
5168 int main(void) {
5169 alSourceQueueBuffers(0, 0, 0);
5170 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5171 return 0;
5174 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5175 cc_check $I && _openal=yes && break
5176 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5177 done
5178 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5180 if test "$_openal" = yes ; then
5181 _def_openal='#define USE_OPENAL 1'
5182 _aosrc="$_aosrc ao_openal.c"
5183 _aomodules="openal $_aomodules"
5184 else
5185 _noaomodules="openal $_noaomodules"
5187 echores "$_openal"
5189 echocheck "ALSA audio"
5190 if test "$_alsa" != no ; then
5191 _alsa=no
5192 cat > $TMPC << EOF
5193 #include <sys/asoundlib.h>
5194 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5195 #error "alsa version != 0.5.x"
5196 #endif
5197 int main(void) { return 0; }
5199 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5201 cat > $TMPC << EOF
5202 #include <sys/asoundlib.h>
5203 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5204 #error "alsa version != 0.9.x"
5205 #endif
5206 int main(void) { return 0; }
5208 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5209 cat > $TMPC << EOF
5210 #include <alsa/asoundlib.h>
5211 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5212 #error "alsa version != 0.9.x"
5213 #endif
5214 int main(void) { return 0; }
5216 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5218 cat > $TMPC << EOF
5219 #include <sys/asoundlib.h>
5220 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5221 #error "alsa version != 1.0.x"
5222 #endif
5223 int main(void) { return 0; }
5225 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5226 cat > $TMPC << EOF
5227 #include <alsa/asoundlib.h>
5228 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5229 #error "alsa version != 1.0.x"
5230 #endif
5231 int main(void) { return 0; }
5233 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5235 _def_alsa5='#undef HAVE_ALSA5'
5236 _def_alsa9='#undef HAVE_ALSA9'
5237 _def_alsa1x='#undef HAVE_ALSA1X'
5238 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5239 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5240 if test "$_alsaver" ; then
5241 _alsa=yes
5242 if test "$_alsaver" = '0.5.x' ; then
5243 _alsa5=yes
5244 _aosrc="$_aosrc ao_alsa5.c"
5245 _aomodules="alsa5 $_aomodules"
5246 _def_alsa5='#define HAVE_ALSA5 1'
5247 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5248 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5249 elif test "$_alsaver" = '0.9.x-sys' ; then
5250 _alsa9=yes
5251 _aosrc="$_aosrc ao_alsa.c"
5252 _aomodules="alsa $_aomodules"
5253 _def_alsa9='#define HAVE_ALSA9 1'
5254 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5255 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5256 elif test "$_alsaver" = '0.9.x-alsa' ; then
5257 _alsa9=yes
5258 _aosrc="$_aosrc ao_alsa.c"
5259 _aomodules="alsa $_aomodules"
5260 _def_alsa9='#define HAVE_ALSA9 1'
5261 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5262 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5263 elif test "$_alsaver" = '1.0.x-sys' ; then
5264 _alsa1x=yes
5265 _aosrc="$_aosrc ao_alsa.c"
5266 _aomodules="alsa $_aomodules"
5267 _def_alsa1x="#define HAVE_ALSA1X 1"
5268 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5269 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5270 elif test "$_alsaver" = '1.0.x-alsa' ; then
5271 _alsa1x=yes
5272 _aosrc="$_aosrc ao_alsa.c"
5273 _aomodules="alsa $_aomodules"
5274 _def_alsa1x="#define HAVE_ALSA1X 1"
5275 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5276 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5277 else
5278 _alsa=no
5279 _res_comment="unknown version"
5281 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5282 else
5283 _noaomodules="alsa $_noaomodules"
5285 echores "$_alsa"
5288 echocheck "Sun audio"
5289 if test "$_sunaudio" = auto ; then
5290 cat > $TMPC << EOF
5291 #include <sys/types.h>
5292 #include <sys/audioio.h>
5293 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5295 _sunaudio=no
5296 cc_check && _sunaudio=yes
5298 if test "$_sunaudio" = yes ; then
5299 _def_sunaudio='#define USE_SUN_AUDIO 1'
5300 _aosrc="$_aosrc ao_sun.c"
5301 _aomodules="sun $_aomodules"
5302 else
5303 _def_sunaudio='#undef USE_SUN_AUDIO'
5304 _noaomodules="sun $_noaomodules"
5306 echores "$_sunaudio"
5309 if sunos; then
5310 echocheck "Sun mediaLib"
5311 if test "$_mlib" = auto ; then
5312 _mlib=no
5313 cat > $TMPC << EOF
5314 #include <mlib.h>
5315 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5317 cc_check -lmlib && _mlib=yes
5319 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5320 echores "$_mlib"
5321 fi #if sunos
5324 if irix; then
5325 echocheck "SGI audio"
5326 if test "$_sgiaudio" = auto ; then
5327 # check for SGI audio
5328 cat > $TMPC << EOF
5329 #include <dmedia/audio.h>
5330 int main(void) { return 0; }
5332 _sgiaudio=no
5333 cc_check && _sgiaudio=yes
5335 if test "$_sgiaudio" = "yes" ; then
5336 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5337 _libs_mplayer="$_libs_mplayer -laudio"
5338 _aosrc="$_aosrc ao_sgi.c"
5339 _aomodules="sgi $_aomodules"
5340 else
5341 _def_sgiaudio='#undef USE_SGI_AUDIO'
5342 _noaomodules="sgi $_noaomodules"
5344 echores "$_sgiaudio"
5345 fi #if irix
5348 echocheck "VCD support"
5349 if linux || freebsd || netbsd || dragonfly || bsdos || darwin || sunos || mingw32; then
5350 _inputmodules="vcd $_inputmodules"
5351 _def_vcd='#define HAVE_VCD 1'
5352 _vcd="yes"
5353 else
5354 _def_vcd='#undef HAVE_VCD'
5355 _noinputmodules="vcd $_noinputmodules"
5356 _res_comment="not supported on this OS"
5357 _vcd="no"
5359 echores "$_vcd"
5363 echocheck "dvdread"
5364 if test "$_dvdread_internal" = auto ; then
5365 _dvdread_internal=no
5366 _dvdread=no
5367 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5368 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5369 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5370 || darwin || win32; then
5371 _dvdread_internal=yes
5372 _dvdread=yes
5374 elif test "$_dvdread" = auto ; then
5375 _dvdread=no
5376 if test "$_dl" = yes; then
5377 cat > $TMPC << EOF
5378 #include <inttypes.h>
5379 #include <libdvdread/dvd_reader.h>
5380 #include <libdvdread/ifo_types.h>
5381 #include <libdvdread/ifo_read.h>
5382 #include <libdvdread/nav_read.h>
5383 int main(void) { return 0; }
5386 _dvdreadcflags=`$_dvdreadconfig --cflags`
5387 _dvdreadlibs=`$_dvdreadconfig --libs`
5388 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5389 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5390 _dvdread=yes
5391 _inc_extra="$_inc_extra $_dvdreadcflags"
5392 _ld_extra="$_ld_extra $_dvdreadlibs"
5393 _res_comment="external"
5397 if test "$_dvdread_internal" = yes; then
5398 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5399 _def_dvdread='#define USE_DVDREAD 1'
5400 _inputmodules="dvdread(internal) $_inputmodules"
5401 _largefiles=yes
5402 _res_comment="internal"
5403 elif test "$_dvdread" = yes; then
5404 _def_dvdread='#define USE_DVDREAD 1'
5405 _largefiles=yes
5406 _ld_extra="$_ld_extra -ldvdread"
5407 _inputmodules="dvdread(external) $_inputmodules"
5408 _res_comment="external"
5409 else
5410 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5411 _def_dvdread='#undef USE_DVDREAD'
5412 _noinputmodules="dvdread $_noinputmodules"
5414 echores "$_dvdread"
5417 echocheck "internal libdvdcss"
5418 if test "$_libdvdcss_internal" = auto ; then
5419 _libdvdcss_internal=no
5420 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5421 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5423 if test "$_libdvdcss_internal" = yes ; then
5424 if linux || netbsd || openbsd || bsdos ; then
5425 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5426 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5427 elif freebsd || dragonfly ; then
5428 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5429 elif darwin ; then
5430 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5431 _ld_extra="$_ld_extra -framework IOKit"
5433 _libdvdcss_dvdread_flags="-Ilibdvdcss -DHAVE_DVDCSS_DVDCSS_H"
5434 _inputmodules="libdvdcss(internal) $_inputmodules"
5435 _largefiles=yes
5436 else
5437 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5439 echores "$_libdvdcss_internal"
5442 echocheck "cdparanoia"
5443 if test "$_cdparanoia" = auto ; then
5444 cat > $TMPC <<EOF
5445 #include <cdda_interface.h>
5446 #include <cdda_paranoia.h>
5447 // This need a better test. How ?
5448 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5450 _cdparanoia=no
5451 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5452 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5453 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5454 done
5456 if test "$_cdparanoia" = yes ; then
5457 _cdda='yes'
5458 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5459 openbsd && _ld_extra="$_ld_extra -lutil"
5461 echores "$_cdparanoia"
5464 echocheck "libcdio"
5465 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5466 cat > $TMPC << EOF
5467 #include <stdio.h>
5468 #include <cdio/version.h>
5469 #include <cdio/cdda.h>
5470 #include <cdio/paranoia.h>
5471 int main(void) {
5472 void *test = cdda_verbose_set;
5473 printf("%s\n", CDIO_VERSION);
5474 return test == (void *)1;
5477 _libcdio=no
5478 for _ld_tmp in "" "-lwinmm" ; do
5479 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5480 cc_check $_ld_tmp $_ld_lm \
5481 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5482 done
5483 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5484 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5485 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5486 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5487 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5490 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5491 _cdda='yes'
5492 _def_libcdio='#define HAVE_LIBCDIO'
5493 _def_havelibcdio='yes'
5494 else
5495 if test "$_cdparanoia" = yes ; then
5496 _res_comment="using cdparanoia"
5498 _def_libcdio='#undef HAVE_LIBCDIO'
5499 _def_havelibcdio='no'
5501 echores "$_libcdio"
5503 if test "$_cdda" = yes ; then
5504 test $_cddb = auto && test $_network = yes && _cddb=yes
5505 _def_cdparanoia='#define HAVE_CDDA'
5506 _inputmodules="cdda $_inputmodules"
5507 else
5508 _def_cdparanoia='#undef HAVE_CDDA'
5509 _noinputmodules="cdda $_noinputmodules"
5512 if test "$_cddb" = yes ; then
5513 _def_cddb='#define HAVE_CDDB'
5514 _inputmodules="cddb $_inputmodules"
5515 else
5516 _cddb=no
5517 _def_cddb='#undef HAVE_CDDB'
5518 _noinputmodules="cddb $_noinputmodules"
5521 echocheck "bitmap font support"
5522 if test "$_bitmap_font" = yes ; then
5523 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5524 else
5525 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5527 echores "$_bitmap_font"
5530 echocheck "freetype >= 2.0.9"
5532 # freetype depends on iconv
5533 if test "$_iconv" = no ; then
5534 _freetype=no
5535 _res_comment="iconv support needed"
5538 if test "$_freetype" = auto ; then
5539 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5540 cat > $TMPC << EOF
5541 #include <stdio.h>
5542 #include <ft2build.h>
5543 #include FT_FREETYPE_H
5544 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5545 #error "Need FreeType 2.0.9 or newer"
5546 #endif
5547 int main(void) {
5548 FT_Library library;
5549 FT_Int major=-1,minor=-1,patch=-1;
5550 int err=FT_Init_FreeType(&library);
5551 if(err){
5552 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5553 exit(err);
5555 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5556 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5557 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5558 (int)major,(int)minor,(int)patch );
5559 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5560 printf("Library and header version mismatch! Fix it in your distribution!\n");
5561 exit(1);
5563 return 0;
5566 _freetype=no
5567 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5568 else
5569 _freetype=no
5572 if test "$_freetype" = yes ; then
5573 _def_freetype='#define HAVE_FREETYPE'
5574 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5575 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5576 else
5577 _def_freetype='#undef HAVE_FREETYPE'
5579 echores "$_freetype"
5581 if test "$_freetype" = no ; then
5582 _fontconfig=no
5583 _res_comment="freetype support needed"
5585 echocheck "fontconfig"
5586 if test "$_fontconfig" = auto ; then
5587 cat > $TMPC << EOF
5588 #include <stdio.h>
5589 #include <fontconfig/fontconfig.h>
5590 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;
5599 _fontconfig=no
5600 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5601 _ld_tmp="-lfontconfig $_ld_tmp"
5602 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5603 done
5604 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5605 _inc_tmp=`$_pkg_config --cflags fontconfig`
5606 _ld_tmp=`$_pkg_config --libs fontconfig`
5607 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5608 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5611 if test "$_fontconfig" = yes ; then
5612 _def_fontconfig='#define HAVE_FONTCONFIG'
5613 else
5614 _def_fontconfig='#undef HAVE_FONTCONFIG'
5616 echores "$_fontconfig"
5619 echocheck "SSA/ASS support"
5620 # libass depends on FreeType
5621 if test "$_freetype" = no ; then
5622 _ass=no
5623 _res_comment="FreeType support needed"
5626 if test "$_ass" = auto ; then
5627 cat > $TMPC << EOF
5628 #include <ft2build.h>
5629 #include FT_FREETYPE_H
5630 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5631 #error "Need FreeType 2.1.8 or newer"
5632 #endif
5633 int main(void) { return 0; }
5635 _ass=no
5636 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5637 if test "$_ass" = no ; then
5638 _res_comment="FreeType >= 2.1.8 needed"
5641 if test "$_ass" = yes ; then
5642 _def_ass='#define USE_ASS'
5643 else
5644 _def_ass='#undef USE_ASS'
5646 echores "$_ass"
5649 echocheck "fribidi with charsets"
5650 if test "$_fribidi" = auto ; then
5651 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5652 cat > $TMPC << EOF
5653 #include <stdio.h>
5654 /* workaround for fribidi 0.10.4 and below */
5655 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5656 #include <fribidi/fribidi.h>
5657 int main(void) {
5658 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5659 printf("Fribidi headers are not consistents with the library!\n");
5660 exit(1);
5662 return 0;
5665 _fribidi=no
5666 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5667 else
5668 _fribidi=no
5671 if test "$_fribidi" = yes ; then
5672 _def_fribidi='#define USE_FRIBIDI'
5673 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5674 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5675 else
5676 _def_fribidi='#undef USE_FRIBIDI'
5678 echores "$_fribidi"
5681 echocheck "ENCA"
5682 if test "$_enca" = auto ; then
5683 cat > $TMPC << EOF
5684 #include <enca.h>
5685 int main(void) {
5686 const char **langs;
5687 size_t langcnt;
5688 langs = enca_get_languages(&langcnt);
5689 return 0;
5692 _enca=no
5693 cc_check -lenca $_ld_lm && _enca=yes
5695 if test "$_enca" = yes ; then
5696 _def_enca='#define HAVE_ENCA 1'
5697 _ld_extra="$_ld_extra -lenca"
5698 else
5699 _def_enca='#undef HAVE_ENCA'
5701 echores "$_enca"
5704 echocheck "zlib"
5705 cat > $TMPC << EOF
5706 #include <zlib.h>
5707 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5709 _zlib=no
5710 cc_check -lz && _zlib=yes
5711 if test "$_zlib" = yes ; then
5712 _def_zlib='#define HAVE_ZLIB 1'
5713 _ld_extra="$_ld_extra -lz"
5714 else
5715 _def_zlib='#undef HAVE_ZLIB'
5716 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5717 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5719 echores "$_zlib"
5722 echocheck "RTC"
5723 if test "$_rtc" = auto ; then
5724 cat > $TMPC << EOF
5725 #include <sys/ioctl.h>
5726 #ifdef __linux__
5727 #include <linux/rtc.h>
5728 #else
5729 #include <rtc.h>
5730 #define RTC_PIE_ON RTCIO_PIE_ON
5731 #endif
5732 int main(void) { return RTC_PIE_ON; }
5734 _rtc=no
5735 cc_check && _rtc=yes
5736 ppc && _rtc=no
5738 if test "$_rtc" = yes ; then
5739 _def_rtc='#define HAVE_RTC 1'
5740 else
5741 _def_rtc='#undef HAVE_RTC'
5743 echores "$_rtc"
5746 echocheck "liblzo2 support"
5747 if test "$_liblzo" = auto ; then
5748 _liblzo=no
5749 cat > $TMPC << EOF
5750 #include <lzo/lzo1x.h>
5751 int main(void) { lzo_init();return 0; }
5753 cc_check -llzo2 && _liblzo=yes
5755 if test "$_liblzo" = yes ; then
5756 _def_liblzo='#define USE_LIBLZO 1'
5757 _ld_extra="$_ld_extra -llzo2"
5758 _codecmodules="liblzo $_codecmodules"
5759 else
5760 _def_liblzo='#undef USE_LIBLZO'
5761 _nocodecmodules="liblzo $_nocodecmodules"
5763 echores "$_liblzo"
5766 echocheck "mad support"
5767 if test "$_mad" = auto ; then
5768 _mad=no
5769 cat > $TMPC << EOF
5770 #include <mad.h>
5771 int main(void) { return 0; }
5773 cc_check -lmad && _mad=yes
5775 if test "$_mad" = yes ; then
5776 _def_mad='#define USE_LIBMAD 1'
5777 _ld_extra="$_ld_extra -lmad"
5778 _codecmodules="libmad $_codecmodules"
5779 else
5780 _def_mad='#undef USE_LIBMAD'
5781 _nocodecmodules="libmad $_nocodecmodules"
5783 echores "$_mad"
5785 echocheck "Twolame"
5786 if test "$_twolame" = auto ; then
5787 cat > $TMPC <<EOF
5788 #include <twolame.h>
5789 int main(void) { twolame_init(); return 0; }
5791 _twolame=no
5792 cc_check -ltwolame $_ld_lm && _twolame=yes
5794 if test "$_twolame" = yes ; then
5795 _def_twolame='#define HAVE_TWOLAME 1'
5796 _libs_mencoder="$_libs_mencoder -ltwolame"
5797 _codecmodules="twolame $_codecmodules"
5798 else
5799 _def_twolame='#undef HAVE_TWOLAME'
5800 _nocodecmodules="twolame $_nocodecmodules"
5802 echores "$_twolame"
5804 echocheck "Toolame"
5805 if test "$_toolame" = auto ; then
5806 _toolame=no
5807 if test "$_twolame" = yes ; then
5808 _res_comment="disabled by twolame"
5809 else
5810 cat > $TMPC <<EOF
5811 #include <toolame.h>
5812 int main(void) { toolame_init(); return 0; }
5814 cc_check -ltoolame $_ld_lm && _toolame=yes
5817 if test "$_toolame" = yes ; then
5818 _def_toolame='#define HAVE_TOOLAME 1'
5819 _libs_mencoder="$_libs_mencoder -ltoolame"
5820 _codecmodules="toolame $_codecmodules"
5821 else
5822 _def_toolame='#undef HAVE_TOOLAME'
5823 _nocodecmodules="toolame $_nocodecmodules"
5825 if test "$_toolamedir" ; then
5826 _res_comment="using $_toolamedir"
5828 echores "$_toolame"
5830 echocheck "OggVorbis support"
5831 if test "$_tremor_internal" = yes; then
5832 _libvorbis=no
5833 elif test "$_tremor_external" = auto; then
5834 _tremor_external=no
5835 cat > $TMPC << EOF
5836 #include <tremor/ivorbiscodec.h>
5837 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5839 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5841 if test "$_libvorbis" = auto; then
5842 _libvorbis=no
5843 cat > $TMPC << EOF
5844 #include <vorbis/codec.h>
5845 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5847 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5849 if test "$_tremor_internal" = yes ; then
5850 _vorbis=yes
5851 _def_vorbis='#define HAVE_OGGVORBIS 1'
5852 _def_tremor='#define TREMOR 1'
5853 _codecmodules="tremor(internal) $_codecmodules"
5854 _res_comment="internal Tremor"
5855 if test "$_tremor_low" = yes ; then
5856 CFLAGS="$CFLAGS -D_LOW_ACCURACY_"
5857 _res_comment="internal low accuracy Tremor"
5859 elif test "$_tremor_external" = yes ; then
5860 _vorbis=yes
5861 _def_vorbis='#define HAVE_OGGVORBIS 1'
5862 _def_tremor='#define TREMOR 1'
5863 _codecmodules="tremor(external) $_codecmodules"
5864 _res_comment="external Tremor"
5865 _ld_extra="$_ld_extra -logg -lvorbisidec"
5866 elif test "$_libvorbis" = yes ; then
5867 _vorbis=yes
5868 _def_vorbis='#define HAVE_OGGVORBIS 1'
5869 _codecmodules="libvorbis $_codecmodules"
5870 _res_comment="libvorbis"
5871 _ld_extra="$_ld_extra -lvorbis -logg"
5872 else
5873 _vorbis=no
5874 _nocodecmodules="libvorbis $_nocodecmodules"
5876 echores "$_vorbis"
5878 echocheck "libspeex (version >= 1.1 required)"
5879 if test "$_speex" = auto ; then
5880 _speex=no
5881 cat > $TMPC << EOF
5882 #include <speex/speex.h>
5883 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); }
5885 cc_check -lspeex $_ld_lm && _speex=yes
5887 if test "$_speex" = yes ; then
5888 _def_speex='#define HAVE_SPEEX 1'
5889 _ld_extra="$_ld_extra -lspeex"
5890 _codecmodules="speex $_codecmodules"
5891 else
5892 _def_speex='#undef HAVE_SPEEX'
5893 _nocodecmodules="speex $_nocodecmodules"
5895 echores "$_speex"
5897 echocheck "OggTheora support"
5898 if test "$_theora" = auto ; then
5899 _theora=no
5900 cat > $TMPC << EOF
5901 #include <theora/theora.h>
5902 #include <string.h>
5903 int main(void) {
5904 /* theora is in flux, make sure that all interface routines and
5905 * datatypes exist and work the way we expect it, so we don't break
5906 * mplayer */
5907 ogg_packet op;
5908 theora_comment tc;
5909 theora_info inf;
5910 theora_state st;
5911 yuv_buffer yuv;
5912 int r;
5913 double t;
5915 theora_info_init (&inf);
5916 theora_comment_init (&tc);
5918 return 0;
5920 /* we don't want to execute this kind of nonsense; just for making sure
5921 * that compilation works... */
5922 memset(&op, 0, sizeof(op));
5923 r = theora_decode_header (&inf, &tc, &op);
5924 r = theora_decode_init (&st, &inf);
5925 t = theora_granule_time (&st, op.granulepos);
5926 r = theora_decode_packetin (&st, &op);
5927 r = theora_decode_YUVout (&st, &yuv);
5928 theora_clear (&st);
5930 return 0;
5933 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5934 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5935 && _theora=yes && break
5936 done
5937 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5938 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5939 cc_check -I. tremor/bitwise.c $_ld_theora \
5940 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5941 done
5944 if test "$_theora" = yes ; then
5945 _def_theora='#define HAVE_OGGTHEORA 1'
5946 _codecmodules="libtheora $_codecmodules"
5947 # when --enable-theora is forced, we'd better provide a probably sane
5948 # $_ld_theora than nothing
5949 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5950 else
5951 _def_theora='#undef HAVE_OGGTHEORA'
5952 _nocodecmodules="libtheora $_nocodecmodules"
5954 echores "$_theora"
5956 echocheck "internal mp3lib support"
5957 if test "$_mp3lib" = yes ; then
5958 _def_mp3lib='#define USE_MP3LIB 1'
5959 _codecmodules="mp3lib $_codecmodules"
5960 else
5961 _def_mp3lib='#undef USE_MP3LIB'
5962 _nocodecmodules="mp3lib $_nocodecmodules"
5964 echores "$_mp3lib"
5966 echocheck "internal liba52 support"
5967 if test "$_liba52" = yes ; then
5968 _def_liba52='#define USE_LIBA52 1'
5969 _codecmodules="liba52 $_codecmodules"
5970 else
5971 _def_liba52='#undef USE_LIBA52'
5972 _nocodecmodules="liba52 $_nocodecmodules"
5974 echores "$_liba52"
5976 echocheck "internal libmpeg2 support"
5977 if test "$_libmpeg2" = auto ; then
5978 _libmpeg2=yes
5979 if alpha && test cc_vendor=gnu; then
5980 case $cc_version in
5981 2*|3.0*|3.1*) # cannot compile MVI instructions
5982 _libmpeg2=no
5983 _res_comment="broken gcc"
5985 esac
5988 if test "$_libmpeg2" = yes ; then
5989 _def_libmpeg2='#define USE_LIBMPEG2 1'
5990 _codecmodules="libmpeg2 $_codecmodules"
5991 else
5992 _def_libmpeg2='#undef USE_LIBMPEG2'
5993 _nocodecmodules="libmpeg2 $_nocodecmodules"
5995 echores "$_libmpeg2"
5997 echocheck "libdca support"
5998 if test "$_libdca" = auto ; then
5999 _libdca=no
6000 cat > $TMPC << EOF
6001 #include <inttypes.h>
6002 #include <dts.h>
6003 int main(void) { dts_init (0); return 0; }
6005 for _ld_dca in -ldts -ldca ; do
6006 cc_check $_ld_dca $_ld_lm && _ld_extra="$_ld_extra $_ld_dca" \
6007 && _libdca=yes && break
6008 done
6010 if test "$_libdca" = yes ; then
6011 _def_libdca='#define USE_LIBDCA 1'
6012 _codecmodules="libdca $_codecmodules"
6013 else
6014 _def_libdca='#undef USE_LIBDCA'
6015 _nocodecmodules="libdca $_nocodecmodules"
6017 echores "$_libdca"
6019 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6020 if test "$_musepack" = auto ; then
6021 _musepack=no
6022 cat > $TMPC << EOF
6023 #include <mpcdec/mpcdec.h>
6024 int main(void) {
6025 mpc_streaminfo info;
6026 mpc_decoder decoder;
6027 mpc_decoder_set_streaminfo(&decoder, &info);
6028 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6031 cc_check -lmpcdec $_ld_lm && _musepack=yes
6033 if test "$_musepack" = yes ; then
6034 _def_musepack='#define HAVE_MUSEPACK 1'
6035 _ld_extra="$_ld_extra -lmpcdec"
6036 _codecmodules="musepack $_codecmodules"
6037 else
6038 _def_musepack='#undef HAVE_MUSEPACK'
6039 _nocodecmodules="musepack $_nocodecmodules"
6041 echores "$_musepack"
6044 echocheck "FAAC (AAC encoder) support"
6045 if test "$_faac" = auto ; then
6046 cat > $TMPC <<EOF
6047 #include <inttypes.h>
6048 #include <faac.h>
6049 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6051 _faac=no
6052 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6053 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6054 done
6056 if test "$_faac" = yes ; then
6057 _def_faac="#define HAVE_FAAC 1"
6058 test "$_faac_lavc" = auto && _faac_lavc=yes
6059 if test "$_faac_lavc" = yes ; then
6060 _def_faac_lavc="#define CONFIG_LIBFAAC 1"
6061 _libs_mplayer="$_libs_mplayer $_ld_faac"
6062 _libavencoders="$_libavencoders LIBFAAC_ENCODER"
6064 _codecmodules="faac $_codecmodules"
6065 else
6066 _faac_lavc=no
6067 _def_faac="#undef HAVE_FAAC"
6068 _def_faac_lavc="#undef CONFIG_LIBFAAC"
6069 _nocodecmodules="faac $_nocodecmodules"
6071 _res_comment="in libavcodec: $_faac_lavc"
6072 echores "$_faac"
6075 echocheck "FAAD2 (AAC) support"
6076 if test "$_faad_internal" = auto ; then
6077 if x86_32 && test cc_vendor=gnu; then
6078 case $cc_version in
6079 3.1*|3.2) # ICE/insn with these versions
6080 _faad_internal=no
6081 _res_comment="broken gcc"
6084 _faad_internal=yes
6086 esac
6087 else
6088 _faad_internal=yes
6090 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6091 _faad_external=no
6092 cat > $TMPC << EOF
6093 #include <faad.h>
6094 #ifndef FAAD_MIN_STREAMSIZE
6095 #error Too old version
6096 #endif
6097 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6098 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6100 cc_check -lfaad $_ld_lm && _faad_external=yes
6103 if test "$_faad_internal" = yes ; then
6104 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6105 _faad=yes
6106 _res_comment="internal floating-point"
6107 if test "$_faad_fixed" = yes ; then
6108 # The FIXED_POINT implementation of FAAD2 improves performance
6109 # on some platforms, especially for SBR files.
6110 CFLAGS="$CFLAGS -DFIXED_POINT"
6111 _res_comment="internal fixed-point"
6113 elif test "$_faad_external" = yes ; then
6114 _faad=yes
6115 _ld_extra="$_ld_extra -lfaad"
6116 else
6117 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6118 _faad=no
6121 if test "$_faad" = yes ; then
6122 _def_faad='#define HAVE_FAAD 1'
6123 _codecmodules="faad2 $_codecmodules"
6124 else
6125 _def_faad='#undef HAVE_FAAD'
6126 _nocodecmodules="faad2 $_nocodecmodules"
6128 echores "$_faad"
6131 echocheck "LADSPA plugin support"
6132 if test "$_ladspa" = auto ; then
6133 cat > $TMPC <<EOF
6134 #include <stdio.h>
6135 #include <ladspa.h>
6136 int main(void) {
6137 const LADSPA_Descriptor *ld = NULL;
6138 return 0;
6141 _ladspa=no
6142 cc_check && _ladspa=yes
6144 if test "$_ladspa" = yes; then
6145 _def_ladspa="#define HAVE_LADSPA"
6146 else
6147 _def_ladspa="#undef HAVE_LADSPA"
6149 echores "$_ladspa"
6152 if test -z "$_codecsdir" ; then
6153 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6154 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6155 if test -d "$dir" ; then
6156 _codecsdir="$dir"
6157 break;
6159 done
6161 # Fall back on default directory.
6162 if test -z "$_codecsdir" ; then
6163 _codecsdir="$_libdir/codecs"
6164 mingw32 && _codecsdir="codecs"
6165 os2 && _codecsdir="codecs"
6169 echocheck "Win32 codecs"
6170 if test "$_win32dll" = auto ; then
6171 _win32dll=no
6172 if x86_32 && ! qnx; then
6173 _win32dll=yes
6176 if test "$_win32dll" = yes ; then
6177 _def_win32dll='#define USE_WIN32DLL 1'
6178 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6179 _res_comment="using $_win32codecsdir"
6180 if ! win32 ; then
6181 _def_win32_loader='#define WIN32_LOADER 1'
6182 _win32_emulation=yes
6183 else
6184 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6185 _res_comment="using native windows"
6187 _codecmodules="win32 $_codecmodules"
6188 else
6189 _def_win32dll='#undef USE_WIN32DLL'
6190 _def_win32_loader='#undef WIN32_LOADER'
6191 _nocodecmodules="win32 $_nocodecmodules"
6193 echores "$_win32dll"
6196 echocheck "XAnim codecs"
6197 if test "$_xanim" = auto ; then
6198 _xanim=no
6199 _res_comment="dynamic loader support needed"
6200 if test "$_dl" = yes ; then
6201 _xanim=yes
6204 if test "$_xanim" = yes ; then
6205 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6206 _def_xanim='#define USE_XANIM 1'
6207 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6208 _codecmodules="xanim $_codecmodules"
6209 _res_comment="using $_xanimcodecsdir"
6210 else
6211 _def_xanim='#undef USE_XANIM'
6212 _def_xanim_path='#undef XACODEC_PATH'
6213 _nocodecmodules="xanim $_nocodecmodules"
6215 echores "$_xanim"
6218 echocheck "RealPlayer codecs"
6219 if test "$_real" = auto ; then
6220 _real=no
6221 _res_comment="dynamic loader support needed"
6222 if test "$_dl" = yes || test "$_win32dll" = yes &&
6223 (linux || freebsd || netbsd || dragonfly || darwin || win32) ; then
6224 _real=yes
6227 if test "$_real" = yes ; then
6228 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6229 _def_real='#define USE_REALCODECS 1'
6230 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6231 _codecmodules="real $_codecmodules"
6232 _res_comment="using $_realcodecsdir"
6233 else
6234 _def_real='#undef USE_REALCODECS'
6235 _def_real_path="#undef REALCODEC_PATH"
6236 _nocodecmodules="real $_nocodecmodules"
6238 echores "$_real"
6241 echocheck "QuickTime codecs"
6242 _qtx_emulation=no
6243 _def_qtx_win32='#undef USE_QTX_CODECS_WIN32'
6244 if test "$_qtx" = auto ; then
6245 test "$_win32dll" = yes || darwin && _qtx=yes
6247 if test "$_qtx" = yes ; then
6248 _def_qtx='#define USE_QTX_CODECS 1'
6249 win32 && _qtx_codecs_win32=yes && _def_qtx_win32='#define USE_QTX_CODECS_WIN32 1'
6250 _codecmodules="qtx $_codecmodules"
6251 darwin || win32 || _qtx_emulation=yes
6252 else
6253 _def_qtx='#undef USE_QTX_CODECS'
6254 _nocodecmodules="qtx $_nocodecmodules"
6256 echores "$_qtx"
6258 echocheck "Nemesi Streaming Media libraries"
6259 if test "$_nemesi" = auto && test "$_network" = yes ; then
6260 _nemesi=no
6261 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6262 _inc_extra="$_inc_extra `$_pkg_config --cflags libnemesi`"
6263 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6264 _nemesi=yes
6267 if test "$_nemesi" = yes; then
6268 _native_rtsp=no
6269 _def_nemesi='#define LIBNEMESI 1'
6270 _inputmodules="nemesi $_inputmodules"
6271 else
6272 _native_rtsp="$_network"
6273 _nemesi=no
6274 _def_nemesi='#undef LIBNEMESI'
6275 _noinputmodules="nemesi $_noinputmodules"
6277 echores "$_nemesi"
6279 echocheck "LIVE555 Streaming Media libraries"
6280 if test "$_live" = auto && test "$_network" = yes ; then
6281 cat > $TMPCPP << EOF
6282 #include <liveMedia.hh>
6283 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6284 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6285 #endif
6286 int main(void) {}
6289 _live=no
6290 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6291 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6292 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6293 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6294 $_livelibdir/groupsock/libgroupsock.a \
6295 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6296 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6297 $_ld_extra -lstdc++" \
6298 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6299 -I$_livelibdir/UsageEnvironment/include \
6300 -I$_livelibdir/BasicUsageEnvironment/include \
6301 -I$_livelibdir/groupsock/include" && \
6302 _live=yes && break
6303 done
6304 if test "$_live" != yes ; then
6305 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6306 _live_dist=yes
6310 if test "$_live" = yes && test "$_network" = yes; then
6311 _res_comment="using $_livelibdir"
6312 _def_live='#define STREAMING_LIVE555 1'
6313 _inputmodules="live555 $_inputmodules"
6314 elif test "$_live_dist" = yes && test "$_network" = yes; then
6315 _res_comment="using distribution version"
6316 _live="yes"
6317 _def_live='#define STREAMING_LIVE555 1'
6318 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6319 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6320 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6321 _inputmodules="live555 $_inputmodules"
6322 else
6323 _live=no
6324 _def_live='#undef STREAMING_LIVE555'
6325 _noinputmodules="live555 $_noinputmodules"
6327 echores "$_live"
6330 echocheck "FFmpeg libavutil"
6331 if test "$_libavutil_a" = auto ; then
6332 if test -d ffmpeg/libavutil ; then
6333 _libavutil_a=yes
6334 _res_comment="static"
6335 else
6336 die "MPlayer will not compile without libavutil in the source tree."
6338 elif test "$_libavutil_so" = auto ; then
6339 _libavutil_so=no
6340 cat > $TMPC << EOF
6341 #include <libavutil/common.h>
6342 int main(void) { ff_gcd(1,1); return 0; }
6344 if $_pkg_config --exists libavutil ; then
6345 _inc_libavutil=`$_pkg_config --cflags libavutil`
6346 _ld_tmp=`$_pkg_config --libs libavutil`
6347 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6348 && _libavutil_so=yes
6349 elif cc_check -lavutil $_ld_lm ; then
6350 _ld_extra="$_ld_extra -lavutil"
6351 _libavutil_so=yes
6352 _res_comment="using libavutil.so, but static libavutil is recommended"
6355 _libavutil=no
6356 _def_libavutil='#undef USE_LIBAVUTIL'
6357 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6358 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6359 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6360 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6361 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6362 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6363 # neither static nor shared libavutil is available, but it is mandatory ...
6364 if test "$_libavutil" = no ; then
6365 die "You need static or shared libavutil, MPlayer will not compile without!"
6367 echores "$_libavutil"
6369 echocheck "FFmpeg libavcodec"
6370 if test "$_libavcodec_a" = auto ; then
6371 _libavcodec_a=no
6372 if test -d ffmpeg/libavcodec && test -f ffmpeg/libavcodec/utils.c ; then
6373 _libavcodec_a="yes"
6374 _res_comment="static"
6376 elif test "$_libavcodec_so" = auto ; then
6377 _libavcodec_so=no
6378 _res_comment="libavcodec.so is discouraged over static libavcodec"
6379 cat > $TMPC << EOF
6380 #include <libavcodec/avcodec.h>
6381 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6383 if $_pkg_config --exists libavcodec ; then
6384 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6385 _ld_tmp=`$_pkg_config --libs libavcodec`
6386 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6387 && _libavcodec_so=yes
6388 elif cc_check -lavcodec $_ld_lm ; then
6389 _ld_extra="$_ld_extra -lavcodec"
6390 _libavcodec_so=yes
6391 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6394 _libavcodec=no
6395 _def_libavcodec='#undef USE_LIBAVCODEC'
6396 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6397 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6398 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6399 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6400 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6401 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6402 test "$_libavcodec_mpegaudio_hp" = yes \
6403 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6404 if test "$_libavcodec_a" = yes ; then
6405 _codecmodules="libavcodec $_codecmodules"
6406 elif test "$_libavcodec_so" = yes ; then
6407 _codecmodules="libavcodec.so $_codecmodules"
6408 else
6409 _nocodecmodules="libavcodec $_nocodecmodules"
6411 echores "$_libavcodec"
6413 echocheck "FFmpeg libavformat"
6414 if test "$_libavformat_a" = auto ; then
6415 _libavformat_a=no
6416 if test -d ffmpeg/libavformat && test -f ffmpeg/libavformat/utils.c ; then
6417 _libavformat_a=yes
6418 _res_comment="static"
6420 elif test "$_libavformat_so" = auto ; then
6421 _libavformat_so=no
6422 cat > $TMPC <<EOF
6423 #include <libavformat/avformat.h>
6424 #include <libavcodec/opt.h>
6425 int main(void) { av_alloc_format_context(); return 0; }
6427 if $_pkg_config --exists libavformat ; then
6428 _inc_libavformat=`$_pkg_config --cflags libavformat`
6429 _ld_tmp=`$_pkg_config --libs libavformat`
6430 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6431 && _libavformat_so=yes
6432 elif cc_check $_ld_lm -lavformat ; then
6433 _ld_extra="$_ld_extra -lavformat"
6434 _libavformat_so=yes
6435 _res_comment="using libavformat.so, but static libavformat is recommended"
6438 _libavformat=no
6439 _def_libavformat='#undef USE_LIBAVFORMAT'
6440 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6441 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6442 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6443 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6444 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6445 test "$_libavformat_so" = yes \
6446 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6447 echores "$_libavformat"
6449 echocheck "FFmpeg libpostproc"
6450 if test "$_libpostproc_a" = auto ; then
6451 _libpostproc_a=no
6452 if test -d ffmpeg/libpostproc && test -f ffmpeg/libpostproc/postprocess.h ; then
6453 _libpostproc_a='yes'
6454 _res_comment="static"
6456 elif test "$_libpostproc_so" = auto ; then
6457 _libpostproc_so=no
6458 cat > $TMPC << EOF
6459 #define USE_LIBPOSTPROC 1
6460 #include <inttypes.h>
6461 #include <libpostproc/postprocess.h>
6462 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6464 if cc_check -lpostproc $_ld_lm ; then
6465 _ld_extra="$_ld_extra -lpostproc"
6466 _libpostproc_so=yes
6467 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6470 _libpostproc=no
6471 _def_libpostproc='#undef USE_LIBPOSTPROC'
6472 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6473 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6474 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6475 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6476 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6477 test "$_libpostproc_so" = yes \
6478 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6479 echores "$_libpostproc"
6482 echocheck "libamr narrowband"
6483 if test "$_libamr_nb" = auto ; then
6484 _libamr_nb=no
6485 cat > $TMPC << EOF
6486 #include <amrnb/interf_dec.h>
6487 int main(void) { Speech_Decode_Frame_init(); return 0; }
6489 cc_check -lamrnb && _libamr_nb=yes
6490 if test "$_libavcodec_a" != yes ; then
6491 _libamr_nb=no
6492 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6495 if test "$_libamr_nb" = yes ; then
6496 _libamr=yes
6497 _ld_extra="$_ld_extra -lamrnb"
6498 _def_libamr='#define CONFIG_LIBAMR 1'
6499 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6500 _libavdecoders="$_libavdecoders LIBAMR_NB_DECODER"
6501 _libavencoders="$_libavencoders LIBAMR_NB_ENCODER"
6502 _codecmodules="libamr_nb $_codecmodules"
6503 else
6504 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6505 _nocodecmodules="libamr_nb $_nocodecmodules"
6507 echores "$_libamr_nb"
6510 echocheck "libamr wideband"
6511 if test "$_libamr_wb" = auto ; then
6512 _libamr_wb=no
6513 cat > $TMPC << EOF
6514 #include <amrwb/dec_if.h>
6515 int main(void) { D_IF_init(); return 0; }
6517 cc_check -lamrwb && _libamr_wb=yes
6518 if test "$_libavcodec_a" != yes ; then
6519 _libamr_wb=no
6520 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6523 if test "$_libamr_wb" = yes ; then
6524 _libamr=yes
6525 _ld_extra="$_ld_extra -lamrwb"
6526 _def_libamr='#define CONFIG_LIBAMR 1'
6527 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6528 _libavdecoders="$_libavdecoders LIBAMR_WB_DECODER"
6529 _libavencoders="$_libavencoders LIBAMR_WB_ENCODER"
6530 _codecmodules="libamr_wb $_codecmodules"
6531 else
6532 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6533 _nocodecmodules="libamr_wb $_nocodecmodules"
6535 echores "$_libamr_wb"
6537 echocheck "libdv-0.9.5+"
6538 if test "$_libdv" = auto ; then
6539 _libdv=no
6540 cat > $TMPC <<EOF
6541 #include <libdv/dv.h>
6542 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6544 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6546 if test "$_libdv" = yes ; then
6547 _def_libdv='#define HAVE_LIBDV095 1'
6548 _ld_extra="$_ld_extra -ldv"
6549 _codecmodules="libdv $_codecmodules"
6550 else
6551 _def_libdv='#undef HAVE_LIBDV095'
6552 _nocodecmodules="libdv $_nocodecmodules"
6554 echores "$_libdv"
6557 echocheck "Xvid"
6558 if test "$_xvid" = auto ; then
6559 _xvid=no
6560 cat > $TMPC << EOF
6561 #include <xvid.h>
6562 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6564 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6565 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6566 done
6569 if test "$_xvid" = yes ; then
6570 _def_xvid='#define HAVE_XVID4 1'
6571 _codecmodules="xvid $_codecmodules"
6572 else
6573 _def_xvid='#undef HAVE_XVID4'
6574 _nocodecmodules="xvid $_nocodecmodules"
6576 echores "$_xvid"
6578 echocheck "Xvid two pass plugin"
6579 if test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
6580 cat > $TMPC << EOF
6581 #include <xvid.h>
6582 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6584 cc_check && _xvid_lavc=yes
6586 if test "$_xvid_lavc" = yes ; then
6587 _def_xvid_lavc='#define CONFIG_LIBXVID 1'
6588 _libavencoders="$_libavencoders LIBXVID_ENCODER"
6589 else
6590 _xvid_lavc=no
6591 _def_xvid_lavc='#undef CONFIG_LIBXVID'
6593 echores "$_xvid_lavc"
6596 echocheck "x264"
6597 if test "$_x264" = auto ; then
6598 cat > $TMPC << EOF
6599 #include <inttypes.h>
6600 #include <x264.h>
6601 #if X264_BUILD < 59
6602 #error We do not support old versions of x264. Get the latest from SVN.
6603 #endif
6604 int main(void) { x264_encoder_open((void*)0); return 0; }
6606 _x264=no
6607 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6608 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6609 done
6612 if test "$_x264" = yes ; then
6613 _def_x264='#define HAVE_X264 1'
6614 _codecmodules="x264 $_codecmodules"
6615 test "$_x264_lavc" = auto && _x264_lavc=yes
6616 if test "$_x264_lavc" = yes ; then
6617 _def_x264_lavc='#define CONFIG_LIBX264 1'
6618 _libs_mplayer="$_libs_mplayer $_ld_x264"
6619 _libavencoders="$_libavencoders LIBX264_ENCODER"
6621 else
6622 _x264_lavc=no
6623 _def_x264='#undef HAVE_X264'
6624 _def_x264_lavc='#undef CONFIG_LIBX264'
6625 _nocodecmodules="x264 $_nocodecmodules"
6627 _res_comment="in libavcodec: $_x264_lavc"
6628 echores "$_x264"
6631 echocheck "libnut"
6632 if test "$_libnut" = auto ; then
6633 cat > $TMPC << EOF
6634 #include <stdio.h>
6635 #include <stdlib.h>
6636 #include <inttypes.h>
6637 #include <libnut.h>
6638 int main(void) { (void)nut_error(0); return 0; }
6640 _libnut=no
6641 cc_check -lnut && _libnut=yes
6644 if test "$_libnut" = yes ; then
6645 _def_libnut='#define HAVE_LIBNUT 1'
6646 _ld_extra="$_ld_extra -lnut"
6647 else
6648 _def_libnut='#undef HAVE_LIBNUT'
6650 echores "$_libnut"
6652 #check must be done after libavcodec one
6653 echocheck "zr"
6654 if test "$_zr" = auto ; then
6655 #36067's seem to identify themselves as 36057PQC's, so the line
6656 #below should work for 36067's and 36057's.
6657 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6658 _zr=yes
6659 else
6660 _zr=no
6663 if test "$_zr" = yes ; then
6664 if test "$_libavcodec_a" = yes ; then
6665 _def_zr='#define HAVE_ZR 1'
6666 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6667 _vomodules="zr zr2 $_vomodules"
6668 else
6669 _res_comment="libavcodec (static) is required by zr, sorry"
6670 _novomodules="zr $_novomodules"
6671 _def_zr='#undef HAVE_ZR'
6673 else
6674 _def_zr='#undef HAVE_ZR'
6675 _novomodules="zr zr2 $_novomodules"
6677 echores "$_zr"
6679 # mencoder requires (optional) those libs: libmp3lame
6680 if test "$_mencoder" != no ; then
6682 echocheck "libmp3lame (for mencoder)"
6683 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6684 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6685 if test "$_mp3lame" = auto ; then
6686 _mp3lame=no
6687 cat > $TMPC <<EOF
6688 #include <lame/lame.h>
6689 int main(void) { lame_version_t lv; (void) lame_init();
6690 get_lame_version_numerical(&lv); printf("%d%d\n",lv.major,lv.minor);
6691 return 0; }
6693 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6695 if test "$_mp3lame" = yes ; then
6696 _def_mp3lame="#define HAVE_MP3LAME"
6697 _ld_mp3lame=-lmp3lame
6698 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6699 cat > $TMPC << EOF
6700 #include <lame/lame.h>
6701 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6703 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6704 cat > $TMPC << EOF
6705 #include <lame/lame.h>
6706 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6708 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6709 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
6710 if test "$_mp3lame_lavc" = yes ; then
6711 _def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
6712 _libavencoders="$_libavencoders LIBMP3LAME_ENCODER"
6713 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6715 else
6716 _mp3lame_lavc=no
6717 _def_mp3lame='#undef HAVE_MP3LAME'
6718 _def_mp3lame_lavc="#undef CONFIG_LIBMP3LAME"
6720 _res_comment="in libavcodec: $_mp3lame_lavc"
6721 echores "$_mp3lame"
6725 echocheck "mencoder"
6726 _mencoder_flag='#undef HAVE_MENCODER'
6727 if test "$_mencoder" = yes ; then
6728 _mencoder_flag='#define HAVE_MENCODER'
6729 _def_muxers='#define CONFIG_MUXERS 1'
6730 else
6731 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6732 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6733 _libavmuxers=""
6735 echores "$_mencoder"
6737 echocheck "fastmemcpy"
6738 # fastmemcpy check is done earlier with tests of CPU & binutils features
6739 if test "$_fastmemcpy" = yes ; then
6740 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6741 else
6742 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6744 echores "$_fastmemcpy"
6747 echocheck "UnRAR executable"
6748 if test "$_unrar_exec" = auto ; then
6749 _unrar_exec="yes"
6750 mingw32 && _unrar_exec="no"
6752 if test "$_unrar_exec" = yes ; then
6753 _def_unrar_exec='#define USE_UNRAR_EXEC 1'
6754 else
6755 _def_unrar_exec='#undef USE_UNRAR_EXEC'
6757 echores "$_unrar_exec"
6759 echocheck "TV interface"
6760 if test "$_tv" = yes ; then
6761 _def_tv='#define USE_TV 1'
6762 _inputmodules="tv $_inputmodules"
6763 else
6764 _noinputmodules="tv $_noinputmodules"
6765 _def_tv='#undef USE_TV'
6767 echores "$_tv"
6770 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
6771 echocheck "*BSD BT848 bt8xx header"
6772 _ioctl_bt848_h=no
6773 for file in "machine/ioctl_bt848.h" \
6774 "dev/bktr/ioctl_bt848.h" \
6775 "dev/video/bktr/ioctl_bt848.h" \
6776 "dev/ic/bt8xx.h" ; do
6777 cat > $TMPC <<EOF
6778 #include <sys/types.h>
6779 #include <sys/ioctl.h>
6780 #include <$file>
6781 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
6783 if cc_check ; then
6784 _ioctl_bt848_h=yes
6785 _ioctl_bt848_h_name="$file"
6786 break;
6788 done
6789 if test "$_ioctl_bt848_h" = yes ; then
6790 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6791 _res_comment="using $_ioctl_bt848_h_name"
6792 else
6793 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6795 echores "$_ioctl_bt848_h"
6797 echocheck "*BSD ioctl_meteor.h"
6798 _ioctl_meteor_h=no
6799 for file in "machine/ioctl_meteor.h" \
6800 "dev/bktr/ioctl_meteor.h" \
6801 "dev/video/bktr/ioctl_meteor.h" ; do
6802 cat > $TMPC <<EOF
6803 #include <sys/types.h>
6804 #include <$file>
6805 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
6807 if cc_check ; then
6808 _ioctl_meteor_h=yes
6809 _ioctl_meteor_h_name="$file"
6810 break;
6812 done
6813 if test "$_ioctl_meteor_h" = yes ; then
6814 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6815 _res_comment="using $_ioctl_meteor_h_name"
6816 else
6817 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6819 echores "$_ioctl_meteor_h"
6821 echocheck "*BSD BrookTree 848 TV interface"
6822 if test "$_tv_bsdbt848" = auto ; then
6823 _tv_bsdbt848=no
6824 if test "$_tv" = yes ; then
6825 cat > $TMPC <<EOF
6826 #include <sys/types.h>
6827 $_def_ioctl_meteor_h_name
6828 $_def_ioctl_bt848_h_name
6829 #ifdef IOCTL_METEOR_H_NAME
6830 #include IOCTL_METEOR_H_NAME
6831 #endif
6832 #ifdef IOCTL_BT848_H_NAME
6833 #include IOCTL_BT848_H_NAME
6834 #endif
6835 int main(void) {
6836 ioctl(0, METEORSINPUT, 0);
6837 ioctl(0, TVTUNER_GETFREQ, 0);
6838 return 0;
6841 cc_check && _tv_bsdbt848=yes
6844 if test "$_tv_bsdbt848" = yes ; then
6845 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6846 _inputmodules="tv-bsdbt848 $_inputmodules"
6847 else
6848 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6849 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6851 echores "$_tv_bsdbt848"
6852 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
6855 echocheck "DirectShow TV interface"
6856 if test "$_tv_dshow" = auto ; then
6857 _tv_dshow=no
6858 if test "$_tv" = yes && win32 ; then
6859 cat > $TMPC <<EOF
6860 #include <ole2.h>
6861 int main(void) {
6862 void* p;
6863 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6864 return 0;
6867 cc_check -lole32 -luuid && _tv_dshow=yes
6870 if test "$_tv_dshow" = yes ; then
6871 _inputmodules="tv-dshow $_inputmodules"
6872 _def_tv_dshow='#define HAVE_TV_DSHOW 1'
6873 _ld_extra="$_ld_extra -lole32 -luuid"
6874 else
6875 _noinputmodules="tv-dshow $_noinputmodules"
6876 _def_tv_dshow='#undef HAVE_TV_DSHOW'
6878 echores "$_tv_dshow"
6881 echocheck "Video 4 Linux TV interface"
6882 if test "$_tv_v4l1" = auto ; then
6883 _tv_v4l1=no
6884 if test "$_tv" = yes && linux ; then
6885 cat > $TMPC <<EOF
6886 #include <stdlib.h>
6887 #include <linux/videodev.h>
6888 int main(void) { return 0; }
6890 cc_check && _tv_v4l1=yes
6893 if test "$_tv_v4l1" = yes ; then
6894 _audio_input=yes
6895 _tv_v4l=yes
6896 _def_tv_v4l='#define HAVE_TV_V4L 1'
6897 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6898 _inputmodules="tv-v4l $_inputmodules"
6899 else
6900 _noinputmodules="tv-v4l1 $_noinputmodules"
6901 _def_tv_v4l='#undef HAVE_TV_V4L'
6903 echores "$_tv_v4l1"
6906 echocheck "Video 4 Linux 2 TV interface"
6907 if test "$_tv_v4l2" = auto ; then
6908 _tv_v4l2=no
6909 if test "$_tv" = yes && linux ; then
6910 cat > $TMPC <<EOF
6911 #include <stdlib.h>
6912 #include <linux/types.h>
6913 #include <linux/videodev2.h>
6914 int main(void) { return 0; }
6916 cc_check && _tv_v4l2=yes
6919 if test "$_tv_v4l2" = yes ; then
6920 _audio_input=yes
6921 _tv_v4l=yes
6922 _def_tv_v4l='#define HAVE_TV_V4L 1'
6923 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6924 _inputmodules="tv-v4l2 $_inputmodules"
6925 else
6926 _noinputmodules="tv-v4l2 $_noinputmodules"
6927 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6929 echores "$_tv_v4l2"
6932 echocheck "TV teletext interface"
6933 if test "$_tv_teletext" = auto ; then
6934 _tv_teletext=no
6935 if test "$_freetype" = yes && test "$_pthreads" = yes; then
6936 if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes; then
6937 _tv_teletext=yes
6941 if test "$_tv_teletext" = yes ; then
6942 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6943 _inputmodules="tv-teletext $_inputmodules"
6944 else
6945 _noinputmodules="tv-teletext $_noinputmodules"
6946 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6948 echores "$_tv_teletext"
6951 echocheck "Radio interface"
6952 if test "$_radio" = yes ; then
6953 _def_radio='#define USE_RADIO 1'
6954 _inputmodules="radio $_inputmodules"
6955 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6956 _radio_capture=no
6958 if test "$_radio_capture" = yes ; then
6959 _audio_input=yes
6960 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6961 else
6962 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6964 else
6965 _noinputmodules="radio $_noinputmodules"
6966 _def_radio='#undef USE_RADIO'
6967 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6968 _radio_capture=no
6970 echores "$_radio"
6971 echocheck "Capture for Radio interface"
6972 echores "$_radio_capture"
6974 echocheck "Video 4 Linux 2 Radio interface"
6975 if test "$_radio_v4l2" = auto ; then
6976 _radio_v4l2=no
6977 if test "$_radio" = yes && linux ; then
6978 cat > $TMPC <<EOF
6979 #include <stdlib.h>
6980 #include <linux/types.h>
6981 #include <linux/videodev2.h>
6982 int main(void) { return 0; }
6984 cc_check && _radio_v4l2=yes
6987 if test "$_radio_v4l2" = yes ; then
6988 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6989 else
6990 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6992 echores "$_radio_v4l2"
6994 echocheck "Video 4 Linux Radio interface"
6995 if test "$_radio_v4l" = auto ; then
6996 _radio_v4l=no
6997 if test "$_radio" = yes && linux ; then
6998 cat > $TMPC <<EOF
6999 #include <stdlib.h>
7000 #include <linux/videodev.h>
7001 int main(void) { return 0; }
7003 cc_check && _radio_v4l=yes
7006 if test "$_radio_v4l" = yes ; then
7007 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
7008 else
7009 _def_radio_v4l='#undef HAVE_RADIO_V4L'
7011 echores "$_radio_v4l"
7013 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7014 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7015 echocheck "*BSD BrookTree 848 Radio interface"
7016 _radio_bsdbt848=no
7017 cat > $TMPC <<EOF
7018 #include <sys/types.h>
7019 $_def_ioctl_bt848_h_name
7020 #ifdef IOCTL_BT848_H_NAME
7021 #include IOCTL_BT848_H_NAME
7022 #endif
7023 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7025 cc_check && _radio_bsdbt848=yes
7026 echores "$_radio_bsdbt848"
7027 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7029 if test "$_radio_bsdbt848" = yes ; then
7030 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
7031 else
7032 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
7035 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7036 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7037 die "Radio driver requires BSD BT848, V4L or V4L2!"
7040 echocheck "Video 4 Linux 2 MPEG PVR interface"
7041 if test "$_pvr" = auto ; then
7042 _pvr=no
7043 if test "$_tv_v4l2" = yes && linux ; then
7044 cat > $TMPC <<EOF
7045 #include <stdlib.h>
7046 #include <inttypes.h>
7047 #include <linux/types.h>
7048 #include <linux/videodev2.h>
7049 int main(void) { struct v4l2_ext_controls ext; return 0; }
7051 cc_check && _pvr=yes
7054 if test "$_pvr" = yes ; then
7055 _def_pvr='#define HAVE_PVR 1'
7056 _inputmodules="pvr $_inputmodules"
7057 else
7058 _noinputmodules="pvr $_noinputmodules"
7059 _def_pvr='#undef HAVE_PVR'
7061 echores "$_pvr"
7064 echocheck "audio select()"
7065 if test "$_select" = no ; then
7066 _def_select='#undef HAVE_AUDIO_SELECT'
7067 elif test "$_select" = yes ; then
7068 _def_select='#define HAVE_AUDIO_SELECT 1'
7070 echores "$_select"
7073 echocheck "ftp"
7074 if ! beos && test "$_ftp" = yes ; then
7075 _def_ftp='#define HAVE_FTP 1'
7076 _inputmodules="ftp $_inputmodules"
7077 else
7078 _noinputmodules="ftp $_noinputmodules"
7079 _def_ftp='#undef HAVE_FTP'
7081 echores "$_ftp"
7083 echocheck "vstream client"
7084 if test "$_vstream" = auto ; then
7085 _vstream=no
7086 cat > $TMPC <<EOF
7087 #include <vstream-client.h>
7088 void vstream_error(const char *format, ... ) {}
7089 int main(void) { vstream_start(); return 0; }
7091 cc_check -lvstream-client && _vstream=yes
7093 if test "$_vstream" = yes ; then
7094 _def_vstream='#define HAVE_VSTREAM 1'
7095 _inputmodules="vstream $_inputmodules"
7096 _ld_extra="$_ld_extra -lvstream-client"
7097 else
7098 _noinputmodules="vstream $_noinputmodules"
7099 _def_vstream='#undef HAVE_VSTREAM'
7101 echores "$_vstream"
7103 # endian testing
7104 echocheck "byte order"
7105 if test "$_big_endian" = auto ; then
7106 cat > $TMPC <<EOF
7107 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7108 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7109 int main(void) { return (int)ascii_name; }
7111 if cc_check ; then
7112 if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
7113 _big_endian=yes
7114 else
7115 _big_endian=no
7117 else
7118 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7121 if test "$_big_endian" = yes ; then
7122 _byte_order='big-endian'
7123 _def_words_endian='#define WORDS_BIGENDIAN 1'
7124 else
7125 _byte_order='little-endian'
7126 _def_words_endian='#undef WORDS_BIGENDIAN'
7128 echores "$_byte_order"
7130 echocheck "OSD menu"
7131 if test "$_menu" = yes ; then
7132 _def_menu='#define HAVE_MENU 1'
7133 test $_dvbin = "yes" && _menu_dvbin=yes
7134 else
7135 _def_menu='#undef HAVE_MENU'
7136 _menu_dvbin=no
7138 echores "$_menu"
7141 echocheck "Subtitles sorting"
7142 if test "$_sortsub" = yes ; then
7143 _def_sortsub='#define USE_SORTSUB 1'
7144 else
7145 _def_sortsub='#undef USE_SORTSUB'
7147 echores "$_sortsub"
7150 echocheck "XMMS inputplugin support"
7151 if test "$_xmms" = yes ; then
7152 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7153 _xmmsplugindir=`xmms-config --input-plugin-dir`
7154 _xmmslibdir=`xmms-config --exec-prefix`/lib
7155 else
7156 _xmmsplugindir=/usr/lib/xmms/Input
7157 _xmmslibdir=/usr/lib
7160 _def_xmms='#define HAVE_XMMS 1'
7161 if darwin ; then
7162 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7163 else
7164 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7166 else
7167 _def_xmms='#undef HAVE_XMMS'
7169 echores "$_xmms"
7171 echocheck "inet6"
7172 if test "$_inet6" = auto ; then
7173 cat > $TMPC << EOF
7174 #include <sys/types.h>
7175 #if !defined(_WIN32) || defined(__CYGWIN__)
7176 #include <sys/socket.h>
7177 #include <netinet/in.h>
7178 #else
7179 #include <ws2tcpip.h>
7180 #endif
7181 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7183 _inet6=no
7184 if cc_check $_ld_sock ; then
7185 _inet6=yes
7188 if test "$_inet6" = yes ; then
7189 _def_inet6='#define HAVE_AF_INET6 1'
7190 else
7191 _def_inet6='#undef HAVE_AF_INET6'
7193 echores "$_inet6"
7196 echocheck "gethostbyname2"
7197 if test "$_gethostbyname2" = auto ; then
7198 cat > $TMPC << EOF
7199 #include <sys/types.h>
7200 #include <sys/socket.h>
7201 #include <netdb.h>
7202 int main(void) { gethostbyname2("", AF_INET); }
7204 _gethostbyname2=no
7205 if cc_check ; then
7206 _gethostbyname2=yes
7210 if test "$_gethostbyname2" = yes ; then
7211 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7212 else
7213 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7215 echores "$_gethostbyname2"
7218 # --------------- GUI specific tests begin -------------------
7219 echocheck "GUI"
7220 echo "$_gui"
7221 if test "$_gui" = yes ; then
7223 # Required libraries
7224 if test "$_libavcodec" != yes ||
7225 ! echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1 ; then
7226 die "The GUI requires libavcodec with PNG support (needs zlib)."
7228 test "$_freetype" = no && test "$_bitmap_font" = no && \
7229 die "The GUI requires either FreeType or bitmap font support."
7230 if ! win32 ; then
7231 _gui_gtk=yes
7232 test "$_x11" != yes && die "X11 support required for GUI compilation."
7234 echocheck "XShape extension"
7235 if test "$_xshape" = auto ; then
7236 _xshape=no
7237 cat > $TMPC << EOF
7238 #include <X11/Xlib.h>
7239 #include <X11/Xproto.h>
7240 #include <X11/Xutil.h>
7241 #include <X11/extensions/shape.h>
7242 #include <stdlib.h>
7243 int main(void) {
7244 char *name = ":0.0";
7245 Display *wsDisplay;
7246 int exitvar = 0;
7247 int eventbase, errorbase;
7248 if (getenv("DISPLAY"))
7249 name=getenv("DISPLAY");
7250 wsDisplay=XOpenDisplay(name);
7251 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7252 exitvar=1;
7253 XCloseDisplay(wsDisplay);
7254 return exitvar;
7257 cc_check -lXext && _xshape=yes
7259 if test "$_xshape" = yes ; then
7260 _def_xshape='#define HAVE_XSHAPE 1'
7261 else
7262 die "The GUI requires the X11 extension XShape (which was not found)."
7264 echores "$_xshape"
7266 #Check for GTK
7267 if test "$_gtk1" = no ; then
7268 #Check for GTK2 :
7269 echocheck "GTK+ version"
7271 if $_pkg_config gtk+-2.0 --exists ; then
7272 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7273 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7274 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7275 echores "$_gtk"
7277 # Check for GLIB2
7278 if $_pkg_config glib-2.0 --exists ; then
7279 echocheck "glib version"
7280 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7281 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7282 echores "$_glib"
7284 _def_gui='#define HAVE_NEW_GUI 1'
7285 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7286 else
7287 _gtk1=yes
7288 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7290 else
7291 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7292 _gtk1=yes
7296 if test "$_gtk1" = yes ; then
7297 # Check for old GTK (1.2.x)
7298 echocheck "GTK version"
7299 if test -z "$_gtkconfig" ; then
7300 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7301 _gtkconfig="gtk-config"
7302 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7303 _gtkconfig="gtk12-config"
7304 else
7305 die "The GUI requires GTK devel packages (which were not found)."
7308 _gtk=`$_gtkconfig --version 2>&1`
7309 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7310 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7311 echores "$_gtk (using $_gtkconfig)"
7313 # Check for GLIB
7314 echocheck "glib version"
7315 if test -z "$_glibconfig" ; then
7316 if ( glib-config --version ) >/dev/null 2>&1 ; then
7317 _glibconfig="glib-config"
7318 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7319 _glibconfig="glib12-config"
7320 else
7321 die "The GUI requires GLIB devel packages (which were not found)"
7324 _glib=`$_glibconfig --version 2>&1`
7325 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7326 echores "$_glib (using $_glibconfig)"
7328 _def_gui='#define HAVE_NEW_GUI 1'
7329 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7332 else #if ! win32
7333 _gui_win32=yes
7334 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7335 _def_gui='#define HAVE_NEW_GUI 1'
7336 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7337 fi #if ! win32
7339 else #if test "$_gui"
7340 _def_gui='#undef HAVE_NEW_GUI'
7341 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7342 fi #if test "$_gui"
7343 # --------------- GUI specific tests end -------------------
7346 if test "$_charset" = "noconv" ; then
7347 _charset=""
7349 if test "$_charset" ; then
7350 _def_charset="#define MSG_CHARSET \"$_charset\""
7351 else
7352 _def_charset="#undef MSG_CHARSET"
7355 if test "$_charset" != "UTF-8" ; then
7356 echocheck "iconv program"
7357 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7358 if test "$?" -ne 0 ; then
7359 echores "no"
7360 echo "No working iconv program found, use "
7361 echo "--charset=UTF-8 to continue anyway."
7362 echo "If you also have problems with iconv library functions use --charset=noconv."
7363 echo "Messages in the GTK-2 interface will be broken then."
7364 exit 1
7365 else
7366 echores "yes"
7370 #############################################################################
7372 echocheck "automatic gdb attach"
7373 if test "$_crash_debug" = yes ; then
7374 _def_crash_debug='#define CRASH_DEBUG 1'
7375 else
7376 _def_crash_debug='#undef CRASH_DEBUG'
7377 _crash_debug=no
7379 echores "$_crash_debug"
7381 echocheck "compiler support for noexecstack"
7382 cat > $TMPC <<EOF
7383 int main(void) { return 0; }
7385 if cc_check -Wl,-z,noexecstack ; then
7386 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7387 echores "yes"
7388 else
7389 echores "no"
7393 # Dynamic linking flags
7394 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7395 _ld_dl_dynamic=''
7396 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
7397 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 ; then
7398 _ld_dl_dynamic='-rdynamic'
7401 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7402 bsdos && _ld_extra="$_ld_extra -ldvd"
7403 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7404 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7406 _def_debug='#undef MP_DEBUG'
7407 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7410 echocheck "joystick"
7411 _def_joystick='#undef HAVE_JOYSTICK'
7412 if test "$_joystick" = yes ; then
7413 if linux ; then
7414 # TODO add some check
7415 _def_joystick='#define HAVE_JOYSTICK 1'
7416 else
7417 _joystick="no"
7418 _res_comment="unsupported under $system_name"
7421 echores "$_joystick"
7423 echocheck "lirc"
7424 if test "$_lirc" = auto ; then
7425 _lirc=no
7426 cat > $TMPC <<EOF
7427 #include <lirc/lirc_client.h>
7428 int main(void) { return 0; }
7430 cc_check -llirc_client && _lirc=yes
7432 if test "$_lirc" = yes ; then
7433 _def_lirc='#define HAVE_LIRC 1'
7434 _ld_extra="$_ld_extra -llirc_client"
7435 else
7436 _def_lirc='#undef HAVE_LIRC'
7438 echores "$_lirc"
7440 echocheck "lircc"
7441 if test "$_lircc" = auto ; then
7442 _lircc=no
7443 cat > $TMPC <<EOF
7444 #include <lirc/lircc.h>
7445 int main(void) { return 0; }
7447 cc_check -llircc && _lircc=yes
7449 if test "$_lircc" = yes ; then
7450 _def_lircc='#define HAVE_LIRCC 1'
7451 _ld_extra="$_ld_extra -llircc"
7452 else
7453 _def_lircc='#undef HAVE_LIRCC'
7455 echores "$_lircc"
7457 if arm; then
7458 # Detect maemo development platform libraries availability (http://www.maemo.org),
7459 # they are used when run on Nokia 770
7460 echocheck "maemo (Nokia 770)"
7461 if test "$_maemo" = auto ; then
7462 _maemo=no
7463 cat > $TMPC << EOF
7464 #include <libosso.h>
7465 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7467 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7469 if test "$_maemo" = yes ; then
7470 _def_maemo='#define HAVE_MAEMO 1'
7471 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7472 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7473 else
7474 _def_maemo='#undef HAVE_MAEMO'
7476 echores "$_maemo"
7479 # linker paths should be the same for mencoder and mplayer
7480 _ld_tmp=""
7481 for I in $_libs_mplayer ; do
7482 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7483 if test -z "$_tmp" ; then
7484 _ld_extra="$I $_ld_extra"
7485 else
7486 _ld_tmp="$_ld_tmp $I"
7488 done
7489 _libs_mplayer=$_ld_tmp
7492 #############################################################################
7493 if darwin ; then
7494 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
7495 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7496 CFLAGS="$CFLAGS -no-cpp-precomp"
7499 if amigaos ; then
7500 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__"
7502 if hpux ; then
7503 # use flag for HPUX missing setenv()
7504 CFLAGS="$CFLAGS -DHPUX"
7506 # Thread support
7507 if linux ; then
7508 CFLAGS="$CFLAGS -D_REENTRANT"
7509 elif freebsd || netbsd || openbsd || bsdos ; then
7510 # FIXME bsd needs this so maybe other OS'es
7511 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7513 if cygwin ; then
7514 CFLAGS="$CFLAGS -D__CYGWIN__"
7516 if os2 ; then
7517 CFLAGS="$CFLAGS -Zomf"
7518 ASFLAGS="$ASFLAGS -Zomf"
7520 # 64 bit file offsets?
7521 if test "$_largefiles" = yes || freebsd ; then
7522 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7523 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7524 # dvdread support requires this (for off64_t)
7525 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7526 cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
7527 beos && CFLAGS="$CFLAGS -DSYS_BEOS"
7528 os2 && CFLAGS="$CFLAGS -DSYS_OS2"
7532 # Make sure config.h gets included.
7533 if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then
7534 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
7537 cat > $TMPC << EOF
7538 int main(void) { return 0; }
7540 if test "$cc_vendor" = "gnu" ; then
7541 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
7542 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7543 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7546 CFLAGS_FFMPEG="-I../.. $CFLAGS"
7547 CFLAGS="-I. -Iffmpeg $CFLAGS"
7548 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7550 cc_check -mno-omit-leaf-frame-pointer && CFLAG_NO_OMIT_LEAF_FRAME_POINTER="-mno-omit-leaf-frame-pointer"
7552 #this must be the last test to be performed or the ones following it will likely fail
7553 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7554 # to use its own copy of the library)
7555 echocheck "DVD support (libdvdnav)"
7556 if test "$_dvdnav" = auto ; then
7557 if test "$_dvdread_internal" = yes ; then
7558 _dvdnav=no
7559 _res_comment="Disabled in favor of the internal copy of dvdread. Append --disable-dvdread-internal."
7560 else
7561 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7564 if test "$_dvdnav" = auto ; then
7565 cat > $TMPC <<EOF
7566 #include <inttypes.h>
7567 #include <dvdnav/dvdnav.h>
7568 int main(void) { dvdnav_t *dvd=0; return 0; }
7570 _dvdnav=no
7571 _dvdnavdir=`$_dvdnavconfig --cflags`
7572 _dvdnavlibs=`$_dvdnavconfig --libs`
7573 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7575 if test "$_dvdnav" = yes ; then
7576 _largefiles=yes
7577 _def_dvdnav='#define USE_DVDNAV 1'
7578 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7579 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7580 _inputmodules="dvdnav $_inputmodules"
7581 else
7582 _def_dvdnav='#undef USE_DVDNAV'
7583 _noinputmodules="dvdnav $_noinputmodules"
7585 echores "$_dvdnav"
7587 #############################################################################
7588 echo "Creating config.mak"
7589 cat > config.mak << EOF
7590 # -------- Generated by configure -----------
7592 # Ensure that locale settings do not interfere with shell commands.
7593 export LC_ALL = C
7595 MAN_LANG = $MAN_LANG
7596 MAN_LANG_ALL = $MAN_LANG_ALL
7598 DESTDIR =
7599 prefix = \$(DESTDIR)$_prefix
7600 BINDIR = \$(DESTDIR)$_bindir
7601 DATADIR = \$(DESTDIR)$_datadir
7602 MANDIR = \$(DESTDIR)$_mandir
7603 CONFDIR = \$(DESTDIR)$_confdir
7604 LIBDIR = \$(DESTDIR)$_libdir
7606 AR = $_ar
7607 CC = $_cc
7608 CXX = $_cc
7609 HOST_CC = $_host_cc
7610 RANLIB = $_ranlib
7611 WINDRES = $_windres
7612 INSTALL = $_install
7613 INSTALLSTRIP = $_install_strip
7615 EXTRA_INC = $_inc_extra
7616 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7617 CFLAGS = $CFLAGS \$(EXTRA_INC)
7618 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7619 FFMPEG_OFLAGS = $CFLAGS_FFMPEG \$(EXTRA_INC)
7620 CFLAG_NO_OMIT_LEAF_FRAME_POINTER = $CFLAG_NO_OMIT_LEAF_FRAME_POINTER
7621 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7622 CFLAG_STACKREALIGN = $_stackrealign
7623 LIBDVDCSS_DVDREAD_FLAGS = $_libdvdcss_dvdread_flags
7624 CFLAG_DHAHELPER = $cflag_dhahelper
7625 CFLAG_SVGALIB_HELPER = $cflag_svgalib_helper
7626 ASFLAGS = $ASFLAGS
7628 EXTRALIBS = $_extra_libs
7629 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7630 EXTRALIBS_MPLAYER = $_libs_mplayer
7631 EXTRALIBS_MENCODER = $_libs_mencoder
7633 CHARSET = $_charset
7634 HELP_FILE = $_mp_help
7636 EXESUF = $_exesuf
7638 $_target_arch
7639 $_target_arch_x86
7640 `echo $_cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/'`
7642 GETCH = $_getch
7643 TIMER = $_timer
7645 AO_SRCS = $_aosrc
7646 VO_SRCS = $_vosrc
7648 MENCODER = $_mencoder
7649 MPLAYER = $_mplayer
7651 #internal libraries
7652 LIBA52 = $_liba52
7653 LIBMPEG2 = $_libmpeg2
7654 MP3LIB = $_mp3lib
7655 TREMOR_INTERNAL = $_tremor_internal
7656 TREMOR_LOW = $_tremor_low
7658 HAVE_SYS_MMAN_H = $_mman
7659 HAVE_POSIX_SELECT = $_posix_select
7661 NEED_GETTIMEOFDAY = $_need_gettimeofday
7662 NEED_GLOB = $_need_glob
7663 NEED_MMAP = $_need_mmap
7664 NEED_SETENV = $_need_setenv
7665 NEED_SHMEM = $_need_shmem
7666 NEED_STRSEP = $_need_strsep
7667 NEED_SWAB = $_need_swab
7668 NEED_VSSCANF = $_need_vsscanf
7670 # audio output
7671 OSS = $_ossaudio
7672 ALSA9 = $_alsa9
7673 ALSA1X = $_alsa1x
7675 # features
7676 APPLE_IR = $_apple_ir
7677 APPLE_REMOTE = $_apple_remote
7678 AUDIO_INPUT = $_audio_input
7679 BITMAP_FONT = $_bitmap_font
7680 CDDA = $_cdda
7681 CDDB = $_cddb
7682 COREAUDIO = $_coreaudio
7683 COREVIDEO = $_corevideo
7684 DVBIN = $_dvbin
7685 DVDNAV = $_dvdnav
7686 DVDREAD = $_dvdread
7687 DVDREAD_INTERNAL = $_dvdread_internal
7688 FAAC=$_faac
7689 FAAD = $_faad
7690 FAAD_INTERNAL = $_faad_internal
7691 FREETYPE = $_freetype
7692 FTP = $_ftp
7693 GIF = $_gif
7694 GUI = $_gui
7695 GUI_GTK = $_gui_gtk
7696 GUI_WIN32 = $_gui_win32
7697 JOYSTICK = $_joystick
7698 JPEG = $_jpeg
7699 LADSPA = $_ladspa
7700 LIBASS = $_ass
7701 LIBDCA = $_libdca
7702 LIBDV = $_libdv
7703 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7704 LIBLZO = $_liblzo
7705 LIBMAD = $_mad
7706 LIBMENU = $_menu
7707 LIBMENU_DVBIN = $_menu_dvbin
7708 LIBNEMESI = $_nemesi
7709 LIBNUT = $_libnut
7710 LIBSMBCLIENT = $_smbsupport
7711 LIBTHEORA = $_theora
7712 LIBVORBIS = $_vorbis
7713 LIRC = $_lirc
7714 MACOSX_BUNDLE = $_macosx_bundle
7715 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7716 MP3LAME = $_mp3lame
7717 MPLAYER_NETWORK = $_network
7718 MUSEPACK = $_musepack
7719 NATIVE_RTSP = $_native_rtsp
7720 PE_EXECUTABLE = $_pe_executable
7721 PNG = $_png
7722 PVR = $_pvr
7723 QTX_CODECS = $_qtx
7724 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7725 QTX_EMULATION = $_qtx_emulation
7726 QUARTZ = $_quartz
7727 RADIO=$_radio
7728 RADIO_CAPTURE=$_radio_capture
7729 REAL_CODECS = $_real
7730 SPEEX = $_speex
7731 STREAMING_LIVE555 = $_live
7732 STREAM_CACHE = $_stream_cache
7733 TOOLAME=$_toolame
7734 TV = $_tv
7735 TV_BSDBT848 = $_tv_bsdbt848
7736 TV_DSHOW = $_tv_dshow
7737 TV_TELETEXT = $_tv_teletext
7738 TV_V4L = $_tv_v4l
7739 TV_V4L1 = $_tv_v4l1
7740 TV_V4L2 = $_tv_v4l2
7741 TWOLAME=$_twolame
7742 UNRAR_EXEC = $_unrar_exec
7743 VCD = $_vcd
7744 VIDIX = $_vidix
7745 VIDIX_PCIDB = $_vidix_pcidb_val
7746 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7747 VIDIX_IVTV=$_vidix_drv_ivtv
7748 VIDIX_MACH64=$_vidix_drv_mach64
7749 VIDIX_MGA=$_vidix_drv_mga
7750 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7751 VIDIX_NVIDIA=$_vidix_drv_nvidia
7752 VIDIX_PM2=$_vidix_drv_pm2
7753 VIDIX_PM3=$_vidix_drv_pm3
7754 VIDIX_RADEON=$_vidix_drv_radeon
7755 VIDIX_RAGE128=$_vidix_drv_rage128
7756 VIDIX_S3=$_vidix_drv_s3
7757 VIDIX_SIS=$_vidix_drv_sis
7758 VIDIX_UNICHROME=$_vidix_drv_unichrome
7759 VSTREAM = $_vstream
7760 WIN32DLL = $_win32dll
7761 WIN32_EMULATION = $_win32_emulation
7762 X264 = $_x264
7763 XANIM_CODECS = $_xanim
7764 XMMS_PLUGINS = $_xmms
7765 XVID4 = $_xvid
7766 ZORAN = $_zr
7768 # FFmpeg
7769 LIBAVUTIL = $_libavutil
7770 LIBAVUTIL_A = $_libavutil_a
7771 LIBAVUTIL_SO = $_libavutil_so
7772 LIBAVCODEC = $_libavcodec
7773 LIBAVCODEC_A = $_libavcodec_a
7774 LIBAVCODEC_SO = $_libavcodec_so
7775 LIBAVFORMAT = $_libavformat
7776 LIBAVFORMAT_A = $_libavformat_a
7777 LIBAVFORMAT_SO = $_libavformat_so
7778 LIBPOSTPROC = $_libpostproc
7779 LIBPOSTPROC_A = $_libpostproc_a
7780 LIBPOSTPROC_SO = $_libpostproc_so
7782 BUILD_STATIC=yes
7783 SRC_PATH=..
7784 BUILD_ROOT=..
7785 LIBPREF=lib
7786 LIBSUF=.a
7787 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7789 CONFIG_ENCODERS=yes
7790 CONFIG_GPL=yes
7791 CONFIG_MUXERS=$_mencoder
7792 CONFIG_LIBAMR=$_libamr
7793 CONFIG_LIBAMR_NB=$_libamr_nb
7794 CONFIG_LIBAMR_WB=$_libamr_wb
7795 CONFIG_LIBFAAC=$_faac_lavc
7796 CONFIG_LIBMP3LAME=$_mp3lame_lavc
7797 CONFIG_LIBVORBIS=$_libvorbis
7798 CONFIG_LIBX264=$_x264_lavc
7799 CONFIG_LIBXVID=$_xvid_lavc
7800 CONFIG_MLIB = $_mlib
7801 CONFIG_POSTPROC = yes
7802 # Prevent building libavcodec/imgresample.c with conflicting symbols
7803 CONFIG_SWSCALE=yes
7804 CONFIG_ZLIB=$_zlib
7806 HAVE_PTHREADS = $_pthreads
7807 HAVE_W32THREADS = $_w32threads
7808 HAVE_XVMC = $_xvmc
7810 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7811 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7812 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7813 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7814 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7815 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7817 DEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,\$^) | sed "s,[0-9a-z._-]*: \(\$(SRC_DIR)/\)*\([a-z0-9]*/\)[^/]* ,\\2&,"
7819 MPDEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,$^) | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &,"
7820 MPDEPEND_CMD_CXX = \$(CC) -MM \$(CXXFLAGS) \$(filter-out %.h,$^) | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &,"
7824 #############################################################################
7826 ff_config_enable () {
7827 _nprefix=$3;
7828 test -z "$_nprefix" && _nprefix='CONFIG'
7829 for part in $1; do
7830 if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
7831 echo "#define ${_nprefix}_$part 1"
7832 echo "#define ENABLE_$part 1"
7833 else
7834 echo "#define ENABLE_$part 0"
7836 done
7839 echo "Creating config.h"
7840 cat > $TMPH << EOF
7841 /* -------- This file has been automatically generated by configure ---------
7842 Note: Any changes in it will be lost when you run configure again. */
7844 /* Protect against multiple inclusion */
7845 #ifndef MPLAYER_CONFIG_H
7846 #define MPLAYER_CONFIG_H
7848 #define CONFIGURATION "$_configuration"
7850 /* make sure we never get lavformat's poll() emulation, the results are
7851 horrible if the X libs try to actually use it, see MPlayer-users
7852 Message-ID: <45D49541.8060101@infernix.net>
7853 Date: Thu, 15 Feb 2007 18:15:45 +0100
7854 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7856 #define HAVE_SYS_POLL_H 1
7858 /* yes, we have inttypes.h */
7859 #define HAVE_INTTYPES_H 1
7861 /* int_fastXY_t emulation */
7862 $_def_fast_inttypes
7864 /* libdvdcss */
7865 #define HAVE_ERRNO_H 1
7867 /* libdvdcss + libdvdread */
7868 #define HAVE_LIMITS_H 1
7870 /* libdvdcss + libfaad2 */
7871 #define HAVE_UNISTD_H 1
7873 /* libfaad2 + libdvdread */
7874 #define STDC_HEADERS 1
7876 /* libfaad2 */
7877 #define HAVE_MEMCPY 1
7878 #define HAVE_STRCHR 1
7880 /* libdvdread */
7881 #define HAVE_UINTPTR_T 1
7883 /* name of messages charset */
7884 $_def_charset
7886 /* Runtime CPU detection */
7887 $_def_runtime_cpudetection
7889 /* Dynamic a/v plugins */
7890 $_def_dynamic_plugins
7892 /* "restrict" keyword */
7893 $_def_restrict_keyword
7895 /* __builtin_expect branch prediction hint */
7896 $_def_builtin_expect
7897 #ifdef HAVE_BUILTIN_EXPECT
7898 #define likely(x) __builtin_expect ((x) != 0, 1)
7899 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7900 #else
7901 #define likely(x) (x)
7902 #define unlikely(x) (x)
7903 #endif
7905 /* attribute(used) as needed by some compilers */
7906 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7907 # define attribute_used __attribute__((used))
7908 #else
7909 # define attribute_used
7910 #endif
7912 /* extern symbol prefix */
7913 $_def_extern_prefix
7915 /* compiler support for named assembler arguments */
7916 $_def_named_asm_args
7918 /* enable/disable SIGHANDLER */
7919 $_def_sighandler
7921 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7922 $_def_crash_debug
7924 /* Toggles debugging informations */
7925 $_def_debug
7927 /* Indicates that libcdio is available for VCD and CD-DA playback */
7928 $_def_libcdio
7930 /* Indicates that Ogle's libdvdread is available for DVD playback */
7931 $_def_dvdread
7933 /* Indicates that dvdread is internal */
7934 $_def_dvdread_internal
7936 /* Additional options for libdvdread/libdvdcss */
7937 $_def_dvd
7938 $_def_cdrom
7939 $_def_cdio
7940 $_def_dvdio
7941 $_def_bsdi_dvd
7942 $_def_dvd_bsd
7943 $_def_dvd_linux
7944 $_dev_dvd_openbsd
7945 $_def_dvd_darwin
7946 $_def_sol_scsi_h
7947 $_def_hpux_scsi_h
7949 /* Common data directory (for fonts, etc) */
7950 #define MPLAYER_DATADIR "$_datadir"
7951 #define MPLAYER_CONFDIR "$_confdir"
7952 #define MPLAYER_LIBDIR "$_libdir"
7954 /* Define this to compile stream-caching support, it can be enabled via
7955 -cache <kilobytes> */
7956 $_def_stream_cache
7958 /* Define if you are using Xvid library */
7959 $_def_xvid
7961 /* Define if you are using the X.264 library */
7962 $_def_x264
7964 /* Define if you are using libnut */
7965 $_def_libnut
7967 /* Define to include support for libdv-0.9.5 */
7968 $_def_libdv
7970 /* If build mencoder */
7971 $_mencoder_flag
7973 /* Indicates if libmp3lame is available
7974 Note: for mencoder */
7975 $_def_mp3lame
7976 $_def_mp3lame_preset
7977 $_def_mp3lame_preset_medium
7979 /* Undefine this if you do not want to select mono audio (left or right)
7980 with a stereo MPEG layer 2/3 audio stream. The command line option
7981 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7982 right-only), with 0 being the default.
7984 #define USE_FAKE_MONO 1
7986 /* Undefine this if your sound card driver has no working select().
7987 If you have kernel Oops, player hangups, or just no audio, you should
7988 try to recompile MPlayer with this option disabled! */
7989 $_def_select
7991 /* define this to use iconv(3) function to codepage conversions */
7992 $_def_iconv
7994 /* define this to use nl_langinfo function */
7995 $_def_langinfo
7997 /* define this to use RTC (/dev/rtc) for video timers */
7998 $_def_rtc
8000 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
8001 #define MAX_OUTBURST 65536
8003 /* set up audio OUTBURST. Do not change this! */
8004 #define OUTBURST 512
8006 /* Define this if your system has the header file for the OSS sound interface */
8007 $_def_sys_soundcard
8009 /* Define this if your system has the header file for the OSS sound interface
8010 * in /usr/include */
8011 $_def_soundcard
8013 /* Define this if your system has the sysinfo header */
8014 $_def_sys_sysinfo
8016 /* Define this if your system has the "malloc.h" header file */
8017 $_def_malloc
8019 /* memalign is mapped to malloc if unsupported */
8020 $_def_memalign
8021 $_def_map_memalign
8022 $_def_memalign_hack
8024 /* assembler handling of .align */
8025 $_def_asmalign_pot
8027 /* Define this if your system has the "alloca.h" header file */
8028 $_def_alloca
8030 /* Define this if your system has the "byteswap.h" header file */
8031 $_def_byteswap_h
8033 /* Define this if your system has the "sys/mman.h" header file */
8034 $_def_mman
8035 $_def_mman_has_map_failed
8037 /* Define this if you have the elf dynamic linker -ldl library */
8038 $_def_dl
8040 /* Define this if you have the kstat kernel statistics library */
8041 $_def_kstat
8043 /* Define this if you have zlib */
8044 $_def_zlib
8045 #ifdef HAVE_ZLIB
8046 #define CONFIG_ZLIB 1
8047 #endif
8049 /* Define this if you have shm support */
8050 $_def_shm
8052 /* Define this if your system has strsep */
8053 $_def_strsep
8055 /* Define this if your system has vsscanf */
8056 $_def_vsscanf
8058 /* Define this if your system has swab */
8059 $_def_swab
8061 /* Define this if your system has posix select */
8062 $_def_posix_select
8064 /* Define this if your system has gettimeofday */
8065 $_def_gettimeofday
8067 /* Define this if your system has glob */
8068 $_def_glob
8070 /* Define this if your system has setenv */
8071 $_def_setenv
8072 #ifndef HAVE_SETENV
8073 int setenv(const char *name, const char *val, int overwrite);
8074 #endif
8076 /* Define this if your system has sysi86 */
8077 $_def_sysi86
8078 $_def_sysi86_iv
8080 /* Define this if your system has pthreads */
8081 $_def_pthreads
8083 /* Define this if you enabled thread support for libavcodec */
8084 $_def_threads
8085 #ifdef HAVE_THREADS
8086 #define ENABLE_THREADS 1
8087 #else
8088 #define ENABLE_THREADS 0
8089 #endif
8091 /* LIRC (remote control, see www.lirc.org) support: */
8092 $_def_lirc
8094 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8095 $_def_apple_remote
8097 /* Apple IR Remote (Linux remote control driver) */
8098 $_def_apple_ir
8100 /* Support for maemo (http://www.maemo.org) */
8101 $_def_maemo
8104 * LIRCCD (LIRC client daemon)
8105 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8107 $_def_lircc
8109 /* DVD navigation support using libdvdnav */
8110 $_def_dvdnav
8112 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8113 #define MPEG12_POSTPROC 1
8115 /* maximum alignment used by libmpeg2 */
8116 #define ATTRIBUTE_ALIGNED_MAX 16
8118 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8119 $_def_libpostproc
8120 $_def_libpostproc_a
8121 $_def_libpostproc_so
8123 /* Win32 DLL support */
8124 $_def_win32dll
8125 #define WIN32_PATH "$_win32codecsdir"
8127 /* Mac OS X specific features */
8128 $_def_macosx_finder_support
8129 $_def_macosx_bundle
8130 $_def_coreaudio
8131 $_def_corevideo
8132 $_def_quartz
8133 $_def_quicktime
8135 /* Build our Win32-loader */
8136 $_def_win32_loader
8138 /* ffmpeg's libavcodec support (requires libavcodec source) */
8139 $_def_libavcodec
8140 $_def_libavcodec_a
8141 $_def_libavcodec_so
8142 $_def_libavcodec_mpegaudio_hp
8144 /* ffmpeg's libavformat support (requires libavformat source) */
8145 $_def_libavformat
8146 $_def_libavformat_a
8147 $_def_libavformat_so
8149 $_def_libavutil
8150 $_def_libavutil_a
8151 $_def_libavutil_so
8153 /* Use libavcodec's decoders */
8154 #define CONFIG_DECODERS 1
8155 #define ENABLE_DECODERS 1
8156 /* Use libavcodec's encoders */
8157 #define CONFIG_ENCODERS 1
8158 #define ENABLE_ENCODERS 1
8160 /* Use libavformat's demuxers */
8161 #define CONFIG_DEMUXERS 1
8162 #define ENABLE_DEMUXERS 1
8163 /* Use libavformat's muxers */
8164 $_def_muxers
8166 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8167 #define HAVE_EBX_AVAILABLE 1
8168 #ifndef MP_DEBUG
8169 #define HAVE_EBP_AVAILABLE 1
8170 #endif
8172 #define HAVE_SOCKLEN_T 1
8174 #define CONFIG_GPL 1
8175 #define ENABLE_SMALL 0
8176 #define ENABLE_GRAY 0
8178 /* Use AMR codecs from libavcodec. */
8179 $_def_libamr
8180 $_def_libamr_nb
8181 $_def_libamr_wb
8183 /* Use specific parts from FFmpeg. */
8184 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8185 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8186 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8187 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8188 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8189 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8190 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8192 $_def_faac_lavc
8193 $_def_mp3lame_lavc
8194 $_def_x264_lavc
8195 $_def_xvid_lavc
8197 /* Use codec libs included in mplayer CVS / source dist: */
8198 $_def_mp3lib
8199 $_def_liba52
8200 $_def_libmpeg2
8202 /* XAnim DLL support */
8203 $_def_xanim
8204 /* Default search path */
8205 $_def_xanim_path
8207 /* RealPlayer DLL support */
8208 $_def_real
8209 /* Default search path */
8210 $_def_real_path
8212 /* LIVE555 Streaming Media library support */
8213 $_def_live
8215 /* libnemesi Streaming Media library support */
8216 $_def_nemesi
8218 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8219 $_def_fastmemcpy
8221 /* Use UnRAR executable for Vobsubs */
8222 $_def_unrar_exec
8224 /* gui support, please do not edit this option */
8225 $_def_gui
8226 $_def_gtk2_gui
8228 /* Audio output drivers */
8229 $_def_ossaudio
8230 $_def_ossaudio_devdsp
8231 $_def_ossaudio_devmixer
8232 $_def_alsa5
8233 $_def_alsa9
8234 $_def_alsa1x
8235 $_def_arts
8236 $_def_esd
8237 $_def_esd_latency
8238 $_def_pulse
8239 $_def_jack
8240 $_def_openal
8241 $_def_openal_h
8242 $_def_sys_asoundlib_h
8243 $_def_alsa_asoundlib_h
8244 $_def_sunaudio
8245 $_def_sgiaudio
8246 $_def_win32waveout
8247 $_def_nas
8249 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8250 #undef FAST_OSD
8251 #undef FAST_OSD_TABLE
8253 /* Enable TV Interface support */
8254 $_def_tv
8256 /* Enable Video 4 Linux TV interface support */
8257 $_def_tv_v4l
8259 /* Enable Video 4 Linux 1 TV interface support */
8260 $_def_tv_v4l1
8262 /* Enable Video 4 Linux 2 TV interface support */
8263 $_def_tv_v4l2
8265 /* Enable DirectShow TV interface support */
8266 $_def_tv_dshow
8268 /* *BSD BrookTree headers */
8269 $_def_ioctl_meteor_h_name
8270 $_def_ioctl_bt848_h_name
8272 /* Enable *BSD BrookTree TV interface support */
8273 $_def_tv_bsdbt848
8275 /* Enable TV Teletext Interface support */
8276 $_def_tv_teletext
8278 /* Enable Radio Interface support */
8279 $_def_radio
8281 /* Enable Capture for Radio Interface support */
8282 $_def_radio_capture
8284 /* Enable Video 4 Linux Radio interface support */
8285 $_def_radio_v4l
8287 /* Enable Video 4 Linux 2 Radio interface support */
8288 $_def_radio_v4l2
8290 /* Enable *BSD BrookTree Radio interface support */
8291 $_def_radio_bsdbt848
8293 /* Enable Video 4 Linux 2 MPEG PVR support */
8294 $_def_pvr
8296 /* Define if your processor stores words with the most significant
8297 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8298 $_def_words_endian
8300 /* Define if your processor can access unaligned data in a fast way */
8301 $_def_fast_unaligned
8303 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8305 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8306 have the instruction. */
8307 $_def_dcbzl
8309 /* Define this for Cygwin build for win32 */
8310 $_def_confwin32
8312 /* Define this to any prefered value from 386 up to infinity with step 100 */
8313 #define __CPU__ $iproc
8315 $_mp_wordsize
8317 $_def_vcd
8319 #ifdef sun
8320 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8321 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8322 #elif defined(WIN32) || defined(__OS2__)
8323 #define DEFAULT_CDROM_DEVICE "D:"
8324 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8325 #elif defined(__APPLE__) || defined(__DARWIN__)
8326 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8327 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8328 #elif defined(__OpenBSD__)
8329 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8330 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8331 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8332 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8333 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8334 #elif defined(__DragonFly__)
8335 #define DEFAULT_CDROM_DEVICE "/dev/cd0"
8336 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8337 #elif defined(__AMIGAOS4__)
8338 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8339 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8340 #else
8341 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8342 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8343 #endif
8346 /*----------------------------------------------------------------------------
8348 ** NOTE: Instead of modifying these definitions here, use the
8349 ** --enable/--disable options of the ./configure script!
8350 ** See ./configure --help for details.
8352 *---------------------------------------------------------------------------*/
8354 /* C99 *lrint* and round* functions available */
8355 $_def_llrint
8356 $_def_lrint
8357 $_def_lrintf
8358 $_def_round
8359 $_def_roundf
8361 /* mkstemp support */
8362 $_def_mkstemp
8364 /* nanosleep support */
8365 $_def_nanosleep
8367 /* SMB support */
8368 $_def_smbsupport
8370 /* termcap flag for getch2.c */
8371 $_def_termcap
8373 /* termios flag for getch2.c */
8374 $_def_termios
8375 $_def_termios_h
8376 $_def_termios_sys_h
8378 /* enable PNG support */
8379 $_def_png
8381 /* enable JPEG support */
8382 $_def_jpeg
8384 /* enable PNM support */
8385 $_def_pnm
8387 /* enable md5sum support */
8388 $_def_md5sum
8390 /* enable yuv4mpeg support */
8391 $_def_yuv4mpeg
8393 /* enable GIF support */
8394 $_def_gif
8395 $_def_gif_4
8396 $_def_gif_tvt_hack
8398 /* enable bitmap font support */
8399 $_def_bitmap_font
8401 /* enable FreeType support */
8402 $_def_freetype
8404 /* enable Fontconfig support */
8405 $_def_fontconfig
8407 /* enable SSA/ASS support */
8408 $_def_ass
8410 /* enable FriBiDi usage */
8411 $_def_fribidi
8413 /* enable ENCA usage */
8414 $_def_enca
8416 /* liblzo support */
8417 $_def_liblzo
8418 #ifdef USE_LIBLZO
8419 #define CONFIG_LZO 1
8420 #endif
8422 /* libmad support */
8423 $_def_mad
8425 /* enable OggVorbis support */
8426 $_def_vorbis
8427 $_def_tremor
8429 /* enable Speex support */
8430 $_def_speex
8432 /* enable musepack support */
8433 $_def_musepack
8435 /* enable OggTheora support */
8436 $_def_theora
8438 /* enable FAAD (AAC) support */
8439 $_def_faad
8440 $_def_faad_internal
8442 /* enable FAAC (AAC encoder) support */
8443 $_def_faac
8445 /* enable libdca support */
8446 $_def_libdca
8448 /* enable LADSPA plugin support */
8449 $_def_ladspa
8451 /* enable network */
8452 $_def_network
8454 /* enable ftp support */
8455 $_def_ftp
8457 /* enable vstream support */
8458 $_def_vstream
8460 /* enable winsock2 instead of Unix functions*/
8461 $_def_winsock2
8463 /* define this to use inet_aton() instead of inet_pton() */
8464 $_def_use_aton
8466 /* enables / disables cdparanoia support */
8467 $_def_cdparanoia
8468 $_def_cddb
8470 /* enables / disables VIDIX usage */
8471 $_def_vidix
8472 $_def_vidix_drv_cyberblade
8473 $_def_vidix_drv_ivtv
8474 $_def_vidix_drv_mach64
8475 $_def_vidix_drv_mga
8476 $_def_vidix_drv_mga_crtc2
8477 $_def_vidix_drv_nvidia
8478 $_def_vidix_drv_pm3
8479 $_def_vidix_drv_radeon
8480 $_def_vidix_drv_rage128
8481 $_def_vidix_drv_s3
8482 $_def_vidix_drv_sis
8483 $_def_vidix_drv_unichrome
8484 $_def_vidix_pfx
8486 /* enables / disables new input joystick support */
8487 $_def_joystick
8489 /* enables / disables QTX codecs */
8490 $_def_qtx
8491 $_def_qtx_win32
8493 /* enables / disables osd menu */
8494 $_def_menu
8496 /* enables / disables subtitles sorting */
8497 $_def_sortsub
8499 /* XMMS input plugin support */
8500 $_def_xmms
8501 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8503 /* enables inet6 support */
8504 $_def_inet6
8506 /* do we have gethostbyname2? */
8507 $_def_gethostbyname2
8509 /* Extension defines */
8510 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8512 $_def_altivec_h // enables usage of altivec.h
8513 $_def_altivec_vector_braces
8515 /* libvo options */
8516 #define SCREEN_SIZE_X 1
8517 #define SCREEN_SIZE_Y 1
8518 $_def_x11
8519 $_def_xv
8520 $_def_xvmc
8521 $_def_vm
8522 $_def_xf86keysym
8523 $_def_xinerama
8524 $_def_gl
8525 $_def_gl_win32
8526 $_def_dga
8527 $_def_dga1
8528 $_def_dga2
8529 $_def_sdl
8530 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8531 $_def_sdlbuggy
8532 $_def_directx
8533 $_def_ggi
8534 $_def_ggiwmh
8535 $_def_3dfx
8536 $_def_s3fb
8537 $_def_tdfxfb
8538 $_def_tdfxvid
8539 $_def_xvr100
8540 $_def_directfb
8541 $_def_directfb_version
8542 $_def_dfbmga
8543 $_def_zr
8544 $_def_bl
8545 $_def_mga
8546 $_def_xmga
8547 $_def_fbdev
8548 $_def_dxr2
8549 $_def_dxr3
8550 $_def_ivtv
8551 $_def_v4l2
8552 $_def_dvb
8553 $_def_dvb_in
8554 $_def_svga
8555 $_def_vesa
8556 $_def_xss
8557 $_def_xdpms
8558 $_def_aa
8559 $_def_caca
8560 $_def_tga
8561 $_def_toolame
8562 $_def_twolame
8564 /* used by GUI: */
8565 $_def_xshape
8567 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8568 #define X11_FULLSCREEN 1
8569 #endif
8571 #endif /* MPLAYER_CONFIG_H */
8574 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8575 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8577 cp -p config.h ffmpeg/config.h
8578 sed -e 's/OPTFLAGS/MPLAYER_OPTFLAGS/' -e 's/FFMPEG_OFLAGS/OPTFLAGS/' config.mak >ffmpeg/config.mak
8580 #############################################################################
8582 cat << EOF
8584 Config files successfully generated by ./configure $_configuration !
8586 Install prefix: $_prefix
8587 Data directory: $_datadir
8588 Config direct.: $_confdir
8590 Byte order: $_byte_order
8591 Optimizing for: $_optimizing
8593 Languages:
8594 Messages/GUI: $_language
8597 echo ${_echo_n} " Manual pages: $MAN_LANG_ALL ${_echo_c}"
8598 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8599 echo
8601 cat << EOF
8603 Enabled optional drivers:
8604 Input: $_inputmodules
8605 Codecs: $_codecmodules
8606 Audio output: $_aomodules
8607 Video output: $_vomodules
8608 Disabled optional drivers:
8609 Input: $_noinputmodules
8610 Codecs: $_nocodecmodules
8611 Audio output: $_noaomodules
8612 Video output: $_novomodules
8614 'config.h' and 'config.mak' contain your configuration options.
8615 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8616 compile *** DO NOT REPORT BUGS if you tweak these files ***
8618 'make' will now compile MPlayer and 'make install' will install it.
8619 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8624 if test "$_mtrr" = yes ; then
8625 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8626 echo
8629 if ! x86_32; then
8630 cat <<EOF
8631 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8632 operating system ($system_name). You may encounter a few files that cannot
8633 be played due to missing open source video/audio codec support.
8639 cat <<EOF
8640 Check $TMPLOG if you wonder why an autodetection failed (make sure
8641 development headers/packages are installed).
8643 NOTE: The --enable-* parameters unconditionally force options on, completely
8644 skipping autodetection. This behavior is unlike what you may be used to from
8645 autoconf-based configure scripts that can decide to override you. This greater
8646 level of control comes at a price. You may have to provide the correct compiler
8647 and linker flags yourself.
8648 If you used one of these options (except --enable-gui and similar ones that
8649 turn on internal features) and experience a compilation or linking failure,
8650 make sure you have passed the necessary compiler/linker flags to configure.
8652 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8656 if test "$_warn_CFLAGS" = yes; then
8657 cat <<EOF
8659 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8661 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8663 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8664 To do so, execute 'CFLAGS= ./configure <options>'
8669 # Last move:
8670 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"