Fix compilation after FFmpeg r9283.
[mplayer/glamo.git] / configure
blob5b5480188925a81935d024d41ba6e89f46d65ea5
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 $TMPO $@" >> "$TMPLOG"
66 rm -f "$TMPO"
67 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPO" "$@" >> "$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 "$TMPO" >> "$TMPLOG" 2>&1
86 # Display error message, flushes tempfile, exit
87 die () {
88 echo
89 echo "Error: $@" >&2
90 echo >&2
91 rm -f "$TMPO" "$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 # not boolean test: implement the posix shell "!" operator for a
162 # non-posix /bin/sh.
163 # usage: not {command}
164 # returns exit status "success" when the execution of "command"
165 # fails.
166 not() {
167 eval "$@"
168 test $? -ne 0
171 # Use this before starting a check
172 echocheck() {
173 echo "============ Checking for $@ ============" >> "$TMPLOG"
174 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
177 # Use this to echo the results of a check
178 echores() {
179 if test "$_res_comment" ; then
180 _res_comment="($_res_comment)"
182 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
183 echo "##########################################" >> "$TMPLOG"
184 echo "" >> "$TMPLOG"
185 echo "$@ $_res_comment"
186 _res_comment=""
188 #############################################################################
190 # Check how echo works in this /bin/sh
191 case `echo -n` in
192 -n) _echo_n= _echo_c='\c' ;; # SysV echo
193 *) _echo_n='-n ' _echo_c= ;; # BSD echo
194 esac
196 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"`
198 show_help(){
199 cat << EOF
200 Usage: $0 [OPTIONS]...
202 Configuration:
203 -h, --help display this help and exit
205 Installation directories:
206 --prefix=DIR prefix directory for installation [/usr/local]
207 --bindir=DIR directory for installing binaries [PREFIX/bin]
208 --datadir=DIR directory for installing machine independent
209 data files (skins, etc) [PREFIX/share/mplayer]
210 --mandir=DIR directory for installing man pages [PREFIX/man]
211 --confdir=DIR directory for installing configuration files
212 [PREFIX/etc/mplayer]
213 --libdir=DIR directory for object code libraries [PREFIX/lib]
214 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
215 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
216 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
217 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
219 Optional features:
220 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
221 --disable-mplayer disable MPlayer compilation [enable]
222 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
223 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
224 --enable-largefiles enable support for files > 2GB [disable]
225 --enable-linux-devfs set default devices to devfs [disable]
226 --enable-termcap use termcap database for key codes [autodetect]
227 --enable-termios use termios database for key codes [autodetect]
228 --disable-iconv disable iconv for encoding conversion [autodetect]
229 --disable-langinfo do not use langinfo [autodetect]
230 --enable-lirc enable LIRC (remote control) support [autodetect]
231 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
232 --enable-joystick enable joystick support [disable]
233 --disable-vm disable X video mode extensions [autodetect]
234 --disable-xf86keysym disable support for multimedia keys [autodetect]
235 --enable-radio enable radio interface [disable]
236 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
237 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
238 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
239 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
240 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
241 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
242 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
243 --disable-tv-teletex disable TV teletext interface [autodetect]
244 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
245 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
246 --disable-network disable networking [enable]
247 --enable-winsock2 enable winsock2 [autodetect]
248 --enable-smb enable Samba (SMB) input [autodetect]
249 --enable-live enable LIVE555 Streaming Media [autodetect]
250 --disable-dvdnav disable libdvdnav [autodetect]
251 --disable-dvdread disable libdvdread [autodetect]
252 --disable-dvdread-internal disable internal libdvdread [autodetect]
253 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
254 --disable-cdparanoia disable cdparanoia [autodetect]
255 --disable-cddb disable cddb [autodetect]
256 --disable-bitmap-font disable bitmap font support [enable]
257 --disable-freetype disable FreeType 2 font rendering [autodetect]
258 --disable-fontconfig disable fontconfig font lookup [autodetect]
259 --disable-unrarlib disable Unique RAR File Library [enabled]
260 --enable-menu enable OSD menu (not DVD menu) [disabled]
261 --disable-sortsub disable subtitle sorting [enabled]
262 --enable-fribidi enable the FriBiDi libs [autodetect]
263 --disable-enca disable ENCA charset oracle library [autodetect]
264 --disable-macosx disable Mac OS X specific features [autodetect]
265 --disable-maemo disable maemo specific features [autodetect]
266 --enable-macosx-finder-support enable Mac OS X Finder invocation
267 parameter parsing [disabled]
268 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
269 --disable-inet6 disable IPv6 support [autodetect]
270 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
271 --disable-ftp disable FTP support [enabled]
272 --disable-vstream disable TiVo vstream client support [autodetect]
273 --disable-pthreads disable Posix 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-nut 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 --disable-mp3lib disable builtin mp3lib [enabled]
317 --disable-liba52 disable builtin liba52 [enabled]
318 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
319 --disable-musepack disable musepack support [autodetect]
320 --disable-libamr_nb disable libamr narrowband [autodetect]
321 --disable-libamr_wb disable libamr wideband [autodetect]
322 --disable-decoder=DECODER disable specified FFmpeg decoder
323 --enable-decoder=DECODER enable specified FFmpeg decoder
324 --disable-encoder=ENCODER disable specified FFmpeg encoder
325 --enable-encoder=ENCODER enable specified FFmpeg encoder
326 --disable-parser=PARSER disable specified FFmpeg parser
327 --enable-parser=PARSER enable specified FFmpeg parser
328 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
329 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
330 --disable-muxer=MUXER disable specified FFmpeg muxer
331 --enable-muxer=MUXER enable specified FFmpeg muxer
333 Video output:
334 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
335 --disable-vidix-external disable external VIDIX [for x86 *nix]
336 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
337 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
338 nvidia,pm2,pm3,radeon,rage128,savage,sis,unichrome
339 --enable-gl enable OpenGL video output [autodetect]
340 --enable-dga[=n] enable DGA [n in {1, 2} ] support [autodetect]
341 --enable-vesa enable VESA video output [autodetect]
342 --enable-svga enable SVGAlib video output [autodetect]
343 --enable-sdl enable SDL video output [autodetect]
344 --enable-aa enable AAlib video output [autodetect]
345 --enable-caca enable CACA video output [autodetect]
346 --enable-ggi enable GGI video output [autodetect]
347 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
348 --enable-directx enable DirectX video output [autodetect]
349 --enable-dxr2 enable DXR2 video output [autodetect]
350 --enable-dxr3 enable DXR3/H+ video output [autodetect]
351 --enable-ivtv enable IVTV TV-Out video output [autodetect]
352 --enable-dvb enable DVB video output [autodetect]
353 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
354 --enable-mga enable mga_vid video output [autodetect]
355 --enable-xmga enable mga_vid X11 video output [autodetect]
356 --enable-xv enable Xv video output [autodetect]
357 --enable-xvmc enable XvMC acceleration [disable]
358 --enable-vm enable XF86VidMode support [autodetect]
359 --enable-xinerama enable Xinerama support [autodetect]
360 --enable-x11 enable X11 video output [autodetect]
361 --enable-xshape enable XShape support [autodetect]
362 --enable-fbdev enable FBDev video output [autodetect]
363 --enable-mlib enable mediaLib video output (Solaris) [disable]
364 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
365 --enable-tdfxfb enable tdfxfb video output [disable]
366 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
367 --enable-directfb enable DirectFB video output [autodetect]
368 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
369 --enable-bl enable Blinkenlights video output [disable]
370 --enable-tdfxvid enable tdfx_vid video output [disable]
371 --disable-tga disable Targa video output [enable]
372 --disable-pnm disable PNM video output [enable]
373 --disable-md5sum disable md5sum video output [enable]
375 Audio output:
376 --disable-alsa disable ALSA audio output [autodetect]
377 --disable-ossaudio disable OSS audio output [autodetect]
378 --disable-arts disable aRts audio output [autodetect]
379 --disable-esd disable esd audio output [autodetect]
380 --disable-polyp disable Polypaudio audio output [autodetect]
381 --disable-jack disable JACK audio output [autodetect]
382 --disable-openal disable OpenAL audio output [autodetect]
383 --disable-nas disable NAS audio output [autodetect]
384 --disable-sgiaudio disable SGI audio output [autodetect]
385 --disable-sunaudio disable Sun audio output [autodetect]
386 --disable-win32waveout disable Windows waveout audio output [autodetect]
387 --disable-select disable using select() on the audio device [enable]
389 Miscellaneous options:
390 --enable-runtime-cpudetection enable runtime CPU detection [disable]
391 --enable-cross-compile enable cross-compilation [autodetect]
392 --cc=COMPILER C compiler to build MPlayer [gcc]
393 --host-cc=COMPILER C compiler for tools needed while building [gcc]
394 --as=ASSEMBLER assembler to build MPlayer [as]
395 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
396 --enable-static build a statically linked binary
397 --charset=charset convert the console messages to this character set
398 --language=list a white space or comma separated list of languages for
399 translated man pages, the first language is used for
400 messages and the GUI (the environment variable
401 \$LINGUAS is also honored) [en]
402 (Available: $LANGUAGES all)
403 --with-install=PATH path to a custom install program
404 --enable-color-console enable color console output (UNSUPPORTED) [disable]
406 Advanced options:
407 --enable-mmx enable MMX [autodetect]
408 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
409 --enable-3dnow enable 3DNow! [autodetect]
410 --enable-3dnowext enable extended 3DNow! [autodetect]
411 --enable-sse enable SSE [autodetect]
412 --enable-sse2 enable SSE2 [autodetect]
413 --enable-ssse3 enable SSSE3 [autodetect]
414 --enable-shm enable shm [autodetect]
415 --enable-altivec enable AltiVec (PowerPC) [autodetect]
416 --enable-armv5te enable DSP extensions (ARM) [autodetect]
417 --enable-armv6 enable ARMv6 (ARM) [autodetect]
418 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
419 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
420 --enable-big-endian force byte order to big-endian [autodetect]
421 --enable-debug[=1-3] compile-in debugging information [disable]
422 --enable-profile compile-in profiling information [disable]
423 --disable-sighandler disable sighandler for crashes [enable]
424 --enable-crash-debug enable automatic gdb attach on crash [disable]
425 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
427 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
428 --disable-gcc-check disable gcc version checking [enable]
430 Use these options if autodetection fails (Options marked with (*) accept
431 multiple paths separated by ':'):
432 --extra-libs=FLAGS extra linker flags
433 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
434 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
435 --with-extraincdir=DIR extra header search paths in DIR (*)
436 --with-extralibdir=DIR extra linker search paths in DIR (*)
437 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
439 --with-freetype-config=PATH path to freetype-config
440 --with-fribidi-config=PATH path to fribidi-config
441 --with-glib-config=PATH path to glib*-config
442 --with-gtk-config=PATH path to gtk*-config
443 --with-sdl-config=PATH path to sdl*-config
444 --with-dvdnav-config=PATH path to dvdnav-config
446 This configure script is NOT autoconf-based, even though its output is similar.
447 It will try to autodetect all configuration options. If you --enable an option
448 it will be forcefully turned on, skipping autodetection. This can break
449 compilation, so you need to know what you are doing.
451 exit 0
452 } #show_help()
454 # GOTCHA: the variables below defines the default behavior for autodetection
455 # and have - unless stated otherwise - at least 2 states : yes no
456 # If autodetection is available then the third state is: auto
457 _mmx=auto
458 _3dnow=auto
459 _3dnowext=auto
460 _mmxext=auto
461 _sse=auto
462 _sse2=auto
463 _ssse3=auto
464 _cmov=auto
465 _fast_cmov=auto
466 _armv5te=auto
467 _armv6=auto
468 _iwmmxt=auto
469 _mtrr=auto
470 _install=install
471 _ranlib=ranlib
472 _ldconfig=ldconfig
473 _cc=cc
474 test "$CC" && _cc="$CC"
475 _gcc_check=yes
476 _as=auto
477 _runtime_cpudetection=no
478 _cross_compile=auto
479 _prefix="/usr/local"
480 _libavutil_a=auto
481 _libavutil_so=auto
482 _libavcodec_a=auto
483 _libamr_nb=auto
484 _libamr_wb=auto
485 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
486 _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// `
487 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
488 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// `
489 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
490 _libavparsers=$_libavparsers_all
491 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
492 _libavbsfs=$_libavbsfs_all
493 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
494 _libavdemuxers=`echo $_libavdemuxers_all | sed -e s/AUDIO_DEMUXER// -e s/DC1394_DEMUXER// -e s/DV1394_DEMUXER// -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/VIDEO_GRAB_V4L_DEMUXER// -e s/VIDEO_GRAB_BKTR_DEMUXER// -e s/X11_GRAB_DEVICE_DEMUXER// -e s/V4L2_DEMUXER// -e s/LIBNUT_DEMUXER// `
495 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
496 _libavmuxers=`echo $_libavmuxers_all | sed -e s/AUDIO_MUXER// -e s/RTP_MUXER// `
497 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
498 _libavcodec_so=auto
499 _libavformat_a=auto
500 _libavformat_so=auto
501 _libpostproc_a=auto
502 _libpostproc_so=auto
503 _libavcodec_mpegaudio_hp=yes
504 _mencoder=yes
505 _mplayer=yes
506 _x11=auto
507 _xshape=auto
508 _dga=auto # 1 2 no auto
509 _xv=auto
510 _xvmc=no #auto when complete
511 _sdl=auto
512 _directx=auto
513 _win32waveout=auto
514 _nas=auto
515 _png=auto
516 _jpeg=auto
517 _pnm=yes
518 _md5sum=yes
519 _gif=auto
520 _gl=auto
521 _ggi=auto
522 _ggiwmh=auto
523 _aa=auto
524 _caca=auto
525 _svga=auto
526 _vesa=auto
527 _fbdev=auto
528 _dvb=auto
529 _dvbhead=auto
530 _dxr2=auto
531 _dxr3=auto
532 _ivtv=auto
533 _iconv=auto
534 _langinfo=auto
535 _rtc=auto
536 _ossaudio=auto
537 _arts=auto
538 _esd=auto
539 _polyp=auto
540 _jack=auto
541 _openal=auto
542 _libcdio=auto
543 _liblzo=auto
544 _mad=auto
545 _toolame=auto
546 _twolame=auto
547 _tremor_internal=yes
548 _tremor_low=no
549 _tremor_external=auto
550 _libvorbis=auto
551 _speex=auto
552 _theora=auto
553 _mp3lib=yes
554 _liba52=yes
555 _libmpeg2=yes
556 _faad_internal=auto
557 _faad_external=auto
558 _faad_fixed=no
559 _faac=auto
560 _ladspa=auto
561 _xmms=no
562 _dvdnav=auto
563 _dvdnavconfig=dvdnav-config
564 _dvdread=auto
565 _dvdread_internal=auto
566 _libdvdcss_internal=auto
567 _xanim=auto
568 _real=auto
569 _live=auto
570 _xinerama=auto
571 _mga=auto
572 _xmga=auto
573 _vm=auto
574 _xf86keysym=auto
575 _mlib=no #broken, thus disabled
576 _sgiaudio=auto
577 _sunaudio=auto
578 _alsa=auto
579 _fastmemcpy=yes
580 _unrarlib=yes
581 _win32dll=auto
582 _select=yes
583 _radio=no
584 _radio_capture=no
585 _radio_v4l=auto
586 _radio_v4l2=auto
587 _radio_bsdbt848=auto
588 _tv=yes
589 _tv_v4l1=auto
590 _tv_v4l2=auto
591 _tv_bsdbt848=auto
592 _tv_teletext=auto
593 _pvr=auto
594 _network=yes
595 _winsock2=auto
596 _smbsupport=auto
597 _vidix_internal=auto
598 _vidix_external=auto
599 _joystick=no
600 _xvid=auto
601 _x264=auto
602 _nut=auto
603 _lirc=auto
604 _lircc=auto
605 _gui=no
606 _gtk1=no
607 _termcap=auto
608 _termios=auto
609 _3dfx=no
610 _s3fb=no
611 _tdfxfb=no
612 _tdfxvid=no
613 _tga=yes
614 _directfb=auto
615 _zr=auto
616 _bl=no
617 _largefiles=no
618 #_language=en
619 _shm=auto
620 _linux_devfs=no
621 _charset="UTF-8"
622 _dynamic_plugins=no
623 _crash_debug=no
624 _sighandler=yes
625 _libdv=auto
626 _cdparanoia=auto
627 _cddb=auto
628 _big_endian=auto
629 _bitmap_font=yes
630 _freetype=auto
631 _fontconfig=auto
632 _menu=no
633 _qtx=auto
634 _macosx=auto
635 _maemo=auto
636 _macosx_finder_support=no
637 _macosx_bundle=auto
638 _sortsub=yes
639 _freetypeconfig='freetype-config'
640 _fribidi=auto
641 _fribidiconfig='fribidi-config'
642 _enca=auto
643 _inet6=auto
644 _gethostbyname2=auto
645 _ftp=yes
646 _musepack=auto
647 _vstream=auto
648 _pthreads=auto
649 _ass=auto
650 _rpath=no
651 _asmalign_pot=auto
652 _color_console=no
653 _stream_cache=yes
654 _def_stream_cache="#define USE_STREAM_CACHE 1"
655 _need_shmem=yes
656 for ac_option do
657 case "$ac_option" in
658 --help|-help|-h)
659 show_help
661 --prefix=*)
662 _prefix=`echo $ac_option | cut -d '=' -f 2`
664 --bindir=*)
665 _bindir=`echo $ac_option | cut -d '=' -f 2`
667 --datadir=*)
668 _datadir=`echo $ac_option | cut -d '=' -f 2`
670 --mandir=*)
671 _mandir=`echo $ac_option | cut -d '=' -f 2`
673 --confdir=*)
674 _confdir=`echo $ac_option | cut -d '=' -f 2`
676 --libdir=*)
677 _libdir=`echo $ac_option | cut -d '=' -f 2`
679 --codecsdir=*)
680 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
682 --win32codecsdir=*)
683 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
685 --xanimcodecsdir=*)
686 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
688 --realcodecsdir=*)
689 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
691 --with-extraincdir=*)
692 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
694 --with-extralibdir=*)
695 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
698 --with-install=*)
699 _install=`echo $ac_option | cut -d '=' -f 2 `
701 --with-xvmclib=*)
702 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
705 --with-sdl-config=*)
706 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
708 --with-freetype-config=*)
709 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
711 --with-fribidi-config=*)
712 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
714 --with-gtk-config=*)
715 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
717 --with-glib-config=*)
718 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
720 --with-dvdnav-config=*)
721 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
724 --extra-libs=*)
725 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
727 --extra-libs-mplayer=*)
728 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
730 --extra-libs-mencoder=*)
731 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
734 --target=*)
735 _target=`echo $ac_option | cut -d '=' -f 2`
737 --cc=*)
738 _cc=`echo $ac_option | cut -d '=' -f 2`
740 --host-cc=*)
741 _host_cc=`echo $ac_option | cut -d '=' -f 2`
743 --as=*)
744 _as=`echo $ac_option | cut -d '=' -f 2`
746 --charset=*)
747 _charset=`echo $ac_option | cut -d '=' -f 2`
749 --language=*)
750 _language=`echo $ac_option | cut -d '=' -f 2`
753 --enable-static)
754 _ld_static='-static'
756 --disable-static)
757 _ld_static=''
759 --enable-profile)
760 _profile='-p'
762 --disable-profile)
763 _profile=
765 --enable-debug)
766 _debug='-g'
768 --enable-debug=*)
769 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
771 --disable-debug)
772 _debug=
774 --enable-gcc-check) _gcc_check=yes ;;
775 --disable-gcc-check) _gcc_check=no ;;
776 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
777 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
778 --enable-cross-compile) _cross_compile=yes ;;
779 --disable-cross-compile) _cross_compile=no ;;
780 --enable-mencoder) _mencoder=yes ;;
781 --disable-mencoder) _mencoder=no ;;
782 --enable-mplayer) _mplayer=yes ;;
783 --disable-mplayer) _mplayer=no ;;
784 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
785 --disable-dynamic-plugins) _dynamic_plugins=no ;;
786 --enable-x11) _x11=yes ;;
787 --disable-x11) _x11=no ;;
788 --enable-xshape) _xshape=yes ;;
789 --disable-xshape) _xshape=no ;;
790 --enable-xv) _xv=yes ;;
791 --disable-xv) _xv=no ;;
792 --enable-xvmc) _xvmc=yes ;;
793 --disable-xvmc) _xvmc=no ;;
794 --enable-sdl) _sdl=yes ;;
795 --disable-sdl) _sdl=no ;;
796 --enable-directx) _directx=yes ;;
797 --disable-directx) _directx=no ;;
798 --enable-win32waveout) _win32waveout=yes ;;
799 --disable-win32waveout) _win32waveout=no ;;
800 --enable-nas) _nas=yes ;;
801 --disable-nas) _nas=no ;;
802 --enable-png) _png=yes ;;
803 --disable-png) _png=no ;;
804 --enable-jpeg) _jpeg=yes ;;
805 --disable-jpeg) _jpeg=no ;;
806 --enable-pnm) _pnm=yes ;;
807 --disable-pnm) _pnm=no ;;
808 --enable-md5sum) _md5sum=yes ;;
809 --disable-md5sum) _md5sum=no ;;
810 --enable-gif) _gif=yes ;;
811 --disable-gif) _gif=no ;;
812 --enable-gl) _gl=yes ;;
813 --disable-gl) _gl=no ;;
814 --enable-ggi) _ggi=yes ;;
815 --disable-ggi) _ggi=no ;;
816 --enable-ggiwmh) _ggiwmh=yes ;;
817 --disable-ggiwmh) _ggiwmh=no ;;
818 --enable-aa) _aa=yes ;;
819 --disable-aa) _aa=no ;;
820 --enable-caca) _caca=yes ;;
821 --disable-caca) _caca=no ;;
822 --enable-svga) _svga=yes ;;
823 --disable-svga) _svga=no ;;
824 --enable-vesa) _vesa=yes ;;
825 --disable-vesa) _vesa=no ;;
826 --enable-fbdev) _fbdev=yes ;;
827 --disable-fbdev) _fbdev=no ;;
828 --enable-dvb) _dvb=yes ;;
829 --disable-dvb) _dvb=no ;;
830 --enable-dvbhead) _dvbhead=yes ;;
831 --disable-dvbhead) _dvbhead=no ;;
832 --enable-dxr2) _dxr2=yes ;;
833 --disable-dxr2) _dxr2=no ;;
834 --enable-dxr3) _dxr3=yes ;;
835 --disable-dxr3) _dxr3=no ;;
836 --enable-ivtv) _ivtv=yes ;;
837 --disable-ivtv) _ivtv=no ;;
838 --enable-iconv) _iconv=yes ;;
839 --disable-iconv) _iconv=no ;;
840 --enable-langinfo) _langinfo=yes ;;
841 --disable-langinfo) _langinfo=no ;;
842 --enable-rtc) _rtc=yes ;;
843 --disable-rtc) _rtc=no ;;
844 --enable-libdv) _libdv=yes ;;
845 --disable-libdv) _libdv=no ;;
846 --enable-ossaudio) _ossaudio=yes ;;
847 --disable-ossaudio) _ossaudio=no ;;
848 --enable-arts) _arts=yes ;;
849 --disable-arts) _arts=no ;;
850 --enable-esd) _esd=yes ;;
851 --disable-esd) _esd=no ;;
852 --enable-polyp) _polyp=yes ;;
853 --disable-polyp) _polyp=no ;;
854 --enable-jack) _jack=yes ;;
855 --disable-jack) _jack=no ;;
856 --enable-openal) _openal=yes ;;
857 --disable-openal) _openal=no ;;
858 --enable-mad) _mad=yes ;;
859 --disable-mad) _mad=no ;;
860 --enable-toolame) _toolame=yes ;;
861 --disable-toolame) _toolame=no ;;
862 --enable-twolame) _twolame=yes ;;
863 --disable-twolame) _twolame=no ;;
864 --enable-libcdio) _libcdio=yes ;;
865 --disable-libcdio) _libcdio=no ;;
866 --enable-liblzo) _liblzo=yes ;;
867 --disable-liblzo) _liblzo=no ;;
868 --enable-libvorbis) _libvorbis=yes ;;
869 --disable-libvorbis) _libvorbis=no ;;
870 --enable-speex) _speex=yes ;;
871 --disable-speex) _speex=no ;;
872 --enable-tremor-internal) _tremor_internal=yes ;;
873 --disable-tremor-internal) _tremor_internal=no ;;
874 --enable-tremor-low) _tremor_low=yes ;;
875 --disable-tremor-low) _tremor_low=no ;;
876 --enable-tremor-external) _tremor_external=yes ;;
877 --disable-tremor-external) _tremor_external=no ;;
878 --enable-theora) _theora=yes ;;
879 --disable-theora) _theora=no ;;
880 --enable-mp3lib) _mp3lib=yes ;;
881 --disable-mp3lib) _mp3lib=no ;;
882 --enable-liba52) _liba52=yes ;;
883 --disable-liba52) _liba52=no ;;
884 --enable-libmpeg2) _libmpeg2=yes ;;
885 --disable-libmpeg2) _libmpeg2=no ;;
886 --enable-musepack) _musepack=yes ;;
887 --disable-musepack) _musepack=no ;;
888 --enable-faad-internal) _faad_internal=yes ;;
889 --disable-faad-internal) _faad_internal=no ;;
890 --enable-faad-external) _faad_external=yes ;;
891 --disable-faad-external) _faad_external=no ;;
892 --enable-faad-fixed) _faad_fixed=yes ;;
893 --disable-faad-fixed) _faad_fixed=no ;;
894 --enable-faac) _faac=yes ;;
895 --disable-faac) _faac=no ;;
896 --enable-ladspa) _ladspa=yes ;;
897 --disable-ladspa) _ladspa=no ;;
898 --enable-xmms) _xmms=yes ;;
899 --disable-xmms) _xmms=no ;;
900 --enable-dvdread) _dvdread=yes ;;
901 --disable-dvdread) _dvdread=no ;;
902 --enable-dvdread-internal) _dvdread_internal=yes ;;
903 --disable-dvdread-internal) _dvdread_internal=no ;;
904 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
905 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
906 --enable-dvdnav) _dvdnav=yes ;;
907 --disable-dvdnav) _dvdnav=no ;;
908 --enable-xanim) _xanim=yes ;;
909 --disable-xanim) _xanim=no ;;
910 --enable-real) _real=yes ;;
911 --disable-real) _real=no ;;
912 --enable-live) _live=yes ;;
913 --disable-live) _live=no ;;
914 --enable-xinerama) _xinerama=yes ;;
915 --disable-xinerama) _xinerama=no ;;
916 --enable-mga) _mga=yes ;;
917 --disable-mga) _mga=no ;;
918 --enable-xmga) _xmga=yes ;;
919 --disable-xmga) _xmga=no ;;
920 --enable-vm) _vm=yes ;;
921 --disable-vm) _vm=no ;;
922 --enable-xf86keysym) _xf86keysym=yes ;;
923 --disable-xf86keysym) _xf86keysym=no ;;
924 --enable-mlib) _mlib=yes ;;
925 --disable-mlib) _mlib=no ;;
926 --enable-sunaudio) _sunaudio=yes ;;
927 --disable-sunaudio) _sunaudio=no ;;
928 --enable-sgiaudio) _sgiaudio=yes ;;
929 --disable-sgiaudio) _sgiaudio=no ;;
930 --enable-alsa) _alsa=yes ;;
931 --disable-alsa) _alsa=no ;;
932 --enable-tv) _tv=yes ;;
933 --disable-tv) _tv=no ;;
934 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
935 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
936 --enable-tv-v4l1) _tv_v4l1=yes ;;
937 --disable-tv-v4l1) _tv_v4l1=no ;;
938 --enable-tv-v4l2) _tv_v4l2=yes ;;
939 --disable-tv-v4l2) _tv_v4l2=no ;;
940 --enable-tv-teletext) _tv_teletext=yes ;;
941 --disable-tv-teletext) _tv_teletext=no ;;
942 --enable-radio) _radio=yes ;;
943 --enable-radio-capture) _radio_capture=yes ;;
944 --disable-radio-capture) _radio_capture=no ;;
945 --disable-radio) _radio=no ;;
946 --enable-radio-v4l) _radio_v4l=yes ;;
947 --disable-radio-v4l) _radio_v4l=no ;;
948 --enable-radio-v4l2) _radio_v4l2=yes ;;
949 --disable-radio-v4l2) _radio_v4l2=no ;;
950 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
951 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
952 --enable-pvr) _pvr=yes ;;
953 --disable-pvr) _pvr=no ;;
954 --enable-fastmemcpy) _fastmemcpy=yes ;;
955 --disable-fastmemcpy) _fastmemcpy=no ;;
956 --enable-network) _network=yes ;;
957 --disable-network) _network=no ;;
958 --enable-winsock2) _winsock2=yes ;;
959 --disable-winsock2) _winsock2=no ;;
960 --enable-smb) _smbsupport=yes ;;
961 --disable-smb) _smbsupport=no ;;
962 --enable-vidix-internal) _vidix_internal=yes ;;
963 --disable-vidix-internal) _vidix_internal=no ;;
964 --enable-vidix-external) _vidix_external=yes ;;
965 --disable-vidix-external) _vidix_external=no ;;
966 --with-vidix-drivers=*)
967 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
969 --enable-joystick) _joystick=yes ;;
970 --disable-joystick) _joystick=no ;;
971 --enable-xvid) _xvid=yes ;;
972 --disable-xvid) _xvid=no ;;
973 --enable-x264) _x264=yes ;;
974 --disable-x264) _x264=no ;;
975 --enable-nut) _nut=yes ;;
976 --disable-nut) _nut=no ;;
977 --enable-libavutil_a) _libavutil_a=yes ;;
978 --disable-libavutil_a) _libavutil_a=no ;;
979 --enable-libavutil_so) _libavutil_so=yes ;;
980 --disable-libavutil_so) _libavutil_so=no ;;
981 --enable-libavcodec_a) _libavcodec_a=yes ;;
982 --disable-libavcodec_a) _libavcodec_a=no ;;
983 --enable-libavcodec_so) _libavcodec_so=yes ;;
984 --disable-libavcodec_so) _libavcodec_so=no ;;
985 --enable-libamr_nb) _libamr_nb=yes ;;
986 --disable-libamr_nb) _libamr_nb=no ;;
987 --enable-libamr_wb) _libamr_wb=yes ;;
988 --disable-libamr_wb) _libamr_wb=no ;;
989 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
990 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
991 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
992 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
993 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
994 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
995 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
996 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
997 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
998 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
999 --enable-libavformat_a) _libavformat_a=yes ;;
1000 --disable-libavformat_a) _libavformat_a=no ;;
1001 --enable-libavformat_so) _libavformat_so=yes ;;
1002 --disable-libavformat_so) _libavformat_so=no ;;
1003 --enable-libpostproc_a) _libpostproc_a=yes ;;
1004 --disable-libpostproc_a) _libpostproc_a=no ;;
1005 --enable-libpostproc_so) _libpostproc_so=yes ;;
1006 --disable-libpostproc_so) _libpostproc_so=no ;;
1007 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1008 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1010 --enable-lirc) _lirc=yes ;;
1011 --disable-lirc) _lirc=no ;;
1012 --enable-lircc) _lircc=yes ;;
1013 --disable-lircc) _lircc=no ;;
1014 --enable-gui) _gui=yes ;;
1015 --disable-gui) _gui=no ;;
1016 --enable-gtk1) _gtk1=yes ;;
1017 --disable-gtk1) _gtk1=no ;;
1018 --enable-termcap) _termcap=yes ;;
1019 --disable-termcap) _termcap=no ;;
1020 --enable-termios) _termios=yes ;;
1021 --disable-termios) _termios=no ;;
1022 --enable-3dfx) _3dfx=yes ;;
1023 --disable-3dfx) _3dfx=no ;;
1024 --enable-s3fb) _s3fb=yes ;;
1025 --disable-s3fb) _s3fb=no ;;
1026 --enable-tdfxfb) _tdfxfb=yes ;;
1027 --disable-tdfxfb) _tdfxfb=no ;;
1028 --disable-tdfxvid) _tdfxvid=no ;;
1029 --enable-tdfxvid) _tdfxvid=yes ;;
1030 --disable-tga) _tga=no ;;
1031 --enable-tga) _tga=yes ;;
1032 --enable-directfb) _directfb=yes ;;
1033 --disable-directfb) _directfb=no ;;
1034 --enable-zr) _zr=yes ;;
1035 --disable-zr) _zr=no ;;
1036 --enable-bl) _bl=yes ;;
1037 --disable-bl) _bl=no ;;
1038 --enable-mtrr) _mtrr=yes ;;
1039 --disable-mtrr) _mtrr=no ;;
1040 --enable-largefiles) _largefiles=yes ;;
1041 --disable-largefiles) _largefiles=no ;;
1042 --enable-shm) _shm=yes ;;
1043 --disable-shm) _shm=no ;;
1044 --enable-select) _select=yes ;;
1045 --disable-select) _select=no ;;
1046 --enable-linux-devfs) _linux_devfs=yes ;;
1047 --disable-linux-devfs) _linux_devfs=no ;;
1048 --enable-cdparanoia) _cdparanoia=yes ;;
1049 --disable-cdparanoia) _cdparanoia=no ;;
1050 --enable-cddb) _cddb=yes ;;
1051 --disable-cddb) _cddb=no ;;
1052 --enable-big-endian) _big_endian=yes ;;
1053 --disable-big-endian) _big_endian=no ;;
1054 --enable-bitmap-font) _bitmap_font=yes ;;
1055 --disable-bitmap-font) _bitmap_font=no ;;
1056 --enable-freetype) _freetype=yes ;;
1057 --disable-freetype) _freetype=no ;;
1058 --enable-fontconfig) _fontconfig=yes ;;
1059 --disable-fontconfig) _fontconfig=no ;;
1060 --enable-unrarlib) _unrarlib=yes ;;
1061 --disable-unrarlib) _unrarlib=no ;;
1062 --enable-ftp) _ftp=yes ;;
1063 --disable-ftp) _ftp=no ;;
1064 --enable-vstream) _vstream=yes ;;
1065 --disable-vstream) _vstream=no ;;
1066 --enable-pthreads) _pthreads=yes ;;
1067 --disable-pthreads) _pthreads=no ;;
1068 --enable-ass) _ass=yes ;;
1069 --disable-ass) _ass=no ;;
1070 --enable-rpath) _rpath=yes ;;
1071 --disable-rpath) _rpath=no ;;
1072 --enable-color-console) _color_console=yes ;;
1073 --disable-color-console) _color_console=no ;;
1075 --enable-fribidi) _fribidi=yes ;;
1076 --disable-fribidi) _fribidi=no ;;
1078 --enable-enca) _enca=yes ;;
1079 --disable-enca) _enca=no ;;
1081 --enable-inet6) _inet6=yes ;;
1082 --disable-inet6) _inet6=no ;;
1084 --enable-gethostbyname2) _gethostbyname2=yes ;;
1085 --disable-gethostbyname2) _gethostbyname2=no ;;
1087 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1088 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1089 --disable-dga) _dga=no ;;
1091 --enable-menu) _menu=yes ;;
1092 --disable-menu) _menu=no ;;
1094 --enable-qtx) _qtx=yes ;;
1095 --disable-qtx) _qtx=no ;;
1097 --enable-macosx) _macosx=yes ;;
1098 --disable-macosx) _macosx=no ;;
1099 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1100 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1101 --enable-macosx-bundle) _macosx_bundle=yes;;
1102 --disable-macosx-bundle) _macosx_bundle=no;;
1104 --enable-maemo) _maemo=yes ;;
1105 --disable-maemo) _maemo=no ;;
1107 --enable-sortsub) _sortsub=yes ;;
1108 --disable-sortsub) _sortsub=no ;;
1110 --enable-crash-debug) _crash_debug=yes ;;
1111 --disable-crash-debug) _crash_debug=no ;;
1112 --enable-sighandler) _sighandler=yes ;;
1113 --disable-sighandler) _sighandler=no ;;
1114 --enable-win32dll) _win32dll=yes ;;
1115 --disable-win32dll) _win32dll=no ;;
1117 --enable-sse) _sse=yes ;;
1118 --disable-sse) _sse=no ;;
1119 --enable-sse2) _sse2=yes ;;
1120 --disable-sse2) _sse2=no ;;
1121 --enable-ssse3) _ssse3=yes ;;
1122 --disable-ssse3) _ssse3=no ;;
1123 --enable-mmxext) _mmxext=yes ;;
1124 --disable-mmxext) _mmxext=no ;;
1125 --enable-3dnow) _3dnow=yes ;;
1126 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1127 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1128 --disable-3dnowext) _3dnowext=no ;;
1129 --enable-cmov) _cmov=yes ;;
1130 --disable-cmov) _cmov=no ;;
1131 --enable-fast-cmov) _fast_cmov=yes ;;
1132 --disable-fast-cmov) _fast_cmov=no ;;
1133 --enable-altivec) _altivec=yes ;;
1134 --disable-altivec) _altivec=no ;;
1135 --enable-armv5te) _armv5te=yes ;;
1136 --disable-armv5te) _armv5te=no ;;
1137 --enable-armv6) _armv6=yes ;;
1138 --disable-armv6) _armv6=no ;;
1139 --enable-iwmmxt) _iwmmxt=yes ;;
1140 --disable-iwmmxt) _iwmmxt=no ;;
1141 --enable-mmx) _mmx=yes ;;
1142 --disable-mmx) # 3Dnow! and MMX2 require MMX
1143 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1146 echo "Unknown parameter: $ac_option"
1147 exit 1
1150 esac
1151 done
1153 # Atmos: moved this here, to be correct, if --prefix is specified
1154 test -z "$_bindir" && _bindir="$_prefix/bin"
1155 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1156 test -z "$_mandir" && _mandir="$_prefix/man"
1157 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1158 test -z "$_libdir" && _libdir="$_prefix/lib"
1160 # Determine our OS name and CPU architecture
1161 if test -z "$_target" ; then
1162 # OS name
1163 system_name=`uname -s 2>&1`
1164 case "$system_name" in
1165 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX|AmigaOS)
1167 IRIX*)
1168 system_name=IRIX
1170 GNU/kFreeBSD)
1171 system_name=FreeBSD
1173 HP-UX*)
1174 system_name=HP-UX
1176 [cC][yY][gG][wW][iI][nN]*)
1177 system_name=CYGWIN
1179 MINGW32*)
1180 system_name=MINGW32
1183 system_name="$system_name-UNKNOWN"
1185 esac
1188 # host's CPU/instruction set
1189 host_arch=`uname -p 2>&1`
1190 case "$host_arch" in
1191 i386|sparc|ppc|alpha|arm|mips|vax)
1193 powerpc) # Darwin returns 'powerpc'
1194 host_arch=ppc
1196 *) # uname -p on Linux returns 'unknown' for the processor type,
1197 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1199 # Maybe uname -m (machine hardware name) returns something we
1200 # recognize.
1202 # x86/x86pc is used by QNX
1203 case "`uname -m 2>&1`" in
1204 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 ;;
1205 ia64) host_arch=ia64 ;;
1206 x86_64|amd64)
1207 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1208 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1209 host_arch=x86_64
1210 else
1211 host_arch=i386
1214 macppc|ppc|ppc64) host_arch=ppc ;;
1215 alpha) host_arch=alpha ;;
1216 sparc) host_arch=sparc ;;
1217 sparc64) host_arch=sparc64 ;;
1218 parisc*|hppa*|9000*) host_arch=hppa ;;
1219 arm*|zaurus|cats) host_arch=arm ;;
1220 s390) host_arch=s390 ;;
1221 s390x) host_arch=s390x ;;
1222 mips*) host_arch=mips ;;
1223 vax) host_arch=vax ;;
1224 *) host_arch=UNKNOWN ;;
1225 esac
1227 esac
1228 else # if test -z "$_target"
1229 system_name=`echo $_target | cut -d '-' -f 2`
1230 case "`echo $system_name | tr A-Z a-z`" in
1231 linux) system_name=Linux ;;
1232 freebsd) system_name=FreeBSD ;;
1233 gnu/kfreebsd) system_name=FreeBSD ;;
1234 netbsd) system_name=NetBSD ;;
1235 bsd/os) system_name=BSD/OS ;;
1236 openbsd) system_name=OpenBSD ;;
1237 sunos) system_name=SunOS ;;
1238 qnx) system_name=QNX ;;
1239 morphos) system_name=MorphOS ;;
1240 amigaos) system_name=AmigaOS ;;
1241 mingw32msvc) system_name=MINGW32 ;;
1242 esac
1243 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1244 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
1247 echo "Detected operating system: $system_name"
1248 echo "Detected host architecture: $host_arch"
1250 if test "$_runtime_cpudetection" = yes && not x86 && not ppc; then
1251 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1254 # LGB: temporary files
1255 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1256 test "$I" && break
1257 done
1259 TMPLOG="configure.log"
1260 rm -f "$TMPLOG"
1261 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1262 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1263 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
1264 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1266 # config files
1268 # FIXME: A lot of stuff is installed under /usr/local
1269 # NK: But we should never use this stuff implicitly since we call compiler
1270 # from /usr we should be sure that there no effects from other compilers
1271 # (libraries) which might be installed into /usr/local. Let users use this
1272 # stuff explicitly as command line argument. In other words: It would be
1273 # resonable to have only /usr/include or only /usr/local/include.
1275 if openbsd ; then
1276 _ldconfig="ldconfig -R"
1279 if freebsd ; then
1280 _ld_extra="$_ld_extra -L/usr/local/lib"
1281 _inc_extra="$_inc_extra -I/usr/local/include"
1284 if darwin; then
1285 _ld_extra="$_ld_extra -L/usr/local/lib"
1286 _inc_extra="$_inc_extra -I/usr/local/include"
1289 if aix ; then
1290 _ld_extra="$_ld_extra -lC"
1293 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
1294 if irix ; then
1295 _ranlib='ar -r'
1296 elif linux ; then
1297 _ranlib='true'
1300 if win32 ; then
1301 _exesuf=".exe"
1302 # -lwinmm is always needed for osdep/timer-win2.c
1303 _ld_extra="$_ld_extra -lwinmm"
1304 _confwin32='TARGET_WIN32 = yes'
1305 else
1306 _confwin32='TARGET_WIN32 = no'
1309 if mingw32 ; then
1310 _need_shmem=no
1313 if cygwin ; then
1314 _def_confwin32='#define WIN32'
1317 if amigaos ; then
1318 _select=no
1319 _sighandler=no
1320 _stream_cache=no
1321 _def_stream_cache="#undef USE_STREAM_CACHE"
1324 if qnx ; then
1325 _ld_extra="$_ld_extra -lph"
1328 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1329 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1330 # know about '-n'.
1331 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1332 _head() { head -$1 2>/dev/null ; }
1333 else
1334 _head() { head -n $1 2>/dev/null ; }
1336 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1337 _tail() { tail -$1 2>/dev/null ; }
1338 else
1339 _tail() { tail -n $1 2>/dev/null ; }
1342 # Checking CC version...
1343 if test "$_gcc_check" = yes ; then
1344 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1345 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1346 echocheck "$_cc version"
1347 cc_vendor=intel
1348 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1349 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1350 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1351 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1352 # TODO verify older icc/ecc compatibility
1353 case $cc_version in
1355 cc_version="v. ?.??, bad"
1356 cc_verc_fail=yes
1358 8.0|9.1|10.0)
1359 cc_version="$cc_version, ok"
1360 cc_verc_fail=no
1363 cc_version="$cc_version, bad"
1364 cc_verc_fail=yes
1366 esac
1367 echores "$cc_version"
1368 else
1369 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
1370 echocheck "$_cc version"
1371 cc_vendor=gnu
1372 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1373 cc_version=`$_cc -dumpversion 2>&1`
1374 if test "$?" -gt 0; then
1375 cc_version="not found"
1377 case $cc_version in
1379 cc_version="v. ?.??, bad"
1380 cc_verc_fail=yes
1382 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1383 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1384 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1385 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1386 cc_version="$cc_version, ok"
1387 cc_verc_fail=no
1389 'not found')
1390 cc_verc_fail=yes
1393 cc_version="$cc_version, bad"
1394 cc_verc_fail=yes
1396 esac
1397 echores "$cc_version"
1398 test "$cc_verc_fail" = "no" && break
1399 done
1400 fi # icc
1401 if test "$cc_verc_fail" = yes ; then
1402 cat <<EOF
1404 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1406 You are not using a supported compiler. We do not have the time to make sure
1407 everything works with compilers other than the ones we use. Use either the
1408 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1409 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1411 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1412 mplayer and lame (which is used for mencoder). If you get compile errors,
1413 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1414 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1415 bugs!
1417 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1420 die "Bad gcc version"
1422 else
1423 cat <<EOF
1425 ******************************************************************************
1427 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1428 Ok. You know. Do it.
1430 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1431 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1432 Lame which is used by mencoder produces weird errors, too.
1434 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1435 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1437 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1439 ******************************************************************************
1443 read _answer
1446 echocheck "host cc"
1447 test "$_host_cc" || _host_cc=$_cc
1448 echores $_host_cc
1450 echocheck "cross compilation"
1451 if test $_cross_compile = auto ; then
1452 cat > $TMPC << EOF
1453 int main() { return 0; }
1455 _cross_compile=yes
1456 cc_check && "$TMPO" && _cross_compile=no
1458 echores $_cross_compile
1460 if test $_cross_compile = yes; then
1461 tmp_run() {
1462 return 0
1466 # ---
1468 # now that we know what compiler should be used for compilation, try to find
1469 # out which assembler is used by the $_cc compiler
1470 if test "$_as" = auto ; then
1471 _as=`$_cc -print-prog-name=as`
1472 test -z "$_as" && _as=as
1475 # XXX: this should be ok..
1476 _cpuinfo="echo"
1478 if test "$_runtime_cpudetection" = no ; then
1480 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1481 # FIXME: Remove the cygwin check once AMD CPUs are supported
1482 if test -r /proc/cpuinfo && not cygwin; then
1483 # Linux with /proc mounted, extract CPU information from it
1484 _cpuinfo="cat /proc/cpuinfo"
1485 elif test -r /compat/linux/proc/cpuinfo && not x86_32 ; then
1486 # FreeBSD with Linux emulation /proc mounted,
1487 # extract CPU information from it
1488 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1489 elif darwin && not x86_32 ; then
1490 # use hostinfo on Darwin
1491 _cpuinfo="hostinfo"
1492 elif aix; then
1493 # use 'lsattr' on AIX
1494 _cpuinfo="lsattr -E -l proc0 -a type"
1495 elif x86; then
1496 # all other OSes try to extract CPU information from a small helper
1497 # program cpuinfo instead
1498 $_cc -o cpuinfo cpuinfo.c
1499 _cpuinfo="./cpuinfo"
1502 if x86 ; then
1503 # gather more CPU information
1504 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1505 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1506 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1507 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1508 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1510 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1512 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1513 -e s/xmm/sse/ -e s/kni/sse/`
1515 for ext in $pparam ; do
1516 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1517 done
1519 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1520 test $_sse = kernel_check && _mmxext=kernel_check
1522 echocheck "CPU vendor"
1523 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1525 echocheck "CPU type"
1526 echores "$pname"
1529 fi # test "$_runtime_cpudetection" = no
1531 if x86 && test "$_runtime_cpudetection" = no ; then
1532 extcheck() {
1533 if test "$1" = kernel_check ; then
1534 echocheck "kernel support of $2"
1535 cat > $TMPC <<EOF
1536 #include <signal.h>
1537 void catch() { exit(1); }
1538 int main(void){
1539 signal(SIGILL, catch);
1540 __asm__ __volatile__ ("$3":::"memory");return(0);
1544 if cc_check && tmp_run ; then
1545 eval _$2=yes
1546 echores "yes"
1547 _optimizing="$_optimizing $2"
1548 return 0
1549 else
1550 eval _$2=no
1551 echores "failed"
1552 echo "It seems that your kernel does not correctly support $2."
1553 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1554 return 1
1557 return 0
1560 extcheck $_mmx "mmx" "emms"
1561 extcheck $_mmxext "mmxext" "sfence"
1562 extcheck $_3dnow "3dnow" "femms"
1563 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1564 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1565 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1566 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1567 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1569 echocheck "mtrr support"
1570 if test "$_mtrr" = kernel_check ; then
1571 _mtrr="yes"
1572 _optimizing="$_optimizing mtrr"
1574 echores "$_mtrr"
1576 if test "$_gcc3_ext" != ""; then
1577 # if we had to disable sse/sse2 because the active kernel does not
1578 # support this instruction set extension, we also have to tell
1579 # gcc3 to not generate sse/sse2 instructions for normal C code
1580 cat > $TMPC << EOF
1581 int main(void) { return 0; }
1583 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1588 case "$host_arch" in
1589 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1590 _def_arch_x86="#define ARCH_X86 1"
1591 _target_arch_x86="TARGET_ARCH_X86 = yes"
1592 _def_arch="#define ARCH_X86_32 1"
1593 _target_arch="TARGET_ARCH_X86_32 = yes"
1594 iproc=486
1595 proc=i486
1598 if test "$_runtime_cpudetection" = no ; then
1599 case "$pvendor" in
1600 AuthenticAMD)
1601 case "$pfamily" in
1602 3) proc=i386 iproc=386 ;;
1603 4) proc=i486 iproc=486 ;;
1604 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1605 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1606 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1607 proc=k6-3
1608 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1609 proc=geode
1610 elif test "$pmodel" -ge 8; then
1611 proc=k6-2
1612 elif test "$pmodel" -ge 6; then
1613 proc=k6
1614 else
1615 proc=i586
1618 6) iproc=686
1619 # It's a bit difficult to determine the correct type of Family 6
1620 # AMD CPUs just from their signature. Instead, we check directly
1621 # whether it supports SSE.
1622 if test "$_sse" = yes; then
1623 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1624 proc=athlon-xp
1625 else
1626 # Again, gcc treats athlon and athlon-tbird similarly.
1627 proc=athlon
1630 15) iproc=686
1631 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1632 # caught and remedied in the optimization tests below.
1633 proc=k8
1636 *) proc=k8 iproc=686 ;;
1637 esac
1639 GenuineIntel)
1640 case "$pfamily" in
1641 3) proc=i386 iproc=386 ;;
1642 4) proc=i486 iproc=486 ;;
1643 5) iproc=586
1644 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1645 proc=pentium-mmx # 4 is desktop, 8 is mobile
1646 else
1647 proc=i586
1650 6) iproc=686
1651 if test "$pmodel" -ge 15; then
1652 proc=core2
1653 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1654 proc=pentium-m
1655 elif test "$pmodel" -ge 7; then
1656 proc=pentium3
1657 elif test "$pmodel" -ge 3; then
1658 proc=pentium2
1659 else
1660 proc=i686
1663 15) iproc=686
1664 # A nocona in 32-bit mode has no more capabilities than a prescott.
1665 if test "$pmodel" -ge 3; then
1666 proc=prescott
1667 else
1668 proc=pentium4
1671 *) proc=prescott iproc=686 ;;
1672 esac
1674 CentaurHauls)
1675 case "$pfamily" in
1676 5) iproc=586
1677 if test "$pmodel" -ge 8; then
1678 proc=winchip2
1679 elif test "$pmodel" -ge 4; then
1680 proc=winchip-c6
1681 else
1682 proc=i586
1685 6) iproc=686
1686 if test "$pmodel" -ge 9; then
1687 proc=c3-2
1688 else
1689 proc=c3
1690 iproc=586
1693 *) proc=i686 iproc=i686 ;;
1694 esac
1696 unknown)
1697 case "$pfamily" in
1698 3) proc=i386 iproc=386 ;;
1699 4) proc=i486 iproc=486 ;;
1700 *) proc=i586 iproc=586 ;;
1701 esac
1704 proc=i586 iproc=586 ;;
1705 esac
1706 fi # test "$_runtime_cpudetection" = no
1709 # check that gcc supports our CPU, if not, fall back to earlier ones
1710 # LGB: check -mcpu and -march swithing step by step with enabling
1711 # to fall back till 386.
1713 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1715 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1716 cpuopt=-mtune
1717 else
1718 cpuopt=-mcpu
1721 echocheck "GCC & CPU optimization abilities"
1722 cat > $TMPC << EOF
1723 int main(void) { return 0; }
1725 if test "$_runtime_cpudetection" = no ; then
1726 if test "$proc" = "k8"; then
1727 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1729 if test "$proc" = "athlon-xp"; then
1730 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1732 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1733 cc_check -march=$proc $cpuopt=$proc || proc=k6
1735 if test "$proc" = "k6" || test "$proc" = "c3"; then
1736 if not cc_check -march=$proc $cpuopt=$proc; then
1737 if cc_check -march=i586 $cpuopt=i686; then
1738 proc=i586-i686
1739 else
1740 proc=i586
1744 if test "$proc" = "prescott" ; then
1745 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1747 if test "$proc" = "core2" ; then
1748 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1750 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
1751 cc_check -march=$proc $cpuopt=$proc || proc=i686
1753 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1754 cc_check -march=$proc $cpuopt=$proc || proc=i586
1756 if test "$proc" = "i586"; then
1757 cc_check -march=$proc $cpuopt=$proc || proc=i486
1759 if test "$proc" = "i486" ; then
1760 cc_check -march=$proc $cpuopt=$proc || proc=i386
1762 if test "$proc" = "i386" ; then
1763 cc_check -march=$proc $cpuopt=$proc || proc=error
1765 if test "$proc" = "error" ; then
1766 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1767 _mcpu=""
1768 _march=""
1769 _optimizing=""
1770 elif test "$proc" = "i586-i686"; then
1771 _march="-march=i586"
1772 _mcpu="$cpuopt=i686"
1773 _optimizing="$proc"
1774 else
1775 _march="-march=$proc"
1776 _mcpu="$cpuopt=$proc"
1777 _optimizing="$proc"
1779 else # if test "$_runtime_cpudetection" = no
1780 _mcpu="$cpuopt=generic"
1781 # at least i486 required, for bswap instruction
1782 _march="-march=i486"
1783 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1784 cc_check $_mcpu || _mcpu=""
1785 cc_check $_march $_mcpu || _march=""
1788 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1789 ## autodetected mcpu/march parameters
1790 if test "$_target" ; then
1791 # TODO: it may be a good idea to check GCC and fall back in all cases
1792 if test "$host_arch" = "i586-i686"; then
1793 _march="-march=i586"
1794 _mcpu="$cpuopt=i686"
1795 else
1796 _march="-march=$host_arch"
1797 _mcpu="$cpuopt=$host_arch"
1800 proc="$host_arch"
1802 case "$proc" in
1803 i386) iproc=386 ;;
1804 i486) iproc=486 ;;
1805 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1806 i686|athlon*|pentium*) iproc=686 ;;
1807 *) iproc=586 ;;
1808 esac
1811 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1812 _fast_cmov="yes"
1813 case "$proc" in
1814 pentium4|prescott|nocona)
1815 _fast_cmov="no"
1816 esac
1817 else
1818 _fast_cmov="no"
1821 echores "$proc"
1824 ia64)
1825 _def_arch='#define ARCH_IA64 1'
1826 _target_arch='TARGET_ARCH_IA64 = yes'
1827 iproc='ia64'
1828 proc=''
1829 _march=''
1830 _mcpu=''
1831 _optimizing=''
1834 x86_64|amd64)
1835 _def_arch='#define ARCH_X86_64 1'
1836 _target_arch='TARGET_ARCH_X86_64 = yes'
1837 _def_arch_x86="#define ARCH_X86 1"
1838 _target_arch_x86="TARGET_ARCH_X86 = yes"
1839 iproc='x86_64'
1841 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1842 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1843 cpuopt=-mtune
1844 else
1845 cpuopt=-mcpu
1847 if test "$_runtime_cpudetection" = no ; then
1848 case "$pvendor" in
1849 AuthenticAMD)
1850 proc=k8;;
1851 GenuineIntel)
1852 case "$pfamily" in
1853 6) proc=core2;;
1855 # 64-bit prescotts exist, but as far as GCC is concerned they
1856 # have the same capabilities as a nocona.
1857 proc=nocona;;
1858 esac
1861 proc=error;;
1862 esac
1863 fi # test "$_runtime_cpudetection" = no
1865 echocheck "GCC & CPU optimization abilities"
1866 cat > $TMPC << EOF
1867 int main(void) { return 0; }
1869 # This is a stripped-down version of the i386 fallback.
1870 if test "$_runtime_cpudetection" = no ; then
1871 # --- AMD processors ---
1872 if test "$proc" = "k8"; then
1873 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1875 # This will fail if gcc version < 3.3, which is ok because earlier
1876 # versions don't really support 64-bit on amd64.
1877 # Is this a valid assumption? -Corey
1878 if test "$proc" = "athlon-xp"; then
1879 cc_check -march=$proc $cpuopt=$proc || proc=error
1881 # --- Intel processors ---
1882 if test "$proc" = "core2"; then
1883 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1885 if test "$proc" = "nocona"; then
1886 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1888 if test "$proc" = "pentium4"; then
1889 cc_check -march=$proc $cpuopt=$proc || proc=error
1892 _march="-march=$proc"
1893 _mcpu="$cpuopt=$proc"
1894 if test "$proc" = "error" ; then
1895 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1896 _mcpu=""
1897 _march=""
1899 else # if test "$_runtime_cpudetection" = no
1900 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1901 _march="-march=x86-64"
1902 _mcpu="$cpuopt=generic"
1903 cc_check $_mcpu || _mcpu="x86-64"
1904 cc_check $_mcpu || _mcpu=""
1905 cc_check $_march $_mcpu || _march=""
1908 _optimizing=""
1910 echores "$proc"
1913 sparc)
1914 _def_arch='#define ARCH_SPARC 1'
1915 _target_arch='TARGET_ARCH_SPARC = yes'
1916 iproc='sparc'
1917 if sunos ; then
1918 echocheck "CPU type"
1919 karch=`uname -m`
1920 case "`echo $karch`" in
1921 sun4) proc=v7 ;;
1922 sun4c) proc=v7 ;;
1923 sun4d) proc=v8 ;;
1924 sun4m) proc=v8 ;;
1925 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1926 sun4v) proc=v9 ;;
1927 *) proc=v8 ;;
1928 esac
1929 echores "$proc"
1930 else
1931 proc=v8
1933 _march=''
1934 _mcpu="-mcpu=$proc"
1935 _optimizing="$proc"
1938 sparc64)
1939 _def_arch='#define ARCH_SPARC 1'
1940 _target_arch='TARGET_ARCH_SPARC = yes'
1941 _vis='yes'
1942 _def_vis='#define HAVE_VIS = yes'
1943 iproc='sparc'
1944 proc='v9'
1945 _march=''
1946 _mcpu="-mcpu=$proc"
1947 _optimizing="$proc"
1950 arm|armv4l|armv5tel)
1951 _def_arch='#define ARCH_ARMV4L 1'
1952 _target_arch='TARGET_ARCH_ARMV4L = yes'
1953 iproc='arm'
1954 proc=''
1955 _march=''
1956 _mcpu=''
1957 _optimizing=''
1960 ppc|powerpc)
1961 _def_arch='#define ARCH_POWERPC 1'
1962 _def_dcbzl='#define NO_DCBZL 1'
1963 _target_arch='TARGET_ARCH_POWERPC = yes'
1964 iproc='ppc'
1965 proc=''
1966 _march=''
1967 _mcpu=''
1968 _optimizing=''
1969 _altivec=no
1971 echocheck "CPU type"
1972 case $system_name in
1973 Linux)
1974 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1975 if test -n "`$_cpuinfo | grep altivec`"; then
1976 _altivec=yes
1979 Darwin)
1980 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1981 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
1982 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
1983 _altivec=yes
1986 NetBSD)
1987 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1988 case $cc_version in
1989 2*|3.0*|3.1*|3.2*|3.3*)
1992 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1993 _altivec=yes
1996 esac
1998 AIX)
1999 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2001 esac
2002 if test "$_altivec" = yes; then
2003 echores "$proc altivec"
2004 else
2005 echores "$proc"
2008 echocheck "GCC & CPU optimization abilities"
2010 if test -n "$proc"; then
2011 case "$proc" in
2012 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2013 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2014 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2015 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2016 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2017 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2018 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2019 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2020 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2021 *) ;;
2022 esac
2023 # gcc 3.1(.1) and up supports 7400 and 7450
2024 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2025 case "$proc" in
2026 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2027 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2028 *) ;;
2029 esac
2031 # gcc 3.2 and up supports 970
2032 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2033 case "$proc" in
2034 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2035 _def_dcbzl='#undef NO_DCBZL' ;;
2036 *) ;;
2037 esac
2039 # gcc 3.3 and up supports POWER4
2040 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2041 case "$proc" in
2042 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2043 *) ;;
2044 esac
2046 # gcc 3.4 and up supports 440*
2047 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2048 case "$proc" in
2049 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2050 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2051 *) ;;
2052 esac
2054 # gcc 4.0 and up supports POWER5
2055 if test "$_cc_major" -ge "4"; then
2056 case "$proc" in
2057 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2058 *) ;;
2059 esac
2063 if test -n "$_mcpu"; then
2064 _optimizing=`echo $_mcpu | cut -c 8-`
2065 echores "$_optimizing"
2066 else
2067 echores "none"
2072 alpha)
2073 _def_arch='#define ARCH_ALPHA 1'
2074 _target_arch='TARGET_ARCH_ALPHA = yes'
2075 iproc='alpha'
2076 _march=''
2078 echocheck "CPU type"
2079 cat > $TMPC << EOF
2080 int main() {
2081 unsigned long ver, mask;
2082 asm ("implver %0" : "=r" (ver));
2083 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2084 printf("%ld-%x\n", ver, ~mask);
2085 return 0;
2088 $_cc -o "$TMPO" "$TMPC"
2089 case `"$TMPO"` in
2091 0-0) proc="ev4"; cpu_understands_mvi="0";;
2092 1-0) proc="ev5"; cpu_understands_mvi="0";;
2093 1-1) proc="ev56"; cpu_understands_mvi="0";;
2094 1-101) proc="pca56"; cpu_understands_mvi="1";;
2095 2-303) proc="ev6"; cpu_understands_mvi="1";;
2096 2-307) proc="ev67"; cpu_understands_mvi="1";;
2097 2-1307) proc="ev68"; cpu_understands_mvi="1";;
2098 esac
2099 echores "$proc"
2101 echocheck "GCC & CPU optimization abilities"
2102 if test "$proc" = "ev68" ; then
2103 cc_check -mcpu=$proc || proc=ev67
2105 if test "$proc" = "ev67" ; then
2106 cc_check -mcpu=$proc || proc=ev6
2108 _mcpu="-mcpu=$proc"
2109 echores "$proc"
2111 _optimizing="$proc"
2113 echocheck "MVI instruction support in GCC"
2114 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
2115 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2116 echores "yes"
2117 else
2118 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2119 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2123 mips)
2124 _def_arch='#define ARCH_SGI_MIPS 1'
2125 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
2126 iproc='sgi-mips'
2127 proc=''
2128 _march=''
2129 _mcpu=''
2130 _optimizing=''
2132 if irix ; then
2133 echocheck "CPU type"
2134 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2135 case "`echo $proc`" in
2136 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2137 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2138 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2139 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2140 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2141 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2142 esac
2143 # gcc < 3.x does not support -mtune.
2144 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2145 _mcpu=''
2147 echores "$proc"
2152 hppa)
2153 _def_arch='#define ARCH_PA_RISC 1'
2154 _target_arch='TARGET_ARCH_PA_RISC = yes'
2155 iproc='PA-RISC'
2156 proc=''
2157 _march=''
2158 _mcpu=''
2159 _optimizing=''
2162 s390)
2163 _def_arch='#define ARCH_S390 1'
2164 _target_arch='TARGET_ARCH_S390 = yes'
2165 iproc='390'
2166 proc=''
2167 _march=''
2168 _mcpu=''
2169 _optimizing=''
2172 s390x)
2173 _def_arch='#define ARCH_S390X 1'
2174 _target_arch='TARGET_ARCH_S390X = yes'
2175 iproc='390x'
2176 proc=''
2177 _march=''
2178 _mcpu=''
2179 _optimizing=''
2182 vax)
2183 _def_arch='#define ARCH_VAX 1'
2184 _target_arch='TARGET_ARCH_VAX = yes'
2185 iproc='vax'
2186 proc=''
2187 _march=''
2188 _mcpu=''
2189 _optimizing=''
2192 generic)
2193 _def_arch='#define ARCH_GENERIC 1'
2194 _target_arch='TARGET_ARCH_GENERIC = yes'
2195 iproc=''
2196 proc=''
2197 _march=''
2198 _mcpu=''
2199 _optimizing=''
2203 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2204 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2205 die "unsupported architecture $host_arch"
2207 esac # case "$host_arch" in
2209 if test "$_runtime_cpudetection" = yes ; then
2210 if x86 ; then
2211 _cmov=yes
2212 x86_32 && _cmov=no
2213 _mmx=yes
2214 _3dnow=yes
2215 _3dnowext=yes
2216 _mmxext=yes
2217 _sse=yes
2218 _sse2=yes
2219 _ssse3=yes
2220 _mtrr=yes
2222 if ppc; then
2223 _altivec=yes
2229 echocheck "assembler support of -pipe option"
2230 cat > $TMPC << EOF
2231 int main(void) { return 0; }
2233 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2236 echocheck "compiler support of named assembler arguments"
2237 _named_asm_args=yes
2238 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2239 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2240 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2241 _named_asm_args=no
2242 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2244 echores $_named_asm_args
2247 # Checking for CFLAGS
2248 _install_strip="-s"
2249 if test "$_profile" != "" || test "$_debug" != "" ; then
2250 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2251 _install_strip=
2252 elif test -z "$CFLAGS" ; then
2253 if test "$cc_vendor" = "intel" ; then
2254 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2255 elif test "$cc_vendor" != "gnu" ; then
2256 CFLAGS="-O2 $_march $_mcpu $_pipe"
2257 else
2258 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2260 else
2261 _warn_CFLAGS=yes
2263 if test -n "$LDFLAGS" ; then
2264 _ld_extra="$_ld_extra $LDFLAGS"
2265 _warn_CFLAGS=yes
2266 elif test "$cc_vendor" = "intel" ; then
2267 _ld_extra="$_ld_extra -i-static"
2269 if test -n "$CPPFLAGS" ; then
2270 _inc_extra="$_inc_extra $CPPFLAGS"
2271 _warn_CFLAGS=yes
2276 if x86_32 ; then
2277 # Checking assembler (_as) compatibility...
2278 # Added workaround for older as that reads from stdin by default - atmos
2279 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2280 echocheck "assembler ($_as $as_version)"
2282 _pref_as_version='2.9.1'
2283 echo 'nop' > $TMPS
2284 if test "$_mmx" = yes ; then
2285 echo 'emms' >> $TMPS
2287 if test "$_3dnow" = yes ; then
2288 _pref_as_version='2.10.1'
2289 echo 'femms' >> $TMPS
2291 if test "$_3dnowext" = yes ; then
2292 _pref_as_version='2.10.1'
2293 echo 'pswapd %mm0, %mm0' >> $TMPS
2295 if test "$_mmxext" = yes ; then
2296 _pref_as_version='2.10.1'
2297 echo 'movntq %mm0, (%eax)' >> $TMPS
2299 if test "$_sse" = yes ; then
2300 _pref_as_version='2.10.1'
2301 echo 'xorps %xmm0, %xmm0' >> $TMPS
2303 #if test "$_sse2" = yes ; then
2304 # _pref_as_version='2.11'
2305 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2307 if test "$_cmov" = yes ; then
2308 _pref_as_version='2.10.1'
2309 echo 'cmovb %eax, %ebx' >> $TMPS
2311 if test "$_ssse3" = yes ; then
2312 _pref_as_version='2.16.92'
2313 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2315 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2317 if test "$as_verc_fail" != yes ; then
2318 echores "ok"
2319 else
2320 _res_comment="Upgrade binutils to ${_pref_as_version} ..."
2321 echores "failed"
2322 die "obsolete binutils version"
2325 fi #if x86_32
2327 echocheck ".align is a power of two"
2328 if test "$_asmalign_pot" = auto ; then
2329 _asmalign_pot=no
2330 cat > $TMPC << EOF
2331 main() { asm (".align 3"); }
2333 cc_check && _asmalign_pot=yes
2335 if test "$_asmalign_pot" = "yes" ; then
2336 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2337 else
2338 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2340 echores $_asmalign_pot
2343 #FIXME: This should happen before the check for CFLAGS..
2344 if ppc ; then
2346 # check if altivec is supported by the compiler, and how to enable it
2348 _altivec_gcc_flags=''
2350 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2351 echocheck "GCC altivec support"
2353 p=''
2354 cat > $TMPC << EOF
2355 int main() {
2356 return 0;
2359 FSF_flags='-maltivec -mabi=altivec'
2360 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2362 # check for Darwin-style flags first, since
2363 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2364 # accepts but ignores FSF-style flags...
2366 if test -z "$p"; then
2367 cc_check $Darwin_flags && p='Darwin'
2369 if test -z "$p"; then
2370 cc_check $FSF_flags && p='FSF'
2373 case $p in
2374 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2375 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2376 *) _altivec=no ;;
2377 esac
2379 if test -z "$p"; then
2380 p=none
2381 else
2382 p="$p-style ($_altivec_gcc_flags)"
2385 echores "$p"
2388 # check if <altivec.h> should be included
2390 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2392 if test "$_altivec" = yes ; then
2393 echocheck "altivec.h"
2394 cat > $TMPC << EOF
2395 #include <altivec.h>
2396 int main(void) { return 0; }
2398 _have_altivec_h=no
2399 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2400 if test "$_have_altivec_h" = yes ; then
2401 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2403 echores "$_have_altivec_h"
2406 # disable runtime cpudetection if
2407 # - we cannot generate altivec code
2408 # - altivec is disabled by the user
2410 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2411 _runtime_cpudetection=no
2414 # show that we are optimizing for altivec (if enabled and supported)
2416 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2417 _optimizing="$_optimizing altivec"
2420 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2422 if test "$_altivec" = yes ; then
2423 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2424 #_mcpu="$_mcpu $_altivec_gcc_flags"
2425 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2428 # setup _def_altivec correctly
2430 if test "$_altivec" = yes ; then
2431 _def_altivec='#define HAVE_ALTIVEC 1'
2432 else
2433 _def_altivec='#undef HAVE_ALTIVEC'
2437 if arm ; then
2438 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2439 if test $_armv5te = "auto" ; then
2440 cat > $TMPC << EOF
2441 int main(void) {
2442 __asm__ __volatile__ ("qadd r0, r0, r0");
2445 _armv5te=no
2446 cc_check && _armv5te=yes
2448 echores "$_armv5te"
2450 echocheck "ARMv6 (SIMD instructions)"
2451 if test $_armv6 = "auto" ; then
2452 cat > $TMPC << EOF
2453 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2455 _armv6=no
2456 cc_check && _armv6=yes
2458 echores "$_armv6"
2460 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2461 if test $_iwmmxt = "auto" ; then
2462 cat > $TMPC << EOF
2463 int main(void) {
2464 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2467 _iwmmxt=no
2468 cc_check && _iwmmxt=yes
2470 echores "$_iwmmxt"
2473 _def_mmx='#undef HAVE_MMX'
2474 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2475 _def_mmxext='#undef HAVE_MMX2'
2476 test "$_mmxext" = yes && _def_mmxext='#define HAVE_MMX2 1'
2477 _def_3dnow='#undef HAVE_3DNOW'
2478 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2479 _def_3dnowext='#undef HAVE_3DNOWEX'
2480 test "$_3dnowext" = yes && _def_3dnowext='#define HAVE_3DNOWEX 1'
2481 _def_sse='#undef HAVE_SSE'
2482 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2483 _def_sse2='#undef HAVE_SSE2'
2484 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2485 _def_ssse3='#undef HAVE_SSSE3'
2486 test "$_ssse3" = yes && _def_ssse3='#define HAVE_SSSE3 1'
2487 _def_cmov='#undef HAVE_CMOV'
2488 test "$_cmov" = yes && _def_cmov='#define HAVE_CMOV 1'
2489 _def_fast_cmov='#undef HAVE_FAST_CMOV'
2490 test "$_fast_cmov" = yes && _def_fast_cmov='#define HAVE_FAST_CMOV 1'
2491 _def_armv5te='#undef HAVE_ARMV5TE'
2492 test "$_armv5te" = yes && _def_armv5te='#define HAVE_ARMV5TE 1'
2493 _def_armv6='#undef HAVE_ARMV6'
2494 test "$_armv6" = yes && _def_armv6='#define HAVE_ARMV6 1'
2495 _def_iwmmxt='#undef HAVE_IWMMXT'
2496 test "$_iwmmxt" = yes && _def_iwmmxt='#define HAVE_IWMMXT 1'
2498 # Checking kernel version...
2499 if x86_32 && linux ; then
2500 _k_verc_problem=no
2501 kernel_version=`uname -r 2>&1`
2502 echocheck "$system_name kernel version"
2503 case "$kernel_version" in
2504 '') kernel_version="?.??"; _k_verc_fail=yes;;
2505 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2506 _k_verc_problem=yes;;
2507 esac
2508 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2509 _k_verc_fail=yes
2511 if test "$_k_verc_fail" ; then
2512 echores "$kernel_version, fail"
2513 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2514 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2515 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2516 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2517 echo "2.2.x you must upgrade it to get SSE support!"
2518 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2519 else
2520 echores "$kernel_version, ok"
2524 ######################
2525 # MAIN TESTS GO HERE #
2526 ######################
2529 echocheck "extra headers"
2530 if test "$_inc_extra" ; then
2531 echores "$_inc_extra"
2532 else
2533 echores "none"
2537 echocheck "extra libs"
2538 if test "$_ld_extra" ; then
2539 echores "$_ld_extra"
2540 else
2541 echores "none"
2544 echocheck "-lposix"
2545 cat > $TMPC <<EOF
2546 int main(void) { return 0; }
2548 if cc_check -lposix ; then
2549 _ld_extra="$_ld_extra -lposix"
2550 echores "yes"
2551 else
2552 echores "no"
2555 echocheck "-lm"
2556 cat > $TMPC <<EOF
2557 int main(void) { return 0; }
2559 if cc_check -lm ; then
2560 _ld_lm="-lm"
2561 echores "yes"
2562 else
2563 _ld_lm=""
2564 echores "no"
2568 echocheck "langinfo"
2569 if test "$_langinfo" = auto ; then
2570 cat > $TMPC <<EOF
2571 #include <langinfo.h>
2572 int main(void) { nl_langinfo(CODESET); return 0; }
2574 _langinfo=no
2575 cc_check && _langinfo=yes
2577 if test "$_langinfo" = yes ; then
2578 _def_langinfo='#define USE_LANGINFO 1'
2579 else
2580 _def_langinfo='#undef USE_LANGINFO'
2582 echores "$_langinfo"
2585 echocheck "language"
2586 test -z "$_language" && _language=$LINGUAS
2587 _language=`echo $_language | sed 's/,/ /g'`
2588 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2589 for lang in $_language ; do
2590 test "$lang" = all && lang=en
2591 if test -f "help/help_mp-${lang}.h" ; then
2592 _language=$lang
2593 break
2594 else
2595 echo ${_echo_n} "$lang not found, ${_echo_c}"
2596 _language=`echo $_language | sed "s/$lang *//"`
2598 done
2599 test -z "$_language" && _language=en
2600 _mp_help="help/help_mp-${_language}.h"
2601 test -f $_mp_help || die "$_mp_help not found"
2602 for lang in $LANGUAGES ; do
2603 if test -f "DOCS/man/$lang/mplayer.1" ; then
2604 MAN_LANG="$lang $MAN_LANG"
2606 done
2607 _doc_lang=$_language
2608 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2609 echores "using $_language (man pages: $MAN_LANG)"
2612 echocheck "enable sighandler"
2613 if test "$_sighandler" = yes ; then
2614 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2615 else
2616 _def_sighandler='#undef ENABLE_SIGHANDLER'
2618 echores "$_sighandler"
2620 echocheck "runtime cpudetection"
2621 if test "$_runtime_cpudetection" = yes ; then
2622 _optimizing="Runtime CPU-Detection enabled"
2623 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2624 else
2625 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2627 echores "$_runtime_cpudetection"
2630 echocheck "restrict keyword"
2631 for restrict_keyword in restrict __restrict __restrict__ ; do
2632 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2633 if cc_check; then
2634 _def_restrict_keyword=$restrict_keyword
2635 break;
2637 done
2638 if [ -n "$_def_restrict_keyword" ]; then
2639 echores "$_def_restrict_keyword"
2640 else
2641 echores "none"
2643 # Avoid infinite recursion loop ("#define restrict restrict")
2644 if [ "$_def_restrict_keyword" != "restrict" ]; then
2645 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2646 else
2647 _def_restrict_keyword=""
2651 echocheck "__builtin_expect"
2652 # GCC branch prediction hint
2653 cat > $TMPC << EOF
2654 int foo (int a) {
2655 a = __builtin_expect (a, 10);
2656 return a == 10 ? 0 : 1;
2658 int main() { return foo(10) && foo(0); }
2660 _builtin_expect=no
2661 cc_check && _builtin_expect=yes
2662 if test "$_builtin_expect" = yes ; then
2663 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2664 else
2665 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2667 echores "$_builtin_expect"
2670 echocheck "kstat"
2671 cat > $TMPC << EOF
2672 #include <kstat.h>
2673 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2675 _kstat=no
2676 cc_check -lkstat && _kstat=yes
2677 if test "$_kstat" = yes ; then
2678 _def_kstat="#define HAVE_LIBKSTAT 1"
2679 _ld_extra="$_ld_extra -lkstat"
2680 else
2681 _def_kstat="#undef HAVE_LIBKSTAT"
2683 echores "$_kstat"
2686 echocheck "posix4"
2687 # required for nanosleep on some systems
2688 cat > $TMPC << EOF
2689 #include <time.h>
2690 int main(void) { (void) nanosleep(0, 0); return 0; }
2692 _posix4=no
2693 cc_check -lposix4 && _posix4=yes
2694 if test "$_posix4" = yes ; then
2695 _ld_extra="$_ld_extra -lposix4"
2697 echores "$_posix4"
2699 echocheck "lrintf"
2700 cat > $TMPC << EOF
2701 #include <math.h>
2702 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2704 _lrintf=no
2705 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2706 if test "$_lrintf" = yes ; then
2707 _def_lrintf="#define HAVE_LRINTF 1"
2708 else
2709 _def_lrintf="#undef HAVE_LRINTF"
2711 echores "$_lrintf"
2713 echocheck "round"
2714 cat > $TMPC << EOF
2715 #include <math.h>
2716 int main(void) { (void) round(0.0); return 0; }
2718 _round=no
2719 cc_check $_ld_lm && _round=yes
2720 if test "$_round" = yes ; then
2721 _def_round="#define HAVE_ROUND 1"
2722 else
2723 _def_round="#undef HAVE_ROUND"
2725 echores "$_round"
2727 echocheck "nanosleep"
2728 # also check for nanosleep
2729 cat > $TMPC << EOF
2730 #include <time.h>
2731 int main(void) { (void) nanosleep(0, 0); return 0; }
2733 _nanosleep=no
2734 cc_check && _nanosleep=yes
2735 if test "$_nanosleep" = yes ; then
2736 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2737 else
2738 _def_nanosleep='#undef HAVE_NANOSLEEP'
2740 echores "$_nanosleep"
2743 echocheck "socklib"
2744 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2745 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2746 cat > $TMPC << EOF
2747 #include <netdb.h>
2748 #include <sys/socket.h>
2749 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2751 _socklib=no
2752 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2753 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2754 done
2755 if test $_winsock2 = auto && not cygwin ; then
2756 _winsock2=no
2757 cat > $TMPC << EOF
2758 #include <winsock2.h>
2759 int main(void) { (void) gethostbyname(0); return 0; }
2761 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2763 test "$_ld_sock" && _res_comment="using $_ld_sock"
2764 echores "$_socklib"
2767 if test $_winsock2 = yes ; then
2768 _ld_sock="-lws2_32"
2769 _def_winsock2='#define HAVE_WINSOCK2 1'
2770 else
2771 _def_winsock2='#undef HAVE_WINSOCK2'
2775 _use_aton=no
2776 echocheck "inet_pton()"
2777 cat > $TMPC << EOF
2778 #include <sys/types.h>
2779 #include <sys/socket.h>
2780 #include <arpa/inet.h>
2781 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2783 if test "$_winsock2" = yes ; then
2784 _res_comment="using winsock2 functions instead"
2785 echores "no"
2786 elif cc_check $_ld_sock ; then
2787 # NOTE: Linux has libresolv but does not need it
2789 _res_comment="using $_ld_sock"
2790 echores "yes"
2791 elif cc_check $_ld_sock -lresolv ; then
2792 # NOTE: needed for SunOS at least
2793 _ld_sock="$_ld_sock -lresolv"
2794 _res_comment="using $_ld_sock"
2795 echores "yes"
2796 else
2797 _res_comment="trying inet_aton next"
2798 echores "no"
2800 echocheck "inet_aton()"
2801 cat > $TMPC << EOF
2802 #include <sys/types.h>
2803 #include <sys/socket.h>
2804 #include <arpa/inet.h>
2805 int main(void) { (void) inet_aton(0, 0); return 0; }
2807 _use_aton=yes
2808 if cc_check $_ld_sock ; then
2809 # NOTE: Linux has libresolv but does not need it
2811 _res_comment="using $_ld_sock"
2812 elif cc_check $_ld_sock -lresolv ; then
2813 # NOTE: needed for SunOS at least
2814 _ld_sock="$_ld_sock -lresolv"
2815 _res_comment="using $_ld_sock"
2816 else
2817 _use_aton=no
2818 _network=no
2819 _res_comment="network support disabled"
2821 echores "$_use_aton"
2824 _def_use_aton='#undef USE_ATON'
2825 if test "$_use_aton" = yes; then
2826 _def_use_aton='#define USE_ATON 1'
2829 echocheck "network"
2830 # FIXME network check
2831 if test "$_network" = yes ; then
2832 _def_network='#define MPLAYER_NETWORK 1'
2833 _ld_extra="$_ld_extra $_ld_sock"
2834 _inputmodules="network $_inputmodules"
2835 else
2836 _noinputmodules="network $_noinputmodules"
2837 _def_network='#undef MPLAYER_NETWORK'
2838 _ftp=no
2840 echores "$_network"
2842 echocheck "inttypes.h (required)"
2843 cat > $TMPC << EOF
2844 #include <inttypes.h>
2845 int main(void) { return 0; }
2847 _inttypes=no
2848 cc_check && _inttypes=yes
2849 echores "$_inttypes"
2851 if test "$_inttypes" = no ; then
2852 echocheck "bitypes.h (inttypes.h predecessor)"
2853 cat > $TMPC << EOF
2854 #include <sys/bitypes.h>
2855 int main(void) { return 0; }
2857 cc_check && _inttypes=yes
2858 if test "$_inttypes" = yes ; then
2859 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."
2860 else
2861 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2866 echocheck "int_fastXY_t in inttypes.h"
2867 cat > $TMPC << EOF
2868 #include <inttypes.h>
2869 int main(void) {
2870 volatile int_fast16_t v= 0;
2871 return v; }
2873 _fast_inttypes=no
2874 cc_check && _fast_inttypes=yes
2875 if test "$_fast_inttypes" = yes ; then
2876 # nothing to do
2878 else
2879 _def_fast_inttypes='
2880 typedef signed char int_fast8_t;
2881 typedef signed int int_fast16_t;
2882 typedef signed int int_fast32_t;
2883 typedef signed long long int_fast64_t;
2884 typedef unsigned char uint_fast8_t;
2885 typedef unsigned int uint_fast16_t;
2886 typedef unsigned int uint_fast32_t;
2887 typedef unsigned long long uint_fast64_t;'
2889 echores "$_fast_inttypes"
2892 echocheck "word size"
2893 _mp_wordsize="#undef MP_WORDSIZE"
2894 cat > $TMPC << EOF
2895 #include <stdio.h>
2896 #include <sys/types.h>
2897 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2899 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2900 echores "$_wordsize"
2903 echocheck "stddef.h"
2904 cat > $TMPC << EOF
2905 #include <stddef.h>
2906 int main(void) { return 0; }
2908 _stddef=no
2909 cc_check && _stddef=yes
2910 if test "$_stddef" = yes ; then
2911 _def_stddef='#define HAVE_STDDEF_H 1'
2912 else
2913 _def_stddef='#undef HAVE_STDDEF_H'
2915 echores "$_stddef"
2918 echocheck "malloc.h"
2919 cat > $TMPC << EOF
2920 #include <malloc.h>
2921 int main(void) { (void) malloc(0); return 0; }
2923 _malloc=no
2924 cc_check && _malloc=yes
2925 if test "$_malloc" = yes ; then
2926 _def_malloc='#define HAVE_MALLOC_H 1'
2927 else
2928 _def_malloc='#undef HAVE_MALLOC_H'
2930 # malloc.h emits a warning in FreeBSD and OpenBSD
2931 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2932 echores "$_malloc"
2935 echocheck "memalign()"
2936 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2937 cat > $TMPC << EOF
2938 #include <malloc.h>
2939 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2941 _memalign=no
2942 cc_check && _memalign=yes
2943 if test "$_memalign" = yes ; then
2944 _def_memalign='#define HAVE_MEMALIGN 1'
2945 else
2946 _def_memalign='#undef HAVE_MEMALIGN'
2947 _def_map_memalign='#define memalign(a,b) malloc(b)'
2948 not darwin && _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2950 echores "$_memalign"
2953 echocheck "alloca.h"
2954 cat > $TMPC << EOF
2955 #include <alloca.h>
2956 int main(void) { (void) alloca(0); return 0; }
2958 _alloca=no
2959 cc_check && _alloca=yes
2960 if cc_check ; then
2961 _def_alloca='#define HAVE_ALLOCA_H 1'
2962 else
2963 _def_alloca='#undef HAVE_ALLOCA_H'
2965 echores "$_alloca"
2968 echocheck "mman.h"
2969 cat > $TMPC << EOF
2970 #include <sys/types.h>
2971 #include <sys/mman.h>
2972 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2974 _mman=no
2975 cc_check && _mman=yes
2976 if test "$_mman" = yes ; then
2977 _def_mman='#define HAVE_SYS_MMAN_H 1'
2978 else
2979 _def_mman='#undef HAVE_SYS_MMAN_H'
2981 echores "$_mman"
2983 cat > $TMPC << EOF
2984 #include <sys/types.h>
2985 #include <sys/mman.h>
2986 int main(void) { void *p = MAP_FAILED; return 0; }
2988 _mman_has_map_failed=no
2989 cc_check && _mman_has_map_failed=yes
2990 if test "$_mman_has_map_failed" = yes ; then
2991 _def_mman_has_map_failed=''
2992 else
2993 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2996 echocheck "dynamic loader"
2997 cat > $TMPC << EOF
2998 #include <dlfcn.h>
2999 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3001 _dl=no
3002 for _ld_tmp in "" "-ldl" ; do
3003 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3004 done
3005 if test "$_dl" = yes ; then
3006 _def_dl='#define HAVE_LIBDL 1'
3007 else
3008 _def_dl='#undef HAVE_LIBDL'
3010 echores "$_dl"
3013 echocheck "dynamic a/v plugins support"
3014 if test "$_dl" = no ; then
3015 _dynamic_plugins=no
3017 if test "$_dynamic_plugins" = yes ; then
3018 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3019 else
3020 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3022 echores "$_dynamic_plugins"
3025 #echocheck "dynamic linking"
3026 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
3027 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
3028 #cat > $TMPC << EOF
3029 #int main(void) { return 0; }
3030 #EOF
3031 #if cc_check -rdynamic ; then
3032 # _ld_dl_dynamic='-rdynamic'
3033 #elif cc_check -Bdynamic ; then
3034 # _ld_dl_dynamic='-Bdynamic'
3035 #elif cc_check ; then
3036 # _ld_dl_dynamic=''
3038 #echores "using $_ld_dl_dynamic"
3040 _def_threads='#undef HAVE_THREADS'
3042 echocheck "pthread"
3043 if test "$_pthreads" = auto ; then
3044 cat > $TMPC << EOF
3045 #include <pthread.h>
3046 void* func(void *arg) { return arg; }
3047 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3049 _pthreads=no
3050 if not hpux ; then
3051 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3052 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3053 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3054 done
3057 if test "$_pthreads" = yes ; then
3058 _res_comment="using $_ld_pthread"
3059 _def_pthreads='#define HAVE_PTHREADS 1'
3060 _def_threads='#define HAVE_THREADS 1'
3061 else
3062 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3063 _def_pthreads='#undef HAVE_PTHREADS'
3064 _nas=no ; _tv_v4l1=no ; _macosx=no
3065 if not mingw32 ; then
3066 _win32dll=no
3069 echores "$_pthreads"
3071 echocheck "rpath"
3072 netbsd &&_rpath=yes
3073 if test "$_rpath" = yes ; then
3074 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3075 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3076 done
3077 _ld_extra=$tmp
3079 echores "$_rpath"
3081 echocheck "iconv"
3082 if test "$_iconv" = auto ; then
3083 _iconv_tmp='#include <iconv.h>'
3085 cat > $TMPC << EOF
3086 #include <stdio.h>
3087 #include <unistd.h>
3088 $_iconv_tmp
3089 #define INBUFSIZE 1024
3090 #define OUTBUFSIZE 4096
3092 char inbuffer[INBUFSIZE];
3093 char outbuffer[OUTBUFSIZE];
3095 int main(void) {
3096 size_t numread;
3097 iconv_t icdsc;
3098 char *tocode="UTF-8";
3099 char *fromcode="cp1250";
3100 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3101 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3102 char *iptr=inbuffer;
3103 char *optr=outbuffer;
3104 size_t inleft=numread;
3105 size_t outleft=OUTBUFSIZE;
3106 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3107 != (size_t)(-1)) {
3108 write (1, outbuffer, OUTBUFSIZE - outleft);
3111 if (iconv_close(icdsc) == -1)
3116 _iconv=no
3117 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3118 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3119 _iconv=yes && break
3120 done
3122 if test "$_iconv" = yes ; then
3123 _def_iconv='#define USE_ICONV 1'
3124 else
3125 _def_iconv='#undef USE_ICONV'
3127 echores "$_iconv"
3130 echocheck "sys/soundcard.h"
3131 cat > $TMPC << EOF
3132 #include <sys/soundcard.h>
3133 int main(void) { return 0; }
3135 _sys_soundcard=no
3136 cc_check && _sys_soundcard=yes
3137 if test "$_sys_soundcard" = yes ; then
3138 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3139 _include_soundcard='#include <sys/soundcard.h>'
3140 else
3141 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3143 echores "$_sys_soundcard"
3145 if test "$_sys_soundcard" != yes ; then
3146 echocheck "soundcard.h"
3147 cat > $TMPC << EOF
3148 #include <soundcard.h>
3149 int main(void) { return 0; }
3151 _soundcard=no
3152 cc_check && _soundcard=yes
3153 if linux || test "$_ossaudio" != no ; then
3154 # use soundcard.h on Linux, or when OSS support is enabled
3155 echores "$_soundcard"
3156 else
3157 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
3158 _res_comment= "but ignored!"
3159 echores "$_soundcard"
3160 _soundcard=no
3162 if test "$_soundcard" = yes ; then
3163 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3164 _include_soundcard='#include <soundcard.h>'
3165 else
3166 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3168 else
3169 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3173 echocheck "sys/dvdio.h"
3174 cat > $TMPC << EOF
3175 #include <unistd.h>
3176 #include <sys/dvdio.h>
3177 int main(void) { return 0; }
3179 _dvdio=no
3180 cc_check && _dvdio=yes
3181 if test "$_dvdio" = yes ; then
3182 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3183 else
3184 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3186 echores "$_dvdio"
3189 echocheck "sys/cdio.h"
3190 cat > $TMPC << EOF
3191 #include <unistd.h>
3192 #include <sys/cdio.h>
3193 int main(void) { return 0; }
3195 _cdio=no
3196 cc_check && _cdio=yes
3197 if test "$_cdio" = yes ; then
3198 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3199 else
3200 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3202 echores "$_cdio"
3205 echocheck "linux/cdrom.h"
3206 cat > $TMPC << EOF
3207 #include <sys/types.h>
3208 #include <linux/cdrom.h>
3209 int main(void) { return 0; }
3211 _cdrom=no
3212 cc_check && _cdrom=yes
3213 if test "$_cdrom" = yes ; then
3214 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3215 else
3216 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3218 echores "$_cdrom"
3221 echocheck "dvd.h"
3222 cat > $TMPC << EOF
3223 #include <dvd.h>
3224 int main(void) { return 0; }
3226 _dvd=no
3227 cc_check && _dvd=yes
3228 if test "$_dvd" = yes ; then
3229 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3230 else
3231 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3233 echores "$_dvd"
3236 if bsdos; then
3237 echocheck "BSDI dvd.h"
3238 cat > $TMPC << EOF
3239 #include <dvd.h>
3240 int main(void) { return 0; }
3242 _bsdi_dvd=no
3243 cc_check && _bsdi_dvd=yes
3244 if test "$_bsdi_dvd" = yes ; then
3245 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3246 else
3247 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3249 echores "$_bsdi_dvd"
3250 fi #if bsdos
3253 if hpux; then
3254 # also used by AIX, but AIX does not support VCD and/or libdvdread
3255 echocheck "HP-UX SCSI header"
3256 cat > $TMPC << EOF
3257 #include <sys/scsi.h>
3258 int main(void) { return 0; }
3260 _hpux_scsi_h=no
3261 cc_check && _hpux_scsi_h=yes
3262 if test "$_hpux_scsi_h" = yes ; then
3263 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3264 else
3265 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3267 echores "$_hpux_scsi_h"
3268 fi #if hpux
3271 if sunos; then
3272 echocheck "userspace SCSI headers (Solaris)"
3273 cat > $TMPC << EOF
3274 # include <unistd.h>
3275 # include <stropts.h>
3276 # include <sys/scsi/scsi_types.h>
3277 # include <sys/scsi/impl/uscsi.h>
3278 int main(void) { return 0; }
3280 _sol_scsi_h=no
3281 cc_check && _sol_scsi_h=yes
3282 if test "$_sol_scsi_h" = yes ; then
3283 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3284 else
3285 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3287 echores "$_sol_scsi_h"
3288 fi #if sunos
3291 echocheck "termcap"
3292 if test "$_termcap" = auto ; then
3293 cat > $TMPC <<EOF
3294 int main(void) { tgetent(); return 0; }
3296 _termcap=no
3297 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3298 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3299 && _termcap=yes && break
3300 done
3302 if test "$_termcap" = yes ; then
3303 _def_termcap='#define USE_TERMCAP 1'
3304 _res_comment="using $_ld_tmp"
3305 else
3306 _def_termcap='#undef USE_TERMCAP'
3308 echores "$_termcap"
3311 echocheck "termios"
3312 if test "$_termios" = auto ; then
3313 cat > $TMPC <<EOF
3314 #include <sys/termios.h>
3315 int main(void) { return 0; }
3317 _termios=auto
3318 cc_check && _termios=yes
3319 _def_termios_h_name='sys/termios.h'
3321 # second test:
3322 if test "$_termios" = auto ; then
3323 cat > $TMPC <<EOF
3324 #include <termios.h>
3325 int main(void) { return 0; }
3327 _termios=no
3328 cc_check && _termios=yes
3329 _def_termios_h_name='termios.h'
3332 if test "$_termios" = yes ; then
3333 _def_termios='#define HAVE_TERMIOS 1'
3334 _def_termios_h='#undef HAVE_TERMIOS_H'
3335 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3337 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3338 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3339 elif test "$_def_termios_h_name" = 'termios.h' ; then
3340 _def_termios_h='#define HAVE_TERMIOS_H 1'
3342 _res_comment="using $_def_termios_h_name"
3343 else
3344 _def_termios='#undef HAVE_TERMIOS'
3345 _def_termios_h_name=''
3346 _termios=no
3348 echores "$_termios"
3351 echocheck "shm"
3352 if test "$_shm" = auto ; then
3353 cat > $TMPC << EOF
3354 #include <sys/types.h>
3355 #include <sys/shm.h>
3356 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3358 _shm=no
3359 cc_check && _shm=yes
3361 if test "$_shm" = yes ; then
3362 _def_shm='#define HAVE_SHM 1'
3363 else
3364 _def_shm='#undef HAVE_SHM'
3366 echores "$_shm"
3369 # XXX: FIXME, add runtime checking
3370 echocheck "linux devfs"
3371 echores "$_linux_devfs"
3374 echocheck "scandir()"
3375 cat > $TMPC << EOF
3376 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3378 _scandir=no
3379 cc_check && _scandir=yes
3380 if test "$_scandir" = yes ; then
3381 _def_scandir='#define HAVE_SCANDIR 1'
3382 _need_scandir=no
3383 else
3384 _def_scandir='#undef HAVE_SCANDIR'
3385 _need_scandir=yes
3387 echores "$_scandir"
3390 echocheck "strsep()"
3391 cat > $TMPC << EOF
3392 #include <string.h>
3393 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3395 _strsep=no
3396 cc_check && _strsep=yes
3397 if test "$_strsep" = yes ; then
3398 _def_strsep='#define HAVE_STRSEP 1'
3399 _need_strsep=no
3400 else
3401 _def_strsep='#undef HAVE_STRSEP'
3402 _need_strsep=yes
3404 echores "$_strsep"
3406 echocheck "strlcpy()"
3407 cat > $TMPC << EOF
3408 #include <string.h>
3409 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3411 _strlcpy=no
3412 cc_check && _strlcpy=yes
3413 if test "$_strlcpy" = yes ; then
3414 _def_strlcpy='#define HAVE_STRLCPY 1'
3415 _need_strlcpy=no
3416 else
3417 _def_strlcpy='#undef HAVE_STRLCPY'
3418 _need_strlcpy=yes
3420 echores "$_strlcpy"
3422 echocheck "strlcat()"
3423 cat > $TMPC << EOF
3424 #include <string.h>
3425 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3427 _strlcat=no
3428 cc_check && _strlcat=yes
3429 if test "$_strlcat" = yes ; then
3430 _def_strlcat='#define HAVE_STRLCAT 1'
3431 _need_strlcat=no
3432 else
3433 _def_strlcat='#undef HAVE_STRLCAT'
3434 _need_strlcat=yes
3436 echores "$_strlcat"
3438 echocheck "fseeko()"
3439 cat > $TMPC << EOF
3440 #include <stdio.h>
3441 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3443 _fseeko=no
3444 cc_check && _fseeko=yes
3445 if test "$_fseeko" = yes ; then
3446 _def_fseeko='#define HAVE_FSEEKO 1'
3447 _need_fseeko=no
3448 else
3449 _def_fseeko='#undef HAVE_FSEEKO'
3450 _need_fseeko=yes
3452 echores "$_fseeko"
3454 echocheck "localtime_r()"
3455 cat > $TMPC << EOF
3456 #include <time.h>
3457 int main( void ) { localtime_r(NULL, NULL); }
3459 _localtime_r=no
3460 cc_check && _localtime_r=yes
3461 if test "$_localtime_r" = yes ; then
3462 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3463 else
3464 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3466 echores "$_localtime_r"
3468 echocheck "vsscanf()"
3469 cat > $TMPC << EOF
3470 #include <stdarg.h>
3471 int main(void) { vsscanf(0, 0, 0); return 0; }
3473 _vsscanf=no
3474 cc_check && _vsscanf=yes
3475 if test "$_vsscanf" = yes ; then
3476 _def_vsscanf='#define HAVE_VSSCANF 1'
3477 _need_vsscanf=no
3478 else
3479 _def_vsscanf='#undef HAVE_VSSCANF'
3480 _need_vsscanf=yes
3482 echores "$_vsscanf"
3485 echocheck "swab()"
3486 cat > $TMPC << EOF
3487 #include <unistd.h>
3488 int main(void) { swab(0, 0, 0); return 0; }
3490 _swab=no
3491 cc_check && _swab=yes
3492 if test "$_swab" = yes ; then
3493 _def_swab='#define HAVE_SWAB 1'
3494 _need_swab=no
3495 else
3496 _def_swab='#undef HAVE_SWAB'
3497 _need_swab=yes
3499 echores "$_swab"
3501 echocheck "POSIX select()"
3502 cat > $TMPC << EOF
3503 #include <stdio.h>
3504 #include <stdlib.h>
3505 #include <sys/types.h>
3506 #include <string.h>
3507 #include <sys/time.h>
3508 #include <unistd.h>
3509 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3511 _posix_select=no
3512 _def_posix_select='#undef HAVE_POSIX_SELECT'
3513 cc_check && _posix_select=yes \
3514 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3515 echores "$_posix_select"
3518 echocheck "gettimeofday()"
3519 cat > $TMPC << EOF
3520 #include <stdio.h>
3521 #include <sys/time.h>
3522 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3524 _gettimeofday=no
3525 cc_check && _gettimeofday=yes
3526 if test "$_gettimeofday" = yes ; then
3527 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3528 _need_gettimeofday=no
3529 else
3530 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3531 _need_gettimeofday=yes
3533 echores "$_gettimeofday"
3536 echocheck "glob()"
3537 cat > $TMPC << EOF
3538 #include <stdio.h>
3539 #include <glob.h>
3540 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3542 _glob=no
3543 cc_check && _glob=yes
3544 if test "$_glob" = yes ; then
3545 _def_glob='#define HAVE_GLOB 1'
3546 _need_glob=no
3547 else
3548 _def_glob='#undef HAVE_GLOB'
3549 _need_glob=yes
3551 echores "$_glob"
3554 echocheck "setenv()"
3555 cat > $TMPC << EOF
3556 #include <stdlib.h>
3557 int main (void){ setenv("","",0); return 0; }
3559 _setenv=no
3560 cc_check && _setenv=yes
3561 if test "$_setenv" = yes ; then
3562 _def_setenv='#define HAVE_SETENV 1'
3563 _need_setenv=no
3564 else
3565 _def_setenv='#undef HAVE_SETENV'
3566 _need_setenv=yes
3568 echores "$_setenv"
3571 if sunos; then
3572 echocheck "sysi86()"
3573 cat > $TMPC << EOF
3574 #include <sys/sysi86.h>
3575 int main (void) { sysi86(0); return 0; }
3577 _sysi86=no
3578 cc_check && _sysi86=yes
3579 if test "$_sysi86" = yes ; then
3580 _def_sysi86='#define HAVE_SYSI86 1'
3581 cat > $TMPC << EOF
3582 #include <sys/sysi86.h>
3583 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3585 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3586 else
3587 _def_sysi86='#undef HAVE_SYSI86'
3589 echores "$_sysi86"
3590 fi #if sunos
3593 echocheck "sys/sysinfo.h"
3594 cat > $TMPC << EOF
3595 #include <sys/sysinfo.h>
3596 int main(void) {
3597 struct sysinfo s_info;
3598 sysinfo(&s_info);
3599 return 0;
3602 _sys_sysinfo=no
3603 cc_check && _sys_sysinfo=yes
3604 if test "$_sys_sysinfo" = yes ; then
3605 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3606 else
3607 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3609 echores "$_sys_sysinfo"
3612 if darwin; then
3614 echocheck "Mac OS X APIs"
3615 if test "$_macosx" = auto ; then
3616 productName=`/usr/bin/sw_vers -productName`
3617 if test "$productName" = "Mac OS X" ||
3618 test "$productName" = "Mac OS X Server" ; then
3619 _macosx=yes
3620 else
3621 _macosx=no
3622 _def_macosx='#undef MACOSX'
3623 _noaomodules="macosx $_noaomodules"
3624 _novomodules="quartz $_novomodules"
3627 if test "$_macosx" = yes ; then
3628 cat > $TMPC <<EOF
3629 #include <Carbon/Carbon.h>
3630 #include <QuickTime/QuickTime.h>
3631 #include <CoreAudio/CoreAudio.h>
3632 int main(void) {
3633 EnterMovies();
3634 ExitMovies();
3635 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3638 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3639 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3640 _def_macosx='#define MACOSX 1'
3641 _aosrc="$_aosrc ao_macosx.c"
3642 _aomodules="macosx $_aomodules"
3643 _vosrc="$_vosrc vo_quartz.c"
3644 _vomodules="quartz $_vomodules"
3645 else
3646 _macosx=no
3647 _def_macosx='#undef MACOSX'
3648 _noaomodules="macosx $_noaomodules"
3649 _novomodules="quartz $_novomodules"
3651 cat > $TMPC <<EOF
3652 #include <Carbon/Carbon.h>
3653 #include <QuartzCore/CoreVideo.h>
3654 int main(void) {}
3656 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3657 _vosrc="$_vosrc vo_macosx.m"
3658 _vomodules="macosx $_vomodules"
3659 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3660 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3661 _macosx_corevideo=yes
3662 else
3663 _novomodules="macosx $_novomodules"
3664 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3665 _macosx_corevideo=no
3668 echores "$_macosx"
3670 echocheck "Mac OS X Finder Support"
3671 if test "$_macosx_finder_support" = auto ; then
3672 _macosx_finder_support=$_macosx
3674 if test "$_macosx_finder_support" = yes; then
3675 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3676 _macosx_finder_support=yes
3677 else
3678 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3679 _macosx_finder_support=no
3681 echores "$_macosx_finder_support"
3683 echocheck "Mac OS X Bundle file locations"
3684 if test "$_macosx_bundle" = auto ; then
3685 _macosx_bundle=$_macosx_finder_support
3687 if test "$_macosx_bundle" = yes; then
3688 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3689 else
3690 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3691 _macosx_bundle=no
3693 echores "$_macosx_bundle"
3695 fi #if darwin
3698 echocheck "pkg-config"
3699 _pkg_config=pkg-config
3700 if `$_pkg_config --version > /dev/null 2>&1`; then
3701 echores "yes"
3702 else
3703 _pkg_config=false
3704 echores "no"
3708 echocheck "Samba support (libsmbclient)"
3709 if test "$_smbsupport" = yes; then
3710 _ld_extra="$_ld_extra -lsmbclient"
3712 if test "$_smbsupport" = auto; then
3713 _smbsupport=no
3714 cat > $TMPC << EOF
3715 #include <libsmbclient.h>
3716 int main(void) { smbc_opendir("smb://"); return 0; }
3718 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3719 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3720 _smbsupport=yes && break
3721 done
3724 if test "$_smbsupport" = yes; then
3725 _def_smbsupport="#define LIBSMBCLIENT"
3726 _inputmodules="smb $_inputmodules"
3727 else
3728 _def_smbsupport="#undef LIBSMBCLIENT"
3729 _noinputmodules="smb $_noinputmodules"
3731 echores "$_smbsupport"
3734 #########
3735 # VIDEO #
3736 #########
3739 echocheck "3dfx"
3740 if test "$_3dfx" = yes ; then
3741 _def_3dfx='#define HAVE_3DFX 1'
3742 _vosrc="$_vosrc vo_3dfx.c"
3743 _vomodules="3dfx $_vomodules"
3744 else
3745 _def_3dfx='#undef HAVE_3DFX'
3746 _novomodules="3dfx $_novomodules"
3748 echores "$_3dfx"
3751 echocheck "tdfxfb"
3752 if test "$_tdfxfb" = yes ; then
3753 _def_tdfxfb='#define HAVE_TDFXFB 1'
3754 _vosrc="$_vosrc vo_tdfxfb.c"
3755 _vomodules="tdfxfb $_vomodules"
3756 else
3757 _def_tdfxfb='#undef HAVE_TDFXFB'
3758 _novomodules="tdfxfb $_novomodules"
3760 echores "$_tdfxfb"
3762 echocheck "s3fb"
3763 if test "$_s3fb" = yes ; then
3764 _def_s3fb='#define HAVE_S3FB 1'
3765 _vosrc="$_vosrc vo_s3fb.c"
3766 _vomodules="s3fb $_vomodules"
3767 else
3768 _def_s3fb='#undef HAVE_S3FB'
3769 _novomodules="s3fb $_novomodules"
3771 echores "$_s3fb"
3773 echocheck "tdfxvid"
3774 if test "$_tdfxvid" = yes ; then
3775 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3776 _vosrc="$_vosrc vo_tdfx_vid.c"
3777 _vomodules="tdfx_vid $_vomodules"
3778 else
3779 _def_tdfxvid='#undef HAVE_TDFX_VID'
3780 _novomodules="tdfx_vid $_novomodules"
3782 echores "$_tdfxvid"
3784 echocheck "tga"
3785 if test "$_tga" = yes ; then
3786 _def_tga='#define HAVE_TGA 1'
3787 _vosrc="$_vosrc vo_tga.c"
3788 _vomodules="tga $_vomodules"
3789 else
3790 _def_tga='#undef HAVE_TGA'
3791 _novomodules="tga $_novomodules"
3793 echores "$_tga"
3796 echocheck "DirectFB"
3797 if test "$_directfb" = auto ; then
3798 _directfb=no
3799 cat > $TMPC <<EOF
3800 #include <directfb.h>
3801 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3803 for _inc_tmp in "" -I/usr/local/include/directfb \
3804 -I/usr/include/directfb -I/usr/local/include -I/usr/include; do
3805 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3806 _inc_extra="$_inc_extra $_inc_tmp" && break
3807 done
3810 dfb_version() {
3811 expr $1 \* 65536 + $2 \* 256 + $3
3814 if test "$_directfb" = yes; then
3815 cat > $TMPC << EOF
3816 #include <directfb_version.h>
3818 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3821 if $_cc -E $TMPC $_inc_extra > "$TMPO"; then
3822 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPO" | tr -d '()'`
3823 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3824 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3825 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3826 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3827 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3828 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3829 _res_comment="$_directfb_version"
3830 else
3831 _def_directfb_version='#undef DIRECTFBVERSION'
3832 _directfb=no
3833 _res_comment="version >=0.9.13 required"
3835 else
3836 _directfb=no
3837 _res_comment="failed to get version"
3840 echores "$_directfb"
3842 if test "$_directfb" = yes ; then
3843 _def_directfb='#define HAVE_DIRECTFB 1'
3844 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3845 _vosrc="$_vosrc vo_directfb2.c"
3846 _vomodules="directfb $_vomodules"
3847 _libs_mplayer="$_libs_mplayer -ldirectfb"
3848 else
3849 _novomodules="directfb $_novomodules"
3852 if test "$_dfb_version" -ge `dfb_version 0 9 15`; then
3853 _vosrc="$_vosrc vo_dfbmga.c"
3854 _vomodules="dfbmga $_vomodules"
3855 _def_dfbmga='#define HAVE_DFBMGA 1'
3856 else
3857 _novomodules="dfbmga $_novomodules"
3858 _def_dfbmga='#undef HAVE_DFBMGA'
3860 else
3861 _def_directfb='#undef HAVE_DIRECTFB'
3862 _novomodules="dfbmga directfb $_novomodules"
3866 echocheck "X11 headers presence"
3867 for I in `echo $_inc_extra | sed s/-I//g` /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3868 if test -f "$I/X11/Xlib.h" ; then
3869 _inc_x11="-I$I"
3870 _x11_headers="yes"
3871 _res_comment="using $I"
3872 break
3874 done
3875 if test -z "$_inc_x11" ; then
3876 _x11=no
3877 _x11_headers="no"
3878 _res_comment="check if the dev(el) packages are installed"
3880 echores "$_x11_headers"
3883 echocheck "X11"
3884 if test "$_x11" != no ; then
3885 cat > $TMPC <<EOF
3886 #include <X11/Xlib.h>
3887 #include <X11/Xutil.h>
3888 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3890 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3891 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3892 if netbsd; then
3893 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3894 else
3895 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3897 cc_check $_inc_x11 $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3898 && _x11=yes && break
3899 done
3901 if test "$_x11" = yes ; then
3902 #FIXME: This is ugly as it can duplicate a -I parameter..
3903 _inc_extra="$_inc_extra $_inc_x11"
3904 _def_x11='#define HAVE_X11 1'
3905 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3906 _vomodules="x11 xover $_vomodules"
3907 else
3908 _x11=no
3909 _def_x11='#undef HAVE_X11'
3910 _novomodules="x11 $_novomodules"
3911 _res_comment="check if the dev(el) packages are installed"
3912 # disable stuff that depends on X
3913 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _dga=no
3915 echores "$_x11"
3918 echocheck "DPMS"
3919 _xdpms3=no
3920 _xdpms4=no
3921 if test "$_x11" = yes ; then
3922 cat > $TMPC <<EOF
3923 #include <X11/Xmd.h>
3924 #include <X11/Xlib.h>
3925 #include <X11/Xutil.h>
3926 #include <X11/Xatom.h>
3927 #include <X11/extensions/dpms.h>
3928 int main(void) {
3929 (void) DPMSQueryExtension(0, 0, 0);
3932 cc_check -lXdpms && _xdpms3=yes
3933 cat > $TMPC <<EOF
3934 #include <X11/Xlib.h>
3935 #include <X11/extensions/dpms.h>
3936 int main(void) {
3937 (void) DPMSQueryExtension(0, 0, 0);
3940 cc_check && _xdpms4=yes
3942 if test "$_xdpms4" = yes ; then
3943 _def_xdpms='#define HAVE_XDPMS 1'
3944 _res_comment="using Xdpms 4"
3945 echores "yes"
3946 elif test "$_xdpms3" = yes ; then
3947 _def_xdpms='#define HAVE_XDPMS 1'
3948 _libs_mplayer="$_libs_mplayer -lXdpms"
3949 _res_comment="using Xdpms 3"
3950 echores "yes"
3951 else
3952 _def_xdpms='#undef HAVE_XDPMS'
3953 echores "no"
3957 echocheck "Xv"
3958 if test "$_xv" = auto ; then
3959 cat > $TMPC <<EOF
3960 #include <X11/Xlib.h>
3961 #include <X11/extensions/Xvlib.h>
3962 int main(void) {
3963 (void) XvGetPortAttribute(0, 0, 0, 0);
3964 (void) XvQueryPortAttributes(0, 0, 0);
3965 return 0; }
3967 _xv=no
3968 cc_check -lXv && _xv=yes
3971 if test "$_xv" = yes ; then
3972 _def_xv='#define HAVE_XV 1'
3973 _libs_mplayer="$_libs_mplayer -lXv"
3974 _vosrc="$_vosrc vo_xv.c"
3975 _vomodules="xv $_vomodules"
3976 else
3977 _def_xv='#undef HAVE_XV'
3978 _novomodules="xv $_novomodules"
3980 echores "$_xv"
3983 echocheck "XvMC"
3984 if test "$_xv" = yes && test "$_xvmc" != no ; then
3985 _xvmc=no
3986 cat > $TMPC <<EOF
3987 #include <X11/Xlib.h>
3988 #include <X11/extensions/Xvlib.h>
3989 #include <X11/extensions/XvMClib.h>
3990 int main(void) {
3991 (void) XvMCQueryExtension(0,0,0);
3992 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3993 return 0; }
3995 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3996 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3997 done
3999 if test "$_xvmc" = yes ; then
4000 _def_xvmc='#define HAVE_XVMC 1'
4001 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
4002 _vosrc="$_vosrc vo_xvmc.c"
4003 _vomodules="xvmc $_vomodules"
4004 _res_comment="using $_xvmclib"
4005 else
4006 _def_xvmc='#undef HAVE_XVMC'
4007 _novomodules="xvmc $_novomodules"
4008 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4010 echores "$_xvmc"
4013 echocheck "Xinerama"
4014 if test "$_xinerama" = auto ; then
4015 cat > $TMPC <<EOF
4016 #include <X11/Xlib.h>
4017 #include <X11/extensions/Xinerama.h>
4018 int main(void) { (void) XineramaIsActive(0); return 0; }
4020 _xinerama=no
4021 cc_check -lXinerama && _xinerama=yes
4024 if test "$_xinerama" = yes ; then
4025 _def_xinerama='#define HAVE_XINERAMA 1'
4026 _libs_mplayer="$_libs_mplayer -lXinerama"
4027 else
4028 _def_xinerama='#undef HAVE_XINERAMA'
4030 echores "$_xinerama"
4033 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4034 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4035 # named 'X extensions' or something similar.
4036 # This check may be useful for future mplayer versions (to change resolution)
4037 # If you run into problems, remove '-lXxf86vm'.
4038 echocheck "Xxf86vm"
4039 if test "$_vm" = auto ; then
4040 cat > $TMPC <<EOF
4041 #include <X11/Xlib.h>
4042 #include <X11/extensions/xf86vmode.h>
4043 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4045 _vm=no
4046 cc_check -lXxf86vm && _vm=yes
4048 if test "$_vm" = yes ; then
4049 _def_vm='#define HAVE_XF86VM 1'
4050 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4051 else
4052 _def_vm='#undef HAVE_XF86VM'
4054 echores "$_vm"
4056 # Check for the presence of special keycodes, like audio control buttons
4057 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4058 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4059 # have these new keycodes.
4060 echocheck "XF86keysym"
4061 if test "$_xf86keysym" = auto; then
4062 _xf86keysym=no
4063 cat > $TMPC <<EOF
4064 #include <X11/Xlib.h>
4065 #include <X11/XF86keysym.h>
4066 int main(void) { return XF86XK_AudioPause; }
4068 cc_check && _xf86keysym=yes
4070 if test "$_xf86keysym" = yes ; then
4071 _def_xf86keysym='#define HAVE_XF86XK 1'
4072 else
4073 _def_xf86keysym='#undef HAVE_XF86XK'
4075 echores "$_xf86keysym"
4077 echocheck "DGA"
4078 # Version 2 is preferred to version 1 if available
4079 if test "$_dga" = auto ; then
4080 cat > $TMPC << EOF
4081 #include <X11/Xlib.h>
4082 #include <X11/extensions/xf86dga.h>
4083 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4085 _dga=no
4086 cc_check -lXxf86dga -lXxf86vm && _dga=1
4088 cat > $TMPC << EOF
4089 #include <X11/Xlib.h>
4090 #include <X11/extensions/xf86dga.h>
4091 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4093 cc_check -lXxf86dga && _dga=2
4096 _def_dga='#undef HAVE_DGA'
4097 _def_dga2='#undef HAVE_DGA2'
4098 if test "$_dga" = 1 ; then
4099 _def_dga='#define HAVE_DGA 1'
4100 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4101 _vosrc="$_vosrc vo_dga.c"
4102 _vomodules="dga $_vomodules"
4103 _res_comment="using DGA 1.0"
4104 elif test "$_dga" = 2 ; then
4105 _def_dga='#define HAVE_DGA 1'
4106 _def_dga2='#define HAVE_DGA2 1'
4107 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4108 _vosrc="$_vosrc vo_dga.c"
4109 _vomodules="dga $_vomodules"
4110 _res_comment="using DGA 2.0"
4111 elif test "$_dga" = no ; then
4112 _novomodules="dga $_novomodules"
4113 else
4114 die "DGA version must be 1 or 2"
4116 echores "$_dga"
4119 echocheck "OpenGL"
4120 #Note: this test is run even with --enable-gl since we autodetect linker flags
4121 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4122 cat > $TMPC << EOF
4123 #include <GL/gl.h>
4124 int main(void) { return 0; }
4126 _gl=no
4127 if cc_check -lGL $_ld_lm ; then
4128 _gl=yes
4129 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4130 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4131 _gl=yes
4132 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4133 elif cc_check -lopengl32 ; then
4134 _gl=yes
4135 _gl_win32=yes
4136 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4138 else
4139 _gl=no
4141 if test "$_gl" = yes ; then
4142 _def_gl='#define HAVE_GL 1'
4143 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4144 if test "$_gl_win32" = yes ; then
4145 _def_gl_win32='#define GL_WIN32 1'
4146 _vosrc="$_vosrc w32_common.c"
4147 _res_comment="win32 version"
4149 _vomodules="opengl $_vomodules"
4150 else
4151 _def_gl='#undef HAVE_GL'
4152 _def_gl_win32='#undef GL_WIN32'
4153 _novomodules="opengl $_novomodules"
4155 echores "$_gl"
4158 echocheck "/dev/mga_vid"
4159 if test "$_mga" = auto ; then
4160 _mga=no
4161 test -c /dev/mga_vid && _mga=yes
4163 if test "$_mga" = yes ; then
4164 _def_mga='#define HAVE_MGA 1'
4165 _vosrc="$_vosrc vo_mga.c"
4166 _vomodules="mga $_vomodules"
4167 else
4168 _def_mga='#undef HAVE_MGA'
4169 _novomodules="mga $_novomodules"
4171 echores "$_mga"
4174 # echocheck "syncfb"
4175 # _syncfb=no
4176 # test "$_mga" = yes && _syncfb=yes
4177 # if test "$_syncfb" = yes ; then
4178 # _def_syncfb='#define HAVE_SYNCFB 1'
4179 # _vosrc="$_vosrc vo_syncfb.c"
4180 # else
4181 # _def_syncfb='#undef HAVE_SYNCFB'
4182 # fi
4183 # echores "$_syncfb"
4186 echocheck "xmga"
4187 if test "$_xmga" = auto ; then
4188 _xmga=no
4189 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4191 if test "$_xmga" = yes ; then
4192 _def_xmga='#define HAVE_XMGA 1'
4193 _vosrc="$_vosrc vo_xmga.c"
4194 _vomodules="xmga $_vomodules"
4195 else
4196 _def_xmga='#undef HAVE_XMGA'
4197 _novomodules="xmga $_novomodules"
4199 echores "$_xmga"
4202 echocheck "GGI"
4203 if test "$_ggi" = auto ; then
4204 cat > $TMPC << EOF
4205 #include <ggi/ggi.h>
4206 int main(void) { return 0; }
4208 _ggi=no
4209 cc_check -lggi && _ggi=yes
4211 if test "$_ggi" = yes ; then
4212 _def_ggi='#define HAVE_GGI 1'
4213 _libs_mplayer="$_libs_mplayer -lggi"
4214 _vosrc="$_vosrc vo_ggi.c"
4215 _vomodules="ggi $_vomodules"
4216 else
4217 _def_ggi='#undef HAVE_GGI'
4218 _novomodules="ggi $_novomodules"
4220 echores "$_ggi"
4222 echocheck "GGI extension: libggiwmh"
4223 if test "$_ggiwmh" = auto ; then
4224 _ggiwmh=no
4225 cat > $TMPC << EOF
4226 #include <ggi/ggi.h>
4227 #include <ggi/wmh.h>
4228 int main(void) { return 0; }
4230 cc_check -lggi -lggiwmh && _ggiwmh=yes
4232 # needed to get right output on obscure combination
4233 # like --disable-ggi --enable-ggiwmh
4234 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4235 _def_ggiwmh='#define HAVE_GGIWMH 1'
4236 _libs_mplayer="$_libs_mplayer -lggiwmh"
4237 else
4238 _ggiwmh=no
4239 _def_ggiwmh='#undef HAVE_GGIWMH'
4241 echores "$_ggiwmh"
4244 echocheck "AA"
4245 if test "$_aa" = auto ; then
4246 cat > $TMPC << EOF
4247 #include <aalib.h>
4248 extern struct aa_hardware_params aa_defparams;
4249 extern struct aa_renderparams aa_defrenderparams;
4250 int main(void) {
4251 aa_context *c;
4252 aa_renderparams *p;
4253 (void) aa_init(0, 0, 0);
4254 c = aa_autoinit(&aa_defparams);
4255 p = aa_getrenderparams();
4256 aa_autoinitkbd(c,0);
4257 return 0; }
4259 _aa=no
4260 for _ld_tmp in "-laa" ; do
4261 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4262 done
4264 if test "$_aa" = yes ; then
4265 _def_aa='#define HAVE_AA 1'
4266 if cygwin ; then
4267 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4269 _vosrc="$_vosrc vo_aa.c"
4270 _vomodules="aa $_vomodules"
4271 else
4272 _def_aa='#undef HAVE_AA'
4273 _novomodules="aa $_novomodules"
4275 echores "$_aa"
4278 echocheck "CACA"
4279 if test "$_caca" = auto ; then
4280 _caca=no
4281 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4282 cat > $TMPC << EOF
4283 #include <caca.h>
4284 #ifdef CACA_API_VERSION_1
4285 #include <caca0.h>
4286 #endif
4287 int main(void) { (void) caca_init(); return 0; }
4289 cc_check `caca-config --libs` && _caca=yes
4292 if test "$_caca" = yes ; then
4293 _def_caca='#define HAVE_CACA 1'
4294 _inc_extra="$_inc_extra `caca-config --cflags`"
4295 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4296 _vosrc="$_vosrc vo_caca.c"
4297 _vomodules="caca $_vomodules"
4298 else
4299 _def_caca='#undef HAVE_CACA'
4300 _novomodules="caca $_novomodules"
4302 echores "$_caca"
4305 echocheck "SVGAlib"
4306 if test "$_svga" = auto ; then
4307 cat > $TMPC << EOF
4308 #include <vga.h>
4309 int main(void) { return 0; }
4311 _svga=no
4312 cc_check -lvga $_ld_lm && _svga=yes
4314 if test "$_svga" = yes ; then
4315 _def_svga='#define HAVE_SVGALIB 1'
4316 _libs_mplayer="$_libs_mplayer -lvga"
4317 _vosrc="$_vosrc vo_svga.c"
4318 _vomodules="svga $_vomodules"
4319 else
4320 _def_svga='#undef HAVE_SVGALIB'
4321 _novomodules="svga $_novomodules"
4323 echores "$_svga"
4326 echocheck "FBDev"
4327 if test "$_fbdev" = auto ; then
4328 _fbdev=no
4329 linux && test -c /dev/fb0 && _fbdev=yes
4331 if test "$_fbdev" = yes ; then
4332 _def_fbdev='#define HAVE_FBDEV 1'
4333 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4334 _vomodules="fbdev $_vomodules"
4335 else
4336 _def_fbdev='#undef HAVE_FBDEV'
4337 _novomodules="fbdev $_novomodules"
4339 echores "$_fbdev"
4343 echocheck "DVB"
4344 if test "$_dvb" = auto ; then
4345 _dvb=no
4346 cat >$TMPC << EOF
4347 #include <sys/poll.h>
4348 #include <sys/ioctl.h>
4349 #include <stdio.h>
4350 #include <time.h>
4351 #include <unistd.h>
4353 #include <ost/dmx.h>
4354 #include <ost/frontend.h>
4355 #include <ost/sec.h>
4356 #include <ost/video.h>
4357 #include <ost/audio.h>
4358 int main(void) {return 0;}
4360 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4361 cc_check $_inc_tmp && _dvb=yes && \
4362 _inc_extra="$_inc_extra $_inc_tmp" && break
4363 done
4365 echores "$_dvb"
4366 if test "$_dvb" = yes ; then
4367 _def_dvb='#define HAVE_DVB 1'
4368 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4369 _aomodules="mpegpes(dvb) $_aomodules"
4370 _vomodules="mpegpes(dvb) $_vomodules"
4373 echocheck "DVB HEAD"
4374 if test "$_dvbhead" = auto ; then
4375 _dvbhead=no
4377 cat >$TMPC << EOF
4378 #include <sys/poll.h>
4379 #include <sys/ioctl.h>
4380 #include <stdio.h>
4381 #include <time.h>
4382 #include <unistd.h>
4384 #include <linux/dvb/dmx.h>
4385 #include <linux/dvb/frontend.h>
4386 #include <linux/dvb/video.h>
4387 #include <linux/dvb/audio.h>
4388 int main(void) {return 0;}
4390 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4391 cc_check $_inc_tmp && _dvbhead=yes && \
4392 _inc_extra="$_inc_extra $_inc_tmp" && break
4393 done
4395 echores "$_dvbhead"
4396 if test "$_dvbhead" = yes ; then
4397 _def_dvb='#define HAVE_DVB_HEAD 1'
4398 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4399 _aomodules="mpegpes(dvb) $_aomodules"
4400 _vomodules="mpegpes(dvb) $_vomodules"
4403 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4404 _def_dvb='#undef HAVE_DVB'
4405 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4406 _aomodules="mpegpes(file) $_aomodules"
4407 _vomodules="mpegpes(file) $_vomodules"
4410 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4411 _dvbin=yes
4412 _inputmodules="dvb $_inputmodules"
4413 else
4414 _dvbin=no
4415 _noinputmodules="dvb $_noinputmodules"
4418 echocheck "PNG support"
4419 if test "$_png" = auto ; then
4420 _png=no
4421 if irix ; then
4422 # Don't check for -lpng on irix since it has its own libpng
4423 # incompatible with the GNU libpng
4424 _res_comment="disabled on irix (not GNU libpng)"
4425 else
4426 cat > $TMPC << EOF
4427 #include <png.h>
4428 #include <string.h>
4429 int main(void) {
4430 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4431 printf("libpng: %s\n", png_libpng_ver);
4432 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4435 if cc_check -lpng -lz $_ld_lm ; then
4436 if tmp_run ; then
4437 _png=yes
4438 else
4439 _res_comment="mismatch of library and header versions"
4444 echores "$_png"
4445 if test "$_png" = yes ; then
4446 _def_png='#define HAVE_PNG 1'
4447 _ld_extra="$_ld_extra -lpng -lz"
4448 _vosrc="$_vosrc vo_png.c"
4449 _vomodules="png $_vomodules"
4450 else
4451 _def_png='#undef HAVE_PNG'
4452 _novomodules="png $_novomodules"
4455 echocheck "JPEG support"
4456 if test "$_jpeg" = auto ; then
4457 _jpeg=no
4458 cat > $TMPC << EOF
4459 #include <stdio.h>
4460 #include <stdlib.h>
4461 #include <setjmp.h>
4462 #include <string.h>
4463 #include <jpeglib.h>
4464 int main(void) {
4465 return 0;
4468 if cc_check -ljpeg $_ld_lm ; then
4469 if tmp_run ; then
4470 _jpeg=yes
4474 echores "$_jpeg"
4476 if test "$_jpeg" = yes ; then
4477 _def_jpeg='#define HAVE_JPEG 1'
4478 _vosrc="$_vosrc vo_jpeg.c"
4479 _vomodules="jpeg $_vomodules"
4480 _ld_extra="$_ld_extra -ljpeg"
4481 else
4482 _def_jpeg='#undef HAVE_JPEG'
4483 _novomodules="jpeg $_novomodules"
4488 echocheck "PNM support"
4489 if test "$_pnm" = yes; then
4490 _def_pnm="#define HAVE_PNM"
4491 _vosrc="$_vosrc vo_pnm.c"
4492 _vomodules="pnm $_vomodules"
4493 else
4494 _def_pnm="#undef HAVE_PNM"
4495 _novomodules="pnm $_novomodules"
4497 echores "$_pnm"
4501 echocheck "GIF support"
4502 # This is to appease people who want to force gif support.
4503 # If it is forced to yes, then we still do checks to determine
4504 # which gif library to use.
4505 if test "$_gif" = yes ; then
4506 _force_gif=yes
4507 _gif=auto
4510 if test "$_gif" = auto ; then
4511 _gif=no
4512 cat > $TMPC << EOF
4513 #include <gif_lib.h>
4514 int main(void) {
4515 return 0;
4518 for _ld_gif in "-lungif" "-lgif" ; do
4519 cc_check $_ld_gif && tmp_run && _gif=yes && break
4520 done
4523 # If no library was found, and the user wants support forced,
4524 # then we force it on with libgif, as this is the safest
4525 # assumption IMHO. (libungif & libregif both create symbolic
4526 # links to libgif. We also assume that no x11 support is needed,
4527 # because if you are forcing this, then you _should_ know what
4528 # you are doing. [ Besides, package maintainers should never
4529 # have compiled x11 deps into libungif in the first place. ] )
4530 # </rant>
4531 # --Joey
4532 if test "$_force_gif" = yes && test "$_gif" = no ; then
4533 _gif=yes
4534 _ld_gif="-lgif"
4537 if test "$_gif" = yes ; then
4538 _def_gif='#define HAVE_GIF 1'
4539 _vosrc="$_vosrc vo_gif89a.c"
4540 _codecmodules="gif $_codecmodules"
4541 _vomodules="gif89a $_vomodules"
4542 _res_comment="old version, some encoding functions disabled"
4543 _def_gif_4='#undef HAVE_GIF_4'
4544 _ld_extra="$_ld_extra $_ld_gif"
4546 cat > $TMPC << EOF
4547 #include <signal.h>
4548 #include <gif_lib.h>
4549 void catch() { exit(1); }
4550 int main(void) {
4551 signal(SIGSEGV, catch); // catch segfault
4552 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4553 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4554 return 0;
4557 if cc_check "$_ld_gif" && tmp_run ; then
4558 _def_gif_4='#define HAVE_GIF_4 1'
4559 _res_comment=""
4561 else
4562 _def_gif='#undef HAVE_GIF'
4563 _def_gif_4='#undef HAVE_GIF_4'
4564 _novomodules="gif89a $_novomodules"
4565 _nocodecmodules="gif $_nocodecmodules"
4567 echores "$_gif"
4570 case "$_gif" in yes*)
4571 echocheck "broken giflib workaround"
4572 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4574 cat > $TMPC << EOF
4575 #include <gif_lib.h>
4576 int main(void) {
4577 GifFileType gif;
4578 printf("UserData is at address %p\n", gif.UserData);
4579 return 0;
4582 if cc_check "$_ld_gif" && tmp_run ; then
4583 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4584 echores "disabled"
4585 else
4586 echores "enabled"
4589 esac
4592 echocheck "VESA support"
4593 if test "$_vesa" = auto ; then
4594 cat > $TMPC << EOF
4595 #include <vbe.h>
4596 int main(void) { vbeVersion(); return 0; }
4598 _vesa=no
4599 cc_check -lvbe -llrmi && _vesa=yes
4601 if test "$_vesa" = yes ; then
4602 _def_vesa='#define HAVE_VESA 1'
4603 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4604 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4605 _vomodules="vesa $_vomodules"
4606 else
4607 _def_vesa='#undef HAVE_VESA'
4608 _novomodules="vesa $_novomodules"
4610 echores "$_vesa"
4612 #################
4613 # VIDEO + AUDIO #
4614 #################
4617 echocheck "SDL"
4618 if test -z "$_sdlconfig" ; then
4619 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4620 _sdlconfig="sdl-config"
4621 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4622 _sdlconfig="sdl11-config"
4623 else
4624 _sdlconfig=false
4627 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4628 cat > $TMPC << EOF
4629 #include <SDL.h>
4630 int main(int argc, char *argv[]) { return 0; }
4632 _sdl=no
4633 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4634 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4635 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4636 if test "$_sdlversion" -gt 116 ; then
4637 if test "$_sdlversion" -lt 121 ; then
4638 _def_sdlbuggy='#define BUGGY_SDL'
4639 else
4640 _def_sdlbuggy='#undef BUGGY_SDL'
4642 _sdl=yes
4647 if test "$_sdl" = yes ; then
4648 _def_sdl='#define HAVE_SDL 1'
4649 if cygwin ; then
4650 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4651 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4652 elif mingw32 ; then
4653 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4654 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4655 else
4656 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4657 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4659 _vosrc="$_vosrc vo_sdl.c"
4660 _vomodules="sdl $_vomodules"
4661 _aosrc="$_aosrc ao_sdl.c"
4662 _aomodules="sdl $_aomodules"
4663 _res_comment="using $_sdlconfig"
4664 else
4665 _def_sdl='#undef HAVE_SDL'
4666 _novomodules="sdl $_novomodules"
4667 _noaomodules="sdl $_noaomodules"
4669 echores "$_sdl"
4672 if win32; then
4674 echocheck "Windows waveout"
4675 if test "$_win32waveout" = auto ; then
4676 cat > $TMPC << EOF
4677 #include <windows.h>
4678 #include <mmsystem.h>
4679 int main(void) { return 0; }
4681 _win32waveout=no
4682 cc_check -lwinmm && _win32waveout=yes
4684 if test "$_win32waveout" = yes ; then
4685 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4686 _libs_mplayer="$_libs_mplayer -lwinmm"
4687 _aosrc="$_aosrc ao_win32.c"
4688 _aomodules="win32 $_aomodules"
4689 else
4690 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4691 _noaomodules="win32 $_noaomodules"
4693 echores "$_win32waveout"
4695 echocheck "Directx"
4696 if test "$_directx" = auto ; then
4697 cat > $TMPC << EOF
4698 #include <windows.h>
4699 #include <ddraw.h>
4700 #include <dsound.h>
4701 int main(void) { return 0; }
4703 _directx=no
4704 cc_check -lgdi32 && _directx=yes
4706 if test "$_directx" = yes ; then
4707 _def_directx='#define HAVE_DIRECTX 1'
4708 _libs_mplayer="$_libs_mplayer -lgdi32"
4709 _vosrc="$_vosrc vo_directx.c"
4710 _vomodules="directx $_vomodules"
4711 _aosrc="$_aosrc ao_dsound.c"
4712 _aomodules="dsound $_aomodules"
4713 else
4714 _def_directx='#undef HAVE_DIRECTX'
4715 _novomodules="directx $_novomodules"
4716 _noaomodules="dsound $_noaomodules"
4718 echores "$_directx"
4720 fi #if win32; then
4723 echocheck "NAS"
4724 if test "$_nas" = auto ; then
4725 cat > $TMPC << EOF
4726 #include <audio/audiolib.h>
4727 int main(void) { return 0; }
4729 _nas=no
4730 cc_check $_ld_lm -laudio -lXt && _nas=yes
4732 if test "$_nas" = yes ; then
4733 _def_nas='#define HAVE_NAS 1'
4734 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4735 _aosrc="$_aosrc ao_nas.c"
4736 _aomodules="nas $_aomodules"
4737 else
4738 _noaomodules="nas $_noaomodules"
4739 _def_nas='#undef HAVE_NAS'
4741 echores "$_nas"
4743 echocheck "DXR2"
4744 if test "$_dxr2" = auto; then
4745 _dxr2=no
4746 cat > $TMPC << EOF
4747 #include <dxr2ioctl.h>
4748 int main(void) { return 0; }
4750 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4751 cc_check $_inc_tmp && _dxr2=yes && \
4752 _inc_extra="$_inc_extra $_inc_tmp" && break
4753 done
4755 if test "$_dxr2" = yes; then
4756 _def_dxr2='#define HAVE_DXR2 1'
4757 _vosrc="$_vosrc vo_dxr2.c"
4758 _aosrc="$_aosrc ao_dxr2.c"
4759 _aomodules="dxr2 $_aomodules"
4760 _vomodules="dxr2 $_vomodules"
4761 else
4762 _def_dxr2='#undef HAVE_DXR2'
4763 _noaomodules="dxr2 $_noaomodules"
4764 _novomodules="dxr2 $_novomodules"
4766 echores "$_dxr2"
4768 echocheck "DXR3/H+"
4769 if test "$_dxr3" = auto ; then
4770 cat > $TMPC << EOF
4771 #include <linux/em8300.h>
4772 int main(void) { return 0; }
4774 _dxr3=no
4775 cc_check && _dxr3=yes
4777 if test "$_dxr3" = yes ; then
4778 _def_dxr3='#define HAVE_DXR3 1'
4779 _vosrc="$_vosrc vo_dxr3.c"
4780 _vomodules="dxr3 $_vomodules"
4781 else
4782 _def_dxr3='#undef HAVE_DXR3'
4783 _novomodules="dxr3 $_novomodules"
4785 echores "$_dxr3"
4788 echocheck "IVTV TV-Out"
4789 if test "$_ivtv" = auto ; then
4790 cat > $TMPC << EOF
4791 #include <stdlib.h>
4792 #include <inttypes.h>
4793 #include <linux/types.h>
4794 #include <linux/videodev2.h>
4795 #include <linux/ivtv.h>
4796 int main(void) { return 0; }
4798 _ivtv=no
4799 cc_check && _ivtv=yes
4801 if test "$_ivtv" = yes ; then
4802 _def_ivtv='#define HAVE_IVTV 1'
4803 _vosrc="$_vosrc vo_ivtv.c"
4804 _vomodules="ivtv $_vomodules"
4805 _aosrc="$_aosrc ao_ivtv.c"
4806 _aomodules="ivtv $_aomodules"
4807 else
4808 _def_ivtv='#undef HAVE_IVTV'
4809 _novomodules="ivtv $_novomodules"
4810 _noaomodules="ivtv $_noaomodules"
4812 echores "$_ivtv"
4816 #########
4817 # AUDIO #
4818 #########
4821 echocheck "OSS Audio"
4822 if test "$_ossaudio" = auto ; then
4823 cat > $TMPC << EOF
4824 #include <sys/ioctl.h>
4825 $_include_soundcard
4826 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4828 _ossaudio=no
4829 cc_check && _ossaudio=yes
4831 if test "$_ossaudio" = yes ; then
4832 _def_ossaudio='#define USE_OSS_AUDIO 1'
4833 _aosrc="$_aosrc ao_oss.c"
4834 _aomodules="oss $_aomodules"
4835 if test "$_linux_devfs" = yes; then
4836 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4837 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4838 else
4839 cat > $TMPC << EOF
4840 #include <sys/ioctl.h>
4841 $_include_soundcard
4842 #ifdef OPEN_SOUND_SYSTEM
4843 int main(void) { return 0; }
4844 #else
4845 #error Not the real thing
4846 #endif
4848 _real_ossaudio=no
4849 cc_check && _real_ossaudio=yes
4850 if test "$_real_ossaudio" = yes; then
4851 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4852 elif netbsd || openbsd ; then
4853 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4854 _ld_extra="$_ld_extra -lossaudio"
4855 else
4856 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4858 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4860 else
4861 _def_ossaudio='#undef USE_OSS_AUDIO'
4862 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4863 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4864 _noaomodules="oss $_noaomodules"
4866 echores "$_ossaudio"
4869 echocheck "aRts"
4870 if test "$_arts" = auto ; then
4871 _arts=no
4872 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4874 cat > $TMPC << EOF
4875 #include <artsc.h>
4876 int main(void) { return 0; }
4878 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
4883 if test "$_arts" = yes ; then
4884 _def_arts='#define USE_ARTS 1'
4885 _aosrc="$_aosrc ao_arts.c"
4886 _aomodules="arts $_aomodules"
4887 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
4888 _inc_extra="$_inc_extra `artsc-config --cflags`"
4889 else
4890 _noaomodules="arts $_noaomodules"
4892 echores "$_arts"
4895 echocheck "EsounD"
4896 if test "$_esd" = auto ; then
4897 _esd=no
4898 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4900 cat > $TMPC << EOF
4901 #include <esd.h>
4902 int main(void) { return 0; }
4904 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes
4908 echores "$_esd"
4910 if test "$_esd" = yes ; then
4911 _def_esd='#define USE_ESD 1'
4912 _aosrc="$_aosrc ao_esd.c"
4913 _aomodules="esd $_aomodules"
4914 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
4915 _inc_extra="$_inc_extra `esd-config --cflags`"
4917 echocheck "esd_get_latency()"
4918 cat > $TMPC << EOF
4919 #include <esd.h>
4920 int main(void) { return esd_get_latency(0); }
4922 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4923 echores "$_esd_latency"
4924 else
4925 _def_esd='#undef USE_ESD'
4926 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4927 _noaomodules="esd $_noaomodules"
4930 echocheck "Polyp"
4931 if test "$_polyp" = auto ; then
4932 _polyp=no
4933 if $_pkg_config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
4935 cat > $TMPC << EOF
4936 #include <polyp/polyplib.h>
4937 #include <polyp/mainloop.h>
4938 #include <polyp/polyplib-error.h>
4939 int main(void) { return 0; }
4941 cc_check `$_pkg_config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
4945 echores "$_polyp"
4947 if test "$_polyp" = yes ; then
4948 _def_polyp='#define USE_POLYP 1'
4949 _aosrc="$_aosrc ao_polyp.c"
4950 _aomodules="polyp $_aomodules"
4951 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs polyplib polyplib-error polyplib-mainloop`"
4952 _inc_extra="$_inc_extra `$_pkg_config --cflags polyplib polyplib-error polyplib-mainloop`"
4953 else
4954 _def_polyp='#undef USE_POLYP'
4955 _noaomodules="polyp $_noaomodules"
4959 echocheck "JACK"
4960 if test "$_jack" = auto ; then
4961 _jack=yes
4963 cat > $TMPC << EOF
4964 #include <jack/jack.h>
4965 int main(void) { jack_client_new("test"); return 0; }
4967 if cc_check -ljack ; then
4968 _libs_mplayer="$_libs_mplayer -ljack"
4969 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
4970 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
4971 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
4972 else
4973 _jack=no
4977 if test "$_jack" = yes ; then
4978 _def_jack='#define USE_JACK 1'
4979 _aosrc="$_aosrc ao_jack.c"
4980 _aomodules="jack $_aomodules"
4981 else
4982 _noaomodules="jack $_noaomodules"
4984 echores "$_jack"
4986 echocheck "OpenAL"
4987 if test "$_openal" = auto ; then
4988 _openal=no
4989 cat > $TMPC << EOF
4990 #ifdef OPENAL_AL_H
4991 #include <OpenAL/al.h>
4992 #else
4993 #include <AL/al.h>
4994 #endif
4995 int main(void) {
4996 alSourceQueueBuffers(0, 0, 0);
4997 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4998 return 0;
5001 for I in "-lopenal" "-framework OpenAL" ; do
5002 cc_check $I && _openal=yes && break
5003 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5004 done
5005 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5007 if test "$_openal" = yes ; then
5008 _def_openal='#define USE_OPENAL 1'
5009 _aosrc="$_aosrc ao_openal.c"
5010 _aomodules="openal $_aomodules"
5011 else
5012 _noaomodules="openal $_noaomodules"
5014 echores "$_openal"
5016 echocheck "ALSA audio"
5017 if test "$_alsa" != no ; then
5018 _alsa=no
5019 cat > $TMPC << EOF
5020 #include <sys/asoundlib.h>
5021 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5022 #error "alsa version != 0.5.x"
5023 #endif
5024 int main(void) { return 0; }
5026 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5028 cat > $TMPC << EOF
5029 #include <sys/asoundlib.h>
5030 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5031 #error "alsa version != 0.9.x"
5032 #endif
5033 int main(void) { return 0; }
5035 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5036 cat > $TMPC << EOF
5037 #include <alsa/asoundlib.h>
5038 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5039 #error "alsa version != 0.9.x"
5040 #endif
5041 int main(void) { return 0; }
5043 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5045 cat > $TMPC << EOF
5046 #include <sys/asoundlib.h>
5047 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5048 #error "alsa version != 1.0.x"
5049 #endif
5050 int main(void) { return 0; }
5052 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5053 cat > $TMPC << EOF
5054 #include <alsa/asoundlib.h>
5055 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5056 #error "alsa version != 1.0.x"
5057 #endif
5058 int main(void) { return 0; }
5060 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5062 _def_alsa5='#undef HAVE_ALSA5'
5063 _def_alsa9='#undef HAVE_ALSA9'
5064 _def_alsa1x='#undef HAVE_ALSA1X'
5065 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5066 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5067 if test "$_alsaver" ; then
5068 _alsa=yes
5069 if test "$_alsaver" = '0.5.x' ; then
5070 _alsa5=yes
5071 _aosrc="$_aosrc ao_alsa5.c"
5072 _aomodules="alsa5 $_aomodules"
5073 _def_alsa5='#define HAVE_ALSA5 1'
5074 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5075 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5076 elif test "$_alsaver" = '0.9.x-sys' ; then
5077 _alsa9=yes
5078 _aosrc="$_aosrc ao_alsa.c"
5079 _aomodules="alsa $_aomodules"
5080 _def_alsa9='#define HAVE_ALSA9 1'
5081 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5082 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5083 elif test "$_alsaver" = '0.9.x-alsa' ; then
5084 _alsa9=yes
5085 _aosrc="$_aosrc ao_alsa.c"
5086 _aomodules="alsa $_aomodules"
5087 _def_alsa9='#define HAVE_ALSA9 1'
5088 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5089 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5090 elif test "$_alsaver" = '1.0.x-sys' ; then
5091 _alsa1x=yes
5092 _aosrc="$_aosrc ao_alsa.c"
5093 _aomodules="alsa $_aomodules"
5094 _def_alsa1x="#define HAVE_ALSA1X 1"
5095 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5096 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5097 elif test "$_alsaver" = '1.0.x-alsa' ; then
5098 _alsa1x=yes
5099 _aosrc="$_aosrc ao_alsa.c"
5100 _aomodules="alsa $_aomodules"
5101 _def_alsa1x="#define HAVE_ALSA1X 1"
5102 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5103 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5104 else
5105 _alsa=no
5106 _res_comment="unknown version"
5108 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5109 else
5110 _noaomodules="alsa $_noaomodules"
5112 echores "$_alsa"
5115 echocheck "Sun audio"
5116 if test "$_sunaudio" = auto ; then
5117 cat > $TMPC << EOF
5118 #include <sys/types.h>
5119 #include <sys/audioio.h>
5120 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5122 _sunaudio=no
5123 cc_check && _sunaudio=yes
5125 if test "$_sunaudio" = yes ; then
5126 _def_sunaudio='#define USE_SUN_AUDIO 1'
5127 _aosrc="$_aosrc ao_sun.c"
5128 _aomodules="sun $_aomodules"
5129 else
5130 _def_sunaudio='#undef USE_SUN_AUDIO'
5131 _noaomodules="sun $_noaomodules"
5133 echores "$_sunaudio"
5136 if sunos; then
5137 echocheck "Sun mediaLib"
5138 if test "$_mlib" = auto ; then
5139 _mlib=no
5140 cat > $TMPC << EOF
5141 #include <mlib.h>
5142 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5144 cc_check -lmlib && _mlib=yes
5146 if test "$_mlib" = yes ; then
5147 _def_mlib='#define HAVE_MLIB 1'
5148 else
5149 _def_mlib='#undef HAVE_MLIB'
5151 echores "$_mlib"
5152 fi #if sunos
5155 if irix; then
5156 echocheck "SGI audio"
5157 if test "$_sgiaudio" = auto ; then
5158 # check for SGI audio
5159 cat > $TMPC << EOF
5160 #include <dmedia/audio.h>
5161 int main(void) { return 0; }
5163 _sgiaudio=no
5164 cc_check && _sgiaudio=yes
5166 if test "$_sgiaudio" = "yes" ; then
5167 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5168 _libs_mplayer="$_libs_mplayer -laudio"
5169 _aosrc="$_aosrc ao_sgi.c"
5170 _aomodules="sgi $_aomodules"
5171 else
5172 _def_sgiaudio='#undef USE_SGI_AUDIO'
5173 _noaomodules="sgi $_noaomodules"
5175 echores "$_sgiaudio"
5176 fi #if irix
5179 echocheck "VCD support"
5180 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5181 _inputmodules="vcd $_inputmodules"
5182 _def_vcd='#define HAVE_VCD 1'
5183 _vcd="yes"
5184 else
5185 _def_vcd='#undef HAVE_VCD'
5186 _noinputmodules="vcd $_noinputmodules"
5187 _res_comment="not supported on this OS"
5188 _vcd="no"
5190 echores "$_vcd"
5194 echocheck "dvdread"
5195 if test "$_dvdread_internal" = auto ; then
5196 _dvdread_internal=no
5197 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5198 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5199 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5200 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5201 _dvdread_internal=yes
5202 _dvdread=yes
5203 _res_comment="internal"
5205 elif test "$_dvdread" = auto ; then
5206 _dvdread=no
5207 if test "$_dl" = yes; then
5208 cat > $TMPC << EOF
5209 #include <inttypes.h>
5210 #include <dvdread/dvd_reader.h>
5211 #include <dvdread/ifo_types.h>
5212 #include <dvdread/ifo_read.h>
5213 #include <dvdread/nav_read.h>
5214 int main(void) { return 0; }
5216 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5217 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5221 if test "$_dvdread_internal" = yes; then
5222 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5223 _def_dvdread='#define USE_DVDREAD 1'
5224 _inputmodules="dvdread(internal) $_inputmodules"
5225 _largefiles=yes
5226 elif test "$_dvdread" = yes; then
5227 _def_dvdread='#define USE_DVDREAD 1'
5228 _largefiles=yes
5229 _ld_extra="$_ld_extra -ldvdread"
5230 _inputmodules="dvdread(external) $_inputmodules"
5231 _res_comment="external"
5232 else
5233 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5234 _def_dvdread='#undef USE_DVDREAD'
5235 _noinputmodules="dvdread $_noinputmodules"
5237 echores "$_dvdread"
5240 echocheck "internal libdvdcss"
5241 if test "$_libdvdcss_internal" = auto ; then
5242 _libdvdcss_internal=no
5243 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5245 if test "$_libdvdcss_internal" = yes ; then
5246 if linux || netbsd || openbsd || bsdos ; then
5247 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5248 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5249 elif freebsd ; then
5250 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5251 elif darwin ; then
5252 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5253 _ld_extra="$_ld_extra -framework IOKit"
5255 _inputmodules="libdvdcss(internal) $_inputmodules"
5256 _largefiles=yes
5257 else
5258 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5260 echores "$_libdvdcss_internal"
5263 echocheck "cdparanoia"
5264 if test "$_cdparanoia" = auto ; then
5265 cat > $TMPC <<EOF
5266 #include <cdda_interface.h>
5267 #include <cdda_paranoia.h>
5268 // This need a better test. How ?
5269 int main(void) {
5270 void *test = cdda_verbose_set;
5271 return test == (void *)1;
5274 _cdparanoia=no
5275 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5276 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5277 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5278 done
5280 if test "$_cdparanoia" = yes ; then
5281 _cdda='yes'
5282 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5283 openbsd && _ld_extra="$_ld_extra -lutil"
5285 echores "$_cdparanoia"
5288 echocheck "libcdio"
5289 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5290 cat > $TMPC << EOF
5291 #include <stdio.h>
5292 #include <cdio/version.h>
5293 #include <cdio/cdda.h>
5294 #include <cdio/paranoia.h>
5295 int main()
5297 void *test = cdda_verbose_set;
5298 printf("%s\n", CDIO_VERSION);
5299 return test == (void *)1;
5303 _libcdio=no
5304 for _ld_tmp in "" "-lwinmm" ; do
5305 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5306 cc_check $_ld_tmp $_ld_lm \
5307 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5308 done
5309 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5310 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5311 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5312 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5313 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5316 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5317 _cdda='yes'
5318 _def_libcdio='#define HAVE_LIBCDIO'
5319 _def_havelibcdio='yes'
5320 else
5321 if test "$_cdparanoia" = yes ; then
5322 _res_comment="using cdparanoia"
5324 _def_libcdio='#undef HAVE_LIBCDIO'
5325 _def_havelibcdio='no'
5327 echores "$_libcdio"
5329 if test "$_cdda" = yes ; then
5330 test $_cddb = auto && test $_network = yes && not darwin && _cddb=yes
5331 _def_cdparanoia='#define HAVE_CDDA'
5332 _inputmodules="cdda $_inputmodules"
5333 else
5334 _def_cdparanoia='#undef HAVE_CDDA'
5335 _noinputmodules="cdda $_noinputmodules"
5338 if test "$_cddb" = yes ; then
5339 _def_cddb='#define HAVE_CDDB'
5340 _inputmodules="cddb $_inputmodules"
5341 else
5342 _cddb=no
5343 _def_cddb='#undef HAVE_CDDB'
5344 _noinputmodules="cddb $_noinputmodules"
5347 echocheck "bitmap font support"
5348 if test "$_bitmap_font" = yes ; then
5349 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5350 else
5351 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5353 echores "$_bitmap_font"
5356 echocheck "freetype >= 2.0.9"
5358 # freetype depends on iconv
5359 if test "$_iconv" = no ; then
5360 _freetype=no
5361 _res_comment="iconv support needed"
5364 if test "$_freetype" = auto ; then
5365 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5366 cat > $TMPC << EOF
5367 #include <stdio.h>
5368 #include <ft2build.h>
5369 #include FT_FREETYPE_H
5370 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5371 #error "Need FreeType 2.0.9 or newer"
5372 #endif
5373 int main()
5375 FT_Library library;
5376 FT_Int major=-1,minor=-1,patch=-1;
5377 int err=FT_Init_FreeType(&library);
5378 if(err){
5379 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5380 exit(err);
5382 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5383 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5384 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5385 (int)major,(int)minor,(int)patch );
5386 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5387 printf("Library and header version mismatch! Fix it in your distribution!\n");
5388 exit(1);
5390 return 0;
5393 _freetype=no
5394 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5395 else
5396 _freetype=no
5399 if test "$_freetype" = yes ; then
5400 _def_freetype='#define HAVE_FREETYPE'
5401 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5402 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5403 else
5404 _def_freetype='#undef HAVE_FREETYPE'
5406 echores "$_freetype"
5408 if test "$_freetype" = no ; then
5409 _fontconfig=no
5410 _res_comment="freetype support needed"
5412 echocheck "fontconfig"
5413 if test "$_fontconfig" = auto ; then
5414 cat > $TMPC << EOF
5415 #include <stdio.h>
5416 #include <fontconfig/fontconfig.h>
5417 int main()
5419 int err = FcInit();
5420 if(err == FcFalse){
5421 printf("Couldn't initialize fontconfig lib\n");
5422 exit(err);
5424 return 0;
5428 _fontconfig=no
5429 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5430 _ld_tmp="-lfontconfig $_ld_tmp"
5431 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5432 done
5433 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5434 _inc_tmp=`$_pkg_config --cflags fontconfig`
5435 _ld_tmp=`$_pkg_config --libs fontconfig`
5436 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5437 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5440 if test "$_fontconfig" = yes ; then
5441 _def_fontconfig='#define HAVE_FONTCONFIG'
5442 else
5443 _def_fontconfig='#undef HAVE_FONTCONFIG'
5445 echores "$_fontconfig"
5448 echocheck "SSA/ASS support"
5449 # libass depends on FreeType
5450 if test "$_freetype" = no ; then
5451 _ass=no
5452 _res_comment="FreeType support needed"
5455 if test "$_ass" = auto ; then
5456 cat > $TMPC << EOF
5457 #include <ft2build.h>
5458 #include FT_FREETYPE_H
5459 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5460 #error "Need FreeType 2.1.8 or newer"
5461 #endif
5462 int main() { return 0; }
5464 _ass=no
5465 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5466 if test "$_ass" = no ; then
5467 _res_comment="FreeType >= 2.1.8 needed"
5470 if test "$_ass" = yes ; then
5471 _def_ass='#define USE_ASS'
5472 else
5473 _def_ass='#undef USE_ASS'
5475 echores "$_ass"
5478 echocheck "fribidi with charsets"
5479 if test "$_fribidi" = auto ; then
5480 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5481 cat > $TMPC << EOF
5482 #include <stdio.h>
5483 /* workaround for fribidi 0.10.4 and below */
5484 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5485 #include <fribidi/fribidi.h>
5486 int main()
5488 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5489 printf("Fribidi headers are not consistents with the library!\n");
5490 exit(1);
5492 return 0;
5495 _fribidi=no
5496 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5497 else
5498 _fribidi=no
5501 if test "$_fribidi" = yes ; then
5502 _def_fribidi='#define USE_FRIBIDI'
5503 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5504 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5505 else
5506 _def_fribidi='#undef USE_FRIBIDI'
5508 echores "$_fribidi"
5511 echocheck "ENCA"
5512 if test "$_enca" = auto ; then
5513 cat > $TMPC << EOF
5514 #include <enca.h>
5515 int main()
5517 const char **langs;
5518 size_t langcnt;
5519 langs = enca_get_languages(&langcnt);
5520 return 0;
5523 _enca=no
5524 cc_check -lenca $_ld_lm && _enca=yes
5526 if test "$_enca" = yes ; then
5527 _def_enca='#define HAVE_ENCA 1'
5528 _ld_extra="$_ld_extra -lenca"
5529 else
5530 _def_enca='#undef HAVE_ENCA'
5532 echores "$_enca"
5535 echocheck "zlib"
5536 cat > $TMPC << EOF
5537 #include <zlib.h>
5538 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5540 _zlib=no
5541 cc_check -lz && _zlib=yes
5542 if test "$_zlib" = yes ; then
5543 _def_zlib='#define HAVE_ZLIB 1'
5544 _ld_extra="$_ld_extra -lz"
5545 else
5546 _def_zlib='#undef HAVE_ZLIB'
5547 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5548 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5550 echores "$_zlib"
5553 echocheck "RTC"
5554 if test "$_rtc" = auto ; then
5555 cat > $TMPC << EOF
5556 #include <sys/ioctl.h>
5557 #ifdef __linux__
5558 #include <linux/rtc.h>
5559 #else
5560 #include <rtc.h>
5561 #define RTC_PIE_ON RTCIO_PIE_ON
5562 #endif
5563 int main(void) { return RTC_PIE_ON; }
5565 _rtc=no
5566 cc_check && _rtc=yes
5567 ppc && _rtc=no
5569 if test "$_rtc" = yes ; then
5570 _def_rtc='#define HAVE_RTC 1'
5571 else
5572 _def_rtc='#undef HAVE_RTC'
5574 echores "$_rtc"
5577 echocheck "liblzo2 support"
5578 if test "$_liblzo" = auto ; then
5579 _liblzo=no
5580 cat > $TMPC << EOF
5581 #include <lzo/lzo1x.h>
5582 int main(void) { lzo_init();return 0; }
5584 cc_check -llzo2 && _liblzo=yes
5586 if test "$_liblzo" = yes ; then
5587 _def_liblzo='#define USE_LIBLZO 1'
5588 _ld_extra="$_ld_extra -llzo2"
5589 _codecmodules="liblzo $_codecmodules"
5590 else
5591 _def_liblzo='#undef USE_LIBLZO'
5592 _nocodecmodules="liblzo $_nocodecmodules"
5594 echores "$_liblzo"
5597 echocheck "mad support"
5598 if test "$_mad" = auto ; then
5599 _mad=no
5600 cat > $TMPC << EOF
5601 #include <mad.h>
5602 int main(void) { return 0; }
5604 cc_check -lmad && _mad=yes
5606 if test "$_mad" = yes ; then
5607 _def_mad='#define USE_LIBMAD 1'
5608 _ld_extra="$_ld_extra -lmad"
5609 _codecmodules="libmad $_codecmodules"
5610 else
5611 _def_mad='#undef USE_LIBMAD'
5612 _nocodecmodules="libmad $_nocodecmodules"
5614 echores "$_mad"
5616 echocheck "Twolame"
5617 if test "$_twolame" = auto ; then
5618 cat > $TMPC <<EOF
5619 #include <twolame.h>
5620 int main(void) { twolame_init(); return 0; }
5622 _twolame=no
5623 cc_check -ltwolame $_ld_lm && _twolame=yes
5625 if test "$_twolame" = yes ; then
5626 _def_twolame='#define HAVE_TWOLAME 1'
5627 _libs_mencoder="$_libs_mencoder -ltwolame"
5628 _codecmodules="twolame $_codecmodules"
5629 else
5630 _def_twolame='#undef HAVE_TWOLAME'
5631 _nocodecmodules="twolame $_nocodecmodules"
5633 echores "$_twolame"
5635 echocheck "Toolame"
5636 if test "$_toolame" = auto ; then
5637 _toolame=no
5638 if test "$_twolame" = yes ; then
5639 _res_comment="disabled by twolame"
5640 else
5641 cat > $TMPC <<EOF
5642 #include <toolame.h>
5643 int main(void) { toolame_init(); return 0; }
5645 cc_check -ltoolame $_ld_lm && _toolame=yes
5648 if test "$_toolame" = yes ; then
5649 _def_toolame='#define HAVE_TOOLAME 1'
5650 _libs_mencoder="$_libs_mencoder -ltoolame"
5651 _codecmodules="toolame $_codecmodules"
5652 else
5653 _def_toolame='#undef HAVE_TOOLAME'
5654 _nocodecmodules="toolame $_nocodecmodules"
5656 if test "$_toolamedir" ; then
5657 _res_comment="using $_toolamedir"
5659 echores "$_toolame"
5661 echocheck "OggVorbis support"
5662 if test "$_tremor_internal" = yes; then
5663 _libvorbis=no
5664 elif test "$_tremor_external" = auto; then
5665 _tremor_external=no
5666 cat > $TMPC << EOF
5667 #include <tremor/ivorbiscodec.h>
5668 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5670 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5672 if test "$_libvorbis" = auto; then
5673 _libvorbis=no
5674 cat > $TMPC << EOF
5675 #include <vorbis/codec.h>
5676 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5678 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5680 if test "$_tremor_internal" = yes ; then
5681 _vorbis=yes
5682 _def_vorbis='#define HAVE_OGGVORBIS 1'
5683 _def_tremor='#define TREMOR 1'
5684 _codecmodules="tremor(internal) $_codecmodules"
5685 _res_comment="internal Tremor"
5686 if test "$_tremor_low" = yes ; then
5687 _res_comment="internal low accuracy Tremor"
5689 elif test "$_tremor_external" = yes ; then
5690 _vorbis=yes
5691 _def_vorbis='#define HAVE_OGGVORBIS 1'
5692 _def_tremor='#define TREMOR 1'
5693 _codecmodules="tremor(external) $_codecmodules"
5694 _res_comment="external Tremor"
5695 _ld_extra="$_ld_extra -logg -lvorbisidec"
5696 elif test "$_libvorbis" = yes ; then
5697 _vorbis=yes
5698 _def_vorbis='#define HAVE_OGGVORBIS 1'
5699 _codecmodules="libvorbis $_codecmodules"
5700 _res_comment="libvorbis"
5701 _ld_extra="$_ld_extra -lvorbis -logg"
5702 else
5703 _vorbis=no
5704 _nocodecmodules="libvorbis $_nocodecmodules"
5706 if test "$_libvorbis" = no ; then
5707 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5708 _libavmuxers=`echo $_libavmuxers | sed -e s/OGG_MUXER// `
5710 echores "$_vorbis"
5712 echocheck "libspeex (version >= 1.1 required)"
5713 if test "$_speex" = auto ; then
5714 _speex=no
5715 cat > $TMPC << EOF
5716 #include <speex/speex.h>
5717 int main(void) {
5718 SpeexBits bits;
5719 void *dec;
5720 speex_decode_int(dec, &bits, dec);
5723 cc_check -lspeex $_ld_lm && _speex=yes
5725 if test "$_speex" = yes ; then
5726 _def_speex='#define HAVE_SPEEX 1'
5727 _ld_extra="$_ld_extra -lspeex"
5728 _codecmodules="speex $_codecmodules"
5729 else
5730 _def_speex='#undef HAVE_SPEEX'
5731 _nocodecmodules="speex $_nocodecmodules"
5733 echores "$_speex"
5735 echocheck "OggTheora support"
5736 if test "$_theora" = auto ; then
5737 _theora=no
5738 cat > $TMPC << EOF
5739 #include <theora/theora.h>
5740 #include <string.h>
5741 int main(void)
5743 /* theora is in flux, make sure that all interface routines and
5744 * datatypes exist and work the way we expect it, so we don't break
5745 * mplayer */
5746 ogg_packet op;
5747 theora_comment tc;
5748 theora_info inf;
5749 theora_state st;
5750 yuv_buffer yuv;
5751 int r;
5752 double t;
5754 theora_info_init (&inf);
5755 theora_comment_init (&tc);
5757 return 0;
5759 /* we don't want to execute this kind of nonsense; just for making sure
5760 * that compilation works... */
5761 memset(&op, 0, sizeof(op));
5762 r = theora_decode_header (&inf, &tc, &op);
5763 r = theora_decode_init (&st, &inf);
5764 t = theora_granule_time (&st, op.granulepos);
5765 r = theora_decode_packetin (&st, &op);
5766 r = theora_decode_YUVout (&st, &yuv);
5767 theora_clear (&st);
5769 return 0;
5772 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5773 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5774 && _theora=yes && break
5775 done
5776 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5777 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5778 cc_check -I. tremor/bitwise.c $_ld_theora \
5779 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5780 done
5783 if test "$_theora" = yes ; then
5784 _def_theora='#define HAVE_OGGTHEORA 1'
5785 _codecmodules="libtheora $_codecmodules"
5786 # when --enable-theora is forced, we'd better provide a probably sane
5787 # $_ld_theora than nothing
5788 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5789 else
5790 _def_theora='#undef HAVE_OGGTHEORA'
5791 _nocodecmodules="libtheora $_nocodecmodules"
5793 echores "$_theora"
5795 echocheck "mp3lib support"
5796 if test "$_mp3lib" = yes ; then
5797 _def_mp3lib='#define USE_MP3LIB 1'
5798 _codecmodules="mp3lib $_codecmodules"
5799 else
5800 _def_mp3lib='#undef USE_MP3LIB'
5801 _nocodecmodules="mp3lib $_nocodecmodules"
5803 echores "$_mp3lib"
5805 echocheck "liba52 support"
5806 if test "$_liba52" = yes ; then
5807 _def_liba52='#define USE_LIBA52 1'
5808 _codecmodules="liba52 $_codecmodules"
5809 else
5810 _def_liba52='#undef USE_LIBA52'
5811 _nocodecmodules="liba52 $_nocodecmodules"
5813 echores "$_liba52"
5816 echocheck "libmpeg2 support"
5817 if test "$_libmpeg2" = yes ; then
5818 _def_libmpeg2='#define USE_LIBMPEG2 1'
5819 _codecmodules="libmpeg2 $_codecmodules"
5820 else
5821 _def_libmpeg2='#undef USE_LIBMPEG2'
5822 _nocodecmodules="libmpeg2 $_nocodecmodules"
5824 echores "$_libmpeg2"
5826 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5827 if test "$_musepack" = auto ; then
5828 _musepack=no
5829 cat > $TMPC << EOF
5830 #include <mpcdec/mpcdec.h>
5831 int main(void) {
5832 mpc_streaminfo info;
5833 mpc_decoder decoder;
5834 mpc_decoder_set_streaminfo(&decoder, &info);
5835 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5838 cc_check -lmpcdec $_ld_lm && _musepack=yes
5840 if test "$_musepack" = yes ; then
5841 _def_musepack='#define HAVE_MUSEPACK 1'
5842 _ld_extra="$_ld_extra -lmpcdec"
5843 _codecmodules="musepack $_codecmodules"
5844 else
5845 _def_musepack='#undef HAVE_MUSEPACK'
5846 _nocodecmodules="musepack $_nocodecmodules"
5848 echores "$_musepack"
5851 echocheck "FAAC (AAC encoder) support"
5852 if test "$_faac" = auto ; then
5853 cat > $TMPC <<EOF
5854 #include <inttypes.h>
5855 #include <faac.h>
5856 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5858 _faac=no
5859 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5860 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
5861 done
5863 if test "$_faac" = yes ; then
5864 _def_faac="#define HAVE_FAAC 1"
5865 if echo $_libavencoders | grep -q FAAC ; then
5866 _lavc_faac=yes
5867 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
5868 _libs_mplayer="$_libs_mplayer $_ld_faac"
5869 else
5870 _lavc_faac=no
5871 _def_lavc_faac="#undef CONFIG_LIBFAAC"
5873 _codecmodules="faac $_codecmodules"
5874 else
5875 _def_faac="#undef HAVE_FAAC"
5876 _nocodecmodules="faac $_nocodecmodules"
5877 _libavencoders=`echo $_libavencoders | sed -e s/LIBFAAC_ENCODER// `
5879 echores "$_faac (in libavcodec: $_lavc_faac)"
5882 echocheck "FAAD2 (AAC) support"
5883 if test "$_faad_internal" = auto ; then
5884 if x86_32 && test cc_vendor=gnu; then
5885 case $cc_version in
5886 3.1*|3.2) # ICE/insn with these versions
5887 _faad_internal=no
5888 _res_comment="broken gcc"
5891 _faad_internal=yes
5893 esac
5894 else
5895 _faad_internal=yes
5897 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
5898 _faad_external=no
5899 cat > $TMPC << EOF
5900 #include <faad.h>
5901 #ifndef FAAD_MIN_STREAMSIZE
5902 #error Too old version
5903 #endif
5904 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5906 cc_check -lfaad $_ld_lm && _faad_external=yes
5909 if test "$_faad_internal" = yes ; then
5910 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
5911 _faad=yes
5912 _res_comment="internal floating-point"
5913 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
5914 elif test "$_faad_external" = yes ; then
5915 _faad=yes
5916 _ld_extra="$_ld_extra -lfaad"
5917 else
5918 _def_faad_internal="#undef USE_FAAD_INTERNAL"
5919 _faad=no
5922 if test "$_faad" = yes ; then
5923 _def_faad='#define HAVE_FAAD 1'
5924 _codecmodules="faad2 $_codecmodules"
5925 else
5926 _def_faad='#undef HAVE_FAAD'
5927 _nocodecmodules="faad2 $_nocodecmodules"
5929 echores "$_faad"
5932 echocheck "LADSPA plugin support"
5933 if test "$_ladspa" = auto ; then
5934 cat > $TMPC <<EOF
5935 #include <stdio.h>
5936 #include <ladspa.h>
5937 int main(void) {
5938 const LADSPA_Descriptor *ld = NULL;
5939 return 0;
5942 _ladspa=no
5943 cc_check && _ladspa=yes
5945 if test "$_ladspa" = yes; then
5946 _def_ladspa="#define HAVE_LADSPA"
5947 _afsrc="$_afsrc af_ladspa.c"
5948 _afmodules="ladspa $_afmodules"
5949 else
5950 _def_ladspa="#undef HAVE_LADSPA"
5951 _noafmodules="ladspa $_noafmodules"
5953 echores "$_ladspa"
5956 if test -z "$_codecsdir" ; then
5957 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5958 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5959 if test -d "$dir" ; then
5960 _codecsdir="$dir"
5961 break;
5963 done
5965 # Fall back on default directory.
5966 if test -z "$_codecsdir" ; then
5967 _codecsdir="$_libdir/codecs"
5968 mingw32 && _codecsdir="codecs"
5972 echocheck "Win32 codecs"
5973 if test "$_win32dll" = auto ; then
5974 _win32dll=no
5975 if x86_32 && not qnx; then
5976 _win32dll=yes
5979 if test "$_win32dll" = yes ; then
5980 _def_win32dll='#define USE_WIN32DLL 1'
5981 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
5982 _res_comment="using $_win32codecsdir"
5983 if not win32 ; then
5984 _def_win32_loader='#define WIN32_LOADER 1'
5985 else
5986 _ld_extra="$_ld_extra -ladvapi32 -lole32"
5987 _res_comment="using native windows"
5989 _codecmodules="win32 $_codecmodules"
5990 else
5991 _def_win32dll='#undef USE_WIN32DLL'
5992 _def_win32_loader='#undef WIN32_LOADER'
5993 _nocodecmodules="win32 $_nocodecmodules"
5995 echores "$_win32dll"
5998 echocheck "XAnim codecs"
5999 if test "$_xanim" = auto ; then
6000 _xanim=no
6001 _res_comment="dynamic loader support needed"
6002 if test "$_dl" = yes ; then
6003 _xanim=yes
6006 if test "$_xanim" = yes ; then
6007 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6008 _def_xanim='#define USE_XANIM 1'
6009 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6010 _codecmodules="xanim $_codecmodules"
6011 _res_comment="using $_xanimcodecsdir"
6012 else
6013 _def_xanim='#undef USE_XANIM'
6014 _def_xanim_path='#undef XACODEC_PATH'
6015 _nocodecmodules="xanim $_nocodecmodules"
6017 echores "$_xanim"
6020 echocheck "RealPlayer codecs"
6021 if test "$_real" = auto ; then
6022 _real=no
6023 _res_comment="dynamic loader support needed"
6024 if test "$_dl" = yes || test "$_win32dll" = yes &&
6025 (linux || freebsd || netbsd || win32 || darwin) ; then
6026 _real=yes
6029 if test "$_real" = yes ; then
6030 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6031 _def_real='#define USE_REALCODECS 1'
6032 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6033 _codecmodules="real $_codecmodules"
6034 _res_comment="using $_realcodecsdir"
6035 else
6036 _def_real='#undef USE_REALCODECS'
6037 _def_real_path="#undef REALCODEC_PATH"
6038 _nocodecmodules="real $_nocodecmodules"
6040 echores "$_real"
6043 echocheck "LIVE555 Streaming Media libraries"
6044 if test "$_live" = auto && test "$_network" = yes ; then
6045 cat > $TMPCPP << EOF
6046 #include <liveMedia.hh>
6047 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6048 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6049 #endif
6050 int main(void) {}
6053 _live=no
6054 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6055 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6056 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6057 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6058 $_livelibdir/groupsock/libgroupsock.a \
6059 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6060 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6061 $_ld_extra -lstdc++" \
6062 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6063 -I$_livelibdir/UsageEnvironment/include \
6064 -I$_livelibdir/BasicUsageEnvironment/include \
6065 -I$_livelibdir/groupsock/include" && \
6066 _live=yes && break
6067 done
6068 if test "$_live" != yes ; then
6069 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6070 _live_dist=yes
6074 if test "$_live" = yes && test "$_network" = yes ; then
6075 _res_comment="using $_livelibdir"
6076 _def_live='#define STREAMING_LIVE555 1'
6077 _inputmodules="live555 $_inputmodules"
6078 elif test "$_live_dist" = yes && test "$_network" = yes ; then
6079 _res_comment="using distribution version"
6080 _live="yes"
6081 _def_live='#define STREAMING_LIVE555 1'
6082 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6083 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6084 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6085 _inputmodules="live555 $_inputmodules"
6086 else
6087 _def_live='#undef STREAMING_LIVE555'
6088 _noinputmodules="live555 $_noinputmodules"
6090 echores "$_live"
6093 echocheck "FFmpeg libavutil"
6094 if test "$_libavutil_a" = auto ; then
6095 if test -d libavutil ; then
6096 _libavutil_a=yes
6097 _res_comment="static"
6098 else
6099 die "MPlayer will not compile without libavutil in the source tree."
6101 elif test "$_libavutil_so" = auto ; then
6102 _libavutil_so=no
6103 cat > $TMPC << EOF
6104 #include <ffmpeg/common.h>
6105 int main(void) { ff_gcd(1,1); return 0; }
6107 if $_pkg_config --exists libavutil ; then
6108 _inc_libavutil=`$_pkg_config --cflags libavutil`
6109 _ld_tmp=`$_pkg_config --libs libavutil`
6110 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6111 && _libavutil_so=yes
6112 elif cc_check -lavutil $_ld_lm ; then
6113 _ld_extra="$_ld_extra -lavutil"
6114 _libavutil_so=yes
6115 _res_comment="using libavutil.so, but static libavutil is recommended"
6118 _libavutil=no
6119 _def_libavutil='#undef USE_LIBAVUTIL'
6120 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6121 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6122 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6123 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6124 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6125 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6126 # neither static nor shared libavutil is available, but it is mandatory ...
6127 if test "$_libavutil" = no ; then
6128 die "You need static or shared libavutil, MPlayer will not compile without!"
6130 echores "$_libavutil"
6132 echocheck "FFmpeg libavcodec"
6133 if test "$_libavcodec_a" = auto ; then
6134 _libavcodec_a=no
6135 if test -d libavcodec && test -f libavcodec/utils.c ; then
6136 _libavcodec_a="yes"
6137 _res_comment="static"
6139 elif test "$_libavcodec_so" = auto ; then
6140 _libavcodec_so=no
6141 _res_comment="libavcodec.so is discouraged over static libavcodec"
6142 cat > $TMPC << EOF
6143 #include <ffmpeg/avcodec.h>
6144 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6146 if $_pkg_config --exists libavcodec ; then
6147 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6148 _ld_tmp=`$_pkg_config --libs libavcodec`
6149 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6150 && _libavcodec_so=yes
6151 elif cc_check -lavcodec $_ld_lm ; then
6152 _ld_extra="$_ld_extra -lavcodec"
6153 _libavcodec_so=yes
6154 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6157 _libavcodec=no
6158 _def_libavcodec='#undef USE_LIBAVCODEC'
6159 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6160 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6161 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6162 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6163 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6164 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6165 test "$_libavcodec_mpegaudio_hp" = yes \
6166 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6167 if test "$_libavcodec_a" = yes ; then
6168 _codecmodules="libavcodec $_codecmodules"
6169 elif test "$_libavcodec_so" = yes ; then
6170 _codecmodules="libavcodec.so $_codecmodules"
6171 else
6172 _nocodecmodules="libavcodec $_nocodecmodules"
6174 echores "$_libavcodec"
6176 echocheck "FFmpeg libavformat"
6177 if test "$_libavformat_a" = auto ; then
6178 _libavformat_a=no
6179 if test -d libavformat && test -f libavformat/utils.c ; then
6180 _libavformat_a=yes
6181 _res_comment="static"
6183 elif test "$_libavformat_so" = auto ; then
6184 _libavformat_so=no
6185 cat > $TMPC <<EOF
6186 #include <ffmpeg/avformat.h>
6187 #include <ffmpeg/opt.h>
6188 int main(void) { av_alloc_format_context(); return 0; }
6190 if $_pkg_config --exists libavformat ; then
6191 _inc_libavformat=`$_pkg_config --cflags libavformat`
6192 _ld_tmp=`$_pkg_config --libs libavformat`
6193 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6194 && _libavformat_so=yes
6195 elif cc_check $_ld_lm -lavformat ; then
6196 _ld_extra="$_ld_extra -lavformat"
6197 _libavformat_so=yes
6198 _res_comment="using libavformat.so, but static libavformat is recommended"
6201 _libavformat=no
6202 _def_libavformat='#undef USE_LIBAVFORMAT'
6203 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6204 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6205 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6206 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6207 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6208 test "$_libavformat_so" = yes \
6209 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6210 echores "$_libavformat"
6212 echocheck "FFmpeg libpostproc"
6213 if test "$_libpostproc_a" = auto ; then
6214 _libpostproc_a=no
6215 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6216 _libpostproc_a='yes'
6217 _res_comment="static"
6219 elif test "$_libpostproc_so" = auto ; then
6220 _libpostproc_so=no
6221 cat > $TMPC << EOF
6222 #define USE_LIBPOSTPROC 1
6223 #include <inttypes.h>
6224 #include <postproc/postprocess.h>
6225 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6227 if cc_check -lpostproc $_ld_lm ; then
6228 _ld_extra="$_ld_extra -lpostproc"
6229 _libpostproc_so=yes
6230 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6233 _libpostproc=no
6234 _def_libpostproc='#undef USE_LIBPOSTPROC'
6235 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6236 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6237 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6238 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6239 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6240 test "$_libpostproc_so" = yes \
6241 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6242 echores "$_libpostproc"
6245 echocheck "md5sum support"
6246 if test "$_md5sum" = yes; then
6247 _def_md5sum="#define HAVE_MD5SUM"
6248 _vosrc="$_vosrc vo_md5sum.c"
6249 _vomodules="md5sum $_vomodules"
6250 else
6251 _def_md5sum="#undef HAVE_MD5SUM"
6252 _novomodules="md5sum $_novomodules"
6254 echores "$_md5sum"
6256 echocheck "libamr narrowband"
6257 if test "$_libamr_nb" = auto ; then
6258 _libamr_nb=no
6259 cat > $TMPC << EOF
6260 #include <amrnb/interf_dec.h>
6261 int main(void) { Speech_Decode_Frame_init(); return 0; }
6263 cc_check -lamrnb && _libamr_nb=yes
6264 if test "$_libavcodec_a" != yes ; then
6265 _libamr_nb=no
6266 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6269 if test "$_libamr_nb" = yes ; then
6270 _libamr=yes
6271 _ld_extra="$_ld_extra -lamrnb"
6272 _def_libamr='#define CONFIG_LIBAMR 1'
6273 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6274 _codecmodules="libamr_nb $_codecmodules"
6275 else
6276 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6277 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6278 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6279 _nocodecmodules="libamr_nb $_nocodecmodules"
6281 echores "$_libamr_nb"
6284 echocheck "libamr wideband"
6285 if test "$_libamr_wb" = auto ; then
6286 _libamr_wb=no
6287 cat > $TMPC << EOF
6288 #include <amrwb/dec_if.h>
6289 int main(void) { D_IF_init(); return 0; }
6291 cc_check -lamrwb && _libamr_wb=yes
6292 if test "$_libavcodec_a" != yes ; then
6293 _libamr_wb=no
6294 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6297 if test "$_libamr_wb" = yes ; then
6298 _libamr=yes
6299 _ld_extra="$_ld_extra -lamrwb"
6300 _def_libamr='#define CONFIG_LIBAMR 1'
6301 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6302 _codecmodules="libamr_wb $_codecmodules"
6303 else
6304 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6305 _nocodecmodules="libamr_wb $_nocodecmodules"
6306 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6307 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6309 echores "$_libamr_wb"
6311 echocheck "libdv-0.9.5+"
6312 if test "$_libdv" = auto ; then
6313 _libdv=no
6314 cat > $TMPC <<EOF
6315 #include <libdv/dv.h>
6316 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6318 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6320 if test "$_libdv" = yes ; then
6321 _def_libdv='#define HAVE_LIBDV095 1'
6322 _ld_extra="$_ld_extra -ldv"
6323 _codecmodules="libdv $_codecmodules"
6324 else
6325 _def_libdv='#undef HAVE_LIBDV095'
6326 _nocodecmodules="libdv $_nocodecmodules"
6328 echores "$_libdv"
6330 echocheck "zr"
6331 if test "$_zr" = auto ; then
6332 #36067's seem to identify themselves as 36057PQC's, so the line
6333 #below should work for 36067's and 36057's.
6334 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6335 _zr=yes
6336 else
6337 _zr=no
6340 if test "$_zr" = yes ; then
6341 if test "$_libavcodec_a" = yes ; then
6342 _def_zr='#define HAVE_ZR 1'
6343 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6344 _vomodules="zr zr2 $_vomodules"
6345 else
6346 _res_comment="libavcodec (static) is required by zr, sorry"
6347 _novomodules="zr $_novomodules"
6348 _def_zr='#undef HAVE_ZR'
6350 else
6351 _def_zr='#undef HAVE_ZR'
6352 _novomodules="zr zr2 $_novomodules"
6354 echores "$_zr"
6356 echocheck "bl"
6357 if test "$_bl" = yes ; then
6358 _def_bl='#define HAVE_BL 1'
6359 _vosrc="$_vosrc vo_bl.c"
6360 _vomodules="bl $_vomodules"
6361 else
6362 _def_bl='#undef HAVE_BL'
6363 _novomodules="bl $_novomodules"
6365 echores "$_bl"
6368 echocheck "XviD"
6369 if test "$_xvid" = auto ; then
6370 _xvid=no
6371 cat > $TMPC << EOF
6372 #include <xvid.h>
6373 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6375 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6376 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6377 done
6380 if test "$_xvid" = yes ; then
6381 _def_xvid='#define HAVE_XVID4 1'
6382 _codecmodules="xvid $_codecmodules"
6383 else
6384 _def_xvid='#undef HAVE_XVID4'
6385 _nocodecmodules="xvid $_nocodecmodules"
6386 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6388 echores "$_xvid"
6390 if test "$_xvid" = yes ; then
6391 echocheck "XviD two pass plugin"
6392 cat > $TMPC << EOF
6393 #include <xvid.h>
6394 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6396 if cc_check ; then
6397 _lavc_xvid=yes
6398 _def_lavc_xvid='#define CONFIG_XVID 1'
6399 else
6400 _lavc_xvid=no
6401 _def_lavc_xvid='#undef CONFIG_XVID'
6403 echores "$_lavc_xvid"
6407 echocheck "x264"
6408 if test "$_x264" = auto ; then
6409 cat > $TMPC << EOF
6410 #include <inttypes.h>
6411 #include <x264.h>
6412 #if X264_BUILD < 53
6413 #error We do not support old versions of x264. Get the latest from SVN.
6414 #endif
6415 int main(void) { x264_encoder_open((void*)0); return 0; }
6417 _x264=no
6418 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6419 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6420 done
6423 if test "$_x264" = yes ; then
6424 _x264=yes
6425 _def_x264='#define HAVE_X264 1'
6426 _codecmodules="x264 $_codecmodules"
6427 if echo $_libavencoders | grep -q X264 ; then
6428 _lavc_x264=yes
6429 _def_lavc_x264='#define CONFIG_X264 1'
6430 _libs_mplayer="$_libs_mplayer $_ld_x264"
6431 else
6432 _lavc_x264=no
6433 _def_lavc_x264='#undef CONFIG_X264'
6435 else
6436 _x264=no
6437 _lavc_x264=no
6438 _def_x264='#undef HAVE_X264'
6439 _def_lavc_x264='#undef CONFIG_X264'
6440 _nocodecmodules="x264 $_nocodecmodules"
6441 _libavencoders=`echo $_libavencoders | sed -e s/LIBX264_ENCODER// `
6443 echores "$_x264 (in libavcodec: $_lavc_x264)"
6446 echocheck "nut"
6447 if test "$_nut" = auto ; then
6448 cat > $TMPC << EOF
6449 #include <stdio.h>
6450 #include <stdlib.h>
6451 #include <inttypes.h>
6452 #include <libnut.h>
6453 int main(void) { (void)nut_error(0); return 0; }
6455 _nut=no
6456 cc_check -lnut && _nut=yes
6459 if test "$_nut" = yes ; then
6460 _def_nut='#define HAVE_LIBNUT 1'
6461 _ld_extra="$_ld_extra -lnut"
6462 else
6463 _def_nut='#undef HAVE_LIBNUT'
6464 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6466 echores "$_nut"
6469 # mencoder requires (optional) those libs: libmp3lame
6470 if test "$_mencoder" != no ; then
6472 echocheck "libmp3lame (for mencoder)"
6473 _mp3lame=no
6474 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6475 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6476 cat > $TMPC <<EOF
6477 #include <lame/lame.h>
6478 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; }
6480 # Note: libmp3lame usually depends on vorbis
6481 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6482 if test "$_mp3lame" = yes ; then
6483 _def_mp3lame="#define HAVE_MP3LAME"
6484 _ld_mp3lame=-lmp3lame
6485 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6486 cat > $TMPC << EOF
6487 #include <lame/lame.h>
6488 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6490 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6491 cat > $TMPC << EOF
6492 #include <lame/lame.h>
6493 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6495 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6496 if echo $_libavencoders | grep -q MP3LAME ; then
6497 _lavc_mp3lame=yes
6498 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6499 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6500 else
6501 _lavc_mp3lame=no
6502 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6504 else
6505 _def_mp3lame='#undef HAVE_MP3LAME'
6506 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6508 echores "$_mp3lame"
6512 echocheck "mencoder"
6513 _mencoder_flag='#undef HAVE_MENCODER'
6514 if test "$_mencoder" = yes ; then
6515 _mencoder_flag='#define HAVE_MENCODER'
6516 _def_muxers='#define CONFIG_MUXERS 1'
6517 else
6518 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6519 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6520 _libavmuxers=""
6522 echores "$_mencoder"
6524 echocheck "fastmemcpy"
6525 # fastmemcpy check is done earlier with tests of CPU & binutils features
6526 if test "$_fastmemcpy" = yes ; then
6527 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6528 else
6529 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6531 echores "$_fastmemcpy"
6533 echocheck "UniquE RAR File Library"
6534 if test "$_unrarlib" = yes ; then
6535 _def_unrarlib='#define USE_UNRARLIB 1'
6536 else
6537 _def_unrarlib='#undef USE_UNRARLIB'
6539 echores "$_unrarlib"
6541 echocheck "TV interface"
6542 if test "$_tv" = yes ; then
6543 _def_tv='#define USE_TV 1'
6544 _inputmodules="tv $_inputmodules"
6545 else
6546 _noinputmodules="tv $_noinputmodules"
6547 _def_tv='#undef USE_TV'
6549 echores "$_tv"
6552 if bsd; then
6553 echocheck "*BSD BT848 bt8xx header"
6554 _ioctl_bt848_h=no
6555 for file in "machine/ioctl_bt848.h" \
6556 "dev/bktr/ioctl_bt848.h" \
6557 "dev/video/bktr/ioctl_bt848.h" \
6558 "dev/ic/bt8xx.h" ; do
6559 cat > $TMPC <<EOF
6560 #include <sys/types.h>
6561 #include <$file>
6562 int main(void) {
6563 ioctl(0, TVTUNER_GETFREQ, 0);
6564 return 0;
6567 if cc_check ; then
6568 _ioctl_bt848_h=yes
6569 _ioctl_bt848_h_name="$file"
6570 break;
6572 done
6573 if test "$_ioctl_bt848_h" = yes ; then
6574 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6575 _res_comment="using $_ioctl_bt848_h_name"
6576 else
6577 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6579 echores "$_ioctl_bt848_h"
6581 echocheck "*BSD ioctl_meteor.h"
6582 _ioctl_meteor_h=no
6583 for file in "machine/ioctl_meteor.h" \
6584 "dev/bktr/ioctl_meteor.h" \
6585 "dev/video/bktr/ioctl_meteor.h" ; do
6586 cat > $TMPC <<EOF
6587 #include <sys/types.h>
6588 #include <$file>
6589 int main(void) {
6590 ioctl(0, METEORSINPUT, 0);
6591 return 0;
6594 if cc_check ; then
6595 _ioctl_meteor_h=yes
6596 _ioctl_meteor_h_name="$file"
6597 break;
6599 done
6600 if test "$_ioctl_meteor_h" = yes ; then
6601 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6602 _res_comment="using $_ioctl_meteor_h_name"
6603 else
6604 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6606 echores "$_ioctl_meteor_h"
6608 echocheck "*BSD BrookTree 848 TV interface"
6609 if test "$_tv_bsdbt848" = auto ; then
6610 _tv_bsdbt848=no
6611 if test "$_tv" = yes ; then
6612 cat > $TMPC <<EOF
6613 #include <sys/types.h>
6614 $_def_ioctl_meteor_h_name
6615 $_def_ioctl_bt848_h_name
6616 #ifdef IOCTL_METEOR_H_NAME
6617 #include IOCTL_METEOR_H_NAME
6618 #endif
6619 #ifdef IOCTL_BT848_H_NAME
6620 #include IOCTL_BT848_H_NAME
6621 #endif
6622 int main(void){
6623 ioctl(0, METEORSINPUT, 0);
6624 ioctl(0, TVTUNER_GETFREQ, 0);
6625 return 0;
6628 cc_check && _tv_bsdbt848=yes
6631 if test "$_tv_bsdbt848" = yes ; then
6632 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6633 _inputmodules="tv-bsdbt848 $_inputmodules"
6634 else
6635 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6636 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6638 echores "$_tv_bsdbt848"
6639 fi #if bsd
6642 echocheck "Video 4 Linux TV interface"
6643 if test "$_tv_v4l1" = auto ; then
6644 _tv_v4l1=no
6645 if test "$_tv" = yes && linux ; then
6646 cat > $TMPC <<EOF
6647 #include <stdlib.h>
6648 #include <linux/videodev.h>
6649 int main(void) { return 0; }
6651 cc_check && _tv_v4l1=yes
6654 if test "$_tv_v4l1" = yes ; then
6655 _audio_input=yes
6656 _tv_v4l=yes
6657 _def_tv_v4l='#define HAVE_TV_V4L 1'
6658 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6659 _inputmodules="tv-v4l $_inputmodules"
6660 else
6661 _noinputmodules="tv-v4l1 $_noinputmodules"
6662 _def_tv_v4l='#undef HAVE_TV_V4L'
6664 echores "$_tv_v4l1"
6667 echocheck "Video 4 Linux 2 TV interface"
6668 if test "$_tv_v4l2" = auto ; then
6669 _tv_v4l2=no
6670 if test "$_tv" = yes && linux ; then
6671 cat > $TMPC <<EOF
6672 #include <stdlib.h>
6673 #include <linux/types.h>
6674 #include <linux/videodev2.h>
6675 int main(void) { return 0; }
6677 cc_check && _tv_v4l2=yes
6680 if test "$_tv_v4l2" = yes ; then
6681 _audio_input=yes
6682 _tv_v4l=yes
6683 _def_tv_v4l='#define HAVE_TV_V4L 1'
6684 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6685 _inputmodules="tv-v4l2 $_inputmodules"
6686 else
6687 _noinputmodules="tv-v4l2 $_noinputmodules"
6688 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6690 echores "$_tv_v4l2"
6692 echocheck "TV teletext interface"
6693 if test "$_tv_teletext" = auto ; then
6694 _tv_teletext=no
6695 if test linux ; then
6696 cat > $TMPC <<EOF
6697 #include <stdlib.h>
6698 #include <libzvbi.h>
6699 int main(void) { return 0; }
6701 cc_check && _tv_teletext=yes
6704 if test "$_tv_teletext" = yes ; then
6705 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6706 _ld_extra="$_ld_extra -lzvbi"
6707 _inputmodules="tv-teletext $_inputmodules"
6708 else
6709 _noinputmodules="tv-teletext $_noinputmodules"
6710 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6712 echores "$_tv_teletext"
6715 echocheck "Radio interface"
6716 if test "$_radio" = yes ; then
6717 _def_radio='#define USE_RADIO 1'
6718 _inputmodules="radio $_inputmodules"
6719 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6720 _radio_capture=no
6722 if test "$_radio_capture" = yes ; then
6723 _audio_input=yes
6724 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6725 else
6726 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6728 else
6729 _noinputmodules="radio $_noinputmodules"
6730 _def_radio='#undef USE_RADIO'
6731 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6732 _radio_capture=no
6734 echores "$_radio"
6735 echocheck "Capture for Radio interface"
6736 echores "$_radio_capture"
6738 echocheck "Video 4 Linux 2 Radio interface"
6739 if test "$_radio_v4l2" = auto ; then
6740 _radio_v4l2=no
6741 if test "$_radio" = yes && linux ; then
6742 cat > $TMPC <<EOF
6743 #include <stdlib.h>
6744 #include <linux/types.h>
6745 #include <linux/videodev2.h>
6746 int main(void) { return 0; }
6748 cc_check && _radio_v4l2=yes
6751 if test "$_radio_v4l2" = yes ; then
6752 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6753 else
6754 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6756 echores "$_radio_v4l2"
6758 echocheck "Video 4 Linux Radio interface"
6759 if test "$_radio_v4l" = auto ; then
6760 _radio_v4l=no
6761 if test "$_radio" = yes && linux ; then
6762 cat > $TMPC <<EOF
6763 #include <stdlib.h>
6764 #include <linux/videodev.h>
6765 int main(void) { return 0; }
6767 cc_check && _radio_v4l=yes
6770 if test "$_radio_v4l" = yes ; then
6771 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6772 else
6773 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6775 echores "$_radio_v4l"
6777 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6778 echocheck "*BSD BrookTree 848 Radio interface"
6779 _radio_bsdbt848=no
6780 cat > $TMPC <<EOF
6781 #include <sys/types.h>
6782 $_def_ioctl_bt848_h_name
6783 #ifdef IOCTL_BT848_H_NAME
6784 #include IOCTL_BT848_H_NAME
6785 #endif
6786 int main(void){
6787 ioctl(0, RADIO_GETFREQ, 0);
6788 return 0;
6791 cc_check && _radio_bsdbt848=yes
6792 echores "$_radio_bsdbt848"
6793 fi #if bsd && radio && radio_bsdbt848
6795 if test "$_radio_bsdbt848" = yes ; then
6796 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
6797 else
6798 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
6801 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6802 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6803 die "Radio driver requires BSD BT848, V4L or V4L2!"
6806 echocheck "Video 4 Linux 2 MPEG PVR interface"
6807 if test "$_pvr" = auto ; then
6808 _pvr=no
6809 if test "$_tv_v4l2" = yes && linux ; then
6810 cat > $TMPC <<EOF
6811 #include <stdlib.h>
6812 #include <inttypes.h>
6813 #include <linux/types.h>
6814 #include <linux/videodev2.h>
6815 int main(void) { struct v4l2_ext_controls ext; return 0; }
6817 cc_check && _pvr=yes
6820 if test "$_pvr" = yes ; then
6821 _def_pvr='#define HAVE_PVR 1'
6822 _inputmodules="pvr $_inputmodules"
6823 else
6824 _noinputmodules="pvr $_noinputmodules"
6825 _def_pvr='#undef HAVE_PVR'
6827 echores "$_pvr"
6830 echocheck "audio select()"
6831 if test "$_select" = no ; then
6832 _def_select='#undef HAVE_AUDIO_SELECT'
6833 elif test "$_select" = yes ; then
6834 _def_select='#define HAVE_AUDIO_SELECT 1'
6836 echores "$_select"
6839 echocheck "ftp"
6840 if not beos && test "$_ftp" = yes ; then
6841 _def_ftp='#define HAVE_FTP 1'
6842 _inputmodules="ftp $_inputmodules"
6843 else
6844 _noinputmodules="ftp $_noinputmodules"
6845 _def_ftp='#undef HAVE_FTP'
6847 echores "$_ftp"
6849 echocheck "vstream client"
6850 if test "$_vstream" = auto ; then
6851 _vstream=no
6852 cat > $TMPC <<EOF
6853 #include <vstream-client.h>
6854 void vstream_error(const char *format, ... ) {}
6855 int main(void) { vstream_start(); return 0; }
6857 cc_check -lvstream-client && _vstream=yes
6859 if test "$_vstream" = yes ; then
6860 _def_vstream='#define HAVE_VSTREAM 1'
6861 _inputmodules="vstream $_inputmodules"
6862 _ld_extra="$_ld_extra -lvstream-client"
6863 else
6864 _noinputmodules="vstream $_noinputmodules"
6865 _def_vstream='#undef HAVE_VSTREAM'
6867 echores "$_vstream"
6869 # endian testing
6870 echocheck "byte order"
6871 if test "$_big_endian" = auto ; then
6872 cat > $TMPC <<EOF
6873 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6874 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6875 int main(){
6876 return (int)ascii_name;
6879 if cc_check ; then
6880 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6881 _big_endian=yes
6882 else
6883 _big_endian=no
6885 else
6886 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
6889 if test "$_big_endian" = yes ; then
6890 _byte_order='big-endian'
6891 _def_words_endian='#define WORDS_BIGENDIAN 1'
6892 else
6893 _byte_order='little-endian'
6894 _def_words_endian='#undef WORDS_BIGENDIAN'
6896 echores "$_byte_order"
6898 echocheck "OSD menu"
6899 if test "$_menu" = yes ; then
6900 _def_menu='#define HAVE_MENU 1'
6901 else
6902 _def_menu='#undef HAVE_MENU'
6904 echores "$_menu"
6907 echocheck "QuickTime codecs"
6908 if test "$_qtx" = auto ; then
6909 test "$_win32dll" = yes || darwin && _qtx=yes
6911 if test "$_qtx" = yes ; then
6912 _def_qtx='#define USE_QTX_CODECS 1'
6913 _codecmodules="qtx $_codecmodules"
6914 else
6915 _def_qtx='#undef USE_QTX_CODECS'
6916 _nocodecmodules="qtx $_nocodecmodules"
6918 echores "$_qtx"
6921 echocheck "Subtitles sorting"
6922 if test "$_sortsub" = yes ; then
6923 _def_sortsub='#define USE_SORTSUB 1'
6924 else
6925 _def_sortsub='#undef USE_SORTSUB'
6927 echores "$_sortsub"
6930 echocheck "XMMS inputplugin support"
6931 if test "$_xmms" = yes ; then
6932 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6933 _xmmsplugindir=`xmms-config --input-plugin-dir`
6934 _xmmslibdir=`xmms-config --exec-prefix`/lib
6935 else
6936 _xmmsplugindir=/usr/lib/xmms/Input
6937 _xmmslibdir=/usr/lib
6940 _def_xmms='#define HAVE_XMMS 1'
6941 if darwin ; then
6942 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
6943 else
6944 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6946 else
6947 _def_xmms='#undef HAVE_XMMS'
6949 echores "$_xmms"
6951 echocheck "inet6"
6952 if test "$_inet6" = auto ; then
6953 cat > $TMPC << EOF
6954 #include <sys/types.h>
6955 #include <sys/socket.h>
6956 #include <netinet/in.h>
6957 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6959 _inet6=no
6960 if cc_check ; then
6961 _inet6=yes
6964 if test "$_inet6" = yes ; then
6965 _def_inet6='#define HAVE_AF_INET6 1'
6966 else
6967 _def_inet6='#undef HAVE_AF_INET6'
6969 echores "$_inet6"
6972 echocheck "gethostbyname2"
6973 if test "$_gethostbyname2" = auto ; then
6974 cat > $TMPC << EOF
6975 #include <sys/types.h>
6976 #include <sys/socket.h>
6977 #include <netdb.h>
6978 int main(void) { gethostbyname2("", AF_INET); }
6980 _gethostbyname2=no
6981 if cc_check ; then
6982 _gethostbyname2=yes
6986 if test "$_gethostbyname2" = yes ; then
6987 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6988 else
6989 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6991 echores "$_gethostbyname2"
6994 # --------------- GUI specific tests begin -------------------
6995 echocheck "GUI"
6996 echo "$_gui"
6997 if test "$_gui" = yes ; then
6999 # Required libraries
7000 test "$_libavcodec" != yes && die "The GUI requires libavcodec with PNG support."
7001 if not win32 ; then
7002 test "$_x11" != yes && die "X11 support required for GUI compilation."
7004 echocheck "XShape extension"
7005 if test "$_xshape" = auto ; then
7006 _xshape=no
7007 cat > $TMPC << EOF
7008 #include <X11/Xlib.h>
7009 #include <X11/Xproto.h>
7010 #include <X11/Xutil.h>
7011 #include <X11/extensions/shape.h>
7012 #include <stdlib.h>
7013 int main(void) {
7014 char *name = ":0.0";
7015 Display *wsDisplay;
7016 int exitvar = 0;
7017 int eventbase, errorbase;
7018 if (getenv("DISPLAY"))
7019 name=getenv("DISPLAY");
7020 wsDisplay=XOpenDisplay(name);
7021 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7022 exitvar=1;
7023 XCloseDisplay(wsDisplay);
7024 return exitvar;
7027 cc_check && _xshape=yes
7029 if test "$_xshape" = yes ; then
7030 _def_xshape='#define HAVE_XSHAPE 1'
7031 else
7032 die "The GUI requires the X11 extension XShape (which was not found)."
7034 echores "$_xshape"
7036 #Check for GTK
7037 if test "$_gtk1" = no ; then
7038 #Check for GTK2 :
7039 echocheck "GTK+ version"
7041 if $_pkg_config gtk+-2.0 --exists ; then
7042 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7043 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7044 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7045 echores "$_gtk"
7047 # Check for GLIB2
7048 if $_pkg_config glib-2.0 --exists ; then
7049 echocheck "glib version"
7050 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7051 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7052 echores "$_glib"
7054 _def_gui='#define HAVE_NEW_GUI 1'
7055 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7056 else
7057 _gtk1=yes
7058 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7060 else
7061 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7062 _gtk1=yes
7066 if test "$_gtk1" = yes ; then
7067 # Check for old GTK (1.2.x)
7068 echocheck "GTK version"
7069 if test -z "$_gtkconfig" ; then
7070 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7071 _gtkconfig="gtk-config"
7072 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7073 _gtkconfig="gtk12-config"
7074 else
7075 die "The GUI requires GTK devel packages (which were not found)."
7078 _gtk=`$_gtkconfig --version 2>&1`
7079 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7080 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7081 echores "$_gtk (using $_gtkconfig)"
7083 # Check for GLIB
7084 echocheck "glib version"
7085 if test -z "$_glibconfig" ; then
7086 if ( glib-config --version ) >/dev/null 2>&1 ; then
7087 _glibconfig="glib-config"
7088 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7089 _glibconfig="glib12-config"
7090 else
7091 die "The GUI requires GLIB devel packages (which were not found)"
7094 _glib=`$_glibconfig --version 2>&1`
7095 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7096 echores "$_glib (using $_glibconfig)"
7098 _def_gui='#define HAVE_NEW_GUI 1'
7099 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7102 else #if not win32
7103 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7104 _def_gui='#define HAVE_NEW_GUI 1'
7105 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7106 fi #if not win32
7108 else #if test "$_gui"
7109 _def_gui='#undef HAVE_NEW_GUI'
7110 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7111 fi #if test "$_gui"
7112 # --------------- GUI specific tests end -------------------
7115 if test "$_charset" = "noconv" ; then
7116 _charset=""
7118 if test "$_charset" ; then
7119 _def_charset="#define MSG_CHARSET \"$_charset\""
7120 else
7121 _def_charset="#undef MSG_CHARSET"
7124 if test "$_charset" = "UTF-8" ; then
7125 # hack to disable conversion in the Makefile
7126 _charset=""
7129 if test "$_charset" ; then
7130 echocheck "iconv program"
7131 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7132 if test "$?" -ne 0 ; then
7133 echores "no"
7134 echo "No working iconv program found, use "
7135 echo "--charset=UTF-8 to continue anyway."
7136 echo "If you also have problems with iconv library functions use --charset=noconv."
7137 echo "Messages in the GTK-2 interface will be broken then."
7138 exit 1
7139 else
7140 echores "yes"
7144 #############################################################################
7146 echocheck "automatic gdb attach"
7147 if test "$_crash_debug" = yes ; then
7148 _def_crash_debug='#define CRASH_DEBUG 1'
7149 else
7150 _def_crash_debug='#undef CRASH_DEBUG'
7151 _crash_debug=no
7153 echores "$_crash_debug"
7155 echocheck "compiler support for noexecstack"
7156 cat > $TMPC <<EOF
7157 int main(void) { return 0; }
7159 if cc_check -Wl,-z,noexecstack ; then
7160 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7161 echores "yes"
7162 else
7163 echores "no"
7166 echocheck "ftello()"
7167 # if we don't have ftello use the osdep/ compatibility module
7168 cat > $TMPC << EOF
7169 #include <stdio.h>
7170 #include <sys/types.h>
7171 int main (void) { ftello(stdin); return 0; }
7173 _ftello=no
7174 cc_check && _ftello=yes
7175 if test "$_ftello" = yes ; then
7176 _def_ftello='#define HAVE_FTELLO 1'
7177 _need_ftello=no
7178 else
7179 _def_ftello='#undef HAVE_FTELLO'
7180 _need_ftello=yes
7182 echores "$_ftello"
7184 # Dynamic linking flags
7185 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7186 _ld_dl_dynamic=''
7187 bsd && _ld_dl_dynamic='-rdynamic'
7188 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7189 _ld_dl_dynamic='-rdynamic'
7192 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7193 bsdos && _ld_extra="$_ld_extra -ldvd"
7194 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7195 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7197 _def_debug='#undef MP_DEBUG'
7198 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7200 _def_linux='#undef TARGET_LINUX'
7201 linux && _def_linux='#define TARGET_LINUX 1'
7204 echocheck "VIDIX"
7205 _vidix=no
7206 _def_vidix='#undef CONFIG_VIDIX'
7207 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
7208 _vidix_drv_cyberblade=no
7209 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
7210 _vidix_drv_ivtv=no
7211 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
7212 _vidix_drv_ivtv=no
7213 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
7214 _vidix_drv_mach64=no
7215 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
7216 _vidix_drv_mga=no
7217 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
7218 _vidix_drv_mga_crtc2=no
7219 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
7220 _vidix_drv_nvidia=no
7221 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
7222 _vidix_drv_pm2=no
7223 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
7224 _vidix_drv_pm3=no
7225 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
7226 _vidix_drv_radeon=no
7227 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
7228 _vidix_drv_rage128=no
7229 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
7230 _vidix_drv_savage=no
7231 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
7232 _vidix_drv_sis=no
7233 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
7234 _vidix_drv_unichrome=no
7235 if test "$_vidix_internal" = auto ; then
7236 _vidix_internal=no
7237 x86 && _vidix_internal=yes
7238 # this is broken currently, undefined references to inw, outw etc.
7239 #ppc && linux && _vidix_internal=yes
7240 alpha && linux && _vidix_internal=yes
7241 qnx || beos || darwin && _vidix_internal=no
7243 if test "$_vidix_internal" = yes; then
7244 _res_comment="internal"
7245 _vidix_external=no
7246 _vidix=yes
7247 elif test "$_vidix_external" = auto; then
7248 _vidix_external=no
7249 cat > $TMPC <<EOF
7250 #include <vidix/vidix.h>
7251 int main(void) { return 0; }
7253 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
7254 && _vidix=yes
7256 echores "$_vidix"
7258 if test "$_vidix" = yes ; then
7259 _def_vidix='#define CONFIG_VIDIX 1'
7260 _vosrc="$_vosrc vo_cvidix.c"
7261 _vomodules="cvidix $_vomodules"
7262 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 savage sis unichrome"
7263 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
7265 for driver in $_vidix_drivers ; do
7266 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
7267 eval _vidix_drv_${driver}=yes
7268 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
7269 done
7270 else
7271 _novomodules="cvidix $_novomodules"
7274 if test "$_vidix_internal" = yes ; then
7275 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
7276 elif test "$_vidix_external" = yes ; then
7277 _libs_mplayer="$_libs_mplayer -lvidix"
7278 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
7281 if test "$_vidix" = yes && win32; then
7282 _vosrc="$_vosrc vo_winvidix.c"
7283 _vomodules="winvidix $_vomodules"
7284 _libs_mplayer="$_libs_mplayer -lgdi32"
7285 else
7286 _novomodules="winvidix $_novomodules"
7288 if test "$_vidix" = yes && test "$_x11" = yes; then
7289 _vosrc="$_vosrc vo_xvidix.c"
7290 _vomodules="xvidix $_vomodules"
7291 else
7292 _novomodules="xvidix $_novomodules"
7295 echocheck "joystick"
7296 _def_joystick='#undef HAVE_JOYSTICK'
7297 if test "$_joystick" = yes ; then
7298 if linux ; then
7299 # TODO add some check
7300 _def_joystick='#define HAVE_JOYSTICK 1'
7301 else
7302 _joystick="no (unsupported under $system_name)"
7305 echores "$_joystick"
7307 echocheck "lirc"
7308 if test "$_lirc" = auto ; then
7309 _lirc=no
7310 cat > $TMPC <<EOF
7311 #include <lirc/lirc_client.h>
7312 int main(void) { return 0; }
7314 cc_check -llirc_client && _lirc=yes
7316 if test "$_lirc" = yes ; then
7317 _def_lirc='#define HAVE_LIRC 1'
7318 _ld_extra="$_ld_extra -llirc_client"
7319 else
7320 _def_lirc='#undef HAVE_LIRC'
7322 echores "$_lirc"
7324 echocheck "lircc"
7325 if test "$_lircc" = auto ; then
7326 _lircc=no
7327 cat > $TMPC <<EOF
7328 #include <lirc/lircc.h>
7329 int main(void) { return 0; }
7331 cc_check -llircc && _lircc=yes
7333 if test "$_lircc" = yes ; then
7334 _def_lircc='#define HAVE_LIRCC 1'
7335 _ld_extra="$_ld_extra -llircc"
7336 else
7337 _def_lircc='#undef HAVE_LIRCC'
7339 echores "$_lircc"
7341 if arm; then
7342 # Detect maemo development platform libraries availability (http://www.maemo.org),
7343 # they are used when run on Nokia 770
7344 echocheck "maemo (Nokia 770)"
7345 if test "$_maemo" = auto ; then
7346 _maemo=no
7347 cat > $TMPC << EOF
7348 #include <libosso.h>
7349 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7351 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7353 if test "$_maemo" = yes ; then
7354 _def_maemo='#define HAVE_MAEMO 1'
7355 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7356 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7357 else
7358 _def_maemo='#undef HAVE_MAEMO'
7360 echores "$_maemo"
7363 echocheck "color console output"
7364 if test "$_color_console" = yes ; then
7365 _def_color_console='#define MSG_USE_COLORS 1'
7366 else
7367 _def_color_console='#undef MSG_USE_COLORS'
7369 echores "$_color_console"
7371 # linker paths should be the same for mencoder and mplayer
7372 _ld_tmp=""
7373 for I in $_libs_mplayer ; do
7374 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7375 if test -z "$_tmp" ; then
7376 _ld_extra="$I $_ld_extra"
7377 else
7378 _ld_tmp="$_ld_tmp $I"
7380 done
7381 _libs_mplayer=$_ld_tmp
7384 #############################################################################
7385 if darwin ; then
7386 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN -shared-libgcc"
7387 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7388 CFLAGS="$CFLAGS -no-cpp-precomp"
7391 if amigaos ; then
7392 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__ -DSYS_AMIGAOS4"
7394 if hpux ; then
7395 # use flag for HPUX missing setenv()
7396 CFLAGS="$CFLAGS -DHPUX"
7398 # Thread support
7399 if linux ; then
7400 CFLAGS="$CFLAGS -D_REENTRANT"
7401 elif bsd ; then
7402 # FIXME bsd needs this so maybe other OS'es
7403 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7405 if cygwin ; then
7406 CFLAGS="$CFLAGS -D__CYGWIN__ -DSYS_CYGWIN"
7408 # 64 bit file offsets?
7409 if test "$_largefiles" = yes || freebsd ; then
7410 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7411 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7412 # dvdread support requires this (for off64_t)
7413 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7417 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7418 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7420 cat > $TMPC << EOF
7421 int main() { return 0; }
7423 if test "$cc_vendor" = "gnu" ; then
7424 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7425 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7426 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7430 #this must be the last test to be performed or the ones following it will likely fail
7431 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7432 # to use its own copy of the library)
7433 echocheck "DVD support (libdvdnav)"
7434 if test "$_dvdnav" = auto ; then
7435 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7437 if test "$_dvdnav" = auto ; then
7438 cat > $TMPC <<EOF
7439 #include <inttypes.h>
7440 #include <dvdnav.h>
7441 int main(void) { dvdnav_t *dvd=0; return 0; }
7443 _dvdnav=no
7444 _dvdnavdir=`$_dvdnavconfig --cflags`
7445 _dvdnavlibs=`$_dvdnavconfig --libs`
7446 _dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
7447 _dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
7448 test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
7449 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7451 if test "$_dvdnav" = yes ; then
7452 _largefiles=yes
7453 _def_dvdnav='#define USE_DVDNAV 1'
7454 _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
7455 _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
7456 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7457 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7458 _inputmodules="dvdnav $_inputmodules"
7459 else
7460 _def_dvdnav='#undef USE_DVDNAV'
7461 _noinputmodules="dvdnav $_noinputmodules"
7463 echores "$_dvdnav"
7465 #############################################################################
7466 echo "Creating config.mak"
7467 cat > config.mak << EOF
7468 # -------- Generated by configure -----------
7470 LANG = C
7471 MAN_LANG = $MAN_LANG
7472 TARGET_OS = $system_name
7473 DESTDIR =
7474 prefix = \$(DESTDIR)$_prefix
7475 BINDIR = \$(DESTDIR)$_bindir
7476 DATADIR = \$(DESTDIR)$_datadir
7477 MANDIR = \$(DESTDIR)$_mandir
7478 CONFDIR = \$(DESTDIR)$_confdir
7479 LIBDIR = \$(DESTDIR)$_libdir
7480 # FFmpeg uses libdir instead of LIBDIR
7481 libdir = \$(LIBDIR)
7482 #AR = ar
7483 CC = $_cc
7484 CXX = $_cc
7485 HOST_CC = $_host_cc
7486 RANLIB = $_ranlib
7487 LDCONFIG = $_ldconfig
7488 INSTALL = $_install
7489 EXTRA_INC = $_inc_extra
7490 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7491 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7492 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7493 INSTALLSTRIP = $_install_strip
7494 CHARSET = $_charset
7495 HELP_FILE = $_mp_help
7497 EXESUF = $_exesuf
7499 MPLAYER_NETWORK = $_network
7500 FTP = $_ftp
7501 STREAMING_LIVE555 = $_live
7502 VSTREAM = $_vstream
7503 STREAM_CACHE = $_stream_cache
7504 DVBIN = $_dvbin
7505 VIDIX = $_vidix
7506 VIDIX_INTERNAL = $_vidix_internal
7507 VIDIX_EXTERNAL = $_vidix_external
7508 CONFIG_PP = yes
7509 MP3LAME = $_mp3lame
7510 LIBMENU = $_menu
7512 MP3LIB = $_mp3lib
7513 LIBA52 = $_liba52
7514 LIBMPEG2 = $_libmpeg2
7515 TREMOR_INTERNAL = $_tremor_internal
7516 TREMOR_LOW = $_tremor_low
7517 FAAD = $_faad
7519 SPEEX = $_speex
7520 MUSEPACK = $_musepack
7522 UNRARLIB = $_unrarlib
7523 PNG = $_png
7524 JPEG = $_jpeg
7525 GIF = $_gif
7527 EXTRALIBS = $_extra_libs
7528 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7529 EXTRALIBS_MPLAYER = $_libs_mplayer
7530 EXTRALIBS_MENCODER = $_libs_mencoder
7532 HAVE_MLIB = $_mlib
7533 HAVE_PTHREADS = $_pthreads
7535 HAVE_XVMC_ACCEL = $_xvmc
7537 HAVE_SYS_MMAN_H = $_mman
7538 HAVE_POSIX_SELECT = $_posix_select
7540 NEED_FSEEKO = $_need_fseeko
7541 NEED_FTELLO = $_need_ftello
7542 NEED_GETTIMEOFDAY = $_need_gettimeofday
7543 NEED_GLOB = $_need_glob
7544 NEED_SCANDIR = $_need_scandir
7545 NEED_SETENV = $_need_setenv
7546 NEED_SHMEM = $_need_shmem
7547 NEED_STRLCAT = $_need_strlcat
7548 NEED_STRLCPY = $_need_strlcpy
7549 NEED_STRSEP = $_need_strsep
7550 NEED_SWAB = $_need_swab
7551 NEED_VSSCANF = $_need_vsscanf
7553 # for FFmpeg
7554 SRC_PATH=..
7555 BUILD_ROOT=..
7556 LIBPREF=lib
7557 LIBSUF=.a
7558 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7560 # audio output
7561 OSS = $_ossaudio
7562 ALSA = $_alsa
7563 ALSA5 = $_alsa5
7564 ALSA9 = $_alsa9
7565 ALSA1X = $_alsa1x
7567 # input/demuxer/codecs
7568 JOYSTICK = $_joystick
7569 LIRC = $_lirc
7570 TV = $_tv
7571 TV_V4L = $_tv_v4l
7572 TV_V4L1 = $_tv_v4l1
7573 TV_V4L2 = $_tv_v4l2
7574 TV_BSDBT848 = $_tv_bsdbt848
7575 TV_TELETEXT = $_tv_teletext
7576 AUDIO_INPUT = $_audio_input
7577 PVR = $_pvr
7578 VCD = $_vcd
7579 DVDREAD = $_dvdread
7580 DVDREAD_INTERNAL = $_dvdread_internal
7581 DVDCSS_INTERNAL = $_libdvdcss_internal
7582 DVDNAV = $_dvdnav
7583 WIN32DLL = $_win32dll
7584 QTX_CODECS = $_qtx
7585 REAL_CODECS = $_real
7586 XANIM_CODECS = $_xanim
7587 LIBAVUTIL = $_libavutil
7588 LIBAVUTIL_A = $_libavutil_a
7589 LIBAVUTIL_SO = $_libavutil_so
7590 LIBAVCODEC = $_libavcodec
7591 LIBAVCODEC_A = $_libavcodec_a
7592 LIBAVCODEC_SO = $_libavcodec_so
7593 LIBAVFORMAT = $_libavformat
7594 LIBAVFORMAT_A = $_libavformat_a
7595 LIBAVFORMAT_SO = $_libavformat_so
7596 LIBPOSTPROC = $_libpostproc
7597 LIBPOSTPROC_A = $_libpostproc_a
7598 LIBPOSTPROC_SO = $_libpostproc_so
7599 ZORAN = $_zr
7600 LIBLZO = $_liblzo
7601 LIBDV = $_libdv
7602 XVID4 = $_xvid
7603 X264 = $_x264
7604 LIBNUT = $_nut
7605 MPLAYER = $_mplayer
7606 MENCODER = $_mencoder
7607 CDDA = $_cdda
7608 CDDB = $_cddb
7609 BITMAP_FONT = $_bitmap_font
7610 FREETYPE = $_freetype
7611 ASS = $_ass
7612 LIBMAD = $_mad
7613 LIBVORBIS = $_vorbis
7614 LIBTHEORA = $_theora
7615 FAAD_INTERNAL = $_faad_internal
7616 FAAD_FIXED = $_faad_fixed
7617 LIBSMBCLIENT = $_smbsupport
7618 XMMS_PLUGINS = $_xmms
7619 MACOSX = $_macosx
7620 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7621 MACOSX_BUNDLE = $_macosx_bundle
7622 MACOSX_COREVIDEO = $_macosx_corevideo
7623 TOOLAME=$_toolame
7624 TWOLAME=$_twolame
7625 FAAC=$_faac
7626 CONFIG_LIBAMR=$_libamr
7627 CONFIG_LIBAMR_NB=$_libamr_nb
7628 CONFIG_LIBAMR_WB=$_libamr_wb
7629 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7630 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7631 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7632 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7633 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7634 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7635 CONFIG_LIBFAAC=$_lavc_faac
7636 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7637 CONFIG_LIBXVID=$_lavc_xvid
7638 CONFIG_LIBX264=$_lavc_x264
7639 CONFIG_ZLIB=$_zlib
7640 CONFIG_GPL=yes
7641 CONFIG_ENCODERS=$_mencoder
7642 CONFIG_MUXERS=$_mencoder
7643 RADIO=$_radio
7644 RADIO_CAPTURE=$_radio_capture
7645 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7646 VIDIX_IVTV=$_vidix_drv_ivtv
7647 VIDIX_MACH64=$_vidix_drv_mach64
7648 VIDIX_MGA=$_vidix_drv_mga
7649 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7650 VIDIX_NVIDIA=$_vidix_drv_nvidia
7651 VIDIX_PM2=$_vidix_drv_pm2
7652 VIDIX_PM3=$_vidix_drv_pm3
7653 VIDIX_RADEON=$_vidix_drv_radeon
7654 VIDIX_RAGE128=$_vidix_drv_rage128
7655 VIDIX_SAVAGE=$_vidix_drv_savage
7656 VIDIX_SIS=$_vidix_drv_sis
7657 VIDIX_UNICHROME=$_vidix_drv_unichrome
7659 # --- Some stuff for autoconfigure ----
7660 $_target_arch
7661 $_target_arch_x86
7662 $_confwin32
7663 TARGET_CPU=$iproc
7664 TARGET_MMX = $_mmx
7665 TARGET_MMX2 = $_mmxext
7666 TARGET_3DNOW = $_3dnow
7667 TARGET_3DNOWEX = $_3dnowext
7668 TARGET_SSE = $_sse
7669 TARGET_CMOV = $_cmov
7670 TARGET_ALTIVEC = $_altivec
7671 TARGET_ARMV5TE = $_armv5te
7672 TARGET_ARMV6 = $_armv6
7673 TARGET_IWMMXT = $_iwmmxt
7674 TARGET_VIS = $_vis
7676 # --- GUI stuff ---
7677 GUI = $_gui
7679 # --- libvo stuff ---
7680 VO_SRCS = $_vosrc
7682 # --- libao2 stuff ---
7683 AO_SRCS = $_aosrc
7685 # --- libaf stuff ---
7686 AF_SRCS = $_afsrc
7690 #############################################################################
7692 ff_config_enable () {
7693 for part in $1; do
7694 if ` echo $2 | grep $part > /dev/null `; then
7695 echo "#define CONFIG_$part 1"
7696 echo "#define ENABLE_$part 1"
7697 else
7698 echo "#define ENABLE_$part 0"
7700 done
7703 echo "Creating config.h"
7704 cat > config.h << EOF
7705 /* -------- This file has been automatically generated by configure ---------
7706 Note: Any changes in it will be lost when you run configure again. */
7708 /* Protect against multiple inclusion */
7709 #ifndef MPLAYER_CONFIG_H
7710 #define MPLAYER_CONFIG_H 1
7712 #define CONFIGURATION "$_configuration"
7714 /* make sure we never get lavformat's poll() emulation, the results are
7715 horrible if the X libs try to actually use it, see MPlayer-users
7716 Message-ID: <45D49541.8060101@infernix.net>
7717 Date: Thu, 15 Feb 2007 18:15:45 +0100
7718 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7720 #define HAVE_SYS_POLL_H 1
7722 /* use GNU internationalization */
7723 $_def_i18n
7725 /* name of messages charset */
7726 $_def_charset
7728 /* Runtime CPU detection */
7729 $_def_runtime_cpudetection
7731 /* Dynamic a/v plugins */
7732 $_def_dynamic_plugins
7734 /* "restrict" keyword */
7735 $_def_restrict_keyword
7737 /* __builtin_expect branch prediction hint */
7738 $_def_builtin_expect
7739 #ifdef HAVE_BUILTIN_EXPECT
7740 #define likely(x) __builtin_expect ((x) != 0, 1)
7741 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7742 #else
7743 #define likely(x) (x)
7744 #define unlikely(x) (x)
7745 #endif
7747 /* attribute(used) as needed by some compilers */
7748 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7749 # define attribute_used __attribute__((used))
7750 #else
7751 # define attribute_used
7752 #endif
7754 /* compiler support for named assembler arguments */
7755 $_def_named_asm_args
7757 #define PREFIX "$_prefix"
7759 /* enable/disable SIGHANDLER */
7760 $_def_sighandler
7762 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7763 $_def_crash_debug
7765 /* Toggles debugging informations */
7766 $_def_debug
7768 /* Toggles color console output */
7769 $_def_color_console
7771 /* Indicates that libcdio is available for VCD and CD-DA playback */
7772 $_def_libcdio
7774 /* Indicates that Ogle's libdvdread is available for DVD playback */
7775 $_def_dvdread
7777 /* Indicates that dvdread is internal */
7778 $_def_dvdread_internal
7780 /* Additional options for libdvdread/libdvdcss */
7781 $_def_dvd
7782 $_def_cdrom
7783 $_def_cdio
7784 $_def_dvdio
7785 $_def_bsdi_dvd
7786 $_def_dvd_bsd
7787 $_def_dvd_linux
7788 $_dev_dvd_openbsd
7789 $_def_dvd_darwin
7790 $_def_sol_scsi_h
7791 $_def_hpux_scsi_h
7792 $_def_stddef
7794 /* Common data directory (for fonts, etc) */
7795 #define MPLAYER_DATADIR "$_datadir"
7796 #define MPLAYER_CONFDIR "$_confdir"
7797 #define MPLAYER_LIBDIR "$_libdir"
7799 /* Define this to compile stream-caching support, it can be enabled via
7800 -cache <kilobytes> */
7801 $_def_stream_cache
7803 /* Define if you are using XviD library */
7804 $_def_xvid
7806 /* Define if you are using the X.264 library */
7807 $_def_x264
7809 /* Define if you are using libnut */
7810 $_def_nut
7812 /* Define to include support for libdv-0.9.5 */
7813 $_def_libdv
7815 /* If build mencoder */
7816 $_mencoder_flag
7818 /* Indicates if libmp3lame is available
7819 Note: for mencoder */
7820 $_def_mp3lame
7821 $_def_mp3lame_preset
7822 $_def_mp3lame_preset_medium
7824 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7825 (use -bps or -nobps commandline option for run-time method selection)
7826 -bps gives better sync for vbr mp3 audio, it is now default */
7827 #define AVI_SYNC_BPS 1
7829 /* Undefine this if you do not want to select mono audio (left or right)
7830 with a stereo MPEG layer 2/3 audio stream. The command line option
7831 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7832 right-only), with 0 being the default.
7834 #define USE_FAKE_MONO 1
7836 /* Undefine this if your sound card driver has no working select().
7837 If you have kernel Oops, player hangups, or just no audio, you should
7838 try to recompile MPlayer with this option disabled! */
7839 $_def_select
7841 /* define this to use iconv(3) function to codepage conversions */
7842 $_def_iconv
7844 /* define this to use nl_langinfo function */
7845 $_def_langinfo
7847 /* define this to use RTC (/dev/rtc) for video timers */
7848 $_def_rtc
7850 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7851 #define MAX_OUTBURST 65536
7853 /* set up audio OUTBURST. Do not change this! */
7854 #define OUTBURST 512
7856 /* Define this if your system has the header file for the OSS sound interface */
7857 $_def_sys_soundcard
7859 /* Define this if your system has the header file for the OSS sound interface
7860 * in /usr/include */
7861 $_def_soundcard
7863 /* Define this if your system has the sysinfo header */
7864 $_def_sys_sysinfo
7866 /* Define this if your system has ftello() */
7868 $_def_ftello
7869 #ifndef HAVE_FTELLO
7870 /* Need these for FILE and off_t an config.h is usually before other includes*/
7871 #include <stdio.h>
7872 #include <sys/types.h>
7873 off_t ftello(FILE *);
7874 #endif
7876 /* Define this if your system has the "malloc.h" header file */
7877 $_def_malloc
7879 /* memalign is mapped to malloc if unsupported */
7880 $_def_memalign
7881 $_def_map_memalign
7882 $_def_memalign_hack
7884 /* assembler handling of .align */
7885 $_def_asmalign_pot
7887 /* Define this if your system has the "alloca.h" header file */
7888 $_def_alloca
7890 /* Define this if your system has the "sys/mman.h" header file */
7891 $_def_mman
7892 $_def_mman_has_map_failed
7894 /* Define this if you have the elf dynamic linker -ldl library */
7895 $_def_dl
7897 /* Define this if you have the kstat kernel statistics library */
7898 $_def_kstat
7900 /* Define this if you have zlib */
7901 $_def_zlib
7902 #ifdef HAVE_ZLIB
7903 #define CONFIG_ZLIB 1
7904 #endif
7906 /* Define this if you have shm support */
7907 $_def_shm
7909 /* Define this if your system has scandir & alphasort */
7910 $_def_scandir
7912 /* Define this if your system has strsep */
7913 $_def_strsep
7915 /* Define this if your system has strlcpy */
7916 $_def_strlcpy
7917 #ifndef HAVE_STRLCPY
7918 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7919 #endif
7921 /* Define this if your system has strlcat */
7922 $_def_strlcat
7923 #ifndef HAVE_STRLCAT
7924 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7925 #endif
7927 /* Define this if your system has fseeko */
7928 $_def_fseeko
7929 #ifndef HAVE_FSEEKO
7930 /* Need these for FILE and off_t an config.h is usually before other includes*/
7931 #include <stdio.h>
7932 #include <sys/types.h>
7933 int fseeko(FILE *, off_t, int);
7934 #endif
7936 $_def_localtime_r
7938 /* Define this if your system has vsscanf */
7939 $_def_vsscanf
7941 /* Define this if your system has swab */
7942 $_def_swab
7944 /* Define this if your system has posix select */
7945 $_def_posix_select
7947 /* Define this if your system has gettimeofday */
7948 $_def_gettimeofday
7950 /* Define this if your system has glob */
7951 $_def_glob
7953 /* Define this if your system has setenv */
7954 $_def_setenv
7955 #ifndef HAVE_SETENV
7956 int setenv(const char *name, const char *val, int overwrite);
7957 #endif
7959 /* Define this if your system has sysi86 */
7960 $_def_sysi86
7961 $_def_sysi86_iv
7963 /* Define this if your system has pthreads */
7964 $_def_pthreads
7966 /* Define this if you enabled thread support for libavcodec */
7967 $_def_threads
7969 /* LIRC (remote control, see www.lirc.org) support: */
7970 $_def_lirc
7972 /* Support for maemo (http://www.maemo.org) */
7973 $_def_maemo
7976 * LIRCCD (LIRC client daemon)
7977 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7979 $_def_lircc
7981 /* DVD navigation support using libdvdnav */
7982 $_def_dvdnav
7983 $_def_dvdnav_version
7985 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7986 #define MPEG12_POSTPROC 1
7988 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7989 $_def_libpostproc
7990 $_def_libpostproc_a
7991 $_def_libpostproc_so
7993 /* Win32 DLL support */
7994 $_def_win32dll
7995 #define WIN32_PATH "$_win32codecsdir"
7997 /* Mac OS X specific features */
7998 $_def_macosx
7999 $_def_macosx_finder_support
8000 $_def_macosx_bundle
8001 $_def_macosx_corevideo
8003 /* Build our Win32-loader */
8004 $_def_win32_loader
8006 /* ffmpeg's libavcodec support (requires libavcodec source) */
8007 $_def_libavcodec
8008 $_def_libavcodec_a
8009 $_def_libavcodec_so
8010 $_def_libavcodec_mpegaudio_hp
8012 /* ffmpeg's libavformat support (requires libavformat source) */
8013 $_def_libavformat
8014 $_def_libavformat_a
8015 $_def_libavformat_so
8017 $_def_libavutil
8018 $_def_libavutil_a
8019 $_def_libavutil_so
8021 /* Use libavcodec's decoders */
8022 #define CONFIG_DECODERS 1
8023 /* Use libavcodec's encoders */
8024 #define CONFIG_ENCODERS 1
8026 /* Use libavformat's demuxers */
8027 #define CONFIG_DEMUXERS 1
8028 /* Use libavformat's muxers */
8029 $_def_muxers
8031 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8032 #define HAVE_EBX_AVAILABLE 1
8033 #define HAVE_EBP_AVAILABLE 1
8035 #define CONFIG_GPL 1
8037 /* Use AMR codecs from libavcodec. */
8038 $_def_libamr
8039 $_def_libamr_nb
8040 $_def_libamr_wb
8042 /* Use specific parts from FFmpeg. */
8043 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8044 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8045 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8046 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8047 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8048 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8049 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8051 $_def_lavc_faac
8052 $_def_lavc_xvid
8053 $_def_lavc_mp3lame
8054 $_def_lavc_x264
8056 /* Use codec libs included in mplayer CVS / source dist: */
8057 $_def_mp3lib
8058 $_def_liba52
8059 $_def_libmpeg2
8061 /* XAnim DLL support */
8062 $_def_xanim
8063 /* Default search path */
8064 $_def_xanim_path
8066 /* RealPlayer DLL support */
8067 $_def_real
8068 /* Default search path */
8069 $_def_real_path
8071 /* LIVE555 Streaming Media library support */
8072 $_def_live
8074 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8075 $_def_fastmemcpy
8077 /* Use unrarlib for Vobsubs */
8078 $_def_unrarlib
8080 /* gui support, please do not edit this option */
8081 $_def_gui
8082 $_def_gtk2_gui
8084 /* Audio output drivers */
8085 $_def_ossaudio
8086 $_def_ossaudio_devdsp
8087 $_def_ossaudio_devmixer
8088 $_def_alsa5
8089 $_def_alsa9
8090 $_def_alsa1x
8091 $_def_arts
8092 $_def_esd
8093 $_def_esd_latency
8094 $_def_polyp
8095 $_def_jack
8096 $_def_openal
8097 $_def_openal_h
8098 $_def_sys_asoundlib_h
8099 $_def_alsa_asoundlib_h
8100 $_def_sunaudio
8101 $_def_sgiaudio
8102 $_def_win32waveout
8103 $_def_nas
8105 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8106 #undef FAST_OSD
8107 #undef FAST_OSD_TABLE
8109 /* Enable TV Interface support */
8110 $_def_tv
8112 /* Enable Video 4 Linux TV interface support */
8113 $_def_tv_v4l
8115 /* Enable Video 4 Linux 1 TV interface support */
8116 $_def_tv_v4l1
8118 /* Enable Video 4 Linux 2 TV interface support */
8119 $_def_tv_v4l2
8121 /* *BSD BrookTree headers */
8122 $_def_ioctl_meteor_h_name
8123 $_def_ioctl_bt848_h_name
8125 /* Enable *BSD BrookTree TV interface support */
8126 $_def_tv_bsdbt848
8128 /* Enable TV Teletext Interface support */
8129 $_def_tv_teletext
8131 /* Enable Radio Interface support */
8132 $_def_radio
8134 /* Enable Capture for Radio Interface support */
8135 $_def_radio_capture
8137 /* Enable Video 4 Linux Radio interface support */
8138 $_def_radio_v4l
8140 /* Enable Video 4 Linux 2 Radio interface support */
8141 $_def_radio_v4l2
8143 /* Enable *BSD BrookTree Radio interface support */
8144 $_def_radio_bsdbt848
8146 /* Enable Video 4 Linux 2 MPEG PVR support */
8147 $_def_pvr
8149 /* Define if your processor stores words with the most significant
8150 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8151 $_def_words_endian
8153 $_def_arch
8154 $_def_arch_x86
8156 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8157 have the instruction. */
8158 $_def_dcbzl
8160 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
8161 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
8163 #ifdef ARCH_POWERPC
8164 #define ARCH_PPC 1
8165 #endif
8167 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
8168 #ifdef ARCH_ARMV4L
8169 #define ARCH_ARM 1
8170 #endif
8172 /* only gcc3 can compile mvi instructions */
8173 $_def_gcc_mvi_support
8175 /* Define this for Cygwin build for win32 */
8176 $_def_confwin32
8178 /* Define this to any prefered value from 386 up to infinity with step 100 */
8179 #define __CPU__ $iproc
8181 $_mp_wordsize
8183 $_def_linux
8185 $_def_vcd
8187 #ifdef sun
8188 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8189 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8190 #elif defined(HPUX)
8191 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8192 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8193 #elif defined(WIN32)
8194 #define DEFAULT_CDROM_DEVICE "D:"
8195 #define DEFAULT_DVD_DEVICE "D:"
8196 #elif defined(SYS_DARWIN)
8197 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8198 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8199 #elif defined(__OpenBSD__)
8200 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8201 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8202 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8203 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8204 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8205 #elif defined(SYS_AMIGAOS4)
8206 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8207 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8208 #else
8209 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8210 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8211 #endif
8214 /*----------------------------------------------------------------------------
8216 ** NOTE: Instead of modifying these definitions here, use the
8217 ** --enable/--disable options of the ./configure script!
8218 ** See ./configure --help for details.
8220 *---------------------------------------------------------------------------*/
8222 /* C99 lrintf function available */
8223 $_def_lrintf
8225 /* round function is available */
8226 $_def_round
8228 /* yes, we have inttypes.h */
8229 #define HAVE_INTTYPES_H 1
8231 /* int_fastXY_t emulation */
8232 $_def_fast_inttypes
8234 /* nanosleep support */
8235 $_def_nanosleep
8237 /* SMB support */
8238 $_def_smbsupport
8240 /* termcap flag for getch2.c */
8241 $_def_termcap
8243 /* termios flag for getch2.c */
8244 $_def_termios
8245 $_def_termios_h
8246 $_def_termios_sys_h
8248 /* enable PNG support */
8249 $_def_png
8251 /* enable JPEG support */
8252 $_def_jpeg
8254 /* enable PNM support */
8255 $_def_pnm
8257 /* enable md5sum support */
8258 $_def_md5sum
8260 /* enable GIF support */
8261 $_def_gif
8262 $_def_gif_4
8263 $_def_gif_tvt_hack
8265 /* enable bitmap font support */
8266 $_def_bitmap_font
8268 /* enable FreeType support */
8269 $_def_freetype
8271 /* enable Fontconfig support */
8272 $_def_fontconfig
8274 /* enable SSA/ASS support */
8275 $_def_ass
8277 /* enable FriBiDi usage */
8278 $_def_fribidi
8280 /* enable ENCA usage */
8281 $_def_enca
8283 /* liblzo support */
8284 $_def_liblzo
8285 #ifdef USE_LIBLZO
8286 #define CONFIG_LZO 1
8287 #endif
8289 /* libmad support */
8290 $_def_mad
8292 /* enable OggVorbis support */
8293 $_def_vorbis
8294 $_def_tremor
8296 /* enable Speex support */
8297 $_def_speex
8299 /* enable musepack support */
8300 $_def_musepack
8302 /* enable OggTheora support */
8303 $_def_theora
8305 /* enable FAAD (AAC) support */
8306 $_def_faad
8307 $_def_faad_internal
8309 /* enable FAAC (AAC encoder) support */
8310 $_def_faac
8312 /* enable LADSPA plugin support */
8313 $_def_ladspa
8315 /* enable network */
8316 $_def_network
8318 /* enable ftp support */
8319 $_def_ftp
8321 /* enable vstream support */
8322 $_def_vstream
8324 /* enable winsock2 instead of Unix functions*/
8325 $_def_winsock2
8327 /* define this to use inet_aton() instead of inet_pton() */
8328 $_def_use_aton
8330 /* enables / disables cdparanoia support */
8331 $_def_cdparanoia
8332 $_def_cddb
8334 /* enables / disables VIDIX usage */
8335 $_def_vidix
8336 $_def_vidix_drv_cyberblade
8337 $_def_vidix_drv_ivtv
8338 $_def_vidix_drv_mach64
8339 $_def_vidix_drv_mga
8340 $_def_vidix_drv_mga_crtc2
8341 $_def_vidix_drv_nvidia
8342 $_def_vidix_drv_pm3
8343 $_def_vidix_drv_radeon
8344 $_def_vidix_drv_rage128
8345 $_def_vidix_drv_savage
8346 $_def_vidix_drv_sis
8347 $_def_vidix_drv_unichrome
8348 $_def_vidix_pfx
8350 /* enables / disables new input joystick support */
8351 $_def_joystick
8353 /* enables / disables QTX codecs */
8354 $_def_qtx
8356 /* enables / disables osd menu */
8357 $_def_menu
8359 /* enables / disables subtitles sorting */
8360 $_def_sortsub
8362 /* XMMS input plugin support */
8363 $_def_xmms
8364 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8366 /* enables inet6 support */
8367 $_def_inet6
8369 /* do we have gethostbyname2? */
8370 $_def_gethostbyname2
8372 /* Extension defines */
8373 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
8374 $_def_3dnowext // only define if you have 3DNOWEXT (AMD Athlon, etc.)
8375 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
8376 $_def_mmxext // only define if you have MMX2 (Athlon/PIII/4/CelII)
8377 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
8378 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
8379 $_def_ssse3 // only define if you have SSSE3 (Intel Core 2)
8380 $_def_cmov // only define if you have CMOV (i686+, without VIA C3)
8381 $_def_fast_cmov // only define if CMOV is fast
8382 $_def_altivec // only define if you have Altivec (G4)
8383 $_def_armv5te // only define if you have Enhanced DSP Extensions (ARM)
8384 $_def_armv6 // only define if you have ARMv6
8385 $_def_iwmmxt // only define if you have XScale IWMMX (ARM)
8387 $_def_altivec_h // enables usage of altivec.h
8389 $_def_mlib // Sun mediaLib, available only on solaris
8390 $_def_vis // only define if you have VIS ( ultrasparc )
8392 /* libmpeg2 uses a different feature test macro for mediaLib */
8393 #ifdef HAVE_MLIB
8394 #define LIBMPEG2_MLIB 1
8395 #endif
8397 /* libvo options */
8398 #define SCREEN_SIZE_X 1
8399 #define SCREEN_SIZE_Y 1
8400 $_def_x11
8401 $_def_xv
8402 $_def_xvmc
8403 $_def_vm
8404 $_def_xf86keysym
8405 $_def_xinerama
8406 $_def_gl
8407 $_def_gl_win32
8408 $_def_dga
8409 $_def_dga2
8410 $_def_sdl
8411 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8412 $_def_sdlbuggy
8413 $_def_directx
8414 $_def_ggi
8415 $_def_ggiwmh
8416 $_def_3dfx
8417 $_def_s3fb
8418 $_def_tdfxfb
8419 $_def_tdfxvid
8420 $_def_directfb
8421 $_def_directfb_version
8422 $_def_dfbmga
8423 $_def_zr
8424 $_def_bl
8425 $_def_mga
8426 $_def_xmga
8427 $_def_syncfb
8428 $_def_fbdev
8429 $_def_dxr2
8430 $_def_dxr3
8431 $_def_ivtv
8432 $_def_dvb
8433 $_def_dvb_in
8434 $_def_svga
8435 $_def_vesa
8436 $_def_xdpms
8437 $_def_aa
8438 $_def_caca
8439 $_def_tga
8440 $_def_toolame
8441 $_def_twolame
8443 /* used by GUI: */
8444 $_def_xshape
8446 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8447 #define X11_FULLSCREEN 1
8448 #endif
8450 #endif /* MPLAYER_CONFIG_H */
8453 #############################################################################
8455 cat << EOF
8457 Config files successfully generated by ./configure $_configuration !
8459 Install prefix: $_prefix
8460 Data directory: $_datadir
8461 Config direct.: $_confdir
8463 Byte order: $_byte_order
8464 Optimizing for: $_optimizing
8466 Languages:
8467 Messages/GUI: $_language
8470 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8471 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8472 echo
8474 cat << EOF
8476 Enabled optional drivers:
8477 Input: $_inputmodules
8478 Codecs: $_codecmodules
8479 Audio output: $_aomodules
8480 Video output: $_vomodules
8481 Audio filters: $_afmodules
8482 Disabled optional drivers:
8483 Input: $_noinputmodules
8484 Codecs: $_nocodecmodules
8485 Audio output: $_noaomodules
8486 Video output: $_novomodules
8487 Audio filters: $_noafmodules
8489 'config.h' and 'config.mak' contain your configuration options.
8490 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8491 compile *** DO NOT REPORT BUGS if you tweak these files ***
8493 'make' will now compile MPlayer and 'make install' will install it.
8494 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8499 if test "$_mtrr" = yes ; then
8500 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8501 echo
8504 if not x86_32; then
8505 cat <<EOF
8506 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8507 operating system ($system_name). You may encounter a few files that cannot
8508 be played due to missing open source video/audio codec support.
8514 cat <<EOF
8515 Check $TMPLOG if you wonder why an autodetection failed (make sure
8516 development headers/packages are installed).
8518 NOTE: The --enable-* parameters unconditionally force options on, completely
8519 skipping autodetection. This behavior is unlike what you may be used to from
8520 autoconf-based configure scripts that can decide to override you. This greater
8521 level of control comes at a price. You may have to provide the correct compiler
8522 and linker flags yourself.
8523 If you used one of these options (except --enable-gui and similar ones that
8524 turn on internal features) and experience a compilation or linking failure,
8525 make sure you have passed the necessary compiler/linker flags to configure.
8527 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8531 if test "$_warn_CFLAGS" = yes; then
8532 cat <<EOF
8534 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8536 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8538 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8539 To do so, execute 'CFLAGS= ./configure <options>'
8544 # Last move:
8545 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"