typo fix
[mplayer/greg.git] / configure
blob23778891f083858af4b06213f8fc7b03b2435e8e
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: check the cvs log !
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, here is a simple skeleton:
24 # echocheck "$feature"
25 # if "$_feature" = auto; then
26 # cat > $TMPC << EOF
27 # #include <feature.h>
28 # int main(void) { return 0; }
29 # EOF
30 # _feature=no
31 # cc_check && _feature=yes
32 # if test "$_feature" = yes ; then
33 # _def_feature='#define HAVE_FEATURE 1'
34 # else
35 # _def_feature='#undef HAVE_FEATURE'
36 # fi
37 # echores "$_feature"
39 # Furthermore you need to add the variable _feature to the list of default
40 # settings and set it to one of yes/no/auto. Also add appropriate
41 # --enable-feature/--disable-feature command line options.
42 # The results of the check should be written to config.h and config.mak
43 # at the end of this script. The variable names used for this should be
44 # uniform, i.e. if the option is named 'feature':
46 # _feature : should have a value of yes/no/auto
47 # _def_feature : '#define ... 1' or '#undef ...' for conditional compilation
48 # _ld_feature : '-L/path/dir -lfeature' GCC options
50 #############################################################################
52 # Prevent locale nonsense from breaking basic text processing utils
53 LC_ALL=C
54 export LC_ALL
56 # Store the configure line that was used
57 _configuration="$*"
59 # Prefer these macros to full length text !
60 # These macros only return an error code - NO display is done
61 compile_check() {
62 echo >> "$TMPLOG"
63 cat "$1" >> "$TMPLOG"
64 echo >> "$TMPLOG"
65 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
66 rm -f "$TMPEXE"
67 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
68 TMP="$?"
69 echo >> "$TMPLOG"
70 echo >> "$TMPLOG"
71 return "$TMP"
74 cc_check() {
75 compile_check $TMPC $@
78 cxx_check() {
79 compile_check $TMPCPP $@ -lstdc++
82 tmp_run() {
83 "$TMPEXE" >> "$TMPLOG" 2>&1
86 # Display error message, flushes tempfile, exit
87 die () {
88 echo
89 echo "Error: $@" >&2
90 echo >&2
91 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
92 echo "Check \"$TMPLOG\" if you do not understand why it failed."
93 exit 1
96 # OS test booleans functions
97 issystem() {
98 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
100 linux() { issystem "Linux" || issystem "uClinux" ; return "$?" ; }
101 sunos() { issystem "SunOS" ; return "$?" ; }
102 hpux() { issystem "HP-UX" ; return "$?" ; }
103 irix() { issystem "IRIX" ; return "$?" ; }
104 aix() { issystem "AIX" ; return "$?" ; }
105 cygwin() { issystem "CYGWIN" ; return "$?" ; }
106 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; }
107 netbsd() { issystem "NetBSD" ; return "$?" ; }
108 bsdos() { issystem "BSD/OS" ; return "$?" ; }
109 openbsd() { issystem "OpenBSD" ; return "$?" ; }
110 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
111 qnx() { issystem "QNX" ; return "$?" ; }
112 darwin() { issystem "Darwin" ; return "$?" ; }
113 gnu() { issystem "GNU" ; return "$?" ; }
114 mingw32() { issystem "MINGW32" ; return "$?" ; }
115 morphos() { issystem "MorphOS" ; return "$?" ; }
116 amigaos() { issystem "AmigaOS" ; return "$?" ; }
117 win32() { cygwin || mingw32 ; return "$?" ; }
118 beos() { issystem "BEOS" ; return "$?" ; }
120 # arch test boolean functions
121 # x86/x86pc is used by QNX
122 x86_32() {
123 case "$host_arch" in
124 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
125 *) return 1 ;;
126 esac
129 x86_64() {
130 case "$host_arch" in
131 x86_64|amd64) return 0 ;;
132 *) return 1 ;;
133 esac
136 x86() {
137 x86_32 || x86_64
140 ppc() {
141 case "$host_arch" in
142 ppc|powerpc) return 0;;
143 *) return 1;;
144 esac
147 alpha() {
148 case "$host_arch" in
149 alpha) return 0;;
150 *) return 1;;
151 esac
154 arm() {
155 case "$host_arch" in
156 arm) return 0;;
157 *) return 1;;
158 esac
161 sh3() {
162 case "$host_arch" in
163 sh3) return 0;;
164 *) return 1;;
165 esac
168 # Use this before starting a check
169 echocheck() {
170 echo "============ Checking for $@ ============" >> "$TMPLOG"
171 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
174 # Use this to echo the results of a check
175 echores() {
176 if test "$_res_comment" ; then
177 _res_comment="($_res_comment)"
179 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
180 echo "##########################################" >> "$TMPLOG"
181 echo "" >> "$TMPLOG"
182 echo "$@ $_res_comment"
183 _res_comment=""
185 #############################################################################
187 # Check how echo works in this /bin/sh
188 case `echo -n` in
189 -n) _echo_n= _echo_c='\c' ;; # SysV echo
190 *) _echo_n='-n ' _echo_c= ;; # BSD echo
191 esac
193 LANGUAGES=`echo help/help_mp-??.h help/help_mp-??_??.h | sed "s:help/help_mp-\(..\).h:\1:g" | sed "s:help/help_mp-\(.....\).h:\1:g"`
195 show_help(){
196 cat << EOF
197 Usage: $0 [OPTIONS]...
199 Configuration:
200 -h, --help display this help and exit
202 Installation directories:
203 --prefix=DIR prefix directory for installation [/usr/local]
204 --bindir=DIR directory for installing binaries [PREFIX/bin]
205 --datadir=DIR directory for installing machine independent
206 data files (skins, etc) [PREFIX/share/mplayer]
207 --mandir=DIR directory for installing man pages [PREFIX/share/man]
208 --confdir=DIR directory for installing configuration files
209 [PREFIX/etc/mplayer]
210 --libdir=DIR directory for object code libraries [PREFIX/lib]
211 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
212 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
213 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
214 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
216 Optional features:
217 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
218 --disable-mplayer disable MPlayer compilation [enable]
219 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
220 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
221 --disable-largefiles disable support for files > 2GB [enable]
222 --enable-linux-devfs set default devices to devfs [disable]
223 --enable-termcap use termcap database for key codes [autodetect]
224 --enable-termios use termios database for key codes [autodetect]
225 --disable-iconv disable iconv for encoding conversion [autodetect]
226 --disable-langinfo do not use langinfo [autodetect]
227 --enable-lirc enable LIRC (remote control) support [autodetect]
228 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
229 --enable-joystick enable joystick support [disable]
230 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
231 --disable-vm disable X video mode extensions [autodetect]
232 --disable-xf86keysym disable support for multimedia keys [autodetect]
233 --enable-radio enable radio interface [disable]
234 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
235 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
236 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
237 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
238 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
239 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
240 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
241 --disable-tv-teletext disable TV teletext interface [autodetect]
242 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
243 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
244 --disable-network disable networking [enable]
245 --enable-winsock2 enable winsock2 [autodetect]
246 --enable-smb enable Samba (SMB) input [autodetect]
247 --enable-live enable LIVE555 Streaming Media [autodetect]
248 --enable-nemesi enable Nemesi Streaming Media [autodetect]
249 --disable-dvdnav disable libdvdnav [autodetect]
250 --disable-dvdread disable libdvdread [autodetect]
251 --disable-dvdread-internal disable internal libdvdread [autodetect]
252 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
253 --disable-cdparanoia disable cdparanoia [autodetect]
254 --disable-cddb disable cddb [autodetect]
255 --disable-bitmap-font disable bitmap font support [enable]
256 --disable-freetype disable FreeType 2 font rendering [autodetect]
257 --disable-fontconfig disable fontconfig font lookup [autodetect]
258 --disable-unrarexec disable using of UnRAR executable [enabled]
259 --enable-menu enable OSD menu (not DVD menu) [disabled]
260 --disable-sortsub disable subtitle sorting [enabled]
261 --enable-fribidi enable the FriBiDi libs [autodetect]
262 --disable-enca disable ENCA charset oracle library [autodetect]
263 --disable-macosx disable Mac OS X specific features [autodetect]
264 --disable-maemo disable maemo specific features [autodetect]
265 --enable-macosx-finder-support enable Mac OS X Finder invocation
266 parameter parsing [disabled]
267 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
268 --disable-inet6 disable IPv6 support [autodetect]
269 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
270 --disable-ftp disable FTP support [enabled]
271 --disable-vstream disable TiVo vstream client support [autodetect]
272 --disable-pthreads disable Posix threads support [autodetect]
273 --disable-w32threads disable Win32 threads support [autodetect]
274 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
275 --enable-rpath enable runtime linker path for extra libs [disabled]
277 Codecs:
278 --enable-gif enable GIF support [autodetect]
279 --enable-png enable PNG input/output support [autodetect]
280 --enable-jpeg enable JPEG input/output support [autodetect]
281 --enable-libcdio enable external libcdio [autodetect]
282 --enable-liblzo enable external liblzo [autodetect]
283 --disable-win32dll disable Win32 DLL support [enabled]
284 --disable-qtx disable QuickTime codecs support [enabled]
285 --disable-xanim disable XAnim codecs support [enabled]
286 --disable-real disable RealPlayer codecs support [enabled]
287 --disable-xvid disable XviD [autodetect]
288 --disable-x264 disable x264 [autodetect]
289 --disable-libnut disable libnut [autodetect]
290 --disable-libavutil_a disable static libavutil [autodetect]
291 --disable-libavcodec_a disable static libavcodec [autodetect]
292 --disable-libavformat_a disable static libavformat [autodetect]
293 --disable-libpostproc_a disable static libpostproc [autodetect]
294 --disable-libavutil_so disable shared libavutil [autodetect]
295 --disable-libavcodec_so disable shared libavcodec [autodetect]
296 --disable-libavformat_so disable shared libavformat [autodetect]
297 --disable-libpostproc_so disable shared libpostproc [autodetect]
298 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
299 in libavcodec [enabled]
300 --disable-tremor-internal disable internal Tremor [enabled]
301 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
302 --enable-tremor-external enable external Tremor [autodetect]
303 --disable-libvorbis disable libvorbis support [autodetect]
304 --disable-speex disable Speex support [autodetect]
305 --enable-theora enable OggTheora libraries [autodetect]
306 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
307 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
308 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
309 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
310 --disable-ladspa disable LADSPA plugin support [autodetect]
311 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
312 --disable-mad disable libmad (MPEG audio) support [autodetect]
313 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
314 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
315 --enable-xmms enable XMMS input plugin support [disabled]
316 --enable-libdca enable libdca support [autodetect]
317 --disable-mp3lib disable builtin mp3lib [enabled]
318 --disable-liba52 disable builtin liba52 [enabled]
319 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
320 --disable-musepack disable musepack support [autodetect]
321 --disable-libamr_nb disable libamr narrowband [autodetect]
322 --disable-libamr_wb disable libamr wideband [autodetect]
323 --disable-decoder=DECODER disable specified FFmpeg decoder
324 --enable-decoder=DECODER enable specified FFmpeg decoder
325 --disable-encoder=ENCODER disable specified FFmpeg encoder
326 --enable-encoder=ENCODER enable specified FFmpeg encoder
327 --disable-parser=PARSER disable specified FFmpeg parser
328 --enable-parser=PARSER enable specified FFmpeg parser
329 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
330 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
331 --disable-muxer=MUXER disable specified FFmpeg muxer
332 --enable-muxer=MUXER enable specified FFmpeg muxer
334 Video output:
335 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
336 --disable-vidix-external disable external VIDIX [for x86 *nix]
337 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
338 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
339 nvidia,pm2,pm3,radeon,rage128,savage,sis,unichrome
340 --disable-vidix-pcidb disable VIDIX PCI device name database
341 --enable-gl enable OpenGL video output [autodetect]
342 --enable-dga2 enable DGA 2 support [autodetect]
343 --enable-dga1 enable DGA 1 support [autodetect]
344 --enable-vesa enable VESA video output [autodetect]
345 --enable-svga enable SVGAlib video output [autodetect]
346 --enable-sdl enable SDL video output [autodetect]
347 --enable-aa enable AAlib video output [autodetect]
348 --enable-caca enable CACA video output [autodetect]
349 --enable-ggi enable GGI video output [autodetect]
350 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
351 --enable-directx enable DirectX video output [autodetect]
352 --enable-dxr2 enable DXR2 video output [autodetect]
353 --enable-dxr3 enable DXR3/H+ video output [autodetect]
354 --enable-ivtv enable IVTV TV-Out video output [autodetect]
355 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
356 --enable-dvb enable DVB video output [autodetect]
357 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
358 --enable-mga enable mga_vid video output [autodetect]
359 --enable-xmga enable mga_vid X11 video output [autodetect]
360 --enable-xv enable Xv video output [autodetect]
361 --enable-xvmc enable XvMC acceleration [disable]
362 --enable-vm enable XF86VidMode support [autodetect]
363 --enable-xinerama enable Xinerama support [autodetect]
364 --enable-x11 enable X11 video output [autodetect]
365 --enable-xshape enable XShape support [autodetect]
366 --disable-xss disable screensaver support via xss [autodetect]
367 --enable-fbdev enable FBDev video output [autodetect]
368 --enable-mlib enable mediaLib video output (Solaris) [disable]
369 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
370 --enable-tdfxfb enable tdfxfb video output [disable]
371 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
372 --enable-directfb enable DirectFB video output [autodetect]
373 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
374 --enable-bl enable Blinkenlights video output [disable]
375 --enable-tdfxvid enable tdfx_vid video output [disable]
376 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
377 --disable-tga disable Targa video output [enable]
378 --disable-pnm disable PNM video output [enable]
379 --disable-md5sum disable md5sum video output [enable]
381 Audio output:
382 --disable-alsa disable ALSA audio output [autodetect]
383 --disable-ossaudio disable OSS audio output [autodetect]
384 --disable-arts disable aRts audio output [autodetect]
385 --disable-esd disable esd audio output [autodetect]
386 --disable-pulse disable Pulseaudio audio output [autodetect]
387 --disable-jack disable JACK audio output [autodetect]
388 --disable-openal disable OpenAL audio output [autodetect]
389 --disable-nas disable NAS audio output [autodetect]
390 --disable-sgiaudio disable SGI audio output [autodetect]
391 --disable-sunaudio disable Sun audio output [autodetect]
392 --disable-win32waveout disable Windows waveout audio output [autodetect]
393 --disable-select disable using select() on the audio device [enable]
395 Miscellaneous options:
396 --enable-runtime-cpudetection enable runtime CPU detection [disable]
397 --enable-cross-compile enable cross-compilation [autodetect]
398 --cc=COMPILER C compiler to build MPlayer [gcc]
399 --host-cc=COMPILER C compiler for tools needed while building [gcc]
400 --as=ASSEMBLER assembler to build MPlayer [as]
401 --ar=AR librarian to build MPlayer [ar]
402 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
403 --windres=WINDRES windres to build MPlayer [windres]
404 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
405 --enable-static build a statically linked binary
406 --charset=charset convert the console messages to this character set
407 --language=list a white space or comma separated list of languages for
408 translated man pages, the first language is used for
409 messages and the GUI (the environment variable
410 \$LINGUAS is also honored) [en]
411 (Available: $LANGUAGES all)
412 --with-install=PATH path to a custom install program
413 --enable-color-console enable color console output (UNSUPPORTED) [disable]
415 Advanced options:
416 --enable-mmx enable MMX [autodetect]
417 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
418 --enable-3dnow enable 3DNow! [autodetect]
419 --enable-3dnowext enable extended 3DNow! [autodetect]
420 --enable-sse enable SSE [autodetect]
421 --enable-sse2 enable SSE2 [autodetect]
422 --enable-ssse3 enable SSSE3 [autodetect]
423 --enable-shm enable shm [autodetect]
424 --enable-altivec enable AltiVec (PowerPC) [autodetect]
425 --enable-armv5te enable DSP extensions (ARM) [autodetect]
426 --enable-armv6 enable ARMv6 (ARM) [autodetect]
427 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
428 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
429 --enable-big-endian force byte order to big-endian [autodetect]
430 --enable-debug[=1-3] compile-in debugging information [disable]
431 --enable-profile compile-in profiling information [disable]
432 --disable-sighandler disable sighandler for crashes [enable]
433 --enable-crash-debug enable automatic gdb attach on crash [disable]
434 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
436 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
437 --disable-gcc-check disable gcc version checking [enable]
439 Use these options if autodetection fails (Options marked with (*) accept
440 multiple paths separated by ':'):
441 --extra-libs=FLAGS extra linker flags
442 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
443 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
444 --with-extraincdir=DIR extra header search paths in DIR (*)
445 --with-extralibdir=DIR extra linker search paths in DIR (*)
446 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
448 --with-freetype-config=PATH path to freetype-config
449 --with-fribidi-config=PATH path to fribidi-config
450 --with-glib-config=PATH path to glib*-config
451 --with-gtk-config=PATH path to gtk*-config
452 --with-sdl-config=PATH path to sdl*-config
453 --with-dvdnav-config=PATH path to dvdnav-config
455 This configure script is NOT autoconf-based, even though its output is similar.
456 It will try to autodetect all configuration options. If you --enable an option
457 it will be forcefully turned on, skipping autodetection. This can break
458 compilation, so you need to know what you are doing.
460 exit 0
461 } #show_help()
463 # GOTCHA: the variables below defines the default behavior for autodetection
464 # and have - unless stated otherwise - at least 2 states : yes no
465 # If autodetection is available then the third state is: auto
466 _mmx=auto
467 _3dnow=auto
468 _3dnowext=auto
469 _mmxext=auto
470 _sse=auto
471 _sse2=auto
472 _ssse3=auto
473 _cmov=auto
474 _fast_cmov=auto
475 _armv5te=auto
476 _armv6=auto
477 _iwmmxt=auto
478 _mtrr=auto
479 _altivec=auto
480 _install=install
481 _ranlib=ranlib
482 _windres=windres
483 _ldconfig=ldconfig
484 _cc=cc
485 _ar=ar
486 test "$CC" && _cc="$CC"
487 _gcc_check=yes
488 _as=auto
489 _runtime_cpudetection=no
490 _cross_compile=auto
491 _prefix="/usr/local"
492 _libavutil_a=auto
493 _libavutil_so=auto
494 _libavcodec_a=auto
495 _libamr_nb=auto
496 _libamr_wb=auto
497 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
498 _libavdecoders=` echo $_libavdecoders_all | sed -e s/LIBFAAD_DECODER// -e s/MPEG4AAC_DECODER// -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// `
499 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
500 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// -e s/LIBVORBIS_ENCODER// `
501 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
502 _libavparsers=$_libavparsers_all
503 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
504 _libavbsfs=$_libavbsfs_all
505 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
506 _libavdemuxers=`echo $_libavdemuxers_all | sed -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/LIBNUT_DEMUXER// -e s/AVISYNTH_DEMUXER// `
507 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
508 _libavmuxers=`echo $_libavmuxers_all | sed -e s/RTP_MUXER// `
509 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
510 _libavcodec_so=auto
511 _libavformat_a=auto
512 _libavformat_so=auto
513 _libpostproc_a=auto
514 _libpostproc_so=auto
515 _libavcodec_mpegaudio_hp=yes
516 _mencoder=yes
517 _mplayer=yes
518 _x11=auto
519 _xshape=auto
520 _xss=auto
521 _dga1=auto
522 _dga2=auto
523 _xv=auto
524 _xvmc=no #auto when complete
525 _sdl=auto
526 _directx=auto
527 _win32waveout=auto
528 _nas=auto
529 _png=auto
530 _jpeg=auto
531 _pnm=yes
532 _md5sum=yes
533 _gif=auto
534 _gl=auto
535 _ggi=auto
536 _ggiwmh=auto
537 _aa=auto
538 _caca=auto
539 _svga=auto
540 _vesa=auto
541 _fbdev=auto
542 _dvb=auto
543 _dvbhead=auto
544 _dxr2=auto
545 _dxr3=auto
546 _ivtv=auto
547 _v4l2=auto
548 _iconv=auto
549 _langinfo=auto
550 _rtc=auto
551 _ossaudio=auto
552 _arts=auto
553 _esd=auto
554 _pulse=auto
555 _jack=auto
556 _openal=auto
557 _libcdio=auto
558 _liblzo=auto
559 _mad=auto
560 _toolame=auto
561 _twolame=auto
562 _tremor_internal=yes
563 _tremor_low=no
564 _tremor_external=auto
565 _libvorbis=auto
566 _speex=auto
567 _theora=auto
568 _mp3lib=yes
569 _liba52=yes
570 _libdca=auto
571 _libmpeg2=yes
572 _faad_internal=auto
573 _faad_external=auto
574 _faad_fixed=no
575 _faac=auto
576 _ladspa=auto
577 _xmms=no
578 _dvdnav=auto
579 _dvdnavconfig=dvdnav-config
580 _dvdread=auto
581 _dvdread_internal=auto
582 _libdvdcss_internal=auto
583 _xanim=auto
584 _real=auto
585 _live=auto
586 _nemesi=auto
587 _native_rtsp=yes
588 _xinerama=auto
589 _mga=auto
590 _xmga=auto
591 _vm=auto
592 _xf86keysym=auto
593 _mlib=no #broken, thus disabled
594 _sgiaudio=auto
595 _sunaudio=auto
596 _alsa=auto
597 _fastmemcpy=yes
598 _unrar_exec=auto
599 _win32dll=auto
600 _select=yes
601 _radio=no
602 _radio_capture=no
603 _radio_v4l=auto
604 _radio_v4l2=auto
605 _radio_bsdbt848=auto
606 _tv=yes
607 _tv_v4l1=auto
608 _tv_v4l2=auto
609 _tv_bsdbt848=auto
610 _tv_dshow=auto
611 _tv_teletext=auto
612 _pvr=auto
613 _network=yes
614 _winsock2=auto
615 _smbsupport=auto
616 _vidix_internal=auto
617 _vidix_external=auto
618 _vidix_pcidb=yes
619 _joystick=no
620 _xvid=auto
621 _x264=auto
622 _libnut=auto
623 _lirc=auto
624 _lircc=auto
625 _apple_remote=auto
626 _gui=no
627 _gtk1=no
628 _termcap=auto
629 _termios=auto
630 _3dfx=no
631 _s3fb=no
632 _tdfxfb=no
633 _tdfxvid=no
634 _xvr100=auto
635 _tga=yes
636 _directfb=auto
637 _zr=auto
638 _bl=no
639 _largefiles=yes
640 #_language=en
641 _shm=auto
642 _linux_devfs=no
643 _charset="UTF-8"
644 _dynamic_plugins=no
645 _crash_debug=no
646 _sighandler=yes
647 _libdv=auto
648 _cdparanoia=auto
649 _cddb=auto
650 _big_endian=auto
651 _bitmap_font=yes
652 _freetype=auto
653 _fontconfig=auto
654 _menu=no
655 _qtx=auto
656 _macosx=auto
657 _maemo=auto
658 _macosx_finder_support=no
659 _macosx_bundle=auto
660 _sortsub=yes
661 _freetypeconfig='freetype-config'
662 _fribidi=auto
663 _fribidiconfig='fribidi-config'
664 _enca=auto
665 _inet6=auto
666 _gethostbyname2=auto
667 _ftp=yes
668 _musepack=auto
669 _vstream=auto
670 _pthreads=auto
671 _w32threads=auto
672 _ass=auto
673 _rpath=no
674 _asmalign_pot=auto
675 _color_console=no
676 _stream_cache=yes
677 _def_stream_cache="#define USE_STREAM_CACHE 1"
678 _need_shmem=yes
679 for ac_option do
680 case "$ac_option" in
681 --help|-help|-h)
682 show_help
684 --prefix=*)
685 _prefix=`echo $ac_option | cut -d '=' -f 2`
687 --bindir=*)
688 _bindir=`echo $ac_option | cut -d '=' -f 2`
690 --datadir=*)
691 _datadir=`echo $ac_option | cut -d '=' -f 2`
693 --mandir=*)
694 _mandir=`echo $ac_option | cut -d '=' -f 2`
696 --confdir=*)
697 _confdir=`echo $ac_option | cut -d '=' -f 2`
699 --libdir=*)
700 _libdir=`echo $ac_option | cut -d '=' -f 2`
702 --codecsdir=*)
703 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
705 --win32codecsdir=*)
706 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
708 --xanimcodecsdir=*)
709 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
711 --realcodecsdir=*)
712 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
714 --with-extraincdir=*)
715 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
717 --with-extralibdir=*)
718 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
721 --with-install=*)
722 _install=`echo $ac_option | cut -d '=' -f 2 `
724 --with-xvmclib=*)
725 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
728 --with-sdl-config=*)
729 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
731 --with-freetype-config=*)
732 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
734 --with-fribidi-config=*)
735 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
737 --with-gtk-config=*)
738 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
740 --with-glib-config=*)
741 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
743 --with-dvdnav-config=*)
744 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
747 --extra-libs=*)
748 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
750 --extra-libs-mplayer=*)
751 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
753 --extra-libs-mencoder=*)
754 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
757 --target=*)
758 _target=`echo $ac_option | cut -d '=' -f 2`
760 --cc=*)
761 _cc=`echo $ac_option | cut -d '=' -f 2`
763 --host-cc=*)
764 _host_cc=`echo $ac_option | cut -d '=' -f 2`
766 --as=*)
767 _as=`echo $ac_option | cut -d '=' -f 2`
769 --ar=*)
770 _ar=`echo $ac_option | cut -d '=' -f 2`
772 --ranlib=*)
773 _ranlib=`echo $ac_option | cut -d '=' -f 2`
775 --windres=*)
776 _windres=`echo $ac_option | cut -d '=' -f 2`
778 --charset=*)
779 _charset=`echo $ac_option | cut -d '=' -f 2`
781 --language=*)
782 _language=`echo $ac_option | cut -d '=' -f 2`
785 --enable-static)
786 _ld_static='-static'
788 --disable-static)
789 _ld_static=''
791 --enable-profile)
792 _profile='-p'
794 --disable-profile)
795 _profile=
797 --enable-debug)
798 _debug='-g'
800 --enable-debug=*)
801 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
803 --disable-debug)
804 _debug=
806 --enable-gcc-check) _gcc_check=yes ;;
807 --disable-gcc-check) _gcc_check=no ;;
808 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
809 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
810 --enable-cross-compile) _cross_compile=yes ;;
811 --disable-cross-compile) _cross_compile=no ;;
812 --enable-mencoder) _mencoder=yes ;;
813 --disable-mencoder) _mencoder=no ;;
814 --enable-mplayer) _mplayer=yes ;;
815 --disable-mplayer) _mplayer=no ;;
816 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
817 --disable-dynamic-plugins) _dynamic_plugins=no ;;
818 --enable-x11) _x11=yes ;;
819 --disable-x11) _x11=no ;;
820 --enable-xshape) _xshape=yes ;;
821 --disable-xshape) _xshape=no ;;
822 --enable-xss) _xss=yes ;;
823 --disable-xss) _xss=no ;;
824 --enable-xv) _xv=yes ;;
825 --disable-xv) _xv=no ;;
826 --enable-xvmc) _xvmc=yes ;;
827 --disable-xvmc) _xvmc=no ;;
828 --enable-sdl) _sdl=yes ;;
829 --disable-sdl) _sdl=no ;;
830 --enable-directx) _directx=yes ;;
831 --disable-directx) _directx=no ;;
832 --enable-win32waveout) _win32waveout=yes ;;
833 --disable-win32waveout) _win32waveout=no ;;
834 --enable-nas) _nas=yes ;;
835 --disable-nas) _nas=no ;;
836 --enable-png) _png=yes ;;
837 --disable-png) _png=no ;;
838 --enable-jpeg) _jpeg=yes ;;
839 --disable-jpeg) _jpeg=no ;;
840 --enable-pnm) _pnm=yes ;;
841 --disable-pnm) _pnm=no ;;
842 --enable-md5sum) _md5sum=yes ;;
843 --disable-md5sum) _md5sum=no ;;
844 --enable-gif) _gif=yes ;;
845 --disable-gif) _gif=no ;;
846 --enable-gl) _gl=yes ;;
847 --disable-gl) _gl=no ;;
848 --enable-ggi) _ggi=yes ;;
849 --disable-ggi) _ggi=no ;;
850 --enable-ggiwmh) _ggiwmh=yes ;;
851 --disable-ggiwmh) _ggiwmh=no ;;
852 --enable-aa) _aa=yes ;;
853 --disable-aa) _aa=no ;;
854 --enable-caca) _caca=yes ;;
855 --disable-caca) _caca=no ;;
856 --enable-svga) _svga=yes ;;
857 --disable-svga) _svga=no ;;
858 --enable-vesa) _vesa=yes ;;
859 --disable-vesa) _vesa=no ;;
860 --enable-fbdev) _fbdev=yes ;;
861 --disable-fbdev) _fbdev=no ;;
862 --enable-dvb) _dvb=yes ;;
863 --disable-dvb) _dvb=no ;;
864 --enable-dvbhead) _dvbhead=yes ;;
865 --disable-dvbhead) _dvbhead=no ;;
866 --enable-dxr2) _dxr2=yes ;;
867 --disable-dxr2) _dxr2=no ;;
868 --enable-dxr3) _dxr3=yes ;;
869 --disable-dxr3) _dxr3=no ;;
870 --enable-ivtv) _ivtv=yes ;;
871 --disable-ivtv) _ivtv=no ;;
872 --enable-v4l2) _v4l2=yes ;;
873 --disable-v4l2) _v4l2=no ;;
874 --enable-iconv) _iconv=yes ;;
875 --disable-iconv) _iconv=no ;;
876 --enable-langinfo) _langinfo=yes ;;
877 --disable-langinfo) _langinfo=no ;;
878 --enable-rtc) _rtc=yes ;;
879 --disable-rtc) _rtc=no ;;
880 --enable-libdv) _libdv=yes ;;
881 --disable-libdv) _libdv=no ;;
882 --enable-ossaudio) _ossaudio=yes ;;
883 --disable-ossaudio) _ossaudio=no ;;
884 --enable-arts) _arts=yes ;;
885 --disable-arts) _arts=no ;;
886 --enable-esd) _esd=yes ;;
887 --disable-esd) _esd=no ;;
888 --enable-pulse) _pulse=yes ;;
889 --disable-pulse) _pulse=no ;;
890 --enable-jack) _jack=yes ;;
891 --disable-jack) _jack=no ;;
892 --enable-openal) _openal=yes ;;
893 --disable-openal) _openal=no ;;
894 --enable-mad) _mad=yes ;;
895 --disable-mad) _mad=no ;;
896 --enable-toolame) _toolame=yes ;;
897 --disable-toolame) _toolame=no ;;
898 --enable-twolame) _twolame=yes ;;
899 --disable-twolame) _twolame=no ;;
900 --enable-libcdio) _libcdio=yes ;;
901 --disable-libcdio) _libcdio=no ;;
902 --enable-liblzo) _liblzo=yes ;;
903 --disable-liblzo) _liblzo=no ;;
904 --enable-libvorbis) _libvorbis=yes ;;
905 --disable-libvorbis) _libvorbis=no ;;
906 --enable-speex) _speex=yes ;;
907 --disable-speex) _speex=no ;;
908 --enable-tremor-internal) _tremor_internal=yes ;;
909 --disable-tremor-internal) _tremor_internal=no ;;
910 --enable-tremor-low) _tremor_low=yes ;;
911 --disable-tremor-low) _tremor_low=no ;;
912 --enable-tremor-external) _tremor_external=yes ;;
913 --disable-tremor-external) _tremor_external=no ;;
914 --enable-theora) _theora=yes ;;
915 --disable-theora) _theora=no ;;
916 --enable-mp3lib) _mp3lib=yes ;;
917 --disable-mp3lib) _mp3lib=no ;;
918 --enable-liba52) _liba52=yes ;;
919 --disable-liba52) _liba52=no ;;
920 --enable-libdca) _libdca=yes ;;
921 --disable-libdca) _libdca=no ;;
922 --enable-libmpeg2) _libmpeg2=yes ;;
923 --disable-libmpeg2) _libmpeg2=no ;;
924 --enable-musepack) _musepack=yes ;;
925 --disable-musepack) _musepack=no ;;
926 --enable-faad-internal) _faad_internal=yes ;;
927 --disable-faad-internal) _faad_internal=no ;;
928 --enable-faad-external) _faad_external=yes ;;
929 --disable-faad-external) _faad_external=no ;;
930 --enable-faad-fixed) _faad_fixed=yes ;;
931 --disable-faad-fixed) _faad_fixed=no ;;
932 --enable-faac) _faac=yes ;;
933 --disable-faac) _faac=no ;;
934 --enable-ladspa) _ladspa=yes ;;
935 --disable-ladspa) _ladspa=no ;;
936 --enable-xmms) _xmms=yes ;;
937 --disable-xmms) _xmms=no ;;
938 --enable-dvdread) _dvdread=yes ;;
939 --disable-dvdread) _dvdread=no ;;
940 --enable-dvdread-internal) _dvdread_internal=yes ;;
941 --disable-dvdread-internal) _dvdread_internal=no ;;
942 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
943 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
944 --enable-dvdnav) _dvdnav=yes ;;
945 --disable-dvdnav) _dvdnav=no ;;
946 --enable-xanim) _xanim=yes ;;
947 --disable-xanim) _xanim=no ;;
948 --enable-real) _real=yes ;;
949 --disable-real) _real=no ;;
950 --enable-live) _live=yes ;;
951 --disable-live) _live=no ;;
952 --enable-nemesi) _nemesi=yes ;;
953 --disable-nemesi) _nemesi=no ;;
954 --enable-xinerama) _xinerama=yes ;;
955 --disable-xinerama) _xinerama=no ;;
956 --enable-mga) _mga=yes ;;
957 --disable-mga) _mga=no ;;
958 --enable-xmga) _xmga=yes ;;
959 --disable-xmga) _xmga=no ;;
960 --enable-vm) _vm=yes ;;
961 --disable-vm) _vm=no ;;
962 --enable-xf86keysym) _xf86keysym=yes ;;
963 --disable-xf86keysym) _xf86keysym=no ;;
964 --enable-mlib) _mlib=yes ;;
965 --disable-mlib) _mlib=no ;;
966 --enable-sunaudio) _sunaudio=yes ;;
967 --disable-sunaudio) _sunaudio=no ;;
968 --enable-sgiaudio) _sgiaudio=yes ;;
969 --disable-sgiaudio) _sgiaudio=no ;;
970 --enable-alsa) _alsa=yes ;;
971 --disable-alsa) _alsa=no ;;
972 --enable-tv) _tv=yes ;;
973 --disable-tv) _tv=no ;;
974 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
975 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
976 --enable-tv-v4l1) _tv_v4l1=yes ;;
977 --disable-tv-v4l1) _tv_v4l1=no ;;
978 --enable-tv-v4l2) _tv_v4l2=yes ;;
979 --disable-tv-v4l2) _tv_v4l2=no ;;
980 --enable-tv-dshow) _tv_dshow=yes ;;
981 --disable-tv-dshow) _tv_dshow=no ;;
982 --enable-tv-teletext) _tv_teletext=yes ;;
983 --disable-tv-teletext) _tv_teletext=no ;;
984 --enable-radio) _radio=yes ;;
985 --enable-radio-capture) _radio_capture=yes ;;
986 --disable-radio-capture) _radio_capture=no ;;
987 --disable-radio) _radio=no ;;
988 --enable-radio-v4l) _radio_v4l=yes ;;
989 --disable-radio-v4l) _radio_v4l=no ;;
990 --enable-radio-v4l2) _radio_v4l2=yes ;;
991 --disable-radio-v4l2) _radio_v4l2=no ;;
992 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
993 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
994 --enable-pvr) _pvr=yes ;;
995 --disable-pvr) _pvr=no ;;
996 --enable-fastmemcpy) _fastmemcpy=yes ;;
997 --disable-fastmemcpy) _fastmemcpy=no ;;
998 --enable-network) _network=yes ;;
999 --disable-network) _network=no ;;
1000 --enable-winsock2) _winsock2=yes ;;
1001 --disable-winsock2) _winsock2=no ;;
1002 --enable-smb) _smbsupport=yes ;;
1003 --disable-smb) _smbsupport=no ;;
1004 --enable-vidix-internal) _vidix_internal=yes ;;
1005 --disable-vidix-internal) _vidix_internal=no ;;
1006 --enable-vidix-external) _vidix_external=yes ;;
1007 --disable-vidix-external) _vidix_external=no ;;
1008 --with-vidix-drivers=*)
1009 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
1011 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1012 --enable-joystick) _joystick=yes ;;
1013 --disable-joystick) _joystick=no ;;
1014 --enable-xvid) _xvid=yes ;;
1015 --disable-xvid) _xvid=no ;;
1016 --enable-x264) _x264=yes ;;
1017 --disable-x264) _x264=no ;;
1018 --enable-libnut) _libnut=yes ;;
1019 --disable-libnut) _libnut=no ;;
1020 --enable-libavutil_a) _libavutil_a=yes ;;
1021 --disable-libavutil_a) _libavutil_a=no ;;
1022 --enable-libavutil_so) _libavutil_so=yes ;;
1023 --disable-libavutil_so) _libavutil_so=no ;;
1024 --enable-libavcodec_a) _libavcodec_a=yes ;;
1025 --disable-libavcodec_a) _libavcodec_a=no ;;
1026 --enable-libavcodec_so) _libavcodec_so=yes ;;
1027 --disable-libavcodec_so) _libavcodec_so=no ;;
1028 --enable-libamr_nb) _libamr_nb=yes ;;
1029 --disable-libamr_nb) _libamr_nb=no ;;
1030 --enable-libamr_wb) _libamr_wb=yes ;;
1031 --disable-libamr_wb) _libamr_wb=no ;;
1032 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1033 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1034 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1035 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1036 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1037 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1038 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1039 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1040 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1041 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1042 --enable-libavformat_a) _libavformat_a=yes ;;
1043 --disable-libavformat_a) _libavformat_a=no ;;
1044 --enable-libavformat_so) _libavformat_so=yes ;;
1045 --disable-libavformat_so) _libavformat_so=no ;;
1046 --enable-libpostproc_a) _libpostproc_a=yes ;;
1047 --disable-libpostproc_a) _libpostproc_a=no ;;
1048 --enable-libpostproc_so) _libpostproc_so=yes ;;
1049 --disable-libpostproc_so) _libpostproc_so=no ;;
1050 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1051 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1053 --enable-lirc) _lirc=yes ;;
1054 --disable-lirc) _lirc=no ;;
1055 --enable-lircc) _lircc=yes ;;
1056 --disable-lircc) _lircc=no ;;
1057 --enable-apple-remote) _apple_remote=yes ;;
1058 --disable-apple-remote) _apple_remote=no ;;
1059 --enable-gui) _gui=yes ;;
1060 --disable-gui) _gui=no ;;
1061 --enable-gtk1) _gtk1=yes ;;
1062 --disable-gtk1) _gtk1=no ;;
1063 --enable-termcap) _termcap=yes ;;
1064 --disable-termcap) _termcap=no ;;
1065 --enable-termios) _termios=yes ;;
1066 --disable-termios) _termios=no ;;
1067 --enable-3dfx) _3dfx=yes ;;
1068 --disable-3dfx) _3dfx=no ;;
1069 --enable-s3fb) _s3fb=yes ;;
1070 --disable-s3fb) _s3fb=no ;;
1071 --enable-tdfxfb) _tdfxfb=yes ;;
1072 --disable-tdfxfb) _tdfxfb=no ;;
1073 --disable-tdfxvid) _tdfxvid=no ;;
1074 --enable-tdfxvid) _tdfxvid=yes ;;
1075 --disable-xvr100) _xvr100=no ;;
1076 --enable-xvr100) _xvr100=yes ;;
1077 --disable-tga) _tga=no ;;
1078 --enable-tga) _tga=yes ;;
1079 --enable-directfb) _directfb=yes ;;
1080 --disable-directfb) _directfb=no ;;
1081 --enable-zr) _zr=yes ;;
1082 --disable-zr) _zr=no ;;
1083 --enable-bl) _bl=yes ;;
1084 --disable-bl) _bl=no ;;
1085 --enable-mtrr) _mtrr=yes ;;
1086 --disable-mtrr) _mtrr=no ;;
1087 --enable-largefiles) _largefiles=yes ;;
1088 --disable-largefiles) _largefiles=no ;;
1089 --enable-shm) _shm=yes ;;
1090 --disable-shm) _shm=no ;;
1091 --enable-select) _select=yes ;;
1092 --disable-select) _select=no ;;
1093 --enable-linux-devfs) _linux_devfs=yes ;;
1094 --disable-linux-devfs) _linux_devfs=no ;;
1095 --enable-cdparanoia) _cdparanoia=yes ;;
1096 --disable-cdparanoia) _cdparanoia=no ;;
1097 --enable-cddb) _cddb=yes ;;
1098 --disable-cddb) _cddb=no ;;
1099 --enable-big-endian) _big_endian=yes ;;
1100 --disable-big-endian) _big_endian=no ;;
1101 --enable-bitmap-font) _bitmap_font=yes ;;
1102 --disable-bitmap-font) _bitmap_font=no ;;
1103 --enable-freetype) _freetype=yes ;;
1104 --disable-freetype) _freetype=no ;;
1105 --enable-fontconfig) _fontconfig=yes ;;
1106 --disable-fontconfig) _fontconfig=no ;;
1107 --enable-unrarexec) _unrar_exec=yes ;;
1108 --disable-unrarexec) _unrar_exec=no ;;
1109 --enable-ftp) _ftp=yes ;;
1110 --disable-ftp) _ftp=no ;;
1111 --enable-vstream) _vstream=yes ;;
1112 --disable-vstream) _vstream=no ;;
1113 --enable-pthreads) _pthreads=yes ;;
1114 --disable-pthreads) _pthreads=no ;;
1115 --enable-w32threads) _w32threads=yes ;;
1116 --disable-w32threads) _w32threads=no ;;
1117 --enable-ass) _ass=yes ;;
1118 --disable-ass) _ass=no ;;
1119 --enable-rpath) _rpath=yes ;;
1120 --disable-rpath) _rpath=no ;;
1121 --enable-color-console) _color_console=yes ;;
1122 --disable-color-console) _color_console=no ;;
1124 --enable-fribidi) _fribidi=yes ;;
1125 --disable-fribidi) _fribidi=no ;;
1127 --enable-enca) _enca=yes ;;
1128 --disable-enca) _enca=no ;;
1130 --enable-inet6) _inet6=yes ;;
1131 --disable-inet6) _inet6=no ;;
1133 --enable-gethostbyname2) _gethostbyname2=yes ;;
1134 --disable-gethostbyname2) _gethostbyname2=no ;;
1136 --enable-dga1) _dga1=yes ;;
1137 --disable-dga1) _dga1=no ;;
1138 --enable-dga2) _dga2=yes ;;
1139 --disable-dga2) _dga2=no ;;
1141 --enable-menu) _menu=yes ;;
1142 --disable-menu) _menu=no ;;
1144 --enable-qtx) _qtx=yes ;;
1145 --disable-qtx) _qtx=no ;;
1147 --enable-macosx) _macosx=yes ;;
1148 --disable-macosx) _macosx=no ;;
1149 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1150 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1151 --enable-macosx-bundle) _macosx_bundle=yes;;
1152 --disable-macosx-bundle) _macosx_bundle=no;;
1154 --enable-maemo) _maemo=yes ;;
1155 --disable-maemo) _maemo=no ;;
1157 --enable-sortsub) _sortsub=yes ;;
1158 --disable-sortsub) _sortsub=no ;;
1160 --enable-crash-debug) _crash_debug=yes ;;
1161 --disable-crash-debug) _crash_debug=no ;;
1162 --enable-sighandler) _sighandler=yes ;;
1163 --disable-sighandler) _sighandler=no ;;
1164 --enable-win32dll) _win32dll=yes ;;
1165 --disable-win32dll) _win32dll=no ;;
1167 --enable-sse) _sse=yes ;;
1168 --disable-sse) _sse=no ;;
1169 --enable-sse2) _sse2=yes ;;
1170 --disable-sse2) _sse2=no ;;
1171 --enable-ssse3) _ssse3=yes ;;
1172 --disable-ssse3) _ssse3=no ;;
1173 --enable-mmxext) _mmxext=yes ;;
1174 --disable-mmxext) _mmxext=no ;;
1175 --enable-3dnow) _3dnow=yes ;;
1176 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1177 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1178 --disable-3dnowext) _3dnowext=no ;;
1179 --enable-cmov) _cmov=yes ;;
1180 --disable-cmov) _cmov=no ;;
1181 --enable-fast-cmov) _fast_cmov=yes ;;
1182 --disable-fast-cmov) _fast_cmov=no ;;
1183 --enable-altivec) _altivec=yes ;;
1184 --disable-altivec) _altivec=no ;;
1185 --enable-armv5te) _armv5te=yes ;;
1186 --disable-armv5te) _armv5te=no ;;
1187 --enable-armv6) _armv6=yes ;;
1188 --disable-armv6) _armv6=no ;;
1189 --enable-iwmmxt) _iwmmxt=yes ;;
1190 --disable-iwmmxt) _iwmmxt=no ;;
1191 --enable-mmx) _mmx=yes ;;
1192 --disable-mmx) # 3Dnow! and MMX2 require MMX
1193 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1196 echo "Unknown parameter: $ac_option"
1197 exit 1
1200 esac
1201 done
1203 # Atmos: moved this here, to be correct, if --prefix is specified
1204 test -z "$_bindir" && _bindir="$_prefix/bin"
1205 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1206 test -z "$_mandir" && _mandir="$_prefix/share/man"
1207 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1208 test -z "$_libdir" && _libdir="$_prefix/lib"
1210 # Determine our OS name and CPU architecture
1211 if test -z "$_target" ; then
1212 # OS name
1213 system_name=`uname -s 2>&1`
1214 case "$system_name" in
1215 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX|AmigaOS)
1217 IRIX*)
1218 system_name=IRIX
1220 GNU/kFreeBSD)
1221 system_name=FreeBSD
1223 HP-UX*)
1224 system_name=HP-UX
1226 [cC][yY][gG][wW][iI][nN]*)
1227 system_name=CYGWIN
1229 MINGW32*)
1230 system_name=MINGW32
1233 system_name="$system_name-UNKNOWN"
1235 esac
1238 # host's CPU/instruction set
1239 host_arch=`uname -p 2>&1`
1240 case "$host_arch" in
1241 i386|sparc|ppc|alpha|arm|sh3|mips|vax)
1243 powerpc) # Darwin returns 'powerpc'
1244 host_arch=ppc
1246 *) # uname -p on Linux returns 'unknown' for the processor type,
1247 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1249 # Maybe uname -m (machine hardware name) returns something we
1250 # recognize.
1252 # x86/x86pc is used by QNX
1253 case "`uname -m 2>&1`" in
1254 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 ;;
1255 ia64) host_arch=ia64 ;;
1256 x86_64|amd64)
1257 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1258 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1259 host_arch=x86_64
1260 else
1261 host_arch=i386
1264 macppc|ppc|ppc64) host_arch=ppc ;;
1265 alpha) host_arch=alpha ;;
1266 sparc) host_arch=sparc ;;
1267 sparc64) host_arch=sparc64 ;;
1268 parisc*|hppa*|9000*) host_arch=hppa ;;
1269 arm*|zaurus|cats) host_arch=arm ;;
1270 sh3) host_arch=sh3 ;;
1271 s390) host_arch=s390 ;;
1272 s390x) host_arch=s390x ;;
1273 mips*) host_arch=mips ;;
1274 vax) host_arch=vax ;;
1275 xtensa*) host_arch=xtensa ;;
1276 *) host_arch=UNKNOWN ;;
1277 esac
1279 esac
1280 else # if test -z "$_target"
1281 system_name=`echo $_target | cut -d '-' -f 2`
1282 case "`echo $system_name | tr A-Z a-z`" in
1283 linux) system_name=Linux ;;
1284 freebsd) system_name=FreeBSD ;;
1285 gnu/kfreebsd) system_name=FreeBSD ;;
1286 netbsd) system_name=NetBSD ;;
1287 bsd/os) system_name=BSD/OS ;;
1288 openbsd) system_name=OpenBSD ;;
1289 sunos) system_name=SunOS ;;
1290 qnx) system_name=QNX ;;
1291 morphos) system_name=MorphOS ;;
1292 amigaos) system_name=AmigaOS ;;
1293 mingw32msvc) system_name=MINGW32 ;;
1294 esac
1295 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1296 host_arch=`echo $_target | cut -d '-' -f 1`
1297 if test `echo $host_arch` != "x86_64" ; then
1298 host_arch=`echo $host_arch | tr '_' '-'`
1302 echo "Detected operating system: $system_name"
1303 echo "Detected host architecture: $host_arch"
1305 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1306 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1310 if openbsd ; then
1311 _ldconfig="ldconfig -R"
1314 if freebsd ; then
1315 _ld_extra="$_ld_extra -L/usr/local/lib"
1316 _inc_extra="$_inc_extra -I/usr/local/include"
1319 if darwin; then
1320 _ld_extra="$_ld_extra -L/usr/local/lib"
1321 _inc_extra="$_inc_extra -I/usr/local/include"
1324 if aix ; then
1325 _ld_extra="$_ld_extra -lC"
1328 if irix ; then
1329 _ranlib='ar -r'
1330 elif linux ; then
1331 _ranlib='true'
1334 if win32 ; then
1335 _exesuf=".exe"
1336 # -lwinmm is always needed for osdep/timer-win2.c
1337 _ld_extra="$_ld_extra -lwinmm"
1338 _confwin32='TARGET_WIN32 = yes'
1339 else
1340 _confwin32='TARGET_WIN32 = no'
1343 if mingw32 ; then
1344 _need_shmem=no
1347 if cygwin ; then
1348 _def_confwin32='#define WIN32'
1351 if amigaos ; then
1352 _select=no
1353 _sighandler=no
1354 _stream_cache=no
1355 _def_stream_cache="#undef USE_STREAM_CACHE"
1358 if qnx ; then
1359 _ld_extra="$_ld_extra -lph"
1362 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1363 test "$I" && break
1364 done
1367 TMPLOG="configure.log"
1368 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1369 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1370 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1371 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1372 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1374 rm -f "$TMPLOG"
1375 echo configuration: $_configuration > "$TMPLOG"
1376 echo >> "$TMPLOG"
1379 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1380 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1381 # know about '-n'.
1382 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1383 _head() { head -$1 2>/dev/null ; }
1384 else
1385 _head() { head -n $1 2>/dev/null ; }
1387 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1388 _tail() { tail -$1 2>/dev/null ; }
1389 else
1390 _tail() { tail -n $1 2>/dev/null ; }
1393 # Checking CC version...
1394 if test "$_gcc_check" = yes ; then
1395 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1396 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1397 echocheck "$_cc version"
1398 cc_vendor=intel
1399 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1400 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1401 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1402 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1403 # TODO verify older icc/ecc compatibility
1404 case $cc_version in
1406 cc_version="v. ?.??, bad"
1407 cc_verc_fail=yes
1409 8.0|9.1|10.0|10.1)
1410 cc_version="$cc_version, ok"
1411 cc_verc_fail=no
1414 cc_version="$cc_version, bad"
1415 cc_verc_fail=yes
1417 esac
1418 echores "$cc_version"
1419 else
1420 for _cc in "$_cc" gcc cc ; do
1421 echocheck "$_cc version"
1422 cc_vendor=gnu
1423 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1424 cc_version=`$_cc -dumpversion 2>&1`
1425 if test "$?" -gt 0; then
1426 cc_version="not found"
1428 case $cc_version in
1430 cc_version="v. ?.??, bad"
1431 cc_verc_fail=yes
1433 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1434 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1435 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1436 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1437 cc_version="$cc_version, ok"
1438 cc_verc_fail=no
1440 'not found')
1441 cc_verc_fail=yes
1444 cc_version="$cc_version, bad"
1445 cc_verc_fail=yes
1447 esac
1448 echores "$cc_version"
1449 test "$cc_verc_fail" = "no" && break
1450 done
1451 fi # icc
1452 if test "$cc_verc_fail" = yes ; then
1453 cat <<EOF
1455 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1457 You are not using a supported compiler. We do not have the time to make sure
1458 everything works with compilers other than the ones we use. Use either the
1459 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1460 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1462 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1463 mplayer and lame (which is used for mencoder). If you get compile errors,
1464 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1465 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1466 bugs!
1468 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1471 die "Bad gcc version"
1473 else
1474 cat <<EOF
1476 ******************************************************************************
1478 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1479 Ok. You know. Do it.
1481 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1482 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1483 Lame which is used by mencoder produces weird errors, too.
1485 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1486 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1488 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1490 ******************************************************************************
1494 read _answer
1497 echocheck "host cc"
1498 test "$_host_cc" || _host_cc=$_cc
1499 echores $_host_cc
1501 echocheck "cross compilation"
1502 if test $_cross_compile = auto ; then
1503 cat > $TMPC << EOF
1504 int main(void) { return 0; }
1506 _cross_compile=yes
1507 cc_check && "$TMPEXE" && _cross_compile=no
1509 echores $_cross_compile
1511 if test $_cross_compile = yes; then
1512 tmp_run() {
1513 return 0
1517 # ---
1519 # now that we know what compiler should be used for compilation, try to find
1520 # out which assembler is used by the $_cc compiler
1521 if test "$_as" = auto ; then
1522 _as=`$_cc -print-prog-name=as`
1523 test -z "$_as" && _as=as
1526 # XXX: this should be ok..
1527 _cpuinfo="echo"
1529 if test "$_runtime_cpudetection" = no ; then
1531 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1532 # FIXME: Remove the cygwin check once AMD CPUs are supported
1533 if test -r /proc/cpuinfo && ! cygwin; then
1534 # Linux with /proc mounted, extract CPU information from it
1535 _cpuinfo="cat /proc/cpuinfo"
1536 elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then
1537 # FreeBSD with Linux emulation /proc mounted,
1538 # extract CPU information from it
1539 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1540 elif darwin && ! x86_32 ; then
1541 # use hostinfo on Darwin
1542 _cpuinfo="hostinfo"
1543 elif aix; then
1544 # use 'lsattr' on AIX
1545 _cpuinfo="lsattr -E -l proc0 -a type"
1546 elif x86; then
1547 # all other OSes try to extract CPU information from a small helper
1548 # program cpuinfo instead
1549 $_cc -o cpuinfo$_exesuf cpuinfo.c
1550 _cpuinfo="./cpuinfo$_exesuf"
1553 if x86 ; then
1554 # gather more CPU information
1555 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1556 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1557 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1558 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1559 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1561 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1563 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1564 -e s/xmm/sse/ -e s/kni/sse/`
1566 for ext in $pparam ; do
1567 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1568 done
1570 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1571 test $_sse = kernel_check && _mmxext=kernel_check
1573 echocheck "CPU vendor"
1574 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1576 echocheck "CPU type"
1577 echores "$pname"
1580 fi # test "$_runtime_cpudetection" = no
1582 if x86 && test "$_runtime_cpudetection" = no ; then
1583 extcheck() {
1584 if test "$1" = kernel_check ; then
1585 echocheck "kernel support of $2"
1586 cat > $TMPC <<EOF
1587 #include <signal.h>
1588 void catch() { exit(1); }
1589 int main(void){
1590 signal(SIGILL, catch);
1591 __asm__ __volatile__ ("$3":::"memory");return(0);
1595 if cc_check && tmp_run ; then
1596 eval _$2=yes
1597 echores "yes"
1598 _optimizing="$_optimizing $2"
1599 return 0
1600 else
1601 eval _$2=no
1602 echores "failed"
1603 echo "It seems that your kernel does not correctly support $2."
1604 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1605 return 1
1608 return 0
1611 extcheck $_mmx "mmx" "emms"
1612 extcheck $_mmxext "mmxext" "sfence"
1613 extcheck $_3dnow "3dnow" "femms"
1614 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1615 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1616 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1617 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1618 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1620 echocheck "mtrr support"
1621 if test "$_mtrr" = kernel_check ; then
1622 _mtrr="yes"
1623 _optimizing="$_optimizing mtrr"
1625 echores "$_mtrr"
1627 if test "$_gcc3_ext" != ""; then
1628 # if we had to disable sse/sse2 because the active kernel does not
1629 # support this instruction set extension, we also have to tell
1630 # gcc3 to not generate sse/sse2 instructions for normal C code
1631 cat > $TMPC << EOF
1632 int main(void) { return 0; }
1634 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1640 _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'
1641 case "$host_arch" in
1642 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1643 _arch='X86 X86_32'
1644 _target_arch_x86="ARCH_X86 = yes"
1645 _target_arch="ARCH_X86_32 = yes"
1646 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1647 iproc=486
1648 proc=i486
1651 if test "$_runtime_cpudetection" = no ; then
1652 case "$pvendor" in
1653 AuthenticAMD)
1654 case "$pfamily" in
1655 3) proc=i386 iproc=386 ;;
1656 4) proc=i486 iproc=486 ;;
1657 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1658 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1659 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1660 proc=k6-3
1661 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1662 proc=geode
1663 elif test "$pmodel" -ge 8; then
1664 proc=k6-2
1665 elif test "$pmodel" -ge 6; then
1666 proc=k6
1667 else
1668 proc=i586
1671 6) iproc=686
1672 # It's a bit difficult to determine the correct type of Family 6
1673 # AMD CPUs just from their signature. Instead, we check directly
1674 # whether it supports SSE.
1675 if test "$_sse" = yes; then
1676 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1677 proc=athlon-xp
1678 else
1679 # Again, gcc treats athlon and athlon-tbird similarly.
1680 proc=athlon
1683 15) iproc=686
1684 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1685 # caught and remedied in the optimization tests below.
1686 proc=k8
1689 *) proc=k8 iproc=686 ;;
1690 esac
1692 GenuineIntel)
1693 case "$pfamily" in
1694 3) proc=i386 iproc=386 ;;
1695 4) proc=i486 iproc=486 ;;
1696 5) iproc=586
1697 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1698 proc=pentium-mmx # 4 is desktop, 8 is mobile
1699 else
1700 proc=i586
1703 6) iproc=686
1704 if test "$pmodel" -ge 15; then
1705 proc=core2
1706 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1707 proc=pentium-m
1708 elif test "$pmodel" -ge 7; then
1709 proc=pentium3
1710 elif test "$pmodel" -ge 3; then
1711 proc=pentium2
1712 else
1713 proc=i686
1716 15) iproc=686
1717 # A nocona in 32-bit mode has no more capabilities than a prescott.
1718 if test "$pmodel" -ge 3; then
1719 proc=prescott
1720 else
1721 proc=pentium4
1723 test $_fast_cmov = "auto" && _fast_cmov=no
1725 *) proc=prescott iproc=686 ;;
1726 esac
1728 CentaurHauls)
1729 case "$pfamily" in
1730 5) iproc=586
1731 if test "$pmodel" -ge 8; then
1732 proc=winchip2
1733 elif test "$pmodel" -ge 4; then
1734 proc=winchip-c6
1735 else
1736 proc=i586
1739 6) iproc=686
1740 if test "$pmodel" -ge 9; then
1741 proc=c3-2
1742 else
1743 proc=c3
1744 iproc=586
1747 *) proc=i686 iproc=i686 ;;
1748 esac
1750 unknown)
1751 case "$pfamily" in
1752 3) proc=i386 iproc=386 ;;
1753 4) proc=i486 iproc=486 ;;
1754 *) proc=i586 iproc=586 ;;
1755 esac
1758 proc=i586 iproc=586 ;;
1759 esac
1760 fi # test "$_runtime_cpudetection" = no
1763 # check that gcc supports our CPU, if not, fall back to earlier ones
1764 # LGB: check -mcpu and -march swithing step by step with enabling
1765 # to fall back till 386.
1767 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1769 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1770 cpuopt=-mtune
1771 else
1772 cpuopt=-mcpu
1775 echocheck "GCC & CPU optimization abilities"
1776 cat > $TMPC << EOF
1777 int main(void) { return 0; }
1779 if test "$_runtime_cpudetection" = no ; then
1780 cc_check -march=native && proc=native
1781 if test "$proc" = "k8"; then
1782 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1784 if test "$proc" = "athlon-xp"; then
1785 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1787 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1788 cc_check -march=$proc $cpuopt=$proc || proc=k6
1790 if test "$proc" = "k6" || test "$proc" = "c3"; then
1791 if ! cc_check -march=$proc $cpuopt=$proc; then
1792 if cc_check -march=i586 $cpuopt=i686; then
1793 proc=i586-i686
1794 else
1795 proc=i586
1799 if test "$proc" = "prescott" ; then
1800 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1802 if test "$proc" = "core2" ; then
1803 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1805 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
1806 cc_check -march=$proc $cpuopt=$proc || proc=i686
1808 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1809 cc_check -march=$proc $cpuopt=$proc || proc=i586
1811 if test "$proc" = "i586"; then
1812 cc_check -march=$proc $cpuopt=$proc || proc=i486
1814 if test "$proc" = "i486" ; then
1815 cc_check -march=$proc $cpuopt=$proc || proc=i386
1817 if test "$proc" = "i386" ; then
1818 cc_check -march=$proc $cpuopt=$proc || proc=error
1820 if test "$proc" = "error" ; then
1821 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1822 _mcpu=""
1823 _march=""
1824 _optimizing=""
1825 elif test "$proc" = "i586-i686"; then
1826 _march="-march=i586"
1827 _mcpu="$cpuopt=i686"
1828 _optimizing="$proc"
1829 else
1830 _march="-march=$proc"
1831 _mcpu="$cpuopt=$proc"
1832 _optimizing="$proc"
1834 else # if test "$_runtime_cpudetection" = no
1835 _mcpu="$cpuopt=generic"
1836 # at least i486 required, for bswap instruction
1837 _march="-march=i486"
1838 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1839 cc_check $_mcpu || _mcpu=""
1840 cc_check $_march $_mcpu || _march=""
1843 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1844 ## autodetected mcpu/march parameters
1845 if test "$_target" ; then
1846 # TODO: it may be a good idea to check GCC and fall back in all cases
1847 if test "$host_arch" = "i586-i686"; then
1848 _march="-march=i586"
1849 _mcpu="$cpuopt=i686"
1850 else
1851 _march="-march=$host_arch"
1852 _mcpu="$cpuopt=$host_arch"
1855 proc="$host_arch"
1857 case "$proc" in
1858 i386) iproc=386 ;;
1859 i486) iproc=486 ;;
1860 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1861 i686|athlon*|pentium*) iproc=686 ;;
1862 *) iproc=586 ;;
1863 esac
1866 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1867 _fast_cmov="yes"
1868 else
1869 _fast_cmov="no"
1872 echores "$proc"
1875 ia64)
1876 _arch='IA64'
1877 _target_arch='ARCH_IA64 = yes'
1878 iproc='ia64'
1879 proc=''
1880 _march=''
1881 _mcpu=''
1882 _optimizing=''
1885 x86_64|amd64)
1886 _arch='X86 X86_64'
1887 _target_arch='ARCH_X86_64 = yes'
1888 _target_arch_x86="ARCH_X86 = yes"
1889 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1890 iproc='x86_64'
1892 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1893 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1894 cpuopt=-mtune
1895 else
1896 cpuopt=-mcpu
1898 if test "$_runtime_cpudetection" = no ; then
1899 case "$pvendor" in
1900 AuthenticAMD)
1901 proc=k8;;
1902 GenuineIntel)
1903 case "$pfamily" in
1904 6) proc=core2;;
1906 # 64-bit prescotts exist, but as far as GCC is concerned they
1907 # have the same capabilities as a nocona.
1908 proc=nocona
1909 test $_fast_cmov = "auto" && _fast_cmov=no
1911 esac
1914 proc=error;;
1915 esac
1916 fi # test "$_runtime_cpudetection" = no
1918 echocheck "GCC & CPU optimization abilities"
1919 cat > $TMPC << EOF
1920 int main(void) { return 0; }
1922 # This is a stripped-down version of the i386 fallback.
1923 if test "$_runtime_cpudetection" = no ; then
1924 cc_check -march=native && proc=native
1925 # --- AMD processors ---
1926 if test "$proc" = "k8"; then
1927 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1929 # This will fail if gcc version < 3.3, which is ok because earlier
1930 # versions don't really support 64-bit on amd64.
1931 # Is this a valid assumption? -Corey
1932 if test "$proc" = "athlon-xp"; then
1933 cc_check -march=$proc $cpuopt=$proc || proc=error
1935 # --- Intel processors ---
1936 if test "$proc" = "core2"; then
1937 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1939 if test "$proc" = "nocona"; then
1940 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1942 if test "$proc" = "pentium4"; then
1943 cc_check -march=$proc $cpuopt=$proc || proc=error
1946 _march="-march=$proc"
1947 _mcpu="$cpuopt=$proc"
1948 if test "$proc" = "error" ; then
1949 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1950 _mcpu=""
1951 _march=""
1953 else # if test "$_runtime_cpudetection" = no
1954 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1955 _march="-march=x86-64"
1956 _mcpu="$cpuopt=generic"
1957 cc_check $_mcpu || _mcpu="x86-64"
1958 cc_check $_mcpu || _mcpu=""
1959 cc_check $_march $_mcpu || _march=""
1962 _optimizing=""
1964 echores "$proc"
1967 sparc)
1968 _arch='SPARC'
1969 _target_arch='ARCH_SPARC = yes'
1970 iproc='sparc'
1971 if sunos ; then
1972 echocheck "CPU type"
1973 karch=`uname -m`
1974 case "`echo $karch`" in
1975 sun4) proc=v7 ;;
1976 sun4c) proc=v7 ;;
1977 sun4d) proc=v8 ;;
1978 sun4m) proc=v8 ;;
1979 sun4u) proc=ultrasparc _vis='yes' ;;
1980 sun4v) proc=v9 ;;
1981 *) proc=v8 ;;
1982 esac
1983 echores "$proc"
1984 else
1985 proc=v8
1987 _march=''
1988 _mcpu="-mcpu=$proc"
1989 _optimizing="$proc"
1992 sparc64)
1993 _arch='SPARC'
1994 _target_arch='ARCH_SPARC = yes'
1995 _vis='yes'
1996 iproc='sparc'
1997 proc='ultrasparc'
1998 _march=''
1999 _mcpu="-mcpu=$proc"
2000 _optimizing="$proc"
2003 arm|armv4l|armv5tel)
2004 _arch='ARM ARMV4L'
2005 _target_arch='ARCH_ARMV4L = yes'
2006 iproc='arm'
2007 proc=''
2008 _march=''
2009 _mcpu=''
2010 _optimizing=''
2013 sh3)
2014 _arch='SH3'
2015 _target_arch='ARCH_SH3 = yes'
2016 iproc='sh3'
2017 proc=''
2018 _march='-m3'
2019 _mcpu='-ml'
2020 _optimizing=''
2023 ppc|powerpc)
2024 _arch='POWERPC PPC'
2025 _def_dcbzl='#undef HAVE_DCBZL'
2026 _target_arch='ARCH_POWERPC = yes'
2027 iproc='ppc'
2028 proc=''
2029 _march=''
2030 _mcpu=''
2031 _optimizing=''
2033 echocheck "CPU type"
2034 case $system_name in
2035 Linux)
2036 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2037 if test -n "`$_cpuinfo | grep altivec`"; then
2038 test $_altivec = auto && _altivec=yes
2041 Darwin)
2042 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2043 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2044 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2045 test $_altivec = auto && _altivec=yes
2048 NetBSD)
2049 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2050 case $cc_version in
2051 2*|3.0*|3.1*|3.2*|3.3*)
2054 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2055 test $_altivec = auto && _altivec=yes
2058 esac
2060 AIX)
2061 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2063 esac
2064 if test "$_altivec" = yes; then
2065 echores "$proc altivec"
2066 else
2067 _altivec=no
2068 echores "$proc"
2071 echocheck "GCC & CPU optimization abilities"
2073 if test -n "$proc"; then
2074 case "$proc" in
2075 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2076 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2077 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2078 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2079 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2080 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2081 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2082 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2083 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2084 *) ;;
2085 esac
2086 # gcc 3.1(.1) and up supports 7400 and 7450
2087 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2088 case "$proc" in
2089 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2090 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2091 *) ;;
2092 esac
2094 # gcc 3.2 and up supports 970
2095 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2096 case "$proc" in
2097 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2098 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2099 *) ;;
2100 esac
2102 # gcc 3.3 and up supports POWER4
2103 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2104 case "$proc" in
2105 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2106 *) ;;
2107 esac
2109 # gcc 3.4 and up supports 440*
2110 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2111 case "$proc" in
2112 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2113 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2114 *) ;;
2115 esac
2117 # gcc 4.0 and up supports POWER5
2118 if test "$_cc_major" -ge "4"; then
2119 case "$proc" in
2120 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2121 *) ;;
2122 esac
2126 if test -n "$_mcpu"; then
2127 _optimizing=`echo $_mcpu | cut -c 8-`
2128 echores "$_optimizing"
2129 else
2130 echores "none"
2135 alpha)
2136 _arch='ALPHA'
2137 _target_arch='ARCH_ALPHA = yes'
2138 iproc='alpha'
2139 _march=''
2141 echocheck "CPU type"
2142 cat > $TMPC << EOF
2143 int main(void) {
2144 unsigned long ver, mask;
2145 asm ("implver %0" : "=r" (ver));
2146 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2147 printf("%ld-%x\n", ver, ~mask);
2148 return 0;
2151 $_cc -o "$TMPEXE" "$TMPC"
2152 case `"$TMPEXE"` in
2154 0-0) proc="ev4"; _mvi="0";;
2155 1-0) proc="ev5"; _mvi="0";;
2156 1-1) proc="ev56"; _mvi="0";;
2157 1-101) proc="pca56"; _mvi="1";;
2158 2-303) proc="ev6"; _mvi="1";;
2159 2-307) proc="ev67"; _mvi="1";;
2160 2-1307) proc="ev68"; _mvi="1";;
2161 esac
2162 echores "$proc"
2164 echocheck "GCC & CPU optimization abilities"
2165 if test "$proc" = "ev68" ; then
2166 cc_check -mcpu=$proc || proc=ev67
2168 if test "$proc" = "ev67" ; then
2169 cc_check -mcpu=$proc || proc=ev6
2171 _mcpu="-mcpu=$proc"
2172 echores "$proc"
2174 _optimizing="$proc"
2176 echocheck "MVI instruction support in GCC"
2177 if test "$_cc_major" -ge "3" && test "$_mvi" = "1" ; then
2178 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2179 echores "yes"
2180 else
2181 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2182 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2186 mips)
2187 _arch='SGI_MIPS'
2188 _target_arch='ARCH_SGI_MIPS = yes'
2189 iproc='sgi-mips'
2190 proc=''
2191 _march=''
2192 _mcpu=''
2193 _optimizing=''
2195 if irix ; then
2196 echocheck "CPU type"
2197 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2198 case "`echo $proc`" in
2199 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2200 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2201 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2202 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2203 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2204 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2205 esac
2206 # gcc < 3.x does not support -mtune.
2207 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2208 _mcpu=''
2210 echores "$proc"
2215 hppa)
2216 _arch='PA_RISC'
2217 _target_arch='ARCH_PA_RISC = yes'
2218 iproc='PA-RISC'
2219 proc=''
2220 _march=''
2221 _mcpu=''
2222 _optimizing=''
2225 s390)
2226 _arch='S390'
2227 _target_arch='ARCH_S390 = yes'
2228 iproc='390'
2229 proc=''
2230 _march=''
2231 _mcpu=''
2232 _optimizing=''
2235 s390x)
2236 _arch='S390X'
2237 _target_arch='ARCH_S390X = yes'
2238 iproc='390x'
2239 proc=''
2240 _march=''
2241 _mcpu=''
2242 _optimizing=''
2245 vax)
2246 _arch='VAX'
2247 _target_arch='ARCH_VAX = yes'
2248 iproc='vax'
2249 proc=''
2250 _march=''
2251 _mcpu=''
2252 _optimizing=''
2255 xtensa)
2256 _arch='XTENSA'
2257 _target_arch='ARCH_XTENSA = yes'
2258 iproc='xtensa'
2259 proc=''
2260 _march=''
2261 _mcpu=''
2262 _optimizing=''
2265 generic)
2266 _arch='GENERIC'
2267 _target_arch='ARCH_GENERIC = yes'
2268 iproc=''
2269 proc=''
2270 _march=''
2271 _mcpu=''
2272 _optimizing=''
2276 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2277 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2278 die "unsupported architecture $host_arch"
2280 esac # case "$host_arch" in
2282 if test "$_runtime_cpudetection" = yes ; then
2283 if x86 ; then
2284 test "$_cmov" != no && _cmov=yes
2285 x86_32 && _cmov=no
2286 test "$_mmx" != no && _mmx=yes
2287 test "$_3dnow" != no && _3dnow=yes
2288 test "$_3dnowext" != no && _3dnowext=yes
2289 test "$_mmxext" != no && _mmxext=yes
2290 test "$_sse" != no && _sse=yes
2291 test "$_sse2" != no && _sse2=yes
2292 test "$_ssse3" != no && _ssse3=yes
2293 test "$_mtrr" != no && _mtrr=yes
2295 if ppc; then
2296 _altivec=yes
2302 echocheck "assembler support of -pipe option"
2303 cat > $TMPC << EOF
2304 int main(void) { return 0; }
2306 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2309 echocheck "compiler support of named assembler arguments"
2310 _named_asm_args=yes
2311 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2312 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2313 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2314 _named_asm_args=no
2315 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2317 echores $_named_asm_args
2320 if darwin && test "$cc_vendor" = "gnu" ; then
2321 echocheck "GCC support of -mstackrealign"
2322 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2323 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2324 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2325 # wrong code with this flag, but this can be worked around by adding
2326 # -fno-unit-at-a-time as described in the blog post at
2327 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2328 cat > $TMPC << EOF
2329 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2330 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2332 cc_check -O4 -mstackrealign && tmp_run && _stackrealign=-mstackrealign
2333 test -z "$_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2334 && tmp_run && _stackrealign="-mstackrealign -fno-unit-at-a-time"
2335 test -n "$_stackrealign" && echores "yes" || echores "no"
2336 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2339 # Checking for CFLAGS
2340 _install_strip="-s"
2341 if test "$_profile" != "" || test "$_debug" != "" ; then
2342 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2343 _install_strip=
2344 elif test -z "$CFLAGS" ; then
2345 if test "$cc_vendor" = "intel" ; then
2346 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2347 elif test "$cc_vendor" != "gnu" ; then
2348 CFLAGS="-O2 $_march $_mcpu $_pipe"
2349 else
2350 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2352 else
2353 _warn_CFLAGS=yes
2355 if test -n "$LDFLAGS" ; then
2356 _ld_extra="$_ld_extra $LDFLAGS"
2357 _warn_CFLAGS=yes
2358 elif test "$cc_vendor" = "intel" ; then
2359 _ld_extra="$_ld_extra -i-static"
2361 if test -n "$CPPFLAGS" ; then
2362 _inc_extra="$_inc_extra $CPPFLAGS"
2363 _warn_CFLAGS=yes
2368 if x86_32 ; then
2369 # Checking assembler (_as) compatibility...
2370 # Added workaround for older as that reads from stdin by default - atmos
2371 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2372 echocheck "assembler ($_as $as_version)"
2374 _pref_as_version='2.9.1'
2375 echo 'nop' > $TMPS
2376 if test "$_mmx" = yes ; then
2377 echo 'emms' >> $TMPS
2379 if test "$_3dnow" = yes ; then
2380 _pref_as_version='2.10.1'
2381 echo 'femms' >> $TMPS
2383 if test "$_3dnowext" = yes ; then
2384 _pref_as_version='2.10.1'
2385 echo 'pswapd %mm0, %mm0' >> $TMPS
2387 if test "$_mmxext" = yes ; then
2388 _pref_as_version='2.10.1'
2389 echo 'movntq %mm0, (%eax)' >> $TMPS
2391 if test "$_sse" = yes ; then
2392 _pref_as_version='2.10.1'
2393 echo 'xorps %xmm0, %xmm0' >> $TMPS
2395 #if test "$_sse2" = yes ; then
2396 # _pref_as_version='2.11'
2397 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2399 if test "$_cmov" = yes ; then
2400 _pref_as_version='2.10.1'
2401 echo 'cmovb %eax, %ebx' >> $TMPS
2403 if test "$_ssse3" = yes ; then
2404 _pref_as_version='2.16.92'
2405 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2407 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2409 if test "$as_verc_fail" != yes ; then
2410 echores "ok"
2411 else
2412 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2413 echores "failed"
2414 die "obsolete binutils version"
2417 fi #if x86_32
2419 echocheck ".align is a power of two"
2420 if test "$_asmalign_pot" = auto ; then
2421 _asmalign_pot=no
2422 cat > $TMPC << EOF
2423 main(void) { asm (".align 3"); }
2425 cc_check && _asmalign_pot=yes
2427 if test "$_asmalign_pot" = "yes" ; then
2428 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2429 else
2430 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2432 echores $_asmalign_pot
2435 #FIXME: This should happen before the check for CFLAGS..
2436 if ppc ; then
2438 # check if altivec is supported by the compiler, and how to enable it
2440 _altivec_gcc_flags=''
2442 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2443 echocheck "GCC altivec support"
2445 p=''
2446 cat > $TMPC << EOF
2447 int main(void) {
2448 return 0;
2451 FSF_flags='-maltivec -mabi=altivec'
2452 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2454 # check for Darwin-style flags first, since
2455 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2456 # accepts but ignores FSF-style flags...
2458 if test -z "$p"; then
2459 cc_check $Darwin_flags && p='Darwin'
2461 if test -z "$p"; then
2462 cc_check $FSF_flags && p='FSF'
2465 case $p in
2466 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2467 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2468 *) _altivec=no ;;
2469 esac
2471 if test -z "$p"; then
2472 p=none
2473 else
2474 p="$p-style ($_altivec_gcc_flags)"
2477 echores "$p"
2480 # check if <altivec.h> should be included
2482 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2484 if test "$_altivec" = yes ; then
2485 echocheck "altivec.h"
2486 cat > $TMPC << EOF
2487 #include <altivec.h>
2488 int main(void) { return 0; }
2490 _have_altivec_h=no
2491 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2492 if test "$_have_altivec_h" = yes ; then
2493 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2495 echores "$_have_altivec_h"
2498 # disable runtime cpudetection if
2499 # - we cannot generate altivec code
2500 # - altivec is disabled by the user
2502 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2503 _runtime_cpudetection=no
2506 # show that we are optimizing for altivec (if enabled and supported)
2508 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2509 _optimizing="$_optimizing altivec"
2512 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2514 if test "$_altivec" = yes ; then
2515 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2516 #_mcpu="$_mcpu $_altivec_gcc_flags"
2517 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2521 if arm ; then
2522 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2523 if test $_armv5te = "auto" ; then
2524 cat > $TMPC << EOF
2525 int main(void) {
2526 __asm__ __volatile__ ("qadd r0, r0, r0");
2529 _armv5te=no
2530 cc_check && _armv5te=yes
2532 echores "$_armv5te"
2534 echocheck "ARMv6 (SIMD instructions)"
2535 if test $_armv6 = "auto" ; then
2536 cat > $TMPC << EOF
2537 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2539 _armv6=no
2540 cc_check && _armv6=yes
2542 echores "$_armv6"
2544 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2545 if test $_iwmmxt = "auto" ; then
2546 cat > $TMPC << EOF
2547 int main(void) {
2548 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2551 _iwmmxt=no
2552 cc_check && _iwmmxt=yes
2554 echores "$_iwmmxt"
2557 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
2558 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2559 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2560 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2561 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2562 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2563 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2564 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2565 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2566 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2567 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2568 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2569 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2570 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2571 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2572 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2574 # Checking kernel version...
2575 if x86_32 && linux ; then
2576 _k_verc_problem=no
2577 kernel_version=`uname -r 2>&1`
2578 echocheck "$system_name kernel version"
2579 case "$kernel_version" in
2580 '') kernel_version="?.??"; _k_verc_fail=yes;;
2581 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2582 _k_verc_problem=yes;;
2583 esac
2584 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2585 _k_verc_fail=yes
2587 if test "$_k_verc_fail" ; then
2588 echores "$kernel_version, fail"
2589 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2590 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2591 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2592 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2593 echo "2.2.x you must upgrade it to get SSE support!"
2594 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2595 else
2596 echores "$kernel_version, ok"
2600 ######################
2601 # MAIN TESTS GO HERE #
2602 ######################
2605 echocheck "-lposix"
2606 cat > $TMPC <<EOF
2607 int main(void) { return 0; }
2609 if cc_check -lposix ; then
2610 _ld_extra="$_ld_extra -lposix"
2611 echores "yes"
2612 else
2613 echores "no"
2616 echocheck "-lm"
2617 cat > $TMPC <<EOF
2618 int main(void) { return 0; }
2620 if cc_check -lm ; then
2621 _ld_lm="-lm"
2622 echores "yes"
2623 else
2624 _ld_lm=""
2625 echores "no"
2629 echocheck "langinfo"
2630 if test "$_langinfo" = auto ; then
2631 cat > $TMPC <<EOF
2632 #include <langinfo.h>
2633 int main(void) { nl_langinfo(CODESET); return 0; }
2635 _langinfo=no
2636 cc_check && _langinfo=yes
2638 if test "$_langinfo" = yes ; then
2639 _def_langinfo='#define USE_LANGINFO 1'
2640 else
2641 _def_langinfo='#undef USE_LANGINFO'
2643 echores "$_langinfo"
2646 echocheck "language"
2647 test -z "$_language" && _language=$LINGUAS
2648 _language=`echo $_language | sed 's/,/ /g'`
2649 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2650 for lang in $_language ; do
2651 test "$lang" = all && lang=en
2652 if test -f "help/help_mp-${lang}.h" ; then
2653 _language=$lang
2654 break
2655 else
2656 echo ${_echo_n} "$lang not found, ${_echo_c}"
2657 _language=`echo $_language | sed "s/$lang *//"`
2659 done
2660 test -z "$_language" && _language=en
2661 _mp_help="help/help_mp-${_language}.h"
2662 test -f $_mp_help || die "$_mp_help not found"
2663 for lang in $LANGUAGES ; do
2664 if test -f "DOCS/man/$lang/mplayer.1" ; then
2665 MAN_LANG="$lang $MAN_LANG"
2667 done
2668 _doc_lang=$_language
2669 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2670 echores "using $_language (man pages: $MAN_LANG)"
2673 echocheck "enable sighandler"
2674 if test "$_sighandler" = yes ; then
2675 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2676 else
2677 _def_sighandler='#undef ENABLE_SIGHANDLER'
2679 echores "$_sighandler"
2681 echocheck "runtime cpudetection"
2682 if test "$_runtime_cpudetection" = yes ; then
2683 _optimizing="Runtime CPU-Detection enabled"
2684 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2685 else
2686 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2688 echores "$_runtime_cpudetection"
2691 echocheck "restrict keyword"
2692 for restrict_keyword in restrict __restrict __restrict__ ; do
2693 echo "void foo(char * $restrict_keyword p); int main(void){}" > $TMPC
2694 if cc_check; then
2695 _def_restrict_keyword=$restrict_keyword
2696 break;
2698 done
2699 if [ -n "$_def_restrict_keyword" ]; then
2700 echores "$_def_restrict_keyword"
2701 else
2702 echores "none"
2704 # Avoid infinite recursion loop ("#define restrict restrict")
2705 if [ "$_def_restrict_keyword" != "restrict" ]; then
2706 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2707 else
2708 _def_restrict_keyword=""
2712 echocheck "__builtin_expect"
2713 # GCC branch prediction hint
2714 cat > $TMPC << EOF
2715 int foo (int a) {
2716 a = __builtin_expect (a, 10);
2717 return a == 10 ? 0 : 1;
2719 int main(void) { return foo(10) && foo(0); }
2721 _builtin_expect=no
2722 cc_check && _builtin_expect=yes
2723 if test "$_builtin_expect" = yes ; then
2724 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2725 else
2726 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2728 echores "$_builtin_expect"
2731 echocheck "kstat"
2732 cat > $TMPC << EOF
2733 #include <kstat.h>
2734 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2736 _kstat=no
2737 cc_check -lkstat && _kstat=yes
2738 if test "$_kstat" = yes ; then
2739 _def_kstat="#define HAVE_LIBKSTAT 1"
2740 _ld_extra="$_ld_extra -lkstat"
2741 else
2742 _def_kstat="#undef HAVE_LIBKSTAT"
2744 echores "$_kstat"
2747 echocheck "posix4"
2748 # required for nanosleep on some systems
2749 cat > $TMPC << EOF
2750 #include <time.h>
2751 int main(void) { (void) nanosleep(0, 0); return 0; }
2753 _posix4=no
2754 cc_check -lposix4 && _posix4=yes
2755 if test "$_posix4" = yes ; then
2756 _ld_extra="$_ld_extra -lposix4"
2758 echores "$_posix4"
2760 for func in llrint lrint lrintf round roundf; do
2761 echocheck $func
2762 cat > $TMPC << EOF
2763 #include <math.h>
2764 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
2766 eval _$func=no
2767 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2768 if eval test "x\$_$func" = "xyes"; then
2769 eval _def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 1\""
2770 echores yes
2771 else
2772 eval _def_$func="\"#undef HAVE_`echo $func | tr '[a-z]' '[A-Z]'`\""
2773 echores no
2775 done
2778 echocheck "mkstemp"
2779 cat > $TMPC << EOF
2780 #include <stdlib.h>
2781 int main(void) { char a; mkstemp(&a); return 0; }
2783 _mkstemp=no
2784 cc_check && _mkstemp=yes
2785 if test "$_mkstemp" = yes ; then
2786 _def_mkstemp='#define HAVE_MKSTEMP 1'
2787 else
2788 _def_mkstemp='#undef HAVE_MKSTEMP'
2790 echores "$_mkstemp"
2793 echocheck "nanosleep"
2794 # also check for nanosleep
2795 cat > $TMPC << EOF
2796 #include <time.h>
2797 int main(void) { (void) nanosleep(0, 0); return 0; }
2799 _nanosleep=no
2800 cc_check && _nanosleep=yes
2801 if test "$_nanosleep" = yes ; then
2802 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2803 else
2804 _def_nanosleep='#undef HAVE_NANOSLEEP'
2806 echores "$_nanosleep"
2809 echocheck "socklib"
2810 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2811 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2812 cat > $TMPC << EOF
2813 #include <netdb.h>
2814 #include <sys/socket.h>
2815 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2817 _socklib=no
2818 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2819 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2820 done
2821 if test $_winsock2 = auto && ! cygwin ; then
2822 _winsock2=no
2823 cat > $TMPC << EOF
2824 #include <winsock2.h>
2825 int main(void) { (void) gethostbyname(0); return 0; }
2827 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2829 test "$_ld_sock" && _res_comment="using $_ld_sock"
2830 echores "$_socklib"
2833 if test $_winsock2 = yes ; then
2834 _ld_sock="-lws2_32"
2835 _def_winsock2='#define HAVE_WINSOCK2 1'
2836 else
2837 _def_winsock2='#undef HAVE_WINSOCK2'
2841 _use_aton=no
2842 echocheck "inet_pton()"
2843 cat > $TMPC << EOF
2844 #include <sys/types.h>
2845 #include <sys/socket.h>
2846 #include <arpa/inet.h>
2847 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2849 if test "$_winsock2" = yes ; then
2850 _res_comment="using winsock2 functions instead"
2851 echores "no"
2852 elif cc_check $_ld_sock ; then
2853 # NOTE: Linux has libresolv but does not need it
2855 _res_comment="using $_ld_sock"
2856 echores "yes"
2857 elif cc_check $_ld_sock -lresolv ; then
2858 # NOTE: needed for SunOS at least
2859 _ld_sock="$_ld_sock -lresolv"
2860 _res_comment="using $_ld_sock"
2861 echores "yes"
2862 else
2863 _res_comment="trying inet_aton next"
2864 echores "no"
2866 echocheck "inet_aton()"
2867 cat > $TMPC << EOF
2868 #include <sys/types.h>
2869 #include <sys/socket.h>
2870 #include <arpa/inet.h>
2871 int main(void) { (void) inet_aton(0, 0); return 0; }
2873 _use_aton=yes
2874 if cc_check $_ld_sock ; then
2875 # NOTE: Linux has libresolv but does not need it
2877 _res_comment="using $_ld_sock"
2878 elif cc_check $_ld_sock -lresolv ; then
2879 # NOTE: needed for SunOS at least
2880 _ld_sock="$_ld_sock -lresolv"
2881 _res_comment="using $_ld_sock"
2882 else
2883 _use_aton=no
2884 _network=no
2885 _res_comment="network support disabled"
2887 echores "$_use_aton"
2890 _def_use_aton='#undef USE_ATON'
2891 if test "$_use_aton" = yes; then
2892 _def_use_aton='#define USE_ATON 1'
2895 echocheck "network"
2896 # FIXME network check
2897 if test "$_network" = yes ; then
2898 _def_network='#define MPLAYER_NETWORK 1'
2899 _ld_extra="$_ld_extra $_ld_sock"
2900 _inputmodules="network $_inputmodules"
2901 else
2902 _noinputmodules="network $_noinputmodules"
2903 _def_network='#undef MPLAYER_NETWORK'
2904 _ftp=no
2906 echores "$_network"
2908 echocheck "inttypes.h (required)"
2909 cat > $TMPC << EOF
2910 #include <inttypes.h>
2911 int main(void) { return 0; }
2913 _inttypes=no
2914 cc_check && _inttypes=yes
2915 echores "$_inttypes"
2917 if test "$_inttypes" = no ; then
2918 echocheck "bitypes.h (inttypes.h predecessor)"
2919 cat > $TMPC << EOF
2920 #include <sys/bitypes.h>
2921 int main(void) { return 0; }
2923 cc_check && _inttypes=yes
2924 if test "$_inttypes" = yes ; then
2925 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."
2926 else
2927 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2932 echocheck "int_fastXY_t in inttypes.h"
2933 cat > $TMPC << EOF
2934 #include <inttypes.h>
2935 int main(void) {
2936 volatile int_fast16_t v= 0;
2937 return v; }
2939 _fast_inttypes=no
2940 cc_check && _fast_inttypes=yes
2941 if test "$_fast_inttypes" = no ; then
2942 _def_fast_inttypes='
2943 typedef signed char int_fast8_t;
2944 typedef signed int int_fast16_t;
2945 typedef signed int int_fast32_t;
2946 typedef signed long long int_fast64_t;
2947 typedef unsigned char uint_fast8_t;
2948 typedef unsigned int uint_fast16_t;
2949 typedef unsigned int uint_fast32_t;
2950 typedef unsigned long long uint_fast64_t;'
2952 echores "$_fast_inttypes"
2955 echocheck "word size"
2956 _mp_wordsize="#undef MP_WORDSIZE"
2957 cat > $TMPC << EOF
2958 #include <stdio.h>
2959 #include <sys/types.h>
2960 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2962 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2963 echores "$_wordsize"
2966 echocheck "malloc.h"
2967 cat > $TMPC << EOF
2968 #include <malloc.h>
2969 int main(void) { (void) malloc(0); return 0; }
2971 _malloc=no
2972 cc_check && _malloc=yes
2973 if test "$_malloc" = yes ; then
2974 _def_malloc='#define HAVE_MALLOC_H 1'
2975 else
2976 _def_malloc='#undef HAVE_MALLOC_H'
2978 # malloc.h emits a warning in FreeBSD and OpenBSD
2979 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2980 echores "$_malloc"
2983 echocheck "memalign()"
2984 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2985 cat > $TMPC << EOF
2986 #include <malloc.h>
2987 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2989 _memalign=no
2990 cc_check && _memalign=yes
2991 if test "$_memalign" = yes ; then
2992 _def_memalign='#define HAVE_MEMALIGN 1'
2993 else
2994 _def_memalign='#undef HAVE_MEMALIGN'
2995 _def_map_memalign='#define memalign(a,b) malloc(b)'
2996 darwin || _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2998 echores "$_memalign"
3001 echocheck "alloca.h"
3002 cat > $TMPC << EOF
3003 #include <alloca.h>
3004 int main(void) { (void) alloca(0); return 0; }
3006 _alloca=no
3007 cc_check && _alloca=yes
3008 if cc_check ; then
3009 _def_alloca='#define HAVE_ALLOCA_H 1'
3010 else
3011 _def_alloca='#undef HAVE_ALLOCA_H'
3013 echores "$_alloca"
3016 echocheck "mman.h"
3017 cat > $TMPC << EOF
3018 #include <sys/types.h>
3019 #include <sys/mman.h>
3020 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3022 _mman=no
3023 cc_check && _mman=yes
3024 if test "$_mman" = yes ; then
3025 _def_mman='#define HAVE_SYS_MMAN_H 1'
3026 else
3027 _def_mman='#undef HAVE_SYS_MMAN_H'
3029 echores "$_mman"
3031 cat > $TMPC << EOF
3032 #include <sys/types.h>
3033 #include <sys/mman.h>
3034 int main(void) { void *p = MAP_FAILED; return 0; }
3036 _mman_has_map_failed=no
3037 cc_check && _mman_has_map_failed=yes
3038 if test "$_mman_has_map_failed" = yes ; then
3039 _def_mman_has_map_failed=''
3040 else
3041 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3044 echocheck "dynamic loader"
3045 cat > $TMPC << EOF
3046 #include <dlfcn.h>
3047 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3049 _dl=no
3050 for _ld_tmp in "" "-ldl" ; do
3051 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3052 done
3053 if test "$_dl" = yes ; then
3054 _def_dl='#define HAVE_LIBDL 1'
3055 else
3056 _def_dl='#undef HAVE_LIBDL'
3058 echores "$_dl"
3061 echocheck "dynamic a/v plugins support"
3062 if test "$_dl" = no ; then
3063 _dynamic_plugins=no
3065 if test "$_dynamic_plugins" = yes ; then
3066 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3067 else
3068 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3070 echores "$_dynamic_plugins"
3073 _def_threads='#undef HAVE_THREADS'
3075 echocheck "pthread"
3076 if test "$_pthreads" = auto ; then
3077 cat > $TMPC << EOF
3078 #include <pthread.h>
3079 void* func(void *arg) { return arg; }
3080 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3082 _pthreads=no
3083 if ! hpux ; then
3084 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3085 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3086 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3087 done
3090 if test "$_pthreads" = yes ; then
3091 _res_comment="using $_ld_pthread"
3092 _def_pthreads='#define HAVE_PTHREADS 1'
3093 _def_threads='#define HAVE_THREADS 1'
3094 else
3095 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3096 _def_pthreads='#undef HAVE_PTHREADS'
3097 _nas=no ; _tv_v4l1=no ; _macosx=no
3098 mingw32 || _win32dll=no
3100 echores "$_pthreads"
3102 echocheck "w32threads"
3103 if test "$_pthreads" = yes ; then
3104 _res_comment="using pthread instead"
3105 _w32threads=no
3107 if test "$_w32threads" = auto ; then
3108 _w32threads=no
3109 mingw32 && _w32threads=yes
3111 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3112 echores "$_w32threads"
3114 echocheck "rpath"
3115 netbsd &&_rpath=yes
3116 if test "$_rpath" = yes ; then
3117 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3118 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3119 done
3120 _ld_extra=$tmp
3122 echores "$_rpath"
3124 echocheck "iconv"
3125 if test "$_iconv" = auto ; then
3126 cat > $TMPC << EOF
3127 #include <stdio.h>
3128 #include <unistd.h>
3129 #include <iconv.h>
3130 #define INBUFSIZE 1024
3131 #define OUTBUFSIZE 4096
3133 char inbuffer[INBUFSIZE];
3134 char outbuffer[OUTBUFSIZE];
3136 int main(void) {
3137 size_t numread;
3138 iconv_t icdsc;
3139 char *tocode="UTF-8";
3140 char *fromcode="cp1250";
3141 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3142 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3143 char *iptr=inbuffer;
3144 char *optr=outbuffer;
3145 size_t inleft=numread;
3146 size_t outleft=OUTBUFSIZE;
3147 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3148 != (size_t)(-1)) {
3149 write (1, outbuffer, OUTBUFSIZE - outleft);
3152 if (iconv_close(icdsc) == -1)
3157 _iconv=no
3158 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3159 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3160 _iconv=yes && break
3161 done
3163 if test "$_iconv" = yes ; then
3164 _def_iconv='#define USE_ICONV 1'
3165 else
3166 _def_iconv='#undef USE_ICONV'
3168 echores "$_iconv"
3171 echocheck "soundcard.h"
3172 _soundcard_h=no
3173 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3174 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3175 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3176 cat > $TMPC << EOF
3177 #include <$_soundcard_header>
3178 int main(void) { return 0; }
3180 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3181 done
3183 if test "$_soundcard_h" = yes ; then
3184 if test $_soundcard_header = "sys/soundcard.h"; then
3185 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3186 else
3187 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3190 echores "$_soundcard_h"
3193 echocheck "sys/dvdio.h"
3194 cat > $TMPC << EOF
3195 #include <unistd.h>
3196 #include <sys/dvdio.h>
3197 int main(void) { return 0; }
3199 _dvdio=no
3200 cc_check && _dvdio=yes
3201 if test "$_dvdio" = yes ; then
3202 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3203 else
3204 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3206 echores "$_dvdio"
3209 echocheck "sys/cdio.h"
3210 cat > $TMPC << EOF
3211 #include <unistd.h>
3212 #include <sys/cdio.h>
3213 int main(void) { return 0; }
3215 _cdio=no
3216 cc_check && _cdio=yes
3217 if test "$_cdio" = yes ; then
3218 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3219 else
3220 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3222 echores "$_cdio"
3225 echocheck "linux/cdrom.h"
3226 cat > $TMPC << EOF
3227 #include <sys/types.h>
3228 #include <linux/cdrom.h>
3229 int main(void) { return 0; }
3231 _cdrom=no
3232 cc_check && _cdrom=yes
3233 if test "$_cdrom" = yes ; then
3234 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3235 else
3236 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3238 echores "$_cdrom"
3241 echocheck "dvd.h"
3242 cat > $TMPC << EOF
3243 #include <dvd.h>
3244 int main(void) { return 0; }
3246 _dvd=no
3247 cc_check && _dvd=yes
3248 if test "$_dvd" = yes ; then
3249 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3250 else
3251 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3253 echores "$_dvd"
3256 if bsdos; then
3257 echocheck "BSDI dvd.h"
3258 cat > $TMPC << EOF
3259 #include <dvd.h>
3260 int main(void) { return 0; }
3262 _bsdi_dvd=no
3263 cc_check && _bsdi_dvd=yes
3264 if test "$_bsdi_dvd" = yes ; then
3265 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3266 else
3267 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3269 echores "$_bsdi_dvd"
3270 fi #if bsdos
3273 if hpux; then
3274 # also used by AIX, but AIX does not support VCD and/or libdvdread
3275 echocheck "HP-UX SCSI header"
3276 cat > $TMPC << EOF
3277 #include <sys/scsi.h>
3278 int main(void) { return 0; }
3280 _hpux_scsi_h=no
3281 cc_check && _hpux_scsi_h=yes
3282 if test "$_hpux_scsi_h" = yes ; then
3283 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3284 else
3285 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3287 echores "$_hpux_scsi_h"
3288 fi #if hpux
3291 if sunos; then
3292 echocheck "userspace SCSI headers (Solaris)"
3293 cat > $TMPC << EOF
3294 # include <unistd.h>
3295 # include <stropts.h>
3296 # include <sys/scsi/scsi_types.h>
3297 # include <sys/scsi/impl/uscsi.h>
3298 int main(void) { return 0; }
3300 _sol_scsi_h=no
3301 cc_check && _sol_scsi_h=yes
3302 if test "$_sol_scsi_h" = yes ; then
3303 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3304 else
3305 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3307 echores "$_sol_scsi_h"
3308 fi #if sunos
3311 echocheck "termcap"
3312 if test "$_termcap" = auto ; then
3313 cat > $TMPC <<EOF
3314 int main(void) { tgetent(); return 0; }
3316 _termcap=no
3317 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3318 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3319 && _termcap=yes && break
3320 done
3322 if test "$_termcap" = yes ; then
3323 _def_termcap='#define USE_TERMCAP 1'
3324 _res_comment="using $_ld_tmp"
3325 else
3326 _def_termcap='#undef USE_TERMCAP'
3328 echores "$_termcap"
3331 echocheck "termios"
3332 _def_termios='#undef HAVE_TERMIOS'
3333 _def_termios_h='#undef HAVE_TERMIOS_H'
3334 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3335 if test "$_termios" = auto ; then
3336 _termios=no
3337 for _termios_header in "sys/termios.h" "termios.h"; do
3338 cat > $TMPC <<EOF
3339 #include <$_termios_header>
3340 int main(void) { return 0; }
3342 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3343 done
3346 if test "$_termios" = yes ; then
3347 _def_termios='#define HAVE_TERMIOS 1'
3348 if test "$_termios_header" = "termios.h" ; then
3349 _def_termios_h='#define HAVE_TERMIOS_H 1'
3350 else
3351 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3354 echores "$_termios"
3357 echocheck "shm"
3358 if test "$_shm" = auto ; then
3359 cat > $TMPC << EOF
3360 #include <sys/types.h>
3361 #include <sys/shm.h>
3362 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3364 _shm=no
3365 cc_check && _shm=yes
3367 if test "$_shm" = yes ; then
3368 _def_shm='#define HAVE_SHM 1'
3369 else
3370 _def_shm='#undef HAVE_SHM'
3372 echores "$_shm"
3375 echocheck "strsep()"
3376 cat > $TMPC << EOF
3377 #include <string.h>
3378 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3380 _strsep=no
3381 cc_check && _strsep=yes
3382 if test "$_strsep" = yes ; then
3383 _def_strsep='#define HAVE_STRSEP 1'
3384 _need_strsep=no
3385 else
3386 _def_strsep='#undef HAVE_STRSEP'
3387 _need_strsep=yes
3389 echores "$_strsep"
3392 echocheck "vsscanf()"
3393 cat > $TMPC << EOF
3394 #include <stdarg.h>
3395 int main(void) { vsscanf(0, 0, 0); return 0; }
3397 _vsscanf=no
3398 cc_check && _vsscanf=yes
3399 if test "$_vsscanf" = yes ; then
3400 _def_vsscanf='#define HAVE_VSSCANF 1'
3401 _need_vsscanf=no
3402 else
3403 _def_vsscanf='#undef HAVE_VSSCANF'
3404 _need_vsscanf=yes
3406 echores "$_vsscanf"
3409 echocheck "swab()"
3410 cat > $TMPC << EOF
3411 #include <unistd.h>
3412 int main(void) { swab(0, 0, 0); return 0; }
3414 _swab=no
3415 cc_check && _swab=yes
3416 if test "$_swab" = yes ; then
3417 _def_swab='#define HAVE_SWAB 1'
3418 _need_swab=no
3419 else
3420 _def_swab='#undef HAVE_SWAB'
3421 _need_swab=yes
3423 echores "$_swab"
3425 echocheck "POSIX select()"
3426 cat > $TMPC << EOF
3427 #include <stdio.h>
3428 #include <stdlib.h>
3429 #include <sys/types.h>
3430 #include <string.h>
3431 #include <sys/time.h>
3432 #include <unistd.h>
3433 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3435 _posix_select=no
3436 _def_posix_select='#undef HAVE_POSIX_SELECT'
3437 cc_check && _posix_select=yes \
3438 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3439 echores "$_posix_select"
3442 echocheck "gettimeofday()"
3443 cat > $TMPC << EOF
3444 #include <stdio.h>
3445 #include <sys/time.h>
3446 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3448 _gettimeofday=no
3449 cc_check && _gettimeofday=yes
3450 if test "$_gettimeofday" = yes ; then
3451 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3452 _need_gettimeofday=no
3453 else
3454 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3455 _need_gettimeofday=yes
3457 echores "$_gettimeofday"
3460 echocheck "glob()"
3461 cat > $TMPC << EOF
3462 #include <stdio.h>
3463 #include <glob.h>
3464 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3466 _glob=no
3467 cc_check && _glob=yes
3468 if test "$_glob" = yes ; then
3469 _def_glob='#define HAVE_GLOB 1'
3470 _need_glob=no
3471 else
3472 _def_glob='#undef HAVE_GLOB'
3473 _need_glob=yes
3475 echores "$_glob"
3478 echocheck "setenv()"
3479 cat > $TMPC << EOF
3480 #include <stdlib.h>
3481 int main (void){ setenv("","",0); return 0; }
3483 _setenv=no
3484 cc_check && _setenv=yes
3485 if test "$_setenv" = yes ; then
3486 _def_setenv='#define HAVE_SETENV 1'
3487 _need_setenv=no
3488 else
3489 _def_setenv='#undef HAVE_SETENV'
3490 _need_setenv=yes
3492 echores "$_setenv"
3495 if sunos; then
3496 echocheck "sysi86()"
3497 cat > $TMPC << EOF
3498 #include <sys/sysi86.h>
3499 int main (void) { sysi86(0); return 0; }
3501 _sysi86=no
3502 cc_check && _sysi86=yes
3503 if test "$_sysi86" = yes ; then
3504 _def_sysi86='#define HAVE_SYSI86 1'
3505 cat > $TMPC << EOF
3506 #include <sys/sysi86.h>
3507 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3509 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3510 else
3511 _def_sysi86='#undef HAVE_SYSI86'
3513 echores "$_sysi86"
3514 fi #if sunos
3517 echocheck "sys/sysinfo.h"
3518 cat > $TMPC << EOF
3519 #include <sys/sysinfo.h>
3520 int main(void) {
3521 struct sysinfo s_info;
3522 sysinfo(&s_info);
3523 return 0;
3526 _sys_sysinfo=no
3527 cc_check && _sys_sysinfo=yes
3528 if test "$_sys_sysinfo" = yes ; then
3529 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3530 else
3531 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3533 echores "$_sys_sysinfo"
3536 if darwin; then
3538 echocheck "Mac OS X APIs"
3539 if test "$_macosx" = auto ; then
3540 productName=`/usr/bin/sw_vers -productName`
3541 if test "$productName" = "Mac OS X" ||
3542 test "$productName" = "Mac OS X Server" ; then
3543 _macosx=yes
3544 else
3545 _macosx=no
3546 _def_macosx='#undef MACOSX'
3547 _noaomodules="macosx $_noaomodules"
3548 _novomodules="quartz $_novomodules"
3551 if test "$_macosx" = yes ; then
3552 cat > $TMPC <<EOF
3553 #include <Carbon/Carbon.h>
3554 #include <QuickTime/QuickTime.h>
3555 #include <CoreAudio/CoreAudio.h>
3556 int main(void) {
3557 EnterMovies();
3558 ExitMovies();
3559 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3562 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3563 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3564 _def_macosx='#define MACOSX 1'
3565 _aosrc="$_aosrc ao_macosx.c"
3566 _aomodules="macosx $_aomodules"
3567 _vosrc="$_vosrc vo_quartz.c"
3568 _vomodules="quartz $_vomodules"
3569 else
3570 _macosx=no
3571 _def_macosx='#undef MACOSX'
3572 _noaomodules="macosx $_noaomodules"
3573 _novomodules="quartz $_novomodules"
3575 cat > $TMPC <<EOF
3576 #include <Carbon/Carbon.h>
3577 #include <QuartzCore/CoreVideo.h>
3578 int main(void) {}
3580 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3581 _vosrc="$_vosrc vo_macosx.m"
3582 _vomodules="macosx $_vomodules"
3583 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3584 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3585 _macosx_corevideo=yes
3586 else
3587 _novomodules="macosx $_novomodules"
3588 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3589 _macosx_corevideo=no
3592 echores "$_macosx"
3594 echocheck "Mac OS X Finder Support"
3595 if test "$_macosx_finder_support" = auto ; then
3596 _macosx_finder_support=$_macosx
3598 if test "$_macosx_finder_support" = yes; then
3599 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3600 _macosx_finder_support=yes
3601 else
3602 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3603 _macosx_finder_support=no
3605 echores "$_macosx_finder_support"
3607 echocheck "Mac OS X Bundle file locations"
3608 if test "$_macosx_bundle" = auto ; then
3609 _macosx_bundle=$_macosx_finder_support
3611 if test "$_macosx_bundle" = yes; then
3612 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3613 else
3614 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3615 _macosx_bundle=no
3617 echores "$_macosx_bundle"
3619 echocheck "Apple Remote"
3620 if test "$_apple_remote" = auto ; then
3621 _apple_remote=no
3622 cat > $TMPC <<EOF
3623 #include <stdio.h>
3624 #include <IOKit/IOCFPlugIn.h>
3625 int main (int argc, const char * argv[])
3627 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3628 CFMutableDictionaryRef hidMatchDictionary;
3629 IOReturn ioReturnValue;
3631 // Set up a matching dictionary to search the I/O Registry by class.
3632 // name for all HID class devices
3633 hidMatchDictionary = IOServiceMatching("AppleIRController");
3635 // Now search I/O Registry for matching devices.
3636 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3637 hidMatchDictionary, &hidObjectIterator);
3639 // If search is unsuccessful, return nonzero.
3640 if (ioReturnValue != kIOReturnSuccess ||
3641 !IOIteratorIsValid(hidObjectIterator)) {
3642 return 1;
3644 return 0;
3647 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3649 if test "$_apple_remote" = yes ; then
3650 _def_apple_remote='#define HAVE_APPLE_REMOTE 1'
3651 _ld_extra="$_ld_extra -framework IOKit"
3652 else
3653 _def_apple_remote='#undef HAVE_APPLE_REMOTE'
3655 echores "$_apple_remote"
3657 fi #if darwin
3660 echocheck "pkg-config"
3661 _pkg_config=pkg-config
3662 if `$_pkg_config --version > /dev/null 2>&1`; then
3663 if test "$_ld_static"; then
3664 _pkg_config="$_pkg_config --static"
3666 echores "yes"
3667 else
3668 _pkg_config=false
3669 echores "no"
3673 echocheck "Samba support (libsmbclient)"
3674 if test "$_smbsupport" = yes; then
3675 _ld_extra="$_ld_extra -lsmbclient"
3677 if test "$_smbsupport" = auto; then
3678 _smbsupport=no
3679 cat > $TMPC << EOF
3680 #include <libsmbclient.h>
3681 int main(void) { smbc_opendir("smb://"); return 0; }
3683 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3684 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3685 _smbsupport=yes && break
3686 done
3689 if test "$_smbsupport" = yes; then
3690 _def_smbsupport="#define LIBSMBCLIENT"
3691 _inputmodules="smb $_inputmodules"
3692 else
3693 _def_smbsupport="#undef LIBSMBCLIENT"
3694 _noinputmodules="smb $_noinputmodules"
3696 echores "$_smbsupport"
3699 #########
3700 # VIDEO #
3701 #########
3704 echocheck "tdfxfb"
3705 if test "$_tdfxfb" = yes ; then
3706 _def_tdfxfb='#define HAVE_TDFXFB 1'
3707 _vosrc="$_vosrc vo_tdfxfb.c"
3708 _vomodules="tdfxfb $_vomodules"
3709 else
3710 _def_tdfxfb='#undef HAVE_TDFXFB'
3711 _novomodules="tdfxfb $_novomodules"
3713 echores "$_tdfxfb"
3715 echocheck "s3fb"
3716 if test "$_s3fb" = yes ; then
3717 _def_s3fb='#define HAVE_S3FB 1'
3718 _vosrc="$_vosrc vo_s3fb.c"
3719 _vomodules="s3fb $_vomodules"
3720 else
3721 _def_s3fb='#undef HAVE_S3FB'
3722 _novomodules="s3fb $_novomodules"
3724 echores "$_s3fb"
3726 echocheck "tdfxvid"
3727 if test "$_tdfxvid" = yes ; then
3728 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3729 _vosrc="$_vosrc vo_tdfx_vid.c"
3730 _vomodules="tdfx_vid $_vomodules"
3731 else
3732 _def_tdfxvid='#undef HAVE_TDFX_VID'
3733 _novomodules="tdfx_vid $_novomodules"
3735 echores "$_tdfxvid"
3737 echocheck "xvr100"
3738 if test "$_xvr100" = auto ; then
3739 cat > $TMPC << EOF
3740 #include <unistd.h>
3741 #include <sys/fbio.h>
3742 #include <sys/visual_io.h>
3743 int main(void) {
3744 struct vis_identifier ident;
3745 struct fbgattr attr;
3747 ioctl(0, VIS_GETIDENTIFIER, &ident);
3748 ioctl(0, FBIOGATTR, &attr);
3751 _xvr100=no
3752 cc_check && _xvr100=yes
3754 if test "$_xvr100" = yes ; then
3755 _def_xvr100='#define HAVE_XVR100 1'
3756 _vosrc="$_vosrc vo_xvr100.c"
3757 _vomodules="xvr100 $_vomodules"
3758 else
3759 _def_tdfxvid='#undef HAVE_XVR100'
3760 _novomodules="xvr100 $_novomodules"
3762 echores "$_xvr100"
3764 echocheck "tga"
3765 if test "$_tga" = yes ; then
3766 _def_tga='#define HAVE_TGA 1'
3767 _vosrc="$_vosrc vo_tga.c"
3768 _vomodules="tga $_vomodules"
3769 else
3770 _def_tga='#undef HAVE_TGA'
3771 _novomodules="tga $_novomodules"
3773 echores "$_tga"
3776 echocheck "md5sum support"
3777 if test "$_md5sum" = yes; then
3778 _def_md5sum="#define HAVE_MD5SUM"
3779 _vosrc="$_vosrc vo_md5sum.c"
3780 _vomodules="md5sum $_vomodules"
3781 else
3782 _def_md5sum="#undef HAVE_MD5SUM"
3783 _novomodules="md5sum $_novomodules"
3785 echores "$_md5sum"
3788 echocheck "bl"
3789 if test "$_bl" = yes ; then
3790 _def_bl='#define HAVE_BL 1'
3791 _vosrc="$_vosrc vo_bl.c"
3792 _vomodules="bl $_vomodules"
3793 else
3794 _def_bl='#undef HAVE_BL'
3795 _novomodules="bl $_novomodules"
3797 echores "$_bl"
3800 echocheck "DirectFB"
3801 if test "$_directfb" = auto ; then
3802 _directfb=no
3803 cat > $TMPC <<EOF
3804 #include <directfb.h>
3805 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3807 for _inc_tmp in "" -I/usr/local/include/directfb \
3808 -I/usr/include/directfb -I/usr/local/include; do
3809 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3810 _inc_extra="$_inc_extra $_inc_tmp" && break
3811 done
3814 dfb_version() {
3815 expr $1 \* 65536 + $2 \* 256 + $3
3818 if test "$_directfb" = yes; then
3819 cat > $TMPC << EOF
3820 #include <directfb_version.h>
3822 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3825 if $_cc -E $TMPC $_inc_extra > "$TMPEXE"; then
3826 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'`
3827 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3828 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3829 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3830 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3831 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3832 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3833 _res_comment="$_directfb_version"
3834 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3835 else
3836 _def_directfb_version='#undef DIRECTFBVERSION'
3837 _directfb=no
3838 _res_comment="version >=0.9.13 required"
3840 else
3841 _directfb=no
3842 _res_comment="failed to get version"
3845 echores "$_directfb"
3847 if test "$_directfb" = yes ; then
3848 _def_directfb='#define HAVE_DIRECTFB 1'
3849 _vosrc="$_vosrc vo_directfb2.c"
3850 _vomodules="directfb $_vomodules"
3851 _libs_mplayer="$_libs_mplayer -ldirectfb"
3852 else
3853 _def_directfb='#undef HAVE_DIRECTFB'
3854 _novomodules="directfb $_novomodules"
3856 if test "$_dfbmga" = yes; then
3857 _vosrc="$_vosrc vo_dfbmga.c"
3858 _vomodules="dfbmga $_vomodules"
3859 _def_dfbmga='#define HAVE_DFBMGA 1'
3860 else
3861 _novomodules="dfbmga $_novomodules"
3862 _def_dfbmga='#undef HAVE_DFBMGA'
3866 echocheck "X11 headers presence"
3867 _x11_headers="no"
3868 _res_comment="check if the dev(el) packages are installed"
3869 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3870 if test -f "$I/X11/Xlib.h" ; then
3871 _x11_headers="yes"
3872 _res_comment=""
3873 break
3875 done
3876 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3877 if test -f "$I/X11/Xlib.h" ; then
3878 _inc_extra="$_inc_extra -I$I"
3879 _x11_headers="yes"
3880 _res_comment="using $I"
3881 break
3883 done
3884 echores "$_x11_headers"
3887 echocheck "X11"
3888 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3889 cat > $TMPC <<EOF
3890 #include <X11/Xlib.h>
3891 #include <X11/Xutil.h>
3892 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3894 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3895 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3896 if netbsd; then
3897 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3898 else
3899 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3901 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3902 && _x11=yes && break
3903 done
3905 if test "$_x11" = yes ; then
3906 _def_x11='#define HAVE_X11 1'
3907 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3908 _vomodules="x11 xover $_vomodules"
3909 else
3910 _x11=no
3911 _def_x11='#undef HAVE_X11'
3912 _novomodules="x11 $_novomodules"
3913 _res_comment="check if the dev(el) packages are installed"
3914 # disable stuff that depends on X
3915 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
3917 echores "$_x11"
3919 echocheck "Xss screensaver extensions"
3920 if test "$_xss" = auto ; then
3921 cat > $TMPC << EOF
3922 #include <X11/Xlib.h>
3923 #include <X11/extensions/scrnsaver.h>
3924 int main(void) {
3925 XScreenSaverSuspend(NULL, True);
3926 return 0;
3929 _xss=no
3930 cc_check -lXss && _xss=yes
3932 if test "$_xss" = yes ; then
3933 _def_xss='#define HAVE_XSS 1'
3934 _libs_mplayer="$_libs_mplayer -lXss"
3935 else
3936 _def_xss='#undef HAVE_XSS'
3938 echores "$_xss"
3940 echocheck "DPMS"
3941 _xdpms3=no
3942 _xdpms4=no
3943 if test "$_x11" = yes ; then
3944 cat > $TMPC <<EOF
3945 #include <X11/Xmd.h>
3946 #include <X11/Xlib.h>
3947 #include <X11/Xutil.h>
3948 #include <X11/Xatom.h>
3949 #include <X11/extensions/dpms.h>
3950 int main(void) {
3951 (void) DPMSQueryExtension(0, 0, 0);
3954 cc_check -lXdpms && _xdpms3=yes
3955 cat > $TMPC <<EOF
3956 #include <X11/Xlib.h>
3957 #include <X11/extensions/dpms.h>
3958 int main(void) {
3959 (void) DPMSQueryExtension(0, 0, 0);
3962 cc_check -lXext && _xdpms4=yes
3964 if test "$_xdpms4" = yes ; then
3965 _def_xdpms='#define HAVE_XDPMS 1'
3966 _res_comment="using Xdpms 4"
3967 echores "yes"
3968 elif test "$_xdpms3" = yes ; then
3969 _def_xdpms='#define HAVE_XDPMS 1'
3970 _libs_mplayer="$_libs_mplayer -lXdpms"
3971 _res_comment="using Xdpms 3"
3972 echores "yes"
3973 else
3974 _def_xdpms='#undef HAVE_XDPMS'
3975 echores "no"
3979 echocheck "Xv"
3980 if test "$_xv" = auto ; then
3981 cat > $TMPC <<EOF
3982 #include <X11/Xlib.h>
3983 #include <X11/extensions/Xvlib.h>
3984 int main(void) {
3985 (void) XvGetPortAttribute(0, 0, 0, 0);
3986 (void) XvQueryPortAttributes(0, 0, 0);
3987 return 0; }
3989 _xv=no
3990 cc_check -lXv && _xv=yes
3993 if test "$_xv" = yes ; then
3994 _def_xv='#define HAVE_XV 1'
3995 _libs_mplayer="$_libs_mplayer -lXv"
3996 _vosrc="$_vosrc vo_xv.c"
3997 _vomodules="xv $_vomodules"
3998 else
3999 _def_xv='#undef HAVE_XV'
4000 _novomodules="xv $_novomodules"
4002 echores "$_xv"
4005 echocheck "XvMC"
4006 if test "$_xv" = yes && test "$_xvmc" != no ; then
4007 _xvmc=no
4008 cat > $TMPC <<EOF
4009 #include <X11/Xlib.h>
4010 #include <X11/extensions/Xvlib.h>
4011 #include <X11/extensions/XvMClib.h>
4012 int main(void) {
4013 (void) XvMCQueryExtension(0,0,0);
4014 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4015 return 0; }
4017 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4018 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4019 done
4021 if test "$_xvmc" = yes ; then
4022 _def_xvmc='#define HAVE_XVMC 1'
4023 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
4024 _vosrc="$_vosrc vo_xvmc.c"
4025 _vomodules="xvmc $_vomodules"
4026 _res_comment="using $_xvmclib"
4027 else
4028 _def_xvmc='#undef HAVE_XVMC'
4029 _novomodules="xvmc $_novomodules"
4030 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4032 echores "$_xvmc"
4035 echocheck "Xinerama"
4036 if test "$_xinerama" = auto ; then
4037 cat > $TMPC <<EOF
4038 #include <X11/Xlib.h>
4039 #include <X11/extensions/Xinerama.h>
4040 int main(void) { (void) XineramaIsActive(0); return 0; }
4042 _xinerama=no
4043 cc_check -lXinerama && _xinerama=yes
4046 if test "$_xinerama" = yes ; then
4047 _def_xinerama='#define HAVE_XINERAMA 1'
4048 _libs_mplayer="$_libs_mplayer -lXinerama"
4049 else
4050 _def_xinerama='#undef HAVE_XINERAMA'
4052 echores "$_xinerama"
4055 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4056 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4057 # named 'X extensions' or something similar.
4058 # This check may be useful for future mplayer versions (to change resolution)
4059 # If you run into problems, remove '-lXxf86vm'.
4060 echocheck "Xxf86vm"
4061 if test "$_vm" = auto ; then
4062 cat > $TMPC <<EOF
4063 #include <X11/Xlib.h>
4064 #include <X11/extensions/xf86vmode.h>
4065 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4067 _vm=no
4068 cc_check -lXxf86vm && _vm=yes
4070 if test "$_vm" = yes ; then
4071 _def_vm='#define HAVE_XF86VM 1'
4072 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4073 else
4074 _def_vm='#undef HAVE_XF86VM'
4076 echores "$_vm"
4078 # Check for the presence of special keycodes, like audio control buttons
4079 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4080 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4081 # have these new keycodes.
4082 echocheck "XF86keysym"
4083 if test "$_xf86keysym" = auto; then
4084 _xf86keysym=no
4085 cat > $TMPC <<EOF
4086 #include <X11/Xlib.h>
4087 #include <X11/XF86keysym.h>
4088 int main(void) { return XF86XK_AudioPause; }
4090 cc_check && _xf86keysym=yes
4092 if test "$_xf86keysym" = yes ; then
4093 _def_xf86keysym='#define HAVE_XF86XK 1'
4094 else
4095 _def_xf86keysym='#undef HAVE_XF86XK'
4097 echores "$_xf86keysym"
4099 echocheck "DGA"
4100 if test "$_dga2" = auto && test "$_x11" = yes ; then
4101 cat > $TMPC << EOF
4102 #include <X11/Xlib.h>
4103 #include <X11/extensions/xf86dga.h>
4104 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4106 _dga2=no
4107 cc_check -lXxf86dga && _dga2=yes
4109 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4110 cat > $TMPC << EOF
4111 #include <X11/Xlib.h>
4112 #include <X11/extensions/xf86dga.h>
4113 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4115 _dga1=no
4116 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4119 _dga=no
4120 _def_dga='#undef HAVE_DGA'
4121 _def_dga1='#undef HAVE_DGA1'
4122 _def_dga2='#undef HAVE_DGA2'
4123 if test "$_dga1" = yes ; then
4124 _dga=yes
4125 _def_dga1='#define HAVE_DGA1 1'
4126 _res_comment="using DGA 1.0"
4127 elif test "$_dga2" = yes ; then
4128 _dga=yes
4129 _def_dga2='#define HAVE_DGA2 1'
4130 _res_comment="using DGA 2.0"
4132 if test "$_dga" = yes ; then
4133 _def_dga='#define HAVE_DGA 1'
4134 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4135 _vosrc="$_vosrc vo_dga.c"
4136 _vomodules="dga $_vomodules"
4137 else
4138 _novomodules="dga $_novomodules"
4140 echores "$_dga"
4143 echocheck "3dfx"
4144 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4145 _def_3dfx='#define HAVE_3DFX 1'
4146 _vosrc="$_vosrc vo_3dfx.c"
4147 _vomodules="3dfx $_vomodules"
4148 else
4149 _def_3dfx='#undef HAVE_3DFX'
4150 _novomodules="3dfx $_novomodules"
4152 echores "$_3dfx"
4155 echocheck "OpenGL"
4156 #Note: this test is run even with --enable-gl since we autodetect linker flags
4157 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4158 cat > $TMPC << EOF
4159 #include <GL/gl.h>
4160 #ifdef GL_WIN32
4161 #include <windows.h>
4162 #include <GL/glext.h>
4163 #else
4164 #include <X11/Xlib.h>
4165 #include <GL/glx.h>
4166 #endif
4167 int main(void) {
4168 #ifdef GL_WIN32
4169 HDC dc;
4170 wglCreateContext(dc);
4171 #else
4172 glXCreateContext(NULL, NULL, NULL, True);
4173 #endif
4174 glFinish();
4175 return 0;
4178 _gl=no
4179 if cc_check -lGL $_ld_lm ; then
4180 _gl=yes
4181 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4182 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4183 _gl=yes
4184 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4185 elif cc_check -DGL_WIN32 -lopengl32 ; then
4186 _gl=yes
4187 _gl_win32=yes
4188 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4190 else
4191 _gl=no
4193 if test "$_gl" = yes ; then
4194 _def_gl='#define HAVE_GL 1'
4195 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4196 if test "$_gl_win32" = yes ; then
4197 _def_gl_win32='#define GL_WIN32 1'
4198 _vosrc="$_vosrc w32_common.c"
4199 _res_comment="win32 version"
4201 _vomodules="opengl $_vomodules"
4202 else
4203 _def_gl='#undef HAVE_GL'
4204 _def_gl_win32='#undef GL_WIN32'
4205 _novomodules="opengl $_novomodules"
4207 echores "$_gl"
4210 echocheck "VIDIX"
4211 _vidix=no
4212 _def_vidix='#undef CONFIG_VIDIX'
4213 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4214 _vidix_drv_cyberblade=no
4215 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4216 _vidix_drv_ivtv=no
4217 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4218 _vidix_drv_ivtv=no
4219 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4220 _vidix_drv_mach64=no
4221 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4222 _vidix_drv_mga=no
4223 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4224 _vidix_drv_mga_crtc2=no
4225 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4226 _vidix_drv_nvidia=no
4227 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4228 _vidix_drv_pm2=no
4229 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4230 _vidix_drv_pm3=no
4231 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4232 _vidix_drv_radeon=no
4233 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4234 _vidix_drv_rage128=no
4235 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
4236 _vidix_drv_savage=no
4237 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4238 _vidix_drv_sis=no
4239 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4240 _vidix_drv_unichrome=no
4241 if test "$_vidix_internal" = auto ; then
4242 _vidix_internal=no
4243 x86 && _vidix_internal=yes
4244 ppc && linux && _vidix_internal=yes
4245 alpha && linux && _vidix_internal=yes
4246 qnx || beos || darwin && _vidix_internal=no
4248 if test "$_vidix_internal" = yes; then
4249 _res_comment="internal"
4250 _vidix_external=no
4251 _vidix=yes
4252 elif test "$_vidix_external" = auto; then
4253 _vidix_external=no
4254 cat > $TMPC <<EOF
4255 #include <vidix/vidix.h>
4256 int main(void) { return 0; }
4258 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
4259 && _vidix=yes
4261 echores "$_vidix"
4263 if test "$_vidix" = yes ; then
4264 _def_vidix='#define CONFIG_VIDIX 1'
4265 _vosrc="$_vosrc vo_cvidix.c"
4266 _vomodules="cvidix $_vomodules"
4267 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 savage sis unichrome"
4268 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4270 # some vidix drivers are meant to work on x86 only, discard them elsewhere
4271 x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome//`
4273 for driver in $_vidix_drivers ; do
4274 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4275 eval _vidix_drv_${driver}=yes
4276 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4277 done
4278 else
4279 _novomodules="cvidix $_novomodules"
4282 if test "$_vidix_internal" = yes ; then
4283 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
4284 elif test "$_vidix_external" = yes ; then
4285 _libs_mplayer="$_libs_mplayer -lvidix"
4286 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
4289 if test "$_vidix" = yes && win32; then
4290 _vosrc="$_vosrc vo_winvidix.c"
4291 _vomodules="winvidix $_vomodules"
4292 _libs_mplayer="$_libs_mplayer -lgdi32"
4293 else
4294 _novomodules="winvidix $_novomodules"
4296 if test "$_vidix" = yes && test "$_x11" = yes; then
4297 _vosrc="$_vosrc vo_xvidix.c"
4298 _vomodules="xvidix $_vomodules"
4299 else
4300 _novomodules="xvidix $_novomodules"
4303 echocheck "VIDIX PCI device name database"
4304 echores "$_vidix_pcidb"
4305 if test "$_vidix_pcidb" = yes ; then
4306 _vidix_pcidb_val=1
4307 else
4308 _vidix_pcidb_val=0
4311 echocheck "/dev/mga_vid"
4312 if test "$_mga" = auto ; then
4313 _mga=no
4314 test -c /dev/mga_vid && _mga=yes
4316 if test "$_mga" = yes ; then
4317 _def_mga='#define HAVE_MGA 1'
4318 _vosrc="$_vosrc vo_mga.c"
4319 _vomodules="mga $_vomodules"
4320 else
4321 _def_mga='#undef HAVE_MGA'
4322 _novomodules="mga $_novomodules"
4324 echores "$_mga"
4327 echocheck "xmga"
4328 if test "$_xmga" = auto ; then
4329 _xmga=no
4330 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4332 if test "$_xmga" = yes ; then
4333 _def_xmga='#define HAVE_XMGA 1'
4334 _vosrc="$_vosrc vo_xmga.c"
4335 _vomodules="xmga $_vomodules"
4336 else
4337 _def_xmga='#undef HAVE_XMGA'
4338 _novomodules="xmga $_novomodules"
4340 echores "$_xmga"
4343 echocheck "GGI"
4344 if test "$_ggi" = auto ; then
4345 cat > $TMPC << EOF
4346 #include <ggi/ggi.h>
4347 int main(void) { ggiInit(); return 0; }
4349 _ggi=no
4350 cc_check -lggi && _ggi=yes
4352 if test "$_ggi" = yes ; then
4353 _def_ggi='#define HAVE_GGI 1'
4354 _libs_mplayer="$_libs_mplayer -lggi"
4355 _vosrc="$_vosrc vo_ggi.c"
4356 _vomodules="ggi $_vomodules"
4357 else
4358 _def_ggi='#undef HAVE_GGI'
4359 _novomodules="ggi $_novomodules"
4361 echores "$_ggi"
4363 echocheck "GGI extension: libggiwmh"
4364 if test "$_ggiwmh" = auto ; then
4365 _ggiwmh=no
4366 cat > $TMPC << EOF
4367 #include <ggi/ggi.h>
4368 #include <ggi/wmh.h>
4369 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4371 cc_check -lggi -lggiwmh && _ggiwmh=yes
4373 # needed to get right output on obscure combination
4374 # like --disable-ggi --enable-ggiwmh
4375 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4376 _def_ggiwmh='#define HAVE_GGIWMH 1'
4377 _libs_mplayer="$_libs_mplayer -lggiwmh"
4378 else
4379 _ggiwmh=no
4380 _def_ggiwmh='#undef HAVE_GGIWMH'
4382 echores "$_ggiwmh"
4385 echocheck "AA"
4386 if test "$_aa" = auto ; then
4387 cat > $TMPC << EOF
4388 #include <aalib.h>
4389 extern struct aa_hardware_params aa_defparams;
4390 extern struct aa_renderparams aa_defrenderparams;
4391 int main(void) {
4392 aa_context *c;
4393 aa_renderparams *p;
4394 (void) aa_init(0, 0, 0);
4395 c = aa_autoinit(&aa_defparams);
4396 p = aa_getrenderparams();
4397 aa_autoinitkbd(c,0);
4398 return 0; }
4400 _aa=no
4401 for _ld_tmp in "-laa" ; do
4402 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4403 done
4405 if test "$_aa" = yes ; then
4406 _def_aa='#define HAVE_AA 1'
4407 if cygwin ; then
4408 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4410 _vosrc="$_vosrc vo_aa.c"
4411 _vomodules="aa $_vomodules"
4412 else
4413 _def_aa='#undef HAVE_AA'
4414 _novomodules="aa $_novomodules"
4416 echores "$_aa"
4419 echocheck "CACA"
4420 if test "$_caca" = auto ; then
4421 _caca=no
4422 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4423 cat > $TMPC << EOF
4424 #include <caca.h>
4425 #ifdef CACA_API_VERSION_1
4426 #include <caca0.h>
4427 #endif
4428 int main(void) { (void) caca_init(); return 0; }
4430 cc_check `caca-config --libs` && _caca=yes
4433 if test "$_caca" = yes ; then
4434 _def_caca='#define HAVE_CACA 1'
4435 _inc_extra="$_inc_extra `caca-config --cflags`"
4436 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4437 _vosrc="$_vosrc vo_caca.c"
4438 _vomodules="caca $_vomodules"
4439 else
4440 _def_caca='#undef HAVE_CACA'
4441 _novomodules="caca $_novomodules"
4443 echores "$_caca"
4446 echocheck "SVGAlib"
4447 if test "$_svga" = auto ; then
4448 cat > $TMPC << EOF
4449 #include <vga.h>
4450 int main(void) { return 0; }
4452 _svga=no
4453 cc_check -lvga $_ld_lm && _svga=yes
4455 if test "$_svga" = yes ; then
4456 _def_svga='#define HAVE_SVGALIB 1'
4457 _libs_mplayer="$_libs_mplayer -lvga"
4458 _vosrc="$_vosrc vo_svga.c"
4459 _vomodules="svga $_vomodules"
4460 else
4461 _def_svga='#undef HAVE_SVGALIB'
4462 _novomodules="svga $_novomodules"
4464 echores "$_svga"
4467 echocheck "FBDev"
4468 if test "$_fbdev" = auto ; then
4469 _fbdev=no
4470 linux && _fbdev=yes
4472 if test "$_fbdev" = yes ; then
4473 _def_fbdev='#define HAVE_FBDEV 1'
4474 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4475 _vomodules="fbdev $_vomodules"
4476 else
4477 _def_fbdev='#undef HAVE_FBDEV'
4478 _novomodules="fbdev $_novomodules"
4480 echores "$_fbdev"
4484 echocheck "DVB"
4485 if test "$_dvb" = auto ; then
4486 _dvb=no
4487 cat >$TMPC << EOF
4488 #include <sys/poll.h>
4489 #include <sys/ioctl.h>
4490 #include <stdio.h>
4491 #include <time.h>
4492 #include <unistd.h>
4494 #include <ost/dmx.h>
4495 #include <ost/frontend.h>
4496 #include <ost/sec.h>
4497 #include <ost/video.h>
4498 #include <ost/audio.h>
4499 int main(void) {return 0;}
4501 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4502 cc_check $_inc_tmp && _dvb=yes && \
4503 _inc_extra="$_inc_extra $_inc_tmp" && break
4504 done
4506 echores "$_dvb"
4507 if test "$_dvb" = yes ; then
4508 _def_dvb='#define HAVE_DVB 1'
4509 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4510 _aomodules="mpegpes(dvb) $_aomodules"
4511 _vomodules="mpegpes(dvb) $_vomodules"
4514 echocheck "DVB HEAD"
4515 if test "$_dvbhead" = auto ; then
4516 _dvbhead=no
4518 cat >$TMPC << EOF
4519 #include <sys/poll.h>
4520 #include <sys/ioctl.h>
4521 #include <stdio.h>
4522 #include <time.h>
4523 #include <unistd.h>
4525 #include <linux/dvb/dmx.h>
4526 #include <linux/dvb/frontend.h>
4527 #include <linux/dvb/video.h>
4528 #include <linux/dvb/audio.h>
4529 int main(void) {return 0;}
4531 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4532 cc_check $_inc_tmp && _dvbhead=yes && \
4533 _inc_extra="$_inc_extra $_inc_tmp" && break
4534 done
4536 echores "$_dvbhead"
4537 if test "$_dvbhead" = yes ; then
4538 _def_dvb='#define HAVE_DVB_HEAD 1'
4539 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4540 _aomodules="mpegpes(dvb) $_aomodules"
4541 _vomodules="mpegpes(dvb) $_vomodules"
4544 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4545 _def_dvb='#undef HAVE_DVB'
4546 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4547 _aomodules="mpegpes(file) $_aomodules"
4548 _vomodules="mpegpes(file) $_vomodules"
4551 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4552 _dvbin=yes
4553 _inputmodules="dvb $_inputmodules"
4554 else
4555 _dvbin=no
4556 _noinputmodules="dvb $_noinputmodules"
4560 echocheck "zr"
4561 if test "$_zr" = auto ; then
4562 #36067's seem to identify themselves as 36057PQC's, so the line
4563 #below should work for 36067's and 36057's.
4564 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
4565 _zr=yes
4566 else
4567 _zr=no
4570 if test "$_zr" = yes ; then
4571 if test "$_libavcodec_a" = yes ; then
4572 _def_zr='#define HAVE_ZR 1'
4573 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
4574 _vomodules="zr zr2 $_vomodules"
4575 else
4576 _res_comment="libavcodec (static) is required by zr, sorry"
4577 _novomodules="zr $_novomodules"
4578 _def_zr='#undef HAVE_ZR'
4580 else
4581 _def_zr='#undef HAVE_ZR'
4582 _novomodules="zr zr2 $_novomodules"
4584 echores "$_zr"
4587 echocheck "PNG support"
4588 if test "$_png" = auto ; then
4589 _png=no
4590 if irix ; then
4591 # Don't check for -lpng on irix since it has its own libpng
4592 # incompatible with the GNU libpng
4593 _res_comment="disabled on irix (not GNU libpng)"
4594 else
4595 cat > $TMPC << EOF
4596 #include <png.h>
4597 #include <string.h>
4598 int main(void) {
4599 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4600 printf("libpng: %s\n", png_libpng_ver);
4601 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4604 if cc_check -lpng -lz $_ld_lm ; then
4605 if tmp_run ; then
4606 _png=yes
4607 else
4608 _res_comment="mismatch of library and header versions"
4613 echores "$_png"
4614 if test "$_png" = yes ; then
4615 _def_png='#define HAVE_PNG 1'
4616 _ld_extra="$_ld_extra -lpng -lz"
4617 _vosrc="$_vosrc vo_png.c"
4618 _vomodules="png $_vomodules"
4619 else
4620 _def_png='#undef HAVE_PNG'
4621 _novomodules="png $_novomodules"
4624 echocheck "JPEG support"
4625 if test "$_jpeg" = auto ; then
4626 _jpeg=no
4627 cat > $TMPC << EOF
4628 #include <stdio.h>
4629 #include <stdlib.h>
4630 #include <setjmp.h>
4631 #include <string.h>
4632 #include <jpeglib.h>
4633 int main(void) {
4634 return 0;
4637 if cc_check -ljpeg $_ld_lm ; then
4638 if tmp_run ; then
4639 _jpeg=yes
4643 echores "$_jpeg"
4645 if test "$_jpeg" = yes ; then
4646 _def_jpeg='#define HAVE_JPEG 1'
4647 _vosrc="$_vosrc vo_jpeg.c"
4648 _vomodules="jpeg $_vomodules"
4649 _ld_extra="$_ld_extra -ljpeg"
4650 else
4651 _def_jpeg='#undef HAVE_JPEG'
4652 _novomodules="jpeg $_novomodules"
4657 echocheck "PNM support"
4658 if test "$_pnm" = yes; then
4659 _def_pnm="#define HAVE_PNM"
4660 _vosrc="$_vosrc vo_pnm.c"
4661 _vomodules="pnm $_vomodules"
4662 else
4663 _def_pnm="#undef HAVE_PNM"
4664 _novomodules="pnm $_novomodules"
4666 echores "$_pnm"
4670 echocheck "GIF support"
4671 # This is to appease people who want to force gif support.
4672 # If it is forced to yes, then we still do checks to determine
4673 # which gif library to use.
4674 if test "$_gif" = yes ; then
4675 _force_gif=yes
4676 _gif=auto
4679 if test "$_gif" = auto ; then
4680 _gif=no
4681 cat > $TMPC << EOF
4682 #include <gif_lib.h>
4683 int main(void) {
4684 return 0;
4687 for _ld_gif in "-lungif" "-lgif" ; do
4688 cc_check $_ld_gif && tmp_run && _gif=yes && break
4689 done
4692 # If no library was found, and the user wants support forced,
4693 # then we force it on with libgif, as this is the safest
4694 # assumption IMHO. (libungif & libregif both create symbolic
4695 # links to libgif. We also assume that no x11 support is needed,
4696 # because if you are forcing this, then you _should_ know what
4697 # you are doing. [ Besides, package maintainers should never
4698 # have compiled x11 deps into libungif in the first place. ] )
4699 # </rant>
4700 # --Joey
4701 if test "$_force_gif" = yes && test "$_gif" = no ; then
4702 _gif=yes
4703 _ld_gif="-lgif"
4706 if test "$_gif" = yes ; then
4707 _def_gif='#define HAVE_GIF 1'
4708 _vosrc="$_vosrc vo_gif89a.c"
4709 _codecmodules="gif $_codecmodules"
4710 _vomodules="gif89a $_vomodules"
4711 _res_comment="old version, some encoding functions disabled"
4712 _def_gif_4='#undef HAVE_GIF_4'
4713 _ld_extra="$_ld_extra $_ld_gif"
4715 cat > $TMPC << EOF
4716 #include <signal.h>
4717 #include <gif_lib.h>
4718 void catch() { exit(1); }
4719 int main(void) {
4720 signal(SIGSEGV, catch); // catch segfault
4721 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4722 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4723 return 0;
4726 if cc_check "$_ld_gif" && tmp_run ; then
4727 _def_gif_4='#define HAVE_GIF_4 1'
4728 _res_comment=""
4730 else
4731 _def_gif='#undef HAVE_GIF'
4732 _def_gif_4='#undef HAVE_GIF_4'
4733 _novomodules="gif89a $_novomodules"
4734 _nocodecmodules="gif $_nocodecmodules"
4736 echores "$_gif"
4739 case "$_gif" in yes*)
4740 echocheck "broken giflib workaround"
4741 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4743 cat > $TMPC << EOF
4744 #include <gif_lib.h>
4745 int main(void) {
4746 GifFileType gif;
4747 printf("UserData is at address %p\n", gif.UserData);
4748 return 0;
4751 if cc_check "$_ld_gif" && tmp_run ; then
4752 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4753 echores "disabled"
4754 else
4755 echores "enabled"
4758 esac
4761 echocheck "VESA support"
4762 if test "$_vesa" = auto ; then
4763 cat > $TMPC << EOF
4764 #include <vbe.h>
4765 int main(void) { vbeVersion(); return 0; }
4767 _vesa=no
4768 cc_check -lvbe -llrmi && _vesa=yes
4770 if test "$_vesa" = yes ; then
4771 _def_vesa='#define HAVE_VESA 1'
4772 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4773 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4774 _vomodules="vesa $_vomodules"
4775 else
4776 _def_vesa='#undef HAVE_VESA'
4777 _novomodules="vesa $_novomodules"
4779 echores "$_vesa"
4781 #################
4782 # VIDEO + AUDIO #
4783 #################
4786 echocheck "SDL"
4787 if test -z "$_sdlconfig" ; then
4788 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4789 _sdlconfig="sdl-config"
4790 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4791 _sdlconfig="sdl11-config"
4792 else
4793 _sdlconfig=false
4796 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4797 cat > $TMPC << EOF
4798 #include <SDL.h>
4799 int main(int argc, char *argv[]) {
4800 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4801 return 0;
4804 _sdl=no
4805 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4806 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4807 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4808 if test "$_sdlversion" -gt 116 ; then
4809 if test "$_sdlversion" -lt 121 ; then
4810 _def_sdlbuggy='#define BUGGY_SDL'
4811 else
4812 _def_sdlbuggy='#undef BUGGY_SDL'
4814 _sdl=yes
4819 if test "$_sdl" = yes ; then
4820 _def_sdl='#define HAVE_SDL 1'
4821 if cygwin ; then
4822 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4823 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4824 elif mingw32 ; then
4825 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4826 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4827 else
4828 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4829 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4831 _vosrc="$_vosrc vo_sdl.c"
4832 _vomodules="sdl $_vomodules"
4833 _aosrc="$_aosrc ao_sdl.c"
4834 _aomodules="sdl $_aomodules"
4835 _res_comment="using $_sdlconfig"
4836 else
4837 _def_sdl='#undef HAVE_SDL'
4838 _novomodules="sdl $_novomodules"
4839 _noaomodules="sdl $_noaomodules"
4841 echores "$_sdl"
4844 if win32; then
4846 echocheck "Windows waveout"
4847 if test "$_win32waveout" = auto ; then
4848 cat > $TMPC << EOF
4849 #include <windows.h>
4850 #include <mmsystem.h>
4851 int main(void) { return 0; }
4853 _win32waveout=no
4854 cc_check -lwinmm && _win32waveout=yes
4856 if test "$_win32waveout" = yes ; then
4857 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4858 _libs_mplayer="$_libs_mplayer -lwinmm"
4859 _aosrc="$_aosrc ao_win32.c"
4860 _aomodules="win32 $_aomodules"
4861 else
4862 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4863 _noaomodules="win32 $_noaomodules"
4865 echores "$_win32waveout"
4867 echocheck "Directx"
4868 if test "$_directx" = auto ; then
4869 cat > $TMPC << EOF
4870 #include <windows.h>
4871 #include <ddraw.h>
4872 #include <dsound.h>
4873 int main(void) { return 0; }
4875 _directx=no
4876 cc_check -lgdi32 && _directx=yes
4878 if test "$_directx" = yes ; then
4879 _def_directx='#define HAVE_DIRECTX 1'
4880 _libs_mplayer="$_libs_mplayer -lgdi32"
4881 _vosrc="$_vosrc vo_directx.c"
4882 _vomodules="directx $_vomodules"
4883 _aosrc="$_aosrc ao_dsound.c"
4884 _aomodules="dsound $_aomodules"
4885 else
4886 _def_directx='#undef HAVE_DIRECTX'
4887 _novomodules="directx $_novomodules"
4888 _noaomodules="dsound $_noaomodules"
4890 echores "$_directx"
4892 fi #if win32; then
4895 echocheck "NAS"
4896 if test "$_nas" = auto ; then
4897 cat > $TMPC << EOF
4898 #include <audio/audiolib.h>
4899 int main(void) { return 0; }
4901 _nas=no
4902 cc_check $_ld_lm -laudio -lXt && _nas=yes
4904 if test "$_nas" = yes ; then
4905 _def_nas='#define HAVE_NAS 1'
4906 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4907 _aosrc="$_aosrc ao_nas.c"
4908 _aomodules="nas $_aomodules"
4909 else
4910 _noaomodules="nas $_noaomodules"
4911 _def_nas='#undef HAVE_NAS'
4913 echores "$_nas"
4915 echocheck "DXR2"
4916 if test "$_dxr2" = auto; then
4917 _dxr2=no
4918 cat > $TMPC << EOF
4919 #include <dxr2ioctl.h>
4920 int main(void) { return 0; }
4922 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4923 cc_check $_inc_tmp && _dxr2=yes && \
4924 _inc_extra="$_inc_extra $_inc_tmp" && break
4925 done
4927 if test "$_dxr2" = yes; then
4928 _def_dxr2='#define HAVE_DXR2 1'
4929 _vosrc="$_vosrc vo_dxr2.c"
4930 _aosrc="$_aosrc ao_dxr2.c"
4931 _aomodules="dxr2 $_aomodules"
4932 _vomodules="dxr2 $_vomodules"
4933 else
4934 _def_dxr2='#undef HAVE_DXR2'
4935 _noaomodules="dxr2 $_noaomodules"
4936 _novomodules="dxr2 $_novomodules"
4938 echores "$_dxr2"
4940 echocheck "DXR3/H+"
4941 if test "$_dxr3" = auto ; then
4942 cat > $TMPC << EOF
4943 #include <linux/em8300.h>
4944 int main(void) { return 0; }
4946 _dxr3=no
4947 cc_check && _dxr3=yes
4949 if test "$_dxr3" = yes ; then
4950 _def_dxr3='#define HAVE_DXR3 1'
4951 _vosrc="$_vosrc vo_dxr3.c"
4952 _vomodules="dxr3 $_vomodules"
4953 else
4954 _def_dxr3='#undef HAVE_DXR3'
4955 _novomodules="dxr3 $_novomodules"
4957 echores "$_dxr3"
4960 echocheck "IVTV TV-Out"
4961 if test "$_ivtv" = auto ; then
4962 cat > $TMPC << EOF
4963 #include <stdlib.h>
4964 #include <inttypes.h>
4965 #include <linux/types.h>
4966 #include <linux/videodev2.h>
4967 #include <linux/ivtv.h>
4968 int main(void) { return 0; }
4970 _ivtv=no
4971 cc_check && _ivtv=yes
4973 if test "$_ivtv" = yes ; then
4974 _def_ivtv='#define HAVE_IVTV 1'
4975 _vosrc="$_vosrc vo_ivtv.c"
4976 _vomodules="ivtv $_vomodules"
4977 _aosrc="$_aosrc ao_ivtv.c"
4978 _aomodules="ivtv $_aomodules"
4979 else
4980 _def_ivtv='#undef HAVE_IVTV'
4981 _novomodules="ivtv $_novomodules"
4982 _noaomodules="ivtv $_noaomodules"
4984 echores "$_ivtv"
4987 echocheck "V4L2 MPEG Decoder"
4988 if test "$_v4l2" = auto ; then
4989 cat > $TMPC << EOF
4990 #include <stdlib.h>
4991 #include <inttypes.h>
4992 #include <linux/types.h>
4993 #include <linux/videodev2.h>
4994 #include <linux/version.h>
4995 int main(void) {
4996 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4997 #error kernel headers too old, need 2.6.22
4998 bad_kernel_version();
4999 #endif
5000 struct v4l2_ext_controls ctrls;
5001 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5002 return 0;
5005 _v4l2=no
5006 cc_check && _v4l2=yes
5008 if test "$_v4l2" = yes ; then
5009 _def_v4l2='#define HAVE_V4L2_DECODER 1'
5010 _vosrc="$_vosrc vo_v4l2.c"
5011 _vomodules="v4l2 $_vomodules"
5012 _aosrc="$_aosrc ao_v4l2.c"
5013 _aomodules="v4l2 $_aomodules"
5014 else
5015 _def_v4l2='#undef HAVE_V4L2_DECODER'
5016 _novomodules="v4l2 $_novomodules"
5017 _noaomodules="v4l2 $_noaomodules"
5019 echores "$_v4l2"
5023 #########
5024 # AUDIO #
5025 #########
5028 echocheck "OSS Audio"
5029 if test "$_ossaudio" = auto ; then
5030 cat > $TMPC << EOF
5031 #include <sys/ioctl.h>
5032 #include <$_soundcard_header>
5033 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5035 _ossaudio=no
5036 cc_check && _ossaudio=yes
5038 if test "$_ossaudio" = yes ; then
5039 _def_ossaudio='#define USE_OSS_AUDIO 1'
5040 _aosrc="$_aosrc ao_oss.c"
5041 _aomodules="oss $_aomodules"
5042 if test "$_linux_devfs" = yes; then
5043 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5044 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5045 else
5046 cat > $TMPC << EOF
5047 #include <sys/ioctl.h>
5048 #include <$_soundcard_header>
5049 #ifdef OPEN_SOUND_SYSTEM
5050 int main(void) { return 0; }
5051 #else
5052 #error Not the real thing
5053 #endif
5055 _real_ossaudio=no
5056 cc_check && _real_ossaudio=yes
5057 if test "$_real_ossaudio" = yes; then
5058 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5059 elif netbsd || openbsd ; then
5060 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5061 _ld_extra="$_ld_extra -lossaudio"
5062 else
5063 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5065 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5067 else
5068 _def_ossaudio='#undef USE_OSS_AUDIO'
5069 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5070 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5071 _noaomodules="oss $_noaomodules"
5073 echores "$_ossaudio"
5076 echocheck "aRts"
5077 if test "$_arts" = auto ; then
5078 _arts=no
5079 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5081 cat > $TMPC << EOF
5082 #include <artsc.h>
5083 int main(void) { return 0; }
5085 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5090 if test "$_arts" = yes ; then
5091 _def_arts='#define USE_ARTS 1'
5092 _aosrc="$_aosrc ao_arts.c"
5093 _aomodules="arts $_aomodules"
5094 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5095 _inc_extra="$_inc_extra `artsc-config --cflags`"
5096 else
5097 _noaomodules="arts $_noaomodules"
5099 echores "$_arts"
5102 echocheck "EsounD"
5103 if test "$_esd" = auto ; then
5104 _esd=no
5105 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5107 cat > $TMPC << EOF
5108 #include <esd.h>
5109 int main(void) { int fd = esd_open_sound("test"); return fd; }
5111 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5115 echores "$_esd"
5117 if test "$_esd" = yes ; then
5118 _def_esd='#define USE_ESD 1'
5119 _aosrc="$_aosrc ao_esd.c"
5120 _aomodules="esd $_aomodules"
5121 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5122 _inc_extra="$_inc_extra `esd-config --cflags`"
5124 echocheck "esd_get_latency()"
5125 cat > $TMPC << EOF
5126 #include <esd.h>
5127 int main(void) { return esd_get_latency(0); }
5129 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5130 echores "$_esd_latency"
5131 else
5132 _def_esd='#undef USE_ESD'
5133 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5134 _noaomodules="esd $_noaomodules"
5137 echocheck "pulse"
5138 if test "$_pulse" = auto ; then
5139 _pulse=no
5140 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5142 cat > $TMPC << EOF
5143 #include <pulse/pulseaudio.h>
5144 int main(void) { return 0; }
5146 cc_check `$_pkg_config --libs --cflags libpulse` && tmp_run && _pulse=yes
5150 echores "$_pulse"
5152 if test "$_pulse" = yes ; then
5153 _def_pulse='#define USE_PULSE 1'
5154 _aosrc="$_aosrc ao_pulse.c"
5155 _aomodules="pulse $_aomodules"
5156 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs libpulse`"
5157 _inc_extra="$_inc_extra `$_pkg_config --cflags libpulse`"
5158 else
5159 _def_pulse='#undef USE_PULSE'
5160 _noaomodules="pulse $_noaomodules"
5164 echocheck "JACK"
5165 if test "$_jack" = auto ; then
5166 _jack=yes
5168 cat > $TMPC << EOF
5169 #include <jack/jack.h>
5170 int main(void) { jack_client_new("test"); return 0; }
5172 if cc_check -ljack ; then
5173 _libs_mplayer="$_libs_mplayer -ljack"
5174 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5175 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5176 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5177 else
5178 _jack=no
5182 if test "$_jack" = yes ; then
5183 _def_jack='#define USE_JACK 1'
5184 _aosrc="$_aosrc ao_jack.c"
5185 _aomodules="jack $_aomodules"
5186 else
5187 _noaomodules="jack $_noaomodules"
5189 echores "$_jack"
5191 echocheck "OpenAL"
5192 if test "$_openal" = auto ; then
5193 _openal=no
5194 cat > $TMPC << EOF
5195 #ifdef OPENAL_AL_H
5196 #include <OpenAL/al.h>
5197 #else
5198 #include <AL/al.h>
5199 #endif
5200 int main(void) {
5201 alSourceQueueBuffers(0, 0, 0);
5202 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5203 return 0;
5206 for I in "-lopenal" "-framework OpenAL" ; do
5207 cc_check $I && _openal=yes && break
5208 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5209 done
5210 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5212 if test "$_openal" = yes ; then
5213 _def_openal='#define USE_OPENAL 1'
5214 _aosrc="$_aosrc ao_openal.c"
5215 _aomodules="openal $_aomodules"
5216 else
5217 _noaomodules="openal $_noaomodules"
5219 echores "$_openal"
5221 echocheck "ALSA audio"
5222 if test "$_alsa" != no ; then
5223 _alsa=no
5224 cat > $TMPC << EOF
5225 #include <sys/asoundlib.h>
5226 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5227 #error "alsa version != 0.5.x"
5228 #endif
5229 int main(void) { return 0; }
5231 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5233 cat > $TMPC << EOF
5234 #include <sys/asoundlib.h>
5235 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5236 #error "alsa version != 0.9.x"
5237 #endif
5238 int main(void) { return 0; }
5240 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5241 cat > $TMPC << EOF
5242 #include <alsa/asoundlib.h>
5243 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5244 #error "alsa version != 0.9.x"
5245 #endif
5246 int main(void) { return 0; }
5248 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5250 cat > $TMPC << EOF
5251 #include <sys/asoundlib.h>
5252 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5253 #error "alsa version != 1.0.x"
5254 #endif
5255 int main(void) { return 0; }
5257 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5258 cat > $TMPC << EOF
5259 #include <alsa/asoundlib.h>
5260 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5261 #error "alsa version != 1.0.x"
5262 #endif
5263 int main(void) { return 0; }
5265 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5267 _def_alsa5='#undef HAVE_ALSA5'
5268 _def_alsa9='#undef HAVE_ALSA9'
5269 _def_alsa1x='#undef HAVE_ALSA1X'
5270 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5271 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5272 if test "$_alsaver" ; then
5273 _alsa=yes
5274 if test "$_alsaver" = '0.5.x' ; then
5275 _alsa5=yes
5276 _aosrc="$_aosrc ao_alsa5.c"
5277 _aomodules="alsa5 $_aomodules"
5278 _def_alsa5='#define HAVE_ALSA5 1'
5279 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5280 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5281 elif test "$_alsaver" = '0.9.x-sys' ; then
5282 _alsa9=yes
5283 _aosrc="$_aosrc ao_alsa.c"
5284 _aomodules="alsa $_aomodules"
5285 _def_alsa9='#define HAVE_ALSA9 1'
5286 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5287 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5288 elif test "$_alsaver" = '0.9.x-alsa' ; then
5289 _alsa9=yes
5290 _aosrc="$_aosrc ao_alsa.c"
5291 _aomodules="alsa $_aomodules"
5292 _def_alsa9='#define HAVE_ALSA9 1'
5293 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5294 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5295 elif test "$_alsaver" = '1.0.x-sys' ; then
5296 _alsa1x=yes
5297 _aosrc="$_aosrc ao_alsa.c"
5298 _aomodules="alsa $_aomodules"
5299 _def_alsa1x="#define HAVE_ALSA1X 1"
5300 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5301 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5302 elif test "$_alsaver" = '1.0.x-alsa' ; then
5303 _alsa1x=yes
5304 _aosrc="$_aosrc ao_alsa.c"
5305 _aomodules="alsa $_aomodules"
5306 _def_alsa1x="#define HAVE_ALSA1X 1"
5307 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5308 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5309 else
5310 _alsa=no
5311 _res_comment="unknown version"
5313 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5314 else
5315 _noaomodules="alsa $_noaomodules"
5317 echores "$_alsa"
5320 echocheck "Sun audio"
5321 if test "$_sunaudio" = auto ; then
5322 cat > $TMPC << EOF
5323 #include <sys/types.h>
5324 #include <sys/audioio.h>
5325 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5327 _sunaudio=no
5328 cc_check && _sunaudio=yes
5330 if test "$_sunaudio" = yes ; then
5331 _def_sunaudio='#define USE_SUN_AUDIO 1'
5332 _aosrc="$_aosrc ao_sun.c"
5333 _aomodules="sun $_aomodules"
5334 else
5335 _def_sunaudio='#undef USE_SUN_AUDIO'
5336 _noaomodules="sun $_noaomodules"
5338 echores "$_sunaudio"
5341 if sunos; then
5342 echocheck "Sun mediaLib"
5343 if test "$_mlib" = auto ; then
5344 _mlib=no
5345 cat > $TMPC << EOF
5346 #include <mlib.h>
5347 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5349 cc_check -lmlib && _mlib=yes
5351 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5352 echores "$_mlib"
5353 fi #if sunos
5356 if irix; then
5357 echocheck "SGI audio"
5358 if test "$_sgiaudio" = auto ; then
5359 # check for SGI audio
5360 cat > $TMPC << EOF
5361 #include <dmedia/audio.h>
5362 int main(void) { return 0; }
5364 _sgiaudio=no
5365 cc_check && _sgiaudio=yes
5367 if test "$_sgiaudio" = "yes" ; then
5368 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5369 _libs_mplayer="$_libs_mplayer -laudio"
5370 _aosrc="$_aosrc ao_sgi.c"
5371 _aomodules="sgi $_aomodules"
5372 else
5373 _def_sgiaudio='#undef USE_SGI_AUDIO'
5374 _noaomodules="sgi $_noaomodules"
5376 echores "$_sgiaudio"
5377 fi #if irix
5380 echocheck "VCD support"
5381 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5382 _inputmodules="vcd $_inputmodules"
5383 _def_vcd='#define HAVE_VCD 1'
5384 _vcd="yes"
5385 else
5386 _def_vcd='#undef HAVE_VCD'
5387 _noinputmodules="vcd $_noinputmodules"
5388 _res_comment="not supported on this OS"
5389 _vcd="no"
5391 echores "$_vcd"
5395 echocheck "dvdread"
5396 if test "$_dvdread_internal" = auto ; then
5397 _dvdread_internal=no
5398 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5399 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5400 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5401 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5402 _dvdread_internal=yes
5403 _dvdread=yes
5405 elif test "$_dvdread" = auto ; then
5406 _dvdread=no
5407 if test "$_dl" = yes; then
5408 cat > $TMPC << EOF
5409 #include <inttypes.h>
5410 #include <dvdread/dvd_reader.h>
5411 #include <dvdread/ifo_types.h>
5412 #include <dvdread/ifo_read.h>
5413 #include <dvdread/nav_read.h>
5414 int main(void) { return 0; }
5416 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5417 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5421 if test "$_dvdread_internal" = yes; then
5422 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5423 _def_dvdread='#define USE_DVDREAD 1'
5424 _inputmodules="dvdread(internal) $_inputmodules"
5425 _largefiles=yes
5426 _res_comment="internal"
5427 elif test "$_dvdread" = yes; then
5428 _def_dvdread='#define USE_DVDREAD 1'
5429 _largefiles=yes
5430 _ld_extra="$_ld_extra -ldvdread"
5431 _inputmodules="dvdread(external) $_inputmodules"
5432 _res_comment="external"
5433 else
5434 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5435 _def_dvdread='#undef USE_DVDREAD'
5436 _noinputmodules="dvdread $_noinputmodules"
5438 echores "$_dvdread"
5441 echocheck "internal libdvdcss"
5442 if test "$_libdvdcss_internal" = auto ; then
5443 _libdvdcss_internal=no
5444 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5446 if test "$_libdvdcss_internal" = yes ; then
5447 if linux || netbsd || openbsd || bsdos ; then
5448 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5449 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5450 elif freebsd ; then
5451 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5452 elif darwin ; then
5453 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5454 _ld_extra="$_ld_extra -framework IOKit"
5456 _inputmodules="libdvdcss(internal) $_inputmodules"
5457 _largefiles=yes
5458 else
5459 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5461 echores "$_libdvdcss_internal"
5464 echocheck "cdparanoia"
5465 if test "$_cdparanoia" = auto ; then
5466 cat > $TMPC <<EOF
5467 #include <cdda_interface.h>
5468 #include <cdda_paranoia.h>
5469 // This need a better test. How ?
5470 int main(void) {
5471 void *test = cdda_verbose_set;
5472 return test == (void *)1;
5475 _cdparanoia=no
5476 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5477 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5478 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5479 done
5481 if test "$_cdparanoia" = yes ; then
5482 _cdda='yes'
5483 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5484 openbsd && _ld_extra="$_ld_extra -lutil"
5486 echores "$_cdparanoia"
5489 echocheck "libcdio"
5490 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5491 cat > $TMPC << EOF
5492 #include <stdio.h>
5493 #include <cdio/version.h>
5494 #include <cdio/cdda.h>
5495 #include <cdio/paranoia.h>
5496 int main(void)
5498 void *test = cdda_verbose_set;
5499 printf("%s\n", CDIO_VERSION);
5500 return test == (void *)1;
5504 _libcdio=no
5505 for _ld_tmp in "" "-lwinmm" ; do
5506 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5507 cc_check $_ld_tmp $_ld_lm \
5508 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5509 done
5510 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5511 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5512 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5513 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5514 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5517 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5518 _cdda='yes'
5519 _def_libcdio='#define HAVE_LIBCDIO'
5520 _def_havelibcdio='yes'
5521 else
5522 if test "$_cdparanoia" = yes ; then
5523 _res_comment="using cdparanoia"
5525 _def_libcdio='#undef HAVE_LIBCDIO'
5526 _def_havelibcdio='no'
5528 echores "$_libcdio"
5530 if test "$_cdda" = yes ; then
5531 test $_cddb = auto && test $_network = yes && _cddb=yes
5532 _def_cdparanoia='#define HAVE_CDDA'
5533 _inputmodules="cdda $_inputmodules"
5534 else
5535 _def_cdparanoia='#undef HAVE_CDDA'
5536 _noinputmodules="cdda $_noinputmodules"
5539 if test "$_cddb" = yes ; then
5540 _def_cddb='#define HAVE_CDDB'
5541 _inputmodules="cddb $_inputmodules"
5542 else
5543 _cddb=no
5544 _def_cddb='#undef HAVE_CDDB'
5545 _noinputmodules="cddb $_noinputmodules"
5548 echocheck "bitmap font support"
5549 if test "$_bitmap_font" = yes ; then
5550 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5551 else
5552 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5554 echores "$_bitmap_font"
5557 echocheck "freetype >= 2.0.9"
5559 # freetype depends on iconv
5560 if test "$_iconv" = no ; then
5561 _freetype=no
5562 _res_comment="iconv support needed"
5565 if test "$_freetype" = auto ; then
5566 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5567 cat > $TMPC << EOF
5568 #include <stdio.h>
5569 #include <ft2build.h>
5570 #include FT_FREETYPE_H
5571 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5572 #error "Need FreeType 2.0.9 or newer"
5573 #endif
5574 int main(void)
5576 FT_Library library;
5577 FT_Int major=-1,minor=-1,patch=-1;
5578 int err=FT_Init_FreeType(&library);
5579 if(err){
5580 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5581 exit(err);
5583 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5584 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5585 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5586 (int)major,(int)minor,(int)patch );
5587 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5588 printf("Library and header version mismatch! Fix it in your distribution!\n");
5589 exit(1);
5591 return 0;
5594 _freetype=no
5595 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5596 else
5597 _freetype=no
5600 if test "$_freetype" = yes ; then
5601 _def_freetype='#define HAVE_FREETYPE'
5602 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5603 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5604 else
5605 _def_freetype='#undef HAVE_FREETYPE'
5607 echores "$_freetype"
5609 if test "$_freetype" = no ; then
5610 _fontconfig=no
5611 _res_comment="freetype support needed"
5613 echocheck "fontconfig"
5614 if test "$_fontconfig" = auto ; then
5615 cat > $TMPC << EOF
5616 #include <stdio.h>
5617 #include <fontconfig/fontconfig.h>
5618 int main(void)
5620 int err = FcInit();
5621 if(err == FcFalse){
5622 printf("Couldn't initialize fontconfig lib\n");
5623 exit(err);
5625 return 0;
5629 _fontconfig=no
5630 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5631 _ld_tmp="-lfontconfig $_ld_tmp"
5632 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5633 done
5634 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5635 _inc_tmp=`$_pkg_config --cflags fontconfig`
5636 _ld_tmp=`$_pkg_config --libs fontconfig`
5637 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5638 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5641 if test "$_fontconfig" = yes ; then
5642 _def_fontconfig='#define HAVE_FONTCONFIG'
5643 else
5644 _def_fontconfig='#undef HAVE_FONTCONFIG'
5646 echores "$_fontconfig"
5649 echocheck "SSA/ASS support"
5650 # libass depends on FreeType
5651 if test "$_freetype" = no ; then
5652 _ass=no
5653 _res_comment="FreeType support needed"
5656 if test "$_ass" = auto ; then
5657 cat > $TMPC << EOF
5658 #include <ft2build.h>
5659 #include FT_FREETYPE_H
5660 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5661 #error "Need FreeType 2.1.8 or newer"
5662 #endif
5663 int main(void) { return 0; }
5665 _ass=no
5666 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5667 if test "$_ass" = no ; then
5668 _res_comment="FreeType >= 2.1.8 needed"
5671 if test "$_ass" = yes ; then
5672 _def_ass='#define USE_ASS'
5673 else
5674 _def_ass='#undef USE_ASS'
5676 echores "$_ass"
5679 echocheck "fribidi with charsets"
5680 if test "$_fribidi" = auto ; then
5681 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5682 cat > $TMPC << EOF
5683 #include <stdio.h>
5684 /* workaround for fribidi 0.10.4 and below */
5685 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5686 #include <fribidi/fribidi.h>
5687 int main(void)
5689 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5690 printf("Fribidi headers are not consistents with the library!\n");
5691 exit(1);
5693 return 0;
5696 _fribidi=no
5697 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5698 else
5699 _fribidi=no
5702 if test "$_fribidi" = yes ; then
5703 _def_fribidi='#define USE_FRIBIDI'
5704 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5705 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5706 else
5707 _def_fribidi='#undef USE_FRIBIDI'
5709 echores "$_fribidi"
5712 echocheck "ENCA"
5713 if test "$_enca" = auto ; then
5714 cat > $TMPC << EOF
5715 #include <enca.h>
5716 int main(void)
5718 const char **langs;
5719 size_t langcnt;
5720 langs = enca_get_languages(&langcnt);
5721 return 0;
5724 _enca=no
5725 cc_check -lenca $_ld_lm && _enca=yes
5727 if test "$_enca" = yes ; then
5728 _def_enca='#define HAVE_ENCA 1'
5729 _ld_extra="$_ld_extra -lenca"
5730 else
5731 _def_enca='#undef HAVE_ENCA'
5733 echores "$_enca"
5736 echocheck "zlib"
5737 cat > $TMPC << EOF
5738 #include <zlib.h>
5739 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5741 _zlib=no
5742 cc_check -lz && _zlib=yes
5743 if test "$_zlib" = yes ; then
5744 _def_zlib='#define HAVE_ZLIB 1'
5745 _ld_extra="$_ld_extra -lz"
5746 else
5747 _def_zlib='#undef HAVE_ZLIB'
5748 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5749 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5751 echores "$_zlib"
5754 echocheck "RTC"
5755 if test "$_rtc" = auto ; then
5756 cat > $TMPC << EOF
5757 #include <sys/ioctl.h>
5758 #ifdef __linux__
5759 #include <linux/rtc.h>
5760 #else
5761 #include <rtc.h>
5762 #define RTC_PIE_ON RTCIO_PIE_ON
5763 #endif
5764 int main(void) { return RTC_PIE_ON; }
5766 _rtc=no
5767 cc_check && _rtc=yes
5768 ppc && _rtc=no
5770 if test "$_rtc" = yes ; then
5771 _def_rtc='#define HAVE_RTC 1'
5772 else
5773 _def_rtc='#undef HAVE_RTC'
5775 echores "$_rtc"
5778 echocheck "liblzo2 support"
5779 if test "$_liblzo" = auto ; then
5780 _liblzo=no
5781 cat > $TMPC << EOF
5782 #include <lzo/lzo1x.h>
5783 int main(void) { lzo_init();return 0; }
5785 cc_check -llzo2 && _liblzo=yes
5787 if test "$_liblzo" = yes ; then
5788 _def_liblzo='#define USE_LIBLZO 1'
5789 _ld_extra="$_ld_extra -llzo2"
5790 _codecmodules="liblzo $_codecmodules"
5791 else
5792 _def_liblzo='#undef USE_LIBLZO'
5793 _nocodecmodules="liblzo $_nocodecmodules"
5795 echores "$_liblzo"
5798 echocheck "mad support"
5799 if test "$_mad" = auto ; then
5800 _mad=no
5801 cat > $TMPC << EOF
5802 #include <mad.h>
5803 int main(void) { return 0; }
5805 cc_check -lmad && _mad=yes
5807 if test "$_mad" = yes ; then
5808 _def_mad='#define USE_LIBMAD 1'
5809 _ld_extra="$_ld_extra -lmad"
5810 _codecmodules="libmad $_codecmodules"
5811 else
5812 _def_mad='#undef USE_LIBMAD'
5813 _nocodecmodules="libmad $_nocodecmodules"
5815 echores "$_mad"
5817 echocheck "Twolame"
5818 if test "$_twolame" = auto ; then
5819 cat > $TMPC <<EOF
5820 #include <twolame.h>
5821 int main(void) { twolame_init(); return 0; }
5823 _twolame=no
5824 cc_check -ltwolame $_ld_lm && _twolame=yes
5826 if test "$_twolame" = yes ; then
5827 _def_twolame='#define HAVE_TWOLAME 1'
5828 _libs_mencoder="$_libs_mencoder -ltwolame"
5829 _codecmodules="twolame $_codecmodules"
5830 else
5831 _def_twolame='#undef HAVE_TWOLAME'
5832 _nocodecmodules="twolame $_nocodecmodules"
5834 echores "$_twolame"
5836 echocheck "Toolame"
5837 if test "$_toolame" = auto ; then
5838 _toolame=no
5839 if test "$_twolame" = yes ; then
5840 _res_comment="disabled by twolame"
5841 else
5842 cat > $TMPC <<EOF
5843 #include <toolame.h>
5844 int main(void) { toolame_init(); return 0; }
5846 cc_check -ltoolame $_ld_lm && _toolame=yes
5849 if test "$_toolame" = yes ; then
5850 _def_toolame='#define HAVE_TOOLAME 1'
5851 _libs_mencoder="$_libs_mencoder -ltoolame"
5852 _codecmodules="toolame $_codecmodules"
5853 else
5854 _def_toolame='#undef HAVE_TOOLAME'
5855 _nocodecmodules="toolame $_nocodecmodules"
5857 if test "$_toolamedir" ; then
5858 _res_comment="using $_toolamedir"
5860 echores "$_toolame"
5862 echocheck "OggVorbis support"
5863 if test "$_tremor_internal" = yes; then
5864 _libvorbis=no
5865 elif test "$_tremor_external" = auto; then
5866 _tremor_external=no
5867 cat > $TMPC << EOF
5868 #include <tremor/ivorbiscodec.h>
5869 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5871 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5873 if test "$_libvorbis" = auto; then
5874 _libvorbis=no
5875 cat > $TMPC << EOF
5876 #include <vorbis/codec.h>
5877 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5879 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5881 if test "$_tremor_internal" = yes ; then
5882 _vorbis=yes
5883 _def_vorbis='#define HAVE_OGGVORBIS 1'
5884 _def_tremor='#define TREMOR 1'
5885 _codecmodules="tremor(internal) $_codecmodules"
5886 _res_comment="internal Tremor"
5887 if test "$_tremor_low" = yes ; then
5888 _res_comment="internal low accuracy Tremor"
5890 elif test "$_tremor_external" = yes ; then
5891 _vorbis=yes
5892 _def_vorbis='#define HAVE_OGGVORBIS 1'
5893 _def_tremor='#define TREMOR 1'
5894 _codecmodules="tremor(external) $_codecmodules"
5895 _res_comment="external Tremor"
5896 _ld_extra="$_ld_extra -logg -lvorbisidec"
5897 elif test "$_libvorbis" = yes ; then
5898 _vorbis=yes
5899 _def_vorbis='#define HAVE_OGGVORBIS 1'
5900 _codecmodules="libvorbis $_codecmodules"
5901 _res_comment="libvorbis"
5902 _ld_extra="$_ld_extra -lvorbis -logg"
5903 else
5904 _vorbis=no
5905 _nocodecmodules="libvorbis $_nocodecmodules"
5907 if test "$_libvorbis" = no ; then
5908 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5910 echores "$_vorbis"
5912 echocheck "libspeex (version >= 1.1 required)"
5913 if test "$_speex" = auto ; then
5914 _speex=no
5915 cat > $TMPC << EOF
5916 #include <speex/speex.h>
5917 int main(void) {
5918 SpeexBits bits;
5919 void *dec;
5920 speex_decode_int(dec, &bits, dec);
5923 cc_check -lspeex $_ld_lm && _speex=yes
5925 if test "$_speex" = yes ; then
5926 _def_speex='#define HAVE_SPEEX 1'
5927 _ld_extra="$_ld_extra -lspeex"
5928 _codecmodules="speex $_codecmodules"
5929 else
5930 _def_speex='#undef HAVE_SPEEX'
5931 _nocodecmodules="speex $_nocodecmodules"
5933 echores "$_speex"
5935 echocheck "OggTheora support"
5936 if test "$_theora" = auto ; then
5937 _theora=no
5938 cat > $TMPC << EOF
5939 #include <theora/theora.h>
5940 #include <string.h>
5941 int main(void)
5943 /* theora is in flux, make sure that all interface routines and
5944 * datatypes exist and work the way we expect it, so we don't break
5945 * mplayer */
5946 ogg_packet op;
5947 theora_comment tc;
5948 theora_info inf;
5949 theora_state st;
5950 yuv_buffer yuv;
5951 int r;
5952 double t;
5954 theora_info_init (&inf);
5955 theora_comment_init (&tc);
5957 return 0;
5959 /* we don't want to execute this kind of nonsense; just for making sure
5960 * that compilation works... */
5961 memset(&op, 0, sizeof(op));
5962 r = theora_decode_header (&inf, &tc, &op);
5963 r = theora_decode_init (&st, &inf);
5964 t = theora_granule_time (&st, op.granulepos);
5965 r = theora_decode_packetin (&st, &op);
5966 r = theora_decode_YUVout (&st, &yuv);
5967 theora_clear (&st);
5969 return 0;
5972 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5973 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5974 && _theora=yes && break
5975 done
5976 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5977 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5978 cc_check -I. tremor/bitwise.c $_ld_theora \
5979 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5980 done
5983 if test "$_theora" = yes ; then
5984 _def_theora='#define HAVE_OGGTHEORA 1'
5985 _codecmodules="libtheora $_codecmodules"
5986 # when --enable-theora is forced, we'd better provide a probably sane
5987 # $_ld_theora than nothing
5988 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5989 else
5990 _def_theora='#undef HAVE_OGGTHEORA'
5991 _nocodecmodules="libtheora $_nocodecmodules"
5993 echores "$_theora"
5995 echocheck "internal mp3lib support"
5996 if test "$_mp3lib" = yes ; then
5997 _def_mp3lib='#define USE_MP3LIB 1'
5998 _codecmodules="mp3lib $_codecmodules"
5999 else
6000 _def_mp3lib='#undef USE_MP3LIB'
6001 _nocodecmodules="mp3lib $_nocodecmodules"
6003 echores "$_mp3lib"
6005 echocheck "internal liba52 support"
6006 if test "$_liba52" = yes ; then
6007 _def_liba52='#define USE_LIBA52 1'
6008 _codecmodules="liba52 $_codecmodules"
6009 else
6010 _def_liba52='#undef USE_LIBA52'
6011 _nocodecmodules="liba52 $_nocodecmodules"
6013 echores "$_liba52"
6015 echocheck "libdca support"
6016 if test "$_libdca" = auto ; then
6017 _libdca=no
6018 cat > $TMPC << EOF
6019 #include <inttypes.h>
6020 #include <dts.h>
6021 int main(void) { dts_init (0); return 0; }
6023 for _ld_dca in -ldts -ldca ; do
6024 cc_check $_ld_dca $_ld_lm && _ld_extra="$_ld_extra $_ld_dca" \
6025 && _libdca=yes && break
6026 done
6028 if test "$_libdca" = yes ; then
6029 _def_libdca='#define USE_LIBDCA 1'
6030 _codecmodules="libdca $_codecmodules"
6031 else
6032 _def_libdca='#undef USE_LIBDCA'
6033 _nocodecmodules="libdca $_nocodecmodules"
6035 echores "$_libdca"
6037 echocheck "internal libmpeg2 support"
6038 if test "$_libmpeg2" = yes ; then
6039 _def_libmpeg2='#define USE_LIBMPEG2 1'
6040 _codecmodules="libmpeg2 $_codecmodules"
6041 else
6042 _def_libmpeg2='#undef USE_LIBMPEG2'
6043 _nocodecmodules="libmpeg2 $_nocodecmodules"
6045 echores "$_libmpeg2"
6047 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6048 if test "$_musepack" = auto ; then
6049 _musepack=no
6050 cat > $TMPC << EOF
6051 #include <mpcdec/mpcdec.h>
6052 int main(void) {
6053 mpc_streaminfo info;
6054 mpc_decoder decoder;
6055 mpc_decoder_set_streaminfo(&decoder, &info);
6056 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6059 cc_check -lmpcdec $_ld_lm && _musepack=yes
6061 if test "$_musepack" = yes ; then
6062 _def_musepack='#define HAVE_MUSEPACK 1'
6063 _ld_extra="$_ld_extra -lmpcdec"
6064 _codecmodules="musepack $_codecmodules"
6065 else
6066 _def_musepack='#undef HAVE_MUSEPACK'
6067 _nocodecmodules="musepack $_nocodecmodules"
6069 echores "$_musepack"
6072 echocheck "FAAC (AAC encoder) support"
6073 if test "$_faac" = auto ; then
6074 cat > $TMPC <<EOF
6075 #include <inttypes.h>
6076 #include <faac.h>
6077 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6079 _faac=no
6080 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6081 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6082 done
6084 if test "$_faac" = yes ; then
6085 _def_faac="#define HAVE_FAAC 1"
6086 if echo $_libavencoders | grep -q FAAC ; then
6087 _lavc_faac=yes
6088 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
6089 _libs_mplayer="$_libs_mplayer $_ld_faac"
6090 else
6091 _lavc_faac=no
6092 _def_lavc_faac="#undef CONFIG_LIBFAAC"
6094 _codecmodules="faac $_codecmodules"
6095 else
6096 _def_faac="#undef HAVE_FAAC"
6097 _nocodecmodules="faac $_nocodecmodules"
6098 _libavencoders=`echo $_libavencoders | sed -e s/LIBFAAC_ENCODER// `
6100 echores "$_faac (in libavcodec: $_lavc_faac)"
6103 echocheck "FAAD2 (AAC) support"
6104 if test "$_faad_internal" = auto ; then
6105 if x86_32 && test cc_vendor=gnu; then
6106 case $cc_version in
6107 3.1*|3.2) # ICE/insn with these versions
6108 _faad_internal=no
6109 _res_comment="broken gcc"
6112 _faad_internal=yes
6114 esac
6115 else
6116 _faad_internal=yes
6118 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6119 _faad_external=no
6120 cat > $TMPC << EOF
6121 #include <faad.h>
6122 #ifndef FAAD_MIN_STREAMSIZE
6123 #error Too old version
6124 #endif
6125 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6127 cc_check -lfaad $_ld_lm && _faad_external=yes
6130 if test "$_faad_internal" = yes ; then
6131 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6132 _faad=yes
6133 _res_comment="internal floating-point"
6134 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
6135 elif test "$_faad_external" = yes ; then
6136 _faad=yes
6137 _ld_extra="$_ld_extra -lfaad"
6138 else
6139 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6140 _faad=no
6143 if test "$_faad" = yes ; then
6144 _def_faad='#define HAVE_FAAD 1'
6145 _codecmodules="faad2 $_codecmodules"
6146 else
6147 _def_faad='#undef HAVE_FAAD'
6148 _nocodecmodules="faad2 $_nocodecmodules"
6150 echores "$_faad"
6153 echocheck "LADSPA plugin support"
6154 if test "$_ladspa" = auto ; then
6155 cat > $TMPC <<EOF
6156 #include <stdio.h>
6157 #include <ladspa.h>
6158 int main(void) {
6159 const LADSPA_Descriptor *ld = NULL;
6160 return 0;
6163 _ladspa=no
6164 cc_check && _ladspa=yes
6166 if test "$_ladspa" = yes; then
6167 _def_ladspa="#define HAVE_LADSPA"
6168 _afsrc="$_afsrc af_ladspa.c"
6169 _afmodules="ladspa $_afmodules"
6170 else
6171 _def_ladspa="#undef HAVE_LADSPA"
6172 _noafmodules="ladspa $_noafmodules"
6174 echores "$_ladspa"
6177 if test -z "$_codecsdir" ; then
6178 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6179 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6180 if test -d "$dir" ; then
6181 _codecsdir="$dir"
6182 break;
6184 done
6186 # Fall back on default directory.
6187 if test -z "$_codecsdir" ; then
6188 _codecsdir="$_libdir/codecs"
6189 mingw32 && _codecsdir="codecs"
6193 echocheck "Win32 codecs"
6194 if test "$_win32dll" = auto ; then
6195 _win32dll=no
6196 if x86_32 && ! qnx; then
6197 _win32dll=yes
6200 if test "$_win32dll" = yes ; then
6201 _def_win32dll='#define USE_WIN32DLL 1'
6202 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6203 _res_comment="using $_win32codecsdir"
6204 if ! win32 ; then
6205 _def_win32_loader='#define WIN32_LOADER 1'
6206 else
6207 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6208 _res_comment="using native windows"
6210 _codecmodules="win32 $_codecmodules"
6211 else
6212 _def_win32dll='#undef USE_WIN32DLL'
6213 _def_win32_loader='#undef WIN32_LOADER'
6214 _nocodecmodules="win32 $_nocodecmodules"
6216 echores "$_win32dll"
6219 echocheck "XAnim codecs"
6220 if test "$_xanim" = auto ; then
6221 _xanim=no
6222 _res_comment="dynamic loader support needed"
6223 if test "$_dl" = yes ; then
6224 _xanim=yes
6227 if test "$_xanim" = yes ; then
6228 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6229 _def_xanim='#define USE_XANIM 1'
6230 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6231 _codecmodules="xanim $_codecmodules"
6232 _res_comment="using $_xanimcodecsdir"
6233 else
6234 _def_xanim='#undef USE_XANIM'
6235 _def_xanim_path='#undef XACODEC_PATH'
6236 _nocodecmodules="xanim $_nocodecmodules"
6238 echores "$_xanim"
6241 echocheck "RealPlayer codecs"
6242 if test "$_real" = auto ; then
6243 _real=no
6244 _res_comment="dynamic loader support needed"
6245 if test "$_dl" = yes || test "$_win32dll" = yes &&
6246 (linux || freebsd || netbsd || win32 || darwin) ; then
6247 _real=yes
6250 if test "$_real" = yes ; then
6251 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6252 _def_real='#define USE_REALCODECS 1'
6253 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6254 _codecmodules="real $_codecmodules"
6255 _res_comment="using $_realcodecsdir"
6256 else
6257 _def_real='#undef USE_REALCODECS'
6258 _def_real_path="#undef REALCODEC_PATH"
6259 _nocodecmodules="real $_nocodecmodules"
6261 echores "$_real"
6264 echocheck "QuickTime codecs"
6265 if test "$_qtx" = auto ; then
6266 test "$_win32dll" = yes || darwin && _qtx=yes
6268 if test "$_qtx" = yes ; then
6269 _def_qtx='#define USE_QTX_CODECS 1'
6270 _codecmodules="qtx $_codecmodules"
6271 else
6272 _def_qtx='#undef USE_QTX_CODECS'
6273 _nocodecmodules="qtx $_nocodecmodules"
6275 echores "$_qtx"
6277 echocheck "Nemesi Streaming Media libraries"
6278 if test "$_nemesi" = auto && test "$_network" = yes ; then
6279 _nemesi=no
6280 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6281 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6282 _nemesi=yes
6285 if test "$_nemesi" = yes; then
6286 _native_rtsp=no
6287 _def_nemesi='#define LIBNEMESI 1'
6288 _inputmodules="nemesi $_inputmodules"
6289 else
6290 _native_rtsp="$_network"
6291 _nemesi=no
6292 _def_nemesi='#undef LIBNEMESI'
6293 _noinputmodules="nemesi $_noinputmodules"
6295 echores "$_nemesi"
6297 echocheck "LIVE555 Streaming Media libraries"
6298 if test "$_live" = auto && test "$_network" = yes ; then
6299 cat > $TMPCPP << EOF
6300 #include <liveMedia.hh>
6301 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6302 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6303 #endif
6304 int main(void) {}
6307 _live=no
6308 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6309 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6310 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6311 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6312 $_livelibdir/groupsock/libgroupsock.a \
6313 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6314 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6315 $_ld_extra -lstdc++" \
6316 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6317 -I$_livelibdir/UsageEnvironment/include \
6318 -I$_livelibdir/BasicUsageEnvironment/include \
6319 -I$_livelibdir/groupsock/include" && \
6320 _live=yes && break
6321 done
6322 if test "$_live" != yes ; then
6323 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6324 _live_dist=yes
6328 if test "$_live" = yes && test "$_network" = yes; then
6329 _res_comment="using $_livelibdir"
6330 _def_live='#define STREAMING_LIVE555 1'
6331 _inputmodules="live555 $_inputmodules"
6332 elif test "$_live_dist" = yes && test "$_network" = yes; then
6333 _res_comment="using distribution version"
6334 _live="yes"
6335 _def_live='#define STREAMING_LIVE555 1'
6336 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6337 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6338 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6339 _inputmodules="live555 $_inputmodules"
6340 else
6341 _live=no
6342 _def_live='#undef STREAMING_LIVE555'
6343 _noinputmodules="live555 $_noinputmodules"
6345 echores "$_live"
6348 echocheck "FFmpeg libavutil"
6349 if test "$_libavutil_a" = auto ; then
6350 if test -d libavutil ; then
6351 _libavutil_a=yes
6352 _res_comment="static"
6353 else
6354 die "MPlayer will not compile without libavutil in the source tree."
6356 elif test "$_libavutil_so" = auto ; then
6357 _libavutil_so=no
6358 cat > $TMPC << EOF
6359 #include <ffmpeg/common.h>
6360 int main(void) { ff_gcd(1,1); return 0; }
6362 if $_pkg_config --exists libavutil ; then
6363 _inc_libavutil=`$_pkg_config --cflags libavutil`
6364 _ld_tmp=`$_pkg_config --libs libavutil`
6365 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6366 && _libavutil_so=yes
6367 elif cc_check -lavutil $_ld_lm ; then
6368 _ld_extra="$_ld_extra -lavutil"
6369 _libavutil_so=yes
6370 _res_comment="using libavutil.so, but static libavutil is recommended"
6373 _libavutil=no
6374 _def_libavutil='#undef USE_LIBAVUTIL'
6375 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6376 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6377 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6378 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6379 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6380 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6381 # neither static nor shared libavutil is available, but it is mandatory ...
6382 if test "$_libavutil" = no ; then
6383 die "You need static or shared libavutil, MPlayer will not compile without!"
6385 echores "$_libavutil"
6387 echocheck "FFmpeg libavcodec"
6388 if test "$_libavcodec_a" = auto ; then
6389 _libavcodec_a=no
6390 if test -d libavcodec && test -f libavcodec/utils.c ; then
6391 _libavcodec_a="yes"
6392 _res_comment="static"
6394 elif test "$_libavcodec_so" = auto ; then
6395 _libavcodec_so=no
6396 _res_comment="libavcodec.so is discouraged over static libavcodec"
6397 cat > $TMPC << EOF
6398 #include <ffmpeg/avcodec.h>
6399 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6401 if $_pkg_config --exists libavcodec ; then
6402 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6403 _ld_tmp=`$_pkg_config --libs libavcodec`
6404 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6405 && _libavcodec_so=yes
6406 elif cc_check -lavcodec $_ld_lm ; then
6407 _ld_extra="$_ld_extra -lavcodec"
6408 _libavcodec_so=yes
6409 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6412 _libavcodec=no
6413 _def_libavcodec='#undef USE_LIBAVCODEC'
6414 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6415 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6416 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6417 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6418 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6419 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6420 test "$_libavcodec_mpegaudio_hp" = yes \
6421 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6422 if test "$_libavcodec_a" = yes ; then
6423 _codecmodules="libavcodec $_codecmodules"
6424 elif test "$_libavcodec_so" = yes ; then
6425 _codecmodules="libavcodec.so $_codecmodules"
6426 else
6427 _nocodecmodules="libavcodec $_nocodecmodules"
6429 echores "$_libavcodec"
6431 echocheck "FFmpeg libavformat"
6432 if test "$_libavformat_a" = auto ; then
6433 _libavformat_a=no
6434 if test -d libavformat && test -f libavformat/utils.c ; then
6435 _libavformat_a=yes
6436 _res_comment="static"
6438 elif test "$_libavformat_so" = auto ; then
6439 _libavformat_so=no
6440 cat > $TMPC <<EOF
6441 #include <ffmpeg/avformat.h>
6442 #include <ffmpeg/opt.h>
6443 int main(void) { av_alloc_format_context(); return 0; }
6445 if $_pkg_config --exists libavformat ; then
6446 _inc_libavformat=`$_pkg_config --cflags libavformat`
6447 _ld_tmp=`$_pkg_config --libs libavformat`
6448 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6449 && _libavformat_so=yes
6450 elif cc_check $_ld_lm -lavformat ; then
6451 _ld_extra="$_ld_extra -lavformat"
6452 _libavformat_so=yes
6453 _res_comment="using libavformat.so, but static libavformat is recommended"
6456 _libavformat=no
6457 _def_libavformat='#undef USE_LIBAVFORMAT'
6458 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6459 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6460 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6461 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6462 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6463 test "$_libavformat_so" = yes \
6464 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6465 echores "$_libavformat"
6467 echocheck "FFmpeg libpostproc"
6468 if test "$_libpostproc_a" = auto ; then
6469 _libpostproc_a=no
6470 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6471 _libpostproc_a='yes'
6472 _res_comment="static"
6474 elif test "$_libpostproc_so" = auto ; then
6475 _libpostproc_so=no
6476 cat > $TMPC << EOF
6477 #define USE_LIBPOSTPROC 1
6478 #include <inttypes.h>
6479 #include <postproc/postprocess.h>
6480 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6482 if cc_check -lpostproc $_ld_lm ; then
6483 _ld_extra="$_ld_extra -lpostproc"
6484 _libpostproc_so=yes
6485 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6488 _libpostproc=no
6489 _def_libpostproc='#undef USE_LIBPOSTPROC'
6490 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6491 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6492 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6493 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6494 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6495 test "$_libpostproc_so" = yes \
6496 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6497 echores "$_libpostproc"
6500 echocheck "libamr narrowband"
6501 if test "$_libamr_nb" = auto ; then
6502 _libamr_nb=no
6503 cat > $TMPC << EOF
6504 #include <amrnb/interf_dec.h>
6505 int main(void) { Speech_Decode_Frame_init(); return 0; }
6507 cc_check -lamrnb && _libamr_nb=yes
6508 if test "$_libavcodec_a" != yes ; then
6509 _libamr_nb=no
6510 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6513 if test "$_libamr_nb" = yes ; then
6514 _libamr=yes
6515 _ld_extra="$_ld_extra -lamrnb"
6516 _def_libamr='#define CONFIG_LIBAMR 1'
6517 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6518 _codecmodules="libamr_nb $_codecmodules"
6519 else
6520 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6521 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6522 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6523 _nocodecmodules="libamr_nb $_nocodecmodules"
6525 echores "$_libamr_nb"
6528 echocheck "libamr wideband"
6529 if test "$_libamr_wb" = auto ; then
6530 _libamr_wb=no
6531 cat > $TMPC << EOF
6532 #include <amrwb/dec_if.h>
6533 int main(void) { D_IF_init(); return 0; }
6535 cc_check -lamrwb && _libamr_wb=yes
6536 if test "$_libavcodec_a" != yes ; then
6537 _libamr_wb=no
6538 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6541 if test "$_libamr_wb" = yes ; then
6542 _libamr=yes
6543 _ld_extra="$_ld_extra -lamrwb"
6544 _def_libamr='#define CONFIG_LIBAMR 1'
6545 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6546 _codecmodules="libamr_wb $_codecmodules"
6547 else
6548 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6549 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6550 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6551 _nocodecmodules="libamr_wb $_nocodecmodules"
6553 echores "$_libamr_wb"
6555 echocheck "libdv-0.9.5+"
6556 if test "$_libdv" = auto ; then
6557 _libdv=no
6558 cat > $TMPC <<EOF
6559 #include <libdv/dv.h>
6560 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6562 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6564 if test "$_libdv" = yes ; then
6565 _def_libdv='#define HAVE_LIBDV095 1'
6566 _ld_extra="$_ld_extra -ldv"
6567 _codecmodules="libdv $_codecmodules"
6568 else
6569 _def_libdv='#undef HAVE_LIBDV095'
6570 _nocodecmodules="libdv $_nocodecmodules"
6572 echores "$_libdv"
6575 echocheck "XviD"
6576 if test "$_xvid" = auto ; then
6577 _xvid=no
6578 cat > $TMPC << EOF
6579 #include <xvid.h>
6580 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6582 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6583 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6584 done
6587 if test "$_xvid" = yes ; then
6588 _def_xvid='#define HAVE_XVID4 1'
6589 _codecmodules="xvid $_codecmodules"
6590 else
6591 _def_xvid='#undef HAVE_XVID4'
6592 _nocodecmodules="xvid $_nocodecmodules"
6593 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6595 echores "$_xvid"
6597 if test "$_xvid" = yes ; then
6598 echocheck "XviD two pass plugin"
6599 cat > $TMPC << EOF
6600 #include <xvid.h>
6601 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6603 if cc_check ; then
6604 _lavc_xvid=yes
6605 _def_lavc_xvid='#define CONFIG_LIBXVID 1'
6606 else
6607 _lavc_xvid=no
6608 _def_lavc_xvid='#undef CONFIG_LIBXVID'
6609 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6611 echores "$_lavc_xvid"
6615 echocheck "x264"
6616 if test "$_x264" = auto ; then
6617 cat > $TMPC << EOF
6618 #include <inttypes.h>
6619 #include <x264.h>
6620 #if X264_BUILD < 53
6621 #error We do not support old versions of x264. Get the latest from SVN.
6622 #endif
6623 int main(void) { x264_encoder_open((void*)0); return 0; }
6625 _x264=no
6626 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6627 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6628 done
6631 if test "$_x264" = yes ; then
6632 _def_x264='#define HAVE_X264 1'
6633 _codecmodules="x264 $_codecmodules"
6634 if echo $_libavencoders | grep -q X264 ; then
6635 _lavc_x264=yes
6636 _def_lavc_x264='#define CONFIG_LIBX264 1'
6637 _libs_mplayer="$_libs_mplayer $_ld_x264"
6638 else
6639 _lavc_x264=no
6640 _def_lavc_x264='#undef CONFIG_LIBX264'
6642 else
6643 _lavc_x264=no
6644 _def_x264='#undef HAVE_X264'
6645 _def_lavc_x264='#undef CONFIG_LIBX264'
6646 _nocodecmodules="x264 $_nocodecmodules"
6647 _libavencoders=`echo $_libavencoders | sed -e s/LIBX264_ENCODER// `
6649 echores "$_x264 (in libavcodec: $_lavc_x264)"
6652 echocheck "libnut"
6653 if test "$_libnut" = auto ; then
6654 cat > $TMPC << EOF
6655 #include <stdio.h>
6656 #include <stdlib.h>
6657 #include <inttypes.h>
6658 #include <libnut.h>
6659 int main(void) { (void)nut_error(0); return 0; }
6661 _libnut=no
6662 cc_check -lnut && _libnut=yes
6665 if test "$_libnut" = yes ; then
6666 _def_libnut='#define HAVE_LIBNUT 1'
6667 _ld_extra="$_ld_extra -lnut"
6668 else
6669 _def_libnut='#undef HAVE_LIBNUT'
6670 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6672 echores "$_libnut"
6675 # mencoder requires (optional) those libs: libmp3lame
6676 if test "$_mencoder" != no ; then
6678 echocheck "libmp3lame (for mencoder)"
6679 _mp3lame=no
6680 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6681 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6682 cat > $TMPC <<EOF
6683 #include <lame/lame.h>
6684 int main(void) { lame_version_t lv; (void) lame_init(); get_lame_version_numerical(&lv); printf("%d%d\n",lv.major,lv.minor); return 0; }
6686 # Note: libmp3lame usually depends on vorbis
6687 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6688 if test "$_mp3lame" = yes ; then
6689 _def_mp3lame="#define HAVE_MP3LAME"
6690 _ld_mp3lame=-lmp3lame
6691 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6692 cat > $TMPC << EOF
6693 #include <lame/lame.h>
6694 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6696 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6697 cat > $TMPC << EOF
6698 #include <lame/lame.h>
6699 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6701 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6702 if echo $_libavencoders | grep -q MP3LAME ; then
6703 _lavc_mp3lame=yes
6704 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6705 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6706 else
6707 _lavc_mp3lame=no
6708 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6710 else
6711 _def_mp3lame='#undef HAVE_MP3LAME'
6712 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6714 echores "$_mp3lame"
6718 echocheck "mencoder"
6719 _mencoder_flag='#undef HAVE_MENCODER'
6720 if test "$_mencoder" = yes ; then
6721 _mencoder_flag='#define HAVE_MENCODER'
6722 _def_muxers='#define CONFIG_MUXERS 1'
6723 else
6724 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6725 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6726 _libavmuxers=""
6728 echores "$_mencoder"
6730 echocheck "fastmemcpy"
6731 # fastmemcpy check is done earlier with tests of CPU & binutils features
6732 if test "$_fastmemcpy" = yes ; then
6733 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6734 else
6735 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6737 echores "$_fastmemcpy"
6740 echocheck "UnRAR executable"
6741 if test "$_unrar_exec" = auto ; then
6742 _unrar_exec="yes"
6743 mingw32 && _unrar_exec="no"
6745 if test "$_unrar_exec" = yes ; then
6746 _def_unrar_exec='#define USE_UNRAR_EXEC 1'
6747 else
6748 _def_unrar_exec='#undef USE_UNRAR_EXEC'
6750 echores "$_unrar_exec"
6752 echocheck "TV interface"
6753 if test "$_tv" = yes ; then
6754 _def_tv='#define USE_TV 1'
6755 _inputmodules="tv $_inputmodules"
6756 else
6757 _noinputmodules="tv $_noinputmodules"
6758 _def_tv='#undef USE_TV'
6760 echores "$_tv"
6763 if bsd; then
6764 echocheck "*BSD BT848 bt8xx header"
6765 _ioctl_bt848_h=no
6766 for file in "machine/ioctl_bt848.h" \
6767 "dev/bktr/ioctl_bt848.h" \
6768 "dev/video/bktr/ioctl_bt848.h" \
6769 "dev/ic/bt8xx.h" ; do
6770 cat > $TMPC <<EOF
6771 #include <sys/types.h>
6772 #include <sys/ioctl.h>
6773 #include <$file>
6774 int main(void) {
6775 ioctl(0, TVTUNER_GETFREQ, 0);
6776 return 0;
6779 if cc_check ; then
6780 _ioctl_bt848_h=yes
6781 _ioctl_bt848_h_name="$file"
6782 break;
6784 done
6785 if test "$_ioctl_bt848_h" = yes ; then
6786 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6787 _res_comment="using $_ioctl_bt848_h_name"
6788 else
6789 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6791 echores "$_ioctl_bt848_h"
6793 echocheck "*BSD ioctl_meteor.h"
6794 _ioctl_meteor_h=no
6795 for file in "machine/ioctl_meteor.h" \
6796 "dev/bktr/ioctl_meteor.h" \
6797 "dev/video/bktr/ioctl_meteor.h" ; do
6798 cat > $TMPC <<EOF
6799 #include <sys/types.h>
6800 #include <$file>
6801 int main(void) {
6802 ioctl(0, METEORSINPUT, 0);
6803 return 0;
6806 if cc_check ; then
6807 _ioctl_meteor_h=yes
6808 _ioctl_meteor_h_name="$file"
6809 break;
6811 done
6812 if test "$_ioctl_meteor_h" = yes ; then
6813 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6814 _res_comment="using $_ioctl_meteor_h_name"
6815 else
6816 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6818 echores "$_ioctl_meteor_h"
6820 echocheck "*BSD BrookTree 848 TV interface"
6821 if test "$_tv_bsdbt848" = auto ; then
6822 _tv_bsdbt848=no
6823 if test "$_tv" = yes ; then
6824 cat > $TMPC <<EOF
6825 #include <sys/types.h>
6826 $_def_ioctl_meteor_h_name
6827 $_def_ioctl_bt848_h_name
6828 #ifdef IOCTL_METEOR_H_NAME
6829 #include IOCTL_METEOR_H_NAME
6830 #endif
6831 #ifdef IOCTL_BT848_H_NAME
6832 #include IOCTL_BT848_H_NAME
6833 #endif
6834 int main(void){
6835 ioctl(0, METEORSINPUT, 0);
6836 ioctl(0, TVTUNER_GETFREQ, 0);
6837 return 0;
6840 cc_check && _tv_bsdbt848=yes
6843 if test "$_tv_bsdbt848" = yes ; then
6844 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6845 _inputmodules="tv-bsdbt848 $_inputmodules"
6846 else
6847 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6848 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6850 echores "$_tv_bsdbt848"
6851 fi #if bsd
6854 echocheck "DirectShow TV interface"
6855 if test "$_tv_dshow" = auto ; then
6856 _tv_dshow=no
6857 if test "$_tv" = yes && win32 ; then
6858 cat > $TMPC <<EOF
6859 #include <ole2.h>
6860 int main(void) {
6861 void* p;
6862 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6863 return 0;
6866 cc_check -lole32 -luuid && _tv_dshow=yes
6869 if test "$_tv_dshow" = yes ; then
6870 _inputmodules="tv-dshow $_inputmodules"
6871 _def_tv_dshow='#define HAVE_TV_DSHOW 1'
6872 _ld_extra="$_ld_extra -lole32 -luuid"
6873 else
6874 _noinputmodules="tv-dshow $_noinputmodules"
6875 _def_tv_dshow='#undef HAVE_TV_DSHOW'
6877 echores "$_tv_dshow"
6880 echocheck "Video 4 Linux TV interface"
6881 if test "$_tv_v4l1" = auto ; then
6882 _tv_v4l1=no
6883 if test "$_tv" = yes && linux ; then
6884 cat > $TMPC <<EOF
6885 #include <stdlib.h>
6886 #include <linux/videodev.h>
6887 int main(void) { return 0; }
6889 cc_check && _tv_v4l1=yes
6892 if test "$_tv_v4l1" = yes ; then
6893 _audio_input=yes
6894 _tv_v4l=yes
6895 _def_tv_v4l='#define HAVE_TV_V4L 1'
6896 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6897 _inputmodules="tv-v4l $_inputmodules"
6898 else
6899 _noinputmodules="tv-v4l1 $_noinputmodules"
6900 _def_tv_v4l='#undef HAVE_TV_V4L'
6902 echores "$_tv_v4l1"
6905 echocheck "Video 4 Linux 2 TV interface"
6906 if test "$_tv_v4l2" = auto ; then
6907 _tv_v4l2=no
6908 if test "$_tv" = yes && linux ; then
6909 cat > $TMPC <<EOF
6910 #include <stdlib.h>
6911 #include <linux/types.h>
6912 #include <linux/videodev2.h>
6913 int main(void) { return 0; }
6915 cc_check && _tv_v4l2=yes
6918 if test "$_tv_v4l2" = yes ; then
6919 _audio_input=yes
6920 _tv_v4l=yes
6921 _def_tv_v4l='#define HAVE_TV_V4L 1'
6922 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6923 _inputmodules="tv-v4l2 $_inputmodules"
6924 else
6925 _noinputmodules="tv-v4l2 $_noinputmodules"
6926 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6928 echores "$_tv_v4l2"
6931 echocheck "TV teletext interface"
6932 if test "$_tv_teletext" = auto ; then
6933 _tv_teletext=no
6934 if test "$_freetype" = yes && test "$_pthreads" = yes; then
6935 if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes; then
6936 _tv_teletext=yes
6940 if test "$_tv_teletext" = yes ; then
6941 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6942 _inputmodules="tv-teletext $_inputmodules"
6943 else
6944 _noinputmodules="tv-teletext $_noinputmodules"
6945 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6947 echores "$_tv_teletext"
6950 echocheck "Radio interface"
6951 if test "$_radio" = yes ; then
6952 _def_radio='#define USE_RADIO 1'
6953 _inputmodules="radio $_inputmodules"
6954 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6955 _radio_capture=no
6957 if test "$_radio_capture" = yes ; then
6958 _audio_input=yes
6959 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6960 else
6961 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6963 else
6964 _noinputmodules="radio $_noinputmodules"
6965 _def_radio='#undef USE_RADIO'
6966 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6967 _radio_capture=no
6969 echores "$_radio"
6970 echocheck "Capture for Radio interface"
6971 echores "$_radio_capture"
6973 echocheck "Video 4 Linux 2 Radio interface"
6974 if test "$_radio_v4l2" = auto ; then
6975 _radio_v4l2=no
6976 if test "$_radio" = yes && linux ; then
6977 cat > $TMPC <<EOF
6978 #include <stdlib.h>
6979 #include <linux/types.h>
6980 #include <linux/videodev2.h>
6981 int main(void) { return 0; }
6983 cc_check && _radio_v4l2=yes
6986 if test "$_radio_v4l2" = yes ; then
6987 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6988 else
6989 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6991 echores "$_radio_v4l2"
6993 echocheck "Video 4 Linux Radio interface"
6994 if test "$_radio_v4l" = auto ; then
6995 _radio_v4l=no
6996 if test "$_radio" = yes && linux ; then
6997 cat > $TMPC <<EOF
6998 #include <stdlib.h>
6999 #include <linux/videodev.h>
7000 int main(void) { return 0; }
7002 cc_check && _radio_v4l=yes
7005 if test "$_radio_v4l" = yes ; then
7006 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
7007 else
7008 _def_radio_v4l='#undef HAVE_RADIO_V4L'
7010 echores "$_radio_v4l"
7012 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7013 echocheck "*BSD BrookTree 848 Radio interface"
7014 _radio_bsdbt848=no
7015 cat > $TMPC <<EOF
7016 #include <sys/types.h>
7017 $_def_ioctl_bt848_h_name
7018 #ifdef IOCTL_BT848_H_NAME
7019 #include IOCTL_BT848_H_NAME
7020 #endif
7021 int main(void){
7022 ioctl(0, RADIO_GETFREQ, 0);
7023 return 0;
7026 cc_check && _radio_bsdbt848=yes
7027 echores "$_radio_bsdbt848"
7028 fi #if bsd && radio && radio_bsdbt848
7030 if test "$_radio_bsdbt848" = yes ; then
7031 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
7032 else
7033 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
7036 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7037 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7038 die "Radio driver requires BSD BT848, V4L or V4L2!"
7041 echocheck "Video 4 Linux 2 MPEG PVR interface"
7042 if test "$_pvr" = auto ; then
7043 _pvr=no
7044 if test "$_tv_v4l2" = yes && linux ; then
7045 cat > $TMPC <<EOF
7046 #include <stdlib.h>
7047 #include <inttypes.h>
7048 #include <linux/types.h>
7049 #include <linux/videodev2.h>
7050 int main(void) { struct v4l2_ext_controls ext; return 0; }
7052 cc_check && _pvr=yes
7055 if test "$_pvr" = yes ; then
7056 _def_pvr='#define HAVE_PVR 1'
7057 _inputmodules="pvr $_inputmodules"
7058 else
7059 _noinputmodules="pvr $_noinputmodules"
7060 _def_pvr='#undef HAVE_PVR'
7062 echores "$_pvr"
7065 echocheck "audio select()"
7066 if test "$_select" = no ; then
7067 _def_select='#undef HAVE_AUDIO_SELECT'
7068 elif test "$_select" = yes ; then
7069 _def_select='#define HAVE_AUDIO_SELECT 1'
7071 echores "$_select"
7074 echocheck "ftp"
7075 if ! beos && test "$_ftp" = yes ; then
7076 _def_ftp='#define HAVE_FTP 1'
7077 _inputmodules="ftp $_inputmodules"
7078 else
7079 _noinputmodules="ftp $_noinputmodules"
7080 _def_ftp='#undef HAVE_FTP'
7082 echores "$_ftp"
7084 echocheck "vstream client"
7085 if test "$_vstream" = auto ; then
7086 _vstream=no
7087 cat > $TMPC <<EOF
7088 #include <vstream-client.h>
7089 void vstream_error(const char *format, ... ) {}
7090 int main(void) { vstream_start(); return 0; }
7092 cc_check -lvstream-client && _vstream=yes
7094 if test "$_vstream" = yes ; then
7095 _def_vstream='#define HAVE_VSTREAM 1'
7096 _inputmodules="vstream $_inputmodules"
7097 _ld_extra="$_ld_extra -lvstream-client"
7098 else
7099 _noinputmodules="vstream $_noinputmodules"
7100 _def_vstream='#undef HAVE_VSTREAM'
7102 echores "$_vstream"
7104 # endian testing
7105 echocheck "byte order"
7106 if test "$_big_endian" = auto ; then
7107 cat > $TMPC <<EOF
7108 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7109 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7110 int main(void){
7111 return (int)ascii_name;
7114 if cc_check ; then
7115 if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
7116 _big_endian=yes
7117 else
7118 _big_endian=no
7120 else
7121 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7124 if test "$_big_endian" = yes ; then
7125 _byte_order='big-endian'
7126 _def_words_endian='#define WORDS_BIGENDIAN 1'
7127 else
7128 _byte_order='little-endian'
7129 _def_words_endian='#undef WORDS_BIGENDIAN'
7131 echores "$_byte_order"
7133 echocheck "OSD menu"
7134 if test "$_menu" = yes ; then
7135 _def_menu='#define HAVE_MENU 1'
7136 else
7137 _def_menu='#undef HAVE_MENU'
7139 echores "$_menu"
7142 echocheck "Subtitles sorting"
7143 if test "$_sortsub" = yes ; then
7144 _def_sortsub='#define USE_SORTSUB 1'
7145 else
7146 _def_sortsub='#undef USE_SORTSUB'
7148 echores "$_sortsub"
7151 echocheck "XMMS inputplugin support"
7152 if test "$_xmms" = yes ; then
7153 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7154 _xmmsplugindir=`xmms-config --input-plugin-dir`
7155 _xmmslibdir=`xmms-config --exec-prefix`/lib
7156 else
7157 _xmmsplugindir=/usr/lib/xmms/Input
7158 _xmmslibdir=/usr/lib
7161 _def_xmms='#define HAVE_XMMS 1'
7162 if darwin ; then
7163 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7164 else
7165 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7167 else
7168 _def_xmms='#undef HAVE_XMMS'
7170 echores "$_xmms"
7172 echocheck "inet6"
7173 if test "$_inet6" = auto ; then
7174 cat > $TMPC << EOF
7175 #include <sys/types.h>
7176 #if !defined(_WIN32) || defined(__CYGWIN__)
7177 #include <sys/socket.h>
7178 #include <netinet/in.h>
7179 #else
7180 #include <ws2tcpip.h>
7181 #endif
7182 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7184 _inet6=no
7185 if cc_check $_ld_sock ; then
7186 _inet6=yes
7189 if test "$_inet6" = yes ; then
7190 _def_inet6='#define HAVE_AF_INET6 1'
7191 else
7192 _def_inet6='#undef HAVE_AF_INET6'
7194 echores "$_inet6"
7197 echocheck "gethostbyname2"
7198 if test "$_gethostbyname2" = auto ; then
7199 cat > $TMPC << EOF
7200 #include <sys/types.h>
7201 #include <sys/socket.h>
7202 #include <netdb.h>
7203 int main(void) { gethostbyname2("", AF_INET); }
7205 _gethostbyname2=no
7206 if cc_check ; then
7207 _gethostbyname2=yes
7211 if test "$_gethostbyname2" = yes ; then
7212 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7213 else
7214 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7216 echores "$_gethostbyname2"
7219 # --------------- GUI specific tests begin -------------------
7220 echocheck "GUI"
7221 echo "$_gui"
7222 if test "$_gui" = yes ; then
7224 # Required libraries
7225 if test "$_libavcodec" != yes ||
7226 ! echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1 ; then
7227 die "The GUI requires libavcodec with PNG support (needs zlib)."
7229 test "$_freetype" = no && test "$_bitmap_font" = no && \
7230 die "The GUI requires either FreeType or bitmap font support."
7231 if ! win32 ; then
7232 test "$_x11" != yes && die "X11 support required for GUI compilation."
7234 echocheck "XShape extension"
7235 if test "$_xshape" = auto ; then
7236 _xshape=no
7237 cat > $TMPC << EOF
7238 #include <X11/Xlib.h>
7239 #include <X11/Xproto.h>
7240 #include <X11/Xutil.h>
7241 #include <X11/extensions/shape.h>
7242 #include <stdlib.h>
7243 int main(void) {
7244 char *name = ":0.0";
7245 Display *wsDisplay;
7246 int exitvar = 0;
7247 int eventbase, errorbase;
7248 if (getenv("DISPLAY"))
7249 name=getenv("DISPLAY");
7250 wsDisplay=XOpenDisplay(name);
7251 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7252 exitvar=1;
7253 XCloseDisplay(wsDisplay);
7254 return exitvar;
7257 cc_check -lXext && _xshape=yes
7259 if test "$_xshape" = yes ; then
7260 _def_xshape='#define HAVE_XSHAPE 1'
7261 else
7262 die "The GUI requires the X11 extension XShape (which was not found)."
7264 echores "$_xshape"
7266 #Check for GTK
7267 if test "$_gtk1" = no ; then
7268 #Check for GTK2 :
7269 echocheck "GTK+ version"
7271 if $_pkg_config gtk+-2.0 --exists ; then
7272 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7273 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7274 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7275 echores "$_gtk"
7277 # Check for GLIB2
7278 if $_pkg_config glib-2.0 --exists ; then
7279 echocheck "glib version"
7280 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7281 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7282 echores "$_glib"
7284 _def_gui='#define HAVE_NEW_GUI 1'
7285 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7286 else
7287 _gtk1=yes
7288 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7290 else
7291 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7292 _gtk1=yes
7296 if test "$_gtk1" = yes ; then
7297 # Check for old GTK (1.2.x)
7298 echocheck "GTK version"
7299 if test -z "$_gtkconfig" ; then
7300 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7301 _gtkconfig="gtk-config"
7302 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7303 _gtkconfig="gtk12-config"
7304 else
7305 die "The GUI requires GTK devel packages (which were not found)."
7308 _gtk=`$_gtkconfig --version 2>&1`
7309 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7310 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7311 echores "$_gtk (using $_gtkconfig)"
7313 # Check for GLIB
7314 echocheck "glib version"
7315 if test -z "$_glibconfig" ; then
7316 if ( glib-config --version ) >/dev/null 2>&1 ; then
7317 _glibconfig="glib-config"
7318 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7319 _glibconfig="glib12-config"
7320 else
7321 die "The GUI requires GLIB devel packages (which were not found)"
7324 _glib=`$_glibconfig --version 2>&1`
7325 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7326 echores "$_glib (using $_glibconfig)"
7328 _def_gui='#define HAVE_NEW_GUI 1'
7329 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7332 else #if ! win32
7333 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7334 _def_gui='#define HAVE_NEW_GUI 1'
7335 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7336 fi #if ! win32
7338 else #if test "$_gui"
7339 _def_gui='#undef HAVE_NEW_GUI'
7340 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7341 fi #if test "$_gui"
7342 # --------------- GUI specific tests end -------------------
7345 if test "$_charset" = "noconv" ; then
7346 _charset=""
7348 if test "$_charset" ; then
7349 _def_charset="#define MSG_CHARSET \"$_charset\""
7350 else
7351 _def_charset="#undef MSG_CHARSET"
7354 if test "$_charset" = "UTF-8" ; then
7355 # hack to disable conversion in the Makefile
7356 _charset=""
7359 if test "$_charset" ; then
7360 echocheck "iconv program"
7361 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7362 if test "$?" -ne 0 ; then
7363 echores "no"
7364 echo "No working iconv program found, use "
7365 echo "--charset=UTF-8 to continue anyway."
7366 echo "If you also have problems with iconv library functions use --charset=noconv."
7367 echo "Messages in the GTK-2 interface will be broken then."
7368 exit 1
7369 else
7370 echores "yes"
7374 #############################################################################
7376 echocheck "automatic gdb attach"
7377 if test "$_crash_debug" = yes ; then
7378 _def_crash_debug='#define CRASH_DEBUG 1'
7379 else
7380 _def_crash_debug='#undef CRASH_DEBUG'
7381 _crash_debug=no
7383 echores "$_crash_debug"
7385 echocheck "compiler support for noexecstack"
7386 cat > $TMPC <<EOF
7387 int main(void) { return 0; }
7389 if cc_check -Wl,-z,noexecstack ; then
7390 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7391 echores "yes"
7392 else
7393 echores "no"
7397 # Dynamic linking flags
7398 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7399 _ld_dl_dynamic=''
7400 bsd && _ld_dl_dynamic='-rdynamic'
7401 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin ; then
7402 _ld_dl_dynamic='-rdynamic'
7405 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7406 bsdos && _ld_extra="$_ld_extra -ldvd"
7407 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7408 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7410 _def_debug='#undef MP_DEBUG'
7411 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7413 _def_linux='#undef TARGET_LINUX'
7414 linux && _def_linux='#define TARGET_LINUX 1'
7417 echocheck "joystick"
7418 _def_joystick='#undef HAVE_JOYSTICK'
7419 if test "$_joystick" = yes ; then
7420 if linux ; then
7421 # TODO add some check
7422 _def_joystick='#define HAVE_JOYSTICK 1'
7423 else
7424 _joystick="no (unsupported under $system_name)"
7427 echores "$_joystick"
7429 echocheck "lirc"
7430 if test "$_lirc" = auto ; then
7431 _lirc=no
7432 cat > $TMPC <<EOF
7433 #include <lirc/lirc_client.h>
7434 int main(void) { return 0; }
7436 cc_check -llirc_client && _lirc=yes
7438 if test "$_lirc" = yes ; then
7439 _def_lirc='#define HAVE_LIRC 1'
7440 _ld_extra="$_ld_extra -llirc_client"
7441 else
7442 _def_lirc='#undef HAVE_LIRC'
7444 echores "$_lirc"
7446 echocheck "lircc"
7447 if test "$_lircc" = auto ; then
7448 _lircc=no
7449 cat > $TMPC <<EOF
7450 #include <lirc/lircc.h>
7451 int main(void) { return 0; }
7453 cc_check -llircc && _lircc=yes
7455 if test "$_lircc" = yes ; then
7456 _def_lircc='#define HAVE_LIRCC 1'
7457 _ld_extra="$_ld_extra -llircc"
7458 else
7459 _def_lircc='#undef HAVE_LIRCC'
7461 echores "$_lircc"
7463 if arm; then
7464 # Detect maemo development platform libraries availability (http://www.maemo.org),
7465 # they are used when run on Nokia 770
7466 echocheck "maemo (Nokia 770)"
7467 if test "$_maemo" = auto ; then
7468 _maemo=no
7469 cat > $TMPC << EOF
7470 #include <libosso.h>
7471 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7473 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7475 if test "$_maemo" = yes ; then
7476 _def_maemo='#define HAVE_MAEMO 1'
7477 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7478 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7479 else
7480 _def_maemo='#undef HAVE_MAEMO'
7482 echores "$_maemo"
7485 echocheck "color console output"
7486 if test "$_color_console" = yes ; then
7487 _def_color_console='#define MSG_USE_COLORS 1'
7488 else
7489 _def_color_console='#undef MSG_USE_COLORS'
7491 echores "$_color_console"
7493 # linker paths should be the same for mencoder and mplayer
7494 _ld_tmp=""
7495 for I in $_libs_mplayer ; do
7496 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7497 if test -z "$_tmp" ; then
7498 _ld_extra="$I $_ld_extra"
7499 else
7500 _ld_tmp="$_ld_tmp $I"
7502 done
7503 _libs_mplayer=$_ld_tmp
7506 #############################################################################
7507 if darwin ; then
7508 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
7509 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7510 CFLAGS="$CFLAGS -no-cpp-precomp"
7513 if amigaos ; then
7514 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__"
7516 if hpux ; then
7517 # use flag for HPUX missing setenv()
7518 CFLAGS="$CFLAGS -DHPUX"
7520 # Thread support
7521 if linux ; then
7522 CFLAGS="$CFLAGS -D_REENTRANT"
7523 elif bsd ; then
7524 # FIXME bsd needs this so maybe other OS'es
7525 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7527 if cygwin ; then
7528 CFLAGS="$CFLAGS -D__CYGWIN__"
7530 # 64 bit file offsets?
7531 if test "$_largefiles" = yes || freebsd ; then
7532 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7533 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7534 # dvdread support requires this (for off64_t)
7535 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7536 cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
7540 # Make sure config.h gets included.
7541 if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then
7542 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
7545 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7546 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7548 cat > $TMPC << EOF
7549 int main(void) { return 0; }
7551 if test "$cc_vendor" = "gnu" ; then
7552 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7553 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7554 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7558 #this must be the last test to be performed or the ones following it will likely fail
7559 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7560 # to use its own copy of the library)
7561 echocheck "DVD support (libdvdnav)"
7562 if test "$_dvdnav" = auto ; then
7563 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7565 if test "$_dvdnav" = auto ; then
7566 cat > $TMPC <<EOF
7567 #include <inttypes.h>
7568 #include <dvdnav/dvdnav.h>
7569 int main(void) { dvdnav_t *dvd=0; return 0; }
7571 _dvdnav=no
7572 _dvdnavdir=`$_dvdnavconfig --cflags`
7573 _dvdnavlibs=`$_dvdnavconfig --libs`
7574 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7576 if test "$_dvdnav" = yes ; then
7577 _largefiles=yes
7578 _def_dvdnav='#define USE_DVDNAV 1'
7579 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7580 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7581 _inputmodules="dvdnav $_inputmodules"
7582 else
7583 _def_dvdnav='#undef USE_DVDNAV'
7584 _noinputmodules="dvdnav $_noinputmodules"
7586 echores "$_dvdnav"
7588 #############################################################################
7589 echo "Creating config.mak"
7590 cat > config.mak << EOF
7591 # -------- Generated by configure -----------
7593 LANG = C
7594 MAN_LANG = $MAN_LANG
7595 TARGET_OS = $system_name
7596 DESTDIR =
7597 prefix = \$(DESTDIR)$_prefix
7598 BINDIR = \$(DESTDIR)$_bindir
7599 DATADIR = \$(DESTDIR)$_datadir
7600 MANDIR = \$(DESTDIR)$_mandir
7601 CONFDIR = \$(DESTDIR)$_confdir
7602 LIBDIR = \$(DESTDIR)$_libdir
7603 # FFmpeg uses libdir instead of LIBDIR
7604 libdir = \$(LIBDIR)
7605 AR = $_ar
7606 CC = $_cc
7607 CXX = $_cc
7608 HOST_CC = $_host_cc
7609 RANLIB = $_ranlib
7610 WINDRES = $_windres
7611 LDCONFIG = $_ldconfig
7612 INSTALL = $_install
7613 EXTRA_INC = $_inc_extra
7614 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7615 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7616 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7617 CFLAG_STACKREALIGN = $_stackrealign
7618 INSTALLSTRIP = $_install_strip
7619 CHARSET = $_charset
7620 HELP_FILE = $_mp_help
7622 EXESUF = $_exesuf
7624 MPLAYER_NETWORK = $_network
7625 FTP = $_ftp
7626 STREAMING_LIVE555 = $_live
7627 LIBNEMESI = $_nemesi
7628 NATIVE_RTSP = $_native_rtsp
7629 VSTREAM = $_vstream
7630 STREAM_CACHE = $_stream_cache
7631 DVBIN = $_dvbin
7632 VIDIX = $_vidix
7633 VIDIX_INTERNAL = $_vidix_internal
7634 VIDIX_EXTERNAL = $_vidix_external
7635 VIDIX_PCIDB = $_vidix_pcidb_val
7636 CONFIG_PP = yes
7637 MP3LAME = $_mp3lame
7638 LIBMENU = $_menu
7640 MP3LIB = $_mp3lib
7641 LIBA52 = $_liba52
7642 LIBMPEG2 = $_libmpeg2
7643 TREMOR_INTERNAL = $_tremor_internal
7644 TREMOR_LOW = $_tremor_low
7645 FAAD = $_faad
7647 SPEEX = $_speex
7648 MUSEPACK = $_musepack
7650 UNRAR_EXEC = $_unrar_exec
7651 PNG = $_png
7652 JPEG = $_jpeg
7653 GIF = $_gif
7655 EXTRALIBS = $_extra_libs
7656 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7657 EXTRALIBS_MPLAYER = $_libs_mplayer
7658 EXTRALIBS_MENCODER = $_libs_mencoder
7660 HAVE_MLIB = $_mlib
7661 HAVE_PTHREADS = $_pthreads
7662 HAVE_W32THREADS = $_w32threads
7664 HAVE_XVMC_ACCEL = $_xvmc
7666 HAVE_SYS_MMAN_H = $_mman
7667 HAVE_POSIX_SELECT = $_posix_select
7669 NEED_GETTIMEOFDAY = $_need_gettimeofday
7670 NEED_GLOB = $_need_glob
7671 NEED_SETENV = $_need_setenv
7672 NEED_SHMEM = $_need_shmem
7673 NEED_STRSEP = $_need_strsep
7674 NEED_SWAB = $_need_swab
7675 NEED_VSSCANF = $_need_vsscanf
7677 # for FFmpeg
7678 SRC_PATH=..
7679 BUILD_ROOT=..
7680 LIBPREF=lib
7681 LIBSUF=.a
7682 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7684 # audio output
7685 OSS = $_ossaudio
7686 ALSA = $_alsa
7687 ALSA5 = $_alsa5
7688 ALSA9 = $_alsa9
7689 ALSA1X = $_alsa1x
7691 # input/demuxer/codecs
7692 JOYSTICK = $_joystick
7693 LIRC = $_lirc
7694 APPLE_REMOTE = $_apple_remote
7695 TV = $_tv
7696 TV_V4L = $_tv_v4l
7697 TV_V4L1 = $_tv_v4l1
7698 TV_V4L2 = $_tv_v4l2
7699 TV_DSHOW = $_tv_dshow
7700 TV_BSDBT848 = $_tv_bsdbt848
7701 TV_TELETEXT = $_tv_teletext
7702 AUDIO_INPUT = $_audio_input
7703 PVR = $_pvr
7704 VCD = $_vcd
7705 DVDREAD = $_dvdread
7706 DVDREAD_INTERNAL = $_dvdread_internal
7707 DVDCSS_INTERNAL = $_libdvdcss_internal
7708 DVDNAV = $_dvdnav
7709 WIN32DLL = $_win32dll
7710 QTX_CODECS = $_qtx
7711 REAL_CODECS = $_real
7712 XANIM_CODECS = $_xanim
7713 LIBAVUTIL = $_libavutil
7714 LIBAVUTIL_A = $_libavutil_a
7715 LIBAVUTIL_SO = $_libavutil_so
7716 LIBAVCODEC = $_libavcodec
7717 LIBAVCODEC_A = $_libavcodec_a
7718 LIBAVCODEC_SO = $_libavcodec_so
7719 LIBAVFORMAT = $_libavformat
7720 LIBAVFORMAT_A = $_libavformat_a
7721 LIBAVFORMAT_SO = $_libavformat_so
7722 LIBPOSTPROC = $_libpostproc
7723 LIBPOSTPROC_A = $_libpostproc_a
7724 LIBPOSTPROC_SO = $_libpostproc_so
7725 ZORAN = $_zr
7726 LIBLZO = $_liblzo
7727 LIBDV = $_libdv
7728 XVID4 = $_xvid
7729 X264 = $_x264
7730 LIBNUT = $_libnut
7731 LIBDCA = $_libdca
7732 MPLAYER = $_mplayer
7733 MENCODER = $_mencoder
7734 CDDA = $_cdda
7735 CDDB = $_cddb
7736 BITMAP_FONT = $_bitmap_font
7737 FREETYPE = $_freetype
7738 ASS = $_ass
7739 LIBMAD = $_mad
7740 LIBVORBIS = $_vorbis
7741 LIBTHEORA = $_theora
7742 FAAD_INTERNAL = $_faad_internal
7743 FAAD_FIXED = $_faad_fixed
7744 LIBSMBCLIENT = $_smbsupport
7745 XMMS_PLUGINS = $_xmms
7746 MACOSX = $_macosx
7747 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7748 MACOSX_BUNDLE = $_macosx_bundle
7749 MACOSX_COREVIDEO = $_macosx_corevideo
7750 TOOLAME=$_toolame
7751 TWOLAME=$_twolame
7752 FAAC=$_faac
7753 CONFIG_LIBAMR=$_libamr
7754 CONFIG_LIBAMR_NB=$_libamr_nb
7755 CONFIG_LIBAMR_WB=$_libamr_wb
7756 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7757 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7758 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7759 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7760 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7761 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7762 CONFIG_LIBFAAC=$_lavc_faac
7763 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7764 CONFIG_LIBVORBIS=$_libvorbis
7765 CONFIG_LIBXVID=$_lavc_xvid
7766 CONFIG_LIBX264=$_lavc_x264
7767 CONFIG_ZLIB=$_zlib
7768 CONFIG_GPL=yes
7769 CONFIG_ENCODERS=$_mencoder
7770 CONFIG_MUXERS=$_mencoder
7771 # Prevent building libavcodec/imgresample.c with conflicting symbols
7772 CONFIG_SWSCALER=yes
7773 RADIO=$_radio
7774 RADIO_CAPTURE=$_radio_capture
7775 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7776 VIDIX_IVTV=$_vidix_drv_ivtv
7777 VIDIX_MACH64=$_vidix_drv_mach64
7778 VIDIX_MGA=$_vidix_drv_mga
7779 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7780 VIDIX_NVIDIA=$_vidix_drv_nvidia
7781 VIDIX_PM2=$_vidix_drv_pm2
7782 VIDIX_PM3=$_vidix_drv_pm3
7783 VIDIX_RADEON=$_vidix_drv_radeon
7784 VIDIX_RAGE128=$_vidix_drv_rage128
7785 VIDIX_SAVAGE=$_vidix_drv_savage
7786 VIDIX_SIS=$_vidix_drv_sis
7787 VIDIX_UNICHROME=$_vidix_drv_unichrome
7789 # --- Some stuff for autoconfigure ----
7790 $_target_arch
7791 $_target_arch_x86
7792 $_confwin32
7793 TARGET_CPU=$iproc
7794 HAVE_MMX = $_mmx
7795 HAVE_MMX2 = $_mmxext
7796 HAVE_3DNOW = $_3dnow
7797 HAVE_3DNOWEX = $_3dnowext
7798 HAVE_SSE = $_sse
7799 HAVE_CMOV = $_cmov
7800 HAVE_ALTIVEC = $_altivec
7801 HAVE_ARMV5TE = $_armv5te
7802 HAVE_ARMV6 = $_armv6
7803 HAVE_IWMMXT = $_iwmmxt
7804 HAVE_VIS = $_vis
7806 # --- GUI stuff ---
7807 GUI = $_gui
7809 # --- libvo stuff ---
7810 VO_SRCS = $_vosrc
7812 # --- libao2 stuff ---
7813 AO_SRCS = $_aosrc
7815 # --- libaf stuff ---
7816 AF_SRCS = $_afsrc
7820 #############################################################################
7822 ff_config_enable () {
7823 _nprefix=$3;
7824 test -z "$_nprefix" && _nprefix='CONFIG'
7825 for part in $1; do
7826 if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
7827 echo "#define ${_nprefix}_$part 1"
7828 echo "#define ENABLE_$part 1"
7829 else
7830 echo "#define ENABLE_$part 0"
7832 done
7835 echo "Creating config.h"
7836 cat > $TMPH << EOF
7837 /* -------- This file has been automatically generated by configure ---------
7838 Note: Any changes in it will be lost when you run configure again. */
7840 /* Protect against multiple inclusion */
7841 #ifndef MPLAYER_CONFIG_H
7842 #define MPLAYER_CONFIG_H 1
7844 #define CONFIGURATION "$_configuration"
7846 /* make sure we never get lavformat's poll() emulation, the results are
7847 horrible if the X libs try to actually use it, see MPlayer-users
7848 Message-ID: <45D49541.8060101@infernix.net>
7849 Date: Thu, 15 Feb 2007 18:15:45 +0100
7850 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7852 #define HAVE_SYS_POLL_H 1
7854 /* yes, we have inttypes.h */
7855 #define HAVE_INTTYPES_H 1
7857 /* int_fastXY_t emulation */
7858 $_def_fast_inttypes
7860 /* libdvdcss */
7861 #define HAVE_ERRNO_H 1
7863 /* libdvdcss + libdvdread */
7864 #define HAVE_LIMITS_H 1
7866 /* libdvdcss + libfaad2 */
7867 #define HAVE_UNISTD_H 1
7869 /* libfaad2 + libdvdread */
7870 #define STDC_HEADERS 1
7872 /* libfaad2 */
7873 #define HAVE_MEMCPY 1
7874 #define HAVE_STRCHR 1
7876 /* libdvdread */
7877 #define HAVE_UINTPTR_T 1
7879 /* name of messages charset */
7880 $_def_charset
7882 /* Runtime CPU detection */
7883 $_def_runtime_cpudetection
7885 /* Dynamic a/v plugins */
7886 $_def_dynamic_plugins
7888 /* "restrict" keyword */
7889 $_def_restrict_keyword
7891 /* __builtin_expect branch prediction hint */
7892 $_def_builtin_expect
7893 #ifdef HAVE_BUILTIN_EXPECT
7894 #define likely(x) __builtin_expect ((x) != 0, 1)
7895 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7896 #else
7897 #define likely(x) (x)
7898 #define unlikely(x) (x)
7899 #endif
7901 /* attribute(used) as needed by some compilers */
7902 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7903 # define attribute_used __attribute__((used))
7904 #else
7905 # define attribute_used
7906 #endif
7908 /* compiler support for named assembler arguments */
7909 $_def_named_asm_args
7911 /* enable/disable SIGHANDLER */
7912 $_def_sighandler
7914 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7915 $_def_crash_debug
7917 /* Toggles debugging informations */
7918 $_def_debug
7920 /* Toggles color console output */
7921 $_def_color_console
7923 /* Indicates that libcdio is available for VCD and CD-DA playback */
7924 $_def_libcdio
7926 /* Indicates that Ogle's libdvdread is available for DVD playback */
7927 $_def_dvdread
7929 /* Indicates that dvdread is internal */
7930 $_def_dvdread_internal
7932 /* Additional options for libdvdread/libdvdcss */
7933 $_def_dvd
7934 $_def_cdrom
7935 $_def_cdio
7936 $_def_dvdio
7937 $_def_bsdi_dvd
7938 $_def_dvd_bsd
7939 $_def_dvd_linux
7940 $_dev_dvd_openbsd
7941 $_def_dvd_darwin
7942 $_def_sol_scsi_h
7943 $_def_hpux_scsi_h
7945 /* Common data directory (for fonts, etc) */
7946 #define MPLAYER_DATADIR "$_datadir"
7947 #define MPLAYER_CONFDIR "$_confdir"
7948 #define MPLAYER_LIBDIR "$_libdir"
7950 /* Define this to compile stream-caching support, it can be enabled via
7951 -cache <kilobytes> */
7952 $_def_stream_cache
7954 /* Define if you are using XviD library */
7955 $_def_xvid
7957 /* Define if you are using the X.264 library */
7958 $_def_x264
7960 /* Define if you are using libnut */
7961 $_def_libnut
7963 /* Define to include support for libdv-0.9.5 */
7964 $_def_libdv
7966 /* If build mencoder */
7967 $_mencoder_flag
7969 /* Indicates if libmp3lame is available
7970 Note: for mencoder */
7971 $_def_mp3lame
7972 $_def_mp3lame_preset
7973 $_def_mp3lame_preset_medium
7975 /* Undefine this if you do not want to select mono audio (left or right)
7976 with a stereo MPEG layer 2/3 audio stream. The command line option
7977 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7978 right-only), with 0 being the default.
7980 #define USE_FAKE_MONO 1
7982 /* Undefine this if your sound card driver has no working select().
7983 If you have kernel Oops, player hangups, or just no audio, you should
7984 try to recompile MPlayer with this option disabled! */
7985 $_def_select
7987 /* define this to use iconv(3) function to codepage conversions */
7988 $_def_iconv
7990 /* define this to use nl_langinfo function */
7991 $_def_langinfo
7993 /* define this to use RTC (/dev/rtc) for video timers */
7994 $_def_rtc
7996 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7997 #define MAX_OUTBURST 65536
7999 /* set up audio OUTBURST. Do not change this! */
8000 #define OUTBURST 512
8002 /* Define this if your system has the header file for the OSS sound interface */
8003 $_def_sys_soundcard
8005 /* Define this if your system has the header file for the OSS sound interface
8006 * in /usr/include */
8007 $_def_soundcard
8009 /* Define this if your system has the sysinfo header */
8010 $_def_sys_sysinfo
8012 /* Define this if your system has the "malloc.h" header file */
8013 $_def_malloc
8015 /* memalign is mapped to malloc if unsupported */
8016 $_def_memalign
8017 $_def_map_memalign
8018 $_def_memalign_hack
8020 /* assembler handling of .align */
8021 $_def_asmalign_pot
8023 /* Define this if your system has the "alloca.h" header file */
8024 $_def_alloca
8026 /* Define this if your system has the "sys/mman.h" header file */
8027 $_def_mman
8028 $_def_mman_has_map_failed
8030 /* Define this if you have the elf dynamic linker -ldl library */
8031 $_def_dl
8033 /* Define this if you have the kstat kernel statistics library */
8034 $_def_kstat
8036 /* Define this if you have zlib */
8037 $_def_zlib
8038 #ifdef HAVE_ZLIB
8039 #define CONFIG_ZLIB 1
8040 #endif
8042 /* Define this if you have shm support */
8043 $_def_shm
8045 /* Define this if your system has strsep */
8046 $_def_strsep
8048 /* Define this if your system has vsscanf */
8049 $_def_vsscanf
8051 /* Define this if your system has swab */
8052 $_def_swab
8054 /* Define this if your system has posix select */
8055 $_def_posix_select
8057 /* Define this if your system has gettimeofday */
8058 $_def_gettimeofday
8060 /* Define this if your system has glob */
8061 $_def_glob
8063 /* Define this if your system has setenv */
8064 $_def_setenv
8065 #ifndef HAVE_SETENV
8066 int setenv(const char *name, const char *val, int overwrite);
8067 #endif
8069 /* Define this if your system has sysi86 */
8070 $_def_sysi86
8071 $_def_sysi86_iv
8073 /* Define this if your system has pthreads */
8074 $_def_pthreads
8076 /* Define this if you enabled thread support for libavcodec */
8077 $_def_threads
8078 #ifdef HAVE_THREADS
8079 #define ENABLE_THREADS 1
8080 #else
8081 #define ENABLE_THREADS 0
8082 #endif
8084 /* LIRC (remote control, see www.lirc.org) support: */
8085 $_def_lirc
8087 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8088 $_def_apple_remote
8090 /* Support for maemo (http://www.maemo.org) */
8091 $_def_maemo
8094 * LIRCCD (LIRC client daemon)
8095 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8097 $_def_lircc
8099 /* DVD navigation support using libdvdnav */
8100 $_def_dvdnav
8102 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8103 #define MPEG12_POSTPROC 1
8105 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8106 $_def_libpostproc
8107 $_def_libpostproc_a
8108 $_def_libpostproc_so
8110 /* Win32 DLL support */
8111 $_def_win32dll
8112 #define WIN32_PATH "$_win32codecsdir"
8114 /* Mac OS X specific features */
8115 $_def_macosx
8116 $_def_macosx_finder_support
8117 $_def_macosx_bundle
8118 $_def_macosx_corevideo
8120 /* Build our Win32-loader */
8121 $_def_win32_loader
8123 /* ffmpeg's libavcodec support (requires libavcodec source) */
8124 $_def_libavcodec
8125 $_def_libavcodec_a
8126 $_def_libavcodec_so
8127 $_def_libavcodec_mpegaudio_hp
8129 /* ffmpeg's libavformat support (requires libavformat source) */
8130 $_def_libavformat
8131 $_def_libavformat_a
8132 $_def_libavformat_so
8134 $_def_libavutil
8135 $_def_libavutil_a
8136 $_def_libavutil_so
8138 /* Use libavcodec's decoders */
8139 #define CONFIG_DECODERS 1
8140 /* Use libavcodec's encoders */
8141 #define CONFIG_ENCODERS 1
8143 /* Use libavformat's demuxers */
8144 #define CONFIG_DEMUXERS 1
8145 /* Use libavformat's muxers */
8146 $_def_muxers
8148 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8149 #define HAVE_EBX_AVAILABLE 1
8150 #ifndef MP_DEBUG
8151 #define HAVE_EBP_AVAILABLE 1
8152 #endif
8154 #define HAVE_SOCKLEN_T 1
8156 #define CONFIG_GPL 1
8157 #define ENABLE_SMALL 0
8159 /* Support for grayscale encoding/decoding in FFmpeg (makes color slower) */
8160 #define ENABLE_GRAY 1
8162 /* Use AMR codecs from libavcodec. */
8163 $_def_libamr
8164 $_def_libamr_nb
8165 $_def_libamr_wb
8167 /* Use specific parts from FFmpeg. */
8168 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8169 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8170 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8171 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8172 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8173 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8174 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8176 $_def_lavc_faac
8177 $_def_lavc_xvid
8178 $_def_lavc_mp3lame
8179 $_def_lavc_x264
8181 /* Use codec libs included in mplayer CVS / source dist: */
8182 $_def_mp3lib
8183 $_def_liba52
8184 $_def_libdca
8185 $_def_libmpeg2
8187 /* XAnim DLL support */
8188 $_def_xanim
8189 /* Default search path */
8190 $_def_xanim_path
8192 /* RealPlayer DLL support */
8193 $_def_real
8194 /* Default search path */
8195 $_def_real_path
8197 /* LIVE555 Streaming Media library support */
8198 $_def_live
8200 /* libnemesi Streaming Media library support */
8201 $_def_nemesi
8203 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8204 $_def_fastmemcpy
8206 /* Use UnRAR executable for Vobsubs */
8207 $_def_unrar_exec
8209 /* gui support, please do not edit this option */
8210 $_def_gui
8211 $_def_gtk2_gui
8213 /* Audio output drivers */
8214 $_def_ossaudio
8215 $_def_ossaudio_devdsp
8216 $_def_ossaudio_devmixer
8217 $_def_alsa5
8218 $_def_alsa9
8219 $_def_alsa1x
8220 $_def_arts
8221 $_def_esd
8222 $_def_esd_latency
8223 $_def_pulse
8224 $_def_jack
8225 $_def_openal
8226 $_def_openal_h
8227 $_def_sys_asoundlib_h
8228 $_def_alsa_asoundlib_h
8229 $_def_sunaudio
8230 $_def_sgiaudio
8231 $_def_win32waveout
8232 $_def_nas
8234 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8235 #undef FAST_OSD
8236 #undef FAST_OSD_TABLE
8238 /* Enable TV Interface support */
8239 $_def_tv
8241 /* Enable Video 4 Linux TV interface support */
8242 $_def_tv_v4l
8244 /* Enable Video 4 Linux 1 TV interface support */
8245 $_def_tv_v4l1
8247 /* Enable Video 4 Linux 2 TV interface support */
8248 $_def_tv_v4l2
8250 /* Enable DirectShow TV interface support */
8251 $_def_tv_dshow
8253 /* *BSD BrookTree headers */
8254 $_def_ioctl_meteor_h_name
8255 $_def_ioctl_bt848_h_name
8257 /* Enable *BSD BrookTree TV interface support */
8258 $_def_tv_bsdbt848
8260 /* Enable TV Teletext Interface support */
8261 $_def_tv_teletext
8263 /* Enable Radio Interface support */
8264 $_def_radio
8266 /* Enable Capture for Radio Interface support */
8267 $_def_radio_capture
8269 /* Enable Video 4 Linux Radio interface support */
8270 $_def_radio_v4l
8272 /* Enable Video 4 Linux 2 Radio interface support */
8273 $_def_radio_v4l2
8275 /* Enable *BSD BrookTree Radio interface support */
8276 $_def_radio_bsdbt848
8278 /* Enable Video 4 Linux 2 MPEG PVR support */
8279 $_def_pvr
8281 /* Define if your processor stores words with the most significant
8282 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8283 $_def_words_endian
8285 /* Define if your processor can access unaligned data in a fast way */
8286 $_def_fast_unaligned
8288 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8290 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8291 have the instruction. */
8292 $_def_dcbzl
8294 /* only gcc3 can compile mvi instructions (libmpeg2) */
8295 $_def_gcc_mvi_support
8297 /* Define this for Cygwin build for win32 */
8298 $_def_confwin32
8300 /* Define this to any prefered value from 386 up to infinity with step 100 */
8301 #define __CPU__ $iproc
8303 $_mp_wordsize
8305 $_def_linux
8307 $_def_vcd
8309 #ifdef sun
8310 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8311 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8312 #elif defined(WIN32)
8313 #define DEFAULT_CDROM_DEVICE "D:"
8314 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8315 #elif defined(__APPLE__) || defined(__DARWIN__)
8316 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8317 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8318 #elif defined(__OpenBSD__)
8319 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8320 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8321 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8322 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8323 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8324 #elif defined(__AMIGAOS4__)
8325 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8326 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8327 #else
8328 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8329 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8330 #endif
8333 /*----------------------------------------------------------------------------
8335 ** NOTE: Instead of modifying these definitions here, use the
8336 ** --enable/--disable options of the ./configure script!
8337 ** See ./configure --help for details.
8339 *---------------------------------------------------------------------------*/
8341 /* C99 *lrint* and round* functions available */
8342 $_def_llrint
8343 $_def_lrint
8344 $_def_lrintf
8345 $_def_round
8346 $_def_roundf
8348 /* mkstemp support */
8349 $_def_mkstemp
8351 /* nanosleep support */
8352 $_def_nanosleep
8354 /* SMB support */
8355 $_def_smbsupport
8357 /* termcap flag for getch2.c */
8358 $_def_termcap
8360 /* termios flag for getch2.c */
8361 $_def_termios
8362 $_def_termios_h
8363 $_def_termios_sys_h
8365 /* enable PNG support */
8366 $_def_png
8368 /* enable JPEG support */
8369 $_def_jpeg
8371 /* enable PNM support */
8372 $_def_pnm
8374 /* enable md5sum support */
8375 $_def_md5sum
8377 /* enable GIF support */
8378 $_def_gif
8379 $_def_gif_4
8380 $_def_gif_tvt_hack
8382 /* enable bitmap font support */
8383 $_def_bitmap_font
8385 /* enable FreeType support */
8386 $_def_freetype
8388 /* enable Fontconfig support */
8389 $_def_fontconfig
8391 /* enable SSA/ASS support */
8392 $_def_ass
8394 /* enable FriBiDi usage */
8395 $_def_fribidi
8397 /* enable ENCA usage */
8398 $_def_enca
8400 /* liblzo support */
8401 $_def_liblzo
8402 #ifdef USE_LIBLZO
8403 #define CONFIG_LZO 1
8404 #endif
8406 /* libmad support */
8407 $_def_mad
8409 /* enable OggVorbis support */
8410 $_def_vorbis
8411 $_def_tremor
8413 /* enable Speex support */
8414 $_def_speex
8416 /* enable musepack support */
8417 $_def_musepack
8419 /* enable OggTheora support */
8420 $_def_theora
8422 /* enable FAAD (AAC) support */
8423 $_def_faad
8424 $_def_faad_internal
8426 /* enable FAAC (AAC encoder) support */
8427 $_def_faac
8429 /* enable LADSPA plugin support */
8430 $_def_ladspa
8432 /* enable network */
8433 $_def_network
8435 /* enable ftp support */
8436 $_def_ftp
8438 /* enable vstream support */
8439 $_def_vstream
8441 /* enable winsock2 instead of Unix functions*/
8442 $_def_winsock2
8444 /* define this to use inet_aton() instead of inet_pton() */
8445 $_def_use_aton
8447 /* enables / disables cdparanoia support */
8448 $_def_cdparanoia
8449 $_def_cddb
8451 /* enables / disables VIDIX usage */
8452 $_def_vidix
8453 $_def_vidix_drv_cyberblade
8454 $_def_vidix_drv_ivtv
8455 $_def_vidix_drv_mach64
8456 $_def_vidix_drv_mga
8457 $_def_vidix_drv_mga_crtc2
8458 $_def_vidix_drv_nvidia
8459 $_def_vidix_drv_pm3
8460 $_def_vidix_drv_radeon
8461 $_def_vidix_drv_rage128
8462 $_def_vidix_drv_savage
8463 $_def_vidix_drv_sis
8464 $_def_vidix_drv_unichrome
8465 $_def_vidix_pfx
8467 /* enables / disables new input joystick support */
8468 $_def_joystick
8470 /* enables / disables QTX codecs */
8471 $_def_qtx
8473 /* enables / disables osd menu */
8474 $_def_menu
8476 /* enables / disables subtitles sorting */
8477 $_def_sortsub
8479 /* XMMS input plugin support */
8480 $_def_xmms
8481 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8483 /* enables inet6 support */
8484 $_def_inet6
8486 /* do we have gethostbyname2? */
8487 $_def_gethostbyname2
8489 /* Extension defines */
8490 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8492 $_def_altivec_h // enables usage of altivec.h
8494 /* libmpeg2 uses a different feature test macro for mediaLib */
8495 #ifdef HAVE_MLIB
8496 #define LIBMPEG2_MLIB 1
8497 #endif
8499 /* libvo options */
8500 #define SCREEN_SIZE_X 1
8501 #define SCREEN_SIZE_Y 1
8502 $_def_x11
8503 $_def_xv
8504 $_def_xvmc
8505 $_def_vm
8506 $_def_xf86keysym
8507 $_def_xinerama
8508 $_def_gl
8509 $_def_gl_win32
8510 $_def_dga
8511 $_def_dga1
8512 $_def_dga2
8513 $_def_sdl
8514 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8515 $_def_sdlbuggy
8516 $_def_directx
8517 $_def_ggi
8518 $_def_ggiwmh
8519 $_def_3dfx
8520 $_def_s3fb
8521 $_def_tdfxfb
8522 $_def_tdfxvid
8523 $_def_xvr100
8524 $_def_directfb
8525 $_def_directfb_version
8526 $_def_dfbmga
8527 $_def_zr
8528 $_def_bl
8529 $_def_mga
8530 $_def_xmga
8531 $_def_fbdev
8532 $_def_dxr2
8533 $_def_dxr3
8534 $_def_ivtv
8535 $_def_v4l2
8536 $_def_dvb
8537 $_def_dvb_in
8538 $_def_svga
8539 $_def_vesa
8540 $_def_xss
8541 $_def_xdpms
8542 $_def_aa
8543 $_def_caca
8544 $_def_tga
8545 $_def_toolame
8546 $_def_twolame
8548 /* used by GUI: */
8549 $_def_xshape
8551 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8552 #define X11_FULLSCREEN 1
8553 #endif
8555 #endif /* MPLAYER_CONFIG_H */
8558 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8559 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8561 #############################################################################
8563 cat << EOF
8565 Config files successfully generated by ./configure $_configuration !
8567 Install prefix: $_prefix
8568 Data directory: $_datadir
8569 Config direct.: $_confdir
8571 Byte order: $_byte_order
8572 Optimizing for: $_optimizing
8574 Languages:
8575 Messages/GUI: $_language
8578 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8579 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8580 echo
8582 cat << EOF
8584 Enabled optional drivers:
8585 Input: $_inputmodules
8586 Codecs: $_codecmodules
8587 Audio output: $_aomodules
8588 Video output: $_vomodules
8589 Audio filters: $_afmodules
8590 Disabled optional drivers:
8591 Input: $_noinputmodules
8592 Codecs: $_nocodecmodules
8593 Audio output: $_noaomodules
8594 Video output: $_novomodules
8595 Audio filters: $_noafmodules
8597 'config.h' and 'config.mak' contain your configuration options.
8598 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8599 compile *** DO NOT REPORT BUGS if you tweak these files ***
8601 'make' will now compile MPlayer and 'make install' will install it.
8602 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8607 if test "$_mtrr" = yes ; then
8608 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8609 echo
8612 if ! x86_32; then
8613 cat <<EOF
8614 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8615 operating system ($system_name). You may encounter a few files that cannot
8616 be played due to missing open source video/audio codec support.
8622 cat <<EOF
8623 Check $TMPLOG if you wonder why an autodetection failed (make sure
8624 development headers/packages are installed).
8626 NOTE: The --enable-* parameters unconditionally force options on, completely
8627 skipping autodetection. This behavior is unlike what you may be used to from
8628 autoconf-based configure scripts that can decide to override you. This greater
8629 level of control comes at a price. You may have to provide the correct compiler
8630 and linker flags yourself.
8631 If you used one of these options (except --enable-gui and similar ones that
8632 turn on internal features) and experience a compilation or linking failure,
8633 make sure you have passed the necessary compiler/linker flags to configure.
8635 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8639 if test "$_warn_CFLAGS" = yes; then
8640 cat <<EOF
8642 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8644 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8646 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8647 To do so, execute 'CFLAGS= ./configure <options>'
8652 # Last move:
8653 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"