Remove unnecessary #include <malloc.h>
[mplayer.git] / configure
blobf862f60ea1387fc61da9176aaa1288954c609ad2
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: check the cvs log !
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, here is a simple skeleton:
24 # echocheck "$feature"
25 # if "$_feature" = auto; then
26 # cat > $TMPC << EOF
27 # #include <feature.h>
28 # int main(void) { return 0; }
29 # EOF
30 # _feature=no
31 # cc_check && _feature=yes
32 # if test "$_feature" = yes ; then
33 # _def_feature='#define HAVE_FEATURE 1'
34 # else
35 # _def_feature='#undef HAVE_FEATURE'
36 # fi
37 # echores "$_feature"
39 # Furthermore you need to add the variable _feature to the list of default
40 # settings and set it to one of yes/no/auto. Also add appropriate
41 # --enable-feature/--disable-feature command line options.
42 # The results of the check should be written to config.h and config.mak
43 # at the end of this script. The variable names used for this should be
44 # uniform, i.e. if the option is named 'feature':
46 # _feature : should have a value of yes/no/auto
47 # _def_feature : '#define ... 1' or '#undef ...' for conditional compilation
48 # _ld_feature : '-L/path/dir -lfeature' GCC options
50 #############################################################################
52 # Prevent locale nonsense from breaking basic text processing utils
53 LC_ALL=C
54 export LC_ALL
56 # Store the configure line that was used
57 _configuration="$*"
59 # Prefer these macros to full length text !
60 # These macros only return an error code - NO display is done
61 compile_check() {
62 echo >> "$TMPLOG"
63 cat "$1" >> "$TMPLOG"
64 echo >> "$TMPLOG"
65 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
66 rm -f "$TMPEXE"
67 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $_libs_mplayer $_libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
68 TMP="$?"
69 echo >> "$TMPLOG"
70 echo >> "$TMPLOG"
71 return "$TMP"
74 cc_check() {
75 compile_check $TMPC $@
78 cxx_check() {
79 compile_check $TMPCPP $@ -lstdc++
82 tmp_run() {
83 "$TMPEXE" >> "$TMPLOG" 2>&1
86 # Display error message, flushes tempfile, exit
87 die () {
88 echo
89 echo "Error: $@" >&2
90 echo >&2
91 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
92 echo "Check \"$TMPLOG\" if you do not understand why it failed."
93 exit 1
96 # OS test booleans functions
97 issystem() {
98 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
100 linux() { issystem "Linux" || issystem "uClinux" ; return "$?" ; }
101 sunos() { issystem "SunOS" ; return "$?" ; }
102 hpux() { issystem "HP-UX" ; return "$?" ; }
103 irix() { issystem "IRIX" ; return "$?" ; }
104 aix() { issystem "AIX" ; return "$?" ; }
105 cygwin() { issystem "CYGWIN" ; return "$?" ; }
106 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; }
107 netbsd() { issystem "NetBSD" ; return "$?" ; }
108 bsdos() { issystem "BSD/OS" ; return "$?" ; }
109 openbsd() { issystem "OpenBSD" ; return "$?" ; }
110 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
111 qnx() { issystem "QNX" ; return "$?" ; }
112 darwin() { issystem "Darwin" ; return "$?" ; }
113 gnu() { issystem "GNU" ; return "$?" ; }
114 mingw32() { issystem "MINGW32" ; return "$?" ; }
115 morphos() { issystem "MorphOS" ; return "$?" ; }
116 amigaos() { issystem "AmigaOS" ; return "$?" ; }
117 win32() { cygwin || mingw32 ; return "$?" ; }
118 beos() { issystem "BEOS" ; return "$?" ; }
120 # arch test boolean functions
121 # x86/x86pc is used by QNX
122 x86_32() {
123 case "$host_arch" in
124 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
125 *) return 1 ;;
126 esac
129 x86_64() {
130 case "$host_arch" in
131 x86_64|amd64) return 0 ;;
132 *) return 1 ;;
133 esac
136 x86() {
137 x86_32 || x86_64
140 ppc() {
141 case "$host_arch" in
142 ppc|powerpc) return 0;;
143 *) return 1;;
144 esac
147 alpha() {
148 case "$host_arch" in
149 alpha) return 0;;
150 *) return 1;;
151 esac
154 arm() {
155 case "$host_arch" in
156 arm) return 0;;
157 *) return 1;;
158 esac
161 sh3() {
162 case "$host_arch" in
163 sh3) return 0;;
164 *) return 1;;
165 esac
168 # not boolean test: implement the posix shell "!" operator for a
169 # non-posix /bin/sh.
170 # usage: not {command}
171 # returns exit status "success" when the execution of "command"
172 # fails.
173 not() {
174 eval "$@"
175 test $? -ne 0
178 # Use this before starting a check
179 echocheck() {
180 echo "============ Checking for $@ ============" >> "$TMPLOG"
181 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
184 # Use this to echo the results of a check
185 echores() {
186 if test "$_res_comment" ; then
187 _res_comment="($_res_comment)"
189 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
190 echo "##########################################" >> "$TMPLOG"
191 echo "" >> "$TMPLOG"
192 echo "$@ $_res_comment"
193 _res_comment=""
195 #############################################################################
197 # Check how echo works in this /bin/sh
198 case `echo -n` in
199 -n) _echo_n= _echo_c='\c' ;; # SysV echo
200 *) _echo_n='-n ' _echo_c= ;; # BSD echo
201 esac
203 LANGUAGES=`echo help/help_mp-??.h help/help_mp-??_??.h | sed "s:help/help_mp-\(..\).h:\1:g" | sed "s:help/help_mp-\(.....\).h:\1:g"`
205 show_help(){
206 cat << EOF
207 Usage: $0 [OPTIONS]...
209 Configuration:
210 -h, --help display this help and exit
212 Installation directories:
213 --prefix=DIR prefix directory for installation [/usr/local]
214 --bindir=DIR directory for installing binaries [PREFIX/bin]
215 --datadir=DIR directory for installing machine independent
216 data files (skins, etc) [PREFIX/share/mplayer]
217 --mandir=DIR directory for installing man pages [PREFIX/share/man]
218 --confdir=DIR directory for installing configuration files
219 [PREFIX/etc/mplayer]
220 --libdir=DIR directory for object code libraries [PREFIX/lib]
221 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
222 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
223 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
224 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
226 Optional features:
227 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
228 --disable-mplayer disable MPlayer compilation [enable]
229 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
230 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
231 --enable-largefiles enable support for files > 2GB [disable]
232 --enable-linux-devfs set default devices to devfs [disable]
233 --enable-termcap use termcap database for key codes [autodetect]
234 --enable-termios use termios database for key codes [autodetect]
235 --disable-iconv disable iconv for encoding conversion [autodetect]
236 --disable-langinfo do not use langinfo [autodetect]
237 --enable-lirc enable LIRC (remote control) support [autodetect]
238 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
239 --enable-joystick enable joystick support [disable]
240 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
241 --disable-vm disable X video mode extensions [autodetect]
242 --disable-xf86keysym disable support for multimedia keys [autodetect]
243 --enable-radio enable radio interface [disable]
244 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
245 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
246 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
247 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
248 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
249 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
250 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
251 --disable-tv-teletext disable TV teletext interface [autodetect]
252 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
253 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
254 --disable-network disable networking [enable]
255 --enable-winsock2 enable winsock2 [autodetect]
256 --enable-smb enable Samba (SMB) input [autodetect]
257 --enable-live enable LIVE555 Streaming Media [autodetect]
258 --enable-nemesi enable Nemesi Streaming Media [autodetect]
259 --disable-dvdnav disable libdvdnav [autodetect]
260 --disable-dvdread disable libdvdread [autodetect]
261 --disable-dvdread-internal disable internal libdvdread [autodetect]
262 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
263 --disable-cdparanoia disable cdparanoia [autodetect]
264 --disable-cddb disable cddb [autodetect]
265 --disable-bitmap-font disable bitmap font support [enable]
266 --disable-freetype disable FreeType 2 font rendering [autodetect]
267 --disable-fontconfig disable fontconfig font lookup [autodetect]
268 --disable-unrarlib disable Unique RAR File Library [enabled]
269 --enable-menu enable OSD menu (not DVD menu) [disabled]
270 --disable-sortsub disable subtitle sorting [enabled]
271 --enable-fribidi enable the FriBiDi libs [autodetect]
272 --disable-enca disable ENCA charset oracle library [autodetect]
273 --disable-macosx disable Mac OS X specific features [autodetect]
274 --disable-maemo disable maemo specific features [autodetect]
275 --enable-macosx-finder-support enable Mac OS X Finder invocation
276 parameter parsing [disabled]
277 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
278 --disable-inet6 disable IPv6 support [autodetect]
279 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
280 --disable-ftp disable FTP support [enabled]
281 --disable-vstream disable TiVo vstream client support [autodetect]
282 --disable-pthreads disable Posix threads support [autodetect]
283 --disable-w32threads disable Win32 threads support [autodetect]
284 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
285 --enable-rpath enable runtime linker path for extra libs [disabled]
287 Codecs:
288 --enable-gif enable GIF support [autodetect]
289 --enable-png enable PNG input/output support [autodetect]
290 --enable-jpeg enable JPEG input/output support [autodetect]
291 --enable-libcdio enable external libcdio [autodetect]
292 --enable-liblzo enable external liblzo [autodetect]
293 --disable-win32dll disable Win32 DLL support [enabled]
294 --disable-qtx disable QuickTime codecs support [enabled]
295 --disable-xanim disable XAnim codecs support [enabled]
296 --disable-real disable RealPlayer codecs support [enabled]
297 --disable-xvid disable XviD [autodetect]
298 --disable-x264 disable x264 [autodetect]
299 --disable-libnut disable libnut [autodetect]
300 --disable-libavutil_a disable static libavutil [autodetect]
301 --disable-libavcodec_a disable static libavcodec [autodetect]
302 --disable-libavformat_a disable static libavformat [autodetect]
303 --disable-libpostproc_a disable static libpostproc [autodetect]
304 --disable-libavutil_so disable shared libavutil [autodetect]
305 --disable-libavcodec_so disable shared libavcodec [autodetect]
306 --disable-libavformat_so disable shared libavformat [autodetect]
307 --disable-libpostproc_so disable shared libpostproc [autodetect]
308 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
309 in libavcodec [enabled]
310 --disable-tremor-internal disable internal Tremor [enabled]
311 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
312 --enable-tremor-external enable external Tremor [autodetect]
313 --disable-libvorbis disable libvorbis support [autodetect]
314 --disable-speex disable Speex support [autodetect]
315 --enable-theora enable OggTheora libraries [autodetect]
316 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
317 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
318 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
319 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
320 --disable-ladspa disable LADSPA plugin support [autodetect]
321 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
322 --disable-mad disable libmad (MPEG audio) support [autodetect]
323 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
324 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
325 --enable-xmms enable XMMS input plugin support [disabled]
326 --enable-libdca enable libdca support [autodetect]
327 --disable-mp3lib disable builtin mp3lib [enabled]
328 --disable-liba52 disable builtin liba52 [enabled]
329 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
330 --disable-musepack disable musepack support [autodetect]
331 --disable-libamr_nb disable libamr narrowband [autodetect]
332 --disable-libamr_wb disable libamr wideband [autodetect]
333 --disable-decoder=DECODER disable specified FFmpeg decoder
334 --enable-decoder=DECODER enable specified FFmpeg decoder
335 --disable-encoder=ENCODER disable specified FFmpeg encoder
336 --enable-encoder=ENCODER enable specified FFmpeg encoder
337 --disable-parser=PARSER disable specified FFmpeg parser
338 --enable-parser=PARSER enable specified FFmpeg parser
339 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
340 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
341 --disable-muxer=MUXER disable specified FFmpeg muxer
342 --enable-muxer=MUXER enable specified FFmpeg muxer
344 Video output:
345 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
346 --disable-vidix-external disable external VIDIX [for x86 *nix]
347 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
348 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
349 nvidia,pm2,pm3,radeon,rage128,savage,sis,unichrome
350 --enable-gl enable OpenGL video output [autodetect]
351 --enable-dga2 enable DGA 2 support [autodetect]
352 --enable-dga1 enable DGA 1 support [autodetect]
353 --enable-vesa enable VESA video output [autodetect]
354 --enable-svga enable SVGAlib video output [autodetect]
355 --enable-sdl enable SDL video output [autodetect]
356 --enable-aa enable AAlib video output [autodetect]
357 --enable-caca enable CACA video output [autodetect]
358 --enable-ggi enable GGI video output [autodetect]
359 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
360 --enable-directx enable DirectX video output [autodetect]
361 --enable-dxr2 enable DXR2 video output [autodetect]
362 --enable-dxr3 enable DXR3/H+ video output [autodetect]
363 --enable-ivtv enable IVTV TV-Out video output [autodetect]
364 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
365 --enable-dvb enable DVB video output [autodetect]
366 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
367 --enable-mga enable mga_vid video output [autodetect]
368 --enable-xmga enable mga_vid X11 video output [autodetect]
369 --enable-xv enable Xv video output [autodetect]
370 --enable-xvmc enable XvMC acceleration [disable]
371 --enable-vm enable XF86VidMode support [autodetect]
372 --enable-xinerama enable Xinerama support [autodetect]
373 --enable-x11 enable X11 video output [autodetect]
374 --enable-xshape enable XShape support [autodetect]
375 --enable-fbdev enable FBDev video output [autodetect]
376 --enable-mlib enable mediaLib video output (Solaris) [disable]
377 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
378 --enable-tdfxfb enable tdfxfb video output [disable]
379 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
380 --enable-directfb enable DirectFB video output [autodetect]
381 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
382 --enable-bl enable Blinkenlights video output [disable]
383 --enable-tdfxvid enable tdfx_vid video output [disable]
384 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
385 --disable-tga disable Targa video output [enable]
386 --disable-pnm disable PNM video output [enable]
387 --disable-md5sum disable md5sum video output [enable]
389 Audio output:
390 --disable-alsa disable ALSA audio output [autodetect]
391 --disable-ossaudio disable OSS audio output [autodetect]
392 --disable-arts disable aRts audio output [autodetect]
393 --disable-esd disable esd audio output [autodetect]
394 --disable-polyp disable Polypaudio audio output [autodetect]
395 --disable-jack disable JACK audio output [autodetect]
396 --disable-openal disable OpenAL audio output [autodetect]
397 --disable-nas disable NAS audio output [autodetect]
398 --disable-sgiaudio disable SGI audio output [autodetect]
399 --disable-sunaudio disable Sun audio output [autodetect]
400 --disable-win32waveout disable Windows waveout audio output [autodetect]
401 --disable-select disable using select() on the audio device [enable]
403 Miscellaneous options:
404 --enable-runtime-cpudetection enable runtime CPU detection [disable]
405 --enable-cross-compile enable cross-compilation [autodetect]
406 --cc=COMPILER C compiler to build MPlayer [gcc]
407 --host-cc=COMPILER C compiler for tools needed while building [gcc]
408 --as=ASSEMBLER assembler to build MPlayer [as]
409 --ar=AR librarian to build MPlayer [ar]
410 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
411 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
412 --enable-static build a statically linked binary
413 --charset=charset convert the console messages to this character set
414 --language=list a white space or comma separated list of languages for
415 translated man pages, the first language is used for
416 messages and the GUI (the environment variable
417 \$LINGUAS is also honored) [en]
418 (Available: $LANGUAGES all)
419 --with-install=PATH path to a custom install program
420 --enable-color-console enable color console output (UNSUPPORTED) [disable]
422 Advanced options:
423 --enable-mmx enable MMX [autodetect]
424 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
425 --enable-3dnow enable 3DNow! [autodetect]
426 --enable-3dnowext enable extended 3DNow! [autodetect]
427 --enable-sse enable SSE [autodetect]
428 --enable-sse2 enable SSE2 [autodetect]
429 --enable-ssse3 enable SSSE3 [autodetect]
430 --enable-shm enable shm [autodetect]
431 --enable-altivec enable AltiVec (PowerPC) [autodetect]
432 --enable-armv5te enable DSP extensions (ARM) [autodetect]
433 --enable-armv6 enable ARMv6 (ARM) [autodetect]
434 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
435 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
436 --enable-big-endian force byte order to big-endian [autodetect]
437 --enable-debug[=1-3] compile-in debugging information [disable]
438 --enable-profile compile-in profiling information [disable]
439 --disable-sighandler disable sighandler for crashes [enable]
440 --enable-crash-debug enable automatic gdb attach on crash [disable]
441 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
443 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
444 --disable-gcc-check disable gcc version checking [enable]
446 Use these options if autodetection fails (Options marked with (*) accept
447 multiple paths separated by ':'):
448 --extra-libs=FLAGS extra linker flags
449 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
450 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
451 --with-extraincdir=DIR extra header search paths in DIR (*)
452 --with-extralibdir=DIR extra linker search paths in DIR (*)
453 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
455 --with-freetype-config=PATH path to freetype-config
456 --with-fribidi-config=PATH path to fribidi-config
457 --with-glib-config=PATH path to glib*-config
458 --with-gtk-config=PATH path to gtk*-config
459 --with-sdl-config=PATH path to sdl*-config
460 --with-dvdnav-config=PATH path to dvdnav-config
462 This configure script is NOT autoconf-based, even though its output is similar.
463 It will try to autodetect all configuration options. If you --enable an option
464 it will be forcefully turned on, skipping autodetection. This can break
465 compilation, so you need to know what you are doing.
467 exit 0
468 } #show_help()
470 # GOTCHA: the variables below defines the default behavior for autodetection
471 # and have - unless stated otherwise - at least 2 states : yes no
472 # If autodetection is available then the third state is: auto
473 _mmx=auto
474 _3dnow=auto
475 _3dnowext=auto
476 _mmxext=auto
477 _sse=auto
478 _sse2=auto
479 _ssse3=auto
480 _cmov=auto
481 _fast_cmov=auto
482 _armv5te=auto
483 _armv6=auto
484 _iwmmxt=auto
485 _mtrr=auto
486 _altivec=auto
487 _install=install
488 _ranlib=ranlib
489 _ldconfig=ldconfig
490 _cc=cc
491 _ar=ar
492 test "$CC" && _cc="$CC"
493 _gcc_check=yes
494 _as=auto
495 _runtime_cpudetection=no
496 _cross_compile=auto
497 _prefix="/usr/local"
498 _libavutil_a=auto
499 _libavutil_so=auto
500 _libavcodec_a=auto
501 _libamr_nb=auto
502 _libamr_wb=auto
503 _libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
504 _libavdecoders=` echo $_libavdecoders_all | sed -e s/LIBFAAD_DECODER// -e s/MPEG4AAC_DECODER// -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_DECODER// `
505 _libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
506 _libavencoders=` echo $_libavencoders_all | sed -e s/LIBGSM_ENCODER// -e s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_ENCODER// `
507 _libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
508 _libavparsers=$_libavparsers_all
509 _libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'`
510 _libavbsfs=$_libavbsfs_all
511 _libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
512 _libavdemuxers=`echo $_libavdemuxers_all | sed -e s/AUDIO_BEOS_DEMUXER// -e s/OSS_DEMUXER// -e s/DC1394_DEMUXER// -e s/DV1394_DEMUXER// -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/V4L_DEMUXER// -e s/BKTR_DEMUXER// -e s/X11_GRAB_DEVICE_DEMUXER// -e s/V4L2_DEMUXER// -e s/LIBNUT_DEMUXER// -e s/AVISYNTH_DEMUXER// `
513 _libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
514 _libavmuxers=`echo $_libavmuxers_all | sed -e s/AUDIO_BEOS_MUXER// -e s/OSS_MUXER// -e s/RTP_MUXER// `
515 _libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
516 _libavcodec_so=auto
517 _libavformat_a=auto
518 _libavformat_so=auto
519 _libpostproc_a=auto
520 _libpostproc_so=auto
521 _libavcodec_mpegaudio_hp=yes
522 _mencoder=yes
523 _mplayer=yes
524 _x11=auto
525 _xshape=auto
526 _dga1=auto
527 _dga2=auto
528 _xv=auto
529 _xvmc=no #auto when complete
530 _sdl=auto
531 _directx=auto
532 _win32waveout=auto
533 _nas=auto
534 _png=auto
535 _jpeg=auto
536 _pnm=yes
537 _md5sum=yes
538 _gif=auto
539 _gl=auto
540 _ggi=auto
541 _ggiwmh=auto
542 _aa=auto
543 _caca=auto
544 _svga=auto
545 _vesa=auto
546 _fbdev=auto
547 _dvb=auto
548 _dvbhead=auto
549 _dxr2=auto
550 _dxr3=auto
551 _ivtv=auto
552 _v4l2=auto
553 _iconv=auto
554 _langinfo=auto
555 _rtc=auto
556 _ossaudio=auto
557 _arts=auto
558 _esd=auto
559 _polyp=auto
560 _jack=auto
561 _openal=auto
562 _libcdio=auto
563 _liblzo=auto
564 _mad=auto
565 _toolame=auto
566 _twolame=auto
567 _tremor_internal=yes
568 _tremor_low=no
569 _tremor_external=auto
570 _libvorbis=auto
571 _speex=auto
572 _theora=auto
573 _mp3lib=yes
574 _liba52=yes
575 _libdca=auto
576 _libmpeg2=yes
577 _faad_internal=auto
578 _faad_external=auto
579 _faad_fixed=no
580 _faac=auto
581 _ladspa=auto
582 _xmms=no
583 _dvdnav=auto
584 _dvdnavconfig=dvdnav-config
585 _dvdread=auto
586 _dvdread_internal=auto
587 _libdvdcss_internal=auto
588 _xanim=auto
589 _real=auto
590 _live=auto
591 _nemesi=auto
592 _native_rtsp=yes
593 _xinerama=auto
594 _mga=auto
595 _xmga=auto
596 _vm=auto
597 _xf86keysym=auto
598 _mlib=no #broken, thus disabled
599 _sgiaudio=auto
600 _sunaudio=auto
601 _alsa=auto
602 _fastmemcpy=yes
603 _unrarlib=yes
604 _win32dll=auto
605 _select=yes
606 _radio=no
607 _radio_capture=no
608 _radio_v4l=auto
609 _radio_v4l2=auto
610 _radio_bsdbt848=auto
611 _tv=yes
612 _tv_v4l1=auto
613 _tv_v4l2=auto
614 _tv_bsdbt848=auto
615 _tv_teletext=auto
616 _pvr=auto
617 _network=yes
618 _winsock2=auto
619 _smbsupport=auto
620 _vidix_internal=auto
621 _vidix_external=auto
622 _joystick=no
623 _xvid=auto
624 _x264=auto
625 _libnut=auto
626 _lirc=auto
627 _lircc=auto
628 _apple_remote=auto
629 _gui=no
630 _gtk1=no
631 _termcap=auto
632 _termios=auto
633 _3dfx=no
634 _s3fb=no
635 _tdfxfb=no
636 _tdfxvid=no
637 _xvr100=auto
638 _tga=yes
639 _directfb=auto
640 _zr=auto
641 _bl=no
642 _largefiles=no
643 #_language=en
644 _shm=auto
645 _linux_devfs=no
646 _charset="UTF-8"
647 _dynamic_plugins=no
648 _crash_debug=no
649 _sighandler=yes
650 _libdv=auto
651 _cdparanoia=auto
652 _cddb=auto
653 _big_endian=auto
654 _bitmap_font=yes
655 _freetype=auto
656 _fontconfig=auto
657 _menu=no
658 _qtx=auto
659 _macosx=auto
660 _maemo=auto
661 _macosx_finder_support=no
662 _macosx_bundle=auto
663 _sortsub=yes
664 _freetypeconfig='freetype-config'
665 _fribidi=auto
666 _fribidiconfig='fribidi-config'
667 _enca=auto
668 _inet6=auto
669 _gethostbyname2=auto
670 _ftp=yes
671 _musepack=auto
672 _vstream=auto
673 _pthreads=auto
674 _w32threads=auto
675 _ass=auto
676 _rpath=no
677 _asmalign_pot=auto
678 _color_console=no
679 _stream_cache=yes
680 _def_stream_cache="#define USE_STREAM_CACHE 1"
681 _need_shmem=yes
682 for ac_option do
683 case "$ac_option" in
684 --help|-help|-h)
685 show_help
687 --prefix=*)
688 _prefix=`echo $ac_option | cut -d '=' -f 2`
690 --bindir=*)
691 _bindir=`echo $ac_option | cut -d '=' -f 2`
693 --datadir=*)
694 _datadir=`echo $ac_option | cut -d '=' -f 2`
696 --mandir=*)
697 _mandir=`echo $ac_option | cut -d '=' -f 2`
699 --confdir=*)
700 _confdir=`echo $ac_option | cut -d '=' -f 2`
702 --libdir=*)
703 _libdir=`echo $ac_option | cut -d '=' -f 2`
705 --codecsdir=*)
706 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
708 --win32codecsdir=*)
709 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
711 --xanimcodecsdir=*)
712 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
714 --realcodecsdir=*)
715 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
717 --with-extraincdir=*)
718 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
720 --with-extralibdir=*)
721 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
724 --with-install=*)
725 _install=`echo $ac_option | cut -d '=' -f 2 `
727 --with-xvmclib=*)
728 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
731 --with-sdl-config=*)
732 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
734 --with-freetype-config=*)
735 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
737 --with-fribidi-config=*)
738 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
740 --with-gtk-config=*)
741 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
743 --with-glib-config=*)
744 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
746 --with-dvdnav-config=*)
747 _dvdnavconfig=`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 --charset=*)
779 _charset=`echo $ac_option | cut -d '=' -f 2`
781 --language=*)
782 _language=`echo $ac_option | cut -d '=' -f 2`
785 --enable-static)
786 _ld_static='-static'
788 --disable-static)
789 _ld_static=''
791 --enable-profile)
792 _profile='-p'
794 --disable-profile)
795 _profile=
797 --enable-debug)
798 _debug='-g'
800 --enable-debug=*)
801 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
803 --disable-debug)
804 _debug=
806 --enable-gcc-check) _gcc_check=yes ;;
807 --disable-gcc-check) _gcc_check=no ;;
808 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
809 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
810 --enable-cross-compile) _cross_compile=yes ;;
811 --disable-cross-compile) _cross_compile=no ;;
812 --enable-mencoder) _mencoder=yes ;;
813 --disable-mencoder) _mencoder=no ;;
814 --enable-mplayer) _mplayer=yes ;;
815 --disable-mplayer) _mplayer=no ;;
816 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
817 --disable-dynamic-plugins) _dynamic_plugins=no ;;
818 --enable-x11) _x11=yes ;;
819 --disable-x11) _x11=no ;;
820 --enable-xshape) _xshape=yes ;;
821 --disable-xshape) _xshape=no ;;
822 --enable-xv) _xv=yes ;;
823 --disable-xv) _xv=no ;;
824 --enable-xvmc) _xvmc=yes ;;
825 --disable-xvmc) _xvmc=no ;;
826 --enable-sdl) _sdl=yes ;;
827 --disable-sdl) _sdl=no ;;
828 --enable-directx) _directx=yes ;;
829 --disable-directx) _directx=no ;;
830 --enable-win32waveout) _win32waveout=yes ;;
831 --disable-win32waveout) _win32waveout=no ;;
832 --enable-nas) _nas=yes ;;
833 --disable-nas) _nas=no ;;
834 --enable-png) _png=yes ;;
835 --disable-png) _png=no ;;
836 --enable-jpeg) _jpeg=yes ;;
837 --disable-jpeg) _jpeg=no ;;
838 --enable-pnm) _pnm=yes ;;
839 --disable-pnm) _pnm=no ;;
840 --enable-md5sum) _md5sum=yes ;;
841 --disable-md5sum) _md5sum=no ;;
842 --enable-gif) _gif=yes ;;
843 --disable-gif) _gif=no ;;
844 --enable-gl) _gl=yes ;;
845 --disable-gl) _gl=no ;;
846 --enable-ggi) _ggi=yes ;;
847 --disable-ggi) _ggi=no ;;
848 --enable-ggiwmh) _ggiwmh=yes ;;
849 --disable-ggiwmh) _ggiwmh=no ;;
850 --enable-aa) _aa=yes ;;
851 --disable-aa) _aa=no ;;
852 --enable-caca) _caca=yes ;;
853 --disable-caca) _caca=no ;;
854 --enable-svga) _svga=yes ;;
855 --disable-svga) _svga=no ;;
856 --enable-vesa) _vesa=yes ;;
857 --disable-vesa) _vesa=no ;;
858 --enable-fbdev) _fbdev=yes ;;
859 --disable-fbdev) _fbdev=no ;;
860 --enable-dvb) _dvb=yes ;;
861 --disable-dvb) _dvb=no ;;
862 --enable-dvbhead) _dvbhead=yes ;;
863 --disable-dvbhead) _dvbhead=no ;;
864 --enable-dxr2) _dxr2=yes ;;
865 --disable-dxr2) _dxr2=no ;;
866 --enable-dxr3) _dxr3=yes ;;
867 --disable-dxr3) _dxr3=no ;;
868 --enable-ivtv) _ivtv=yes ;;
869 --disable-ivtv) _ivtv=no ;;
870 --enable-v4l2) _v4l2=yes ;;
871 --disable-v4l2) _v4l2=no ;;
872 --enable-iconv) _iconv=yes ;;
873 --disable-iconv) _iconv=no ;;
874 --enable-langinfo) _langinfo=yes ;;
875 --disable-langinfo) _langinfo=no ;;
876 --enable-rtc) _rtc=yes ;;
877 --disable-rtc) _rtc=no ;;
878 --enable-libdv) _libdv=yes ;;
879 --disable-libdv) _libdv=no ;;
880 --enable-ossaudio) _ossaudio=yes ;;
881 --disable-ossaudio) _ossaudio=no ;;
882 --enable-arts) _arts=yes ;;
883 --disable-arts) _arts=no ;;
884 --enable-esd) _esd=yes ;;
885 --disable-esd) _esd=no ;;
886 --enable-polyp) _polyp=yes ;;
887 --disable-polyp) _polyp=no ;;
888 --enable-jack) _jack=yes ;;
889 --disable-jack) _jack=no ;;
890 --enable-openal) _openal=yes ;;
891 --disable-openal) _openal=no ;;
892 --enable-mad) _mad=yes ;;
893 --disable-mad) _mad=no ;;
894 --enable-toolame) _toolame=yes ;;
895 --disable-toolame) _toolame=no ;;
896 --enable-twolame) _twolame=yes ;;
897 --disable-twolame) _twolame=no ;;
898 --enable-libcdio) _libcdio=yes ;;
899 --disable-libcdio) _libcdio=no ;;
900 --enable-liblzo) _liblzo=yes ;;
901 --disable-liblzo) _liblzo=no ;;
902 --enable-libvorbis) _libvorbis=yes ;;
903 --disable-libvorbis) _libvorbis=no ;;
904 --enable-speex) _speex=yes ;;
905 --disable-speex) _speex=no ;;
906 --enable-tremor-internal) _tremor_internal=yes ;;
907 --disable-tremor-internal) _tremor_internal=no ;;
908 --enable-tremor-low) _tremor_low=yes ;;
909 --disable-tremor-low) _tremor_low=no ;;
910 --enable-tremor-external) _tremor_external=yes ;;
911 --disable-tremor-external) _tremor_external=no ;;
912 --enable-theora) _theora=yes ;;
913 --disable-theora) _theora=no ;;
914 --enable-mp3lib) _mp3lib=yes ;;
915 --disable-mp3lib) _mp3lib=no ;;
916 --enable-liba52) _liba52=yes ;;
917 --disable-liba52) _liba52=no ;;
918 --enable-libdca) _libdca=yes ;;
919 --disable-libdca) _libdca=no ;;
920 --enable-libmpeg2) _libmpeg2=yes ;;
921 --disable-libmpeg2) _libmpeg2=no ;;
922 --enable-musepack) _musepack=yes ;;
923 --disable-musepack) _musepack=no ;;
924 --enable-faad-internal) _faad_internal=yes ;;
925 --disable-faad-internal) _faad_internal=no ;;
926 --enable-faad-external) _faad_external=yes ;;
927 --disable-faad-external) _faad_external=no ;;
928 --enable-faad-fixed) _faad_fixed=yes ;;
929 --disable-faad-fixed) _faad_fixed=no ;;
930 --enable-faac) _faac=yes ;;
931 --disable-faac) _faac=no ;;
932 --enable-ladspa) _ladspa=yes ;;
933 --disable-ladspa) _ladspa=no ;;
934 --enable-xmms) _xmms=yes ;;
935 --disable-xmms) _xmms=no ;;
936 --enable-dvdread) _dvdread=yes ;;
937 --disable-dvdread) _dvdread=no ;;
938 --enable-dvdread-internal) _dvdread_internal=yes ;;
939 --disable-dvdread-internal) _dvdread_internal=no ;;
940 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
941 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
942 --enable-dvdnav) _dvdnav=yes ;;
943 --disable-dvdnav) _dvdnav=no ;;
944 --enable-xanim) _xanim=yes ;;
945 --disable-xanim) _xanim=no ;;
946 --enable-real) _real=yes ;;
947 --disable-real) _real=no ;;
948 --enable-live) _live=yes ;;
949 --disable-live) _live=no ;;
950 --enable-nemesi) _nemesi=yes ;;
951 --disable-nemesi) _nemesi=no ;;
952 --enable-xinerama) _xinerama=yes ;;
953 --disable-xinerama) _xinerama=no ;;
954 --enable-mga) _mga=yes ;;
955 --disable-mga) _mga=no ;;
956 --enable-xmga) _xmga=yes ;;
957 --disable-xmga) _xmga=no ;;
958 --enable-vm) _vm=yes ;;
959 --disable-vm) _vm=no ;;
960 --enable-xf86keysym) _xf86keysym=yes ;;
961 --disable-xf86keysym) _xf86keysym=no ;;
962 --enable-mlib) _mlib=yes ;;
963 --disable-mlib) _mlib=no ;;
964 --enable-sunaudio) _sunaudio=yes ;;
965 --disable-sunaudio) _sunaudio=no ;;
966 --enable-sgiaudio) _sgiaudio=yes ;;
967 --disable-sgiaudio) _sgiaudio=no ;;
968 --enable-alsa) _alsa=yes ;;
969 --disable-alsa) _alsa=no ;;
970 --enable-tv) _tv=yes ;;
971 --disable-tv) _tv=no ;;
972 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
973 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
974 --enable-tv-v4l1) _tv_v4l1=yes ;;
975 --disable-tv-v4l1) _tv_v4l1=no ;;
976 --enable-tv-v4l2) _tv_v4l2=yes ;;
977 --disable-tv-v4l2) _tv_v4l2=no ;;
978 --enable-tv-teletext) _tv_teletext=yes ;;
979 --disable-tv-teletext) _tv_teletext=no ;;
980 --enable-radio) _radio=yes ;;
981 --enable-radio-capture) _radio_capture=yes ;;
982 --disable-radio-capture) _radio_capture=no ;;
983 --disable-radio) _radio=no ;;
984 --enable-radio-v4l) _radio_v4l=yes ;;
985 --disable-radio-v4l) _radio_v4l=no ;;
986 --enable-radio-v4l2) _radio_v4l2=yes ;;
987 --disable-radio-v4l2) _radio_v4l2=no ;;
988 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
989 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
990 --enable-pvr) _pvr=yes ;;
991 --disable-pvr) _pvr=no ;;
992 --enable-fastmemcpy) _fastmemcpy=yes ;;
993 --disable-fastmemcpy) _fastmemcpy=no ;;
994 --enable-network) _network=yes ;;
995 --disable-network) _network=no ;;
996 --enable-winsock2) _winsock2=yes ;;
997 --disable-winsock2) _winsock2=no ;;
998 --enable-smb) _smbsupport=yes ;;
999 --disable-smb) _smbsupport=no ;;
1000 --enable-vidix-internal) _vidix_internal=yes ;;
1001 --disable-vidix-internal) _vidix_internal=no ;;
1002 --enable-vidix-external) _vidix_external=yes ;;
1003 --disable-vidix-external) _vidix_external=no ;;
1004 --with-vidix-drivers=*)
1005 _vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
1007 --enable-joystick) _joystick=yes ;;
1008 --disable-joystick) _joystick=no ;;
1009 --enable-xvid) _xvid=yes ;;
1010 --disable-xvid) _xvid=no ;;
1011 --enable-x264) _x264=yes ;;
1012 --disable-x264) _x264=no ;;
1013 --enable-libnut) _libnut=yes ;;
1014 --disable-libnut) _libnut=no ;;
1015 --enable-libavutil_a) _libavutil_a=yes ;;
1016 --disable-libavutil_a) _libavutil_a=no ;;
1017 --enable-libavutil_so) _libavutil_so=yes ;;
1018 --disable-libavutil_so) _libavutil_so=no ;;
1019 --enable-libavcodec_a) _libavcodec_a=yes ;;
1020 --disable-libavcodec_a) _libavcodec_a=no ;;
1021 --enable-libavcodec_so) _libavcodec_so=yes ;;
1022 --disable-libavcodec_so) _libavcodec_so=no ;;
1023 --enable-libamr_nb) _libamr_nb=yes ;;
1024 --disable-libamr_nb) _libamr_nb=no ;;
1025 --enable-libamr_wb) _libamr_wb=yes ;;
1026 --disable-libamr_wb) _libamr_wb=no ;;
1027 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1028 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1029 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1030 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1031 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1032 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1033 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1034 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1035 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1036 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1037 --enable-libavformat_a) _libavformat_a=yes ;;
1038 --disable-libavformat_a) _libavformat_a=no ;;
1039 --enable-libavformat_so) _libavformat_so=yes ;;
1040 --disable-libavformat_so) _libavformat_so=no ;;
1041 --enable-libpostproc_a) _libpostproc_a=yes ;;
1042 --disable-libpostproc_a) _libpostproc_a=no ;;
1043 --enable-libpostproc_so) _libpostproc_so=yes ;;
1044 --disable-libpostproc_so) _libpostproc_so=no ;;
1045 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1046 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1048 --enable-lirc) _lirc=yes ;;
1049 --disable-lirc) _lirc=no ;;
1050 --enable-lircc) _lircc=yes ;;
1051 --disable-lircc) _lircc=no ;;
1052 --enable-apple-remote) _apple_remote=yes ;;
1053 --disable-apple-remote) _apple_remote=no ;;
1054 --enable-gui) _gui=yes ;;
1055 --disable-gui) _gui=no ;;
1056 --enable-gtk1) _gtk1=yes ;;
1057 --disable-gtk1) _gtk1=no ;;
1058 --enable-termcap) _termcap=yes ;;
1059 --disable-termcap) _termcap=no ;;
1060 --enable-termios) _termios=yes ;;
1061 --disable-termios) _termios=no ;;
1062 --enable-3dfx) _3dfx=yes ;;
1063 --disable-3dfx) _3dfx=no ;;
1064 --enable-s3fb) _s3fb=yes ;;
1065 --disable-s3fb) _s3fb=no ;;
1066 --enable-tdfxfb) _tdfxfb=yes ;;
1067 --disable-tdfxfb) _tdfxfb=no ;;
1068 --disable-tdfxvid) _tdfxvid=no ;;
1069 --enable-tdfxvid) _tdfxvid=yes ;;
1070 --disable-xvr100) _xvr100=no ;;
1071 --enable-xvr100) _xvr100=yes ;;
1072 --disable-tga) _tga=no ;;
1073 --enable-tga) _tga=yes ;;
1074 --enable-directfb) _directfb=yes ;;
1075 --disable-directfb) _directfb=no ;;
1076 --enable-zr) _zr=yes ;;
1077 --disable-zr) _zr=no ;;
1078 --enable-bl) _bl=yes ;;
1079 --disable-bl) _bl=no ;;
1080 --enable-mtrr) _mtrr=yes ;;
1081 --disable-mtrr) _mtrr=no ;;
1082 --enable-largefiles) _largefiles=yes ;;
1083 --disable-largefiles) _largefiles=no ;;
1084 --enable-shm) _shm=yes ;;
1085 --disable-shm) _shm=no ;;
1086 --enable-select) _select=yes ;;
1087 --disable-select) _select=no ;;
1088 --enable-linux-devfs) _linux_devfs=yes ;;
1089 --disable-linux-devfs) _linux_devfs=no ;;
1090 --enable-cdparanoia) _cdparanoia=yes ;;
1091 --disable-cdparanoia) _cdparanoia=no ;;
1092 --enable-cddb) _cddb=yes ;;
1093 --disable-cddb) _cddb=no ;;
1094 --enable-big-endian) _big_endian=yes ;;
1095 --disable-big-endian) _big_endian=no ;;
1096 --enable-bitmap-font) _bitmap_font=yes ;;
1097 --disable-bitmap-font) _bitmap_font=no ;;
1098 --enable-freetype) _freetype=yes ;;
1099 --disable-freetype) _freetype=no ;;
1100 --enable-fontconfig) _fontconfig=yes ;;
1101 --disable-fontconfig) _fontconfig=no ;;
1102 --enable-unrarlib) _unrarlib=yes ;;
1103 --disable-unrarlib) _unrarlib=no ;;
1104 --enable-ftp) _ftp=yes ;;
1105 --disable-ftp) _ftp=no ;;
1106 --enable-vstream) _vstream=yes ;;
1107 --disable-vstream) _vstream=no ;;
1108 --enable-pthreads) _pthreads=yes ;;
1109 --disable-pthreads) _pthreads=no ;;
1110 --enable-w32threads) _w32threads=yes ;;
1111 --disable-w32threads) _w32threads=no ;;
1112 --enable-ass) _ass=yes ;;
1113 --disable-ass) _ass=no ;;
1114 --enable-rpath) _rpath=yes ;;
1115 --disable-rpath) _rpath=no ;;
1116 --enable-color-console) _color_console=yes ;;
1117 --disable-color-console) _color_console=no ;;
1119 --enable-fribidi) _fribidi=yes ;;
1120 --disable-fribidi) _fribidi=no ;;
1122 --enable-enca) _enca=yes ;;
1123 --disable-enca) _enca=no ;;
1125 --enable-inet6) _inet6=yes ;;
1126 --disable-inet6) _inet6=no ;;
1128 --enable-gethostbyname2) _gethostbyname2=yes ;;
1129 --disable-gethostbyname2) _gethostbyname2=no ;;
1131 --enable-dga1) _dga1=yes ;;
1132 --disable-dga1) _dga1=no ;;
1133 --enable-dga2) _dga2=yes ;;
1134 --disable-dga2) _dga2=no ;;
1136 --enable-menu) _menu=yes ;;
1137 --disable-menu) _menu=no ;;
1139 --enable-qtx) _qtx=yes ;;
1140 --disable-qtx) _qtx=no ;;
1142 --enable-macosx) _macosx=yes ;;
1143 --disable-macosx) _macosx=no ;;
1144 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1145 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1146 --enable-macosx-bundle) _macosx_bundle=yes;;
1147 --disable-macosx-bundle) _macosx_bundle=no;;
1149 --enable-maemo) _maemo=yes ;;
1150 --disable-maemo) _maemo=no ;;
1152 --enable-sortsub) _sortsub=yes ;;
1153 --disable-sortsub) _sortsub=no ;;
1155 --enable-crash-debug) _crash_debug=yes ;;
1156 --disable-crash-debug) _crash_debug=no ;;
1157 --enable-sighandler) _sighandler=yes ;;
1158 --disable-sighandler) _sighandler=no ;;
1159 --enable-win32dll) _win32dll=yes ;;
1160 --disable-win32dll) _win32dll=no ;;
1162 --enable-sse) _sse=yes ;;
1163 --disable-sse) _sse=no ;;
1164 --enable-sse2) _sse2=yes ;;
1165 --disable-sse2) _sse2=no ;;
1166 --enable-ssse3) _ssse3=yes ;;
1167 --disable-ssse3) _ssse3=no ;;
1168 --enable-mmxext) _mmxext=yes ;;
1169 --disable-mmxext) _mmxext=no ;;
1170 --enable-3dnow) _3dnow=yes ;;
1171 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1172 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1173 --disable-3dnowext) _3dnowext=no ;;
1174 --enable-cmov) _cmov=yes ;;
1175 --disable-cmov) _cmov=no ;;
1176 --enable-fast-cmov) _fast_cmov=yes ;;
1177 --disable-fast-cmov) _fast_cmov=no ;;
1178 --enable-altivec) _altivec=yes ;;
1179 --disable-altivec) _altivec=no ;;
1180 --enable-armv5te) _armv5te=yes ;;
1181 --disable-armv5te) _armv5te=no ;;
1182 --enable-armv6) _armv6=yes ;;
1183 --disable-armv6) _armv6=no ;;
1184 --enable-iwmmxt) _iwmmxt=yes ;;
1185 --disable-iwmmxt) _iwmmxt=no ;;
1186 --enable-mmx) _mmx=yes ;;
1187 --disable-mmx) # 3Dnow! and MMX2 require MMX
1188 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1191 echo "Unknown parameter: $ac_option"
1192 exit 1
1195 esac
1196 done
1198 # Atmos: moved this here, to be correct, if --prefix is specified
1199 test -z "$_bindir" && _bindir="$_prefix/bin"
1200 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1201 test -z "$_mandir" && _mandir="$_prefix/share/man"
1202 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1203 test -z "$_libdir" && _libdir="$_prefix/lib"
1205 # Determine our OS name and CPU architecture
1206 if test -z "$_target" ; then
1207 # OS name
1208 system_name=`uname -s 2>&1`
1209 case "$system_name" in
1210 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX|AmigaOS)
1212 IRIX*)
1213 system_name=IRIX
1215 GNU/kFreeBSD)
1216 system_name=FreeBSD
1218 HP-UX*)
1219 system_name=HP-UX
1221 [cC][yY][gG][wW][iI][nN]*)
1222 system_name=CYGWIN
1224 MINGW32*)
1225 system_name=MINGW32
1228 system_name="$system_name-UNKNOWN"
1230 esac
1233 # host's CPU/instruction set
1234 host_arch=`uname -p 2>&1`
1235 case "$host_arch" in
1236 i386|sparc|ppc|alpha|arm|sh3|mips|vax)
1238 powerpc) # Darwin returns 'powerpc'
1239 host_arch=ppc
1241 *) # uname -p on Linux returns 'unknown' for the processor type,
1242 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1244 # Maybe uname -m (machine hardware name) returns something we
1245 # recognize.
1247 # x86/x86pc is used by QNX
1248 case "`uname -m 2>&1`" in
1249 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 ;;
1250 ia64) host_arch=ia64 ;;
1251 x86_64|amd64)
1252 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
1253 -z "`echo $CFLAGS | grep -- -m32`" ]; then
1254 host_arch=x86_64
1255 else
1256 host_arch=i386
1259 macppc|ppc|ppc64) host_arch=ppc ;;
1260 alpha) host_arch=alpha ;;
1261 sparc) host_arch=sparc ;;
1262 sparc64) host_arch=sparc64 ;;
1263 parisc*|hppa*|9000*) host_arch=hppa ;;
1264 arm*|zaurus|cats) host_arch=arm ;;
1265 sh3) host_arch=sh3 ;;
1266 s390) host_arch=s390 ;;
1267 s390x) host_arch=s390x ;;
1268 mips*) host_arch=mips ;;
1269 vax) host_arch=vax ;;
1270 *) host_arch=UNKNOWN ;;
1271 esac
1273 esac
1274 else # if test -z "$_target"
1275 system_name=`echo $_target | cut -d '-' -f 2`
1276 case "`echo $system_name | tr A-Z a-z`" in
1277 linux) system_name=Linux ;;
1278 freebsd) system_name=FreeBSD ;;
1279 gnu/kfreebsd) system_name=FreeBSD ;;
1280 netbsd) system_name=NetBSD ;;
1281 bsd/os) system_name=BSD/OS ;;
1282 openbsd) system_name=OpenBSD ;;
1283 sunos) system_name=SunOS ;;
1284 qnx) system_name=QNX ;;
1285 morphos) system_name=MorphOS ;;
1286 amigaos) system_name=AmigaOS ;;
1287 mingw32msvc) system_name=MINGW32 ;;
1288 esac
1289 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1290 host_arch=`echo $_target | cut -d '-' -f 1`
1291 if test `echo $host_arch` != "x86_64" ; then
1292 host_arch=`echo $host_arch | tr '_' '-'`
1296 echo "Detected operating system: $system_name"
1297 echo "Detected host architecture: $host_arch"
1299 if test "$_runtime_cpudetection" = yes && not x86 && not ppc; then
1300 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1304 if openbsd ; then
1305 _ldconfig="ldconfig -R"
1308 if freebsd ; then
1309 _ld_extra="$_ld_extra -L/usr/local/lib"
1310 _inc_extra="$_inc_extra -I/usr/local/include"
1313 if darwin; then
1314 _ld_extra="$_ld_extra -L/usr/local/lib"
1315 _inc_extra="$_inc_extra -I/usr/local/include"
1318 if aix ; then
1319 _ld_extra="$_ld_extra -lC"
1322 if irix ; then
1323 _ranlib='ar -r'
1324 elif linux ; then
1325 _ranlib='true'
1328 if win32 ; then
1329 _exesuf=".exe"
1330 # -lwinmm is always needed for osdep/timer-win2.c
1331 _ld_extra="$_ld_extra -lwinmm"
1332 _confwin32='TARGET_WIN32 = yes'
1333 else
1334 _confwin32='TARGET_WIN32 = no'
1337 if mingw32 ; then
1338 _need_shmem=no
1341 if cygwin ; then
1342 _def_confwin32='#define WIN32'
1345 if amigaos ; then
1346 _select=no
1347 _sighandler=no
1348 _stream_cache=no
1349 _def_stream_cache="#undef USE_STREAM_CACHE"
1352 if qnx ; then
1353 _ld_extra="$_ld_extra -lph"
1356 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1357 test "$I" && break
1358 done
1361 TMPLOG="configure.log"
1362 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1363 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1364 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1365 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1366 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1368 rm -f "$TMPLOG"
1369 echo configuration: $_configuration > "$TMPLOG"
1370 echo >> "$TMPLOG"
1373 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
1374 # if used as 'head -1' instead of 'head -n 1', but older versions don't
1375 # know about '-n'.
1376 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
1377 _head() { head -$1 2>/dev/null ; }
1378 else
1379 _head() { head -n $1 2>/dev/null ; }
1381 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
1382 _tail() { tail -$1 2>/dev/null ; }
1383 else
1384 _tail() { tail -n $1 2>/dev/null ; }
1387 # Checking CC version...
1388 if test "$_gcc_check" = yes ; then
1389 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1390 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
1391 echocheck "$_cc version"
1392 cc_vendor=intel
1393 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
1394 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
1395 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1396 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1397 # TODO verify older icc/ecc compatibility
1398 case $cc_version in
1400 cc_version="v. ?.??, bad"
1401 cc_verc_fail=yes
1403 8.0|9.1|10.0)
1404 cc_version="$cc_version, ok"
1405 cc_verc_fail=no
1408 cc_version="$cc_version, bad"
1409 cc_verc_fail=yes
1411 esac
1412 echores "$cc_version"
1413 else
1414 for _cc in "$_cc" gcc cc ; do
1415 echocheck "$_cc version"
1416 cc_vendor=gnu
1417 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
1418 cc_version=`$_cc -dumpversion 2>&1`
1419 if test "$?" -gt 0; then
1420 cc_version="not found"
1422 case $cc_version in
1424 cc_version="v. ?.??, bad"
1425 cc_verc_fail=yes
1427 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
1428 _cc_major=`echo $cc_version | cut -d '.' -f 1`
1429 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
1430 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
1431 cc_version="$cc_version, ok"
1432 cc_verc_fail=no
1434 'not found')
1435 cc_verc_fail=yes
1438 cc_version="$cc_version, bad"
1439 cc_verc_fail=yes
1441 esac
1442 echores "$cc_version"
1443 test "$cc_verc_fail" = "no" && break
1444 done
1445 fi # icc
1446 if test "$cc_verc_fail" = yes ; then
1447 cat <<EOF
1449 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
1451 You are not using a supported compiler. We do not have the time to make sure
1452 everything works with compilers other than the ones we use. Use either the
1453 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
1454 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
1456 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
1457 mplayer and lame (which is used for mencoder). If you get compile errors,
1458 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
1459 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
1460 bugs!
1462 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
1465 die "Bad gcc version"
1467 else
1468 cat <<EOF
1470 ******************************************************************************
1472 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
1473 Ok. You know. Do it.
1475 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
1476 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
1477 Lame which is used by mencoder produces weird errors, too.
1479 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
1480 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
1482 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
1484 ******************************************************************************
1488 read _answer
1491 echocheck "host cc"
1492 test "$_host_cc" || _host_cc=$_cc
1493 echores $_host_cc
1495 echocheck "cross compilation"
1496 if test $_cross_compile = auto ; then
1497 cat > $TMPC << EOF
1498 int main() { return 0; }
1500 _cross_compile=yes
1501 cc_check && "$TMPEXE" && _cross_compile=no
1503 echores $_cross_compile
1505 if test $_cross_compile = yes; then
1506 tmp_run() {
1507 return 0
1511 # ---
1513 # now that we know what compiler should be used for compilation, try to find
1514 # out which assembler is used by the $_cc compiler
1515 if test "$_as" = auto ; then
1516 _as=`$_cc -print-prog-name=as`
1517 test -z "$_as" && _as=as
1520 # XXX: this should be ok..
1521 _cpuinfo="echo"
1523 if test "$_runtime_cpudetection" = no ; then
1525 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1526 # FIXME: Remove the cygwin check once AMD CPUs are supported
1527 if test -r /proc/cpuinfo && not cygwin; then
1528 # Linux with /proc mounted, extract CPU information from it
1529 _cpuinfo="cat /proc/cpuinfo"
1530 elif test -r /compat/linux/proc/cpuinfo && not x86_32 ; then
1531 # FreeBSD with Linux emulation /proc mounted,
1532 # extract CPU information from it
1533 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1534 elif darwin && not x86_32 ; then
1535 # use hostinfo on Darwin
1536 _cpuinfo="hostinfo"
1537 elif aix; then
1538 # use 'lsattr' on AIX
1539 _cpuinfo="lsattr -E -l proc0 -a type"
1540 elif x86; then
1541 # all other OSes try to extract CPU information from a small helper
1542 # program cpuinfo instead
1543 $_cc -o cpuinfo$_exesuf cpuinfo.c
1544 _cpuinfo="./cpuinfo$_exesuf"
1547 if x86 ; then
1548 # gather more CPU information
1549 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
1550 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1551 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1552 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1553 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
1555 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
1557 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1558 -e s/xmm/sse/ -e s/kni/sse/`
1560 for ext in $pparam ; do
1561 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1562 done
1564 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1565 test $_sse = kernel_check && _mmxext=kernel_check
1567 echocheck "CPU vendor"
1568 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1570 echocheck "CPU type"
1571 echores "$pname"
1574 fi # test "$_runtime_cpudetection" = no
1576 if x86 && test "$_runtime_cpudetection" = no ; then
1577 extcheck() {
1578 if test "$1" = kernel_check ; then
1579 echocheck "kernel support of $2"
1580 cat > $TMPC <<EOF
1581 #include <signal.h>
1582 void catch() { exit(1); }
1583 int main(void){
1584 signal(SIGILL, catch);
1585 __asm__ __volatile__ ("$3":::"memory");return(0);
1589 if cc_check && tmp_run ; then
1590 eval _$2=yes
1591 echores "yes"
1592 _optimizing="$_optimizing $2"
1593 return 0
1594 else
1595 eval _$2=no
1596 echores "failed"
1597 echo "It seems that your kernel does not correctly support $2."
1598 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1599 return 1
1602 return 0
1605 extcheck $_mmx "mmx" "emms"
1606 extcheck $_mmxext "mmxext" "sfence"
1607 extcheck $_3dnow "3dnow" "femms"
1608 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1609 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1610 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1611 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1612 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1614 echocheck "mtrr support"
1615 if test "$_mtrr" = kernel_check ; then
1616 _mtrr="yes"
1617 _optimizing="$_optimizing mtrr"
1619 echores "$_mtrr"
1621 if test "$_gcc3_ext" != ""; then
1622 # if we had to disable sse/sse2 because the active kernel does not
1623 # support this instruction set extension, we also have to tell
1624 # gcc3 to not generate sse/sse2 instructions for normal C code
1625 cat > $TMPC << EOF
1626 int main(void) { return 0; }
1628 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1634 _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM ARMV4L SH3 POWERPC PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN GENERIC'
1635 case "$host_arch" in
1636 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1637 _arch='X86 X86_32'
1638 _target_arch_x86="ARCH_X86 = yes"
1639 _target_arch="ARCH_X86_32 = yes"
1640 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1641 iproc=486
1642 proc=i486
1645 if test "$_runtime_cpudetection" = no ; then
1646 case "$pvendor" in
1647 AuthenticAMD)
1648 case "$pfamily" in
1649 3) proc=i386 iproc=386 ;;
1650 4) proc=i486 iproc=486 ;;
1651 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1652 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1653 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1654 proc=k6-3
1655 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1656 proc=geode
1657 elif test "$pmodel" -ge 8; then
1658 proc=k6-2
1659 elif test "$pmodel" -ge 6; then
1660 proc=k6
1661 else
1662 proc=i586
1665 6) iproc=686
1666 # It's a bit difficult to determine the correct type of Family 6
1667 # AMD CPUs just from their signature. Instead, we check directly
1668 # whether it supports SSE.
1669 if test "$_sse" = yes; then
1670 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1671 proc=athlon-xp
1672 else
1673 # Again, gcc treats athlon and athlon-tbird similarly.
1674 proc=athlon
1677 15) iproc=686
1678 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1679 # caught and remedied in the optimization tests below.
1680 proc=k8
1683 *) proc=k8 iproc=686 ;;
1684 esac
1686 GenuineIntel)
1687 case "$pfamily" in
1688 3) proc=i386 iproc=386 ;;
1689 4) proc=i486 iproc=486 ;;
1690 5) iproc=586
1691 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1692 proc=pentium-mmx # 4 is desktop, 8 is mobile
1693 else
1694 proc=i586
1697 6) iproc=686
1698 if test "$pmodel" -ge 15; then
1699 proc=core2
1700 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1701 proc=pentium-m
1702 elif test "$pmodel" -ge 7; then
1703 proc=pentium3
1704 elif test "$pmodel" -ge 3; then
1705 proc=pentium2
1706 else
1707 proc=i686
1710 15) iproc=686
1711 # A nocona in 32-bit mode has no more capabilities than a prescott.
1712 if test "$pmodel" -ge 3; then
1713 proc=prescott
1714 else
1715 proc=pentium4
1717 test $_fast_cmov = "auto" && _fast_cmov=no
1719 *) proc=prescott iproc=686 ;;
1720 esac
1722 CentaurHauls)
1723 case "$pfamily" in
1724 5) iproc=586
1725 if test "$pmodel" -ge 8; then
1726 proc=winchip2
1727 elif test "$pmodel" -ge 4; then
1728 proc=winchip-c6
1729 else
1730 proc=i586
1733 6) iproc=686
1734 if test "$pmodel" -ge 9; then
1735 proc=c3-2
1736 else
1737 proc=c3
1738 iproc=586
1741 *) proc=i686 iproc=i686 ;;
1742 esac
1744 unknown)
1745 case "$pfamily" in
1746 3) proc=i386 iproc=386 ;;
1747 4) proc=i486 iproc=486 ;;
1748 *) proc=i586 iproc=586 ;;
1749 esac
1752 proc=i586 iproc=586 ;;
1753 esac
1754 fi # test "$_runtime_cpudetection" = no
1757 # check that gcc supports our CPU, if not, fall back to earlier ones
1758 # LGB: check -mcpu and -march swithing step by step with enabling
1759 # to fall back till 386.
1761 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1763 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1764 cpuopt=-mtune
1765 else
1766 cpuopt=-mcpu
1769 echocheck "GCC & CPU optimization abilities"
1770 cat > $TMPC << EOF
1771 int main(void) { return 0; }
1773 if test "$_runtime_cpudetection" = no ; then
1774 cc_check -march=native && proc=native
1775 if test "$proc" = "k8"; then
1776 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1778 if test "$proc" = "athlon-xp"; then
1779 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1781 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1782 cc_check -march=$proc $cpuopt=$proc || proc=k6
1784 if test "$proc" = "k6" || test "$proc" = "c3"; then
1785 if not cc_check -march=$proc $cpuopt=$proc; then
1786 if cc_check -march=i586 $cpuopt=i686; then
1787 proc=i586-i686
1788 else
1789 proc=i586
1793 if test "$proc" = "prescott" ; then
1794 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1796 if test "$proc" = "core2" ; then
1797 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1799 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
1800 cc_check -march=$proc $cpuopt=$proc || proc=i686
1802 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1803 cc_check -march=$proc $cpuopt=$proc || proc=i586
1805 if test "$proc" = "i586"; then
1806 cc_check -march=$proc $cpuopt=$proc || proc=i486
1808 if test "$proc" = "i486" ; then
1809 cc_check -march=$proc $cpuopt=$proc || proc=i386
1811 if test "$proc" = "i386" ; then
1812 cc_check -march=$proc $cpuopt=$proc || proc=error
1814 if test "$proc" = "error" ; then
1815 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1816 _mcpu=""
1817 _march=""
1818 _optimizing=""
1819 elif test "$proc" = "i586-i686"; then
1820 _march="-march=i586"
1821 _mcpu="$cpuopt=i686"
1822 _optimizing="$proc"
1823 else
1824 _march="-march=$proc"
1825 _mcpu="$cpuopt=$proc"
1826 _optimizing="$proc"
1828 else # if test "$_runtime_cpudetection" = no
1829 _mcpu="$cpuopt=generic"
1830 # at least i486 required, for bswap instruction
1831 _march="-march=i486"
1832 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1833 cc_check $_mcpu || _mcpu=""
1834 cc_check $_march $_mcpu || _march=""
1837 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1838 ## autodetected mcpu/march parameters
1839 if test "$_target" ; then
1840 # TODO: it may be a good idea to check GCC and fall back in all cases
1841 if test "$host_arch" = "i586-i686"; then
1842 _march="-march=i586"
1843 _mcpu="$cpuopt=i686"
1844 else
1845 _march="-march=$host_arch"
1846 _mcpu="$cpuopt=$host_arch"
1849 proc="$host_arch"
1851 case "$proc" in
1852 i386) iproc=386 ;;
1853 i486) iproc=486 ;;
1854 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1855 i686|athlon*|pentium*) iproc=686 ;;
1856 *) iproc=586 ;;
1857 esac
1860 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1861 _fast_cmov="yes"
1862 else
1863 _fast_cmov="no"
1866 echores "$proc"
1869 ia64)
1870 _arch='IA64'
1871 _target_arch='ARCH_IA64 = yes'
1872 iproc='ia64'
1873 proc=''
1874 _march=''
1875 _mcpu=''
1876 _optimizing=''
1879 x86_64|amd64)
1880 _arch='X86 X86_64'
1881 _target_arch='ARCH_X86_64 = yes'
1882 _target_arch_x86="ARCH_X86 = yes"
1883 _def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1884 iproc='x86_64'
1886 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1887 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1888 cpuopt=-mtune
1889 else
1890 cpuopt=-mcpu
1892 if test "$_runtime_cpudetection" = no ; then
1893 case "$pvendor" in
1894 AuthenticAMD)
1895 proc=k8;;
1896 GenuineIntel)
1897 case "$pfamily" in
1898 6) proc=core2;;
1900 # 64-bit prescotts exist, but as far as GCC is concerned they
1901 # have the same capabilities as a nocona.
1902 proc=nocona
1903 test $_fast_cmov = "auto" && _fast_cmov=no
1905 esac
1908 proc=error;;
1909 esac
1910 fi # test "$_runtime_cpudetection" = no
1912 echocheck "GCC & CPU optimization abilities"
1913 cat > $TMPC << EOF
1914 int main(void) { return 0; }
1916 # This is a stripped-down version of the i386 fallback.
1917 if test "$_runtime_cpudetection" = no ; then
1918 cc_check -march=native && proc=native
1919 # --- AMD processors ---
1920 if test "$proc" = "k8"; then
1921 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1923 # This will fail if gcc version < 3.3, which is ok because earlier
1924 # versions don't really support 64-bit on amd64.
1925 # Is this a valid assumption? -Corey
1926 if test "$proc" = "athlon-xp"; then
1927 cc_check -march=$proc $cpuopt=$proc || proc=error
1929 # --- Intel processors ---
1930 if test "$proc" = "core2"; then
1931 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1933 if test "$proc" = "nocona"; then
1934 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1936 if test "$proc" = "pentium4"; then
1937 cc_check -march=$proc $cpuopt=$proc || proc=error
1940 _march="-march=$proc"
1941 _mcpu="$cpuopt=$proc"
1942 if test "$proc" = "error" ; then
1943 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1944 _mcpu=""
1945 _march=""
1947 else # if test "$_runtime_cpudetection" = no
1948 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1949 _march="-march=x86-64"
1950 _mcpu="$cpuopt=generic"
1951 cc_check $_mcpu || _mcpu="x86-64"
1952 cc_check $_mcpu || _mcpu=""
1953 cc_check $_march $_mcpu || _march=""
1956 _optimizing=""
1958 echores "$proc"
1961 sparc)
1962 _arch='SPARC'
1963 _target_arch='ARCH_SPARC = yes'
1964 iproc='sparc'
1965 if sunos ; then
1966 echocheck "CPU type"
1967 karch=`uname -m`
1968 case "`echo $karch`" in
1969 sun4) proc=v7 ;;
1970 sun4c) proc=v7 ;;
1971 sun4d) proc=v8 ;;
1972 sun4m) proc=v8 ;;
1973 sun4u) proc=ultrasparc _vis='yes' ;;
1974 sun4v) proc=v9 ;;
1975 *) proc=v8 ;;
1976 esac
1977 echores "$proc"
1978 else
1979 proc=v8
1981 _march=''
1982 _mcpu="-mcpu=$proc"
1983 _optimizing="$proc"
1986 sparc64)
1987 _arch='SPARC'
1988 _target_arch='ARCH_SPARC = yes'
1989 _vis='yes'
1990 iproc='sparc'
1991 proc='ultrasparc'
1992 _march=''
1993 _mcpu="-mcpu=$proc"
1994 _optimizing="$proc"
1997 arm|armv4l|armv5tel)
1998 _arch='ARM ARMV4L'
1999 _target_arch='ARCH_ARMV4L = yes'
2000 iproc='arm'
2001 proc=''
2002 _march=''
2003 _mcpu=''
2004 _optimizing=''
2007 sh3)
2008 _arch='SH3'
2009 _target_arch='ARCH_SH3 = yes'
2010 iproc='sh3'
2011 proc=''
2012 _march='-m3'
2013 _mcpu='-ml'
2014 _optimizing=''
2017 ppc|powerpc)
2018 _arch='POWERPC PPC'
2019 _def_dcbzl='#undef HAVE_DCBZL'
2020 _target_arch='ARCH_POWERPC = yes'
2021 iproc='ppc'
2022 proc=''
2023 _march=''
2024 _mcpu=''
2025 _optimizing=''
2027 echocheck "CPU type"
2028 case $system_name in
2029 Linux)
2030 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
2031 if test -n "`$_cpuinfo | grep altivec`"; then
2032 test $_altivec = auto && _altivec=yes
2035 Darwin)
2036 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
2037 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
2038 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
2039 test $_altivec = auto && _altivec=yes
2042 NetBSD)
2043 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2044 case $cc_version in
2045 2*|3.0*|3.1*|3.2*|3.3*)
2048 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
2049 test $_altivec = auto && _altivec=yes
2052 esac
2054 AIX)
2055 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
2057 esac
2058 if test "$_altivec" = yes; then
2059 echores "$proc altivec"
2060 else
2061 _altivec=no
2062 echores "$proc"
2065 echocheck "GCC & CPU optimization abilities"
2067 if test -n "$proc"; then
2068 case "$proc" in
2069 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2070 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2071 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2072 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2073 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2074 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2075 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2076 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2077 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2078 *) ;;
2079 esac
2080 # gcc 3.1(.1) and up supports 7400 and 7450
2081 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2082 case "$proc" in
2083 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2084 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2085 *) ;;
2086 esac
2088 # gcc 3.2 and up supports 970
2089 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2090 case "$proc" in
2091 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2092 _def_dcbzl='#define HAVE_DCBZL 1' ;;
2093 *) ;;
2094 esac
2096 # gcc 3.3 and up supports POWER4
2097 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2098 case "$proc" in
2099 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2100 *) ;;
2101 esac
2103 # gcc 3.4 and up supports 440*
2104 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2105 case "$proc" in
2106 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2107 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2108 *) ;;
2109 esac
2111 # gcc 4.0 and up supports POWER5
2112 if test "$_cc_major" -ge "4"; then
2113 case "$proc" in
2114 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2115 *) ;;
2116 esac
2120 if test -n "$_mcpu"; then
2121 _optimizing=`echo $_mcpu | cut -c 8-`
2122 echores "$_optimizing"
2123 else
2124 echores "none"
2129 alpha)
2130 _arch='ALPHA'
2131 _target_arch='ARCH_ALPHA = yes'
2132 iproc='alpha'
2133 _march=''
2135 echocheck "CPU type"
2136 cat > $TMPC << EOF
2137 int main() {
2138 unsigned long ver, mask;
2139 asm ("implver %0" : "=r" (ver));
2140 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
2141 printf("%ld-%x\n", ver, ~mask);
2142 return 0;
2145 $_cc -o "$TMPEXE" "$TMPC"
2146 case `"$TMPEXE"` in
2148 0-0) proc="ev4"; _mvi="0";;
2149 1-0) proc="ev5"; _mvi="0";;
2150 1-1) proc="ev56"; _mvi="0";;
2151 1-101) proc="pca56"; _mvi="1";;
2152 2-303) proc="ev6"; _mvi="1";;
2153 2-307) proc="ev67"; _mvi="1";;
2154 2-1307) proc="ev68"; _mvi="1";;
2155 esac
2156 echores "$proc"
2158 echocheck "GCC & CPU optimization abilities"
2159 if test "$proc" = "ev68" ; then
2160 cc_check -mcpu=$proc || proc=ev67
2162 if test "$proc" = "ev67" ; then
2163 cc_check -mcpu=$proc || proc=ev6
2165 _mcpu="-mcpu=$proc"
2166 echores "$proc"
2168 _optimizing="$proc"
2170 echocheck "MVI instruction support in GCC"
2171 if test "$_cc_major" -ge "3" && test "$_mvi" = "1" ; then
2172 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
2173 echores "yes"
2174 else
2175 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
2176 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
2180 mips)
2181 _arch='SGI_MIPS'
2182 _target_arch='ARCH_SGI_MIPS = yes'
2183 iproc='sgi-mips'
2184 proc=''
2185 _march=''
2186 _mcpu=''
2187 _optimizing=''
2189 if irix ; then
2190 echocheck "CPU type"
2191 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
2192 case "`echo $proc`" in
2193 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2194 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2195 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2196 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2197 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2198 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2199 esac
2200 # gcc < 3.x does not support -mtune.
2201 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2202 _mcpu=''
2204 echores "$proc"
2209 hppa)
2210 _arch='PA_RISC'
2211 _target_arch='ARCH_PA_RISC = yes'
2212 iproc='PA-RISC'
2213 proc=''
2214 _march=''
2215 _mcpu=''
2216 _optimizing=''
2219 s390)
2220 _arch='S390'
2221 _target_arch='ARCH_S390 = yes'
2222 iproc='390'
2223 proc=''
2224 _march=''
2225 _mcpu=''
2226 _optimizing=''
2229 s390x)
2230 _arch='S390X'
2231 _target_arch='ARCH_S390X = yes'
2232 iproc='390x'
2233 proc=''
2234 _march=''
2235 _mcpu=''
2236 _optimizing=''
2239 vax)
2240 _arch='VAX'
2241 _target_arch='ARCH_VAX = yes'
2242 iproc='vax'
2243 proc=''
2244 _march=''
2245 _mcpu=''
2246 _optimizing=''
2249 generic)
2250 _arch='GENERIC'
2251 _target_arch='ARCH_GENERIC = yes'
2252 iproc=''
2253 proc=''
2254 _march=''
2255 _mcpu=''
2256 _optimizing=''
2260 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2261 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2262 die "unsupported architecture $host_arch"
2264 esac # case "$host_arch" in
2266 if test "$_runtime_cpudetection" = yes ; then
2267 if x86 ; then
2268 test "$_cmov" != no && _cmov=yes
2269 x86_32 && _cmov=no
2270 test "$_mmx" != no && _mmx=yes
2271 test "$_3dnow" != no && _3dnow=yes
2272 test "$_3dnowext" != no && _3dnowext=yes
2273 test "$_mmxext" != no && _mmxext=yes
2274 test "$_sse" != no && _sse=yes
2275 test "$_sse2" != no && _sse2=yes
2276 test "$_ssse3" != no && _ssse3=yes
2277 test "$_mtrr" != no && _mtrr=yes
2279 if ppc; then
2280 _altivec=yes
2286 echocheck "assembler support of -pipe option"
2287 cat > $TMPC << EOF
2288 int main(void) { return 0; }
2290 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2293 echocheck "compiler support of named assembler arguments"
2294 _named_asm_args=yes
2295 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
2296 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2297 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2298 _named_asm_args=no
2299 _def_named_asm_args="#undef NAMED_ASM_ARGS"
2301 echores $_named_asm_args
2304 if darwin && test "$cc_vendor" = "gnu" ; then
2305 echocheck "GCC support of -mstackrealign"
2306 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2307 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2308 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2309 # wrong code with this flag, but this can be worked around by adding
2310 # -fno-unit-at-a-time as described in the blog post at
2311 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2312 cat > $TMPC << EOF
2313 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2314 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2316 cc_check -O4 -mstackrealign && tmp_run && _stackrealign=-mstackrealign
2317 test -z "$_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2318 && tmp_run && _stackrealign="-mstackrealign -fno-unit-at-a-time"
2319 test -n "$_stackrealign" && echores "yes" || echores "no"
2320 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2323 # Checking for CFLAGS
2324 _install_strip="-s"
2325 if test "$_profile" != "" || test "$_debug" != "" ; then
2326 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2327 _install_strip=
2328 elif test -z "$CFLAGS" ; then
2329 if test "$cc_vendor" = "intel" ; then
2330 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2331 elif test "$cc_vendor" != "gnu" ; then
2332 CFLAGS="-O2 $_march $_mcpu $_pipe"
2333 else
2334 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2336 else
2337 _warn_CFLAGS=yes
2339 if test -n "$LDFLAGS" ; then
2340 _ld_extra="$_ld_extra $LDFLAGS"
2341 _warn_CFLAGS=yes
2342 elif test "$cc_vendor" = "intel" ; then
2343 _ld_extra="$_ld_extra -i-static"
2345 if test -n "$CPPFLAGS" ; then
2346 _inc_extra="$_inc_extra $CPPFLAGS"
2347 _warn_CFLAGS=yes
2352 if x86_32 ; then
2353 # Checking assembler (_as) compatibility...
2354 # Added workaround for older as that reads from stdin by default - atmos
2355 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2356 echocheck "assembler ($_as $as_version)"
2358 _pref_as_version='2.9.1'
2359 echo 'nop' > $TMPS
2360 if test "$_mmx" = yes ; then
2361 echo 'emms' >> $TMPS
2363 if test "$_3dnow" = yes ; then
2364 _pref_as_version='2.10.1'
2365 echo 'femms' >> $TMPS
2367 if test "$_3dnowext" = yes ; then
2368 _pref_as_version='2.10.1'
2369 echo 'pswapd %mm0, %mm0' >> $TMPS
2371 if test "$_mmxext" = yes ; then
2372 _pref_as_version='2.10.1'
2373 echo 'movntq %mm0, (%eax)' >> $TMPS
2375 if test "$_sse" = yes ; then
2376 _pref_as_version='2.10.1'
2377 echo 'xorps %xmm0, %xmm0' >> $TMPS
2379 #if test "$_sse2" = yes ; then
2380 # _pref_as_version='2.11'
2381 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2383 if test "$_cmov" = yes ; then
2384 _pref_as_version='2.10.1'
2385 echo 'cmovb %eax, %ebx' >> $TMPS
2387 if test "$_ssse3" = yes ; then
2388 _pref_as_version='2.16.92'
2389 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2391 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2393 if test "$as_verc_fail" != yes ; then
2394 echores "ok"
2395 else
2396 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2397 echores "failed"
2398 die "obsolete binutils version"
2401 fi #if x86_32
2403 echocheck ".align is a power of two"
2404 if test "$_asmalign_pot" = auto ; then
2405 _asmalign_pot=no
2406 cat > $TMPC << EOF
2407 main() { asm (".align 3"); }
2409 cc_check && _asmalign_pot=yes
2411 if test "$_asmalign_pot" = "yes" ; then
2412 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2413 else
2414 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2416 echores $_asmalign_pot
2419 #FIXME: This should happen before the check for CFLAGS..
2420 if ppc ; then
2422 # check if altivec is supported by the compiler, and how to enable it
2424 _altivec_gcc_flags=''
2426 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2427 echocheck "GCC altivec support"
2429 p=''
2430 cat > $TMPC << EOF
2431 int main() {
2432 return 0;
2435 FSF_flags='-maltivec -mabi=altivec'
2436 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2438 # check for Darwin-style flags first, since
2439 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2440 # accepts but ignores FSF-style flags...
2442 if test -z "$p"; then
2443 cc_check $Darwin_flags && p='Darwin'
2445 if test -z "$p"; then
2446 cc_check $FSF_flags && p='FSF'
2449 case $p in
2450 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2451 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2452 *) _altivec=no ;;
2453 esac
2455 if test -z "$p"; then
2456 p=none
2457 else
2458 p="$p-style ($_altivec_gcc_flags)"
2461 echores "$p"
2464 # check if <altivec.h> should be included
2466 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2468 if test "$_altivec" = yes ; then
2469 echocheck "altivec.h"
2470 cat > $TMPC << EOF
2471 #include <altivec.h>
2472 int main(void) { return 0; }
2474 _have_altivec_h=no
2475 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2476 if test "$_have_altivec_h" = yes ; then
2477 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2479 echores "$_have_altivec_h"
2482 # disable runtime cpudetection if
2483 # - we cannot generate altivec code
2484 # - altivec is disabled by the user
2486 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2487 _runtime_cpudetection=no
2490 # show that we are optimizing for altivec (if enabled and supported)
2492 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2493 _optimizing="$_optimizing altivec"
2496 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2498 if test "$_altivec" = yes ; then
2499 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2500 #_mcpu="$_mcpu $_altivec_gcc_flags"
2501 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2505 if arm ; then
2506 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2507 if test $_armv5te = "auto" ; then
2508 cat > $TMPC << EOF
2509 int main(void) {
2510 __asm__ __volatile__ ("qadd r0, r0, r0");
2513 _armv5te=no
2514 cc_check && _armv5te=yes
2516 echores "$_armv5te"
2518 echocheck "ARMv6 (SIMD instructions)"
2519 if test $_armv6 = "auto" ; then
2520 cat > $TMPC << EOF
2521 int main(void) { __asm__ __volatile__ ("sadd16 r0, r0, r0"); }
2523 _armv6=no
2524 cc_check && _armv6=yes
2526 echores "$_armv6"
2528 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2529 if test $_iwmmxt = "auto" ; then
2530 cat > $TMPC << EOF
2531 int main(void) {
2532 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2535 _iwmmxt=no
2536 cc_check && _iwmmxt=yes
2538 echores "$_iwmmxt"
2541 _cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
2542 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2543 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2544 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2545 test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
2546 test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_cpuexts"
2547 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2548 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2549 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2550 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2551 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2552 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2553 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2554 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2555 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2556 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2558 # Checking kernel version...
2559 if x86_32 && linux ; then
2560 _k_verc_problem=no
2561 kernel_version=`uname -r 2>&1`
2562 echocheck "$system_name kernel version"
2563 case "$kernel_version" in
2564 '') kernel_version="?.??"; _k_verc_fail=yes;;
2565 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2566 _k_verc_problem=yes;;
2567 esac
2568 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2569 _k_verc_fail=yes
2571 if test "$_k_verc_fail" ; then
2572 echores "$kernel_version, fail"
2573 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2574 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2575 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2576 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2577 echo "2.2.x you must upgrade it to get SSE support!"
2578 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2579 else
2580 echores "$kernel_version, ok"
2584 ######################
2585 # MAIN TESTS GO HERE #
2586 ######################
2589 echocheck "-lposix"
2590 cat > $TMPC <<EOF
2591 int main(void) { return 0; }
2593 if cc_check -lposix ; then
2594 _ld_extra="$_ld_extra -lposix"
2595 echores "yes"
2596 else
2597 echores "no"
2600 echocheck "-lm"
2601 cat > $TMPC <<EOF
2602 int main(void) { return 0; }
2604 if cc_check -lm ; then
2605 _ld_lm="-lm"
2606 echores "yes"
2607 else
2608 _ld_lm=""
2609 echores "no"
2613 echocheck "langinfo"
2614 if test "$_langinfo" = auto ; then
2615 cat > $TMPC <<EOF
2616 #include <langinfo.h>
2617 int main(void) { nl_langinfo(CODESET); return 0; }
2619 _langinfo=no
2620 cc_check && _langinfo=yes
2622 if test "$_langinfo" = yes ; then
2623 _def_langinfo='#define USE_LANGINFO 1'
2624 else
2625 _def_langinfo='#undef USE_LANGINFO'
2627 echores "$_langinfo"
2630 echocheck "language"
2631 test -z "$_language" && _language=$LINGUAS
2632 _language=`echo $_language | sed 's/,/ /g'`
2633 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2634 for lang in $_language ; do
2635 test "$lang" = all && lang=en
2636 if test -f "help/help_mp-${lang}.h" ; then
2637 _language=$lang
2638 break
2639 else
2640 echo ${_echo_n} "$lang not found, ${_echo_c}"
2641 _language=`echo $_language | sed "s/$lang *//"`
2643 done
2644 test -z "$_language" && _language=en
2645 _mp_help="help/help_mp-${_language}.h"
2646 test -f $_mp_help || die "$_mp_help not found"
2647 for lang in $LANGUAGES ; do
2648 if test -f "DOCS/man/$lang/mplayer.1" ; then
2649 MAN_LANG="$lang $MAN_LANG"
2651 done
2652 _doc_lang=$_language
2653 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2654 echores "using $_language (man pages: $MAN_LANG)"
2657 echocheck "enable sighandler"
2658 if test "$_sighandler" = yes ; then
2659 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2660 else
2661 _def_sighandler='#undef ENABLE_SIGHANDLER'
2663 echores "$_sighandler"
2665 echocheck "runtime cpudetection"
2666 if test "$_runtime_cpudetection" = yes ; then
2667 _optimizing="Runtime CPU-Detection enabled"
2668 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2669 else
2670 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2672 echores "$_runtime_cpudetection"
2675 echocheck "restrict keyword"
2676 for restrict_keyword in restrict __restrict __restrict__ ; do
2677 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2678 if cc_check; then
2679 _def_restrict_keyword=$restrict_keyword
2680 break;
2682 done
2683 if [ -n "$_def_restrict_keyword" ]; then
2684 echores "$_def_restrict_keyword"
2685 else
2686 echores "none"
2688 # Avoid infinite recursion loop ("#define restrict restrict")
2689 if [ "$_def_restrict_keyword" != "restrict" ]; then
2690 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2691 else
2692 _def_restrict_keyword=""
2696 echocheck "__builtin_expect"
2697 # GCC branch prediction hint
2698 cat > $TMPC << EOF
2699 int foo (int a) {
2700 a = __builtin_expect (a, 10);
2701 return a == 10 ? 0 : 1;
2703 int main() { return foo(10) && foo(0); }
2705 _builtin_expect=no
2706 cc_check && _builtin_expect=yes
2707 if test "$_builtin_expect" = yes ; then
2708 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2709 else
2710 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2712 echores "$_builtin_expect"
2715 echocheck "kstat"
2716 cat > $TMPC << EOF
2717 #include <kstat.h>
2718 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2720 _kstat=no
2721 cc_check -lkstat && _kstat=yes
2722 if test "$_kstat" = yes ; then
2723 _def_kstat="#define HAVE_LIBKSTAT 1"
2724 _ld_extra="$_ld_extra -lkstat"
2725 else
2726 _def_kstat="#undef HAVE_LIBKSTAT"
2728 echores "$_kstat"
2731 echocheck "posix4"
2732 # required for nanosleep on some systems
2733 cat > $TMPC << EOF
2734 #include <time.h>
2735 int main(void) { (void) nanosleep(0, 0); return 0; }
2737 _posix4=no
2738 cc_check -lposix4 && _posix4=yes
2739 if test "$_posix4" = yes ; then
2740 _ld_extra="$_ld_extra -lposix4"
2742 echores "$_posix4"
2744 echocheck "lrintf"
2745 cat > $TMPC << EOF
2746 #include <math.h>
2747 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2749 _lrintf=no
2750 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2751 if test "$_lrintf" = yes ; then
2752 _def_lrintf="#define HAVE_LRINTF 1"
2753 else
2754 _def_lrintf="#undef HAVE_LRINTF"
2756 echores "$_lrintf"
2759 echocheck "mkstemp"
2760 cat > $TMPC << EOF
2761 #include <stdlib.h>
2762 int main(void) { char a; mkstemp(&a); return 0; }
2764 _mkstemp=no
2765 cc_check && _mkstemp=yes
2766 if test "$_mkstemp" = yes ; then
2767 _def_mkstemp='#define HAVE_MKSTEMP 1'
2768 else
2769 _def_mkstemp='#undef HAVE_MKSTEMP'
2771 echores "$_mkstemp"
2774 echocheck "nanosleep"
2775 # also check for nanosleep
2776 cat > $TMPC << EOF
2777 #include <time.h>
2778 int main(void) { (void) nanosleep(0, 0); return 0; }
2780 _nanosleep=no
2781 cc_check && _nanosleep=yes
2782 if test "$_nanosleep" = yes ; then
2783 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2784 else
2785 _def_nanosleep='#undef HAVE_NANOSLEEP'
2787 echores "$_nanosleep"
2790 echocheck "socklib"
2791 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2792 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2793 cat > $TMPC << EOF
2794 #include <netdb.h>
2795 #include <sys/socket.h>
2796 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2798 _socklib=no
2799 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2800 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2801 done
2802 if test $_winsock2 = auto && not cygwin ; then
2803 _winsock2=no
2804 cat > $TMPC << EOF
2805 #include <winsock2.h>
2806 int main(void) { (void) gethostbyname(0); return 0; }
2808 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2810 test "$_ld_sock" && _res_comment="using $_ld_sock"
2811 echores "$_socklib"
2814 if test $_winsock2 = yes ; then
2815 _ld_sock="-lws2_32"
2816 _def_winsock2='#define HAVE_WINSOCK2 1'
2817 else
2818 _def_winsock2='#undef HAVE_WINSOCK2'
2822 _use_aton=no
2823 echocheck "inet_pton()"
2824 cat > $TMPC << EOF
2825 #include <sys/types.h>
2826 #include <sys/socket.h>
2827 #include <arpa/inet.h>
2828 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2830 if test "$_winsock2" = yes ; then
2831 _res_comment="using winsock2 functions instead"
2832 echores "no"
2833 elif cc_check $_ld_sock ; then
2834 # NOTE: Linux has libresolv but does not need it
2836 _res_comment="using $_ld_sock"
2837 echores "yes"
2838 elif cc_check $_ld_sock -lresolv ; then
2839 # NOTE: needed for SunOS at least
2840 _ld_sock="$_ld_sock -lresolv"
2841 _res_comment="using $_ld_sock"
2842 echores "yes"
2843 else
2844 _res_comment="trying inet_aton next"
2845 echores "no"
2847 echocheck "inet_aton()"
2848 cat > $TMPC << EOF
2849 #include <sys/types.h>
2850 #include <sys/socket.h>
2851 #include <arpa/inet.h>
2852 int main(void) { (void) inet_aton(0, 0); return 0; }
2854 _use_aton=yes
2855 if cc_check $_ld_sock ; then
2856 # NOTE: Linux has libresolv but does not need it
2858 _res_comment="using $_ld_sock"
2859 elif cc_check $_ld_sock -lresolv ; then
2860 # NOTE: needed for SunOS at least
2861 _ld_sock="$_ld_sock -lresolv"
2862 _res_comment="using $_ld_sock"
2863 else
2864 _use_aton=no
2865 _network=no
2866 _res_comment="network support disabled"
2868 echores "$_use_aton"
2871 _def_use_aton='#undef USE_ATON'
2872 if test "$_use_aton" = yes; then
2873 _def_use_aton='#define USE_ATON 1'
2876 echocheck "network"
2877 # FIXME network check
2878 if test "$_network" = yes ; then
2879 _def_network='#define MPLAYER_NETWORK 1'
2880 _ld_extra="$_ld_extra $_ld_sock"
2881 _inputmodules="network $_inputmodules"
2882 else
2883 _noinputmodules="network $_noinputmodules"
2884 _def_network='#undef MPLAYER_NETWORK'
2885 _ftp=no
2887 echores "$_network"
2889 echocheck "inttypes.h (required)"
2890 cat > $TMPC << EOF
2891 #include <inttypes.h>
2892 int main(void) { return 0; }
2894 _inttypes=no
2895 cc_check && _inttypes=yes
2896 echores "$_inttypes"
2898 if test "$_inttypes" = no ; then
2899 echocheck "bitypes.h (inttypes.h predecessor)"
2900 cat > $TMPC << EOF
2901 #include <sys/bitypes.h>
2902 int main(void) { return 0; }
2904 cc_check && _inttypes=yes
2905 if test "$_inttypes" = yes ; then
2906 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."
2907 else
2908 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2913 echocheck "int_fastXY_t in inttypes.h"
2914 cat > $TMPC << EOF
2915 #include <inttypes.h>
2916 int main(void) {
2917 volatile int_fast16_t v= 0;
2918 return v; }
2920 _fast_inttypes=no
2921 cc_check && _fast_inttypes=yes
2922 if test "$_fast_inttypes" = yes ; then
2923 # nothing to do
2925 else
2926 _def_fast_inttypes='
2927 typedef signed char int_fast8_t;
2928 typedef signed int int_fast16_t;
2929 typedef signed int int_fast32_t;
2930 typedef signed long long int_fast64_t;
2931 typedef unsigned char uint_fast8_t;
2932 typedef unsigned int uint_fast16_t;
2933 typedef unsigned int uint_fast32_t;
2934 typedef unsigned long long uint_fast64_t;'
2936 echores "$_fast_inttypes"
2939 echocheck "word size"
2940 _mp_wordsize="#undef MP_WORDSIZE"
2941 cat > $TMPC << EOF
2942 #include <stdio.h>
2943 #include <sys/types.h>
2944 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2946 cc_check && _wordsize=`$TMPEXE` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2947 echores "$_wordsize"
2950 echocheck "malloc.h"
2951 cat > $TMPC << EOF
2952 #include <malloc.h>
2953 int main(void) { (void) malloc(0); return 0; }
2955 _malloc=no
2956 cc_check && _malloc=yes
2957 if test "$_malloc" = yes ; then
2958 _def_malloc='#define HAVE_MALLOC_H 1'
2959 else
2960 _def_malloc='#undef HAVE_MALLOC_H'
2962 # malloc.h emits a warning in FreeBSD and OpenBSD
2963 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2964 echores "$_malloc"
2967 echocheck "memalign()"
2968 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2969 cat > $TMPC << EOF
2970 #include <malloc.h>
2971 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2973 _memalign=no
2974 cc_check && _memalign=yes
2975 if test "$_memalign" = yes ; then
2976 _def_memalign='#define HAVE_MEMALIGN 1'
2977 else
2978 _def_memalign='#undef HAVE_MEMALIGN'
2979 _def_map_memalign='#define memalign(a,b) malloc(b)'
2980 not darwin && _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
2982 echores "$_memalign"
2985 echocheck "alloca.h"
2986 cat > $TMPC << EOF
2987 #include <alloca.h>
2988 int main(void) { (void) alloca(0); return 0; }
2990 _alloca=no
2991 cc_check && _alloca=yes
2992 if cc_check ; then
2993 _def_alloca='#define HAVE_ALLOCA_H 1'
2994 else
2995 _def_alloca='#undef HAVE_ALLOCA_H'
2997 echores "$_alloca"
3000 echocheck "mman.h"
3001 cat > $TMPC << EOF
3002 #include <sys/types.h>
3003 #include <sys/mman.h>
3004 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3006 _mman=no
3007 cc_check && _mman=yes
3008 if test "$_mman" = yes ; then
3009 _def_mman='#define HAVE_SYS_MMAN_H 1'
3010 else
3011 _def_mman='#undef HAVE_SYS_MMAN_H'
3013 echores "$_mman"
3015 cat > $TMPC << EOF
3016 #include <sys/types.h>
3017 #include <sys/mman.h>
3018 int main(void) { void *p = MAP_FAILED; return 0; }
3020 _mman_has_map_failed=no
3021 cc_check && _mman_has_map_failed=yes
3022 if test "$_mman_has_map_failed" = yes ; then
3023 _def_mman_has_map_failed=''
3024 else
3025 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3028 echocheck "dynamic loader"
3029 cat > $TMPC << EOF
3030 #include <dlfcn.h>
3031 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
3033 _dl=no
3034 for _ld_tmp in "" "-ldl" ; do
3035 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3036 done
3037 if test "$_dl" = yes ; then
3038 _def_dl='#define HAVE_LIBDL 1'
3039 else
3040 _def_dl='#undef HAVE_LIBDL'
3042 echores "$_dl"
3045 echocheck "dynamic a/v plugins support"
3046 if test "$_dl" = no ; then
3047 _dynamic_plugins=no
3049 if test "$_dynamic_plugins" = yes ; then
3050 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
3051 else
3052 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
3054 echores "$_dynamic_plugins"
3057 _def_threads='#undef HAVE_THREADS'
3059 echocheck "pthread"
3060 if test "$_pthreads" = auto ; then
3061 cat > $TMPC << EOF
3062 #include <pthread.h>
3063 void* func(void *arg) { return arg; }
3064 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3066 _pthreads=no
3067 if not hpux ; then
3068 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3069 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3070 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3071 done
3074 if test "$_pthreads" = yes ; then
3075 _res_comment="using $_ld_pthread"
3076 _def_pthreads='#define HAVE_PTHREADS 1'
3077 _def_threads='#define HAVE_THREADS 1'
3078 else
3079 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3080 _def_pthreads='#undef HAVE_PTHREADS'
3081 _nas=no ; _tv_v4l1=no ; _macosx=no
3082 if not mingw32 ; then
3083 _win32dll=no
3086 echores "$_pthreads"
3088 echocheck "w32threads"
3089 if test "$_pthreads" = yes ; then
3090 _res_comment="using pthread instead"
3091 _w32threads=no
3093 if test "$_w32threads" = auto ; then
3094 _w32threads=no
3095 mingw32 && _w32threads=yes
3097 test "$_w32threads" = yes && _def_threads='#define HAVE_THREADS 1'
3098 echores "$_w32threads"
3100 echocheck "rpath"
3101 netbsd &&_rpath=yes
3102 if test "$_rpath" = yes ; then
3103 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3104 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3105 done
3106 _ld_extra=$tmp
3108 echores "$_rpath"
3110 echocheck "iconv"
3111 if test "$_iconv" = auto ; then
3112 cat > $TMPC << EOF
3113 #include <stdio.h>
3114 #include <unistd.h>
3115 #include <iconv.h>
3116 #define INBUFSIZE 1024
3117 #define OUTBUFSIZE 4096
3119 char inbuffer[INBUFSIZE];
3120 char outbuffer[OUTBUFSIZE];
3122 int main(void) {
3123 size_t numread;
3124 iconv_t icdsc;
3125 char *tocode="UTF-8";
3126 char *fromcode="cp1250";
3127 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3128 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3129 char *iptr=inbuffer;
3130 char *optr=outbuffer;
3131 size_t inleft=numread;
3132 size_t outleft=OUTBUFSIZE;
3133 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3134 != (size_t)(-1)) {
3135 write (1, outbuffer, OUTBUFSIZE - outleft);
3138 if (iconv_close(icdsc) == -1)
3143 _iconv=no
3144 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3145 cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3146 _iconv=yes && break
3147 done
3149 if test "$_iconv" = yes ; then
3150 _def_iconv='#define USE_ICONV 1'
3151 else
3152 _def_iconv='#undef USE_ICONV'
3154 echores "$_iconv"
3157 echocheck "soundcard.h"
3158 _soundcard_h=no
3159 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3160 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3161 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3162 cat > $TMPC << EOF
3163 #include <$_soundcard_header>
3164 int main(void) { return 0; }
3166 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3167 done
3169 if test "$_soundcard_h" = yes ; then
3170 if test $_soundcard_header = "sys/soundcard.h"; then
3171 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3172 else
3173 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3176 echores "$_soundcard_h"
3179 echocheck "sys/dvdio.h"
3180 cat > $TMPC << EOF
3181 #include <unistd.h>
3182 #include <sys/dvdio.h>
3183 int main(void) { return 0; }
3185 _dvdio=no
3186 cc_check && _dvdio=yes
3187 if test "$_dvdio" = yes ; then
3188 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3189 else
3190 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3192 echores "$_dvdio"
3195 echocheck "sys/cdio.h"
3196 cat > $TMPC << EOF
3197 #include <unistd.h>
3198 #include <sys/cdio.h>
3199 int main(void) { return 0; }
3201 _cdio=no
3202 cc_check && _cdio=yes
3203 if test "$_cdio" = yes ; then
3204 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3205 else
3206 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3208 echores "$_cdio"
3211 echocheck "linux/cdrom.h"
3212 cat > $TMPC << EOF
3213 #include <sys/types.h>
3214 #include <linux/cdrom.h>
3215 int main(void) { return 0; }
3217 _cdrom=no
3218 cc_check && _cdrom=yes
3219 if test "$_cdrom" = yes ; then
3220 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3221 else
3222 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3224 echores "$_cdrom"
3227 echocheck "dvd.h"
3228 cat > $TMPC << EOF
3229 #include <dvd.h>
3230 int main(void) { return 0; }
3232 _dvd=no
3233 cc_check && _dvd=yes
3234 if test "$_dvd" = yes ; then
3235 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3236 else
3237 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3239 echores "$_dvd"
3242 if bsdos; then
3243 echocheck "BSDI dvd.h"
3244 cat > $TMPC << EOF
3245 #include <dvd.h>
3246 int main(void) { return 0; }
3248 _bsdi_dvd=no
3249 cc_check && _bsdi_dvd=yes
3250 if test "$_bsdi_dvd" = yes ; then
3251 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3252 else
3253 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3255 echores "$_bsdi_dvd"
3256 fi #if bsdos
3259 if hpux; then
3260 # also used by AIX, but AIX does not support VCD and/or libdvdread
3261 echocheck "HP-UX SCSI header"
3262 cat > $TMPC << EOF
3263 #include <sys/scsi.h>
3264 int main(void) { return 0; }
3266 _hpux_scsi_h=no
3267 cc_check && _hpux_scsi_h=yes
3268 if test "$_hpux_scsi_h" = yes ; then
3269 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3270 else
3271 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3273 echores "$_hpux_scsi_h"
3274 fi #if hpux
3277 if sunos; then
3278 echocheck "userspace SCSI headers (Solaris)"
3279 cat > $TMPC << EOF
3280 # include <unistd.h>
3281 # include <stropts.h>
3282 # include <sys/scsi/scsi_types.h>
3283 # include <sys/scsi/impl/uscsi.h>
3284 int main(void) { return 0; }
3286 _sol_scsi_h=no
3287 cc_check && _sol_scsi_h=yes
3288 if test "$_sol_scsi_h" = yes ; then
3289 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3290 else
3291 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3293 echores "$_sol_scsi_h"
3294 fi #if sunos
3297 echocheck "termcap"
3298 if test "$_termcap" = auto ; then
3299 cat > $TMPC <<EOF
3300 int main(void) { tgetent(); return 0; }
3302 _termcap=no
3303 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3304 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
3305 && _termcap=yes && break
3306 done
3308 if test "$_termcap" = yes ; then
3309 _def_termcap='#define USE_TERMCAP 1'
3310 _res_comment="using $_ld_tmp"
3311 else
3312 _def_termcap='#undef USE_TERMCAP'
3314 echores "$_termcap"
3317 echocheck "termios"
3318 _def_termios='#undef HAVE_TERMIOS'
3319 _def_termios_h='#undef HAVE_TERMIOS_H'
3320 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3321 if test "$_termios" = auto ; then
3322 _termios=no
3323 for _termios_header in "sys/termios.h" "termios.h"; do
3324 cat > $TMPC <<EOF
3325 #include <$_termios_header>
3326 int main(void) { return 0; }
3328 cc_check && _termios=yes && _res_comment="$_termios_header" && break
3329 done
3332 if test "$_termios" = yes ; then
3333 _def_termios='#define HAVE_TERMIOS 1'
3334 if test "$_termios_header" = "termios.h" ; then
3335 _def_termios_h='#define HAVE_TERMIOS_H 1'
3336 else
3337 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3340 echores "$_termios"
3343 echocheck "shm"
3344 if test "$_shm" = auto ; then
3345 cat > $TMPC << EOF
3346 #include <sys/types.h>
3347 #include <sys/shm.h>
3348 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3350 _shm=no
3351 cc_check && _shm=yes
3353 if test "$_shm" = yes ; then
3354 _def_shm='#define HAVE_SHM 1'
3355 else
3356 _def_shm='#undef HAVE_SHM'
3358 echores "$_shm"
3361 echocheck "strsep()"
3362 cat > $TMPC << EOF
3363 #include <string.h>
3364 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3366 _strsep=no
3367 cc_check && _strsep=yes
3368 if test "$_strsep" = yes ; then
3369 _def_strsep='#define HAVE_STRSEP 1'
3370 _need_strsep=no
3371 else
3372 _def_strsep='#undef HAVE_STRSEP'
3373 _need_strsep=yes
3375 echores "$_strsep"
3378 echocheck "vsscanf()"
3379 cat > $TMPC << EOF
3380 #include <stdarg.h>
3381 int main(void) { vsscanf(0, 0, 0); return 0; }
3383 _vsscanf=no
3384 cc_check && _vsscanf=yes
3385 if test "$_vsscanf" = yes ; then
3386 _def_vsscanf='#define HAVE_VSSCANF 1'
3387 _need_vsscanf=no
3388 else
3389 _def_vsscanf='#undef HAVE_VSSCANF'
3390 _need_vsscanf=yes
3392 echores "$_vsscanf"
3395 echocheck "swab()"
3396 cat > $TMPC << EOF
3397 #include <unistd.h>
3398 int main(void) { swab(0, 0, 0); return 0; }
3400 _swab=no
3401 cc_check && _swab=yes
3402 if test "$_swab" = yes ; then
3403 _def_swab='#define HAVE_SWAB 1'
3404 _need_swab=no
3405 else
3406 _def_swab='#undef HAVE_SWAB'
3407 _need_swab=yes
3409 echores "$_swab"
3411 echocheck "POSIX select()"
3412 cat > $TMPC << EOF
3413 #include <stdio.h>
3414 #include <stdlib.h>
3415 #include <sys/types.h>
3416 #include <string.h>
3417 #include <sys/time.h>
3418 #include <unistd.h>
3419 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3421 _posix_select=no
3422 _def_posix_select='#undef HAVE_POSIX_SELECT'
3423 cc_check && _posix_select=yes \
3424 && _def_posix_select='#define HAVE_POSIX_SELECT 1'
3425 echores "$_posix_select"
3428 echocheck "gettimeofday()"
3429 cat > $TMPC << EOF
3430 #include <stdio.h>
3431 #include <sys/time.h>
3432 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3434 _gettimeofday=no
3435 cc_check && _gettimeofday=yes
3436 if test "$_gettimeofday" = yes ; then
3437 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3438 _need_gettimeofday=no
3439 else
3440 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3441 _need_gettimeofday=yes
3443 echores "$_gettimeofday"
3446 echocheck "glob()"
3447 cat > $TMPC << EOF
3448 #include <stdio.h>
3449 #include <glob.h>
3450 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3452 _glob=no
3453 cc_check && _glob=yes
3454 if test "$_glob" = yes ; then
3455 _def_glob='#define HAVE_GLOB 1'
3456 _need_glob=no
3457 else
3458 _def_glob='#undef HAVE_GLOB'
3459 _need_glob=yes
3461 echores "$_glob"
3464 echocheck "setenv()"
3465 cat > $TMPC << EOF
3466 #include <stdlib.h>
3467 int main (void){ setenv("","",0); return 0; }
3469 _setenv=no
3470 cc_check && _setenv=yes
3471 if test "$_setenv" = yes ; then
3472 _def_setenv='#define HAVE_SETENV 1'
3473 _need_setenv=no
3474 else
3475 _def_setenv='#undef HAVE_SETENV'
3476 _need_setenv=yes
3478 echores "$_setenv"
3481 if sunos; then
3482 echocheck "sysi86()"
3483 cat > $TMPC << EOF
3484 #include <sys/sysi86.h>
3485 int main (void) { sysi86(0); return 0; }
3487 _sysi86=no
3488 cc_check && _sysi86=yes
3489 if test "$_sysi86" = yes ; then
3490 _def_sysi86='#define HAVE_SYSI86 1'
3491 cat > $TMPC << EOF
3492 #include <sys/sysi86.h>
3493 int main (void) { int sysi86(int, void*); sysi86(0); return 0; }
3495 cc_check && _def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3496 else
3497 _def_sysi86='#undef HAVE_SYSI86'
3499 echores "$_sysi86"
3500 fi #if sunos
3503 echocheck "sys/sysinfo.h"
3504 cat > $TMPC << EOF
3505 #include <sys/sysinfo.h>
3506 int main(void) {
3507 struct sysinfo s_info;
3508 sysinfo(&s_info);
3509 return 0;
3512 _sys_sysinfo=no
3513 cc_check && _sys_sysinfo=yes
3514 if test "$_sys_sysinfo" = yes ; then
3515 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3516 else
3517 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3519 echores "$_sys_sysinfo"
3522 if darwin; then
3524 echocheck "Mac OS X APIs"
3525 if test "$_macosx" = auto ; then
3526 productName=`/usr/bin/sw_vers -productName`
3527 if test "$productName" = "Mac OS X" ||
3528 test "$productName" = "Mac OS X Server" ; then
3529 _macosx=yes
3530 else
3531 _macosx=no
3532 _def_macosx='#undef MACOSX'
3533 _noaomodules="macosx $_noaomodules"
3534 _novomodules="quartz $_novomodules"
3537 if test "$_macosx" = yes ; then
3538 cat > $TMPC <<EOF
3539 #include <Carbon/Carbon.h>
3540 #include <QuickTime/QuickTime.h>
3541 #include <CoreAudio/CoreAudio.h>
3542 int main(void) {
3543 EnterMovies();
3544 ExitMovies();
3545 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3548 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3549 _ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3550 _def_macosx='#define MACOSX 1'
3551 _aosrc="$_aosrc ao_macosx.c"
3552 _aomodules="macosx $_aomodules"
3553 _vosrc="$_vosrc vo_quartz.c"
3554 _vomodules="quartz $_vomodules"
3555 else
3556 _macosx=no
3557 _def_macosx='#undef MACOSX'
3558 _noaomodules="macosx $_noaomodules"
3559 _novomodules="quartz $_novomodules"
3561 cat > $TMPC <<EOF
3562 #include <Carbon/Carbon.h>
3563 #include <QuartzCore/CoreVideo.h>
3564 int main(void) {}
3566 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3567 _vosrc="$_vosrc vo_macosx.m"
3568 _vomodules="macosx $_vomodules"
3569 _ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework OpenGL"
3570 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3571 _macosx_corevideo=yes
3572 else
3573 _novomodules="macosx $_novomodules"
3574 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3575 _macosx_corevideo=no
3578 echores "$_macosx"
3580 echocheck "Mac OS X Finder Support"
3581 if test "$_macosx_finder_support" = auto ; then
3582 _macosx_finder_support=$_macosx
3584 if test "$_macosx_finder_support" = yes; then
3585 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3586 _macosx_finder_support=yes
3587 else
3588 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3589 _macosx_finder_support=no
3591 echores "$_macosx_finder_support"
3593 echocheck "Mac OS X Bundle file locations"
3594 if test "$_macosx_bundle" = auto ; then
3595 _macosx_bundle=$_macosx_finder_support
3597 if test "$_macosx_bundle" = yes; then
3598 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3599 else
3600 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3601 _macosx_bundle=no
3603 echores "$_macosx_bundle"
3605 echocheck "Apple Remote"
3606 if test "$_apple_remote" = auto ; then
3607 _apple_remote=no
3608 cat > $TMPC <<EOF
3609 #include <stdio.h>
3610 #include <IOKit/IOCFPlugIn.h>
3611 int main (int argc, const char * argv[])
3613 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3614 CFMutableDictionaryRef hidMatchDictionary;
3615 IOReturn ioReturnValue;
3617 // Set up a matching dictionary to search the I/O Registry by class.
3618 // name for all HID class devices
3619 hidMatchDictionary = IOServiceMatching("AppleIRController");
3621 // Now search I/O Registry for matching devices.
3622 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3623 hidMatchDictionary, &hidObjectIterator);
3625 // If search is unsuccessful, return nonzero.
3626 if (ioReturnValue != kIOReturnSuccess ||
3627 !IOIteratorIsValid(hidObjectIterator)) {
3628 return 1;
3630 return 0;
3633 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3635 if test "$_apple_remote" = yes ; then
3636 _def_apple_remote='#define HAVE_APPLE_REMOTE 1'
3637 _ld_extra="$_ld_extra -framework IOKit"
3638 else
3639 _def_apple_remote='#undef HAVE_APPLE_REMOTE'
3641 echores "$_apple_remote"
3643 fi #if darwin
3646 echocheck "pkg-config"
3647 _pkg_config=pkg-config
3648 if `$_pkg_config --version > /dev/null 2>&1`; then
3649 if test "$_ld_static"; then
3650 _pkg_config="$_pkg_config --static"
3652 echores "yes"
3653 else
3654 _pkg_config=false
3655 echores "no"
3659 echocheck "Samba support (libsmbclient)"
3660 if test "$_smbsupport" = yes; then
3661 _ld_extra="$_ld_extra -lsmbclient"
3663 if test "$_smbsupport" = auto; then
3664 _smbsupport=no
3665 cat > $TMPC << EOF
3666 #include <libsmbclient.h>
3667 int main(void) { smbc_opendir("smb://"); return 0; }
3669 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3670 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
3671 _smbsupport=yes && break
3672 done
3675 if test "$_smbsupport" = yes; then
3676 _def_smbsupport="#define LIBSMBCLIENT"
3677 _inputmodules="smb $_inputmodules"
3678 else
3679 _def_smbsupport="#undef LIBSMBCLIENT"
3680 _noinputmodules="smb $_noinputmodules"
3682 echores "$_smbsupport"
3685 #########
3686 # VIDEO #
3687 #########
3690 echocheck "tdfxfb"
3691 if test "$_tdfxfb" = yes ; then
3692 _def_tdfxfb='#define HAVE_TDFXFB 1'
3693 _vosrc="$_vosrc vo_tdfxfb.c"
3694 _vomodules="tdfxfb $_vomodules"
3695 else
3696 _def_tdfxfb='#undef HAVE_TDFXFB'
3697 _novomodules="tdfxfb $_novomodules"
3699 echores "$_tdfxfb"
3701 echocheck "s3fb"
3702 if test "$_s3fb" = yes ; then
3703 _def_s3fb='#define HAVE_S3FB 1'
3704 _vosrc="$_vosrc vo_s3fb.c"
3705 _vomodules="s3fb $_vomodules"
3706 else
3707 _def_s3fb='#undef HAVE_S3FB'
3708 _novomodules="s3fb $_novomodules"
3710 echores "$_s3fb"
3712 echocheck "tdfxvid"
3713 if test "$_tdfxvid" = yes ; then
3714 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3715 _vosrc="$_vosrc vo_tdfx_vid.c"
3716 _vomodules="tdfx_vid $_vomodules"
3717 else
3718 _def_tdfxvid='#undef HAVE_TDFX_VID'
3719 _novomodules="tdfx_vid $_novomodules"
3721 echores "$_tdfxvid"
3723 echocheck "xvr100"
3724 if test "$_xvr100" = auto ; then
3725 cat > $TMPC << EOF
3726 #include <unistd.h>
3727 #include <sys/fbio.h>
3728 #include <sys/visual_io.h>
3729 int main(void) {
3730 struct vis_identifier ident;
3731 struct fbgattr attr;
3733 ioctl(0, VIS_GETIDENTIFIER, &ident);
3734 ioctl(0, FBIOGATTR, &attr);
3737 _xvr100=no
3738 cc_check && _xvr100=yes
3740 if test "$_xvr100" = yes ; then
3741 _def_xvr100='#define HAVE_XVR100 1'
3742 _vosrc="$_vosrc vo_xvr100.c"
3743 _vomodules="xvr100 $_vomodules"
3744 else
3745 _def_tdfxvid='#undef HAVE_XVR100'
3746 _novomodules="xvr100 $_novomodules"
3748 echores "$_xvr100"
3750 echocheck "tga"
3751 if test "$_tga" = yes ; then
3752 _def_tga='#define HAVE_TGA 1'
3753 _vosrc="$_vosrc vo_tga.c"
3754 _vomodules="tga $_vomodules"
3755 else
3756 _def_tga='#undef HAVE_TGA'
3757 _novomodules="tga $_novomodules"
3759 echores "$_tga"
3762 echocheck "md5sum support"
3763 if test "$_md5sum" = yes; then
3764 _def_md5sum="#define HAVE_MD5SUM"
3765 _vosrc="$_vosrc vo_md5sum.c"
3766 _vomodules="md5sum $_vomodules"
3767 else
3768 _def_md5sum="#undef HAVE_MD5SUM"
3769 _novomodules="md5sum $_novomodules"
3771 echores "$_md5sum"
3774 echocheck "bl"
3775 if test "$_bl" = yes ; then
3776 _def_bl='#define HAVE_BL 1'
3777 _vosrc="$_vosrc vo_bl.c"
3778 _vomodules="bl $_vomodules"
3779 else
3780 _def_bl='#undef HAVE_BL'
3781 _novomodules="bl $_novomodules"
3783 echores "$_bl"
3786 echocheck "DirectFB"
3787 if test "$_directfb" = auto ; then
3788 _directfb=no
3789 cat > $TMPC <<EOF
3790 #include <directfb.h>
3791 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3793 for _inc_tmp in "" -I/usr/local/include/directfb \
3794 -I/usr/include/directfb -I/usr/local/include; do
3795 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3796 _inc_extra="$_inc_extra $_inc_tmp" && break
3797 done
3800 dfb_version() {
3801 expr $1 \* 65536 + $2 \* 256 + $3
3804 if test "$_directfb" = yes; then
3805 cat > $TMPC << EOF
3806 #include <directfb_version.h>
3808 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3811 if $_cc -E $TMPC $_inc_extra > "$TMPEXE"; then
3812 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'`
3813 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3814 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3815 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3816 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3817 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3818 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3819 _res_comment="$_directfb_version"
3820 test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes
3821 else
3822 _def_directfb_version='#undef DIRECTFBVERSION'
3823 _directfb=no
3824 _res_comment="version >=0.9.13 required"
3826 else
3827 _directfb=no
3828 _res_comment="failed to get version"
3831 echores "$_directfb"
3833 if test "$_directfb" = yes ; then
3834 _def_directfb='#define HAVE_DIRECTFB 1'
3835 _vosrc="$_vosrc vo_directfb2.c"
3836 _vomodules="directfb $_vomodules"
3837 _libs_mplayer="$_libs_mplayer -ldirectfb"
3838 else
3839 _def_directfb='#undef HAVE_DIRECTFB'
3840 _novomodules="directfb $_novomodules"
3842 if test "$_dfbmga" = yes; then
3843 _vosrc="$_vosrc vo_dfbmga.c"
3844 _vomodules="dfbmga $_vomodules"
3845 _def_dfbmga='#define HAVE_DFBMGA 1'
3846 else
3847 _novomodules="dfbmga $_novomodules"
3848 _def_dfbmga='#undef HAVE_DFBMGA'
3852 echocheck "X11 headers presence"
3853 _x11_headers="no"
3854 _res_comment="check if the dev(el) packages are installed"
3855 for I in `echo $_inc_extra | sed s/-I//g` /usr/include ; do
3856 if test -f "$I/X11/Xlib.h" ; then
3857 _x11_headers="yes"
3858 _res_comment=""
3859 break
3861 done
3862 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/openwin/include ; do
3863 if test -f "$I/X11/Xlib.h" ; then
3864 _inc_extra="$_inc_extra -I$I"
3865 _x11_headers="yes"
3866 _res_comment="using $I"
3867 break
3869 done
3870 echores "$_x11_headers"
3873 echocheck "X11"
3874 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
3875 cat > $TMPC <<EOF
3876 #include <X11/Xlib.h>
3877 #include <X11/Xutil.h>
3878 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3880 for I in "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3881 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3882 if netbsd; then
3883 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`"
3884 else
3885 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
3887 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" \
3888 && _x11=yes && break
3889 done
3891 if test "$_x11" = yes ; then
3892 _def_x11='#define HAVE_X11 1'
3893 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3894 _vomodules="x11 xover $_vomodules"
3895 else
3896 _x11=no
3897 _def_x11='#undef HAVE_X11'
3898 _novomodules="x11 $_novomodules"
3899 _res_comment="check if the dev(el) packages are installed"
3900 # disable stuff that depends on X
3901 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no
3903 echores "$_x11"
3906 echocheck "DPMS"
3907 _xdpms3=no
3908 _xdpms4=no
3909 if test "$_x11" = yes ; then
3910 cat > $TMPC <<EOF
3911 #include <X11/Xmd.h>
3912 #include <X11/Xlib.h>
3913 #include <X11/Xutil.h>
3914 #include <X11/Xatom.h>
3915 #include <X11/extensions/dpms.h>
3916 int main(void) {
3917 (void) DPMSQueryExtension(0, 0, 0);
3920 cc_check -lXdpms && _xdpms3=yes
3921 cat > $TMPC <<EOF
3922 #include <X11/Xlib.h>
3923 #include <X11/extensions/dpms.h>
3924 int main(void) {
3925 (void) DPMSQueryExtension(0, 0, 0);
3928 cc_check -lXext && _xdpms4=yes
3930 if test "$_xdpms4" = yes ; then
3931 _def_xdpms='#define HAVE_XDPMS 1'
3932 _res_comment="using Xdpms 4"
3933 echores "yes"
3934 elif test "$_xdpms3" = yes ; then
3935 _def_xdpms='#define HAVE_XDPMS 1'
3936 _libs_mplayer="$_libs_mplayer -lXdpms"
3937 _res_comment="using Xdpms 3"
3938 echores "yes"
3939 else
3940 _def_xdpms='#undef HAVE_XDPMS'
3941 echores "no"
3945 echocheck "Xv"
3946 if test "$_xv" = auto ; then
3947 cat > $TMPC <<EOF
3948 #include <X11/Xlib.h>
3949 #include <X11/extensions/Xvlib.h>
3950 int main(void) {
3951 (void) XvGetPortAttribute(0, 0, 0, 0);
3952 (void) XvQueryPortAttributes(0, 0, 0);
3953 return 0; }
3955 _xv=no
3956 cc_check -lXv && _xv=yes
3959 if test "$_xv" = yes ; then
3960 _def_xv='#define HAVE_XV 1'
3961 _libs_mplayer="$_libs_mplayer -lXv"
3962 _vosrc="$_vosrc vo_xv.c"
3963 _vomodules="xv $_vomodules"
3964 else
3965 _def_xv='#undef HAVE_XV'
3966 _novomodules="xv $_novomodules"
3968 echores "$_xv"
3971 echocheck "XvMC"
3972 if test "$_xv" = yes && test "$_xvmc" != no ; then
3973 _xvmc=no
3974 cat > $TMPC <<EOF
3975 #include <X11/Xlib.h>
3976 #include <X11/extensions/Xvlib.h>
3977 #include <X11/extensions/XvMClib.h>
3978 int main(void) {
3979 (void) XvMCQueryExtension(0,0,0);
3980 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3981 return 0; }
3983 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3984 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3985 done
3987 if test "$_xvmc" = yes ; then
3988 _def_xvmc='#define HAVE_XVMC 1'
3989 _libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
3990 _vosrc="$_vosrc vo_xvmc.c"
3991 _vomodules="xvmc $_vomodules"
3992 _res_comment="using $_xvmclib"
3993 else
3994 _def_xvmc='#undef HAVE_XVMC'
3995 _novomodules="xvmc $_novomodules"
3996 _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
3998 echores "$_xvmc"
4001 echocheck "Xinerama"
4002 if test "$_xinerama" = auto ; then
4003 cat > $TMPC <<EOF
4004 #include <X11/Xlib.h>
4005 #include <X11/extensions/Xinerama.h>
4006 int main(void) { (void) XineramaIsActive(0); return 0; }
4008 _xinerama=no
4009 cc_check -lXinerama && _xinerama=yes
4012 if test "$_xinerama" = yes ; then
4013 _def_xinerama='#define HAVE_XINERAMA 1'
4014 _libs_mplayer="$_libs_mplayer -lXinerama"
4015 else
4016 _def_xinerama='#undef HAVE_XINERAMA'
4018 echores "$_xinerama"
4021 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4022 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4023 # named 'X extensions' or something similar.
4024 # This check may be useful for future mplayer versions (to change resolution)
4025 # If you run into problems, remove '-lXxf86vm'.
4026 echocheck "Xxf86vm"
4027 if test "$_vm" = auto ; then
4028 cat > $TMPC <<EOF
4029 #include <X11/Xlib.h>
4030 #include <X11/extensions/xf86vmode.h>
4031 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4033 _vm=no
4034 cc_check -lXxf86vm && _vm=yes
4036 if test "$_vm" = yes ; then
4037 _def_vm='#define HAVE_XF86VM 1'
4038 _libs_mplayer="$_libs_mplayer -lXxf86vm"
4039 else
4040 _def_vm='#undef HAVE_XF86VM'
4042 echores "$_vm"
4044 # Check for the presence of special keycodes, like audio control buttons
4045 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4046 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4047 # have these new keycodes.
4048 echocheck "XF86keysym"
4049 if test "$_xf86keysym" = auto; then
4050 _xf86keysym=no
4051 cat > $TMPC <<EOF
4052 #include <X11/Xlib.h>
4053 #include <X11/XF86keysym.h>
4054 int main(void) { return XF86XK_AudioPause; }
4056 cc_check && _xf86keysym=yes
4058 if test "$_xf86keysym" = yes ; then
4059 _def_xf86keysym='#define HAVE_XF86XK 1'
4060 else
4061 _def_xf86keysym='#undef HAVE_XF86XK'
4063 echores "$_xf86keysym"
4065 echocheck "DGA"
4066 if test "$_dga2" = auto && test "$_x11" = yes ; then
4067 cat > $TMPC << EOF
4068 #include <X11/Xlib.h>
4069 #include <X11/extensions/xf86dga.h>
4070 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4072 _dga2=no
4073 cc_check -lXxf86dga && _dga2=yes
4075 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4076 cat > $TMPC << EOF
4077 #include <X11/Xlib.h>
4078 #include <X11/extensions/xf86dga.h>
4079 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4081 _dga1=no
4082 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4085 _dga=no
4086 _def_dga='#undef HAVE_DGA'
4087 _def_dga1='#undef HAVE_DGA1'
4088 _def_dga2='#undef HAVE_DGA2'
4089 if test "$_dga1" = yes ; then
4090 _dga=yes
4091 _def_dga1='#define HAVE_DGA1 1'
4092 _res_comment="using DGA 1.0"
4093 elif test "$_dga2" = yes ; then
4094 _dga=yes
4095 _def_dga2='#define HAVE_DGA2 1'
4096 _res_comment="using DGA 2.0"
4098 if test "$_dga" = yes ; then
4099 _def_dga='#define HAVE_DGA 1'
4100 _libs_mplayer="$_libs_mplayer -lXxf86dga"
4101 _vosrc="$_vosrc vo_dga.c"
4102 _vomodules="dga $_vomodules"
4103 else
4104 _novomodules="dga $_novomodules"
4106 echores "$_dga"
4109 echocheck "3dfx"
4110 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4111 _def_3dfx='#define HAVE_3DFX 1'
4112 _vosrc="$_vosrc vo_3dfx.c"
4113 _vomodules="3dfx $_vomodules"
4114 else
4115 _def_3dfx='#undef HAVE_3DFX'
4116 _novomodules="3dfx $_novomodules"
4118 echores "$_3dfx"
4121 echocheck "OpenGL"
4122 #Note: this test is run even with --enable-gl since we autodetect linker flags
4123 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4124 cat > $TMPC << EOF
4125 #include <GL/gl.h>
4126 #ifdef GL_WIN32
4127 #include <windows.h>
4128 #include <GL/glext.h>
4129 #else
4130 #include <X11/Xlib.h>
4131 #include <GL/glx.h>
4132 #endif
4133 int main(void) {
4134 #ifdef GL_WIN32
4135 HDC dc;
4136 wglCreateContext(dc);
4137 #else
4138 glXCreateContext(NULL, NULL, NULL, True);
4139 #endif
4140 glFinish();
4141 return 0;
4144 _gl=no
4145 if cc_check -lGL $_ld_lm ; then
4146 _gl=yes
4147 _libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
4148 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4149 _gl=yes
4150 _libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
4151 elif cc_check -DGL_WIN32 -lopengl32 ; then
4152 _gl=yes
4153 _gl_win32=yes
4154 _libs_mplayer="$_libs_mplayer -lopengl32 -lgdi32"
4156 else
4157 _gl=no
4159 if test "$_gl" = yes ; then
4160 _def_gl='#define HAVE_GL 1'
4161 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4162 if test "$_gl_win32" = yes ; then
4163 _def_gl_win32='#define GL_WIN32 1'
4164 _vosrc="$_vosrc w32_common.c"
4165 _res_comment="win32 version"
4167 _vomodules="opengl $_vomodules"
4168 else
4169 _def_gl='#undef HAVE_GL'
4170 _def_gl_win32='#undef GL_WIN32'
4171 _novomodules="opengl $_novomodules"
4173 echores "$_gl"
4176 echocheck "VIDIX"
4177 _vidix=no
4178 _def_vidix='#undef CONFIG_VIDIX'
4179 _def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4180 _vidix_drv_cyberblade=no
4181 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4182 _vidix_drv_ivtv=no
4183 _def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4184 _vidix_drv_ivtv=no
4185 _def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4186 _vidix_drv_mach64=no
4187 _def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4188 _vidix_drv_mga=no
4189 _def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4190 _vidix_drv_mga_crtc2=no
4191 _def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4192 _vidix_drv_nvidia=no
4193 _def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4194 _vidix_drv_pm2=no
4195 _def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4196 _vidix_drv_pm3=no
4197 _def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4198 _vidix_drv_radeon=no
4199 _def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4200 _vidix_drv_rage128=no
4201 _def_vidix_drv_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
4202 _vidix_drv_savage=no
4203 _def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4204 _vidix_drv_sis=no
4205 _def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4206 _vidix_drv_unichrome=no
4207 if test "$_vidix_internal" = auto ; then
4208 _vidix_internal=no
4209 x86 && _vidix_internal=yes
4210 ppc && linux && _vidix_internal=yes
4211 alpha && linux && _vidix_internal=yes
4212 qnx || beos || darwin && _vidix_internal=no
4214 if test "$_vidix_internal" = yes; then
4215 _res_comment="internal"
4216 _vidix_external=no
4217 _vidix=yes
4218 elif test "$_vidix_external" = auto; then
4219 _vidix_external=no
4220 cat > $TMPC <<EOF
4221 #include <vidix/vidix.h>
4222 int main(void) { return 0; }
4224 cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
4225 && _vidix=yes
4227 echores "$_vidix"
4229 if test "$_vidix" = yes ; then
4230 _def_vidix='#define CONFIG_VIDIX 1'
4231 _vosrc="$_vosrc vo_cvidix.c"
4232 _vomodules="cvidix $_vomodules"
4233 test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 savage sis unichrome"
4234 test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//`
4236 # some vidix drivers are not meant to work on powerpc, discard them
4237 ppc && _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome//`
4239 for driver in $_vidix_drivers ; do
4240 uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'`
4241 eval _vidix_drv_${driver}=yes
4242 eval _def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4243 done
4244 else
4245 _novomodules="cvidix $_novomodules"
4248 if test "$_vidix_internal" = yes ; then
4249 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
4250 elif test "$_vidix_external" = yes ; then
4251 _libs_mplayer="$_libs_mplayer -lvidix"
4252 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
4255 if test "$_vidix" = yes && win32; then
4256 _vosrc="$_vosrc vo_winvidix.c"
4257 _vomodules="winvidix $_vomodules"
4258 _libs_mplayer="$_libs_mplayer -lgdi32"
4259 else
4260 _novomodules="winvidix $_novomodules"
4262 if test "$_vidix" = yes && test "$_x11" = yes; then
4263 _vosrc="$_vosrc vo_xvidix.c"
4264 _vomodules="xvidix $_vomodules"
4265 else
4266 _novomodules="xvidix $_novomodules"
4270 echocheck "/dev/mga_vid"
4271 if test "$_mga" = auto ; then
4272 _mga=no
4273 test -c /dev/mga_vid && _mga=yes
4275 if test "$_mga" = yes ; then
4276 _def_mga='#define HAVE_MGA 1'
4277 _vosrc="$_vosrc vo_mga.c"
4278 _vomodules="mga $_vomodules"
4279 else
4280 _def_mga='#undef HAVE_MGA'
4281 _novomodules="mga $_novomodules"
4283 echores "$_mga"
4286 echocheck "xmga"
4287 if test "$_xmga" = auto ; then
4288 _xmga=no
4289 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4291 if test "$_xmga" = yes ; then
4292 _def_xmga='#define HAVE_XMGA 1'
4293 _vosrc="$_vosrc vo_xmga.c"
4294 _vomodules="xmga $_vomodules"
4295 else
4296 _def_xmga='#undef HAVE_XMGA'
4297 _novomodules="xmga $_novomodules"
4299 echores "$_xmga"
4302 echocheck "GGI"
4303 if test "$_ggi" = auto ; then
4304 cat > $TMPC << EOF
4305 #include <ggi/ggi.h>
4306 int main(void) { ggiInit(); return 0; }
4308 _ggi=no
4309 cc_check -lggi && _ggi=yes
4311 if test "$_ggi" = yes ; then
4312 _def_ggi='#define HAVE_GGI 1'
4313 _libs_mplayer="$_libs_mplayer -lggi"
4314 _vosrc="$_vosrc vo_ggi.c"
4315 _vomodules="ggi $_vomodules"
4316 else
4317 _def_ggi='#undef HAVE_GGI'
4318 _novomodules="ggi $_novomodules"
4320 echores "$_ggi"
4322 echocheck "GGI extension: libggiwmh"
4323 if test "$_ggiwmh" = auto ; then
4324 _ggiwmh=no
4325 cat > $TMPC << EOF
4326 #include <ggi/ggi.h>
4327 #include <ggi/wmh.h>
4328 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4330 cc_check -lggi -lggiwmh && _ggiwmh=yes
4332 # needed to get right output on obscure combination
4333 # like --disable-ggi --enable-ggiwmh
4334 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4335 _def_ggiwmh='#define HAVE_GGIWMH 1'
4336 _libs_mplayer="$_libs_mplayer -lggiwmh"
4337 else
4338 _ggiwmh=no
4339 _def_ggiwmh='#undef HAVE_GGIWMH'
4341 echores "$_ggiwmh"
4344 echocheck "AA"
4345 if test "$_aa" = auto ; then
4346 cat > $TMPC << EOF
4347 #include <aalib.h>
4348 extern struct aa_hardware_params aa_defparams;
4349 extern struct aa_renderparams aa_defrenderparams;
4350 int main(void) {
4351 aa_context *c;
4352 aa_renderparams *p;
4353 (void) aa_init(0, 0, 0);
4354 c = aa_autoinit(&aa_defparams);
4355 p = aa_getrenderparams();
4356 aa_autoinitkbd(c,0);
4357 return 0; }
4359 _aa=no
4360 for _ld_tmp in "-laa" ; do
4361 cc_check $_ld_tmp && _libs_mplayer="$_libs_mplayer $_ld_tmp" && _aa=yes && break
4362 done
4364 if test "$_aa" = yes ; then
4365 _def_aa='#define HAVE_AA 1'
4366 if cygwin ; then
4367 _libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
4369 _vosrc="$_vosrc vo_aa.c"
4370 _vomodules="aa $_vomodules"
4371 else
4372 _def_aa='#undef HAVE_AA'
4373 _novomodules="aa $_novomodules"
4375 echores "$_aa"
4378 echocheck "CACA"
4379 if test "$_caca" = auto ; then
4380 _caca=no
4381 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4382 cat > $TMPC << EOF
4383 #include <caca.h>
4384 #ifdef CACA_API_VERSION_1
4385 #include <caca0.h>
4386 #endif
4387 int main(void) { (void) caca_init(); return 0; }
4389 cc_check `caca-config --libs` && _caca=yes
4392 if test "$_caca" = yes ; then
4393 _def_caca='#define HAVE_CACA 1'
4394 _inc_extra="$_inc_extra `caca-config --cflags`"
4395 _libs_mplayer="$_libs_mplayer `caca-config --libs`"
4396 _vosrc="$_vosrc vo_caca.c"
4397 _vomodules="caca $_vomodules"
4398 else
4399 _def_caca='#undef HAVE_CACA'
4400 _novomodules="caca $_novomodules"
4402 echores "$_caca"
4405 echocheck "SVGAlib"
4406 if test "$_svga" = auto ; then
4407 cat > $TMPC << EOF
4408 #include <vga.h>
4409 int main(void) { return 0; }
4411 _svga=no
4412 cc_check -lvga $_ld_lm && _svga=yes
4414 if test "$_svga" = yes ; then
4415 _def_svga='#define HAVE_SVGALIB 1'
4416 _libs_mplayer="$_libs_mplayer -lvga"
4417 _vosrc="$_vosrc vo_svga.c"
4418 _vomodules="svga $_vomodules"
4419 else
4420 _def_svga='#undef HAVE_SVGALIB'
4421 _novomodules="svga $_novomodules"
4423 echores "$_svga"
4426 echocheck "FBDev"
4427 if test "$_fbdev" = auto ; then
4428 _fbdev=no
4429 linux && _fbdev=yes
4431 if test "$_fbdev" = yes ; then
4432 _def_fbdev='#define HAVE_FBDEV 1'
4433 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4434 _vomodules="fbdev $_vomodules"
4435 else
4436 _def_fbdev='#undef HAVE_FBDEV'
4437 _novomodules="fbdev $_novomodules"
4439 echores "$_fbdev"
4443 echocheck "DVB"
4444 if test "$_dvb" = auto ; then
4445 _dvb=no
4446 cat >$TMPC << EOF
4447 #include <sys/poll.h>
4448 #include <sys/ioctl.h>
4449 #include <stdio.h>
4450 #include <time.h>
4451 #include <unistd.h>
4453 #include <ost/dmx.h>
4454 #include <ost/frontend.h>
4455 #include <ost/sec.h>
4456 #include <ost/video.h>
4457 #include <ost/audio.h>
4458 int main(void) {return 0;}
4460 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4461 cc_check $_inc_tmp && _dvb=yes && \
4462 _inc_extra="$_inc_extra $_inc_tmp" && break
4463 done
4465 echores "$_dvb"
4466 if test "$_dvb" = yes ; then
4467 _def_dvb='#define HAVE_DVB 1'
4468 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4469 _aomodules="mpegpes(dvb) $_aomodules"
4470 _vomodules="mpegpes(dvb) $_vomodules"
4473 echocheck "DVB HEAD"
4474 if test "$_dvbhead" = auto ; then
4475 _dvbhead=no
4477 cat >$TMPC << EOF
4478 #include <sys/poll.h>
4479 #include <sys/ioctl.h>
4480 #include <stdio.h>
4481 #include <time.h>
4482 #include <unistd.h>
4484 #include <linux/dvb/dmx.h>
4485 #include <linux/dvb/frontend.h>
4486 #include <linux/dvb/video.h>
4487 #include <linux/dvb/audio.h>
4488 int main(void) {return 0;}
4490 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4491 cc_check $_inc_tmp && _dvbhead=yes && \
4492 _inc_extra="$_inc_extra $_inc_tmp" && break
4493 done
4495 echores "$_dvbhead"
4496 if test "$_dvbhead" = yes ; then
4497 _def_dvb='#define HAVE_DVB_HEAD 1'
4498 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4499 _aomodules="mpegpes(dvb) $_aomodules"
4500 _vomodules="mpegpes(dvb) $_vomodules"
4503 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4504 _def_dvb='#undef HAVE_DVB'
4505 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4506 _aomodules="mpegpes(file) $_aomodules"
4507 _vomodules="mpegpes(file) $_vomodules"
4510 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4511 _dvbin=yes
4512 _inputmodules="dvb $_inputmodules"
4513 else
4514 _dvbin=no
4515 _noinputmodules="dvb $_noinputmodules"
4519 echocheck "zr"
4520 if test "$_zr" = auto ; then
4521 #36067's seem to identify themselves as 36057PQC's, so the line
4522 #below should work for 36067's and 36057's.
4523 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
4524 _zr=yes
4525 else
4526 _zr=no
4529 if test "$_zr" = yes ; then
4530 if test "$_libavcodec_a" = yes ; then
4531 _def_zr='#define HAVE_ZR 1'
4532 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
4533 _vomodules="zr zr2 $_vomodules"
4534 else
4535 _res_comment="libavcodec (static) is required by zr, sorry"
4536 _novomodules="zr $_novomodules"
4537 _def_zr='#undef HAVE_ZR'
4539 else
4540 _def_zr='#undef HAVE_ZR'
4541 _novomodules="zr zr2 $_novomodules"
4543 echores "$_zr"
4546 echocheck "PNG support"
4547 if test "$_png" = auto ; then
4548 _png=no
4549 if irix ; then
4550 # Don't check for -lpng on irix since it has its own libpng
4551 # incompatible with the GNU libpng
4552 _res_comment="disabled on irix (not GNU libpng)"
4553 else
4554 cat > $TMPC << EOF
4555 #include <png.h>
4556 #include <string.h>
4557 int main(void) {
4558 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4559 printf("libpng: %s\n", png_libpng_ver);
4560 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4563 if cc_check -lpng -lz $_ld_lm ; then
4564 if tmp_run ; then
4565 _png=yes
4566 else
4567 _res_comment="mismatch of library and header versions"
4572 echores "$_png"
4573 if test "$_png" = yes ; then
4574 _def_png='#define HAVE_PNG 1'
4575 _ld_extra="$_ld_extra -lpng -lz"
4576 _vosrc="$_vosrc vo_png.c"
4577 _vomodules="png $_vomodules"
4578 else
4579 _def_png='#undef HAVE_PNG'
4580 _novomodules="png $_novomodules"
4583 echocheck "JPEG support"
4584 if test "$_jpeg" = auto ; then
4585 _jpeg=no
4586 cat > $TMPC << EOF
4587 #include <stdio.h>
4588 #include <stdlib.h>
4589 #include <setjmp.h>
4590 #include <string.h>
4591 #include <jpeglib.h>
4592 int main(void) {
4593 return 0;
4596 if cc_check -ljpeg $_ld_lm ; then
4597 if tmp_run ; then
4598 _jpeg=yes
4602 echores "$_jpeg"
4604 if test "$_jpeg" = yes ; then
4605 _def_jpeg='#define HAVE_JPEG 1'
4606 _vosrc="$_vosrc vo_jpeg.c"
4607 _vomodules="jpeg $_vomodules"
4608 _ld_extra="$_ld_extra -ljpeg"
4609 else
4610 _def_jpeg='#undef HAVE_JPEG'
4611 _novomodules="jpeg $_novomodules"
4616 echocheck "PNM support"
4617 if test "$_pnm" = yes; then
4618 _def_pnm="#define HAVE_PNM"
4619 _vosrc="$_vosrc vo_pnm.c"
4620 _vomodules="pnm $_vomodules"
4621 else
4622 _def_pnm="#undef HAVE_PNM"
4623 _novomodules="pnm $_novomodules"
4625 echores "$_pnm"
4629 echocheck "GIF support"
4630 # This is to appease people who want to force gif support.
4631 # If it is forced to yes, then we still do checks to determine
4632 # which gif library to use.
4633 if test "$_gif" = yes ; then
4634 _force_gif=yes
4635 _gif=auto
4638 if test "$_gif" = auto ; then
4639 _gif=no
4640 cat > $TMPC << EOF
4641 #include <gif_lib.h>
4642 int main(void) {
4643 return 0;
4646 for _ld_gif in "-lungif" "-lgif" ; do
4647 cc_check $_ld_gif && tmp_run && _gif=yes && break
4648 done
4651 # If no library was found, and the user wants support forced,
4652 # then we force it on with libgif, as this is the safest
4653 # assumption IMHO. (libungif & libregif both create symbolic
4654 # links to libgif. We also assume that no x11 support is needed,
4655 # because if you are forcing this, then you _should_ know what
4656 # you are doing. [ Besides, package maintainers should never
4657 # have compiled x11 deps into libungif in the first place. ] )
4658 # </rant>
4659 # --Joey
4660 if test "$_force_gif" = yes && test "$_gif" = no ; then
4661 _gif=yes
4662 _ld_gif="-lgif"
4665 if test "$_gif" = yes ; then
4666 _def_gif='#define HAVE_GIF 1'
4667 _vosrc="$_vosrc vo_gif89a.c"
4668 _codecmodules="gif $_codecmodules"
4669 _vomodules="gif89a $_vomodules"
4670 _res_comment="old version, some encoding functions disabled"
4671 _def_gif_4='#undef HAVE_GIF_4'
4672 _ld_extra="$_ld_extra $_ld_gif"
4674 cat > $TMPC << EOF
4675 #include <signal.h>
4676 #include <gif_lib.h>
4677 void catch() { exit(1); }
4678 int main(void) {
4679 signal(SIGSEGV, catch); // catch segfault
4680 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4681 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4682 return 0;
4685 if cc_check "$_ld_gif" && tmp_run ; then
4686 _def_gif_4='#define HAVE_GIF_4 1'
4687 _res_comment=""
4689 else
4690 _def_gif='#undef HAVE_GIF'
4691 _def_gif_4='#undef HAVE_GIF_4'
4692 _novomodules="gif89a $_novomodules"
4693 _nocodecmodules="gif $_nocodecmodules"
4695 echores "$_gif"
4698 case "$_gif" in yes*)
4699 echocheck "broken giflib workaround"
4700 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4702 cat > $TMPC << EOF
4703 #include <gif_lib.h>
4704 int main(void) {
4705 GifFileType gif;
4706 printf("UserData is at address %p\n", gif.UserData);
4707 return 0;
4710 if cc_check "$_ld_gif" && tmp_run ; then
4711 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4712 echores "disabled"
4713 else
4714 echores "enabled"
4717 esac
4720 echocheck "VESA support"
4721 if test "$_vesa" = auto ; then
4722 cat > $TMPC << EOF
4723 #include <vbe.h>
4724 int main(void) { vbeVersion(); return 0; }
4726 _vesa=no
4727 cc_check -lvbe -llrmi && _vesa=yes
4729 if test "$_vesa" = yes ; then
4730 _def_vesa='#define HAVE_VESA 1'
4731 _libs_mplayer="$_libs_mplayer -lvbe -llrmi"
4732 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4733 _vomodules="vesa $_vomodules"
4734 else
4735 _def_vesa='#undef HAVE_VESA'
4736 _novomodules="vesa $_novomodules"
4738 echores "$_vesa"
4740 #################
4741 # VIDEO + AUDIO #
4742 #################
4745 echocheck "SDL"
4746 if test -z "$_sdlconfig" ; then
4747 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4748 _sdlconfig="sdl-config"
4749 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4750 _sdlconfig="sdl11-config"
4751 else
4752 _sdlconfig=false
4755 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4756 cat > $TMPC << EOF
4757 #include <SDL.h>
4758 int main(int argc, char *argv[]) {
4759 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4760 return 0;
4763 _sdl=no
4764 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4765 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4766 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4767 if test "$_sdlversion" -gt 116 ; then
4768 if test "$_sdlversion" -lt 121 ; then
4769 _def_sdlbuggy='#define BUGGY_SDL'
4770 else
4771 _def_sdlbuggy='#undef BUGGY_SDL'
4773 _sdl=yes
4778 if test "$_sdl" = yes ; then
4779 _def_sdl='#define HAVE_SDL 1'
4780 if cygwin ; then
4781 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`"
4782 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4783 elif mingw32 ; then
4784 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`"
4785 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4786 else
4787 _libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
4788 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
4790 _vosrc="$_vosrc vo_sdl.c"
4791 _vomodules="sdl $_vomodules"
4792 _aosrc="$_aosrc ao_sdl.c"
4793 _aomodules="sdl $_aomodules"
4794 _res_comment="using $_sdlconfig"
4795 else
4796 _def_sdl='#undef HAVE_SDL'
4797 _novomodules="sdl $_novomodules"
4798 _noaomodules="sdl $_noaomodules"
4800 echores "$_sdl"
4803 if win32; then
4805 echocheck "Windows waveout"
4806 if test "$_win32waveout" = auto ; then
4807 cat > $TMPC << EOF
4808 #include <windows.h>
4809 #include <mmsystem.h>
4810 int main(void) { return 0; }
4812 _win32waveout=no
4813 cc_check -lwinmm && _win32waveout=yes
4815 if test "$_win32waveout" = yes ; then
4816 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4817 _libs_mplayer="$_libs_mplayer -lwinmm"
4818 _aosrc="$_aosrc ao_win32.c"
4819 _aomodules="win32 $_aomodules"
4820 else
4821 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4822 _noaomodules="win32 $_noaomodules"
4824 echores "$_win32waveout"
4826 echocheck "Directx"
4827 if test "$_directx" = auto ; then
4828 cat > $TMPC << EOF
4829 #include <windows.h>
4830 #include <ddraw.h>
4831 #include <dsound.h>
4832 int main(void) { return 0; }
4834 _directx=no
4835 cc_check -lgdi32 && _directx=yes
4837 if test "$_directx" = yes ; then
4838 _def_directx='#define HAVE_DIRECTX 1'
4839 _libs_mplayer="$_libs_mplayer -lgdi32"
4840 _vosrc="$_vosrc vo_directx.c"
4841 _vomodules="directx $_vomodules"
4842 _aosrc="$_aosrc ao_dsound.c"
4843 _aomodules="dsound $_aomodules"
4844 else
4845 _def_directx='#undef HAVE_DIRECTX'
4846 _novomodules="directx $_novomodules"
4847 _noaomodules="dsound $_noaomodules"
4849 echores "$_directx"
4851 fi #if win32; then
4854 echocheck "NAS"
4855 if test "$_nas" = auto ; then
4856 cat > $TMPC << EOF
4857 #include <audio/audiolib.h>
4858 int main(void) { return 0; }
4860 _nas=no
4861 cc_check $_ld_lm -laudio -lXt && _nas=yes
4863 if test "$_nas" = yes ; then
4864 _def_nas='#define HAVE_NAS 1'
4865 _libs_mplayer="$_libs_mplayer -laudio -lXt"
4866 _aosrc="$_aosrc ao_nas.c"
4867 _aomodules="nas $_aomodules"
4868 else
4869 _noaomodules="nas $_noaomodules"
4870 _def_nas='#undef HAVE_NAS'
4872 echores "$_nas"
4874 echocheck "DXR2"
4875 if test "$_dxr2" = auto; then
4876 _dxr2=no
4877 cat > $TMPC << EOF
4878 #include <dxr2ioctl.h>
4879 int main(void) { return 0; }
4881 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4882 cc_check $_inc_tmp && _dxr2=yes && \
4883 _inc_extra="$_inc_extra $_inc_tmp" && break
4884 done
4886 if test "$_dxr2" = yes; then
4887 _def_dxr2='#define HAVE_DXR2 1'
4888 _vosrc="$_vosrc vo_dxr2.c"
4889 _aosrc="$_aosrc ao_dxr2.c"
4890 _aomodules="dxr2 $_aomodules"
4891 _vomodules="dxr2 $_vomodules"
4892 else
4893 _def_dxr2='#undef HAVE_DXR2'
4894 _noaomodules="dxr2 $_noaomodules"
4895 _novomodules="dxr2 $_novomodules"
4897 echores "$_dxr2"
4899 echocheck "DXR3/H+"
4900 if test "$_dxr3" = auto ; then
4901 cat > $TMPC << EOF
4902 #include <linux/em8300.h>
4903 int main(void) { return 0; }
4905 _dxr3=no
4906 cc_check && _dxr3=yes
4908 if test "$_dxr3" = yes ; then
4909 _def_dxr3='#define HAVE_DXR3 1'
4910 _vosrc="$_vosrc vo_dxr3.c"
4911 _vomodules="dxr3 $_vomodules"
4912 else
4913 _def_dxr3='#undef HAVE_DXR3'
4914 _novomodules="dxr3 $_novomodules"
4916 echores "$_dxr3"
4919 echocheck "IVTV TV-Out"
4920 if test "$_ivtv" = auto ; then
4921 cat > $TMPC << EOF
4922 #include <stdlib.h>
4923 #include <inttypes.h>
4924 #include <linux/types.h>
4925 #include <linux/videodev2.h>
4926 #include <linux/ivtv.h>
4927 int main(void) { return 0; }
4929 _ivtv=no
4930 cc_check && _ivtv=yes
4932 if test "$_ivtv" = yes ; then
4933 _def_ivtv='#define HAVE_IVTV 1'
4934 _vosrc="$_vosrc vo_ivtv.c"
4935 _vomodules="ivtv $_vomodules"
4936 _aosrc="$_aosrc ao_ivtv.c"
4937 _aomodules="ivtv $_aomodules"
4938 else
4939 _def_ivtv='#undef HAVE_IVTV'
4940 _novomodules="ivtv $_novomodules"
4941 _noaomodules="ivtv $_noaomodules"
4943 echores "$_ivtv"
4946 echocheck "V4L2 MPEG Decoder"
4947 if test "$_v4l2" = auto ; then
4948 cat > $TMPC << EOF
4949 #include <stdlib.h>
4950 #include <inttypes.h>
4951 #include <linux/types.h>
4952 #include <linux/videodev2.h>
4953 #include <linux/version.h>
4954 int main(void) {
4955 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
4956 #error kernel headers too old, need 2.6.22
4957 bad_kernel_version();
4958 #endif
4959 struct v4l2_ext_controls ctrls;
4960 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
4961 return 0;
4964 _v4l2=no
4965 cc_check && _v4l2=yes
4967 if test "$_v4l2" = yes ; then
4968 _def_v4l2='#define HAVE_V4L2_DECODER 1'
4969 _vosrc="$_vosrc vo_v4l2.c"
4970 _vomodules="v4l2 $_vomodules"
4971 _aosrc="$_aosrc ao_v4l2.c"
4972 _aomodules="v4l2 $_aomodules"
4973 else
4974 _def_v4l2='#undef HAVE_V4L2_DECODER'
4975 _novomodules="v4l2 $_novomodules"
4976 _noaomodules="v4l2 $_noaomodules"
4978 echores "$_v4l2"
4982 #########
4983 # AUDIO #
4984 #########
4987 echocheck "OSS Audio"
4988 if test "$_ossaudio" = auto ; then
4989 cat > $TMPC << EOF
4990 #include <sys/ioctl.h>
4991 #include <$_soundcard_header>
4992 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4994 _ossaudio=no
4995 cc_check && _ossaudio=yes
4997 if test "$_ossaudio" = yes ; then
4998 _def_ossaudio='#define USE_OSS_AUDIO 1'
4999 _aosrc="$_aosrc ao_oss.c"
5000 _aomodules="oss $_aomodules"
5001 if test "$_linux_devfs" = yes; then
5002 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5003 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5004 else
5005 cat > $TMPC << EOF
5006 #include <sys/ioctl.h>
5007 #include <$_soundcard_header>
5008 #ifdef OPEN_SOUND_SYSTEM
5009 int main(void) { return 0; }
5010 #else
5011 #error Not the real thing
5012 #endif
5014 _real_ossaudio=no
5015 cc_check && _real_ossaudio=yes
5016 if test "$_real_ossaudio" = yes; then
5017 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5018 elif netbsd || openbsd ; then
5019 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5020 _ld_extra="$_ld_extra -lossaudio"
5021 else
5022 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5024 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5026 else
5027 _def_ossaudio='#undef USE_OSS_AUDIO'
5028 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5029 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5030 _noaomodules="oss $_noaomodules"
5032 echores "$_ossaudio"
5035 echocheck "aRts"
5036 if test "$_arts" = auto ; then
5037 _arts=no
5038 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5040 cat > $TMPC << EOF
5041 #include <artsc.h>
5042 int main(void) { return 0; }
5044 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
5049 if test "$_arts" = yes ; then
5050 _def_arts='#define USE_ARTS 1'
5051 _aosrc="$_aosrc ao_arts.c"
5052 _aomodules="arts $_aomodules"
5053 _libs_mplayer="$_libs_mplayer `artsc-config --libs`"
5054 _inc_extra="$_inc_extra `artsc-config --cflags`"
5055 else
5056 _noaomodules="arts $_noaomodules"
5058 echores "$_arts"
5061 echocheck "EsounD"
5062 if test "$_esd" = auto ; then
5063 _esd=no
5064 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5066 cat > $TMPC << EOF
5067 #include <esd.h>
5068 int main(void) { int fd = esd_open_sound("test"); return fd; }
5070 cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes
5074 echores "$_esd"
5076 if test "$_esd" = yes ; then
5077 _def_esd='#define USE_ESD 1'
5078 _aosrc="$_aosrc ao_esd.c"
5079 _aomodules="esd $_aomodules"
5080 _libs_mplayer="$_libs_mplayer `esd-config --libs`"
5081 _inc_extra="$_inc_extra `esd-config --cflags`"
5083 echocheck "esd_get_latency()"
5084 cat > $TMPC << EOF
5085 #include <esd.h>
5086 int main(void) { return esd_get_latency(0); }
5088 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
5089 echores "$_esd_latency"
5090 else
5091 _def_esd='#undef USE_ESD'
5092 _def_esd_latency='#undef HAVE_ESD_LATENCY'
5093 _noaomodules="esd $_noaomodules"
5096 echocheck "Polyp"
5097 if test "$_polyp" = auto ; then
5098 _polyp=no
5099 if $_pkg_config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
5101 cat > $TMPC << EOF
5102 #include <polyp/polyplib.h>
5103 #include <polyp/mainloop.h>
5104 #include <polyp/polyplib-error.h>
5105 int main(void) { return 0; }
5107 cc_check `$_pkg_config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
5111 echores "$_polyp"
5113 if test "$_polyp" = yes ; then
5114 _def_polyp='#define USE_POLYP 1'
5115 _aosrc="$_aosrc ao_polyp.c"
5116 _aomodules="polyp $_aomodules"
5117 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs polyplib polyplib-error polyplib-mainloop`"
5118 _inc_extra="$_inc_extra `$_pkg_config --cflags polyplib polyplib-error polyplib-mainloop`"
5119 else
5120 _def_polyp='#undef USE_POLYP'
5121 _noaomodules="polyp $_noaomodules"
5125 echocheck "JACK"
5126 if test "$_jack" = auto ; then
5127 _jack=yes
5129 cat > $TMPC << EOF
5130 #include <jack/jack.h>
5131 int main(void) { jack_client_new("test"); return 0; }
5133 if cc_check -ljack ; then
5134 _libs_mplayer="$_libs_mplayer -ljack"
5135 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
5136 _libs_mplayer="$_libs_mplayer `$_pkg_config --libs jack`"
5137 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
5138 else
5139 _jack=no
5143 if test "$_jack" = yes ; then
5144 _def_jack='#define USE_JACK 1'
5145 _aosrc="$_aosrc ao_jack.c"
5146 _aomodules="jack $_aomodules"
5147 else
5148 _noaomodules="jack $_noaomodules"
5150 echores "$_jack"
5152 echocheck "OpenAL"
5153 if test "$_openal" = auto ; then
5154 _openal=no
5155 cat > $TMPC << EOF
5156 #ifdef OPENAL_AL_H
5157 #include <OpenAL/al.h>
5158 #else
5159 #include <AL/al.h>
5160 #endif
5161 int main(void) {
5162 alSourceQueueBuffers(0, 0, 0);
5163 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5164 return 0;
5167 for I in "-lopenal" "-framework OpenAL" ; do
5168 cc_check $I && _openal=yes && break
5169 cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5170 done
5171 test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
5173 if test "$_openal" = yes ; then
5174 _def_openal='#define USE_OPENAL 1'
5175 _aosrc="$_aosrc ao_openal.c"
5176 _aomodules="openal $_aomodules"
5177 else
5178 _noaomodules="openal $_noaomodules"
5180 echores "$_openal"
5182 echocheck "ALSA audio"
5183 if test "$_alsa" != no ; then
5184 _alsa=no
5185 cat > $TMPC << EOF
5186 #include <sys/asoundlib.h>
5187 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5188 #error "alsa version != 0.5.x"
5189 #endif
5190 int main(void) { return 0; }
5192 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5194 cat > $TMPC << EOF
5195 #include <sys/asoundlib.h>
5196 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5197 #error "alsa version != 0.9.x"
5198 #endif
5199 int main(void) { return 0; }
5201 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5202 cat > $TMPC << EOF
5203 #include <alsa/asoundlib.h>
5204 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5205 #error "alsa version != 0.9.x"
5206 #endif
5207 int main(void) { return 0; }
5209 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5211 cat > $TMPC << EOF
5212 #include <sys/asoundlib.h>
5213 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5214 #error "alsa version != 1.0.x"
5215 #endif
5216 int main(void) { return 0; }
5218 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5219 cat > $TMPC << EOF
5220 #include <alsa/asoundlib.h>
5221 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5222 #error "alsa version != 1.0.x"
5223 #endif
5224 int main(void) { return 0; }
5226 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5228 _def_alsa5='#undef HAVE_ALSA5'
5229 _def_alsa9='#undef HAVE_ALSA9'
5230 _def_alsa1x='#undef HAVE_ALSA1X'
5231 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5232 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5233 if test "$_alsaver" ; then
5234 _alsa=yes
5235 if test "$_alsaver" = '0.5.x' ; then
5236 _alsa5=yes
5237 _aosrc="$_aosrc ao_alsa5.c"
5238 _aomodules="alsa5 $_aomodules"
5239 _def_alsa5='#define HAVE_ALSA5 1'
5240 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5241 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5242 elif test "$_alsaver" = '0.9.x-sys' ; then
5243 _alsa9=yes
5244 _aosrc="$_aosrc ao_alsa.c"
5245 _aomodules="alsa $_aomodules"
5246 _def_alsa9='#define HAVE_ALSA9 1'
5247 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5248 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5249 elif test "$_alsaver" = '0.9.x-alsa' ; then
5250 _alsa9=yes
5251 _aosrc="$_aosrc ao_alsa.c"
5252 _aomodules="alsa $_aomodules"
5253 _def_alsa9='#define HAVE_ALSA9 1'
5254 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5255 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5256 elif test "$_alsaver" = '1.0.x-sys' ; then
5257 _alsa1x=yes
5258 _aosrc="$_aosrc ao_alsa.c"
5259 _aomodules="alsa $_aomodules"
5260 _def_alsa1x="#define HAVE_ALSA1X 1"
5261 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5262 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5263 elif test "$_alsaver" = '1.0.x-alsa' ; then
5264 _alsa1x=yes
5265 _aosrc="$_aosrc ao_alsa.c"
5266 _aomodules="alsa $_aomodules"
5267 _def_alsa1x="#define HAVE_ALSA1X 1"
5268 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5269 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5270 else
5271 _alsa=no
5272 _res_comment="unknown version"
5274 _ld_extra="$_ld_extra -lasound $_ld_dl $_ld_pthread"
5275 else
5276 _noaomodules="alsa $_noaomodules"
5278 echores "$_alsa"
5281 echocheck "Sun audio"
5282 if test "$_sunaudio" = auto ; then
5283 cat > $TMPC << EOF
5284 #include <sys/types.h>
5285 #include <sys/audioio.h>
5286 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5288 _sunaudio=no
5289 cc_check && _sunaudio=yes
5291 if test "$_sunaudio" = yes ; then
5292 _def_sunaudio='#define USE_SUN_AUDIO 1'
5293 _aosrc="$_aosrc ao_sun.c"
5294 _aomodules="sun $_aomodules"
5295 else
5296 _def_sunaudio='#undef USE_SUN_AUDIO'
5297 _noaomodules="sun $_noaomodules"
5299 echores "$_sunaudio"
5302 if sunos; then
5303 echocheck "Sun mediaLib"
5304 if test "$_mlib" = auto ; then
5305 _mlib=no
5306 cat > $TMPC << EOF
5307 #include <mlib.h>
5308 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5310 cc_check -lmlib && _mlib=yes
5312 test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
5313 echores "$_mlib"
5314 fi #if sunos
5317 if irix; then
5318 echocheck "SGI audio"
5319 if test "$_sgiaudio" = auto ; then
5320 # check for SGI audio
5321 cat > $TMPC << EOF
5322 #include <dmedia/audio.h>
5323 int main(void) { return 0; }
5325 _sgiaudio=no
5326 cc_check && _sgiaudio=yes
5328 if test "$_sgiaudio" = "yes" ; then
5329 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5330 _libs_mplayer="$_libs_mplayer -laudio"
5331 _aosrc="$_aosrc ao_sgi.c"
5332 _aomodules="sgi $_aomodules"
5333 else
5334 _def_sgiaudio='#undef USE_SGI_AUDIO'
5335 _noaomodules="sgi $_noaomodules"
5337 echores "$_sgiaudio"
5338 fi #if irix
5341 echocheck "VCD support"
5342 if linux || bsdos || freebsd || netbsd || sunos || darwin || mingw32; then
5343 _inputmodules="vcd $_inputmodules"
5344 _def_vcd='#define HAVE_VCD 1'
5345 _vcd="yes"
5346 else
5347 _def_vcd='#undef HAVE_VCD'
5348 _noinputmodules="vcd $_noinputmodules"
5349 _res_comment="not supported on this OS"
5350 _vcd="no"
5352 echores "$_vcd"
5356 echocheck "dvdread"
5357 if test "$_dvdread_internal" = auto ; then
5358 _dvdread_internal=no
5359 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5360 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5361 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5362 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5363 _dvdread_internal=yes
5364 _dvdread=yes
5366 elif test "$_dvdread" = auto ; then
5367 _dvdread=no
5368 if test "$_dl" = yes; then
5369 cat > $TMPC << EOF
5370 #include <inttypes.h>
5371 #include <dvdread/dvd_reader.h>
5372 #include <dvdread/ifo_types.h>
5373 #include <dvdread/ifo_read.h>
5374 #include <dvdread/nav_read.h>
5375 int main(void) { return 0; }
5377 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5378 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5382 if test "$_dvdread_internal" = yes; then
5383 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5384 _def_dvdread='#define USE_DVDREAD 1'
5385 _inputmodules="dvdread(internal) $_inputmodules"
5386 _largefiles=yes
5387 _res_comment="internal"
5388 elif test "$_dvdread" = yes; then
5389 _def_dvdread='#define USE_DVDREAD 1'
5390 _largefiles=yes
5391 _ld_extra="$_ld_extra -ldvdread"
5392 _inputmodules="dvdread(external) $_inputmodules"
5393 _res_comment="external"
5394 else
5395 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5396 _def_dvdread='#undef USE_DVDREAD'
5397 _noinputmodules="dvdread $_noinputmodules"
5399 echores "$_dvdread"
5402 echocheck "internal libdvdcss"
5403 if test "$_libdvdcss_internal" = auto ; then
5404 _libdvdcss_internal=no
5405 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5407 if test "$_libdvdcss_internal" = yes ; then
5408 if linux || netbsd || openbsd || bsdos ; then
5409 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5410 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5411 elif freebsd ; then
5412 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5413 elif darwin ; then
5414 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5415 _ld_extra="$_ld_extra -framework IOKit"
5417 _inputmodules="libdvdcss(internal) $_inputmodules"
5418 _largefiles=yes
5419 else
5420 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5422 echores "$_libdvdcss_internal"
5425 echocheck "cdparanoia"
5426 if test "$_cdparanoia" = auto ; then
5427 cat > $TMPC <<EOF
5428 #include <cdda_interface.h>
5429 #include <cdda_paranoia.h>
5430 // This need a better test. How ?
5431 int main(void) {
5432 void *test = cdda_verbose_set;
5433 return test == (void *)1;
5436 _cdparanoia=no
5437 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5438 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5439 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5440 done
5442 if test "$_cdparanoia" = yes ; then
5443 _cdda='yes'
5444 _ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
5445 openbsd && _ld_extra="$_ld_extra -lutil"
5447 echores "$_cdparanoia"
5450 echocheck "libcdio"
5451 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5452 cat > $TMPC << EOF
5453 #include <stdio.h>
5454 #include <cdio/version.h>
5455 #include <cdio/cdda.h>
5456 #include <cdio/paranoia.h>
5457 int main()
5459 void *test = cdda_verbose_set;
5460 printf("%s\n", CDIO_VERSION);
5461 return test == (void *)1;
5465 _libcdio=no
5466 for _ld_tmp in "" "-lwinmm" ; do
5467 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5468 cc_check $_ld_tmp $_ld_lm \
5469 && _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5470 done
5471 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5472 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5473 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5474 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5475 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5478 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5479 _cdda='yes'
5480 _def_libcdio='#define HAVE_LIBCDIO'
5481 _def_havelibcdio='yes'
5482 else
5483 if test "$_cdparanoia" = yes ; then
5484 _res_comment="using cdparanoia"
5486 _def_libcdio='#undef HAVE_LIBCDIO'
5487 _def_havelibcdio='no'
5489 echores "$_libcdio"
5491 if test "$_cdda" = yes ; then
5492 test $_cddb = auto && test $_network = yes && not darwin && _cddb=yes
5493 _def_cdparanoia='#define HAVE_CDDA'
5494 _inputmodules="cdda $_inputmodules"
5495 else
5496 _def_cdparanoia='#undef HAVE_CDDA'
5497 _noinputmodules="cdda $_noinputmodules"
5500 if test "$_cddb" = yes ; then
5501 _def_cddb='#define HAVE_CDDB'
5502 _inputmodules="cddb $_inputmodules"
5503 else
5504 _cddb=no
5505 _def_cddb='#undef HAVE_CDDB'
5506 _noinputmodules="cddb $_noinputmodules"
5509 echocheck "bitmap font support"
5510 if test "$_bitmap_font" = yes ; then
5511 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5512 else
5513 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5515 echores "$_bitmap_font"
5518 echocheck "freetype >= 2.0.9"
5520 # freetype depends on iconv
5521 if test "$_iconv" = no ; then
5522 _freetype=no
5523 _res_comment="iconv support needed"
5526 if test "$_freetype" = auto ; then
5527 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5528 cat > $TMPC << EOF
5529 #include <stdio.h>
5530 #include <ft2build.h>
5531 #include FT_FREETYPE_H
5532 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5533 #error "Need FreeType 2.0.9 or newer"
5534 #endif
5535 int main()
5537 FT_Library library;
5538 FT_Int major=-1,minor=-1,patch=-1;
5539 int err=FT_Init_FreeType(&library);
5540 if(err){
5541 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5542 exit(err);
5544 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5545 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5546 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5547 (int)major,(int)minor,(int)patch );
5548 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5549 printf("Library and header version mismatch! Fix it in your distribution!\n");
5550 exit(1);
5552 return 0;
5555 _freetype=no
5556 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5557 else
5558 _freetype=no
5561 if test "$_freetype" = yes ; then
5562 _def_freetype='#define HAVE_FREETYPE'
5563 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5564 _ld_extra="$_ld_extra `$_freetypeconfig --libs`"
5565 else
5566 _def_freetype='#undef HAVE_FREETYPE'
5568 echores "$_freetype"
5570 if test "$_freetype" = no ; then
5571 _fontconfig=no
5572 _res_comment="freetype support needed"
5574 echocheck "fontconfig"
5575 if test "$_fontconfig" = auto ; then
5576 cat > $TMPC << EOF
5577 #include <stdio.h>
5578 #include <fontconfig/fontconfig.h>
5579 int main()
5581 int err = FcInit();
5582 if(err == FcFalse){
5583 printf("Couldn't initialize fontconfig lib\n");
5584 exit(err);
5586 return 0;
5590 _fontconfig=no
5591 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5592 _ld_tmp="-lfontconfig $_ld_tmp"
5593 cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
5594 done
5595 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5596 _inc_tmp=`$_pkg_config --cflags fontconfig`
5597 _ld_tmp=`$_pkg_config --libs fontconfig`
5598 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5599 && _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5602 if test "$_fontconfig" = yes ; then
5603 _def_fontconfig='#define HAVE_FONTCONFIG'
5604 else
5605 _def_fontconfig='#undef HAVE_FONTCONFIG'
5607 echores "$_fontconfig"
5610 echocheck "SSA/ASS support"
5611 # libass depends on FreeType
5612 if test "$_freetype" = no ; then
5613 _ass=no
5614 _res_comment="FreeType support needed"
5617 if test "$_ass" = auto ; then
5618 cat > $TMPC << EOF
5619 #include <ft2build.h>
5620 #include FT_FREETYPE_H
5621 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5622 #error "Need FreeType 2.1.8 or newer"
5623 #endif
5624 int main() { return 0; }
5626 _ass=no
5627 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5628 if test "$_ass" = no ; then
5629 _res_comment="FreeType >= 2.1.8 needed"
5632 if test "$_ass" = yes ; then
5633 _def_ass='#define USE_ASS'
5634 else
5635 _def_ass='#undef USE_ASS'
5637 echores "$_ass"
5640 echocheck "fribidi with charsets"
5641 if test "$_fribidi" = auto ; then
5642 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5643 cat > $TMPC << EOF
5644 #include <stdio.h>
5645 /* workaround for fribidi 0.10.4 and below */
5646 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5647 #include <fribidi/fribidi.h>
5648 int main()
5650 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5651 printf("Fribidi headers are not consistents with the library!\n");
5652 exit(1);
5654 return 0;
5657 _fribidi=no
5658 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5659 else
5660 _fribidi=no
5663 if test "$_fribidi" = yes ; then
5664 _def_fribidi='#define USE_FRIBIDI'
5665 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5666 _ld_extra="$_ld_extra `$_fribidiconfig --libs`"
5667 else
5668 _def_fribidi='#undef USE_FRIBIDI'
5670 echores "$_fribidi"
5673 echocheck "ENCA"
5674 if test "$_enca" = auto ; then
5675 cat > $TMPC << EOF
5676 #include <enca.h>
5677 int main()
5679 const char **langs;
5680 size_t langcnt;
5681 langs = enca_get_languages(&langcnt);
5682 return 0;
5685 _enca=no
5686 cc_check -lenca $_ld_lm && _enca=yes
5688 if test "$_enca" = yes ; then
5689 _def_enca='#define HAVE_ENCA 1'
5690 _ld_extra="$_ld_extra -lenca"
5691 else
5692 _def_enca='#undef HAVE_ENCA'
5694 echores "$_enca"
5697 echocheck "zlib"
5698 cat > $TMPC << EOF
5699 #include <zlib.h>
5700 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5702 _zlib=no
5703 cc_check -lz && _zlib=yes
5704 if test "$_zlib" = yes ; then
5705 _def_zlib='#define HAVE_ZLIB 1'
5706 _ld_extra="$_ld_extra -lz"
5707 else
5708 _def_zlib='#undef HAVE_ZLIB'
5709 _libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
5710 _libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
5712 echores "$_zlib"
5715 echocheck "RTC"
5716 if test "$_rtc" = auto ; then
5717 cat > $TMPC << EOF
5718 #include <sys/ioctl.h>
5719 #ifdef __linux__
5720 #include <linux/rtc.h>
5721 #else
5722 #include <rtc.h>
5723 #define RTC_PIE_ON RTCIO_PIE_ON
5724 #endif
5725 int main(void) { return RTC_PIE_ON; }
5727 _rtc=no
5728 cc_check && _rtc=yes
5729 ppc && _rtc=no
5731 if test "$_rtc" = yes ; then
5732 _def_rtc='#define HAVE_RTC 1'
5733 else
5734 _def_rtc='#undef HAVE_RTC'
5736 echores "$_rtc"
5739 echocheck "liblzo2 support"
5740 if test "$_liblzo" = auto ; then
5741 _liblzo=no
5742 cat > $TMPC << EOF
5743 #include <lzo/lzo1x.h>
5744 int main(void) { lzo_init();return 0; }
5746 cc_check -llzo2 && _liblzo=yes
5748 if test "$_liblzo" = yes ; then
5749 _def_liblzo='#define USE_LIBLZO 1'
5750 _ld_extra="$_ld_extra -llzo2"
5751 _codecmodules="liblzo $_codecmodules"
5752 else
5753 _def_liblzo='#undef USE_LIBLZO'
5754 _nocodecmodules="liblzo $_nocodecmodules"
5756 echores "$_liblzo"
5759 echocheck "mad support"
5760 if test "$_mad" = auto ; then
5761 _mad=no
5762 cat > $TMPC << EOF
5763 #include <mad.h>
5764 int main(void) { return 0; }
5766 cc_check -lmad && _mad=yes
5768 if test "$_mad" = yes ; then
5769 _def_mad='#define USE_LIBMAD 1'
5770 _ld_extra="$_ld_extra -lmad"
5771 _codecmodules="libmad $_codecmodules"
5772 else
5773 _def_mad='#undef USE_LIBMAD'
5774 _nocodecmodules="libmad $_nocodecmodules"
5776 echores "$_mad"
5778 echocheck "Twolame"
5779 if test "$_twolame" = auto ; then
5780 cat > $TMPC <<EOF
5781 #include <twolame.h>
5782 int main(void) { twolame_init(); return 0; }
5784 _twolame=no
5785 cc_check -ltwolame $_ld_lm && _twolame=yes
5787 if test "$_twolame" = yes ; then
5788 _def_twolame='#define HAVE_TWOLAME 1'
5789 _libs_mencoder="$_libs_mencoder -ltwolame"
5790 _codecmodules="twolame $_codecmodules"
5791 else
5792 _def_twolame='#undef HAVE_TWOLAME'
5793 _nocodecmodules="twolame $_nocodecmodules"
5795 echores "$_twolame"
5797 echocheck "Toolame"
5798 if test "$_toolame" = auto ; then
5799 _toolame=no
5800 if test "$_twolame" = yes ; then
5801 _res_comment="disabled by twolame"
5802 else
5803 cat > $TMPC <<EOF
5804 #include <toolame.h>
5805 int main(void) { toolame_init(); return 0; }
5807 cc_check -ltoolame $_ld_lm && _toolame=yes
5810 if test "$_toolame" = yes ; then
5811 _def_toolame='#define HAVE_TOOLAME 1'
5812 _libs_mencoder="$_libs_mencoder -ltoolame"
5813 _codecmodules="toolame $_codecmodules"
5814 else
5815 _def_toolame='#undef HAVE_TOOLAME'
5816 _nocodecmodules="toolame $_nocodecmodules"
5818 if test "$_toolamedir" ; then
5819 _res_comment="using $_toolamedir"
5821 echores "$_toolame"
5823 echocheck "OggVorbis support"
5824 if test "$_tremor_internal" = yes; then
5825 _libvorbis=no
5826 elif test "$_tremor_external" = auto; then
5827 _tremor_external=no
5828 cat > $TMPC << EOF
5829 #include <tremor/ivorbiscodec.h>
5830 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5832 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5834 if test "$_libvorbis" = auto; then
5835 _libvorbis=no
5836 cat > $TMPC << EOF
5837 #include <vorbis/codec.h>
5838 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5840 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5842 if test "$_tremor_internal" = yes ; then
5843 _vorbis=yes
5844 _def_vorbis='#define HAVE_OGGVORBIS 1'
5845 _def_tremor='#define TREMOR 1'
5846 _codecmodules="tremor(internal) $_codecmodules"
5847 _res_comment="internal Tremor"
5848 if test "$_tremor_low" = yes ; then
5849 _res_comment="internal low accuracy Tremor"
5851 elif test "$_tremor_external" = yes ; then
5852 _vorbis=yes
5853 _def_vorbis='#define HAVE_OGGVORBIS 1'
5854 _def_tremor='#define TREMOR 1'
5855 _codecmodules="tremor(external) $_codecmodules"
5856 _res_comment="external Tremor"
5857 _ld_extra="$_ld_extra -logg -lvorbisidec"
5858 elif test "$_libvorbis" = yes ; then
5859 _vorbis=yes
5860 _def_vorbis='#define HAVE_OGGVORBIS 1'
5861 _codecmodules="libvorbis $_codecmodules"
5862 _res_comment="libvorbis"
5863 _ld_extra="$_ld_extra -lvorbis -logg"
5864 else
5865 _vorbis=no
5866 _nocodecmodules="libvorbis $_nocodecmodules"
5868 if test "$_libvorbis" = no ; then
5869 _libavencoders=`echo $_libavencoders | sed -e s/LIBVORBIS_ENCODER// `
5870 _libavmuxers=`echo $_libavmuxers | sed -e s/OGG_MUXER// `
5872 echores "$_vorbis"
5874 echocheck "libspeex (version >= 1.1 required)"
5875 if test "$_speex" = auto ; then
5876 _speex=no
5877 cat > $TMPC << EOF
5878 #include <speex/speex.h>
5879 int main(void) {
5880 SpeexBits bits;
5881 void *dec;
5882 speex_decode_int(dec, &bits, dec);
5885 cc_check -lspeex $_ld_lm && _speex=yes
5887 if test "$_speex" = yes ; then
5888 _def_speex='#define HAVE_SPEEX 1'
5889 _ld_extra="$_ld_extra -lspeex"
5890 _codecmodules="speex $_codecmodules"
5891 else
5892 _def_speex='#undef HAVE_SPEEX'
5893 _nocodecmodules="speex $_nocodecmodules"
5895 echores "$_speex"
5897 echocheck "OggTheora support"
5898 if test "$_theora" = auto ; then
5899 _theora=no
5900 cat > $TMPC << EOF
5901 #include <theora/theora.h>
5902 #include <string.h>
5903 int main(void)
5905 /* theora is in flux, make sure that all interface routines and
5906 * datatypes exist and work the way we expect it, so we don't break
5907 * mplayer */
5908 ogg_packet op;
5909 theora_comment tc;
5910 theora_info inf;
5911 theora_state st;
5912 yuv_buffer yuv;
5913 int r;
5914 double t;
5916 theora_info_init (&inf);
5917 theora_comment_init (&tc);
5919 return 0;
5921 /* we don't want to execute this kind of nonsense; just for making sure
5922 * that compilation works... */
5923 memset(&op, 0, sizeof(op));
5924 r = theora_decode_header (&inf, &tc, &op);
5925 r = theora_decode_init (&st, &inf);
5926 t = theora_granule_time (&st, op.granulepos);
5927 r = theora_decode_packetin (&st, &op);
5928 r = theora_decode_YUVout (&st, &yuv);
5929 theora_clear (&st);
5931 return 0;
5934 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5935 cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
5936 && _theora=yes && break
5937 done
5938 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5939 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora -logg"; do
5940 cc_check -I. tremor/bitwise.c $_ld_theora \
5941 && _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
5942 done
5945 if test "$_theora" = yes ; then
5946 _def_theora='#define HAVE_OGGTHEORA 1'
5947 _codecmodules="libtheora $_codecmodules"
5948 # when --enable-theora is forced, we'd better provide a probably sane
5949 # $_ld_theora than nothing
5950 test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
5951 else
5952 _def_theora='#undef HAVE_OGGTHEORA'
5953 _nocodecmodules="libtheora $_nocodecmodules"
5955 echores "$_theora"
5957 echocheck "internal mp3lib support"
5958 if test "$_mp3lib" = yes ; then
5959 _def_mp3lib='#define USE_MP3LIB 1'
5960 _codecmodules="mp3lib $_codecmodules"
5961 else
5962 _def_mp3lib='#undef USE_MP3LIB'
5963 _nocodecmodules="mp3lib $_nocodecmodules"
5965 echores "$_mp3lib"
5967 echocheck "internal liba52 support"
5968 if test "$_liba52" = yes ; then
5969 _def_liba52='#define USE_LIBA52 1'
5970 _codecmodules="liba52 $_codecmodules"
5971 else
5972 _def_liba52='#undef USE_LIBA52'
5973 _nocodecmodules="liba52 $_nocodecmodules"
5975 echores "$_liba52"
5977 echocheck "libdca support"
5978 if test "$_libdca" = auto ; then
5979 _libdca=no
5980 cat > $TMPC << EOF
5981 #include <inttypes.h>
5982 #include <dts.h>
5983 int main(void) { dts_init (0); return 0; }
5985 cc_check -ldts $_ld_lm && _libdca=yes
5987 if test "$_libdca" = yes ; then
5988 _def_libdca='#define USE_LIBDCA 1'
5989 _ld_extra="$_ld_extra -ldts"
5990 _codecmodules="libdca $_codecmodules"
5991 else
5992 _def_libdca='#undef USE_LIBDCA'
5993 _nocodecmodules="libdca $_nocodecmodules"
5995 echores "$_libdca"
5997 echocheck "internal libmpeg2 support"
5998 if test "$_libmpeg2" = yes ; then
5999 _def_libmpeg2='#define USE_LIBMPEG2 1'
6000 _codecmodules="libmpeg2 $_codecmodules"
6001 else
6002 _def_libmpeg2='#undef USE_LIBMPEG2'
6003 _nocodecmodules="libmpeg2 $_nocodecmodules"
6005 echores "$_libmpeg2"
6007 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6008 if test "$_musepack" = auto ; then
6009 _musepack=no
6010 cat > $TMPC << EOF
6011 #include <mpcdec/mpcdec.h>
6012 int main(void) {
6013 mpc_streaminfo info;
6014 mpc_decoder decoder;
6015 mpc_decoder_set_streaminfo(&decoder, &info);
6016 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6019 cc_check -lmpcdec $_ld_lm && _musepack=yes
6021 if test "$_musepack" = yes ; then
6022 _def_musepack='#define HAVE_MUSEPACK 1'
6023 _ld_extra="$_ld_extra -lmpcdec"
6024 _codecmodules="musepack $_codecmodules"
6025 else
6026 _def_musepack='#undef HAVE_MUSEPACK'
6027 _nocodecmodules="musepack $_nocodecmodules"
6029 echores "$_musepack"
6032 echocheck "FAAC (AAC encoder) support"
6033 if test "$_faac" = auto ; then
6034 cat > $TMPC <<EOF
6035 #include <inttypes.h>
6036 #include <faac.h>
6037 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6039 _faac=no
6040 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6041 cc_check -O4 $_ld_faac $_ld_lm && _libs_mencoder="$_libs_mencoder $_ld_faac" && _faac=yes && break
6042 done
6044 if test "$_faac" = yes ; then
6045 _def_faac="#define HAVE_FAAC 1"
6046 if echo $_libavencoders | grep -q FAAC ; then
6047 _lavc_faac=yes
6048 _def_lavc_faac="#define CONFIG_LIBFAAC 1"
6049 _libs_mplayer="$_libs_mplayer $_ld_faac"
6050 else
6051 _lavc_faac=no
6052 _def_lavc_faac="#undef CONFIG_LIBFAAC"
6054 _codecmodules="faac $_codecmodules"
6055 else
6056 _def_faac="#undef HAVE_FAAC"
6057 _nocodecmodules="faac $_nocodecmodules"
6058 _libavencoders=`echo $_libavencoders | sed -e s/LIBFAAC_ENCODER// `
6060 echores "$_faac (in libavcodec: $_lavc_faac)"
6063 echocheck "FAAD2 (AAC) support"
6064 if test "$_faad_internal" = auto ; then
6065 if x86_32 && test cc_vendor=gnu; then
6066 case $cc_version in
6067 3.1*|3.2) # ICE/insn with these versions
6068 _faad_internal=no
6069 _res_comment="broken gcc"
6072 _faad_internal=yes
6074 esac
6075 else
6076 _faad_internal=yes
6078 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
6079 _faad_external=no
6080 cat > $TMPC << EOF
6081 #include <faad.h>
6082 #ifndef FAAD_MIN_STREAMSIZE
6083 #error Too old version
6084 #endif
6085 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6087 cc_check -lfaad $_ld_lm && _faad_external=yes
6090 if test "$_faad_internal" = yes ; then
6091 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
6092 _faad=yes
6093 _res_comment="internal floating-point"
6094 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
6095 elif test "$_faad_external" = yes ; then
6096 _faad=yes
6097 _ld_extra="$_ld_extra -lfaad"
6098 else
6099 _def_faad_internal="#undef USE_FAAD_INTERNAL"
6100 _faad=no
6103 if test "$_faad" = yes ; then
6104 _def_faad='#define HAVE_FAAD 1'
6105 _codecmodules="faad2 $_codecmodules"
6106 else
6107 _def_faad='#undef HAVE_FAAD'
6108 _nocodecmodules="faad2 $_nocodecmodules"
6110 echores "$_faad"
6113 echocheck "LADSPA plugin support"
6114 if test "$_ladspa" = auto ; then
6115 cat > $TMPC <<EOF
6116 #include <stdio.h>
6117 #include <ladspa.h>
6118 int main(void) {
6119 const LADSPA_Descriptor *ld = NULL;
6120 return 0;
6123 _ladspa=no
6124 cc_check && _ladspa=yes
6126 if test "$_ladspa" = yes; then
6127 _def_ladspa="#define HAVE_LADSPA"
6128 _afsrc="$_afsrc af_ladspa.c"
6129 _afmodules="ladspa $_afmodules"
6130 else
6131 _def_ladspa="#undef HAVE_LADSPA"
6132 _noafmodules="ladspa $_noafmodules"
6134 echores "$_ladspa"
6137 if test -z "$_codecsdir" ; then
6138 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6139 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6140 if test -d "$dir" ; then
6141 _codecsdir="$dir"
6142 break;
6144 done
6146 # Fall back on default directory.
6147 if test -z "$_codecsdir" ; then
6148 _codecsdir="$_libdir/codecs"
6149 mingw32 && _codecsdir="codecs"
6153 echocheck "Win32 codecs"
6154 if test "$_win32dll" = auto ; then
6155 _win32dll=no
6156 if x86_32 && not qnx; then
6157 _win32dll=yes
6160 if test "$_win32dll" = yes ; then
6161 _def_win32dll='#define USE_WIN32DLL 1'
6162 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6163 _res_comment="using $_win32codecsdir"
6164 if not win32 ; then
6165 _def_win32_loader='#define WIN32_LOADER 1'
6166 else
6167 _ld_extra="$_ld_extra -ladvapi32 -lole32"
6168 _res_comment="using native windows"
6170 _codecmodules="win32 $_codecmodules"
6171 else
6172 _def_win32dll='#undef USE_WIN32DLL'
6173 _def_win32_loader='#undef WIN32_LOADER'
6174 _nocodecmodules="win32 $_nocodecmodules"
6176 echores "$_win32dll"
6179 echocheck "XAnim codecs"
6180 if test "$_xanim" = auto ; then
6181 _xanim=no
6182 _res_comment="dynamic loader support needed"
6183 if test "$_dl" = yes ; then
6184 _xanim=yes
6187 if test "$_xanim" = yes ; then
6188 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6189 _def_xanim='#define USE_XANIM 1'
6190 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6191 _codecmodules="xanim $_codecmodules"
6192 _res_comment="using $_xanimcodecsdir"
6193 else
6194 _def_xanim='#undef USE_XANIM'
6195 _def_xanim_path='#undef XACODEC_PATH'
6196 _nocodecmodules="xanim $_nocodecmodules"
6198 echores "$_xanim"
6201 echocheck "RealPlayer codecs"
6202 if test "$_real" = auto ; then
6203 _real=no
6204 _res_comment="dynamic loader support needed"
6205 if test "$_dl" = yes || test "$_win32dll" = yes &&
6206 (linux || freebsd || netbsd || win32 || darwin) ; then
6207 _real=yes
6210 if test "$_real" = yes ; then
6211 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6212 _def_real='#define USE_REALCODECS 1'
6213 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6214 _codecmodules="real $_codecmodules"
6215 _res_comment="using $_realcodecsdir"
6216 else
6217 _def_real='#undef USE_REALCODECS'
6218 _def_real_path="#undef REALCODEC_PATH"
6219 _nocodecmodules="real $_nocodecmodules"
6221 echores "$_real"
6224 echocheck "QuickTime codecs"
6225 if test "$_qtx" = auto ; then
6226 test "$_win32dll" = yes || darwin && _qtx=yes
6228 if test "$_qtx" = yes ; then
6229 _def_qtx='#define USE_QTX_CODECS 1'
6230 _codecmodules="qtx $_codecmodules"
6231 else
6232 _def_qtx='#undef USE_QTX_CODECS'
6233 _nocodecmodules="qtx $_nocodecmodules"
6235 echores "$_qtx"
6237 echocheck "Nemesi Streaming Media libraries"
6238 if test "$_nemesi" = auto && test "$_network" = yes ; then
6239 _nemesi=no
6240 if $_pkg_config libnemesi --atleast-version=0.6.2 ; then
6241 _ld_extra="$_ld_extra `$_pkg_config --libs libnemesi`"
6242 _nemesi=yes
6245 if test "$_nemesi" = yes; then
6246 _native_rtsp=no
6247 _def_nemesi='#define LIBNEMESI 1'
6248 _inputmodules="nemesi $_inputmodules"
6249 else
6250 _native_rtsp="$_network"
6251 _nemesi=no
6252 _def_nemesi='#undef LIBNEMESI'
6253 _noinputmodules="nemesi $_noinputmodules"
6255 echores "$_nemesi"
6257 echocheck "LIVE555 Streaming Media libraries"
6258 if test "$_live" = auto && test "$_network" = yes ; then
6259 cat > $TMPCPP << EOF
6260 #include <liveMedia.hh>
6261 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6262 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6263 #endif
6264 int main(void) {}
6267 _live=no
6268 for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6269 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6270 $I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
6271 _ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
6272 $_livelibdir/groupsock/libgroupsock.a \
6273 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6274 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6275 $_ld_extra -lstdc++" \
6276 _inc_extraxx="-I$_livelibdir/liveMedia/include \
6277 -I$_livelibdir/UsageEnvironment/include \
6278 -I$_livelibdir/BasicUsageEnvironment/include \
6279 -I$_livelibdir/groupsock/include" && \
6280 _live=yes && break
6281 done
6282 if test "$_live" != yes ; then
6283 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6284 _live_dist=yes
6288 if test "$_live" = yes && test "$_network" = yes && test "$_nemesi" = no; then
6289 _res_comment="using $_livelibdir"
6290 _def_live='#define STREAMING_LIVE555 1'
6291 _inputmodules="live555 $_inputmodules"
6292 elif test "$_live_dist" = yes && test "$_network" = yes && test "$_nemesi" = no; then
6293 _res_comment="using distribution version"
6294 _live="yes"
6295 _def_live='#define STREAMING_LIVE555 1'
6296 _ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6297 _inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6298 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6299 _inputmodules="live555 $_inputmodules"
6300 else
6301 _live=no
6302 _def_live='#undef STREAMING_LIVE555'
6303 _noinputmodules="live555 $_noinputmodules"
6305 echores "$_live"
6308 echocheck "FFmpeg libavutil"
6309 if test "$_libavutil_a" = auto ; then
6310 if test -d libavutil ; then
6311 _libavutil_a=yes
6312 _res_comment="static"
6313 else
6314 die "MPlayer will not compile without libavutil in the source tree."
6316 elif test "$_libavutil_so" = auto ; then
6317 _libavutil_so=no
6318 cat > $TMPC << EOF
6319 #include <ffmpeg/common.h>
6320 int main(void) { ff_gcd(1,1); return 0; }
6322 if $_pkg_config --exists libavutil ; then
6323 _inc_libavutil=`$_pkg_config --cflags libavutil`
6324 _ld_tmp=`$_pkg_config --libs libavutil`
6325 cc_check $_inc_libavutil $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6326 && _libavutil_so=yes
6327 elif cc_check -lavutil $_ld_lm ; then
6328 _ld_extra="$_ld_extra -lavutil"
6329 _libavutil_so=yes
6330 _res_comment="using libavutil.so, but static libavutil is recommended"
6333 _libavutil=no
6334 _def_libavutil='#undef USE_LIBAVUTIL'
6335 _def_libavutil_a='#undef USE_LIBAVUTIL_A'
6336 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6337 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
6338 test "$_libavutil" = yes && _def_libavutil='#define USE_LIBAVUTIL 1'
6339 test "$_libavutil_a" = yes && _def_libavutil_a='#define USE_LIBAVUTIL_A 1'
6340 test "$_libavutil_so" = yes && _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6341 # neither static nor shared libavutil is available, but it is mandatory ...
6342 if test "$_libavutil" = no ; then
6343 die "You need static or shared libavutil, MPlayer will not compile without!"
6345 echores "$_libavutil"
6347 echocheck "FFmpeg libavcodec"
6348 if test "$_libavcodec_a" = auto ; then
6349 _libavcodec_a=no
6350 if test -d libavcodec && test -f libavcodec/utils.c ; then
6351 _libavcodec_a="yes"
6352 _res_comment="static"
6354 elif test "$_libavcodec_so" = auto ; then
6355 _libavcodec_so=no
6356 _res_comment="libavcodec.so is discouraged over static libavcodec"
6357 cat > $TMPC << EOF
6358 #include <ffmpeg/avcodec.h>
6359 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6361 if $_pkg_config --exists libavcodec ; then
6362 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6363 _ld_tmp=`$_pkg_config --libs libavcodec`
6364 cc_check $_inc_libavcodec $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6365 && _libavcodec_so=yes
6366 elif cc_check -lavcodec $_ld_lm ; then
6367 _ld_extra="$_ld_extra -lavcodec"
6368 _libavcodec_so=yes
6369 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6372 _libavcodec=no
6373 _def_libavcodec='#undef USE_LIBAVCODEC'
6374 _def_libavcodec_a='#undef USE_LIBAVCODEC_A'
6375 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6376 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
6377 test "$_libavcodec" = yes && _def_libavcodec='#define USE_LIBAVCODEC 1'
6378 test "$_libavcodec_a" = yes && _def_libavcodec_a='#define USE_LIBAVCODEC_A 1'
6379 test "$_libavcodec_so" = yes && _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6380 test "$_libavcodec_mpegaudio_hp" = yes \
6381 && _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6382 if test "$_libavcodec_a" = yes ; then
6383 _codecmodules="libavcodec $_codecmodules"
6384 elif test "$_libavcodec_so" = yes ; then
6385 _codecmodules="libavcodec.so $_codecmodules"
6386 else
6387 _nocodecmodules="libavcodec $_nocodecmodules"
6389 echores "$_libavcodec"
6391 echocheck "FFmpeg libavformat"
6392 if test "$_libavformat_a" = auto ; then
6393 _libavformat_a=no
6394 if test -d libavformat && test -f libavformat/utils.c ; then
6395 _libavformat_a=yes
6396 _res_comment="static"
6398 elif test "$_libavformat_so" = auto ; then
6399 _libavformat_so=no
6400 cat > $TMPC <<EOF
6401 #include <ffmpeg/avformat.h>
6402 #include <ffmpeg/opt.h>
6403 int main(void) { av_alloc_format_context(); return 0; }
6405 if $_pkg_config --exists libavformat ; then
6406 _inc_libavformat=`$_pkg_config --cflags libavformat`
6407 _ld_tmp=`$_pkg_config --libs libavformat`
6408 cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
6409 && _libavformat_so=yes
6410 elif cc_check $_ld_lm -lavformat ; then
6411 _ld_extra="$_ld_extra -lavformat"
6412 _libavformat_so=yes
6413 _res_comment="using libavformat.so, but static libavformat is recommended"
6416 _libavformat=no
6417 _def_libavformat='#undef USE_LIBAVFORMAT'
6418 _def_libavformat_a='#undef USE_LIBAVFORMAT_A'
6419 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6420 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
6421 test "$_libavformat" = yes && _def_libavformat='#define USE_LIBAVFORMAT 1'
6422 test "$_libavformat_a" = yes && _def_libavformat_a='#define USE_LIBAVFORMAT_A 1'
6423 test "$_libavformat_so" = yes \
6424 && _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6425 echores "$_libavformat"
6427 echocheck "FFmpeg libpostproc"
6428 if test "$_libpostproc_a" = auto ; then
6429 _libpostproc_a=no
6430 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6431 _libpostproc_a='yes'
6432 _res_comment="static"
6434 elif test "$_libpostproc_so" = auto ; then
6435 _libpostproc_so=no
6436 cat > $TMPC << EOF
6437 #define USE_LIBPOSTPROC 1
6438 #include <inttypes.h>
6439 #include <postproc/postprocess.h>
6440 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6442 if cc_check -lpostproc $_ld_lm ; then
6443 _ld_extra="$_ld_extra -lpostproc"
6444 _libpostproc_so=yes
6445 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6448 _libpostproc=no
6449 _def_libpostproc='#undef USE_LIBPOSTPROC'
6450 _def_libpostproc_a='#undef USE_LIBPOSTPROC_A'
6451 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6452 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
6453 test "$_libpostproc" = yes && _def_libpostproc='#define USE_LIBPOSTPROC 1'
6454 test "$_libpostproc_a" = yes && _def_libpostproc_a='#define USE_LIBPOSTPROC_A 1'
6455 test "$_libpostproc_so" = yes \
6456 && _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6457 echores "$_libpostproc"
6460 echocheck "libamr narrowband"
6461 if test "$_libamr_nb" = auto ; then
6462 _libamr_nb=no
6463 cat > $TMPC << EOF
6464 #include <amrnb/interf_dec.h>
6465 int main(void) { Speech_Decode_Frame_init(); return 0; }
6467 cc_check -lamrnb && _libamr_nb=yes
6468 if test "$_libavcodec_a" != yes ; then
6469 _libamr_nb=no
6470 _res_comment="libavcodec (static) is required by libamr_nb, sorry"
6473 if test "$_libamr_nb" = yes ; then
6474 _libamr=yes
6475 _ld_extra="$_ld_extra -lamrnb"
6476 _def_libamr='#define CONFIG_LIBAMR 1'
6477 _def_libamr_nb='#define CONFIG_LIBAMR_NB 1'
6478 _codecmodules="libamr_nb $_codecmodules"
6479 else
6480 _def_libamr_nb='#undef CONFIG_LIBAMR_NB'
6481 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_NB_DECODER// `
6482 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_NB_ENCODER// `
6483 _nocodecmodules="libamr_nb $_nocodecmodules"
6485 echores "$_libamr_nb"
6488 echocheck "libamr wideband"
6489 if test "$_libamr_wb" = auto ; then
6490 _libamr_wb=no
6491 cat > $TMPC << EOF
6492 #include <amrwb/dec_if.h>
6493 int main(void) { D_IF_init(); return 0; }
6495 cc_check -lamrwb && _libamr_wb=yes
6496 if test "$_libavcodec_a" != yes ; then
6497 _libamr_wb=no
6498 _res_comment="libavcodec (static) is required by libamr_wb, sorry"
6501 if test "$_libamr_wb" = yes ; then
6502 _libamr=yes
6503 _ld_extra="$_ld_extra -lamrwb"
6504 _def_libamr='#define CONFIG_LIBAMR 1'
6505 _def_libamr_wb='#define CONFIG_LIBAMR_WB 1'
6506 _codecmodules="libamr_wb $_codecmodules"
6507 else
6508 _def_libamr_wb='#undef CONFIG_LIBAMR_WB'
6509 _libavdecoders=`echo $_libavdecoders | sed -e s/LIBAMR_WB_DECODER// `
6510 _libavencoders=`echo $_libavencoders | sed -e s/LIBAMR_WB_ENCODER// `
6511 _nocodecmodules="libamr_wb $_nocodecmodules"
6513 echores "$_libamr_wb"
6515 echocheck "libdv-0.9.5+"
6516 if test "$_libdv" = auto ; then
6517 _libdv=no
6518 cat > $TMPC <<EOF
6519 #include <libdv/dv.h>
6520 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6522 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6524 if test "$_libdv" = yes ; then
6525 _def_libdv='#define HAVE_LIBDV095 1'
6526 _ld_extra="$_ld_extra -ldv"
6527 _codecmodules="libdv $_codecmodules"
6528 else
6529 _def_libdv='#undef HAVE_LIBDV095'
6530 _nocodecmodules="libdv $_nocodecmodules"
6532 echores "$_libdv"
6535 echocheck "XviD"
6536 if test "$_xvid" = auto ; then
6537 _xvid=no
6538 cat > $TMPC << EOF
6539 #include <xvid.h>
6540 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6542 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6543 cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
6544 done
6547 if test "$_xvid" = yes ; then
6548 _def_xvid='#define HAVE_XVID4 1'
6549 _codecmodules="xvid $_codecmodules"
6550 else
6551 _def_xvid='#undef HAVE_XVID4'
6552 _nocodecmodules="xvid $_nocodecmodules"
6553 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6555 echores "$_xvid"
6557 if test "$_xvid" = yes ; then
6558 echocheck "XviD two pass plugin"
6559 cat > $TMPC << EOF
6560 #include <xvid.h>
6561 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6563 if cc_check ; then
6564 _lavc_xvid=yes
6565 _def_lavc_xvid='#define CONFIG_LIBXVID 1'
6566 else
6567 _lavc_xvid=no
6568 _def_lavc_xvid='#undef CONFIG_LIBXVID'
6569 _libavencoders=`echo $_libavencoders | sed -e s/LIBXVID_ENCODER// `
6571 echores "$_lavc_xvid"
6575 echocheck "x264"
6576 if test "$_x264" = auto ; then
6577 cat > $TMPC << EOF
6578 #include <inttypes.h>
6579 #include <x264.h>
6580 #if X264_BUILD < 53
6581 #error We do not support old versions of x264. Get the latest from SVN.
6582 #endif
6583 int main(void) { x264_encoder_open((void*)0); return 0; }
6585 _x264=no
6586 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6587 cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes && break
6588 done
6591 if test "$_x264" = yes ; then
6592 _def_x264='#define HAVE_X264 1'
6593 _codecmodules="x264 $_codecmodules"
6594 if echo $_libavencoders | grep -q X264 ; then
6595 _lavc_x264=yes
6596 _def_lavc_x264='#define CONFIG_LIBX264 1'
6597 _libs_mplayer="$_libs_mplayer $_ld_x264"
6598 else
6599 _lavc_x264=no
6600 _def_lavc_x264='#undef CONFIG_LIBX264'
6602 else
6603 _lavc_x264=no
6604 _def_x264='#undef HAVE_X264'
6605 _def_lavc_x264='#undef CONFIG_LIBX264'
6606 _nocodecmodules="x264 $_nocodecmodules"
6607 _libavencoders=`echo $_libavencoders | sed -e s/LIBX264_ENCODER// `
6609 echores "$_x264 (in libavcodec: $_lavc_x264)"
6612 echocheck "libnut"
6613 if test "$_libnut" = auto ; then
6614 cat > $TMPC << EOF
6615 #include <stdio.h>
6616 #include <stdlib.h>
6617 #include <inttypes.h>
6618 #include <libnut.h>
6619 int main(void) { (void)nut_error(0); return 0; }
6621 _libnut=no
6622 cc_check -lnut && _libnut=yes
6625 if test "$_libnut" = yes ; then
6626 _def_libnut='#define HAVE_LIBNUT 1'
6627 _ld_extra="$_ld_extra -lnut"
6628 else
6629 _def_libnut='#undef HAVE_LIBNUT'
6630 _libavmuxers=`echo $_libavmuxers | sed -e s/LIBNUT_MUXER// `
6632 echores "$_libnut"
6635 # mencoder requires (optional) those libs: libmp3lame
6636 if test "$_mencoder" != no ; then
6638 echocheck "libmp3lame (for mencoder)"
6639 _mp3lame=no
6640 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6641 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6642 cat > $TMPC <<EOF
6643 #include <lame/lame.h>
6644 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; }
6646 # Note: libmp3lame usually depends on vorbis
6647 cc_check -lmp3lame $_ld_lm && tmp_run && _mp3lame=yes
6648 if test "$_mp3lame" = yes ; then
6649 _def_mp3lame="#define HAVE_MP3LAME"
6650 _ld_mp3lame=-lmp3lame
6651 _libs_mencoder="$_libs_mencoder $_ld_mp3lame"
6652 cat > $TMPC << EOF
6653 #include <lame/lame.h>
6654 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
6656 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6657 cat > $TMPC << EOF
6658 #include <lame/lame.h>
6659 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
6661 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6662 if echo $_libavencoders | grep -q MP3LAME ; then
6663 _lavc_mp3lame=yes
6664 _def_lavc_mp3lame="#define CONFIG_LIBMP3LAME 1"
6665 _libs_mplayer="$_libs_mplayer $_ld_mp3lame"
6666 else
6667 _lavc_mp3lame=no
6668 _def_lavc_mp3lame="#undef CONFIG_LIBMP3LAME"
6670 else
6671 _def_mp3lame='#undef HAVE_MP3LAME'
6672 _libavencoders=`echo $_libavencoders | sed -e s/MP3LAME_ENCODER// `
6674 echores "$_mp3lame"
6678 echocheck "mencoder"
6679 _mencoder_flag='#undef HAVE_MENCODER'
6680 if test "$_mencoder" = yes ; then
6681 _mencoder_flag='#define HAVE_MENCODER'
6682 _def_muxers='#define CONFIG_MUXERS 1'
6683 else
6684 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6685 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
6686 _libavmuxers=""
6688 echores "$_mencoder"
6690 echocheck "fastmemcpy"
6691 # fastmemcpy check is done earlier with tests of CPU & binutils features
6692 if test "$_fastmemcpy" = yes ; then
6693 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6694 else
6695 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6697 echores "$_fastmemcpy"
6699 echocheck "UniquE RAR File Library"
6700 if test "$_unrarlib" = yes ; then
6701 _def_unrarlib='#define USE_UNRARLIB 1'
6702 else
6703 _def_unrarlib='#undef USE_UNRARLIB'
6705 echores "$_unrarlib"
6707 echocheck "TV interface"
6708 if test "$_tv" = yes ; then
6709 _def_tv='#define USE_TV 1'
6710 _inputmodules="tv $_inputmodules"
6711 else
6712 _noinputmodules="tv $_noinputmodules"
6713 _def_tv='#undef USE_TV'
6715 echores "$_tv"
6718 if bsd; then
6719 echocheck "*BSD BT848 bt8xx header"
6720 _ioctl_bt848_h=no
6721 for file in "machine/ioctl_bt848.h" \
6722 "dev/bktr/ioctl_bt848.h" \
6723 "dev/video/bktr/ioctl_bt848.h" \
6724 "dev/ic/bt8xx.h" ; do
6725 cat > $TMPC <<EOF
6726 #include <sys/types.h>
6727 #include <$file>
6728 int main(void) {
6729 ioctl(0, TVTUNER_GETFREQ, 0);
6730 return 0;
6733 if cc_check ; then
6734 _ioctl_bt848_h=yes
6735 _ioctl_bt848_h_name="$file"
6736 break;
6738 done
6739 if test "$_ioctl_bt848_h" = yes ; then
6740 _def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6741 _res_comment="using $_ioctl_bt848_h_name"
6742 else
6743 _def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6745 echores "$_ioctl_bt848_h"
6747 echocheck "*BSD ioctl_meteor.h"
6748 _ioctl_meteor_h=no
6749 for file in "machine/ioctl_meteor.h" \
6750 "dev/bktr/ioctl_meteor.h" \
6751 "dev/video/bktr/ioctl_meteor.h" ; do
6752 cat > $TMPC <<EOF
6753 #include <sys/types.h>
6754 #include <$file>
6755 int main(void) {
6756 ioctl(0, METEORSINPUT, 0);
6757 return 0;
6760 if cc_check ; then
6761 _ioctl_meteor_h=yes
6762 _ioctl_meteor_h_name="$file"
6763 break;
6765 done
6766 if test "$_ioctl_meteor_h" = yes ; then
6767 _def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
6768 _res_comment="using $_ioctl_meteor_h_name"
6769 else
6770 _def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
6772 echores "$_ioctl_meteor_h"
6774 echocheck "*BSD BrookTree 848 TV interface"
6775 if test "$_tv_bsdbt848" = auto ; then
6776 _tv_bsdbt848=no
6777 if test "$_tv" = yes ; then
6778 cat > $TMPC <<EOF
6779 #include <sys/types.h>
6780 $_def_ioctl_meteor_h_name
6781 $_def_ioctl_bt848_h_name
6782 #ifdef IOCTL_METEOR_H_NAME
6783 #include IOCTL_METEOR_H_NAME
6784 #endif
6785 #ifdef IOCTL_BT848_H_NAME
6786 #include IOCTL_BT848_H_NAME
6787 #endif
6788 int main(void){
6789 ioctl(0, METEORSINPUT, 0);
6790 ioctl(0, TVTUNER_GETFREQ, 0);
6791 return 0;
6794 cc_check && _tv_bsdbt848=yes
6797 if test "$_tv_bsdbt848" = yes ; then
6798 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6799 _inputmodules="tv-bsdbt848 $_inputmodules"
6800 else
6801 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6802 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6804 echores "$_tv_bsdbt848"
6805 fi #if bsd
6808 echocheck "Video 4 Linux TV interface"
6809 if test "$_tv_v4l1" = auto ; then
6810 _tv_v4l1=no
6811 if test "$_tv" = yes && linux ; then
6812 cat > $TMPC <<EOF
6813 #include <stdlib.h>
6814 #include <linux/videodev.h>
6815 int main(void) { return 0; }
6817 cc_check && _tv_v4l1=yes
6820 if test "$_tv_v4l1" = yes ; then
6821 _audio_input=yes
6822 _tv_v4l=yes
6823 _def_tv_v4l='#define HAVE_TV_V4L 1'
6824 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6825 _inputmodules="tv-v4l $_inputmodules"
6826 else
6827 _noinputmodules="tv-v4l1 $_noinputmodules"
6828 _def_tv_v4l='#undef HAVE_TV_V4L'
6830 echores "$_tv_v4l1"
6833 echocheck "Video 4 Linux 2 TV interface"
6834 if test "$_tv_v4l2" = auto ; then
6835 _tv_v4l2=no
6836 if test "$_tv" = yes && linux ; then
6837 cat > $TMPC <<EOF
6838 #include <stdlib.h>
6839 #include <linux/types.h>
6840 #include <linux/videodev2.h>
6841 int main(void) { return 0; }
6843 cc_check && _tv_v4l2=yes
6846 if test "$_tv_v4l2" = yes ; then
6847 _audio_input=yes
6848 _tv_v4l=yes
6849 _def_tv_v4l='#define HAVE_TV_V4L 1'
6850 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6851 _inputmodules="tv-v4l2 $_inputmodules"
6852 else
6853 _noinputmodules="tv-v4l2 $_noinputmodules"
6854 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6856 echores "$_tv_v4l2"
6859 echocheck "TV teletext interface"
6860 if test "$_tv_teletext" = auto ; then
6861 _tv_teletext=no
6862 if test "$_freetype" = yes && test "$_pthreads" = yes ; then
6863 if test "$_tv_v4l2" = yes || test "$_v4l" = yes ; then
6864 _tv_teletext=yes
6868 if test "$_tv_teletext" = yes ; then
6869 _def_tv_teletext='#define HAVE_TV_TELETEXT 1'
6870 _inputmodules="tv-teletext $_inputmodules"
6871 else
6872 _noinputmodules="tv-teletext $_noinputmodules"
6873 _def_tv_teletext='#undef HAVE_TV_TELETEXT'
6875 echores "$_tv_teletext"
6878 echocheck "Radio interface"
6879 if test "$_radio" = yes ; then
6880 _def_radio='#define USE_RADIO 1'
6881 _inputmodules="radio $_inputmodules"
6882 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6883 _radio_capture=no
6885 if test "$_radio_capture" = yes ; then
6886 _audio_input=yes
6887 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6888 else
6889 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6891 else
6892 _noinputmodules="radio $_noinputmodules"
6893 _def_radio='#undef USE_RADIO'
6894 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6895 _radio_capture=no
6897 echores "$_radio"
6898 echocheck "Capture for Radio interface"
6899 echores "$_radio_capture"
6901 echocheck "Video 4 Linux 2 Radio interface"
6902 if test "$_radio_v4l2" = auto ; then
6903 _radio_v4l2=no
6904 if test "$_radio" = yes && linux ; then
6905 cat > $TMPC <<EOF
6906 #include <stdlib.h>
6907 #include <linux/types.h>
6908 #include <linux/videodev2.h>
6909 int main(void) { return 0; }
6911 cc_check && _radio_v4l2=yes
6914 if test "$_radio_v4l2" = yes ; then
6915 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6916 else
6917 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6919 echores "$_radio_v4l2"
6921 echocheck "Video 4 Linux Radio interface"
6922 if test "$_radio_v4l" = auto ; then
6923 _radio_v4l=no
6924 if test "$_radio" = yes && linux ; then
6925 cat > $TMPC <<EOF
6926 #include <stdlib.h>
6927 #include <linux/videodev.h>
6928 int main(void) { return 0; }
6930 cc_check && _radio_v4l=yes
6933 if test "$_radio_v4l" = yes ; then
6934 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6935 else
6936 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6938 echores "$_radio_v4l"
6940 if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
6941 echocheck "*BSD BrookTree 848 Radio interface"
6942 _radio_bsdbt848=no
6943 cat > $TMPC <<EOF
6944 #include <sys/types.h>
6945 $_def_ioctl_bt848_h_name
6946 #ifdef IOCTL_BT848_H_NAME
6947 #include IOCTL_BT848_H_NAME
6948 #endif
6949 int main(void){
6950 ioctl(0, RADIO_GETFREQ, 0);
6951 return 0;
6954 cc_check && _radio_bsdbt848=yes
6955 echores "$_radio_bsdbt848"
6956 fi #if bsd && radio && radio_bsdbt848
6958 if test "$_radio_bsdbt848" = yes ; then
6959 _def_radio_bsdbt848='#define HAVE_RADIO_BSDBT848 1'
6960 else
6961 _def_radio_bsdbt848='#undef HAVE_RADIO_BSDBT848'
6964 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
6965 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
6966 die "Radio driver requires BSD BT848, V4L or V4L2!"
6969 echocheck "Video 4 Linux 2 MPEG PVR interface"
6970 if test "$_pvr" = auto ; then
6971 _pvr=no
6972 if test "$_tv_v4l2" = yes && linux ; then
6973 cat > $TMPC <<EOF
6974 #include <stdlib.h>
6975 #include <inttypes.h>
6976 #include <linux/types.h>
6977 #include <linux/videodev2.h>
6978 int main(void) { struct v4l2_ext_controls ext; return 0; }
6980 cc_check && _pvr=yes
6983 if test "$_pvr" = yes ; then
6984 _def_pvr='#define HAVE_PVR 1'
6985 _inputmodules="pvr $_inputmodules"
6986 else
6987 _noinputmodules="pvr $_noinputmodules"
6988 _def_pvr='#undef HAVE_PVR'
6990 echores "$_pvr"
6993 echocheck "audio select()"
6994 if test "$_select" = no ; then
6995 _def_select='#undef HAVE_AUDIO_SELECT'
6996 elif test "$_select" = yes ; then
6997 _def_select='#define HAVE_AUDIO_SELECT 1'
6999 echores "$_select"
7002 echocheck "ftp"
7003 if not beos && test "$_ftp" = yes ; then
7004 _def_ftp='#define HAVE_FTP 1'
7005 _inputmodules="ftp $_inputmodules"
7006 else
7007 _noinputmodules="ftp $_noinputmodules"
7008 _def_ftp='#undef HAVE_FTP'
7010 echores "$_ftp"
7012 echocheck "vstream client"
7013 if test "$_vstream" = auto ; then
7014 _vstream=no
7015 cat > $TMPC <<EOF
7016 #include <vstream-client.h>
7017 void vstream_error(const char *format, ... ) {}
7018 int main(void) { vstream_start(); return 0; }
7020 cc_check -lvstream-client && _vstream=yes
7022 if test "$_vstream" = yes ; then
7023 _def_vstream='#define HAVE_VSTREAM 1'
7024 _inputmodules="vstream $_inputmodules"
7025 _ld_extra="$_ld_extra -lvstream-client"
7026 else
7027 _noinputmodules="vstream $_noinputmodules"
7028 _def_vstream='#undef HAVE_VSTREAM'
7030 echores "$_vstream"
7032 # endian testing
7033 echocheck "byte order"
7034 if test "$_big_endian" = auto ; then
7035 cat > $TMPC <<EOF
7036 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
7037 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
7038 int main(){
7039 return (int)ascii_name;
7042 if cc_check ; then
7043 if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
7044 _big_endian=yes
7045 else
7046 _big_endian=no
7048 else
7049 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
7052 if test "$_big_endian" = yes ; then
7053 _byte_order='big-endian'
7054 _def_words_endian='#define WORDS_BIGENDIAN 1'
7055 else
7056 _byte_order='little-endian'
7057 _def_words_endian='#undef WORDS_BIGENDIAN'
7059 echores "$_byte_order"
7061 echocheck "OSD menu"
7062 if test "$_menu" = yes ; then
7063 _def_menu='#define HAVE_MENU 1'
7064 else
7065 _def_menu='#undef HAVE_MENU'
7067 echores "$_menu"
7070 echocheck "Subtitles sorting"
7071 if test "$_sortsub" = yes ; then
7072 _def_sortsub='#define USE_SORTSUB 1'
7073 else
7074 _def_sortsub='#undef USE_SORTSUB'
7076 echores "$_sortsub"
7079 echocheck "XMMS inputplugin support"
7080 if test "$_xmms" = yes ; then
7081 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7082 _xmmsplugindir=`xmms-config --input-plugin-dir`
7083 _xmmslibdir=`xmms-config --exec-prefix`/lib
7084 else
7085 _xmmsplugindir=/usr/lib/xmms/Input
7086 _xmmslibdir=/usr/lib
7089 _def_xmms='#define HAVE_XMMS 1'
7090 if darwin ; then
7091 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.dylib"
7092 else
7093 _ld_extra="$_ld_extra ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7095 else
7096 _def_xmms='#undef HAVE_XMMS'
7098 echores "$_xmms"
7100 echocheck "inet6"
7101 if test "$_inet6" = auto ; then
7102 cat > $TMPC << EOF
7103 #include <sys/types.h>
7104 #include <sys/socket.h>
7105 #include <netinet/in.h>
7106 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
7108 _inet6=no
7109 if cc_check ; then
7110 _inet6=yes
7113 if test "$_inet6" = yes ; then
7114 _def_inet6='#define HAVE_AF_INET6 1'
7115 else
7116 _def_inet6='#undef HAVE_AF_INET6'
7118 echores "$_inet6"
7121 echocheck "gethostbyname2"
7122 if test "$_gethostbyname2" = auto ; then
7123 cat > $TMPC << EOF
7124 #include <sys/types.h>
7125 #include <sys/socket.h>
7126 #include <netdb.h>
7127 int main(void) { gethostbyname2("", AF_INET); }
7129 _gethostbyname2=no
7130 if cc_check ; then
7131 _gethostbyname2=yes
7135 if test "$_gethostbyname2" = yes ; then
7136 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
7137 else
7138 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
7140 echores "$_gethostbyname2"
7143 # --------------- GUI specific tests begin -------------------
7144 echocheck "GUI"
7145 echo "$_gui"
7146 if test "$_gui" = yes ; then
7148 # Required libraries
7149 if test "$_libavcodec" != yes ||
7150 not "echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1" ; then
7151 die "The GUI requires libavcodec with PNG support (needs zlib)."
7153 if not win32 ; then
7154 test "$_x11" != yes && die "X11 support required for GUI compilation."
7156 echocheck "XShape extension"
7157 if test "$_xshape" = auto ; then
7158 _xshape=no
7159 cat > $TMPC << EOF
7160 #include <X11/Xlib.h>
7161 #include <X11/Xproto.h>
7162 #include <X11/Xutil.h>
7163 #include <X11/extensions/shape.h>
7164 #include <stdlib.h>
7165 int main(void) {
7166 char *name = ":0.0";
7167 Display *wsDisplay;
7168 int exitvar = 0;
7169 int eventbase, errorbase;
7170 if (getenv("DISPLAY"))
7171 name=getenv("DISPLAY");
7172 wsDisplay=XOpenDisplay(name);
7173 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7174 exitvar=1;
7175 XCloseDisplay(wsDisplay);
7176 return exitvar;
7179 cc_check -lXext && _xshape=yes
7181 if test "$_xshape" = yes ; then
7182 _def_xshape='#define HAVE_XSHAPE 1'
7183 else
7184 die "The GUI requires the X11 extension XShape (which was not found)."
7186 echores "$_xshape"
7188 #Check for GTK
7189 if test "$_gtk1" = no ; then
7190 #Check for GTK2 :
7191 echocheck "GTK+ version"
7193 if $_pkg_config gtk+-2.0 --exists ; then
7194 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
7195 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
7196 _libs_mplayer="$_libs_mplayer `$_pkg_config gtk+-2.0 --libs 2>/dev/null`"
7197 echores "$_gtk"
7199 # Check for GLIB2
7200 if $_pkg_config glib-2.0 --exists ; then
7201 echocheck "glib version"
7202 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
7203 _libs_mplayer="$_libs_mplayer `$_pkg_config glib-2.0 --libs 2>/dev/null`"
7204 echores "$_glib"
7206 _def_gui='#define HAVE_NEW_GUI 1'
7207 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7208 else
7209 _gtk1=yes
7210 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7212 else
7213 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7214 _gtk1=yes
7218 if test "$_gtk1" = yes ; then
7219 # Check for old GTK (1.2.x)
7220 echocheck "GTK version"
7221 if test -z "$_gtkconfig" ; then
7222 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7223 _gtkconfig="gtk-config"
7224 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7225 _gtkconfig="gtk12-config"
7226 else
7227 die "The GUI requires GTK devel packages (which were not found)."
7230 _gtk=`$_gtkconfig --version 2>&1`
7231 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7232 _libs_mplayer="$_libs_mplayer `$_gtkconfig --libs 2>&1`"
7233 echores "$_gtk (using $_gtkconfig)"
7235 # Check for GLIB
7236 echocheck "glib version"
7237 if test -z "$_glibconfig" ; then
7238 if ( glib-config --version ) >/dev/null 2>&1 ; then
7239 _glibconfig="glib-config"
7240 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7241 _glibconfig="glib12-config"
7242 else
7243 die "The GUI requires GLIB devel packages (which were not found)"
7246 _glib=`$_glibconfig --version 2>&1`
7247 _libs_mplayer="$_libs_mplayer `$_glibconfig --libs 2>&1`"
7248 echores "$_glib (using $_glibconfig)"
7250 _def_gui='#define HAVE_NEW_GUI 1'
7251 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7254 else #if not win32
7255 _libs_mplayer="$_libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
7256 _def_gui='#define HAVE_NEW_GUI 1'
7257 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7258 fi #if not win32
7260 else #if test "$_gui"
7261 _def_gui='#undef HAVE_NEW_GUI'
7262 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7263 fi #if test "$_gui"
7264 # --------------- GUI specific tests end -------------------
7267 if test "$_charset" = "noconv" ; then
7268 _charset=""
7270 if test "$_charset" ; then
7271 _def_charset="#define MSG_CHARSET \"$_charset\""
7272 else
7273 _def_charset="#undef MSG_CHARSET"
7276 if test "$_charset" = "UTF-8" ; then
7277 # hack to disable conversion in the Makefile
7278 _charset=""
7281 if test "$_charset" ; then
7282 echocheck "iconv program"
7283 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7284 if test "$?" -ne 0 ; then
7285 echores "no"
7286 echo "No working iconv program found, use "
7287 echo "--charset=UTF-8 to continue anyway."
7288 echo "If you also have problems with iconv library functions use --charset=noconv."
7289 echo "Messages in the GTK-2 interface will be broken then."
7290 exit 1
7291 else
7292 echores "yes"
7296 #############################################################################
7298 echocheck "automatic gdb attach"
7299 if test "$_crash_debug" = yes ; then
7300 _def_crash_debug='#define CRASH_DEBUG 1'
7301 else
7302 _def_crash_debug='#undef CRASH_DEBUG'
7303 _crash_debug=no
7305 echores "$_crash_debug"
7307 echocheck "compiler support for noexecstack"
7308 cat > $TMPC <<EOF
7309 int main(void) { return 0; }
7311 if cc_check -Wl,-z,noexecstack ; then
7312 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7313 echores "yes"
7314 else
7315 echores "no"
7319 # Dynamic linking flags
7320 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7321 _ld_dl_dynamic=''
7322 bsd && _ld_dl_dynamic='-rdynamic'
7323 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7324 _ld_dl_dynamic='-rdynamic'
7327 _ld_extra="$_ld_extra $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7328 bsdos && _ld_extra="$_ld_extra -ldvd"
7329 netbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7330 openbsd && x86_32 && _ld_extra="$_ld_extra -li386"
7332 _def_debug='#undef MP_DEBUG'
7333 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7335 _def_linux='#undef TARGET_LINUX'
7336 linux && _def_linux='#define TARGET_LINUX 1'
7339 echocheck "joystick"
7340 _def_joystick='#undef HAVE_JOYSTICK'
7341 if test "$_joystick" = yes ; then
7342 if linux ; then
7343 # TODO add some check
7344 _def_joystick='#define HAVE_JOYSTICK 1'
7345 else
7346 _joystick="no (unsupported under $system_name)"
7349 echores "$_joystick"
7351 echocheck "lirc"
7352 if test "$_lirc" = auto ; then
7353 _lirc=no
7354 cat > $TMPC <<EOF
7355 #include <lirc/lirc_client.h>
7356 int main(void) { return 0; }
7358 cc_check -llirc_client && _lirc=yes
7360 if test "$_lirc" = yes ; then
7361 _def_lirc='#define HAVE_LIRC 1'
7362 _ld_extra="$_ld_extra -llirc_client"
7363 else
7364 _def_lirc='#undef HAVE_LIRC'
7366 echores "$_lirc"
7368 echocheck "lircc"
7369 if test "$_lircc" = auto ; then
7370 _lircc=no
7371 cat > $TMPC <<EOF
7372 #include <lirc/lircc.h>
7373 int main(void) { return 0; }
7375 cc_check -llircc && _lircc=yes
7377 if test "$_lircc" = yes ; then
7378 _def_lircc='#define HAVE_LIRCC 1'
7379 _ld_extra="$_ld_extra -llircc"
7380 else
7381 _def_lircc='#undef HAVE_LIRCC'
7383 echores "$_lircc"
7385 if arm; then
7386 # Detect maemo development platform libraries availability (http://www.maemo.org),
7387 # they are used when run on Nokia 770
7388 echocheck "maemo (Nokia 770)"
7389 if test "$_maemo" = auto ; then
7390 _maemo=no
7391 cat > $TMPC << EOF
7392 #include <libosso.h>
7393 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7395 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7397 if test "$_maemo" = yes ; then
7398 _def_maemo='#define HAVE_MAEMO 1'
7399 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7400 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7401 else
7402 _def_maemo='#undef HAVE_MAEMO'
7404 echores "$_maemo"
7407 echocheck "color console output"
7408 if test "$_color_console" = yes ; then
7409 _def_color_console='#define MSG_USE_COLORS 1'
7410 else
7411 _def_color_console='#undef MSG_USE_COLORS'
7413 echores "$_color_console"
7415 # linker paths should be the same for mencoder and mplayer
7416 _ld_tmp=""
7417 for I in $_libs_mplayer ; do
7418 _tmp=`echo $I | sed -e 's/^-L.*$//'`
7419 if test -z "$_tmp" ; then
7420 _ld_extra="$I $_ld_extra"
7421 else
7422 _ld_tmp="$_ld_tmp $I"
7424 done
7425 _libs_mplayer=$_ld_tmp
7428 #############################################################################
7429 if darwin ; then
7430 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -shared-libgcc"
7431 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7432 CFLAGS="$CFLAGS -no-cpp-precomp"
7435 if amigaos ; then
7436 CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__ -DSYS_AMIGAOS4"
7438 if hpux ; then
7439 # use flag for HPUX missing setenv()
7440 CFLAGS="$CFLAGS -DHPUX"
7442 # Thread support
7443 if linux ; then
7444 CFLAGS="$CFLAGS -D_REENTRANT"
7445 elif bsd ; then
7446 # FIXME bsd needs this so maybe other OS'es
7447 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7449 if cygwin ; then
7450 CFLAGS="$CFLAGS -D__CYGWIN__"
7452 # 64 bit file offsets?
7453 if test "$_largefiles" = yes || freebsd ; then
7454 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7455 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7456 # dvdread support requires this (for off64_t)
7457 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7458 cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
7462 # Make sure config.h gets included.
7463 if test "$_dvdread_internal" = yes || test "$_faad_internal" = yes ; then
7464 CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
7467 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
7468 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
7470 cat > $TMPC << EOF
7471 int main() { return 0; }
7473 if test "$cc_vendor" = "gnu" ; then
7474 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7475 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
7476 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
7480 #this must be the last test to be performed or the ones following it will likely fail
7481 #because libdvdnavmini is intentionally not linked against libdvdread (to permit mplayer
7482 # to use its own copy of the library)
7483 echocheck "DVD support (libdvdnav)"
7484 if test "$_dvdnav" = auto ; then
7485 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7487 if test "$_dvdnav" = auto ; then
7488 cat > $TMPC <<EOF
7489 #include <inttypes.h>
7490 #include <dvdnav.h>
7491 int main(void) { dvdnav_t *dvd=0; return 0; }
7493 _dvdnav=no
7494 _dvdnavdir=`$_dvdnavconfig --cflags`
7495 _dvdnavlibs=`$_dvdnavconfig --libs`
7496 _dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
7497 _dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
7498 test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
7499 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7501 if test "$_dvdnav" = yes ; then
7502 _largefiles=yes
7503 _def_dvdnav='#define USE_DVDNAV 1'
7504 _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
7505 _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
7506 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
7507 _ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
7508 _inputmodules="dvdnav $_inputmodules"
7509 else
7510 _def_dvdnav='#undef USE_DVDNAV'
7511 _noinputmodules="dvdnav $_noinputmodules"
7513 echores "$_dvdnav"
7515 #############################################################################
7516 echo "Creating config.mak"
7517 cat > config.mak << EOF
7518 # -------- Generated by configure -----------
7520 LANG = C
7521 MAN_LANG = $MAN_LANG
7522 TARGET_OS = $system_name
7523 DESTDIR =
7524 prefix = \$(DESTDIR)$_prefix
7525 BINDIR = \$(DESTDIR)$_bindir
7526 DATADIR = \$(DESTDIR)$_datadir
7527 MANDIR = \$(DESTDIR)$_mandir
7528 CONFDIR = \$(DESTDIR)$_confdir
7529 LIBDIR = \$(DESTDIR)$_libdir
7530 # FFmpeg uses libdir instead of LIBDIR
7531 libdir = \$(LIBDIR)
7532 AR = $_ar
7533 CC = $_cc
7534 CXX = $_cc
7535 HOST_CC = $_host_cc
7536 RANLIB = $_ranlib
7537 LDCONFIG = $_ldconfig
7538 INSTALL = $_install
7539 EXTRA_INC = $_inc_extra
7540 EXTRAXX_INC = $_inc_extra $_inc_extraxx
7541 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7542 CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
7543 CFLAG_STACKREALIGN = $_stackrealign
7544 INSTALLSTRIP = $_install_strip
7545 CHARSET = $_charset
7546 HELP_FILE = $_mp_help
7548 EXESUF = $_exesuf
7550 MPLAYER_NETWORK = $_network
7551 FTP = $_ftp
7552 STREAMING_LIVE555 = $_live
7553 LIBNEMESI = $_nemesi
7554 NATIVE_RTSP = $_native_rtsp
7555 VSTREAM = $_vstream
7556 STREAM_CACHE = $_stream_cache
7557 DVBIN = $_dvbin
7558 VIDIX = $_vidix
7559 VIDIX_INTERNAL = $_vidix_internal
7560 VIDIX_EXTERNAL = $_vidix_external
7561 CONFIG_PP = yes
7562 MP3LAME = $_mp3lame
7563 LIBMENU = $_menu
7565 MP3LIB = $_mp3lib
7566 LIBA52 = $_liba52
7567 LIBMPEG2 = $_libmpeg2
7568 TREMOR_INTERNAL = $_tremor_internal
7569 TREMOR_LOW = $_tremor_low
7570 FAAD = $_faad
7572 SPEEX = $_speex
7573 MUSEPACK = $_musepack
7575 UNRARLIB = $_unrarlib
7576 PNG = $_png
7577 JPEG = $_jpeg
7578 GIF = $_gif
7580 EXTRALIBS = $_extra_libs
7581 EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
7582 EXTRALIBS_MPLAYER = $_libs_mplayer
7583 EXTRALIBS_MENCODER = $_libs_mencoder
7585 HAVE_MLIB = $_mlib
7586 HAVE_PTHREADS = $_pthreads
7587 HAVE_W32THREADS = $_w32threads
7589 HAVE_XVMC_ACCEL = $_xvmc
7591 HAVE_SYS_MMAN_H = $_mman
7592 HAVE_POSIX_SELECT = $_posix_select
7594 NEED_GETTIMEOFDAY = $_need_gettimeofday
7595 NEED_GLOB = $_need_glob
7596 NEED_SETENV = $_need_setenv
7597 NEED_SHMEM = $_need_shmem
7598 NEED_STRSEP = $_need_strsep
7599 NEED_SWAB = $_need_swab
7600 NEED_VSSCANF = $_need_vsscanf
7602 # for FFmpeg
7603 SRC_PATH=..
7604 BUILD_ROOT=..
7605 LIBPREF=lib
7606 LIBSUF=.a
7607 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7609 # audio output
7610 OSS = $_ossaudio
7611 ALSA = $_alsa
7612 ALSA5 = $_alsa5
7613 ALSA9 = $_alsa9
7614 ALSA1X = $_alsa1x
7616 # input/demuxer/codecs
7617 JOYSTICK = $_joystick
7618 LIRC = $_lirc
7619 APPLE_REMOTE = $_apple_remote
7620 TV = $_tv
7621 TV_V4L = $_tv_v4l
7622 TV_V4L1 = $_tv_v4l1
7623 TV_V4L2 = $_tv_v4l2
7624 TV_BSDBT848 = $_tv_bsdbt848
7625 TV_TELETEXT = $_tv_teletext
7626 AUDIO_INPUT = $_audio_input
7627 PVR = $_pvr
7628 VCD = $_vcd
7629 DVDREAD = $_dvdread
7630 DVDREAD_INTERNAL = $_dvdread_internal
7631 DVDCSS_INTERNAL = $_libdvdcss_internal
7632 DVDNAV = $_dvdnav
7633 WIN32DLL = $_win32dll
7634 QTX_CODECS = $_qtx
7635 REAL_CODECS = $_real
7636 XANIM_CODECS = $_xanim
7637 LIBAVUTIL = $_libavutil
7638 LIBAVUTIL_A = $_libavutil_a
7639 LIBAVUTIL_SO = $_libavutil_so
7640 LIBAVCODEC = $_libavcodec
7641 LIBAVCODEC_A = $_libavcodec_a
7642 LIBAVCODEC_SO = $_libavcodec_so
7643 LIBAVFORMAT = $_libavformat
7644 LIBAVFORMAT_A = $_libavformat_a
7645 LIBAVFORMAT_SO = $_libavformat_so
7646 LIBPOSTPROC = $_libpostproc
7647 LIBPOSTPROC_A = $_libpostproc_a
7648 LIBPOSTPROC_SO = $_libpostproc_so
7649 ZORAN = $_zr
7650 LIBLZO = $_liblzo
7651 LIBDV = $_libdv
7652 XVID4 = $_xvid
7653 X264 = $_x264
7654 LIBNUT = $_libnut
7655 LIBDCA = $_libdca
7656 MPLAYER = $_mplayer
7657 MENCODER = $_mencoder
7658 CDDA = $_cdda
7659 CDDB = $_cddb
7660 BITMAP_FONT = $_bitmap_font
7661 FREETYPE = $_freetype
7662 ASS = $_ass
7663 LIBMAD = $_mad
7664 LIBVORBIS = $_vorbis
7665 LIBTHEORA = $_theora
7666 FAAD_INTERNAL = $_faad_internal
7667 FAAD_FIXED = $_faad_fixed
7668 LIBSMBCLIENT = $_smbsupport
7669 XMMS_PLUGINS = $_xmms
7670 MACOSX = $_macosx
7671 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7672 MACOSX_BUNDLE = $_macosx_bundle
7673 MACOSX_COREVIDEO = $_macosx_corevideo
7674 TOOLAME=$_toolame
7675 TWOLAME=$_twolame
7676 FAAC=$_faac
7677 CONFIG_LIBAMR=$_libamr
7678 CONFIG_LIBAMR_NB=$_libamr_nb
7679 CONFIG_LIBAMR_WB=$_libamr_wb
7680 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7681 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7682 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7683 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7684 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7685 `echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7686 CONFIG_LIBFAAC=$_lavc_faac
7687 CONFIG_LIBMP3LAME=$_lavc_mp3lame
7688 CONFIG_LIBXVID=$_lavc_xvid
7689 CONFIG_LIBX264=$_lavc_x264
7690 CONFIG_ZLIB=$_zlib
7691 CONFIG_GPL=yes
7692 CONFIG_ENCODERS=$_mencoder
7693 CONFIG_MUXERS=$_mencoder
7694 RADIO=$_radio
7695 RADIO_CAPTURE=$_radio_capture
7696 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7697 VIDIX_IVTV=$_vidix_drv_ivtv
7698 VIDIX_MACH64=$_vidix_drv_mach64
7699 VIDIX_MGA=$_vidix_drv_mga
7700 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7701 VIDIX_NVIDIA=$_vidix_drv_nvidia
7702 VIDIX_PM2=$_vidix_drv_pm2
7703 VIDIX_PM3=$_vidix_drv_pm3
7704 VIDIX_RADEON=$_vidix_drv_radeon
7705 VIDIX_RAGE128=$_vidix_drv_rage128
7706 VIDIX_SAVAGE=$_vidix_drv_savage
7707 VIDIX_SIS=$_vidix_drv_sis
7708 VIDIX_UNICHROME=$_vidix_drv_unichrome
7710 # --- Some stuff for autoconfigure ----
7711 $_target_arch
7712 $_target_arch_x86
7713 $_confwin32
7714 TARGET_CPU=$iproc
7715 HAVE_MMX = $_mmx
7716 HAVE_MMX2 = $_mmxext
7717 HAVE_3DNOW = $_3dnow
7718 HAVE_3DNOWEX = $_3dnowext
7719 HAVE_SSE = $_sse
7720 HAVE_CMOV = $_cmov
7721 HAVE_ALTIVEC = $_altivec
7722 HAVE_ARMV5TE = $_armv5te
7723 HAVE_ARMV6 = $_armv6
7724 HAVE_IWMMXT = $_iwmmxt
7725 HAVE_VIS = $_vis
7727 # --- GUI stuff ---
7728 GUI = $_gui
7730 # --- libvo stuff ---
7731 VO_SRCS = $_vosrc
7733 # --- libao2 stuff ---
7734 AO_SRCS = $_aosrc
7736 # --- libaf stuff ---
7737 AF_SRCS = $_afsrc
7741 #############################################################################
7743 ff_config_enable () {
7744 _nprefix=$3;
7745 test -z "$_nprefix" && _nprefix='CONFIG'
7746 for part in $1; do
7747 if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
7748 echo "#define ${_nprefix}_$part 1"
7749 echo "#define ENABLE_$part 1"
7750 else
7751 echo "#define ENABLE_$part 0"
7753 done
7756 echo "Creating config.h"
7757 cat > $TMPH << EOF
7758 /* -------- This file has been automatically generated by configure ---------
7759 Note: Any changes in it will be lost when you run configure again. */
7761 /* Protect against multiple inclusion */
7762 #ifndef MPLAYER_CONFIG_H
7763 #define MPLAYER_CONFIG_H 1
7765 #define CONFIGURATION "$_configuration"
7767 /* make sure we never get lavformat's poll() emulation, the results are
7768 horrible if the X libs try to actually use it, see MPlayer-users
7769 Message-ID: <45D49541.8060101@infernix.net>
7770 Date: Thu, 15 Feb 2007 18:15:45 +0100
7771 Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
7773 #define HAVE_SYS_POLL_H 1
7775 /* yes, we have inttypes.h */
7776 #define HAVE_INTTYPES_H 1
7778 /* int_fastXY_t emulation */
7779 $_def_fast_inttypes
7781 /* libdvdcss */
7782 #define HAVE_ERRNO_H 1
7784 /* libdvdcss + libdvdread */
7785 #define HAVE_LIMITS_H 1
7787 /* libdvdcss + libfaad2 */
7788 #define HAVE_UNISTD_H 1
7790 /* libfaad2 + libdvdread */
7791 #define STDC_HEADERS 1
7793 /* libfaad2 */
7794 #define HAVE_MEMCPY 1
7795 #define HAVE_STRCHR 1
7797 /* libdvdread */
7798 #define HAVE_UINTPTR_T 1
7800 /* name of messages charset */
7801 $_def_charset
7803 /* Runtime CPU detection */
7804 $_def_runtime_cpudetection
7806 /* Dynamic a/v plugins */
7807 $_def_dynamic_plugins
7809 /* "restrict" keyword */
7810 $_def_restrict_keyword
7812 /* __builtin_expect branch prediction hint */
7813 $_def_builtin_expect
7814 #ifdef HAVE_BUILTIN_EXPECT
7815 #define likely(x) __builtin_expect ((x) != 0, 1)
7816 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7817 #else
7818 #define likely(x) (x)
7819 #define unlikely(x) (x)
7820 #endif
7822 /* attribute(used) as needed by some compilers */
7823 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7824 # define attribute_used __attribute__((used))
7825 #else
7826 # define attribute_used
7827 #endif
7829 /* compiler support for named assembler arguments */
7830 $_def_named_asm_args
7832 /* enable/disable SIGHANDLER */
7833 $_def_sighandler
7835 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7836 $_def_crash_debug
7838 /* Toggles debugging informations */
7839 $_def_debug
7841 /* Toggles color console output */
7842 $_def_color_console
7844 /* Indicates that libcdio is available for VCD and CD-DA playback */
7845 $_def_libcdio
7847 /* Indicates that Ogle's libdvdread is available for DVD playback */
7848 $_def_dvdread
7850 /* Indicates that dvdread is internal */
7851 $_def_dvdread_internal
7853 /* Additional options for libdvdread/libdvdcss */
7854 $_def_dvd
7855 $_def_cdrom
7856 $_def_cdio
7857 $_def_dvdio
7858 $_def_bsdi_dvd
7859 $_def_dvd_bsd
7860 $_def_dvd_linux
7861 $_dev_dvd_openbsd
7862 $_def_dvd_darwin
7863 $_def_sol_scsi_h
7864 $_def_hpux_scsi_h
7866 /* Common data directory (for fonts, etc) */
7867 #define MPLAYER_DATADIR "$_datadir"
7868 #define MPLAYER_CONFDIR "$_confdir"
7869 #define MPLAYER_LIBDIR "$_libdir"
7871 /* Define this to compile stream-caching support, it can be enabled via
7872 -cache <kilobytes> */
7873 $_def_stream_cache
7875 /* Define if you are using XviD library */
7876 $_def_xvid
7878 /* Define if you are using the X.264 library */
7879 $_def_x264
7881 /* Define if you are using libnut */
7882 $_def_libnut
7884 /* Define to include support for libdv-0.9.5 */
7885 $_def_libdv
7887 /* If build mencoder */
7888 $_mencoder_flag
7890 /* Indicates if libmp3lame is available
7891 Note: for mencoder */
7892 $_def_mp3lame
7893 $_def_mp3lame_preset
7894 $_def_mp3lame_preset_medium
7896 /* Undefine this if you do not want to select mono audio (left or right)
7897 with a stereo MPEG layer 2/3 audio stream. The command line option
7898 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7899 right-only), with 0 being the default.
7901 #define USE_FAKE_MONO 1
7903 /* Undefine this if your sound card driver has no working select().
7904 If you have kernel Oops, player hangups, or just no audio, you should
7905 try to recompile MPlayer with this option disabled! */
7906 $_def_select
7908 /* define this to use iconv(3) function to codepage conversions */
7909 $_def_iconv
7911 /* define this to use nl_langinfo function */
7912 $_def_langinfo
7914 /* define this to use RTC (/dev/rtc) for video timers */
7915 $_def_rtc
7917 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7918 #define MAX_OUTBURST 65536
7920 /* set up audio OUTBURST. Do not change this! */
7921 #define OUTBURST 512
7923 /* Define this if your system has the header file for the OSS sound interface */
7924 $_def_sys_soundcard
7926 /* Define this if your system has the header file for the OSS sound interface
7927 * in /usr/include */
7928 $_def_soundcard
7930 /* Define this if your system has the sysinfo header */
7931 $_def_sys_sysinfo
7933 /* Define this if your system has the "malloc.h" header file */
7934 $_def_malloc
7936 /* memalign is mapped to malloc if unsupported */
7937 $_def_memalign
7938 $_def_map_memalign
7939 $_def_memalign_hack
7941 /* assembler handling of .align */
7942 $_def_asmalign_pot
7944 /* Define this if your system has the "alloca.h" header file */
7945 $_def_alloca
7947 /* Define this if your system has the "sys/mman.h" header file */
7948 $_def_mman
7949 $_def_mman_has_map_failed
7951 /* Define this if you have the elf dynamic linker -ldl library */
7952 $_def_dl
7954 /* Define this if you have the kstat kernel statistics library */
7955 $_def_kstat
7957 /* Define this if you have zlib */
7958 $_def_zlib
7959 #ifdef HAVE_ZLIB
7960 #define CONFIG_ZLIB 1
7961 #endif
7963 /* Define this if you have shm support */
7964 $_def_shm
7966 /* Define this if your system has strsep */
7967 $_def_strsep
7969 /* Define this if your system has vsscanf */
7970 $_def_vsscanf
7972 /* Define this if your system has swab */
7973 $_def_swab
7975 /* Define this if your system has posix select */
7976 $_def_posix_select
7978 /* Define this if your system has gettimeofday */
7979 $_def_gettimeofday
7981 /* Define this if your system has glob */
7982 $_def_glob
7984 /* Define this if your system has setenv */
7985 $_def_setenv
7986 #ifndef HAVE_SETENV
7987 int setenv(const char *name, const char *val, int overwrite);
7988 #endif
7990 /* Define this if your system has sysi86 */
7991 $_def_sysi86
7992 $_def_sysi86_iv
7994 /* Define this if your system has pthreads */
7995 $_def_pthreads
7997 /* Define this if you enabled thread support for libavcodec */
7998 $_def_threads
7999 #ifdef HAVE_THREADS
8000 #define ENABLE_THREADS 1
8001 #else
8002 #define ENABLE_THREADS 0
8003 #endif
8005 /* LIRC (remote control, see www.lirc.org) support: */
8006 $_def_lirc
8008 /* Apple Remote (remote control, see http://docs.info.apple.com/article.html?artnum=302504) support: */
8009 $_def_apple_remote
8011 /* Support for maemo (http://www.maemo.org) */
8012 $_def_maemo
8015 * LIRCCD (LIRC client daemon)
8016 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
8018 $_def_lircc
8020 /* DVD navigation support using libdvdnav */
8021 $_def_dvdnav
8022 $_def_dvdnav_version
8024 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
8025 #define MPEG12_POSTPROC 1
8027 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
8028 $_def_libpostproc
8029 $_def_libpostproc_a
8030 $_def_libpostproc_so
8032 /* Win32 DLL support */
8033 $_def_win32dll
8034 #define WIN32_PATH "$_win32codecsdir"
8036 /* Mac OS X specific features */
8037 $_def_macosx
8038 $_def_macosx_finder_support
8039 $_def_macosx_bundle
8040 $_def_macosx_corevideo
8042 /* Build our Win32-loader */
8043 $_def_win32_loader
8045 /* ffmpeg's libavcodec support (requires libavcodec source) */
8046 $_def_libavcodec
8047 $_def_libavcodec_a
8048 $_def_libavcodec_so
8049 $_def_libavcodec_mpegaudio_hp
8051 /* ffmpeg's libavformat support (requires libavformat source) */
8052 $_def_libavformat
8053 $_def_libavformat_a
8054 $_def_libavformat_so
8056 $_def_libavutil
8057 $_def_libavutil_a
8058 $_def_libavutil_so
8060 /* Use libavcodec's decoders */
8061 #define CONFIG_DECODERS 1
8062 /* Use libavcodec's encoders */
8063 #define CONFIG_ENCODERS 1
8065 /* Use libavformat's demuxers */
8066 #define CONFIG_DEMUXERS 1
8067 /* Use libavformat's muxers */
8068 $_def_muxers
8070 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8071 #define HAVE_EBX_AVAILABLE 1
8072 #ifndef MP_DEBUG
8073 #define HAVE_EBP_AVAILABLE 1
8074 #endif
8076 #define CONFIG_GPL 1
8077 #define ENABLE_SMALL 0
8079 /* Support for grayscale encoding/decoding in FFmpeg (makes color slower) */
8080 #define ENABLE_GRAY 1
8082 /* Use AMR codecs from libavcodec. */
8083 $_def_libamr
8084 $_def_libamr_nb
8085 $_def_libamr_wb
8087 /* Use specific parts from FFmpeg. */
8088 `ff_config_enable "$_libavdecoders_all" "$_libavdecoders"`
8089 `ff_config_enable "$_libavencoders_all" "$_libavencoders"`
8090 `ff_config_enable "$_libavparsers_all" "$_libavparsers"`
8091 `ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers"`
8092 `ff_config_enable "$_libavmuxers_all" "$_libavmuxers"`
8093 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
8094 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
8096 $_def_lavc_faac
8097 $_def_lavc_xvid
8098 $_def_lavc_mp3lame
8099 $_def_lavc_x264
8101 /* Use codec libs included in mplayer CVS / source dist: */
8102 $_def_mp3lib
8103 $_def_liba52
8104 $_def_libdca
8105 $_def_libmpeg2
8107 /* XAnim DLL support */
8108 $_def_xanim
8109 /* Default search path */
8110 $_def_xanim_path
8112 /* RealPlayer DLL support */
8113 $_def_real
8114 /* Default search path */
8115 $_def_real_path
8117 /* LIVE555 Streaming Media library support */
8118 $_def_live
8120 /* libnemesi Streaming Media library support */
8121 $_def_nemesi
8123 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
8124 $_def_fastmemcpy
8126 /* Use unrarlib for Vobsubs */
8127 $_def_unrarlib
8129 /* gui support, please do not edit this option */
8130 $_def_gui
8131 $_def_gtk2_gui
8133 /* Audio output drivers */
8134 $_def_ossaudio
8135 $_def_ossaudio_devdsp
8136 $_def_ossaudio_devmixer
8137 $_def_alsa5
8138 $_def_alsa9
8139 $_def_alsa1x
8140 $_def_arts
8141 $_def_esd
8142 $_def_esd_latency
8143 $_def_polyp
8144 $_def_jack
8145 $_def_openal
8146 $_def_openal_h
8147 $_def_sys_asoundlib_h
8148 $_def_alsa_asoundlib_h
8149 $_def_sunaudio
8150 $_def_sgiaudio
8151 $_def_win32waveout
8152 $_def_nas
8154 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8155 #undef FAST_OSD
8156 #undef FAST_OSD_TABLE
8158 /* Enable TV Interface support */
8159 $_def_tv
8161 /* Enable Video 4 Linux TV interface support */
8162 $_def_tv_v4l
8164 /* Enable Video 4 Linux 1 TV interface support */
8165 $_def_tv_v4l1
8167 /* Enable Video 4 Linux 2 TV interface support */
8168 $_def_tv_v4l2
8170 /* *BSD BrookTree headers */
8171 $_def_ioctl_meteor_h_name
8172 $_def_ioctl_bt848_h_name
8174 /* Enable *BSD BrookTree TV interface support */
8175 $_def_tv_bsdbt848
8177 /* Enable TV Teletext Interface support */
8178 $_def_tv_teletext
8180 /* Enable Radio Interface support */
8181 $_def_radio
8183 /* Enable Capture for Radio Interface support */
8184 $_def_radio_capture
8186 /* Enable Video 4 Linux Radio interface support */
8187 $_def_radio_v4l
8189 /* Enable Video 4 Linux 2 Radio interface support */
8190 $_def_radio_v4l2
8192 /* Enable *BSD BrookTree Radio interface support */
8193 $_def_radio_bsdbt848
8195 /* Enable Video 4 Linux 2 MPEG PVR support */
8196 $_def_pvr
8198 /* Define if your processor stores words with the most significant
8199 byte first (like Motorola and SPARC, unlike Intel and VAX). */
8200 $_def_words_endian
8202 /* Define if your processor can access unaligned data in a fast way */
8203 $_def_fast_unaligned
8205 `ff_config_enable "$_arch_all" "$_arch" "ARCH"`
8207 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
8208 have the instruction. */
8209 $_def_dcbzl
8211 /* only gcc3 can compile mvi instructions (libmpeg2) */
8212 $_def_gcc_mvi_support
8214 /* Define this for Cygwin build for win32 */
8215 $_def_confwin32
8217 /* Define this to any prefered value from 386 up to infinity with step 100 */
8218 #define __CPU__ $iproc
8220 $_mp_wordsize
8222 $_def_linux
8224 $_def_vcd
8226 #ifdef sun
8227 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8228 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8229 #elif defined(HPUX)
8230 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8231 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8232 #elif defined(WIN32)
8233 #define DEFAULT_CDROM_DEVICE "D:"
8234 #define DEFAULT_DVD_DEVICE "D:"
8235 #elif defined(SYS_DARWIN)
8236 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8237 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8238 #elif defined(__OpenBSD__)
8239 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8240 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8241 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
8242 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8243 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8244 #elif defined(SYS_AMIGAOS4)
8245 #define DEFAULT_CDROM_DEVICE "a1ide.device:2"
8246 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8247 #else
8248 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8249 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8250 #endif
8253 /*----------------------------------------------------------------------------
8255 ** NOTE: Instead of modifying these definitions here, use the
8256 ** --enable/--disable options of the ./configure script!
8257 ** See ./configure --help for details.
8259 *---------------------------------------------------------------------------*/
8261 /* C99 lrintf function available */
8262 $_def_lrintf
8264 /* mkstemp support */
8265 $_def_mkstemp
8267 /* nanosleep support */
8268 $_def_nanosleep
8270 /* SMB support */
8271 $_def_smbsupport
8273 /* termcap flag for getch2.c */
8274 $_def_termcap
8276 /* termios flag for getch2.c */
8277 $_def_termios
8278 $_def_termios_h
8279 $_def_termios_sys_h
8281 /* enable PNG support */
8282 $_def_png
8284 /* enable JPEG support */
8285 $_def_jpeg
8287 /* enable PNM support */
8288 $_def_pnm
8290 /* enable md5sum support */
8291 $_def_md5sum
8293 /* enable GIF support */
8294 $_def_gif
8295 $_def_gif_4
8296 $_def_gif_tvt_hack
8298 /* enable bitmap font support */
8299 $_def_bitmap_font
8301 /* enable FreeType support */
8302 $_def_freetype
8304 /* enable Fontconfig support */
8305 $_def_fontconfig
8307 /* enable SSA/ASS support */
8308 $_def_ass
8310 /* enable FriBiDi usage */
8311 $_def_fribidi
8313 /* enable ENCA usage */
8314 $_def_enca
8316 /* liblzo support */
8317 $_def_liblzo
8318 #ifdef USE_LIBLZO
8319 #define CONFIG_LZO 1
8320 #endif
8322 /* libmad support */
8323 $_def_mad
8325 /* enable OggVorbis support */
8326 $_def_vorbis
8327 $_def_tremor
8329 /* enable Speex support */
8330 $_def_speex
8332 /* enable musepack support */
8333 $_def_musepack
8335 /* enable OggTheora support */
8336 $_def_theora
8338 /* enable FAAD (AAC) support */
8339 $_def_faad
8340 $_def_faad_internal
8342 /* enable FAAC (AAC encoder) support */
8343 $_def_faac
8345 /* enable LADSPA plugin support */
8346 $_def_ladspa
8348 /* enable network */
8349 $_def_network
8351 /* enable ftp support */
8352 $_def_ftp
8354 /* enable vstream support */
8355 $_def_vstream
8357 /* enable winsock2 instead of Unix functions*/
8358 $_def_winsock2
8360 /* define this to use inet_aton() instead of inet_pton() */
8361 $_def_use_aton
8363 /* enables / disables cdparanoia support */
8364 $_def_cdparanoia
8365 $_def_cddb
8367 /* enables / disables VIDIX usage */
8368 $_def_vidix
8369 $_def_vidix_drv_cyberblade
8370 $_def_vidix_drv_ivtv
8371 $_def_vidix_drv_mach64
8372 $_def_vidix_drv_mga
8373 $_def_vidix_drv_mga_crtc2
8374 $_def_vidix_drv_nvidia
8375 $_def_vidix_drv_pm3
8376 $_def_vidix_drv_radeon
8377 $_def_vidix_drv_rage128
8378 $_def_vidix_drv_savage
8379 $_def_vidix_drv_sis
8380 $_def_vidix_drv_unichrome
8381 $_def_vidix_pfx
8383 /* enables / disables new input joystick support */
8384 $_def_joystick
8386 /* enables / disables QTX codecs */
8387 $_def_qtx
8389 /* enables / disables osd menu */
8390 $_def_menu
8392 /* enables / disables subtitles sorting */
8393 $_def_sortsub
8395 /* XMMS input plugin support */
8396 $_def_xmms
8397 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8399 /* enables inet6 support */
8400 $_def_inet6
8402 /* do we have gethostbyname2? */
8403 $_def_gethostbyname2
8405 /* Extension defines */
8406 `ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
8408 $_def_altivec_h // enables usage of altivec.h
8410 /* libmpeg2 uses a different feature test macro for mediaLib */
8411 #ifdef HAVE_MLIB
8412 #define LIBMPEG2_MLIB 1
8413 #endif
8415 /* libvo options */
8416 #define SCREEN_SIZE_X 1
8417 #define SCREEN_SIZE_Y 1
8418 $_def_x11
8419 $_def_xv
8420 $_def_xvmc
8421 $_def_vm
8422 $_def_xf86keysym
8423 $_def_xinerama
8424 $_def_gl
8425 $_def_gl_win32
8426 $_def_dga
8427 $_def_dga1
8428 $_def_dga2
8429 $_def_sdl
8430 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8431 $_def_sdlbuggy
8432 $_def_directx
8433 $_def_ggi
8434 $_def_ggiwmh
8435 $_def_3dfx
8436 $_def_s3fb
8437 $_def_tdfxfb
8438 $_def_tdfxvid
8439 $_def_xvr100
8440 $_def_directfb
8441 $_def_directfb_version
8442 $_def_dfbmga
8443 $_def_zr
8444 $_def_bl
8445 $_def_mga
8446 $_def_xmga
8447 $_def_fbdev
8448 $_def_dxr2
8449 $_def_dxr3
8450 $_def_ivtv
8451 $_def_v4l2
8452 $_def_dvb
8453 $_def_dvb_in
8454 $_def_svga
8455 $_def_vesa
8456 $_def_xdpms
8457 $_def_aa
8458 $_def_caca
8459 $_def_tga
8460 $_def_toolame
8461 $_def_twolame
8463 /* used by GUI: */
8464 $_def_xshape
8466 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8467 #define X11_FULLSCREEN 1
8468 #endif
8470 #endif /* MPLAYER_CONFIG_H */
8473 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8474 ! cmp -s "$TMPH" config.h && mv -f "$TMPH" config.h
8476 #############################################################################
8478 cat << EOF
8480 Config files successfully generated by ./configure $_configuration !
8482 Install prefix: $_prefix
8483 Data directory: $_datadir
8484 Config direct.: $_confdir
8486 Byte order: $_byte_order
8487 Optimizing for: $_optimizing
8489 Languages:
8490 Messages/GUI: $_language
8493 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8494 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8495 echo
8497 cat << EOF
8499 Enabled optional drivers:
8500 Input: $_inputmodules
8501 Codecs: $_codecmodules
8502 Audio output: $_aomodules
8503 Video output: $_vomodules
8504 Audio filters: $_afmodules
8505 Disabled optional drivers:
8506 Input: $_noinputmodules
8507 Codecs: $_nocodecmodules
8508 Audio output: $_noaomodules
8509 Video output: $_novomodules
8510 Audio filters: $_noafmodules
8512 'config.h' and 'config.mak' contain your configuration options.
8513 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8514 compile *** DO NOT REPORT BUGS if you tweak these files ***
8516 'make' will now compile MPlayer and 'make install' will install it.
8517 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8522 if test "$_mtrr" = yes ; then
8523 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8524 echo
8527 if not x86_32; then
8528 cat <<EOF
8529 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8530 operating system ($system_name). You may encounter a few files that cannot
8531 be played due to missing open source video/audio codec support.
8537 cat <<EOF
8538 Check $TMPLOG if you wonder why an autodetection failed (make sure
8539 development headers/packages are installed).
8541 NOTE: The --enable-* parameters unconditionally force options on, completely
8542 skipping autodetection. This behavior is unlike what you may be used to from
8543 autoconf-based configure scripts that can decide to override you. This greater
8544 level of control comes at a price. You may have to provide the correct compiler
8545 and linker flags yourself.
8546 If you used one of these options (except --enable-gui and similar ones that
8547 turn on internal features) and experience a compilation or linking failure,
8548 make sure you have passed the necessary compiler/linker flags to configure.
8550 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8554 if test "$_warn_CFLAGS" = yes; then
8555 cat <<EOF
8557 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8559 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8561 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8562 To do so, execute 'CFLAGS= ./configure <options>'
8567 # Last move:
8568 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"