osdep: Remove cruft
[mplayer.git] / configure
blob8507df187e010e9327ac93d0f366bae79dc7eef0
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 dragonfly() { issystem "DragonFly" ; 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
415 Advanced options:
416 --enable-mmx enable MMX [autodetect]
417 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
418 --enable-3dnow enable 3DNow! [autodetect]
419 --enable-3dnowext enable extended 3DNow! [autodetect]
420 --enable-sse enable SSE [autodetect]
421 --enable-sse2 enable SSE2 [autodetect]
422 --enable-ssse3 enable SSSE3 [autodetect]
423 --enable-shm enable shm [autodetect]
424 --enable-altivec enable AltiVec (PowerPC) [autodetect]
425 --enable-armv5te enable DSP extensions (ARM) [autodetect]
426 --enable-armv6 enable ARMv6 (ARM) [autodetect]
427 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
428 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
429 --enable-big-endian force byte order to big-endian [autodetect]
430 --enable-debug[=1-3] compile-in debugging information [disable]
431 --enable-profile compile-in profiling information [disable]
432 --disable-sighandler disable sighandler for crashes [enable]
433 --enable-crash-debug enable automatic gdb attach on crash [disable]
434 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
436 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
437 --disable-gcc-check disable gcc version checking [enable]
439 Use these options if autodetection fails (Options marked with (*) accept
440 multiple paths separated by ':'):
441 --extra-libs=FLAGS extra linker flags
442 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
443 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
444 --with-extraincdir=DIR extra header search paths in DIR (*)
445 --with-extralibdir=DIR extra linker search paths in DIR (*)
446 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
448 --with-freetype-config=PATH path to freetype-config
449 --with-fribidi-config=PATH path to fribidi-config
450 --with-glib-config=PATH path to glib*-config
451 --with-gtk-config=PATH path to gtk*-config
452 --with-sdl-config=PATH path to sdl*-config
453 --with-dvdnav-config=PATH path to dvdnav-config
454 --with-dvdread-config=PATH path to dvdread-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' ffmpeg/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' ffmpeg/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' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
502 _libavparsers=$_libavparsers_all
503 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' ffmpeg/libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
504 _libavbsfs=$_libavbsfs_all
505 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' ffmpeg/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' ffmpeg/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' ffmpeg/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 _dvdreadconfig=dvdread-config
581 _dvdread=auto
582 _dvdread_internal=auto
583 _libdvdcss_internal=auto
584 _xanim=auto
585 _real=auto
586 _live=auto
587 _nemesi=auto
588 _native_rtsp=yes
589 _xinerama=auto
590 _mga=auto
591 _xmga=auto
592 _vm=auto
593 _xf86keysym=auto
594 _mlib=no #broken, thus disabled
595 _sgiaudio=auto
596 _sunaudio=auto
597 _alsa=auto
598 _fastmemcpy=yes
599 _unrar_exec=auto
600 _win32dll=auto
601 _select=yes
602 _radio=no
603 _radio_capture=no
604 _radio_v4l=auto
605 _radio_v4l2=auto
606 _radio_bsdbt848=auto
607 _tv=yes
608 _tv_v4l1=auto
609 _tv_v4l2=auto
610 _tv_bsdbt848=auto
611 _tv_dshow=auto
612 _tv_teletext=auto
613 _pvr=auto
614 _network=yes
615 _winsock2=auto
616 _smbsupport=auto
617 _vidix_internal=auto
618 _vidix_external=auto
619 _vidix_pcidb=yes
620 _joystick=no
621 _xvid=auto
622 _x264=auto
623 _libnut=auto
624 _lirc=auto
625 _lircc=auto
626 _apple_remote=auto
627 _gui=no
628 _gtk1=no
629 _termcap=auto
630 _termios=auto
631 _3dfx=no
632 _s3fb=no
633 _tdfxfb=no
634 _tdfxvid=no
635 _xvr100=auto
636 _tga=yes
637 _directfb=auto
638 _zr=auto
639 _bl=no
640 _largefiles=yes
641 #_language=en
642 _shm=auto
643 _linux_devfs=no
644 _charset="UTF-8"
645 _dynamic_plugins=no
646 _crash_debug=no
647 _sighandler=yes
648 _libdv=auto
649 _cdparanoia=auto
650 _cddb=auto
651 _big_endian=auto
652 _bitmap_font=yes
653 _freetype=auto
654 _fontconfig=auto
655 _menu=no
656 _qtx=auto
657 _macosx=auto
658 _maemo=auto
659 _macosx_finder_support=no
660 _macosx_bundle=auto
661 _sortsub=yes
662 _freetypeconfig='freetype-config'
663 _fribidi=auto
664 _fribidiconfig='fribidi-config'
665 _enca=auto
666 _inet6=auto
667 _gethostbyname2=auto
668 _ftp=yes
669 _musepack=auto
670 _vstream=auto
671 _pthreads=auto
672 _w32threads=auto
673 _ass=auto
674 _rpath=no
675 _asmalign_pot=auto
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`
746 --with-dvdread-config=*)
747 _dvdreadconfig=`echo $ac_option | cut -d '=' -f 2`
750 --extra-libs=*)
751 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
753 --extra-libs-mplayer=*)
754 _libs_mplayer=`echo $ac_option | cut -d '=' -f 2`
756 --extra-libs-mencoder=*)
757 _libs_mencoder=`echo $ac_option | cut -d '=' -f 2`
760 --target=*)
761 _target=`echo $ac_option | cut -d '=' -f 2`
763 --cc=*)
764 _cc=`echo $ac_option | cut -d '=' -f 2`
766 --host-cc=*)
767 _host_cc=`echo $ac_option | cut -d '=' -f 2`
769 --as=*)
770 _as=`echo $ac_option | cut -d '=' -f 2`
772 --ar=*)
773 _ar=`echo $ac_option | cut -d '=' -f 2`
775 --ranlib=*)
776 _ranlib=`echo $ac_option | cut -d '=' -f 2`
778 --windres=*)
779 _windres=`echo $ac_option | cut -d '=' -f 2`
781 --charset=*)
782 _charset=`echo $ac_option | cut -d '=' -f 2`
784 --language=*)
785 _language=`echo $ac_option | cut -d '=' -f 2`
788 --enable-static)
789 _ld_static='-static'
791 --disable-static)
792 _ld_static=''
794 --enable-profile)
795 _profile='-p'
797 --disable-profile)
798 _profile=
800 --enable-debug)
801 _debug='-g'
803 --enable-debug=*)
804 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
806 --disable-debug)
807 _debug=
809 --enable-gcc-check) _gcc_check=yes ;;
810 --disable-gcc-check) _gcc_check=no ;;
811 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
812 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
813 --enable-cross-compile) _cross_compile=yes ;;
814 --disable-cross-compile) _cross_compile=no ;;
815 --enable-mencoder) _mencoder=yes ;;
816 --disable-mencoder) _mencoder=no ;;
817 --enable-mplayer) _mplayer=yes ;;
818 --disable-mplayer) _mplayer=no ;;
819 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
820 --disable-dynamic-plugins) _dynamic_plugins=no ;;
821 --enable-x11) _x11=yes ;;
822 --disable-x11) _x11=no ;;
823 --enable-xshape) _xshape=yes ;;
824 --disable-xshape) _xshape=no ;;
825 --enable-xss) _xss=yes ;;
826 --disable-xss) _xss=no ;;
827 --enable-xv) _xv=yes ;;
828 --disable-xv) _xv=no ;;
829 --enable-xvmc) _xvmc=yes ;;
830 --disable-xvmc) _xvmc=no ;;
831 --enable-sdl) _sdl=yes ;;
832 --disable-sdl) _sdl=no ;;
833 --enable-directx) _directx=yes ;;
834 --disable-directx) _directx=no ;;
835 --enable-win32waveout) _win32waveout=yes ;;
836 --disable-win32waveout) _win32waveout=no ;;
837 --enable-nas) _nas=yes ;;
838 --disable-nas) _nas=no ;;
839 --enable-png) _png=yes ;;
840 --disable-png) _png=no ;;
841 --enable-jpeg) _jpeg=yes ;;
842 --disable-jpeg) _jpeg=no ;;
843 --enable-pnm) _pnm=yes ;;
844 --disable-pnm) _pnm=no ;;
845 --enable-md5sum) _md5sum=yes ;;
846 --disable-md5sum) _md5sum=no ;;
847 --enable-gif) _gif=yes ;;
848 --disable-gif) _gif=no ;;
849 --enable-gl) _gl=yes ;;
850 --disable-gl) _gl=no ;;
851 --enable-ggi) _ggi=yes ;;
852 --disable-ggi) _ggi=no ;;
853 --enable-ggiwmh) _ggiwmh=yes ;;
854 --disable-ggiwmh) _ggiwmh=no ;;
855 --enable-aa) _aa=yes ;;
856 --disable-aa) _aa=no ;;
857 --enable-caca) _caca=yes ;;
858 --disable-caca) _caca=no ;;
859 --enable-svga) _svga=yes ;;
860 --disable-svga) _svga=no ;;
861 --enable-vesa) _vesa=yes ;;
862 --disable-vesa) _vesa=no ;;
863 --enable-fbdev) _fbdev=yes ;;
864 --disable-fbdev) _fbdev=no ;;
865 --enable-dvb) _dvb=yes ;;
866 --disable-dvb) _dvb=no ;;
867 --enable-dvbhead) _dvbhead=yes ;;
868 --disable-dvbhead) _dvbhead=no ;;
869 --enable-dxr2) _dxr2=yes ;;
870 --disable-dxr2) _dxr2=no ;;
871 --enable-dxr3) _dxr3=yes ;;
872 --disable-dxr3) _dxr3=no ;;
873 --enable-ivtv) _ivtv=yes ;;
874 --disable-ivtv) _ivtv=no ;;
875 --enable-v4l2) _v4l2=yes ;;
876 --disable-v4l2) _v4l2=no ;;
877 --enable-iconv) _iconv=yes ;;
878 --disable-iconv) _iconv=no ;;
879 --enable-langinfo) _langinfo=yes ;;
880 --disable-langinfo) _langinfo=no ;;
881 --enable-rtc) _rtc=yes ;;
882 --disable-rtc) _rtc=no ;;
883 --enable-libdv) _libdv=yes ;;
884 --disable-libdv) _libdv=no ;;
885 --enable-ossaudio) _ossaudio=yes ;;
886 --disable-ossaudio) _ossaudio=no ;;
887 --enable-arts) _arts=yes ;;
888 --disable-arts) _arts=no ;;
889 --enable-esd) _esd=yes ;;
890 --disable-esd) _esd=no ;;
891 --enable-pulse) _pulse=yes ;;
892 --disable-pulse) _pulse=no ;;
893 --enable-jack) _jack=yes ;;
894 --disable-jack) _jack=no ;;
895 --enable-openal) _openal=yes ;;
896 --disable-openal) _openal=no ;;
897 --enable-mad) _mad=yes ;;
898 --disable-mad) _mad=no ;;
899 --enable-toolame) _toolame=yes ;;
900 --disable-toolame) _toolame=no ;;
901 --enable-twolame) _twolame=yes ;;
902 --disable-twolame) _twolame=no ;;
903 --enable-libcdio) _libcdio=yes ;;
904 --disable-libcdio) _libcdio=no ;;
905 --enable-liblzo) _liblzo=yes ;;
906 --disable-liblzo) _liblzo=no ;;
907 --enable-libvorbis) _libvorbis=yes ;;
908 --disable-libvorbis) _libvorbis=no ;;
909 --enable-speex) _speex=yes ;;
910 --disable-speex) _speex=no ;;
911 --enable-tremor-internal) _tremor_internal=yes ;;
912 --disable-tremor-internal) _tremor_internal=no ;;
913 --enable-tremor-low) _tremor_low=yes ;;
914 --disable-tremor-low) _tremor_low=no ;;
915 --enable-tremor-external) _tremor_external=yes ;;
916 --disable-tremor-external) _tremor_external=no ;;
917 --enable-theora) _theora=yes ;;
918 --disable-theora) _theora=no ;;
919 --enable-mp3lib) _mp3lib=yes ;;
920 --disable-mp3lib) _mp3lib=no ;;
921 --enable-liba52) _liba52=yes ;;
922 --disable-liba52) _liba52=no ;;
923 --enable-libdca) _libdca=yes ;;
924 --disable-libdca) _libdca=no ;;
925 --enable-libmpeg2) _libmpeg2=yes ;;
926 --disable-libmpeg2) _libmpeg2=no ;;
927 --enable-musepack) _musepack=yes ;;
928 --disable-musepack) _musepack=no ;;
929 --enable-faad-internal) _faad_internal=yes ;;
930 --disable-faad-internal) _faad_internal=no ;;
931 --enable-faad-external) _faad_external=yes ;;
932 --disable-faad-external) _faad_external=no ;;
933 --enable-faad-fixed) _faad_fixed=yes ;;
934 --disable-faad-fixed) _faad_fixed=no ;;
935 --enable-faac) _faac=yes ;;
936 --disable-faac) _faac=no ;;
937 --enable-ladspa) _ladspa=yes ;;
938 --disable-ladspa) _ladspa=no ;;
939 --enable-xmms) _xmms=yes ;;
940 --disable-xmms) _xmms=no ;;
941 --enable-dvdread) _dvdread=yes ;;
942 --disable-dvdread) _dvdread=no ;;
943 --enable-dvdread-internal) _dvdread_internal=yes ;;
944 --disable-dvdread-internal) _dvdread_internal=no ;;
945 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
946 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
947 --enable-dvdnav) _dvdnav=yes ;;
948 --disable-dvdnav) _dvdnav=no ;;
949 --enable-xanim) _xanim=yes ;;
950 --disable-xanim) _xanim=no ;;
951 --enable-real) _real=yes ;;
952 --disable-real) _real=no ;;
953 --enable-live) _live=yes ;;
954 --disable-live) _live=no ;;
955 --enable-nemesi) _nemesi=yes ;;
956 --disable-nemesi) _nemesi=no ;;
957 --enable-xinerama) _xinerama=yes ;;
958 --disable-xinerama) _xinerama=no ;;
959 --enable-mga) _mga=yes ;;
960 --disable-mga) _mga=no ;;
961 --enable-xmga) _xmga=yes ;;
962 --disable-xmga) _xmga=no ;;
963 --enable-vm) _vm=yes ;;
964 --disable-vm) _vm=no ;;
965 --enable-xf86keysym) _xf86keysym=yes ;;
966 --disable-xf86keysym) _xf86keysym=no ;;
967 --enable-mlib) _mlib=yes ;;
968 --disable-mlib) _mlib=no ;;
969 --enable-sunaudio) _sunaudio=yes ;;
970 --disable-sunaudio) _sunaudio=no ;;
971 --enable-sgiaudio) _sgiaudio=yes ;;
972 --disable-sgiaudio) _sgiaudio=no ;;
973 --enable-alsa) _alsa=yes ;;
974 --disable-alsa) _alsa=no ;;
975 --enable-tv) _tv=yes ;;
976 --disable-tv) _tv=no ;;
977 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
978 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
979 --enable-tv-v4l1) _tv_v4l1=yes ;;
980 --disable-tv-v4l1) _tv_v4l1=no ;;
981 --enable-tv-v4l2) _tv_v4l2=yes ;;
982 --disable-tv-v4l2) _tv_v4l2=no ;;
983 --enable-tv-dshow) _tv_dshow=yes ;;
984 --disable-tv-dshow) _tv_dshow=no ;;
985 --enable-tv-teletext) _tv_teletext=yes ;;
986 --disable-tv-teletext) _tv_teletext=no ;;
987 --enable-radio) _radio=yes ;;
988 --enable-radio-capture) _radio_capture=yes ;;
989 --disable-radio-capture) _radio_capture=no ;;
990 --disable-radio) _radio=no ;;
991 --enable-radio-v4l) _radio_v4l=yes ;;
992 --disable-radio-v4l) _radio_v4l=no ;;
993 --enable-radio-v4l2) _radio_v4l2=yes ;;
994 --disable-radio-v4l2) _radio_v4l2=no ;;
995 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
996 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
997 --enable-pvr) _pvr=yes ;;
998 --disable-pvr) _pvr=no ;;
999 --enable-fastmemcpy) _fastmemcpy=yes ;;
1000 --disable-fastmemcpy) _fastmemcpy=no ;;
1001 --enable-network) _network=yes ;;
1002 --disable-network) _network=no ;;
1003 --enable-winsock2) _winsock2=yes ;;
1004 --disable-winsock2) _winsock2=no ;;
1005 --enable-smb) _smbsupport=yes ;;
1006 --disable-smb) _smbsupport=no ;;
1007 --enable-vidix-internal) _vidix_internal=yes ;;
1008 --disable-vidix-internal) _vidix_internal=no ;;
1009 --enable-vidix-external) _vidix_external=yes ;;
1010 --disable-vidix-external) _vidix_external=no ;;
1011 --with-vidix-drivers=*)
1012 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
1014 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1015 --enable-joystick) _joystick=yes ;;
1016 --disable-joystick) _joystick=no ;;
1017 --enable-xvid) _xvid=yes ;;
1018 --disable-xvid) _xvid=no ;;
1019 --enable-x264) _x264=yes ;;
1020 --disable-x264) _x264=no ;;
1021 --enable-libnut) _libnut=yes ;;
1022 --disable-libnut) _libnut=no ;;
1023 --enable-libavutil_a) _libavutil_a=yes ;;
1024 --disable-libavutil_a) _libavutil_a=no ;;
1025 --enable-libavutil_so) _libavutil_so=yes ;;
1026 --disable-libavutil_so) _libavutil_so=no ;;
1027 --enable-libavcodec_a) _libavcodec_a=yes ;;
1028 --disable-libavcodec_a) _libavcodec_a=no ;;
1029 --enable-libavcodec_so) _libavcodec_so=yes ;;
1030 --disable-libavcodec_so) _libavcodec_so=no ;;
1031 --enable-libamr_nb) _libamr_nb=yes ;;
1032 --disable-libamr_nb) _libamr_nb=no ;;
1033 --enable-libamr_wb) _libamr_wb=yes ;;
1034 --disable-libamr_wb) _libamr_wb=no ;;
1035 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1036 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1037 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1038 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1039 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1040 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1041 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1042 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1043 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1044 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1045 --enable-libavformat_a) _libavformat_a=yes ;;
1046 --disable-libavformat_a) _libavformat_a=no ;;
1047 --enable-libavformat_so) _libavformat_so=yes ;;
1048 --disable-libavformat_so) _libavformat_so=no ;;
1049 --enable-libpostproc_a) _libpostproc_a=yes ;;
1050 --disable-libpostproc_a) _libpostproc_a=no ;;
1051 --enable-libpostproc_so) _libpostproc_so=yes ;;
1052 --disable-libpostproc_so) _libpostproc_so=no ;;
1053 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1054 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1056 --enable-lirc) _lirc=yes ;;
1057 --disable-lirc) _lirc=no ;;
1058 --enable-lircc) _lircc=yes ;;
1059 --disable-lircc) _lircc=no ;;
1060 --enable-apple-remote) _apple_remote=yes ;;
1061 --disable-apple-remote) _apple_remote=no ;;
1062 --enable-gui) _gui=yes ;;
1063 --disable-gui) _gui=no ;;
1064 --enable-gtk1) _gtk1=yes ;;
1065 --disable-gtk1) _gtk1=no ;;
1066 --enable-termcap) _termcap=yes ;;
1067 --disable-termcap) _termcap=no ;;
1068 --enable-termios) _termios=yes ;;
1069 --disable-termios) _termios=no ;;
1070 --enable-3dfx) _3dfx=yes ;;
1071 --disable-3dfx) _3dfx=no ;;
1072 --enable-s3fb) _s3fb=yes ;;
1073 --disable-s3fb) _s3fb=no ;;
1074 --enable-tdfxfb) _tdfxfb=yes ;;
1075 --disable-tdfxfb) _tdfxfb=no ;;
1076 --disable-tdfxvid) _tdfxvid=no ;;
1077 --enable-tdfxvid) _tdfxvid=yes ;;
1078 --disable-xvr100) _xvr100=no ;;
1079 --enable-xvr100) _xvr100=yes ;;
1080 --disable-tga) _tga=no ;;
1081 --enable-tga) _tga=yes ;;
1082 --enable-directfb) _directfb=yes ;;
1083 --disable-directfb) _directfb=no ;;
1084 --enable-zr) _zr=yes ;;
1085 --disable-zr) _zr=no ;;
1086 --enable-bl) _bl=yes ;;
1087 --disable-bl) _bl=no ;;
1088 --enable-mtrr) _mtrr=yes ;;
1089 --disable-mtrr) _mtrr=no ;;
1090 --enable-largefiles) _largefiles=yes ;;
1091 --disable-largefiles) _largefiles=no ;;
1092 --enable-shm) _shm=yes ;;
1093 --disable-shm) _shm=no ;;
1094 --enable-select) _select=yes ;;
1095 --disable-select) _select=no ;;
1096 --enable-linux-devfs) _linux_devfs=yes ;;
1097 --disable-linux-devfs) _linux_devfs=no ;;
1098 --enable-cdparanoia) _cdparanoia=yes ;;
1099 --disable-cdparanoia) _cdparanoia=no ;;
1100 --enable-cddb) _cddb=yes ;;
1101 --disable-cddb) _cddb=no ;;
1102 --enable-big-endian) _big_endian=yes ;;
1103 --disable-big-endian) _big_endian=no ;;
1104 --enable-bitmap-font) _bitmap_font=yes ;;
1105 --disable-bitmap-font) _bitmap_font=no ;;
1106 --enable-freetype) _freetype=yes ;;
1107 --disable-freetype) _freetype=no ;;
1108 --enable-fontconfig) _fontconfig=yes ;;
1109 --disable-fontconfig) _fontconfig=no ;;
1110 --enable-unrarexec) _unrar_exec=yes ;;
1111 --disable-unrarexec) _unrar_exec=no ;;
1112 --enable-ftp) _ftp=yes ;;
1113 --disable-ftp) _ftp=no ;;
1114 --enable-vstream) _vstream=yes ;;
1115 --disable-vstream) _vstream=no ;;
1116 --enable-pthreads) _pthreads=yes ;;
1117 --disable-pthreads) _pthreads=no ;;
1118 --enable-w32threads) _w32threads=yes ;;
1119 --disable-w32threads) _w32threads=no ;;
1120 --enable-ass) _ass=yes ;;
1121 --disable-ass) _ass=no ;;
1122 --enable-rpath) _rpath=yes ;;
1123 --disable-rpath) _rpath=no ;;
1125 --enable-fribidi) _fribidi=yes ;;
1126 --disable-fribidi) _fribidi=no ;;
1128 --enable-enca) _enca=yes ;;
1129 --disable-enca) _enca=no ;;
1131 --enable-inet6) _inet6=yes ;;
1132 --disable-inet6) _inet6=no ;;
1134 --enable-gethostbyname2) _gethostbyname2=yes ;;
1135 --disable-gethostbyname2) _gethostbyname2=no ;;
1137 --enable-dga1) _dga1=yes ;;
1138 --disable-dga1) _dga1=no ;;
1139 --enable-dga2) _dga2=yes ;;
1140 --disable-dga2) _dga2=no ;;
1142 --enable-menu) _menu=yes ;;
1143 --disable-menu) _menu=no ;;
1145 --enable-qtx) _qtx=yes ;;
1146 --disable-qtx) _qtx=no ;;
1148 --enable-macosx) _macosx=yes ;;
1149 --disable-macosx) _macosx=no ;;
1150 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1151 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1152 --enable-macosx-bundle) _macosx_bundle=yes;;
1153 --disable-macosx-bundle) _macosx_bundle=no;;
1155 --enable-maemo) _maemo=yes ;;
1156 --disable-maemo) _maemo=no ;;
1158 --enable-sortsub) _sortsub=yes ;;
1159 --disable-sortsub) _sortsub=no ;;
1161 --enable-crash-debug) _crash_debug=yes ;;
1162 --disable-crash-debug) _crash_debug=no ;;
1163 --enable-sighandler) _sighandler=yes ;;
1164 --disable-sighandler) _sighandler=no ;;
1165 --enable-win32dll) _win32dll=yes ;;
1166 --disable-win32dll) _win32dll=no ;;
1168 --enable-sse) _sse=yes ;;
1169 --disable-sse) _sse=no ;;
1170 --enable-sse2) _sse2=yes ;;
1171 --disable-sse2) _sse2=no ;;
1172 --enable-ssse3) _ssse3=yes ;;
1173 --disable-ssse3) _ssse3=no ;;
1174 --enable-mmxext) _mmxext=yes ;;
1175 --disable-mmxext) _mmxext=no ;;
1176 --enable-3dnow) _3dnow=yes ;;
1177 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1178 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1179 --disable-3dnowext) _3dnowext=no ;;
1180 --enable-cmov) _cmov=yes ;;
1181 --disable-cmov) _cmov=no ;;
1182 --enable-fast-cmov) _fast_cmov=yes ;;
1183 --disable-fast-cmov) _fast_cmov=no ;;
1184 --enable-altivec) _altivec=yes ;;
1185 --disable-altivec) _altivec=no ;;
1186 --enable-armv5te) _armv5te=yes ;;
1187 --disable-armv5te) _armv5te=no ;;
1188 --enable-armv6) _armv6=yes ;;
1189 --disable-armv6) _armv6=no ;;
1190 --enable-iwmmxt) _iwmmxt=yes ;;
1191 --disable-iwmmxt) _iwmmxt=no ;;
1192 --enable-mmx) _mmx=yes ;;
1193 --disable-mmx) # 3Dnow! and MMX2 require MMX
1194 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1197 echo "Unknown parameter: $ac_option"
1198 exit 1
1201 esac
1202 done
1204 # Atmos: moved this here, to be correct, if --prefix is specified
1205 test -z "$_bindir" && _bindir="$_prefix/bin"
1206 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1207 test -z "$_mandir" && _mandir="$_prefix/share/man"
1208 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1209 test -z "$_libdir" && _libdir="$_prefix/lib"
1211 # Determine our OS name and CPU architecture
1212 if test -z "$_target" ; then
1213 # OS name
1214 system_name=`uname -s 2>&1`
1215 case "$system_name" in
1216 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1218 IRIX*)
1219 system_name=IRIX
1221 GNU/kFreeBSD)
1222 system_name=FreeBSD
1224 HP-UX*)
1225 system_name=HP-UX
1227 [cC][yY][gG][wW][iI][nN]*)
1228 system_name=CYGWIN
1230 MINGW32*)
1231 system_name=MINGW32
1233 OS/2*)
1234 system_name=OS/2
1237 system_name="$system_name-UNKNOWN"
1239 esac
1242 # host's CPU/instruction set
1243 host_arch=`uname -p 2>&1`
1244 case "$host_arch" in
1245 i386|sparc|ppc|alpha|arm|sh3|mips|vax)
1247 powerpc) # Darwin returns 'powerpc'
1248 host_arch=ppc
1250 *) # uname -p on Linux returns 'unknown' for the processor type,
1251 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1253 # Maybe uname -m (machine hardware name) returns something we
1254 # recognize.
1256 # x86/x86pc is used by QNX
1257 case "`uname -m 2>&1`" in
1258 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 ;;
1259 ia64) host_arch=ia64 ;;
1260 x86_64|amd64)
1261 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1262 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1263 host_arch=x86_64
1264 else
1265 host_arch=i386
1268 macppc|ppc|ppc64) host_arch=ppc ;;
1269 alpha) host_arch=alpha ;;
1270 sparc) host_arch=sparc ;;
1271 sparc64) host_arch=sparc64 ;;
1272 parisc*|hppa*|9000*) host_arch=hppa ;;
1273 arm*|zaurus|cats) host_arch=arm ;;
1274 sh3) host_arch=sh3 ;;
1275 s390) host_arch=s390 ;;
1276 s390x) host_arch=s390x ;;
1277 mips*) host_arch=mips ;;
1278 vax) host_arch=vax ;;
1279 xtensa*) host_arch=xtensa ;;
1280 *) host_arch=UNKNOWN ;;
1281 esac
1283 esac
1284 else # if test -z "$_target"
1285 system_name=`echo $_target | cut -d '-' -f 2`
1286 case "`echo $system_name | tr A-Z a-z`" in
1287 linux) system_name=Linux ;;
1288 freebsd) system_name=FreeBSD ;;
1289 gnu/kfreebsd) system_name=FreeBSD ;;
1290 netbsd) system_name=NetBSD ;;
1291 bsd/os) system_name=BSD/OS ;;
1292 openbsd) system_name=OpenBSD ;;
1293 dragonfly) system_name=DragonFly ;;
1294 sunos) system_name=SunOS ;;
1295 qnx) system_name=QNX ;;
1296 morphos) system_name=MorphOS ;;
1297 amigaos) system_name=AmigaOS ;;
1298 mingw32msvc) system_name=MINGW32 ;;
1299 esac
1300 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1301 host_arch=`echo $_target | cut -d '-' -f 1`
1302 if test `echo $host_arch` != "x86_64" ; then
1303 host_arch=`echo $host_arch | tr '_' '-'`
1307 echo "Detected operating system: $system_name"
1308 echo "Detected host architecture: $host_arch"
1310 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1311 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1315 _timer=timer-linux.c
1316 _getch=getch2.c
1317 if freebsd ; then
1318 _ld_extra="$_ld_extra -L/usr/local/lib"
1319 _inc_extra="$_inc_extra -I/usr/local/include"
1322 if netbsd || dragonfly ; then
1323 _ld_extra="$_ld_extra -L/usr/pkg/lib"
1324 _inc_extra="$_inc_extra -I/usr/pkg/include"
1327 if darwin; then
1328 _ld_extra="$_ld_extra -L/usr/local/lib"
1329 _inc_extra="$_inc_extra -I/usr/local/include"
1330 _timer=timer-darwin.c
1333 if aix ; then
1334 _ld_extra="$_ld_extra -lC"
1337 if irix ; then
1338 _ranlib='ar -r'
1339 elif linux ; then
1340 _ranlib='true'
1343 if win32 ; then
1344 _exesuf=".exe"
1345 # -lwinmm is always needed for osdep/timer-win2.c
1346 _ld_extra="$_ld_extra -lwinmm"
1347 _pe_executable=yes
1348 _timer=timer-win2.c
1351 if mingw32 ; then
1352 _getch=getch2-win.c
1353 _need_shmem=no
1356 if cygwin ; then
1357 _def_confwin32='#define WIN32'
1360 if amigaos ; then
1361 _select=no
1362 _sighandler=no
1363 _stream_cache=no
1364 _def_stream_cache="#undef USE_STREAM_CACHE"
1367 if qnx ; then
1368 _ld_extra="$_ld_extra -lph"
1371 if os2 ; then
1372 _exesuf=".exe"
1373 _getch=getch2-os2.c
1374 _need_shmem=no
1375 _ar="emxomfar -p256"
1376 _ranlib="echo ignoring ranlib"
1377 _ld_extra="$_ld_extra -Zomf -Zstack 16384 -Zbin-files -Zargs-wild -lmmpm2"
1380 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1381 test "$I" && break
1382 done
1385 TMPLOG="configure.log"
1386 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1387 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1388 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1389 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1390 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1392 rm -f "$TMPLOG"
1393 echo configuration: $_configuration > "$TMPLOG"
1394 echo >> "$TMPLOG"
1397 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1398 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1399 # know about '-n'.
1400 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1401 _head() { head -$1 2>/dev/null ; }
1402 else
1403 _head() { head -n $1 2>/dev/null ; }
1405 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1406 _tail() { tail -$1 2>/dev/null ; }
1407 else
1408 _tail() { tail -n $1 2>/dev/null ; }
1411 # Checking CC version...
1412 if test "$_gcc_check" = yes ; then
1413 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1414 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1415 echocheck "$_cc version"
1416 cc_vendor=intel
1417 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1418 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1419 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1420 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1421 # TODO verify older icc/ecc compatibility
1422 case $cc_version in
1424 cc_version="v. ?.??, bad"
1425 cc_verc_fail=yes
1427 10.1)
1428 cc_version="$cc_version, ok"
1429 cc_verc_fail=no
1432 cc_version="$cc_version, bad"
1433 cc_verc_fail=yes
1435 esac
1436 echores "$cc_version"
1437 else
1438 for _cc in "$_cc" gcc cc ; do
1439 echocheck "$_cc version"
1440 cc_vendor=gnu
1441 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1442 cc_version=`$_cc -dumpversion 2>&1`
1443 if test "$?" -gt 0; then
1444 cc_version="not found"
1446 case $cc_version in
1448 cc_version="v. ?.??, bad"
1449 cc_verc_fail=yes
1451 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1452 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1453 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1454 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1455 cc_version="$cc_version, ok"
1456 cc_verc_fail=no
1458 'not found')
1459 cc_verc_fail=yes
1462 cc_version="$cc_version, bad"
1463 cc_verc_fail=yes
1465 esac
1466 echores "$cc_version"
1467 test "$cc_verc_fail" = "no" && break
1468 done
1469 fi # icc
1470 if test "$cc_verc_fail" = yes ; then
1471 cat <<EOF
1473 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1475 You are not using a supported compiler. We do not have the time to make sure
1476 everything works with compilers other than the ones we use. Use either the
1477 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1478 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1480 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1481 mplayer and lame (which is used for mencoder). If you get compile errors,
1482 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1483 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1484 bugs!
1486 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1489 die "Bad gcc version"
1491 else
1492 cat <<EOF
1494 ******************************************************************************
1496 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1497 Ok. You know. Do it.
1499 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1500 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1501 Lame which is used by mencoder produces weird errors, too.
1503 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1504 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1506 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1508 ******************************************************************************
1512 read _answer
1515 echocheck "host cc"
1516 test "$_host_cc" || _host_cc=$_cc
1517 echores $_host_cc
1519 echocheck "cross compilation"
1520 if test $_cross_compile = auto ; then
1521 cat > $TMPC << EOF
1522 int main(void) { return 0; }
1524 _cross_compile=yes
1525 cc_check && "$TMPEXE" && _cross_compile=no
1527 echores $_cross_compile
1529 if test $_cross_compile = yes; then
1530 tmp_run() {
1531 return 0
1535 # ---
1537 # now that we know what compiler should be used for compilation, try to find
1538 # out which assembler is used by the $_cc compiler
1539 if test "$_as" = auto ; then
1540 _as=`$_cc -print-prog-name=as`
1541 test -z "$_as" && _as=as
1544 # XXX: this should be ok..
1545 _cpuinfo="echo"
1547 if test "$_runtime_cpudetection" = no ; then
1549 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1550 # FIXME: Remove the cygwin check once AMD CPUs are supported
1551 if test -r /proc/cpuinfo && ! cygwin; then
1552 # Linux with /proc mounted, extract CPU information from it
1553 _cpuinfo="cat /proc/cpuinfo"
1554 elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then
1555 # FreeBSD with Linux emulation /proc mounted,
1556 # extract CPU information from it
1557 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1558 elif darwin && ! x86_32 ; then
1559 # use hostinfo on Darwin
1560 _cpuinfo="hostinfo"
1561 elif aix; then
1562 # use 'lsattr' on AIX
1563 _cpuinfo="lsattr -E -l proc0 -a type"
1564 elif x86; then
1565 # all other OSes try to extract CPU information from a small helper
1566 # program cpuinfo instead
1567 $_cc -o cpuinfo$_exesuf cpuinfo.c
1568 _cpuinfo="./cpuinfo$_exesuf"
1571 if x86 ; then
1572 # gather more CPU information
1573 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1574 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1575 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1576 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1577 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1579 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1581 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1582 -e s/xmm/sse/ -e s/kni/sse/`
1584 for ext in $pparam ; do
1585 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1586 done
1588 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1589 test $_sse = kernel_check && _mmxext=kernel_check
1591 echocheck "CPU vendor"
1592 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1594 echocheck "CPU type"
1595 echores "$pname"
1598 fi # test "$_runtime_cpudetection" = no
1600 if x86 && test "$_runtime_cpudetection" = no ; then
1601 extcheck() {
1602 if test "$1" = kernel_check ; then
1603 echocheck "kernel support of $2"
1604 cat > $TMPC <<EOF
1605 #include <signal.h>
1606 void catch() { exit(1); }
1607 int main(void){
1608 signal(SIGILL, catch);
1609 __asm__ __volatile__ ("$3":::"memory");return(0);
1613 if cc_check && tmp_run ; then
1614 eval _$2=yes
1615 echores "yes"
1616 _optimizing="$_optimizing $2"
1617 return 0
1618 else
1619 eval _$2=no
1620 echores "failed"
1621 echo "It seems that your kernel does not correctly support $2."
1622 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1623 return 1
1626 return 0
1629 extcheck $_mmx "mmx" "emms"
1630 extcheck $_mmxext "mmxext" "sfence"
1631 extcheck $_3dnow "3dnow" "femms"
1632 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1633 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1634 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1635 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1636 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1638 echocheck "mtrr support"
1639 if test "$_mtrr" = kernel_check ; then
1640 _mtrr="yes"
1641 _optimizing="$_optimizing mtrr"
1643 echores "$_mtrr"
1645 if test "$_gcc3_ext" != ""; then
1646 # if we had to disable sse/sse2 because the active kernel does not
1647 # support this instruction set extension, we also have to tell
1648 # gcc3 to not generate sse/sse2 instructions for normal C code
1649 cat > $TMPC << EOF
1650 int main(void) { return 0; }
1652 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1658 _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'
1659 case "$host_arch" in
1660 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1661 _arch='X86 X86_32'
1662 _target_arch_x86="ARCH_X86 = yes"
1663 _target_arch="ARCH_X86_32 = yes"
1664 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1665 iproc=486
1666 proc=i486
1669 if test "$_runtime_cpudetection" = no ; then
1670 case "$pvendor" in
1671 AuthenticAMD)
1672 case "$pfamily" in
1673 3) proc=i386 iproc=386 ;;
1674 4) proc=i486 iproc=486 ;;
1675 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1676 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1677 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1678 proc=k6-3
1679 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1680 proc=geode
1681 elif test "$pmodel" -ge 8; then
1682 proc=k6-2
1683 elif test "$pmodel" -ge 6; then
1684 proc=k6
1685 else
1686 proc=i586
1689 6) iproc=686
1690 # It's a bit difficult to determine the correct type of Family 6
1691 # AMD CPUs just from their signature. Instead, we check directly
1692 # whether it supports SSE.
1693 if test "$_sse" = yes; then
1694 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1695 proc=athlon-xp
1696 else
1697 # Again, gcc treats athlon and athlon-tbird similarly.
1698 proc=athlon
1701 15) iproc=686
1702 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1703 # caught and remedied in the optimization tests below.
1704 proc=k8
1707 *) proc=k8 iproc=686 ;;
1708 esac
1710 GenuineIntel)
1711 case "$pfamily" in
1712 3) proc=i386 iproc=386 ;;
1713 4) proc=i486 iproc=486 ;;
1714 5) iproc=586
1715 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1716 proc=pentium-mmx # 4 is desktop, 8 is mobile
1717 else
1718 proc=i586
1721 6) iproc=686
1722 if test "$pmodel" -ge 15; then
1723 proc=core2
1724 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1725 proc=pentium-m
1726 elif test "$pmodel" -ge 7; then
1727 proc=pentium3
1728 elif test "$pmodel" -ge 3; then
1729 proc=pentium2
1730 else
1731 proc=i686
1734 15) iproc=686
1735 # A nocona in 32-bit mode has no more capabilities than a prescott.
1736 if test "$pmodel" -ge 3; then
1737 proc=prescott
1738 else
1739 proc=pentium4
1741 test $_fast_cmov = "auto" && _fast_cmov=no
1743 *) proc=prescott iproc=686 ;;
1744 esac
1746 CentaurHauls)
1747 case "$pfamily" in
1748 5) iproc=586
1749 if test "$pmodel" -ge 8; then
1750 proc=winchip2
1751 elif test "$pmodel" -ge 4; then
1752 proc=winchip-c6
1753 else
1754 proc=i586
1757 6) iproc=686
1758 if test "$pmodel" -ge 9; then
1759 proc=c3-2
1760 else
1761 proc=c3
1762 iproc=586
1765 *) proc=i686 iproc=i686 ;;
1766 esac
1768 unknown)
1769 case "$pfamily" in
1770 3) proc=i386 iproc=386 ;;
1771 4) proc=i486 iproc=486 ;;
1772 *) proc=i586 iproc=586 ;;
1773 esac
1776 proc=i586 iproc=586 ;;
1777 esac
1778 fi # test "$_runtime_cpudetection" = no
1781 # check that gcc supports our CPU, if not, fall back to earlier ones
1782 # LGB: check -mcpu and -march swithing step by step with enabling
1783 # to fall back till 386.
1785 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1787 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1788 cpuopt=-mtune
1789 else
1790 cpuopt=-mcpu
1793 echocheck "GCC & CPU optimization abilities"
1794 cat > $TMPC << EOF
1795 int main(void) { return 0; }
1797 if test "$_runtime_cpudetection" = no ; then
1798 cc_check -march=native && proc=native
1799 if test "$proc" = "k8"; then
1800 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1802 if test "$proc" = "athlon-xp"; then
1803 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1805 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1806 cc_check -march=$proc $cpuopt=$proc || proc=k6
1808 if test "$proc" = "k6" || test "$proc" = "c3"; then
1809 if ! cc_check -march=$proc $cpuopt=$proc; then
1810 if cc_check -march=i586 $cpuopt=i686; then
1811 proc=i586-i686
1812 else
1813 proc=i586
1817 if test "$proc" = "prescott" ; then
1818 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1820 if test "$proc" = "core2" ; then
1821 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1823 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
1824 cc_check -march=$proc $cpuopt=$proc || proc=i686
1826 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1827 cc_check -march=$proc $cpuopt=$proc || proc=i586
1829 if test "$proc" = "i586"; then
1830 cc_check -march=$proc $cpuopt=$proc || proc=i486
1832 if test "$proc" = "i486" ; then
1833 cc_check -march=$proc $cpuopt=$proc || proc=i386
1835 if test "$proc" = "i386" ; then
1836 cc_check -march=$proc $cpuopt=$proc || proc=error
1838 if test "$proc" = "error" ; then
1839 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1840 _mcpu=""
1841 _march=""
1842 _optimizing=""
1843 elif test "$proc" = "i586-i686"; then
1844 _march="-march=i586"
1845 _mcpu="$cpuopt=i686"
1846 _optimizing="$proc"
1847 else
1848 _march="-march=$proc"
1849 _mcpu="$cpuopt=$proc"
1850 _optimizing="$proc"
1852 else # if test "$_runtime_cpudetection" = no
1853 _mcpu="$cpuopt=generic"
1854 # at least i486 required, for bswap instruction
1855 _march="-march=i486"
1856 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1857 cc_check $_mcpu || _mcpu=""
1858 cc_check $_march $_mcpu || _march=""
1861 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1862 ## autodetected mcpu/march parameters
1863 if test "$_target" ; then
1864 # TODO: it may be a good idea to check GCC and fall back in all cases
1865 if test "$host_arch" = "i586-i686"; then
1866 _march="-march=i586"
1867 _mcpu="$cpuopt=i686"
1868 else
1869 _march="-march=$host_arch"
1870 _mcpu="$cpuopt=$host_arch"
1873 proc="$host_arch"
1875 case "$proc" in
1876 i386) iproc=386 ;;
1877 i486) iproc=486 ;;
1878 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1879 i686|athlon*|pentium*) iproc=686 ;;
1880 *) iproc=586 ;;
1881 esac
1884 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1885 _fast_cmov="yes"
1886 else
1887 _fast_cmov="no"
1890 echores "$proc"
1893 ia64)
1894 _arch='IA64'
1895 _target_arch='ARCH_IA64 = yes'
1896 iproc='ia64'
1897 proc=''
1898 _march=''
1899 _mcpu=''
1900 _optimizing=''
1903 x86_64|amd64)
1904 _arch='X86 X86_64'
1905 _target_arch='ARCH_X86_64 = yes'
1906 _target_arch_x86="ARCH_X86 = yes"
1907 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1908 iproc='x86_64'
1910 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1911 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1912 cpuopt=-mtune
1913 else
1914 cpuopt=-mcpu
1916 if test "$_runtime_cpudetection" = no ; then
1917 case "$pvendor" in
1918 AuthenticAMD)
1919 proc=k8;;
1920 GenuineIntel)
1921 case "$pfamily" in
1922 6) proc=core2;;
1924 # 64-bit prescotts exist, but as far as GCC is concerned they
1925 # have the same capabilities as a nocona.
1926 proc=nocona
1927 test $_fast_cmov = "auto" && _fast_cmov=no
1929 esac
1932 proc=error;;
1933 esac
1934 fi # test "$_runtime_cpudetection" = no
1936 echocheck "GCC & CPU optimization abilities"
1937 cat > $TMPC << EOF
1938 int main(void) { return 0; }
1940 # This is a stripped-down version of the i386 fallback.
1941 if test "$_runtime_cpudetection" = no ; then
1942 cc_check -march=native && proc=native
1943 # --- AMD processors ---
1944 if test "$proc" = "k8"; then
1945 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1947 # This will fail if gcc version < 3.3, which is ok because earlier
1948 # versions don't really support 64-bit on amd64.
1949 # Is this a valid assumption? -Corey
1950 if test "$proc" = "athlon-xp"; then
1951 cc_check -march=$proc $cpuopt=$proc || proc=error
1953 # --- Intel processors ---
1954 if test "$proc" = "core2"; then
1955 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1957 if test "$proc" = "nocona"; then
1958 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1960 if test "$proc" = "pentium4"; then
1961 cc_check -march=$proc $cpuopt=$proc || proc=error
1964 _march="-march=$proc"
1965 _mcpu="$cpuopt=$proc"
1966 if test "$proc" = "error" ; then
1967 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1968 _mcpu=""
1969 _march=""
1971 else # if test "$_runtime_cpudetection" = no
1972 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1973 _march="-march=x86-64"
1974 _mcpu="$cpuopt=generic"
1975 cc_check $_mcpu || _mcpu="x86-64"
1976 cc_check $_mcpu || _mcpu=""
1977 cc_check $_march $_mcpu || _march=""
1980 _optimizing=""
1982 echores "$proc"
1985 sparc)
1986 _arch='SPARC'
1987 _target_arch='ARCH_SPARC = yes'
1988 iproc='sparc'
1989 if sunos ; then
1990 echocheck "CPU type"
1991 karch=`uname -m`
1992 case "`echo $karch`" in
1993 sun4) proc=v7 ;;
1994 sun4c) proc=v7 ;;
1995 sun4d) proc=v8 ;;
1996 sun4m) proc=v8 ;;
1997 sun4u) proc=ultrasparc _vis='yes' ;;
1998 sun4v) proc=v9 ;;
1999 *) proc=v8 ;;
2000 esac
2001 echores "$proc"
2002 else
2003 proc=v8
2005 _march=''
2006 _mcpu="-mcpu=$proc"
2007 _optimizing="$proc"
2010 sparc64)
2011 _arch='SPARC'
2012 _target_arch='ARCH_SPARC = yes'
2013 _vis='yes'
2014 iproc='sparc'
2015 proc='ultrasparc'
2016 _march=''
2017 _mcpu="-mcpu=$proc"
2018 _optimizing="$proc"
2021 arm|armv4l|armv5tel)
2022 _arch='ARM ARMV4L'
2023 _target_arch='ARCH_ARMV4L = yes'
2024 iproc='arm'
2025 proc=''
2026 _march=''
2027 _mcpu=''
2028 _optimizing=''
2031 sh3)
2032 _arch='SH3'
2033 _target_arch='ARCH_SH3 = yes'
2034 iproc='sh3'
2035 proc=''
2036 _march='-m3'
2037 _mcpu='-ml'
2038 _optimizing=''
2041 ppc|powerpc)
2042 _arch='POWERPC PPC'
2043 _def_dcbzl='#undef HAVE_DCBZL'
2044 _target_arch='ARCH_POWERPC = yes'
2045 iproc='ppc'
2046 proc=''
2047 _march=''
2048 _mcpu=''
2049 _optimizing=''
2051 echocheck "CPU type"
2052 case $system_name in
2053 Linux)
2054 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2055 if test -n "`$_cpuinfo | grep altivec`"; then
2056 test $_altivec = auto && _altivec=yes
2059 Darwin)
2060 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2061 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2062 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2063 test $_altivec = auto && _altivec=yes
2066 NetBSD)
2067 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2068 case $cc_version in
2069 2*|3.0*|3.1*|3.2*|3.3*)
2072 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2073 test $_altivec = auto && _altivec=yes
2076 esac
2078 AIX)
2079 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2081 esac
2082 if test "$_altivec" = yes; then
2083 echores "$proc altivec"
2084 else
2085 _altivec=no
2086 echores "$proc"
2089 echocheck "GCC & CPU optimization abilities"
2091 if test -n "$proc"; then
2092 case "$proc" in
2093 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2094 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2095 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2096 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2097 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2098 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2099 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2100 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2101 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2102 *) ;;
2103 esac
2104 # gcc 3.1(.1) and up supports 7400 and 7450
2105 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2106 case "$proc" in
2107 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2108 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2109 *) ;;
2110 esac
2112 # gcc 3.2 and up supports 970
2113 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2114 case "$proc" in
2115 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2116 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2117 *) ;;
2118 esac
2120 # gcc 3.3 and up supports POWER4
2121 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2122 case "$proc" in
2123 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2124 *) ;;
2125 esac
2127 # gcc 3.4 and up supports 440*
2128 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2129 case "$proc" in
2130 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2131 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2132 *) ;;
2133 esac
2135 # gcc 4.0 and up supports POWER5
2136 if test "$_cc_major" -ge "4"; then
2137 case "$proc" in
2138 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2139 *) ;;
2140 esac
2144 if test -n "$_mcpu"; then
2145 _optimizing=`echo $_mcpu | cut -c 8-`
2146 echores "$_optimizing"
2147 else
2148 echores "none"
2153 alpha)
2154 _arch='ALPHA'
2155 _target_arch='ARCH_ALPHA = yes'
2156 iproc='alpha'
2157 _march=''
2159 echocheck "CPU type"
2160 cat > $TMPC << EOF
2161 int main(void) {
2162 unsigned long ver, mask;
2163 asm ("implver %0" : "=r" (ver));
2164 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2165 printf("%ld-%x\n", ver, ~mask);
2166 return 0;
2169 $_cc -o "$TMPEXE" "$TMPC"
2170 case `"$TMPEXE"` in
2172 0-0) proc="ev4"; _mvi="0";;
2173 1-0) proc="ev5"; _mvi="0";;
2174 1-1) proc="ev56"; _mvi="0";;
2175 1-101) proc="pca56"; _mvi="1";;
2176 2-303) proc="ev6"; _mvi="1";;
2177 2-307) proc="ev67"; _mvi="1";;
2178 2-1307) proc="ev68"; _mvi="1";;
2179 esac
2180 echores "$proc"
2182 echocheck "GCC & CPU optimization abilities"
2183 if test "$proc" = "ev68" ; then
2184 cc_check -mcpu=$proc || proc=ev67
2186 if test "$proc" = "ev67" ; then
2187 cc_check -mcpu=$proc || proc=ev6
2189 _mcpu="-mcpu=$proc"
2190 echores "$proc"
2192 _optimizing="$proc"
2195 mips)
2196 _arch='SGI_MIPS'
2197 _target_arch='ARCH_SGI_MIPS = yes'
2198 iproc='sgi-mips'
2199 proc=''
2200 _march=''
2201 _mcpu=''
2202 _optimizing=''
2204 if irix ; then
2205 echocheck "CPU type"
2206 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2207 case "`echo $proc`" in
2208 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2209 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2210 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2211 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2212 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2213 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2214 esac
2215 # gcc < 3.x does not support -mtune.
2216 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2217 _mcpu=''
2219 echores "$proc"
2224 hppa)
2225 _arch='PA_RISC'
2226 _target_arch='ARCH_PA_RISC = yes'
2227 iproc='PA-RISC'
2228 proc=''
2229 _march=''
2230 _mcpu=''
2231 _optimizing=''
2234 s390)
2235 _arch='S390'
2236 _target_arch='ARCH_S390 = yes'
2237 iproc='390'
2238 proc=''
2239 _march=''
2240 _mcpu=''
2241 _optimizing=''
2244 s390x)
2245 _arch='S390X'
2246 _target_arch='ARCH_S390X = yes'
2247 iproc='390x'
2248 proc=''
2249 _march=''
2250 _mcpu=''
2251 _optimizing=''
2254 vax)
2255 _arch='VAX'
2256 _target_arch='ARCH_VAX = yes'
2257 iproc='vax'
2258 proc=''
2259 _march=''
2260 _mcpu=''
2261 _optimizing=''
2264 xtensa)
2265 _arch='XTENSA'
2266 _target_arch='ARCH_XTENSA = yes'
2267 iproc='xtensa'
2268 proc=''
2269 _march=''
2270 _mcpu=''
2271 _optimizing=''
2274 generic)
2275 _arch='GENERIC'
2276 _target_arch='ARCH_GENERIC = yes'
2277 iproc=''
2278 proc=''
2279 _march=''
2280 _mcpu=''
2281 _optimizing=''
2285 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2286 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2287 die "unsupported architecture $host_arch"
2289 esac # case "$host_arch" in
2291 if test "$_runtime_cpudetection" = yes ; then
2292 if x86 ; then
2293 test "$_cmov" != no && _cmov=yes
2294 x86_32 && _cmov=no
2295 test "$_mmx" != no && _mmx=yes
2296 test "$_3dnow" != no && _3dnow=yes
2297 test "$_3dnowext" != no && _3dnowext=yes
2298 test "$_mmxext" != no && _mmxext=yes
2299 test "$_sse" != no && _sse=yes
2300 test "$_sse2" != no && _sse2=yes
2301 test "$_ssse3" != no && _ssse3=yes
2302 test "$_mtrr" != no && _mtrr=yes
2304 if ppc; then
2305 _altivec=yes
2310 echocheck "extern symbol prefix"
2311 cat > $TMPC << EOF
2312 int ff_extern;
2314 cc_check -c || die "Symbol mangling check failed."
2315 sym=$(nm -P -g $TMPEXE)
2316 extern_prefix=${sym%%ff_extern*}
2317 _def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2318 echores $extern_prefix
2321 echocheck "assembler support of -pipe option"
2322 cat > $TMPC << EOF
2323 int main(void) { return 0; }
2325 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2328 echocheck "compiler support of named assembler arguments"
2329 _named_asm_args=yes
2330 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2331 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2332 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2333 _named_asm_args=no
2334 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2336 echores $_named_asm_args
2339 if darwin && test "$cc_vendor" = "gnu" ; then
2340 echocheck "GCC support of -mstackrealign"
2341 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2342 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2343 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2344 # wrong code with this flag, but this can be worked around by adding
2345 # -fno-unit-at-a-time as described in the blog post at
2346 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2347 cat > $TMPC << EOF
2348 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2349 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2351 cc_check -O4 -mstackrealign && tmp_run && _stackrealign=-mstackrealign
2352 test -z "$_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2353 && tmp_run && _stackrealign="-mstackrealign -fno-unit-at-a-time"
2354 test -n "$_stackrealign" && echores "yes" || echores "no"
2355 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2358 # Checking for CFLAGS
2359 _install_strip="-s"
2360 if test "$_profile" != "" || test "$_debug" != "" ; then
2361 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2362 _install_strip=
2363 elif test -z "$CFLAGS" ; then
2364 if test "$cc_vendor" = "intel" ; then
2365 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2366 elif test "$cc_vendor" != "gnu" ; then
2367 CFLAGS="-O2 $_march $_mcpu $_pipe"
2368 else
2369 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2371 else
2372 _warn_CFLAGS=yes
2374 if test -n "$LDFLAGS" ; then
2375 _ld_extra="$_ld_extra $LDFLAGS"
2376 _warn_CFLAGS=yes
2377 elif test "$cc_vendor" = "intel" ; then
2378 _ld_extra="$_ld_extra -i-static"
2380 if test -n "$CPPFLAGS" ; then
2381 _inc_extra="$_inc_extra $CPPFLAGS"
2382 _warn_CFLAGS=yes
2387 if x86_32 ; then
2388 # Checking assembler (_as) compatibility...
2389 # Added workaround for older as that reads from stdin by default - atmos
2390 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2391 echocheck "assembler ($_as $as_version)"
2393 _pref_as_version='2.9.1'
2394 echo 'nop' > $TMPS
2395 if test "$_mmx" = yes ; then
2396 echo 'emms' >> $TMPS
2398 if test "$_3dnow" = yes ; then
2399 _pref_as_version='2.10.1'
2400 echo 'femms' >> $TMPS
2402 if test "$_3dnowext" = yes ; then
2403 _pref_as_version='2.10.1'
2404 echo 'pswapd %mm0, %mm0' >> $TMPS
2406 if test "$_mmxext" = yes ; then
2407 _pref_as_version='2.10.1'
2408 echo 'movntq %mm0, (%eax)' >> $TMPS
2410 if test "$_sse" = yes ; then
2411 _pref_as_version='2.10.1'
2412 echo 'xorps %xmm0, %xmm0' >> $TMPS
2414 #if test "$_sse2" = yes ; then
2415 # _pref_as_version='2.11'
2416 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2418 if test "$_cmov" = yes ; then
2419 _pref_as_version='2.10.1'
2420 echo 'cmovb %eax, %ebx' >> $TMPS
2422 if test "$_ssse3" = yes ; then
2423 _pref_as_version='2.16.92'
2424 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2426 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2428 if test "$as_verc_fail" != yes ; then
2429 echores "ok"
2430 else
2431 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2432 echores "failed"
2433 die "obsolete binutils version"
2436 fi #if x86_32
2438 echocheck ".align is a power of two"
2439 if test "$_asmalign_pot" = auto ; then
2440 _asmalign_pot=no
2441 cat > $TMPC << EOF
2442 main(void) { asm (".align 3"); }
2444 cc_check && _asmalign_pot=yes
2446 if test "$_asmalign_pot" = "yes" ; then
2447 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2448 else
2449 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2451 echores $_asmalign_pot
2454 #FIXME: This should happen before the check for CFLAGS..
2455 if ppc ; then
2457 # check if altivec is supported by the compiler, and how to enable it
2459 _altivec_gcc_flags=''
2461 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2462 echocheck "GCC altivec support"
2464 p=''
2465 cat > $TMPC << EOF
2466 int main(void) {
2467 return 0;
2470 FSF_flags='-maltivec -mabi=altivec'
2471 Darwin_flags='-faltivec'
2473 # check for Darwin-style flags first, since
2474 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2475 # accepts but ignores FSF-style flags...
2477 if test -z "$p"; then
2478 cc_check $Darwin_flags && p='Darwin'
2480 if test -z "$p"; then
2481 cc_check $FSF_flags && p='FSF'
2484 case $p in
2485 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2486 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2487 *) _altivec=no ;;
2488 esac
2490 if test -z "$p"; then
2491 p=none
2492 else
2493 p="$p-style ($_altivec_gcc_flags)"
2496 echores "$p"
2499 # check if <altivec.h> should be included
2501 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2503 if test "$_altivec" = yes ; then
2504 echocheck "altivec.h"
2505 cat > $TMPC << EOF
2506 #include <altivec.h>
2507 int main(void) { return 0; }
2509 _have_altivec_h=no
2510 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2511 if test "$_have_altivec_h" = yes ; then
2512 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2514 echores "$_have_altivec_h"
2517 # disable runtime cpudetection if
2518 # - we cannot generate altivec code
2519 # - altivec is disabled by the user
2521 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2522 _runtime_cpudetection=no
2525 # show that we are optimizing for altivec (if enabled and supported)
2527 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2528 _optimizing="$_optimizing altivec"
2531 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2533 if test "$_altivec" = yes ; then
2534 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2535 #_mcpu="$_mcpu $_altivec_gcc_flags"
2536 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2540 if arm ; then
2541 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2542 if test $_armv5te = "auto" ; then
2543 cat > $TMPC << EOF
2544 int main(void) {
2545 __asm__ __volatile__ ("qadd r0, r0, r0");
2548 _armv5te=no
2549 cc_check && _armv5te=yes
2551 echores "$_armv5te"
2553 echocheck "ARMv6 (SIMD instructions)"
2554 if test $_armv6 = "auto" ; then
2555 cat > $TMPC << EOF
2556 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2558 _armv6=no
2559 cc_check && _armv6=yes
2561 echores "$_armv6"
2563 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2564 if test $_iwmmxt = "auto" ; then
2565 cat > $TMPC << EOF
2566 int main(void) {
2567 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2570 _iwmmxt=no
2571 cc_check && _iwmmxt=yes
2573 echores "$_iwmmxt"
2576 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
2577 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2578 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2579 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2580 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2581 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2582 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2583 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2584 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2585 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2586 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2587 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2588 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2589 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2590 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2591 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2593 # Checking kernel version...
2594 if x86_32 && linux ; then
2595 _k_verc_problem=no
2596 kernel_version=`uname -r 2>&1`
2597 echocheck "$system_name kernel version"
2598 case "$kernel_version" in
2599 '') kernel_version="?.??"; _k_verc_fail=yes;;
2600 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2601 _k_verc_problem=yes;;
2602 esac
2603 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2604 _k_verc_fail=yes
2606 if test "$_k_verc_fail" ; then
2607 echores "$kernel_version, fail"
2608 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2609 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2610 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2611 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2612 echo "2.2.x you must upgrade it to get SSE support!"
2613 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2614 else
2615 echores "$kernel_version, ok"
2619 ######################
2620 # MAIN TESTS GO HERE #
2621 ######################
2624 echocheck "-lposix"
2625 cat > $TMPC <<EOF
2626 int main(void) { return 0; }
2628 if cc_check -lposix ; then
2629 _ld_extra="$_ld_extra -lposix"
2630 echores "yes"
2631 else
2632 echores "no"
2635 echocheck "-lm"
2636 cat > $TMPC <<EOF
2637 int main(void) { return 0; }
2639 if cc_check -lm ; then
2640 _ld_lm="-lm"
2641 echores "yes"
2642 else
2643 _ld_lm=""
2644 echores "no"
2648 echocheck "langinfo"
2649 if test "$_langinfo" = auto ; then
2650 cat > $TMPC <<EOF
2651 #include <langinfo.h>
2652 int main(void) { nl_langinfo(CODESET); return 0; }
2654 _langinfo=no
2655 cc_check && _langinfo=yes
2657 if test "$_langinfo" = yes ; then
2658 _def_langinfo='#define USE_LANGINFO 1'
2659 else
2660 _def_langinfo='#undef USE_LANGINFO'
2662 echores "$_langinfo"
2665 echocheck "language"
2666 test -z "$_language" && _language=$LINGUAS
2667 _language=`echo $_language | sed 's/,/ /g'`
2668 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2669 for lang in $_language ; do
2670 test "$lang" = all && lang=en
2671 if test -f "help/help_mp-${lang}.h" ; then
2672 _language=$lang
2673 break
2674 else
2675 echo ${_echo_n} "$lang not found, ${_echo_c}"
2676 _language=`echo $_language | sed "s/$lang *//"`
2678 done
2679 test -z "$_language" && _language=en
2680 _mp_help="help/help_mp-${_language}.h"
2681 test -f $_mp_help || die "$_mp_help not found"
2682 for lang in $LANGUAGES ; do
2683 if test -f "DOCS/man/$lang/mplayer.1" ; then
2684 MAN_LANG="$lang $MAN_LANG"
2686 done
2687 _doc_lang=$_language
2688 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2689 echores "using $_language (man pages: $MAN_LANG)"
2692 echocheck "enable sighandler"
2693 if test "$_sighandler" = yes ; then
2694 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2695 else
2696 _def_sighandler='#undef ENABLE_SIGHANDLER'
2698 echores "$_sighandler"
2700 echocheck "runtime cpudetection"
2701 if test "$_runtime_cpudetection" = yes ; then
2702 _optimizing="Runtime CPU-Detection enabled"
2703 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2704 else
2705 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2707 echores "$_runtime_cpudetection"
2710 echocheck "restrict keyword"
2711 for restrict_keyword in restrict __restrict __restrict__ ; do
2712 echo "void foo(char * $restrict_keyword p); int main(void){}" > $TMPC
2713 if cc_check; then
2714 _def_restrict_keyword=$restrict_keyword
2715 break;
2717 done
2718 if [ -n "$_def_restrict_keyword" ]; then
2719 echores "$_def_restrict_keyword"
2720 else
2721 echores "none"
2723 # Avoid infinite recursion loop ("#define restrict restrict")
2724 if [ "$_def_restrict_keyword" != "restrict" ]; then
2725 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2726 else
2727 _def_restrict_keyword=""
2731 echocheck "__builtin_expect"
2732 # GCC branch prediction hint
2733 cat > $TMPC << EOF
2734 int foo (int a) {
2735 a = __builtin_expect (a, 10);
2736 return a == 10 ? 0 : 1;
2738 int main(void) { return foo(10) && foo(0); }
2740 _builtin_expect=no
2741 cc_check && _builtin_expect=yes
2742 if test "$_builtin_expect" = yes ; then
2743 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2744 else
2745 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2747 echores "$_builtin_expect"
2750 echocheck "kstat"
2751 cat > $TMPC << EOF
2752 #include <kstat.h>
2753 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2755 _kstat=no
2756 cc_check -lkstat && _kstat=yes
2757 if test "$_kstat" = yes ; then
2758 _def_kstat="#define HAVE_LIBKSTAT 1"
2759 _ld_extra="$_ld_extra -lkstat"
2760 else
2761 _def_kstat="#undef HAVE_LIBKSTAT"
2763 echores "$_kstat"
2766 echocheck "posix4"
2767 # required for nanosleep on some systems
2768 cat > $TMPC << EOF
2769 #include <time.h>
2770 int main(void) { (void) nanosleep(0, 0); return 0; }
2772 _posix4=no
2773 cc_check -lposix4 && _posix4=yes
2774 if test "$_posix4" = yes ; then
2775 _ld_extra="$_ld_extra -lposix4"
2777 echores "$_posix4"
2779 for func in llrint lrint lrintf round roundf; do
2780 echocheck $func
2781 cat > $TMPC << EOF
2782 #include <math.h>
2783 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
2785 eval _$func=no
2786 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2787 if eval test "x\$_$func" = "xyes"; then
2788 eval _def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 1\""
2789 echores yes
2790 else
2791 eval _def_$func="\"#undef HAVE_`echo $func | tr '[a-z]' '[A-Z]'`\""
2792 echores no
2794 done
2797 echocheck "mkstemp"
2798 cat > $TMPC << EOF
2799 #include <stdlib.h>
2800 int main(void) { char a; mkstemp(&a); return 0; }
2802 _mkstemp=no
2803 cc_check && _mkstemp=yes
2804 if test "$_mkstemp" = yes ; then
2805 _def_mkstemp='#define HAVE_MKSTEMP 1'
2806 else
2807 _def_mkstemp='#undef HAVE_MKSTEMP'
2809 echores "$_mkstemp"
2812 echocheck "nanosleep"
2813 # also check for nanosleep
2814 cat > $TMPC << EOF
2815 #include <time.h>
2816 int main(void) { (void) nanosleep(0, 0); return 0; }
2818 _nanosleep=no
2819 cc_check && _nanosleep=yes
2820 if test "$_nanosleep" = yes ; then
2821 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2822 else
2823 _def_nanosleep='#undef HAVE_NANOSLEEP'
2825 echores "$_nanosleep"
2828 echocheck "socklib"
2829 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2830 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2831 cat > $TMPC << EOF
2832 #include <netdb.h>
2833 #include <sys/socket.h>
2834 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2836 _socklib=no
2837 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2838 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2839 done
2840 if test $_winsock2 = auto && ! cygwin ; then
2841 _winsock2=no
2842 cat > $TMPC << EOF
2843 #include <winsock2.h>
2844 int main(void) { (void) gethostbyname(0); return 0; }
2846 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2848 test "$_ld_sock" && _res_comment="using $_ld_sock"
2849 echores "$_socklib"
2852 if test $_winsock2 = yes ; then
2853 _ld_sock="-lws2_32"
2854 _def_winsock2='#define HAVE_WINSOCK2 1'
2855 else
2856 _def_winsock2='#undef HAVE_WINSOCK2'
2860 _use_aton=no
2861 echocheck "inet_pton()"
2862 cat > $TMPC << EOF
2863 #include <sys/types.h>
2864 #include <sys/socket.h>
2865 #include <arpa/inet.h>
2866 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2868 if test "$_winsock2" = yes ; then
2869 _res_comment="using winsock2 functions instead"
2870 echores "no"
2871 elif cc_check $_ld_sock ; then
2872 # NOTE: Linux has libresolv but does not need it
2874 _res_comment="using $_ld_sock"
2875 echores "yes"
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 echores "yes"
2881 else
2882 _res_comment="trying inet_aton next"
2883 echores "no"
2885 echocheck "inet_aton()"
2886 cat > $TMPC << EOF
2887 #include <sys/types.h>
2888 #include <sys/socket.h>
2889 #include <arpa/inet.h>
2890 int main(void) { (void) inet_aton(0, 0); return 0; }
2892 _use_aton=yes
2893 if cc_check $_ld_sock ; then
2894 # NOTE: Linux has libresolv but does not need it
2896 _res_comment="using $_ld_sock"
2897 elif cc_check $_ld_sock -lresolv ; then
2898 # NOTE: needed for SunOS at least
2899 _ld_sock="$_ld_sock -lresolv"
2900 _res_comment="using $_ld_sock"
2901 else
2902 _use_aton=no
2903 _network=no
2904 _res_comment="network support disabled"
2906 echores "$_use_aton"
2909 _def_use_aton='#undef USE_ATON'
2910 if test "$_use_aton" = yes; then
2911 _def_use_aton='#define USE_ATON 1'
2914 echocheck "network"
2915 # FIXME network check
2916 if test "$_network" = yes ; then
2917 _def_network='#define MPLAYER_NETWORK 1'
2918 _ld_extra="$_ld_extra $_ld_sock"
2919 _inputmodules="network $_inputmodules"
2920 else
2921 _noinputmodules="network $_noinputmodules"
2922 _def_network='#undef MPLAYER_NETWORK'
2923 _ftp=no
2925 echores "$_network"
2927 echocheck "inttypes.h (required)"
2928 cat > $TMPC << EOF
2929 #include <inttypes.h>
2930 int main(void) { return 0; }
2932 _inttypes=no
2933 cc_check && _inttypes=yes
2934 echores "$_inttypes"
2936 if test "$_inttypes" = no ; then
2937 echocheck "bitypes.h (inttypes.h predecessor)"
2938 cat > $TMPC << EOF
2939 #include <sys/bitypes.h>
2940 int main(void) { return 0; }
2942 cc_check && _inttypes=yes
2943 if test "$_inttypes" = yes ; then
2944 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."
2945 else
2946 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2951 echocheck "int_fastXY_t in inttypes.h"
2952 cat > $TMPC << EOF
2953 #include <inttypes.h>
2954 int main(void) {
2955 volatile int_fast16_t v= 0;
2956 return v; }
2958 _fast_inttypes=no
2959 cc_check && _fast_inttypes=yes
2960 if test "$_fast_inttypes" = no ; then
2961 _def_fast_inttypes='
2962 typedef signed char int_fast8_t;
2963 typedef signed int int_fast16_t;
2964 typedef signed int int_fast32_t;
2965 typedef signed long long int_fast64_t;
2966 typedef unsigned char uint_fast8_t;
2967 typedef unsigned int uint_fast16_t;
2968 typedef unsigned int uint_fast32_t;
2969 typedef unsigned long long uint_fast64_t;'
2971 echores "$_fast_inttypes"
2974 echocheck "word size"
2975 _mp_wordsize="#undef MP_WORDSIZE"
2976 cat > $TMPC << EOF
2977 #include <stdio.h>
2978 #include <sys/types.h>
2979 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2981 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2982 echores "$_wordsize"
2985 echocheck "malloc.h"
2986 cat > $TMPC << EOF
2987 #include <malloc.h>
2988 int main(void) { (void) malloc(0); return 0; }
2990 _malloc=no
2991 cc_check && _malloc=yes
2992 if test "$_malloc" = yes ; then
2993 _def_malloc='#define HAVE_MALLOC_H 1'
2994 else
2995 _def_malloc='#undef HAVE_MALLOC_H'
2997 # malloc.h emits a warning in FreeBSD and OpenBSD
2998 freebsd || openbsd || dragonfly && _def_malloc='#undef HAVE_MALLOC_H'
2999 echores "$_malloc"
3002 echocheck "memalign()"
3003 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3004 cat > $TMPC << EOF
3005 #include <malloc.h>
3006 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
3008 _memalign=no
3009 cc_check && _memalign=yes
3010 if test "$_memalign" = yes ; then
3011 _def_memalign='#define HAVE_MEMALIGN 1'
3012 else
3013 _def_memalign='#undef HAVE_MEMALIGN'
3014 _def_map_memalign='#define memalign(a,b) malloc(b)'
3015 darwin || _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3017 echores "$_memalign"
3020 echocheck "alloca.h"
3021 cat > $TMPC << EOF
3022 #include <alloca.h>
3023 int main(void) { (void) alloca(0); return 0; }
3025 _alloca=no
3026 cc_check && _alloca=yes
3027 if cc_check ; then
3028 _def_alloca='#define HAVE_ALLOCA_H 1'
3029 else
3030 _def_alloca='#undef HAVE_ALLOCA_H'
3032 echores "$_alloca"
3035 echocheck "byteswap.h"
3036 cat > $TMPC << EOF
3037 #include <byteswap.h>
3038 int main(void) { bswap_16(0); return 0; }
3040 _byteswap_h=no
3041 cc_check && _byteswap_h=yes
3042 if cc_check ; then
3043 _def_byteswap_h='#define HAVE_BYTESWAP_H 1'
3044 else
3045 _def_byteswap_h='#undef HAVE_BYTESWAP_H'
3047 echores "$_byteswap_h"
3050 echocheck "mman.h"
3051 cat > $TMPC << EOF
3052 #include <sys/types.h>
3053 #include <sys/mman.h>
3054 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3056 _mman=no
3057 cc_check && _mman=yes
3058 if test "$_mman" = yes ; then
3059 _def_mman='#define HAVE_SYS_MMAN_H 1'
3060 else
3061 _def_mman='#undef HAVE_SYS_MMAN_H'
3062 os2 && _need_mmap=yes
3064 echores "$_mman"
3066 cat > $TMPC << EOF
3067 #include <sys/types.h>
3068 #include <sys/mman.h>
3069 int main(void) { void *p = MAP_FAILED; return 0; }
3071 _mman_has_map_failed=no
3072 cc_check && _mman_has_map_failed=yes
3073 if test "$_mman_has_map_failed" = yes ; then
3074 _def_mman_has_map_failed=''
3075 else
3076 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3079 echocheck "dynamic loader"
3080 cat > $TMPC << EOF
3081 #include <dlfcn.h>
3082 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3084 _dl=no
3085 for _ld_tmp in "" "-ldl" ; do
3086 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3087 done
3088 if test "$_dl" = yes ; then
3089 _def_dl='#define HAVE_LIBDL 1'
3090 else
3091 _def_dl='#undef HAVE_LIBDL'
3093 echores "$_dl"
3096 echocheck "dynamic a/v plugins support"
3097 if test "$_dl" = no ; then
3098 _dynamic_plugins=no
3100 if test "$_dynamic_plugins" = yes ; then
3101 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3102 else
3103 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3105 echores "$_dynamic_plugins"
3108 _def_threads='#undef HAVE_THREADS'
3110 echocheck "pthread"
3111 if test "$_pthreads" = auto ; then
3112 cat > $TMPC << EOF
3113 #include <pthread.h>
3114 void* func(void *arg) { return arg; }
3115 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3117 _pthreads=no
3118 if ! hpux ; then
3119 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3120 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3121 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3122 done
3125 if test "$_pthreads" = yes ; then
3126 _res_comment="using $_ld_pthread"
3127 _def_pthreads='#define HAVE_PTHREADS 1'
3128 _def_threads='#define HAVE_THREADS 1'
3129 else
3130 _res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3131 _def_pthreads='#undef HAVE_PTHREADS'
3132 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3133 mingw32 || _win32dll=no
3135 echores "$_pthreads"
3137 echocheck "w32threads"
3138 if test "$_pthreads" = yes ; then
3139 _res_comment="using pthread instead"
3140 _w32threads=no
3142 if test "$_w32threads" = auto ; then
3143 _w32threads=no
3144 mingw32 && _w32threads=yes
3146 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3147 echores "$_w32threads"
3149 echocheck "rpath"
3150 netbsd &&_rpath=yes
3151 if test "$_rpath" = yes ; then
3152 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3153 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3154 done
3155 _ld_extra=$tmp
3157 echores "$_rpath"
3159 echocheck "iconv"
3160 if test "$_iconv" = auto ; then
3161 cat > $TMPC << EOF
3162 #include <stdio.h>
3163 #include <unistd.h>
3164 #include <iconv.h>
3165 #define INBUFSIZE 1024
3166 #define OUTBUFSIZE 4096
3168 char inbuffer[INBUFSIZE];
3169 char outbuffer[OUTBUFSIZE];
3171 int main(void) {
3172 size_t numread;
3173 iconv_t icdsc;
3174 char *tocode="UTF-8";
3175 char *fromcode="cp1250";
3176 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3177 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3178 char *iptr=inbuffer;
3179 char *optr=outbuffer;
3180 size_t inleft=numread;
3181 size_t outleft=OUTBUFSIZE;
3182 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3183 != (size_t)(-1)) {
3184 write (1, outbuffer, OUTBUFSIZE - outleft);
3187 if (iconv_close(icdsc) == -1)
3192 _iconv=no
3193 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3194 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3195 _iconv=yes && break
3196 done
3198 if test "$_iconv" = yes ; then
3199 _def_iconv='#define USE_ICONV 1'
3200 else
3201 _def_iconv='#undef USE_ICONV'
3203 echores "$_iconv"
3206 echocheck "soundcard.h"
3207 _soundcard_h=no
3208 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3209 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3210 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3211 cat > $TMPC << EOF
3212 #include <$_soundcard_header>
3213 int main(void) { return 0; }
3215 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3216 done
3218 if test "$_soundcard_h" = yes ; then
3219 if test $_soundcard_header = "sys/soundcard.h"; then
3220 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3221 else
3222 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3225 echores "$_soundcard_h"
3228 echocheck "sys/dvdio.h"
3229 cat > $TMPC << EOF
3230 #include <unistd.h>
3231 #include <sys/dvdio.h>
3232 int main(void) { return 0; }
3234 _dvdio=no
3235 cc_check && _dvdio=yes
3236 if test "$_dvdio" = yes ; then
3237 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3238 else
3239 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3241 echores "$_dvdio"
3244 echocheck "sys/cdio.h"
3245 cat > $TMPC << EOF
3246 #include <unistd.h>
3247 #include <sys/cdio.h>
3248 int main(void) { return 0; }
3250 _cdio=no
3251 cc_check && _cdio=yes
3252 if test "$_cdio" = yes ; then
3253 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3254 else
3255 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3257 echores "$_cdio"
3260 echocheck "linux/cdrom.h"
3261 cat > $TMPC << EOF
3262 #include <sys/types.h>
3263 #include <linux/cdrom.h>
3264 int main(void) { return 0; }
3266 _cdrom=no
3267 cc_check && _cdrom=yes
3268 if test "$_cdrom" = yes ; then
3269 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3270 else
3271 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3273 echores "$_cdrom"
3276 echocheck "dvd.h"
3277 cat > $TMPC << EOF
3278 #include <dvd.h>
3279 int main(void) { return 0; }
3281 _dvd=no
3282 cc_check && _dvd=yes
3283 if test "$_dvd" = yes ; then
3284 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3285 else
3286 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3288 echores "$_dvd"
3291 if bsdos; then
3292 echocheck "BSDI dvd.h"
3293 cat > $TMPC << EOF
3294 #include <dvd.h>
3295 int main(void) { return 0; }
3297 _bsdi_dvd=no
3298 cc_check && _bsdi_dvd=yes
3299 if test "$_bsdi_dvd" = yes ; then
3300 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3301 else
3302 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3304 echores "$_bsdi_dvd"
3305 fi #if bsdos
3308 if hpux; then
3309 # also used by AIX, but AIX does not support VCD and/or libdvdread
3310 echocheck "HP-UX SCSI header"
3311 cat > $TMPC << EOF
3312 #include <sys/scsi.h>
3313 int main(void) { return 0; }
3315 _hpux_scsi_h=no
3316 cc_check && _hpux_scsi_h=yes
3317 if test "$_hpux_scsi_h" = yes ; then
3318 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3319 else
3320 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3322 echores "$_hpux_scsi_h"
3323 fi #if hpux
3326 if sunos; then
3327 echocheck "userspace SCSI headers (Solaris)"
3328 cat > $TMPC << EOF
3329 # include <unistd.h>
3330 # include <stropts.h>
3331 # include <sys/scsi/scsi_types.h>
3332 # include <sys/scsi/impl/uscsi.h>
3333 int main(void) { return 0; }
3335 _sol_scsi_h=no
3336 cc_check && _sol_scsi_h=yes
3337 if test "$_sol_scsi_h" = yes ; then
3338 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3339 else
3340 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3342 echores "$_sol_scsi_h"
3343 fi #if sunos
3346 echocheck "termcap"
3347 if test "$_termcap" = auto ; then
3348 cat > $TMPC <<EOF
3349 int main(void) { tgetent(); return 0; }
3351 _termcap=no
3352 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3353 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3354 && _termcap=yes && break
3355 done
3357 if test "$_termcap" = yes ; then
3358 _def_termcap='#define USE_TERMCAP 1'
3359 _res_comment="using $_ld_tmp"
3360 else
3361 _def_termcap='#undef USE_TERMCAP'
3363 echores "$_termcap"
3366 echocheck "termios"
3367 _def_termios='#undef HAVE_TERMIOS'
3368 _def_termios_h='#undef HAVE_TERMIOS_H'
3369 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3370 if test "$_termios" = auto ; then
3371 _termios=no
3372 for _termios_header in "sys/termios.h" "termios.h"; do
3373 cat > $TMPC <<EOF
3374 #include <$_termios_header>
3375 int main(void) { return 0; }
3377 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3378 done
3381 if test "$_termios" = yes ; then
3382 _def_termios='#define HAVE_TERMIOS 1'
3383 if test "$_termios_header" = "termios.h" ; then
3384 _def_termios_h='#define HAVE_TERMIOS_H 1'
3385 else
3386 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3389 echores "$_termios"
3392 echocheck "shm"
3393 if test "$_shm" = auto ; then
3394 cat > $TMPC << EOF
3395 #include <sys/types.h>
3396 #include <sys/shm.h>
3397 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3399 _shm=no
3400 cc_check && _shm=yes
3402 if test "$_shm" = yes ; then
3403 _def_shm='#define HAVE_SHM 1'
3404 else
3405 _def_shm='#undef HAVE_SHM'
3407 echores "$_shm"
3410 echocheck "strsep()"
3411 cat > $TMPC << EOF
3412 #include <string.h>
3413 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3415 _strsep=no
3416 cc_check && _strsep=yes
3417 if test "$_strsep" = yes ; then
3418 _def_strsep='#define HAVE_STRSEP 1'
3419 _need_strsep=no
3420 else
3421 _def_strsep='#undef HAVE_STRSEP'
3422 _need_strsep=yes
3424 echores "$_strsep"
3427 echocheck "vsscanf()"
3428 cat > $TMPC << EOF
3429 #include <stdarg.h>
3430 int main(void) { vsscanf(0, 0, 0); return 0; }
3432 _vsscanf=no
3433 cc_check && _vsscanf=yes
3434 if test "$_vsscanf" = yes ; then
3435 _def_vsscanf='#define HAVE_VSSCANF 1'
3436 _need_vsscanf=no
3437 else
3438 _def_vsscanf='#undef HAVE_VSSCANF'
3439 _need_vsscanf=yes
3441 echores "$_vsscanf"
3444 echocheck "swab()"
3445 cat > $TMPC << EOF
3446 #include <unistd.h>
3447 int main(void) { swab(0, 0, 0); return 0; }
3449 _swab=no
3450 cc_check && _swab=yes
3451 if test "$_swab" = yes ; then
3452 _def_swab='#define HAVE_SWAB 1'
3453 _need_swab=no
3454 else
3455 _def_swab='#undef HAVE_SWAB'
3456 _need_swab=yes
3458 echores "$_swab"
3460 echocheck "POSIX select()"
3461 cat > $TMPC << EOF
3462 #include <stdio.h>
3463 #include <stdlib.h>
3464 #include <sys/types.h>
3465 #include <string.h>
3466 #include <sys/time.h>
3467 #include <unistd.h>
3468 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3470 _posix_select=no
3471 _def_posix_select='#undef HAVE_POSIX_SELECT'
3472 #select() of kLIBC (OS/2) supports socket only
3473 ! os2 && cc_check && _posix_select=yes \
3474 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3475 echores "$_posix_select"
3478 echocheck "gettimeofday()"
3479 cat > $TMPC << EOF
3480 #include <stdio.h>
3481 #include <sys/time.h>
3482 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3484 _gettimeofday=no
3485 cc_check && _gettimeofday=yes
3486 if test "$_gettimeofday" = yes ; then
3487 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3488 _need_gettimeofday=no
3489 else
3490 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3491 _need_gettimeofday=yes
3493 echores "$_gettimeofday"
3496 echocheck "glob()"
3497 cat > $TMPC << EOF
3498 #include <stdio.h>
3499 #include <glob.h>
3500 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3502 _glob=no
3503 cc_check && _glob=yes
3504 if test "$_glob" = yes ; then
3505 _def_glob='#define HAVE_GLOB 1'
3506 _need_glob=no
3507 else
3508 _def_glob='#undef HAVE_GLOB'
3509 _need_glob=yes
3511 echores "$_glob"
3514 echocheck "setenv()"
3515 cat > $TMPC << EOF
3516 #include <stdlib.h>
3517 int main (void){ setenv("","",0); return 0; }
3519 _setenv=no
3520 cc_check && _setenv=yes
3521 if test "$_setenv" = yes ; then
3522 _def_setenv='#define HAVE_SETENV 1'
3523 _need_setenv=no
3524 else
3525 _def_setenv='#undef HAVE_SETENV'
3526 _need_setenv=yes
3528 echores "$_setenv"
3531 if sunos; then
3532 echocheck "sysi86()"
3533 cat > $TMPC << EOF
3534 #include <sys/sysi86.h>
3535 int main (void) { sysi86(0); return 0; }
3537 _sysi86=no
3538 cc_check && _sysi86=yes
3539 if test "$_sysi86" = yes ; then
3540 _def_sysi86='#define HAVE_SYSI86 1'
3541 cat > $TMPC << EOF
3542 #include <sys/sysi86.h>
3543 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3545 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3546 else
3547 _def_sysi86='#undef HAVE_SYSI86'
3549 echores "$_sysi86"
3550 fi #if sunos
3553 echocheck "sys/sysinfo.h"
3554 cat > $TMPC << EOF
3555 #include <sys/sysinfo.h>
3556 int main(void) {
3557 struct sysinfo s_info;
3558 sysinfo(&s_info);
3559 return 0;
3562 _sys_sysinfo=no
3563 cc_check && _sys_sysinfo=yes
3564 if test "$_sys_sysinfo" = yes ; then
3565 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3566 else
3567 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3569 echores "$_sys_sysinfo"
3572 if darwin; then
3574 echocheck "Mac OS X APIs"
3575 if test "$_macosx" = auto ; then
3576 productName=`/usr/bin/sw_vers -productName`
3577 if test "$productName" = "Mac OS X" ||
3578 test "$productName" = "Mac OS X Server" ; then
3579 _macosx=yes
3580 else
3581 _macosx=no
3582 _noaomodules="macosx $_noaomodules"
3583 _novomodules="quartz $_novomodules"
3586 if test "$_macosx" = yes ; then
3587 cat > $TMPC <<EOF
3588 #include <Carbon/Carbon.h>
3589 #include <QuickTime/QuickTime.h>
3590 #include <CoreAudio/CoreAudio.h>
3591 int main(void) {
3592 EnterMovies();
3593 ExitMovies();
3594 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3597 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3598 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3599 _coreaudio=yes
3600 _def_coreaudio='#define HAVE_COREAUDIO 1'
3601 _aosrc="$_aosrc ao_macosx.c"
3602 _aomodules="macosx $_aomodules"
3603 _def_quartz='#define HAVE_QUARTZ 1'
3604 _vosrc="$_vosrc vo_quartz.c"
3605 _vomodules="quartz $_vomodules"
3606 _def_quicktime='#define HAVE_QUICKTIME 1'
3607 else
3608 _macosx=no
3609 _coreaudio=no
3610 _def_coreaudio='#undef HAVE_COREAUDIO'
3611 _noaomodules="macosx $_noaomodules"
3612 _def_quartz='#undef HAVE_QUARTZ'
3613 _novomodules="quartz $_novomodules"
3614 _def_quicktime='#undef HAVE_QUICKTIME'
3616 cat > $TMPC <<EOF
3617 #include <Carbon/Carbon.h>
3618 #include <QuartzCore/CoreVideo.h>
3619 int main(void) {}
3621 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3622 _vosrc="$_vosrc vo_macosx.m"
3623 _vomodules="macosx $_vomodules"
3624 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3625 _def_corevideo='#define HAVE_COREVIDEO 1'
3626 _corevideo=yes
3627 else
3628 _novomodules="macosx $_novomodules"
3629 _def_corevideo='#undef HAVE_COREVIDEO'
3630 _corevideo=no
3633 echores "$_macosx"
3635 echocheck "Mac OS X Finder Support"
3636 if test "$_macosx_finder_support" = auto ; then
3637 _macosx_finder_support=$_macosx
3639 if test "$_macosx_finder_support" = yes; then
3640 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3641 _macosx_finder_support=yes
3642 else
3643 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3644 _macosx_finder_support=no
3646 echores "$_macosx_finder_support"
3648 echocheck "Mac OS X Bundle file locations"
3649 if test "$_macosx_bundle" = auto ; then
3650 _macosx_bundle=$_macosx_finder_support
3652 if test "$_macosx_bundle" = yes; then
3653 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3654 else
3655 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3656 _macosx_bundle=no
3658 echores "$_macosx_bundle"
3660 echocheck "Apple Remote"
3661 if test "$_apple_remote" = auto ; then
3662 _apple_remote=no
3663 cat > $TMPC <<EOF
3664 #include <stdio.h>
3665 #include <IOKit/IOCFPlugIn.h>
3666 int main (int argc, const char * argv[])
3668 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3669 CFMutableDictionaryRef hidMatchDictionary;
3670 IOReturn ioReturnValue;
3672 // Set up a matching dictionary to search the I/O Registry by class.
3673 // name for all HID class devices
3674 hidMatchDictionary = IOServiceMatching("AppleIRController");
3676 // Now search I/O Registry for matching devices.
3677 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3678 hidMatchDictionary, &hidObjectIterator);
3680 // If search is unsuccessful, return nonzero.
3681 if (ioReturnValue != kIOReturnSuccess ||
3682 !IOIteratorIsValid(hidObjectIterator)) {
3683 return 1;
3685 return 0;
3688 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3690 if test "$_apple_remote" = yes ; then
3691 _def_apple_remote='#define HAVE_APPLE_REMOTE 1'
3692 _ld_extra="$_ld_extra -framework IOKit"
3693 else
3694 _def_apple_remote='#undef HAVE_APPLE_REMOTE'
3696 echores "$_apple_remote"
3698 fi #if darwin
3701 echocheck "pkg-config"
3702 _pkg_config=pkg-config
3703 if `$_pkg_config --version > /dev/null 2>&1`; then
3704 if test "$_ld_static"; then
3705 _pkg_config="$_pkg_config --static"
3707 echores "yes"
3708 else
3709 _pkg_config=false
3710 echores "no"
3714 echocheck "Samba support (libsmbclient)"
3715 if test "$_smbsupport" = yes; then
3716 _ld_extra="$_ld_extra -lsmbclient"
3718 if test "$_smbsupport" = auto; then
3719 _smbsupport=no
3720 cat > $TMPC << EOF
3721 #include <libsmbclient.h>
3722 int main(void) { smbc_opendir("smb://"); return 0; }
3724 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3725 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3726 _smbsupport=yes && break
3727 done
3730 if test "$_smbsupport" = yes; then
3731 _def_smbsupport="#define LIBSMBCLIENT"
3732 _inputmodules="smb $_inputmodules"
3733 else
3734 _def_smbsupport="#undef LIBSMBCLIENT"
3735 _noinputmodules="smb $_noinputmodules"
3737 echores "$_smbsupport"
3740 #########
3741 # VIDEO #
3742 #########
3745 echocheck "tdfxfb"
3746 if test "$_tdfxfb" = yes ; then
3747 _def_tdfxfb='#define HAVE_TDFXFB 1'
3748 _vosrc="$_vosrc vo_tdfxfb.c"
3749 _vomodules="tdfxfb $_vomodules"
3750 else
3751 _def_tdfxfb='#undef HAVE_TDFXFB'
3752 _novomodules="tdfxfb $_novomodules"
3754 echores "$_tdfxfb"
3756 echocheck "s3fb"
3757 if test "$_s3fb" = yes ; then
3758 _def_s3fb='#define HAVE_S3FB 1'
3759 _vosrc="$_vosrc vo_s3fb.c"
3760 _vomodules="s3fb $_vomodules"
3761 else
3762 _def_s3fb='#undef HAVE_S3FB'
3763 _novomodules="s3fb $_novomodules"
3765 echores "$_s3fb"
3767 echocheck "tdfxvid"
3768 if test "$_tdfxvid" = yes ; then
3769 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3770 _vosrc="$_vosrc vo_tdfx_vid.c"
3771 _vomodules="tdfx_vid $_vomodules"
3772 else
3773 _def_tdfxvid='#undef HAVE_TDFX_VID'
3774 _novomodules="tdfx_vid $_novomodules"
3776 echores "$_tdfxvid"
3778 echocheck "xvr100"
3779 if test "$_xvr100" = auto ; then
3780 cat > $TMPC << EOF
3781 #include <unistd.h>
3782 #include <sys/fbio.h>
3783 #include <sys/visual_io.h>
3784 int main(void) {
3785 struct vis_identifier ident;
3786 struct fbgattr attr;
3788 ioctl(0, VIS_GETIDENTIFIER, &ident);
3789 ioctl(0, FBIOGATTR, &attr);
3792 _xvr100=no
3793 cc_check && _xvr100=yes
3795 if test "$_xvr100" = yes ; then
3796 _def_xvr100='#define HAVE_XVR100 1'
3797 _vosrc="$_vosrc vo_xvr100.c"
3798 _vomodules="xvr100 $_vomodules"
3799 else
3800 _def_tdfxvid='#undef HAVE_XVR100'
3801 _novomodules="xvr100 $_novomodules"
3803 echores "$_xvr100"
3805 echocheck "tga"
3806 if test "$_tga" = yes ; then
3807 _def_tga='#define HAVE_TGA 1'
3808 _vosrc="$_vosrc vo_tga.c"
3809 _vomodules="tga $_vomodules"
3810 else
3811 _def_tga='#undef HAVE_TGA'
3812 _novomodules="tga $_novomodules"
3814 echores "$_tga"
3817 echocheck "md5sum support"
3818 if test "$_md5sum" = yes; then
3819 _def_md5sum="#define HAVE_MD5SUM"
3820 _vosrc="$_vosrc vo_md5sum.c"
3821 _vomodules="md5sum $_vomodules"
3822 else
3823 _def_md5sum="#undef HAVE_MD5SUM"
3824 _novomodules="md5sum $_novomodules"
3826 echores "$_md5sum"
3829 echocheck "bl"
3830 if test "$_bl" = yes ; then
3831 _def_bl='#define HAVE_BL 1'
3832 _vosrc="$_vosrc vo_bl.c"
3833 _vomodules="bl $_vomodules"
3834 else
3835 _def_bl='#undef HAVE_BL'
3836 _novomodules="bl $_novomodules"
3838 echores "$_bl"
3841 echocheck "DirectFB"
3842 if test "$_directfb" = auto ; then
3843 _directfb=no
3844 cat > $TMPC <<EOF
3845 #include <directfb.h>
3846 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3848 for _inc_tmp in "" -I/usr/local/include/directfb \
3849 -I/usr/include/directfb -I/usr/local/include; do
3850 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3851 _inc_extra="$_inc_extra $_inc_tmp" && break
3852 done
3855 dfb_version() {
3856 expr $1 \* 65536 + $2 \* 256 + $3
3859 if test "$_directfb" = yes; then
3860 cat > $TMPC << EOF
3861 #include <directfb_version.h>
3863 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3866 if $_cc -E $TMPC $_inc_extra > "$TMPEXE"; then
3867 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'`
3868 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3869 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3870 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3871 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3872 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3873 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3874 _res_comment="$_directfb_version"
3875 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3876 else
3877 _def_directfb_version='#undef DIRECTFBVERSION'
3878 _directfb=no
3879 _res_comment="version >=0.9.13 required"
3881 else
3882 _directfb=no
3883 _res_comment="failed to get version"
3886 echores "$_directfb"
3888 if test "$_directfb" = yes ; then
3889 _def_directfb='#define HAVE_DIRECTFB 1'
3890 _vosrc="$_vosrc vo_directfb2.c"
3891 _vomodules="directfb $_vomodules"
3892 _libs_mplayer="$_libs_mplayer -ldirectfb"
3893 else
3894 _def_directfb='#undef HAVE_DIRECTFB'
3895 _novomodules="directfb $_novomodules"
3897 if test "$_dfbmga" = yes; then
3898 _vosrc="$_vosrc vo_dfbmga.c"
3899 _vomodules="dfbmga $_vomodules"
3900 _def_dfbmga='#define HAVE_DFBMGA 1'
3901 else
3902 _novomodules="dfbmga $_novomodules"
3903 _def_dfbmga='#undef HAVE_DFBMGA'
3907 echocheck "X11 headers presence"
3908 _x11_headers="no"
3909 _res_comment="check if the dev(el) packages are installed"
3910 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3911 if test -f "$I/X11/Xlib.h" ; then
3912 _x11_headers="yes"
3913 _res_comment=""
3914 break
3916 done
3917 if test $_cross_compile = no; then
3918 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3919 if test -f "$I/X11/Xlib.h" ; then
3920 _inc_extra="$_inc_extra -I$I"
3921 _x11_headers="yes"
3922 _res_comment="using $I"
3923 break
3925 done
3927 echores "$_x11_headers"
3930 echocheck "X11"
3931 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3932 cat > $TMPC <<EOF
3933 #include <X11/Xlib.h>
3934 #include <X11/Xutil.h>
3935 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3937 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3938 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3939 if netbsd; then
3940 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3941 else
3942 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3944 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3945 && _x11=yes && break
3946 done
3948 if test "$_x11" = yes ; then
3949 _def_x11='#define HAVE_X11 1'
3950 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3951 _vomodules="x11 xover $_vomodules"
3952 else
3953 _x11=no
3954 _def_x11='#undef HAVE_X11'
3955 _novomodules="x11 $_novomodules"
3956 _res_comment="check if the dev(el) packages are installed"
3957 # disable stuff that depends on X
3958 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
3960 echores "$_x11"
3962 echocheck "Xss screensaver extensions"
3963 if test "$_xss" = auto ; then
3964 cat > $TMPC << EOF
3965 #include <X11/Xlib.h>
3966 #include <X11/extensions/scrnsaver.h>
3967 int main(void) {
3968 XScreenSaverSuspend(NULL, True);
3969 return 0;
3972 _xss=no
3973 cc_check -lXss && _xss=yes
3975 if test "$_xss" = yes ; then
3976 _def_xss='#define HAVE_XSS 1'
3977 _libs_mplayer="$_libs_mplayer -lXss"
3978 else
3979 _def_xss='#undef HAVE_XSS'
3981 echores "$_xss"
3983 echocheck "DPMS"
3984 _xdpms3=no
3985 _xdpms4=no
3986 if test "$_x11" = yes ; then
3987 cat > $TMPC <<EOF
3988 #include <X11/Xmd.h>
3989 #include <X11/Xlib.h>
3990 #include <X11/Xutil.h>
3991 #include <X11/Xatom.h>
3992 #include <X11/extensions/dpms.h>
3993 int main(void) {
3994 (void) DPMSQueryExtension(0, 0, 0);
3997 cc_check -lXdpms && _xdpms3=yes
3998 cat > $TMPC <<EOF
3999 #include <X11/Xlib.h>
4000 #include <X11/extensions/dpms.h>
4001 int main(void) {
4002 (void) DPMSQueryExtension(0, 0, 0);
4005 cc_check -lXext && _xdpms4=yes
4007 if test "$_xdpms4" = yes ; then
4008 _def_xdpms='#define HAVE_XDPMS 1'
4009 _res_comment="using Xdpms 4"
4010 echores "yes"
4011 elif test "$_xdpms3" = yes ; then
4012 _def_xdpms='#define HAVE_XDPMS 1'
4013 _libs_mplayer="$_libs_mplayer -lXdpms"
4014 _res_comment="using Xdpms 3"
4015 echores "yes"
4016 else
4017 _def_xdpms='#undef HAVE_XDPMS'
4018 echores "no"
4022 echocheck "Xv"
4023 if test "$_xv" = auto ; then
4024 cat > $TMPC <<EOF
4025 #include <X11/Xlib.h>
4026 #include <X11/extensions/Xvlib.h>
4027 int main(void) {
4028 (void) XvGetPortAttribute(0, 0, 0, 0);
4029 (void) XvQueryPortAttributes(0, 0, 0);
4030 return 0; }
4032 _xv=no
4033 cc_check -lXv && _xv=yes
4036 if test "$_xv" = yes ; then
4037 _def_xv='#define HAVE_XV 1'
4038 _libs_mplayer="$_libs_mplayer -lXv"
4039 _vosrc="$_vosrc vo_xv.c"
4040 _vomodules="xv $_vomodules"
4041 else
4042 _def_xv='#undef HAVE_XV'
4043 _novomodules="xv $_novomodules"
4045 echores "$_xv"
4048 echocheck "XvMC"
4049 if test "$_xv" = yes && test "$_xvmc" != no ; then
4050 _xvmc=no
4051 cat > $TMPC <<EOF
4052 #include <X11/Xlib.h>
4053 #include <X11/extensions/Xvlib.h>
4054 #include <X11/extensions/XvMClib.h>
4055 int main(void) {
4056 (void) XvMCQueryExtension(0,0,0);
4057 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4058 return 0; }
4060 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4061 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4062 done
4064 if test "$_xvmc" = yes ; then
4065 _def_xvmc='#define HAVE_XVMC 1'
4066 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
4067 _vosrc="$_vosrc vo_xvmc.c"
4068 _vomodules="xvmc $_vomodules"
4069 _res_comment="using $_xvmclib"
4070 else
4071 _def_xvmc='#undef HAVE_XVMC'
4072 _novomodules="xvmc $_novomodules"
4073 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
4075 echores "$_xvmc"
4078 echocheck "Xinerama"
4079 if test "$_xinerama" = auto ; then
4080 cat > $TMPC <<EOF
4081 #include <X11/Xlib.h>
4082 #include <X11/extensions/Xinerama.h>
4083 int main(void) { (void) XineramaIsActive(0); return 0; }
4085 _xinerama=no
4086 cc_check -lXinerama && _xinerama=yes
4089 if test "$_xinerama" = yes ; then
4090 _def_xinerama='#define HAVE_XINERAMA 1'
4091 _libs_mplayer="$_libs_mplayer -lXinerama"
4092 else
4093 _def_xinerama='#undef HAVE_XINERAMA'
4095 echores "$_xinerama"
4098 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4099 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4100 # named 'X extensions' or something similar.
4101 # This check may be useful for future mplayer versions (to change resolution)
4102 # If you run into problems, remove '-lXxf86vm'.
4103 echocheck "Xxf86vm"
4104 if test "$_vm" = auto ; then
4105 cat > $TMPC <<EOF
4106 #include <X11/Xlib.h>
4107 #include <X11/extensions/xf86vmode.h>
4108 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4110 _vm=no
4111 cc_check -lXxf86vm && _vm=yes
4113 if test "$_vm" = yes ; then
4114 _def_vm='#define HAVE_XF86VM 1'
4115 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4116 else
4117 _def_vm='#undef HAVE_XF86VM'
4119 echores "$_vm"
4121 # Check for the presence of special keycodes, like audio control buttons
4122 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4123 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4124 # have these new keycodes.
4125 echocheck "XF86keysym"
4126 if test "$_xf86keysym" = auto; then
4127 _xf86keysym=no
4128 cat > $TMPC <<EOF
4129 #include <X11/Xlib.h>
4130 #include <X11/XF86keysym.h>
4131 int main(void) { return XF86XK_AudioPause; }
4133 cc_check && _xf86keysym=yes
4135 if test "$_xf86keysym" = yes ; then
4136 _def_xf86keysym='#define HAVE_XF86XK 1'
4137 else
4138 _def_xf86keysym='#undef HAVE_XF86XK'
4140 echores "$_xf86keysym"
4142 echocheck "DGA"
4143 if test "$_dga2" = auto && test "$_x11" = yes ; then
4144 cat > $TMPC << EOF
4145 #include <X11/Xlib.h>
4146 #include <X11/extensions/xf86dga.h>
4147 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4149 _dga2=no
4150 cc_check -lXxf86dga && _dga2=yes
4152 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4153 cat > $TMPC << EOF
4154 #include <X11/Xlib.h>
4155 #include <X11/extensions/xf86dga.h>
4156 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4158 _dga1=no
4159 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4162 _dga=no
4163 _def_dga='#undef HAVE_DGA'
4164 _def_dga1='#undef HAVE_DGA1'
4165 _def_dga2='#undef HAVE_DGA2'
4166 if test "$_dga1" = yes ; then
4167 _dga=yes
4168 _def_dga1='#define HAVE_DGA1 1'
4169 _res_comment="using DGA 1.0"
4170 elif test "$_dga2" = yes ; then
4171 _dga=yes
4172 _def_dga2='#define HAVE_DGA2 1'
4173 _res_comment="using DGA 2.0"
4175 if test "$_dga" = yes ; then
4176 _def_dga='#define HAVE_DGA 1'
4177 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4178 _vosrc="$_vosrc vo_dga.c"
4179 _vomodules="dga $_vomodules"
4180 else
4181 _novomodules="dga $_novomodules"
4183 echores "$_dga"
4186 echocheck "3dfx"
4187 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4188 _def_3dfx='#define HAVE_3DFX 1'
4189 _vosrc="$_vosrc vo_3dfx.c"
4190 _vomodules="3dfx $_vomodules"
4191 else
4192 _def_3dfx='#undef HAVE_3DFX'
4193 _novomodules="3dfx $_novomodules"
4195 echores "$_3dfx"
4198 echocheck "OpenGL"
4199 #Note: this test is run even with --enable-gl since we autodetect linker flags
4200 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4201 cat > $TMPC << EOF
4202 #include <GL/gl.h>
4203 #ifdef GL_WIN32
4204 #include <windows.h>
4205 #include <GL/glext.h>
4206 #else
4207 #include <X11/Xlib.h>
4208 #include <GL/glx.h>
4209 #endif
4210 int main(void) {
4211 #ifdef GL_WIN32
4212 HDC dc;
4213 wglCreateContext(dc);
4214 #else
4215 glXCreateContext(NULL, NULL, NULL, True);
4216 #endif
4217 glFinish();
4218 return 0;
4221 _gl=no
4222 if cc_check -lGL $_ld_lm ; then
4223 _gl=yes
4224 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4225 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4226 _gl=yes
4227 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4228 elif cc_check -DGL_WIN32 -lopengl32 ; then
4229 _gl=yes
4230 _gl_win32=yes
4231 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4233 else
4234 _gl=no
4236 if test "$_gl" = yes ; then
4237 _def_gl='#define HAVE_GL 1'
4238 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4239 if test "$_gl_win32" = yes ; then
4240 _def_gl_win32='#define GL_WIN32 1'
4241 _vosrc="$_vosrc w32_common.c"
4242 _res_comment="win32 version"
4244 _vomodules="opengl $_vomodules"
4245 else
4246 _def_gl='#undef HAVE_GL'
4247 _def_gl_win32='#undef GL_WIN32'
4248 _novomodules="opengl $_novomodules"
4250 echores "$_gl"
4253 echocheck "VIDIX"
4254 _vidix=no
4255 _def_vidix='#undef CONFIG_VIDIX'
4256 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4257 _vidix_drv_cyberblade=no
4258 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4259 _vidix_drv_ivtv=no
4260 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4261 _vidix_drv_ivtv=no
4262 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4263 _vidix_drv_mach64=no
4264 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4265 _vidix_drv_mga=no
4266 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4267 _vidix_drv_mga_crtc2=no
4268 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4269 _vidix_drv_nvidia=no
4270 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4271 _vidix_drv_pm2=no
4272 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4273 _vidix_drv_pm3=no
4274 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4275 _vidix_drv_radeon=no
4276 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4277 _vidix_drv_rage128=no
4278 _def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4279 _vidix_drv_s3=no
4280 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4281 _vidix_drv_sis=no
4282 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4283 _vidix_drv_unichrome=no
4284 if test "$_vidix_internal" = auto ; then
4285 _vidix_internal=no
4286 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4287 && _vidix_internal=yes
4288 (ppc || alpha) && linux && _vidix_internal=yes
4290 if test "$_vidix_internal" = yes; then
4291 _res_comment="internal"
4292 _vidix_external=no
4293 _vidix=yes
4294 elif test "$_vidix_external" = auto; then
4295 _vidix_external=no
4296 cat > $TMPC <<EOF
4297 #include <vidix/vidix.h>
4298 int main(void) { return 0; }
4300 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
4301 && _vidix=yes
4303 echores "$_vidix"
4305 if test "$_vidix" = yes ; then
4306 _def_vidix='#define CONFIG_VIDIX 1'
4307 _vosrc="$_vosrc vo_cvidix.c"
4308 _vomodules="cvidix $_vomodules"
4309 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sis unichrome"
4310 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4312 # some vidix drivers are meant to work on x86 only, discard them elsewhere
4313 x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//`
4315 for driver in $_vidix_drivers ; do
4316 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4317 eval _vidix_drv_${driver}=yes
4318 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4319 done
4320 else
4321 _novomodules="cvidix $_novomodules"
4324 if test "$_vidix_internal" = yes ; then
4325 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
4326 elif test "$_vidix_external" = yes ; then
4327 _libs_mplayer="$_libs_mplayer -lvidix"
4328 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
4331 if test "$_vidix" = yes && win32; then
4332 _vosrc="$_vosrc vo_winvidix.c"
4333 _vomodules="winvidix $_vomodules"
4334 _libs_mplayer="$_libs_mplayer -lgdi32"
4335 else
4336 _novomodules="winvidix $_novomodules"
4338 if test "$_vidix" = yes && test "$_x11" = yes; then
4339 _vosrc="$_vosrc vo_xvidix.c"
4340 _vomodules="xvidix $_vomodules"
4341 else
4342 _novomodules="xvidix $_novomodules"
4345 echocheck "VIDIX PCI device name database"
4346 echores "$_vidix_pcidb"
4347 if test "$_vidix_pcidb" = yes ; then
4348 _vidix_pcidb_val=1
4349 else
4350 _vidix_pcidb_val=0
4353 echocheck "/dev/mga_vid"
4354 if test "$_mga" = auto ; then
4355 _mga=no
4356 test -c /dev/mga_vid && _mga=yes
4358 if test "$_mga" = yes ; then
4359 _def_mga='#define HAVE_MGA 1'
4360 _vosrc="$_vosrc vo_mga.c"
4361 _vomodules="mga $_vomodules"
4362 else
4363 _def_mga='#undef HAVE_MGA'
4364 _novomodules="mga $_novomodules"
4366 echores "$_mga"
4369 echocheck "xmga"
4370 if test "$_xmga" = auto ; then
4371 _xmga=no
4372 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4374 if test "$_xmga" = yes ; then
4375 _def_xmga='#define HAVE_XMGA 1'
4376 _vosrc="$_vosrc vo_xmga.c"
4377 _vomodules="xmga $_vomodules"
4378 else
4379 _def_xmga='#undef HAVE_XMGA'
4380 _novomodules="xmga $_novomodules"
4382 echores "$_xmga"
4385 echocheck "GGI"
4386 if test "$_ggi" = auto ; then
4387 cat > $TMPC << EOF
4388 #include <ggi/ggi.h>
4389 int main(void) { ggiInit(); return 0; }
4391 _ggi=no
4392 cc_check -lggi && _ggi=yes
4394 if test "$_ggi" = yes ; then
4395 _def_ggi='#define HAVE_GGI 1'
4396 _libs_mplayer="$_libs_mplayer -lggi"
4397 _vosrc="$_vosrc vo_ggi.c"
4398 _vomodules="ggi $_vomodules"
4399 else
4400 _def_ggi='#undef HAVE_GGI'
4401 _novomodules="ggi $_novomodules"
4403 echores "$_ggi"
4405 echocheck "GGI extension: libggiwmh"
4406 if test "$_ggiwmh" = auto ; then
4407 _ggiwmh=no
4408 cat > $TMPC << EOF
4409 #include <ggi/ggi.h>
4410 #include <ggi/wmh.h>
4411 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4413 cc_check -lggi -lggiwmh && _ggiwmh=yes
4415 # needed to get right output on obscure combination
4416 # like --disable-ggi --enable-ggiwmh
4417 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4418 _def_ggiwmh='#define HAVE_GGIWMH 1'
4419 _libs_mplayer="$_libs_mplayer -lggiwmh"
4420 else
4421 _ggiwmh=no
4422 _def_ggiwmh='#undef HAVE_GGIWMH'
4424 echores "$_ggiwmh"
4427 echocheck "AA"
4428 if test "$_aa" = auto ; then
4429 cat > $TMPC << EOF
4430 #include <aalib.h>
4431 extern struct aa_hardware_params aa_defparams;
4432 extern struct aa_renderparams aa_defrenderparams;
4433 int main(void) {
4434 aa_context *c;
4435 aa_renderparams *p;
4436 (void) aa_init(0, 0, 0);
4437 c = aa_autoinit(&aa_defparams);
4438 p = aa_getrenderparams();
4439 aa_autoinitkbd(c,0);
4440 return 0; }
4442 _aa=no
4443 for _ld_tmp in "-laa" ; do
4444 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4445 done
4447 if test "$_aa" = yes ; then
4448 _def_aa='#define HAVE_AA 1'
4449 if cygwin ; then
4450 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4452 _vosrc="$_vosrc vo_aa.c"
4453 _vomodules="aa $_vomodules"
4454 else
4455 _def_aa='#undef HAVE_AA'
4456 _novomodules="aa $_novomodules"
4458 echores "$_aa"
4461 echocheck "CACA"
4462 if test "$_caca" = auto ; then
4463 _caca=no
4464 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4465 cat > $TMPC << EOF
4466 #include <caca.h>
4467 #ifdef CACA_API_VERSION_1
4468 #include <caca0.h>
4469 #endif
4470 int main(void) { (void) caca_init(); return 0; }
4472 cc_check `caca-config --libs` && _caca=yes
4475 if test "$_caca" = yes ; then
4476 _def_caca='#define HAVE_CACA 1'
4477 _inc_extra="$_inc_extra `caca-config --cflags`"
4478 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4479 _vosrc="$_vosrc vo_caca.c"
4480 _vomodules="caca $_vomodules"
4481 else
4482 _def_caca='#undef HAVE_CACA'
4483 _novomodules="caca $_novomodules"
4485 echores "$_caca"
4488 echocheck "SVGAlib"
4489 if test "$_svga" = auto ; then
4490 cat > $TMPC << EOF
4491 #include <vga.h>
4492 int main(void) { return 0; }
4494 _svga=no
4495 cc_check -lvga $_ld_lm && _svga=yes
4497 if test "$_svga" = yes ; then
4498 _def_svga='#define HAVE_SVGALIB 1'
4499 _libs_mplayer="$_libs_mplayer -lvga"
4500 _vosrc="$_vosrc vo_svga.c"
4501 _vomodules="svga $_vomodules"
4502 else
4503 _def_svga='#undef HAVE_SVGALIB'
4504 _novomodules="svga $_novomodules"
4506 echores "$_svga"
4509 echocheck "FBDev"
4510 if test "$_fbdev" = auto ; then
4511 _fbdev=no
4512 linux && _fbdev=yes
4514 if test "$_fbdev" = yes ; then
4515 _def_fbdev='#define HAVE_FBDEV 1'
4516 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4517 _vomodules="fbdev $_vomodules"
4518 else
4519 _def_fbdev='#undef HAVE_FBDEV'
4520 _novomodules="fbdev $_novomodules"
4522 echores "$_fbdev"
4526 echocheck "DVB"
4527 if test "$_dvb" = auto ; then
4528 _dvb=no
4529 cat >$TMPC << EOF
4530 #include <sys/poll.h>
4531 #include <sys/ioctl.h>
4532 #include <stdio.h>
4533 #include <time.h>
4534 #include <unistd.h>
4536 #include <ost/dmx.h>
4537 #include <ost/frontend.h>
4538 #include <ost/sec.h>
4539 #include <ost/video.h>
4540 #include <ost/audio.h>
4541 int main(void) {return 0;}
4543 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4544 cc_check $_inc_tmp && _dvb=yes && \
4545 _inc_extra="$_inc_extra $_inc_tmp" && break
4546 done
4548 echores "$_dvb"
4549 if test "$_dvb" = yes ; then
4550 _def_dvb='#define HAVE_DVB 1'
4551 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4552 _aomodules="mpegpes(dvb) $_aomodules"
4553 _vomodules="mpegpes(dvb) $_vomodules"
4556 echocheck "DVB HEAD"
4557 if test "$_dvbhead" = auto ; then
4558 _dvbhead=no
4560 cat >$TMPC << EOF
4561 #include <sys/poll.h>
4562 #include <sys/ioctl.h>
4563 #include <stdio.h>
4564 #include <time.h>
4565 #include <unistd.h>
4567 #include <linux/dvb/dmx.h>
4568 #include <linux/dvb/frontend.h>
4569 #include <linux/dvb/video.h>
4570 #include <linux/dvb/audio.h>
4571 int main(void) {return 0;}
4573 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4574 cc_check $_inc_tmp && _dvbhead=yes && \
4575 _inc_extra="$_inc_extra $_inc_tmp" && break
4576 done
4578 echores "$_dvbhead"
4579 if test "$_dvbhead" = yes ; then
4580 _def_dvb='#define HAVE_DVB_HEAD 1'
4581 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4582 _aomodules="mpegpes(dvb) $_aomodules"
4583 _vomodules="mpegpes(dvb) $_vomodules"
4586 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4587 _def_dvb='#undef HAVE_DVB'
4588 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4589 _aomodules="mpegpes(file) $_aomodules"
4590 _vomodules="mpegpes(file) $_vomodules"
4593 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4594 _dvbin=yes
4595 _inputmodules="dvb $_inputmodules"
4596 else
4597 _dvbin=no
4598 _noinputmodules="dvb $_noinputmodules"
4604 echocheck "PNG support"
4605 if test "$_png" = auto ; then
4606 _png=no
4607 if irix ; then
4608 # Don't check for -lpng on irix since it has its own libpng
4609 # incompatible with the GNU libpng
4610 _res_comment="disabled on irix (not GNU libpng)"
4611 else
4612 cat > $TMPC << EOF
4613 #include <png.h>
4614 #include <string.h>
4615 int main(void) {
4616 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4617 printf("libpng: %s\n", png_libpng_ver);
4618 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4621 if cc_check -lpng -lz $_ld_lm ; then
4622 if tmp_run ; then
4623 _png=yes
4624 else
4625 _res_comment="mismatch of library and header versions"
4630 echores "$_png"
4631 if test "$_png" = yes ; then
4632 _def_png='#define HAVE_PNG 1'
4633 _ld_extra="$_ld_extra -lpng -lz"
4634 _vosrc="$_vosrc vo_png.c"
4635 _vomodules="png $_vomodules"
4636 else
4637 _def_png='#undef HAVE_PNG'
4638 _novomodules="png $_novomodules"
4641 echocheck "JPEG support"
4642 if test "$_jpeg" = auto ; then
4643 _jpeg=no
4644 cat > $TMPC << EOF
4645 #include <stdio.h>
4646 #include <stdlib.h>
4647 #include <setjmp.h>
4648 #include <string.h>
4649 #include <jpeglib.h>
4650 int main(void) {
4651 return 0;
4654 if cc_check -ljpeg $_ld_lm ; then
4655 if tmp_run ; then
4656 _jpeg=yes
4660 echores "$_jpeg"
4662 if test "$_jpeg" = yes ; then
4663 _def_jpeg='#define HAVE_JPEG 1'
4664 _vosrc="$_vosrc vo_jpeg.c"
4665 _vomodules="jpeg $_vomodules"
4666 _ld_extra="$_ld_extra -ljpeg"
4667 else
4668 _def_jpeg='#undef HAVE_JPEG'
4669 _novomodules="jpeg $_novomodules"
4674 echocheck "PNM support"
4675 if test "$_pnm" = yes; then
4676 _def_pnm="#define HAVE_PNM"
4677 _vosrc="$_vosrc vo_pnm.c"
4678 _vomodules="pnm $_vomodules"
4679 else
4680 _def_pnm="#undef HAVE_PNM"
4681 _novomodules="pnm $_novomodules"
4683 echores "$_pnm"
4687 echocheck "GIF support"
4688 # This is to appease people who want to force gif support.
4689 # If it is forced to yes, then we still do checks to determine
4690 # which gif library to use.
4691 if test "$_gif" = yes ; then
4692 _force_gif=yes
4693 _gif=auto
4696 if test "$_gif" = auto ; then
4697 _gif=no
4698 cat > $TMPC << EOF
4699 #include <gif_lib.h>
4700 int main(void) {
4701 return 0;
4704 for _ld_gif in "-lungif" "-lgif" ; do
4705 cc_check $_ld_gif && tmp_run && _gif=yes && break
4706 done
4709 # If no library was found, and the user wants support forced,
4710 # then we force it on with libgif, as this is the safest
4711 # assumption IMHO. (libungif & libregif both create symbolic
4712 # links to libgif. We also assume that no x11 support is needed,
4713 # because if you are forcing this, then you _should_ know what
4714 # you are doing. [ Besides, package maintainers should never
4715 # have compiled x11 deps into libungif in the first place. ] )
4716 # </rant>
4717 # --Joey
4718 if test "$_force_gif" = yes && test "$_gif" = no ; then
4719 _gif=yes
4720 _ld_gif="-lgif"
4723 if test "$_gif" = yes ; then
4724 _def_gif='#define HAVE_GIF 1'
4725 _vosrc="$_vosrc vo_gif89a.c"
4726 _codecmodules="gif $_codecmodules"
4727 _vomodules="gif89a $_vomodules"
4728 _res_comment="old version, some encoding functions disabled"
4729 _def_gif_4='#undef HAVE_GIF_4'
4730 _ld_extra="$_ld_extra $_ld_gif"
4732 cat > $TMPC << EOF
4733 #include <signal.h>
4734 #include <gif_lib.h>
4735 void catch() { exit(1); }
4736 int main(void) {
4737 signal(SIGSEGV, catch); // catch segfault
4738 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4739 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4740 return 0;
4743 if cc_check "$_ld_gif" && tmp_run ; then
4744 _def_gif_4='#define HAVE_GIF_4 1'
4745 _res_comment=""
4747 else
4748 _def_gif='#undef HAVE_GIF'
4749 _def_gif_4='#undef HAVE_GIF_4'
4750 _novomodules="gif89a $_novomodules"
4751 _nocodecmodules="gif $_nocodecmodules"
4753 echores "$_gif"
4756 case "$_gif" in yes*)
4757 echocheck "broken giflib workaround"
4758 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4760 cat > $TMPC << EOF
4761 #include <gif_lib.h>
4762 int main(void) {
4763 GifFileType gif;
4764 printf("UserData is at address %p\n", gif.UserData);
4765 return 0;
4768 if cc_check "$_ld_gif" && tmp_run ; then
4769 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4770 echores "disabled"
4771 else
4772 echores "enabled"
4775 esac
4778 echocheck "VESA support"
4779 if test "$_vesa" = auto ; then
4780 cat > $TMPC << EOF
4781 #include <vbe.h>
4782 int main(void) { vbeVersion(); return 0; }
4784 _vesa=no
4785 cc_check -lvbe -llrmi && _vesa=yes
4787 if test "$_vesa" = yes ; then
4788 _def_vesa='#define HAVE_VESA 1'
4789 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4790 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4791 _vomodules="vesa $_vomodules"
4792 else
4793 _def_vesa='#undef HAVE_VESA'
4794 _novomodules="vesa $_novomodules"
4796 echores "$_vesa"
4798 #################
4799 # VIDEO + AUDIO #
4800 #################
4803 echocheck "SDL"
4804 if test -z "$_sdlconfig" ; then
4805 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4806 _sdlconfig="sdl-config"
4807 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4808 _sdlconfig="sdl11-config"
4809 else
4810 _sdlconfig=false
4813 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4814 cat > $TMPC << EOF
4815 #include <SDL.h>
4816 int main(int argc, char *argv[]) {
4817 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4818 return 0;
4821 _sdl=no
4822 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4823 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4824 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4825 if test "$_sdlversion" -gt 116 ; then
4826 if test "$_sdlversion" -lt 121 ; then
4827 _def_sdlbuggy='#define BUGGY_SDL'
4828 else
4829 _def_sdlbuggy='#undef BUGGY_SDL'
4831 _sdl=yes
4836 if test "$_sdl" = yes ; then
4837 _def_sdl='#define HAVE_SDL 1'
4838 if cygwin ; then
4839 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4840 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4841 elif mingw32 ; then
4842 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4843 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4844 else
4845 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4846 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4848 _vosrc="$_vosrc vo_sdl.c"
4849 _vomodules="sdl $_vomodules"
4850 _aosrc="$_aosrc ao_sdl.c"
4851 _aomodules="sdl $_aomodules"
4852 _res_comment="using $_sdlconfig"
4853 else
4854 _def_sdl='#undef HAVE_SDL'
4855 _novomodules="sdl $_novomodules"
4856 _noaomodules="sdl $_noaomodules"
4858 echores "$_sdl"
4861 if win32; then
4863 echocheck "Windows waveout"
4864 if test "$_win32waveout" = auto ; then
4865 cat > $TMPC << EOF
4866 #include <windows.h>
4867 #include <mmsystem.h>
4868 int main(void) { return 0; }
4870 _win32waveout=no
4871 cc_check -lwinmm && _win32waveout=yes
4873 if test "$_win32waveout" = yes ; then
4874 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4875 _libs_mplayer="$_libs_mplayer -lwinmm"
4876 _aosrc="$_aosrc ao_win32.c"
4877 _aomodules="win32 $_aomodules"
4878 else
4879 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4880 _noaomodules="win32 $_noaomodules"
4882 echores "$_win32waveout"
4884 echocheck "Directx"
4885 if test "$_directx" = auto ; then
4886 cat > $TMPC << EOF
4887 #include <windows.h>
4888 #include <ddraw.h>
4889 #include <dsound.h>
4890 int main(void) { return 0; }
4892 _directx=no
4893 cc_check -lgdi32 && _directx=yes
4895 if test "$_directx" = yes ; then
4896 _def_directx='#define HAVE_DIRECTX 1'
4897 _libs_mplayer="$_libs_mplayer -lgdi32"
4898 _vosrc="$_vosrc vo_directx.c"
4899 _vomodules="directx $_vomodules"
4900 _aosrc="$_aosrc ao_dsound.c"
4901 _aomodules="dsound $_aomodules"
4902 else
4903 _def_directx='#undef HAVE_DIRECTX'
4904 _novomodules="directx $_novomodules"
4905 _noaomodules="dsound $_noaomodules"
4907 echores "$_directx"
4909 fi #if win32; then
4912 echocheck "NAS"
4913 if test "$_nas" = auto ; then
4914 cat > $TMPC << EOF
4915 #include <audio/audiolib.h>
4916 int main(void) { return 0; }
4918 _nas=no
4919 cc_check $_ld_lm -laudio -lXt && _nas=yes
4921 if test "$_nas" = yes ; then
4922 _def_nas='#define HAVE_NAS 1'
4923 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4924 _aosrc="$_aosrc ao_nas.c"
4925 _aomodules="nas $_aomodules"
4926 else
4927 _noaomodules="nas $_noaomodules"
4928 _def_nas='#undef HAVE_NAS'
4930 echores "$_nas"
4932 echocheck "DXR2"
4933 if test "$_dxr2" = auto; then
4934 _dxr2=no
4935 cat > $TMPC << EOF
4936 #include <dxr2ioctl.h>
4937 int main(void) { return 0; }
4939 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4940 cc_check $_inc_tmp && _dxr2=yes && \
4941 _inc_extra="$_inc_extra $_inc_tmp" && break
4942 done
4944 if test "$_dxr2" = yes; then
4945 _def_dxr2='#define HAVE_DXR2 1'
4946 _vosrc="$_vosrc vo_dxr2.c"
4947 _aosrc="$_aosrc ao_dxr2.c"
4948 _aomodules="dxr2 $_aomodules"
4949 _vomodules="dxr2 $_vomodules"
4950 else
4951 _def_dxr2='#undef HAVE_DXR2'
4952 _noaomodules="dxr2 $_noaomodules"
4953 _novomodules="dxr2 $_novomodules"
4955 echores "$_dxr2"
4957 echocheck "DXR3/H+"
4958 if test "$_dxr3" = auto ; then
4959 cat > $TMPC << EOF
4960 #include <linux/em8300.h>
4961 int main(void) { return 0; }
4963 _dxr3=no
4964 cc_check && _dxr3=yes
4966 if test "$_dxr3" = yes ; then
4967 _def_dxr3='#define HAVE_DXR3 1'
4968 _vosrc="$_vosrc vo_dxr3.c"
4969 _vomodules="dxr3 $_vomodules"
4970 else
4971 _def_dxr3='#undef HAVE_DXR3'
4972 _novomodules="dxr3 $_novomodules"
4974 echores "$_dxr3"
4977 echocheck "IVTV TV-Out (pre linux-2.6.24)"
4978 if test "$_ivtv" = auto ; then
4979 cat > $TMPC << EOF
4980 #include <stdlib.h>
4981 #include <inttypes.h>
4982 #include <linux/types.h>
4983 #include <linux/videodev2.h>
4984 #include <linux/ivtv.h>
4985 #include <sys/ioctl.h>
4986 int main(void) {
4987 struct ivtv_cfg_stop_decode sd;
4988 struct ivtv_cfg_start_decode sd1;
4989 ioctl (0, IVTV_IOC_START_DECODE, &sd1);
4990 ioctl (0, IVTV_IOC_STOP_DECODE, &sd);
4991 return 0; }
4993 _ivtv=no
4994 cc_check && _ivtv=yes
4996 if test "$_ivtv" = yes ; then
4997 _def_ivtv='#define HAVE_IVTV 1'
4998 _vosrc="$_vosrc vo_ivtv.c"
4999 _vomodules="ivtv $_vomodules"
5000 _aosrc="$_aosrc ao_ivtv.c"
5001 _aomodules="ivtv $_aomodules"
5002 else
5003 _def_ivtv='#undef HAVE_IVTV'
5004 _novomodules="ivtv $_novomodules"
5005 _noaomodules="ivtv $_noaomodules"
5007 echores "$_ivtv"
5010 echocheck "V4L2 MPEG Decoder"
5011 if test "$_v4l2" = auto ; then
5012 cat > $TMPC << EOF
5013 #include <stdlib.h>
5014 #include <inttypes.h>
5015 #include <linux/types.h>
5016 #include <linux/videodev2.h>
5017 #include <linux/version.h>
5018 int main(void) {
5019 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5020 #error kernel headers too old, need 2.6.22
5021 bad_kernel_version();
5022 #endif
5023 struct v4l2_ext_controls ctrls;
5024 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5025 return 0;
5028 _v4l2=no
5029 cc_check && _v4l2=yes
5031 if test "$_v4l2" = yes ; then
5032 _def_v4l2='#define HAVE_V4L2_DECODER 1'
5033 _vosrc="$_vosrc vo_v4l2.c"
5034 _vomodules="v4l2 $_vomodules"
5035 _aosrc="$_aosrc ao_v4l2.c"
5036 _aomodules="v4l2 $_aomodules"
5037 else
5038 _def_v4l2='#undef HAVE_V4L2_DECODER'
5039 _novomodules="v4l2 $_novomodules"
5040 _noaomodules="v4l2 $_noaomodules"
5042 echores "$_v4l2"
5046 #########
5047 # AUDIO #
5048 #########
5051 echocheck "OSS Audio"
5052 if test "$_ossaudio" = auto ; then
5053 cat > $TMPC << EOF
5054 #include <sys/ioctl.h>
5055 #include <$_soundcard_header>
5056 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5058 _ossaudio=no
5059 cc_check && _ossaudio=yes
5061 if test "$_ossaudio" = yes ; then
5062 _def_ossaudio='#define USE_OSS_AUDIO 1'
5063 _aosrc="$_aosrc ao_oss.c"
5064 _aomodules="oss $_aomodules"
5065 if test "$_linux_devfs" = yes; then
5066 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5067 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5068 else
5069 cat > $TMPC << EOF
5070 #include <sys/ioctl.h>
5071 #include <$_soundcard_header>
5072 #ifdef OPEN_SOUND_SYSTEM
5073 int main(void) { return 0; }
5074 #else
5075 #error Not the real thing
5076 #endif
5078 _real_ossaudio=no
5079 cc_check && _real_ossaudio=yes
5080 if test "$_real_ossaudio" = yes; then
5081 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5082 elif netbsd || openbsd ; then
5083 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5084 _ld_extra="$_ld_extra -lossaudio"
5085 else
5086 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5088 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5090 else
5091 _def_ossaudio='#undef USE_OSS_AUDIO'
5092 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5093 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5094 _noaomodules="oss $_noaomodules"
5096 echores "$_ossaudio"
5099 echocheck "aRts"
5100 if test "$_arts" = auto ; then
5101 _arts=no
5102 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5104 cat > $TMPC << EOF
5105 #include <artsc.h>
5106 int main(void) { return 0; }
5108 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5113 if test "$_arts" = yes ; then
5114 _def_arts='#define USE_ARTS 1'
5115 _aosrc="$_aosrc ao_arts.c"
5116 _aomodules="arts $_aomodules"
5117 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5118 _inc_extra="$_inc_extra `artsc-config --cflags`"
5119 else
5120 _noaomodules="arts $_noaomodules"
5122 echores "$_arts"
5125 echocheck "EsounD"
5126 if test "$_esd" = auto ; then
5127 _esd=no
5128 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5130 cat > $TMPC << EOF
5131 #include <esd.h>
5132 int main(void) { int fd = esd_open_sound("test"); return fd; }
5134 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5138 echores "$_esd"
5140 if test "$_esd" = yes ; then
5141 _def_esd='#define USE_ESD 1'
5142 _aosrc="$_aosrc ao_esd.c"
5143 _aomodules="esd $_aomodules"
5144 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5145 _inc_extra="$_inc_extra `esd-config --cflags`"
5147 echocheck "esd_get_latency()"
5148 cat > $TMPC << EOF
5149 #include <esd.h>
5150 int main(void) { return esd_get_latency(0); }
5152 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5153 echores "$_esd_latency"
5154 else
5155 _def_esd='#undef USE_ESD'
5156 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5157 _noaomodules="esd $_noaomodules"
5160 echocheck "pulse"
5161 if test "$_pulse" = auto ; then
5162 _pulse=no
5163 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5165 cat > $TMPC << EOF
5166 #include <pulse/pulseaudio.h>
5167 int main(void) { return 0; }
5169 cc_check `$_pkg_config --libs --cflags libpulse` && tmp_run && _pulse=yes
5173 echores "$_pulse"
5175 if test "$_pulse" = yes ; then
5176 _def_pulse='#define USE_PULSE 1'
5177 _aosrc="$_aosrc ao_pulse.c"
5178 _aomodules="pulse $_aomodules"
5179 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs libpulse`"
5180 _inc_extra="$_inc_extra `$_pkg_config --cflags libpulse`"
5181 else
5182 _def_pulse='#undef USE_PULSE'
5183 _noaomodules="pulse $_noaomodules"
5187 echocheck "JACK"
5188 if test "$_jack" = auto ; then
5189 _jack=yes
5191 cat > $TMPC << EOF
5192 #include <jack/jack.h>
5193 int main(void) { jack_client_new("test"); return 0; }
5195 if cc_check -ljack ; then
5196 _libs_mplayer="$_libs_mplayer -ljack"
5197 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5198 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5199 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5200 else
5201 _jack=no
5205 if test "$_jack" = yes ; then
5206 _def_jack='#define USE_JACK 1'
5207 _aosrc="$_aosrc ao_jack.c"
5208 _aomodules="jack $_aomodules"
5209 else
5210 _noaomodules="jack $_noaomodules"
5212 echores "$_jack"
5214 echocheck "OpenAL"
5215 if test "$_openal" = auto ; then
5216 _openal=no
5217 cat > $TMPC << EOF
5218 #ifdef OPENAL_AL_H
5219 #include <OpenAL/al.h>
5220 #else
5221 #include <AL/al.h>
5222 #endif
5223 int main(void) {
5224 alSourceQueueBuffers(0, 0, 0);
5225 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5226 return 0;
5229 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5230 cc_check $I && _openal=yes && break
5231 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5232 done
5233 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5235 if test "$_openal" = yes ; then
5236 _def_openal='#define USE_OPENAL 1'
5237 _aosrc="$_aosrc ao_openal.c"
5238 _aomodules="openal $_aomodules"
5239 else
5240 _noaomodules="openal $_noaomodules"
5242 echores "$_openal"
5244 echocheck "ALSA audio"
5245 if test "$_alsa" != no ; then
5246 _alsa=no
5247 cat > $TMPC << EOF
5248 #include <sys/asoundlib.h>
5249 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5250 #error "alsa version != 0.5.x"
5251 #endif
5252 int main(void) { return 0; }
5254 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5256 cat > $TMPC << EOF
5257 #include <sys/asoundlib.h>
5258 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5259 #error "alsa version != 0.9.x"
5260 #endif
5261 int main(void) { return 0; }
5263 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5264 cat > $TMPC << EOF
5265 #include <alsa/asoundlib.h>
5266 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5267 #error "alsa version != 0.9.x"
5268 #endif
5269 int main(void) { return 0; }
5271 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5273 cat > $TMPC << EOF
5274 #include <sys/asoundlib.h>
5275 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5276 #error "alsa version != 1.0.x"
5277 #endif
5278 int main(void) { return 0; }
5280 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5281 cat > $TMPC << EOF
5282 #include <alsa/asoundlib.h>
5283 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5284 #error "alsa version != 1.0.x"
5285 #endif
5286 int main(void) { return 0; }
5288 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5290 _def_alsa5='#undef HAVE_ALSA5'
5291 _def_alsa9='#undef HAVE_ALSA9'
5292 _def_alsa1x='#undef HAVE_ALSA1X'
5293 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5294 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5295 if test "$_alsaver" ; then
5296 _alsa=yes
5297 if test "$_alsaver" = '0.5.x' ; then
5298 _alsa5=yes
5299 _aosrc="$_aosrc ao_alsa5.c"
5300 _aomodules="alsa5 $_aomodules"
5301 _def_alsa5='#define HAVE_ALSA5 1'
5302 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5303 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5304 elif test "$_alsaver" = '0.9.x-sys' ; then
5305 _alsa9=yes
5306 _aosrc="$_aosrc ao_alsa.c"
5307 _aomodules="alsa $_aomodules"
5308 _def_alsa9='#define HAVE_ALSA9 1'
5309 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5310 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5311 elif test "$_alsaver" = '0.9.x-alsa' ; then
5312 _alsa9=yes
5313 _aosrc="$_aosrc ao_alsa.c"
5314 _aomodules="alsa $_aomodules"
5315 _def_alsa9='#define HAVE_ALSA9 1'
5316 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5317 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5318 elif test "$_alsaver" = '1.0.x-sys' ; then
5319 _alsa1x=yes
5320 _aosrc="$_aosrc ao_alsa.c"
5321 _aomodules="alsa $_aomodules"
5322 _def_alsa1x="#define HAVE_ALSA1X 1"
5323 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5324 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5325 elif test "$_alsaver" = '1.0.x-alsa' ; then
5326 _alsa1x=yes
5327 _aosrc="$_aosrc ao_alsa.c"
5328 _aomodules="alsa $_aomodules"
5329 _def_alsa1x="#define HAVE_ALSA1X 1"
5330 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5331 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5332 else
5333 _alsa=no
5334 _res_comment="unknown version"
5336 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5337 else
5338 _noaomodules="alsa $_noaomodules"
5340 echores "$_alsa"
5343 echocheck "Sun audio"
5344 if test "$_sunaudio" = auto ; then
5345 cat > $TMPC << EOF
5346 #include <sys/types.h>
5347 #include <sys/audioio.h>
5348 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5350 _sunaudio=no
5351 cc_check && _sunaudio=yes
5353 if test "$_sunaudio" = yes ; then
5354 _def_sunaudio='#define USE_SUN_AUDIO 1'
5355 _aosrc="$_aosrc ao_sun.c"
5356 _aomodules="sun $_aomodules"
5357 else
5358 _def_sunaudio='#undef USE_SUN_AUDIO'
5359 _noaomodules="sun $_noaomodules"
5361 echores "$_sunaudio"
5364 if sunos; then
5365 echocheck "Sun mediaLib"
5366 if test "$_mlib" = auto ; then
5367 _mlib=no
5368 cat > $TMPC << EOF
5369 #include <mlib.h>
5370 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5372 cc_check -lmlib && _mlib=yes
5374 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5375 echores "$_mlib"
5376 fi #if sunos
5379 if irix; then
5380 echocheck "SGI audio"
5381 if test "$_sgiaudio" = auto ; then
5382 # check for SGI audio
5383 cat > $TMPC << EOF
5384 #include <dmedia/audio.h>
5385 int main(void) { return 0; }
5387 _sgiaudio=no
5388 cc_check && _sgiaudio=yes
5390 if test "$_sgiaudio" = "yes" ; then
5391 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5392 _libs_mplayer="$_libs_mplayer -laudio"
5393 _aosrc="$_aosrc ao_sgi.c"
5394 _aomodules="sgi $_aomodules"
5395 else
5396 _def_sgiaudio='#undef USE_SGI_AUDIO'
5397 _noaomodules="sgi $_noaomodules"
5399 echores "$_sgiaudio"
5400 fi #if irix
5403 echocheck "VCD support"
5404 if linux || freebsd || netbsd || dragonfly || bsdos || darwin || sunos || mingw32; then
5405 _inputmodules="vcd $_inputmodules"
5406 _def_vcd='#define HAVE_VCD 1'
5407 _vcd="yes"
5408 else
5409 _def_vcd='#undef HAVE_VCD'
5410 _noinputmodules="vcd $_noinputmodules"
5411 _res_comment="not supported on this OS"
5412 _vcd="no"
5414 echores "$_vcd"
5418 echocheck "dvdread"
5419 if test "$_dvdread_internal" = auto ; then
5420 _dvdread_internal=no
5421 _dvdread=no
5422 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5423 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5424 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5425 || darwin || win32; then
5426 _dvdread_internal=yes
5427 _dvdread=yes
5429 elif test "$_dvdread" = auto ; then
5430 _dvdread=no
5431 if test "$_dl" = yes; then
5432 cat > $TMPC << EOF
5433 #include <inttypes.h>
5434 #include <dvdread/dvd_reader.h>
5435 #include <dvdread/ifo_types.h>
5436 #include <dvdread/ifo_read.h>
5437 #include <dvdread/nav_read.h>
5438 int main(void) { return 0; }
5440 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5441 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5443 if test "$_dvdread" = no ; then
5444 _dvdreadconfig="dvdread-config"
5445 _dvdreadcflags=`$_dvdreadconfig --cflags`
5446 _dvdreadlibs=`$_dvdreadconfig --libs`
5447 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5448 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5449 _dvdread=yes
5450 _inc_extra="$_inc_extra $_dvdreadcflags"
5451 _ld_extra="$_ld_extra $_dvdreadlibs"
5452 _res_comment="external"
5457 if test "$_dvdread_internal" = yes; then
5458 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5459 _def_dvdread='#define USE_DVDREAD 1'
5460 _inputmodules="dvdread(internal) $_inputmodules"
5461 _largefiles=yes
5462 _res_comment="internal"
5463 elif test "$_dvdread" = yes; then
5464 _def_dvdread='#define USE_DVDREAD 1'
5465 _largefiles=yes
5466 _ld_extra="$_ld_extra -ldvdread"
5467 _inputmodules="dvdread(external) $_inputmodules"
5468 _res_comment="external"
5469 else
5470 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5471 _def_dvdread='#undef USE_DVDREAD'
5472 _noinputmodules="dvdread $_noinputmodules"
5474 echores "$_dvdread"
5477 echocheck "internal libdvdcss"
5478 if test "$_libdvdcss_internal" = auto ; then
5479 _libdvdcss_internal=no
5480 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5481 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5483 if test "$_libdvdcss_internal" = yes ; then
5484 if linux || netbsd || openbsd || bsdos ; then
5485 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5486 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5487 elif freebsd || dragonfly ; then
5488 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5489 elif darwin ; then
5490 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5491 _ld_extra="$_ld_extra -framework IOKit"
5493 _inputmodules="libdvdcss(internal) $_inputmodules"
5494 _largefiles=yes
5495 else
5496 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5498 echores "$_libdvdcss_internal"
5501 echocheck "cdparanoia"
5502 if test "$_cdparanoia" = auto ; then
5503 cat > $TMPC <<EOF
5504 #include <cdda_interface.h>
5505 #include <cdda_paranoia.h>
5506 // This need a better test. How ?
5507 int main(void) {
5508 void *test = cdda_verbose_set;
5509 return test == (void *)1;
5512 _cdparanoia=no
5513 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5514 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5515 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5516 done
5518 if test "$_cdparanoia" = yes ; then
5519 _cdda='yes'
5520 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5521 openbsd && _ld_extra="$_ld_extra -lutil"
5523 echores "$_cdparanoia"
5526 echocheck "libcdio"
5527 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5528 cat > $TMPC << EOF
5529 #include <stdio.h>
5530 #include <cdio/version.h>
5531 #include <cdio/cdda.h>
5532 #include <cdio/paranoia.h>
5533 int main(void)
5535 void *test = cdda_verbose_set;
5536 printf("%s\n", CDIO_VERSION);
5537 return test == (void *)1;
5541 _libcdio=no
5542 for _ld_tmp in "" "-lwinmm" ; do
5543 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5544 cc_check $_ld_tmp $_ld_lm \
5545 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5546 done
5547 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5548 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5549 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5550 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5551 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5554 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5555 _cdda='yes'
5556 _def_libcdio='#define HAVE_LIBCDIO'
5557 _def_havelibcdio='yes'
5558 else
5559 if test "$_cdparanoia" = yes ; then
5560 _res_comment="using cdparanoia"
5562 _def_libcdio='#undef HAVE_LIBCDIO'
5563 _def_havelibcdio='no'
5565 echores "$_libcdio"
5567 if test "$_cdda" = yes ; then
5568 test $_cddb = auto && test $_network = yes && _cddb=yes
5569 _def_cdparanoia='#define HAVE_CDDA'
5570 _inputmodules="cdda $_inputmodules"
5571 else
5572 _def_cdparanoia='#undef HAVE_CDDA'
5573 _noinputmodules="cdda $_noinputmodules"
5576 if test "$_cddb" = yes ; then
5577 _def_cddb='#define HAVE_CDDB'
5578 _inputmodules="cddb $_inputmodules"
5579 else
5580 _cddb=no
5581 _def_cddb='#undef HAVE_CDDB'
5582 _noinputmodules="cddb $_noinputmodules"
5585 echocheck "bitmap font support"
5586 if test "$_bitmap_font" = yes ; then
5587 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5588 else
5589 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5591 echores "$_bitmap_font"
5594 echocheck "freetype >= 2.0.9"
5596 # freetype depends on iconv
5597 if test "$_iconv" = no ; then
5598 _freetype=no
5599 _res_comment="iconv support needed"
5602 if test "$_freetype" = auto ; then
5603 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5604 cat > $TMPC << EOF
5605 #include <stdio.h>
5606 #include <ft2build.h>
5607 #include FT_FREETYPE_H
5608 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5609 #error "Need FreeType 2.0.9 or newer"
5610 #endif
5611 int main(void)
5613 FT_Library library;
5614 FT_Int major=-1,minor=-1,patch=-1;
5615 int err=FT_Init_FreeType(&library);
5616 if(err){
5617 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5618 exit(err);
5620 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5621 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5622 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5623 (int)major,(int)minor,(int)patch );
5624 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5625 printf("Library and header version mismatch! Fix it in your distribution!\n");
5626 exit(1);
5628 return 0;
5631 _freetype=no
5632 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5633 else
5634 _freetype=no
5637 if test "$_freetype" = yes ; then
5638 _def_freetype='#define HAVE_FREETYPE'
5639 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5640 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5641 else
5642 _def_freetype='#undef HAVE_FREETYPE'
5644 echores "$_freetype"
5646 if test "$_freetype" = no ; then
5647 _fontconfig=no
5648 _res_comment="freetype support needed"
5650 echocheck "fontconfig"
5651 if test "$_fontconfig" = auto ; then
5652 cat > $TMPC << EOF
5653 #include <stdio.h>
5654 #include <fontconfig/fontconfig.h>
5655 int main(void)
5657 int err = FcInit();
5658 if(err == FcFalse){
5659 printf("Couldn't initialize fontconfig lib\n");
5660 exit(err);
5662 return 0;
5666 _fontconfig=no
5667 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5668 _ld_tmp="-lfontconfig $_ld_tmp"
5669 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5670 done
5671 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5672 _inc_tmp=`$_pkg_config --cflags fontconfig`
5673 _ld_tmp=`$_pkg_config --libs fontconfig`
5674 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5675 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5678 if test "$_fontconfig" = yes ; then
5679 _def_fontconfig='#define HAVE_FONTCONFIG'
5680 else
5681 _def_fontconfig='#undef HAVE_FONTCONFIG'
5683 echores "$_fontconfig"
5686 echocheck "SSA/ASS support"
5687 # libass depends on FreeType
5688 if test "$_freetype" = no ; then
5689 _ass=no
5690 _res_comment="FreeType support needed"
5693 if test "$_ass" = auto ; then
5694 cat > $TMPC << EOF
5695 #include <ft2build.h>
5696 #include FT_FREETYPE_H
5697 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5698 #error "Need FreeType 2.1.8 or newer"
5699 #endif
5700 int main(void) { return 0; }
5702 _ass=no
5703 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5704 if test "$_ass" = no ; then
5705 _res_comment="FreeType >= 2.1.8 needed"
5708 if test "$_ass" = yes ; then
5709 _def_ass='#define USE_ASS'
5710 else
5711 _def_ass='#undef USE_ASS'
5713 echores "$_ass"
5716 echocheck "fribidi with charsets"
5717 if test "$_fribidi" = auto ; then
5718 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5719 cat > $TMPC << EOF
5720 #include <stdio.h>
5721 /* workaround for fribidi 0.10.4 and below */
5722 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5723 #include <fribidi/fribidi.h>
5724 int main(void)
5726 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5727 printf("Fribidi headers are not consistents with the library!\n");
5728 exit(1);
5730 return 0;
5733 _fribidi=no
5734 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5735 else
5736 _fribidi=no
5739 if test "$_fribidi" = yes ; then
5740 _def_fribidi='#define USE_FRIBIDI'
5741 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5742 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5743 else
5744 _def_fribidi='#undef USE_FRIBIDI'
5746 echores "$_fribidi"
5749 echocheck "ENCA"
5750 if test "$_enca" = auto ; then
5751 cat > $TMPC << EOF
5752 #include <enca.h>
5753 int main(void)
5755 const char **langs;
5756 size_t langcnt;
5757 langs = enca_get_languages(&langcnt);
5758 return 0;
5761 _enca=no
5762 cc_check -lenca $_ld_lm && _enca=yes
5764 if test "$_enca" = yes ; then
5765 _def_enca='#define HAVE_ENCA 1'
5766 _ld_extra="$_ld_extra -lenca"
5767 else
5768 _def_enca='#undef HAVE_ENCA'
5770 echores "$_enca"
5773 echocheck "zlib"
5774 cat > $TMPC << EOF
5775 #include <zlib.h>
5776 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5778 _zlib=no
5779 cc_check -lz && _zlib=yes
5780 if test "$_zlib" = yes ; then
5781 _def_zlib='#define HAVE_ZLIB 1'
5782 _ld_extra="$_ld_extra -lz"
5783 else
5784 _def_zlib='#undef HAVE_ZLIB'
5785 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5786 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5788 echores "$_zlib"
5791 echocheck "RTC"
5792 if test "$_rtc" = auto ; then
5793 cat > $TMPC << EOF
5794 #include <sys/ioctl.h>
5795 #ifdef __linux__
5796 #include <linux/rtc.h>
5797 #else
5798 #include <rtc.h>
5799 #define RTC_PIE_ON RTCIO_PIE_ON
5800 #endif
5801 int main(void) { return RTC_PIE_ON; }
5803 _rtc=no
5804 cc_check && _rtc=yes
5805 ppc && _rtc=no
5807 if test "$_rtc" = yes ; then
5808 _def_rtc='#define HAVE_RTC 1'
5809 else
5810 _def_rtc='#undef HAVE_RTC'
5812 echores "$_rtc"
5815 echocheck "liblzo2 support"
5816 if test "$_liblzo" = auto ; then
5817 _liblzo=no
5818 cat > $TMPC << EOF
5819 #include <lzo/lzo1x.h>
5820 int main(void) { lzo_init();return 0; }
5822 cc_check -llzo2 && _liblzo=yes
5824 if test "$_liblzo" = yes ; then
5825 _def_liblzo='#define USE_LIBLZO 1'
5826 _ld_extra="$_ld_extra -llzo2"
5827 _codecmodules="liblzo $_codecmodules"
5828 else
5829 _def_liblzo='#undef USE_LIBLZO'
5830 _nocodecmodules="liblzo $_nocodecmodules"
5832 echores "$_liblzo"
5835 echocheck "mad support"
5836 if test "$_mad" = auto ; then
5837 _mad=no
5838 cat > $TMPC << EOF
5839 #include <mad.h>
5840 int main(void) { return 0; }
5842 cc_check -lmad && _mad=yes
5844 if test "$_mad" = yes ; then
5845 _def_mad='#define USE_LIBMAD 1'
5846 _ld_extra="$_ld_extra -lmad"
5847 _codecmodules="libmad $_codecmodules"
5848 else
5849 _def_mad='#undef USE_LIBMAD'
5850 _nocodecmodules="libmad $_nocodecmodules"
5852 echores "$_mad"
5854 echocheck "Twolame"
5855 if test "$_twolame" = auto ; then
5856 cat > $TMPC <<EOF
5857 #include <twolame.h>
5858 int main(void) { twolame_init(); return 0; }
5860 _twolame=no
5861 cc_check -ltwolame $_ld_lm && _twolame=yes
5863 if test "$_twolame" = yes ; then
5864 _def_twolame='#define HAVE_TWOLAME 1'
5865 _libs_mencoder="$_libs_mencoder -ltwolame"
5866 _codecmodules="twolame $_codecmodules"
5867 else
5868 _def_twolame='#undef HAVE_TWOLAME'
5869 _nocodecmodules="twolame $_nocodecmodules"
5871 echores "$_twolame"
5873 echocheck "Toolame"
5874 if test "$_toolame" = auto ; then
5875 _toolame=no
5876 if test "$_twolame" = yes ; then
5877 _res_comment="disabled by twolame"
5878 else
5879 cat > $TMPC <<EOF
5880 #include <toolame.h>
5881 int main(void) { toolame_init(); return 0; }
5883 cc_check -ltoolame $_ld_lm && _toolame=yes
5886 if test "$_toolame" = yes ; then
5887 _def_toolame='#define HAVE_TOOLAME 1'
5888 _libs_mencoder="$_libs_mencoder -ltoolame"
5889 _codecmodules="toolame $_codecmodules"
5890 else
5891 _def_toolame='#undef HAVE_TOOLAME'
5892 _nocodecmodules="toolame $_nocodecmodules"
5894 if test "$_toolamedir" ; then
5895 _res_comment="using $_toolamedir"
5897 echores "$_toolame"
5899 echocheck "OggVorbis support"
5900 if test "$_tremor_internal" = yes; then
5901 _libvorbis=no
5902 elif test "$_tremor_external" = auto; then
5903 _tremor_external=no
5904 cat > $TMPC << EOF
5905 #include <tremor/ivorbiscodec.h>
5906 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5908 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5910 if test "$_libvorbis" = auto; then
5911 _libvorbis=no
5912 cat > $TMPC << EOF
5913 #include <vorbis/codec.h>
5914 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5916 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5918 if test "$_tremor_internal" = yes ; then
5919 _vorbis=yes
5920 _def_vorbis='#define HAVE_OGGVORBIS 1'
5921 _def_tremor='#define TREMOR 1'
5922 _codecmodules="tremor(internal) $_codecmodules"
5923 _res_comment="internal Tremor"
5924 if test "$_tremor_low" = yes ; then
5925 CFLAGS="$CFLAGS -D_LOW_ACCURACY_"
5926 _res_comment="internal low accuracy Tremor"
5928 elif test "$_tremor_external" = yes ; then
5929 _vorbis=yes
5930 _def_vorbis='#define HAVE_OGGVORBIS 1'
5931 _def_tremor='#define TREMOR 1'
5932 _codecmodules="tremor(external) $_codecmodules"
5933 _res_comment="external Tremor"
5934 _ld_extra="$_ld_extra -logg -lvorbisidec"
5935 elif test "$_libvorbis" = yes ; then
5936 _vorbis=yes
5937 _def_vorbis='#define HAVE_OGGVORBIS 1'
5938 _codecmodules="libvorbis $_codecmodules"
5939 _res_comment="libvorbis"
5940 _ld_extra="$_ld_extra -lvorbis -logg"
5941 else
5942 _vorbis=no
5943 _nocodecmodules="libvorbis $_nocodecmodules"
5945 if test "$_libvorbis" = no ; then
5946 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5948 echores "$_vorbis"
5950 echocheck "libspeex (version >= 1.1 required)"
5951 if test "$_speex" = auto ; then
5952 _speex=no
5953 cat > $TMPC << EOF
5954 #include <speex/speex.h>
5955 int main(void) {
5956 SpeexBits bits;
5957 void *dec;
5958 speex_decode_int(dec, &bits, dec);
5961 cc_check -lspeex $_ld_lm && _speex=yes
5963 if test "$_speex" = yes ; then
5964 _def_speex='#define HAVE_SPEEX 1'
5965 _ld_extra="$_ld_extra -lspeex"
5966 _codecmodules="speex $_codecmodules"
5967 else
5968 _def_speex='#undef HAVE_SPEEX'
5969 _nocodecmodules="speex $_nocodecmodules"
5971 echores "$_speex"
5973 echocheck "OggTheora support"
5974 if test "$_theora" = auto ; then
5975 _theora=no
5976 cat > $TMPC << EOF
5977 #include <theora/theora.h>
5978 #include <string.h>
5979 int main(void)
5981 /* theora is in flux, make sure that all interface routines and
5982 * datatypes exist and work the way we expect it, so we don't break
5983 * mplayer */
5984 ogg_packet op;
5985 theora_comment tc;
5986 theora_info inf;
5987 theora_state st;
5988 yuv_buffer yuv;
5989 int r;
5990 double t;
5992 theora_info_init (&inf);
5993 theora_comment_init (&tc);
5995 return 0;
5997 /* we don't want to execute this kind of nonsense; just for making sure
5998 * that compilation works... */
5999 memset(&op, 0, sizeof(op));
6000 r = theora_decode_header (&inf, &tc, &op);
6001 r = theora_decode_init (&st, &inf);
6002 t = theora_granule_time (&st, op.granulepos);
6003 r = theora_decode_packetin (&st, &op);
6004 r = theora_decode_YUVout (&st, &yuv);
6005 theora_clear (&st);
6007 return 0;
6010 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
6011 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
6012 && _theora=yes && break
6013 done
6014 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6015 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
6016 cc_check -I. tremor/bitwise.c $_ld_theora \
6017 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
6018 done
6021 if test "$_theora" = yes ; then
6022 _def_theora='#define HAVE_OGGTHEORA 1'
6023 _codecmodules="libtheora $_codecmodules"
6024 # when --enable-theora is forced, we'd better provide a probably sane
6025 # $_ld_theora than nothing
6026 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
6027 else
6028 _def_theora='#undef HAVE_OGGTHEORA'
6029 _nocodecmodules="libtheora $_nocodecmodules"
6031 echores "$_theora"
6033 echocheck "internal mp3lib support"
6034 if test "$_mp3lib" = yes ; then
6035 _def_mp3lib='#define USE_MP3LIB 1'
6036 _codecmodules="mp3lib $_codecmodules"
6037 else
6038 _def_mp3lib='#undef USE_MP3LIB'
6039 _nocodecmodules="mp3lib $_nocodecmodules"
6041 echores "$_mp3lib"
6043 echocheck "internal liba52 support"
6044 if test "$_liba52" = yes ; then
6045 _def_liba52='#define USE_LIBA52 1'
6046 _codecmodules="liba52 $_codecmodules"
6047 else
6048 _def_liba52='#undef USE_LIBA52'
6049 _nocodecmodules="liba52 $_nocodecmodules"
6051 echores "$_liba52"
6053 echocheck "libdca support"
6054 if test "$_libdca" = auto ; then
6055 _libdca=no
6056 cat > $TMPC << EOF
6057 #include <inttypes.h>
6058 #include <dts.h>
6059 int main(void) { dts_init (0); return 0; }
6061 for _ld_dca in -ldts -ldca ; do
6062 cc_check $_ld_dca $_ld_lm && _ld_extra="$_ld_extra $_ld_dca" \
6063 && _libdca=yes && break
6064 done
6066 if test "$_libdca" = yes ; then
6067 _def_libdca='#define USE_LIBDCA 1'
6068 _codecmodules="libdca $_codecmodules"
6069 else
6070 _def_libdca='#undef USE_LIBDCA'
6071 _nocodecmodules="libdca $_nocodecmodules"
6073 echores "$_libdca"
6075 echocheck "internal libmpeg2 support"
6076 if test "$_libmpeg2" = auto ; then
6077 _libmpeg2=yes
6078 if alpha && test cc_vendor=gnu; then
6079 case $cc_version in
6080 2*|3.0*|3.1*) # cannot compile MVI instructions
6081 _libmpeg2=no
6082 _res_comment="broken gcc"
6084 esac
6087 if test "$_libmpeg2" = yes ; then
6088 _def_libmpeg2='#define USE_LIBMPEG2 1'
6089 _codecmodules="libmpeg2 $_codecmodules"
6090 else
6091 _def_libmpeg2='#undef USE_LIBMPEG2'
6092 _nocodecmodules="libmpeg2 $_nocodecmodules"
6094 echores "$_libmpeg2"
6096 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6097 if test "$_musepack" = auto ; then
6098 _musepack=no
6099 cat > $TMPC << EOF
6100 #include <mpcdec/mpcdec.h>
6101 int main(void) {
6102 mpc_streaminfo info;
6103 mpc_decoder decoder;
6104 mpc_decoder_set_streaminfo(&decoder, &info);
6105 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6108 cc_check -lmpcdec $_ld_lm && _musepack=yes
6110 if test "$_musepack" = yes ; then
6111 _def_musepack='#define HAVE_MUSEPACK 1'
6112 _ld_extra="$_ld_extra -lmpcdec"
6113 _codecmodules="musepack $_codecmodules"
6114 else
6115 _def_musepack='#undef HAVE_MUSEPACK'
6116 _nocodecmodules="musepack $_nocodecmodules"
6118 echores "$_musepack"
6121 echocheck "FAAC (AAC encoder) support"
6122 if test "$_faac" = auto ; then
6123 cat > $TMPC <<EOF
6124 #include <inttypes.h>
6125 #include <faac.h>
6126 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6128 _faac=no
6129 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6130 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6131 done
6133 if test "$_faac" = yes ; then
6134 _def_faac="#define HAVE_FAAC 1"
6135 if echo $_libavencoders | grep -q FAAC ; then
6136 _lavc_faac=yes
6137 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
6138 _libs_mplayer="$_libs_mplayer $_ld_faac"
6139 else
6140 _lavc_faac=no
6141 _def_lavc_faac="#undef CONFIG_LIBFAAC"
6143 _codecmodules="faac $_codecmodules"
6144 else
6145 _def_faac="#undef HAVE_FAAC"
6146 _nocodecmodules="faac $_nocodecmodules"
6147 _libavencoders=`echo $_libavencoders | sed -e s/LIBFAAC_ENCODER// `
6149 echores "$_faac (in libavcodec: $_lavc_faac)"
6152 echocheck "FAAD2 (AAC) support"
6153 if test "$_faad_internal" = auto ; then
6154 if x86_32 && test cc_vendor=gnu; then
6155 case $cc_version in
6156 3.1*|3.2) # ICE/insn with these versions
6157 _faad_internal=no
6158 _res_comment="broken gcc"
6161 _faad_internal=yes
6163 esac
6164 else
6165 _faad_internal=yes
6167 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6168 _faad_external=no
6169 cat > $TMPC << EOF
6170 #include <faad.h>
6171 #ifndef FAAD_MIN_STREAMSIZE
6172 #error Too old version
6173 #endif
6174 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6176 cc_check -lfaad $_ld_lm && _faad_external=yes
6179 if test "$_faad_internal" = yes ; then
6180 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6181 _faad=yes
6182 _res_comment="internal floating-point"
6183 if test "$_faad_fixed" = yes ; then
6184 # The FIXED_POINT implementation of FAAD2 improves performance
6185 # on some platforms, especially for SBR files.
6186 CFLAGS="$CFLAGS -DFIXED_POINT"
6187 _res_comment="internal fixed-point"
6189 elif test "$_faad_external" = yes ; then
6190 _faad=yes
6191 _ld_extra="$_ld_extra -lfaad"
6192 else
6193 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6194 _faad=no
6197 if test "$_faad" = yes ; then
6198 _def_faad='#define HAVE_FAAD 1'
6199 _codecmodules="faad2 $_codecmodules"
6200 else
6201 _def_faad='#undef HAVE_FAAD'
6202 _nocodecmodules="faad2 $_nocodecmodules"
6204 echores "$_faad"
6207 echocheck "LADSPA plugin support"
6208 if test "$_ladspa" = auto ; then
6209 cat > $TMPC <<EOF
6210 #include <stdio.h>
6211 #include <ladspa.h>
6212 int main(void) {
6213 const LADSPA_Descriptor *ld = NULL;
6214 return 0;
6217 _ladspa=no
6218 cc_check && _ladspa=yes
6220 if test "$_ladspa" = yes; then
6221 _def_ladspa="#define HAVE_LADSPA"
6222 else
6223 _def_ladspa="#undef HAVE_LADSPA"
6225 echores "$_ladspa"
6228 if test -z "$_codecsdir" ; then
6229 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6230 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6231 if test -d "$dir" ; then
6232 _codecsdir="$dir"
6233 break;
6235 done
6237 # Fall back on default directory.
6238 if test -z "$_codecsdir" ; then
6239 _codecsdir="$_libdir/codecs"
6240 mingw32 && _codecsdir="codecs"
6241 os2 && _codecsdir="codecs"
6245 echocheck "Win32 codecs"
6246 if test "$_win32dll" = auto ; then
6247 _win32dll=no
6248 if x86_32 && ! qnx; then
6249 _win32dll=yes
6252 if test "$_win32dll" = yes ; then
6253 _def_win32dll='#define USE_WIN32DLL 1'
6254 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6255 _res_comment="using $_win32codecsdir"
6256 if ! win32 ; then
6257 _def_win32_loader='#define WIN32_LOADER 1'
6258 _win32_emulation=yes
6259 else
6260 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6261 _res_comment="using native windows"
6263 _codecmodules="win32 $_codecmodules"
6264 else
6265 _def_win32dll='#undef USE_WIN32DLL'
6266 _def_win32_loader='#undef WIN32_LOADER'
6267 _nocodecmodules="win32 $_nocodecmodules"
6269 echores "$_win32dll"
6272 echocheck "XAnim codecs"
6273 if test "$_xanim" = auto ; then
6274 _xanim=no
6275 _res_comment="dynamic loader support needed"
6276 if test "$_dl" = yes ; then
6277 _xanim=yes
6280 if test "$_xanim" = yes ; then
6281 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6282 _def_xanim='#define USE_XANIM 1'
6283 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6284 _codecmodules="xanim $_codecmodules"
6285 _res_comment="using $_xanimcodecsdir"
6286 else
6287 _def_xanim='#undef USE_XANIM'
6288 _def_xanim_path='#undef XACODEC_PATH'
6289 _nocodecmodules="xanim $_nocodecmodules"
6291 echores "$_xanim"
6294 echocheck "RealPlayer codecs"
6295 if test "$_real" = auto ; then
6296 _real=no
6297 _res_comment="dynamic loader support needed"
6298 if test "$_dl" = yes || test "$_win32dll" = yes &&
6299 (linux || freebsd || netbsd || dragonfly || darwin || win32) ; then
6300 _real=yes
6303 if test "$_real" = yes ; then
6304 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6305 _def_real='#define USE_REALCODECS 1'
6306 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6307 _codecmodules="real $_codecmodules"
6308 _res_comment="using $_realcodecsdir"
6309 else
6310 _def_real='#undef USE_REALCODECS'
6311 _def_real_path="#undef REALCODEC_PATH"
6312 _nocodecmodules="real $_nocodecmodules"
6314 echores "$_real"
6317 echocheck "QuickTime codecs"
6318 _qtx_emulation=no
6319 _def_qtx_win32='#undef USE_QTX_CODECS_WIN32'
6320 if test "$_qtx" = auto ; then
6321 test "$_win32dll" = yes || darwin && _qtx=yes
6323 if test "$_qtx" = yes ; then
6324 _def_qtx='#define USE_QTX_CODECS 1'
6325 win32 && _qtx_codecs_win32=yes && _def_qtx_win32='#define USE_QTX_CODECS_WIN32 1'
6326 _codecmodules="qtx $_codecmodules"
6327 darwin || win32 || _qtx_emulation=yes
6328 else
6329 _def_qtx='#undef USE_QTX_CODECS'
6330 _nocodecmodules="qtx $_nocodecmodules"
6332 echores "$_qtx"
6334 echocheck "Nemesi Streaming Media libraries"
6335 if test "$_nemesi" = auto && test "$_network" = yes ; then
6336 _nemesi=no
6337 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6338 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6339 _nemesi=yes
6342 if test "$_nemesi" = yes; then
6343 _native_rtsp=no
6344 _def_nemesi='#define LIBNEMESI 1'
6345 _inputmodules="nemesi $_inputmodules"
6346 else
6347 _native_rtsp="$_network"
6348 _nemesi=no
6349 _def_nemesi='#undef LIBNEMESI'
6350 _noinputmodules="nemesi $_noinputmodules"
6352 echores "$_nemesi"
6354 echocheck "LIVE555 Streaming Media libraries"
6355 if test "$_live" = auto && test "$_network" = yes ; then
6356 cat > $TMPCPP << EOF
6357 #include <liveMedia.hh>
6358 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6359 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6360 #endif
6361 int main(void) {}
6364 _live=no
6365 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6366 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6367 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6368 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6369 $_livelibdir/groupsock/libgroupsock.a \
6370 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6371 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6372 $_ld_extra -lstdc++" \
6373 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6374 -I$_livelibdir/UsageEnvironment/include \
6375 -I$_livelibdir/BasicUsageEnvironment/include \
6376 -I$_livelibdir/groupsock/include" && \
6377 _live=yes && break
6378 done
6379 if test "$_live" != yes ; then
6380 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6381 _live_dist=yes
6385 if test "$_live" = yes && test "$_network" = yes; then
6386 _res_comment="using $_livelibdir"
6387 _def_live='#define STREAMING_LIVE555 1'
6388 _inputmodules="live555 $_inputmodules"
6389 elif test "$_live_dist" = yes && test "$_network" = yes; then
6390 _res_comment="using distribution version"
6391 _live="yes"
6392 _def_live='#define STREAMING_LIVE555 1'
6393 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6394 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6395 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6396 _inputmodules="live555 $_inputmodules"
6397 else
6398 _live=no
6399 _def_live='#undef STREAMING_LIVE555'
6400 _noinputmodules="live555 $_noinputmodules"
6402 echores "$_live"
6405 echocheck "FFmpeg libavutil"
6406 if test "$_libavutil_a" = auto ; then
6407 if test -d ffmpeg/libavutil ; then
6408 _libavutil_a=yes
6409 _res_comment="static"
6410 else
6411 die "MPlayer will not compile without libavutil in the source tree."
6413 elif test "$_libavutil_so" = auto ; then
6414 _libavutil_so=no
6415 cat > $TMPC << EOF
6416 #include <libavutil/common.h>
6417 int main(void) { ff_gcd(1,1); return 0; }
6419 if $_pkg_config --exists libavutil ; then
6420 _inc_libavutil=`$_pkg_config --cflags libavutil`
6421 _ld_tmp=`$_pkg_config --libs libavutil`
6422 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6423 && _libavutil_so=yes
6424 elif cc_check -lavutil $_ld_lm ; then
6425 _ld_extra="$_ld_extra -lavutil"
6426 _libavutil_so=yes
6427 _res_comment="using libavutil.so, but static libavutil is recommended"
6430 _libavutil=no
6431 _def_libavutil='#undef USE_LIBAVUTIL'
6432 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6433 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6434 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6435 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6436 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6437 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6438 # neither static nor shared libavutil is available, but it is mandatory ...
6439 if test "$_libavutil" = no ; then
6440 die "You need static or shared libavutil, MPlayer will not compile without!"
6442 echores "$_libavutil"
6444 echocheck "FFmpeg libavcodec"
6445 if test "$_libavcodec_a" = auto ; then
6446 _libavcodec_a=no
6447 if test -d ffmpeg/libavcodec && test -f ffmpeg/libavcodec/utils.c ; then
6448 _libavcodec_a="yes"
6449 _res_comment="static"
6451 elif test "$_libavcodec_so" = auto ; then
6452 _libavcodec_so=no
6453 _res_comment="libavcodec.so is discouraged over static libavcodec"
6454 cat > $TMPC << EOF
6455 #include <libavcodec/avcodec.h>
6456 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6458 if $_pkg_config --exists libavcodec ; then
6459 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6460 _ld_tmp=`$_pkg_config --libs libavcodec`
6461 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6462 && _libavcodec_so=yes
6463 elif cc_check -lavcodec $_ld_lm ; then
6464 _ld_extra="$_ld_extra -lavcodec"
6465 _libavcodec_so=yes
6466 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6469 _libavcodec=no
6470 _def_libavcodec='#undef USE_LIBAVCODEC'
6471 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6472 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6473 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6474 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6475 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6476 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6477 test "$_libavcodec_mpegaudio_hp" = yes \
6478 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6479 if test "$_libavcodec_a" = yes ; then
6480 _codecmodules="libavcodec $_codecmodules"
6481 elif test "$_libavcodec_so" = yes ; then
6482 _codecmodules="libavcodec.so $_codecmodules"
6483 else
6484 _nocodecmodules="libavcodec $_nocodecmodules"
6486 echores "$_libavcodec"
6488 echocheck "FFmpeg libavformat"
6489 if test "$_libavformat_a" = auto ; then
6490 _libavformat_a=no
6491 if test -d ffmpeg/libavformat && test -f ffmpeg/libavformat/utils.c ; then
6492 _libavformat_a=yes
6493 _res_comment="static"
6495 elif test "$_libavformat_so" = auto ; then
6496 _libavformat_so=no
6497 cat > $TMPC <<EOF
6498 #include <libavformat/avformat.h>
6499 #include <libavcodec/opt.h>
6500 int main(void) { av_alloc_format_context(); return 0; }
6502 if $_pkg_config --exists libavformat ; then
6503 _inc_libavformat=`$_pkg_config --cflags libavformat`
6504 _ld_tmp=`$_pkg_config --libs libavformat`
6505 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6506 && _libavformat_so=yes
6507 elif cc_check $_ld_lm -lavformat ; then
6508 _ld_extra="$_ld_extra -lavformat"
6509 _libavformat_so=yes
6510 _res_comment="using libavformat.so, but static libavformat is recommended"
6513 _libavformat=no
6514 _def_libavformat='#undef USE_LIBAVFORMAT'
6515 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6516 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6517 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6518 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6519 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6520 test "$_libavformat_so" = yes \
6521 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6522 echores "$_libavformat"
6524 echocheck "FFmpeg libpostproc"
6525 if test "$_libpostproc_a" = auto ; then
6526 _libpostproc_a=no
6527 if test -d ffmpeg/libpostproc && test -f ffmpeg/libpostproc/postprocess.h ; then
6528 _libpostproc_a='yes'
6529 _res_comment="static"
6531 elif test "$_libpostproc_so" = auto ; then
6532 _libpostproc_so=no
6533 cat > $TMPC << EOF
6534 #define USE_LIBPOSTPROC 1
6535 #include <inttypes.h>
6536 #include <libpostproc/postprocess.h>
6537 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6539 if cc_check -lpostproc $_ld_lm ; then
6540 _ld_extra="$_ld_extra -lpostproc"
6541 _libpostproc_so=yes
6542 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6545 _libpostproc=no
6546 _def_libpostproc='#undef USE_LIBPOSTPROC'
6547 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6548 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6549 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6550 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6551 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6552 test "$_libpostproc_so" = yes \
6553 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6554 echores "$_libpostproc"
6557 echocheck "libamr narrowband"
6558 if test "$_libamr_nb" = auto ; then
6559 _libamr_nb=no
6560 cat > $TMPC << EOF
6561 #include <amrnb/interf_dec.h>
6562 int main(void) { Speech_Decode_Frame_init(); return 0; }
6564 cc_check -lamrnb && _libamr_nb=yes
6565 if test "$_libavcodec_a" != yes ; then
6566 _libamr_nb=no
6567 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6570 if test "$_libamr_nb" = yes ; then
6571 _libamr=yes
6572 _ld_extra="$_ld_extra -lamrnb"
6573 _def_libamr='#define CONFIG_LIBAMR 1'
6574 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6575 _codecmodules="libamr_nb $_codecmodules"
6576 else
6577 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6578 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6579 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6580 _nocodecmodules="libamr_nb $_nocodecmodules"
6582 echores "$_libamr_nb"
6585 echocheck "libamr wideband"
6586 if test "$_libamr_wb" = auto ; then
6587 _libamr_wb=no
6588 cat > $TMPC << EOF
6589 #include <amrwb/dec_if.h>
6590 int main(void) { D_IF_init(); return 0; }
6592 cc_check -lamrwb && _libamr_wb=yes
6593 if test "$_libavcodec_a" != yes ; then
6594 _libamr_wb=no
6595 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6598 if test "$_libamr_wb" = yes ; then
6599 _libamr=yes
6600 _ld_extra="$_ld_extra -lamrwb"
6601 _def_libamr='#define CONFIG_LIBAMR 1'
6602 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6603 _codecmodules="libamr_wb $_codecmodules"
6604 else
6605 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6606 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6607 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6608 _nocodecmodules="libamr_wb $_nocodecmodules"
6610 echores "$_libamr_wb"
6612 echocheck "libdv-0.9.5+"
6613 if test "$_libdv" = auto ; then
6614 _libdv=no
6615 cat > $TMPC <<EOF
6616 #include <libdv/dv.h>
6617 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6619 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6621 if test "$_libdv" = yes ; then
6622 _def_libdv='#define HAVE_LIBDV095 1'
6623 _ld_extra="$_ld_extra -ldv"
6624 _codecmodules="libdv $_codecmodules"
6625 else
6626 _def_libdv='#undef HAVE_LIBDV095'
6627 _nocodecmodules="libdv $_nocodecmodules"
6629 echores "$_libdv"
6632 echocheck "XviD"
6633 if test "$_xvid" = auto ; then
6634 _xvid=no
6635 cat > $TMPC << EOF
6636 #include <xvid.h>
6637 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6639 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6640 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6641 done
6644 if test "$_xvid" = yes ; then
6645 _def_xvid='#define HAVE_XVID4 1'
6646 _codecmodules="xvid $_codecmodules"
6647 else
6648 _def_xvid='#undef HAVE_XVID4'
6649 _nocodecmodules="xvid $_nocodecmodules"
6650 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6652 echores "$_xvid"
6654 if test "$_xvid" = yes ; then
6655 echocheck "XviD two pass plugin"
6656 cat > $TMPC << EOF
6657 #include <xvid.h>
6658 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6660 if cc_check ; then
6661 _lavc_xvid=yes
6662 _def_lavc_xvid='#define CONFIG_LIBXVID 1'
6663 else
6664 _lavc_xvid=no
6665 _def_lavc_xvid='#undef CONFIG_LIBXVID'
6666 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6668 echores "$_lavc_xvid"
6672 echocheck "x264"
6673 if test "$_x264" = auto ; then
6674 cat > $TMPC << EOF
6675 #include <inttypes.h>
6676 #include <x264.h>
6677 #if X264_BUILD < 53
6678 #error We do not support old versions of x264. Get the latest from SVN.
6679 #endif
6680 int main(void) { x264_encoder_open((void*)0); return 0; }
6682 _x264=no
6683 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6684 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6685 done
6688 if test "$_x264" = yes ; then
6689 _def_x264='#define HAVE_X264 1'
6690 _codecmodules="x264 $_codecmodules"
6691 if echo $_libavencoders | grep -q X264 ; then
6692 _lavc_x264=yes
6693 _def_lavc_x264='#define CONFIG_LIBX264 1'
6694 _libs_mplayer="$_libs_mplayer $_ld_x264"
6695 else
6696 _lavc_x264=no
6697 _def_lavc_x264='#undef CONFIG_LIBX264'
6699 else
6700 _lavc_x264=no
6701 _def_x264='#undef HAVE_X264'
6702 _def_lavc_x264='#undef CONFIG_LIBX264'
6703 _nocodecmodules="x264 $_nocodecmodules"
6704 _libavencoders=`echo $_libavencoders | sed -e s/LIBX264_ENCODER// `
6706 echores "$_x264 (in libavcodec: $_lavc_x264)"
6709 echocheck "libnut"
6710 if test "$_libnut" = auto ; then
6711 cat > $TMPC << EOF
6712 #include <stdio.h>
6713 #include <stdlib.h>
6714 #include <inttypes.h>
6715 #include <libnut.h>
6716 int main(void) { (void)nut_error(0); return 0; }
6718 _libnut=no
6719 cc_check -lnut && _libnut=yes
6722 if test "$_libnut" = yes ; then
6723 _def_libnut='#define HAVE_LIBNUT 1'
6724 _ld_extra="$_ld_extra -lnut"
6725 else
6726 _def_libnut='#undef HAVE_LIBNUT'
6727 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6729 echores "$_libnut"
6731 #check must be done after libavcodec one
6732 echocheck "zr"
6733 if test "$_zr" = auto ; then
6734 #36067's seem to identify themselves as 36057PQC's, so the line
6735 #below should work for 36067's and 36057's.
6736 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6737 _zr=yes
6738 else
6739 _zr=no
6742 if test "$_zr" = yes ; then
6743 if test "$_libavcodec_a" = yes ; then
6744 _def_zr='#define HAVE_ZR 1'
6745 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6746 _vomodules="zr zr2 $_vomodules"
6747 else
6748 _res_comment="libavcodec (static) is required by zr, sorry"
6749 _novomodules="zr $_novomodules"
6750 _def_zr='#undef HAVE_ZR'
6752 else
6753 _def_zr='#undef HAVE_ZR'
6754 _novomodules="zr zr2 $_novomodules"
6756 echores "$_zr"
6758 # mencoder requires (optional) those libs: libmp3lame
6759 if test "$_mencoder" != no ; then
6761 echocheck "libmp3lame (for mencoder)"
6762 _mp3lame=no
6763 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6764 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6765 cat > $TMPC <<EOF
6766 #include <lame/lame.h>
6767 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; }
6769 # Note: libmp3lame usually depends on vorbis
6770 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6771 if test "$_mp3lame" = yes ; then
6772 _def_mp3lame="#define HAVE_MP3LAME"
6773 _ld_mp3lame=-lmp3lame
6774 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6775 cat > $TMPC << EOF
6776 #include <lame/lame.h>
6777 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6779 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6780 cat > $TMPC << EOF
6781 #include <lame/lame.h>
6782 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6784 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6785 if echo $_libavencoders | grep -q MP3LAME ; then
6786 _lavc_mp3lame=yes
6787 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6788 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6789 else
6790 _lavc_mp3lame=no
6791 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6793 else
6794 _def_mp3lame='#undef HAVE_MP3LAME'
6795 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6797 echores "$_mp3lame"
6801 echocheck "mencoder"
6802 _mencoder_flag='#undef HAVE_MENCODER'
6803 if test "$_mencoder" = yes ; then
6804 _mencoder_flag='#define HAVE_MENCODER'
6805 _def_muxers='#define CONFIG_MUXERS 1'
6806 else
6807 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6808 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6809 _libavmuxers=""
6811 echores "$_mencoder"
6813 echocheck "fastmemcpy"
6814 # fastmemcpy check is done earlier with tests of CPU & binutils features
6815 if test "$_fastmemcpy" = yes ; then
6816 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6817 else
6818 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6820 echores "$_fastmemcpy"
6823 echocheck "UnRAR executable"
6824 if test "$_unrar_exec" = auto ; then
6825 _unrar_exec="yes"
6826 mingw32 && _unrar_exec="no"
6828 if test "$_unrar_exec" = yes ; then
6829 _def_unrar_exec='#define USE_UNRAR_EXEC 1'
6830 else
6831 _def_unrar_exec='#undef USE_UNRAR_EXEC'
6833 echores "$_unrar_exec"
6835 echocheck "TV interface"
6836 if test "$_tv" = yes ; then
6837 _def_tv='#define USE_TV 1'
6838 _inputmodules="tv $_inputmodules"
6839 else
6840 _noinputmodules="tv $_noinputmodules"
6841 _def_tv='#undef USE_TV'
6843 echores "$_tv"
6846 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
6847 echocheck "*BSD BT848 bt8xx header"
6848 _ioctl_bt848_h=no
6849 for file in "machine/ioctl_bt848.h" \
6850 "dev/bktr/ioctl_bt848.h" \
6851 "dev/video/bktr/ioctl_bt848.h" \
6852 "dev/ic/bt8xx.h" ; do
6853 cat > $TMPC <<EOF
6854 #include <sys/types.h>
6855 #include <sys/ioctl.h>
6856 #include <$file>
6857 int main(void) {
6858 ioctl(0, TVTUNER_GETFREQ, 0);
6859 return 0;
6862 if cc_check ; then
6863 _ioctl_bt848_h=yes
6864 _ioctl_bt848_h_name="$file"
6865 break;
6867 done
6868 if test "$_ioctl_bt848_h" = yes ; then
6869 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6870 _res_comment="using $_ioctl_bt848_h_name"
6871 else
6872 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6874 echores "$_ioctl_bt848_h"
6876 echocheck "*BSD ioctl_meteor.h"
6877 _ioctl_meteor_h=no
6878 for file in "machine/ioctl_meteor.h" \
6879 "dev/bktr/ioctl_meteor.h" \
6880 "dev/video/bktr/ioctl_meteor.h" ; do
6881 cat > $TMPC <<EOF
6882 #include <sys/types.h>
6883 #include <$file>
6884 int main(void) {
6885 ioctl(0, METEORSINPUT, 0);
6886 return 0;
6889 if cc_check ; then
6890 _ioctl_meteor_h=yes
6891 _ioctl_meteor_h_name="$file"
6892 break;
6894 done
6895 if test "$_ioctl_meteor_h" = yes ; then
6896 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6897 _res_comment="using $_ioctl_meteor_h_name"
6898 else
6899 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6901 echores "$_ioctl_meteor_h"
6903 echocheck "*BSD BrookTree 848 TV interface"
6904 if test "$_tv_bsdbt848" = auto ; then
6905 _tv_bsdbt848=no
6906 if test "$_tv" = yes ; then
6907 cat > $TMPC <<EOF
6908 #include <sys/types.h>
6909 $_def_ioctl_meteor_h_name
6910 $_def_ioctl_bt848_h_name
6911 #ifdef IOCTL_METEOR_H_NAME
6912 #include IOCTL_METEOR_H_NAME
6913 #endif
6914 #ifdef IOCTL_BT848_H_NAME
6915 #include IOCTL_BT848_H_NAME
6916 #endif
6917 int main(void){
6918 ioctl(0, METEORSINPUT, 0);
6919 ioctl(0, TVTUNER_GETFREQ, 0);
6920 return 0;
6923 cc_check && _tv_bsdbt848=yes
6926 if test "$_tv_bsdbt848" = yes ; then
6927 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6928 _inputmodules="tv-bsdbt848 $_inputmodules"
6929 else
6930 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6931 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6933 echores "$_tv_bsdbt848"
6934 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
6937 echocheck "DirectShow TV interface"
6938 if test "$_tv_dshow" = auto ; then
6939 _tv_dshow=no
6940 if test "$_tv" = yes && win32 ; then
6941 cat > $TMPC <<EOF
6942 #include <ole2.h>
6943 int main(void) {
6944 void* p;
6945 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
6946 return 0;
6949 cc_check -lole32 -luuid && _tv_dshow=yes
6952 if test "$_tv_dshow" = yes ; then
6953 _inputmodules="tv-dshow $_inputmodules"
6954 _def_tv_dshow='#define HAVE_TV_DSHOW 1'
6955 _ld_extra="$_ld_extra -lole32 -luuid"
6956 else
6957 _noinputmodules="tv-dshow $_noinputmodules"
6958 _def_tv_dshow='#undef HAVE_TV_DSHOW'
6960 echores "$_tv_dshow"
6963 echocheck "Video 4 Linux TV interface"
6964 if test "$_tv_v4l1" = auto ; then
6965 _tv_v4l1=no
6966 if test "$_tv" = yes && linux ; then
6967 cat > $TMPC <<EOF
6968 #include <stdlib.h>
6969 #include <linux/videodev.h>
6970 int main(void) { return 0; }
6972 cc_check && _tv_v4l1=yes
6975 if test "$_tv_v4l1" = yes ; then
6976 _audio_input=yes
6977 _tv_v4l=yes
6978 _def_tv_v4l='#define HAVE_TV_V4L 1'
6979 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6980 _inputmodules="tv-v4l $_inputmodules"
6981 else
6982 _noinputmodules="tv-v4l1 $_noinputmodules"
6983 _def_tv_v4l='#undef HAVE_TV_V4L'
6985 echores "$_tv_v4l1"
6988 echocheck "Video 4 Linux 2 TV interface"
6989 if test "$_tv_v4l2" = auto ; then
6990 _tv_v4l2=no
6991 if test "$_tv" = yes && linux ; then
6992 cat > $TMPC <<EOF
6993 #include <stdlib.h>
6994 #include <linux/types.h>
6995 #include <linux/videodev2.h>
6996 int main(void) { return 0; }
6998 cc_check && _tv_v4l2=yes
7001 if test "$_tv_v4l2" = yes ; then
7002 _audio_input=yes
7003 _tv_v4l=yes
7004 _def_tv_v4l='#define HAVE_TV_V4L 1'
7005 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
7006 _inputmodules="tv-v4l2 $_inputmodules"
7007 else
7008 _noinputmodules="tv-v4l2 $_noinputmodules"
7009 _def_tv_v4l2='#undef HAVE_TV_V4L2'
7011 echores "$_tv_v4l2"
7014 echocheck "TV teletext interface"
7015 if test "$_tv_teletext" = auto ; then
7016 _tv_teletext=no
7017 if test "$_freetype" = yes && test "$_pthreads" = yes; then
7018 if test "$_tv_v4l2" = yes || test "$_v4l" = yes || test "$_tv_dshow" = yes; then
7019 _tv_teletext=yes
7023 if test "$_tv_teletext" = yes ; then
7024 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
7025 _inputmodules="tv-teletext $_inputmodules"
7026 else
7027 _noinputmodules="tv-teletext $_noinputmodules"
7028 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
7030 echores "$_tv_teletext"
7033 echocheck "Radio interface"
7034 if test "$_radio" = yes ; then
7035 _def_radio='#define USE_RADIO 1'
7036 _inputmodules="radio $_inputmodules"
7037 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7038 _radio_capture=no
7040 if test "$_radio_capture" = yes ; then
7041 _audio_input=yes
7042 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
7043 else
7044 _def_radio_capture="#undef USE_RADIO_CAPTURE"
7046 else
7047 _noinputmodules="radio $_noinputmodules"
7048 _def_radio='#undef USE_RADIO'
7049 _def_radio_capture="#undef USE_RADIO_CAPTURE"
7050 _radio_capture=no
7052 echores "$_radio"
7053 echocheck "Capture for Radio interface"
7054 echores "$_radio_capture"
7056 echocheck "Video 4 Linux 2 Radio interface"
7057 if test "$_radio_v4l2" = auto ; then
7058 _radio_v4l2=no
7059 if test "$_radio" = yes && linux ; then
7060 cat > $TMPC <<EOF
7061 #include <stdlib.h>
7062 #include <linux/types.h>
7063 #include <linux/videodev2.h>
7064 int main(void) { return 0; }
7066 cc_check && _radio_v4l2=yes
7069 if test "$_radio_v4l2" = yes ; then
7070 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
7071 else
7072 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
7074 echores "$_radio_v4l2"
7076 echocheck "Video 4 Linux Radio interface"
7077 if test "$_radio_v4l" = auto ; then
7078 _radio_v4l=no
7079 if test "$_radio" = yes && linux ; then
7080 cat > $TMPC <<EOF
7081 #include <stdlib.h>
7082 #include <linux/videodev.h>
7083 int main(void) { return 0; }
7085 cc_check && _radio_v4l=yes
7088 if test "$_radio_v4l" = yes ; then
7089 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
7090 else
7091 _def_radio_v4l='#undef HAVE_RADIO_V4L'
7093 echores "$_radio_v4l"
7095 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7096 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7097 echocheck "*BSD BrookTree 848 Radio interface"
7098 _radio_bsdbt848=no
7099 cat > $TMPC <<EOF
7100 #include <sys/types.h>
7101 $_def_ioctl_bt848_h_name
7102 #ifdef IOCTL_BT848_H_NAME
7103 #include IOCTL_BT848_H_NAME
7104 #endif
7105 int main(void){
7106 ioctl(0, RADIO_GETFREQ, 0);
7107 return 0;
7110 cc_check && _radio_bsdbt848=yes
7111 echores "$_radio_bsdbt848"
7112 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7114 if test "$_radio_bsdbt848" = yes ; then
7115 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
7116 else
7117 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
7120 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7121 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7122 die "Radio driver requires BSD BT848, V4L or V4L2!"
7125 echocheck "Video 4 Linux 2 MPEG PVR interface"
7126 if test "$_pvr" = auto ; then
7127 _pvr=no
7128 if test "$_tv_v4l2" = yes && linux ; then
7129 cat > $TMPC <<EOF
7130 #include <stdlib.h>
7131 #include <inttypes.h>
7132 #include <linux/types.h>
7133 #include <linux/videodev2.h>
7134 int main(void) { struct v4l2_ext_controls ext; return 0; }
7136 cc_check && _pvr=yes
7139 if test "$_pvr" = yes ; then
7140 _def_pvr='#define HAVE_PVR 1'
7141 _inputmodules="pvr $_inputmodules"
7142 else
7143 _noinputmodules="pvr $_noinputmodules"
7144 _def_pvr='#undef HAVE_PVR'
7146 echores "$_pvr"
7149 echocheck "audio select()"
7150 if test "$_select" = no ; then
7151 _def_select='#undef HAVE_AUDIO_SELECT'
7152 elif test "$_select" = yes ; then
7153 _def_select='#define HAVE_AUDIO_SELECT 1'
7155 echores "$_select"
7158 echocheck "ftp"
7159 if ! beos && test "$_ftp" = yes ; then
7160 _def_ftp='#define HAVE_FTP 1'
7161 _inputmodules="ftp $_inputmodules"
7162 else
7163 _noinputmodules="ftp $_noinputmodules"
7164 _def_ftp='#undef HAVE_FTP'
7166 echores "$_ftp"
7168 echocheck "vstream client"
7169 if test "$_vstream" = auto ; then
7170 _vstream=no
7171 cat > $TMPC <<EOF
7172 #include <vstream-client.h>
7173 void vstream_error(const char *format, ... ) {}
7174 int main(void) { vstream_start(); return 0; }
7176 cc_check -lvstream-client && _vstream=yes
7178 if test "$_vstream" = yes ; then
7179 _def_vstream='#define HAVE_VSTREAM 1'
7180 _inputmodules="vstream $_inputmodules"
7181 _ld_extra="$_ld_extra -lvstream-client"
7182 else
7183 _noinputmodules="vstream $_noinputmodules"
7184 _def_vstream='#undef HAVE_VSTREAM'
7186 echores "$_vstream"
7188 # endian testing
7189 echocheck "byte order"
7190 if test "$_big_endian" = auto ; then
7191 cat > $TMPC <<EOF
7192 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7193 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7194 int main(void){
7195 return (int)ascii_name;
7198 if cc_check ; then
7199 if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
7200 _big_endian=yes
7201 else
7202 _big_endian=no
7204 else
7205 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7208 if test "$_big_endian" = yes ; then
7209 _byte_order='big-endian'
7210 _def_words_endian='#define WORDS_BIGENDIAN 1'
7211 else
7212 _byte_order='little-endian'
7213 _def_words_endian='#undef WORDS_BIGENDIAN'
7215 echores "$_byte_order"
7217 echocheck "OSD menu"
7218 if test "$_menu" = yes ; then
7219 _def_menu='#define HAVE_MENU 1'
7220 test $_dvbin = "yes" && _menu_dvbin=yes
7221 else
7222 _def_menu='#undef HAVE_MENU'
7223 _menu_dvbin=no
7225 echores "$_menu"
7228 echocheck "Subtitles sorting"
7229 if test "$_sortsub" = yes ; then
7230 _def_sortsub='#define USE_SORTSUB 1'
7231 else
7232 _def_sortsub='#undef USE_SORTSUB'
7234 echores "$_sortsub"
7237 echocheck "XMMS inputplugin support"
7238 if test "$_xmms" = yes ; then
7239 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7240 _xmmsplugindir=`xmms-config --input-plugin-dir`
7241 _xmmslibdir=`xmms-config --exec-prefix`/lib
7242 else
7243 _xmmsplugindir=/usr/lib/xmms/Input
7244 _xmmslibdir=/usr/lib
7247 _def_xmms='#define HAVE_XMMS 1'
7248 if darwin ; then
7249 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7250 else
7251 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7253 else
7254 _def_xmms='#undef HAVE_XMMS'
7256 echores "$_xmms"
7258 echocheck "inet6"
7259 if test "$_inet6" = auto ; then
7260 cat > $TMPC << EOF
7261 #include <sys/types.h>
7262 #if !defined(_WIN32) || defined(__CYGWIN__)
7263 #include <sys/socket.h>
7264 #include <netinet/in.h>
7265 #else
7266 #include <ws2tcpip.h>
7267 #endif
7268 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7270 _inet6=no
7271 if cc_check $_ld_sock ; then
7272 _inet6=yes
7275 if test "$_inet6" = yes ; then
7276 _def_inet6='#define HAVE_AF_INET6 1'
7277 else
7278 _def_inet6='#undef HAVE_AF_INET6'
7280 echores "$_inet6"
7283 echocheck "gethostbyname2"
7284 if test "$_gethostbyname2" = auto ; then
7285 cat > $TMPC << EOF
7286 #include <sys/types.h>
7287 #include <sys/socket.h>
7288 #include <netdb.h>
7289 int main(void) { gethostbyname2("", AF_INET); }
7291 _gethostbyname2=no
7292 if cc_check ; then
7293 _gethostbyname2=yes
7297 if test "$_gethostbyname2" = yes ; then
7298 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7299 else
7300 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7302 echores "$_gethostbyname2"
7305 # --------------- GUI specific tests begin -------------------
7306 echocheck "GUI"
7307 echo "$_gui"
7308 if test "$_gui" = yes ; then
7310 # Required libraries
7311 if test "$_libavcodec" != yes ||
7312 ! echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1 ; then
7313 die "The GUI requires libavcodec with PNG support (needs zlib)."
7315 test "$_freetype" = no && test "$_bitmap_font" = no && \
7316 die "The GUI requires either FreeType or bitmap font support."
7317 if ! win32 ; then
7318 _gui_gtk=yes
7319 test "$_x11" != yes && die "X11 support required for GUI compilation."
7321 echocheck "XShape extension"
7322 if test "$_xshape" = auto ; then
7323 _xshape=no
7324 cat > $TMPC << EOF
7325 #include <X11/Xlib.h>
7326 #include <X11/Xproto.h>
7327 #include <X11/Xutil.h>
7328 #include <X11/extensions/shape.h>
7329 #include <stdlib.h>
7330 int main(void) {
7331 char *name = ":0.0";
7332 Display *wsDisplay;
7333 int exitvar = 0;
7334 int eventbase, errorbase;
7335 if (getenv("DISPLAY"))
7336 name=getenv("DISPLAY");
7337 wsDisplay=XOpenDisplay(name);
7338 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7339 exitvar=1;
7340 XCloseDisplay(wsDisplay);
7341 return exitvar;
7344 cc_check -lXext && _xshape=yes
7346 if test "$_xshape" = yes ; then
7347 _def_xshape='#define HAVE_XSHAPE 1'
7348 else
7349 die "The GUI requires the X11 extension XShape (which was not found)."
7351 echores "$_xshape"
7353 #Check for GTK
7354 if test "$_gtk1" = no ; then
7355 #Check for GTK2 :
7356 echocheck "GTK+ version"
7358 if $_pkg_config gtk+-2.0 --exists ; then
7359 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7360 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7361 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7362 echores "$_gtk"
7364 # Check for GLIB2
7365 if $_pkg_config glib-2.0 --exists ; then
7366 echocheck "glib version"
7367 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7368 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7369 echores "$_glib"
7371 _def_gui='#define HAVE_NEW_GUI 1'
7372 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7373 else
7374 _gtk1=yes
7375 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7377 else
7378 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7379 _gtk1=yes
7383 if test "$_gtk1" = yes ; then
7384 # Check for old GTK (1.2.x)
7385 echocheck "GTK version"
7386 if test -z "$_gtkconfig" ; then
7387 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7388 _gtkconfig="gtk-config"
7389 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7390 _gtkconfig="gtk12-config"
7391 else
7392 die "The GUI requires GTK devel packages (which were not found)."
7395 _gtk=`$_gtkconfig --version 2>&1`
7396 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7397 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7398 echores "$_gtk (using $_gtkconfig)"
7400 # Check for GLIB
7401 echocheck "glib version"
7402 if test -z "$_glibconfig" ; then
7403 if ( glib-config --version ) >/dev/null 2>&1 ; then
7404 _glibconfig="glib-config"
7405 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7406 _glibconfig="glib12-config"
7407 else
7408 die "The GUI requires GLIB devel packages (which were not found)"
7411 _glib=`$_glibconfig --version 2>&1`
7412 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7413 echores "$_glib (using $_glibconfig)"
7415 _def_gui='#define HAVE_NEW_GUI 1'
7416 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7419 else #if ! win32
7420 _gui_win32=yes
7421 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7422 _def_gui='#define HAVE_NEW_GUI 1'
7423 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7424 fi #if ! win32
7426 else #if test "$_gui"
7427 _def_gui='#undef HAVE_NEW_GUI'
7428 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7429 fi #if test "$_gui"
7430 # --------------- GUI specific tests end -------------------
7433 if test "$_charset" = "noconv" ; then
7434 _charset=""
7436 if test "$_charset" ; then
7437 _def_charset="#define MSG_CHARSET \"$_charset\""
7438 else
7439 _def_charset="#undef MSG_CHARSET"
7442 if test "$_charset" = "UTF-8" ; then
7443 # hack to disable conversion in the Makefile
7444 _charset=""
7447 if test "$_charset" ; then
7448 echocheck "iconv program"
7449 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7450 if test "$?" -ne 0 ; then
7451 echores "no"
7452 echo "No working iconv program found, use "
7453 echo "--charset=UTF-8 to continue anyway."
7454 echo "If you also have problems with iconv library functions use --charset=noconv."
7455 echo "Messages in the GTK-2 interface will be broken then."
7456 exit 1
7457 else
7458 echores "yes"
7462 #############################################################################
7464 echocheck "automatic gdb attach"
7465 if test "$_crash_debug" = yes ; then
7466 _def_crash_debug='#define CRASH_DEBUG 1'
7467 else
7468 _def_crash_debug='#undef CRASH_DEBUG'
7469 _crash_debug=no
7471 echores "$_crash_debug"
7473 echocheck "compiler support for noexecstack"
7474 cat > $TMPC <<EOF
7475 int main(void) { return 0; }
7477 if cc_check -Wl,-z,noexecstack ; then
7478 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7479 echores "yes"
7480 else
7481 echores "no"
7485 # Dynamic linking flags
7486 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7487 _ld_dl_dynamic=''
7488 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
7489 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 ; then
7490 _ld_dl_dynamic='-rdynamic'
7493 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7494 bsdos && _ld_extra="$_ld_extra -ldvd"
7495 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7496 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7498 _def_debug='#undef MP_DEBUG'
7499 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7502 echocheck "joystick"
7503 _def_joystick='#undef HAVE_JOYSTICK'
7504 if test "$_joystick" = yes ; then
7505 if linux ; then
7506 # TODO add some check
7507 _def_joystick='#define HAVE_JOYSTICK 1'
7508 else
7509 _joystick="no"
7510 _res_comment="unsupported under $system_name"
7513 echores "$_joystick"
7515 echocheck "lirc"
7516 if test "$_lirc" = auto ; then
7517 _lirc=no
7518 cat > $TMPC <<EOF
7519 #include <lirc/lirc_client.h>
7520 int main(void) { return 0; }
7522 cc_check -llirc_client && _lirc=yes
7524 if test "$_lirc" = yes ; then
7525 _def_lirc='#define HAVE_LIRC 1'
7526 _ld_extra="$_ld_extra -llirc_client"
7527 else
7528 _def_lirc='#undef HAVE_LIRC'
7530 echores "$_lirc"
7532 echocheck "lircc"
7533 if test "$_lircc" = auto ; then
7534 _lircc=no
7535 cat > $TMPC <<EOF
7536 #include <lirc/lircc.h>
7537 int main(void) { return 0; }
7539 cc_check -llircc && _lircc=yes
7541 if test "$_lircc" = yes ; then
7542 _def_lircc='#define HAVE_LIRCC 1'
7543 _ld_extra="$_ld_extra -llircc"
7544 else
7545 _def_lircc='#undef HAVE_LIRCC'
7547 echores "$_lircc"
7549 if arm; then
7550 # Detect maemo development platform libraries availability (http://www.maemo.org),
7551 # they are used when run on Nokia 770
7552 echocheck "maemo (Nokia 770)"
7553 if test "$_maemo" = auto ; then
7554 _maemo=no
7555 cat > $TMPC << EOF
7556 #include <libosso.h>
7557 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7559 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7561 if test "$_maemo" = yes ; then
7562 _def_maemo='#define HAVE_MAEMO 1'
7563 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7564 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7565 else
7566 _def_maemo='#undef HAVE_MAEMO'
7568 echores "$_maemo"
7571 # linker paths should be the same for mencoder and mplayer
7572 _ld_tmp=""
7573 for I in $_libs_mplayer ; do
7574 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7575 if test -z "$_tmp" ; then
7576 _ld_extra="$I $_ld_extra"
7577 else
7578 _ld_tmp="$_ld_tmp $I"
7580 done
7581 _libs_mplayer=$_ld_tmp
7584 #############################################################################
7585 if darwin ; then
7586 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
7587 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7588 CFLAGS="$CFLAGS -no-cpp-precomp"
7591 if amigaos ; then
7592 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__"
7594 if hpux ; then
7595 # use flag for HPUX missing setenv()
7596 CFLAGS="$CFLAGS -DHPUX"
7598 # Thread support
7599 if linux ; then
7600 CFLAGS="$CFLAGS -D_REENTRANT"
7601 elif freebsd || netbsd || openbsd || bsdos ; then
7602 # FIXME bsd needs this so maybe other OS'es
7603 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7605 if cygwin ; then
7606 CFLAGS="$CFLAGS -D__CYGWIN__"
7608 if os2 ; then
7609 CFLAGS="$CFLAGS -Zomf"
7610 ASFLAGS="$ASFLAGS -Zomf"
7612 # 64 bit file offsets?
7613 if test "$_largefiles" = yes || freebsd ; then
7614 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7615 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7616 # dvdread support requires this (for off64_t)
7617 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7618 cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
7619 beos && CFLAGS="$CFLAGS -DSYS_BEOS"
7620 os2 && CFLAGS="$CFLAGS -DSYS_OS2"
7624 # Make sure config.h gets included.
7625 if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then
7626 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
7629 cat > $TMPC << EOF
7630 int main(void) { return 0; }
7632 if test "$cc_vendor" = "gnu" ; then
7633 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7634 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7637 CFLAGS_FFMPEG="-I../.. $CFLAGS"
7638 CFLAGS="-I. -I../ffmpeg -I.. -I../ffmpeg/libavutil $CFLAGS"
7639 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7641 cc_check -mno-omit-leaf-frame-pointer && CFLAG_NO_OMIT_LEAF_FRAME_POINTER="-mno-omit-leaf-frame-pointer"
7643 #this must be the last test to be performed or the ones following it will likely fail
7644 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7645 # to use its own copy of the library)
7646 echocheck "DVD support (libdvdnav)"
7647 if test "$_dvdnav" = auto ; then
7648 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7650 if test "$_dvdnav" = auto ; then
7651 cat > $TMPC <<EOF
7652 #include <inttypes.h>
7653 #include <dvdnav/dvdnav.h>
7654 int main(void) { dvdnav_t *dvd=0; return 0; }
7656 _dvdnav=no
7657 _dvdnavdir=`$_dvdnavconfig --cflags`
7658 _dvdnavlibs=`$_dvdnavconfig --libs`
7659 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7661 if test "$_dvdnav" = yes ; then
7662 _largefiles=yes
7663 _def_dvdnav='#define USE_DVDNAV 1'
7664 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7665 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7666 _inputmodules="dvdnav $_inputmodules"
7667 else
7668 _def_dvdnav='#undef USE_DVDNAV'
7669 _noinputmodules="dvdnav $_noinputmodules"
7671 echores "$_dvdnav"
7673 #############################################################################
7674 echo "Creating config.mak"
7675 cat > config.mak << EOF
7676 # -------- Generated by configure -----------
7678 LANG = C
7679 MAN_LANG = $MAN_LANG
7680 TARGET_OS = $system_name
7681 DESTDIR =
7682 prefix = \$(DESTDIR)$_prefix
7683 BINDIR = \$(DESTDIR)$_bindir
7684 DATADIR = \$(DESTDIR)$_datadir
7685 MANDIR = \$(DESTDIR)$_mandir
7686 CONFDIR = \$(DESTDIR)$_confdir
7687 LIBDIR = \$(DESTDIR)$_libdir
7688 # FFmpeg uses libdir instead of LIBDIR
7689 libdir = \$(LIBDIR)
7690 AR = $_ar
7691 CC = $_cc
7692 CXX = $_cc
7693 HOST_CC = $_host_cc
7694 RANLIB = $_ranlib
7695 WINDRES = $_windres
7696 INSTALL = $_install
7697 EXTRA_INC = $_inc_extra
7698 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7699 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7700 FFMPEG_OFLAGS = $CFLAGS_FFMPEG \$(EXTRA_INC)
7701 CFLAG_NO_OMIT_LEAF_FRAME_POINTER = $CFLAG_NO_OMIT_LEAF_FRAME_POINTER
7702 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7703 CFLAG_STACKREALIGN = $_stackrealign
7704 ASFLAGS = $ASFLAGS
7705 INSTALLSTRIP = $_install_strip
7706 CHARSET = $_charset
7707 HELP_FILE = $_mp_help
7709 EXESUF = $_exesuf
7711 MPLAYER_NETWORK = $_network
7712 FTP = $_ftp
7713 STREAMING_LIVE555 = $_live
7714 LIBNEMESI = $_nemesi
7715 NATIVE_RTSP = $_native_rtsp
7716 VSTREAM = $_vstream
7717 STREAM_CACHE = $_stream_cache
7718 DVBIN = $_dvbin
7719 VIDIX = $_vidix
7720 VIDIX_INTERNAL = $_vidix_internal
7721 VIDIX_EXTERNAL = $_vidix_external
7722 VIDIX_PCIDB = $_vidix_pcidb_val
7723 CONFIG_POSTPROC = yes
7724 MP3LAME = $_mp3lame
7725 LIBMENU = $_menu
7726 LIBMENU_DVBIN = $_menu_dvbin
7728 MP3LIB = $_mp3lib
7729 LIBA52 = $_liba52
7730 LIBMPEG2 = $_libmpeg2
7731 TREMOR_INTERNAL = $_tremor_internal
7732 TREMOR_LOW = $_tremor_low
7733 FAAD = $_faad
7735 SPEEX = $_speex
7736 MUSEPACK = $_musepack
7738 UNRAR_EXEC = $_unrar_exec
7739 PNG = $_png
7740 JPEG = $_jpeg
7741 GIF = $_gif
7743 EXTRALIBS = $_extra_libs
7744 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7745 EXTRALIBS_MPLAYER = $_libs_mplayer
7746 EXTRALIBS_MENCODER = $_libs_mencoder
7748 HAVE_SYS_MMAN_H = $_mman
7749 HAVE_POSIX_SELECT = $_posix_select
7751 NEED_GETTIMEOFDAY = $_need_gettimeofday
7752 NEED_GLOB = $_need_glob
7753 NEED_MMAP = $_need_mmap
7754 NEED_SETENV = $_need_setenv
7755 NEED_SHMEM = $_need_shmem
7756 NEED_STRSEP = $_need_strsep
7757 NEED_SWAB = $_need_swab
7758 NEED_VSSCANF = $_need_vsscanf
7760 GETCH = $_getch
7761 TIMER = $_timer
7763 PE_EXECUTABLE = $_pe_executable
7765 # audio output
7766 OSS = $_ossaudio
7767 ALSA = $_alsa
7768 ALSA5 = $_alsa5
7769 ALSA9 = $_alsa9
7770 ALSA1X = $_alsa1x
7772 LADSPA = $_ladspa
7774 # input/demuxer/codecs
7775 JOYSTICK = $_joystick
7776 LIRC = $_lirc
7777 APPLE_REMOTE = $_apple_remote
7778 TV = $_tv
7779 TV_V4L = $_tv_v4l
7780 TV_V4L1 = $_tv_v4l1
7781 TV_V4L2 = $_tv_v4l2
7782 TV_DSHOW = $_tv_dshow
7783 TV_BSDBT848 = $_tv_bsdbt848
7784 TV_TELETEXT = $_tv_teletext
7785 AUDIO_INPUT = $_audio_input
7786 PVR = $_pvr
7787 VCD = $_vcd
7788 DVDREAD = $_dvdread
7789 DVDREAD_INTERNAL = $_dvdread_internal
7790 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7791 DVDNAV = $_dvdnav
7792 WIN32DLL = $_win32dll
7793 WIN32_EMULATION = $_win32_emulation
7794 QTX_CODECS = $_qtx
7795 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7796 QTX_EMULATION = $_qtx_emulation
7797 REAL_CODECS = $_real
7798 XANIM_CODECS = $_xanim
7799 ZORAN = $_zr
7800 LIBLZO = $_liblzo
7801 LIBDV = $_libdv
7802 XVID4 = $_xvid
7803 X264 = $_x264
7804 LIBNUT = $_libnut
7805 LIBDCA = $_libdca
7806 MPLAYER = $_mplayer
7807 MENCODER = $_mencoder
7808 CDDA = $_cdda
7809 CDDB = $_cddb
7810 BITMAP_FONT = $_bitmap_font
7811 FREETYPE = $_freetype
7812 LIBASS = $_ass
7813 LIBMAD = $_mad
7814 LIBVORBIS = $_vorbis
7815 LIBTHEORA = $_theora
7816 FAAD_INTERNAL = $_faad_internal
7817 LIBSMBCLIENT = $_smbsupport
7818 XMMS_PLUGINS = $_xmms
7819 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7820 MACOSX_BUNDLE = $_macosx_bundle
7821 COREAUDIO = $_coreaudio
7822 COREVIDEO = $_corevideo
7823 QUARTZ = $_quartz
7824 TOOLAME=$_toolame
7825 TWOLAME=$_twolame
7826 FAAC=$_faac
7827 RADIO=$_radio
7828 RADIO_CAPTURE=$_radio_capture
7829 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7830 VIDIX_IVTV=$_vidix_drv_ivtv
7831 VIDIX_MACH64=$_vidix_drv_mach64
7832 VIDIX_MGA=$_vidix_drv_mga
7833 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7834 VIDIX_NVIDIA=$_vidix_drv_nvidia
7835 VIDIX_PM2=$_vidix_drv_pm2
7836 VIDIX_PM3=$_vidix_drv_pm3
7837 VIDIX_RADEON=$_vidix_drv_radeon
7838 VIDIX_RAGE128=$_vidix_drv_rage128
7839 VIDIX_S3=$_vidix_drv_s3
7840 VIDIX_SIS=$_vidix_drv_sis
7841 VIDIX_UNICHROME=$_vidix_drv_unichrome
7843 # --- Some stuff for autoconfigure ----
7844 $_target_arch
7845 $_target_arch_x86
7846 TARGET_CPU=$iproc
7847 `echo $_cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/'`
7849 # --- GUI stuff ---
7850 GUI_GTK = $_gui_gtk
7851 GUI_WIN32 = $_gui_win32
7853 # --- libvo stuff ---
7854 VO_SRCS = $_vosrc
7856 # --- libao2 stuff ---
7857 AO_SRCS = $_aosrc
7859 # FFmpeg
7860 LIBAVUTIL = $_libavutil
7861 LIBAVUTIL_A = $_libavutil_a
7862 LIBAVUTIL_SO = $_libavutil_so
7863 LIBAVCODEC = $_libavcodec
7864 LIBAVCODEC_A = $_libavcodec_a
7865 LIBAVCODEC_SO = $_libavcodec_so
7866 LIBAVFORMAT = $_libavformat
7867 LIBAVFORMAT_A = $_libavformat_a
7868 LIBAVFORMAT_SO = $_libavformat_so
7869 LIBPOSTPROC = $_libpostproc
7870 LIBPOSTPROC_A = $_libpostproc_a
7871 LIBPOSTPROC_SO = $_libpostproc_so
7873 BUILD_STATIC=yes
7874 SRC_PATH=..
7875 BUILD_ROOT=..
7876 LIBPREF=lib
7877 LIBSUF=.a
7878 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7880 CONFIG_ENCODERS=yes
7881 CONFIG_GPL=yes
7882 CONFIG_MUXERS=$_mencoder
7883 CONFIG_LIBAMR=$_libamr
7884 CONFIG_LIBAMR_NB=$_libamr_nb
7885 CONFIG_LIBAMR_WB=$_libamr_wb
7886 CONFIG_LIBFAAC=$_lavc_faac
7887 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7888 CONFIG_LIBVORBIS=$_libvorbis
7889 CONFIG_LIBX264=$_lavc_x264
7890 CONFIG_LIBXVID=$_lavc_xvid
7891 CONFIG_MLIB = $_mlib
7892 # Prevent building libavcodec/imgresample.c with conflicting symbols
7893 CONFIG_SWSCALE=yes
7894 CONFIG_ZLIB=$_zlib
7896 HAVE_PTHREADS = $_pthreads
7897 HAVE_W32THREADS = $_w32threads
7898 HAVE_XVMC = $_xvmc
7900 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7901 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7902 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7903 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7904 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7905 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7907 DEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,\$^) | sed "s,[0-9a-z._-]*: \(\$(SRC_DIR)/\)*\([a-z0-9]*/\)[^/]* ,\\2&,"
7909 MPDEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,$^) | sed "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&,"
7910 MPDEPEND_CMD_CXX = \$(CC) -MM \$(CXXFLAGS) \$(filter-out %.h,$^) | sed "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&,"
7914 #############################################################################
7916 ff_config_enable () {
7917 _nprefix=$3;
7918 test -z "$_nprefix" && _nprefix='CONFIG'
7919 for part in $1; do
7920 if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
7921 echo "#define ${_nprefix}_$part 1"
7922 echo "#define ENABLE_$part 1"
7923 else
7924 echo "#define ENABLE_$part 0"
7926 done
7929 echo "Creating config.h"
7930 cat > $TMPH << EOF
7931 /* -------- This file has been automatically generated by configure ---------
7932 Note: Any changes in it will be lost when you run configure again. */
7934 /* Protect against multiple inclusion */
7935 #ifndef MPLAYER_CONFIG_H
7936 #define MPLAYER_CONFIG_H
7938 #define CONFIGURATION "$_configuration"
7940 /* make sure we never get lavformat's poll() emulation, the results are
7941 horrible if the X libs try to actually use it, see MPlayer-users
7942 Message-ID: <45D49541.8060101@infernix.net>
7943 Date: Thu, 15 Feb 2007 18:15:45 +0100
7944 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7946 #define HAVE_SYS_POLL_H 1
7948 /* yes, we have inttypes.h */
7949 #define HAVE_INTTYPES_H 1
7951 /* int_fastXY_t emulation */
7952 $_def_fast_inttypes
7954 /* libdvdcss */
7955 #define HAVE_ERRNO_H 1
7957 /* libdvdcss + libdvdread */
7958 #define HAVE_LIMITS_H 1
7960 /* libdvdcss + libfaad2 */
7961 #define HAVE_UNISTD_H 1
7963 /* libfaad2 + libdvdread */
7964 #define STDC_HEADERS 1
7966 /* libfaad2 */
7967 #define HAVE_MEMCPY 1
7968 #define HAVE_STRCHR 1
7970 /* libdvdread */
7971 #define HAVE_UINTPTR_T 1
7973 /* name of messages charset */
7974 $_def_charset
7976 /* Runtime CPU detection */
7977 $_def_runtime_cpudetection
7979 /* Dynamic a/v plugins */
7980 $_def_dynamic_plugins
7982 /* "restrict" keyword */
7983 $_def_restrict_keyword
7985 /* __builtin_expect branch prediction hint */
7986 $_def_builtin_expect
7987 #ifdef HAVE_BUILTIN_EXPECT
7988 #define likely(x) __builtin_expect ((x) != 0, 1)
7989 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7990 #else
7991 #define likely(x) (x)
7992 #define unlikely(x) (x)
7993 #endif
7995 /* attribute(used) as needed by some compilers */
7996 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7997 # define attribute_used __attribute__((used))
7998 #else
7999 # define attribute_used
8000 #endif
8002 /* extern symbol prefix */
8003 $_def_extern_prefix
8005 /* compiler support for named assembler arguments */
8006 $_def_named_asm_args
8008 /* enable/disable SIGHANDLER */
8009 $_def_sighandler
8011 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
8012 $_def_crash_debug
8014 /* Toggles debugging informations */
8015 $_def_debug
8017 /* Indicates that libcdio is available for VCD and CD-DA playback */
8018 $_def_libcdio
8020 /* Indicates that Ogle's libdvdread is available for DVD playback */
8021 $_def_dvdread
8023 /* Indicates that dvdread is internal */
8024 $_def_dvdread_internal
8026 /* Additional options for libdvdread/libdvdcss */
8027 $_def_dvd
8028 $_def_cdrom
8029 $_def_cdio
8030 $_def_dvdio
8031 $_def_bsdi_dvd
8032 $_def_dvd_bsd
8033 $_def_dvd_linux
8034 $_dev_dvd_openbsd
8035 $_def_dvd_darwin
8036 $_def_sol_scsi_h
8037 $_def_hpux_scsi_h
8039 /* Common data directory (for fonts, etc) */
8040 #define MPLAYER_DATADIR "$_datadir"
8041 #define MPLAYER_CONFDIR "$_confdir"
8042 #define MPLAYER_LIBDIR "$_libdir"
8044 /* Define this to compile stream-caching support, it can be enabled via
8045 -cache <kilobytes> */
8046 $_def_stream_cache
8048 /* Define if you are using XviD library */
8049 $_def_xvid
8051 /* Define if you are using the X.264 library */
8052 $_def_x264
8054 /* Define if you are using libnut */
8055 $_def_libnut
8057 /* Define to include support for libdv-0.9.5 */
8058 $_def_libdv
8060 /* If build mencoder */
8061 $_mencoder_flag
8063 /* Indicates if libmp3lame is available
8064 Note: for mencoder */
8065 $_def_mp3lame
8066 $_def_mp3lame_preset
8067 $_def_mp3lame_preset_medium
8069 /* Undefine this if you do not want to select mono audio (left or right)
8070 with a stereo MPEG layer 2/3 audio stream. The command line option
8071 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8072 right-only), with 0 being the default.
8074 #define USE_FAKE_MONO 1
8076 /* Undefine this if your sound card driver has no working select().
8077 If you have kernel Oops, player hangups, or just no audio, you should
8078 try to recompile MPlayer with this option disabled! */
8079 $_def_select
8081 /* define this to use iconv(3) function to codepage conversions */
8082 $_def_iconv
8084 /* define this to use nl_langinfo function */
8085 $_def_langinfo
8087 /* define this to use RTC (/dev/rtc) for video timers */
8088 $_def_rtc
8090 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
8091 #define MAX_OUTBURST 65536
8093 /* set up audio OUTBURST. Do not change this! */
8094 #define OUTBURST 512
8096 /* Define this if your system has the header file for the OSS sound interface */
8097 $_def_sys_soundcard
8099 /* Define this if your system has the header file for the OSS sound interface
8100 * in /usr/include */
8101 $_def_soundcard
8103 /* Define this if your system has the sysinfo header */
8104 $_def_sys_sysinfo
8106 /* Define this if your system has the "malloc.h" header file */
8107 $_def_malloc
8109 /* memalign is mapped to malloc if unsupported */
8110 $_def_memalign
8111 $_def_map_memalign
8112 $_def_memalign_hack
8114 /* assembler handling of .align */
8115 $_def_asmalign_pot
8117 /* Define this if your system has the "alloca.h" header file */
8118 $_def_alloca
8120 /* Define this if your system has the "byteswap.h" header file */
8121 $_def_byteswap_h
8123 /* Define this if your system has the "sys/mman.h" header file */
8124 $_def_mman
8125 $_def_mman_has_map_failed
8127 /* Define this if you have the elf dynamic linker -ldl library */
8128 $_def_dl
8130 /* Define this if you have the kstat kernel statistics library */
8131 $_def_kstat
8133 /* Define this if you have zlib */
8134 $_def_zlib
8135 #ifdef HAVE_ZLIB
8136 #define CONFIG_ZLIB 1
8137 #endif
8139 /* Define this if you have shm support */
8140 $_def_shm
8142 /* Define this if your system has strsep */
8143 $_def_strsep
8145 /* Define this if your system has vsscanf */
8146 $_def_vsscanf
8148 /* Define this if your system has swab */
8149 $_def_swab
8151 /* Define this if your system has posix select */
8152 $_def_posix_select
8154 /* Define this if your system has gettimeofday */
8155 $_def_gettimeofday
8157 /* Define this if your system has glob */
8158 $_def_glob
8160 /* Define this if your system has setenv */
8161 $_def_setenv
8162 #ifndef HAVE_SETENV
8163 int setenv(const char *name, const char *val, int overwrite);
8164 #endif
8166 /* Define this if your system has sysi86 */
8167 $_def_sysi86
8168 $_def_sysi86_iv
8170 /* Define this if your system has pthreads */
8171 $_def_pthreads
8173 /* Define this if you enabled thread support for libavcodec */
8174 $_def_threads
8175 #ifdef HAVE_THREADS
8176 #define ENABLE_THREADS 1
8177 #else
8178 #define ENABLE_THREADS 0
8179 #endif
8181 /* LIRC (remote control, see www.lirc.org) support: */
8182 $_def_lirc
8184 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8185 $_def_apple_remote
8187 /* Support for maemo (http://www.maemo.org) */
8188 $_def_maemo
8191 * LIRCCD (LIRC client daemon)
8192 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8194 $_def_lircc
8196 /* DVD navigation support using libdvdnav */
8197 $_def_dvdnav
8199 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8200 #define MPEG12_POSTPROC 1
8202 /* maximum alignment used by libmpeg2 */
8203 #define ATTRIBUTE_ALIGNED_MAX 16
8205 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8206 $_def_libpostproc
8207 $_def_libpostproc_a
8208 $_def_libpostproc_so
8210 /* Win32 DLL support */
8211 $_def_win32dll
8212 #define WIN32_PATH "$_win32codecsdir"
8214 /* Mac OS X specific features */
8215 $_def_macosx_finder_support
8216 $_def_macosx_bundle
8217 $_def_coreaudio
8218 $_def_corevideo
8219 $_def_quartz
8220 $_def_quicktime
8222 /* Build our Win32-loader */
8223 $_def_win32_loader
8225 /* ffmpeg's libavcodec support (requires libavcodec source) */
8226 $_def_libavcodec
8227 $_def_libavcodec_a
8228 $_def_libavcodec_so
8229 $_def_libavcodec_mpegaudio_hp
8231 /* ffmpeg's libavformat support (requires libavformat source) */
8232 $_def_libavformat
8233 $_def_libavformat_a
8234 $_def_libavformat_so
8236 $_def_libavutil
8237 $_def_libavutil_a
8238 $_def_libavutil_so
8240 /* Use libavcodec's decoders */
8241 #define CONFIG_DECODERS 1
8242 #define ENABLE_DECODERS 1
8243 /* Use libavcodec's encoders */
8244 #define CONFIG_ENCODERS 1
8245 #define ENABLE_ENCODERS 1
8247 /* Use libavformat's demuxers */
8248 #define CONFIG_DEMUXERS 1
8249 #define ENABLE_DEMUXERS 1
8250 /* Use libavformat's muxers */
8251 $_def_muxers
8253 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8254 #define HAVE_EBX_AVAILABLE 1
8255 #ifndef MP_DEBUG
8256 #define HAVE_EBP_AVAILABLE 1
8257 #endif
8259 #define HAVE_SOCKLEN_T 1
8261 #define CONFIG_GPL 1
8262 #define ENABLE_SMALL 0
8263 #define ENABLE_GRAY 0
8265 /* Use AMR codecs from libavcodec. */
8266 $_def_libamr
8267 $_def_libamr_nb
8268 $_def_libamr_wb
8270 /* Use specific parts from FFmpeg. */
8271 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8272 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8273 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8274 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8275 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8276 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8277 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8279 $_def_lavc_faac
8280 $_def_lavc_xvid
8281 $_def_lavc_mp3lame
8282 $_def_lavc_x264
8284 /* Use codec libs included in mplayer CVS / source dist: */
8285 $_def_mp3lib
8286 $_def_liba52
8287 $_def_libmpeg2
8289 /* XAnim DLL support */
8290 $_def_xanim
8291 /* Default search path */
8292 $_def_xanim_path
8294 /* RealPlayer DLL support */
8295 $_def_real
8296 /* Default search path */
8297 $_def_real_path
8299 /* LIVE555 Streaming Media library support */
8300 $_def_live
8302 /* libnemesi Streaming Media library support */
8303 $_def_nemesi
8305 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8306 $_def_fastmemcpy
8308 /* Use UnRAR executable for Vobsubs */
8309 $_def_unrar_exec
8311 /* gui support, please do not edit this option */
8312 $_def_gui
8313 $_def_gtk2_gui
8315 /* Audio output drivers */
8316 $_def_ossaudio
8317 $_def_ossaudio_devdsp
8318 $_def_ossaudio_devmixer
8319 $_def_alsa5
8320 $_def_alsa9
8321 $_def_alsa1x
8322 $_def_arts
8323 $_def_esd
8324 $_def_esd_latency
8325 $_def_pulse
8326 $_def_jack
8327 $_def_openal
8328 $_def_openal_h
8329 $_def_sys_asoundlib_h
8330 $_def_alsa_asoundlib_h
8331 $_def_sunaudio
8332 $_def_sgiaudio
8333 $_def_win32waveout
8334 $_def_nas
8336 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8337 #undef FAST_OSD
8338 #undef FAST_OSD_TABLE
8340 /* Enable TV Interface support */
8341 $_def_tv
8343 /* Enable Video 4 Linux TV interface support */
8344 $_def_tv_v4l
8346 /* Enable Video 4 Linux 1 TV interface support */
8347 $_def_tv_v4l1
8349 /* Enable Video 4 Linux 2 TV interface support */
8350 $_def_tv_v4l2
8352 /* Enable DirectShow TV interface support */
8353 $_def_tv_dshow
8355 /* *BSD BrookTree headers */
8356 $_def_ioctl_meteor_h_name
8357 $_def_ioctl_bt848_h_name
8359 /* Enable *BSD BrookTree TV interface support */
8360 $_def_tv_bsdbt848
8362 /* Enable TV Teletext Interface support */
8363 $_def_tv_teletext
8365 /* Enable Radio Interface support */
8366 $_def_radio
8368 /* Enable Capture for Radio Interface support */
8369 $_def_radio_capture
8371 /* Enable Video 4 Linux Radio interface support */
8372 $_def_radio_v4l
8374 /* Enable Video 4 Linux 2 Radio interface support */
8375 $_def_radio_v4l2
8377 /* Enable *BSD BrookTree Radio interface support */
8378 $_def_radio_bsdbt848
8380 /* Enable Video 4 Linux 2 MPEG PVR support */
8381 $_def_pvr
8383 /* Define if your processor stores words with the most significant
8384 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8385 $_def_words_endian
8387 /* Define if your processor can access unaligned data in a fast way */
8388 $_def_fast_unaligned
8390 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8392 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8393 have the instruction. */
8394 $_def_dcbzl
8396 /* Define this for Cygwin build for win32 */
8397 $_def_confwin32
8399 /* Define this to any prefered value from 386 up to infinity with step 100 */
8400 #define __CPU__ $iproc
8402 $_mp_wordsize
8404 $_def_vcd
8406 #ifdef sun
8407 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8408 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8409 #elif defined(WIN32) || defined(__OS2__)
8410 #define DEFAULT_CDROM_DEVICE "D:"
8411 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8412 #elif defined(__APPLE__) || defined(__DARWIN__)
8413 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8414 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8415 #elif defined(__OpenBSD__)
8416 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8417 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8418 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8419 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8420 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8421 #elif defined(__DragonFly__)
8422 #define DEFAULT_CDROM_DEVICE "/dev/cd0"
8423 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8424 #elif defined(__AMIGAOS4__)
8425 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8426 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8427 #else
8428 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8429 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8430 #endif
8433 /*----------------------------------------------------------------------------
8435 ** NOTE: Instead of modifying these definitions here, use the
8436 ** --enable/--disable options of the ./configure script!
8437 ** See ./configure --help for details.
8439 *---------------------------------------------------------------------------*/
8441 /* C99 *lrint* and round* functions available */
8442 $_def_llrint
8443 $_def_lrint
8444 $_def_lrintf
8445 $_def_round
8446 $_def_roundf
8448 /* mkstemp support */
8449 $_def_mkstemp
8451 /* nanosleep support */
8452 $_def_nanosleep
8454 /* SMB support */
8455 $_def_smbsupport
8457 /* termcap flag for getch2.c */
8458 $_def_termcap
8460 /* termios flag for getch2.c */
8461 $_def_termios
8462 $_def_termios_h
8463 $_def_termios_sys_h
8465 /* enable PNG support */
8466 $_def_png
8468 /* enable JPEG support */
8469 $_def_jpeg
8471 /* enable PNM support */
8472 $_def_pnm
8474 /* enable md5sum support */
8475 $_def_md5sum
8477 /* enable GIF support */
8478 $_def_gif
8479 $_def_gif_4
8480 $_def_gif_tvt_hack
8482 /* enable bitmap font support */
8483 $_def_bitmap_font
8485 /* enable FreeType support */
8486 $_def_freetype
8488 /* enable Fontconfig support */
8489 $_def_fontconfig
8491 /* enable SSA/ASS support */
8492 $_def_ass
8494 /* enable FriBiDi usage */
8495 $_def_fribidi
8497 /* enable ENCA usage */
8498 $_def_enca
8500 /* liblzo support */
8501 $_def_liblzo
8502 #ifdef USE_LIBLZO
8503 #define CONFIG_LZO 1
8504 #endif
8506 /* libmad support */
8507 $_def_mad
8509 /* enable OggVorbis support */
8510 $_def_vorbis
8511 $_def_tremor
8513 /* enable Speex support */
8514 $_def_speex
8516 /* enable musepack support */
8517 $_def_musepack
8519 /* enable OggTheora support */
8520 $_def_theora
8522 /* enable FAAD (AAC) support */
8523 $_def_faad
8524 $_def_faad_internal
8526 /* enable FAAC (AAC encoder) support */
8527 $_def_faac
8529 /* enable libdca support */
8530 $_def_libdca
8532 /* enable LADSPA plugin support */
8533 $_def_ladspa
8535 /* enable network */
8536 $_def_network
8538 /* enable ftp support */
8539 $_def_ftp
8541 /* enable vstream support */
8542 $_def_vstream
8544 /* enable winsock2 instead of Unix functions*/
8545 $_def_winsock2
8547 /* define this to use inet_aton() instead of inet_pton() */
8548 $_def_use_aton
8550 /* enables / disables cdparanoia support */
8551 $_def_cdparanoia
8552 $_def_cddb
8554 /* enables / disables VIDIX usage */
8555 $_def_vidix
8556 $_def_vidix_drv_cyberblade
8557 $_def_vidix_drv_ivtv
8558 $_def_vidix_drv_mach64
8559 $_def_vidix_drv_mga
8560 $_def_vidix_drv_mga_crtc2
8561 $_def_vidix_drv_nvidia
8562 $_def_vidix_drv_pm3
8563 $_def_vidix_drv_radeon
8564 $_def_vidix_drv_rage128
8565 $_def_vidix_drv_s3
8566 $_def_vidix_drv_sis
8567 $_def_vidix_drv_unichrome
8568 $_def_vidix_pfx
8570 /* enables / disables new input joystick support */
8571 $_def_joystick
8573 /* enables / disables QTX codecs */
8574 $_def_qtx
8575 $_def_qtx_win32
8577 /* enables / disables osd menu */
8578 $_def_menu
8580 /* enables / disables subtitles sorting */
8581 $_def_sortsub
8583 /* XMMS input plugin support */
8584 $_def_xmms
8585 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8587 /* enables inet6 support */
8588 $_def_inet6
8590 /* do we have gethostbyname2? */
8591 $_def_gethostbyname2
8593 /* Extension defines */
8594 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8596 $_def_altivec_h // enables usage of altivec.h
8598 /* libvo options */
8599 #define SCREEN_SIZE_X 1
8600 #define SCREEN_SIZE_Y 1
8601 $_def_x11
8602 $_def_xv
8603 $_def_xvmc
8604 $_def_vm
8605 $_def_xf86keysym
8606 $_def_xinerama
8607 $_def_gl
8608 $_def_gl_win32
8609 $_def_dga
8610 $_def_dga1
8611 $_def_dga2
8612 $_def_sdl
8613 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8614 $_def_sdlbuggy
8615 $_def_directx
8616 $_def_ggi
8617 $_def_ggiwmh
8618 $_def_3dfx
8619 $_def_s3fb
8620 $_def_tdfxfb
8621 $_def_tdfxvid
8622 $_def_xvr100
8623 $_def_directfb
8624 $_def_directfb_version
8625 $_def_dfbmga
8626 $_def_zr
8627 $_def_bl
8628 $_def_mga
8629 $_def_xmga
8630 $_def_fbdev
8631 $_def_dxr2
8632 $_def_dxr3
8633 $_def_ivtv
8634 $_def_v4l2
8635 $_def_dvb
8636 $_def_dvb_in
8637 $_def_svga
8638 $_def_vesa
8639 $_def_xss
8640 $_def_xdpms
8641 $_def_aa
8642 $_def_caca
8643 $_def_tga
8644 $_def_toolame
8645 $_def_twolame
8647 /* used by GUI: */
8648 $_def_xshape
8650 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8651 #define X11_FULLSCREEN 1
8652 #endif
8654 #endif /* MPLAYER_CONFIG_H */
8657 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8658 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8660 cp -p config.h ffmpeg/config.h
8661 sed -e 's/OPTFLAGS/MPLAYER_OPTFLAGS/' -e 's/FFMPEG_OFLAGS/OPTFLAGS/' config.mak >ffmpeg/config.mak
8663 #############################################################################
8665 cat << EOF
8667 Config files successfully generated by ./configure $_configuration !
8669 Install prefix: $_prefix
8670 Data directory: $_datadir
8671 Config direct.: $_confdir
8673 Byte order: $_byte_order
8674 Optimizing for: $_optimizing
8676 Languages:
8677 Messages/GUI: $_language
8680 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8681 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8682 echo
8684 cat << EOF
8686 Enabled optional drivers:
8687 Input: $_inputmodules
8688 Codecs: $_codecmodules
8689 Audio output: $_aomodules
8690 Video output: $_vomodules
8691 Disabled optional drivers:
8692 Input: $_noinputmodules
8693 Codecs: $_nocodecmodules
8694 Audio output: $_noaomodules
8695 Video output: $_novomodules
8697 'config.h' and 'config.mak' contain your configuration options.
8698 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8699 compile *** DO NOT REPORT BUGS if you tweak these files ***
8701 'make' will now compile MPlayer and 'make install' will install it.
8702 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8707 if test "$_mtrr" = yes ; then
8708 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8709 echo
8712 if ! x86_32; then
8713 cat <<EOF
8714 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8715 operating system ($system_name). You may encounter a few files that cannot
8716 be played due to missing open source video/audio codec support.
8722 cat <<EOF
8723 Check $TMPLOG if you wonder why an autodetection failed (make sure
8724 development headers/packages are installed).
8726 NOTE: The --enable-* parameters unconditionally force options on, completely
8727 skipping autodetection. This behavior is unlike what you may be used to from
8728 autoconf-based configure scripts that can decide to override you. This greater
8729 level of control comes at a price. You may have to provide the correct compiler
8730 and linker flags yourself.
8731 If you used one of these options (except --enable-gui and similar ones that
8732 turn on internal features) and experience a compilation or linking failure,
8733 make sure you have passed the necessary compiler/linker flags to configure.
8735 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8739 if test "$_warn_CFLAGS" = yes; then
8740 cat <<EOF
8742 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8744 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8746 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8747 To do so, execute 'CFLAGS= ./configure <options>'
8752 # Last move:
8753 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"