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
28 # #include <feature.h>
29 # int main(void) { return 0; }
32 # cc_check && _feature=yes
33 # if test "$_feature" = yes ; then
34 # _def_feature='#define HAVE_FEATURE 1'
36 # _def_feature='#undef HAVE_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
58 # Prefer these macros to full length text !
59 # These macros only return an error code - NO display is done
64 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o $TMPO $@" >> "$TMPLOG"
66 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o "$TMPO" "$@" >> "$TMPLOG" 2>&1
69 echo "ldd $TMPO" >> "$TMPLOG"
70 $_ldd "$TMPO" >> "$TMPLOG" 2>&1
76 compile_check
$TMPC $@
80 compile_check
$TMPCPP $@
-lstdc++
84 "$TMPO" >> "$TMPLOG" 2>&1
87 # Display error message, flushes tempfile, exit
92 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
93 echo "Check \"$TMPLOG\" if you do not understand why it failed."
97 # OS test booleans functions
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
124 i
[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium
*|athlon
*|i586-i686
) return 0 ;;
131 x86_64|amd64
) return 0 ;;
150 # not boolean test: implement the posix shell "!" operator for a
152 # usage: not {command}
153 # returns exit status "success" when the execution of "command"
160 # Use this before starting a check
162 echo "============ Checking for $@ ============" >> "$TMPLOG"
163 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
166 # Use this to echo the results of a check
168 if test "$_res_comment" ; then
169 _res_comment
="($_res_comment)"
171 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
172 echo "##########################################" >> "$TMPLOG"
174 echo "$@ $_res_comment"
177 #############################################################################
179 # Check how echo works in this /bin/sh
181 -n) _echo_n
= _echo_c
='\c' ;; # SysV echo
182 *) _echo_n
='-n ' _echo_c
= ;; # BSD echo
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
191 Usage: $0 [OPTIONS]...
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
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
205 --libdir=DIR use this prefix for object code libraries [PREFIX/lib]
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
248 --disable-ftp Disable ftp support [enabled]
249 --disable-vstream Disable tivo vstream client support [autodetect]
250 --disable-pthreads Disable Posix threads support [autodetect]
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
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]
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
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.
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.
444 done # for parm in ...
447 # 1st pass checking for vital options
458 test "$CC" && _cc
="$CC"
460 _runtime_cpudetection
=no
465 _target
=`echo $ac_option | cut -d '=' -f 2`
468 _cc
=`echo $ac_option | cut -d '=' -f 2`
471 _host_cc
=`echo $ac_option | cut -d '=' -f 2`
474 _as
=`echo $ac_option | cut -d '=' -f 2`
476 --enable-gcc-checking)
479 --disable-gcc-checking)
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)
506 --disable-cross-compile)
510 _install
=`echo $ac_option | cut -d '=' -f 2 | sed 's/\/$//'`"/install"
513 _install
=`echo $ac_option | cut -d '=' -f 2 `
525 _debug
=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
533 # Determine our OS name and CPU architecture
534 if test -z "$_target" ; then
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
)
546 [cC
][yY
][gG
][wW
][iI
][nN
]*)
553 system_name
="$system_name-UNKNOWN"
558 # host's CPU/instruction set
559 host_arch
=`uname -p 2>&1`
561 i386|sparc|ppc|alpha|arm|mips|vax
)
563 powerpc
) # Darwin returns 'powerpc'
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
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
;;
577 if [ -n "`$_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p'`" -a \
578 -z "`echo $CFLAGS | grep -- -m32`" ]; then
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
;;
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
;;
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
623 TMPLOG
="configure.log"
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"
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.
640 _ld_extra
="$_ld_extra -L/usr/local/lib"
641 _inc_extra
="$_inc_extra -I/usr/local/include"
645 for I
in `echo $_ld_extra | sed 's/-L//g'` ; do
646 tmp
="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
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
665 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
666 _head
() { head -$1 2>/dev
/null
; }
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
; }
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"
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
689 cc_version
="v. ?.??, bad"
693 cc_version
="$cc_version, ok"
697 cc_version
="$cc_version, bad"
701 echores
"$cc_version"
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"
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"
713 cc_version
="v. ?.??, bad"
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"
727 cc_version
="$cc_version, bad"
731 echores
"$cc_version"
732 test "$cc_verc_fail" = "no" && break
735 if test "$cc_verc_fail" = yes ; then
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
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"
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 ******************************************************************************
783 test "$_host_cc" || _host_cc
=$_cc
786 echocheck
"cross compilation"
787 if test $_cross_compile = auto
; then
789 int main() { return 0; }
792 cc_check
&& "$TMPO" && _cross_compile
=no
794 echores
$_cross_compile
796 if test $_cross_compile = yes; then
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..
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
826 # use 'lsattr' on AIX
827 _cpuinfo
="lsattr -E -l proc0 -a type"
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
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)"
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"
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
877 elif test "$pmodel" -ge 8; then
879 elif test "$pmodel" -ge 6; then
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.
893 # Again, gcc treats athlon and athlon-tbird similarly.
898 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
899 # caught and remedied in the optimization tests below.
903 *) proc
=k8 iproc
=686 ;;
908 3) proc
=i386 iproc
=386 ;;
909 4) proc
=i486 iproc
=486 ;;
911 if test "$pmodel" -eq 4 ||
test "$pmodel" -eq 8; then
912 proc
=pentium-mmx
# 4 is desktop, 8 is mobile
918 if test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
920 elif test "$pmodel" -ge 7; then
922 elif test "$pmodel" -ge 3; then
929 # A nocona in 32-bit mode has no more capabilities than a prescott.
930 if test "$pmodel" -ge 3; then
936 *) proc
=prescott iproc
=686 ;;
942 if test "$pmodel" -ge 8; then
944 elif test "$pmodel" -ge 4; then
951 if test "$pmodel" -ge 9; then
958 *) proc
=i686 iproc
=i686
;;
963 3) proc
=i386 iproc
=386 ;;
964 4) proc
=i486 iproc
=486 ;;
965 *) proc
=i586 iproc
=586 ;;
969 proc
=i586 iproc
=586 ;;
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
984 echocheck
"GCC & CPU optimization abilities"
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
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."
1027 elif test "$proc" = "i586-i686"; then
1028 _march
="-march=i586"
1029 _mcpu
="$cpuopt=i686"
1032 _march
="-march=$proc"
1033 _mcpu
="$cpuopt=$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"
1053 _march
="-march=$host_arch"
1054 _mcpu
="$cpuopt=$host_arch"
1062 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx
) iproc
=586 ;;
1063 i686|athlon
*|pentium
*) iproc
=686 ;;
1072 _def_arch
='#define ARCH_IA64 1'
1073 _target_arch
='TARGET_ARCH_IA64 = yes'
1082 _def_arch
='#define ARCH_X86_64 1'
1083 _target_arch
='TARGET_ARCH_X86_64 = yes'
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
1096 # 64-bit prescotts exist, but as far as GCC is concerned they have the
1097 # same capabilities as a nocona.
1103 echocheck
"GCC & CPU optimization abilities"
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."
1145 _def_arch
='#define ARCH_SPARC 1'
1146 _target_arch
='TARGET_ARCH_SPARC = yes'
1149 echocheck
"CPU type"
1151 case "`echo $karch`" in
1156 sun4u
) proc
=v9 _vis
='yes' _def_vis
='#define HAVE_VIS = yes' ;;
1170 _def_arch
='#define ARCH_SPARC 1'
1171 _target_arch
='TARGET_ARCH_SPARC = yes'
1173 _def_vis
='#define HAVE_VIS = yes'
1181 arm|armv4l|armv5tel
)
1182 _def_arch
='#define ARCH_ARMV4L 1'
1183 _target_arch
='TARGET_ARCH_ARMV4L = yes'
1192 _def_arch
='#define ARCH_POWERPC 1'
1193 _def_dcbzl
='#define NO_DCBZL 1'
1194 _target_arch
='TARGET_ARCH_POWERPC = yes'
1202 echocheck
"CPU type"
1203 case $system_name in
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
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
1218 # only gcc 3.4 works reliably with AltiVec code under NetBSD
1220 2*|
3.0*|
3.1*|
3.2*|
3.3*)
1223 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1230 proc
=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'`
1233 if test "$_altivec" = yes; then
1234 echores
"$proc altivec"
1239 echocheck
"GCC & CPU optimization abilities"
1241 if test -n "$proc"; then
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' ;;
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
1257 7400*|
7410*) _march
='-mcpu=7400' _mcpu
='-mtune=7400' ;;
1258 7447*|
7450*|
7455*) _march
='-mcpu=7450' _mcpu
='-mtune=7450' ;;
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
1265 970*) _march
='-mcpu=970' _mcpu
='-mtune=970'
1266 _def_dcbzl
='#undef NO_DCBZL' ;;
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
1273 POWER4
) _march
='-mcpu=power4' _mcpu
='-mtune=power4' ;;
1277 # gcc 4.0 and up supports POWER5
1278 if test "$_cc_major" -ge "4"; then
1280 POWER5
) _march
='-mcpu=power5' _mcpu
='-mtune=power5' ;;
1286 if test -n "$_mcpu"; then
1287 _optimizing
=`echo $_mcpu | cut -c 8-`
1288 echores
"$_optimizing"
1296 _def_arch
='#define ARCH_ALPHA 1'
1297 _target_arch
='TARGET_ARCH_ALPHA = yes'
1301 echocheck
"CPU type"
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);
1311 $_cc -o "$TMPO" "$TMPC"
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";;
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
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"
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)"
1347 _def_arch
='#define ARCH_SGI_MIPS 1'
1348 _target_arch
='TARGET_ARCH_SGI_MIPS = yes'
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' ;;
1372 _def_arch
='#define ARCH_PA_RISC 1'
1373 _target_arch
='TARGET_ARCH_PA_RISC = yes'
1382 _def_arch
='#define ARCH_S390 1'
1383 _target_arch
='TARGET_ARCH_S390 = yes'
1392 _def_arch
='#define ARCH_S390X 1'
1393 _target_arch
='TARGET_ARCH_S390X = yes'
1402 _def_arch
='#define ARCH_VAX 1'
1403 _target_arch
='TARGET_ARCH_VAX = yes'
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
1433 if x86
&& test "$_runtime_cpudetection" = no
; then
1435 if test "$1" = yes ; then
1436 echocheck
"kernel support of $2"
1439 void catch() { exit(1); }
1441 signal(SIGILL, catch);
1442 __asm__ __volatile__ ("$3":::"memory");return(0);
1446 if cc_check
&& tmp_run
; then
1448 _optimizing
="$_optimizing $2"
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!"
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"
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
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"
1490 #include <xmmintrin.h>
1491 int main() { _mm_sfence(); return 0; }
1494 cc_check
-msse && _builtin_vector
=yes
1495 if test "$_builtin_vector" = yes ; then
1496 _def_builtin_vector
='#define HAVE_BUILTIN_VECTOR 1'
1498 _def_builtin_vector
='#undef HAVE_BUILTIN_VECTOR'
1500 echores
"$_builtin_vector"
1503 if test "$_3dnow" = yes ; then
1504 echocheck
"mm3dnow.h"
1506 #include <mm3dnow.h>
1507 int main() { _m_femms(); return 0; }
1510 cc_check
-m3dnow && _mm3dnow
=yes
1511 if test "$_mm3dnow" = yes ; then
1512 _def_mm3dnow
='#define HAVE_MM3DNOW 1'
1514 _def_mm3dnow
='#undef HAVE_MM3DNOW'
1520 echocheck
"assembler support of -pipe option"
1522 int main(void) { return 0; }
1524 cc_check
-pipe && _pipe
="-pipe" && echores
"yes" || echores
"no"
1526 # Checking for CFLAGS
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/'`
1534 elif test -z "$CFLAGS" ; then
1535 CFLAGS
="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
1539 if test -n "$LDFLAGS" ; then
1540 _ld_extra
="$_ld_extra $LDFLAGS"
1543 if test -n "$CPPFLAGS" ; then
1544 _inc_extra
="$_inc_extra $CPPFLAGS"
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
1559 _libavcodecs
=`grep 'register_avcodec(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1562 _libavformat_so
=auto
1564 _libpostproc_so
=auto
1569 _dga
=auto
# 1 2 no auto
1571 _xvmc
=no
#auto when complete
1607 _tremor_internal
=yes
1623 # dvdnav disabled, it does not work
1635 _mlib
=no
#broken, thus disabled
1651 _vidix_internal
=auto
1652 _vidix_external
=auto
1688 _macosx_finder_support
=no
1691 _freetypeconfig
='freetype-config'
1693 _fribidiconfig
='fribidi-config'
1696 _gethostbyname2
=auto
1702 case "$ac_option" in
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) ;;
1723 --enable-debug=*) ;;
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
;;
2017 _charset
=`echo $ac_option | cut -d '=' -f 2`
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`
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`
2037 --with-xanimlibdir=*)
2038 _xanimlibdir
=`echo $ac_option | cut -d '=' -f 2`
2041 --with-reallibdir=*)
2042 _reallibdir
=`echo $ac_option | cut -d '=' -f 2`
2045 --with-livelibdir=*)
2046 _livelibdir
=`echo $ac_option | cut -d '=' -f 2`
2048 --with-toolamedir=*)
2049 _toolamedir
=`echo $ac_option | cut -d '=' -f 2`
2052 _mlibdir
=`echo $ac_option | cut -d '=' -f 2`
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)
2067 --disable-crash-debug)
2070 --enable-sighandler)
2073 --disable-sighandler)
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
;;
2099 _inc_x11
=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
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'`
2108 _xvmclib
=`echo $ac_option | cut -d '=' -f 2`
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'`
2120 _ld_libdts
=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
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`
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`
2164 _prefix
=`echo $ac_option | cut -d '=' -f 2`
2167 _bindir
=`echo $ac_option | cut -d '=' -f 2`
2170 _datadir
=`echo $ac_option | cut -d '=' -f 2`
2173 _mandir
=`echo $ac_option | cut -d '=' -f 2`
2176 _confdir
=`echo $ac_option | cut -d '=' -f 2`
2179 _libdir
=`echo $ac_option | cut -d '=' -f 2`
2183 echo "Unknown parameter: $ac_option"
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"
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'
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
2234 _res_comment
="Upgrade binutils to ${_pref_as_version} ..."
2236 die
"obsolete binutils version"
2240 #FIXME: This should happen before the check for CFLAGS..
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"
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'
2271 FSF
) _altivec_gcc_flags
="$FSF_flags" _altivec
=yes ;;
2272 Darwin
) _altivec_gcc_flags
="$Darwin_flags" _altivec
=yes ;;
2276 if test -z "$p"; then
2279 p
="$p-style ($_altivec_gcc_flags)"
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"
2292 #include <altivec.h>
2293 int main(void) { return 0; }
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'
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
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;;
2357 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
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)
2369 echores
"$kernel_version, ok"
2373 if test "$_vidix_internal" = auto
; then
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"
2389 _prg_mencoder
="mencoder.exe"
2392 _prg_mencoder
="mencoder"
2397 # On QNX we must link to libph - Gabucino
2399 _ld_arch
="$_ld_arch -lph"
2402 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2404 if test "$_vidix_internal" = yes ; then
2407 for _awk
in mawk gawk nawk
awk; do
2408 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2413 test "$_awk_verc_fail" = yes && _awk
=no
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."
2424 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2431 ######################
2432 # MAIN TESTS GO HERE #
2433 ######################
2436 echocheck
"extra headers"
2437 if test "$_inc_extra" ; then
2438 echores
"$_inc_extra"
2444 echocheck
"extra libs"
2445 if test "$_ld_extra" ; then
2446 echores
"$_ld_extra"
2453 int main(void) { return 0; }
2455 if cc_check
-lposix ; then
2456 _ld_arch
="$_ld_arch -lposix"
2464 int main(void) { return 0; }
2466 if cc_check
-lm ; then
2475 echocheck
"langinfo"
2476 if test "$_langinfo" = auto
; then
2478 #include <langinfo.h>
2479 int main(void) { nl_langinfo(CODESET); return 0; }
2482 cc_check
&& _langinfo
=yes
2484 if test "$_langinfo" = yes ; then
2485 _def_langinfo
='#define USE_LANGINFO 1'
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
2502 echo -n "$lang not found, "
2503 _language
=`echo $_language | sed "s/$lang *//"`
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"
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'
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'
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
2541 _def_restrict_keyword
=$restrict_keyword
2545 if [ -n "$_def_restrict_keyword" ]; then
2546 echores
"$_def_restrict_keyword"
2550 # Avoid infinite recursion loop ("#define restrict restrict")
2551 if [ "$_def_restrict_keyword" != "restrict" ]; then
2552 _def_restrict_keyword
="#define restrict $_def_restrict_keyword"
2554 _def_restrict_keyword
=""
2558 echocheck
"__builtin_expect"
2559 # GCC branch prediction hint
2562 a = __builtin_expect (a, 10);
2563 return a == 10 ? 0 : 1;
2565 int main() { return foo(10) && foo(0); }
2568 cc_check
&& _builtin_expect
=yes
2569 if test "$_builtin_expect" = yes ; then
2570 _def_builtin_expect
='#define HAVE_BUILTIN_EXPECT 1'
2572 _def_builtin_expect
='#undef HAVE_BUILTIN_EXPECT'
2574 echores
"$_builtin_expect"
2580 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
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"
2588 _def_kstat
="#undef HAVE_LIBKSTAT"
2594 # required for nanosleep on some systems
2597 int main(void) { (void) nanosleep(0, 0); return 0; }
2600 cc_check
-lposix4 && _posix4
=yes
2601 if test "$_posix4" = yes ; then
2602 _ld_arch
="-lposix4 $_ld_arch"
2609 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2612 cc_check
-D_GNU_SOURCE $_ld_lm && _lrintf
=yes
2613 if test "$_lrintf" = yes ; then
2614 _def_lrintf
="#define HAVE_LRINTF 1"
2616 _def_lrintf
="#undef HAVE_LRINTF"
2623 int main(void) { (void) round(0.0); return 0; }
2626 cc_check
$_ld_lm && _round
=yes
2627 if test "$_round" = yes ; then
2628 _def_round
="#define HAVE_ROUND 1"
2630 _def_round
="#undef HAVE_ROUND"
2634 echocheck
"nanosleep"
2635 # also check for nanosleep
2638 int main(void) { (void) nanosleep(0, 0); return 0; }
2641 cc_check
$_ld_arch && _nanosleep
=yes
2642 if test "$_nanosleep" = yes ; then
2643 _def_nanosleep
='#define HAVE_NANOSLEEP 1'
2645 _def_nanosleep
='#undef HAVE_NANOSLEEP'
2647 echores
"$_nanosleep"
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):
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
2661 if test $_winsock2 = auto
&& not cygwin
; then
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"
2677 if test $_winsock2 = yes ; then
2679 _def_winsock2
='#define HAVE_WINSOCK2 1'
2681 _def_winsock2
='#undef HAVE_WINSOCK2'
2686 echocheck
"inet_pton()"
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"
2696 elif cc_check
$_ld_sock ; then
2697 # NOTE: Linux has libresolv but does not need it
2699 _res_comment
="using $_ld_sock"
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"
2707 _res_comment
="trying inet_aton next"
2710 echocheck
"inet_aton()"
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; }
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"
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)"
2742 #include <inttypes.h>
2743 int main(void) { return 0; }
2746 cc_check
&& _inttypes
=yes
2747 echores
"$_inttypes"
2749 if test "$_inttypes" = no
; then
2750 echocheck
"bitypes.h (inttypes.h predecessor)"
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."
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"
2766 #include <inttypes.h>
2768 volatile int_fast16_t v= 0;
2772 cc_check
&& _fast_inttypes
=yes
2773 if test "$_fast_inttypes" = yes ; then
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"
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"
2802 int main(void) { return 0; }
2805 cc_check
&& _stddef
=yes
2806 if test "$_stddef" = yes ; then
2807 _def_stddef
='#define HAVE_STDDEF_H 1'
2809 _def_stddef
='#undef HAVE_STDDEF_H'
2814 echocheck
"malloc.h"
2817 int main(void) { (void) malloc(0); return 0; }
2820 cc_check
&& _malloc
=yes
2821 if test "$_malloc" = yes ; then
2822 _def_malloc
='#define HAVE_MALLOC_H 1'
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'
2831 echocheck
"memalign()"
2832 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2835 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2838 cc_check
&& _memalign
=yes
2839 if test "$_memalign" = yes ; then
2840 _def_memalign
='#define HAVE_MEMALIGN 1'
2842 _def_memalign
='#undef HAVE_MEMALIGN'
2844 echores
"$_memalign"
2847 echocheck
"alloca.h"
2850 int main(void) { (void) alloca(0); return 0; }
2853 cc_check
&& _alloca
=yes
2855 _def_alloca
='#define HAVE_ALLOCA_H 1'
2857 _def_alloca
='#undef HAVE_ALLOCA_H'
2864 #include <sys/types.h>
2865 #include <sys/mman.h>
2866 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2869 cc_check
&& _mman
=yes
2870 if test "$_mman" = yes ; then
2871 _def_mman
='#define HAVE_SYS_MMAN_H 1'
2873 _def_mman
='#undef HAVE_SYS_MMAN_H'
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
=''
2887 _def_mman_has_map_failed
='#define MAP_FAILED ((void *) -1)'
2890 echocheck
"dynamic loader"
2893 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2896 for _ld_tmp
in "" "-ldl" ; do
2897 cc_check
$_ld_tmp && _ld_dl
="$_ld_tmp" && _dl
=yes && break
2899 if test "$_dl" = yes ; then
2900 _def_dl
='#define HAVE_LIBDL 1'
2902 _def_dl
='#undef HAVE_LIBDL'
2907 echocheck
"dynamic a/v plugins support"
2908 if test "$_dl" = no
; then
2911 if test "$_dynamic_plugins" = yes ; then
2912 _def_dynamic_plugins
='#define DYNAMIC_PLUGINS 1'
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)
2923 #int main(void) { return 0; }
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
2932 #echores "using $_ld_dl_dynamic"
2934 _def_threads
='#undef HAVE_THREADS'
2937 if test "$_pthreads" != no
; then
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; }
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
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'
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
2963 echores
"$_pthreads"
2967 if test "$_iconv" = auto
; then
2968 _iconv_tmp
='#include <iconv.h>'
2974 #define INBUFSIZE 1024
2975 #define OUTBUFSIZE 4096
2977 char inbuffer[INBUFSIZE];
2978 char outbuffer[OUTBUFSIZE];
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)
2993 write (1, outbuffer, OUTBUFSIZE - outleft);
2996 if (iconv_close(icdsc) == -1)
3002 for _ld_tmp
in "" "-liconv" "-liconv $_ld_dl" ; do
3003 cc_check
$_ld_lm $_ld_tmp && _ld_iconv
="$_ld_tmp" && _iconv
=yes && break
3006 if test "$_iconv" = yes ; then
3007 _def_iconv
='#define USE_ICONV 1'
3009 _def_iconv
='#undef USE_ICONV'
3014 echocheck
"sys/soundcard.h"
3016 #include <sys/soundcard.h>
3017 int main(void) { return 0; }
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>'
3025 _def_sys_soundcard
='#undef HAVE_SYS_SOUNDCARD_H'
3027 echores
"$_sys_soundcard"
3029 if test "$_sys_soundcard" != yes ; then
3030 echocheck
"soundcard.h"
3032 #include <soundcard.h>
3033 int main(void) { return 0; }
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"
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"
3046 if test "$_soundcard" = yes ; then
3047 _def_soundcard
='#define HAVE_SOUNDCARD_H 1'
3048 _inc_soundcard
='#include <soundcard.h>'
3050 _def_soundcard
='#undef HAVE_SOUNDCARD_H'
3053 _def_soundcard
='#undef HAVE_SOUNDCARD_H'
3057 echocheck
"sys/dvdio.h"
3060 #include <sys/dvdio.h>
3061 int main(void) { return 0; }
3064 cc_check
&& _dvdio
=yes
3065 if test "$_dvdio" = yes ; then
3066 _def_dvdio
='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3068 _def_dvdio
='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3073 echocheck
"sys/cdio.h"
3076 #include <sys/cdio.h>
3077 int main(void) { return 0; }
3080 cc_check
&& _cdio
=yes
3081 if test "$_cdio" = yes ; then
3082 _def_cdio
='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3084 _def_cdio
='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3089 echocheck
"linux/cdrom.h"
3091 #include <sys/types.h>
3092 #include <linux/cdrom.h>
3093 int main(void) { return 0; }
3096 cc_check
&& _cdrom
=yes
3097 if test "$_cdrom" = yes ; then
3098 _def_cdrom
='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3100 _def_cdrom
='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3108 int main(void) { return 0; }
3111 cc_check
&& _dvd
=yes
3112 if test "$_dvd" = yes ; then
3113 _def_dvd
='#define DVD_STRUCT_IN_DVD_H 1'
3115 _def_dvd
='#undef DVD_STRUCT_IN_DVD_H'
3120 echocheck
"BSDI dvd.h"
3123 int main(void) { return 0; }
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'
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"
3138 #include <sys/scsi.h>
3139 int main(void) { return 0; }
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'
3146 _def_hpux_scsi_h
='#undef HPUX_SCTL_IO'
3148 echores
"$_hpux_scsi_h"
3151 echocheck
"userspace SCSI headers (Solaris)"
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; }
3160 cc_check
&& _sol_scsi_h
=yes
3161 if test "$_sol_scsi_h" = yes ; then
3162 _def_sol_scsi_h
='#define SOLARIS_USCSI 1'
3164 _def_sol_scsi_h
='#undef SOLARIS_USCSI'
3166 echores
"$_sol_scsi_h"
3170 if test "$_termcap" = auto
; then
3172 int main(void) { tgetent(); return 0; }
3175 for _ld_tmp
in "-lncurses" "-ltinfo" "-ltermcap"; do
3176 cc_check
$_ld_tmp && _ld_termcap
="$_ld_tmp" && _termcap
=yes && break
3179 if test "$_termcap" = yes ; then
3180 _def_termcap
='#define USE_TERMCAP 1'
3181 _res_comment
="using $_ld_termcap"
3183 _def_termcap
='#undef USE_TERMCAP'
3189 if test "$_termios" = auto
; then
3191 #include <sys/termios.h>
3192 int main(void) { return 0; }
3195 cc_check
&& _termios
=yes
3196 _def_termios_h_name
='sys/termios.h'
3199 if test "$_termios" = auto
; then
3201 #include <termios.h>
3202 int main(void) { return 0; }
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"
3221 _def_termios
='#undef HAVE_TERMIOS'
3222 _def_termios_h_name
=''
3229 if test "$_shm" = auto
; then
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; }
3236 cc_check
&& _shm
=yes
3238 if test "$_shm" = yes ; then
3239 _def_shm
='#define HAVE_SHM 1'
3241 _def_shm
='#undef HAVE_SHM'
3246 # XXX: FIXME, add runtime checking
3247 echocheck
"linux devfs"
3248 echores
"$_linux_devfs"
3251 echocheck
"scandir()"
3253 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3256 cc_check
&& _scandir
=yes
3257 if test "$_scandir" = yes ; then
3258 _def_scandir
='#define HAVE_SCANDIR 1'
3260 _def_scandir
='#undef HAVE_SCANDIR'
3265 echocheck
"strsep()"
3268 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3271 cc_check
&& _strsep
=yes
3272 if test "$_strsep" = yes ; then
3273 _def_strsep
='#define HAVE_STRSEP 1'
3275 _def_strsep
='#undef HAVE_STRSEP'
3279 echocheck
"strlcpy()"
3282 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3285 cc_check
&& _strlcpy
=yes
3286 if test "$_strlcpy" = yes ; then
3287 _def_strlcpy
='#define HAVE_STRLCPY 1'
3289 _def_strlcpy
='#undef HAVE_STRLCPY'
3293 echocheck
"strlcat()"
3296 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3299 cc_check
&& _strlcat
=yes
3300 if test "$_strlcat" = yes ; then
3301 _def_strlcat
='#define HAVE_STRLCAT 1'
3303 _def_strlcat
='#undef HAVE_STRLCAT'
3307 echocheck
"fseeko()"
3310 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3313 cc_check
&& _fseeko
=yes
3314 if test "$_fseeko" = yes ; then
3315 _def_fseeko
='#define HAVE_FSEEKO 1'
3317 _def_fseeko
='#undef HAVE_FSEEKO'
3321 echocheck
"localtime_r()"
3324 int main( void ) { localtime_r(NULL, NULL); }
3327 cc_check
&& _localtime_r
=yes
3328 if test "$_localtime_r" = yes ; then
3329 _def_localtime_r
='#define HAVE_LOCALTIME_R 1'
3331 _def_localtime_r
='#undef HAVE_LOCALTIME_R'
3333 echores
"$_localtime_r"
3335 echocheck
"vsscanf()"
3338 int main(void) { vsscanf(0, 0, 0); return 0; }
3341 cc_check
&& _vsscanf
=yes
3342 if test "$_vsscanf" = yes ; then
3343 _def_vsscanf
='#define HAVE_VSSCANF 1'
3345 _def_vsscanf
='#undef HAVE_VSSCANF'
3353 int main(void) { swab(0, 0, 0); return 0; }
3356 cc_check
&& _swab
=yes
3357 if test "$_swab" = yes ; then
3358 _def_swab
='#define HAVE_SWAB 1'
3360 _def_swab
='#undef HAVE_SWAB'
3364 echocheck
"POSIX select()"
3368 #include <sys/types.h>
3370 #include <sys/time.h>
3372 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3375 cc_check
&& _posix_select
=yes
3376 if test "$_posix_select" = no
; then
3377 _def_no_posix_select
='#define HAVE_NO_POSIX_SELECT 1'
3379 _def_no_posix_select
='#undef HAVE_NO_POSIX_SELECT'
3381 echores
"$_posix_select"
3384 echocheck
"gettimeofday()"
3387 #include <sys/time.h>
3388 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3391 cc_check
&& _gettimeofday
=yes
3392 if test "$_gettimeofday" = yes ; then
3393 _def_gettimeofday
='#define HAVE_GETTIMEOFDAY 1'
3395 _def_gettimeofday
='#undef HAVE_GETTIMEOFDAY'
3397 echores
"$_gettimeofday"
3404 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3407 cc_check
&& _glob
=yes
3408 if test "$_glob" = yes ; then
3409 _def_glob
='#define HAVE_GLOB 1'
3411 _def_glob
='#undef HAVE_GLOB'
3416 echocheck
"setenv()"
3419 int main (void){ setenv("","",0); return 0; }
3422 cc_check
&& _setenv
=yes
3423 if test "$_setenv" = yes ; then
3424 _def_setenv
='#define HAVE_SETENV 1'
3426 _def_setenv
='#undef HAVE_SETENV'
3432 echocheck
"sysi86()"
3434 #include <sys/sysi86.h>
3435 int main (void) { sysi86(0); return 0; }
3438 cc_check
&& _sysi86
=yes
3439 if test "$_sysi86" = yes ; then
3440 _def_sysi86
='#define HAVE_SYSI86 1'
3442 _def_sysi86
='#undef HAVE_SYSI86'
3448 echocheck
"sys/sysinfo.h"
3450 #include <sys/sysinfo.h>
3452 struct sysinfo s_info;
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>'
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
3475 _def_macosx
='#undef MACOSX'
3476 _noaomodules
="macosx $_noaomodules"
3477 _novomodules
="quartz $_novomodules"
3480 if test "$_macosx" = yes ; then
3482 #include <Carbon/Carbon.h>
3483 #include <QuickTime/QuickTime.h>
3484 #include <CoreAudio/CoreAudio.h>
3488 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3491 if cc_check
-framework Carbon
-framework QuickTime
-framework CoreAudio
; then
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"
3501 _def_macosx
='#undef MACOSX'
3502 _noaomodules
="macosx $_noaomodules"
3503 _novomodules
="quartz $_novomodules"
3506 #include <Carbon/Carbon.h>
3507 #include <QuartzCore/CoreVideo.h>
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
3517 _novomodules
="macosx $_novomodules"
3518 _def_macosx_corevideo
='#undef MACOSX_COREVIDEO'
3519 _macosx_corevideo
=no
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
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'
3544 _def_macosx_bundle
='#undef MACOSX_BUNDLE'
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
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
3564 if test "$_smbsupport" = yes; then
3565 _def_smbsupport
="#define LIBSMBCLIENT"
3566 _inputmodules
="smb $_inputmodules"
3568 _def_smbsupport
="#undef LIBSMBCLIENT"
3569 _noinputmodules
="smb $_noinputmodules"
3571 echores
"$_smbsupport"
3580 if test "$_3dfx" = yes ; then
3581 _def_3dfx
='#define HAVE_3DFX 1'
3582 _vosrc
="$_vosrc vo_3dfx.c"
3583 _vomodules
="3dfx $_vomodules"
3585 _def_3dfx
='#undef HAVE_3DFX'
3586 _novomodules
="3dfx $_novomodules"
3592 if test "$_tdfxfb" = yes ; then
3593 _def_tdfxfb
='#define HAVE_TDFXFB 1'
3594 _vosrc
="$_vosrc vo_tdfxfb.c"
3595 _vomodules
="tdfxfb $_vomodules"
3597 _def_tdfxfb
='#undef HAVE_TDFXFB'
3598 _novomodules
="tdfxfb $_novomodules"
3603 if test "$_s3fb" = yes ; then
3604 _def_s3fb
='#define HAVE_S3FB 1'
3605 _vosrc
="$_vosrc vo_s3fb.c"
3606 _vomodules
="s3fb $_vomodules"
3608 _def_s3fb
='#undef HAVE_S3FB'
3609 _novomodules
="s3fb $_novomodules"
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"
3619 _def_tdfxvid
='#undef HAVE_TDFX_VID'
3620 _novomodules
="tdfx_vid $_novomodules"
3625 if test "$_tga" = yes ; then
3626 _def_tga
='#define HAVE_TGA 1'
3627 _vosrc
="$_vosrc vo_tga.c"
3628 _vomodules
="tga $_vomodules"
3630 _def_tga
='#undef HAVE_TGA'
3631 _novomodules
="tga $_novomodules"
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"
3644 if test -d "$I" && test -f "$I/directfb.h" ; then
3645 _inc_directfb
="-I$I"
3646 _res_comment
="using $_inc_directfb"
3651 if test -z "$_inc_directfb" ; then
3656 _res_comment
="using $_inc_directfb"
3659 if test "$_inc_directfb" = "-I/usr/include" ; then
3663 echocheck
"DirectFB"
3664 if test "$_directfb" = auto
; then
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
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"
3686 _def_directfb_version
='#undef DIRECTFBVERSION'
3688 _res_comment
="version >=0.9.13 required"
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"
3710 _def_directfb
='#undef HAVE_DIRECTFB'
3711 _novomodules
="directfb $_novomodules"
3716 echocheck
"X11 headers presence"
3717 if test -z "$_inc_x11" ; then
3718 for I
in /usr
/X11
/include
/usr
/X11R
6/include
/usr
/include
/X11R6
/usr
/include
/usr
/openwin
/include
; do
3719 if test -d "$I/X11" && test -f "$I/X11/Xlib.h" ; then
3722 _res_comment
="using $I"
3726 if test -z "$_inc_x11" ; then
3729 _res_comment
="check if the dev(el) packages are installed"
3733 _res_comment
="using $_inc_x11"
3735 if test "$_inc_x11" = "-I/usr/include" ; then
3738 echores
"$_x11_headers"
3742 if test "$_x11" != no
; then
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"
3754 _ld_x11
="$_ld_x11 -Wl,-R$I"
3756 if test -d "$I" && cc_check
$_inc_x11 $_ld_x11 ; then
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"
3769 _def_x11
='#undef HAVE_X11'
3772 _novomodules
="x11 $_novomodules"
3773 _res_comment
="check if the dev(el) packages are installed"
3781 if test "$_x11" = yes ; then
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>
3789 (void) DPMSQueryExtension(0, 0, 0);
3792 cc_check
$_inc_x11 -lXdpms $_ld_x11 && _xdpms3
=yes
3794 #include <X11/Xlib.h>
3795 #include <X11/extensions/dpms.h>
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"
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"
3812 _def_xdpms
='#undef HAVE_XDPMS'
3818 if test "$_x11" = yes && test "$_xv" != no
; then
3820 #include <X11/Xlib.h>
3821 #include <X11/extensions/Xvlib.h>
3823 (void) XvGetPortAttribute(0, 0, 0, 0);
3824 (void) XvQueryPortAttributes(0, 0, 0);
3828 cc_check
$_inc_x11 -lXv $_ld_x11 && _xv
=yes
3832 if test "$_xv" = yes ; then
3833 _def_xv
='#define HAVE_XV 1'
3835 _vosrc
="$_vosrc vo_xv.c"
3836 _vomodules
="xv $_vomodules"
3838 _def_xv
='#undef HAVE_XV'
3839 _novomodules
="xv $_novomodules"
3845 if test "$_x11" = yes && test "$_xv" = yes && test "$_xvmc" != no
; then
3848 #include <X11/Xlib.h>
3849 #include <X11/extensions/Xvlib.h>
3850 #include <X11/extensions/XvMClib.h>
3852 (void) XvMCQueryExtension(0,0,0);
3853 (void) XvMCCreateContext(0,0,0,0,0,0,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
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"
3867 _def_xvmc
='#undef HAVE_XVMC'
3868 _novomodules
="xvmc $_novomodules"
3873 echocheck
"Xinerama"
3874 if test "$_x11" = yes && test "$_xinerama" != no
; then
3876 #include <X11/Xlib.h>
3877 #include <X11/extensions/Xinerama.h>
3878 int main(void) { (void) XineramaIsActive(0); return 0; }
3881 cc_check
$_inc_x11 -lXinerama $_ld_x11 && _xinerama
=yes
3885 if test "$_xinerama" = yes ; then
3886 _def_xinerama
='#define HAVE_XINERAMA 1'
3887 _ld_xinerama
='-lXinerama'
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'.
3900 if test "$_x11" = yes && test "$_vm" = auto
; then
3902 #include <X11/Xlib.h>
3903 #include <X11/extensions/xf86vmode.h>
3904 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3907 cc_check
$_inc_x11 -lXxf86vm $_ld_x11 && _vm
=yes
3909 if test "$_vm" = yes ; then
3910 _def_vm
='#define HAVE_XF86VM 1'
3913 _def_vm
='#undef HAVE_XF86VM'
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
3924 if test "$_x11" = yes ; then
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'
3936 _def_xf86keysym
='#undef HAVE_XF86XK'
3938 echores
"$_xf86keysym"
3941 if test "$_x11" = no
; then
3944 # Version 2 is preferred to version 1 if available
3945 if test "$_dga" = auto
; then
3947 #include <X11/Xlib.h>
3948 #include <X11/extensions/xf86dga.h>
3949 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
3952 cc_check
$_inc_x11 -lXxf86dga -lXxf86vm $_ld_x11 && _dga
=1
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"
3980 die
"DGA version must be 1 or 2"
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
3990 int main(void) { return 0; }
3993 if cc_check
$_inc_x11 $_ld_x11 -lGL $_ld_lm ; then
3995 _ld_gl
="-lGL $_ld_dl"
3996 elif cc_check
$_inc_x11 $_ld_x11 -lGL $_ld_lm $_ld_pthread ; then
3998 _ld_gl
="-lGL $_ld_pthread $_ld_dl"
3999 elif cc_check
-lopengl32 ; then
4002 _ld_gl
="-lopengl32 -lgdi32"
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"
4017 _def_gl
='#undef HAVE_GL'
4018 _def_gl_win32
='#undef GL_WIN32'
4019 _novomodules
="opengl $_novomodules"
4024 echocheck
"/dev/mga_vid"
4025 if test "$_mga" = auto
; then
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"
4034 _def_mga
='#undef HAVE_MGA'
4035 _novomodules
="mga $_novomodules"
4040 # echocheck "syncfb"
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"
4047 # _def_syncfb='#undef HAVE_SYNCFB'
4049 # echores "$_syncfb"
4053 if test "$_xmga" = auto
; then
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"
4062 _def_xmga
='#undef HAVE_XMGA'
4063 _novomodules
="xmga $_novomodules"
4069 if test "$_ggi" = auto
; then
4071 #include <ggi/ggi.h>
4072 int main(void) { return 0; }
4075 cc_check
-lggi && _ggi
=yes
4077 if test "$_ggi" = yes ; then
4078 _def_ggi
='#define HAVE_GGI 1'
4080 _vosrc
="$_vosrc vo_ggi.c"
4081 _vomodules
="ggi $_vomodules"
4083 _def_ggi
='#undef HAVE_GGI'
4084 _novomodules
="ggi $_novomodules"
4088 echocheck
"GGI extension: libggiwmh"
4089 if test "$_ggiwmh" = auto
; then
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"
4105 _def_ggiwmh
='#undef HAVE_GGIWMH'
4111 if test "$_aa" = auto
; then
4114 extern struct aa_hardware_params aa_defparams;
4115 extern struct aa_renderparams aa_defrenderparams;
4119 (void) aa_init(0, 0, 0);
4120 c = aa_autoinit(&aa_defparams);
4121 p = aa_getrenderparams();
4122 aa_autoinitkbd(c,0);
4126 for _ld_tmp
in "-laa" "$_ld_x11 -laa" ; do
4127 cc_check
$_ld_tmp && _ld_aa
=$_ld_tmp && _aa
=yes && break
4130 if test "$_aa" = yes ; then
4131 _def_aa
='#define HAVE_AA 1'
4133 _ld_aa
=`aalib-config --libs | cut -d " " -f 2,5,6`
4135 _vosrc
="$_vosrc vo_aa.c"
4136 _vomodules
="aa $_vomodules"
4138 _def_aa
='#undef HAVE_AA'
4139 _novomodules
="aa $_novomodules"
4145 if test "$_caca" = auto
; then
4147 if ( caca-config
--version ) >> "$TMPLOG" 2>&1 ; then
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"
4162 _def_caca
='#undef HAVE_CACA'
4163 _novomodules
="caca $_novomodules"
4169 if test "$_svga" = auto
; then
4172 int main(void) { return 0; }
4175 cc_check
-lvga $_ld_lm && _svga
=yes
4177 if test "$_svga" = yes ; then
4178 _def_svga
='#define HAVE_SVGALIB 1'
4180 _vosrc
="$_vosrc vo_svga.c"
4181 _vomodules
="svga $_vomodules"
4183 _def_svga
='#undef HAVE_SVGALIB'
4184 _novomodules
="svga $_novomodules"
4190 if test "$_fbdev" = auto
; then
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"
4199 _def_fbdev
='#undef HAVE_FBDEV'
4200 _novomodules
="fbdev $_novomodules"
4207 if test "$_dvb" != no
; then
4210 #include <sys/poll.h>
4211 #include <sys/ioctl.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;}
4226 for I
in "$_inc_dvb" "-I/usr/src/DVB/ost/include" ; do
4227 if cc_check
"$I" ; then
4230 _res_comment
="using $_inc_dvb"
4234 test "$_dvb" = no
&& _res_comment
="specify path to DVB/ost/include with --with-dvbincdir=DIR"
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
4250 #include <sys/poll.h>
4251 #include <sys/ioctl.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;}
4265 for I
in "$_inc_dvb" "-I/usr/src/DVB/include" ; do
4266 if cc_check
"$I" ; then
4269 _res_comment
="using $_inc_dvb"
4273 test "$_dvbhead" = no
&& _res_comment
="specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR"
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
4293 _inputmodules
="dvb $_inputmodules"
4296 _noinputmodules
="dvb $_noinputmodules"
4299 echocheck
"PNG support"
4300 if test "$_png" = auto
; 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)"
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
4320 _res_comment
="mismatch of library and header versions"
4326 if test "$_png" = yes ; then
4327 _def_png
='#define HAVE_PNG 1'
4329 _vosrc
="$_vosrc vo_png.c"
4330 _vomodules
="png $_vomodules"
4333 _def_png
='#undef HAVE_PNG'
4334 _novomodules
="png $_novomodules"
4338 echocheck
"JPEG support"
4339 if test "$_jpg" = auto
; then
4346 #include <jpeglib.h>
4351 if cc_check
-ljpeg $_ld_lm ; then
4359 if test "$_jpg" = yes ; then
4360 _def_jpg
='#define HAVE_JPEG 1'
4361 _vosrc
="$_vosrc vo_jpeg.c"
4362 _vomodules
="jpeg $_vomodules"
4366 _def_jpg
='#undef HAVE_JPEG'
4367 _novomodules
="jpeg $_novomodules"
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"
4379 _def_pnm
="#undef HAVE_PNM"
4380 _novomodules
="pnm $_novomodules"
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"
4392 _def_md5sum
="#undef HAVE_MD5SUM"
4393 _novomodules
="md5sum $_novomodules"
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
4408 if test "$_gif" = auto
; then
4411 #include <gif_lib.h>
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
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. ] )
4430 if test "$_force_gif" = yes && test "$_gif" = no
; then
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"
4441 _res_comment
="old version, some encoding functions disabled"
4442 _def_gif_4
='#undef HAVE_GIF_4'
4446 #include <gif_lib.h>
4447 void catch() { exit(1); }
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.
4455 if cc_check
"$_ld_gif" && tmp_run
; then
4456 _def_gif_4
='#define HAVE_GIF_4 1'
4460 _def_gif
='#undef HAVE_GIF'
4461 _def_gif_4
='#undef HAVE_GIF_4'
4462 _novomodules
="gif89a $_novomodules"
4463 _nocodecmodules
="gif $_nocodecmodules"
4469 case "$_gif" in yes*)
4470 echocheck
"broken giflib workaround"
4471 _def_gif_tvt_hack
='#define HAVE_GIF_TVT_HACK 1'
4474 #include <gif_lib.h>
4477 printf("UserData is at address %p\n", gif.UserData);
4481 if cc_check
"$_ld_gif" && tmp_run
; then
4482 _def_gif_tvt_hack
='#undef HAVE_GIF_TVT_HACK'
4491 echocheck
"VESA support"
4492 if test "$_vesa" = auto
; then
4495 int main(void) { vbeVersion(); return 0; }
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"
4506 _def_vesa
='#undef HAVE_VESA'
4507 _novomodules
="vesa $_novomodules"
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"
4526 if test "$_sdl" = auto ||
test "$_sdl" = yes ; then
4529 int main(int argc, char *argv[]) { return 0; }
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'
4539 _def_sdlbuggy
='#undef BUGGY_SDL'
4543 _res_comment
="outdated"
4548 if test "$_sdl" = yes ; then
4549 _def_sdl
='#define HAVE_SDL 1'
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/`
4554 _ld_sdl
=`$_sdlconfig --libs | sed s/-mwindows//`
4555 _inc_sdl
=`$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`
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"
4566 _def_sdl
='#undef HAVE_SDL'
4567 _novomodules
="sdl $_novomodules"
4568 _noaomodules
="sdl $_noaomodules"
4572 echocheck
"Windows waveout"
4573 if test "$_win32waveout" = auto
; then
4575 #include <windows.h>
4576 #include <mmsystem.h>
4577 int main(void) { return 0; }
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"
4588 _def_win32waveout
='#undef HAVE_WIN32WAVEOUT'
4589 _noaomodules
="win32 $_noaomodules"
4591 echores
"$_win32waveout"
4594 if test "$_directx" = auto
; then
4596 #include <windows.h>
4599 int main(void) { return 0; }
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"
4612 _def_directx
='#undef HAVE_DIRECTX'
4613 _novomodules
="directx $_novomodules"
4614 _noaomodules
="dsound $_noaomodules"
4619 if test "$_nas" = auto
; then
4621 #include <audio/audiolib.h>
4622 int main(void) { return 0; }
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"
4633 _noaomodules
="nas $_noaomodules"
4634 _def_nas
='#undef HAVE_NAS'
4639 if test "$_dxr2" = auto
; then
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
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"
4659 _def_dxr2
='#undef HAVE_DXR2'
4660 _noaomodules
="dxr2 $_noaomodules"
4661 _novomodules
="dxr2 $_novomodules"
4667 if test "$_dxr3" = auto
; then
4669 #include <linux/em8300.h>
4670 int main(void) { return 0; }
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"
4680 _def_dxr3
='#undef HAVE_DXR3'
4681 _novomodules
="dxr3 $_novomodules"
4682 if test "$_mp1e" = auto
; then
4683 # we don't need mp1e
4690 if test "$_mmx" = no
; then
4691 # mp1e REQUIRES mmx!
4694 if test "$_mp1e" != no
; then
4696 _def_mp1e
='#define USE_MP1E'
4697 _ld_mp1e
='libmp1e/libmp1e.a'
4698 _dep_mp1e
='libmp1e/libmp1e.a'
4701 _def_mp1e
='#undef USE_MP1E'
4709 if test "$_fame" = auto
; then
4711 test "$_dxr2" = yes && _fame
=auto
4712 test "$_dxr3" = yes && _fame
=auto
4713 test "$_dvb" = yes && _fame
=auto
4715 if test "$_fame" = auto
; then
4717 if test -d libfame
&& test -f libfame
/fame.h
; then
4718 # disable fame on cygwin as no sense to port - atmos
4721 _res_comment
="no fame dir"
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'
4738 echocheck
"OSS Audio"
4739 if test "$_ossaudio" = auto
; then
4741 #include <sys/ioctl.h>
4743 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
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"'
4757 #include <sys/ioctl.h>
4759 #ifdef OPEN_SOUND_SYSTEM
4760 int main(void) { return 0; }
4762 #error Not the real thing
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"
4773 _def_ossaudio_devdsp
='#define PATH_DEV_DSP "/dev/dsp"'
4775 _def_ossaudio_devmixer
='#define PATH_DEV_MIXER "/dev/mixer"'
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"
4787 if test "$_arts" = auto
; then
4789 if ( artsc-config
--version ) >> "$TMPLOG" 2>&1 ; then
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`
4807 _noaomodules
="arts $_noaomodules"
4813 if test "$_esd" = auto
; then
4815 if ( esd-config
--version ) >> "$TMPLOG" 2>&1 ; then
4819 int main(void) { return 0; }
4821 cc_check
`esd-config --libs` `esd-config --cflags` && tmp_run
&& _esd
=yes
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()"
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"
4842 _def_esd
='#undef USE_ESD'
4843 _def_esd_latency
='#undef HAVE_ESD_LATENCY'
4844 _noaomodules
="esd $_noaomodules"
4848 if test "$_polyp" = auto
; then
4850 if pkg-config
--exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ; then
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
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`
4871 _def_polyp
='#undef USE_POLYP'
4872 _noaomodules
="polyp $_noaomodules"
4877 if test "$_jack" = auto
; then
4881 #include <jack/jack.h>
4882 int main(void) { jack_client_new("test"); return 0; }
4884 if cc_check
-ljack ; then
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`"
4894 if test "$_jack" = yes ; then
4895 _def_jack
='#define USE_JACK 1'
4896 _aosrc
="$_aosrc ao_jack.c"
4897 _aomodules
="jack $_aomodules"
4899 _noaomodules
="jack $_noaomodules"
4904 if test "$_openal" = auto
; then
4909 alSourceQueueBuffers(0, 0, 0);
4910 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
4914 if cc_check
-lopenal ; then
4915 _ld_openal
="-lopenal"
4919 if test "$_openal" = yes ; then
4920 _def_openal
='#define USE_OPENAL 1'
4921 _aosrc
="$_aosrc ao_openal.c"
4922 _aomodules
="openal $_aomodules"
4924 _noaomodules
="openal $_noaomodules"
4928 echocheck
"ALSA audio"
4929 if test "$_alsa" != no
; then
4932 #include <sys/asoundlib.h>
4933 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
4934 #error "alsa version != 0.5.x"
4936 int main(void) { return 0; }
4938 cc_check
-lasound $_ld_dl $_ld_pthread && _alsaver
='0.5.x'
4941 #include <sys/asoundlib.h>
4942 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4943 #error "alsa version != 0.9.x"
4945 int main(void) { return 0; }
4947 cc_check
-lasound $_ld_dl $_ld_pthread && _alsaver
='0.9.x-sys'
4949 #include <alsa/asoundlib.h>
4950 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4951 #error "alsa version != 0.9.x"
4953 int main(void) { return 0; }
4955 cc_check
-lasound $_ld_dl $_ld_pthread && _alsaver
='0.9.x-alsa'
4958 #include <sys/asoundlib.h>
4959 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4960 #error "alsa version != 1.0.x"
4962 int main(void) { return 0; }
4964 cc_check
-lasound $_ld_dl $_ld_pthread && _alsaver
='1.0.x-sys'
4966 #include <alsa/asoundlib.h>
4967 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4968 #error "alsa version != 1.0.x"
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
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"
5013 _res_comment
="unknown version"
5015 _ld_alsa
="-lasound $_ld_dl $_ld_pthread"
5017 _noaomodules
="alsa $_noaomodules"
5022 echocheck
"Sun audio"
5023 if test "$_sunaudio" = auto
; then
5025 #include <sys/types.h>
5026 #include <sys/audioio.h>
5027 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
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"
5037 _def_sunaudio
='#undef USE_SUN_AUDIO'
5038 _noaomodules
="sun $_noaomodules"
5040 echores
"$_sunaudio"
5043 echocheck
"Sun mediaLib"
5044 if test "$_mlib" = auto
; then
5046 test -z "$_mlibdir" && _mlibdir
=/opt
/SUNWmlib
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 "
5058 _def_mlib
='#undef HAVE_MLIB'
5063 echocheck
"SGI audio"
5064 if test "$_sgiaudio" = auto
; then
5065 # check for SGI audio
5067 #include <dmedia/audio.h>
5068 int main(void) { return 0; }
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"
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'
5091 _def_vcd
='#undef HAVE_VCD'
5092 _noinputmodules
="vcd $_noinputmodules"
5093 _res_comment
="not supported on this OS"
5099 echocheck
"DVD support (libmpdvdkit2)"
5100 if test "$_dvdkit" = auto
; then
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
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'
5120 _dev_dvd_openbsd
='#define HAVE_OPENBSD_DVD_STRUCT 1'
5124 _def_dvd_bsd
='#define HAVE_BSD_DVD_STRUCT 1'
5127 _def_dvd_darwin
='#define DARWIN_DVD_IOCTL'
5132 _noinputmodules
="mpdvdkit2 $_noinputmodules"
5136 echocheck
"DVD support (libdvdread)"
5137 if test "$_dvdread" = auto
; then
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; }
5147 if test "$_dl" = yes; then
5149 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread $_ld_dl && \
5153 _def_mpdvdkit
="#undef USE_MPDVDKIT"
5157 _def_dvdread
='#define USE_DVDREAD 1'
5158 _ld_dvdread
='-ldvdread'
5159 _inputmodules
="dvdread $_inputmodules"
5163 _def_dvdread
='#undef USE_DVDREAD'
5164 _noinputmodules
="dvdread $_noinputmodules"
5168 _def_dvdread
='#define USE_DVDREAD 1'
5169 _ld_dvdread
='-Llibmpdvdkit2 -lmpdvdkit'
5170 _noinputmodules
="dvdread $_noinputmodules"
5171 _def_mpdvdkit
="#define USE_MPDVDKIT 2"
5174 _res_comment
="disabled by libmpdvdkit2"
5179 if test "$_have_dvd" = yes ; then
5180 _def_have_dvd
='#define HAVE_DVD 1'
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
5189 # #include <dvdnav.h>
5190 # int main(void) { dvdnav_t *dvd=0; return 0; }
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"
5199 # test -z "$_dvdnavdir" && test -n "$_dvdnavconfig" && _dvdnavdir=`$_dvdnavconfig --cflags`
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
5204 # if test "$_dvdnav" = yes ; then
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`"
5212 # _ld_css="$_ld_css -ldvdnav"
5214 # if test -n "$_dvdnavconfig" ; then
5215 # _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
5216 # _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
5218 # if test -n "$_dvdnavdir" ; then
5219 # _inc_extra="$_inc_extra -I$_dvdnavdir"
5221 # _inputmodules="dvdnav $_inputmodules"
5223 # _def_dvdnav='#undef USE_DVDNAV'
5224 # _noinputmodules="dvdnav $_noinputmodules"
5226 # echores "$_dvdnav"
5228 echocheck
"cdparanoia"
5229 if test "$_cdparanoia" = auto
; then
5231 #include <cdda_interface.h>
5232 #include <cdda_paranoia.h>
5233 // This need a better test. How ?
5234 int main(void) { return 1; }
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
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"
5247 _def_cdparanoia
='#undef HAVE_CDDA'
5248 _noinputmodules
="cdda $_noinputmodules"
5250 echores
"$_cdparanoia"
5254 if test "$_libcdio" = auto
&& test "$_cdparanoia" = no
; then
5255 if pkg-config
--exists libcdio
; then
5258 #include <cdio/version.h>
5259 #include <cdio/cdda.h>
5260 #include <cdio/paranoia.h>
5263 printf("%s\n", CDIO_VERSION);
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
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`
5286 if test "$_cdparanoia" = yes ; then
5287 _res_comment
="using cdparanoia"
5289 _def_libcdio
='#undef HAVE_LIBCDIO'
5290 _def_havelibcdio
='no'
5295 echocheck
"freetype >= 2.0.9"
5297 # freetype depends on iconv
5298 if test "$_iconv" = no
; then
5300 _res_comment
="iconv support needed"
5303 if test "$_freetype" = auto
; then
5304 if ( $_freetypeconfig --version ) >/dev
/null
2>&1 ; then
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"
5315 FT_Int major=-1,minor=-1,patch=-1;
5316 int err=FT_Init_FreeType(&library);
5318 printf("Couldn't initialize freetype2 lib, err code: %d\n",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");
5333 cc_check
`$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run
&& _freetype
=yes
5338 if test "$_freetype" = yes ; then
5339 _def_freetype
='#define HAVE_FREETYPE'
5340 _inc_freetype
=`$_freetypeconfig --cflags`
5341 _ld_freetype
=`$_freetypeconfig --libs`
5343 _def_freetype
='#undef HAVE_FREETYPE'
5345 echores
"$_freetype"
5347 if test "$_freetype" = no
; then
5349 _res_comment
="freetype support needed"
5351 echocheck
"fontconfig"
5352 if test "$_fontconfig" = auto
; then
5355 #include <fontconfig/fontconfig.h>
5360 printf("Couldn't initialize fontconfig lib\n");
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`
5377 if test "$_fontconfig" = yes ; then
5378 _def_fontconfig
='#define HAVE_FONTCONFIG'
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
5389 /* workaround for fribidi 0.10.4 and below */
5390 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5391 #include <fribidi/fribidi.h>
5394 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5395 printf("Fribidi headers are not consistents with the library!\n");
5402 cc_check
`$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run
&& _fribidi
=yes
5407 if test "$_fribidi" = yes ; then
5408 _def_fribidi
='#define USE_FRIBIDI'
5409 _inc_fribidi
=`$_fribidiconfig --cflags`
5410 _ld_fribidi
=`$_fribidiconfig --libs`
5412 _def_fribidi
='#undef USE_FRIBIDI'
5418 if test "$_enca" = auto
; then
5425 langs = enca_get_languages(&langcnt);
5430 cc_check
-lenca $_ld_lm && _enca
=yes
5432 if test "$_enca" = yes ; then
5433 _def_enca
='#define HAVE_ENCA 1'
5436 _def_enca
='#undef HAVE_ENCA'
5444 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5447 cc_check
-lz && _zlib
=yes
5448 if test "$_zlib" = yes ; then
5449 _def_zlib
='#define HAVE_ZLIB 1'
5452 _def_zlib
='#undef HAVE_ZLIB'
5458 if test "$_rtc" = auto
; then
5460 #include <sys/ioctl.h>
5462 #include <linux/rtc.h>
5465 #define RTC_PIE_ON RTCIO_PIE_ON
5467 int main(void) { return RTC_PIE_ON; }
5470 cc_check
&& _rtc
=yes
5473 if test "$_rtc" = yes ; then
5474 _def_rtc
='#define HAVE_RTC 1'
5476 _def_rtc
='#undef HAVE_RTC'
5481 echocheck
"external liblzo support"
5482 if test "$_liblzo" = auto
; then
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'
5493 _codecmodules
="liblzo $_codecmodules"
5495 _def_liblzo
='#undef USE_LIBLZO'
5496 _nocodecmodules
="liblzo $_nocodecmodules"
5501 echocheck
"mad support"
5502 if test "$_mad" = auto
; then
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'
5513 _codecmodules
="libmad $_codecmodules"
5515 _def_mad
='#undef USE_LIBMAD'
5516 _nocodecmodules
="libmad $_nocodecmodules"
5521 if test "$_toolame" = auto
; then
5523 #include <toolame.h>
5524 int main(void) { toolame_init(); return 0; }
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"
5538 _def_toolame
='#undef HAVE_TOOLAME'
5540 _nocodecmodules
="toolame $_nocodecmodules"
5542 if test "$_toolamedir" ; then
5543 _res_comment
="using $_toolamedir"
5548 if test "$_twolame" = auto
; then
5550 #include <twolame.h>
5551 int main(void) { twolame_init(); return 0; }
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"
5561 _def_twolame
='#undef HAVE_TWOLAME'
5563 _nocodecmodules
="twolame $_nocodecmodules"
5567 echocheck
"OggVorbis support"
5568 if test "$_tremor_internal" = yes; then
5570 elif test "$_vorbis" = auto
; then
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_'
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"
5595 _def_tremor
='#undef TREMOR'
5596 _ld_vorbis
='-lvorbis -logg'
5597 _codecmodules
="libvorbis $_codecmodules"
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"
5613 echocheck
"libspeex (version >= 1.1 required)"
5614 if test "$_speex" = auto
; then
5617 #include <speex/speex.h>
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'
5629 _codecmodules
="speex $_codecmodules"
5631 _def_speex
='#undef HAVE_SPEEX'
5632 _nocodecmodules
="speex $_nocodecmodules"
5636 echocheck
"OggTheora support"
5637 if test "$_theora" = auto
; then
5640 #include <theora/theora.h>
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
5655 theora_info_init (&inf);
5656 theora_comment_init (&tc);
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);
5673 for _ld_theora
in "`pkg-config --silence-errors --libs --cflags theora`" "-ltheora"; do
5674 cc_check
$_ld_theora && _theora
=yes && break
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
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"
5689 _def_theora
='#undef HAVE_OGGTHEORA'
5690 _nocodecmodules
="libtheora $_nocodecmodules"
5695 echocheck
"mp3lib support"
5696 if test "$_mp3lib" = yes ; then
5697 _def_mp3lib
='#define USE_MP3LIB 1'
5698 _codecmodules
="mp3lib $_codecmodules"
5700 _def_mp3lib
='#undef USE_MP3LIB'
5701 _nocodecmodules
="mp3lib $_nocodecmodules"
5705 echocheck
"liba52 support"
5706 if test "$_liba52" = yes ; then
5707 _def_liba52
='#define USE_LIBA52 1'
5708 _codecmodules
="liba52 $_codecmodules"
5710 _def_liba52
='#undef USE_LIBA52'
5711 _nocodecmodules
="liba52 $_nocodecmodules"
5715 echocheck
"libdts support"
5716 if test "$_libdts" = auto
; then
5719 #include <inttypes.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"
5730 _def_libdts
='#undef CONFIG_DTS'
5731 _nocodecmodules
="libdts $_nocodecmodules"
5735 echocheck
"libmpeg2 support"
5736 if test "$_libmpeg2" = yes ; then
5737 _def_libmpeg2
='#define USE_LIBMPEG2 1'
5738 _codecmodules
="libmpeg2 $_codecmodules"
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
5749 #include <mpcdec/mpcdec.h>
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"
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
5773 #include <inttypes.h>
5775 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
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
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"
5787 _def_faac
="#undef HAVE_FAAC"
5788 _nocodecmodules
="faac $_nocodecmodules"
5792 echocheck
"internal FAAD2 (AAC) support"
5793 if test "$_faad_internal" = auto
; then
5794 if x86
&& test cc_vendor
=gnu
; then
5796 3.1*|
3.2) # ICE/insn with these versions
5798 _res_comment
="broken gcc"
5808 if test "$_faad_internal" = yes ; then
5809 _def_faad_internal
="#define USE_INTERNAL_FAAD 1"
5812 _def_faad_internal
="#undef USE_INTERNAL_FAAD"
5815 echores
"$_faad_internal"
5818 echocheck
"external FAAD2 (AAC) support"
5819 if test "$_faad_external" != no
; then
5821 _inc_faad
="$_inc_extra"
5822 # external faad: check if it's really faad2 :)
5823 if test "$_faad_external" = auto
; then
5827 #ifndef FAAD_MIN_STREAMSIZE
5828 #error Too old version
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"
5844 _def_faad
='#undef HAVE_FAAD'
5845 _nocodecmodules
="faad2 $_nocodecmodules"
5850 echocheck
"LADSPA plugin support"
5851 if test "$_ladspa" = auto
; then
5856 const LADSPA_Descriptor *ld = NULL;
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"
5868 _def_ladspa
="#undef HAVE_LADSPA"
5869 _noafmodules
="ladspa $_noafmodules"
5874 if test "$_win32" = auto
; then
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
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
5898 test -n "$_win32libdir" && _win32
=yes
5900 if test "$_win32" = yes ; then
5901 _def_win32
='#define USE_WIN32DLL 1'
5902 _res_comment
="using $_win32libdir"
5904 _def_win32
='#undef USE_WIN32DLL'
5905 _nocodecmodules
="win32 $_nocodecmodules"
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"
5917 x86
&& _ld_win32
="$_ld_win32 -li386"
5920 _def_win32_loader
='#define WIN32_LOADER 1'
5922 _ld_win32libs
="$_ld_win32libs -ladvapi32 -lole32"
5923 _res_comment
="using native windows"
5929 echocheck
"DirectShow"
5932 if test "$_dshow" != no
; then
5934 # check if compiler supports C++ and C++-libs are installed correctly
5935 cat > "$TMPCPP" << EOF
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
5946 echores
"yes (C++ is ok)"
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"
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"
5976 _def_dshow
='#undef USE_DIRECTSHOW'
5977 _nocodecmodules
="dshow/dmo $_nocodecmodules"
5981 echocheck
"XAnim DLL"
5982 if test "$_xanim" = auto
; then
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
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"
6004 _def_xanim
='#undef USE_XANIM'
6005 _def_xanim_path
='#undef XACODEC_PATH'
6006 _nocodecmodules
="xanim $_nocodecmodules"
6010 echocheck
"RealPlayer DLL"
6011 if test "$_real" = auto
; then
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 \
6025 if test -d "$I" ; then
6029 # Fall back on a subfolder of the current dir on Windows
6030 mingw32
&& _reallibdir
="codecs"
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"
6043 _def_real
='#undef USE_REALCODECS'
6044 _def_real_path
="#undef REALCODEC_PATH"
6045 _nocodecmodules
="real $_nocodecmodules"
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/>
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
6064 if test "$_live" != yes ; then
6065 if cxx_check
-I/usr
/include
/liveMedia
-I/usr
/include
/UsageEnvironment
-I/usr
/include
/groupsock
; then
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"
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"
6104 _def_live
='#undef STREAMING_LIVE555'
6105 _noinputmodules
="live555 $_noinputmodules"
6110 echocheck
"FFmpeg libavutil (static)"
6111 if test "$_libavutil" = auto
; then
6112 if test -d libavutil
; then
6118 echores
"$_libavutil"
6120 echocheck
"FFmpeg libavcodec (static)"
6121 if test "$_libavcodec" = auto
; then
6122 # Note: static linking is preferred to dynamic linking
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
6130 #include "libavcodec/avcodec.h"
6131 #if LIBAVCODEC_BUILD >= 3211265
6132 #error We need libavutil!
6134 int main(void) { return 0; }
6137 if cc_check
-I.
-I.
/libavutil
; then
6138 _libavutil_required
="no"
6140 _libavutil_required
="yes"
6142 _res_comment
="libavutil availability does not fit libavcodec version"
6143 if test "$_libavutil_required" = "$_libavutil"; then
6150 echores
"$_libavcodec"
6152 echocheck
"FFmpeg libavformat (static)"
6153 if test "$_libavformat" = auto
; then
6154 # Note: static linking is preferred to dynamic linking
6156 if test -d libavformat
&& test -f libavformat
/utils.c
; then
6160 echores
"$_libavformat"
6162 echocheck
"FFmpeg libpostproc (static)"
6163 if test "$_libpostproc" = auto
; then
6165 if test -d libpostproc
&& test -f libpostproc
/postprocess.h
; then
6169 echores
"$_libpostproc"
6172 if test "$_libavutil" != yes ; then
6173 echocheck
"FFmpeg libavutil (dynamic)"
6174 if test "$_libavutil_so" = auto
; then
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
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
6198 _res_comment
="libavcodec.so is broken/obsolete"
6199 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
6201 #include <ffmpeg/avcodec.h>
6203 avcodec_find_encoder_by_name("");
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
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
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
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
6248 #define USE_LIBPOSTPROC 1
6249 #include <inttypes.h>
6250 #include <postproc/postprocess.h>
6252 pp_get_mode_by_name_and_quality("de", 0);
6255 if cc_check
-lpostproc $_ld_lm ; then
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"
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'
6293 _def_libavformat_win32
='#define CONFIG_WIN32 1'
6296 if test "$_libavformat_so" = yes ; then
6297 _def_libavformat_so
='#define USE_LIBAVFORMAT_SO 1'
6298 test "$_ld_libavformat" || _ld_libavformat
='-lavformat'
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'
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
6321 if test -f libavcodec
/amr_float
/sp_dec.c
; then
6322 if test "$_libavcodec" = yes ; then
6325 _res_comment
="libavcodec (static) is required by amr_nb, sorry"
6329 if test "$_amr_nb" = yes ; then
6331 _def_amr
='#define AMR 1'
6332 _def_amr_nb
='#define AMR_NB 1'
6334 _def_amr_nb
='#undef AMR_NB'
6338 echocheck
"AMR narrowband, fixed point"
6339 if test "$_amr_nb_fixed" = auto
; then
6341 if test -f libavcodec
/amr
/dtx_dec.c
; then
6342 if test "$_libavcodec" = yes ; then
6343 if test "$_amr_nb" = no
; then
6346 _res_comment
="disabled by amr_nb"
6349 _res_comment
="libavcodec (static) is required by amr_nb-fixed, sorry"
6353 if test "$_amr_nb_fixed" = yes ; then
6355 _def_amr
='#define AMR 1'
6356 _def_amr_nb_fixed
='#define AMR_NB_FIXED 1'
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"
6365 _nocodecmodules
="amr_nb $_nocodecmodules"
6368 echocheck
"AMR wideband"
6369 if test "$_amr_wb" = auto
; then
6371 if test -f libavcodec
/amrwb_float
/dec_dtx.c
; then
6372 if test "$_libavcodec" = yes ; then
6375 _res_comment
="libavcodec (static) is required by amr_wb, sorry"
6379 if test "$_amr_wb" = yes ; then
6381 _def_amr
='#define AMR 1'
6382 _def_amr_wb
='#define AMR_WB 1'
6383 _codecmodules
="amr_wb $_codecmodules"
6385 _def_amr_wb
='#undef AMR_WB'
6386 _nocodecmodules
="amr_wb $_nocodecmodules"
6390 echocheck
"libdv-0.9.5+"
6391 if test "$_libdv" = auto
; then
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'
6402 _codecmodules
="libdv $_codecmodules"
6404 _def_libdv
='#undef HAVE_LIBDV095'
6405 _nocodecmodules
="libdv $_nocodecmodules"
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
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"
6425 _res_comment
="libavcodec (static) is required by zr, sorry"
6426 _novomodules
="zr $_novomodules"
6427 _def_zr
='#undef HAVE_ZR'
6430 _def_zr
='#undef HAVE_ZR'
6431 _novomodules
="zr zr2 $_novomodules"
6436 if test "$_bl" = yes ; then
6437 _def_bl
='#define HAVE_BL 1'
6438 _vosrc
="$_vosrc vo_bl.c"
6439 _vomodules
="bl $_vomodules"
6441 _def_bl
='#undef HAVE_BL'
6442 _novomodules
="bl $_novomodules"
6449 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
6451 _ld_xvid
="$_ld_xvid -lxvidcore"
6453 if test "$_xvid" != no
&& cc_check
$_inc_xvid $_ld_xvid $_ld_lm ; then
6455 _def_xvid3
='#define HAVE_XVID3 1'
6456 _def_xvid4
='#undef HAVE_XVID4'
6457 _codecmodules
="xvid $_codecmodules"
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
6466 elif cc_check
$_inc_xvid $_ld_xvid $_ld_lm $_ld_pthread ; then
6468 _ld_xvid
="$_ld_xvid $_ld_pthread"
6472 if test "$_xvid4" = yes ; then
6475 _def_xvid3
='#undef HAVE_XVID3'
6476 _def_xvid4
='#define HAVE_XVID4 1'
6477 _codecmodules
="xvid $_codecmodules"
6481 _def_xvid3
='#undef HAVE_XVID3'
6482 _def_xvid4
='#undef HAVE_XVID4'
6483 _nocodecmodules
="xvid $_nocodecmodules"
6488 if test "$_xvid4" = yes ; then
6489 echocheck
"XviD two pass plugin"
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
6496 _def_lavc_xvid
='#define CONFIG_XVID 1'
6499 _def_lavc_xvid
='#undef CONFIG_XVID'
6501 echores
"$_lavc_xvid"
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"
6511 int main(void) { (void) decore(0, 0, 0, 0); return 0; }
6513 cc_check
$_ld_lm "$_ld_xvid" && _xvidcompat
=yes
6514 echores
"$_xvidcompat"
6519 #include <inttypes.h>
6522 #error We do not support old versions of x264. Get the latest from SVN.
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
6529 if cc_check
$_inc_x264 $_ld_x264 $_ld_lm ; then
6531 elif test "$_x11" = yes && cc_check
$_inc_x264 $_inc_x11 $_ld_x264 $_ld_x11 $_ld_lm ; then
6533 _ld_x264
="$_ld_x264 $_ld_x11"
6537 if test "$_x264" = yes ; then
6539 _def_x264
='#define HAVE_X264 1'
6540 _codecmodules
="x264 $_codecmodules"
6544 _def_x264
='#undef HAVE_X264'
6545 _nocodecmodules
="x264 $_nocodecmodules"
6549 echocheck
"DivX4linux/DivX5linux/OpenDivX decore"
6550 # DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
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
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"
6566 # if test "$_divx4linux" != no ; then
6568 # OdivxPP disabled because of:
6569 # ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
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
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
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
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."
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"
6623 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
6624 if test "$_mencoder" != no
; then
6626 echocheck
"libmp3lame (for mencoder)"
6628 _def_mp3lame_preset
='#undef HAVE_MP3LAME_PRESET'
6629 _def_mp3lame_preset_medium
='#undef HAVE_MP3LAME_PRESET_MEDIUM'
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"
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"
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"
6651 _def_mp3lame
='#undef HAVE_MP3LAME'
6656 echocheck
"DivX4linux encore (for mencoder)"
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
6663 _def_encore
='#define HAVE_DIVX4ENCORE 1'
6664 _ld_encore
='-ldivxencore'
6665 _res_comment
="DivX4linux - with libdivxencore.so"
6666 elif test "$_xvidcompat" = yes ; then
6668 _def_encore
='#define HAVE_DIVX4ENCORE 1'
6670 _def_encore_xvid
='#define ENCORE_XVID 1'
6671 _res_comment
="XviD compatibility"
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'
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'
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"
6709 _noinputmodules
="tv $_noinputmodules"
6710 _def_tv
='#undef USE_TV'
6714 echocheck
"*BSD BrookTree 848 TV interface"
6715 if test "$_tv_bsdbt848" = auto
; then
6717 if test "$_tv" = yes ; then
6719 #include <sys/types.h>
6720 #if defined(__NetBSD__)
6721 #include <dev/ic/bt8xx.h>
6723 #include <machine/ioctl_bt848.h>
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"
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
6742 if test "$_tv" = yes && linux
; then
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"
6755 _noinputmodules
="tv-v4l $_noinputmodules"
6756 _def_tv_v4l
='#undef HAVE_TV_V4L'
6761 echocheck
"Video 4 Linux 2 TV interface"
6762 if test "$_tv_v4l2" = auto
; then
6764 if test "$_tv" = yes && linux
; then
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"
6778 _noinputmodules
="tv-v4l2 $_noinputmodules"
6779 _def_tv_v4l2
='#undef HAVE_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'
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"
6800 _noinputmodules
="network $_noinputmodules"
6801 _def_network
='#undef MPLAYER_NETWORK'
6807 if not beos
&& test "$_ftp" != no
; then
6808 _def_ftp
='#define HAVE_FTP 1'
6809 _inputmodules
="ftp $_inputmodules"
6811 _noinputmodules
="ftp $_noinputmodules"
6812 _def_ftp
='#undef HAVE_FTP'
6816 echocheck
"vstream client"
6817 if test "$_vstream" = auto
; then
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'
6831 _noinputmodules
="vstream $_noinputmodules"
6832 _def_vstream
='#undef HAVE_VSTREAM'
6837 echocheck
"byte order"
6838 if test "$_big_endian" = auto
; then
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};
6843 return (int)ascii_name;
6847 if strings $TMPO |
grep -l MPlayerBigEndian
>/dev
/null
; then
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'
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'
6869 _def_menu
='#undef HAVE_MENU'
6873 # Check to see if they want QTX codecs enabled
6874 echocheck
"QTX codecs"
6875 if test "$_qtx" = auto
; then
6878 if test "$_qtx" = yes ; then
6879 _def_qtx
='#define USE_QTX_CODECS 1'
6880 _codecmodules
="qtx $_codecmodules"
6882 _def_qtx
='#undef USE_QTX_CODECS'
6883 _nocodecmodules
="qtx $_nocodecmodules"
6888 echocheck
"Subtitles sorting"
6889 if test "$_sortsub" = yes ; then
6890 _def_sortsub
='#define USE_SORTSUB 1'
6892 _def_sortsub
='#undef USE_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
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'
6918 _xmms_lib
="${_xmmslibdir}/libxmms.dylib"
6920 _xmms_lib
="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6923 _def_xmms
='#undef HAVE_XMMS'
6928 if test "$_inet6" = auto
; then
6930 #include <sys/types.h>
6931 #include <sys/socket.h>
6932 int main(void) { socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6939 if test "$_inet6" = yes ; then
6940 _def_inet6
='#define HAVE_AF_INET6 1'
6942 _def_inet6
='#undef HAVE_AF_INET6'
6947 echocheck
"gethostbyname2"
6948 if test "$_gethostbyname2" = auto
; then
6950 #include <sys/types.h>
6951 #include <sys/socket.h>
6953 int main(void) { gethostbyname2("", AF_INET); }
6961 if test "$_gethostbyname2" = yes ; then
6962 _def_gethostbyname2
='#define HAVE_GETHOSTBYNAME2 1'
6964 _def_gethostbyname2
='#undef HAVE_GETHOSTBYNAME2'
6966 echores
"$_gethostbyname2"
6968 # --------------- GUI specific tests begin -------------------
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"
6979 if test "$_x11" = yes ; then
6981 #include <X11/Xlib.h>
6982 #include <X11/Xproto.h>
6983 #include <X11/Xutil.h>
6984 #include <X11/extensions/shape.h>
6987 char *name = ":0.0";
6990 int eventbase, errorbase;
6991 if (getenv("DISPLAY"))
6992 name=getenv("DISPLAY");
6993 wsDisplay=XOpenDisplay(name);
6994 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6996 XCloseDisplay(wsDisplay);
7000 cc_check
$_inc_x11 $_ld_x11 && _xshape
=yes
7002 if test "$_xshape" = yes ; then
7003 _def_xshape
='#define HAVE_XSHAPE 1'
7005 die
"The GUI requires the X11 extension XShape (which was not found)."
7010 if test "$_gtk1" = no
; then
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`
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`
7028 _def_gui
='#define HAVE_NEW_GUI 1'
7029 _def_gtk2_gui
='#define HAVE_GTK2_GUI 1'
7030 _ld_gui
='$(GTKLIB) $(GLIBLIB)'
7033 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7036 echo "GTK-2 devel packages were not found, trying GTK 1.2"
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"
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)"
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"
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 -----------
7085 GLIBINC = $_inc_glib
7086 GLIBLIBS = $_ld_glib
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
7098 elif test -z "$_charset" ; then
7099 if test "$_gtk1" = yes ; then
7100 _charset
=`cat ${_mp_help}.charset`
7105 if test "$_charset" ; then
7106 _def_charset
="#define MSG_CHARSET \"$_charset\""
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
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."
7125 if test "$_charset" = `cat ${_mp_help}.charset` ; then
7126 # hack to disable conversion in the Makefile
7130 #############################################################################
7132 echocheck
"automatic gdb attach"
7133 if test "$_crash_debug" = yes ; then
7134 _def_crash_debug
='#define CRASH_DEBUG 1'
7136 _def_crash_debug
='#undef CRASH_DEBUG'
7139 echores
"$_crash_debug"
7142 CFLAGS
="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -DCONFIG_DARWIN"
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"
7154 # use flag for HPUX missing setenv()
7155 CFLAGS
="$CFLAGS -DHPUX"
7159 CFLAGS
="$CFLAGS -D_REENTRANT"
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"
7176 int main(void) { return 0; }
7178 if cc_check
-fno-PIC ; then
7179 CFLAGS
="-fno-PIC $CFLAGS"
7185 echores
"only used for x86"
7188 echocheck
"compiler support for noexecstack"
7190 int main(void) { return 0; }
7192 if cc_check
-Wl,-z,noexecstack
; then
7193 _ld_extra
="-Wl,-z,noexecstack $_ld_extra"
7199 echocheck
"ftello()"
7200 # if we don't have ftello use the osdep/ compatibility module
7203 #include <sys/types.h>
7204 int main (void) { ftello(stdin); return 0; }
7207 cc_check
&& _ftello
=yes
7208 if test "$_ftello" = yes ; then
7209 _def_ftello
='#define HAVE_FTELLO 1'
7211 _def_ftello
='#undef HAVE_FTELLO'
7215 # Determine OS dependent libs
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__"
7224 _confwin32
='TARGET_WIN32 = yes'
7226 _confwin32
='TARGET_WIN32 = no'
7229 # Dynamic linking flags
7230 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
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"
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
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
7266 _def_vidix
='#define CONFIG_VIDIX 1'
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"
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"
7290 _novomodules
="winvidix $_novomodules"
7292 if test "$_vidix" = yes && test "$_x11" = yes; then
7293 _vosrc
="$_vosrc vo_xvidix.c"
7294 _vomodules
="xvidix $_vomodules"
7296 _novomodules
="xvidix $_novomodules"
7299 echocheck
"joystick"
7300 _def_joystick
='#undef HAVE_JOYSTICK'
7301 if test "$_joystick" = yes ; then
7303 # TODO add some check
7304 _def_joystick
='#define HAVE_JOYSTICK 1'
7306 _joystick
="no (unsupported under $system_name)"
7309 echores
"$_joystick"
7312 if test "$_lirc" = auto
; then
7314 if test -c /dev
/lirc
-o -c /dev
/lirc
/0 ; then
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'
7326 _def_lirc
='#undef HAVE_LIRC'
7331 if test "$_lircc" = auto
; then
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'
7343 _def_lircc
='#undef HAVE_LIRCC'
7347 #############################################################################
7348 echo "Creating config.mak"
7349 cat > config.mak
<< EOF
7350 # -------- Generated by configure -----------
7353 MAN_LANG = $MAN_LANG
7354 TARGET_OS = $system_name
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
7370 EXTRA_INC = $_inc_extra
7371 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
7372 STRIPBINARIES = $_stripbinaries
7374 HELP_FILE = $_mp_help
7377 PRG_MENCODER = $_prg_mencoder
7381 MPLAYER_NETWORK = $_network
7382 STREAMING_LIVE555 = $_live
7383 MPLAYER_NETWORK_LIB = $_ld_live $_ld_vstream $_ld_network
7385 VIDIX = $_vidix_internal
7386 EXTERNAL_VIDIX = $_vidix_external
7387 EXTERNAL_VIDIX_LIB = $_ld_vidix_external
7389 CONFIG_MP3LAME = $_mp3lame
7392 OPENDIVX = $_opendivx
7396 LIBMPEG2 = $_libmpeg2
7397 TREMOR = $_tremor_internal
7398 TREMOR_FLAGS = $_tremor_flags
7401 MUSEPACK = $_musepack
7403 UNRARLIB = $_unrarlib
7408 EXTRA_LIB = $_ld_extra
7409 Z_LIB = $_ld_static $_ld_zlib
7411 WIN32_LIB = $_ld_win32libs
7412 STATIC_LIB = $_ld_static
7413 ENCA_LIB = $_ld_enca
7414 HAVE_PTHREADS = $_pthreads
7416 LIBC_LIB = $_ld_libC
7421 HAVE_XVMC_ACCEL = $_xvmc
7427 LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
7430 X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
7432 MLIB_LIB = $_ld_mlib
7433 MLIB_INC = $_inc_mlib
7434 DXR2_INC = $_inc_dxr2
7440 SVGA_LIB = $_ld_svga
7441 VESA_LIB = $_ld_vesa
7443 CACA_INC = $_inc_caca
7444 CACA_LIB = $_ld_caca
7447 ALSA_LIB = $_ld_alsa
7449 ARTS_LIB = $_ld_arts
7450 ARTS_INC = $_inc_arts
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
7467 DVDREAD_LIB = $_ld_dvdread
7470 W32_DEP = $_dep_win32
7471 W32_LIB = $_ld_win32
7472 DS_DEP = $_dep_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
7486 FAME_LIB = $_ld_fame
7487 MP1E_DEP = $_dep_mp1e
7488 MP1E_LIB = $_ld_mp1e
7489 ARCH_LIB = $_ld_arch $_ld_iconv
7491 XVID_INC = $_inc_xvid
7492 XVID_LIB = $_ld_xvid
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
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
7525 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7526 MACOSX_BUNDLE = $_macosx_bundle
7527 MACOSX_FRAMEWORKS = $_macosx_frameworks
7528 MACOSX_COREVIDEO = $_macosx_corevideo
7530 TOOLAME_EXTRAFLAGS=$_toolame_extraflags
7531 TOOLAME_LIB=$_toolame_lib
7533 TWOLAME_LIB=$_twolame_lib
7534 MUSEPACK_LIB = $_ld_musepack
7539 AMR_NB_FIXED=$_amr_nb_fixed
7541 `echo $_libavcodecs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7543 CONFIG_XVID=$_lavc_xvid
7547 # --- Some stuff for autoconfigure ----
7552 TARGET_MMX2 = $_mmxext
7553 TARGET_3DNOW = $_3dnow
7554 TARGET_3DNOWEX = $_3dnowext
7556 TARGET_ALTIVEC = $_altivec
7558 TARGET_BUILTIN_VECTOR = $_builtin_vector
7559 TARGET_BUILTIN_3DNOW = $_mm3dnow
7563 GTKLIB = $_ld_static $_ld_gtk
7564 GLIBLIB = $_ld_static $_ld_glib
7565 GTK_LIBS = $_ld_static $_ld_gui
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 */
7584 /* name of messages 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)
7602 #define likely(x) (x)
7603 #define unlikely(x) (x)
7606 /* attribute(used) as needed by some compilers */
7607 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7608 # define attribute_used __attribute__((used))
7610 # define attribute_used
7613 #define PREFIX "$_prefix"
7618 /* enable/disable SIGHANDLER */
7621 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7624 /* Toggles debugging informations */
7627 /* Toggles colorized output */
7628 //#define MSG_USE_COLORS 1
7630 /* Indicates that libcdio is available for VCD and CD-DA playback */
7633 /* Indicates that Ogle's libdvdread is available for DVD playback */
7636 /* Indicates that dvdread is from libmpdvdkit */
7639 /* Additional options for libmpdvdkit*/
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 */
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! */
7670 /* Define if you are using DivX5Linux Decore library */
7673 /* Define if you are using XviD library */
7679 /* Define if you are using the X.264 library */
7682 /* Define to include support for libdv-0.9.5 */
7685 /* If build mencoder */
7688 /* Indicates if XviD/Divx4linux encore is available
7689 Note: for mencoder */
7692 /* Indicates if libmp3lame is available
7693 Note: for mencoder */
7695 $_def_mp3lame_preset
7696 $_def_mp3lame_preset_medium
7698 /* Define libmp1e for realtime mpeg encoding (for DXR3 and DVB cards) */
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! */
7718 /* define this to use iconv(3) function to codepage conversions */
7721 /* define this to use nl_langinfo function */
7724 /* define this to use RTC (/dev/rtc) for video timers */
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 */
7736 /* Define this if your system has the header file for the OSS sound interface
7737 * in /usr/include */
7740 /* Define this if your system has the sysinfo header */
7743 /* Define this if your system has ftello() */
7747 /* Need these for FILE and off_t an config.h is usually before other includes*/
7749 #include <sys/types.h>
7750 off_t ftello(FILE *);
7753 /* Define this if your system has the "malloc.h" header file */
7756 /* memalign is mapped to malloc if unsupported */
7758 #ifndef HAVE_MEMALIGN
7759 # define memalign(a,b) malloc(b)
7760 #define MEMALIGN_HACK 1
7763 /* Define this if your system has the "alloca.h" header file */
7766 /* Define this if your system has the "sys/mman.h" header file */
7768 $_def_mman_has_map_failed
7770 /* Define this if you have the elf dynamic linker -ldl library */
7773 /* Define this if you have the kstat kernel statistics library */
7776 /* Define this if you have zlib */
7779 #define CONFIG_ZLIB 1
7782 /* Define this if you have shm support */
7785 /* Define this if your system has scandir & alphasort */
7788 /* Define this if your system has strsep */
7791 /* Define this if your system has strlcpy */
7793 #ifndef HAVE_STRLCPY
7794 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7797 /* Define this if your system has strlcat */
7799 #ifndef HAVE_STRLCAT
7800 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7803 /* Define this if your system has fseeko */
7806 /* Need these for FILE and off_t an config.h is usually before other includes*/
7808 #include <sys/types.h>
7809 int fseeko(FILE *, off_t, int);
7814 /* Define this if your system has vsscanf */
7817 /* Define this if your system has swab */
7820 /* Define this if your system has no posix select */
7821 $_def_no_posix_select
7823 /* Define this if your system has gettimeofday */
7826 /* Define this if your system has glob */
7829 /* Define this if your system has setenv */
7832 int setenv(const char *name, const char *val, int overwrite);
7835 /* Define this if your system has sysi86 */
7838 /* Define this if your system has pthreads */
7841 /* Define this if you enabled thread support for libavcodec */
7844 /* LIRC (remote control, see www.lirc.org) support: */
7848 * LIRCCD (LIRC client daemon)
7849 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7853 /* DVD navigation support using libdvdnav */
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!) */
7862 $_def_libpostproc_so
7864 /* Define to include support for OpenDivx postprocessing */
7865 $_def_odivx_postprocess
7867 /* Win32 DLL support */
7869 #define WIN32_PATH "$_win32libdir"
7871 /* DirectShow support */
7874 /* Mac OS X specific features */
7876 $_def_macosx_finder_support
7878 $_def_macosx_corevideo
7880 /* Build our Win32-loader */
7883 /* ffmpeg's libavcodec support (requires libavcodec source) */
7888 /* ffmpeg's libavformat support (requires libavformat source) */
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) */
7913 /* Use specific codecs from libavcodec */
7914 `echo $_libavcodecs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7919 /* Use codec libs included in mplayer CVS / source dist: */
7925 /* Use libfame encoder filter */
7928 /* XAnim DLL support */
7930 /* Default search path */
7933 /* RealPlayer DLL support */
7935 /* Default search path */
7938 /* LIVE555 Streaming Media library support */
7941 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
7944 /* Use unrarlib for Vobsubs */
7947 /* gui support, please do not edit this option */
7951 /* Audio output drivers */
7953 $_def_ossaudio_devdsp
7954 $_def_ossaudio_devmixer
7964 $_def_sys_asoundlib_h
7965 $_def_alsa_asoundlib_h
7971 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7973 #undef FAST_OSD_TABLE
7975 /* Enable TV Interface support */
7978 /* Enable Video 4 Linux TV interface support */
7981 /* Enable Video 4 Linux 2 TV interface support */
7984 /* Enable *BSD BrookTree TV interface support */
7987 /* Define if your processor stores words with the most significant
7988 byte first (like Motorola and SPARC, unlike Intel and VAX). */
7993 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
7994 have the instruction. */
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.
8004 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
8009 /* only gcc3 can compile mvi instructions */
8010 $_def_gcc_mvi_support
8012 /* Define this for Cygwin build for win32 */
8015 /* Define this to any prefered value from 386 up to infinity with step 100 */
8016 #define __CPU__ $iproc
8025 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
8026 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
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
8043 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
8044 #define DEFAULT_DVD_DEVICE "/dev/dvd"
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 */
8059 /* round function is available */
8062 /* yes, we have inttypes.h */
8063 #define HAVE_INTTYPES_H 1
8065 /* int_fastXY_t emulation */
8068 /* nanosleep support */
8074 /* termcap flag for getch2.c */
8077 /* termios flag for getch2.c */
8082 /* enable PNG support */
8085 /* enable JPEG support */
8088 /* enable PNM support */
8091 /* enable md5sum support */
8094 /* enable GIF support */
8099 /* enable FreeType support */
8102 /* enable Fontconfig support */
8105 /* enable FriBiDi usage */
8108 /* enable ENCA usage */
8111 /* liblzo support */
8114 #define CONFIG_LZO 1
8117 /* libmad support */
8120 /* enable OggVorbis support */
8123 /* enable Tremor as vorbis decoder */
8126 /* enable Speex support */
8129 /* enable musepack support */
8132 /* enable OggTheora support */
8135 /* enable FAAD (AAC) support */
8139 /* enable FAAC (AAC encoder) support */
8142 /* enable LADSPA plugin support */
8145 /* enable network */
8148 /* enable ftp support */
8151 /* enable vstream support */
8154 /* enable winsock2 instead of Unix functions*/
8157 /* define this to use inet_aton() instead of inet_pton() */
8160 /* enables / disables cdparanoia support */
8163 /* enables / disables VIDIX usage */
8167 /* enables / disables new input joystick support */
8170 /* enables / disables QTX codecs */
8173 /* enables / disables osd menu */
8176 /* enables / disables subtitles sorting */
8179 /* XMMS input plugin support */
8181 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8183 /* enables inet6 support */
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 */
8208 #define LIBMPEG2_MLIB 1
8212 #define SCREEN_SIZE_X 1
8213 #define SCREEN_SIZE_Y 1
8225 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
8235 $_def_directfb_version
8258 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
8259 #define X11_FULLSCREEN 1
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 > libao
2/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 #############################################################################
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
8309 Messages/GUI: $_language
8312 echo -n " Manual pages: $MAN_LANG"
8313 test "$LANGUAGES" = en
&& echo -n " (no localization selected, use --language=all)"
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)"
8346 if test "$_sdl" = "outdated" ; then
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.
8363 if test "$_win32" = no
; then
8364 if test "$_win32libdir" ; then
8365 echo "Failed to find a Win32 codecs dir at $_win32libdir!"
8367 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
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/
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.
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
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
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>'
8418 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"