Add configures arguments to its output
[mplayer/glamo.git] / configure
blobd6f20b6f1ebae54cff84d9d9c9d0128a64539af8
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" ; 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-pvr disable Video4Linux2 MPEG PVR [autodetect]
244 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
245 --disable-network disable networking [enable]
246 --enable-winsock2 enable winsock2 [autodetect]
247 --enable-smb enable Samba (SMB) input [autodetect]
248 --enable-live enable LIVE555 Streaming Media [autodetect]
249 --disable-dvdnav disable libdvdnav [autodetect]
250 --disable-dvdread disable libdvdread [autodetect]
251 --disable-dvdread-internal disable internal libdvdread [autodetect]
252 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
253 --disable-cdparanoia disable cdparanoia [autodetect]
254 --disable-cddb disable cddb [autodetect]
255 --disable-bitmap-font disable bitmap font support [enable]
256 --disable-freetype disable FreeType 2 font rendering [autodetect]
257 --disable-fontconfig disable fontconfig font lookup [autodetect]
258 --disable-unrarlib disable Unique RAR File Library [enabled]
259 --enable-menu enable OSD menu (not DVD menu) [disabled]
260 --disable-sortsub disable subtitle sorting [enabled]
261 --enable-fribidi enable the FriBiDi libs [autodetect]
262 --disable-enca disable ENCA charset oracle library [autodetect]
263 --disable-macosx disable Mac OS X specific features [autodetect]
264 --disable-maemo disable maemo specific features [autodetect]
265 --enable-macosx-finder-support enable Mac OS X Finder invocation
266 parameter parsing [disabled]
267 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
268 --disable-inet6 disable IPv6 support [autodetect]
269 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
270 --disable-ftp disable FTP support [enabled]
271 --disable-vstream disable TiVo vstream client support [autodetect]
272 --disable-pthreads disable Posix threads support [autodetect]
273 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
274 --enable-rpath enable runtime linker path for extra libs [disabled]
276 Codecs:
277 --enable-gif enable GIF support [autodetect]
278 --enable-png enable PNG input/output support [autodetect]
279 --enable-jpeg enable JPEG input/output support [autodetect]
280 --enable-libcdio enable external libcdio [autodetect]
281 --enable-liblzo enable external liblzo [autodetect]
282 --disable-win32dll disable Win32 DLL support [enabled]
283 --disable-qtx disable QuickTime codecs support [enabled]
284 --disable-xanim disable XAnim codecs support [enabled]
285 --disable-real disable RealPlayer codecs support [enabled]
286 --disable-xvid disable XviD [autodetect]
287 --disable-x264 disable x264 [autodetect]
288 --disable-nut disable libnut [autodetect]
289 --disable-libavutil disable static libavutil [autodetect]
290 --disable-libavcodec_a disable static libavcodec [autodetect]
291 --disable-libavformat_a disable static libavformat [autodetect]
292 --disable-libpostproc_a disable static libpostproc [autodetect]
293 --disable-libavutil_so disable shared libavutil [autodetect]
294 --disable-libavcodec_so disable shared libavcodec [autodetect]
295 --disable-libavformat_so disable shared libavformat [autodetect]
296 --disable-libpostproc_so disable shared libpostproc [autodetect]
297 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
298 in libavcodec [enabled]
299 --disable-tremor-internal disable internal Tremor [enabled]
300 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
301 --enable-tremor-external enable external Tremor [autodetect]
302 --disable-libvorbis disable libvorbis support [autodetect]
303 --disable-speex disable Speex support [autodetect]
304 --enable-theora enable OggTheora libraries [autodetect]
305 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
306 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
307 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
308 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
309 --disable-ladspa disable LADSPA plugin support [autodetect]
310 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
311 --disable-mad disable libmad (MPEG audio) support [autodetect]
312 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
313 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
314 --enable-xmms enable XMMS input plugin support [disabled]
315 --enable-libdts enable libdts support [autodetect]
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-amr_nb disable AMR narrowband, floating-point [autodetect]
321 --disable-amr_wb disable AMR wideband, floating-point [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: all,cyberblade,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-shm enable shm [autodetect]
414 --enable-altivec enable AltiVec (PowerPC) [autodetect]
415 --enable-armv5te enable DSP extensions (ARM) [autodetect]
416 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
417 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
418 --enable-big-endian force byte order to big-endian [autodetect]
419 --enable-debug[=1-3] compile-in debugging information [disable]
420 --enable-profile compile-in profiling information [disable]
421 --disable-sighandler disable sighandler for crashes [enable]
422 --enable-crash-debug enable automatic gdb attach on crash [disable]
423 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
425 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
426 --disable-gcc-check disable gcc version checking [enable]
428 Use these options if autodetection fails (Options marked with (*) accept
429 multiple paths separated by ':'):
430 --extra-libs=FLAGS extra linker flags
431 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
432 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
433 --with-extraincdir=DIR extra header search paths in DIR (*)
434 --with-extralibdir=DIR extra linker search paths in DIR (*)
435 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
437 --with-freetype-config=PATH path to freetype-config
438 --with-fribidi-config=PATH path to fribidi-config
439 --with-glib-config=PATH path to glib*-config
440 --with-gtk-config=PATH path to gtk*-config
441 --with-sdl-config=PATH path to sdl*-config
442 --with-dvdnav-config=PATH path to dvdnav-config
444 This configure script is NOT autoconf-based, even though its output is similar.
445 It will try to autodetect all configuration options. If you --enable an option
446 it will be forcefully turned on, skipping autodetection. This can break
447 compilation, so you need to know what you are doing.
449 exit 0
450 } #show_help()
452 # GOTCHA: the variables below defines the default behavior for autodetection
453 # and have - unless stated otherwise - at least 2 states : yes no
454 # If autodetection is available then the third state is: auto
455 _mmx=auto
456 _3dnow=auto
457 _3dnowext=auto
458 _mmxext=auto
459 _sse=auto
460 _sse2=auto
461 _cmov=auto
462 _fast_cmov=auto
463 _armv5te=auto
464 _iwmmxt=auto
465 _mtrr=auto
466 _install=install
467 _ranlib=ranlib
468 _ldconfig=ldconfig
469 _cc=cc
470 test "$CC" && _cc="$CC"
471 _gcc_check=yes
472 _as=auto
473 _runtime_cpudetection=no
474 _cross_compile=auto
475 _prefix="/usr/local"
476 _libavutil_a=auto
477 _libavutil_so=auto
478 _libavcodec_a=auto
479 _amr_nb=auto
480 _amr_wb=auto
481 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
482 _libavdecoders=` echo $_libavdecoders_all | sed -e s/AAC_DECODER// -e s/MPEG4AAC_DECODER// -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// `
483 _libavencoders_all=`sed -n 's/^[^#]*ENC.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
484 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// `
485 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
486 _libavparsers=$_libavparsers_all
487 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
488 _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// `
489 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
490 _libavmuxers=`echo $_libavmuxers_all | sed -e s/AUDIO_MUXER// -e s/RTP_MUXER// `
491 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
492 _libavcodec_so=auto
493 _libavformat_a=auto
494 _libavformat_so=auto
495 _libpostproc_a=auto
496 _libpostproc_so=auto
497 _libavcodec_mpegaudio_hp=yes
498 _mencoder=yes
499 _mplayer=yes
500 _x11=auto
501 _xshape=auto
502 _dga=auto # 1 2 no auto
503 _xv=auto
504 _xvmc=no #auto when complete
505 _sdl=auto
506 _directx=auto
507 _win32waveout=auto
508 _nas=auto
509 _png=auto
510 _jpeg=auto
511 _pnm=yes
512 _md5sum=yes
513 _gif=auto
514 _gl=auto
515 _ggi=auto
516 _ggiwmh=auto
517 _aa=auto
518 _caca=auto
519 _svga=auto
520 _vesa=auto
521 _fbdev=auto
522 _dvb=auto
523 _dvbhead=auto
524 _dxr2=auto
525 _dxr3=auto
526 _ivtv=auto
527 _iconv=auto
528 _langinfo=auto
529 _rtc=auto
530 _ossaudio=auto
531 _arts=auto
532 _esd=auto
533 _polyp=auto
534 _jack=auto
535 _openal=auto
536 _libcdio=auto
537 _liblzo=auto
538 _mad=auto
539 _toolame=auto
540 _twolame=auto
541 _tremor_internal=yes
542 _tremor_low=no
543 _tremor_external=auto
544 _libvorbis=auto
545 _speex=auto
546 _theora=auto
547 _mp3lib=yes
548 _liba52=yes
549 _libdts=auto
550 _libmpeg2=yes
551 _faad_internal=auto
552 _faad_external=auto
553 _faad_fixed=no
554 _faac=auto
555 _ladspa=auto
556 _xmms=no
557 _dvdnav=auto
558 _dvdnavconfig=dvdnav-config
559 _dvdread=auto
560 _dvdread_internal=auto
561 _libdvdcss_internal=auto
562 _xanim=auto
563 _real=auto
564 _live=auto
565 _xinerama=auto
566 _mga=auto
567 _xmga=auto
568 _vm=auto
569 _xf86keysym=auto
570 _mlib=no #broken, thus disabled
571 _sgiaudio=auto
572 _sunaudio=auto
573 _alsa=auto
574 _fastmemcpy=yes
575 _unrarlib=yes
576 _win32dll=auto
577 _select=yes
578 _radio=no
579 _radio_capture=no
580 _radio_v4l=auto
581 _radio_v4l2=auto
582 _radio_bsdbt848=auto
583 _tv=yes
584 _tv_v4l1=auto
585 _tv_v4l2=auto
586 _tv_bsdbt848=auto
587 _pvr=auto
588 _network=yes
589 _winsock2=auto
590 _smbsupport=auto
591 _vidix_internal=auto
592 _vidix_external=auto
593 _vidix_drivers="all"
594 _joystick=no
595 _xvid=auto
596 _x264=auto
597 _nut=auto
598 _lirc=auto
599 _lircc=auto
600 _gui=no
601 _gtk1=no
602 _termcap=auto
603 _termios=auto
604 _3dfx=no
605 _s3fb=no
606 _tdfxfb=no
607 _tdfxvid=no
608 _tga=yes
609 _directfb=auto
610 _zr=auto
611 _bl=no
612 _largefiles=no
613 #_language=en
614 _shm=auto
615 _linux_devfs=no
616 _charset="UTF-8"
617 _dynamic_plugins=no
618 _crash_debug=no
619 _sighandler=yes
620 _libdv=auto
621 _cdparanoia=auto
622 _cddb=auto
623 _big_endian=auto
624 _bitmap_font=yes
625 _freetype=auto
626 _fontconfig=auto
627 _menu=no
628 _qtx=auto
629 _macosx=auto
630 _maemo=auto
631 _macosx_finder_support=no
632 _macosx_bundle=auto
633 _sortsub=yes
634 _freetypeconfig='freetype-config'
635 _fribidi=auto
636 _fribidiconfig='fribidi-config'
637 _enca=auto
638 _inet6=auto
639 _gethostbyname2=auto
640 _ftp=yes
641 _musepack=auto
642 _vstream=auto
643 _pthreads=auto
644 _ass=auto
645 _rpath=no
646 _asmalign_pot=auto
647 _color_console=no
648 _stream_cache=yes
649 _def_stream_cache="#define USE_STREAM_CACHE 1"
650 _need_shmem=yes
651 for ac_option do
652 case "$ac_option" in
653 --help|-help|-h)
654 show_help
656 --prefix=*)
657 _prefix=`echo $ac_option | cut -d '=' -f 2`
659 --bindir=*)
660 _bindir=`echo $ac_option | cut -d '=' -f 2`
662 --datadir=*)
663 _datadir=`echo $ac_option | cut -d '=' -f 2`
665 --mandir=*)
666 _mandir=`echo $ac_option | cut -d '=' -f 2`
668 --confdir=*)
669 _confdir=`echo $ac_option | cut -d '=' -f 2`
671 --libdir=*)
672 _libdir=`echo $ac_option | cut -d '=' -f 2`
674 --codecsdir=*)
675 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
677 --win32codecsdir=*)
678 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
680 --xanimcodecsdir=*)
681 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
683 --realcodecsdir=*)
684 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
686 --with-extraincdir=*)
687 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
689 --with-extralibdir=*)
690 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
693 --with-install=*)
694 _install=`echo $ac_option | cut -d '=' -f 2 `
696 --with-xvmclib=*)
697 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
700 --with-sdl-config=*)
701 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
703 --with-freetype-config=*)
704 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
706 --with-fribidi-config=*)
707 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
709 --with-gtk-config=*)
710 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
712 --with-glib-config=*)
713 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
715 --with-dvdnav-config=*)
716 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
719 --extra-libs=*)
720 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
722 --extra-libs-mplayer=*)
723 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
725 --extra-libs-mencoder=*)
726 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
729 --target=*)
730 _target=`echo $ac_option | cut -d '=' -f 2`
732 --cc=*)
733 _cc=`echo $ac_option | cut -d '=' -f 2`
735 --host-cc=*)
736 _host_cc=`echo $ac_option | cut -d '=' -f 2`
738 --as=*)
739 _as=`echo $ac_option | cut -d '=' -f 2`
741 --charset=*)
742 _charset=`echo $ac_option | cut -d '=' -f 2`
744 --language=*)
745 _language=`echo $ac_option | cut -d '=' -f 2`
748 --enable-static)
749 _ld_static='-static'
751 --disable-static)
752 _ld_static=''
754 --enable-profile)
755 _profile='-p'
757 --disable-profile)
758 _profile=
760 --enable-debug)
761 _debug='-g'
763 --enable-debug=*)
764 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
766 --disable-debug)
767 _debug=
769 --enable-gcc-check) _gcc_check=yes ;;
770 --disable-gcc-check) _gcc_check=no ;;
771 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
772 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
773 --enable-cross-compile) _cross_compile=yes ;;
774 --disable-cross-compile) _cross_compile=no ;;
775 --enable-mencoder) _mencoder=yes ;;
776 --disable-mencoder) _mencoder=no ;;
777 --enable-mplayer) _mplayer=yes ;;
778 --disable-mplayer) _mplayer=no ;;
779 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
780 --disable-dynamic-plugins) _dynamic_plugins=no ;;
781 --enable-x11) _x11=yes ;;
782 --disable-x11) _x11=no ;;
783 --enable-xshape) _xshape=yes ;;
784 --disable-xshape) _xshape=no ;;
785 --enable-xv) _xv=yes ;;
786 --disable-xv) _xv=no ;;
787 --enable-xvmc) _xvmc=yes ;;
788 --disable-xvmc) _xvmc=no ;;
789 --enable-sdl) _sdl=yes ;;
790 --disable-sdl) _sdl=no ;;
791 --enable-directx) _directx=yes ;;
792 --disable-directx) _directx=no ;;
793 --enable-win32waveout) _win32waveout=yes ;;
794 --disable-win32waveout) _win32waveout=no ;;
795 --enable-nas) _nas=yes ;;
796 --disable-nas) _nas=no ;;
797 --enable-png) _png=yes ;;
798 --disable-png) _png=no ;;
799 --enable-jpeg) _jpeg=yes ;;
800 --disable-jpeg) _jpeg=no ;;
801 --enable-pnm) _pnm=yes ;;
802 --disable-pnm) _pnm=no ;;
803 --enable-md5sum) _md5sum=yes ;;
804 --disable-md5sum) _md5sum=no ;;
805 --enable-gif) _gif=yes ;;
806 --disable-gif) _gif=no ;;
807 --enable-gl) _gl=yes ;;
808 --disable-gl) _gl=no ;;
809 --enable-ggi) _ggi=yes ;;
810 --disable-ggi) _ggi=no ;;
811 --enable-ggiwmh) _ggiwmh=yes ;;
812 --disable-ggiwmh) _ggiwmh=no ;;
813 --enable-aa) _aa=yes ;;
814 --disable-aa) _aa=no ;;
815 --enable-caca) _caca=yes ;;
816 --disable-caca) _caca=no ;;
817 --enable-svga) _svga=yes ;;
818 --disable-svga) _svga=no ;;
819 --enable-vesa) _vesa=yes ;;
820 --disable-vesa) _vesa=no ;;
821 --enable-fbdev) _fbdev=yes ;;
822 --disable-fbdev) _fbdev=no ;;
823 --enable-dvb) _dvb=yes ;;
824 --disable-dvb) _dvb=no ;;
825 --enable-dvbhead) _dvbhead=yes ;;
826 --disable-dvbhead) _dvbhead=no ;;
827 --enable-dxr2) _dxr2=yes ;;
828 --disable-dxr2) _dxr2=no ;;
829 --enable-dxr3) _dxr3=yes ;;
830 --disable-dxr3) _dxr3=no ;;
831 --enable-ivtv) _ivtv=yes ;;
832 --disable-ivtv) _ivtv=no ;;
833 --enable-iconv) _iconv=yes ;;
834 --disable-iconv) _iconv=no ;;
835 --enable-langinfo) _langinfo=yes ;;
836 --disable-langinfo) _langinfo=no ;;
837 --enable-rtc) _rtc=yes ;;
838 --disable-rtc) _rtc=no ;;
839 --enable-libdv) _libdv=yes ;;
840 --disable-libdv) _libdv=no ;;
841 --enable-ossaudio) _ossaudio=yes ;;
842 --disable-ossaudio) _ossaudio=no ;;
843 --enable-arts) _arts=yes ;;
844 --disable-arts) _arts=no ;;
845 --enable-esd) _esd=yes ;;
846 --disable-esd) _esd=no ;;
847 --enable-polyp) _polyp=yes ;;
848 --disable-polyp) _polyp=no ;;
849 --enable-jack) _jack=yes ;;
850 --disable-jack) _jack=no ;;
851 --enable-openal) _openal=yes ;;
852 --disable-openal) _openal=no ;;
853 --enable-mad) _mad=yes ;;
854 --disable-mad) _mad=no ;;
855 --enable-toolame) _toolame=yes ;;
856 --disable-toolame) _toolame=no ;;
857 --enable-twolame) _twolame=yes ;;
858 --disable-twolame) _twolame=no ;;
859 --enable-libcdio) _libcdio=yes ;;
860 --disable-libcdio) _libcdio=no ;;
861 --enable-liblzo) _liblzo=yes ;;
862 --disable-liblzo) _liblzo=no ;;
863 --enable-libvorbis) _libvorbis=yes ;;
864 --disable-libvorbis) _libvorbis=no ;;
865 --enable-speex) _speex=yes ;;
866 --disable-speex) _speex=no ;;
867 --enable-tremor-internal) _tremor_internal=yes ;;
868 --disable-tremor-internal) _tremor_internal=no ;;
869 --enable-tremor-low) _tremor_low=yes ;;
870 --disable-tremor-low) _tremor_low=no ;;
871 --enable-tremor-external) _tremor_external=yes ;;
872 --disable-tremor-external) _tremor_external=no ;;
873 --enable-theora) _theora=yes ;;
874 --disable-theora) _theora=no ;;
875 --enable-mp3lib) _mp3lib=yes ;;
876 --disable-mp3lib) _mp3lib=no ;;
877 --enable-liba52) _liba52=yes ;;
878 --disable-liba52) _liba52=no ;;
879 --enable-libdts) _libdts=yes ;;
880 --disable-libdts) _libdts=no ;;
881 --enable-libmpeg2) _libmpeg2=yes ;;
882 --disable-libmpeg2) _libmpeg2=no ;;
883 --enable-musepack) _musepack=yes ;;
884 --disable-musepack) _musepack=no ;;
885 --enable-faad-internal) _faad_internal=yes ;;
886 --disable-faad-internal) _faad_internal=no ;;
887 --enable-faad-external) _faad_external=yes ;;
888 --disable-faad-external) _faad_external=no ;;
889 --enable-faad-fixed) _faad_fixed=yes ;;
890 --disable-faad-fixed) _faad_fixed=no ;;
891 --enable-faac) _faac=yes ;;
892 --disable-faac) _faac=no ;;
893 --enable-ladspa) _ladspa=yes ;;
894 --disable-ladspa) _ladspa=no ;;
895 --enable-xmms) _xmms=yes ;;
896 --disable-xmms) _xmms=no ;;
897 --enable-dvdread) _dvdread=yes ;;
898 --disable-dvdread) _dvdread=no ;;
899 --enable-dvdread-internal) _dvdread_internal=yes ;;
900 --disable-dvdread-internal) _dvdread_internal=no ;;
901 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
902 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
903 --enable-dvdnav) _dvdnav=yes ;;
904 --disable-dvdnav) _dvdnav=no ;;
905 --enable-xanim) _xanim=yes ;;
906 --disable-xanim) _xanim=no ;;
907 --enable-real) _real=yes ;;
908 --disable-real) _real=no ;;
909 --enable-live) _live=yes ;;
910 --disable-live) _live=no ;;
911 --enable-xinerama) _xinerama=yes ;;
912 --disable-xinerama) _xinerama=no ;;
913 --enable-mga) _mga=yes ;;
914 --disable-mga) _mga=no ;;
915 --enable-xmga) _xmga=yes ;;
916 --disable-xmga) _xmga=no ;;
917 --enable-vm) _vm=yes ;;
918 --disable-vm) _vm=no ;;
919 --enable-xf86keysym) _xf86keysym=yes ;;
920 --disable-xf86keysym) _xf86keysym=no ;;
921 --enable-mlib) _mlib=yes ;;
922 --disable-mlib) _mlib=no ;;
923 --enable-sunaudio) _sunaudio=yes ;;
924 --disable-sunaudio) _sunaudio=no ;;
925 --enable-sgiaudio) _sgiaudio=yes ;;
926 --disable-sgiaudio) _sgiaudio=no ;;
927 --enable-alsa) _alsa=yes ;;
928 --disable-alsa) _alsa=no ;;
929 --enable-tv) _tv=yes ;;
930 --disable-tv) _tv=no ;;
931 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
932 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
933 --enable-tv-v4l1) _tv_v4l1=yes ;;
934 --disable-tv-v4l1) _tv_v4l1=no ;;
935 --enable-tv-v4l2) _tv_v4l2=yes ;;
936 --disable-tv-v4l2) _tv_v4l2=no ;;
937 --enable-radio) _radio=yes ;;
938 --enable-radio-capture) _radio_capture=yes ;;
939 --disable-radio-capture) _radio_capture=no ;;
940 --disable-radio) _radio=no ;;
941 --enable-radio-v4l) _radio_v4l=yes ;;
942 --disable-radio-v4l) _radio_v4l=no ;;
943 --enable-radio-v4l2) _radio_v4l2=yes ;;
944 --disable-radio-v4l2) _radio_v4l2=no ;;
945 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
946 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
947 --enable-pvr) _pvr=yes ;;
948 --disable-pvr) _pvr=no ;;
949 --enable-fastmemcpy) _fastmemcpy=yes ;;
950 --disable-fastmemcpy) _fastmemcpy=no ;;
951 --enable-network) _network=yes ;;
952 --disable-network) _network=no ;;
953 --enable-winsock2) _winsock2=yes ;;
954 --disable-winsock2) _winsock2=no ;;
955 --enable-smb) _smbsupport=yes ;;
956 --disable-smb) _smbsupport=no ;;
957 --enable-vidix-internal) _vidix_internal=yes ;;
958 --disable-vidix-internal) _vidix_internal=no ;;
959 --enable-vidix-external) _vidix_external=yes ;;
960 --disable-vidix-external) _vidix_external=no ;;
961 --with-vidix-drivers=*)
962 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
964 --enable-joystick) _joystick=yes ;;
965 --disable-joystick) _joystick=no ;;
966 --enable-xvid) _xvid=yes ;;
967 --disable-xvid) _xvid=no ;;
968 --enable-x264) _x264=yes ;;
969 --disable-x264) _x264=no ;;
970 --enable-nut) _nut=yes ;;
971 --disable-nut) _nut=no ;;
972 --enable-libavutil_a) _libavutil_a=yes ;;
973 --disable-libavutil_a) _libavutil_a=no ;;
974 --enable-libavutil_so) _libavutil_so=yes ;;
975 --disable-libavutil_so) _libavutil_so=no ;;
976 --enable-libavcodec_a) _libavcodec_a=yes ;;
977 --disable-libavcodec_a) _libavcodec_a=no ;;
978 --enable-libavcodec_so) _libavcodec_so=yes ;;
979 --disable-libavcodec_so) _libavcodec_so=no ;;
980 --enable-amr_nb) _amr_nb=yes ;;
981 --disable-amr_nb) _amr_nb=no ;;
982 --enable-amr_wb) _amr_wb=yes ;;
983 --disable-amr_wb) _amr_wb=no ;;
984 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
985 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
986 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
987 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
988 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
989 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
990 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
991 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
992 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
993 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
994 --enable-libavformat_a) _libavformat_a=yes ;;
995 --disable-libavformat_a) _libavformat_a=no ;;
996 --enable-libavformat_so) _libavformat_so=yes ;;
997 --disable-libavformat_so) _libavformat_so=no ;;
998 --enable-libpostproc_a) _libpostproc_a=yes ;;
999 --disable-libpostproc_a) _libpostproc_a=no ;;
1000 --enable-libpostproc_so) _libpostproc_so=yes ;;
1001 --disable-libpostproc_so) _libpostproc_so=no ;;
1002 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1003 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1005 --enable-lirc) _lirc=yes ;;
1006 --disable-lirc) _lirc=no ;;
1007 --enable-lircc) _lircc=yes ;;
1008 --disable-lircc) _lircc=no ;;
1009 --enable-gui) _gui=yes ;;
1010 --disable-gui) _gui=no ;;
1011 --enable-gtk1) _gtk1=yes ;;
1012 --disable-gtk1) _gtk1=no ;;
1013 --enable-termcap) _termcap=yes ;;
1014 --disable-termcap) _termcap=no ;;
1015 --enable-termios) _termios=yes ;;
1016 --disable-termios) _termios=no ;;
1017 --enable-3dfx) _3dfx=yes ;;
1018 --disable-3dfx) _3dfx=no ;;
1019 --enable-s3fb) _s3fb=yes ;;
1020 --disable-s3fb) _s3fb=no ;;
1021 --enable-tdfxfb) _tdfxfb=yes ;;
1022 --disable-tdfxfb) _tdfxfb=no ;;
1023 --disable-tdfxvid) _tdfxvid=no ;;
1024 --enable-tdfxvid) _tdfxvid=yes ;;
1025 --disable-tga) _tga=no ;;
1026 --enable-tga) _tga=yes ;;
1027 --enable-directfb) _directfb=yes ;;
1028 --disable-directfb) _directfb=no ;;
1029 --enable-zr) _zr=yes ;;
1030 --disable-zr) _zr=no ;;
1031 --enable-bl) _bl=yes ;;
1032 --disable-bl) _bl=no ;;
1033 --enable-mtrr) _mtrr=yes ;;
1034 --disable-mtrr) _mtrr=no ;;
1035 --enable-largefiles) _largefiles=yes ;;
1036 --disable-largefiles) _largefiles=no ;;
1037 --enable-shm) _shm=yes ;;
1038 --disable-shm) _shm=no ;;
1039 --enable-select) _select=yes ;;
1040 --disable-select) _select=no ;;
1041 --enable-linux-devfs) _linux_devfs=yes ;;
1042 --disable-linux-devfs) _linux_devfs=no ;;
1043 --enable-cdparanoia) _cdparanoia=yes ;;
1044 --disable-cdparanoia) _cdparanoia=no ;;
1045 --enable-cddb) _cddb=yes ;;
1046 --disable-cddb) _cddb=no ;;
1047 --enable-big-endian) _big_endian=yes ;;
1048 --disable-big-endian) _big_endian=no ;;
1049 --enable-bitmap-font) _bitmap_font=yes ;;
1050 --disable-bitmap-font) _bitmap_font=no ;;
1051 --enable-freetype) _freetype=yes ;;
1052 --disable-freetype) _freetype=no ;;
1053 --enable-fontconfig) _fontconfig=yes ;;
1054 --disable-fontconfig) _fontconfig=no ;;
1055 --enable-unrarlib) _unrarlib=yes ;;
1056 --disable-unrarlib) _unrarlib=no ;;
1057 --enable-ftp) _ftp=yes ;;
1058 --disable-ftp) _ftp=no ;;
1059 --enable-vstream) _vstream=yes ;;
1060 --disable-vstream) _vstream=no ;;
1061 --enable-pthreads) _pthreads=yes ;;
1062 --disable-pthreads) _pthreads=no ;;
1063 --enable-ass) _ass=yes ;;
1064 --disable-ass) _ass=no ;;
1065 --enable-rpath) _rpath=yes ;;
1066 --disable-rpath) _rpath=no ;;
1067 --enable-color-console) _color_console=yes ;;
1068 --disable-color-console) _color_console=no ;;
1070 --enable-fribidi) _fribidi=yes ;;
1071 --disable-fribidi) _fribidi=no ;;
1073 --enable-enca) _enca=yes ;;
1074 --disable-enca) _enca=no ;;
1076 --enable-inet6) _inet6=yes ;;
1077 --disable-inet6) _inet6=no ;;
1079 --enable-gethostbyname2) _gethostbyname2=yes ;;
1080 --disable-gethostbyname2) _gethostbyname2=no ;;
1082 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1083 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1084 --disable-dga) _dga=no ;;
1086 --enable-menu) _menu=yes ;;
1087 --disable-menu) _menu=no ;;
1089 --enable-qtx) _qtx=yes ;;
1090 --disable-qtx) _qtx=no ;;
1092 --enable-macosx) _macosx=yes ;;
1093 --disable-macosx) _macosx=no ;;
1094 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1095 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1096 --enable-macosx-bundle) _macosx_bundle=yes;;
1097 --disable-macosx-bundle) _macosx_bundle=no;;
1099 --enable-maemo) _maemo=yes ;;
1100 --disable-maemo) _maemo=no ;;
1102 --enable-sortsub) _sortsub=yes ;;
1103 --disable-sortsub) _sortsub=no ;;
1105 --enable-crash-debug) _crash_debug=yes ;;
1106 --disable-crash-debug) _crash_debug=no ;;
1107 --enable-sighandler) _sighandler=yes ;;
1108 --disable-sighandler) _sighandler=no ;;
1109 --enable-win32dll) _win32dll=yes ;;
1110 --disable-win32dll) _win32dll=no ;;
1112 --enable-sse) _sse=yes ;;
1113 --disable-sse) _sse=no ;;
1114 --enable-sse2) _sse2=yes ;;
1115 --disable-sse2) _sse2=no ;;
1116 --enable-mmxext) _mmxext=yes ;;
1117 --disable-mmxext) _mmxext=no ;;
1118 --enable-3dnow) _3dnow=yes ;;
1119 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1120 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1121 --disable-3dnowext) _3dnowext=no ;;
1122 --enable-cmov) _cmov=yes ;;
1123 --disable-cmov) _cmov=no ;;
1124 --enable-fast-cmov) _fast_cmov=yes ;;
1125 --disable-fast-cmov) _fast_cmov=no ;;
1126 --enable-altivec) _altivec=yes ;;
1127 --disable-altivec) _altivec=no ;;
1128 --enable-armv5te) _armv5te=yes ;;
1129 --disable-armv5te) _armv5te=no ;;
1130 --enable-iwmmxt) _iwmmxt=yes ;;
1131 --disable-iwmmxt) _iwmmxt=no ;;
1132 --enable-mmx) _mmx=yes ;;
1133 --disable-mmx) # 3Dnow! and MMX2 require MMX
1134 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1137 echo "Unknown parameter: $ac_option"
1138 exit 1
1141 esac
1142 done
1144 # Atmos: moved this here, to be correct, if --prefix is specified
1145 test -z "$_bindir" && _bindir="$_prefix/bin"
1146 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1147 test -z "$_mandir" && _mandir="$_prefix/man"
1148 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1149 test -z "$_libdir" && _libdir="$_prefix/lib"
1151 # Determine our OS name and CPU architecture
1152 if test -z "$_target" ; then
1153 # OS name
1154 system_name=`uname -s 2>&1`
1155 case "$system_name" in
1156 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX|AmigaOS)
1158 IRIX*)
1159 system_name=IRIX
1161 GNU/kFreeBSD)
1162 system_name=FreeBSD
1164 HP-UX*)
1165 system_name=HP-UX
1167 [cC][yY][gG][wW][iI][nN]*)
1168 system_name=CYGWIN
1170 MINGW32*)
1171 system_name=MINGW32
1174 system_name="$system_name-UNKNOWN"
1176 esac
1179 # host's CPU/instruction set
1180 host_arch=`uname -p 2>&1`
1181 case "$host_arch" in
1182 i386|sparc|ppc|alpha|arm|mips|vax)
1184 powerpc) # Darwin returns 'powerpc'
1185 host_arch=ppc
1187 *) # uname -p on Linux returns 'unknown' for the processor type,
1188 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1190 # Maybe uname -m (machine hardware name) returns something we
1191 # recognize.
1193 # x86/x86pc is used by QNX
1194 case "`uname -m 2>&1`" in
1195 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 ;;
1196 ia64) host_arch=ia64 ;;
1197 x86_64|amd64)
1198 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1199 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1200 host_arch=x86_64
1201 else
1202 host_arch=i386
1205 macppc|ppc|ppc64) host_arch=ppc ;;
1206 alpha) host_arch=alpha ;;
1207 sparc) host_arch=sparc ;;
1208 sparc64) host_arch=sparc64 ;;
1209 parisc*|hppa*|9000*) host_arch=hppa ;;
1210 arm*|zaurus|cats) host_arch=arm ;;
1211 s390) host_arch=s390 ;;
1212 s390x) host_arch=s390x ;;
1213 mips*) host_arch=mips ;;
1214 vax) host_arch=vax ;;
1215 *) host_arch=UNKNOWN ;;
1216 esac
1218 esac
1219 else # if test -z "$_target"
1220 system_name=`echo $_target | cut -d '-' -f 2`
1221 case "`echo $system_name | tr A-Z a-z`" in
1222 linux) system_name=Linux ;;
1223 freebsd) system_name=FreeBSD ;;
1224 gnu/kfreebsd) system_name=FreeBSD ;;
1225 netbsd) system_name=NetBSD ;;
1226 bsd/os) system_name=BSD/OS ;;
1227 openbsd) system_name=OpenBSD ;;
1228 sunos) system_name=SunOS ;;
1229 qnx) system_name=QNX ;;
1230 morphos) system_name=MorphOS ;;
1231 amigaos) system_name=AmigaOS ;;
1232 mingw32msvc) system_name=MINGW32 ;;
1233 esac
1234 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1235 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
1238 echo "Detected operating system: $system_name"
1239 echo "Detected host architecture: $host_arch"
1241 if test "$_runtime_cpudetection" = yes && not x86 && not ppc; then
1242 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1245 # LGB: temporary files
1246 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1247 test "$I" && break
1248 done
1250 TMPLOG="configure.log"
1251 rm -f "$TMPLOG"
1252 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1253 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1254 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
1255 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1257 # config files
1259 # FIXME: A lot of stuff is installed under /usr/local
1260 # NK: But we should never use this stuff implicitly since we call compiler
1261 # from /usr we should be sure that there no effects from other compilers
1262 # (libraries) which might be installed into /usr/local. Let users use this
1263 # stuff explicitly as command line argument. In other words: It would be
1264 # resonable to have only /usr/include or only /usr/local/include.
1266 if openbsd ; then
1267 _ldconfig="ldconfig -R"
1270 if freebsd ; then
1271 _ld_extra="$_ld_extra -L/usr/local/lib"
1272 _inc_extra="$_inc_extra -I/usr/local/include"
1275 if darwin; then
1276 _ld_extra="$_ld_extra -L/usr/local/lib"
1277 _inc_extra="$_inc_extra -I/usr/local/include"
1280 if aix ; then
1281 _ld_extra="$_ld_extra -lC"
1284 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
1285 if irix ; then
1286 _ranlib='ar -r'
1287 elif linux ; then
1288 _ranlib='true'
1291 if win32 ; then
1292 _exesuf=".exe"
1293 # -lwinmm is always needed for osdep/timer-win2.c
1294 _ld_extra="$_ld_extra -lwinmm"
1295 _confwin32='TARGET_WIN32 = yes'
1296 else
1297 _confwin32='TARGET_WIN32 = no'
1300 if mingw32 ; then
1301 _need_shmem=no
1304 if cygwin ; then
1305 _def_confwin32='#define WIN32'
1308 if amigaos ; then
1309 _select=no
1310 _sighandler=no
1311 _stream_cache=no
1312 _def_stream_cache="#undef USE_STREAM_CACHE"
1315 if qnx ; then
1316 _ld_extra="$_ld_extra -lph"
1319 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1320 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1321 # know about '-n'.
1322 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1323 _head() { head -$1 2>/dev/null ; }
1324 else
1325 _head() { head -n $1 2>/dev/null ; }
1327 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1328 _tail() { tail -$1 2>/dev/null ; }
1329 else
1330 _tail() { tail -n $1 2>/dev/null ; }
1333 # Checking CC version...
1334 if test "$_gcc_check" = yes ; then
1335 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1336 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1337 echocheck "$_cc version"
1338 cc_vendor=intel
1339 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1340 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1341 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1342 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1343 # TODO verify older icc/ecc compatibility
1344 case $cc_version in
1346 cc_version="v. ?.??, bad"
1347 cc_verc_fail=yes
1349 8.0|9.1)
1350 cc_version="$cc_version, ok"
1351 cc_verc_fail=no
1354 cc_version="$cc_version, bad"
1355 cc_verc_fail=yes
1357 esac
1358 echores "$cc_version"
1359 else
1360 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
1361 echocheck "$_cc version"
1362 cc_vendor=gnu
1363 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1364 cc_version=`$_cc -dumpversion 2>&1`
1365 if test "$?" -gt 0; then
1366 cc_version="not found"
1368 case $cc_version in
1370 cc_version="v. ?.??, bad"
1371 cc_verc_fail=yes
1373 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1374 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1375 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1376 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1377 cc_version="$cc_version, ok"
1378 cc_verc_fail=no
1380 'not found')
1381 cc_verc_fail=yes
1384 cc_version="$cc_version, bad"
1385 cc_verc_fail=yes
1387 esac
1388 echores "$cc_version"
1389 test "$cc_verc_fail" = "no" && break
1390 done
1391 fi # icc
1392 if test "$cc_verc_fail" = yes ; then
1393 cat <<EOF
1395 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1397 You are not using a supported compiler. We do not have the time to make sure
1398 everything works with compilers other than the ones we use. Use either the
1399 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1400 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1402 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1403 mplayer and lame (which is used for mencoder). If you get compile errors,
1404 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1405 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1406 bugs!
1408 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1411 die "Bad gcc version"
1413 else
1414 cat <<EOF
1416 ******************************************************************************
1418 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1419 Ok. You know. Do it.
1421 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1422 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1423 Lame which is used by mencoder produces weird errors, too.
1425 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1426 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1428 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1430 ******************************************************************************
1434 read _answer
1437 echocheck "host cc"
1438 test "$_host_cc" || _host_cc=$_cc
1439 echores $_host_cc
1441 echocheck "cross compilation"
1442 if test $_cross_compile = auto ; then
1443 cat > $TMPC << EOF
1444 int main() { return 0; }
1446 _cross_compile=yes
1447 cc_check && "$TMPO" && _cross_compile=no
1449 echores $_cross_compile
1451 if test $_cross_compile = yes; then
1452 tmp_run() {
1453 return 0
1457 # ---
1459 # now that we know what compiler should be used for compilation, try to find
1460 # out which assembler is used by the $_cc compiler
1461 if test "$_as" = auto ; then
1462 _as=`$_cc -print-prog-name=as`
1463 test -z "$_as" && _as=as
1466 # XXX: this should be ok..
1467 _cpuinfo="echo"
1469 if test "$_runtime_cpudetection" = no ; then
1471 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1472 # FIXME: Remove the cygwin check once AMD CPUs are supported
1473 if test -r /proc/cpuinfo && not cygwin; then
1474 # Linux with /proc mounted, extract CPU information from it
1475 _cpuinfo="cat /proc/cpuinfo"
1476 elif test -r /compat/linux/proc/cpuinfo && not x86_32 ; then
1477 # FreeBSD with Linux emulation /proc mounted,
1478 # extract CPU information from it
1479 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1480 elif darwin && not x86_32 ; then
1481 # use hostinfo on Darwin
1482 _cpuinfo="hostinfo"
1483 elif aix; then
1484 # use 'lsattr' on AIX
1485 _cpuinfo="lsattr -E -l proc0 -a type"
1486 elif x86; then
1487 # all other OSes try to extract CPU information from a small helper
1488 # program cpuinfo instead
1489 $_cc -o cpuinfo cpuinfo.c
1490 _cpuinfo="./cpuinfo"
1493 if x86 ; then
1494 # gather more CPU information
1495 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1496 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1497 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1498 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1499 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1501 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1503 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1504 -e s/xmm/sse/ -e s/kni/sse/`
1506 for ext in $pparam ; do
1507 eval test \$_$ext = auto 2>/dev/null && eval _$ext=kernel_check
1508 done
1510 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1511 test $_sse = kernel_check && _mmxext=kernel_check
1513 echocheck "CPU vendor"
1514 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1516 echocheck "CPU type"
1517 echores "$pname"
1520 fi # test "$_runtime_cpudetection" = no
1522 if x86 && test "$_runtime_cpudetection" = no ; then
1523 extcheck() {
1524 if test "$1" = kernel_check ; then
1525 echocheck "kernel support of $2"
1526 cat > $TMPC <<EOF
1527 #include <signal.h>
1528 void catch() { exit(1); }
1529 int main(void){
1530 signal(SIGILL, catch);
1531 __asm__ __volatile__ ("$3":::"memory");return(0);
1535 if cc_check && tmp_run ; then
1536 eval _$2=yes
1537 echores "yes"
1538 _optimizing="$_optimizing $2"
1539 return 0
1540 else
1541 eval _$2=no
1542 echores "failed"
1543 echo "It seems that your kernel does not correctly support $2."
1544 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1545 return 1
1548 return 0
1551 extcheck $_mmx "mmx" "emms"
1552 extcheck $_mmxext "mmxext" "sfence"
1553 extcheck $_3dnow "3dnow" "femms"
1554 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1555 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1556 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1557 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1559 echocheck "mtrr support"
1560 if test "$_mtrr" = kernel_check ; then
1561 _mtrr="yes"
1562 _optimizing="$_optimizing mtrr"
1564 echores "$_mtrr"
1566 if test "$_gcc3_ext" != ""; then
1567 # if we had to disable sse/sse2 because the active kernel does not
1568 # support this instruction set extension, we also have to tell
1569 # gcc3 to not generate sse/sse2 instructions for normal C code
1570 cat > $TMPC << EOF
1571 int main(void) { return 0; }
1573 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1578 case "$host_arch" in
1579 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1580 _def_arch_x86="#define ARCH_X86 1"
1581 _target_arch_x86="TARGET_ARCH_X86 = yes"
1582 _def_arch="#define ARCH_X86_32 1"
1583 _target_arch="TARGET_ARCH_X86_32 = yes"
1584 iproc=486
1585 proc=i486
1588 if test "$_runtime_cpudetection" = no ; then
1589 case "$pvendor" in
1590 AuthenticAMD)
1591 case "$pfamily" in
1592 3) proc=i386 iproc=386 ;;
1593 4) proc=i486 iproc=486 ;;
1594 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1595 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1596 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1597 proc=k6-3
1598 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1599 proc=geode
1600 elif test "$pmodel" -ge 8; then
1601 proc=k6-2
1602 elif test "$pmodel" -ge 6; then
1603 proc=k6
1604 else
1605 proc=i586
1608 6) iproc=686
1609 # It's a bit difficult to determine the correct type of Family 6
1610 # AMD CPUs just from their signature. Instead, we check directly
1611 # whether it supports SSE.
1612 if test "$_sse" = yes; then
1613 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1614 proc=athlon-xp
1615 else
1616 # Again, gcc treats athlon and athlon-tbird similarly.
1617 proc=athlon
1620 15) iproc=686
1621 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1622 # caught and remedied in the optimization tests below.
1623 proc=k8
1626 *) proc=k8 iproc=686 ;;
1627 esac
1629 GenuineIntel)
1630 case "$pfamily" in
1631 3) proc=i386 iproc=386 ;;
1632 4) proc=i486 iproc=486 ;;
1633 5) iproc=586
1634 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1635 proc=pentium-mmx # 4 is desktop, 8 is mobile
1636 else
1637 proc=i586
1640 6) iproc=686
1641 if test "$pmodel" -ge 15; then
1642 proc=core2
1643 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1644 proc=pentium-m
1645 elif test "$pmodel" -ge 7; then
1646 proc=pentium3
1647 elif test "$pmodel" -ge 3; then
1648 proc=pentium2
1649 else
1650 proc=i686
1653 15) iproc=686
1654 # A nocona in 32-bit mode has no more capabilities than a prescott.
1655 if test "$pmodel" -ge 3; then
1656 proc=prescott
1657 else
1658 proc=pentium4
1661 *) proc=prescott iproc=686 ;;
1662 esac
1664 CentaurHauls)
1665 case "$pfamily" in
1666 5) iproc=586
1667 if test "$pmodel" -ge 8; then
1668 proc=winchip2
1669 elif test "$pmodel" -ge 4; then
1670 proc=winchip-c6
1671 else
1672 proc=i586
1675 6) iproc=686
1676 if test "$pmodel" -ge 9; then
1677 proc=c3-2
1678 else
1679 proc=c3
1680 iproc=586
1683 *) proc=i686 iproc=i686 ;;
1684 esac
1686 unknown)
1687 case "$pfamily" in
1688 3) proc=i386 iproc=386 ;;
1689 4) proc=i486 iproc=486 ;;
1690 *) proc=i586 iproc=586 ;;
1691 esac
1694 proc=i586 iproc=586 ;;
1695 esac
1696 fi # test "$_runtime_cpudetection" = no
1699 # check that gcc supports our CPU, if not, fall back to earlier ones
1700 # LGB: check -mcpu and -march swithing step by step with enabling
1701 # to fall back till 386.
1703 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1705 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1706 cpuopt=-mtune
1707 else
1708 cpuopt=-mcpu
1711 echocheck "GCC & CPU optimization abilities"
1712 cat > $TMPC << EOF
1713 int main(void) { return 0; }
1715 if test "$_runtime_cpudetection" = no ; then
1716 if test "$proc" = "k8"; then
1717 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1719 if test "$proc" = "athlon-xp"; then
1720 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1722 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1723 cc_check -march=$proc $cpuopt=$proc || proc=k6
1725 if test "$proc" = "k6" || test "$proc" = "c3"; then
1726 if not cc_check -march=$proc $cpuopt=$proc; then
1727 if cc_check -march=i586 $cpuopt=i686; then
1728 proc=i586-i686
1729 else
1730 proc=i586
1734 if test "$proc" = "prescott" ; then
1735 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1737 if test "$proc" = "core2" ; then
1738 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1740 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
1741 cc_check -march=$proc $cpuopt=$proc || proc=i686
1743 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1744 cc_check -march=$proc $cpuopt=$proc || proc=i586
1746 if test "$proc" = "i586"; then
1747 cc_check -march=$proc $cpuopt=$proc || proc=i486
1749 if test "$proc" = "i486" ; then
1750 cc_check -march=$proc $cpuopt=$proc || proc=i386
1752 if test "$proc" = "i386" ; then
1753 cc_check -march=$proc $cpuopt=$proc || proc=error
1755 if test "$proc" = "error" ; then
1756 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1757 _mcpu=""
1758 _march=""
1759 _optimizing=""
1760 elif test "$proc" = "i586-i686"; then
1761 _march="-march=i586"
1762 _mcpu="$cpuopt=i686"
1763 _optimizing="$proc"
1764 else
1765 _march="-march=$proc"
1766 _mcpu="$cpuopt=$proc"
1767 _optimizing="$proc"
1769 else # if test "$_runtime_cpudetection" = no
1770 _mcpu="$cpuopt=generic"
1771 # at least i486 required, for bswap instruction
1772 _march="-march=i486"
1773 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1774 cc_check $_mcpu || _mcpu=""
1775 cc_check $_march $_mcpu || _march=""
1778 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1779 ## autodetected mcpu/march parameters
1780 if test "$_target" ; then
1781 # TODO: it may be a good idea to check GCC and fall back in all cases
1782 if test "$host_arch" = "i586-i686"; then
1783 _march="-march=i586"
1784 _mcpu="$cpuopt=i686"
1785 else
1786 _march="-march=$host_arch"
1787 _mcpu="$cpuopt=$host_arch"
1790 proc="$host_arch"
1792 case "$proc" in
1793 i386) iproc=386 ;;
1794 i486) iproc=486 ;;
1795 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1796 i686|athlon*|pentium*) iproc=686 ;;
1797 *) iproc=586 ;;
1798 esac
1801 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1802 _fast_cmov="yes"
1803 case "$proc" in
1804 pentium4|prescott|nocona)
1805 _fast_cmov="no"
1806 esac
1807 else
1808 _fast_cmov="no"
1811 echores "$proc"
1814 ia64)
1815 _def_arch='#define ARCH_IA64 1'
1816 _target_arch='TARGET_ARCH_IA64 = yes'
1817 iproc='ia64'
1818 proc=''
1819 _march=''
1820 _mcpu=''
1821 _optimizing=''
1824 x86_64|amd64)
1825 _def_arch='#define ARCH_X86_64 1'
1826 _target_arch='TARGET_ARCH_X86_64 = yes'
1827 _def_arch_x86="#define ARCH_X86 1"
1828 _target_arch_x86="TARGET_ARCH_X86 = yes"
1829 iproc='x86_64'
1831 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1832 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1833 cpuopt=-mtune
1834 else
1835 cpuopt=-mcpu
1837 if test "$_runtime_cpudetection" = no ; then
1838 case "$pvendor" in
1839 AuthenticAMD)
1840 proc=k8;;
1841 GenuineIntel)
1842 case "$pmodel" in
1843 6) proc=core2;;
1845 # 64-bit prescotts exist, but as far as GCC is concerned they
1846 # have the same capabilities as a nocona.
1847 proc=nocona;;
1848 esac
1851 proc=error;;
1852 esac
1853 fi # test "$_runtime_cpudetection" = no
1855 echocheck "GCC & CPU optimization abilities"
1856 cat > $TMPC << EOF
1857 int main(void) { return 0; }
1859 # This is a stripped-down version of the i386 fallback.
1860 if test "$_runtime_cpudetection" = no ; then
1861 # --- AMD processors ---
1862 if test "$proc" = "k8"; then
1863 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1865 # This will fail if gcc version < 3.3, which is ok because earlier
1866 # versions don't really support 64-bit on amd64.
1867 # Is this a valid assumption? -Corey
1868 if test "$proc" = "athlon-xp"; then
1869 cc_check -march=$proc $cpuopt=$proc || proc=error
1871 # --- Intel processors ---
1872 if test "$proc" = "core2"; then
1873 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1875 if test "$proc" = "nocona"; then
1876 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1878 if test "$proc" = "pentium4"; then
1879 cc_check -march=$proc $cpuopt=$proc || proc=error
1882 _march="-march=$proc"
1883 _mcpu="$cpuopt=$proc"
1884 if test "$proc" = "error" ; then
1885 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1886 _mcpu=""
1887 _march=""
1889 else # if test "$_runtime_cpudetection" = no
1890 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1891 _march="-march=x86-64"
1892 _mcpu="$cpuopt=generic"
1893 cc_check $_mcpu || _mcpu="x86-64"
1894 cc_check $_mcpu || _mcpu=""
1895 cc_check $_march $_mcpu || _march=""
1898 _optimizing=""
1900 echores "$proc"
1903 sparc)
1904 _def_arch='#define ARCH_SPARC 1'
1905 _target_arch='TARGET_ARCH_SPARC = yes'
1906 iproc='sparc'
1907 if sunos ; then
1908 echocheck "CPU type"
1909 karch=`uname -m`
1910 case "`echo $karch`" in
1911 sun4) proc=v7 ;;
1912 sun4c) proc=v7 ;;
1913 sun4d) proc=v8 ;;
1914 sun4m) proc=v8 ;;
1915 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1916 sun4v) proc=v9 ;;
1917 *) proc=v8 ;;
1918 esac
1919 echores "$proc"
1920 else
1921 proc=v8
1923 _march=''
1924 _mcpu="-mcpu=$proc"
1925 _optimizing="$proc"
1928 sparc64)
1929 _def_arch='#define ARCH_SPARC 1'
1930 _target_arch='TARGET_ARCH_SPARC = yes'
1931 _vis='yes'
1932 _def_vis='#define HAVE_VIS = yes'
1933 iproc='sparc'
1934 proc='v9'
1935 _march=''
1936 _mcpu="-mcpu=$proc"
1937 _optimizing="$proc"
1940 arm|armv4l|armv5tel)
1941 _def_arch='#define ARCH_ARMV4L 1'
1942 _target_arch='TARGET_ARCH_ARMV4L = yes'
1943 iproc='arm'
1944 proc=''
1945 _march=''
1946 _mcpu=''
1947 _optimizing=''
1950 ppc|powerpc)
1951 _def_arch='#define ARCH_POWERPC 1'
1952 _def_dcbzl='#define NO_DCBZL 1'
1953 _target_arch='TARGET_ARCH_POWERPC = yes'
1954 iproc='ppc'
1955 proc=''
1956 _march=''
1957 _mcpu=''
1958 _optimizing=''
1959 _altivec=no
1961 echocheck "CPU type"
1962 case $system_name in
1963 Linux)
1964 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1965 if test -n "`$_cpuinfo | grep altivec`"; then
1966 _altivec=yes
1969 Darwin)
1970 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1971 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
1972 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
1973 _altivec=yes
1976 NetBSD)
1977 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1978 case $cc_version in
1979 2*|3.0*|3.1*|3.2*|3.3*)
1982 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1983 _altivec=yes
1986 esac
1988 AIX)
1989 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
1991 esac
1992 if test "$_altivec" = yes; then
1993 echores "$proc altivec"
1994 else
1995 echores "$proc"
1998 echocheck "GCC & CPU optimization abilities"
2000 if test -n "$proc"; then
2001 case "$proc" in
2002 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2003 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2004 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2005 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2006 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2007 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2008 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2009 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2010 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2011 *) ;;
2012 esac
2013 # gcc 3.1(.1) and up supports 7400 and 7450
2014 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2015 case "$proc" in
2016 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2017 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2018 *) ;;
2019 esac
2021 # gcc 3.2 and up supports 970
2022 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2023 case "$proc" in
2024 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2025 _def_dcbzl='#undef NO_DCBZL' ;;
2026 *) ;;
2027 esac
2029 # gcc 3.3 and up supports POWER4
2030 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2031 case "$proc" in
2032 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2033 *) ;;
2034 esac
2036 # gcc 3.4 and up supports 440*
2037 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2038 case "$proc" in
2039 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2040 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2041 *) ;;
2042 esac
2044 # gcc 4.0 and up supports POWER5
2045 if test "$_cc_major" -ge "4"; then
2046 case "$proc" in
2047 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2048 *) ;;
2049 esac
2053 if test -n "$_mcpu"; then
2054 _optimizing=`echo $_mcpu | cut -c 8-`
2055 echores "$_optimizing"
2056 else
2057 echores "none"
2062 alpha)
2063 _def_arch='#define ARCH_ALPHA 1'
2064 _target_arch='TARGET_ARCH_ALPHA = yes'
2065 iproc='alpha'
2066 _march=''
2068 echocheck "CPU type"
2069 cat > $TMPC << EOF
2070 int main() {
2071 unsigned long ver, mask;
2072 asm ("implver %0" : "=r" (ver));
2073 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2074 printf("%ld-%x\n", ver, ~mask);
2075 return 0;
2078 $_cc -o "$TMPO" "$TMPC"
2079 case `"$TMPO"` in
2081 0-0) proc="ev4"; cpu_understands_mvi="0";;
2082 1-0) proc="ev5"; cpu_understands_mvi="0";;
2083 1-1) proc="ev56"; cpu_understands_mvi="0";;
2084 1-101) proc="pca56"; cpu_understands_mvi="1";;
2085 2-303) proc="ev6"; cpu_understands_mvi="1";;
2086 2-307) proc="ev67"; cpu_understands_mvi="1";;
2087 2-1307) proc="ev68"; cpu_understands_mvi="1";;
2088 esac
2089 echores "$proc"
2091 echocheck "GCC & CPU optimization abilities"
2092 if test "$proc" = "ev68" ; then
2093 cc_check -mcpu=$proc || proc=ev67
2095 if test "$proc" = "ev67" ; then
2096 cc_check -mcpu=$proc || proc=ev6
2098 _mcpu="-mcpu=$proc"
2099 echores "$proc"
2101 _optimizing="$proc"
2103 echocheck "MVI instruction support in GCC"
2104 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
2105 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2106 echores "yes"
2107 else
2108 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2109 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2113 mips)
2114 _def_arch='#define ARCH_SGI_MIPS 1'
2115 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
2116 iproc='sgi-mips'
2117 proc=''
2118 _march=''
2119 _mcpu=''
2120 _optimizing=''
2122 if irix ; then
2123 echocheck "CPU type"
2124 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2125 case "`echo $proc`" in
2126 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2127 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2128 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2129 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2130 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2131 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2132 esac
2133 # gcc < 3.x does not support -mtune.
2134 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2135 _mcpu=''
2137 echores "$proc"
2142 hppa)
2143 _def_arch='#define ARCH_PA_RISC 1'
2144 _target_arch='TARGET_ARCH_PA_RISC = yes'
2145 iproc='PA-RISC'
2146 proc=''
2147 _march=''
2148 _mcpu=''
2149 _optimizing=''
2152 s390)
2153 _def_arch='#define ARCH_S390 1'
2154 _target_arch='TARGET_ARCH_S390 = yes'
2155 iproc='390'
2156 proc=''
2157 _march=''
2158 _mcpu=''
2159 _optimizing=''
2162 s390x)
2163 _def_arch='#define ARCH_S390X 1'
2164 _target_arch='TARGET_ARCH_S390X = yes'
2165 iproc='390x'
2166 proc=''
2167 _march=''
2168 _mcpu=''
2169 _optimizing=''
2172 vax)
2173 _def_arch='#define ARCH_VAX 1'
2174 _target_arch='TARGET_ARCH_VAX = yes'
2175 iproc='vax'
2176 proc=''
2177 _march=''
2178 _mcpu=''
2179 _optimizing=''
2182 generic)
2183 _def_arch='#define ARCH_GENERIC 1'
2184 _target_arch='TARGET_ARCH_GENERIC = yes'
2185 iproc=''
2186 proc=''
2187 _march=''
2188 _mcpu=''
2189 _optimizing=''
2193 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2194 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2195 die "unsupported architecture $host_arch"
2197 esac # case "$host_arch" in
2199 if test "$_runtime_cpudetection" = yes ; then
2200 if x86 ; then
2201 _cmov=yes
2202 x86_32 && _cmov=no
2203 _mmx=yes
2204 _3dnow=yes
2205 _3dnowext=yes
2206 _mmxext=yes
2207 _sse=yes
2208 _sse2=yes
2209 _mtrr=yes
2211 if ppc; then
2212 _altivec=yes
2218 echocheck "assembler support of -pipe option"
2219 cat > $TMPC << EOF
2220 int main(void) { return 0; }
2222 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2225 echocheck "compiler support of named assembler arguments"
2226 _named_asm_args=yes
2227 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2228 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2229 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2230 _named_asm_args=no
2231 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2233 echores $_named_asm_args
2236 # Checking for CFLAGS
2237 _install_strip="-s"
2238 if test "$_profile" != "" || test "$_debug" != "" ; then
2239 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
2240 if test "$_cc_major" -ge "3" ; then
2241 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
2243 _install_strip=
2244 elif test -z "$CFLAGS" ; then
2245 if test "$cc_vendor" = "intel" ; then
2246 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2247 elif test "$cc_vendor" != "gnu" ; then
2248 CFLAGS="-O2 $_march $_mcpu $_pipe"
2249 else
2250 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2252 else
2253 _warn_CFLAGS=yes
2255 if test -n "$LDFLAGS" ; then
2256 _ld_extra="$_ld_extra $LDFLAGS"
2257 _warn_CFLAGS=yes
2258 elif test "$cc_vendor" = "intel" ; then
2259 _ld_extra="$_ld_extra -i-static"
2261 if test -n "$CPPFLAGS" ; then
2262 _inc_extra="$_inc_extra $CPPFLAGS"
2263 _warn_CFLAGS=yes
2268 if x86_32 ; then
2269 # Checking assembler (_as) compatibility...
2270 # Added workaround for older as that reads from stdin by default - atmos
2271 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2272 echocheck "assembler ($_as $as_version)"
2274 _pref_as_version='2.9.1'
2275 echo 'nop' > $TMPS
2276 if test "$_mmx" = yes ; then
2277 echo 'emms' >> $TMPS
2279 if test "$_3dnow" = yes ; then
2280 _pref_as_version='2.10.1'
2281 echo 'femms' >> $TMPS
2283 if test "$_3dnowext" = yes ; then
2284 _pref_as_version='2.10.1'
2285 echo 'pswapd %mm0, %mm0' >> $TMPS
2287 if test "$_mmxext" = yes ; then
2288 _pref_as_version='2.10.1'
2289 echo 'movntq %mm0, (%eax)' >> $TMPS
2291 if test "$_sse" = yes ; then
2292 _pref_as_version='2.10.1'
2293 echo 'xorps %xmm0, %xmm0' >> $TMPS
2295 #if test "$_sse2" = yes ; then
2296 # _pref_as_version='2.11'
2297 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2299 if test "$_cmov" = yes ; then
2300 _pref_as_version='2.10.1'
2301 echo 'cmovb %eax, %ebx' >> $TMPS
2303 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2305 if test "$as_verc_fail" != yes ; then
2306 echores "ok"
2307 else
2308 _res_comment="Upgrade binutils to ${_pref_as_version} ..."
2309 echores "failed"
2310 die "obsolete binutils version"
2313 fi #if x86_32
2315 echocheck ".align is a power of two"
2316 if test "$_asmalign_pot" = auto ; then
2317 _asmalign_pot=no
2318 cat > $TMPC << EOF
2319 main() { asm (".align 3"); }
2321 cc_check && _asmalign_pot=yes
2323 if test "$_asmalign_pot" = "yes" ; then
2324 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2325 else
2326 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2328 echores $_asmalign_pot
2331 #FIXME: This should happen before the check for CFLAGS..
2332 if ppc ; then
2334 # check if altivec is supported by the compiler, and how to enable it
2336 _altivec_gcc_flags=''
2338 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2339 echocheck "GCC altivec support"
2341 p=''
2342 cat > $TMPC << EOF
2343 int main() {
2344 return 0;
2347 FSF_flags='-maltivec -mabi=altivec'
2348 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2350 # check for Darwin-style flags first, since
2351 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2352 # accepts but ignores FSF-style flags...
2354 if test -z "$p"; then
2355 cc_check $Darwin_flags && p='Darwin'
2357 if test -z "$p"; then
2358 cc_check $FSF_flags && p='FSF'
2361 case $p in
2362 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2363 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2364 *) _altivec=no ;;
2365 esac
2367 if test -z "$p"; then
2368 p=none
2369 else
2370 p="$p-style ($_altivec_gcc_flags)"
2373 echores "$p"
2376 # check if <altivec.h> should be included
2378 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2380 if test "$_altivec" = yes ; then
2381 echocheck "altivec.h"
2382 cat > $TMPC << EOF
2383 #include <altivec.h>
2384 int main(void) { return 0; }
2386 _have_altivec_h=no
2387 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2388 if test "$_have_altivec_h" = yes ; then
2389 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2391 echores "$_have_altivec_h"
2394 # disable runtime cpudetection if
2395 # - we cannot generate altivec code
2396 # - altivec is disabled by the user
2398 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2399 _runtime_cpudetection=no
2402 # show that we are optimizing for altivec (if enabled and supported)
2404 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2405 _optimizing="$_optimizing altivec"
2408 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2410 if test "$_altivec" = yes ; then
2411 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2412 #_mcpu="$_mcpu $_altivec_gcc_flags"
2413 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2416 # setup _def_altivec correctly
2418 if test "$_altivec" = yes ; then
2419 _def_altivec='#define HAVE_ALTIVEC 1'
2420 else
2421 _def_altivec='#undef HAVE_ALTIVEC'
2425 if arm ; then
2426 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2427 if test $_armv5te = "auto" ; then
2428 cat > $TMPC << EOF
2429 int main(void) {
2430 __asm__ __volatile__ ("qadd r0, r0, r0");
2433 _armv5te=no
2434 cc_check && _armv5te=yes
2436 echores "$_armv5te"
2438 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2439 if test $_iwmmxt = "auto" ; then
2440 cat > $TMPC << EOF
2441 int main(void) {
2442 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2445 _iwmmxt=no
2446 cc_check && _iwmmxt=yes
2448 echores "$_iwmmxt"
2451 _def_mmx='#undef HAVE_MMX'
2452 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2453 _def_mmxext='#undef HAVE_MMX2'
2454 test "$_mmxext" = yes && _def_mmxext='#define HAVE_MMX2 1'
2455 _def_3dnow='#undef HAVE_3DNOW'
2456 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2457 _def_3dnowext='#undef HAVE_3DNOWEX'
2458 test "$_3dnowext" = yes && _def_3dnowext='#define HAVE_3DNOWEX 1'
2459 _def_sse='#undef HAVE_SSE'
2460 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2461 _def_sse2='#undef HAVE_SSE2'
2462 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2463 _def_cmov='#undef HAVE_CMOV'
2464 test "$_cmov" = yes && _def_cmov='#define HAVE_CMOV 1'
2465 _def_fast_cmov='#undef HAVE_FAST_CMOV'
2466 test "$_fast_cmov" = yes && _def_fast_cmov='#define HAVE_FAST_CMOV 1'
2467 _def_armv5te='#undef HAVE_ARMV5TE'
2468 test "$_armv5te" = yes && _def_armv5te='#define HAVE_ARMV5TE 1'
2469 _def_iwmmxt='#undef HAVE_IWMMXT'
2470 test "$_iwmmxt" = yes && _def_iwmmxt='#define HAVE_IWMMXT 1'
2472 # Checking kernel version...
2473 if x86_32 && linux ; then
2474 _k_verc_problem=no
2475 kernel_version=`uname -r 2>&1`
2476 echocheck "$system_name kernel version"
2477 case "$kernel_version" in
2478 '') kernel_version="?.??"; _k_verc_fail=yes;;
2479 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2480 _k_verc_problem=yes;;
2481 esac
2482 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2483 _k_verc_fail=yes
2485 if test "$_k_verc_fail" ; then
2486 echores "$kernel_version, fail"
2487 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2488 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2489 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2490 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2491 echo "2.2.x you must upgrade it to get SSE support!"
2492 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2493 else
2494 echores "$kernel_version, ok"
2498 if test "$_vidix_internal" = auto ; then
2499 _vidix_internal=no
2500 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2501 x86 && _vidix_internal=yes
2502 ppc && linux && _vidix_internal=yes
2503 alpha && linux && _vidix_internal=yes
2504 qnx && _vidix_internal=no
2505 sunos && not x86 && _vidix_internal=no
2506 beos && _vidix_internal=no
2507 darwin && _vidix_internal=no
2511 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2512 _awk=awk
2513 if test "$_vidix_internal" = yes ; then
2514 _awk_verc_fail=yes
2515 echocheck "awk"
2516 for _awk in mawk gawk nawk; do
2517 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2518 _awk_verc_fail=no
2519 break
2521 done
2522 test "$_awk_verc_fail" = yes && _awk=no
2523 echores "$_awk"
2524 if test "$_awk_verc_fail" = yes; then
2525 echo "VIDIX needs awk, but no working implementation was found!"
2526 echo "Try the GNU version, which can be downloaded from:"
2527 echo "ftp://ftp.gnu.org/gnu/gawk/"
2528 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2529 die "no awk"
2533 ######################
2534 # MAIN TESTS GO HERE #
2535 ######################
2538 echocheck "extra headers"
2539 if test "$_inc_extra" ; then
2540 echores "$_inc_extra"
2541 else
2542 echores "none"
2546 echocheck "extra libs"
2547 if test "$_ld_extra" ; then
2548 echores "$_ld_extra"
2549 else
2550 echores "none"
2553 echocheck "-lposix"
2554 cat > $TMPC <<EOF
2555 int main(void) { return 0; }
2557 if cc_check -lposix ; then
2558 _ld_extra="$_ld_extra -lposix"
2559 echores "yes"
2560 else
2561 echores "no"
2564 echocheck "-lm"
2565 cat > $TMPC <<EOF
2566 int main(void) { return 0; }
2568 if cc_check -lm ; then
2569 _ld_lm="-lm"
2570 echores "yes"
2571 else
2572 _ld_lm=""
2573 echores "no"
2577 echocheck "langinfo"
2578 if test "$_langinfo" = auto ; then
2579 cat > $TMPC <<EOF
2580 #include <langinfo.h>
2581 int main(void) { nl_langinfo(CODESET); return 0; }
2583 _langinfo=no
2584 cc_check && _langinfo=yes
2586 if test "$_langinfo" = yes ; then
2587 _def_langinfo='#define USE_LANGINFO 1'
2588 else
2589 _def_langinfo='#undef USE_LANGINFO'
2591 echores "$_langinfo"
2594 echocheck "language"
2595 test -z "$_language" && _language=$LINGUAS
2596 _language=`echo $_language | sed 's/,/ /g'`
2597 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2598 for lang in $_language ; do
2599 test "$lang" = all && lang=en
2600 if test -f "help/help_mp-${lang}.h" ; then
2601 _language=$lang
2602 break
2603 else
2604 echo ${_echo_n} "$lang not found, ${_echo_c}"
2605 _language=`echo $_language | sed "s/$lang *//"`
2607 done
2608 test -z "$_language" && _language=en
2609 _mp_help="help/help_mp-${_language}.h"
2610 test -f $_mp_help || die "$_mp_help not found"
2611 for lang in $LANGUAGES ; do
2612 if test -f "DOCS/man/$lang/mplayer.1" ; then
2613 MAN_LANG="$lang $MAN_LANG"
2615 done
2616 _doc_lang=$_language
2617 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2618 echores "using $_language (man pages: $MAN_LANG)"
2621 echocheck "enable sighandler"
2622 if test "$_sighandler" = yes ; then
2623 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2624 else
2625 _def_sighandler='#undef ENABLE_SIGHANDLER'
2627 echores "$_sighandler"
2629 echocheck "runtime cpudetection"
2630 if test "$_runtime_cpudetection" = yes ; then
2631 _optimizing="Runtime CPU-Detection enabled"
2632 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2633 else
2634 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2636 echores "$_runtime_cpudetection"
2639 echocheck "restrict keyword"
2640 for restrict_keyword in restrict __restrict __restrict__ ; do
2641 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2642 if cc_check; then
2643 _def_restrict_keyword=$restrict_keyword
2644 break;
2646 done
2647 if [ -n "$_def_restrict_keyword" ]; then
2648 echores "$_def_restrict_keyword"
2649 else
2650 echores "none"
2652 # Avoid infinite recursion loop ("#define restrict restrict")
2653 if [ "$_def_restrict_keyword" != "restrict" ]; then
2654 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2655 else
2656 _def_restrict_keyword=""
2660 echocheck "__builtin_expect"
2661 # GCC branch prediction hint
2662 cat > $TMPC << EOF
2663 int foo (int a) {
2664 a = __builtin_expect (a, 10);
2665 return a == 10 ? 0 : 1;
2667 int main() { return foo(10) && foo(0); }
2669 _builtin_expect=no
2670 cc_check && _builtin_expect=yes
2671 if test "$_builtin_expect" = yes ; then
2672 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2673 else
2674 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2676 echores "$_builtin_expect"
2679 echocheck "kstat"
2680 cat > $TMPC << EOF
2681 #include <kstat.h>
2682 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2684 _kstat=no
2685 cc_check -lkstat && _kstat=yes
2686 if test "$_kstat" = yes ; then
2687 _def_kstat="#define HAVE_LIBKSTAT 1"
2688 _ld_extra="$_ld_extra -lkstat"
2689 else
2690 _def_kstat="#undef HAVE_LIBKSTAT"
2692 echores "$_kstat"
2695 echocheck "posix4"
2696 # required for nanosleep on some systems
2697 cat > $TMPC << EOF
2698 #include <time.h>
2699 int main(void) { (void) nanosleep(0, 0); return 0; }
2701 _posix4=no
2702 cc_check -lposix4 && _posix4=yes
2703 if test "$_posix4" = yes ; then
2704 _ld_extra="$_ld_extra -lposix4"
2706 echores "$_posix4"
2708 echocheck "lrintf"
2709 cat > $TMPC << EOF
2710 #include <math.h>
2711 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2713 _lrintf=no
2714 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2715 if test "$_lrintf" = yes ; then
2716 _def_lrintf="#define HAVE_LRINTF 1"
2717 else
2718 _def_lrintf="#undef HAVE_LRINTF"
2720 echores "$_lrintf"
2722 echocheck "round"
2723 cat > $TMPC << EOF
2724 #include <math.h>
2725 int main(void) { (void) round(0.0); return 0; }
2727 _round=no
2728 cc_check $_ld_lm && _round=yes
2729 if test "$_round" = yes ; then
2730 _def_round="#define HAVE_ROUND 1"
2731 else
2732 _def_round="#undef HAVE_ROUND"
2734 echores "$_round"
2736 echocheck "nanosleep"
2737 # also check for nanosleep
2738 cat > $TMPC << EOF
2739 #include <time.h>
2740 int main(void) { (void) nanosleep(0, 0); return 0; }
2742 _nanosleep=no
2743 cc_check && _nanosleep=yes
2744 if test "$_nanosleep" = yes ; then
2745 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2746 else
2747 _def_nanosleep='#undef HAVE_NANOSLEEP'
2749 echores "$_nanosleep"
2752 echocheck "socklib"
2753 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2754 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2755 cat > $TMPC << EOF
2756 #include <netdb.h>
2757 #include <sys/socket.h>
2758 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2760 _socklib=no
2761 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2762 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2763 done
2764 if test $_winsock2 = auto && not cygwin ; then
2765 _winsock2=no
2766 cat > $TMPC << EOF
2767 #include <winsock2.h>
2768 int main(void) { (void) gethostbyname(0); return 0; }
2770 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2772 test "$_ld_sock" && _res_comment="using $_ld_sock"
2773 echores "$_socklib"
2776 if test $_winsock2 = yes ; then
2777 _ld_sock="-lws2_32"
2778 _def_winsock2='#define HAVE_WINSOCK2 1'
2779 else
2780 _def_winsock2='#undef HAVE_WINSOCK2'
2784 _use_aton=no
2785 echocheck "inet_pton()"
2786 cat > $TMPC << EOF
2787 #include <sys/types.h>
2788 #include <sys/socket.h>
2789 #include <arpa/inet.h>
2790 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2792 if test "$_winsock2" = yes ; then
2793 _res_comment="using winsock2 functions instead"
2794 echores "no"
2795 elif cc_check $_ld_sock ; then
2796 # NOTE: Linux has libresolv but does not need it
2798 _res_comment="using $_ld_sock"
2799 echores "yes"
2800 elif cc_check $_ld_sock -lresolv ; then
2801 # NOTE: needed for SunOS at least
2802 _ld_sock="$_ld_sock -lresolv"
2803 _res_comment="using $_ld_sock"
2804 echores "yes"
2805 else
2806 _res_comment="trying inet_aton next"
2807 echores "no"
2809 echocheck "inet_aton()"
2810 cat > $TMPC << EOF
2811 #include <sys/types.h>
2812 #include <sys/socket.h>
2813 #include <arpa/inet.h>
2814 int main(void) { (void) inet_aton(0, 0); return 0; }
2816 _use_aton=yes
2817 if cc_check $_ld_sock ; then
2818 # NOTE: Linux has libresolv but does not need it
2820 _res_comment="using $_ld_sock"
2821 elif cc_check $_ld_sock -lresolv ; then
2822 # NOTE: needed for SunOS at least
2823 _ld_sock="$_ld_sock -lresolv"
2824 _res_comment="using $_ld_sock"
2825 else
2826 _use_aton=no
2827 _network=no
2828 _res_comment="network support disabled"
2830 echores "$_use_aton"
2833 _def_use_aton='#undef USE_ATON'
2834 if test "$_use_aton" = yes; then
2835 _def_use_aton='#define USE_ATON 1'
2838 echocheck "network"
2839 # FIXME network check
2840 if test "$_network" = yes ; then
2841 _def_network='#define MPLAYER_NETWORK 1'
2842 _ld_extra="$_ld_extra $_ld_sock"
2843 _inputmodules="network $_inputmodules"
2844 else
2845 _noinputmodules="network $_noinputmodules"
2846 _def_network='#undef MPLAYER_NETWORK'
2847 _ftp=no
2849 echores "$_network"
2851 echocheck "inttypes.h (required)"
2852 cat > $TMPC << EOF
2853 #include <inttypes.h>
2854 int main(void) { return 0; }
2856 _inttypes=no
2857 cc_check && _inttypes=yes
2858 echores "$_inttypes"
2860 if test "$_inttypes" = no ; then
2861 echocheck "bitypes.h (inttypes.h predecessor)"
2862 cat > $TMPC << EOF
2863 #include <sys/bitypes.h>
2864 int main(void) { return 0; }
2866 cc_check && _inttypes=yes
2867 if test "$_inttypes" = yes ; then
2868 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."
2869 else
2870 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2875 echocheck "int_fastXY_t in inttypes.h"
2876 cat > $TMPC << EOF
2877 #include <inttypes.h>
2878 int main(void) {
2879 volatile int_fast16_t v= 0;
2880 return v; }
2882 _fast_inttypes=no
2883 cc_check && _fast_inttypes=yes
2884 if test "$_fast_inttypes" = yes ; then
2885 # nothing to do
2887 else
2888 _def_fast_inttypes='
2889 typedef signed char int_fast8_t;
2890 typedef signed int int_fast16_t;
2891 typedef signed int int_fast32_t;
2892 typedef signed long long int_fast64_t;
2893 typedef unsigned char uint_fast8_t;
2894 typedef unsigned int uint_fast16_t;
2895 typedef unsigned int uint_fast32_t;
2896 typedef unsigned long long uint_fast64_t;'
2898 echores "$_fast_inttypes"
2901 echocheck "word size"
2902 _mp_wordsize="#undef MP_WORDSIZE"
2903 cat > $TMPC << EOF
2904 #include <stdio.h>
2905 #include <sys/types.h>
2906 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2908 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2909 echores "$_wordsize"
2912 echocheck "stddef.h"
2913 cat > $TMPC << EOF
2914 #include <stddef.h>
2915 int main(void) { return 0; }
2917 _stddef=no
2918 cc_check && _stddef=yes
2919 if test "$_stddef" = yes ; then
2920 _def_stddef='#define HAVE_STDDEF_H 1'
2921 else
2922 _def_stddef='#undef HAVE_STDDEF_H'
2924 echores "$_stddef"
2927 echocheck "malloc.h"
2928 cat > $TMPC << EOF
2929 #include <malloc.h>
2930 int main(void) { (void) malloc(0); return 0; }
2932 _malloc=no
2933 cc_check && _malloc=yes
2934 if test "$_malloc" = yes ; then
2935 _def_malloc='#define HAVE_MALLOC_H 1'
2936 else
2937 _def_malloc='#undef HAVE_MALLOC_H'
2939 # malloc.h emits a warning in FreeBSD and OpenBSD
2940 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2941 echores "$_malloc"
2944 echocheck "memalign()"
2945 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2946 cat > $TMPC << EOF
2947 #include <malloc.h>
2948 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2950 _memalign=no
2951 cc_check && _memalign=yes
2952 if test "$_memalign" = yes ; then
2953 _def_memalign='#define HAVE_MEMALIGN 1'
2954 else
2955 _def_memalign='#undef HAVE_MEMALIGN'
2956 _def_map_memalign='#define memalign(a,b) malloc(b)'
2957 not darwin && _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2959 echores "$_memalign"
2962 echocheck "alloca.h"
2963 cat > $TMPC << EOF
2964 #include <alloca.h>
2965 int main(void) { (void) alloca(0); return 0; }
2967 _alloca=no
2968 cc_check && _alloca=yes
2969 if cc_check ; then
2970 _def_alloca='#define HAVE_ALLOCA_H 1'
2971 else
2972 _def_alloca='#undef HAVE_ALLOCA_H'
2974 echores "$_alloca"
2977 echocheck "mman.h"
2978 cat > $TMPC << EOF
2979 #include <sys/types.h>
2980 #include <sys/mman.h>
2981 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2983 _mman=no
2984 cc_check && _mman=yes
2985 if test "$_mman" = yes ; then
2986 _def_mman='#define HAVE_SYS_MMAN_H 1'
2987 else
2988 _def_mman='#undef HAVE_SYS_MMAN_H'
2990 echores "$_mman"
2992 cat > $TMPC << EOF
2993 #include <sys/types.h>
2994 #include <sys/mman.h>
2995 int main(void) { void *p = MAP_FAILED; return 0; }
2997 _mman_has_map_failed=no
2998 cc_check && _mman_has_map_failed=yes
2999 if test "$_mman_has_map_failed" = yes ; then
3000 _def_mman_has_map_failed=''
3001 else
3002 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3005 echocheck "dynamic loader"
3006 cat > $TMPC << EOF
3007 #include <dlfcn.h>
3008 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3010 _dl=no
3011 for _ld_tmp in "" "-ldl" ; do
3012 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3013 done
3014 if test "$_dl" = yes ; then
3015 _def_dl='#define HAVE_LIBDL 1'
3016 else
3017 _def_dl='#undef HAVE_LIBDL'
3019 echores "$_dl"
3022 echocheck "dynamic a/v plugins support"
3023 if test "$_dl" = no ; then
3024 _dynamic_plugins=no
3026 if test "$_dynamic_plugins" = yes ; then
3027 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3028 else
3029 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3031 echores "$_dynamic_plugins"
3034 #echocheck "dynamic linking"
3035 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
3036 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
3037 #cat > $TMPC << EOF
3038 #int main(void) { return 0; }
3039 #EOF
3040 #if cc_check -rdynamic ; then
3041 # _ld_dl_dynamic='-rdynamic'
3042 #elif cc_check -Bdynamic ; then
3043 # _ld_dl_dynamic='-Bdynamic'
3044 #elif cc_check ; then
3045 # _ld_dl_dynamic=''
3047 #echores "using $_ld_dl_dynamic"
3049 _def_threads='#undef HAVE_THREADS'
3051 echocheck "pthread"
3052 if test "$_pthreads" = auto ; then
3053 cat > $TMPC << EOF
3054 #include <pthread.h>
3055 void* func(void *arg) { return arg; }
3056 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3058 _pthreads=no
3059 if not hpux ; then
3060 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3061 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3062 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3063 done
3066 if test "$_pthreads" = yes ; then
3067 _res_comment="using $_ld_pthread"
3068 _def_pthreads='#define HAVE_PTHREADS 1'
3069 _def_threads='#define HAVE_THREADS 1'
3070 else
3071 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3072 _def_pthreads='#undef HAVE_PTHREADS'
3073 _nas=no ; _tv_v4l1=no ; _macosx=no
3074 if not mingw32 ; then
3075 _win32dll=no
3078 echores "$_pthreads"
3080 echocheck "rpath"
3081 netbsd &&_rpath=yes
3082 if test "$_rpath" = yes ; then
3083 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3084 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3085 done
3086 _ld_extra=$tmp
3088 echores "$_rpath"
3090 echocheck "iconv"
3091 if test "$_iconv" = auto ; then
3092 _iconv_tmp='#include <iconv.h>'
3094 cat > $TMPC << EOF
3095 #include <stdio.h>
3096 #include <unistd.h>
3097 $_iconv_tmp
3098 #define INBUFSIZE 1024
3099 #define OUTBUFSIZE 4096
3101 char inbuffer[INBUFSIZE];
3102 char outbuffer[OUTBUFSIZE];
3104 int main(void) {
3105 size_t numread;
3106 iconv_t icdsc;
3107 char *tocode="UTF-8";
3108 char *fromcode="cp1250";
3109 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3110 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3111 char *iptr=inbuffer;
3112 char *optr=outbuffer;
3113 size_t inleft=numread;
3114 size_t outleft=OUTBUFSIZE;
3115 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3116 != (size_t)(-1)) {
3117 write (1, outbuffer, OUTBUFSIZE - outleft);
3120 if (iconv_close(icdsc) == -1)
3125 _iconv=no
3126 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3127 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3128 _iconv=yes && break
3129 done
3131 if test "$_iconv" = yes ; then
3132 _def_iconv='#define USE_ICONV 1'
3133 else
3134 _def_iconv='#undef USE_ICONV'
3136 echores "$_iconv"
3139 echocheck "sys/soundcard.h"
3140 cat > $TMPC << EOF
3141 #include <sys/soundcard.h>
3142 int main(void) { return 0; }
3144 _sys_soundcard=no
3145 cc_check && _sys_soundcard=yes
3146 if test "$_sys_soundcard" = yes ; then
3147 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3148 _include_soundcard='#include <sys/soundcard.h>'
3149 else
3150 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3152 echores "$_sys_soundcard"
3154 if test "$_sys_soundcard" != yes ; then
3155 echocheck "soundcard.h"
3156 cat > $TMPC << EOF
3157 #include <soundcard.h>
3158 int main(void) { return 0; }
3160 _soundcard=no
3161 cc_check && _soundcard=yes
3162 if linux || test "$_ossaudio" != no ; then
3163 # use soundcard.h on Linux, or when OSS support is enabled
3164 echores "$_soundcard"
3165 else
3166 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
3167 _res_comment= "but ignored!"
3168 echores "$_soundcard"
3169 _soundcard=no
3171 if test "$_soundcard" = yes ; then
3172 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3173 _include_soundcard='#include <soundcard.h>'
3174 else
3175 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3177 else
3178 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3182 echocheck "sys/dvdio.h"
3183 cat > $TMPC << EOF
3184 #include <unistd.h>
3185 #include <sys/dvdio.h>
3186 int main(void) { return 0; }
3188 _dvdio=no
3189 cc_check && _dvdio=yes
3190 if test "$_dvdio" = yes ; then
3191 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3192 else
3193 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3195 echores "$_dvdio"
3198 echocheck "sys/cdio.h"
3199 cat > $TMPC << EOF
3200 #include <unistd.h>
3201 #include <sys/cdio.h>
3202 int main(void) { return 0; }
3204 _cdio=no
3205 cc_check && _cdio=yes
3206 if test "$_cdio" = yes ; then
3207 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3208 else
3209 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3211 echores "$_cdio"
3214 echocheck "linux/cdrom.h"
3215 cat > $TMPC << EOF
3216 #include <sys/types.h>
3217 #include <linux/cdrom.h>
3218 int main(void) { return 0; }
3220 _cdrom=no
3221 cc_check && _cdrom=yes
3222 if test "$_cdrom" = yes ; then
3223 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3224 else
3225 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3227 echores "$_cdrom"
3230 echocheck "dvd.h"
3231 cat > $TMPC << EOF
3232 #include <dvd.h>
3233 int main(void) { return 0; }
3235 _dvd=no
3236 cc_check && _dvd=yes
3237 if test "$_dvd" = yes ; then
3238 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3239 else
3240 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3242 echores "$_dvd"
3245 if bsdos; then
3246 echocheck "BSDI dvd.h"
3247 cat > $TMPC << EOF
3248 #include <dvd.h>
3249 int main(void) { return 0; }
3251 _bsdi_dvd=no
3252 cc_check && _bsdi_dvd=yes
3253 if test "$_bsdi_dvd" = yes ; then
3254 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3255 else
3256 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3258 echores "$_bsdi_dvd"
3259 fi #if bsdos
3262 if hpux; then
3263 # also used by AIX, but AIX does not support VCD and/or libdvdread
3264 echocheck "HP-UX SCSI header"
3265 cat > $TMPC << EOF
3266 #include <sys/scsi.h>
3267 int main(void) { return 0; }
3269 _hpux_scsi_h=no
3270 cc_check && _hpux_scsi_h=yes
3271 if test "$_hpux_scsi_h" = yes ; then
3272 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3273 else
3274 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3276 echores "$_hpux_scsi_h"
3277 fi #if hpux
3280 if sunos; then
3281 echocheck "userspace SCSI headers (Solaris)"
3282 cat > $TMPC << EOF
3283 # include <unistd.h>
3284 # include <stropts.h>
3285 # include <sys/scsi/scsi_types.h>
3286 # include <sys/scsi/impl/uscsi.h>
3287 int main(void) { return 0; }
3289 _sol_scsi_h=no
3290 cc_check && _sol_scsi_h=yes
3291 if test "$_sol_scsi_h" = yes ; then
3292 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3293 else
3294 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3296 echores "$_sol_scsi_h"
3297 fi #if sunos
3300 echocheck "termcap"
3301 if test "$_termcap" = auto ; then
3302 cat > $TMPC <<EOF
3303 int main(void) { tgetent(); return 0; }
3305 _termcap=no
3306 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3307 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3308 && _termcap=yes && break
3309 done
3311 if test "$_termcap" = yes ; then
3312 _def_termcap='#define USE_TERMCAP 1'
3313 _res_comment="using $_ld_tmp"
3314 else
3315 _def_termcap='#undef USE_TERMCAP'
3317 echores "$_termcap"
3320 echocheck "termios"
3321 if test "$_termios" = auto ; then
3322 cat > $TMPC <<EOF
3323 #include <sys/termios.h>
3324 int main(void) { return 0; }
3326 _termios=auto
3327 cc_check && _termios=yes
3328 _def_termios_h_name='sys/termios.h'
3330 # second test:
3331 if test "$_termios" = auto ; then
3332 cat > $TMPC <<EOF
3333 #include <termios.h>
3334 int main(void) { return 0; }
3336 _termios=no
3337 cc_check && _termios=yes
3338 _def_termios_h_name='termios.h'
3341 if test "$_termios" = yes ; then
3342 _def_termios='#define HAVE_TERMIOS 1'
3343 _def_termios_h='#undef HAVE_TERMIOS_H'
3344 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3346 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3347 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3348 elif test "$_def_termios_h_name" = 'termios.h' ; then
3349 _def_termios_h='#define HAVE_TERMIOS_H 1'
3351 _res_comment="using $_def_termios_h_name"
3352 else
3353 _def_termios='#undef HAVE_TERMIOS'
3354 _def_termios_h_name=''
3355 _termios=no
3357 echores "$_termios"
3360 echocheck "shm"
3361 if test "$_shm" = auto ; then
3362 cat > $TMPC << EOF
3363 #include <sys/types.h>
3364 #include <sys/shm.h>
3365 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3367 _shm=no
3368 cc_check && _shm=yes
3370 if test "$_shm" = yes ; then
3371 _def_shm='#define HAVE_SHM 1'
3372 else
3373 _def_shm='#undef HAVE_SHM'
3375 echores "$_shm"
3378 # XXX: FIXME, add runtime checking
3379 echocheck "linux devfs"
3380 echores "$_linux_devfs"
3383 echocheck "scandir()"
3384 cat > $TMPC << EOF
3385 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3387 _scandir=no
3388 cc_check && _scandir=yes
3389 if test "$_scandir" = yes ; then
3390 _def_scandir='#define HAVE_SCANDIR 1'
3391 _need_scandir=no
3392 else
3393 _def_scandir='#undef HAVE_SCANDIR'
3394 _need_scandir=yes
3396 echores "$_scandir"
3399 echocheck "strsep()"
3400 cat > $TMPC << EOF
3401 #include <string.h>
3402 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3404 _strsep=no
3405 cc_check && _strsep=yes
3406 if test "$_strsep" = yes ; then
3407 _def_strsep='#define HAVE_STRSEP 1'
3408 _need_strsep=no
3409 else
3410 _def_strsep='#undef HAVE_STRSEP'
3411 _need_strsep=yes
3413 echores "$_strsep"
3415 echocheck "strlcpy()"
3416 cat > $TMPC << EOF
3417 #include <string.h>
3418 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3420 _strlcpy=no
3421 cc_check && _strlcpy=yes
3422 if test "$_strlcpy" = yes ; then
3423 _def_strlcpy='#define HAVE_STRLCPY 1'
3424 _need_strlcpy=no
3425 else
3426 _def_strlcpy='#undef HAVE_STRLCPY'
3427 _need_strlcpy=yes
3429 echores "$_strlcpy"
3431 echocheck "strlcat()"
3432 cat > $TMPC << EOF
3433 #include <string.h>
3434 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3436 _strlcat=no
3437 cc_check && _strlcat=yes
3438 if test "$_strlcat" = yes ; then
3439 _def_strlcat='#define HAVE_STRLCAT 1'
3440 _need_strlcat=no
3441 else
3442 _def_strlcat='#undef HAVE_STRLCAT'
3443 _need_strlcat=yes
3445 echores "$_strlcat"
3447 echocheck "fseeko()"
3448 cat > $TMPC << EOF
3449 #include <stdio.h>
3450 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3452 _fseeko=no
3453 cc_check && _fseeko=yes
3454 if test "$_fseeko" = yes ; then
3455 _def_fseeko='#define HAVE_FSEEKO 1'
3456 _need_fseeko=no
3457 else
3458 _def_fseeko='#undef HAVE_FSEEKO'
3459 _need_fseeko=yes
3461 echores "$_fseeko"
3463 echocheck "localtime_r()"
3464 cat > $TMPC << EOF
3465 #include <time.h>
3466 int main( void ) { localtime_r(NULL, NULL); }
3468 _localtime_r=no
3469 cc_check && _localtime_r=yes
3470 if test "$_localtime_r" = yes ; then
3471 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3472 else
3473 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3475 echores "$_localtime_r"
3477 echocheck "vsscanf()"
3478 cat > $TMPC << EOF
3479 #include <stdarg.h>
3480 int main(void) { vsscanf(0, 0, 0); return 0; }
3482 _vsscanf=no
3483 cc_check && _vsscanf=yes
3484 if test "$_vsscanf" = yes ; then
3485 _def_vsscanf='#define HAVE_VSSCANF 1'
3486 _need_vsscanf=no
3487 else
3488 _def_vsscanf='#undef HAVE_VSSCANF'
3489 _need_vsscanf=yes
3491 echores "$_vsscanf"
3494 echocheck "swab()"
3495 cat > $TMPC << EOF
3496 #include <unistd.h>
3497 int main(void) { swab(0, 0, 0); return 0; }
3499 _swab=no
3500 cc_check && _swab=yes
3501 if test "$_swab" = yes ; then
3502 _def_swab='#define HAVE_SWAB 1'
3503 _need_swab=no
3504 else
3505 _def_swab='#undef HAVE_SWAB'
3506 _need_swab=yes
3508 echores "$_swab"
3510 echocheck "POSIX select()"
3511 cat > $TMPC << EOF
3512 #include <stdio.h>
3513 #include <stdlib.h>
3514 #include <sys/types.h>
3515 #include <string.h>
3516 #include <sys/time.h>
3517 #include <unistd.h>
3518 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3520 _posix_select=no
3521 _def_posix_select='#undef HAVE_POSIX_SELECT'
3522 cc_check && _posix_select=yes \
3523 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3524 echores "$_posix_select"
3527 echocheck "gettimeofday()"
3528 cat > $TMPC << EOF
3529 #include <stdio.h>
3530 #include <sys/time.h>
3531 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3533 _gettimeofday=no
3534 cc_check && _gettimeofday=yes
3535 if test "$_gettimeofday" = yes ; then
3536 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3537 _need_gettimeofday=no
3538 else
3539 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3540 _need_gettimeofday=yes
3542 echores "$_gettimeofday"
3545 echocheck "glob()"
3546 cat > $TMPC << EOF
3547 #include <stdio.h>
3548 #include <glob.h>
3549 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3551 _glob=no
3552 cc_check && _glob=yes
3553 if test "$_glob" = yes ; then
3554 _def_glob='#define HAVE_GLOB 1'
3555 _need_glob=no
3556 else
3557 _def_glob='#undef HAVE_GLOB'
3558 _need_glob=yes
3560 echores "$_glob"
3563 echocheck "setenv()"
3564 cat > $TMPC << EOF
3565 #include <stdlib.h>
3566 int main (void){ setenv("","",0); return 0; }
3568 _setenv=no
3569 cc_check && _setenv=yes
3570 if test "$_setenv" = yes ; then
3571 _def_setenv='#define HAVE_SETENV 1'
3572 _need_setenv=no
3573 else
3574 _def_setenv='#undef HAVE_SETENV'
3575 _need_setenv=yes
3577 echores "$_setenv"
3580 if sunos; then
3581 echocheck "sysi86()"
3582 cat > $TMPC << EOF
3583 #include <sys/sysi86.h>
3584 int main (void) { sysi86(0); return 0; }
3586 _sysi86=no
3587 cc_check && _sysi86=yes
3588 if test "$_sysi86" = yes ; then
3589 _def_sysi86='#define HAVE_SYSI86 1'
3590 cat > $TMPC << EOF
3591 #include <sys/sysi86.h>
3592 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3594 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3595 else
3596 _def_sysi86='#undef HAVE_SYSI86'
3598 echores "$_sysi86"
3599 fi #if sunos
3602 echocheck "sys/sysinfo.h"
3603 cat > $TMPC << EOF
3604 #include <sys/sysinfo.h>
3605 int main(void) {
3606 struct sysinfo s_info;
3607 sysinfo(&s_info);
3608 return 0;
3611 _sys_sysinfo=no
3612 cc_check && _sys_sysinfo=yes
3613 if test "$_sys_sysinfo" = yes ; then
3614 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3615 else
3616 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3618 echores "$_sys_sysinfo"
3621 if darwin; then
3623 echocheck "Mac OS X APIs"
3624 if test "$_macosx" = auto ; then
3625 productName=`/usr/bin/sw_vers -productName`
3626 if test "$productName" = "Mac OS X" ||
3627 test "$productName" = "Mac OS X Server" ; then
3628 _macosx=yes
3629 else
3630 _macosx=no
3631 _def_macosx='#undef MACOSX'
3632 _noaomodules="macosx $_noaomodules"
3633 _novomodules="quartz $_novomodules"
3636 if test "$_macosx" = yes ; then
3637 cat > $TMPC <<EOF
3638 #include <Carbon/Carbon.h>
3639 #include <QuickTime/QuickTime.h>
3640 #include <CoreAudio/CoreAudio.h>
3641 int main(void) {
3642 EnterMovies();
3643 ExitMovies();
3644 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3647 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3648 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3649 _def_macosx='#define MACOSX 1'
3650 _aosrc="$_aosrc ao_macosx.c"
3651 _aomodules="macosx $_aomodules"
3652 _vosrc="$_vosrc vo_quartz.c"
3653 _vomodules="quartz $_vomodules"
3654 else
3655 _macosx=no
3656 _def_macosx='#undef MACOSX'
3657 _noaomodules="macosx $_noaomodules"
3658 _novomodules="quartz $_novomodules"
3660 cat > $TMPC <<EOF
3661 #include <Carbon/Carbon.h>
3662 #include <QuartzCore/CoreVideo.h>
3663 int main(void) {}
3665 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3666 _vosrc="$_vosrc vo_macosx.m"
3667 _vomodules="macosx $_vomodules"
3668 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3669 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3670 _macosx_corevideo=yes
3671 else
3672 _novomodules="macosx $_novomodules"
3673 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3674 _macosx_corevideo=no
3677 echores "$_macosx"
3679 echocheck "Mac OS X Finder Support"
3680 if test "$_macosx_finder_support" = auto ; then
3681 _macosx_finder_support=$_macosx
3683 if test "$_macosx_finder_support" = yes; then
3684 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3685 _macosx_finder_support=yes
3686 else
3687 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3688 _macosx_finder_support=no
3690 echores "$_macosx_finder_support"
3692 echocheck "Mac OS X Bundle file locations"
3693 if test "$_macosx_bundle" = auto ; then
3694 _macosx_bundle=$_macosx_finder_support
3696 if test "$_macosx_bundle" = yes; then
3697 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3698 else
3699 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3700 _macosx_bundle=no
3702 echores "$_macosx_bundle"
3704 fi #if darwin
3707 echocheck "pkg-config"
3708 _pkg_config=pkg-config
3709 if `$_pkg_config --version > /dev/null 2>&1`; then
3710 echores "yes"
3711 else
3712 _pkg_config=false
3713 echores "no"
3717 echocheck "Samba support (libsmbclient)"
3718 if test "$_smbsupport" = yes; then
3719 _ld_extra="$_ld_extra -lsmbclient"
3721 if test "$_smbsupport" = auto; then
3722 _smbsupport=no
3723 cat > $TMPC << EOF
3724 #include <libsmbclient.h>
3725 int main(void) { smbc_opendir("smb://"); return 0; }
3727 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3728 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3729 _smbsupport=yes && break
3730 done
3733 if test "$_smbsupport" = yes; then
3734 _def_smbsupport="#define LIBSMBCLIENT"
3735 _inputmodules="smb $_inputmodules"
3736 else
3737 _def_smbsupport="#undef LIBSMBCLIENT"
3738 _noinputmodules="smb $_noinputmodules"
3740 echores "$_smbsupport"
3743 #########
3744 # VIDEO #
3745 #########
3748 echocheck "3dfx"
3749 if test "$_3dfx" = yes ; then
3750 _def_3dfx='#define HAVE_3DFX 1'
3751 _vosrc="$_vosrc vo_3dfx.c"
3752 _vomodules="3dfx $_vomodules"
3753 else
3754 _def_3dfx='#undef HAVE_3DFX'
3755 _novomodules="3dfx $_novomodules"
3757 echores "$_3dfx"
3760 echocheck "tdfxfb"
3761 if test "$_tdfxfb" = yes ; then
3762 _def_tdfxfb='#define HAVE_TDFXFB 1'
3763 _vosrc="$_vosrc vo_tdfxfb.c"
3764 _vomodules="tdfxfb $_vomodules"
3765 else
3766 _def_tdfxfb='#undef HAVE_TDFXFB'
3767 _novomodules="tdfxfb $_novomodules"
3769 echores "$_tdfxfb"
3771 echocheck "s3fb"
3772 if test "$_s3fb" = yes ; then
3773 _def_s3fb='#define HAVE_S3FB 1'
3774 _vosrc="$_vosrc vo_s3fb.c"
3775 _vomodules="s3fb $_vomodules"
3776 else
3777 _def_s3fb='#undef HAVE_S3FB'
3778 _novomodules="s3fb $_novomodules"
3780 echores "$_s3fb"
3782 echocheck "tdfxvid"
3783 if test "$_tdfxvid" = yes ; then
3784 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3785 _vosrc="$_vosrc vo_tdfx_vid.c"
3786 _vomodules="tdfx_vid $_vomodules"
3787 else
3788 _def_tdfxvid='#undef HAVE_TDFX_VID'
3789 _novomodules="tdfx_vid $_novomodules"
3791 echores "$_tdfxvid"
3793 echocheck "tga"
3794 if test "$_tga" = yes ; then
3795 _def_tga='#define HAVE_TGA 1'
3796 _vosrc="$_vosrc vo_tga.c"
3797 _vomodules="tga $_vomodules"
3798 else
3799 _def_tga='#undef HAVE_TGA'
3800 _novomodules="tga $_novomodules"
3802 echores "$_tga"
3805 echocheck "DirectFB"
3806 if test "$_directfb" = auto ; then
3807 _directfb=no
3808 cat > $TMPC <<EOF
3809 #include <directfb.h>
3810 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3812 for _inc_tmp in "" -I/usr/local/include/directfb \
3813 -I/usr/include/directfb -I/usr/local/include -I/usr/include; do
3814 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3815 _inc_extra="$_inc_extra $_inc_tmp" && break
3816 done
3819 dfb_version() {
3820 expr $1 \* 65536 + $2 \* 256 + $3
3823 if test "$_directfb" = yes; then
3824 cat > $TMPC << EOF
3825 #include <directfb_version.h>
3827 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3830 if $_cc -E $TMPC $_inc_extra > "$TMPO"; then
3831 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPO" | tr -d '()'`
3832 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3833 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3834 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3835 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3836 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3837 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3838 _res_comment="$_directfb_version"
3839 else
3840 _def_directfb_version='#undef DIRECTFBVERSION'
3841 _directfb=no
3842 _res_comment="version >=0.9.13 required"
3844 else
3845 _directfb=no
3846 _res_comment="failed to get version"
3849 echores "$_directfb"
3851 if test "$_directfb" = yes ; then
3852 _def_directfb='#define HAVE_DIRECTFB 1'
3853 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3854 _vosrc="$_vosrc vo_directfb2.c"
3855 _vomodules="directfb $_vomodules"
3856 _libs_mplayer="$_libs_mplayer -ldirectfb"
3857 else
3858 _novomodules="directfb $_novomodules"
3861 if test "$_dfb_version" -ge `dfb_version 0 9 15`; then
3862 _vosrc="$_vosrc vo_dfbmga.c"
3863 _vomodules="dfbmga $_vomodules"
3864 _def_dfbmga='#define HAVE_DFBMGA 1'
3865 else
3866 _novomodules="dfbmga $_novomodules"
3867 _def_dfbmga='#undef HAVE_DFBMGA'
3869 else
3870 _def_directfb='#undef HAVE_DIRECTFB'
3871 _novomodules="dfbmga directfb $_novomodules"
3875 echocheck "X11 headers presence"
3876 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
3877 if test -f "$I/X11/Xlib.h" ; then
3878 _inc_x11="-I$I"
3879 _x11_headers="yes"
3880 _res_comment="using $I"
3881 break
3883 done
3884 if test -z "$_inc_x11" ; then
3885 _x11=no
3886 _x11_headers="no"
3887 _res_comment="check if the dev(el) packages are installed"
3889 echores "$_x11_headers"
3892 echocheck "X11"
3893 if test "$_x11" != no ; then
3894 cat > $TMPC <<EOF
3895 #include <X11/Xlib.h>
3896 #include <X11/Xutil.h>
3897 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3899 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3900 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3901 if netbsd; then
3902 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3903 else
3904 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3906 cc_check $_inc_x11 $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3907 && _x11=yes && break
3908 done
3910 if test "$_x11" = yes ; then
3911 #FIXME: This is ugly as it can duplicate a -I parameter..
3912 _inc_extra="$_inc_extra $_inc_x11"
3913 _def_x11='#define HAVE_X11 1'
3914 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3915 _vomodules="x11 xover $_vomodules"
3916 else
3917 _x11=no
3918 _def_x11='#undef HAVE_X11'
3919 _novomodules="x11 $_novomodules"
3920 _res_comment="check if the dev(el) packages are installed"
3921 # disable stuff that depends on X
3922 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _dga=no
3924 echores "$_x11"
3927 echocheck "DPMS"
3928 _xdpms3=no
3929 _xdpms4=no
3930 if test "$_x11" = yes ; then
3931 cat > $TMPC <<EOF
3932 #include <X11/Xmd.h>
3933 #include <X11/Xlib.h>
3934 #include <X11/Xutil.h>
3935 #include <X11/Xatom.h>
3936 #include <X11/extensions/dpms.h>
3937 int main(void) {
3938 (void) DPMSQueryExtension(0, 0, 0);
3941 cc_check -lXdpms && _xdpms3=yes
3942 cat > $TMPC <<EOF
3943 #include <X11/Xlib.h>
3944 #include <X11/extensions/dpms.h>
3945 int main(void) {
3946 (void) DPMSQueryExtension(0, 0, 0);
3949 cc_check && _xdpms4=yes
3951 if test "$_xdpms4" = yes ; then
3952 _def_xdpms='#define HAVE_XDPMS 1'
3953 _res_comment="using Xdpms 4"
3954 echores "yes"
3955 elif test "$_xdpms3" = yes ; then
3956 _def_xdpms='#define HAVE_XDPMS 1'
3957 _libs_mplayer="$_libs_mplayer -lXdpms"
3958 _res_comment="using Xdpms 3"
3959 echores "yes"
3960 else
3961 _def_xdpms='#undef HAVE_XDPMS'
3962 echores "no"
3966 echocheck "Xv"
3967 if test "$_xv" = auto ; then
3968 cat > $TMPC <<EOF
3969 #include <X11/Xlib.h>
3970 #include <X11/extensions/Xvlib.h>
3971 int main(void) {
3972 (void) XvGetPortAttribute(0, 0, 0, 0);
3973 (void) XvQueryPortAttributes(0, 0, 0);
3974 return 0; }
3976 _xv=no
3977 cc_check -lXv && _xv=yes
3980 if test "$_xv" = yes ; then
3981 _def_xv='#define HAVE_XV 1'
3982 _libs_mplayer="$_libs_mplayer -lXv"
3983 _vosrc="$_vosrc vo_xv.c"
3984 _vomodules="xv $_vomodules"
3985 else
3986 _def_xv='#undef HAVE_XV'
3987 _novomodules="xv $_novomodules"
3989 echores "$_xv"
3992 echocheck "XvMC"
3993 if test "$_xv" = yes && test "$_xvmc" != no ; then
3994 _xvmc=no
3995 cat > $TMPC <<EOF
3996 #include <X11/Xlib.h>
3997 #include <X11/extensions/Xvlib.h>
3998 #include <X11/extensions/XvMClib.h>
3999 int main(void) {
4000 (void) XvMCQueryExtension(0,0,0);
4001 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4002 return 0; }
4004 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4005 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4006 done
4008 if test "$_xvmc" = yes ; then
4009 _def_xvmc='#define HAVE_XVMC 1'
4010 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
4011 _vosrc="$_vosrc vo_xvmc.c"
4012 _vomodules="xvmc $_vomodules"
4013 _res_comment="using $_xvmclib"
4014 else
4015 _def_xvmc='#undef HAVE_XVMC'
4016 _novomodules="xvmc $_novomodules"
4018 echores "$_xvmc"
4021 echocheck "Xinerama"
4022 if test "$_xinerama" = auto ; then
4023 cat > $TMPC <<EOF
4024 #include <X11/Xlib.h>
4025 #include <X11/extensions/Xinerama.h>
4026 int main(void) { (void) XineramaIsActive(0); return 0; }
4028 _xinerama=no
4029 cc_check -lXinerama && _xinerama=yes
4032 if test "$_xinerama" = yes ; then
4033 _def_xinerama='#define HAVE_XINERAMA 1'
4034 _libs_mplayer="$_libs_mplayer -lXinerama"
4035 else
4036 _def_xinerama='#undef HAVE_XINERAMA'
4038 echores "$_xinerama"
4041 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4042 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4043 # named 'X extensions' or something similar.
4044 # This check may be useful for future mplayer versions (to change resolution)
4045 # If you run into problems, remove '-lXxf86vm'.
4046 echocheck "Xxf86vm"
4047 if test "$_vm" = auto ; then
4048 cat > $TMPC <<EOF
4049 #include <X11/Xlib.h>
4050 #include <X11/extensions/xf86vmode.h>
4051 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4053 _vm=no
4054 cc_check -lXxf86vm && _vm=yes
4056 if test "$_vm" = yes ; then
4057 _def_vm='#define HAVE_XF86VM 1'
4058 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4059 else
4060 _def_vm='#undef HAVE_XF86VM'
4062 echores "$_vm"
4064 # Check for the presence of special keycodes, like audio control buttons
4065 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4066 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4067 # have these new keycodes.
4068 echocheck "XF86keysym"
4069 if test "$_xf86keysym" = auto; then
4070 _xf86keysym=no
4071 cat > $TMPC <<EOF
4072 #include <X11/Xlib.h>
4073 #include <X11/XF86keysym.h>
4074 int main(void) { return XF86XK_AudioPause; }
4076 cc_check && _xf86keysym=yes
4078 if test "$_xf86keysym" = yes ; then
4079 _def_xf86keysym='#define HAVE_XF86XK 1'
4080 else
4081 _def_xf86keysym='#undef HAVE_XF86XK'
4083 echores "$_xf86keysym"
4085 echocheck "DGA"
4086 # Version 2 is preferred to version 1 if available
4087 if test "$_dga" = auto ; then
4088 cat > $TMPC << EOF
4089 #include <X11/Xlib.h>
4090 #include <X11/extensions/xf86dga.h>
4091 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4093 _dga=no
4094 cc_check -lXxf86dga -lXxf86vm && _dga=1
4096 cat > $TMPC << EOF
4097 #include <X11/Xlib.h>
4098 #include <X11/extensions/xf86dga.h>
4099 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4101 cc_check -lXxf86dga && _dga=2
4104 _def_dga='#undef HAVE_DGA'
4105 _def_dga2='#undef HAVE_DGA2'
4106 if test "$_dga" = 1 ; then
4107 _def_dga='#define HAVE_DGA 1'
4108 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4109 _vosrc="$_vosrc vo_dga.c"
4110 _vomodules="dga $_vomodules"
4111 _res_comment="using DGA 1.0"
4112 elif test "$_dga" = 2 ; then
4113 _def_dga='#define HAVE_DGA 1'
4114 _def_dga2='#define HAVE_DGA2 1'
4115 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4116 _vosrc="$_vosrc vo_dga.c"
4117 _vomodules="dga $_vomodules"
4118 _res_comment="using DGA 2.0"
4119 elif test "$_dga" = no ; then
4120 _novomodules="dga $_novomodules"
4121 else
4122 die "DGA version must be 1 or 2"
4124 echores "$_dga"
4127 echocheck "OpenGL"
4128 #Note: this test is run even with --enable-gl since we autodetect linker flags
4129 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4130 cat > $TMPC << EOF
4131 #include <GL/gl.h>
4132 int main(void) { return 0; }
4134 _gl=no
4135 if cc_check -lGL $_ld_lm ; then
4136 _gl=yes
4137 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4138 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4139 _gl=yes
4140 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4141 elif cc_check -lopengl32 ; then
4142 _gl=yes
4143 _gl_win32=yes
4144 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4146 else
4147 _gl=no
4149 if test "$_gl" = yes ; then
4150 _def_gl='#define HAVE_GL 1'
4151 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4152 if test "$_gl_win32" = yes ; then
4153 _def_gl_win32='#define GL_WIN32 1'
4154 _vosrc="$_vosrc w32_common.c"
4155 _res_comment="win32 version"
4157 _vomodules="opengl $_vomodules"
4158 else
4159 _def_gl='#undef HAVE_GL'
4160 _def_gl_win32='#undef GL_WIN32'
4161 _novomodules="opengl $_novomodules"
4163 echores "$_gl"
4166 echocheck "/dev/mga_vid"
4167 if test "$_mga" = auto ; then
4168 _mga=no
4169 test -c /dev/mga_vid && _mga=yes
4171 if test "$_mga" = yes ; then
4172 _def_mga='#define HAVE_MGA 1'
4173 _vosrc="$_vosrc vo_mga.c"
4174 _vomodules="mga $_vomodules"
4175 else
4176 _def_mga='#undef HAVE_MGA'
4177 _novomodules="mga $_novomodules"
4179 echores "$_mga"
4182 # echocheck "syncfb"
4183 # _syncfb=no
4184 # test "$_mga" = yes && _syncfb=yes
4185 # if test "$_syncfb" = yes ; then
4186 # _def_syncfb='#define HAVE_SYNCFB 1'
4187 # _vosrc="$_vosrc vo_syncfb.c"
4188 # else
4189 # _def_syncfb='#undef HAVE_SYNCFB'
4190 # fi
4191 # echores "$_syncfb"
4194 echocheck "xmga"
4195 if test "$_xmga" = auto ; then
4196 _xmga=no
4197 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4199 if test "$_xmga" = yes ; then
4200 _def_xmga='#define HAVE_XMGA 1'
4201 _vosrc="$_vosrc vo_xmga.c"
4202 _vomodules="xmga $_vomodules"
4203 else
4204 _def_xmga='#undef HAVE_XMGA'
4205 _novomodules="xmga $_novomodules"
4207 echores "$_xmga"
4210 echocheck "GGI"
4211 if test "$_ggi" = auto ; then
4212 cat > $TMPC << EOF
4213 #include <ggi/ggi.h>
4214 int main(void) { return 0; }
4216 _ggi=no
4217 cc_check -lggi && _ggi=yes
4219 if test "$_ggi" = yes ; then
4220 _def_ggi='#define HAVE_GGI 1'
4221 _libs_mplayer="$_libs_mplayer -lggi"
4222 _vosrc="$_vosrc vo_ggi.c"
4223 _vomodules="ggi $_vomodules"
4224 else
4225 _def_ggi='#undef HAVE_GGI'
4226 _novomodules="ggi $_novomodules"
4228 echores "$_ggi"
4230 echocheck "GGI extension: libggiwmh"
4231 if test "$_ggiwmh" = auto ; then
4232 _ggiwmh=no
4233 cat > $TMPC << EOF
4234 #include <ggi/ggi.h>
4235 #include <ggi/wmh.h>
4236 int main(void) { return 0; }
4238 cc_check -lggi -lggiwmh && _ggiwmh=yes
4240 # needed to get right output on obscure combination
4241 # like --disable-ggi --enable-ggiwmh
4242 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4243 _def_ggiwmh='#define HAVE_GGIWMH 1'
4244 _libs_mplayer="$_libs_mplayer -lggiwmh"
4245 else
4246 _ggiwmh=no
4247 _def_ggiwmh='#undef HAVE_GGIWMH'
4249 echores "$_ggiwmh"
4252 echocheck "AA"
4253 if test "$_aa" = auto ; then
4254 cat > $TMPC << EOF
4255 #include <aalib.h>
4256 extern struct aa_hardware_params aa_defparams;
4257 extern struct aa_renderparams aa_defrenderparams;
4258 int main(void) {
4259 aa_context *c;
4260 aa_renderparams *p;
4261 (void) aa_init(0, 0, 0);
4262 c = aa_autoinit(&aa_defparams);
4263 p = aa_getrenderparams();
4264 aa_autoinitkbd(c,0);
4265 return 0; }
4267 _aa=no
4268 for _ld_tmp in "-laa" ; do
4269 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4270 done
4272 if test "$_aa" = yes ; then
4273 _def_aa='#define HAVE_AA 1'
4274 if cygwin ; then
4275 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4277 _vosrc="$_vosrc vo_aa.c"
4278 _vomodules="aa $_vomodules"
4279 else
4280 _def_aa='#undef HAVE_AA'
4281 _novomodules="aa $_novomodules"
4283 echores "$_aa"
4286 echocheck "CACA"
4287 if test "$_caca" = auto ; then
4288 _caca=no
4289 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4290 cat > $TMPC << EOF
4291 #include <caca.h>
4292 #ifdef CACA_API_VERSION_1
4293 #include <caca0.h>
4294 #endif
4295 int main(void) { (void) caca_init(); return 0; }
4297 cc_check `caca-config --libs` && _caca=yes
4300 if test "$_caca" = yes ; then
4301 _def_caca='#define HAVE_CACA 1'
4302 _inc_extra="$_inc_extra `caca-config --cflags`"
4303 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4304 _vosrc="$_vosrc vo_caca.c"
4305 _vomodules="caca $_vomodules"
4306 else
4307 _def_caca='#undef HAVE_CACA'
4308 _novomodules="caca $_novomodules"
4310 echores "$_caca"
4313 echocheck "SVGAlib"
4314 if test "$_svga" = auto ; then
4315 cat > $TMPC << EOF
4316 #include <vga.h>
4317 int main(void) { return 0; }
4319 _svga=no
4320 cc_check -lvga $_ld_lm && _svga=yes
4322 if test "$_svga" = yes ; then
4323 _def_svga='#define HAVE_SVGALIB 1'
4324 _libs_mplayer="$_libs_mplayer -lvga"
4325 _vosrc="$_vosrc vo_svga.c"
4326 _vomodules="svga $_vomodules"
4327 else
4328 _def_svga='#undef HAVE_SVGALIB'
4329 _novomodules="svga $_novomodules"
4331 echores "$_svga"
4334 echocheck "FBDev"
4335 if test "$_fbdev" = auto ; then
4336 _fbdev=no
4337 linux && test -c /dev/fb0 && _fbdev=yes
4339 if test "$_fbdev" = yes ; then
4340 _def_fbdev='#define HAVE_FBDEV 1'
4341 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4342 _vomodules="fbdev $_vomodules"
4343 else
4344 _def_fbdev='#undef HAVE_FBDEV'
4345 _novomodules="fbdev $_novomodules"
4347 echores "$_fbdev"
4351 echocheck "DVB"
4352 if test "$_dvb" = auto ; then
4353 _dvb=no
4354 cat >$TMPC << EOF
4355 #include <sys/poll.h>
4356 #include <sys/ioctl.h>
4357 #include <stdio.h>
4358 #include <time.h>
4359 #include <unistd.h>
4361 #include <ost/dmx.h>
4362 #include <ost/frontend.h>
4363 #include <ost/sec.h>
4364 #include <ost/video.h>
4365 #include <ost/audio.h>
4366 int main(void) {return 0;}
4368 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4369 cc_check $_inc_tmp && _dvb=yes && \
4370 _inc_extra="$_inc_extra $_inc_tmp" && break
4371 done
4373 echores "$_dvb"
4374 if test "$_dvb" = yes ; then
4375 _def_dvb='#define HAVE_DVB 1'
4376 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4377 _aomodules="mpegpes(dvb) $_aomodules"
4378 _vomodules="mpegpes(dvb) $_vomodules"
4381 echocheck "DVB HEAD"
4382 if test "$_dvbhead" = auto ; then
4383 _dvbhead=no
4385 cat >$TMPC << EOF
4386 #include <sys/poll.h>
4387 #include <sys/ioctl.h>
4388 #include <stdio.h>
4389 #include <time.h>
4390 #include <unistd.h>
4392 #include <linux/dvb/dmx.h>
4393 #include <linux/dvb/frontend.h>
4394 #include <linux/dvb/video.h>
4395 #include <linux/dvb/audio.h>
4396 int main(void) {return 0;}
4398 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4399 cc_check $_inc_tmp && _dvbhead=yes && \
4400 _inc_extra="$_inc_extra $_inc_tmp" && break
4401 done
4403 echores "$_dvbhead"
4404 if test "$_dvbhead" = yes ; then
4405 _def_dvb='#define HAVE_DVB_HEAD 1'
4406 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4407 _aomodules="mpegpes(dvb) $_aomodules"
4408 _vomodules="mpegpes(dvb) $_vomodules"
4411 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4412 _def_dvb='#undef HAVE_DVB'
4413 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4414 _aomodules="mpegpes(file) $_aomodules"
4415 _vomodules="mpegpes(file) $_vomodules"
4418 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4419 _dvbin=yes
4420 _inputmodules="dvb $_inputmodules"
4421 else
4422 _dvbin=no
4423 _noinputmodules="dvb $_noinputmodules"
4426 echocheck "PNG support"
4427 if test "$_png" = auto ; then
4428 _png=no
4429 if irix ; then
4430 # Don't check for -lpng on irix since it has its own libpng
4431 # incompatible with the GNU libpng
4432 _res_comment="disabled on irix (not GNU libpng)"
4433 else
4434 cat > $TMPC << EOF
4435 #include <png.h>
4436 #include <string.h>
4437 int main(void) {
4438 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4439 printf("libpng: %s\n", png_libpng_ver);
4440 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4443 if cc_check -lpng -lz $_ld_lm ; then
4444 if tmp_run ; then
4445 _png=yes
4446 else
4447 _res_comment="mismatch of library and header versions"
4452 echores "$_png"
4453 if test "$_png" = yes ; then
4454 _def_png='#define HAVE_PNG 1'
4455 _ld_extra="$_ld_extra -lpng -lz"
4456 _vosrc="$_vosrc vo_png.c"
4457 _vomodules="png $_vomodules"
4458 else
4459 _def_png='#undef HAVE_PNG'
4460 _novomodules="png $_novomodules"
4463 echocheck "JPEG support"
4464 if test "$_jpeg" = auto ; then
4465 _jpeg=no
4466 cat > $TMPC << EOF
4467 #include <stdio.h>
4468 #include <stdlib.h>
4469 #include <setjmp.h>
4470 #include <string.h>
4471 #include <jpeglib.h>
4472 int main(void) {
4473 return 0;
4476 if cc_check -ljpeg $_ld_lm ; then
4477 if tmp_run ; then
4478 _jpeg=yes
4482 echores "$_jpeg"
4484 if test "$_jpeg" = yes ; then
4485 _def_jpeg='#define HAVE_JPEG 1'
4486 _vosrc="$_vosrc vo_jpeg.c"
4487 _vomodules="jpeg $_vomodules"
4488 _ld_extra="$_ld_extra -ljpeg"
4489 else
4490 _def_jpeg='#undef HAVE_JPEG'
4491 _novomodules="jpeg $_novomodules"
4496 echocheck "PNM support"
4497 if test "$_pnm" = yes; then
4498 _def_pnm="#define HAVE_PNM"
4499 _vosrc="$_vosrc vo_pnm.c"
4500 _vomodules="pnm $_vomodules"
4501 else
4502 _def_pnm="#undef HAVE_PNM"
4503 _novomodules="pnm $_novomodules"
4505 echores "$_pnm"
4509 echocheck "GIF support"
4510 # This is to appease people who want to force gif support.
4511 # If it is forced to yes, then we still do checks to determine
4512 # which gif library to use.
4513 if test "$_gif" = yes ; then
4514 _force_gif=yes
4515 _gif=auto
4518 if test "$_gif" = auto ; then
4519 _gif=no
4520 cat > $TMPC << EOF
4521 #include <gif_lib.h>
4522 int main(void) {
4523 return 0;
4526 for _ld_gif in "-lungif" "-lgif" ; do
4527 cc_check $_ld_gif && tmp_run && _gif=yes && break
4528 done
4531 # If no library was found, and the user wants support forced,
4532 # then we force it on with libgif, as this is the safest
4533 # assumption IMHO. (libungif & libregif both create symbolic
4534 # links to libgif. We also assume that no x11 support is needed,
4535 # because if you are forcing this, then you _should_ know what
4536 # you are doing. [ Besides, package maintainers should never
4537 # have compiled x11 deps into libungif in the first place. ] )
4538 # </rant>
4539 # --Joey
4540 if test "$_force_gif" = yes && test "$_gif" = no ; then
4541 _gif=yes
4542 _ld_gif="-lgif"
4545 if test "$_gif" = yes ; then
4546 _def_gif='#define HAVE_GIF 1'
4547 _vosrc="$_vosrc vo_gif89a.c"
4548 _codecmodules="gif $_codecmodules"
4549 _vomodules="gif89a $_vomodules"
4550 _res_comment="old version, some encoding functions disabled"
4551 _def_gif_4='#undef HAVE_GIF_4'
4552 _ld_extra="$_ld_extra $_ld_gif"
4554 cat > $TMPC << EOF
4555 #include <signal.h>
4556 #include <gif_lib.h>
4557 void catch() { exit(1); }
4558 int main(void) {
4559 signal(SIGSEGV, catch); // catch segfault
4560 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4561 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4562 return 0;
4565 if cc_check "$_ld_gif" && tmp_run ; then
4566 _def_gif_4='#define HAVE_GIF_4 1'
4567 _res_comment=""
4569 else
4570 _def_gif='#undef HAVE_GIF'
4571 _def_gif_4='#undef HAVE_GIF_4'
4572 _novomodules="gif89a $_novomodules"
4573 _nocodecmodules="gif $_nocodecmodules"
4575 echores "$_gif"
4578 case "$_gif" in yes*)
4579 echocheck "broken giflib workaround"
4580 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4582 cat > $TMPC << EOF
4583 #include <gif_lib.h>
4584 int main(void) {
4585 GifFileType gif;
4586 printf("UserData is at address %p\n", gif.UserData);
4587 return 0;
4590 if cc_check "$_ld_gif" && tmp_run ; then
4591 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4592 echores "disabled"
4593 else
4594 echores "enabled"
4597 esac
4600 echocheck "VESA support"
4601 if test "$_vesa" = auto ; then
4602 cat > $TMPC << EOF
4603 #include <vbe.h>
4604 int main(void) { vbeVersion(); return 0; }
4606 _vesa=no
4607 cc_check -lvbe -llrmi && _vesa=yes
4609 if test "$_vesa" = yes ; then
4610 _def_vesa='#define HAVE_VESA 1'
4611 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4612 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4613 _vomodules="vesa $_vomodules"
4614 else
4615 _def_vesa='#undef HAVE_VESA'
4616 _novomodules="vesa $_novomodules"
4618 echores "$_vesa"
4620 #################
4621 # VIDEO + AUDIO #
4622 #################
4625 echocheck "SDL"
4626 if test -z "$_sdlconfig" ; then
4627 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4628 _sdlconfig="sdl-config"
4629 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4630 _sdlconfig="sdl11-config"
4631 else
4632 _sdlconfig=false
4635 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4636 cat > $TMPC << EOF
4637 #include <SDL.h>
4638 int main(int argc, char *argv[]) { return 0; }
4640 _sdl=no
4641 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4642 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4643 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4644 if test "$_sdlversion" -gt 116 ; then
4645 if test "$_sdlversion" -lt 121 ; then
4646 _def_sdlbuggy='#define BUGGY_SDL'
4647 else
4648 _def_sdlbuggy='#undef BUGGY_SDL'
4650 _sdl=yes
4655 if test "$_sdl" = yes ; then
4656 _def_sdl='#define HAVE_SDL 1'
4657 if cygwin ; then
4658 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4659 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4660 elif mingw32 ; then
4661 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4662 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4663 else
4664 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4665 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4667 _vosrc="$_vosrc vo_sdl.c"
4668 _vomodules="sdl $_vomodules"
4669 _aosrc="$_aosrc ao_sdl.c"
4670 _aomodules="sdl $_aomodules"
4671 _res_comment="using $_sdlconfig"
4672 else
4673 _def_sdl='#undef HAVE_SDL'
4674 _novomodules="sdl $_novomodules"
4675 _noaomodules="sdl $_noaomodules"
4677 echores "$_sdl"
4680 if win32; then
4682 echocheck "Windows waveout"
4683 if test "$_win32waveout" = auto ; then
4684 cat > $TMPC << EOF
4685 #include <windows.h>
4686 #include <mmsystem.h>
4687 int main(void) { return 0; }
4689 _win32waveout=no
4690 cc_check -lwinmm && _win32waveout=yes
4692 if test "$_win32waveout" = yes ; then
4693 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4694 _libs_mplayer="$_libs_mplayer -lwinmm"
4695 _aosrc="$_aosrc ao_win32.c"
4696 _aomodules="win32 $_aomodules"
4697 else
4698 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4699 _noaomodules="win32 $_noaomodules"
4701 echores "$_win32waveout"
4703 echocheck "Directx"
4704 if test "$_directx" = auto ; then
4705 cat > $TMPC << EOF
4706 #include <windows.h>
4707 #include <ddraw.h>
4708 #include <dsound.h>
4709 int main(void) { return 0; }
4711 _directx=no
4712 cc_check -lgdi32 && _directx=yes
4714 if test "$_directx" = yes ; then
4715 _def_directx='#define HAVE_DIRECTX 1'
4716 _libs_mplayer="$_libs_mplayer -lgdi32"
4717 _vosrc="$_vosrc vo_directx.c"
4718 _vomodules="directx $_vomodules"
4719 _aosrc="$_aosrc ao_dsound.c"
4720 _aomodules="dsound $_aomodules"
4721 else
4722 _def_directx='#undef HAVE_DIRECTX'
4723 _novomodules="directx $_novomodules"
4724 _noaomodules="dsound $_noaomodules"
4726 echores "$_directx"
4728 fi #if win32; then
4731 echocheck "NAS"
4732 if test "$_nas" = auto ; then
4733 cat > $TMPC << EOF
4734 #include <audio/audiolib.h>
4735 int main(void) { return 0; }
4737 _nas=no
4738 cc_check $_ld_lm -laudio -lXt && _nas=yes
4740 if test "$_nas" = yes ; then
4741 _def_nas='#define HAVE_NAS 1'
4742 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4743 _aosrc="$_aosrc ao_nas.c"
4744 _aomodules="nas $_aomodules"
4745 else
4746 _noaomodules="nas $_noaomodules"
4747 _def_nas='#undef HAVE_NAS'
4749 echores "$_nas"
4751 echocheck "DXR2"
4752 if test "$_dxr2" = auto; then
4753 _dxr2=no
4754 cat > $TMPC << EOF
4755 #include <dxr2ioctl.h>
4756 int main(void) { return 0; }
4758 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4759 cc_check $_inc_tmp && _dxr2=yes && \
4760 _inc_extra="$_inc_extra $_inc_tmp" && break
4761 done
4763 if test "$_dxr2" = yes; then
4764 _def_dxr2='#define HAVE_DXR2 1'
4765 _vosrc="$_vosrc vo_dxr2.c"
4766 _aosrc="$_aosrc ao_dxr2.c"
4767 _aomodules="dxr2 $_aomodules"
4768 _vomodules="dxr2 $_vomodules"
4769 else
4770 _def_dxr2='#undef HAVE_DXR2'
4771 _noaomodules="dxr2 $_noaomodules"
4772 _novomodules="dxr2 $_novomodules"
4774 echores "$_dxr2"
4776 echocheck "DXR3/H+"
4777 if test "$_dxr3" = auto ; then
4778 cat > $TMPC << EOF
4779 #include <linux/em8300.h>
4780 int main(void) { return 0; }
4782 _dxr3=no
4783 cc_check && _dxr3=yes
4785 if test "$_dxr3" = yes ; then
4786 _def_dxr3='#define HAVE_DXR3 1'
4787 _vosrc="$_vosrc vo_dxr3.c"
4788 _vomodules="dxr3 $_vomodules"
4789 else
4790 _def_dxr3='#undef HAVE_DXR3'
4791 _novomodules="dxr3 $_novomodules"
4793 echores "$_dxr3"
4796 echocheck "IVTV TV-Out"
4797 if test "$_ivtv" = auto ; then
4798 cat > $TMPC << EOF
4799 #include <stdlib.h>
4800 #include <inttypes.h>
4801 #include <linux/types.h>
4802 #include <linux/videodev2.h>
4803 #include <linux/ivtv.h>
4804 int main(void) { return 0; }
4806 _ivtv=no
4807 cc_check && _ivtv=yes
4809 if test "$_ivtv" = yes ; then
4810 _def_ivtv='#define HAVE_IVTV 1'
4811 _vosrc="$_vosrc vo_ivtv.c"
4812 _vomodules="ivtv $_vomodules"
4813 _aosrc="$_aosrc ao_ivtv.c"
4814 _aomodules="ivtv $_aomodules"
4815 else
4816 _def_ivtv='#undef HAVE_IVTV'
4817 _novomodules="ivtv $_novomodules"
4818 _noaomodules="ivtv $_noaomodules"
4820 echores "$_ivtv"
4824 #########
4825 # AUDIO #
4826 #########
4829 echocheck "OSS Audio"
4830 if test "$_ossaudio" = auto ; then
4831 cat > $TMPC << EOF
4832 #include <sys/ioctl.h>
4833 $_include_soundcard
4834 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4836 _ossaudio=no
4837 cc_check && _ossaudio=yes
4839 if test "$_ossaudio" = yes ; then
4840 _def_ossaudio='#define USE_OSS_AUDIO 1'
4841 _aosrc="$_aosrc ao_oss.c"
4842 _aomodules="oss $_aomodules"
4843 if test "$_linux_devfs" = yes; then
4844 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4845 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4846 else
4847 cat > $TMPC << EOF
4848 #include <sys/ioctl.h>
4849 $_include_soundcard
4850 #ifdef OPEN_SOUND_SYSTEM
4851 int main(void) { return 0; }
4852 #else
4853 #error Not the real thing
4854 #endif
4856 _real_ossaudio=no
4857 cc_check && _real_ossaudio=yes
4858 if test "$_real_ossaudio" = yes; then
4859 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4860 elif netbsd || openbsd ; then
4861 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4862 _ld_extra="$_ld_extra -lossaudio"
4863 else
4864 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4866 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4868 else
4869 _def_ossaudio='#undef USE_OSS_AUDIO'
4870 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4871 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4872 _noaomodules="oss $_noaomodules"
4874 echores "$_ossaudio"
4877 echocheck "aRts"
4878 if test "$_arts" = auto ; then
4879 _arts=no
4880 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4882 cat > $TMPC << EOF
4883 #include <artsc.h>
4884 int main(void) { return 0; }
4886 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
4891 if test "$_arts" = yes ; then
4892 _def_arts='#define USE_ARTS 1'
4893 _aosrc="$_aosrc ao_arts.c"
4894 _aomodules="arts $_aomodules"
4895 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
4896 _inc_extra="$_inc_extra `artsc-config --cflags`"
4897 else
4898 _noaomodules="arts $_noaomodules"
4900 echores "$_arts"
4903 echocheck "EsounD"
4904 if test "$_esd" = auto ; then
4905 _esd=no
4906 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4908 cat > $TMPC << EOF
4909 #include <esd.h>
4910 int main(void) { return 0; }
4912 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes
4916 echores "$_esd"
4918 if test "$_esd" = yes ; then
4919 _def_esd='#define USE_ESD 1'
4920 _aosrc="$_aosrc ao_esd.c"
4921 _aomodules="esd $_aomodules"
4922 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
4923 _inc_extra="$_inc_extra `esd-config --cflags`"
4925 echocheck "esd_get_latency()"
4926 cat > $TMPC << EOF
4927 #include <esd.h>
4928 int main(void) { return esd_get_latency(0); }
4930 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4931 echores "$_esd_latency"
4932 else
4933 _def_esd='#undef USE_ESD'
4934 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4935 _noaomodules="esd $_noaomodules"
4938 echocheck "Polyp"
4939 if test "$_polyp" = auto ; then
4940 _polyp=no
4941 if $_pkg_config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
4943 cat > $TMPC << EOF
4944 #include <polyp/polyplib.h>
4945 #include <polyp/mainloop.h>
4946 #include <polyp/polyplib-error.h>
4947 int main(void) { return 0; }
4949 cc_check `$_pkg_config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
4953 echores "$_polyp"
4955 if test "$_polyp" = yes ; then
4956 _def_polyp='#define USE_POLYP 1'
4957 _aosrc="$_aosrc ao_polyp.c"
4958 _aomodules="polyp $_aomodules"
4959 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs polyplib polyplib-error polyplib-mainloop`"
4960 _inc_extra="$_inc_extra `$_pkg_config --cflags polyplib polyplib-error polyplib-mainloop`"
4961 else
4962 _def_polyp='#undef USE_POLYP'
4963 _noaomodules="polyp $_noaomodules"
4967 echocheck "JACK"
4968 if test "$_jack" = auto ; then
4969 _jack=yes
4971 cat > $TMPC << EOF
4972 #include <jack/jack.h>
4973 int main(void) { jack_client_new("test"); return 0; }
4975 if cc_check -ljack ; then
4976 _libs_mplayer="$_libs_mplayer -ljack"
4977 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
4978 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
4979 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
4980 else
4981 _jack=no
4985 if test "$_jack" = yes ; then
4986 _def_jack='#define USE_JACK 1'
4987 _aosrc="$_aosrc ao_jack.c"
4988 _aomodules="jack $_aomodules"
4989 else
4990 _noaomodules="jack $_noaomodules"
4992 echores "$_jack"
4994 echocheck "OpenAL"
4995 if test "$_openal" = auto ; then
4996 _openal=no
4997 cat > $TMPC << EOF
4998 #ifdef OPENAL_AL_H
4999 #include <OpenAL/al.h>
5000 #else
5001 #include <AL/al.h>
5002 #endif
5003 int main(void) {
5004 alSourceQueueBuffers(0, 0, 0);
5005 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5006 return 0;
5009 for I in "-lopenal" "-framework OpenAL" ; do
5010 cc_check $I && _openal=yes && break
5011 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5012 done
5013 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5015 if test "$_openal" = yes ; then
5016 _def_openal='#define USE_OPENAL 1'
5017 _aosrc="$_aosrc ao_openal.c"
5018 _aomodules="openal $_aomodules"
5019 else
5020 _noaomodules="openal $_noaomodules"
5022 echores "$_openal"
5024 echocheck "ALSA audio"
5025 if test "$_alsa" != no ; then
5026 _alsa=no
5027 cat > $TMPC << EOF
5028 #include <sys/asoundlib.h>
5029 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5030 #error "alsa version != 0.5.x"
5031 #endif
5032 int main(void) { return 0; }
5034 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5036 cat > $TMPC << EOF
5037 #include <sys/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-sys'
5044 cat > $TMPC << EOF
5045 #include <alsa/asoundlib.h>
5046 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5047 #error "alsa version != 0.9.x"
5048 #endif
5049 int main(void) { return 0; }
5051 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5053 cat > $TMPC << EOF
5054 #include <sys/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-sys'
5061 cat > $TMPC << EOF
5062 #include <alsa/asoundlib.h>
5063 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5064 #error "alsa version != 1.0.x"
5065 #endif
5066 int main(void) { return 0; }
5068 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5070 _def_alsa5='#undef HAVE_ALSA5'
5071 _def_alsa9='#undef HAVE_ALSA9'
5072 _def_alsa1x='#undef HAVE_ALSA1X'
5073 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5074 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5075 if test "$_alsaver" ; then
5076 _alsa=yes
5077 if test "$_alsaver" = '0.5.x' ; then
5078 _alsa5=yes
5079 _aosrc="$_aosrc ao_alsa5.c"
5080 _aomodules="alsa5 $_aomodules"
5081 _def_alsa5='#define HAVE_ALSA5 1'
5082 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5083 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5084 elif test "$_alsaver" = '0.9.x-sys' ; then
5085 _alsa9=yes
5086 _aosrc="$_aosrc ao_alsa.c"
5087 _aomodules="alsa $_aomodules"
5088 _def_alsa9='#define HAVE_ALSA9 1'
5089 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5090 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5091 elif test "$_alsaver" = '0.9.x-alsa' ; then
5092 _alsa9=yes
5093 _aosrc="$_aosrc ao_alsa.c"
5094 _aomodules="alsa $_aomodules"
5095 _def_alsa9='#define HAVE_ALSA9 1'
5096 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5097 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5098 elif test "$_alsaver" = '1.0.x-sys' ; then
5099 _alsa1x=yes
5100 _aosrc="$_aosrc ao_alsa.c"
5101 _aomodules="alsa $_aomodules"
5102 _def_alsa1x="#define HAVE_ALSA1X 1"
5103 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5104 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5105 elif test "$_alsaver" = '1.0.x-alsa' ; then
5106 _alsa1x=yes
5107 _aosrc="$_aosrc ao_alsa.c"
5108 _aomodules="alsa $_aomodules"
5109 _def_alsa1x="#define HAVE_ALSA1X 1"
5110 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5111 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5112 else
5113 _alsa=no
5114 _res_comment="unknown version"
5116 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5117 else
5118 _noaomodules="alsa $_noaomodules"
5120 echores "$_alsa"
5123 echocheck "Sun audio"
5124 if test "$_sunaudio" = auto ; then
5125 cat > $TMPC << EOF
5126 #include <sys/types.h>
5127 #include <sys/audioio.h>
5128 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5130 _sunaudio=no
5131 cc_check && _sunaudio=yes
5133 if test "$_sunaudio" = yes ; then
5134 _def_sunaudio='#define USE_SUN_AUDIO 1'
5135 _aosrc="$_aosrc ao_sun.c"
5136 _aomodules="sun $_aomodules"
5137 else
5138 _def_sunaudio='#undef USE_SUN_AUDIO'
5139 _noaomodules="sun $_noaomodules"
5141 echores "$_sunaudio"
5144 if sunos; then
5145 echocheck "Sun mediaLib"
5146 if test "$_mlib" = auto ; then
5147 _mlib=no
5148 cat > $TMPC << EOF
5149 #include <mlib.h>
5150 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5152 cc_check -lmlib && _mlib=yes
5154 if test "$_mlib" = yes ; then
5155 _def_mlib='#define HAVE_MLIB 1'
5156 else
5157 _def_mlib='#undef HAVE_MLIB'
5159 echores "$_mlib"
5160 fi #if sunos
5163 if irix; then
5164 echocheck "SGI audio"
5165 if test "$_sgiaudio" = auto ; then
5166 # check for SGI audio
5167 cat > $TMPC << EOF
5168 #include <dmedia/audio.h>
5169 int main(void) { return 0; }
5171 _sgiaudio=no
5172 cc_check && _sgiaudio=yes
5174 if test "$_sgiaudio" = "yes" ; then
5175 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5176 _libs_mplayer="$_libs_mplayer -laudio"
5177 _aosrc="$_aosrc ao_sgi.c"
5178 _aomodules="sgi $_aomodules"
5179 else
5180 _def_sgiaudio='#undef USE_SGI_AUDIO'
5181 _noaomodules="sgi $_noaomodules"
5183 echores "$_sgiaudio"
5184 fi #if irix
5187 echocheck "VCD support"
5188 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5189 _inputmodules="vcd $_inputmodules"
5190 _def_vcd='#define HAVE_VCD 1'
5191 _vcd="yes"
5192 else
5193 _def_vcd='#undef HAVE_VCD'
5194 _noinputmodules="vcd $_noinputmodules"
5195 _res_comment="not supported on this OS"
5196 _vcd="no"
5198 echores "$_vcd"
5200 echocheck "DVD support (libdvdnav)"
5201 if test "$_dvdnav" = auto ; then
5202 $_dvdnavconfig --version >> $TMPLOG 2>&1 || _dvdnav=no
5204 if test "$_dvdnav" = auto ; then
5205 cat > $TMPC <<EOF
5206 #include <inttypes.h>
5207 #include <dvdnav.h>
5208 int main(void) { dvdnav_t *dvd=0; return 0; }
5210 _dvdnav=no
5211 _dvdnavdir=`$_dvdnavconfig --cflags`
5212 _dvdnavlibs=`$_dvdnavconfig --libs`
5213 _dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
5214 _dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
5215 test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
5216 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
5218 if test "$_dvdnav" = yes ; then
5219 _largefiles=yes
5220 _def_dvdnav='#define USE_DVDNAV 1'
5221 _ld_extra="$_ld_extra `$_dvdnavconfig --libs`"
5222 _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
5223 _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
5224 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
5225 _inputmodules="dvdnav $_inputmodules"
5227 #disable dvdread checks: dvdread will be enabled using dvdnav's version of dvdread
5228 _dvdread_internal=no
5229 _dvdread=yes
5230 else
5231 _def_dvdnav='#undef USE_DVDNAV'
5232 _noinputmodules="dvdnav $_noinputmodules"
5234 echores "$_dvdnav"
5237 echocheck "dvdread"
5238 if test "$_dvdread_internal" = auto ; then
5239 _dvdread_internal=no
5240 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5241 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5242 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5243 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5244 _dvdread_internal=yes
5245 _dvdread=yes
5246 _res_comment="internal"
5248 elif test "$_dvdread" = auto ; then
5249 _dvdread=no
5250 if test "$_dl" = yes; then
5251 cat > $TMPC << EOF
5252 #include <inttypes.h>
5253 #include <dvdread/dvd_reader.h>
5254 #include <dvdread/ifo_types.h>
5255 #include <dvdread/ifo_read.h>
5256 #include <dvdread/nav_read.h>
5257 int main(void) { return 0; }
5259 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5260 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5264 if test "$_dvdread_internal" = yes; then
5265 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5266 _def_dvdread='#define USE_DVDREAD 1'
5267 _inputmodules="dvdread(internal) $_inputmodules"
5268 _largefiles=yes
5269 elif test "$_dvdread" = yes; then
5270 _def_dvdread='#define USE_DVDREAD 1'
5271 _largefiles=yes
5272 if test "$_dvdnav" != yes; then
5273 _ld_extra="$_ld_extra -ldvdread"
5274 _inputmodules="dvdread(external) $_inputmodules"
5275 _res_comment="external"
5276 else
5277 _inputmodules="dvdread(from dvdnav) $_inputmodules"
5278 _res_comment="from dvdnav"
5280 else
5281 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5282 _def_dvdread='#undef USE_DVDREAD'
5283 _noinputmodules="dvdread $_noinputmodules"
5285 echores "$_dvdread"
5288 echocheck "internal libdvdcss"
5289 if test "$_libdvdcss_internal" = auto ; then
5290 _libdvdcss_internal=no
5291 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5293 if test "$_libdvdcss_internal" = yes ; then
5294 if linux || netbsd || openbsd || bsdos ; then
5295 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5296 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5297 elif freebsd ; then
5298 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5299 elif darwin ; then
5300 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5301 _ld_extra="$_ld_extra -framework IOKit"
5303 _inputmodules="libdvdcss(internal) $_inputmodules"
5304 _largefiles=yes
5305 else
5306 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5308 echores "$_libdvdcss_internal"
5311 echocheck "cdparanoia"
5312 if test "$_cdparanoia" = auto ; then
5313 cat > $TMPC <<EOF
5314 #include <cdda_interface.h>
5315 #include <cdda_paranoia.h>
5316 // This need a better test. How ?
5317 int main(void) {
5318 void *test = cdda_verbose_set;
5319 return test == (void *)1;
5322 _cdparanoia=no
5323 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5324 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5325 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5326 done
5328 if test "$_cdparanoia" = yes ; then
5329 _cdda='yes'
5330 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5331 openbsd && _ld_extra="$_ld_extra -lutil"
5333 echores "$_cdparanoia"
5336 echocheck "libcdio"
5337 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5338 cat > $TMPC << EOF
5339 #include <stdio.h>
5340 #include <cdio/version.h>
5341 #include <cdio/cdda.h>
5342 #include <cdio/paranoia.h>
5343 int main()
5345 void *test = cdda_verbose_set;
5346 printf("%s\n", CDIO_VERSION);
5347 return test == (void *)1;
5351 _libcdio=no
5352 for _ld_tmp in "" "-lwinmm" ; do
5353 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5354 cc_check $_ld_tmp $_ld_lm \
5355 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5356 done
5357 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5358 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5359 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5360 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5361 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5364 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5365 _cdda='yes'
5366 _def_libcdio='#define HAVE_LIBCDIO'
5367 _def_havelibcdio='yes'
5368 else
5369 if test "$_cdparanoia" = yes ; then
5370 _res_comment="using cdparanoia"
5372 _def_libcdio='#undef HAVE_LIBCDIO'
5373 _def_havelibcdio='no'
5375 echores "$_libcdio"
5377 if test "$_cdda" = yes ; then
5378 test $_cddb = auto && test $_network = yes && not darwin && _cddb=yes
5379 _def_cdparanoia='#define HAVE_CDDA'
5380 _inputmodules="cdda $_inputmodules"
5381 else
5382 _def_cdparanoia='#undef HAVE_CDDA'
5383 _noinputmodules="cdda $_noinputmodules"
5386 if test "$_cddb" = yes ; then
5387 _def_cddb='#define HAVE_CDDB'
5388 _inputmodules="cddb $_inputmodules"
5389 else
5390 _cddb=no
5391 _def_cddb='#undef HAVE_CDDB'
5392 _noinputmodules="cddb $_noinputmodules"
5395 echocheck "bitmap font support"
5396 if test "$_bitmap_font" = yes ; then
5397 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5398 else
5399 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5401 echores "$_bitmap_font"
5404 echocheck "freetype >= 2.0.9"
5406 # freetype depends on iconv
5407 if test "$_iconv" = no ; then
5408 _freetype=no
5409 _res_comment="iconv support needed"
5412 if test "$_freetype" = auto ; then
5413 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5414 cat > $TMPC << EOF
5415 #include <stdio.h>
5416 #include <ft2build.h>
5417 #include FT_FREETYPE_H
5418 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5419 #error "Need FreeType 2.0.9 or newer"
5420 #endif
5421 int main()
5423 FT_Library library;
5424 FT_Int major=-1,minor=-1,patch=-1;
5425 int err=FT_Init_FreeType(&library);
5426 if(err){
5427 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5428 exit(err);
5430 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5431 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5432 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5433 (int)major,(int)minor,(int)patch );
5434 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5435 printf("Library and header version mismatch! Fix it in your distribution!\n");
5436 exit(1);
5438 return 0;
5441 _freetype=no
5442 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5443 else
5444 _freetype=no
5447 if test "$_freetype" = yes ; then
5448 _def_freetype='#define HAVE_FREETYPE'
5449 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5450 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5451 else
5452 _def_freetype='#undef HAVE_FREETYPE'
5454 echores "$_freetype"
5456 if test "$_freetype" = no ; then
5457 _fontconfig=no
5458 _res_comment="freetype support needed"
5460 echocheck "fontconfig"
5461 if test "$_fontconfig" = auto ; then
5462 cat > $TMPC << EOF
5463 #include <stdio.h>
5464 #include <fontconfig/fontconfig.h>
5465 int main()
5467 int err = FcInit();
5468 if(err == FcFalse){
5469 printf("Couldn't initialize fontconfig lib\n");
5470 exit(err);
5472 return 0;
5476 _fontconfig=no
5477 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5478 _ld_tmp="-lfontconfig $_ld_tmp"
5479 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5480 done
5481 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5482 _inc_tmp=`$_pkg_config --cflags fontconfig`
5483 _ld_tmp=`$_pkg_config --libs fontconfig`
5484 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5485 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5488 if test "$_fontconfig" = yes ; then
5489 _def_fontconfig='#define HAVE_FONTCONFIG'
5490 else
5491 _def_fontconfig='#undef HAVE_FONTCONFIG'
5493 echores "$_fontconfig"
5496 echocheck "SSA/ASS support"
5497 # libass depends on FreeType
5498 if test "$_freetype" = no ; then
5499 _ass=no
5500 _res_comment="FreeType support needed"
5503 if test "$_ass" = auto ; then
5504 cat > $TMPC << EOF
5505 #include <ft2build.h>
5506 #include FT_FREETYPE_H
5507 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5508 #error "Need FreeType 2.1.8 or newer"
5509 #endif
5510 int main() { return 0; }
5512 _ass=no
5513 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5514 if test "$_ass" = no ; then
5515 _res_comment="FreeType >= 2.1.8 needed"
5518 if test "$_ass" = yes ; then
5519 _def_ass='#define USE_ASS'
5520 else
5521 _def_ass='#undef USE_ASS'
5523 echores "$_ass"
5526 echocheck "fribidi with charsets"
5527 if test "$_fribidi" = auto ; then
5528 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5529 cat > $TMPC << EOF
5530 #include <stdio.h>
5531 /* workaround for fribidi 0.10.4 and below */
5532 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5533 #include <fribidi/fribidi.h>
5534 int main()
5536 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5537 printf("Fribidi headers are not consistents with the library!\n");
5538 exit(1);
5540 return 0;
5543 _fribidi=no
5544 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5545 else
5546 _fribidi=no
5549 if test "$_fribidi" = yes ; then
5550 _def_fribidi='#define USE_FRIBIDI'
5551 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5552 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5553 else
5554 _def_fribidi='#undef USE_FRIBIDI'
5556 echores "$_fribidi"
5559 echocheck "ENCA"
5560 if test "$_enca" = auto ; then
5561 cat > $TMPC << EOF
5562 #include <enca.h>
5563 int main()
5565 const char **langs;
5566 size_t langcnt;
5567 langs = enca_get_languages(&langcnt);
5568 return 0;
5571 _enca=no
5572 cc_check -lenca $_ld_lm && _enca=yes
5574 if test "$_enca" = yes ; then
5575 _def_enca='#define HAVE_ENCA 1'
5576 _ld_extra="$_ld_extra -lenca"
5577 else
5578 _def_enca='#undef HAVE_ENCA'
5580 echores "$_enca"
5583 echocheck "zlib"
5584 cat > $TMPC << EOF
5585 #include <zlib.h>
5586 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5588 _zlib=no
5589 cc_check -lz && _zlib=yes
5590 if test "$_zlib" = yes ; then
5591 _def_zlib='#define HAVE_ZLIB 1'
5592 _ld_extra="$_ld_extra -lz"
5593 else
5594 _def_zlib='#undef HAVE_ZLIB'
5596 echores "$_zlib"
5599 echocheck "RTC"
5600 if test "$_rtc" = auto ; then
5601 cat > $TMPC << EOF
5602 #include <sys/ioctl.h>
5603 #ifdef __linux__
5604 #include <linux/rtc.h>
5605 #else
5606 #include <rtc.h>
5607 #define RTC_PIE_ON RTCIO_PIE_ON
5608 #endif
5609 int main(void) { return RTC_PIE_ON; }
5611 _rtc=no
5612 cc_check && _rtc=yes
5613 ppc && _rtc=no
5615 if test "$_rtc" = yes ; then
5616 _def_rtc='#define HAVE_RTC 1'
5617 else
5618 _def_rtc='#undef HAVE_RTC'
5620 echores "$_rtc"
5623 echocheck "liblzo2 support"
5624 if test "$_liblzo" = auto ; then
5625 _liblzo=no
5626 cat > $TMPC << EOF
5627 #include <lzo/lzo1x.h>
5628 int main(void) { lzo_init();return 0; }
5630 cc_check -llzo2 && _liblzo=yes
5632 if test "$_liblzo" = yes ; then
5633 _def_liblzo='#define USE_LIBLZO 1'
5634 _ld_extra="$_ld_extra -llzo2"
5635 _codecmodules="liblzo $_codecmodules"
5636 else
5637 _def_liblzo='#undef USE_LIBLZO'
5638 _nocodecmodules="liblzo $_nocodecmodules"
5640 echores "$_liblzo"
5643 echocheck "mad support"
5644 if test "$_mad" = auto ; then
5645 _mad=no
5646 cat > $TMPC << EOF
5647 #include <mad.h>
5648 int main(void) { return 0; }
5650 cc_check -lmad && _mad=yes
5652 if test "$_mad" = yes ; then
5653 _def_mad='#define USE_LIBMAD 1'
5654 _ld_extra="$_ld_extra -lmad"
5655 _codecmodules="libmad $_codecmodules"
5656 else
5657 _def_mad='#undef USE_LIBMAD'
5658 _nocodecmodules="libmad $_nocodecmodules"
5660 echores "$_mad"
5662 echocheck "Twolame"
5663 if test "$_twolame" = auto ; then
5664 cat > $TMPC <<EOF
5665 #include <twolame.h>
5666 int main(void) { twolame_init(); return 0; }
5668 _twolame=no
5669 cc_check -ltwolame $_ld_lm && _twolame=yes
5671 if test "$_twolame" = yes ; then
5672 _def_twolame='#define HAVE_TWOLAME 1'
5673 _libs_mencoder="$_libs_mencoder -ltwolame"
5674 _codecmodules="twolame $_codecmodules"
5675 else
5676 _def_twolame='#undef HAVE_TWOLAME'
5677 _nocodecmodules="twolame $_nocodecmodules"
5679 echores "$_twolame"
5681 echocheck "Toolame"
5682 if test "$_toolame" = auto ; then
5683 _toolame=no
5684 if test "$_twolame" = yes ; then
5685 _res_comment="disabled by twolame"
5686 else
5687 cat > $TMPC <<EOF
5688 #include <toolame.h>
5689 int main(void) { toolame_init(); return 0; }
5691 cc_check -ltoolame $_ld_lm && _toolame=yes
5694 if test "$_toolame" = yes ; then
5695 _def_toolame='#define HAVE_TOOLAME 1'
5696 _libs_mencoder="$_libs_mencoder -ltoolame"
5697 _codecmodules="toolame $_codecmodules"
5698 else
5699 _def_toolame='#undef HAVE_TOOLAME'
5700 _nocodecmodules="toolame $_nocodecmodules"
5702 if test "$_toolamedir" ; then
5703 _res_comment="using $_toolamedir"
5705 echores "$_toolame"
5707 echocheck "OggVorbis support"
5708 if test "$_tremor_internal" = yes; then
5709 _libvorbis=no
5710 elif test "$_tremor_external" = auto; then
5711 _tremor_external=no
5712 cat > $TMPC << EOF
5713 #include <tremor/ivorbiscodec.h>
5714 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5716 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5718 if test "$_libvorbis" = auto; then
5719 _libvorbis=no
5720 cat > $TMPC << EOF
5721 #include <vorbis/codec.h>
5722 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5724 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5726 if test "$_tremor_internal" = yes ; then
5727 _vorbis=yes
5728 _def_vorbis='#define HAVE_OGGVORBIS 1'
5729 _def_tremor='#define TREMOR 1'
5730 _codecmodules="tremor(internal) $_codecmodules"
5731 _res_comment="internal Tremor"
5732 if test "$_tremor_low" = yes ; then
5733 _res_comment="internal low accuracy Tremor"
5735 elif test "$_tremor_external" = yes ; then
5736 _vorbis=yes
5737 _def_vorbis='#define HAVE_OGGVORBIS 1'
5738 _def_tremor='#define TREMOR 1'
5739 _codecmodules="tremor(external) $_codecmodules"
5740 _res_comment="external Tremor"
5741 _ld_extra="$_ld_extra -logg -lvorbisidec"
5742 elif test "$_libvorbis" = yes ; then
5743 _vorbis=yes
5744 _def_vorbis='#define HAVE_OGGVORBIS 1'
5745 _codecmodules="libvorbis $_codecmodules"
5746 _res_comment="libvorbis"
5747 _ld_extra="$_ld_extra -lvorbis -logg"
5748 else
5749 _vorbis=no
5750 _nocodecmodules="libvorbis $_nocodecmodules"
5752 echores "$_vorbis"
5754 echocheck "libspeex (version >= 1.1 required)"
5755 if test "$_speex" = auto ; then
5756 _speex=no
5757 cat > $TMPC << EOF
5758 #include <speex/speex.h>
5759 int main(void) {
5760 SpeexBits bits;
5761 void *dec;
5762 speex_decode_int(dec, &bits, dec);
5765 cc_check -lspeex $_ld_lm && _speex=yes
5767 if test "$_speex" = yes ; then
5768 _def_speex='#define HAVE_SPEEX 1'
5769 _ld_extra="$_ld_extra -lspeex"
5770 _codecmodules="speex $_codecmodules"
5771 else
5772 _def_speex='#undef HAVE_SPEEX'
5773 _nocodecmodules="speex $_nocodecmodules"
5775 echores "$_speex"
5777 echocheck "OggTheora support"
5778 if test "$_theora" = auto ; then
5779 _theora=no
5780 cat > $TMPC << EOF
5781 #include <theora/theora.h>
5782 #include <string.h>
5783 int main(void)
5785 /* theora is in flux, make sure that all interface routines and
5786 * datatypes exist and work the way we expect it, so we don't break
5787 * mplayer */
5788 ogg_packet op;
5789 theora_comment tc;
5790 theora_info inf;
5791 theora_state st;
5792 yuv_buffer yuv;
5793 int r;
5794 double t;
5796 theora_info_init (&inf);
5797 theora_comment_init (&tc);
5799 return 0;
5801 /* we don't want to execute this kind of nonsense; just for making sure
5802 * that compilation works... */
5803 memset(&op, 0, sizeof(op));
5804 r = theora_decode_header (&inf, &tc, &op);
5805 r = theora_decode_init (&st, &inf);
5806 t = theora_granule_time (&st, op.granulepos);
5807 r = theora_decode_packetin (&st, &op);
5808 r = theora_decode_YUVout (&st, &yuv);
5809 theora_clear (&st);
5811 return 0;
5814 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5815 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5816 && _theora=yes && break
5817 done
5818 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5819 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5820 cc_check -I. tremor/bitwise.c $_ld_theora \
5821 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5822 done
5825 if test "$_theora" = yes ; then
5826 _def_theora='#define HAVE_OGGTHEORA 1'
5827 _codecmodules="libtheora $_codecmodules"
5828 # when --enable-theora is forced, we'd better provide a probably sane
5829 # $_ld_theora than nothing
5830 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5831 else
5832 _def_theora='#undef HAVE_OGGTHEORA'
5833 _nocodecmodules="libtheora $_nocodecmodules"
5835 echores "$_theora"
5837 echocheck "mp3lib support"
5838 if test "$_mp3lib" = yes ; then
5839 _def_mp3lib='#define USE_MP3LIB 1'
5840 _codecmodules="mp3lib $_codecmodules"
5841 else
5842 _def_mp3lib='#undef USE_MP3LIB'
5843 _nocodecmodules="mp3lib $_nocodecmodules"
5845 echores "$_mp3lib"
5847 echocheck "liba52 support"
5848 if test "$_liba52" = yes ; then
5849 _def_liba52='#define USE_LIBA52 1'
5850 _codecmodules="liba52 $_codecmodules"
5851 else
5852 _def_liba52='#undef USE_LIBA52'
5853 _nocodecmodules="liba52 $_nocodecmodules"
5855 echores "$_liba52"
5857 echocheck "libdts support"
5858 if test "$_libdts" = auto ; then
5859 _libdts=no
5860 cat > $TMPC << EOF
5861 #include <inttypes.h>
5862 #include <dts.h>
5863 int main(void) { dts_init (0); return 0; }
5865 cc_check -ldts $_ld_lm && _libdts=yes
5867 if test "$_libdts" = yes ; then
5868 _def_libdts='#define CONFIG_LIBDTS 1'
5869 _ld_extra="$_ld_extra -ldts"
5870 _codecmodules="libdts $_codecmodules"
5871 else
5872 _def_libdts='#undef CONFIG_LIBDTS'
5873 _nocodecmodules="libdts $_nocodecmodules"
5875 echores "$_libdts"
5877 echocheck "libmpeg2 support"
5878 if test "$_libmpeg2" = yes ; then
5879 _def_libmpeg2='#define USE_LIBMPEG2 1'
5880 _codecmodules="libmpeg2 $_codecmodules"
5881 else
5882 _def_libmpeg2='#undef USE_LIBMPEG2'
5883 _nocodecmodules="libmpeg2 $_nocodecmodules"
5885 echores "$_libmpeg2"
5887 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5888 if test "$_musepack" = auto ; then
5889 _musepack=no
5890 cat > $TMPC << EOF
5891 #include <mpcdec/mpcdec.h>
5892 int main(void) {
5893 mpc_streaminfo info;
5894 mpc_decoder decoder;
5895 mpc_decoder_set_streaminfo(&decoder, &info);
5896 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5899 cc_check -lmpcdec $_ld_lm && _musepack=yes
5901 if test "$_musepack" = yes ; then
5902 _def_musepack='#define HAVE_MUSEPACK 1'
5903 _ld_extra="$_ld_extra -lmpcdec"
5904 _codecmodules="musepack $_codecmodules"
5905 else
5906 _def_musepack='#undef HAVE_MUSEPACK'
5907 _nocodecmodules="musepack $_nocodecmodules"
5909 echores "$_musepack"
5912 echocheck "FAAC (AAC encoder) support"
5913 if test "$_faac" = auto ; then
5914 cat > $TMPC <<EOF
5915 #include <inttypes.h>
5916 #include <faac.h>
5917 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5919 _faac=no
5920 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5921 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
5922 done
5924 if test "$_faac" = yes ; then
5925 _def_faac="#define HAVE_FAAC 1"
5926 if echo $_libavencoders | grep -q FAAC ; then
5927 _lavc_faac=yes
5928 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
5929 _libs_mplayer="$_libs_mplayer $_ld_faac"
5930 else
5931 _lavc_faac=no
5932 _def_lavc_faac="#undef CONFIG_LIBFAAC"
5934 _codecmodules="faac $_codecmodules"
5935 else
5936 _def_faac="#undef HAVE_FAAC"
5937 _nocodecmodules="faac $_nocodecmodules"
5939 echores "$_faac (in libavcodec: $_lavc_faac)"
5942 echocheck "FAAD2 (AAC) support"
5943 if test "$_faad_internal" = auto ; then
5944 if x86_32 && test cc_vendor=gnu; then
5945 case $cc_version in
5946 3.1*|3.2) # ICE/insn with these versions
5947 _faad_internal=no
5948 _res_comment="broken gcc"
5951 _faad_internal=yes
5953 esac
5954 else
5955 _faad_internal=yes
5957 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
5958 _faad_external=no
5959 cat > $TMPC << EOF
5960 #include <faad.h>
5961 #ifndef FAAD_MIN_STREAMSIZE
5962 #error Too old version
5963 #endif
5964 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5966 cc_check -lfaad $_ld_lm && _faad_external=yes
5969 if test "$_faad_internal" = yes ; then
5970 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
5971 _faad=yes
5972 _res_comment="internal floating-point"
5973 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
5974 elif test "$_faad_external" = yes ; then
5975 _faad=yes
5976 _ld_extra="$_ld_extra -lfaad"
5977 else
5978 _def_faad_internal="#undef USE_FAAD_INTERNAL"
5979 _faad=no
5982 if test "$_faad" = yes ; then
5983 _def_faad='#define HAVE_FAAD 1'
5984 _codecmodules="faad2 $_codecmodules"
5985 else
5986 _def_faad='#undef HAVE_FAAD'
5987 _nocodecmodules="faad2 $_nocodecmodules"
5989 echores "$_faad"
5992 echocheck "LADSPA plugin support"
5993 if test "$_ladspa" = auto ; then
5994 cat > $TMPC <<EOF
5995 #include <stdio.h>
5996 #include <ladspa.h>
5997 int main(void) {
5998 const LADSPA_Descriptor *ld = NULL;
5999 return 0;
6002 _ladspa=no
6003 cc_check && _ladspa=yes
6005 if test "$_ladspa" = yes; then
6006 _def_ladspa="#define HAVE_LADSPA"
6007 _afsrc="$_afsrc af_ladspa.c"
6008 _afmodules="ladspa $_afmodules"
6009 else
6010 _def_ladspa="#undef HAVE_LADSPA"
6011 _noafmodules="ladspa $_noafmodules"
6013 echores "$_ladspa"
6016 if test -z "$_codecsdir" ; then
6017 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6018 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6019 if test -d "$dir" ; then
6020 _codecsdir="$dir"
6021 break;
6023 done
6025 # Fall back on default directory.
6026 if test -z "$_codecsdir" ; then
6027 _codecsdir="$_libdir/codecs"
6028 mingw32 && _codecsdir="codecs"
6032 echocheck "Win32 codecs"
6033 if test "$_win32dll" = auto ; then
6034 _win32dll=no
6035 if x86_32 && not qnx; then
6036 _win32dll=yes
6039 if test "$_win32dll" = yes ; then
6040 _def_win32dll='#define USE_WIN32DLL 1'
6041 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6042 _res_comment="using $_win32codecsdir"
6043 if not win32 ; then
6044 _def_win32_loader='#define WIN32_LOADER 1'
6045 else
6046 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6047 _res_comment="using native windows"
6049 _codecmodules="win32 $_codecmodules"
6050 else
6051 _def_win32dll='#undef USE_WIN32DLL'
6052 _def_win32_loader='#undef WIN32_LOADER'
6053 _nocodecmodules="win32 $_nocodecmodules"
6055 echores "$_win32dll"
6058 echocheck "XAnim codecs"
6059 if test "$_xanim" = auto ; then
6060 _xanim=no
6061 _res_comment="dynamic loader support needed"
6062 if test "$_dl" = yes ; then
6063 _xanim=yes
6066 if test "$_xanim" = yes ; then
6067 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6068 _def_xanim='#define USE_XANIM 1'
6069 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6070 _codecmodules="xanim $_codecmodules"
6071 _res_comment="using $_xanimcodecsdir"
6072 else
6073 _def_xanim='#undef USE_XANIM'
6074 _def_xanim_path='#undef XACODEC_PATH'
6075 _nocodecmodules="xanim $_nocodecmodules"
6077 echores "$_xanim"
6080 echocheck "RealPlayer codecs"
6081 if test "$_real" = auto ; then
6082 _real=no
6083 _res_comment="dynamic loader support needed"
6084 if test "$_dl" = yes || test "$_win32dll" = yes &&
6085 (linux || freebsd || netbsd || win32 || darwin) ; then
6086 _real=yes
6089 if test "$_real" = yes ; then
6090 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6091 _def_real='#define USE_REALCODECS 1'
6092 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6093 _codecmodules="real $_codecmodules"
6094 _res_comment="using $_realcodecsdir"
6095 else
6096 _def_real='#undef USE_REALCODECS'
6097 _def_real_path="#undef REALCODEC_PATH"
6098 _nocodecmodules="real $_nocodecmodules"
6100 echores "$_real"
6103 echocheck "LIVE555 Streaming Media libraries"
6104 if test "$_live" = auto && test "$_network" = yes ; then
6105 cat > $TMPCPP << EOF
6106 #include <liveMedia.hh>
6107 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6108 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6109 #endif
6110 int main(void) {}
6113 _live=no
6114 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6115 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6116 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6117 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6118 $_livelibdir/groupsock/libgroupsock.a \
6119 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6120 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6121 $_ld_extra -lstdc++" \
6122 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6123 -I$_livelibdir/UsageEnvironment/include \
6124 -I$_livelibdir/BasicUsageEnvironment/include \
6125 -I$_livelibdir/groupsock/include" && \
6126 _live=yes && break
6127 done
6128 if test "$_live" != yes ; then
6129 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6130 _live_dist=yes
6134 if test "$_live" = yes && test "$_network" = yes ; then
6135 _res_comment="using $_livelibdir"
6136 _def_live='#define STREAMING_LIVE555 1'
6137 _inputmodules="live555 $_inputmodules"
6138 elif test "$_live_dist" = yes && test "$_network" = yes ; then
6139 _res_comment="using distribution version"
6140 _live="yes"
6141 _def_live='#define STREAMING_LIVE555 1'
6142 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6143 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6144 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6145 _inputmodules="live555 $_inputmodules"
6146 else
6147 _def_live='#undef STREAMING_LIVE555'
6148 _noinputmodules="live555 $_noinputmodules"
6150 echores "$_live"
6153 echocheck "FFmpeg libavutil"
6154 if test "$_libavutil_a" = auto ; then
6155 if test -d libavutil ; then
6156 _libavutil_a=yes
6157 _res_comment="static"
6158 else
6159 die "MPlayer will not compile without libavutil in the source tree."
6161 elif test "$_libavutil_so" = auto ; then
6162 _libavutil_so=no
6163 cat > $TMPC << EOF
6164 #include <ffmpeg/common.h>
6165 int main(void) { ff_gcd(1,1); return 0; }
6167 if $_pkg_config --exists libavutil ; then
6168 _inc_libavutil=`$_pkg_config --cflags libavutil`
6169 _ld_tmp=`$_pkg_config --libs libavutil`
6170 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6171 && _libavutil_so=yes
6172 elif cc_check -lavutil $_ld_lm ; then
6173 _ld_extra="$_ld_extra -lavutil"
6174 _libavutil_so=yes
6175 _res_comment="using libavutil.so, but static libavutil is recommended"
6178 _libavutil=no
6179 _def_libavutil='#undef USE_LIBAVUTIL'
6180 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6181 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6182 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6183 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6184 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6185 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6186 # neither static nor shared libavutil is available, but it is mandatory ...
6187 if test "$_libavutil" = no ; then
6188 die "You need static or shared libavutil, MPlayer will not compile without!"
6190 echores "$_libavutil"
6192 echocheck "FFmpeg libavcodec"
6193 if test "$_libavcodec_a" = auto ; then
6194 _libavcodec_a=no
6195 if test -d libavcodec && test -f libavcodec/utils.c ; then
6196 _libavcodec_a="yes"
6197 _res_comment="static"
6199 elif test "$_libavcodec_so" = auto ; then
6200 _libavcodec_so=no
6201 _res_comment="libavcodec.so is discouraged over static libavcodec"
6202 cat > $TMPC << EOF
6203 #include <ffmpeg/avcodec.h>
6204 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6206 if $_pkg_config --exists libavcodec ; then
6207 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6208 _ld_tmp=`$_pkg_config --libs libavcodec`
6209 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6210 && _libavcodec_so=yes
6211 elif cc_check -lavcodec $_ld_lm ; then
6212 _ld_extra="$_ld_extra -lavcodec"
6213 _libavcodec_so=yes
6214 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6217 _libavcodec=no
6218 _def_libavcodec='#undef USE_LIBAVCODEC'
6219 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6220 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6221 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6222 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6223 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6224 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6225 test "$_libavcodec_mpegaudio_hp" = yes \
6226 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6227 if test "$_libavcodec_a" = yes ; then
6228 _codecmodules="libavcodec $_codecmodules"
6229 elif test "$_libavcodec_so" = yes ; then
6230 _codecmodules="libavcodec.so $_codecmodules"
6231 else
6232 _nocodecmodules="libavcodec $_nocodecmodules"
6234 echores "$_libavcodec"
6236 echocheck "FFmpeg libavformat"
6237 if test "$_libavformat_a" = auto ; then
6238 _libavformat_a=no
6239 if test -d libavformat && test -f libavformat/utils.c ; then
6240 _libavformat_a=yes
6241 _res_comment="static"
6243 elif test "$_libavformat_so" = auto ; then
6244 _libavformat_so=no
6245 cat > $TMPC <<EOF
6246 #include <ffmpeg/avformat.h>
6247 #include <ffmpeg/opt.h>
6248 int main(void) { av_alloc_format_context(); return 0; }
6250 if $_pkg_config --exists libavformat ; then
6251 _inc_libavformat=`$_pkg_config --cflags libavformat`
6252 _ld_tmp=`$_pkg_config --libs libavformat`
6253 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6254 && _libavformat_so=yes
6255 elif cc_check $_ld_lm -lavformat ; then
6256 _ld_extra="$_ld_extra -lavformat"
6257 _libavformat_so=yes
6258 _res_comment="using libavformat.so, but static libavformat is recommended"
6261 _libavformat=no
6262 _def_libavformat='#undef USE_LIBAVFORMAT'
6263 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6264 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6265 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6266 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6267 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6268 test "$_libavformat_so" = yes \
6269 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6270 echores "$_libavformat"
6272 echocheck "FFmpeg libpostproc"
6273 if test "$_libpostproc_a" = auto ; then
6274 _libpostproc_a=no
6275 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6276 _libpostproc_a='yes'
6277 _res_comment="static"
6279 elif test "$_libpostproc_so" = auto ; then
6280 _libpostproc_so=no
6281 cat > $TMPC << EOF
6282 #define USE_LIBPOSTPROC 1
6283 #include <inttypes.h>
6284 #include <postproc/postprocess.h>
6285 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6287 if cc_check -lpostproc $_ld_lm ; then
6288 _ld_extra="$_ld_extra -lpostproc"
6289 _libpostproc_so=yes
6290 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6293 _libpostproc=no
6294 _def_libpostproc='#undef USE_LIBPOSTPROC'
6295 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6296 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6297 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6298 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6299 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6300 test "$_libpostproc_so" = yes \
6301 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6302 echores "$_libpostproc"
6305 echocheck "md5sum support"
6306 if test "$_md5sum" = yes; then
6307 _def_md5sum="#define HAVE_MD5SUM"
6308 _vosrc="$_vosrc vo_md5sum.c"
6309 _vomodules="md5sum $_vomodules"
6310 else
6311 _def_md5sum="#undef HAVE_MD5SUM"
6312 _novomodules="md5sum $_novomodules"
6314 echores "$_md5sum"
6316 echocheck "AMR narrowband"
6317 if test "$_amr_nb" = auto ; then
6318 _amr_nb=no
6319 cat > $TMPC << EOF
6320 #include <amrnb/interf_dec.h>
6321 int main(void) { Speech_Decode_Frame_init(); return 0; }
6323 cc_check -lamrnb && _amr_nb=yes
6324 if test "$_libavcodec_a" != yes ; then
6325 _amr_nb=no
6326 _res_comment="libavcodec (static) is required by amr_nb, sorry"
6329 if test "$_amr_nb" = yes ; then
6330 _amr=yes
6331 _ld_extra="$_ld_extra -lamrnb"
6332 _def_amr='#define CONFIG_AMR 1'
6333 _def_amr_nb='#define CONFIG_AMR_NB 1'
6334 else
6335 _def_amr_nb='#undef CONFIG_AMR_NB'
6337 echores "$_amr_nb"
6339 if test "$_amr_nb" = yes ; then
6340 _codecmodules="amr_nb $_codecmodules"
6341 else
6342 _nocodecmodules="amr_nb $_nocodecmodules"
6345 echocheck "AMR wideband"
6346 if test "$_amr_wb" = auto ; then
6347 _amr_wb=no
6348 cat > $TMPC << EOF
6349 #include <amrwb/dec_if.h>
6350 int main(void) { D_IF_init(); return 0; }
6352 cc_check -lamrwb && _amr_wb=yes
6353 if test "$_libavcodec_a" != yes ; then
6354 _amr_wb=no
6355 _res_comment="libavcodec (static) is required by amr_wb, sorry"
6358 if test "$_amr_wb" = yes ; then
6359 _amr=yes
6360 _ld_extra="$_ld_extra -lamrwb"
6361 _def_amr='#define CONFIG_AMR 1'
6362 _def_amr_wb='#define CONFIG_AMR_WB 1'
6363 _codecmodules="amr_wb $_codecmodules"
6364 else
6365 _def_amr_wb='#undef CONFIG_AMR_WB'
6366 _nocodecmodules="amr_wb $_nocodecmodules"
6368 echores "$_amr_wb"
6370 echocheck "libdv-0.9.5+"
6371 if test "$_libdv" = auto ; then
6372 _libdv=no
6373 cat > $TMPC <<EOF
6374 #include <libdv/dv.h>
6375 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6377 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6379 if test "$_libdv" = yes ; then
6380 _def_libdv='#define HAVE_LIBDV095 1'
6381 _ld_extra="$_ld_extra -ldv"
6382 _codecmodules="libdv $_codecmodules"
6383 else
6384 _def_libdv='#undef HAVE_LIBDV095'
6385 _nocodecmodules="libdv $_nocodecmodules"
6387 echores "$_libdv"
6389 echocheck "zr"
6390 if test "$_zr" = auto ; then
6391 #36067's seem to identify themselves as 36057PQC's, so the line
6392 #below should work for 36067's and 36057's.
6393 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6394 _zr=yes
6395 else
6396 _zr=no
6399 if test "$_zr" = yes ; then
6400 if test "$_libavcodec_a" = yes ; then
6401 _def_zr='#define HAVE_ZR 1'
6402 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6403 _vomodules="zr zr2 $_vomodules"
6404 else
6405 _res_comment="libavcodec (static) is required by zr, sorry"
6406 _novomodules="zr $_novomodules"
6407 _def_zr='#undef HAVE_ZR'
6409 else
6410 _def_zr='#undef HAVE_ZR'
6411 _novomodules="zr zr2 $_novomodules"
6413 echores "$_zr"
6415 echocheck "bl"
6416 if test "$_bl" = yes ; then
6417 _def_bl='#define HAVE_BL 1'
6418 _vosrc="$_vosrc vo_bl.c"
6419 _vomodules="bl $_vomodules"
6420 else
6421 _def_bl='#undef HAVE_BL'
6422 _novomodules="bl $_novomodules"
6424 echores "$_bl"
6427 echocheck "XviD"
6428 if test "$_xvid" = auto ; then
6429 _xvid=no
6430 cat > $TMPC << EOF
6431 #include <xvid.h>
6432 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6434 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6435 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6436 done
6439 if test "$_xvid" = yes ; then
6440 _def_xvid='#define HAVE_XVID4 1'
6441 _codecmodules="xvid $_codecmodules"
6442 else
6443 _def_xvid='#undef HAVE_XVID4'
6444 _nocodecmodules="xvid $_nocodecmodules"
6446 echores "$_xvid"
6448 if test "$_xvid" = yes ; then
6449 echocheck "XviD two pass plugin"
6450 cat > $TMPC << EOF
6451 #include <xvid.h>
6452 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6454 if cc_check ; then
6455 _lavc_xvid=yes
6456 _def_lavc_xvid='#define CONFIG_XVID 1'
6457 else
6458 _lavc_xvid=no
6459 _def_lavc_xvid='#undef CONFIG_XVID'
6461 echores "$_lavc_xvid"
6465 echocheck "x264"
6466 if test "$_x264" = auto ; then
6467 cat > $TMPC << EOF
6468 #include <inttypes.h>
6469 #include <x264.h>
6470 #if X264_BUILD < 53
6471 #error We do not support old versions of x264. Get the latest from SVN.
6472 #endif
6473 int main(void) { x264_encoder_open((void*)0); return 0; }
6475 _x264=no
6476 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6477 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6478 done
6481 if test "$_x264" = yes ; then
6482 _x264=yes
6483 _def_x264='#define HAVE_X264 1'
6484 _codecmodules="x264 $_codecmodules"
6485 if echo $_libavencoders | grep -q X264 ; then
6486 _lavc_x264=yes
6487 _def_lavc_x264='#define CONFIG_X264 1'
6488 _libs_mplayer="$_libs_mplayer $_ld_x264"
6489 else
6490 _lavc_x264=no
6491 _def_lavc_x264='#undef CONFIG_X264'
6493 else
6494 _x264=no
6495 _lavc_x264=no
6496 _def_x264='#undef HAVE_X264'
6497 _def_lavc_x264='#undef CONFIG_X264'
6498 _nocodecmodules="x264 $_nocodecmodules"
6500 echores "$_x264 (in libavcodec: $_lavc_x264)"
6503 echocheck "nut"
6504 if test "$_nut" = auto ; then
6505 cat > $TMPC << EOF
6506 #include <stdio.h>
6507 #include <stdlib.h>
6508 #include <inttypes.h>
6509 #include <libnut.h>
6510 int main(void) { (void)nut_error(0); return 0; }
6512 _nut=no
6513 cc_check -lnut && _nut=yes
6516 if test "$_nut" = yes ; then
6517 _def_nut='#define HAVE_LIBNUT 1'
6518 _ld_extra="$_ld_extra -lnut"
6519 else
6520 _def_nut='#undef HAVE_LIBNUT'
6522 echores "$_nut"
6525 # mencoder requires (optional) those libs: libmp3lame
6526 if test "$_mencoder" != no ; then
6528 echocheck "libmp3lame (for mencoder)"
6529 _mp3lame=no
6530 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6531 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6532 cat > $TMPC <<EOF
6533 #include <lame/lame.h>
6534 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; }
6536 # Note: libmp3lame usually depends on vorbis
6537 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6538 if test "$_mp3lame" = yes ; then
6539 _def_mp3lame="#define HAVE_MP3LAME"
6540 _ld_mp3lame=-lmp3lame
6541 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6542 cat > $TMPC << EOF
6543 #include <lame/lame.h>
6544 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6546 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6547 cat > $TMPC << EOF
6548 #include <lame/lame.h>
6549 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6551 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6552 if echo $_libavencoders | grep -q MP3LAME ; then
6553 _lavc_mp3lame=yes
6554 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6555 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6556 else
6557 _lavc_mp3lame=no
6558 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6560 else
6561 _def_mp3lame='#undef HAVE_MP3LAME'
6563 echores "$_mp3lame"
6567 echocheck "mencoder"
6568 _mencoder_flag='#undef HAVE_MENCODER'
6569 if test "$_mencoder" = yes ; then
6570 _mencoder_flag='#define HAVE_MENCODER'
6571 _def_muxers='#define CONFIG_MUXERS 1'
6572 else
6573 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6574 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6575 _libavmuxers=""
6577 echores "$_mencoder"
6579 echocheck "fastmemcpy"
6580 # fastmemcpy check is done earlier with tests of CPU & binutils features
6581 if test "$_fastmemcpy" = yes ; then
6582 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6583 else
6584 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6586 echores "$_fastmemcpy"
6588 echocheck "UniquE RAR File Library"
6589 if test "$_unrarlib" = yes ; then
6590 _def_unrarlib='#define USE_UNRARLIB 1'
6591 else
6592 _def_unrarlib='#undef USE_UNRARLIB'
6594 echores "$_unrarlib"
6596 echocheck "TV interface"
6597 if test "$_tv" = yes ; then
6598 _def_tv='#define USE_TV 1'
6599 _inputmodules="tv $_inputmodules"
6600 else
6601 _noinputmodules="tv $_noinputmodules"
6602 _def_tv='#undef USE_TV'
6604 echores "$_tv"
6607 if bsd; then
6608 echocheck "*BSD BT848 bt8xx header"
6609 _ioctl_bt848_h=no
6610 for file in "machine/ioctl_bt848.h" \
6611 "dev/bktr/ioctl_bt848.h" \
6612 "dev/video/bktr/ioctl_bt848.h" \
6613 "dev/ic/bt8xx.h" ; do
6614 cat > $TMPC <<EOF
6615 #include <sys/types.h>
6616 #include <$file>
6617 int main(void) {
6618 ioctl(0, TVTUNER_GETFREQ, 0);
6619 return 0;
6622 if cc_check ; then
6623 _ioctl_bt848_h=yes
6624 _ioctl_bt848_h_name="$file"
6625 break;
6627 done
6628 if test "$_ioctl_bt848_h" = yes ; then
6629 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6630 _res_comment="using $_ioctl_bt848_h_name"
6631 else
6632 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6634 echores "$_ioctl_bt848_h"
6636 echocheck "*BSD ioctl_meteor.h"
6637 _ioctl_meteor_h=no
6638 for file in "machine/ioctl_meteor.h" \
6639 "dev/bktr/ioctl_meteor.h" \
6640 "dev/video/bktr/ioctl_meteor.h" ; do
6641 cat > $TMPC <<EOF
6642 #include <sys/types.h>
6643 #include <$file>
6644 int main(void) {
6645 ioctl(0, METEORSINPUT, 0);
6646 return 0;
6649 if cc_check ; then
6650 _ioctl_meteor_h=yes
6651 _ioctl_meteor_h_name="$file"
6652 break;
6654 done
6655 if test "$_ioctl_meteor_h" = yes ; then
6656 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6657 _res_comment="using $_ioctl_meteor_h_name"
6658 else
6659 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6661 echores "$_ioctl_meteor_h"
6663 echocheck "*BSD BrookTree 848 TV interface"
6664 if test "$_tv_bsdbt848" = auto ; then
6665 _tv_bsdbt848=no
6666 if test "$_tv" = yes ; then
6667 cat > $TMPC <<EOF
6668 #include <sys/types.h>
6669 $_def_ioctl_meteor_h_name
6670 $_def_ioctl_bt848_h_name
6671 #ifdef IOCTL_METEOR_H_NAME
6672 #include IOCTL_METEOR_H_NAME
6673 #endif
6674 #ifdef IOCTL_BT848_H_NAME
6675 #include IOCTL_BT848_H_NAME
6676 #endif
6677 int main(void){
6678 ioctl(0, METEORSINPUT, 0);
6679 ioctl(0, TVTUNER_GETFREQ, 0);
6680 return 0;
6683 cc_check && _tv_bsdbt848=yes
6686 if test "$_tv_bsdbt848" = yes ; then
6687 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6688 _inputmodules="tv-bsdbt848 $_inputmodules"
6689 else
6690 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6691 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6693 echores "$_tv_bsdbt848"
6694 fi #if bsd
6697 echocheck "Video 4 Linux TV interface"
6698 if test "$_tv_v4l1" = auto ; then
6699 _tv_v4l1=no
6700 if test "$_tv" = yes && linux ; then
6701 cat > $TMPC <<EOF
6702 #include <stdlib.h>
6703 #include <linux/videodev.h>
6704 int main(void) { return 0; }
6706 cc_check && _tv_v4l1=yes
6709 if test "$_tv_v4l1" = yes ; then
6710 _audio_input=yes
6711 _tv_v4l=yes
6712 _def_tv_v4l='#define HAVE_TV_V4L 1'
6713 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6714 _inputmodules="tv-v4l $_inputmodules"
6715 else
6716 _noinputmodules="tv-v4l1 $_noinputmodules"
6717 _def_tv_v4l='#undef HAVE_TV_V4L'
6719 echores "$_tv_v4l1"
6722 echocheck "Video 4 Linux 2 TV interface"
6723 if test "$_tv_v4l2" = auto ; then
6724 _tv_v4l2=no
6725 if test "$_tv" = yes && linux ; then
6726 cat > $TMPC <<EOF
6727 #include <stdlib.h>
6728 #include <linux/types.h>
6729 #include <linux/videodev2.h>
6730 int main(void) { return 0; }
6732 cc_check && _tv_v4l2=yes
6735 if test "$_tv_v4l2" = yes ; then
6736 _audio_input=yes
6737 _tv_v4l=yes
6738 _def_tv_v4l='#define HAVE_TV_V4L 1'
6739 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6740 _inputmodules="tv-v4l2 $_inputmodules"
6741 else
6742 _noinputmodules="tv-v4l2 $_noinputmodules"
6743 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6745 echores "$_tv_v4l2"
6748 echocheck "Radio interface"
6749 if test "$_radio" = yes ; then
6750 _def_radio='#define USE_RADIO 1'
6751 _inputmodules="radio $_inputmodules"
6752 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6753 _radio_capture=no
6755 if test "$_radio_capture" = yes ; then
6756 _audio_input=yes
6757 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6758 else
6759 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6761 else
6762 _noinputmodules="radio $_noinputmodules"
6763 _def_radio='#undef USE_RADIO'
6764 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6765 _radio_capture=no
6767 echores "$_radio"
6768 echocheck "Capture for Radio interface"
6769 echores "$_radio_capture"
6771 echocheck "Video 4 Linux 2 Radio interface"
6772 if test "$_radio_v4l2" = auto ; then
6773 _radio_v4l2=no
6774 if test "$_radio" = yes && linux ; then
6775 cat > $TMPC <<EOF
6776 #include <stdlib.h>
6777 #include <linux/types.h>
6778 #include <linux/videodev2.h>
6779 int main(void) { return 0; }
6781 cc_check && _radio_v4l2=yes
6784 if test "$_radio_v4l2" = yes ; then
6785 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6786 else
6787 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6789 echores "$_radio_v4l2"
6791 echocheck "Video 4 Linux Radio interface"
6792 if test "$_radio_v4l" = auto ; then
6793 _radio_v4l=no
6794 if test "$_radio" = yes && linux ; then
6795 cat > $TMPC <<EOF
6796 #include <stdlib.h>
6797 #include <linux/videodev.h>
6798 int main(void) { return 0; }
6800 cc_check && _radio_v4l=yes
6803 if test "$_radio_v4l" = yes ; then
6804 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6805 else
6806 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6808 echores "$_radio_v4l"
6810 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6811 echocheck "*BSD BrookTree 848 Radio interface"
6812 _radio_bsdbt848=no
6813 cat > $TMPC <<EOF
6814 #include <sys/types.h>
6815 $_def_ioctl_bt848_h_name
6816 #ifdef IOCTL_BT848_H_NAME
6817 #include IOCTL_BT848_H_NAME
6818 #endif
6819 int main(void){
6820 ioctl(0, RADIO_GETFREQ, 0);
6821 return 0;
6824 cc_check && _radio_bsdbt848=yes
6825 echores "$_radio_bsdbt848"
6826 fi #if bsd && radio && radio_bsdbt848
6828 if test "$_radio_bsdbt848" = yes ; then
6829 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
6830 else
6831 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
6834 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6835 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6836 die "Radio driver requires BSD BT848, V4L or V4L2!"
6839 echocheck "Video 4 Linux 2 MPEG PVR interface"
6840 if test "$_pvr" = auto ; then
6841 _pvr=no
6842 if test "$_tv_v4l2" = yes && linux ; then
6843 cat > $TMPC <<EOF
6844 #include <stdlib.h>
6845 #include <inttypes.h>
6846 #include <linux/types.h>
6847 #include <linux/videodev2.h>
6848 int main(void) { struct v4l2_ext_controls ext; return 0; }
6850 cc_check && _pvr=yes
6853 if test "$_pvr" = yes ; then
6854 _def_pvr='#define HAVE_PVR 1'
6855 _inputmodules="pvr $_inputmodules"
6856 else
6857 _noinputmodules="pvr $_noinputmodules"
6858 _def_pvr='#undef HAVE_PVR'
6860 echores "$_pvr"
6863 echocheck "audio select()"
6864 if test "$_select" = no ; then
6865 _def_select='#undef HAVE_AUDIO_SELECT'
6866 elif test "$_select" = yes ; then
6867 _def_select='#define HAVE_AUDIO_SELECT 1'
6869 echores "$_select"
6872 echocheck "ftp"
6873 if not beos && test "$_ftp" = yes ; then
6874 _def_ftp='#define HAVE_FTP 1'
6875 _inputmodules="ftp $_inputmodules"
6876 else
6877 _noinputmodules="ftp $_noinputmodules"
6878 _def_ftp='#undef HAVE_FTP'
6880 echores "$_ftp"
6882 echocheck "vstream client"
6883 if test "$_vstream" = auto ; then
6884 _vstream=no
6885 cat > $TMPC <<EOF
6886 #include <vstream-client.h>
6887 void vstream_error(const char *format, ... ) {}
6888 int main(void) { vstream_start(); return 0; }
6890 cc_check -lvstream-client && _vstream=yes
6892 if test "$_vstream" = yes ; then
6893 _def_vstream='#define HAVE_VSTREAM 1'
6894 _inputmodules="vstream $_inputmodules"
6895 _ld_extra="$_ld_extra -lvstream-client"
6896 else
6897 _noinputmodules="vstream $_noinputmodules"
6898 _def_vstream='#undef HAVE_VSTREAM'
6900 echores "$_vstream"
6902 # endian testing
6903 echocheck "byte order"
6904 if test "$_big_endian" = auto ; then
6905 cat > $TMPC <<EOF
6906 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6907 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6908 int main(){
6909 return (int)ascii_name;
6912 if cc_check ; then
6913 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6914 _big_endian=yes
6915 else
6916 _big_endian=no
6918 else
6919 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
6922 if test "$_big_endian" = yes ; then
6923 _byte_order='big-endian'
6924 _def_words_endian='#define WORDS_BIGENDIAN 1'
6925 else
6926 _byte_order='little-endian'
6927 _def_words_endian='#undef WORDS_BIGENDIAN'
6929 echores "$_byte_order"
6931 echocheck "OSD menu"
6932 if test "$_menu" = yes ; then
6933 _def_menu='#define HAVE_MENU 1'
6934 else
6935 _def_menu='#undef HAVE_MENU'
6937 echores "$_menu"
6940 echocheck "QuickTime codecs"
6941 if test "$_qtx" = auto ; then
6942 test "$_win32dll" = yes || darwin && _qtx=yes
6944 if test "$_qtx" = yes ; then
6945 _def_qtx='#define USE_QTX_CODECS 1'
6946 _codecmodules="qtx $_codecmodules"
6947 else
6948 _def_qtx='#undef USE_QTX_CODECS'
6949 _nocodecmodules="qtx $_nocodecmodules"
6951 echores "$_qtx"
6954 echocheck "Subtitles sorting"
6955 if test "$_sortsub" = yes ; then
6956 _def_sortsub='#define USE_SORTSUB 1'
6957 else
6958 _def_sortsub='#undef USE_SORTSUB'
6960 echores "$_sortsub"
6963 echocheck "XMMS inputplugin support"
6964 if test "$_xmms" = yes ; then
6965 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6966 _xmmsplugindir=`xmms-config --input-plugin-dir`
6967 _xmmslibdir=`xmms-config --exec-prefix`/lib
6968 else
6969 _xmmsplugindir=/usr/lib/xmms/Input
6970 _xmmslibdir=/usr/lib
6973 _def_xmms='#define HAVE_XMMS 1'
6974 if darwin ; then
6975 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
6976 else
6977 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6979 else
6980 _def_xmms='#undef HAVE_XMMS'
6982 echores "$_xmms"
6984 echocheck "inet6"
6985 if test "$_inet6" = auto ; then
6986 cat > $TMPC << EOF
6987 #include <sys/types.h>
6988 #include <sys/socket.h>
6989 #include <netinet/in.h>
6990 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6992 _inet6=no
6993 if cc_check ; then
6994 _inet6=yes
6997 if test "$_inet6" = yes ; then
6998 _def_inet6='#define HAVE_AF_INET6 1'
6999 else
7000 _def_inet6='#undef HAVE_AF_INET6'
7002 echores "$_inet6"
7005 echocheck "gethostbyname2"
7006 if test "$_gethostbyname2" = auto ; then
7007 cat > $TMPC << EOF
7008 #include <sys/types.h>
7009 #include <sys/socket.h>
7010 #include <netdb.h>
7011 int main(void) { gethostbyname2("", AF_INET); }
7013 _gethostbyname2=no
7014 if cc_check ; then
7015 _gethostbyname2=yes
7019 if test "$_gethostbyname2" = yes ; then
7020 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7021 else
7022 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7024 echores "$_gethostbyname2"
7027 # --------------- GUI specific tests begin -------------------
7028 echocheck "GUI"
7029 echo "$_gui"
7030 if test "$_gui" = yes ; then
7032 # Required libraries
7033 test "$_png" != yes && die "The GUI requires PNG support, please install libpng and libpng-dev packages."
7034 if not win32 ; then
7035 test "$_x11" != yes && die "X11 support required for GUI compilation."
7037 echocheck "XShape extension"
7038 if test "$_xshape" = auto ; then
7039 _xshape=no
7040 cat > $TMPC << EOF
7041 #include <X11/Xlib.h>
7042 #include <X11/Xproto.h>
7043 #include <X11/Xutil.h>
7044 #include <X11/extensions/shape.h>
7045 #include <stdlib.h>
7046 int main(void) {
7047 char *name = ":0.0";
7048 Display *wsDisplay;
7049 int exitvar = 0;
7050 int eventbase, errorbase;
7051 if (getenv("DISPLAY"))
7052 name=getenv("DISPLAY");
7053 wsDisplay=XOpenDisplay(name);
7054 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7055 exitvar=1;
7056 XCloseDisplay(wsDisplay);
7057 return exitvar;
7060 cc_check && _xshape=yes
7062 if test "$_xshape" = yes ; then
7063 _def_xshape='#define HAVE_XSHAPE 1'
7064 else
7065 die "The GUI requires the X11 extension XShape (which was not found)."
7067 echores "$_xshape"
7069 #Check for GTK
7070 if test "$_gtk1" = no ; then
7071 #Check for GTK2 :
7072 echocheck "GTK+ version"
7074 if $_pkg_config gtk+-2.0 --exists ; then
7075 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7076 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7077 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7078 echores "$_gtk"
7080 # Check for GLIB2
7081 if $_pkg_config glib-2.0 --exists ; then
7082 echocheck "glib version"
7083 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7084 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7085 echores "$_glib"
7087 _def_gui='#define HAVE_NEW_GUI 1'
7088 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7089 else
7090 _gtk1=yes
7091 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7093 else
7094 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7095 _gtk1=yes
7099 if test "$_gtk1" = yes ; then
7100 # Check for old GTK (1.2.x)
7101 echocheck "GTK version"
7102 if test -z "$_gtkconfig" ; then
7103 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7104 _gtkconfig="gtk-config"
7105 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7106 _gtkconfig="gtk12-config"
7107 else
7108 die "The GUI requires GTK devel packages (which were not found)."
7111 _gtk=`$_gtkconfig --version 2>&1`
7112 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7113 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7114 echores "$_gtk (using $_gtkconfig)"
7116 # Check for GLIB
7117 echocheck "glib version"
7118 if test -z "$_glibconfig" ; then
7119 if ( glib-config --version ) >/dev/null 2>&1 ; then
7120 _glibconfig="glib-config"
7121 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7122 _glibconfig="glib12-config"
7123 else
7124 die "The GUI requires GLIB devel packages (which were not found)"
7127 _glib=`$_glibconfig --version 2>&1`
7128 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7129 echores "$_glib (using $_glibconfig)"
7131 _def_gui='#define HAVE_NEW_GUI 1'
7132 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7135 else #if not win32
7136 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7137 _def_gui='#define HAVE_NEW_GUI 1'
7138 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7139 fi #if not win32
7141 else #if test "$_gui"
7142 _def_gui='#undef HAVE_NEW_GUI'
7143 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7144 fi #if test "$_gui"
7145 # --------------- GUI specific tests end -------------------
7148 if test "$_charset" = "noconv" ; then
7149 _charset=""
7151 if test "$_charset" ; then
7152 _def_charset="#define MSG_CHARSET \"$_charset\""
7153 else
7154 _def_charset="#undef MSG_CHARSET"
7157 if test "$_charset" = "UTF-8" ; then
7158 # hack to disable conversion in the Makefile
7159 _charset=""
7162 if test "$_charset" ; then
7163 echocheck "iconv program"
7164 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7165 if test "$?" -ne 0 ; then
7166 echores "no"
7167 echo "No working iconv program found, use "
7168 echo "--charset=UTF-8 to continue anyway."
7169 echo "If you also have problems with iconv library functions use --charset=noconv."
7170 echo "Messages in the GTK-2 interface will be broken then."
7171 exit 1
7172 else
7173 echores "yes"
7177 #############################################################################
7179 echocheck "automatic gdb attach"
7180 if test "$_crash_debug" = yes ; then
7181 _def_crash_debug='#define CRASH_DEBUG 1'
7182 else
7183 _def_crash_debug='#undef CRASH_DEBUG'
7184 _crash_debug=no
7186 echores "$_crash_debug"
7188 echocheck "compiler support for noexecstack"
7189 cat > $TMPC <<EOF
7190 int main(void) { return 0; }
7192 if cc_check -Wl,-z,noexecstack ; then
7193 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7194 echores "yes"
7195 else
7196 echores "no"
7199 echocheck "ftello()"
7200 # if we don't have ftello use the osdep/ compatibility module
7201 cat > $TMPC << EOF
7202 #include <stdio.h>
7203 #include <sys/types.h>
7204 int main (void) { ftello(stdin); return 0; }
7206 _ftello=no
7207 cc_check && _ftello=yes
7208 if test "$_ftello" = yes ; then
7209 _def_ftello='#define HAVE_FTELLO 1'
7210 _need_ftello=no
7211 else
7212 _def_ftello='#undef HAVE_FTELLO'
7213 _need_ftello=yes
7215 echores "$_ftello"
7217 # Dynamic linking flags
7218 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7219 _ld_dl_dynamic=''
7220 bsd && _ld_dl_dynamic='-rdynamic'
7221 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7222 _ld_dl_dynamic='-rdynamic'
7225 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7226 bsdos && _ld_extra="$_ld_extra -ldvd"
7227 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7228 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7230 _def_debug='#undef MP_DEBUG'
7231 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7233 _def_linux='#undef TARGET_LINUX'
7234 linux && _def_linux='#define TARGET_LINUX 1'
7236 # TODO cleanup the VIDIX stuff here
7237 echocheck "VIDIX (internal)"
7238 echores "$_vidix_internal"
7240 echocheck "VIDIX (external)"
7241 if test "$_vidix_external" = auto; then
7242 _vidix_external=no
7243 cat > $TMPC <<EOF
7244 #include <vidix/vidix.h>
7245 int main(void) { return 0; }
7247 cc_check -lvidix && _vidix_external=yes
7249 echores "$_vidix_external"
7251 if test "$_vidix_internal" = yes || test "$_vidix_external" = yes ; then
7252 _vidix=yes
7253 _def_vidix='#define CONFIG_VIDIX 1'
7254 else
7255 _vidix=no
7256 _def_vidix='#undef CONFIG_VIDIX'
7259 if test "$_vidix" = yes ; then
7260 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e cyberblade`; then
7261 _def_vidix_drv_cyberblade='#define CONFIG_VIDIX_DRV_CYBERBLADE 1'
7262 _vidix_drv_cyberblade=yes
7263 else
7264 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
7265 _vidix_drv_cyberblade=no
7267 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e mach64`; then
7268 _def_vidix_drv_mach64='#define CONFIG_VIDIX_DRV_MACH64 1'
7269 _vidix_drv_mach64=yes
7270 else
7271 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
7272 _vidix_drv_mach64=no
7274 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e mga`; then
7275 _def_vidix_drv_mga='#define CONFIG_VIDIX_DRV_MGA 1'
7276 _vidix_drv_mga=yes
7277 else
7278 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
7279 _vidix_drv_mga=no
7281 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e mga_crtc2`; then
7282 _def_vidix_drv_mga_crtc2='#define CONFIG_VIDIX_DRV_MGA_CRTC2 1'
7283 _vidix_drv_mga_crtc2=yes
7284 else
7285 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
7286 _vidix_drv_mga_crtc2=no
7288 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e nvidia`; then
7289 _def_vidix_drv_nvidia='#define CONFIG_VIDIX_DRV_NVIDIA 1'
7290 _vidix_drv_nvidia=yes
7291 else
7292 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
7293 _vidix_drv_nvidia=no
7295 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e pm2`; then
7296 _def_vidix_drv_pm2='#define CONFIG_VIDIX_DRV_PM2 1'
7297 _vidix_drv_pm2=yes
7298 else
7299 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
7300 _vidix_drv_pm2=no
7302 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e pm3`; then
7303 _def_vidix_drv_pm3='#define CONFIG_VIDIX_DRV_PM3 1'
7304 _vidix_drv_pm3=yes
7305 else
7306 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
7307 _vidix_drv_pm3=no
7309 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e radeon`; then
7310 _def_vidix_drv_radeon='#define CONFIG_VIDIX_DRV_RADEON 1'
7311 _vidix_drv_radeon=yes
7312 else
7313 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
7314 _vidix_drv_radeon=no
7316 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e rage128`; then
7317 _def_vidix_drv_rage128='#define CONFIG_VIDIX_DRV_RAGE128 1'
7318 _vidix_drv_rage128=yes
7319 else
7320 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
7321 _vidix_drv_rage128=no
7323 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e savage`; then
7324 _def_vidix_drv_savage='#define CONFIG_VIDIX_DRV_SAVAGE 1'
7325 _vidix_drv_savage=yes
7326 else
7327 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
7328 _vidix_drv_savage=no
7330 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e sis`; then
7331 _def_vidix_drv_sis='#define CONFIG_VIDIX_DRV_SIS 1'
7332 _vidix_drv_sis=yes
7333 else
7334 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
7335 _vidix_drv_sis=no
7337 if test "$_vidix_drivers" = all || test `echo "$_vidix_drivers" | grep -e unichrome`; then
7338 _def_vidix_drv_unichrome='#define CONFIG_VIDIX_DRV_UNICHROME 1'
7339 _vidix_drv_unichrome=yes
7340 else
7341 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
7342 _vidix_drv_unichrome=no
7346 if test "$_vidix_internal" = yes ; then
7347 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
7348 elif test "$_vidix_external" = yes ; then
7349 _libs_mplayer="$_libs_mplayer -lvidix"
7350 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
7353 if test "$_vidix" = yes; then
7354 _vosrc="$_vosrc vo_cvidix.c"
7355 _vomodules="cvidix $_vomodules"
7356 else
7357 _novomodules="cvidix $_novomodules"
7359 if test "$_vidix" = yes && win32; then
7360 _vosrc="$_vosrc vo_winvidix.c"
7361 _vomodules="winvidix $_vomodules"
7362 _libs_mplayer="$_libs_mplayer -lgdi32"
7363 else
7364 _novomodules="winvidix $_novomodules"
7366 if test "$_vidix" = yes && test "$_x11" = yes; then
7367 _vosrc="$_vosrc vo_xvidix.c"
7368 _vomodules="xvidix $_vomodules"
7369 else
7370 _novomodules="xvidix $_novomodules"
7373 echocheck "joystick"
7374 _def_joystick='#undef HAVE_JOYSTICK'
7375 if test "$_joystick" = yes ; then
7376 if linux ; then
7377 # TODO add some check
7378 _def_joystick='#define HAVE_JOYSTICK 1'
7379 else
7380 _joystick="no (unsupported under $system_name)"
7383 echores "$_joystick"
7385 echocheck "lirc"
7386 if test "$_lirc" = auto ; then
7387 _lirc=no
7388 cat > $TMPC <<EOF
7389 #include <lirc/lirc_client.h>
7390 int main(void) { return 0; }
7392 cc_check -llirc_client && _lirc=yes
7394 if test "$_lirc" = yes ; then
7395 _def_lirc='#define HAVE_LIRC 1'
7396 _ld_extra="$_ld_extra -llirc_client"
7397 else
7398 _def_lirc='#undef HAVE_LIRC'
7400 echores "$_lirc"
7402 echocheck "lircc"
7403 if test "$_lircc" = auto ; then
7404 _lircc=no
7405 cat > $TMPC <<EOF
7406 #include <lirc/lircc.h>
7407 int main(void) { return 0; }
7409 cc_check -llircc && _lircc=yes
7411 if test "$_lircc" = yes ; then
7412 _def_lircc='#define HAVE_LIRCC 1'
7413 _ld_extra="$_ld_extra -llircc"
7414 else
7415 _def_lircc='#undef HAVE_LIRCC'
7417 echores "$_lircc"
7419 if arm; then
7420 # Detect maemo development platform libraries availability (http://www.maemo.org),
7421 # they are used when run on Nokia 770
7422 echocheck "maemo (Nokia 770)"
7423 if test "$_maemo" = auto ; then
7424 _maemo=no
7425 cat > $TMPC << EOF
7426 #include <libosso.h>
7427 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7429 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7431 if test "$_maemo" = yes ; then
7432 _def_maemo='#define HAVE_MAEMO 1'
7433 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7434 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7435 else
7436 _def_maemo='#undef HAVE_MAEMO'
7438 echores "$_maemo"
7441 echocheck "color console output"
7442 if test "$_color_console" = yes ; then
7443 _def_color_console='#define MSG_USE_COLORS 1'
7444 else
7445 _def_color_console='#undef MSG_USE_COLORS'
7447 echores "$_color_console"
7449 # linker paths should be the same for mencoder and mplayer
7450 _ld_tmp=""
7451 for I in $_libs_mplayer ; do
7452 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7453 if test -z "$_tmp" ; then
7454 _ld_extra="$I $_ld_extra"
7455 else
7456 _ld_tmp="$_ld_tmp $I"
7458 done
7459 _libs_mplayer=$_ld_tmp
7462 #############################################################################
7463 if darwin ; then
7464 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN -shared-libgcc"
7465 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7466 CFLAGS="$CFLAGS -no-cpp-precomp"
7469 if amigaos ; then
7470 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__ -DSYS_AMIGAOS4"
7472 if hpux ; then
7473 # use flag for HPUX missing setenv()
7474 CFLAGS="$CFLAGS -DHPUX"
7476 # Thread support
7477 if linux ; then
7478 CFLAGS="$CFLAGS -D_REENTRANT"
7479 elif bsd ; then
7480 # FIXME bsd needs this so maybe other OS'es
7481 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7483 if cygwin ; then
7484 CFLAGS="$CFLAGS -D__CYGWIN__ -DSYS_CYGWIN"
7486 # 64 bit file offsets?
7487 if test "$_largefiles" = yes || freebsd ; then
7488 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7489 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7490 # dvdread support requires this (for off64_t)
7491 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7495 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7496 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7498 cat > $TMPC << EOF
7499 int main() { return 0; }
7501 if cc_check -Wdeclaration-after-statement ; then
7502 CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7505 #############################################################################
7506 # Take care of ffmpeg dependencies
7507 if test "$_zlib" = no ; then
7508 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
7509 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
7511 if test "$_amr_nb" = no ; then
7512 _libavdecoders=`echo $_libavdecoders | sed -e s/AMR_NB_DECODER// `
7513 _libavencoders=`echo $_libavencoders | sed -e s/AMR_NB_ENCODER// `
7515 if test "$_amr_wb" = no ; then
7516 _libavdecoders=`echo $_libavdecoders | sed -e s/AMR_WB_DECODER// `
7517 _libavencoders=`echo $_libavencoders | sed -e s/AMR_WB_ENCODER// `
7519 if test "$_libdts" = no ; then
7520 _libavdecoders=`echo $_libavdecoders | sed -e s/DTS_DECODER// `
7522 if test "$_xvmc" = no ; then
7523 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
7525 if test "$_x264" = no || test "$_lavc_x264" = no ; then
7526 _libavencoders=`echo $_libavencoders | sed -e s/X264_ENCODER// `
7528 if test "$_xvid" = no || test "$_lavc_xvid" = no ; then
7529 _libavencoders=`echo $_libavencoders | sed -e s/XVID_ENCODER// `
7531 if test "$_faac" = no || test "$_lavc_faac" = no ; then
7532 _libavencoders=`echo $_libavencoders | sed -e s/FAAC_ENCODER// `
7534 if test "$_mp3lame" = no || test "$_lavc_mp3lame" = no ; then
7535 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
7537 if test "$_libvorbis" = no ; then
7538 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
7539 _libavmuxers=`echo $_libavmuxers | sed -e s/OGG_MUXER// `
7541 if test "$_nut" = no ; then
7542 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
7545 #############################################################################
7546 echo "Creating config.mak"
7547 cat > config.mak << EOF
7548 # -------- Generated by configure -----------
7550 LANG = C
7551 MAN_LANG = $MAN_LANG
7552 TARGET_OS = $system_name
7553 DESTDIR =
7554 prefix = \$(DESTDIR)$_prefix
7555 BINDIR = \$(DESTDIR)$_bindir
7556 DATADIR = \$(DESTDIR)$_datadir
7557 MANDIR = \$(DESTDIR)$_mandir
7558 CONFDIR = \$(DESTDIR)$_confdir
7559 LIBDIR = \$(DESTDIR)$_libdir
7560 # FFmpeg uses libdir instead of LIBDIR
7561 libdir = \$(LIBDIR)
7562 #AR = ar
7563 CC = $_cc
7564 HOST_CC = $_host_cc
7565 AWK = $_awk
7566 RANLIB = $_ranlib
7567 LDCONFIG = $_ldconfig
7568 INSTALL = $_install
7569 EXTRA_INC = $_inc_extra
7570 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7571 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7572 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7573 INSTALLSTRIP = $_install_strip
7574 CHARSET = $_charset
7575 HELP_FILE = $_mp_help
7577 EXESUF = $_exesuf
7579 MPLAYER_NETWORK = $_network
7580 FTP = $_ftp
7581 STREAMING_LIVE555 = $_live
7582 VSTREAM = $_vstream
7583 STREAM_CACHE = $_stream_cache
7584 DVBIN = $_dvbin
7585 VIDIX = $_vidix
7586 VIDIX_INTERNAL = $_vidix_internal
7587 VIDIX_EXTERNAL = $_vidix_external
7588 CONFIG_PP = yes
7589 MP3LAME = $_mp3lame
7590 LIBMENU = $_menu
7592 MP3LIB = $_mp3lib
7593 LIBA52 = $_liba52
7594 LIBMPEG2 = $_libmpeg2
7595 TREMOR_INTERNAL = $_tremor_internal
7596 TREMOR_LOW = $_tremor_low
7597 FAAD = $_faad
7599 SPEEX = $_speex
7600 MUSEPACK = $_musepack
7602 UNRARLIB = $_unrarlib
7603 PNG = $_png
7604 JPEG = $_jpeg
7605 GIF = $_gif
7607 EXTRALIBS = $_extra_libs
7608 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7609 EXTRALIBS_MPLAYER = $_libs_mplayer
7610 EXTRALIBS_MENCODER = $_libs_mencoder
7612 HAVE_MLIB = $_mlib
7613 HAVE_PTHREADS = $_pthreads
7615 HAVE_XVMC_ACCEL = $_xvmc
7617 HAVE_SYS_MMAN_H = $_mman
7618 HAVE_POSIX_SELECT = $_posix_select
7620 NEED_FSEEKO = $_need_fseeko
7621 NEED_FTELLO = $_need_ftello
7622 NEED_GETTIMEOFDAY = $_need_gettimeofday
7623 NEED_GLOB = $_need_glob
7624 NEED_SCANDIR = $_need_scandir
7625 NEED_SETENV = $_need_setenv
7626 NEED_SHMEM = $_need_shmem
7627 NEED_STRLCAT = $_need_strlcat
7628 NEED_STRLCPY = $_need_strlcpy
7629 NEED_STRSEP = $_need_strsep
7630 NEED_SWAB = $_need_swab
7631 NEED_VSSCANF = $_need_vsscanf
7633 # for FFmpeg
7634 SRC_PATH=..
7635 BUILD_ROOT=..
7636 LIBPREF=lib
7637 LIBSUF=.a
7638 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7640 # audio output
7641 OSS = $_ossaudio
7642 ALSA = $_alsa
7643 ALSA5 = $_alsa5
7644 ALSA9 = $_alsa9
7645 ALSA1X = $_alsa1x
7647 # input/demuxer/codecs
7648 JOYSTICK = $_joystick
7649 LIRC = $_lirc
7650 TV = $_tv
7651 TV_V4L = $_tv_v4l
7652 TV_V4L1 = $_tv_v4l1
7653 TV_V4L2 = $_tv_v4l2
7654 TV_BSDBT848 = $_tv_bsdbt848
7655 AUDIO_INPUT = $_audio_input
7656 PVR = $_pvr
7657 VCD = $_vcd
7658 DVDREAD = $_dvdread
7659 DVDREAD_INTERNAL = $_dvdread_internal
7660 DVDCSS_INTERNAL = $_libdvdcss_internal
7661 DVDNAV = $_dvdnav
7662 WIN32DLL = $_win32dll
7663 QTX_CODECS = $_qtx
7664 REAL_CODECS = $_real
7665 XANIM_CODECS = $_xanim
7666 LIBAVUTIL = $_libavutil
7667 LIBAVUTIL_A = $_libavutil_a
7668 LIBAVUTIL_SO = $_libavutil_so
7669 LIBAVCODEC = $_libavcodec
7670 LIBAVCODEC_A = $_libavcodec_a
7671 LIBAVCODEC_SO = $_libavcodec_so
7672 LIBAVFORMAT = $_libavformat
7673 LIBAVFORMAT_A = $_libavformat_a
7674 LIBAVFORMAT_SO = $_libavformat_so
7675 LIBPOSTPROC = $_libpostproc
7676 LIBPOSTPROC_A = $_libpostproc_a
7677 LIBPOSTPROC_SO = $_libpostproc_so
7678 ZORAN = $_zr
7679 LIBLZO = $_liblzo
7680 LIBDV = $_libdv
7681 XVID4 = $_xvid
7682 X264 = $_x264
7683 LIBNUT = $_nut
7684 CONFIG_LIBDTS = $_libdts
7685 MPLAYER = $_mplayer
7686 MENCODER = $_mencoder
7687 CDDA = $_cdda
7688 CDDB = $_cddb
7689 BITMAP_FONT = $_bitmap_font
7690 FREETYPE = $_freetype
7691 ASS = $_ass
7692 LIBMAD = $_mad
7693 LIBVORBIS = $_vorbis
7694 LIBTHEORA = $_theora
7695 FAAD_INTERNAL = $_faad_internal
7696 FAAD_FIXED = $_faad_fixed
7697 LIBSMBCLIENT = $_smbsupport
7698 XMMS_PLUGINS = $_xmms
7699 MACOSX = $_macosx
7700 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7701 MACOSX_BUNDLE = $_macosx_bundle
7702 MACOSX_COREVIDEO = $_macosx_corevideo
7703 TOOLAME=$_toolame
7704 TWOLAME=$_twolame
7705 FAAC=$_faac
7706 CONFIG_AMR=$_amr
7707 CONFIG_AMR_NB=$_amr_nb
7708 CONFIG_AMR_WB=$_amr_wb
7709 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7710 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7711 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7712 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7713 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7714 CONFIG_LIBFAAC=$_lavc_faac
7715 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7716 CONFIG_XVID=$_lavc_xvid
7717 CONFIG_X264=$_lavc_x264
7718 CONFIG_ZLIB=$_zlib
7719 CONFIG_GPL=yes
7720 CONFIG_ENCODERS=$_mencoder
7721 CONFIG_MUXERS=$_mencoder
7722 RADIO=$_radio
7723 RADIO_CAPTURE=$_radio_capture
7724 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7725 VIDIX_MACH64=$_vidix_drv_mach64
7726 VIDIX_MGA=$_vidix_drv_mga
7727 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7728 VIDIX_NVIDIA=$_vidix_drv_nvidia
7729 VIDIX_PM2=$_vidix_drv_pm2
7730 VIDIX_PM3=$_vidix_drv_pm3
7731 VIDIX_RADEON=$_vidix_drv_radeon
7732 VIDIX_RAGE128=$_vidix_drv_rage128
7733 VIDIX_SAVAGE=$_vidix_drv_savage
7734 VIDIX_SIS=$_vidix_drv_sis
7735 VIDIX_UNICHROME=$_vidix_drv_unichrome
7737 # --- Some stuff for autoconfigure ----
7738 $_target_arch
7739 $_target_arch_x86
7740 $_confwin32
7741 TARGET_CPU=$iproc
7742 TARGET_MMX = $_mmx
7743 TARGET_MMX2 = $_mmxext
7744 TARGET_3DNOW = $_3dnow
7745 TARGET_3DNOWEX = $_3dnowext
7746 TARGET_SSE = $_sse
7747 TARGET_CMOV = $_cmov
7748 TARGET_ALTIVEC = $_altivec
7749 TARGET_ARMV5TE = $_armv5te
7750 TARGET_IWMMXT = $_iwmmxt
7751 TARGET_VIS = $_vis
7752 TARGET_BUILTIN_VECTOR = $_builtin_vector
7753 TARGET_BUILTIN_3DNOW = $_mm3dnow
7755 # --- GUI stuff ---
7756 GUI = $_gui
7758 # --- libvo stuff ---
7759 VO_SRCS = $_vosrc
7761 # --- libao2 stuff ---
7762 AO_SRCS = $_aosrc
7764 # --- libaf stuff ---
7765 AF_SRCS = $_afsrc
7769 #############################################################################
7771 ff_config_enable () {
7772 for part in $1; do
7773 if ` echo $2 | grep $part > /dev/null `; then
7774 echo "#define CONFIG_$part 1"
7775 echo "#define ENABLE_$part 1"
7776 else
7777 echo "#define ENABLE_$part 0"
7779 done
7782 echo "Creating config.h"
7783 cat > config.h << EOF
7784 /* -------- This file has been automatically generated by configure ---------
7785 Note: Any changes in it will be lost when you run configure again. */
7787 /* Protect against multiple inclusion */
7788 #ifndef MPLAYER_CONFIG_H
7789 #define MPLAYER_CONFIG_H 1
7791 #define CONFIGURATION "$_configuration"
7793 /* make sure we never get lavformat's poll() emulation, the results are
7794 horrible if the X libs try to actually use it, see MPlayer-users
7795 Message-ID: <45D49541.8060101@infernix.net>
7796 Date: Thu, 15 Feb 2007 18:15:45 +0100
7797 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7799 #define HAVE_SYS_POLL_H 1
7801 /* use GNU internationalization */
7802 $_def_i18n
7804 /* name of messages charset */
7805 $_def_charset
7807 /* Runtime CPU detection */
7808 $_def_runtime_cpudetection
7810 /* Dynamic a/v plugins */
7811 $_def_dynamic_plugins
7813 /* "restrict" keyword */
7814 $_def_restrict_keyword
7816 /* __builtin_expect branch prediction hint */
7817 $_def_builtin_expect
7818 #ifdef HAVE_BUILTIN_EXPECT
7819 #define likely(x) __builtin_expect ((x) != 0, 1)
7820 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7821 #else
7822 #define likely(x) (x)
7823 #define unlikely(x) (x)
7824 #endif
7826 /* attribute(used) as needed by some compilers */
7827 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7828 # define attribute_used __attribute__((used))
7829 #else
7830 # define attribute_used
7831 #endif
7833 /* compiler support for named assembler arguments */
7834 $_def_named_asm_args
7836 #define PREFIX "$_prefix"
7838 /* enable/disable SIGHANDLER */
7839 $_def_sighandler
7841 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7842 $_def_crash_debug
7844 /* Toggles debugging informations */
7845 $_def_debug
7847 /* Toggles color console output */
7848 $_def_color_console
7850 /* Indicates that libcdio is available for VCD and CD-DA playback */
7851 $_def_libcdio
7853 /* Indicates that Ogle's libdvdread is available for DVD playback */
7854 $_def_dvdread
7856 /* Indicates that dvdread is internal */
7857 $_def_dvdread_internal
7859 /* Additional options for libdvdread/libdvdcss */
7860 $_def_dvd
7861 $_def_cdrom
7862 $_def_cdio
7863 $_def_dvdio
7864 $_def_bsdi_dvd
7865 $_def_dvd_bsd
7866 $_def_dvd_linux
7867 $_dev_dvd_openbsd
7868 $_def_dvd_darwin
7869 $_def_sol_scsi_h
7870 $_def_hpux_scsi_h
7871 $_def_stddef
7873 /* Common data directory (for fonts, etc) */
7874 #define MPLAYER_DATADIR "$_datadir"
7875 #define MPLAYER_CONFDIR "$_confdir"
7876 #define MPLAYER_LIBDIR "$_libdir"
7878 /* Define this to compile stream-caching support, it can be enabled via
7879 -cache <kilobytes> */
7880 $_def_stream_cache
7882 /* Define if you are using XviD library */
7883 $_def_xvid
7885 /* Define if you are using the X.264 library */
7886 $_def_x264
7888 /* Define if you are using libnut */
7889 $_def_nut
7891 /* Define to include support for libdv-0.9.5 */
7892 $_def_libdv
7894 /* If build mencoder */
7895 $_mencoder_flag
7897 /* Indicates if libmp3lame is available
7898 Note: for mencoder */
7899 $_def_mp3lame
7900 $_def_mp3lame_preset
7901 $_def_mp3lame_preset_medium
7903 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7904 (use -bps or -nobps commandline option for run-time method selection)
7905 -bps gives better sync for vbr mp3 audio, it is now default */
7906 #define AVI_SYNC_BPS 1
7908 /* Undefine this if you do not want to select mono audio (left or right)
7909 with a stereo MPEG layer 2/3 audio stream. The command line option
7910 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7911 right-only), with 0 being the default.
7913 #define USE_FAKE_MONO 1
7915 /* Undefine this if your sound card driver has no working select().
7916 If you have kernel Oops, player hangups, or just no audio, you should
7917 try to recompile MPlayer with this option disabled! */
7918 $_def_select
7920 /* define this to use iconv(3) function to codepage conversions */
7921 $_def_iconv
7923 /* define this to use nl_langinfo function */
7924 $_def_langinfo
7926 /* define this to use RTC (/dev/rtc) for video timers */
7927 $_def_rtc
7929 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7930 #define MAX_OUTBURST 65536
7932 /* set up audio OUTBURST. Do not change this! */
7933 #define OUTBURST 512
7935 /* Define this if your system has the header file for the OSS sound interface */
7936 $_def_sys_soundcard
7938 /* Define this if your system has the header file for the OSS sound interface
7939 * in /usr/include */
7940 $_def_soundcard
7942 /* Define this if your system has the sysinfo header */
7943 $_def_sys_sysinfo
7945 /* Define this if your system has ftello() */
7947 $_def_ftello
7948 #ifndef HAVE_FTELLO
7949 /* Need these for FILE and off_t an config.h is usually before other includes*/
7950 #include <stdio.h>
7951 #include <sys/types.h>
7952 off_t ftello(FILE *);
7953 #endif
7955 /* Define this if your system has the "malloc.h" header file */
7956 $_def_malloc
7958 /* memalign is mapped to malloc if unsupported */
7959 $_def_memalign
7960 $_def_map_memalign
7961 $_def_memalign_hack
7963 /* assembler handling of .align */
7964 $_def_asmalign_pot
7966 /* Define this if your system has the "alloca.h" header file */
7967 $_def_alloca
7969 /* Define this if your system has the "sys/mman.h" header file */
7970 $_def_mman
7971 $_def_mman_has_map_failed
7973 /* Define this if you have the elf dynamic linker -ldl library */
7974 $_def_dl
7976 /* Define this if you have the kstat kernel statistics library */
7977 $_def_kstat
7979 /* Define this if you have zlib */
7980 $_def_zlib
7981 #ifdef HAVE_ZLIB
7982 #define CONFIG_ZLIB 1
7983 #endif
7985 /* Define this if you have shm support */
7986 $_def_shm
7988 /* Define this if your system has scandir & alphasort */
7989 $_def_scandir
7991 /* Define this if your system has strsep */
7992 $_def_strsep
7994 /* Define this if your system has strlcpy */
7995 $_def_strlcpy
7996 #ifndef HAVE_STRLCPY
7997 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7998 #endif
8000 /* Define this if your system has strlcat */
8001 $_def_strlcat
8002 #ifndef HAVE_STRLCAT
8003 unsigned int strlcat (char *dest, const char *src, unsigned int size);
8004 #endif
8006 /* Define this if your system has fseeko */
8007 $_def_fseeko
8008 #ifndef HAVE_FSEEKO
8009 /* Need these for FILE and off_t an config.h is usually before other includes*/
8010 #include <stdio.h>
8011 #include <sys/types.h>
8012 int fseeko(FILE *, off_t, int);
8013 #endif
8015 $_def_localtime_r
8017 /* Define this if your system has vsscanf */
8018 $_def_vsscanf
8020 /* Define this if your system has swab */
8021 $_def_swab
8023 /* Define this if your system has posix select */
8024 $_def_posix_select
8026 /* Define this if your system has gettimeofday */
8027 $_def_gettimeofday
8029 /* Define this if your system has glob */
8030 $_def_glob
8032 /* Define this if your system has setenv */
8033 $_def_setenv
8034 #ifndef HAVE_SETENV
8035 int setenv(const char *name, const char *val, int overwrite);
8036 #endif
8038 /* Define this if your system has sysi86 */
8039 $_def_sysi86
8040 $_def_sysi86_iv
8042 /* Define this if your system has pthreads */
8043 $_def_pthreads
8045 /* Define this if you enabled thread support for libavcodec */
8046 $_def_threads
8048 /* LIRC (remote control, see www.lirc.org) support: */
8049 $_def_lirc
8051 /* Support for maemo (http://www.maemo.org) */
8052 $_def_maemo
8055 * LIRCCD (LIRC client daemon)
8056 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8058 $_def_lircc
8060 /* DVD navigation support using libdvdnav */
8061 $_def_dvdnav
8062 $_def_dvdnav_version
8064 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8065 #define MPEG12_POSTPROC 1
8067 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8068 $_def_libpostproc
8069 $_def_libpostproc_a
8070 $_def_libpostproc_so
8072 /* Win32 DLL support */
8073 $_def_win32dll
8074 #define WIN32_PATH "$_win32codecsdir"
8076 /* Mac OS X specific features */
8077 $_def_macosx
8078 $_def_macosx_finder_support
8079 $_def_macosx_bundle
8080 $_def_macosx_corevideo
8082 /* Build our Win32-loader */
8083 $_def_win32_loader
8085 /* ffmpeg's libavcodec support (requires libavcodec source) */
8086 $_def_libavcodec
8087 $_def_libavcodec_a
8088 $_def_libavcodec_so
8089 $_def_libavcodec_mpegaudio_hp
8091 /* ffmpeg's libavformat support (requires libavformat source) */
8092 $_def_libavformat
8093 $_def_libavformat_a
8094 $_def_libavformat_so
8096 $_def_libavutil
8097 $_def_libavutil_a
8098 $_def_libavutil_so
8100 /* Use libavcodec's decoders */
8101 #define CONFIG_DECODERS 1
8102 /* Use libavcodec's encoders */
8103 #define CONFIG_ENCODERS 1
8105 /* Use libavformat's demuxers */
8106 #define CONFIG_DEMUXERS 1
8107 /* Use libavformat's muxers */
8108 $_def_muxers
8110 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8111 #define HAVE_EBX_AVAILABLE 1
8112 #define HAVE_EBP_AVAILABLE 1
8114 #define CONFIG_GPL 1
8116 /* Use AMR codecs from libavcodec. */
8117 $_def_amr
8118 $_def_amr_nb
8119 $_def_amr_wb
8121 /* Use specific parts from FFmpeg. */
8122 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8123 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8124 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8125 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8126 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8127 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8129 $_def_lavc_faac
8130 $_def_lavc_xvid
8131 $_def_lavc_mp3lame
8132 $_def_lavc_x264
8134 /* Use codec libs included in mplayer CVS / source dist: */
8135 $_def_mp3lib
8136 $_def_liba52
8137 $_def_libdts
8138 $_def_libmpeg2
8140 /* XAnim DLL support */
8141 $_def_xanim
8142 /* Default search path */
8143 $_def_xanim_path
8145 /* RealPlayer DLL support */
8146 $_def_real
8147 /* Default search path */
8148 $_def_real_path
8150 /* LIVE555 Streaming Media library support */
8151 $_def_live
8153 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8154 $_def_fastmemcpy
8156 /* Use unrarlib for Vobsubs */
8157 $_def_unrarlib
8159 /* gui support, please do not edit this option */
8160 $_def_gui
8161 $_def_gtk2_gui
8163 /* Audio output drivers */
8164 $_def_ossaudio
8165 $_def_ossaudio_devdsp
8166 $_def_ossaudio_devmixer
8167 $_def_alsa5
8168 $_def_alsa9
8169 $_def_alsa1x
8170 $_def_arts
8171 $_def_esd
8172 $_def_esd_latency
8173 $_def_polyp
8174 $_def_jack
8175 $_def_openal
8176 $_def_openal_h
8177 $_def_sys_asoundlib_h
8178 $_def_alsa_asoundlib_h
8179 $_def_sunaudio
8180 $_def_sgiaudio
8181 $_def_win32waveout
8182 $_def_nas
8184 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8185 #undef FAST_OSD
8186 #undef FAST_OSD_TABLE
8188 /* Enable TV Interface support */
8189 $_def_tv
8191 /* Enable Video 4 Linux TV interface support */
8192 $_def_tv_v4l
8194 /* Enable Video 4 Linux 1 TV interface support */
8195 $_def_tv_v4l1
8197 /* Enable Video 4 Linux 2 TV interface support */
8198 $_def_tv_v4l2
8200 /* *BSD BrookTree headers */
8201 $_def_ioctl_meteor_h_name
8202 $_def_ioctl_bt848_h_name
8204 /* Enable *BSD BrookTree TV interface support */
8205 $_def_tv_bsdbt848
8207 /* Enable Radio Interface support */
8208 $_def_radio
8210 /* Enable Capture for Radio Interface support */
8211 $_def_radio_capture
8213 /* Enable Video 4 Linux Radio interface support */
8214 $_def_radio_v4l
8216 /* Enable Video 4 Linux 2 Radio interface support */
8217 $_def_radio_v4l2
8219 /* Enable *BSD BrookTree Radio interface support */
8220 $_def_radio_bsdbt848
8222 /* Enable Video 4 Linux 2 MPEG PVR support */
8223 $_def_pvr
8225 /* Define if your processor stores words with the most significant
8226 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8227 $_def_words_endian
8229 $_def_arch
8230 $_def_arch_x86
8232 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8233 have the instruction. */
8234 $_def_dcbzl
8236 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
8237 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
8239 #ifdef ARCH_POWERPC
8240 #define ARCH_PPC 1
8241 #endif
8243 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
8244 #ifdef ARCH_ARMV4L
8245 #define ARCH_ARM 1
8246 #endif
8248 /* only gcc3 can compile mvi instructions */
8249 $_def_gcc_mvi_support
8251 /* Define this for Cygwin build for win32 */
8252 $_def_confwin32
8254 /* Define this to any prefered value from 386 up to infinity with step 100 */
8255 #define __CPU__ $iproc
8257 $_mp_wordsize
8259 $_def_linux
8261 $_def_vcd
8263 #ifdef sun
8264 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8265 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8266 #elif defined(HPUX)
8267 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8268 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8269 #elif defined(WIN32)
8270 #define DEFAULT_CDROM_DEVICE "D:"
8271 #define DEFAULT_DVD_DEVICE "D:"
8272 #elif defined(SYS_DARWIN)
8273 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8274 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8275 #elif defined(__OpenBSD__)
8276 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8277 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8278 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8279 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8280 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8281 #elif defined(SYS_AMIGAOS4)
8282 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8283 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8284 #else
8285 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8286 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8287 #endif
8290 /*----------------------------------------------------------------------------
8292 ** NOTE: Instead of modifying these definitions here, use the
8293 ** --enable/--disable options of the ./configure script!
8294 ** See ./configure --help for details.
8296 *---------------------------------------------------------------------------*/
8298 /* C99 lrintf function available */
8299 $_def_lrintf
8301 /* round function is available */
8302 $_def_round
8304 /* yes, we have inttypes.h */
8305 #define HAVE_INTTYPES_H 1
8307 /* int_fastXY_t emulation */
8308 $_def_fast_inttypes
8310 /* nanosleep support */
8311 $_def_nanosleep
8313 /* SMB support */
8314 $_def_smbsupport
8316 /* termcap flag for getch2.c */
8317 $_def_termcap
8319 /* termios flag for getch2.c */
8320 $_def_termios
8321 $_def_termios_h
8322 $_def_termios_sys_h
8324 /* enable PNG support */
8325 $_def_png
8327 /* enable JPEG support */
8328 $_def_jpeg
8330 /* enable PNM support */
8331 $_def_pnm
8333 /* enable md5sum support */
8334 $_def_md5sum
8336 /* enable GIF support */
8337 $_def_gif
8338 $_def_gif_4
8339 $_def_gif_tvt_hack
8341 /* enable bitmap font support */
8342 $_def_bitmap_font
8344 /* enable FreeType support */
8345 $_def_freetype
8347 /* enable Fontconfig support */
8348 $_def_fontconfig
8350 /* enable SSA/ASS support */
8351 $_def_ass
8353 /* enable FriBiDi usage */
8354 $_def_fribidi
8356 /* enable ENCA usage */
8357 $_def_enca
8359 /* liblzo support */
8360 $_def_liblzo
8361 #ifdef USE_LIBLZO
8362 #define CONFIG_LZO 1
8363 #endif
8365 /* libmad support */
8366 $_def_mad
8368 /* enable OggVorbis support */
8369 $_def_vorbis
8370 $_def_tremor
8372 /* enable Speex support */
8373 $_def_speex
8375 /* enable musepack support */
8376 $_def_musepack
8378 /* enable OggTheora support */
8379 $_def_theora
8381 /* enable FAAD (AAC) support */
8382 $_def_faad
8383 $_def_faad_internal
8385 /* enable FAAC (AAC encoder) support */
8386 $_def_faac
8388 /* enable LADSPA plugin support */
8389 $_def_ladspa
8391 /* enable network */
8392 $_def_network
8394 /* enable ftp support */
8395 $_def_ftp
8397 /* enable vstream support */
8398 $_def_vstream
8400 /* enable winsock2 instead of Unix functions*/
8401 $_def_winsock2
8403 /* define this to use inet_aton() instead of inet_pton() */
8404 $_def_use_aton
8406 /* enables / disables cdparanoia support */
8407 $_def_cdparanoia
8408 $_def_cddb
8410 /* enables / disables VIDIX usage */
8411 $_def_vidix
8412 $_def_vidix_drv_cyberblade
8413 $_def_vidix_drv_mach64
8414 $_def_vidix_drv_mga
8415 $_def_vidix_drv_mga_crtc2
8416 $_def_vidix_drv_nvidia
8417 $_def_vidix_drv_pm3
8418 $_def_vidix_drv_radeon
8419 $_def_vidix_drv_rage128
8420 $_def_vidix_drv_savage
8421 $_def_vidix_drv_sis
8422 $_def_vidix_drv_unichrome
8423 $_def_vidix_pfx
8425 /* enables / disables new input joystick support */
8426 $_def_joystick
8428 /* enables / disables QTX codecs */
8429 $_def_qtx
8431 /* enables / disables osd menu */
8432 $_def_menu
8434 /* enables / disables subtitles sorting */
8435 $_def_sortsub
8437 /* XMMS input plugin support */
8438 $_def_xmms
8439 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8441 /* enables inet6 support */
8442 $_def_inet6
8444 /* do we have gethostbyname2? */
8445 $_def_gethostbyname2
8447 /* Extension defines */
8448 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
8449 $_def_3dnowext // only define if you have 3DNOWEXT (AMD Athlon, etc.)
8450 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
8451 $_def_mmxext // only define if you have MMX2 (Athlon/PIII/4/CelII)
8452 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
8453 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
8454 $_def_cmov // only define if you have CMOV (i686+, without VIA C3)
8455 $_def_fast_cmov // only define if CMOV is fast
8456 $_def_altivec // only define if you have Altivec (G4)
8457 $_def_armv5te // only define if you have Enhanced DSP Extensions (ARM)
8458 $_def_iwmmxt // only define if you have XScale IWMMX (ARM)
8460 $_def_altivec_h // enables usage of altivec.h
8462 $_def_mlib // Sun mediaLib, available only on solaris
8463 $_def_vis // only define if you have VIS ( ultrasparc )
8465 /* libmpeg2 uses a different feature test macro for mediaLib */
8466 #ifdef HAVE_MLIB
8467 #define LIBMPEG2_MLIB 1
8468 #endif
8470 /* libvo options */
8471 #define SCREEN_SIZE_X 1
8472 #define SCREEN_SIZE_Y 1
8473 $_def_x11
8474 $_def_xv
8475 $_def_xvmc
8476 $_def_vm
8477 $_def_xf86keysym
8478 $_def_xinerama
8479 $_def_gl
8480 $_def_gl_win32
8481 $_def_dga
8482 $_def_dga2
8483 $_def_sdl
8484 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8485 $_def_sdlbuggy
8486 $_def_directx
8487 $_def_ggi
8488 $_def_ggiwmh
8489 $_def_3dfx
8490 $_def_s3fb
8491 $_def_tdfxfb
8492 $_def_tdfxvid
8493 $_def_directfb
8494 $_def_directfb_version
8495 $_def_dfbmga
8496 $_def_zr
8497 $_def_bl
8498 $_def_mga
8499 $_def_xmga
8500 $_def_syncfb
8501 $_def_fbdev
8502 $_def_dxr2
8503 $_def_dxr3
8504 $_def_ivtv
8505 $_def_dvb
8506 $_def_dvb_in
8507 $_def_svga
8508 $_def_vesa
8509 $_def_xdpms
8510 $_def_aa
8511 $_def_caca
8512 $_def_tga
8513 $_def_toolame
8514 $_def_twolame
8516 /* used by GUI: */
8517 $_def_xshape
8519 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8520 #define X11_FULLSCREEN 1
8521 #endif
8523 #endif /* MPLAYER_CONFIG_H */
8526 #############################################################################
8528 cat << EOF
8530 Config files successfully generated by ./configure $_configuration !
8532 Install prefix: $_prefix
8533 Data directory: $_datadir
8534 Config direct.: $_confdir
8536 Byte order: $_byte_order
8537 Optimizing for: $_optimizing
8539 Languages:
8540 Messages/GUI: $_language
8543 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8544 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8545 echo
8547 cat << EOF
8549 Enabled optional drivers:
8550 Input: $_inputmodules
8551 Codecs: $_codecmodules
8552 Audio output: $_aomodules
8553 Video output: $_vomodules
8554 Audio filters: $_afmodules
8555 Disabled optional drivers:
8556 Input: $_noinputmodules
8557 Codecs: $_nocodecmodules
8558 Audio output: $_noaomodules
8559 Video output: $_novomodules
8560 Audio filters: $_noafmodules
8562 'config.h' and 'config.mak' contain your configuration options.
8563 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8564 compile *** DO NOT REPORT BUGS if you tweak these files ***
8566 'make' will now compile MPlayer and 'make install' will install it.
8567 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8572 if test "$_mtrr" = yes ; then
8573 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8574 echo
8577 if not x86_32; then
8578 cat <<EOF
8579 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8580 operating system ($system_name). You may encounter a few files that cannot
8581 be played due to missing open source video/audio codec support.
8587 cat <<EOF
8588 Check $TMPLOG if you wonder why an autodetection failed (make sure
8589 development headers/packages are installed).
8591 NOTE: The --enable-* parameters unconditionally force options on, completely
8592 skipping autodetection. This behavior is unlike what you may be used to from
8593 autoconf-based configure scripts that can decide to override you. This greater
8594 level of control comes at a price. You may have to provide the correct compiler
8595 and linker flags yourself.
8596 If you used one of these options (except --enable-gui and similar ones that
8597 turn on internal features) and experience a compilation or linking failure,
8598 make sure you have passed the necessary compiler/linker flags to configure.
8600 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8604 if test "$_warn_CFLAGS" = yes; then
8605 cat <<EOF
8607 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8609 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8611 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8612 To do so, execute 'CFLAGS= ./configure <options>'
8617 # Last move:
8618 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"