sync mga_vid.h to revision 265 from the mga_vid repo
[mplayer/glamo.git] / configure
blob5771169a5796fd8810a84d546ed0b126b720a5cd
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-internal disable internal VIDIX [for x86 *nix]
343 --disable-vidix-external disable external VIDIX [for x86 *nix]
344 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
345 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
346 nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome
347 --disable-vidix-pcidb disable VIDIX PCI device name database
348 --enable-gl enable OpenGL video output [autodetect]
349 --enable-dga2 enable DGA 2 support [autodetect]
350 --enable-dga1 enable DGA 1 support [autodetect]
351 --enable-vesa enable VESA video output [autodetect]
352 --enable-svga enable SVGAlib video output [autodetect]
353 --enable-sdl enable SDL video output [autodetect]
354 --enable-aa enable AAlib video output [autodetect]
355 --enable-caca enable CACA video output [autodetect]
356 --enable-ggi enable GGI video output [autodetect]
357 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
358 --enable-directx enable DirectX video output [autodetect]
359 --enable-dxr2 enable DXR2 video output [autodetect]
360 --enable-dxr3 enable DXR3/H+ video output [autodetect]
361 --enable-ivtv enable IVTV TV-Out video output [autodetect]
362 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
363 --enable-dvb enable DVB video output [autodetect]
364 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
365 --enable-mga enable mga_vid video output [autodetect]
366 --enable-xmga enable mga_vid X11 video output [autodetect]
367 --enable-xv enable Xv video output [autodetect]
368 --enable-xvmc enable XvMC acceleration [disable]
369 --enable-vm enable XF86VidMode support [autodetect]
370 --enable-xinerama enable Xinerama support [autodetect]
371 --enable-x11 enable X11 video output [autodetect]
372 --enable-xshape enable XShape support [autodetect]
373 --disable-xss disable screensaver support via xss [autodetect]
374 --enable-fbdev enable FBDev video output [autodetect]
375 --enable-mlib enable mediaLib video output (Solaris) [disable]
376 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
377 --enable-tdfxfb enable tdfxfb video output [disable]
378 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
379 --enable-directfb enable DirectFB video output [autodetect]
380 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
381 --enable-bl enable Blinkenlights video output [disable]
382 --enable-tdfxvid enable tdfx_vid video output [disable]
383 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
384 --disable-tga disable Targa video output [enable]
385 --disable-pnm disable PNM video output [enable]
386 --disable-md5sum disable md5sum video output [enable]
388 Audio output:
389 --disable-alsa disable ALSA audio output [autodetect]
390 --disable-ossaudio disable OSS audio output [autodetect]
391 --disable-arts disable aRts audio output [autodetect]
392 --disable-esd disable esd audio output [autodetect]
393 --disable-pulse disable Pulseaudio audio output [autodetect]
394 --disable-jack disable JACK audio output [autodetect]
395 --disable-openal disable OpenAL audio output [autodetect]
396 --disable-nas disable NAS audio output [autodetect]
397 --disable-sgiaudio disable SGI audio output [autodetect]
398 --disable-sunaudio disable Sun audio output [autodetect]
399 --disable-win32waveout disable Windows waveout audio output [autodetect]
400 --disable-select disable using select() on the audio device [enable]
402 Miscellaneous options:
403 --enable-runtime-cpudetection enable runtime CPU detection [disable]
404 --enable-cross-compile enable cross-compilation [autodetect]
405 --cc=COMPILER C compiler to build MPlayer [gcc]
406 --host-cc=COMPILER C compiler for tools needed while building [gcc]
407 --as=ASSEMBLER assembler to build MPlayer [as]
408 --ar=AR librarian to build MPlayer [ar]
409 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
410 --windres=WINDRES windres to build MPlayer [windres]
411 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
412 --enable-static build a statically linked binary
413 --charset=charset convert the console messages to this character set
414 --language=list a white space or comma separated list of languages for
415 translated man pages, the first language is used for
416 messages and the GUI (the environment variable
417 \$LINGUAS is also honored) [en]
418 (Available: $LANGUAGES all)
419 --with-install=PATH path to a custom install program
421 Advanced options:
422 --enable-mmx enable MMX [autodetect]
423 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
424 --enable-3dnow enable 3DNow! [autodetect]
425 --enable-3dnowext enable extended 3DNow! [autodetect]
426 --enable-sse enable SSE [autodetect]
427 --enable-sse2 enable SSE2 [autodetect]
428 --enable-ssse3 enable SSSE3 [autodetect]
429 --enable-shm enable shm [autodetect]
430 --enable-altivec enable AltiVec (PowerPC) [autodetect]
431 --enable-armv5te enable DSP extensions (ARM) [autodetect]
432 --enable-armv6 enable ARMv6 (ARM) [autodetect]
433 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
434 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
435 --enable-big-endian force byte order to big-endian [autodetect]
436 --enable-debug[=1-3] compile-in debugging information [disable]
437 --enable-profile compile-in profiling information [disable]
438 --disable-sighandler disable sighandler for crashes [enable]
439 --enable-crash-debug enable automatic gdb attach on crash [disable]
440 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
442 Use these options if autodetection fails (Options marked with (*) accept
443 multiple paths separated by ':'):
444 --extra-libs=FLAGS extra linker flags
445 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
446 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
447 --with-extraincdir=DIR extra header search paths in DIR (*)
448 --with-extralibdir=DIR extra linker search paths in DIR (*)
449 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
451 --with-freetype-config=PATH path to freetype-config
452 --with-fribidi-config=PATH path to fribidi-config
453 --with-glib-config=PATH path to glib*-config
454 --with-gtk-config=PATH path to gtk*-config
455 --with-sdl-config=PATH path to sdl*-config
456 --with-dvdnav-config=PATH path to dvdnav-config
457 --with-dvdread-config=PATH path to dvdread-config
459 This configure script is NOT autoconf-based, even though its output is similar.
460 It will try to autodetect all configuration options. If you --enable an option
461 it will be forcefully turned on, skipping autodetection. This can break
462 compilation, so you need to know what you are doing.
464 exit 0
465 } #show_help()
467 # GOTCHA: the variables below defines the default behavior for autodetection
468 # and have - unless stated otherwise - at least 2 states : yes no
469 # If autodetection is available then the third state is: auto
470 _mmx=auto
471 _3dnow=auto
472 _3dnowext=auto
473 _mmxext=auto
474 _sse=auto
475 _sse2=auto
476 _ssse3=auto
477 _cmov=auto
478 _fast_cmov=auto
479 _armv5te=auto
480 _armv6=auto
481 _iwmmxt=auto
482 _mtrr=auto
483 _altivec=auto
484 _install=install
485 _ranlib=ranlib
486 _windres=windres
487 _cc=cc
488 _ar=ar
489 test "$CC" && _cc="$CC"
490 _as=auto
491 _runtime_cpudetection=no
492 _cross_compile=auto
493 _prefix="/usr/local"
494 _libavutil_a=auto
495 _libavutil_so=auto
496 _libavcodec_a=auto
497 _libamr_nb=auto
498 _libamr_wb=auto
499 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
500 _libavdecoders=` echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER// `
501 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
502 _libavencoders=` echo $_libavencoders_all | sed 's/ LIB[A-Z0-9_]*_ENCODER//g'`
503 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
504 _libavparsers=$_libavparsers_all
505 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
506 _libavbsfs=$_libavbsfs_all
507 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
508 _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// `
509 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
510 _libavmuxers=`echo $_libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER// `
511 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
512 _libavcodec_so=auto
513 _libavformat_a=auto
514 _libavformat_so=auto
515 _libpostproc_a=auto
516 _libpostproc_so=auto
517 _libavcodec_mpegaudio_hp=yes
518 _mencoder=yes
519 _mplayer=yes
520 _x11=auto
521 _xshape=auto
522 _xss=auto
523 _dga1=auto
524 _dga2=auto
525 _xv=auto
526 _xvmc=no #auto when complete
527 _sdl=auto
528 _directx=auto
529 _win32waveout=auto
530 _nas=auto
531 _png=auto
532 _jpeg=auto
533 _pnm=yes
534 _md5sum=yes
535 _gif=auto
536 _gl=auto
537 _ggi=auto
538 _ggiwmh=auto
539 _aa=auto
540 _caca=auto
541 _svga=auto
542 _vesa=auto
543 _fbdev=auto
544 _dvb=auto
545 _dvbhead=auto
546 _dxr2=auto
547 _dxr3=auto
548 _ivtv=auto
549 _v4l2=auto
550 _iconv=auto
551 _langinfo=auto
552 _rtc=auto
553 _ossaudio=auto
554 _arts=auto
555 _esd=auto
556 _pulse=auto
557 _jack=auto
558 _openal=auto
559 _libcdio=auto
560 _liblzo=auto
561 _mad=auto
562 _mp3lame=auto
563 _mp3lame_lavc=auto
564 _toolame=auto
565 _twolame=auto
566 _tremor_internal=yes
567 _tremor_low=no
568 _tremor_external=auto
569 _libvorbis=auto
570 _speex=auto
571 _theora=auto
572 _mp3lib=yes
573 _liba52=yes
574 _libdca=auto
575 _libmpeg2=auto
576 _faad_internal=auto
577 _faad_external=auto
578 _faad_fixed=no
579 _faac=auto
580 _faac_lavc=auto
581 _ladspa=auto
582 _xmms=no
583 _dvdnav=auto
584 _dvdnavconfig=dvdnav-config
585 _dvdreadconfig=dvdread-config
586 _dvdread=auto
587 _dvdread_internal=auto
588 _libdvdcss_internal=auto
589 _xanim=auto
590 _real=auto
591 _live=auto
592 _nemesi=auto
593 _native_rtsp=yes
594 _xinerama=auto
595 _mga=auto
596 _xmga=auto
597 _vm=auto
598 _xf86keysym=auto
599 _mlib=no #broken, thus disabled
600 _sgiaudio=auto
601 _sunaudio=auto
602 _alsa=auto
603 _fastmemcpy=yes
604 _unrar_exec=auto
605 _win32dll=auto
606 _select=yes
607 _radio=no
608 _radio_capture=no
609 _radio_v4l=auto
610 _radio_v4l2=auto
611 _radio_bsdbt848=auto
612 _tv=yes
613 _tv_v4l1=auto
614 _tv_v4l2=auto
615 _tv_bsdbt848=auto
616 _tv_dshow=auto
617 _tv_teletext=auto
618 _pvr=auto
619 _network=yes
620 _winsock2=auto
621 _smbsupport=auto
622 _vidix_internal=auto
623 _vidix_external=auto
624 _vidix_pcidb=yes
625 _joystick=no
626 _xvid=auto
627 _xvid_lavc=auto
628 _x264=auto
629 _x264_lavc=auto
630 _libnut=auto
631 _lirc=auto
632 _lircc=auto
633 _apple_remote=auto
634 _apple_ir=auto
635 _gui=no
636 _gtk1=no
637 _termcap=auto
638 _termios=auto
639 _3dfx=no
640 _s3fb=no
641 _tdfxfb=no
642 _tdfxvid=no
643 _xvr100=auto
644 _tga=yes
645 _directfb=auto
646 _zr=auto
647 _bl=no
648 _largefiles=yes
649 #_language=en
650 _shm=auto
651 _linux_devfs=no
652 _charset="UTF-8"
653 _dynamic_plugins=no
654 _crash_debug=no
655 _sighandler=yes
656 _libdv=auto
657 _cdparanoia=auto
658 _cddb=auto
659 _big_endian=auto
660 _bitmap_font=yes
661 _freetype=auto
662 _fontconfig=auto
663 _menu=no
664 _qtx=auto
665 _macosx=auto
666 _maemo=auto
667 _macosx_finder_support=no
668 _macosx_bundle=auto
669 _sortsub=yes
670 _freetypeconfig='freetype-config'
671 _fribidi=auto
672 _fribidiconfig='fribidi-config'
673 _enca=auto
674 _inet6=auto
675 _gethostbyname2=auto
676 _ftp=yes
677 _musepack=auto
678 _vstream=auto
679 _pthreads=auto
680 _w32threads=auto
681 _ass=auto
682 _rpath=no
683 _asmalign_pot=auto
684 _stream_cache=yes
685 _def_stream_cache="#define USE_STREAM_CACHE 1"
686 _need_shmem=yes
687 for ac_option do
688 case "$ac_option" in
689 --help|-help|-h)
690 show_help
692 --prefix=*)
693 _prefix=`echo $ac_option | cut -d '=' -f 2`
695 --bindir=*)
696 _bindir=`echo $ac_option | cut -d '=' -f 2`
698 --datadir=*)
699 _datadir=`echo $ac_option | cut -d '=' -f 2`
701 --mandir=*)
702 _mandir=`echo $ac_option | cut -d '=' -f 2`
704 --confdir=*)
705 _confdir=`echo $ac_option | cut -d '=' -f 2`
707 --libdir=*)
708 _libdir=`echo $ac_option | cut -d '=' -f 2`
710 --codecsdir=*)
711 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
713 --win32codecsdir=*)
714 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
716 --xanimcodecsdir=*)
717 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
719 --realcodecsdir=*)
720 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
722 --with-extraincdir=*)
723 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
725 --with-extralibdir=*)
726 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
729 --with-install=*)
730 _install=`echo $ac_option | cut -d '=' -f 2 `
732 --with-xvmclib=*)
733 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
736 --with-sdl-config=*)
737 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
739 --with-freetype-config=*)
740 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
742 --with-fribidi-config=*)
743 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
745 --with-gtk-config=*)
746 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
748 --with-glib-config=*)
749 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
751 --with-dvdnav-config=*)
752 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
754 --with-dvdread-config=*)
755 _dvdreadconfig=`echo $ac_option | cut -d '=' -f 2`
758 --extra-libs=*)
759 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
761 --extra-libs-mplayer=*)
762 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
764 --extra-libs-mencoder=*)
765 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
768 --target=*)
769 _target=`echo $ac_option | cut -d '=' -f 2`
771 --cc=*)
772 _cc=`echo $ac_option | cut -d '=' -f 2`
774 --host-cc=*)
775 _host_cc=`echo $ac_option | cut -d '=' -f 2`
777 --as=*)
778 _as=`echo $ac_option | cut -d '=' -f 2`
780 --ar=*)
781 _ar=`echo $ac_option | cut -d '=' -f 2`
783 --ranlib=*)
784 _ranlib=`echo $ac_option | cut -d '=' -f 2`
786 --windres=*)
787 _windres=`echo $ac_option | cut -d '=' -f 2`
789 --charset=*)
790 _charset=`echo $ac_option | cut -d '=' -f 2`
792 --language=*)
793 _language=`echo $ac_option | cut -d '=' -f 2`
796 --enable-static)
797 _ld_static='-static'
799 --disable-static)
800 _ld_static=''
802 --enable-profile)
803 _profile='-p'
805 --disable-profile)
806 _profile=
808 --enable-debug)
809 _debug='-g'
811 --enable-debug=*)
812 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
814 --disable-debug)
815 _debug=
817 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
818 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
819 --enable-cross-compile) _cross_compile=yes ;;
820 --disable-cross-compile) _cross_compile=no ;;
821 --enable-mencoder) _mencoder=yes ;;
822 --disable-mencoder) _mencoder=no ;;
823 --enable-mplayer) _mplayer=yes ;;
824 --disable-mplayer) _mplayer=no ;;
825 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
826 --disable-dynamic-plugins) _dynamic_plugins=no ;;
827 --enable-x11) _x11=yes ;;
828 --disable-x11) _x11=no ;;
829 --enable-xshape) _xshape=yes ;;
830 --disable-xshape) _xshape=no ;;
831 --enable-xss) _xss=yes ;;
832 --disable-xss) _xss=no ;;
833 --enable-xv) _xv=yes ;;
834 --disable-xv) _xv=no ;;
835 --enable-xvmc) _xvmc=yes ;;
836 --disable-xvmc) _xvmc=no ;;
837 --enable-sdl) _sdl=yes ;;
838 --disable-sdl) _sdl=no ;;
839 --enable-directx) _directx=yes ;;
840 --disable-directx) _directx=no ;;
841 --enable-win32waveout) _win32waveout=yes ;;
842 --disable-win32waveout) _win32waveout=no ;;
843 --enable-nas) _nas=yes ;;
844 --disable-nas) _nas=no ;;
845 --enable-png) _png=yes ;;
846 --disable-png) _png=no ;;
847 --enable-jpeg) _jpeg=yes ;;
848 --disable-jpeg) _jpeg=no ;;
849 --enable-pnm) _pnm=yes ;;
850 --disable-pnm) _pnm=no ;;
851 --enable-md5sum) _md5sum=yes ;;
852 --disable-md5sum) _md5sum=no ;;
853 --enable-gif) _gif=yes ;;
854 --disable-gif) _gif=no ;;
855 --enable-gl) _gl=yes ;;
856 --disable-gl) _gl=no ;;
857 --enable-ggi) _ggi=yes ;;
858 --disable-ggi) _ggi=no ;;
859 --enable-ggiwmh) _ggiwmh=yes ;;
860 --disable-ggiwmh) _ggiwmh=no ;;
861 --enable-aa) _aa=yes ;;
862 --disable-aa) _aa=no ;;
863 --enable-caca) _caca=yes ;;
864 --disable-caca) _caca=no ;;
865 --enable-svga) _svga=yes ;;
866 --disable-svga) _svga=no ;;
867 --enable-vesa) _vesa=yes ;;
868 --disable-vesa) _vesa=no ;;
869 --enable-fbdev) _fbdev=yes ;;
870 --disable-fbdev) _fbdev=no ;;
871 --enable-dvb) _dvb=yes ;;
872 --disable-dvb) _dvb=no ;;
873 --enable-dvbhead) _dvbhead=yes ;;
874 --disable-dvbhead) _dvbhead=no ;;
875 --enable-dxr2) _dxr2=yes ;;
876 --disable-dxr2) _dxr2=no ;;
877 --enable-dxr3) _dxr3=yes ;;
878 --disable-dxr3) _dxr3=no ;;
879 --enable-ivtv) _ivtv=yes ;;
880 --disable-ivtv) _ivtv=no ;;
881 --enable-v4l2) _v4l2=yes ;;
882 --disable-v4l2) _v4l2=no ;;
883 --enable-iconv) _iconv=yes ;;
884 --disable-iconv) _iconv=no ;;
885 --enable-langinfo) _langinfo=yes ;;
886 --disable-langinfo) _langinfo=no ;;
887 --enable-rtc) _rtc=yes ;;
888 --disable-rtc) _rtc=no ;;
889 --enable-libdv) _libdv=yes ;;
890 --disable-libdv) _libdv=no ;;
891 --enable-ossaudio) _ossaudio=yes ;;
892 --disable-ossaudio) _ossaudio=no ;;
893 --enable-arts) _arts=yes ;;
894 --disable-arts) _arts=no ;;
895 --enable-esd) _esd=yes ;;
896 --disable-esd) _esd=no ;;
897 --enable-pulse) _pulse=yes ;;
898 --disable-pulse) _pulse=no ;;
899 --enable-jack) _jack=yes ;;
900 --disable-jack) _jack=no ;;
901 --enable-openal) _openal=yes ;;
902 --disable-openal) _openal=no ;;
903 --enable-mad) _mad=yes ;;
904 --disable-mad) _mad=no ;;
905 --enable-mp3lame) _mp3lame=yes ;;
906 --disable-mp3lame) _mp3lame=no ;;
907 --enable-mp3lame-lavc) _mp3lame_lavc=yes ;;
908 --disable-mp3lame-lavc) _mp3lame_lavc=no ;;
909 --enable-toolame) _toolame=yes ;;
910 --disable-toolame) _toolame=no ;;
911 --enable-twolame) _twolame=yes ;;
912 --disable-twolame) _twolame=no ;;
913 --enable-libcdio) _libcdio=yes ;;
914 --disable-libcdio) _libcdio=no ;;
915 --enable-liblzo) _liblzo=yes ;;
916 --disable-liblzo) _liblzo=no ;;
917 --enable-libvorbis) _libvorbis=yes ;;
918 --disable-libvorbis) _libvorbis=no ;;
919 --enable-speex) _speex=yes ;;
920 --disable-speex) _speex=no ;;
921 --enable-tremor-internal) _tremor_internal=yes ;;
922 --disable-tremor-internal) _tremor_internal=no ;;
923 --enable-tremor-low) _tremor_low=yes ;;
924 --disable-tremor-low) _tremor_low=no ;;
925 --enable-tremor-external) _tremor_external=yes ;;
926 --disable-tremor-external) _tremor_external=no ;;
927 --enable-theora) _theora=yes ;;
928 --disable-theora) _theora=no ;;
929 --enable-mp3lib) _mp3lib=yes ;;
930 --disable-mp3lib) _mp3lib=no ;;
931 --enable-liba52) _liba52=yes ;;
932 --disable-liba52) _liba52=no ;;
933 --enable-libdca) _libdca=yes ;;
934 --disable-libdca) _libdca=no ;;
935 --enable-libmpeg2) _libmpeg2=yes ;;
936 --disable-libmpeg2) _libmpeg2=no ;;
937 --enable-musepack) _musepack=yes ;;
938 --disable-musepack) _musepack=no ;;
939 --enable-faad-internal) _faad_internal=yes ;;
940 --disable-faad-internal) _faad_internal=no ;;
941 --enable-faad-external) _faad_external=yes ;;
942 --disable-faad-external) _faad_external=no ;;
943 --enable-faad-fixed) _faad_fixed=yes ;;
944 --disable-faad-fixed) _faad_fixed=no ;;
945 --enable-faac) _faac=yes ;;
946 --disable-faac) _faac=no ;;
947 --enable-faac-lavc) _faac_lavc=yes ;;
948 --disable-faac-lavc) _faac_lavc=no ;;
949 --enable-ladspa) _ladspa=yes ;;
950 --disable-ladspa) _ladspa=no ;;
951 --enable-xmms) _xmms=yes ;;
952 --disable-xmms) _xmms=no ;;
953 --enable-dvdread) _dvdread=yes ;;
954 --disable-dvdread) _dvdread=no ;;
955 --enable-dvdread-internal) _dvdread_internal=yes ;;
956 --disable-dvdread-internal) _dvdread_internal=no ;;
957 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
958 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
959 --enable-dvdnav) _dvdnav=yes ;;
960 --disable-dvdnav) _dvdnav=no ;;
961 --enable-xanim) _xanim=yes ;;
962 --disable-xanim) _xanim=no ;;
963 --enable-real) _real=yes ;;
964 --disable-real) _real=no ;;
965 --enable-live) _live=yes ;;
966 --disable-live) _live=no ;;
967 --enable-nemesi) _nemesi=yes ;;
968 --disable-nemesi) _nemesi=no ;;
969 --enable-xinerama) _xinerama=yes ;;
970 --disable-xinerama) _xinerama=no ;;
971 --enable-mga) _mga=yes ;;
972 --disable-mga) _mga=no ;;
973 --enable-xmga) _xmga=yes ;;
974 --disable-xmga) _xmga=no ;;
975 --enable-vm) _vm=yes ;;
976 --disable-vm) _vm=no ;;
977 --enable-xf86keysym) _xf86keysym=yes ;;
978 --disable-xf86keysym) _xf86keysym=no ;;
979 --enable-mlib) _mlib=yes ;;
980 --disable-mlib) _mlib=no ;;
981 --enable-sunaudio) _sunaudio=yes ;;
982 --disable-sunaudio) _sunaudio=no ;;
983 --enable-sgiaudio) _sgiaudio=yes ;;
984 --disable-sgiaudio) _sgiaudio=no ;;
985 --enable-alsa) _alsa=yes ;;
986 --disable-alsa) _alsa=no ;;
987 --enable-tv) _tv=yes ;;
988 --disable-tv) _tv=no ;;
989 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
990 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
991 --enable-tv-v4l1) _tv_v4l1=yes ;;
992 --disable-tv-v4l1) _tv_v4l1=no ;;
993 --enable-tv-v4l2) _tv_v4l2=yes ;;
994 --disable-tv-v4l2) _tv_v4l2=no ;;
995 --enable-tv-dshow) _tv_dshow=yes ;;
996 --disable-tv-dshow) _tv_dshow=no ;;
997 --enable-tv-teletext) _tv_teletext=yes ;;
998 --disable-tv-teletext) _tv_teletext=no ;;
999 --enable-radio) _radio=yes ;;
1000 --enable-radio-capture) _radio_capture=yes ;;
1001 --disable-radio-capture) _radio_capture=no ;;
1002 --disable-radio) _radio=no ;;
1003 --enable-radio-v4l) _radio_v4l=yes ;;
1004 --disable-radio-v4l) _radio_v4l=no ;;
1005 --enable-radio-v4l2) _radio_v4l2=yes ;;
1006 --disable-radio-v4l2) _radio_v4l2=no ;;
1007 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1008 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1009 --enable-pvr) _pvr=yes ;;
1010 --disable-pvr) _pvr=no ;;
1011 --enable-fastmemcpy) _fastmemcpy=yes ;;
1012 --disable-fastmemcpy) _fastmemcpy=no ;;
1013 --enable-network) _network=yes ;;
1014 --disable-network) _network=no ;;
1015 --enable-winsock2) _winsock2=yes ;;
1016 --disable-winsock2) _winsock2=no ;;
1017 --enable-smb) _smbsupport=yes ;;
1018 --disable-smb) _smbsupport=no ;;
1019 --enable-vidix-internal) _vidix_internal=yes ;;
1020 --disable-vidix-internal) _vidix_internal=no ;;
1021 --enable-vidix-external) _vidix_external=yes ;;
1022 --disable-vidix-external) _vidix_external=no ;;
1023 --with-vidix-drivers=*)
1024 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
1026 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1027 --enable-joystick) _joystick=yes ;;
1028 --disable-joystick) _joystick=no ;;
1029 --enable-xvid) _xvid=yes ;;
1030 --disable-xvid) _xvid=no ;;
1031 --enable-xvid-lavc) _xvid_lavc=yes ;;
1032 --disable-xvid-lavc) _xvid_lavc=no ;;
1033 --enable-x264) _x264=yes ;;
1034 --disable-x264) _x264=no ;;
1035 --enable-x264-lavc) _x264_lavc=yes ;;
1036 --disable-x264-lavc) _x264_lavc=no ;;
1037 --enable-libnut) _libnut=yes ;;
1038 --disable-libnut) _libnut=no ;;
1039 --enable-libavutil_a) _libavutil_a=yes ;;
1040 --disable-libavutil_a) _libavutil_a=no ;;
1041 --enable-libavutil_so) _libavutil_so=yes ;;
1042 --disable-libavutil_so) _libavutil_so=no ;;
1043 --enable-libavcodec_a) _libavcodec_a=yes ;;
1044 --disable-libavcodec_a) _libavcodec_a=no ;;
1045 --enable-libavcodec_so) _libavcodec_so=yes ;;
1046 --disable-libavcodec_so) _libavcodec_so=no ;;
1047 --enable-libamr_nb) _libamr_nb=yes ;;
1048 --disable-libamr_nb) _libamr_nb=no ;;
1049 --enable-libamr_wb) _libamr_wb=yes ;;
1050 --disable-libamr_wb) _libamr_wb=no ;;
1051 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1052 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1053 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1054 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1055 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1056 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1057 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1058 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1059 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1060 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1061 --enable-libavformat_a) _libavformat_a=yes ;;
1062 --disable-libavformat_a) _libavformat_a=no ;;
1063 --enable-libavformat_so) _libavformat_so=yes ;;
1064 --disable-libavformat_so) _libavformat_so=no ;;
1065 --enable-libpostproc_a) _libpostproc_a=yes ;;
1066 --disable-libpostproc_a) _libpostproc_a=no ;;
1067 --enable-libpostproc_so) _libpostproc_so=yes ;;
1068 --disable-libpostproc_so) _libpostproc_so=no ;;
1069 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1070 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1072 --enable-lirc) _lirc=yes ;;
1073 --disable-lirc) _lirc=no ;;
1074 --enable-lircc) _lircc=yes ;;
1075 --disable-lircc) _lircc=no ;;
1076 --enable-apple-remote) _apple_remote=yes ;;
1077 --disable-apple-remote) _apple_remote=no ;;
1078 --enable-apple-ir) _apple_ir=yes ;;
1079 --disable-apple-ir) _apple_ir=no ;;
1080 --enable-gui) _gui=yes ;;
1081 --disable-gui) _gui=no ;;
1082 --enable-gtk1) _gtk1=yes ;;
1083 --disable-gtk1) _gtk1=no ;;
1084 --enable-termcap) _termcap=yes ;;
1085 --disable-termcap) _termcap=no ;;
1086 --enable-termios) _termios=yes ;;
1087 --disable-termios) _termios=no ;;
1088 --enable-3dfx) _3dfx=yes ;;
1089 --disable-3dfx) _3dfx=no ;;
1090 --enable-s3fb) _s3fb=yes ;;
1091 --disable-s3fb) _s3fb=no ;;
1092 --enable-tdfxfb) _tdfxfb=yes ;;
1093 --disable-tdfxfb) _tdfxfb=no ;;
1094 --disable-tdfxvid) _tdfxvid=no ;;
1095 --enable-tdfxvid) _tdfxvid=yes ;;
1096 --disable-xvr100) _xvr100=no ;;
1097 --enable-xvr100) _xvr100=yes ;;
1098 --disable-tga) _tga=no ;;
1099 --enable-tga) _tga=yes ;;
1100 --enable-directfb) _directfb=yes ;;
1101 --disable-directfb) _directfb=no ;;
1102 --enable-zr) _zr=yes ;;
1103 --disable-zr) _zr=no ;;
1104 --enable-bl) _bl=yes ;;
1105 --disable-bl) _bl=no ;;
1106 --enable-mtrr) _mtrr=yes ;;
1107 --disable-mtrr) _mtrr=no ;;
1108 --enable-largefiles) _largefiles=yes ;;
1109 --disable-largefiles) _largefiles=no ;;
1110 --enable-shm) _shm=yes ;;
1111 --disable-shm) _shm=no ;;
1112 --enable-select) _select=yes ;;
1113 --disable-select) _select=no ;;
1114 --enable-linux-devfs) _linux_devfs=yes ;;
1115 --disable-linux-devfs) _linux_devfs=no ;;
1116 --enable-cdparanoia) _cdparanoia=yes ;;
1117 --disable-cdparanoia) _cdparanoia=no ;;
1118 --enable-cddb) _cddb=yes ;;
1119 --disable-cddb) _cddb=no ;;
1120 --enable-big-endian) _big_endian=yes ;;
1121 --disable-big-endian) _big_endian=no ;;
1122 --enable-bitmap-font) _bitmap_font=yes ;;
1123 --disable-bitmap-font) _bitmap_font=no ;;
1124 --enable-freetype) _freetype=yes ;;
1125 --disable-freetype) _freetype=no ;;
1126 --enable-fontconfig) _fontconfig=yes ;;
1127 --disable-fontconfig) _fontconfig=no ;;
1128 --enable-unrarexec) _unrar_exec=yes ;;
1129 --disable-unrarexec) _unrar_exec=no ;;
1130 --enable-ftp) _ftp=yes ;;
1131 --disable-ftp) _ftp=no ;;
1132 --enable-vstream) _vstream=yes ;;
1133 --disable-vstream) _vstream=no ;;
1134 --enable-pthreads) _pthreads=yes ;;
1135 --disable-pthreads) _pthreads=no ;;
1136 --enable-w32threads) _w32threads=yes ;;
1137 --disable-w32threads) _w32threads=no ;;
1138 --enable-ass) _ass=yes ;;
1139 --disable-ass) _ass=no ;;
1140 --enable-rpath) _rpath=yes ;;
1141 --disable-rpath) _rpath=no ;;
1143 --enable-fribidi) _fribidi=yes ;;
1144 --disable-fribidi) _fribidi=no ;;
1146 --enable-enca) _enca=yes ;;
1147 --disable-enca) _enca=no ;;
1149 --enable-inet6) _inet6=yes ;;
1150 --disable-inet6) _inet6=no ;;
1152 --enable-gethostbyname2) _gethostbyname2=yes ;;
1153 --disable-gethostbyname2) _gethostbyname2=no ;;
1155 --enable-dga1) _dga1=yes ;;
1156 --disable-dga1) _dga1=no ;;
1157 --enable-dga2) _dga2=yes ;;
1158 --disable-dga2) _dga2=no ;;
1160 --enable-menu) _menu=yes ;;
1161 --disable-menu) _menu=no ;;
1163 --enable-qtx) _qtx=yes ;;
1164 --disable-qtx) _qtx=no ;;
1166 --enable-macosx) _macosx=yes ;;
1167 --disable-macosx) _macosx=no ;;
1168 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1169 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1170 --enable-macosx-bundle) _macosx_bundle=yes;;
1171 --disable-macosx-bundle) _macosx_bundle=no;;
1173 --enable-maemo) _maemo=yes ;;
1174 --disable-maemo) _maemo=no ;;
1176 --enable-sortsub) _sortsub=yes ;;
1177 --disable-sortsub) _sortsub=no ;;
1179 --enable-crash-debug) _crash_debug=yes ;;
1180 --disable-crash-debug) _crash_debug=no ;;
1181 --enable-sighandler) _sighandler=yes ;;
1182 --disable-sighandler) _sighandler=no ;;
1183 --enable-win32dll) _win32dll=yes ;;
1184 --disable-win32dll) _win32dll=no ;;
1186 --enable-sse) _sse=yes ;;
1187 --disable-sse) _sse=no ;;
1188 --enable-sse2) _sse2=yes ;;
1189 --disable-sse2) _sse2=no ;;
1190 --enable-ssse3) _ssse3=yes ;;
1191 --disable-ssse3) _ssse3=no ;;
1192 --enable-mmxext) _mmxext=yes ;;
1193 --disable-mmxext) _mmxext=no ;;
1194 --enable-3dnow) _3dnow=yes ;;
1195 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1196 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1197 --disable-3dnowext) _3dnowext=no ;;
1198 --enable-cmov) _cmov=yes ;;
1199 --disable-cmov) _cmov=no ;;
1200 --enable-fast-cmov) _fast_cmov=yes ;;
1201 --disable-fast-cmov) _fast_cmov=no ;;
1202 --enable-altivec) _altivec=yes ;;
1203 --disable-altivec) _altivec=no ;;
1204 --enable-armv5te) _armv5te=yes ;;
1205 --disable-armv5te) _armv5te=no ;;
1206 --enable-armv6) _armv6=yes ;;
1207 --disable-armv6) _armv6=no ;;
1208 --enable-iwmmxt) _iwmmxt=yes ;;
1209 --disable-iwmmxt) _iwmmxt=no ;;
1210 --enable-mmx) _mmx=yes ;;
1211 --disable-mmx) # 3Dnow! and MMX2 require MMX
1212 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1215 echo "Unknown parameter: $ac_option"
1216 exit 1
1219 esac
1220 done
1222 # Atmos: moved this here, to be correct, if --prefix is specified
1223 test -z "$_bindir" && _bindir="$_prefix/bin"
1224 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1225 test -z "$_mandir" && _mandir="$_prefix/share/man"
1226 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1227 test -z "$_libdir" && _libdir="$_prefix/lib"
1229 # Determine our OS name and CPU architecture
1230 if test -z "$_target" ; then
1231 # OS name
1232 system_name=`uname -s 2>&1`
1233 case "$system_name" in
1234 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1236 IRIX*)
1237 system_name=IRIX
1239 GNU/kFreeBSD)
1240 system_name=FreeBSD
1242 HP-UX*)
1243 system_name=HP-UX
1245 [cC][yY][gG][wW][iI][nN]*)
1246 system_name=CYGWIN
1248 MINGW32*)
1249 system_name=MINGW32
1251 OS/2*)
1252 system_name=OS/2
1255 system_name="$system_name-UNKNOWN"
1257 esac
1260 # host's CPU/instruction set
1261 host_arch=`uname -p 2>&1`
1262 case "$host_arch" in
1263 i386|sparc|ppc|alpha|arm|sh3|mips|vax)
1265 powerpc) # Darwin returns 'powerpc'
1266 host_arch=ppc
1268 *) # uname -p on Linux returns 'unknown' for the processor type,
1269 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1271 # Maybe uname -m (machine hardware name) returns something we
1272 # recognize.
1274 # x86/x86pc is used by QNX
1275 case "`uname -m 2>&1`" in
1276 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 ;;
1277 ia64) host_arch=ia64 ;;
1278 x86_64|amd64)
1279 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1280 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1281 host_arch=x86_64
1282 else
1283 host_arch=i386
1286 macppc|ppc|ppc64) host_arch=ppc ;;
1287 alpha) host_arch=alpha ;;
1288 sparc) host_arch=sparc ;;
1289 sparc64) host_arch=sparc64 ;;
1290 parisc*|hppa*|9000*) host_arch=hppa ;;
1291 arm*|zaurus|cats) host_arch=arm ;;
1292 sh3) host_arch=sh3 ;;
1293 s390) host_arch=s390 ;;
1294 s390x) host_arch=s390x ;;
1295 mips*) host_arch=mips ;;
1296 vax) host_arch=vax ;;
1297 xtensa*) host_arch=xtensa ;;
1298 *) host_arch=UNKNOWN ;;
1299 esac
1301 esac
1302 else # if test -z "$_target"
1303 system_name=`echo $_target | cut -d '-' -f 2`
1304 case "`echo $system_name | tr A-Z a-z`" in
1305 linux) system_name=Linux ;;
1306 freebsd) system_name=FreeBSD ;;
1307 gnu/kfreebsd) system_name=FreeBSD ;;
1308 netbsd) system_name=NetBSD ;;
1309 bsd/os) system_name=BSD/OS ;;
1310 openbsd) system_name=OpenBSD ;;
1311 dragonfly) system_name=DragonFly ;;
1312 sunos) system_name=SunOS ;;
1313 qnx) system_name=QNX ;;
1314 morphos) system_name=MorphOS ;;
1315 amigaos) system_name=AmigaOS ;;
1316 mingw32msvc) system_name=MINGW32 ;;
1317 esac
1318 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1319 host_arch=`echo $_target | cut -d '-' -f 1`
1320 if test `echo $host_arch` != "x86_64" ; then
1321 host_arch=`echo $host_arch | tr '_' '-'`
1325 echo "Detected operating system: $system_name"
1326 echo "Detected host architecture: $host_arch"
1328 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1329 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1333 _timer=timer-linux.c
1334 _getch=getch2.c
1335 if freebsd ; then
1336 _ld_extra="$_ld_extra -L/usr/local/lib"
1337 _inc_extra="$_inc_extra -I/usr/local/include"
1340 if netbsd || dragonfly ; then
1341 _ld_extra="$_ld_extra -L/usr/pkg/lib"
1342 _inc_extra="$_inc_extra -I/usr/pkg/include"
1345 if darwin; then
1346 _ld_extra="$_ld_extra -L/usr/local/lib"
1347 _inc_extra="$_inc_extra -I/usr/local/include"
1348 _timer=timer-darwin.c
1351 if aix ; then
1352 _ld_extra="$_ld_extra -lC"
1355 if irix ; then
1356 _ranlib='ar -r'
1357 elif linux ; then
1358 _ranlib='true'
1361 if win32 ; then
1362 _exesuf=".exe"
1363 # -lwinmm is always needed for osdep/timer-win2.c
1364 _ld_extra="$_ld_extra -lwinmm"
1365 _pe_executable=yes
1366 _timer=timer-win2.c
1369 if mingw32 ; then
1370 _getch=getch2-win.c
1371 _need_shmem=no
1374 if cygwin ; then
1375 _def_confwin32='#define WIN32'
1378 if amigaos ; then
1379 _select=no
1380 _sighandler=no
1381 _stream_cache=no
1382 _def_stream_cache="#undef USE_STREAM_CACHE"
1385 if qnx ; then
1386 _ld_extra="$_ld_extra -lph"
1389 if os2 ; then
1390 _exesuf=".exe"
1391 _getch=getch2-os2.c
1392 _need_shmem=no
1393 _ar="emxomfar -p256"
1394 _ranlib="echo ignoring ranlib"
1395 _ld_extra="$_ld_extra -Zomf -Zstack 16384 -Zbin-files -Zargs-wild -lmmpm2"
1398 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1399 test "$I" && break
1400 done
1403 TMPLOG="configure.log"
1404 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1405 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1406 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1407 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1408 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1410 rm -f "$TMPLOG"
1411 echo configuration: $_configuration > "$TMPLOG"
1412 echo >> "$TMPLOG"
1415 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1416 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1417 # know about '-n'.
1418 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1419 _head() { head -$1 2>/dev/null ; }
1420 else
1421 _head() { head -n $1 2>/dev/null ; }
1423 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1424 _tail() { tail -$1 2>/dev/null ; }
1425 else
1426 _tail() { tail -n $1 2>/dev/null ; }
1429 # Checking CC version...
1430 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1431 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1432 echocheck "$_cc version"
1433 cc_vendor=intel
1434 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1435 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1436 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1437 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1438 # TODO verify older icc/ecc compatibility
1439 case $cc_version in
1441 cc_version="v. ?.??, bad"
1442 cc_fail=yes
1444 10.1)
1445 cc_version="$cc_version, ok"
1448 cc_version="$cc_version, bad"
1449 cc_fail=yes
1451 esac
1452 echores "$cc_version"
1453 else
1454 for _cc in "$_cc" cc gcc ; do
1455 cc_name_tmp=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1456 if test "$cc_name_tmp" = "gcc"; then
1457 cc_name=$cc_name_tmp
1458 echocheck "$_cc version"
1459 cc_vendor=gnu
1460 cc_version=`$_cc -dumpversion 2>&1`
1461 case $cc_version in
1462 2.96*)
1463 cc_fail=yes
1466 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1467 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1468 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1470 esac
1471 echores "$cc_version"
1472 break
1474 done
1475 fi # icc
1476 test "$cc_fail" = yes && die "unsupported compiler version"
1478 echocheck "host cc"
1479 test "$_host_cc" || _host_cc=$_cc
1480 echores $_host_cc
1482 echocheck "cross compilation"
1483 if test $_cross_compile = auto ; then
1484 cat > $TMPC << EOF
1485 int main(void) { return 0; }
1487 _cross_compile=yes
1488 cc_check && "$TMPEXE" && _cross_compile=no
1490 echores $_cross_compile
1492 if test $_cross_compile = yes; then
1493 tmp_run() {
1494 return 0
1498 # ---
1500 # now that we know what compiler should be used for compilation, try to find
1501 # out which assembler is used by the $_cc compiler
1502 if test "$_as" = auto ; then
1503 _as=`$_cc -print-prog-name=as`
1504 test -z "$_as" && _as=as
1507 # XXX: this should be ok..
1508 _cpuinfo="echo"
1510 if test "$_runtime_cpudetection" = no ; then
1512 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1513 # FIXME: Remove the cygwin check once AMD CPUs are supported
1514 if test -r /proc/cpuinfo && ! cygwin; then
1515 # Linux with /proc mounted, extract CPU information from it
1516 _cpuinfo="cat /proc/cpuinfo"
1517 elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then
1518 # FreeBSD with Linux emulation /proc mounted,
1519 # extract CPU information from it
1520 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1521 elif darwin && ! x86_32 ; then
1522 # use hostinfo on Darwin
1523 _cpuinfo="hostinfo"
1524 elif aix; then
1525 # use 'lsattr' on AIX
1526 _cpuinfo="lsattr -E -l proc0 -a type"
1527 elif x86; then
1528 # all other OSes try to extract CPU information from a small helper
1529 # program cpuinfo instead
1530 $_cc -o cpuinfo$_exesuf cpuinfo.c
1531 _cpuinfo="./cpuinfo$_exesuf"
1534 if x86 ; then
1535 # gather more CPU information
1536 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1537 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1538 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1539 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1540 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1542 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1544 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1545 -e s/xmm/sse/ -e s/kni/sse/`
1547 for ext in $pparam ; do
1548 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1549 done
1551 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1552 test $_sse = kernel_check && _mmxext=kernel_check
1554 echocheck "CPU vendor"
1555 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1557 echocheck "CPU type"
1558 echores "$pname"
1561 fi # test "$_runtime_cpudetection" = no
1563 if x86 && test "$_runtime_cpudetection" = no ; then
1564 extcheck() {
1565 if test "$1" = kernel_check ; then
1566 echocheck "kernel support of $2"
1567 cat > $TMPC <<EOF
1568 #include <signal.h>
1569 void catch() { exit(1); }
1570 int main(void) {
1571 signal(SIGILL, catch);
1572 __asm__ __volatile__ ("$3":::"memory"); return 0;
1576 if cc_check && tmp_run ; then
1577 eval _$2=yes
1578 echores "yes"
1579 _optimizing="$_optimizing $2"
1580 return 0
1581 else
1582 eval _$2=no
1583 echores "failed"
1584 echo "It seems that your kernel does not correctly support $2."
1585 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1586 return 1
1589 return 0
1592 extcheck $_mmx "mmx" "emms"
1593 extcheck $_mmxext "mmxext" "sfence"
1594 extcheck $_3dnow "3dnow" "femms"
1595 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1596 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1597 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1598 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1599 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1601 echocheck "mtrr support"
1602 if test "$_mtrr" = kernel_check ; then
1603 _mtrr="yes"
1604 _optimizing="$_optimizing mtrr"
1606 echores "$_mtrr"
1608 if test "$_gcc3_ext" != ""; then
1609 # if we had to disable sse/sse2 because the active kernel does not
1610 # support this instruction set extension, we also have to tell
1611 # gcc3 to not generate sse/sse2 instructions for normal C code
1612 cat > $TMPC << EOF
1613 int main(void) { return 0; }
1615 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1621 _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'
1622 case "$host_arch" in
1623 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1624 _arch='X86 X86_32'
1625 _target_arch_x86="ARCH_X86 = yes"
1626 _target_arch="ARCH_X86_32 = yes"
1627 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1628 iproc=486
1629 proc=i486
1632 if test "$_runtime_cpudetection" = no ; then
1633 case "$pvendor" in
1634 AuthenticAMD)
1635 case "$pfamily" in
1636 3) proc=i386 iproc=386 ;;
1637 4) proc=i486 iproc=486 ;;
1638 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1639 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1640 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1641 proc=k6-3
1642 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1643 proc=geode
1644 elif test "$pmodel" -ge 8; then
1645 proc=k6-2
1646 elif test "$pmodel" -ge 6; then
1647 proc=k6
1648 else
1649 proc=i586
1652 6) iproc=686
1653 # It's a bit difficult to determine the correct type of Family 6
1654 # AMD CPUs just from their signature. Instead, we check directly
1655 # whether it supports SSE.
1656 if test "$_sse" = yes; then
1657 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1658 proc=athlon-xp
1659 else
1660 # Again, gcc treats athlon and athlon-tbird similarly.
1661 proc=athlon
1664 15) iproc=686
1665 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1666 # caught and remedied in the optimization tests below.
1667 proc=k8
1670 *) proc=k8 iproc=686 ;;
1671 esac
1673 GenuineIntel)
1674 case "$pfamily" in
1675 3) proc=i386 iproc=386 ;;
1676 4) proc=i486 iproc=486 ;;
1677 5) iproc=586
1678 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1679 proc=pentium-mmx # 4 is desktop, 8 is mobile
1680 else
1681 proc=i586
1684 6) iproc=686
1685 if test "$pmodel" -ge 15; then
1686 proc=core2
1687 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1688 proc=pentium-m
1689 elif test "$pmodel" -ge 7; then
1690 proc=pentium3
1691 elif test "$pmodel" -ge 3; then
1692 proc=pentium2
1693 else
1694 proc=i686
1697 15) iproc=686
1698 # A nocona in 32-bit mode has no more capabilities than a prescott.
1699 if test "$pmodel" -ge 3; then
1700 proc=prescott
1701 else
1702 proc=pentium4
1704 test $_fast_cmov = "auto" && _fast_cmov=no
1706 *) proc=prescott iproc=686 ;;
1707 esac
1709 CentaurHauls)
1710 case "$pfamily" in
1711 5) iproc=586
1712 if test "$pmodel" -ge 8; then
1713 proc=winchip2
1714 elif test "$pmodel" -ge 4; then
1715 proc=winchip-c6
1716 else
1717 proc=i586
1720 6) iproc=686
1721 if test "$pmodel" -ge 9; then
1722 proc=c3-2
1723 else
1724 proc=c3
1725 iproc=586
1728 *) proc=i686 iproc=i686 ;;
1729 esac
1731 unknown)
1732 case "$pfamily" in
1733 3) proc=i386 iproc=386 ;;
1734 4) proc=i486 iproc=486 ;;
1735 *) proc=i586 iproc=586 ;;
1736 esac
1739 proc=i586 iproc=586 ;;
1740 esac
1741 fi # test "$_runtime_cpudetection" = no
1744 # check that gcc supports our CPU, if not, fall back to earlier ones
1745 # LGB: check -mcpu and -march swithing step by step with enabling
1746 # to fall back till 386.
1748 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1750 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1751 cpuopt=-mtune
1752 else
1753 cpuopt=-mcpu
1756 echocheck "GCC & CPU optimization abilities"
1757 cat > $TMPC << EOF
1758 int main(void) { return 0; }
1760 if test "$_runtime_cpudetection" = no ; then
1761 cc_check -march=native && proc=native
1762 if test "$proc" = "k8"; then
1763 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1765 if test "$proc" = "athlon-xp"; then
1766 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1768 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1769 cc_check -march=$proc $cpuopt=$proc || proc=k6
1771 if test "$proc" = "k6" || test "$proc" = "c3"; then
1772 if ! cc_check -march=$proc $cpuopt=$proc; then
1773 if cc_check -march=i586 $cpuopt=i686; then
1774 proc=i586-i686
1775 else
1776 proc=i586
1780 if test "$proc" = "prescott" ; then
1781 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1783 if test "$proc" = "core2" ; then
1784 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1786 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
1787 cc_check -march=$proc $cpuopt=$proc || proc=i686
1789 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1790 cc_check -march=$proc $cpuopt=$proc || proc=i586
1792 if test "$proc" = "i586"; then
1793 cc_check -march=$proc $cpuopt=$proc || proc=i486
1795 if test "$proc" = "i486" ; then
1796 cc_check -march=$proc $cpuopt=$proc || proc=i386
1798 if test "$proc" = "i386" ; then
1799 cc_check -march=$proc $cpuopt=$proc || proc=error
1801 if test "$proc" = "error" ; then
1802 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1803 _mcpu=""
1804 _march=""
1805 _optimizing=""
1806 elif test "$proc" = "i586-i686"; then
1807 _march="-march=i586"
1808 _mcpu="$cpuopt=i686"
1809 _optimizing="$proc"
1810 else
1811 _march="-march=$proc"
1812 _mcpu="$cpuopt=$proc"
1813 _optimizing="$proc"
1815 else # if test "$_runtime_cpudetection" = no
1816 _mcpu="$cpuopt=generic"
1817 # at least i486 required, for bswap instruction
1818 _march="-march=i486"
1819 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1820 cc_check $_mcpu || _mcpu=""
1821 cc_check $_march $_mcpu || _march=""
1824 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1825 ## autodetected mcpu/march parameters
1826 if test "$_target" ; then
1827 # TODO: it may be a good idea to check GCC and fall back in all cases
1828 if test "$host_arch" = "i586-i686"; then
1829 _march="-march=i586"
1830 _mcpu="$cpuopt=i686"
1831 else
1832 _march="-march=$host_arch"
1833 _mcpu="$cpuopt=$host_arch"
1836 proc="$host_arch"
1838 case "$proc" in
1839 i386) iproc=386 ;;
1840 i486) iproc=486 ;;
1841 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1842 i686|athlon*|pentium*) iproc=686 ;;
1843 *) iproc=586 ;;
1844 esac
1847 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1848 _fast_cmov="yes"
1849 else
1850 _fast_cmov="no"
1853 echores "$proc"
1856 ia64)
1857 _arch='IA64'
1858 _target_arch='ARCH_IA64 = yes'
1859 iproc='ia64'
1860 proc=''
1861 _march=''
1862 _mcpu=''
1863 _optimizing=''
1866 x86_64|amd64)
1867 _arch='X86 X86_64'
1868 _target_arch='ARCH_X86_64 = yes'
1869 _target_arch_x86="ARCH_X86 = yes"
1870 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1871 iproc='x86_64'
1873 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1874 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1875 cpuopt=-mtune
1876 else
1877 cpuopt=-mcpu
1879 if test "$_runtime_cpudetection" = no ; then
1880 case "$pvendor" in
1881 AuthenticAMD)
1882 proc=k8;;
1883 GenuineIntel)
1884 case "$pfamily" in
1885 6) proc=core2;;
1887 # 64-bit prescotts exist, but as far as GCC is concerned they
1888 # have the same capabilities as a nocona.
1889 proc=nocona
1890 test $_fast_cmov = "auto" && _fast_cmov=no
1892 esac
1895 proc=error;;
1896 esac
1897 fi # test "$_runtime_cpudetection" = no
1899 echocheck "GCC & CPU optimization abilities"
1900 cat > $TMPC << EOF
1901 int main(void) { return 0; }
1903 # This is a stripped-down version of the i386 fallback.
1904 if test "$_runtime_cpudetection" = no ; then
1905 cc_check -march=native && proc=native
1906 # --- AMD processors ---
1907 if test "$proc" = "k8"; then
1908 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1910 # This will fail if gcc version < 3.3, which is ok because earlier
1911 # versions don't really support 64-bit on amd64.
1912 # Is this a valid assumption? -Corey
1913 if test "$proc" = "athlon-xp"; then
1914 cc_check -march=$proc $cpuopt=$proc || proc=error
1916 # --- Intel processors ---
1917 if test "$proc" = "core2"; then
1918 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1920 if test "$proc" = "nocona"; then
1921 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1923 if test "$proc" = "pentium4"; then
1924 cc_check -march=$proc $cpuopt=$proc || proc=error
1927 _march="-march=$proc"
1928 _mcpu="$cpuopt=$proc"
1929 if test "$proc" = "error" ; then
1930 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1931 _mcpu=""
1932 _march=""
1934 else # if test "$_runtime_cpudetection" = no
1935 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1936 _march="-march=x86-64"
1937 _mcpu="$cpuopt=generic"
1938 cc_check $_mcpu || _mcpu="x86-64"
1939 cc_check $_mcpu || _mcpu=""
1940 cc_check $_march $_mcpu || _march=""
1943 _optimizing=""
1945 echores "$proc"
1948 sparc)
1949 _arch='SPARC'
1950 _target_arch='ARCH_SPARC = yes'
1951 iproc='sparc'
1952 if sunos ; then
1953 echocheck "CPU type"
1954 karch=`uname -m`
1955 case "`echo $karch`" in
1956 sun4) proc=v7 ;;
1957 sun4c) proc=v7 ;;
1958 sun4d) proc=v8 ;;
1959 sun4m) proc=v8 ;;
1960 sun4u) proc=ultrasparc _vis='yes' ;;
1961 sun4v) proc=v9 ;;
1962 *) proc=v8 ;;
1963 esac
1964 echores "$proc"
1965 else
1966 proc=v8
1968 _march=''
1969 _mcpu="-mcpu=$proc"
1970 _optimizing="$proc"
1973 sparc64)
1974 _arch='SPARC'
1975 _target_arch='ARCH_SPARC = yes'
1976 _vis='yes'
1977 iproc='sparc'
1978 proc='ultrasparc'
1979 _march=''
1980 _mcpu="-mcpu=$proc"
1981 _optimizing="$proc"
1984 arm|armv4l|armv5tel)
1985 _arch='ARM ARMV4L'
1986 _target_arch='ARCH_ARMV4L = yes'
1987 iproc='arm'
1988 proc=''
1989 _march=''
1990 _mcpu=''
1991 _optimizing=''
1994 sh3)
1995 _arch='SH3'
1996 _target_arch='ARCH_SH3 = yes'
1997 iproc='sh3'
1998 proc=''
1999 _march='-m3'
2000 _mcpu='-ml'
2001 _optimizing=''
2004 ppc|powerpc)
2005 _arch='POWERPC PPC'
2006 _def_dcbzl='#undef HAVE_DCBZL'
2007 _target_arch='ARCH_POWERPC = yes'
2008 iproc='ppc'
2009 proc=''
2010 _march=''
2011 _mcpu=''
2012 _optimizing=''
2014 echocheck "CPU type"
2015 case $system_name in
2016 Linux)
2017 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2018 if test -n "`$_cpuinfo | grep altivec`"; then
2019 test $_altivec = auto && _altivec=yes
2022 Darwin)
2023 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2024 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2025 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2026 test $_altivec = auto && _altivec=yes
2029 NetBSD)
2030 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2031 case $cc_version in
2032 2*|3.0*|3.1*|3.2*|3.3*)
2035 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2036 test $_altivec = auto && _altivec=yes
2039 esac
2041 AIX)
2042 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2044 esac
2045 if test "$_altivec" = yes; then
2046 echores "$proc altivec"
2047 else
2048 _altivec=no
2049 echores "$proc"
2052 echocheck "GCC & CPU optimization abilities"
2054 if test -n "$proc"; then
2055 case "$proc" in
2056 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2057 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2058 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2059 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2060 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2061 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2062 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2063 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2064 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2065 *) ;;
2066 esac
2067 # gcc 3.1(.1) and up supports 7400 and 7450
2068 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2069 case "$proc" in
2070 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2071 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2072 *) ;;
2073 esac
2075 # gcc 3.2 and up supports 970
2076 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2077 case "$proc" in
2078 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2079 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2080 *) ;;
2081 esac
2083 # gcc 3.3 and up supports POWER4
2084 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2085 case "$proc" in
2086 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2087 *) ;;
2088 esac
2090 # gcc 3.4 and up supports 440*
2091 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2092 case "$proc" in
2093 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2094 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2095 *) ;;
2096 esac
2098 # gcc 4.0 and up supports POWER5
2099 if test "$_cc_major" -ge "4"; then
2100 case "$proc" in
2101 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2102 *) ;;
2103 esac
2107 if test -n "$_mcpu"; then
2108 _optimizing=`echo $_mcpu | cut -c 8-`
2109 echores "$_optimizing"
2110 else
2111 echores "none"
2116 alpha)
2117 _arch='ALPHA'
2118 _target_arch='ARCH_ALPHA = yes'
2119 iproc='alpha'
2120 _march=''
2122 echocheck "CPU type"
2123 cat > $TMPC << EOF
2124 int main(void) {
2125 unsigned long ver, mask;
2126 asm ("implver %0" : "=r" (ver));
2127 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2128 printf("%ld-%x\n", ver, ~mask);
2129 return 0;
2132 $_cc -o "$TMPEXE" "$TMPC"
2133 case `"$TMPEXE"` in
2135 0-0) proc="ev4"; _mvi="0";;
2136 1-0) proc="ev5"; _mvi="0";;
2137 1-1) proc="ev56"; _mvi="0";;
2138 1-101) proc="pca56"; _mvi="1";;
2139 2-303) proc="ev6"; _mvi="1";;
2140 2-307) proc="ev67"; _mvi="1";;
2141 2-1307) proc="ev68"; _mvi="1";;
2142 esac
2143 echores "$proc"
2145 echocheck "GCC & CPU optimization abilities"
2146 if test "$proc" = "ev68" ; then
2147 cc_check -mcpu=$proc || proc=ev67
2149 if test "$proc" = "ev67" ; then
2150 cc_check -mcpu=$proc || proc=ev6
2152 _mcpu="-mcpu=$proc"
2153 echores "$proc"
2155 _optimizing="$proc"
2158 mips)
2159 _arch='SGI_MIPS'
2160 _target_arch='ARCH_SGI_MIPS = yes'
2161 iproc='sgi-mips'
2162 proc=''
2163 _march=''
2164 _mcpu=''
2165 _optimizing=''
2167 if irix ; then
2168 echocheck "CPU type"
2169 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2170 case "`echo $proc`" in
2171 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2172 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2173 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2174 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2175 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2176 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2177 esac
2178 # gcc < 3.x does not support -mtune.
2179 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2180 _mcpu=''
2182 echores "$proc"
2187 hppa)
2188 _arch='PA_RISC'
2189 _target_arch='ARCH_PA_RISC = yes'
2190 iproc='PA-RISC'
2191 proc=''
2192 _march=''
2193 _mcpu=''
2194 _optimizing=''
2197 s390)
2198 _arch='S390'
2199 _target_arch='ARCH_S390 = yes'
2200 iproc='390'
2201 proc=''
2202 _march=''
2203 _mcpu=''
2204 _optimizing=''
2207 s390x)
2208 _arch='S390X'
2209 _target_arch='ARCH_S390X = yes'
2210 iproc='390x'
2211 proc=''
2212 _march=''
2213 _mcpu=''
2214 _optimizing=''
2217 vax)
2218 _arch='VAX'
2219 _target_arch='ARCH_VAX = yes'
2220 iproc='vax'
2221 proc=''
2222 _march=''
2223 _mcpu=''
2224 _optimizing=''
2227 xtensa)
2228 _arch='XTENSA'
2229 _target_arch='ARCH_XTENSA = yes'
2230 iproc='xtensa'
2231 proc=''
2232 _march=''
2233 _mcpu=''
2234 _optimizing=''
2237 generic)
2238 _arch='GENERIC'
2239 _target_arch='ARCH_GENERIC = yes'
2240 iproc=''
2241 proc=''
2242 _march=''
2243 _mcpu=''
2244 _optimizing=''
2248 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2249 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2250 die "unsupported architecture $host_arch"
2252 esac # case "$host_arch" in
2254 if test "$_runtime_cpudetection" = yes ; then
2255 if x86 ; then
2256 test "$_cmov" != no && _cmov=yes
2257 x86_32 && _cmov=no
2258 test "$_mmx" != no && _mmx=yes
2259 test "$_3dnow" != no && _3dnow=yes
2260 test "$_3dnowext" != no && _3dnowext=yes
2261 test "$_mmxext" != no && _mmxext=yes
2262 test "$_sse" != no && _sse=yes
2263 test "$_sse2" != no && _sse2=yes
2264 test "$_ssse3" != no && _ssse3=yes
2265 test "$_mtrr" != no && _mtrr=yes
2267 if ppc; then
2268 _altivec=yes
2273 echocheck "extern symbol prefix"
2274 cat > $TMPC << EOF
2275 int ff_extern;
2277 cc_check -c || die "Symbol mangling check failed."
2278 sym=$(nm -P -g $TMPEXE)
2279 extern_prefix=${sym%%ff_extern*}
2280 _def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2281 echores $extern_prefix
2284 echocheck "assembler support of -pipe option"
2285 cat > $TMPC << EOF
2286 int main(void) { return 0; }
2288 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2291 echocheck "compiler support of named assembler arguments"
2292 _named_asm_args=yes
2293 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2294 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2295 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2296 _named_asm_args=no
2297 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2299 echores $_named_asm_args
2302 if darwin && test "$cc_vendor" = "gnu" ; then
2303 echocheck "GCC support of -mstackrealign"
2304 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2305 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2306 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2307 # wrong code with this flag, but this can be worked around by adding
2308 # -fno-unit-at-a-time as described in the blog post at
2309 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2310 cat > $TMPC << EOF
2311 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2312 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2314 cc_check -O4 -mstackrealign && tmp_run && _stackrealign=-mstackrealign
2315 test -z "$_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2316 && tmp_run && _stackrealign="-mstackrealign -fno-unit-at-a-time"
2317 test -n "$_stackrealign" && echores "yes" || echores "no"
2318 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2321 # Checking for CFLAGS
2322 _install_strip="-s"
2323 if test "$_profile" != "" || test "$_debug" != "" ; then
2324 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2325 _install_strip=
2326 elif test -z "$CFLAGS" ; then
2327 if test "$cc_vendor" = "intel" ; then
2328 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2329 elif test "$cc_vendor" != "gnu" ; then
2330 CFLAGS="-O2 $_march $_mcpu $_pipe"
2331 else
2332 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2334 else
2335 _warn_CFLAGS=yes
2337 if test -n "$LDFLAGS" ; then
2338 _ld_extra="$_ld_extra $LDFLAGS"
2339 _warn_CFLAGS=yes
2340 elif test "$cc_vendor" = "intel" ; then
2341 _ld_extra="$_ld_extra -i-static"
2343 if test -n "$CPPFLAGS" ; then
2344 _inc_extra="$_inc_extra $CPPFLAGS"
2345 _warn_CFLAGS=yes
2350 if x86_32 ; then
2351 # Checking assembler (_as) compatibility...
2352 # Added workaround for older as that reads from stdin by default - atmos
2353 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2354 echocheck "assembler ($_as $as_version)"
2356 _pref_as_version='2.9.1'
2357 echo 'nop' > $TMPS
2358 if test "$_mmx" = yes ; then
2359 echo 'emms' >> $TMPS
2361 if test "$_3dnow" = yes ; then
2362 _pref_as_version='2.10.1'
2363 echo 'femms' >> $TMPS
2365 if test "$_3dnowext" = yes ; then
2366 _pref_as_version='2.10.1'
2367 echo 'pswapd %mm0, %mm0' >> $TMPS
2369 if test "$_mmxext" = yes ; then
2370 _pref_as_version='2.10.1'
2371 echo 'movntq %mm0, (%eax)' >> $TMPS
2373 if test "$_sse" = yes ; then
2374 _pref_as_version='2.10.1'
2375 echo 'xorps %xmm0, %xmm0' >> $TMPS
2377 #if test "$_sse2" = yes ; then
2378 # _pref_as_version='2.11'
2379 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2381 if test "$_cmov" = yes ; then
2382 _pref_as_version='2.10.1'
2383 echo 'cmovb %eax, %ebx' >> $TMPS
2385 if test "$_ssse3" = yes ; then
2386 _pref_as_version='2.16.92'
2387 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2389 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2391 if test "$as_verc_fail" != yes ; then
2392 echores "ok"
2393 else
2394 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2395 echores "failed"
2396 die "obsolete binutils version"
2399 fi #if x86_32
2401 echocheck ".align is a power of two"
2402 if test "$_asmalign_pot" = auto ; then
2403 _asmalign_pot=no
2404 cat > $TMPC << EOF
2405 main(void) { asm (".align 3"); }
2407 cc_check && _asmalign_pot=yes
2409 if test "$_asmalign_pot" = "yes" ; then
2410 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2411 else
2412 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2414 echores $_asmalign_pot
2417 #FIXME: This should happen before the check for CFLAGS..
2418 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2420 # check if AltiVec is supported by the compiler, and how to enable it
2421 echocheck "GCC AltiVec flags"
2422 cat > $TMPC << EOF
2423 int main(void) { return 0; }
2425 cc_check -maltivec -mabi=altivec \
2426 && _altivec_gcc_flags="-maltivec -mabi=altivec" \
2427 || { cc_check -faltivec && _altivec_gcc_flags=-faltivec ; } \
2428 || { _altivec=no && _altivec_gcc_flags="none, AltiVec disabled" ; }
2429 echores "$_altivec_gcc_flags"
2431 # check if <altivec.h> should be included
2432 echocheck "altivec.h"
2433 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2434 _have_altivec_h=no
2435 cat > $TMPC << EOF
2436 #include <altivec.h>
2437 int main(void) { return 0; }
2439 cc_check $_altivec_gcc_flags && _have_altivec_h=yes \
2440 && _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2441 echores "$_have_altivec_h"
2443 # Disable runtime cpudetection if we cannot generate AltiVec code or
2444 # AltiVec is disabled by the user.
2445 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2446 && _runtime_cpudetection=no
2448 # Show that we are optimizing for AltiVec (if enabled and supported).
2449 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2450 && _optimizing="$_optimizing altivec"
2452 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2453 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2456 if arm ; then
2457 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2458 if test $_armv5te = "auto" ; then
2459 cat > $TMPC << EOF
2460 int main(void) { __asm__ __volatile__ ("qadd r0, r0, r0"); }
2462 _armv5te=no
2463 cc_check && _armv5te=yes
2465 echores "$_armv5te"
2467 echocheck "ARMv6 (SIMD instructions)"
2468 if test $_armv6 = "auto" ; then
2469 cat > $TMPC << EOF
2470 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2472 _armv6=no
2473 cc_check && _armv6=yes
2475 echores "$_armv6"
2477 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2478 if test $_iwmmxt = "auto" ; then
2479 cat > $TMPC << EOF
2480 int main(void) { __asm__ __volatile__ ("wunpckelub wr6, wr4"); }
2482 _iwmmxt=no
2483 cc_check && _iwmmxt=yes
2485 echores "$_iwmmxt"
2488 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
2489 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2490 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2491 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2492 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2493 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2494 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2495 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2496 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2497 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2498 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2499 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2500 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2501 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2502 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2503 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2505 # Checking kernel version...
2506 if x86_32 && linux ; then
2507 _k_verc_problem=no
2508 kernel_version=`uname -r 2>&1`
2509 echocheck "$system_name kernel version"
2510 case "$kernel_version" in
2511 '') kernel_version="?.??"; _k_verc_fail=yes;;
2512 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2513 _k_verc_problem=yes;;
2514 esac
2515 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2516 _k_verc_fail=yes
2518 if test "$_k_verc_fail" ; then
2519 echores "$kernel_version, fail"
2520 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2521 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2522 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2523 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2524 echo "2.2.x you must upgrade it to get SSE support!"
2525 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2526 else
2527 echores "$kernel_version, ok"
2531 ######################
2532 # MAIN TESTS GO HERE #
2533 ######################
2536 echocheck "-lposix"
2537 cat > $TMPC <<EOF
2538 int main(void) { return 0; }
2540 if cc_check -lposix ; then
2541 _ld_extra="$_ld_extra -lposix"
2542 echores "yes"
2543 else
2544 echores "no"
2547 echocheck "-lm"
2548 cat > $TMPC <<EOF
2549 int main(void) { return 0; }
2551 if cc_check -lm ; then
2552 _ld_lm="-lm"
2553 echores "yes"
2554 else
2555 _ld_lm=""
2556 echores "no"
2560 echocheck "langinfo"
2561 if test "$_langinfo" = auto ; then
2562 cat > $TMPC <<EOF
2563 #include <langinfo.h>
2564 int main(void) { nl_langinfo(CODESET); return 0; }
2566 _langinfo=no
2567 cc_check && _langinfo=yes
2569 if test "$_langinfo" = yes ; then
2570 _def_langinfo='#define USE_LANGINFO 1'
2571 else
2572 _def_langinfo='#undef USE_LANGINFO'
2574 echores "$_langinfo"
2577 echocheck "language"
2578 test -z "$_language" && _language=$LINGUAS
2579 _language=`echo $_language | sed 's/,/ /g'`
2580 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2581 for lang in $_language ; do
2582 test "$lang" = all && lang=en
2583 if test -f "help/help_mp-${lang}.h" ; then
2584 _language=$lang
2585 break
2586 else
2587 echo ${_echo_n} "$lang not found, ${_echo_c}"
2588 _language=`echo $_language | sed "s/$lang *//"`
2590 done
2591 test -z "$_language" && _language=en
2592 _mp_help="help/help_mp-${_language}.h"
2593 test -f $_mp_help || die "$_mp_help not found"
2594 for lang in $LANGUAGES ; do
2595 if test -f "DOCS/man/$lang/mplayer.1" ; then
2596 MAN_LANG_ALL="$lang $MAN_LANG_ALL"
2598 done
2599 MAN_LANG="$(echo $MAN_LANG_ALL | sed 's/en//')"
2600 _doc_lang=$_language
2601 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2602 echores "using $_language (man pages: $MAN_LANG_ALL)"
2605 echocheck "enable sighandler"
2606 if test "$_sighandler" = yes ; then
2607 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2608 else
2609 _def_sighandler='#undef ENABLE_SIGHANDLER'
2611 echores "$_sighandler"
2613 echocheck "runtime cpudetection"
2614 if test "$_runtime_cpudetection" = yes ; then
2615 _optimizing="Runtime CPU-Detection enabled"
2616 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2617 else
2618 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2620 echores "$_runtime_cpudetection"
2623 echocheck "restrict keyword"
2624 for restrict_keyword in restrict __restrict __restrict__ ; do
2625 echo "void foo(char * $restrict_keyword p); int main(void) {}" > $TMPC
2626 if cc_check; then
2627 _def_restrict_keyword=$restrict_keyword
2628 break;
2630 done
2631 if [ -n "$_def_restrict_keyword" ]; then
2632 echores "$_def_restrict_keyword"
2633 else
2634 echores "none"
2636 # Avoid infinite recursion loop ("#define restrict restrict")
2637 if [ "$_def_restrict_keyword" != "restrict" ]; then
2638 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2639 else
2640 _def_restrict_keyword=""
2644 echocheck "__builtin_expect"
2645 # GCC branch prediction hint
2646 cat > $TMPC << EOF
2647 int foo (int a) {
2648 a = __builtin_expect (a, 10);
2649 return a == 10 ? 0 : 1;
2651 int main(void) { return foo(10) && foo(0); }
2653 _builtin_expect=no
2654 cc_check && _builtin_expect=yes
2655 if test "$_builtin_expect" = yes ; then
2656 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2657 else
2658 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2660 echores "$_builtin_expect"
2663 echocheck "kstat"
2664 cat > $TMPC << EOF
2665 #include <kstat.h>
2666 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2668 _kstat=no
2669 cc_check -lkstat && _kstat=yes
2670 if test "$_kstat" = yes ; then
2671 _def_kstat="#define HAVE_LIBKSTAT 1"
2672 _ld_extra="$_ld_extra -lkstat"
2673 else
2674 _def_kstat="#undef HAVE_LIBKSTAT"
2676 echores "$_kstat"
2679 echocheck "posix4"
2680 # required for nanosleep on some systems
2681 cat > $TMPC << EOF
2682 #include <time.h>
2683 int main(void) { (void) nanosleep(0, 0); return 0; }
2685 _posix4=no
2686 cc_check -lposix4 && _posix4=yes
2687 if test "$_posix4" = yes ; then
2688 _ld_extra="$_ld_extra -lposix4"
2690 echores "$_posix4"
2692 for func in llrint lrint lrintf round roundf; do
2693 echocheck $func
2694 cat > $TMPC << EOF
2695 #include <math.h>
2696 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
2698 eval _$func=no
2699 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2700 if eval test "x\$_$func" = "xyes"; then
2701 eval _def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 1\""
2702 echores yes
2703 else
2704 eval _def_$func="\"#undef HAVE_`echo $func | tr '[a-z]' '[A-Z]'`\""
2705 echores no
2707 done
2710 echocheck "mkstemp"
2711 cat > $TMPC << EOF
2712 #include <stdlib.h>
2713 int main(void) { char a; mkstemp(&a); return 0; }
2715 _mkstemp=no
2716 cc_check && _mkstemp=yes
2717 if test "$_mkstemp" = yes ; then
2718 _def_mkstemp='#define HAVE_MKSTEMP 1'
2719 else
2720 _def_mkstemp='#undef HAVE_MKSTEMP'
2722 echores "$_mkstemp"
2725 echocheck "nanosleep"
2726 # also check for nanosleep
2727 cat > $TMPC << EOF
2728 #include <time.h>
2729 int main(void) { (void) nanosleep(0, 0); return 0; }
2731 _nanosleep=no
2732 cc_check && _nanosleep=yes
2733 if test "$_nanosleep" = yes ; then
2734 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2735 else
2736 _def_nanosleep='#undef HAVE_NANOSLEEP'
2738 echores "$_nanosleep"
2741 echocheck "socklib"
2742 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2743 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2744 cat > $TMPC << EOF
2745 #include <netdb.h>
2746 #include <sys/socket.h>
2747 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2749 _socklib=no
2750 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2751 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2752 done
2753 if test $_winsock2 = auto && ! cygwin ; then
2754 _winsock2=no
2755 cat > $TMPC << EOF
2756 #include <winsock2.h>
2757 int main(void) { (void) gethostbyname(0); return 0; }
2759 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2761 test "$_ld_sock" && _res_comment="using $_ld_sock"
2762 echores "$_socklib"
2765 if test $_winsock2 = yes ; then
2766 _ld_sock="-lws2_32"
2767 _def_winsock2='#define HAVE_WINSOCK2 1'
2768 else
2769 _def_winsock2='#undef HAVE_WINSOCK2'
2773 _use_aton=no
2774 echocheck "inet_pton()"
2775 cat > $TMPC << EOF
2776 #include <sys/types.h>
2777 #include <sys/socket.h>
2778 #include <arpa/inet.h>
2779 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2781 if test "$_winsock2" = yes ; then
2782 _res_comment="using winsock2 functions instead"
2783 echores "no"
2784 elif cc_check $_ld_sock ; then
2785 # NOTE: Linux has libresolv but does not need it
2787 _res_comment="using $_ld_sock"
2788 echores "yes"
2789 elif cc_check $_ld_sock -lresolv ; then
2790 # NOTE: needed for SunOS at least
2791 _ld_sock="$_ld_sock -lresolv"
2792 _res_comment="using $_ld_sock"
2793 echores "yes"
2794 else
2795 _res_comment="trying inet_aton next"
2796 echores "no"
2798 echocheck "inet_aton()"
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_aton(0, 0); return 0; }
2805 _use_aton=yes
2806 if cc_check $_ld_sock ; then
2807 # NOTE: Linux has libresolv but does not need it
2809 _res_comment="using $_ld_sock"
2810 elif cc_check $_ld_sock -lresolv ; then
2811 # NOTE: needed for SunOS at least
2812 _ld_sock="$_ld_sock -lresolv"
2813 _res_comment="using $_ld_sock"
2814 else
2815 _use_aton=no
2816 _network=no
2817 _res_comment="network support disabled"
2819 echores "$_use_aton"
2822 _def_use_aton='#undef USE_ATON'
2823 if test "$_use_aton" = yes; then
2824 _def_use_aton='#define USE_ATON 1'
2827 echocheck "network"
2828 # FIXME network check
2829 if test "$_network" = yes ; then
2830 _def_network='#define MPLAYER_NETWORK 1'
2831 _ld_extra="$_ld_extra $_ld_sock"
2832 _inputmodules="network $_inputmodules"
2833 else
2834 _noinputmodules="network $_noinputmodules"
2835 _def_network='#undef MPLAYER_NETWORK'
2836 _ftp=no
2838 echores "$_network"
2840 echocheck "inttypes.h (required)"
2841 cat > $TMPC << EOF
2842 #include <inttypes.h>
2843 int main(void) { return 0; }
2845 _inttypes=no
2846 cc_check && _inttypes=yes
2847 echores "$_inttypes"
2849 if test "$_inttypes" = no ; then
2850 echocheck "bitypes.h (inttypes.h predecessor)"
2851 cat > $TMPC << EOF
2852 #include <sys/bitypes.h>
2853 int main(void) { return 0; }
2855 cc_check && _inttypes=yes
2856 if test "$_inttypes" = yes ; then
2857 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."
2858 else
2859 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2864 echocheck "int_fastXY_t in inttypes.h"
2865 cat > $TMPC << EOF
2866 #include <inttypes.h>
2867 int main(void) {
2868 volatile int_fast16_t v= 0;
2869 return v; }
2871 _fast_inttypes=no
2872 cc_check && _fast_inttypes=yes
2873 if test "$_fast_inttypes" = no ; then
2874 _def_fast_inttypes='
2875 typedef signed char int_fast8_t;
2876 typedef signed int int_fast16_t;
2877 typedef signed int int_fast32_t;
2878 typedef signed long long int_fast64_t;
2879 typedef unsigned char uint_fast8_t;
2880 typedef unsigned int uint_fast16_t;
2881 typedef unsigned int uint_fast32_t;
2882 typedef unsigned long long uint_fast64_t;'
2884 echores "$_fast_inttypes"
2887 echocheck "word size"
2888 _mp_wordsize="#undef MP_WORDSIZE"
2889 cat > $TMPC << EOF
2890 #include <stdio.h>
2891 #include <sys/types.h>
2892 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2894 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2895 echores "$_wordsize"
2898 echocheck "malloc.h"
2899 cat > $TMPC << EOF
2900 #include <malloc.h>
2901 int main(void) { (void) malloc(0); return 0; }
2903 _malloc=no
2904 cc_check && _malloc=yes
2905 if test "$_malloc" = yes ; then
2906 _def_malloc='#define HAVE_MALLOC_H 1'
2907 else
2908 _def_malloc='#undef HAVE_MALLOC_H'
2910 # malloc.h emits a warning in FreeBSD and OpenBSD
2911 freebsd || openbsd || dragonfly && _def_malloc='#undef HAVE_MALLOC_H'
2912 echores "$_malloc"
2915 echocheck "memalign()"
2916 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2917 cat > $TMPC << EOF
2918 #include <malloc.h>
2919 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
2921 _memalign=no
2922 cc_check && _memalign=yes
2923 if test "$_memalign" = yes ; then
2924 _def_memalign='#define HAVE_MEMALIGN 1'
2925 else
2926 _def_memalign='#undef HAVE_MEMALIGN'
2927 _def_map_memalign='#define memalign(a,b) malloc(b)'
2928 darwin || _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2930 echores "$_memalign"
2933 echocheck "alloca.h"
2934 cat > $TMPC << EOF
2935 #include <alloca.h>
2936 int main(void) { (void) alloca(0); return 0; }
2938 _alloca=no
2939 cc_check && _alloca=yes
2940 if cc_check ; then
2941 _def_alloca='#define HAVE_ALLOCA_H 1'
2942 else
2943 _def_alloca='#undef HAVE_ALLOCA_H'
2945 echores "$_alloca"
2948 echocheck "byteswap.h"
2949 cat > $TMPC << EOF
2950 #include <byteswap.h>
2951 int main(void) { bswap_16(0); return 0; }
2953 _byteswap_h=no
2954 cc_check && _byteswap_h=yes
2955 if cc_check ; then
2956 _def_byteswap_h='#define HAVE_BYTESWAP_H 1'
2957 else
2958 _def_byteswap_h='#undef HAVE_BYTESWAP_H'
2960 echores "$_byteswap_h"
2963 echocheck "mman.h"
2964 cat > $TMPC << EOF
2965 #include <sys/types.h>
2966 #include <sys/mman.h>
2967 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2969 _mman=no
2970 cc_check && _mman=yes
2971 if test "$_mman" = yes ; then
2972 _def_mman='#define HAVE_SYS_MMAN_H 1'
2973 else
2974 _def_mman='#undef HAVE_SYS_MMAN_H'
2975 os2 && _need_mmap=yes
2977 echores "$_mman"
2979 cat > $TMPC << EOF
2980 #include <sys/types.h>
2981 #include <sys/mman.h>
2982 int main(void) { void *p = MAP_FAILED; return 0; }
2984 _mman_has_map_failed=no
2985 cc_check && _mman_has_map_failed=yes
2986 if test "$_mman_has_map_failed" = yes ; then
2987 _def_mman_has_map_failed=''
2988 else
2989 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2992 echocheck "dynamic loader"
2993 cat > $TMPC << EOF
2994 #include <dlfcn.h>
2995 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2997 _dl=no
2998 for _ld_tmp in "" "-ldl" ; do
2999 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3000 done
3001 if test "$_dl" = yes ; then
3002 _def_dl='#define HAVE_LIBDL 1'
3003 else
3004 _def_dl='#undef HAVE_LIBDL'
3006 echores "$_dl"
3009 echocheck "dynamic a/v plugins support"
3010 if test "$_dl" = no ; then
3011 _dynamic_plugins=no
3013 if test "$_dynamic_plugins" = yes ; then
3014 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3015 else
3016 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3018 echores "$_dynamic_plugins"
3021 _def_threads='#undef HAVE_THREADS'
3023 echocheck "pthread"
3024 if test "$_pthreads" = auto ; then
3025 cat > $TMPC << EOF
3026 #include <pthread.h>
3027 void* func(void *arg) { return arg; }
3028 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3030 _pthreads=no
3031 if ! hpux ; then
3032 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3033 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3034 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3035 done
3038 if test "$_pthreads" = yes ; then
3039 _res_comment="using $_ld_pthread"
3040 _def_pthreads='#define HAVE_PTHREADS 1'
3041 _def_threads='#define HAVE_THREADS 1'
3042 else
3043 _res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3044 _def_pthreads='#undef HAVE_PTHREADS'
3045 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3046 mingw32 || _win32dll=no
3048 echores "$_pthreads"
3050 echocheck "w32threads"
3051 if test "$_pthreads" = yes ; then
3052 _res_comment="using pthread instead"
3053 _w32threads=no
3055 if test "$_w32threads" = auto ; then
3056 _w32threads=no
3057 mingw32 && _w32threads=yes
3059 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3060 echores "$_w32threads"
3062 echocheck "rpath"
3063 netbsd &&_rpath=yes
3064 if test "$_rpath" = yes ; then
3065 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3066 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3067 done
3068 _ld_extra=$tmp
3070 echores "$_rpath"
3072 echocheck "iconv"
3073 if test "$_iconv" = auto ; then
3074 cat > $TMPC << EOF
3075 #include <stdio.h>
3076 #include <unistd.h>
3077 #include <iconv.h>
3078 #define INBUFSIZE 1024
3079 #define OUTBUFSIZE 4096
3081 char inbuffer[INBUFSIZE];
3082 char outbuffer[OUTBUFSIZE];
3084 int main(void) {
3085 size_t numread;
3086 iconv_t icdsc;
3087 char *tocode="UTF-8";
3088 char *fromcode="cp1250";
3089 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3090 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3091 char *iptr=inbuffer;
3092 char *optr=outbuffer;
3093 size_t inleft=numread;
3094 size_t outleft=OUTBUFSIZE;
3095 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3096 != (size_t)(-1)) {
3097 write (1, outbuffer, OUTBUFSIZE - outleft);
3100 if (iconv_close(icdsc) == -1)
3105 _iconv=no
3106 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3107 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3108 _iconv=yes && break
3109 done
3111 if test "$_iconv" = yes ; then
3112 _def_iconv='#define USE_ICONV 1'
3113 else
3114 _def_iconv='#undef USE_ICONV'
3116 echores "$_iconv"
3119 echocheck "soundcard.h"
3120 _soundcard_h=no
3121 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3122 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3123 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3124 cat > $TMPC << EOF
3125 #include <$_soundcard_header>
3126 int main(void) { return 0; }
3128 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3129 done
3131 if test "$_soundcard_h" = yes ; then
3132 if test $_soundcard_header = "sys/soundcard.h"; then
3133 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3134 else
3135 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3138 echores "$_soundcard_h"
3141 echocheck "sys/dvdio.h"
3142 cat > $TMPC << EOF
3143 #include <unistd.h>
3144 #include <sys/dvdio.h>
3145 int main(void) { return 0; }
3147 _dvdio=no
3148 cc_check && _dvdio=yes
3149 if test "$_dvdio" = yes ; then
3150 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3151 else
3152 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3154 echores "$_dvdio"
3157 echocheck "sys/cdio.h"
3158 cat > $TMPC << EOF
3159 #include <unistd.h>
3160 #include <sys/cdio.h>
3161 int main(void) { return 0; }
3163 _cdio=no
3164 cc_check && _cdio=yes
3165 if test "$_cdio" = yes ; then
3166 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3167 else
3168 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3170 echores "$_cdio"
3173 echocheck "linux/cdrom.h"
3174 cat > $TMPC << EOF
3175 #include <sys/types.h>
3176 #include <linux/cdrom.h>
3177 int main(void) { return 0; }
3179 _cdrom=no
3180 cc_check && _cdrom=yes
3181 if test "$_cdrom" = yes ; then
3182 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3183 else
3184 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3186 echores "$_cdrom"
3189 echocheck "dvd.h"
3190 cat > $TMPC << EOF
3191 #include <dvd.h>
3192 int main(void) { return 0; }
3194 _dvd=no
3195 cc_check && _dvd=yes
3196 if test "$_dvd" = yes ; then
3197 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3198 else
3199 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3201 echores "$_dvd"
3204 if bsdos; then
3205 echocheck "BSDI dvd.h"
3206 cat > $TMPC << EOF
3207 #include <dvd.h>
3208 int main(void) { return 0; }
3210 _bsdi_dvd=no
3211 cc_check && _bsdi_dvd=yes
3212 if test "$_bsdi_dvd" = yes ; then
3213 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3214 else
3215 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3217 echores "$_bsdi_dvd"
3218 fi #if bsdos
3221 if hpux; then
3222 # also used by AIX, but AIX does not support VCD and/or libdvdread
3223 echocheck "HP-UX SCSI header"
3224 cat > $TMPC << EOF
3225 #include <sys/scsi.h>
3226 int main(void) { return 0; }
3228 _hpux_scsi_h=no
3229 cc_check && _hpux_scsi_h=yes
3230 if test "$_hpux_scsi_h" = yes ; then
3231 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3232 else
3233 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3235 echores "$_hpux_scsi_h"
3236 fi #if hpux
3239 if sunos; then
3240 echocheck "userspace SCSI headers (Solaris)"
3241 cat > $TMPC << EOF
3242 #include <unistd.h>
3243 #include <stropts.h>
3244 #include <sys/scsi/scsi_types.h>
3245 #include <sys/scsi/impl/uscsi.h>
3246 int main(void) { return 0; }
3248 _sol_scsi_h=no
3249 cc_check && _sol_scsi_h=yes
3250 if test "$_sol_scsi_h" = yes ; then
3251 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3252 else
3253 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3255 echores "$_sol_scsi_h"
3256 fi #if sunos
3259 echocheck "termcap"
3260 if test "$_termcap" = auto ; then
3261 cat > $TMPC <<EOF
3262 int main(void) { tgetent(); return 0; }
3264 _termcap=no
3265 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3266 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3267 && _termcap=yes && break
3268 done
3270 if test "$_termcap" = yes ; then
3271 _def_termcap='#define USE_TERMCAP 1'
3272 _res_comment="using $_ld_tmp"
3273 else
3274 _def_termcap='#undef USE_TERMCAP'
3276 echores "$_termcap"
3279 echocheck "termios"
3280 _def_termios='#undef HAVE_TERMIOS'
3281 _def_termios_h='#undef HAVE_TERMIOS_H'
3282 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3283 if test "$_termios" = auto ; then
3284 _termios=no
3285 for _termios_header in "sys/termios.h" "termios.h"; do
3286 cat > $TMPC <<EOF
3287 #include <$_termios_header>
3288 int main(void) { return 0; }
3290 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3291 done
3294 if test "$_termios" = yes ; then
3295 _def_termios='#define HAVE_TERMIOS 1'
3296 if test "$_termios_header" = "termios.h" ; then
3297 _def_termios_h='#define HAVE_TERMIOS_H 1'
3298 else
3299 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3302 echores "$_termios"
3305 echocheck "shm"
3306 if test "$_shm" = auto ; then
3307 cat > $TMPC << EOF
3308 #include <sys/types.h>
3309 #include <sys/shm.h>
3310 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3312 _shm=no
3313 cc_check && _shm=yes
3315 if test "$_shm" = yes ; then
3316 _def_shm='#define HAVE_SHM 1'
3317 else
3318 _def_shm='#undef HAVE_SHM'
3320 echores "$_shm"
3323 echocheck "strsep()"
3324 cat > $TMPC << EOF
3325 #include <string.h>
3326 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3328 _strsep=no
3329 cc_check && _strsep=yes
3330 if test "$_strsep" = yes ; then
3331 _def_strsep='#define HAVE_STRSEP 1'
3332 _need_strsep=no
3333 else
3334 _def_strsep='#undef HAVE_STRSEP'
3335 _need_strsep=yes
3337 echores "$_strsep"
3340 echocheck "vsscanf()"
3341 cat > $TMPC << EOF
3342 #include <stdarg.h>
3343 int main(void) { vsscanf(0, 0, 0); return 0; }
3345 _vsscanf=no
3346 cc_check && _vsscanf=yes
3347 if test "$_vsscanf" = yes ; then
3348 _def_vsscanf='#define HAVE_VSSCANF 1'
3349 _need_vsscanf=no
3350 else
3351 _def_vsscanf='#undef HAVE_VSSCANF'
3352 _need_vsscanf=yes
3354 echores "$_vsscanf"
3357 echocheck "swab()"
3358 cat > $TMPC << EOF
3359 #include <unistd.h>
3360 int main(void) { swab(0, 0, 0); return 0; }
3362 _swab=no
3363 cc_check && _swab=yes
3364 if test "$_swab" = yes ; then
3365 _def_swab='#define HAVE_SWAB 1'
3366 _need_swab=no
3367 else
3368 _def_swab='#undef HAVE_SWAB'
3369 _need_swab=yes
3371 echores "$_swab"
3373 echocheck "POSIX select()"
3374 cat > $TMPC << EOF
3375 #include <stdio.h>
3376 #include <stdlib.h>
3377 #include <sys/types.h>
3378 #include <string.h>
3379 #include <sys/time.h>
3380 #include <unistd.h>
3381 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3383 _posix_select=no
3384 _def_posix_select='#undef HAVE_POSIX_SELECT'
3385 #select() of kLIBC (OS/2) supports socket only
3386 ! os2 && cc_check && _posix_select=yes \
3387 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3388 echores "$_posix_select"
3391 echocheck "gettimeofday()"
3392 cat > $TMPC << EOF
3393 #include <stdio.h>
3394 #include <sys/time.h>
3395 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3397 _gettimeofday=no
3398 cc_check && _gettimeofday=yes
3399 if test "$_gettimeofday" = yes ; then
3400 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3401 _need_gettimeofday=no
3402 else
3403 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3404 _need_gettimeofday=yes
3406 echores "$_gettimeofday"
3409 echocheck "glob()"
3410 cat > $TMPC << EOF
3411 #include <stdio.h>
3412 #include <glob.h>
3413 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3415 _glob=no
3416 cc_check && _glob=yes
3417 if test "$_glob" = yes ; then
3418 _def_glob='#define HAVE_GLOB 1'
3419 _need_glob=no
3420 else
3421 _def_glob='#undef HAVE_GLOB'
3422 _need_glob=yes
3424 echores "$_glob"
3427 echocheck "setenv()"
3428 cat > $TMPC << EOF
3429 #include <stdlib.h>
3430 int main(void) { setenv("","",0); return 0; }
3432 _setenv=no
3433 cc_check && _setenv=yes
3434 if test "$_setenv" = yes ; then
3435 _def_setenv='#define HAVE_SETENV 1'
3436 _need_setenv=no
3437 else
3438 _def_setenv='#undef HAVE_SETENV'
3439 _need_setenv=yes
3441 echores "$_setenv"
3444 if sunos; then
3445 echocheck "sysi86()"
3446 cat > $TMPC << EOF
3447 #include <sys/sysi86.h>
3448 int main(void) { sysi86(0); return 0; }
3450 _sysi86=no
3451 cc_check && _sysi86=yes
3452 if test "$_sysi86" = yes ; then
3453 _def_sysi86='#define HAVE_SYSI86 1'
3454 cat > $TMPC << EOF
3455 #include <sys/sysi86.h>
3456 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3458 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3459 else
3460 _def_sysi86='#undef HAVE_SYSI86'
3462 echores "$_sysi86"
3463 fi #if sunos
3466 echocheck "sys/sysinfo.h"
3467 cat > $TMPC << EOF
3468 #include <sys/sysinfo.h>
3469 int main(void) {
3470 struct sysinfo s_info;
3471 sysinfo(&s_info);
3472 return 0;
3475 _sys_sysinfo=no
3476 cc_check && _sys_sysinfo=yes
3477 if test "$_sys_sysinfo" = yes ; then
3478 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3479 else
3480 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3482 echores "$_sys_sysinfo"
3485 if darwin; then
3487 echocheck "Mac OS X APIs"
3488 if test "$_macosx" = auto ; then
3489 productName=`/usr/bin/sw_vers -productName`
3490 if test "$productName" = "Mac OS X" ||
3491 test "$productName" = "Mac OS X Server" ; then
3492 _macosx=yes
3493 else
3494 _macosx=no
3495 _noaomodules="macosx $_noaomodules"
3496 _novomodules="quartz $_novomodules"
3499 if test "$_macosx" = yes ; then
3500 cat > $TMPC <<EOF
3501 #include <Carbon/Carbon.h>
3502 #include <QuickTime/QuickTime.h>
3503 #include <CoreAudio/CoreAudio.h>
3504 int main(void) {
3505 EnterMovies();
3506 ExitMovies();
3507 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3510 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3511 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3512 _coreaudio=yes
3513 _def_coreaudio='#define HAVE_COREAUDIO 1'
3514 _aosrc="$_aosrc ao_macosx.c"
3515 _aomodules="macosx $_aomodules"
3516 _def_quartz='#define HAVE_QUARTZ 1'
3517 _vosrc="$_vosrc vo_quartz.c"
3518 _vomodules="quartz $_vomodules"
3519 _def_quicktime='#define HAVE_QUICKTIME 1'
3520 else
3521 _macosx=no
3522 _coreaudio=no
3523 _def_coreaudio='#undef HAVE_COREAUDIO'
3524 _noaomodules="macosx $_noaomodules"
3525 _def_quartz='#undef HAVE_QUARTZ'
3526 _novomodules="quartz $_novomodules"
3527 _def_quicktime='#undef HAVE_QUICKTIME'
3529 cat > $TMPC <<EOF
3530 #include <Carbon/Carbon.h>
3531 #include <QuartzCore/CoreVideo.h>
3532 int main(void) {}
3534 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3535 _vosrc="$_vosrc vo_macosx.m"
3536 _vomodules="macosx $_vomodules"
3537 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3538 _def_corevideo='#define HAVE_COREVIDEO 1'
3539 _corevideo=yes
3540 else
3541 _novomodules="macosx $_novomodules"
3542 _def_corevideo='#undef HAVE_COREVIDEO'
3543 _corevideo=no
3546 echores "$_macosx"
3548 echocheck "Mac OS X Finder Support"
3549 if test "$_macosx_finder_support" = auto ; then
3550 _macosx_finder_support=$_macosx
3552 if test "$_macosx_finder_support" = yes; then
3553 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3554 _macosx_finder_support=yes
3555 else
3556 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3557 _macosx_finder_support=no
3559 echores "$_macosx_finder_support"
3561 echocheck "Mac OS X Bundle file locations"
3562 if test "$_macosx_bundle" = auto ; then
3563 _macosx_bundle=$_macosx_finder_support
3565 if test "$_macosx_bundle" = yes; then
3566 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3567 else
3568 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3569 _macosx_bundle=no
3571 echores "$_macosx_bundle"
3573 echocheck "Apple Remote"
3574 if test "$_apple_remote" = auto ; then
3575 _apple_remote=no
3576 cat > $TMPC <<EOF
3577 #include <stdio.h>
3578 #include <IOKit/IOCFPlugIn.h>
3579 int main(void) {
3580 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3581 CFMutableDictionaryRef hidMatchDictionary;
3582 IOReturn ioReturnValue;
3584 // Set up a matching dictionary to search the I/O Registry by class.
3585 // name for all HID class devices
3586 hidMatchDictionary = IOServiceMatching("AppleIRController");
3588 // Now search I/O Registry for matching devices.
3589 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3590 hidMatchDictionary, &hidObjectIterator);
3592 // If search is unsuccessful, return nonzero.
3593 if (ioReturnValue != kIOReturnSuccess ||
3594 !IOIteratorIsValid(hidObjectIterator)) {
3595 return 1;
3597 return 0;
3600 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3602 if test "$_apple_remote" = yes ; then
3603 _def_apple_remote='#define HAVE_APPLE_REMOTE 1'
3604 _ld_extra="$_ld_extra -framework IOKit"
3605 else
3606 _def_apple_remote='#undef HAVE_APPLE_REMOTE'
3608 echores "$_apple_remote"
3610 fi #if darwin
3612 if linux; then
3614 echocheck "Apple IR"
3615 if test "$_apple_ir" = auto ; then
3616 _apple_ir=no
3617 cat > $TMPC <<EOF
3618 #include <linux/types.h>
3619 #include <linux/input.h>
3620 int main(void) {
3621 struct input_event ev;
3622 return 0;
3625 cc_check && tmp_run && _apple_ir=yes
3627 if test "$_apple_ir" = yes ; then
3628 _def_apple_ir='#define HAVE_APPLE_IR 1'
3629 else
3630 _def_apple_ir='#undef HAVE_APPLE_IR'
3632 echores "$_apple_ir"
3633 fi #if linux
3635 echocheck "pkg-config"
3636 _pkg_config=pkg-config
3637 if `$_pkg_config --version > /dev/null 2>&1`; then
3638 if test "$_ld_static"; then
3639 _pkg_config="$_pkg_config --static"
3641 echores "yes"
3642 else
3643 _pkg_config=false
3644 echores "no"
3648 echocheck "Samba support (libsmbclient)"
3649 if test "$_smbsupport" = yes; then
3650 _ld_extra="$_ld_extra -lsmbclient"
3652 if test "$_smbsupport" = auto; then
3653 _smbsupport=no
3654 cat > $TMPC << EOF
3655 #include <libsmbclient.h>
3656 int main(void) { smbc_opendir("smb://"); return 0; }
3658 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3659 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3660 _smbsupport=yes && break
3661 done
3664 if test "$_smbsupport" = yes; then
3665 _def_smbsupport="#define LIBSMBCLIENT"
3666 _inputmodules="smb $_inputmodules"
3667 else
3668 _def_smbsupport="#undef LIBSMBCLIENT"
3669 _noinputmodules="smb $_noinputmodules"
3671 echores "$_smbsupport"
3674 #########
3675 # VIDEO #
3676 #########
3679 echocheck "tdfxfb"
3680 if test "$_tdfxfb" = yes ; then
3681 _def_tdfxfb='#define HAVE_TDFXFB 1'
3682 _vosrc="$_vosrc vo_tdfxfb.c"
3683 _vomodules="tdfxfb $_vomodules"
3684 else
3685 _def_tdfxfb='#undef HAVE_TDFXFB'
3686 _novomodules="tdfxfb $_novomodules"
3688 echores "$_tdfxfb"
3690 echocheck "s3fb"
3691 if test "$_s3fb" = yes ; then
3692 _def_s3fb='#define HAVE_S3FB 1'
3693 _vosrc="$_vosrc vo_s3fb.c"
3694 _vomodules="s3fb $_vomodules"
3695 else
3696 _def_s3fb='#undef HAVE_S3FB'
3697 _novomodules="s3fb $_novomodules"
3699 echores "$_s3fb"
3701 echocheck "tdfxvid"
3702 if test "$_tdfxvid" = yes ; then
3703 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3704 _vosrc="$_vosrc vo_tdfx_vid.c"
3705 _vomodules="tdfx_vid $_vomodules"
3706 else
3707 _def_tdfxvid='#undef HAVE_TDFX_VID'
3708 _novomodules="tdfx_vid $_novomodules"
3710 echores "$_tdfxvid"
3712 echocheck "xvr100"
3713 if test "$_xvr100" = auto ; then
3714 cat > $TMPC << EOF
3715 #include <unistd.h>
3716 #include <sys/fbio.h>
3717 #include <sys/visual_io.h>
3718 int main(void) {
3719 struct vis_identifier ident;
3720 struct fbgattr attr;
3721 ioctl(0, VIS_GETIDENTIFIER, &ident);
3722 ioctl(0, FBIOGATTR, &attr);
3725 _xvr100=no
3726 cc_check && _xvr100=yes
3728 if test "$_xvr100" = yes ; then
3729 _def_xvr100='#define HAVE_XVR100 1'
3730 _vosrc="$_vosrc vo_xvr100.c"
3731 _vomodules="xvr100 $_vomodules"
3732 else
3733 _def_tdfxvid='#undef HAVE_XVR100'
3734 _novomodules="xvr100 $_novomodules"
3736 echores "$_xvr100"
3738 echocheck "tga"
3739 if test "$_tga" = yes ; then
3740 _def_tga='#define HAVE_TGA 1'
3741 _vosrc="$_vosrc vo_tga.c"
3742 _vomodules="tga $_vomodules"
3743 else
3744 _def_tga='#undef HAVE_TGA'
3745 _novomodules="tga $_novomodules"
3747 echores "$_tga"
3750 echocheck "md5sum support"
3751 if test "$_md5sum" = yes; then
3752 _def_md5sum="#define HAVE_MD5SUM"
3753 _vosrc="$_vosrc vo_md5sum.c"
3754 _vomodules="md5sum $_vomodules"
3755 else
3756 _def_md5sum="#undef HAVE_MD5SUM"
3757 _novomodules="md5sum $_novomodules"
3759 echores "$_md5sum"
3762 echocheck "bl"
3763 if test "$_bl" = yes ; then
3764 _def_bl='#define HAVE_BL 1'
3765 _vosrc="$_vosrc vo_bl.c"
3766 _vomodules="bl $_vomodules"
3767 else
3768 _def_bl='#undef HAVE_BL'
3769 _novomodules="bl $_novomodules"
3771 echores "$_bl"
3774 echocheck "DirectFB"
3775 if test "$_directfb" = auto ; then
3776 _directfb=no
3777 cat > $TMPC <<EOF
3778 #include <directfb.h>
3779 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3781 for _inc_tmp in "" -I/usr/local/include/directfb \
3782 -I/usr/include/directfb -I/usr/local/include; do
3783 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3784 _inc_extra="$_inc_extra $_inc_tmp" && break
3785 done
3788 dfb_version() {
3789 expr $1 \* 65536 + $2 \* 256 + $3
3792 if test "$_directfb" = yes; then
3793 cat > $TMPC << EOF
3794 #include <directfb_version.h>
3796 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3799 if $_cc -E $TMPC $_inc_extra > "$TMPEXE"; then
3800 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'`
3801 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3802 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3803 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3804 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3805 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3806 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3807 _res_comment="$_directfb_version"
3808 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3809 else
3810 _def_directfb_version='#undef DIRECTFBVERSION'
3811 _directfb=no
3812 _res_comment="version >=0.9.13 required"
3814 else
3815 _directfb=no
3816 _res_comment="failed to get version"
3819 echores "$_directfb"
3821 if test "$_directfb" = yes ; then
3822 _def_directfb='#define HAVE_DIRECTFB 1'
3823 _vosrc="$_vosrc vo_directfb2.c"
3824 _vomodules="directfb $_vomodules"
3825 _libs_mplayer="$_libs_mplayer -ldirectfb"
3826 else
3827 _def_directfb='#undef HAVE_DIRECTFB'
3828 _novomodules="directfb $_novomodules"
3830 if test "$_dfbmga" = yes; then
3831 _vosrc="$_vosrc vo_dfbmga.c"
3832 _vomodules="dfbmga $_vomodules"
3833 _def_dfbmga='#define HAVE_DFBMGA 1'
3834 else
3835 _novomodules="dfbmga $_novomodules"
3836 _def_dfbmga='#undef HAVE_DFBMGA'
3840 echocheck "X11 headers presence"
3841 _x11_headers="no"
3842 _res_comment="check if the dev(el) packages are installed"
3843 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3844 if test -f "$I/X11/Xlib.h" ; then
3845 _x11_headers="yes"
3846 _res_comment=""
3847 break
3849 done
3850 if test $_cross_compile = no; then
3851 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3852 if test -f "$I/X11/Xlib.h" ; then
3853 _inc_extra="$_inc_extra -I$I"
3854 _x11_headers="yes"
3855 _res_comment="using $I"
3856 break
3858 done
3860 echores "$_x11_headers"
3863 echocheck "X11"
3864 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3865 cat > $TMPC <<EOF
3866 #include <X11/Xlib.h>
3867 #include <X11/Xutil.h>
3868 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3870 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3871 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3872 if netbsd; then
3873 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3874 else
3875 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3877 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3878 && _x11=yes && break
3879 done
3881 if test "$_x11" = yes ; then
3882 _def_x11='#define HAVE_X11 1'
3883 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3884 _vomodules="x11 xover $_vomodules"
3885 else
3886 _x11=no
3887 _def_x11='#undef HAVE_X11'
3888 _novomodules="x11 $_novomodules"
3889 _res_comment="check if the dev(el) packages are installed"
3890 # disable stuff that depends on X
3891 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
3893 echores "$_x11"
3895 echocheck "Xss screensaver extensions"
3896 if test "$_xss" = auto ; then
3897 cat > $TMPC << EOF
3898 #include <X11/Xlib.h>
3899 #include <X11/extensions/scrnsaver.h>
3900 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
3902 _xss=no
3903 cc_check -lXss && _xss=yes
3905 if test "$_xss" = yes ; then
3906 _def_xss='#define HAVE_XSS 1'
3907 _libs_mplayer="$_libs_mplayer -lXss"
3908 else
3909 _def_xss='#undef HAVE_XSS'
3911 echores "$_xss"
3913 echocheck "DPMS"
3914 _xdpms3=no
3915 _xdpms4=no
3916 if test "$_x11" = yes ; then
3917 cat > $TMPC <<EOF
3918 #include <X11/Xmd.h>
3919 #include <X11/Xlib.h>
3920 #include <X11/Xutil.h>
3921 #include <X11/Xatom.h>
3922 #include <X11/extensions/dpms.h>
3923 int main(void) { (void) DPMSQueryExtension(0, 0, 0); }
3925 cc_check -lXdpms && _xdpms3=yes
3926 cat > $TMPC <<EOF
3927 #include <X11/Xlib.h>
3928 #include <X11/extensions/dpms.h>
3929 int main(void) { (void) DPMSQueryExtension(0, 0, 0); }
3931 cc_check -lXext && _xdpms4=yes
3933 if test "$_xdpms4" = yes ; then
3934 _def_xdpms='#define HAVE_XDPMS 1'
3935 _res_comment="using Xdpms 4"
3936 echores "yes"
3937 elif test "$_xdpms3" = yes ; then
3938 _def_xdpms='#define HAVE_XDPMS 1'
3939 _libs_mplayer="$_libs_mplayer -lXdpms"
3940 _res_comment="using Xdpms 3"
3941 echores "yes"
3942 else
3943 _def_xdpms='#undef HAVE_XDPMS'
3944 echores "no"
3948 echocheck "Xv"
3949 if test "$_xv" = auto ; then
3950 cat > $TMPC <<EOF
3951 #include <X11/Xlib.h>
3952 #include <X11/extensions/Xvlib.h>
3953 int main(void) {
3954 (void) XvGetPortAttribute(0, 0, 0, 0);
3955 (void) XvQueryPortAttributes(0, 0, 0);
3956 return 0; }
3958 _xv=no
3959 cc_check -lXv && _xv=yes
3962 if test "$_xv" = yes ; then
3963 _def_xv='#define HAVE_XV 1'
3964 _libs_mplayer="$_libs_mplayer -lXv"
3965 _vosrc="$_vosrc vo_xv.c"
3966 _vomodules="xv $_vomodules"
3967 else
3968 _def_xv='#undef HAVE_XV'
3969 _novomodules="xv $_novomodules"
3971 echores "$_xv"
3974 echocheck "XvMC"
3975 if test "$_xv" = yes && test "$_xvmc" != no ; then
3976 _xvmc=no
3977 cat > $TMPC <<EOF
3978 #include <X11/Xlib.h>
3979 #include <X11/extensions/Xvlib.h>
3980 #include <X11/extensions/XvMClib.h>
3981 int main(void) {
3982 (void) XvMCQueryExtension(0,0,0);
3983 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3984 return 0; }
3986 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3987 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3988 done
3990 if test "$_xvmc" = yes ; then
3991 _def_xvmc='#define HAVE_XVMC 1'
3992 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
3993 _vosrc="$_vosrc vo_xvmc.c"
3994 _vomodules="xvmc $_vomodules"
3995 _res_comment="using $_xvmclib"
3996 else
3997 _def_xvmc='#undef HAVE_XVMC'
3998 _novomodules="xvmc $_novomodules"
3999 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4001 echores "$_xvmc"
4004 echocheck "Xinerama"
4005 if test "$_xinerama" = auto ; then
4006 cat > $TMPC <<EOF
4007 #include <X11/Xlib.h>
4008 #include <X11/extensions/Xinerama.h>
4009 int main(void) { (void) XineramaIsActive(0); return 0; }
4011 _xinerama=no
4012 cc_check -lXinerama && _xinerama=yes
4015 if test "$_xinerama" = yes ; then
4016 _def_xinerama='#define HAVE_XINERAMA 1'
4017 _libs_mplayer="$_libs_mplayer -lXinerama"
4018 else
4019 _def_xinerama='#undef HAVE_XINERAMA'
4021 echores "$_xinerama"
4024 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4025 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4026 # named 'X extensions' or something similar.
4027 # This check may be useful for future mplayer versions (to change resolution)
4028 # If you run into problems, remove '-lXxf86vm'.
4029 echocheck "Xxf86vm"
4030 if test "$_vm" = auto ; then
4031 cat > $TMPC <<EOF
4032 #include <X11/Xlib.h>
4033 #include <X11/extensions/xf86vmode.h>
4034 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4036 _vm=no
4037 cc_check -lXxf86vm && _vm=yes
4039 if test "$_vm" = yes ; then
4040 _def_vm='#define HAVE_XF86VM 1'
4041 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4042 else
4043 _def_vm='#undef HAVE_XF86VM'
4045 echores "$_vm"
4047 # Check for the presence of special keycodes, like audio control buttons
4048 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4049 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4050 # have these new keycodes.
4051 echocheck "XF86keysym"
4052 if test "$_xf86keysym" = auto; then
4053 _xf86keysym=no
4054 cat > $TMPC <<EOF
4055 #include <X11/Xlib.h>
4056 #include <X11/XF86keysym.h>
4057 int main(void) { return XF86XK_AudioPause; }
4059 cc_check && _xf86keysym=yes
4061 if test "$_xf86keysym" = yes ; then
4062 _def_xf86keysym='#define HAVE_XF86XK 1'
4063 else
4064 _def_xf86keysym='#undef HAVE_XF86XK'
4066 echores "$_xf86keysym"
4068 echocheck "DGA"
4069 if test "$_dga2" = auto && test "$_x11" = yes ; then
4070 cat > $TMPC << EOF
4071 #include <X11/Xlib.h>
4072 #include <X11/extensions/xf86dga.h>
4073 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4075 _dga2=no
4076 cc_check -lXxf86dga && _dga2=yes
4078 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4079 cat > $TMPC << EOF
4080 #include <X11/Xlib.h>
4081 #include <X11/extensions/xf86dga.h>
4082 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4084 _dga1=no
4085 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4088 _dga=no
4089 _def_dga='#undef HAVE_DGA'
4090 _def_dga1='#undef HAVE_DGA1'
4091 _def_dga2='#undef HAVE_DGA2'
4092 if test "$_dga1" = yes ; then
4093 _dga=yes
4094 _def_dga1='#define HAVE_DGA1 1'
4095 _res_comment="using DGA 1.0"
4096 elif test "$_dga2" = yes ; then
4097 _dga=yes
4098 _def_dga2='#define HAVE_DGA2 1'
4099 _res_comment="using DGA 2.0"
4101 if test "$_dga" = yes ; then
4102 _def_dga='#define HAVE_DGA 1'
4103 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4104 _vosrc="$_vosrc vo_dga.c"
4105 _vomodules="dga $_vomodules"
4106 else
4107 _novomodules="dga $_novomodules"
4109 echores "$_dga"
4112 echocheck "3dfx"
4113 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4114 _def_3dfx='#define HAVE_3DFX 1'
4115 _vosrc="$_vosrc vo_3dfx.c"
4116 _vomodules="3dfx $_vomodules"
4117 else
4118 _def_3dfx='#undef HAVE_3DFX'
4119 _novomodules="3dfx $_novomodules"
4121 echores "$_3dfx"
4124 echocheck "OpenGL"
4125 #Note: this test is run even with --enable-gl since we autodetect linker flags
4126 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4127 cat > $TMPC << EOF
4128 #include <GL/gl.h>
4129 #ifdef GL_WIN32
4130 #include <windows.h>
4131 #include <GL/glext.h>
4132 #else
4133 #include <X11/Xlib.h>
4134 #include <GL/glx.h>
4135 #endif
4136 int main(void) {
4137 #ifdef GL_WIN32
4138 HDC dc;
4139 wglCreateContext(dc);
4140 #else
4141 glXCreateContext(NULL, NULL, NULL, True);
4142 #endif
4143 glFinish();
4144 return 0;
4147 _gl=no
4148 if cc_check -lGL $_ld_lm ; then
4149 _gl=yes
4150 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4151 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4152 _gl=yes
4153 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4154 elif cc_check -DGL_WIN32 -lopengl32 ; then
4155 _gl=yes
4156 _gl_win32=yes
4157 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4159 else
4160 _gl=no
4162 if test "$_gl" = yes ; then
4163 _def_gl='#define HAVE_GL 1'
4164 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4165 if test "$_gl_win32" = yes ; then
4166 _def_gl_win32='#define GL_WIN32 1'
4167 _vosrc="$_vosrc w32_common.c"
4168 _res_comment="win32 version"
4170 _vomodules="opengl $_vomodules"
4171 else
4172 _def_gl='#undef HAVE_GL'
4173 _def_gl_win32='#undef GL_WIN32'
4174 _novomodules="opengl $_novomodules"
4176 echores "$_gl"
4179 echocheck "VIDIX"
4180 _vidix=no
4181 _def_vidix='#undef CONFIG_VIDIX'
4182 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4183 _vidix_drv_cyberblade=no
4184 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4185 _vidix_drv_ivtv=no
4186 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4187 _vidix_drv_ivtv=no
4188 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4189 _vidix_drv_mach64=no
4190 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4191 _vidix_drv_mga=no
4192 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4193 _vidix_drv_mga_crtc2=no
4194 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4195 _vidix_drv_nvidia=no
4196 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4197 _vidix_drv_pm2=no
4198 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4199 _vidix_drv_pm3=no
4200 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4201 _vidix_drv_radeon=no
4202 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4203 _vidix_drv_rage128=no
4204 _def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4205 _vidix_drv_s3=no
4206 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4207 _vidix_drv_sis=no
4208 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4209 _vidix_drv_unichrome=no
4210 if test "$_vidix_internal" = auto ; then
4211 _vidix_internal=no
4212 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4213 && _vidix_internal=yes
4214 (ppc || alpha) && linux && _vidix_internal=yes
4216 if test "$_vidix_internal" = yes; then
4217 _res_comment="internal"
4218 _vidix_external=no
4219 _vidix=yes
4220 elif test "$_vidix_external" = auto; then
4221 _vidix_external=no
4222 cat > $TMPC <<EOF
4223 #include <vidix/vidix.h>
4224 int main(void) { return 0; }
4226 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
4227 && _vidix=yes
4229 echores "$_vidix"
4231 if test "$_vidix" = yes ; then
4232 _def_vidix='#define CONFIG_VIDIX 1'
4233 _vosrc="$_vosrc vo_cvidix.c"
4234 _vomodules="cvidix $_vomodules"
4235 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sis unichrome"
4236 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4238 # some vidix drivers are meant to work on x86 only, discard them elsewhere
4239 x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//`
4241 for driver in $_vidix_drivers ; do
4242 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4243 eval _vidix_drv_${driver}=yes
4244 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4245 done
4246 else
4247 _novomodules="cvidix $_novomodules"
4250 if test "$_vidix_internal" = yes ; then
4251 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
4252 elif test "$_vidix_external" = yes ; then
4253 _libs_mplayer="$_libs_mplayer -lvidix"
4254 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
4257 if test "$_vidix" = yes && win32; then
4258 _vosrc="$_vosrc vo_winvidix.c"
4259 _vomodules="winvidix $_vomodules"
4260 _libs_mplayer="$_libs_mplayer -lgdi32"
4261 else
4262 _novomodules="winvidix $_novomodules"
4264 if test "$_vidix" = yes && test "$_x11" = yes; then
4265 _vosrc="$_vosrc vo_xvidix.c"
4266 _vomodules="xvidix $_vomodules"
4267 else
4268 _novomodules="xvidix $_novomodules"
4271 echocheck "VIDIX PCI device name database"
4272 echores "$_vidix_pcidb"
4273 if test "$_vidix_pcidb" = yes ; then
4274 _vidix_pcidb_val=1
4275 else
4276 _vidix_pcidb_val=0
4279 echocheck "/dev/mga_vid"
4280 if test "$_mga" = auto ; then
4281 _mga=no
4282 test -c /dev/mga_vid && _mga=yes
4284 if test "$_mga" = yes ; then
4285 _def_mga='#define HAVE_MGA 1'
4286 _vosrc="$_vosrc vo_mga.c"
4287 _vomodules="mga $_vomodules"
4288 else
4289 _def_mga='#undef HAVE_MGA'
4290 _novomodules="mga $_novomodules"
4292 echores "$_mga"
4295 echocheck "xmga"
4296 if test "$_xmga" = auto ; then
4297 _xmga=no
4298 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4300 if test "$_xmga" = yes ; then
4301 _def_xmga='#define HAVE_XMGA 1'
4302 _vosrc="$_vosrc vo_xmga.c"
4303 _vomodules="xmga $_vomodules"
4304 else
4305 _def_xmga='#undef HAVE_XMGA'
4306 _novomodules="xmga $_novomodules"
4308 echores "$_xmga"
4311 echocheck "GGI"
4312 if test "$_ggi" = auto ; then
4313 cat > $TMPC << EOF
4314 #include <ggi/ggi.h>
4315 int main(void) { ggiInit(); return 0; }
4317 _ggi=no
4318 cc_check -lggi && _ggi=yes
4320 if test "$_ggi" = yes ; then
4321 _def_ggi='#define HAVE_GGI 1'
4322 _libs_mplayer="$_libs_mplayer -lggi"
4323 _vosrc="$_vosrc vo_ggi.c"
4324 _vomodules="ggi $_vomodules"
4325 else
4326 _def_ggi='#undef HAVE_GGI'
4327 _novomodules="ggi $_novomodules"
4329 echores "$_ggi"
4331 echocheck "GGI extension: libggiwmh"
4332 if test "$_ggiwmh" = auto ; then
4333 _ggiwmh=no
4334 cat > $TMPC << EOF
4335 #include <ggi/ggi.h>
4336 #include <ggi/wmh.h>
4337 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4339 cc_check -lggi -lggiwmh && _ggiwmh=yes
4341 # needed to get right output on obscure combination
4342 # like --disable-ggi --enable-ggiwmh
4343 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4344 _def_ggiwmh='#define HAVE_GGIWMH 1'
4345 _libs_mplayer="$_libs_mplayer -lggiwmh"
4346 else
4347 _ggiwmh=no
4348 _def_ggiwmh='#undef HAVE_GGIWMH'
4350 echores "$_ggiwmh"
4353 echocheck "AA"
4354 if test "$_aa" = auto ; then
4355 cat > $TMPC << EOF
4356 #include <aalib.h>
4357 extern struct aa_hardware_params aa_defparams;
4358 extern struct aa_renderparams aa_defrenderparams;
4359 int main(void) {
4360 aa_context *c;
4361 aa_renderparams *p;
4362 (void) aa_init(0, 0, 0);
4363 c = aa_autoinit(&aa_defparams);
4364 p = aa_getrenderparams();
4365 aa_autoinitkbd(c,0);
4366 return 0; }
4368 _aa=no
4369 for _ld_tmp in "-laa" ; do
4370 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4371 done
4373 if test "$_aa" = yes ; then
4374 _def_aa='#define HAVE_AA 1'
4375 if cygwin ; then
4376 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4378 _vosrc="$_vosrc vo_aa.c"
4379 _vomodules="aa $_vomodules"
4380 else
4381 _def_aa='#undef HAVE_AA'
4382 _novomodules="aa $_novomodules"
4384 echores "$_aa"
4387 echocheck "CACA"
4388 if test "$_caca" = auto ; then
4389 _caca=no
4390 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4391 cat > $TMPC << EOF
4392 #include <caca.h>
4393 #ifdef CACA_API_VERSION_1
4394 #include <caca0.h>
4395 #endif
4396 int main(void) { (void) caca_init(); return 0; }
4398 cc_check `caca-config --libs` && _caca=yes
4401 if test "$_caca" = yes ; then
4402 _def_caca='#define HAVE_CACA 1'
4403 _inc_extra="$_inc_extra `caca-config --cflags`"
4404 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4405 _vosrc="$_vosrc vo_caca.c"
4406 _vomodules="caca $_vomodules"
4407 else
4408 _def_caca='#undef HAVE_CACA'
4409 _novomodules="caca $_novomodules"
4411 echores "$_caca"
4414 echocheck "SVGAlib"
4415 if test "$_svga" = auto ; then
4416 cat > $TMPC << EOF
4417 #include <vga.h>
4418 int main(void) { return 0; }
4420 _svga=no
4421 cc_check -lvga $_ld_lm && _svga=yes
4423 if test "$_svga" = yes ; then
4424 _def_svga='#define HAVE_SVGALIB 1'
4425 _libs_mplayer="$_libs_mplayer -lvga"
4426 _vosrc="$_vosrc vo_svga.c"
4427 _vomodules="svga $_vomodules"
4428 else
4429 _def_svga='#undef HAVE_SVGALIB'
4430 _novomodules="svga $_novomodules"
4432 echores "$_svga"
4435 echocheck "FBDev"
4436 if test "$_fbdev" = auto ; then
4437 _fbdev=no
4438 linux && _fbdev=yes
4440 if test "$_fbdev" = yes ; then
4441 _def_fbdev='#define HAVE_FBDEV 1'
4442 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4443 _vomodules="fbdev $_vomodules"
4444 else
4445 _def_fbdev='#undef HAVE_FBDEV'
4446 _novomodules="fbdev $_novomodules"
4448 echores "$_fbdev"
4452 echocheck "DVB"
4453 if test "$_dvb" = auto ; then
4454 _dvb=no
4455 cat >$TMPC << EOF
4456 #include <sys/poll.h>
4457 #include <sys/ioctl.h>
4458 #include <stdio.h>
4459 #include <time.h>
4460 #include <unistd.h>
4461 #include <ost/dmx.h>
4462 #include <ost/frontend.h>
4463 #include <ost/sec.h>
4464 #include <ost/video.h>
4465 #include <ost/audio.h>
4466 int main(void) {return 0;}
4468 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4469 cc_check $_inc_tmp && _dvb=yes && \
4470 _inc_extra="$_inc_extra $_inc_tmp" && break
4471 done
4473 echores "$_dvb"
4474 if test "$_dvb" = yes ; then
4475 _def_dvb='#define HAVE_DVB 1'
4476 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4477 _aomodules="mpegpes(dvb) $_aomodules"
4478 _vomodules="mpegpes(dvb) $_vomodules"
4481 echocheck "DVB HEAD"
4482 if test "$_dvbhead" = auto ; then
4483 _dvbhead=no
4485 cat >$TMPC << EOF
4486 #include <sys/poll.h>
4487 #include <sys/ioctl.h>
4488 #include <stdio.h>
4489 #include <time.h>
4490 #include <unistd.h>
4491 #include <linux/dvb/dmx.h>
4492 #include <linux/dvb/frontend.h>
4493 #include <linux/dvb/video.h>
4494 #include <linux/dvb/audio.h>
4495 int main(void) {return 0;}
4497 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4498 cc_check $_inc_tmp && _dvbhead=yes && \
4499 _inc_extra="$_inc_extra $_inc_tmp" && break
4500 done
4502 echores "$_dvbhead"
4503 if test "$_dvbhead" = yes ; then
4504 _def_dvb='#define HAVE_DVB_HEAD 1'
4505 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4506 _aomodules="mpegpes(dvb) $_aomodules"
4507 _vomodules="mpegpes(dvb) $_vomodules"
4510 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4511 _def_dvb='#undef HAVE_DVB'
4512 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4513 _aomodules="mpegpes(file) $_aomodules"
4514 _vomodules="mpegpes(file) $_vomodules"
4517 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4518 _dvbin=yes
4519 _inputmodules="dvb $_inputmodules"
4520 else
4521 _dvbin=no
4522 _noinputmodules="dvb $_noinputmodules"
4528 echocheck "PNG support"
4529 if test "$_png" = auto ; then
4530 _png=no
4531 if irix ; then
4532 # Don't check for -lpng on irix since it has its own libpng
4533 # incompatible with the GNU libpng
4534 _res_comment="disabled on irix (not GNU libpng)"
4535 else
4536 cat > $TMPC << EOF
4537 #include <png.h>
4538 #include <string.h>
4539 int main(void) {
4540 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4541 printf("libpng: %s\n", png_libpng_ver);
4542 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4545 if cc_check -lpng -lz $_ld_lm ; then
4546 if tmp_run ; then
4547 _png=yes
4548 else
4549 _res_comment="mismatch of library and header versions"
4554 echores "$_png"
4555 if test "$_png" = yes ; then
4556 _def_png='#define HAVE_PNG 1'
4557 _ld_extra="$_ld_extra -lpng -lz"
4558 _vosrc="$_vosrc vo_png.c"
4559 _vomodules="png $_vomodules"
4560 else
4561 _def_png='#undef HAVE_PNG'
4562 _novomodules="png $_novomodules"
4565 echocheck "JPEG support"
4566 if test "$_jpeg" = auto ; then
4567 _jpeg=no
4568 cat > $TMPC << EOF
4569 #include <stdio.h>
4570 #include <stdlib.h>
4571 #include <setjmp.h>
4572 #include <string.h>
4573 #include <jpeglib.h>
4574 int main(void) { return 0; }
4576 if cc_check -ljpeg $_ld_lm ; then
4577 if tmp_run ; then
4578 _jpeg=yes
4582 echores "$_jpeg"
4584 if test "$_jpeg" = yes ; then
4585 _def_jpeg='#define HAVE_JPEG 1'
4586 _vosrc="$_vosrc vo_jpeg.c"
4587 _vomodules="jpeg $_vomodules"
4588 _ld_extra="$_ld_extra -ljpeg"
4589 else
4590 _def_jpeg='#undef HAVE_JPEG'
4591 _novomodules="jpeg $_novomodules"
4596 echocheck "PNM support"
4597 if test "$_pnm" = yes; then
4598 _def_pnm="#define HAVE_PNM"
4599 _vosrc="$_vosrc vo_pnm.c"
4600 _vomodules="pnm $_vomodules"
4601 else
4602 _def_pnm="#undef HAVE_PNM"
4603 _novomodules="pnm $_novomodules"
4605 echores "$_pnm"
4609 echocheck "GIF support"
4610 # This is to appease people who want to force gif support.
4611 # If it is forced to yes, then we still do checks to determine
4612 # which gif library to use.
4613 if test "$_gif" = yes ; then
4614 _force_gif=yes
4615 _gif=auto
4618 if test "$_gif" = auto ; then
4619 _gif=no
4620 cat > $TMPC << EOF
4621 #include <gif_lib.h>
4622 int main(void) { return 0; }
4624 for _ld_gif in "-lungif" "-lgif" ; do
4625 cc_check $_ld_gif && tmp_run && _gif=yes && break
4626 done
4629 # If no library was found, and the user wants support forced,
4630 # then we force it on with libgif, as this is the safest
4631 # assumption IMHO. (libungif & libregif both create symbolic
4632 # links to libgif. We also assume that no x11 support is needed,
4633 # because if you are forcing this, then you _should_ know what
4634 # you are doing. [ Besides, package maintainers should never
4635 # have compiled x11 deps into libungif in the first place. ] )
4636 # </rant>
4637 # --Joey
4638 if test "$_force_gif" = yes && test "$_gif" = no ; then
4639 _gif=yes
4640 _ld_gif="-lgif"
4643 if test "$_gif" = yes ; then
4644 _def_gif='#define HAVE_GIF 1'
4645 _vosrc="$_vosrc vo_gif89a.c"
4646 _codecmodules="gif $_codecmodules"
4647 _vomodules="gif89a $_vomodules"
4648 _res_comment="old version, some encoding functions disabled"
4649 _def_gif_4='#undef HAVE_GIF_4'
4650 _ld_extra="$_ld_extra $_ld_gif"
4652 cat > $TMPC << EOF
4653 #include <signal.h>
4654 #include <gif_lib.h>
4655 void catch() { exit(1); }
4656 int main(void) {
4657 signal(SIGSEGV, catch); // catch segfault
4658 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4659 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4660 return 0;
4663 if cc_check "$_ld_gif" && tmp_run ; then
4664 _def_gif_4='#define HAVE_GIF_4 1'
4665 _res_comment=""
4667 else
4668 _def_gif='#undef HAVE_GIF'
4669 _def_gif_4='#undef HAVE_GIF_4'
4670 _novomodules="gif89a $_novomodules"
4671 _nocodecmodules="gif $_nocodecmodules"
4673 echores "$_gif"
4676 case "$_gif" in yes*)
4677 echocheck "broken giflib workaround"
4678 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4680 cat > $TMPC << EOF
4681 #include <gif_lib.h>
4682 int main(void) {
4683 GifFileType gif;
4684 printf("UserData is at address %p\n", gif.UserData);
4685 return 0;
4688 if cc_check "$_ld_gif" && tmp_run ; then
4689 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4690 echores "disabled"
4691 else
4692 echores "enabled"
4695 esac
4698 echocheck "VESA support"
4699 if test "$_vesa" = auto ; then
4700 cat > $TMPC << EOF
4701 #include <vbe.h>
4702 int main(void) { vbeVersion(); return 0; }
4704 _vesa=no
4705 cc_check -lvbe -llrmi && _vesa=yes
4707 if test "$_vesa" = yes ; then
4708 _def_vesa='#define HAVE_VESA 1'
4709 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4710 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4711 _vomodules="vesa $_vomodules"
4712 else
4713 _def_vesa='#undef HAVE_VESA'
4714 _novomodules="vesa $_novomodules"
4716 echores "$_vesa"
4718 #################
4719 # VIDEO + AUDIO #
4720 #################
4723 echocheck "SDL"
4724 if test -z "$_sdlconfig" ; then
4725 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4726 _sdlconfig="sdl-config"
4727 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4728 _sdlconfig="sdl11-config"
4729 else
4730 _sdlconfig=false
4733 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4734 cat > $TMPC << EOF
4735 #include <SDL.h>
4736 int main(void) {
4737 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4738 return 0;
4741 _sdl=no
4742 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4743 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4744 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4745 if test "$_sdlversion" -gt 116 ; then
4746 if test "$_sdlversion" -lt 121 ; then
4747 _def_sdlbuggy='#define BUGGY_SDL'
4748 else
4749 _def_sdlbuggy='#undef BUGGY_SDL'
4751 _sdl=yes
4756 if test "$_sdl" = yes ; then
4757 _def_sdl='#define HAVE_SDL 1'
4758 if cygwin ; then
4759 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4760 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4761 elif mingw32 ; then
4762 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4763 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4764 else
4765 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4766 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4768 _vosrc="$_vosrc vo_sdl.c"
4769 _vomodules="sdl $_vomodules"
4770 _aosrc="$_aosrc ao_sdl.c"
4771 _aomodules="sdl $_aomodules"
4772 _res_comment="using $_sdlconfig"
4773 else
4774 _def_sdl='#undef HAVE_SDL'
4775 _novomodules="sdl $_novomodules"
4776 _noaomodules="sdl $_noaomodules"
4778 echores "$_sdl"
4781 if win32; then
4783 echocheck "Windows waveout"
4784 if test "$_win32waveout" = auto ; then
4785 cat > $TMPC << EOF
4786 #include <windows.h>
4787 #include <mmsystem.h>
4788 int main(void) { return 0; }
4790 _win32waveout=no
4791 cc_check -lwinmm && _win32waveout=yes
4793 if test "$_win32waveout" = yes ; then
4794 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4795 _libs_mplayer="$_libs_mplayer -lwinmm"
4796 _aosrc="$_aosrc ao_win32.c"
4797 _aomodules="win32 $_aomodules"
4798 else
4799 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4800 _noaomodules="win32 $_noaomodules"
4802 echores "$_win32waveout"
4804 echocheck "Directx"
4805 if test "$_directx" = auto ; then
4806 cat > $TMPC << EOF
4807 #include <windows.h>
4808 #include <ddraw.h>
4809 #include <dsound.h>
4810 int main(void) { return 0; }
4812 _directx=no
4813 cc_check -lgdi32 && _directx=yes
4815 if test "$_directx" = yes ; then
4816 _def_directx='#define HAVE_DIRECTX 1'
4817 _libs_mplayer="$_libs_mplayer -lgdi32"
4818 _vosrc="$_vosrc vo_directx.c"
4819 _vomodules="directx $_vomodules"
4820 _aosrc="$_aosrc ao_dsound.c"
4821 _aomodules="dsound $_aomodules"
4822 else
4823 _def_directx='#undef HAVE_DIRECTX'
4824 _novomodules="directx $_novomodules"
4825 _noaomodules="dsound $_noaomodules"
4827 echores "$_directx"
4829 fi #if win32; then
4832 echocheck "NAS"
4833 if test "$_nas" = auto ; then
4834 cat > $TMPC << EOF
4835 #include <audio/audiolib.h>
4836 int main(void) { return 0; }
4838 _nas=no
4839 cc_check $_ld_lm -laudio -lXt && _nas=yes
4841 if test "$_nas" = yes ; then
4842 _def_nas='#define HAVE_NAS 1'
4843 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4844 _aosrc="$_aosrc ao_nas.c"
4845 _aomodules="nas $_aomodules"
4846 else
4847 _noaomodules="nas $_noaomodules"
4848 _def_nas='#undef HAVE_NAS'
4850 echores "$_nas"
4852 echocheck "DXR2"
4853 if test "$_dxr2" = auto; then
4854 _dxr2=no
4855 cat > $TMPC << EOF
4856 #include <dxr2ioctl.h>
4857 int main(void) { return 0; }
4859 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4860 cc_check $_inc_tmp && _dxr2=yes && \
4861 _inc_extra="$_inc_extra $_inc_tmp" && break
4862 done
4864 if test "$_dxr2" = yes; then
4865 _def_dxr2='#define HAVE_DXR2 1'
4866 _vosrc="$_vosrc vo_dxr2.c"
4867 _aosrc="$_aosrc ao_dxr2.c"
4868 _aomodules="dxr2 $_aomodules"
4869 _vomodules="dxr2 $_vomodules"
4870 else
4871 _def_dxr2='#undef HAVE_DXR2'
4872 _noaomodules="dxr2 $_noaomodules"
4873 _novomodules="dxr2 $_novomodules"
4875 echores "$_dxr2"
4877 echocheck "DXR3/H+"
4878 if test "$_dxr3" = auto ; then
4879 cat > $TMPC << EOF
4880 #include <linux/em8300.h>
4881 int main(void) { return 0; }
4883 _dxr3=no
4884 cc_check && _dxr3=yes
4886 if test "$_dxr3" = yes ; then
4887 _def_dxr3='#define HAVE_DXR3 1'
4888 _vosrc="$_vosrc vo_dxr3.c"
4889 _vomodules="dxr3 $_vomodules"
4890 else
4891 _def_dxr3='#undef HAVE_DXR3'
4892 _novomodules="dxr3 $_novomodules"
4894 echores "$_dxr3"
4897 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4898 if test "$_ivtv" = auto ; then
4899 cat > $TMPC << EOF
4900 #include <stdlib.h>
4901 #include <inttypes.h>
4902 #include <linux/types.h>
4903 #include <linux/videodev2.h>
4904 #include <linux/ivtv.h>
4905 #include <sys/ioctl.h>
4906 int main(void) {
4907 struct ivtv_cfg_stop_decode sd;
4908 struct ivtv_cfg_start_decode sd1;
4909 ioctl (0, IVTV_IOC_START_DECODE, &sd1);
4910 ioctl (0, IVTV_IOC_STOP_DECODE, &sd);
4911 return 0; }
4913 _ivtv=no
4914 cc_check && _ivtv=yes
4916 if test "$_ivtv" = yes ; then
4917 _def_ivtv='#define HAVE_IVTV 1'
4918 _vosrc="$_vosrc vo_ivtv.c"
4919 _vomodules="ivtv $_vomodules"
4920 _aosrc="$_aosrc ao_ivtv.c"
4921 _aomodules="ivtv $_aomodules"
4922 else
4923 _def_ivtv='#undef HAVE_IVTV'
4924 _novomodules="ivtv $_novomodules"
4925 _noaomodules="ivtv $_noaomodules"
4927 echores "$_ivtv"
4930 echocheck "V4L2 MPEG Decoder"
4931 if test "$_v4l2" = auto ; then
4932 cat > $TMPC << EOF
4933 #include <stdlib.h>
4934 #include <inttypes.h>
4935 #include <linux/types.h>
4936 #include <linux/videodev2.h>
4937 #include <linux/version.h>
4938 int main(void) {
4939 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4940 #error kernel headers too old, need 2.6.22
4941 bad_kernel_version();
4942 #endif
4943 struct v4l2_ext_controls ctrls;
4944 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4945 return 0;
4948 _v4l2=no
4949 cc_check && _v4l2=yes
4951 if test "$_v4l2" = yes ; then
4952 _def_v4l2='#define HAVE_V4L2_DECODER 1'
4953 _vosrc="$_vosrc vo_v4l2.c"
4954 _vomodules="v4l2 $_vomodules"
4955 _aosrc="$_aosrc ao_v4l2.c"
4956 _aomodules="v4l2 $_aomodules"
4957 else
4958 _def_v4l2='#undef HAVE_V4L2_DECODER'
4959 _novomodules="v4l2 $_novomodules"
4960 _noaomodules="v4l2 $_noaomodules"
4962 echores "$_v4l2"
4966 #########
4967 # AUDIO #
4968 #########
4971 echocheck "OSS Audio"
4972 if test "$_ossaudio" = auto ; then
4973 cat > $TMPC << EOF
4974 #include <sys/ioctl.h>
4975 #include <$_soundcard_header>
4976 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4978 _ossaudio=no
4979 cc_check && _ossaudio=yes
4981 if test "$_ossaudio" = yes ; then
4982 _def_ossaudio='#define USE_OSS_AUDIO 1'
4983 _aosrc="$_aosrc ao_oss.c"
4984 _aomodules="oss $_aomodules"
4985 if test "$_linux_devfs" = yes; then
4986 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4987 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4988 else
4989 cat > $TMPC << EOF
4990 #include <sys/ioctl.h>
4991 #include <$_soundcard_header>
4992 #ifdef OPEN_SOUND_SYSTEM
4993 int main(void) { return 0; }
4994 #else
4995 #error Not the real thing
4996 #endif
4998 _real_ossaudio=no
4999 cc_check && _real_ossaudio=yes
5000 if test "$_real_ossaudio" = yes; then
5001 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5002 elif netbsd || openbsd ; then
5003 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5004 _ld_extra="$_ld_extra -lossaudio"
5005 else
5006 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5008 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5010 else
5011 _def_ossaudio='#undef USE_OSS_AUDIO'
5012 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5013 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5014 _noaomodules="oss $_noaomodules"
5016 echores "$_ossaudio"
5019 echocheck "aRts"
5020 if test "$_arts" = auto ; then
5021 _arts=no
5022 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5024 cat > $TMPC << EOF
5025 #include <artsc.h>
5026 int main(void) { return 0; }
5028 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5033 if test "$_arts" = yes ; then
5034 _def_arts='#define USE_ARTS 1'
5035 _aosrc="$_aosrc ao_arts.c"
5036 _aomodules="arts $_aomodules"
5037 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5038 _inc_extra="$_inc_extra `artsc-config --cflags`"
5039 else
5040 _noaomodules="arts $_noaomodules"
5042 echores "$_arts"
5045 echocheck "EsounD"
5046 if test "$_esd" = auto ; then
5047 _esd=no
5048 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5050 cat > $TMPC << EOF
5051 #include <esd.h>
5052 int main(void) { int fd = esd_open_sound("test"); return fd; }
5054 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5058 echores "$_esd"
5060 if test "$_esd" = yes ; then
5061 _def_esd='#define USE_ESD 1'
5062 _aosrc="$_aosrc ao_esd.c"
5063 _aomodules="esd $_aomodules"
5064 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5065 _inc_extra="$_inc_extra `esd-config --cflags`"
5067 echocheck "esd_get_latency()"
5068 cat > $TMPC << EOF
5069 #include <esd.h>
5070 int main(void) { return esd_get_latency(0); }
5072 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5073 echores "$_esd_latency"
5074 else
5075 _def_esd='#undef USE_ESD'
5076 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5077 _noaomodules="esd $_noaomodules"
5080 echocheck "pulse"
5081 if test "$_pulse" = auto ; then
5082 _pulse=no
5083 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5085 cat > $TMPC << EOF
5086 #include <pulse/pulseaudio.h>
5087 int main(void) { return 0; }
5089 cc_check `$_pkg_config --libs --cflags libpulse` && tmp_run && _pulse=yes
5093 echores "$_pulse"
5095 if test "$_pulse" = yes ; then
5096 _def_pulse='#define USE_PULSE 1'
5097 _aosrc="$_aosrc ao_pulse.c"
5098 _aomodules="pulse $_aomodules"
5099 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs libpulse`"
5100 _inc_extra="$_inc_extra `$_pkg_config --cflags libpulse`"
5101 else
5102 _def_pulse='#undef USE_PULSE'
5103 _noaomodules="pulse $_noaomodules"
5107 echocheck "JACK"
5108 if test "$_jack" = auto ; then
5109 _jack=yes
5111 cat > $TMPC << EOF
5112 #include <jack/jack.h>
5113 int main(void) { jack_client_new("test"); return 0; }
5115 if cc_check -ljack ; then
5116 _libs_mplayer="$_libs_mplayer -ljack"
5117 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5118 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5119 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5120 else
5121 _jack=no
5125 if test "$_jack" = yes ; then
5126 _def_jack='#define USE_JACK 1'
5127 _aosrc="$_aosrc ao_jack.c"
5128 _aomodules="jack $_aomodules"
5129 else
5130 _noaomodules="jack $_noaomodules"
5132 echores "$_jack"
5134 echocheck "OpenAL"
5135 if test "$_openal" = auto ; then
5136 _openal=no
5137 cat > $TMPC << EOF
5138 #ifdef OPENAL_AL_H
5139 #include <OpenAL/al.h>
5140 #else
5141 #include <AL/al.h>
5142 #endif
5143 int main(void) {
5144 alSourceQueueBuffers(0, 0, 0);
5145 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5146 return 0;
5149 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5150 cc_check $I && _openal=yes && break
5151 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5152 done
5153 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5155 if test "$_openal" = yes ; then
5156 _def_openal='#define USE_OPENAL 1'
5157 _aosrc="$_aosrc ao_openal.c"
5158 _aomodules="openal $_aomodules"
5159 else
5160 _noaomodules="openal $_noaomodules"
5162 echores "$_openal"
5164 echocheck "ALSA audio"
5165 if test "$_alsa" != no ; then
5166 _alsa=no
5167 cat > $TMPC << EOF
5168 #include <sys/asoundlib.h>
5169 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5170 #error "alsa version != 0.5.x"
5171 #endif
5172 int main(void) { return 0; }
5174 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5176 cat > $TMPC << EOF
5177 #include <sys/asoundlib.h>
5178 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5179 #error "alsa version != 0.9.x"
5180 #endif
5181 int main(void) { return 0; }
5183 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5184 cat > $TMPC << EOF
5185 #include <alsa/asoundlib.h>
5186 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5187 #error "alsa version != 0.9.x"
5188 #endif
5189 int main(void) { return 0; }
5191 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5193 cat > $TMPC << EOF
5194 #include <sys/asoundlib.h>
5195 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5196 #error "alsa version != 1.0.x"
5197 #endif
5198 int main(void) { return 0; }
5200 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5201 cat > $TMPC << EOF
5202 #include <alsa/asoundlib.h>
5203 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5204 #error "alsa version != 1.0.x"
5205 #endif
5206 int main(void) { return 0; }
5208 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5210 _def_alsa5='#undef HAVE_ALSA5'
5211 _def_alsa9='#undef HAVE_ALSA9'
5212 _def_alsa1x='#undef HAVE_ALSA1X'
5213 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5214 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5215 if test "$_alsaver" ; then
5216 _alsa=yes
5217 if test "$_alsaver" = '0.5.x' ; then
5218 _alsa5=yes
5219 _aosrc="$_aosrc ao_alsa5.c"
5220 _aomodules="alsa5 $_aomodules"
5221 _def_alsa5='#define HAVE_ALSA5 1'
5222 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5223 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5224 elif test "$_alsaver" = '0.9.x-sys' ; then
5225 _alsa9=yes
5226 _aosrc="$_aosrc ao_alsa.c"
5227 _aomodules="alsa $_aomodules"
5228 _def_alsa9='#define HAVE_ALSA9 1'
5229 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5230 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5231 elif test "$_alsaver" = '0.9.x-alsa' ; then
5232 _alsa9=yes
5233 _aosrc="$_aosrc ao_alsa.c"
5234 _aomodules="alsa $_aomodules"
5235 _def_alsa9='#define HAVE_ALSA9 1'
5236 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5237 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5238 elif test "$_alsaver" = '1.0.x-sys' ; then
5239 _alsa1x=yes
5240 _aosrc="$_aosrc ao_alsa.c"
5241 _aomodules="alsa $_aomodules"
5242 _def_alsa1x="#define HAVE_ALSA1X 1"
5243 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5244 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5245 elif test "$_alsaver" = '1.0.x-alsa' ; then
5246 _alsa1x=yes
5247 _aosrc="$_aosrc ao_alsa.c"
5248 _aomodules="alsa $_aomodules"
5249 _def_alsa1x="#define HAVE_ALSA1X 1"
5250 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5251 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5252 else
5253 _alsa=no
5254 _res_comment="unknown version"
5256 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5257 else
5258 _noaomodules="alsa $_noaomodules"
5260 echores "$_alsa"
5263 echocheck "Sun audio"
5264 if test "$_sunaudio" = auto ; then
5265 cat > $TMPC << EOF
5266 #include <sys/types.h>
5267 #include <sys/audioio.h>
5268 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5270 _sunaudio=no
5271 cc_check && _sunaudio=yes
5273 if test "$_sunaudio" = yes ; then
5274 _def_sunaudio='#define USE_SUN_AUDIO 1'
5275 _aosrc="$_aosrc ao_sun.c"
5276 _aomodules="sun $_aomodules"
5277 else
5278 _def_sunaudio='#undef USE_SUN_AUDIO'
5279 _noaomodules="sun $_noaomodules"
5281 echores "$_sunaudio"
5284 if sunos; then
5285 echocheck "Sun mediaLib"
5286 if test "$_mlib" = auto ; then
5287 _mlib=no
5288 cat > $TMPC << EOF
5289 #include <mlib.h>
5290 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5292 cc_check -lmlib && _mlib=yes
5294 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5295 echores "$_mlib"
5296 fi #if sunos
5299 if irix; then
5300 echocheck "SGI audio"
5301 if test "$_sgiaudio" = auto ; then
5302 # check for SGI audio
5303 cat > $TMPC << EOF
5304 #include <dmedia/audio.h>
5305 int main(void) { return 0; }
5307 _sgiaudio=no
5308 cc_check && _sgiaudio=yes
5310 if test "$_sgiaudio" = "yes" ; then
5311 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5312 _libs_mplayer="$_libs_mplayer -laudio"
5313 _aosrc="$_aosrc ao_sgi.c"
5314 _aomodules="sgi $_aomodules"
5315 else
5316 _def_sgiaudio='#undef USE_SGI_AUDIO'
5317 _noaomodules="sgi $_noaomodules"
5319 echores "$_sgiaudio"
5320 fi #if irix
5323 echocheck "VCD support"
5324 if linux || freebsd || netbsd || dragonfly || bsdos || darwin || sunos || mingw32; then
5325 _inputmodules="vcd $_inputmodules"
5326 _def_vcd='#define HAVE_VCD 1'
5327 _vcd="yes"
5328 else
5329 _def_vcd='#undef HAVE_VCD'
5330 _noinputmodules="vcd $_noinputmodules"
5331 _res_comment="not supported on this OS"
5332 _vcd="no"
5334 echores "$_vcd"
5338 echocheck "dvdread"
5339 if test "$_dvdread_internal" = auto ; then
5340 _dvdread_internal=no
5341 _dvdread=no
5342 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5343 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5344 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5345 || darwin || win32; then
5346 _dvdread_internal=yes
5347 _dvdread=yes
5349 elif test "$_dvdread" = auto ; then
5350 _dvdread=no
5351 if test "$_dl" = yes; then
5352 cat > $TMPC << EOF
5353 #include <inttypes.h>
5354 #include <dvdread/dvd_reader.h>
5355 #include <dvdread/ifo_types.h>
5356 #include <dvdread/ifo_read.h>
5357 #include <dvdread/nav_read.h>
5358 int main(void) { return 0; }
5360 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5361 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5363 if test "$_dvdread" = no ; then
5364 _dvdreadconfig="dvdread-config"
5365 _dvdreadcflags=`$_dvdreadconfig --cflags`
5366 _dvdreadlibs=`$_dvdreadconfig --libs`
5367 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5368 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5369 _dvdread=yes
5370 _inc_extra="$_inc_extra $_dvdreadcflags"
5371 _ld_extra="$_ld_extra $_dvdreadlibs"
5372 _res_comment="external"
5377 if test "$_dvdread_internal" = yes; then
5378 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5379 _def_dvdread='#define USE_DVDREAD 1'
5380 _inputmodules="dvdread(internal) $_inputmodules"
5381 _largefiles=yes
5382 _res_comment="internal"
5383 elif test "$_dvdread" = yes; then
5384 _def_dvdread='#define USE_DVDREAD 1'
5385 _largefiles=yes
5386 _ld_extra="$_ld_extra -ldvdread"
5387 _inputmodules="dvdread(external) $_inputmodules"
5388 _res_comment="external"
5389 else
5390 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5391 _def_dvdread='#undef USE_DVDREAD'
5392 _noinputmodules="dvdread $_noinputmodules"
5394 echores "$_dvdread"
5397 echocheck "internal libdvdcss"
5398 if test "$_libdvdcss_internal" = auto ; then
5399 _libdvdcss_internal=no
5400 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5401 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5403 if test "$_libdvdcss_internal" = yes ; then
5404 if linux || netbsd || openbsd || bsdos ; then
5405 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5406 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5407 elif freebsd || dragonfly ; then
5408 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5409 elif darwin ; then
5410 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5411 _ld_extra="$_ld_extra -framework IOKit"
5413 _libdvdcss_dvdread_flags="-Ilibdvdcss -DHAVE_DVDCSS_DVDCSS_H"
5414 _inputmodules="libdvdcss(internal) $_inputmodules"
5415 _largefiles=yes
5416 else
5417 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5419 echores "$_libdvdcss_internal"
5422 echocheck "cdparanoia"
5423 if test "$_cdparanoia" = auto ; then
5424 cat > $TMPC <<EOF
5425 #include <cdda_interface.h>
5426 #include <cdda_paranoia.h>
5427 // This need a better test. How ?
5428 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5430 _cdparanoia=no
5431 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5432 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5433 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5434 done
5436 if test "$_cdparanoia" = yes ; then
5437 _cdda='yes'
5438 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5439 openbsd && _ld_extra="$_ld_extra -lutil"
5441 echores "$_cdparanoia"
5444 echocheck "libcdio"
5445 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5446 cat > $TMPC << EOF
5447 #include <stdio.h>
5448 #include <cdio/version.h>
5449 #include <cdio/cdda.h>
5450 #include <cdio/paranoia.h>
5451 int main(void) {
5452 void *test = cdda_verbose_set;
5453 printf("%s\n", CDIO_VERSION);
5454 return test == (void *)1;
5457 _libcdio=no
5458 for _ld_tmp in "" "-lwinmm" ; do
5459 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5460 cc_check $_ld_tmp $_ld_lm \
5461 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5462 done
5463 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5464 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5465 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5466 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5467 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5470 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5471 _cdda='yes'
5472 _def_libcdio='#define HAVE_LIBCDIO'
5473 _def_havelibcdio='yes'
5474 else
5475 if test "$_cdparanoia" = yes ; then
5476 _res_comment="using cdparanoia"
5478 _def_libcdio='#undef HAVE_LIBCDIO'
5479 _def_havelibcdio='no'
5481 echores "$_libcdio"
5483 if test "$_cdda" = yes ; then
5484 test $_cddb = auto && test $_network = yes && _cddb=yes
5485 _def_cdparanoia='#define HAVE_CDDA'
5486 _inputmodules="cdda $_inputmodules"
5487 else
5488 _def_cdparanoia='#undef HAVE_CDDA'
5489 _noinputmodules="cdda $_noinputmodules"
5492 if test "$_cddb" = yes ; then
5493 _def_cddb='#define HAVE_CDDB'
5494 _inputmodules="cddb $_inputmodules"
5495 else
5496 _cddb=no
5497 _def_cddb='#undef HAVE_CDDB'
5498 _noinputmodules="cddb $_noinputmodules"
5501 echocheck "bitmap font support"
5502 if test "$_bitmap_font" = yes ; then
5503 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5504 else
5505 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5507 echores "$_bitmap_font"
5510 echocheck "freetype >= 2.0.9"
5512 # freetype depends on iconv
5513 if test "$_iconv" = no ; then
5514 _freetype=no
5515 _res_comment="iconv support needed"
5518 if test "$_freetype" = auto ; then
5519 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5520 cat > $TMPC << EOF
5521 #include <stdio.h>
5522 #include <ft2build.h>
5523 #include FT_FREETYPE_H
5524 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5525 #error "Need FreeType 2.0.9 or newer"
5526 #endif
5527 int main(void) {
5528 FT_Library library;
5529 FT_Int major=-1,minor=-1,patch=-1;
5530 int err=FT_Init_FreeType(&library);
5531 if(err){
5532 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5533 exit(err);
5535 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5536 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5537 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5538 (int)major,(int)minor,(int)patch );
5539 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5540 printf("Library and header version mismatch! Fix it in your distribution!\n");
5541 exit(1);
5543 return 0;
5546 _freetype=no
5547 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5548 else
5549 _freetype=no
5552 if test "$_freetype" = yes ; then
5553 _def_freetype='#define HAVE_FREETYPE'
5554 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5555 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5556 else
5557 _def_freetype='#undef HAVE_FREETYPE'
5559 echores "$_freetype"
5561 if test "$_freetype" = no ; then
5562 _fontconfig=no
5563 _res_comment="freetype support needed"
5565 echocheck "fontconfig"
5566 if test "$_fontconfig" = auto ; then
5567 cat > $TMPC << EOF
5568 #include <stdio.h>
5569 #include <fontconfig/fontconfig.h>
5570 int main(void) {
5571 int err = FcInit();
5572 if(err == FcFalse){
5573 printf("Couldn't initialize fontconfig lib\n");
5574 exit(err);
5576 return 0;
5579 _fontconfig=no
5580 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5581 _ld_tmp="-lfontconfig $_ld_tmp"
5582 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5583 done
5584 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5585 _inc_tmp=`$_pkg_config --cflags fontconfig`
5586 _ld_tmp=`$_pkg_config --libs fontconfig`
5587 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5588 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5591 if test "$_fontconfig" = yes ; then
5592 _def_fontconfig='#define HAVE_FONTCONFIG'
5593 else
5594 _def_fontconfig='#undef HAVE_FONTCONFIG'
5596 echores "$_fontconfig"
5599 echocheck "SSA/ASS support"
5600 # libass depends on FreeType
5601 if test "$_freetype" = no ; then
5602 _ass=no
5603 _res_comment="FreeType support needed"
5606 if test "$_ass" = auto ; then
5607 cat > $TMPC << EOF
5608 #include <ft2build.h>
5609 #include FT_FREETYPE_H
5610 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5611 #error "Need FreeType 2.1.8 or newer"
5612 #endif
5613 int main(void) { return 0; }
5615 _ass=no
5616 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5617 if test "$_ass" = no ; then
5618 _res_comment="FreeType >= 2.1.8 needed"
5621 if test "$_ass" = yes ; then
5622 _def_ass='#define USE_ASS'
5623 else
5624 _def_ass='#undef USE_ASS'
5626 echores "$_ass"
5629 echocheck "fribidi with charsets"
5630 if test "$_fribidi" = auto ; then
5631 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5632 cat > $TMPC << EOF
5633 #include <stdio.h>
5634 /* workaround for fribidi 0.10.4 and below */
5635 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5636 #include <fribidi/fribidi.h>
5637 int main(void) {
5638 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5639 printf("Fribidi headers are not consistents with the library!\n");
5640 exit(1);
5642 return 0;
5645 _fribidi=no
5646 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5647 else
5648 _fribidi=no
5651 if test "$_fribidi" = yes ; then
5652 _def_fribidi='#define USE_FRIBIDI'
5653 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5654 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5655 else
5656 _def_fribidi='#undef USE_FRIBIDI'
5658 echores "$_fribidi"
5661 echocheck "ENCA"
5662 if test "$_enca" = auto ; then
5663 cat > $TMPC << EOF
5664 #include <enca.h>
5665 int main(void) {
5666 const char **langs;
5667 size_t langcnt;
5668 langs = enca_get_languages(&langcnt);
5669 return 0;
5672 _enca=no
5673 cc_check -lenca $_ld_lm && _enca=yes
5675 if test "$_enca" = yes ; then
5676 _def_enca='#define HAVE_ENCA 1'
5677 _ld_extra="$_ld_extra -lenca"
5678 else
5679 _def_enca='#undef HAVE_ENCA'
5681 echores "$_enca"
5684 echocheck "zlib"
5685 cat > $TMPC << EOF
5686 #include <zlib.h>
5687 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5689 _zlib=no
5690 cc_check -lz && _zlib=yes
5691 if test "$_zlib" = yes ; then
5692 _def_zlib='#define HAVE_ZLIB 1'
5693 _ld_extra="$_ld_extra -lz"
5694 else
5695 _def_zlib='#undef HAVE_ZLIB'
5696 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5697 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5699 echores "$_zlib"
5702 echocheck "RTC"
5703 if test "$_rtc" = auto ; then
5704 cat > $TMPC << EOF
5705 #include <sys/ioctl.h>
5706 #ifdef __linux__
5707 #include <linux/rtc.h>
5708 #else
5709 #include <rtc.h>
5710 #define RTC_PIE_ON RTCIO_PIE_ON
5711 #endif
5712 int main(void) { return RTC_PIE_ON; }
5714 _rtc=no
5715 cc_check && _rtc=yes
5716 ppc && _rtc=no
5718 if test "$_rtc" = yes ; then
5719 _def_rtc='#define HAVE_RTC 1'
5720 else
5721 _def_rtc='#undef HAVE_RTC'
5723 echores "$_rtc"
5726 echocheck "liblzo2 support"
5727 if test "$_liblzo" = auto ; then
5728 _liblzo=no
5729 cat > $TMPC << EOF
5730 #include <lzo/lzo1x.h>
5731 int main(void) { lzo_init();return 0; }
5733 cc_check -llzo2 && _liblzo=yes
5735 if test "$_liblzo" = yes ; then
5736 _def_liblzo='#define USE_LIBLZO 1'
5737 _ld_extra="$_ld_extra -llzo2"
5738 _codecmodules="liblzo $_codecmodules"
5739 else
5740 _def_liblzo='#undef USE_LIBLZO'
5741 _nocodecmodules="liblzo $_nocodecmodules"
5743 echores "$_liblzo"
5746 echocheck "mad support"
5747 if test "$_mad" = auto ; then
5748 _mad=no
5749 cat > $TMPC << EOF
5750 #include <mad.h>
5751 int main(void) { return 0; }
5753 cc_check -lmad && _mad=yes
5755 if test "$_mad" = yes ; then
5756 _def_mad='#define USE_LIBMAD 1'
5757 _ld_extra="$_ld_extra -lmad"
5758 _codecmodules="libmad $_codecmodules"
5759 else
5760 _def_mad='#undef USE_LIBMAD'
5761 _nocodecmodules="libmad $_nocodecmodules"
5763 echores "$_mad"
5765 echocheck "Twolame"
5766 if test "$_twolame" = auto ; then
5767 cat > $TMPC <<EOF
5768 #include <twolame.h>
5769 int main(void) { twolame_init(); return 0; }
5771 _twolame=no
5772 cc_check -ltwolame $_ld_lm && _twolame=yes
5774 if test "$_twolame" = yes ; then
5775 _def_twolame='#define HAVE_TWOLAME 1'
5776 _libs_mencoder="$_libs_mencoder -ltwolame"
5777 _codecmodules="twolame $_codecmodules"
5778 else
5779 _def_twolame='#undef HAVE_TWOLAME'
5780 _nocodecmodules="twolame $_nocodecmodules"
5782 echores "$_twolame"
5784 echocheck "Toolame"
5785 if test "$_toolame" = auto ; then
5786 _toolame=no
5787 if test "$_twolame" = yes ; then
5788 _res_comment="disabled by twolame"
5789 else
5790 cat > $TMPC <<EOF
5791 #include <toolame.h>
5792 int main(void) { toolame_init(); return 0; }
5794 cc_check -ltoolame $_ld_lm && _toolame=yes
5797 if test "$_toolame" = yes ; then
5798 _def_toolame='#define HAVE_TOOLAME 1'
5799 _libs_mencoder="$_libs_mencoder -ltoolame"
5800 _codecmodules="toolame $_codecmodules"
5801 else
5802 _def_toolame='#undef HAVE_TOOLAME'
5803 _nocodecmodules="toolame $_nocodecmodules"
5805 if test "$_toolamedir" ; then
5806 _res_comment="using $_toolamedir"
5808 echores "$_toolame"
5810 echocheck "OggVorbis support"
5811 if test "$_tremor_internal" = yes; then
5812 _libvorbis=no
5813 elif test "$_tremor_external" = auto; then
5814 _tremor_external=no
5815 cat > $TMPC << EOF
5816 #include <tremor/ivorbiscodec.h>
5817 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5819 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5821 if test "$_libvorbis" = auto; then
5822 _libvorbis=no
5823 cat > $TMPC << EOF
5824 #include <vorbis/codec.h>
5825 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5827 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5829 if test "$_tremor_internal" = yes ; then
5830 _vorbis=yes
5831 _def_vorbis='#define HAVE_OGGVORBIS 1'
5832 _def_tremor='#define TREMOR 1'
5833 _codecmodules="tremor(internal) $_codecmodules"
5834 _res_comment="internal Tremor"
5835 if test "$_tremor_low" = yes ; then
5836 CFLAGS="$CFLAGS -D_LOW_ACCURACY_"
5837 _res_comment="internal low accuracy Tremor"
5839 elif test "$_tremor_external" = yes ; then
5840 _vorbis=yes
5841 _def_vorbis='#define HAVE_OGGVORBIS 1'
5842 _def_tremor='#define TREMOR 1'
5843 _codecmodules="tremor(external) $_codecmodules"
5844 _res_comment="external Tremor"
5845 _ld_extra="$_ld_extra -logg -lvorbisidec"
5846 elif test "$_libvorbis" = yes ; then
5847 _vorbis=yes
5848 _def_vorbis='#define HAVE_OGGVORBIS 1'
5849 _codecmodules="libvorbis $_codecmodules"
5850 _res_comment="libvorbis"
5851 _ld_extra="$_ld_extra -lvorbis -logg"
5852 else
5853 _vorbis=no
5854 _nocodecmodules="libvorbis $_nocodecmodules"
5856 echores "$_vorbis"
5858 echocheck "libspeex (version >= 1.1 required)"
5859 if test "$_speex" = auto ; then
5860 _speex=no
5861 cat > $TMPC << EOF
5862 #include <speex/speex.h>
5863 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); }
5865 cc_check -lspeex $_ld_lm && _speex=yes
5867 if test "$_speex" = yes ; then
5868 _def_speex='#define HAVE_SPEEX 1'
5869 _ld_extra="$_ld_extra -lspeex"
5870 _codecmodules="speex $_codecmodules"
5871 else
5872 _def_speex='#undef HAVE_SPEEX'
5873 _nocodecmodules="speex $_nocodecmodules"
5875 echores "$_speex"
5877 echocheck "OggTheora support"
5878 if test "$_theora" = auto ; then
5879 _theora=no
5880 cat > $TMPC << EOF
5881 #include <theora/theora.h>
5882 #include <string.h>
5883 int main(void) {
5884 /* theora is in flux, make sure that all interface routines and
5885 * datatypes exist and work the way we expect it, so we don't break
5886 * mplayer */
5887 ogg_packet op;
5888 theora_comment tc;
5889 theora_info inf;
5890 theora_state st;
5891 yuv_buffer yuv;
5892 int r;
5893 double t;
5895 theora_info_init (&inf);
5896 theora_comment_init (&tc);
5898 return 0;
5900 /* we don't want to execute this kind of nonsense; just for making sure
5901 * that compilation works... */
5902 memset(&op, 0, sizeof(op));
5903 r = theora_decode_header (&inf, &tc, &op);
5904 r = theora_decode_init (&st, &inf);
5905 t = theora_granule_time (&st, op.granulepos);
5906 r = theora_decode_packetin (&st, &op);
5907 r = theora_decode_YUVout (&st, &yuv);
5908 theora_clear (&st);
5910 return 0;
5913 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5914 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5915 && _theora=yes && break
5916 done
5917 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5918 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5919 cc_check -I. tremor/bitwise.c $_ld_theora \
5920 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5921 done
5924 if test "$_theora" = yes ; then
5925 _def_theora='#define HAVE_OGGTHEORA 1'
5926 _codecmodules="libtheora $_codecmodules"
5927 # when --enable-theora is forced, we'd better provide a probably sane
5928 # $_ld_theora than nothing
5929 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5930 else
5931 _def_theora='#undef HAVE_OGGTHEORA'
5932 _nocodecmodules="libtheora $_nocodecmodules"
5934 echores "$_theora"
5936 echocheck "internal mp3lib support"
5937 if test "$_mp3lib" = yes ; then
5938 _def_mp3lib='#define USE_MP3LIB 1'
5939 _codecmodules="mp3lib $_codecmodules"
5940 else
5941 _def_mp3lib='#undef USE_MP3LIB'
5942 _nocodecmodules="mp3lib $_nocodecmodules"
5944 echores "$_mp3lib"
5946 echocheck "internal liba52 support"
5947 if test "$_liba52" = yes ; then
5948 _def_liba52='#define USE_LIBA52 1'
5949 _codecmodules="liba52 $_codecmodules"
5950 else
5951 _def_liba52='#undef USE_LIBA52'
5952 _nocodecmodules="liba52 $_nocodecmodules"
5954 echores "$_liba52"
5956 echocheck "libdca support"
5957 if test "$_libdca" = auto ; then
5958 _libdca=no
5959 cat > $TMPC << EOF
5960 #include <inttypes.h>
5961 #include <dts.h>
5962 int main(void) { dts_init (0); return 0; }
5964 for _ld_dca in -ldts -ldca ; do
5965 cc_check $_ld_dca $_ld_lm && _ld_extra="$_ld_extra $_ld_dca" \
5966 && _libdca=yes && break
5967 done
5969 if test "$_libdca" = yes ; then
5970 _def_libdca='#define USE_LIBDCA 1'
5971 _codecmodules="libdca $_codecmodules"
5972 else
5973 _def_libdca='#undef USE_LIBDCA'
5974 _nocodecmodules="libdca $_nocodecmodules"
5976 echores "$_libdca"
5978 echocheck "internal libmpeg2 support"
5979 if test "$_libmpeg2" = auto ; then
5980 _libmpeg2=yes
5981 if alpha && test cc_vendor=gnu; then
5982 case $cc_version in
5983 2*|3.0*|3.1*) # cannot compile MVI instructions
5984 _libmpeg2=no
5985 _res_comment="broken gcc"
5987 esac
5990 if test "$_libmpeg2" = yes ; then
5991 _def_libmpeg2='#define USE_LIBMPEG2 1'
5992 _codecmodules="libmpeg2 $_codecmodules"
5993 else
5994 _def_libmpeg2='#undef USE_LIBMPEG2'
5995 _nocodecmodules="libmpeg2 $_nocodecmodules"
5997 echores "$_libmpeg2"
5999 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6000 if test "$_musepack" = auto ; then
6001 _musepack=no
6002 cat > $TMPC << EOF
6003 #include <mpcdec/mpcdec.h>
6004 int main(void) {
6005 mpc_streaminfo info;
6006 mpc_decoder decoder;
6007 mpc_decoder_set_streaminfo(&decoder, &info);
6008 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6011 cc_check -lmpcdec $_ld_lm && _musepack=yes
6013 if test "$_musepack" = yes ; then
6014 _def_musepack='#define HAVE_MUSEPACK 1'
6015 _ld_extra="$_ld_extra -lmpcdec"
6016 _codecmodules="musepack $_codecmodules"
6017 else
6018 _def_musepack='#undef HAVE_MUSEPACK'
6019 _nocodecmodules="musepack $_nocodecmodules"
6021 echores "$_musepack"
6024 echocheck "FAAC (AAC encoder) support"
6025 if test "$_faac" = auto ; then
6026 cat > $TMPC <<EOF
6027 #include <inttypes.h>
6028 #include <faac.h>
6029 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6031 _faac=no
6032 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6033 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6034 done
6036 if test "$_faac" = yes ; then
6037 _def_faac="#define HAVE_FAAC 1"
6038 test "$_faac_lavc" = auto && _faac_lavc=yes
6039 if test "$_faac_lavc" = yes ; then
6040 _def_faac_lavc="#define CONFIG_LIBFAAC 1"
6041 _libs_mplayer="$_libs_mplayer $_ld_faac"
6042 _libavencoders="$_libavencoders LIBFAAC_ENCODER"
6044 _codecmodules="faac $_codecmodules"
6045 else
6046 _faac_lavc=no
6047 _def_faac="#undef HAVE_FAAC"
6048 _def_faac_lavc="#undef CONFIG_LIBFAAC"
6049 _nocodecmodules="faac $_nocodecmodules"
6051 _res_comment="in libavcodec: $_faac_lavc"
6052 echores "$_faac"
6055 echocheck "FAAD2 (AAC) support"
6056 if test "$_faad_internal" = auto ; then
6057 if x86_32 && test cc_vendor=gnu; then
6058 case $cc_version in
6059 3.1*|3.2) # ICE/insn with these versions
6060 _faad_internal=no
6061 _res_comment="broken gcc"
6064 _faad_internal=yes
6066 esac
6067 else
6068 _faad_internal=yes
6070 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6071 _faad_external=no
6072 cat > $TMPC << EOF
6073 #include <faad.h>
6074 #ifndef FAAD_MIN_STREAMSIZE
6075 #error Too old version
6076 #endif
6077 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6078 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6080 cc_check -lfaad $_ld_lm && _faad_external=yes
6083 if test "$_faad_internal" = yes ; then
6084 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6085 _faad=yes
6086 _res_comment="internal floating-point"
6087 if test "$_faad_fixed" = yes ; then
6088 # The FIXED_POINT implementation of FAAD2 improves performance
6089 # on some platforms, especially for SBR files.
6090 CFLAGS="$CFLAGS -DFIXED_POINT"
6091 _res_comment="internal fixed-point"
6093 elif test "$_faad_external" = yes ; then
6094 _faad=yes
6095 _ld_extra="$_ld_extra -lfaad"
6096 else
6097 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6098 _faad=no
6101 if test "$_faad" = yes ; then
6102 _def_faad='#define HAVE_FAAD 1'
6103 _codecmodules="faad2 $_codecmodules"
6104 else
6105 _def_faad='#undef HAVE_FAAD'
6106 _nocodecmodules="faad2 $_nocodecmodules"
6108 echores "$_faad"
6111 echocheck "LADSPA plugin support"
6112 if test "$_ladspa" = auto ; then
6113 cat > $TMPC <<EOF
6114 #include <stdio.h>
6115 #include <ladspa.h>
6116 int main(void) {
6117 const LADSPA_Descriptor *ld = NULL;
6118 return 0;
6121 _ladspa=no
6122 cc_check && _ladspa=yes
6124 if test "$_ladspa" = yes; then
6125 _def_ladspa="#define HAVE_LADSPA"
6126 else
6127 _def_ladspa="#undef HAVE_LADSPA"
6129 echores "$_ladspa"
6132 if test -z "$_codecsdir" ; then
6133 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6134 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6135 if test -d "$dir" ; then
6136 _codecsdir="$dir"
6137 break;
6139 done
6141 # Fall back on default directory.
6142 if test -z "$_codecsdir" ; then
6143 _codecsdir="$_libdir/codecs"
6144 mingw32 && _codecsdir="codecs"
6145 os2 && _codecsdir="codecs"
6149 echocheck "Win32 codecs"
6150 if test "$_win32dll" = auto ; then
6151 _win32dll=no
6152 if x86_32 && ! qnx; then
6153 _win32dll=yes
6156 if test "$_win32dll" = yes ; then
6157 _def_win32dll='#define USE_WIN32DLL 1'
6158 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6159 _res_comment="using $_win32codecsdir"
6160 if ! win32 ; then
6161 _def_win32_loader='#define WIN32_LOADER 1'
6162 _win32_emulation=yes
6163 else
6164 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6165 _res_comment="using native windows"
6167 _codecmodules="win32 $_codecmodules"
6168 else
6169 _def_win32dll='#undef USE_WIN32DLL'
6170 _def_win32_loader='#undef WIN32_LOADER'
6171 _nocodecmodules="win32 $_nocodecmodules"
6173 echores "$_win32dll"
6176 echocheck "XAnim codecs"
6177 if test "$_xanim" = auto ; then
6178 _xanim=no
6179 _res_comment="dynamic loader support needed"
6180 if test "$_dl" = yes ; then
6181 _xanim=yes
6184 if test "$_xanim" = yes ; then
6185 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6186 _def_xanim='#define USE_XANIM 1'
6187 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6188 _codecmodules="xanim $_codecmodules"
6189 _res_comment="using $_xanimcodecsdir"
6190 else
6191 _def_xanim='#undef USE_XANIM'
6192 _def_xanim_path='#undef XACODEC_PATH'
6193 _nocodecmodules="xanim $_nocodecmodules"
6195 echores "$_xanim"
6198 echocheck "RealPlayer codecs"
6199 if test "$_real" = auto ; then
6200 _real=no
6201 _res_comment="dynamic loader support needed"
6202 if test "$_dl" = yes || test "$_win32dll" = yes &&
6203 (linux || freebsd || netbsd || dragonfly || darwin || win32) ; then
6204 _real=yes
6207 if test "$_real" = yes ; then
6208 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6209 _def_real='#define USE_REALCODECS 1'
6210 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6211 _codecmodules="real $_codecmodules"
6212 _res_comment="using $_realcodecsdir"
6213 else
6214 _def_real='#undef USE_REALCODECS'
6215 _def_real_path="#undef REALCODEC_PATH"
6216 _nocodecmodules="real $_nocodecmodules"
6218 echores "$_real"
6221 echocheck "QuickTime codecs"
6222 _qtx_emulation=no
6223 _def_qtx_win32='#undef USE_QTX_CODECS_WIN32'
6224 if test "$_qtx" = auto ; then
6225 test "$_win32dll" = yes || darwin && _qtx=yes
6227 if test "$_qtx" = yes ; then
6228 _def_qtx='#define USE_QTX_CODECS 1'
6229 win32 && _qtx_codecs_win32=yes && _def_qtx_win32='#define USE_QTX_CODECS_WIN32 1'
6230 _codecmodules="qtx $_codecmodules"
6231 darwin || win32 || _qtx_emulation=yes
6232 else
6233 _def_qtx='#undef USE_QTX_CODECS'
6234 _nocodecmodules="qtx $_nocodecmodules"
6236 echores "$_qtx"
6238 echocheck "Nemesi Streaming Media libraries"
6239 if test "$_nemesi" = auto && test "$_network" = yes ; then
6240 _nemesi=no
6241 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6242 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6243 _nemesi=yes
6246 if test "$_nemesi" = yes; then
6247 _native_rtsp=no
6248 _def_nemesi='#define LIBNEMESI 1'
6249 _inputmodules="nemesi $_inputmodules"
6250 else
6251 _native_rtsp="$_network"
6252 _nemesi=no
6253 _def_nemesi='#undef LIBNEMESI'
6254 _noinputmodules="nemesi $_noinputmodules"
6256 echores "$_nemesi"
6258 echocheck "LIVE555 Streaming Media libraries"
6259 if test "$_live" = auto && test "$_network" = yes ; then
6260 cat > $TMPCPP << EOF
6261 #include <liveMedia.hh>
6262 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6263 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6264 #endif
6265 int main(void) {}
6268 _live=no
6269 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6270 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6271 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6272 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6273 $_livelibdir/groupsock/libgroupsock.a \
6274 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6275 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6276 $_ld_extra -lstdc++" \
6277 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6278 -I$_livelibdir/UsageEnvironment/include \
6279 -I$_livelibdir/BasicUsageEnvironment/include \
6280 -I$_livelibdir/groupsock/include" && \
6281 _live=yes && break
6282 done
6283 if test "$_live" != yes ; then
6284 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6285 _live_dist=yes
6289 if test "$_live" = yes && test "$_network" = yes; then
6290 _res_comment="using $_livelibdir"
6291 _def_live='#define STREAMING_LIVE555 1'
6292 _inputmodules="live555 $_inputmodules"
6293 elif test "$_live_dist" = yes && test "$_network" = yes; then
6294 _res_comment="using distribution version"
6295 _live="yes"
6296 _def_live='#define STREAMING_LIVE555 1'
6297 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6298 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6299 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6300 _inputmodules="live555 $_inputmodules"
6301 else
6302 _live=no
6303 _def_live='#undef STREAMING_LIVE555'
6304 _noinputmodules="live555 $_noinputmodules"
6306 echores "$_live"
6309 echocheck "FFmpeg libavutil"
6310 if test "$_libavutil_a" = auto ; then
6311 if test -d libavutil ; then
6312 _libavutil_a=yes
6313 _res_comment="static"
6314 else
6315 die "MPlayer will not compile without libavutil in the source tree."
6317 elif test "$_libavutil_so" = auto ; then
6318 _libavutil_so=no
6319 cat > $TMPC << EOF
6320 #include <libavutil/common.h>
6321 int main(void) { ff_gcd(1,1); return 0; }
6323 if $_pkg_config --exists libavutil ; then
6324 _inc_libavutil=`$_pkg_config --cflags libavutil`
6325 _ld_tmp=`$_pkg_config --libs libavutil`
6326 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6327 && _libavutil_so=yes
6328 elif cc_check -lavutil $_ld_lm ; then
6329 _ld_extra="$_ld_extra -lavutil"
6330 _libavutil_so=yes
6331 _res_comment="using libavutil.so, but static libavutil is recommended"
6334 _libavutil=no
6335 _def_libavutil='#undef USE_LIBAVUTIL'
6336 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6337 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6338 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6339 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6340 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6341 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6342 # neither static nor shared libavutil is available, but it is mandatory ...
6343 if test "$_libavutil" = no ; then
6344 die "You need static or shared libavutil, MPlayer will not compile without!"
6346 echores "$_libavutil"
6348 echocheck "FFmpeg libavcodec"
6349 if test "$_libavcodec_a" = auto ; then
6350 _libavcodec_a=no
6351 if test -d libavcodec && test -f libavcodec/utils.c ; then
6352 _libavcodec_a="yes"
6353 _res_comment="static"
6355 elif test "$_libavcodec_so" = auto ; then
6356 _libavcodec_so=no
6357 _res_comment="libavcodec.so is discouraged over static libavcodec"
6358 cat > $TMPC << EOF
6359 #include <libavcodec/avcodec.h>
6360 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6362 if $_pkg_config --exists libavcodec ; then
6363 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6364 _ld_tmp=`$_pkg_config --libs libavcodec`
6365 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6366 && _libavcodec_so=yes
6367 elif cc_check -lavcodec $_ld_lm ; then
6368 _ld_extra="$_ld_extra -lavcodec"
6369 _libavcodec_so=yes
6370 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6373 _libavcodec=no
6374 _def_libavcodec='#undef USE_LIBAVCODEC'
6375 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6376 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6377 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6378 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6379 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6380 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6381 test "$_libavcodec_mpegaudio_hp" = yes \
6382 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6383 if test "$_libavcodec_a" = yes ; then
6384 _codecmodules="libavcodec $_codecmodules"
6385 elif test "$_libavcodec_so" = yes ; then
6386 _codecmodules="libavcodec.so $_codecmodules"
6387 else
6388 _nocodecmodules="libavcodec $_nocodecmodules"
6390 echores "$_libavcodec"
6392 echocheck "FFmpeg libavformat"
6393 if test "$_libavformat_a" = auto ; then
6394 _libavformat_a=no
6395 if test -d libavformat && test -f libavformat/utils.c ; then
6396 _libavformat_a=yes
6397 _res_comment="static"
6399 elif test "$_libavformat_so" = auto ; then
6400 _libavformat_so=no
6401 cat > $TMPC <<EOF
6402 #include <libavformat/avformat.h>
6403 #include <libavcodec/opt.h>
6404 int main(void) { av_alloc_format_context(); return 0; }
6406 if $_pkg_config --exists libavformat ; then
6407 _inc_libavformat=`$_pkg_config --cflags libavformat`
6408 _ld_tmp=`$_pkg_config --libs libavformat`
6409 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6410 && _libavformat_so=yes
6411 elif cc_check $_ld_lm -lavformat ; then
6412 _ld_extra="$_ld_extra -lavformat"
6413 _libavformat_so=yes
6414 _res_comment="using libavformat.so, but static libavformat is recommended"
6417 _libavformat=no
6418 _def_libavformat='#undef USE_LIBAVFORMAT'
6419 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6420 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6421 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6422 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6423 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6424 test "$_libavformat_so" = yes \
6425 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6426 echores "$_libavformat"
6428 echocheck "FFmpeg libpostproc"
6429 if test "$_libpostproc_a" = auto ; then
6430 _libpostproc_a=no
6431 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6432 _libpostproc_a='yes'
6433 _res_comment="static"
6435 elif test "$_libpostproc_so" = auto ; then
6436 _libpostproc_so=no
6437 cat > $TMPC << EOF
6438 #define USE_LIBPOSTPROC 1
6439 #include <inttypes.h>
6440 #include <libpostproc/postprocess.h>
6441 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6443 if cc_check -lpostproc $_ld_lm ; then
6444 _ld_extra="$_ld_extra -lpostproc"
6445 _libpostproc_so=yes
6446 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6449 _libpostproc=no
6450 _def_libpostproc='#undef USE_LIBPOSTPROC'
6451 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6452 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6453 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6454 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6455 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6456 test "$_libpostproc_so" = yes \
6457 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6458 echores "$_libpostproc"
6461 echocheck "libamr narrowband"
6462 if test "$_libamr_nb" = auto ; then
6463 _libamr_nb=no
6464 cat > $TMPC << EOF
6465 #include <amrnb/interf_dec.h>
6466 int main(void) { Speech_Decode_Frame_init(); return 0; }
6468 cc_check -lamrnb && _libamr_nb=yes
6469 if test "$_libavcodec_a" != yes ; then
6470 _libamr_nb=no
6471 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6474 if test "$_libamr_nb" = yes ; then
6475 _libamr=yes
6476 _ld_extra="$_ld_extra -lamrnb"
6477 _def_libamr='#define CONFIG_LIBAMR 1'
6478 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6479 _libavdecoders="$_libavdecoders LIBAMR_NB_DECODER"
6480 _libavencoders="$_libavencoders LIBAMR_NB_ENCODER"
6481 _codecmodules="libamr_nb $_codecmodules"
6482 else
6483 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6484 _nocodecmodules="libamr_nb $_nocodecmodules"
6486 echores "$_libamr_nb"
6489 echocheck "libamr wideband"
6490 if test "$_libamr_wb" = auto ; then
6491 _libamr_wb=no
6492 cat > $TMPC << EOF
6493 #include <amrwb/dec_if.h>
6494 int main(void) { D_IF_init(); return 0; }
6496 cc_check -lamrwb && _libamr_wb=yes
6497 if test "$_libavcodec_a" != yes ; then
6498 _libamr_wb=no
6499 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6502 if test "$_libamr_wb" = yes ; then
6503 _libamr=yes
6504 _ld_extra="$_ld_extra -lamrwb"
6505 _def_libamr='#define CONFIG_LIBAMR 1'
6506 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6507 _libavdecoders="$_libavdecoders LIBAMR_WB_DECODER"
6508 _libavencoders="$_libavencoders LIBAMR_WB_ENCODER"
6509 _codecmodules="libamr_wb $_codecmodules"
6510 else
6511 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6512 _nocodecmodules="libamr_wb $_nocodecmodules"
6514 echores "$_libamr_wb"
6516 echocheck "libdv-0.9.5+"
6517 if test "$_libdv" = auto ; then
6518 _libdv=no
6519 cat > $TMPC <<EOF
6520 #include <libdv/dv.h>
6521 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6523 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6525 if test "$_libdv" = yes ; then
6526 _def_libdv='#define HAVE_LIBDV095 1'
6527 _ld_extra="$_ld_extra -ldv"
6528 _codecmodules="libdv $_codecmodules"
6529 else
6530 _def_libdv='#undef HAVE_LIBDV095'
6531 _nocodecmodules="libdv $_nocodecmodules"
6533 echores "$_libdv"
6536 echocheck "XviD"
6537 if test "$_xvid" = auto ; then
6538 _xvid=no
6539 cat > $TMPC << EOF
6540 #include <xvid.h>
6541 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6543 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6544 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6545 done
6548 if test "$_xvid" = yes ; then
6549 _def_xvid='#define HAVE_XVID4 1'
6550 _codecmodules="xvid $_codecmodules"
6551 else
6552 _def_xvid='#undef HAVE_XVID4'
6553 _nocodecmodules="xvid $_nocodecmodules"
6555 echores "$_xvid"
6557 echocheck "XviD two pass plugin"
6558 if test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
6559 cat > $TMPC << EOF
6560 #include <xvid.h>
6561 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6563 cc_check && _xvid_lavc=yes
6565 if test "$_xvid_lavc" = yes ; then
6566 _def_xvid_lavc='#define CONFIG_LIBXVID 1'
6567 _libavencoders="$_libavencoders LIBXVID_ENCODER"
6568 else
6569 _xvid_lavc=no
6570 _def_xvid_lavc='#undef CONFIG_LIBXVID'
6572 echores "$_xvid_lavc"
6575 echocheck "x264"
6576 if test "$_x264" = auto ; then
6577 cat > $TMPC << EOF
6578 #include <inttypes.h>
6579 #include <x264.h>
6580 #if X264_BUILD < 53
6581 #error We do not support old versions of x264. Get the latest from SVN.
6582 #endif
6583 int main(void) { x264_encoder_open((void*)0); return 0; }
6585 _x264=no
6586 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6587 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6588 done
6591 if test "$_x264" = yes ; then
6592 _def_x264='#define HAVE_X264 1'
6593 _codecmodules="x264 $_codecmodules"
6594 test "$_x264_lavc" = auto && _x264_lavc=yes
6595 if test "$_x264_lavc" = yes ; then
6596 _def_x264_lavc='#define CONFIG_LIBX264 1'
6597 _libs_mplayer="$_libs_mplayer $_ld_x264"
6598 _libavencoders="$_libavencoders LIBX264_ENCODER"
6600 else
6601 _x264_lavc=no
6602 _def_x264='#undef HAVE_X264'
6603 _def_x264_lavc='#undef CONFIG_LIBX264'
6604 _nocodecmodules="x264 $_nocodecmodules"
6606 _res_comment="in libavcodec: $_x264_lavc"
6607 echores "$_x264"
6610 echocheck "libnut"
6611 if test "$_libnut" = auto ; then
6612 cat > $TMPC << EOF
6613 #include <stdio.h>
6614 #include <stdlib.h>
6615 #include <inttypes.h>
6616 #include <libnut.h>
6617 int main(void) { (void)nut_error(0); return 0; }
6619 _libnut=no
6620 cc_check -lnut && _libnut=yes
6623 if test "$_libnut" = yes ; then
6624 _def_libnut='#define HAVE_LIBNUT 1'
6625 _ld_extra="$_ld_extra -lnut"
6626 else
6627 _def_libnut='#undef HAVE_LIBNUT'
6629 echores "$_libnut"
6631 #check must be done after libavcodec one
6632 echocheck "zr"
6633 if test "$_zr" = auto ; then
6634 #36067's seem to identify themselves as 36057PQC's, so the line
6635 #below should work for 36067's and 36057's.
6636 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6637 _zr=yes
6638 else
6639 _zr=no
6642 if test "$_zr" = yes ; then
6643 if test "$_libavcodec_a" = yes ; then
6644 _def_zr='#define HAVE_ZR 1'
6645 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6646 _vomodules="zr zr2 $_vomodules"
6647 else
6648 _res_comment="libavcodec (static) is required by zr, sorry"
6649 _novomodules="zr $_novomodules"
6650 _def_zr='#undef HAVE_ZR'
6652 else
6653 _def_zr='#undef HAVE_ZR'
6654 _novomodules="zr zr2 $_novomodules"
6656 echores "$_zr"
6658 # mencoder requires (optional) those libs: libmp3lame
6659 if test "$_mencoder" != no ; then
6661 echocheck "libmp3lame (for mencoder)"
6662 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6663 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6664 if test "$_mp3lame" = auto ; then
6665 _mp3lame=no
6666 cat > $TMPC <<EOF
6667 #include <lame/lame.h>
6668 int main(void) { lame_version_t lv; (void) lame_init();
6669 get_lame_version_numerical(&lv); printf("%d%d\n",lv.major,lv.minor);
6670 return 0; }
6672 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6674 if test "$_mp3lame" = yes ; then
6675 _def_mp3lame="#define HAVE_MP3LAME"
6676 _ld_mp3lame=-lmp3lame
6677 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6678 cat > $TMPC << EOF
6679 #include <lame/lame.h>
6680 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6682 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6683 cat > $TMPC << EOF
6684 #include <lame/lame.h>
6685 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6687 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6688 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
6689 if test "$_mp3lame_lavc" = yes ; then
6690 _def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
6691 _libavencoders="$_libavencoders LIBMP3LAME_ENCODER"
6692 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6694 else
6695 _mp3lame_lavc=no
6696 _def_mp3lame='#undef HAVE_MP3LAME'
6697 _def_mp3lame_lavc="#undef CONFIG_LIBMP3LAME"
6699 _res_comment="in libavcodec: $_mp3lame_lavc"
6700 echores "$_mp3lame"
6704 echocheck "mencoder"
6705 _mencoder_flag='#undef HAVE_MENCODER'
6706 if test "$_mencoder" = yes ; then
6707 _mencoder_flag='#define HAVE_MENCODER'
6708 _def_muxers='#define CONFIG_MUXERS 1'
6709 else
6710 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6711 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6712 _libavmuxers=""
6714 echores "$_mencoder"
6716 echocheck "fastmemcpy"
6717 # fastmemcpy check is done earlier with tests of CPU & binutils features
6718 if test "$_fastmemcpy" = yes ; then
6719 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6720 else
6721 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6723 echores "$_fastmemcpy"
6726 echocheck "UnRAR executable"
6727 if test "$_unrar_exec" = auto ; then
6728 _unrar_exec="yes"
6729 mingw32 && _unrar_exec="no"
6731 if test "$_unrar_exec" = yes ; then
6732 _def_unrar_exec='#define USE_UNRAR_EXEC 1'
6733 else
6734 _def_unrar_exec='#undef USE_UNRAR_EXEC'
6736 echores "$_unrar_exec"
6738 echocheck "TV interface"
6739 if test "$_tv" = yes ; then
6740 _def_tv='#define USE_TV 1'
6741 _inputmodules="tv $_inputmodules"
6742 else
6743 _noinputmodules="tv $_noinputmodules"
6744 _def_tv='#undef USE_TV'
6746 echores "$_tv"
6749 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
6750 echocheck "*BSD BT848 bt8xx header"
6751 _ioctl_bt848_h=no
6752 for file in "machine/ioctl_bt848.h" \
6753 "dev/bktr/ioctl_bt848.h" \
6754 "dev/video/bktr/ioctl_bt848.h" \
6755 "dev/ic/bt8xx.h" ; do
6756 cat > $TMPC <<EOF
6757 #include <sys/types.h>
6758 #include <sys/ioctl.h>
6759 #include <$file>
6760 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
6762 if cc_check ; then
6763 _ioctl_bt848_h=yes
6764 _ioctl_bt848_h_name="$file"
6765 break;
6767 done
6768 if test "$_ioctl_bt848_h" = yes ; then
6769 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6770 _res_comment="using $_ioctl_bt848_h_name"
6771 else
6772 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6774 echores "$_ioctl_bt848_h"
6776 echocheck "*BSD ioctl_meteor.h"
6777 _ioctl_meteor_h=no
6778 for file in "machine/ioctl_meteor.h" \
6779 "dev/bktr/ioctl_meteor.h" \
6780 "dev/video/bktr/ioctl_meteor.h" ; do
6781 cat > $TMPC <<EOF
6782 #include <sys/types.h>
6783 #include <$file>
6784 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
6786 if cc_check ; then
6787 _ioctl_meteor_h=yes
6788 _ioctl_meteor_h_name="$file"
6789 break;
6791 done
6792 if test "$_ioctl_meteor_h" = yes ; then
6793 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6794 _res_comment="using $_ioctl_meteor_h_name"
6795 else
6796 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6798 echores "$_ioctl_meteor_h"
6800 echocheck "*BSD BrookTree 848 TV interface"
6801 if test "$_tv_bsdbt848" = auto ; then
6802 _tv_bsdbt848=no
6803 if test "$_tv" = yes ; then
6804 cat > $TMPC <<EOF
6805 #include <sys/types.h>
6806 $_def_ioctl_meteor_h_name
6807 $_def_ioctl_bt848_h_name
6808 #ifdef IOCTL_METEOR_H_NAME
6809 #include IOCTL_METEOR_H_NAME
6810 #endif
6811 #ifdef IOCTL_BT848_H_NAME
6812 #include IOCTL_BT848_H_NAME
6813 #endif
6814 int main(void) {
6815 ioctl(0, METEORSINPUT, 0);
6816 ioctl(0, TVTUNER_GETFREQ, 0);
6817 return 0;
6820 cc_check && _tv_bsdbt848=yes
6823 if test "$_tv_bsdbt848" = yes ; then
6824 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6825 _inputmodules="tv-bsdbt848 $_inputmodules"
6826 else
6827 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6828 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6830 echores "$_tv_bsdbt848"
6831 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
6834 echocheck "DirectShow TV interface"
6835 if test "$_tv_dshow" = auto ; then
6836 _tv_dshow=no
6837 if test "$_tv" = yes && win32 ; then
6838 cat > $TMPC <<EOF
6839 #include <ole2.h>
6840 int main(void) {
6841 void* p;
6842 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6843 return 0;
6846 cc_check -lole32 -luuid && _tv_dshow=yes
6849 if test "$_tv_dshow" = yes ; then
6850 _inputmodules="tv-dshow $_inputmodules"
6851 _def_tv_dshow='#define HAVE_TV_DSHOW 1'
6852 _ld_extra="$_ld_extra -lole32 -luuid"
6853 else
6854 _noinputmodules="tv-dshow $_noinputmodules"
6855 _def_tv_dshow='#undef HAVE_TV_DSHOW'
6857 echores "$_tv_dshow"
6860 echocheck "Video 4 Linux TV interface"
6861 if test "$_tv_v4l1" = auto ; then
6862 _tv_v4l1=no
6863 if test "$_tv" = yes && linux ; then
6864 cat > $TMPC <<EOF
6865 #include <stdlib.h>
6866 #include <linux/videodev.h>
6867 int main(void) { return 0; }
6869 cc_check && _tv_v4l1=yes
6872 if test "$_tv_v4l1" = yes ; then
6873 _audio_input=yes
6874 _tv_v4l=yes
6875 _def_tv_v4l='#define HAVE_TV_V4L 1'
6876 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6877 _inputmodules="tv-v4l $_inputmodules"
6878 else
6879 _noinputmodules="tv-v4l1 $_noinputmodules"
6880 _def_tv_v4l='#undef HAVE_TV_V4L'
6882 echores "$_tv_v4l1"
6885 echocheck "Video 4 Linux 2 TV interface"
6886 if test "$_tv_v4l2" = auto ; then
6887 _tv_v4l2=no
6888 if test "$_tv" = yes && linux ; then
6889 cat > $TMPC <<EOF
6890 #include <stdlib.h>
6891 #include <linux/types.h>
6892 #include <linux/videodev2.h>
6893 int main(void) { return 0; }
6895 cc_check && _tv_v4l2=yes
6898 if test "$_tv_v4l2" = yes ; then
6899 _audio_input=yes
6900 _tv_v4l=yes
6901 _def_tv_v4l='#define HAVE_TV_V4L 1'
6902 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6903 _inputmodules="tv-v4l2 $_inputmodules"
6904 else
6905 _noinputmodules="tv-v4l2 $_noinputmodules"
6906 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6908 echores "$_tv_v4l2"
6911 echocheck "TV teletext interface"
6912 if test "$_tv_teletext" = auto ; then
6913 _tv_teletext=no
6914 if test "$_freetype" = yes && test "$_pthreads" = yes; then
6915 if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes; then
6916 _tv_teletext=yes
6920 if test "$_tv_teletext" = yes ; then
6921 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6922 _inputmodules="tv-teletext $_inputmodules"
6923 else
6924 _noinputmodules="tv-teletext $_noinputmodules"
6925 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6927 echores "$_tv_teletext"
6930 echocheck "Radio interface"
6931 if test "$_radio" = yes ; then
6932 _def_radio='#define USE_RADIO 1'
6933 _inputmodules="radio $_inputmodules"
6934 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6935 _radio_capture=no
6937 if test "$_radio_capture" = yes ; then
6938 _audio_input=yes
6939 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6940 else
6941 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6943 else
6944 _noinputmodules="radio $_noinputmodules"
6945 _def_radio='#undef USE_RADIO'
6946 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6947 _radio_capture=no
6949 echores "$_radio"
6950 echocheck "Capture for Radio interface"
6951 echores "$_radio_capture"
6953 echocheck "Video 4 Linux 2 Radio interface"
6954 if test "$_radio_v4l2" = auto ; then
6955 _radio_v4l2=no
6956 if test "$_radio" = yes && linux ; then
6957 cat > $TMPC <<EOF
6958 #include <stdlib.h>
6959 #include <linux/types.h>
6960 #include <linux/videodev2.h>
6961 int main(void) { return 0; }
6963 cc_check && _radio_v4l2=yes
6966 if test "$_radio_v4l2" = yes ; then
6967 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6968 else
6969 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6971 echores "$_radio_v4l2"
6973 echocheck "Video 4 Linux Radio interface"
6974 if test "$_radio_v4l" = auto ; then
6975 _radio_v4l=no
6976 if test "$_radio" = yes && linux ; then
6977 cat > $TMPC <<EOF
6978 #include <stdlib.h>
6979 #include <linux/videodev.h>
6980 int main(void) { return 0; }
6982 cc_check && _radio_v4l=yes
6985 if test "$_radio_v4l" = yes ; then
6986 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6987 else
6988 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6990 echores "$_radio_v4l"
6992 if freebsd || netbsd || openbsd || dragonfly || bsdos \
6993 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6994 echocheck "*BSD BrookTree 848 Radio interface"
6995 _radio_bsdbt848=no
6996 cat > $TMPC <<EOF
6997 #include <sys/types.h>
6998 $_def_ioctl_bt848_h_name
6999 #ifdef IOCTL_BT848_H_NAME
7000 #include IOCTL_BT848_H_NAME
7001 #endif
7002 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7004 cc_check && _radio_bsdbt848=yes
7005 echores "$_radio_bsdbt848"
7006 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7008 if test "$_radio_bsdbt848" = yes ; then
7009 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
7010 else
7011 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
7014 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7015 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7016 die "Radio driver requires BSD BT848, V4L or V4L2!"
7019 echocheck "Video 4 Linux 2 MPEG PVR interface"
7020 if test "$_pvr" = auto ; then
7021 _pvr=no
7022 if test "$_tv_v4l2" = yes && linux ; then
7023 cat > $TMPC <<EOF
7024 #include <stdlib.h>
7025 #include <inttypes.h>
7026 #include <linux/types.h>
7027 #include <linux/videodev2.h>
7028 int main(void) { struct v4l2_ext_controls ext; return 0; }
7030 cc_check && _pvr=yes
7033 if test "$_pvr" = yes ; then
7034 _def_pvr='#define HAVE_PVR 1'
7035 _inputmodules="pvr $_inputmodules"
7036 else
7037 _noinputmodules="pvr $_noinputmodules"
7038 _def_pvr='#undef HAVE_PVR'
7040 echores "$_pvr"
7043 echocheck "audio select()"
7044 if test "$_select" = no ; then
7045 _def_select='#undef HAVE_AUDIO_SELECT'
7046 elif test "$_select" = yes ; then
7047 _def_select='#define HAVE_AUDIO_SELECT 1'
7049 echores "$_select"
7052 echocheck "ftp"
7053 if ! beos && test "$_ftp" = yes ; then
7054 _def_ftp='#define HAVE_FTP 1'
7055 _inputmodules="ftp $_inputmodules"
7056 else
7057 _noinputmodules="ftp $_noinputmodules"
7058 _def_ftp='#undef HAVE_FTP'
7060 echores "$_ftp"
7062 echocheck "vstream client"
7063 if test "$_vstream" = auto ; then
7064 _vstream=no
7065 cat > $TMPC <<EOF
7066 #include <vstream-client.h>
7067 void vstream_error(const char *format, ... ) {}
7068 int main(void) { vstream_start(); return 0; }
7070 cc_check -lvstream-client && _vstream=yes
7072 if test "$_vstream" = yes ; then
7073 _def_vstream='#define HAVE_VSTREAM 1'
7074 _inputmodules="vstream $_inputmodules"
7075 _ld_extra="$_ld_extra -lvstream-client"
7076 else
7077 _noinputmodules="vstream $_noinputmodules"
7078 _def_vstream='#undef HAVE_VSTREAM'
7080 echores "$_vstream"
7082 # endian testing
7083 echocheck "byte order"
7084 if test "$_big_endian" = auto ; then
7085 cat > $TMPC <<EOF
7086 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7087 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7088 int main(void) { return (int)ascii_name; }
7090 if cc_check ; then
7091 if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
7092 _big_endian=yes
7093 else
7094 _big_endian=no
7096 else
7097 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7100 if test "$_big_endian" = yes ; then
7101 _byte_order='big-endian'
7102 _def_words_endian='#define WORDS_BIGENDIAN 1'
7103 else
7104 _byte_order='little-endian'
7105 _def_words_endian='#undef WORDS_BIGENDIAN'
7107 echores "$_byte_order"
7109 echocheck "OSD menu"
7110 if test "$_menu" = yes ; then
7111 _def_menu='#define HAVE_MENU 1'
7112 test $_dvbin = "yes" && _menu_dvbin=yes
7113 else
7114 _def_menu='#undef HAVE_MENU'
7115 _menu_dvbin=no
7117 echores "$_menu"
7120 echocheck "Subtitles sorting"
7121 if test "$_sortsub" = yes ; then
7122 _def_sortsub='#define USE_SORTSUB 1'
7123 else
7124 _def_sortsub='#undef USE_SORTSUB'
7126 echores "$_sortsub"
7129 echocheck "XMMS inputplugin support"
7130 if test "$_xmms" = yes ; then
7131 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7132 _xmmsplugindir=`xmms-config --input-plugin-dir`
7133 _xmmslibdir=`xmms-config --exec-prefix`/lib
7134 else
7135 _xmmsplugindir=/usr/lib/xmms/Input
7136 _xmmslibdir=/usr/lib
7139 _def_xmms='#define HAVE_XMMS 1'
7140 if darwin ; then
7141 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7142 else
7143 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7145 else
7146 _def_xmms='#undef HAVE_XMMS'
7148 echores "$_xmms"
7150 echocheck "inet6"
7151 if test "$_inet6" = auto ; then
7152 cat > $TMPC << EOF
7153 #include <sys/types.h>
7154 #if !defined(_WIN32) || defined(__CYGWIN__)
7155 #include <sys/socket.h>
7156 #include <netinet/in.h>
7157 #else
7158 #include <ws2tcpip.h>
7159 #endif
7160 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7162 _inet6=no
7163 if cc_check $_ld_sock ; then
7164 _inet6=yes
7167 if test "$_inet6" = yes ; then
7168 _def_inet6='#define HAVE_AF_INET6 1'
7169 else
7170 _def_inet6='#undef HAVE_AF_INET6'
7172 echores "$_inet6"
7175 echocheck "gethostbyname2"
7176 if test "$_gethostbyname2" = auto ; then
7177 cat > $TMPC << EOF
7178 #include <sys/types.h>
7179 #include <sys/socket.h>
7180 #include <netdb.h>
7181 int main(void) { gethostbyname2("", AF_INET); }
7183 _gethostbyname2=no
7184 if cc_check ; then
7185 _gethostbyname2=yes
7189 if test "$_gethostbyname2" = yes ; then
7190 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7191 else
7192 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7194 echores "$_gethostbyname2"
7197 # --------------- GUI specific tests begin -------------------
7198 echocheck "GUI"
7199 echo "$_gui"
7200 if test "$_gui" = yes ; then
7202 # Required libraries
7203 if test "$_libavcodec" != yes ||
7204 ! echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1 ; then
7205 die "The GUI requires libavcodec with PNG support (needs zlib)."
7207 test "$_freetype" = no && test "$_bitmap_font" = no && \
7208 die "The GUI requires either FreeType or bitmap font support."
7209 if ! win32 ; then
7210 _gui_gtk=yes
7211 test "$_x11" != yes && die "X11 support required for GUI compilation."
7213 echocheck "XShape extension"
7214 if test "$_xshape" = auto ; then
7215 _xshape=no
7216 cat > $TMPC << EOF
7217 #include <X11/Xlib.h>
7218 #include <X11/Xproto.h>
7219 #include <X11/Xutil.h>
7220 #include <X11/extensions/shape.h>
7221 #include <stdlib.h>
7222 int main(void) {
7223 char *name = ":0.0";
7224 Display *wsDisplay;
7225 int exitvar = 0;
7226 int eventbase, errorbase;
7227 if (getenv("DISPLAY"))
7228 name=getenv("DISPLAY");
7229 wsDisplay=XOpenDisplay(name);
7230 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7231 exitvar=1;
7232 XCloseDisplay(wsDisplay);
7233 return exitvar;
7236 cc_check -lXext && _xshape=yes
7238 if test "$_xshape" = yes ; then
7239 _def_xshape='#define HAVE_XSHAPE 1'
7240 else
7241 die "The GUI requires the X11 extension XShape (which was not found)."
7243 echores "$_xshape"
7245 #Check for GTK
7246 if test "$_gtk1" = no ; then
7247 #Check for GTK2 :
7248 echocheck "GTK+ version"
7250 if $_pkg_config gtk+-2.0 --exists ; then
7251 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7252 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7253 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7254 echores "$_gtk"
7256 # Check for GLIB2
7257 if $_pkg_config glib-2.0 --exists ; then
7258 echocheck "glib version"
7259 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7260 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7261 echores "$_glib"
7263 _def_gui='#define HAVE_NEW_GUI 1'
7264 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7265 else
7266 _gtk1=yes
7267 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7269 else
7270 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7271 _gtk1=yes
7275 if test "$_gtk1" = yes ; then
7276 # Check for old GTK (1.2.x)
7277 echocheck "GTK version"
7278 if test -z "$_gtkconfig" ; then
7279 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7280 _gtkconfig="gtk-config"
7281 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7282 _gtkconfig="gtk12-config"
7283 else
7284 die "The GUI requires GTK devel packages (which were not found)."
7287 _gtk=`$_gtkconfig --version 2>&1`
7288 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7289 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7290 echores "$_gtk (using $_gtkconfig)"
7292 # Check for GLIB
7293 echocheck "glib version"
7294 if test -z "$_glibconfig" ; then
7295 if ( glib-config --version ) >/dev/null 2>&1 ; then
7296 _glibconfig="glib-config"
7297 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7298 _glibconfig="glib12-config"
7299 else
7300 die "The GUI requires GLIB devel packages (which were not found)"
7303 _glib=`$_glibconfig --version 2>&1`
7304 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7305 echores "$_glib (using $_glibconfig)"
7307 _def_gui='#define HAVE_NEW_GUI 1'
7308 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7311 else #if ! win32
7312 _gui_win32=yes
7313 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7314 _def_gui='#define HAVE_NEW_GUI 1'
7315 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7316 fi #if ! win32
7318 else #if test "$_gui"
7319 _def_gui='#undef HAVE_NEW_GUI'
7320 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7321 fi #if test "$_gui"
7322 # --------------- GUI specific tests end -------------------
7325 if test "$_charset" = "noconv" ; then
7326 _charset=""
7328 if test "$_charset" ; then
7329 _def_charset="#define MSG_CHARSET \"$_charset\""
7330 else
7331 _def_charset="#undef MSG_CHARSET"
7334 if test "$_charset" != "UTF-8" ; then
7335 echocheck "iconv program"
7336 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7337 if test "$?" -ne 0 ; then
7338 echores "no"
7339 echo "No working iconv program found, use "
7340 echo "--charset=UTF-8 to continue anyway."
7341 echo "If you also have problems with iconv library functions use --charset=noconv."
7342 echo "Messages in the GTK-2 interface will be broken then."
7343 exit 1
7344 else
7345 echores "yes"
7349 #############################################################################
7351 echocheck "automatic gdb attach"
7352 if test "$_crash_debug" = yes ; then
7353 _def_crash_debug='#define CRASH_DEBUG 1'
7354 else
7355 _def_crash_debug='#undef CRASH_DEBUG'
7356 _crash_debug=no
7358 echores "$_crash_debug"
7360 echocheck "compiler support for noexecstack"
7361 cat > $TMPC <<EOF
7362 int main(void) { return 0; }
7364 if cc_check -Wl,-z,noexecstack ; then
7365 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7366 echores "yes"
7367 else
7368 echores "no"
7372 # Dynamic linking flags
7373 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7374 _ld_dl_dynamic=''
7375 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
7376 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 ; then
7377 _ld_dl_dynamic='-rdynamic'
7380 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7381 bsdos && _ld_extra="$_ld_extra -ldvd"
7382 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7383 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7385 _def_debug='#undef MP_DEBUG'
7386 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7389 echocheck "joystick"
7390 _def_joystick='#undef HAVE_JOYSTICK'
7391 if test "$_joystick" = yes ; then
7392 if linux ; then
7393 # TODO add some check
7394 _def_joystick='#define HAVE_JOYSTICK 1'
7395 else
7396 _joystick="no"
7397 _res_comment="unsupported under $system_name"
7400 echores "$_joystick"
7402 echocheck "lirc"
7403 if test "$_lirc" = auto ; then
7404 _lirc=no
7405 cat > $TMPC <<EOF
7406 #include <lirc/lirc_client.h>
7407 int main(void) { return 0; }
7409 cc_check -llirc_client && _lirc=yes
7411 if test "$_lirc" = yes ; then
7412 _def_lirc='#define HAVE_LIRC 1'
7413 _ld_extra="$_ld_extra -llirc_client"
7414 else
7415 _def_lirc='#undef HAVE_LIRC'
7417 echores "$_lirc"
7419 echocheck "lircc"
7420 if test "$_lircc" = auto ; then
7421 _lircc=no
7422 cat > $TMPC <<EOF
7423 #include <lirc/lircc.h>
7424 int main(void) { return 0; }
7426 cc_check -llircc && _lircc=yes
7428 if test "$_lircc" = yes ; then
7429 _def_lircc='#define HAVE_LIRCC 1'
7430 _ld_extra="$_ld_extra -llircc"
7431 else
7432 _def_lircc='#undef HAVE_LIRCC'
7434 echores "$_lircc"
7436 if arm; then
7437 # Detect maemo development platform libraries availability (http://www.maemo.org),
7438 # they are used when run on Nokia 770
7439 echocheck "maemo (Nokia 770)"
7440 if test "$_maemo" = auto ; then
7441 _maemo=no
7442 cat > $TMPC << EOF
7443 #include <libosso.h>
7444 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7446 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7448 if test "$_maemo" = yes ; then
7449 _def_maemo='#define HAVE_MAEMO 1'
7450 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7451 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7452 else
7453 _def_maemo='#undef HAVE_MAEMO'
7455 echores "$_maemo"
7458 # linker paths should be the same for mencoder and mplayer
7459 _ld_tmp=""
7460 for I in $_libs_mplayer ; do
7461 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7462 if test -z "$_tmp" ; then
7463 _ld_extra="$I $_ld_extra"
7464 else
7465 _ld_tmp="$_ld_tmp $I"
7467 done
7468 _libs_mplayer=$_ld_tmp
7471 #############################################################################
7472 if darwin ; then
7473 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
7474 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7475 CFLAGS="$CFLAGS -no-cpp-precomp"
7478 if amigaos ; then
7479 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__"
7481 if hpux ; then
7482 # use flag for HPUX missing setenv()
7483 CFLAGS="$CFLAGS -DHPUX"
7485 # Thread support
7486 if linux ; then
7487 CFLAGS="$CFLAGS -D_REENTRANT"
7488 elif freebsd || netbsd || openbsd || bsdos ; then
7489 # FIXME bsd needs this so maybe other OS'es
7490 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7492 if cygwin ; then
7493 CFLAGS="$CFLAGS -D__CYGWIN__"
7495 if os2 ; then
7496 CFLAGS="$CFLAGS -Zomf"
7497 ASFLAGS="$ASFLAGS -Zomf"
7499 # 64 bit file offsets?
7500 if test "$_largefiles" = yes || freebsd ; then
7501 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7502 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7503 # dvdread support requires this (for off64_t)
7504 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7505 cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
7506 beos && CFLAGS="$CFLAGS -DSYS_BEOS"
7507 os2 && CFLAGS="$CFLAGS -DSYS_OS2"
7511 # Make sure config.h gets included.
7512 if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then
7513 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
7516 CFLAGS="-I. $CFLAGS"
7517 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7519 cat > $TMPC << EOF
7520 int main(void) { return 0; }
7522 if test "$cc_vendor" = "gnu" ; then
7523 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7524 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7525 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7528 cc_check -mno-omit-leaf-frame-pointer && CFLAG_NO_OMIT_LEAF_FRAME_POINTER="-mno-omit-leaf-frame-pointer"
7530 #this must be the last test to be performed or the ones following it will likely fail
7531 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7532 # to use its own copy of the library)
7533 echocheck "DVD support (libdvdnav)"
7534 if test "$_dvdnav" = auto ; then
7535 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7537 if test "$_dvdnav" = auto ; then
7538 cat > $TMPC <<EOF
7539 #include <inttypes.h>
7540 #include <dvdnav/dvdnav.h>
7541 int main(void) { dvdnav_t *dvd=0; return 0; }
7543 _dvdnav=no
7544 _dvdnavdir=`$_dvdnavconfig --cflags`
7545 _dvdnavlibs=`$_dvdnavconfig --libs`
7546 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7548 if test "$_dvdnav" = yes ; then
7549 _largefiles=yes
7550 _def_dvdnav='#define USE_DVDNAV 1'
7551 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7552 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7553 _inputmodules="dvdnav $_inputmodules"
7554 else
7555 _def_dvdnav='#undef USE_DVDNAV'
7556 _noinputmodules="dvdnav $_noinputmodules"
7558 echores "$_dvdnav"
7560 #############################################################################
7561 echo "Creating config.mak"
7562 cat > config.mak << EOF
7563 # -------- Generated by configure -----------
7565 LANG = C
7566 MAN_LANG = $MAN_LANG
7567 MAN_LANG_ALL = $MAN_LANG_ALL
7568 TARGET_OS = $system_name
7569 DESTDIR =
7570 prefix = \$(DESTDIR)$_prefix
7571 BINDIR = \$(DESTDIR)$_bindir
7572 DATADIR = \$(DESTDIR)$_datadir
7573 MANDIR = \$(DESTDIR)$_mandir
7574 CONFDIR = \$(DESTDIR)$_confdir
7575 LIBDIR = \$(DESTDIR)$_libdir
7576 # FFmpeg uses libdir instead of LIBDIR
7577 libdir = \$(LIBDIR)
7578 AR = $_ar
7579 CC = $_cc
7580 CXX = $_cc
7581 HOST_CC = $_host_cc
7582 RANLIB = $_ranlib
7583 WINDRES = $_windres
7584 INSTALL = $_install
7585 EXTRA_INC = $_inc_extra
7586 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7587 CFLAGS = $CFLAGS \$(EXTRA_INC)
7588 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7589 CFLAG_NO_OMIT_LEAF_FRAME_POINTER = $CFLAG_NO_OMIT_LEAF_FRAME_POINTER
7590 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7591 CFLAG_STACKREALIGN = $_stackrealign
7592 ASFLAGS = $ASFLAGS
7593 INSTALLSTRIP = $_install_strip
7594 CHARSET = $_charset
7595 HELP_FILE = $_mp_help
7597 EXESUF = $_exesuf
7599 MPLAYER_NETWORK = $_network
7600 FTP = $_ftp
7601 STREAMING_LIVE555 = $_live
7602 LIBNEMESI = $_nemesi
7603 NATIVE_RTSP = $_native_rtsp
7604 VSTREAM = $_vstream
7605 STREAM_CACHE = $_stream_cache
7606 DVBIN = $_dvbin
7607 VIDIX = $_vidix
7608 VIDIX_INTERNAL = $_vidix_internal
7609 VIDIX_EXTERNAL = $_vidix_external
7610 VIDIX_PCIDB = $_vidix_pcidb_val
7611 CONFIG_POSTPROC = yes
7612 MP3LAME = $_mp3lame
7613 LIBMENU = $_menu
7614 LIBMENU_DVBIN = $_menu_dvbin
7616 MP3LIB = $_mp3lib
7617 LIBA52 = $_liba52
7618 LIBMPEG2 = $_libmpeg2
7619 TREMOR_INTERNAL = $_tremor_internal
7620 TREMOR_LOW = $_tremor_low
7621 FAAD = $_faad
7623 SPEEX = $_speex
7624 MUSEPACK = $_musepack
7626 UNRAR_EXEC = $_unrar_exec
7627 PNG = $_png
7628 JPEG = $_jpeg
7629 GIF = $_gif
7631 EXTRALIBS = $_extra_libs
7632 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7633 EXTRALIBS_MPLAYER = $_libs_mplayer
7634 EXTRALIBS_MENCODER = $_libs_mencoder
7636 HAVE_SYS_MMAN_H = $_mman
7637 HAVE_POSIX_SELECT = $_posix_select
7639 NEED_GETTIMEOFDAY = $_need_gettimeofday
7640 NEED_GLOB = $_need_glob
7641 NEED_MMAP = $_need_mmap
7642 NEED_SETENV = $_need_setenv
7643 NEED_SHMEM = $_need_shmem
7644 NEED_STRSEP = $_need_strsep
7645 NEED_SWAB = $_need_swab
7646 NEED_VSSCANF = $_need_vsscanf
7648 GETCH = $_getch
7649 TIMER = $_timer
7651 PE_EXECUTABLE = $_pe_executable
7653 # audio output
7654 OSS = $_ossaudio
7655 ALSA = $_alsa
7656 ALSA5 = $_alsa5
7657 ALSA9 = $_alsa9
7658 ALSA1X = $_alsa1x
7660 LADSPA = $_ladspa
7662 # input/demuxer/codecs
7663 JOYSTICK = $_joystick
7664 LIRC = $_lirc
7665 APPLE_REMOTE = $_apple_remote
7666 APPLE_IR = $_apple_ir
7667 TV = $_tv
7668 TV_V4L = $_tv_v4l
7669 TV_V4L1 = $_tv_v4l1
7670 TV_V4L2 = $_tv_v4l2
7671 TV_DSHOW = $_tv_dshow
7672 TV_BSDBT848 = $_tv_bsdbt848
7673 TV_TELETEXT = $_tv_teletext
7674 AUDIO_INPUT = $_audio_input
7675 PVR = $_pvr
7676 VCD = $_vcd
7677 DVDREAD = $_dvdread
7678 DVDREAD_INTERNAL = $_dvdread_internal
7679 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7680 LIBDVDCSS_DVDREAD_FLAGS = $_libdvdcss_dvdread_flags
7681 DVDNAV = $_dvdnav
7682 WIN32DLL = $_win32dll
7683 WIN32_EMULATION = $_win32_emulation
7684 QTX_CODECS = $_qtx
7685 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7686 QTX_EMULATION = $_qtx_emulation
7687 REAL_CODECS = $_real
7688 XANIM_CODECS = $_xanim
7689 ZORAN = $_zr
7690 LIBLZO = $_liblzo
7691 LIBDV = $_libdv
7692 XVID4 = $_xvid
7693 X264 = $_x264
7694 LIBNUT = $_libnut
7695 LIBDCA = $_libdca
7696 MPLAYER = $_mplayer
7697 MENCODER = $_mencoder
7698 CDDA = $_cdda
7699 CDDB = $_cddb
7700 BITMAP_FONT = $_bitmap_font
7701 FREETYPE = $_freetype
7702 LIBASS = $_ass
7703 LIBMAD = $_mad
7704 LIBVORBIS = $_vorbis
7705 LIBTHEORA = $_theora
7706 FAAD_INTERNAL = $_faad_internal
7707 LIBSMBCLIENT = $_smbsupport
7708 XMMS_PLUGINS = $_xmms
7709 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7710 MACOSX_BUNDLE = $_macosx_bundle
7711 COREAUDIO = $_coreaudio
7712 COREVIDEO = $_corevideo
7713 QUARTZ = $_quartz
7714 TOOLAME=$_toolame
7715 TWOLAME=$_twolame
7716 FAAC=$_faac
7717 RADIO=$_radio
7718 RADIO_CAPTURE=$_radio_capture
7719 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7720 VIDIX_IVTV=$_vidix_drv_ivtv
7721 VIDIX_MACH64=$_vidix_drv_mach64
7722 VIDIX_MGA=$_vidix_drv_mga
7723 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7724 VIDIX_NVIDIA=$_vidix_drv_nvidia
7725 VIDIX_PM2=$_vidix_drv_pm2
7726 VIDIX_PM3=$_vidix_drv_pm3
7727 VIDIX_RADEON=$_vidix_drv_radeon
7728 VIDIX_RAGE128=$_vidix_drv_rage128
7729 VIDIX_S3=$_vidix_drv_s3
7730 VIDIX_SIS=$_vidix_drv_sis
7731 VIDIX_UNICHROME=$_vidix_drv_unichrome
7733 # --- Some stuff for autoconfigure ----
7734 $_target_arch
7735 $_target_arch_x86
7736 TARGET_CPU=$iproc
7737 `echo $_cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/'`
7739 # --- GUI stuff ---
7740 GUI = $_gui
7741 GUI_GTK = $_gui_gtk
7742 GUI_WIN32 = $_gui_win32
7744 # --- libvo stuff ---
7745 VO_SRCS = $_vosrc
7747 # --- libao2 stuff ---
7748 AO_SRCS = $_aosrc
7750 # FFmpeg
7751 LIBAVUTIL = $_libavutil
7752 LIBAVUTIL_A = $_libavutil_a
7753 LIBAVUTIL_SO = $_libavutil_so
7754 LIBAVCODEC = $_libavcodec
7755 LIBAVCODEC_A = $_libavcodec_a
7756 LIBAVCODEC_SO = $_libavcodec_so
7757 LIBAVFORMAT = $_libavformat
7758 LIBAVFORMAT_A = $_libavformat_a
7759 LIBAVFORMAT_SO = $_libavformat_so
7760 LIBPOSTPROC = $_libpostproc
7761 LIBPOSTPROC_A = $_libpostproc_a
7762 LIBPOSTPROC_SO = $_libpostproc_so
7764 BUILD_STATIC=yes
7765 SRC_PATH=..
7766 BUILD_ROOT=..
7767 LIBPREF=lib
7768 LIBSUF=.a
7769 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7771 CONFIG_ENCODERS=yes
7772 CONFIG_GPL=yes
7773 CONFIG_MUXERS=$_mencoder
7774 CONFIG_LIBAMR=$_libamr
7775 CONFIG_LIBAMR_NB=$_libamr_nb
7776 CONFIG_LIBAMR_WB=$_libamr_wb
7777 CONFIG_LIBFAAC=$_faac_lavc
7778 CONFIG_LIBMP3LAME=$_mp3lame_lavc
7779 CONFIG_LIBVORBIS=$_libvorbis
7780 CONFIG_LIBX264=$_x264_lavc
7781 CONFIG_LIBXVID=$_xvid_lavc
7782 CONFIG_MLIB = $_mlib
7783 # Prevent building libavcodec/imgresample.c with conflicting symbols
7784 CONFIG_SWSCALE=yes
7785 CONFIG_ZLIB=$_zlib
7787 HAVE_PTHREADS = $_pthreads
7788 HAVE_W32THREADS = $_w32threads
7789 HAVE_XVMC = $_xvmc
7791 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7792 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7793 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7794 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7795 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7796 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7798 DEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,\$^) | sed "s,[0-9a-z._-]*: \(\$(SRC_DIR)/\)*\([a-z0-9]*/\)[^/]* ,\\2&,"
7800 MPDEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,$^) | sed "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&,"
7801 MPDEPEND_CMD_CXX = \$(CC) -MM \$(CXXFLAGS) \$(filter-out %.h,$^) | sed "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&,"
7805 #############################################################################
7807 ff_config_enable () {
7808 _nprefix=$3;
7809 test -z "$_nprefix" && _nprefix='CONFIG'
7810 for part in $1; do
7811 if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
7812 echo "#define ${_nprefix}_$part 1"
7813 echo "#define ENABLE_$part 1"
7814 else
7815 echo "#define ENABLE_$part 0"
7817 done
7820 echo "Creating config.h"
7821 cat > $TMPH << EOF
7822 /* -------- This file has been automatically generated by configure ---------
7823 Note: Any changes in it will be lost when you run configure again. */
7825 /* Protect against multiple inclusion */
7826 #ifndef MPLAYER_CONFIG_H
7827 #define MPLAYER_CONFIG_H
7829 #define CONFIGURATION "$_configuration"
7831 /* make sure we never get lavformat's poll() emulation, the results are
7832 horrible if the X libs try to actually use it, see MPlayer-users
7833 Message-ID: <45D49541.8060101@infernix.net>
7834 Date: Thu, 15 Feb 2007 18:15:45 +0100
7835 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7837 #define HAVE_SYS_POLL_H 1
7839 /* yes, we have inttypes.h */
7840 #define HAVE_INTTYPES_H 1
7842 /* int_fastXY_t emulation */
7843 $_def_fast_inttypes
7845 /* libdvdcss */
7846 #define HAVE_ERRNO_H 1
7848 /* libdvdcss + libdvdread */
7849 #define HAVE_LIMITS_H 1
7851 /* libdvdcss + libfaad2 */
7852 #define HAVE_UNISTD_H 1
7854 /* libfaad2 + libdvdread */
7855 #define STDC_HEADERS 1
7857 /* libfaad2 */
7858 #define HAVE_MEMCPY 1
7859 #define HAVE_STRCHR 1
7861 /* libdvdread */
7862 #define HAVE_UINTPTR_T 1
7864 /* name of messages charset */
7865 $_def_charset
7867 /* Runtime CPU detection */
7868 $_def_runtime_cpudetection
7870 /* Dynamic a/v plugins */
7871 $_def_dynamic_plugins
7873 /* "restrict" keyword */
7874 $_def_restrict_keyword
7876 /* __builtin_expect branch prediction hint */
7877 $_def_builtin_expect
7878 #ifdef HAVE_BUILTIN_EXPECT
7879 #define likely(x) __builtin_expect ((x) != 0, 1)
7880 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7881 #else
7882 #define likely(x) (x)
7883 #define unlikely(x) (x)
7884 #endif
7886 /* attribute(used) as needed by some compilers */
7887 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7888 # define attribute_used __attribute__((used))
7889 #else
7890 # define attribute_used
7891 #endif
7893 /* extern symbol prefix */
7894 $_def_extern_prefix
7896 /* compiler support for named assembler arguments */
7897 $_def_named_asm_args
7899 /* enable/disable SIGHANDLER */
7900 $_def_sighandler
7902 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7903 $_def_crash_debug
7905 /* Toggles debugging informations */
7906 $_def_debug
7908 /* Indicates that libcdio is available for VCD and CD-DA playback */
7909 $_def_libcdio
7911 /* Indicates that Ogle's libdvdread is available for DVD playback */
7912 $_def_dvdread
7914 /* Indicates that dvdread is internal */
7915 $_def_dvdread_internal
7917 /* Additional options for libdvdread/libdvdcss */
7918 $_def_dvd
7919 $_def_cdrom
7920 $_def_cdio
7921 $_def_dvdio
7922 $_def_bsdi_dvd
7923 $_def_dvd_bsd
7924 $_def_dvd_linux
7925 $_dev_dvd_openbsd
7926 $_def_dvd_darwin
7927 $_def_sol_scsi_h
7928 $_def_hpux_scsi_h
7930 /* Common data directory (for fonts, etc) */
7931 #define MPLAYER_DATADIR "$_datadir"
7932 #define MPLAYER_CONFDIR "$_confdir"
7933 #define MPLAYER_LIBDIR "$_libdir"
7935 /* Define this to compile stream-caching support, it can be enabled via
7936 -cache <kilobytes> */
7937 $_def_stream_cache
7939 /* Define if you are using XviD library */
7940 $_def_xvid
7942 /* Define if you are using the X.264 library */
7943 $_def_x264
7945 /* Define if you are using libnut */
7946 $_def_libnut
7948 /* Define to include support for libdv-0.9.5 */
7949 $_def_libdv
7951 /* If build mencoder */
7952 $_mencoder_flag
7954 /* Indicates if libmp3lame is available
7955 Note: for mencoder */
7956 $_def_mp3lame
7957 $_def_mp3lame_preset
7958 $_def_mp3lame_preset_medium
7960 /* Undefine this if you do not want to select mono audio (left or right)
7961 with a stereo MPEG layer 2/3 audio stream. The command line option
7962 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7963 right-only), with 0 being the default.
7965 #define USE_FAKE_MONO 1
7967 /* Undefine this if your sound card driver has no working select().
7968 If you have kernel Oops, player hangups, or just no audio, you should
7969 try to recompile MPlayer with this option disabled! */
7970 $_def_select
7972 /* define this to use iconv(3) function to codepage conversions */
7973 $_def_iconv
7975 /* define this to use nl_langinfo function */
7976 $_def_langinfo
7978 /* define this to use RTC (/dev/rtc) for video timers */
7979 $_def_rtc
7981 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7982 #define MAX_OUTBURST 65536
7984 /* set up audio OUTBURST. Do not change this! */
7985 #define OUTBURST 512
7987 /* Define this if your system has the header file for the OSS sound interface */
7988 $_def_sys_soundcard
7990 /* Define this if your system has the header file for the OSS sound interface
7991 * in /usr/include */
7992 $_def_soundcard
7994 /* Define this if your system has the sysinfo header */
7995 $_def_sys_sysinfo
7997 /* Define this if your system has the "malloc.h" header file */
7998 $_def_malloc
8000 /* memalign is mapped to malloc if unsupported */
8001 $_def_memalign
8002 $_def_map_memalign
8003 $_def_memalign_hack
8005 /* assembler handling of .align */
8006 $_def_asmalign_pot
8008 /* Define this if your system has the "alloca.h" header file */
8009 $_def_alloca
8011 /* Define this if your system has the "byteswap.h" header file */
8012 $_def_byteswap_h
8014 /* Define this if your system has the "sys/mman.h" header file */
8015 $_def_mman
8016 $_def_mman_has_map_failed
8018 /* Define this if you have the elf dynamic linker -ldl library */
8019 $_def_dl
8021 /* Define this if you have the kstat kernel statistics library */
8022 $_def_kstat
8024 /* Define this if you have zlib */
8025 $_def_zlib
8026 #ifdef HAVE_ZLIB
8027 #define CONFIG_ZLIB 1
8028 #endif
8030 /* Define this if you have shm support */
8031 $_def_shm
8033 /* Define this if your system has strsep */
8034 $_def_strsep
8036 /* Define this if your system has vsscanf */
8037 $_def_vsscanf
8039 /* Define this if your system has swab */
8040 $_def_swab
8042 /* Define this if your system has posix select */
8043 $_def_posix_select
8045 /* Define this if your system has gettimeofday */
8046 $_def_gettimeofday
8048 /* Define this if your system has glob */
8049 $_def_glob
8051 /* Define this if your system has setenv */
8052 $_def_setenv
8053 #ifndef HAVE_SETENV
8054 int setenv(const char *name, const char *val, int overwrite);
8055 #endif
8057 /* Define this if your system has sysi86 */
8058 $_def_sysi86
8059 $_def_sysi86_iv
8061 /* Define this if your system has pthreads */
8062 $_def_pthreads
8064 /* Define this if you enabled thread support for libavcodec */
8065 $_def_threads
8066 #ifdef HAVE_THREADS
8067 #define ENABLE_THREADS 1
8068 #else
8069 #define ENABLE_THREADS 0
8070 #endif
8072 /* LIRC (remote control, see www.lirc.org) support: */
8073 $_def_lirc
8075 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8076 $_def_apple_remote
8078 /* Apple IR Remote (Linux remote control driver) */
8079 $_def_apple_ir
8081 /* Support for maemo (http://www.maemo.org) */
8082 $_def_maemo
8085 * LIRCCD (LIRC client daemon)
8086 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8088 $_def_lircc
8090 /* DVD navigation support using libdvdnav */
8091 $_def_dvdnav
8093 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8094 #define MPEG12_POSTPROC 1
8096 /* maximum alignment used by libmpeg2 */
8097 #define ATTRIBUTE_ALIGNED_MAX 16
8099 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8100 $_def_libpostproc
8101 $_def_libpostproc_a
8102 $_def_libpostproc_so
8104 /* Win32 DLL support */
8105 $_def_win32dll
8106 #define WIN32_PATH "$_win32codecsdir"
8108 /* Mac OS X specific features */
8109 $_def_macosx_finder_support
8110 $_def_macosx_bundle
8111 $_def_coreaudio
8112 $_def_corevideo
8113 $_def_quartz
8114 $_def_quicktime
8116 /* Build our Win32-loader */
8117 $_def_win32_loader
8119 /* ffmpeg's libavcodec support (requires libavcodec source) */
8120 $_def_libavcodec
8121 $_def_libavcodec_a
8122 $_def_libavcodec_so
8123 $_def_libavcodec_mpegaudio_hp
8125 /* ffmpeg's libavformat support (requires libavformat source) */
8126 $_def_libavformat
8127 $_def_libavformat_a
8128 $_def_libavformat_so
8130 $_def_libavutil
8131 $_def_libavutil_a
8132 $_def_libavutil_so
8134 /* Use libavcodec's decoders */
8135 #define CONFIG_DECODERS 1
8136 #define ENABLE_DECODERS 1
8137 /* Use libavcodec's encoders */
8138 #define CONFIG_ENCODERS 1
8139 #define ENABLE_ENCODERS 1
8141 /* Use libavformat's demuxers */
8142 #define CONFIG_DEMUXERS 1
8143 #define ENABLE_DEMUXERS 1
8144 /* Use libavformat's muxers */
8145 $_def_muxers
8147 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8148 #define HAVE_EBX_AVAILABLE 1
8149 #ifndef MP_DEBUG
8150 #define HAVE_EBP_AVAILABLE 1
8151 #endif
8153 #define HAVE_SOCKLEN_T 1
8155 #define CONFIG_GPL 1
8156 #define ENABLE_SMALL 0
8157 #define ENABLE_GRAY 0
8159 /* Use AMR codecs from libavcodec. */
8160 $_def_libamr
8161 $_def_libamr_nb
8162 $_def_libamr_wb
8164 /* Use specific parts from FFmpeg. */
8165 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8166 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8167 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8168 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8169 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8170 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8171 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8173 $_def_faac_lavc
8174 $_def_mp3lame_lavc
8175 $_def_x264_lavc
8176 $_def_xvid_lavc
8178 /* Use codec libs included in mplayer CVS / source dist: */
8179 $_def_mp3lib
8180 $_def_liba52
8181 $_def_libmpeg2
8183 /* XAnim DLL support */
8184 $_def_xanim
8185 /* Default search path */
8186 $_def_xanim_path
8188 /* RealPlayer DLL support */
8189 $_def_real
8190 /* Default search path */
8191 $_def_real_path
8193 /* LIVE555 Streaming Media library support */
8194 $_def_live
8196 /* libnemesi Streaming Media library support */
8197 $_def_nemesi
8199 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8200 $_def_fastmemcpy
8202 /* Use UnRAR executable for Vobsubs */
8203 $_def_unrar_exec
8205 /* gui support, please do not edit this option */
8206 $_def_gui
8207 $_def_gtk2_gui
8209 /* Audio output drivers */
8210 $_def_ossaudio
8211 $_def_ossaudio_devdsp
8212 $_def_ossaudio_devmixer
8213 $_def_alsa5
8214 $_def_alsa9
8215 $_def_alsa1x
8216 $_def_arts
8217 $_def_esd
8218 $_def_esd_latency
8219 $_def_pulse
8220 $_def_jack
8221 $_def_openal
8222 $_def_openal_h
8223 $_def_sys_asoundlib_h
8224 $_def_alsa_asoundlib_h
8225 $_def_sunaudio
8226 $_def_sgiaudio
8227 $_def_win32waveout
8228 $_def_nas
8230 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8231 #undef FAST_OSD
8232 #undef FAST_OSD_TABLE
8234 /* Enable TV Interface support */
8235 $_def_tv
8237 /* Enable Video 4 Linux TV interface support */
8238 $_def_tv_v4l
8240 /* Enable Video 4 Linux 1 TV interface support */
8241 $_def_tv_v4l1
8243 /* Enable Video 4 Linux 2 TV interface support */
8244 $_def_tv_v4l2
8246 /* Enable DirectShow TV interface support */
8247 $_def_tv_dshow
8249 /* *BSD BrookTree headers */
8250 $_def_ioctl_meteor_h_name
8251 $_def_ioctl_bt848_h_name
8253 /* Enable *BSD BrookTree TV interface support */
8254 $_def_tv_bsdbt848
8256 /* Enable TV Teletext Interface support */
8257 $_def_tv_teletext
8259 /* Enable Radio Interface support */
8260 $_def_radio
8262 /* Enable Capture for Radio Interface support */
8263 $_def_radio_capture
8265 /* Enable Video 4 Linux Radio interface support */
8266 $_def_radio_v4l
8268 /* Enable Video 4 Linux 2 Radio interface support */
8269 $_def_radio_v4l2
8271 /* Enable *BSD BrookTree Radio interface support */
8272 $_def_radio_bsdbt848
8274 /* Enable Video 4 Linux 2 MPEG PVR support */
8275 $_def_pvr
8277 /* Define if your processor stores words with the most significant
8278 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8279 $_def_words_endian
8281 /* Define if your processor can access unaligned data in a fast way */
8282 $_def_fast_unaligned
8284 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8286 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8287 have the instruction. */
8288 $_def_dcbzl
8290 /* Define this for Cygwin build for win32 */
8291 $_def_confwin32
8293 /* Define this to any prefered value from 386 up to infinity with step 100 */
8294 #define __CPU__ $iproc
8296 $_mp_wordsize
8298 $_def_vcd
8300 #ifdef sun
8301 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8302 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8303 #elif defined(WIN32) || defined(__OS2__)
8304 #define DEFAULT_CDROM_DEVICE "D:"
8305 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8306 #elif defined(__APPLE__) || defined(__DARWIN__)
8307 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8308 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8309 #elif defined(__OpenBSD__)
8310 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8311 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8312 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8313 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8314 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8315 #elif defined(__DragonFly__)
8316 #define DEFAULT_CDROM_DEVICE "/dev/cd0"
8317 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8318 #elif defined(__AMIGAOS4__)
8319 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8320 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8321 #else
8322 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8323 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8324 #endif
8327 /*----------------------------------------------------------------------------
8329 ** NOTE: Instead of modifying these definitions here, use the
8330 ** --enable/--disable options of the ./configure script!
8331 ** See ./configure --help for details.
8333 *---------------------------------------------------------------------------*/
8335 /* C99 *lrint* and round* functions available */
8336 $_def_llrint
8337 $_def_lrint
8338 $_def_lrintf
8339 $_def_round
8340 $_def_roundf
8342 /* mkstemp support */
8343 $_def_mkstemp
8345 /* nanosleep support */
8346 $_def_nanosleep
8348 /* SMB support */
8349 $_def_smbsupport
8351 /* termcap flag for getch2.c */
8352 $_def_termcap
8354 /* termios flag for getch2.c */
8355 $_def_termios
8356 $_def_termios_h
8357 $_def_termios_sys_h
8359 /* enable PNG support */
8360 $_def_png
8362 /* enable JPEG support */
8363 $_def_jpeg
8365 /* enable PNM support */
8366 $_def_pnm
8368 /* enable md5sum support */
8369 $_def_md5sum
8371 /* enable GIF support */
8372 $_def_gif
8373 $_def_gif_4
8374 $_def_gif_tvt_hack
8376 /* enable bitmap font support */
8377 $_def_bitmap_font
8379 /* enable FreeType support */
8380 $_def_freetype
8382 /* enable Fontconfig support */
8383 $_def_fontconfig
8385 /* enable SSA/ASS support */
8386 $_def_ass
8388 /* enable FriBiDi usage */
8389 $_def_fribidi
8391 /* enable ENCA usage */
8392 $_def_enca
8394 /* liblzo support */
8395 $_def_liblzo
8396 #ifdef USE_LIBLZO
8397 #define CONFIG_LZO 1
8398 #endif
8400 /* libmad support */
8401 $_def_mad
8403 /* enable OggVorbis support */
8404 $_def_vorbis
8405 $_def_tremor
8407 /* enable Speex support */
8408 $_def_speex
8410 /* enable musepack support */
8411 $_def_musepack
8413 /* enable OggTheora support */
8414 $_def_theora
8416 /* enable FAAD (AAC) support */
8417 $_def_faad
8418 $_def_faad_internal
8420 /* enable FAAC (AAC encoder) support */
8421 $_def_faac
8423 /* enable libdca support */
8424 $_def_libdca
8426 /* enable LADSPA plugin support */
8427 $_def_ladspa
8429 /* enable network */
8430 $_def_network
8432 /* enable ftp support */
8433 $_def_ftp
8435 /* enable vstream support */
8436 $_def_vstream
8438 /* enable winsock2 instead of Unix functions*/
8439 $_def_winsock2
8441 /* define this to use inet_aton() instead of inet_pton() */
8442 $_def_use_aton
8444 /* enables / disables cdparanoia support */
8445 $_def_cdparanoia
8446 $_def_cddb
8448 /* enables / disables VIDIX usage */
8449 $_def_vidix
8450 $_def_vidix_drv_cyberblade
8451 $_def_vidix_drv_ivtv
8452 $_def_vidix_drv_mach64
8453 $_def_vidix_drv_mga
8454 $_def_vidix_drv_mga_crtc2
8455 $_def_vidix_drv_nvidia
8456 $_def_vidix_drv_pm3
8457 $_def_vidix_drv_radeon
8458 $_def_vidix_drv_rage128
8459 $_def_vidix_drv_s3
8460 $_def_vidix_drv_sis
8461 $_def_vidix_drv_unichrome
8462 $_def_vidix_pfx
8464 /* enables / disables new input joystick support */
8465 $_def_joystick
8467 /* enables / disables QTX codecs */
8468 $_def_qtx
8469 $_def_qtx_win32
8471 /* enables / disables osd menu */
8472 $_def_menu
8474 /* enables / disables subtitles sorting */
8475 $_def_sortsub
8477 /* XMMS input plugin support */
8478 $_def_xmms
8479 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8481 /* enables inet6 support */
8482 $_def_inet6
8484 /* do we have gethostbyname2? */
8485 $_def_gethostbyname2
8487 /* Extension defines */
8488 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8490 $_def_altivec_h // enables usage of altivec.h
8492 /* libvo options */
8493 #define SCREEN_SIZE_X 1
8494 #define SCREEN_SIZE_Y 1
8495 $_def_x11
8496 $_def_xv
8497 $_def_xvmc
8498 $_def_vm
8499 $_def_xf86keysym
8500 $_def_xinerama
8501 $_def_gl
8502 $_def_gl_win32
8503 $_def_dga
8504 $_def_dga1
8505 $_def_dga2
8506 $_def_sdl
8507 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8508 $_def_sdlbuggy
8509 $_def_directx
8510 $_def_ggi
8511 $_def_ggiwmh
8512 $_def_3dfx
8513 $_def_s3fb
8514 $_def_tdfxfb
8515 $_def_tdfxvid
8516 $_def_xvr100
8517 $_def_directfb
8518 $_def_directfb_version
8519 $_def_dfbmga
8520 $_def_zr
8521 $_def_bl
8522 $_def_mga
8523 $_def_xmga
8524 $_def_fbdev
8525 $_def_dxr2
8526 $_def_dxr3
8527 $_def_ivtv
8528 $_def_v4l2
8529 $_def_dvb
8530 $_def_dvb_in
8531 $_def_svga
8532 $_def_vesa
8533 $_def_xss
8534 $_def_xdpms
8535 $_def_aa
8536 $_def_caca
8537 $_def_tga
8538 $_def_toolame
8539 $_def_twolame
8541 /* used by GUI: */
8542 $_def_xshape
8544 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8545 #define X11_FULLSCREEN 1
8546 #endif
8548 #endif /* MPLAYER_CONFIG_H */
8551 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8552 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8554 #############################################################################
8556 cat << EOF
8558 Config files successfully generated by ./configure $_configuration !
8560 Install prefix: $_prefix
8561 Data directory: $_datadir
8562 Config direct.: $_confdir
8564 Byte order: $_byte_order
8565 Optimizing for: $_optimizing
8567 Languages:
8568 Messages/GUI: $_language
8571 echo ${_echo_n} " Manual pages: $MAN_LANG_ALL ${_echo_c}"
8572 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8573 echo
8575 cat << EOF
8577 Enabled optional drivers:
8578 Input: $_inputmodules
8579 Codecs: $_codecmodules
8580 Audio output: $_aomodules
8581 Video output: $_vomodules
8582 Disabled optional drivers:
8583 Input: $_noinputmodules
8584 Codecs: $_nocodecmodules
8585 Audio output: $_noaomodules
8586 Video output: $_novomodules
8588 'config.h' and 'config.mak' contain your configuration options.
8589 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8590 compile *** DO NOT REPORT BUGS if you tweak these files ***
8592 'make' will now compile MPlayer and 'make install' will install it.
8593 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8598 if test "$_mtrr" = yes ; then
8599 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8600 echo
8603 if ! x86_32; then
8604 cat <<EOF
8605 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8606 operating system ($system_name). You may encounter a few files that cannot
8607 be played due to missing open source video/audio codec support.
8613 cat <<EOF
8614 Check $TMPLOG if you wonder why an autodetection failed (make sure
8615 development headers/packages are installed).
8617 NOTE: The --enable-* parameters unconditionally force options on, completely
8618 skipping autodetection. This behavior is unlike what you may be used to from
8619 autoconf-based configure scripts that can decide to override you. This greater
8620 level of control comes at a price. You may have to provide the correct compiler
8621 and linker flags yourself.
8622 If you used one of these options (except --enable-gui and similar ones that
8623 turn on internal features) and experience a compilation or linking failure,
8624 make sure you have passed the necessary compiler/linker flags to configure.
8626 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8630 if test "$_warn_CFLAGS" = yes; then
8631 cat <<EOF
8633 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8635 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8637 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8638 To do so, execute 'CFLAGS= ./configure <options>'
8643 # Last move:
8644 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"