UltraSPARC T1 (Niagara) support, patch by Derek E. Lewis /dlewis (gobble) solnetworks...
[mplayer/glamo.git] / configure
blobb7b4e26e97654413765a70ef2961c6907acafadf
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 libvo/config.mak libao2/config.mak Gui/config.mak
21 # and libaf/config.mak are included from the Makefiles.
23 # If you want to add a new check for $feature, here is a simple skeleton:
25 # echocheck "$feature"
26 # if "$_feature" = auto; then
27 # cat > $TMPC << EOF
28 # #include <feature.h>
29 # int main(void) { return 0; }
30 # EOF
31 # _feature=no
32 # cc_check && _feature=yes
33 # if test "$_feature" = yes ; then
34 # _def_feature='#define HAVE_FEATURE 1'
35 # else
36 # _def_feature='#undef HAVE_FEATURE'
37 # fi
38 # echores "$_feature"
40 # Furthermore you need to add the variable _feature to the list of default
41 # settings and set it to one of yes/no/auto. Also add appropriate
42 # --enable-feature/--disable-feature command line options.
43 # The results of the check should be written to config.h and config.mak
44 # at the end of this script. The variable names used for this should be
45 # uniform, i.e. if the option is named 'feature':
47 # _feature : should have a value of yes/no/auto
48 # _def_feature : '#define ... 1' or '#undef ...' for conditional compilation
49 # _ld_feature : '-L/path/dir -lfeature' GCC options
50 # _inc_feature : '-I/path/dir/include' extra include paths
52 #############################################################################
54 # Prevent locale nonsense from breaking basic text processing utils
55 LC_ALL=C
56 export LC_ALL
58 # Prefer these macros to full length text !
59 # These macros only return an error code - NO display is done
60 compile_check() {
61 echo >> "$TMPLOG"
62 cat "$1" >> "$TMPLOG"
63 echo >> "$TMPLOG"
64 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o $TMPO $@" >> "$TMPLOG"
65 rm -f "$TMPO"
66 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o "$TMPO" "$@" >> "$TMPLOG" 2>&1
67 TMP="$?"
68 echo >> "$TMPLOG"
69 echo "ldd $TMPO" >> "$TMPLOG"
70 $_ldd "$TMPO" >> "$TMPLOG" 2>&1
71 echo >> "$TMPLOG"
72 return "$TMP"
75 cc_check() {
76 compile_check $TMPC $@
79 cxx_check() {
80 compile_check $TMPCPP $@ -lstdc++
83 tmp_run() {
84 "$TMPO" >> "$TMPLOG" 2>&1
87 # Display error message, flushes tempfile, exit
88 die () {
89 echo
90 echo "Error: $@" >&2
91 echo >&2
92 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
93 echo "Check \"$TMPLOG\" if you do not understand why it failed."
94 exit 1
97 # OS test booleans functions
98 issystem() {
99 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
101 linux() { issystem "Linux" ; return "$?" ; }
102 sunos() { issystem "SunOS" ; return "$?" ; }
103 hpux() { issystem "HP-UX" ; return "$?" ; }
104 irix() { issystem "IRIX" ; return "$?" ; }
105 aix() { issystem "AIX" ; return "$?" ; }
106 cygwin() { issystem "CYGWIN" ; return "$?" ; }
107 freebsd() { issystem "FreeBSD" ; return "$?" ; }
108 netbsd() { issystem "NetBSD" ; return "$?" ; }
109 bsdos() { issystem "BSD/OS" ; return "$?" ; }
110 openbsd() { issystem "OpenBSD" ; return "$?" ; }
111 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
112 qnx() { issystem "QNX" ; return "$?" ; }
113 darwin() { issystem "Darwin" ; return "$?" ; }
114 gnu() { issystem "GNU" ; return "$?" ; }
115 mingw32() { issystem "MINGW32" ; return "$?" ; }
116 morphos() { issystem "MorphOS" ; return "$?" ; }
117 win32() { cygwin || mingw32 ; return "$?" ; }
118 beos() { issystem "BEOS" ; return "$?" ; }
120 # arch test boolean functions
121 # x86/x86pc is used by QNX
122 x86() {
123 case "$host_arch" in
124 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
125 *) return 1 ;;
126 esac
129 x86_64() {
130 case "$host_arch" in
131 x86_64|amd64) return 0 ;;
132 *) return 1 ;;
133 esac
136 ppc() {
137 case "$host_arch" in
138 ppc) return 0;;
139 *) return 1;;
140 esac
143 alpha() {
144 case "$host_arch" in
145 alpha) return 0;;
146 *) return 1;;
147 esac
150 # not boolean test: implement the posix shell "!" operator for a
151 # non-posix /bin/sh.
152 # usage: not {command}
153 # returns exit status "success" when the execution of "command"
154 # fails.
155 not() {
156 eval "$@"
157 test $? -ne 0
160 # Use this before starting a check
161 echocheck() {
162 echo "============ Checking for $@ ============" >> "$TMPLOG"
163 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
166 # Use this to echo the results of a check
167 echores() {
168 if test "$_res_comment" ; then
169 _res_comment="($_res_comment)"
171 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
172 echo "##########################################" >> "$TMPLOG"
173 echo "" >> "$TMPLOG"
174 echo "$@ $_res_comment"
175 _res_comment=""
177 #############################################################################
179 # Check how echo works in this /bin/sh
180 case `echo -n` in
181 -n) _echo_n= _echo_c='\c' ;; # SysV echo
182 *) _echo_n='-n ' _echo_c= ;; # BSD echo
183 esac
185 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"`
187 for parm in "$@" ; do
188 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
189 cat << EOF
191 Usage: $0 [OPTIONS]...
193 Configuration:
194 -h, --help display this help and exit
196 Installation directories:
197 --prefix=DIR use this prefix for installing mplayer [/usr/local]
198 --bindir=DIR use this prefix for installing mplayer binary
199 [PREFIX/bin]
200 --datadir=DIR use this prefix for installing machine independent
201 data files (fonts, skins) [PREFIX/share/mplayer]
202 --mandir=DIR use this prefix for installing manpages [PREFIX/man]
203 --confdir=DIR use this prefix for installing configuration files
204 [PREFIX/etc/mplayer]
205 --libdir=DIR use this prefix for object code libraries [PREFIX/lib]
207 Optional features:
208 --disable-mencoder disable mencoder (a/v encoder) compilation [enable]
209 --enable-gui enable gmplayer compilation (GTK+ GUI) [disable]
210 --enable-old-gtk force using GTK 1.2 for GUI [disable]
211 --enable-largefiles enable support for files > 2 GBytes [disable]
212 --enable-linux-devfs set default devices to devfs ones [disable]
213 --enable-termcap use termcap database for key codes [autodetect]
214 --enable-termios use termios database for key codes [autodetect]
215 --disable-iconv do not use iconv(3) function [autodetect]
216 --disable-setlocale disable setlocale using in mplayer [autodetect]
217 --disable-langinfo do not use langinfo [autodetect]
218 --enable-lirc enable LIRC (remote control) support [autodetect]
219 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
220 --enable-joystick enable joystick support [disable]
221 --disable-vm disable support X video mode extensions [autodetect]
222 --disable-xf86keysym disable support for 'multimedia' keys [autodetect]
223 --disable-tv disable TV Interface (tv/dvb grabbers) [enable]
224 --disable-tv-v4l disable Video4Linux TV Interface support [autodetect]
225 --disable-tv-v4l2 disable Video4Linux2 TV Interface support [autodetect]
226 --disable-tv-bsdbt848 disable BSD BT848 Interface support [autodetect]
227 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
228 --disable-network disable network support (for: http/mms/rtp) [enable]
229 --enable-winsock2 enable winsock2 usage [autodetect]
230 --enable-smb enable Samba (SMB) input support [autodetect]
231 --enable-live enable LIVE555 Streaming Media support [autodetect]
232 --disable-dvdread Disable libdvdread support [autodetect]
233 --disable-mpdvdkit Disable mpdvdkit2 support [autodetect]
234 --disable-cdparanoia Disable cdparanoia support [autodetect]
235 --disable-freetype Disable freetype2 font rendering support [autodetect]
236 --disable-fontconfig Disable fontconfig font lookup support [autodetect]
237 --disable-unrarlib Disable Unique RAR File Library [enabled]
238 --enable-menu Enable OSD menu support (NOT DVD MENU) [disabled]
239 --disable-sortsub Disable subtitles sorting [enabled]
240 --enable-fribidi Enable using the FriBiDi libs [autodetect]
241 --disable-enca Disable using ENCA charset oracle library [autodetect]
242 --disable-macosx Disable Mac OS X specific features [autodetect]
243 --enable-macosx-finder-support Enable Mac OS X Finder invocation parameter parsing [disabled]
244 --enable-macosx-bundle Enable Mac OS X bundle file locations [autodetect]
245 --disable-inet6 Disable IPv6 support [autodetect]
246 --disable-gethostbyname2 gethostbyname() function is not provided by the C
247 library [autodetect]
248 --disable-ftp Disable ftp support [enabled]
249 --disable-vstream Disable tivo vstream client support [autodetect]
250 --disable-pthreads Disable Posix threads support [autodetect]
252 Codecs:
253 --enable-gif enable gif support [autodetect]
254 --enable-png enable png input/output support [autodetect]
255 --enable-jpeg enable jpeg input/output support [autodetect]
256 --enable-libcdio enable external libcdio support [autodetect]
257 --enable-liblzo enable external liblzo support [autodetect]
258 --disable-win32 disable Win32 DLL support [autodetect]
259 --disable-dshow disable Win32/DirectShow support [autodetect]
260 --disable-qtx disable Quicktime codecs [autodetect]
261 --disable-xanim disable XAnim DLL support [autodetect]
262 --disable-real disable RealPlayer DLL support [autodetect]
263 --disable-xvid disable XviD codec [autodetect]
264 --disable-x264 disable H.264 encoder [autodetect]
265 --disable-divx4linux disable DivX4linux/Divx5linux codec [autodetect]
266 --enable-opendivx enable _old_ OpenDivx codec [disable]
267 --disable-libavutil disable libavutil [autodetect]
268 --disable-libavcodec disable libavcodec [autodetect]
269 --disable-libavformat disable libavformat [autodetect]
270 --disable-libpostproc disable libpostproc [autodetect]
271 --disable-libavutil_so disable shared libavutil [autodetect]
272 --disable-libavcodec_so disable shared libavcodec [autodetect]
273 --disable-libavformat_so disable shared libavformat [autodetect]
274 --disable-libpostproc_so disable shared libpostproc [autodetect]
275 --enable-libfame enable libfame realtime encoder [autodetect]
276 --disable-internal-tremor do not build internal OggVorbis support [enabled]
277 --enable-tremor-low build with lower accuracy internal tremor [disabled]
278 --enable-external-tremor build with external tremor [disabled]
279 --disable-vorbis disable OggVorbis support entirely [autodetect]
280 --disable-speex disable Speex support [autodetect]
281 --enable-theora build with OggTheora support [autodetect]
282 --enable-external-faad build with external FAAD2 (AAC) support [autodetect]
283 --disable-internal-faad disable internal FAAD2 (AAC) support [autodetect]
284 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
285 --disable-ladspa disable LADSPA plugin support [autodetect]
286 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
287 --disable-mad disable libmad (MPEG audio) support [autodetect]
288 --disable-toolame disable Toolame (MPEG layer 2 audio) support in mencoder [autodetect]
289 --disable-twolame disable Twolame (MPEG layer 2 audio) support in mencoder [autodetect]
290 --enable-xmms build with XMMS inputplugin support [disabled]
291 --disable-mp3lib disable builtin mp3lib [enabled]
292 --disable-liba52 disable builtin liba52 [enabled]
293 --enable-libdts enable libdts support [autodetect]
294 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
295 --disable-musepack disable musepack support [autodetect]
296 --disable-amr_nb disable amr narrowband, floating point [autodetect]
297 --disable-amr_nb-fixed disable amr narrowband, fixed point [autodetect]
298 --disable-amr_wb disable amr wideband, floating point [autodetect]
299 --disable-codec=CODEC disable specified codec
300 --enable-codec=CODEC dnable specified codec
302 Video output:
303 --disable-internal-vidix disable internal VIDIX [for x86 *nix]
304 --disable-external-vidix disable external VIDIX [for x86 *nix]
305 --enable-gl build with OpenGL render support [autodetect]
306 --enable-dga[=n] build with DGA [n in {1, 2} ] support [autodetect]
307 --enable-vesa build with VESA support [autodetect]
308 --enable-svga build with SVGAlib support [autodetect]
309 --enable-sdl build with SDL render support [autodetect]
310 --enable-aa build with AAlib render support [autodetect]
311 --enable-caca build with CACA render support [autodetect]
312 --enable-ggi build with GGI render support [autodetect]
313 --enable-ggiwmh build with GGI libggiwmh extension [autodetect]
314 --enable-directx build with DirectX support [autodetect]
315 --enable-dxr2 build with DXR2 render support [autodetect]
316 --enable-dxr3 build with DXR3/H+ render support [autodetect]
317 --enable-dvb build with support for output via DVB-Card [autodetect]
318 --enable-dvbhead build with DVB support (HEAD version) [autodetect]
319 --enable-mga build with mga_vid (for Matrox G200/G4x0/G550) support
320 (check for /dev/mga_vid) [autodetect]
321 --enable-xmga build with mga_vid X Window support
322 (check for X & /dev/mga_vid) [autodetect]
323 --enable-xv build with Xv render support for X 4.x [autodetect]
324 --enable-xvmc build with XvMC acceleration for X 4.x [disable]
325 --enable-vm build with XF86VidMode support for X11 [autodetect]
326 --enable-xinerama build with Xinerama support for X11 [autodetect]
327 --enable-x11 build with X11 render support [autodetect]
328 --enable-fbdev build with FBDev render support [autodetect]
329 --enable-mlib build with mediaLib support (Solaris only) [disable]
330 --enable-3dfx build with obsolete /dev/3dfx support [disable]
331 --enable-tdfxfb build with tdfxfb (Voodoo 3/banshee) support [disable]
332 --enable-s3fb build with s3fb (S3 ViRGE) support [disable]
333 --enable-directfb build with DirectFB support [autodetect]
334 --enable-zr build with ZR360[56]7/ZR36060 support [autodetect]
335 --enable-bl build with Blinkenlights support [disable]
336 --enable-tdfxvid build with tdfx_vid support [disable]
337 --disable-tga disable targa output support [enable]
338 --disable-pnm disable pnm output support [enable]
339 --disable-md5sum disable md5sum output support [enable]
341 Audio output:
342 --disable-alsa disable ALSA sound support [autodetect]
343 --disable-ossaudio disable OSS sound support [autodetect]
344 --disable-arts disable aRts sound support [autodetect]
345 --disable-esd disable esd sound support [autodetect]
346 --disable-polyp disable Polypaudio sound support [autodetect]
347 --disable-jack disable JACK sound support [autodetect]
348 --disable-openal disable OpenAL sound support [autodetect]
349 --disable-nas disable NAS sound support [autodetect]
350 --disable-sgiaudio disable SGI sound support [autodetect]
351 --disable-sunaudio disable Sun sound support [autodetect]
352 --disable-win32waveout disable Windows waveout sound support [autodetect]
353 --disable-select disable using select() on audio device [enable]
355 Miscellaneous options:
356 --enable-runtime-cpudetection Enable runtime CPU detection [disable]
357 --enable-cross-compile Enable cross-compilation [autodetect]
358 --cc=COMPILER use this C compiler to build MPlayer [gcc]
359 --host-cc=COMPILER use this C compiler to build apps needed for the build process [gcc]
360 --as=ASSEMBLER use this assembler to build MPlayer [as]
361 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
362 --enable-static build a statically linked binary. Set further linking
363 options with --enable-static="-lslang -lncurses"
364 --charset convert the help messages to this charset
365 --language=list a white space or comma separated list of languages
366 for translated man pages, the first language is the
367 primary and therefore used for translated messages
368 and GUI (also the environment variable \$LINGUAS is
369 honored) [en]
370 (Available: $LANGUAGES all)
371 --with-install=PATH use a custom install program (useful if your OS uses
372 a GNU-incompatible install utility by default and
373 you want to use GNU version)
374 --install-path=PATH the path to a custom install program
375 this option is obsolete and will be removed soon,
376 use --with-install instead.
378 Advanced options:
379 --enable-mmx build with MMX support [autodetect]
380 --enable-mmxext build with MMX2 support (PIII, Athlon) [autodetect]
381 --enable-3dnow build with 3DNow! support [autodetect]
382 --enable-3dnowext build with extended 3DNow! support [autodetect]
383 --enable-sse build with SSE support [autodetect]
384 --enable-sse2 build with SSE2 support [autodetect]
385 --enable-shm build with shm support [autodetect]
386 --enable-altivec build with Altivec support (PowerPC) [autodetect]
387 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy() [enable]
388 --enable-big-endian Force byte order to big-endian [autodetect]
389 --enable-debug[=1-3] compile debugging information into mplayer [disable]
390 --enable-profile compile profiling information into mplayer [disable]
391 --disable-sighandler disable sighandler for crashes [enable]
392 --enable-crash-debug enable automatic gdb attach on crash [disable]
393 --enable-dynamic-plugins Enable support for dynamic a/v plugins [disable]
395 Hazardous options a.k.a. "DO NOT REPORT ANY BUGS!"
396 --disable-gcc-checking disable gcc version checking [enable]
398 Use these options if autodetection fails (Options marked with (*) accept
399 multiple paths separated by ':'):
400 --with-extraincdir=DIR extra headers (png, mad, sdl, ...) in DIR (*)
401 --with-extralibdir=DIR extra library files (png, mad, sdl, ...) in DIR (*)
402 --with-x11incdir=DIR X headers in DIR (*)
403 --with-x11libdir=DIR X library files in DIR (*)
404 --with-dxr2incdir=DIR DXR2 headers in DIR (*)
405 --with-dvbincdir=DIR DVB headers in DIR (*)
406 --with-madlibdir=DIR libmad (libmad shared library) in DIR (*)
407 --with-mlibdir=DIR libmlib (mediaLib support) in DIR (Solaris only)
408 --with-codecsdir=DIR Binary codec files in DIR
409 --with-win32libdir=DIR W*ndows DLL files in DIR
410 --with-xanimlibdir=DIR XAnim DLL files in DIR
411 --with-reallibdir=DIR RealPlayer DLL files in DIR
412 --with-xvidlibdir=DIR libxvidcore (XviD) in DIR (*)
413 --with-xvidincdir=DIR XviD header in DIR (*)
414 --with-x264libdir=DIR libx264 in DIR
415 --with-x264incdir=DIR x264 header in DIR
416 --with-dtslibdir=DIR libdts library in DIR (*)
417 --with-dtsincdir=DIR libdts header in DIR (*)
418 --with-livelibdir=DIR LIVE555 Streaming Media libraries in DIR
419 --with-toolamedir=DIR path to Toolame library and include file
420 --with-xmmsplugindir=DIR XMMS plugins in DIR
421 --with-xmmslibdir=DIR libxmms.so.1 in DIR
422 --with-cdparanoiaincdir=DIR cdparanoia headers in DIR (*)
423 --with-cdparanoialibdir=DIR cdparanoia libraries (libcdda_*) in DIR (*)
424 --with-xvmclib=NAME name of adapter-specific library (e.g. XvMCNVIDIA)
425 --with-termcaplib=NAME name of library with termcap functionality
426 name should be given without leading "lib"
427 checks for "termcap" and "tinfo"
429 --with-freetype-config=PATH path to freetype-config
430 (e.g. /opt/bin/freetype-config)
431 --with-fribidi-config=PATH path to fribidi-config
432 (e.g. /opt/bin/fribidi-config)
433 --with-glib-config=PATH path to glib*-config (e.g. /opt/bin/glib-config)
434 --with-gtk-config=PATH path to gtk*-config (e.g. /opt/bin/gtk-config)
435 --with-sdl-config=PATH path to sdl*-config (e.g. /opt/bin/sdl-config)
437 This configure script is NOT autoconf-based, even though its output is similar.
438 It will try to autodetect all configuration options. If you --enable an option
439 it will be forcefully turned on, skipping autodetection. This can break
440 compilation, so you need to know what you are doing.
442 exit 0
444 done # for parm in ...
447 # 1st pass checking for vital options
448 _mmx=auto
449 _3dnow=auto
450 _3dnowext=auto
451 _mmxext=auto
452 _sse=auto
453 _sse2=auto
454 _mtrr=auto
455 _install=install
456 _ranlib=ranlib
457 _cc=cc
458 test "$CC" && _cc="$CC"
459 _as=auto
460 _runtime_cpudetection=no
461 _cross_compile=auto
462 for ac_option do
463 case "$ac_option" in
464 --target=*)
465 _target=`echo $ac_option | cut -d '=' -f 2`
467 --cc=*)
468 _cc=`echo $ac_option | cut -d '=' -f 2`
470 --host-cc=*)
471 _host_cc=`echo $ac_option | cut -d '=' -f 2`
473 --as=*)
474 _as=`echo $ac_option | cut -d '=' -f 2`
476 --enable-gcc-checking)
477 _skip_cc_check=no
479 --disable-gcc-checking)
480 _skip_cc_check=yes
482 --enable-static)
483 _ld_static='-static'
485 --disable-static)
486 _ld_static=''
488 --enable-static=*)
489 _ld_static="-static `echo $ac_option | cut -d '=' -f 2`"
491 --with-extraincdir=*)
492 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
494 --with-extralibdir=*)
495 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
497 --enable-runtime-cpudetection)
498 _runtime_cpudetection=yes
500 --disable-runtime-cpudetection)
501 _runtime_cpudetection=no
503 --enable-cross-compile)
504 _cross_compile=yes
506 --disable-cross-compile)
507 _cross_compile=no
509 --install-path=*)
510 _install=`echo $ac_option | cut -d '=' -f 2 | sed 's/\/$//'`"/install"
512 --with-install=*)
513 _install=`echo $ac_option | cut -d '=' -f 2 `
515 --enable-profile)
516 _profile='-p'
518 --disable-profile)
519 _profile=
521 --enable-debug)
522 _debug='-g'
524 --enable-debug=*)
525 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
527 --disable-debug)
528 _debug=
530 esac
531 done
533 # Determine our OS name and CPU architecture
534 if test -z "$_target" ; then
535 # OS name
536 system_name=`uname -s 2>&1`
537 case "$system_name" in
538 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS|AIX)
540 IRIX*)
541 system_name=IRIX
543 HP-UX*)
544 system_name=HP-UX
546 [cC][yY][gG][wW][iI][nN]*)
547 system_name=CYGWIN
549 MINGW32*)
550 system_name=MINGW32
553 system_name="$system_name-UNKNOWN"
555 esac
558 # host's CPU/instruction set
559 host_arch=`uname -p 2>&1`
560 case "$host_arch" in
561 i386|sparc|ppc|alpha|arm|mips|vax)
563 powerpc) # Darwin returns 'powerpc'
564 host_arch=ppc
566 *) # uname -p on Linux returns 'unknown' for the processor type,
567 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
569 # Maybe uname -m (machine hardware name) returns something we
570 # recognize.
572 # x86/x86pc is used by QNX
573 case "`uname -m 2>&1`" in
574 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 ;;
575 ia64) host_arch=ia64 ;;
576 x86_64|amd64)
577 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
578 -z "`echo $CFLAGS | grep -- -m32`" ]; then
579 host_arch=x86_64
580 else
581 host_arch=i386
584 macppc|ppc|ppc64) host_arch=ppc ;;
585 alpha) host_arch=alpha ;;
586 sparc) host_arch=sparc ;;
587 sparc64) host_arch=sparc64 ;;
588 parisc*|hppa*|9000*) host_arch=hppa ;;
589 arm*|zaurus|cats) host_arch=arm ;;
590 s390) host_arch=s390 ;;
591 s390x) host_arch=s390x ;;
592 mips*) host_arch=mips ;;
593 vax) host_arch=vax ;;
594 *) host_arch=UNKNOWN ;;
595 esac
597 esac
598 else # if test -z "$_target"
599 system_name=`echo $_target | cut -d '-' -f 2`
600 case "`echo $system_name | tr A-Z a-z`" in
601 linux) system_name=Linux ;;
602 freebsd) system_name=FreeBSD ;;
603 netbsd) system_name=NetBSD ;;
604 bsd/os) system_name=BSD/OS ;;
605 openbsd) system_name=OpenBSD ;;
606 sunos) system_name=SunOS ;;
607 qnx) system_name=QNX ;;
608 morphos) system_name=MorphOS ;;
609 mingw32msvc) system_name=MINGW32 ;;
610 esac
611 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
612 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
615 echo "Detected operating system: $system_name"
616 echo "Detected host architecture: $host_arch"
618 # LGB: temporary files
619 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
620 test "$I" && break
621 done
623 TMPLOG="configure.log"
624 rm -f "$TMPLOG"
625 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
626 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
627 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
628 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
630 # config files
632 # FIXME: A lot of stuff is installed under /usr/local
633 # NK: But we should never use this stuff implicitly since we call compiler
634 # from /usr we should be sure that there no effects from other compilers
635 # (libraries) which might be installed into /usr/local. Let users use this
636 # stuff explicitly as command line argument. In other words: It would be
637 # resonable to have only /usr/include or only /usr/local/include.
639 if freebsd ; then
640 _ld_extra="$_ld_extra -L/usr/local/lib"
641 _inc_extra="$_inc_extra -I/usr/local/include"
644 if netbsd ; then
645 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
646 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
647 done
648 _ld_extra=$tmp
651 _ldd=ldd
652 if darwin; then
653 _ldd="otool -L"
656 if aix ; then
657 _ld_libC="-lC"
658 else
659 _ld_libC=""
662 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
663 # if used as 'head -1' instead of 'head -n 1', but older versions don't
664 # know about '-n'.
665 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
666 _head() { head -$1 2>/dev/null ; }
667 else
668 _head() { head -n $1 2>/dev/null ; }
670 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
671 _tail() { tail -$1 2>/dev/null ; }
672 else
673 _tail() { tail -n $1 2>/dev/null ; }
676 # Checking CC version...
677 if test "$_skip_cc_check" != yes ; then
678 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
679 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
680 echocheck "$_cc version"
681 cc_vendor=intel
682 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
683 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
684 _cc_major=`echo $cc_version | cut -d '.' -f 1`
685 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
686 # TODO verify older icc/ecc compatibility
687 case $cc_version in
689 cc_version="v. ?.??, bad"
690 cc_verc_fail=yes
692 8.0)
693 cc_version="$cc_version, ok"
694 cc_verc_fail=no
697 cc_version="$cc_version, bad"
698 cc_verc_fail=yes
700 esac
701 echores "$cc_version"
702 else
703 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
704 echocheck "$_cc version"
705 cc_vendor=gnu
706 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
707 cc_version=`$_cc -dumpversion 2>&1`
708 if test "$?" -gt 0; then
709 cc_version="not found"
711 case $cc_version in
713 cc_version="v. ?.??, bad"
714 cc_verc_fail=yes
716 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
717 _cc_major=`echo $cc_version | cut -d '.' -f 1`
718 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
719 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
720 cc_version="$cc_version, ok"
721 cc_verc_fail=no
723 'not found')
724 cc_verc_fail=yes
727 cc_version="$cc_version, bad"
728 cc_verc_fail=yes
730 esac
731 echores "$cc_version"
732 test "$cc_verc_fail" = "no" && break
733 done
734 fi # icc
735 if test "$cc_verc_fail" = yes ; then
736 cat <<EOF
738 *** Please downgrade/upgrade C compiler to version gcc-2.95.x or gcc-3.x! ***
740 You are not using a supported compiler. We do not have the time to make sure
741 everything works with compilers other than the ones we use. Use either the
742 same compiler as we do, or use --disable-gcc-checking but DO *NOT* REPORT BUGS
743 unless you can reproduce them after recompiling with a 2.95.x or 3.x version!
745 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
746 mplayer and lame (which is used for mencoder). If you get compile errors,
747 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
748 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
749 bugs!
751 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
753 *** For details please read DOCS/HTML/en/users-vs-dev.html ***
756 die "Bad gcc version"
758 else
759 cat <<EOF
761 ******************************************************************************
763 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
764 Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???
766 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
767 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
768 Lame which is used by mencoder produces weird errors, too.
770 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
771 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
773 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
775 ******************************************************************************
779 read _answer
782 echocheck "host cc"
783 test "$_host_cc" || _host_cc=$_cc
784 echores $_host_cc
786 echocheck "cross compilation"
787 if test $_cross_compile = auto ; then
788 cat > $TMPC << EOF
789 int main() { return 0; }
791 _cross_compile=yes
792 cc_check && "$TMPO" && _cross_compile=no
794 echores $_cross_compile
796 if test $_cross_compile = yes; then
797 tmp_run() {
798 return 0
802 # ---
804 # now that we know what compiler should be used for compilation, try to find
805 # out which assembler is used by the $_cc compiler
806 if test "$_as" = auto ; then
807 _as=`$_cc -print-prog-name=as`
808 test -z "$_as" && _as=as
811 # XXX: this should be ok..
812 _cpuinfo="echo"
813 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
814 # FIXME: Remove the cygwin check once AMD CPUs are supported
815 if test -r /proc/cpuinfo && not cygwin; then
816 # Linux with /proc mounted, extract CPU information from it
817 _cpuinfo="cat /proc/cpuinfo"
818 elif test -r /compat/linux/proc/cpuinfo && not x86 ; then
819 # FreeBSD with Linux emulation /proc mounted,
820 # extract CPU information from it
821 _cpuinfo="cat /compat/linux/proc/cpuinfo"
822 elif darwin && not x86 ; then
823 # use hostinfo on Darwin
824 _cpuinfo="hostinfo"
825 elif aix; then
826 # use 'lsattr' on AIX
827 _cpuinfo="lsattr -E -l proc0 -a type"
828 elif x86; then
829 # all other OSes try to extract CPU information from a small helper
830 # program TOOLS/cpuinfo instead
831 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
832 _cpuinfo="TOOLS/cpuinfo"
835 if x86 || x86_64 ; then
836 # gather more CPU information
837 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
838 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
839 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
840 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
841 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
843 exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1`
845 pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
846 -e s/xmm/sse/ -e s/kni/sse/`
848 for ext in $pparam ; do
849 eval _$ext=auto && eval _$ext=yes
850 done
852 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
853 test $_sse = yes && _mmxext=yes
855 echocheck "CPU vendor"
856 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
858 echocheck "CPU type"
859 echores "$pname"
862 case "$host_arch" in
863 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
864 _def_arch="#define ARCH_X86 1"
865 _target_arch="TARGET_ARCH_X86 = yes"
868 case "$pvendor" in
869 AuthenticAMD)
870 case "$pfamily" in
871 3) proc=i386 iproc=386 ;;
872 4) proc=i486 iproc=486 ;;
873 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
874 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
875 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
876 proc=k6-3
877 elif test "$pmodel" -ge 8; then
878 proc=k6-2
879 elif test "$pmodel" -ge 6; then
880 proc=k6
881 else
882 proc=i586
885 6) iproc=686
886 # It's a bit difficult to determine the correct type of Family 6
887 # AMD CPUs just from their signature. Instead, we check directly
888 # whether it supports SSE.
889 if test "$_sse" = yes; then
890 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
891 proc=athlon-xp
892 else
893 # Again, gcc treats athlon and athlon-tbird similarly.
894 proc=athlon
897 15) iproc=686
898 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
899 # caught and remedied in the optimization tests below.
900 proc=k8
903 *) proc=k8 iproc=686 ;;
904 esac
906 GenuineIntel)
907 case "$pfamily" in
908 3) proc=i386 iproc=386 ;;
909 4) proc=i486 iproc=486 ;;
910 5) iproc=586
911 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
912 proc=pentium-mmx # 4 is desktop, 8 is mobile
913 else
914 proc=i586
917 6) iproc=686
918 if test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
919 proc=pentium-m
920 elif test "$pmodel" -ge 7; then
921 proc=pentium3
922 elif test "$pmodel" -ge 3; then
923 proc=pentium2
924 else
925 proc=i686
928 15) iproc=686
929 # A nocona in 32-bit mode has no more capabilities than a prescott.
930 if test "$pmodel" -ge 3; then
931 proc=prescott
932 else
933 proc=pentium4
936 *) proc=prescott iproc=686 ;;
937 esac
939 CentaurHauls)
940 case "$pfamily" in
941 5) iproc=586
942 if test "$pmodel" -ge 8; then
943 proc=winchip2
944 elif test "$pmodel" -ge 4; then
945 proc=winchip-c6
946 else
947 proc=i586
950 6) iproc=686
951 if test "$pmodel" -ge 9; then
952 proc=c3-2
953 else
954 proc=c3
955 iproc=586
958 *) proc=i686 iproc=i686 ;;
959 esac
961 unknown)
962 case "$pfamily" in
963 3) proc=i386 iproc=386 ;;
964 4) proc=i486 iproc=486 ;;
965 *) proc=i586 iproc=586 ;;
966 esac
969 proc=i586 iproc=586 ;;
970 esac
972 # check that gcc supports our CPU, if not, fall back to earlier ones
973 # LGB: check -mcpu and -march swithing step by step with enabling
974 # to fall back till 386.
976 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
978 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
979 cpuopt=-mtune
980 else
981 cpuopt=-mcpu
984 echocheck "GCC & CPU optimization abilities"
985 cat > $TMPC << EOF
986 int main(void) { return 0; }
988 if test "$_runtime_cpudetection" = no ; then
989 if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
990 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
992 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" || test "$proc" = "athlon-tbird"; then
993 cc_check -march=$proc $cpuopt=$proc || proc=athlon
995 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
996 cc_check -march=$proc $cpuopt=$proc || proc=k6
998 if test "$proc" = "k6" || test "$proc" = "c3"; then
999 if not cc_check -march=$proc $cpuopt=$proc; then
1000 if cc_check -march=i586 $cpuopt=i686; then
1001 proc=i586-i686
1002 else
1003 proc=i586
1007 if test "$proc" = "pentium4" || test "$proc" = "pentium-m" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon" || test "$proc" = "c3-2"; then
1008 cc_check -march=$proc $cpuopt=$proc || proc=i686
1010 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1011 cc_check -march=$proc $cpuopt=$proc || proc=i586
1013 if test "$proc" = "i586"; then
1014 cc_check -march=$proc $cpuopt=$proc || proc=i486
1016 if test "$proc" = "i486" ; then
1017 cc_check -march=$proc $cpuopt=$proc || proc=i386
1019 if test "$proc" = "i386" ; then
1020 cc_check -march=$proc $cpuopt=$proc || proc=error
1022 if test "$proc" = "error" ; then
1023 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1024 _mcpu=""
1025 _march=""
1026 _optimizing=""
1027 elif test "$proc" = "i586-i686"; then
1028 _march="-march=i586"
1029 _mcpu="$cpuopt=i686"
1030 _optimizing="$proc"
1031 else
1032 _march="-march=$proc"
1033 _mcpu="$cpuopt=$proc"
1034 _optimizing="$proc"
1036 else # if test "$_runtime_cpudetection" = no
1037 # i686 is probably the most common CPU - optimize for it
1038 _mcpu="$cpuopt=i686"
1039 # at least i486 required, for bswap instruction
1040 _march="-march=i486"
1041 cc_check $_mcpu || _mcpu=""
1042 cc_check $_march $_mcpu || _march=""
1045 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1046 ## autodetected mcpu/march parameters
1047 if test "$_target" ; then
1048 # TODO: it may be a good idea to check GCC and fall back in all cases
1049 if test "$host_arch" = "i586-i686"; then
1050 _march="-march=i586"
1051 _mcpu="$cpuopt=i686"
1052 else
1053 _march="-march=$host_arch"
1054 _mcpu="$cpuopt=$host_arch"
1057 proc="$host_arch"
1059 case "$proc" in
1060 i386) iproc=386 ;;
1061 i486) iproc=486 ;;
1062 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1063 i686|athlon*|pentium*) iproc=686 ;;
1064 *) iproc=586 ;;
1065 esac
1068 echores "$proc"
1071 ia64)
1072 _def_arch='#define ARCH_IA64 1'
1073 _target_arch='TARGET_ARCH_IA64 = yes'
1074 iproc='ia64'
1075 proc=''
1076 _march=''
1077 _mcpu=''
1078 _optimizing=''
1081 x86_64|amd64)
1082 _def_arch='#define ARCH_X86_64 1'
1083 _target_arch='TARGET_ARCH_X86_64 = yes'
1084 iproc='x86_64'
1086 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1087 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1088 cpuopt=-mtune
1089 else
1090 cpuopt=-mcpu
1092 case "$pvendor" in
1093 AuthenticAMD)
1094 proc=k8;;
1095 GenuineIntel)
1096 # 64-bit prescotts exist, but as far as GCC is concerned they have the
1097 # same capabilities as a nocona.
1098 proc=nocona;;
1100 proc=error;;
1101 esac
1103 echocheck "GCC & CPU optimization abilities"
1104 cat > $TMPC << EOF
1105 int main(void) { return 0; }
1107 # This is a stripped-down version of the i386 fallback.
1108 if test "$_runtime_cpudetection" = no ; then
1109 # --- AMD processors ---
1110 if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
1111 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1113 # This will fail if gcc version < 3.3, which is ok because earlier
1114 # versions don't really support 64-bit on amd64.
1115 # Is this a valid assumption? -Corey
1116 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" ; then
1117 cc_check -march=$proc $cpuopt=$proc || proc=error
1119 # --- Intel processors ---
1120 if test "$proc" = "nocona" || test "$proc" = "prescott" ; then
1121 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1123 if test "$proc" = "pentium4" || test "$proc" = "pentium4m" ; then
1124 cc_check -march=$proc $cpuopt=$proc || proc=error
1127 _march="-march=$proc"
1128 _mcpu="$cpuopt=$proc"
1129 if test "$proc" = "error" ; then
1130 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1131 _mcpu=""
1132 _march=""
1134 else
1135 _march=""
1136 _mcpu=""
1139 _optimizing=""
1141 echores "$proc"
1144 sparc)
1145 _def_arch='#define ARCH_SPARC 1'
1146 _target_arch='TARGET_ARCH_SPARC = yes'
1147 iproc='sparc'
1148 if sunos ; then
1149 echocheck "CPU type"
1150 karch=`uname -m`
1151 case "`echo $karch`" in
1152 sun4) proc=v7 ;;
1153 sun4c) proc=v7 ;;
1154 sun4d) proc=v8 ;;
1155 sun4m) proc=v8 ;;
1156 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1157 sun4v) proc=v9 ;;
1158 *) proc=v8 ;;
1159 esac
1160 echores "$proc"
1161 else
1162 proc=v8
1164 _march=''
1165 _mcpu="-mcpu=$proc"
1166 _optimizing="$proc"
1169 sparc64)
1170 _def_arch='#define ARCH_SPARC 1'
1171 _target_arch='TARGET_ARCH_SPARC = yes'
1172 _vis='yes'
1173 _def_vis='#define HAVE_VIS = yes'
1174 iproc='sparc'
1175 proc='v9'
1176 _march=''
1177 _mcpu="-mcpu=$proc"
1178 _optimizing="$proc"
1181 arm|armv4l|armv5tel)
1182 _def_arch='#define ARCH_ARMV4L 1'
1183 _target_arch='TARGET_ARCH_ARMV4L = yes'
1184 iproc='arm'
1185 proc=''
1186 _march=''
1187 _mcpu=''
1188 _optimizing=''
1191 ppc)
1192 _def_arch='#define ARCH_POWERPC 1'
1193 _def_dcbzl='#define NO_DCBZL 1'
1194 _target_arch='TARGET_ARCH_POWERPC = yes'
1195 iproc='ppc'
1196 proc=''
1197 _march=''
1198 _mcpu=''
1199 _optimizing=''
1200 _altivec=no
1202 echocheck "CPU type"
1203 case $system_name in
1204 Linux)
1205 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1206 if test -n "`$_cpuinfo | grep altivec`"; then
1207 _altivec=yes
1210 Darwin)
1211 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1212 if [ `sysctl -n hw.vectorunit` -eq 1 -o \
1213 "`sysctl -n hw.optional.altivec 2>/dev/null`" -eq 1 ]; then
1214 _altivec=yes
1217 NetBSD)
1218 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1219 case $cc_version in
1220 2*|3.0*|3.1*|3.2*|3.3*)
1223 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1224 _altivec=yes
1227 esac
1229 AIX)
1230 proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
1232 esac
1233 if test "$_altivec" = yes; then
1234 echores "$proc altivec"
1235 else
1236 echores "$proc"
1239 echocheck "GCC & CPU optimization abilities"
1241 if test -n "$proc"; then
1242 case "$proc" in
1243 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1244 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1245 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1246 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1247 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1248 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1249 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
1250 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
1251 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
1252 *) ;;
1253 esac
1254 # gcc 3.1(.1) and up supports 7400 and 7450
1255 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1256 case "$proc" in
1257 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1258 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1259 *) ;;
1260 esac
1262 # gcc 3.2 and up supports 970
1263 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1264 case "$proc" in
1265 970*) _march='-mcpu=970' _mcpu='-mtune=970'
1266 _def_dcbzl='#undef NO_DCBZL' ;;
1267 *) ;;
1268 esac
1270 # gcc 3.3 and up supports POWER4
1271 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1272 case "$proc" in
1273 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
1274 *) ;;
1275 esac
1277 # gcc 4.0 and up supports POWER5
1278 if test "$_cc_major" -ge "4"; then
1279 case "$proc" in
1280 POWER5) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
1281 *) ;;
1282 esac
1286 if test -n "$_mcpu"; then
1287 _optimizing=`echo $_mcpu | cut -c 8-`
1288 echores "$_optimizing"
1289 else
1290 echores "none"
1295 alpha)
1296 _def_arch='#define ARCH_ALPHA 1'
1297 _target_arch='TARGET_ARCH_ALPHA = yes'
1298 iproc='alpha'
1299 _march=''
1301 echocheck "CPU type"
1302 cat > $TMPC << EOF
1303 int main() {
1304 unsigned long ver, mask;
1305 asm ("implver %0" : "=r" (ver));
1306 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1307 printf("%ld-%x\n", ver, ~mask);
1308 return 0;
1311 $_cc -o "$TMPO" "$TMPC"
1312 case `"$TMPO"` in
1314 0-0) proc="ev4"; cpu_understands_mvi="0";;
1315 1-0) proc="ev5"; cpu_understands_mvi="0";;
1316 1-1) proc="ev56"; cpu_understands_mvi="0";;
1317 1-101) proc="pca56"; cpu_understands_mvi="1";;
1318 2-303) proc="ev6"; cpu_understands_mvi="1";;
1319 2-307) proc="ev67"; cpu_understands_mvi="1";;
1320 2-1307) proc="ev68"; cpu_understands_mvi="1";;
1321 esac
1322 echores "$proc"
1324 echocheck "GCC & CPU optimization abilities"
1325 if test "$proc" = "ev68" ; then
1326 cc_check -mcpu=$proc || proc=ev67
1328 if test "$proc" = "ev67" ; then
1329 cc_check -mcpu=$proc || proc=ev6
1331 _mcpu="-mcpu=$proc"
1332 echores "$proc"
1334 _optimizing="$proc"
1336 echocheck "MVI instruction support in GCC"
1337 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
1338 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
1339 echores "yes"
1340 else
1341 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
1342 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
1346 mips)
1347 _def_arch='#define ARCH_SGI_MIPS 1'
1348 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
1349 iproc='sgi-mips'
1350 proc=''
1351 _march=''
1352 _mcpu=''
1353 _optimizing=''
1355 if irix ; then
1356 echocheck "CPU type"
1357 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
1358 case "`echo $proc`" in
1359 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
1360 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
1361 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
1362 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
1363 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
1364 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
1365 esac
1366 echores "$proc"
1371 hppa)
1372 _def_arch='#define ARCH_PA_RISC 1'
1373 _target_arch='TARGET_ARCH_PA_RISC = yes'
1374 iproc='PA-RISC'
1375 proc=''
1376 _march=''
1377 _mcpu=''
1378 _optimizing=''
1381 s390)
1382 _def_arch='#define ARCH_S390 1'
1383 _target_arch='TARGET_ARCH_S390 = yes'
1384 iproc='390'
1385 proc=''
1386 _march=''
1387 _mcpu=''
1388 _optimizing=''
1391 s390x)
1392 _def_arch='#define ARCH_S390X 1'
1393 _target_arch='TARGET_ARCH_S390X = yes'
1394 iproc='390x'
1395 proc=''
1396 _march=''
1397 _mcpu=''
1398 _optimizing=''
1401 vax)
1402 _def_arch='#define ARCH_VAX 1'
1403 _target_arch='TARGET_ARCH_VAX = yes'
1404 iproc='vax'
1405 proc=''
1406 _march=''
1407 _mcpu=''
1408 _optimizing=''
1412 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1413 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1414 die "unsupported architecture $host_arch"
1416 esac # case "$host_arch" in
1418 if test "$_runtime_cpudetection" = yes ; then
1419 if x86; then
1420 _mmx=yes
1421 _3dnow=yes
1422 _3dnowext=yes
1423 _mmxext=yes
1424 _sse=yes
1425 _sse2=yes
1426 _mtrr=yes
1428 if ppc; then
1429 _altivec=yes
1433 if x86 && test "$_runtime_cpudetection" = no ; then
1434 extcheck() {
1435 if test "$1" = yes ; then
1436 echocheck "kernel support of $2"
1437 cat > $TMPC <<EOF
1438 #include <signal.h>
1439 void catch() { exit(1); }
1440 int main(void){
1441 signal(SIGILL, catch);
1442 __asm__ __volatile__ ("$3":::"memory");return(0);
1446 if cc_check && tmp_run ; then
1447 echores "yes"
1448 _optimizing="$_optimizing $2"
1449 return 0
1450 else
1451 echores "failed"
1452 echo "It seems that your kernel does not correctly support $2."
1453 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1454 return 1
1457 return 0
1460 extcheck $_mmx "mmx" "emms" || _mmx=no
1461 extcheck $_mmxext "mmxext" "sfence" || _mmxext=no
1462 extcheck $_3dnow "3dnow" "femms" || _3dnow=no
1463 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0" || _3dnowext=no
1464 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no _gcc3_ext="$_gcc3_ext -mno-sse"
1465 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no _gcc3_ext="$_gcc3_ext -mno-sse2"
1466 echocheck "mtrr support"
1467 echores "$_mtrr"
1469 if test "$_mtrr" = yes ; then
1470 _optimizing="$_optimizing mtrr"
1473 if test "$_gcc3_ext" != ""; then
1474 # if we had to disable sse/sse2 because the active kernel does not
1475 # support this instruction set extension, we also have to tell
1476 # gcc3 to not generate sse/sse2 instructions for normal C code
1477 cat > $TMPC << EOF
1478 int main(void) { return 0; }
1480 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1486 # intrinsics headers for use with FFmpeg
1487 if test "$_sse" = yes ; then
1488 echocheck "xmmintrin.h"
1489 cat > $TMPC << EOF
1490 #include <xmmintrin.h>
1491 int main() { _mm_sfence(); return 0; }
1493 _builtin_vector=no
1494 cc_check -msse && _builtin_vector=yes
1495 if test "$_builtin_vector" = yes ; then
1496 _def_builtin_vector='#define HAVE_BUILTIN_VECTOR 1'
1497 else
1498 _def_builtin_vector='#undef HAVE_BUILTIN_VECTOR'
1500 echores "$_builtin_vector"
1503 if test "$_3dnow" = yes ; then
1504 echocheck "mm3dnow.h"
1505 cat > $TMPC << EOF
1506 #include <mm3dnow.h>
1507 int main() { _m_femms(); return 0; }
1509 _mm3dnow=no
1510 cc_check -m3dnow && _mm3dnow=yes
1511 if test "$_mm3dnow" = yes ; then
1512 _def_mm3dnow='#define HAVE_MM3DNOW 1'
1513 else
1514 _def_mm3dnow='#undef HAVE_MM3DNOW'
1516 echores "$_mm3dnow"
1520 echocheck "assembler support of -pipe option"
1521 cat > $TMPC << EOF
1522 int main(void) { return 0; }
1524 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
1526 # Checking for CFLAGS
1527 _stripbinaries=yes
1528 if test "$_profile" != "" || test "$_debug" != "" ; then
1529 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
1530 if test "$_cc_major" -ge "3" ; then
1531 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
1533 _stripbinaries=no
1534 elif test -z "$CFLAGS" ; then
1535 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
1536 else
1537 _warn_CFLAGS=yes
1539 if test -n "$LDFLAGS" ; then
1540 _ld_extra="$_ld_extra $LDFLAGS"
1541 _warn_CFLAGS=yes
1543 if test -n "$CPPFLAGS" ; then
1544 _inc_extra="$_inc_extra $CPPFLAGS"
1545 _warn_CFLAGS=yes
1548 _prefix="/usr/local"
1550 # GOTCHA: the variables below defines the default behavior for autodetection
1551 # and have - unless stated otherwise - at least 2 states : yes no
1552 # If autodetection is available then the third state is: auto
1553 _libavutil=auto
1554 _libavutil_so=auto
1555 _libavcodec=auto
1556 _amr_nb=auto
1557 _amr_nb_fixed=auto
1558 _amr_wb=auto
1559 _libavcodecs=`grep 'register_avcodec(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1560 _libavcodec_so=auto
1561 _libavformat=auto
1562 _libavformat_so=auto
1563 _libpostproc=auto
1564 _libpostproc_so=auto
1565 _fame=auto
1566 _mp1e=no
1567 _mencoder=yes
1568 _x11=auto
1569 _dga=auto # 1 2 no auto
1570 _xv=auto
1571 _xvmc=no #auto when complete
1572 _sdl=auto
1573 _directx=auto
1574 _win32waveout=auto
1575 _nas=auto
1576 _png=auto
1577 _jpg=auto
1578 _pnm=yes
1579 _md5sum=yes
1580 _gif=auto
1581 _gl=auto
1582 _ggi=auto
1583 _ggiwmh=auto
1584 _aa=auto
1585 _caca=auto
1586 _svga=auto
1587 _vesa=auto
1588 _fbdev=auto
1589 _dvb=auto
1590 _dvbhead=auto
1591 _dxr2=auto
1592 _dxr3=auto
1593 _iconv=auto
1594 _langinfo=auto
1595 _rtc=auto
1596 _ossaudio=auto
1597 _arts=auto
1598 _esd=auto
1599 _polyp=auto
1600 _jack=auto
1601 _openal=auto
1602 _libcdio=auto
1603 _liblzo=auto
1604 _mad=auto
1605 _toolame=auto
1606 _twolame=auto
1607 _tremor_internal=yes
1608 _tremor_low=no
1609 _vorbis=auto
1610 _speex=auto
1611 _theora=auto
1612 _mp3lib=yes
1613 _liba52=yes
1614 _libdts=auto
1615 _libmpeg2=yes
1616 _tremor=no
1617 _faad_internal=auto
1618 _faad_external=auto
1619 _faac=auto
1620 _ladspa=auto
1621 _xmms=no
1622 _have_dvd=no
1623 # dvdnav disabled, it does not work
1624 #_dvdnav=no
1625 _dvdread=auto
1626 _dvdkit=auto
1627 _xanim=auto
1628 _real=auto
1629 _live=auto
1630 _xinerama=auto
1631 _mga=auto
1632 _xmga=auto
1633 _vm=auto
1634 _xf86keysym=auto
1635 _mlib=no #broken, thus disabled
1636 _sgiaudio=auto
1637 _sunaudio=auto
1638 _alsa=auto
1639 _fastmemcpy=yes
1640 _unrarlib=yes
1641 _win32=auto
1642 _dshow=yes
1643 _select=yes
1644 _tv=yes
1645 _tv_v4l=auto
1646 _tv_v4l2=auto
1647 _tv_bsdbt848=auto
1648 _network=yes
1649 _winsock2=auto
1650 _smbsupport=auto
1651 _vidix_internal=auto
1652 _vidix_external=auto
1653 _joystick=no
1654 _xvid=auto
1655 _x264=auto
1656 _divx4linux=auto
1657 _opendivx=no
1658 _lirc=auto
1659 _lircc=auto
1660 _gui=no
1661 _gtk1=no
1662 _termcap=auto
1663 _termios=auto
1664 _3dfx=no
1665 _s3fb=no
1666 _tdfxfb=no
1667 _tdfxvid=no
1668 _tga=yes
1669 _directfb=auto
1670 _zr=auto
1671 _bl=no
1672 _largefiles=no
1673 #_language=en
1674 _shm=auto
1675 _linux_devfs=no
1676 #_charset=utf8
1677 _dynamic_plugins=no
1678 _crash_debug=no
1679 _sighandler=yes
1680 _libdv=auto
1681 _cdparanoia=auto
1682 _big_endian=auto
1683 _freetype=auto
1684 _fontconfig=auto
1685 _menu=no
1686 _qtx=auto
1687 _macosx=auto
1688 _macosx_finder_support=no
1689 _macosx_bundle=auto
1690 _sortsub=yes
1691 _freetypeconfig='freetype-config'
1692 _fribidi=auto
1693 _fribidiconfig='fribidi-config'
1694 _enca=auto
1695 _inet6=auto
1696 _gethostbyname2=auto
1697 _ftp=yes
1698 _musepack=auto
1699 _vstream=auto
1700 _pthreads=yes
1701 for ac_option do
1702 case "$ac_option" in
1703 # Skip 1st pass
1704 --target=*) ;;
1705 --cc=*) ;;
1706 --host-cc=*) ;;
1707 --as=*) ;;
1708 --enable-gcc-checking) ;;
1709 --disable-gcc-checking) ;;
1710 --enable-static*) ;;
1711 --disable-static*) ;;
1712 --with-extraincdir=*) ;;
1713 --with-extralibdir=*) ;;
1714 --enable-runtime-cpudetection) ;;
1715 --disable-runtime-cpudetection) ;;
1716 --enable-cross-compile) ;;
1717 --disable-cross-compile) ;;
1718 --install-path=*) ;;
1719 --with-install=*) ;;
1720 --enable-profile) ;;
1721 --disable-profile) ;;
1722 --enable-debug) ;;
1723 --enable-debug=*) ;;
1724 --disable-debug) ;;
1726 # Real 2nd pass
1727 --enable-mencoder) _mencoder=yes ;;
1728 --disable-mencoder) _mencoder=no ;;
1729 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
1730 --disable-dynamic-plugins) _dynamic_plugins=no ;;
1731 --enable-x11) _x11=yes ;;
1732 --disable-x11) _x11=no ;;
1733 --enable-xv) _xv=yes ;;
1734 --disable-xv) _xv=no ;;
1735 --enable-xvmc) _xvmc=yes ;;
1736 --disable-xvmc) _xvmc=no ;;
1737 --enable-sdl) _sdl=yes ;;
1738 --disable-sdl) _sdl=no ;;
1739 --enable-directx) _directx=yes ;;
1740 --disable-directx) _directx=no ;;
1741 --enable-win32waveout) _win32waveout=yes ;;
1742 --disable-win32waveout) _win32waveout=no ;;
1743 --enable-nas) _nas=yes ;;
1744 --disable-nas) _nas=no ;;
1745 --enable-png) _png=yes ;;
1746 --disable-png) _png=no ;;
1747 --enable-jpeg) _jpg=yes ;;
1748 --disable-jpeg) _jpg=no ;;
1749 --enable-pnm) _pnm=yes ;;
1750 --disable-pnm) _pnm=no ;;
1751 --enable-md5sum) _md5sum=yes ;;
1752 --disable-md5sum) _md5sum=no ;;
1753 --enable-gif) _gif=yes ;;
1754 --disable-gif) _gif=no ;;
1755 --enable-gl) _gl=yes ;;
1756 --disable-gl) _gl=no ;;
1757 --enable-ggi) _ggi=yes ;;
1758 --disable-ggi) _ggi=no ;;
1759 --enable-ggiwmh) _ggiwmh=yes ;;
1760 --disable-ggiwmh) _ggiwmh=no ;;
1761 --enable-aa) _aa=yes ;;
1762 --disable-aa) _aa=no ;;
1763 --enable-caca) _caca=yes ;;
1764 --disable-caca) _caca=no ;;
1765 --enable-svga) _svga=yes ;;
1766 --disable-svga) _svga=no ;;
1767 --enable-vesa) _vesa=yes ;;
1768 --disable-vesa) _vesa=no ;;
1769 --enable-fbdev) _fbdev=yes ;;
1770 --disable-fbdev) _fbdev=no ;;
1771 --enable-dvb) _dvb=yes ;;
1772 --disable-dvb) _dvb=no ;;
1773 --enable-dvbhead) _dvbhead=yes ;;
1774 --disable-dvbhead) _dvbhead=no ;;
1775 --enable-dxr2) _dxr2=yes ;;
1776 --disable-dxr2) _dxr2=no ;;
1777 --enable-dxr3) _dxr3=yes ;;
1778 --disable-dxr3) _dxr3=no ;;
1779 --enable-iconv) _iconv=yes ;;
1780 --disable-iconv) _iconv=no ;;
1781 --enable-langinfo) _langinfo=yes ;;
1782 --disable-langinfo) _langinfo=no ;;
1783 --enable-rtc) _rtc=yes ;;
1784 --disable-rtc) _rtc=no ;;
1785 --enable-mp1e) _mp1e=yes ;;
1786 --disable-mp1e) _mp1e=no ;;
1787 --enable-libdv) _libdv=yes ;;
1788 --disable-libdv) _libdv=no ;;
1789 --enable-ossaudio) _ossaudio=yes ;;
1790 --disable-ossaudio) _ossaudio=no ;;
1791 --enable-arts) _arts=yes ;;
1792 --disable-arts) _arts=no ;;
1793 --enable-esd) _esd=yes ;;
1794 --disable-esd) _esd=no ;;
1795 --enable-polyp) _polyp=yes ;;
1796 --disable-polyp) _polyp=no ;;
1797 --enable-jack) _jack=yes ;;
1798 --disable-jack) _jack=no ;;
1799 --enable-openal) _openal=yes ;;
1800 --disable-openal) _openal=no ;;
1801 --enable-mad) _mad=yes ;;
1802 --disable-mad) _mad=no ;;
1803 --enable-toolame) _toolame=yes ;;
1804 --disable-toolame) _toolame=no ;;
1805 --enable-twolame) _twolame=yes ;;
1806 --disable-twolame) _twolame=no ;;
1807 --enable-libcdio) _libcdio=yes ;;
1808 --disable-libcdio) _libcdio=no ;;
1809 --enable-liblzo) _liblzo=yes ;;
1810 --disable-liblzo) _liblzo=no ;;
1811 --enable-vorbis) _vorbis=yes ;;
1812 --disable-vorbis) _vorbis=no ;;
1813 --enable-speex) _speex=yes ;;
1814 --disable-speex) _speex=no ;;
1815 --enable-internal-tremor) _tremor_internal=yes ;;
1816 --disable-internal-tremor) _tremor_internal=no ;;
1817 --enable-tremor-low) _tremor_low=yes ;;
1818 --disable-tremor-low) _tremor_low=no ;;
1819 --enable-external-tremor) _tremor=yes ;;
1820 --disable-external-tremor) _tremor=no ;;
1821 --enable-theora) _theora=yes ;;
1822 --disable-theora) _theora=no ;;
1823 --enable-mp3lib) _mp3lib=yes ;;
1824 --disable-mp3lib) _mp3lib=no ;;
1825 --enable-liba52) _liba52=yes ;;
1826 --disable-liba52) _liba52=no ;;
1827 --enable-libdts) _libdts=yes ;;
1828 --disable-libdts) _libdts=no ;;
1829 --enable-libmpeg2) _libmpeg2=yes ;;
1830 --disable-libmpeg2) _libmpeg2=no ;;
1831 --enable-musepack) _musepack=yes ;;
1832 --disable-musepack) _musepack=no ;;
1833 --enable-internal-faad) _faad_internal=yes _faad_external=no ;;
1834 --disable-internal-faad) _faad_internal=no ;;
1835 --enable-external-faad) _faad_external=yes _faad_internal=no ;;
1836 --disable-external-faad) _faad_external=no ;;
1837 --enable-faac) _faac=yes ;;
1838 --disable-faac) _faac=no ;;
1839 --enable-ladspa) _ladspa=yes ;;
1840 --disable-ladspa) _ladspa=no ;;
1841 --enable-xmms) _xmms=yes ;;
1842 --disable-xmms) _xmms=no ;;
1843 --enable-dvdread) _dvdread=yes ;;
1844 --disable-dvdread) _dvdread=no ;;
1845 --enable-mpdvdkit) _dvdkit=yes ;;
1846 --disable-mpdvdkit) _dvdkit=no ;;
1847 # dvdnav disabled, it does not work
1848 # --enable-dvdnav) _dvdnav=yes ;;
1849 # --disable-dvdnav) _dvdnav=no ;;
1850 --enable-xanim) _xanim=yes ;;
1851 --disable-xanim) _xanim=no ;;
1852 --enable-real) _real=yes ;;
1853 --disable-real) _real=no ;;
1854 --enable-live) _live=yes ;;
1855 --disable-live) _live=no ;;
1856 --enable-xinerama) _xinerama=yes ;;
1857 --disable-xinerama) _xinerama=no ;;
1858 --enable-mga) _mga=yes ;;
1859 --disable-mga) _mga=no ;;
1860 --enable-xmga) _xmga=yes ;;
1861 --disable-xmga) _xmga=no ;;
1862 --enable-vm) _vm=yes ;;
1863 --disable-vm) _vm=no ;;
1864 --enable-xf86keysym) _xf86keysym=yes ;;
1865 --disable-xf86keysym) _xf86keysym=no ;;
1866 --enable-mlib) _mlib=yes ;;
1867 --disable-mlib) _mlib=no ;;
1868 --enable-sunaudio) _sunaudio=yes ;;
1869 --disable-sunaudio) _sunaudio=no ;;
1870 --enable-sgiaudio) _sgiaudio=yes ;;
1871 --disable-sgiaudio) _sgiaudio=no ;;
1872 --enable-alsa) _alsa=yes ;;
1873 --disable-alsa) _alsa=no ;;
1874 --enable-tv) _tv=yes ;;
1875 --disable-tv) _tv=no ;;
1876 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1877 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1878 --enable-tv-v4l) _tv_v4l=yes ;;
1879 --disable-tv-v4l) _tv_v4l=no ;;
1880 --enable-tv-v4l2) _tv_v4l2=yes ;;
1881 --disable-tv-v4l2) _tv_v4l2=no ;;
1882 --enable-fastmemcpy) _fastmemcpy=yes ;;
1883 --disable-fastmemcpy) _fastmemcpy=no ;;
1884 --enable-network) _network=yes ;;
1885 --disable-network) _network=no ;;
1886 --enable-winsock2) _winsock2=yes ;;
1887 --disable-winsock2) _winsock2=no ;;
1888 --enable-smb) _smbsupport=yes ;;
1889 --disable-smb) _smbsupport=no ;;
1890 --enable-internal-vidix) _vidix_internal=yes ;;
1891 --disable-internal-vidix) _vidix_internal=no ;;
1892 --enable-external-vidix) _vidix_external=yes ;;
1893 --disable-external-vidix) _vidix_external=no ;;
1894 --enable-joystick) _joystick=yes ;;
1895 --disable-joystick) _joystick=no ;;
1896 --enable-xvid) _xvid=yes ;;
1897 --disable-xvid) _xvid=no ;;
1898 --enable-x264) _x264=yes ;;
1899 --disable-x264) _x264=no ;;
1900 --enable-divx4linux) _divx4linux=yes ;;
1901 --disable-divx4linux) _divx4linux=no ;;
1902 --enable-opendivx) _opendivx=yes ;;
1903 --disable-opendivx) _opendivx=no ;;
1904 --enable-libavutil) _libavutil=yes ;;
1905 --disable-libavutil) _libavutil=no ;;
1906 --enable-libavutil_so) _libavutil_so=yes ;;
1907 --disable-libavutil_so) _libavutil_so=no ;;
1908 --enable-libavcodec) _libavcodec=yes ;;
1909 --disable-libavcodec) _libavcodec=no ;;
1910 --enable-libavcodec_so) _libavcodec_so=yes ;;
1911 --disable-libavcodec_so) _libavcodec_so=no ;;
1912 --enable-amr_nb) _amr_nb=yes ;;
1913 --disable-amr_nb) _amr_nb=no ;;
1914 --enable-amr_nb-fixed) _amr_nb_fixed=yes ;;
1915 --disable-amr_nb-fixed) _amr_nb_fixed=no ;;
1916 --enable-amr_wb) _amr_wb=yes ;;
1917 --disable-amr_wb) _amr_wb=no ;;
1918 --enable-codec=*) _libavcodecs="$_libavcodecs `echo $ac_option | cut -d '=' -f 2`" ;;
1919 --disable-codec=*) _libavcodecs=`echo $_libavcodecs | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1920 --enable-libavformat) _libavformat=yes;;
1921 --disable-libavformat) _libavformat=no ;;
1922 --enable-libavformat_so) _libavformat_so=yes ;;
1923 --disable-libavformat_so) _libavformat_so=no ;;
1924 --enable-libpostproc) _libpostproc=yes ;;
1925 --disable-libpostproc) _libpostproc=no ;;
1926 --enable-libpostproc_so) _libpostproc_so=yes ;;
1927 --disable-libpostproc_so) _libpostproc_so=no ;;
1928 --enable-libfame) _fame=yes ;;
1929 --disable-libfame) _fame=no ;;
1930 --enable-lirc) _lirc=yes ;;
1931 --disable-lirc) _lirc=no ;;
1932 --enable-lircc) _lircc=yes ;;
1933 --disable-lircc) _lircc=no ;;
1934 --enable-gui) _gui=yes ;;
1935 --disable-gui) _gui=no ;;
1936 --enable-old-gtk) _gtk1=yes ;;
1937 --enable-termcap) _termcap=yes ;;
1938 --disable-termcap) _termcap=no ;;
1939 --enable-termios) _termios=yes ;;
1940 --disable-termios) _termios=no ;;
1941 --enable-3dfx) _3dfx=yes ;;
1942 --disable-3dfx) _3dfx=no ;;
1943 --enable-s3fb) _s3fb=yes ;;
1944 --disable-s3fb) _s3fb=no ;;
1945 --enable-tdfxfb) _tdfxfb=yes ;;
1946 --disable-tdfxvid) _tdfxvid=no ;;
1947 --enable-tdfxvid) _tdfxvid=yes ;;
1948 --disable-tga) _tga=no ;;
1949 --enable-tga) _tga=yes ;;
1950 --disable-tdfxfb) _tdfxfb=no ;;
1951 --enable-directfb) _directfb=yes ;;
1952 --disable-directfb) _directfb=no ;;
1953 --enable-zr) _zr=yes ;;
1954 --disable-zr) _zr=no ;;
1955 --enable-bl) _bl=yes ;;
1956 --disable-bl) _bl=no ;;
1957 --enable-mtrr) _mtrr=yes ;;
1958 --disable-mtrr) _mtrr=no ;;
1959 --enable-largefiles) _largefiles=yes ;;
1960 --disable-largefiles) _largefiles=no ;;
1961 --enable-shm) _shm=yes ;;
1962 --disable-shm) _shm=no ;;
1963 --enable-select) _select=yes ;;
1964 --disable-select) _select=no ;;
1965 --enable-linux-devfs) _linux_devfs=yes ;;
1966 --disable-linux-devfs) _linux_devfs=no ;;
1967 --enable-cdparanoia) _cdparanoia=yes ;;
1968 --disable-cdparanoia) _cdparanoia=no ;;
1969 --enable-big-endian) _big_endian=yes ;;
1970 --disable-big-endian) _big_endian=no ;;
1971 --enable-freetype) _freetype=yes ;;
1972 --disable-freetype) _freetype=no ;;
1973 --enable-fontconfig) _fontconfig=yes ;;
1974 --disable-fontconfig) _fontconfig=no ;;
1975 --enable-unrarlib) _unrarlib=yes ;;
1976 --disable-unrarlib) _unrarlib=no ;;
1977 --enable-ftp) _ftp=yes ;;
1978 --disable-ftp) _ftp=no ;;
1979 --enable-vstream) _vstream=yes ;;
1980 --disable-vstream) _vstream=no ;;
1981 --enable-pthreads) _pthreads=yes ;;
1982 --disable-pthreads) _pthreads=no ;;
1984 --enable-fribidi) _fribidi=yes ;;
1985 --disable-fribidi) _fribidi=no ;;
1987 --enable-enca) _enca=yes ;;
1988 --disable-enca) _enca=no ;;
1990 --enable-inet6) _inet6=yes ;;
1991 --disable-inet6) _inet6=no ;;
1993 --enable-gethostbyname2) _gethostbyname2=yes ;;
1994 --disable-gethostbyname2) _gethostbyname2=no ;;
1996 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1997 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1998 --disable-dga) _dga=no ;;
2000 --enable-menu) _menu=yes ;;
2001 --disable-menu) _menu=no ;;
2003 --enable-qtx) _qtx=yes ;;
2004 --disable-qtx) _qtx=no ;;
2006 --enable-macosx) _macosx=yes ;;
2007 --disable-macosx) _macosx=no ;;
2008 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
2009 --disable-macosx-finder-support) _macosx_finder_support=no ;;
2010 --enable-macosx-bundle) _macosx_bundle=yes;;
2011 --disable-macosx-bundle) _macosx_bundle=no;;
2013 --enable-sortsub) _sortsub=yes ;;
2014 --disable-sortsub) _sortsub=no ;;
2016 --charset=*)
2017 _charset=`echo $ac_option | cut -d '=' -f 2`
2019 --language=*)
2020 _language=`echo $ac_option | cut -d '=' -f 2`
2022 # dvdnav disabled, it does not work
2023 # --with-libdvdnav=*)
2024 # _dvdnavdir=`echo $ac_option | cut -d '=' -f 2`
2025 # _dvdnav=yes
2026 # ;;
2028 --with-codecsdir=*)
2029 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
2030 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
2031 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
2033 --with-win32libdir=*)
2034 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
2035 _win32=yes
2037 --with-xanimlibdir=*)
2038 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
2039 _xanim=yes
2041 --with-reallibdir=*)
2042 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
2043 _real=yes
2045 --with-livelibdir=*)
2046 _livelibdir=`echo $ac_option | cut -d '=' -f 2`
2048 --with-toolamedir=*)
2049 _toolamedir=`echo $ac_option | cut -d '=' -f 2`
2051 --with-mlibdir=*)
2052 _mlibdir=`echo $ac_option | cut -d '=' -f 2`
2053 _mlib=yes
2056 --with-xmmslibdir=*)
2057 _xmmslibdir=`echo $ac_option | cut -d '=' -f 2`
2060 --with-xmmsplugindir=*)
2061 _xmmsplugindir=`echo $ac_option | cut -d '=' -f 2`
2064 --enable-crash-debug)
2065 _crash_debug=yes
2067 --disable-crash-debug)
2068 _crash_debug=no
2070 --enable-sighandler)
2071 _sighandler=yes
2073 --disable-sighandler)
2074 _sighandler=no
2077 --enable-sse) _sse=yes ;;
2078 --disable-sse) _sse=no ;;
2079 --enable-sse2) _sse2=yes ;;
2080 --disable-sse2) _sse2=no ;;
2081 --enable-mmxext) _mmxext=yes ;;
2082 --disable-mmxext) _mmxext=no ;;
2083 --enable-3dnow) _3dnow=yes ;;
2084 --disable-3dnow) _3dnow=no _3dnowext=no ;;
2085 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
2086 --disable-3dnowext) _3dnowext=no ;;
2087 --enable-altivec) _altivec=yes ;;
2088 --disable-altivec) _altivec=no ;;
2089 --enable-mmx) _mmx=yes ;;
2090 --disable-mmx) # 3Dnow! and MMX2 require MMX
2091 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
2093 --enable-win32) _win32=yes ;;
2094 --disable-win32) _win32=no _dshow=no ;;
2095 --enable-dshow) _win32=yes _dshow=yes ;;
2096 --disable-dshow) _dshow=no ;;
2098 --with-x11incdir=*)
2099 _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2101 --with-x11libdir=*)
2102 _x11_paths=`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2104 --with-dxr2incdir=*)
2105 _inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2107 --with-xvmclib=*)
2108 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
2110 --with-dvbincdir=*)
2111 _inc_dvb=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2113 --with-xvidlibdir=*)
2114 _ld_xvid=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2116 --with-xvidincdir=*)
2117 _inc_xvid=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2119 --with-dtslibdir=*)
2120 _ld_libdts=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2122 --with-dtsincdir=*)
2123 _inc_libdts=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2125 --with-x264libdir=*)
2126 _ld_x264=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2128 --with-x264incdir=*)
2129 _inc_x264=-I`echo $ac_option | cut -d '=' -f 2 |sed 's,:, -I,g'`
2131 --with-sdl-config=*)
2132 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
2134 --with-freetype-config=*)
2135 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
2137 --with-fribidi-config=*)
2138 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
2140 --with-gtk-config=*)
2141 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
2143 --with-glib-config=*)
2144 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
2146 # dvdnav disabled, it does not work
2147 # --with-dvdnav-config=*)
2148 # _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
2149 # ;;
2150 --with-madlibdir=*)
2151 _ld_mad=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2153 --with-cdparanoiaincdir=*)
2154 _inc_cdparanoia=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
2156 --with-cdparanoialibdir=*)
2157 _ld_cdparanoia=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2159 --with-termcaplib=*)
2160 _ld_termcap=-l`echo $ac_option | cut -d '=' -f 2`
2161 _termcap=yes
2163 --prefix=*)
2164 _prefix=`echo $ac_option | cut -d '=' -f 2`
2166 --bindir=*)
2167 _bindir=`echo $ac_option | cut -d '=' -f 2`
2169 --datadir=*)
2170 _datadir=`echo $ac_option | cut -d '=' -f 2`
2172 --mandir=*)
2173 _mandir=`echo $ac_option | cut -d '=' -f 2`
2175 --confdir=*)
2176 _confdir=`echo $ac_option | cut -d '=' -f 2`
2178 --libdir=*)
2179 _libdir=`echo $ac_option | cut -d '=' -f 2`
2183 echo "Unknown parameter: $ac_option"
2184 exit 1
2187 esac
2188 done
2190 # Atmos: moved this here, to be correct, if --prefix is specified
2191 test -z "$_bindir" && _bindir="$_prefix/bin"
2192 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
2193 test -z "$_mandir" && _mandir="$_prefix/man"
2194 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
2195 test -z "$_libdir" && _libdir="$_prefix/lib"
2196 test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
2198 if x86 ; then
2199 # Checking assembler (_as) compatibility...
2200 # Added workaround for older as that reads from stdin by default - atmos
2201 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2202 echocheck "assembler ($_as $as_version)"
2204 _pref_as_version='2.9.1'
2205 echo 'nop' > $TMPS
2206 if test "$_mmx" = yes ; then
2207 echo 'emms' >> $TMPS
2209 if test "$_3dnow" = yes ; then
2210 _pref_as_version='2.10.1'
2211 echo 'femms' >> $TMPS
2213 if test "$_3dnowext" = yes ; then
2214 _pref_as_version='2.10.1'
2215 echo 'pswapd %mm0, %mm0' >> $TMPS
2217 if test "$_mmxext" = yes ; then
2218 _pref_as_version='2.10.1'
2219 echo 'movntq %mm0, (%eax)' >> $TMPS
2221 if test "$_sse" = yes ; then
2222 _pref_as_version='2.10.1'
2223 echo 'xorps %xmm0, %xmm0' >> $TMPS
2225 #if test "$_sse2" = yes ; then
2226 # _pref_as_version='2.11'
2227 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2229 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2231 if test "$as_verc_fail" != yes ; then
2232 echores "ok"
2233 else
2234 _res_comment="Upgrade binutils to ${_pref_as_version} ..."
2235 echores "failed"
2236 die "obsolete binutils version"
2240 #FIXME: This should happen before the check for CFLAGS..
2241 if ppc ; then
2243 # check if altivec is supported by the compiler, and how to enable it
2245 _altivec_gcc_flags=''
2247 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2248 echocheck "GCC altivec support"
2250 p=''
2251 cat > $TMPC << EOF
2252 int main() {
2253 return 0;
2256 FSF_flags='-maltivec -mabi=altivec'
2257 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2259 # check for Darwin-style flags first, since
2260 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2261 # accepts but ignores FSF-style flags...
2263 if test -z "$p"; then
2264 cc_check $Darwin_flags && p='Darwin'
2266 if test -z "$p"; then
2267 cc_check $FSF_flags && p='FSF'
2270 case $p in
2271 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2272 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2273 *) _altivec=no ;;
2274 esac
2276 if test -z "$p"; then
2277 p=none
2278 else
2279 p="$p-style ($_altivec_gcc_flags)"
2282 echores "$p"
2285 # check if <altivec.h> should be included
2287 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2289 if test "$_altivec" = yes ; then
2290 echocheck "altivec.h"
2291 cat > $TMPC << EOF
2292 #include <altivec.h>
2293 int main(void) { return 0; }
2295 _have_altivec_h=no
2296 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2297 if test "$_have_altivec_h" = yes ; then
2298 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2300 echores "$_have_altivec_h"
2303 # disable runtime cpudetection if
2304 # - we cannot generate altivec code
2305 # - altivec is disabled by the user
2307 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2308 _runtime_cpudetection=no
2311 # show that we are optimizing for altivec (if enabled and supported)
2313 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2314 _optimizing="$_optimizing altivec"
2317 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2319 if test "$_altivec" = yes ; then
2320 #FIXME: _mcpu is used for CFLAGS, this needs to be set earlier
2321 #_mcpu="$_mcpu $_altivec_gcc_flags"
2322 CFLAGS="$CFLAGS $_altivec_gcc_flags"
2325 # setup _def_altivec correctly
2327 if test "$_altivec" = yes ; then
2328 _def_altivec='#define HAVE_ALTIVEC 1'
2329 else
2330 _def_altivec='#undef HAVE_ALTIVEC'
2334 _def_mmx='#undef HAVE_MMX'
2335 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2336 _def_mmxext='#undef HAVE_MMX2'
2337 test "$_mmxext" = yes && _def_mmxext='#define HAVE_MMX2 1'
2338 _def_3dnow='#undef HAVE_3DNOW'
2339 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2340 _def_3dnowext='#undef HAVE_3DNOWEX'
2341 test "$_3dnowext" = yes && _def_3dnowext='#define HAVE_3DNOWEX 1'
2342 _def_sse='#undef HAVE_SSE'
2343 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2344 _def_sse2='#undef HAVE_SSE2'
2345 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2347 # Checking kernel version...
2348 if x86 && linux ; then
2349 _k_verc_problem=no
2350 kernel_version=`uname -r 2>&1`
2351 echocheck "$system_name kernel version"
2352 case "$kernel_version" in
2353 '') kernel_version="?.??"; _k_verc_fail=yes;;
2354 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2355 _k_verc_problem=yes;;
2356 esac
2357 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2358 _k_verc_fail=yes
2360 if test "$_k_verc_fail" ; then
2361 echores "$kernel_version, fail"
2362 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2363 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2364 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2365 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2366 echo "2.2.x you must upgrade it to get SSE support!"
2367 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2368 else
2369 echores "$kernel_version, ok"
2373 if test "$_vidix_internal" = auto ; then
2374 _vidix_internal=no
2375 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2376 x86 && _vidix_internal=yes
2377 x86_64 && _vidix_internal=yes
2378 ppc && linux && _vidix_internal=yes
2379 alpha && linux && _vidix_internal=yes
2380 qnx && _vidix_internal=no
2381 sunos && _vidix_internal=no
2382 beos && _vidix_internal=no
2383 darwin && _vidix_internal=no
2386 echocheck "MPlayer binary name"
2387 if win32 ; then
2388 _prg="mplayer.exe"
2389 _prg_mencoder="mencoder.exe"
2390 else
2391 _prg="mplayer"
2392 _prg_mencoder="mencoder"
2394 echores $_prg
2397 # On QNX we must link to libph - Gabucino
2398 if qnx ; then
2399 _ld_arch="$_ld_arch -lph"
2402 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2403 _awk=
2404 if test "$_vidix_internal" = yes ; then
2405 _awk_verc_fail=yes
2406 echocheck "awk"
2407 for _awk in mawk gawk nawk awk; do
2408 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2409 _awk_verc_fail=no
2410 break
2412 done
2413 test "$_awk_verc_fail" = yes && _awk=no
2414 echores "$_awk"
2415 if test "$_awk_verc_fail" = yes; then
2416 echo "VIDIX needs awk, but no working implementation was found!"
2417 echo "Try the GNU version, which can be downloaded from:"
2418 echo "ftp://ftp.gnu.org/gnu/gawk/"
2419 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2420 die "no awk"
2424 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2425 if irix ; then
2426 _ranlib='ar -r'
2427 elif linux ; then
2428 _ranlib='true'
2431 ######################
2432 # MAIN TESTS GO HERE #
2433 ######################
2436 echocheck "extra headers"
2437 if test "$_inc_extra" ; then
2438 echores "$_inc_extra"
2439 else
2440 echores "none"
2444 echocheck "extra libs"
2445 if test "$_ld_extra" ; then
2446 echores "$_ld_extra"
2447 else
2448 echores "none"
2451 echocheck "-lposix"
2452 cat > $TMPC <<EOF
2453 int main(void) { return 0; }
2455 if cc_check -lposix ; then
2456 _ld_arch="$_ld_arch -lposix"
2457 echores "yes"
2458 else
2459 echores "no"
2462 echocheck "-lm"
2463 cat > $TMPC <<EOF
2464 int main(void) { return 0; }
2466 if cc_check -lm ; then
2467 _ld_lm="-lm"
2468 echores "yes"
2469 else
2470 _ld_lm=""
2471 echores "no"
2475 echocheck "langinfo"
2476 if test "$_langinfo" = auto ; then
2477 cat > $TMPC <<EOF
2478 #include <langinfo.h>
2479 int main(void) { nl_langinfo(CODESET); return 0; }
2481 _langinfo=no
2482 cc_check && _langinfo=yes
2484 if test "$_langinfo" = yes ; then
2485 _def_langinfo='#define USE_LANGINFO 1'
2486 else
2487 _def_langinfo='#undef USE_LANGINFO'
2489 echores "$_langinfo"
2492 echocheck "language"
2493 test -z "$_language" && _language=$LINGUAS
2494 _language=`echo $_language | sed 's/,/ /g'`
2495 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2496 for lang in $_language ; do
2497 test "$lang" = all && lang=en
2498 if test -f "help/help_mp-${lang}.h" ; then
2499 _language=$lang
2500 break
2501 else
2502 echo -n "$lang not found, "
2503 _language=`echo $_language | sed "s/$lang *//"`
2505 done
2506 test -z "$_language" && _language=en
2507 _mp_help="help/help_mp-${_language}.h"
2508 test -f $_mp_help || die "$_mp_help not found"
2509 for lang in $LANGUAGES ; do
2510 if test -f "DOCS/man/$lang/mplayer.1" ; then
2511 MAN_LANG="$MAN_LANG $lang"
2513 done
2514 _doc_lang=$_language
2515 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2516 echores "using $_language (man pages: $MAN_LANG)"
2519 echocheck "enable sighandler"
2520 if test "$_sighandler" = yes ; then
2521 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2522 else
2523 _def_sighandler='#undef ENABLE_SIGHANDLER'
2525 echores "$_sighandler"
2527 echocheck "runtime cpudetection"
2528 if test "$_runtime_cpudetection" = yes ; then
2529 _optimizing="Runtime CPU-Detection enabled"
2530 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2531 else
2532 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2534 echores "$_runtime_cpudetection"
2537 echocheck "restrict keyword"
2538 for restrict_keyword in restrict __restrict __restrict__ ; do
2539 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2540 if cc_check; then
2541 _def_restrict_keyword=$restrict_keyword
2542 break;
2544 done
2545 if [ -n "$_def_restrict_keyword" ]; then
2546 echores "$_def_restrict_keyword"
2547 else
2548 echores "none"
2550 # Avoid infinite recursion loop ("#define restrict restrict")
2551 if [ "$_def_restrict_keyword" != "restrict" ]; then
2552 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2553 else
2554 _def_restrict_keyword=""
2558 echocheck "__builtin_expect"
2559 # GCC branch prediction hint
2560 cat > $TMPC << EOF
2561 int foo (int a) {
2562 a = __builtin_expect (a, 10);
2563 return a == 10 ? 0 : 1;
2565 int main() { return foo(10) && foo(0); }
2567 _builtin_expect=no
2568 cc_check && _builtin_expect=yes
2569 if test "$_builtin_expect" = yes ; then
2570 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2571 else
2572 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2574 echores "$_builtin_expect"
2577 echocheck "kstat"
2578 cat > $TMPC << EOF
2579 #include <kstat.h>
2580 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2582 _kstat=no
2583 cc_check -lkstat && _kstat=yes
2584 if test "$_kstat" = yes ; then
2585 _def_kstat="#define HAVE_LIBKSTAT 1"
2586 _ld_arch="-lkstat $_ld_arch"
2587 else
2588 _def_kstat="#undef HAVE_LIBKSTAT"
2590 echores "$_kstat"
2593 echocheck "posix4"
2594 # required for nanosleep on some systems
2595 cat > $TMPC << EOF
2596 #include <time.h>
2597 int main(void) { (void) nanosleep(0, 0); return 0; }
2599 _posix4=no
2600 cc_check -lposix4 && _posix4=yes
2601 if test "$_posix4" = yes ; then
2602 _ld_arch="-lposix4 $_ld_arch"
2604 echores "$_posix4"
2606 echocheck "lrintf"
2607 cat > $TMPC << EOF
2608 #include <math.h>
2609 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2611 _lrintf=no
2612 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2613 if test "$_lrintf" = yes ; then
2614 _def_lrintf="#define HAVE_LRINTF 1"
2615 else
2616 _def_lrintf="#undef HAVE_LRINTF"
2618 echores "$_lrintf"
2620 echocheck "round"
2621 cat > $TMPC << EOF
2622 #include <math.h>
2623 int main(void) { (void) round(0.0); return 0; }
2625 _round=no
2626 cc_check $_ld_lm && _round=yes
2627 if test "$_round" = yes ; then
2628 _def_round="#define HAVE_ROUND 1"
2629 else
2630 _def_round="#undef HAVE_ROUND"
2632 echores "$_round"
2634 echocheck "nanosleep"
2635 # also check for nanosleep
2636 cat > $TMPC << EOF
2637 #include <time.h>
2638 int main(void) { (void) nanosleep(0, 0); return 0; }
2640 _nanosleep=no
2641 cc_check $_ld_arch && _nanosleep=yes
2642 if test "$_nanosleep" = yes ; then
2643 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2644 else
2645 _def_nanosleep='#undef HAVE_NANOSLEEP'
2647 echores "$_nanosleep"
2650 echocheck "socklib"
2651 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2652 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2653 cat > $TMPC << EOF
2654 #include <netdb.h>
2655 #include <sys/socket.h>
2656 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2658 for _ld_tmp in "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2659 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && break
2660 done
2661 if test $_winsock2 = auto && not cygwin ; then
2662 _winsock2=no
2663 cat > $TMPC << EOF
2664 #include <winsock2.h>
2665 int main(void) { (void) gethostbyname(0); return 0; }
2667 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2669 if test "$_ld_sock" ; then
2670 _res_comment="using $_ld_sock"
2671 echores "yes"
2672 else
2673 echores "no"
2677 if test $_winsock2 = yes ; then
2678 _ld_sock="-lws2_32"
2679 _def_winsock2='#define HAVE_WINSOCK2 1'
2680 else
2681 _def_winsock2='#undef HAVE_WINSOCK2'
2685 _use_aton=no
2686 echocheck "inet_pton()"
2687 cat > $TMPC << EOF
2688 #include <sys/types.h>
2689 #include <sys/socket.h>
2690 #include <arpa/inet.h>
2691 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2693 if test "$_winsock2" = yes ; then
2694 _res_comment="using winsock2 functions instead"
2695 echores "no"
2696 elif cc_check $_ld_sock ; then
2697 # NOTE: Linux has libresolv but does not need it
2699 _res_comment="using $_ld_sock"
2700 echores "yes"
2701 elif cc_check $_ld_sock -lresolv ; then
2702 # NOTE: needed for SunOS at least
2703 _ld_sock="$_ld_sock -lresolv"
2704 _res_comment="using $_ld_sock"
2705 echores "yes"
2706 else
2707 _res_comment="trying inet_aton next"
2708 echores "no"
2710 echocheck "inet_aton()"
2711 cat > $TMPC << EOF
2712 #include <sys/types.h>
2713 #include <sys/socket.h>
2714 #include <arpa/inet.h>
2715 int main(void) { (void) inet_aton(0, 0); return 0; }
2717 _use_aton=yes
2718 if cc_check $_ld_sock ; then
2719 # NOTE: Linux has libresolv but does not need it
2721 _res_comment="using $_ld_sock"
2722 elif cc_check $_ld_sock -lresolv ; then
2723 # NOTE: needed for SunOS at least
2724 _ld_sock="$_ld_sock -lresolv"
2725 _res_comment="using $_ld_sock"
2726 else
2727 _use_aton=no
2728 _network=no
2729 _res_comment="network support disabled"
2731 echores "$_use_aton"
2734 _def_use_aton='#undef USE_ATON'
2735 if test "$_use_aton" != no; then
2736 _def_use_aton='#define USE_ATON 1'
2740 echocheck "inttypes.h (required)"
2741 cat > $TMPC << EOF
2742 #include <inttypes.h>
2743 int main(void) { return 0; }
2745 _inttypes=no
2746 cc_check && _inttypes=yes
2747 echores "$_inttypes"
2749 if test "$_inttypes" = no ; then
2750 echocheck "bitypes.h (inttypes.h predecessor)"
2751 cat > $TMPC << EOF
2752 #include <sys/bitypes.h>
2753 int main(void) { return 0; }
2755 cc_check && _inttypes=yes
2756 if test "$_inttypes" = yes ; then
2757 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."
2758 else
2759 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2764 echocheck "int_fastXY_t in inttypes.h"
2765 cat > $TMPC << EOF
2766 #include <inttypes.h>
2767 int main(void) {
2768 volatile int_fast16_t v= 0;
2769 return v; }
2771 _fast_inttypes=no
2772 cc_check && _fast_inttypes=yes
2773 if test "$_fast_inttypes" = yes ; then
2774 # nothing to do
2776 else
2777 _def_fast_inttypes='
2778 typedef signed char int_fast8_t;
2779 typedef signed int int_fast16_t;
2780 typedef signed int int_fast32_t;
2781 typedef unsigned char uint_fast8_t;
2782 typedef unsigned int uint_fast16_t;
2783 typedef unsigned int uint_fast32_t;'
2785 echores "$_fast_inttypes"
2788 echocheck "word size"
2789 _mp_wordsize="#undef MP_WORDSIZE"
2790 cat > $TMPC << EOF
2791 #include <stdio.h>
2792 #include <sys/types.h>
2793 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2795 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2796 echores "$_wordsize"
2799 echocheck "stddef.h"
2800 cat > $TMPC << EOF
2801 #include <stddef.h>
2802 int main(void) { return 0; }
2804 _stddef=no
2805 cc_check && _stddef=yes
2806 if test "$_stddef" = yes ; then
2807 _def_stddef='#define HAVE_STDDEF_H 1'
2808 else
2809 _def_stddef='#undef HAVE_STDDEF_H'
2811 echores "$_stddef"
2814 echocheck "malloc.h"
2815 cat > $TMPC << EOF
2816 #include <malloc.h>
2817 int main(void) { (void) malloc(0); return 0; }
2819 _malloc=no
2820 cc_check && _malloc=yes
2821 if test "$_malloc" = yes ; then
2822 _def_malloc='#define HAVE_MALLOC_H 1'
2823 else
2824 _def_malloc='#undef HAVE_MALLOC_H'
2826 # malloc.h emits a warning in FreeBSD and OpenBSD
2827 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2828 echores "$_malloc"
2831 echocheck "memalign()"
2832 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2833 cat > $TMPC << EOF
2834 #include <malloc.h>
2835 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2837 _memalign=no
2838 cc_check && _memalign=yes
2839 if test "$_memalign" = yes ; then
2840 _def_memalign='#define HAVE_MEMALIGN 1'
2841 else
2842 _def_memalign='#undef HAVE_MEMALIGN'
2844 echores "$_memalign"
2847 echocheck "alloca.h"
2848 cat > $TMPC << EOF
2849 #include <alloca.h>
2850 int main(void) { (void) alloca(0); return 0; }
2852 _alloca=no
2853 cc_check && _alloca=yes
2854 if cc_check ; then
2855 _def_alloca='#define HAVE_ALLOCA_H 1'
2856 else
2857 _def_alloca='#undef HAVE_ALLOCA_H'
2859 echores "$_alloca"
2862 echocheck "mman.h"
2863 cat > $TMPC << EOF
2864 #include <sys/types.h>
2865 #include <sys/mman.h>
2866 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2868 _mman=no
2869 cc_check && _mman=yes
2870 if test "$_mman" = yes ; then
2871 _def_mman='#define HAVE_SYS_MMAN_H 1'
2872 else
2873 _def_mman='#undef HAVE_SYS_MMAN_H'
2875 echores "$_mman"
2877 cat > $TMPC << EOF
2878 #include <sys/types.h>
2879 #include <sys/mman.h>
2880 int main(void) { void *p = MAP_FAILED; return 0; }
2882 _mman_has_map_failed=no
2883 cc_check && _mman_has_map_failed=yes
2884 if test "$_mman_has_map_failed" = yes ; then
2885 _def_mman_has_map_failed=''
2886 else
2887 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2890 echocheck "dynamic loader"
2891 cat > $TMPC << EOF
2892 #include <dlfcn.h>
2893 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2895 _dl=no
2896 for _ld_tmp in "" "-ldl" ; do
2897 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2898 done
2899 if test "$_dl" = yes ; then
2900 _def_dl='#define HAVE_LIBDL 1'
2901 else
2902 _def_dl='#undef HAVE_LIBDL'
2904 echores "$_dl"
2907 echocheck "dynamic a/v plugins support"
2908 if test "$_dl" = no ; then
2909 _dynamic_plugins=no
2911 if test "$_dynamic_plugins" = yes ; then
2912 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
2913 else
2914 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
2916 echores "$_dynamic_plugins"
2919 #echocheck "dynamic linking"
2920 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
2921 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
2922 #cat > $TMPC << EOF
2923 #int main(void) { return 0; }
2924 #EOF
2925 #if cc_check -rdynamic ; then
2926 # _ld_dl_dynamic='-rdynamic'
2927 #elif cc_check -Bdynamic ; then
2928 # _ld_dl_dynamic='-Bdynamic'
2929 #elif cc_check ; then
2930 # _ld_dl_dynamic=''
2932 #echores "using $_ld_dl_dynamic"
2934 _def_threads='#undef HAVE_THREADS'
2936 echocheck "pthread"
2937 if test "$_pthreads" != no ; then
2938 cat > $TMPC << EOF
2939 #include <pthread.h>
2940 void* func(void *arg) { return arg; }
2941 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
2943 _pthreads=no
2944 if not hpux ; then
2945 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2946 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2947 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
2948 done
2951 if test "$_pthreads" = yes ; then
2952 _res_comment="using $_ld_pthread"
2953 _def_pthreads='#define HAVE_PTHREADS 1'
2954 _def_threads='#define HAVE_THREADS 1'
2955 else
2956 _res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
2957 _def_pthreads='#undef HAVE_PTHREADS'
2958 _nas=no ; _tv_v4l=no ; _macosx=no
2959 if not mingw32 ; then
2960 _win32=no
2963 echores "$_pthreads"
2966 echocheck "iconv"
2967 if test "$_iconv" = auto ; then
2968 _iconv_tmp='#include <iconv.h>'
2970 cat > $TMPC << EOF
2971 #include <stdio.h>
2972 #include <unistd.h>
2973 $_iconv_tmp
2974 #define INBUFSIZE 1024
2975 #define OUTBUFSIZE 4096
2977 char inbuffer[INBUFSIZE];
2978 char outbuffer[OUTBUFSIZE];
2980 int main(void) {
2981 size_t numread;
2982 iconv_t icdsc;
2983 char *tocode="UTF-8";
2984 char *fromcode="cp1250";
2985 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
2986 while ((numread = read (0, inbuffer, INBUFSIZE))) {
2987 char *iptr=inbuffer;
2988 char *optr=outbuffer;
2989 size_t inleft=numread;
2990 size_t outleft=OUTBUFSIZE;
2991 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
2992 != (size_t)(-1)) {
2993 write (1, outbuffer, OUTBUFSIZE - outleft);
2996 if (iconv_close(icdsc) == -1)
3001 _iconv=no
3002 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3003 cc_check $_ld_lm $_ld_tmp && _ld_iconv="$_ld_tmp" && _iconv=yes && break
3004 done
3006 if test "$_iconv" = yes ; then
3007 _def_iconv='#define USE_ICONV 1'
3008 else
3009 _def_iconv='#undef USE_ICONV'
3011 echores "$_iconv"
3014 echocheck "sys/soundcard.h"
3015 cat > $TMPC << EOF
3016 #include <sys/soundcard.h>
3017 int main(void) { return 0; }
3019 _sys_soundcard=no
3020 cc_check && _sys_soundcard=yes
3021 if test "$_sys_soundcard" = yes ; then
3022 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
3023 _inc_soundcard='#include <sys/soundcard.h>'
3024 else
3025 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
3027 echores "$_sys_soundcard"
3029 if test "$_sys_soundcard" != yes ; then
3030 echocheck "soundcard.h"
3031 cat > $TMPC << EOF
3032 #include <soundcard.h>
3033 int main(void) { return 0; }
3035 _soundcard=no
3036 cc_check && _soundcard=yes
3037 if linux || test "$_ossaudio" != no ; then
3038 # use soundcard.h on Linux, or when OSS support is enabled
3039 echores "$_soundcard"
3040 else
3041 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
3042 _res_comment= "but ignored!"
3043 echores "$_soundcard"
3044 _soundcard=no
3046 if test "$_soundcard" = yes ; then
3047 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
3048 _inc_soundcard='#include <soundcard.h>'
3049 else
3050 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3052 else
3053 _def_soundcard='#undef HAVE_SOUNDCARD_H'
3057 echocheck "sys/dvdio.h"
3058 cat > $TMPC << EOF
3059 #include <unistd.h>
3060 #include <sys/dvdio.h>
3061 int main(void) { return 0; }
3063 _dvdio=no
3064 cc_check && _dvdio=yes
3065 if test "$_dvdio" = yes ; then
3066 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3067 else
3068 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3070 echores "$_dvdio"
3073 echocheck "sys/cdio.h"
3074 cat > $TMPC << EOF
3075 #include <unistd.h>
3076 #include <sys/cdio.h>
3077 int main(void) { return 0; }
3079 _cdio=no
3080 cc_check && _cdio=yes
3081 if test "$_cdio" = yes ; then
3082 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3083 else
3084 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3086 echores "$_cdio"
3089 echocheck "linux/cdrom.h"
3090 cat > $TMPC << EOF
3091 #include <sys/types.h>
3092 #include <linux/cdrom.h>
3093 int main(void) { return 0; }
3095 _cdrom=no
3096 cc_check && _cdrom=yes
3097 if test "$_cdrom" = yes ; then
3098 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3099 else
3100 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3102 echores "$_cdrom"
3105 echocheck "dvd.h"
3106 cat > $TMPC << EOF
3107 #include <dvd.h>
3108 int main(void) { return 0; }
3110 _dvd=no
3111 cc_check && _dvd=yes
3112 if test "$_dvd" = yes ; then
3113 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3114 else
3115 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3117 echores "$_dvd"
3120 echocheck "BSDI dvd.h"
3121 cat > $TMPC << EOF
3122 #include <dvd.h>
3123 int main(void) { return 0; }
3125 _bsdi_dvd=no
3126 cc_check && _bsdi_dvd=yes
3127 if test "$_bsdi_dvd" = yes ; then
3128 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3129 else
3130 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3132 echores "$_bsdi_dvd"
3135 # also used by AIX, but AIX does not support VCD and/or libdvdread
3136 echocheck "HP-UX SCSI header"
3137 cat > $TMPC << EOF
3138 #include <sys/scsi.h>
3139 int main(void) { return 0; }
3141 _hpux_scsi_h=no
3142 cc_check && _hpux_scsi_h=yes
3143 if test "$_hpux_scsi_h" = yes ; then
3144 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3145 else
3146 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3148 echores "$_hpux_scsi_h"
3151 echocheck "userspace SCSI headers (Solaris)"
3152 cat > $TMPC << EOF
3153 # include <unistd.h>
3154 # include <stropts.h>
3155 # include <sys/scsi/scsi_types.h>
3156 # include <sys/scsi/impl/uscsi.h>
3157 int main(void) { return 0; }
3159 _sol_scsi_h=no
3160 cc_check && _sol_scsi_h=yes
3161 if test "$_sol_scsi_h" = yes ; then
3162 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3163 else
3164 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3166 echores "$_sol_scsi_h"
3169 echocheck "termcap"
3170 if test "$_termcap" = auto ; then
3171 cat > $TMPC <<EOF
3172 int main(void) { tgetent(); return 0; }
3174 _termcap=no
3175 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3176 cc_check $_ld_tmp && _ld_termcap="$_ld_tmp" && _termcap=yes && break
3177 done
3179 if test "$_termcap" = yes ; then
3180 _def_termcap='#define USE_TERMCAP 1'
3181 _res_comment="using $_ld_termcap"
3182 else
3183 _def_termcap='#undef USE_TERMCAP'
3185 echores "$_termcap"
3188 echocheck "termios"
3189 if test "$_termios" = auto ; then
3190 cat > $TMPC <<EOF
3191 #include <sys/termios.h>
3192 int main(void) { return 0; }
3194 _termios=auto
3195 cc_check && _termios=yes
3196 _def_termios_h_name='sys/termios.h'
3198 # second test:
3199 if test "$_termios" = auto ; then
3200 cat > $TMPC <<EOF
3201 #include <termios.h>
3202 int main(void) { return 0; }
3204 _termios=no
3205 cc_check && _termios=yes
3206 _def_termios_h_name='termios.h'
3209 if test "$_termios" = yes ; then
3210 _def_termios='#define HAVE_TERMIOS 1'
3211 _def_termios_h='#undef HAVE_TERMIOS_H'
3212 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3214 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3215 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3216 elif test "$_def_termios_h_name" = 'termios.h' ; then
3217 _def_termios_h='#define HAVE_TERMIOS_H 1'
3219 _res_comment="using $_def_termios_h_name"
3220 else
3221 _def_termios='#undef HAVE_TERMIOS'
3222 _def_termios_h_name=''
3223 _termios=no
3225 echores "$_termios"
3228 echocheck "shm"
3229 if test "$_shm" = auto ; then
3230 cat > $TMPC << EOF
3231 #include <sys/types.h>
3232 #include <sys/shm.h>
3233 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3235 _shm=no
3236 cc_check && _shm=yes
3238 if test "$_shm" = yes ; then
3239 _def_shm='#define HAVE_SHM 1'
3240 else
3241 _def_shm='#undef HAVE_SHM'
3243 echores "$_shm"
3246 # XXX: FIXME, add runtime checking
3247 echocheck "linux devfs"
3248 echores "$_linux_devfs"
3251 echocheck "scandir()"
3252 cat > $TMPC << EOF
3253 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3255 _scandir=no
3256 cc_check && _scandir=yes
3257 if test "$_scandir" = yes ; then
3258 _def_scandir='#define HAVE_SCANDIR 1'
3259 else
3260 _def_scandir='#undef HAVE_SCANDIR'
3262 echores "$_scandir"
3265 echocheck "strsep()"
3266 cat > $TMPC << EOF
3267 #include <string.h>
3268 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3270 _strsep=no
3271 cc_check && _strsep=yes
3272 if test "$_strsep" = yes ; then
3273 _def_strsep='#define HAVE_STRSEP 1'
3274 else
3275 _def_strsep='#undef HAVE_STRSEP'
3277 echores "$_strsep"
3279 echocheck "strlcpy()"
3280 cat > $TMPC << EOF
3281 #include <string.h>
3282 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3284 _strlcpy=no
3285 cc_check && _strlcpy=yes
3286 if test "$_strlcpy" = yes ; then
3287 _def_strlcpy='#define HAVE_STRLCPY 1'
3288 else
3289 _def_strlcpy='#undef HAVE_STRLCPY'
3291 echores "$_strlcpy"
3293 echocheck "strlcat()"
3294 cat > $TMPC << EOF
3295 #include <string.h>
3296 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3298 _strlcat=no
3299 cc_check && _strlcat=yes
3300 if test "$_strlcat" = yes ; then
3301 _def_strlcat='#define HAVE_STRLCAT 1'
3302 else
3303 _def_strlcat='#undef HAVE_STRLCAT'
3305 echores "$_strlcat"
3307 echocheck "fseeko()"
3308 cat > $TMPC << EOF
3309 #include <stdio.h>
3310 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3312 _fseeko=no
3313 cc_check && _fseeko=yes
3314 if test "$_fseeko" = yes ; then
3315 _def_fseeko='#define HAVE_FSEEKO 1'
3316 else
3317 _def_fseeko='#undef HAVE_FSEEKO'
3319 echores "$_fseeko"
3321 echocheck "localtime_r()"
3322 cat > $TMPC << EOF
3323 #include <time.h>
3324 int main( void ) { localtime_r(NULL, NULL); }
3326 _localtime_r=no
3327 cc_check && _localtime_r=yes
3328 if test "$_localtime_r" = yes ; then
3329 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3330 else
3331 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3333 echores "$_localtime_r"
3335 echocheck "vsscanf()"
3336 cat > $TMPC << EOF
3337 #include <stdarg.h>
3338 int main(void) { vsscanf(0, 0, 0); return 0; }
3340 _vsscanf=no
3341 cc_check && _vsscanf=yes
3342 if test "$_vsscanf" = yes ; then
3343 _def_vsscanf='#define HAVE_VSSCANF 1'
3344 else
3345 _def_vsscanf='#undef HAVE_VSSCANF'
3347 echores "$_vsscanf"
3350 echocheck "swab()"
3351 cat > $TMPC << EOF
3352 #include <unistd.h>
3353 int main(void) { swab(0, 0, 0); return 0; }
3355 _swab=no
3356 cc_check && _swab=yes
3357 if test "$_swab" = yes ; then
3358 _def_swab='#define HAVE_SWAB 1'
3359 else
3360 _def_swab='#undef HAVE_SWAB'
3362 echores "$_swab"
3364 echocheck "POSIX select()"
3365 cat > $TMPC << EOF
3366 #include <stdio.h>
3367 #include <stdlib.h>
3368 #include <sys/types.h>
3369 #include <string.h>
3370 #include <sys/time.h>
3371 #include <unistd.h>
3372 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3374 _posix_select=no
3375 cc_check && _posix_select=yes
3376 if test "$_posix_select" = no ; then
3377 _def_no_posix_select='#define HAVE_NO_POSIX_SELECT 1'
3378 else
3379 _def_no_posix_select='#undef HAVE_NO_POSIX_SELECT'
3381 echores "$_posix_select"
3384 echocheck "gettimeofday()"
3385 cat > $TMPC << EOF
3386 #include <stdio.h>
3387 #include <sys/time.h>
3388 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3390 _gettimeofday=no
3391 cc_check && _gettimeofday=yes
3392 if test "$_gettimeofday" = yes ; then
3393 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3394 else
3395 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3397 echores "$_gettimeofday"
3400 echocheck "glob()"
3401 cat > $TMPC << EOF
3402 #include <stdio.h>
3403 #include <glob.h>
3404 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3406 _glob=no
3407 cc_check && _glob=yes
3408 if test "$_glob" = yes ; then
3409 _def_glob='#define HAVE_GLOB 1'
3410 else
3411 _def_glob='#undef HAVE_GLOB'
3413 echores "$_glob"
3416 echocheck "setenv()"
3417 cat > $TMPC << EOF
3418 #include <stdlib.h>
3419 int main (void){ setenv("","",0); return 0; }
3421 _setenv=no
3422 cc_check && _setenv=yes
3423 if test "$_setenv" = yes ; then
3424 _def_setenv='#define HAVE_SETENV 1'
3425 else
3426 _def_setenv='#undef HAVE_SETENV'
3428 echores "$_setenv"
3431 if sunos; then
3432 echocheck "sysi86()"
3433 cat > $TMPC << EOF
3434 #include <sys/sysi86.h>
3435 int main (void) { sysi86(0); return 0; }
3437 _sysi86=no
3438 cc_check && _sysi86=yes
3439 if test "$_sysi86" = yes ; then
3440 _def_sysi86='#define HAVE_SYSI86 1'
3441 else
3442 _def_sysi86='#undef HAVE_SYSI86'
3444 echores "$_sysi86"
3448 echocheck "sys/sysinfo.h"
3449 cat > $TMPC << EOF
3450 #include <sys/sysinfo.h>
3451 int main(void) {
3452 struct sysinfo s_info;
3453 sysinfo(&s_info);
3454 return 0;
3457 _sys_sysinfo=no
3458 cc_check && _sys_sysinfo=yes
3459 if test "$_sys_sysinfo" = yes ; then
3460 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3461 _inc_sysinfo='#include <sys/sysinfo.h>'
3462 else
3463 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3465 echores "$_sys_sysinfo"
3468 echocheck "Mac OS X APIs"
3469 if test "$_macosx" = auto && darwin ; then
3470 productName=`/usr/bin/sw_vers -productName`
3471 if test "$productName" = "Mac OS X" ; then
3472 _macosx=yes
3473 else
3474 _macosx=no
3475 _def_macosx='#undef MACOSX'
3476 _noaomodules="macosx $_noaomodules"
3477 _novomodules="quartz $_novomodules"
3480 if test "$_macosx" = yes ; then
3481 cat > $TMPC <<EOF
3482 #include <Carbon/Carbon.h>
3483 #include <QuickTime/QuickTime.h>
3484 #include <CoreAudio/CoreAudio.h>
3485 int main(void) {
3486 EnterMovies();
3487 ExitMovies();
3488 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3491 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3492 _macosx=yes
3493 _macosx_frameworks="-framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3494 _def_macosx='#define MACOSX 1'
3495 _aosrc="$_aosrc ao_macosx.c"
3496 _aomodules="macosx $_aomodules"
3497 _vosrc="$_vosrc vo_quartz.c"
3498 _vomodules="quartz $_vomodules"
3499 else
3500 _macosx=no
3501 _def_macosx='#undef MACOSX'
3502 _noaomodules="macosx $_noaomodules"
3503 _novomodules="quartz $_novomodules"
3505 cat > $TMPC <<EOF
3506 #include <Carbon/Carbon.h>
3507 #include <QuartzCore/CoreVideo.h>
3508 int main(void) {}
3510 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3511 _vosrc="$_vosrc vo_macosx.m"
3512 _vomodules="macosx $_vomodules"
3513 _macosx_frameworks="$_macosx_frameworks -framework Cocoa -framework QuartzCore -framework OpenGL"
3514 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3515 _macosx_corevideo=yes
3516 else
3517 _novomodules="macosx $_novomodules"
3518 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3519 _macosx_corevideo=no
3522 echores "$_macosx"
3524 echocheck "Mac OS X Finder Support"
3525 if test "$_macosx_finder_support" = auto ; then
3526 _macosx_finder_support=$_macosx
3528 if test "$_macosx_finder_support" = yes; then
3529 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3530 _macosx_finder_support=yes
3531 else
3532 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3533 _macosx_finder_support=no
3535 echores "$_macosx_finder_support"
3537 echocheck "Mac OS X Bundle file locations"
3538 if test "$_macosx_bundle" = auto ; then
3539 _macosx_bundle=$_macosx_finder_support
3541 if test "$_macosx_bundle" = yes; then
3542 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3543 else
3544 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3545 _macosx_bundle=no
3547 echores "$_macosx_bundle"
3549 echocheck "Samba support (libsmbclient)"
3550 if test "$_smbsupport" = yes; then
3551 _ld_smb="-lsmbclient"
3553 if test "$_smbsupport" = auto; then
3554 _smbsupport=no
3555 cat > $TMPC << EOF
3556 #include <libsmbclient.h>
3557 int main(void) { smbc_opendir("smb://"); return 0; }
3559 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3560 cc_check $_ld_tmp && _ld_smb="$_ld_tmp" && _smbsupport=yes && break
3561 done
3564 if test "$_smbsupport" = yes; then
3565 _def_smbsupport="#define LIBSMBCLIENT"
3566 _inputmodules="smb $_inputmodules"
3567 else
3568 _def_smbsupport="#undef LIBSMBCLIENT"
3569 _noinputmodules="smb $_noinputmodules"
3571 echores "$_smbsupport"
3574 #########
3575 # VIDEO #
3576 #########
3579 echocheck "3dfx"
3580 if test "$_3dfx" = yes ; then
3581 _def_3dfx='#define HAVE_3DFX 1'
3582 _vosrc="$_vosrc vo_3dfx.c"
3583 _vomodules="3dfx $_vomodules"
3584 else
3585 _def_3dfx='#undef HAVE_3DFX'
3586 _novomodules="3dfx $_novomodules"
3588 echores "$_3dfx"
3591 echocheck "tdfxfb"
3592 if test "$_tdfxfb" = yes ; then
3593 _def_tdfxfb='#define HAVE_TDFXFB 1'
3594 _vosrc="$_vosrc vo_tdfxfb.c"
3595 _vomodules="tdfxfb $_vomodules"
3596 else
3597 _def_tdfxfb='#undef HAVE_TDFXFB'
3598 _novomodules="tdfxfb $_novomodules"
3600 echores "$_tdfxfb"
3602 echocheck "s3fb"
3603 if test "$_s3fb" = yes ; then
3604 _def_s3fb='#define HAVE_S3FB 1'
3605 _vosrc="$_vosrc vo_s3fb.c"
3606 _vomodules="s3fb $_vomodules"
3607 else
3608 _def_s3fb='#undef HAVE_S3FB'
3609 _novomodules="s3fb $_novomodules"
3611 echores "$_s3fb"
3613 echocheck "tdfxvid"
3614 if test "$_tdfxvid" = yes ; then
3615 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3616 _vosrc="$_vosrc vo_tdfx_vid.c"
3617 _vomodules="tdfx_vid $_vomodules"
3618 else
3619 _def_tdfxvid='#undef HAVE_TDFX_VID'
3620 _novomodules="tdfx_vid $_novomodules"
3622 echores "$_tdfxfb"
3624 echocheck "tga"
3625 if test "$_tga" = yes ; then
3626 _def_tga='#define HAVE_TGA 1'
3627 _vosrc="$_vosrc vo_tga.c"
3628 _vomodules="tga $_vomodules"
3629 else
3630 _def_tga='#undef HAVE_TGA'
3631 _novomodules="tga $_novomodules"
3633 echores "$_tga"
3635 echocheck "DirectFB headers presence"
3636 if test -z "$_inc_directfb" ; then
3637 for I in /usr/include /usr/local/include `echo $_inc_extra | sed s/-I//g`; do
3638 if test -d "$I/directfb" && test -f "$I/directfb/directfb.h" ; then
3639 _inc_directfb="-I$I/directfb"
3640 _res_comment="using $_inc_directfb"
3641 echores "yes"
3642 break
3644 if test -d "$I" && test -f "$I/directfb.h" ; then
3645 _inc_directfb="-I$I"
3646 _res_comment="using $_inc_directfb"
3647 echores "yes"
3648 break
3650 done
3651 if test -z "$_inc_directfb" ; then
3652 _directfb=no
3653 echores "not found"
3655 else
3656 _res_comment="using $_inc_directfb"
3657 echores "yes"
3659 if test "$_inc_directfb" = "-I/usr/include" ; then
3660 _inc_directfb=""
3663 echocheck "DirectFB"
3664 if test "$_directfb" = auto ; then
3665 _directfb=no
3666 cat > $TMPC <<EOF
3667 #include <directfb.h>
3668 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3670 linux && test -c /dev/fb0 && cc_check $_inc_directfb -ldirectfb && _directfb=yes
3673 if test "$_directfb" = yes; then
3674 cat > $TMPC << EOF
3675 #include <directfb_version.h>
3677 dfb_ver = DIRECTFB_MAJOR_VERSION DIRECTFB_MINOR_VERSION DIRECTFB_MICRO_VERSION
3680 if $_cc -E $TMPC $_inc_directfb > "$TMPO"; then
3681 _directfb_version=`sed -n 's/^dfb_ver[^1-9]*\(.*\)/\1/p' "$TMPO" | tr -d '() '`
3682 _def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
3683 if test "$_directfb_version" -ge 913; then
3684 _res_comment="$_directfb_version"
3685 else
3686 _def_directfb_version='#undef DIRECTFBVERSION'
3687 _directfb=no
3688 _res_comment="version >=0.9.13 required"
3690 else
3691 _directfb=no
3692 _res_comment="failed to get version"
3695 echores "$_directfb"
3697 if test "$_directfb" = yes ; then
3698 _def_directfb='#define HAVE_DIRECTFB 1'
3699 if test "$_directfb_version" -ge 913; then
3700 _vosrc="$_vosrc vo_directfb2.c"
3701 _vomodules="directfb $_vomodules"
3702 _ld_directfb='-ldirectfb'
3705 if test "$_directfb_version" -ge 915; then
3706 _vosrc="$_vosrc vo_dfbmga.c"
3707 _vomodules="dfbmga $_vomodules"
3709 else
3710 _def_directfb='#undef HAVE_DIRECTFB'
3711 _novomodules="directfb $_novomodules"
3712 _inc_directfb=""
3716 echocheck "X11 headers presence"
3717 if test -z "$_inc_x11" ; then
3718 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3719 if test -d "$I/X11" && test -f "$I/X11/Xlib.h" ; then
3720 _inc_x11="-I$I"
3721 _x11_headers="yes"
3722 _res_comment="using $I"
3723 break
3725 done
3726 if test -z "$_inc_x11" ; then
3727 _x11=no
3728 _x11_headers="no"
3729 _res_comment="check if the dev(el) packages are installed"
3731 else
3732 _x11_headers="yes"
3733 _res_comment="using $_inc_x11"
3735 if test "$_inc_x11" = "-I/usr/include" ; then
3736 _inc_x11=""
3738 echores "$_x11_headers"
3741 echocheck "X11"
3742 if test "$_x11" != no ; then
3743 cat > $TMPC <<EOF
3744 #include <X11/Xlib.h>
3745 #include <X11/Xutil.h>
3746 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3748 if test -z "$_x11_paths" ; then
3749 _x11_paths="/usr/X11R6/lib /usr/lib/X11R6 /usr/X11/lib /usr/lib32 /usr/openwin/lib /usr/X11R6/lib64 /usr/lib"
3751 for I in $_x11_paths ; do
3752 _ld_x11="-L$I -lXext -lX11 $_ld_sock $_ld_pthread"
3753 if netbsd; then
3754 _ld_x11="$_ld_x11 -Wl,-R$I"
3756 if test -d "$I" && cc_check $_inc_x11 $_ld_x11 ; then
3757 _x11=yes
3758 break
3760 done
3762 if test "$_x11" = yes ; then
3763 _def_x11='#define HAVE_X11 1'
3764 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3765 _vomodules="x11 xover $_vomodules"
3766 _res_comment="using $I"
3767 else
3768 _x11=no
3769 _def_x11='#undef HAVE_X11'
3770 _inc_x11=''
3771 _ld_x11=''
3772 _novomodules="x11 $_novomodules"
3773 _res_comment="check if the dev(el) packages are installed"
3775 echores "$_x11"
3778 echocheck "DPMS"
3779 _xdpms3=no
3780 _xdpms4=no
3781 if test "$_x11" = yes ; then
3782 cat > $TMPC <<EOF
3783 #include <X11/Xmd.h>
3784 #include <X11/Xlib.h>
3785 #include <X11/Xutil.h>
3786 #include <X11/Xatom.h>
3787 #include <X11/extensions/dpms.h>
3788 int main(void) {
3789 (void) DPMSQueryExtension(0, 0, 0);
3792 cc_check $_inc_x11 -lXdpms $_ld_x11 && _xdpms3=yes
3793 cat > $TMPC <<EOF
3794 #include <X11/Xlib.h>
3795 #include <X11/extensions/dpms.h>
3796 int main(void) {
3797 (void) DPMSQueryExtension(0, 0, 0);
3800 cc_check $_inc_x11 $_ld_x11 && _xdpms4=yes
3802 if test "$_xdpms4" = yes ; then
3803 _def_xdpms='#define HAVE_XDPMS 1'
3804 _res_comment="using Xdpms 4"
3805 echores "yes"
3806 elif test "$_xdpms3" = yes ; then
3807 _def_xdpms='#define HAVE_XDPMS 1'
3808 _ld_x11="-lXdpms $_ld_x11"
3809 _res_comment="using Xdpms 3"
3810 echores "yes"
3811 else
3812 _def_xdpms='#undef HAVE_XDPMS'
3813 echores "no"
3817 echocheck "Xv"
3818 if test "$_x11" = yes && test "$_xv" != no ; then
3819 cat > $TMPC <<EOF
3820 #include <X11/Xlib.h>
3821 #include <X11/extensions/Xvlib.h>
3822 int main(void) {
3823 (void) XvGetPortAttribute(0, 0, 0, 0);
3824 (void) XvQueryPortAttributes(0, 0, 0);
3825 return 0; }
3827 _xv=no
3828 cc_check $_inc_x11 -lXv $_ld_x11 && _xv=yes
3829 else
3830 _xv=no
3832 if test "$_xv" = yes ; then
3833 _def_xv='#define HAVE_XV 1'
3834 _ld_xv='-lXv'
3835 _vosrc="$_vosrc vo_xv.c"
3836 _vomodules="xv $_vomodules"
3837 else
3838 _def_xv='#undef HAVE_XV'
3839 _novomodules="xv $_novomodules"
3841 echores "$_xv"
3844 echocheck "XvMC"
3845 if test "$_x11" = yes && test "$_xv" = yes && test "$_xvmc" != no ; then
3846 _xvmc=no
3847 cat > $TMPC <<EOF
3848 #include <X11/Xlib.h>
3849 #include <X11/extensions/Xvlib.h>
3850 #include <X11/extensions/XvMClib.h>
3851 int main(void) {
3852 (void) XvMCQueryExtension(0,0,0);
3853 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3854 return 0; }
3856 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
3857 cc_check $_inc_x11 -lXvMC -l$_ld_tmp $_ld_xv $_ld_x11 && _xvmc=yes && _xvmclib="$_ld_tmp" && break
3858 done
3860 if test "$_xvmc" = yes ; then
3861 _def_xvmc='#define HAVE_XVMC 1'
3862 _ld_xvmc="-lXvMC -l$_xvmclib"
3863 _vosrc="$_vosrc vo_xvmc.c"
3864 _vomodules="xvmc $_vomodules"
3865 _res_comment="using $_xvmclib"
3866 else
3867 _def_xvmc='#undef HAVE_XVMC'
3868 _novomodules="xvmc $_novomodules"
3870 echores "$_xvmc"
3873 echocheck "Xinerama"
3874 if test "$_x11" = yes && test "$_xinerama" != no ; then
3875 cat > $TMPC <<EOF
3876 #include <X11/Xlib.h>
3877 #include <X11/extensions/Xinerama.h>
3878 int main(void) { (void) XineramaIsActive(0); return 0; }
3880 _xinerama=no
3881 cc_check $_inc_x11 -lXinerama $_ld_x11 && _xinerama=yes
3882 else
3883 _xinerama=no
3885 if test "$_xinerama" = yes ; then
3886 _def_xinerama='#define HAVE_XINERAMA 1'
3887 _ld_xinerama='-lXinerama'
3888 else
3889 _def_xinerama='#undef HAVE_XINERAMA'
3891 echores "$_xinerama"
3894 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3895 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3896 # named 'X extensions' or something similar.
3897 # This check may be useful for future mplayer versions (to change resolution)
3898 # If you run into problems, remove '-lXxf86vm'.
3899 echocheck "Xxf86vm"
3900 if test "$_x11" = yes && test "$_vm" = auto ; then
3901 cat > $TMPC <<EOF
3902 #include <X11/Xlib.h>
3903 #include <X11/extensions/xf86vmode.h>
3904 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3906 _vm=no
3907 cc_check $_inc_x11 -lXxf86vm $_ld_x11 && _vm=yes
3909 if test "$_vm" = yes ; then
3910 _def_vm='#define HAVE_XF86VM 1'
3911 _ld_vm='-lXxf86vm'
3912 else
3913 _def_vm='#undef HAVE_XF86VM'
3915 echores "$_vm"
3917 # Check for the presence of special keycodes, like audio control buttons
3918 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3919 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3920 # have these new keycodes.
3921 echocheck "XF86keysym"
3922 if test "$_xf86keysym" = auto; then
3923 _xf86keysym=no
3924 if test "$_x11" = yes ; then
3925 cat > $TMPC <<EOF
3926 #include <X11/Xlib.h>
3927 #include <X11/XF86keysym.h>
3928 int main(void) { return XF86XK_AudioPause; }
3930 cc_check $_inc_x11 $_ld_x11 && _xf86keysym=yes
3933 if test "$_xf86keysym" = yes ; then
3934 _def_xf86keysym='#define HAVE_XF86XK 1'
3935 else
3936 _def_xf86keysym='#undef HAVE_XF86XK'
3938 echores "$_xf86keysym"
3940 echocheck "DGA"
3941 if test "$_x11" = no ; then
3942 _dga=no
3944 # Version 2 is preferred to version 1 if available
3945 if test "$_dga" = auto ; then
3946 cat > $TMPC << EOF
3947 #include <X11/Xlib.h>
3948 #include <X11/extensions/xf86dga.h>
3949 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
3951 _dga=no
3952 cc_check $_inc_x11 -lXxf86dga -lXxf86vm $_ld_x11 && _dga=1
3954 cat > $TMPC << EOF
3955 #include <X11/Xlib.h>
3956 #include <X11/extensions/xf86dga.h>
3957 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
3959 cc_check $_inc_x11 -lXxf86dga $_ld_x11 && _dga=2
3962 _def_dga='#undef HAVE_DGA'
3963 _def_dga2='#undef HAVE_DGA2'
3964 if test "$_dga" = 1 ; then
3965 _def_dga='#define HAVE_DGA 1'
3966 _ld_dga='-lXxf86dga'
3967 _vosrc="$_vosrc vo_dga.c"
3968 _vomodules="dga $_vomodules"
3969 _res_comment="using DGA 1.0"
3970 elif test "$_dga" = 2 ; then
3971 _def_dga='#define HAVE_DGA 1'
3972 _def_dga2='#define HAVE_DGA2 1'
3973 _ld_dga='-lXxf86dga'
3974 _vosrc="$_vosrc vo_dga.c"
3975 _vomodules="dga $_vomodules"
3976 _res_comment="using DGA 2.0"
3977 elif test "$_dga" = no ; then
3978 _novomodules="dga $_novomodules"
3979 else
3980 die "DGA version must be 1 or 2"
3982 echores "$_dga"
3985 echocheck "OpenGL"
3986 #Note: this test is run even with --enable-gl since we autodetect $_ld_gl
3987 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
3988 cat > $TMPC << EOF
3989 #include <GL/gl.h>
3990 int main(void) { return 0; }
3992 _gl=no
3993 if cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm ; then
3994 _gl=yes
3995 _ld_gl="-lGL $_ld_dl"
3996 elif cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm $_ld_pthread ; then
3997 _gl=yes
3998 _ld_gl="-lGL $_ld_pthread $_ld_dl"
3999 elif cc_check -lopengl32 ; then
4000 _gl=yes
4001 _gl_win32=yes
4002 _ld_gl="-lopengl32 -lgdi32"
4004 else
4005 _gl=no
4007 if test "$_gl" = yes ; then
4008 _def_gl='#define HAVE_GL 1'
4009 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
4010 if test "$_gl_win32" = yes ; then
4011 _def_gl_win32='#define GL_WIN32 1'
4012 _vosrc="$_vosrc w32_common.c"
4013 _res_comment="win32 version"
4015 _vomodules="opengl $_vomodules"
4016 else
4017 _def_gl='#undef HAVE_GL'
4018 _def_gl_win32='#undef GL_WIN32'
4019 _novomodules="opengl $_novomodules"
4021 echores "$_gl"
4024 echocheck "/dev/mga_vid"
4025 if test "$_mga" = auto ; then
4026 _mga=no
4027 test -c /dev/mga_vid && _mga=yes
4029 if test "$_mga" = yes ; then
4030 _def_mga='#define HAVE_MGA 1'
4031 _vosrc="$_vosrc vo_mga.c"
4032 _vomodules="mga $_vomodules"
4033 else
4034 _def_mga='#undef HAVE_MGA'
4035 _novomodules="mga $_novomodules"
4037 echores "$_mga"
4040 # echocheck "syncfb"
4041 # _syncfb=no
4042 # test "$_mga" = yes && _syncfb=yes
4043 # if test "$_syncfb" = yes ; then
4044 # _def_syncfb='#define HAVE_SYNCFB 1'
4045 # _vosrc="$_vosrc vo_syncfb.c"
4046 # else
4047 # _def_syncfb='#undef HAVE_SYNCFB'
4048 # fi
4049 # echores "$_syncfb"
4052 echocheck "xmga"
4053 if test "$_xmga" = auto ; then
4054 _xmga=no
4055 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4057 if test "$_xmga" = yes ; then
4058 _def_xmga='#define HAVE_XMGA 1'
4059 _vosrc="$_vosrc vo_xmga.c"
4060 _vomodules="xmga $_vomodules"
4061 else
4062 _def_xmga='#undef HAVE_XMGA'
4063 _novomodules="xmga $_novomodules"
4065 echores "$_xmga"
4068 echocheck "GGI"
4069 if test "$_ggi" = auto ; then
4070 cat > $TMPC << EOF
4071 #include <ggi/ggi.h>
4072 int main(void) { return 0; }
4074 _ggi=no
4075 cc_check -lggi && _ggi=yes
4077 if test "$_ggi" = yes ; then
4078 _def_ggi='#define HAVE_GGI 1'
4079 _ld_ggi='-lggi'
4080 _vosrc="$_vosrc vo_ggi.c"
4081 _vomodules="ggi $_vomodules"
4082 else
4083 _def_ggi='#undef HAVE_GGI'
4084 _novomodules="ggi $_novomodules"
4086 echores "$_ggi"
4088 echocheck "GGI extension: libggiwmh"
4089 if test "$_ggiwmh" = auto ; then
4090 _ggiwmh=no
4091 cat > $TMPC << EOF
4092 #include <ggi/ggi.h>
4093 #include <ggi/wmh.h>
4094 int main(void) { return 0; }
4096 cc_check -lggi -lggiwmh && _ggiwmh=yes
4098 # needed to get right output on obscure combination
4099 # like --disable-ggi --enable-ggiwmh
4100 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4101 _def_ggiwmh='#define HAVE_GGIWMH 1'
4102 _ld_ggi="$_ld_ggi -lggiwmh"
4103 else
4104 _ggiwmh=no
4105 _def_ggiwmh='#undef HAVE_GGIWMH'
4107 echores "$_ggiwmh"
4110 echocheck "AA"
4111 if test "$_aa" = auto ; then
4112 cat > $TMPC << EOF
4113 #include <aalib.h>
4114 extern struct aa_hardware_params aa_defparams;
4115 extern struct aa_renderparams aa_defrenderparams;
4116 int main(void) {
4117 aa_context *c;
4118 aa_renderparams *p;
4119 (void) aa_init(0, 0, 0);
4120 c = aa_autoinit(&aa_defparams);
4121 p = aa_getrenderparams();
4122 aa_autoinitkbd(c,0);
4123 return 0; }
4125 _aa=no
4126 for _ld_tmp in "-laa" "$_ld_x11 -laa" ; do
4127 cc_check $_ld_tmp && _ld_aa=$_ld_tmp && _aa=yes && break
4128 done
4130 if test "$_aa" = yes ; then
4131 _def_aa='#define HAVE_AA 1'
4132 if cygwin ; then
4133 _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6`
4135 _vosrc="$_vosrc vo_aa.c"
4136 _vomodules="aa $_vomodules"
4137 else
4138 _def_aa='#undef HAVE_AA'
4139 _novomodules="aa $_novomodules"
4141 echores "$_aa"
4144 echocheck "CACA"
4145 if test "$_caca" = auto ; then
4146 _caca=no
4147 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4148 cat > $TMPC << EOF
4149 #include <caca.h>
4150 int main(void) { (void) caca_init(); return 0; }
4152 cc_check `caca-config --libs` && _caca=yes
4155 if test "$_caca" = yes ; then
4156 _def_caca='#define HAVE_CACA 1'
4157 _inc_caca=`caca-config --cflags`
4158 _ld_caca=`caca-config --libs`
4159 _vosrc="$_vosrc vo_caca.c"
4160 _vomodules="caca $_vomodules"
4161 else
4162 _def_caca='#undef HAVE_CACA'
4163 _novomodules="caca $_novomodules"
4165 echores "$_caca"
4168 echocheck "SVGAlib"
4169 if test "$_svga" = auto ; then
4170 cat > $TMPC << EOF
4171 #include <vga.h>
4172 int main(void) { return 0; }
4174 _svga=no
4175 cc_check -lvga $_ld_lm && _svga=yes
4177 if test "$_svga" = yes ; then
4178 _def_svga='#define HAVE_SVGALIB 1'
4179 _ld_svga="-lvga"
4180 _vosrc="$_vosrc vo_svga.c"
4181 _vomodules="svga $_vomodules"
4182 else
4183 _def_svga='#undef HAVE_SVGALIB'
4184 _novomodules="svga $_novomodules"
4186 echores "$_svga"
4189 echocheck "FBDev"
4190 if test "$_fbdev" = auto ; then
4191 _fbdev=no
4192 linux && test -c /dev/fb0 && _fbdev=yes
4194 if test "$_fbdev" = yes ; then
4195 _def_fbdev='#define HAVE_FBDEV 1'
4196 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4197 _vomodules="fbdev $_vomodules"
4198 else
4199 _def_fbdev='#undef HAVE_FBDEV'
4200 _novomodules="fbdev $_novomodules"
4202 echores "$_fbdev"
4206 echocheck "DVB"
4207 if test "$_dvb" != no ; then
4208 _dvb=no
4209 cat >$TMPC << EOF
4210 #include <sys/poll.h>
4211 #include <sys/ioctl.h>
4212 #include <stdio.h>
4213 #include <time.h>
4214 #include <unistd.h>
4216 #include <ost/dmx.h>
4217 #include <ost/frontend.h>
4218 #include <ost/sec.h>
4219 #include <ost/video.h>
4220 #include <ost/audio.h>
4221 int main(void) {return 0;}
4223 if cc_check ; then
4224 _dvb=yes
4225 else
4226 for I in "$_inc_dvb" "-I/usr/src/DVB/ost/include" ; do
4227 if cc_check "$I" ; then
4228 _dvb=yes
4229 _inc_dvb="$I"
4230 _res_comment="using $_inc_dvb"
4231 break
4233 done
4234 test "$_dvb" = no && _res_comment="specify path to DVB/ost/include with --with-dvbincdir=DIR"
4237 echores "$_dvb"
4238 if test "$_dvb" = yes ; then
4239 _def_dvb='#define HAVE_DVB 1'
4240 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4241 _aomodules="mpegpes(dvb) $_aomodules"
4242 _vomodules="mpegpes(dvb) $_vomodules"
4244 if test "$_dvbhead" != no ; then
4245 echocheck "DVB HEAD"
4246 if test "$_dvbhead" != no ; then
4247 _dvbhead=no
4249 cat >$TMPC << EOF
4250 #include <sys/poll.h>
4251 #include <sys/ioctl.h>
4252 #include <stdio.h>
4253 #include <time.h>
4254 #include <unistd.h>
4256 #include <linux/dvb/dmx.h>
4257 #include <linux/dvb/frontend.h>
4258 #include <linux/dvb/video.h>
4259 #include <linux/dvb/audio.h>
4260 int main(void) {return 0;}
4262 if cc_check ; then
4263 _dvbhead=yes
4264 else
4265 for I in "$_inc_dvb" "-I/usr/src/DVB/include" ; do
4266 if cc_check "$I" ; then
4267 _dvbhead=yes
4268 _inc_dvb="$I"
4269 _res_comment="using $_inc_dvb"
4270 break
4272 done
4273 test "$_dvbhead" = no && _res_comment="specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR"
4276 echores "$_dvbhead"
4277 if test "$_dvbhead" = yes ; then
4278 _def_dvb='#define HAVE_DVB_HEAD 1'
4279 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4280 _aomodules="mpegpes(dvb) $_aomodules"
4281 _vomodules="mpegpes(dvb) $_vomodules"
4284 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4285 _def_dvb='#undef HAVE_DVB'
4286 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4287 _aomodules="mpegpes(file) $_aomodules"
4288 _vomodules="mpegpes(file) $_vomodules"
4291 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4292 _dvbin=yes
4293 _inputmodules="dvb $_inputmodules"
4294 else
4295 _dvbin=no
4296 _noinputmodules="dvb $_noinputmodules"
4299 echocheck "PNG support"
4300 if test "$_png" = auto ; then
4301 _png=no
4302 if irix ; then
4303 # Don't check for -lpng on irix since it has its own libpng
4304 # incompatible with the GNU libpng
4305 _res_comment="disabled on irix (not GNU libpng)"
4306 else
4307 cat > $TMPC << EOF
4308 #include <png.h>
4309 #include <string.h>
4310 int main(void) {
4311 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4312 printf("libpng: %s\n", png_libpng_ver);
4313 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4316 if cc_check -lpng -lz $_ld_lm ; then
4317 if tmp_run ; then
4318 _png=yes
4319 else
4320 _res_comment="mismatch of library and header versions"
4325 echores "$_png"
4326 if test "$_png" = yes ; then
4327 _def_png='#define HAVE_PNG 1'
4328 _ld_png='-lpng -lz'
4329 _vosrc="$_vosrc vo_png.c"
4330 _vomodules="png $_vomodules"
4331 _mkf_png="yes"
4332 else
4333 _def_png='#undef HAVE_PNG'
4334 _novomodules="png $_novomodules"
4335 _mkf_png="no"
4338 echocheck "JPEG support"
4339 if test "$_jpg" = auto ; then
4340 _jpg=no
4341 cat > $TMPC << EOF
4342 #include <stdio.h>
4343 #include <stdlib.h>
4344 #include <setjmp.h>
4345 #include <string.h>
4346 #include <jpeglib.h>
4347 int main(void) {
4348 return 0;
4351 if cc_check -ljpeg $_ld_lm ; then
4352 if tmp_run ; then
4353 _jpg=yes
4357 echores "$_jpg"
4359 if test "$_jpg" = yes ; then
4360 _def_jpg='#define HAVE_JPEG 1'
4361 _vosrc="$_vosrc vo_jpeg.c"
4362 _vomodules="jpeg $_vomodules"
4363 _ld_jpg="-ljpeg"
4364 _mkf_jpg="yes"
4365 else
4366 _def_jpg='#undef HAVE_JPEG'
4367 _novomodules="jpeg $_novomodules"
4368 _mkf_jpg="no"
4373 echocheck "PNM support"
4374 if test "$_pnm" = yes; then
4375 _def_pnm="#define HAVE_PNM"
4376 _vosrc="$_vosrc vo_pnm.c"
4377 _vomodules="pnm $_vomodules"
4378 else
4379 _def_pnm="#undef HAVE_PNM"
4380 _novomodules="pnm $_novomodules"
4382 echores "$_pnm"
4386 echocheck "md5sum support"
4387 if test "$_md5sum" = yes; then
4388 _def_md5sum="#define HAVE_MD5SUM"
4389 _vosrc="$_vosrc vo_md5sum.c md5sum.c"
4390 _vomodules="md5sum $_vomodules"
4391 else
4392 _def_md5sum="#undef HAVE_MD5SUM"
4393 _novomodules="md5sum $_novomodules"
4395 echores "$_md5sum"
4399 echocheck "GIF support"
4400 # This is to appease people who want to force gif support.
4401 # If it is forced to yes, then we still do checks to determine
4402 # which gif library to use.
4403 if test "$_gif" = yes ; then
4404 _force_gif=yes
4405 _gif=auto
4408 if test "$_gif" = auto ; then
4409 _gif=no
4410 cat > $TMPC << EOF
4411 #include <gif_lib.h>
4412 int main(void) {
4413 return 0;
4416 for _ld_tmp in "-lungif" "-lungif $_ld_x11" "-lgif" "-lgif $_ld_x11" ; do
4417 cc_check $_ld_tmp && tmp_run && _ld_gif="$_ld_tmp" && _gif=yes && break
4418 done
4421 # If no library was found, and the user wants support forced,
4422 # then we force it on with libgif, as this is the safest
4423 # assumption IMHO. (libungif & libregif both create symbolic
4424 # links to libgif. We also assume that no x11 support is needed,
4425 # because if you are forcing this, then you _should_ know what
4426 # you are doing. [ Besides, package maintainers should never
4427 # have compiled x11 deps into libungif in the first place. ] )
4428 # </rant>
4429 # --Joey
4430 if test "$_force_gif" = yes && test "$_gif" = no ; then
4431 _gif=yes
4432 _ld_gif="-lgif"
4435 if test "$_gif" = yes ; then
4436 _def_gif='#define HAVE_GIF 1'
4437 _vosrc="$_vosrc vo_gif89a.c"
4438 _codecmodules="gif $_codecmodules"
4439 _vomodules="gif89a $_vomodules"
4440 _mkf_gif="yes"
4441 _res_comment="old version, some encoding functions disabled"
4442 _def_gif_4='#undef HAVE_GIF_4'
4444 cat > $TMPC << EOF
4445 #include <signal.h>
4446 #include <gif_lib.h>
4447 void catch() { exit(1); }
4448 int main(void) {
4449 signal(SIGSEGV, catch); // catch segfault
4450 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4451 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4452 return 0;
4455 if cc_check "$_ld_gif" && tmp_run ; then
4456 _def_gif_4='#define HAVE_GIF_4 1'
4457 _res_comment=""
4459 else
4460 _def_gif='#undef HAVE_GIF'
4461 _def_gif_4='#undef HAVE_GIF_4'
4462 _novomodules="gif89a $_novomodules"
4463 _nocodecmodules="gif $_nocodecmodules"
4464 _mkf_gif="no"
4466 echores "$_gif"
4469 case "$_gif" in yes*)
4470 echocheck "broken giflib workaround"
4471 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4473 cat > $TMPC << EOF
4474 #include <gif_lib.h>
4475 int main(void) {
4476 GifFileType gif;
4477 printf("UserData is at address %p\n", gif.UserData);
4478 return 0;
4481 if cc_check "$_ld_gif" && tmp_run ; then
4482 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4483 echores "disabled"
4484 else
4485 echores "enabled"
4488 esac
4491 echocheck "VESA support"
4492 if test "$_vesa" = auto ; then
4493 cat > $TMPC << EOF
4494 #include <vbe.h>
4495 int main(void) { vbeVersion(); return 0; }
4497 _vesa=no
4498 cc_check -lvbe -llrmi && _vesa=yes
4500 if test "$_vesa" = yes ; then
4501 _def_vesa='#define HAVE_VESA 1'
4502 _ld_vesa="-lvbe -llrmi"
4503 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4504 _vomodules="vesa $_vomodules"
4505 else
4506 _def_vesa='#undef HAVE_VESA'
4507 _novomodules="vesa $_novomodules"
4509 echores "$_vesa"
4511 #################
4512 # VIDEO + AUDIO #
4513 #################
4516 echocheck "SDL"
4517 if test -z "$_sdlconfig" ; then
4518 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4519 _sdlconfig="sdl-config"
4520 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4521 _sdlconfig="sdl11-config"
4522 else
4523 _sdlconfig=false
4526 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4527 cat > $TMPC << EOF
4528 #include <SDL.h>
4529 int main(int argc, char *argv[]) { return 0; }
4531 _sdl=no
4532 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4533 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4534 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4535 if test "$_sdlversion" -gt 116 ; then
4536 if test "$_sdlversion" -lt 121 ; then
4537 _def_sdlbuggy='#define BUGGY_SDL'
4538 else
4539 _def_sdlbuggy='#undef BUGGY_SDL'
4541 _sdl=yes
4542 else
4543 _res_comment="outdated"
4548 if test "$_sdl" = yes ; then
4549 _def_sdl='#define HAVE_SDL 1'
4550 if cygwin ; then
4551 _ld_sdl=`$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`
4552 _inc_sdl=`$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`
4553 elif mingw32 ; then
4554 _ld_sdl=`$_sdlconfig --libs | sed s/-mwindows//`
4555 _inc_sdl=`$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`
4556 else
4557 _ld_sdl=`$_sdlconfig --libs`
4558 _inc_sdl=`$_sdlconfig --cflags`
4560 _vosrc="$_vosrc vo_sdl.c"
4561 _vomodules="sdl $_vomodules"
4562 _aosrc="$_aosrc ao_sdl.c"
4563 _aomodules="sdl $_aomodules"
4564 _res_comment="using $_sdlconfig"
4565 else
4566 _def_sdl='#undef HAVE_SDL'
4567 _novomodules="sdl $_novomodules"
4568 _noaomodules="sdl $_noaomodules"
4570 echores "$_sdl"
4572 echocheck "Windows waveout"
4573 if test "$_win32waveout" = auto ; then
4574 cat > $TMPC << EOF
4575 #include <windows.h>
4576 #include <mmsystem.h>
4577 int main(void) { return 0; }
4579 _win32waveout=no
4580 cc_check -lwinmm && _win32waveout=yes
4582 if test "$_win32waveout" = yes ; then
4583 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4584 _ld_win32libs="-lwinmm $_ld_win32libs"
4585 _aosrc="$_aosrc ao_win32.c"
4586 _aomodules="win32 $_aomodules"
4587 else
4588 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4589 _noaomodules="win32 $_noaomodules"
4591 echores "$_win32waveout"
4593 echocheck "Directx"
4594 if test "$_directx" = auto ; then
4595 cat > $TMPC << EOF
4596 #include <windows.h>
4597 #include <ddraw.h>
4598 #include <dsound.h>
4599 int main(void) { return 0; }
4601 _directx=no
4602 cc_check -lgdi32 && _directx=yes
4604 if test "$_directx" = yes ; then
4605 _def_directx='#define HAVE_DIRECTX 1'
4606 _ld_win32libs="-lgdi32 $_ld_win32libs"
4607 _vosrc="$_vosrc vo_directx.c"
4608 _vomodules="directx $_vomodules"
4609 _aosrc="$_aosrc ao_dsound.c"
4610 _aomodules="dsound $_aomodules"
4611 else
4612 _def_directx='#undef HAVE_DIRECTX'
4613 _novomodules="directx $_novomodules"
4614 _noaomodules="dsound $_noaomodules"
4616 echores "$_directx"
4618 echocheck "NAS"
4619 if test "$_nas" = auto ; then
4620 cat > $TMPC << EOF
4621 #include <audio/audiolib.h>
4622 int main(void) { return 0; }
4624 _nas=no
4625 cc_check -laudio $_inc_x11 -lXt $_ld_x11 $_ld_lm && _nas=yes
4627 if test "$_nas" = yes ; then
4628 _def_nas='#define HAVE_NAS 1'
4629 _ld_nas="-laudio -lXt $_ld_x11"
4630 _aosrc="$_aosrc ao_nas.c"
4631 _aomodules="nas $_aomodules"
4632 else
4633 _noaomodules="nas $_noaomodules"
4634 _def_nas='#undef HAVE_NAS'
4636 echores "$_nas"
4638 echocheck "DXR2"
4639 if test "$_dxr2" = auto; then
4640 _dxr2=no
4641 cat > $TMPC << EOF
4642 #include <dxr2ioctl.h>
4643 int main(void) { return 0; }
4645 for _inc_dxr2 in "$_inc_dxr2" \
4646 "-I/usr/local/include/dxr2" \
4647 "-I/usr/include/dxr2"; do
4648 cc_check $_inc_dxr2 && _dxr2=yes && break
4649 done
4651 if test "$_dxr2" = yes; then
4652 _def_dxr2='#define HAVE_DXR2 1'
4653 _vosrc="$_vosrc vo_dxr2.c"
4654 _aosrc="$_aosrc ao_dxr2.c"
4655 _aomodules="dxr2 $_aomodules"
4656 _vomodules="dxr2 $_vomodules"
4657 _res_comment="using $_inc_dxr2"
4658 else
4659 _def_dxr2='#undef HAVE_DXR2'
4660 _noaomodules="dxr2 $_noaomodules"
4661 _novomodules="dxr2 $_novomodules"
4662 _inc_dxr2=""
4664 echores "$_dxr2"
4666 echocheck "DXR3/H+"
4667 if test "$_dxr3" = auto ; then
4668 cat > $TMPC << EOF
4669 #include <linux/em8300.h>
4670 int main(void) { return 0; }
4672 _dxr3=no
4673 cc_check && _dxr3=yes
4675 if test "$_dxr3" = yes ; then
4676 _def_dxr3='#define HAVE_DXR3 1'
4677 _vosrc="$_vosrc vo_dxr3.c"
4678 _vomodules="dxr3 $_vomodules"
4679 else
4680 _def_dxr3='#undef HAVE_DXR3'
4681 _novomodules="dxr3 $_novomodules"
4682 if test "$_mp1e" = auto ; then
4683 # we don't need mp1e
4684 _mp1e=no
4687 echores "$_dxr3"
4689 echocheck "libmp1e"
4690 if test "$_mmx" = no ; then
4691 # mp1e REQUIRES mmx!
4692 _mp1e=no
4694 if test "$_mp1e" != no ; then
4695 _mp1e=yes
4696 _def_mp1e='#define USE_MP1E'
4697 _ld_mp1e='libmp1e/libmp1e.a'
4698 _dep_mp1e='libmp1e/libmp1e.a'
4699 else
4700 _mp1e=no
4701 _def_mp1e='#undef USE_MP1E'
4702 _ld_mp1e=""
4703 _dep_mp1e=''
4705 echores "$_mp1e"
4708 echocheck "libfame"
4709 if test "$_fame" = auto ; then
4710 _fame=no
4711 test "$_dxr2" = yes && _fame=auto
4712 test "$_dxr3" = yes && _fame=auto
4713 test "$_dvb" = yes && _fame=auto
4715 if test "$_fame" = auto ; then
4716 _fame=no
4717 if test -d libfame && test -f libfame/fame.h ; then
4718 # disable fame on cygwin as no sense to port - atmos
4719 cygwin || _fame=yes
4720 else
4721 _res_comment="no fame dir"
4724 echores "$_fame"
4726 _def_fame='#undef USE_LIBFAME'
4727 if test "$_fame" = yes ; then
4728 _def_fame='#define USE_LIBFAME 1'
4729 _ld_fame='libfame/libfame.a'
4733 #########
4734 # AUDIO #
4735 #########
4738 echocheck "OSS Audio"
4739 if test "$_ossaudio" = auto ; then
4740 cat > $TMPC << EOF
4741 #include <sys/ioctl.h>
4742 $_inc_soundcard
4743 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4745 _ossaudio=no
4746 cc_check && _ossaudio=yes
4748 if test "$_ossaudio" = yes ; then
4749 _def_ossaudio='#define USE_OSS_AUDIO 1'
4750 _aosrc="$_aosrc ao_oss.c"
4751 _aomodules="oss $_aomodules"
4752 if test "$_linux_devfs" = yes; then
4753 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4754 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4755 else
4756 cat > $TMPC << EOF
4757 #include <sys/ioctl.h>
4758 $_inc_soundcard
4759 #ifdef OPEN_SOUND_SYSTEM
4760 int main(void) { return 0; }
4761 #else
4762 #error Not the real thing
4763 #endif
4765 _real_ossaudio=no
4766 cc_check && _real_ossaudio=yes
4767 if test "$_real_ossaudio" = yes; then
4768 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4769 elif netbsd || openbsd ; then
4770 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4771 _ld_arch="$_ld_arch -lossaudio"
4772 else
4773 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4775 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4777 else
4778 _def_ossaudio='#undef USE_OSS_AUDIO'
4779 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4780 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4781 _noaomodules="oss $_noaomodules"
4783 echores "$_ossaudio"
4786 echocheck "aRts"
4787 if test "$_arts" = auto ; then
4788 _arts=no
4789 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4791 cat > $TMPC << EOF
4792 #include <artsc.h>
4793 int main(void) { return 0; }
4795 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
4800 if test "$_arts" = yes ; then
4801 _def_arts='#define USE_ARTS 1'
4802 _aosrc="$_aosrc ao_arts.c"
4803 _aomodules="arts $_aomodules"
4804 _ld_arts=`artsc-config --libs`
4805 _inc_arts=`artsc-config --cflags`
4806 else
4807 _noaomodules="arts $_noaomodules"
4809 echores "$_arts"
4812 echocheck "EsounD"
4813 if test "$_esd" = auto ; then
4814 _esd=no
4815 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4817 cat > $TMPC << EOF
4818 #include <esd.h>
4819 int main(void) { return 0; }
4821 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes
4825 echores "$_esd"
4827 if test "$_esd" = yes ; then
4828 _def_esd='#define USE_ESD 1'
4829 _aosrc="$_aosrc ao_esd.c"
4830 _aomodules="esd $_aomodules"
4831 _ld_esd=`esd-config --libs`
4832 _inc_esd=`esd-config --cflags`
4834 echocheck "esd_get_latency()"
4835 cat > $TMPC << EOF
4836 #include <esd.h>
4837 int main(void) { return esd_get_latency(0); }
4839 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4840 echores "$_esd_latency"
4841 else
4842 _def_esd='#undef USE_ESD'
4843 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4844 _noaomodules="esd $_noaomodules"
4847 echocheck "Polyp"
4848 if test "$_polyp" = auto ; then
4849 _polyp=no
4850 if pkg-config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
4852 cat > $TMPC << EOF
4853 #include <polyp/polyplib.h>
4854 #include <polyp/mainloop.h>
4855 #include <polyp/polyplib-error.h>
4856 int main(void) { return 0; }
4858 cc_check `pkg-config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
4862 echores "$_polyp"
4864 if test "$_polyp" = yes ; then
4865 _def_polyp='#define USE_POLYP 1'
4866 _aosrc="$_aosrc ao_polyp.c"
4867 _aomodules="polyp $_aomodules"
4868 _ld_polyp=`pkg-config --libs polyplib polyplib-error polyplib-mainloop`
4869 _inc_polyp=`pkg-config --cflags polyplib polyplib-error polyplib-mainloop`
4870 else
4871 _def_polyp='#undef USE_POLYP'
4872 _noaomodules="polyp $_noaomodules"
4876 echocheck "JACK"
4877 if test "$_jack" = auto ; then
4878 _jack=yes
4880 cat > $TMPC << EOF
4881 #include <jack/jack.h>
4882 int main(void) { jack_client_new("test"); return 0; }
4884 if cc_check -ljack ; then
4885 _ld_jack="-ljack"
4886 elif cc_check `pkg-config --libs --cflags --silence-errors jack` ; then
4887 _ld_jack="`pkg-config --libs jack`"
4888 _inc_jack="`pkg-config --cflags jack`"
4889 else
4890 _jack=no
4894 if test "$_jack" = yes ; then
4895 _def_jack='#define USE_JACK 1'
4896 _aosrc="$_aosrc ao_jack.c"
4897 _aomodules="jack $_aomodules"
4898 else
4899 _noaomodules="jack $_noaomodules"
4901 echores "$_jack"
4903 echocheck "OpenAL"
4904 if test "$_openal" = auto ; then
4905 _openal=no
4906 cat > $TMPC << EOF
4907 #include <AL/al.h>
4908 int main(void) {
4909 alSourceQueueBuffers(0, 0, 0);
4910 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4911 return 0;
4914 if cc_check -lopenal ; then
4915 _ld_openal="-lopenal"
4916 _openal=yes
4919 if test "$_openal" = yes ; then
4920 _def_openal='#define USE_OPENAL 1'
4921 _aosrc="$_aosrc ao_openal.c"
4922 _aomodules="openal $_aomodules"
4923 else
4924 _noaomodules="openal $_noaomodules"
4926 echores "$_openal"
4928 echocheck "ALSA audio"
4929 if test "$_alsa" != no ; then
4930 _alsa=no
4931 cat > $TMPC << EOF
4932 #include <sys/asoundlib.h>
4933 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
4934 #error "alsa version != 0.5.x"
4935 #endif
4936 int main(void) { return 0; }
4938 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
4940 cat > $TMPC << EOF
4941 #include <sys/asoundlib.h>
4942 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4943 #error "alsa version != 0.9.x"
4944 #endif
4945 int main(void) { return 0; }
4947 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
4948 cat > $TMPC << EOF
4949 #include <alsa/asoundlib.h>
4950 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4951 #error "alsa version != 0.9.x"
4952 #endif
4953 int main(void) { return 0; }
4955 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
4957 cat > $TMPC << EOF
4958 #include <sys/asoundlib.h>
4959 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4960 #error "alsa version != 1.0.x"
4961 #endif
4962 int main(void) { return 0; }
4964 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
4965 cat > $TMPC << EOF
4966 #include <alsa/asoundlib.h>
4967 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4968 #error "alsa version != 1.0.x"
4969 #endif
4970 int main(void) { return 0; }
4972 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
4974 _def_alsa5='#undef HAVE_ALSA5'
4975 _def_alsa9='#undef HAVE_ALSA9'
4976 _def_alsa1x='#undef HAVE_ALSA1X'
4977 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
4978 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
4979 if test "$_alsaver" ; then
4980 _alsa=yes
4981 if test "$_alsaver" = '0.5.x' ; then
4982 _aosrc="$_aosrc ao_alsa5.c"
4983 _aomodules="alsa5 $_aomodules"
4984 _def_alsa5='#define HAVE_ALSA5 1'
4985 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4986 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
4987 elif test "$_alsaver" = '0.9.x-sys' ; then
4988 _aosrc="$_aosrc ao_alsa.c"
4989 _aomodules="alsa $_aomodules"
4990 _def_alsa9='#define HAVE_ALSA9 1'
4991 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4992 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
4993 elif test "$_alsaver" = '0.9.x-alsa' ; then
4994 _aosrc="$_aosrc ao_alsa.c"
4995 _aomodules="alsa $_aomodules"
4996 _def_alsa9='#define HAVE_ALSA9 1'
4997 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4998 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
4999 elif test "$_alsaver" = '1.0.x-sys' ; then
5000 _aosrc="$_aosrc ao_alsa.c"
5001 _aomodules="alsa $_aomodules"
5002 _def_alsa1x="#define HAVE_ALSA1X 1"
5003 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5004 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5005 elif test "$_alsaver" = '1.0.x-alsa' ; then
5006 _aosrc="$_aosrc ao_alsa.c"
5007 _aomodules="alsa $_aomodules"
5008 _def_alsa1x="#define HAVE_ALSA1X 1"
5009 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5010 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5011 else
5012 _alsa=no
5013 _res_comment="unknown version"
5015 _ld_alsa="-lasound $_ld_dl $_ld_pthread"
5016 else
5017 _noaomodules="alsa $_noaomodules"
5019 echores "$_alsa"
5022 echocheck "Sun audio"
5023 if test "$_sunaudio" = auto ; then
5024 cat > $TMPC << EOF
5025 #include <sys/types.h>
5026 #include <sys/audioio.h>
5027 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5029 _sunaudio=no
5030 cc_check && _sunaudio=yes
5032 if test "$_sunaudio" = yes ; then
5033 _def_sunaudio='#define USE_SUN_AUDIO 1'
5034 _aosrc="$_aosrc ao_sun.c"
5035 _aomodules="sun $_aomodules"
5036 else
5037 _def_sunaudio='#undef USE_SUN_AUDIO'
5038 _noaomodules="sun $_noaomodules"
5040 echores "$_sunaudio"
5043 echocheck "Sun mediaLib"
5044 if test "$_mlib" = auto ; then
5045 _mlib=no
5046 test -z "$_mlibdir" && _mlibdir=/opt/SUNWmlib
5047 cat > $TMPC << EOF
5048 #include <mlib.h>
5049 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5051 cc_check -I${_mlibdir}/include -L${_mlibdir}/lib -lmlib && _mlib=yes
5053 if test "$_mlib" = yes ; then
5054 _def_mlib='#define HAVE_MLIB 1'
5055 _inc_mlib=" -I${_mlibdir}/include "
5056 _ld_mlib=" -L${_mlibdir}/lib -R${_mlibdir}/lib -lmlib "
5057 else
5058 _def_mlib='#undef HAVE_MLIB'
5060 echores "$_mlib"
5063 echocheck "SGI audio"
5064 if test "$_sgiaudio" = auto ; then
5065 # check for SGI audio
5066 cat > $TMPC << EOF
5067 #include <dmedia/audio.h>
5068 int main(void) { return 0; }
5070 _sgiaudio=no
5071 cc_check && _sgiaudio=yes
5073 if test "$_sgiaudio" = "yes" ; then
5074 _def_sgiaudio='#define USE_SGI_AUDIO 1'
5075 _ld_sgiaudio='-laudio'
5076 _aosrc="$_aosrc ao_sgi.c"
5077 _aomodules="sgi $_aomodules"
5078 else
5079 _def_sgiaudio='#undef USE_SGI_AUDIO'
5080 _noaomodules="sgi $_noaomodules"
5082 echores "$_sgiaudio"
5085 echocheck "VCD support"
5086 if linux || bsdos || freebsd || netbsd || sunos || darwin ; then
5087 _inputmodules="vcd $_inputmodules"
5088 _def_vcd='#define HAVE_VCD 1'
5089 _vcd="yes"
5090 else
5091 _def_vcd='#undef HAVE_VCD'
5092 _noinputmodules="vcd $_noinputmodules"
5093 _res_comment="not supported on this OS"
5094 _vcd="no"
5096 echores "$_vcd"
5099 echocheck "DVD support (libmpdvdkit2)"
5100 if test "$_dvdkit" = auto ; then
5101 _dvdkit=no
5102 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux; then
5103 test -f "./libmpdvdkit2/Makefile" && _dvdkit=yes
5106 if test "$_dvdkit" = yes ; then
5107 if test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || test "$_hpux_scsi_h" = yes || darwin || win32 ; then
5108 _inputmodules="mpdvdkit2 $_inputmodules"
5109 _dvdread=libmpdvdkit2
5110 else
5111 _noinputmodules="mpdvdkit2 $_noinputmodules"
5113 _def_dvd_linux='#undef HAVE_LINUX_DVD_STRUCT'
5114 _def_dvd_bsd='#undef HAVE_BSD_DVD_STRUCT'
5115 _dev_dvd_openbsd='#undef HAVE_OPENBSD_DVD_STRUCT'
5116 _def_dvd_darwin='#undef DARWIN_DVD_IOCTL'
5117 if linux || netbsd || openbsd || bsdos ; then
5118 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5119 if openbsd ; then
5120 _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5122 else
5123 if freebsd ; then
5124 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5125 else
5126 if darwin ; then
5127 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5131 else
5132 _noinputmodules="mpdvdkit2 $_noinputmodules"
5134 echores "$_dvdkit"
5136 echocheck "DVD support (libdvdread)"
5137 if test "$_dvdread" = auto ; then
5138 cat > $TMPC << EOF
5139 #include <inttypes.h>
5140 #include <dvdread/dvd_reader.h>
5141 #include <dvdread/ifo_types.h>
5142 #include <dvdread/ifo_read.h>
5143 #include <dvdread/nav_read.h>
5144 int main(void) { return 0; }
5146 _dvdread=no
5147 if test "$_dl" = yes; then
5148 cc_check \
5149 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread $_ld_dl && \
5150 _dvdread=yes
5153 _def_mpdvdkit="#undef USE_MPDVDKIT"
5154 case "$_dvdread" in
5155 yes)
5156 _largefiles=yes
5157 _def_dvdread='#define USE_DVDREAD 1'
5158 _ld_dvdread='-ldvdread'
5159 _inputmodules="dvdread $_inputmodules"
5160 _have_dvd=yes
5163 _def_dvdread='#undef USE_DVDREAD'
5164 _noinputmodules="dvdread $_noinputmodules"
5166 libmpdvdkit2)
5167 _largefiles=yes
5168 _def_dvdread='#define USE_DVDREAD 1'
5169 _ld_dvdread='-Llibmpdvdkit2 -lmpdvdkit'
5170 _noinputmodules="dvdread $_noinputmodules"
5171 _def_mpdvdkit="#define USE_MPDVDKIT 2"
5172 _have_dvd=yes
5173 _dvdread=no
5174 _res_comment="disabled by libmpdvdkit2"
5176 esac
5177 echores "$_dvdread"
5179 if test "$_have_dvd" = yes ; then
5180 _def_have_dvd='#define HAVE_DVD 1'
5181 else
5182 _def_have_dvd='#undef HAVE_DVD'
5185 # dvdnav disabled, it does not work
5186 # echocheck "DVD support (libdvdnav)"
5187 # if test "$_dvdnav" = yes ; then
5188 # cat > $TMPC <<EOF
5189 # #include <dvdnav.h>
5190 # int main(void) { dvdnav_t *dvd=0; return 0; }
5191 # EOF
5192 # _dvdnav=no
5193 # test -n "$_dvdnavdir" && _legal_dvdnavdir=-L$_dvdnavdir/.libs
5194 # if test -z "$_dvdnavconfig" ; then
5195 # if ( dvdnav-config --version ) >/dev/null 2>&1 ; then
5196 # _dvdnavconfig="dvdnav-config"
5197 # fi
5198 # fi
5199 # test -z "$_dvdnavdir" && test -n "$_dvdnavconfig" && _dvdnavdir=`$_dvdnavconfig --cflags`
5200 # _used_css=
5201 # test "$_dvdkit" = no && _used_css=$_ld_css
5202 # cc_check $_inc_extra -I$_dvdnavdir $_legal_dvdnavdir -ldvdnav $_used_css $_ld_dl $_ld_pthread && _dvdnav=yes
5203 # fi
5204 # if test "$_dvdnav" = yes ; then
5205 # _largefiles=yes
5206 # _def_dvdnav='#define USE_DVDNAV 1'
5207 # if test -n "$_legal_dvdnavdir" ; then
5208 # _ld_css="$_ld_css $_legal_dvdnavdir -ldvdnav"
5209 # elif test -n "$_dvdnavconfig" ; then
5210 # _ld_css="$_ld_css `$_dvdnavconfig --libs`"
5211 # else
5212 # _ld_css="$_ld_css -ldvdnav"
5213 # fi
5214 # if test -n "$_dvdnavconfig" ; then
5215 # _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
5216 # _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
5217 # fi
5218 # if test -n "$_dvdnavdir" ; then
5219 # _inc_extra="$_inc_extra -I$_dvdnavdir"
5220 # fi
5221 # _inputmodules="dvdnav $_inputmodules"
5222 # else
5223 # _def_dvdnav='#undef USE_DVDNAV'
5224 # _noinputmodules="dvdnav $_noinputmodules"
5225 # fi
5226 # echores "$_dvdnav"
5228 echocheck "cdparanoia"
5229 if test "$_cdparanoia" = auto ; then
5230 cat > $TMPC <<EOF
5231 #include <cdda_interface.h>
5232 #include <cdda_paranoia.h>
5233 // This need a better test. How ?
5234 int main(void) { return 1; }
5236 _cdparanoia=no
5237 for _inc_tmp in "$_inc_cdparanoia" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5238 cc_check $_inc_tmp $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm && _inc_cdparanoia="$_inc_tmp" && _cdparanoia=yes && break
5239 done
5241 if test "$_cdparanoia" = yes ; then
5242 _def_cdparanoia='#define HAVE_CDDA'
5243 _inputmodules="cdda $_inputmodules"
5244 _ld_cdparanoia="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
5245 openbsd && _ld_cdparanoia="$_ld_cdparanoia -lutil"
5246 else
5247 _def_cdparanoia='#undef HAVE_CDDA'
5248 _noinputmodules="cdda $_noinputmodules"
5250 echores "$_cdparanoia"
5253 echocheck "libcdio"
5254 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5255 if pkg-config --exists libcdio ; then
5256 cat > $TMPC << EOF
5257 #include <stdio.h>
5258 #include <cdio/version.h>
5259 #include <cdio/cdda.h>
5260 #include <cdio/paranoia.h>
5261 int main()
5263 printf("%s\n", CDIO_VERSION);
5264 return 0;
5268 _libcdio=no
5269 for _inc_tmp in "$_inc_libcdio" "-I/usr/include/cdio" "-I/usr/local/include/cdio" ; do
5270 cc_check `pkg-config --cflags --libs libcdio_paranoia` $_inc_tmp $_ld_lm \
5271 && _inc_libcdio="$_inc_tmp" && ( $TMPO >> "$TMPLOG" ) \
5272 && _libcdio=yes && break
5273 done
5274 else
5275 _libcdio=no
5278 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5279 _def_libcdio='#define HAVE_LIBCDIO'
5280 _def_cdparanoia='#define HAVE_CDDA'
5281 _def_havelibcdio='yes'
5282 _inputmodules="cdda $_inputmodules"
5283 _inc_libcdio=`pkg-config --cflags libcdio`
5284 _ld_libcdio=`pkg-config --libs libcdio_paranoia`
5285 else
5286 if test "$_cdparanoia" = yes ; then
5287 _res_comment="using cdparanoia"
5289 _def_libcdio='#undef HAVE_LIBCDIO'
5290 _def_havelibcdio='no'
5292 echores "$_libcdio"
5295 echocheck "freetype >= 2.0.9"
5297 # freetype depends on iconv
5298 if test "$_iconv" = no ; then
5299 _freetype=no
5300 _res_comment="iconv support needed"
5303 if test "$_freetype" = auto ; then
5304 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5305 cat > $TMPC << EOF
5306 #include <stdio.h>
5307 #include <ft2build.h>
5308 #include FT_FREETYPE_H
5309 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5310 #error "Need FreeType 2.0.9 or newer"
5311 #endif
5312 int main()
5314 FT_Library library;
5315 FT_Int major=-1,minor=-1,patch=-1;
5316 int err=FT_Init_FreeType(&library);
5317 if(err){
5318 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5319 exit(err);
5321 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5322 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5323 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5324 (int)major,(int)minor,(int)patch );
5325 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5326 printf("Library and header version mismatch! Fix it in your distribution!\n");
5327 exit(1);
5329 return 0;
5332 _freetype=no
5333 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5334 else
5335 _freetype=no
5338 if test "$_freetype" = yes ; then
5339 _def_freetype='#define HAVE_FREETYPE'
5340 _inc_freetype=`$_freetypeconfig --cflags`
5341 _ld_freetype=`$_freetypeconfig --libs`
5342 else
5343 _def_freetype='#undef HAVE_FREETYPE'
5345 echores "$_freetype"
5347 if test "$_freetype" = no ; then
5348 _fontconfig=no
5349 _res_comment="freetype support needed"
5351 echocheck "fontconfig"
5352 if test "$_fontconfig" = auto ; then
5353 cat > $TMPC << EOF
5354 #include <stdio.h>
5355 #include <fontconfig/fontconfig.h>
5356 int main()
5358 int err = FcInit();
5359 if(err == FcFalse){
5360 printf("Couldn't initialize fontconfig lib\n");
5361 exit(err);
5363 return 0;
5367 _fontconfig=yes
5368 if cc_check -lfontconfig ; then
5369 _ld_fontconfig="-lfontconfig"
5370 elif cc_check `pkg-config --silence-errors --cflags --libs fontconfig` ; then
5371 _inc_fontconfig=`pkg-config --cflags fontconfig`
5372 _ld_fontconfig=`pkg-config --libs fontconfig`
5373 else
5374 _fontconfig=no
5377 if test "$_fontconfig" = yes ; then
5378 _def_fontconfig='#define HAVE_FONTCONFIG'
5379 else
5380 _def_fontconfig='#undef HAVE_FONTCONFIG'
5382 echores "$_fontconfig"
5384 echocheck "fribidi with charsets"
5385 if test "$_fribidi" = auto ; then
5386 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5387 cat > $TMPC << EOF
5388 #include <stdio.h>
5389 /* workaround for fribidi 0.10.4 and below */
5390 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5391 #include <fribidi/fribidi.h>
5392 int main()
5394 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5395 printf("Fribidi headers are not consistents with the library!\n");
5396 exit(1);
5398 return 0;
5401 _fribidi=no
5402 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5403 else
5404 _fribidi=no
5407 if test "$_fribidi" = yes ; then
5408 _def_fribidi='#define USE_FRIBIDI'
5409 _inc_fribidi=`$_fribidiconfig --cflags`
5410 _ld_fribidi=`$_fribidiconfig --libs`
5411 else
5412 _def_fribidi='#undef USE_FRIBIDI'
5414 echores "$_fribidi"
5417 echocheck "ENCA"
5418 if test "$_enca" = auto ; then
5419 cat > $TMPC << EOF
5420 #include <enca.h>
5421 int main()
5423 const char **langs;
5424 size_t langcnt;
5425 langs = enca_get_languages(&langcnt);
5426 return 0;
5429 _enca=no
5430 cc_check -lenca $_ld_lm && _enca=yes
5432 if test "$_enca" = yes ; then
5433 _def_enca='#define HAVE_ENCA 1'
5434 _ld_enca='-lenca'
5435 else
5436 _def_enca='#undef HAVE_ENCA'
5438 echores "$_enca"
5441 echocheck "zlib"
5442 cat > $TMPC << EOF
5443 #include <zlib.h>
5444 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5446 _zlib=no
5447 cc_check -lz && _zlib=yes
5448 if test "$_zlib" = yes ; then
5449 _def_zlib='#define HAVE_ZLIB 1'
5450 _ld_zlib='-lz'
5451 else
5452 _def_zlib='#undef HAVE_ZLIB'
5454 echores "$_zlib"
5457 echocheck "RTC"
5458 if test "$_rtc" = auto ; then
5459 cat > $TMPC << EOF
5460 #include <sys/ioctl.h>
5461 #ifdef __linux__
5462 #include <linux/rtc.h>
5463 #else
5464 #include <rtc.h>
5465 #define RTC_PIE_ON RTCIO_PIE_ON
5466 #endif
5467 int main(void) { return RTC_PIE_ON; }
5469 _rtc=no
5470 cc_check && _rtc=yes
5471 ppc && _rtc=no
5473 if test "$_rtc" = yes ; then
5474 _def_rtc='#define HAVE_RTC 1'
5475 else
5476 _def_rtc='#undef HAVE_RTC'
5478 echores "$_rtc"
5481 echocheck "external liblzo support"
5482 if test "$_liblzo" = auto ; then
5483 _liblzo=no
5484 cat > $TMPC << EOF
5485 #include <lzo1x.h>
5486 int main(void) { lzo_init();return 0; }
5488 cc_check -llzo && _liblzo=yes
5490 if test "$_liblzo" = yes ; then
5491 _def_liblzo='#define USE_LIBLZO 1'
5492 _ld_liblzo='-llzo'
5493 _codecmodules="liblzo $_codecmodules"
5494 else
5495 _def_liblzo='#undef USE_LIBLZO'
5496 _nocodecmodules="liblzo $_nocodecmodules"
5498 echores "$_liblzo"
5501 echocheck "mad support"
5502 if test "$_mad" = auto ; then
5503 _mad=no
5504 cat > $TMPC << EOF
5505 #include <mad.h>
5506 int main(void) { return 0; }
5508 cc_check $_madlibdir -lmad && _mad=yes
5510 if test "$_mad" = yes ; then
5511 _def_mad='#define USE_LIBMAD 1'
5512 _ld_mad='-lmad'
5513 _codecmodules="libmad $_codecmodules"
5514 else
5515 _def_mad='#undef USE_LIBMAD'
5516 _nocodecmodules="libmad $_nocodecmodules"
5518 echores "$_mad"
5520 echocheck "Toolame"
5521 if test "$_toolame" = auto ; then
5522 cat > $TMPC <<EOF
5523 #include <toolame.h>
5524 int main(void) { toolame_init(); return 0; }
5526 _toolame=no
5527 _toolame_extraflags=""
5528 _toolame_lib="-ltoolame"
5529 if test -n "$_toolamedir"; then
5530 _toolame_extraflags="-I$_toolamedir -L$_toolamedir"
5532 cc_check $_toolame_extraflags $_toolame_lib $_ld_lm && _toolame=yes
5534 if test "$_toolame" = yes ; then
5535 _def_toolame='#define HAVE_TOOLAME 1'
5536 _codecmodules="$_codecmodules toolame"
5537 else
5538 _def_toolame='#undef HAVE_TOOLAME'
5539 _toolame_lib=""
5540 _nocodecmodules="toolame $_nocodecmodules"
5542 if test "$_toolamedir" ; then
5543 _res_comment="using $_toolamedir"
5545 echores "$_toolame"
5547 echocheck "Twolame"
5548 if test "$_twolame" = auto ; then
5549 cat > $TMPC <<EOF
5550 #include <twolame.h>
5551 int main(void) { twolame_init(); return 0; }
5553 _twolame=no
5554 _twolame_lib="-ltwolame"
5555 cc_check $_twolame_lib $_ld_lm && _twolame=yes
5557 if test "$_twolame" = yes ; then
5558 _def_twolame='#define HAVE_TWOLAME 1'
5559 _codecmodules="$_codecmodules twolame"
5560 else
5561 _def_twolame='#undef HAVE_TWOLAME'
5562 _twolame_lib=""
5563 _nocodecmodules="twolame $_nocodecmodules"
5565 echores "$_twolame"
5567 echocheck "OggVorbis support"
5568 if test "$_tremor_internal" = yes; then
5569 _vorbis=yes
5570 elif test "$_vorbis" = auto; then
5571 _vorbis=no
5572 cat > $TMPC << EOF
5573 #include <vorbis/codec.h>
5574 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5576 cc_check -lvorbis -logg $_ld_lm && _vorbis=yes
5578 if test "$_vorbis" = yes ; then
5579 _def_vorbis='#define HAVE_OGGVORBIS 1'
5580 if test "$_tremor_internal" = yes ; then
5581 # do not set _ld_vorbis as it is resolved separately
5582 # mp3lame support for vorbis is deprecated so don't care
5583 _def_tremor='#define TREMOR 1'
5584 if test "$_tremor_low" = yes ; then
5585 _tremor_flags='-D_LOW_ACCURACY_'
5586 else
5587 _tremor_flags=''
5589 _codecmodules="tremor(internal) $_codecmodules"
5590 elif test "$_tremor" = yes ; then
5591 _def_tremor='#define TREMOR 1'
5592 _ld_vorbis='-lvorbisidec'
5593 _codecmodules="tremor $_codecmodules"
5594 else
5595 _def_tremor='#undef TREMOR'
5596 _ld_vorbis='-lvorbis -logg'
5597 _codecmodules="libvorbis $_codecmodules"
5599 else
5600 _def_vorbis='#undef HAVE_OGGVORBIS'
5601 _def_tremor='#undef TREMOR'
5602 _nocodecmodules="libvorbis $_nocodecmodules"
5604 if test "$_vorbis" = yes -a "$_tremor_internal" = yes -a "$_tremor_low" = yes ; then
5605 _res_comment="internal low accuracy Tremor"
5606 elif test "$_vorbis" = yes -a "$_tremor_internal" = yes ; then
5607 _res_comment="internal Tremor"
5608 elif test "$_vorbis" = yes -a "$_tremor" = yes ; then
5609 _res_comment="Tremor"
5611 echores "$_vorbis"
5613 echocheck "libspeex (version >= 1.1 required)"
5614 if test "$_speex" = auto ; then
5615 _speex=no
5616 cat > $TMPC << EOF
5617 #include <speex/speex.h>
5618 int main(void) {
5619 SpeexBits bits;
5620 void *dec;
5621 speex_decode_int(dec, &bits, dec);
5624 cc_check -lspeex $_ld_lm && _speex=yes
5626 if test "$_speex" = yes ; then
5627 _def_speex='#define HAVE_SPEEX 1'
5628 _ld_speex='-lspeex'
5629 _codecmodules="speex $_codecmodules"
5630 else
5631 _def_speex='#undef HAVE_SPEEX'
5632 _nocodecmodules="speex $_nocodecmodules"
5634 echores "$_speex"
5636 echocheck "OggTheora support"
5637 if test "$_theora" = auto ; then
5638 _theora=no
5639 cat > $TMPC << EOF
5640 #include <theora/theora.h>
5641 #include <string.h>
5642 int main(void)
5644 /* theora is in flux, make sure that all interface routines and
5645 * datatypes exist and work the way we expect it, so we don't break
5646 * mplayer */
5647 ogg_packet op;
5648 theora_comment tc;
5649 theora_info inf;
5650 theora_state st;
5651 yuv_buffer yuv;
5652 int r;
5653 double t;
5655 theora_info_init (&inf);
5656 theora_comment_init (&tc);
5658 return 0;
5660 /* we don't want to execute this kind of nonsense; just for making sure
5661 * that compilation works... */
5662 memset(&op, 0, sizeof(op));
5663 r = theora_decode_header (&inf, &tc, &op);
5664 r = theora_decode_init (&st, &inf);
5665 t = theora_granule_time (&st, op.granulepos);
5666 r = theora_decode_packetin (&st, &op);
5667 r = theora_decode_YUVout (&st, &yuv);
5668 theora_clear (&st);
5670 return 0;
5673 for _ld_theora in "`pkg-config --silence-errors --libs --cflags theora`" "-ltheora"; do
5674 cc_check $_ld_theora && _theora=yes && break
5675 done
5676 if test "$_theora" = no && test "$_tremor_internal" = yes; then
5677 for _ld_theora in "`pkg-config --silence-errors --libs --cflags theora`" "-ltheora"; do
5678 cc_check -I. tremor/bitwise.c $_ld_theora && _theora=yes && break
5679 done
5682 if test "$_theora" = yes ; then
5683 _def_theora='#define HAVE_OGGTHEORA 1'
5684 _codecmodules="libtheora $_codecmodules"
5685 # when --enable-theora is forced, we'd better provide a probably sane
5686 # $_ld_theora than nothing
5687 test -z "$_ld_theora" && _ld_theora="-ltheora -logg"
5688 else
5689 _def_theora='#undef HAVE_OGGTHEORA'
5690 _nocodecmodules="libtheora $_nocodecmodules"
5691 _ld_theora=""
5693 echores "$_theora"
5695 echocheck "mp3lib support"
5696 if test "$_mp3lib" = yes ; then
5697 _def_mp3lib='#define USE_MP3LIB 1'
5698 _codecmodules="mp3lib $_codecmodules"
5699 else
5700 _def_mp3lib='#undef USE_MP3LIB'
5701 _nocodecmodules="mp3lib $_nocodecmodules"
5703 echores "$_mp3lib"
5705 echocheck "liba52 support"
5706 if test "$_liba52" = yes ; then
5707 _def_liba52='#define USE_LIBA52 1'
5708 _codecmodules="liba52 $_codecmodules"
5709 else
5710 _def_liba52='#undef USE_LIBA52'
5711 _nocodecmodules="liba52 $_nocodecmodules"
5713 echores "$_liba52"
5715 echocheck "libdts support"
5716 if test "$_libdts" = auto ; then
5717 _libdts=no
5718 cat > $TMPC << EOF
5719 #include <inttypes.h>
5720 #include <dts.h>
5721 int main(void) { dts_init (0); return 0; }
5723 cc_check $_inc_libdts $_ld_libdts -ldts $_ld_lm && _libdts=yes
5725 if test "$_libdts" = yes ; then
5726 _def_libdts='#define CONFIG_DTS 1'
5727 _ld_libdts="$_ld_libdts -ldts"
5728 _codecmodules="libdts $_codecmodules"
5729 else
5730 _def_libdts='#undef CONFIG_DTS'
5731 _nocodecmodules="libdts $_nocodecmodules"
5733 echores "$_libdts"
5735 echocheck "libmpeg2 support"
5736 if test "$_libmpeg2" = yes ; then
5737 _def_libmpeg2='#define USE_LIBMPEG2 1'
5738 _codecmodules="libmpeg2 $_codecmodules"
5739 else
5740 _def_libmpeg2='#undef USE_LIBMPEG2'
5741 _nocodecmodules="libmpeg2 $_nocodecmodules"
5743 echores "$_libmpeg2"
5745 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5746 if test "$_musepack" = auto ; then
5747 _musepack=no
5748 cat > $TMPC << EOF
5749 #include <mpcdec/mpcdec.h>
5750 int main(void) {
5751 mpc_streaminfo info;
5752 mpc_decoder decoder;
5753 mpc_decoder_set_streaminfo(&decoder, &info);
5754 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5757 cc_check -lmpcdec $_ld_lm && _musepack=yes
5759 if test "$_musepack" = yes ; then
5760 _def_musepack='#define HAVE_MUSEPACK 1'
5761 _ld_musepack='-lmpcdec'
5762 _codecmodules="musepack $_codecmodules"
5763 else
5764 _def_musepack='#undef HAVE_MUSEPACK'
5765 _nocodecmodules="musepack $_nocodecmodules"
5767 echores "$_musepack"
5770 echocheck "FAAC (AAC encoder) support"
5771 if test "$_faac" = auto ; then
5772 cat > $TMPC <<EOF
5773 #include <inttypes.h>
5774 #include <faac.h>
5775 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5777 _faac=no
5778 for _ld_tmp in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5779 cc_check -c -O4 $_ld_tmp $_ld_lm && _ld_faac="$_ld_tmp" && _faac=yes && break
5780 done
5782 if test "$_faac" = yes ; then
5783 _def_faac="#define HAVE_FAAC 1"
5784 _def_lavc_faac="#define CONFIG_FAAC 1"
5785 _codecmodules="faac $_codecmodules"
5786 else
5787 _def_faac="#undef HAVE_FAAC"
5788 _nocodecmodules="faac $_nocodecmodules"
5790 echores "$_faac"
5792 echocheck "internal FAAD2 (AAC) support"
5793 if test "$_faad_internal" = auto ; then
5794 if x86 && test cc_vendor=gnu; then
5795 case $cc_version in
5796 3.1*|3.2) # ICE/insn with these versions
5797 _faad_internal=no
5798 _res_comment="broken gcc"
5801 _faad_internal=yes
5803 esac
5804 else
5805 _faad_internal=yes
5808 if test "$_faad_internal" = yes ; then
5809 _def_faad_internal="#define USE_INTERNAL_FAAD 1"
5810 _faad_external=no
5811 else
5812 _def_faad_internal="#undef USE_INTERNAL_FAAD"
5813 _inc_faad=
5815 echores "$_faad_internal"
5818 echocheck "external FAAD2 (AAC) support"
5819 if test "$_faad_external" != no ; then
5820 _ld_faad='-lfaad'
5821 _inc_faad="$_inc_extra"
5822 # external faad: check if it's really faad2 :)
5823 if test "$_faad_external" = auto ; then
5824 _faad_external=no
5825 cat > $TMPC << EOF
5826 #include <faad.h>
5827 #ifndef FAAD_MIN_STREAMSIZE
5828 #error Too old version
5829 #endif
5830 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5832 cc_check $_inc_faad $_ld_faad $_ld_lm && _faad_external=yes
5835 echores "$_faad_external"
5837 if test "$_faad_external" = yes; then
5838 _def_faad='#define HAVE_FAAD 1'
5839 _codecmodules="faad2(external) $_codecmodules"
5840 elif test "$_faad_internal" = yes; then
5841 _def_faad='#define HAVE_FAAD 1'
5842 _codecmodules="faad2(internal) $_codecmodules"
5843 else
5844 _def_faad='#undef HAVE_FAAD'
5845 _nocodecmodules="faad2 $_nocodecmodules"
5846 _ld_faad=
5850 echocheck "LADSPA plugin support"
5851 if test "$_ladspa" = auto ; then
5852 cat > $TMPC <<EOF
5853 #include <stdio.h>
5854 #include <ladspa.h>
5855 int main(void) {
5856 const LADSPA_Descriptor *ld = NULL;
5857 return 0;
5860 _ladspa=no
5861 cc_check && _ladspa=yes
5863 if test "$_ladspa" = yes; then
5864 _def_ladspa="#define HAVE_LADSPA"
5865 _afsrc="$_afsrc af_ladspa.c"
5866 _afmodules="ladspa $_afmodules"
5867 else
5868 _def_ladspa="#undef HAVE_LADSPA"
5869 _noafmodules="ladspa $_noafmodules"
5871 echores "$_ladspa"
5874 if test "$_win32" = auto ; then
5875 if x86 ; then
5876 qnx && _win32=no
5877 else
5878 _win32=no # x86 arch only
5882 if test "$_win32" != no ; then
5883 if test -z "$_win32libdir" ; then
5884 for I in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5885 if test -d "$I" ; then
5886 _win32libdir="$I"
5887 break;
5889 done
5890 # Fall back on a subfolder of the current dir on Windows
5891 mingw32 && _win32libdir="codecs"
5895 echocheck "Win32 codec DLL support"
5896 if test "$_win32" = auto ; then
5897 _win32=no
5898 test -n "$_win32libdir" && _win32=yes
5900 if test "$_win32" = yes ; then
5901 _def_win32='#define USE_WIN32DLL 1'
5902 _res_comment="using $_win32libdir"
5903 else
5904 _def_win32='#undef USE_WIN32DLL'
5905 _nocodecmodules="win32 $_nocodecmodules"
5906 _dshow=no
5908 echores "$_win32"
5910 if test "$_win32" != no ; then
5911 _def_win32_loader='#undef WIN32_LOADER'
5912 echocheck "Win32 loader support"
5913 _ld_win32='loader/libloader.a'
5914 _dep_win32='loader/libloader.a'
5915 _codecmodules="win32 $_codecmodules"
5916 if openbsd ; then
5917 x86 && _ld_win32="$_ld_win32 -li386"
5919 if not win32 ; then
5920 _def_win32_loader='#define WIN32_LOADER 1'
5921 else
5922 _ld_win32libs="$_ld_win32libs -ladvapi32 -lole32"
5923 _res_comment="using native windows"
5926 echores "$_win32"
5929 echocheck "DirectShow"
5930 if false ; then
5932 if test "$_dshow" != no ; then
5933 _dshow=no
5934 # check if compiler supports C++ and C++-libs are installed correctly
5935 cat > "$TMPCPP" << EOF
5936 #include <string>
5937 class myclass {
5938 private: int ret;
5939 public: int myreturn(void);
5941 int myclass::myreturn(void) { ret = 0; return ret ; }
5942 int main(void) { myclass myobject; return myobject.myreturn(); }
5944 if cxx_check && tmp_run ; then
5945 _dshow=yes
5946 echores "yes (C++ is ok)"
5947 else
5948 echores "no"
5949 cat << EOF
5951 Your C++ runtime environment is broken.
5953 Hints: Does $_cc support C++? Do you have you a C++ compiler installed?
5954 Are the C++ libraries correctly installed?
5955 Check for libstdc++ and in (/etc/)ld.so.conf.
5957 If you do not need DirectShow support, you can also use:
5958 ./configure --disable-dshow <your-normal-configure-options>
5959 to disable building the C++ based DirectShow code.
5962 die "$_cc's C++ is broken"
5968 echores "$_dshow"
5970 if test "$_dshow" = yes ; then
5971 _def_dshow='#define USE_DIRECTSHOW 1'
5972 _ld_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5973 _dep_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5974 _codecmodules="dshow/dmo $_codecmodules"
5975 else
5976 _def_dshow='#undef USE_DIRECTSHOW'
5977 _nocodecmodules="dshow/dmo $_nocodecmodules"
5981 echocheck "XAnim DLL"
5982 if test "$_xanim" = auto ; then
5983 _xanim=no
5984 _res_comment="dynamic loader support needed"
5985 if test "$_dl" = yes ; then
5986 _res_comment="no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html"
5987 if test -z "$_xanimlibdir" ; then
5988 for I in "$_libdir/codecs" /usr/local/lib/xanim/mods /usr/lib/xanim/mods /usr/lib/xanim $XANIM_MOD_DIR ; do
5989 if test -d "$I" ; then
5990 _xanimlibdir="$I"
5991 break;
5993 done
5995 test "$_xanimlibdir" && _xanim=yes
5998 if test "$_xanim" = yes ; then
5999 _def_xanim='#define USE_XANIM 1'
6000 _def_xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
6001 _codecmodules="xanim $_codecmodules"
6002 _res_comment="using $_xanimlibdir"
6003 else
6004 _def_xanim='#undef USE_XANIM'
6005 _def_xanim_path='#undef XACODEC_PATH'
6006 _nocodecmodules="xanim $_nocodecmodules"
6008 echores "$_xanim"
6010 echocheck "RealPlayer DLL"
6011 if test "$_real" = auto ; then
6012 _real=no
6013 _res_comment="dynamic loader support needed"
6014 if test "$_dl" = yes || test "$_win32" = yes ; then
6015 # if test "$_dl" = yes ; then
6016 _res_comment="tested only on Linux/FreeBSD/NetBSD/Cygwin/MinGW/Darwin"
6017 if linux || freebsd || netbsd || win32 || darwin ; then
6018 _res_comment="no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html"
6019 if test -z "$_reallibdir" ; then
6020 for I in "$_libdir/codecs" "$_libdir/real" /usr/lib/real \
6021 /usr/lib/RealPlayer{9,8,}/Codecs /usr/local/RealPlayer{9,8,}/Codecs \
6022 /usr/local/lib/RealPlayer{9,8,}/Codecs /opt/RealPlayer{9,8,}/{Real/,}Codecs \
6023 {~,}/Applications/RealOne\ Player.app/Contents/MacOS/Library/Codecs \
6024 "$_win32libdir"; do
6025 if test -d "$I" ; then
6026 _reallibdir="$I"
6027 break
6029 # Fall back on a subfolder of the current dir on Windows
6030 mingw32 && _reallibdir="codecs"
6031 done
6033 test "$_reallibdir" && _real=yes
6037 if test "$_real" = yes ; then
6038 _def_real='#define USE_REALCODECS 1'
6039 _def_real_path="#define REALCODEC_PATH \"$_reallibdir\""
6040 _codecmodules="real $_codecmodules"
6041 _res_comment="using $_reallibdir"
6042 else
6043 _def_real='#undef USE_REALCODECS'
6044 _def_real_path="#undef REALCODEC_PATH"
6045 _nocodecmodules="real $_nocodecmodules"
6047 echores "$_real"
6050 echocheck "LIVE555 Streaming Media libraries"
6051 if test "$_live" = auto && test "$_network" = yes ; then
6052 cat > $TMPCPP << EOF
6053 #include <liveMedia.hh>
6054 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1090195200)
6055 #error Please upgrade to version 2004.07.19 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6056 #endif
6057 int main(void) {}
6060 _live=no
6061 for I in "$_livelibdir" "$_libdir/live" "/usr/lib/live" "/usr/local/live" "/usr/local/lib/live" ; do
6062 cxx_check -I$I/liveMedia/include -I$I/UsageEnvironment/include -I$I/groupsock/include && _livelibdir=$I && _live=yes && break
6063 done
6064 if test "$_live" != yes ; then
6065 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
6066 _live_dist=yes
6070 if test "$_live" = yes && test "$_network" = yes ; then
6071 _res_comment="using $_livelibdir"
6072 _def_live='#define STREAMING_LIVE555 1'
6073 _live_libs_def="# LIVE555 Streaming Media libraries:
6074 LIVE_LIB_DIR = $_livelibdir
6075 LIVE_LIBS = \$(LIVE_LIB_DIR)/liveMedia/libliveMedia.a
6076 LIVE_LIBS += \$(LIVE_LIB_DIR)/groupsock/libgroupsock.a
6077 LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
6078 LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
6079 LIVE_LIBS += -lstdc++
6080 LIVE_INCLUDES = -I\$(LIVE_LIB_DIR)/liveMedia/include
6081 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/UsageEnvironment/include
6082 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/BasicUsageEnvironment/include
6083 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/groupsock/include"
6084 _ld_live='$(LIVE_LIBS)'
6085 _inputmodules="live555 $_inputmodules"
6086 elif test "$_live_dist" = yes && test "$_network" = yes ; then
6087 _res_comment="using distribution version"
6088 _live="yes"
6089 _def_live='#define STREAMING_LIVE555 1'
6090 _live_libs_def="# LIVE555 Streaming Media libraries:
6091 LIVE_LIB_DIR = $_livelibdir
6092 LIVE_LIBS = -lliveMedia
6093 LIVE_LIBS += -lgroupsock
6094 LIVE_LIBS += -lUsageEnvironment
6095 LIVE_LIBS += -lBasicUsageEnvironment
6096 LIVE_LIBS += -lstdc++
6097 LIVE_INCLUDES = -I/usr/include/liveMedia
6098 LIVE_INCLUDES += -I/usr/include/UsageEnvironment
6099 LIVE_INCLUDES += -I/usr/include/BasicUsageEnvironment
6100 LIVE_INCLUDES += -I/usr/include/groupsock"
6101 _ld_live='$(LIVE_LIBS)'
6102 _inputmodules="live555 $_inputmodules"
6103 else
6104 _def_live='#undef STREAMING_LIVE555'
6105 _noinputmodules="live555 $_noinputmodules"
6107 echores "$_live"
6110 echocheck "FFmpeg libavutil (static)"
6111 if test "$_libavutil" = auto ; then
6112 if test -d libavutil ; then
6113 _libavutil=yes
6114 else
6115 _libavutil=no
6118 echores "$_libavutil"
6120 echocheck "FFmpeg libavcodec (static)"
6121 if test "$_libavcodec" = auto ; then
6122 # Note: static linking is preferred to dynamic linking
6123 _libavcodec=no
6124 _res_comment="see DOCS/HTML/$_doc_lang/codecs.html"
6125 if test -d libavcodec && test -f libavcodec/utils.c ; then
6126 _res_comment="old ffmpeg version, use CVS !"
6127 if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
6128 # check if libavutil is a required
6129 cat > $TMPC << EOF
6130 #include "libavcodec/avcodec.h"
6131 #if LIBAVCODEC_BUILD >= 3211265
6132 #error We need libavutil!
6133 #endif
6134 int main(void) { return 0; }
6137 if cc_check -I. -I./libavutil; then
6138 _libavutil_required="no"
6139 else
6140 _libavutil_required="yes"
6142 _res_comment="libavutil availability does not fit libavcodec version"
6143 if test "$_libavutil_required" = "$_libavutil"; then
6144 _libavcodec="yes"
6145 _res_comment=""
6150 echores "$_libavcodec"
6152 echocheck "FFmpeg libavformat (static)"
6153 if test "$_libavformat" = auto ; then
6154 # Note: static linking is preferred to dynamic linking
6155 _libavformat=no
6156 if test -d libavformat && test -f libavformat/utils.c ; then
6157 _libavformat=yes
6160 echores "$_libavformat"
6162 echocheck "FFmpeg libpostproc (static)"
6163 if test "$_libpostproc" = auto ; then
6164 _libpostproc=no
6165 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
6166 _libpostproc='yes'
6169 echores "$_libpostproc"
6172 if test "$_libavutil" != yes ; then
6173 echocheck "FFmpeg libavutil (dynamic)"
6174 if test "$_libavutil_so" = auto ; then
6175 _libavutil_so=no
6176 cat > $TMPC << EOF
6177 #include <ffmpeg/common.h>
6178 int main(void) { ff_gcd(1,1); return 0; }
6180 if pkg-config --exists libavutil ; then
6181 _inc_libavutil=`pkg-config --cflags libavutil`
6182 _ld_libavutil=`pkg-config --libs libavutil`
6183 cc_check $_inc_libavutil $_ld_libavutil && _libavutil_so=yes
6184 elif cc_check -lavutil $_ld_lm ; then
6185 _libavutil_so=yes
6187 if test "$_libavutil_so" == yes ; then
6188 _res_comment="using libavutil.so, but static libavutil is recommended"
6191 echores "$_libavutil_so"
6194 if test "$_libavcodec" != yes ; then
6195 echocheck "FFmpeg libavcodec (dynamic)"
6196 if test "$_libavcodec_so" = auto ; then
6197 _libavcodec_so=no
6198 _res_comment="libavcodec.so is broken/obsolete"
6199 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
6200 cat > $TMPC << EOF
6201 #include <ffmpeg/avcodec.h>
6202 int main(void) {
6203 avcodec_find_encoder_by_name("");
6204 return 0;
6207 if pkg-config --exists libavcodec ; then
6208 _inc_libavcodec=`pkg-config --cflags libavcodec`
6209 _ld_libavcodec=`pkg-config --libs libavcodec`
6210 cc_check $_inc_libavcodec $_ld_libavcodec && _libavcodec_so=yes
6211 elif cc_check -lavcodec $_ld_lm ; then
6212 _libavcodec_so=yes
6214 if test "$_libavcodec_so" == yes ; then
6215 _res_comment="using libavcodec.so, but static libavcodec is recommended"
6218 echores "$_libavcodec_so"
6221 if test "$_libavformat" != yes ; then
6222 echocheck "FFmpeg libavformat (dynamic)"
6223 if test "$_libavformat_so" = auto ; then
6224 _libavformat_so=no
6225 cat > $TMPC <<EOF
6226 #include <ffmpeg/avformat.h>
6227 int main(void) { av_alloc_format_context(); return 0; }
6229 if pkg-config --exists libavformat ; then
6230 _inc_libavformat=`pkg-config --cflags libavformat`
6231 _ld_libavformat=`pkg-config --libs libavformat`
6232 cc_check $_inc_libavformat $_ld_libavformat && _libavformat_so=yes
6233 elif cc_check $_ld_lm -lavformat ; then
6234 _libavformat_so=yes
6236 if test "$_libavformat_so" == yes ; then
6237 _res_comment="using libavformat.so, but static libavformat is recommended"
6240 echores "$_libavformat_so"
6243 if test "$_libpostproc" != yes ; then
6244 echocheck "FFmpeg libpostproc (dynamic)"
6245 if test "$_libpostproc_so" = auto ; then
6246 _libpostproc_so=no
6247 cat > $TMPC << EOF
6248 #define USE_LIBPOSTPROC 1
6249 #include <inttypes.h>
6250 #include <postproc/postprocess.h>
6251 int main(void) {
6252 pp_get_mode_by_name_and_quality("de", 0);
6253 return 0;}
6255 if cc_check -lpostproc $_ld_lm ; then
6256 _libpostproc_so=yes
6257 _res_comment="using libpostproc.so, but static libpostproc is recommended"
6260 echores "$_libpostproc_so"
6263 _def_libavcodec='#undef USE_LIBAVCODEC'
6264 _def_libavcodec_so='#undef USE_LIBAVCODEC_SO'
6265 _def_lavc_dsputil='#undef USE_LIBAVCODEC_DSPUTIL'
6266 if test "$_libavcodec" = yes ; then
6267 _def_libavcodec='#define USE_LIBAVCODEC 1'
6268 _def_lavc_dsputil='#define USE_LIBAVCODEC_DSPUTIL'
6269 _ld_libavcodec='libavcodec/libavcodec.a'
6270 _dep_libavcodec='libavcodec/libavcodec.a'
6271 _codecmodules="libavcodec $_codecmodules"
6272 if test "$_libavutil" = yes; then
6273 _ld_libavutil='libavutil/libavutil.a'
6274 _dep_libavutil='libavutil/libavutil.a'
6276 elif test "$_libavcodec_so" = yes ; then
6277 _def_libavcodec='#define USE_LIBAVCODEC 1'
6278 _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1'
6279 test "$_ld_libavcodec" || _ld_libavcodec='-lavcodec'
6280 _codecmodules="libavcodec.so $_codecmodules"
6281 else
6282 _nocodecmodules="libavcodec $_nocodecmodules"
6285 _def_libavformat='#undef USE_LIBAVFORMAT'
6286 _def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
6287 _def_libavformat_win32='#undef CONFIG_WIN32'
6288 if test "$_libavformat" = yes ; then
6289 _def_libavformat='#define USE_LIBAVFORMAT 1'
6290 _ld_libavformat='libavformat/libavformat.a'
6291 _dep_libavformat='libavformat/libavformat.a'
6292 if win32 ; then
6293 _def_libavformat_win32='#define CONFIG_WIN32 1'
6295 else
6296 if test "$_libavformat_so" = yes ; then
6297 _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
6298 test "$_ld_libavformat" || _ld_libavformat='-lavformat'
6299 if win32 ; then
6300 _def_libavformat_win32='#define CONFIG_WIN32 1'
6305 _def_libpostproc='#undef USE_LIBPOSTPROC'
6306 _def_libpostproc_so='#undef USE_LIBPOSTPROC_SO'
6307 if test "$_libpostproc" = yes ; then
6308 _def_libpostproc='#define USE_LIBPOSTPROC 1'
6309 _ld_libpostproc='libpostproc/libpostproc.a'
6310 _dep_libpostproc='libpostproc/libpostproc.a'
6311 else
6312 if test "$_libpostproc_so" = yes ; then
6313 _def_libpostproc_so='#define USE_LIBPOSTPROC_SO 1'
6314 _ld_libpostproc='-lpostproc'
6318 echocheck "AMR narrowband"
6319 if test "$_amr_nb" = auto ; then
6320 _amr_nb=no
6321 if test -f libavcodec/amr_float/sp_dec.c ; then
6322 if test "$_libavcodec" = yes ; then
6323 _amr_nb=yes
6324 else
6325 _res_comment="libavcodec (static) is required by amr_nb, sorry"
6329 if test "$_amr_nb" = yes ; then
6330 _amr=yes
6331 _def_amr='#define AMR 1'
6332 _def_amr_nb='#define AMR_NB 1'
6333 else
6334 _def_amr_nb='#undef AMR_NB'
6336 echores "$_amr_nb"
6338 echocheck "AMR narrowband, fixed point"
6339 if test "$_amr_nb_fixed" = auto ; then
6340 _amr_nb_fixed=no
6341 if test -f libavcodec/amr/dtx_dec.c ; then
6342 if test "$_libavcodec" = yes ; then
6343 if test "$_amr_nb" = no ; then
6344 _amr_nb_fixed=yes
6345 else
6346 _res_comment="disabled by amr_nb"
6348 else
6349 _res_comment="libavcodec (static) is required by amr_nb-fixed, sorry"
6353 if test "$_amr_nb_fixed" = yes ; then
6354 _amr=yes
6355 _def_amr='#define AMR 1'
6356 _def_amr_nb_fixed='#define AMR_NB_FIXED 1'
6357 else
6358 _def_amr_nb_fixed='#undef AMR_NB_FIXED'
6360 echores "$_amr_nb_fixed"
6362 if test "$_amr_nb" = yes ; then
6363 _codecmodules="amr_nb $_codecmodules"
6364 else
6365 _nocodecmodules="amr_nb $_nocodecmodules"
6368 echocheck "AMR wideband"
6369 if test "$_amr_wb" = auto ; then
6370 _amr_wb=no
6371 if test -f libavcodec/amrwb_float/dec_dtx.c ; then
6372 if test "$_libavcodec" = yes ; then
6373 _amr_wb=yes
6374 else
6375 _res_comment="libavcodec (static) is required by amr_wb, sorry"
6379 if test "$_amr_wb" = yes ; then
6380 _amr=yes
6381 _def_amr='#define AMR 1'
6382 _def_amr_wb='#define AMR_WB 1'
6383 _codecmodules="amr_wb $_codecmodules"
6384 else
6385 _def_amr_wb='#undef AMR_WB'
6386 _nocodecmodules="amr_wb $_nocodecmodules"
6388 echores "$_amr_wb"
6390 echocheck "libdv-0.9.5+"
6391 if test "$_libdv" = auto ; then
6392 _libdv=no
6393 cat > $TMPC <<EOF
6394 #include <libdv/dv.h>
6395 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6397 cc_check -ldv $_ld_lm && _libdv=yes
6399 if test "$_libdv" = yes ; then
6400 _def_libdv='#define HAVE_LIBDV095 1'
6401 _ld_libdv="-ldv"
6402 _codecmodules="libdv $_codecmodules"
6403 else
6404 _def_libdv='#undef HAVE_LIBDV095'
6405 _nocodecmodules="libdv $_nocodecmodules"
6407 echores "$_libdv"
6409 echocheck "zr"
6410 if test "$_zr" = auto ; then
6411 #36067's seem to identify themselves as 36057PQC's, so the line
6412 #below should work for 36067's and 36057's.
6413 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6414 _zr=yes
6415 else
6416 _zr=no
6419 if test "$_zr" = yes ; then
6420 if test "$_libavcodec" = yes ; then
6421 _def_zr='#define HAVE_ZR 1'
6422 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6423 _vomodules="zr zr2 $_vomodules"
6424 else
6425 _res_comment="libavcodec (static) is required by zr, sorry"
6426 _novomodules="zr $_novomodules"
6427 _def_zr='#undef HAVE_ZR'
6429 else
6430 _def_zr='#undef HAVE_ZR'
6431 _novomodules="zr zr2 $_novomodules"
6433 echores "$_zr"
6435 echocheck "bl"
6436 if test "$_bl" = yes ; then
6437 _def_bl='#define HAVE_BL 1'
6438 _vosrc="$_vosrc vo_bl.c"
6439 _vomodules="bl $_vomodules"
6440 else
6441 _def_bl='#undef HAVE_BL'
6442 _novomodules="bl $_novomodules"
6444 echores "$_bl"
6446 echocheck "XviD"
6447 cat > $TMPC << EOF
6448 #include <xvid.h>
6449 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
6451 _ld_xvid="$_ld_xvid -lxvidcore"
6452 _xvid4=no
6453 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid $_ld_lm ; then
6454 _xvid=yes
6455 _def_xvid3='#define HAVE_XVID3 1'
6456 _def_xvid4='#undef HAVE_XVID4'
6457 _codecmodules="xvid $_codecmodules"
6458 else
6459 cat > $TMPC << EOF
6460 #include <xvid.h>
6461 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6463 if test "$_xvid" != no ;then
6464 if cc_check $_inc_xvid $_ld_xvid $_ld_lm ; then
6465 _xvid4=yes
6466 elif cc_check $_inc_xvid $_ld_xvid $_ld_lm $_ld_pthread ; then
6467 _xvid4=yes;
6468 _ld_xvid="$_ld_xvid $_ld_pthread"
6472 if test "$_xvid4" = yes ; then
6473 _xvid=yes
6474 _xvid4=yes
6475 _def_xvid3='#undef HAVE_XVID3'
6476 _def_xvid4='#define HAVE_XVID4 1'
6477 _codecmodules="xvid $_codecmodules"
6478 else
6479 _xvid=no
6480 _ld_xvid=''
6481 _def_xvid3='#undef HAVE_XVID3'
6482 _def_xvid4='#undef HAVE_XVID4'
6483 _nocodecmodules="xvid $_nocodecmodules"
6486 echores "$_xvid"
6488 if test "$_xvid4" = yes ; then
6489 echocheck "XviD two pass plugin"
6490 cat > $TMPC << EOF
6491 #include <xvid.h>
6492 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
6494 if cc_check $_inc_xvid $_ld_xvid $_ld_lb ; then
6495 _lavc_xvid=yes
6496 _def_lavc_xvid='#define CONFIG_XVID 1'
6497 else
6498 _lavc_xvid=no
6499 _def_lavc_xvid='#undef CONFIG_XVID'
6501 echores "$_lavc_xvid"
6504 _xvidcompat=no
6505 _def_decore_xvid='#undef DECORE_XVID'
6506 _def_encore_xvid='#undef ENCORE_XVID'
6507 if test "$_xvid" = yes ; then
6508 echocheck "DivX4 compatibility in XviD"
6509 cat > $TMPC << EOF
6510 #include <divx4.h>
6511 int main(void) { (void) decore(0, 0, 0, 0); return 0; }
6513 cc_check $_ld_lm "$_ld_xvid" && _xvidcompat=yes
6514 echores "$_xvidcompat"
6517 echocheck "x264"
6518 cat > $TMPC << EOF
6519 #include <inttypes.h>
6520 #include <x264.h>
6521 #if X264_BUILD < 46
6522 #error We do not support old versions of x264. Get the latest from SVN.
6523 #endif
6524 int main(void) { x264_encoder_open((void*)0); return 0; }
6526 _ld_x264="$_ld_x264 -lx264 $_ld_pthread"
6527 if test "$_x264" != no ; then
6528 _x264=no
6529 if cc_check $_inc_x264 $_ld_x264 $_ld_lm ; then
6530 _x264=yes
6531 elif test "$_x11" = yes && cc_check $_inc_x264 $_inc_x11 $_ld_x264 $_ld_x11 $_ld_lm ; then
6532 _x264=yes
6533 _ld_x264="$_ld_x264 $_ld_x11"
6537 if test "$_x264" = yes ; then
6538 _x264=yes
6539 _def_x264='#define HAVE_X264 1'
6540 _codecmodules="x264 $_codecmodules"
6541 else
6542 _x264=no
6543 _ld_x264=''
6544 _def_x264='#undef HAVE_X264'
6545 _nocodecmodules="x264 $_nocodecmodules"
6547 echores "$_x264"
6549 echocheck "DivX4linux/DivX5linux/OpenDivX decore"
6550 # DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
6551 cat > $TMPC << EOF
6552 #include <decore.h>
6553 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_FRAME_311; }
6555 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
6556 _divx=yes
6557 _opendivx=no
6558 _ld_decore='-ldivxdecore'
6559 _def_decore='#define NEW_DECORE 1'
6560 _def_divx='#define USE_DIVX'
6561 _def_divx5='#undef DECORE_DIVX5'
6562 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6563 _codecmodules="divx4linux $_codecmodules"
6564 _res_comment="DivX4linux - with libdivxdecore.so"
6565 else
6566 # if test "$_divx4linux" != no ; then
6567 # DivX5 check
6568 # OdivxPP disabled because of:
6569 # ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
6570 cat > $TMPC << EOF
6571 #include <decore.h>
6572 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_INIT; }
6574 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
6575 _divx=yes
6576 _opendivx=no
6577 # _ld_decore='-ldivxdecore opendivx/postprocess.o'
6578 _ld_decore='-ldivxdecore'
6579 _def_decore='#define NEW_DECORE 1'
6580 _def_divx='#define USE_DIVX'
6581 _def_divx5='#define DECORE_DIVX5 1'
6582 # _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
6583 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6584 _codecmodules="divx5linux $_codecmodules"
6585 _nocodecmodules="divx4linux $_nocodecmodules"
6586 _res_comment="DivX5linux - with libdivxdecore.so"
6587 elif test "$_opendivx" != no ; then
6588 _divx=yes
6589 _opendivx=yes
6590 _ld_decore='opendivx/libdecore.a'
6591 _def_decore='#undef NEW_DECORE'
6592 _def_divx='#define USE_DIVX'
6593 _def_divx5='#undef DECORE_DIVX5'
6594 _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
6595 _codecmodules="opendivx $_codecmodules"
6596 _nocodecmodules="divx5linux $_nocodecmodules"
6597 _res_comment="OpenDivX"
6598 elif test "$_xvidcompat" = yes ; then
6599 _divx=yes
6600 _opendivx=no
6601 _ld_decore=''
6602 _def_decore='#define NEW_DECORE 1'
6603 _def_divx='#define USE_DIVX 1'
6604 _def_divx5='#undef DECORE_DIVX5'
6605 _def_decore_xvid='#define DECORE_XVID 1'
6606 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6607 _nocodecmodules="opendivx divx5linux divx4linux $_nocodecmodules"
6608 _res_comment="XviD compat."
6609 else
6610 _divx=no
6611 _opendivx=no
6612 _ld_decore=''
6613 _def_decore='#undef NEW_DECORE'
6614 _def_divx='#undef USE_DIVX'
6615 _def_divx5='#undef DECORE_DIVX5'
6616 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6617 _nocodecmodules="opendivx $_nocodecmodules"
6618 fi # DivX5 check
6620 echores "$_divx"
6623 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
6624 if test "$_mencoder" != no ; then
6626 echocheck "libmp3lame (for mencoder)"
6627 _mp3lame=no
6628 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6629 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6630 cat > $TMPC <<EOF
6631 #include <lame/lame.h>
6632 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; }
6634 # Note: libmp3lame usually depends on vorbis
6635 cc_check -lmp3lame $_ld_vorbis $_ld_lm && tmp_run && _mp3lame=yes
6636 if test "$_mp3lame" = yes ; then
6637 _def_mp3lame="#define HAVE_MP3LAME"
6638 _def_lavc_mp3lame="#define CONFIG_MP3LAME 1"
6639 _ld_mp3lame="-lmp3lame $_ld_vorbis"
6640 cat > $TMPC << EOF
6641 #include <lame/lame.h>
6642 int main(void) { int p = STANDARD_FAST; return 0; }
6644 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6645 cat > $TMPC << EOF
6646 #include <lame/lame.h>
6647 int main(void) { int p = MEDIUM_FAST; return 0; }
6649 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6650 else
6651 _def_mp3lame='#undef HAVE_MP3LAME'
6653 echores "$_mp3lame"
6656 echocheck "DivX4linux encore (for mencoder)"
6657 cat > $TMPC << EOF
6658 #include <encore2.h>
6659 int main(void) { (void) encore(0, 0, 0, 0); return 0; }
6661 if test "$_divx4linux" != no && cc_check -ldivxencore $_ld_lm ; then
6662 _divx_encore=yes
6663 _def_encore='#define HAVE_DIVX4ENCORE 1'
6664 _ld_encore='-ldivxencore'
6665 _res_comment="DivX4linux - with libdivxencore.so"
6666 elif test "$_xvidcompat" = yes ; then
6667 _divx_encore=yes
6668 _def_encore='#define HAVE_DIVX4ENCORE 1'
6669 _ld_encore=''
6670 _def_encore_xvid='#define ENCORE_XVID 1'
6671 _res_comment="XviD compatibility"
6672 else
6673 _divx_encore=no
6674 _def_encore='#undef HAVE_DIVX4ENCORE'
6676 echores "$_divx_encore"
6680 echocheck "mencoder"
6681 _mencoder_flag='#undef HAVE_MENCODER'
6682 if test "$_mencoder" = yes ; then
6683 _mencoder_flag='#define HAVE_MENCODER'
6685 echores "$_mencoder"
6687 echocheck "fastmemcpy"
6688 # fastmemcpy check is done earlier with tests of CPU & binutils features
6689 if test "$_fastmemcpy" = yes ; then
6690 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6691 else
6692 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6694 echores "$_fastmemcpy"
6696 echocheck "UniquE RAR File Library"
6697 if test "$_unrarlib" = yes ; then
6698 _def_unrarlib='#define USE_UNRARLIB 1'
6699 else
6700 _def_unrarlib='#undef USE_UNRARLIB'
6702 echores "$_unrarlib"
6704 echocheck "TV interface"
6705 if test "$_tv" = yes ; then
6706 _def_tv='#define USE_TV 1'
6707 _inputmodules="tv $_inputmodules"
6708 else
6709 _noinputmodules="tv $_noinputmodules"
6710 _def_tv='#undef USE_TV'
6712 echores "$_tv"
6714 echocheck "*BSD BrookTree 848 TV interface"
6715 if test "$_tv_bsdbt848" = auto ; then
6716 _tv_bsdbt848=no
6717 if test "$_tv" = yes ; then
6718 cat > $TMPC <<EOF
6719 #include <sys/types.h>
6720 #if defined(__NetBSD__)
6721 #include <dev/ic/bt8xx.h>
6722 #else
6723 #include <machine/ioctl_bt848.h>
6724 #endif
6725 int main(void) { return 0; }
6727 cc_check && _tv_bsdbt848=yes
6730 if test "$_tv_bsdbt848" = yes ; then
6731 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6732 _inputmodules="tv-bsdbt848 $_inputmodules"
6733 else
6734 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6735 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6737 echores "$_tv_bsdbt848"
6739 echocheck "Video 4 Linux TV interface"
6740 if test "$_tv_v4l" = auto ; then
6741 _tv_v4l=no
6742 if test "$_tv" = yes && linux ; then
6743 cat > $TMPC <<EOF
6744 #include <stdlib.h>
6745 #include <linux/videodev.h>
6746 int main(void) { return 0; }
6748 cc_check && _tv_v4l=yes
6751 if test "$_tv_v4l" = yes ; then
6752 _def_tv_v4l='#define HAVE_TV_V4L 1'
6753 _inputmodules="tv-v4l $_inputmodules"
6754 else
6755 _noinputmodules="tv-v4l $_noinputmodules"
6756 _def_tv_v4l='#undef HAVE_TV_V4L'
6758 echores "$_tv_v4l"
6761 echocheck "Video 4 Linux 2 TV interface"
6762 if test "$_tv_v4l2" = auto ; then
6763 _tv_v4l2=no
6764 if test "$_tv" = yes && linux ; then
6765 cat > $TMPC <<EOF
6766 #include <stdlib.h>
6767 #include <linux/types.h>
6768 #include <linux/videodev2.h>
6769 int main(void) { return 0; }
6771 cc_check && _tv_v4l2=yes
6774 if test "$_tv_v4l2" = yes ; then
6775 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6776 _inputmodules="tv-v4l2 $_inputmodules"
6777 else
6778 _noinputmodules="tv-v4l2 $_noinputmodules"
6779 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6781 echores "$_tv_v4l2"
6784 echocheck "audio select()"
6785 if test "$_select" = no ; then
6786 _def_select='#undef HAVE_AUDIO_SELECT'
6787 elif test "$_select" = yes ; then
6788 _def_select='#define HAVE_AUDIO_SELECT 1'
6790 echores "$_select"
6793 echocheck "network"
6794 # FIXME network check
6795 if test "$_network" != no ; then
6796 _def_network='#define MPLAYER_NETWORK 1'
6797 _ld_network="$_ld_sock"
6798 _inputmodules="network $_inputmodules"
6799 else
6800 _noinputmodules="network $_noinputmodules"
6801 _def_network='#undef MPLAYER_NETWORK'
6802 _ftp=no
6804 echores "$_network"
6806 echocheck "ftp"
6807 if not beos && test "$_ftp" != no ; then
6808 _def_ftp='#define HAVE_FTP 1'
6809 _inputmodules="ftp $_inputmodules"
6810 else
6811 _noinputmodules="ftp $_noinputmodules"
6812 _def_ftp='#undef HAVE_FTP'
6814 echores "$_ftp"
6816 echocheck "vstream client"
6817 if test "$_vstream" = auto ; then
6818 _vstream=no
6819 cat > $TMPC <<EOF
6820 #include <vstream-client.h>
6821 void vstream_error(const char *format, ... ) {}
6822 int main(void) { vstream_start(); return 0; }
6824 cc_check -lvstream-client && _vstream=yes
6826 if test "$_vstream" = yes ; then
6827 _def_vstream='#define HAVE_VSTREAM 1'
6828 _inputmodules="vstream $_inputmodules"
6829 _ld_vstream='-lvstream-client'
6830 else
6831 _noinputmodules="vstream $_noinputmodules"
6832 _def_vstream='#undef HAVE_VSTREAM'
6834 echores "$_vstream"
6836 # endian testing
6837 echocheck "byte order"
6838 if test "$_big_endian" = auto ; then
6839 cat > $TMPC <<EOF
6840 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6841 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6842 int main(){
6843 return (int)ascii_name;
6846 if cc_check ; then
6847 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6848 _big_endian=yes
6849 else
6850 _big_endian=no
6852 else
6853 echo -n "failed to autodetect byte order, defaulting to "
6856 if test "$_big_endian" = yes ; then
6857 _byte_order='big-endian'
6858 _def_words_endian='#define WORDS_BIGENDIAN 1'
6859 else
6860 _byte_order='little-endian'
6861 _def_words_endian='#undef WORDS_BIGENDIAN'
6863 echores "$_byte_order"
6865 echocheck "OSD menu"
6866 if test "$_menu" = yes ; then
6867 _def_menu='#define HAVE_MENU 1'
6868 else
6869 _def_menu='#undef HAVE_MENU'
6871 echores "$_menu"
6873 # Check to see if they want QTX codecs enabled
6874 echocheck "QTX codecs"
6875 if test "$_qtx" = auto ; then
6876 _qtx=$_win32
6878 if test "$_qtx" = yes ; then
6879 _def_qtx='#define USE_QTX_CODECS 1'
6880 _codecmodules="qtx $_codecmodules"
6881 else
6882 _def_qtx='#undef USE_QTX_CODECS'
6883 _nocodecmodules="qtx $_nocodecmodules"
6885 echores "$_qtx"
6888 echocheck "Subtitles sorting"
6889 if test "$_sortsub" = yes ; then
6890 _def_sortsub='#define USE_SORTSUB 1'
6891 else
6892 _def_sortsub='#undef USE_SORTSUB'
6894 echores "$_sortsub"
6897 echocheck "XMMS inputplugin support"
6898 if test "$_xmms" = yes ; then
6900 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6901 if test -z "$_xmmsplugindir" ; then
6902 _xmmsplugindir=`xmms-config --input-plugin-dir`
6904 if test -z "$_xmmslibdir" ; then
6905 _xmmslibdir=`xmms-config --exec-prefix`/lib
6907 else
6908 if test -z "$_xmmsplugindir" ; then
6909 _xmmsplugindir=/usr/lib/xmms/Input
6911 if test -z "$_xmmslibdir" ; then
6912 _xmmslibdir=/usr/lib
6916 _def_xmms='#define HAVE_XMMS 1'
6917 if darwin ; then
6918 _xmms_lib="${_xmmslibdir}/libxmms.dylib"
6919 else
6920 _xmms_lib="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6922 else
6923 _def_xmms='#undef HAVE_XMMS'
6925 echores "$_xmms"
6927 echocheck "inet6"
6928 if test "$_inet6" = auto ; then
6929 cat > $TMPC << EOF
6930 #include <sys/types.h>
6931 #include <sys/socket.h>
6932 int main(void) { socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6934 _inet6=no
6935 if cc_check ; then
6936 _inet6=yes
6939 if test "$_inet6" = yes ; then
6940 _def_inet6='#define HAVE_AF_INET6 1'
6941 else
6942 _def_inet6='#undef HAVE_AF_INET6'
6944 echores "$_inet6"
6947 echocheck "gethostbyname2"
6948 if test "$_gethostbyname2" = auto ; then
6949 cat > $TMPC << EOF
6950 #include <sys/types.h>
6951 #include <sys/socket.h>
6952 #include <netdb.h>
6953 int main(void) { gethostbyname2("", AF_INET); }
6955 _gethostbyname2=no
6956 if cc_check ; then
6957 _gethostbyname2=yes
6961 if test "$_gethostbyname2" = yes ; then
6962 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6963 else
6964 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6966 echores "$_gethostbyname2"
6968 # --------------- GUI specific tests begin -------------------
6969 echocheck "GUI"
6970 echo "$_gui"
6971 if test "$_gui" = yes ; then
6973 # Required libraries
6974 test "$_png" != yes && die "PNG support required for GUI compilation, please install libpng and libpng-dev packages."
6975 test "$_x11" != yes && die "X11 support required for GUI compilation"
6977 echocheck "XShape extension"
6978 _xshape=no
6979 if test "$_x11" = yes ; then
6980 cat > $TMPC << EOF
6981 #include <X11/Xlib.h>
6982 #include <X11/Xproto.h>
6983 #include <X11/Xutil.h>
6984 #include <X11/extensions/shape.h>
6985 #include <stdlib.h>
6986 int main(void) {
6987 char *name = ":0.0";
6988 Display *wsDisplay;
6989 int exitvar = 0;
6990 int eventbase, errorbase;
6991 if (getenv("DISPLAY"))
6992 name=getenv("DISPLAY");
6993 wsDisplay=XOpenDisplay(name);
6994 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6995 exitvar=1;
6996 XCloseDisplay(wsDisplay);
6997 return exitvar;
7000 cc_check $_inc_x11 $_ld_x11 && _xshape=yes
7002 if test "$_xshape" = yes ; then
7003 _def_xshape='#define HAVE_XSHAPE 1'
7004 else
7005 die "The GUI requires the X11 extension XShape (which was not found)."
7007 echores "$_xshape"
7009 #Check for GTK
7010 if test "$_gtk1" = no ; then
7011 #Check for GTK2 :
7012 echocheck "GTK+ version"
7014 if pkg-config gtk+-2.0 --exists ; then
7015 _gtk=`pkg-config gtk+-2.0 --modversion 2>/dev/null`
7016 _inc_gtk=`pkg-config gtk+-2.0 --cflags 2>/dev/null`
7017 _ld_gtk=`pkg-config gtk+-2.0 --libs 2>/dev/null`
7018 echores "$_gtk"
7020 # Check for GLIB2
7021 if pkg-config glib-2.0 --exists ; then
7022 echocheck "glib version"
7023 _glib=`pkg-config glib-2.0 --modversion 2>/dev/null`
7024 _inc_glib=`pkg-config glib-2.0 --cflags 2>/dev/null`
7025 _ld_glib=`pkg-config glib-2.0 --libs 2>/dev/null`
7026 echores "$_glib"
7028 _def_gui='#define HAVE_NEW_GUI 1'
7029 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
7030 _ld_gui='$(GTKLIB) $(GLIBLIB)'
7031 else
7032 _gtk1=yes
7033 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7035 else
7036 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7037 _gtk1=yes
7041 if test "$_gtk1" = yes ; then
7042 # Check for old GTK (1.2.x)
7043 echocheck "GTK version"
7044 if test -z "$_gtkconfig" ; then
7045 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7046 _gtkconfig="gtk-config"
7047 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7048 _gtkconfig="gtk12-config"
7049 else
7050 die "The GUI requires GTK devel packages (which were not found)."
7053 _gtk=`$_gtkconfig --version 2>&1`
7054 _inc_gtk=`$_gtkconfig --cflags 2>&1`
7055 _ld_gtk=`$_gtkconfig --libs 2>&1`
7056 echores "$_gtk (using $_gtkconfig)"
7058 # Check for GLIB
7059 echocheck "glib version"
7060 if test -z "$_glibconfig" ; then
7061 if ( glib-config --version ) >/dev/null 2>&1 ; then
7062 _glibconfig="glib-config"
7063 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
7064 _glibconfig="glib12-config"
7065 else
7066 die "The GUI requires GLib devel packages (which were not found)"
7069 _glib=`$_glibconfig --version 2>&1`
7070 _inc_glib=`$_glibconfig --cflags 2>&1`
7071 _ld_glib=`$_glibconfig --libs 2>&1`
7072 echores "$_glib (using $_glibconfig)"
7074 _def_gui='#define HAVE_NEW_GUI 1'
7075 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7076 _ld_gui='$(GTKLIB) $(GLIBLIB)'
7079 echo "Creating Gui/config.mak"
7080 cat > Gui/config.mak << EOF
7081 # -------- Generated by configure -----------
7083 GTKINC = $_inc_gtk
7084 GTKLIBS = $_ld_gtk
7085 GLIBINC = $_inc_glib
7086 GLIBLIBS = $_ld_glib
7090 else
7091 _def_gui='#undef HAVE_NEW_GUI'
7092 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
7094 # --------------- GUI specific tests end -------------------
7096 if test "$_charset" = "noconv" ; then
7097 _charset=""
7098 elif test -z "$_charset" ; then
7099 if test "$_gtk1" = yes ; then
7100 _charset=`cat ${_mp_help}.charset`
7101 else
7102 _charset="UTF-8"
7105 if test "$_charset" ; then
7106 _def_charset="#define MSG_CHARSET \"$_charset\""
7107 else
7108 _def_charset="#undef MSG_CHARSET"
7111 echocheck "iconv program"
7112 iconv -f `cat ${_mp_help}.charset` -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7113 if test "$?" -ne 0 ; then
7114 echores "no"
7115 if test "$_charset" != `cat ${_mp_help}.charset` ; then
7116 echo "No working iconv program found, use "
7117 echo "--charset=`cat ${_mp_help}.charset` to continue anyway."
7118 echo "Messages in the GTK-2 interface will be broken then."
7119 exit 1
7121 else
7122 echores "yes"
7125 if test "$_charset" = `cat ${_mp_help}.charset` ; then
7126 # hack to disable conversion in the Makefile
7127 _charset=""
7130 #############################################################################
7132 echocheck "automatic gdb attach"
7133 if test "$_crash_debug" = yes ; then
7134 _def_crash_debug='#define CRASH_DEBUG 1'
7135 else
7136 _def_crash_debug='#undef CRASH_DEBUG'
7137 _crash_debug=no
7139 echores "$_crash_debug"
7141 if darwin ; then
7142 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN"
7143 if x86 ; then
7144 CFLAGS="$CFLAGS -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
7146 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
7147 CFLAGS="$CFLAGS -no-cpp-precomp"
7150 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
7151 test "$_altivec" = yes && CFLAGS="$CFLAGS -DCONFIG_DARWIN"
7153 if hpux ; then
7154 # use flag for HPUX missing setenv()
7155 CFLAGS="$CFLAGS -DHPUX"
7157 # Thread support
7158 if linux ; then
7159 CFLAGS="$CFLAGS -D_REENTRANT"
7160 elif bsd ; then
7161 # FIXME bsd needs this so maybe other OS'es
7162 CFLAGS="$CFLAGS -D_THREAD_SAFE"
7164 # 64 bit file offsets?
7165 if test "$_largefiles" = yes || freebsd ; then
7166 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7167 if test "$_dvdread" = yes ; then
7168 # dvdread support requires this (for off64_t)
7169 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7173 echocheck "compiler support for -fno-PIC"
7174 if x86; then
7175 cat > $TMPC <<EOF
7176 int main(void) { return 0; }
7178 if cc_check -fno-PIC ; then
7179 CFLAGS="-fno-PIC $CFLAGS"
7180 echores "yes"
7181 else
7182 echores "no"
7184 else
7185 echores "only used for x86"
7188 echocheck "compiler support for noexecstack"
7189 cat > $TMPC <<EOF
7190 int main(void) { return 0; }
7192 if cc_check -Wl,-z,noexecstack ; then
7193 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
7194 echores "yes"
7195 else
7196 echores "no"
7199 echocheck "ftello()"
7200 # if we don't have ftello use the osdep/ compatibility module
7201 cat > $TMPC << EOF
7202 #include <stdio.h>
7203 #include <sys/types.h>
7204 int main (void) { ftello(stdin); return 0; }
7206 _ftello=no
7207 cc_check && _ftello=yes
7208 if test "$_ftello" = yes ; then
7209 _def_ftello='#define HAVE_FTELLO 1'
7210 else
7211 _def_ftello='#undef HAVE_FTELLO'
7213 echores "$_ftello"
7215 # Determine OS dependent libs
7216 if cygwin ; then
7217 _def_confwin32='#define WIN32'
7218 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
7219 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
7220 CFLAGS="$CFLAGS -D__CYGWIN__"
7223 if win32 ; then
7224 _confwin32='TARGET_WIN32 = yes'
7225 else
7226 _confwin32='TARGET_WIN32 = no'
7229 # Dynamic linking flags
7230 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7231 _ld_dl_dynamic=''
7232 bsd && _ld_dl_dynamic='-rdynamic'
7233 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx && not darwin ; then
7234 _ld_dl_dynamic='-rdynamic'
7237 _ld_arch="$_ld_arch $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7238 bsdos && _ld_arch="$_ld_arch -ldvd"
7239 if netbsd ; then
7240 x86 && _ld_arch="$_ld_arch -li386"
7243 _def_debug='#undef MP_DEBUG'
7244 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
7246 _def_linux='#undef TARGET_LINUX'
7247 linux && _def_linux='#define TARGET_LINUX 1'
7249 # TODO cleanup the VIDIX stuff here
7250 echocheck "VIDIX (internal)"
7251 echores "$_vidix_internal"
7253 echocheck "VIDIX (external)"
7254 if test "$_vidix_external" = auto; then
7255 _vidix_external=no
7256 cat > $TMPC <<EOF
7257 #include <vidix/vidix.h>
7258 int main(void) { return 0; }
7260 cc_check -lvidix && _vidix_external=yes
7262 echores "$_vidix_external"
7264 if test "$_vidix_internal" = yes || test "$_vidix_external" = yes ; then
7265 _vidix=yes
7266 _def_vidix='#define CONFIG_VIDIX 1'
7267 else
7268 _vidix=no
7269 _def_vidix='#undef CONFIG_VIDIX'
7272 if test "$_vidix_internal" = yes ; then
7273 _def_vidix_pfx="#define MP_VIDIX_PFX \"$_libdir\" \"/mplayer/vidix/\" "
7274 elif test "$_vidix_external" = yes ; then
7275 _ld_vidix_external="-lvidix"
7276 _def_vidix_pfx='#define MP_VIDIX_PFX "" '
7279 if test "$_vidix" = yes; then
7280 _vosrc="$_vosrc vo_cvidix.c"
7281 _vomodules="cvidix $_vomodules"
7282 else
7283 _novomodules="cvidix $_novomodules"
7285 if test "$_vidix" = yes && win32; then
7286 _vosrc="$_vosrc vo_winvidix.c"
7287 _vomodules="winvidix $_vomodules"
7288 _ld_win32libs="-lgdi32 $_ld_win32libs"
7289 else
7290 _novomodules="winvidix $_novomodules"
7292 if test "$_vidix" = yes && test "$_x11" = yes; then
7293 _vosrc="$_vosrc vo_xvidix.c"
7294 _vomodules="xvidix $_vomodules"
7295 else
7296 _novomodules="xvidix $_novomodules"
7299 echocheck "joystick"
7300 _def_joystick='#undef HAVE_JOYSTICK'
7301 if test "$_joystick" = yes ; then
7302 if linux ; then
7303 # TODO add some check
7304 _def_joystick='#define HAVE_JOYSTICK 1'
7305 else
7306 _joystick="no (unsupported under $system_name)"
7309 echores "$_joystick"
7311 echocheck "lirc"
7312 if test "$_lirc" = auto ; then
7313 _lirc=no
7314 if test -c /dev/lirc -o -c /dev/lirc/0 ; then
7315 cat > $TMPC <<EOF
7316 #include <lirc/lirc_client.h>
7317 int main(void) { return 0; }
7319 cc_check -llirc_client && _lirc=yes
7322 if test "$_lirc" = yes ; then
7323 _def_lirc='#define HAVE_LIRC 1'
7324 _ld_lirc='-llirc_client'
7325 else
7326 _def_lirc='#undef HAVE_LIRC'
7328 echores "$_lirc"
7330 echocheck "lircc"
7331 if test "$_lircc" = auto ; then
7332 _lircc=no
7333 cat > $TMPC <<EOF
7334 #include <lirc/lircc.h>
7335 int main(void) { return 0; }
7337 cc_check -llircc && _lircc=yes
7339 if test "$_lircc" = yes ; then
7340 _def_lircc='#define HAVE_LIRCC 1'
7341 _ld_lircc='-llircc'
7342 else
7343 _def_lircc='#undef HAVE_LIRCC'
7345 echores "$_lircc"
7347 #############################################################################
7348 echo "Creating config.mak"
7349 cat > config.mak << EOF
7350 # -------- Generated by configure -----------
7352 LANG = C
7353 MAN_LANG = $MAN_LANG
7354 TARGET_OS = $system_name
7355 DESTDIR =
7356 prefix = \$(DESTDIR)$_prefix
7357 BINDIR = \$(DESTDIR)$_bindir
7358 DATADIR = \$(DESTDIR)$_datadir
7359 MANDIR = \$(DESTDIR)$_mandir
7360 CONFDIR = \$(DESTDIR)$_confdir
7361 LIBDIR = \$(DESTDIR)$_libdir
7362 # FFmpeg uses libdir instead of LIBDIR
7363 libdir = \$(LIBDIR)
7364 #AR = ar
7365 CC = $_cc
7366 HOST_CC = $_host_cc
7367 AWK = $_awk
7368 RANLIB = $_ranlib
7369 INSTALL = $_install
7370 EXTRA_INC = $_inc_extra
7371 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
7372 STRIPBINARIES = $_stripbinaries
7373 CHARSET = $_charset
7374 HELP_FILE = $_mp_help
7376 PRG = $_prg
7377 PRG_MENCODER = $_prg_mencoder
7379 $_live_libs_def
7381 MPLAYER_NETWORK = $_network
7382 STREAMING_LIVE555 = $_live
7383 MPLAYER_NETWORK_LIB = $_ld_live $_ld_vstream $_ld_network
7384 DVBIN = $_dvbin
7385 VIDIX = $_vidix_internal
7386 EXTERNAL_VIDIX = $_vidix_external
7387 EXTERNAL_VIDIX_LIB = $_ld_vidix_external
7388 CONFIG_PP = yes
7389 CONFIG_MP3LAME = $_mp3lame
7390 LIBMENU = $_menu
7392 OPENDIVX = $_opendivx
7394 MP3LIB = $_mp3lib
7395 LIBA52 = $_liba52
7396 LIBMPEG2 = $_libmpeg2
7397 TREMOR = $_tremor_internal
7398 TREMOR_FLAGS = $_tremor_flags
7400 SPEEX = $_speex
7401 MUSEPACK = $_musepack
7403 UNRARLIB = $_unrarlib
7404 PNG = $_mkf_png
7405 JPEG = $_mkf_jpg
7406 GIF = $_mkf_gif
7408 EXTRA_LIB = $_ld_extra
7409 Z_LIB = $_ld_static $_ld_zlib
7410 HAVE_MLIB = $_mlib
7411 WIN32_LIB = $_ld_win32libs
7412 STATIC_LIB = $_ld_static
7413 ENCA_LIB = $_ld_enca
7414 HAVE_PTHREADS = $_pthreads
7415 MATH_LIB = $_ld_lm
7416 LIBC_LIB = $_ld_libC
7418 X11_INC = $_inc_x11
7419 X11DIR = $_ld_x11
7421 HAVE_XVMC_ACCEL = $_xvmc
7423 # for FFmpeg
7424 SRC_PATH=`pwd`
7425 LIBPREF=lib
7426 LIBSUF=.a
7427 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7429 # video output
7430 X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
7431 GGI_LIB = $_ld_ggi
7432 MLIB_LIB = $_ld_mlib
7433 MLIB_INC = $_inc_mlib
7434 DXR2_INC = $_inc_dxr2
7435 DVB_INC = $_inc_dvb
7436 PNG_LIB = $_ld_png
7437 JPEG_LIB = $_ld_jpg
7438 GIF_LIB = $_ld_gif
7439 SDL_LIB = $_ld_sdl
7440 SVGA_LIB = $_ld_svga
7441 VESA_LIB = $_ld_vesa
7442 AA_LIB = $_ld_aa
7443 CACA_INC = $_inc_caca
7444 CACA_LIB = $_ld_caca
7446 # audio output
7447 ALSA_LIB = $_ld_alsa
7448 NAS_LIB = $_ld_nas
7449 ARTS_LIB = $_ld_arts
7450 ARTS_INC = $_inc_arts
7451 ESD_LIB = $_ld_esd
7452 ESD_INC = $_inc_esd
7453 POLYP_LIB = $_ld_polyp
7454 POLYP_INC = $_inc_polyp
7455 JACK_LIB = $_ld_jack
7456 JACK_INC = $_inc_jack
7457 OPENAL_LIB = $_ld_openal
7458 OPENAL_INC = $_inc_openal
7459 SGIAUDIO_LIB = $_ld_sgiaudio
7461 # input/demuxer/codecs
7462 TERMCAP_LIB = $_ld_termcap
7463 LIRC_LIB = $_ld_lirc
7464 LIRCC_LIB = $_ld_lircc
7465 HAVE_DVD = $_have_dvd
7466 DVDREAD = $_dvdread
7467 DVDREAD_LIB = $_ld_dvdread
7468 DVDKIT2 = $_dvdkit
7469 SDL_INC = $_inc_sdl
7470 W32_DEP = $_dep_win32
7471 W32_LIB = $_ld_win32
7472 DS_DEP = $_dep_dshow
7473 DS_LIB = $_ld_dshow
7474 AV_DEP = $_dep_libavcodec $_dep_libavformat $_dep_libavutil $_dep_libpostproc
7475 AV_LIB = $_ld_libavcodec $_ld_libavformat $_ld_libavutil $_ld_libpostproc
7476 CONFIG_LIBAVUTIL = $_libavutil
7477 CONFIG_LIBAVUTIL_SO = $_libavutil_so
7478 CONFIG_LIBAVCODEC = $_libavcodec
7479 CONFIG_LIBAVCODEC_SO = $_libavcodec_so
7480 CONFIG_LIBAVFORMAT = $_libavformat
7481 CONFIG_LIBAVFORMAT_SO = $_libavformat_so
7482 CONFIG_LIBPOSTPROC = $_libpostproc
7483 CONFIG_LIBPOSTPROC_SO = $_libpostproc_so
7484 ZORAN = $_zr
7485 FAME = $_fame
7486 FAME_LIB = $_ld_fame
7487 MP1E_DEP = $_dep_mp1e
7488 MP1E_LIB = $_ld_mp1e
7489 ARCH_LIB = $_ld_arch $_ld_iconv
7490 XVID = $_xvid
7491 XVID_INC = $_inc_xvid
7492 XVID_LIB = $_ld_xvid
7493 X264 = $_x264
7494 X264_INC = $_inc_x264
7495 X264_LIB = $_ld_x264
7496 CONFIG_DTS = $_libdts
7497 DTS_INC = $_inc_libdts
7498 DTS_LIB = $_ld_libdts
7499 DECORE_LIB = $_ld_decore $_ld_mp3lame
7500 MENCODER = $_mencoder
7501 ENCORE_LIB = $_ld_encore $_ld_mp3lame
7502 DIRECTFB_INC = $_inc_directfb
7503 DIRECTFB_LIB = $_ld_directfb
7504 CDPARANOIA_INC = $_inc_cdparanoia
7505 CDPARANOIA_LIB = $_ld_cdparanoia
7506 FREETYPE_INC = $_inc_freetype
7507 FREETYPE_LIB = $_ld_freetype
7508 FONTCONFIG_INC = $_inc_fontconfig
7509 FONTCONFIG_LIB = $_ld_fontconfig
7510 FRIBIDI_INC = $_inc_fribidi
7511 FRIBIDI_LIB = $_ld_fribidi
7512 LIBCDIO_INC = $_inc_libcdio
7513 LIBCDIO_LIB = $_ld_libcdio
7514 LIBLZO_LIB= $_ld_liblzo
7515 MAD_LIB = $_ld_mad
7516 VORBIS_LIB = $_ld_vorbis $_ld_libdv
7517 SPEEX_LIB = $_ld_speex
7518 THEORA_LIB = $_ld_theora
7519 FAAD_LIB = $_ld_faad
7520 INTERNAL_FAAD = $_faad_internal
7521 SMBSUPPORT_LIB = $_ld_smb
7522 XMMS_PLUGINS = $_xmms
7523 XMMS_LIB = $_xmms_lib
7524 MACOSX = $_macosx
7525 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7526 MACOSX_BUNDLE = $_macosx_bundle
7527 MACOSX_FRAMEWORKS = $_macosx_frameworks
7528 MACOSX_COREVIDEO = $_macosx_corevideo
7529 TOOLAME=$_toolame
7530 TOOLAME_EXTRAFLAGS=$_toolame_extraflags
7531 TOOLAME_LIB=$_toolame_lib
7532 TWOLAME=$_twolame
7533 TWOLAME_LIB=$_twolame_lib
7534 MUSEPACK_LIB = $_ld_musepack
7535 FAAC=$_faac
7536 FAAC_LIB=$_ld_faac
7537 AMR=$_amr
7538 AMR_NB=$_amr_nb
7539 AMR_NB_FIXED=$_amr_nb_fixed
7540 AMR_WB=$_amr_wb
7541 `echo $_libavcodecs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7542 CONFIG_FAAC=$_faac
7543 CONFIG_XVID=$_lavc_xvid
7544 CONFIG_GPL=yes
7545 CONFIG_MUXERS=yes
7547 # --- Some stuff for autoconfigure ----
7548 $_target_arch
7549 $_confwin32
7550 TARGET_CPU=$iproc
7551 TARGET_MMX = $_mmx
7552 TARGET_MMX2 = $_mmxext
7553 TARGET_3DNOW = $_3dnow
7554 TARGET_3DNOWEX = $_3dnowext
7555 TARGET_SSE = $_sse
7556 TARGET_ALTIVEC = $_altivec
7557 TARGET_VIS = $_vis
7558 TARGET_BUILTIN_VECTOR = $_builtin_vector
7559 TARGET_BUILTIN_3DNOW = $_mm3dnow
7561 # --- GUI stuff ---
7562 GTKINC = $_inc_gtk
7563 GTKLIB = $_ld_static $_ld_gtk
7564 GLIBLIB = $_ld_static $_ld_glib
7565 GTK_LIBS = $_ld_static $_ld_gui
7566 GUI = $_gui
7567 DEBUG = -DDEBUG
7571 #############################################################################
7572 echo "Creating config.h"
7573 cat > config.h << EOF
7574 /* -------- This file has been automatically generated by configure ---------
7575 Note: Any changes in it will be lost when you run configure again. */
7577 /* Protect against multiple inclusion */
7578 #ifndef MPLAYER_CONFIG_H
7579 #define MPLAYER_CONFIG_H 1
7581 /* use GNU internationalization */
7582 $_def_i18n
7584 /* name of messages charset */
7585 $_def_charset
7587 /* Runtime CPU detection */
7588 $_def_runtime_cpudetection
7590 /* Dynamic a/v plugins */
7591 $_def_dynamic_plugins
7593 /* "restrict" keyword */
7594 $_def_restrict_keyword
7596 /* __builtin_expect branch prediction hint */
7597 $_def_builtin_expect
7598 #ifdef HAVE_BUILTIN_EXPECT
7599 #define likely(x) __builtin_expect ((x) != 0, 1)
7600 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7601 #else
7602 #define likely(x) (x)
7603 #define unlikely(x) (x)
7604 #endif
7606 /* attribute(used) as needed by some compilers */
7607 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7608 # define attribute_used __attribute__((used))
7609 #else
7610 # define attribute_used
7611 #endif
7613 #define PREFIX "$_prefix"
7615 #define USE_OSD 1
7616 #define USE_SUB 1
7618 /* enable/disable SIGHANDLER */
7619 $_def_sighandler
7621 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7622 $_def_crash_debug
7624 /* Toggles debugging informations */
7625 $_def_debug
7627 /* Toggles colorized output */
7628 //#define MSG_USE_COLORS 1
7630 /* Indicates that libcdio is available for VCD and CD-DA playback */
7631 $_def_libcdio
7633 /* Indicates that Ogle's libdvdread is available for DVD playback */
7634 $_def_dvdread
7636 /* Indicates that dvdread is from libmpdvdkit */
7637 $_def_mpdvdkit
7639 /* Additional options for libmpdvdkit*/
7640 $_def_dvd
7641 $_def_cdrom
7642 $_def_cdio
7643 $_def_dvdio
7644 $_def_bsdi_dvd
7645 $_def_dvd_bsd
7646 $_def_dvd_linux
7647 $_dev_dvd_openbsd
7648 $_def_dvd_darwin
7649 $_def_sol_scsi_h
7650 $_def_hpux_scsi_h
7651 $_def_stddef
7652 $_def_have_dvd
7654 /* Common data directory (for fonts, etc) */
7655 #define MPLAYER_DATADIR "$_datadir"
7656 #define MPLAYER_CONFDIR "$_confdir"
7657 #define MPLAYER_LIBDIR "$_libdir"
7659 /* Define this to compile stream-caching support, it can be enabled via
7660 -cache <kilobytes> */
7661 #define USE_STREAM_CACHE 1
7663 /* Define to include support for XviD/Divx4Linux/OpenDivx */
7664 $_def_divx
7666 /* Define to use the new XviD/DivX4Linux library instead of open source OpenDivX */
7667 /* You have to change DECORE_LIBS in config.mak, too! */
7668 $_def_decore
7670 /* Define if you are using DivX5Linux Decore library */
7671 $_def_divx5
7673 /* Define if you are using XviD library */
7674 $_def_xvid3
7675 $_def_xvid4
7676 $_def_decore_xvid
7677 $_def_encore_xvid
7679 /* Define if you are using the X.264 library */
7680 $_def_x264
7682 /* Define to include support for libdv-0.9.5 */
7683 $_def_libdv
7685 /* If build mencoder */
7686 $_mencoder_flag
7688 /* Indicates if XviD/Divx4linux encore is available
7689 Note: for mencoder */
7690 $_def_encore
7692 /* Indicates if libmp3lame is available
7693 Note: for mencoder */
7694 $_def_mp3lame
7695 $_def_mp3lame_preset
7696 $_def_mp3lame_preset_medium
7698 /* Define libmp1e for realtime mpeg encoding (for DXR3 and DVB cards) */
7699 $_def_mp1e
7701 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7702 (use -bps or -nobps commandline option for run-time method selection)
7703 -bps gives better sync for vbr mp3 audio, it is now default */
7704 #define AVI_SYNC_BPS 1
7706 /* Undefine this if you do not want to select mono audio (left or right)
7707 with a stereo MPEG layer 2/3 audio stream. The command line option
7708 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7709 right-only), with 0 being the default.
7711 #define USE_FAKE_MONO 1
7713 /* Undefine this if your sound card driver has no working select().
7714 If you have kernel Oops, player hangups, or just no audio, you should
7715 try to recompile MPlayer with this option disabled! */
7716 $_def_select
7718 /* define this to use iconv(3) function to codepage conversions */
7719 $_def_iconv
7721 /* define this to use nl_langinfo function */
7722 $_def_langinfo
7724 /* define this to use RTC (/dev/rtc) for video timers */
7725 $_def_rtc
7727 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7728 #define MAX_OUTBURST 65536
7730 /* set up audio OUTBURST. Do not change this! */
7731 #define OUTBURST 512
7733 /* Define this if your system has the header file for the OSS sound interface */
7734 $_def_sys_soundcard
7736 /* Define this if your system has the header file for the OSS sound interface
7737 * in /usr/include */
7738 $_def_soundcard
7740 /* Define this if your system has the sysinfo header */
7741 $_def_sys_sysinfo
7743 /* Define this if your system has ftello() */
7745 $_def_ftello
7746 #ifndef HAVE_FTELLO
7747 /* Need these for FILE and off_t an config.h is usually before other includes*/
7748 #include <stdio.h>
7749 #include <sys/types.h>
7750 off_t ftello(FILE *);
7751 #endif
7753 /* Define this if your system has the "malloc.h" header file */
7754 $_def_malloc
7756 /* memalign is mapped to malloc if unsupported */
7757 $_def_memalign
7758 #ifndef HAVE_MEMALIGN
7759 # define memalign(a,b) malloc(b)
7760 #define MEMALIGN_HACK 1
7761 #endif
7763 /* Define this if your system has the "alloca.h" header file */
7764 $_def_alloca
7766 /* Define this if your system has the "sys/mman.h" header file */
7767 $_def_mman
7768 $_def_mman_has_map_failed
7770 /* Define this if you have the elf dynamic linker -ldl library */
7771 $_def_dl
7773 /* Define this if you have the kstat kernel statistics library */
7774 $_def_kstat
7776 /* Define this if you have zlib */
7777 $_def_zlib
7778 #ifdef HAVE_ZLIB
7779 #define CONFIG_ZLIB 1
7780 #endif
7782 /* Define this if you have shm support */
7783 $_def_shm
7785 /* Define this if your system has scandir & alphasort */
7786 $_def_scandir
7788 /* Define this if your system has strsep */
7789 $_def_strsep
7791 /* Define this if your system has strlcpy */
7792 $_def_strlcpy
7793 #ifndef HAVE_STRLCPY
7794 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7795 #endif
7797 /* Define this if your system has strlcat */
7798 $_def_strlcat
7799 #ifndef HAVE_STRLCAT
7800 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7801 #endif
7803 /* Define this if your system has fseeko */
7804 $_def_fseeko
7805 #ifndef HAVE_FSEEKO
7806 /* Need these for FILE and off_t an config.h is usually before other includes*/
7807 #include <stdio.h>
7808 #include <sys/types.h>
7809 int fseeko(FILE *, off_t, int);
7810 #endif
7812 $_def_localtime_r
7814 /* Define this if your system has vsscanf */
7815 $_def_vsscanf
7817 /* Define this if your system has swab */
7818 $_def_swab
7820 /* Define this if your system has no posix select */
7821 $_def_no_posix_select
7823 /* Define this if your system has gettimeofday */
7824 $_def_gettimeofday
7826 /* Define this if your system has glob */
7827 $_def_glob
7829 /* Define this if your system has setenv */
7830 $_def_setenv
7831 #ifndef HAVE_SETENV
7832 int setenv(const char *name, const char *val, int overwrite);
7833 #endif
7835 /* Define this if your system has sysi86 */
7836 $_def_sysi86
7838 /* Define this if your system has pthreads */
7839 $_def_pthreads
7841 /* Define this if you enabled thread support for libavcodec */
7842 $_def_threads
7844 /* LIRC (remote control, see www.lirc.org) support: */
7845 $_def_lirc
7848 * LIRCCD (LIRC client daemon)
7849 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7851 $_def_lircc
7853 /* DVD navigation support using libdvdnav */
7854 $_def_dvdnav
7855 $_def_dvdnav_version
7857 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7858 #define MPEG12_POSTPROC 1
7860 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7861 $_def_libpostproc
7862 $_def_libpostproc_so
7864 /* Define to include support for OpenDivx postprocessing */
7865 $_def_odivx_postprocess
7867 /* Win32 DLL support */
7868 $_def_win32
7869 #define WIN32_PATH "$_win32libdir"
7871 /* DirectShow support */
7872 $_def_dshow
7874 /* Mac OS X specific features */
7875 $_def_macosx
7876 $_def_macosx_finder_support
7877 $_def_macosx_bundle
7878 $_def_macosx_corevideo
7880 /* Build our Win32-loader */
7881 $_def_win32_loader
7883 /* ffmpeg's libavcodec support (requires libavcodec source) */
7884 $_def_libavcodec
7885 $_def_libavcodec_so
7886 $_def_lavc_dsputil
7888 /* ffmpeg's libavformat support (requires libavformat source) */
7889 $_def_libavformat
7890 $_def_libavformat_so
7891 $_def_libavformat_win32
7893 /* Use libavcodec's decoders */
7894 #define CONFIG_DECODERS 1
7895 /* Use libavcodec's encoders */
7896 #define CONFIG_ENCODERS 1
7898 /* Use libavformat's demuxers */
7899 #define CONFIG_DEMUXERS 1
7900 /* Use libavformat's muxers */
7901 #define CONFIG_MUXERS 1
7903 #define CONFIG_MPEGAUDIO_HP 1
7905 #define CONFIG_GPL 1
7907 /* Use amr codecs from libavcodec (requires amr sources) */
7908 $_def_amr
7909 $_def_amr_nb
7910 $_def_amr_nb_fixed
7911 $_def_amr_wb
7913 /* Use specific codecs from libavcodec */
7914 `echo $_libavcodecs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7915 $_def_lavc_faac
7916 $_def_lavc_xvid
7917 $_def_lavc_mp3lame
7919 /* Use codec libs included in mplayer CVS / source dist: */
7920 $_def_mp3lib
7921 $_def_liba52
7922 $_def_libdts
7923 $_def_libmpeg2
7925 /* Use libfame encoder filter */
7926 $_def_fame
7928 /* XAnim DLL support */
7929 $_def_xanim
7930 /* Default search path */
7931 $_def_xanim_path
7933 /* RealPlayer DLL support */
7934 $_def_real
7935 /* Default search path */
7936 $_def_real_path
7938 /* LIVE555 Streaming Media library support */
7939 $_def_live
7941 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
7942 $_def_fastmemcpy
7944 /* Use unrarlib for Vobsubs */
7945 $_def_unrarlib
7947 /* gui support, please do not edit this option */
7948 $_def_gui
7949 $_def_gtk2_gui
7951 /* Audio output drivers */
7952 $_def_ossaudio
7953 $_def_ossaudio_devdsp
7954 $_def_ossaudio_devmixer
7955 $_def_alsa5
7956 $_def_alsa9
7957 $_def_alsa1x
7958 $_def_arts
7959 $_def_esd
7960 $_def_esd_latency
7961 $_def_polyp
7962 $_def_jack
7963 $_def_openal
7964 $_def_sys_asoundlib_h
7965 $_def_alsa_asoundlib_h
7966 $_def_sunaudio
7967 $_def_sgiaudio
7968 $_def_win32waveout
7969 $_def_nas
7971 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7972 #undef FAST_OSD
7973 #undef FAST_OSD_TABLE
7975 /* Enable TV Interface support */
7976 $_def_tv
7978 /* Enable Video 4 Linux TV interface support */
7979 $_def_tv_v4l
7981 /* Enable Video 4 Linux 2 TV interface support */
7982 $_def_tv_v4l2
7984 /* Enable *BSD BrookTree TV interface support */
7985 $_def_tv_bsdbt848
7987 /* Define if your processor stores words with the most significant
7988 byte first (like Motorola and SPARC, unlike Intel and VAX). */
7989 $_def_words_endian
7991 $_def_arch
7993 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
7994 have the instruction. */
7995 $_def_dcbzl
7997 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
7998 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
8000 #ifdef ARCH_POWERPC
8001 #define ARCH_PPC 1
8002 #endif
8004 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
8005 #ifdef ARCH_ARMV4L
8006 #define ARCH_ARM 1
8007 #endif
8009 /* only gcc3 can compile mvi instructions */
8010 $_def_gcc_mvi_support
8012 /* Define this for Cygwin build for win32 */
8013 $_def_confwin32
8015 /* Define this to any prefered value from 386 up to infinity with step 100 */
8016 #define __CPU__ $iproc
8018 $_mp_wordsize
8020 $_def_linux
8022 $_def_vcd
8024 #ifdef sun
8025 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8026 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8027 #elif defined(HPUX)
8028 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8029 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8030 #elif defined(WIN32)
8031 #define DEFAULT_CDROM_DEVICE "D:"
8032 #define DEFAULT_DVD_DEVICE "D:"
8033 #elif defined(SYS_DARWIN)
8034 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
8035 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
8036 #elif defined(__OpenBSD__)
8037 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
8038 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8039 #elif defined(__FreeBSD__)
8040 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
8041 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
8042 #else
8043 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8044 #define DEFAULT_DVD_DEVICE "/dev/dvd"
8045 #endif
8048 /*----------------------------------------------------------------------------
8050 ** NOTE: Instead of modifying these definitions here, use the
8051 ** --enable/--disable options of the ./configure script!
8052 ** See ./configure --help for details.
8054 *---------------------------------------------------------------------------*/
8056 /* C99 lrintf function available */
8057 $_def_lrintf
8059 /* round function is available */
8060 $_def_round
8062 /* yes, we have inttypes.h */
8063 #define HAVE_INTTYPES_H 1
8065 /* int_fastXY_t emulation */
8066 $_def_fast_inttypes
8068 /* nanosleep support */
8069 $_def_nanosleep
8071 /* SMB support */
8072 $_def_smbsupport
8074 /* termcap flag for getch2.c */
8075 $_def_termcap
8077 /* termios flag for getch2.c */
8078 $_def_termios
8079 $_def_termios_h
8080 $_def_termios_sys_h
8082 /* enable PNG support */
8083 $_def_png
8085 /* enable JPEG support */
8086 $_def_jpg
8088 /* enable PNM support */
8089 $_def_pnm
8091 /* enable md5sum support */
8092 $_def_md5sum
8094 /* enable GIF support */
8095 $_def_gif
8096 $_def_gif_4
8097 $_def_gif_tvt_hack
8099 /* enable FreeType support */
8100 $_def_freetype
8102 /* enable Fontconfig support */
8103 $_def_fontconfig
8105 /* enable FriBiDi usage */
8106 $_def_fribidi
8108 /* enable ENCA usage */
8109 $_def_enca
8111 /* liblzo support */
8112 $_def_liblzo
8113 #ifdef USE_LIBLZO
8114 #define CONFIG_LZO 1
8115 #endif
8117 /* libmad support */
8118 $_def_mad
8120 /* enable OggVorbis support */
8121 $_def_vorbis
8123 /* enable Tremor as vorbis decoder */
8124 $_def_tremor
8126 /* enable Speex support */
8127 $_def_speex
8129 /* enable musepack support */
8130 $_def_musepack
8132 /* enable OggTheora support */
8133 $_def_theora
8135 /* enable FAAD (AAC) support */
8136 $_def_faad
8137 $_def_faad_internal
8139 /* enable FAAC (AAC encoder) support */
8140 $_def_faac
8142 /* enable LADSPA plugin support */
8143 $_def_ladspa
8145 /* enable network */
8146 $_def_network
8148 /* enable ftp support */
8149 $_def_ftp
8151 /* enable vstream support */
8152 $_def_vstream
8154 /* enable winsock2 instead of Unix functions*/
8155 $_def_winsock2
8157 /* define this to use inet_aton() instead of inet_pton() */
8158 $_def_use_aton
8160 /* enables / disables cdparanoia support */
8161 $_def_cdparanoia
8163 /* enables / disables VIDIX usage */
8164 $_def_vidix
8165 $_def_vidix_pfx
8167 /* enables / disables new input joystick support */
8168 $_def_joystick
8170 /* enables / disables QTX codecs */
8171 $_def_qtx
8173 /* enables / disables osd menu */
8174 $_def_menu
8176 /* enables / disables subtitles sorting */
8177 $_def_sortsub
8179 /* XMMS input plugin support */
8180 $_def_xmms
8181 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8183 /* enables inet6 support */
8184 $_def_inet6
8186 /* do we have gethostbyname2? */
8187 $_def_gethostbyname2
8189 /* Extension defines */
8190 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
8191 $_def_3dnowext // only define if you have 3DNOWEXT (AMD Athlon, etc.)
8192 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
8193 $_def_mmxext // only define if you have MMX2 (Athlon/PIII/4/CelII)
8194 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
8195 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
8196 $_def_altivec // only define if you have Altivec (G4)
8198 $_def_altivec_h // enables usage of altivec.h
8200 $_def_builtin_vector // enables usage of xmmintrin.h
8201 $_def_mm3dnow // enables usage of mm3dnow.h
8203 $_def_mlib // Sun mediaLib, available only on solaris
8204 $_def_vis // only define if you have VIS ( ultrasparc )
8206 /* libmpeg2 uses a different feature test macro for mediaLib */
8207 #ifdef HAVE_MLIB
8208 #define LIBMPEG2_MLIB 1
8209 #endif
8211 /* libvo options */
8212 #define SCREEN_SIZE_X 1
8213 #define SCREEN_SIZE_Y 1
8214 $_def_x11
8215 $_def_xv
8216 $_def_xvmc
8217 $_def_vm
8218 $_def_xf86keysym
8219 $_def_xinerama
8220 $_def_gl
8221 $_def_gl_win32
8222 $_def_dga
8223 $_def_dga2
8224 $_def_sdl
8225 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8226 $_def_sdlbuggy
8227 $_def_directx
8228 $_def_ggi
8229 $_def_ggiwmh
8230 $_def_3dfx
8231 $_def_s3fb
8232 $_def_tdfxfb
8233 $_def_tdfxvid
8234 $_def_directfb
8235 $_def_directfb_version
8236 $_def_zr
8237 $_def_bl
8238 $_def_mga
8239 $_def_xmga
8240 $_def_syncfb
8241 $_def_fbdev
8242 $_def_dxr2
8243 $_def_dxr3
8244 $_def_dvb
8245 $_def_dvb_in
8246 $_def_svga
8247 $_def_vesa
8248 $_def_xdpms
8249 $_def_aa
8250 $_def_caca
8251 $_def_tga
8252 $_def_toolame
8253 $_def_twolame
8255 /* used by GUI: */
8256 $_def_xshape
8258 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8259 #define X11_FULLSCREEN 1
8260 #endif
8262 #endif /* MPLAYER_CONFIG_H */
8265 #############################################################################
8267 echo "Creating libvo/config.mak"
8268 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g;s/\.m/\.o/g'`
8269 cat > libvo/config.mak << EOF
8270 include ../config.mak
8271 OPTIONAL_SRCS = $_vosrc
8272 OPTIONAL_OBJS = $_voobj
8275 #############################################################################
8277 echo "Creating libao2/config.mak"
8278 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'`
8279 cat > libao2/config.mak << EOF
8280 include ../config.mak
8281 OPTIONAL_SRCS = $_aosrc
8282 OPTIONAL_OBJS = $_aoobj
8285 #############################################################################
8287 echo "Creating libaf/config.mak"
8288 _afobj=`echo $_afsrc | sed -e 's/\.c/\.o/g'`
8289 cat > libaf/config.mak << EOF
8290 include ../config.mak
8291 OPTIONAL_SRCS = $_afsrc
8292 OPTIONAL_OBJS = $_afobj
8295 #############################################################################
8297 cat << EOF
8299 Config files successfully generated by ./configure !
8301 Install prefix: $_prefix
8302 Data directory: $_datadir
8303 Config direct.: $_confdir
8305 Byte order: $_byte_order
8306 Optimizing for: $_optimizing
8308 Languages:
8309 Messages/GUI: $_language
8312 echo -n " Manual pages: $MAN_LANG"
8313 test "$LANGUAGES" = en && echo -n " (no localization selected, use --language=all)"
8314 echo
8316 cat << EOF
8318 Enabled optional drivers:
8319 Input: $_inputmodules
8320 Codecs: $_codecmodules
8321 Audio output: $_aomodules
8322 Video output: $_vomodules
8323 Audio filters: $_afmodules
8324 Disabled optional drivers:
8325 Input: $_noinputmodules
8326 Codecs: $_nocodecmodules
8327 Audio output: $_noaomodules
8328 Video output: $_novomodules
8329 Audio filters: $_noafmodules
8331 'config.h' and 'config.mak' contain your configuration options.
8332 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8333 compile *** DO NOT REPORT BUGS if you tweak these files ***
8335 'make' will now compile MPlayer and 'make install' will install it.
8336 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8341 if test "$_mtrr" = yes ; then
8342 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
8343 echo
8346 if test "$_sdl" = "outdated" ; then
8347 cat <<EOF
8348 You have an outdated version of libSDL installed (older than v1.1.7) and SDL
8349 support has therefore been disabled.
8351 Please upgrade to a more recent version (version 1.1.8 and above are known to
8352 work). You may get this library from: http://www.libsdl.org
8354 You need to rerun ./configure and recompile after updating SDL. If you are
8355 only interested in the libSDL audio drivers, then an older version might work.
8357 Use --enable-sdl to force usage of libSDL.
8362 if x86; then
8363 if test "$_win32" = no ; then
8364 if test "$_win32libdir" ; then
8365 echo "Failed to find a Win32 codecs dir at $_win32libdir!"
8366 else
8367 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
8369 cat << EOF
8370 Create it and copy the DLL files there! You can download the codecs from our
8371 homepage at http://www.mplayerhq.hu/MPlayer/releases/codecs/
8375 else
8376 cat <<EOF
8377 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8378 operating system ($system_name). You may encounter a few files that cannot
8379 be played due to missing open source video/audio codec support.
8385 cat <<EOF
8387 Check $TMPLOG if you wonder why an autodetection failed (check whether
8388 the development headers/packages are installed).
8389 Do not report compilation errors if you used any of the --enable-* options
8390 (except --enable-gui and maybe --enable-debug).
8392 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
8396 if test "$_vidix" = no ; then
8397 cat <<EOF
8398 You've disabled VIDIX. Although it would be better to PORT it instead.
8399 Have a look at the documentation for supported cards!
8404 if test "$_warn_CFLAGS" = yes; then
8405 cat <<EOF
8407 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you, but:
8409 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8411 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8412 To do so, execute 'CFLAGS= ./configure <options>'
8417 # Last move:
8418 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"