synced with r26138
[mplayer/glamo.git] / configure
blobe939efd63b3f33919cc87c2f4c0a31ab25c58731
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 "$?" ; }
119 os2() { issystem "OS/2" ; return "$?" ; }
121 # arch test boolean functions
122 # x86/x86pc is used by QNX
123 x86_32() {
124 case "$host_arch" in
125 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
126 *) return 1 ;;
127 esac
130 x86_64() {
131 case "$host_arch" in
132 x86_64|amd64) return 0 ;;
133 *) return 1 ;;
134 esac
137 x86() {
138 x86_32 || x86_64
141 ppc() {
142 case "$host_arch" in
143 ppc|powerpc) return 0;;
144 *) return 1;;
145 esac
148 alpha() {
149 case "$host_arch" in
150 alpha) return 0;;
151 *) return 1;;
152 esac
155 arm() {
156 case "$host_arch" in
157 arm) return 0;;
158 *) return 1;;
159 esac
162 sh3() {
163 case "$host_arch" in
164 sh3) return 0;;
165 *) return 1;;
166 esac
169 # Use this before starting a check
170 echocheck() {
171 echo "============ Checking for $@ ============" >> "$TMPLOG"
172 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
175 # Use this to echo the results of a check
176 echores() {
177 if test "$_res_comment" ; then
178 _res_comment="($_res_comment)"
180 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
181 echo "##########################################" >> "$TMPLOG"
182 echo "" >> "$TMPLOG"
183 echo "$@ $_res_comment"
184 _res_comment=""
186 #############################################################################
188 # Check how echo works in this /bin/sh
189 case `echo -n` in
190 -n) _echo_n= _echo_c='\c' ;; # SysV echo
191 *) _echo_n='-n ' _echo_c= ;; # BSD echo
192 esac
194 LANGUAGES=`echo help/help_mp-??.h help/help_mp-??_??.h | sed "s:help/help_mp-\(..\).h:\1:g" | sed "s:help/help_mp-\(.....\).h:\1:g"`
196 show_help(){
197 cat << EOF
198 Usage: $0 [OPTIONS]...
200 Configuration:
201 -h, --help display this help and exit
203 Installation directories:
204 --prefix=DIR prefix directory for installation [/usr/local]
205 --bindir=DIR directory for installing binaries [PREFIX/bin]
206 --datadir=DIR directory for installing machine independent
207 data files (skins, etc) [PREFIX/share/mplayer]
208 --mandir=DIR directory for installing man pages [PREFIX/share/man]
209 --confdir=DIR directory for installing configuration files
210 [PREFIX/etc/mplayer]
211 --libdir=DIR directory for object code libraries [PREFIX/lib]
212 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
213 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
214 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
215 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
217 Optional features:
218 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
219 --disable-mplayer disable MPlayer compilation [enable]
220 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
221 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
222 --disable-largefiles disable support for files > 2GB [enable]
223 --enable-linux-devfs set default devices to devfs [disable]
224 --enable-termcap use termcap database for key codes [autodetect]
225 --enable-termios use termios database for key codes [autodetect]
226 --disable-iconv disable iconv for encoding conversion [autodetect]
227 --disable-langinfo do not use langinfo [autodetect]
228 --enable-lirc enable LIRC (remote control) support [autodetect]
229 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
230 --enable-joystick enable joystick support [disable]
231 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
232 --disable-vm disable X video mode extensions [autodetect]
233 --disable-xf86keysym disable support for multimedia keys [autodetect]
234 --enable-radio enable radio interface [disable]
235 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
236 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
237 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
238 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
239 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
240 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
241 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
242 --disable-tv-teletext disable TV teletext interface [autodetect]
243 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
244 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
245 --disable-network disable networking [enable]
246 --enable-winsock2 enable winsock2 [autodetect]
247 --enable-smb enable Samba (SMB) input [autodetect]
248 --enable-live enable LIVE555 Streaming Media [autodetect]
249 --enable-nemesi enable Nemesi Streaming Media [autodetect]
250 --disable-dvdnav disable libdvdnav [autodetect]
251 --disable-dvdread disable libdvdread [autodetect]
252 --disable-dvdread-internal disable internal libdvdread [autodetect]
253 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
254 --disable-cdparanoia disable cdparanoia [autodetect]
255 --disable-cddb disable cddb [autodetect]
256 --disable-bitmap-font disable bitmap font support [enable]
257 --disable-freetype disable FreeType 2 font rendering [autodetect]
258 --disable-fontconfig disable fontconfig font lookup [autodetect]
259 --disable-unrarexec disable using of UnRAR executable [enabled]
260 --enable-menu enable OSD menu (not DVD menu) [disabled]
261 --disable-sortsub disable subtitle sorting [enabled]
262 --enable-fribidi enable the FriBiDi libs [autodetect]
263 --disable-enca disable ENCA charset oracle library [autodetect]
264 --disable-macosx disable Mac OS X specific features [autodetect]
265 --disable-maemo disable maemo specific features [autodetect]
266 --enable-macosx-finder-support enable Mac OS X Finder invocation
267 parameter parsing [disabled]
268 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
269 --disable-inet6 disable IPv6 support [autodetect]
270 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
271 --disable-ftp disable FTP support [enabled]
272 --disable-vstream disable TiVo vstream client support [autodetect]
273 --disable-pthreads disable Posix threads support [autodetect]
274 --disable-w32threads disable Win32 threads support [autodetect]
275 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
276 --enable-rpath enable runtime linker path for extra libs [disabled]
278 Codecs:
279 --enable-gif enable GIF support [autodetect]
280 --enable-png enable PNG input/output support [autodetect]
281 --enable-jpeg enable JPEG input/output support [autodetect]
282 --enable-libcdio enable external libcdio [autodetect]
283 --enable-liblzo enable external liblzo [autodetect]
284 --disable-win32dll disable Win32 DLL support [enabled]
285 --disable-qtx disable QuickTime codecs support [enabled]
286 --disable-xanim disable XAnim codecs support [enabled]
287 --disable-real disable RealPlayer codecs support [enabled]
288 --disable-xvid disable XviD [autodetect]
289 --disable-x264 disable x264 [autodetect]
290 --disable-libnut disable libnut [autodetect]
291 --disable-libavutil_a disable static libavutil [autodetect]
292 --disable-libavcodec_a disable static libavcodec [autodetect]
293 --disable-libavformat_a disable static libavformat [autodetect]
294 --disable-libpostproc_a disable static libpostproc [autodetect]
295 --disable-libavutil_so disable shared libavutil [autodetect]
296 --disable-libavcodec_so disable shared libavcodec [autodetect]
297 --disable-libavformat_so disable shared libavformat [autodetect]
298 --disable-libpostproc_so disable shared libpostproc [autodetect]
299 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
300 in libavcodec [enabled]
301 --disable-tremor-internal disable internal Tremor [enabled]
302 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
303 --enable-tremor-external enable external Tremor [autodetect]
304 --disable-libvorbis disable libvorbis support [autodetect]
305 --disable-speex disable Speex support [autodetect]
306 --enable-theora enable OggTheora libraries [autodetect]
307 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
308 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
309 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
310 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
311 --disable-ladspa disable LADSPA plugin support [autodetect]
312 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
313 --disable-mad disable libmad (MPEG audio) support [autodetect]
314 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
315 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
316 --enable-xmms enable XMMS input plugin support [disabled]
317 --enable-libdca enable libdca support [autodetect]
318 --disable-mp3lib disable builtin mp3lib [enabled]
319 --disable-liba52 disable builtin liba52 [enabled]
320 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
321 --disable-musepack disable musepack support [autodetect]
322 --disable-libamr_nb disable libamr narrowband [autodetect]
323 --disable-libamr_wb disable libamr wideband [autodetect]
324 --disable-decoder=DECODER disable specified FFmpeg decoder
325 --enable-decoder=DECODER enable specified FFmpeg decoder
326 --disable-encoder=ENCODER disable specified FFmpeg encoder
327 --enable-encoder=ENCODER enable specified FFmpeg encoder
328 --disable-parser=PARSER disable specified FFmpeg parser
329 --enable-parser=PARSER enable specified FFmpeg parser
330 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
331 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
332 --disable-muxer=MUXER disable specified FFmpeg muxer
333 --enable-muxer=MUXER enable specified FFmpeg muxer
335 Video output:
336 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
337 --disable-vidix-external disable external VIDIX [for x86 *nix]
338 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
339 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
340 nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome
341 --disable-vidix-pcidb disable VIDIX PCI device name database
342 --enable-gl enable OpenGL video output [autodetect]
343 --enable-dga2 enable DGA 2 support [autodetect]
344 --enable-dga1 enable DGA 1 support [autodetect]
345 --enable-vesa enable VESA video output [autodetect]
346 --enable-svga enable SVGAlib video output [autodetect]
347 --enable-sdl enable SDL video output [autodetect]
348 --enable-aa enable AAlib video output [autodetect]
349 --enable-caca enable CACA video output [autodetect]
350 --enable-ggi enable GGI video output [autodetect]
351 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
352 --enable-directx enable DirectX video output [autodetect]
353 --enable-dxr2 enable DXR2 video output [autodetect]
354 --enable-dxr3 enable DXR3/H+ video output [autodetect]
355 --enable-ivtv enable IVTV TV-Out video output [autodetect]
356 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
357 --enable-dvb enable DVB video output [autodetect]
358 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
359 --enable-mga enable mga_vid video output [autodetect]
360 --enable-xmga enable mga_vid X11 video output [autodetect]
361 --enable-xv enable Xv video output [autodetect]
362 --enable-xvmc enable XvMC acceleration [disable]
363 --enable-vm enable XF86VidMode support [autodetect]
364 --enable-xinerama enable Xinerama support [autodetect]
365 --enable-x11 enable X11 video output [autodetect]
366 --enable-xshape enable XShape support [autodetect]
367 --disable-xss disable screensaver support via xss [autodetect]
368 --enable-fbdev enable FBDev video output [autodetect]
369 --enable-mlib enable mediaLib video output (Solaris) [disable]
370 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
371 --enable-tdfxfb enable tdfxfb video output [disable]
372 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
373 --enable-directfb enable DirectFB video output [autodetect]
374 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
375 --enable-bl enable Blinkenlights video output [disable]
376 --enable-tdfxvid enable tdfx_vid video output [disable]
377 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
378 --disable-tga disable Targa video output [enable]
379 --disable-pnm disable PNM video output [enable]
380 --disable-md5sum disable md5sum video output [enable]
382 Audio output:
383 --disable-alsa disable ALSA audio output [autodetect]
384 --disable-ossaudio disable OSS audio output [autodetect]
385 --disable-arts disable aRts audio output [autodetect]
386 --disable-esd disable esd audio output [autodetect]
387 --disable-pulse disable Pulseaudio audio output [autodetect]
388 --disable-jack disable JACK audio output [autodetect]
389 --disable-openal disable OpenAL audio output [autodetect]
390 --disable-nas disable NAS audio output [autodetect]
391 --disable-sgiaudio disable SGI audio output [autodetect]
392 --disable-sunaudio disable Sun audio output [autodetect]
393 --disable-win32waveout disable Windows waveout audio output [autodetect]
394 --disable-select disable using select() on the audio device [enable]
396 Miscellaneous options:
397 --enable-runtime-cpudetection enable runtime CPU detection [disable]
398 --enable-cross-compile enable cross-compilation [autodetect]
399 --cc=COMPILER C compiler to build MPlayer [gcc]
400 --host-cc=COMPILER C compiler for tools needed while building [gcc]
401 --as=ASSEMBLER assembler to build MPlayer [as]
402 --ar=AR librarian to build MPlayer [ar]
403 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
404 --windres=WINDRES windres to build MPlayer [windres]
405 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
406 --enable-static build a statically linked binary
407 --charset=charset convert the console messages to this character set
408 --language=list a white space or comma separated list of languages for
409 translated man pages, the first language is used for
410 messages and the GUI (the environment variable
411 \$LINGUAS is also honored) [en]
412 (Available: $LANGUAGES all)
413 --with-install=PATH path to a custom install program
414 --enable-color-console enable color console output (UNSUPPORTED) [disable]
416 Advanced options:
417 --enable-mmx enable MMX [autodetect]
418 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
419 --enable-3dnow enable 3DNow! [autodetect]
420 --enable-3dnowext enable extended 3DNow! [autodetect]
421 --enable-sse enable SSE [autodetect]
422 --enable-sse2 enable SSE2 [autodetect]
423 --enable-ssse3 enable SSSE3 [autodetect]
424 --enable-shm enable shm [autodetect]
425 --enable-altivec enable AltiVec (PowerPC) [autodetect]
426 --enable-armv5te enable DSP extensions (ARM) [autodetect]
427 --enable-armv6 enable ARMv6 (ARM) [autodetect]
428 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
429 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
430 --enable-big-endian force byte order to big-endian [autodetect]
431 --enable-debug[=1-3] compile-in debugging information [disable]
432 --enable-profile compile-in profiling information [disable]
433 --disable-sighandler disable sighandler for crashes [enable]
434 --enable-crash-debug enable automatic gdb attach on crash [disable]
435 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
437 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
438 --disable-gcc-check disable gcc version checking [enable]
440 Use these options if autodetection fails (Options marked with (*) accept
441 multiple paths separated by ':'):
442 --extra-libs=FLAGS extra linker flags
443 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
444 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
445 --with-extraincdir=DIR extra header search paths in DIR (*)
446 --with-extralibdir=DIR extra linker search paths in DIR (*)
447 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
449 --with-freetype-config=PATH path to freetype-config
450 --with-fribidi-config=PATH path to fribidi-config
451 --with-glib-config=PATH path to glib*-config
452 --with-gtk-config=PATH path to gtk*-config
453 --with-sdl-config=PATH path to sdl*-config
454 --with-dvdnav-config=PATH path to dvdnav-config
456 This configure script is NOT autoconf-based, even though its output is similar.
457 It will try to autodetect all configuration options. If you --enable an option
458 it will be forcefully turned on, skipping autodetection. This can break
459 compilation, so you need to know what you are doing.
461 exit 0
462 } #show_help()
464 # GOTCHA: the variables below defines the default behavior for autodetection
465 # and have - unless stated otherwise - at least 2 states : yes no
466 # If autodetection is available then the third state is: auto
467 _mmx=auto
468 _3dnow=auto
469 _3dnowext=auto
470 _mmxext=auto
471 _sse=auto
472 _sse2=auto
473 _ssse3=auto
474 _cmov=auto
475 _fast_cmov=auto
476 _armv5te=auto
477 _armv6=auto
478 _iwmmxt=auto
479 _mtrr=auto
480 _altivec=auto
481 _install=install
482 _ranlib=ranlib
483 _windres=windres
484 _cc=cc
485 _ar=ar
486 test "$CC" && _cc="$CC"
487 _gcc_check=yes
488 _as=auto
489 _runtime_cpudetection=no
490 _cross_compile=auto
491 _prefix="/usr/local"
492 _libavutil_a=auto
493 _libavutil_so=auto
494 _libavcodec_a=auto
495 _libamr_nb=auto
496 _libamr_wb=auto
497 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
498 _libavdecoders=` echo $_libavdecoders_all | sed -e s/LIBFAAD_DECODER// -e s/MPEG4AAC_DECODER// -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// `
499 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
500 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// -e s/LIBVORBIS_ENCODER// `
501 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
502 _libavparsers=$_libavparsers_all
503 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
504 _libavbsfs=$_libavbsfs_all
505 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
506 _libavdemuxers=`echo $_libavdemuxers_all | sed -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/LIBNUT_DEMUXER// -e s/AVISYNTH_DEMUXER// `
507 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
508 _libavmuxers=`echo $_libavmuxers_all | sed -e s/RTP_MUXER// `
509 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
510 _libavcodec_so=auto
511 _libavformat_a=auto
512 _libavformat_so=auto
513 _libpostproc_a=auto
514 _libpostproc_so=auto
515 _libavcodec_mpegaudio_hp=yes
516 _mencoder=yes
517 _mplayer=yes
518 _x11=auto
519 _xshape=auto
520 _xss=auto
521 _dga1=auto
522 _dga2=auto
523 _xv=auto
524 _xvmc=no #auto when complete
525 _sdl=auto
526 _directx=auto
527 _win32waveout=auto
528 _nas=auto
529 _png=auto
530 _jpeg=auto
531 _pnm=yes
532 _md5sum=yes
533 _gif=auto
534 _gl=auto
535 _ggi=auto
536 _ggiwmh=auto
537 _aa=auto
538 _caca=auto
539 _svga=auto
540 _vesa=auto
541 _fbdev=auto
542 _dvb=auto
543 _dvbhead=auto
544 _dxr2=auto
545 _dxr3=auto
546 _ivtv=auto
547 _v4l2=auto
548 _iconv=auto
549 _langinfo=auto
550 _rtc=auto
551 _ossaudio=auto
552 _arts=auto
553 _esd=auto
554 _pulse=auto
555 _jack=auto
556 _openal=auto
557 _libcdio=auto
558 _liblzo=auto
559 _mad=auto
560 _toolame=auto
561 _twolame=auto
562 _tremor_internal=yes
563 _tremor_low=no
564 _tremor_external=auto
565 _libvorbis=auto
566 _speex=auto
567 _theora=auto
568 _mp3lib=yes
569 _liba52=yes
570 _libdca=auto
571 _libmpeg2=auto
572 _faad_internal=auto
573 _faad_external=auto
574 _faad_fixed=no
575 _faac=auto
576 _ladspa=auto
577 _xmms=no
578 _dvdnav=auto
579 _dvdnavconfig=dvdnav-config
580 _dvdread=auto
581 _dvdread_internal=auto
582 _libdvdcss_internal=auto
583 _xanim=auto
584 _real=auto
585 _live=auto
586 _nemesi=auto
587 _native_rtsp=yes
588 _xinerama=auto
589 _mga=auto
590 _xmga=auto
591 _vm=auto
592 _xf86keysym=auto
593 _mlib=no #broken, thus disabled
594 _sgiaudio=auto
595 _sunaudio=auto
596 _alsa=auto
597 _fastmemcpy=yes
598 _unrar_exec=auto
599 _win32dll=auto
600 _select=yes
601 _radio=no
602 _radio_capture=no
603 _radio_v4l=auto
604 _radio_v4l2=auto
605 _radio_bsdbt848=auto
606 _tv=yes
607 _tv_v4l1=auto
608 _tv_v4l2=auto
609 _tv_bsdbt848=auto
610 _tv_dshow=auto
611 _tv_teletext=auto
612 _pvr=auto
613 _network=yes
614 _winsock2=auto
615 _smbsupport=auto
616 _vidix_internal=auto
617 _vidix_external=auto
618 _vidix_pcidb=yes
619 _joystick=no
620 _xvid=auto
621 _x264=auto
622 _libnut=auto
623 _lirc=auto
624 _lircc=auto
625 _apple_remote=auto
626 _gui=no
627 _gtk1=no
628 _termcap=auto
629 _termios=auto
630 _3dfx=no
631 _s3fb=no
632 _tdfxfb=no
633 _tdfxvid=no
634 _xvr100=auto
635 _tga=yes
636 _directfb=auto
637 _zr=auto
638 _bl=no
639 _largefiles=yes
640 #_language=en
641 _shm=auto
642 _linux_devfs=no
643 _charset="UTF-8"
644 _dynamic_plugins=no
645 _crash_debug=no
646 _sighandler=yes
647 _libdv=auto
648 _cdparanoia=auto
649 _cddb=auto
650 _big_endian=auto
651 _bitmap_font=yes
652 _freetype=auto
653 _fontconfig=auto
654 _menu=no
655 _qtx=auto
656 _macosx=auto
657 _maemo=auto
658 _macosx_finder_support=no
659 _macosx_bundle=auto
660 _sortsub=yes
661 _freetypeconfig='freetype-config'
662 _fribidi=auto
663 _fribidiconfig='fribidi-config'
664 _enca=auto
665 _inet6=auto
666 _gethostbyname2=auto
667 _ftp=yes
668 _musepack=auto
669 _vstream=auto
670 _pthreads=auto
671 _w32threads=auto
672 _ass=auto
673 _rpath=no
674 _asmalign_pot=auto
675 _color_console=no
676 _stream_cache=yes
677 _def_stream_cache="#define USE_STREAM_CACHE 1"
678 _need_shmem=yes
679 for ac_option do
680 case "$ac_option" in
681 --help|-help|-h)
682 show_help
684 --prefix=*)
685 _prefix=`echo $ac_option | cut -d '=' -f 2`
687 --bindir=*)
688 _bindir=`echo $ac_option | cut -d '=' -f 2`
690 --datadir=*)
691 _datadir=`echo $ac_option | cut -d '=' -f 2`
693 --mandir=*)
694 _mandir=`echo $ac_option | cut -d '=' -f 2`
696 --confdir=*)
697 _confdir=`echo $ac_option | cut -d '=' -f 2`
699 --libdir=*)
700 _libdir=`echo $ac_option | cut -d '=' -f 2`
702 --codecsdir=*)
703 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
705 --win32codecsdir=*)
706 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
708 --xanimcodecsdir=*)
709 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
711 --realcodecsdir=*)
712 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
714 --with-extraincdir=*)
715 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
717 --with-extralibdir=*)
718 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
721 --with-install=*)
722 _install=`echo $ac_option | cut -d '=' -f 2 `
724 --with-xvmclib=*)
725 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
728 --with-sdl-config=*)
729 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
731 --with-freetype-config=*)
732 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
734 --with-fribidi-config=*)
735 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
737 --with-gtk-config=*)
738 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
740 --with-glib-config=*)
741 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
743 --with-dvdnav-config=*)
744 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
747 --extra-libs=*)
748 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
750 --extra-libs-mplayer=*)
751 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
753 --extra-libs-mencoder=*)
754 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
757 --target=*)
758 _target=`echo $ac_option | cut -d '=' -f 2`
760 --cc=*)
761 _cc=`echo $ac_option | cut -d '=' -f 2`
763 --host-cc=*)
764 _host_cc=`echo $ac_option | cut -d '=' -f 2`
766 --as=*)
767 _as=`echo $ac_option | cut -d '=' -f 2`
769 --ar=*)
770 _ar=`echo $ac_option | cut -d '=' -f 2`
772 --ranlib=*)
773 _ranlib=`echo $ac_option | cut -d '=' -f 2`
775 --windres=*)
776 _windres=`echo $ac_option | cut -d '=' -f 2`
778 --charset=*)
779 _charset=`echo $ac_option | cut -d '=' -f 2`
781 --language=*)
782 _language=`echo $ac_option | cut -d '=' -f 2`
785 --enable-static)
786 _ld_static='-static'
788 --disable-static)
789 _ld_static=''
791 --enable-profile)
792 _profile='-p'
794 --disable-profile)
795 _profile=
797 --enable-debug)
798 _debug='-g'
800 --enable-debug=*)
801 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
803 --disable-debug)
804 _debug=
806 --enable-gcc-check) _gcc_check=yes ;;
807 --disable-gcc-check) _gcc_check=no ;;
808 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
809 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
810 --enable-cross-compile) _cross_compile=yes ;;
811 --disable-cross-compile) _cross_compile=no ;;
812 --enable-mencoder) _mencoder=yes ;;
813 --disable-mencoder) _mencoder=no ;;
814 --enable-mplayer) _mplayer=yes ;;
815 --disable-mplayer) _mplayer=no ;;
816 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
817 --disable-dynamic-plugins) _dynamic_plugins=no ;;
818 --enable-x11) _x11=yes ;;
819 --disable-x11) _x11=no ;;
820 --enable-xshape) _xshape=yes ;;
821 --disable-xshape) _xshape=no ;;
822 --enable-xss) _xss=yes ;;
823 --disable-xss) _xss=no ;;
824 --enable-xv) _xv=yes ;;
825 --disable-xv) _xv=no ;;
826 --enable-xvmc) _xvmc=yes ;;
827 --disable-xvmc) _xvmc=no ;;
828 --enable-sdl) _sdl=yes ;;
829 --disable-sdl) _sdl=no ;;
830 --enable-directx) _directx=yes ;;
831 --disable-directx) _directx=no ;;
832 --enable-win32waveout) _win32waveout=yes ;;
833 --disable-win32waveout) _win32waveout=no ;;
834 --enable-nas) _nas=yes ;;
835 --disable-nas) _nas=no ;;
836 --enable-png) _png=yes ;;
837 --disable-png) _png=no ;;
838 --enable-jpeg) _jpeg=yes ;;
839 --disable-jpeg) _jpeg=no ;;
840 --enable-pnm) _pnm=yes ;;
841 --disable-pnm) _pnm=no ;;
842 --enable-md5sum) _md5sum=yes ;;
843 --disable-md5sum) _md5sum=no ;;
844 --enable-gif) _gif=yes ;;
845 --disable-gif) _gif=no ;;
846 --enable-gl) _gl=yes ;;
847 --disable-gl) _gl=no ;;
848 --enable-ggi) _ggi=yes ;;
849 --disable-ggi) _ggi=no ;;
850 --enable-ggiwmh) _ggiwmh=yes ;;
851 --disable-ggiwmh) _ggiwmh=no ;;
852 --enable-aa) _aa=yes ;;
853 --disable-aa) _aa=no ;;
854 --enable-caca) _caca=yes ;;
855 --disable-caca) _caca=no ;;
856 --enable-svga) _svga=yes ;;
857 --disable-svga) _svga=no ;;
858 --enable-vesa) _vesa=yes ;;
859 --disable-vesa) _vesa=no ;;
860 --enable-fbdev) _fbdev=yes ;;
861 --disable-fbdev) _fbdev=no ;;
862 --enable-dvb) _dvb=yes ;;
863 --disable-dvb) _dvb=no ;;
864 --enable-dvbhead) _dvbhead=yes ;;
865 --disable-dvbhead) _dvbhead=no ;;
866 --enable-dxr2) _dxr2=yes ;;
867 --disable-dxr2) _dxr2=no ;;
868 --enable-dxr3) _dxr3=yes ;;
869 --disable-dxr3) _dxr3=no ;;
870 --enable-ivtv) _ivtv=yes ;;
871 --disable-ivtv) _ivtv=no ;;
872 --enable-v4l2) _v4l2=yes ;;
873 --disable-v4l2) _v4l2=no ;;
874 --enable-iconv) _iconv=yes ;;
875 --disable-iconv) _iconv=no ;;
876 --enable-langinfo) _langinfo=yes ;;
877 --disable-langinfo) _langinfo=no ;;
878 --enable-rtc) _rtc=yes ;;
879 --disable-rtc) _rtc=no ;;
880 --enable-libdv) _libdv=yes ;;
881 --disable-libdv) _libdv=no ;;
882 --enable-ossaudio) _ossaudio=yes ;;
883 --disable-ossaudio) _ossaudio=no ;;
884 --enable-arts) _arts=yes ;;
885 --disable-arts) _arts=no ;;
886 --enable-esd) _esd=yes ;;
887 --disable-esd) _esd=no ;;
888 --enable-pulse) _pulse=yes ;;
889 --disable-pulse) _pulse=no ;;
890 --enable-jack) _jack=yes ;;
891 --disable-jack) _jack=no ;;
892 --enable-openal) _openal=yes ;;
893 --disable-openal) _openal=no ;;
894 --enable-mad) _mad=yes ;;
895 --disable-mad) _mad=no ;;
896 --enable-toolame) _toolame=yes ;;
897 --disable-toolame) _toolame=no ;;
898 --enable-twolame) _twolame=yes ;;
899 --disable-twolame) _twolame=no ;;
900 --enable-libcdio) _libcdio=yes ;;
901 --disable-libcdio) _libcdio=no ;;
902 --enable-liblzo) _liblzo=yes ;;
903 --disable-liblzo) _liblzo=no ;;
904 --enable-libvorbis) _libvorbis=yes ;;
905 --disable-libvorbis) _libvorbis=no ;;
906 --enable-speex) _speex=yes ;;
907 --disable-speex) _speex=no ;;
908 --enable-tremor-internal) _tremor_internal=yes ;;
909 --disable-tremor-internal) _tremor_internal=no ;;
910 --enable-tremor-low) _tremor_low=yes ;;
911 --disable-tremor-low) _tremor_low=no ;;
912 --enable-tremor-external) _tremor_external=yes ;;
913 --disable-tremor-external) _tremor_external=no ;;
914 --enable-theora) _theora=yes ;;
915 --disable-theora) _theora=no ;;
916 --enable-mp3lib) _mp3lib=yes ;;
917 --disable-mp3lib) _mp3lib=no ;;
918 --enable-liba52) _liba52=yes ;;
919 --disable-liba52) _liba52=no ;;
920 --enable-libdca) _libdca=yes ;;
921 --disable-libdca) _libdca=no ;;
922 --enable-libmpeg2) _libmpeg2=yes ;;
923 --disable-libmpeg2) _libmpeg2=no ;;
924 --enable-musepack) _musepack=yes ;;
925 --disable-musepack) _musepack=no ;;
926 --enable-faad-internal) _faad_internal=yes ;;
927 --disable-faad-internal) _faad_internal=no ;;
928 --enable-faad-external) _faad_external=yes ;;
929 --disable-faad-external) _faad_external=no ;;
930 --enable-faad-fixed) _faad_fixed=yes ;;
931 --disable-faad-fixed) _faad_fixed=no ;;
932 --enable-faac) _faac=yes ;;
933 --disable-faac) _faac=no ;;
934 --enable-ladspa) _ladspa=yes ;;
935 --disable-ladspa) _ladspa=no ;;
936 --enable-xmms) _xmms=yes ;;
937 --disable-xmms) _xmms=no ;;
938 --enable-dvdread) _dvdread=yes ;;
939 --disable-dvdread) _dvdread=no ;;
940 --enable-dvdread-internal) _dvdread_internal=yes ;;
941 --disable-dvdread-internal) _dvdread_internal=no ;;
942 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
943 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
944 --enable-dvdnav) _dvdnav=yes ;;
945 --disable-dvdnav) _dvdnav=no ;;
946 --enable-xanim) _xanim=yes ;;
947 --disable-xanim) _xanim=no ;;
948 --enable-real) _real=yes ;;
949 --disable-real) _real=no ;;
950 --enable-live) _live=yes ;;
951 --disable-live) _live=no ;;
952 --enable-nemesi) _nemesi=yes ;;
953 --disable-nemesi) _nemesi=no ;;
954 --enable-xinerama) _xinerama=yes ;;
955 --disable-xinerama) _xinerama=no ;;
956 --enable-mga) _mga=yes ;;
957 --disable-mga) _mga=no ;;
958 --enable-xmga) _xmga=yes ;;
959 --disable-xmga) _xmga=no ;;
960 --enable-vm) _vm=yes ;;
961 --disable-vm) _vm=no ;;
962 --enable-xf86keysym) _xf86keysym=yes ;;
963 --disable-xf86keysym) _xf86keysym=no ;;
964 --enable-mlib) _mlib=yes ;;
965 --disable-mlib) _mlib=no ;;
966 --enable-sunaudio) _sunaudio=yes ;;
967 --disable-sunaudio) _sunaudio=no ;;
968 --enable-sgiaudio) _sgiaudio=yes ;;
969 --disable-sgiaudio) _sgiaudio=no ;;
970 --enable-alsa) _alsa=yes ;;
971 --disable-alsa) _alsa=no ;;
972 --enable-tv) _tv=yes ;;
973 --disable-tv) _tv=no ;;
974 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
975 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
976 --enable-tv-v4l1) _tv_v4l1=yes ;;
977 --disable-tv-v4l1) _tv_v4l1=no ;;
978 --enable-tv-v4l2) _tv_v4l2=yes ;;
979 --disable-tv-v4l2) _tv_v4l2=no ;;
980 --enable-tv-dshow) _tv_dshow=yes ;;
981 --disable-tv-dshow) _tv_dshow=no ;;
982 --enable-tv-teletext) _tv_teletext=yes ;;
983 --disable-tv-teletext) _tv_teletext=no ;;
984 --enable-radio) _radio=yes ;;
985 --enable-radio-capture) _radio_capture=yes ;;
986 --disable-radio-capture) _radio_capture=no ;;
987 --disable-radio) _radio=no ;;
988 --enable-radio-v4l) _radio_v4l=yes ;;
989 --disable-radio-v4l) _radio_v4l=no ;;
990 --enable-radio-v4l2) _radio_v4l2=yes ;;
991 --disable-radio-v4l2) _radio_v4l2=no ;;
992 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
993 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
994 --enable-pvr) _pvr=yes ;;
995 --disable-pvr) _pvr=no ;;
996 --enable-fastmemcpy) _fastmemcpy=yes ;;
997 --disable-fastmemcpy) _fastmemcpy=no ;;
998 --enable-network) _network=yes ;;
999 --disable-network) _network=no ;;
1000 --enable-winsock2) _winsock2=yes ;;
1001 --disable-winsock2) _winsock2=no ;;
1002 --enable-smb) _smbsupport=yes ;;
1003 --disable-smb) _smbsupport=no ;;
1004 --enable-vidix-internal) _vidix_internal=yes ;;
1005 --disable-vidix-internal) _vidix_internal=no ;;
1006 --enable-vidix-external) _vidix_external=yes ;;
1007 --disable-vidix-external) _vidix_external=no ;;
1008 --with-vidix-drivers=*)
1009 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
1011 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1012 --enable-joystick) _joystick=yes ;;
1013 --disable-joystick) _joystick=no ;;
1014 --enable-xvid) _xvid=yes ;;
1015 --disable-xvid) _xvid=no ;;
1016 --enable-x264) _x264=yes ;;
1017 --disable-x264) _x264=no ;;
1018 --enable-libnut) _libnut=yes ;;
1019 --disable-libnut) _libnut=no ;;
1020 --enable-libavutil_a) _libavutil_a=yes ;;
1021 --disable-libavutil_a) _libavutil_a=no ;;
1022 --enable-libavutil_so) _libavutil_so=yes ;;
1023 --disable-libavutil_so) _libavutil_so=no ;;
1024 --enable-libavcodec_a) _libavcodec_a=yes ;;
1025 --disable-libavcodec_a) _libavcodec_a=no ;;
1026 --enable-libavcodec_so) _libavcodec_so=yes ;;
1027 --disable-libavcodec_so) _libavcodec_so=no ;;
1028 --enable-libamr_nb) _libamr_nb=yes ;;
1029 --disable-libamr_nb) _libamr_nb=no ;;
1030 --enable-libamr_wb) _libamr_wb=yes ;;
1031 --disable-libamr_wb) _libamr_wb=no ;;
1032 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1033 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1034 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1035 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1036 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1037 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1038 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1039 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1040 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1041 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1042 --enable-libavformat_a) _libavformat_a=yes ;;
1043 --disable-libavformat_a) _libavformat_a=no ;;
1044 --enable-libavformat_so) _libavformat_so=yes ;;
1045 --disable-libavformat_so) _libavformat_so=no ;;
1046 --enable-libpostproc_a) _libpostproc_a=yes ;;
1047 --disable-libpostproc_a) _libpostproc_a=no ;;
1048 --enable-libpostproc_so) _libpostproc_so=yes ;;
1049 --disable-libpostproc_so) _libpostproc_so=no ;;
1050 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1051 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1053 --enable-lirc) _lirc=yes ;;
1054 --disable-lirc) _lirc=no ;;
1055 --enable-lircc) _lircc=yes ;;
1056 --disable-lircc) _lircc=no ;;
1057 --enable-apple-remote) _apple_remote=yes ;;
1058 --disable-apple-remote) _apple_remote=no ;;
1059 --enable-gui) _gui=yes ;;
1060 --disable-gui) _gui=no ;;
1061 --enable-gtk1) _gtk1=yes ;;
1062 --disable-gtk1) _gtk1=no ;;
1063 --enable-termcap) _termcap=yes ;;
1064 --disable-termcap) _termcap=no ;;
1065 --enable-termios) _termios=yes ;;
1066 --disable-termios) _termios=no ;;
1067 --enable-3dfx) _3dfx=yes ;;
1068 --disable-3dfx) _3dfx=no ;;
1069 --enable-s3fb) _s3fb=yes ;;
1070 --disable-s3fb) _s3fb=no ;;
1071 --enable-tdfxfb) _tdfxfb=yes ;;
1072 --disable-tdfxfb) _tdfxfb=no ;;
1073 --disable-tdfxvid) _tdfxvid=no ;;
1074 --enable-tdfxvid) _tdfxvid=yes ;;
1075 --disable-xvr100) _xvr100=no ;;
1076 --enable-xvr100) _xvr100=yes ;;
1077 --disable-tga) _tga=no ;;
1078 --enable-tga) _tga=yes ;;
1079 --enable-directfb) _directfb=yes ;;
1080 --disable-directfb) _directfb=no ;;
1081 --enable-zr) _zr=yes ;;
1082 --disable-zr) _zr=no ;;
1083 --enable-bl) _bl=yes ;;
1084 --disable-bl) _bl=no ;;
1085 --enable-mtrr) _mtrr=yes ;;
1086 --disable-mtrr) _mtrr=no ;;
1087 --enable-largefiles) _largefiles=yes ;;
1088 --disable-largefiles) _largefiles=no ;;
1089 --enable-shm) _shm=yes ;;
1090 --disable-shm) _shm=no ;;
1091 --enable-select) _select=yes ;;
1092 --disable-select) _select=no ;;
1093 --enable-linux-devfs) _linux_devfs=yes ;;
1094 --disable-linux-devfs) _linux_devfs=no ;;
1095 --enable-cdparanoia) _cdparanoia=yes ;;
1096 --disable-cdparanoia) _cdparanoia=no ;;
1097 --enable-cddb) _cddb=yes ;;
1098 --disable-cddb) _cddb=no ;;
1099 --enable-big-endian) _big_endian=yes ;;
1100 --disable-big-endian) _big_endian=no ;;
1101 --enable-bitmap-font) _bitmap_font=yes ;;
1102 --disable-bitmap-font) _bitmap_font=no ;;
1103 --enable-freetype) _freetype=yes ;;
1104 --disable-freetype) _freetype=no ;;
1105 --enable-fontconfig) _fontconfig=yes ;;
1106 --disable-fontconfig) _fontconfig=no ;;
1107 --enable-unrarexec) _unrar_exec=yes ;;
1108 --disable-unrarexec) _unrar_exec=no ;;
1109 --enable-ftp) _ftp=yes ;;
1110 --disable-ftp) _ftp=no ;;
1111 --enable-vstream) _vstream=yes ;;
1112 --disable-vstream) _vstream=no ;;
1113 --enable-pthreads) _pthreads=yes ;;
1114 --disable-pthreads) _pthreads=no ;;
1115 --enable-w32threads) _w32threads=yes ;;
1116 --disable-w32threads) _w32threads=no ;;
1117 --enable-ass) _ass=yes ;;
1118 --disable-ass) _ass=no ;;
1119 --enable-rpath) _rpath=yes ;;
1120 --disable-rpath) _rpath=no ;;
1121 --enable-color-console) _color_console=yes ;;
1122 --disable-color-console) _color_console=no ;;
1124 --enable-fribidi) _fribidi=yes ;;
1125 --disable-fribidi) _fribidi=no ;;
1127 --enable-enca) _enca=yes ;;
1128 --disable-enca) _enca=no ;;
1130 --enable-inet6) _inet6=yes ;;
1131 --disable-inet6) _inet6=no ;;
1133 --enable-gethostbyname2) _gethostbyname2=yes ;;
1134 --disable-gethostbyname2) _gethostbyname2=no ;;
1136 --enable-dga1) _dga1=yes ;;
1137 --disable-dga1) _dga1=no ;;
1138 --enable-dga2) _dga2=yes ;;
1139 --disable-dga2) _dga2=no ;;
1141 --enable-menu) _menu=yes ;;
1142 --disable-menu) _menu=no ;;
1144 --enable-qtx) _qtx=yes ;;
1145 --disable-qtx) _qtx=no ;;
1147 --enable-macosx) _macosx=yes ;;
1148 --disable-macosx) _macosx=no ;;
1149 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1150 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1151 --enable-macosx-bundle) _macosx_bundle=yes;;
1152 --disable-macosx-bundle) _macosx_bundle=no;;
1154 --enable-maemo) _maemo=yes ;;
1155 --disable-maemo) _maemo=no ;;
1157 --enable-sortsub) _sortsub=yes ;;
1158 --disable-sortsub) _sortsub=no ;;
1160 --enable-crash-debug) _crash_debug=yes ;;
1161 --disable-crash-debug) _crash_debug=no ;;
1162 --enable-sighandler) _sighandler=yes ;;
1163 --disable-sighandler) _sighandler=no ;;
1164 --enable-win32dll) _win32dll=yes ;;
1165 --disable-win32dll) _win32dll=no ;;
1167 --enable-sse) _sse=yes ;;
1168 --disable-sse) _sse=no ;;
1169 --enable-sse2) _sse2=yes ;;
1170 --disable-sse2) _sse2=no ;;
1171 --enable-ssse3) _ssse3=yes ;;
1172 --disable-ssse3) _ssse3=no ;;
1173 --enable-mmxext) _mmxext=yes ;;
1174 --disable-mmxext) _mmxext=no ;;
1175 --enable-3dnow) _3dnow=yes ;;
1176 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1177 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1178 --disable-3dnowext) _3dnowext=no ;;
1179 --enable-cmov) _cmov=yes ;;
1180 --disable-cmov) _cmov=no ;;
1181 --enable-fast-cmov) _fast_cmov=yes ;;
1182 --disable-fast-cmov) _fast_cmov=no ;;
1183 --enable-altivec) _altivec=yes ;;
1184 --disable-altivec) _altivec=no ;;
1185 --enable-armv5te) _armv5te=yes ;;
1186 --disable-armv5te) _armv5te=no ;;
1187 --enable-armv6) _armv6=yes ;;
1188 --disable-armv6) _armv6=no ;;
1189 --enable-iwmmxt) _iwmmxt=yes ;;
1190 --disable-iwmmxt) _iwmmxt=no ;;
1191 --enable-mmx) _mmx=yes ;;
1192 --disable-mmx) # 3Dnow! and MMX2 require MMX
1193 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1196 echo "Unknown parameter: $ac_option"
1197 exit 1
1200 esac
1201 done
1203 # Atmos: moved this here, to be correct, if --prefix is specified
1204 test -z "$_bindir" && _bindir="$_prefix/bin"
1205 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1206 test -z "$_mandir" && _mandir="$_prefix/share/man"
1207 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1208 test -z "$_libdir" && _libdir="$_prefix/lib"
1210 # Determine our OS name and CPU architecture
1211 if test -z "$_target" ; then
1212 # OS name
1213 system_name=`uname -s 2>&1`
1214 case "$system_name" in
1215 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX|AmigaOS)
1217 IRIX*)
1218 system_name=IRIX
1220 GNU/kFreeBSD)
1221 system_name=FreeBSD
1223 HP-UX*)
1224 system_name=HP-UX
1226 [cC][yY][gG][wW][iI][nN]*)
1227 system_name=CYGWIN
1229 MINGW32*)
1230 system_name=MINGW32
1232 OS/2*)
1233 system_name=OS/2
1236 system_name="$system_name-UNKNOWN"
1238 esac
1241 # host's CPU/instruction set
1242 host_arch=`uname -p 2>&1`
1243 case "$host_arch" in
1244 i386|sparc|ppc|alpha|arm|sh3|mips|vax)
1246 powerpc) # Darwin returns 'powerpc'
1247 host_arch=ppc
1249 *) # uname -p on Linux returns 'unknown' for the processor type,
1250 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1252 # Maybe uname -m (machine hardware name) returns something we
1253 # recognize.
1255 # x86/x86pc is used by QNX
1256 case "`uname -m 2>&1`" in
1257 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 ;;
1258 ia64) host_arch=ia64 ;;
1259 x86_64|amd64)
1260 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1261 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1262 host_arch=x86_64
1263 else
1264 host_arch=i386
1267 macppc|ppc|ppc64) host_arch=ppc ;;
1268 alpha) host_arch=alpha ;;
1269 sparc) host_arch=sparc ;;
1270 sparc64) host_arch=sparc64 ;;
1271 parisc*|hppa*|9000*) host_arch=hppa ;;
1272 arm*|zaurus|cats) host_arch=arm ;;
1273 sh3) host_arch=sh3 ;;
1274 s390) host_arch=s390 ;;
1275 s390x) host_arch=s390x ;;
1276 mips*) host_arch=mips ;;
1277 vax) host_arch=vax ;;
1278 xtensa*) host_arch=xtensa ;;
1279 *) host_arch=UNKNOWN ;;
1280 esac
1282 esac
1283 else # if test -z "$_target"
1284 system_name=`echo $_target | cut -d '-' -f 2`
1285 case "`echo $system_name | tr A-Z a-z`" in
1286 linux) system_name=Linux ;;
1287 freebsd) system_name=FreeBSD ;;
1288 gnu/kfreebsd) system_name=FreeBSD ;;
1289 netbsd) system_name=NetBSD ;;
1290 bsd/os) system_name=BSD/OS ;;
1291 openbsd) system_name=OpenBSD ;;
1292 sunos) system_name=SunOS ;;
1293 qnx) system_name=QNX ;;
1294 morphos) system_name=MorphOS ;;
1295 amigaos) system_name=AmigaOS ;;
1296 mingw32msvc) system_name=MINGW32 ;;
1297 esac
1298 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1299 host_arch=`echo $_target | cut -d '-' -f 1`
1300 if test `echo $host_arch` != "x86_64" ; then
1301 host_arch=`echo $host_arch | tr '_' '-'`
1305 echo "Detected operating system: $system_name"
1306 echo "Detected host architecture: $host_arch"
1308 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1309 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1313 if freebsd ; then
1314 _ld_extra="$_ld_extra -L/usr/local/lib"
1315 _inc_extra="$_inc_extra -I/usr/local/include"
1318 if darwin; then
1319 _ld_extra="$_ld_extra -L/usr/local/lib"
1320 _inc_extra="$_inc_extra -I/usr/local/include"
1323 if aix ; then
1324 _ld_extra="$_ld_extra -lC"
1327 if irix ; then
1328 _ranlib='ar -r'
1329 elif linux ; then
1330 _ranlib='true'
1333 if win32 ; then
1334 _exesuf=".exe"
1335 # -lwinmm is always needed for osdep/timer-win2.c
1336 _ld_extra="$_ld_extra -lwinmm"
1337 _confwin32='TARGET_WIN32 = yes'
1338 else
1339 _confwin32='TARGET_WIN32 = no'
1342 if mingw32 ; then
1343 _need_shmem=no
1346 if cygwin ; then
1347 _def_confwin32='#define WIN32'
1350 if amigaos ; then
1351 _select=no
1352 _sighandler=no
1353 _stream_cache=no
1354 _def_stream_cache="#undef USE_STREAM_CACHE"
1357 if qnx ; then
1358 _ld_extra="$_ld_extra -lph"
1361 if os2 ; then
1362 _exesuf=".exe"
1363 _need_shmem=no
1364 _ar="emxomfar -p256"
1365 _ranlib="echo ignoring ranlib"
1366 _ld_extra="$_ld_extra -Zomf -Zstack 16384 -Zbin-files -Zargs-wild -lmmpm2"
1369 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1370 test "$I" && break
1371 done
1374 TMPLOG="configure.log"
1375 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1376 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1377 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1378 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1379 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1381 rm -f "$TMPLOG"
1382 echo configuration: $_configuration > "$TMPLOG"
1383 echo >> "$TMPLOG"
1386 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1387 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1388 # know about '-n'.
1389 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1390 _head() { head -$1 2>/dev/null ; }
1391 else
1392 _head() { head -n $1 2>/dev/null ; }
1394 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1395 _tail() { tail -$1 2>/dev/null ; }
1396 else
1397 _tail() { tail -n $1 2>/dev/null ; }
1400 # Checking CC version...
1401 if test "$_gcc_check" = yes ; then
1402 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1403 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1404 echocheck "$_cc version"
1405 cc_vendor=intel
1406 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1407 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1408 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1409 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1410 # TODO verify older icc/ecc compatibility
1411 case $cc_version in
1413 cc_version="v. ?.??, bad"
1414 cc_verc_fail=yes
1416 10.1)
1417 cc_version="$cc_version, ok"
1418 cc_verc_fail=no
1421 cc_version="$cc_version, bad"
1422 cc_verc_fail=yes
1424 esac
1425 echores "$cc_version"
1426 else
1427 for _cc in "$_cc" gcc cc ; do
1428 echocheck "$_cc version"
1429 cc_vendor=gnu
1430 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1431 cc_version=`$_cc -dumpversion 2>&1`
1432 if test "$?" -gt 0; then
1433 cc_version="not found"
1435 case $cc_version in
1437 cc_version="v. ?.??, bad"
1438 cc_verc_fail=yes
1440 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1441 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1442 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1443 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1444 cc_version="$cc_version, ok"
1445 cc_verc_fail=no
1447 'not found')
1448 cc_verc_fail=yes
1451 cc_version="$cc_version, bad"
1452 cc_verc_fail=yes
1454 esac
1455 echores "$cc_version"
1456 test "$cc_verc_fail" = "no" && break
1457 done
1458 fi # icc
1459 if test "$cc_verc_fail" = yes ; then
1460 cat <<EOF
1462 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1464 You are not using a supported compiler. We do not have the time to make sure
1465 everything works with compilers other than the ones we use. Use either the
1466 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1467 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1469 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1470 mplayer and lame (which is used for mencoder). If you get compile errors,
1471 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1472 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1473 bugs!
1475 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1478 die "Bad gcc version"
1480 else
1481 cat <<EOF
1483 ******************************************************************************
1485 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1486 Ok. You know. Do it.
1488 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1489 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1490 Lame which is used by mencoder produces weird errors, too.
1492 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1493 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1495 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1497 ******************************************************************************
1501 read _answer
1504 echocheck "host cc"
1505 test "$_host_cc" || _host_cc=$_cc
1506 echores $_host_cc
1508 echocheck "cross compilation"
1509 if test $_cross_compile = auto ; then
1510 cat > $TMPC << EOF
1511 int main(void) { return 0; }
1513 _cross_compile=yes
1514 cc_check && "$TMPEXE" && _cross_compile=no
1516 echores $_cross_compile
1518 if test $_cross_compile = yes; then
1519 tmp_run() {
1520 return 0
1524 # ---
1526 # now that we know what compiler should be used for compilation, try to find
1527 # out which assembler is used by the $_cc compiler
1528 if test "$_as" = auto ; then
1529 _as=`$_cc -print-prog-name=as`
1530 test -z "$_as" && _as=as
1533 # XXX: this should be ok..
1534 _cpuinfo="echo"
1536 if test "$_runtime_cpudetection" = no ; then
1538 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1539 # FIXME: Remove the cygwin check once AMD CPUs are supported
1540 if test -r /proc/cpuinfo && ! cygwin; then
1541 # Linux with /proc mounted, extract CPU information from it
1542 _cpuinfo="cat /proc/cpuinfo"
1543 elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then
1544 # FreeBSD with Linux emulation /proc mounted,
1545 # extract CPU information from it
1546 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1547 elif darwin && ! x86_32 ; then
1548 # use hostinfo on Darwin
1549 _cpuinfo="hostinfo"
1550 elif aix; then
1551 # use 'lsattr' on AIX
1552 _cpuinfo="lsattr -E -l proc0 -a type"
1553 elif x86; then
1554 # all other OSes try to extract CPU information from a small helper
1555 # program cpuinfo instead
1556 $_cc -o cpuinfo$_exesuf cpuinfo.c
1557 _cpuinfo="./cpuinfo$_exesuf"
1560 if x86 ; then
1561 # gather more CPU information
1562 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1563 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1564 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1565 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1566 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1568 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1570 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1571 -e s/xmm/sse/ -e s/kni/sse/`
1573 for ext in $pparam ; do
1574 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1575 done
1577 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1578 test $_sse = kernel_check && _mmxext=kernel_check
1580 echocheck "CPU vendor"
1581 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1583 echocheck "CPU type"
1584 echores "$pname"
1587 fi # test "$_runtime_cpudetection" = no
1589 if x86 && test "$_runtime_cpudetection" = no ; then
1590 extcheck() {
1591 if test "$1" = kernel_check ; then
1592 echocheck "kernel support of $2"
1593 cat > $TMPC <<EOF
1594 #include <signal.h>
1595 void catch() { exit(1); }
1596 int main(void){
1597 signal(SIGILL, catch);
1598 __asm__ __volatile__ ("$3":::"memory");return(0);
1602 if cc_check && tmp_run ; then
1603 eval _$2=yes
1604 echores "yes"
1605 _optimizing="$_optimizing $2"
1606 return 0
1607 else
1608 eval _$2=no
1609 echores "failed"
1610 echo "It seems that your kernel does not correctly support $2."
1611 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1612 return 1
1615 return 0
1618 extcheck $_mmx "mmx" "emms"
1619 extcheck $_mmxext "mmxext" "sfence"
1620 extcheck $_3dnow "3dnow" "femms"
1621 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1622 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1623 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1624 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1625 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1627 echocheck "mtrr support"
1628 if test "$_mtrr" = kernel_check ; then
1629 _mtrr="yes"
1630 _optimizing="$_optimizing mtrr"
1632 echores "$_mtrr"
1634 if test "$_gcc3_ext" != ""; then
1635 # if we had to disable sse/sse2 because the active kernel does not
1636 # support this instruction set extension, we also have to tell
1637 # gcc3 to not generate sse/sse2 instructions for normal C code
1638 cat > $TMPC << EOF
1639 int main(void) { return 0; }
1641 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1647 _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM ARMV4L SH3 POWERPC PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC'
1648 case "$host_arch" in
1649 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1650 _arch='X86 X86_32'
1651 _target_arch_x86="ARCH_X86 = yes"
1652 _target_arch="ARCH_X86_32 = yes"
1653 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1654 iproc=486
1655 proc=i486
1658 if test "$_runtime_cpudetection" = no ; then
1659 case "$pvendor" in
1660 AuthenticAMD)
1661 case "$pfamily" in
1662 3) proc=i386 iproc=386 ;;
1663 4) proc=i486 iproc=486 ;;
1664 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1665 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1666 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1667 proc=k6-3
1668 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1669 proc=geode
1670 elif test "$pmodel" -ge 8; then
1671 proc=k6-2
1672 elif test "$pmodel" -ge 6; then
1673 proc=k6
1674 else
1675 proc=i586
1678 6) iproc=686
1679 # It's a bit difficult to determine the correct type of Family 6
1680 # AMD CPUs just from their signature. Instead, we check directly
1681 # whether it supports SSE.
1682 if test "$_sse" = yes; then
1683 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1684 proc=athlon-xp
1685 else
1686 # Again, gcc treats athlon and athlon-tbird similarly.
1687 proc=athlon
1690 15) iproc=686
1691 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1692 # caught and remedied in the optimization tests below.
1693 proc=k8
1696 *) proc=k8 iproc=686 ;;
1697 esac
1699 GenuineIntel)
1700 case "$pfamily" in
1701 3) proc=i386 iproc=386 ;;
1702 4) proc=i486 iproc=486 ;;
1703 5) iproc=586
1704 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1705 proc=pentium-mmx # 4 is desktop, 8 is mobile
1706 else
1707 proc=i586
1710 6) iproc=686
1711 if test "$pmodel" -ge 15; then
1712 proc=core2
1713 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1714 proc=pentium-m
1715 elif test "$pmodel" -ge 7; then
1716 proc=pentium3
1717 elif test "$pmodel" -ge 3; then
1718 proc=pentium2
1719 else
1720 proc=i686
1723 15) iproc=686
1724 # A nocona in 32-bit mode has no more capabilities than a prescott.
1725 if test "$pmodel" -ge 3; then
1726 proc=prescott
1727 else
1728 proc=pentium4
1730 test $_fast_cmov = "auto" && _fast_cmov=no
1732 *) proc=prescott iproc=686 ;;
1733 esac
1735 CentaurHauls)
1736 case "$pfamily" in
1737 5) iproc=586
1738 if test "$pmodel" -ge 8; then
1739 proc=winchip2
1740 elif test "$pmodel" -ge 4; then
1741 proc=winchip-c6
1742 else
1743 proc=i586
1746 6) iproc=686
1747 if test "$pmodel" -ge 9; then
1748 proc=c3-2
1749 else
1750 proc=c3
1751 iproc=586
1754 *) proc=i686 iproc=i686 ;;
1755 esac
1757 unknown)
1758 case "$pfamily" in
1759 3) proc=i386 iproc=386 ;;
1760 4) proc=i486 iproc=486 ;;
1761 *) proc=i586 iproc=586 ;;
1762 esac
1765 proc=i586 iproc=586 ;;
1766 esac
1767 fi # test "$_runtime_cpudetection" = no
1770 # check that gcc supports our CPU, if not, fall back to earlier ones
1771 # LGB: check -mcpu and -march swithing step by step with enabling
1772 # to fall back till 386.
1774 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1776 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1777 cpuopt=-mtune
1778 else
1779 cpuopt=-mcpu
1782 echocheck "GCC & CPU optimization abilities"
1783 cat > $TMPC << EOF
1784 int main(void) { return 0; }
1786 if test "$_runtime_cpudetection" = no ; then
1787 cc_check -march=native && proc=native
1788 if test "$proc" = "k8"; then
1789 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1791 if test "$proc" = "athlon-xp"; then
1792 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1794 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1795 cc_check -march=$proc $cpuopt=$proc || proc=k6
1797 if test "$proc" = "k6" || test "$proc" = "c3"; then
1798 if ! cc_check -march=$proc $cpuopt=$proc; then
1799 if cc_check -march=i586 $cpuopt=i686; then
1800 proc=i586-i686
1801 else
1802 proc=i586
1806 if test "$proc" = "prescott" ; then
1807 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1809 if test "$proc" = "core2" ; then
1810 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1812 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
1813 cc_check -march=$proc $cpuopt=$proc || proc=i686
1815 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1816 cc_check -march=$proc $cpuopt=$proc || proc=i586
1818 if test "$proc" = "i586"; then
1819 cc_check -march=$proc $cpuopt=$proc || proc=i486
1821 if test "$proc" = "i486" ; then
1822 cc_check -march=$proc $cpuopt=$proc || proc=i386
1824 if test "$proc" = "i386" ; then
1825 cc_check -march=$proc $cpuopt=$proc || proc=error
1827 if test "$proc" = "error" ; then
1828 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1829 _mcpu=""
1830 _march=""
1831 _optimizing=""
1832 elif test "$proc" = "i586-i686"; then
1833 _march="-march=i586"
1834 _mcpu="$cpuopt=i686"
1835 _optimizing="$proc"
1836 else
1837 _march="-march=$proc"
1838 _mcpu="$cpuopt=$proc"
1839 _optimizing="$proc"
1841 else # if test "$_runtime_cpudetection" = no
1842 _mcpu="$cpuopt=generic"
1843 # at least i486 required, for bswap instruction
1844 _march="-march=i486"
1845 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1846 cc_check $_mcpu || _mcpu=""
1847 cc_check $_march $_mcpu || _march=""
1850 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1851 ## autodetected mcpu/march parameters
1852 if test "$_target" ; then
1853 # TODO: it may be a good idea to check GCC and fall back in all cases
1854 if test "$host_arch" = "i586-i686"; then
1855 _march="-march=i586"
1856 _mcpu="$cpuopt=i686"
1857 else
1858 _march="-march=$host_arch"
1859 _mcpu="$cpuopt=$host_arch"
1862 proc="$host_arch"
1864 case "$proc" in
1865 i386) iproc=386 ;;
1866 i486) iproc=486 ;;
1867 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1868 i686|athlon*|pentium*) iproc=686 ;;
1869 *) iproc=586 ;;
1870 esac
1873 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1874 _fast_cmov="yes"
1875 else
1876 _fast_cmov="no"
1879 echores "$proc"
1882 ia64)
1883 _arch='IA64'
1884 _target_arch='ARCH_IA64 = yes'
1885 iproc='ia64'
1886 proc=''
1887 _march=''
1888 _mcpu=''
1889 _optimizing=''
1892 x86_64|amd64)
1893 _arch='X86 X86_64'
1894 _target_arch='ARCH_X86_64 = yes'
1895 _target_arch_x86="ARCH_X86 = yes"
1896 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1897 iproc='x86_64'
1899 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1900 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1901 cpuopt=-mtune
1902 else
1903 cpuopt=-mcpu
1905 if test "$_runtime_cpudetection" = no ; then
1906 case "$pvendor" in
1907 AuthenticAMD)
1908 proc=k8;;
1909 GenuineIntel)
1910 case "$pfamily" in
1911 6) proc=core2;;
1913 # 64-bit prescotts exist, but as far as GCC is concerned they
1914 # have the same capabilities as a nocona.
1915 proc=nocona
1916 test $_fast_cmov = "auto" && _fast_cmov=no
1918 esac
1921 proc=error;;
1922 esac
1923 fi # test "$_runtime_cpudetection" = no
1925 echocheck "GCC & CPU optimization abilities"
1926 cat > $TMPC << EOF
1927 int main(void) { return 0; }
1929 # This is a stripped-down version of the i386 fallback.
1930 if test "$_runtime_cpudetection" = no ; then
1931 cc_check -march=native && proc=native
1932 # --- AMD processors ---
1933 if test "$proc" = "k8"; then
1934 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1936 # This will fail if gcc version < 3.3, which is ok because earlier
1937 # versions don't really support 64-bit on amd64.
1938 # Is this a valid assumption? -Corey
1939 if test "$proc" = "athlon-xp"; then
1940 cc_check -march=$proc $cpuopt=$proc || proc=error
1942 # --- Intel processors ---
1943 if test "$proc" = "core2"; then
1944 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1946 if test "$proc" = "nocona"; then
1947 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1949 if test "$proc" = "pentium4"; then
1950 cc_check -march=$proc $cpuopt=$proc || proc=error
1953 _march="-march=$proc"
1954 _mcpu="$cpuopt=$proc"
1955 if test "$proc" = "error" ; then
1956 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1957 _mcpu=""
1958 _march=""
1960 else # if test "$_runtime_cpudetection" = no
1961 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1962 _march="-march=x86-64"
1963 _mcpu="$cpuopt=generic"
1964 cc_check $_mcpu || _mcpu="x86-64"
1965 cc_check $_mcpu || _mcpu=""
1966 cc_check $_march $_mcpu || _march=""
1969 _optimizing=""
1971 echores "$proc"
1974 sparc)
1975 _arch='SPARC'
1976 _target_arch='ARCH_SPARC = yes'
1977 iproc='sparc'
1978 if sunos ; then
1979 echocheck "CPU type"
1980 karch=`uname -m`
1981 case "`echo $karch`" in
1982 sun4) proc=v7 ;;
1983 sun4c) proc=v7 ;;
1984 sun4d) proc=v8 ;;
1985 sun4m) proc=v8 ;;
1986 sun4u) proc=ultrasparc _vis='yes' ;;
1987 sun4v) proc=v9 ;;
1988 *) proc=v8 ;;
1989 esac
1990 echores "$proc"
1991 else
1992 proc=v8
1994 _march=''
1995 _mcpu="-mcpu=$proc"
1996 _optimizing="$proc"
1999 sparc64)
2000 _arch='SPARC'
2001 _target_arch='ARCH_SPARC = yes'
2002 _vis='yes'
2003 iproc='sparc'
2004 proc='ultrasparc'
2005 _march=''
2006 _mcpu="-mcpu=$proc"
2007 _optimizing="$proc"
2010 arm|armv4l|armv5tel)
2011 _arch='ARM ARMV4L'
2012 _target_arch='ARCH_ARMV4L = yes'
2013 iproc='arm'
2014 proc=''
2015 _march=''
2016 _mcpu=''
2017 _optimizing=''
2020 sh3)
2021 _arch='SH3'
2022 _target_arch='ARCH_SH3 = yes'
2023 iproc='sh3'
2024 proc=''
2025 _march='-m3'
2026 _mcpu='-ml'
2027 _optimizing=''
2030 ppc|powerpc)
2031 _arch='POWERPC PPC'
2032 _def_dcbzl='#undef HAVE_DCBZL'
2033 _target_arch='ARCH_POWERPC = yes'
2034 iproc='ppc'
2035 proc=''
2036 _march=''
2037 _mcpu=''
2038 _optimizing=''
2040 echocheck "CPU type"
2041 case $system_name in
2042 Linux)
2043 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2044 if test -n "`$_cpuinfo | grep altivec`"; then
2045 test $_altivec = auto && _altivec=yes
2048 Darwin)
2049 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2050 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2051 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2052 test $_altivec = auto && _altivec=yes
2055 NetBSD)
2056 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2057 case $cc_version in
2058 2*|3.0*|3.1*|3.2*|3.3*)
2061 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2062 test $_altivec = auto && _altivec=yes
2065 esac
2067 AIX)
2068 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2070 esac
2071 if test "$_altivec" = yes; then
2072 echores "$proc altivec"
2073 else
2074 _altivec=no
2075 echores "$proc"
2078 echocheck "GCC & CPU optimization abilities"
2080 if test -n "$proc"; then
2081 case "$proc" in
2082 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2083 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2084 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2085 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2086 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2087 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2088 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2089 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2090 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2091 *) ;;
2092 esac
2093 # gcc 3.1(.1) and up supports 7400 and 7450
2094 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2095 case "$proc" in
2096 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2097 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2098 *) ;;
2099 esac
2101 # gcc 3.2 and up supports 970
2102 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2103 case "$proc" in
2104 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2105 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2106 *) ;;
2107 esac
2109 # gcc 3.3 and up supports POWER4
2110 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2111 case "$proc" in
2112 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2113 *) ;;
2114 esac
2116 # gcc 3.4 and up supports 440*
2117 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2118 case "$proc" in
2119 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2120 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2121 *) ;;
2122 esac
2124 # gcc 4.0 and up supports POWER5
2125 if test "$_cc_major" -ge "4"; then
2126 case "$proc" in
2127 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2128 *) ;;
2129 esac
2133 if test -n "$_mcpu"; then
2134 _optimizing=`echo $_mcpu | cut -c 8-`
2135 echores "$_optimizing"
2136 else
2137 echores "none"
2142 alpha)
2143 _arch='ALPHA'
2144 _target_arch='ARCH_ALPHA = yes'
2145 iproc='alpha'
2146 _march=''
2148 echocheck "CPU type"
2149 cat > $TMPC << EOF
2150 int main(void) {
2151 unsigned long ver, mask;
2152 asm ("implver %0" : "=r" (ver));
2153 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2154 printf("%ld-%x\n", ver, ~mask);
2155 return 0;
2158 $_cc -o "$TMPEXE" "$TMPC"
2159 case `"$TMPEXE"` in
2161 0-0) proc="ev4"; _mvi="0";;
2162 1-0) proc="ev5"; _mvi="0";;
2163 1-1) proc="ev56"; _mvi="0";;
2164 1-101) proc="pca56"; _mvi="1";;
2165 2-303) proc="ev6"; _mvi="1";;
2166 2-307) proc="ev67"; _mvi="1";;
2167 2-1307) proc="ev68"; _mvi="1";;
2168 esac
2169 echores "$proc"
2171 echocheck "GCC & CPU optimization abilities"
2172 if test "$proc" = "ev68" ; then
2173 cc_check -mcpu=$proc || proc=ev67
2175 if test "$proc" = "ev67" ; then
2176 cc_check -mcpu=$proc || proc=ev6
2178 _mcpu="-mcpu=$proc"
2179 echores "$proc"
2181 _optimizing="$proc"
2184 mips)
2185 _arch='SGI_MIPS'
2186 _target_arch='ARCH_SGI_MIPS = yes'
2187 iproc='sgi-mips'
2188 proc=''
2189 _march=''
2190 _mcpu=''
2191 _optimizing=''
2193 if irix ; then
2194 echocheck "CPU type"
2195 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2196 case "`echo $proc`" in
2197 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2198 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2199 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2200 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2201 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2202 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2203 esac
2204 # gcc < 3.x does not support -mtune.
2205 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2206 _mcpu=''
2208 echores "$proc"
2213 hppa)
2214 _arch='PA_RISC'
2215 _target_arch='ARCH_PA_RISC = yes'
2216 iproc='PA-RISC'
2217 proc=''
2218 _march=''
2219 _mcpu=''
2220 _optimizing=''
2223 s390)
2224 _arch='S390'
2225 _target_arch='ARCH_S390 = yes'
2226 iproc='390'
2227 proc=''
2228 _march=''
2229 _mcpu=''
2230 _optimizing=''
2233 s390x)
2234 _arch='S390X'
2235 _target_arch='ARCH_S390X = yes'
2236 iproc='390x'
2237 proc=''
2238 _march=''
2239 _mcpu=''
2240 _optimizing=''
2243 vax)
2244 _arch='VAX'
2245 _target_arch='ARCH_VAX = yes'
2246 iproc='vax'
2247 proc=''
2248 _march=''
2249 _mcpu=''
2250 _optimizing=''
2253 xtensa)
2254 _arch='XTENSA'
2255 _target_arch='ARCH_XTENSA = yes'
2256 iproc='xtensa'
2257 proc=''
2258 _march=''
2259 _mcpu=''
2260 _optimizing=''
2263 generic)
2264 _arch='GENERIC'
2265 _target_arch='ARCH_GENERIC = yes'
2266 iproc=''
2267 proc=''
2268 _march=''
2269 _mcpu=''
2270 _optimizing=''
2274 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2275 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2276 die "unsupported architecture $host_arch"
2278 esac # case "$host_arch" in
2280 if test "$_runtime_cpudetection" = yes ; then
2281 if x86 ; then
2282 test "$_cmov" != no && _cmov=yes
2283 x86_32 && _cmov=no
2284 test "$_mmx" != no && _mmx=yes
2285 test "$_3dnow" != no && _3dnow=yes
2286 test "$_3dnowext" != no && _3dnowext=yes
2287 test "$_mmxext" != no && _mmxext=yes
2288 test "$_sse" != no && _sse=yes
2289 test "$_sse2" != no && _sse2=yes
2290 test "$_ssse3" != no && _ssse3=yes
2291 test "$_mtrr" != no && _mtrr=yes
2293 if ppc; then
2294 _altivec=yes
2300 echocheck "assembler support of -pipe option"
2301 cat > $TMPC << EOF
2302 int main(void) { return 0; }
2304 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2307 echocheck "compiler support of named assembler arguments"
2308 _named_asm_args=yes
2309 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2310 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2311 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2312 _named_asm_args=no
2313 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2315 echores $_named_asm_args
2318 if darwin && test "$cc_vendor" = "gnu" ; then
2319 echocheck "GCC support of -mstackrealign"
2320 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2321 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2322 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2323 # wrong code with this flag, but this can be worked around by adding
2324 # -fno-unit-at-a-time as described in the blog post at
2325 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2326 cat > $TMPC << EOF
2327 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2328 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2330 cc_check -O4 -mstackrealign && tmp_run && _stackrealign=-mstackrealign
2331 test -z "$_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2332 && tmp_run && _stackrealign="-mstackrealign -fno-unit-at-a-time"
2333 test -n "$_stackrealign" && echores "yes" || echores "no"
2334 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2337 # Checking for CFLAGS
2338 _install_strip="-s"
2339 if test "$_profile" != "" || test "$_debug" != "" ; then
2340 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2341 _install_strip=
2342 elif test -z "$CFLAGS" ; then
2343 if test "$cc_vendor" = "intel" ; then
2344 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2345 elif test "$cc_vendor" != "gnu" ; then
2346 CFLAGS="-O2 $_march $_mcpu $_pipe"
2347 else
2348 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2350 else
2351 _warn_CFLAGS=yes
2353 if test -n "$LDFLAGS" ; then
2354 _ld_extra="$_ld_extra $LDFLAGS"
2355 _warn_CFLAGS=yes
2356 elif test "$cc_vendor" = "intel" ; then
2357 _ld_extra="$_ld_extra -i-static"
2359 if test -n "$CPPFLAGS" ; then
2360 _inc_extra="$_inc_extra $CPPFLAGS"
2361 _warn_CFLAGS=yes
2366 if x86_32 ; then
2367 # Checking assembler (_as) compatibility...
2368 # Added workaround for older as that reads from stdin by default - atmos
2369 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2370 echocheck "assembler ($_as $as_version)"
2372 _pref_as_version='2.9.1'
2373 echo 'nop' > $TMPS
2374 if test "$_mmx" = yes ; then
2375 echo 'emms' >> $TMPS
2377 if test "$_3dnow" = yes ; then
2378 _pref_as_version='2.10.1'
2379 echo 'femms' >> $TMPS
2381 if test "$_3dnowext" = yes ; then
2382 _pref_as_version='2.10.1'
2383 echo 'pswapd %mm0, %mm0' >> $TMPS
2385 if test "$_mmxext" = yes ; then
2386 _pref_as_version='2.10.1'
2387 echo 'movntq %mm0, (%eax)' >> $TMPS
2389 if test "$_sse" = yes ; then
2390 _pref_as_version='2.10.1'
2391 echo 'xorps %xmm0, %xmm0' >> $TMPS
2393 #if test "$_sse2" = yes ; then
2394 # _pref_as_version='2.11'
2395 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2397 if test "$_cmov" = yes ; then
2398 _pref_as_version='2.10.1'
2399 echo 'cmovb %eax, %ebx' >> $TMPS
2401 if test "$_ssse3" = yes ; then
2402 _pref_as_version='2.16.92'
2403 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2405 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2407 if test "$as_verc_fail" != yes ; then
2408 echores "ok"
2409 else
2410 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2411 echores "failed"
2412 die "obsolete binutils version"
2415 fi #if x86_32
2417 echocheck ".align is a power of two"
2418 if test "$_asmalign_pot" = auto ; then
2419 _asmalign_pot=no
2420 cat > $TMPC << EOF
2421 main(void) { asm (".align 3"); }
2423 cc_check && _asmalign_pot=yes
2425 if test "$_asmalign_pot" = "yes" ; then
2426 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2427 else
2428 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2430 echores $_asmalign_pot
2433 #FIXME: This should happen before the check for CFLAGS..
2434 if ppc ; then
2436 # check if altivec is supported by the compiler, and how to enable it
2438 _altivec_gcc_flags=''
2440 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2441 echocheck "GCC altivec support"
2443 p=''
2444 cat > $TMPC << EOF
2445 int main(void) {
2446 return 0;
2449 FSF_flags='-maltivec -mabi=altivec'
2450 Darwin_flags='-faltivec'
2452 # check for Darwin-style flags first, since
2453 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2454 # accepts but ignores FSF-style flags...
2456 if test -z "$p"; then
2457 cc_check $Darwin_flags && p='Darwin'
2459 if test -z "$p"; then
2460 cc_check $FSF_flags && p='FSF'
2463 case $p in
2464 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2465 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2466 *) _altivec=no ;;
2467 esac
2469 if test -z "$p"; then
2470 p=none
2471 else
2472 p="$p-style ($_altivec_gcc_flags)"
2475 echores "$p"
2478 # check if <altivec.h> should be included
2480 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2482 if test "$_altivec" = yes ; then
2483 echocheck "altivec.h"
2484 cat > $TMPC << EOF
2485 #include <altivec.h>
2486 int main(void) { return 0; }
2488 _have_altivec_h=no
2489 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2490 if test "$_have_altivec_h" = yes ; then
2491 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2493 echores "$_have_altivec_h"
2496 # disable runtime cpudetection if
2497 # - we cannot generate altivec code
2498 # - altivec is disabled by the user
2500 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2501 _runtime_cpudetection=no
2504 # show that we are optimizing for altivec (if enabled and supported)
2506 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2507 _optimizing="$_optimizing altivec"
2510 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2512 if test "$_altivec" = yes ; then
2513 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2514 #_mcpu="$_mcpu $_altivec_gcc_flags"
2515 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2519 if arm ; then
2520 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2521 if test $_armv5te = "auto" ; then
2522 cat > $TMPC << EOF
2523 int main(void) {
2524 __asm__ __volatile__ ("qadd r0, r0, r0");
2527 _armv5te=no
2528 cc_check && _armv5te=yes
2530 echores "$_armv5te"
2532 echocheck "ARMv6 (SIMD instructions)"
2533 if test $_armv6 = "auto" ; then
2534 cat > $TMPC << EOF
2535 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2537 _armv6=no
2538 cc_check && _armv6=yes
2540 echores "$_armv6"
2542 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2543 if test $_iwmmxt = "auto" ; then
2544 cat > $TMPC << EOF
2545 int main(void) {
2546 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2549 _iwmmxt=no
2550 cc_check && _iwmmxt=yes
2552 echores "$_iwmmxt"
2555 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
2556 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2557 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2558 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2559 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2560 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2561 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2562 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2563 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2564 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2565 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2566 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2567 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2568 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2569 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2570 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2572 # Checking kernel version...
2573 if x86_32 && linux ; then
2574 _k_verc_problem=no
2575 kernel_version=`uname -r 2>&1`
2576 echocheck "$system_name kernel version"
2577 case "$kernel_version" in
2578 '') kernel_version="?.??"; _k_verc_fail=yes;;
2579 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2580 _k_verc_problem=yes;;
2581 esac
2582 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2583 _k_verc_fail=yes
2585 if test "$_k_verc_fail" ; then
2586 echores "$kernel_version, fail"
2587 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2588 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2589 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2590 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2591 echo "2.2.x you must upgrade it to get SSE support!"
2592 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2593 else
2594 echores "$kernel_version, ok"
2598 ######################
2599 # MAIN TESTS GO HERE #
2600 ######################
2603 echocheck "-lposix"
2604 cat > $TMPC <<EOF
2605 int main(void) { return 0; }
2607 if cc_check -lposix ; then
2608 _ld_extra="$_ld_extra -lposix"
2609 echores "yes"
2610 else
2611 echores "no"
2614 echocheck "-lm"
2615 cat > $TMPC <<EOF
2616 int main(void) { return 0; }
2618 if cc_check -lm ; then
2619 _ld_lm="-lm"
2620 echores "yes"
2621 else
2622 _ld_lm=""
2623 echores "no"
2627 echocheck "langinfo"
2628 if test "$_langinfo" = auto ; then
2629 cat > $TMPC <<EOF
2630 #include <langinfo.h>
2631 int main(void) { nl_langinfo(CODESET); return 0; }
2633 _langinfo=no
2634 cc_check && _langinfo=yes
2636 if test "$_langinfo" = yes ; then
2637 _def_langinfo='#define USE_LANGINFO 1'
2638 else
2639 _def_langinfo='#undef USE_LANGINFO'
2641 echores "$_langinfo"
2644 echocheck "language"
2645 test -z "$_language" && _language=$LINGUAS
2646 _language=`echo $_language | sed 's/,/ /g'`
2647 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2648 for lang in $_language ; do
2649 test "$lang" = all && lang=en
2650 if test -f "help/help_mp-${lang}.h" ; then
2651 _language=$lang
2652 break
2653 else
2654 echo ${_echo_n} "$lang not found, ${_echo_c}"
2655 _language=`echo $_language | sed "s/$lang *//"`
2657 done
2658 test -z "$_language" && _language=en
2659 _mp_help="help/help_mp-${_language}.h"
2660 test -f $_mp_help || die "$_mp_help not found"
2661 for lang in $LANGUAGES ; do
2662 if test -f "DOCS/man/$lang/mplayer.1" ; then
2663 MAN_LANG="$lang $MAN_LANG"
2665 done
2666 _doc_lang=$_language
2667 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2668 echores "using $_language (man pages: $MAN_LANG)"
2671 echocheck "enable sighandler"
2672 if test "$_sighandler" = yes ; then
2673 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2674 else
2675 _def_sighandler='#undef ENABLE_SIGHANDLER'
2677 echores "$_sighandler"
2679 echocheck "runtime cpudetection"
2680 if test "$_runtime_cpudetection" = yes ; then
2681 _optimizing="Runtime CPU-Detection enabled"
2682 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2683 else
2684 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2686 echores "$_runtime_cpudetection"
2689 echocheck "restrict keyword"
2690 for restrict_keyword in restrict __restrict __restrict__ ; do
2691 echo "void foo(char * $restrict_keyword p); int main(void){}" > $TMPC
2692 if cc_check; then
2693 _def_restrict_keyword=$restrict_keyword
2694 break;
2696 done
2697 if [ -n "$_def_restrict_keyword" ]; then
2698 echores "$_def_restrict_keyword"
2699 else
2700 echores "none"
2702 # Avoid infinite recursion loop ("#define restrict restrict")
2703 if [ "$_def_restrict_keyword" != "restrict" ]; then
2704 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2705 else
2706 _def_restrict_keyword=""
2710 echocheck "__builtin_expect"
2711 # GCC branch prediction hint
2712 cat > $TMPC << EOF
2713 int foo (int a) {
2714 a = __builtin_expect (a, 10);
2715 return a == 10 ? 0 : 1;
2717 int main(void) { return foo(10) && foo(0); }
2719 _builtin_expect=no
2720 cc_check && _builtin_expect=yes
2721 if test "$_builtin_expect" = yes ; then
2722 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2723 else
2724 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2726 echores "$_builtin_expect"
2729 echocheck "kstat"
2730 cat > $TMPC << EOF
2731 #include <kstat.h>
2732 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2734 _kstat=no
2735 cc_check -lkstat && _kstat=yes
2736 if test "$_kstat" = yes ; then
2737 _def_kstat="#define HAVE_LIBKSTAT 1"
2738 _ld_extra="$_ld_extra -lkstat"
2739 else
2740 _def_kstat="#undef HAVE_LIBKSTAT"
2742 echores "$_kstat"
2745 echocheck "posix4"
2746 # required for nanosleep on some systems
2747 cat > $TMPC << EOF
2748 #include <time.h>
2749 int main(void) { (void) nanosleep(0, 0); return 0; }
2751 _posix4=no
2752 cc_check -lposix4 && _posix4=yes
2753 if test "$_posix4" = yes ; then
2754 _ld_extra="$_ld_extra -lposix4"
2756 echores "$_posix4"
2758 for func in llrint lrint lrintf round roundf; do
2759 echocheck $func
2760 cat > $TMPC << EOF
2761 #include <math.h>
2762 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
2764 eval _$func=no
2765 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2766 if eval test "x\$_$func" = "xyes"; then
2767 eval _def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 1\""
2768 echores yes
2769 else
2770 eval _def_$func="\"#undef HAVE_`echo $func | tr '[a-z]' '[A-Z]'`\""
2771 echores no
2773 done
2776 echocheck "mkstemp"
2777 cat > $TMPC << EOF
2778 #include <stdlib.h>
2779 int main(void) { char a; mkstemp(&a); return 0; }
2781 _mkstemp=no
2782 cc_check && _mkstemp=yes
2783 if test "$_mkstemp" = yes ; then
2784 _def_mkstemp='#define HAVE_MKSTEMP 1'
2785 else
2786 _def_mkstemp='#undef HAVE_MKSTEMP'
2788 echores "$_mkstemp"
2791 echocheck "nanosleep"
2792 # also check for nanosleep
2793 cat > $TMPC << EOF
2794 #include <time.h>
2795 int main(void) { (void) nanosleep(0, 0); return 0; }
2797 _nanosleep=no
2798 cc_check && _nanosleep=yes
2799 if test "$_nanosleep" = yes ; then
2800 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2801 else
2802 _def_nanosleep='#undef HAVE_NANOSLEEP'
2804 echores "$_nanosleep"
2807 echocheck "socklib"
2808 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2809 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2810 cat > $TMPC << EOF
2811 #include <netdb.h>
2812 #include <sys/socket.h>
2813 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2815 _socklib=no
2816 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2817 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2818 done
2819 if test $_winsock2 = auto && ! cygwin ; then
2820 _winsock2=no
2821 cat > $TMPC << EOF
2822 #include <winsock2.h>
2823 int main(void) { (void) gethostbyname(0); return 0; }
2825 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2827 test "$_ld_sock" && _res_comment="using $_ld_sock"
2828 echores "$_socklib"
2831 if test $_winsock2 = yes ; then
2832 _ld_sock="-lws2_32"
2833 _def_winsock2='#define HAVE_WINSOCK2 1'
2834 else
2835 _def_winsock2='#undef HAVE_WINSOCK2'
2839 _use_aton=no
2840 echocheck "inet_pton()"
2841 cat > $TMPC << EOF
2842 #include <sys/types.h>
2843 #include <sys/socket.h>
2844 #include <arpa/inet.h>
2845 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2847 if test "$_winsock2" = yes ; then
2848 _res_comment="using winsock2 functions instead"
2849 echores "no"
2850 elif cc_check $_ld_sock ; then
2851 # NOTE: Linux has libresolv but does not need it
2853 _res_comment="using $_ld_sock"
2854 echores "yes"
2855 elif cc_check $_ld_sock -lresolv ; then
2856 # NOTE: needed for SunOS at least
2857 _ld_sock="$_ld_sock -lresolv"
2858 _res_comment="using $_ld_sock"
2859 echores "yes"
2860 else
2861 _res_comment="trying inet_aton next"
2862 echores "no"
2864 echocheck "inet_aton()"
2865 cat > $TMPC << EOF
2866 #include <sys/types.h>
2867 #include <sys/socket.h>
2868 #include <arpa/inet.h>
2869 int main(void) { (void) inet_aton(0, 0); return 0; }
2871 _use_aton=yes
2872 if cc_check $_ld_sock ; then
2873 # NOTE: Linux has libresolv but does not need it
2875 _res_comment="using $_ld_sock"
2876 elif cc_check $_ld_sock -lresolv ; then
2877 # NOTE: needed for SunOS at least
2878 _ld_sock="$_ld_sock -lresolv"
2879 _res_comment="using $_ld_sock"
2880 else
2881 _use_aton=no
2882 _network=no
2883 _res_comment="network support disabled"
2885 echores "$_use_aton"
2888 _def_use_aton='#undef USE_ATON'
2889 if test "$_use_aton" = yes; then
2890 _def_use_aton='#define USE_ATON 1'
2893 echocheck "network"
2894 # FIXME network check
2895 if test "$_network" = yes ; then
2896 _def_network='#define MPLAYER_NETWORK 1'
2897 _ld_extra="$_ld_extra $_ld_sock"
2898 _inputmodules="network $_inputmodules"
2899 else
2900 _noinputmodules="network $_noinputmodules"
2901 _def_network='#undef MPLAYER_NETWORK'
2902 _ftp=no
2904 echores "$_network"
2906 echocheck "inttypes.h (required)"
2907 cat > $TMPC << EOF
2908 #include <inttypes.h>
2909 int main(void) { return 0; }
2911 _inttypes=no
2912 cc_check && _inttypes=yes
2913 echores "$_inttypes"
2915 if test "$_inttypes" = no ; then
2916 echocheck "bitypes.h (inttypes.h predecessor)"
2917 cat > $TMPC << EOF
2918 #include <sys/bitypes.h>
2919 int main(void) { return 0; }
2921 cc_check && _inttypes=yes
2922 if test "$_inttypes" = yes ; then
2923 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."
2924 else
2925 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2930 echocheck "int_fastXY_t in inttypes.h"
2931 cat > $TMPC << EOF
2932 #include <inttypes.h>
2933 int main(void) {
2934 volatile int_fast16_t v= 0;
2935 return v; }
2937 _fast_inttypes=no
2938 cc_check && _fast_inttypes=yes
2939 if test "$_fast_inttypes" = no ; then
2940 _def_fast_inttypes='
2941 typedef signed char int_fast8_t;
2942 typedef signed int int_fast16_t;
2943 typedef signed int int_fast32_t;
2944 typedef signed long long int_fast64_t;
2945 typedef unsigned char uint_fast8_t;
2946 typedef unsigned int uint_fast16_t;
2947 typedef unsigned int uint_fast32_t;
2948 typedef unsigned long long uint_fast64_t;'
2950 echores "$_fast_inttypes"
2953 echocheck "word size"
2954 _mp_wordsize="#undef MP_WORDSIZE"
2955 cat > $TMPC << EOF
2956 #include <stdio.h>
2957 #include <sys/types.h>
2958 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2960 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2961 echores "$_wordsize"
2964 echocheck "malloc.h"
2965 cat > $TMPC << EOF
2966 #include <malloc.h>
2967 int main(void) { (void) malloc(0); return 0; }
2969 _malloc=no
2970 cc_check && _malloc=yes
2971 if test "$_malloc" = yes ; then
2972 _def_malloc='#define HAVE_MALLOC_H 1'
2973 else
2974 _def_malloc='#undef HAVE_MALLOC_H'
2976 # malloc.h emits a warning in FreeBSD and OpenBSD
2977 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2978 echores "$_malloc"
2981 echocheck "memalign()"
2982 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2983 cat > $TMPC << EOF
2984 #include <malloc.h>
2985 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2987 _memalign=no
2988 cc_check && _memalign=yes
2989 if test "$_memalign" = yes ; then
2990 _def_memalign='#define HAVE_MEMALIGN 1'
2991 else
2992 _def_memalign='#undef HAVE_MEMALIGN'
2993 _def_map_memalign='#define memalign(a,b) malloc(b)'
2994 darwin || _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2996 echores "$_memalign"
2999 echocheck "alloca.h"
3000 cat > $TMPC << EOF
3001 #include <alloca.h>
3002 int main(void) { (void) alloca(0); return 0; }
3004 _alloca=no
3005 cc_check && _alloca=yes
3006 if cc_check ; then
3007 _def_alloca='#define HAVE_ALLOCA_H 1'
3008 else
3009 _def_alloca='#undef HAVE_ALLOCA_H'
3011 echores "$_alloca"
3014 echocheck "byteswap.h"
3015 cat > $TMPC << EOF
3016 #include <byteswap.h>
3017 int main(void) { bswap_16(0); return 0; }
3019 _byteswap_h=no
3020 cc_check && _byteswap_h=yes
3021 if cc_check ; then
3022 _def_byteswap_h='#define HAVE_BYTESWAP_H 1'
3023 else
3024 _def_byteswap_h='#undef HAVE_BYTESWAP_H'
3026 echores "$_byteswap_h"
3029 echocheck "mman.h"
3030 cat > $TMPC << EOF
3031 #include <sys/types.h>
3032 #include <sys/mman.h>
3033 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3035 _mman=no
3036 cc_check && _mman=yes
3037 if test "$_mman" = yes ; then
3038 _def_mman='#define HAVE_SYS_MMAN_H 1'
3039 else
3040 _def_mman='#undef HAVE_SYS_MMAN_H'
3042 echores "$_mman"
3044 cat > $TMPC << EOF
3045 #include <sys/types.h>
3046 #include <sys/mman.h>
3047 int main(void) { void *p = MAP_FAILED; return 0; }
3049 _mman_has_map_failed=no
3050 cc_check && _mman_has_map_failed=yes
3051 if test "$_mman_has_map_failed" = yes ; then
3052 _def_mman_has_map_failed=''
3053 else
3054 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3057 echocheck "dynamic loader"
3058 cat > $TMPC << EOF
3059 #include <dlfcn.h>
3060 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3062 _dl=no
3063 for _ld_tmp in "" "-ldl" ; do
3064 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3065 done
3066 if test "$_dl" = yes ; then
3067 _def_dl='#define HAVE_LIBDL 1'
3068 else
3069 _def_dl='#undef HAVE_LIBDL'
3071 echores "$_dl"
3074 echocheck "dynamic a/v plugins support"
3075 if test "$_dl" = no ; then
3076 _dynamic_plugins=no
3078 if test "$_dynamic_plugins" = yes ; then
3079 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3080 else
3081 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3083 echores "$_dynamic_plugins"
3086 _def_threads='#undef HAVE_THREADS'
3088 echocheck "pthread"
3089 if test "$_pthreads" = auto ; then
3090 cat > $TMPC << EOF
3091 #include <pthread.h>
3092 void* func(void *arg) { return arg; }
3093 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3095 _pthreads=no
3096 if ! hpux ; then
3097 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3098 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3099 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3100 done
3103 if test "$_pthreads" = yes ; then
3104 _res_comment="using $_ld_pthread"
3105 _def_pthreads='#define HAVE_PTHREADS 1'
3106 _def_threads='#define HAVE_THREADS 1'
3107 else
3108 _res_comment="v4l, v4l2, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3109 _def_pthreads='#undef HAVE_PTHREADS'
3110 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no ; _macosx=no
3111 mingw32 || _win32dll=no
3113 echores "$_pthreads"
3115 echocheck "w32threads"
3116 if test "$_pthreads" = yes ; then
3117 _res_comment="using pthread instead"
3118 _w32threads=no
3120 if test "$_w32threads" = auto ; then
3121 _w32threads=no
3122 mingw32 && _w32threads=yes
3124 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3125 echores "$_w32threads"
3127 echocheck "rpath"
3128 netbsd &&_rpath=yes
3129 if test "$_rpath" = yes ; then
3130 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3131 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3132 done
3133 _ld_extra=$tmp
3135 echores "$_rpath"
3137 echocheck "iconv"
3138 if test "$_iconv" = auto ; then
3139 cat > $TMPC << EOF
3140 #include <stdio.h>
3141 #include <unistd.h>
3142 #include <iconv.h>
3143 #define INBUFSIZE 1024
3144 #define OUTBUFSIZE 4096
3146 char inbuffer[INBUFSIZE];
3147 char outbuffer[OUTBUFSIZE];
3149 int main(void) {
3150 size_t numread;
3151 iconv_t icdsc;
3152 char *tocode="UTF-8";
3153 char *fromcode="cp1250";
3154 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3155 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3156 char *iptr=inbuffer;
3157 char *optr=outbuffer;
3158 size_t inleft=numread;
3159 size_t outleft=OUTBUFSIZE;
3160 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3161 != (size_t)(-1)) {
3162 write (1, outbuffer, OUTBUFSIZE - outleft);
3165 if (iconv_close(icdsc) == -1)
3170 _iconv=no
3171 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3172 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3173 _iconv=yes && break
3174 done
3176 if test "$_iconv" = yes ; then
3177 _def_iconv='#define USE_ICONV 1'
3178 else
3179 _def_iconv='#undef USE_ICONV'
3181 echores "$_iconv"
3184 echocheck "soundcard.h"
3185 _soundcard_h=no
3186 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3187 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3188 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3189 cat > $TMPC << EOF
3190 #include <$_soundcard_header>
3191 int main(void) { return 0; }
3193 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3194 done
3196 if test "$_soundcard_h" = yes ; then
3197 if test $_soundcard_header = "sys/soundcard.h"; then
3198 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3199 else
3200 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3203 echores "$_soundcard_h"
3206 echocheck "sys/dvdio.h"
3207 cat > $TMPC << EOF
3208 #include <unistd.h>
3209 #include <sys/dvdio.h>
3210 int main(void) { return 0; }
3212 _dvdio=no
3213 cc_check && _dvdio=yes
3214 if test "$_dvdio" = yes ; then
3215 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3216 else
3217 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3219 echores "$_dvdio"
3222 echocheck "sys/cdio.h"
3223 cat > $TMPC << EOF
3224 #include <unistd.h>
3225 #include <sys/cdio.h>
3226 int main(void) { return 0; }
3228 _cdio=no
3229 cc_check && _cdio=yes
3230 if test "$_cdio" = yes ; then
3231 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3232 else
3233 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3235 echores "$_cdio"
3238 echocheck "linux/cdrom.h"
3239 cat > $TMPC << EOF
3240 #include <sys/types.h>
3241 #include <linux/cdrom.h>
3242 int main(void) { return 0; }
3244 _cdrom=no
3245 cc_check && _cdrom=yes
3246 if test "$_cdrom" = yes ; then
3247 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3248 else
3249 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3251 echores "$_cdrom"
3254 echocheck "dvd.h"
3255 cat > $TMPC << EOF
3256 #include <dvd.h>
3257 int main(void) { return 0; }
3259 _dvd=no
3260 cc_check && _dvd=yes
3261 if test "$_dvd" = yes ; then
3262 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3263 else
3264 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3266 echores "$_dvd"
3269 if bsdos; then
3270 echocheck "BSDI dvd.h"
3271 cat > $TMPC << EOF
3272 #include <dvd.h>
3273 int main(void) { return 0; }
3275 _bsdi_dvd=no
3276 cc_check && _bsdi_dvd=yes
3277 if test "$_bsdi_dvd" = yes ; then
3278 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3279 else
3280 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3282 echores "$_bsdi_dvd"
3283 fi #if bsdos
3286 if hpux; then
3287 # also used by AIX, but AIX does not support VCD and/or libdvdread
3288 echocheck "HP-UX SCSI header"
3289 cat > $TMPC << EOF
3290 #include <sys/scsi.h>
3291 int main(void) { return 0; }
3293 _hpux_scsi_h=no
3294 cc_check && _hpux_scsi_h=yes
3295 if test "$_hpux_scsi_h" = yes ; then
3296 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3297 else
3298 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3300 echores "$_hpux_scsi_h"
3301 fi #if hpux
3304 if sunos; then
3305 echocheck "userspace SCSI headers (Solaris)"
3306 cat > $TMPC << EOF
3307 # include <unistd.h>
3308 # include <stropts.h>
3309 # include <sys/scsi/scsi_types.h>
3310 # include <sys/scsi/impl/uscsi.h>
3311 int main(void) { return 0; }
3313 _sol_scsi_h=no
3314 cc_check && _sol_scsi_h=yes
3315 if test "$_sol_scsi_h" = yes ; then
3316 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3317 else
3318 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3320 echores "$_sol_scsi_h"
3321 fi #if sunos
3324 echocheck "termcap"
3325 if test "$_termcap" = auto ; then
3326 cat > $TMPC <<EOF
3327 int main(void) { tgetent(); return 0; }
3329 _termcap=no
3330 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3331 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3332 && _termcap=yes && break
3333 done
3335 if test "$_termcap" = yes ; then
3336 _def_termcap='#define USE_TERMCAP 1'
3337 _res_comment="using $_ld_tmp"
3338 else
3339 _def_termcap='#undef USE_TERMCAP'
3341 echores "$_termcap"
3344 echocheck "termios"
3345 _def_termios='#undef HAVE_TERMIOS'
3346 _def_termios_h='#undef HAVE_TERMIOS_H'
3347 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3348 if test "$_termios" = auto ; then
3349 _termios=no
3350 for _termios_header in "sys/termios.h" "termios.h"; do
3351 cat > $TMPC <<EOF
3352 #include <$_termios_header>
3353 int main(void) { return 0; }
3355 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3356 done
3359 if test "$_termios" = yes ; then
3360 _def_termios='#define HAVE_TERMIOS 1'
3361 if test "$_termios_header" = "termios.h" ; then
3362 _def_termios_h='#define HAVE_TERMIOS_H 1'
3363 else
3364 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3367 echores "$_termios"
3370 echocheck "shm"
3371 if test "$_shm" = auto ; then
3372 cat > $TMPC << EOF
3373 #include <sys/types.h>
3374 #include <sys/shm.h>
3375 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3377 _shm=no
3378 cc_check && _shm=yes
3380 if test "$_shm" = yes ; then
3381 _def_shm='#define HAVE_SHM 1'
3382 else
3383 _def_shm='#undef HAVE_SHM'
3385 echores "$_shm"
3388 echocheck "strsep()"
3389 cat > $TMPC << EOF
3390 #include <string.h>
3391 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3393 _strsep=no
3394 cc_check && _strsep=yes
3395 if test "$_strsep" = yes ; then
3396 _def_strsep='#define HAVE_STRSEP 1'
3397 _need_strsep=no
3398 else
3399 _def_strsep='#undef HAVE_STRSEP'
3400 _need_strsep=yes
3402 echores "$_strsep"
3405 echocheck "vsscanf()"
3406 cat > $TMPC << EOF
3407 #include <stdarg.h>
3408 int main(void) { vsscanf(0, 0, 0); return 0; }
3410 _vsscanf=no
3411 cc_check && _vsscanf=yes
3412 if test "$_vsscanf" = yes ; then
3413 _def_vsscanf='#define HAVE_VSSCANF 1'
3414 _need_vsscanf=no
3415 else
3416 _def_vsscanf='#undef HAVE_VSSCANF'
3417 _need_vsscanf=yes
3419 echores "$_vsscanf"
3422 echocheck "swab()"
3423 cat > $TMPC << EOF
3424 #include <unistd.h>
3425 int main(void) { swab(0, 0, 0); return 0; }
3427 _swab=no
3428 cc_check && _swab=yes
3429 if test "$_swab" = yes ; then
3430 _def_swab='#define HAVE_SWAB 1'
3431 _need_swab=no
3432 else
3433 _def_swab='#undef HAVE_SWAB'
3434 _need_swab=yes
3436 echores "$_swab"
3438 echocheck "POSIX select()"
3439 cat > $TMPC << EOF
3440 #include <stdio.h>
3441 #include <stdlib.h>
3442 #include <sys/types.h>
3443 #include <string.h>
3444 #include <sys/time.h>
3445 #include <unistd.h>
3446 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3448 _posix_select=no
3449 _def_posix_select='#undef HAVE_POSIX_SELECT'
3450 #select() of kLIBC (OS/2) supports socket only
3451 ! os2 && cc_check && _posix_select=yes \
3452 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3453 echores "$_posix_select"
3456 echocheck "gettimeofday()"
3457 cat > $TMPC << EOF
3458 #include <stdio.h>
3459 #include <sys/time.h>
3460 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3462 _gettimeofday=no
3463 cc_check && _gettimeofday=yes
3464 if test "$_gettimeofday" = yes ; then
3465 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3466 _need_gettimeofday=no
3467 else
3468 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3469 _need_gettimeofday=yes
3471 echores "$_gettimeofday"
3474 echocheck "glob()"
3475 cat > $TMPC << EOF
3476 #include <stdio.h>
3477 #include <glob.h>
3478 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3480 _glob=no
3481 cc_check && _glob=yes
3482 if test "$_glob" = yes ; then
3483 _def_glob='#define HAVE_GLOB 1'
3484 _need_glob=no
3485 else
3486 _def_glob='#undef HAVE_GLOB'
3487 _need_glob=yes
3489 echores "$_glob"
3492 echocheck "setenv()"
3493 cat > $TMPC << EOF
3494 #include <stdlib.h>
3495 int main (void){ setenv("","",0); return 0; }
3497 _setenv=no
3498 cc_check && _setenv=yes
3499 if test "$_setenv" = yes ; then
3500 _def_setenv='#define HAVE_SETENV 1'
3501 _need_setenv=no
3502 else
3503 _def_setenv='#undef HAVE_SETENV'
3504 _need_setenv=yes
3506 echores "$_setenv"
3509 if sunos; then
3510 echocheck "sysi86()"
3511 cat > $TMPC << EOF
3512 #include <sys/sysi86.h>
3513 int main (void) { sysi86(0); return 0; }
3515 _sysi86=no
3516 cc_check && _sysi86=yes
3517 if test "$_sysi86" = yes ; then
3518 _def_sysi86='#define HAVE_SYSI86 1'
3519 cat > $TMPC << EOF
3520 #include <sys/sysi86.h>
3521 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3523 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3524 else
3525 _def_sysi86='#undef HAVE_SYSI86'
3527 echores "$_sysi86"
3528 fi #if sunos
3531 echocheck "sys/sysinfo.h"
3532 cat > $TMPC << EOF
3533 #include <sys/sysinfo.h>
3534 int main(void) {
3535 struct sysinfo s_info;
3536 sysinfo(&s_info);
3537 return 0;
3540 _sys_sysinfo=no
3541 cc_check && _sys_sysinfo=yes
3542 if test "$_sys_sysinfo" = yes ; then
3543 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3544 else
3545 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3547 echores "$_sys_sysinfo"
3550 if darwin; then
3552 echocheck "Mac OS X APIs"
3553 if test "$_macosx" = auto ; then
3554 productName=`/usr/bin/sw_vers -productName`
3555 if test "$productName" = "Mac OS X" ||
3556 test "$productName" = "Mac OS X Server" ; then
3557 _macosx=yes
3558 else
3559 _macosx=no
3560 _def_macosx='#undef MACOSX'
3561 _noaomodules="macosx $_noaomodules"
3562 _novomodules="quartz $_novomodules"
3565 if test "$_macosx" = yes ; then
3566 cat > $TMPC <<EOF
3567 #include <Carbon/Carbon.h>
3568 #include <QuickTime/QuickTime.h>
3569 #include <CoreAudio/CoreAudio.h>
3570 int main(void) {
3571 EnterMovies();
3572 ExitMovies();
3573 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3576 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3577 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3578 _def_macosx='#define MACOSX 1'
3579 _aosrc="$_aosrc ao_macosx.c"
3580 _aomodules="macosx $_aomodules"
3581 _vosrc="$_vosrc vo_quartz.c"
3582 _vomodules="quartz $_vomodules"
3583 else
3584 _macosx=no
3585 _def_macosx='#undef MACOSX'
3586 _noaomodules="macosx $_noaomodules"
3587 _novomodules="quartz $_novomodules"
3589 cat > $TMPC <<EOF
3590 #include <Carbon/Carbon.h>
3591 #include <QuartzCore/CoreVideo.h>
3592 int main(void) {}
3594 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3595 _vosrc="$_vosrc vo_macosx.m"
3596 _vomodules="macosx $_vomodules"
3597 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3598 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3599 _macosx_corevideo=yes
3600 else
3601 _novomodules="macosx $_novomodules"
3602 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3603 _macosx_corevideo=no
3606 echores "$_macosx"
3608 echocheck "Mac OS X Finder Support"
3609 if test "$_macosx_finder_support" = auto ; then
3610 _macosx_finder_support=$_macosx
3612 if test "$_macosx_finder_support" = yes; then
3613 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3614 _macosx_finder_support=yes
3615 else
3616 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3617 _macosx_finder_support=no
3619 echores "$_macosx_finder_support"
3621 echocheck "Mac OS X Bundle file locations"
3622 if test "$_macosx_bundle" = auto ; then
3623 _macosx_bundle=$_macosx_finder_support
3625 if test "$_macosx_bundle" = yes; then
3626 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3627 else
3628 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3629 _macosx_bundle=no
3631 echores "$_macosx_bundle"
3633 echocheck "Apple Remote"
3634 if test "$_apple_remote" = auto ; then
3635 _apple_remote=no
3636 cat > $TMPC <<EOF
3637 #include <stdio.h>
3638 #include <IOKit/IOCFPlugIn.h>
3639 int main (int argc, const char * argv[])
3641 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3642 CFMutableDictionaryRef hidMatchDictionary;
3643 IOReturn ioReturnValue;
3645 // Set up a matching dictionary to search the I/O Registry by class.
3646 // name for all HID class devices
3647 hidMatchDictionary = IOServiceMatching("AppleIRController");
3649 // Now search I/O Registry for matching devices.
3650 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3651 hidMatchDictionary, &hidObjectIterator);
3653 // If search is unsuccessful, return nonzero.
3654 if (ioReturnValue != kIOReturnSuccess ||
3655 !IOIteratorIsValid(hidObjectIterator)) {
3656 return 1;
3658 return 0;
3661 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3663 if test "$_apple_remote" = yes ; then
3664 _def_apple_remote='#define HAVE_APPLE_REMOTE 1'
3665 _ld_extra="$_ld_extra -framework IOKit"
3666 else
3667 _def_apple_remote='#undef HAVE_APPLE_REMOTE'
3669 echores "$_apple_remote"
3671 fi #if darwin
3674 echocheck "pkg-config"
3675 _pkg_config=pkg-config
3676 if `$_pkg_config --version > /dev/null 2>&1`; then
3677 if test "$_ld_static"; then
3678 _pkg_config="$_pkg_config --static"
3680 echores "yes"
3681 else
3682 _pkg_config=false
3683 echores "no"
3687 echocheck "Samba support (libsmbclient)"
3688 if test "$_smbsupport" = yes; then
3689 _ld_extra="$_ld_extra -lsmbclient"
3691 if test "$_smbsupport" = auto; then
3692 _smbsupport=no
3693 cat > $TMPC << EOF
3694 #include <libsmbclient.h>
3695 int main(void) { smbc_opendir("smb://"); return 0; }
3697 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3698 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3699 _smbsupport=yes && break
3700 done
3703 if test "$_smbsupport" = yes; then
3704 _def_smbsupport="#define LIBSMBCLIENT"
3705 _inputmodules="smb $_inputmodules"
3706 else
3707 _def_smbsupport="#undef LIBSMBCLIENT"
3708 _noinputmodules="smb $_noinputmodules"
3710 echores "$_smbsupport"
3713 #########
3714 # VIDEO #
3715 #########
3718 echocheck "tdfxfb"
3719 if test "$_tdfxfb" = yes ; then
3720 _def_tdfxfb='#define HAVE_TDFXFB 1'
3721 _vosrc="$_vosrc vo_tdfxfb.c"
3722 _vomodules="tdfxfb $_vomodules"
3723 else
3724 _def_tdfxfb='#undef HAVE_TDFXFB'
3725 _novomodules="tdfxfb $_novomodules"
3727 echores "$_tdfxfb"
3729 echocheck "s3fb"
3730 if test "$_s3fb" = yes ; then
3731 _def_s3fb='#define HAVE_S3FB 1'
3732 _vosrc="$_vosrc vo_s3fb.c"
3733 _vomodules="s3fb $_vomodules"
3734 else
3735 _def_s3fb='#undef HAVE_S3FB'
3736 _novomodules="s3fb $_novomodules"
3738 echores "$_s3fb"
3740 echocheck "tdfxvid"
3741 if test "$_tdfxvid" = yes ; then
3742 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3743 _vosrc="$_vosrc vo_tdfx_vid.c"
3744 _vomodules="tdfx_vid $_vomodules"
3745 else
3746 _def_tdfxvid='#undef HAVE_TDFX_VID'
3747 _novomodules="tdfx_vid $_novomodules"
3749 echores "$_tdfxvid"
3751 echocheck "xvr100"
3752 if test "$_xvr100" = auto ; then
3753 cat > $TMPC << EOF
3754 #include <unistd.h>
3755 #include <sys/fbio.h>
3756 #include <sys/visual_io.h>
3757 int main(void) {
3758 struct vis_identifier ident;
3759 struct fbgattr attr;
3761 ioctl(0, VIS_GETIDENTIFIER, &ident);
3762 ioctl(0, FBIOGATTR, &attr);
3765 _xvr100=no
3766 cc_check && _xvr100=yes
3768 if test "$_xvr100" = yes ; then
3769 _def_xvr100='#define HAVE_XVR100 1'
3770 _vosrc="$_vosrc vo_xvr100.c"
3771 _vomodules="xvr100 $_vomodules"
3772 else
3773 _def_tdfxvid='#undef HAVE_XVR100'
3774 _novomodules="xvr100 $_novomodules"
3776 echores "$_xvr100"
3778 echocheck "tga"
3779 if test "$_tga" = yes ; then
3780 _def_tga='#define HAVE_TGA 1'
3781 _vosrc="$_vosrc vo_tga.c"
3782 _vomodules="tga $_vomodules"
3783 else
3784 _def_tga='#undef HAVE_TGA'
3785 _novomodules="tga $_novomodules"
3787 echores "$_tga"
3790 echocheck "md5sum support"
3791 if test "$_md5sum" = yes; then
3792 _def_md5sum="#define HAVE_MD5SUM"
3793 _vosrc="$_vosrc vo_md5sum.c"
3794 _vomodules="md5sum $_vomodules"
3795 else
3796 _def_md5sum="#undef HAVE_MD5SUM"
3797 _novomodules="md5sum $_novomodules"
3799 echores "$_md5sum"
3802 echocheck "bl"
3803 if test "$_bl" = yes ; then
3804 _def_bl='#define HAVE_BL 1'
3805 _vosrc="$_vosrc vo_bl.c"
3806 _vomodules="bl $_vomodules"
3807 else
3808 _def_bl='#undef HAVE_BL'
3809 _novomodules="bl $_novomodules"
3811 echores "$_bl"
3814 echocheck "DirectFB"
3815 if test "$_directfb" = auto ; then
3816 _directfb=no
3817 cat > $TMPC <<EOF
3818 #include <directfb.h>
3819 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3821 for _inc_tmp in "" -I/usr/local/include/directfb \
3822 -I/usr/include/directfb -I/usr/local/include; do
3823 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3824 _inc_extra="$_inc_extra $_inc_tmp" && break
3825 done
3828 dfb_version() {
3829 expr $1 \* 65536 + $2 \* 256 + $3
3832 if test "$_directfb" = yes; then
3833 cat > $TMPC << EOF
3834 #include <directfb_version.h>
3836 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3839 if $_cc -E $TMPC $_inc_extra > "$TMPEXE"; then
3840 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'`
3841 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3842 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3843 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3844 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3845 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3846 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3847 _res_comment="$_directfb_version"
3848 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3849 else
3850 _def_directfb_version='#undef DIRECTFBVERSION'
3851 _directfb=no
3852 _res_comment="version >=0.9.13 required"
3854 else
3855 _directfb=no
3856 _res_comment="failed to get version"
3859 echores "$_directfb"
3861 if test "$_directfb" = yes ; then
3862 _def_directfb='#define HAVE_DIRECTFB 1'
3863 _vosrc="$_vosrc vo_directfb2.c"
3864 _vomodules="directfb $_vomodules"
3865 _libs_mplayer="$_libs_mplayer -ldirectfb"
3866 else
3867 _def_directfb='#undef HAVE_DIRECTFB'
3868 _novomodules="directfb $_novomodules"
3870 if test "$_dfbmga" = yes; then
3871 _vosrc="$_vosrc vo_dfbmga.c"
3872 _vomodules="dfbmga $_vomodules"
3873 _def_dfbmga='#define HAVE_DFBMGA 1'
3874 else
3875 _novomodules="dfbmga $_novomodules"
3876 _def_dfbmga='#undef HAVE_DFBMGA'
3880 echocheck "X11 headers presence"
3881 _x11_headers="no"
3882 _res_comment="check if the dev(el) packages are installed"
3883 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3884 if test -f "$I/X11/Xlib.h" ; then
3885 _x11_headers="yes"
3886 _res_comment=""
3887 break
3889 done
3890 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3891 if test -f "$I/X11/Xlib.h" ; then
3892 _inc_extra="$_inc_extra -I$I"
3893 _x11_headers="yes"
3894 _res_comment="using $I"
3895 break
3897 done
3898 echores "$_x11_headers"
3901 echocheck "X11"
3902 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3903 cat > $TMPC <<EOF
3904 #include <X11/Xlib.h>
3905 #include <X11/Xutil.h>
3906 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3908 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3909 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3910 if netbsd; then
3911 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3912 else
3913 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3915 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3916 && _x11=yes && break
3917 done
3919 if test "$_x11" = yes ; then
3920 _def_x11='#define HAVE_X11 1'
3921 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3922 _vomodules="x11 xover $_vomodules"
3923 else
3924 _x11=no
3925 _def_x11='#undef HAVE_X11'
3926 _novomodules="x11 $_novomodules"
3927 _res_comment="check if the dev(el) packages are installed"
3928 # disable stuff that depends on X
3929 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
3931 echores "$_x11"
3933 echocheck "Xss screensaver extensions"
3934 if test "$_xss" = auto ; then
3935 cat > $TMPC << EOF
3936 #include <X11/Xlib.h>
3937 #include <X11/extensions/scrnsaver.h>
3938 int main(void) {
3939 XScreenSaverSuspend(NULL, True);
3940 return 0;
3943 _xss=no
3944 cc_check -lXss && _xss=yes
3946 if test "$_xss" = yes ; then
3947 _def_xss='#define HAVE_XSS 1'
3948 _libs_mplayer="$_libs_mplayer -lXss"
3949 else
3950 _def_xss='#undef HAVE_XSS'
3952 echores "$_xss"
3954 echocheck "DPMS"
3955 _xdpms3=no
3956 _xdpms4=no
3957 if test "$_x11" = yes ; then
3958 cat > $TMPC <<EOF
3959 #include <X11/Xmd.h>
3960 #include <X11/Xlib.h>
3961 #include <X11/Xutil.h>
3962 #include <X11/Xatom.h>
3963 #include <X11/extensions/dpms.h>
3964 int main(void) {
3965 (void) DPMSQueryExtension(0, 0, 0);
3968 cc_check -lXdpms && _xdpms3=yes
3969 cat > $TMPC <<EOF
3970 #include <X11/Xlib.h>
3971 #include <X11/extensions/dpms.h>
3972 int main(void) {
3973 (void) DPMSQueryExtension(0, 0, 0);
3976 cc_check -lXext && _xdpms4=yes
3978 if test "$_xdpms4" = yes ; then
3979 _def_xdpms='#define HAVE_XDPMS 1'
3980 _res_comment="using Xdpms 4"
3981 echores "yes"
3982 elif test "$_xdpms3" = yes ; then
3983 _def_xdpms='#define HAVE_XDPMS 1'
3984 _libs_mplayer="$_libs_mplayer -lXdpms"
3985 _res_comment="using Xdpms 3"
3986 echores "yes"
3987 else
3988 _def_xdpms='#undef HAVE_XDPMS'
3989 echores "no"
3993 echocheck "Xv"
3994 if test "$_xv" = auto ; then
3995 cat > $TMPC <<EOF
3996 #include <X11/Xlib.h>
3997 #include <X11/extensions/Xvlib.h>
3998 int main(void) {
3999 (void) XvGetPortAttribute(0, 0, 0, 0);
4000 (void) XvQueryPortAttributes(0, 0, 0);
4001 return 0; }
4003 _xv=no
4004 cc_check -lXv && _xv=yes
4007 if test "$_xv" = yes ; then
4008 _def_xv='#define HAVE_XV 1'
4009 _libs_mplayer="$_libs_mplayer -lXv"
4010 _vosrc="$_vosrc vo_xv.c"
4011 _vomodules="xv $_vomodules"
4012 else
4013 _def_xv='#undef HAVE_XV'
4014 _novomodules="xv $_novomodules"
4016 echores "$_xv"
4019 echocheck "XvMC"
4020 if test "$_xv" = yes && test "$_xvmc" != no ; then
4021 _xvmc=no
4022 cat > $TMPC <<EOF
4023 #include <X11/Xlib.h>
4024 #include <X11/extensions/Xvlib.h>
4025 #include <X11/extensions/XvMClib.h>
4026 int main(void) {
4027 (void) XvMCQueryExtension(0,0,0);
4028 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4029 return 0; }
4031 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4032 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4033 done
4035 if test "$_xvmc" = yes ; then
4036 _def_xvmc='#define HAVE_XVMC 1'
4037 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
4038 _vosrc="$_vosrc vo_xvmc.c"
4039 _vomodules="xvmc $_vomodules"
4040 _res_comment="using $_xvmclib"
4041 else
4042 _def_xvmc='#undef HAVE_XVMC'
4043 _novomodules="xvmc $_novomodules"
4044 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4046 echores "$_xvmc"
4049 echocheck "Xinerama"
4050 if test "$_xinerama" = auto ; then
4051 cat > $TMPC <<EOF
4052 #include <X11/Xlib.h>
4053 #include <X11/extensions/Xinerama.h>
4054 int main(void) { (void) XineramaIsActive(0); return 0; }
4056 _xinerama=no
4057 cc_check -lXinerama && _xinerama=yes
4060 if test "$_xinerama" = yes ; then
4061 _def_xinerama='#define HAVE_XINERAMA 1'
4062 _libs_mplayer="$_libs_mplayer -lXinerama"
4063 else
4064 _def_xinerama='#undef HAVE_XINERAMA'
4066 echores "$_xinerama"
4069 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4070 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4071 # named 'X extensions' or something similar.
4072 # This check may be useful for future mplayer versions (to change resolution)
4073 # If you run into problems, remove '-lXxf86vm'.
4074 echocheck "Xxf86vm"
4075 if test "$_vm" = auto ; then
4076 cat > $TMPC <<EOF
4077 #include <X11/Xlib.h>
4078 #include <X11/extensions/xf86vmode.h>
4079 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4081 _vm=no
4082 cc_check -lXxf86vm && _vm=yes
4084 if test "$_vm" = yes ; then
4085 _def_vm='#define HAVE_XF86VM 1'
4086 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4087 else
4088 _def_vm='#undef HAVE_XF86VM'
4090 echores "$_vm"
4092 # Check for the presence of special keycodes, like audio control buttons
4093 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4094 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4095 # have these new keycodes.
4096 echocheck "XF86keysym"
4097 if test "$_xf86keysym" = auto; then
4098 _xf86keysym=no
4099 cat > $TMPC <<EOF
4100 #include <X11/Xlib.h>
4101 #include <X11/XF86keysym.h>
4102 int main(void) { return XF86XK_AudioPause; }
4104 cc_check && _xf86keysym=yes
4106 if test "$_xf86keysym" = yes ; then
4107 _def_xf86keysym='#define HAVE_XF86XK 1'
4108 else
4109 _def_xf86keysym='#undef HAVE_XF86XK'
4111 echores "$_xf86keysym"
4113 echocheck "DGA"
4114 if test "$_dga2" = auto && test "$_x11" = yes ; then
4115 cat > $TMPC << EOF
4116 #include <X11/Xlib.h>
4117 #include <X11/extensions/xf86dga.h>
4118 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4120 _dga2=no
4121 cc_check -lXxf86dga && _dga2=yes
4123 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4124 cat > $TMPC << EOF
4125 #include <X11/Xlib.h>
4126 #include <X11/extensions/xf86dga.h>
4127 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4129 _dga1=no
4130 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4133 _dga=no
4134 _def_dga='#undef HAVE_DGA'
4135 _def_dga1='#undef HAVE_DGA1'
4136 _def_dga2='#undef HAVE_DGA2'
4137 if test "$_dga1" = yes ; then
4138 _dga=yes
4139 _def_dga1='#define HAVE_DGA1 1'
4140 _res_comment="using DGA 1.0"
4141 elif test "$_dga2" = yes ; then
4142 _dga=yes
4143 _def_dga2='#define HAVE_DGA2 1'
4144 _res_comment="using DGA 2.0"
4146 if test "$_dga" = yes ; then
4147 _def_dga='#define HAVE_DGA 1'
4148 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4149 _vosrc="$_vosrc vo_dga.c"
4150 _vomodules="dga $_vomodules"
4151 else
4152 _novomodules="dga $_novomodules"
4154 echores "$_dga"
4157 echocheck "3dfx"
4158 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4159 _def_3dfx='#define HAVE_3DFX 1'
4160 _vosrc="$_vosrc vo_3dfx.c"
4161 _vomodules="3dfx $_vomodules"
4162 else
4163 _def_3dfx='#undef HAVE_3DFX'
4164 _novomodules="3dfx $_novomodules"
4166 echores "$_3dfx"
4169 echocheck "OpenGL"
4170 #Note: this test is run even with --enable-gl since we autodetect linker flags
4171 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4172 cat > $TMPC << EOF
4173 #include <GL/gl.h>
4174 #ifdef GL_WIN32
4175 #include <windows.h>
4176 #include <GL/glext.h>
4177 #else
4178 #include <X11/Xlib.h>
4179 #include <GL/glx.h>
4180 #endif
4181 int main(void) {
4182 #ifdef GL_WIN32
4183 HDC dc;
4184 wglCreateContext(dc);
4185 #else
4186 glXCreateContext(NULL, NULL, NULL, True);
4187 #endif
4188 glFinish();
4189 return 0;
4192 _gl=no
4193 if cc_check -lGL $_ld_lm ; then
4194 _gl=yes
4195 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4196 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4197 _gl=yes
4198 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4199 elif cc_check -DGL_WIN32 -lopengl32 ; then
4200 _gl=yes
4201 _gl_win32=yes
4202 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4204 else
4205 _gl=no
4207 if test "$_gl" = yes ; then
4208 _def_gl='#define HAVE_GL 1'
4209 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4210 if test "$_gl_win32" = yes ; then
4211 _def_gl_win32='#define GL_WIN32 1'
4212 _vosrc="$_vosrc w32_common.c"
4213 _res_comment="win32 version"
4215 _vomodules="opengl $_vomodules"
4216 else
4217 _def_gl='#undef HAVE_GL'
4218 _def_gl_win32='#undef GL_WIN32'
4219 _novomodules="opengl $_novomodules"
4221 echores "$_gl"
4224 echocheck "VIDIX"
4225 _vidix=no
4226 _def_vidix='#undef CONFIG_VIDIX'
4227 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4228 _vidix_drv_cyberblade=no
4229 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4230 _vidix_drv_ivtv=no
4231 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4232 _vidix_drv_ivtv=no
4233 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4234 _vidix_drv_mach64=no
4235 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4236 _vidix_drv_mga=no
4237 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4238 _vidix_drv_mga_crtc2=no
4239 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4240 _vidix_drv_nvidia=no
4241 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4242 _vidix_drv_pm2=no
4243 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4244 _vidix_drv_pm3=no
4245 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4246 _vidix_drv_radeon=no
4247 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4248 _vidix_drv_rage128=no
4249 _def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4250 _vidix_drv_s3=no
4251 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4252 _vidix_drv_sis=no
4253 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4254 _vidix_drv_unichrome=no
4255 if test "$_vidix_internal" = auto ; then
4256 _vidix_internal=no
4257 x86 && linux || freebsd || netbsd || openbsd || sunos || win32 \
4258 && _vidix_internal=yes
4259 ppc || alpha && linux && _vidix_internal=yes
4261 if test "$_vidix_internal" = yes; then
4262 _res_comment="internal"
4263 _vidix_external=no
4264 _vidix=yes
4265 elif test "$_vidix_external" = auto; then
4266 _vidix_external=no
4267 cat > $TMPC <<EOF
4268 #include <vidix/vidix.h>
4269 int main(void) { return 0; }
4271 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
4272 && _vidix=yes
4274 echores "$_vidix"
4276 if test "$_vidix" = yes ; then
4277 _def_vidix='#define CONFIG_VIDIX 1'
4278 _vosrc="$_vosrc vo_cvidix.c"
4279 _vomodules="cvidix $_vomodules"
4280 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sis unichrome"
4281 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4283 # some vidix drivers are meant to work on x86 only, discard them elsewhere
4284 x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome//`
4286 for driver in $_vidix_drivers ; do
4287 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4288 eval _vidix_drv_${driver}=yes
4289 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4290 done
4291 else
4292 _novomodules="cvidix $_novomodules"
4295 if test "$_vidix_internal" = yes ; then
4296 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
4297 elif test "$_vidix_external" = yes ; then
4298 _libs_mplayer="$_libs_mplayer -lvidix"
4299 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
4302 if test "$_vidix" = yes && win32; then
4303 _vosrc="$_vosrc vo_winvidix.c"
4304 _vomodules="winvidix $_vomodules"
4305 _libs_mplayer="$_libs_mplayer -lgdi32"
4306 else
4307 _novomodules="winvidix $_novomodules"
4309 if test "$_vidix" = yes && test "$_x11" = yes; then
4310 _vosrc="$_vosrc vo_xvidix.c"
4311 _vomodules="xvidix $_vomodules"
4312 else
4313 _novomodules="xvidix $_novomodules"
4316 echocheck "VIDIX PCI device name database"
4317 echores "$_vidix_pcidb"
4318 if test "$_vidix_pcidb" = yes ; then
4319 _vidix_pcidb_val=1
4320 else
4321 _vidix_pcidb_val=0
4324 echocheck "/dev/mga_vid"
4325 if test "$_mga" = auto ; then
4326 _mga=no
4327 test -c /dev/mga_vid && _mga=yes
4329 if test "$_mga" = yes ; then
4330 _def_mga='#define HAVE_MGA 1'
4331 _vosrc="$_vosrc vo_mga.c"
4332 _vomodules="mga $_vomodules"
4333 else
4334 _def_mga='#undef HAVE_MGA'
4335 _novomodules="mga $_novomodules"
4337 echores "$_mga"
4340 echocheck "xmga"
4341 if test "$_xmga" = auto ; then
4342 _xmga=no
4343 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4345 if test "$_xmga" = yes ; then
4346 _def_xmga='#define HAVE_XMGA 1'
4347 _vosrc="$_vosrc vo_xmga.c"
4348 _vomodules="xmga $_vomodules"
4349 else
4350 _def_xmga='#undef HAVE_XMGA'
4351 _novomodules="xmga $_novomodules"
4353 echores "$_xmga"
4356 echocheck "GGI"
4357 if test "$_ggi" = auto ; then
4358 cat > $TMPC << EOF
4359 #include <ggi/ggi.h>
4360 int main(void) { ggiInit(); return 0; }
4362 _ggi=no
4363 cc_check -lggi && _ggi=yes
4365 if test "$_ggi" = yes ; then
4366 _def_ggi='#define HAVE_GGI 1'
4367 _libs_mplayer="$_libs_mplayer -lggi"
4368 _vosrc="$_vosrc vo_ggi.c"
4369 _vomodules="ggi $_vomodules"
4370 else
4371 _def_ggi='#undef HAVE_GGI'
4372 _novomodules="ggi $_novomodules"
4374 echores "$_ggi"
4376 echocheck "GGI extension: libggiwmh"
4377 if test "$_ggiwmh" = auto ; then
4378 _ggiwmh=no
4379 cat > $TMPC << EOF
4380 #include <ggi/ggi.h>
4381 #include <ggi/wmh.h>
4382 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4384 cc_check -lggi -lggiwmh && _ggiwmh=yes
4386 # needed to get right output on obscure combination
4387 # like --disable-ggi --enable-ggiwmh
4388 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4389 _def_ggiwmh='#define HAVE_GGIWMH 1'
4390 _libs_mplayer="$_libs_mplayer -lggiwmh"
4391 else
4392 _ggiwmh=no
4393 _def_ggiwmh='#undef HAVE_GGIWMH'
4395 echores "$_ggiwmh"
4398 echocheck "AA"
4399 if test "$_aa" = auto ; then
4400 cat > $TMPC << EOF
4401 #include <aalib.h>
4402 extern struct aa_hardware_params aa_defparams;
4403 extern struct aa_renderparams aa_defrenderparams;
4404 int main(void) {
4405 aa_context *c;
4406 aa_renderparams *p;
4407 (void) aa_init(0, 0, 0);
4408 c = aa_autoinit(&aa_defparams);
4409 p = aa_getrenderparams();
4410 aa_autoinitkbd(c,0);
4411 return 0; }
4413 _aa=no
4414 for _ld_tmp in "-laa" ; do
4415 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4416 done
4418 if test "$_aa" = yes ; then
4419 _def_aa='#define HAVE_AA 1'
4420 if cygwin ; then
4421 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4423 _vosrc="$_vosrc vo_aa.c"
4424 _vomodules="aa $_vomodules"
4425 else
4426 _def_aa='#undef HAVE_AA'
4427 _novomodules="aa $_novomodules"
4429 echores "$_aa"
4432 echocheck "CACA"
4433 if test "$_caca" = auto ; then
4434 _caca=no
4435 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4436 cat > $TMPC << EOF
4437 #include <caca.h>
4438 #ifdef CACA_API_VERSION_1
4439 #include <caca0.h>
4440 #endif
4441 int main(void) { (void) caca_init(); return 0; }
4443 cc_check `caca-config --libs` && _caca=yes
4446 if test "$_caca" = yes ; then
4447 _def_caca='#define HAVE_CACA 1'
4448 _inc_extra="$_inc_extra `caca-config --cflags`"
4449 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4450 _vosrc="$_vosrc vo_caca.c"
4451 _vomodules="caca $_vomodules"
4452 else
4453 _def_caca='#undef HAVE_CACA'
4454 _novomodules="caca $_novomodules"
4456 echores "$_caca"
4459 echocheck "SVGAlib"
4460 if test "$_svga" = auto ; then
4461 cat > $TMPC << EOF
4462 #include <vga.h>
4463 int main(void) { return 0; }
4465 _svga=no
4466 cc_check -lvga $_ld_lm && _svga=yes
4468 if test "$_svga" = yes ; then
4469 _def_svga='#define HAVE_SVGALIB 1'
4470 _libs_mplayer="$_libs_mplayer -lvga"
4471 _vosrc="$_vosrc vo_svga.c"
4472 _vomodules="svga $_vomodules"
4473 else
4474 _def_svga='#undef HAVE_SVGALIB'
4475 _novomodules="svga $_novomodules"
4477 echores "$_svga"
4480 echocheck "FBDev"
4481 if test "$_fbdev" = auto ; then
4482 _fbdev=no
4483 linux && _fbdev=yes
4485 if test "$_fbdev" = yes ; then
4486 _def_fbdev='#define HAVE_FBDEV 1'
4487 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4488 _vomodules="fbdev $_vomodules"
4489 else
4490 _def_fbdev='#undef HAVE_FBDEV'
4491 _novomodules="fbdev $_novomodules"
4493 echores "$_fbdev"
4497 echocheck "DVB"
4498 if test "$_dvb" = auto ; then
4499 _dvb=no
4500 cat >$TMPC << EOF
4501 #include <sys/poll.h>
4502 #include <sys/ioctl.h>
4503 #include <stdio.h>
4504 #include <time.h>
4505 #include <unistd.h>
4507 #include <ost/dmx.h>
4508 #include <ost/frontend.h>
4509 #include <ost/sec.h>
4510 #include <ost/video.h>
4511 #include <ost/audio.h>
4512 int main(void) {return 0;}
4514 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4515 cc_check $_inc_tmp && _dvb=yes && \
4516 _inc_extra="$_inc_extra $_inc_tmp" && break
4517 done
4519 echores "$_dvb"
4520 if test "$_dvb" = yes ; then
4521 _def_dvb='#define HAVE_DVB 1'
4522 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4523 _aomodules="mpegpes(dvb) $_aomodules"
4524 _vomodules="mpegpes(dvb) $_vomodules"
4527 echocheck "DVB HEAD"
4528 if test "$_dvbhead" = auto ; then
4529 _dvbhead=no
4531 cat >$TMPC << EOF
4532 #include <sys/poll.h>
4533 #include <sys/ioctl.h>
4534 #include <stdio.h>
4535 #include <time.h>
4536 #include <unistd.h>
4538 #include <linux/dvb/dmx.h>
4539 #include <linux/dvb/frontend.h>
4540 #include <linux/dvb/video.h>
4541 #include <linux/dvb/audio.h>
4542 int main(void) {return 0;}
4544 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4545 cc_check $_inc_tmp && _dvbhead=yes && \
4546 _inc_extra="$_inc_extra $_inc_tmp" && break
4547 done
4549 echores "$_dvbhead"
4550 if test "$_dvbhead" = yes ; then
4551 _def_dvb='#define HAVE_DVB_HEAD 1'
4552 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4553 _aomodules="mpegpes(dvb) $_aomodules"
4554 _vomodules="mpegpes(dvb) $_vomodules"
4557 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4558 _def_dvb='#undef HAVE_DVB'
4559 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4560 _aomodules="mpegpes(file) $_aomodules"
4561 _vomodules="mpegpes(file) $_vomodules"
4564 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4565 _dvbin=yes
4566 _inputmodules="dvb $_inputmodules"
4567 else
4568 _dvbin=no
4569 _noinputmodules="dvb $_noinputmodules"
4575 echocheck "PNG support"
4576 if test "$_png" = auto ; then
4577 _png=no
4578 if irix ; then
4579 # Don't check for -lpng on irix since it has its own libpng
4580 # incompatible with the GNU libpng
4581 _res_comment="disabled on irix (not GNU libpng)"
4582 else
4583 cat > $TMPC << EOF
4584 #include <png.h>
4585 #include <string.h>
4586 int main(void) {
4587 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4588 printf("libpng: %s\n", png_libpng_ver);
4589 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4592 if cc_check -lpng -lz $_ld_lm ; then
4593 if tmp_run ; then
4594 _png=yes
4595 else
4596 _res_comment="mismatch of library and header versions"
4601 echores "$_png"
4602 if test "$_png" = yes ; then
4603 _def_png='#define HAVE_PNG 1'
4604 _ld_extra="$_ld_extra -lpng -lz"
4605 _vosrc="$_vosrc vo_png.c"
4606 _vomodules="png $_vomodules"
4607 else
4608 _def_png='#undef HAVE_PNG'
4609 _novomodules="png $_novomodules"
4612 echocheck "JPEG support"
4613 if test "$_jpeg" = auto ; then
4614 _jpeg=no
4615 cat > $TMPC << EOF
4616 #include <stdio.h>
4617 #include <stdlib.h>
4618 #include <setjmp.h>
4619 #include <string.h>
4620 #include <jpeglib.h>
4621 int main(void) {
4622 return 0;
4625 if cc_check -ljpeg $_ld_lm ; then
4626 if tmp_run ; then
4627 _jpeg=yes
4631 echores "$_jpeg"
4633 if test "$_jpeg" = yes ; then
4634 _def_jpeg='#define HAVE_JPEG 1'
4635 _vosrc="$_vosrc vo_jpeg.c"
4636 _vomodules="jpeg $_vomodules"
4637 _ld_extra="$_ld_extra -ljpeg"
4638 else
4639 _def_jpeg='#undef HAVE_JPEG'
4640 _novomodules="jpeg $_novomodules"
4645 echocheck "PNM support"
4646 if test "$_pnm" = yes; then
4647 _def_pnm="#define HAVE_PNM"
4648 _vosrc="$_vosrc vo_pnm.c"
4649 _vomodules="pnm $_vomodules"
4650 else
4651 _def_pnm="#undef HAVE_PNM"
4652 _novomodules="pnm $_novomodules"
4654 echores "$_pnm"
4658 echocheck "GIF support"
4659 # This is to appease people who want to force gif support.
4660 # If it is forced to yes, then we still do checks to determine
4661 # which gif library to use.
4662 if test "$_gif" = yes ; then
4663 _force_gif=yes
4664 _gif=auto
4667 if test "$_gif" = auto ; then
4668 _gif=no
4669 cat > $TMPC << EOF
4670 #include <gif_lib.h>
4671 int main(void) {
4672 return 0;
4675 for _ld_gif in "-lungif" "-lgif" ; do
4676 cc_check $_ld_gif && tmp_run && _gif=yes && break
4677 done
4680 # If no library was found, and the user wants support forced,
4681 # then we force it on with libgif, as this is the safest
4682 # assumption IMHO. (libungif & libregif both create symbolic
4683 # links to libgif. We also assume that no x11 support is needed,
4684 # because if you are forcing this, then you _should_ know what
4685 # you are doing. [ Besides, package maintainers should never
4686 # have compiled x11 deps into libungif in the first place. ] )
4687 # </rant>
4688 # --Joey
4689 if test "$_force_gif" = yes && test "$_gif" = no ; then
4690 _gif=yes
4691 _ld_gif="-lgif"
4694 if test "$_gif" = yes ; then
4695 _def_gif='#define HAVE_GIF 1'
4696 _vosrc="$_vosrc vo_gif89a.c"
4697 _codecmodules="gif $_codecmodules"
4698 _vomodules="gif89a $_vomodules"
4699 _res_comment="old version, some encoding functions disabled"
4700 _def_gif_4='#undef HAVE_GIF_4'
4701 _ld_extra="$_ld_extra $_ld_gif"
4703 cat > $TMPC << EOF
4704 #include <signal.h>
4705 #include <gif_lib.h>
4706 void catch() { exit(1); }
4707 int main(void) {
4708 signal(SIGSEGV, catch); // catch segfault
4709 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4710 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4711 return 0;
4714 if cc_check "$_ld_gif" && tmp_run ; then
4715 _def_gif_4='#define HAVE_GIF_4 1'
4716 _res_comment=""
4718 else
4719 _def_gif='#undef HAVE_GIF'
4720 _def_gif_4='#undef HAVE_GIF_4'
4721 _novomodules="gif89a $_novomodules"
4722 _nocodecmodules="gif $_nocodecmodules"
4724 echores "$_gif"
4727 case "$_gif" in yes*)
4728 echocheck "broken giflib workaround"
4729 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4731 cat > $TMPC << EOF
4732 #include <gif_lib.h>
4733 int main(void) {
4734 GifFileType gif;
4735 printf("UserData is at address %p\n", gif.UserData);
4736 return 0;
4739 if cc_check "$_ld_gif" && tmp_run ; then
4740 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4741 echores "disabled"
4742 else
4743 echores "enabled"
4746 esac
4749 echocheck "VESA support"
4750 if test "$_vesa" = auto ; then
4751 cat > $TMPC << EOF
4752 #include <vbe.h>
4753 int main(void) { vbeVersion(); return 0; }
4755 _vesa=no
4756 cc_check -lvbe -llrmi && _vesa=yes
4758 if test "$_vesa" = yes ; then
4759 _def_vesa='#define HAVE_VESA 1'
4760 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4761 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4762 _vomodules="vesa $_vomodules"
4763 else
4764 _def_vesa='#undef HAVE_VESA'
4765 _novomodules="vesa $_novomodules"
4767 echores "$_vesa"
4769 #################
4770 # VIDEO + AUDIO #
4771 #################
4774 echocheck "SDL"
4775 if test -z "$_sdlconfig" ; then
4776 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4777 _sdlconfig="sdl-config"
4778 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4779 _sdlconfig="sdl11-config"
4780 else
4781 _sdlconfig=false
4784 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4785 cat > $TMPC << EOF
4786 #include <SDL.h>
4787 int main(int argc, char *argv[]) {
4788 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4789 return 0;
4792 _sdl=no
4793 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4794 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4795 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4796 if test "$_sdlversion" -gt 116 ; then
4797 if test "$_sdlversion" -lt 121 ; then
4798 _def_sdlbuggy='#define BUGGY_SDL'
4799 else
4800 _def_sdlbuggy='#undef BUGGY_SDL'
4802 _sdl=yes
4807 if test "$_sdl" = yes ; then
4808 _def_sdl='#define HAVE_SDL 1'
4809 if cygwin ; then
4810 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4811 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4812 elif mingw32 ; then
4813 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4814 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4815 else
4816 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4817 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4819 _vosrc="$_vosrc vo_sdl.c"
4820 _vomodules="sdl $_vomodules"
4821 _aosrc="$_aosrc ao_sdl.c"
4822 _aomodules="sdl $_aomodules"
4823 _res_comment="using $_sdlconfig"
4824 else
4825 _def_sdl='#undef HAVE_SDL'
4826 _novomodules="sdl $_novomodules"
4827 _noaomodules="sdl $_noaomodules"
4829 echores "$_sdl"
4832 if win32; then
4834 echocheck "Windows waveout"
4835 if test "$_win32waveout" = auto ; then
4836 cat > $TMPC << EOF
4837 #include <windows.h>
4838 #include <mmsystem.h>
4839 int main(void) { return 0; }
4841 _win32waveout=no
4842 cc_check -lwinmm && _win32waveout=yes
4844 if test "$_win32waveout" = yes ; then
4845 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4846 _libs_mplayer="$_libs_mplayer -lwinmm"
4847 _aosrc="$_aosrc ao_win32.c"
4848 _aomodules="win32 $_aomodules"
4849 else
4850 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4851 _noaomodules="win32 $_noaomodules"
4853 echores "$_win32waveout"
4855 echocheck "Directx"
4856 if test "$_directx" = auto ; then
4857 cat > $TMPC << EOF
4858 #include <windows.h>
4859 #include <ddraw.h>
4860 #include <dsound.h>
4861 int main(void) { return 0; }
4863 _directx=no
4864 cc_check -lgdi32 && _directx=yes
4866 if test "$_directx" = yes ; then
4867 _def_directx='#define HAVE_DIRECTX 1'
4868 _libs_mplayer="$_libs_mplayer -lgdi32"
4869 _vosrc="$_vosrc vo_directx.c"
4870 _vomodules="directx $_vomodules"
4871 _aosrc="$_aosrc ao_dsound.c"
4872 _aomodules="dsound $_aomodules"
4873 else
4874 _def_directx='#undef HAVE_DIRECTX'
4875 _novomodules="directx $_novomodules"
4876 _noaomodules="dsound $_noaomodules"
4878 echores "$_directx"
4880 fi #if win32; then
4883 echocheck "NAS"
4884 if test "$_nas" = auto ; then
4885 cat > $TMPC << EOF
4886 #include <audio/audiolib.h>
4887 int main(void) { return 0; }
4889 _nas=no
4890 cc_check $_ld_lm -laudio -lXt && _nas=yes
4892 if test "$_nas" = yes ; then
4893 _def_nas='#define HAVE_NAS 1'
4894 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4895 _aosrc="$_aosrc ao_nas.c"
4896 _aomodules="nas $_aomodules"
4897 else
4898 _noaomodules="nas $_noaomodules"
4899 _def_nas='#undef HAVE_NAS'
4901 echores "$_nas"
4903 echocheck "DXR2"
4904 if test "$_dxr2" = auto; then
4905 _dxr2=no
4906 cat > $TMPC << EOF
4907 #include <dxr2ioctl.h>
4908 int main(void) { return 0; }
4910 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4911 cc_check $_inc_tmp && _dxr2=yes && \
4912 _inc_extra="$_inc_extra $_inc_tmp" && break
4913 done
4915 if test "$_dxr2" = yes; then
4916 _def_dxr2='#define HAVE_DXR2 1'
4917 _vosrc="$_vosrc vo_dxr2.c"
4918 _aosrc="$_aosrc ao_dxr2.c"
4919 _aomodules="dxr2 $_aomodules"
4920 _vomodules="dxr2 $_vomodules"
4921 else
4922 _def_dxr2='#undef HAVE_DXR2'
4923 _noaomodules="dxr2 $_noaomodules"
4924 _novomodules="dxr2 $_novomodules"
4926 echores "$_dxr2"
4928 echocheck "DXR3/H+"
4929 if test "$_dxr3" = auto ; then
4930 cat > $TMPC << EOF
4931 #include <linux/em8300.h>
4932 int main(void) { return 0; }
4934 _dxr3=no
4935 cc_check && _dxr3=yes
4937 if test "$_dxr3" = yes ; then
4938 _def_dxr3='#define HAVE_DXR3 1'
4939 _vosrc="$_vosrc vo_dxr3.c"
4940 _vomodules="dxr3 $_vomodules"
4941 else
4942 _def_dxr3='#undef HAVE_DXR3'
4943 _novomodules="dxr3 $_novomodules"
4945 echores "$_dxr3"
4948 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4949 if test "$_ivtv" = auto ; then
4950 cat > $TMPC << EOF
4951 #include <stdlib.h>
4952 #include <inttypes.h>
4953 #include <linux/types.h>
4954 #include <linux/videodev2.h>
4955 #include <linux/ivtv.h>
4956 #include <sys/ioctl.h>
4957 int main(void) {
4958 struct ivtv_cfg_stop_decode sd;
4959 struct ivtv_cfg_start_decode sd1;
4960 ioctl (0, IVTV_IOC_START_DECODE, &sd1);
4961 ioctl (0, IVTV_IOC_STOP_DECODE, &sd);
4962 return 0; }
4964 _ivtv=no
4965 cc_check && _ivtv=yes
4967 if test "$_ivtv" = yes ; then
4968 _def_ivtv='#define HAVE_IVTV 1'
4969 _vosrc="$_vosrc vo_ivtv.c"
4970 _vomodules="ivtv $_vomodules"
4971 _aosrc="$_aosrc ao_ivtv.c"
4972 _aomodules="ivtv $_aomodules"
4973 else
4974 _def_ivtv='#undef HAVE_IVTV'
4975 _novomodules="ivtv $_novomodules"
4976 _noaomodules="ivtv $_noaomodules"
4978 echores "$_ivtv"
4981 echocheck "V4L2 MPEG Decoder"
4982 if test "$_v4l2" = auto ; then
4983 cat > $TMPC << EOF
4984 #include <stdlib.h>
4985 #include <inttypes.h>
4986 #include <linux/types.h>
4987 #include <linux/videodev2.h>
4988 #include <linux/version.h>
4989 int main(void) {
4990 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4991 #error kernel headers too old, need 2.6.22
4992 bad_kernel_version();
4993 #endif
4994 struct v4l2_ext_controls ctrls;
4995 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4996 return 0;
4999 _v4l2=no
5000 cc_check && _v4l2=yes
5002 if test "$_v4l2" = yes ; then
5003 _def_v4l2='#define HAVE_V4L2_DECODER 1'
5004 _vosrc="$_vosrc vo_v4l2.c"
5005 _vomodules="v4l2 $_vomodules"
5006 _aosrc="$_aosrc ao_v4l2.c"
5007 _aomodules="v4l2 $_aomodules"
5008 else
5009 _def_v4l2='#undef HAVE_V4L2_DECODER'
5010 _novomodules="v4l2 $_novomodules"
5011 _noaomodules="v4l2 $_noaomodules"
5013 echores "$_v4l2"
5017 #########
5018 # AUDIO #
5019 #########
5022 echocheck "OSS Audio"
5023 if test "$_ossaudio" = auto ; then
5024 cat > $TMPC << EOF
5025 #include <sys/ioctl.h>
5026 #include <$_soundcard_header>
5027 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5029 _ossaudio=no
5030 cc_check && _ossaudio=yes
5032 if test "$_ossaudio" = yes ; then
5033 _def_ossaudio='#define USE_OSS_AUDIO 1'
5034 _aosrc="$_aosrc ao_oss.c"
5035 _aomodules="oss $_aomodules"
5036 if test "$_linux_devfs" = yes; then
5037 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5038 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5039 else
5040 cat > $TMPC << EOF
5041 #include <sys/ioctl.h>
5042 #include <$_soundcard_header>
5043 #ifdef OPEN_SOUND_SYSTEM
5044 int main(void) { return 0; }
5045 #else
5046 #error Not the real thing
5047 #endif
5049 _real_ossaudio=no
5050 cc_check && _real_ossaudio=yes
5051 if test "$_real_ossaudio" = yes; then
5052 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5053 elif netbsd || openbsd ; then
5054 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5055 _ld_extra="$_ld_extra -lossaudio"
5056 else
5057 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5059 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5061 else
5062 _def_ossaudio='#undef USE_OSS_AUDIO'
5063 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5064 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5065 _noaomodules="oss $_noaomodules"
5067 echores "$_ossaudio"
5070 echocheck "aRts"
5071 if test "$_arts" = auto ; then
5072 _arts=no
5073 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5075 cat > $TMPC << EOF
5076 #include <artsc.h>
5077 int main(void) { return 0; }
5079 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5084 if test "$_arts" = yes ; then
5085 _def_arts='#define USE_ARTS 1'
5086 _aosrc="$_aosrc ao_arts.c"
5087 _aomodules="arts $_aomodules"
5088 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5089 _inc_extra="$_inc_extra `artsc-config --cflags`"
5090 else
5091 _noaomodules="arts $_noaomodules"
5093 echores "$_arts"
5096 echocheck "EsounD"
5097 if test "$_esd" = auto ; then
5098 _esd=no
5099 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5101 cat > $TMPC << EOF
5102 #include <esd.h>
5103 int main(void) { int fd = esd_open_sound("test"); return fd; }
5105 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5109 echores "$_esd"
5111 if test "$_esd" = yes ; then
5112 _def_esd='#define USE_ESD 1'
5113 _aosrc="$_aosrc ao_esd.c"
5114 _aomodules="esd $_aomodules"
5115 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5116 _inc_extra="$_inc_extra `esd-config --cflags`"
5118 echocheck "esd_get_latency()"
5119 cat > $TMPC << EOF
5120 #include <esd.h>
5121 int main(void) { return esd_get_latency(0); }
5123 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5124 echores "$_esd_latency"
5125 else
5126 _def_esd='#undef USE_ESD'
5127 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5128 _noaomodules="esd $_noaomodules"
5131 echocheck "pulse"
5132 if test "$_pulse" = auto ; then
5133 _pulse=no
5134 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5136 cat > $TMPC << EOF
5137 #include <pulse/pulseaudio.h>
5138 int main(void) { return 0; }
5140 cc_check `$_pkg_config --libs --cflags libpulse` && tmp_run && _pulse=yes
5144 echores "$_pulse"
5146 if test "$_pulse" = yes ; then
5147 _def_pulse='#define USE_PULSE 1'
5148 _aosrc="$_aosrc ao_pulse.c"
5149 _aomodules="pulse $_aomodules"
5150 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs libpulse`"
5151 _inc_extra="$_inc_extra `$_pkg_config --cflags libpulse`"
5152 else
5153 _def_pulse='#undef USE_PULSE'
5154 _noaomodules="pulse $_noaomodules"
5158 echocheck "JACK"
5159 if test "$_jack" = auto ; then
5160 _jack=yes
5162 cat > $TMPC << EOF
5163 #include <jack/jack.h>
5164 int main(void) { jack_client_new("test"); return 0; }
5166 if cc_check -ljack ; then
5167 _libs_mplayer="$_libs_mplayer -ljack"
5168 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5169 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5170 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5171 else
5172 _jack=no
5176 if test "$_jack" = yes ; then
5177 _def_jack='#define USE_JACK 1'
5178 _aosrc="$_aosrc ao_jack.c"
5179 _aomodules="jack $_aomodules"
5180 else
5181 _noaomodules="jack $_noaomodules"
5183 echores "$_jack"
5185 echocheck "OpenAL"
5186 if test "$_openal" = auto ; then
5187 _openal=no
5188 cat > $TMPC << EOF
5189 #ifdef OPENAL_AL_H
5190 #include <OpenAL/al.h>
5191 #else
5192 #include <AL/al.h>
5193 #endif
5194 int main(void) {
5195 alSourceQueueBuffers(0, 0, 0);
5196 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5197 return 0;
5200 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5201 cc_check $I && _openal=yes && break
5202 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5203 done
5204 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5206 if test "$_openal" = yes ; then
5207 _def_openal='#define USE_OPENAL 1'
5208 _aosrc="$_aosrc ao_openal.c"
5209 _aomodules="openal $_aomodules"
5210 else
5211 _noaomodules="openal $_noaomodules"
5213 echores "$_openal"
5215 echocheck "ALSA audio"
5216 if test "$_alsa" != no ; then
5217 _alsa=no
5218 cat > $TMPC << EOF
5219 #include <sys/asoundlib.h>
5220 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5221 #error "alsa version != 0.5.x"
5222 #endif
5223 int main(void) { return 0; }
5225 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5227 cat > $TMPC << EOF
5228 #include <sys/asoundlib.h>
5229 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5230 #error "alsa version != 0.9.x"
5231 #endif
5232 int main(void) { return 0; }
5234 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5235 cat > $TMPC << EOF
5236 #include <alsa/asoundlib.h>
5237 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5238 #error "alsa version != 0.9.x"
5239 #endif
5240 int main(void) { return 0; }
5242 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5244 cat > $TMPC << EOF
5245 #include <sys/asoundlib.h>
5246 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5247 #error "alsa version != 1.0.x"
5248 #endif
5249 int main(void) { return 0; }
5251 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5252 cat > $TMPC << EOF
5253 #include <alsa/asoundlib.h>
5254 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5255 #error "alsa version != 1.0.x"
5256 #endif
5257 int main(void) { return 0; }
5259 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5261 _def_alsa5='#undef HAVE_ALSA5'
5262 _def_alsa9='#undef HAVE_ALSA9'
5263 _def_alsa1x='#undef HAVE_ALSA1X'
5264 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5265 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5266 if test "$_alsaver" ; then
5267 _alsa=yes
5268 if test "$_alsaver" = '0.5.x' ; then
5269 _alsa5=yes
5270 _aosrc="$_aosrc ao_alsa5.c"
5271 _aomodules="alsa5 $_aomodules"
5272 _def_alsa5='#define HAVE_ALSA5 1'
5273 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5274 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5275 elif test "$_alsaver" = '0.9.x-sys' ; then
5276 _alsa9=yes
5277 _aosrc="$_aosrc ao_alsa.c"
5278 _aomodules="alsa $_aomodules"
5279 _def_alsa9='#define HAVE_ALSA9 1'
5280 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5281 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5282 elif test "$_alsaver" = '0.9.x-alsa' ; then
5283 _alsa9=yes
5284 _aosrc="$_aosrc ao_alsa.c"
5285 _aomodules="alsa $_aomodules"
5286 _def_alsa9='#define HAVE_ALSA9 1'
5287 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5288 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5289 elif test "$_alsaver" = '1.0.x-sys' ; then
5290 _alsa1x=yes
5291 _aosrc="$_aosrc ao_alsa.c"
5292 _aomodules="alsa $_aomodules"
5293 _def_alsa1x="#define HAVE_ALSA1X 1"
5294 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5295 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5296 elif test "$_alsaver" = '1.0.x-alsa' ; then
5297 _alsa1x=yes
5298 _aosrc="$_aosrc ao_alsa.c"
5299 _aomodules="alsa $_aomodules"
5300 _def_alsa1x="#define HAVE_ALSA1X 1"
5301 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5302 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5303 else
5304 _alsa=no
5305 _res_comment="unknown version"
5307 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5308 else
5309 _noaomodules="alsa $_noaomodules"
5311 echores "$_alsa"
5314 echocheck "Sun audio"
5315 if test "$_sunaudio" = auto ; then
5316 cat > $TMPC << EOF
5317 #include <sys/types.h>
5318 #include <sys/audioio.h>
5319 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5321 _sunaudio=no
5322 cc_check && _sunaudio=yes
5324 if test "$_sunaudio" = yes ; then
5325 _def_sunaudio='#define USE_SUN_AUDIO 1'
5326 _aosrc="$_aosrc ao_sun.c"
5327 _aomodules="sun $_aomodules"
5328 else
5329 _def_sunaudio='#undef USE_SUN_AUDIO'
5330 _noaomodules="sun $_noaomodules"
5332 echores "$_sunaudio"
5335 if sunos; then
5336 echocheck "Sun mediaLib"
5337 if test "$_mlib" = auto ; then
5338 _mlib=no
5339 cat > $TMPC << EOF
5340 #include <mlib.h>
5341 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5343 cc_check -lmlib && _mlib=yes
5345 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5346 echores "$_mlib"
5347 fi #if sunos
5350 if irix; then
5351 echocheck "SGI audio"
5352 if test "$_sgiaudio" = auto ; then
5353 # check for SGI audio
5354 cat > $TMPC << EOF
5355 #include <dmedia/audio.h>
5356 int main(void) { return 0; }
5358 _sgiaudio=no
5359 cc_check && _sgiaudio=yes
5361 if test "$_sgiaudio" = "yes" ; then
5362 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5363 _libs_mplayer="$_libs_mplayer -laudio"
5364 _aosrc="$_aosrc ao_sgi.c"
5365 _aomodules="sgi $_aomodules"
5366 else
5367 _def_sgiaudio='#undef USE_SGI_AUDIO'
5368 _noaomodules="sgi $_noaomodules"
5370 echores "$_sgiaudio"
5371 fi #if irix
5374 echocheck "VCD support"
5375 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5376 _inputmodules="vcd $_inputmodules"
5377 _def_vcd='#define HAVE_VCD 1'
5378 _vcd="yes"
5379 else
5380 _def_vcd='#undef HAVE_VCD'
5381 _noinputmodules="vcd $_noinputmodules"
5382 _res_comment="not supported on this OS"
5383 _vcd="no"
5385 echores "$_vcd"
5389 echocheck "dvdread"
5390 if test "$_dvdread_internal" = auto ; then
5391 _dvdread_internal=no
5392 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5393 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5394 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5395 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5396 _dvdread_internal=yes
5397 _dvdread=yes
5399 elif test "$_dvdread" = auto ; then
5400 _dvdread=no
5401 if test "$_dl" = yes; then
5402 cat > $TMPC << EOF
5403 #include <inttypes.h>
5404 #include <dvdread/dvd_reader.h>
5405 #include <dvdread/ifo_types.h>
5406 #include <dvdread/ifo_read.h>
5407 #include <dvdread/nav_read.h>
5408 int main(void) { return 0; }
5410 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5411 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5415 if test "$_dvdread_internal" = yes; then
5416 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5417 _def_dvdread='#define USE_DVDREAD 1'
5418 _inputmodules="dvdread(internal) $_inputmodules"
5419 _largefiles=yes
5420 _res_comment="internal"
5421 elif test "$_dvdread" = yes; then
5422 _def_dvdread='#define USE_DVDREAD 1'
5423 _largefiles=yes
5424 _ld_extra="$_ld_extra -ldvdread"
5425 _inputmodules="dvdread(external) $_inputmodules"
5426 _res_comment="external"
5427 else
5428 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5429 _def_dvdread='#undef USE_DVDREAD'
5430 _noinputmodules="dvdread $_noinputmodules"
5432 echores "$_dvdread"
5435 echocheck "internal libdvdcss"
5436 if test "$_libdvdcss_internal" = auto ; then
5437 _libdvdcss_internal=no
5438 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5440 if test "$_libdvdcss_internal" = yes ; then
5441 if linux || netbsd || openbsd || bsdos ; then
5442 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5443 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5444 elif freebsd ; then
5445 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5446 elif darwin ; then
5447 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5448 _ld_extra="$_ld_extra -framework IOKit"
5450 _inputmodules="libdvdcss(internal) $_inputmodules"
5451 _largefiles=yes
5452 else
5453 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5455 echores "$_libdvdcss_internal"
5458 echocheck "cdparanoia"
5459 if test "$_cdparanoia" = auto ; then
5460 cat > $TMPC <<EOF
5461 #include <cdda_interface.h>
5462 #include <cdda_paranoia.h>
5463 // This need a better test. How ?
5464 int main(void) {
5465 void *test = cdda_verbose_set;
5466 return test == (void *)1;
5469 _cdparanoia=no
5470 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5471 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5472 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5473 done
5475 if test "$_cdparanoia" = yes ; then
5476 _cdda='yes'
5477 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5478 openbsd && _ld_extra="$_ld_extra -lutil"
5480 echores "$_cdparanoia"
5483 echocheck "libcdio"
5484 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5485 cat > $TMPC << EOF
5486 #include <stdio.h>
5487 #include <cdio/version.h>
5488 #include <cdio/cdda.h>
5489 #include <cdio/paranoia.h>
5490 int main(void)
5492 void *test = cdda_verbose_set;
5493 printf("%s\n", CDIO_VERSION);
5494 return test == (void *)1;
5498 _libcdio=no
5499 for _ld_tmp in "" "-lwinmm" ; do
5500 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5501 cc_check $_ld_tmp $_ld_lm \
5502 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5503 done
5504 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5505 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5506 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5507 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5508 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5511 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5512 _cdda='yes'
5513 _def_libcdio='#define HAVE_LIBCDIO'
5514 _def_havelibcdio='yes'
5515 else
5516 if test "$_cdparanoia" = yes ; then
5517 _res_comment="using cdparanoia"
5519 _def_libcdio='#undef HAVE_LIBCDIO'
5520 _def_havelibcdio='no'
5522 echores "$_libcdio"
5524 if test "$_cdda" = yes ; then
5525 test $_cddb = auto && test $_network = yes && _cddb=yes
5526 _def_cdparanoia='#define HAVE_CDDA'
5527 _inputmodules="cdda $_inputmodules"
5528 else
5529 _def_cdparanoia='#undef HAVE_CDDA'
5530 _noinputmodules="cdda $_noinputmodules"
5533 if test "$_cddb" = yes ; then
5534 _def_cddb='#define HAVE_CDDB'
5535 _inputmodules="cddb $_inputmodules"
5536 else
5537 _cddb=no
5538 _def_cddb='#undef HAVE_CDDB'
5539 _noinputmodules="cddb $_noinputmodules"
5542 echocheck "bitmap font support"
5543 if test "$_bitmap_font" = yes ; then
5544 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5545 else
5546 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5548 echores "$_bitmap_font"
5551 echocheck "freetype >= 2.0.9"
5553 # freetype depends on iconv
5554 if test "$_iconv" = no ; then
5555 _freetype=no
5556 _res_comment="iconv support needed"
5559 if test "$_freetype" = auto ; then
5560 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5561 cat > $TMPC << EOF
5562 #include <stdio.h>
5563 #include <ft2build.h>
5564 #include FT_FREETYPE_H
5565 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5566 #error "Need FreeType 2.0.9 or newer"
5567 #endif
5568 int main(void)
5570 FT_Library library;
5571 FT_Int major=-1,minor=-1,patch=-1;
5572 int err=FT_Init_FreeType(&library);
5573 if(err){
5574 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5575 exit(err);
5577 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5578 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5579 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5580 (int)major,(int)minor,(int)patch );
5581 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5582 printf("Library and header version mismatch! Fix it in your distribution!\n");
5583 exit(1);
5585 return 0;
5588 _freetype=no
5589 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5590 else
5591 _freetype=no
5594 if test "$_freetype" = yes ; then
5595 _def_freetype='#define HAVE_FREETYPE'
5596 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5597 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5598 else
5599 _def_freetype='#undef HAVE_FREETYPE'
5601 echores "$_freetype"
5603 if test "$_freetype" = no ; then
5604 _fontconfig=no
5605 _res_comment="freetype support needed"
5607 echocheck "fontconfig"
5608 if test "$_fontconfig" = auto ; then
5609 cat > $TMPC << EOF
5610 #include <stdio.h>
5611 #include <fontconfig/fontconfig.h>
5612 int main(void)
5614 int err = FcInit();
5615 if(err == FcFalse){
5616 printf("Couldn't initialize fontconfig lib\n");
5617 exit(err);
5619 return 0;
5623 _fontconfig=no
5624 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5625 _ld_tmp="-lfontconfig $_ld_tmp"
5626 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5627 done
5628 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5629 _inc_tmp=`$_pkg_config --cflags fontconfig`
5630 _ld_tmp=`$_pkg_config --libs fontconfig`
5631 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5632 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5635 if test "$_fontconfig" = yes ; then
5636 _def_fontconfig='#define HAVE_FONTCONFIG'
5637 else
5638 _def_fontconfig='#undef HAVE_FONTCONFIG'
5640 echores "$_fontconfig"
5643 echocheck "SSA/ASS support"
5644 # libass depends on FreeType
5645 if test "$_freetype" = no ; then
5646 _ass=no
5647 _res_comment="FreeType support needed"
5650 if test "$_ass" = auto ; then
5651 cat > $TMPC << EOF
5652 #include <ft2build.h>
5653 #include FT_FREETYPE_H
5654 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5655 #error "Need FreeType 2.1.8 or newer"
5656 #endif
5657 int main(void) { return 0; }
5659 _ass=no
5660 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5661 if test "$_ass" = no ; then
5662 _res_comment="FreeType >= 2.1.8 needed"
5665 if test "$_ass" = yes ; then
5666 _def_ass='#define USE_ASS'
5667 else
5668 _def_ass='#undef USE_ASS'
5670 echores "$_ass"
5673 echocheck "fribidi with charsets"
5674 if test "$_fribidi" = auto ; then
5675 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5676 cat > $TMPC << EOF
5677 #include <stdio.h>
5678 /* workaround for fribidi 0.10.4 and below */
5679 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5680 #include <fribidi/fribidi.h>
5681 int main(void)
5683 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5684 printf("Fribidi headers are not consistents with the library!\n");
5685 exit(1);
5687 return 0;
5690 _fribidi=no
5691 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5692 else
5693 _fribidi=no
5696 if test "$_fribidi" = yes ; then
5697 _def_fribidi='#define USE_FRIBIDI'
5698 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5699 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5700 else
5701 _def_fribidi='#undef USE_FRIBIDI'
5703 echores "$_fribidi"
5706 echocheck "ENCA"
5707 if test "$_enca" = auto ; then
5708 cat > $TMPC << EOF
5709 #include <enca.h>
5710 int main(void)
5712 const char **langs;
5713 size_t langcnt;
5714 langs = enca_get_languages(&langcnt);
5715 return 0;
5718 _enca=no
5719 cc_check -lenca $_ld_lm && _enca=yes
5721 if test "$_enca" = yes ; then
5722 _def_enca='#define HAVE_ENCA 1'
5723 _ld_extra="$_ld_extra -lenca"
5724 else
5725 _def_enca='#undef HAVE_ENCA'
5727 echores "$_enca"
5730 echocheck "zlib"
5731 cat > $TMPC << EOF
5732 #include <zlib.h>
5733 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5735 _zlib=no
5736 cc_check -lz && _zlib=yes
5737 if test "$_zlib" = yes ; then
5738 _def_zlib='#define HAVE_ZLIB 1'
5739 _ld_extra="$_ld_extra -lz"
5740 else
5741 _def_zlib='#undef HAVE_ZLIB'
5742 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5743 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5745 echores "$_zlib"
5748 echocheck "RTC"
5749 if test "$_rtc" = auto ; then
5750 cat > $TMPC << EOF
5751 #include <sys/ioctl.h>
5752 #ifdef __linux__
5753 #include <linux/rtc.h>
5754 #else
5755 #include <rtc.h>
5756 #define RTC_PIE_ON RTCIO_PIE_ON
5757 #endif
5758 int main(void) { return RTC_PIE_ON; }
5760 _rtc=no
5761 cc_check && _rtc=yes
5762 ppc && _rtc=no
5764 if test "$_rtc" = yes ; then
5765 _def_rtc='#define HAVE_RTC 1'
5766 else
5767 _def_rtc='#undef HAVE_RTC'
5769 echores "$_rtc"
5772 echocheck "liblzo2 support"
5773 if test "$_liblzo" = auto ; then
5774 _liblzo=no
5775 cat > $TMPC << EOF
5776 #include <lzo/lzo1x.h>
5777 int main(void) { lzo_init();return 0; }
5779 cc_check -llzo2 && _liblzo=yes
5781 if test "$_liblzo" = yes ; then
5782 _def_liblzo='#define USE_LIBLZO 1'
5783 _ld_extra="$_ld_extra -llzo2"
5784 _codecmodules="liblzo $_codecmodules"
5785 else
5786 _def_liblzo='#undef USE_LIBLZO'
5787 _nocodecmodules="liblzo $_nocodecmodules"
5789 echores "$_liblzo"
5792 echocheck "mad support"
5793 if test "$_mad" = auto ; then
5794 _mad=no
5795 cat > $TMPC << EOF
5796 #include <mad.h>
5797 int main(void) { return 0; }
5799 cc_check -lmad && _mad=yes
5801 if test "$_mad" = yes ; then
5802 _def_mad='#define USE_LIBMAD 1'
5803 _ld_extra="$_ld_extra -lmad"
5804 _codecmodules="libmad $_codecmodules"
5805 else
5806 _def_mad='#undef USE_LIBMAD'
5807 _nocodecmodules="libmad $_nocodecmodules"
5809 echores "$_mad"
5811 echocheck "Twolame"
5812 if test "$_twolame" = auto ; then
5813 cat > $TMPC <<EOF
5814 #include <twolame.h>
5815 int main(void) { twolame_init(); return 0; }
5817 _twolame=no
5818 cc_check -ltwolame $_ld_lm && _twolame=yes
5820 if test "$_twolame" = yes ; then
5821 _def_twolame='#define HAVE_TWOLAME 1'
5822 _libs_mencoder="$_libs_mencoder -ltwolame"
5823 _codecmodules="twolame $_codecmodules"
5824 else
5825 _def_twolame='#undef HAVE_TWOLAME'
5826 _nocodecmodules="twolame $_nocodecmodules"
5828 echores "$_twolame"
5830 echocheck "Toolame"
5831 if test "$_toolame" = auto ; then
5832 _toolame=no
5833 if test "$_twolame" = yes ; then
5834 _res_comment="disabled by twolame"
5835 else
5836 cat > $TMPC <<EOF
5837 #include <toolame.h>
5838 int main(void) { toolame_init(); return 0; }
5840 cc_check -ltoolame $_ld_lm && _toolame=yes
5843 if test "$_toolame" = yes ; then
5844 _def_toolame='#define HAVE_TOOLAME 1'
5845 _libs_mencoder="$_libs_mencoder -ltoolame"
5846 _codecmodules="toolame $_codecmodules"
5847 else
5848 _def_toolame='#undef HAVE_TOOLAME'
5849 _nocodecmodules="toolame $_nocodecmodules"
5851 if test "$_toolamedir" ; then
5852 _res_comment="using $_toolamedir"
5854 echores "$_toolame"
5856 echocheck "OggVorbis support"
5857 if test "$_tremor_internal" = yes; then
5858 _libvorbis=no
5859 elif test "$_tremor_external" = auto; then
5860 _tremor_external=no
5861 cat > $TMPC << EOF
5862 #include <tremor/ivorbiscodec.h>
5863 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5865 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5867 if test "$_libvorbis" = auto; then
5868 _libvorbis=no
5869 cat > $TMPC << EOF
5870 #include <vorbis/codec.h>
5871 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5873 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5875 if test "$_tremor_internal" = yes ; then
5876 _vorbis=yes
5877 _def_vorbis='#define HAVE_OGGVORBIS 1'
5878 _def_tremor='#define TREMOR 1'
5879 _codecmodules="tremor(internal) $_codecmodules"
5880 _res_comment="internal Tremor"
5881 if test "$_tremor_low" = yes ; then
5882 _res_comment="internal low accuracy Tremor"
5884 elif test "$_tremor_external" = yes ; then
5885 _vorbis=yes
5886 _def_vorbis='#define HAVE_OGGVORBIS 1'
5887 _def_tremor='#define TREMOR 1'
5888 _codecmodules="tremor(external) $_codecmodules"
5889 _res_comment="external Tremor"
5890 _ld_extra="$_ld_extra -logg -lvorbisidec"
5891 elif test "$_libvorbis" = yes ; then
5892 _vorbis=yes
5893 _def_vorbis='#define HAVE_OGGVORBIS 1'
5894 _codecmodules="libvorbis $_codecmodules"
5895 _res_comment="libvorbis"
5896 _ld_extra="$_ld_extra -lvorbis -logg"
5897 else
5898 _vorbis=no
5899 _nocodecmodules="libvorbis $_nocodecmodules"
5901 if test "$_libvorbis" = no ; then
5902 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5904 echores "$_vorbis"
5906 echocheck "libspeex (version >= 1.1 required)"
5907 if test "$_speex" = auto ; then
5908 _speex=no
5909 cat > $TMPC << EOF
5910 #include <speex/speex.h>
5911 int main(void) {
5912 SpeexBits bits;
5913 void *dec;
5914 speex_decode_int(dec, &bits, dec);
5917 cc_check -lspeex $_ld_lm && _speex=yes
5919 if test "$_speex" = yes ; then
5920 _def_speex='#define HAVE_SPEEX 1'
5921 _ld_extra="$_ld_extra -lspeex"
5922 _codecmodules="speex $_codecmodules"
5923 else
5924 _def_speex='#undef HAVE_SPEEX'
5925 _nocodecmodules="speex $_nocodecmodules"
5927 echores "$_speex"
5929 echocheck "OggTheora support"
5930 if test "$_theora" = auto ; then
5931 _theora=no
5932 cat > $TMPC << EOF
5933 #include <theora/theora.h>
5934 #include <string.h>
5935 int main(void)
5937 /* theora is in flux, make sure that all interface routines and
5938 * datatypes exist and work the way we expect it, so we don't break
5939 * mplayer */
5940 ogg_packet op;
5941 theora_comment tc;
5942 theora_info inf;
5943 theora_state st;
5944 yuv_buffer yuv;
5945 int r;
5946 double t;
5948 theora_info_init (&inf);
5949 theora_comment_init (&tc);
5951 return 0;
5953 /* we don't want to execute this kind of nonsense; just for making sure
5954 * that compilation works... */
5955 memset(&op, 0, sizeof(op));
5956 r = theora_decode_header (&inf, &tc, &op);
5957 r = theora_decode_init (&st, &inf);
5958 t = theora_granule_time (&st, op.granulepos);
5959 r = theora_decode_packetin (&st, &op);
5960 r = theora_decode_YUVout (&st, &yuv);
5961 theora_clear (&st);
5963 return 0;
5966 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5967 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5968 && _theora=yes && break
5969 done
5970 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5971 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5972 cc_check -I. tremor/bitwise.c $_ld_theora \
5973 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5974 done
5977 if test "$_theora" = yes ; then
5978 _def_theora='#define HAVE_OGGTHEORA 1'
5979 _codecmodules="libtheora $_codecmodules"
5980 # when --enable-theora is forced, we'd better provide a probably sane
5981 # $_ld_theora than nothing
5982 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5983 else
5984 _def_theora='#undef HAVE_OGGTHEORA'
5985 _nocodecmodules="libtheora $_nocodecmodules"
5987 echores "$_theora"
5989 echocheck "internal mp3lib support"
5990 if test "$_mp3lib" = yes ; then
5991 _def_mp3lib='#define USE_MP3LIB 1'
5992 _codecmodules="mp3lib $_codecmodules"
5993 else
5994 _def_mp3lib='#undef USE_MP3LIB'
5995 _nocodecmodules="mp3lib $_nocodecmodules"
5997 echores "$_mp3lib"
5999 echocheck "internal liba52 support"
6000 if test "$_liba52" = yes ; then
6001 _def_liba52='#define USE_LIBA52 1'
6002 _codecmodules="liba52 $_codecmodules"
6003 else
6004 _def_liba52='#undef USE_LIBA52'
6005 _nocodecmodules="liba52 $_nocodecmodules"
6007 echores "$_liba52"
6009 echocheck "libdca support"
6010 if test "$_libdca" = auto ; then
6011 _libdca=no
6012 cat > $TMPC << EOF
6013 #include <inttypes.h>
6014 #include <dts.h>
6015 int main(void) { dts_init (0); return 0; }
6017 for _ld_dca in -ldts -ldca ; do
6018 cc_check $_ld_dca $_ld_lm && _ld_extra="$_ld_extra $_ld_dca" \
6019 && _libdca=yes && break
6020 done
6022 if test "$_libdca" = yes ; then
6023 _def_libdca='#define USE_LIBDCA 1'
6024 _codecmodules="libdca $_codecmodules"
6025 else
6026 _def_libdca='#undef USE_LIBDCA'
6027 _nocodecmodules="libdca $_nocodecmodules"
6029 echores "$_libdca"
6031 echocheck "internal libmpeg2 support"
6032 if test "$_libmpeg2" = auto ; then
6033 _libmpeg2=yes
6034 if alpha && test cc_vendor=gnu; then
6035 case $cc_version in
6036 2*|3.0*|3.1*) # cannot compile MVI instructions
6037 _libmpeg2=no
6038 _res_comment="broken gcc"
6040 esac
6043 if test "$_libmpeg2" = yes ; then
6044 _def_libmpeg2='#define USE_LIBMPEG2 1'
6045 _codecmodules="libmpeg2 $_codecmodules"
6046 else
6047 _def_libmpeg2='#undef USE_LIBMPEG2'
6048 _nocodecmodules="libmpeg2 $_nocodecmodules"
6050 echores "$_libmpeg2"
6052 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6053 if test "$_musepack" = auto ; then
6054 _musepack=no
6055 cat > $TMPC << EOF
6056 #include <mpcdec/mpcdec.h>
6057 int main(void) {
6058 mpc_streaminfo info;
6059 mpc_decoder decoder;
6060 mpc_decoder_set_streaminfo(&decoder, &info);
6061 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6064 cc_check -lmpcdec $_ld_lm && _musepack=yes
6066 if test "$_musepack" = yes ; then
6067 _def_musepack='#define HAVE_MUSEPACK 1'
6068 _ld_extra="$_ld_extra -lmpcdec"
6069 _codecmodules="musepack $_codecmodules"
6070 else
6071 _def_musepack='#undef HAVE_MUSEPACK'
6072 _nocodecmodules="musepack $_nocodecmodules"
6074 echores "$_musepack"
6077 echocheck "FAAC (AAC encoder) support"
6078 if test "$_faac" = auto ; then
6079 cat > $TMPC <<EOF
6080 #include <inttypes.h>
6081 #include <faac.h>
6082 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6084 _faac=no
6085 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6086 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6087 done
6089 if test "$_faac" = yes ; then
6090 _def_faac="#define HAVE_FAAC 1"
6091 if echo $_libavencoders | grep -q FAAC ; then
6092 _lavc_faac=yes
6093 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
6094 _libs_mplayer="$_libs_mplayer $_ld_faac"
6095 else
6096 _lavc_faac=no
6097 _def_lavc_faac="#undef CONFIG_LIBFAAC"
6099 _codecmodules="faac $_codecmodules"
6100 else
6101 _def_faac="#undef HAVE_FAAC"
6102 _nocodecmodules="faac $_nocodecmodules"
6103 _libavencoders=`echo $_libavencoders | sed -e s/LIBFAAC_ENCODER// `
6105 echores "$_faac (in libavcodec: $_lavc_faac)"
6108 echocheck "FAAD2 (AAC) support"
6109 if test "$_faad_internal" = auto ; then
6110 if x86_32 && test cc_vendor=gnu; then
6111 case $cc_version in
6112 3.1*|3.2) # ICE/insn with these versions
6113 _faad_internal=no
6114 _res_comment="broken gcc"
6117 _faad_internal=yes
6119 esac
6120 else
6121 _faad_internal=yes
6123 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6124 _faad_external=no
6125 cat > $TMPC << EOF
6126 #include <faad.h>
6127 #ifndef FAAD_MIN_STREAMSIZE
6128 #error Too old version
6129 #endif
6130 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6132 cc_check -lfaad $_ld_lm && _faad_external=yes
6135 if test "$_faad_internal" = yes ; then
6136 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6137 _faad=yes
6138 _res_comment="internal floating-point"
6139 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
6140 elif test "$_faad_external" = yes ; then
6141 _faad=yes
6142 _ld_extra="$_ld_extra -lfaad"
6143 else
6144 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6145 _faad=no
6148 if test "$_faad" = yes ; then
6149 _def_faad='#define HAVE_FAAD 1'
6150 _codecmodules="faad2 $_codecmodules"
6151 else
6152 _def_faad='#undef HAVE_FAAD'
6153 _nocodecmodules="faad2 $_nocodecmodules"
6155 echores "$_faad"
6158 echocheck "LADSPA plugin support"
6159 if test "$_ladspa" = auto ; then
6160 cat > $TMPC <<EOF
6161 #include <stdio.h>
6162 #include <ladspa.h>
6163 int main(void) {
6164 const LADSPA_Descriptor *ld = NULL;
6165 return 0;
6168 _ladspa=no
6169 cc_check && _ladspa=yes
6171 if test "$_ladspa" = yes; then
6172 _def_ladspa="#define HAVE_LADSPA"
6173 _afsrc="$_afsrc af_ladspa.c"
6174 _afmodules="ladspa $_afmodules"
6175 else
6176 _def_ladspa="#undef HAVE_LADSPA"
6177 _noafmodules="ladspa $_noafmodules"
6179 echores "$_ladspa"
6182 if test -z "$_codecsdir" ; then
6183 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6184 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6185 if test -d "$dir" ; then
6186 _codecsdir="$dir"
6187 break;
6189 done
6191 # Fall back on default directory.
6192 if test -z "$_codecsdir" ; then
6193 _codecsdir="$_libdir/codecs"
6194 mingw32 && _codecsdir="codecs"
6195 os2 && _codecsdir="codecs"
6199 echocheck "Win32 codecs"
6200 if test "$_win32dll" = auto ; then
6201 _win32dll=no
6202 if x86_32 && ! qnx; then
6203 _win32dll=yes
6206 if test "$_win32dll" = yes ; then
6207 _def_win32dll='#define USE_WIN32DLL 1'
6208 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6209 _res_comment="using $_win32codecsdir"
6210 if ! win32 ; then
6211 _def_win32_loader='#define WIN32_LOADER 1'
6212 else
6213 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6214 _res_comment="using native windows"
6216 _codecmodules="win32 $_codecmodules"
6217 else
6218 _def_win32dll='#undef USE_WIN32DLL'
6219 _def_win32_loader='#undef WIN32_LOADER'
6220 _nocodecmodules="win32 $_nocodecmodules"
6222 echores "$_win32dll"
6225 echocheck "XAnim codecs"
6226 if test "$_xanim" = auto ; then
6227 _xanim=no
6228 _res_comment="dynamic loader support needed"
6229 if test "$_dl" = yes ; then
6230 _xanim=yes
6233 if test "$_xanim" = yes ; then
6234 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6235 _def_xanim='#define USE_XANIM 1'
6236 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6237 _codecmodules="xanim $_codecmodules"
6238 _res_comment="using $_xanimcodecsdir"
6239 else
6240 _def_xanim='#undef USE_XANIM'
6241 _def_xanim_path='#undef XACODEC_PATH'
6242 _nocodecmodules="xanim $_nocodecmodules"
6244 echores "$_xanim"
6247 echocheck "RealPlayer codecs"
6248 if test "$_real" = auto ; then
6249 _real=no
6250 _res_comment="dynamic loader support needed"
6251 if test "$_dl" = yes || test "$_win32dll" = yes &&
6252 (linux || freebsd || netbsd || win32 || darwin) ; then
6253 _real=yes
6256 if test "$_real" = yes ; then
6257 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6258 _def_real='#define USE_REALCODECS 1'
6259 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6260 _codecmodules="real $_codecmodules"
6261 _res_comment="using $_realcodecsdir"
6262 else
6263 _def_real='#undef USE_REALCODECS'
6264 _def_real_path="#undef REALCODEC_PATH"
6265 _nocodecmodules="real $_nocodecmodules"
6267 echores "$_real"
6270 echocheck "QuickTime codecs"
6271 if test "$_qtx" = auto ; then
6272 test "$_win32dll" = yes || darwin && _qtx=yes
6274 if test "$_qtx" = yes ; then
6275 _def_qtx='#define USE_QTX_CODECS 1'
6276 _codecmodules="qtx $_codecmodules"
6277 else
6278 _def_qtx='#undef USE_QTX_CODECS'
6279 _nocodecmodules="qtx $_nocodecmodules"
6281 echores "$_qtx"
6283 echocheck "Nemesi Streaming Media libraries"
6284 if test "$_nemesi" = auto && test "$_network" = yes ; then
6285 _nemesi=no
6286 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6287 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6288 _nemesi=yes
6291 if test "$_nemesi" = yes; then
6292 _native_rtsp=no
6293 _def_nemesi='#define LIBNEMESI 1'
6294 _inputmodules="nemesi $_inputmodules"
6295 else
6296 _native_rtsp="$_network"
6297 _nemesi=no
6298 _def_nemesi='#undef LIBNEMESI'
6299 _noinputmodules="nemesi $_noinputmodules"
6301 echores "$_nemesi"
6303 echocheck "LIVE555 Streaming Media libraries"
6304 if test "$_live" = auto && test "$_network" = yes ; then
6305 cat > $TMPCPP << EOF
6306 #include <liveMedia.hh>
6307 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6308 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6309 #endif
6310 int main(void) {}
6313 _live=no
6314 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6315 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6316 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6317 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6318 $_livelibdir/groupsock/libgroupsock.a \
6319 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6320 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6321 $_ld_extra -lstdc++" \
6322 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6323 -I$_livelibdir/UsageEnvironment/include \
6324 -I$_livelibdir/BasicUsageEnvironment/include \
6325 -I$_livelibdir/groupsock/include" && \
6326 _live=yes && break
6327 done
6328 if test "$_live" != yes ; then
6329 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6330 _live_dist=yes
6334 if test "$_live" = yes && test "$_network" = yes; then
6335 _res_comment="using $_livelibdir"
6336 _def_live='#define STREAMING_LIVE555 1'
6337 _inputmodules="live555 $_inputmodules"
6338 elif test "$_live_dist" = yes && test "$_network" = yes; then
6339 _res_comment="using distribution version"
6340 _live="yes"
6341 _def_live='#define STREAMING_LIVE555 1'
6342 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6343 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6344 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6345 _inputmodules="live555 $_inputmodules"
6346 else
6347 _live=no
6348 _def_live='#undef STREAMING_LIVE555'
6349 _noinputmodules="live555 $_noinputmodules"
6351 echores "$_live"
6354 echocheck "FFmpeg libavutil"
6355 if test "$_libavutil_a" = auto ; then
6356 if test -d libavutil ; then
6357 _libavutil_a=yes
6358 _res_comment="static"
6359 else
6360 die "MPlayer will not compile without libavutil in the source tree."
6362 elif test "$_libavutil_so" = auto ; then
6363 _libavutil_so=no
6364 cat > $TMPC << EOF
6365 #include <libavutil/common.h>
6366 int main(void) { ff_gcd(1,1); return 0; }
6368 if $_pkg_config --exists libavutil ; then
6369 _inc_libavutil=`$_pkg_config --cflags libavutil`
6370 _ld_tmp=`$_pkg_config --libs libavutil`
6371 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6372 && _libavutil_so=yes
6373 elif cc_check -lavutil $_ld_lm ; then
6374 _ld_extra="$_ld_extra -lavutil"
6375 _libavutil_so=yes
6376 _res_comment="using libavutil.so, but static libavutil is recommended"
6379 _libavutil=no
6380 _def_libavutil='#undef USE_LIBAVUTIL'
6381 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6382 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6383 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6384 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6385 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6386 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6387 # neither static nor shared libavutil is available, but it is mandatory ...
6388 if test "$_libavutil" = no ; then
6389 die "You need static or shared libavutil, MPlayer will not compile without!"
6391 echores "$_libavutil"
6393 echocheck "FFmpeg libavcodec"
6394 if test "$_libavcodec_a" = auto ; then
6395 _libavcodec_a=no
6396 if test -d libavcodec && test -f libavcodec/utils.c ; then
6397 _libavcodec_a="yes"
6398 _res_comment="static"
6400 elif test "$_libavcodec_so" = auto ; then
6401 _libavcodec_so=no
6402 _res_comment="libavcodec.so is discouraged over static libavcodec"
6403 cat > $TMPC << EOF
6404 #include <libavcodec/avcodec.h>
6405 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6407 if $_pkg_config --exists libavcodec ; then
6408 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6409 _ld_tmp=`$_pkg_config --libs libavcodec`
6410 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6411 && _libavcodec_so=yes
6412 elif cc_check -lavcodec $_ld_lm ; then
6413 _ld_extra="$_ld_extra -lavcodec"
6414 _libavcodec_so=yes
6415 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6418 _libavcodec=no
6419 _def_libavcodec='#undef USE_LIBAVCODEC'
6420 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6421 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6422 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6423 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6424 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6425 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6426 test "$_libavcodec_mpegaudio_hp" = yes \
6427 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6428 if test "$_libavcodec_a" = yes ; then
6429 _codecmodules="libavcodec $_codecmodules"
6430 elif test "$_libavcodec_so" = yes ; then
6431 _codecmodules="libavcodec.so $_codecmodules"
6432 else
6433 _nocodecmodules="libavcodec $_nocodecmodules"
6435 echores "$_libavcodec"
6437 echocheck "FFmpeg libavformat"
6438 if test "$_libavformat_a" = auto ; then
6439 _libavformat_a=no
6440 if test -d libavformat && test -f libavformat/utils.c ; then
6441 _libavformat_a=yes
6442 _res_comment="static"
6444 elif test "$_libavformat_so" = auto ; then
6445 _libavformat_so=no
6446 cat > $TMPC <<EOF
6447 #include <libavformat/avformat.h>
6448 #include <libavcodec/opt.h>
6449 int main(void) { av_alloc_format_context(); return 0; }
6451 if $_pkg_config --exists libavformat ; then
6452 _inc_libavformat=`$_pkg_config --cflags libavformat`
6453 _ld_tmp=`$_pkg_config --libs libavformat`
6454 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6455 && _libavformat_so=yes
6456 elif cc_check $_ld_lm -lavformat ; then
6457 _ld_extra="$_ld_extra -lavformat"
6458 _libavformat_so=yes
6459 _res_comment="using libavformat.so, but static libavformat is recommended"
6462 _libavformat=no
6463 _def_libavformat='#undef USE_LIBAVFORMAT'
6464 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6465 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6466 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6467 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6468 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6469 test "$_libavformat_so" = yes \
6470 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6471 echores "$_libavformat"
6473 echocheck "FFmpeg libpostproc"
6474 if test "$_libpostproc_a" = auto ; then
6475 _libpostproc_a=no
6476 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6477 _libpostproc_a='yes'
6478 _res_comment="static"
6480 elif test "$_libpostproc_so" = auto ; then
6481 _libpostproc_so=no
6482 cat > $TMPC << EOF
6483 #define USE_LIBPOSTPROC 1
6484 #include <inttypes.h>
6485 #include <libpostproc/postprocess.h>
6486 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6488 if cc_check -lpostproc $_ld_lm ; then
6489 _ld_extra="$_ld_extra -lpostproc"
6490 _libpostproc_so=yes
6491 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6494 _libpostproc=no
6495 _def_libpostproc='#undef USE_LIBPOSTPROC'
6496 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6497 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6498 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6499 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6500 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6501 test "$_libpostproc_so" = yes \
6502 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6503 echores "$_libpostproc"
6506 echocheck "libamr narrowband"
6507 if test "$_libamr_nb" = auto ; then
6508 _libamr_nb=no
6509 cat > $TMPC << EOF
6510 #include <amrnb/interf_dec.h>
6511 int main(void) { Speech_Decode_Frame_init(); return 0; }
6513 cc_check -lamrnb && _libamr_nb=yes
6514 if test "$_libavcodec_a" != yes ; then
6515 _libamr_nb=no
6516 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6519 if test "$_libamr_nb" = yes ; then
6520 _libamr=yes
6521 _ld_extra="$_ld_extra -lamrnb"
6522 _def_libamr='#define CONFIG_LIBAMR 1'
6523 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6524 _codecmodules="libamr_nb $_codecmodules"
6525 else
6526 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6527 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6528 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6529 _nocodecmodules="libamr_nb $_nocodecmodules"
6531 echores "$_libamr_nb"
6534 echocheck "libamr wideband"
6535 if test "$_libamr_wb" = auto ; then
6536 _libamr_wb=no
6537 cat > $TMPC << EOF
6538 #include <amrwb/dec_if.h>
6539 int main(void) { D_IF_init(); return 0; }
6541 cc_check -lamrwb && _libamr_wb=yes
6542 if test "$_libavcodec_a" != yes ; then
6543 _libamr_wb=no
6544 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6547 if test "$_libamr_wb" = yes ; then
6548 _libamr=yes
6549 _ld_extra="$_ld_extra -lamrwb"
6550 _def_libamr='#define CONFIG_LIBAMR 1'
6551 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6552 _codecmodules="libamr_wb $_codecmodules"
6553 else
6554 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6555 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6556 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6557 _nocodecmodules="libamr_wb $_nocodecmodules"
6559 echores "$_libamr_wb"
6561 echocheck "libdv-0.9.5+"
6562 if test "$_libdv" = auto ; then
6563 _libdv=no
6564 cat > $TMPC <<EOF
6565 #include <libdv/dv.h>
6566 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6568 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6570 if test "$_libdv" = yes ; then
6571 _def_libdv='#define HAVE_LIBDV095 1'
6572 _ld_extra="$_ld_extra -ldv"
6573 _codecmodules="libdv $_codecmodules"
6574 else
6575 _def_libdv='#undef HAVE_LIBDV095'
6576 _nocodecmodules="libdv $_nocodecmodules"
6578 echores "$_libdv"
6581 echocheck "XviD"
6582 if test "$_xvid" = auto ; then
6583 _xvid=no
6584 cat > $TMPC << EOF
6585 #include <xvid.h>
6586 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6588 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6589 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6590 done
6593 if test "$_xvid" = yes ; then
6594 _def_xvid='#define HAVE_XVID4 1'
6595 _codecmodules="xvid $_codecmodules"
6596 else
6597 _def_xvid='#undef HAVE_XVID4'
6598 _nocodecmodules="xvid $_nocodecmodules"
6599 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6601 echores "$_xvid"
6603 if test "$_xvid" = yes ; then
6604 echocheck "XviD two pass plugin"
6605 cat > $TMPC << EOF
6606 #include <xvid.h>
6607 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6609 if cc_check ; then
6610 _lavc_xvid=yes
6611 _def_lavc_xvid='#define CONFIG_LIBXVID 1'
6612 else
6613 _lavc_xvid=no
6614 _def_lavc_xvid='#undef CONFIG_LIBXVID'
6615 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6617 echores "$_lavc_xvid"
6621 echocheck "x264"
6622 if test "$_x264" = auto ; then
6623 cat > $TMPC << EOF
6624 #include <inttypes.h>
6625 #include <x264.h>
6626 #if X264_BUILD < 53
6627 #error We do not support old versions of x264. Get the latest from SVN.
6628 #endif
6629 int main(void) { x264_encoder_open((void*)0); return 0; }
6631 _x264=no
6632 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6633 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6634 done
6637 if test "$_x264" = yes ; then
6638 _def_x264='#define HAVE_X264 1'
6639 _codecmodules="x264 $_codecmodules"
6640 if echo $_libavencoders | grep -q X264 ; then
6641 _lavc_x264=yes
6642 _def_lavc_x264='#define CONFIG_LIBX264 1'
6643 _libs_mplayer="$_libs_mplayer $_ld_x264"
6644 else
6645 _lavc_x264=no
6646 _def_lavc_x264='#undef CONFIG_LIBX264'
6648 else
6649 _lavc_x264=no
6650 _def_x264='#undef HAVE_X264'
6651 _def_lavc_x264='#undef CONFIG_LIBX264'
6652 _nocodecmodules="x264 $_nocodecmodules"
6653 _libavencoders=`echo $_libavencoders | sed -e s/LIBX264_ENCODER// `
6655 echores "$_x264 (in libavcodec: $_lavc_x264)"
6658 echocheck "libnut"
6659 if test "$_libnut" = auto ; then
6660 cat > $TMPC << EOF
6661 #include <stdio.h>
6662 #include <stdlib.h>
6663 #include <inttypes.h>
6664 #include <libnut.h>
6665 int main(void) { (void)nut_error(0); return 0; }
6667 _libnut=no
6668 cc_check -lnut && _libnut=yes
6671 if test "$_libnut" = yes ; then
6672 _def_libnut='#define HAVE_LIBNUT 1'
6673 _ld_extra="$_ld_extra -lnut"
6674 else
6675 _def_libnut='#undef HAVE_LIBNUT'
6676 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6678 echores "$_libnut"
6680 #check must be done after libavcodec one
6681 echocheck "zr"
6682 if test "$_zr" = auto ; then
6683 #36067's seem to identify themselves as 36057PQC's, so the line
6684 #below should work for 36067's and 36057's.
6685 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6686 _zr=yes
6687 else
6688 _zr=no
6691 if test "$_zr" = yes ; then
6692 if test "$_libavcodec_a" = yes ; then
6693 _def_zr='#define HAVE_ZR 1'
6694 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6695 _vomodules="zr zr2 $_vomodules"
6696 else
6697 _res_comment="libavcodec (static) is required by zr, sorry"
6698 _novomodules="zr $_novomodules"
6699 _def_zr='#undef HAVE_ZR'
6701 else
6702 _def_zr='#undef HAVE_ZR'
6703 _novomodules="zr zr2 $_novomodules"
6705 echores "$_zr"
6707 # mencoder requires (optional) those libs: libmp3lame
6708 if test "$_mencoder" != no ; then
6710 echocheck "libmp3lame (for mencoder)"
6711 _mp3lame=no
6712 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6713 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6714 cat > $TMPC <<EOF
6715 #include <lame/lame.h>
6716 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; }
6718 # Note: libmp3lame usually depends on vorbis
6719 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6720 if test "$_mp3lame" = yes ; then
6721 _def_mp3lame="#define HAVE_MP3LAME"
6722 _ld_mp3lame=-lmp3lame
6723 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6724 cat > $TMPC << EOF
6725 #include <lame/lame.h>
6726 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6728 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6729 cat > $TMPC << EOF
6730 #include <lame/lame.h>
6731 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6733 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6734 if echo $_libavencoders | grep -q MP3LAME ; then
6735 _lavc_mp3lame=yes
6736 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6737 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6738 else
6739 _lavc_mp3lame=no
6740 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6742 else
6743 _def_mp3lame='#undef HAVE_MP3LAME'
6744 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6746 echores "$_mp3lame"
6750 echocheck "mencoder"
6751 _mencoder_flag='#undef HAVE_MENCODER'
6752 if test "$_mencoder" = yes ; then
6753 _mencoder_flag='#define HAVE_MENCODER'
6754 _def_muxers='#define CONFIG_MUXERS 1'
6755 else
6756 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6757 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6758 _libavmuxers=""
6760 echores "$_mencoder"
6762 echocheck "fastmemcpy"
6763 # fastmemcpy check is done earlier with tests of CPU & binutils features
6764 if test "$_fastmemcpy" = yes ; then
6765 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6766 else
6767 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6769 echores "$_fastmemcpy"
6772 echocheck "UnRAR executable"
6773 if test "$_unrar_exec" = auto ; then
6774 _unrar_exec="yes"
6775 mingw32 && _unrar_exec="no"
6777 if test "$_unrar_exec" = yes ; then
6778 _def_unrar_exec='#define USE_UNRAR_EXEC 1'
6779 else
6780 _def_unrar_exec='#undef USE_UNRAR_EXEC'
6782 echores "$_unrar_exec"
6784 echocheck "TV interface"
6785 if test "$_tv" = yes ; then
6786 _def_tv='#define USE_TV 1'
6787 _inputmodules="tv $_inputmodules"
6788 else
6789 _noinputmodules="tv $_noinputmodules"
6790 _def_tv='#undef USE_TV'
6792 echores "$_tv"
6795 if bsd; then
6796 echocheck "*BSD BT848 bt8xx header"
6797 _ioctl_bt848_h=no
6798 for file in "machine/ioctl_bt848.h" \
6799 "dev/bktr/ioctl_bt848.h" \
6800 "dev/video/bktr/ioctl_bt848.h" \
6801 "dev/ic/bt8xx.h" ; do
6802 cat > $TMPC <<EOF
6803 #include <sys/types.h>
6804 #include <sys/ioctl.h>
6805 #include <$file>
6806 int main(void) {
6807 ioctl(0, TVTUNER_GETFREQ, 0);
6808 return 0;
6811 if cc_check ; then
6812 _ioctl_bt848_h=yes
6813 _ioctl_bt848_h_name="$file"
6814 break;
6816 done
6817 if test "$_ioctl_bt848_h" = yes ; then
6818 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6819 _res_comment="using $_ioctl_bt848_h_name"
6820 else
6821 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6823 echores "$_ioctl_bt848_h"
6825 echocheck "*BSD ioctl_meteor.h"
6826 _ioctl_meteor_h=no
6827 for file in "machine/ioctl_meteor.h" \
6828 "dev/bktr/ioctl_meteor.h" \
6829 "dev/video/bktr/ioctl_meteor.h" ; do
6830 cat > $TMPC <<EOF
6831 #include <sys/types.h>
6832 #include <$file>
6833 int main(void) {
6834 ioctl(0, METEORSINPUT, 0);
6835 return 0;
6838 if cc_check ; then
6839 _ioctl_meteor_h=yes
6840 _ioctl_meteor_h_name="$file"
6841 break;
6843 done
6844 if test "$_ioctl_meteor_h" = yes ; then
6845 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6846 _res_comment="using $_ioctl_meteor_h_name"
6847 else
6848 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6850 echores "$_ioctl_meteor_h"
6852 echocheck "*BSD BrookTree 848 TV interface"
6853 if test "$_tv_bsdbt848" = auto ; then
6854 _tv_bsdbt848=no
6855 if test "$_tv" = yes ; then
6856 cat > $TMPC <<EOF
6857 #include <sys/types.h>
6858 $_def_ioctl_meteor_h_name
6859 $_def_ioctl_bt848_h_name
6860 #ifdef IOCTL_METEOR_H_NAME
6861 #include IOCTL_METEOR_H_NAME
6862 #endif
6863 #ifdef IOCTL_BT848_H_NAME
6864 #include IOCTL_BT848_H_NAME
6865 #endif
6866 int main(void){
6867 ioctl(0, METEORSINPUT, 0);
6868 ioctl(0, TVTUNER_GETFREQ, 0);
6869 return 0;
6872 cc_check && _tv_bsdbt848=yes
6875 if test "$_tv_bsdbt848" = yes ; then
6876 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6877 _inputmodules="tv-bsdbt848 $_inputmodules"
6878 else
6879 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6880 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6882 echores "$_tv_bsdbt848"
6883 fi #if bsd
6886 echocheck "DirectShow TV interface"
6887 if test "$_tv_dshow" = auto ; then
6888 _tv_dshow=no
6889 if test "$_tv" = yes && win32 ; then
6890 cat > $TMPC <<EOF
6891 #include <ole2.h>
6892 int main(void) {
6893 void* p;
6894 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6895 return 0;
6898 cc_check -lole32 -luuid && _tv_dshow=yes
6901 if test "$_tv_dshow" = yes ; then
6902 _inputmodules="tv-dshow $_inputmodules"
6903 _def_tv_dshow='#define HAVE_TV_DSHOW 1'
6904 _ld_extra="$_ld_extra -lole32 -luuid"
6905 else
6906 _noinputmodules="tv-dshow $_noinputmodules"
6907 _def_tv_dshow='#undef HAVE_TV_DSHOW'
6909 echores "$_tv_dshow"
6912 echocheck "Video 4 Linux TV interface"
6913 if test "$_tv_v4l1" = auto ; then
6914 _tv_v4l1=no
6915 if test "$_tv" = yes && linux ; then
6916 cat > $TMPC <<EOF
6917 #include <stdlib.h>
6918 #include <linux/videodev.h>
6919 int main(void) { return 0; }
6921 cc_check && _tv_v4l1=yes
6924 if test "$_tv_v4l1" = yes ; then
6925 _audio_input=yes
6926 _tv_v4l=yes
6927 _def_tv_v4l='#define HAVE_TV_V4L 1'
6928 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6929 _inputmodules="tv-v4l $_inputmodules"
6930 else
6931 _noinputmodules="tv-v4l1 $_noinputmodules"
6932 _def_tv_v4l='#undef HAVE_TV_V4L'
6934 echores "$_tv_v4l1"
6937 echocheck "Video 4 Linux 2 TV interface"
6938 if test "$_tv_v4l2" = auto ; then
6939 _tv_v4l2=no
6940 if test "$_tv" = yes && linux ; then
6941 cat > $TMPC <<EOF
6942 #include <stdlib.h>
6943 #include <linux/types.h>
6944 #include <linux/videodev2.h>
6945 int main(void) { return 0; }
6947 cc_check && _tv_v4l2=yes
6950 if test "$_tv_v4l2" = yes ; then
6951 _audio_input=yes
6952 _tv_v4l=yes
6953 _def_tv_v4l='#define HAVE_TV_V4L 1'
6954 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6955 _inputmodules="tv-v4l2 $_inputmodules"
6956 else
6957 _noinputmodules="tv-v4l2 $_noinputmodules"
6958 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6960 echores "$_tv_v4l2"
6963 echocheck "TV teletext interface"
6964 if test "$_tv_teletext" = auto ; then
6965 _tv_teletext=no
6966 if test "$_freetype" = yes && test "$_pthreads" = yes; then
6967 if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes; then
6968 _tv_teletext=yes
6972 if test "$_tv_teletext" = yes ; then
6973 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6974 _inputmodules="tv-teletext $_inputmodules"
6975 else
6976 _noinputmodules="tv-teletext $_noinputmodules"
6977 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6979 echores "$_tv_teletext"
6982 echocheck "Radio interface"
6983 if test "$_radio" = yes ; then
6984 _def_radio='#define USE_RADIO 1'
6985 _inputmodules="radio $_inputmodules"
6986 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6987 _radio_capture=no
6989 if test "$_radio_capture" = yes ; then
6990 _audio_input=yes
6991 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6992 else
6993 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6995 else
6996 _noinputmodules="radio $_noinputmodules"
6997 _def_radio='#undef USE_RADIO'
6998 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6999 _radio_capture=no
7001 echores "$_radio"
7002 echocheck "Capture for Radio interface"
7003 echores "$_radio_capture"
7005 echocheck "Video 4 Linux 2 Radio interface"
7006 if test "$_radio_v4l2" = auto ; then
7007 _radio_v4l2=no
7008 if test "$_radio" = yes && linux ; then
7009 cat > $TMPC <<EOF
7010 #include <stdlib.h>
7011 #include <linux/types.h>
7012 #include <linux/videodev2.h>
7013 int main(void) { return 0; }
7015 cc_check && _radio_v4l2=yes
7018 if test "$_radio_v4l2" = yes ; then
7019 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
7020 else
7021 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
7023 echores "$_radio_v4l2"
7025 echocheck "Video 4 Linux Radio interface"
7026 if test "$_radio_v4l" = auto ; then
7027 _radio_v4l=no
7028 if test "$_radio" = yes && linux ; then
7029 cat > $TMPC <<EOF
7030 #include <stdlib.h>
7031 #include <linux/videodev.h>
7032 int main(void) { return 0; }
7034 cc_check && _radio_v4l=yes
7037 if test "$_radio_v4l" = yes ; then
7038 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
7039 else
7040 _def_radio_v4l='#undef HAVE_RADIO_V4L'
7042 echores "$_radio_v4l"
7044 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7045 echocheck "*BSD BrookTree 848 Radio interface"
7046 _radio_bsdbt848=no
7047 cat > $TMPC <<EOF
7048 #include <sys/types.h>
7049 $_def_ioctl_bt848_h_name
7050 #ifdef IOCTL_BT848_H_NAME
7051 #include IOCTL_BT848_H_NAME
7052 #endif
7053 int main(void){
7054 ioctl(0, RADIO_GETFREQ, 0);
7055 return 0;
7058 cc_check && _radio_bsdbt848=yes
7059 echores "$_radio_bsdbt848"
7060 fi #if bsd && radio && radio_bsdbt848
7062 if test "$_radio_bsdbt848" = yes ; then
7063 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
7064 else
7065 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
7068 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7069 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7070 die "Radio driver requires BSD BT848, V4L or V4L2!"
7073 echocheck "Video 4 Linux 2 MPEG PVR interface"
7074 if test "$_pvr" = auto ; then
7075 _pvr=no
7076 if test "$_tv_v4l2" = yes && linux ; then
7077 cat > $TMPC <<EOF
7078 #include <stdlib.h>
7079 #include <inttypes.h>
7080 #include <linux/types.h>
7081 #include <linux/videodev2.h>
7082 int main(void) { struct v4l2_ext_controls ext; return 0; }
7084 cc_check && _pvr=yes
7087 if test "$_pvr" = yes ; then
7088 _def_pvr='#define HAVE_PVR 1'
7089 _inputmodules="pvr $_inputmodules"
7090 else
7091 _noinputmodules="pvr $_noinputmodules"
7092 _def_pvr='#undef HAVE_PVR'
7094 echores "$_pvr"
7097 echocheck "audio select()"
7098 if test "$_select" = no ; then
7099 _def_select='#undef HAVE_AUDIO_SELECT'
7100 elif test "$_select" = yes ; then
7101 _def_select='#define HAVE_AUDIO_SELECT 1'
7103 echores "$_select"
7106 echocheck "ftp"
7107 if ! beos && test "$_ftp" = yes ; then
7108 _def_ftp='#define HAVE_FTP 1'
7109 _inputmodules="ftp $_inputmodules"
7110 else
7111 _noinputmodules="ftp $_noinputmodules"
7112 _def_ftp='#undef HAVE_FTP'
7114 echores "$_ftp"
7116 echocheck "vstream client"
7117 if test "$_vstream" = auto ; then
7118 _vstream=no
7119 cat > $TMPC <<EOF
7120 #include <vstream-client.h>
7121 void vstream_error(const char *format, ... ) {}
7122 int main(void) { vstream_start(); return 0; }
7124 cc_check -lvstream-client && _vstream=yes
7126 if test "$_vstream" = yes ; then
7127 _def_vstream='#define HAVE_VSTREAM 1'
7128 _inputmodules="vstream $_inputmodules"
7129 _ld_extra="$_ld_extra -lvstream-client"
7130 else
7131 _noinputmodules="vstream $_noinputmodules"
7132 _def_vstream='#undef HAVE_VSTREAM'
7134 echores "$_vstream"
7136 # endian testing
7137 echocheck "byte order"
7138 if test "$_big_endian" = auto ; then
7139 cat > $TMPC <<EOF
7140 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7141 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7142 int main(void){
7143 return (int)ascii_name;
7146 if cc_check ; then
7147 if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
7148 _big_endian=yes
7149 else
7150 _big_endian=no
7152 else
7153 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7156 if test "$_big_endian" = yes ; then
7157 _byte_order='big-endian'
7158 _def_words_endian='#define WORDS_BIGENDIAN 1'
7159 else
7160 _byte_order='little-endian'
7161 _def_words_endian='#undef WORDS_BIGENDIAN'
7163 echores "$_byte_order"
7165 echocheck "OSD menu"
7166 if test "$_menu" = yes ; then
7167 _def_menu='#define HAVE_MENU 1'
7168 else
7169 _def_menu='#undef HAVE_MENU'
7171 echores "$_menu"
7174 echocheck "Subtitles sorting"
7175 if test "$_sortsub" = yes ; then
7176 _def_sortsub='#define USE_SORTSUB 1'
7177 else
7178 _def_sortsub='#undef USE_SORTSUB'
7180 echores "$_sortsub"
7183 echocheck "XMMS inputplugin support"
7184 if test "$_xmms" = yes ; then
7185 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7186 _xmmsplugindir=`xmms-config --input-plugin-dir`
7187 _xmmslibdir=`xmms-config --exec-prefix`/lib
7188 else
7189 _xmmsplugindir=/usr/lib/xmms/Input
7190 _xmmslibdir=/usr/lib
7193 _def_xmms='#define HAVE_XMMS 1'
7194 if darwin ; then
7195 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7196 else
7197 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7199 else
7200 _def_xmms='#undef HAVE_XMMS'
7202 echores "$_xmms"
7204 echocheck "inet6"
7205 if test "$_inet6" = auto ; then
7206 cat > $TMPC << EOF
7207 #include <sys/types.h>
7208 #if !defined(_WIN32) || defined(__CYGWIN__)
7209 #include <sys/socket.h>
7210 #include <netinet/in.h>
7211 #else
7212 #include <ws2tcpip.h>
7213 #endif
7214 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7216 _inet6=no
7217 if cc_check $_ld_sock ; then
7218 _inet6=yes
7221 if test "$_inet6" = yes ; then
7222 _def_inet6='#define HAVE_AF_INET6 1'
7223 else
7224 _def_inet6='#undef HAVE_AF_INET6'
7226 echores "$_inet6"
7229 echocheck "gethostbyname2"
7230 if test "$_gethostbyname2" = auto ; then
7231 cat > $TMPC << EOF
7232 #include <sys/types.h>
7233 #include <sys/socket.h>
7234 #include <netdb.h>
7235 int main(void) { gethostbyname2("", AF_INET); }
7237 _gethostbyname2=no
7238 if cc_check ; then
7239 _gethostbyname2=yes
7243 if test "$_gethostbyname2" = yes ; then
7244 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7245 else
7246 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7248 echores "$_gethostbyname2"
7251 # --------------- GUI specific tests begin -------------------
7252 echocheck "GUI"
7253 echo "$_gui"
7254 if test "$_gui" = yes ; then
7256 # Required libraries
7257 if test "$_libavcodec" != yes ||
7258 ! echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1 ; then
7259 die "The GUI requires libavcodec with PNG support (needs zlib)."
7261 test "$_freetype" = no && test "$_bitmap_font" = no && \
7262 die "The GUI requires either FreeType or bitmap font support."
7263 if ! win32 ; then
7264 test "$_x11" != yes && die "X11 support required for GUI compilation."
7266 echocheck "XShape extension"
7267 if test "$_xshape" = auto ; then
7268 _xshape=no
7269 cat > $TMPC << EOF
7270 #include <X11/Xlib.h>
7271 #include <X11/Xproto.h>
7272 #include <X11/Xutil.h>
7273 #include <X11/extensions/shape.h>
7274 #include <stdlib.h>
7275 int main(void) {
7276 char *name = ":0.0";
7277 Display *wsDisplay;
7278 int exitvar = 0;
7279 int eventbase, errorbase;
7280 if (getenv("DISPLAY"))
7281 name=getenv("DISPLAY");
7282 wsDisplay=XOpenDisplay(name);
7283 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7284 exitvar=1;
7285 XCloseDisplay(wsDisplay);
7286 return exitvar;
7289 cc_check -lXext && _xshape=yes
7291 if test "$_xshape" = yes ; then
7292 _def_xshape='#define HAVE_XSHAPE 1'
7293 else
7294 die "The GUI requires the X11 extension XShape (which was not found)."
7296 echores "$_xshape"
7298 #Check for GTK
7299 if test "$_gtk1" = no ; then
7300 #Check for GTK2 :
7301 echocheck "GTK+ version"
7303 if $_pkg_config gtk+-2.0 --exists ; then
7304 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7305 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7306 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7307 echores "$_gtk"
7309 # Check for GLIB2
7310 if $_pkg_config glib-2.0 --exists ; then
7311 echocheck "glib version"
7312 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7313 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7314 echores "$_glib"
7316 _def_gui='#define HAVE_NEW_GUI 1'
7317 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7318 else
7319 _gtk1=yes
7320 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7322 else
7323 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7324 _gtk1=yes
7328 if test "$_gtk1" = yes ; then
7329 # Check for old GTK (1.2.x)
7330 echocheck "GTK version"
7331 if test -z "$_gtkconfig" ; then
7332 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7333 _gtkconfig="gtk-config"
7334 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7335 _gtkconfig="gtk12-config"
7336 else
7337 die "The GUI requires GTK devel packages (which were not found)."
7340 _gtk=`$_gtkconfig --version 2>&1`
7341 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7342 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7343 echores "$_gtk (using $_gtkconfig)"
7345 # Check for GLIB
7346 echocheck "glib version"
7347 if test -z "$_glibconfig" ; then
7348 if ( glib-config --version ) >/dev/null 2>&1 ; then
7349 _glibconfig="glib-config"
7350 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7351 _glibconfig="glib12-config"
7352 else
7353 die "The GUI requires GLIB devel packages (which were not found)"
7356 _glib=`$_glibconfig --version 2>&1`
7357 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7358 echores "$_glib (using $_glibconfig)"
7360 _def_gui='#define HAVE_NEW_GUI 1'
7361 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7364 else #if ! win32
7365 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7366 _def_gui='#define HAVE_NEW_GUI 1'
7367 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7368 fi #if ! win32
7370 else #if test "$_gui"
7371 _def_gui='#undef HAVE_NEW_GUI'
7372 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7373 fi #if test "$_gui"
7374 # --------------- GUI specific tests end -------------------
7377 if test "$_charset" = "noconv" ; then
7378 _charset=""
7380 if test "$_charset" ; then
7381 _def_charset="#define MSG_CHARSET \"$_charset\""
7382 else
7383 _def_charset="#undef MSG_CHARSET"
7386 if test "$_charset" = "UTF-8" ; then
7387 # hack to disable conversion in the Makefile
7388 _charset=""
7391 if test "$_charset" ; then
7392 echocheck "iconv program"
7393 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7394 if test "$?" -ne 0 ; then
7395 echores "no"
7396 echo "No working iconv program found, use "
7397 echo "--charset=UTF-8 to continue anyway."
7398 echo "If you also have problems with iconv library functions use --charset=noconv."
7399 echo "Messages in the GTK-2 interface will be broken then."
7400 exit 1
7401 else
7402 echores "yes"
7406 #############################################################################
7408 echocheck "automatic gdb attach"
7409 if test "$_crash_debug" = yes ; then
7410 _def_crash_debug='#define CRASH_DEBUG 1'
7411 else
7412 _def_crash_debug='#undef CRASH_DEBUG'
7413 _crash_debug=no
7415 echores "$_crash_debug"
7417 echocheck "compiler support for noexecstack"
7418 cat > $TMPC <<EOF
7419 int main(void) { return 0; }
7421 if cc_check -Wl,-z,noexecstack ; then
7422 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7423 echores "yes"
7424 else
7425 echores "no"
7429 # Dynamic linking flags
7430 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7431 _ld_dl_dynamic=''
7432 bsd && _ld_dl_dynamic='-rdynamic'
7433 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 ; then
7434 _ld_dl_dynamic='-rdynamic'
7437 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7438 bsdos && _ld_extra="$_ld_extra -ldvd"
7439 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7440 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7442 _def_debug='#undef MP_DEBUG'
7443 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7445 _def_linux='#undef TARGET_LINUX'
7446 linux && _def_linux='#define TARGET_LINUX 1'
7449 echocheck "joystick"
7450 _def_joystick='#undef HAVE_JOYSTICK'
7451 if test "$_joystick" = yes ; then
7452 if linux ; then
7453 # TODO add some check
7454 _def_joystick='#define HAVE_JOYSTICK 1'
7455 else
7456 _joystick="no"
7457 _res_comment="unsupported under $system_name"
7460 echores "$_joystick"
7462 echocheck "lirc"
7463 if test "$_lirc" = auto ; then
7464 _lirc=no
7465 cat > $TMPC <<EOF
7466 #include <lirc/lirc_client.h>
7467 int main(void) { return 0; }
7469 cc_check -llirc_client && _lirc=yes
7471 if test "$_lirc" = yes ; then
7472 _def_lirc='#define HAVE_LIRC 1'
7473 _ld_extra="$_ld_extra -llirc_client"
7474 else
7475 _def_lirc='#undef HAVE_LIRC'
7477 echores "$_lirc"
7479 echocheck "lircc"
7480 if test "$_lircc" = auto ; then
7481 _lircc=no
7482 cat > $TMPC <<EOF
7483 #include <lirc/lircc.h>
7484 int main(void) { return 0; }
7486 cc_check -llircc && _lircc=yes
7488 if test "$_lircc" = yes ; then
7489 _def_lircc='#define HAVE_LIRCC 1'
7490 _ld_extra="$_ld_extra -llircc"
7491 else
7492 _def_lircc='#undef HAVE_LIRCC'
7494 echores "$_lircc"
7496 if arm; then
7497 # Detect maemo development platform libraries availability (http://www.maemo.org),
7498 # they are used when run on Nokia 770
7499 echocheck "maemo (Nokia 770)"
7500 if test "$_maemo" = auto ; then
7501 _maemo=no
7502 cat > $TMPC << EOF
7503 #include <libosso.h>
7504 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7506 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7508 if test "$_maemo" = yes ; then
7509 _def_maemo='#define HAVE_MAEMO 1'
7510 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7511 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7512 else
7513 _def_maemo='#undef HAVE_MAEMO'
7515 echores "$_maemo"
7518 echocheck "color console output"
7519 if test "$_color_console" = yes ; then
7520 _def_color_console='#define MSG_USE_COLORS 1'
7521 else
7522 _def_color_console='#undef MSG_USE_COLORS'
7524 echores "$_color_console"
7526 # linker paths should be the same for mencoder and mplayer
7527 _ld_tmp=""
7528 for I in $_libs_mplayer ; do
7529 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7530 if test -z "$_tmp" ; then
7531 _ld_extra="$I $_ld_extra"
7532 else
7533 _ld_tmp="$_ld_tmp $I"
7535 done
7536 _libs_mplayer=$_ld_tmp
7539 #############################################################################
7540 if darwin ; then
7541 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
7542 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7543 CFLAGS="$CFLAGS -no-cpp-precomp"
7546 if amigaos ; then
7547 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__"
7549 if hpux ; then
7550 # use flag for HPUX missing setenv()
7551 CFLAGS="$CFLAGS -DHPUX"
7553 # Thread support
7554 if linux ; then
7555 CFLAGS="$CFLAGS -D_REENTRANT"
7556 elif bsd ; then
7557 # FIXME bsd needs this so maybe other OS'es
7558 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7560 if cygwin ; then
7561 CFLAGS="$CFLAGS -D__CYGWIN__"
7563 if os2 ; then
7564 CFLAGS="$CFLAGS -Zomf"
7566 # 64 bit file offsets?
7567 if test "$_largefiles" = yes || freebsd ; then
7568 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7569 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7570 # dvdread support requires this (for off64_t)
7571 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7572 cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
7573 beos && CFLAGS="$CFLAGS -DSYS_BEOS"
7574 os2 && CFLAGS="$CFLAGS -DSYS_OS2"
7578 # Make sure config.h gets included.
7579 if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then
7580 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
7583 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7584 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7586 cat > $TMPC << EOF
7587 int main(void) { return 0; }
7589 if test "$cc_vendor" = "gnu" ; then
7590 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7591 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7592 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7595 cc_check -mno-omit-leaf-frame-pointer && CFLAG_NO_OMIT_LEAF_FRAME_POINTER="-mno-omit-leaf-frame-pointer"
7597 #this must be the last test to be performed or the ones following it will likely fail
7598 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7599 # to use its own copy of the library)
7600 echocheck "DVD support (libdvdnav)"
7601 if test "$_dvdnav" = auto ; then
7602 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7604 if test "$_dvdnav" = auto ; then
7605 cat > $TMPC <<EOF
7606 #include <inttypes.h>
7607 #include <dvdnav/dvdnav.h>
7608 int main(void) { dvdnav_t *dvd=0; return 0; }
7610 _dvdnav=no
7611 _dvdnavdir=`$_dvdnavconfig --cflags`
7612 _dvdnavlibs=`$_dvdnavconfig --libs`
7613 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7615 if test "$_dvdnav" = yes ; then
7616 _largefiles=yes
7617 _def_dvdnav='#define USE_DVDNAV 1'
7618 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7619 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7620 _inputmodules="dvdnav $_inputmodules"
7621 else
7622 _def_dvdnav='#undef USE_DVDNAV'
7623 _noinputmodules="dvdnav $_noinputmodules"
7625 echores "$_dvdnav"
7627 #############################################################################
7628 echo "Creating config.mak"
7629 cat > config.mak << EOF
7630 # -------- Generated by configure -----------
7632 LANG = C
7633 MAN_LANG = $MAN_LANG
7634 TARGET_OS = $system_name
7635 DESTDIR =
7636 prefix = \$(DESTDIR)$_prefix
7637 BINDIR = \$(DESTDIR)$_bindir
7638 DATADIR = \$(DESTDIR)$_datadir
7639 MANDIR = \$(DESTDIR)$_mandir
7640 CONFDIR = \$(DESTDIR)$_confdir
7641 LIBDIR = \$(DESTDIR)$_libdir
7642 # FFmpeg uses libdir instead of LIBDIR
7643 libdir = \$(LIBDIR)
7644 AR = $_ar
7645 CC = $_cc
7646 CXX = $_cc
7647 HOST_CC = $_host_cc
7648 RANLIB = $_ranlib
7649 WINDRES = $_windres
7650 INSTALL = $_install
7651 EXTRA_INC = $_inc_extra
7652 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7653 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7654 CFLAG_NO_OMIT_LEAF_FRAME_POINTER = $CFLAG_NO_OMIT_LEAF_FRAME_POINTER
7655 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7656 CFLAG_STACKREALIGN = $_stackrealign
7657 INSTALLSTRIP = $_install_strip
7658 CHARSET = $_charset
7659 HELP_FILE = $_mp_help
7661 EXESUF = $_exesuf
7663 MPLAYER_NETWORK = $_network
7664 FTP = $_ftp
7665 STREAMING_LIVE555 = $_live
7666 LIBNEMESI = $_nemesi
7667 NATIVE_RTSP = $_native_rtsp
7668 VSTREAM = $_vstream
7669 STREAM_CACHE = $_stream_cache
7670 DVBIN = $_dvbin
7671 VIDIX = $_vidix
7672 VIDIX_INTERNAL = $_vidix_internal
7673 VIDIX_EXTERNAL = $_vidix_external
7674 VIDIX_PCIDB = $_vidix_pcidb_val
7675 CONFIG_PP = yes
7676 MP3LAME = $_mp3lame
7677 LIBMENU = $_menu
7679 MP3LIB = $_mp3lib
7680 LIBA52 = $_liba52
7681 LIBMPEG2 = $_libmpeg2
7682 TREMOR_INTERNAL = $_tremor_internal
7683 TREMOR_LOW = $_tremor_low
7684 FAAD = $_faad
7686 SPEEX = $_speex
7687 MUSEPACK = $_musepack
7689 UNRAR_EXEC = $_unrar_exec
7690 PNG = $_png
7691 JPEG = $_jpeg
7692 GIF = $_gif
7694 EXTRALIBS = $_extra_libs
7695 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7696 EXTRALIBS_MPLAYER = $_libs_mplayer
7697 EXTRALIBS_MENCODER = $_libs_mencoder
7699 HAVE_MLIB = $_mlib
7700 HAVE_PTHREADS = $_pthreads
7701 HAVE_W32THREADS = $_w32threads
7703 HAVE_XVMC_ACCEL = $_xvmc
7705 HAVE_SYS_MMAN_H = $_mman
7706 HAVE_POSIX_SELECT = $_posix_select
7708 NEED_GETTIMEOFDAY = $_need_gettimeofday
7709 NEED_GLOB = $_need_glob
7710 NEED_SETENV = $_need_setenv
7711 NEED_SHMEM = $_need_shmem
7712 NEED_STRSEP = $_need_strsep
7713 NEED_SWAB = $_need_swab
7714 NEED_VSSCANF = $_need_vsscanf
7716 # for FFmpeg
7717 SRC_PATH=..
7718 BUILD_ROOT=..
7719 LIBPREF=lib
7720 LIBSUF=.a
7721 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7723 # audio output
7724 OSS = $_ossaudio
7725 ALSA = $_alsa
7726 ALSA5 = $_alsa5
7727 ALSA9 = $_alsa9
7728 ALSA1X = $_alsa1x
7730 # input/demuxer/codecs
7731 JOYSTICK = $_joystick
7732 LIRC = $_lirc
7733 APPLE_REMOTE = $_apple_remote
7734 TV = $_tv
7735 TV_V4L = $_tv_v4l
7736 TV_V4L1 = $_tv_v4l1
7737 TV_V4L2 = $_tv_v4l2
7738 TV_DSHOW = $_tv_dshow
7739 TV_BSDBT848 = $_tv_bsdbt848
7740 TV_TELETEXT = $_tv_teletext
7741 AUDIO_INPUT = $_audio_input
7742 PVR = $_pvr
7743 VCD = $_vcd
7744 DVDREAD = $_dvdread
7745 DVDREAD_INTERNAL = $_dvdread_internal
7746 DVDCSS_INTERNAL = $_libdvdcss_internal
7747 DVDNAV = $_dvdnav
7748 WIN32DLL = $_win32dll
7749 QTX_CODECS = $_qtx
7750 REAL_CODECS = $_real
7751 XANIM_CODECS = $_xanim
7752 LIBAVUTIL = $_libavutil
7753 LIBAVUTIL_A = $_libavutil_a
7754 LIBAVUTIL_SO = $_libavutil_so
7755 LIBAVCODEC = $_libavcodec
7756 LIBAVCODEC_A = $_libavcodec_a
7757 LIBAVCODEC_SO = $_libavcodec_so
7758 LIBAVFORMAT = $_libavformat
7759 LIBAVFORMAT_A = $_libavformat_a
7760 LIBAVFORMAT_SO = $_libavformat_so
7761 LIBPOSTPROC = $_libpostproc
7762 LIBPOSTPROC_A = $_libpostproc_a
7763 LIBPOSTPROC_SO = $_libpostproc_so
7764 ZORAN = $_zr
7765 LIBLZO = $_liblzo
7766 LIBDV = $_libdv
7767 XVID4 = $_xvid
7768 X264 = $_x264
7769 LIBNUT = $_libnut
7770 LIBDCA = $_libdca
7771 MPLAYER = $_mplayer
7772 MENCODER = $_mencoder
7773 CDDA = $_cdda
7774 CDDB = $_cddb
7775 BITMAP_FONT = $_bitmap_font
7776 FREETYPE = $_freetype
7777 ASS = $_ass
7778 LIBMAD = $_mad
7779 LIBVORBIS = $_vorbis
7780 LIBTHEORA = $_theora
7781 FAAD_INTERNAL = $_faad_internal
7782 FAAD_FIXED = $_faad_fixed
7783 LIBSMBCLIENT = $_smbsupport
7784 XMMS_PLUGINS = $_xmms
7785 MACOSX = $_macosx
7786 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7787 MACOSX_BUNDLE = $_macosx_bundle
7788 MACOSX_COREVIDEO = $_macosx_corevideo
7789 TOOLAME=$_toolame
7790 TWOLAME=$_twolame
7791 FAAC=$_faac
7792 CONFIG_LIBAMR=$_libamr
7793 CONFIG_LIBAMR_NB=$_libamr_nb
7794 CONFIG_LIBAMR_WB=$_libamr_wb
7795 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7796 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7797 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7798 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7799 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7800 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7801 CONFIG_LIBFAAC=$_lavc_faac
7802 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7803 CONFIG_LIBVORBIS=$_libvorbis
7804 CONFIG_LIBXVID=$_lavc_xvid
7805 CONFIG_LIBX264=$_lavc_x264
7806 CONFIG_ZLIB=$_zlib
7807 CONFIG_GPL=yes
7808 CONFIG_ENCODERS=$_mencoder
7809 CONFIG_MUXERS=$_mencoder
7810 # Prevent building libavcodec/imgresample.c with conflicting symbols
7811 CONFIG_SWSCALER=yes
7812 RADIO=$_radio
7813 RADIO_CAPTURE=$_radio_capture
7814 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7815 VIDIX_IVTV=$_vidix_drv_ivtv
7816 VIDIX_MACH64=$_vidix_drv_mach64
7817 VIDIX_MGA=$_vidix_drv_mga
7818 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7819 VIDIX_NVIDIA=$_vidix_drv_nvidia
7820 VIDIX_PM2=$_vidix_drv_pm2
7821 VIDIX_PM3=$_vidix_drv_pm3
7822 VIDIX_RADEON=$_vidix_drv_radeon
7823 VIDIX_RAGE128=$_vidix_drv_rage128
7824 VIDIX_S3=$_vidix_drv_s3
7825 VIDIX_SIS=$_vidix_drv_sis
7826 VIDIX_UNICHROME=$_vidix_drv_unichrome
7828 # --- Some stuff for autoconfigure ----
7829 $_target_arch
7830 $_target_arch_x86
7831 $_confwin32
7832 TARGET_CPU=$iproc
7833 HAVE_MMX = $_mmx
7834 HAVE_MMX2 = $_mmxext
7835 HAVE_3DNOW = $_3dnow
7836 HAVE_3DNOWEX = $_3dnowext
7837 HAVE_SSE = $_sse
7838 HAVE_CMOV = $_cmov
7839 HAVE_ALTIVEC = $_altivec
7840 HAVE_ARMV5TE = $_armv5te
7841 HAVE_ARMV6 = $_armv6
7842 HAVE_IWMMXT = $_iwmmxt
7843 HAVE_VIS = $_vis
7845 # --- GUI stuff ---
7846 GUI = $_gui
7848 # --- libvo stuff ---
7849 VO_SRCS = $_vosrc
7851 # --- libao2 stuff ---
7852 AO_SRCS = $_aosrc
7854 # --- libaf stuff ---
7855 AF_SRCS = $_afsrc
7859 #############################################################################
7861 ff_config_enable () {
7862 _nprefix=$3;
7863 test -z "$_nprefix" && _nprefix='CONFIG'
7864 for part in $1; do
7865 if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
7866 echo "#define ${_nprefix}_$part 1"
7867 echo "#define ENABLE_$part 1"
7868 else
7869 echo "#define ENABLE_$part 0"
7871 done
7874 echo "Creating config.h"
7875 cat > $TMPH << EOF
7876 /* -------- This file has been automatically generated by configure ---------
7877 Note: Any changes in it will be lost when you run configure again. */
7879 /* Protect against multiple inclusion */
7880 #ifndef MPLAYER_CONFIG_H
7881 #define MPLAYER_CONFIG_H
7883 #define CONFIGURATION "$_configuration"
7885 /* make sure we never get lavformat's poll() emulation, the results are
7886 horrible if the X libs try to actually use it, see MPlayer-users
7887 Message-ID: <45D49541.8060101@infernix.net>
7888 Date: Thu, 15 Feb 2007 18:15:45 +0100
7889 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7891 #define HAVE_SYS_POLL_H 1
7893 /* yes, we have inttypes.h */
7894 #define HAVE_INTTYPES_H 1
7896 /* int_fastXY_t emulation */
7897 $_def_fast_inttypes
7899 /* libdvdcss */
7900 #define HAVE_ERRNO_H 1
7902 /* libdvdcss + libdvdread */
7903 #define HAVE_LIMITS_H 1
7905 /* libdvdcss + libfaad2 */
7906 #define HAVE_UNISTD_H 1
7908 /* libfaad2 + libdvdread */
7909 #define STDC_HEADERS 1
7911 /* libfaad2 */
7912 #define HAVE_MEMCPY 1
7913 #define HAVE_STRCHR 1
7915 /* libdvdread */
7916 #define HAVE_UINTPTR_T 1
7918 /* name of messages charset */
7919 $_def_charset
7921 /* Runtime CPU detection */
7922 $_def_runtime_cpudetection
7924 /* Dynamic a/v plugins */
7925 $_def_dynamic_plugins
7927 /* "restrict" keyword */
7928 $_def_restrict_keyword
7930 /* __builtin_expect branch prediction hint */
7931 $_def_builtin_expect
7932 #ifdef HAVE_BUILTIN_EXPECT
7933 #define likely(x) __builtin_expect ((x) != 0, 1)
7934 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7935 #else
7936 #define likely(x) (x)
7937 #define unlikely(x) (x)
7938 #endif
7940 /* attribute(used) as needed by some compilers */
7941 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7942 # define attribute_used __attribute__((used))
7943 #else
7944 # define attribute_used
7945 #endif
7947 /* compiler support for named assembler arguments */
7948 $_def_named_asm_args
7950 /* enable/disable SIGHANDLER */
7951 $_def_sighandler
7953 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7954 $_def_crash_debug
7956 /* Toggles debugging informations */
7957 $_def_debug
7959 /* Toggles color console output */
7960 $_def_color_console
7962 /* Indicates that libcdio is available for VCD and CD-DA playback */
7963 $_def_libcdio
7965 /* Indicates that Ogle's libdvdread is available for DVD playback */
7966 $_def_dvdread
7968 /* Indicates that dvdread is internal */
7969 $_def_dvdread_internal
7971 /* Additional options for libdvdread/libdvdcss */
7972 $_def_dvd
7973 $_def_cdrom
7974 $_def_cdio
7975 $_def_dvdio
7976 $_def_bsdi_dvd
7977 $_def_dvd_bsd
7978 $_def_dvd_linux
7979 $_dev_dvd_openbsd
7980 $_def_dvd_darwin
7981 $_def_sol_scsi_h
7982 $_def_hpux_scsi_h
7984 /* Common data directory (for fonts, etc) */
7985 #define MPLAYER_DATADIR "$_datadir"
7986 #define MPLAYER_CONFDIR "$_confdir"
7987 #define MPLAYER_LIBDIR "$_libdir"
7989 /* Define this to compile stream-caching support, it can be enabled via
7990 -cache <kilobytes> */
7991 $_def_stream_cache
7993 /* Define if you are using XviD library */
7994 $_def_xvid
7996 /* Define if you are using the X.264 library */
7997 $_def_x264
7999 /* Define if you are using libnut */
8000 $_def_libnut
8002 /* Define to include support for libdv-0.9.5 */
8003 $_def_libdv
8005 /* If build mencoder */
8006 $_mencoder_flag
8008 /* Indicates if libmp3lame is available
8009 Note: for mencoder */
8010 $_def_mp3lame
8011 $_def_mp3lame_preset
8012 $_def_mp3lame_preset_medium
8014 /* Undefine this if you do not want to select mono audio (left or right)
8015 with a stereo MPEG layer 2/3 audio stream. The command line option
8016 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8017 right-only), with 0 being the default.
8019 #define USE_FAKE_MONO 1
8021 /* Undefine this if your sound card driver has no working select().
8022 If you have kernel Oops, player hangups, or just no audio, you should
8023 try to recompile MPlayer with this option disabled! */
8024 $_def_select
8026 /* define this to use iconv(3) function to codepage conversions */
8027 $_def_iconv
8029 /* define this to use nl_langinfo function */
8030 $_def_langinfo
8032 /* define this to use RTC (/dev/rtc) for video timers */
8033 $_def_rtc
8035 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
8036 #define MAX_OUTBURST 65536
8038 /* set up audio OUTBURST. Do not change this! */
8039 #define OUTBURST 512
8041 /* Define this if your system has the header file for the OSS sound interface */
8042 $_def_sys_soundcard
8044 /* Define this if your system has the header file for the OSS sound interface
8045 * in /usr/include */
8046 $_def_soundcard
8048 /* Define this if your system has the sysinfo header */
8049 $_def_sys_sysinfo
8051 /* Define this if your system has the "malloc.h" header file */
8052 $_def_malloc
8054 /* memalign is mapped to malloc if unsupported */
8055 $_def_memalign
8056 $_def_map_memalign
8057 $_def_memalign_hack
8059 /* assembler handling of .align */
8060 $_def_asmalign_pot
8062 /* Define this if your system has the "alloca.h" header file */
8063 $_def_alloca
8065 /* Define this if your system has the "byteswap.h" header file */
8066 $_def_byteswap_h
8068 /* Define this if your system has the "sys/mman.h" header file */
8069 $_def_mman
8070 $_def_mman_has_map_failed
8072 /* Define this if you have the elf dynamic linker -ldl library */
8073 $_def_dl
8075 /* Define this if you have the kstat kernel statistics library */
8076 $_def_kstat
8078 /* Define this if you have zlib */
8079 $_def_zlib
8080 #ifdef HAVE_ZLIB
8081 #define CONFIG_ZLIB 1
8082 #endif
8084 /* Define this if you have shm support */
8085 $_def_shm
8087 /* Define this if your system has strsep */
8088 $_def_strsep
8090 /* Define this if your system has vsscanf */
8091 $_def_vsscanf
8093 /* Define this if your system has swab */
8094 $_def_swab
8096 /* Define this if your system has posix select */
8097 $_def_posix_select
8099 /* Define this if your system has gettimeofday */
8100 $_def_gettimeofday
8102 /* Define this if your system has glob */
8103 $_def_glob
8105 /* Define this if your system has setenv */
8106 $_def_setenv
8107 #ifndef HAVE_SETENV
8108 int setenv(const char *name, const char *val, int overwrite);
8109 #endif
8111 /* Define this if your system has sysi86 */
8112 $_def_sysi86
8113 $_def_sysi86_iv
8115 /* Define this if your system has pthreads */
8116 $_def_pthreads
8118 /* Define this if you enabled thread support for libavcodec */
8119 $_def_threads
8120 #ifdef HAVE_THREADS
8121 #define ENABLE_THREADS 1
8122 #else
8123 #define ENABLE_THREADS 0
8124 #endif
8126 /* LIRC (remote control, see www.lirc.org) support: */
8127 $_def_lirc
8129 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8130 $_def_apple_remote
8132 /* Support for maemo (http://www.maemo.org) */
8133 $_def_maemo
8136 * LIRCCD (LIRC client daemon)
8137 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8139 $_def_lircc
8141 /* DVD navigation support using libdvdnav */
8142 $_def_dvdnav
8144 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8145 #define MPEG12_POSTPROC 1
8147 /* maximum alignment used by libmpeg2 */
8148 #define ATTRIBUTE_ALIGNED_MAX 16
8150 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8151 $_def_libpostproc
8152 $_def_libpostproc_a
8153 $_def_libpostproc_so
8155 /* Win32 DLL support */
8156 $_def_win32dll
8157 #define WIN32_PATH "$_win32codecsdir"
8159 /* Mac OS X specific features */
8160 $_def_macosx
8161 $_def_macosx_finder_support
8162 $_def_macosx_bundle
8163 $_def_macosx_corevideo
8165 /* Build our Win32-loader */
8166 $_def_win32_loader
8168 /* ffmpeg's libavcodec support (requires libavcodec source) */
8169 $_def_libavcodec
8170 $_def_libavcodec_a
8171 $_def_libavcodec_so
8172 $_def_libavcodec_mpegaudio_hp
8174 /* ffmpeg's libavformat support (requires libavformat source) */
8175 $_def_libavformat
8176 $_def_libavformat_a
8177 $_def_libavformat_so
8179 $_def_libavutil
8180 $_def_libavutil_a
8181 $_def_libavutil_so
8183 /* Use libavcodec's decoders */
8184 #define CONFIG_DECODERS 1
8185 /* Use libavcodec's encoders */
8186 #define CONFIG_ENCODERS 1
8187 #define ENABLE_ENCODERS 1
8189 /* Use libavformat's demuxers */
8190 #define CONFIG_DEMUXERS 1
8191 /* Use libavformat's muxers */
8192 $_def_muxers
8194 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8195 #define HAVE_EBX_AVAILABLE 1
8196 #ifndef MP_DEBUG
8197 #define HAVE_EBP_AVAILABLE 1
8198 #endif
8200 #define HAVE_SOCKLEN_T 1
8202 #define CONFIG_GPL 1
8203 #define ENABLE_SMALL 0
8205 /* Support for grayscale encoding/decoding in FFmpeg (makes color slower) */
8206 #define ENABLE_GRAY 1
8208 /* Use AMR codecs from libavcodec. */
8209 $_def_libamr
8210 $_def_libamr_nb
8211 $_def_libamr_wb
8213 /* Use specific parts from FFmpeg. */
8214 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8215 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8216 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8217 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8218 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8219 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8220 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8222 $_def_lavc_faac
8223 $_def_lavc_xvid
8224 $_def_lavc_mp3lame
8225 $_def_lavc_x264
8227 /* Use codec libs included in mplayer CVS / source dist: */
8228 $_def_mp3lib
8229 $_def_liba52
8230 $_def_libmpeg2
8232 /* XAnim DLL support */
8233 $_def_xanim
8234 /* Default search path */
8235 $_def_xanim_path
8237 /* RealPlayer DLL support */
8238 $_def_real
8239 /* Default search path */
8240 $_def_real_path
8242 /* LIVE555 Streaming Media library support */
8243 $_def_live
8245 /* libnemesi Streaming Media library support */
8246 $_def_nemesi
8248 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8249 $_def_fastmemcpy
8251 /* Use UnRAR executable for Vobsubs */
8252 $_def_unrar_exec
8254 /* gui support, please do not edit this option */
8255 $_def_gui
8256 $_def_gtk2_gui
8258 /* Audio output drivers */
8259 $_def_ossaudio
8260 $_def_ossaudio_devdsp
8261 $_def_ossaudio_devmixer
8262 $_def_alsa5
8263 $_def_alsa9
8264 $_def_alsa1x
8265 $_def_arts
8266 $_def_esd
8267 $_def_esd_latency
8268 $_def_pulse
8269 $_def_jack
8270 $_def_openal
8271 $_def_openal_h
8272 $_def_sys_asoundlib_h
8273 $_def_alsa_asoundlib_h
8274 $_def_sunaudio
8275 $_def_sgiaudio
8276 $_def_win32waveout
8277 $_def_nas
8279 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8280 #undef FAST_OSD
8281 #undef FAST_OSD_TABLE
8283 /* Enable TV Interface support */
8284 $_def_tv
8286 /* Enable Video 4 Linux TV interface support */
8287 $_def_tv_v4l
8289 /* Enable Video 4 Linux 1 TV interface support */
8290 $_def_tv_v4l1
8292 /* Enable Video 4 Linux 2 TV interface support */
8293 $_def_tv_v4l2
8295 /* Enable DirectShow TV interface support */
8296 $_def_tv_dshow
8298 /* *BSD BrookTree headers */
8299 $_def_ioctl_meteor_h_name
8300 $_def_ioctl_bt848_h_name
8302 /* Enable *BSD BrookTree TV interface support */
8303 $_def_tv_bsdbt848
8305 /* Enable TV Teletext Interface support */
8306 $_def_tv_teletext
8308 /* Enable Radio Interface support */
8309 $_def_radio
8311 /* Enable Capture for Radio Interface support */
8312 $_def_radio_capture
8314 /* Enable Video 4 Linux Radio interface support */
8315 $_def_radio_v4l
8317 /* Enable Video 4 Linux 2 Radio interface support */
8318 $_def_radio_v4l2
8320 /* Enable *BSD BrookTree Radio interface support */
8321 $_def_radio_bsdbt848
8323 /* Enable Video 4 Linux 2 MPEG PVR support */
8324 $_def_pvr
8326 /* Define if your processor stores words with the most significant
8327 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8328 $_def_words_endian
8330 /* Define if your processor can access unaligned data in a fast way */
8331 $_def_fast_unaligned
8333 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8335 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8336 have the instruction. */
8337 $_def_dcbzl
8339 /* Define this for Cygwin build for win32 */
8340 $_def_confwin32
8342 /* Define this to any prefered value from 386 up to infinity with step 100 */
8343 #define __CPU__ $iproc
8345 $_mp_wordsize
8347 $_def_linux
8349 $_def_vcd
8351 #ifdef sun
8352 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8353 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8354 #elif defined(WIN32) || defined(__OS2__)
8355 #define DEFAULT_CDROM_DEVICE "D:"
8356 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8357 #elif defined(__APPLE__) || defined(__DARWIN__)
8358 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8359 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8360 #elif defined(__OpenBSD__)
8361 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8362 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8363 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8364 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8365 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8366 #elif defined(__AMIGAOS4__)
8367 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8368 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8369 #else
8370 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8371 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8372 #endif
8375 /*----------------------------------------------------------------------------
8377 ** NOTE: Instead of modifying these definitions here, use the
8378 ** --enable/--disable options of the ./configure script!
8379 ** See ./configure --help for details.
8381 *---------------------------------------------------------------------------*/
8383 /* C99 *lrint* and round* functions available */
8384 $_def_llrint
8385 $_def_lrint
8386 $_def_lrintf
8387 $_def_round
8388 $_def_roundf
8390 /* mkstemp support */
8391 $_def_mkstemp
8393 /* nanosleep support */
8394 $_def_nanosleep
8396 /* SMB support */
8397 $_def_smbsupport
8399 /* termcap flag for getch2.c */
8400 $_def_termcap
8402 /* termios flag for getch2.c */
8403 $_def_termios
8404 $_def_termios_h
8405 $_def_termios_sys_h
8407 /* enable PNG support */
8408 $_def_png
8410 /* enable JPEG support */
8411 $_def_jpeg
8413 /* enable PNM support */
8414 $_def_pnm
8416 /* enable md5sum support */
8417 $_def_md5sum
8419 /* enable GIF support */
8420 $_def_gif
8421 $_def_gif_4
8422 $_def_gif_tvt_hack
8424 /* enable bitmap font support */
8425 $_def_bitmap_font
8427 /* enable FreeType support */
8428 $_def_freetype
8430 /* enable Fontconfig support */
8431 $_def_fontconfig
8433 /* enable SSA/ASS support */
8434 $_def_ass
8436 /* enable FriBiDi usage */
8437 $_def_fribidi
8439 /* enable ENCA usage */
8440 $_def_enca
8442 /* liblzo support */
8443 $_def_liblzo
8444 #ifdef USE_LIBLZO
8445 #define CONFIG_LZO 1
8446 #endif
8448 /* libmad support */
8449 $_def_mad
8451 /* enable OggVorbis support */
8452 $_def_vorbis
8453 $_def_tremor
8455 /* enable Speex support */
8456 $_def_speex
8458 /* enable musepack support */
8459 $_def_musepack
8461 /* enable OggTheora support */
8462 $_def_theora
8464 /* enable FAAD (AAC) support */
8465 $_def_faad
8466 $_def_faad_internal
8468 /* enable FAAC (AAC encoder) support */
8469 $_def_faac
8471 /* enable libdca support */
8472 $_def_libdca
8474 /* enable LADSPA plugin support */
8475 $_def_ladspa
8477 /* enable network */
8478 $_def_network
8480 /* enable ftp support */
8481 $_def_ftp
8483 /* enable vstream support */
8484 $_def_vstream
8486 /* enable winsock2 instead of Unix functions*/
8487 $_def_winsock2
8489 /* define this to use inet_aton() instead of inet_pton() */
8490 $_def_use_aton
8492 /* enables / disables cdparanoia support */
8493 $_def_cdparanoia
8494 $_def_cddb
8496 /* enables / disables VIDIX usage */
8497 $_def_vidix
8498 $_def_vidix_drv_cyberblade
8499 $_def_vidix_drv_ivtv
8500 $_def_vidix_drv_mach64
8501 $_def_vidix_drv_mga
8502 $_def_vidix_drv_mga_crtc2
8503 $_def_vidix_drv_nvidia
8504 $_def_vidix_drv_pm3
8505 $_def_vidix_drv_radeon
8506 $_def_vidix_drv_rage128
8507 $_def_vidix_drv_s3
8508 $_def_vidix_drv_sis
8509 $_def_vidix_drv_unichrome
8510 $_def_vidix_pfx
8512 /* enables / disables new input joystick support */
8513 $_def_joystick
8515 /* enables / disables QTX codecs */
8516 $_def_qtx
8518 /* enables / disables osd menu */
8519 $_def_menu
8521 /* enables / disables subtitles sorting */
8522 $_def_sortsub
8524 /* XMMS input plugin support */
8525 $_def_xmms
8526 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8528 /* enables inet6 support */
8529 $_def_inet6
8531 /* do we have gethostbyname2? */
8532 $_def_gethostbyname2
8534 /* Extension defines */
8535 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8537 $_def_altivec_h // enables usage of altivec.h
8539 /* libvo options */
8540 #define SCREEN_SIZE_X 1
8541 #define SCREEN_SIZE_Y 1
8542 $_def_x11
8543 $_def_xv
8544 $_def_xvmc
8545 $_def_vm
8546 $_def_xf86keysym
8547 $_def_xinerama
8548 $_def_gl
8549 $_def_gl_win32
8550 $_def_dga
8551 $_def_dga1
8552 $_def_dga2
8553 $_def_sdl
8554 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8555 $_def_sdlbuggy
8556 $_def_directx
8557 $_def_ggi
8558 $_def_ggiwmh
8559 $_def_3dfx
8560 $_def_s3fb
8561 $_def_tdfxfb
8562 $_def_tdfxvid
8563 $_def_xvr100
8564 $_def_directfb
8565 $_def_directfb_version
8566 $_def_dfbmga
8567 $_def_zr
8568 $_def_bl
8569 $_def_mga
8570 $_def_xmga
8571 $_def_fbdev
8572 $_def_dxr2
8573 $_def_dxr3
8574 $_def_ivtv
8575 $_def_v4l2
8576 $_def_dvb
8577 $_def_dvb_in
8578 $_def_svga
8579 $_def_vesa
8580 $_def_xss
8581 $_def_xdpms
8582 $_def_aa
8583 $_def_caca
8584 $_def_tga
8585 $_def_toolame
8586 $_def_twolame
8588 /* used by GUI: */
8589 $_def_xshape
8591 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8592 #define X11_FULLSCREEN 1
8593 #endif
8595 #endif /* MPLAYER_CONFIG_H */
8598 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8599 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8601 #############################################################################
8603 cat << EOF
8605 Config files successfully generated by ./configure $_configuration !
8607 Install prefix: $_prefix
8608 Data directory: $_datadir
8609 Config direct.: $_confdir
8611 Byte order: $_byte_order
8612 Optimizing for: $_optimizing
8614 Languages:
8615 Messages/GUI: $_language
8618 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8619 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8620 echo
8622 cat << EOF
8624 Enabled optional drivers:
8625 Input: $_inputmodules
8626 Codecs: $_codecmodules
8627 Audio output: $_aomodules
8628 Video output: $_vomodules
8629 Audio filters: $_afmodules
8630 Disabled optional drivers:
8631 Input: $_noinputmodules
8632 Codecs: $_nocodecmodules
8633 Audio output: $_noaomodules
8634 Video output: $_novomodules
8635 Audio filters: $_noafmodules
8637 'config.h' and 'config.mak' contain your configuration options.
8638 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8639 compile *** DO NOT REPORT BUGS if you tweak these files ***
8641 'make' will now compile MPlayer and 'make install' will install it.
8642 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8647 if test "$_mtrr" = yes ; then
8648 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8649 echo
8652 if ! x86_32; then
8653 cat <<EOF
8654 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8655 operating system ($system_name). You may encounter a few files that cannot
8656 be played due to missing open source video/audio codec support.
8662 cat <<EOF
8663 Check $TMPLOG if you wonder why an autodetection failed (make sure
8664 development headers/packages are installed).
8666 NOTE: The --enable-* parameters unconditionally force options on, completely
8667 skipping autodetection. This behavior is unlike what you may be used to from
8668 autoconf-based configure scripts that can decide to override you. This greater
8669 level of control comes at a price. You may have to provide the correct compiler
8670 and linker flags yourself.
8671 If you used one of these options (except --enable-gui and similar ones that
8672 turn on internal features) and experience a compilation or linking failure,
8673 make sure you have passed the necessary compiler/linker flags to configure.
8675 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8679 if test "$_warn_CFLAGS" = yes; then
8680 cat <<EOF
8682 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8684 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8686 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8687 To do so, execute 'CFLAGS= ./configure <options>'
8692 # Last move:
8693 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"