Changed code that used pts=0 in demux packets to indicate "not known".
[mplayer.git] / configure
blob3ae6dd2bed664fa38343a8aaaf37c94eb24094da
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 # Prefer these macros to full length text !
57 # These macros only return an error code - NO display is done
58 compile_check() {
59 echo >> "$TMPLOG"
60 cat "$1" >> "$TMPLOG"
61 echo >> "$TMPLOG"
62 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o $TMPO $@" >> "$TMPLOG"
63 rm -f "$TMPO"
64 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o "$TMPO" "$@" >> "$TMPLOG" 2>&1
65 TMP="$?"
66 echo >> "$TMPLOG"
67 echo "ldd $TMPO" >> "$TMPLOG"
68 $_ldd "$TMPO" >> "$TMPLOG" 2>&1
69 echo >> "$TMPLOG"
70 return "$TMP"
73 cc_check() {
74 compile_check $TMPC $@
77 cxx_check() {
78 compile_check $TMPCPP $@ -lstdc++
81 tmp_run() {
82 "$TMPO" >> "$TMPLOG" 2>&1
85 # Display error message, flushes tempfile, exit
86 die () {
87 echo
88 echo "Error: $@" >&2
89 echo >&2
90 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
91 echo "Check \"$TMPLOG\" if you do not understand why it failed."
92 exit 1
95 # OS test booleans functions
96 issystem() {
97 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
99 linux() { issystem "Linux" ; return "$?" ; }
100 sunos() { issystem "SunOS" ; return "$?" ; }
101 hpux() { issystem "HP-UX" ; return "$?" ; }
102 irix() { issystem "IRIX" ; return "$?" ; }
103 aix() { issystem "AIX" ; return "$?" ; }
104 cygwin() { issystem "CYGWIN" ; return "$?" ; }
105 freebsd() { issystem "FreeBSD" ; return "$?" ; }
106 netbsd() { issystem "NetBSD" ; return "$?" ; }
107 bsdos() { issystem "BSD/OS" ; return "$?" ; }
108 openbsd() { issystem "OpenBSD" ; return "$?" ; }
109 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
110 qnx() { issystem "QNX" ; return "$?" ; }
111 darwin() { issystem "Darwin" ; return "$?" ; }
112 gnu() { issystem "GNU" ; return "$?" ; }
113 mingw32() { issystem "MINGW32" ; return "$?" ; }
114 morphos() { issystem "MorphOS" ; return "$?" ; }
115 win32() { cygwin || mingw32 ; return "$?" ; }
116 beos() { issystem "BEOS" ; return "$?" ; }
118 # arch test boolean functions
119 # x86/x86pc is used by QNX
120 x86() {
121 case "$host_arch" in
122 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
123 *) return 1 ;;
124 esac
127 x86_64() {
128 case "$host_arch" in
129 x86_64|amd64) return 0 ;;
130 *) return 1 ;;
131 esac
134 ppc() {
135 case "$host_arch" in
136 ppc) return 0;;
137 *) return 1;;
138 esac
141 alpha() {
142 case "$host_arch" in
143 alpha) return 0;;
144 *) return 1;;
145 esac
148 arm() {
149 case "$host_arch" in
150 arm) return 0;;
151 *) return 1;;
152 esac
155 # not boolean test: implement the posix shell "!" operator for a
156 # non-posix /bin/sh.
157 # usage: not {command}
158 # returns exit status "success" when the execution of "command"
159 # fails.
160 not() {
161 eval "$@"
162 test $? -ne 0
165 # Use this before starting a check
166 echocheck() {
167 echo "============ Checking for $@ ============" >> "$TMPLOG"
168 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
171 # Use this to echo the results of a check
172 echores() {
173 if test "$_res_comment" ; then
174 _res_comment="($_res_comment)"
176 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
177 echo "##########################################" >> "$TMPLOG"
178 echo "" >> "$TMPLOG"
179 echo "$@ $_res_comment"
180 _res_comment=""
182 #############################################################################
184 # Check how echo works in this /bin/sh
185 case `echo -n` in
186 -n) _echo_n= _echo_c='\c' ;; # SysV echo
187 *) _echo_n='-n ' _echo_c= ;; # BSD echo
188 esac
190 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"`
192 show_help(){
193 cat << EOF
194 Usage: $0 [OPTIONS]...
196 Configuration:
197 -h, --help display this help and exit
199 Installation directories:
200 --prefix=DIR prefix directory for installation [/usr/local]
201 --bindir=DIR directory for installing binaries [PREFIX/bin]
202 --datadir=DIR directory for installing machine independent
203 data files (skins, etc) [PREFIX/share/mplayer]
204 --mandir=DIR directory for installing man pages [PREFIX/man]
205 --confdir=DIR directory for installing configuration files
206 [PREFIX/etc/mplayer]
207 --libdir=DIR directory for object code libraries [PREFIX/lib]
208 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
209 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
210 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
211 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
213 Optional features:
214 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
215 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
216 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
217 --enable-largefiles enable support for files > 2GB [disable]
218 --enable-linux-devfs set default devices to devfs [disable]
219 --enable-termcap use termcap database for key codes [autodetect]
220 --enable-termios use termios database for key codes [autodetect]
221 --disable-iconv disable iconv for encoding conversion [autodetect]
222 --disable-langinfo do not use langinfo [autodetect]
223 --enable-lirc enable LIRC (remote control) support [autodetect]
224 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
225 --enable-joystick enable joystick support [disable]
226 --disable-vm disable X video mode extensions [autodetect]
227 --disable-xf86keysym disable support for multimedia keys [autodetect]
228 --enable-radio enable radio interface [disable]
229 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
230 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
231 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
232 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
233 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
234 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
235 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
236 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
237 --disable-network disable networking [enable]
238 --enable-winsock2 enable winsock2 [autodetect]
239 --enable-smb enable Samba (SMB) input [autodetect]
240 --enable-live enable LIVE555 Streaming Media [autodetect]
241 --disable-dvdnav disable libdvdnav [autodetect]
242 --disable-dvdread disable libdvdread [autodetect]
243 --disable-dvdread-internal disable internal libdvdread [autodetect]
244 --disable-cdparanoia disable cdparanoia [autodetect]
245 --disable-bitmap-font disable bitmap font support [enable]
246 --disable-freetype disable FreeType 2 font rendering [autodetect]
247 --disable-fontconfig disable fontconfig font lookup [autodetect]
248 --disable-unrarlib disable Unique RAR File Library [enabled]
249 --enable-menu enable OSD menu (not DVD menu) [disabled]
250 --disable-sortsub disable subtitle sorting [enabled]
251 --enable-fribidi enable the FriBiDi libs [autodetect]
252 --disable-enca disable ENCA charset oracle library [autodetect]
253 --disable-macosx disable Mac OS X specific features [autodetect]
254 --disable-maemo disable maemo specific features [autodetect]
255 --enable-macosx-finder-support enable Mac OS X Finder invocation
256 parameter parsing [disabled]
257 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
258 --disable-inet6 disable IPv6 support [autodetect]
259 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
260 --disable-ftp disable FTP support [enabled]
261 --disable-vstream disable TiVo vstream client support [autodetect]
262 --disable-pthreads disable Posix threads support [autodetect]
263 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
264 --enable-rpath enable runtime linker path for extra libs [disabled]
266 Codecs:
267 --enable-gif enable GIF support [autodetect]
268 --enable-png enable PNG input/output support [autodetect]
269 --enable-jpeg enable JPEG input/output support [autodetect]
270 --enable-libcdio enable external libcdio [autodetect]
271 --enable-liblzo enable external liblzo [autodetect]
272 --disable-win32 disable Win32 DLL support [enabled]
273 --disable-qtx disable QuickTime codecs support [enabled]
274 --disable-xanim disable XAnim codecs support [enabled]
275 --disable-real disable RealPlayer codecs support [enabled]
276 --disable-xvid disable XviD [autodetect]
277 --disable-xvid3 disable XviD 3 [autodetect]
278 --disable-x264 disable x264 [autodetect]
279 --disable-nut disable libnut [autodetect]
280 --disable-libavutil disable libavutil [autodetect]
281 --disable-libavcodec disable libavcodec [autodetect]
282 --disable-libavformat disable libavformat [autodetect]
283 --disable-libpostproc disable libpostproc [autodetect]
284 --disable-libavutil_so disable shared libavutil [autodetect]
285 --disable-libavcodec_so disable shared libavcodec [autodetect]
286 --disable-libavformat_so disable shared libavformat [autodetect]
287 --disable-libpostproc_so disable shared libpostproc [autodetect]
288 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
289 in libavcodec [enabled]
290 --disable-tremor-internal disable internal Tremor [enabled]
291 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
292 --enable-tremor-external enable external Tremor [autodetect]
293 --disable-libvorbis disable libvorbis support [autodetect]
294 --disable-speex disable Speex support [autodetect]
295 --enable-theora enable OggTheora libraries [autodetect]
296 --enable-faad-external enable external FAAD2 (AAC) [autodetect]
297 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
298 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
299 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
300 --disable-ladspa disable LADSPA plugin support [autodetect]
301 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
302 --disable-mad disable libmad (MPEG audio) support [autodetect]
303 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
304 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
305 --enable-xmms enable XMMS input plugin support [disabled]
306 --enable-libdts enable libdts support [autodetect]
307 --disable-mp3lib disable builtin mp3lib [enabled]
308 --disable-liba52 disable builtin liba52 [enabled]
309 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
310 --disable-musepack disable musepack support [autodetect]
311 --disable-amr_nb disable AMR narrowband, floating-point [autodetect]
312 --disable-amr_nb-fixed disable AMR narrowband, fixed-point [autodetect]
313 --disable-amr_wb disable AMR wideband, floating-point [autodetect]
314 --disable-decoder=DECODER disable specified FFmpeg decoder
315 --enable-decoder=DECODER enable specified FFmpeg decoder
316 --disable-encoder=ENCODER disable specified FFmpeg encoder
317 --enable-encoder=ENCODER enable specified FFmpeg encoder
318 --disable-parser=PARSER disable specified FFmpeg parser
319 --enable-parser=PARSER enable specified FFmpeg parser
320 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
321 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
322 --disable-muxer=MUXER disable specified FFmpeg muxer
323 --enable-muxer=MUXER enable specified FFmpeg muxer
325 Video output:
326 --disable-vidix-internal disable internal VIDIX [for x86 *nix]
327 --disable-vidix-external disable external VIDIX [for x86 *nix]
328 --enable-gl enable OpenGL video output [autodetect]
329 --enable-dga[=n] enable DGA [n in {1, 2} ] support [autodetect]
330 --enable-vesa enable VESA video output [autodetect]
331 --enable-svga enable SVGAlib video output [autodetect]
332 --enable-sdl enable SDL video output [autodetect]
333 --enable-aa enable AAlib video output [autodetect]
334 --enable-caca enable CACA video output [autodetect]
335 --enable-ggi enable GGI video output [autodetect]
336 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
337 --enable-directx enable DirectX video output [autodetect]
338 --enable-dxr2 enable DXR2 video output [autodetect]
339 --enable-dxr3 enable DXR3/H+ video output [autodetect]
340 --enable-ivtv enable IVTV TV-Out video output [autodetect]
341 --enable-dvb enable DVB video output [autodetect]
342 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
343 --enable-mga enable mga_vid video output [autodetect]
344 --enable-xmga enable mga_vid X11 video output [autodetect]
345 --enable-xv enable Xv video output [autodetect]
346 --enable-xvmc enable XvMC acceleration [disable]
347 --enable-vm enable XF86VidMode support [autodetect]
348 --enable-xinerama enable Xinerama support [autodetect]
349 --enable-x11 enable X11 video output [autodetect]
350 --enable-xshape enable XShape support [autodetect]
351 --enable-fbdev enable FBDev video output [autodetect]
352 --enable-mlib enable mediaLib video output (Solaris) [disable]
353 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
354 --enable-tdfxfb enable tdfxfb video output [disable]
355 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
356 --enable-directfb enable DirectFB video output [autodetect]
357 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
358 --enable-bl enable Blinkenlights video output [disable]
359 --enable-tdfxvid enable tdfx_vid video output [disable]
360 --disable-tga disable Targa video output [enable]
361 --disable-pnm disable PNM video output [enable]
362 --disable-md5sum disable md5sum video output [enable]
364 Audio output:
365 --disable-alsa disable ALSA audio output [autodetect]
366 --disable-ossaudio disable OSS audio output [autodetect]
367 --disable-arts disable aRts audio output [autodetect]
368 --disable-esd disable esd audio output [autodetect]
369 --disable-polyp disable Polypaudio audio output [autodetect]
370 --disable-jack disable JACK audio output [autodetect]
371 --disable-openal disable OpenAL audio output [autodetect]
372 --disable-nas disable NAS audio output [autodetect]
373 --disable-sgiaudio disable SGI audio output [autodetect]
374 --disable-sunaudio disable Sun audio output [autodetect]
375 --disable-win32waveout disable Windows waveout audio output [autodetect]
376 --disable-select disable using select() on the audio device [enable]
378 Miscellaneous options:
379 --enable-runtime-cpudetection enable runtime CPU detection [disable]
380 --enable-cross-compile enable cross-compilation [autodetect]
381 --cc=COMPILER C compiler to build MPlayer [gcc]
382 --host-cc=COMPILER C compiler for tools needed while building [gcc]
383 --as=ASSEMBLER assembler to build MPlayer [as]
384 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
385 --enable-static build a statically linked binary
386 --charset=charset convert the console messages to this character set
387 --language=list a white space or comma separated list of languages for
388 translated man pages, the first language is used for
389 messages and the GUI (the environment variable
390 \$LINGUAS is also honored) [en]
391 (Available: $LANGUAGES all)
392 --with-install=PATH path to a custom install program
393 --enable-color-console enable color console output [disable]
395 Advanced options:
396 --enable-mmx enable MMX [autodetect]
397 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
398 --enable-3dnow enable 3DNow! [autodetect]
399 --enable-3dnowext enable extended 3DNow! [autodetect]
400 --enable-sse enable SSE [autodetect]
401 --enable-sse2 enable SSE2 [autodetect]
402 --enable-shm enable shm [autodetect]
403 --enable-altivec enable AltiVec (PowerPC) [autodetect]
404 --enable-armv5te enable DSP extensions (ARM) [autodetect]
405 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
406 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
407 --enable-big-endian force byte order to big-endian [autodetect]
408 --enable-debug[=1-3] compile-in debugging information [disable]
409 --enable-profile compile-in profiling information [disable]
410 --disable-sighandler disable sighandler for crashes [enable]
411 --enable-crash-debug enable automatic gdb attach on crash [disable]
412 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
414 Hazardous options AKA "DO NOT REPORT ANY BUGS!"
415 --disable-gcc-check disable gcc version checking [enable]
417 Use these options if autodetection fails (Options marked with (*) accept
418 multiple paths separated by ':'):
419 --extra-libs=FLAGS extra linker flags
420 --with-extraincdir=DIR extra header search paths in DIR (*)
421 --with-extralibdir=DIR extra linker search paths in DIR (*)
422 --with-x11libdir=DIR X library files in DIR (*)
423 --with-mliblibdir=DIR libmlib (mediaLib) in DIR (Solaris only)
424 --with-xvidlibdir=DIR libxvidcore (XviD) in DIR (*)
425 --with-x264libdir=DIR libx264 in DIR
426 --with-libdtslibdir=DIR libdts in DIR (*)
427 --with-livelibdir=DIR LIVE555 Streaming Media in DIR
428 --with-toolamelibdir=DIR Toolame in DIR
429 --with-xmmsplugindir=DIR XMMS plugins in DIR
430 --with-xmmslibdir=DIR libxmms.so.1 in DIR
431 --with-cdparanoialibdir=DIR cdparanoia libraries (libcdda_*) in DIR (*)
432 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
434 --with-freetype-config=PATH path to freetype-config
435 --with-fribidi-config=PATH path to fribidi-config
436 --with-glib-config=PATH path to glib*-config
437 --with-gtk-config=PATH path to gtk*-config
438 --with-sdl-config=PATH path to sdl*-config
439 --with-dvdnav-config=PATH path to dvdnav-config
441 This configure script is NOT autoconf-based, even though its output is similar.
442 It will try to autodetect all configuration options. If you --enable an option
443 it will be forcefully turned on, skipping autodetection. This can break
444 compilation, so you need to know what you are doing.
446 exit 0
447 } #show_help()
449 for parm in "$@" ; do
450 case $parm in
451 --help|-help|-h)
452 show_help
453 esac
454 done
456 # 1st pass checking for vital options
457 _mmx=auto
458 _3dnow=auto
459 _3dnowext=auto
460 _mmxext=auto
461 _sse=auto
462 _sse2=auto
463 _cmov=auto
464 _armv5te=auto
465 _iwmmxt=auto
466 _mtrr=auto
467 _install=install
468 _ranlib=ranlib
469 _cc=cc
470 test "$CC" && _cc="$CC"
471 _gcc_check=yes
472 _as=auto
473 _runtime_cpudetection=no
474 _cross_compile=auto
475 for ac_option do
476 case "$ac_option" in
477 --target=*)
478 _target=`echo $ac_option | cut -d '=' -f 2`
480 --cc=*)
481 _cc=`echo $ac_option | cut -d '=' -f 2`
483 --host-cc=*)
484 _host_cc=`echo $ac_option | cut -d '=' -f 2`
486 --as=*)
487 _as=`echo $ac_option | cut -d '=' -f 2`
489 --enable-gcc-check)
490 _gcc_check=yes
492 --disable-gcc-check)
493 _gcc_check=no
495 --enable-static)
496 _ld_static='-static'
498 --disable-static)
499 _ld_static=''
501 --with-extraincdir=*)
502 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
504 --with-extralibdir=*)
505 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
507 --extra-libs=*)
508 _extra_libs=`echo $ac_option | cut -d '=' -f 2`
510 --enable-runtime-cpudetection)
511 _runtime_cpudetection=yes
513 --disable-runtime-cpudetection)
514 _runtime_cpudetection=no
516 --enable-cross-compile)
517 _cross_compile=yes
519 --disable-cross-compile)
520 _cross_compile=no
522 --with-install=*)
523 _install=`echo $ac_option | cut -d '=' -f 2 `
525 --enable-profile)
526 _profile='-p'
528 --disable-profile)
529 _profile=
531 --enable-debug)
532 _debug='-g'
534 --enable-debug=*)
535 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
537 --disable-debug)
538 _debug=
540 esac
541 done
543 # Determine our OS name and CPU architecture
544 if test -z "$_target" ; then
545 # OS name
546 system_name=`uname -s 2>&1`
547 case "$system_name" in
548 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX)
550 IRIX*)
551 system_name=IRIX
553 HP-UX*)
554 system_name=HP-UX
556 [cC][yY][gG][wW][iI][nN]*)
557 system_name=CYGWIN
559 MINGW32*)
560 system_name=MINGW32
563 system_name="$system_name-UNKNOWN"
565 esac
568 # host's CPU/instruction set
569 host_arch=`uname -p 2>&1`
570 case "$host_arch" in
571 i386|sparc|ppc|alpha|arm|mips|vax)
573 powerpc) # Darwin returns 'powerpc'
574 host_arch=ppc
576 *) # uname -p on Linux returns 'unknown' for the processor type,
577 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
579 # Maybe uname -m (machine hardware name) returns something we
580 # recognize.
582 # x86/x86pc is used by QNX
583 case "`uname -m 2>&1`" in
584 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 ;;
585 ia64) host_arch=ia64 ;;
586 x86_64|amd64)
587 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
588 -z "`echo $CFLAGS | grep -- -m32`" ]; then
589 host_arch=x86_64
590 else
591 host_arch=i386
594 macppc|ppc|ppc64) host_arch=ppc ;;
595 alpha) host_arch=alpha ;;
596 sparc) host_arch=sparc ;;
597 sparc64) host_arch=sparc64 ;;
598 parisc*|hppa*|9000*) host_arch=hppa ;;
599 arm*|zaurus|cats) host_arch=arm ;;
600 s390) host_arch=s390 ;;
601 s390x) host_arch=s390x ;;
602 mips*) host_arch=mips ;;
603 vax) host_arch=vax ;;
604 *) host_arch=UNKNOWN ;;
605 esac
607 esac
608 else # if test -z "$_target"
609 system_name=`echo $_target | cut -d '-' -f 2`
610 case "`echo $system_name | tr A-Z a-z`" in
611 linux) system_name=Linux ;;
612 freebsd) system_name=FreeBSD ;;
613 netbsd) system_name=NetBSD ;;
614 bsd/os) system_name=BSD/OS ;;
615 openbsd) system_name=OpenBSD ;;
616 sunos) system_name=SunOS ;;
617 qnx) system_name=QNX ;;
618 morphos) system_name=MorphOS ;;
619 mingw32msvc) system_name=MINGW32 ;;
620 esac
621 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
622 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
625 echo "Detected operating system: $system_name"
626 echo "Detected host architecture: $host_arch"
628 # LGB: temporary files
629 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
630 test "$I" && break
631 done
633 TMPLOG="configure.log"
634 rm -f "$TMPLOG"
635 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
636 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
637 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
638 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
640 # config files
642 # FIXME: A lot of stuff is installed under /usr/local
643 # NK: But we should never use this stuff implicitly since we call compiler
644 # from /usr we should be sure that there no effects from other compilers
645 # (libraries) which might be installed into /usr/local. Let users use this
646 # stuff explicitly as command line argument. In other words: It would be
647 # resonable to have only /usr/include or only /usr/local/include.
649 if freebsd ; then
650 _ld_extra="$_ld_extra -L/usr/local/lib"
651 _inc_extra="$_inc_extra -I/usr/local/include"
654 _ldd=ldd
655 if darwin; then
656 _ldd="otool -L"
659 if aix ; then
660 _ld_libC="-lC"
661 else
662 _ld_libC=""
665 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
666 # if used as 'head -1' instead of 'head -n 1', but older versions don't
667 # know about '-n'.
668 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
669 _head() { head -$1 2>/dev/null ; }
670 else
671 _head() { head -n $1 2>/dev/null ; }
673 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
674 _tail() { tail -$1 2>/dev/null ; }
675 else
676 _tail() { tail -n $1 2>/dev/null ; }
679 # Checking CC version...
680 if test "$_gcc_check" = yes ; then
681 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
682 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
683 echocheck "$_cc version"
684 cc_vendor=intel
685 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
686 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
687 _cc_major=`echo $cc_version | cut -d '.' -f 1`
688 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
689 # TODO verify older icc/ecc compatibility
690 case $cc_version in
692 cc_version="v. ?.??, bad"
693 cc_verc_fail=yes
695 8.0)
696 cc_version="$cc_version, ok"
697 cc_verc_fail=no
700 cc_version="$cc_version, bad"
701 cc_verc_fail=yes
703 esac
704 echores "$cc_version"
705 else
706 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
707 echocheck "$_cc version"
708 cc_vendor=gnu
709 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
710 cc_version=`$_cc -dumpversion 2>&1`
711 if test "$?" -gt 0; then
712 cc_version="not found"
714 case $cc_version in
716 cc_version="v. ?.??, bad"
717 cc_verc_fail=yes
719 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
720 _cc_major=`echo $cc_version | cut -d '.' -f 1`
721 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
722 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
723 cc_version="$cc_version, ok"
724 cc_verc_fail=no
726 'not found')
727 cc_verc_fail=yes
730 cc_version="$cc_version, bad"
731 cc_verc_fail=yes
733 esac
734 echores "$cc_version"
735 test "$cc_verc_fail" = "no" && break
736 done
737 fi # icc
738 if test "$cc_verc_fail" = yes ; then
739 cat <<EOF
741 *** Please downgrade/upgrade C compiler to version gcc-2.95, 3.x or 4.x! ***
743 You are not using a supported compiler. We do not have the time to make sure
744 everything works with compilers other than the ones we use. Use either the
745 same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
746 unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
748 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
749 mplayer and lame (which is used for mencoder). If you get compile errors,
750 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
751 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
752 bugs!
754 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
756 *** For details please read DOCS/HTML/en/users-vs-dev.html ***
759 die "Bad gcc version"
761 else
762 cat <<EOF
764 ******************************************************************************
766 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
767 Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???
769 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
770 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
771 Lame which is used by mencoder produces weird errors, too.
773 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
774 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
776 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
778 ******************************************************************************
782 read _answer
785 echocheck "host cc"
786 test "$_host_cc" || _host_cc=$_cc
787 echores $_host_cc
789 echocheck "cross compilation"
790 if test $_cross_compile = auto ; then
791 cat > $TMPC << EOF
792 int main() { return 0; }
794 _cross_compile=yes
795 cc_check && "$TMPO" && _cross_compile=no
797 echores $_cross_compile
799 if test $_cross_compile = yes; then
800 tmp_run() {
801 return 0
805 # ---
807 # now that we know what compiler should be used for compilation, try to find
808 # out which assembler is used by the $_cc compiler
809 if test "$_as" = auto ; then
810 _as=`$_cc -print-prog-name=as`
811 test -z "$_as" && _as=as
814 # XXX: this should be ok..
815 _cpuinfo="echo"
816 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
817 # FIXME: Remove the cygwin check once AMD CPUs are supported
818 if test -r /proc/cpuinfo && not cygwin; then
819 # Linux with /proc mounted, extract CPU information from it
820 _cpuinfo="cat /proc/cpuinfo"
821 elif test -r /compat/linux/proc/cpuinfo && not x86 ; then
822 # FreeBSD with Linux emulation /proc mounted,
823 # extract CPU information from it
824 _cpuinfo="cat /compat/linux/proc/cpuinfo"
825 elif darwin && not x86 ; then
826 # use hostinfo on Darwin
827 _cpuinfo="hostinfo"
828 elif aix; then
829 # use 'lsattr' on AIX
830 _cpuinfo="lsattr -E -l proc0 -a type"
831 elif x86 || x86_64; then
832 # all other OSes try to extract CPU information from a small helper
833 # program TOOLS/cpuinfo instead
834 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
835 _cpuinfo="TOOLS/cpuinfo"
838 if x86 || x86_64 ; then
839 # gather more CPU information
840 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
841 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
842 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
843 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
844 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
846 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
848 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
849 -e s/xmm/sse/ -e s/kni/sse/`
851 for ext in $pparam ; do
852 eval _$ext=auto && eval _$ext=yes
853 done
855 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
856 test $_sse = yes && _mmxext=yes
858 echocheck "CPU vendor"
859 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
861 echocheck "CPU type"
862 echores "$pname"
865 case "$host_arch" in
866 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
867 _def_arch_x86="#define ARCH_X86 1"
868 _target_arch_x86="TARGET_ARCH_X86 = yes"
869 _def_arch="#define ARCH_X86_32 1"
870 _target_arch="TARGET_ARCH_X86_32 = yes"
873 case "$pvendor" in
874 AuthenticAMD)
875 case "$pfamily" in
876 3) proc=i386 iproc=386 ;;
877 4) proc=i486 iproc=486 ;;
878 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
879 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
880 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
881 proc=k6-3
882 elif test "$pmodel" -ge 8; then
883 proc=k6-2
884 elif test "$pmodel" -ge 6; then
885 proc=k6
886 else
887 proc=i586
890 6) iproc=686
891 # It's a bit difficult to determine the correct type of Family 6
892 # AMD CPUs just from their signature. Instead, we check directly
893 # whether it supports SSE.
894 if test "$_sse" = yes; then
895 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
896 proc=athlon-xp
897 else
898 # Again, gcc treats athlon and athlon-tbird similarly.
899 proc=athlon
902 15) iproc=686
903 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
904 # caught and remedied in the optimization tests below.
905 proc=k8
908 *) proc=k8 iproc=686 ;;
909 esac
911 GenuineIntel)
912 case "$pfamily" in
913 3) proc=i386 iproc=386 ;;
914 4) proc=i486 iproc=486 ;;
915 5) iproc=586
916 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
917 proc=pentium-mmx # 4 is desktop, 8 is mobile
918 else
919 proc=i586
922 6) iproc=686
923 if test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
924 proc=pentium-m
925 elif test "$pmodel" -ge 7; then
926 proc=pentium3
927 elif test "$pmodel" -ge 3; then
928 proc=pentium2
929 else
930 proc=i686
933 15) iproc=686
934 # A nocona in 32-bit mode has no more capabilities than a prescott.
935 if test "$pmodel" -ge 3; then
936 proc=prescott
937 else
938 proc=pentium4
941 *) proc=prescott iproc=686 ;;
942 esac
944 CentaurHauls)
945 case "$pfamily" in
946 5) iproc=586
947 if test "$pmodel" -ge 8; then
948 proc=winchip2
949 elif test "$pmodel" -ge 4; then
950 proc=winchip-c6
951 else
952 proc=i586
955 6) iproc=686
956 if test "$pmodel" -ge 9; then
957 proc=c3-2
958 else
959 proc=c3
960 iproc=586
963 *) proc=i686 iproc=i686 ;;
964 esac
966 unknown)
967 case "$pfamily" in
968 3) proc=i386 iproc=386 ;;
969 4) proc=i486 iproc=486 ;;
970 *) proc=i586 iproc=586 ;;
971 esac
974 proc=i586 iproc=586 ;;
975 esac
977 # check that gcc supports our CPU, if not, fall back to earlier ones
978 # LGB: check -mcpu and -march swithing step by step with enabling
979 # to fall back till 386.
981 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
983 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
984 cpuopt=-mtune
985 else
986 cpuopt=-mcpu
989 echocheck "GCC & CPU optimization abilities"
990 cat > $TMPC << EOF
991 int main(void) { return 0; }
993 if test "$_runtime_cpudetection" = no ; then
994 if test "$proc" = "k8"; then
995 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
997 if test "$proc" = "athlon-xp"; then
998 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1000 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1001 cc_check -march=$proc $cpuopt=$proc || proc=k6
1003 if test "$proc" = "k6" || test "$proc" = "c3"; then
1004 if not cc_check -march=$proc $cpuopt=$proc; then
1005 if cc_check -march=i586 $cpuopt=i686; then
1006 proc=i586-i686
1007 else
1008 proc=i586
1012 if test "$proc" = "prescott" ; then
1013 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1015 if test "$proc" = "pentium4" || test "$proc" = "pentium-m" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon" || test "$proc" = "c3-2"; then
1016 cc_check -march=$proc $cpuopt=$proc || proc=i686
1018 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1019 cc_check -march=$proc $cpuopt=$proc || proc=i586
1021 if test "$proc" = "i586"; then
1022 cc_check -march=$proc $cpuopt=$proc || proc=i486
1024 if test "$proc" = "i486" ; then
1025 cc_check -march=$proc $cpuopt=$proc || proc=i386
1027 if test "$proc" = "i386" ; then
1028 cc_check -march=$proc $cpuopt=$proc || proc=error
1030 if test "$proc" = "error" ; then
1031 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1032 _mcpu=""
1033 _march=""
1034 _optimizing=""
1035 elif test "$proc" = "i586-i686"; then
1036 _march="-march=i586"
1037 _mcpu="$cpuopt=i686"
1038 _optimizing="$proc"
1039 else
1040 _march="-march=$proc"
1041 _mcpu="$cpuopt=$proc"
1042 _optimizing="$proc"
1044 else # if test "$_runtime_cpudetection" = no
1045 # i686 is probably the most common CPU - optimize for it
1046 _mcpu="$cpuopt=i686"
1047 # at least i486 required, for bswap instruction
1048 _march="-march=i486"
1049 cc_check $_mcpu || _mcpu=""
1050 cc_check $_march $_mcpu || _march=""
1053 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1054 ## autodetected mcpu/march parameters
1055 if test "$_target" ; then
1056 # TODO: it may be a good idea to check GCC and fall back in all cases
1057 if test "$host_arch" = "i586-i686"; then
1058 _march="-march=i586"
1059 _mcpu="$cpuopt=i686"
1060 else
1061 _march="-march=$host_arch"
1062 _mcpu="$cpuopt=$host_arch"
1065 proc="$host_arch"
1067 case "$proc" in
1068 i386) iproc=386 ;;
1069 i486) iproc=486 ;;
1070 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1071 i686|athlon*|pentium*) iproc=686 ;;
1072 *) iproc=586 ;;
1073 esac
1076 echores "$proc"
1079 ia64)
1080 _def_arch='#define ARCH_IA64 1'
1081 _target_arch='TARGET_ARCH_IA64 = yes'
1082 iproc='ia64'
1083 proc=''
1084 _march=''
1085 _mcpu=''
1086 _optimizing=''
1089 x86_64|amd64)
1090 _def_arch='#define ARCH_X86_64 1'
1091 _target_arch='TARGET_ARCH_X86_64 = yes'
1092 _def_arch_x86="#define ARCH_X86 1"
1093 _target_arch_x86="TARGET_ARCH_X86 = yes"
1094 iproc='x86_64'
1096 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1097 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1098 cpuopt=-mtune
1099 else
1100 cpuopt=-mcpu
1102 case "$pvendor" in
1103 AuthenticAMD)
1104 proc=k8;;
1105 GenuineIntel)
1106 # 64-bit prescotts exist, but as far as GCC is concerned they have the
1107 # same capabilities as a nocona.
1108 proc=nocona;;
1110 proc=error;;
1111 esac
1113 echocheck "GCC & CPU optimization abilities"
1114 cat > $TMPC << EOF
1115 int main(void) { return 0; }
1117 # This is a stripped-down version of the i386 fallback.
1118 if test "$_runtime_cpudetection" = no ; then
1119 # --- AMD processors ---
1120 if test "$proc" = "k8"; then
1121 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1123 # This will fail if gcc version < 3.3, which is ok because earlier
1124 # versions don't really support 64-bit on amd64.
1125 # Is this a valid assumption? -Corey
1126 if test "$proc" = "athlon-xp"; then
1127 cc_check -march=$proc $cpuopt=$proc || proc=error
1129 # --- Intel processors ---
1130 if test "$proc" = "nocona"; then
1131 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1133 if test "$proc" = "pentium4"; then
1134 cc_check -march=$proc $cpuopt=$proc || proc=error
1137 _march="-march=$proc"
1138 _mcpu="$cpuopt=$proc"
1139 if test "$proc" = "error" ; then
1140 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1141 _mcpu=""
1142 _march=""
1144 else # if test "$_runtime_cpudetection" = no
1145 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1146 _march="-march=x86-64"
1147 _mcpu="$cpuopt=x86-64"
1148 cc_check $_mcpu || _mcpu=""
1149 cc_check $_march $_mcpu || _march=""
1152 _optimizing=""
1154 echores "$proc"
1157 sparc)
1158 _def_arch='#define ARCH_SPARC 1'
1159 _target_arch='TARGET_ARCH_SPARC = yes'
1160 iproc='sparc'
1161 if sunos ; then
1162 echocheck "CPU type"
1163 karch=`uname -m`
1164 case "`echo $karch`" in
1165 sun4) proc=v7 ;;
1166 sun4c) proc=v7 ;;
1167 sun4d) proc=v8 ;;
1168 sun4m) proc=v8 ;;
1169 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1170 sun4v) proc=v9 ;;
1171 *) proc=v8 ;;
1172 esac
1173 echores "$proc"
1174 else
1175 proc=v8
1177 _march=''
1178 _mcpu="-mcpu=$proc"
1179 _optimizing="$proc"
1182 sparc64)
1183 _def_arch='#define ARCH_SPARC 1'
1184 _target_arch='TARGET_ARCH_SPARC = yes'
1185 _vis='yes'
1186 _def_vis='#define HAVE_VIS = yes'
1187 iproc='sparc'
1188 proc='v9'
1189 _march=''
1190 _mcpu="-mcpu=$proc"
1191 _optimizing="$proc"
1194 arm|armv4l|armv5tel)
1195 _def_arch='#define ARCH_ARMV4L 1'
1196 _target_arch='TARGET_ARCH_ARMV4L = yes'
1197 iproc='arm'
1198 proc=''
1199 _march=''
1200 _mcpu=''
1201 _optimizing=''
1204 ppc)
1205 _def_arch='#define ARCH_POWERPC 1'
1206 _def_dcbzl='#define NO_DCBZL 1'
1207 _target_arch='TARGET_ARCH_POWERPC = yes'
1208 iproc='ppc'
1209 proc=''
1210 _march=''
1211 _mcpu=''
1212 _optimizing=''
1213 _altivec=no
1215 echocheck "CPU type"
1216 case $system_name in
1217 Linux)
1218 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1219 if test -n "`$_cpuinfo | grep altivec`"; then
1220 _altivec=yes
1223 Darwin)
1224 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1225 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
1226 "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then
1227 _altivec=yes
1230 NetBSD)
1231 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1232 case $cc_version in
1233 2*|3.0*|3.1*|3.2*|3.3*)
1236 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1237 _altivec=yes
1240 esac
1242 AIX)
1243 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
1245 esac
1246 if test "$_altivec" = yes; then
1247 echores "$proc altivec"
1248 else
1249 echores "$proc"
1252 echocheck "GCC & CPU optimization abilities"
1254 if test -n "$proc"; then
1255 case "$proc" in
1256 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1257 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1258 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1259 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1260 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1261 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1262 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
1263 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
1264 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
1265 *) ;;
1266 esac
1267 # gcc 3.1(.1) and up supports 7400 and 7450
1268 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1269 case "$proc" in
1270 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1271 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1272 *) ;;
1273 esac
1275 # gcc 3.2 and up supports 970
1276 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1277 case "$proc" in
1278 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
1279 _def_dcbzl='#undef NO_DCBZL' ;;
1280 *) ;;
1281 esac
1283 # gcc 3.3 and up supports POWER4
1284 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1285 case "$proc" in
1286 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
1287 *) ;;
1288 esac
1290 # gcc 4.0 and up supports POWER5
1291 if test "$_cc_major" -ge "4"; then
1292 case "$proc" in
1293 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
1294 *) ;;
1295 esac
1299 if test -n "$_mcpu"; then
1300 _optimizing=`echo $_mcpu | cut -c 8-`
1301 echores "$_optimizing"
1302 else
1303 echores "none"
1308 alpha)
1309 _def_arch='#define ARCH_ALPHA 1'
1310 _target_arch='TARGET_ARCH_ALPHA = yes'
1311 iproc='alpha'
1312 _march=''
1314 echocheck "CPU type"
1315 cat > $TMPC << EOF
1316 int main() {
1317 unsigned long ver, mask;
1318 asm ("implver %0" : "=r" (ver));
1319 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1320 printf("%ld-%x\n", ver, ~mask);
1321 return 0;
1324 $_cc -o "$TMPO" "$TMPC"
1325 case `"$TMPO"` in
1327 0-0) proc="ev4"; cpu_understands_mvi="0";;
1328 1-0) proc="ev5"; cpu_understands_mvi="0";;
1329 1-1) proc="ev56"; cpu_understands_mvi="0";;
1330 1-101) proc="pca56"; cpu_understands_mvi="1";;
1331 2-303) proc="ev6"; cpu_understands_mvi="1";;
1332 2-307) proc="ev67"; cpu_understands_mvi="1";;
1333 2-1307) proc="ev68"; cpu_understands_mvi="1";;
1334 esac
1335 echores "$proc"
1337 echocheck "GCC & CPU optimization abilities"
1338 if test "$proc" = "ev68" ; then
1339 cc_check -mcpu=$proc || proc=ev67
1341 if test "$proc" = "ev67" ; then
1342 cc_check -mcpu=$proc || proc=ev6
1344 _mcpu="-mcpu=$proc"
1345 echores "$proc"
1347 _optimizing="$proc"
1349 echocheck "MVI instruction support in GCC"
1350 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
1351 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
1352 echores "yes"
1353 else
1354 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
1355 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
1359 mips)
1360 _def_arch='#define ARCH_SGI_MIPS 1'
1361 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
1362 iproc='sgi-mips'
1363 proc=''
1364 _march=''
1365 _mcpu=''
1366 _optimizing=''
1368 if irix ; then
1369 echocheck "CPU type"
1370 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
1371 case "`echo $proc`" in
1372 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
1373 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
1374 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
1375 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
1376 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
1377 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
1378 esac
1379 # gcc < 3.x does not support -mtune.
1380 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
1381 _mcpu=''
1383 echores "$proc"
1388 hppa)
1389 _def_arch='#define ARCH_PA_RISC 1'
1390 _target_arch='TARGET_ARCH_PA_RISC = yes'
1391 iproc='PA-RISC'
1392 proc=''
1393 _march=''
1394 _mcpu=''
1395 _optimizing=''
1398 s390)
1399 _def_arch='#define ARCH_S390 1'
1400 _target_arch='TARGET_ARCH_S390 = yes'
1401 iproc='390'
1402 proc=''
1403 _march=''
1404 _mcpu=''
1405 _optimizing=''
1408 s390x)
1409 _def_arch='#define ARCH_S390X 1'
1410 _target_arch='TARGET_ARCH_S390X = yes'
1411 iproc='390x'
1412 proc=''
1413 _march=''
1414 _mcpu=''
1415 _optimizing=''
1418 vax)
1419 _def_arch='#define ARCH_VAX 1'
1420 _target_arch='TARGET_ARCH_VAX = yes'
1421 iproc='vax'
1422 proc=''
1423 _march=''
1424 _mcpu=''
1425 _optimizing=''
1429 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1430 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1431 die "unsupported architecture $host_arch"
1433 esac # case "$host_arch" in
1435 if test "$_runtime_cpudetection" = yes ; then
1436 if x86; then
1437 _cmov=no
1438 _mmx=yes
1439 _3dnow=yes
1440 _3dnowext=yes
1441 _mmxext=yes
1442 _sse=yes
1443 _sse2=yes
1444 _mtrr=yes
1446 if ppc; then
1447 _altivec=yes
1451 if x86 && test "$_runtime_cpudetection" = no ; then
1452 extcheck() {
1453 if test "$1" = yes ; then
1454 echocheck "kernel support of $2"
1455 cat > $TMPC <<EOF
1456 #include <signal.h>
1457 void catch() { exit(1); }
1458 int main(void){
1459 signal(SIGILL, catch);
1460 __asm__ __volatile__ ("$3":::"memory");return(0);
1464 if cc_check && tmp_run ; then
1465 echores "yes"
1466 _optimizing="$_optimizing $2"
1467 return 0
1468 else
1469 echores "failed"
1470 echo "It seems that your kernel does not correctly support $2."
1471 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1472 return 1
1475 return 0
1478 extcheck $_mmx "mmx" "emms" || _mmx=no
1479 extcheck $_mmxext "mmxext" "sfence" || _mmxext=no
1480 extcheck $_3dnow "3dnow" "femms" || _3dnow=no
1481 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0" || _3dnowext=no
1482 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no _gcc3_ext="$_gcc3_ext -mno-sse"
1483 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no _gcc3_ext="$_gcc3_ext -mno-sse2"
1484 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx" || _cmov=no
1485 echocheck "mtrr support"
1486 echores "$_mtrr"
1488 if test "$_mtrr" = yes ; then
1489 _optimizing="$_optimizing mtrr"
1492 if test "$_gcc3_ext" != ""; then
1493 # if we had to disable sse/sse2 because the active kernel does not
1494 # support this instruction set extension, we also have to tell
1495 # gcc3 to not generate sse/sse2 instructions for normal C code
1496 cat > $TMPC << EOF
1497 int main(void) { return 0; }
1499 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1505 echocheck "assembler support of -pipe option"
1506 cat > $TMPC << EOF
1507 int main(void) { return 0; }
1509 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
1512 echocheck "compiler support of named assembler arguments"
1513 _named_asm_args=yes
1514 _def_named_asm_args="#define NAMED_ASM_ARGS 1"
1515 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
1516 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
1517 _named_asm_args=no
1518 _def_named_asm_args="#undef NAMED_ASM_ARGS"
1520 echores $_named_asm_args
1523 # Checking for CFLAGS
1524 _stripbinaries=yes
1525 if test "$_profile" != "" || test "$_debug" != "" ; then
1526 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
1527 if test "$_cc_major" -ge "3" ; then
1528 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
1530 _stripbinaries=no
1531 elif test -z "$CFLAGS" ; then
1532 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
1533 else
1534 _warn_CFLAGS=yes
1536 if test -n "$LDFLAGS" ; then
1537 _ld_extra="$_ld_extra $LDFLAGS"
1538 _warn_CFLAGS=yes
1540 if test -n "$CPPFLAGS" ; then
1541 _inc_extra="$_inc_extra $CPPFLAGS"
1542 _warn_CFLAGS=yes
1545 _prefix="/usr/local"
1547 # GOTCHA: the variables below defines the default behavior for autodetection
1548 # and have - unless stated otherwise - at least 2 states : yes no
1549 # If autodetection is available then the third state is: auto
1550 _libavutil=auto
1551 _libavutil_so=auto
1552 _libavcodec=auto
1553 _amr_nb=auto
1554 _amr_nb_fixed=auto
1555 _amr_wb=auto
1556 _libavdecoders=`grep 'register_avcodec(&[a-z0-9_]*_decoder)' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1557 _libavencoders=`grep 'register_avcodec(&[a-z0-9_]*_encoder)' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1558 _libavparsers=`grep 'av_register_codec_parser(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1559 _libavdemuxers=`grep 'av_register_input_format(&[a-z]' libavformat/allformats.c | sed 's/.*&\(.*\)).*/\1/'`
1560 _libavmuxers=`grep 'av_register_output_format(&[a-z]' libavformat/allformats.c | sed 's/.*&\(.*\)).*/\1/'`
1561 _libavcodec_so=auto
1562 _libavformat=auto
1563 _libavformat_so=auto
1564 _libpostproc=auto
1565 _libpostproc_so=auto
1566 _libavcodec_mpegaudio_hp=yes
1567 _mencoder=yes
1568 _x11=auto
1569 _xshape=auto
1570 _dga=auto # 1 2 no auto
1571 _xv=auto
1572 _xvmc=no #auto when complete
1573 _sdl=auto
1574 _directx=auto
1575 _win32waveout=auto
1576 _nas=auto
1577 _png=auto
1578 _jpeg=auto
1579 _pnm=yes
1580 _md5sum=yes
1581 _gif=auto
1582 _gl=auto
1583 _ggi=auto
1584 _ggiwmh=auto
1585 _aa=auto
1586 _caca=auto
1587 _svga=auto
1588 _vesa=auto
1589 _fbdev=auto
1590 _dvb=auto
1591 _dvbhead=auto
1592 _dxr2=auto
1593 _dxr3=auto
1594 _ivtv=auto
1595 _iconv=auto
1596 _langinfo=auto
1597 _rtc=auto
1598 _ossaudio=auto
1599 _arts=auto
1600 _esd=auto
1601 _polyp=auto
1602 _jack=auto
1603 _openal=auto
1604 _libcdio=auto
1605 _liblzo=auto
1606 _mad=auto
1607 _toolame=auto
1608 _twolame=auto
1609 _tremor_internal=yes
1610 _tremor_low=no
1611 _tremor_external=auto
1612 _libvorbis=auto
1613 _speex=auto
1614 _theora=auto
1615 _mp3lib=yes
1616 _liba52=yes
1617 _libdts=auto
1618 _libmpeg2=yes
1619 _faad_internal=auto
1620 _faad_external=auto
1621 _faad_fixed=no
1622 _faac=auto
1623 _ladspa=auto
1624 _xmms=no
1625 _dvdnav=auto
1626 _dvdnavconfig=dvdnav-config
1627 _dvdread=auto
1628 _dvdread_internal=auto
1629 _xanim=auto
1630 _real=auto
1631 _live=auto
1632 _xinerama=auto
1633 _mga=auto
1634 _xmga=auto
1635 _vm=auto
1636 _xf86keysym=auto
1637 _mlib=no #broken, thus disabled
1638 _sgiaudio=auto
1639 _sunaudio=auto
1640 _alsa=auto
1641 _fastmemcpy=yes
1642 _unrarlib=yes
1643 _win32=auto
1644 _select=yes
1645 _radio=no
1646 _radio_capture=no
1647 _radio_v4l=auto
1648 _radio_v4l2=auto
1649 _tv=yes
1650 _tv_v4l1=auto
1651 _tv_v4l2=auto
1652 _tv_bsdbt848=auto
1653 _pvr=auto
1654 _network=yes
1655 _winsock2=auto
1656 _smbsupport=auto
1657 _vidix_internal=auto
1658 _vidix_external=auto
1659 _joystick=no
1660 _xvid3=auto
1661 _xvid=auto
1662 _x264=auto
1663 _nut=auto
1664 _lirc=auto
1665 _lircc=auto
1666 _gui=no
1667 _gtk1=no
1668 _termcap=auto
1669 _termios=auto
1670 _3dfx=no
1671 _s3fb=no
1672 _tdfxfb=no
1673 _tdfxvid=no
1674 _tga=yes
1675 _directfb=auto
1676 _zr=auto
1677 _bl=no
1678 _largefiles=no
1679 #_language=en
1680 _shm=auto
1681 _linux_devfs=no
1682 _charset="UTF-8"
1683 _dynamic_plugins=no
1684 _crash_debug=no
1685 _sighandler=yes
1686 _libdv=auto
1687 _cdparanoia=auto
1688 _big_endian=auto
1689 _bitmap_font=yes
1690 _freetype=auto
1691 _fontconfig=auto
1692 _menu=no
1693 _qtx=auto
1694 _macosx=auto
1695 _maemo=auto
1696 _macosx_finder_support=no
1697 _macosx_bundle=auto
1698 _sortsub=yes
1699 _freetypeconfig='freetype-config'
1700 _fribidi=auto
1701 _fribidiconfig='fribidi-config'
1702 _enca=auto
1703 _inet6=auto
1704 _gethostbyname2=auto
1705 _ftp=yes
1706 _musepack=auto
1707 _vstream=auto
1708 _pthreads=auto
1709 _ass=auto
1710 _rpath=no
1711 _asmalign_pot=auto
1712 _color_console=no
1713 for ac_option do
1714 case "$ac_option" in
1715 # Skip 1st pass
1716 --target=*) ;;
1717 --cc=*) ;;
1718 --host-cc=*) ;;
1719 --as=*) ;;
1720 --enable-gcc-check) ;;
1721 --disable-gcc-check) ;;
1722 --enable-static*) ;;
1723 --disable-static*) ;;
1724 --with-extraincdir=*) ;;
1725 --with-extralibdir=*) ;;
1726 --extra-libs=*) ;;
1727 --enable-runtime-cpudetection) ;;
1728 --disable-runtime-cpudetection) ;;
1729 --enable-cross-compile) ;;
1730 --disable-cross-compile) ;;
1731 --with-install=*) ;;
1732 --enable-profile) ;;
1733 --disable-profile) ;;
1734 --enable-debug) ;;
1735 --enable-debug=*) ;;
1736 --disable-debug) ;;
1738 # Real 2nd pass
1739 --enable-mencoder) _mencoder=yes ;;
1740 --disable-mencoder) _mencoder=no ;;
1741 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
1742 --disable-dynamic-plugins) _dynamic_plugins=no ;;
1743 --enable-x11) _x11=yes ;;
1744 --disable-x11) _x11=no ;;
1745 --enable-xshape) _xshape=yes ;;
1746 --disable-xshape) _xshape=no ;;
1747 --enable-xv) _xv=yes ;;
1748 --disable-xv) _xv=no ;;
1749 --enable-xvmc) _xvmc=yes ;;
1750 --disable-xvmc) _xvmc=no ;;
1751 --enable-sdl) _sdl=yes ;;
1752 --disable-sdl) _sdl=no ;;
1753 --enable-directx) _directx=yes ;;
1754 --disable-directx) _directx=no ;;
1755 --enable-win32waveout) _win32waveout=yes ;;
1756 --disable-win32waveout) _win32waveout=no ;;
1757 --enable-nas) _nas=yes ;;
1758 --disable-nas) _nas=no ;;
1759 --enable-png) _png=yes ;;
1760 --disable-png) _png=no ;;
1761 --enable-jpeg) _jpeg=yes ;;
1762 --disable-jpeg) _jpeg=no ;;
1763 --enable-pnm) _pnm=yes ;;
1764 --disable-pnm) _pnm=no ;;
1765 --enable-md5sum) _md5sum=yes ;;
1766 --disable-md5sum) _md5sum=no ;;
1767 --enable-gif) _gif=yes ;;
1768 --disable-gif) _gif=no ;;
1769 --enable-gl) _gl=yes ;;
1770 --disable-gl) _gl=no ;;
1771 --enable-ggi) _ggi=yes ;;
1772 --disable-ggi) _ggi=no ;;
1773 --enable-ggiwmh) _ggiwmh=yes ;;
1774 --disable-ggiwmh) _ggiwmh=no ;;
1775 --enable-aa) _aa=yes ;;
1776 --disable-aa) _aa=no ;;
1777 --enable-caca) _caca=yes ;;
1778 --disable-caca) _caca=no ;;
1779 --enable-svga) _svga=yes ;;
1780 --disable-svga) _svga=no ;;
1781 --enable-vesa) _vesa=yes ;;
1782 --disable-vesa) _vesa=no ;;
1783 --enable-fbdev) _fbdev=yes ;;
1784 --disable-fbdev) _fbdev=no ;;
1785 --enable-dvb) _dvb=yes ;;
1786 --disable-dvb) _dvb=no ;;
1787 --enable-dvbhead) _dvbhead=yes ;;
1788 --disable-dvbhead) _dvbhead=no ;;
1789 --enable-dxr2) _dxr2=yes ;;
1790 --disable-dxr2) _dxr2=no ;;
1791 --enable-dxr3) _dxr3=yes ;;
1792 --disable-dxr3) _dxr3=no ;;
1793 --enable-ivtv) _ivtv=yes ;;
1794 --disable-ivtv) _ivtv=no ;;
1795 --enable-iconv) _iconv=yes ;;
1796 --disable-iconv) _iconv=no ;;
1797 --enable-langinfo) _langinfo=yes ;;
1798 --disable-langinfo) _langinfo=no ;;
1799 --enable-rtc) _rtc=yes ;;
1800 --disable-rtc) _rtc=no ;;
1801 --enable-libdv) _libdv=yes ;;
1802 --disable-libdv) _libdv=no ;;
1803 --enable-ossaudio) _ossaudio=yes ;;
1804 --disable-ossaudio) _ossaudio=no ;;
1805 --enable-arts) _arts=yes ;;
1806 --disable-arts) _arts=no ;;
1807 --enable-esd) _esd=yes ;;
1808 --disable-esd) _esd=no ;;
1809 --enable-polyp) _polyp=yes ;;
1810 --disable-polyp) _polyp=no ;;
1811 --enable-jack) _jack=yes ;;
1812 --disable-jack) _jack=no ;;
1813 --enable-openal) _openal=yes ;;
1814 --disable-openal) _openal=no ;;
1815 --enable-mad) _mad=yes ;;
1816 --disable-mad) _mad=no ;;
1817 --enable-toolame) _toolame=yes ;;
1818 --disable-toolame) _toolame=no ;;
1819 --enable-twolame) _twolame=yes ;;
1820 --disable-twolame) _twolame=no ;;
1821 --enable-libcdio) _libcdio=yes ;;
1822 --disable-libcdio) _libcdio=no ;;
1823 --enable-liblzo) _liblzo=yes ;;
1824 --disable-liblzo) _liblzo=no ;;
1825 --enable-libvorbis) _libvorbis=yes ;;
1826 --disable-libvorbis) _libvorbis=no ;;
1827 --enable-speex) _speex=yes ;;
1828 --disable-speex) _speex=no ;;
1829 --enable-tremor-internal) _tremor_internal=yes ;;
1830 --disable-tremor-internal) _tremor_internal=no ;;
1831 --enable-tremor-low) _tremor_low=yes ;;
1832 --disable-tremor-low) _tremor_low=no ;;
1833 --enable-tremor-external) _tremor_external=yes ;;
1834 --disable-tremor-external) _tremor_external=no ;;
1835 --enable-theora) _theora=yes ;;
1836 --disable-theora) _theora=no ;;
1837 --enable-mp3lib) _mp3lib=yes ;;
1838 --disable-mp3lib) _mp3lib=no ;;
1839 --enable-liba52) _liba52=yes ;;
1840 --disable-liba52) _liba52=no ;;
1841 --enable-libdts) _libdts=yes ;;
1842 --disable-libdts) _libdts=no ;;
1843 --enable-libmpeg2) _libmpeg2=yes ;;
1844 --disable-libmpeg2) _libmpeg2=no ;;
1845 --enable-musepack) _musepack=yes ;;
1846 --disable-musepack) _musepack=no ;;
1847 --enable-faad-internal) _faad_internal=yes ;;
1848 --disable-faad-internal) _faad_internal=no ;;
1849 --enable-faad-external) _faad_external=yes ;;
1850 --disable-faad-external) _faad_external=no ;;
1851 --enable-faad-fixed) _faad_fixed=yes ;;
1852 --disable-faad-fixed) _faad_fixed=no ;;
1853 --enable-faac) _faac=yes ;;
1854 --disable-faac) _faac=no ;;
1855 --enable-ladspa) _ladspa=yes ;;
1856 --disable-ladspa) _ladspa=no ;;
1857 --enable-xmms) _xmms=yes ;;
1858 --disable-xmms) _xmms=no ;;
1859 --enable-dvdread) _dvdread=yes ;;
1860 --disable-dvdread) _dvdread=no ;;
1861 --enable-dvdread-internal) _dvdread_internal=yes ;;
1862 --disable-dvdread-internal) _dvdread_internal=no ;;
1863 --enable-dvdnav) _dvdnav=yes ;;
1864 --disable-dvdnav) _dvdnav=no ;;
1865 --enable-xanim) _xanim=yes ;;
1866 --disable-xanim) _xanim=no ;;
1867 --enable-real) _real=yes ;;
1868 --disable-real) _real=no ;;
1869 --enable-live) _live=yes ;;
1870 --disable-live) _live=no ;;
1871 --enable-xinerama) _xinerama=yes ;;
1872 --disable-xinerama) _xinerama=no ;;
1873 --enable-mga) _mga=yes ;;
1874 --disable-mga) _mga=no ;;
1875 --enable-xmga) _xmga=yes ;;
1876 --disable-xmga) _xmga=no ;;
1877 --enable-vm) _vm=yes ;;
1878 --disable-vm) _vm=no ;;
1879 --enable-xf86keysym) _xf86keysym=yes ;;
1880 --disable-xf86keysym) _xf86keysym=no ;;
1881 --enable-mlib) _mlib=yes ;;
1882 --disable-mlib) _mlib=no ;;
1883 --enable-sunaudio) _sunaudio=yes ;;
1884 --disable-sunaudio) _sunaudio=no ;;
1885 --enable-sgiaudio) _sgiaudio=yes ;;
1886 --disable-sgiaudio) _sgiaudio=no ;;
1887 --enable-alsa) _alsa=yes ;;
1888 --disable-alsa) _alsa=no ;;
1889 --enable-tv) _tv=yes ;;
1890 --disable-tv) _tv=no ;;
1891 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1892 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1893 --enable-tv-v4l1) _tv_v4l1=yes ;;
1894 --disable-tv-v4l1) _tv_v4l1=no ;;
1895 --enable-tv-v4l2) _tv_v4l2=yes ;;
1896 --disable-tv-v4l2) _tv_v4l2=no ;;
1897 --enable-radio) _radio=yes ;;
1898 --enable-radio-capture) _radio_capture=yes ;;
1899 --disable-radio-capture) _radio_capture=no ;;
1900 --disable-radio) _radio=no ;;
1901 --enable-radio-v4l) _radio_v4l=yes ;;
1902 --disable-radio-v4l) _radio_v4l=no ;;
1903 --enable-radio-v4l2) _radio_v4l2=yes ;;
1904 --disable-radio-v4l2) _radio_v4l2=no ;;
1905 --enable-pvr) _pvr=yes ;;
1906 --disable-pvr) _pvr=no ;;
1907 --enable-fastmemcpy) _fastmemcpy=yes ;;
1908 --disable-fastmemcpy) _fastmemcpy=no ;;
1909 --enable-network) _network=yes ;;
1910 --disable-network) _network=no ;;
1911 --enable-winsock2) _winsock2=yes ;;
1912 --disable-winsock2) _winsock2=no ;;
1913 --enable-smb) _smbsupport=yes ;;
1914 --disable-smb) _smbsupport=no ;;
1915 --enable-vidix-internal) _vidix_internal=yes ;;
1916 --disable-vidix-internal) _vidix_internal=no ;;
1917 --enable-vidix-external) _vidix_external=yes ;;
1918 --disable-vidix-external) _vidix_external=no ;;
1919 --enable-joystick) _joystick=yes ;;
1920 --disable-joystick) _joystick=no ;;
1921 --enable-xvid3) _xvid3=yes ;;
1922 --disable-xvid3) _xvid3=no ;;
1923 --enable-xvid) _xvid=yes ;;
1924 --disable-xvid) _xvid=no ;;
1925 --enable-x264) _x264=yes ;;
1926 --disable-x264) _x264=no ;;
1927 --enable-nut) _nut=yes ;;
1928 --disable-nut) _nut=no ;;
1929 --enable-libavutil) _libavutil=yes ;;
1930 --disable-libavutil) _libavutil=no ;;
1931 --enable-libavutil_so) _libavutil_so=yes ;;
1932 --disable-libavutil_so) _libavutil_so=no ;;
1933 --enable-libavcodec) _libavcodec=yes ;;
1934 --disable-libavcodec) _libavcodec=no ;;
1935 --enable-libavcodec_so) _libavcodec_so=yes ;;
1936 --disable-libavcodec_so) _libavcodec_so=no ;;
1937 --enable-amr_nb) _amr_nb=yes ;;
1938 --disable-amr_nb) _amr_nb=no ;;
1939 --enable-amr_nb-fixed) _amr_nb_fixed=yes ;;
1940 --disable-amr_nb-fixed) _amr_nb_fixed=no ;;
1941 --enable-amr_wb) _amr_wb=yes ;;
1942 --disable-amr_wb) _amr_wb=no ;;
1943 --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;;
1944 --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1945 --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;;
1946 --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1947 --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;;
1948 --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1949 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1950 --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1951 --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;;
1952 --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1953 --enable-libavformat) _libavformat=yes;;
1954 --disable-libavformat) _libavformat=no ;;
1955 --enable-libavformat_so) _libavformat_so=yes ;;
1956 --disable-libavformat_so) _libavformat_so=no ;;
1957 --enable-libpostproc) _libpostproc=yes ;;
1958 --disable-libpostproc) _libpostproc=no ;;
1959 --enable-libpostproc_so) _libpostproc_so=yes ;;
1960 --disable-libpostproc_so) _libpostproc_so=no ;;
1961 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1962 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1964 --enable-lirc) _lirc=yes ;;
1965 --disable-lirc) _lirc=no ;;
1966 --enable-lircc) _lircc=yes ;;
1967 --disable-lircc) _lircc=no ;;
1968 --enable-gui) _gui=yes ;;
1969 --disable-gui) _gui=no ;;
1970 --enable-gtk1) _gtk1=yes ;;
1971 --disable-gtk1) _gtk1=no ;;
1972 --enable-termcap) _termcap=yes ;;
1973 --disable-termcap) _termcap=no ;;
1974 --enable-termios) _termios=yes ;;
1975 --disable-termios) _termios=no ;;
1976 --enable-3dfx) _3dfx=yes ;;
1977 --disable-3dfx) _3dfx=no ;;
1978 --enable-s3fb) _s3fb=yes ;;
1979 --disable-s3fb) _s3fb=no ;;
1980 --enable-tdfxfb) _tdfxfb=yes ;;
1981 --disable-tdfxfb) _tdfxfb=no ;;
1982 --disable-tdfxvid) _tdfxvid=no ;;
1983 --enable-tdfxvid) _tdfxvid=yes ;;
1984 --disable-tga) _tga=no ;;
1985 --enable-tga) _tga=yes ;;
1986 --enable-directfb) _directfb=yes ;;
1987 --disable-directfb) _directfb=no ;;
1988 --enable-zr) _zr=yes ;;
1989 --disable-zr) _zr=no ;;
1990 --enable-bl) _bl=yes ;;
1991 --disable-bl) _bl=no ;;
1992 --enable-mtrr) _mtrr=yes ;;
1993 --disable-mtrr) _mtrr=no ;;
1994 --enable-largefiles) _largefiles=yes ;;
1995 --disable-largefiles) _largefiles=no ;;
1996 --enable-shm) _shm=yes ;;
1997 --disable-shm) _shm=no ;;
1998 --enable-select) _select=yes ;;
1999 --disable-select) _select=no ;;
2000 --enable-linux-devfs) _linux_devfs=yes ;;
2001 --disable-linux-devfs) _linux_devfs=no ;;
2002 --enable-cdparanoia) _cdparanoia=yes ;;
2003 --disable-cdparanoia) _cdparanoia=no ;;
2004 --enable-big-endian) _big_endian=yes ;;
2005 --disable-big-endian) _big_endian=no ;;
2006 --enable-bitmap-font) _bitmap_font=yes ;;
2007 --disable-bitmap-font) _bitmap_font=no ;;
2008 --enable-freetype) _freetype=yes ;;
2009 --disable-freetype) _freetype=no ;;
2010 --enable-fontconfig) _fontconfig=yes ;;
2011 --disable-fontconfig) _fontconfig=no ;;
2012 --enable-unrarlib) _unrarlib=yes ;;
2013 --disable-unrarlib) _unrarlib=no ;;
2014 --enable-ftp) _ftp=yes ;;
2015 --disable-ftp) _ftp=no ;;
2016 --enable-vstream) _vstream=yes ;;
2017 --disable-vstream) _vstream=no ;;
2018 --enable-pthreads) _pthreads=yes ;;
2019 --disable-pthreads) _pthreads=no ;;
2020 --enable-ass) _ass=yes ;;
2021 --disable-ass) _ass=no ;;
2022 --enable-rpath) _rpath=yes ;;
2023 --disable-rpath) _rpath=no ;;
2024 --enable-color-console) _color_console=yes ;;
2025 --disable-color-console) _color_console=no ;;
2027 --enable-fribidi) _fribidi=yes ;;
2028 --disable-fribidi) _fribidi=no ;;
2030 --enable-enca) _enca=yes ;;
2031 --disable-enca) _enca=no ;;
2033 --enable-inet6) _inet6=yes ;;
2034 --disable-inet6) _inet6=no ;;
2036 --enable-gethostbyname2) _gethostbyname2=yes ;;
2037 --disable-gethostbyname2) _gethostbyname2=no ;;
2039 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
2040 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
2041 --disable-dga) _dga=no ;;
2043 --enable-menu) _menu=yes ;;
2044 --disable-menu) _menu=no ;;
2046 --enable-qtx) _qtx=yes ;;
2047 --disable-qtx) _qtx=no ;;
2049 --enable-macosx) _macosx=yes ;;
2050 --disable-macosx) _macosx=no ;;
2051 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
2052 --disable-macosx-finder-support) _macosx_finder_support=no ;;
2053 --enable-macosx-bundle) _macosx_bundle=yes;;
2054 --disable-macosx-bundle) _macosx_bundle=no;;
2056 --enable-maemo) _maemo=yes ;;
2057 --disable-maemo) _maemo=no ;;
2059 --enable-sortsub) _sortsub=yes ;;
2060 --disable-sortsub) _sortsub=no ;;
2062 --charset=*)
2063 _charset=`echo $ac_option | cut -d '=' -f 2`
2065 --language=*)
2066 _language=`echo $ac_option | cut -d '=' -f 2`
2069 --codecsdir=*)
2070 _codecsdir=`echo $ac_option | cut -d '=' -f 2`
2072 --win32codecsdir=*)
2073 _win32codecsdir=`echo $ac_option | cut -d '=' -f 2`
2075 --xanimcodecsdir=*)
2076 _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2`
2078 --realcodecsdir=*)
2079 _realcodecsdir=`echo $ac_option | cut -d '=' -f 2`
2081 --with-livelibdir=*)
2082 _livelibdir=`echo $ac_option | cut -d '=' -f 2`
2085 --with-xmmslibdir=*)
2086 _xmmslibdir=`echo $ac_option | cut -d '=' -f 2`
2089 --with-xmmsplugindir=*)
2090 _xmmsplugindir=`echo $ac_option | cut -d '=' -f 2`
2093 --enable-crash-debug)
2094 _crash_debug=yes
2096 --disable-crash-debug)
2097 _crash_debug=no
2099 --enable-sighandler)
2100 _sighandler=yes
2102 --disable-sighandler)
2103 _sighandler=no
2106 --enable-sse) _sse=yes ;;
2107 --disable-sse) _sse=no ;;
2108 --enable-sse2) _sse2=yes ;;
2109 --disable-sse2) _sse2=no ;;
2110 --enable-mmxext) _mmxext=yes ;;
2111 --disable-mmxext) _mmxext=no ;;
2112 --enable-3dnow) _3dnow=yes ;;
2113 --disable-3dnow) _3dnow=no _3dnowext=no ;;
2114 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
2115 --disable-3dnowext) _3dnowext=no ;;
2116 --enable-cmov) _cmov=yes ;;
2117 --disable-cmov) _cmov=no ;;
2118 --enable-altivec) _altivec=yes ;;
2119 --disable-altivec) _altivec=no ;;
2120 --enable-armv5te) _armv5te=yes ;;
2121 --disable-armv5te) _armv5te=no ;;
2122 --enable-iwmmxt) _iwmmxt=yes ;;
2123 --disable-iwmmxt) _iwmmxt=no ;;
2124 --enable-mmx) _mmx=yes ;;
2125 --disable-mmx) # 3Dnow! and MMX2 require MMX
2126 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
2128 --enable-win32) _win32=yes ;;
2129 --disable-win32) _win32=no ;;
2131 --with-x11libdir=*)
2132 _ld_x11=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2134 --with-xvmclib=*)
2135 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
2137 --with-xvidlibdir=*)
2138 _ld_xvid=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2140 --with-libdtslibdir=*)
2141 _ld_libdts=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2143 --with-x264libdir=*)
2144 _ld_x264=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2146 --with-mliblibdir=*)
2147 _ld_mlib=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2149 --with-sdl-config=*)
2150 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
2152 --with-freetype-config=*)
2153 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
2155 --with-fribidi-config=*)
2156 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
2158 --with-gtk-config=*)
2159 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
2161 --with-glib-config=*)
2162 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
2164 --with-dvdnav-config=*)
2165 _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
2167 --with-cdparanoialibdir=*)
2168 _ld_cdparanoia=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2170 --with-toolamelibdir=*)
2171 _ld_toolame=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2173 --prefix=*)
2174 _prefix=`echo $ac_option | cut -d '=' -f 2`
2176 --bindir=*)
2177 _bindir=`echo $ac_option | cut -d '=' -f 2`
2179 --datadir=*)
2180 _datadir=`echo $ac_option | cut -d '=' -f 2`
2182 --mandir=*)
2183 _mandir=`echo $ac_option | cut -d '=' -f 2`
2185 --confdir=*)
2186 _confdir=`echo $ac_option | cut -d '=' -f 2`
2188 --libdir=*)
2189 _libdir=`echo $ac_option | cut -d '=' -f 2`
2193 echo "Unknown parameter: $ac_option"
2194 exit 1
2197 esac
2198 done
2200 # Atmos: moved this here, to be correct, if --prefix is specified
2201 test -z "$_bindir" && _bindir="$_prefix/bin"
2202 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
2203 test -z "$_mandir" && _mandir="$_prefix/man"
2204 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
2205 test -z "$_libdir" && _libdir="$_prefix/lib"
2207 # For lack of a better place to put platform-specific stuff ..
2208 win32 && _exesuf=".exe"
2211 if x86 ; then
2212 # Checking assembler (_as) compatibility...
2213 # Added workaround for older as that reads from stdin by default - atmos
2214 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2215 echocheck "assembler ($_as $as_version)"
2217 _pref_as_version='2.9.1'
2218 echo 'nop' > $TMPS
2219 if test "$_mmx" = yes ; then
2220 echo 'emms' >> $TMPS
2222 if test "$_3dnow" = yes ; then
2223 _pref_as_version='2.10.1'
2224 echo 'femms' >> $TMPS
2226 if test "$_3dnowext" = yes ; then
2227 _pref_as_version='2.10.1'
2228 echo 'pswapd %mm0, %mm0' >> $TMPS
2230 if test "$_mmxext" = yes ; then
2231 _pref_as_version='2.10.1'
2232 echo 'movntq %mm0, (%eax)' >> $TMPS
2234 if test "$_sse" = yes ; then
2235 _pref_as_version='2.10.1'
2236 echo 'xorps %xmm0, %xmm0' >> $TMPS
2238 #if test "$_sse2" = yes ; then
2239 # _pref_as_version='2.11'
2240 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2242 if test "$_cmov" = yes ; then
2243 _pref_as_version='2.10.1'
2244 echo 'cmovb %eax, %ebx' >> $TMPS
2246 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2248 if test "$as_verc_fail" != yes ; then
2249 echores "ok"
2250 else
2251 _res_comment="Upgrade binutils to ${_pref_as_version} ..."
2252 echores "failed"
2253 die "obsolete binutils version"
2256 fi #if x86
2258 echocheck ".align is a power of two"
2259 if test "$_asmalign_pot" = auto ; then
2260 _asmalign_pot=no
2261 cat > $TMPC << EOF
2262 main() { asm (".align 3"); }
2264 cc_check && _asmalign_pot=yes
2266 if test "$_asmalign_pot" = "yes" ; then
2267 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2268 else
2269 _def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2271 echores $_asmalign_pot
2274 #FIXME: This should happen before the check for CFLAGS..
2275 if ppc ; then
2277 # check if altivec is supported by the compiler, and how to enable it
2279 _altivec_gcc_flags=''
2281 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2282 echocheck "GCC altivec support"
2284 p=''
2285 cat > $TMPC << EOF
2286 int main() {
2287 return 0;
2290 FSF_flags='-maltivec -mabi=altivec'
2291 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2293 # check for Darwin-style flags first, since
2294 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2295 # accepts but ignores FSF-style flags...
2297 if test -z "$p"; then
2298 cc_check $Darwin_flags && p='Darwin'
2300 if test -z "$p"; then
2301 cc_check $FSF_flags && p='FSF'
2304 case $p in
2305 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2306 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2307 *) _altivec=no ;;
2308 esac
2310 if test -z "$p"; then
2311 p=none
2312 else
2313 p="$p-style ($_altivec_gcc_flags)"
2316 echores "$p"
2319 # check if <altivec.h> should be included
2321 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2323 if test "$_altivec" = yes ; then
2324 echocheck "altivec.h"
2325 cat > $TMPC << EOF
2326 #include <altivec.h>
2327 int main(void) { return 0; }
2329 _have_altivec_h=no
2330 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2331 if test "$_have_altivec_h" = yes ; then
2332 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2334 echores "$_have_altivec_h"
2337 # disable runtime cpudetection if
2338 # - we cannot generate altivec code
2339 # - altivec is disabled by the user
2341 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2342 _runtime_cpudetection=no
2345 # show that we are optimizing for altivec (if enabled and supported)
2347 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2348 _optimizing="$_optimizing altivec"
2351 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2353 if test "$_altivec" = yes ; then
2354 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2355 #_mcpu="$_mcpu $_altivec_gcc_flags"
2356 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2359 # setup _def_altivec correctly
2361 if test "$_altivec" = yes ; then
2362 _def_altivec='#define HAVE_ALTIVEC 1'
2363 else
2364 _def_altivec='#undef HAVE_ALTIVEC'
2368 if arm ; then
2369 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2370 if test $_armv5te = "auto" ; then
2371 cat > $TMPC << EOF
2372 int main(void) {
2373 __asm__ __volatile__ ("qadd r0, r0, r0");
2376 _armv5te=no
2377 cc_check && _armv5te=yes
2379 echores "$_armv5te"
2381 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2382 if test $_iwmmxt = "auto" ; then
2383 cat > $TMPC << EOF
2384 int main(void) {
2385 __asm__ __volatile__ ("wunpckelub wr6, wr4");
2388 _iwmmxt=no
2389 cc_check && _iwmmxt=yes
2391 echores "$_iwmmxt"
2394 _def_mmx='#undef HAVE_MMX'
2395 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2396 _def_mmxext='#undef HAVE_MMX2'
2397 test "$_mmxext" = yes && _def_mmxext='#define HAVE_MMX2 1'
2398 _def_3dnow='#undef HAVE_3DNOW'
2399 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2400 _def_3dnowext='#undef HAVE_3DNOWEX'
2401 test "$_3dnowext" = yes && _def_3dnowext='#define HAVE_3DNOWEX 1'
2402 _def_sse='#undef HAVE_SSE'
2403 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2404 _def_sse2='#undef HAVE_SSE2'
2405 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2406 _def_cmov='#undef HAVE_CMOV'
2407 test "$_cmov" = yes && _def_cmov='#define HAVE_CMOV 1'
2408 _def_armv5te='#undef HAVE_ARMV5TE'
2409 test "$_armv5te" = yes && _def_armv5te='#define HAVE_ARMV5TE 1'
2410 _def_iwmmxt='#undef HAVE_IWMMXT'
2411 test "$_iwmmxt" = yes && _def_iwmmxt='#define HAVE_IWMMXT 1'
2413 # Checking kernel version...
2414 if x86 && linux ; then
2415 _k_verc_problem=no
2416 kernel_version=`uname -r 2>&1`
2417 echocheck "$system_name kernel version"
2418 case "$kernel_version" in
2419 '') kernel_version="?.??"; _k_verc_fail=yes;;
2420 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2421 _k_verc_problem=yes;;
2422 esac
2423 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2424 _k_verc_fail=yes
2426 if test "$_k_verc_fail" ; then
2427 echores "$kernel_version, fail"
2428 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2429 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2430 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2431 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2432 echo "2.2.x you must upgrade it to get SSE support!"
2433 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2434 else
2435 echores "$kernel_version, ok"
2439 if test "$_vidix_internal" = auto ; then
2440 _vidix_internal=no
2441 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2442 x86 && _vidix_internal=yes
2443 x86_64 && _vidix_internal=yes
2444 ppc && linux && _vidix_internal=yes
2445 alpha && linux && _vidix_internal=yes
2446 qnx && _vidix_internal=no
2447 sunos && _vidix_internal=no
2448 beos && _vidix_internal=no
2449 darwin && _vidix_internal=no
2453 # On QNX we must link to libph - Gabucino
2454 if qnx ; then
2455 _ld_arch="$_ld_arch -lph"
2458 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2459 _awk=
2460 if test "$_vidix_internal" = yes ; then
2461 _awk_verc_fail=yes
2462 echocheck "awk"
2463 for _awk in mawk gawk nawk awk; do
2464 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2465 _awk_verc_fail=no
2466 break
2468 done
2469 test "$_awk_verc_fail" = yes && _awk=no
2470 echores "$_awk"
2471 if test "$_awk_verc_fail" = yes; then
2472 echo "VIDIX needs awk, but no working implementation was found!"
2473 echo "Try the GNU version, which can be downloaded from:"
2474 echo "ftp://ftp.gnu.org/gnu/gawk/"
2475 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2476 die "no awk"
2480 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2481 if irix ; then
2482 _ranlib='ar -r'
2483 elif linux ; then
2484 _ranlib='true'
2487 ######################
2488 # MAIN TESTS GO HERE #
2489 ######################
2492 echocheck "extra headers"
2493 if test "$_inc_extra" ; then
2494 echores "$_inc_extra"
2495 else
2496 echores "none"
2500 echocheck "extra libs"
2501 if test "$_ld_extra" ; then
2502 echores "$_ld_extra"
2503 else
2504 echores "none"
2507 echocheck "-lposix"
2508 cat > $TMPC <<EOF
2509 int main(void) { return 0; }
2511 if cc_check -lposix ; then
2512 _ld_arch="$_ld_arch -lposix"
2513 echores "yes"
2514 else
2515 echores "no"
2518 echocheck "-lm"
2519 cat > $TMPC <<EOF
2520 int main(void) { return 0; }
2522 if cc_check -lm ; then
2523 _ld_lm="-lm"
2524 echores "yes"
2525 else
2526 _ld_lm=""
2527 echores "no"
2531 echocheck "langinfo"
2532 if test "$_langinfo" = auto ; then
2533 cat > $TMPC <<EOF
2534 #include <langinfo.h>
2535 int main(void) { nl_langinfo(CODESET); return 0; }
2537 _langinfo=no
2538 cc_check && _langinfo=yes
2540 if test "$_langinfo" = yes ; then
2541 _def_langinfo='#define USE_LANGINFO 1'
2542 else
2543 _def_langinfo='#undef USE_LANGINFO'
2545 echores "$_langinfo"
2548 echocheck "language"
2549 test -z "$_language" && _language=$LINGUAS
2550 _language=`echo $_language | sed 's/,/ /g'`
2551 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2552 for lang in $_language ; do
2553 test "$lang" = all && lang=en
2554 if test -f "help/help_mp-${lang}.h" ; then
2555 _language=$lang
2556 break
2557 else
2558 echo ${_echo_n} "$lang not found, ${_echo_c}"
2559 _language=`echo $_language | sed "s/$lang *//"`
2561 done
2562 test -z "$_language" && _language=en
2563 _mp_help="help/help_mp-${_language}.h"
2564 test -f $_mp_help || die "$_mp_help not found"
2565 for lang in $LANGUAGES ; do
2566 if test -f "DOCS/man/$lang/mplayer.1" ; then
2567 MAN_LANG="$lang $MAN_LANG"
2569 done
2570 _doc_lang=$_language
2571 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2572 echores "using $_language (man pages: $MAN_LANG)"
2575 echocheck "enable sighandler"
2576 if test "$_sighandler" = yes ; then
2577 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2578 else
2579 _def_sighandler='#undef ENABLE_SIGHANDLER'
2581 echores "$_sighandler"
2583 echocheck "runtime cpudetection"
2584 if test "$_runtime_cpudetection" = yes ; then
2585 _optimizing="Runtime CPU-Detection enabled"
2586 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2587 else
2588 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2590 echores "$_runtime_cpudetection"
2593 echocheck "restrict keyword"
2594 for restrict_keyword in restrict __restrict __restrict__ ; do
2595 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2596 if cc_check; then
2597 _def_restrict_keyword=$restrict_keyword
2598 break;
2600 done
2601 if [ -n "$_def_restrict_keyword" ]; then
2602 echores "$_def_restrict_keyword"
2603 else
2604 echores "none"
2606 # Avoid infinite recursion loop ("#define restrict restrict")
2607 if [ "$_def_restrict_keyword" != "restrict" ]; then
2608 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2609 else
2610 _def_restrict_keyword=""
2614 echocheck "__builtin_expect"
2615 # GCC branch prediction hint
2616 cat > $TMPC << EOF
2617 int foo (int a) {
2618 a = __builtin_expect (a, 10);
2619 return a == 10 ? 0 : 1;
2621 int main() { return foo(10) && foo(0); }
2623 _builtin_expect=no
2624 cc_check && _builtin_expect=yes
2625 if test "$_builtin_expect" = yes ; then
2626 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2627 else
2628 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2630 echores "$_builtin_expect"
2633 echocheck "kstat"
2634 cat > $TMPC << EOF
2635 #include <kstat.h>
2636 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2638 _kstat=no
2639 cc_check -lkstat && _kstat=yes
2640 if test "$_kstat" = yes ; then
2641 _def_kstat="#define HAVE_LIBKSTAT 1"
2642 _ld_arch="-lkstat $_ld_arch"
2643 else
2644 _def_kstat="#undef HAVE_LIBKSTAT"
2646 echores "$_kstat"
2649 echocheck "posix4"
2650 # required for nanosleep on some systems
2651 cat > $TMPC << EOF
2652 #include <time.h>
2653 int main(void) { (void) nanosleep(0, 0); return 0; }
2655 _posix4=no
2656 cc_check -lposix4 && _posix4=yes
2657 if test "$_posix4" = yes ; then
2658 _ld_arch="-lposix4 $_ld_arch"
2660 echores "$_posix4"
2662 echocheck "lrintf"
2663 cat > $TMPC << EOF
2664 #include <math.h>
2665 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2667 _lrintf=no
2668 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2669 if test "$_lrintf" = yes ; then
2670 _def_lrintf="#define HAVE_LRINTF 1"
2671 else
2672 _def_lrintf="#undef HAVE_LRINTF"
2674 echores "$_lrintf"
2676 echocheck "round"
2677 cat > $TMPC << EOF
2678 #include <math.h>
2679 int main(void) { (void) round(0.0); return 0; }
2681 _round=no
2682 cc_check $_ld_lm && _round=yes
2683 if test "$_round" = yes ; then
2684 _def_round="#define HAVE_ROUND 1"
2685 else
2686 _def_round="#undef HAVE_ROUND"
2688 echores "$_round"
2690 echocheck "nanosleep"
2691 # also check for nanosleep
2692 cat > $TMPC << EOF
2693 #include <time.h>
2694 int main(void) { (void) nanosleep(0, 0); return 0; }
2696 _nanosleep=no
2697 cc_check $_ld_arch && _nanosleep=yes
2698 if test "$_nanosleep" = yes ; then
2699 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2700 else
2701 _def_nanosleep='#undef HAVE_NANOSLEEP'
2703 echores "$_nanosleep"
2706 echocheck "socklib"
2707 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2708 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2709 cat > $TMPC << EOF
2710 #include <netdb.h>
2711 #include <sys/socket.h>
2712 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2714 _socklib=no
2715 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2716 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2717 done
2718 if test $_winsock2 = auto && not cygwin ; then
2719 _winsock2=no
2720 cat > $TMPC << EOF
2721 #include <winsock2.h>
2722 int main(void) { (void) gethostbyname(0); return 0; }
2724 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2726 test "$_ld_sock" && _res_comment="using $_ld_sock"
2727 echores "$_socklib"
2730 if test $_winsock2 = yes ; then
2731 _ld_sock="-lws2_32"
2732 _def_winsock2='#define HAVE_WINSOCK2 1'
2733 else
2734 _def_winsock2='#undef HAVE_WINSOCK2'
2738 _use_aton=no
2739 echocheck "inet_pton()"
2740 cat > $TMPC << EOF
2741 #include <sys/types.h>
2742 #include <sys/socket.h>
2743 #include <arpa/inet.h>
2744 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2746 if test "$_winsock2" = yes ; then
2747 _res_comment="using winsock2 functions instead"
2748 echores "no"
2749 elif cc_check $_ld_sock ; then
2750 # NOTE: Linux has libresolv but does not need it
2752 _res_comment="using $_ld_sock"
2753 echores "yes"
2754 elif cc_check $_ld_sock -lresolv ; then
2755 # NOTE: needed for SunOS at least
2756 _ld_sock="$_ld_sock -lresolv"
2757 _res_comment="using $_ld_sock"
2758 echores "yes"
2759 else
2760 _res_comment="trying inet_aton next"
2761 echores "no"
2763 echocheck "inet_aton()"
2764 cat > $TMPC << EOF
2765 #include <sys/types.h>
2766 #include <sys/socket.h>
2767 #include <arpa/inet.h>
2768 int main(void) { (void) inet_aton(0, 0); return 0; }
2770 _use_aton=yes
2771 if cc_check $_ld_sock ; then
2772 # NOTE: Linux has libresolv but does not need it
2774 _res_comment="using $_ld_sock"
2775 elif cc_check $_ld_sock -lresolv ; then
2776 # NOTE: needed for SunOS at least
2777 _ld_sock="$_ld_sock -lresolv"
2778 _res_comment="using $_ld_sock"
2779 else
2780 _use_aton=no
2781 _network=no
2782 _res_comment="network support disabled"
2784 echores "$_use_aton"
2787 _def_use_aton='#undef USE_ATON'
2788 if test "$_use_aton" = yes; then
2789 _def_use_aton='#define USE_ATON 1'
2793 echocheck "inttypes.h (required)"
2794 cat > $TMPC << EOF
2795 #include <inttypes.h>
2796 int main(void) { return 0; }
2798 _inttypes=no
2799 cc_check && _inttypes=yes
2800 echores "$_inttypes"
2802 if test "$_inttypes" = no ; then
2803 echocheck "bitypes.h (inttypes.h predecessor)"
2804 cat > $TMPC << EOF
2805 #include <sys/bitypes.h>
2806 int main(void) { return 0; }
2808 cc_check && _inttypes=yes
2809 if test "$_inttypes" = yes ; then
2810 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."
2811 else
2812 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2817 echocheck "int_fastXY_t in inttypes.h"
2818 cat > $TMPC << EOF
2819 #include <inttypes.h>
2820 int main(void) {
2821 volatile int_fast16_t v= 0;
2822 return v; }
2824 _fast_inttypes=no
2825 cc_check && _fast_inttypes=yes
2826 if test "$_fast_inttypes" = yes ; then
2827 # nothing to do
2829 else
2830 _def_fast_inttypes='
2831 typedef signed char int_fast8_t;
2832 typedef signed int int_fast16_t;
2833 typedef signed int int_fast32_t;
2834 typedef signed long long int_fast64_t;
2835 typedef unsigned char uint_fast8_t;
2836 typedef unsigned int uint_fast16_t;
2837 typedef unsigned int uint_fast32_t;
2838 typedef unsigned long long uint_fast64_t;'
2840 echores "$_fast_inttypes"
2843 echocheck "word size"
2844 _mp_wordsize="#undef MP_WORDSIZE"
2845 cat > $TMPC << EOF
2846 #include <stdio.h>
2847 #include <sys/types.h>
2848 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2850 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2851 echores "$_wordsize"
2854 echocheck "stddef.h"
2855 cat > $TMPC << EOF
2856 #include <stddef.h>
2857 int main(void) { return 0; }
2859 _stddef=no
2860 cc_check && _stddef=yes
2861 if test "$_stddef" = yes ; then
2862 _def_stddef='#define HAVE_STDDEF_H 1'
2863 else
2864 _def_stddef='#undef HAVE_STDDEF_H'
2866 echores "$_stddef"
2869 echocheck "malloc.h"
2870 cat > $TMPC << EOF
2871 #include <malloc.h>
2872 int main(void) { (void) malloc(0); return 0; }
2874 _malloc=no
2875 cc_check && _malloc=yes
2876 if test "$_malloc" = yes ; then
2877 _def_malloc='#define HAVE_MALLOC_H 1'
2878 else
2879 _def_malloc='#undef HAVE_MALLOC_H'
2881 # malloc.h emits a warning in FreeBSD and OpenBSD
2882 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2883 echores "$_malloc"
2886 echocheck "memalign()"
2887 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2888 cat > $TMPC << EOF
2889 #include <malloc.h>
2890 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2892 _memalign=no
2893 cc_check && _memalign=yes
2894 if test "$_memalign" = yes ; then
2895 _def_memalign='#define HAVE_MEMALIGN 1'
2896 else
2897 _def_memalign='#undef HAVE_MEMALIGN'
2898 _def_map_memalign='#define memalign(a,b) malloc(b)'
2899 not darwin && _def_memalign_hack='#define MEMALIGN_HACK 1'
2901 echores "$_memalign"
2904 echocheck "alloca.h"
2905 cat > $TMPC << EOF
2906 #include <alloca.h>
2907 int main(void) { (void) alloca(0); return 0; }
2909 _alloca=no
2910 cc_check && _alloca=yes
2911 if cc_check ; then
2912 _def_alloca='#define HAVE_ALLOCA_H 1'
2913 else
2914 _def_alloca='#undef HAVE_ALLOCA_H'
2916 echores "$_alloca"
2919 echocheck "mman.h"
2920 cat > $TMPC << EOF
2921 #include <sys/types.h>
2922 #include <sys/mman.h>
2923 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2925 _mman=no
2926 cc_check && _mman=yes
2927 if test "$_mman" = yes ; then
2928 _def_mman='#define HAVE_SYS_MMAN_H 1'
2929 else
2930 _def_mman='#undef HAVE_SYS_MMAN_H'
2932 echores "$_mman"
2934 cat > $TMPC << EOF
2935 #include <sys/types.h>
2936 #include <sys/mman.h>
2937 int main(void) { void *p = MAP_FAILED; return 0; }
2939 _mman_has_map_failed=no
2940 cc_check && _mman_has_map_failed=yes
2941 if test "$_mman_has_map_failed" = yes ; then
2942 _def_mman_has_map_failed=''
2943 else
2944 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2947 echocheck "dynamic loader"
2948 cat > $TMPC << EOF
2949 #include <dlfcn.h>
2950 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2952 _dl=no
2953 for _ld_tmp in "" "-ldl" ; do
2954 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2955 done
2956 if test "$_dl" = yes ; then
2957 _def_dl='#define HAVE_LIBDL 1'
2958 else
2959 _def_dl='#undef HAVE_LIBDL'
2961 echores "$_dl"
2964 echocheck "dynamic a/v plugins support"
2965 if test "$_dl" = no ; then
2966 _dynamic_plugins=no
2968 if test "$_dynamic_plugins" = yes ; then
2969 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
2970 else
2971 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
2973 echores "$_dynamic_plugins"
2976 #echocheck "dynamic linking"
2977 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
2978 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
2979 #cat > $TMPC << EOF
2980 #int main(void) { return 0; }
2981 #EOF
2982 #if cc_check -rdynamic ; then
2983 # _ld_dl_dynamic='-rdynamic'
2984 #elif cc_check -Bdynamic ; then
2985 # _ld_dl_dynamic='-Bdynamic'
2986 #elif cc_check ; then
2987 # _ld_dl_dynamic=''
2989 #echores "using $_ld_dl_dynamic"
2991 _def_threads='#undef HAVE_THREADS'
2993 echocheck "pthread"
2994 if test "$_pthreads" = auto ; then
2995 cat > $TMPC << EOF
2996 #include <pthread.h>
2997 void* func(void *arg) { return arg; }
2998 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
3000 _pthreads=no
3001 if not hpux ; then
3002 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3003 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3004 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3005 done
3008 if test "$_pthreads" = yes ; then
3009 _res_comment="using $_ld_pthread"
3010 _def_pthreads='#define HAVE_PTHREADS 1'
3011 _def_threads='#define HAVE_THREADS 1'
3012 else
3013 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
3014 _def_pthreads='#undef HAVE_PTHREADS'
3015 _nas=no ; _tv_v4l1=no ; _macosx=no
3016 if not mingw32 ; then
3017 _win32=no
3020 echores "$_pthreads"
3022 echocheck "rpath"
3023 netbsd &&_rpath=yes
3024 if test "$_rpath" = yes ; then
3025 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
3026 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
3027 done
3028 _ld_extra=$tmp
3030 echores "$_rpath"
3032 echocheck "iconv"
3033 if test "$_iconv" = auto ; then
3034 _iconv_tmp='#include <iconv.h>'
3036 cat > $TMPC << EOF
3037 #include <stdio.h>
3038 #include <unistd.h>
3039 $_iconv_tmp
3040 #define INBUFSIZE 1024
3041 #define OUTBUFSIZE 4096
3043 char inbuffer[INBUFSIZE];
3044 char outbuffer[OUTBUFSIZE];
3046 int main(void) {
3047 size_t numread;
3048 iconv_t icdsc;
3049 char *tocode="UTF-8";
3050 char *fromcode="cp1250";
3051 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
3052 while ((numread = read (0, inbuffer, INBUFSIZE))) {
3053 char *iptr=inbuffer;
3054 char *optr=outbuffer;
3055 size_t inleft=numread;
3056 size_t outleft=OUTBUFSIZE;
3057 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3058 != (size_t)(-1)) {
3059 write (1, outbuffer, OUTBUFSIZE - outleft);
3062 if (iconv_close(icdsc) == -1)
3067 _iconv=no
3068 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3069 cc_check $_ld_lm $_ld_tmp && _ld_iconv="$_ld_tmp" && _iconv=yes && break
3070 done
3072 if test "$_iconv" = yes ; then
3073 _def_iconv='#define USE_ICONV 1'
3074 else
3075 _def_iconv='#undef USE_ICONV'
3077 echores "$_iconv"
3080 echocheck "sys/soundcard.h"
3081 cat > $TMPC << EOF
3082 #include <sys/soundcard.h>
3083 int main(void) { return 0; }
3085 _sys_soundcard=no
3086 cc_check && _sys_soundcard=yes
3087 if test "$_sys_soundcard" = yes ; then
3088 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3089 _include_soundcard='#include <sys/soundcard.h>'
3090 else
3091 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3093 echores "$_sys_soundcard"
3095 if test "$_sys_soundcard" != yes ; then
3096 echocheck "soundcard.h"
3097 cat > $TMPC << EOF
3098 #include <soundcard.h>
3099 int main(void) { return 0; }
3101 _soundcard=no
3102 cc_check && _soundcard=yes
3103 if linux || test "$_ossaudio" != no ; then
3104 # use soundcard.h on Linux, or when OSS support is enabled
3105 echores "$_soundcard"
3106 else
3107 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
3108 _res_comment= "but ignored!"
3109 echores "$_soundcard"
3110 _soundcard=no
3112 if test "$_soundcard" = yes ; then
3113 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3114 _include_soundcard='#include <soundcard.h>'
3115 else
3116 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3118 else
3119 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3123 echocheck "sys/dvdio.h"
3124 cat > $TMPC << EOF
3125 #include <unistd.h>
3126 #include <sys/dvdio.h>
3127 int main(void) { return 0; }
3129 _dvdio=no
3130 cc_check && _dvdio=yes
3131 if test "$_dvdio" = yes ; then
3132 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3133 else
3134 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3136 echores "$_dvdio"
3139 echocheck "sys/cdio.h"
3140 cat > $TMPC << EOF
3141 #include <unistd.h>
3142 #include <sys/cdio.h>
3143 int main(void) { return 0; }
3145 _cdio=no
3146 cc_check && _cdio=yes
3147 if test "$_cdio" = yes ; then
3148 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3149 else
3150 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3152 echores "$_cdio"
3155 echocheck "linux/cdrom.h"
3156 cat > $TMPC << EOF
3157 #include <sys/types.h>
3158 #include <linux/cdrom.h>
3159 int main(void) { return 0; }
3161 _cdrom=no
3162 cc_check && _cdrom=yes
3163 if test "$_cdrom" = yes ; then
3164 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3165 else
3166 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3168 echores "$_cdrom"
3171 echocheck "dvd.h"
3172 cat > $TMPC << EOF
3173 #include <dvd.h>
3174 int main(void) { return 0; }
3176 _dvd=no
3177 cc_check && _dvd=yes
3178 if test "$_dvd" = yes ; then
3179 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3180 else
3181 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3183 echores "$_dvd"
3186 if bsdos; then
3187 echocheck "BSDI dvd.h"
3188 cat > $TMPC << EOF
3189 #include <dvd.h>
3190 int main(void) { return 0; }
3192 _bsdi_dvd=no
3193 cc_check && _bsdi_dvd=yes
3194 if test "$_bsdi_dvd" = yes ; then
3195 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3196 else
3197 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3199 echores "$_bsdi_dvd"
3200 fi #if bsdos
3203 if hpux; then
3204 # also used by AIX, but AIX does not support VCD and/or libdvdread
3205 echocheck "HP-UX SCSI header"
3206 cat > $TMPC << EOF
3207 #include <sys/scsi.h>
3208 int main(void) { return 0; }
3210 _hpux_scsi_h=no
3211 cc_check && _hpux_scsi_h=yes
3212 if test "$_hpux_scsi_h" = yes ; then
3213 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3214 else
3215 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3217 echores "$_hpux_scsi_h"
3218 fi #if hpux
3221 if sunos; then
3222 echocheck "userspace SCSI headers (Solaris)"
3223 cat > $TMPC << EOF
3224 # include <unistd.h>
3225 # include <stropts.h>
3226 # include <sys/scsi/scsi_types.h>
3227 # include <sys/scsi/impl/uscsi.h>
3228 int main(void) { return 0; }
3230 _sol_scsi_h=no
3231 cc_check && _sol_scsi_h=yes
3232 if test "$_sol_scsi_h" = yes ; then
3233 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3234 else
3235 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3237 echores "$_sol_scsi_h"
3238 fi #if sunos
3241 echocheck "termcap"
3242 if test "$_termcap" = auto ; then
3243 cat > $TMPC <<EOF
3244 int main(void) { tgetent(); return 0; }
3246 _termcap=no
3247 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3248 cc_check $_ld_tmp && _ld_termcap="$_ld_tmp" && _termcap=yes && break
3249 done
3251 if test "$_termcap" = yes ; then
3252 _def_termcap='#define USE_TERMCAP 1'
3253 _res_comment="using $_ld_termcap"
3254 else
3255 _def_termcap='#undef USE_TERMCAP'
3257 echores "$_termcap"
3260 echocheck "termios"
3261 if test "$_termios" = auto ; then
3262 cat > $TMPC <<EOF
3263 #include <sys/termios.h>
3264 int main(void) { return 0; }
3266 _termios=auto
3267 cc_check && _termios=yes
3268 _def_termios_h_name='sys/termios.h'
3270 # second test:
3271 if test "$_termios" = auto ; then
3272 cat > $TMPC <<EOF
3273 #include <termios.h>
3274 int main(void) { return 0; }
3276 _termios=no
3277 cc_check && _termios=yes
3278 _def_termios_h_name='termios.h'
3281 if test "$_termios" = yes ; then
3282 _def_termios='#define HAVE_TERMIOS 1'
3283 _def_termios_h='#undef HAVE_TERMIOS_H'
3284 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3286 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3287 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3288 elif test "$_def_termios_h_name" = 'termios.h' ; then
3289 _def_termios_h='#define HAVE_TERMIOS_H 1'
3291 _res_comment="using $_def_termios_h_name"
3292 else
3293 _def_termios='#undef HAVE_TERMIOS'
3294 _def_termios_h_name=''
3295 _termios=no
3297 echores "$_termios"
3300 echocheck "shm"
3301 if test "$_shm" = auto ; then
3302 cat > $TMPC << EOF
3303 #include <sys/types.h>
3304 #include <sys/shm.h>
3305 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3307 _shm=no
3308 cc_check && _shm=yes
3310 if test "$_shm" = yes ; then
3311 _def_shm='#define HAVE_SHM 1'
3312 else
3313 _def_shm='#undef HAVE_SHM'
3315 echores "$_shm"
3318 # XXX: FIXME, add runtime checking
3319 echocheck "linux devfs"
3320 echores "$_linux_devfs"
3323 echocheck "scandir()"
3324 cat > $TMPC << EOF
3325 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3327 _scandir=no
3328 cc_check && _scandir=yes
3329 if test "$_scandir" = yes ; then
3330 _def_scandir='#define HAVE_SCANDIR 1'
3331 else
3332 _def_scandir='#undef HAVE_SCANDIR'
3334 echores "$_scandir"
3337 echocheck "strsep()"
3338 cat > $TMPC << EOF
3339 #include <string.h>
3340 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3342 _strsep=no
3343 cc_check && _strsep=yes
3344 if test "$_strsep" = yes ; then
3345 _def_strsep='#define HAVE_STRSEP 1'
3346 else
3347 _def_strsep='#undef HAVE_STRSEP'
3349 echores "$_strsep"
3351 echocheck "strlcpy()"
3352 cat > $TMPC << EOF
3353 #include <string.h>
3354 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3356 _strlcpy=no
3357 cc_check && _strlcpy=yes
3358 if test "$_strlcpy" = yes ; then
3359 _def_strlcpy='#define HAVE_STRLCPY 1'
3360 else
3361 _def_strlcpy='#undef HAVE_STRLCPY'
3363 echores "$_strlcpy"
3365 echocheck "strlcat()"
3366 cat > $TMPC << EOF
3367 #include <string.h>
3368 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3370 _strlcat=no
3371 cc_check && _strlcat=yes
3372 if test "$_strlcat" = yes ; then
3373 _def_strlcat='#define HAVE_STRLCAT 1'
3374 else
3375 _def_strlcat='#undef HAVE_STRLCAT'
3377 echores "$_strlcat"
3379 echocheck "fseeko()"
3380 cat > $TMPC << EOF
3381 #include <stdio.h>
3382 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3384 _fseeko=no
3385 cc_check && _fseeko=yes
3386 if test "$_fseeko" = yes ; then
3387 _def_fseeko='#define HAVE_FSEEKO 1'
3388 else
3389 _def_fseeko='#undef HAVE_FSEEKO'
3391 echores "$_fseeko"
3393 echocheck "localtime_r()"
3394 cat > $TMPC << EOF
3395 #include <time.h>
3396 int main( void ) { localtime_r(NULL, NULL); }
3398 _localtime_r=no
3399 cc_check && _localtime_r=yes
3400 if test "$_localtime_r" = yes ; then
3401 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3402 else
3403 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3405 echores "$_localtime_r"
3407 echocheck "vsscanf()"
3408 cat > $TMPC << EOF
3409 #include <stdarg.h>
3410 int main(void) { vsscanf(0, 0, 0); return 0; }
3412 _vsscanf=no
3413 cc_check && _vsscanf=yes
3414 if test "$_vsscanf" = yes ; then
3415 _def_vsscanf='#define HAVE_VSSCANF 1'
3416 else
3417 _def_vsscanf='#undef HAVE_VSSCANF'
3419 echores "$_vsscanf"
3422 echocheck "swab()"
3423 cat > $TMPC << EOF
3424 #include <unistd.h>
3425 int main(void) { swab(0, 0, 0); return 0; }
3427 _swab=no
3428 cc_check && _swab=yes
3429 if test "$_swab" = yes ; then
3430 _def_swab='#define HAVE_SWAB 1'
3431 else
3432 _def_swab='#undef HAVE_SWAB'
3434 echores "$_swab"
3436 echocheck "POSIX select()"
3437 cat > $TMPC << EOF
3438 #include <stdio.h>
3439 #include <stdlib.h>
3440 #include <sys/types.h>
3441 #include <string.h>
3442 #include <sys/time.h>
3443 #include <unistd.h>
3444 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3446 _posix_select=no
3447 cc_check && _posix_select=yes
3448 if test "$_posix_select" = no ; then
3449 _def_no_posix_select='#define HAVE_NO_POSIX_SELECT 1'
3450 else
3451 _def_no_posix_select='#undef HAVE_NO_POSIX_SELECT'
3453 echores "$_posix_select"
3456 echocheck "gettimeofday()"
3457 cat > $TMPC << EOF
3458 #include <stdio.h>
3459 #include <sys/time.h>
3460 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3462 _gettimeofday=no
3463 cc_check && _gettimeofday=yes
3464 if test "$_gettimeofday" = yes ; then
3465 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3466 else
3467 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3469 echores "$_gettimeofday"
3472 echocheck "glob()"
3473 cat > $TMPC << EOF
3474 #include <stdio.h>
3475 #include <glob.h>
3476 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3478 _glob=no
3479 cc_check && _glob=yes
3480 if test "$_glob" = yes ; then
3481 _def_glob='#define HAVE_GLOB 1'
3482 else
3483 _def_glob='#undef HAVE_GLOB'
3485 echores "$_glob"
3488 echocheck "setenv()"
3489 cat > $TMPC << EOF
3490 #include <stdlib.h>
3491 int main (void){ setenv("","",0); return 0; }
3493 _setenv=no
3494 cc_check && _setenv=yes
3495 if test "$_setenv" = yes ; then
3496 _def_setenv='#define HAVE_SETENV 1'
3497 else
3498 _def_setenv='#undef HAVE_SETENV'
3500 echores "$_setenv"
3503 if sunos; then
3504 echocheck "sysi86()"
3505 cat > $TMPC << EOF
3506 #include <sys/sysi86.h>
3507 int main (void) { sysi86(0); return 0; }
3509 _sysi86=no
3510 cc_check && _sysi86=yes
3511 if test "$_sysi86" = yes ; then
3512 _def_sysi86='#define HAVE_SYSI86 1'
3513 else
3514 _def_sysi86='#undef HAVE_SYSI86'
3516 echores "$_sysi86"
3517 fi #if sunos
3520 echocheck "sys/sysinfo.h"
3521 cat > $TMPC << EOF
3522 #include <sys/sysinfo.h>
3523 int main(void) {
3524 struct sysinfo s_info;
3525 sysinfo(&s_info);
3526 return 0;
3529 _sys_sysinfo=no
3530 cc_check && _sys_sysinfo=yes
3531 if test "$_sys_sysinfo" = yes ; then
3532 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3533 else
3534 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3536 echores "$_sys_sysinfo"
3539 if darwin; then
3541 echocheck "Mac OS X APIs"
3542 if test "$_macosx" = auto ; then
3543 productName=`/usr/bin/sw_vers -productName`
3544 if test "$productName" = "Mac OS X" ; then
3545 _macosx=yes
3546 else
3547 _macosx=no
3548 _def_macosx='#undef MACOSX'
3549 _noaomodules="macosx $_noaomodules"
3550 _novomodules="quartz $_novomodules"
3553 if test "$_macosx" = yes ; then
3554 cat > $TMPC <<EOF
3555 #include <Carbon/Carbon.h>
3556 #include <QuickTime/QuickTime.h>
3557 #include <CoreAudio/CoreAudio.h>
3558 int main(void) {
3559 EnterMovies();
3560 ExitMovies();
3561 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3564 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3565 _macosx_frameworks="-framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3566 _def_macosx='#define MACOSX 1'
3567 _aosrc="$_aosrc ao_macosx.c"
3568 _aomodules="macosx $_aomodules"
3569 _vosrc="$_vosrc vo_quartz.c"
3570 _vomodules="quartz $_vomodules"
3571 else
3572 _macosx=no
3573 _def_macosx='#undef MACOSX'
3574 _noaomodules="macosx $_noaomodules"
3575 _novomodules="quartz $_novomodules"
3577 cat > $TMPC <<EOF
3578 #include <Carbon/Carbon.h>
3579 #include <QuartzCore/CoreVideo.h>
3580 int main(void) {}
3582 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3583 _vosrc="$_vosrc vo_macosx.m"
3584 _vomodules="macosx $_vomodules"
3585 _macosx_frameworks="$_macosx_frameworks -framework Cocoa -framework QuartzCore -framework OpenGL"
3586 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3587 _macosx_corevideo=yes
3588 else
3589 _novomodules="macosx $_novomodules"
3590 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3591 _macosx_corevideo=no
3594 echores "$_macosx"
3596 echocheck "Mac OS X Finder Support"
3597 if test "$_macosx_finder_support" = auto ; then
3598 _macosx_finder_support=$_macosx
3600 if test "$_macosx_finder_support" = yes; then
3601 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3602 _macosx_finder_support=yes
3603 else
3604 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3605 _macosx_finder_support=no
3607 echores "$_macosx_finder_support"
3609 echocheck "Mac OS X Bundle file locations"
3610 if test "$_macosx_bundle" = auto ; then
3611 _macosx_bundle=$_macosx_finder_support
3613 if test "$_macosx_bundle" = yes; then
3614 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3615 else
3616 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3617 _macosx_bundle=no
3619 echores "$_macosx_bundle"
3621 fi #if darwin
3624 echocheck "pkg-config"
3625 _pkg_config=pkg-config
3626 if `$_pkg_config --version > /dev/null 2>&1`; then
3627 echores "yes"
3628 else
3629 _pkg_config=false
3630 echores "no"
3634 echocheck "Samba support (libsmbclient)"
3635 if test "$_smbsupport" = yes; then
3636 _ld_smb="-lsmbclient"
3638 if test "$_smbsupport" = auto; then
3639 _smbsupport=no
3640 cat > $TMPC << EOF
3641 #include <libsmbclient.h>
3642 int main(void) { smbc_opendir("smb://"); return 0; }
3644 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3645 cc_check $_ld_tmp && _ld_smb="$_ld_tmp" && _smbsupport=yes && break
3646 done
3649 if test "$_smbsupport" = yes; then
3650 _def_smbsupport="#define LIBSMBCLIENT"
3651 _inputmodules="smb $_inputmodules"
3652 else
3653 _def_smbsupport="#undef LIBSMBCLIENT"
3654 _noinputmodules="smb $_noinputmodules"
3656 echores "$_smbsupport"
3659 #########
3660 # VIDEO #
3661 #########
3664 echocheck "3dfx"
3665 if test "$_3dfx" = yes ; then
3666 _def_3dfx='#define HAVE_3DFX 1'
3667 _vosrc="$_vosrc vo_3dfx.c"
3668 _vomodules="3dfx $_vomodules"
3669 else
3670 _def_3dfx='#undef HAVE_3DFX'
3671 _novomodules="3dfx $_novomodules"
3673 echores "$_3dfx"
3676 echocheck "tdfxfb"
3677 if test "$_tdfxfb" = yes ; then
3678 _def_tdfxfb='#define HAVE_TDFXFB 1'
3679 _vosrc="$_vosrc vo_tdfxfb.c"
3680 _vomodules="tdfxfb $_vomodules"
3681 else
3682 _def_tdfxfb='#undef HAVE_TDFXFB'
3683 _novomodules="tdfxfb $_novomodules"
3685 echores "$_tdfxfb"
3687 echocheck "s3fb"
3688 if test "$_s3fb" = yes ; then
3689 _def_s3fb='#define HAVE_S3FB 1'
3690 _vosrc="$_vosrc vo_s3fb.c"
3691 _vomodules="s3fb $_vomodules"
3692 else
3693 _def_s3fb='#undef HAVE_S3FB'
3694 _novomodules="s3fb $_novomodules"
3696 echores "$_s3fb"
3698 echocheck "tdfxvid"
3699 if test "$_tdfxvid" = yes ; then
3700 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3701 _vosrc="$_vosrc vo_tdfx_vid.c"
3702 _vomodules="tdfx_vid $_vomodules"
3703 else
3704 _def_tdfxvid='#undef HAVE_TDFX_VID'
3705 _novomodules="tdfx_vid $_novomodules"
3707 echores "$_tdfxvid"
3709 echocheck "tga"
3710 if test "$_tga" = yes ; then
3711 _def_tga='#define HAVE_TGA 1'
3712 _vosrc="$_vosrc vo_tga.c"
3713 _vomodules="tga $_vomodules"
3714 else
3715 _def_tga='#undef HAVE_TGA'
3716 _novomodules="tga $_novomodules"
3718 echores "$_tga"
3721 echocheck "DirectFB"
3722 if test "$_directfb" = auto ; then
3723 _directfb=no
3724 cat > $TMPC <<EOF
3725 #include <directfb.h>
3726 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3728 for _inc_tmp in "" -I/usr/local/include/directfb \
3729 -I/usr/include/directfb -I/usr/local/include -I/usr/include; do
3730 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
3731 _inc_extra="$_inc_extra $_inc_tmp" && break
3732 done
3735 dfb_version() {
3736 expr $1 \* 65536 + $2 \* 256 + $3
3739 if test "$_directfb" = yes; then
3740 cat > $TMPC << EOF
3741 #include <directfb_version.h>
3743 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
3746 if $_cc -E $TMPC $_inc_extra > "$TMPO"; then
3747 _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPO" | tr -d '()'`
3748 _dfb_major=`echo $_directfb_version | cut -d . -f 1`
3749 _dfb_minor=`echo $_directfb_version | cut -d . -f 2`
3750 _dfb_micro=`echo $_directfb_version | cut -d . -f 3`
3751 _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro`
3752 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3753 _def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
3754 _res_comment="$_directfb_version"
3755 else
3756 _def_directfb_version='#undef DIRECTFBVERSION'
3757 _directfb=no
3758 _res_comment="version >=0.9.13 required"
3760 else
3761 _directfb=no
3762 _res_comment="failed to get version"
3765 echores "$_directfb"
3767 if test "$_directfb" = yes ; then
3768 _def_directfb='#define HAVE_DIRECTFB 1'
3769 if test "$_dfb_version" -ge `dfb_version 0 9 13`; then
3770 _vosrc="$_vosrc vo_directfb2.c"
3771 _vomodules="directfb $_vomodules"
3772 _ld_directfb='-ldirectfb'
3773 else
3774 _novomodules="directfb $_novomodules"
3777 if test "$_dfb_version" -ge `dfb_version 0 9 15`; then
3778 _vosrc="$_vosrc vo_dfbmga.c"
3779 _vomodules="dfbmga $_vomodules"
3780 _def_dfbmga='#define HAVE_DFBMGA 1'
3781 else
3782 _novomodules="dfbmga $_novomodules"
3783 _def_dfbmga='#undef HAVE_DFBMGA'
3785 else
3786 _def_directfb='#undef HAVE_DIRECTFB'
3787 _novomodules="dfbmga directfb $_novomodules"
3791 echocheck "X11 headers presence"
3792 for I in `echo $_inc_extra | sed s/-I//g` /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3793 if test -f "$I/X11/Xlib.h" ; then
3794 _inc_x11="-I$I"
3795 _x11_headers="yes"
3796 _res_comment="using $I"
3797 break
3799 done
3800 #FIXME: This is ugly as it can duplicate a -I parameter..
3801 _inc_extra="$_inc_extra $_inc_x11"
3802 if test -z "$_inc_x11" ; then
3803 _x11=no
3804 _x11_headers="no"
3805 _res_comment="check if the dev(el) packages are installed"
3807 echores "$_x11_headers"
3810 echocheck "X11"
3811 if test "$_x11" != no ; then
3812 cat > $TMPC <<EOF
3813 #include <X11/Xlib.h>
3814 #include <X11/Xutil.h>
3815 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3817 for I in $_ld_x11 "" -L/usr/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
3818 -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 -L/usr/lib ; do
3819 _ld_x11="$I -lXext -lX11 $_ld_sock $_ld_pthread"
3820 if netbsd; then
3821 _ld_x11="$_ld_x11 -Wl,-R`echo $I | sed s/^-L//`"
3823 cc_check $_ld_x11 && _x11=yes && break
3824 done
3826 if test "$_x11" = yes ; then
3827 _def_x11='#define HAVE_X11 1'
3828 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3829 _vomodules="x11 xover $_vomodules"
3830 else
3831 _x11=no
3832 _def_x11='#undef HAVE_X11'
3833 _ld_x11=''
3834 _novomodules="x11 $_novomodules"
3835 _res_comment="check if the dev(el) packages are installed"
3836 # disable stuff that depends on X
3837 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _dga=no
3839 echores "$_x11"
3842 echocheck "DPMS"
3843 _xdpms3=no
3844 _xdpms4=no
3845 if test "$_x11" = yes ; then
3846 cat > $TMPC <<EOF
3847 #include <X11/Xmd.h>
3848 #include <X11/Xlib.h>
3849 #include <X11/Xutil.h>
3850 #include <X11/Xatom.h>
3851 #include <X11/extensions/dpms.h>
3852 int main(void) {
3853 (void) DPMSQueryExtension(0, 0, 0);
3856 cc_check -lXdpms $_ld_x11 && _xdpms3=yes
3857 cat > $TMPC <<EOF
3858 #include <X11/Xlib.h>
3859 #include <X11/extensions/dpms.h>
3860 int main(void) {
3861 (void) DPMSQueryExtension(0, 0, 0);
3864 cc_check $_ld_x11 && _xdpms4=yes
3866 if test "$_xdpms4" = yes ; then
3867 _def_xdpms='#define HAVE_XDPMS 1'
3868 _res_comment="using Xdpms 4"
3869 echores "yes"
3870 elif test "$_xdpms3" = yes ; then
3871 _def_xdpms='#define HAVE_XDPMS 1'
3872 _ld_x11="-lXdpms $_ld_x11"
3873 _res_comment="using Xdpms 3"
3874 echores "yes"
3875 else
3876 _def_xdpms='#undef HAVE_XDPMS'
3877 echores "no"
3881 echocheck "Xv"
3882 if test "$_xv" = auto ; then
3883 cat > $TMPC <<EOF
3884 #include <X11/Xlib.h>
3885 #include <X11/extensions/Xvlib.h>
3886 int main(void) {
3887 (void) XvGetPortAttribute(0, 0, 0, 0);
3888 (void) XvQueryPortAttributes(0, 0, 0);
3889 return 0; }
3891 _xv=no
3892 cc_check -lXv $_ld_x11 && _xv=yes
3895 if test "$_xv" = yes ; then
3896 _def_xv='#define HAVE_XV 1'
3897 _ld_xv='-lXv'
3898 _vosrc="$_vosrc vo_xv.c"
3899 _vomodules="xv $_vomodules"
3900 else
3901 _def_xv='#undef HAVE_XV'
3902 _novomodules="xv $_novomodules"
3904 echores "$_xv"
3907 echocheck "XvMC"
3908 if test "$_xv" = yes && test "$_xvmc" != no ; then
3909 _xvmc=no
3910 cat > $TMPC <<EOF
3911 #include <X11/Xlib.h>
3912 #include <X11/extensions/Xvlib.h>
3913 #include <X11/extensions/XvMClib.h>
3914 int main(void) {
3915 (void) XvMCQueryExtension(0,0,0);
3916 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3917 return 0; }
3919 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3920 cc_check -lXvMC -l$_ld_tmp $_ld_xv $_ld_x11 && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3921 done
3923 if test "$_xvmc" = yes ; then
3924 _def_xvmc='#define HAVE_XVMC 1'
3925 _ld_xvmc="-lXvMC -l$_xvmclib"
3926 _vosrc="$_vosrc vo_xvmc.c"
3927 _vomodules="xvmc $_vomodules"
3928 _res_comment="using $_xvmclib"
3929 else
3930 _def_xvmc='#undef HAVE_XVMC'
3931 _novomodules="xvmc $_novomodules"
3933 echores "$_xvmc"
3936 echocheck "Xinerama"
3937 if test "$_xinerama" = auto ; then
3938 cat > $TMPC <<EOF
3939 #include <X11/Xlib.h>
3940 #include <X11/extensions/Xinerama.h>
3941 int main(void) { (void) XineramaIsActive(0); return 0; }
3943 _xinerama=no
3944 cc_check -lXinerama $_ld_x11 && _xinerama=yes
3947 if test "$_xinerama" = yes ; then
3948 _def_xinerama='#define HAVE_XINERAMA 1'
3949 _ld_xinerama='-lXinerama'
3950 else
3951 _def_xinerama='#undef HAVE_XINERAMA'
3953 echores "$_xinerama"
3956 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3957 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3958 # named 'X extensions' or something similar.
3959 # This check may be useful for future mplayer versions (to change resolution)
3960 # If you run into problems, remove '-lXxf86vm'.
3961 echocheck "Xxf86vm"
3962 if test "$_vm" = auto ; then
3963 cat > $TMPC <<EOF
3964 #include <X11/Xlib.h>
3965 #include <X11/extensions/xf86vmode.h>
3966 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3968 _vm=no
3969 cc_check -lXxf86vm $_ld_x11 && _vm=yes
3971 if test "$_vm" = yes ; then
3972 _def_vm='#define HAVE_XF86VM 1'
3973 _ld_vm='-lXxf86vm'
3974 else
3975 _def_vm='#undef HAVE_XF86VM'
3977 echores "$_vm"
3979 # Check for the presence of special keycodes, like audio control buttons
3980 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3981 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3982 # have these new keycodes.
3983 echocheck "XF86keysym"
3984 if test "$_xf86keysym" = auto; then
3985 _xf86keysym=no
3986 cat > $TMPC <<EOF
3987 #include <X11/Xlib.h>
3988 #include <X11/XF86keysym.h>
3989 int main(void) { return XF86XK_AudioPause; }
3991 cc_check $_ld_x11 && _xf86keysym=yes
3993 if test "$_xf86keysym" = yes ; then
3994 _def_xf86keysym='#define HAVE_XF86XK 1'
3995 else
3996 _def_xf86keysym='#undef HAVE_XF86XK'
3998 echores "$_xf86keysym"
4000 echocheck "DGA"
4001 # Version 2 is preferred to version 1 if available
4002 if test "$_dga" = auto ; then
4003 cat > $TMPC << EOF
4004 #include <X11/Xlib.h>
4005 #include <X11/extensions/xf86dga.h>
4006 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4008 _dga=no
4009 cc_check -lXxf86dga -lXxf86vm $_ld_x11 && _dga=1
4011 cat > $TMPC << EOF
4012 #include <X11/Xlib.h>
4013 #include <X11/extensions/xf86dga.h>
4014 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4016 cc_check -lXxf86dga $_ld_x11 && _dga=2
4019 _def_dga='#undef HAVE_DGA'
4020 _def_dga2='#undef HAVE_DGA2'
4021 if test "$_dga" = 1 ; then
4022 _def_dga='#define HAVE_DGA 1'
4023 _ld_dga='-lXxf86dga'
4024 _vosrc="$_vosrc vo_dga.c"
4025 _vomodules="dga $_vomodules"
4026 _res_comment="using DGA 1.0"
4027 elif test "$_dga" = 2 ; then
4028 _def_dga='#define HAVE_DGA 1'
4029 _def_dga2='#define HAVE_DGA2 1'
4030 _ld_dga='-lXxf86dga'
4031 _vosrc="$_vosrc vo_dga.c"
4032 _vomodules="dga $_vomodules"
4033 _res_comment="using DGA 2.0"
4034 elif test "$_dga" = no ; then
4035 _novomodules="dga $_novomodules"
4036 else
4037 die "DGA version must be 1 or 2"
4039 echores "$_dga"
4042 echocheck "OpenGL"
4043 #Note: this test is run even with --enable-gl since we autodetect $_ld_gl
4044 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4045 cat > $TMPC << EOF
4046 #include <GL/gl.h>
4047 int main(void) { return 0; }
4049 _gl=no
4050 if cc_check $_ld_x11 -lGL $_ld_lm ; then
4051 _gl=yes
4052 _ld_gl="-lGL $_ld_dl"
4053 elif cc_check $_ld_x11 -lGL $_ld_lm $_ld_pthread ; then
4054 _gl=yes
4055 _ld_gl="-lGL $_ld_pthread $_ld_dl"
4056 elif cc_check -lopengl32 ; then
4057 _gl=yes
4058 _gl_win32=yes
4059 _ld_gl="-lopengl32 -lgdi32"
4061 else
4062 _gl=no
4064 if test "$_gl" = yes ; then
4065 _def_gl='#define HAVE_GL 1'
4066 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4067 if test "$_gl_win32" = yes ; then
4068 _def_gl_win32='#define GL_WIN32 1'
4069 _vosrc="$_vosrc w32_common.c"
4070 _res_comment="win32 version"
4072 _vomodules="opengl $_vomodules"
4073 else
4074 _def_gl='#undef HAVE_GL'
4075 _def_gl_win32='#undef GL_WIN32'
4076 _novomodules="opengl $_novomodules"
4078 echores "$_gl"
4081 echocheck "/dev/mga_vid"
4082 if test "$_mga" = auto ; then
4083 _mga=no
4084 test -c /dev/mga_vid && _mga=yes
4086 if test "$_mga" = yes ; then
4087 _def_mga='#define HAVE_MGA 1'
4088 _vosrc="$_vosrc vo_mga.c"
4089 _vomodules="mga $_vomodules"
4090 else
4091 _def_mga='#undef HAVE_MGA'
4092 _novomodules="mga $_novomodules"
4094 echores "$_mga"
4097 # echocheck "syncfb"
4098 # _syncfb=no
4099 # test "$_mga" = yes && _syncfb=yes
4100 # if test "$_syncfb" = yes ; then
4101 # _def_syncfb='#define HAVE_SYNCFB 1'
4102 # _vosrc="$_vosrc vo_syncfb.c"
4103 # else
4104 # _def_syncfb='#undef HAVE_SYNCFB'
4105 # fi
4106 # echores "$_syncfb"
4109 echocheck "xmga"
4110 if test "$_xmga" = auto ; then
4111 _xmga=no
4112 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4114 if test "$_xmga" = yes ; then
4115 _def_xmga='#define HAVE_XMGA 1'
4116 _vosrc="$_vosrc vo_xmga.c"
4117 _vomodules="xmga $_vomodules"
4118 else
4119 _def_xmga='#undef HAVE_XMGA'
4120 _novomodules="xmga $_novomodules"
4122 echores "$_xmga"
4125 echocheck "GGI"
4126 if test "$_ggi" = auto ; then
4127 cat > $TMPC << EOF
4128 #include <ggi/ggi.h>
4129 int main(void) { return 0; }
4131 _ggi=no
4132 cc_check -lggi && _ggi=yes
4134 if test "$_ggi" = yes ; then
4135 _def_ggi='#define HAVE_GGI 1'
4136 _ld_ggi='-lggi'
4137 _vosrc="$_vosrc vo_ggi.c"
4138 _vomodules="ggi $_vomodules"
4139 else
4140 _def_ggi='#undef HAVE_GGI'
4141 _novomodules="ggi $_novomodules"
4143 echores "$_ggi"
4145 echocheck "GGI extension: libggiwmh"
4146 if test "$_ggiwmh" = auto ; then
4147 _ggiwmh=no
4148 cat > $TMPC << EOF
4149 #include <ggi/ggi.h>
4150 #include <ggi/wmh.h>
4151 int main(void) { return 0; }
4153 cc_check -lggi -lggiwmh && _ggiwmh=yes
4155 # needed to get right output on obscure combination
4156 # like --disable-ggi --enable-ggiwmh
4157 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4158 _def_ggiwmh='#define HAVE_GGIWMH 1'
4159 _ld_ggi="$_ld_ggi -lggiwmh"
4160 else
4161 _ggiwmh=no
4162 _def_ggiwmh='#undef HAVE_GGIWMH'
4164 echores "$_ggiwmh"
4167 echocheck "AA"
4168 if test "$_aa" = auto ; then
4169 cat > $TMPC << EOF
4170 #include <aalib.h>
4171 extern struct aa_hardware_params aa_defparams;
4172 extern struct aa_renderparams aa_defrenderparams;
4173 int main(void) {
4174 aa_context *c;
4175 aa_renderparams *p;
4176 (void) aa_init(0, 0, 0);
4177 c = aa_autoinit(&aa_defparams);
4178 p = aa_getrenderparams();
4179 aa_autoinitkbd(c,0);
4180 return 0; }
4182 _aa=no
4183 for _ld_tmp in "-laa" "$_ld_x11 -laa" ; do
4184 cc_check $_ld_tmp && _ld_aa=$_ld_tmp && _aa=yes && break
4185 done
4187 if test "$_aa" = yes ; then
4188 _def_aa='#define HAVE_AA 1'
4189 if cygwin ; then
4190 _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6`
4192 _vosrc="$_vosrc vo_aa.c"
4193 _vomodules="aa $_vomodules"
4194 else
4195 _def_aa='#undef HAVE_AA'
4196 _novomodules="aa $_novomodules"
4198 echores "$_aa"
4201 echocheck "CACA"
4202 if test "$_caca" = auto ; then
4203 _caca=no
4204 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4205 cat > $TMPC << EOF
4206 #include <caca.h>
4207 #ifdef CACA_API_VERSION_1
4208 #include <caca0.h>
4209 #endif
4210 int main(void) { (void) caca_init(); return 0; }
4212 cc_check `caca-config --libs` && _caca=yes
4215 if test "$_caca" = yes ; then
4216 _def_caca='#define HAVE_CACA 1'
4217 _inc_extra="$_inc_extra `caca-config --cflags`"
4218 _ld_caca=`caca-config --libs`
4219 _vosrc="$_vosrc vo_caca.c"
4220 _vomodules="caca $_vomodules"
4221 else
4222 _def_caca='#undef HAVE_CACA'
4223 _novomodules="caca $_novomodules"
4225 echores "$_caca"
4228 echocheck "SVGAlib"
4229 if test "$_svga" = auto ; then
4230 cat > $TMPC << EOF
4231 #include <vga.h>
4232 int main(void) { return 0; }
4234 _svga=no
4235 cc_check -lvga $_ld_lm && _svga=yes
4237 if test "$_svga" = yes ; then
4238 _def_svga='#define HAVE_SVGALIB 1'
4239 _ld_svga="-lvga"
4240 _vosrc="$_vosrc vo_svga.c"
4241 _vomodules="svga $_vomodules"
4242 else
4243 _def_svga='#undef HAVE_SVGALIB'
4244 _novomodules="svga $_novomodules"
4246 echores "$_svga"
4249 echocheck "FBDev"
4250 if test "$_fbdev" = auto ; then
4251 _fbdev=no
4252 linux && test -c /dev/fb0 && _fbdev=yes
4254 if test "$_fbdev" = yes ; then
4255 _def_fbdev='#define HAVE_FBDEV 1'
4256 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4257 _vomodules="fbdev $_vomodules"
4258 else
4259 _def_fbdev='#undef HAVE_FBDEV'
4260 _novomodules="fbdev $_novomodules"
4262 echores "$_fbdev"
4266 echocheck "DVB"
4267 if test "$_dvb" = auto ; then
4268 _dvb=no
4269 cat >$TMPC << EOF
4270 #include <sys/poll.h>
4271 #include <sys/ioctl.h>
4272 #include <stdio.h>
4273 #include <time.h>
4274 #include <unistd.h>
4276 #include <ost/dmx.h>
4277 #include <ost/frontend.h>
4278 #include <ost/sec.h>
4279 #include <ost/video.h>
4280 #include <ost/audio.h>
4281 int main(void) {return 0;}
4283 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4284 cc_check $_inc_tmp && _dvb=yes && \
4285 _inc_extra="$_inc_extra $_inc_tmp" && break
4286 done
4288 echores "$_dvb"
4289 if test "$_dvb" = yes ; then
4290 _def_dvb='#define HAVE_DVB 1'
4291 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4292 _aomodules="mpegpes(dvb) $_aomodules"
4293 _vomodules="mpegpes(dvb) $_vomodules"
4296 echocheck "DVB HEAD"
4297 if test "$_dvbhead" = auto ; then
4298 _dvbhead=no
4300 cat >$TMPC << EOF
4301 #include <sys/poll.h>
4302 #include <sys/ioctl.h>
4303 #include <stdio.h>
4304 #include <time.h>
4305 #include <unistd.h>
4307 #include <linux/dvb/dmx.h>
4308 #include <linux/dvb/frontend.h>
4309 #include <linux/dvb/video.h>
4310 #include <linux/dvb/audio.h>
4311 int main(void) {return 0;}
4313 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4314 cc_check $_inc_tmp && _dvbhead=yes && \
4315 _inc_extra="$_inc_extra $_inc_tmp" && break
4316 done
4318 echores "$_dvbhead"
4319 if test "$_dvbhead" = yes ; then
4320 _def_dvb='#define HAVE_DVB_HEAD 1'
4321 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4322 _aomodules="mpegpes(dvb) $_aomodules"
4323 _vomodules="mpegpes(dvb) $_vomodules"
4326 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4327 _def_dvb='#undef HAVE_DVB'
4328 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4329 _aomodules="mpegpes(file) $_aomodules"
4330 _vomodules="mpegpes(file) $_vomodules"
4333 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4334 _dvbin=yes
4335 _inputmodules="dvb $_inputmodules"
4336 else
4337 _dvbin=no
4338 _noinputmodules="dvb $_noinputmodules"
4341 echocheck "PNG support"
4342 if test "$_png" = auto ; then
4343 _png=no
4344 if irix ; then
4345 # Don't check for -lpng on irix since it has its own libpng
4346 # incompatible with the GNU libpng
4347 _res_comment="disabled on irix (not GNU libpng)"
4348 else
4349 cat > $TMPC << EOF
4350 #include <png.h>
4351 #include <string.h>
4352 int main(void) {
4353 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4354 printf("libpng: %s\n", png_libpng_ver);
4355 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4358 if cc_check -lpng -lz $_ld_lm ; then
4359 if tmp_run ; then
4360 _png=yes
4361 else
4362 _res_comment="mismatch of library and header versions"
4367 echores "$_png"
4368 if test "$_png" = yes ; then
4369 _def_png='#define HAVE_PNG 1'
4370 _ld_png='-lpng -lz'
4371 _vosrc="$_vosrc vo_png.c"
4372 _vomodules="png $_vomodules"
4373 else
4374 _def_png='#undef HAVE_PNG'
4375 _novomodules="png $_novomodules"
4378 echocheck "JPEG support"
4379 if test "$_jpeg" = auto ; then
4380 _jpeg=no
4381 cat > $TMPC << EOF
4382 #include <stdio.h>
4383 #include <stdlib.h>
4384 #include <setjmp.h>
4385 #include <string.h>
4386 #include <jpeglib.h>
4387 int main(void) {
4388 return 0;
4391 if cc_check -ljpeg $_ld_lm ; then
4392 if tmp_run ; then
4393 _jpeg=yes
4397 echores "$_jpeg"
4399 if test "$_jpeg" = yes ; then
4400 _def_jpeg='#define HAVE_JPEG 1'
4401 _vosrc="$_vosrc vo_jpeg.c"
4402 _vomodules="jpeg $_vomodules"
4403 _ld_jpeg="-ljpeg"
4404 else
4405 _def_jpeg='#undef HAVE_JPEG'
4406 _novomodules="jpeg $_novomodules"
4411 echocheck "PNM support"
4412 if test "$_pnm" = yes; then
4413 _def_pnm="#define HAVE_PNM"
4414 _vosrc="$_vosrc vo_pnm.c"
4415 _vomodules="pnm $_vomodules"
4416 else
4417 _def_pnm="#undef HAVE_PNM"
4418 _novomodules="pnm $_novomodules"
4420 echores "$_pnm"
4424 echocheck "GIF support"
4425 # This is to appease people who want to force gif support.
4426 # If it is forced to yes, then we still do checks to determine
4427 # which gif library to use.
4428 if test "$_gif" = yes ; then
4429 _force_gif=yes
4430 _gif=auto
4433 if test "$_gif" = auto ; then
4434 _gif=no
4435 cat > $TMPC << EOF
4436 #include <gif_lib.h>
4437 int main(void) {
4438 return 0;
4441 for _ld_tmp in "-lungif" "-lungif $_ld_x11" "-lgif" "-lgif $_ld_x11" ; do
4442 cc_check $_ld_tmp && tmp_run && _ld_gif="$_ld_tmp" && _gif=yes && break
4443 done
4446 # If no library was found, and the user wants support forced,
4447 # then we force it on with libgif, as this is the safest
4448 # assumption IMHO. (libungif & libregif both create symbolic
4449 # links to libgif. We also assume that no x11 support is needed,
4450 # because if you are forcing this, then you _should_ know what
4451 # you are doing. [ Besides, package maintainers should never
4452 # have compiled x11 deps into libungif in the first place. ] )
4453 # </rant>
4454 # --Joey
4455 if test "$_force_gif" = yes && test "$_gif" = no ; then
4456 _gif=yes
4457 _ld_gif="-lgif"
4460 if test "$_gif" = yes ; then
4461 _def_gif='#define HAVE_GIF 1'
4462 _vosrc="$_vosrc vo_gif89a.c"
4463 _codecmodules="gif $_codecmodules"
4464 _vomodules="gif89a $_vomodules"
4465 _res_comment="old version, some encoding functions disabled"
4466 _def_gif_4='#undef HAVE_GIF_4'
4468 cat > $TMPC << EOF
4469 #include <signal.h>
4470 #include <gif_lib.h>
4471 void catch() { exit(1); }
4472 int main(void) {
4473 signal(SIGSEGV, catch); // catch segfault
4474 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4475 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4476 return 0;
4479 if cc_check "$_ld_gif" && tmp_run ; then
4480 _def_gif_4='#define HAVE_GIF_4 1'
4481 _res_comment=""
4483 else
4484 _def_gif='#undef HAVE_GIF'
4485 _def_gif_4='#undef HAVE_GIF_4'
4486 _novomodules="gif89a $_novomodules"
4487 _nocodecmodules="gif $_nocodecmodules"
4489 echores "$_gif"
4492 case "$_gif" in yes*)
4493 echocheck "broken giflib workaround"
4494 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4496 cat > $TMPC << EOF
4497 #include <gif_lib.h>
4498 int main(void) {
4499 GifFileType gif;
4500 printf("UserData is at address %p\n", gif.UserData);
4501 return 0;
4504 if cc_check "$_ld_gif" && tmp_run ; then
4505 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4506 echores "disabled"
4507 else
4508 echores "enabled"
4511 esac
4514 echocheck "VESA support"
4515 if test "$_vesa" = auto ; then
4516 cat > $TMPC << EOF
4517 #include <vbe.h>
4518 int main(void) { vbeVersion(); return 0; }
4520 _vesa=no
4521 cc_check -lvbe -llrmi && _vesa=yes
4523 if test "$_vesa" = yes ; then
4524 _def_vesa='#define HAVE_VESA 1'
4525 _ld_vesa="-lvbe -llrmi"
4526 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4527 _vomodules="vesa $_vomodules"
4528 else
4529 _def_vesa='#undef HAVE_VESA'
4530 _novomodules="vesa $_novomodules"
4532 echores "$_vesa"
4534 #################
4535 # VIDEO + AUDIO #
4536 #################
4539 echocheck "SDL"
4540 if test -z "$_sdlconfig" ; then
4541 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4542 _sdlconfig="sdl-config"
4543 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4544 _sdlconfig="sdl11-config"
4545 else
4546 _sdlconfig=false
4549 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4550 cat > $TMPC << EOF
4551 #include <SDL.h>
4552 int main(int argc, char *argv[]) { return 0; }
4554 _sdl=no
4555 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4556 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4557 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4558 if test "$_sdlversion" -gt 116 ; then
4559 if test "$_sdlversion" -lt 121 ; then
4560 _def_sdlbuggy='#define BUGGY_SDL'
4561 else
4562 _def_sdlbuggy='#undef BUGGY_SDL'
4564 _sdl=yes
4569 if test "$_sdl" = yes ; then
4570 _def_sdl='#define HAVE_SDL 1'
4571 if cygwin ; then
4572 _ld_sdl=`$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`
4573 _inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`"
4574 elif mingw32 ; then
4575 _ld_sdl=`$_sdlconfig --libs | sed s/-mwindows//`
4576 _inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
4577 else
4578 _ld_sdl=`$_sdlconfig --libs`
4579 _inc_extra="$_inc_extra `$_sdlconfig --cflags`"
4581 _vosrc="$_vosrc vo_sdl.c"
4582 _vomodules="sdl $_vomodules"
4583 _aosrc="$_aosrc ao_sdl.c"
4584 _aomodules="sdl $_aomodules"
4585 _res_comment="using $_sdlconfig"
4586 else
4587 _def_sdl='#undef HAVE_SDL'
4588 _novomodules="sdl $_novomodules"
4589 _noaomodules="sdl $_noaomodules"
4591 echores "$_sdl"
4594 if win32; then
4596 echocheck "Windows waveout"
4597 if test "$_win32waveout" = auto ; then
4598 cat > $TMPC << EOF
4599 #include <windows.h>
4600 #include <mmsystem.h>
4601 int main(void) { return 0; }
4603 _win32waveout=no
4604 cc_check -lwinmm && _win32waveout=yes
4606 if test "$_win32waveout" = yes ; then
4607 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4608 _ld_win32libs="-lwinmm $_ld_win32libs"
4609 _aosrc="$_aosrc ao_win32.c"
4610 _aomodules="win32 $_aomodules"
4611 else
4612 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4613 _noaomodules="win32 $_noaomodules"
4615 echores "$_win32waveout"
4617 echocheck "Directx"
4618 if test "$_directx" = auto ; then
4619 cat > $TMPC << EOF
4620 #include <windows.h>
4621 #include <ddraw.h>
4622 #include <dsound.h>
4623 int main(void) { return 0; }
4625 _directx=no
4626 cc_check -lgdi32 && _directx=yes
4628 if test "$_directx" = yes ; then
4629 _def_directx='#define HAVE_DIRECTX 1'
4630 _ld_win32libs="-lgdi32 $_ld_win32libs"
4631 _vosrc="$_vosrc vo_directx.c"
4632 _vomodules="directx $_vomodules"
4633 _aosrc="$_aosrc ao_dsound.c"
4634 _aomodules="dsound $_aomodules"
4635 else
4636 _def_directx='#undef HAVE_DIRECTX'
4637 _novomodules="directx $_novomodules"
4638 _noaomodules="dsound $_noaomodules"
4640 echores "$_directx"
4642 fi #if win32; then
4645 echocheck "NAS"
4646 if test "$_nas" = auto ; then
4647 cat > $TMPC << EOF
4648 #include <audio/audiolib.h>
4649 int main(void) { return 0; }
4651 _nas=no
4652 cc_check $_ld_lm -laudio -lXt $_ld_x11 && _nas=yes
4654 if test "$_nas" = yes ; then
4655 _def_nas='#define HAVE_NAS 1'
4656 _ld_nas="-laudio -lXt $_ld_x11"
4657 _aosrc="$_aosrc ao_nas.c"
4658 _aomodules="nas $_aomodules"
4659 else
4660 _noaomodules="nas $_noaomodules"
4661 _def_nas='#undef HAVE_NAS'
4663 echores "$_nas"
4665 echocheck "DXR2"
4666 if test "$_dxr2" = auto; then
4667 _dxr2=no
4668 cat > $TMPC << EOF
4669 #include <dxr2ioctl.h>
4670 int main(void) { return 0; }
4672 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
4673 cc_check $_inc_tmp && _dxr2=yes && \
4674 _inc_extra="$_inc_extra $_inc_tmp" && break
4675 done
4677 if test "$_dxr2" = yes; then
4678 _def_dxr2='#define HAVE_DXR2 1'
4679 _vosrc="$_vosrc vo_dxr2.c"
4680 _aosrc="$_aosrc ao_dxr2.c"
4681 _aomodules="dxr2 $_aomodules"
4682 _vomodules="dxr2 $_vomodules"
4683 else
4684 _def_dxr2='#undef HAVE_DXR2'
4685 _noaomodules="dxr2 $_noaomodules"
4686 _novomodules="dxr2 $_novomodules"
4688 echores "$_dxr2"
4690 echocheck "DXR3/H+"
4691 if test "$_dxr3" = auto ; then
4692 cat > $TMPC << EOF
4693 #include <linux/em8300.h>
4694 int main(void) { return 0; }
4696 _dxr3=no
4697 cc_check && _dxr3=yes
4699 if test "$_dxr3" = yes ; then
4700 _def_dxr3='#define HAVE_DXR3 1'
4701 _vosrc="$_vosrc vo_dxr3.c"
4702 _vomodules="dxr3 $_vomodules"
4703 else
4704 _def_dxr3='#undef HAVE_DXR3'
4705 _novomodules="dxr3 $_novomodules"
4707 echores "$_dxr3"
4710 echocheck "IVTV TV-Out"
4711 if test "$_ivtv" = auto ; then
4712 cat > $TMPC << EOF
4713 #include <stdlib.h>
4714 #include <inttypes.h>
4715 #include <linux/types.h>
4716 #include <linux/videodev2.h>
4717 #include <linux/ivtv.h>
4718 int main(void) { return 0; }
4720 _ivtv=no
4721 cc_check && _ivtv=yes
4723 if test "$_ivtv" = yes ; then
4724 _def_ivtv='#define HAVE_IVTV 1'
4725 _vosrc="$_vosrc vo_ivtv.c"
4726 _vomodules="ivtv $_vomodules"
4727 _aosrc="$_aosrc ao_ivtv.c"
4728 _aomodules="ivtv $_aomodules"
4729 else
4730 _def_ivtv='#undef HAVE_IVTV'
4731 _novomodules="ivtv $_novomodules"
4732 _noaomodules="ivtv $_noaomodules"
4734 echores "$_ivtv"
4738 #########
4739 # AUDIO #
4740 #########
4743 echocheck "OSS Audio"
4744 if test "$_ossaudio" = auto ; then
4745 cat > $TMPC << EOF
4746 #include <sys/ioctl.h>
4747 $_include_soundcard
4748 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4750 _ossaudio=no
4751 cc_check && _ossaudio=yes
4753 if test "$_ossaudio" = yes ; then
4754 _def_ossaudio='#define USE_OSS_AUDIO 1'
4755 _aosrc="$_aosrc ao_oss.c"
4756 _aomodules="oss $_aomodules"
4757 if test "$_linux_devfs" = yes; then
4758 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4759 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4760 else
4761 cat > $TMPC << EOF
4762 #include <sys/ioctl.h>
4763 $_include_soundcard
4764 #ifdef OPEN_SOUND_SYSTEM
4765 int main(void) { return 0; }
4766 #else
4767 #error Not the real thing
4768 #endif
4770 _real_ossaudio=no
4771 cc_check && _real_ossaudio=yes
4772 if test "$_real_ossaudio" = yes; then
4773 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4774 elif netbsd || openbsd ; then
4775 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4776 _ld_arch="$_ld_arch -lossaudio"
4777 else
4778 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4780 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4782 else
4783 _def_ossaudio='#undef USE_OSS_AUDIO'
4784 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4785 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4786 _noaomodules="oss $_noaomodules"
4788 echores "$_ossaudio"
4791 echocheck "aRts"
4792 if test "$_arts" = auto ; then
4793 _arts=no
4794 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4796 cat > $TMPC << EOF
4797 #include <artsc.h>
4798 int main(void) { return 0; }
4800 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
4805 if test "$_arts" = yes ; then
4806 _def_arts='#define USE_ARTS 1'
4807 _aosrc="$_aosrc ao_arts.c"
4808 _aomodules="arts $_aomodules"
4809 _ld_arts=`artsc-config --libs`
4810 _inc_extra="$_inc_extra `artsc-config --cflags`"
4811 else
4812 _noaomodules="arts $_noaomodules"
4814 echores "$_arts"
4817 echocheck "EsounD"
4818 if test "$_esd" = auto ; then
4819 _esd=no
4820 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4822 cat > $TMPC << EOF
4823 #include <esd.h>
4824 int main(void) { return 0; }
4826 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes
4830 echores "$_esd"
4832 if test "$_esd" = yes ; then
4833 _def_esd='#define USE_ESD 1'
4834 _aosrc="$_aosrc ao_esd.c"
4835 _aomodules="esd $_aomodules"
4836 _ld_esd=`esd-config --libs`
4837 _inc_extra="$_inc_extra `esd-config --cflags`"
4839 echocheck "esd_get_latency()"
4840 cat > $TMPC << EOF
4841 #include <esd.h>
4842 int main(void) { return esd_get_latency(0); }
4844 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4845 echores "$_esd_latency"
4846 else
4847 _def_esd='#undef USE_ESD'
4848 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4849 _noaomodules="esd $_noaomodules"
4852 echocheck "Polyp"
4853 if test "$_polyp" = auto ; then
4854 _polyp=no
4855 if $_pkg_config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
4857 cat > $TMPC << EOF
4858 #include <polyp/polyplib.h>
4859 #include <polyp/mainloop.h>
4860 #include <polyp/polyplib-error.h>
4861 int main(void) { return 0; }
4863 cc_check `$_pkg_config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
4867 echores "$_polyp"
4869 if test "$_polyp" = yes ; then
4870 _def_polyp='#define USE_POLYP 1'
4871 _aosrc="$_aosrc ao_polyp.c"
4872 _aomodules="polyp $_aomodules"
4873 _ld_polyp=`$_pkg_config --libs polyplib polyplib-error polyplib-mainloop`
4874 _inc_extra="$_inc_extra `$_pkg_config --cflags polyplib polyplib-error polyplib-mainloop`"
4875 else
4876 _def_polyp='#undef USE_POLYP'
4877 _noaomodules="polyp $_noaomodules"
4881 echocheck "JACK"
4882 if test "$_jack" = auto ; then
4883 _jack=yes
4885 cat > $TMPC << EOF
4886 #include <jack/jack.h>
4887 int main(void) { jack_client_new("test"); return 0; }
4889 if cc_check -ljack ; then
4890 _ld_jack="-ljack"
4891 elif cc_check `$_pkg_config --libs --cflags --silence-errors jack` ; then
4892 _ld_jack="`$_pkg_config --libs jack`"
4893 _inc_extra="$_inc_extra "`$_pkg_config --cflags jack`""
4894 else
4895 _jack=no
4899 if test "$_jack" = yes ; then
4900 _def_jack='#define USE_JACK 1'
4901 _aosrc="$_aosrc ao_jack.c"
4902 _aomodules="jack $_aomodules"
4903 else
4904 _noaomodules="jack $_noaomodules"
4906 echores "$_jack"
4908 echocheck "OpenAL"
4909 if test "$_openal" = auto ; then
4910 _openal=no
4911 cat > $TMPC << EOF
4912 #include <AL/al.h>
4913 int main(void) {
4914 alSourceQueueBuffers(0, 0, 0);
4915 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4916 return 0;
4919 if cc_check -lopenal ; then
4920 _ld_openal="-lopenal"
4921 _openal=yes
4924 if test "$_openal" = yes ; then
4925 _def_openal='#define USE_OPENAL 1'
4926 _aosrc="$_aosrc ao_openal.c"
4927 _aomodules="openal $_aomodules"
4928 else
4929 _noaomodules="openal $_noaomodules"
4931 echores "$_openal"
4933 echocheck "ALSA audio"
4934 if test "$_alsa" != no ; then
4935 _alsa=no
4936 cat > $TMPC << EOF
4937 #include <sys/asoundlib.h>
4938 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
4939 #error "alsa version != 0.5.x"
4940 #endif
4941 int main(void) { return 0; }
4943 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
4945 cat > $TMPC << EOF
4946 #include <sys/asoundlib.h>
4947 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4948 #error "alsa version != 0.9.x"
4949 #endif
4950 int main(void) { return 0; }
4952 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
4953 cat > $TMPC << EOF
4954 #include <alsa/asoundlib.h>
4955 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4956 #error "alsa version != 0.9.x"
4957 #endif
4958 int main(void) { return 0; }
4960 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
4962 cat > $TMPC << EOF
4963 #include <sys/asoundlib.h>
4964 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4965 #error "alsa version != 1.0.x"
4966 #endif
4967 int main(void) { return 0; }
4969 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
4970 cat > $TMPC << EOF
4971 #include <alsa/asoundlib.h>
4972 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4973 #error "alsa version != 1.0.x"
4974 #endif
4975 int main(void) { return 0; }
4977 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
4979 _def_alsa5='#undef HAVE_ALSA5'
4980 _def_alsa9='#undef HAVE_ALSA9'
4981 _def_alsa1x='#undef HAVE_ALSA1X'
4982 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
4983 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
4984 if test "$_alsaver" ; then
4985 _alsa=yes
4986 if test "$_alsaver" = '0.5.x' ; then
4987 _alsa5=yes
4988 _aosrc="$_aosrc ao_alsa5.c"
4989 _aomodules="alsa5 $_aomodules"
4990 _def_alsa5='#define HAVE_ALSA5 1'
4991 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4992 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
4993 elif test "$_alsaver" = '0.9.x-sys' ; then
4994 _alsa9=yes
4995 _aosrc="$_aosrc ao_alsa.c"
4996 _aomodules="alsa $_aomodules"
4997 _def_alsa9='#define HAVE_ALSA9 1'
4998 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4999 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5000 elif test "$_alsaver" = '0.9.x-alsa' ; then
5001 _alsa9=yes
5002 _aosrc="$_aosrc ao_alsa.c"
5003 _aomodules="alsa $_aomodules"
5004 _def_alsa9='#define HAVE_ALSA9 1'
5005 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5006 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5007 elif test "$_alsaver" = '1.0.x-sys' ; then
5008 _alsa1x=yes
5009 _aosrc="$_aosrc ao_alsa.c"
5010 _aomodules="alsa $_aomodules"
5011 _def_alsa1x="#define HAVE_ALSA1X 1"
5012 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5013 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5014 elif test "$_alsaver" = '1.0.x-alsa' ; then
5015 _alsa1x=yes
5016 _aosrc="$_aosrc ao_alsa.c"
5017 _aomodules="alsa $_aomodules"
5018 _def_alsa1x="#define HAVE_ALSA1X 1"
5019 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5020 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5021 else
5022 _alsa=no
5023 _res_comment="unknown version"
5025 _ld_alsa="-lasound $_ld_dl $_ld_pthread"
5026 else
5027 _noaomodules="alsa $_noaomodules"
5029 echores "$_alsa"
5032 echocheck "Sun audio"
5033 if test "$_sunaudio" = auto ; then
5034 cat > $TMPC << EOF
5035 #include <sys/types.h>
5036 #include <sys/audioio.h>
5037 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5039 _sunaudio=no
5040 cc_check && _sunaudio=yes
5042 if test "$_sunaudio" = yes ; then
5043 _def_sunaudio='#define USE_SUN_AUDIO 1'
5044 _aosrc="$_aosrc ao_sun.c"
5045 _aomodules="sun $_aomodules"
5046 else
5047 _def_sunaudio='#undef USE_SUN_AUDIO'
5048 _noaomodules="sun $_noaomodules"
5050 echores "$_sunaudio"
5053 if sunos; then
5054 echocheck "Sun mediaLib"
5055 if test "$_mlib" = auto ; then
5056 _mlib=no
5057 cat > $TMPC << EOF
5058 #include <mlib.h>
5059 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5061 cc_check $_ld_mlib -lmlib && _mlib=yes
5063 if test "$_mlib" = yes ; then
5064 _def_mlib='#define HAVE_MLIB 1'
5065 _ld_mlib="$_ld_mlib `echo $_ld_mlib | sed s/^-L/-R/` -lmlib"
5066 else
5067 _def_mlib='#undef HAVE_MLIB'
5069 echores "$_mlib"
5070 fi #if sunos
5073 if irix; then
5074 echocheck "SGI audio"
5075 if test "$_sgiaudio" = auto ; then
5076 # check for SGI audio
5077 cat > $TMPC << EOF
5078 #include <dmedia/audio.h>
5079 int main(void) { return 0; }
5081 _sgiaudio=no
5082 cc_check && _sgiaudio=yes
5084 if test "$_sgiaudio" = "yes" ; then
5085 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5086 _ld_sgiaudio='-laudio'
5087 _aosrc="$_aosrc ao_sgi.c"
5088 _aomodules="sgi $_aomodules"
5089 else
5090 _def_sgiaudio='#undef USE_SGI_AUDIO'
5091 _noaomodules="sgi $_noaomodules"
5093 echores "$_sgiaudio"
5094 fi #if irix
5097 echocheck "VCD support"
5098 if linux || bsdos || freebsd || netbsd || sunos || darwin ; then
5099 _inputmodules="vcd $_inputmodules"
5100 _def_vcd='#define HAVE_VCD 1'
5101 _vcd="yes"
5102 else
5103 _def_vcd='#undef HAVE_VCD'
5104 _noinputmodules="vcd $_noinputmodules"
5105 _res_comment="not supported on this OS"
5106 _vcd="no"
5108 echores "$_vcd"
5110 echocheck "DVD support (libdvdnav)"
5111 if test "$_dvdnav" = auto ; then
5112 $_dvdnavconfig --version >> $TMPLOG 2>&1 || _dvdnav=no
5114 if test "$_dvdnav" = auto ; then
5115 cat > $TMPC <<EOF
5116 #include <dvdnav.h>
5117 int main(void) { dvdnav_t *dvd=0; return 0; }
5119 _dvdnav=no
5120 _dvdnavdir=`$_dvdnavconfig --cflags`
5121 _dvdnavlibs=`$_dvdnavconfig --libs`
5122 _dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
5123 _dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
5124 test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
5125 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
5127 if test "$_dvdnav" = yes ; then
5128 _largefiles=yes
5129 _def_dvdnav='#define USE_DVDNAV 1'
5130 _ld_dvdnav=`$_dvdnavconfig --libs`
5131 _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
5132 _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
5133 _inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
5134 _inputmodules="dvdnav $_inputmodules"
5136 #disable dvdread checks: dvdread will be enabled using dvdnav's version of dvdread
5137 _dvdread_internal=no
5138 _dvdread=yes
5139 else
5140 _def_dvdnav='#undef USE_DVDNAV'
5141 _noinputmodules="dvdnav $_noinputmodules"
5143 echores "$_dvdnav"
5146 echocheck "dvdread"
5147 if test "$_dvdread_internal" = auto ; then
5148 _dvdread_internal=no
5149 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux && \
5150 test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5151 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
5152 test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5153 _dvdread_internal=yes
5154 _dvdread=yes
5155 _res_comment="internal"
5157 elif test "$_dvdread" = auto ; then
5158 _dvdread=no
5159 if test "$_dl" = yes; then
5160 cat > $TMPC << EOF
5161 #include <inttypes.h>
5162 #include <dvdread/dvd_reader.h>
5163 #include <dvdread/ifo_types.h>
5164 #include <dvdread/ifo_read.h>
5165 #include <dvdread/nav_read.h>
5166 int main(void) { return 0; }
5168 cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5169 -ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
5173 if test "$_dvdread_internal" = yes; then
5174 _def_dvdread_internal="#define USE_DVDREAD_INTERNAL 1"
5175 _def_dvdread='#define USE_DVDREAD 1'
5176 _inputmodules="dvdread $_inputmodules"
5177 _largefiles=yes
5178 if linux || netbsd || openbsd || bsdos ; then
5179 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5180 openbsd && _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5181 elif freebsd ; then
5182 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5183 elif darwin ; then
5184 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5185 _macosx_frameworks="$_macosx_frameworks -framework IOKit"
5187 elif test "$_dvdread" = yes; then
5188 _def_dvdread='#define USE_DVDREAD 1'
5189 _inputmodules="dvdread $_inputmodules"
5190 _largefiles=yes
5191 test "$_dvdnav" != yes && _ld_dvdread='-ldvdread'
5192 else
5193 _def_dvdread_internal="#undef USE_DVDREAD_INTERNAL"
5194 _def_dvdread='#undef USE_DVDREAD'
5195 _noinputmodules="dvdread $_noinputmodules"
5197 echores "$_dvdread"
5200 echocheck "cdparanoia"
5201 if test "$_cdparanoia" = auto ; then
5202 cat > $TMPC <<EOF
5203 #include <cdda_interface.h>
5204 #include <cdda_paranoia.h>
5205 // This need a better test. How ?
5206 int main(void) {
5207 void *test = cdda_verbose_set;
5208 return test == (void *)1;
5211 _cdparanoia=no
5212 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5213 cc_check $_inc_tmp $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm && \
5214 _cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
5215 done
5217 if test "$_cdparanoia" = yes ; then
5218 _cdda='yes'
5219 _ld_cdparanoia="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
5220 openbsd && _ld_cdparanoia="$_ld_cdparanoia -lutil"
5222 echores "$_cdparanoia"
5225 echocheck "libcdio"
5226 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5227 cat > $TMPC << EOF
5228 #include <stdio.h>
5229 #include <cdio/version.h>
5230 #include <cdio/cdda.h>
5231 #include <cdio/paranoia.h>
5232 int main()
5234 void *test = cdda_verbose_set;
5235 printf("%s\n", CDIO_VERSION);
5236 return test == (void *)1;
5240 _libcdio=no
5241 for _ld_tmp in "" "-lwinmm" ; do
5242 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5243 cc_check $_ld_tmp $_ld_lm \
5244 && _libcdio=yes && _ld_libcdio="$_ld_tmp" && break
5245 done
5246 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5247 _inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
5248 _ld_tmp=`$_pkg_config --libs libcdio_paranoia`
5249 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5250 && _ld_libcdio="$_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5253 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5254 _cdda='yes'
5255 _def_libcdio='#define HAVE_LIBCDIO'
5256 _def_havelibcdio='yes'
5257 else
5258 if test "$_cdparanoia" = yes ; then
5259 _res_comment="using cdparanoia"
5261 _def_libcdio='#undef HAVE_LIBCDIO'
5262 _def_havelibcdio='no'
5264 echores "$_libcdio"
5266 if test "$_cdda" = yes ; then
5267 _def_cdparanoia='#define HAVE_CDDA'
5268 _inputmodules="cdda $_inputmodules"
5269 else
5270 _def_cdparanoia='#undef HAVE_CDDA'
5271 _noinputmodules="cdda $_noinputmodules"
5274 echocheck "bitmap font support"
5275 if test "$_bitmap_font" = yes ; then
5276 _def_bitmap_font="#define HAVE_BITMAP_FONT 1"
5277 else
5278 _def_bitmap_font="#undef HAVE_BITMAP_FONT"
5280 echores "$_bitmap_font"
5283 echocheck "freetype >= 2.0.9"
5285 # freetype depends on iconv
5286 if test "$_iconv" = no ; then
5287 _freetype=no
5288 _res_comment="iconv support needed"
5291 if test "$_freetype" = auto ; then
5292 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5293 cat > $TMPC << EOF
5294 #include <stdio.h>
5295 #include <ft2build.h>
5296 #include FT_FREETYPE_H
5297 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5298 #error "Need FreeType 2.0.9 or newer"
5299 #endif
5300 int main()
5302 FT_Library library;
5303 FT_Int major=-1,minor=-1,patch=-1;
5304 int err=FT_Init_FreeType(&library);
5305 if(err){
5306 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5307 exit(err);
5309 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5310 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5311 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5312 (int)major,(int)minor,(int)patch );
5313 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5314 printf("Library and header version mismatch! Fix it in your distribution!\n");
5315 exit(1);
5317 return 0;
5320 _freetype=no
5321 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5322 else
5323 _freetype=no
5326 if test "$_freetype" = yes ; then
5327 _def_freetype='#define HAVE_FREETYPE'
5328 _inc_extra="$_inc_extra `$_freetypeconfig --cflags`"
5329 _ld_freetype=`$_freetypeconfig --libs`
5330 else
5331 _def_freetype='#undef HAVE_FREETYPE'
5333 echores "$_freetype"
5335 if test "$_freetype" = no ; then
5336 _fontconfig=no
5337 _res_comment="freetype support needed"
5339 echocheck "fontconfig"
5340 if test "$_fontconfig" = auto ; then
5341 cat > $TMPC << EOF
5342 #include <stdio.h>
5343 #include <fontconfig/fontconfig.h>
5344 int main()
5346 int err = FcInit();
5347 if(err == FcFalse){
5348 printf("Couldn't initialize fontconfig lib\n");
5349 exit(err);
5351 return 0;
5355 _fontconfig=no
5356 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
5357 _ld_tmp="-lfontconfig $_ld_tmp"
5358 cc_check $_ld_tmp && _fontconfig=yes && _ld_fontconfig="$_ld_tmp" && break
5359 done
5360 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5361 _inc_tmp=`$_pkg_config --cflags fontconfig`
5362 _ld_tmp=`$_pkg_config --libs fontconfig`
5363 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5364 && _ld_fontconfig="$_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
5367 if test "$_fontconfig" = yes ; then
5368 _def_fontconfig='#define HAVE_FONTCONFIG'
5369 else
5370 _def_fontconfig='#undef HAVE_FONTCONFIG'
5372 echores "$_fontconfig"
5375 echocheck "SSA/ASS support"
5376 # libass depends on FreeType
5377 if test "$_freetype" = no ; then
5378 _ass=no
5379 _res_comment="FreeType support needed"
5382 if test "$_ass" = auto ; then
5383 cat > $TMPC << EOF
5384 #include <ft2build.h>
5385 #include FT_FREETYPE_H
5386 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
5387 #error "Need FreeType 2.1.8 or newer"
5388 #endif
5389 int main() { return 0; }
5391 _ass=no
5392 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _ass=yes
5393 if test "$_ass" = no ; then
5394 _res_comment="FreeType >= 2.1.8 needed"
5397 if test "$_ass" = yes ; then
5398 _def_ass='#define USE_ASS'
5399 else
5400 _def_ass='#undef USE_ASS'
5402 echores "$_ass"
5405 echocheck "fribidi with charsets"
5406 if test "$_fribidi" = auto ; then
5407 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5408 cat > $TMPC << EOF
5409 #include <stdio.h>
5410 /* workaround for fribidi 0.10.4 and below */
5411 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5412 #include <fribidi/fribidi.h>
5413 int main()
5415 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5416 printf("Fribidi headers are not consistents with the library!\n");
5417 exit(1);
5419 return 0;
5422 _fribidi=no
5423 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5424 else
5425 _fribidi=no
5428 if test "$_fribidi" = yes ; then
5429 _def_fribidi='#define USE_FRIBIDI'
5430 _inc_extra="$_inc_extra `$_fribidiconfig --cflags`"
5431 _ld_fribidi=`$_fribidiconfig --libs`
5432 else
5433 _def_fribidi='#undef USE_FRIBIDI'
5435 echores "$_fribidi"
5438 echocheck "ENCA"
5439 if test "$_enca" = auto ; then
5440 cat > $TMPC << EOF
5441 #include <enca.h>
5442 int main()
5444 const char **langs;
5445 size_t langcnt;
5446 langs = enca_get_languages(&langcnt);
5447 return 0;
5450 _enca=no
5451 cc_check -lenca $_ld_lm && _enca=yes
5453 if test "$_enca" = yes ; then
5454 _def_enca='#define HAVE_ENCA 1'
5455 _ld_enca='-lenca'
5456 else
5457 _def_enca='#undef HAVE_ENCA'
5459 echores "$_enca"
5462 echocheck "zlib"
5463 cat > $TMPC << EOF
5464 #include <zlib.h>
5465 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5467 _zlib=no
5468 cc_check -lz && _zlib=yes
5469 if test "$_zlib" = yes ; then
5470 _def_zlib='#define HAVE_ZLIB 1'
5471 _ld_zlib='-lz'
5472 else
5473 _def_zlib='#undef HAVE_ZLIB'
5475 echores "$_zlib"
5478 echocheck "RTC"
5479 if test "$_rtc" = auto ; then
5480 cat > $TMPC << EOF
5481 #include <sys/ioctl.h>
5482 #ifdef __linux__
5483 #include <linux/rtc.h>
5484 #else
5485 #include <rtc.h>
5486 #define RTC_PIE_ON RTCIO_PIE_ON
5487 #endif
5488 int main(void) { return RTC_PIE_ON; }
5490 _rtc=no
5491 cc_check && _rtc=yes
5492 ppc && _rtc=no
5494 if test "$_rtc" = yes ; then
5495 _def_rtc='#define HAVE_RTC 1'
5496 else
5497 _def_rtc='#undef HAVE_RTC'
5499 echores "$_rtc"
5502 echocheck "external liblzo support"
5503 if test "$_liblzo" = auto ; then
5504 _liblzo=no
5505 cat > $TMPC << EOF
5506 #include <lzo1x.h>
5507 int main(void) { lzo_init();return 0; }
5509 cc_check -llzo && _liblzo=yes
5511 if test "$_liblzo" = yes ; then
5512 _def_liblzo='#define USE_LIBLZO 1'
5513 _ld_liblzo='-llzo'
5514 _codecmodules="liblzo $_codecmodules"
5515 else
5516 _def_liblzo='#undef USE_LIBLZO'
5517 _nocodecmodules="liblzo $_nocodecmodules"
5519 echores "$_liblzo"
5522 echocheck "mad support"
5523 if test "$_mad" = auto ; then
5524 _mad=no
5525 cat > $TMPC << EOF
5526 #include <mad.h>
5527 int main(void) { return 0; }
5529 cc_check -lmad && _mad=yes
5531 if test "$_mad" = yes ; then
5532 _def_mad='#define USE_LIBMAD 1'
5533 _ld_mad='-lmad'
5534 _codecmodules="libmad $_codecmodules"
5535 else
5536 _def_mad='#undef USE_LIBMAD'
5537 _nocodecmodules="libmad $_nocodecmodules"
5539 echores "$_mad"
5541 echocheck "Toolame"
5542 if test "$_toolame" = auto ; then
5543 cat > $TMPC <<EOF
5544 #include <toolame.h>
5545 int main(void) { toolame_init(); return 0; }
5547 _toolame=no
5548 cc_check $_ld_toolame -ltoolame $_ld_lm && _toolame=yes
5550 if test "$_toolame" = yes ; then
5551 _def_toolame='#define HAVE_TOOLAME 1'
5552 _toolame_lib="-ltoolame"
5553 _codecmodules="toolame $_codecmodules"
5554 else
5555 _def_toolame='#undef HAVE_TOOLAME'
5556 _nocodecmodules="toolame $_nocodecmodules"
5558 if test "$_toolamedir" ; then
5559 _res_comment="using $_toolamedir"
5561 echores "$_toolame"
5563 echocheck "Twolame"
5564 if test "$_twolame" = auto ; then
5565 cat > $TMPC <<EOF
5566 #include <twolame.h>
5567 int main(void) { twolame_init(); return 0; }
5569 _twolame=no
5570 _twolame_lib="-ltwolame"
5571 cc_check $_twolame_lib $_ld_lm && _twolame=yes
5573 if test "$_twolame" = yes ; then
5574 _def_twolame='#define HAVE_TWOLAME 1'
5575 _codecmodules="twolame $_codecmodules"
5576 else
5577 _def_twolame='#undef HAVE_TWOLAME'
5578 _twolame_lib=""
5579 _nocodecmodules="twolame $_nocodecmodules"
5581 echores "$_twolame"
5583 echocheck "OggVorbis support"
5584 if test "$_tremor_internal" = yes; then
5585 _libvorbis=no
5586 elif test "$_tremor_external" = auto; then
5587 _tremor_external=no
5588 cat > $TMPC << EOF
5589 #include <tremor/ivorbiscodec.h>
5590 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5592 cc_check -logg -lvorbisidec $_ld_lm && _tremor_external=yes && _libvorbis=no
5594 if test "$_libvorbis" = auto; then
5595 _libvorbis=no
5596 cat > $TMPC << EOF
5597 #include <vorbis/codec.h>
5598 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5600 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
5602 if test "$_tremor_internal" = yes ; then
5603 _vorbis=yes
5604 _def_vorbis='#define HAVE_OGGVORBIS 1'
5605 _def_tremor='#define TREMOR 1'
5606 _codecmodules="tremor(internal) $_codecmodules"
5607 _res_comment="internal Tremor"
5608 if test "$_tremor_low" = yes ; then
5609 _tremor_flags='-D_LOW_ACCURACY_'
5610 _res_comment="internal low accuracy Tremor"
5612 elif test "$_tremor_external" = yes ; then
5613 _vorbis=yes
5614 _def_vorbis='#define HAVE_OGGVORBIS 1'
5615 _def_tremor='#define TREMOR 1'
5616 _codecmodules="tremor(external) $_codecmodules"
5617 _res_comment="external Tremor"
5618 _ld_vorbis='-logg -lvorbisidec'
5619 elif test "$_libvorbis" = yes ; then
5620 _vorbis=yes
5621 _def_vorbis='#define HAVE_OGGVORBIS 1'
5622 _codecmodules="libvorbis $_codecmodules"
5623 _res_comment="libvorbis"
5624 _ld_vorbis='-lvorbis -logg'
5625 else
5626 _vorbis=no
5627 _nocodecmodules="libvorbis $_nocodecmodules"
5629 echores "$_vorbis"
5631 echocheck "libspeex (version >= 1.1 required)"
5632 if test "$_speex" = auto ; then
5633 _speex=no
5634 cat > $TMPC << EOF
5635 #include <speex/speex.h>
5636 int main(void) {
5637 SpeexBits bits;
5638 void *dec;
5639 speex_decode_int(dec, &bits, dec);
5642 cc_check -lspeex $_ld_lm && _speex=yes
5644 if test "$_speex" = yes ; then
5645 _def_speex='#define HAVE_SPEEX 1'
5646 _ld_speex='-lspeex'
5647 _codecmodules="speex $_codecmodules"
5648 else
5649 _def_speex='#undef HAVE_SPEEX'
5650 _nocodecmodules="speex $_nocodecmodules"
5652 echores "$_speex"
5654 echocheck "OggTheora support"
5655 if test "$_theora" = auto ; then
5656 _theora=no
5657 cat > $TMPC << EOF
5658 #include <theora/theora.h>
5659 #include <string.h>
5660 int main(void)
5662 /* theora is in flux, make sure that all interface routines and
5663 * datatypes exist and work the way we expect it, so we don't break
5664 * mplayer */
5665 ogg_packet op;
5666 theora_comment tc;
5667 theora_info inf;
5668 theora_state st;
5669 yuv_buffer yuv;
5670 int r;
5671 double t;
5673 theora_info_init (&inf);
5674 theora_comment_init (&tc);
5676 return 0;
5678 /* we don't want to execute this kind of nonsense; just for making sure
5679 * that compilation works... */
5680 memset(&op, 0, sizeof(op));
5681 r = theora_decode_header (&inf, &tc, &op);
5682 r = theora_decode_init (&st, &inf);
5683 t = theora_granule_time (&st, op.granulepos);
5684 r = theora_decode_packetin (&st, &op);
5685 r = theora_decode_YUVout (&st, &yuv);
5686 theora_clear (&st);
5688 return 0;
5691 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5692 cc_check $_ld_theora && _theora=yes && break
5693 done
5694 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5695 for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`" "-ltheora"; do
5696 cc_check -I. tremor/bitwise.c $_ld_theora && _theora=yes && break
5697 done
5700 if test "$_theora" = yes ; then
5701 _def_theora='#define HAVE_OGGTHEORA 1'
5702 _codecmodules="libtheora $_codecmodules"
5703 # when --enable-theora is forced, we'd better provide a probably sane
5704 # $_ld_theora than nothing
5705 test -z "$_ld_theora" && _ld_theora="-ltheora -logg"
5706 else
5707 _def_theora='#undef HAVE_OGGTHEORA'
5708 _nocodecmodules="libtheora $_nocodecmodules"
5709 _ld_theora=""
5711 echores "$_theora"
5713 echocheck "mp3lib support"
5714 if test "$_mp3lib" = yes ; then
5715 _def_mp3lib='#define USE_MP3LIB 1'
5716 _codecmodules="mp3lib $_codecmodules"
5717 else
5718 _def_mp3lib='#undef USE_MP3LIB'
5719 _nocodecmodules="mp3lib $_nocodecmodules"
5721 echores "$_mp3lib"
5723 echocheck "liba52 support"
5724 if test "$_liba52" = yes ; then
5725 _def_liba52='#define USE_LIBA52 1'
5726 _codecmodules="liba52 $_codecmodules"
5727 else
5728 _def_liba52='#undef USE_LIBA52'
5729 _nocodecmodules="liba52 $_nocodecmodules"
5731 echores "$_liba52"
5733 echocheck "libdts support"
5734 if test "$_libdts" = auto ; then
5735 _libdts=no
5736 cat > $TMPC << EOF
5737 #include <inttypes.h>
5738 #include <dts.h>
5739 int main(void) { dts_init (0); return 0; }
5741 cc_check $_ld_libdts -ldts $_ld_lm && _libdts=yes
5743 if test "$_libdts" = yes ; then
5744 _def_libdts='#define CONFIG_DTS 1'
5745 _ld_libdts="$_ld_libdts -ldts"
5746 _codecmodules="libdts $_codecmodules"
5747 else
5748 _def_libdts='#undef CONFIG_DTS'
5749 _nocodecmodules="libdts $_nocodecmodules"
5751 echores "$_libdts"
5753 echocheck "libmpeg2 support"
5754 if test "$_libmpeg2" = yes ; then
5755 _def_libmpeg2='#define USE_LIBMPEG2 1'
5756 _codecmodules="libmpeg2 $_codecmodules"
5757 else
5758 _def_libmpeg2='#undef USE_LIBMPEG2'
5759 _nocodecmodules="libmpeg2 $_nocodecmodules"
5761 echores "$_libmpeg2"
5763 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5764 if test "$_musepack" = auto ; then
5765 _musepack=no
5766 cat > $TMPC << EOF
5767 #include <mpcdec/mpcdec.h>
5768 int main(void) {
5769 mpc_streaminfo info;
5770 mpc_decoder decoder;
5771 mpc_decoder_set_streaminfo(&decoder, &info);
5772 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5775 cc_check -lmpcdec $_ld_lm && _musepack=yes
5777 if test "$_musepack" = yes ; then
5778 _def_musepack='#define HAVE_MUSEPACK 1'
5779 _ld_musepack='-lmpcdec'
5780 _codecmodules="musepack $_codecmodules"
5781 else
5782 _def_musepack='#undef HAVE_MUSEPACK'
5783 _nocodecmodules="musepack $_nocodecmodules"
5785 echores "$_musepack"
5788 echocheck "FAAC (AAC encoder) support"
5789 if test "$_faac" = auto ; then
5790 cat > $TMPC <<EOF
5791 #include <inttypes.h>
5792 #include <faac.h>
5793 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5795 _faac=no
5796 for _ld_tmp in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5797 cc_check -c -O4 $_ld_tmp $_ld_lm && _ld_faac="$_ld_tmp" && _faac=yes && break
5798 done
5800 if test "$_faac" = yes ; then
5801 _def_faac="#define HAVE_FAAC 1"
5802 _def_lavc_faac="#define CONFIG_FAAC 1"
5803 _codecmodules="faac $_codecmodules"
5804 else
5805 _def_faac="#undef HAVE_FAAC"
5806 _nocodecmodules="faac $_nocodecmodules"
5808 echores "$_faac"
5811 echocheck "FAAD2 (AAC) support"
5812 if test "$_faad_internal" = auto ; then
5813 if x86 && test cc_vendor=gnu; then
5814 case $cc_version in
5815 3.1*|3.2) # ICE/insn with these versions
5816 _faad_internal=no
5817 _res_comment="broken gcc"
5820 _faad_internal=yes
5822 esac
5823 else
5824 _faad_internal=yes
5826 elif test "$_faad_internal" = no && test "$_faad_external" = auto ; then
5827 _ld_faad='-lfaad'
5828 _faad_external=no
5829 cat > $TMPC << EOF
5830 #include <faad.h>
5831 #ifndef FAAD_MIN_STREAMSIZE
5832 #error Too old version
5833 #endif
5834 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5836 cc_check $_ld_faad $_ld_lm && _faad_external=yes
5839 if test "$_faad_internal" = yes ; then
5840 _def_faad_internal="#define USE_FAAD_INTERNAL 1"
5841 _faad=yes
5842 _res_comment="internal floating-point"
5843 test "$_faad_fixed" = yes && _res_comment="internal fixed-point"
5844 elif test "$_faad_external" = yes ; then
5845 _faad=yes
5846 else
5847 _def_faad_internal="#undef USE_FAAD_INTERNAL"
5848 _faad=no
5851 if test "$_faad" = yes ; then
5852 _def_faad='#define HAVE_FAAD 1'
5853 _codecmodules="faad2 $_codecmodules"
5854 else
5855 _def_faad='#undef HAVE_FAAD'
5856 _nocodecmodules="faad2 $_nocodecmodules"
5857 _ld_faad=
5859 echores "$_faad"
5862 echocheck "LADSPA plugin support"
5863 if test "$_ladspa" = auto ; then
5864 cat > $TMPC <<EOF
5865 #include <stdio.h>
5866 #include <ladspa.h>
5867 int main(void) {
5868 const LADSPA_Descriptor *ld = NULL;
5869 return 0;
5872 _ladspa=no
5873 cc_check && _ladspa=yes
5875 if test "$_ladspa" = yes; then
5876 _def_ladspa="#define HAVE_LADSPA"
5877 _afsrc="$_afsrc af_ladspa.c"
5878 _afmodules="ladspa $_afmodules"
5879 else
5880 _def_ladspa="#undef HAVE_LADSPA"
5881 _noafmodules="ladspa $_noafmodules"
5883 echores "$_ladspa"
5886 if test -z "$_codecsdir" ; then
5887 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
5888 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5889 if test -d "$dir" ; then
5890 _codecsdir="$dir"
5891 break;
5893 done
5895 # Fall back on default directory.
5896 if test -z "$_codecsdir" ; then
5897 _codecsdir="$_libdir/codecs"
5898 mingw32 && _codecsdir="codecs"
5902 echocheck "Win32 codecs"
5903 if test "$_win32" = auto ; then
5904 _win32=no
5905 if x86 && not qnx; then
5906 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
5907 _win32=yes
5910 if test "$_win32" = yes ; then
5911 _def_win32='#define USE_WIN32DLL 1'
5912 _res_comment="using $_win32codecsdir"
5913 _ld_win32='loader/libloader.a loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5914 _dep_win32='loader/libloader.a loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5915 openbsd && x86 && _ld_win32="$_ld_win32 -li386"
5916 if not win32 ; then
5917 _def_win32_loader='#define WIN32_LOADER 1'
5918 else
5919 _ld_win32libs="$_ld_win32libs -ladvapi32 -lole32"
5920 _res_comment="using native windows"
5922 _codecmodules="win32 $_codecmodules"
5923 else
5924 _def_win32='#undef USE_WIN32DLL'
5925 _def_win32_loader='#undef WIN32_LOADER'
5926 _nocodecmodules="win32 $_nocodecmodules"
5928 echores "$_win32"
5931 echocheck "XAnim codecs"
5932 if test "$_xanim" = auto ; then
5933 _xanim=no
5934 _res_comment="dynamic loader support needed"
5935 if test "$_dl" = yes ; then
5936 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
5937 _xanim=yes
5940 if test "$_xanim" = yes ; then
5941 _def_xanim='#define USE_XANIM 1'
5942 _def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
5943 _codecmodules="xanim $_codecmodules"
5944 _res_comment="using $_xanimcodecsdir"
5945 else
5946 _def_xanim='#undef USE_XANIM'
5947 _def_xanim_path='#undef XACODEC_PATH'
5948 _nocodecmodules="xanim $_nocodecmodules"
5950 echores "$_xanim"
5953 echocheck "RealPlayer codecs"
5954 if test "$_real" = auto ; then
5955 _real=no
5956 _res_comment="dynamic loader support needed"
5957 if test "$_dl" = yes || test "$_win32" = yes &&
5958 (linux || freebsd || netbsd || win32 || darwin) ; then
5959 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
5960 _real=yes
5963 if test "$_real" = yes ; then
5964 _def_real='#define USE_REALCODECS 1'
5965 _def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
5966 _codecmodules="real $_codecmodules"
5967 _res_comment="using $_realcodecsdir"
5968 else
5969 _def_real='#undef USE_REALCODECS'
5970 _def_real_path="#undef REALCODEC_PATH"
5971 _nocodecmodules="real $_nocodecmodules"
5973 echores "$_real"
5976 echocheck "LIVE555 Streaming Media libraries"
5977 if test "$_live" = auto && test "$_network" = yes ; then
5978 cat > $TMPCPP << EOF
5979 #include <liveMedia.hh>
5980 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1090195200)
5981 #error Please upgrade to version 2004.07.19 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5982 #endif
5983 int main(void) {}
5986 _live=no
5987 for I in "$_livelibdir" "$_libdir/live" "/usr/lib/live" "/usr/local/live" "/usr/local/lib/live" ; do
5988 cxx_check -I$I/liveMedia/include -I$I/UsageEnvironment/include -I$I/groupsock/include && _livelibdir=$I && _live=yes && break
5989 done
5990 if test "$_live" != yes ; then
5991 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
5992 _live_dist=yes
5996 if test "$_live" = yes && test "$_network" = yes ; then
5997 _res_comment="using $_livelibdir"
5998 _def_live='#define STREAMING_LIVE555 1'
5999 _ld_live="$_livelibdir/liveMedia/libliveMedia.a \
6000 $_livelibdir/groupsock/libgroupsock.a \
6001 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6002 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6003 -lstdc++"
6004 _inc_extra="$_inc_extra -I$_livelibdir/liveMedia/include \
6005 -I$_livelibdir/UsageEnvironment/include \
6006 -I$_livelibdir/BasicUsageEnvironment/include \
6007 -I$_livelibdir/groupsock/include"
6008 _inputmodules="live555 $_inputmodules"
6009 elif test "$_live_dist" = yes && test "$_network" = yes ; then
6010 _res_comment="using distribution version"
6011 _live="yes"
6012 _def_live='#define STREAMING_LIVE555 1'
6013 _ld_live="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6014 _inc_extra="$_inc_extra -I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6015 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6016 _inputmodules="live555 $_inputmodules"
6017 else
6018 _def_live='#undef STREAMING_LIVE555'
6019 _noinputmodules="live555 $_noinputmodules"
6021 echores "$_live"
6024 echocheck "FFmpeg libavutil (static)"
6025 if test "$_libavutil" = auto ; then
6026 if test -d libavutil ; then
6027 _libavutil=yes
6028 else
6029 _libavutil=no
6032 echores "$_libavutil"
6034 echocheck "FFmpeg libavcodec (static)"
6035 if test "$_libavcodec" = auto ; then
6036 # Note: static linking is preferred to dynamic linking
6037 _libavcodec=no
6038 _res_comment="see DOCS/HTML/$_doc_lang/codecs.html"
6039 if test -d libavcodec && test -f libavcodec/utils.c ; then
6040 _res_comment="old ffmpeg version, use CVS !"
6041 if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
6042 # check if libavutil is a required
6043 cat > $TMPC << EOF
6044 #include "libavcodec/avcodec.h"
6045 #if LIBAVCODEC_BUILD >= 3211265
6046 #error We need libavutil!
6047 #endif
6048 int main(void) { return 0; }
6051 if cc_check -I. -I./libavutil; then
6052 _libavutil_required="no"
6053 else
6054 _libavutil_required="yes"
6056 _res_comment="libavutil availability does not fit libavcodec version"
6057 if test "$_libavutil_required" = "$_libavutil"; then
6058 _libavcodec="yes"
6059 _res_comment=""
6064 echores "$_libavcodec"
6066 echocheck "FFmpeg libavformat (static)"
6067 if test "$_libavformat" = auto ; then
6068 # Note: static linking is preferred to dynamic linking
6069 _libavformat=no
6070 if test -d libavformat && test -f libavformat/utils.c ; then
6071 _libavformat=yes
6074 echores "$_libavformat"
6076 echocheck "FFmpeg libpostproc (static)"
6077 if test "$_libpostproc" = auto ; then
6078 _libpostproc=no
6079 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6080 _libpostproc='yes'
6083 echores "$_libpostproc"
6086 if test "$_libavutil" != yes ; then
6087 echocheck "FFmpeg libavutil (dynamic)"
6088 if test "$_libavutil_so" = auto ; then
6089 _libavutil_so=no
6090 cat > $TMPC << EOF
6091 #include <ffmpeg/common.h>
6092 int main(void) { ff_gcd(1,1); return 0; }
6094 if $_pkg_config --exists libavutil ; then
6095 _inc_libavutil=`$_pkg_config --cflags libavutil`
6096 _ld_libavutil=`$_pkg_config --libs libavutil`
6097 cc_check $_inc_libavutil $_ld_libavutil && _libavutil_so=yes
6098 elif cc_check -lavutil $_ld_lm ; then
6099 _libavutil_so=yes
6101 if test "$_libavutil_so" = yes ; then
6102 _res_comment="using libavutil.so, but static libavutil is recommended"
6105 # neither static nor shared libavutil is available, but it is mandatory ...
6106 if test "$_libavutil_so" = no ; then
6107 die "You need static or shared libavutil, MPlayer will not compile without!"
6109 echores "$_libavutil_so"
6110 fi #if test "$_libavutil" != yes ; then
6112 if test "$_libavcodec" != yes ; then
6113 echocheck "FFmpeg libavcodec (dynamic)"
6114 if test "$_libavcodec_so" = auto ; then
6115 _libavcodec_so=no
6116 _res_comment="libavcodec.so is broken/obsolete"
6117 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
6118 cat > $TMPC << EOF
6119 #include <ffmpeg/avcodec.h>
6120 int main(void) {
6121 avcodec_find_encoder_by_name("");
6122 return 0;
6125 if $_pkg_config --exists libavcodec ; then
6126 _inc_libavcodec=`$_pkg_config --cflags libavcodec`
6127 _ld_libavcodec=`$_pkg_config --libs libavcodec`
6128 cc_check $_inc_libavcodec $_ld_libavcodec && _libavcodec_so=yes
6129 elif cc_check -lavcodec $_ld_lm ; then
6130 _libavcodec_so=yes
6132 if test "$_libavcodec_so" = yes ; then
6133 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6136 echores "$_libavcodec_so"
6137 fi #if test "$_libavcodec" != yes ; then
6139 if test "$_libavformat" != yes ; then
6140 echocheck "FFmpeg libavformat (dynamic)"
6141 if test "$_libavformat_so" = auto ; then
6142 _libavformat_so=no
6143 cat > $TMPC <<EOF
6144 #include <ffmpeg/avformat.h>
6145 #include <ffmpeg/opt.h>
6146 int main(void) { av_alloc_format_context(); return 0; }
6148 if $_pkg_config --exists libavformat ; then
6149 _inc_libavformat=`$_pkg_config --cflags libavformat`
6150 _ld_libavformat=`$_pkg_config --libs libavformat`
6151 cc_check $_inc_libavformat $_ld_libavformat && _libavformat_so=yes
6152 elif cc_check $_ld_lm -lavformat ; then
6153 _libavformat_so=yes
6155 if test "$_libavformat_so" = yes ; then
6156 _res_comment="using libavformat.so, but static libavformat is recommended"
6159 echores "$_libavformat_so"
6160 fi #if test "$_libavformat" != yes ; then
6162 if test "$_libpostproc" != yes ; then
6163 echocheck "FFmpeg libpostproc (dynamic)"
6164 if test "$_libpostproc_so" = auto ; then
6165 _libpostproc_so=no
6166 cat > $TMPC << EOF
6167 #define USE_LIBPOSTPROC 1
6168 #include <inttypes.h>
6169 #include <postproc/postprocess.h>
6170 int main(void) {
6171 pp_get_mode_by_name_and_quality("de", 0);
6172 return 0;}
6174 if cc_check -lpostproc $_ld_lm ; then
6175 _libpostproc_so=yes
6176 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6179 echores "$_libpostproc_so"
6180 fi #if test "$_libpostproc" != yes ; then
6182 _def_libavutil='#undef USE_LIBAVUTIL'
6183 _def_libavutil_so='#undef USE_LIBAVUTIL_SO'
6184 if test "$_libavutil" = yes ; then
6185 _def_libavutil='#define USE_LIBAVUTIL 1'
6186 elif test "$_libavutil_so" = yes ; then
6187 _def_libavutil_so='#define USE_LIBAVUTIL_SO 1'
6190 _def_libavcodec='#undef USE_LIBAVCODEC'
6191 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6192 _def_lavc_dsputil='#undef USE_LIBAVCODEC_DSPUTIL'
6193 if test "$_libavcodec_mpegaudio_hp" = yes ; then
6194 _def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
6196 if test "$_libavcodec" = yes ; then
6197 _def_libavcodec='#define USE_LIBAVCODEC 1'
6198 _def_lavc_dsputil='#define USE_LIBAVCODEC_DSPUTIL'
6199 _ld_libavcodec='libavcodec/libavcodec.a'
6200 _dep_libavcodec='libavcodec/libavcodec.a'
6201 _codecmodules="libavcodec $_codecmodules"
6202 if test "$_libavutil" = yes; then
6203 _ld_libavutil='libavutil/libavutil.a'
6204 _dep_libavutil='libavutil/libavutil.a'
6206 elif test "$_libavcodec_so" = yes ; then
6207 _def_libavcodec='#define USE_LIBAVCODEC 1'
6208 _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6209 test "$_ld_libavcodec" || _ld_libavcodec='-lavcodec'
6210 _codecmodules="libavcodec.so $_codecmodules"
6211 else
6212 _nocodecmodules="libavcodec $_nocodecmodules"
6215 _def_libavformat='#undef USE_LIBAVFORMAT'
6216 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6217 _def_libavformat_win32='#undef CONFIG_WIN32'
6218 if test "$_libavformat" = yes ; then
6219 _def_libavformat='#define USE_LIBAVFORMAT 1'
6220 _ld_libavformat='libavformat/libavformat.a'
6221 _dep_libavformat='libavformat/libavformat.a'
6222 if win32 ; then
6223 _def_libavformat_win32='#define CONFIG_WIN32 1'
6225 else
6226 if test "$_libavformat_so" = yes ; then
6227 _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6228 test "$_ld_libavformat" || _ld_libavformat='-lavformat'
6229 if win32 ; then
6230 _def_libavformat_win32='#define CONFIG_WIN32 1'
6235 _def_libpostproc='#undef USE_LIBPOSTPROC'
6236 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6237 if test "$_libpostproc" = yes ; then
6238 _def_libpostproc='#define USE_LIBPOSTPROC 1'
6239 _ld_libpostproc='libpostproc/libpostproc.a'
6240 _dep_libpostproc='libpostproc/libpostproc.a'
6241 else
6242 if test "$_libpostproc_so" = yes ; then
6243 _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6244 _ld_libpostproc='-lpostproc'
6248 echocheck "md5sum support"
6249 if test "$_md5sum" = yes; then
6250 _def_md5sum="#define HAVE_MD5SUM"
6251 _vosrc="$_vosrc vo_md5sum.c"
6252 _vomodules="md5sum $_vomodules"
6253 else
6254 _def_md5sum="#undef HAVE_MD5SUM"
6255 _novomodules="md5sum $_novomodules"
6257 echores "$_md5sum"
6259 echocheck "AMR narrowband"
6260 if test "$_amr_nb" = auto ; then
6261 _amr_nb=no
6262 if test -f libavcodec/amr_float/sp_dec.c ; then
6263 if test "$_libavcodec" = yes ; then
6264 _amr_nb=yes
6265 else
6266 _res_comment="libavcodec (static) is required by amr_nb, sorry"
6270 if test "$_amr_nb" = yes ; then
6271 _amr=yes
6272 _def_amr='#define CONFIG_AMR 1'
6273 _def_amr_nb='#define CONFIG_AMR_NB 1'
6274 else
6275 _def_amr_nb='#undef CONFIG_AMR_NB'
6277 echores "$_amr_nb"
6279 echocheck "AMR narrowband, fixed point"
6280 if test "$_amr_nb_fixed" = auto ; then
6281 _amr_nb_fixed=no
6282 if test -f libavcodec/amr/dtx_dec.c ; then
6283 if test "$_libavcodec" = yes ; then
6284 if test "$_amr_nb" = no ; then
6285 _amr_nb_fixed=yes
6286 else
6287 _res_comment="disabled by amr_nb"
6289 else
6290 _res_comment="libavcodec (static) is required by amr_nb-fixed, sorry"
6294 if test "$_amr_nb_fixed" = yes ; then
6295 _amr=yes
6296 _def_amr='#define CONFIG_AMR 1'
6297 _def_amr_nb_fixed='#define CONFIG_AMR_NB_FIXED 1'
6298 else
6299 _def_amr_nb_fixed='#undef CONFIG_AMR_NB_FIXED'
6301 echores "$_amr_nb_fixed"
6303 if test "$_amr_nb" = yes || test "$_amr_nb_fixed" = yes ; then
6304 _codecmodules="amr_nb $_codecmodules"
6305 else
6306 _nocodecmodules="amr_nb $_nocodecmodules"
6309 echocheck "AMR wideband"
6310 if test "$_amr_wb" = auto ; then
6311 _amr_wb=no
6312 if test -f libavcodec/amrwb_float/dec_dtx.c ; then
6313 if test "$_libavcodec" = yes ; then
6314 _amr_wb=yes
6315 else
6316 _res_comment="libavcodec (static) is required by amr_wb, sorry"
6320 if test "$_amr_wb" = yes ; then
6321 _amr=yes
6322 _def_amr='#define CONFIG_AMR 1'
6323 _def_amr_wb='#define CONFIG_AMR_WB 1'
6324 _codecmodules="amr_wb $_codecmodules"
6325 else
6326 _def_amr_wb='#undef CONFIG_AMR_WB'
6327 _nocodecmodules="amr_wb $_nocodecmodules"
6329 echores "$_amr_wb"
6331 echocheck "libdv-0.9.5+"
6332 if test "$_libdv" = auto ; then
6333 _libdv=no
6334 cat > $TMPC <<EOF
6335 #include <libdv/dv.h>
6336 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6338 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6340 if test "$_libdv" = yes ; then
6341 _def_libdv='#define HAVE_LIBDV095 1'
6342 _ld_libdv="-ldv"
6343 _codecmodules="libdv $_codecmodules"
6344 else
6345 _def_libdv='#undef HAVE_LIBDV095'
6346 _nocodecmodules="libdv $_nocodecmodules"
6348 echores "$_libdv"
6350 echocheck "zr"
6351 if test "$_zr" = auto ; then
6352 #36067's seem to identify themselves as 36057PQC's, so the line
6353 #below should work for 36067's and 36057's.
6354 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6355 _zr=yes
6356 else
6357 _zr=no
6360 if test "$_zr" = yes ; then
6361 if test "$_libavcodec" = yes ; then
6362 _def_zr='#define HAVE_ZR 1'
6363 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6364 _vomodules="zr zr2 $_vomodules"
6365 else
6366 _res_comment="libavcodec (static) is required by zr, sorry"
6367 _novomodules="zr $_novomodules"
6368 _def_zr='#undef HAVE_ZR'
6370 else
6371 _def_zr='#undef HAVE_ZR'
6372 _novomodules="zr zr2 $_novomodules"
6374 echores "$_zr"
6376 echocheck "bl"
6377 if test "$_bl" = yes ; then
6378 _def_bl='#define HAVE_BL 1'
6379 _vosrc="$_vosrc vo_bl.c"
6380 _vomodules="bl $_vomodules"
6381 else
6382 _def_bl='#undef HAVE_BL'
6383 _novomodules="bl $_novomodules"
6385 echores "$_bl"
6388 echocheck "XviD 3"
6389 if test "$_xvid3" = auto ; then
6390 cat > $TMPC << EOF
6391 #include <xvid.h>
6392 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
6394 _ld_xvid="$_ld_xvid -lxvidcore"
6395 _xvid3=no
6396 cc_check $_ld_xvid -lxvidcore $_ld_lm && _xvid3=yes
6399 if test "$_xvid3" = yes ; then
6400 _def_xvid3='#define HAVE_XVID3 1'
6401 _codecmodules="xvid3 $_codecmodules"
6402 else
6403 _def_xvid3='#undef HAVE_XVID3'
6404 _nocodecmodules="xvid3 $_nocodecmodules"
6405 _ld_xvid=""
6407 echores "$_xvid3"
6410 echocheck "XviD"
6411 if test "$_xvid" = auto ; then
6412 _xvid=no
6413 _ld_xvid="$_ld_xvid -lxvidcore $_ld_lm"
6414 cat > $TMPC << EOF
6415 #include <xvid.h>
6416 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6418 for _ld_tmp in "$_ld_xvid" "$_ld_xvid $_ld_pthread" ; do
6419 cc_check $_ld_tmp && _ld_xvid="$_ld_tmp" && _xvid=yes && break
6420 done
6423 if test "$_xvid" = yes ; then
6424 _def_xvid='#define HAVE_XVID4 1'
6425 _codecmodules="xvid $_codecmodules"
6426 else
6427 _def_xvid='#undef HAVE_XVID4'
6428 _nocodecmodules="xvid $_nocodecmodules"
6429 _ld_xvid=""
6431 echores "$_xvid"
6433 if test "$_xvid" = yes ; then
6434 echocheck "XviD two pass plugin"
6435 cat > $TMPC << EOF
6436 #include <xvid.h>
6437 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6439 if cc_check $_ld_xvid $_ld_lb ; then
6440 _lavc_xvid=yes
6441 _def_lavc_xvid='#define CONFIG_XVID 1'
6442 else
6443 _lavc_xvid=no
6444 _def_lavc_xvid='#undef CONFIG_XVID'
6446 echores "$_lavc_xvid"
6450 echocheck "x264"
6451 if test "$_x264" = auto ; then
6452 cat > $TMPC << EOF
6453 #include <inttypes.h>
6454 #include <x264.h>
6455 #if X264_BUILD < 53
6456 #error We do not support old versions of x264. Get the latest from SVN.
6457 #endif
6458 int main(void) { x264_encoder_open((void*)0); return 0; }
6460 _ld_x264="$_ld_x264 -lx264 $_ld_pthread"
6461 _x264=no
6462 if cc_check $_ld_x264 $_ld_lm ; then
6463 _x264=yes
6464 elif test "$_x11" = yes && cc_check $_ld_x264 $_ld_x11 $_ld_lm ; then
6465 _x264=yes
6466 _ld_x264="$_ld_x264 $_ld_x11"
6470 if test "$_x264" = yes ; then
6471 _x264=yes
6472 _def_x264='#define HAVE_X264 1'
6473 _def_lavc_x264='#define CONFIG_X264 1'
6474 _codecmodules="x264 $_codecmodules"
6475 else
6476 _x264=no
6477 _ld_x264=''
6478 _def_x264='#undef HAVE_X264'
6479 _def_lavc_x264='#undef CONFIG_X264'
6480 _nocodecmodules="x264 $_nocodecmodules"
6482 echores "$_x264"
6485 echocheck "nut"
6486 if test "$_nut" = auto ; then
6487 cat > $TMPC << EOF
6488 #include <stdio.h>
6489 #include <stdlib.h>
6490 #include <inttypes.h>
6491 #include <nut.h>
6492 int main(void) { (void)nut_error(0); return 0; }
6494 _ld_nut="-lnut"
6495 _nut=no
6496 cc_check $_ld_nut && _nut=yes
6499 if test "$_nut" = yes ; then
6500 _def_nut='#define HAVE_LIBNUT 1'
6501 else
6502 _ld_nut=''
6503 _def_nut='#undef HAVE_LIBNUT'
6505 echores "$_nut"
6508 # mencoder requires (optional) those libs: libmp3lame
6509 if test "$_mencoder" != no ; then
6511 echocheck "libmp3lame (for mencoder)"
6512 _mp3lame=no
6513 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6514 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6515 cat > $TMPC <<EOF
6516 #include <lame/lame.h>
6517 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; }
6519 # Note: libmp3lame usually depends on vorbis
6520 cc_check -lmp3lame $_ld_vorbis $_ld_lm && tmp_run && _mp3lame=yes
6521 if test "$_mp3lame" = yes ; then
6522 _def_mp3lame="#define HAVE_MP3LAME"
6523 _def_lavc_mp3lame="#define CONFIG_MP3LAME 1"
6524 _ld_mp3lame="-lmp3lame $_ld_vorbis"
6525 cat > $TMPC << EOF
6526 #include <lame/lame.h>
6527 int main(void) { int p = STANDARD_FAST; return 0; }
6529 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6530 cat > $TMPC << EOF
6531 #include <lame/lame.h>
6532 int main(void) { int p = MEDIUM_FAST; return 0; }
6534 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6535 echo $_libavencoders | grep -q mp3lame && _lavc_mp3lame=yes || _lavc_mp3lame=no
6536 else
6537 _def_mp3lame='#undef HAVE_MP3LAME'
6539 echores "$_mp3lame"
6543 echocheck "mencoder"
6544 _mencoder_flag='#undef HAVE_MENCODER'
6545 if test "$_mencoder" = yes ; then
6546 _mencoder_flag='#define HAVE_MENCODER'
6547 _def_muxers='#define CONFIG_MUXERS 1'
6548 else
6549 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
6550 _libavencoders="mpeg1video_encoder snow_encoder"
6551 _libavmuxers=""
6553 echores "$_mencoder"
6555 echocheck "fastmemcpy"
6556 # fastmemcpy check is done earlier with tests of CPU & binutils features
6557 if test "$_fastmemcpy" = yes ; then
6558 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6559 else
6560 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6562 echores "$_fastmemcpy"
6564 echocheck "UniquE RAR File Library"
6565 if test "$_unrarlib" = yes ; then
6566 _def_unrarlib='#define USE_UNRARLIB 1'
6567 else
6568 _def_unrarlib='#undef USE_UNRARLIB'
6570 echores "$_unrarlib"
6572 echocheck "TV interface"
6573 if test "$_tv" = yes ; then
6574 _def_tv='#define USE_TV 1'
6575 _inputmodules="tv $_inputmodules"
6576 else
6577 _noinputmodules="tv $_noinputmodules"
6578 _def_tv='#undef USE_TV'
6580 echores "$_tv"
6583 if bsd; then
6584 echocheck "*BSD BrookTree 848 TV interface"
6585 if test "$_tv_bsdbt848" = auto ; then
6586 _tv_bsdbt848=no
6587 if test "$_tv" = yes ; then
6588 cat > $TMPC <<EOF
6589 #include <sys/types.h>
6590 #if defined(__NetBSD__)
6591 #include <dev/ic/bt8xx.h>
6592 #else
6593 #include <machine/ioctl_bt848.h>
6594 #endif
6595 int main(void) { return 0; }
6597 cc_check && _tv_bsdbt848=yes
6600 if test "$_tv_bsdbt848" = yes ; then
6601 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6602 _inputmodules="tv-bsdbt848 $_inputmodules"
6603 else
6604 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6605 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6607 echores "$_tv_bsdbt848"
6608 fi #if bsd
6611 echocheck "Video 4 Linux TV interface"
6612 if test "$_tv_v4l1" = auto ; then
6613 _tv_v4l1=no
6614 if test "$_tv" = yes && linux ; then
6615 cat > $TMPC <<EOF
6616 #include <stdlib.h>
6617 #include <linux/videodev.h>
6618 int main(void) { return 0; }
6620 cc_check && _tv_v4l1=yes
6623 if test "$_tv_v4l1" = yes ; then
6624 _tv_v4l=yes
6625 _def_tv_v4l='#define HAVE_TV_V4L 1'
6626 _def_tv_v4l1='#define HAVE_TV_V4L1 1'
6627 _inputmodules="tv-v4l $_inputmodules"
6628 else
6629 _noinputmodules="tv-v4l1 $_noinputmodules"
6630 _def_tv_v4l='#undef HAVE_TV_V4L'
6632 echores "$_tv_v4l1"
6635 echocheck "Video 4 Linux 2 TV interface"
6636 if test "$_tv_v4l2" = auto ; then
6637 _tv_v4l2=no
6638 if test "$_tv" = yes && linux ; then
6639 cat > $TMPC <<EOF
6640 #include <stdlib.h>
6641 #include <linux/types.h>
6642 #include <linux/videodev2.h>
6643 int main(void) { return 0; }
6645 cc_check && _tv_v4l2=yes
6648 if test "$_tv_v4l2" = yes ; then
6649 _tv_v4l=yes
6650 _def_tv_v4l='#define HAVE_TV_V4L 1'
6651 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6652 _inputmodules="tv-v4l2 $_inputmodules"
6653 else
6654 _noinputmodules="tv-v4l2 $_noinputmodules"
6655 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6657 echores "$_tv_v4l2"
6660 echocheck "Radio interface"
6661 if test "$_radio" = yes ; then
6662 _def_radio='#define USE_RADIO 1'
6663 _inputmodules="radio $_inputmodules"
6664 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
6665 _radio_capture=no
6667 if test "$_radio_capture" = yes ; then
6668 _def_radio_capture="#define USE_RADIO_CAPTURE 1"
6669 else
6670 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6672 else
6673 _noinputmodules="radio $_noinputmodules"
6674 _def_radio='#undef USE_RADIO'
6675 _def_radio_capture="#undef USE_RADIO_CAPTURE"
6676 _radio_capture=no
6678 echores "$_radio"
6679 echocheck "Capture for Radio interface"
6680 echores "$_radio_capture"
6682 echocheck "Video 4 Linux 2 Radio interface"
6683 if test "$_radio_v4l2" = auto ; then
6684 _radio_v4l2=no
6685 if test "$_radio" = yes && linux ; then
6686 cat > $TMPC <<EOF
6687 #include <stdlib.h>
6688 #include <linux/types.h>
6689 #include <linux/videodev2.h>
6690 int main(void) { return 0; }
6692 cc_check && _radio_v4l2=yes
6695 if test "$_radio_v4l2" = yes ; then
6696 _def_radio_v4l2='#define HAVE_RADIO_V4L2 1'
6697 else
6698 _def_radio_v4l2='#undef HAVE_RADIO_V4L2'
6700 echores "$_radio_v4l2"
6702 echocheck "Video 4 Linux Radio interface"
6703 if test "$_radio_v4l" = auto ; then
6704 _radio_v4l=no
6705 if test "$_radio" = yes && linux ; then
6706 cat > $TMPC <<EOF
6707 #include <stdlib.h>
6708 #include <linux/videodev.h>
6709 int main(void) { return 0; }
6711 cc_check && _radio_v4l=yes
6714 if test "$_radio_v4l" = yes ; then
6715 _def_radio_v4l='#define HAVE_RADIO_V4L 1'
6716 else
6717 _def_radio_v4l='#undef HAVE_RADIO_V4L'
6719 echores "$_radio_v4l"
6721 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && test "$_radio" = yes ; then
6722 die "Radio driver requires V4L or V4L2!"
6725 echocheck "Video 4 Linux 2 MPEG PVR interface"
6726 if test "$_pvr" = auto ; then
6727 _pvr=no
6728 if test "$_tv_v4l2" = yes && linux ; then
6729 cat > $TMPC <<EOF
6730 #include <stdlib.h>
6731 #include <inttypes.h>
6732 #include <linux/types.h>
6733 #include <linux/videodev2.h>
6734 int main(void) { struct v4l2_ext_controls ext; return 0; }
6736 cc_check && _pvr=yes
6739 if test "$_pvr" = yes ; then
6740 _def_pvr='#define HAVE_PVR 1'
6741 _inputmodules="pvr $_inputmodules"
6742 else
6743 _noinputmodules="pvr $_noinputmodules"
6744 _def_pvr='#undef HAVE_PVR'
6746 echores "$_pvr"
6749 echocheck "audio select()"
6750 if test "$_select" = no ; then
6751 _def_select='#undef HAVE_AUDIO_SELECT'
6752 elif test "$_select" = yes ; then
6753 _def_select='#define HAVE_AUDIO_SELECT 1'
6755 echores "$_select"
6758 echocheck "network"
6759 # FIXME network check
6760 if test "$_network" = yes ; then
6761 _def_network='#define MPLAYER_NETWORK 1'
6762 _ld_network="$_ld_sock"
6763 _inputmodules="network $_inputmodules"
6764 else
6765 _noinputmodules="network $_noinputmodules"
6766 _def_network='#undef MPLAYER_NETWORK'
6767 _ftp=no
6769 echores "$_network"
6771 echocheck "ftp"
6772 if not beos && test "$_ftp" = yes ; then
6773 _def_ftp='#define HAVE_FTP 1'
6774 _inputmodules="ftp $_inputmodules"
6775 else
6776 _noinputmodules="ftp $_noinputmodules"
6777 _def_ftp='#undef HAVE_FTP'
6779 echores "$_ftp"
6781 echocheck "vstream client"
6782 if test "$_vstream" = auto ; then
6783 _vstream=no
6784 cat > $TMPC <<EOF
6785 #include <vstream-client.h>
6786 void vstream_error(const char *format, ... ) {}
6787 int main(void) { vstream_start(); return 0; }
6789 cc_check -lvstream-client && _vstream=yes
6791 if test "$_vstream" = yes ; then
6792 _def_vstream='#define HAVE_VSTREAM 1'
6793 _inputmodules="vstream $_inputmodules"
6794 _ld_vstream='-lvstream-client'
6795 else
6796 _noinputmodules="vstream $_noinputmodules"
6797 _def_vstream='#undef HAVE_VSTREAM'
6799 echores "$_vstream"
6801 # endian testing
6802 echocheck "byte order"
6803 if test "$_big_endian" = auto ; then
6804 cat > $TMPC <<EOF
6805 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6806 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6807 int main(){
6808 return (int)ascii_name;
6811 if cc_check ; then
6812 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6813 _big_endian=yes
6814 else
6815 _big_endian=no
6817 else
6818 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
6821 if test "$_big_endian" = yes ; then
6822 _byte_order='big-endian'
6823 _def_words_endian='#define WORDS_BIGENDIAN 1'
6824 else
6825 _byte_order='little-endian'
6826 _def_words_endian='#undef WORDS_BIGENDIAN'
6828 echores "$_byte_order"
6830 echocheck "OSD menu"
6831 if test "$_menu" = yes ; then
6832 _def_menu='#define HAVE_MENU 1'
6833 else
6834 _def_menu='#undef HAVE_MENU'
6836 echores "$_menu"
6839 echocheck "QuickTime codecs"
6840 if test "$_qtx" = auto ; then
6841 test "$_win32" = yes || darwin && _qtx=yes
6843 if test "$_qtx" = yes ; then
6844 _def_qtx='#define USE_QTX_CODECS 1'
6845 _codecmodules="qtx $_codecmodules"
6846 else
6847 _def_qtx='#undef USE_QTX_CODECS'
6848 _nocodecmodules="qtx $_nocodecmodules"
6850 echores "$_qtx"
6853 echocheck "Subtitles sorting"
6854 if test "$_sortsub" = yes ; then
6855 _def_sortsub='#define USE_SORTSUB 1'
6856 else
6857 _def_sortsub='#undef USE_SORTSUB'
6859 echores "$_sortsub"
6862 echocheck "XMMS inputplugin support"
6863 if test "$_xmms" = yes ; then
6865 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6866 if test -z "$_xmmsplugindir" ; then
6867 _xmmsplugindir=`xmms-config --input-plugin-dir`
6869 if test -z "$_xmmslibdir" ; then
6870 _xmmslibdir=`xmms-config --exec-prefix`/lib
6872 else
6873 if test -z "$_xmmsplugindir" ; then
6874 _xmmsplugindir=/usr/lib/xmms/Input
6876 if test -z "$_xmmslibdir" ; then
6877 _xmmslibdir=/usr/lib
6881 _def_xmms='#define HAVE_XMMS 1'
6882 if darwin ; then
6883 _xmms_lib="${_xmmslibdir}/libxmms.dylib"
6884 else
6885 _xmms_lib="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6887 else
6888 _def_xmms='#undef HAVE_XMMS'
6890 echores "$_xmms"
6892 echocheck "inet6"
6893 if test "$_inet6" = auto ; then
6894 cat > $TMPC << EOF
6895 #include <sys/types.h>
6896 #include <sys/socket.h>
6897 #include <netinet/in.h>
6898 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6900 _inet6=no
6901 if cc_check ; then
6902 _inet6=yes
6905 if test "$_inet6" = yes ; then
6906 _def_inet6='#define HAVE_AF_INET6 1'
6907 else
6908 _def_inet6='#undef HAVE_AF_INET6'
6910 echores "$_inet6"
6913 echocheck "gethostbyname2"
6914 if test "$_gethostbyname2" = auto ; then
6915 cat > $TMPC << EOF
6916 #include <sys/types.h>
6917 #include <sys/socket.h>
6918 #include <netdb.h>
6919 int main(void) { gethostbyname2("", AF_INET); }
6921 _gethostbyname2=no
6922 if cc_check ; then
6923 _gethostbyname2=yes
6927 if test "$_gethostbyname2" = yes ; then
6928 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6929 else
6930 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6932 echores "$_gethostbyname2"
6935 # --------------- GUI specific tests begin -------------------
6936 echocheck "GUI"
6937 echo "$_gui"
6938 if test "$_gui" = yes ; then
6940 # Required libraries
6941 test "$_png" != yes && die "The GUI requires PNG support, please install libpng and libpng-dev packages."
6942 if not win32 ; then
6943 test "$_x11" != yes && die "X11 support required for GUI compilation."
6945 echocheck "XShape extension"
6946 if test "$_xshape" = auto ; then
6947 _xshape=no
6948 cat > $TMPC << EOF
6949 #include <X11/Xlib.h>
6950 #include <X11/Xproto.h>
6951 #include <X11/Xutil.h>
6952 #include <X11/extensions/shape.h>
6953 #include <stdlib.h>
6954 int main(void) {
6955 char *name = ":0.0";
6956 Display *wsDisplay;
6957 int exitvar = 0;
6958 int eventbase, errorbase;
6959 if (getenv("DISPLAY"))
6960 name=getenv("DISPLAY");
6961 wsDisplay=XOpenDisplay(name);
6962 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6963 exitvar=1;
6964 XCloseDisplay(wsDisplay);
6965 return exitvar;
6968 cc_check $_ld_x11 && _xshape=yes
6970 if test "$_xshape" = yes ; then
6971 _def_xshape='#define HAVE_XSHAPE 1'
6972 else
6973 die "The GUI requires the X11 extension XShape (which was not found)."
6975 echores "$_xshape"
6977 #Check for GTK
6978 if test "$_gtk1" = no ; then
6979 #Check for GTK2 :
6980 echocheck "GTK+ version"
6982 if $_pkg_config gtk+-2.0 --exists ; then
6983 _gtk=`$_pkg_config gtk+-2.0 --modversion 2>/dev/null`
6984 _inc_extra="$_inc_extra `$_pkg_config gtk+-2.0 --cflags 2>/dev/null`"
6985 _ld_gtk=`$_pkg_config gtk+-2.0 --libs 2>/dev/null`
6986 echores "$_gtk"
6988 # Check for GLIB2
6989 if $_pkg_config glib-2.0 --exists ; then
6990 echocheck "glib version"
6991 _glib=`$_pkg_config glib-2.0 --modversion 2>/dev/null`
6992 _ld_glib=`$_pkg_config glib-2.0 --libs 2>/dev/null`
6993 echores "$_glib"
6995 _def_gui='#define HAVE_NEW_GUI 1'
6996 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
6997 else
6998 _gtk1=yes
6999 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7001 else
7002 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7003 _gtk1=yes
7007 if test "$_gtk1" = yes ; then
7008 # Check for old GTK (1.2.x)
7009 echocheck "GTK version"
7010 if test -z "$_gtkconfig" ; then
7011 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7012 _gtkconfig="gtk-config"
7013 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7014 _gtkconfig="gtk12-config"
7015 else
7016 die "The GUI requires GTK devel packages (which were not found)."
7019 _gtk=`$_gtkconfig --version 2>&1`
7020 _inc_extra="$_inc_extra `$_gtkconfig --cflags 2>&1`"
7021 _ld_gtk=`$_gtkconfig --libs 2>&1`
7022 echores "$_gtk (using $_gtkconfig)"
7024 # Check for GLIB
7025 echocheck "glib version"
7026 if test -z "$_glibconfig" ; then
7027 if ( glib-config --version ) >/dev/null 2>&1 ; then
7028 _glibconfig="glib-config"
7029 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7030 _glibconfig="glib12-config"
7031 else
7032 die "The GUI requires GLIB devel packages (which were not found)"
7035 _glib=`$_glibconfig --version 2>&1`
7036 _ld_glib=`$_glibconfig --libs 2>&1`
7037 echores "$_glib (using $_glibconfig)"
7039 _def_gui='#define HAVE_NEW_GUI 1'
7040 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7043 else #if not win32
7044 _ld_win32libs="-lcomdlg32 -lcomctl32 -lshell32 -lkernel32 $_ld_win32libs"
7045 _def_gui='#define HAVE_NEW_GUI 1'
7046 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7047 fi #if not win32
7049 else #if test "$_gui"
7050 _def_gui='#undef HAVE_NEW_GUI'
7051 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7052 fi #if test "$_gui"
7053 # --------------- GUI specific tests end -------------------
7056 if test "$_charset" = "noconv" ; then
7057 _charset=""
7059 if test "$_charset" ; then
7060 _def_charset="#define MSG_CHARSET \"$_charset\""
7061 else
7062 _def_charset="#undef MSG_CHARSET"
7065 if test "$_charset" = "UTF-8" ; then
7066 # hack to disable conversion in the Makefile
7067 _charset=""
7070 if test "$_charset" ; then
7071 echocheck "iconv program"
7072 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7073 if test "$?" -ne 0 ; then
7074 echores "no"
7075 echo "No working iconv program found, use "
7076 echo "--charset=UTF-8 to continue anyway."
7077 echo "If you also have problems with iconv library functions use --charset=noconv."
7078 echo "Messages in the GTK-2 interface will be broken then."
7079 exit 1
7080 else
7081 echores "yes"
7085 #############################################################################
7087 echocheck "automatic gdb attach"
7088 if test "$_crash_debug" = yes ; then
7089 _def_crash_debug='#define CRASH_DEBUG 1'
7090 else
7091 _def_crash_debug='#undef CRASH_DEBUG'
7092 _crash_debug=no
7094 echores "$_crash_debug"
7096 if darwin ; then
7097 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN -shared-libgcc"
7098 if x86 ; then
7099 CFLAGS="$CFLAGS -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
7101 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7102 CFLAGS="$CFLAGS -no-cpp-precomp"
7105 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
7106 test "$_altivec" = yes && CFLAGS="$CFLAGS -DCONFIG_DARWIN"
7108 if hpux ; then
7109 # use flag for HPUX missing setenv()
7110 CFLAGS="$CFLAGS -DHPUX"
7112 # Thread support
7113 if linux ; then
7114 CFLAGS="$CFLAGS -D_REENTRANT"
7115 elif bsd ; then
7116 # FIXME bsd needs this so maybe other OS'es
7117 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7119 # 64 bit file offsets?
7120 if test "$_largefiles" = yes || freebsd ; then
7121 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7122 if test "$_dvdread" = yes ; then
7123 # dvdread support requires this (for off64_t)
7124 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7128 echocheck "compiler support for noexecstack"
7129 cat > $TMPC <<EOF
7130 int main(void) { return 0; }
7132 if cc_check -Wl,-z,noexecstack ; then
7133 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7134 echores "yes"
7135 else
7136 echores "no"
7139 if cc_check -Wdeclaration-after-statement ; then
7140 CFLAGS="-Wdeclaration-after-statement $CFLAGS"
7143 echocheck "ftello()"
7144 # if we don't have ftello use the osdep/ compatibility module
7145 cat > $TMPC << EOF
7146 #include <stdio.h>
7147 #include <sys/types.h>
7148 int main (void) { ftello(stdin); return 0; }
7150 _ftello=no
7151 cc_check && _ftello=yes
7152 if test "$_ftello" = yes ; then
7153 _def_ftello='#define HAVE_FTELLO 1'
7154 else
7155 _def_ftello='#undef HAVE_FTELLO'
7157 echores "$_ftello"
7159 # Determine OS dependent libs
7160 if cygwin ; then
7161 _def_confwin32='#define WIN32'
7162 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
7163 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
7164 CFLAGS="$CFLAGS -D__CYGWIN__"
7167 if win32 ; then
7168 _confwin32='TARGET_WIN32 = yes'
7169 else
7170 _confwin32='TARGET_WIN32 = no'
7173 # Dynamic linking flags
7174 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7175 _ld_dl_dynamic=''
7176 bsd && _ld_dl_dynamic='-rdynamic'
7177 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7178 _ld_dl_dynamic='-rdynamic'
7181 _ld_arch="$_ld_arch $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7182 bsdos && _ld_arch="$_ld_arch -ldvd"
7183 if netbsd ; then
7184 x86 && _ld_arch="$_ld_arch -li386"
7187 _def_debug='#undef MP_DEBUG'
7188 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7190 _def_linux='#undef TARGET_LINUX'
7191 linux && _def_linux='#define TARGET_LINUX 1'
7193 # TODO cleanup the VIDIX stuff here
7194 echocheck "VIDIX (internal)"
7195 echores "$_vidix_internal"
7197 echocheck "VIDIX (external)"
7198 if test "$_vidix_external" = auto; then
7199 _vidix_external=no
7200 cat > $TMPC <<EOF
7201 #include <vidix/vidix.h>
7202 int main(void) { return 0; }
7204 cc_check -lvidix && _vidix_external=yes
7206 echores "$_vidix_external"
7208 if test "$_vidix_internal" = yes || test "$_vidix_external" = yes ; then
7209 _vidix=yes
7210 _def_vidix='#define CONFIG_VIDIX 1'
7211 else
7212 _vidix=no
7213 _def_vidix='#undef CONFIG_VIDIX'
7216 if test "$_vidix_internal" = yes ; then
7217 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
7218 elif test "$_vidix_external" = yes ; then
7219 _ld_vidix_external="-lvidix"
7220 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
7223 if test "$_vidix" = yes; then
7224 _vosrc="$_vosrc vo_cvidix.c"
7225 _vomodules="cvidix $_vomodules"
7226 else
7227 _novomodules="cvidix $_novomodules"
7229 if test "$_vidix" = yes && win32; then
7230 _vosrc="$_vosrc vo_winvidix.c"
7231 _vomodules="winvidix $_vomodules"
7232 _ld_win32libs="-lgdi32 $_ld_win32libs"
7233 else
7234 _novomodules="winvidix $_novomodules"
7236 if test "$_vidix" = yes && test "$_x11" = yes; then
7237 _vosrc="$_vosrc vo_xvidix.c"
7238 _vomodules="xvidix $_vomodules"
7239 else
7240 _novomodules="xvidix $_novomodules"
7243 echocheck "joystick"
7244 _def_joystick='#undef HAVE_JOYSTICK'
7245 if test "$_joystick" = yes ; then
7246 if linux ; then
7247 # TODO add some check
7248 _def_joystick='#define HAVE_JOYSTICK 1'
7249 else
7250 _joystick="no (unsupported under $system_name)"
7253 echores "$_joystick"
7255 echocheck "lirc"
7256 if test "$_lirc" = auto ; then
7257 _lirc=no
7258 cat > $TMPC <<EOF
7259 #include <lirc/lirc_client.h>
7260 int main(void) { return 0; }
7262 cc_check -llirc_client && _lirc=yes
7264 if test "$_lirc" = yes ; then
7265 _def_lirc='#define HAVE_LIRC 1'
7266 _ld_lirc='-llirc_client'
7267 else
7268 _def_lirc='#undef HAVE_LIRC'
7270 echores "$_lirc"
7272 echocheck "lircc"
7273 if test "$_lircc" = auto ; then
7274 _lircc=no
7275 cat > $TMPC <<EOF
7276 #include <lirc/lircc.h>
7277 int main(void) { return 0; }
7279 cc_check -llircc && _lircc=yes
7281 if test "$_lircc" = yes ; then
7282 _def_lircc='#define HAVE_LIRCC 1'
7283 _ld_lircc='-llircc'
7284 else
7285 _def_lircc='#undef HAVE_LIRCC'
7287 echores "$_lircc"
7289 if arm; then
7290 # Detect maemo development platform libraries availability (http://www.maemo.org),
7291 # they are used when run on Nokia 770
7292 echocheck "maemo (Nokia 770)"
7293 if test "$_maemo" = auto ; then
7294 _maemo=no
7295 cat > $TMPC << EOF
7296 #include <libosso.h>
7297 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7299 cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
7301 if test "$_maemo" = yes ; then
7302 _def_maemo='#define HAVE_MAEMO 1'
7303 _inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
7304 _ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
7305 else
7306 _def_maemo='#undef HAVE_MAEMO'
7308 echores "$_maemo"
7311 echocheck "color console output"
7312 if test "$_color_console" = yes ; then
7313 _def_color_console='#define MSG_USE_COLORS 1'
7314 else
7315 _def_color_console='#undef MSG_USE_COLORS'
7317 echores "$_color_console"
7319 #############################################################################
7320 echo "Creating config.mak"
7321 cat > config.mak << EOF
7322 # -------- Generated by configure -----------
7324 LANG = C
7325 MAN_LANG = $MAN_LANG
7326 TARGET_OS = $system_name
7327 DESTDIR =
7328 prefix = \$(DESTDIR)$_prefix
7329 BINDIR = \$(DESTDIR)$_bindir
7330 DATADIR = \$(DESTDIR)$_datadir
7331 MANDIR = \$(DESTDIR)$_mandir
7332 CONFDIR = \$(DESTDIR)$_confdir
7333 LIBDIR = \$(DESTDIR)$_libdir
7334 # FFmpeg uses libdir instead of LIBDIR
7335 libdir = \$(LIBDIR)
7336 #AR = ar
7337 CC = $_cc
7338 HOST_CC = $_host_cc
7339 AWK = $_awk
7340 RANLIB = $_ranlib
7341 INSTALL = $_install
7342 # FIXME: Should only be _inc_extra eventually.
7343 EXTRA_INC = $_inc_extra
7344 OPTFLAGS = $CFLAGS \$(EXTRA_INC)
7345 STRIPBINARIES = $_stripbinaries
7346 CHARSET = $_charset
7347 HELP_FILE = $_mp_help
7349 EXESUF = $_exesuf
7351 MPLAYER_NETWORK = $_network
7352 FTP = $_ftp
7353 STREAMING_LIVE555 = $_live
7354 VSTREAM = $_vstream
7355 STREAM_CACHE = yes
7356 DVBIN = $_dvbin
7357 VIDIX = $_vidix_internal
7358 EXTERNAL_VIDIX = $_vidix_external
7359 CONFIG_PP = yes
7360 CONFIG_MP3LAME = $_mp3lame
7361 LIBMENU = $_menu
7363 MP3LIB = $_mp3lib
7364 LIBA52 = $_liba52
7365 LIBMPEG2 = $_libmpeg2
7366 TREMOR_INTERNAL = $_tremor_internal
7367 TREMOR_FLAGS = $_tremor_flags
7368 FAAD = $_faad
7370 SPEEX = $_speex
7371 MUSEPACK = $_musepack
7373 UNRARLIB = $_unrarlib
7374 PNG = $_png
7375 JPEG = $_jpeg
7376 GIF = $_gif
7378 EXTRALIBS = $_extra_libs
7379 EXTRA_LIB = $_ld_extra $_ld_live $_ld_vstream $_ld_network $_ld_enca \
7380 $_ld_static $_ld_zlib $_ld_termcap $_ld_lirc $_ld_lircc $_ld_win32 \
7381 $_ld_win32libs $_ld_lm $_ld_libC $_ld_fribidi $_ld_smb $_ld_gif \
7382 $_ld_libcdio $_ld_dvdread $_ld_dvdnav $_macosx_frameworks $_ld_cdparanoia \
7383 $_ld_xvid $_ld_x264 $_ld_mp3lame $_ld_libdts $_ld_mad \
7384 $_ld_vorbis $_ld_libdv $_ld_theora $_ld_faad $_ld_speex $_xmms_lib \
7385 $_toolame_lib $_twolame_lib $_ld_faac $_ld_musepack $_ld_liblzo $_ld_png \
7386 $_ld_jpeg $_ld_alsa $_ld_nut $_ld_arch $_ld_iconv $_ld_mlib
7387 VO_LIBS = $_ld_aa $_ld_sdl $_ld_ggi $_ld_svga $_ld_directfb $_ld_caca \
7388 $_ld_vesa $_ld_vidix_external $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm \
7389 $_ld_xinerama $_ld_x11 $_ld_sock
7390 AO_LIBS = $_ld_arts $_ld_esd $_ld_jack $_ld_openal $_ld_nas $_ld_sgiaudio \
7391 $_ld_polyp
7392 ENCORE_LIB = $_ld_mp3lame
7393 LAVC_MP3LAME = $_lavc_mp3lame
7394 FREETYPE_LIB = $_ld_freetype
7395 FONTCONFIG_LIB = $_ld_fontconfig
7396 GTK_LIBS = $_ld_static $_ld_gtk $_ld_glib
7398 HAVE_MLIB = $_mlib
7399 HAVE_PTHREADS = $_pthreads
7401 HAVE_XVMC_ACCEL = $_xvmc
7403 # for FFmpeg
7404 SRC_PATH=..
7405 BUILD_ROOT=..
7406 LIBPREF=lib
7407 LIBSUF=.a
7408 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7410 # audio output
7411 OSS = $_ossaudio
7412 ALSA = $_alsa
7413 ALSA5 = $_alsa5
7414 ALSA9 = $_alsa9
7415 ALSA1X = $_alsa1x
7417 # input/demuxer/codecs
7418 JOYSTICK = $_joystick
7419 LIRC = $_lirc
7420 TV = $_tv
7421 TV_V4L = $_tv_v4l
7422 TV_V4L1 = $_tv_v4l1
7423 TV_V4L2 = $_tv_v4l2
7424 TV_BSDBT848 = $_tv_bsdbt848
7425 PVR = $_pvr
7426 VCD = $_vcd
7427 DVDREAD = $_dvdread
7428 DVDREAD_INTERNAL = $_dvdread_internal
7429 DVDNAV = $_dvdnav
7430 WIN32DLL = $_win32
7431 W32_DEP = $_dep_win32
7432 QTX_CODECS = $_qtx
7433 REAL_CODECS = $_real
7434 XANIM_CODECS = $_xanim
7435 AV_DEP = $_dep_libavformat $_dep_libavcodec $_dep_libavutil $_dep_libpostproc
7436 AV_LIB = $_ld_libavformat $_ld_libavcodec $_ld_libavutil $_ld_libpostproc
7437 CONFIG_LIBAVUTIL = $_libavutil
7438 CONFIG_LIBAVUTIL_SO = $_libavutil_so
7439 CONFIG_LIBAVCODEC = $_libavcodec
7440 CONFIG_LIBAVCODEC_SO = $_libavcodec_so
7441 CONFIG_LIBAVFORMAT = $_libavformat
7442 CONFIG_LIBAVFORMAT_SO = $_libavformat_so
7443 CONFIG_LIBPOSTPROC = $_libpostproc
7444 CONFIG_LIBPOSTPROC_SO = $_libpostproc_so
7445 ZORAN = $_zr
7446 LIBDV = $_libdv
7447 XVID3 = $_xvid3
7448 XVID4 = $_xvid
7449 X264 = $_x264
7450 LIBNUT = $_nut
7451 CONFIG_DTS = $_libdts
7452 MENCODER = $_mencoder
7453 CDDA = $_cdda
7454 BITMAP_FONT = $_bitmap_font
7455 FREETYPE = $_freetype
7456 CONFIG_ASS = $_ass
7457 LIBMAD = $_mad
7458 LIBVORBIS = $_vorbis
7459 LIBTHEORA = $_theora
7460 FAAD_INTERNAL = $_faad_internal
7461 FAAD_FIXED = $_faad_fixed
7462 LIBSMBCLIENT = $_smbsupport
7463 XMMS_PLUGINS = $_xmms
7464 MACOSX = $_macosx
7465 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7466 MACOSX_BUNDLE = $_macosx_bundle
7467 MACOSX_COREVIDEO = $_macosx_corevideo
7468 TOOLAME=$_toolame
7469 TWOLAME=$_twolame
7470 FAAC=$_faac
7471 CONFIG_AMR=$_amr
7472 CONFIG_AMR_NB=$_amr_nb
7473 CONFIG_AMR_NB_FIXED=$_amr_nb_fixed
7474 CONFIG_AMR_WB=$_amr_wb
7475 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7476 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7477 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7478 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7479 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7480 CONFIG_FAAC=$_faac
7481 CONFIG_XVID=$_lavc_xvid
7482 CONFIG_X264=$_x264
7483 CONFIG_GPL=yes
7484 CONFIG_ENCODERS=$_mencoder
7485 CONFIG_MUXERS=$_mencoder
7486 RADIO=$_radio
7487 RADIO_CAPTURE=$_radio_capture
7489 # --- Some stuff for autoconfigure ----
7490 $_target_arch
7491 $_target_arch_x86
7492 $_confwin32
7493 TARGET_CPU=$iproc
7494 TARGET_MMX = $_mmx
7495 TARGET_MMX2 = $_mmxext
7496 TARGET_3DNOW = $_3dnow
7497 TARGET_3DNOWEX = $_3dnowext
7498 TARGET_SSE = $_sse
7499 TARGET_CMOV = $_cmov
7500 TARGET_ALTIVEC = $_altivec
7501 TARGET_ARMV5TE = $_armv5te
7502 TARGET_IWMMXT = $_iwmmxt
7503 TARGET_VIS = $_vis
7504 TARGET_BUILTIN_VECTOR = $_builtin_vector
7505 TARGET_BUILTIN_3DNOW = $_mm3dnow
7507 # --- GUI stuff ---
7508 GUI = $_gui
7510 # --- libvo stuff ---
7511 VO_SRCS = $_vosrc
7513 # --- libao2 stuff ---
7514 AO_SRCS = $_aosrc
7516 # --- libaf stuff ---
7517 AF_SRCS = $_afsrc
7521 #############################################################################
7522 echo "Creating config.h"
7523 cat > config.h << EOF
7524 /* -------- This file has been automatically generated by configure ---------
7525 Note: Any changes in it will be lost when you run configure again. */
7527 /* Protect against multiple inclusion */
7528 #ifndef MPLAYER_CONFIG_H
7529 #define MPLAYER_CONFIG_H 1
7531 /* use GNU internationalization */
7532 $_def_i18n
7534 /* name of messages charset */
7535 $_def_charset
7537 /* Runtime CPU detection */
7538 $_def_runtime_cpudetection
7540 /* Dynamic a/v plugins */
7541 $_def_dynamic_plugins
7543 /* "restrict" keyword */
7544 $_def_restrict_keyword
7546 /* __builtin_expect branch prediction hint */
7547 $_def_builtin_expect
7548 #ifdef HAVE_BUILTIN_EXPECT
7549 #define likely(x) __builtin_expect ((x) != 0, 1)
7550 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7551 #else
7552 #define likely(x) (x)
7553 #define unlikely(x) (x)
7554 #endif
7556 /* attribute(used) as needed by some compilers */
7557 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7558 # define attribute_used __attribute__((used))
7559 #else
7560 # define attribute_used
7561 #endif
7563 /* compiler support for named assembler arguments */
7564 $_def_named_asm_args
7566 #define PREFIX "$_prefix"
7568 #define USE_OSD 1
7569 #define USE_SUB 1
7571 /* enable/disable SIGHANDLER */
7572 $_def_sighandler
7574 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7575 $_def_crash_debug
7577 /* Toggles debugging informations */
7578 $_def_debug
7580 /* Toggles color console output */
7581 $_def_color_console
7583 /* Indicates that libcdio is available for VCD and CD-DA playback */
7584 $_def_libcdio
7586 /* Indicates that Ogle's libdvdread is available for DVD playback */
7587 $_def_dvdread
7589 /* Indicates that dvdread is internal */
7590 $_def_dvdread_internal
7592 /* Additional options for libdvdread/libdvdcss */
7593 $_def_dvd
7594 $_def_cdrom
7595 $_def_cdio
7596 $_def_dvdio
7597 $_def_bsdi_dvd
7598 $_def_dvd_bsd
7599 $_def_dvd_linux
7600 $_dev_dvd_openbsd
7601 $_def_dvd_darwin
7602 $_def_sol_scsi_h
7603 $_def_hpux_scsi_h
7604 $_def_stddef
7606 /* Common data directory (for fonts, etc) */
7607 #define MPLAYER_DATADIR "$_datadir"
7608 #define MPLAYER_CONFDIR "$_confdir"
7609 #define MPLAYER_LIBDIR "$_libdir"
7611 /* Define this to compile stream-caching support, it can be enabled via
7612 -cache <kilobytes> */
7613 #define USE_STREAM_CACHE 1
7615 /* Define if you are using XviD library */
7616 $_def_xvid3
7617 $_def_xvid
7619 /* Define if you are using the X.264 library */
7620 $_def_x264
7622 /* Define if you are using libnut */
7623 $_def_nut
7625 /* Define to include support for libdv-0.9.5 */
7626 $_def_libdv
7628 /* If build mencoder */
7629 $_mencoder_flag
7631 /* Indicates if libmp3lame is available
7632 Note: for mencoder */
7633 $_def_mp3lame
7634 $_def_mp3lame_preset
7635 $_def_mp3lame_preset_medium
7637 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7638 (use -bps or -nobps commandline option for run-time method selection)
7639 -bps gives better sync for vbr mp3 audio, it is now default */
7640 #define AVI_SYNC_BPS 1
7642 /* Undefine this if you do not want to select mono audio (left or right)
7643 with a stereo MPEG layer 2/3 audio stream. The command line option
7644 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7645 right-only), with 0 being the default.
7647 #define USE_FAKE_MONO 1
7649 /* Undefine this if your sound card driver has no working select().
7650 If you have kernel Oops, player hangups, or just no audio, you should
7651 try to recompile MPlayer with this option disabled! */
7652 $_def_select
7654 /* define this to use iconv(3) function to codepage conversions */
7655 $_def_iconv
7657 /* define this to use nl_langinfo function */
7658 $_def_langinfo
7660 /* define this to use RTC (/dev/rtc) for video timers */
7661 $_def_rtc
7663 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7664 #define MAX_OUTBURST 65536
7666 /* set up audio OUTBURST. Do not change this! */
7667 #define OUTBURST 512
7669 /* Define this if your system has the header file for the OSS sound interface */
7670 $_def_sys_soundcard
7672 /* Define this if your system has the header file for the OSS sound interface
7673 * in /usr/include */
7674 $_def_soundcard
7676 /* Define this if your system has the sysinfo header */
7677 $_def_sys_sysinfo
7679 /* Define this if your system has ftello() */
7681 $_def_ftello
7682 #ifndef HAVE_FTELLO
7683 /* Need these for FILE and off_t an config.h is usually before other includes*/
7684 #include <stdio.h>
7685 #include <sys/types.h>
7686 off_t ftello(FILE *);
7687 #endif
7689 /* Define this if your system has the "malloc.h" header file */
7690 $_def_malloc
7692 /* memalign is mapped to malloc if unsupported */
7693 $_def_memalign
7694 $_def_map_memalign
7695 $_def_memalign_hack
7697 /* assembler handling of .align */
7698 $_def_asmalign_pot
7700 /* Define this if your system has the "alloca.h" header file */
7701 $_def_alloca
7703 /* Define this if your system has the "sys/mman.h" header file */
7704 $_def_mman
7705 $_def_mman_has_map_failed
7707 /* Define this if you have the elf dynamic linker -ldl library */
7708 $_def_dl
7710 /* Define this if you have the kstat kernel statistics library */
7711 $_def_kstat
7713 /* Define this if you have zlib */
7714 $_def_zlib
7715 #ifdef HAVE_ZLIB
7716 #define CONFIG_ZLIB 1
7717 #endif
7719 /* Define this if you have shm support */
7720 $_def_shm
7722 /* Define this if your system has scandir & alphasort */
7723 $_def_scandir
7725 /* Define this if your system has strsep */
7726 $_def_strsep
7728 /* Define this if your system has strlcpy */
7729 $_def_strlcpy
7730 #ifndef HAVE_STRLCPY
7731 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7732 #endif
7734 /* Define this if your system has strlcat */
7735 $_def_strlcat
7736 #ifndef HAVE_STRLCAT
7737 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7738 #endif
7740 /* Define this if your system has fseeko */
7741 $_def_fseeko
7742 #ifndef HAVE_FSEEKO
7743 /* Need these for FILE and off_t an config.h is usually before other includes*/
7744 #include <stdio.h>
7745 #include <sys/types.h>
7746 int fseeko(FILE *, off_t, int);
7747 #endif
7749 $_def_localtime_r
7751 /* Define this if your system has vsscanf */
7752 $_def_vsscanf
7754 /* Define this if your system has swab */
7755 $_def_swab
7757 /* Define this if your system has no posix select */
7758 $_def_no_posix_select
7760 /* Define this if your system has gettimeofday */
7761 $_def_gettimeofday
7763 /* Define this if your system has glob */
7764 $_def_glob
7766 /* Define this if your system has setenv */
7767 $_def_setenv
7768 #ifndef HAVE_SETENV
7769 int setenv(const char *name, const char *val, int overwrite);
7770 #endif
7772 /* Define this if your system has sysi86 */
7773 $_def_sysi86
7775 /* Define this if your system has pthreads */
7776 $_def_pthreads
7778 /* Define this if you enabled thread support for libavcodec */
7779 $_def_threads
7781 /* LIRC (remote control, see www.lirc.org) support: */
7782 $_def_lirc
7784 /* Support for maemo (http://www.maemo.org) */
7785 $_def_maemo
7788 * LIRCCD (LIRC client daemon)
7789 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7791 $_def_lircc
7793 /* DVD navigation support using libdvdnav */
7794 $_def_dvdnav
7795 $_def_dvdnav_version
7797 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7798 #define MPEG12_POSTPROC 1
7800 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7801 $_def_libpostproc
7802 $_def_libpostproc_so
7804 /* Win32 DLL support */
7805 $_def_win32
7806 #define WIN32_PATH "$_win32codecsdir"
7808 /* Mac OS X specific features */
7809 $_def_macosx
7810 $_def_macosx_finder_support
7811 $_def_macosx_bundle
7812 $_def_macosx_corevideo
7814 /* Build our Win32-loader */
7815 $_def_win32_loader
7817 /* ffmpeg's libavcodec support (requires libavcodec source) */
7818 $_def_libavcodec
7819 $_def_libavcodec_so
7820 $_def_lavc_dsputil
7821 $_def_libavcodec_mpegaudio_hp
7823 /* ffmpeg's libavformat support (requires libavformat source) */
7824 $_def_libavformat
7825 $_def_libavformat_so
7826 $_def_libavformat_win32
7828 $_def_libavutil
7829 $_def_libavutil_so
7831 /* Use libavcodec's decoders */
7832 #define CONFIG_DECODERS 1
7833 /* Use libavcodec's encoders */
7834 #define CONFIG_ENCODERS 1
7836 /* Use libavformat's demuxers */
7837 #define CONFIG_DEMUXERS 1
7838 /* Use libavformat's muxers */
7839 $_def_muxers
7841 #define CONFIG_GPL 1
7843 /* Use amr codecs from libavcodec (requires amr sources) */
7844 $_def_amr
7845 $_def_amr_nb
7846 $_def_amr_nb_fixed
7847 $_def_amr_wb
7849 /* Use specific parts from FFmpeg. */
7850 `echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7851 `echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7852 `echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7853 `echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7854 `echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7855 $_def_lavc_faac
7856 $_def_lavc_xvid
7857 $_def_lavc_mp3lame
7858 $_def_lavc_x264
7860 /* Use codec libs included in mplayer CVS / source dist: */
7861 $_def_mp3lib
7862 $_def_liba52
7863 $_def_libdts
7864 $_def_libmpeg2
7866 /* XAnim DLL support */
7867 $_def_xanim
7868 /* Default search path */
7869 $_def_xanim_path
7871 /* RealPlayer DLL support */
7872 $_def_real
7873 /* Default search path */
7874 $_def_real_path
7876 /* LIVE555 Streaming Media library support */
7877 $_def_live
7879 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
7880 $_def_fastmemcpy
7882 /* Use unrarlib for Vobsubs */
7883 $_def_unrarlib
7885 /* gui support, please do not edit this option */
7886 $_def_gui
7887 $_def_gtk2_gui
7889 /* Audio output drivers */
7890 $_def_ossaudio
7891 $_def_ossaudio_devdsp
7892 $_def_ossaudio_devmixer
7893 $_def_alsa5
7894 $_def_alsa9
7895 $_def_alsa1x
7896 $_def_arts
7897 $_def_esd
7898 $_def_esd_latency
7899 $_def_polyp
7900 $_def_jack
7901 $_def_openal
7902 $_def_sys_asoundlib_h
7903 $_def_alsa_asoundlib_h
7904 $_def_sunaudio
7905 $_def_sgiaudio
7906 $_def_win32waveout
7907 $_def_nas
7909 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7910 #undef FAST_OSD
7911 #undef FAST_OSD_TABLE
7913 /* Enable TV Interface support */
7914 $_def_tv
7916 /* Enable Video 4 Linux TV interface support */
7917 $_def_tv_v4l
7919 /* Enable Video 4 Linux 1 TV interface support */
7920 $_def_tv_v4l1
7922 /* Enable Video 4 Linux 2 TV interface support */
7923 $_def_tv_v4l2
7925 /* Enable *BSD BrookTree TV interface support */
7926 $_def_tv_bsdbt848
7928 /* Enable Radio Interface support */
7929 $_def_radio
7931 /* Enable Capture for Radio Interface support */
7932 $_def_radio_capture
7934 /* Enable Video 4 Linux Radio interface support */
7935 $_def_radio_v4l
7937 /* Enable Video 4 Linux 2 Radio interface support */
7938 $_def_radio_v4l2
7940 /* Enable Video 4 Linux 2 MPEG PVR support */
7941 $_def_pvr
7943 /* Define if your processor stores words with the most significant
7944 byte first (like Motorola and SPARC, unlike Intel and VAX). */
7945 $_def_words_endian
7947 $_def_arch
7948 $_def_arch_x86
7950 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
7951 have the instruction. */
7952 $_def_dcbzl
7954 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
7955 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
7957 #ifdef ARCH_POWERPC
7958 #define ARCH_PPC 1
7959 #endif
7961 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
7962 #ifdef ARCH_ARMV4L
7963 #define ARCH_ARM 1
7964 #endif
7966 /* only gcc3 can compile mvi instructions */
7967 $_def_gcc_mvi_support
7969 /* Define this for Cygwin build for win32 */
7970 $_def_confwin32
7972 /* Define this to any prefered value from 386 up to infinity with step 100 */
7973 #define __CPU__ $iproc
7975 $_mp_wordsize
7977 $_def_linux
7979 $_def_vcd
7981 #ifdef sun
7982 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
7983 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7984 #elif defined(HPUX)
7985 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7986 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7987 #elif defined(WIN32)
7988 #define DEFAULT_CDROM_DEVICE "D:"
7989 #define DEFAULT_DVD_DEVICE "D:"
7990 #elif defined(SYS_DARWIN)
7991 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
7992 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
7993 #elif defined(__OpenBSD__)
7994 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
7995 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7996 #elif defined(__FreeBSD__)
7997 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
7998 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7999 #else
8000 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8001 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8002 #endif
8005 /*----------------------------------------------------------------------------
8007 ** NOTE: Instead of modifying these definitions here, use the
8008 ** --enable/--disable options of the ./configure script!
8009 ** See ./configure --help for details.
8011 *---------------------------------------------------------------------------*/
8013 /* C99 lrintf function available */
8014 $_def_lrintf
8016 /* round function is available */
8017 $_def_round
8019 /* yes, we have inttypes.h */
8020 #define HAVE_INTTYPES_H 1
8022 /* int_fastXY_t emulation */
8023 $_def_fast_inttypes
8025 /* nanosleep support */
8026 $_def_nanosleep
8028 /* SMB support */
8029 $_def_smbsupport
8031 /* termcap flag for getch2.c */
8032 $_def_termcap
8034 /* termios flag for getch2.c */
8035 $_def_termios
8036 $_def_termios_h
8037 $_def_termios_sys_h
8039 /* enable PNG support */
8040 $_def_png
8042 /* enable JPEG support */
8043 $_def_jpeg
8045 /* enable PNM support */
8046 $_def_pnm
8048 /* enable md5sum support */
8049 $_def_md5sum
8051 /* enable GIF support */
8052 $_def_gif
8053 $_def_gif_4
8054 $_def_gif_tvt_hack
8056 /* enable bitmap font support */
8057 $_def_bitmap_font
8059 /* enable FreeType support */
8060 $_def_freetype
8062 /* enable Fontconfig support */
8063 $_def_fontconfig
8065 /* enable SSA/ASS support */
8066 $_def_ass
8068 /* enable FriBiDi usage */
8069 $_def_fribidi
8071 /* enable ENCA usage */
8072 $_def_enca
8074 /* liblzo support */
8075 $_def_liblzo
8076 #ifdef USE_LIBLZO
8077 #define CONFIG_LZO 1
8078 #endif
8080 /* libmad support */
8081 $_def_mad
8083 /* enable OggVorbis support */
8084 $_def_vorbis
8085 $_def_tremor
8087 /* enable Speex support */
8088 $_def_speex
8090 /* enable musepack support */
8091 $_def_musepack
8093 /* enable OggTheora support */
8094 $_def_theora
8096 /* enable FAAD (AAC) support */
8097 $_def_faad
8098 $_def_faad_internal
8100 /* enable FAAC (AAC encoder) support */
8101 $_def_faac
8103 /* enable LADSPA plugin support */
8104 $_def_ladspa
8106 /* enable network */
8107 $_def_network
8109 /* enable ftp support */
8110 $_def_ftp
8112 /* enable vstream support */
8113 $_def_vstream
8115 /* enable winsock2 instead of Unix functions*/
8116 $_def_winsock2
8118 /* define this to use inet_aton() instead of inet_pton() */
8119 $_def_use_aton
8121 /* enables / disables cdparanoia support */
8122 $_def_cdparanoia
8124 /* enables / disables VIDIX usage */
8125 $_def_vidix
8126 $_def_vidix_pfx
8128 /* enables / disables new input joystick support */
8129 $_def_joystick
8131 /* enables / disables QTX codecs */
8132 $_def_qtx
8134 /* enables / disables osd menu */
8135 $_def_menu
8137 /* enables / disables subtitles sorting */
8138 $_def_sortsub
8140 /* XMMS input plugin support */
8141 $_def_xmms
8142 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8144 /* enables inet6 support */
8145 $_def_inet6
8147 /* do we have gethostbyname2? */
8148 $_def_gethostbyname2
8150 /* Extension defines */
8151 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
8152 $_def_3dnowext // only define if you have 3DNOWEXT (AMD Athlon, etc.)
8153 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
8154 $_def_mmxext // only define if you have MMX2 (Athlon/PIII/4/CelII)
8155 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
8156 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
8157 $_def_cmov // only define if you have CMOV (i686+, without VIA C3)
8158 $_def_altivec // only define if you have Altivec (G4)
8159 $_def_armv5te // only define if you have Enhanced DSP Extensions (ARM)
8160 $_def_iwmmxt // only define if you have XScale IWMMX (ARM)
8162 $_def_altivec_h // enables usage of altivec.h
8164 $_def_mlib // Sun mediaLib, available only on solaris
8165 $_def_vis // only define if you have VIS ( ultrasparc )
8167 /* libmpeg2 uses a different feature test macro for mediaLib */
8168 #ifdef HAVE_MLIB
8169 #define LIBMPEG2_MLIB 1
8170 #endif
8172 /* libvo options */
8173 #define SCREEN_SIZE_X 1
8174 #define SCREEN_SIZE_Y 1
8175 $_def_x11
8176 $_def_xv
8177 $_def_xvmc
8178 $_def_vm
8179 $_def_xf86keysym
8180 $_def_xinerama
8181 $_def_gl
8182 $_def_gl_win32
8183 $_def_dga
8184 $_def_dga2
8185 $_def_sdl
8186 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8187 $_def_sdlbuggy
8188 $_def_directx
8189 $_def_ggi
8190 $_def_ggiwmh
8191 $_def_3dfx
8192 $_def_s3fb
8193 $_def_tdfxfb
8194 $_def_tdfxvid
8195 $_def_directfb
8196 $_def_directfb_version
8197 $_def_dfbmga
8198 $_def_zr
8199 $_def_bl
8200 $_def_mga
8201 $_def_xmga
8202 $_def_syncfb
8203 $_def_fbdev
8204 $_def_dxr2
8205 $_def_dxr3
8206 $_def_ivtv
8207 $_def_dvb
8208 $_def_dvb_in
8209 $_def_svga
8210 $_def_vesa
8211 $_def_xdpms
8212 $_def_aa
8213 $_def_caca
8214 $_def_tga
8215 $_def_toolame
8216 $_def_twolame
8218 /* used by GUI: */
8219 $_def_xshape
8221 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8222 #define X11_FULLSCREEN 1
8223 #endif
8225 #endif /* MPLAYER_CONFIG_H */
8228 #############################################################################
8230 cat << EOF
8232 Config files successfully generated by ./configure !
8234 Install prefix: $_prefix
8235 Data directory: $_datadir
8236 Config direct.: $_confdir
8238 Byte order: $_byte_order
8239 Optimizing for: $_optimizing
8241 Languages:
8242 Messages/GUI: $_language
8245 echo ${_echo_n} " Manual pages: $MAN_LANG ${_echo_c}"
8246 test "$LANGUAGES" = en && echo ${_echo_n} " (no localization selected, use --language=all)${_echo_c}"
8247 echo
8249 cat << EOF
8251 Enabled optional drivers:
8252 Input: $_inputmodules
8253 Codecs: $_codecmodules
8254 Audio output: $_aomodules
8255 Video output: $_vomodules
8256 Audio filters: $_afmodules
8257 Disabled optional drivers:
8258 Input: $_noinputmodules
8259 Codecs: $_nocodecmodules
8260 Audio output: $_noaomodules
8261 Video output: $_novomodules
8262 Audio filters: $_noafmodules
8264 'config.h' and 'config.mak' contain your configuration options.
8265 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8266 compile *** DO NOT REPORT BUGS if you tweak these files ***
8268 'make' will now compile MPlayer and 'make install' will install it.
8269 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8274 if test "$_mtrr" = yes ; then
8275 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8276 echo
8279 if x86; then
8280 if test "$_win32" = no ; then
8281 if test "$_win32codecsdir" ; then
8282 echo "Failed to find a Win32 codecs directory at $_win32codecsdir!"
8283 else
8284 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
8286 cat << EOF
8287 Create it and copy the DLL files there! You can download the codecs from our
8288 homepage at http://www.mplayerhq.hu/MPlayer/releases/codecs/
8292 else
8293 cat <<EOF
8294 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8295 operating system ($system_name). You may encounter a few files that cannot
8296 be played due to missing open source video/audio codec support.
8302 cat <<EOF
8303 Check $TMPLOG if you wonder why an autodetection failed (make sure
8304 development headers/packages are installed).
8306 NOTE: The --enable-* parameters unconditionally force options on, completely
8307 skipping autodetection. This behavior is unlike what you may be used to from
8308 autoconf-based configure scripts that can decide to override you. This greater
8309 level of control comes at a price. You may have to provide the correct compiler
8310 and linker flags yourself.
8311 If you used one of these options (except --enable-gui and similar ones that
8312 turn on internal features) and experience a compilation or linking failure,
8313 make sure you have passed the necessary compiler/linker flags to configure.
8315 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8319 if test "$_warn_CFLAGS" = yes; then
8320 cat <<EOF
8322 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8324 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8326 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8327 To do so, execute 'CFLAGS= ./configure <options>'
8332 # Last move:
8333 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"