Invert the logic to check the cmp return value cmp to avoid using the ! operator.
[mplayer/greg.git] / configure
blob52861f847b5e8716403688f6e8eeefd275d3853b
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: check the cvs log !
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, here is a simple skeleton:
24 # echocheck "$feature"
25 # if "$_feature" = auto; then
26 # cat > $TMPC << EOF
27 # #include <feature.h>
28 # int main(void) { return 0; }
29 # EOF
30 # _feature=no
31 # cc_check && _feature=yes
32 # if test "$_feature" = yes ; then
33 # _def_feature='#define HAVE_FEATURE 1'
34 # else
35 # _def_feature='#undef HAVE_FEATURE'
36 # fi
37 # echores "$_feature"
39 # Furthermore you need to add the variable _feature to the list of default
40 # settings and set it to one of yes/no/auto. Also add appropriate
41 # --enable-feature/--disable-feature command line options.
42 # The results of the check should be written to config.h and config.mak
43 # at the end of this script. The variable names used for this should be
44 # uniform, i.e. if the option is named 'feature':
46 # _feature : should have a value of yes/no/auto
47 # _def_feature : '#define ... 1' or '#undef ...' for conditional compilation
48 # _ld_feature : '-L/path/dir -lfeature' GCC options
50 #############################################################################
52 # Prevent locale nonsense from breaking basic text processing utils
53 LC_ALL=C
54 export LC_ALL
56 # Store the configure line that was used
57 _configuration="$*"
59 # Prefer these macros to full length text !
60 # These macros only return an error code - NO display is done
61 compile_check() {
62 echo >> "$TMPLOG"
63 cat "$1" >> "$TMPLOG"
64 echo >> "$TMPLOG"
65 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
66 rm -f "$TMPEXE"
67 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
68 TMP="$?"
69 echo >> "$TMPLOG"
70 echo >> "$TMPLOG"
71 return "$TMP"
74 cc_check() {
75 compile_check $TMPC $@
78 cxx_check() {
79 compile_check $TMPCPP $@ -lstdc++
82 tmp_run() {
83 "$TMPEXE" >> "$TMPLOG" 2>&1
86 # Display error message, flushes tempfile, exit
87 die () {
88 echo
89 echo "Error: $@" >&2
90 echo >&2
91 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
92 echo "Check \"$TMPLOG\" if you do not understand why it failed."
93 exit 1
96 # OS test booleans functions
97 issystem() {
98 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
100 linux() { issystem "Linux" || issystem "uClinux" ; return "$?" ; }
101 sunos() { issystem "SunOS" ; return "$?" ; }
102 hpux() { issystem "HP-UX" ; return "$?" ; }
103 irix() { issystem "IRIX" ; return "$?" ; }
104 aix() { issystem "AIX" ; return "$?" ; }
105 cygwin() { issystem "CYGWIN" ; return "$?" ; }
106 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; }
107 netbsd() { issystem "NetBSD" ; return "$?" ; }
108 bsdos() { issystem "BSD/OS" ; return "$?" ; }
109 openbsd() { issystem "OpenBSD" ; return "$?" ; }
110 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
111 qnx() { issystem "QNX" ; return "$?" ; }
112 darwin() { issystem "Darwin" ; return "$?" ; }
113 gnu() { issystem "GNU" ; return "$?" ; }
114 mingw32() { issystem "MINGW32" ; return "$?" ; }
115 morphos() { issystem "MorphOS" ; return "$?" ; }
116 amigaos() { issystem "AmigaOS" ; return "$?" ; }
117 win32() { cygwin || mingw32 ; return "$?" ; }
118 beos() { issystem "BEOS" ; return "$?" ; }
120 # arch test boolean functions
121 # x86/x86pc is used by QNX
122 x86_32() {
123 case "$host_arch" in
124 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
125 *) return 1 ;;
126 esac
129 x86_64() {
130 case "$host_arch" in
131 x86_64|amd64) return 0 ;;
132 *) return 1 ;;
133 esac
136 x86() {
137 x86_32 || x86_64
140 ppc() {
141 case "$host_arch" in
142 ppc|powerpc) return 0;;
143 *) return 1;;
144 esac
147 alpha() {
148 case "$host_arch" in
149 alpha) return 0;;
150 *) return 1;;
151 esac
154 arm() {
155 case "$host_arch" in
156 arm) return 0;;
157 *) return 1;;
158 esac
161 sh3() {
162 case "$host_arch" in
163 sh3) return 0;;
164 *) return 1;;
165 esac
168 # not boolean test: implement the posix shell "!" operator for a
169 # non-posix /bin/sh.
170 # usage: not {command}
171 # returns exit status "success" when the execution of "command"
172 # fails.
173 not() {
174 eval "$@"
175 test $? -ne 0
178 # Use this before starting a check
179 echocheck() {
180 echo "============ Checking for $@ ============" >> "$TMPLOG"
181 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
184 # Use this to echo the results of a check
185 echores() {
186 if test "$_res_comment" ; then
187 _res_comment="($_res_comment)"
189 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
190 echo "##########################################" >> "$TMPLOG"
191 echo "" >> "$TMPLOG"
192 echo "$@ $_res_comment"
193 _res_comment=""
195 #############################################################################
197 # Check how echo works in this /bin/sh
198 case `echo -n` in
199 -n) _echo_n= _echo_c='\c' ;; # SysV echo
200 *) _echo_n='-n ' _echo_c= ;; # BSD echo
201 esac
203 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"`
205 show_help(){
206 cat << EOF
207 Usage: $0 [OPTIONS]...
209 Configuration:
210 -h, --help display this help and exit
212 Installation directories:
213 --prefix=DIR prefix directory for installation [/usr/local]
214 --bindir=DIR directory for installing binaries [PREFIX/bin]
215 --datadir=DIR directory for installing machine independent
216 data files (skins, etc) [PREFIX/share/mplayer]
217 --mandir=DIR directory for installing man pages [PREFIX/share/man]
218 --confdir=DIR directory for installing configuration files
219 [PREFIX/etc/mplayer]
220 --libdir=DIR directory for object code libraries [PREFIX/lib]
221 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
222 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
223 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
224 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
226 Optional features:
227 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
228 --disable-mplayer disable MPlayer compilation [enable]
229 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
230 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
231 --enable-largefiles enable support for files > 2GB [disable]
232 --enable-linux-devfs set default devices to devfs [disable]
233 --enable-termcap use termcap database for key codes [autodetect]
234 --enable-termios use termios database for key codes [autodetect]
235 --disable-iconv disable iconv for encoding conversion [autodetect]
236 --disable-langinfo do not use langinfo [autodetect]
237 --enable-lirc enable LIRC (remote control) support [autodetect]
238 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
239 --enable-joystick enable joystick support [disable]
240 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
241 --disable-vm disable X video mode extensions [autodetect]
242 --disable-xf86keysym disable support for multimedia keys [autodetect]
243 --enable-radio enable radio interface [disable]
244 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
245 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
246 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
247 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
248 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
249 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
250 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
251 --disable-tv-teletext disable TV teletext interface [autodetect]
252 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
253 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
254 --disable-network disable networking [enable]
255 --enable-winsock2 enable winsock2 [autodetect]
256 --enable-smb enable Samba (SMB) input [autodetect]
257 --enable-live enable LIVE555 Streaming Media [autodetect]
258 --enable-nemesi enable Nemesi Streaming Media [autodetect]
259 --disable-dvdnav disable libdvdnav [autodetect]
260 --disable-dvdread disable libdvdread [autodetect]
261 --disable-dvdread-internal disable internal libdvdread [autodetect]
262 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
263 --disable-cdparanoia disable cdparanoia [autodetect]
264 --disable-cddb disable cddb [autodetect]
265 --disable-bitmap-font disable bitmap font support [enable]
266 --disable-freetype disable FreeType 2 font rendering [autodetect]
267 --disable-fontconfig disable fontconfig font lookup [autodetect]
268 --disable-unrarlib disable Unique RAR File Library [enabled]
269 --enable-menu enable OSD menu (not DVD menu) [disabled]
270 --disable-sortsub disable subtitle sorting [enabled]
271 --enable-fribidi enable the FriBiDi libs [autodetect]
272 --disable-enca disable ENCA charset oracle library [autodetect]
273 --disable-macosx disable Mac OS X specific features [autodetect]
274 --disable-maemo disable maemo specific features [autodetect]
275 --enable-macosx-finder-support enable Mac OS X Finder invocation
276 parameter parsing [disabled]
277 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
278 --disable-inet6 disable IPv6 support [autodetect]
279 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
280 --disable-ftp disable FTP support [enabled]
281 --disable-vstream disable TiVo vstream client support [autodetect]
282 --disable-pthreads disable Posix threads support [autodetect]
283 --disable-w32threads disable Win32 threads support [autodetect]
284 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
285 --enable-rpath enable runtime linker path for extra libs [disabled]
287 Codecs:
288 --enable-gif enable GIF support [autodetect]
289 --enable-png enable PNG input/output support [autodetect]
290 --enable-jpeg enable JPEG input/output support [autodetect]
291 --enable-libcdio enable external libcdio [autodetect]
292 --enable-liblzo enable external liblzo [autodetect]
293 --disable-win32dll disable Win32 DLL support [enabled]
294 --disable-qtx disable QuickTime codecs support [enabled]
295 --disable-xanim disable XAnim codecs support [enabled]
296 --disable-real disable RealPlayer codecs support [enabled]
297 --disable-xvid disable XviD [autodetect]
298 --disable-x264 disable x264 [autodetect]
299 --disable-libnut disable libnut [autodetect]
300 --disable-libavutil_a disable static libavutil [autodetect]
301 --disable-libavcodec_a disable static libavcodec [autodetect]
302 --disable-libavformat_a disable static libavformat [autodetect]
303 --disable-libpostproc_a disable static libpostproc [autodetect]
304 --disable-libavutil_so disable shared libavutil [autodetect]
305 --disable-libavcodec_so disable shared libavcodec [autodetect]
306 --disable-libavformat_so disable shared libavformat [autodetect]
307 --disable-libpostproc_so disable shared libpostproc [autodetect]
308 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
309 in libavcodec [enabled]
310 --disable-tremor-internal disable internal Tremor [enabled]
311 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
312 --enable-tremor-external enable external Tremor [autodetect]
313 --disable-libvorbis disable libvorbis support [autodetect]
314 --disable-speex disable Speex support [autodetect]
315 --enable-theora enable OggTheora libraries [autodetect]
316 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
317 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
318 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
319 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
320 --disable-ladspa disable LADSPA plugin support [autodetect]
321 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
322 --disable-mad disable libmad (MPEG audio) support [autodetect]
323 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
324 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
325 --enable-xmms enable XMMS input plugin support [disabled]
326 --enable-libdca enable libdca support [autodetect]
327 --disable-mp3lib disable builtin mp3lib [enabled]
328 --disable-liba52 disable builtin liba52 [enabled]
329 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
330 --disable-musepack disable musepack support [autodetect]
331 --disable-libamr_nb disable libamr narrowband [autodetect]
332 --disable-libamr_wb disable libamr wideband [autodetect]
333 --disable-decoder=DECODER disable specified FFmpeg decoder
334 --enable-decoder=DECODER enable specified FFmpeg decoder
335 --disable-encoder=ENCODER disable specified FFmpeg encoder
336 --enable-encoder=ENCODER enable specified FFmpeg encoder
337 --disable-parser=PARSER disable specified FFmpeg parser
338 --enable-parser=PARSER enable specified FFmpeg parser
339 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
340 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
341 --disable-muxer=MUXER disable specified FFmpeg muxer
342 --enable-muxer=MUXER enable specified FFmpeg muxer
344 Video output:
345 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
346 --disable-vidix-external disable external VIDIX [for x86 *nix]
347 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
348 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
349 nvidia,pm2,pm3,radeon,rage128,savage,sis,unichrome
350 --enable-gl enable OpenGL video output [autodetect]
351 --enable-dga2 enable DGA 2 support [autodetect]
352 --enable-dga1 enable DGA 1 support [autodetect]
353 --enable-vesa enable VESA video output [autodetect]
354 --enable-svga enable SVGAlib video output [autodetect]
355 --enable-sdl enable SDL video output [autodetect]
356 --enable-aa enable AAlib video output [autodetect]
357 --enable-caca enable CACA video output [autodetect]
358 --enable-ggi enable GGI video output [autodetect]
359 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
360 --enable-directx enable DirectX video output [autodetect]
361 --enable-dxr2 enable DXR2 video output [autodetect]
362 --enable-dxr3 enable DXR3/H+ video output [autodetect]
363 --enable-ivtv enable IVTV TV-Out video output [autodetect]
364 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
365 --enable-dvb enable DVB video output [autodetect]
366 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
367 --enable-mga enable mga_vid video output [autodetect]
368 --enable-xmga enable mga_vid X11 video output [autodetect]
369 --enable-xv enable Xv video output [autodetect]
370 --enable-xvmc enable XvMC acceleration [disable]
371 --enable-vm enable XF86VidMode support [autodetect]
372 --enable-xinerama enable Xinerama support [autodetect]
373 --enable-x11 enable X11 video output [autodetect]
374 --enable-xshape enable XShape support [autodetect]
375 --enable-fbdev enable FBDev video output [autodetect]
376 --enable-mlib enable mediaLib video output (Solaris) [disable]
377 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
378 --enable-tdfxfb enable tdfxfb video output [disable]
379 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
380 --enable-directfb enable DirectFB video output [autodetect]
381 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
382 --enable-bl enable Blinkenlights video output [disable]
383 --enable-tdfxvid enable tdfx_vid video output [disable]
384 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
385 --disable-tga disable Targa video output [enable]
386 --disable-pnm disable PNM video output [enable]
387 --disable-md5sum disable md5sum video output [enable]
389 Audio output:
390 --disable-alsa disable ALSA audio output [autodetect]
391 --disable-ossaudio disable OSS audio output [autodetect]
392 --disable-arts disable aRts audio output [autodetect]
393 --disable-esd disable esd audio output [autodetect]
394 --disable-pulse disable Pulseaudio audio output [autodetect]
395 --disable-jack disable JACK audio output [autodetect]
396 --disable-openal disable OpenAL audio output [autodetect]
397 --disable-nas disable NAS audio output [autodetect]
398 --disable-sgiaudio disable SGI audio output [autodetect]
399 --disable-sunaudio disable Sun audio output [autodetect]
400 --disable-win32waveout disable Windows waveout audio output [autodetect]
401 --disable-select disable using select() on the audio device [enable]
403 Miscellaneous options:
404 --enable-runtime-cpudetection enable runtime CPU detection [disable]
405 --enable-cross-compile enable cross-compilation [autodetect]
406 --cc=COMPILER C compiler to build MPlayer [gcc]
407 --host-cc=COMPILER C compiler for tools needed while building [gcc]
408 --as=ASSEMBLER assembler to build MPlayer [as]
409 --ar=AR librarian to build MPlayer [ar]
410 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
411 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
412 --enable-static build a statically linked binary
413 --charset=charset convert the console messages to this character set
414 --language=list a white space or comma separated list of languages for
415 translated man pages, the first language is used for
416 messages and the GUI (the environment variable
417 \$LINGUAS is also honored) [en]
418 (Available: $LANGUAGES all)
419 --with-install=PATH path to a custom install program
420 --enable-color-console enable color console output (UNSUPPORTED) [disable]
422 Advanced options:
423 --enable-mmx enable MMX [autodetect]
424 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
425 --enable-3dnow enable 3DNow! [autodetect]
426 --enable-3dnowext enable extended 3DNow! [autodetect]
427 --enable-sse enable SSE [autodetect]
428 --enable-sse2 enable SSE2 [autodetect]
429 --enable-ssse3 enable SSSE3 [autodetect]
430 --enable-shm enable shm [autodetect]
431 --enable-altivec enable AltiVec (PowerPC) [autodetect]
432 --enable-armv5te enable DSP extensions (ARM) [autodetect]
433 --enable-armv6 enable ARMv6 (ARM) [autodetect]
434 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
435 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
436 --enable-big-endian force byte order to big-endian [autodetect]
437 --enable-debug[=1-3] compile-in debugging information [disable]
438 --enable-profile compile-in profiling information [disable]
439 --disable-sighandler disable sighandler for crashes [enable]
440 --enable-crash-debug enable automatic gdb attach on crash [disable]
441 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
443 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
444 --disable-gcc-check disable gcc version checking [enable]
446 Use these options if autodetection fails (Options marked with (*) accept
447 multiple paths separated by ':'):
448 --extra-libs=FLAGS extra linker flags
449 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
450 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
451 --with-extraincdir=DIR extra header search paths in DIR (*)
452 --with-extralibdir=DIR extra linker search paths in DIR (*)
453 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
455 --with-freetype-config=PATH path to freetype-config
456 --with-fribidi-config=PATH path to fribidi-config
457 --with-glib-config=PATH path to glib*-config
458 --with-gtk-config=PATH path to gtk*-config
459 --with-sdl-config=PATH path to sdl*-config
460 --with-dvdnav-config=PATH path to dvdnav-config
462 This configure script is NOT autoconf-based, even though its output is similar.
463 It will try to autodetect all configuration options. If you --enable an option
464 it will be forcefully turned on, skipping autodetection. This can break
465 compilation, so you need to know what you are doing.
467 exit 0
468 } #show_help()
470 # GOTCHA: the variables below defines the default behavior for autodetection
471 # and have - unless stated otherwise - at least 2 states : yes no
472 # If autodetection is available then the third state is: auto
473 _mmx=auto
474 _3dnow=auto
475 _3dnowext=auto
476 _mmxext=auto
477 _sse=auto
478 _sse2=auto
479 _ssse3=auto
480 _cmov=auto
481 _fast_cmov=auto
482 _armv5te=auto
483 _armv6=auto
484 _iwmmxt=auto
485 _mtrr=auto
486 _altivec=auto
487 _install=install
488 _ranlib=ranlib
489 _ldconfig=ldconfig
490 _cc=cc
491 _ar=ar
492 test "$CC" && _cc="$CC"
493 _gcc_check=yes
494 _as=auto
495 _runtime_cpudetection=no
496 _cross_compile=auto
497 _prefix="/usr/local"
498 _libavutil_a=auto
499 _libavutil_so=auto
500 _libavcodec_a=auto
501 _libamr_nb=auto
502 _libamr_wb=auto
503 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
504 _libavdecoders=` echo $_libavdecoders_all | sed -e s/LIBFAAD_DECODER// -e s/MPEG4AAC_DECODER// -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// `
505 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
506 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// -e s/LIBVORBIS_ENCODER// `
507 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
508 _libavparsers=$_libavparsers_all
509 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
510 _libavbsfs=$_libavbsfs_all
511 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
512 _libavdemuxers=`echo $_libavdemuxers_all | sed -e s/AUDIO_BEOS_DEMUXER// -e s/OSS_DEMUXER// -e s/DC1394_DEMUXER// -e s/DV1394_DEMUXER// -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/V4L_DEMUXER// -e s/BKTR_DEMUXER// -e s/X11_GRAB_DEVICE_DEMUXER// -e s/V4L2_DEMUXER// -e s/LIBNUT_DEMUXER// -e s/AVISYNTH_DEMUXER// `
513 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
514 _libavmuxers=`echo $_libavmuxers_all | sed -e s/AUDIO_BEOS_MUXER// -e s/OSS_MUXER// -e s/RTP_MUXER// `
515 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
516 _libavcodec_so=auto
517 _libavformat_a=auto
518 _libavformat_so=auto
519 _libpostproc_a=auto
520 _libpostproc_so=auto
521 _libavcodec_mpegaudio_hp=yes
522 _mencoder=yes
523 _mplayer=yes
524 _x11=auto
525 _xshape=auto
526 _dga1=auto
527 _dga2=auto
528 _xv=auto
529 _xvmc=no #auto when complete
530 _sdl=auto
531 _directx=auto
532 _win32waveout=auto
533 _nas=auto
534 _png=auto
535 _jpeg=auto
536 _pnm=yes
537 _md5sum=yes
538 _gif=auto
539 _gl=auto
540 _ggi=auto
541 _ggiwmh=auto
542 _aa=auto
543 _caca=auto
544 _svga=auto
545 _vesa=auto
546 _fbdev=auto
547 _dvb=auto
548 _dvbhead=auto
549 _dxr2=auto
550 _dxr3=auto
551 _ivtv=auto
552 _v4l2=auto
553 _iconv=auto
554 _langinfo=auto
555 _rtc=auto
556 _ossaudio=auto
557 _arts=auto
558 _esd=auto
559 _pulse=auto
560 _jack=auto
561 _openal=auto
562 _libcdio=auto
563 _liblzo=auto
564 _mad=auto
565 _toolame=auto
566 _twolame=auto
567 _tremor_internal=yes
568 _tremor_low=no
569 _tremor_external=auto
570 _libvorbis=auto
571 _speex=auto
572 _theora=auto
573 _mp3lib=yes
574 _liba52=yes
575 _libdca=auto
576 _libmpeg2=yes
577 _faad_internal=auto
578 _faad_external=auto
579 _faad_fixed=no
580 _faac=auto
581 _ladspa=auto
582 _xmms=no
583 _dvdnav=auto
584 _dvdnavconfig=dvdnav-config
585 _dvdread=auto
586 _dvdread_internal=auto
587 _libdvdcss_internal=auto
588 _xanim=auto
589 _real=auto
590 _live=auto
591 _nemesi=auto
592 _native_rtsp=yes
593 _xinerama=auto
594 _mga=auto
595 _xmga=auto
596 _vm=auto
597 _xf86keysym=auto
598 _mlib=no #broken, thus disabled
599 _sgiaudio=auto
600 _sunaudio=auto
601 _alsa=auto
602 _fastmemcpy=yes
603 _unrarlib=yes
604 _win32dll=auto
605 _select=yes
606 _radio=no
607 _radio_capture=no
608 _radio_v4l=auto
609 _radio_v4l2=auto
610 _radio_bsdbt848=auto
611 _tv=yes
612 _tv_v4l1=auto
613 _tv_v4l2=auto
614 _tv_bsdbt848=auto
615 _tv_dshow=auto
616 _tv_teletext=auto
617 _pvr=auto
618 _network=yes
619 _winsock2=auto
620 _smbsupport=auto
621 _vidix_internal=auto
622 _vidix_external=auto
623 _joystick=no
624 _xvid=auto
625 _x264=auto
626 _libnut=auto
627 _lirc=auto
628 _lircc=auto
629 _apple_remote=auto
630 _gui=no
631 _gtk1=no
632 _termcap=auto
633 _termios=auto
634 _3dfx=no
635 _s3fb=no
636 _tdfxfb=no
637 _tdfxvid=no
638 _xvr100=auto
639 _tga=yes
640 _directfb=auto
641 _zr=auto
642 _bl=no
643 _largefiles=no
644 #_language=en
645 _shm=auto
646 _linux_devfs=no
647 _charset="UTF-8"
648 _dynamic_plugins=no
649 _crash_debug=no
650 _sighandler=yes
651 _libdv=auto
652 _cdparanoia=auto
653 _cddb=auto
654 _big_endian=auto
655 _bitmap_font=yes
656 _freetype=auto
657 _fontconfig=auto
658 _menu=no
659 _qtx=auto
660 _macosx=auto
661 _maemo=auto
662 _macosx_finder_support=no
663 _macosx_bundle=auto
664 _sortsub=yes
665 _freetypeconfig='freetype-config'
666 _fribidi=auto
667 _fribidiconfig='fribidi-config'
668 _enca=auto
669 _inet6=auto
670 _gethostbyname2=auto
671 _ftp=yes
672 _musepack=auto
673 _vstream=auto
674 _pthreads=auto
675 _w32threads=auto
676 _ass=auto
677 _rpath=no
678 _asmalign_pot=auto
679 _color_console=no
680 _stream_cache=yes
681 _def_stream_cache="#define USE_STREAM_CACHE 1"
682 _need_shmem=yes
683 for ac_option do
684 case "$ac_option" in
685 --help|-help|-h)
686 show_help
688 --prefix=*)
689 _prefix=`echo $ac_option | cut -d '=' -f 2`
691 --bindir=*)
692 _bindir=`echo $ac_option | cut -d '=' -f 2`
694 --datadir=*)
695 _datadir=`echo $ac_option | cut -d '=' -f 2`
697 --mandir=*)
698 _mandir=`echo $ac_option | cut -d '=' -f 2`
700 --confdir=*)
701 _confdir=`echo $ac_option | cut -d '=' -f 2`
703 --libdir=*)
704 _libdir=`echo $ac_option | cut -d '=' -f 2`
706 --codecsdir=*)
707 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
709 --win32codecsdir=*)
710 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
712 --xanimcodecsdir=*)
713 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
715 --realcodecsdir=*)
716 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
718 --with-extraincdir=*)
719 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
721 --with-extralibdir=*)
722 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
725 --with-install=*)
726 _install=`echo $ac_option | cut -d '=' -f 2 `
728 --with-xvmclib=*)
729 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
732 --with-sdl-config=*)
733 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
735 --with-freetype-config=*)
736 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
738 --with-fribidi-config=*)
739 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
741 --with-gtk-config=*)
742 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
744 --with-glib-config=*)
745 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
747 --with-dvdnav-config=*)
748 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
751 --extra-libs=*)
752 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
754 --extra-libs-mplayer=*)
755 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
757 --extra-libs-mencoder=*)
758 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
761 --target=*)
762 _target=`echo $ac_option | cut -d '=' -f 2`
764 --cc=*)
765 _cc=`echo $ac_option | cut -d '=' -f 2`
767 --host-cc=*)
768 _host_cc=`echo $ac_option | cut -d '=' -f 2`
770 --as=*)
771 _as=`echo $ac_option | cut -d '=' -f 2`
773 --ar=*)
774 _ar=`echo $ac_option | cut -d '=' -f 2`
776 --ranlib=*)
777 _ranlib=`echo $ac_option | cut -d '=' -f 2`
779 --charset=*)
780 _charset=`echo $ac_option | cut -d '=' -f 2`
782 --language=*)
783 _language=`echo $ac_option | cut -d '=' -f 2`
786 --enable-static)
787 _ld_static='-static'
789 --disable-static)
790 _ld_static=''
792 --enable-profile)
793 _profile='-p'
795 --disable-profile)
796 _profile=
798 --enable-debug)
799 _debug='-g'
801 --enable-debug=*)
802 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
804 --disable-debug)
805 _debug=
807 --enable-gcc-check) _gcc_check=yes ;;
808 --disable-gcc-check) _gcc_check=no ;;
809 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
810 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
811 --enable-cross-compile) _cross_compile=yes ;;
812 --disable-cross-compile) _cross_compile=no ;;
813 --enable-mencoder) _mencoder=yes ;;
814 --disable-mencoder) _mencoder=no ;;
815 --enable-mplayer) _mplayer=yes ;;
816 --disable-mplayer) _mplayer=no ;;
817 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
818 --disable-dynamic-plugins) _dynamic_plugins=no ;;
819 --enable-x11) _x11=yes ;;
820 --disable-x11) _x11=no ;;
821 --enable-xshape) _xshape=yes ;;
822 --disable-xshape) _xshape=no ;;
823 --enable-xv) _xv=yes ;;
824 --disable-xv) _xv=no ;;
825 --enable-xvmc) _xvmc=yes ;;
826 --disable-xvmc) _xvmc=no ;;
827 --enable-sdl) _sdl=yes ;;
828 --disable-sdl) _sdl=no ;;
829 --enable-directx) _directx=yes ;;
830 --disable-directx) _directx=no ;;
831 --enable-win32waveout) _win32waveout=yes ;;
832 --disable-win32waveout) _win32waveout=no ;;
833 --enable-nas) _nas=yes ;;
834 --disable-nas) _nas=no ;;
835 --enable-png) _png=yes ;;
836 --disable-png) _png=no ;;
837 --enable-jpeg) _jpeg=yes ;;
838 --disable-jpeg) _jpeg=no ;;
839 --enable-pnm) _pnm=yes ;;
840 --disable-pnm) _pnm=no ;;
841 --enable-md5sum) _md5sum=yes ;;
842 --disable-md5sum) _md5sum=no ;;
843 --enable-gif) _gif=yes ;;
844 --disable-gif) _gif=no ;;
845 --enable-gl) _gl=yes ;;
846 --disable-gl) _gl=no ;;
847 --enable-ggi) _ggi=yes ;;
848 --disable-ggi) _ggi=no ;;
849 --enable-ggiwmh) _ggiwmh=yes ;;
850 --disable-ggiwmh) _ggiwmh=no ;;
851 --enable-aa) _aa=yes ;;
852 --disable-aa) _aa=no ;;
853 --enable-caca) _caca=yes ;;
854 --disable-caca) _caca=no ;;
855 --enable-svga) _svga=yes ;;
856 --disable-svga) _svga=no ;;
857 --enable-vesa) _vesa=yes ;;
858 --disable-vesa) _vesa=no ;;
859 --enable-fbdev) _fbdev=yes ;;
860 --disable-fbdev) _fbdev=no ;;
861 --enable-dvb) _dvb=yes ;;
862 --disable-dvb) _dvb=no ;;
863 --enable-dvbhead) _dvbhead=yes ;;
864 --disable-dvbhead) _dvbhead=no ;;
865 --enable-dxr2) _dxr2=yes ;;
866 --disable-dxr2) _dxr2=no ;;
867 --enable-dxr3) _dxr3=yes ;;
868 --disable-dxr3) _dxr3=no ;;
869 --enable-ivtv) _ivtv=yes ;;
870 --disable-ivtv) _ivtv=no ;;
871 --enable-v4l2) _v4l2=yes ;;
872 --disable-v4l2) _v4l2=no ;;
873 --enable-iconv) _iconv=yes ;;
874 --disable-iconv) _iconv=no ;;
875 --enable-langinfo) _langinfo=yes ;;
876 --disable-langinfo) _langinfo=no ;;
877 --enable-rtc) _rtc=yes ;;
878 --disable-rtc) _rtc=no ;;
879 --enable-libdv) _libdv=yes ;;
880 --disable-libdv) _libdv=no ;;
881 --enable-ossaudio) _ossaudio=yes ;;
882 --disable-ossaudio) _ossaudio=no ;;
883 --enable-arts) _arts=yes ;;
884 --disable-arts) _arts=no ;;
885 --enable-esd) _esd=yes ;;
886 --disable-esd) _esd=no ;;
887 --enable-pulse) _pulse=yes ;;
888 --disable-pulse) _pulse=no ;;
889 --enable-jack) _jack=yes ;;
890 --disable-jack) _jack=no ;;
891 --enable-openal) _openal=yes ;;
892 --disable-openal) _openal=no ;;
893 --enable-mad) _mad=yes ;;
894 --disable-mad) _mad=no ;;
895 --enable-toolame) _toolame=yes ;;
896 --disable-toolame) _toolame=no ;;
897 --enable-twolame) _twolame=yes ;;
898 --disable-twolame) _twolame=no ;;
899 --enable-libcdio) _libcdio=yes ;;
900 --disable-libcdio) _libcdio=no ;;
901 --enable-liblzo) _liblzo=yes ;;
902 --disable-liblzo) _liblzo=no ;;
903 --enable-libvorbis) _libvorbis=yes ;;
904 --disable-libvorbis) _libvorbis=no ;;
905 --enable-speex) _speex=yes ;;
906 --disable-speex) _speex=no ;;
907 --enable-tremor-internal) _tremor_internal=yes ;;
908 --disable-tremor-internal) _tremor_internal=no ;;
909 --enable-tremor-low) _tremor_low=yes ;;
910 --disable-tremor-low) _tremor_low=no ;;
911 --enable-tremor-external) _tremor_external=yes ;;
912 --disable-tremor-external) _tremor_external=no ;;
913 --enable-theora) _theora=yes ;;
914 --disable-theora) _theora=no ;;
915 --enable-mp3lib) _mp3lib=yes ;;
916 --disable-mp3lib) _mp3lib=no ;;
917 --enable-liba52) _liba52=yes ;;
918 --disable-liba52) _liba52=no ;;
919 --enable-libdca) _libdca=yes ;;
920 --disable-libdca) _libdca=no ;;
921 --enable-libmpeg2) _libmpeg2=yes ;;
922 --disable-libmpeg2) _libmpeg2=no ;;
923 --enable-musepack) _musepack=yes ;;
924 --disable-musepack) _musepack=no ;;
925 --enable-faad-internal) _faad_internal=yes ;;
926 --disable-faad-internal) _faad_internal=no ;;
927 --enable-faad-external) _faad_external=yes ;;
928 --disable-faad-external) _faad_external=no ;;
929 --enable-faad-fixed) _faad_fixed=yes ;;
930 --disable-faad-fixed) _faad_fixed=no ;;
931 --enable-faac) _faac=yes ;;
932 --disable-faac) _faac=no ;;
933 --enable-ladspa) _ladspa=yes ;;
934 --disable-ladspa) _ladspa=no ;;
935 --enable-xmms) _xmms=yes ;;
936 --disable-xmms) _xmms=no ;;
937 --enable-dvdread) _dvdread=yes ;;
938 --disable-dvdread) _dvdread=no ;;
939 --enable-dvdread-internal) _dvdread_internal=yes ;;
940 --disable-dvdread-internal) _dvdread_internal=no ;;
941 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
942 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
943 --enable-dvdnav) _dvdnav=yes ;;
944 --disable-dvdnav) _dvdnav=no ;;
945 --enable-xanim) _xanim=yes ;;
946 --disable-xanim) _xanim=no ;;
947 --enable-real) _real=yes ;;
948 --disable-real) _real=no ;;
949 --enable-live) _live=yes ;;
950 --disable-live) _live=no ;;
951 --enable-nemesi) _nemesi=yes ;;
952 --disable-nemesi) _nemesi=no ;;
953 --enable-xinerama) _xinerama=yes ;;
954 --disable-xinerama) _xinerama=no ;;
955 --enable-mga) _mga=yes ;;
956 --disable-mga) _mga=no ;;
957 --enable-xmga) _xmga=yes ;;
958 --disable-xmga) _xmga=no ;;
959 --enable-vm) _vm=yes ;;
960 --disable-vm) _vm=no ;;
961 --enable-xf86keysym) _xf86keysym=yes ;;
962 --disable-xf86keysym) _xf86keysym=no ;;
963 --enable-mlib) _mlib=yes ;;
964 --disable-mlib) _mlib=no ;;
965 --enable-sunaudio) _sunaudio=yes ;;
966 --disable-sunaudio) _sunaudio=no ;;
967 --enable-sgiaudio) _sgiaudio=yes ;;
968 --disable-sgiaudio) _sgiaudio=no ;;
969 --enable-alsa) _alsa=yes ;;
970 --disable-alsa) _alsa=no ;;
971 --enable-tv) _tv=yes ;;
972 --disable-tv) _tv=no ;;
973 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
974 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
975 --enable-tv-v4l1) _tv_v4l1=yes ;;
976 --disable-tv-v4l1) _tv_v4l1=no ;;
977 --enable-tv-v4l2) _tv_v4l2=yes ;;
978 --disable-tv-v4l2) _tv_v4l2=no ;;
979 --enable-tv-dshow) _tv_dshow=yes ;;
980 --disable-tv-dshow) _tv_dshow=no ;;
981 --enable-tv-teletext) _tv_teletext=yes ;;
982 --disable-tv-teletext) _tv_teletext=no ;;
983 --enable-radio) _radio=yes ;;
984 --enable-radio-capture) _radio_capture=yes ;;
985 --disable-radio-capture) _radio_capture=no ;;
986 --disable-radio) _radio=no ;;
987 --enable-radio-v4l) _radio_v4l=yes ;;
988 --disable-radio-v4l) _radio_v4l=no ;;
989 --enable-radio-v4l2) _radio_v4l2=yes ;;
990 --disable-radio-v4l2) _radio_v4l2=no ;;
991 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
992 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
993 --enable-pvr) _pvr=yes ;;
994 --disable-pvr) _pvr=no ;;
995 --enable-fastmemcpy) _fastmemcpy=yes ;;
996 --disable-fastmemcpy) _fastmemcpy=no ;;
997 --enable-network) _network=yes ;;
998 --disable-network) _network=no ;;
999 --enable-winsock2) _winsock2=yes ;;
1000 --disable-winsock2) _winsock2=no ;;
1001 --enable-smb) _smbsupport=yes ;;
1002 --disable-smb) _smbsupport=no ;;
1003 --enable-vidix-internal) _vidix_internal=yes ;;
1004 --disable-vidix-internal) _vidix_internal=no ;;
1005 --enable-vidix-external) _vidix_external=yes ;;
1006 --disable-vidix-external) _vidix_external=no ;;
1007 --with-vidix-drivers=*)
1008 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
1010 --enable-joystick) _joystick=yes ;;
1011 --disable-joystick) _joystick=no ;;
1012 --enable-xvid) _xvid=yes ;;
1013 --disable-xvid) _xvid=no ;;
1014 --enable-x264) _x264=yes ;;
1015 --disable-x264) _x264=no ;;
1016 --enable-libnut) _libnut=yes ;;
1017 --disable-libnut) _libnut=no ;;
1018 --enable-libavutil_a) _libavutil_a=yes ;;
1019 --disable-libavutil_a) _libavutil_a=no ;;
1020 --enable-libavutil_so) _libavutil_so=yes ;;
1021 --disable-libavutil_so) _libavutil_so=no ;;
1022 --enable-libavcodec_a) _libavcodec_a=yes ;;
1023 --disable-libavcodec_a) _libavcodec_a=no ;;
1024 --enable-libavcodec_so) _libavcodec_so=yes ;;
1025 --disable-libavcodec_so) _libavcodec_so=no ;;
1026 --enable-libamr_nb) _libamr_nb=yes ;;
1027 --disable-libamr_nb) _libamr_nb=no ;;
1028 --enable-libamr_wb) _libamr_wb=yes ;;
1029 --disable-libamr_wb) _libamr_wb=no ;;
1030 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1031 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1032 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1033 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1034 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1035 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1036 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1037 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1038 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1039 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1040 --enable-libavformat_a) _libavformat_a=yes ;;
1041 --disable-libavformat_a) _libavformat_a=no ;;
1042 --enable-libavformat_so) _libavformat_so=yes ;;
1043 --disable-libavformat_so) _libavformat_so=no ;;
1044 --enable-libpostproc_a) _libpostproc_a=yes ;;
1045 --disable-libpostproc_a) _libpostproc_a=no ;;
1046 --enable-libpostproc_so) _libpostproc_so=yes ;;
1047 --disable-libpostproc_so) _libpostproc_so=no ;;
1048 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1049 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1051 --enable-lirc) _lirc=yes ;;
1052 --disable-lirc) _lirc=no ;;
1053 --enable-lircc) _lircc=yes ;;
1054 --disable-lircc) _lircc=no ;;
1055 --enable-apple-remote) _apple_remote=yes ;;
1056 --disable-apple-remote) _apple_remote=no ;;
1057 --enable-gui) _gui=yes ;;
1058 --disable-gui) _gui=no ;;
1059 --enable-gtk1) _gtk1=yes ;;
1060 --disable-gtk1) _gtk1=no ;;
1061 --enable-termcap) _termcap=yes ;;
1062 --disable-termcap) _termcap=no ;;
1063 --enable-termios) _termios=yes ;;
1064 --disable-termios) _termios=no ;;
1065 --enable-3dfx) _3dfx=yes ;;
1066 --disable-3dfx) _3dfx=no ;;
1067 --enable-s3fb) _s3fb=yes ;;
1068 --disable-s3fb) _s3fb=no ;;
1069 --enable-tdfxfb) _tdfxfb=yes ;;
1070 --disable-tdfxfb) _tdfxfb=no ;;
1071 --disable-tdfxvid) _tdfxvid=no ;;
1072 --enable-tdfxvid) _tdfxvid=yes ;;
1073 --disable-xvr100) _xvr100=no ;;
1074 --enable-xvr100) _xvr100=yes ;;
1075 --disable-tga) _tga=no ;;
1076 --enable-tga) _tga=yes ;;
1077 --enable-directfb) _directfb=yes ;;
1078 --disable-directfb) _directfb=no ;;
1079 --enable-zr) _zr=yes ;;
1080 --disable-zr) _zr=no ;;
1081 --enable-bl) _bl=yes ;;
1082 --disable-bl) _bl=no ;;
1083 --enable-mtrr) _mtrr=yes ;;
1084 --disable-mtrr) _mtrr=no ;;
1085 --enable-largefiles) _largefiles=yes ;;
1086 --disable-largefiles) _largefiles=no ;;
1087 --enable-shm) _shm=yes ;;
1088 --disable-shm) _shm=no ;;
1089 --enable-select) _select=yes ;;
1090 --disable-select) _select=no ;;
1091 --enable-linux-devfs) _linux_devfs=yes ;;
1092 --disable-linux-devfs) _linux_devfs=no ;;
1093 --enable-cdparanoia) _cdparanoia=yes ;;
1094 --disable-cdparanoia) _cdparanoia=no ;;
1095 --enable-cddb) _cddb=yes ;;
1096 --disable-cddb) _cddb=no ;;
1097 --enable-big-endian) _big_endian=yes ;;
1098 --disable-big-endian) _big_endian=no ;;
1099 --enable-bitmap-font) _bitmap_font=yes ;;
1100 --disable-bitmap-font) _bitmap_font=no ;;
1101 --enable-freetype) _freetype=yes ;;
1102 --disable-freetype) _freetype=no ;;
1103 --enable-fontconfig) _fontconfig=yes ;;
1104 --disable-fontconfig) _fontconfig=no ;;
1105 --enable-unrarlib) _unrarlib=yes ;;
1106 --disable-unrarlib) _unrarlib=no ;;
1107 --enable-ftp) _ftp=yes ;;
1108 --disable-ftp) _ftp=no ;;
1109 --enable-vstream) _vstream=yes ;;
1110 --disable-vstream) _vstream=no ;;
1111 --enable-pthreads) _pthreads=yes ;;
1112 --disable-pthreads) _pthreads=no ;;
1113 --enable-w32threads) _w32threads=yes ;;
1114 --disable-w32threads) _w32threads=no ;;
1115 --enable-ass) _ass=yes ;;
1116 --disable-ass) _ass=no ;;
1117 --enable-rpath) _rpath=yes ;;
1118 --disable-rpath) _rpath=no ;;
1119 --enable-color-console) _color_console=yes ;;
1120 --disable-color-console) _color_console=no ;;
1122 --enable-fribidi) _fribidi=yes ;;
1123 --disable-fribidi) _fribidi=no ;;
1125 --enable-enca) _enca=yes ;;
1126 --disable-enca) _enca=no ;;
1128 --enable-inet6) _inet6=yes ;;
1129 --disable-inet6) _inet6=no ;;
1131 --enable-gethostbyname2) _gethostbyname2=yes ;;
1132 --disable-gethostbyname2) _gethostbyname2=no ;;
1134 --enable-dga1) _dga1=yes ;;
1135 --disable-dga1) _dga1=no ;;
1136 --enable-dga2) _dga2=yes ;;
1137 --disable-dga2) _dga2=no ;;
1139 --enable-menu) _menu=yes ;;
1140 --disable-menu) _menu=no ;;
1142 --enable-qtx) _qtx=yes ;;
1143 --disable-qtx) _qtx=no ;;
1145 --enable-macosx) _macosx=yes ;;
1146 --disable-macosx) _macosx=no ;;
1147 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1148 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1149 --enable-macosx-bundle) _macosx_bundle=yes;;
1150 --disable-macosx-bundle) _macosx_bundle=no;;
1152 --enable-maemo) _maemo=yes ;;
1153 --disable-maemo) _maemo=no ;;
1155 --enable-sortsub) _sortsub=yes ;;
1156 --disable-sortsub) _sortsub=no ;;
1158 --enable-crash-debug) _crash_debug=yes ;;
1159 --disable-crash-debug) _crash_debug=no ;;
1160 --enable-sighandler) _sighandler=yes ;;
1161 --disable-sighandler) _sighandler=no ;;
1162 --enable-win32dll) _win32dll=yes ;;
1163 --disable-win32dll) _win32dll=no ;;
1165 --enable-sse) _sse=yes ;;
1166 --disable-sse) _sse=no ;;
1167 --enable-sse2) _sse2=yes ;;
1168 --disable-sse2) _sse2=no ;;
1169 --enable-ssse3) _ssse3=yes ;;
1170 --disable-ssse3) _ssse3=no ;;
1171 --enable-mmxext) _mmxext=yes ;;
1172 --disable-mmxext) _mmxext=no ;;
1173 --enable-3dnow) _3dnow=yes ;;
1174 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1175 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1176 --disable-3dnowext) _3dnowext=no ;;
1177 --enable-cmov) _cmov=yes ;;
1178 --disable-cmov) _cmov=no ;;
1179 --enable-fast-cmov) _fast_cmov=yes ;;
1180 --disable-fast-cmov) _fast_cmov=no ;;
1181 --enable-altivec) _altivec=yes ;;
1182 --disable-altivec) _altivec=no ;;
1183 --enable-armv5te) _armv5te=yes ;;
1184 --disable-armv5te) _armv5te=no ;;
1185 --enable-armv6) _armv6=yes ;;
1186 --disable-armv6) _armv6=no ;;
1187 --enable-iwmmxt) _iwmmxt=yes ;;
1188 --disable-iwmmxt) _iwmmxt=no ;;
1189 --enable-mmx) _mmx=yes ;;
1190 --disable-mmx) # 3Dnow! and MMX2 require MMX
1191 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1194 echo "Unknown parameter: $ac_option"
1195 exit 1
1198 esac
1199 done
1201 # Atmos: moved this here, to be correct, if --prefix is specified
1202 test -z "$_bindir" && _bindir="$_prefix/bin"
1203 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1204 test -z "$_mandir" && _mandir="$_prefix/share/man"
1205 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1206 test -z "$_libdir" && _libdir="$_prefix/lib"
1208 # Determine our OS name and CPU architecture
1209 if test -z "$_target" ; then
1210 # OS name
1211 system_name=`uname -s 2>&1`
1212 case "$system_name" in
1213 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX|AmigaOS)
1215 IRIX*)
1216 system_name=IRIX
1218 GNU/kFreeBSD)
1219 system_name=FreeBSD
1221 HP-UX*)
1222 system_name=HP-UX
1224 [cC][yY][gG][wW][iI][nN]*)
1225 system_name=CYGWIN
1227 MINGW32*)
1228 system_name=MINGW32
1231 system_name="$system_name-UNKNOWN"
1233 esac
1236 # host's CPU/instruction set
1237 host_arch=`uname -p 2>&1`
1238 case "$host_arch" in
1239 i386|sparc|ppc|alpha|arm|sh3|mips|vax)
1241 powerpc) # Darwin returns 'powerpc'
1242 host_arch=ppc
1244 *) # uname -p on Linux returns 'unknown' for the processor type,
1245 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1247 # Maybe uname -m (machine hardware name) returns something we
1248 # recognize.
1250 # x86/x86pc is used by QNX
1251 case "`uname -m 2>&1`" in
1252 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 ;;
1253 ia64) host_arch=ia64 ;;
1254 x86_64|amd64)
1255 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1256 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1257 host_arch=x86_64
1258 else
1259 host_arch=i386
1262 macppc|ppc|ppc64) host_arch=ppc ;;
1263 alpha) host_arch=alpha ;;
1264 sparc) host_arch=sparc ;;
1265 sparc64) host_arch=sparc64 ;;
1266 parisc*|hppa*|9000*) host_arch=hppa ;;
1267 arm*|zaurus|cats) host_arch=arm ;;
1268 sh3) host_arch=sh3 ;;
1269 s390) host_arch=s390 ;;
1270 s390x) host_arch=s390x ;;
1271 mips*) host_arch=mips ;;
1272 vax) host_arch=vax ;;
1273 *) host_arch=UNKNOWN ;;
1274 esac
1276 esac
1277 else # if test -z "$_target"
1278 system_name=`echo $_target | cut -d '-' -f 2`
1279 case "`echo $system_name | tr A-Z a-z`" in
1280 linux) system_name=Linux ;;
1281 freebsd) system_name=FreeBSD ;;
1282 gnu/kfreebsd) system_name=FreeBSD ;;
1283 netbsd) system_name=NetBSD ;;
1284 bsd/os) system_name=BSD/OS ;;
1285 openbsd) system_name=OpenBSD ;;
1286 sunos) system_name=SunOS ;;
1287 qnx) system_name=QNX ;;
1288 morphos) system_name=MorphOS ;;
1289 amigaos) system_name=AmigaOS ;;
1290 mingw32msvc) system_name=MINGW32 ;;
1291 esac
1292 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1293 host_arch=`echo $_target | cut -d '-' -f 1`
1294 if test `echo $host_arch` != "x86_64" ; then
1295 host_arch=`echo $host_arch | tr '_' '-'`
1299 echo "Detected operating system: $system_name"
1300 echo "Detected host architecture: $host_arch"
1302 if test "$_runtime_cpudetection" = yes && not x86 && not ppc; then
1303 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1307 if openbsd ; then
1308 _ldconfig="ldconfig -R"
1311 if freebsd ; then
1312 _ld_extra="$_ld_extra -L/usr/local/lib"
1313 _inc_extra="$_inc_extra -I/usr/local/include"
1316 if darwin; then
1317 _ld_extra="$_ld_extra -L/usr/local/lib"
1318 _inc_extra="$_inc_extra -I/usr/local/include"
1321 if aix ; then
1322 _ld_extra="$_ld_extra -lC"
1325 if irix ; then
1326 _ranlib='ar -r'
1327 elif linux ; then
1328 _ranlib='true'
1331 if win32 ; then
1332 _exesuf=".exe"
1333 # -lwinmm is always needed for osdep/timer-win2.c
1334 _ld_extra="$_ld_extra -lwinmm"
1335 _confwin32='TARGET_WIN32 = yes'
1336 else
1337 _confwin32='TARGET_WIN32 = no'
1340 if mingw32 ; then
1341 _need_shmem=no
1344 if cygwin ; then
1345 _def_confwin32='#define WIN32'
1348 if amigaos ; then
1349 _select=no
1350 _sighandler=no
1351 _stream_cache=no
1352 _def_stream_cache="#undef USE_STREAM_CACHE"
1355 if qnx ; then
1356 _ld_extra="$_ld_extra -lph"
1359 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1360 test "$I" && break
1361 done
1364 TMPLOG="configure.log"
1365 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1366 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1367 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1368 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1369 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1371 rm -f "$TMPLOG"
1372 echo configuration: $_configuration > "$TMPLOG"
1373 echo >> "$TMPLOG"
1376 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1377 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1378 # know about '-n'.
1379 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1380 _head() { head -$1 2>/dev/null ; }
1381 else
1382 _head() { head -n $1 2>/dev/null ; }
1384 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1385 _tail() { tail -$1 2>/dev/null ; }
1386 else
1387 _tail() { tail -n $1 2>/dev/null ; }
1390 # Checking CC version...
1391 if test "$_gcc_check" = yes ; then
1392 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1393 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1394 echocheck "$_cc version"
1395 cc_vendor=intel
1396 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1397 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1398 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1399 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1400 # TODO verify older icc/ecc compatibility
1401 case $cc_version in
1403 cc_version="v. ?.??, bad"
1404 cc_verc_fail=yes
1406 8.0|9.1|10.0)
1407 cc_version="$cc_version, ok"
1408 cc_verc_fail=no
1411 cc_version="$cc_version, bad"
1412 cc_verc_fail=yes
1414 esac
1415 echores "$cc_version"
1416 else
1417 for _cc in "$_cc" gcc cc ; do
1418 echocheck "$_cc version"
1419 cc_vendor=gnu
1420 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1421 cc_version=`$_cc -dumpversion 2>&1`
1422 if test "$?" -gt 0; then
1423 cc_version="not found"
1425 case $cc_version in
1427 cc_version="v. ?.??, bad"
1428 cc_verc_fail=yes
1430 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1431 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1432 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1433 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1434 cc_version="$cc_version, ok"
1435 cc_verc_fail=no
1437 'not found')
1438 cc_verc_fail=yes
1441 cc_version="$cc_version, bad"
1442 cc_verc_fail=yes
1444 esac
1445 echores "$cc_version"
1446 test "$cc_verc_fail" = "no" && break
1447 done
1448 fi # icc
1449 if test "$cc_verc_fail" = yes ; then
1450 cat <<EOF
1452 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1454 You are not using a supported compiler. We do not have the time to make sure
1455 everything works with compilers other than the ones we use. Use either the
1456 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1457 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1459 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1460 mplayer and lame (which is used for mencoder). If you get compile errors,
1461 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1462 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1463 bugs!
1465 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1468 die "Bad gcc version"
1470 else
1471 cat <<EOF
1473 ******************************************************************************
1475 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1476 Ok. You know. Do it.
1478 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1479 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1480 Lame which is used by mencoder produces weird errors, too.
1482 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1483 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1485 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1487 ******************************************************************************
1491 read _answer
1494 echocheck "host cc"
1495 test "$_host_cc" || _host_cc=$_cc
1496 echores $_host_cc
1498 echocheck "cross compilation"
1499 if test $_cross_compile = auto ; then
1500 cat > $TMPC << EOF
1501 int main(void) { return 0; }
1503 _cross_compile=yes
1504 cc_check && "$TMPEXE" && _cross_compile=no
1506 echores $_cross_compile
1508 if test $_cross_compile = yes; then
1509 tmp_run() {
1510 return 0
1514 # ---
1516 # now that we know what compiler should be used for compilation, try to find
1517 # out which assembler is used by the $_cc compiler
1518 if test "$_as" = auto ; then
1519 _as=`$_cc -print-prog-name=as`
1520 test -z "$_as" && _as=as
1523 # XXX: this should be ok..
1524 _cpuinfo="echo"
1526 if test "$_runtime_cpudetection" = no ; then
1528 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1529 # FIXME: Remove the cygwin check once AMD CPUs are supported
1530 if test -r /proc/cpuinfo && not cygwin; then
1531 # Linux with /proc mounted, extract CPU information from it
1532 _cpuinfo="cat /proc/cpuinfo"
1533 elif test -r /compat/linux/proc/cpuinfo && not x86_32 ; then
1534 # FreeBSD with Linux emulation /proc mounted,
1535 # extract CPU information from it
1536 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1537 elif darwin && not x86_32 ; then
1538 # use hostinfo on Darwin
1539 _cpuinfo="hostinfo"
1540 elif aix; then
1541 # use 'lsattr' on AIX
1542 _cpuinfo="lsattr -E -l proc0 -a type"
1543 elif x86; then
1544 # all other OSes try to extract CPU information from a small helper
1545 # program cpuinfo instead
1546 $_cc -o cpuinfo$_exesuf cpuinfo.c
1547 _cpuinfo="./cpuinfo$_exesuf"
1550 if x86 ; then
1551 # gather more CPU information
1552 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1553 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1554 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1555 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1556 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1558 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1560 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1561 -e s/xmm/sse/ -e s/kni/sse/`
1563 for ext in $pparam ; do
1564 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1565 done
1567 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1568 test $_sse = kernel_check && _mmxext=kernel_check
1570 echocheck "CPU vendor"
1571 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1573 echocheck "CPU type"
1574 echores "$pname"
1577 fi # test "$_runtime_cpudetection" = no
1579 if x86 && test "$_runtime_cpudetection" = no ; then
1580 extcheck() {
1581 if test "$1" = kernel_check ; then
1582 echocheck "kernel support of $2"
1583 cat > $TMPC <<EOF
1584 #include <signal.h>
1585 void catch() { exit(1); }
1586 int main(void){
1587 signal(SIGILL, catch);
1588 __asm__ __volatile__ ("$3":::"memory");return(0);
1592 if cc_check && tmp_run ; then
1593 eval _$2=yes
1594 echores "yes"
1595 _optimizing="$_optimizing $2"
1596 return 0
1597 else
1598 eval _$2=no
1599 echores "failed"
1600 echo "It seems that your kernel does not correctly support $2."
1601 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1602 return 1
1605 return 0
1608 extcheck $_mmx "mmx" "emms"
1609 extcheck $_mmxext "mmxext" "sfence"
1610 extcheck $_3dnow "3dnow" "femms"
1611 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1612 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1613 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1614 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1615 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1617 echocheck "mtrr support"
1618 if test "$_mtrr" = kernel_check ; then
1619 _mtrr="yes"
1620 _optimizing="$_optimizing mtrr"
1622 echores "$_mtrr"
1624 if test "$_gcc3_ext" != ""; then
1625 # if we had to disable sse/sse2 because the active kernel does not
1626 # support this instruction set extension, we also have to tell
1627 # gcc3 to not generate sse/sse2 instructions for normal C code
1628 cat > $TMPC << EOF
1629 int main(void) { return 0; }
1631 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1637 _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM ARMV4L SH3 POWERPC PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN GENERIC'
1638 case "$host_arch" in
1639 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1640 _arch='X86 X86_32'
1641 _target_arch_x86="ARCH_X86 = yes"
1642 _target_arch="ARCH_X86_32 = yes"
1643 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1644 iproc=486
1645 proc=i486
1648 if test "$_runtime_cpudetection" = no ; then
1649 case "$pvendor" in
1650 AuthenticAMD)
1651 case "$pfamily" in
1652 3) proc=i386 iproc=386 ;;
1653 4) proc=i486 iproc=486 ;;
1654 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1655 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1656 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1657 proc=k6-3
1658 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1659 proc=geode
1660 elif test "$pmodel" -ge 8; then
1661 proc=k6-2
1662 elif test "$pmodel" -ge 6; then
1663 proc=k6
1664 else
1665 proc=i586
1668 6) iproc=686
1669 # It's a bit difficult to determine the correct type of Family 6
1670 # AMD CPUs just from their signature. Instead, we check directly
1671 # whether it supports SSE.
1672 if test "$_sse" = yes; then
1673 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1674 proc=athlon-xp
1675 else
1676 # Again, gcc treats athlon and athlon-tbird similarly.
1677 proc=athlon
1680 15) iproc=686
1681 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1682 # caught and remedied in the optimization tests below.
1683 proc=k8
1686 *) proc=k8 iproc=686 ;;
1687 esac
1689 GenuineIntel)
1690 case "$pfamily" in
1691 3) proc=i386 iproc=386 ;;
1692 4) proc=i486 iproc=486 ;;
1693 5) iproc=586
1694 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1695 proc=pentium-mmx # 4 is desktop, 8 is mobile
1696 else
1697 proc=i586
1700 6) iproc=686
1701 if test "$pmodel" -ge 15; then
1702 proc=core2
1703 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1704 proc=pentium-m
1705 elif test "$pmodel" -ge 7; then
1706 proc=pentium3
1707 elif test "$pmodel" -ge 3; then
1708 proc=pentium2
1709 else
1710 proc=i686
1713 15) iproc=686
1714 # A nocona in 32-bit mode has no more capabilities than a prescott.
1715 if test "$pmodel" -ge 3; then
1716 proc=prescott
1717 else
1718 proc=pentium4
1720 test $_fast_cmov = "auto" && _fast_cmov=no
1722 *) proc=prescott iproc=686 ;;
1723 esac
1725 CentaurHauls)
1726 case "$pfamily" in
1727 5) iproc=586
1728 if test "$pmodel" -ge 8; then
1729 proc=winchip2
1730 elif test "$pmodel" -ge 4; then
1731 proc=winchip-c6
1732 else
1733 proc=i586
1736 6) iproc=686
1737 if test "$pmodel" -ge 9; then
1738 proc=c3-2
1739 else
1740 proc=c3
1741 iproc=586
1744 *) proc=i686 iproc=i686 ;;
1745 esac
1747 unknown)
1748 case "$pfamily" in
1749 3) proc=i386 iproc=386 ;;
1750 4) proc=i486 iproc=486 ;;
1751 *) proc=i586 iproc=586 ;;
1752 esac
1755 proc=i586 iproc=586 ;;
1756 esac
1757 fi # test "$_runtime_cpudetection" = no
1760 # check that gcc supports our CPU, if not, fall back to earlier ones
1761 # LGB: check -mcpu and -march swithing step by step with enabling
1762 # to fall back till 386.
1764 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1766 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1767 cpuopt=-mtune
1768 else
1769 cpuopt=-mcpu
1772 echocheck "GCC & CPU optimization abilities"
1773 cat > $TMPC << EOF
1774 int main(void) { return 0; }
1776 if test "$_runtime_cpudetection" = no ; then
1777 cc_check -march=native && proc=native
1778 if test "$proc" = "k8"; then
1779 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1781 if test "$proc" = "athlon-xp"; then
1782 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1784 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1785 cc_check -march=$proc $cpuopt=$proc || proc=k6
1787 if test "$proc" = "k6" || test "$proc" = "c3"; then
1788 if not cc_check -march=$proc $cpuopt=$proc; then
1789 if cc_check -march=i586 $cpuopt=i686; then
1790 proc=i586-i686
1791 else
1792 proc=i586
1796 if test "$proc" = "prescott" ; then
1797 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1799 if test "$proc" = "core2" ; then
1800 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1802 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
1803 cc_check -march=$proc $cpuopt=$proc || proc=i686
1805 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1806 cc_check -march=$proc $cpuopt=$proc || proc=i586
1808 if test "$proc" = "i586"; then
1809 cc_check -march=$proc $cpuopt=$proc || proc=i486
1811 if test "$proc" = "i486" ; then
1812 cc_check -march=$proc $cpuopt=$proc || proc=i386
1814 if test "$proc" = "i386" ; then
1815 cc_check -march=$proc $cpuopt=$proc || proc=error
1817 if test "$proc" = "error" ; then
1818 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1819 _mcpu=""
1820 _march=""
1821 _optimizing=""
1822 elif test "$proc" = "i586-i686"; then
1823 _march="-march=i586"
1824 _mcpu="$cpuopt=i686"
1825 _optimizing="$proc"
1826 else
1827 _march="-march=$proc"
1828 _mcpu="$cpuopt=$proc"
1829 _optimizing="$proc"
1831 else # if test "$_runtime_cpudetection" = no
1832 _mcpu="$cpuopt=generic"
1833 # at least i486 required, for bswap instruction
1834 _march="-march=i486"
1835 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1836 cc_check $_mcpu || _mcpu=""
1837 cc_check $_march $_mcpu || _march=""
1840 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1841 ## autodetected mcpu/march parameters
1842 if test "$_target" ; then
1843 # TODO: it may be a good idea to check GCC and fall back in all cases
1844 if test "$host_arch" = "i586-i686"; then
1845 _march="-march=i586"
1846 _mcpu="$cpuopt=i686"
1847 else
1848 _march="-march=$host_arch"
1849 _mcpu="$cpuopt=$host_arch"
1852 proc="$host_arch"
1854 case "$proc" in
1855 i386) iproc=386 ;;
1856 i486) iproc=486 ;;
1857 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1858 i686|athlon*|pentium*) iproc=686 ;;
1859 *) iproc=586 ;;
1860 esac
1863 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1864 _fast_cmov="yes"
1865 else
1866 _fast_cmov="no"
1869 echores "$proc"
1872 ia64)
1873 _arch='IA64'
1874 _target_arch='ARCH_IA64 = yes'
1875 iproc='ia64'
1876 proc=''
1877 _march=''
1878 _mcpu=''
1879 _optimizing=''
1882 x86_64|amd64)
1883 _arch='X86 X86_64'
1884 _target_arch='ARCH_X86_64 = yes'
1885 _target_arch_x86="ARCH_X86 = yes"
1886 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1887 iproc='x86_64'
1889 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1890 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1891 cpuopt=-mtune
1892 else
1893 cpuopt=-mcpu
1895 if test "$_runtime_cpudetection" = no ; then
1896 case "$pvendor" in
1897 AuthenticAMD)
1898 proc=k8;;
1899 GenuineIntel)
1900 case "$pfamily" in
1901 6) proc=core2;;
1903 # 64-bit prescotts exist, but as far as GCC is concerned they
1904 # have the same capabilities as a nocona.
1905 proc=nocona
1906 test $_fast_cmov = "auto" && _fast_cmov=no
1908 esac
1911 proc=error;;
1912 esac
1913 fi # test "$_runtime_cpudetection" = no
1915 echocheck "GCC & CPU optimization abilities"
1916 cat > $TMPC << EOF
1917 int main(void) { return 0; }
1919 # This is a stripped-down version of the i386 fallback.
1920 if test "$_runtime_cpudetection" = no ; then
1921 cc_check -march=native && proc=native
1922 # --- AMD processors ---
1923 if test "$proc" = "k8"; then
1924 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1926 # This will fail if gcc version < 3.3, which is ok because earlier
1927 # versions don't really support 64-bit on amd64.
1928 # Is this a valid assumption? -Corey
1929 if test "$proc" = "athlon-xp"; then
1930 cc_check -march=$proc $cpuopt=$proc || proc=error
1932 # --- Intel processors ---
1933 if test "$proc" = "core2"; then
1934 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1936 if test "$proc" = "nocona"; then
1937 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1939 if test "$proc" = "pentium4"; then
1940 cc_check -march=$proc $cpuopt=$proc || proc=error
1943 _march="-march=$proc"
1944 _mcpu="$cpuopt=$proc"
1945 if test "$proc" = "error" ; then
1946 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1947 _mcpu=""
1948 _march=""
1950 else # if test "$_runtime_cpudetection" = no
1951 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1952 _march="-march=x86-64"
1953 _mcpu="$cpuopt=generic"
1954 cc_check $_mcpu || _mcpu="x86-64"
1955 cc_check $_mcpu || _mcpu=""
1956 cc_check $_march $_mcpu || _march=""
1959 _optimizing=""
1961 echores "$proc"
1964 sparc)
1965 _arch='SPARC'
1966 _target_arch='ARCH_SPARC = yes'
1967 iproc='sparc'
1968 if sunos ; then
1969 echocheck "CPU type"
1970 karch=`uname -m`
1971 case "`echo $karch`" in
1972 sun4) proc=v7 ;;
1973 sun4c) proc=v7 ;;
1974 sun4d) proc=v8 ;;
1975 sun4m) proc=v8 ;;
1976 sun4u) proc=ultrasparc _vis='yes' ;;
1977 sun4v) proc=v9 ;;
1978 *) proc=v8 ;;
1979 esac
1980 echores "$proc"
1981 else
1982 proc=v8
1984 _march=''
1985 _mcpu="-mcpu=$proc"
1986 _optimizing="$proc"
1989 sparc64)
1990 _arch='SPARC'
1991 _target_arch='ARCH_SPARC = yes'
1992 _vis='yes'
1993 iproc='sparc'
1994 proc='ultrasparc'
1995 _march=''
1996 _mcpu="-mcpu=$proc"
1997 _optimizing="$proc"
2000 arm|armv4l|armv5tel)
2001 _arch='ARM ARMV4L'
2002 _target_arch='ARCH_ARMV4L = yes'
2003 iproc='arm'
2004 proc=''
2005 _march=''
2006 _mcpu=''
2007 _optimizing=''
2010 sh3)
2011 _arch='SH3'
2012 _target_arch='ARCH_SH3 = yes'
2013 iproc='sh3'
2014 proc=''
2015 _march='-m3'
2016 _mcpu='-ml'
2017 _optimizing=''
2020 ppc|powerpc)
2021 _arch='POWERPC PPC'
2022 _def_dcbzl='#undef HAVE_DCBZL'
2023 _target_arch='ARCH_POWERPC = yes'
2024 iproc='ppc'
2025 proc=''
2026 _march=''
2027 _mcpu=''
2028 _optimizing=''
2030 echocheck "CPU type"
2031 case $system_name in
2032 Linux)
2033 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2034 if test -n "`$_cpuinfo | grep altivec`"; then
2035 test $_altivec = auto && _altivec=yes
2038 Darwin)
2039 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2040 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2041 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2042 test $_altivec = auto && _altivec=yes
2045 NetBSD)
2046 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2047 case $cc_version in
2048 2*|3.0*|3.1*|3.2*|3.3*)
2051 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2052 test $_altivec = auto && _altivec=yes
2055 esac
2057 AIX)
2058 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2060 esac
2061 if test "$_altivec" = yes; then
2062 echores "$proc altivec"
2063 else
2064 _altivec=no
2065 echores "$proc"
2068 echocheck "GCC & CPU optimization abilities"
2070 if test -n "$proc"; then
2071 case "$proc" in
2072 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2073 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2074 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2075 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2076 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2077 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2078 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2079 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2080 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2081 *) ;;
2082 esac
2083 # gcc 3.1(.1) and up supports 7400 and 7450
2084 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2085 case "$proc" in
2086 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2087 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2088 *) ;;
2089 esac
2091 # gcc 3.2 and up supports 970
2092 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2093 case "$proc" in
2094 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2095 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2096 *) ;;
2097 esac
2099 # gcc 3.3 and up supports POWER4
2100 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2101 case "$proc" in
2102 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2103 *) ;;
2104 esac
2106 # gcc 3.4 and up supports 440*
2107 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2108 case "$proc" in
2109 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2110 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2111 *) ;;
2112 esac
2114 # gcc 4.0 and up supports POWER5
2115 if test "$_cc_major" -ge "4"; then
2116 case "$proc" in
2117 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2118 *) ;;
2119 esac
2123 if test -n "$_mcpu"; then
2124 _optimizing=`echo $_mcpu | cut -c 8-`
2125 echores "$_optimizing"
2126 else
2127 echores "none"
2132 alpha)
2133 _arch='ALPHA'
2134 _target_arch='ARCH_ALPHA = yes'
2135 iproc='alpha'
2136 _march=''
2138 echocheck "CPU type"
2139 cat > $TMPC << EOF
2140 int main(void) {
2141 unsigned long ver, mask;
2142 asm ("implver %0" : "=r" (ver));
2143 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2144 printf("%ld-%x\n", ver, ~mask);
2145 return 0;
2148 $_cc -o "$TMPEXE" "$TMPC"
2149 case `"$TMPEXE"` in
2151 0-0) proc="ev4"; _mvi="0";;
2152 1-0) proc="ev5"; _mvi="0";;
2153 1-1) proc="ev56"; _mvi="0";;
2154 1-101) proc="pca56"; _mvi="1";;
2155 2-303) proc="ev6"; _mvi="1";;
2156 2-307) proc="ev67"; _mvi="1";;
2157 2-1307) proc="ev68"; _mvi="1";;
2158 esac
2159 echores "$proc"
2161 echocheck "GCC & CPU optimization abilities"
2162 if test "$proc" = "ev68" ; then
2163 cc_check -mcpu=$proc || proc=ev67
2165 if test "$proc" = "ev67" ; then
2166 cc_check -mcpu=$proc || proc=ev6
2168 _mcpu="-mcpu=$proc"
2169 echores "$proc"
2171 _optimizing="$proc"
2173 echocheck "MVI instruction support in GCC"
2174 if test "$_cc_major" -ge "3" && test "$_mvi" = "1" ; then
2175 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2176 echores "yes"
2177 else
2178 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2179 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2183 mips)
2184 _arch='SGI_MIPS'
2185 _target_arch='ARCH_SGI_MIPS = yes'
2186 iproc='sgi-mips'
2187 proc=''
2188 _march=''
2189 _mcpu=''
2190 _optimizing=''
2192 if irix ; then
2193 echocheck "CPU type"
2194 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2195 case "`echo $proc`" in
2196 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2197 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2198 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2199 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2200 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2201 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2202 esac
2203 # gcc < 3.x does not support -mtune.
2204 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2205 _mcpu=''
2207 echores "$proc"
2212 hppa)
2213 _arch='PA_RISC'
2214 _target_arch='ARCH_PA_RISC = yes'
2215 iproc='PA-RISC'
2216 proc=''
2217 _march=''
2218 _mcpu=''
2219 _optimizing=''
2222 s390)
2223 _arch='S390'
2224 _target_arch='ARCH_S390 = yes'
2225 iproc='390'
2226 proc=''
2227 _march=''
2228 _mcpu=''
2229 _optimizing=''
2232 s390x)
2233 _arch='S390X'
2234 _target_arch='ARCH_S390X = yes'
2235 iproc='390x'
2236 proc=''
2237 _march=''
2238 _mcpu=''
2239 _optimizing=''
2242 vax)
2243 _arch='VAX'
2244 _target_arch='ARCH_VAX = yes'
2245 iproc='vax'
2246 proc=''
2247 _march=''
2248 _mcpu=''
2249 _optimizing=''
2252 generic)
2253 _arch='GENERIC'
2254 _target_arch='ARCH_GENERIC = yes'
2255 iproc=''
2256 proc=''
2257 _march=''
2258 _mcpu=''
2259 _optimizing=''
2263 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2264 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2265 die "unsupported architecture $host_arch"
2267 esac # case "$host_arch" in
2269 if test "$_runtime_cpudetection" = yes ; then
2270 if x86 ; then
2271 test "$_cmov" != no && _cmov=yes
2272 x86_32 && _cmov=no
2273 test "$_mmx" != no && _mmx=yes
2274 test "$_3dnow" != no && _3dnow=yes
2275 test "$_3dnowext" != no && _3dnowext=yes
2276 test "$_mmxext" != no && _mmxext=yes
2277 test "$_sse" != no && _sse=yes
2278 test "$_sse2" != no && _sse2=yes
2279 test "$_ssse3" != no && _ssse3=yes
2280 test "$_mtrr" != no && _mtrr=yes
2282 if ppc; then
2283 _altivec=yes
2289 echocheck "assembler support of -pipe option"
2290 cat > $TMPC << EOF
2291 int main(void) { return 0; }
2293 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2296 echocheck "compiler support of named assembler arguments"
2297 _named_asm_args=yes
2298 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2299 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2300 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2301 _named_asm_args=no
2302 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2304 echores $_named_asm_args
2307 if darwin && test "$cc_vendor" = "gnu" ; then
2308 echocheck "GCC support of -mstackrealign"
2309 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2310 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2311 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2312 # wrong code with this flag, but this can be worked around by adding
2313 # -fno-unit-at-a-time as described in the blog post at
2314 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2315 cat > $TMPC << EOF
2316 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2317 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2319 cc_check -O4 -mstackrealign && tmp_run && _stackrealign=-mstackrealign
2320 test -z "$_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2321 && tmp_run && _stackrealign="-mstackrealign -fno-unit-at-a-time"
2322 test -n "$_stackrealign" && echores "yes" || echores "no"
2323 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2326 # Checking for CFLAGS
2327 _install_strip="-s"
2328 if test "$_profile" != "" || test "$_debug" != "" ; then
2329 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2330 _install_strip=
2331 elif test -z "$CFLAGS" ; then
2332 if test "$cc_vendor" = "intel" ; then
2333 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2334 elif test "$cc_vendor" != "gnu" ; then
2335 CFLAGS="-O2 $_march $_mcpu $_pipe"
2336 else
2337 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2339 else
2340 _warn_CFLAGS=yes
2342 if test -n "$LDFLAGS" ; then
2343 _ld_extra="$_ld_extra $LDFLAGS"
2344 _warn_CFLAGS=yes
2345 elif test "$cc_vendor" = "intel" ; then
2346 _ld_extra="$_ld_extra -i-static"
2348 if test -n "$CPPFLAGS" ; then
2349 _inc_extra="$_inc_extra $CPPFLAGS"
2350 _warn_CFLAGS=yes
2355 if x86_32 ; then
2356 # Checking assembler (_as) compatibility...
2357 # Added workaround for older as that reads from stdin by default - atmos
2358 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2359 echocheck "assembler ($_as $as_version)"
2361 _pref_as_version='2.9.1'
2362 echo 'nop' > $TMPS
2363 if test "$_mmx" = yes ; then
2364 echo 'emms' >> $TMPS
2366 if test "$_3dnow" = yes ; then
2367 _pref_as_version='2.10.1'
2368 echo 'femms' >> $TMPS
2370 if test "$_3dnowext" = yes ; then
2371 _pref_as_version='2.10.1'
2372 echo 'pswapd %mm0, %mm0' >> $TMPS
2374 if test "$_mmxext" = yes ; then
2375 _pref_as_version='2.10.1'
2376 echo 'movntq %mm0, (%eax)' >> $TMPS
2378 if test "$_sse" = yes ; then
2379 _pref_as_version='2.10.1'
2380 echo 'xorps %xmm0, %xmm0' >> $TMPS
2382 #if test "$_sse2" = yes ; then
2383 # _pref_as_version='2.11'
2384 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2386 if test "$_cmov" = yes ; then
2387 _pref_as_version='2.10.1'
2388 echo 'cmovb %eax, %ebx' >> $TMPS
2390 if test "$_ssse3" = yes ; then
2391 _pref_as_version='2.16.92'
2392 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2394 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2396 if test "$as_verc_fail" != yes ; then
2397 echores "ok"
2398 else
2399 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2400 echores "failed"
2401 die "obsolete binutils version"
2404 fi #if x86_32
2406 echocheck ".align is a power of two"
2407 if test "$_asmalign_pot" = auto ; then
2408 _asmalign_pot=no
2409 cat > $TMPC << EOF
2410 main(void) { asm (".align 3"); }
2412 cc_check && _asmalign_pot=yes
2414 if test "$_asmalign_pot" = "yes" ; then
2415 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2416 else
2417 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2419 echores $_asmalign_pot
2422 #FIXME: This should happen before the check for CFLAGS..
2423 if ppc ; then
2425 # check if altivec is supported by the compiler, and how to enable it
2427 _altivec_gcc_flags=''
2429 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2430 echocheck "GCC altivec support"
2432 p=''
2433 cat > $TMPC << EOF
2434 int main(void) {
2435 return 0;
2438 FSF_flags='-maltivec -mabi=altivec'
2439 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2441 # check for Darwin-style flags first, since
2442 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2443 # accepts but ignores FSF-style flags...
2445 if test -z "$p"; then
2446 cc_check $Darwin_flags && p='Darwin'
2448 if test -z "$p"; then
2449 cc_check $FSF_flags && p='FSF'
2452 case $p in
2453 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2454 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2455 *) _altivec=no ;;
2456 esac
2458 if test -z "$p"; then
2459 p=none
2460 else
2461 p="$p-style ($_altivec_gcc_flags)"
2464 echores "$p"
2467 # check if <altivec.h> should be included
2469 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2471 if test "$_altivec" = yes ; then
2472 echocheck "altivec.h"
2473 cat > $TMPC << EOF
2474 #include <altivec.h>
2475 int main(void) { return 0; }
2477 _have_altivec_h=no
2478 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2479 if test "$_have_altivec_h" = yes ; then
2480 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2482 echores "$_have_altivec_h"
2485 # disable runtime cpudetection if
2486 # - we cannot generate altivec code
2487 # - altivec is disabled by the user
2489 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2490 _runtime_cpudetection=no
2493 # show that we are optimizing for altivec (if enabled and supported)
2495 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2496 _optimizing="$_optimizing altivec"
2499 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2501 if test "$_altivec" = yes ; then
2502 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2503 #_mcpu="$_mcpu $_altivec_gcc_flags"
2504 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2508 if arm ; then
2509 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2510 if test $_armv5te = "auto" ; then
2511 cat > $TMPC << EOF
2512 int main(void) {
2513 __asm__ __volatile__ ("qadd r0, r0, r0");
2516 _armv5te=no
2517 cc_check && _armv5te=yes
2519 echores "$_armv5te"
2521 echocheck "ARMv6 (SIMD instructions)"
2522 if test $_armv6 = "auto" ; then
2523 cat > $TMPC << EOF
2524 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2526 _armv6=no
2527 cc_check && _armv6=yes
2529 echores "$_armv6"
2531 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2532 if test $_iwmmxt = "auto" ; then
2533 cat > $TMPC << EOF
2534 int main(void) {
2535 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2538 _iwmmxt=no
2539 cc_check && _iwmmxt=yes
2541 echores "$_iwmmxt"
2544 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
2545 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2546 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2547 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2548 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2549 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2550 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2551 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2552 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2553 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2554 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2555 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2556 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2557 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2558 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2559 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2561 # Checking kernel version...
2562 if x86_32 && linux ; then
2563 _k_verc_problem=no
2564 kernel_version=`uname -r 2>&1`
2565 echocheck "$system_name kernel version"
2566 case "$kernel_version" in
2567 '') kernel_version="?.??"; _k_verc_fail=yes;;
2568 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2569 _k_verc_problem=yes;;
2570 esac
2571 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2572 _k_verc_fail=yes
2574 if test "$_k_verc_fail" ; then
2575 echores "$kernel_version, fail"
2576 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2577 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2578 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2579 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2580 echo "2.2.x you must upgrade it to get SSE support!"
2581 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2582 else
2583 echores "$kernel_version, ok"
2587 ######################
2588 # MAIN TESTS GO HERE #
2589 ######################
2592 echocheck "-lposix"
2593 cat > $TMPC <<EOF
2594 int main(void) { return 0; }
2596 if cc_check -lposix ; then
2597 _ld_extra="$_ld_extra -lposix"
2598 echores "yes"
2599 else
2600 echores "no"
2603 echocheck "-lm"
2604 cat > $TMPC <<EOF
2605 int main(void) { return 0; }
2607 if cc_check -lm ; then
2608 _ld_lm="-lm"
2609 echores "yes"
2610 else
2611 _ld_lm=""
2612 echores "no"
2616 echocheck "langinfo"
2617 if test "$_langinfo" = auto ; then
2618 cat > $TMPC <<EOF
2619 #include <langinfo.h>
2620 int main(void) { nl_langinfo(CODESET); return 0; }
2622 _langinfo=no
2623 cc_check && _langinfo=yes
2625 if test "$_langinfo" = yes ; then
2626 _def_langinfo='#define USE_LANGINFO 1'
2627 else
2628 _def_langinfo='#undef USE_LANGINFO'
2630 echores "$_langinfo"
2633 echocheck "language"
2634 test -z "$_language" && _language=$LINGUAS
2635 _language=`echo $_language | sed 's/,/ /g'`
2636 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2637 for lang in $_language ; do
2638 test "$lang" = all && lang=en
2639 if test -f "help/help_mp-${lang}.h" ; then
2640 _language=$lang
2641 break
2642 else
2643 echo ${_echo_n} "$lang not found, ${_echo_c}"
2644 _language=`echo $_language | sed "s/$lang *//"`
2646 done
2647 test -z "$_language" && _language=en
2648 _mp_help="help/help_mp-${_language}.h"
2649 test -f $_mp_help || die "$_mp_help not found"
2650 for lang in $LANGUAGES ; do
2651 if test -f "DOCS/man/$lang/mplayer.1" ; then
2652 MAN_LANG="$lang $MAN_LANG"
2654 done
2655 _doc_lang=$_language
2656 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2657 echores "using $_language (man pages: $MAN_LANG)"
2660 echocheck "enable sighandler"
2661 if test "$_sighandler" = yes ; then
2662 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2663 else
2664 _def_sighandler='#undef ENABLE_SIGHANDLER'
2666 echores "$_sighandler"
2668 echocheck "runtime cpudetection"
2669 if test "$_runtime_cpudetection" = yes ; then
2670 _optimizing="Runtime CPU-Detection enabled"
2671 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2672 else
2673 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2675 echores "$_runtime_cpudetection"
2678 echocheck "restrict keyword"
2679 for restrict_keyword in restrict __restrict __restrict__ ; do
2680 echo "void foo(char * $restrict_keyword p); int main(void){}" > $TMPC
2681 if cc_check; then
2682 _def_restrict_keyword=$restrict_keyword
2683 break;
2685 done
2686 if [ -n "$_def_restrict_keyword" ]; then
2687 echores "$_def_restrict_keyword"
2688 else
2689 echores "none"
2691 # Avoid infinite recursion loop ("#define restrict restrict")
2692 if [ "$_def_restrict_keyword" != "restrict" ]; then
2693 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2694 else
2695 _def_restrict_keyword=""
2699 echocheck "__builtin_expect"
2700 # GCC branch prediction hint
2701 cat > $TMPC << EOF
2702 int foo (int a) {
2703 a = __builtin_expect (a, 10);
2704 return a == 10 ? 0 : 1;
2706 int main(void) { return foo(10) && foo(0); }
2708 _builtin_expect=no
2709 cc_check && _builtin_expect=yes
2710 if test "$_builtin_expect" = yes ; then
2711 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2712 else
2713 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2715 echores "$_builtin_expect"
2718 echocheck "kstat"
2719 cat > $TMPC << EOF
2720 #include <kstat.h>
2721 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2723 _kstat=no
2724 cc_check -lkstat && _kstat=yes
2725 if test "$_kstat" = yes ; then
2726 _def_kstat="#define HAVE_LIBKSTAT 1"
2727 _ld_extra="$_ld_extra -lkstat"
2728 else
2729 _def_kstat="#undef HAVE_LIBKSTAT"
2731 echores "$_kstat"
2734 echocheck "posix4"
2735 # required for nanosleep on some systems
2736 cat > $TMPC << EOF
2737 #include <time.h>
2738 int main(void) { (void) nanosleep(0, 0); return 0; }
2740 _posix4=no
2741 cc_check -lposix4 && _posix4=yes
2742 if test "$_posix4" = yes ; then
2743 _ld_extra="$_ld_extra -lposix4"
2745 echores "$_posix4"
2747 echocheck "lrintf"
2748 cat > $TMPC << EOF
2749 #include <math.h>
2750 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2752 _lrintf=no
2753 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2754 if test "$_lrintf" = yes ; then
2755 _def_lrintf="#define HAVE_LRINTF 1"
2756 else
2757 _def_lrintf="#undef HAVE_LRINTF"
2759 echores "$_lrintf"
2762 echocheck "mkstemp"
2763 cat > $TMPC << EOF
2764 #include <stdlib.h>
2765 int main(void) { char a; mkstemp(&a); return 0; }
2767 _mkstemp=no
2768 cc_check && _mkstemp=yes
2769 if test "$_mkstemp" = yes ; then
2770 _def_mkstemp='#define HAVE_MKSTEMP 1'
2771 else
2772 _def_mkstemp='#undef HAVE_MKSTEMP'
2774 echores "$_mkstemp"
2777 echocheck "nanosleep"
2778 # also check for nanosleep
2779 cat > $TMPC << EOF
2780 #include <time.h>
2781 int main(void) { (void) nanosleep(0, 0); return 0; }
2783 _nanosleep=no
2784 cc_check && _nanosleep=yes
2785 if test "$_nanosleep" = yes ; then
2786 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2787 else
2788 _def_nanosleep='#undef HAVE_NANOSLEEP'
2790 echores "$_nanosleep"
2793 echocheck "socklib"
2794 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2795 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2796 cat > $TMPC << EOF
2797 #include <netdb.h>
2798 #include <sys/socket.h>
2799 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2801 _socklib=no
2802 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2803 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2804 done
2805 if test $_winsock2 = auto && not cygwin ; then
2806 _winsock2=no
2807 cat > $TMPC << EOF
2808 #include <winsock2.h>
2809 int main(void) { (void) gethostbyname(0); return 0; }
2811 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2813 test "$_ld_sock" && _res_comment="using $_ld_sock"
2814 echores "$_socklib"
2817 if test $_winsock2 = yes ; then
2818 _ld_sock="-lws2_32"
2819 _def_winsock2='#define HAVE_WINSOCK2 1'
2820 else
2821 _def_winsock2='#undef HAVE_WINSOCK2'
2825 _use_aton=no
2826 echocheck "inet_pton()"
2827 cat > $TMPC << EOF
2828 #include <sys/types.h>
2829 #include <sys/socket.h>
2830 #include <arpa/inet.h>
2831 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2833 if test "$_winsock2" = yes ; then
2834 _res_comment="using winsock2 functions instead"
2835 echores "no"
2836 elif cc_check $_ld_sock ; then
2837 # NOTE: Linux has libresolv but does not need it
2839 _res_comment="using $_ld_sock"
2840 echores "yes"
2841 elif cc_check $_ld_sock -lresolv ; then
2842 # NOTE: needed for SunOS at least
2843 _ld_sock="$_ld_sock -lresolv"
2844 _res_comment="using $_ld_sock"
2845 echores "yes"
2846 else
2847 _res_comment="trying inet_aton next"
2848 echores "no"
2850 echocheck "inet_aton()"
2851 cat > $TMPC << EOF
2852 #include <sys/types.h>
2853 #include <sys/socket.h>
2854 #include <arpa/inet.h>
2855 int main(void) { (void) inet_aton(0, 0); return 0; }
2857 _use_aton=yes
2858 if cc_check $_ld_sock ; then
2859 # NOTE: Linux has libresolv but does not need it
2861 _res_comment="using $_ld_sock"
2862 elif cc_check $_ld_sock -lresolv ; then
2863 # NOTE: needed for SunOS at least
2864 _ld_sock="$_ld_sock -lresolv"
2865 _res_comment="using $_ld_sock"
2866 else
2867 _use_aton=no
2868 _network=no
2869 _res_comment="network support disabled"
2871 echores "$_use_aton"
2874 _def_use_aton='#undef USE_ATON'
2875 if test "$_use_aton" = yes; then
2876 _def_use_aton='#define USE_ATON 1'
2879 echocheck "network"
2880 # FIXME network check
2881 if test "$_network" = yes ; then
2882 _def_network='#define MPLAYER_NETWORK 1'
2883 _ld_extra="$_ld_extra $_ld_sock"
2884 _inputmodules="network $_inputmodules"
2885 else
2886 _noinputmodules="network $_noinputmodules"
2887 _def_network='#undef MPLAYER_NETWORK'
2888 _ftp=no
2890 echores "$_network"
2892 echocheck "inttypes.h (required)"
2893 cat > $TMPC << EOF
2894 #include <inttypes.h>
2895 int main(void) { return 0; }
2897 _inttypes=no
2898 cc_check && _inttypes=yes
2899 echores "$_inttypes"
2901 if test "$_inttypes" = no ; then
2902 echocheck "bitypes.h (inttypes.h predecessor)"
2903 cat > $TMPC << EOF
2904 #include <sys/bitypes.h>
2905 int main(void) { return 0; }
2907 cc_check && _inttypes=yes
2908 if test "$_inttypes" = yes ; then
2909 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."
2910 else
2911 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2916 echocheck "int_fastXY_t in inttypes.h"
2917 cat > $TMPC << EOF
2918 #include <inttypes.h>
2919 int main(void) {
2920 volatile int_fast16_t v= 0;
2921 return v; }
2923 _fast_inttypes=no
2924 cc_check && _fast_inttypes=yes
2925 if test "$_fast_inttypes" = yes ; then
2926 # nothing to do
2928 else
2929 _def_fast_inttypes='
2930 typedef signed char int_fast8_t;
2931 typedef signed int int_fast16_t;
2932 typedef signed int int_fast32_t;
2933 typedef signed long long int_fast64_t;
2934 typedef unsigned char uint_fast8_t;
2935 typedef unsigned int uint_fast16_t;
2936 typedef unsigned int uint_fast32_t;
2937 typedef unsigned long long uint_fast64_t;'
2939 echores "$_fast_inttypes"
2942 echocheck "word size"
2943 _mp_wordsize="#undef MP_WORDSIZE"
2944 cat > $TMPC << EOF
2945 #include <stdio.h>
2946 #include <sys/types.h>
2947 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2949 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2950 echores "$_wordsize"
2953 echocheck "malloc.h"
2954 cat > $TMPC << EOF
2955 #include <malloc.h>
2956 int main(void) { (void) malloc(0); return 0; }
2958 _malloc=no
2959 cc_check && _malloc=yes
2960 if test "$_malloc" = yes ; then
2961 _def_malloc='#define HAVE_MALLOC_H 1'
2962 else
2963 _def_malloc='#undef HAVE_MALLOC_H'
2965 # malloc.h emits a warning in FreeBSD and OpenBSD
2966 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2967 echores "$_malloc"
2970 echocheck "memalign()"
2971 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2972 cat > $TMPC << EOF
2973 #include <malloc.h>
2974 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2976 _memalign=no
2977 cc_check && _memalign=yes
2978 if test "$_memalign" = yes ; then
2979 _def_memalign='#define HAVE_MEMALIGN 1'
2980 else
2981 _def_memalign='#undef HAVE_MEMALIGN'
2982 _def_map_memalign='#define memalign(a,b) malloc(b)'
2983 not darwin && _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2985 echores "$_memalign"
2988 echocheck "alloca.h"
2989 cat > $TMPC << EOF
2990 #include <alloca.h>
2991 int main(void) { (void) alloca(0); return 0; }
2993 _alloca=no
2994 cc_check && _alloca=yes
2995 if cc_check ; then
2996 _def_alloca='#define HAVE_ALLOCA_H 1'
2997 else
2998 _def_alloca='#undef HAVE_ALLOCA_H'
3000 echores "$_alloca"
3003 echocheck "mman.h"
3004 cat > $TMPC << EOF
3005 #include <sys/types.h>
3006 #include <sys/mman.h>
3007 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3009 _mman=no
3010 cc_check && _mman=yes
3011 if test "$_mman" = yes ; then
3012 _def_mman='#define HAVE_SYS_MMAN_H 1'
3013 else
3014 _def_mman='#undef HAVE_SYS_MMAN_H'
3016 echores "$_mman"
3018 cat > $TMPC << EOF
3019 #include <sys/types.h>
3020 #include <sys/mman.h>
3021 int main(void) { void *p = MAP_FAILED; return 0; }
3023 _mman_has_map_failed=no
3024 cc_check && _mman_has_map_failed=yes
3025 if test "$_mman_has_map_failed" = yes ; then
3026 _def_mman_has_map_failed=''
3027 else
3028 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3031 echocheck "dynamic loader"
3032 cat > $TMPC << EOF
3033 #include <dlfcn.h>
3034 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3036 _dl=no
3037 for _ld_tmp in "" "-ldl" ; do
3038 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3039 done
3040 if test "$_dl" = yes ; then
3041 _def_dl='#define HAVE_LIBDL 1'
3042 else
3043 _def_dl='#undef HAVE_LIBDL'
3045 echores "$_dl"
3048 echocheck "dynamic a/v plugins support"
3049 if test "$_dl" = no ; then
3050 _dynamic_plugins=no
3052 if test "$_dynamic_plugins" = yes ; then
3053 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3054 else
3055 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3057 echores "$_dynamic_plugins"
3060 _def_threads='#undef HAVE_THREADS'
3062 echocheck "pthread"
3063 if test "$_pthreads" = auto ; then
3064 cat > $TMPC << EOF
3065 #include <pthread.h>
3066 void* func(void *arg) { return arg; }
3067 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3069 _pthreads=no
3070 if not hpux ; then
3071 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3072 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3073 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3074 done
3077 if test "$_pthreads" = yes ; then
3078 _res_comment="using $_ld_pthread"
3079 _def_pthreads='#define HAVE_PTHREADS 1'
3080 _def_threads='#define HAVE_THREADS 1'
3081 else
3082 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3083 _def_pthreads='#undef HAVE_PTHREADS'
3084 _nas=no ; _tv_v4l1=no ; _macosx=no
3085 if not mingw32 ; then
3086 _win32dll=no
3089 echores "$_pthreads"
3091 echocheck "w32threads"
3092 if test "$_pthreads" = yes ; then
3093 _res_comment="using pthread instead"
3094 _w32threads=no
3096 if test "$_w32threads" = auto ; then
3097 _w32threads=no
3098 mingw32 && _w32threads=yes
3100 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3101 echores "$_w32threads"
3103 echocheck "rpath"
3104 netbsd &&_rpath=yes
3105 if test "$_rpath" = yes ; then
3106 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3107 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3108 done
3109 _ld_extra=$tmp
3111 echores "$_rpath"
3113 echocheck "iconv"
3114 if test "$_iconv" = auto ; then
3115 cat > $TMPC << EOF
3116 #include <stdio.h>
3117 #include <unistd.h>
3118 #include <iconv.h>
3119 #define INBUFSIZE 1024
3120 #define OUTBUFSIZE 4096
3122 char inbuffer[INBUFSIZE];
3123 char outbuffer[OUTBUFSIZE];
3125 int main(void) {
3126 size_t numread;
3127 iconv_t icdsc;
3128 char *tocode="UTF-8";
3129 char *fromcode="cp1250";
3130 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3131 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3132 char *iptr=inbuffer;
3133 char *optr=outbuffer;
3134 size_t inleft=numread;
3135 size_t outleft=OUTBUFSIZE;
3136 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3137 != (size_t)(-1)) {
3138 write (1, outbuffer, OUTBUFSIZE - outleft);
3141 if (iconv_close(icdsc) == -1)
3146 _iconv=no
3147 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3148 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3149 _iconv=yes && break
3150 done
3152 if test "$_iconv" = yes ; then
3153 _def_iconv='#define USE_ICONV 1'
3154 else
3155 _def_iconv='#undef USE_ICONV'
3157 echores "$_iconv"
3160 echocheck "soundcard.h"
3161 _soundcard_h=no
3162 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3163 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3164 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3165 cat > $TMPC << EOF
3166 #include <$_soundcard_header>
3167 int main(void) { return 0; }
3169 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3170 done
3172 if test "$_soundcard_h" = yes ; then
3173 if test $_soundcard_header = "sys/soundcard.h"; then
3174 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3175 else
3176 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3179 echores "$_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 _def_termios='#undef HAVE_TERMIOS'
3322 _def_termios_h='#undef HAVE_TERMIOS_H'
3323 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3324 if test "$_termios" = auto ; then
3325 _termios=no
3326 for _termios_header in "sys/termios.h" "termios.h"; do
3327 cat > $TMPC <<EOF
3328 #include <$_termios_header>
3329 int main(void) { return 0; }
3331 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3332 done
3335 if test "$_termios" = yes ; then
3336 _def_termios='#define HAVE_TERMIOS 1'
3337 if test "$_termios_header" = "termios.h" ; then
3338 _def_termios_h='#define HAVE_TERMIOS_H 1'
3339 else
3340 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3343 echores "$_termios"
3346 echocheck "shm"
3347 if test "$_shm" = auto ; then
3348 cat > $TMPC << EOF
3349 #include <sys/types.h>
3350 #include <sys/shm.h>
3351 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3353 _shm=no
3354 cc_check && _shm=yes
3356 if test "$_shm" = yes ; then
3357 _def_shm='#define HAVE_SHM 1'
3358 else
3359 _def_shm='#undef HAVE_SHM'
3361 echores "$_shm"
3364 echocheck "strsep()"
3365 cat > $TMPC << EOF
3366 #include <string.h>
3367 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3369 _strsep=no
3370 cc_check && _strsep=yes
3371 if test "$_strsep" = yes ; then
3372 _def_strsep='#define HAVE_STRSEP 1'
3373 _need_strsep=no
3374 else
3375 _def_strsep='#undef HAVE_STRSEP'
3376 _need_strsep=yes
3378 echores "$_strsep"
3381 echocheck "vsscanf()"
3382 cat > $TMPC << EOF
3383 #include <stdarg.h>
3384 int main(void) { vsscanf(0, 0, 0); return 0; }
3386 _vsscanf=no
3387 cc_check && _vsscanf=yes
3388 if test "$_vsscanf" = yes ; then
3389 _def_vsscanf='#define HAVE_VSSCANF 1'
3390 _need_vsscanf=no
3391 else
3392 _def_vsscanf='#undef HAVE_VSSCANF'
3393 _need_vsscanf=yes
3395 echores "$_vsscanf"
3398 echocheck "swab()"
3399 cat > $TMPC << EOF
3400 #include <unistd.h>
3401 int main(void) { swab(0, 0, 0); return 0; }
3403 _swab=no
3404 cc_check && _swab=yes
3405 if test "$_swab" = yes ; then
3406 _def_swab='#define HAVE_SWAB 1'
3407 _need_swab=no
3408 else
3409 _def_swab='#undef HAVE_SWAB'
3410 _need_swab=yes
3412 echores "$_swab"
3414 echocheck "POSIX select()"
3415 cat > $TMPC << EOF
3416 #include <stdio.h>
3417 #include <stdlib.h>
3418 #include <sys/types.h>
3419 #include <string.h>
3420 #include <sys/time.h>
3421 #include <unistd.h>
3422 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3424 _posix_select=no
3425 _def_posix_select='#undef HAVE_POSIX_SELECT'
3426 cc_check && _posix_select=yes \
3427 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3428 echores "$_posix_select"
3431 echocheck "gettimeofday()"
3432 cat > $TMPC << EOF
3433 #include <stdio.h>
3434 #include <sys/time.h>
3435 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3437 _gettimeofday=no
3438 cc_check && _gettimeofday=yes
3439 if test "$_gettimeofday" = yes ; then
3440 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3441 _need_gettimeofday=no
3442 else
3443 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3444 _need_gettimeofday=yes
3446 echores "$_gettimeofday"
3449 echocheck "glob()"
3450 cat > $TMPC << EOF
3451 #include <stdio.h>
3452 #include <glob.h>
3453 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3455 _glob=no
3456 cc_check && _glob=yes
3457 if test "$_glob" = yes ; then
3458 _def_glob='#define HAVE_GLOB 1'
3459 _need_glob=no
3460 else
3461 _def_glob='#undef HAVE_GLOB'
3462 _need_glob=yes
3464 echores "$_glob"
3467 echocheck "setenv()"
3468 cat > $TMPC << EOF
3469 #include <stdlib.h>
3470 int main (void){ setenv("","",0); return 0; }
3472 _setenv=no
3473 cc_check && _setenv=yes
3474 if test "$_setenv" = yes ; then
3475 _def_setenv='#define HAVE_SETENV 1'
3476 _need_setenv=no
3477 else
3478 _def_setenv='#undef HAVE_SETENV'
3479 _need_setenv=yes
3481 echores "$_setenv"
3484 if sunos; then
3485 echocheck "sysi86()"
3486 cat > $TMPC << EOF
3487 #include <sys/sysi86.h>
3488 int main (void) { sysi86(0); return 0; }
3490 _sysi86=no
3491 cc_check && _sysi86=yes
3492 if test "$_sysi86" = yes ; then
3493 _def_sysi86='#define HAVE_SYSI86 1'
3494 cat > $TMPC << EOF
3495 #include <sys/sysi86.h>
3496 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3498 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3499 else
3500 _def_sysi86='#undef HAVE_SYSI86'
3502 echores "$_sysi86"
3503 fi #if sunos
3506 echocheck "sys/sysinfo.h"
3507 cat > $TMPC << EOF
3508 #include <sys/sysinfo.h>
3509 int main(void) {
3510 struct sysinfo s_info;
3511 sysinfo(&s_info);
3512 return 0;
3515 _sys_sysinfo=no
3516 cc_check && _sys_sysinfo=yes
3517 if test "$_sys_sysinfo" = yes ; then
3518 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3519 else
3520 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3522 echores "$_sys_sysinfo"
3525 if darwin; then
3527 echocheck "Mac OS X APIs"
3528 if test "$_macosx" = auto ; then
3529 productName=`/usr/bin/sw_vers -productName`
3530 if test "$productName" = "Mac OS X" ||
3531 test "$productName" = "Mac OS X Server" ; then
3532 _macosx=yes
3533 else
3534 _macosx=no
3535 _def_macosx='#undef MACOSX'
3536 _noaomodules="macosx $_noaomodules"
3537 _novomodules="quartz $_novomodules"
3540 if test "$_macosx" = yes ; then
3541 cat > $TMPC <<EOF
3542 #include <Carbon/Carbon.h>
3543 #include <QuickTime/QuickTime.h>
3544 #include <CoreAudio/CoreAudio.h>
3545 int main(void) {
3546 EnterMovies();
3547 ExitMovies();
3548 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3551 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3552 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3553 _def_macosx='#define MACOSX 1'
3554 _aosrc="$_aosrc ao_macosx.c"
3555 _aomodules="macosx $_aomodules"
3556 _vosrc="$_vosrc vo_quartz.c"
3557 _vomodules="quartz $_vomodules"
3558 else
3559 _macosx=no
3560 _def_macosx='#undef MACOSX'
3561 _noaomodules="macosx $_noaomodules"
3562 _novomodules="quartz $_novomodules"
3564 cat > $TMPC <<EOF
3565 #include <Carbon/Carbon.h>
3566 #include <QuartzCore/CoreVideo.h>
3567 int main(void) {}
3569 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3570 _vosrc="$_vosrc vo_macosx.m"
3571 _vomodules="macosx $_vomodules"
3572 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3573 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3574 _macosx_corevideo=yes
3575 else
3576 _novomodules="macosx $_novomodules"
3577 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3578 _macosx_corevideo=no
3581 echores "$_macosx"
3583 echocheck "Mac OS X Finder Support"
3584 if test "$_macosx_finder_support" = auto ; then
3585 _macosx_finder_support=$_macosx
3587 if test "$_macosx_finder_support" = yes; then
3588 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3589 _macosx_finder_support=yes
3590 else
3591 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3592 _macosx_finder_support=no
3594 echores "$_macosx_finder_support"
3596 echocheck "Mac OS X Bundle file locations"
3597 if test "$_macosx_bundle" = auto ; then
3598 _macosx_bundle=$_macosx_finder_support
3600 if test "$_macosx_bundle" = yes; then
3601 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3602 else
3603 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3604 _macosx_bundle=no
3606 echores "$_macosx_bundle"
3608 echocheck "Apple Remote"
3609 if test "$_apple_remote" = auto ; then
3610 _apple_remote=no
3611 cat > $TMPC <<EOF
3612 #include <stdio.h>
3613 #include <IOKit/IOCFPlugIn.h>
3614 int main (int argc, const char * argv[])
3616 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3617 CFMutableDictionaryRef hidMatchDictionary;
3618 IOReturn ioReturnValue;
3620 // Set up a matching dictionary to search the I/O Registry by class.
3621 // name for all HID class devices
3622 hidMatchDictionary = IOServiceMatching("AppleIRController");
3624 // Now search I/O Registry for matching devices.
3625 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3626 hidMatchDictionary, &hidObjectIterator);
3628 // If search is unsuccessful, return nonzero.
3629 if (ioReturnValue != kIOReturnSuccess ||
3630 !IOIteratorIsValid(hidObjectIterator)) {
3631 return 1;
3633 return 0;
3636 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3638 if test "$_apple_remote" = yes ; then
3639 _def_apple_remote='#define HAVE_APPLE_REMOTE 1'
3640 _ld_extra="$_ld_extra -framework IOKit"
3641 else
3642 _def_apple_remote='#undef HAVE_APPLE_REMOTE'
3644 echores "$_apple_remote"
3646 fi #if darwin
3649 echocheck "pkg-config"
3650 _pkg_config=pkg-config
3651 if `$_pkg_config --version > /dev/null 2>&1`; then
3652 if test "$_ld_static"; then
3653 _pkg_config="$_pkg_config --static"
3655 echores "yes"
3656 else
3657 _pkg_config=false
3658 echores "no"
3662 echocheck "Samba support (libsmbclient)"
3663 if test "$_smbsupport" = yes; then
3664 _ld_extra="$_ld_extra -lsmbclient"
3666 if test "$_smbsupport" = auto; then
3667 _smbsupport=no
3668 cat > $TMPC << EOF
3669 #include <libsmbclient.h>
3670 int main(void) { smbc_opendir("smb://"); return 0; }
3672 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3673 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3674 _smbsupport=yes && break
3675 done
3678 if test "$_smbsupport" = yes; then
3679 _def_smbsupport="#define LIBSMBCLIENT"
3680 _inputmodules="smb $_inputmodules"
3681 else
3682 _def_smbsupport="#undef LIBSMBCLIENT"
3683 _noinputmodules="smb $_noinputmodules"
3685 echores "$_smbsupport"
3688 #########
3689 # VIDEO #
3690 #########
3693 echocheck "tdfxfb"
3694 if test "$_tdfxfb" = yes ; then
3695 _def_tdfxfb='#define HAVE_TDFXFB 1'
3696 _vosrc="$_vosrc vo_tdfxfb.c"
3697 _vomodules="tdfxfb $_vomodules"
3698 else
3699 _def_tdfxfb='#undef HAVE_TDFXFB'
3700 _novomodules="tdfxfb $_novomodules"
3702 echores "$_tdfxfb"
3704 echocheck "s3fb"
3705 if test "$_s3fb" = yes ; then
3706 _def_s3fb='#define HAVE_S3FB 1'
3707 _vosrc="$_vosrc vo_s3fb.c"
3708 _vomodules="s3fb $_vomodules"
3709 else
3710 _def_s3fb='#undef HAVE_S3FB'
3711 _novomodules="s3fb $_novomodules"
3713 echores "$_s3fb"
3715 echocheck "tdfxvid"
3716 if test "$_tdfxvid" = yes ; then
3717 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3718 _vosrc="$_vosrc vo_tdfx_vid.c"
3719 _vomodules="tdfx_vid $_vomodules"
3720 else
3721 _def_tdfxvid='#undef HAVE_TDFX_VID'
3722 _novomodules="tdfx_vid $_novomodules"
3724 echores "$_tdfxvid"
3726 echocheck "xvr100"
3727 if test "$_xvr100" = auto ; then
3728 cat > $TMPC << EOF
3729 #include <unistd.h>
3730 #include <sys/fbio.h>
3731 #include <sys/visual_io.h>
3732 int main(void) {
3733 struct vis_identifier ident;
3734 struct fbgattr attr;
3736 ioctl(0, VIS_GETIDENTIFIER, &ident);
3737 ioctl(0, FBIOGATTR, &attr);
3740 _xvr100=no
3741 cc_check && _xvr100=yes
3743 if test "$_xvr100" = yes ; then
3744 _def_xvr100='#define HAVE_XVR100 1'
3745 _vosrc="$_vosrc vo_xvr100.c"
3746 _vomodules="xvr100 $_vomodules"
3747 else
3748 _def_tdfxvid='#undef HAVE_XVR100'
3749 _novomodules="xvr100 $_novomodules"
3751 echores "$_xvr100"
3753 echocheck "tga"
3754 if test "$_tga" = yes ; then
3755 _def_tga='#define HAVE_TGA 1'
3756 _vosrc="$_vosrc vo_tga.c"
3757 _vomodules="tga $_vomodules"
3758 else
3759 _def_tga='#undef HAVE_TGA'
3760 _novomodules="tga $_novomodules"
3762 echores "$_tga"
3765 echocheck "md5sum support"
3766 if test "$_md5sum" = yes; then
3767 _def_md5sum="#define HAVE_MD5SUM"
3768 _vosrc="$_vosrc vo_md5sum.c"
3769 _vomodules="md5sum $_vomodules"
3770 else
3771 _def_md5sum="#undef HAVE_MD5SUM"
3772 _novomodules="md5sum $_novomodules"
3774 echores "$_md5sum"
3777 echocheck "bl"
3778 if test "$_bl" = yes ; then
3779 _def_bl='#define HAVE_BL 1'
3780 _vosrc="$_vosrc vo_bl.c"
3781 _vomodules="bl $_vomodules"
3782 else
3783 _def_bl='#undef HAVE_BL'
3784 _novomodules="bl $_novomodules"
3786 echores "$_bl"
3789 echocheck "DirectFB"
3790 if test "$_directfb" = auto ; then
3791 _directfb=no
3792 cat > $TMPC <<EOF
3793 #include <directfb.h>
3794 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3796 for _inc_tmp in "" -I/usr/local/include/directfb \
3797 -I/usr/include/directfb -I/usr/local/include; do
3798 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3799 _inc_extra="$_inc_extra $_inc_tmp" && break
3800 done
3803 dfb_version() {
3804 expr $1 \* 65536 + $2 \* 256 + $3
3807 if test "$_directfb" = yes; then
3808 cat > $TMPC << EOF
3809 #include <directfb_version.h>
3811 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3814 if $_cc -E $TMPC $_inc_extra > "$TMPEXE"; then
3815 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'`
3816 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3817 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3818 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3819 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3820 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3821 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3822 _res_comment="$_directfb_version"
3823 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3824 else
3825 _def_directfb_version='#undef DIRECTFBVERSION'
3826 _directfb=no
3827 _res_comment="version >=0.9.13 required"
3829 else
3830 _directfb=no
3831 _res_comment="failed to get version"
3834 echores "$_directfb"
3836 if test "$_directfb" = yes ; then
3837 _def_directfb='#define HAVE_DIRECTFB 1'
3838 _vosrc="$_vosrc vo_directfb2.c"
3839 _vomodules="directfb $_vomodules"
3840 _libs_mplayer="$_libs_mplayer -ldirectfb"
3841 else
3842 _def_directfb='#undef HAVE_DIRECTFB'
3843 _novomodules="directfb $_novomodules"
3845 if test "$_dfbmga" = yes; then
3846 _vosrc="$_vosrc vo_dfbmga.c"
3847 _vomodules="dfbmga $_vomodules"
3848 _def_dfbmga='#define HAVE_DFBMGA 1'
3849 else
3850 _novomodules="dfbmga $_novomodules"
3851 _def_dfbmga='#undef HAVE_DFBMGA'
3855 echocheck "X11 headers presence"
3856 _x11_headers="no"
3857 _res_comment="check if the dev(el) packages are installed"
3858 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3859 if test -f "$I/X11/Xlib.h" ; then
3860 _x11_headers="yes"
3861 _res_comment=""
3862 break
3864 done
3865 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3866 if test -f "$I/X11/Xlib.h" ; then
3867 _inc_extra="$_inc_extra -I$I"
3868 _x11_headers="yes"
3869 _res_comment="using $I"
3870 break
3872 done
3873 echores "$_x11_headers"
3876 echocheck "X11"
3877 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3878 cat > $TMPC <<EOF
3879 #include <X11/Xlib.h>
3880 #include <X11/Xutil.h>
3881 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3883 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3884 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3885 if netbsd; then
3886 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3887 else
3888 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3890 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3891 && _x11=yes && break
3892 done
3894 if test "$_x11" = yes ; then
3895 _def_x11='#define HAVE_X11 1'
3896 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3897 _vomodules="x11 xover $_vomodules"
3898 else
3899 _x11=no
3900 _def_x11='#undef HAVE_X11'
3901 _novomodules="x11 $_novomodules"
3902 _res_comment="check if the dev(el) packages are installed"
3903 # disable stuff that depends on X
3904 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
3906 echores "$_x11"
3909 echocheck "DPMS"
3910 _xdpms3=no
3911 _xdpms4=no
3912 if test "$_x11" = yes ; then
3913 cat > $TMPC <<EOF
3914 #include <X11/Xmd.h>
3915 #include <X11/Xlib.h>
3916 #include <X11/Xutil.h>
3917 #include <X11/Xatom.h>
3918 #include <X11/extensions/dpms.h>
3919 int main(void) {
3920 (void) DPMSQueryExtension(0, 0, 0);
3923 cc_check -lXdpms && _xdpms3=yes
3924 cat > $TMPC <<EOF
3925 #include <X11/Xlib.h>
3926 #include <X11/extensions/dpms.h>
3927 int main(void) {
3928 (void) DPMSQueryExtension(0, 0, 0);
3931 cc_check -lXext && _xdpms4=yes
3933 if test "$_xdpms4" = yes ; then
3934 _def_xdpms='#define HAVE_XDPMS 1'
3935 _res_comment="using Xdpms 4"
3936 echores "yes"
3937 elif test "$_xdpms3" = yes ; then
3938 _def_xdpms='#define HAVE_XDPMS 1'
3939 _libs_mplayer="$_libs_mplayer -lXdpms"
3940 _res_comment="using Xdpms 3"
3941 echores "yes"
3942 else
3943 _def_xdpms='#undef HAVE_XDPMS'
3944 echores "no"
3948 echocheck "Xv"
3949 if test "$_xv" = auto ; then
3950 cat > $TMPC <<EOF
3951 #include <X11/Xlib.h>
3952 #include <X11/extensions/Xvlib.h>
3953 int main(void) {
3954 (void) XvGetPortAttribute(0, 0, 0, 0);
3955 (void) XvQueryPortAttributes(0, 0, 0);
3956 return 0; }
3958 _xv=no
3959 cc_check -lXv && _xv=yes
3962 if test "$_xv" = yes ; then
3963 _def_xv='#define HAVE_XV 1'
3964 _libs_mplayer="$_libs_mplayer -lXv"
3965 _vosrc="$_vosrc vo_xv.c"
3966 _vomodules="xv $_vomodules"
3967 else
3968 _def_xv='#undef HAVE_XV'
3969 _novomodules="xv $_novomodules"
3971 echores "$_xv"
3974 echocheck "XvMC"
3975 if test "$_xv" = yes && test "$_xvmc" != no ; then
3976 _xvmc=no
3977 cat > $TMPC <<EOF
3978 #include <X11/Xlib.h>
3979 #include <X11/extensions/Xvlib.h>
3980 #include <X11/extensions/XvMClib.h>
3981 int main(void) {
3982 (void) XvMCQueryExtension(0,0,0);
3983 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3984 return 0; }
3986 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3987 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3988 done
3990 if test "$_xvmc" = yes ; then
3991 _def_xvmc='#define HAVE_XVMC 1'
3992 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
3993 _vosrc="$_vosrc vo_xvmc.c"
3994 _vomodules="xvmc $_vomodules"
3995 _res_comment="using $_xvmclib"
3996 else
3997 _def_xvmc='#undef HAVE_XVMC'
3998 _novomodules="xvmc $_novomodules"
3999 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4001 echores "$_xvmc"
4004 echocheck "Xinerama"
4005 if test "$_xinerama" = auto ; then
4006 cat > $TMPC <<EOF
4007 #include <X11/Xlib.h>
4008 #include <X11/extensions/Xinerama.h>
4009 int main(void) { (void) XineramaIsActive(0); return 0; }
4011 _xinerama=no
4012 cc_check -lXinerama && _xinerama=yes
4015 if test "$_xinerama" = yes ; then
4016 _def_xinerama='#define HAVE_XINERAMA 1'
4017 _libs_mplayer="$_libs_mplayer -lXinerama"
4018 else
4019 _def_xinerama='#undef HAVE_XINERAMA'
4021 echores "$_xinerama"
4024 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4025 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4026 # named 'X extensions' or something similar.
4027 # This check may be useful for future mplayer versions (to change resolution)
4028 # If you run into problems, remove '-lXxf86vm'.
4029 echocheck "Xxf86vm"
4030 if test "$_vm" = auto ; then
4031 cat > $TMPC <<EOF
4032 #include <X11/Xlib.h>
4033 #include <X11/extensions/xf86vmode.h>
4034 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4036 _vm=no
4037 cc_check -lXxf86vm && _vm=yes
4039 if test "$_vm" = yes ; then
4040 _def_vm='#define HAVE_XF86VM 1'
4041 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4042 else
4043 _def_vm='#undef HAVE_XF86VM'
4045 echores "$_vm"
4047 # Check for the presence of special keycodes, like audio control buttons
4048 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4049 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4050 # have these new keycodes.
4051 echocheck "XF86keysym"
4052 if test "$_xf86keysym" = auto; then
4053 _xf86keysym=no
4054 cat > $TMPC <<EOF
4055 #include <X11/Xlib.h>
4056 #include <X11/XF86keysym.h>
4057 int main(void) { return XF86XK_AudioPause; }
4059 cc_check && _xf86keysym=yes
4061 if test "$_xf86keysym" = yes ; then
4062 _def_xf86keysym='#define HAVE_XF86XK 1'
4063 else
4064 _def_xf86keysym='#undef HAVE_XF86XK'
4066 echores "$_xf86keysym"
4068 echocheck "DGA"
4069 if test "$_dga2" = auto && test "$_x11" = yes ; then
4070 cat > $TMPC << EOF
4071 #include <X11/Xlib.h>
4072 #include <X11/extensions/xf86dga.h>
4073 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4075 _dga2=no
4076 cc_check -lXxf86dga && _dga2=yes
4078 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4079 cat > $TMPC << EOF
4080 #include <X11/Xlib.h>
4081 #include <X11/extensions/xf86dga.h>
4082 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4084 _dga1=no
4085 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4088 _dga=no
4089 _def_dga='#undef HAVE_DGA'
4090 _def_dga1='#undef HAVE_DGA1'
4091 _def_dga2='#undef HAVE_DGA2'
4092 if test "$_dga1" = yes ; then
4093 _dga=yes
4094 _def_dga1='#define HAVE_DGA1 1'
4095 _res_comment="using DGA 1.0"
4096 elif test "$_dga2" = yes ; then
4097 _dga=yes
4098 _def_dga2='#define HAVE_DGA2 1'
4099 _res_comment="using DGA 2.0"
4101 if test "$_dga" = yes ; then
4102 _def_dga='#define HAVE_DGA 1'
4103 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4104 _vosrc="$_vosrc vo_dga.c"
4105 _vomodules="dga $_vomodules"
4106 else
4107 _novomodules="dga $_novomodules"
4109 echores "$_dga"
4112 echocheck "3dfx"
4113 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4114 _def_3dfx='#define HAVE_3DFX 1'
4115 _vosrc="$_vosrc vo_3dfx.c"
4116 _vomodules="3dfx $_vomodules"
4117 else
4118 _def_3dfx='#undef HAVE_3DFX'
4119 _novomodules="3dfx $_novomodules"
4121 echores "$_3dfx"
4124 echocheck "OpenGL"
4125 #Note: this test is run even with --enable-gl since we autodetect linker flags
4126 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4127 cat > $TMPC << EOF
4128 #include <GL/gl.h>
4129 #ifdef GL_WIN32
4130 #include <windows.h>
4131 #include <GL/glext.h>
4132 #else
4133 #include <X11/Xlib.h>
4134 #include <GL/glx.h>
4135 #endif
4136 int main(void) {
4137 #ifdef GL_WIN32
4138 HDC dc;
4139 wglCreateContext(dc);
4140 #else
4141 glXCreateContext(NULL, NULL, NULL, True);
4142 #endif
4143 glFinish();
4144 return 0;
4147 _gl=no
4148 if cc_check -lGL $_ld_lm ; then
4149 _gl=yes
4150 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4151 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4152 _gl=yes
4153 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4154 elif cc_check -DGL_WIN32 -lopengl32 ; then
4155 _gl=yes
4156 _gl_win32=yes
4157 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4159 else
4160 _gl=no
4162 if test "$_gl" = yes ; then
4163 _def_gl='#define HAVE_GL 1'
4164 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4165 if test "$_gl_win32" = yes ; then
4166 _def_gl_win32='#define GL_WIN32 1'
4167 _vosrc="$_vosrc w32_common.c"
4168 _res_comment="win32 version"
4170 _vomodules="opengl $_vomodules"
4171 else
4172 _def_gl='#undef HAVE_GL'
4173 _def_gl_win32='#undef GL_WIN32'
4174 _novomodules="opengl $_novomodules"
4176 echores "$_gl"
4179 echocheck "VIDIX"
4180 _vidix=no
4181 _def_vidix='#undef CONFIG_VIDIX'
4182 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4183 _vidix_drv_cyberblade=no
4184 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4185 _vidix_drv_ivtv=no
4186 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4187 _vidix_drv_ivtv=no
4188 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4189 _vidix_drv_mach64=no
4190 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4191 _vidix_drv_mga=no
4192 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4193 _vidix_drv_mga_crtc2=no
4194 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4195 _vidix_drv_nvidia=no
4196 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4197 _vidix_drv_pm2=no
4198 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4199 _vidix_drv_pm3=no
4200 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4201 _vidix_drv_radeon=no
4202 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4203 _vidix_drv_rage128=no
4204 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
4205 _vidix_drv_savage=no
4206 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4207 _vidix_drv_sis=no
4208 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4209 _vidix_drv_unichrome=no
4210 if test "$_vidix_internal" = auto ; then
4211 _vidix_internal=no
4212 x86 && _vidix_internal=yes
4213 ppc && linux && _vidix_internal=yes
4214 alpha && linux && _vidix_internal=yes
4215 qnx || beos || darwin && _vidix_internal=no
4217 if test "$_vidix_internal" = yes; then
4218 _res_comment="internal"
4219 _vidix_external=no
4220 _vidix=yes
4221 elif test "$_vidix_external" = auto; then
4222 _vidix_external=no
4223 cat > $TMPC <<EOF
4224 #include <vidix/vidix.h>
4225 int main(void) { return 0; }
4227 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
4228 && _vidix=yes
4230 echores "$_vidix"
4232 if test "$_vidix" = yes ; then
4233 _def_vidix='#define CONFIG_VIDIX 1'
4234 _vosrc="$_vosrc vo_cvidix.c"
4235 _vomodules="cvidix $_vomodules"
4236 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 savage sis unichrome"
4237 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4239 # some vidix drivers are meant to work on x86 only, discard them elsewhere
4240 x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome//`
4242 for driver in $_vidix_drivers ; do
4243 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4244 eval _vidix_drv_${driver}=yes
4245 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4246 done
4247 else
4248 _novomodules="cvidix $_novomodules"
4251 if test "$_vidix_internal" = yes ; then
4252 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
4253 elif test "$_vidix_external" = yes ; then
4254 _libs_mplayer="$_libs_mplayer -lvidix"
4255 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
4258 if test "$_vidix" = yes && win32; then
4259 _vosrc="$_vosrc vo_winvidix.c"
4260 _vomodules="winvidix $_vomodules"
4261 _libs_mplayer="$_libs_mplayer -lgdi32"
4262 else
4263 _novomodules="winvidix $_novomodules"
4265 if test "$_vidix" = yes && test "$_x11" = yes; then
4266 _vosrc="$_vosrc vo_xvidix.c"
4267 _vomodules="xvidix $_vomodules"
4268 else
4269 _novomodules="xvidix $_novomodules"
4273 echocheck "/dev/mga_vid"
4274 if test "$_mga" = auto ; then
4275 _mga=no
4276 test -c /dev/mga_vid && _mga=yes
4278 if test "$_mga" = yes ; then
4279 _def_mga='#define HAVE_MGA 1'
4280 _vosrc="$_vosrc vo_mga.c"
4281 _vomodules="mga $_vomodules"
4282 else
4283 _def_mga='#undef HAVE_MGA'
4284 _novomodules="mga $_novomodules"
4286 echores "$_mga"
4289 echocheck "xmga"
4290 if test "$_xmga" = auto ; then
4291 _xmga=no
4292 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4294 if test "$_xmga" = yes ; then
4295 _def_xmga='#define HAVE_XMGA 1'
4296 _vosrc="$_vosrc vo_xmga.c"
4297 _vomodules="xmga $_vomodules"
4298 else
4299 _def_xmga='#undef HAVE_XMGA'
4300 _novomodules="xmga $_novomodules"
4302 echores "$_xmga"
4305 echocheck "GGI"
4306 if test "$_ggi" = auto ; then
4307 cat > $TMPC << EOF
4308 #include <ggi/ggi.h>
4309 int main(void) { ggiInit(); return 0; }
4311 _ggi=no
4312 cc_check -lggi && _ggi=yes
4314 if test "$_ggi" = yes ; then
4315 _def_ggi='#define HAVE_GGI 1'
4316 _libs_mplayer="$_libs_mplayer -lggi"
4317 _vosrc="$_vosrc vo_ggi.c"
4318 _vomodules="ggi $_vomodules"
4319 else
4320 _def_ggi='#undef HAVE_GGI'
4321 _novomodules="ggi $_novomodules"
4323 echores "$_ggi"
4325 echocheck "GGI extension: libggiwmh"
4326 if test "$_ggiwmh" = auto ; then
4327 _ggiwmh=no
4328 cat > $TMPC << EOF
4329 #include <ggi/ggi.h>
4330 #include <ggi/wmh.h>
4331 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4333 cc_check -lggi -lggiwmh && _ggiwmh=yes
4335 # needed to get right output on obscure combination
4336 # like --disable-ggi --enable-ggiwmh
4337 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4338 _def_ggiwmh='#define HAVE_GGIWMH 1'
4339 _libs_mplayer="$_libs_mplayer -lggiwmh"
4340 else
4341 _ggiwmh=no
4342 _def_ggiwmh='#undef HAVE_GGIWMH'
4344 echores "$_ggiwmh"
4347 echocheck "AA"
4348 if test "$_aa" = auto ; then
4349 cat > $TMPC << EOF
4350 #include <aalib.h>
4351 extern struct aa_hardware_params aa_defparams;
4352 extern struct aa_renderparams aa_defrenderparams;
4353 int main(void) {
4354 aa_context *c;
4355 aa_renderparams *p;
4356 (void) aa_init(0, 0, 0);
4357 c = aa_autoinit(&aa_defparams);
4358 p = aa_getrenderparams();
4359 aa_autoinitkbd(c,0);
4360 return 0; }
4362 _aa=no
4363 for _ld_tmp in "-laa" ; do
4364 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4365 done
4367 if test "$_aa" = yes ; then
4368 _def_aa='#define HAVE_AA 1'
4369 if cygwin ; then
4370 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4372 _vosrc="$_vosrc vo_aa.c"
4373 _vomodules="aa $_vomodules"
4374 else
4375 _def_aa='#undef HAVE_AA'
4376 _novomodules="aa $_novomodules"
4378 echores "$_aa"
4381 echocheck "CACA"
4382 if test "$_caca" = auto ; then
4383 _caca=no
4384 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4385 cat > $TMPC << EOF
4386 #include <caca.h>
4387 #ifdef CACA_API_VERSION_1
4388 #include <caca0.h>
4389 #endif
4390 int main(void) { (void) caca_init(); return 0; }
4392 cc_check `caca-config --libs` && _caca=yes
4395 if test "$_caca" = yes ; then
4396 _def_caca='#define HAVE_CACA 1'
4397 _inc_extra="$_inc_extra `caca-config --cflags`"
4398 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4399 _vosrc="$_vosrc vo_caca.c"
4400 _vomodules="caca $_vomodules"
4401 else
4402 _def_caca='#undef HAVE_CACA'
4403 _novomodules="caca $_novomodules"
4405 echores "$_caca"
4408 echocheck "SVGAlib"
4409 if test "$_svga" = auto ; then
4410 cat > $TMPC << EOF
4411 #include <vga.h>
4412 int main(void) { return 0; }
4414 _svga=no
4415 cc_check -lvga $_ld_lm && _svga=yes
4417 if test "$_svga" = yes ; then
4418 _def_svga='#define HAVE_SVGALIB 1'
4419 _libs_mplayer="$_libs_mplayer -lvga"
4420 _vosrc="$_vosrc vo_svga.c"
4421 _vomodules="svga $_vomodules"
4422 else
4423 _def_svga='#undef HAVE_SVGALIB'
4424 _novomodules="svga $_novomodules"
4426 echores "$_svga"
4429 echocheck "FBDev"
4430 if test "$_fbdev" = auto ; then
4431 _fbdev=no
4432 linux && _fbdev=yes
4434 if test "$_fbdev" = yes ; then
4435 _def_fbdev='#define HAVE_FBDEV 1'
4436 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4437 _vomodules="fbdev $_vomodules"
4438 else
4439 _def_fbdev='#undef HAVE_FBDEV'
4440 _novomodules="fbdev $_novomodules"
4442 echores "$_fbdev"
4446 echocheck "DVB"
4447 if test "$_dvb" = auto ; then
4448 _dvb=no
4449 cat >$TMPC << EOF
4450 #include <sys/poll.h>
4451 #include <sys/ioctl.h>
4452 #include <stdio.h>
4453 #include <time.h>
4454 #include <unistd.h>
4456 #include <ost/dmx.h>
4457 #include <ost/frontend.h>
4458 #include <ost/sec.h>
4459 #include <ost/video.h>
4460 #include <ost/audio.h>
4461 int main(void) {return 0;}
4463 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4464 cc_check $_inc_tmp && _dvb=yes && \
4465 _inc_extra="$_inc_extra $_inc_tmp" && break
4466 done
4468 echores "$_dvb"
4469 if test "$_dvb" = yes ; then
4470 _def_dvb='#define HAVE_DVB 1'
4471 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4472 _aomodules="mpegpes(dvb) $_aomodules"
4473 _vomodules="mpegpes(dvb) $_vomodules"
4476 echocheck "DVB HEAD"
4477 if test "$_dvbhead" = auto ; then
4478 _dvbhead=no
4480 cat >$TMPC << EOF
4481 #include <sys/poll.h>
4482 #include <sys/ioctl.h>
4483 #include <stdio.h>
4484 #include <time.h>
4485 #include <unistd.h>
4487 #include <linux/dvb/dmx.h>
4488 #include <linux/dvb/frontend.h>
4489 #include <linux/dvb/video.h>
4490 #include <linux/dvb/audio.h>
4491 int main(void) {return 0;}
4493 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4494 cc_check $_inc_tmp && _dvbhead=yes && \
4495 _inc_extra="$_inc_extra $_inc_tmp" && break
4496 done
4498 echores "$_dvbhead"
4499 if test "$_dvbhead" = yes ; then
4500 _def_dvb='#define HAVE_DVB_HEAD 1'
4501 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4502 _aomodules="mpegpes(dvb) $_aomodules"
4503 _vomodules="mpegpes(dvb) $_vomodules"
4506 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4507 _def_dvb='#undef HAVE_DVB'
4508 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4509 _aomodules="mpegpes(file) $_aomodules"
4510 _vomodules="mpegpes(file) $_vomodules"
4513 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4514 _dvbin=yes
4515 _inputmodules="dvb $_inputmodules"
4516 else
4517 _dvbin=no
4518 _noinputmodules="dvb $_noinputmodules"
4522 echocheck "zr"
4523 if test "$_zr" = auto ; then
4524 #36067's seem to identify themselves as 36057PQC's, so the line
4525 #below should work for 36067's and 36057's.
4526 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
4527 _zr=yes
4528 else
4529 _zr=no
4532 if test "$_zr" = yes ; then
4533 if test "$_libavcodec_a" = yes ; then
4534 _def_zr='#define HAVE_ZR 1'
4535 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
4536 _vomodules="zr zr2 $_vomodules"
4537 else
4538 _res_comment="libavcodec (static) is required by zr, sorry"
4539 _novomodules="zr $_novomodules"
4540 _def_zr='#undef HAVE_ZR'
4542 else
4543 _def_zr='#undef HAVE_ZR'
4544 _novomodules="zr zr2 $_novomodules"
4546 echores "$_zr"
4549 echocheck "PNG support"
4550 if test "$_png" = auto ; then
4551 _png=no
4552 if irix ; then
4553 # Don't check for -lpng on irix since it has its own libpng
4554 # incompatible with the GNU libpng
4555 _res_comment="disabled on irix (not GNU libpng)"
4556 else
4557 cat > $TMPC << EOF
4558 #include <png.h>
4559 #include <string.h>
4560 int main(void) {
4561 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4562 printf("libpng: %s\n", png_libpng_ver);
4563 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4566 if cc_check -lpng -lz $_ld_lm ; then
4567 if tmp_run ; then
4568 _png=yes
4569 else
4570 _res_comment="mismatch of library and header versions"
4575 echores "$_png"
4576 if test "$_png" = yes ; then
4577 _def_png='#define HAVE_PNG 1'
4578 _ld_extra="$_ld_extra -lpng -lz"
4579 _vosrc="$_vosrc vo_png.c"
4580 _vomodules="png $_vomodules"
4581 else
4582 _def_png='#undef HAVE_PNG'
4583 _novomodules="png $_novomodules"
4586 echocheck "JPEG support"
4587 if test "$_jpeg" = auto ; then
4588 _jpeg=no
4589 cat > $TMPC << EOF
4590 #include <stdio.h>
4591 #include <stdlib.h>
4592 #include <setjmp.h>
4593 #include <string.h>
4594 #include <jpeglib.h>
4595 int main(void) {
4596 return 0;
4599 if cc_check -ljpeg $_ld_lm ; then
4600 if tmp_run ; then
4601 _jpeg=yes
4605 echores "$_jpeg"
4607 if test "$_jpeg" = yes ; then
4608 _def_jpeg='#define HAVE_JPEG 1'
4609 _vosrc="$_vosrc vo_jpeg.c"
4610 _vomodules="jpeg $_vomodules"
4611 _ld_extra="$_ld_extra -ljpeg"
4612 else
4613 _def_jpeg='#undef HAVE_JPEG'
4614 _novomodules="jpeg $_novomodules"
4619 echocheck "PNM support"
4620 if test "$_pnm" = yes; then
4621 _def_pnm="#define HAVE_PNM"
4622 _vosrc="$_vosrc vo_pnm.c"
4623 _vomodules="pnm $_vomodules"
4624 else
4625 _def_pnm="#undef HAVE_PNM"
4626 _novomodules="pnm $_novomodules"
4628 echores "$_pnm"
4632 echocheck "GIF support"
4633 # This is to appease people who want to force gif support.
4634 # If it is forced to yes, then we still do checks to determine
4635 # which gif library to use.
4636 if test "$_gif" = yes ; then
4637 _force_gif=yes
4638 _gif=auto
4641 if test "$_gif" = auto ; then
4642 _gif=no
4643 cat > $TMPC << EOF
4644 #include <gif_lib.h>
4645 int main(void) {
4646 return 0;
4649 for _ld_gif in "-lungif" "-lgif" ; do
4650 cc_check $_ld_gif && tmp_run && _gif=yes && break
4651 done
4654 # If no library was found, and the user wants support forced,
4655 # then we force it on with libgif, as this is the safest
4656 # assumption IMHO. (libungif & libregif both create symbolic
4657 # links to libgif. We also assume that no x11 support is needed,
4658 # because if you are forcing this, then you _should_ know what
4659 # you are doing. [ Besides, package maintainers should never
4660 # have compiled x11 deps into libungif in the first place. ] )
4661 # </rant>
4662 # --Joey
4663 if test "$_force_gif" = yes && test "$_gif" = no ; then
4664 _gif=yes
4665 _ld_gif="-lgif"
4668 if test "$_gif" = yes ; then
4669 _def_gif='#define HAVE_GIF 1'
4670 _vosrc="$_vosrc vo_gif89a.c"
4671 _codecmodules="gif $_codecmodules"
4672 _vomodules="gif89a $_vomodules"
4673 _res_comment="old version, some encoding functions disabled"
4674 _def_gif_4='#undef HAVE_GIF_4'
4675 _ld_extra="$_ld_extra $_ld_gif"
4677 cat > $TMPC << EOF
4678 #include <signal.h>
4679 #include <gif_lib.h>
4680 void catch() { exit(1); }
4681 int main(void) {
4682 signal(SIGSEGV, catch); // catch segfault
4683 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4684 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4685 return 0;
4688 if cc_check "$_ld_gif" && tmp_run ; then
4689 _def_gif_4='#define HAVE_GIF_4 1'
4690 _res_comment=""
4692 else
4693 _def_gif='#undef HAVE_GIF'
4694 _def_gif_4='#undef HAVE_GIF_4'
4695 _novomodules="gif89a $_novomodules"
4696 _nocodecmodules="gif $_nocodecmodules"
4698 echores "$_gif"
4701 case "$_gif" in yes*)
4702 echocheck "broken giflib workaround"
4703 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4705 cat > $TMPC << EOF
4706 #include <gif_lib.h>
4707 int main(void) {
4708 GifFileType gif;
4709 printf("UserData is at address %p\n", gif.UserData);
4710 return 0;
4713 if cc_check "$_ld_gif" && tmp_run ; then
4714 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4715 echores "disabled"
4716 else
4717 echores "enabled"
4720 esac
4723 echocheck "VESA support"
4724 if test "$_vesa" = auto ; then
4725 cat > $TMPC << EOF
4726 #include <vbe.h>
4727 int main(void) { vbeVersion(); return 0; }
4729 _vesa=no
4730 cc_check -lvbe -llrmi && _vesa=yes
4732 if test "$_vesa" = yes ; then
4733 _def_vesa='#define HAVE_VESA 1'
4734 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4735 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4736 _vomodules="vesa $_vomodules"
4737 else
4738 _def_vesa='#undef HAVE_VESA'
4739 _novomodules="vesa $_novomodules"
4741 echores "$_vesa"
4743 #################
4744 # VIDEO + AUDIO #
4745 #################
4748 echocheck "SDL"
4749 if test -z "$_sdlconfig" ; then
4750 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4751 _sdlconfig="sdl-config"
4752 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4753 _sdlconfig="sdl11-config"
4754 else
4755 _sdlconfig=false
4758 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4759 cat > $TMPC << EOF
4760 #include <SDL.h>
4761 int main(int argc, char *argv[]) {
4762 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4763 return 0;
4766 _sdl=no
4767 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4768 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4769 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4770 if test "$_sdlversion" -gt 116 ; then
4771 if test "$_sdlversion" -lt 121 ; then
4772 _def_sdlbuggy='#define BUGGY_SDL'
4773 else
4774 _def_sdlbuggy='#undef BUGGY_SDL'
4776 _sdl=yes
4781 if test "$_sdl" = yes ; then
4782 _def_sdl='#define HAVE_SDL 1'
4783 if cygwin ; then
4784 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4785 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4786 elif mingw32 ; then
4787 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4788 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4789 else
4790 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4791 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4793 _vosrc="$_vosrc vo_sdl.c"
4794 _vomodules="sdl $_vomodules"
4795 _aosrc="$_aosrc ao_sdl.c"
4796 _aomodules="sdl $_aomodules"
4797 _res_comment="using $_sdlconfig"
4798 else
4799 _def_sdl='#undef HAVE_SDL'
4800 _novomodules="sdl $_novomodules"
4801 _noaomodules="sdl $_noaomodules"
4803 echores "$_sdl"
4806 if win32; then
4808 echocheck "Windows waveout"
4809 if test "$_win32waveout" = auto ; then
4810 cat > $TMPC << EOF
4811 #include <windows.h>
4812 #include <mmsystem.h>
4813 int main(void) { return 0; }
4815 _win32waveout=no
4816 cc_check -lwinmm && _win32waveout=yes
4818 if test "$_win32waveout" = yes ; then
4819 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4820 _libs_mplayer="$_libs_mplayer -lwinmm"
4821 _aosrc="$_aosrc ao_win32.c"
4822 _aomodules="win32 $_aomodules"
4823 else
4824 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4825 _noaomodules="win32 $_noaomodules"
4827 echores "$_win32waveout"
4829 echocheck "Directx"
4830 if test "$_directx" = auto ; then
4831 cat > $TMPC << EOF
4832 #include <windows.h>
4833 #include <ddraw.h>
4834 #include <dsound.h>
4835 int main(void) { return 0; }
4837 _directx=no
4838 cc_check -lgdi32 && _directx=yes
4840 if test "$_directx" = yes ; then
4841 _def_directx='#define HAVE_DIRECTX 1'
4842 _libs_mplayer="$_libs_mplayer -lgdi32"
4843 _vosrc="$_vosrc vo_directx.c"
4844 _vomodules="directx $_vomodules"
4845 _aosrc="$_aosrc ao_dsound.c"
4846 _aomodules="dsound $_aomodules"
4847 else
4848 _def_directx='#undef HAVE_DIRECTX'
4849 _novomodules="directx $_novomodules"
4850 _noaomodules="dsound $_noaomodules"
4852 echores "$_directx"
4854 fi #if win32; then
4857 echocheck "NAS"
4858 if test "$_nas" = auto ; then
4859 cat > $TMPC << EOF
4860 #include <audio/audiolib.h>
4861 int main(void) { return 0; }
4863 _nas=no
4864 cc_check $_ld_lm -laudio -lXt && _nas=yes
4866 if test "$_nas" = yes ; then
4867 _def_nas='#define HAVE_NAS 1'
4868 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4869 _aosrc="$_aosrc ao_nas.c"
4870 _aomodules="nas $_aomodules"
4871 else
4872 _noaomodules="nas $_noaomodules"
4873 _def_nas='#undef HAVE_NAS'
4875 echores "$_nas"
4877 echocheck "DXR2"
4878 if test "$_dxr2" = auto; then
4879 _dxr2=no
4880 cat > $TMPC << EOF
4881 #include <dxr2ioctl.h>
4882 int main(void) { return 0; }
4884 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4885 cc_check $_inc_tmp && _dxr2=yes && \
4886 _inc_extra="$_inc_extra $_inc_tmp" && break
4887 done
4889 if test "$_dxr2" = yes; then
4890 _def_dxr2='#define HAVE_DXR2 1'
4891 _vosrc="$_vosrc vo_dxr2.c"
4892 _aosrc="$_aosrc ao_dxr2.c"
4893 _aomodules="dxr2 $_aomodules"
4894 _vomodules="dxr2 $_vomodules"
4895 else
4896 _def_dxr2='#undef HAVE_DXR2'
4897 _noaomodules="dxr2 $_noaomodules"
4898 _novomodules="dxr2 $_novomodules"
4900 echores "$_dxr2"
4902 echocheck "DXR3/H+"
4903 if test "$_dxr3" = auto ; then
4904 cat > $TMPC << EOF
4905 #include <linux/em8300.h>
4906 int main(void) { return 0; }
4908 _dxr3=no
4909 cc_check && _dxr3=yes
4911 if test "$_dxr3" = yes ; then
4912 _def_dxr3='#define HAVE_DXR3 1'
4913 _vosrc="$_vosrc vo_dxr3.c"
4914 _vomodules="dxr3 $_vomodules"
4915 else
4916 _def_dxr3='#undef HAVE_DXR3'
4917 _novomodules="dxr3 $_novomodules"
4919 echores "$_dxr3"
4922 echocheck "IVTV TV-Out"
4923 if test "$_ivtv" = auto ; then
4924 cat > $TMPC << EOF
4925 #include <stdlib.h>
4926 #include <inttypes.h>
4927 #include <linux/types.h>
4928 #include <linux/videodev2.h>
4929 #include <linux/ivtv.h>
4930 int main(void) { return 0; }
4932 _ivtv=no
4933 cc_check && _ivtv=yes
4935 if test "$_ivtv" = yes ; then
4936 _def_ivtv='#define HAVE_IVTV 1'
4937 _vosrc="$_vosrc vo_ivtv.c"
4938 _vomodules="ivtv $_vomodules"
4939 _aosrc="$_aosrc ao_ivtv.c"
4940 _aomodules="ivtv $_aomodules"
4941 else
4942 _def_ivtv='#undef HAVE_IVTV'
4943 _novomodules="ivtv $_novomodules"
4944 _noaomodules="ivtv $_noaomodules"
4946 echores "$_ivtv"
4949 echocheck "V4L2 MPEG Decoder"
4950 if test "$_v4l2" = auto ; then
4951 cat > $TMPC << EOF
4952 #include <stdlib.h>
4953 #include <inttypes.h>
4954 #include <linux/types.h>
4955 #include <linux/videodev2.h>
4956 #include <linux/version.h>
4957 int main(void) {
4958 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4959 #error kernel headers too old, need 2.6.22
4960 bad_kernel_version();
4961 #endif
4962 struct v4l2_ext_controls ctrls;
4963 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4964 return 0;
4967 _v4l2=no
4968 cc_check && _v4l2=yes
4970 if test "$_v4l2" = yes ; then
4971 _def_v4l2='#define HAVE_V4L2_DECODER 1'
4972 _vosrc="$_vosrc vo_v4l2.c"
4973 _vomodules="v4l2 $_vomodules"
4974 _aosrc="$_aosrc ao_v4l2.c"
4975 _aomodules="v4l2 $_aomodules"
4976 else
4977 _def_v4l2='#undef HAVE_V4L2_DECODER'
4978 _novomodules="v4l2 $_novomodules"
4979 _noaomodules="v4l2 $_noaomodules"
4981 echores "$_v4l2"
4985 #########
4986 # AUDIO #
4987 #########
4990 echocheck "OSS Audio"
4991 if test "$_ossaudio" = auto ; then
4992 cat > $TMPC << EOF
4993 #include <sys/ioctl.h>
4994 #include <$_soundcard_header>
4995 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4997 _ossaudio=no
4998 cc_check && _ossaudio=yes
5000 if test "$_ossaudio" = yes ; then
5001 _def_ossaudio='#define USE_OSS_AUDIO 1'
5002 _aosrc="$_aosrc ao_oss.c"
5003 _aomodules="oss $_aomodules"
5004 if test "$_linux_devfs" = yes; then
5005 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5006 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5007 else
5008 cat > $TMPC << EOF
5009 #include <sys/ioctl.h>
5010 #include <$_soundcard_header>
5011 #ifdef OPEN_SOUND_SYSTEM
5012 int main(void) { return 0; }
5013 #else
5014 #error Not the real thing
5015 #endif
5017 _real_ossaudio=no
5018 cc_check && _real_ossaudio=yes
5019 if test "$_real_ossaudio" = yes; then
5020 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5021 elif netbsd || openbsd ; then
5022 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5023 _ld_extra="$_ld_extra -lossaudio"
5024 else
5025 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5027 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5029 else
5030 _def_ossaudio='#undef USE_OSS_AUDIO'
5031 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5032 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5033 _noaomodules="oss $_noaomodules"
5035 echores "$_ossaudio"
5038 echocheck "aRts"
5039 if test "$_arts" = auto ; then
5040 _arts=no
5041 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5043 cat > $TMPC << EOF
5044 #include <artsc.h>
5045 int main(void) { return 0; }
5047 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5052 if test "$_arts" = yes ; then
5053 _def_arts='#define USE_ARTS 1'
5054 _aosrc="$_aosrc ao_arts.c"
5055 _aomodules="arts $_aomodules"
5056 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5057 _inc_extra="$_inc_extra `artsc-config --cflags`"
5058 else
5059 _noaomodules="arts $_noaomodules"
5061 echores "$_arts"
5064 echocheck "EsounD"
5065 if test "$_esd" = auto ; then
5066 _esd=no
5067 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5069 cat > $TMPC << EOF
5070 #include <esd.h>
5071 int main(void) { int fd = esd_open_sound("test"); return fd; }
5073 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5077 echores "$_esd"
5079 if test "$_esd" = yes ; then
5080 _def_esd='#define USE_ESD 1'
5081 _aosrc="$_aosrc ao_esd.c"
5082 _aomodules="esd $_aomodules"
5083 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5084 _inc_extra="$_inc_extra `esd-config --cflags`"
5086 echocheck "esd_get_latency()"
5087 cat > $TMPC << EOF
5088 #include <esd.h>
5089 int main(void) { return esd_get_latency(0); }
5091 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5092 echores "$_esd_latency"
5093 else
5094 _def_esd='#undef USE_ESD'
5095 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5096 _noaomodules="esd $_noaomodules"
5099 echocheck "pulse"
5100 if test "$_pulse" = auto ; then
5101 _pulse=no
5102 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5104 cat > $TMPC << EOF
5105 #include <pulse/pulseaudio.h>
5106 int main(void) { return 0; }
5108 cc_check `$_pkg_config --libs --cflags libpulse` && tmp_run && _pulse=yes
5112 echores "$_pulse"
5114 if test "$_pulse" = yes ; then
5115 _def_pulse='#define USE_PULSE 1'
5116 _aosrc="$_aosrc ao_pulse.c"
5117 _aomodules="pulse $_aomodules"
5118 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs libpulse`"
5119 _inc_extra="$_inc_extra `$_pkg_config --cflags libpulse`"
5120 else
5121 _def_pulse='#undef USE_PULSE'
5122 _noaomodules="pulse $_noaomodules"
5126 echocheck "JACK"
5127 if test "$_jack" = auto ; then
5128 _jack=yes
5130 cat > $TMPC << EOF
5131 #include <jack/jack.h>
5132 int main(void) { jack_client_new("test"); return 0; }
5134 if cc_check -ljack ; then
5135 _libs_mplayer="$_libs_mplayer -ljack"
5136 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5137 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5138 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5139 else
5140 _jack=no
5144 if test "$_jack" = yes ; then
5145 _def_jack='#define USE_JACK 1'
5146 _aosrc="$_aosrc ao_jack.c"
5147 _aomodules="jack $_aomodules"
5148 else
5149 _noaomodules="jack $_noaomodules"
5151 echores "$_jack"
5153 echocheck "OpenAL"
5154 if test "$_openal" = auto ; then
5155 _openal=no
5156 cat > $TMPC << EOF
5157 #ifdef OPENAL_AL_H
5158 #include <OpenAL/al.h>
5159 #else
5160 #include <AL/al.h>
5161 #endif
5162 int main(void) {
5163 alSourceQueueBuffers(0, 0, 0);
5164 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5165 return 0;
5168 for I in "-lopenal" "-framework OpenAL" ; do
5169 cc_check $I && _openal=yes && break
5170 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5171 done
5172 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5174 if test "$_openal" = yes ; then
5175 _def_openal='#define USE_OPENAL 1'
5176 _aosrc="$_aosrc ao_openal.c"
5177 _aomodules="openal $_aomodules"
5178 else
5179 _noaomodules="openal $_noaomodules"
5181 echores "$_openal"
5183 echocheck "ALSA audio"
5184 if test "$_alsa" != no ; then
5185 _alsa=no
5186 cat > $TMPC << EOF
5187 #include <sys/asoundlib.h>
5188 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5189 #error "alsa version != 0.5.x"
5190 #endif
5191 int main(void) { return 0; }
5193 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5195 cat > $TMPC << EOF
5196 #include <sys/asoundlib.h>
5197 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5198 #error "alsa version != 0.9.x"
5199 #endif
5200 int main(void) { return 0; }
5202 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5203 cat > $TMPC << EOF
5204 #include <alsa/asoundlib.h>
5205 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5206 #error "alsa version != 0.9.x"
5207 #endif
5208 int main(void) { return 0; }
5210 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5212 cat > $TMPC << EOF
5213 #include <sys/asoundlib.h>
5214 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5215 #error "alsa version != 1.0.x"
5216 #endif
5217 int main(void) { return 0; }
5219 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5220 cat > $TMPC << EOF
5221 #include <alsa/asoundlib.h>
5222 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5223 #error "alsa version != 1.0.x"
5224 #endif
5225 int main(void) { return 0; }
5227 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5229 _def_alsa5='#undef HAVE_ALSA5'
5230 _def_alsa9='#undef HAVE_ALSA9'
5231 _def_alsa1x='#undef HAVE_ALSA1X'
5232 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5233 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5234 if test "$_alsaver" ; then
5235 _alsa=yes
5236 if test "$_alsaver" = '0.5.x' ; then
5237 _alsa5=yes
5238 _aosrc="$_aosrc ao_alsa5.c"
5239 _aomodules="alsa5 $_aomodules"
5240 _def_alsa5='#define HAVE_ALSA5 1'
5241 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5242 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5243 elif test "$_alsaver" = '0.9.x-sys' ; then
5244 _alsa9=yes
5245 _aosrc="$_aosrc ao_alsa.c"
5246 _aomodules="alsa $_aomodules"
5247 _def_alsa9='#define HAVE_ALSA9 1'
5248 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5249 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5250 elif test "$_alsaver" = '0.9.x-alsa' ; then
5251 _alsa9=yes
5252 _aosrc="$_aosrc ao_alsa.c"
5253 _aomodules="alsa $_aomodules"
5254 _def_alsa9='#define HAVE_ALSA9 1'
5255 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5256 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5257 elif test "$_alsaver" = '1.0.x-sys' ; then
5258 _alsa1x=yes
5259 _aosrc="$_aosrc ao_alsa.c"
5260 _aomodules="alsa $_aomodules"
5261 _def_alsa1x="#define HAVE_ALSA1X 1"
5262 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5263 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5264 elif test "$_alsaver" = '1.0.x-alsa' ; then
5265 _alsa1x=yes
5266 _aosrc="$_aosrc ao_alsa.c"
5267 _aomodules="alsa $_aomodules"
5268 _def_alsa1x="#define HAVE_ALSA1X 1"
5269 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5270 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5271 else
5272 _alsa=no
5273 _res_comment="unknown version"
5275 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5276 else
5277 _noaomodules="alsa $_noaomodules"
5279 echores "$_alsa"
5282 echocheck "Sun audio"
5283 if test "$_sunaudio" = auto ; then
5284 cat > $TMPC << EOF
5285 #include <sys/types.h>
5286 #include <sys/audioio.h>
5287 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5289 _sunaudio=no
5290 cc_check && _sunaudio=yes
5292 if test "$_sunaudio" = yes ; then
5293 _def_sunaudio='#define USE_SUN_AUDIO 1'
5294 _aosrc="$_aosrc ao_sun.c"
5295 _aomodules="sun $_aomodules"
5296 else
5297 _def_sunaudio='#undef USE_SUN_AUDIO'
5298 _noaomodules="sun $_noaomodules"
5300 echores "$_sunaudio"
5303 if sunos; then
5304 echocheck "Sun mediaLib"
5305 if test "$_mlib" = auto ; then
5306 _mlib=no
5307 cat > $TMPC << EOF
5308 #include <mlib.h>
5309 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5311 cc_check -lmlib && _mlib=yes
5313 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5314 echores "$_mlib"
5315 fi #if sunos
5318 if irix; then
5319 echocheck "SGI audio"
5320 if test "$_sgiaudio" = auto ; then
5321 # check for SGI audio
5322 cat > $TMPC << EOF
5323 #include <dmedia/audio.h>
5324 int main(void) { return 0; }
5326 _sgiaudio=no
5327 cc_check && _sgiaudio=yes
5329 if test "$_sgiaudio" = "yes" ; then
5330 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5331 _libs_mplayer="$_libs_mplayer -laudio"
5332 _aosrc="$_aosrc ao_sgi.c"
5333 _aomodules="sgi $_aomodules"
5334 else
5335 _def_sgiaudio='#undef USE_SGI_AUDIO'
5336 _noaomodules="sgi $_noaomodules"
5338 echores "$_sgiaudio"
5339 fi #if irix
5342 echocheck "VCD support"
5343 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5344 _inputmodules="vcd $_inputmodules"
5345 _def_vcd='#define HAVE_VCD 1'
5346 _vcd="yes"
5347 else
5348 _def_vcd='#undef HAVE_VCD'
5349 _noinputmodules="vcd $_noinputmodules"
5350 _res_comment="not supported on this OS"
5351 _vcd="no"
5353 echores "$_vcd"
5357 echocheck "dvdread"
5358 if test "$_dvdread_internal" = auto ; then
5359 _dvdread_internal=no
5360 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5361 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5362 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5363 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5364 _dvdread_internal=yes
5365 _dvdread=yes
5367 elif test "$_dvdread" = auto ; then
5368 _dvdread=no
5369 if test "$_dl" = yes; then
5370 cat > $TMPC << EOF
5371 #include <inttypes.h>
5372 #include <dvdread/dvd_reader.h>
5373 #include <dvdread/ifo_types.h>
5374 #include <dvdread/ifo_read.h>
5375 #include <dvdread/nav_read.h>
5376 int main(void) { return 0; }
5378 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5379 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5383 if test "$_dvdread_internal" = yes; then
5384 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5385 _def_dvdread='#define USE_DVDREAD 1'
5386 _inputmodules="dvdread(internal) $_inputmodules"
5387 _largefiles=yes
5388 _res_comment="internal"
5389 elif test "$_dvdread" = yes; then
5390 _def_dvdread='#define USE_DVDREAD 1'
5391 _largefiles=yes
5392 _ld_extra="$_ld_extra -ldvdread"
5393 _inputmodules="dvdread(external) $_inputmodules"
5394 _res_comment="external"
5395 else
5396 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5397 _def_dvdread='#undef USE_DVDREAD'
5398 _noinputmodules="dvdread $_noinputmodules"
5400 echores "$_dvdread"
5403 echocheck "internal libdvdcss"
5404 if test "$_libdvdcss_internal" = auto ; then
5405 _libdvdcss_internal=no
5406 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5408 if test "$_libdvdcss_internal" = yes ; then
5409 if linux || netbsd || openbsd || bsdos ; then
5410 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5411 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5412 elif freebsd ; then
5413 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5414 elif darwin ; then
5415 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5416 _ld_extra="$_ld_extra -framework IOKit"
5418 _inputmodules="libdvdcss(internal) $_inputmodules"
5419 _largefiles=yes
5420 else
5421 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5423 echores "$_libdvdcss_internal"
5426 echocheck "cdparanoia"
5427 if test "$_cdparanoia" = auto ; then
5428 cat > $TMPC <<EOF
5429 #include <cdda_interface.h>
5430 #include <cdda_paranoia.h>
5431 // This need a better test. How ?
5432 int main(void) {
5433 void *test = cdda_verbose_set;
5434 return test == (void *)1;
5437 _cdparanoia=no
5438 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5439 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5440 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5441 done
5443 if test "$_cdparanoia" = yes ; then
5444 _cdda='yes'
5445 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5446 openbsd && _ld_extra="$_ld_extra -lutil"
5448 echores "$_cdparanoia"
5451 echocheck "libcdio"
5452 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5453 cat > $TMPC << EOF
5454 #include <stdio.h>
5455 #include <cdio/version.h>
5456 #include <cdio/cdda.h>
5457 #include <cdio/paranoia.h>
5458 int main(void)
5460 void *test = cdda_verbose_set;
5461 printf("%s\n", CDIO_VERSION);
5462 return test == (void *)1;
5466 _libcdio=no
5467 for _ld_tmp in "" "-lwinmm" ; do
5468 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5469 cc_check $_ld_tmp $_ld_lm \
5470 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5471 done
5472 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5473 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5474 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5475 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5476 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5479 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5480 _cdda='yes'
5481 _def_libcdio='#define HAVE_LIBCDIO'
5482 _def_havelibcdio='yes'
5483 else
5484 if test "$_cdparanoia" = yes ; then
5485 _res_comment="using cdparanoia"
5487 _def_libcdio='#undef HAVE_LIBCDIO'
5488 _def_havelibcdio='no'
5490 echores "$_libcdio"
5492 if test "$_cdda" = yes ; then
5493 test $_cddb = auto && test $_network = yes && not darwin && _cddb=yes
5494 _def_cdparanoia='#define HAVE_CDDA'
5495 _inputmodules="cdda $_inputmodules"
5496 else
5497 _def_cdparanoia='#undef HAVE_CDDA'
5498 _noinputmodules="cdda $_noinputmodules"
5501 if test "$_cddb" = yes ; then
5502 _def_cddb='#define HAVE_CDDB'
5503 _inputmodules="cddb $_inputmodules"
5504 else
5505 _cddb=no
5506 _def_cddb='#undef HAVE_CDDB'
5507 _noinputmodules="cddb $_noinputmodules"
5510 echocheck "bitmap font support"
5511 if test "$_bitmap_font" = yes ; then
5512 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5513 else
5514 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5516 echores "$_bitmap_font"
5519 echocheck "freetype >= 2.0.9"
5521 # freetype depends on iconv
5522 if test "$_iconv" = no ; then
5523 _freetype=no
5524 _res_comment="iconv support needed"
5527 if test "$_freetype" = auto ; then
5528 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5529 cat > $TMPC << EOF
5530 #include <stdio.h>
5531 #include <ft2build.h>
5532 #include FT_FREETYPE_H
5533 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5534 #error "Need FreeType 2.0.9 or newer"
5535 #endif
5536 int main(void)
5538 FT_Library library;
5539 FT_Int major=-1,minor=-1,patch=-1;
5540 int err=FT_Init_FreeType(&library);
5541 if(err){
5542 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5543 exit(err);
5545 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5546 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5547 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5548 (int)major,(int)minor,(int)patch );
5549 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5550 printf("Library and header version mismatch! Fix it in your distribution!\n");
5551 exit(1);
5553 return 0;
5556 _freetype=no
5557 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5558 else
5559 _freetype=no
5562 if test "$_freetype" = yes ; then
5563 _def_freetype='#define HAVE_FREETYPE'
5564 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5565 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5566 else
5567 _def_freetype='#undef HAVE_FREETYPE'
5569 echores "$_freetype"
5571 if test "$_freetype" = no ; then
5572 _fontconfig=no
5573 _res_comment="freetype support needed"
5575 echocheck "fontconfig"
5576 if test "$_fontconfig" = auto ; then
5577 cat > $TMPC << EOF
5578 #include <stdio.h>
5579 #include <fontconfig/fontconfig.h>
5580 int main(void)
5582 int err = FcInit();
5583 if(err == FcFalse){
5584 printf("Couldn't initialize fontconfig lib\n");
5585 exit(err);
5587 return 0;
5591 _fontconfig=no
5592 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5593 _ld_tmp="-lfontconfig $_ld_tmp"
5594 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5595 done
5596 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5597 _inc_tmp=`$_pkg_config --cflags fontconfig`
5598 _ld_tmp=`$_pkg_config --libs fontconfig`
5599 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5600 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5603 if test "$_fontconfig" = yes ; then
5604 _def_fontconfig='#define HAVE_FONTCONFIG'
5605 else
5606 _def_fontconfig='#undef HAVE_FONTCONFIG'
5608 echores "$_fontconfig"
5611 echocheck "SSA/ASS support"
5612 # libass depends on FreeType
5613 if test "$_freetype" = no ; then
5614 _ass=no
5615 _res_comment="FreeType support needed"
5618 if test "$_ass" = auto ; then
5619 cat > $TMPC << EOF
5620 #include <ft2build.h>
5621 #include FT_FREETYPE_H
5622 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5623 #error "Need FreeType 2.1.8 or newer"
5624 #endif
5625 int main(void) { return 0; }
5627 _ass=no
5628 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5629 if test "$_ass" = no ; then
5630 _res_comment="FreeType >= 2.1.8 needed"
5633 if test "$_ass" = yes ; then
5634 _def_ass='#define USE_ASS'
5635 else
5636 _def_ass='#undef USE_ASS'
5638 echores "$_ass"
5641 echocheck "fribidi with charsets"
5642 if test "$_fribidi" = auto ; then
5643 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5644 cat > $TMPC << EOF
5645 #include <stdio.h>
5646 /* workaround for fribidi 0.10.4 and below */
5647 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5648 #include <fribidi/fribidi.h>
5649 int main(void)
5651 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5652 printf("Fribidi headers are not consistents with the library!\n");
5653 exit(1);
5655 return 0;
5658 _fribidi=no
5659 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5660 else
5661 _fribidi=no
5664 if test "$_fribidi" = yes ; then
5665 _def_fribidi='#define USE_FRIBIDI'
5666 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5667 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5668 else
5669 _def_fribidi='#undef USE_FRIBIDI'
5671 echores "$_fribidi"
5674 echocheck "ENCA"
5675 if test "$_enca" = auto ; then
5676 cat > $TMPC << EOF
5677 #include <enca.h>
5678 int main(void)
5680 const char **langs;
5681 size_t langcnt;
5682 langs = enca_get_languages(&langcnt);
5683 return 0;
5686 _enca=no
5687 cc_check -lenca $_ld_lm && _enca=yes
5689 if test "$_enca" = yes ; then
5690 _def_enca='#define HAVE_ENCA 1'
5691 _ld_extra="$_ld_extra -lenca"
5692 else
5693 _def_enca='#undef HAVE_ENCA'
5695 echores "$_enca"
5698 echocheck "zlib"
5699 cat > $TMPC << EOF
5700 #include <zlib.h>
5701 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5703 _zlib=no
5704 cc_check -lz && _zlib=yes
5705 if test "$_zlib" = yes ; then
5706 _def_zlib='#define HAVE_ZLIB 1'
5707 _ld_extra="$_ld_extra -lz"
5708 else
5709 _def_zlib='#undef HAVE_ZLIB'
5710 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5711 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5713 echores "$_zlib"
5716 echocheck "RTC"
5717 if test "$_rtc" = auto ; then
5718 cat > $TMPC << EOF
5719 #include <sys/ioctl.h>
5720 #ifdef __linux__
5721 #include <linux/rtc.h>
5722 #else
5723 #include <rtc.h>
5724 #define RTC_PIE_ON RTCIO_PIE_ON
5725 #endif
5726 int main(void) { return RTC_PIE_ON; }
5728 _rtc=no
5729 cc_check && _rtc=yes
5730 ppc && _rtc=no
5732 if test "$_rtc" = yes ; then
5733 _def_rtc='#define HAVE_RTC 1'
5734 else
5735 _def_rtc='#undef HAVE_RTC'
5737 echores "$_rtc"
5740 echocheck "liblzo2 support"
5741 if test "$_liblzo" = auto ; then
5742 _liblzo=no
5743 cat > $TMPC << EOF
5744 #include <lzo/lzo1x.h>
5745 int main(void) { lzo_init();return 0; }
5747 cc_check -llzo2 && _liblzo=yes
5749 if test "$_liblzo" = yes ; then
5750 _def_liblzo='#define USE_LIBLZO 1'
5751 _ld_extra="$_ld_extra -llzo2"
5752 _codecmodules="liblzo $_codecmodules"
5753 else
5754 _def_liblzo='#undef USE_LIBLZO'
5755 _nocodecmodules="liblzo $_nocodecmodules"
5757 echores "$_liblzo"
5760 echocheck "mad support"
5761 if test "$_mad" = auto ; then
5762 _mad=no
5763 cat > $TMPC << EOF
5764 #include <mad.h>
5765 int main(void) { return 0; }
5767 cc_check -lmad && _mad=yes
5769 if test "$_mad" = yes ; then
5770 _def_mad='#define USE_LIBMAD 1'
5771 _ld_extra="$_ld_extra -lmad"
5772 _codecmodules="libmad $_codecmodules"
5773 else
5774 _def_mad='#undef USE_LIBMAD'
5775 _nocodecmodules="libmad $_nocodecmodules"
5777 echores "$_mad"
5779 echocheck "Twolame"
5780 if test "$_twolame" = auto ; then
5781 cat > $TMPC <<EOF
5782 #include <twolame.h>
5783 int main(void) { twolame_init(); return 0; }
5785 _twolame=no
5786 cc_check -ltwolame $_ld_lm && _twolame=yes
5788 if test "$_twolame" = yes ; then
5789 _def_twolame='#define HAVE_TWOLAME 1'
5790 _libs_mencoder="$_libs_mencoder -ltwolame"
5791 _codecmodules="twolame $_codecmodules"
5792 else
5793 _def_twolame='#undef HAVE_TWOLAME'
5794 _nocodecmodules="twolame $_nocodecmodules"
5796 echores "$_twolame"
5798 echocheck "Toolame"
5799 if test "$_toolame" = auto ; then
5800 _toolame=no
5801 if test "$_twolame" = yes ; then
5802 _res_comment="disabled by twolame"
5803 else
5804 cat > $TMPC <<EOF
5805 #include <toolame.h>
5806 int main(void) { toolame_init(); return 0; }
5808 cc_check -ltoolame $_ld_lm && _toolame=yes
5811 if test "$_toolame" = yes ; then
5812 _def_toolame='#define HAVE_TOOLAME 1'
5813 _libs_mencoder="$_libs_mencoder -ltoolame"
5814 _codecmodules="toolame $_codecmodules"
5815 else
5816 _def_toolame='#undef HAVE_TOOLAME'
5817 _nocodecmodules="toolame $_nocodecmodules"
5819 if test "$_toolamedir" ; then
5820 _res_comment="using $_toolamedir"
5822 echores "$_toolame"
5824 echocheck "OggVorbis support"
5825 if test "$_tremor_internal" = yes; then
5826 _libvorbis=no
5827 elif test "$_tremor_external" = auto; then
5828 _tremor_external=no
5829 cat > $TMPC << EOF
5830 #include <tremor/ivorbiscodec.h>
5831 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5833 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5835 if test "$_libvorbis" = auto; then
5836 _libvorbis=no
5837 cat > $TMPC << EOF
5838 #include <vorbis/codec.h>
5839 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5841 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5843 if test "$_tremor_internal" = yes ; then
5844 _vorbis=yes
5845 _def_vorbis='#define HAVE_OGGVORBIS 1'
5846 _def_tremor='#define TREMOR 1'
5847 _codecmodules="tremor(internal) $_codecmodules"
5848 _res_comment="internal Tremor"
5849 if test "$_tremor_low" = yes ; then
5850 _res_comment="internal low accuracy Tremor"
5852 elif test "$_tremor_external" = yes ; then
5853 _vorbis=yes
5854 _def_vorbis='#define HAVE_OGGVORBIS 1'
5855 _def_tremor='#define TREMOR 1'
5856 _codecmodules="tremor(external) $_codecmodules"
5857 _res_comment="external Tremor"
5858 _ld_extra="$_ld_extra -logg -lvorbisidec"
5859 elif test "$_libvorbis" = yes ; then
5860 _vorbis=yes
5861 _def_vorbis='#define HAVE_OGGVORBIS 1'
5862 _codecmodules="libvorbis $_codecmodules"
5863 _res_comment="libvorbis"
5864 _ld_extra="$_ld_extra -lvorbis -logg"
5865 else
5866 _vorbis=no
5867 _nocodecmodules="libvorbis $_nocodecmodules"
5869 if test "$_libvorbis" = no ; then
5870 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5872 echores "$_vorbis"
5874 echocheck "libspeex (version >= 1.1 required)"
5875 if test "$_speex" = auto ; then
5876 _speex=no
5877 cat > $TMPC << EOF
5878 #include <speex/speex.h>
5879 int main(void) {
5880 SpeexBits bits;
5881 void *dec;
5882 speex_decode_int(dec, &bits, dec);
5885 cc_check -lspeex $_ld_lm && _speex=yes
5887 if test "$_speex" = yes ; then
5888 _def_speex='#define HAVE_SPEEX 1'
5889 _ld_extra="$_ld_extra -lspeex"
5890 _codecmodules="speex $_codecmodules"
5891 else
5892 _def_speex='#undef HAVE_SPEEX'
5893 _nocodecmodules="speex $_nocodecmodules"
5895 echores "$_speex"
5897 echocheck "OggTheora support"
5898 if test "$_theora" = auto ; then
5899 _theora=no
5900 cat > $TMPC << EOF
5901 #include <theora/theora.h>
5902 #include <string.h>
5903 int main(void)
5905 /* theora is in flux, make sure that all interface routines and
5906 * datatypes exist and work the way we expect it, so we don't break
5907 * mplayer */
5908 ogg_packet op;
5909 theora_comment tc;
5910 theora_info inf;
5911 theora_state st;
5912 yuv_buffer yuv;
5913 int r;
5914 double t;
5916 theora_info_init (&inf);
5917 theora_comment_init (&tc);
5919 return 0;
5921 /* we don't want to execute this kind of nonsense; just for making sure
5922 * that compilation works... */
5923 memset(&op, 0, sizeof(op));
5924 r = theora_decode_header (&inf, &tc, &op);
5925 r = theora_decode_init (&st, &inf);
5926 t = theora_granule_time (&st, op.granulepos);
5927 r = theora_decode_packetin (&st, &op);
5928 r = theora_decode_YUVout (&st, &yuv);
5929 theora_clear (&st);
5931 return 0;
5934 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5935 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5936 && _theora=yes && break
5937 done
5938 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5939 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5940 cc_check -I. tremor/bitwise.c $_ld_theora \
5941 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5942 done
5945 if test "$_theora" = yes ; then
5946 _def_theora='#define HAVE_OGGTHEORA 1'
5947 _codecmodules="libtheora $_codecmodules"
5948 # when --enable-theora is forced, we'd better provide a probably sane
5949 # $_ld_theora than nothing
5950 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5951 else
5952 _def_theora='#undef HAVE_OGGTHEORA'
5953 _nocodecmodules="libtheora $_nocodecmodules"
5955 echores "$_theora"
5957 echocheck "internal mp3lib support"
5958 if test "$_mp3lib" = yes ; then
5959 _def_mp3lib='#define USE_MP3LIB 1'
5960 _codecmodules="mp3lib $_codecmodules"
5961 else
5962 _def_mp3lib='#undef USE_MP3LIB'
5963 _nocodecmodules="mp3lib $_nocodecmodules"
5965 echores "$_mp3lib"
5967 echocheck "internal liba52 support"
5968 if test "$_liba52" = yes ; then
5969 _def_liba52='#define USE_LIBA52 1'
5970 _codecmodules="liba52 $_codecmodules"
5971 else
5972 _def_liba52='#undef USE_LIBA52'
5973 _nocodecmodules="liba52 $_nocodecmodules"
5975 echores "$_liba52"
5977 echocheck "libdca support"
5978 if test "$_libdca" = auto ; then
5979 _libdca=no
5980 cat > $TMPC << EOF
5981 #include <inttypes.h>
5982 #include <dts.h>
5983 int main(void) { dts_init (0); return 0; }
5985 for _ld_dca in -ldts -ldca ; do
5986 cc_check $_ld_dca $_ld_lm && _ld_extra="$_ld_extra $_ld_dca" \
5987 && _libdca=yes && break
5988 done
5990 if test "$_libdca" = yes ; then
5991 _def_libdca='#define USE_LIBDCA 1'
5992 _codecmodules="libdca $_codecmodules"
5993 else
5994 _def_libdca='#undef USE_LIBDCA'
5995 _nocodecmodules="libdca $_nocodecmodules"
5997 echores "$_libdca"
5999 echocheck "internal libmpeg2 support"
6000 if test "$_libmpeg2" = yes ; then
6001 _def_libmpeg2='#define USE_LIBMPEG2 1'
6002 _codecmodules="libmpeg2 $_codecmodules"
6003 else
6004 _def_libmpeg2='#undef USE_LIBMPEG2'
6005 _nocodecmodules="libmpeg2 $_nocodecmodules"
6007 echores "$_libmpeg2"
6009 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6010 if test "$_musepack" = auto ; then
6011 _musepack=no
6012 cat > $TMPC << EOF
6013 #include <mpcdec/mpcdec.h>
6014 int main(void) {
6015 mpc_streaminfo info;
6016 mpc_decoder decoder;
6017 mpc_decoder_set_streaminfo(&decoder, &info);
6018 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6021 cc_check -lmpcdec $_ld_lm && _musepack=yes
6023 if test "$_musepack" = yes ; then
6024 _def_musepack='#define HAVE_MUSEPACK 1'
6025 _ld_extra="$_ld_extra -lmpcdec"
6026 _codecmodules="musepack $_codecmodules"
6027 else
6028 _def_musepack='#undef HAVE_MUSEPACK'
6029 _nocodecmodules="musepack $_nocodecmodules"
6031 echores "$_musepack"
6034 echocheck "FAAC (AAC encoder) support"
6035 if test "$_faac" = auto ; then
6036 cat > $TMPC <<EOF
6037 #include <inttypes.h>
6038 #include <faac.h>
6039 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6041 _faac=no
6042 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6043 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6044 done
6046 if test "$_faac" = yes ; then
6047 _def_faac="#define HAVE_FAAC 1"
6048 if echo $_libavencoders | grep -q FAAC ; then
6049 _lavc_faac=yes
6050 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
6051 _libs_mplayer="$_libs_mplayer $_ld_faac"
6052 else
6053 _lavc_faac=no
6054 _def_lavc_faac="#undef CONFIG_LIBFAAC"
6056 _codecmodules="faac $_codecmodules"
6057 else
6058 _def_faac="#undef HAVE_FAAC"
6059 _nocodecmodules="faac $_nocodecmodules"
6060 _libavencoders=`echo $_libavencoders | sed -e s/LIBFAAC_ENCODER// `
6062 echores "$_faac (in libavcodec: $_lavc_faac)"
6065 echocheck "FAAD2 (AAC) support"
6066 if test "$_faad_internal" = auto ; then
6067 if x86_32 && test cc_vendor=gnu; then
6068 case $cc_version in
6069 3.1*|3.2) # ICE/insn with these versions
6070 _faad_internal=no
6071 _res_comment="broken gcc"
6074 _faad_internal=yes
6076 esac
6077 else
6078 _faad_internal=yes
6080 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6081 _faad_external=no
6082 cat > $TMPC << EOF
6083 #include <faad.h>
6084 #ifndef FAAD_MIN_STREAMSIZE
6085 #error Too old version
6086 #endif
6087 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6089 cc_check -lfaad $_ld_lm && _faad_external=yes
6092 if test "$_faad_internal" = yes ; then
6093 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6094 _faad=yes
6095 _res_comment="internal floating-point"
6096 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
6097 elif test "$_faad_external" = yes ; then
6098 _faad=yes
6099 _ld_extra="$_ld_extra -lfaad"
6100 else
6101 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6102 _faad=no
6105 if test "$_faad" = yes ; then
6106 _def_faad='#define HAVE_FAAD 1'
6107 _codecmodules="faad2 $_codecmodules"
6108 else
6109 _def_faad='#undef HAVE_FAAD'
6110 _nocodecmodules="faad2 $_nocodecmodules"
6112 echores "$_faad"
6115 echocheck "LADSPA plugin support"
6116 if test "$_ladspa" = auto ; then
6117 cat > $TMPC <<EOF
6118 #include <stdio.h>
6119 #include <ladspa.h>
6120 int main(void) {
6121 const LADSPA_Descriptor *ld = NULL;
6122 return 0;
6125 _ladspa=no
6126 cc_check && _ladspa=yes
6128 if test "$_ladspa" = yes; then
6129 _def_ladspa="#define HAVE_LADSPA"
6130 _afsrc="$_afsrc af_ladspa.c"
6131 _afmodules="ladspa $_afmodules"
6132 else
6133 _def_ladspa="#undef HAVE_LADSPA"
6134 _noafmodules="ladspa $_noafmodules"
6136 echores "$_ladspa"
6139 if test -z "$_codecsdir" ; then
6140 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6141 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6142 if test -d "$dir" ; then
6143 _codecsdir="$dir"
6144 break;
6146 done
6148 # Fall back on default directory.
6149 if test -z "$_codecsdir" ; then
6150 _codecsdir="$_libdir/codecs"
6151 mingw32 && _codecsdir="codecs"
6155 echocheck "Win32 codecs"
6156 if test "$_win32dll" = auto ; then
6157 _win32dll=no
6158 if x86_32 && not qnx; then
6159 _win32dll=yes
6162 if test "$_win32dll" = yes ; then
6163 _def_win32dll='#define USE_WIN32DLL 1'
6164 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6165 _res_comment="using $_win32codecsdir"
6166 if not win32 ; then
6167 _def_win32_loader='#define WIN32_LOADER 1'
6168 else
6169 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6170 _res_comment="using native windows"
6172 _codecmodules="win32 $_codecmodules"
6173 else
6174 _def_win32dll='#undef USE_WIN32DLL'
6175 _def_win32_loader='#undef WIN32_LOADER'
6176 _nocodecmodules="win32 $_nocodecmodules"
6178 echores "$_win32dll"
6181 echocheck "XAnim codecs"
6182 if test "$_xanim" = auto ; then
6183 _xanim=no
6184 _res_comment="dynamic loader support needed"
6185 if test "$_dl" = yes ; then
6186 _xanim=yes
6189 if test "$_xanim" = yes ; then
6190 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6191 _def_xanim='#define USE_XANIM 1'
6192 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6193 _codecmodules="xanim $_codecmodules"
6194 _res_comment="using $_xanimcodecsdir"
6195 else
6196 _def_xanim='#undef USE_XANIM'
6197 _def_xanim_path='#undef XACODEC_PATH'
6198 _nocodecmodules="xanim $_nocodecmodules"
6200 echores "$_xanim"
6203 echocheck "RealPlayer codecs"
6204 if test "$_real" = auto ; then
6205 _real=no
6206 _res_comment="dynamic loader support needed"
6207 if test "$_dl" = yes || test "$_win32dll" = yes &&
6208 (linux || freebsd || netbsd || win32 || darwin) ; then
6209 _real=yes
6212 if test "$_real" = yes ; then
6213 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6214 _def_real='#define USE_REALCODECS 1'
6215 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6216 _codecmodules="real $_codecmodules"
6217 _res_comment="using $_realcodecsdir"
6218 else
6219 _def_real='#undef USE_REALCODECS'
6220 _def_real_path="#undef REALCODEC_PATH"
6221 _nocodecmodules="real $_nocodecmodules"
6223 echores "$_real"
6226 echocheck "QuickTime codecs"
6227 if test "$_qtx" = auto ; then
6228 test "$_win32dll" = yes || darwin && _qtx=yes
6230 if test "$_qtx" = yes ; then
6231 _def_qtx='#define USE_QTX_CODECS 1'
6232 _codecmodules="qtx $_codecmodules"
6233 else
6234 _def_qtx='#undef USE_QTX_CODECS'
6235 _nocodecmodules="qtx $_nocodecmodules"
6237 echores "$_qtx"
6239 echocheck "Nemesi Streaming Media libraries"
6240 if test "$_nemesi" = auto && test "$_network" = yes ; then
6241 _nemesi=no
6242 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6243 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6244 _nemesi=yes
6247 if test "$_nemesi" = yes; then
6248 _native_rtsp=no
6249 _def_nemesi='#define LIBNEMESI 1'
6250 _inputmodules="nemesi $_inputmodules"
6251 else
6252 _native_rtsp="$_network"
6253 _nemesi=no
6254 _def_nemesi='#undef LIBNEMESI'
6255 _noinputmodules="nemesi $_noinputmodules"
6257 echores "$_nemesi"
6259 echocheck "LIVE555 Streaming Media libraries"
6260 if test "$_live" = auto && test "$_network" = yes ; then
6261 cat > $TMPCPP << EOF
6262 #include <liveMedia.hh>
6263 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6264 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6265 #endif
6266 int main(void) {}
6269 _live=no
6270 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6271 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6272 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6273 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6274 $_livelibdir/groupsock/libgroupsock.a \
6275 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6276 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6277 $_ld_extra -lstdc++" \
6278 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6279 -I$_livelibdir/UsageEnvironment/include \
6280 -I$_livelibdir/BasicUsageEnvironment/include \
6281 -I$_livelibdir/groupsock/include" && \
6282 _live=yes && break
6283 done
6284 if test "$_live" != yes ; then
6285 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6286 _live_dist=yes
6290 if test "$_live" = yes && test "$_network" = yes && test "$_nemesi" = no; then
6291 _res_comment="using $_livelibdir"
6292 _def_live='#define STREAMING_LIVE555 1'
6293 _inputmodules="live555 $_inputmodules"
6294 elif test "$_live_dist" = yes && test "$_network" = yes && test "$_nemesi" = no; then
6295 _res_comment="using distribution version"
6296 _live="yes"
6297 _def_live='#define STREAMING_LIVE555 1'
6298 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6299 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6300 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6301 _inputmodules="live555 $_inputmodules"
6302 else
6303 _live=no
6304 _def_live='#undef STREAMING_LIVE555'
6305 _noinputmodules="live555 $_noinputmodules"
6307 echores "$_live"
6310 echocheck "FFmpeg libavutil"
6311 if test "$_libavutil_a" = auto ; then
6312 if test -d libavutil ; then
6313 _libavutil_a=yes
6314 _res_comment="static"
6315 else
6316 die "MPlayer will not compile without libavutil in the source tree."
6318 elif test "$_libavutil_so" = auto ; then
6319 _libavutil_so=no
6320 cat > $TMPC << EOF
6321 #include <ffmpeg/common.h>
6322 int main(void) { ff_gcd(1,1); return 0; }
6324 if $_pkg_config --exists libavutil ; then
6325 _inc_libavutil=`$_pkg_config --cflags libavutil`
6326 _ld_tmp=`$_pkg_config --libs libavutil`
6327 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6328 && _libavutil_so=yes
6329 elif cc_check -lavutil $_ld_lm ; then
6330 _ld_extra="$_ld_extra -lavutil"
6331 _libavutil_so=yes
6332 _res_comment="using libavutil.so, but static libavutil is recommended"
6335 _libavutil=no
6336 _def_libavutil='#undef USE_LIBAVUTIL'
6337 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6338 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6339 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6340 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6341 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6342 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6343 # neither static nor shared libavutil is available, but it is mandatory ...
6344 if test "$_libavutil" = no ; then
6345 die "You need static or shared libavutil, MPlayer will not compile without!"
6347 echores "$_libavutil"
6349 echocheck "FFmpeg libavcodec"
6350 if test "$_libavcodec_a" = auto ; then
6351 _libavcodec_a=no
6352 if test -d libavcodec && test -f libavcodec/utils.c ; then
6353 _libavcodec_a="yes"
6354 _res_comment="static"
6356 elif test "$_libavcodec_so" = auto ; then
6357 _libavcodec_so=no
6358 _res_comment="libavcodec.so is discouraged over static libavcodec"
6359 cat > $TMPC << EOF
6360 #include <ffmpeg/avcodec.h>
6361 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6363 if $_pkg_config --exists libavcodec ; then
6364 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6365 _ld_tmp=`$_pkg_config --libs libavcodec`
6366 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6367 && _libavcodec_so=yes
6368 elif cc_check -lavcodec $_ld_lm ; then
6369 _ld_extra="$_ld_extra -lavcodec"
6370 _libavcodec_so=yes
6371 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6374 _libavcodec=no
6375 _def_libavcodec='#undef USE_LIBAVCODEC'
6376 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6377 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6378 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6379 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6380 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6381 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6382 test "$_libavcodec_mpegaudio_hp" = yes \
6383 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6384 if test "$_libavcodec_a" = yes ; then
6385 _codecmodules="libavcodec $_codecmodules"
6386 elif test "$_libavcodec_so" = yes ; then
6387 _codecmodules="libavcodec.so $_codecmodules"
6388 else
6389 _nocodecmodules="libavcodec $_nocodecmodules"
6391 echores "$_libavcodec"
6393 echocheck "FFmpeg libavformat"
6394 if test "$_libavformat_a" = auto ; then
6395 _libavformat_a=no
6396 if test -d libavformat && test -f libavformat/utils.c ; then
6397 _libavformat_a=yes
6398 _res_comment="static"
6400 elif test "$_libavformat_so" = auto ; then
6401 _libavformat_so=no
6402 cat > $TMPC <<EOF
6403 #include <ffmpeg/avformat.h>
6404 #include <ffmpeg/opt.h>
6405 int main(void) { av_alloc_format_context(); return 0; }
6407 if $_pkg_config --exists libavformat ; then
6408 _inc_libavformat=`$_pkg_config --cflags libavformat`
6409 _ld_tmp=`$_pkg_config --libs libavformat`
6410 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6411 && _libavformat_so=yes
6412 elif cc_check $_ld_lm -lavformat ; then
6413 _ld_extra="$_ld_extra -lavformat"
6414 _libavformat_so=yes
6415 _res_comment="using libavformat.so, but static libavformat is recommended"
6418 _libavformat=no
6419 _def_libavformat='#undef USE_LIBAVFORMAT'
6420 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6421 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6422 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6423 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6424 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6425 test "$_libavformat_so" = yes \
6426 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6427 echores "$_libavformat"
6429 echocheck "FFmpeg libpostproc"
6430 if test "$_libpostproc_a" = auto ; then
6431 _libpostproc_a=no
6432 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6433 _libpostproc_a='yes'
6434 _res_comment="static"
6436 elif test "$_libpostproc_so" = auto ; then
6437 _libpostproc_so=no
6438 cat > $TMPC << EOF
6439 #define USE_LIBPOSTPROC 1
6440 #include <inttypes.h>
6441 #include <postproc/postprocess.h>
6442 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6444 if cc_check -lpostproc $_ld_lm ; then
6445 _ld_extra="$_ld_extra -lpostproc"
6446 _libpostproc_so=yes
6447 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6450 _libpostproc=no
6451 _def_libpostproc='#undef USE_LIBPOSTPROC'
6452 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6453 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6454 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6455 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6456 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6457 test "$_libpostproc_so" = yes \
6458 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6459 echores "$_libpostproc"
6462 echocheck "libamr narrowband"
6463 if test "$_libamr_nb" = auto ; then
6464 _libamr_nb=no
6465 cat > $TMPC << EOF
6466 #include <amrnb/interf_dec.h>
6467 int main(void) { Speech_Decode_Frame_init(); return 0; }
6469 cc_check -lamrnb && _libamr_nb=yes
6470 if test "$_libavcodec_a" != yes ; then
6471 _libamr_nb=no
6472 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6475 if test "$_libamr_nb" = yes ; then
6476 _libamr=yes
6477 _ld_extra="$_ld_extra -lamrnb"
6478 _def_libamr='#define CONFIG_LIBAMR 1'
6479 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6480 _codecmodules="libamr_nb $_codecmodules"
6481 else
6482 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6483 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6484 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6485 _nocodecmodules="libamr_nb $_nocodecmodules"
6487 echores "$_libamr_nb"
6490 echocheck "libamr wideband"
6491 if test "$_libamr_wb" = auto ; then
6492 _libamr_wb=no
6493 cat > $TMPC << EOF
6494 #include <amrwb/dec_if.h>
6495 int main(void) { D_IF_init(); return 0; }
6497 cc_check -lamrwb && _libamr_wb=yes
6498 if test "$_libavcodec_a" != yes ; then
6499 _libamr_wb=no
6500 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6503 if test "$_libamr_wb" = yes ; then
6504 _libamr=yes
6505 _ld_extra="$_ld_extra -lamrwb"
6506 _def_libamr='#define CONFIG_LIBAMR 1'
6507 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6508 _codecmodules="libamr_wb $_codecmodules"
6509 else
6510 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6511 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6512 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6513 _nocodecmodules="libamr_wb $_nocodecmodules"
6515 echores "$_libamr_wb"
6517 echocheck "libdv-0.9.5+"
6518 if test "$_libdv" = auto ; then
6519 _libdv=no
6520 cat > $TMPC <<EOF
6521 #include <libdv/dv.h>
6522 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6524 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6526 if test "$_libdv" = yes ; then
6527 _def_libdv='#define HAVE_LIBDV095 1'
6528 _ld_extra="$_ld_extra -ldv"
6529 _codecmodules="libdv $_codecmodules"
6530 else
6531 _def_libdv='#undef HAVE_LIBDV095'
6532 _nocodecmodules="libdv $_nocodecmodules"
6534 echores "$_libdv"
6537 echocheck "XviD"
6538 if test "$_xvid" = auto ; then
6539 _xvid=no
6540 cat > $TMPC << EOF
6541 #include <xvid.h>
6542 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6544 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6545 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6546 done
6549 if test "$_xvid" = yes ; then
6550 _def_xvid='#define HAVE_XVID4 1'
6551 _codecmodules="xvid $_codecmodules"
6552 else
6553 _def_xvid='#undef HAVE_XVID4'
6554 _nocodecmodules="xvid $_nocodecmodules"
6555 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6557 echores "$_xvid"
6559 if test "$_xvid" = yes ; then
6560 echocheck "XviD two pass plugin"
6561 cat > $TMPC << EOF
6562 #include <xvid.h>
6563 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6565 if cc_check ; then
6566 _lavc_xvid=yes
6567 _def_lavc_xvid='#define CONFIG_LIBXVID 1'
6568 else
6569 _lavc_xvid=no
6570 _def_lavc_xvid='#undef CONFIG_LIBXVID'
6571 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6573 echores "$_lavc_xvid"
6577 echocheck "x264"
6578 if test "$_x264" = auto ; then
6579 cat > $TMPC << EOF
6580 #include <inttypes.h>
6581 #include <x264.h>
6582 #if X264_BUILD < 53
6583 #error We do not support old versions of x264. Get the latest from SVN.
6584 #endif
6585 int main(void) { x264_encoder_open((void*)0); return 0; }
6587 _x264=no
6588 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6589 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6590 done
6593 if test "$_x264" = yes ; then
6594 _def_x264='#define HAVE_X264 1'
6595 _codecmodules="x264 $_codecmodules"
6596 if echo $_libavencoders | grep -q X264 ; then
6597 _lavc_x264=yes
6598 _def_lavc_x264='#define CONFIG_LIBX264 1'
6599 _libs_mplayer="$_libs_mplayer $_ld_x264"
6600 else
6601 _lavc_x264=no
6602 _def_lavc_x264='#undef CONFIG_LIBX264'
6604 else
6605 _lavc_x264=no
6606 _def_x264='#undef HAVE_X264'
6607 _def_lavc_x264='#undef CONFIG_LIBX264'
6608 _nocodecmodules="x264 $_nocodecmodules"
6609 _libavencoders=`echo $_libavencoders | sed -e s/LIBX264_ENCODER// `
6611 echores "$_x264 (in libavcodec: $_lavc_x264)"
6614 echocheck "libnut"
6615 if test "$_libnut" = auto ; then
6616 cat > $TMPC << EOF
6617 #include <stdio.h>
6618 #include <stdlib.h>
6619 #include <inttypes.h>
6620 #include <libnut.h>
6621 int main(void) { (void)nut_error(0); return 0; }
6623 _libnut=no
6624 cc_check -lnut && _libnut=yes
6627 if test "$_libnut" = yes ; then
6628 _def_libnut='#define HAVE_LIBNUT 1'
6629 _ld_extra="$_ld_extra -lnut"
6630 else
6631 _def_libnut='#undef HAVE_LIBNUT'
6632 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6634 echores "$_libnut"
6637 # mencoder requires (optional) those libs: libmp3lame
6638 if test "$_mencoder" != no ; then
6640 echocheck "libmp3lame (for mencoder)"
6641 _mp3lame=no
6642 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6643 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6644 cat > $TMPC <<EOF
6645 #include <lame/lame.h>
6646 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; }
6648 # Note: libmp3lame usually depends on vorbis
6649 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6650 if test "$_mp3lame" = yes ; then
6651 _def_mp3lame="#define HAVE_MP3LAME"
6652 _ld_mp3lame=-lmp3lame
6653 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6654 cat > $TMPC << EOF
6655 #include <lame/lame.h>
6656 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6658 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6659 cat > $TMPC << EOF
6660 #include <lame/lame.h>
6661 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6663 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6664 if echo $_libavencoders | grep -q MP3LAME ; then
6665 _lavc_mp3lame=yes
6666 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6667 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6668 else
6669 _lavc_mp3lame=no
6670 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6672 else
6673 _def_mp3lame='#undef HAVE_MP3LAME'
6674 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6676 echores "$_mp3lame"
6680 echocheck "mencoder"
6681 _mencoder_flag='#undef HAVE_MENCODER'
6682 if test "$_mencoder" = yes ; then
6683 _mencoder_flag='#define HAVE_MENCODER'
6684 _def_muxers='#define CONFIG_MUXERS 1'
6685 else
6686 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6687 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6688 _libavmuxers=""
6690 echores "$_mencoder"
6692 echocheck "fastmemcpy"
6693 # fastmemcpy check is done earlier with tests of CPU & binutils features
6694 if test "$_fastmemcpy" = yes ; then
6695 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6696 else
6697 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6699 echores "$_fastmemcpy"
6701 echocheck "UniquE RAR File Library"
6702 if test "$_unrarlib" = yes ; then
6703 _def_unrarlib='#define USE_UNRARLIB 1'
6704 else
6705 _def_unrarlib='#undef USE_UNRARLIB'
6707 echores "$_unrarlib"
6709 echocheck "TV interface"
6710 if test "$_tv" = yes ; then
6711 _def_tv='#define USE_TV 1'
6712 _inputmodules="tv $_inputmodules"
6713 else
6714 _noinputmodules="tv $_noinputmodules"
6715 _def_tv='#undef USE_TV'
6717 echores "$_tv"
6720 if bsd; then
6721 echocheck "*BSD BT848 bt8xx header"
6722 _ioctl_bt848_h=no
6723 for file in "machine/ioctl_bt848.h" \
6724 "dev/bktr/ioctl_bt848.h" \
6725 "dev/video/bktr/ioctl_bt848.h" \
6726 "dev/ic/bt8xx.h" ; do
6727 cat > $TMPC <<EOF
6728 #include <sys/types.h>
6729 #include <sys/ioctl.h>
6730 #include <$file>
6731 int main(void) {
6732 ioctl(0, TVTUNER_GETFREQ, 0);
6733 return 0;
6736 if cc_check ; then
6737 _ioctl_bt848_h=yes
6738 _ioctl_bt848_h_name="$file"
6739 break;
6741 done
6742 if test "$_ioctl_bt848_h" = yes ; then
6743 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6744 _res_comment="using $_ioctl_bt848_h_name"
6745 else
6746 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6748 echores "$_ioctl_bt848_h"
6750 echocheck "*BSD ioctl_meteor.h"
6751 _ioctl_meteor_h=no
6752 for file in "machine/ioctl_meteor.h" \
6753 "dev/bktr/ioctl_meteor.h" \
6754 "dev/video/bktr/ioctl_meteor.h" ; do
6755 cat > $TMPC <<EOF
6756 #include <sys/types.h>
6757 #include <$file>
6758 int main(void) {
6759 ioctl(0, METEORSINPUT, 0);
6760 return 0;
6763 if cc_check ; then
6764 _ioctl_meteor_h=yes
6765 _ioctl_meteor_h_name="$file"
6766 break;
6768 done
6769 if test "$_ioctl_meteor_h" = yes ; then
6770 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6771 _res_comment="using $_ioctl_meteor_h_name"
6772 else
6773 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6775 echores "$_ioctl_meteor_h"
6777 echocheck "*BSD BrookTree 848 TV interface"
6778 if test "$_tv_bsdbt848" = auto ; then
6779 _tv_bsdbt848=no
6780 if test "$_tv" = yes ; then
6781 cat > $TMPC <<EOF
6782 #include <sys/types.h>
6783 $_def_ioctl_meteor_h_name
6784 $_def_ioctl_bt848_h_name
6785 #ifdef IOCTL_METEOR_H_NAME
6786 #include IOCTL_METEOR_H_NAME
6787 #endif
6788 #ifdef IOCTL_BT848_H_NAME
6789 #include IOCTL_BT848_H_NAME
6790 #endif
6791 int main(void){
6792 ioctl(0, METEORSINPUT, 0);
6793 ioctl(0, TVTUNER_GETFREQ, 0);
6794 return 0;
6797 cc_check && _tv_bsdbt848=yes
6800 if test "$_tv_bsdbt848" = yes ; then
6801 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6802 _inputmodules="tv-bsdbt848 $_inputmodules"
6803 else
6804 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6805 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6807 echores "$_tv_bsdbt848"
6808 fi #if bsd
6811 echocheck "DirectShow TV interface"
6812 if test "$_tv_dshow" = auto ; then
6813 _tv_dshow=no
6814 if test "$_tv" = yes && win32 ; then
6815 cat > $TMPC <<EOF
6816 #include <ole2.h>
6817 int main(void) {
6818 void* p;
6819 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6820 return 0;
6823 cc_check -lole32 -luuid && _tv_dshow=yes
6826 if test "$_tv_dshow" = yes ; then
6827 _inputmodules="tv-dshow $_inputmodules"
6828 _def_tv_dshow='#define HAVE_TV_DSHOW 1'
6829 _ld_extra="$_ld_extra -lole32 -luuid"
6830 else
6831 _noinputmodules="tv-dshow $_noinputmodules"
6832 _def_tv_dshow='#undef HAVE_TV_DSHOW'
6834 echores "$_tv_dshow"
6837 echocheck "Video 4 Linux TV interface"
6838 if test "$_tv_v4l1" = auto ; then
6839 _tv_v4l1=no
6840 if test "$_tv" = yes && linux ; then
6841 cat > $TMPC <<EOF
6842 #include <stdlib.h>
6843 #include <linux/videodev.h>
6844 int main(void) { return 0; }
6846 cc_check && _tv_v4l1=yes
6849 if test "$_tv_v4l1" = yes ; then
6850 _audio_input=yes
6851 _tv_v4l=yes
6852 _def_tv_v4l='#define HAVE_TV_V4L 1'
6853 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6854 _inputmodules="tv-v4l $_inputmodules"
6855 else
6856 _noinputmodules="tv-v4l1 $_noinputmodules"
6857 _def_tv_v4l='#undef HAVE_TV_V4L'
6859 echores "$_tv_v4l1"
6862 echocheck "Video 4 Linux 2 TV interface"
6863 if test "$_tv_v4l2" = auto ; then
6864 _tv_v4l2=no
6865 if test "$_tv" = yes && linux ; then
6866 cat > $TMPC <<EOF
6867 #include <stdlib.h>
6868 #include <linux/types.h>
6869 #include <linux/videodev2.h>
6870 int main(void) { return 0; }
6872 cc_check && _tv_v4l2=yes
6875 if test "$_tv_v4l2" = yes ; then
6876 _audio_input=yes
6877 _tv_v4l=yes
6878 _def_tv_v4l='#define HAVE_TV_V4L 1'
6879 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6880 _inputmodules="tv-v4l2 $_inputmodules"
6881 else
6882 _noinputmodules="tv-v4l2 $_noinputmodules"
6883 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6885 echores "$_tv_v4l2"
6888 echocheck "TV teletext interface"
6889 if test "$_tv_teletext" = auto ; then
6890 _tv_teletext=no
6891 if test "$_freetype" = yes && test "$_pthreads" = yes; then
6892 if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes; then
6893 _tv_teletext=yes
6897 if test "$_tv_teletext" = yes ; then
6898 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6899 _inputmodules="tv-teletext $_inputmodules"
6900 else
6901 _noinputmodules="tv-teletext $_noinputmodules"
6902 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6904 echores "$_tv_teletext"
6907 echocheck "Radio interface"
6908 if test "$_radio" = yes ; then
6909 _def_radio='#define USE_RADIO 1'
6910 _inputmodules="radio $_inputmodules"
6911 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6912 _radio_capture=no
6914 if test "$_radio_capture" = yes ; then
6915 _audio_input=yes
6916 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6917 else
6918 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6920 else
6921 _noinputmodules="radio $_noinputmodules"
6922 _def_radio='#undef USE_RADIO'
6923 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6924 _radio_capture=no
6926 echores "$_radio"
6927 echocheck "Capture for Radio interface"
6928 echores "$_radio_capture"
6930 echocheck "Video 4 Linux 2 Radio interface"
6931 if test "$_radio_v4l2" = auto ; then
6932 _radio_v4l2=no
6933 if test "$_radio" = yes && linux ; then
6934 cat > $TMPC <<EOF
6935 #include <stdlib.h>
6936 #include <linux/types.h>
6937 #include <linux/videodev2.h>
6938 int main(void) { return 0; }
6940 cc_check && _radio_v4l2=yes
6943 if test "$_radio_v4l2" = yes ; then
6944 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6945 else
6946 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6948 echores "$_radio_v4l2"
6950 echocheck "Video 4 Linux Radio interface"
6951 if test "$_radio_v4l" = auto ; then
6952 _radio_v4l=no
6953 if test "$_radio" = yes && linux ; then
6954 cat > $TMPC <<EOF
6955 #include <stdlib.h>
6956 #include <linux/videodev.h>
6957 int main(void) { return 0; }
6959 cc_check && _radio_v4l=yes
6962 if test "$_radio_v4l" = yes ; then
6963 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6964 else
6965 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6967 echores "$_radio_v4l"
6969 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6970 echocheck "*BSD BrookTree 848 Radio interface"
6971 _radio_bsdbt848=no
6972 cat > $TMPC <<EOF
6973 #include <sys/types.h>
6974 $_def_ioctl_bt848_h_name
6975 #ifdef IOCTL_BT848_H_NAME
6976 #include IOCTL_BT848_H_NAME
6977 #endif
6978 int main(void){
6979 ioctl(0, RADIO_GETFREQ, 0);
6980 return 0;
6983 cc_check && _radio_bsdbt848=yes
6984 echores "$_radio_bsdbt848"
6985 fi #if bsd && radio && radio_bsdbt848
6987 if test "$_radio_bsdbt848" = yes ; then
6988 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
6989 else
6990 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
6993 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6994 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6995 die "Radio driver requires BSD BT848, V4L or V4L2!"
6998 echocheck "Video 4 Linux 2 MPEG PVR interface"
6999 if test "$_pvr" = auto ; then
7000 _pvr=no
7001 if test "$_tv_v4l2" = yes && linux ; then
7002 cat > $TMPC <<EOF
7003 #include <stdlib.h>
7004 #include <inttypes.h>
7005 #include <linux/types.h>
7006 #include <linux/videodev2.h>
7007 int main(void) { struct v4l2_ext_controls ext; return 0; }
7009 cc_check && _pvr=yes
7012 if test "$_pvr" = yes ; then
7013 _def_pvr='#define HAVE_PVR 1'
7014 _inputmodules="pvr $_inputmodules"
7015 else
7016 _noinputmodules="pvr $_noinputmodules"
7017 _def_pvr='#undef HAVE_PVR'
7019 echores "$_pvr"
7022 echocheck "audio select()"
7023 if test "$_select" = no ; then
7024 _def_select='#undef HAVE_AUDIO_SELECT'
7025 elif test "$_select" = yes ; then
7026 _def_select='#define HAVE_AUDIO_SELECT 1'
7028 echores "$_select"
7031 echocheck "ftp"
7032 if not beos && test "$_ftp" = yes ; then
7033 _def_ftp='#define HAVE_FTP 1'
7034 _inputmodules="ftp $_inputmodules"
7035 else
7036 _noinputmodules="ftp $_noinputmodules"
7037 _def_ftp='#undef HAVE_FTP'
7039 echores "$_ftp"
7041 echocheck "vstream client"
7042 if test "$_vstream" = auto ; then
7043 _vstream=no
7044 cat > $TMPC <<EOF
7045 #include <vstream-client.h>
7046 void vstream_error(const char *format, ... ) {}
7047 int main(void) { vstream_start(); return 0; }
7049 cc_check -lvstream-client && _vstream=yes
7051 if test "$_vstream" = yes ; then
7052 _def_vstream='#define HAVE_VSTREAM 1'
7053 _inputmodules="vstream $_inputmodules"
7054 _ld_extra="$_ld_extra -lvstream-client"
7055 else
7056 _noinputmodules="vstream $_noinputmodules"
7057 _def_vstream='#undef HAVE_VSTREAM'
7059 echores "$_vstream"
7061 # endian testing
7062 echocheck "byte order"
7063 if test "$_big_endian" = auto ; then
7064 cat > $TMPC <<EOF
7065 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7066 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7067 int main(void){
7068 return (int)ascii_name;
7071 if cc_check ; then
7072 if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
7073 _big_endian=yes
7074 else
7075 _big_endian=no
7077 else
7078 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7081 if test "$_big_endian" = yes ; then
7082 _byte_order='big-endian'
7083 _def_words_endian='#define WORDS_BIGENDIAN 1'
7084 else
7085 _byte_order='little-endian'
7086 _def_words_endian='#undef WORDS_BIGENDIAN'
7088 echores "$_byte_order"
7090 echocheck "OSD menu"
7091 if test "$_menu" = yes ; then
7092 _def_menu='#define HAVE_MENU 1'
7093 else
7094 _def_menu='#undef HAVE_MENU'
7096 echores "$_menu"
7099 echocheck "Subtitles sorting"
7100 if test "$_sortsub" = yes ; then
7101 _def_sortsub='#define USE_SORTSUB 1'
7102 else
7103 _def_sortsub='#undef USE_SORTSUB'
7105 echores "$_sortsub"
7108 echocheck "XMMS inputplugin support"
7109 if test "$_xmms" = yes ; then
7110 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7111 _xmmsplugindir=`xmms-config --input-plugin-dir`
7112 _xmmslibdir=`xmms-config --exec-prefix`/lib
7113 else
7114 _xmmsplugindir=/usr/lib/xmms/Input
7115 _xmmslibdir=/usr/lib
7118 _def_xmms='#define HAVE_XMMS 1'
7119 if darwin ; then
7120 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7121 else
7122 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7124 else
7125 _def_xmms='#undef HAVE_XMMS'
7127 echores "$_xmms"
7129 echocheck "inet6"
7130 if test "$_inet6" = auto ; then
7131 cat > $TMPC << EOF
7132 #include <sys/types.h>
7133 #if !defined(_WIN32) || defined(__CYGWIN__)
7134 #include <sys/socket.h>
7135 #include <netinet/in.h>
7136 #else
7137 #include <ws2tcpip.h>
7138 #endif
7139 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7141 _inet6=no
7142 if cc_check $_ld_sock ; then
7143 _inet6=yes
7146 if test "$_inet6" = yes ; then
7147 _def_inet6='#define HAVE_AF_INET6 1'
7148 else
7149 _def_inet6='#undef HAVE_AF_INET6'
7151 echores "$_inet6"
7154 echocheck "gethostbyname2"
7155 if test "$_gethostbyname2" = auto ; then
7156 cat > $TMPC << EOF
7157 #include <sys/types.h>
7158 #include <sys/socket.h>
7159 #include <netdb.h>
7160 int main(void) { gethostbyname2("", AF_INET); }
7162 _gethostbyname2=no
7163 if cc_check ; then
7164 _gethostbyname2=yes
7168 if test "$_gethostbyname2" = yes ; then
7169 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7170 else
7171 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7173 echores "$_gethostbyname2"
7176 # --------------- GUI specific tests begin -------------------
7177 echocheck "GUI"
7178 echo "$_gui"
7179 if test "$_gui" = yes ; then
7181 # Required libraries
7182 if test "$_libavcodec" != yes ||
7183 not "echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1" ; then
7184 die "The GUI requires libavcodec with PNG support (needs zlib)."
7186 if not win32 ; then
7187 test "$_x11" != yes && die "X11 support required for GUI compilation."
7189 echocheck "XShape extension"
7190 if test "$_xshape" = auto ; then
7191 _xshape=no
7192 cat > $TMPC << EOF
7193 #include <X11/Xlib.h>
7194 #include <X11/Xproto.h>
7195 #include <X11/Xutil.h>
7196 #include <X11/extensions/shape.h>
7197 #include <stdlib.h>
7198 int main(void) {
7199 char *name = ":0.0";
7200 Display *wsDisplay;
7201 int exitvar = 0;
7202 int eventbase, errorbase;
7203 if (getenv("DISPLAY"))
7204 name=getenv("DISPLAY");
7205 wsDisplay=XOpenDisplay(name);
7206 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7207 exitvar=1;
7208 XCloseDisplay(wsDisplay);
7209 return exitvar;
7212 cc_check -lXext && _xshape=yes
7214 if test "$_xshape" = yes ; then
7215 _def_xshape='#define HAVE_XSHAPE 1'
7216 else
7217 die "The GUI requires the X11 extension XShape (which was not found)."
7219 echores "$_xshape"
7221 #Check for GTK
7222 if test "$_gtk1" = no ; then
7223 #Check for GTK2 :
7224 echocheck "GTK+ version"
7226 if $_pkg_config gtk+-2.0 --exists ; then
7227 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7228 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7229 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7230 echores "$_gtk"
7232 # Check for GLIB2
7233 if $_pkg_config glib-2.0 --exists ; then
7234 echocheck "glib version"
7235 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7236 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7237 echores "$_glib"
7239 _def_gui='#define HAVE_NEW_GUI 1'
7240 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7241 else
7242 _gtk1=yes
7243 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7245 else
7246 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7247 _gtk1=yes
7251 if test "$_gtk1" = yes ; then
7252 # Check for old GTK (1.2.x)
7253 echocheck "GTK version"
7254 if test -z "$_gtkconfig" ; then
7255 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7256 _gtkconfig="gtk-config"
7257 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7258 _gtkconfig="gtk12-config"
7259 else
7260 die "The GUI requires GTK devel packages (which were not found)."
7263 _gtk=`$_gtkconfig --version 2>&1`
7264 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7265 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7266 echores "$_gtk (using $_gtkconfig)"
7268 # Check for GLIB
7269 echocheck "glib version"
7270 if test -z "$_glibconfig" ; then
7271 if ( glib-config --version ) >/dev/null 2>&1 ; then
7272 _glibconfig="glib-config"
7273 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7274 _glibconfig="glib12-config"
7275 else
7276 die "The GUI requires GLIB devel packages (which were not found)"
7279 _glib=`$_glibconfig --version 2>&1`
7280 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7281 echores "$_glib (using $_glibconfig)"
7283 _def_gui='#define HAVE_NEW_GUI 1'
7284 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7287 else #if not win32
7288 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7289 _def_gui='#define HAVE_NEW_GUI 1'
7290 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7291 fi #if not win32
7293 else #if test "$_gui"
7294 _def_gui='#undef HAVE_NEW_GUI'
7295 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7296 fi #if test "$_gui"
7297 # --------------- GUI specific tests end -------------------
7300 if test "$_charset" = "noconv" ; then
7301 _charset=""
7303 if test "$_charset" ; then
7304 _def_charset="#define MSG_CHARSET \"$_charset\""
7305 else
7306 _def_charset="#undef MSG_CHARSET"
7309 if test "$_charset" = "UTF-8" ; then
7310 # hack to disable conversion in the Makefile
7311 _charset=""
7314 if test "$_charset" ; then
7315 echocheck "iconv program"
7316 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7317 if test "$?" -ne 0 ; then
7318 echores "no"
7319 echo "No working iconv program found, use "
7320 echo "--charset=UTF-8 to continue anyway."
7321 echo "If you also have problems with iconv library functions use --charset=noconv."
7322 echo "Messages in the GTK-2 interface will be broken then."
7323 exit 1
7324 else
7325 echores "yes"
7329 #############################################################################
7331 echocheck "automatic gdb attach"
7332 if test "$_crash_debug" = yes ; then
7333 _def_crash_debug='#define CRASH_DEBUG 1'
7334 else
7335 _def_crash_debug='#undef CRASH_DEBUG'
7336 _crash_debug=no
7338 echores "$_crash_debug"
7340 echocheck "compiler support for noexecstack"
7341 cat > $TMPC <<EOF
7342 int main(void) { return 0; }
7344 if cc_check -Wl,-z,noexecstack ; then
7345 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7346 echores "yes"
7347 else
7348 echores "no"
7352 # Dynamic linking flags
7353 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7354 _ld_dl_dynamic=''
7355 bsd && _ld_dl_dynamic='-rdynamic'
7356 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7357 _ld_dl_dynamic='-rdynamic'
7360 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7361 bsdos && _ld_extra="$_ld_extra -ldvd"
7362 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7363 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7365 _def_debug='#undef MP_DEBUG'
7366 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7368 _def_linux='#undef TARGET_LINUX'
7369 linux && _def_linux='#define TARGET_LINUX 1'
7372 echocheck "joystick"
7373 _def_joystick='#undef HAVE_JOYSTICK'
7374 if test "$_joystick" = yes ; then
7375 if linux ; then
7376 # TODO add some check
7377 _def_joystick='#define HAVE_JOYSTICK 1'
7378 else
7379 _joystick="no (unsupported under $system_name)"
7382 echores "$_joystick"
7384 echocheck "lirc"
7385 if test "$_lirc" = auto ; then
7386 _lirc=no
7387 cat > $TMPC <<EOF
7388 #include <lirc/lirc_client.h>
7389 int main(void) { return 0; }
7391 cc_check -llirc_client && _lirc=yes
7393 if test "$_lirc" = yes ; then
7394 _def_lirc='#define HAVE_LIRC 1'
7395 _ld_extra="$_ld_extra -llirc_client"
7396 else
7397 _def_lirc='#undef HAVE_LIRC'
7399 echores "$_lirc"
7401 echocheck "lircc"
7402 if test "$_lircc" = auto ; then
7403 _lircc=no
7404 cat > $TMPC <<EOF
7405 #include <lirc/lircc.h>
7406 int main(void) { return 0; }
7408 cc_check -llircc && _lircc=yes
7410 if test "$_lircc" = yes ; then
7411 _def_lircc='#define HAVE_LIRCC 1'
7412 _ld_extra="$_ld_extra -llircc"
7413 else
7414 _def_lircc='#undef HAVE_LIRCC'
7416 echores "$_lircc"
7418 if arm; then
7419 # Detect maemo development platform libraries availability (http://www.maemo.org),
7420 # they are used when run on Nokia 770
7421 echocheck "maemo (Nokia 770)"
7422 if test "$_maemo" = auto ; then
7423 _maemo=no
7424 cat > $TMPC << EOF
7425 #include <libosso.h>
7426 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7428 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7430 if test "$_maemo" = yes ; then
7431 _def_maemo='#define HAVE_MAEMO 1'
7432 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7433 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7434 else
7435 _def_maemo='#undef HAVE_MAEMO'
7437 echores "$_maemo"
7440 echocheck "color console output"
7441 if test "$_color_console" = yes ; then
7442 _def_color_console='#define MSG_USE_COLORS 1'
7443 else
7444 _def_color_console='#undef MSG_USE_COLORS'
7446 echores "$_color_console"
7448 # linker paths should be the same for mencoder and mplayer
7449 _ld_tmp=""
7450 for I in $_libs_mplayer ; do
7451 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7452 if test -z "$_tmp" ; then
7453 _ld_extra="$I $_ld_extra"
7454 else
7455 _ld_tmp="$_ld_tmp $I"
7457 done
7458 _libs_mplayer=$_ld_tmp
7461 #############################################################################
7462 if darwin ; then
7463 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -shared-libgcc"
7464 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7465 CFLAGS="$CFLAGS -no-cpp-precomp"
7468 if amigaos ; then
7469 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__ -DSYS_AMIGAOS4"
7471 if hpux ; then
7472 # use flag for HPUX missing setenv()
7473 CFLAGS="$CFLAGS -DHPUX"
7475 # Thread support
7476 if linux ; then
7477 CFLAGS="$CFLAGS -D_REENTRANT"
7478 elif bsd ; then
7479 # FIXME bsd needs this so maybe other OS'es
7480 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7482 if cygwin ; then
7483 CFLAGS="$CFLAGS -D__CYGWIN__"
7485 # 64 bit file offsets?
7486 if test "$_largefiles" = yes || freebsd ; then
7487 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7488 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7489 # dvdread support requires this (for off64_t)
7490 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7491 cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
7495 # Make sure config.h gets included.
7496 if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then
7497 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
7500 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7501 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7503 cat > $TMPC << EOF
7504 int main(void) { return 0; }
7506 if test "$cc_vendor" = "gnu" ; then
7507 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7508 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7509 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7513 #this must be the last test to be performed or the ones following it will likely fail
7514 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7515 # to use its own copy of the library)
7516 echocheck "DVD support (libdvdnav)"
7517 if test "$_dvdnav" = auto ; then
7518 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7520 if test "$_dvdnav" = auto ; then
7521 cat > $TMPC <<EOF
7522 #include <inttypes.h>
7523 #include <dvdnav.h>
7524 int main(void) { dvdnav_t *dvd=0; return 0; }
7526 _dvdnav=no
7527 _dvdnavdir=`$_dvdnavconfig --cflags`
7528 _dvdnavlibs=`$_dvdnavconfig --libs`
7529 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7531 if test "$_dvdnav" = yes ; then
7532 _largefiles=yes
7533 _def_dvdnav='#define USE_DVDNAV 1'
7534 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7535 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7536 _inputmodules="dvdnav $_inputmodules"
7537 else
7538 _def_dvdnav='#undef USE_DVDNAV'
7539 _noinputmodules="dvdnav $_noinputmodules"
7541 echores "$_dvdnav"
7543 #############################################################################
7544 echo "Creating config.mak"
7545 cat > config.mak << EOF
7546 # -------- Generated by configure -----------
7548 LANG = C
7549 MAN_LANG = $MAN_LANG
7550 TARGET_OS = $system_name
7551 DESTDIR =
7552 prefix = \$(DESTDIR)$_prefix
7553 BINDIR = \$(DESTDIR)$_bindir
7554 DATADIR = \$(DESTDIR)$_datadir
7555 MANDIR = \$(DESTDIR)$_mandir
7556 CONFDIR = \$(DESTDIR)$_confdir
7557 LIBDIR = \$(DESTDIR)$_libdir
7558 # FFmpeg uses libdir instead of LIBDIR
7559 libdir = \$(LIBDIR)
7560 AR = $_ar
7561 CC = $_cc
7562 CXX = $_cc
7563 HOST_CC = $_host_cc
7564 RANLIB = $_ranlib
7565 LDCONFIG = $_ldconfig
7566 INSTALL = $_install
7567 EXTRA_INC = $_inc_extra
7568 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7569 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7570 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7571 CFLAG_STACKREALIGN = $_stackrealign
7572 INSTALLSTRIP = $_install_strip
7573 CHARSET = $_charset
7574 HELP_FILE = $_mp_help
7576 EXESUF = $_exesuf
7578 MPLAYER_NETWORK = $_network
7579 FTP = $_ftp
7580 STREAMING_LIVE555 = $_live
7581 LIBNEMESI = $_nemesi
7582 NATIVE_RTSP = $_native_rtsp
7583 VSTREAM = $_vstream
7584 STREAM_CACHE = $_stream_cache
7585 DVBIN = $_dvbin
7586 VIDIX = $_vidix
7587 VIDIX_INTERNAL = $_vidix_internal
7588 VIDIX_EXTERNAL = $_vidix_external
7589 CONFIG_PP = yes
7590 MP3LAME = $_mp3lame
7591 LIBMENU = $_menu
7593 MP3LIB = $_mp3lib
7594 LIBA52 = $_liba52
7595 LIBMPEG2 = $_libmpeg2
7596 TREMOR_INTERNAL = $_tremor_internal
7597 TREMOR_LOW = $_tremor_low
7598 FAAD = $_faad
7600 SPEEX = $_speex
7601 MUSEPACK = $_musepack
7603 UNRARLIB = $_unrarlib
7604 PNG = $_png
7605 JPEG = $_jpeg
7606 GIF = $_gif
7608 EXTRALIBS = $_extra_libs
7609 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7610 EXTRALIBS_MPLAYER = $_libs_mplayer
7611 EXTRALIBS_MENCODER = $_libs_mencoder
7613 HAVE_MLIB = $_mlib
7614 HAVE_PTHREADS = $_pthreads
7615 HAVE_W32THREADS = $_w32threads
7617 HAVE_XVMC_ACCEL = $_xvmc
7619 HAVE_SYS_MMAN_H = $_mman
7620 HAVE_POSIX_SELECT = $_posix_select
7622 NEED_GETTIMEOFDAY = $_need_gettimeofday
7623 NEED_GLOB = $_need_glob
7624 NEED_SETENV = $_need_setenv
7625 NEED_SHMEM = $_need_shmem
7626 NEED_STRSEP = $_need_strsep
7627 NEED_SWAB = $_need_swab
7628 NEED_VSSCANF = $_need_vsscanf
7630 # for FFmpeg
7631 SRC_PATH=..
7632 BUILD_ROOT=..
7633 LIBPREF=lib
7634 LIBSUF=.a
7635 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7637 # audio output
7638 OSS = $_ossaudio
7639 ALSA = $_alsa
7640 ALSA5 = $_alsa5
7641 ALSA9 = $_alsa9
7642 ALSA1X = $_alsa1x
7644 # input/demuxer/codecs
7645 JOYSTICK = $_joystick
7646 LIRC = $_lirc
7647 APPLE_REMOTE = $_apple_remote
7648 TV = $_tv
7649 TV_V4L = $_tv_v4l
7650 TV_V4L1 = $_tv_v4l1
7651 TV_V4L2 = $_tv_v4l2
7652 TV_DSHOW = $_tv_dshow
7653 TV_BSDBT848 = $_tv_bsdbt848
7654 TV_TELETEXT = $_tv_teletext
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 = $_libnut
7684 LIBDCA = $_libdca
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_LIBAMR=$_libamr
7707 CONFIG_LIBAMR_NB=$_libamr_nb
7708 CONFIG_LIBAMR_WB=$_libamr_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 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7715 CONFIG_LIBFAAC=$_lavc_faac
7716 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7717 CONFIG_LIBVORBIS=$_libvorbis
7718 CONFIG_LIBXVID=$_lavc_xvid
7719 CONFIG_LIBX264=$_lavc_x264
7720 CONFIG_ZLIB=$_zlib
7721 CONFIG_GPL=yes
7722 CONFIG_ENCODERS=$_mencoder
7723 CONFIG_MUXERS=$_mencoder
7724 RADIO=$_radio
7725 RADIO_CAPTURE=$_radio_capture
7726 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7727 VIDIX_IVTV=$_vidix_drv_ivtv
7728 VIDIX_MACH64=$_vidix_drv_mach64
7729 VIDIX_MGA=$_vidix_drv_mga
7730 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7731 VIDIX_NVIDIA=$_vidix_drv_nvidia
7732 VIDIX_PM2=$_vidix_drv_pm2
7733 VIDIX_PM3=$_vidix_drv_pm3
7734 VIDIX_RADEON=$_vidix_drv_radeon
7735 VIDIX_RAGE128=$_vidix_drv_rage128
7736 VIDIX_SAVAGE=$_vidix_drv_savage
7737 VIDIX_SIS=$_vidix_drv_sis
7738 VIDIX_UNICHROME=$_vidix_drv_unichrome
7740 # --- Some stuff for autoconfigure ----
7741 $_target_arch
7742 $_target_arch_x86
7743 $_confwin32
7744 TARGET_CPU=$iproc
7745 HAVE_MMX = $_mmx
7746 HAVE_MMX2 = $_mmxext
7747 HAVE_3DNOW = $_3dnow
7748 HAVE_3DNOWEX = $_3dnowext
7749 HAVE_SSE = $_sse
7750 HAVE_CMOV = $_cmov
7751 HAVE_ALTIVEC = $_altivec
7752 HAVE_ARMV5TE = $_armv5te
7753 HAVE_ARMV6 = $_armv6
7754 HAVE_IWMMXT = $_iwmmxt
7755 HAVE_VIS = $_vis
7757 # --- GUI stuff ---
7758 GUI = $_gui
7760 # --- libvo stuff ---
7761 VO_SRCS = $_vosrc
7763 # --- libao2 stuff ---
7764 AO_SRCS = $_aosrc
7766 # --- libaf stuff ---
7767 AF_SRCS = $_afsrc
7771 #############################################################################
7773 ff_config_enable () {
7774 _nprefix=$3;
7775 test -z "$_nprefix" && _nprefix='CONFIG'
7776 for part in $1; do
7777 if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
7778 echo "#define ${_nprefix}_$part 1"
7779 echo "#define ENABLE_$part 1"
7780 else
7781 echo "#define ENABLE_$part 0"
7783 done
7786 echo "Creating config.h"
7787 cat > $TMPH << EOF
7788 /* -------- This file has been automatically generated by configure ---------
7789 Note: Any changes in it will be lost when you run configure again. */
7791 /* Protect against multiple inclusion */
7792 #ifndef MPLAYER_CONFIG_H
7793 #define MPLAYER_CONFIG_H 1
7795 #define CONFIGURATION "$_configuration"
7797 /* make sure we never get lavformat's poll() emulation, the results are
7798 horrible if the X libs try to actually use it, see MPlayer-users
7799 Message-ID: <45D49541.8060101@infernix.net>
7800 Date: Thu, 15 Feb 2007 18:15:45 +0100
7801 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7803 #define HAVE_SYS_POLL_H 1
7805 /* yes, we have inttypes.h */
7806 #define HAVE_INTTYPES_H 1
7808 /* int_fastXY_t emulation */
7809 $_def_fast_inttypes
7811 /* libdvdcss */
7812 #define HAVE_ERRNO_H 1
7814 /* libdvdcss + libdvdread */
7815 #define HAVE_LIMITS_H 1
7817 /* libdvdcss + libfaad2 */
7818 #define HAVE_UNISTD_H 1
7820 /* libfaad2 + libdvdread */
7821 #define STDC_HEADERS 1
7823 /* libfaad2 */
7824 #define HAVE_MEMCPY 1
7825 #define HAVE_STRCHR 1
7827 /* libdvdread */
7828 #define HAVE_UINTPTR_T 1
7830 /* name of messages charset */
7831 $_def_charset
7833 /* Runtime CPU detection */
7834 $_def_runtime_cpudetection
7836 /* Dynamic a/v plugins */
7837 $_def_dynamic_plugins
7839 /* "restrict" keyword */
7840 $_def_restrict_keyword
7842 /* __builtin_expect branch prediction hint */
7843 $_def_builtin_expect
7844 #ifdef HAVE_BUILTIN_EXPECT
7845 #define likely(x) __builtin_expect ((x) != 0, 1)
7846 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7847 #else
7848 #define likely(x) (x)
7849 #define unlikely(x) (x)
7850 #endif
7852 /* attribute(used) as needed by some compilers */
7853 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7854 # define attribute_used __attribute__((used))
7855 #else
7856 # define attribute_used
7857 #endif
7859 /* compiler support for named assembler arguments */
7860 $_def_named_asm_args
7862 /* enable/disable SIGHANDLER */
7863 $_def_sighandler
7865 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7866 $_def_crash_debug
7868 /* Toggles debugging informations */
7869 $_def_debug
7871 /* Toggles color console output */
7872 $_def_color_console
7874 /* Indicates that libcdio is available for VCD and CD-DA playback */
7875 $_def_libcdio
7877 /* Indicates that Ogle's libdvdread is available for DVD playback */
7878 $_def_dvdread
7880 /* Indicates that dvdread is internal */
7881 $_def_dvdread_internal
7883 /* Additional options for libdvdread/libdvdcss */
7884 $_def_dvd
7885 $_def_cdrom
7886 $_def_cdio
7887 $_def_dvdio
7888 $_def_bsdi_dvd
7889 $_def_dvd_bsd
7890 $_def_dvd_linux
7891 $_dev_dvd_openbsd
7892 $_def_dvd_darwin
7893 $_def_sol_scsi_h
7894 $_def_hpux_scsi_h
7896 /* Common data directory (for fonts, etc) */
7897 #define MPLAYER_DATADIR "$_datadir"
7898 #define MPLAYER_CONFDIR "$_confdir"
7899 #define MPLAYER_LIBDIR "$_libdir"
7901 /* Define this to compile stream-caching support, it can be enabled via
7902 -cache <kilobytes> */
7903 $_def_stream_cache
7905 /* Define if you are using XviD library */
7906 $_def_xvid
7908 /* Define if you are using the X.264 library */
7909 $_def_x264
7911 /* Define if you are using libnut */
7912 $_def_libnut
7914 /* Define to include support for libdv-0.9.5 */
7915 $_def_libdv
7917 /* If build mencoder */
7918 $_mencoder_flag
7920 /* Indicates if libmp3lame is available
7921 Note: for mencoder */
7922 $_def_mp3lame
7923 $_def_mp3lame_preset
7924 $_def_mp3lame_preset_medium
7926 /* Undefine this if you do not want to select mono audio (left or right)
7927 with a stereo MPEG layer 2/3 audio stream. The command line option
7928 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7929 right-only), with 0 being the default.
7931 #define USE_FAKE_MONO 1
7933 /* Undefine this if your sound card driver has no working select().
7934 If you have kernel Oops, player hangups, or just no audio, you should
7935 try to recompile MPlayer with this option disabled! */
7936 $_def_select
7938 /* define this to use iconv(3) function to codepage conversions */
7939 $_def_iconv
7941 /* define this to use nl_langinfo function */
7942 $_def_langinfo
7944 /* define this to use RTC (/dev/rtc) for video timers */
7945 $_def_rtc
7947 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7948 #define MAX_OUTBURST 65536
7950 /* set up audio OUTBURST. Do not change this! */
7951 #define OUTBURST 512
7953 /* Define this if your system has the header file for the OSS sound interface */
7954 $_def_sys_soundcard
7956 /* Define this if your system has the header file for the OSS sound interface
7957 * in /usr/include */
7958 $_def_soundcard
7960 /* Define this if your system has the sysinfo header */
7961 $_def_sys_sysinfo
7963 /* Define this if your system has the "malloc.h" header file */
7964 $_def_malloc
7966 /* memalign is mapped to malloc if unsupported */
7967 $_def_memalign
7968 $_def_map_memalign
7969 $_def_memalign_hack
7971 /* assembler handling of .align */
7972 $_def_asmalign_pot
7974 /* Define this if your system has the "alloca.h" header file */
7975 $_def_alloca
7977 /* Define this if your system has the "sys/mman.h" header file */
7978 $_def_mman
7979 $_def_mman_has_map_failed
7981 /* Define this if you have the elf dynamic linker -ldl library */
7982 $_def_dl
7984 /* Define this if you have the kstat kernel statistics library */
7985 $_def_kstat
7987 /* Define this if you have zlib */
7988 $_def_zlib
7989 #ifdef HAVE_ZLIB
7990 #define CONFIG_ZLIB 1
7991 #endif
7993 /* Define this if you have shm support */
7994 $_def_shm
7996 /* Define this if your system has strsep */
7997 $_def_strsep
7999 /* Define this if your system has vsscanf */
8000 $_def_vsscanf
8002 /* Define this if your system has swab */
8003 $_def_swab
8005 /* Define this if your system has posix select */
8006 $_def_posix_select
8008 /* Define this if your system has gettimeofday */
8009 $_def_gettimeofday
8011 /* Define this if your system has glob */
8012 $_def_glob
8014 /* Define this if your system has setenv */
8015 $_def_setenv
8016 #ifndef HAVE_SETENV
8017 int setenv(const char *name, const char *val, int overwrite);
8018 #endif
8020 /* Define this if your system has sysi86 */
8021 $_def_sysi86
8022 $_def_sysi86_iv
8024 /* Define this if your system has pthreads */
8025 $_def_pthreads
8027 /* Define this if you enabled thread support for libavcodec */
8028 $_def_threads
8029 #ifdef HAVE_THREADS
8030 #define ENABLE_THREADS 1
8031 #else
8032 #define ENABLE_THREADS 0
8033 #endif
8035 /* LIRC (remote control, see www.lirc.org) support: */
8036 $_def_lirc
8038 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8039 $_def_apple_remote
8041 /* Support for maemo (http://www.maemo.org) */
8042 $_def_maemo
8045 * LIRCCD (LIRC client daemon)
8046 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8048 $_def_lircc
8050 /* DVD navigation support using libdvdnav */
8051 $_def_dvdnav
8053 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8054 #define MPEG12_POSTPROC 1
8056 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8057 $_def_libpostproc
8058 $_def_libpostproc_a
8059 $_def_libpostproc_so
8061 /* Win32 DLL support */
8062 $_def_win32dll
8063 #define WIN32_PATH "$_win32codecsdir"
8065 /* Mac OS X specific features */
8066 $_def_macosx
8067 $_def_macosx_finder_support
8068 $_def_macosx_bundle
8069 $_def_macosx_corevideo
8071 /* Build our Win32-loader */
8072 $_def_win32_loader
8074 /* ffmpeg's libavcodec support (requires libavcodec source) */
8075 $_def_libavcodec
8076 $_def_libavcodec_a
8077 $_def_libavcodec_so
8078 $_def_libavcodec_mpegaudio_hp
8080 /* ffmpeg's libavformat support (requires libavformat source) */
8081 $_def_libavformat
8082 $_def_libavformat_a
8083 $_def_libavformat_so
8085 $_def_libavutil
8086 $_def_libavutil_a
8087 $_def_libavutil_so
8089 /* Use libavcodec's decoders */
8090 #define CONFIG_DECODERS 1
8091 /* Use libavcodec's encoders */
8092 #define CONFIG_ENCODERS 1
8094 /* Use libavformat's demuxers */
8095 #define CONFIG_DEMUXERS 1
8096 /* Use libavformat's muxers */
8097 $_def_muxers
8099 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8100 #define HAVE_EBX_AVAILABLE 1
8101 #ifndef MP_DEBUG
8102 #define HAVE_EBP_AVAILABLE 1
8103 #endif
8105 #define CONFIG_GPL 1
8106 #define ENABLE_SMALL 0
8108 /* Support for grayscale encoding/decoding in FFmpeg (makes color slower) */
8109 #define ENABLE_GRAY 1
8111 /* Use AMR codecs from libavcodec. */
8112 $_def_libamr
8113 $_def_libamr_nb
8114 $_def_libamr_wb
8116 /* Use specific parts from FFmpeg. */
8117 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8118 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8119 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8120 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8121 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8122 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8123 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8125 $_def_lavc_faac
8126 $_def_lavc_xvid
8127 $_def_lavc_mp3lame
8128 $_def_lavc_x264
8130 /* Use codec libs included in mplayer CVS / source dist: */
8131 $_def_mp3lib
8132 $_def_liba52
8133 $_def_libdca
8134 $_def_libmpeg2
8136 /* XAnim DLL support */
8137 $_def_xanim
8138 /* Default search path */
8139 $_def_xanim_path
8141 /* RealPlayer DLL support */
8142 $_def_real
8143 /* Default search path */
8144 $_def_real_path
8146 /* LIVE555 Streaming Media library support */
8147 $_def_live
8149 /* libnemesi Streaming Media library support */
8150 $_def_nemesi
8152 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8153 $_def_fastmemcpy
8155 /* Use unrarlib for Vobsubs */
8156 $_def_unrarlib
8158 /* gui support, please do not edit this option */
8159 $_def_gui
8160 $_def_gtk2_gui
8162 /* Audio output drivers */
8163 $_def_ossaudio
8164 $_def_ossaudio_devdsp
8165 $_def_ossaudio_devmixer
8166 $_def_alsa5
8167 $_def_alsa9
8168 $_def_alsa1x
8169 $_def_arts
8170 $_def_esd
8171 $_def_esd_latency
8172 $_def_pulse
8173 $_def_jack
8174 $_def_openal
8175 $_def_openal_h
8176 $_def_sys_asoundlib_h
8177 $_def_alsa_asoundlib_h
8178 $_def_sunaudio
8179 $_def_sgiaudio
8180 $_def_win32waveout
8181 $_def_nas
8183 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8184 #undef FAST_OSD
8185 #undef FAST_OSD_TABLE
8187 /* Enable TV Interface support */
8188 $_def_tv
8190 /* Enable Video 4 Linux TV interface support */
8191 $_def_tv_v4l
8193 /* Enable Video 4 Linux 1 TV interface support */
8194 $_def_tv_v4l1
8196 /* Enable Video 4 Linux 2 TV interface support */
8197 $_def_tv_v4l2
8199 /* Enable DirectShow TV interface support */
8200 $_def_tv_dshow
8202 /* *BSD BrookTree headers */
8203 $_def_ioctl_meteor_h_name
8204 $_def_ioctl_bt848_h_name
8206 /* Enable *BSD BrookTree TV interface support */
8207 $_def_tv_bsdbt848
8209 /* Enable TV Teletext Interface support */
8210 $_def_tv_teletext
8212 /* Enable Radio Interface support */
8213 $_def_radio
8215 /* Enable Capture for Radio Interface support */
8216 $_def_radio_capture
8218 /* Enable Video 4 Linux Radio interface support */
8219 $_def_radio_v4l
8221 /* Enable Video 4 Linux 2 Radio interface support */
8222 $_def_radio_v4l2
8224 /* Enable *BSD BrookTree Radio interface support */
8225 $_def_radio_bsdbt848
8227 /* Enable Video 4 Linux 2 MPEG PVR support */
8228 $_def_pvr
8230 /* Define if your processor stores words with the most significant
8231 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8232 $_def_words_endian
8234 /* Define if your processor can access unaligned data in a fast way */
8235 $_def_fast_unaligned
8237 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8239 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8240 have the instruction. */
8241 $_def_dcbzl
8243 /* only gcc3 can compile mvi instructions (libmpeg2) */
8244 $_def_gcc_mvi_support
8246 /* Define this for Cygwin build for win32 */
8247 $_def_confwin32
8249 /* Define this to any prefered value from 386 up to infinity with step 100 */
8250 #define __CPU__ $iproc
8252 $_mp_wordsize
8254 $_def_linux
8256 $_def_vcd
8258 #ifdef sun
8259 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8260 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8261 #elif defined(HPUX)
8262 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8263 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8264 #elif defined(WIN32)
8265 #define DEFAULT_CDROM_DEVICE "D:"
8266 #define DEFAULT_DVD_DEVICE "D:"
8267 #elif defined(SYS_DARWIN)
8268 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8269 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8270 #elif defined(__OpenBSD__)
8271 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8272 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8273 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8274 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8275 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8276 #elif defined(SYS_AMIGAOS4)
8277 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8278 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8279 #else
8280 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8281 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8282 #endif
8285 /*----------------------------------------------------------------------------
8287 ** NOTE: Instead of modifying these definitions here, use the
8288 ** --enable/--disable options of the ./configure script!
8289 ** See ./configure --help for details.
8291 *---------------------------------------------------------------------------*/
8293 /* C99 lrintf function available */
8294 $_def_lrintf
8296 /* mkstemp support */
8297 $_def_mkstemp
8299 /* nanosleep support */
8300 $_def_nanosleep
8302 /* SMB support */
8303 $_def_smbsupport
8305 /* termcap flag for getch2.c */
8306 $_def_termcap
8308 /* termios flag for getch2.c */
8309 $_def_termios
8310 $_def_termios_h
8311 $_def_termios_sys_h
8313 /* enable PNG support */
8314 $_def_png
8316 /* enable JPEG support */
8317 $_def_jpeg
8319 /* enable PNM support */
8320 $_def_pnm
8322 /* enable md5sum support */
8323 $_def_md5sum
8325 /* enable GIF support */
8326 $_def_gif
8327 $_def_gif_4
8328 $_def_gif_tvt_hack
8330 /* enable bitmap font support */
8331 $_def_bitmap_font
8333 /* enable FreeType support */
8334 $_def_freetype
8336 /* enable Fontconfig support */
8337 $_def_fontconfig
8339 /* enable SSA/ASS support */
8340 $_def_ass
8342 /* enable FriBiDi usage */
8343 $_def_fribidi
8345 /* enable ENCA usage */
8346 $_def_enca
8348 /* liblzo support */
8349 $_def_liblzo
8350 #ifdef USE_LIBLZO
8351 #define CONFIG_LZO 1
8352 #endif
8354 /* libmad support */
8355 $_def_mad
8357 /* enable OggVorbis support */
8358 $_def_vorbis
8359 $_def_tremor
8361 /* enable Speex support */
8362 $_def_speex
8364 /* enable musepack support */
8365 $_def_musepack
8367 /* enable OggTheora support */
8368 $_def_theora
8370 /* enable FAAD (AAC) support */
8371 $_def_faad
8372 $_def_faad_internal
8374 /* enable FAAC (AAC encoder) support */
8375 $_def_faac
8377 /* enable LADSPA plugin support */
8378 $_def_ladspa
8380 /* enable network */
8381 $_def_network
8383 /* enable ftp support */
8384 $_def_ftp
8386 /* enable vstream support */
8387 $_def_vstream
8389 /* enable winsock2 instead of Unix functions*/
8390 $_def_winsock2
8392 /* define this to use inet_aton() instead of inet_pton() */
8393 $_def_use_aton
8395 /* enables / disables cdparanoia support */
8396 $_def_cdparanoia
8397 $_def_cddb
8399 /* enables / disables VIDIX usage */
8400 $_def_vidix
8401 $_def_vidix_drv_cyberblade
8402 $_def_vidix_drv_ivtv
8403 $_def_vidix_drv_mach64
8404 $_def_vidix_drv_mga
8405 $_def_vidix_drv_mga_crtc2
8406 $_def_vidix_drv_nvidia
8407 $_def_vidix_drv_pm3
8408 $_def_vidix_drv_radeon
8409 $_def_vidix_drv_rage128
8410 $_def_vidix_drv_savage
8411 $_def_vidix_drv_sis
8412 $_def_vidix_drv_unichrome
8413 $_def_vidix_pfx
8415 /* enables / disables new input joystick support */
8416 $_def_joystick
8418 /* enables / disables QTX codecs */
8419 $_def_qtx
8421 /* enables / disables osd menu */
8422 $_def_menu
8424 /* enables / disables subtitles sorting */
8425 $_def_sortsub
8427 /* XMMS input plugin support */
8428 $_def_xmms
8429 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8431 /* enables inet6 support */
8432 $_def_inet6
8434 /* do we have gethostbyname2? */
8435 $_def_gethostbyname2
8437 /* Extension defines */
8438 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8440 $_def_altivec_h // enables usage of altivec.h
8442 /* libmpeg2 uses a different feature test macro for mediaLib */
8443 #ifdef HAVE_MLIB
8444 #define LIBMPEG2_MLIB 1
8445 #endif
8447 /* libvo options */
8448 #define SCREEN_SIZE_X 1
8449 #define SCREEN_SIZE_Y 1
8450 $_def_x11
8451 $_def_xv
8452 $_def_xvmc
8453 $_def_vm
8454 $_def_xf86keysym
8455 $_def_xinerama
8456 $_def_gl
8457 $_def_gl_win32
8458 $_def_dga
8459 $_def_dga1
8460 $_def_dga2
8461 $_def_sdl
8462 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8463 $_def_sdlbuggy
8464 $_def_directx
8465 $_def_ggi
8466 $_def_ggiwmh
8467 $_def_3dfx
8468 $_def_s3fb
8469 $_def_tdfxfb
8470 $_def_tdfxvid
8471 $_def_xvr100
8472 $_def_directfb
8473 $_def_directfb_version
8474 $_def_dfbmga
8475 $_def_zr
8476 $_def_bl
8477 $_def_mga
8478 $_def_xmga
8479 $_def_fbdev
8480 $_def_dxr2
8481 $_def_dxr3
8482 $_def_ivtv
8483 $_def_v4l2
8484 $_def_dvb
8485 $_def_dvb_in
8486 $_def_svga
8487 $_def_vesa
8488 $_def_xdpms
8489 $_def_aa
8490 $_def_caca
8491 $_def_tga
8492 $_def_toolame
8493 $_def_twolame
8495 /* used by GUI: */
8496 $_def_xshape
8498 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8499 #define X11_FULLSCREEN 1
8500 #endif
8502 #endif /* MPLAYER_CONFIG_H */
8505 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8506 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8508 #############################################################################
8510 cat << EOF
8512 Config files successfully generated by ./configure $_configuration !
8514 Install prefix: $_prefix
8515 Data directory: $_datadir
8516 Config direct.: $_confdir
8518 Byte order: $_byte_order
8519 Optimizing for: $_optimizing
8521 Languages:
8522 Messages/GUI: $_language
8525 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8526 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8527 echo
8529 cat << EOF
8531 Enabled optional drivers:
8532 Input: $_inputmodules
8533 Codecs: $_codecmodules
8534 Audio output: $_aomodules
8535 Video output: $_vomodules
8536 Audio filters: $_afmodules
8537 Disabled optional drivers:
8538 Input: $_noinputmodules
8539 Codecs: $_nocodecmodules
8540 Audio output: $_noaomodules
8541 Video output: $_novomodules
8542 Audio filters: $_noafmodules
8544 'config.h' and 'config.mak' contain your configuration options.
8545 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8546 compile *** DO NOT REPORT BUGS if you tweak these files ***
8548 'make' will now compile MPlayer and 'make install' will install it.
8549 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8554 if test "$_mtrr" = yes ; then
8555 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8556 echo
8559 if not x86_32; then
8560 cat <<EOF
8561 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8562 operating system ($system_name). You may encounter a few files that cannot
8563 be played due to missing open source video/audio codec support.
8569 cat <<EOF
8570 Check $TMPLOG if you wonder why an autodetection failed (make sure
8571 development headers/packages are installed).
8573 NOTE: The --enable-* parameters unconditionally force options on, completely
8574 skipping autodetection. This behavior is unlike what you may be used to from
8575 autoconf-based configure scripts that can decide to override you. This greater
8576 level of control comes at a price. You may have to provide the correct compiler
8577 and linker flags yourself.
8578 If you used one of these options (except --enable-gui and similar ones that
8579 turn on internal features) and experience a compilation or linking failure,
8580 make sure you have passed the necessary compiler/linker flags to configure.
8582 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8586 if test "$_warn_CFLAGS" = yes; then
8587 cat <<EOF
8589 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8591 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8593 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8594 To do so, execute 'CFLAGS= ./configure <options>'
8599 # Last move:
8600 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"