make it possible to select the monitor even when in nonexclusive mode, based on patch...
[mplayer.git] / configure
blob2c00d023b4574806cfaa0f4fb52f51232d13e5a8
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: check the cvs log !
8 # Cleanups all over the place (c) 2001 pl
11 # Guidelines:
12 # If the option is named 'opt':
13 # _opt : should have a value in yes/no/auto
14 # _def_opt : '#define ... 1' or '#undef ...' that is: some C code
15 # _ld_opt : ' -L/path/dir -lopt ' that is: some GCC option
16 # _inc_opt : ' -I/path/dir/include '
18 # In this file, a tab is 8 chars and indentation shift is 2 characters
20 # GOTCHAS:
21 # - config files are currently:
22 # config.h config.mak libvo/config.mak libao2/config.mak Gui/config.mak
24 #############################################################################
26 # Prefer these macros to full length text !
27 # These macros only return an error code - NO display is done
28 cc_check() {
29 echo >> "$TMPLOG"
30 cat "$TMPC" >> "$TMPLOG"
31 echo >> "$TMPLOG"
32 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $TMPC -o $TMPO $@" >> "$TMPLOG"
33 rm -f "$TMPO"
34 ( $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra "$TMPC" -o "$TMPO" "$@" ) >> "$TMPLOG" 2>&1
35 TMP="$?"
36 echo >> "$TMPLOG"
37 echo "ldd $TMPO" >> "$TMPLOG"
38 ( $_ldd "$TMPO" ) >> "$TMPLOG" 2>&1
39 echo >> "$TMPLOG"
40 return "$TMP"
43 # Display error message, flushes tempfile, exit
44 die () {
45 echo
46 echo "Error: $@" >&2
47 echo >&2
48 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
49 echo "Check \"$TMPLOG\" if you do not understand why it failed."
50 exit 1
53 # OS test booleans functions
54 issystem() {
55 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
57 linux() { issystem "Linux" ; return "$?" ; }
58 sunos() { issystem "SunOS" ; return "$?" ; }
59 hpux() { issystem "HP-UX" ; return "$?" ; }
60 irix() { issystem "IRIX" ; return "$?" ; }
61 cygwin() { issystem "CYGWIN" ; return "$?" ; }
62 freebsd() { issystem "FreeBSD" ; return "$?" ; }
63 netbsd() { issystem "NetBSD" ; return "$?" ; }
64 bsdos() { issystem "BSD/OS" ; return "$?" ; }
65 openbsd() { issystem "OpenBSD" ; return "$?" ; }
66 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
67 qnx() { issystem "QNX" ; return "$?" ; }
68 darwin() { issystem "Darwin" ; return "$?" ; }
69 gnu() { issystem "GNU" ; return "$?" ; }
70 mingw32() { issystem "MINGW32" ; return "$?" ; }
71 morphos() { issystem "MorphOS" ; return "$?" ; }
72 win32() { cygwin || mingw32 ; return "$?" ; }
73 beos() { issystem "BEOS" ; return "$?" ; }
75 # arch test boolean functions
76 # x86/x86pc is used by QNX
77 x86() {
78 case "$host_arch" in
79 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
80 *) return 1 ;;
81 esac
84 ppc() {
85 case "$host_arch" in
86 ppc) return 0;;
87 *) return 1;;
88 esac
91 alpha() {
92 case "$host_arch" in
93 alpha) return 0;;
94 *) return 1;;
95 esac
98 # not boolean test: implement the posix shell "!" operator for a
99 # non-posix /bin/sh.
100 # usage: not {command}
101 # returns exit status "success" when the execution of "command"
102 # fails.
103 not() {
104 eval "$@"
105 test $? -ne 0
108 # Use this before starting a check
109 echocheck() {
110 echo "============ Checking for $@ ============" >> "$TMPLOG"
111 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
114 # Use this to echo the results of a check
115 echores() {
116 echo "Result is: $@" >> "$TMPLOG"
117 echo "##########################################" >> "$TMPLOG"
118 echo "" >> "$TMPLOG"
119 echo "$@"
121 #############################################################################
123 # Check how echo works in this /bin/sh
124 case `echo -n` in
125 -n) _echo_n= _echo_c='\c' ;; # SysV echo
126 *) _echo_n='-n ' _echo_c= ;; # BSD echo
127 esac
129 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"`
131 for parm in "$@" ; do
132 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
133 cat << EOF
135 Usage: $0 [OPTIONS]...
137 Configuration:
138 -h, --help display this help and exit
140 Installation directories:
141 --prefix=DIR use this prefix for installing mplayer [/usr/local]
142 --bindir=DIR use this prefix for installing mplayer binary
143 [PREFIX/bin]
144 --datadir=DIR use this prefix for installing machine independent
145 data files (fonts, skins) [PREFIX/share/mplayer]
146 --mandir=DIR use this prefix for installing manpages [PREFIX/man]
147 --confdir=DIR use this prefix for installing configuration files
148 [PREFIX/etc/mplayer]
149 --libdir=DIR use this prefix for object code libraries [PREFIX/lib]
151 Optional features:
152 --disable-mencoder disable mencoder (a/v encoder) compilation [enable]
153 --enable-gui enable gmplayer compilation (GTK 1.2 GUI) [disable]
154 --enable-largefiles enable support for files > 2 GBytes [disable]
155 --enable-linux-devfs set default devices to devfs ones [disable]
156 --enable-termcap use termcap database for key codes [autodetect]
157 --enable-termios use termios database for key codes [autodetect]
158 --disable-iconv do not use iconv(3) function [autodetect]
159 --disable-setlocale disable setlocale using in mplayer [autodetect]
160 --disable-langinfo do not use langinfo [autodetect]
161 --enable-lirc enable LIRC (remote control) support [autodetect]
162 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
163 --enable-joystick enable joystick support [disable]
164 --disable-tv disable TV Interface (tv/dvb grabbers) [enable]
165 --disable-tv-v4l disable Video4Linux TV Interface support [autodetect]
166 --disable-tv-v4l2 disable Video4Linux2 TV Interface support [autodetect]
167 --disable-tv-bsdbt848 disable BSD BT848 Interface support [autodetect]
168 --disable-edl disable EDL (edit decision list) support [enable]
169 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
170 --disable-network disable network support (for: http/mms/rtp) [enable]
171 --enable-winsock2 enable winsock2 usage [autodetect]
172 --enable-smb enable Samba (SMB) input support [autodetect]
173 --enable-live enable LIVE.COM Streaming Media support [autodetect]
174 --disable-dvdread Disable libdvdread support [autodetect]
175 --disable-mpdvdkit Disable mpdvdkit/mpdvdkit2 support [autodetect]
176 --disable-cdparanoia Disable cdparanoia support [autodetect]
177 --disable-freetype Disable freetype2 font rendering support [autodetect]
178 --disable-fontconfig Disable fontconfig font lookup support [autodetect]
179 --disable-unrarlib Disable Unique RAR File Library [enabled]
180 --enable-menu Enable OSD menu support (NOT DVD MENU) [disabled]
181 --disable-sortsub Disable subtitles sorting [enabled]
182 --enable-fribidi Enable using the FriBiDi libs [disabled]
183 --disable-enca Disable using ENCA charset oracle library [autodetect]
184 --disable-macosx Disable Mac OS X specific features [autodetect]
185 --disable-inet6 Disable IPv6 support [autodetect]
186 --disable-gethostbyname2 gethostbyname() function is not provided by the C
187 library [autodetect]
188 --disable-ftp Disable ftp support [enabled]
190 Codecs:
191 --enable-gif enable gif support [autodetect]
192 --enable-png enable png input/output support [autodetect]
193 --enable-jpeg enable jpeg input/output support [autodetect]
194 --enable-liblzo enable external liblzo support [autodetect]
195 --disable-win32 disable Win32 DLL support [autodetect]
196 --disable-macshlb disable Mac OS X SHLB support [autodetect]
197 --disable-dshow disable Win32/DirectShow support [autodetect]
198 --disable-qtx disable Quicktime codecs [autodetect]
199 --disable-xanim disable XAnim DLL support [autodetect]
200 --disable-real disable RealPlayer DLL support [autodetect]
201 --disable-xvid disable XviD codec [autodetect]
202 --disable-x264 disable H.264 encoder [autodetect]
203 --disable-divx4linux disable DivX4linux/Divx5linux codec [autodetect]
204 --enable-opendivx enable _old_ OpenDivx codec [disable]
205 --disable-libavcodec disable libavcodec [autodetect]
206 --disable-libavformat disable libavformat [autodetect]
207 --enable-libfame enable libfame realtime encoder [autodetect]
208 --enable-vorbis build with OggVorbis support [autodetect]
209 --enable-tremor build with integer-only OggVorbis support [disabled]
210 --enable-theora build with OggTheora support [autodetect]
211 --disable-internal-matroska disable internal Matroska support [enabled]
212 --enable-external-faad build with external FAAD2 (AAC) support [autodetect]
213 --disable-internal-faad disable internal FAAD2 (AAC) support [autodetect]
214 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
215 --disable-mad disable libmad (MPEG audio) support [autodetect]
216 --disable-toolame disable Toolame (MPEG layer 2 audio) support in mencoder [autodetect]
217 --enable-xmms build with XMMS inputplugin support [disabled]
218 --disable-mp3lib disable builtin mp3lib [enabled]
219 --disable-liba52 disable builtin liba52 [enabled]
220 --enable-libdts enable libdts support [autodetect]
221 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
223 Video output:
224 --disable-vidix disable VIDIX [enable on x86 *nix]
225 --enable-gl build with OpenGL render support [autodetect]
226 --enable-dga[=n] build with DGA [n in {1, 2} ] support [autodetect]
227 --enable-vesa build with VESA support [autodetect]
228 --enable-svga build with SVGAlib support [autodetect]
229 --enable-sdl build with SDL render support [autodetect]
230 --enable-aa build with AAlib render support [autodetect]
231 --enable-caca build with CACA render support [autodetect]
232 --enable-ggi build with GGI render support [autodetect]
233 --enable-directx build with DirectX support [autodetect]
234 --enable-dxr2 build with DXR2 render support [autodetect]
235 --enable-dxr3 build with DXR3/H+ render support [autodetect]
236 --enable-dvb build with support for output via DVB-Card [autodetect]
237 --enable-dvbhead build with DVB support (HEAD version) [autodetect]
238 --enable-mga build with mga_vid (for Matrox G200/G4x0/G550) support
239 (check for /dev/mga_vid) [autodetect]
240 --enable-xmga build with mga_vid X Window support
241 (check for X & /dev/mga_vid) [autodetect]
242 --enable-xv build with Xv render support for X 4.x [autodetect]
243 --enable-xvmc build with XvMC acceleration for X 4.x [autodetect]
244 --enable-vm build with XF86VidMode support for X11 [autodetect]
245 --enable-xinerama build with Xinerama support for X11 [autodetect]
246 --enable-x11 build with X11 render support [autodetect]
247 --enable-fbdev build with FBDev render support [autodetect]
248 --enable-mlib build with MLIB support (Solaris only) [autodetect]
249 --enable-3dfx build with obsolete /dev/3dfx support [disable]
250 --enable-tdfxfb build with tdfxfb (Voodoo 3/banshee) support [disable]
251 --enable-directfb build with DirectFB support [autodetect]
252 --enable-zr build with ZR360[56]7/ZR36060 support [autodetect]
253 --enable-bl build with Blinkenlights support [disable]
254 --enable-tdfxvid build with tdfx_vid support [disable]
255 --disable-tga disable targa output support [enable]
256 --disable-pnm disable pnm output support [enable]
257 --disable-md5sum disable md5sum output support [enable]
259 Audio output:
260 --disable-alsa disable ALSA sound support [autodetect]
261 --disable-ossaudio disable OSS sound support [autodetect]
262 --disable-arts disable aRts sound support [autodetect]
263 --disable-esd disable esd sound support [autodetect]
264 --disable-jack disable JACK sound support [autodetect]
265 --disable-nas disable NAS sound support [autodetect]
266 --disable-sgiaudio disable SGI sound support [autodetect]
267 --disable-sunaudio disable Sun sound support [autodetect]
268 --disable-win32waveout disable Windows waveout sound support [autodetect]
269 --disable-select disable using select() on audio device [enable]
271 Miscellaneous options:
272 --enable-runtime-cpudetection Enable runtime CPU detection [disable]
273 --cc=COMPILER use this C compiler to build MPlayer [gcc]
274 --host-cc=COMPILER use this C compiler to build apps needed for the build process [gcc]
275 --as=ASSEMBLER use this assembler to build MPlayer [as]
276 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
277 --enable-static build a statically linked binary. Set further linking
278 options with --enable-static="-lslang -lncurses"
279 --language=list a white space or comma separated list of languages
280 for translated man pages, the first language is the
281 primary and therefore used for translated messages
282 and GUI (also the environment variable \$LINGUAS is
283 honored) [en]
284 (Available: $LANGUAGES all)
285 --enable-shared-pp install & use shared postprocessing lib
286 --with-install=PATH use a custom install program (useful if your OS uses
287 a GNU-incompatible install utility by default and
288 you want to use GNU version)
289 --install-path=PATH the path to a custom install program
290 this option is obsolete and will be removed soon,
291 use --with-install instead.
293 Advanced options:
294 --enable-mmx build with MMX support [autodetect]
295 --enable-mmx2 build with MMX2 support (PIII, Athlon) [autodetect]
296 --enable-3dnow build with 3DNow! support [autodetect]
297 --enable-3dnowex build with extended 3DNow! support [autodetect]
298 --enable-sse build with SSE support [autodetect]
299 --enable-sse2 build with SSE2 support [autodetect]
300 --enable-shm build with shm support [autodetect]
301 --enable-altivec build with Altivec support (PowerPC) [autodetect]
302 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy() [enable]
303 --enable-big-endian Force byte order to big-endian [autodetect]
304 --enable-debug[=1-3] compile debugging information into mplayer [disable]
305 --enable-profile compile profiling information into mplayer [disable]
306 --disable-sighandler disable sighandler for crashes [enable]
307 --enable-i18n _experimental_ gnu gettext() support [autodetect]
308 --enable-dynamic-plugins Enable support for dynamic a/v plugins [disable]
310 Hazardous options a.k.a. "DO NOT REPORT ANY BUGS!"
311 --disable-gcc-checking disable gcc version checking [enable]
313 Use these options if autodetection fails (Options marked with (*) accept
314 multiple paths separated by ':'):
315 --with-extraincdir=DIR extra headers (png, mad, sdl, ...) in DIR (*)
316 --with-extralibdir=DIR extra library files (png, mad, sdl, ...) in DIR (*)
317 --with-x11incdir=DIR X headers in DIR (*)
318 --with-x11libdir=DIR X library files in DIR (*)
319 --with-dxr2incdir=DIR DXR2 headers in DIR (*)
320 --with-dvbincdir=DIR DVB headers in DIR (*)
321 --with-madlibdir=DIR libmad (libmad shared library) in DIR (*)
322 --with-mlibdir=DIR libmlib (MLIB support) in DIR (Solaris only)
323 --with-codecsdir=DIR Binary codec files in DIR
324 --with-win32libdir=DIR W*ndows DLL files in DIR
325 --with-xanimlibdir=DIR XAnim DLL files in DIR
326 --with-reallibdir=DIR RealPlayer DLL files in DIR
327 --with-xvidlibdir=DIR libxvidcore (XviD) in DIR (*)
328 --with-xvidincdir=DIR XviD header in DIR (*)
329 --with-x264libdir=DIR libx264 in DIR
330 --with-x264incdir=DIR x264 header in DIR
331 --with-dtslibdir=DIR libdts library in DIR (*)
332 --with-dtsincdir=DIR libdts header in DIR (*)
333 --with-livelibdir=DIR LIVE.COM Streaming Media libraries in DIR
334 --with-toolamedir=DIR path to Toolame library and include file
335 --with-xmmsplugindir=DIR XMMS plugins in DIR
336 --with-xmmslibdir=DIR libxmms.so.1 in DIR
337 --with-bio2jack=DIR libbio2jack.a in DIR
338 --with-cdparanoiaincdir=DIR cdparanoia headers in DIR (*)
339 --with-cdparanoialibdir=DIR cdparanoia libraries (libcdda_*) in DIR (*)
340 --with-xvmclib=NAME name of adapter-specific library (e.g. XvMCNVIDIA)
341 --with-termcaplib=NAME name of library with termcap functionality
342 name should be given without leading "lib"
343 checks for "termcap" and "tinfo"
345 --with-freetype-config=PATH path to freetype-config
346 (e.g. /opt/bin/freetype-config)
347 --with-fribidi-config=PATH path to fribidi-config
348 (e.g. /opt/bin/fribidi-config)
349 --with-glib-config=PATH path to glib*-config (e.g. /opt/bin/glib-config)
350 --with-gtk-config=PATH path to gtk*-config (e.g. /opt/bin/gtk-config)
351 --with-sdl-config=PATH path to sdl*-config (e.g. /opt/bin/sdl-config)
353 exit 0
355 done # for parm in ...
358 # 1st pass checking for vital options
359 _install=install
360 _ranlib=ranlib
361 _cc=cc
362 test "$CC" && _cc="$CC"
363 _as=auto
364 _runtime_cpudetection=no
365 for ac_option do
366 case "$ac_option" in
367 --target=*)
368 _target=`echo $ac_option | cut -d '=' -f 2`
370 --cc=*)
371 _cc=`echo $ac_option | cut -d '=' -f 2`
373 --host-cc=*)
374 _host_cc=`echo $ac_option | cut -d '=' -f 2`
376 --as=*)
377 _as=`echo $ac_option | cut -d '=' -f 2`
379 --enable-gcc-checking)
380 _skip_cc_check=no
382 --disable-gcc-checking)
383 _skip_cc_check=yes
385 --enable-static)
386 _ld_static='-static'
388 --disable-static)
389 _ld_static=''
391 --enable-static=*)
392 _ld_static="-static `echo $ac_option | cut -d '=' -f 2`"
394 --with-extraincdir=*)
395 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
397 --with-extralibdir=*)
398 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
400 --enable-runtime-cpudetection)
401 _runtime_cpudetection=yes
403 --disable-runtime-cpudetection)
404 _runtime_cpudetection=no
406 --install-path=*)
407 _install=`echo $ac_option | cut -d '=' -f 2 | sed 's/\/$//'`"/install"
409 --with-install=*)
410 _install=`echo $ac_option | cut -d '=' -f 2 `
412 esac
413 done
415 # Determine our OS name and CPU architecture
416 if test -z "$_target" ; then
417 # OS name
418 system_name=`( uname -s ) 2>&1`
419 case "$system_name" in
420 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
422 IRIX*)
423 system_name=IRIX
425 HP-UX*)
426 system_name=HP-UX
428 [cC][yY][gG][wW][iI][nN]*)
429 system_name=CYGWIN
431 MINGW32*)
432 system_name=MINGW32
434 MorphOS)
435 system_name=MorphOS
438 system_name="$system_name-UNKNOWN"
440 esac
443 # host's CPU/instruction set
444 host_arch=`( uname -p ) 2>&1`
445 case "$host_arch" in
446 i386|sparc|ppc|alpha|arm|mips|vax)
448 powerpc) # Darwin returns 'powerpc'
449 host_arch=ppc
451 *) # uname -p on Linux returns 'unknown' for the processor type,
452 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
454 # Maybe uname -m (machine hardware name) returns something we
455 # recognize.
457 # x86/x86pc is used by QNX
458 case "`( uname -m ) 2>&1`" in
459 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 ;;
460 ia64) host_arch=ia64 ;;
461 x86_64|amd64)
462 if [ "`$_cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
463 -z "`echo $CFLAGS | grep -- -m32`" ]; then
464 host_arch=x86_64
465 else
466 host_arch=i386
469 macppc|ppc) host_arch=ppc ;;
470 alpha) host_arch=alpha ;;
471 sparc) host_arch=sparc ;;
472 sparc64) host_arch=sparc64 ;;
473 parisc*|hppa*|9000*) host_arch=hppa ;;
474 arm*) host_arch=arm ;;
475 s390) host_arch=s390 ;;
476 s390x) host_arch=s390x ;;
477 mips) host_arch=mips ;;
478 vax) host_arch=vax ;;
479 *) host_arch=UNKNOWN ;;
480 esac
482 esac
483 else
484 system_name=`echo $_target | cut -d '-' -f 2`
485 case "`echo $system_name | tr A-Z a-z`" in
486 linux) system_name=Linux ;;
487 freebsd) system_name=FreeBSD ;;
488 netbsd) system_name=NetBSD ;;
489 bsd/os) system_name=BSD/OS ;;
490 openbsd) system_name=OpenBSD ;;
491 sunos) system_name=SunOS ;;
492 qnx) system_name=QNX ;;
493 morphos) system_name=MorphOS ;;
494 mingw32msvc) system_name=MINGW32 ;;
495 esac
496 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
497 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
500 echo "Detected operating system: $system_name"
501 echo "Detected host architecture: $host_arch"
503 # LGB: temporary files
504 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
505 test "$I" && break
506 done
508 TMPLOG="configure.log"
509 rm -f "$TMPLOG"
510 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
511 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
512 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
513 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
515 # config files
517 # FIXME: A lot of stuff is installed under /usr/local
518 # NK: But we should never use this stuff implicitly since we call compiler
519 # from /usr we should be sure that there no effects from other compilers
520 # (libraries) which might be installed into /usr/local. Let users use this
521 # stuff explicitly as command line argument. In other words: It would be
522 # resonable to have only /usr/include or only /usr/local/include.
524 if freebsd ; then
525 _ld_extra="$_ld_extra -L/usr/local/lib"
526 _inc_extra="$_inc_extra -I/usr/local/include"
529 if netbsd ; then
530 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
531 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
532 done
533 _ld_extra=$tmp
536 _ldd=ldd
537 if darwin; then
538 _ldd="otool -L"
541 # Checking CC version...
542 if test "$_skip_cc_check" != yes ; then
543 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
544 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
545 echocheck "$_cc version"
546 cc_vendor=intel
547 cc_name=`( $_cc -V ) 2>&1 | head -1 | cut -d ',' -f 1`
548 cc_version=`( $_cc -V ) 2>&1 | head -1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
549 _cc_major=`echo $cc_version | cut -d '.' -f 1`
550 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
551 # TODO verify older icc/ecc compatibility
552 case $cc_version in
554 cc_version="v. ?.??, bad"
555 cc_verc_fail=yes
557 8.0)
558 cc_version="$cc_version, ok"
559 cc_verc_fail=no
562 cc_version="$cc_version, bad"
563 cc_verc_fail=yes
565 esac
566 echores "$cc_version"
567 else
568 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
569 echocheck "$_cc version"
570 cc_vendor=gnu
571 cc_name=`( $_cc -v ) 2>&1 | tail -1 | cut -d ' ' -f 1`
572 cc_version=`( $_cc -dumpversion ) 2>&1`
573 if test "$?" -gt 0; then
574 cc_version="not found"
576 case $cc_version in
578 cc_version="v. ?.??, bad"
579 cc_verc_fail=yes
581 2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9])
582 _cc_major=`echo $cc_version | cut -d '.' -f 1`
583 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
584 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
585 cc_version="$cc_version, ok"
586 cc_verc_fail=no
588 'not found')
589 cc_verc_fail=yes
592 cc_version="$cc_version, bad"
593 cc_verc_fail=yes
595 esac
596 echores "$cc_version"
597 (test "$cc_verc_fail" = "no") && break
598 done
599 fi # icc
600 if test "$cc_verc_fail" = yes ; then
601 cat <<EOF
603 *** Please downgrade/upgrade C compiler to version gcc-2.95.x or gcc-3.x! ***
605 You are not using a supported compiler. We do not have the time to make sure
606 everything works with compilers other than the ones we use. Use either the
607 same compiler as we do, or use --disable-gcc-checking but DO *NOT* REPORT BUGS
608 unless you can reproduce them after recompiling with a 2.95.x or 3.x version!
610 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
611 mplayer and lame (which is used for mencoder). If you get compile errors,
612 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
613 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
614 bugs!
616 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
618 *** For details please read DOCS/HTML/en/users-vs-dev.html ***
621 die "Bad gcc version"
623 else
624 cat <<EOF
626 ******************************************************************************
628 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
629 Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???
631 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
632 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
633 Lame which is used by mencoder produces weird errors, too.
635 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
636 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
638 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
640 ******************************************************************************
644 read _answer
647 echocheck "host cc"
648 if not test "$_host_cc" ; then
649 _host_cc=$_cc
651 echores $_host_cc
654 # ---
656 # now that we know what compiler should be used for compilation, try to find
657 # out which assembler is used by the $_cc compiler
658 if test "$_as" = auto ; then
659 _as=`$_cc -print-prog-name=as`
660 test -z "$_as" && _as=as
663 # XXX: this should be ok..
664 _cpuinfo="echo"
665 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
666 # FIXME: Remove the cygwin check once AMD CPUs are supported
667 if test -r /proc/cpuinfo && not cygwin; then
668 # Linux with /proc mounted, extract CPU information from it
669 _cpuinfo="cat /proc/cpuinfo"
670 elif test -r /compat/linux/proc/cpuinfo && not x86 ; then
671 # FreeBSD with Linux emulation /proc mounted,
672 # extract CPU information from it
673 _cpuinfo="cat /compat/linux/proc/cpuinfo"
674 elif darwin ; then
675 # use hostinfo on Darwin
676 _cpuinfo="hostinfo"
677 elif x86; then
678 # all other OSes try to extract CPU information from a small helper
679 # program TOOLS/cpuinfo instead
680 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
681 _cpuinfo="TOOLS/cpuinfo"
684 x86_exts_check()
686 pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | head -1`
687 if test -z "$pparam" ; then
688 pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | head -1`
691 _mmx=no
692 _3dnow=no
693 _3dnowex=no
694 _mmx2=no
695 _sse=no
696 _sse2=no
697 _mtrr=no
699 for i in $pparam ; do
700 case "$i" in
701 3dnow) _3dnow=yes ;;
702 3dnowext) _3dnow=yes _3dnowex=yes ;;
703 mmx) _mmx=yes ;;
704 mmxext) _mmx2=yes ;;
705 mtrr|k6_mtrr|cyrix_arr) _mtrr=yes ;;
706 xmm|sse|kni) _sse=yes _mmx2=yes ;;
707 sse2) _sse2=yes ;;
708 esac
709 done
712 case "$host_arch" in
713 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
714 _def_arch="#define ARCH_X86 1"
715 _target_arch="TARGET_ARCH_X86 = yes"
717 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1`
718 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
719 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
720 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
721 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
723 x86_exts_check
725 echocheck "CPU vendor"
726 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
728 echocheck "CPU type"
729 echores "$pname"
731 case "$pvendor" in
732 AuthenticAMD)
733 case "$pfamily" in
734 3) proc=i386 iproc=386 ;;
735 4) proc=i486 iproc=486 ;;
736 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
737 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
738 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
739 proc=k6-3
740 elif test "$pmodel" -ge 8; then
741 proc=k6-2
742 elif test "$pmodel" -ge 6; then
743 proc=k6
744 else
745 proc=i586
746 iproc=586
749 6) iproc=686
750 if test "$pmodel" -ge 7; then
751 proc=athlon-4
752 elif test "$pmodel" -ge 6; then
753 # only Athlon XP supports ssem MP, Duron etc not
754 # but most of them are CPUID 666, so check if sse detected
755 # btw. there is also athlon-mp opt, but we need extended
756 # CPUID to detect if CPU is SMP capable -> athlon-mp ::atmos
757 if test "$_sse" = yes && test "$pstepping" -ge 2; then
758 proc=athlon-xp
759 else
760 proc=athlon-4
762 elif test "$pmodel" -ge 4; then
763 proc=athlon-tbird
764 else
765 proc=athlon # TODO: should the Duron Spitfire be considered a Thunderbird instead?
769 *) proc=athlon-xp iproc=686 ;;
770 esac
772 GenuineIntel)
773 case "$pfamily" in
774 3) proc=i386 iproc=386 ;;
775 4) proc=i486 iproc=486 ;;
776 5) iproc=586
777 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
778 proc=pentium-mmx # 4 is desktop, 8 is mobile
779 else
780 proc=i586
783 6) iproc=686
784 if test "$pmodel" -ge 7; then
785 proc=pentium3
786 elif test "$pmodel" -ge 3; then
787 proc=pentium2
788 else
789 proc=i686
792 15) proc=pentium4 iproc=686 ;;
793 *) proc=pentium4 iproc=686 ;;
794 esac
796 unknown)
797 case "$pfamily" in
798 3) proc=i386 iproc=386 ;;
799 4) proc=i486 iproc=486 ;;
800 *) proc=i586 iproc=586 ;;
801 esac
804 proc=i586 iproc=586 ;;
805 esac
807 # check that gcc supports our CPU, if not, fall back to earlier ones
808 # LGB: check -mcpu and -march swithing step by step with enabling
809 # to fall back till 386.
811 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
813 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
814 cpuopt=-mtune
815 else
816 cpuopt=-mcpu
819 echocheck "GCC & CPU optimization abilities"
820 cat > $TMPC << EOF
821 int main(void) { return 0; }
823 if test "$_runtime_cpudetection" = no ; then
824 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" || test "$proc" = "athlon-tbird"; then
825 cc_check -march=$proc $cpuopt=$proc || proc=athlon
827 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
828 cc_check -march=$proc $cpuopt=$proc || proc=k6
830 if test "$proc" = "k6"; then
831 if not cc_check -march=$proc $cpuopt=$proc; then
832 if cc_check -march=i586 $cpuopt=i686; then
833 proc=i586-i686
834 else
835 proc=i586
839 if test "$proc" = "pentium4" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon"; then
840 cc_check -march=$proc $cpuopt=$proc || proc=i686
842 if test "$proc" = "i686" || test "$proc" = "pentium-mmx"; then
843 cc_check -march=$proc $cpuopt=$proc || proc=i586
845 if test "$proc" = "i586" ; then
846 cc_check -march=$proc $cpuopt=$proc || proc=i486
848 if test "$proc" = "i486" ; then
849 cc_check -march=$proc $cpuopt=$proc || proc=i386
851 if test "$proc" = "i386" ; then
852 cc_check -march=$proc $cpuopt=$proc || proc=error
854 if test "$proc" = "error" ; then
855 echores "Your $_cc does not even support \"i386\" for '-march' and '$cpuopt'."
856 _mcpu=""
857 _march=""
858 _optimizing=""
859 elif test "$proc" = "i586-i686"; then
860 _march="-march=i586"
861 _mcpu="$cpuopt=i686"
862 _optimizing="$proc"
863 else
864 _march="-march=$proc"
865 _mcpu="$cpuopt=$proc"
866 _optimizing="$proc"
868 else
869 # i686 is probably the most common CPU - optimize for it
870 _mcpu="$cpuopt=i686"
871 # at least i486 required, for bswap instruction
872 _march="-march=i486"
873 cc_check $_mcpu || _mcpu=""
874 cc_check $_march $_mcpu || _march=""
877 ## Gabucino : --target takes effect here (hopefully...) by overwriting
878 ## autodetected mcpu/march parameters
879 if test "$_target" ; then
880 # TODO: it may be a good idea to check GCC and fall back in all cases
881 if test "$host_arch" = "i586-i686"; then
882 _march="-march=i586"
883 _mcpu="$cpuopt=i686"
884 else
885 _march="-march=$host_arch"
886 _mcpu="$cpuopt=$host_arch"
889 proc="$host_arch"
891 case "$proc" in
892 i386) iproc=386 ;;
893 i486) iproc=486 ;;
894 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
895 i686|athlon*|pentium*) iproc=686 ;;
896 *) iproc=586 ;;
897 esac
900 echores "$proc"
903 ia64)
904 _def_arch='#define ARCH_IA64 1'
905 _target_arch='TARGET_ARCH_IA64 = yes'
906 iproc='ia64'
907 proc=''
908 _march=''
909 _mcpu=''
910 _optimizing=''
913 x86_64|amd64)
914 _def_arch='#define ARCH_X86_64 1'
915 _target_arch='TARGET_ARCH_X86_64 = yes'
916 iproc='x86_64'
917 proc=''
918 _march=''
919 _mcpu=''
920 _optimizing=''
921 x86_exts_check
924 sparc)
925 _def_arch='#define ARCH_SPARC 1'
926 _target_arch='TARGET_ARCH_SPARC = yes'
927 iproc='sparc'
928 if sunos ; then
929 echocheck "CPU type"
930 karch=`uname -m`
931 case "`echo $karch`" in
932 sun4) proc=v7 ;;
933 sun4c) proc=v7 ;;
934 sun4d) proc=v8 ;;
935 sun4m) proc=v8 ;;
936 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
937 *) ;;
938 esac
939 echores "$proc"
940 else
941 proc=v8
943 _march=''
944 _mcpu="-mcpu=$proc"
945 _optimizing="$proc"
948 sparc64)
949 _def_arch='#define ARCH_SPARC 1'
950 _target_arch='TARGET_ARCH_SPARC = yes'
951 _vis='yes'
952 _def_vis='#define HAVE_VIS = yes'
953 iproc='sparc'
954 proc='v9'
955 _march=''
956 _mcpu="-mcpu=$proc"
957 _optimizing="$proc"
960 arm|armv4l|armv5tel)
961 _def_arch='#define ARCH_ARMV4L 1'
962 _target_arch='TARGET_ARCH_ARMV4L = yes'
963 iproc='arm'
964 proc=''
965 _march=''
966 _mcpu=''
967 _optimizing=''
970 ppc)
971 _def_arch='#define ARCH_POWERPC 1'
972 _target_arch='TARGET_ARCH_POWERPC = yes'
973 iproc='ppc'
974 proc=''
975 _march=''
976 _mcpu=''
977 _optimizing=''
978 _altivec=no
980 echocheck "CPU type"
981 if linux && test -n "$_cpuinfo"; then
982 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -1`
983 if test -n "`$_cpuinfo | grep altivec`"; then
984 _altivec=yes
987 if darwin ; then
988 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
989 if [ `sysctl -n hw.vectorunit` -eq 1 ]; then
990 _altivec=yes
991 elif [ "`sysctl -n hw.optional.altivec 2>/dev/null`" = 1 ]; then
992 _altivec=yes
995 # only gcc 3.4 works reliably with altivec code under netbsd
996 if netbsd ; then
997 case $cc_version in
998 2*|3.0*|3.1*|3.2*|3.3*)
1001 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1002 _altivec=yes
1005 esac
1007 if test "$_altivec" = yes; then
1008 echores "$proc altivec"
1009 else
1010 echores "$proc"
1013 echocheck "GCC & CPU optimization abilities"
1015 if test -n "$proc"; then
1016 case "$proc" in
1017 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1018 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1019 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1020 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1021 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1022 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1023 *) ;;
1024 esac
1025 # gcc 3.1(.1) and up supports 7400 and 7450
1026 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1"; then
1027 case "$proc" in
1028 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1029 7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1030 *) ;;
1031 esac
1033 # gcc 3.2 and up supports 970
1034 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3"; then
1035 case "$proc" in
1036 970*) _march='-mcpu=970' _mcpu='-mtune=970' ;;
1037 *) ;;
1038 esac
1042 if test -n "$_mcpu"; then
1043 _optimizing=`echo $_mcpu | cut -c 8-`
1044 echores "$_optimizing"
1045 else
1046 echores "none"
1051 alpha)
1052 _def_arch='#define ARCH_ALPHA 1'
1053 _target_arch='TARGET_ARCH_ALPHA = yes'
1054 iproc='alpha'
1055 _march=''
1057 echocheck "CPU type"
1058 cat > $TMPC << EOF
1059 int main() {
1060 unsigned long ver, mask;
1061 asm ("implver %0" : "=r" (ver));
1062 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1063 printf("%ld-%x\n", ver, ~mask);
1064 return 0;
1067 $_cc -o "$TMPO" "$TMPC"
1068 case `"$TMPO"` in
1070 0-0) proc="ev4"; cpu_understands_mvi="0";;
1071 1-0) proc="ev5"; cpu_understands_mvi="0";;
1072 1-1) proc="ev56"; cpu_understands_mvi="0";;
1073 1-101) proc="pca56"; cpu_understands_mvi="1";;
1074 2-303) proc="ev6"; cpu_understands_mvi="1";;
1075 2-307) proc="ev67"; cpu_understands_mvi="1";;
1076 2-1307) proc="ev68"; cpu_understands_mvi="1";;
1077 esac
1078 echores "$proc"
1080 echocheck "GCC & CPU optimization abilities"
1081 if test "$proc" = "ev68" ; then
1082 cc_check -mcpu=$proc || proc=ev67
1084 if test "$proc" = "ev67" ; then
1085 cc_check -mcpu=$proc || proc=ev6
1087 _mcpu="-mcpu=$proc"
1088 echores "$proc"
1090 _optimizing="$proc"
1092 echocheck "MVI instruction support in GCC"
1093 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
1094 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
1095 echores "yes"
1096 else
1097 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
1098 echores "no, GCC = `( $_cc -dumpversion ) 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
1102 mips)
1103 _def_arch='#define ARCH_SGI_MIPS 1'
1104 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
1105 iproc='sgi-mips'
1106 proc=''
1107 _march=''
1108 _mcpu=''
1109 _optimizing=''
1111 if irix ; then
1112 echocheck "CPU type"
1113 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
1114 case "`echo $proc`" in
1115 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
1116 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
1117 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
1118 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
1119 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
1120 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
1121 esac
1122 echores "$proc"
1127 hppa)
1128 _def_arch='#define ARCH_PA_RISC 1'
1129 _target_arch='TARGET_ARCH_PA_RISC = yes'
1130 iproc='PA-RISC'
1131 proc=''
1132 _march=''
1133 _mcpu=''
1134 _optimizing=''
1137 s390)
1138 _def_arch='#define ARCH_S390 1'
1139 _target_arch='TARGET_ARCH_S390 = yes'
1140 iproc='390'
1141 proc=''
1142 _march=''
1143 _mcpu=''
1144 _optimizing=''
1147 s390x)
1148 _def_arch='#define ARCH_S390X 1'
1149 _target_arch='TARGET_ARCH_S390X = yes'
1150 iproc='390x'
1151 proc=''
1152 _march=''
1153 _mcpu=''
1154 _optimizing=''
1157 vax)
1158 _def_arch='#define ARCH_VAX 1'
1159 _target_arch='TARGET_ARCH_VAX = yes'
1160 iproc='vax'
1161 proc=''
1162 _march=''
1163 _mcpu=''
1164 _optimizing=''
1168 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1169 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1170 die "unsupported architecture $host_arch"
1172 esac
1174 if test "$_runtime_cpudetection" = yes ; then
1175 if x86; then
1176 _mmx=yes
1177 _3dnow=yes
1178 _3dnowex=yes
1179 _mmx2=yes
1180 _sse=yes
1181 _sse2=yes
1182 _mtrr=yes
1184 if ppc; then
1185 _altivec=yes
1189 if x86 && test "$_runtime_cpudetection" = no ; then
1190 extcheck() {
1191 if test "$1" = yes ; then
1192 echocheck "kernel support of $2"
1193 cat > $TMPC <<EOF
1194 #include <signal.h>
1195 void catch() { exit(1); }
1196 int main(void){
1197 signal(SIGILL, catch);
1198 __asm__ __volatile__ ("$3":::"memory");return(0);
1202 if ( cc_check && $TMPO ) > /dev/null 2>&1 ; then
1203 echores "yes"
1204 _optimizing="$_optimizing $2"
1205 return 0
1206 else
1207 echores "failed"
1208 echo "It seems that your kernel does not correctly support $2."
1209 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1210 return 1
1213 return 0
1216 extcheck $_mmx "mmx" "emms" || _mmx=no
1217 extcheck $_mmx2 "mmx2" "sfence" || _mmx2=no
1218 extcheck $_3dnow "3dnow" "femms" || _3dnow=no
1219 extcheck $_3dnowex "3dnowex" "pswapd %%mm0, %%mm0" || _3dnowex=no
1220 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no _gcc3_ext="$_gcc3_ext -mno-sse"
1221 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no _gcc3_ext="$_gcc3_ext -mno-sse2"
1222 echocheck "mtrr support"
1223 echores "$_mtrr"
1225 if test "$_mtrr" = yes ; then
1226 _optimizing="$_optimizing mtrr"
1229 if test "$_gcc3_ext" != ""; then
1230 # if we had to disable sse/sse2 because the active kernel does not
1231 # support this instruction set extension, we also have to tell
1232 # gcc3 to not generate sse/sse2 instructions for normal C code
1233 cat > $TMPC << EOF
1234 int main(void) { return 0; }
1236 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1241 echocheck "assembler support of -pipe option"
1242 cat > $TMPC << EOF
1243 int main(void) { return 0; }
1245 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
1247 _prefix="/usr/local"
1248 _xvmclib="XvMCNVIDIA"
1250 # GOTCHA: the variables below defines the default behavior for autodetection
1251 # and have - unless stated otherwise - at least 2 states : yes no
1252 # If autodetection is available then the third state is: auto
1253 _libavcodec=auto
1254 _libavcodecso=auto
1255 _libavformat=auto
1256 _fame=auto
1257 _mp1e=no
1258 _mencoder=yes
1259 _x11=auto
1260 _dga=auto # 1 2 no auto
1261 _xv=auto
1262 _xvmc=no #auto when complete
1263 _sdl=auto
1264 _directx=auto
1265 _win32waveout=auto
1266 _nas=auto
1267 _png=auto
1268 _jpg=auto
1269 _pnm=yes
1270 _md5sum=yes
1271 _gif=auto
1272 _gl=auto
1273 _ggi=auto
1274 _aa=auto
1275 _caca=auto
1276 _svga=auto
1277 _vesa=auto
1278 _fbdev=auto
1279 _dvb=auto
1280 _dvbhead=auto
1281 _dxr2=auto
1282 _dxr3=auto
1283 _iconv=auto
1284 _langinfo=auto
1285 _rtc=auto
1286 _ossaudio=auto
1287 _arts=auto
1288 _esd=auto
1289 _jack=auto
1290 _liblzo=auto
1291 _mad=auto
1292 _toolame=auto
1293 _vorbis=auto
1294 _theora=auto
1295 _mp3lib=yes
1296 _liba52=yes
1297 _libdts=auto
1298 _libmpeg2=yes
1299 _matroska_internal=yes
1300 _tremor=no
1301 _faad_internal=auto
1302 _faad_external=auto
1303 _xmms=no
1304 # dvdnav disabled, it does not work
1305 #_dvdnav=no
1306 _dvdread=auto
1307 _dvdkit=auto
1308 _xanim=auto
1309 _real=auto
1310 _live=auto
1311 _xinerama=auto
1312 _mga=auto
1313 _xmga=auto
1314 _vm=auto
1315 _mlib=auto
1316 _sgiaudio=auto
1317 _sunaudio=auto
1318 _alsa=auto
1319 _fastmemcpy=yes
1320 _unrarlib=yes
1321 _macshlb=auto
1322 _win32=auto
1323 _dshow=yes
1324 _select=yes
1325 _tv=yes
1326 _tv_v4l=auto
1327 _tv_v4l2=auto
1328 _tv_bsdbt848=auto
1329 _edl=yes
1330 _network=yes
1331 _winsock2=auto
1332 _smbsupport=auto
1333 _vidix=auto
1334 _joystick=no
1335 _xvid=auto
1336 _x264=auto
1337 _divx4linux=auto
1338 _opendivx=no
1339 _lirc=auto
1340 _lircc=auto
1341 _gui=no
1342 _termcap=auto
1343 _termios=auto
1344 _3dfx=no
1345 _tdfxfb=no
1346 _tdfxvid=no
1347 _tga=yes
1348 _directfb=auto
1349 _zr=auto
1350 _bl=no
1351 _largefiles=no
1352 #_language=en
1353 _shm=auto
1354 _linux_devfs=no
1355 _i18n=auto
1356 _dynamic_plugins=no
1357 _setlocale=auto
1358 _sighandler=yes
1359 _libdv=auto
1360 _cdparanoia=auto
1361 _big_endian=auto
1362 _freetype=auto
1363 _fontconfig=auto
1364 _shared_pp=no
1365 _menu=no
1366 _qtx=auto
1367 _macosx=auto
1368 _sortsub=yes
1369 _freetypeconfig='freetype-config'
1370 _fribidi=no
1371 _fribidiconfig='fribidi-config'
1372 _enca=auto
1373 _inet6=auto
1374 _gethostbyname2=auto
1375 _ftp=yes
1376 for ac_option do
1377 case "$ac_option" in
1378 # Skip 1st pass
1379 --target=*) ;;
1380 --cc=*) ;;
1381 --host-cc=*) ;;
1382 --as=*) ;;
1383 --enable-gcc-checking) ;;
1384 --disable-gcc-checking) ;;
1385 --enable-static*) ;;
1386 --disable-static*) ;;
1387 --with-extraincdir=*) ;;
1388 --with-extralibdir=*) ;;
1389 --enable-runtime-cpudetection) ;;
1390 --disable-runtime-cpudetection) ;;
1391 --install-path=*) ;;
1392 --with-install=*) ;;
1394 # Real 2nd pass
1395 --enable-mencoder) _mencoder=yes ;;
1396 --disable-mencoder) _mencoder=no ;;
1397 --enable-i18n) _i18n=yes ;;
1398 --disable-i18n) _i18n=no ;;
1399 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
1400 --disable-dynamic-plugins) _dynamic_plugins=no ;;
1401 --enable-setlocale) _setlocale=yes ;;
1402 --disable-setlocale) _setlocale=no ;;
1403 --enable-x11) _x11=yes ;;
1404 --disable-x11) _x11=no ;;
1405 --enable-xv) _xv=yes ;;
1406 --disable-xv) _xv=no ;;
1407 --enable-xvmc) _xvmc=yes ;;
1408 --disable-xvmc) _xvmc=no ;;
1409 --enable-sdl) _sdl=yes ;;
1410 --disable-sdl) _sdl=no ;;
1411 --enable-directx) _directx=yes ;;
1412 --disable-directx) _directx=no ;;
1413 --enable-win32waveout) _win32waveout=yes ;;
1414 --disable-win32waveout) _win32waveout=no ;;
1415 --enable-nas) _nas=yes ;;
1416 --disable-nas) _nas=no ;;
1417 --enable-png) _png=yes ;;
1418 --disable-png) _png=no ;;
1419 --enable-jpeg) _jpg=yes ;;
1420 --disable-jpeg) _jpg=no ;;
1421 --enable-pnm) _pnm=yes ;;
1422 --disable-pnm) _pnm=no ;;
1423 --enable-md5sum) _md5sum=yes ;;
1424 --disable-md5sum) _md5sum=no ;;
1425 --enable-gif) _gif=yes ;;
1426 --disable-gif) _gif=no ;;
1427 --enable-gl) _gl=yes ;;
1428 --disable-gl) _gl=no ;;
1429 --enable-ggi) _ggi=yes ;;
1430 --disable-ggi) _ggi=no ;;
1431 --enable-aa) _aa=yes ;;
1432 --disable-aa) _aa=no ;;
1433 --enable-caca) _caca=yes ;;
1434 --disable-caca) _caca=no ;;
1435 --enable-svga) _svga=yes ;;
1436 --disable-svga) _svga=no ;;
1437 --enable-vesa) _vesa=yes ;;
1438 --disable-vesa) _vesa=no ;;
1439 --enable-fbdev) _fbdev=yes ;;
1440 --disable-fbdev) _fbdev=no ;;
1441 --enable-dvb) _dvb=yes ;;
1442 --disable-dvb) _dvb=no ;;
1443 --enable-dvbhead) _dvbhead=yes ;;
1444 --disable-dvbhead) _dvbhead=no ;;
1445 --enable-dxr2) _dxr2=yes ;;
1446 --disable-dxr2) _dxr2=no ;;
1447 --enable-dxr3) _dxr3=yes ;;
1448 --disable-dxr3) _dxr3=no ;;
1449 --enable-iconv) _iconv=yes ;;
1450 --disable-iconv) _iconv=no ;;
1451 --enable-langinfo) _langinfo=yes ;;
1452 --disable-langinfo) _langinfo=no ;;
1453 --enable-rtc) _rtc=yes ;;
1454 --disable-rtc) _rtc=no ;;
1455 --enable-mp1e) _mp1e=yes ;;
1456 --disable-mp1e) _mp1e=no ;;
1457 --enable-libdv) _libdv=yes ;;
1458 --disable-libdv) _libdv=no ;;
1459 --enable-ossaudio) _ossaudio=yes ;;
1460 --disable-ossaudio) _ossaudio=no ;;
1461 --enable-arts) _arts=yes ;;
1462 --disable-arts) _arts=no ;;
1463 --enable-esd) _esd=yes ;;
1464 --disable-esd) _esd=no ;;
1465 --enable-jack) _jack=yes ;;
1466 --disable-jack) _jack=no ;;
1467 --enable-mad) _mad=yes ;;
1468 --disable-mad) _mad=no ;;
1469 --disable-toolame) _toolame=no ;;
1470 --enable-liblzo) _liblzo=yes ;;
1471 --disable-liblzo) _liblzo=no ;;
1472 --enable-vorbis) _vorbis=yes ;;
1473 --disable-vorbis) _vorbis=no ;;
1474 --enable-tremor) _tremor=yes ;;
1475 --disable-tremor) _tremor=no ;;
1476 --enable-theora) _theora=yes ;;
1477 --disable-theora) _theora=no ;;
1478 --enable-mp3lib) _mp3lib=yes ;;
1479 --disable-mp3lib) _mp3lib=no ;;
1480 --enable-liba52) _liba52=yes ;;
1481 --disable-liba52) _liba52=no ;;
1482 --enable-libdts) _libdts=yes ;;
1483 --disable-libdts) _libdts=no ;;
1484 --enable-libmpeg2) _libmpeg2=yes ;;
1485 --disable-libmpeg2) _libmpeg2=no ;;
1486 --enable-internal-matroska) _matroska_internal=yes ;;
1487 --disable-internal-matroska) _matroska_internal=no ;;
1488 --enable-internal-faad) _faad_internal=yes _faad_external=no ;;
1489 --disable-internal-faad) _faad_internal=no ;;
1490 --enable-external-faad) _faad_external=yes _faad_internal=no ;;
1491 --disable-external-faad) _faad_external=no ;;
1492 --enable-xmms) _xmms=yes ;;
1493 --disable-xmms) _xmms=no ;;
1494 --enable-dvdread) _dvdread=yes ;;
1495 --disable-dvdread) _dvdread=no ;;
1496 --enable-mpdvdkit) _dvdkit=yes ;;
1497 --disable-mpdvdkit) _dvdkit=no ;;
1498 # dvdnav disabled, it does not work
1499 # --enable-dvdnav) _dvdnav=yes ;;
1500 # --disable-dvdnav) _dvdnav=no ;;
1501 --enable-xanim) _xanim=yes ;;
1502 --disable-xanim) _xanim=no ;;
1503 --enable-real) _real=yes ;;
1504 --disable-real) _real=no ;;
1505 --enable-live) _live=yes ;;
1506 --disable-live) _live=no ;;
1507 --enable-xinerama) _xinerama=yes ;;
1508 --disable-xinerama) _xinerama=no ;;
1509 --enable-mga) _mga=yes ;;
1510 --disable-mga) _mga=no ;;
1511 --enable-xmga) _xmga=yes ;;
1512 --disable-xmga) _xmga=no ;;
1513 --enable-vm) _vm=yes ;;
1514 --disable-vm) _vm=no ;;
1515 --enable-mlib) _mlib=yes ;;
1516 --disable-mlib) _mlib=no ;;
1517 --enable-sunaudio) _sunaudio=yes ;;
1518 --disable-sunaudio) _sunaudio=no ;;
1519 --enable-sgiaudio) _sgiaudio=yes ;;
1520 --disable-sgiaudio) _sgiaudio=no ;;
1521 --enable-alsa) _alsa=yes ;;
1522 --disable-alsa) _alsa=no ;;
1523 --enable-tv) _tv=yes ;;
1524 --disable-tv) _tv=no ;;
1525 --enable-edl) _edl=yes ;;
1526 --disable-edl) _edl=no ;;
1527 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1528 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1529 --enable-tv-v4l) _tv_v4l=yes ;;
1530 --disable-tv-v4l) _tv_v4l=no ;;
1531 --enable-tv-v4l2) _tv_v4l2=yes ;;
1532 --disable-tv-v4l2) _tv_v4l2=no ;;
1533 --enable-fastmemcpy) _fastmemcpy=yes ;;
1534 --disable-fastmemcpy) _fastmemcpy=no ;;
1535 --enable-network) _network=yes ;;
1536 --disable-network) _network=no ;;
1537 --enable-winsock2) _winsock2=yes ;;
1538 --disable-winsock2) _winsock2=no ;;
1539 --enable-smb) _smbsupport=yes ;;
1540 --disable-smb) _smbsupport=no ;;
1541 --enable-vidix) _vidix=yes ;;
1542 --disable-vidix) _vidix=no ;;
1543 --enable-joystick) _joystick=yes ;;
1544 --disable-joystick) _joystick=no ;;
1545 --enable-xvid) _xvid=yes ;;
1546 --disable-xvid) _xvid=no ;;
1547 --enable-x264) _x264=yes ;;
1548 --disable-x264) _x264=no ;;
1549 --enable-divx4linux) _divx4linux=yes ;;
1550 --disable-divx4linux) _divx4linux=no ;;
1551 --enable-opendivx) _opendivx=yes ;;
1552 --disable-opendivx) _opendivx=no ;;
1553 --enable-libavcodec) _libavcodec=yes ;;
1554 --disable-libavcodec) _libavcodec=no ;;
1555 --enable-libavformat) _libavformat=yes;;
1556 --disable-libavformat) _libavformat=no ;;
1557 --enable-libfame) _fame=yes ;;
1558 --disable-libfame) _fame=no ;;
1559 --enable-lirc) _lirc=yes ;;
1560 --disable-lirc) _lirc=no ;;
1561 --enable-lircc) _lircc=yes ;;
1562 --disable-lircc) _lircc=no ;;
1563 --enable-gui) _gui=yes ;;
1564 --disable-gui) _gui=no ;;
1565 --enable-termcap) _termcap=yes ;;
1566 --disable-termcap) _termcap=no ;;
1567 --enable-termios) _termios=yes ;;
1568 --disable-termios) _termios=no ;;
1569 --enable-3dfx) _3dfx=yes ;;
1570 --disable-3dfx) _3dfx=no ;;
1571 --enable-tdfxfb) _tdfxfb=yes ;;
1572 --disable-tdfxvid) _tdfxvid=no ;;
1573 --enable-tdfxvid) _tdfxvid=yes ;;
1574 --disable-tga) _tga=no ;;
1575 --enable-tga) _tga=yes ;;
1576 --disable-tdfxfb) _tdfxfb=no ;;
1577 --enable-directfb) _directfb=yes ;;
1578 --disable-directfb) _directfb=no ;;
1579 --enable-zr) _zr=yes ;;
1580 --disable-zr) _zr=no ;;
1581 --enable-bl) _bl=yes ;;
1582 --disable-bl) _bl=no ;;
1583 --enable-mtrr) _mtrr=yes ;;
1584 --disable-mtrr) _mtrr=no ;;
1585 --enable-largefiles) _largefiles=yes ;;
1586 --disable-largefiles) _largefiles=no ;;
1587 --enable-shm) _shm=yes ;;
1588 --disable-shm) _shm=no ;;
1589 --enable-select) _select=yes ;;
1590 --disable-select) _select=no ;;
1591 --enable-linux-devfs) _linux_devfs=yes ;;
1592 --disable-linux-devfs) _linux_devfs=no ;;
1593 --enable-cdparanoia) _cdparanoia=yes ;;
1594 --disable-cdparanoia) _cdparanoia=no ;;
1595 --enable-big-endian) _big_endian=yes ;;
1596 --disable-big-endian) _big_endian=no ;;
1597 --enable-freetype) _freetype=yes ;;
1598 --disable-freetype) _freetype=no ;;
1599 --enable-fontconfig) _fontconfig=yes ;;
1600 --disable-fontconfig) _fontconfig=no ;;
1601 --enable-unrarlib) _unrarlib=yes ;;
1602 --disable-unrarlib) _unrarlib=no ;;
1603 --enable-ftp) _ftp=yes ;;
1604 --disable-ftp) _ftp=no ;;
1606 --enable-fribidi) _fribidi=yes ;;
1607 --disable-fribidi) _fribidi=no ;;
1609 --enable-enca) _enca=yes ;;
1610 --disable-enca) _enca=no ;;
1612 --enable-inet6) _inet6=yes ;;
1613 --disable-inet6) _inet6=no ;;
1615 --enable-gethostbyname2) _gethostbyname2=yes ;;
1616 --disable-gethostbyname2) _gethostbyname2=no ;;
1618 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1619 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1620 --disable-dga) _dga=no ;;
1622 --enable-shared-pp) _shared_pp=yes ;;
1623 --disable-shared-pp) _shared_pp=no ;;
1625 --enable-menu) _menu=yes ;;
1626 --disable-menu) _menu=no ;;
1628 --enable-qtx) _qtx=yes ;;
1629 --disable-qtx) _qtx=no ;;
1631 --enable-macosx) _macosx=yes ;;
1632 --disable-macosx) _macosx=no ;;
1634 --enable-sortsub) _sortsub=yes ;;
1635 --disable-sortsub) _sortsub=no ;;
1637 --language=*)
1638 _language=`echo $ac_option | cut -d '=' -f 2`
1640 # dvdnav disabled, it does not work
1641 # --with-libdvdnav=*)
1642 # _dvdnavdir=`echo $ac_option | cut -d '=' -f 2`
1643 # _dvdnav=yes
1644 # ;;
1646 --with-codecsdir=*)
1647 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1648 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1649 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1651 --with-win32libdir=*)
1652 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1653 _win32=yes
1655 --with-xanimlibdir=*)
1656 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1657 _xanim=yes
1659 --with-reallibdir=*)
1660 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1661 _real=yes
1663 --with-livelibdir=*)
1664 _livelibdir=`echo $ac_option | cut -d '=' -f 2`
1666 --with-toolamedir=*)
1667 _toolamedir=`echo $ac_option | cut -d '=' -f 2`
1669 --with-mlibdir=*)
1670 _mlibdir=`echo $ac_option | cut -d '=' -f 2`
1671 _mlib=yes
1674 --with-xmmslibdir=*)
1675 _xmmslibdir=`echo $ac_option | cut -d '=' -f 2`
1678 --with-xmmsplugindir=*)
1679 _xmmsplugindir=`echo $ac_option | cut -d '=' -f 2`
1682 --with-bio2jack=*)
1683 _bio2jackdir=`echo $ac_option | cut -d '=' -f 2`
1686 --enable-profile)
1687 _profile='-p'
1689 --disable-profile)
1690 _profile=
1692 --enable-debug)
1693 _debug='-g'
1695 --enable-debug=*)
1696 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
1698 --disable-debug)
1699 _debug=
1701 --enable-sighandler)
1702 _sighandler=yes
1704 --disable-sighandler)
1705 _sighandler=no
1708 --enable-sse) _sse=yes ;;
1709 --disable-sse) _sse=no ;;
1710 --enable-sse2) _sse2=yes ;;
1711 --disable-sse2) _sse2=no ;;
1712 --enable-mmx2) _mmx2=yes ;;
1713 --disable-mmx2) _mmx2=no ;;
1714 --enable-3dnow) _3dnow=yes ;;
1715 --disable-3dnow) _3dnow=no _3dnowex=no ;;
1716 --enable-3dnowex) _3dnow=yes _3dnowex=yes ;;
1717 --disable-3dnowex) _3dnowex=no ;;
1718 --enable-altivec) _altivec=yes ;;
1719 --disable-altivec) _altivec=no ;;
1720 --enable-mmx) _mmx=yes ;;
1721 --disable-mmx) # 3Dnow! and MMX2 require MMX
1722 _3dnow=no _3dnowex=no _mmx=no _mmx2=no ;;
1724 --enable-macshlb) _macshlb=yes ;;
1725 --disable-macshlb) _macshlb=no ;;
1726 --enable-win32) _win32=yes ;;
1727 --disable-win32) _win32=no _dshow=no ;;
1728 --enable-dshow) _win32=yes _dshow=yes ;;
1729 --disable-dshow) _dshow=no ;;
1731 --with-x11incdir=*)
1732 _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1734 --with-x11libdir=*)
1735 _ld_x11=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1737 --with-dxr2incdir=*)
1738 _inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1740 --with-xvmclib=*)
1741 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
1743 --with-dvbincdir=*)
1744 _inc_dvb=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1746 --with-xvidlibdir=*)
1747 _ld_xvid=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1749 --with-xvidincdir=*)
1750 _inc_xvid=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1752 --with-dtslibdir=*)
1753 _ld_libdts=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1755 --with-dtsincdir=*)
1756 _inc_libdts=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1758 --with-x264libdir=*)
1759 _ld_x264=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1761 --with-x264incdir=*)
1762 _inc_x264=-I`echo $ac_option | cut -d '=' -f 2 |sed 's,:, -I,g'`
1764 --with-sdl-config=*)
1765 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
1767 --with-freetype-config=*)
1768 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
1770 --with-fribidi-config=*)
1771 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
1773 --with-gtk-config=*)
1774 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
1776 --with-glib-config=*)
1777 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
1779 # dvdnav disabled, it does not work
1780 # --with-dvdnav-config=*)
1781 # _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
1782 # ;;
1783 --with-madlibdir=*)
1784 _ld_mad=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1786 --with-cdparanoiaincdir=*)
1787 _inc_cdparanoia=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1789 --with-cdparanoialibdir=*)
1790 _ld_cdparanoia=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1792 --with-termcaplib=*)
1793 _ld_termcap=-l`echo $ac_option | cut -d '=' -f 2`
1794 _termcap=yes
1796 --prefix=*)
1797 _prefix=`echo $ac_option | cut -d '=' -f 2`
1799 --bindir=*)
1800 _bindir=`echo $ac_option | cut -d '=' -f 2`
1802 --datadir=*)
1803 _datadir=`echo $ac_option | cut -d '=' -f 2`
1805 --mandir=*)
1806 _mandir=`echo $ac_option | cut -d '=' -f 2`
1808 --confdir=*)
1809 _confdir=`echo $ac_option | cut -d '=' -f 2`
1811 --libdir=*)
1812 _libdir=`echo $ac_option | cut -d '=' -f 2`
1816 echo "Unknown parameter: $ac_option"
1817 exit 1
1820 esac
1821 done
1823 # Atmos: moved this here, to be correct, if --prefix is specified
1824 test -z "$_bindir" && _bindir="$_prefix/bin"
1825 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1826 test -z "$_mandir" && _mandir="$_prefix/man"
1827 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1828 test -z "$_libdir" && _libdir="$_prefix/lib"
1829 test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
1831 if x86 ; then
1832 # Checking assembler (_as) compatibility...
1833 # Added workaround for older as that reads from stdin by default - atmos
1834 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
1835 echocheck "assembler ($_as $as_version)"
1837 _pref_as_version='2.9.1'
1838 echo 'nop' > $TMPS
1839 if test "$_mmx" = yes ; then
1840 echo 'emms' >> $TMPS
1842 if test "$_3dnow" = yes ; then
1843 _pref_as_version='2.10.1'
1844 echo 'femms' >> $TMPS
1846 if test "$_3dnowex" = yes ; then
1847 _pref_as_version='2.10.1'
1848 echo 'pswapd %mm0, %mm0' >> $TMPS
1850 if test "$_mmx2" = yes ; then
1851 _pref_as_version='2.10.1'
1852 echo 'movntq %mm0, (%eax)' >> $TMPS
1854 if test "$_sse" = yes ; then
1855 _pref_as_version='2.10.1'
1856 echo 'xorps %xmm0, %xmm0' >> $TMPS
1858 #if test "$_sse2" = yes ; then
1859 # _pref_as_version='2.11'
1860 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
1862 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
1864 if test "$as_verc_fail" != yes ; then
1865 echores "ok"
1866 else
1867 echores "failed"
1868 echo "Upgrade binutils to ${_pref_as_version} ..."
1869 die "obsolete binutils version"
1873 if ppc ; then
1875 # check if altivec is supported by the compiler, and how to enable it
1877 _altivec_gcc_flags=''
1879 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
1880 echocheck "GCC altivec support"
1882 p=''
1883 cat > $TMPC << EOF
1884 int main() {
1885 return 0;
1888 FSF_flags='-maltivec -mabi=altivec'
1889 Darwin_flags='-faltivec'
1891 # check for Darwin-style flags first, since
1892 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
1893 # accepts but ignores FSF-style flags...
1895 if test -z "$p"; then
1896 cc_check $Darwin_flags && p='Darwin'
1898 if test -z "$p"; then
1899 cc_check $FSF_flags && p='FSF'
1902 case $p in
1903 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
1904 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
1905 *) _altivec=no ;;
1906 esac
1908 if test -z "$p"; then
1909 p=none
1910 else
1911 p="$p-style ($_altivec_gcc_flags)"
1914 echores "$p"
1917 # check if <altivec.h> should be included
1919 _def_altivec_h='#undef HAVE_ALTIVEC_H'
1921 if test "$_altivec" = yes ; then
1922 echocheck "altivec.h"
1923 cat > $TMPC << EOF
1924 #include <altivec.h>
1925 int main(void) { return 0; }
1927 _have_altivec_h=no
1928 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
1929 if test "$_have_altivec_h" = yes ; then
1930 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
1932 echores "$_have_altivec_h"
1935 # disable runtime cpudetection if
1936 # - we cannot generate altivec code
1937 # - altivec is disabled by the user
1939 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
1940 _runtime_cpudetection=no
1943 # show that we are optimizing for altivec (if enabled and supported)
1945 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
1946 _optimizing="$_optimizing altivec"
1949 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
1951 if test "$_altivec" = yes ; then
1952 _mcpu="$_mcpu $_altivec_gcc_flags"
1955 # setup _def_altivec correctly
1957 if test "$_altivec" = yes ; then
1958 _def_altivec='#define HAVE_ALTIVEC 1'
1959 else
1960 _def_altivec='#undef HAVE_ALTIVEC'
1964 _def_mmx='#undef HAVE_MMX'
1965 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
1966 _def_mmx2='#undef HAVE_MMX2'
1967 test "$_mmx2" = yes && _def_mmx2='#define HAVE_MMX2 1'
1968 _def_3dnow='#undef HAVE_3DNOW'
1969 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
1970 _def_3dnowex='#undef HAVE_3DNOWEX'
1971 test "$_3dnowex" = yes && _def_3dnowex='#define HAVE_3DNOWEX 1'
1972 _def_sse='#undef HAVE_SSE'
1973 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
1974 _def_sse2='#undef HAVE_SSE2'
1975 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
1977 # Checking kernel version...
1978 if x86 && linux ; then
1979 _k_verc_problem=no
1980 kernel_version=`uname -r 2>&1`
1981 echocheck "$system_name kernel version"
1982 case "$kernel_version" in
1983 '') kernel_version="?.??"; _k_verc_fail=yes;;
1984 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
1985 _k_verc_problem=yes;;
1986 esac
1987 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
1988 _k_verc_fail=yes
1990 if test "$_k_verc_fail" ; then
1991 echores "$kernel_version, fail"
1992 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
1993 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
1994 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
1995 echo "supports SSE, but you have been warned! If you are using a kernel older than"
1996 echo "2.2.x you must upgrade it to get SSE support!"
1997 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
1998 else
1999 echores "$kernel_version, ok"
2003 if test "$_vidix" = auto ; then
2004 _vidix=no
2005 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2006 x86 && _vidix=yes
2007 ppc && linux && _vidix=yes
2008 alpha && linux && _vidix=yes
2009 qnx && _vidix=no
2010 sunos && _vidix=no
2011 beos && _vidix=no
2014 echocheck "mplayer binary name"
2015 if win32 ; then
2016 _prg="mplayer.exe"
2017 _prg_mencoder="mencoder.exe"
2018 else
2019 _prg="mplayer"
2020 _prg_mencoder="mencoder"
2022 echores $_prg
2025 # On QNX we must link to libph - Gabucino
2026 if qnx ; then
2027 _ld_arch="$_ld_arch -lph"
2030 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2031 _awk=
2032 if test "$_vidix" = yes ; then
2033 _awk_verc_fail=yes
2034 echocheck "awk"
2035 for _awk in mawk gawk nawk awk; do
2036 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2037 _awk_verc_fail=no
2038 break
2040 done
2041 test "$_awk_verc_fail" = yes && _awk=no
2042 echores "$_awk"
2043 if test "$_awk_verc_fail" = yes; then
2044 echo "VIDIX needs awk, but no working implementation was found!"
2045 echo "Try the GNU version, which can be downloaded from:"
2046 echo "ftp://ftp.gnu.org/gnu/gawk/"
2047 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2048 die "no awk"
2052 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2053 if irix ; then
2054 _ranlib='ar -r'
2055 elif linux ; then
2056 _ranlib='true'
2059 ######################
2060 # MAIN TESTS GO HERE #
2061 ######################
2064 echocheck "extra headers"
2065 if test "$_inc_extra" ; then
2066 echores "$_inc_extra"
2067 else
2068 echores "none"
2072 echocheck "extra libs"
2073 if test "$_ld_extra" ; then
2074 echores "$_ld_extra"
2075 else
2076 echores "none"
2079 echocheck "-lposix"
2080 cat > $TMPC <<EOF
2081 int main(void) { return 0; }
2083 if cc_check -lposix ; then
2084 _ld_arch="$_ld_arch -lposix"
2085 echores "yes"
2086 else
2087 echores "no"
2090 echocheck "-lm"
2091 cat > $TMPC <<EOF
2092 int main(void) { return 0; }
2094 if cc_check -lm ; then
2095 _ld_lm="-lm"
2096 echores "yes"
2097 else
2098 _ld_lm=""
2099 echores "no"
2102 # Checking for localization ...
2103 # CSAK EGY MARADHAT - A HEGYLAKO
2104 echocheck "i18n"
2105 if test "$_i18n" != no ; then
2106 cat > $TMPC <<EOF
2107 #include <libintl.h>
2108 int main(void) { gettext("test"); return 0; }
2110 _i18n=no
2111 _i18n_libs=""
2112 if test "$_i18n" = auto ; then
2113 cc_check && _i18n=yes
2114 else
2115 for i18n_lib in "" "-lintl"; do
2116 cc_check $i18n_lib && _i18n=yes && _i18n_libs=$i18n_lib && break
2117 done
2120 if test "$_i18n" = yes ; then
2121 _def_i18n='#define USE_I18N 1'
2122 else
2123 _def_i18n='#undef USE_I18N'
2125 if test -z "$_i18n_libs" ; then
2126 echores "$_i18n"
2127 else
2128 echores "$_i18n (using $_i18n_libs)"
2132 # Checking for setlocale() ...
2133 # CSAK EGY MARADHAT - A HEGYLAKO
2134 # Nemnem. a TV Maci !
2135 echocheck "setlocale()"
2136 if test "$_setlocale" = auto ; then
2137 cat > $TMPC <<EOF
2138 #include <locale.h>
2139 int main(void) { setlocale( LC_ALL,"" ); return 0; }
2141 _setlocale=no
2142 cc_check && _setlocale=yes
2144 if test "$_setlocale" = yes ; then
2145 _def_setlocale='#define USE_SETLOCALE 1'
2146 else
2147 _def_setlocale='#undef USE_SETLOCALE'
2149 echores "$_setlocale"
2152 echocheck "iconv"
2153 if test "$_iconv" = auto ; then
2154 _iconv_tmp='#include <iconv.h>'
2156 cat > $TMPC << EOF
2157 #include <stdio.h>
2158 #include <unistd.h>
2159 $_iconv_tmp
2160 #define INBUFSIZE 1024
2161 #define OUTBUFSIZE 4096
2163 char inbuffer[INBUFSIZE];
2164 char outbuffer[OUTBUFSIZE];
2166 int main(void) {
2167 size_t numread;
2168 iconv_t icdsc;
2169 char *tocode="UTF-8";
2170 char *fromcode="cp1250";
2171 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
2172 while ((numread = read (0, inbuffer, INBUFSIZE))) {
2173 char *iptr=inbuffer;
2174 char *optr=outbuffer;
2175 size_t inleft=numread;
2176 size_t outleft=OUTBUFSIZE;
2177 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
2178 != (size_t)(-1)) {
2179 write (1, outbuffer, OUTBUFSIZE - outleft);
2182 if (iconv_close(icdsc) == -1)
2187 _iconv=no
2188 if cc_check $_ld_lm ; then
2189 _iconv=yes
2190 elif cc_check $_ld_lm -liconv ; then
2191 _iconv=yes
2192 _ld_iconv='-liconv'
2195 if test "$_iconv" = yes ; then
2196 _def_iconv='#define USE_ICONV 1'
2197 else
2198 _def_iconv='#undef USE_ICONV'
2200 echores "$_iconv"
2203 echocheck "langinfo"
2204 if test "$_langinfo" = auto ; then
2205 cat > $TMPC <<EOF
2206 #include <langinfo.h>
2207 int main(void) { nl_langinfo(CODESET); return 0; }
2209 _langinfo=no
2210 cc_check && _langinfo=yes
2212 if test "$_langinfo" = yes ; then
2213 _def_langinfo='#define USE_LANGINFO 1'
2214 else
2215 _def_langinfo='#undef USE_LANGINFO'
2217 echores "$_langinfo"
2220 echocheck "language"
2221 test -z "$_language" && _language=$LINGUAS
2222 _language=`echo $_language | sed 's/,/ /g'`
2223 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2224 for lang in $_language ; do
2225 test "$lang" = all && lang=en
2226 if test -f "help/help_mp-${lang}.h" ; then
2227 _language=$lang
2228 break
2229 else
2230 echo -n "$lang not found, "
2231 _language=`echo $_language | sed "s/$lang *//"`
2233 done
2234 test -z "$_language" && _language=en
2235 _mp_help="help/help_mp-${_language}.h"
2236 test -f $_mp_help || die "$_mp_help not found"
2237 for lang in $LANGUAGES ; do
2238 if test -f "DOCS/man/$lang/mplayer.1" ; then
2239 MAN_LANG="$MAN_LANG $lang"
2241 done
2242 _doc_lang=$_language
2243 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2244 echores "using $_language (man pages: $MAN_LANG)"
2247 echocheck "enable sighandler"
2248 if test "$_sighandler" = yes ; then
2249 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2250 else
2251 _def_sighandler='#undef ENABLE_SIGHANDLER'
2253 echores "$_sighandler"
2255 echocheck "runtime cpudetection"
2256 if test "$_runtime_cpudetection" = yes ; then
2257 _optimizing="Runtime CPU-Detection enabled"
2258 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2259 else
2260 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2262 echores "$_runtime_cpudetection"
2265 echocheck "restrict keyword"
2266 for restrict_keyword in restrict __restrict __restrict__ ; do
2267 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2268 if cc_check; then
2269 _def_restrict_keyword=$restrict_keyword
2270 break;
2272 done
2273 if [ -n "$_def_restrict_keyword" ]; then
2274 echores "$_def_restrict_keyword"
2275 else
2276 echores "none"
2280 echocheck "kstat"
2281 cat > $TMPC << EOF
2282 #include <kstat.h>
2283 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2285 _kstat=no
2286 cc_check -lkstat && _kstat=yes
2287 if test "$_kstat" = yes ; then
2288 _ld_arch="-lkstat $_ld_arch"
2290 if test "$_kstat" = yes ; then
2291 _def_kstat="#define HAVE_LIBKSTAT 1"
2292 else
2293 _def_kstat="#undef HAVE_LIBKSTAT"
2295 echores "$_kstat"
2298 echocheck "posix4"
2299 # required for nanosleep on some systems
2300 cat > $TMPC << EOF
2301 #include <time.h>
2302 int main(void) { (void) nanosleep(0, 0); return 0; }
2304 _posix4=no
2305 cc_check -lposix4 && _posix4=yes
2306 if test "$_posix4" = yes ; then
2307 _ld_arch="-lposix4 $_ld_arch"
2309 echores "$_posix4"
2312 echocheck "lrintf"
2313 cat > $TMPC << EOF
2314 #include <math.h>
2315 int main(void) { (void) lrintf(0.0); return 0; }
2317 _lrintf=no
2318 cc_check $_ld_lm && _lrintf=yes
2319 if test "$_lrintf" = yes ; then
2320 _def_lrintf="#define HAVE_LRINTF 1"
2321 else
2322 _def_lrintf="#undef HAVE_LRINTF"
2324 echores "$_lrintf"
2327 echocheck "nanosleep"
2328 # also check for nanosleep
2329 cat > $TMPC << EOF
2330 #include <time.h>
2331 int main(void) { (void) nanosleep(0, 0); return 0; }
2333 _nanosleep=no
2334 cc_check $_ld_arch && _nanosleep=yes
2335 if test "$_nanosleep" = yes ; then
2336 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2337 else
2338 _def_nanosleep='#undef HAVE_NANOSLEEP'
2340 echores "$_nanosleep"
2343 echocheck "socklib"
2344 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2345 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2346 cat > $TMPC << EOF
2347 #include <netdb.h>
2348 int main(void) { (void) gethostbyname(0); return 0; }
2350 cc_check -lsocket && _ld_sock="-lsocket"
2351 cc_check -lnsl && _ld_sock="-lnsl"
2352 cc_check -lsocket -lnsl && _ld_sock="-lsocket -lnsl"
2353 cc_check -lsocket -ldnet && _ld_sock="-lsocket -ldnet"
2354 cc_check -lsocket -lbind && _ld_sock="-lsocket -lbind"
2355 if test $_winsock2 = auto && not cygwin ; then
2356 _winsock2=no
2357 cat > $TMPC << EOF
2358 #include <winsock2.h>
2359 int main(void) { (void) gethostbyname(0); return 0; }
2361 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2363 if test "$_ld_sock" ; then
2364 echores "yes (using $_ld_sock)"
2365 else
2366 echores "no"
2370 if test $_winsock2 = yes ; then
2371 _ld_sock="-lws2_32"
2372 _def_winsock2='#define HAVE_WINSOCK2 1'
2373 else
2374 _def_winsock2='#undef HAVE_WINSOCK2'
2378 _use_aton=no
2379 echocheck "inet_pton()"
2380 cat > $TMPC << EOF
2381 #include <sys/types.h>
2382 #include <sys/socket.h>
2383 #include <arpa/inet.h>
2384 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2386 if test "$_winsock2" = yes ; then
2387 echores "not needed (using winsock2 functions)"
2388 elif cc_check $_ld_sock ; then
2389 # NOTE: Linux has libresolv but does not need it
2391 echores "yes (using $_ld_sock)"
2392 elif cc_check $_ld_sock -lresolv ; then
2393 # NOTE: needed for SunOS at least
2394 _ld_sock="$_ld_sock -lresolv"
2395 echores "yes (using $_ld_sock)"
2396 else
2397 echores "no (=> i'll try inet_aton next)"
2399 echocheck "inet_aton()"
2400 cat > $TMPC << EOF
2401 #include <sys/types.h>
2402 #include <sys/socket.h>
2403 #include <arpa/inet.h>
2404 int main(void) { (void) inet_aton(0, 0); return 0; }
2406 _use_aton=yes
2407 if cc_check $_ld_sock ; then
2408 # NOTE: Linux has libresolv but does not need it
2410 echores "yes (using $_ld_sock)"
2411 elif cc_check $_ld_sock -lresolv ; then
2412 # NOTE: needed for SunOS at least
2413 _ld_sock="$_ld_sock -lresolv"
2414 echores "yes (using $_ld_sock)"
2415 else
2416 _use_aton=no
2417 _network=no
2418 echores "no (=> network support disabled)"
2422 _def_use_aton='#undef USE_ATON'
2423 if test "$_use_aton" != no; then
2424 _def_use_aton='#define USE_ATON 1'
2428 echocheck "inttypes.h (required)"
2429 cat > $TMPC << EOF
2430 #include <inttypes.h>
2431 int main(void) { return 0; }
2433 _inttypes=no
2434 cc_check && _inttypes=yes
2435 if test "$_inttypes" = yes ; then
2436 # nothing to do
2438 else
2439 echores "no"
2440 echocheck "bitypes.h (inttypes.h predecessor)"
2441 cat > $TMPC << EOF
2442 #include <sys/bitypes.h>
2443 int main(void) { return 0; }
2445 _inttypes=no
2446 cc_check && _inttypes=yes
2447 if test "$_inttypes" = yes ; then
2448 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."
2449 else
2450 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2453 echores "$_inttypes"
2456 echocheck "int_fastXY_t in inttypes.h"
2457 cat > $TMPC << EOF
2458 #include <inttypes.h>
2459 int main(void) {
2460 volatile int_fast16_t v= 0;
2461 return v; }
2463 _fast_inttypes=no
2464 cc_check && _fast_inttypes=yes
2465 if test "$_fast_inttypes" = yes ; then
2466 # nothing to do
2468 else
2469 _def_fast_inttypes='
2470 typedef signed char int_fast8_t;
2471 typedef signed int int_fast16_t;
2472 typedef signed int int_fast32_t;
2473 typedef unsigned char uint_fast8_t;
2474 typedef unsigned int uint_fast16_t;
2475 typedef unsigned int uint_fast32_t;'
2477 echores "$_fast_inttypes"
2480 echocheck "word size"
2481 _mp_wordsize="#undef MP_WORDSIZE"
2482 cat > $TMPC << EOF
2483 #include <stdio.h>
2484 #include <sys/types.h>
2485 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2487 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2488 echores "$_wordsize"
2491 echocheck "stddef.h"
2492 cat > $TMPC << EOF
2493 #include <stddef.h>
2494 int main(void) { return 0; }
2496 _stddef=no
2497 cc_check && _stddef=yes
2498 if test "$_stddef" = yes ; then
2499 _def_stddef='#define HAVE_STDDEF_H 1'
2500 else
2501 _def_stddef='#undef HAVE_STDDEF_H'
2503 echores "$_stddef"
2506 echocheck "malloc.h"
2507 cat > $TMPC << EOF
2508 #include <malloc.h>
2509 int main(void) { (void) malloc(0); return 0; }
2511 _malloc=no
2512 cc_check && _malloc=yes
2513 if test "$_malloc" = yes ; then
2514 _def_malloc='#define HAVE_MALLOC_H 1'
2515 else
2516 _def_malloc='#undef HAVE_MALLOC_H'
2518 # malloc.h emits a warning in FreeBSD and OpenBSD
2519 (freebsd || openbsd) && _def_malloc='#undef HAVE_MALLOC_H'
2520 echores "$_malloc"
2523 echocheck "memalign()"
2524 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2525 cat > $TMPC << EOF
2526 #include <malloc.h>
2527 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2529 _memalign=no
2530 cc_check && _memalign=yes
2531 if test "$_memalign" = yes ; then
2532 _def_memalign='#define HAVE_MEMALIGN 1'
2533 else
2534 _def_memalign='#undef HAVE_MEMALIGN'
2536 echores "$_memalign"
2539 echocheck "alloca.h"
2540 cat > $TMPC << EOF
2541 #include <alloca.h>
2542 int main(void) { (void) alloca(0); return 0; }
2544 _alloca=no
2545 cc_check && _alloca=yes
2546 if cc_check ; then
2547 _def_alloca='#define HAVE_ALLOCA_H 1'
2548 else
2549 _def_alloca='#undef HAVE_ALLOCA_H'
2551 echores "$_alloca"
2554 echocheck "mman.h"
2555 cat > $TMPC << EOF
2556 #include <sys/types.h>
2557 #include <sys/mman.h>
2558 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2560 _mman=no
2561 cc_check && _mman=yes
2562 if test "$_mman" = yes ; then
2563 _def_mman='#define HAVE_SYS_MMAN_H 1'
2564 else
2565 _def_mman='#undef HAVE_SYS_MMAN_H'
2567 echores "$_mman"
2569 echocheck "dynamic loader"
2570 cat > $TMPC << EOF
2571 #include <dlfcn.h>
2572 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2574 _dl=no
2575 if cc_check ; then
2576 _dl=yes
2577 elif cc_check -ldl ; then
2578 _dl=yes
2579 _ld_dl='-ldl'
2581 if test "$_dl" = yes ; then
2582 _def_dl='#define HAVE_LIBDL 1'
2583 else
2584 _def_dl='#undef HAVE_LIBDL'
2586 echores "$_dl"
2589 echocheck "dynamic a/v plugins support"
2590 if test "$_dl" = no ; then
2591 _dynamic_plugins=no
2593 if test "$_dynamic_plugins" = yes ; then
2594 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
2595 else
2596 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
2598 echores "$_dynamic_plugins"
2601 #echocheck "dynamic linking"
2602 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
2603 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
2604 #cat > $TMPC << EOF
2605 #int main(void) { return 0; }
2606 #EOF
2607 #if cc_check -rdynamic ; then
2608 # _ld_dl_dynamic='-rdynamic'
2609 #elif cc_check -Bdynamic ; then
2610 # _ld_dl_dynamic='-Bdynamic'
2611 #elif cc_check ; then
2612 # _ld_dl_dynamic=''
2614 #echores "using $_ld_dl_dynamic"
2617 echocheck "pthread"
2618 cat > $TMPC << EOF
2619 #include <pthread.h>
2620 void* func(void *arg) { return arg; }
2621 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
2623 if mingw32 ; then
2624 _ld_pthread=''
2625 elif ( cc_check && $TMPO ) ; then # QNX
2626 _ld_pthread=''
2627 elif ( cc_check -lpthread && $TMPO ) ; then
2628 _ld_pthread='-lpthread'
2629 elif ( cc_check -pthread && $TMPO ) ; then
2630 _ld_pthread='-pthread'
2631 else
2632 if test "$_ld_static" ; then
2633 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2634 if ( cc_check -lpthread ) ; then
2635 _ld_pthread='-lpthread'
2636 elif ( cc_check -pthread ) ; then
2637 _ld_pthread='-pthread'
2638 else
2639 echores "no static pthread found (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, Win32 loader disabled)"
2640 _ld_pthread='' ; _nas=no ; _tv_v4l=no ; _macosx=no ; _win32=no
2642 else
2643 echores "no (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled)"
2644 _ld_pthread='' ; _nas=no ; _tv_v4l=no ; _macosx=no ; _win32=no
2647 if test "$_ld_pthread" != '' ; then
2648 echores "yes (using $_ld_pthread)"
2649 _pthreads='yes'
2650 _def_pthreads='#define HAVE_PTHREADS 1'
2651 else
2652 echores "no"
2653 _pthreads=''
2654 _def_pthreads='#undef HAVE_PTHREADS'
2658 echocheck "sys/soundcard.h"
2659 cat > $TMPC << EOF
2660 #include <sys/soundcard.h>
2661 int main(void) { return 0; }
2663 _sys_soundcard=no
2664 cc_check && _sys_soundcard=yes
2665 if test "$_sys_soundcard" = yes ; then
2666 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
2667 _inc_soundcard='#include <sys/soundcard.h>'
2668 else
2669 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
2671 echores "$_sys_soundcard"
2673 if test "$_sys_soundcard" != yes ; then
2674 echocheck "soundcard.h"
2675 cat > $TMPC << EOF
2676 #include <soundcard.h>
2677 int main(void) { return 0; }
2679 _soundcard=no
2680 cc_check && _soundcard=yes
2681 if linux || test "$_ossaudio" != no ; then
2682 # use soundcard.h on Linux, or when OSS support is enabled
2683 echores "$_soundcard"
2684 else
2685 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
2686 echores "$_soundcard, but ignored!"
2687 _soundcard=no
2689 if test "$_soundcard" = yes ; then
2690 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
2691 _inc_soundcard='#include <soundcard.h>'
2692 else
2693 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2695 else
2696 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2700 echocheck "sys/dvdio.h"
2701 cat > $TMPC << EOF
2702 #include <unistd.h>
2703 #include <sys/dvdio.h>
2704 int main(void) { return 0; }
2706 _dvdio=no
2707 cc_check && _dvdio=yes
2708 if test "$_dvdio" = yes ; then
2709 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
2710 else
2711 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
2713 echores "$_dvdio"
2716 echocheck "sys/cdio.h"
2717 cat > $TMPC << EOF
2718 #include <unistd.h>
2719 #include <sys/cdio.h>
2720 int main(void) { return 0; }
2722 _cdio=no
2723 cc_check && _cdio=yes
2724 if test "$_cdio" = yes ; then
2725 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
2726 else
2727 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
2729 echores "$_cdio"
2732 echocheck "linux/cdrom.h"
2733 cat > $TMPC << EOF
2734 #include <sys/types.h>
2735 #include <linux/cdrom.h>
2736 int main(void) { return 0; }
2738 _cdrom=no
2739 cc_check && _cdrom=yes
2740 if test "$_cdrom" = yes ; then
2741 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
2742 else
2743 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
2745 echores "$_cdrom"
2748 echocheck "dvd.h"
2749 cat > $TMPC << EOF
2750 #include <dvd.h>
2751 int main(void) { return 0; }
2753 _dvd=no
2754 cc_check && _dvd=yes
2755 if test "$_dvd" = yes ; then
2756 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
2757 else
2758 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
2760 echores "$_dvd"
2763 echocheck "BSDI dvd.h"
2764 cat > $TMPC << EOF
2765 #include <dvd.h>
2766 int main(void) { return 0; }
2768 _bsdi_dvd=no
2769 cc_check && _bsdi_dvd=yes
2770 if test "$_bsdi_dvd" = yes ; then
2771 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
2772 else
2773 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
2775 echores "$_bsdi_dvd"
2778 echocheck "HPUX SCSI header"
2779 cat > $TMPC << EOF
2780 #include <sys/scsi.h>
2781 int main(void) { return 0; }
2783 _hpux_scsi_h=no
2784 cc_check && _hpux_scsi_h=yes
2785 if test "$_hpux_scsi_h" = yes ; then
2786 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
2787 else
2788 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
2790 echores "$_hpux_scsi_h"
2793 echocheck "userspace SCSI headers (Solaris)"
2794 cat > $TMPC << EOF
2795 # include <unistd.h>
2796 # include <stropts.h>
2797 # include <sys/scsi/scsi_types.h>
2798 # include <sys/scsi/impl/uscsi.h>
2799 int main(void) { return 0; }
2801 _sol_scsi_h=no
2802 cc_check && _sol_scsi_h=yes
2803 if test "$_sol_scsi_h" = yes ; then
2804 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
2805 else
2806 _def_sol_scsi_h='#undef SOLARIS_USCSI'
2808 echores "$_sol_scsi_h"
2811 echocheck "termcap"
2812 if test "$_termcap" = auto ; then
2813 cat > $TMPC <<EOF
2814 int main(void) { return 0; }
2816 _termcap=no
2817 cc_check -ltermcap && _termcap=yes && _ld_termcap='-ltermcap'
2818 cc_check -ltinfo && _termcap=yes && _ld_termcap='-ltinfo'
2820 if test "$_termcap" = yes ; then
2821 _def_termcap='#define USE_TERMCAP 1'
2822 echores "yes (using $_ld_termcap)"
2823 else
2824 _def_termcap='#undef USE_TERMCAP'
2825 echores no
2829 echocheck "termios"
2830 if test "$_termios" = auto ; then
2831 cat > $TMPC <<EOF
2832 #include <sys/termios.h>
2833 int main(void) { return 0; }
2835 _termios=no
2836 cc_check && _termios=yes
2837 _def_termios_h_name='sys/termios.h'
2839 # second test:
2840 if test "$_termios" = no ; then
2841 cat > $TMPC <<EOF
2842 #include <termios.h>
2843 int main(void) { return 0; }
2845 _termios=no
2846 cc_check && _termios=yes
2847 _def_termios_h_name='termios.h'
2850 if test "$_termios" = yes ; then
2851 _def_termios='#define HAVE_TERMIOS 1'
2852 _def_termios_h='#undef HAVE_TERMIOS_H'
2853 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
2855 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
2856 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
2857 elif test "$_def_termios_h_name" = 'termios.h' ; then
2858 _def_termios_h='#define HAVE_TERMIOS_H 1'
2860 echores "yes (using $_def_termios_h_name)"
2861 else
2862 _def_termios='#undef HAVE_TERMIOS'
2863 _def_termios_h_name=''
2864 echores "no"
2868 echocheck "shm"
2869 if test "$_shm" = auto ; then
2870 cat > $TMPC << EOF
2871 #include <sys/types.h>
2872 #include <sys/shm.h>
2873 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
2875 _shm=no
2876 cc_check && _shm=yes
2878 if test "$_shm" = yes ; then
2879 _def_shm='#define HAVE_SHM 1'
2880 else
2881 _def_shm='#undef HAVE_SHM'
2883 echores "$_shm"
2886 # XXX: FIXME, add runtime checking
2887 echocheck "linux devfs"
2888 echores "$_linux_devfs"
2891 echocheck "scandir()"
2892 cat > $TMPC << EOF
2893 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
2895 _scandir=no
2896 cc_check && _scandir=yes
2897 if test "$_scandir" = yes ; then
2898 _def_scandir='#define HAVE_SCANDIR 1'
2899 else
2900 _def_scandir='#undef HAVE_SCANDIR'
2902 echores "$_scandir"
2905 echocheck "strsep()"
2906 cat > $TMPC << EOF
2907 #include <string.h>
2908 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
2910 _strsep=no
2911 cc_check && _strsep=yes
2912 if test "$_strsep" = yes ; then
2913 _def_strsep='#define HAVE_STRSEP 1'
2914 else
2915 _def_strsep='#undef HAVE_STRSEP'
2917 echores "$_strsep"
2919 echocheck "strlcpy()"
2920 cat > $TMPC << EOF
2921 #include <string.h>
2922 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
2924 _strlcpy=no
2925 cc_check && _strlcpy=yes
2926 if test "$_strlcpy" = yes ; then
2927 _def_strlcpy='#define HAVE_STRLCPY 1'
2928 else
2929 _def_strlcpy='#undef HAVE_STRLCPY'
2931 echores "$_strlcpy"
2933 echocheck "strlcat()"
2934 cat > $TMPC << EOF
2935 #include <string.h>
2936 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
2938 _strlcat=no
2939 cc_check && _strlcat=yes
2940 if test "$_strlcat" = yes ; then
2941 _def_strlcat='#define HAVE_STRLCAT 1'
2942 else
2943 _def_strlcat='#undef HAVE_STRLCAT'
2945 echores "$_strlcat"
2947 echocheck "fseeko()"
2948 cat > $TMPC << EOF
2949 #include <stdio.h>
2950 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
2952 _fseeko=no
2953 cc_check && _fseeko=yes
2954 if test "$_fseeko" = yes ; then
2955 _def_fseeko='#define HAVE_FSEEKO 1'
2956 else
2957 _def_fseeko='#undef HAVE_FSEEKO'
2959 echores "$_fseeko"
2961 echocheck "localtime_r()"
2962 cat > $TMPC << EOF
2963 #include <time.h>
2964 int main( void ) { localtime_r(NULL, NULL); }
2966 _localtime_r=no
2967 cc_check && _localtime_r=yes
2968 if test "$_localtime_r" = yes ; then
2969 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
2970 else
2971 _def_localtime_r='#undef HAVE_LOCALTIME_R'
2973 echores "$_localtime_r"
2975 echocheck "vsscanf()"
2976 cat > $TMPC << EOF
2977 #include <stdarg.h>
2978 int main(void) { vsscanf(0, 0, 0); return 0; }
2980 _vsscanf=no
2981 cc_check && _vsscanf=yes
2982 if test "$_vsscanf" = yes ; then
2983 _def_vsscanf='#define HAVE_VSSCANF 1'
2984 else
2985 _def_vsscanf='#undef HAVE_VSSCANF'
2987 echores "$_vsscanf"
2990 echocheck "swab()"
2991 cat > $TMPC << EOF
2992 #include <unistd.h>
2993 int main(void) { swab(0, 0, 0); return 0; }
2995 _swab=no
2996 cc_check && _swab=yes
2997 if test "$_swab" = yes ; then
2998 _def_swab='#define HAVE_SWAB 1'
2999 else
3000 _def_swab='#undef HAVE_SWAB'
3002 echores "$_swab"
3004 echocheck "posix select()"
3005 cat > $TMPC << EOF
3006 #include <stdio.h>
3007 #include <stdlib.h>
3008 #include <sys/types.h>
3009 #include <string.h>
3010 #include <sys/time.h>
3011 #include <unistd.h>
3012 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3014 _posix_select=no
3015 cc_check && _posix_select=yes
3016 if test "$_posix_select" = no ; then
3017 _def_no_posix_select='#define HAVE_NO_POSIX_SELECT 1'
3018 else
3019 _def_no_posix_select='#undef HAVE_NO_POSIX_SELECT'
3021 echores "$_posix_select"
3024 echocheck "gettimeofday()"
3025 cat > $TMPC << EOF
3026 #include <stdio.h>
3027 #include <sys/time.h>
3028 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3030 _gettimeofday=no
3031 cc_check && _gettimeofday=yes
3032 if test "$_gettimeofday" = yes ; then
3033 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3034 else
3035 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3037 echores "$_gettimeofday"
3040 echocheck "glob()"
3041 cat > $TMPC << EOF
3042 #include <stdio.h>
3043 #include <glob.h>
3044 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3046 _glob=no
3047 cc_check && _glob=yes
3048 if test "$_glob" = yes ; then
3049 _def_glob='#define HAVE_GLOB 1'
3050 else
3051 _def_glob='#undef HAVE_GLOB'
3053 echores "$_glob"
3056 echocheck "sys/sysinfo.h"
3057 cat > $TMPC << EOF
3058 #include <sys/sysinfo.h>
3059 int main(void) {
3060 struct sysinfo s_info;
3061 sysinfo(&s_info);
3062 return 0;
3065 _sys_sysinfo=no
3066 cc_check && _sys_sysinfo=yes
3067 if test "$_sys_sysinfo" = yes ; then
3068 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3069 _inc_sysinfo='#include <sys/sysinfo.h>'
3070 else
3071 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3073 echores "$_sys_sysinfo"
3076 echocheck "Mac OS X APIs"
3077 if test "$_macosx" = auto ; then
3078 if darwin && ppc; then
3079 _macosx=yes
3080 else
3081 _macosx=no
3082 _def_macosx='#undef MACOSX'
3083 _noaomodules="macosx $_noaomodules"
3084 _novomodules="quartz $_novomodules"
3087 if test "$_macosx" = yes ; then
3088 cat > $TMPC <<EOF
3089 #include <Carbon/Carbon.h>
3090 #include <QuickTime/QuickTime.h>
3091 #include <CoreAudio/CoreAudio.h>
3092 int main(void) {
3093 EnterMovies();
3094 ExitMovies();
3095 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3098 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3099 _macosx=yes
3100 _macosx_frameworks="-framework Carbon -framework QuickTime -framework CoreAudio"
3101 _def_macosx='#define MACOSX 1'
3102 _aosrc="$_aosrc ao_macosx.c"
3103 _aomodules="macosx $_aomodules"
3104 _vosrc="$_vosrc vo_quartz.c"
3105 _vomodules="quartz $_vomodules"
3106 else
3107 _macosx=no
3108 _def_macosx='#undef MACOSX'
3109 _noaomodules="macosx $_noaomodules"
3110 _novomodules="quartz $_novomodules"
3113 echores "$_macosx"
3116 echocheck "Samba support (libsmbclient)"
3117 if test "$_smbsupport" = yes; then
3118 _ld_smb="-lsmbclient"
3120 if test "$_smbsupport" = auto; then
3121 _smbsupport=no
3122 cat > $TMPC << EOF
3123 #include <libsmbclient.h>
3124 int main(void) { smbc_opendir("smb://"); return 0; }
3126 if cc_check -lsmbclient ; then
3127 _smbsupport=yes
3128 _ld_smb="-lsmbclient"
3129 else
3130 if cc_check -lsmbclient $_ld_dl ; then
3131 _smbsupport=yes
3132 _ld_smb="-lsmbclient $_ld_dl"
3133 else
3134 if cc_check -lsmbclient $_ld_dl -lnsl ; then
3135 _smbsupport=yes
3136 _ld_smb="-lsmbclient $_ld_dl -lnsl"
3142 if test "$_smbsupport" = yes; then
3143 _def_smbsupport="#define LIBSMBCLIENT"
3144 _inputmodules="smb $_inputmodules"
3145 else
3146 _def_smbsupport="#undef LIBSMBCLIENT"
3147 _noinputmodules="smb $_noinputmodules"
3149 echores "$_smbsupport"
3152 #########
3153 # VIDEO #
3154 #########
3157 echocheck "3dfx"
3158 if test "$_3dfx" = yes ; then
3159 _def_3dfx='#define HAVE_3DFX 1'
3160 _vosrc="$_vosrc vo_3dfx.c"
3161 _vomodules="3dfx $_vomodules"
3162 else
3163 _def_3dfx='#undef HAVE_3DFX'
3164 _novomodules="3dfx $_novomodules"
3166 echores "$_3dfx"
3169 echocheck "tdfxfb"
3170 if test "$_tdfxfb" = yes ; then
3171 _def_tdfxfb='#define HAVE_TDFXFB 1'
3172 _vosrc="$_vosrc vo_tdfxfb.c"
3173 _vomodules="tdfxfb $_vomodules"
3174 else
3175 _def_tdfxfb='#undef HAVE_TDFXFB'
3176 _novomodules="tdfxfb $_novomodules"
3178 echores "$_tdfxfb"
3180 echocheck "tdfxvid"
3181 if test "$_tdfxvid" = yes ; then
3182 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3183 _vosrc="$_vosrc vo_tdfx_vid.c"
3184 _vomodules="tdfx_vid $_vomodules"
3185 else
3186 _def_tdfxvid='#undef HAVE_TDFX_VID'
3187 _novomodules="tdfx_vid $_novomodules"
3189 echores "$_tdfxfb"
3191 echocheck "tga"
3192 if test "$_tga" = yes ; then
3193 _def_tga='#define HAVE_TGA 1'
3194 _vosrc="$_vosrc vo_tga.c"
3195 _vomodules="tga $_vomodules"
3196 else
3197 _def_tga='#undef HAVE_TGA'
3198 _novomodules="tga $_novomodules"
3200 echores "$_tga"
3202 echocheck "DirectFB headers presence"
3203 if test -z "$_inc_directfb" ; then
3204 for I in /usr/include /usr/local/include $_inc_extra; do
3205 if test -d "$I/directfb" && test -f "$I/directfb/directfb.h" ; then
3206 _inc_directfb="-I$I/directfb"
3207 echores "yes (using $_inc_directfb)"
3208 break
3210 if test -d "$I" && test -f "$I/directfb.h" ; then
3211 _inc_directfb="-I$I"
3212 echores "yes (using $_inc_directfb)"
3213 break
3215 done
3216 if test -z "$_inc_directfb" ; then
3217 _directfb=no
3218 echores "not found"
3220 else
3221 echores "yes (using $_inc_directfb)"
3223 if test "$_inc_directfb" = "-I/usr/include" ; then
3224 _inc_directfb=""
3227 echocheck "DirectFB"
3228 if test "$_directfb" = auto ; then
3229 _directfb=no
3230 cat > $TMPC <<EOF
3231 #include <directfb.h>
3232 int main(void) { IDirectFB *foo; return 0; }
3234 linux && test -c /dev/fb0 && cc_check $_inc_directfb -ldirectfb && _directfb=yes
3237 if test "$_directfb" = yes; then
3238 cat > $TMPC <<EOF
3239 #include <directfb.h>
3240 int main(void) {
3241 printf ("%i",(directfb_major_version*100+directfb_minor_version)*100+directfb_micro_version);
3242 return 0;
3245 if cc_check $_inc_directfb -ldirectfb && "$TMPO" >> "$TMPLOG" ; then
3246 _directfb_version=`"$TMPO"`
3247 _def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
3248 echores "yes ($_directfb_version)"
3249 else
3250 _directfb=no
3251 echores "no (failed to get version)"
3253 else
3254 echores "$_directfb"
3257 if test "$_directfb" = yes ; then
3258 _def_directfb='#define HAVE_DIRECTFB 1'
3259 if test "$_directfb_version" -ge 913; then
3260 _vosrc="$_vosrc vo_directfb2.c"
3261 else
3262 _vosrc="$_vosrc vo_directfb.c"
3264 _vomodules="directfb $_vomodules"
3265 _ld_directfb='-ldirectfb'
3267 if test "$_directfb_version" -ge 915; then
3268 _vosrc="$_vosrc vo_dfbmga.c"
3269 _vomodules="dfbmga $_vomodules"
3271 else
3272 _def_directfb='#undef HAVE_DIRECTFB'
3273 _novomodules="directfb $_novomodules"
3274 _inc_directfb=""
3278 echocheck "X11 headers presence"
3279 if test -z "$_inc_x11" ; then
3280 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3281 if test -d "$I/X11" && test -f "$I/X11/Xlib.h" ; then
3282 _inc_x11="-I$I"
3283 echores "yes (using $I)"
3284 break
3286 done
3287 if test -z "$_inc_x11" ; then
3288 _x11=no
3289 echores "not found (check if the dev(el) packages are installed)"
3291 else
3292 echores "yes (using $_inc_x11)"
3294 if test "$_inc_x11" = "-I/usr/include" ; then
3295 _inc_x11=""
3299 echocheck "X11 libs presence"
3300 if test -z "$_ld_x11" ; then
3301 for I in /usr/X11R6/lib /usr/lib/X11R6 /usr/X11/lib /usr/lib32 /usr/openwin/lib /usr/X11R6/lib64 /usr/lib ; do
3302 if test -d "$I" && ( test -f "$I/libX11.so" || test -f "$I/libX11.a" || test -f "$I/libX11.dll.a" ) ; then
3303 if netbsd; then
3304 _ld_x11="-L$I -Wl,-R$I"
3305 else
3306 _ld_x11="-L$I"
3308 echores "yes (using $I)"
3309 break;
3311 done
3312 if test -z "$_ld_x11" ; then
3313 _x11=no
3314 echores "not found (check if the dev(el) packages are installed)"
3316 else
3317 echores "yes (using $_ld_x11)"
3319 _ld_x11="$_ld_x11 -lXext -lX11 $_ld_sock"
3322 echocheck "X11"
3323 if test "$_x11" != no ; then
3324 cat > $TMPC <<EOF
3325 #include <X11/Xlib.h>
3326 #include <X11/Xutil.h>
3327 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3329 _x11=no
3330 cc_check $_inc_x11 $_ld_x11 && _x11=yes
3332 if test "$_x11" = yes ; then
3333 _def_x11='#define HAVE_X11 1'
3334 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3335 _vomodules="x11 xover $_vomodules"
3336 else
3337 _def_x11='#undef HAVE_X11'
3338 _inc_x11=''
3339 _ld_x11=''
3340 _novomodules="x11 $_novomodules"
3342 echores "$_x11"
3345 echocheck "DPMS"
3346 _xdpms3=no
3347 if test "$_x11" = yes ; then
3348 cat > $TMPC <<EOF
3349 #include <X11/Xmd.h>
3350 #include <X11/Xlib.h>
3351 #include <X11/Xutil.h>
3352 #include <X11/Xatom.h>
3353 #include <X11/extensions/dpms.h>
3354 int main(void) {
3355 (void) DPMSQueryExtension(0, 0, 0);
3358 cc_check $_inc_x11 -lXdpms $_ld_x11 && _xdpms3=yes
3360 _xdpms4=no
3361 if test "$_x11" = yes ; then
3362 cat > $TMPC <<EOF
3363 #include <X11/Xlib.h>
3364 #include <X11/extensions/dpms.h>
3365 int main(void) {
3366 (void) DPMSQueryExtension(0, 0, 0);
3369 cc_check $_inc_x11 $_ld_x11 && _xdpms4=yes
3371 if test "$_xdpms4" = yes ; then
3372 _def_xdpms='#define HAVE_XDPMS 1'
3373 echores "yes (using Xdpms 4)"
3374 elif test "$_xdpms3" = yes ; then
3375 _def_xdpms='#define HAVE_XDPMS 1'
3376 _ld_x11="-lXdpms $_ld_x11"
3377 echores "yes (using Xdpms 3)"
3378 else
3379 _def_xdpms='#undef HAVE_XDPMS'
3380 echores "no"
3384 echocheck "Xv"
3385 if test "$_x11" = yes && test "$_xv" != no ; then
3386 cat > $TMPC <<EOF
3387 #include <X11/Xlib.h>
3388 #include <X11/extensions/Xvlib.h>
3389 int main(void) { (void) XvGetPortAttribute(0, 0, 0, 0); return 0; }
3391 _xv=no
3392 cc_check $_inc_x11 -lXv $_ld_x11 && _xv=yes
3393 else
3394 _xv=no
3396 if test "$_xv" = yes ; then
3397 _def_xv='#define HAVE_XV 1'
3398 _ld_xv='-lXv'
3399 _vosrc="$_vosrc vo_xv.c"
3400 _vomodules="xv $_vomodules"
3401 else
3402 _def_xv='#undef HAVE_XV'
3403 _novomodules="xv $_novomodules"
3405 echores "$_xv"
3408 echocheck "XvMC"
3409 if test "$_x11" = yes && test "$_xv" = yes && test "$_xvmc" != no ; then
3410 _xvmc=no
3411 cat > $TMPC <<EOF
3412 #include <X11/Xlib.h>
3413 #include <X11/extensions/Xvlib.h>
3414 #include <X11/extensions/XvMClib.h>
3415 int main(void) {
3416 (void) XvMCQueryExtension(0,0,0);
3417 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3418 return 0; }
3420 cc_check $_inc_x11 -lXvMC -l$_xvmclib $_ld_xv $_ld_x11 && _xvmc=yes
3422 if test "$_xvmc" = yes ; then
3423 _def_xvmc='#define HAVE_XVMC 1'
3424 _ld_xvmc="-lXvMC -l$_xvmclib"
3425 _vosrc="$_vosrc vo_xvmc.c"
3426 _vomodules="xvmc $_vomodules"
3427 else
3428 _def_xvmc='#undef HAVE_XVMC'
3429 _novomodules="xvmc $_novomodules"
3431 echores "$_xvmc"
3434 echocheck "Xinerama"
3435 if test "$_x11" = yes && test "$_xinerama" != no ; then
3436 cat > $TMPC <<EOF
3437 #include <X11/Xlib.h>
3438 #include <X11/extensions/Xinerama.h>
3439 int main(void) { (void) XineramaIsActive(0); return 0; }
3441 _xinerama=no
3442 cc_check $_inc_x11 -lXinerama $_ld_x11 && _xinerama=yes
3443 else
3444 _xinerama=no
3446 if test "$_xinerama" = yes ; then
3447 _def_xinerama='#define HAVE_XINERAMA 1'
3448 _ld_xinerama='-lXinerama'
3449 else
3450 _def_xinerama='#undef HAVE_XINERAMA'
3452 echores "$_xinerama"
3455 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3456 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3457 # named 'X extensions' or something similar.
3458 # This check may be useful for future mplayer versions (to change resolution)
3459 # If you run into problems, remove '-lXxf86vm'.
3460 echocheck "Xxf86vm"
3461 if test "$_x11" = yes && test "$_vm" != no ; then
3462 cat > $TMPC <<EOF
3463 #include <X11/Xlib.h>
3464 #include <X11/extensions/xf86vmode.h>
3465 #include <X11/XF86keysym.h>
3466 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3468 _vm=no
3469 cc_check $_inc_x11 -lXxf86vm $_ld_x11 && _vm=yes
3470 else
3471 _vm=no
3473 if test "$_vm" = yes ; then
3474 _def_vm='#define HAVE_XF86VM 1'
3475 _ld_vm='-lXxf86vm'
3476 else
3477 _def_vm='#undef HAVE_XF86VM'
3479 echores "$_vm"
3482 echocheck "DGA"
3483 # Version 2 is preferred to version 1 if available
3484 if test "$_dga" = auto ; then
3485 cat > $TMPC << EOF
3486 #include <X11/Xlib.h>
3487 #include <X11/extensions/xf86dga.h>
3488 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
3490 _dga=no
3491 cc_check $_inc_x11 -lXxf86dga -lXxf86vm $_ld_x11 && _dga=1
3493 cat > $TMPC << EOF
3494 #include <X11/Xlib.h>
3495 #include <X11/extensions/xf86dga.h>
3496 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
3498 cc_check $_inc_x11 -lXxf86dga $_ld_x11 && _dga=2
3501 _def_dga='#undef HAVE_DGA'
3502 _def_dga2='#undef HAVE_DGA2'
3503 if test "$_dga" = 1 ; then
3504 _def_dga='#define HAVE_DGA 1'
3505 _ld_dga='-lXxf86dga'
3506 _vosrc="$_vosrc vo_dga.c"
3507 _vomodules="dga $_vomodules"
3508 echores "yes (using DGA 1.0)"
3509 elif test "$_dga" = 2 ; then
3510 _def_dga='#define HAVE_DGA 1'
3511 _def_dga2='#define HAVE_DGA2 1'
3512 _ld_dga='-lXxf86dga'
3513 _vosrc="$_vosrc vo_dga.c"
3514 _vomodules="dga $_vomodules"
3515 echores "yes (using DGA 2.0)"
3516 elif test "$_dga" = no ; then
3517 echores "no"
3518 _novomodules="dga $_novomodules"
3519 else
3520 die "DGA version must be 1 or 2"
3524 echocheck "OpenGL"
3525 #Note: this test is run even with --enable-gl since we autodetect $_ld_gl
3526 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
3527 cat > $TMPC << EOF
3528 #include <GL/gl.h>
3529 int main(void) { return 0; }
3531 _gl=no
3532 if cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm ; then
3533 _gl=yes
3534 _ld_gl="-lGL"
3535 elif cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm $_ld_pthread ; then
3536 _gl=yes
3537 _ld_gl="-lGL $_ld_pthread"
3538 elif cc_check -lopengl32 ; then
3539 _gl=yes
3540 _gl_win32=yes
3541 _ld_gl="-lopengl32 -lgdi32"
3543 else
3544 _gl=no
3546 if test "$_gl" = yes ; then
3547 _def_gl='#define HAVE_GL 1'
3548 if test "$_gl_win32" = yes ; then
3549 _def_gl_win32='#define GL_WIN32 1'
3550 _vosrc="$_vosrc vo_gl2.c w32_common.c gl_common.c"
3551 else
3552 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
3554 _vomodules="opengl $_vomodules"
3555 else
3556 _def_gl='#undef HAVE_GL'
3557 _def_gl_win32='#undef GL_WIN32'
3558 _novomodules="opengl $_novomodules"
3560 echores "$_gl"
3563 echocheck "/dev/mga_vid"
3564 if test "$_mga" = auto ; then
3565 _mga=no
3566 test -c /dev/mga_vid && _mga=yes
3568 if test "$_mga" = yes ; then
3569 _def_mga='#define HAVE_MGA 1'
3570 _vosrc="$_vosrc vo_mga.c"
3571 _vomodules="mga $_vomodules"
3572 else
3573 _def_mga='#undef HAVE_MGA'
3574 _novomodules="mga $_novomodules"
3576 echores "$_mga"
3579 # echocheck "syncfb"
3580 # _syncfb=no
3581 # test "$_mga" = yes && _syncfb=yes
3582 # if test "$_syncfb" = yes ; then
3583 # _def_syncfb='#define HAVE_SYNCFB 1'
3584 # _vosrc="$_vosrc vo_syncfb.c"
3585 # else
3586 # _def_syncfb='#undef HAVE_SYNCFB'
3587 # fi
3588 # echores "$_syncfb"
3591 echocheck "xmga"
3592 if test "$_xmga" = auto ; then
3593 _xmga=no
3594 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
3596 if test "$_xmga" = yes ; then
3597 _def_xmga='#define HAVE_XMGA 1'
3598 _vosrc="$_vosrc vo_xmga.c"
3599 _vomodules="xmga $_vomodules"
3600 else
3601 _def_xmga='#undef HAVE_XMGA'
3602 _novomodules="xmga $_novomodules"
3604 echores "$_xmga"
3607 echocheck "GGI"
3608 if test "$_ggi" = auto ; then
3609 cat > $TMPC << EOF
3610 #include <ggi/ggi.h>
3611 int main(void) { return 0; }
3613 _ggi=no
3614 cc_check -lggi && _ggi=yes
3616 if test "$_ggi" = yes ; then
3617 _def_ggi='#define HAVE_GGI 1'
3618 _ld_ggi='-lggi'
3619 _vosrc="$_vosrc vo_ggi.c"
3620 _vomodules="ggi $_vomodules"
3621 else
3622 _def_ggi='#undef HAVE_GGI'
3623 _novomodules="ggi $_novomodules"
3625 echores "$_ggi"
3628 echocheck "AA"
3629 if test "$_aa" = auto ; then
3630 cat > $TMPC << EOF
3631 #include <aalib.h>
3632 int main(void) { (void) aa_init(0, 0, 0); return 0; }
3634 _aa=no
3635 cc_check -laa && _aa=yes
3637 if test "$_aa" = yes ; then
3638 _def_aa='#define HAVE_AA 1'
3639 if cygwin ; then
3640 _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6`
3641 else
3642 _ld_aa='-laa'
3644 _vosrc="$_vosrc vo_aa.c"
3645 _vomodules="aa $_vomodules"
3646 else
3647 _def_aa='#undef HAVE_AA'
3648 _novomodules="aa $_novomodules"
3650 echores "$_aa"
3653 echocheck "CACA"
3654 if test "$_caca" = auto ; then
3655 _caca=no
3656 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3657 cat > $TMPC << EOF
3658 #include <caca.h>
3659 int main(void) { (void) caca_init(); return 0; }
3661 cc_check `caca-config --libs` && _caca=yes
3664 if test "$_caca" = yes ; then
3665 _def_caca='#define HAVE_CACA 1'
3666 _inc_caca=`caca-config --cflags`
3667 _ld_caca=`caca-config --libs`
3668 _vosrc="$_vosrc vo_caca.c"
3669 _vomodules="caca $_vomodules"
3670 else
3671 _def_caca='#undef HAVE_CACA'
3672 _novomodules="caca $_novomodules"
3674 echores "$_caca"
3677 echocheck "SVGAlib"
3678 if test "$_svga" = auto ; then
3679 cat > $TMPC << EOF
3680 #include <vga.h>
3681 #include <vgagl.h>
3682 int main(void) { return 0; }
3684 _svga=no
3685 cc_check -lvgagl -lvga $_ld_lm && _svga=yes
3687 if test "$_svga" = yes ; then
3688 _def_svga='#define HAVE_SVGALIB 1'
3689 _ld_svga="-lvgagl -lvga $_ld_lm"
3690 _vosrc="$_vosrc vo_svga.c"
3691 _vomodules="svga $_vomodules"
3692 else
3693 _def_svga='#undef HAVE_SVGALIB'
3694 _novomodules="svga $_novomodules"
3696 echores "$_svga"
3699 echocheck "FBDev"
3700 if test "$_fbdev" = auto ; then
3701 _fbdev=no
3702 linux && test -c /dev/fb0 && _fbdev=yes
3704 if test "$_fbdev" = yes ; then
3705 _def_fbdev='#define HAVE_FBDEV 1'
3706 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
3707 _vomodules="fbdev $_vomodules"
3708 else
3709 _def_fbdev='#undef HAVE_FBDEV'
3710 _novomodules="fbdev $_novomodules"
3712 echores "$_fbdev"
3716 echocheck "DVB"
3717 if test "$_dvb" != no ; then
3718 _dvb=no
3719 cat >$TMPC << EOF
3720 #include <sys/poll.h>
3721 #include <sys/ioctl.h>
3722 #include <stdio.h>
3723 #include <time.h>
3724 #include <unistd.h>
3726 #include <ost/dmx.h>
3727 #include <ost/frontend.h>
3728 #include <ost/sec.h>
3729 #include <ost/video.h>
3730 #include <ost/audio.h>
3731 int main(void) {return 0;}
3733 if cc_check ; then
3734 _dvb=yes
3735 echores "yes"
3736 else
3737 for I in "$_inc_dvb" "-I/usr/src/DVB/ost/include" ; do
3738 if cc_check "$I" ; then
3739 _dvb=yes
3740 _inc_dvb="$I"
3741 echores "yes (using $_inc_dvb)"
3742 break
3744 done
3745 test "$_dvb" = no && echores "no (specify path to DVB/ost/include with --with-dvbincdir=DIR)"
3747 else
3748 echores "no"
3750 if test "$_dvb" = yes ; then
3751 _def_dvb='#define HAVE_DVB 1'
3752 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
3753 _aomodules="mpegpes(dvb) $_aomodules"
3754 _vomodules="mpegpes(dvb) $_vomodules"
3756 if test "$_dvbhead" != no ; then
3757 echocheck "DVB HEAD"
3758 if test "$_dvbhead" != no ; then
3759 _dvbhead=no
3761 cat >$TMPC << EOF
3762 #include <sys/poll.h>
3763 #include <sys/ioctl.h>
3764 #include <stdio.h>
3765 #include <time.h>
3766 #include <unistd.h>
3768 #include <linux/dvb/dmx.h>
3769 #include <linux/dvb/frontend.h>
3770 #include <linux/dvb/video.h>
3771 #include <linux/dvb/audio.h>
3772 int main(void) {return 0;}
3774 if cc_check ; then
3775 _dvbhead=yes
3776 echores "yes"
3777 else
3778 for I in "$_inc_dvb" "-I/usr/src/DVB/include" ; do
3779 if cc_check "$I" ; then
3780 _dvbhead=yes
3781 _inc_dvb="$I"
3782 echores "yes (using $_inc_dvb)"
3783 break
3785 done
3786 test "$_dvbhead" = no && echores "no (specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR)"
3788 else
3789 echores "no"
3791 if test "$_dvbhead" = yes ; then
3792 _def_dvb='#define HAVE_DVB_HEAD 1'
3793 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
3794 _aomodules="mpegpes(dvb) $_aomodules"
3795 _vomodules="mpegpes(dvb) $_vomodules"
3798 if test "$_dvbhead" = no && test "$_dvb" = no ; then
3799 _def_dvb='#undef HAVE_DVB'
3800 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
3801 _aomodules="mpegpes(file) $_aomodules"
3802 _vomodules="mpegpes(file) $_vomodules"
3805 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
3806 _dvbin=yes
3807 _inputmodules="dvb $_inputmodules"
3808 else
3809 _dvbin=no
3810 _noinputmodules="dvb $_noinputmodules"
3813 echocheck "PNG support"
3814 if test "$_png" = auto ; then
3815 _png=no
3816 if irix ; then
3817 # Don't check for -lpng on irix since it has its own libpng
3818 # incompatible with the GNU libpng
3819 echores "disabled on irix (not GNU libpng)"
3820 else
3821 cat > $TMPC << EOF
3822 #include <png.h>
3823 #include <string.h>
3824 int main(void) {
3825 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
3826 printf("libpng: %s\n", png_libpng_ver);
3827 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
3830 if cc_check -lpng -lz $_ld_lm ; then
3831 if "$TMPO" >> "$TMPLOG" ; then
3832 _png=yes
3833 echores yes
3834 else
3835 echores "no (mismatch of library and header versions)"
3837 else
3838 echores no
3841 else
3842 echores "$_png"
3844 if test "$_png" = yes ; then
3845 _def_png='#define HAVE_PNG 1'
3846 _ld_png='-lpng -lz'
3847 _vosrc="$_vosrc vo_png.c"
3848 _vomodules="png $_vomodules"
3849 _mkf_png="yes"
3850 else
3851 _def_png='#undef HAVE_PNG'
3852 _novomodules="png $_novomodules"
3853 _mkf_png="no"
3856 echocheck "JPEG support"
3857 if test "$_jpg" = auto ; then
3858 _jpg=no
3859 cat > $TMPC << EOF
3860 #include <stdio.h>
3861 #include <stdlib.h>
3862 #include <setjmp.h>
3863 #include <string.h>
3864 #include <jpeglib.h>
3865 int main(void) {
3866 return 0;
3869 if cc_check -ljpeg $_ld_lm ; then
3870 if "$TMPO" >> "$TMPLOG" ; then
3871 _jpg=yes
3875 echores "$_jpg"
3877 if test "$_jpg" = yes ; then
3878 _def_jpg='#define HAVE_JPEG 1'
3879 _vosrc="$_vosrc vo_jpeg.c"
3880 _vomodules="jpeg $_vomodules"
3881 _ld_jpg="-ljpeg"
3882 _mkf_jpg="yes"
3883 else
3884 _def_jpg='#undef HAVE_JPEG'
3885 _novomodules="jpeg $_novomodules"
3886 _mkf_jpg="no"
3891 echocheck "PNM support"
3892 if test "$_pnm" = yes; then
3893 _def_pnm="#define HAVE_PNM"
3894 _vosrc="$_vosrc vo_pnm.c"
3895 _vomodules="pnm $_vomodules"
3896 else
3897 _def_pnm="#undef HAVE_PNM"
3898 _novomodules="pnm $_novomodules"
3900 echores "$_pnm"
3904 echocheck "md5sum support"
3905 if test "$_md5sum" = yes; then
3906 _def_md5sum="#define HAVE_MD5SUM"
3907 _vosrc="$_vosrc vo_md5sum.c md5sum.c"
3908 _vomodules="md5sum $_vomodules"
3909 else
3910 _def_md5sum="#undef HAVE_MD5SUM"
3911 _novomodules="md5sum $_novomodules"
3913 echores "$_md5sum"
3917 echocheck "GIF support"
3918 # This is to appease people who want to force gif support.
3919 # If it is forced to yes, then we still do checks to determine
3920 # which gif library to use.
3921 if test "$_gif" = yes ; then
3922 _force_gif=yes
3923 _gif=auto
3926 if test "$_gif" = auto ; then
3927 _gif=no
3928 cat > $TMPC << EOF
3929 #include <gif_lib.h>
3930 int main(void) {
3931 return 0;
3934 if cc_check -lungif && "$TMPO" >> "$TMPLOG" ; then
3935 _gif=yes
3936 _ld_gif="-lungif"
3937 elif cc_check -lungif $_ld_x11 && "$TMPO" >> "$TMPLOG" ; then
3938 _gif=yes
3939 _ld_gif="-lungif $_ld_x11"
3940 elif cc_check -lgif && "$TMPO" >> "$TMPLOG" ; then
3941 _gif=yes
3942 _ld_gif="-lgif"
3943 elif cc_check -lgif $_ld_x11 && "$TMPO" >> "$TMPLOG" ; then
3944 _gif=yes
3945 _ld_gif="-lgif $_ld_x11"
3949 # If no library was found, and the user wants support forced,
3950 # then we force it on with libgif, as this is the safest
3951 # assumption IMHO. (libungif & libregif both create symbolic
3952 # links to libgif. We also assume that no x11 support is needed,
3953 # because if you are forcing this, then you _should_ know what
3954 # you are doing. [ Besides, package maintainers should never
3955 # have compiled x11 deps into libungif in the first place. ] )
3956 # </rant>
3957 # --Joey
3958 if test "$_force_gif" = yes && test "$_gif" = no ; then
3959 _gif=yes
3960 _ld_gif="-lgif"
3963 if test "$_gif" = yes ; then
3964 _def_gif='#define HAVE_GIF 1'
3965 _vosrc="$_vosrc vo_gif89a.c"
3966 _codecmodules="gif $_codecmodules"
3967 _vomodules="gif89a $_vomodules"
3968 _mkf_gif="yes"
3969 _gif="yes (old version, some encoding functions disabled)"
3970 _def_gif_4='#undef HAVE_GIF_4'
3972 cat > $TMPC << EOF
3973 #include <signal.h>
3974 #include <gif_lib.h>
3975 void catch() { exit(1); }
3976 int main(void) {
3977 signal(SIGSEGV, catch); // catch segfault
3978 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
3979 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
3980 return 0;
3983 if cc_check "$_ld_gif" && ( "$TMPO" ) >>"$TMPLOG" 2>&1 ; then
3984 _def_gif_4='#define HAVE_GIF_4 1'
3985 _gif="yes"
3987 else
3988 _def_gif='#undef HAVE_GIF'
3989 _def_gif_4='#undef HAVE_GIF_4'
3990 _novomodules="gif89a $_novomodules"
3991 _nocodecmodules="gif $_codecmodules"
3992 _mkf_gif="no"
3994 echores "$_gif"
3997 case "$_gif" in yes*)
3998 echocheck "broken giflib workaround"
3999 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4001 cat > $TMPC << EOF
4002 #include <gif_lib.h>
4003 int main(void) {
4004 GifFileType gif;
4005 printf("UserData is at address %p\n", gif.UserData);
4006 return 0;
4009 if cc_check "$_ld_gif" && ( "$TMPO" ) >>"$TMPLOG" 2>&1 ; then
4010 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4011 echores "disabled"
4012 else
4013 echores "enabled"
4016 esac
4019 echocheck "VESA support"
4020 if test "$_vesa" = auto ; then
4021 if x86 && linux ; then
4022 _vesa=no
4023 cat > $TMPC << EOF
4024 #include <sys/io.h>
4025 int main(void) { return 0; }
4027 cc_check && _vesa=yes
4030 if test "$_vesa" = yes ; then
4031 _def_vesa='#define HAVE_VESA 1'
4032 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c"
4033 _vomodules="vesa $_vomodules"
4034 echores "yes"
4035 else
4036 _def_vesa='#undef HAVE_VESA'
4037 echores "no (not supported on this OS/architecture)"
4038 _novomodules="vesa $_novomodules"
4041 #################
4042 # VIDEO + AUDIO #
4043 #################
4046 echocheck "SDL"
4047 if test -z "$_sdlconfig" ; then
4048 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4049 _sdlconfig="sdl-config"
4050 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4051 _sdlconfig="sdl11-config"
4052 else
4053 _sdlconfig=false
4056 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4057 cat > $TMPC << EOF
4058 #include <SDL.h>
4059 int main(int argc, char *argv[]) { return 0; }
4061 _sdl=no
4062 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4063 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4064 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4065 if test "$_sdlversion" -gt 116 ; then
4066 if test "$_sdlversion" -lt 121 ; then
4067 _def_sdlbuggy='#define BUGGY_SDL'
4068 else
4069 _def_sdlbuggy='#undef BUGGY_SDL'
4071 _sdl=yes
4072 else
4073 _sdl=outdated
4078 if test "$_sdl" = yes ; then
4079 _def_sdl='#define HAVE_SDL 1'
4080 if cygwin ; then
4081 _ld_sdl=`$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`
4082 _inc_sdl=`$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`
4083 elif mingw32 ; then
4084 _ld_sdl=`$_sdlconfig --libs | sed s/-mwindows//`
4085 _inc_sdl=`$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`
4086 else
4087 _ld_sdl=`$_sdlconfig --libs`
4088 _inc_sdl=`$_sdlconfig --cflags`
4090 _vosrc="$_vosrc vo_sdl.c"
4091 _vomodules="sdl $_vomodules"
4092 _aosrc="$_aosrc ao_sdl.c"
4093 _aomodules="sdl $_aomodules"
4094 echores "yes (using $_sdlconfig)"
4095 else
4096 _def_sdl='#undef HAVE_SDL'
4097 _novomodules="sdl $_novomodules"
4098 _noaomodules="sdl $_noaomodules"
4099 echores "no"
4102 echocheck "Windows waveout"
4103 if test "$_win32waveout" = auto ; then
4104 cat > $TMPC << EOF
4105 #include <windows.h>
4106 #include <mmsystem.h>
4107 int main(void) { return 0; }
4109 _win32waveout=no
4110 cc_check -lwinmm && _win32waveout=yes
4112 if test "$_win32waveout" = yes ; then
4113 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4114 _ld_win32libs="-lwinmm $_ld_win32libs"
4115 _aosrc="$_aosrc ao_win32.c"
4116 _aomodules="win32 $_aomodules"
4117 else
4118 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4119 _noaomodules="win32 $_noaomodules"
4121 echores "$_win32waveout"
4123 echocheck "Directx"
4124 if test "$_directx" = auto ; then
4125 cat > $TMPC << EOF
4126 #include <windows.h>
4127 #include <ddraw.h>
4128 #include <dsound.h>
4129 int main(void) { return 0; }
4131 _directx=no
4132 cc_check -lgdi32 && _directx=yes
4134 if test "$_directx" = yes ; then
4135 _def_directx='#define HAVE_DIRECTX 1'
4136 _ld_win32libs="-lgdi32 $_ld_win32libs"
4137 _vosrc="$_vosrc vo_directx.c"
4138 _vomodules="directx $_vomodules"
4139 _aosrc="$_aosrc ao_dsound.c"
4140 _aomodules="dsound $_aomodules"
4141 else
4142 _def_directx='#undef HAVE_DIRECTX'
4143 _novomodules="directx $_novomodules"
4144 _noaomodules="dsound $_noaomodules"
4146 echores "$_directx"
4148 echocheck "NAS"
4149 if test "$_nas" = auto || test "$_nas" = yes ; then
4150 cat > $TMPC << EOF
4151 #include <audio/audiolib.h>
4152 int main(void) { return 0; }
4154 _nas=no
4155 cc_check -laudio $_inc_x11 -lXt $_ld_x11 $_ld_lm && _nas=yes
4157 if test "$_nas" = yes ; then
4158 _def_nas='#define HAVE_NAS 1'
4159 _ld_nas="-laudio -lXt $_ld_x11"
4160 _aosrc="$_aosrc ao_nas.c"
4161 _aomodules="nas $_aomodules"
4162 else
4163 _noaomodules="nas $_noaomodules"
4164 _def_nas='#undef HAVE_NAS'
4166 echores "$_nas"
4168 echocheck "DXR2"
4169 if test "$_dxr2" = auto; then
4170 _dxr2=no
4171 for _inc_dxr2 in "$_inc_dxr2" \
4172 "-I/usr/local/include/dxr2" \
4173 "-I/usr/include/dxr2"; do
4174 cat > $TMPC << EOF
4175 #include <dxr2ioctl.h>
4176 int main(void) { return 0; }
4178 cc_check $_inc_dxr2 && _dxr2=yes && break
4179 done
4181 if test "$_dxr2" = yes; then
4182 _def_dxr2='#define HAVE_DXR2 1'
4183 _vosrc="$_vosrc vo_dxr2.c"
4184 _aosrc="$_aosrc ao_dxr2.c"
4185 _aomodules="dxr2 $_aomodules"
4186 _vomodules="dxr2 $_vomodules"
4187 echores "yes (using $_inc_dxr2)"
4188 else
4189 _def_dxr2='#undef HAVE_DXR2'
4190 _noaomodules="dxr2 $_noaomodules"
4191 _novomodules="dxr2 $_novomodules"
4192 _inc_dxr2=""
4193 echores "no"
4196 echocheck "DXR3/H+"
4197 if test "$_dxr3" = auto ; then
4198 cat > $TMPC << EOF
4199 #include <linux/em8300.h>
4200 int main(void) { return 0; }
4202 _dxr3=no
4203 cc_check && _dxr3=yes
4205 if test "$_dxr3" = yes ; then
4206 _def_dxr3='#define HAVE_DXR3 1'
4207 _vosrc="$_vosrc vo_dxr3.c"
4208 _vomodules="dxr3 $_vomodules"
4209 else
4210 _def_dxr3='#undef HAVE_DXR3'
4211 _novomodules="dxr3 $_novomodules"
4212 if test "$_mp1e" = auto ; then
4213 # we don't need mp1e
4214 _mp1e=no
4217 echores "$_dxr3"
4219 echocheck "libmp1e"
4220 if test "$_mmx" = no ; then
4221 # mp1e REQUIRES mmx!
4222 _mp1e=no
4224 if test "$_mp1e" != no ; then
4225 _mp1e=yes
4226 _def_mp1e='#define USE_MP1E'
4227 _ld_mp1e='libmp1e/libmp1e.a'
4228 _dep_mp1e='libmp1e/libmp1e.a'
4229 else
4230 _mp1e=no
4231 _def_mp1e='#undef USE_MP1E'
4232 _ld_mp1e=""
4233 _dep_mp1e=''
4235 echores "$_mp1e"
4238 echocheck "libfame"
4239 if test "$_fame" = auto ; then
4240 _fame=no
4241 test "$_dxr2" = yes && _fame=auto
4242 test "$_dxr3" = yes && _fame=auto
4243 test "$_dvb" = yes && _fame=auto
4245 if test "$_fame" = auto ; then
4246 _fame=no
4247 if test -d libfame && test -f libfame/fame.h ; then
4248 # disable fame on cygwin as no sense to port - atmos
4249 cygwin || _fame=yes
4250 echores $_fame
4251 else
4252 echores "no (no fame dir)"
4254 else
4255 echores "$_fame"
4258 _def_fame='#undef USE_LIBFAME'
4259 if test "$_fame" = yes ; then
4260 _def_fame='#define USE_LIBFAME 1'
4261 _ld_fame='libfame/libfame.a'
4265 #########
4266 # AUDIO #
4267 #########
4270 echocheck "OSS Audio"
4271 if test "$_ossaudio" = auto ; then
4272 cat > $TMPC << EOF
4273 #include <sys/ioctl.h>
4274 $_inc_soundcard
4275 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4277 _ossaudio=no
4278 cc_check && _ossaudio=yes
4280 if test "$_ossaudio" = yes ; then
4281 _def_ossaudio='#define USE_OSS_AUDIO 1'
4282 _aosrc="$_aosrc ao_oss.c"
4283 _aomodules="oss $_aomodules"
4284 if test "$_linux_devfs" = yes; then
4285 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4286 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4287 else
4288 cat > $TMPC << EOF
4289 #include <sys/ioctl.h>
4290 $_inc_soundcard
4291 #ifdef OPEN_SOUND_SYSTEM
4292 int main(void) { return 0; }
4293 #else
4294 #error Not the real thing
4295 #endif
4297 _real_ossaudio=no
4298 cc_check && _real_ossaudio=yes
4299 if test "$_real_ossaudio" = yes; then
4300 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4301 elif netbsd || openbsd ; then
4302 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4303 _ld_arch="$_ld_arch -lossaudio"
4304 else
4305 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4307 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4309 else
4310 _def_ossaudio='#undef USE_OSS_AUDIO'
4311 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4312 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4313 _noaomodules="oss $_noaomodules"
4315 echores "$_ossaudio"
4318 echocheck "aRts"
4319 if test "$_arts" = auto ; then
4320 _arts=no
4321 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4323 cat > $TMPC << EOF
4324 #include <artsc.h>
4325 int main(void) { return 0; }
4327 cc_check `artsc-config --libs` `artsc-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _arts=yes
4332 if test "$_arts" = yes ; then
4333 _def_arts='#define USE_ARTS 1'
4334 _aosrc="$_aosrc ao_arts.c"
4335 _aomodules="arts $_aomodules"
4336 _ld_arts=`artsc-config --libs`
4337 _inc_arts=`artsc-config --cflags`
4338 else
4339 _noaomodules="arts $_noaomodules"
4341 echores "$_arts"
4344 echocheck "EsounD"
4345 if test "$_esd" = auto ; then
4346 _esd=no
4347 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4349 cat > $TMPC << EOF
4350 #include <esd.h>
4351 int main(void) { return 0; }
4353 cc_check `esd-config --libs` `esd-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _esd=yes
4357 echores "$_esd"
4359 if test "$_esd" = yes ; then
4360 _def_esd='#define USE_ESD 1'
4361 _aosrc="$_aosrc ao_esd.c"
4362 _aomodules="esd $_aomodules"
4363 _ld_esd=`esd-config --libs`
4364 _inc_esd=`esd-config --cflags`
4366 echocheck "esd_get_latency()"
4367 cat > $TMPC << EOF
4368 #include <esd.h>
4369 int main(void) { return esd_get_latency(0); }
4371 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4372 echores "$_esd_latency"
4373 else
4374 _def_esd='#undef USE_ESD'
4375 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4376 _noaomodules="esd $_noaomodules"
4380 echocheck "JACK"
4381 if test "$_jack" = auto ; then
4382 _jack=no
4383 if ( ( pkg-config --modversion jack ) > /dev/null 2>&1 ) &&
4384 ( jackd --version | grep version | awk '{ print $3 }' ) >> "$TMPLOG" 2>&1 ; then
4386 cat > $TMPC << EOF
4387 #include <jack/jack.h>
4388 int main(void) { JACK_Init(); return 0; }
4390 # This test only checks the minor version number.
4391 if ( ( test `bio2jack-config --version | cut -d '.' -f 2` -ge 3 ) ) >/dev/null 2>&1 ; then
4392 if test -z "$_bio2jackdir" ; then
4393 cc_check -lbio2jack `pkg-config --libs --cflags jack` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _jack=yes
4394 else
4395 cc_check -L "$_bio2jackdir" -lbio2jack `pkg-config --libs --cflags jack` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _jack=yes
4401 if test "$_jack" = yes ; then
4402 _def_jack='#define USE_JACK 1'
4403 _aosrc="$_aosrc ao_jack.c"
4404 _aomodules="jack $_aomodules"
4405 if test -z "$_bio2jackdir" ; then
4406 _ld_jack="-lbio2jack `pkg-config --libs jack`"
4407 else
4408 _ld_jack="-L \"$_bio2jackdir\" -lbio2jack `pkg-config --libs jack`"
4410 _inc_jack=`pkg-config --cflags jack`
4411 else
4412 _noaomodules="jack $_noaomodules"
4414 echores "$_jack"
4417 echocheck "ALSA audio"
4418 if test "$_alsa" != no ; then
4419 _alsa=no
4420 cat > $TMPC << EOF
4421 #include <sys/asoundlib.h>
4422 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==5)); }
4424 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.5.x'
4426 cat > $TMPC << EOF
4427 #include <sys/asoundlib.h>
4428 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
4430 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-sys'
4431 cat > $TMPC << EOF
4432 #include <alsa/asoundlib.h>
4433 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
4435 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-alsa'
4437 cat > $TMPC << EOF
4438 #include <sys/asoundlib.h>
4439 int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
4441 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-sys'
4442 cat > $TMPC << EOF
4443 #include <alsa/asoundlib.h>
4444 int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
4446 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-alsa'
4448 _def_alsa5='#undef HAVE_ALSA5'
4449 _def_alsa9='#undef HAVE_ALSA9'
4450 _def_alsa1x='#undef HAVE_ALSA1X'
4451 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
4452 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
4453 if test "$_alsaver" ; then
4454 if test "$_alsaver" = '0.5.x' ; then
4455 _aosrc="$_aosrc ao_alsa5.c"
4456 _aomodules="alsa5 $_aomodules"
4457 _def_alsa5='#define HAVE_ALSA5 1'
4458 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4459 echores "yes (using alsa 0.5.x and sys/asoundlib.h)"
4460 elif test "$_alsaver" = '0.9.x-sys' ; then
4461 _aosrc="$_aosrc ao_alsa.c"
4462 _aomodules="alsa $_aomodules"
4463 _def_alsa9='#define HAVE_ALSA9 1'
4464 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4465 echores "yes (using alsa 0.9.x and sys/asoundlib.h)"
4466 elif test "$_alsaver" = '0.9.x-alsa' ; then
4467 _aosrc="$_aosrc ao_alsa.c"
4468 _aomodules="alsa $_aomodules"
4469 _def_alsa9='#define HAVE_ALSA9 1'
4470 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4471 echores "yes (using alsa 0.9.x and alsa/asoundlib.h)"
4472 elif test "$_alsaver" = '1.0.x-sys' ; then
4473 _aosrc="$_aosrc ao_alsa.c"
4474 _aomodules="alsa $_aomodules"
4475 _def_alsa1x="#define HAVE_ALSA1X 1"
4476 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4477 echores "yes (using alsa 1.0.x and sys/asoundlib.h)"
4478 elif test "$_alsaver" = '1.0.x-alsa' ; then
4479 _aosrc="$_aosrc ao_alsa.c"
4480 _aomodules="alsa $_aomodules"
4481 _def_alsa1x="#define HAVE_ALSA1X 1"
4482 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4483 echores "yes (using alsa 1.0.x and alsa/asoundlib.h)"
4485 _ld_alsa="-lasound $_ld_dl $_ld_pthread"
4486 else
4487 _noaomodules="alsa $_noaomodules"
4488 echores "no"
4492 echocheck "Sun audio"
4493 if test "$_sunaudio" = auto ; then
4494 cat > $TMPC << EOF
4495 #include <sys/types.h>
4496 #include <sys/audioio.h>
4497 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4499 _sunaudio=no
4500 cc_check && _sunaudio=yes
4502 if test "$_sunaudio" = yes ; then
4503 _def_sunaudio='#define USE_SUN_AUDIO 1'
4504 _aosrc="$_aosrc ao_sun.c"
4505 _aomodules="sun $_aomodules"
4506 else
4507 _def_sunaudio='#undef USE_SUN_AUDIO'
4508 _noaomodules="sun $_noaomodules"
4510 echores "$_sunaudio"
4513 echocheck "Sun mediaLib"
4514 if test "$_mlib" = auto ; then
4515 _mlib=no
4516 test -z "$_mlibdir" && _mlibdir=/opt/SUNWmlib
4517 cat > $TMPC << EOF
4518 #include <mlib.h>
4519 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
4521 cc_check -I${_mlibdir}/include -L${_mlibdir}/lib -lmlib && _mlib=yes
4523 if test "$_mlib" = yes ; then
4524 _def_mlib='#define HAVE_MLIB 1'
4525 _inc_mlib=" -I${_mlibdir}/include "
4526 _ld_mlib=" -L${_mlibdir}/lib -R${_mlibdir}/lib -lmlib "
4527 else
4528 _def_mlib='#undef HAVE_MLIB'
4530 echores "$_mlib"
4533 echocheck "SGI audio"
4534 if test "$_sgiaudio" = auto ; then
4535 # check for SGI audio
4536 cat > $TMPC << EOF
4537 #include <dmedia/audio.h>
4538 int main(void) { return 0; }
4540 _sgiaudio=no
4541 cc_check && _sgiaudio=yes
4543 if test "$_sgiaudio" = "yes" ; then
4544 _def_sgiaudio='#define USE_SGI_AUDIO 1'
4545 _ld_sgiaudio='-laudio'
4546 _aosrc="$_aosrc ao_sgi.c"
4547 _aomodules="sgi $_aomodules"
4548 else
4549 _def_sgiaudio='#undef USE_SGI_AUDIO'
4550 _noaomodules="sgi $_noaomodules"
4552 echores "$_sgiaudio"
4555 echocheck "VCD support"
4556 if linux || bsdos || freebsd || netbsd || sunos || (darwin && ppc) ; then
4557 _inputmodules="vcd $_inputmodules"
4558 _def_vcd='#define HAVE_VCD 1'
4559 echores "ok"
4560 else
4561 _def_vcd='#undef HAVE_VCD'
4562 _noinputmodules="vcd $_noinputmodules"
4563 echores "not supported on this OS"
4566 echocheck "DVD support (libmpdvdkit)"
4567 if test "$_dvdkit" = auto ; then
4568 _dvdkit=no
4569 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux; then
4570 test -f "./libmpdvdkit2/Makefile" && _dvdkit=yes
4571 test -f "./libmpdvdkit/Makefile" && _dvdkit=yes
4574 if test "$_dvdkit" = yes ; then
4575 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
4576 if test -f "./libmpdvdkit2/Makefile" ; then
4577 _inputmodules="mpdvdkit2 $_inputmodules"
4578 _dvdread=libmpdvdkit2
4579 _dvdkit2=yes
4580 _dvdkit=no
4581 else
4582 _inputmodules="mpdvdkit $_inputmodules"
4583 _dvdread=libmpdvdkit
4585 else
4586 _noinputmodules="mpdvdkit $_noinputmodules"
4588 _def_dvd_linux='#undef HAVE_LINUX_DVD_STRUCT'
4589 _def_dvd_bsd='#undef HAVE_BSD_DVD_STRUCT'
4590 _dev_dvd_openbsd='#undef HAVE_OPENBSD_DVD_STRUCT'
4591 _def_dvd_darwin='#undef DARWIN_DVD_IOCTL'
4592 if linux || netbsd || openbsd || bsdos ; then
4593 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4594 if openbsd ; then
4595 _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4597 else
4598 if freebsd ; then
4599 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4600 else
4601 if darwin ; then
4602 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4606 else
4607 _noinputmodules="mpdvdkit $_noinputmodules"
4609 if test "$_dvdkit" = yes || test "$_dvdkit2" = yes; then
4610 echores "yes"
4611 else
4612 echores "no"
4615 echocheck "DVD support (libdvdread)"
4616 if test "$_dvdread" = auto ; then
4617 cat > $TMPC << EOF
4618 #include <inttypes.h>
4619 #include <dvdread/dvd_reader.h>
4620 #include <dvdread/ifo_types.h>
4621 #include <dvdread/ifo_read.h>
4622 #include <dvdread/nav_read.h>
4623 int main(void) { return 0; }
4625 _dvdread=no
4626 if test "$_dl" = yes; then
4627 cc_check \
4628 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread $_ld_dl && \
4629 _dvdread=yes
4632 _def_mpdvdkit="#undef USE_MPDVDKIT"
4633 case "$_dvdread" in
4634 yes)
4635 _largefiles=yes
4636 _def_dvdread='#define USE_DVDREAD 1'
4637 _ld_dvdread='-ldvdread'
4638 _inputmodules="dvdread $_inputmodules"
4639 echores "yes"
4642 _def_dvdread='#undef USE_DVDREAD'
4643 _noinputmodules="dvdread $_noinputmodules"
4644 echores "no"
4646 libmpdvdkit)
4647 _largefiles=yes
4648 _def_dvdread='#define USE_DVDREAD 1'
4649 _ld_dvdread='-Llibmpdvdkit -lmpdvdkit'
4650 _noinputmodules="dvdread $_noinputmodules"
4651 _def_mpdvdkit="#define USE_MPDVDKIT 1"
4652 echores "disabled by libmpdvdkit"
4654 libmpdvdkit2)
4655 _largefiles=yes
4656 _def_dvdread='#define USE_DVDREAD 1'
4657 _ld_dvdread='-Llibmpdvdkit2 -lmpdvdkit'
4658 _noinputmodules="dvdread $_noinputmodules"
4659 _def_mpdvdkit="#define USE_MPDVDKIT 2"
4660 echores "disabled by libmpdvdkit2"
4662 esac
4664 # dvdnav disabled, it does not work
4665 # echocheck "DVD support (libdvdnav)"
4666 # if test "$_dvdnav" = yes ; then
4667 # cat > $TMPC <<EOF
4668 # #include <dvdnav.h>
4669 # int main(void) { dvdnav_t *dvd=0; return 0; }
4670 # EOF
4671 # _dvdnav=no
4672 # test -n "$_dvdnavdir" && _legal_dvdnavdir=-L$_dvdnavdir/.libs
4673 # if test -z "$_dvdnavconfig" ; then
4674 # if ( dvdnav-config --version ) >/dev/null 2>&1 ; then
4675 # _dvdnavconfig="dvdnav-config"
4676 # fi
4677 # fi
4678 # test -z "$_dvdnavdir" && test -n "$_dvdnavconfig" && _dvdnavdir=`$_dvdnavconfig --cflags`
4679 # _used_css=
4680 # test "$_dvdkit" = no && test "$_dvdkit2" = no && _used_css=$_ld_css
4681 # cc_check $_inc_extra -I$_dvdnavdir $_legal_dvdnavdir -ldvdnav $_used_css $_ld_dl $_ld_pthread && _dvdnav=yes
4682 # fi
4683 # if test "$_dvdnav" = yes ; then
4684 # _largefiles=yes
4685 # _def_dvdnav='#define USE_DVDNAV 1'
4686 # if test -n "$_legal_dvdnavdir" ; then
4687 # _ld_css="$_ld_css $_legal_dvdnavdir -ldvdnav"
4688 # elif test -n "$_dvdnavconfig" ; then
4689 # _ld_css="$_ld_css `$_dvdnavconfig --libs`"
4690 # else
4691 # _ld_css="$_ld_css -ldvdnav"
4692 # fi
4693 # if test -n "$_dvdnavconfig" ; then
4694 # _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
4695 # _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
4696 # fi
4697 # if test -n "$_dvdnavdir" ; then
4698 # _inc_extra="$_inc_extra -I$_dvdnavdir"
4699 # fi
4700 # _inputmodules="dvdnav $_inputmodules"
4701 # echores "yes"
4702 # else
4703 # _def_dvdnav='#undef USE_DVDNAV'
4704 # _noinputmodules="dvdnav $_noinputmodules"
4705 # echores "no"
4706 # fi
4708 echocheck "cdparanoia"
4709 if test "$_cdparanoia" = auto ; then
4710 cat > $TMPC <<EOF
4711 #include <cdda_interface.h>
4712 #include <cdda_paranoia.h>
4713 // This need a better test. How ?
4714 int main(void) { return 1; }
4716 _cdparanoia=no
4717 if cc_check $_inc_cdparanoia $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm ; then
4718 _cdparanoia=yes
4719 else
4720 for I in /usr/include/cdda /usr/local/include/cdda ; do
4721 if cc_check -I$I $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm ; then
4722 _cdparanoia=yes; _inc_cdparanoia="-I$I"; break
4724 done
4727 if test "$_cdparanoia" = yes ; then
4728 _def_cdparanoia='#define HAVE_CDDA'
4729 _inputmodules="cdda $_inputmodules"
4730 _ld_cdparanoia="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
4731 openbsd && _ld_cdparanoia="$_ld_cdparanoia -lutil"
4732 else
4733 _def_cdparanoia='#undef HAVE_CDDA'
4734 _noinputmodules="cdda $_noinputmodules"
4736 echores "$_cdparanoia"
4739 echocheck "freetype >= 2.0.9"
4741 # freetype depends on iconv
4742 if test "$_iconv" = no ; then
4743 _freetype="no (iconv support needed)"
4746 if test "$_freetype" = auto ; then
4747 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
4748 cat > $TMPC << EOF
4749 #include <stdio.h>
4750 #include <ft2build.h>
4751 #include FT_FREETYPE_H
4752 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
4753 #error "Need FreeType 2.0.9 or newer"
4754 #endif
4755 int main()
4757 FT_Library library;
4758 FT_Int major=-1,minor=-1,patch=-1;
4759 int err=FT_Init_FreeType(&library);
4760 if(err){
4761 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
4762 exit(err);
4764 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
4765 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
4766 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
4767 (int)major,(int)minor,(int)patch );
4768 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
4769 printf("Library and header version mismatch! Fix it in your distribution!\n");
4770 exit(1);
4772 return 0;
4775 _freetype=no
4776 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && ( $TMPO >> "$TMPLOG" ) && _freetype=yes
4777 else
4778 _freetype=no
4781 if test "$_freetype" = yes ; then
4782 _def_freetype='#define HAVE_FREETYPE'
4783 _inc_freetype=`$_freetypeconfig --cflags`
4784 _ld_freetype=`$_freetypeconfig --libs`
4785 else
4786 _def_freetype='#undef HAVE_FREETYPE'
4788 echores "$_freetype"
4790 if test "$_freetype" = no ; then
4791 _fontconfig=no
4793 echocheck "fontconfig"
4794 if test "$_fontconfig" = auto ; then
4795 if ( pkg-config --modversion fontconfig) > /dev/null 2>&1 ; then
4796 cat > $TMPC << EOF
4797 #include <stdio.h>
4798 #include <fontconfig/fontconfig.h>
4799 int main()
4801 int err = FcInit();
4802 if(err == FcFalse){
4803 printf("Couldn't initialize fontconfig lib\n");
4804 exit(err);
4806 return 0;
4810 _fontconfig=no
4811 cc_check `pkg-config --cflags --libs fontconfig` && ( $TMPO >> "$TMPLOG" ) && _fontconfig=yes
4812 else
4813 _fontconfig=no
4816 if test "$_fontconfig" = yes ; then
4817 _def_fontconfig='#define HAVE_FONTCONFIG'
4818 _inc_fontconfig=`pkg-config --cflags fontconfig`
4819 _ld_fontconfig=`pkg-config --libs fontconfig`
4820 else
4821 _def_fontconfig='#undef HAVE_FONTCONFIG'
4823 echores "$_fontconfig"
4825 echocheck "fribidi with charsets"
4826 if test "$_fribidi" = yes ; then
4827 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
4828 cat > $TMPC << EOF
4829 #include <stdio.h>
4830 #include <fribidi/fribidi.h>
4831 int main()
4833 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHARSET_UTF8) {
4834 printf("Fribidi headers are not consistents with the library!\n");
4835 exit(1);
4837 return 0;
4840 _fribidi=no
4841 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && ( $TMPO >> "$TMPLOG" ) && _fribidi=yes
4842 else
4843 _fribidi=no
4846 if test "$_fribidi" = yes ; then
4847 _def_fribidi='#define USE_FRIBIDI'
4848 _inc_fribidi=`$_fribidiconfig --cflags`
4849 _ld_fribidi=`$_fribidiconfig --libs`
4850 else
4851 _def_fribidi='#undef USE_FRIBIDI'
4853 echores "$_fribidi"
4856 echocheck "ENCA"
4857 if test "$_enca" = auto ; then
4858 cat > $TMPC << EOF
4859 #include <enca.h>
4860 int main()
4862 const char **langs;
4863 size_t langcnt;
4864 langs = enca_get_languages(&langcnt);
4865 return 0;
4868 _enca=no
4869 cc_check -lenca && _enca=yes
4871 if test "$_enca" = yes ; then
4872 _def_enca='#define HAVE_ENCA 1'
4873 _ld_enca='-lenca'
4874 else
4875 _def_enca='#undef HAVE_ENCA'
4877 echores "$_enca"
4880 echocheck "zlib"
4881 cat > $TMPC << EOF
4882 #include <zlib.h>
4883 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
4885 _zlib=no
4886 cc_check -lz && _zlib=yes
4887 if test "$_zlib" = yes ; then
4888 _def_zlib='#define HAVE_ZLIB 1'
4889 _ld_zlib='-lz'
4890 else
4891 _def_zlib='#undef HAVE_ZLIB'
4893 echores "$_zlib"
4896 echocheck "RTC"
4897 if linux ; then
4898 if test "$_rtc" = auto ; then
4899 cat > $TMPC << EOF
4900 #include <sys/ioctl.h>
4901 #include <linux/rtc.h>
4902 int main(void) { return RTC_IRQP_READ; }
4904 _rtc=no
4905 cc_check && _rtc=yes
4907 echores "$_rtc"
4908 else
4909 _rtc=no
4910 echores "no (Linux specific feature)"
4912 if test "$_rtc" = yes ; then
4913 _def_rtc='#define HAVE_RTC 1'
4914 else
4915 _def_rtc='#undef HAVE_RTC'
4919 echocheck "external liblzo support"
4920 if test "$_liblzo" = auto ; then
4921 _liblzo=no
4922 cat > $TMPC << EOF
4923 #include <lzo1x.h>
4924 int main(void) { lzo_init();return 0; }
4926 cc_check -llzo && _liblzo=yes
4928 if test "$_liblzo" = yes ; then
4929 _def_liblzo='#define USE_LIBLZO 1'
4930 _ld_liblzo='-llzo'
4931 _codecmodules="liblzo $_codecmodules"
4932 else
4933 _def_liblzo='#undef USE_LIBLZO'
4934 _nocodecmodules="liblzo $_nocodecmodules"
4936 echores "$_liblzo"
4939 echocheck "mad support"
4940 if test "$_mad" = auto ; then
4941 _mad=no
4942 cat > $TMPC << EOF
4943 #include <mad.h>
4944 int main(void) { return 0; }
4946 cc_check $_madlibdir -lmad && _mad=yes
4948 if test "$_mad" = yes ; then
4949 _def_mad='#define USE_LIBMAD 1'
4950 _ld_mad='-lmad'
4951 _codecmodules="libmad $_codecmodules"
4952 else
4953 _def_mad='#undef USE_LIBMAD'
4954 _nocodecmodules="libmad $_nocodecmodules"
4956 echores "$_mad"
4958 echocheck "Toolame"
4959 if test "$_toolame" = auto ; then
4960 cat > $TMPC <<EOF
4961 #include <toolame.h>
4962 int main(void) { toolame_init(); return 0; }
4964 _toolame=no
4965 _toolame_extraflags=""
4966 _toolame_lib="-ltoolame"
4967 if test -n "$_toolamedir"; then
4968 _toolame_extraflags="-I$_toolamedir -L$_toolamedir"
4970 cc_check $_toolame_extraflags $_toolame_lib $_ld_lm && _toolame=yes
4972 if test "$_toolame" = yes ; then
4973 _def_toolame='#define HAVE_TOOLAME 1'
4974 _codecmodules="$_codecmodules toolame"
4975 else
4976 _def_toolame='#undef HAVE_TOOLAME'
4977 _toolame_lib=""
4978 _nocodecmodules="toolame $_nocodecmodules"
4980 if test -z "$_toolamedir" ; then
4981 echores "$_toolame"
4982 else
4983 echores "$_toolame (using $_toolamedir)"
4986 echocheck "OggVorbis support"
4987 if test "$_vorbis" = auto ; then
4988 _vorbis=no
4989 cat > $TMPC << EOF
4990 #include <vorbis/codec.h>
4991 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
4993 cc_check -lvorbis -logg $_ld_lm && _vorbis=yes
4995 if test "$_vorbis" = yes ; then
4996 _def_vorbis='#define HAVE_OGGVORBIS 1'
4997 if test "$_tremor" = yes ; then
4998 _def_tremor='#define TREMOR 1'
4999 _ld_vorbis='-lvorbisidec'
5000 else
5001 _def_tremor='#undef TREMOR'
5002 _ld_vorbis='-lvorbis -logg'
5004 _codecmodules="libvorbis $_codecmodules"
5005 else
5006 _def_vorbis='#undef HAVE_OGGVORBIS'
5007 _def_tremor='#undef TREMOR'
5008 _nocodecmodules="libvorbis $_nocodecmodules"
5010 if test "$_vorbis" = yes -a "$_tremor" = yes ; then
5011 echores "$_vorbis (Tremor)"
5012 else
5013 echores "$_vorbis"
5016 echocheck "OggTheora support (only the CVS version!)"
5017 if test "$_theora" = auto ; then
5018 _theora=no
5019 cat > $TMPC << EOF
5020 #include <theora/theora.h>
5021 #include <string.h>
5022 int main(void)
5024 /* theora is in flux, make sure that all interface routines and
5025 * datatypes exist and work the way we expect it, so we don't break
5026 * mplayer */
5027 ogg_packet op;
5028 theora_comment tc;
5029 theora_info inf;
5030 theora_state st;
5031 yuv_buffer yuv;
5032 int r;
5033 double t;
5035 theora_info_init (&inf);
5036 theora_comment_init (&tc);
5038 return 0;
5040 /* we don't want to execute this kind of nonsense; just for making sure
5041 * that compilation works... */
5042 memset(&op, 0, sizeof(op));
5043 r = theora_decode_header (&inf, &tc, &op);
5044 r = theora_decode_init (&st, &inf);
5045 t = theora_granule_time (&st, op.granulepos);
5046 r = theora_decode_packetin (&st, &op);
5047 r = theora_decode_YUVout (&st, &yuv);
5048 theora_clear (&st);
5050 return 0;
5053 cc_check -ltheora -logg $_ld_lm && _theora=yes
5055 if test "$_theora" = yes ; then
5056 _def_theora='#define HAVE_OGGTHEORA 1'
5057 _codecmodules="libtheora $_codecmodules"
5058 _ld_theora="-ltheora -logg"
5059 else
5060 _def_theora='#undef HAVE_OGGTHEORA'
5061 _nocodecmodules="libtheora $_nocodecmodules"
5063 echores "$_theora"
5065 echocheck "mp3lib support"
5066 if test "$_mp3lib" = yes ; then
5067 _def_mp3lib='#define USE_MP3LIB 1'
5068 _codecmodules="mp3lib $_codecmodules"
5069 else
5070 _def_mp3lib='#undef USE_MP3LIB'
5071 _nocodecmodules="mp3lib $_nocodecmodules"
5073 echores "$_mp3lib"
5075 echocheck "liba52 support"
5076 if test "$_liba52" = yes ; then
5077 _def_liba52='#define USE_LIBA52 1'
5078 _codecmodules="liba52 $_codecmodules"
5079 else
5080 _def_liba52='#undef USE_LIBA52'
5081 _nocodecmodules="liba52 $_nocodecmodules"
5083 echores "$_liba52"
5085 echocheck "libdts support"
5086 if test "$_libdts" = auto ; then
5087 _libdts=no
5088 cat > $TMPC << EOF
5089 #include <stdint.h>
5090 #include <dts.h>
5091 int main(void) { dts_init (0); return 0; }
5093 cc_check $_inc_libdts $_ld_libdts -ldts $_ld_lm && _libdts=yes
5095 if test "$_libdts" = yes ; then
5096 _def_libdts='#define CONFIG_DTS 1'
5097 _ld_libdts="$_ld_libdts -ldts $_ld_lm"
5098 _codecmodules="libdts $_codecmodules"
5099 else
5100 _def_libdts='#undef CONFIG_DTS'
5101 _nocodecmodules="libdts $_nocodecmodules"
5103 echores "$_libdts"
5105 echocheck "libmpeg2 support"
5106 if test "$_libmpeg2" = yes ; then
5107 _def_libmpeg2='#define USE_LIBMPEG2 1'
5108 _codecmodules="libmpeg2 $_codecmodules"
5109 else
5110 _def_libmpeg2='#undef USE_LIBMPEG2'
5111 _nocodecmodules="libmpeg2 $_nocodecmodules"
5113 echores "$_libmpeg2"
5116 echocheck "Matroska support"
5117 if test "$_matroska_internal" = yes ; then
5118 _inputmodules="matroska $_inputmodules"
5119 _def_matroska='#define HAVE_MATROSKA 1'
5120 else
5121 _noinputmodules="matroska $_noinputmodules"
5122 _def_matroska='#undef HAVE_MATROSKA'
5124 echores "$_matroska_internal"
5127 echocheck "internal FAAD2 (AAC) support"
5128 _inc_faad="-I`pwd`/libfaad2"
5129 if test "$_faad_internal" = auto ; then
5130 # the faad check needs a config.h file
5131 if not test -f "config.h" ; then
5132 > config.h
5134 # internal faad: check if our dear gcc is able to compile it...
5135 cp "`pwd`/libfaad2/cfft.c" $TMPC
5136 if ( cc_check -c -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer $_inc_faad ); then
5137 _faad_internal=yes
5138 else
5139 _faad_internal="no (broken gcc)"
5142 if test "$_faad_internal" = yes ; then
5143 _def_faad_internal="#define USE_INTERNAL_FAAD 1"
5144 _faad_external=no
5145 else
5146 _def_faad_internal="#undef USE_INTERNAL_FAAD"
5147 _inc_faad=
5149 echores "$_faad_internal"
5152 echocheck "external FAAD2 (AAC) support"
5153 if test "$_faad_external" != no ; then
5154 _ld_faad='-lfaad'
5155 _inc_faad="$_inc_extra"
5156 # external faad: check if it's really faad2 :)
5157 if test "$_faad_external" = auto ; then
5158 _faad_external=no
5159 cat > $TMPC << EOF
5160 #include <faad.h>
5161 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); return 0; }
5163 cc_check $_inc_faad $_ld_faad $_ld_lm && _faad_external=yes
5165 echores "$_faad_external"
5166 else
5167 echores "no"
5170 if test "$_faad_internal" = yes -o "$_faad_external" = yes; then
5171 echocheck "FAAD2 version"
5172 cat > $TMPC <<EOF
5173 #include <faad.h>
5174 #ifndef FAAD_MIN_STREAMSIZE
5175 #error Too old version
5176 #endif
5177 int main(void) {
5178 #ifdef FAAD2_VERSION
5179 printf("%s\n",FAAD2_VERSION);
5180 #else
5181 printf("1.0\n");
5182 #endif
5183 return 0;
5186 if cc_check -I- $_inc_faad $_ld_faad $_ld_lm && "$TMPO" >> "$TMPLOG" ; then
5187 _faad_version=`"$TMPO"`
5188 _faad_tempversion=`"$TMPO" | sed -e 's/^\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*/\1\2/'`
5189 _def_faad_version="#define FAADVERSION $_faad_tempversion"
5190 echores "$_faad_version"
5191 else
5192 _faad_external=no
5193 _faad_internal=no
5194 echores "failed to get version"
5198 if test "$_faad_external" = yes; then
5199 _def_faad='#define HAVE_FAAD 1'
5200 _codecmodules="faad2(external) $_codecmodules"
5201 elif test "$_faad_internal" = yes; then
5202 _def_faad='#define HAVE_FAAD 1'
5203 _codecmodules="faad2(internal) $_codecmodules"
5204 else
5205 _def_faad='#undef HAVE_FAAD'
5206 _nocodecmodules="faad2 $_nocodecmodules"
5207 _ld_faad=
5210 echocheck "MacOS X SHLB (shared lib) support"
5211 if test "$_macshlb" = auto ; then
5212 if test "$_macosx" = yes ; then
5213 _macshlb=yes
5214 else
5215 _macshlb=no
5218 echores "$_macshlb"
5219 if test "$_macshlb" = yes ; then
5220 _def_macshlb='#define USE_MACSHLB 1'
5221 else
5222 _def_macshlb='#undef USE_MACSHLB'
5225 if test "$_win32" = auto ; then
5226 if x86 ; then
5227 qnx && _win32=no
5228 else
5229 _win32=no # x86 arch only
5233 if test "$_win32" != no ; then
5234 if test -z "$_win32libdir" ; then
5235 for I in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/win32 /usr/lib/win32 ; do
5236 if test -d "$I" ; then
5237 _win32libdir="$I"
5238 break;
5240 done
5244 echocheck "Win32 codec DLL support"
5245 if test "$_win32" = auto ; then
5246 _win32=no
5247 test -n "$_win32libdir" && _win32=yes
5249 if test "$_win32" = yes ; then
5250 _def_win32='#define USE_WIN32DLL 1'
5251 echores "yes (using $_win32libdir)"
5252 else
5253 _def_win32='#undef USE_WIN32DLL'
5254 _nocodecmodules="win32 $_nocodecmodules"
5255 _dshow=no
5256 echores "no"
5259 if test "$_win32" != no ; then
5260 _def_win32_loader='#undef WIN32_LOADER'
5261 echocheck "Win32 loader support"
5262 _ld_win32='loader/libloader.a'
5263 _dep_win32='loader/libloader.a'
5264 _codecmodules="win32 $_codecmodules"
5265 if openbsd ; then
5266 x86 && _ld_win32="$_ld_win32 -li386"
5268 if not win32 ; then
5269 _def_win32_loader='#define WIN32_LOADER 1'
5270 echores "yes"
5271 else
5272 _ld_win32libs="$_ld_win32libs -ladvapi32 -lole32"
5273 echores "no (using native windows)"
5277 echocheck "DirectShow"
5278 if false ; then
5280 if test "$_dshow" != no ; then
5281 _dshow=no
5282 # check if compiler supports C++ and C++-libs are installed correctly
5283 cat > "$TMPCPP" << EOF
5284 #include <string>
5285 class myclass {
5286 private: int ret;
5287 public: int myreturn(void);
5289 int myclass::myreturn(void) { ret = 0; return ret ; }
5290 int main(void) { myclass myobject; return myobject.myreturn(); }
5292 echo "------------------------------------------------" >> "$TMPLOG"
5293 cat "$TMPCPP" >> "$TMPLOG"
5294 if ( $_cc "$TMPCPP" -o "$TMPO" && "$TMPO" ) >> "$TMPLOG" 2>&1 ; then
5295 _dshow=yes
5296 echores "yes (C++ is ok)"
5297 else
5298 echores "no"
5299 cat << EOF
5301 Your C++ runtime environment is broken.
5303 Hints: Does $_cc support C++? Do you have you a C++ compiler installed?
5304 Are the C++ libraries correctly installed?
5305 Check for libstdc++ and in (/etc/)ld.so.conf.
5307 If you do not need DirectShow support, you can also use:
5308 ./configure --disable-dshow <your-normal-configure-options>
5309 to disable building the C++ based DirectShow code.
5312 die "$_cc's C++ is broken"
5318 echores "$_dshow"
5320 if test "$_dshow" = yes ; then
5321 _def_dshow='#define USE_DIRECTSHOW 1'
5322 _ld_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5323 _dep_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5324 _codecmodules="dshow/dmo $_codecmodules"
5325 else
5326 _def_dshow='#undef USE_DIRECTSHOW'
5327 _nocodecmodules="dshow/dmo $_nocodecmodules"
5331 echocheck "XAnim DLL"
5332 if test "$_xanim" = auto ; then
5333 _xanim=no
5334 if test "$_dl" = yes ; then
5335 if test -z "$_xanimlibdir" ; then
5336 for I in "$_libdir/codecs" /usr/local/lib/xanim/mods /usr/lib/xanim/mods /usr/lib/xanim $XANIM_MOD_DIR ; do
5337 if test -d "$I" ; then
5338 _xanimlibdir="$I"
5339 break;
5341 done
5343 test "$_xanimlibdir" && _xanim=yes
5344 if test "$_xanim" = yes ; then
5345 echores "yes (using $_xanimlibdir)"
5346 else
5347 echores "no (no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html)"
5349 else
5350 echores "no (dynamic loader support needed)"
5352 else
5353 echores "$_xanim (using $_xanimlibdir)"
5355 if test "$_xanim" = yes ; then
5356 _def_xanim='#define USE_XANIM 1'
5357 _def_xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
5358 _codecmodules="xanim $_codecmodules"
5359 else
5360 _def_xanim='#undef USE_XANIM'
5361 _def_xanim_path='#undef XACODEC_PATH'
5362 _nocodecmodules="xanim $_nocodecmodules"
5365 echocheck "RealPlayer DLL"
5366 if test "$_real" = auto ; then
5367 _real=no
5368 if test "$_dl" = yes || test "$_win32" = yes || test "$_macshlb" = yes ; then
5369 # if test "$_dl" = yes ; then
5370 if linux || freebsd || netbsd || win32 || darwin ; then
5371 _real=yes
5372 else
5373 echores "no (tested only on Linux/FreeBSD/NetBSD/Cygwin/MinGW/Darwin)"
5375 if test "$_real" = yes ; then
5376 if test -z "$_reallibdir" ; then
5377 for I in "$_libdir/codecs" "$_libdir/real" /usr/lib/real \
5378 /usr/lib/RealPlayer{9,8,}/Codecs /usr/local/RealPlayer{9,8,}/Codecs \
5379 /usr/local/lib/RealPlayer{9,8,}/Codecs /opt/RealPlayer{9,8,}/{Real/,}Codecs \
5380 {~,}/Applications/RealOne\ Player.app/Contents/MacOS/Library/Codecs \
5381 "$_win32libdir"; do
5382 if test -d "$I" ; then
5383 _reallibdir="$I"
5384 break
5386 done
5388 test "$_reallibdir" || _real=no
5389 if test "$_real" = yes ; then
5390 echores "yes (using $_reallibdir)"
5391 else
5392 echores "no (no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html)"
5395 else
5396 echores "no (dynamic loader support needed)"
5398 else
5399 echores "$_real (using $_reallibdir)"
5401 if test "$_real" = yes ; then
5402 _def_real='#define USE_REALCODECS 1'
5403 _def_real_path="#define REALCODEC_PATH \"$_reallibdir\""
5404 _codecmodules="real $_codecmodules"
5405 else
5406 _def_real='#undef USE_REALCODECS'
5407 _def_real_path="#undef REALCODEC_PATH"
5408 _nocodecmodules="real $_nocodecmodules"
5412 if test -z "$_livelibdir" ; then
5413 for I in $_libdir/live /usr/lib/live /usr/local/live /usr/local/lib/live; do
5414 if test -d "$I" ; then
5415 _livelibdir="$I"
5416 break;
5418 done
5421 echocheck "LIVE.COM Streaming Media libraries"
5422 if test "$_live" = auto && test "$_network" = yes ; then
5423 _TMPC=$TMPC
5424 TMPC=$TMPCPP
5425 cat >$TMPC <<EOF
5426 #include <liveMedia.hh>
5427 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1090195200)
5428 #error Please upgrade to version 2004.07.19 or later of the "LIVE.COM Streaming Media" libraries - available from <www.live.com/liveMedia/>
5429 #endif
5430 int main(void) {}
5432 if cc_check -I$_livelibdir/liveMedia/include/ -I$_livelibdir/UsageEnvironment/include -I$_livelibdir/groupsock/include; then
5433 _live=yes
5434 else
5435 _live=no
5437 TMPC=$_TMPC
5439 if test "$_live" = yes && test "$_network" = yes ; then
5440 echores "yes (using $_livelibdir)"
5441 _def_live='#define STREAMING_LIVE_DOT_COM 1'
5442 _live_libs_def="# LIVE.COM Streaming Media libraries:
5443 LIVE_LIB_DIR = $_livelibdir
5444 LIVE_LIBS = \$(LIVE_LIB_DIR)/liveMedia/libliveMedia.a
5445 LIVE_LIBS += \$(LIVE_LIB_DIR)/groupsock/libgroupsock.a
5446 LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
5447 LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
5448 LIVE_LIBS += -lstdc++"
5449 _ld_live='$(LIVE_LIBS)'
5450 _inputmodules="live.com $_inputmodules"
5451 else
5452 echores "no"
5453 _def_live='#undef STREAMING_LIVE_DOT_COM'
5454 _noinputmodules="live.com $_noinputmodules"
5458 echocheck "FFmpeg libavcodec (static)"
5459 if test "$_libavcodec" = auto ; then
5460 # Note: static linking is preferred to dynamic linking
5461 _libavcodec=no
5462 if test -d libavcodec && test -f libavcodec/utils.c ; then
5463 if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
5464 _libavcodec=yes
5465 echores "yes"
5466 else
5467 echores "no (old ffmpeg version, use CVS !)"
5469 else
5470 echores "no (see DOCS/HTML/$_doc_lang/codecs.html)"
5472 else
5473 echores "$_libavcodec"
5476 echocheck "FFmpeg libavformat (static)"
5477 if test "$_libavformat" = auto ; then
5478 # Note: static linking is preferred to dynamic linking
5479 _libavformat=no
5480 if test -d libavformat && test -f libavformat/utils.c ; then
5481 _libavformat=yes
5482 echores "yes"
5483 else
5484 echores "no"
5486 else
5487 echores "$_libavformat"
5490 _def_haveffpostprocess='no'
5491 if test -d libavcodec && test -f libavcodec/libpostproc/postprocess.h ; then
5492 _def_haveffpostprocess='yes'
5495 if test "$_libavcodec" != yes ; then
5496 echocheck "FFmpeg libavcodec (dynamic)"
5497 if test "$_libavcodecso" = auto ; then
5498 _libavcodecso=no
5499 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
5500 cat > $TMPC << EOF
5501 #define FF_POSTPROCESS 1
5502 #include <ffmpeg/avcodec.h>
5503 int main(void) {
5504 avcodec_find_encoder_by_name("");
5505 return 0;
5508 if cc_check -lavcodec $_ld_lm ; then
5509 _libavcodecso=yes
5510 echores "yes (using libavcodec.so)"
5511 else
5512 echores "no (libavcodec.so is broken/obsolete)"
5514 else
5515 echores "$_libavcodecso"
5519 _def_libavcodec='#undef USE_LIBAVCODEC'
5520 _def_libavcodecso='#undef USE_LIBAVCODEC_SO'
5521 _def_ffpostprocess='#undef FF_POSTPROCESS'
5522 if test "$_libavcodec" = yes ; then
5523 _def_libavcodec='#define USE_LIBAVCODEC 1'
5524 _ld_libavcodec='libavcodec/libavcodec.a'
5525 _dep_libavcodec='libavcodec/libavcodec.a'
5526 _def_ffpostprocess='#define FF_POSTPROCESS 1'
5527 _codecmodules="libavcodec $_codecmodules"
5528 elif test "$_libavcodecso" = yes ; then
5529 _def_libavcodec='#define USE_LIBAVCODEC 1'
5530 _def_libavcodecso='#define USE_LIBAVCODEC_SO 1'
5531 _ld_libavcodec='-lavcodec'
5532 _codecmodules="libavcodec.so $_codecmodules"
5533 else
5534 _nocodecmodules="libavcodec $_nocodecmodules"
5537 _def_libavformat='#undef USE_LIBAVFORMAT'
5538 _def_libavformat_win32='#undef CONFIG_WIN32'
5539 if test "$_libavformat" = yes ; then
5540 _def_libavformat='#define USE_LIBAVFORMAT 1'
5541 _ld_libavformat='libavformat/libavformat.a'
5542 _dep_libavformat='libavformat/libavformat.a'
5543 if win32 ; then
5544 _def_libavformat_win32='#define CONFIG_WIN32 1'
5548 echocheck "libdv-0.9.5+"
5549 if test "$_libdv" = auto ; then
5550 _libdv=no
5551 cat > $TMPC <<EOF
5552 #include <libdv/dv.h>
5553 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
5555 cc_check -ldv $_ld_lm && _libdv=yes
5557 if test "$_libdv" = yes ; then
5558 _def_libdv='#define HAVE_LIBDV095 1'
5559 _ld_libdv="-ldv"
5560 _codecmodules="libdv $_codecmodules"
5561 else
5562 _def_libdv='#undef HAVE_LIBDV095'
5563 _nocodecmodules="libdv $_nocodecmodules"
5565 echores "$_libdv"
5567 echocheck "zr"
5568 if test "$_zr" = auto ; then
5569 #36067's seem to identify themselves as 36057PQC's, so the line
5570 #below should work for 36067's and 36057's.
5571 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
5572 _zr=yes
5573 else
5574 _zr=no
5577 if test "$_zr" = yes ; then
5578 if test "$_libavcodec" = yes ; then
5579 _def_zr='#define HAVE_ZR 1'
5580 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
5581 _vomodules="zr zr2 $_vomodules"
5582 echores "$_zr"
5583 else
5584 echores "libavcodec (static) is required by zr, sorry"
5585 _novomodules="zr $_novomodules"
5586 _def_zr='#undef HAVE_ZR'
5588 else
5589 _def_zr='#undef HAVE_ZR'
5590 _novomodules="zr zr2 $_novomodules"
5591 echores "$_zr"
5594 echocheck "bl"
5595 if test "$_bl" = yes ; then
5596 _def_bl='#define HAVE_BL 1'
5597 _vosrc="$_vosrc vo_bl.c"
5598 _vomodules="bl $_vomodules"
5599 else
5600 _def_bl='#undef HAVE_BL'
5601 _novomodules="bl $_novomodules"
5603 echores "$_bl"
5605 echocheck "XviD"
5606 cat > $TMPC << EOF
5607 #include <xvid.h>
5608 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
5610 _ld_xvid="$_ld_xvid -lxvidcore $_ld_lm"
5611 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid ; then
5612 _xvid=yes
5613 _def_xvid3='#define HAVE_XVID3 1'
5614 _def_xvid4='#undef HAVE_XVID4'
5615 _codecmodules="xvid $_codecmodules"
5616 else
5617 cat > $TMPC << EOF
5618 #include <xvid.h>
5619 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
5621 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid ; then
5622 _xvid=yes
5623 _def_xvid3='#undef HAVE_XVID3'
5624 _def_xvid4='#define HAVE_XVID4 1'
5625 _codecmodules="xvid $_codecmodules"
5626 else
5627 _xvid=no
5628 _ld_xvid=''
5629 _def_xvid3='#undef HAVE_XVID3'
5630 _def_xvid4='#undef HAVE_XVID4'
5631 _nocodecmodules="xvid $_nocodecmodules"
5634 echores "$_xvid"
5636 _xvidcompat=no
5637 _def_decore_xvid='#undef DECORE_XVID'
5638 _def_encore_xvid='#undef ENCORE_XVID'
5639 if test "$_xvid" = yes ; then
5640 echocheck "DivX4 compatibility in XviD"
5641 cat > $TMPC << EOF
5642 #include <divx4.h>
5643 int main(void) { (void) decore(0, 0, 0, 0); return 0; }
5645 cc_check $_ld_lm "$_ld_xvid" && _xvidcompat=yes
5646 echores "$_xvidcompat"
5649 echocheck "x264"
5650 cat > $TMPC << EOF
5651 #include <stdint.h>
5652 #include <stdarg.h>
5653 #include <x264.h>
5654 int main(void) { x264_encoder_open((void*)0); return 0; }
5656 _ld_x264="$_ld_x264 -lx264 $_ld_lm"
5657 if test "$_x264" != no && cc_check $_inc_x264 $_ld_x264 ; then
5658 _x264=yes
5659 _def_x264='#define HAVE_X264 1'
5660 _codecmodules="x264 $_codecmodules"
5661 else
5662 _x264=no
5663 _ld_x264=''
5664 _def_x264='#undef HAVE_X264'
5665 _nocodecmodules="x264 $_nocodecmodules"
5667 echores "$_x264"
5669 echocheck "DivX4linux/DivX5linux/OpenDivX decore"
5670 # DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
5671 cat > $TMPC << EOF
5672 #include <decore.h>
5673 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_FRAME_311; }
5675 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
5676 _opendivx=no
5677 _ld_decore='-ldivxdecore'
5678 _def_decore='#define NEW_DECORE 1'
5679 _def_divx='#define USE_DIVX'
5680 _def_divx5='#undef DECORE_DIVX5'
5681 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5682 _codecmodules="divx4linux $_codecmodules"
5683 echores "DivX4linux (with libdivxdecore.so)"
5684 else
5685 # if test "$_divx4linux" != no ; then
5686 # DivX5 check
5687 # OdivxPP disabled because of:
5688 # ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
5689 cat > $TMPC << EOF
5690 #include <decore.h>
5691 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_INIT; }
5693 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
5694 _opendivx=no
5695 # _ld_decore='-ldivxdecore opendivx/postprocess.o'
5696 _ld_decore='-ldivxdecore'
5697 _def_decore='#define NEW_DECORE 1'
5698 _def_divx='#define USE_DIVX'
5699 _def_divx5='#define DECORE_DIVX5 1'
5700 # _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
5701 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5702 _codecmodules="divx5linux $_codecmodules"
5703 _nocodecmodules="divx4linux $_nocodecmodules"
5704 echores "DivX5linux (with libdivxdecore.so)"
5705 elif test "$_opendivx" != no ; then
5706 _opendivx=yes
5707 _ld_decore='opendivx/libdecore.a'
5708 _def_decore='#undef NEW_DECORE'
5709 _def_divx='#define USE_DIVX'
5710 _def_divx5='#undef DECORE_DIVX5'
5711 _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
5712 _codecmodules="opendivx $_codecmodules"
5713 _nocodecmodules="divx5linux $_nocodecmodules"
5714 echores "OpenDivX"
5715 elif test "$_xvidcompat" = yes ; then
5716 _opendivx=no
5717 _ld_decore=''
5718 _def_decore='#define NEW_DECORE 1'
5719 _def_divx='#define USE_DIVX 1'
5720 _def_divx5='#undef DECORE_DIVX5'
5721 _def_decore_xvid='#define DECORE_XVID 1'
5722 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5723 _nocodecmodules="opendivx divx5linux divx4linux $_nocodecmodules"
5724 echores "XviD compat."
5725 else
5726 _opendivx=no
5727 _ld_decore=''
5728 _def_decore='#undef NEW_DECORE'
5729 _def_divx='#undef USE_DIVX'
5730 _def_divx5='#undef DECORE_DIVX5'
5731 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5732 _nocodecmodules="opendivx $_nocodecmodules"
5733 echores "no"
5734 fi # DivX5 check
5738 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
5739 if test "$_mencoder" != no ; then
5741 echocheck "libmp3lame (for mencoder)"
5742 _mp3lame=no
5743 cat > $TMPC <<EOF
5744 #include <lame/lame.h>
5745 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; }
5747 # Note: libmp3lame usually depends on vorbis
5748 cc_check -lmp3lame $_ld_vorbis $_ld_lm && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _mp3lame=yes
5749 if test "$_mp3lame" = yes ; then
5750 _def_mp3lame="#define HAVE_MP3LAME `$TMPO`"
5751 _def_cfg_mp3lame="#define CONFIG_MP3LAME `$TMPO`"
5752 _ld_mp3lame="-lmp3lame $_ld_vorbis"
5753 else
5754 _def_mp3lame='#undef HAVE_MP3LAME'
5755 _def_cfg_mp3lame='#undef CONFIG_MP3LAME'
5757 echores "$_mp3lame"
5760 echocheck "DivX4linux encore (for mencoder)"
5761 cat > $TMPC << EOF
5762 #include <encore2.h>
5763 int main(void) { (void) encore(0, 0, 0, 0); return 0; }
5765 if test "$_divx4linux" != no && cc_check -ldivxencore $_ld_lm ; then
5766 _def_encore='#define HAVE_DIVX4ENCORE 1'
5767 _ld_encore='-ldivxencore'
5768 echores "DivX4linux (with libdivxencore.so)"
5769 elif test "$_xvidcompat" = yes ; then
5770 _def_encore='#define HAVE_DIVX4ENCORE 1'
5771 _ld_encore=''
5772 _def_encore_xvid='#define ENCORE_XVID 1'
5773 echores "XviD compat."
5774 else
5775 _def_encore='#undef HAVE_DIVX4ENCORE'
5776 echores "no"
5781 echocheck "mencoder"
5782 _mencoder_flag='#undef HAVE_MENCODER'
5783 if test "$_mencoder" = yes ; then
5784 _mencoder_flag='#define HAVE_MENCODER'
5786 echores "$_mencoder"
5788 echocheck "fastmemcpy"
5789 # fastmemcpy check is done earlier with tests of CPU & binutils features
5790 if test "$_fastmemcpy" = yes ; then
5791 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
5792 else
5793 _def_fastmemcpy='#undef USE_FASTMEMCPY'
5795 echores "$_fastmemcpy"
5797 echocheck "UniquE RAR File Library"
5798 if test "$_unrarlib" = yes ; then
5799 _def_unrarlib='#define USE_UNRARLIB 1'
5800 else
5801 _def_unrarlib='#undef USE_UNRARLIB'
5803 echores "$_unrarlib"
5805 echocheck "TV interface"
5806 if test "$_tv" = yes ; then
5807 _def_tv='#define USE_TV 1'
5808 _inputmodules="tv $_inputmodules"
5809 else
5810 _noinputmodules="tv $_noinputmodules"
5811 _def_tv='#undef USE_TV'
5813 echores "$_tv"
5815 echocheck "EDL support"
5816 if test "$_edl" = yes ; then
5817 _def_edl='#define USE_EDL'
5818 _inputmodules="edl $_inputmodules"
5819 else
5820 _noinputmodules="edl $_noinputmodules"
5821 _def_edl='#undef USE_EDL'
5823 echores "$_edl"
5825 echocheck "*BSD BrookTree 848 TV interface"
5826 if test "$_tv_bsdbt848" = auto ; then
5827 _tv_bsdbt848=no
5828 if test "$_tv" = yes ; then
5829 cat > $TMPC <<EOF
5830 #include <sys/types.h>
5831 #if defined(__NetBSD__)
5832 #include <dev/ic/bt8xx.h>
5833 #else
5834 #include <machine/ioctl_bt848.h>
5835 #endif
5836 int main(void) { return 0; }
5838 cc_check && _tv_bsdbt848=yes
5841 if test "$_tv_bsdbt848" = yes ; then
5842 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
5843 _inputmodules="tv-bsdbt848 $_inputmodules"
5844 else
5845 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
5846 _noinputmodules="tv-bsdbt848 $_noinputmodules"
5848 echores "$_tv_bsdbt848"
5850 echocheck "Video 4 Linux TV interface"
5851 if test "$_tv_v4l" = auto ; then
5852 _tv_v4l=no
5853 if test "$_tv" = yes && linux ; then
5854 for I in /dev/video /dev/video? ; do
5855 if test -c $I ; then
5856 cat > $TMPC <<EOF
5857 #include <stdlib.h>
5858 #include <linux/videodev.h>
5859 int main(void) { return 0; }
5861 cc_check && _tv_v4l=yes
5862 break
5864 done
5867 if test "$_tv_v4l" = yes ; then
5868 _def_tv_v4l='#define HAVE_TV_V4L 1'
5869 _inputmodules="tv-v4l $_inputmodules"
5870 else
5871 _noinputmodules="tv-v4l $_noinputmodules"
5872 _def_tv_v4l='#undef HAVE_TV_V4L'
5874 echores "$_tv_v4l"
5877 echocheck "Video 4 Linux 2 TV interface"
5878 if test "$_tv_v4l2" = auto ; then
5879 _tv_v4l2=no
5880 if test "$_tv" = yes && linux ; then
5881 for I in /dev/video /dev/video? ; do
5882 if test -c $I ; then
5883 _tv_v4l2=yes
5884 break
5886 done
5889 if test "$_tv_v4l2" = yes ; then
5890 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
5891 _inputmodules="tv-v4l2 $_inputmodules"
5892 else
5893 _noinputmodules="tv-v4l2 $_noinputmodules"
5894 _def_tv_v4l2='#undef HAVE_TV_V4L2'
5896 echores "$_tv_v4l2"
5899 echocheck "audio select()"
5900 if test "$_select" = no ; then
5901 _def_select='#undef HAVE_AUDIO_SELECT'
5902 elif test "$_select" = yes ; then
5903 _def_select='#define HAVE_AUDIO_SELECT 1'
5905 echores "$_select"
5908 echocheck "network"
5909 # FIXME network check
5910 if test "$_network" != no ; then
5911 _def_network='#define MPLAYER_NETWORK 1'
5912 _ld_network="$_ld_sock"
5913 _inputmodules="network $_inputmodules"
5914 else
5915 _noinputmodules="network $_noinputmodules"
5916 _def_network='#undef MPLAYER_NETWORK'
5917 _ftp=no
5919 echores "$_network"
5921 echocheck "ftp"
5922 if (not beos) && (test "$_ftp" != no) ; then
5923 _def_ftp='#define HAVE_FTP 1'
5924 _inputmodules="ftp $_inputmodules"
5925 else
5926 _noinputmodules="ftp $_noinputmodules"
5927 _def_ftp='#undef HAVE_FTP'
5929 echores "$_ftp"
5931 # endian testing
5932 echocheck "byte order"
5933 if test "$_big_endian" = auto ; then
5934 cat > $TMPC <<EOF
5935 short asci_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|0)};
5936 int main(){
5937 char* s = (char*)asci_name;
5938 return 0;
5941 if cc_check ; then
5942 if test `grep -l MPlayer $TMPO` ; then
5943 _big_endian=yes
5944 else
5945 _big_endian=no
5947 else
5948 echo -n "failed to autodetect byte order, defaulting to "
5951 if test "$_big_endian" = yes ; then
5952 _byte_order='big-endian'
5953 _def_words_endian='#define WORDS_BIGENDIAN 1'
5954 else
5955 _byte_order='little-endian'
5956 _def_words_endian='#undef WORDS_BIGENDIAN'
5958 echores "$_byte_order"
5960 echocheck "shared postprocess lib"
5961 echores "$_shared_pp"
5963 echocheck "OSD menu"
5964 if test "$_menu" = yes ; then
5965 _def_menu='#define HAVE_MENU 1'
5966 else
5967 _def_menu='#undef HAVE_MENU'
5969 echores "$_menu"
5971 # Check to see if they want QTX codecs enabled
5972 echocheck "QTX codecs"
5973 if test "$_qtx" = auto ; then
5974 _qtx=$_win32
5976 if test "$_qtx" = yes ; then
5977 _def_qtx='#define USE_QTX_CODECS 1'
5978 _codecmodules="qtx $_codecmodules"
5979 else
5980 _def_qtx='#undef USE_QTX_CODECS'
5981 _nocodecmodules="qtx $_nocodecmodules"
5983 echores "$_qtx"
5986 echocheck "Subtitles sorting"
5987 if test "$_sortsub" = yes ; then
5988 _def_sortsub='#define USE_SORTSUB 1'
5989 else
5990 _def_sortsub='#undef USE_SORTSUB'
5992 echores "$_sortsub"
5995 echocheck "XMMS inputplugin support"
5996 if test "$_xmms" = yes ; then
5998 if ( xmms-config --version ) >/dev/null 2>&1 ; then
5999 if test -z "$_xmmsplugindir" ; then
6000 _xmmsplugindir=`xmms-config --input-plugin-dir`
6002 if test -z "$_xmmslibdir" ; then
6003 _xmmslibdir=`xmms-config --exec-prefix`/lib
6005 else
6006 if test -z "$_xmmsplugindir" ; then
6007 _xmmsplugindir=/usr/lib/xmms/Input
6009 if test -z "$_xmmslibdir" ; then
6010 _xmmslibdir=/usr/lib
6014 _def_xmms='#define HAVE_XMMS 1'
6015 if darwin ; then
6016 _xmms_lib="${_xmmslibdir}/libxmms.dylib"
6017 else
6018 _xmms_lib="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6020 else
6021 _def_xmms='#undef HAVE_XMMS'
6023 echores "$_xmms"
6025 echocheck "inet6"
6026 if test "$_inet6" = auto ; then
6027 cat > $TMPC << EOF
6028 #include <sys/types.h>
6029 #include <sys/socket.h>
6030 int main(void) { socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6032 _inet6=no
6033 if cc_check ; then
6034 _inet6=yes
6037 if test "$_inet6" = yes ; then
6038 _def_inet6='#define HAVE_AF_INET6 1'
6039 else
6040 _def_inet6='#undef HAVE_AF_INET6'
6042 echores "$_inet6"
6045 echocheck "gethostbyname2"
6046 if test "$_gethostbyname2" = auto ; then
6047 cat > $TMPC << EOF
6048 #include <sys/types.h>
6049 #include <sys/socket.h>
6050 #include <netdb.h>
6051 int main(void) { gethostbyname2("", AF_INET); }
6053 _gethostbyname2=no
6054 if cc_check ; then
6055 _gethostbyname2=yes
6059 if test "$_gethostbyname2" = yes ; then
6060 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6061 else
6062 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6064 echores "$_gethostbyname2"
6066 # --------------- GUI specific tests begin -------------------
6067 echocheck "GUI"
6068 echo "$_gui"
6069 if test "$_gui" = yes ; then
6071 # Required libraries
6072 test "$_png" != yes && die "PNG support required for GUI compilation, please install libpng and libpng-dev packages."
6073 test "$_x11" != yes && die "X11 support required for GUI compilation"
6075 echocheck "XShape extension"
6076 _xshape=no
6077 if test "$_x11" = yes ; then
6078 cat > $TMPC << EOF
6079 #include <X11/Xlib.h>
6080 #include <X11/Xproto.h>
6081 #include <X11/Xutil.h>
6082 #include <X11/extensions/shape.h>
6083 #include <stdlib.h>
6084 int main(void) {
6085 char *name = ":0.0";
6086 Display *wsDisplay;
6087 int exitvar = 0;
6088 int eventbase, errorbase;
6089 if (getenv("DISPLAY"))
6090 name=getenv("DISPLAY");
6091 wsDisplay=XOpenDisplay(name);
6092 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6093 exitvar=1;
6094 XCloseDisplay(wsDisplay);
6095 return exitvar;
6098 cc_check $_inc_x11 $_ld_x11 && _xshape=yes
6100 if test "$_xshape" = yes ; then
6101 _def_xshape='#define HAVE_XSHAPE 1'
6102 else
6103 die "The GUI requires the X11 extension XShape (which was not found)."
6105 echores "$_xshape"
6108 # Check for GTK:
6109 echocheck "GTK version"
6110 if test -z "$_gtkconfig" ; then
6111 if ( gtk-config --version ) >/dev/null 2>&1 ; then
6112 _gtkconfig="gtk-config"
6113 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
6114 _gtkconfig="gtk12-config"
6115 else
6116 die "The GUI requires GTK devel packages (which were not found)."
6119 _gtk=`$_gtkconfig --version 2>&1`
6120 _inc_gtk=`$_gtkconfig --cflags 2>&1`
6121 _ld_gtk=`$_gtkconfig --libs 2>&1`
6122 echores "$_gtk (using $_gtkconfig)"
6124 # Check for GLIB
6125 echocheck "glib version"
6126 if test -z "$_glibconfig" ; then
6127 if ( glib-config --version ) >/dev/null 2>&1 ; then
6128 _glibconfig="glib-config"
6129 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
6130 _glibconfig="glib12-config"
6131 else
6132 die "The GUI requires GLib devel packages (which were not found)"
6135 _glib=`$_glibconfig --version 2>&1`
6136 _inc_glib=`$_glibconfig --cflags 2>&1`
6137 _ld_glib=`$_glibconfig --libs 2>&1`
6138 echores "$_glib (using $_glibconfig)"
6140 _def_gui='#define HAVE_NEW_GUI 1'
6141 _ld_gui='$(GTKLIB) $(GLIBLIB)'
6143 echo "Creating Gui/config.mak"
6144 cat > Gui/config.mak << EOF
6145 # -------- Generated by configure -----------
6147 GTKINC = $_inc_gtk
6148 GTKLIBS = $_ld_gtk
6149 GLIBINC = $_inc_glib
6150 GLIBLIBS = $_ld_glib
6154 else
6155 _def_gui='#undef HAVE_NEW_GUI'
6157 # --------------- GUI specific tests end -------------------
6161 #############################################################################
6163 # Checking for CFLAGS
6164 _stripbinaries=yes
6165 if test "$_profile" != "" || test "$_debug" != "" ; then
6166 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
6167 if test "$_cc_major" -ge "3" ; then
6168 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
6170 _stripbinaries=no
6171 elif test -z "$CFLAGS" ; then
6172 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
6173 # always compile with '-g' if .developer:
6174 if test -f ".developer" ; then
6175 CFLAGS="-g $CFLAGS"
6176 _stripbinaries=no
6178 else
6179 cat <<EOF
6181 MPlayer compilation will use the CFLAGS set by you, but:
6183 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6185 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6186 To do so, execute 'CFLAGS= ./configure <options>'
6190 if darwin ; then
6191 CFLAGS="$CFLAGS -DSYS_DARWIN"
6192 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
6193 CFLAGS="$CFLAGS -no-cpp-precomp"
6196 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
6197 test "$_altivec" = yes && CFLAGS="$CFLAGS -DCONFIG_DARWIN"
6199 if hpux ; then
6200 # use flag for HPUX missing setenv()
6201 CFLAGS="$CFLAGS -DHPUX"
6203 # Thread support
6204 if linux ; then
6205 CFLAGS="$CFLAGS -D_REENTRANT"
6206 elif bsd ; then
6207 # FIXME bsd needs this so maybe other OS'es
6208 CFLAGS="$CFLAGS -D_THREAD_SAFE"
6210 # 64 bit file offsets?
6211 if test "$_largefiles" = yes || freebsd ; then
6212 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
6213 if test "$_dvdread" = yes ; then
6214 # dvdread support requires this (for off64_t)
6215 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
6219 echocheck "compiler support for -fno-PIC"
6220 if x86; then
6221 cat > $TMPC <<EOF
6222 int main(void) { return 0; }
6224 if cc_check -fno-PIC ; then
6225 CFLAGS="-fno-PIC $CFLAGS"
6226 echores "yes"
6227 else
6228 echores "no"
6230 else
6231 echores "only used for x86"
6234 echocheck "ftello()"
6235 # if we don't have ftello use the osdep/ compatibility module
6236 cat > $TMPC << EOF
6237 #include <stdio.h>
6238 #include <sys/types.h>
6239 int main (void) { ftello(stdin); return 0; }
6241 _ftello=no
6242 cc_check && _ftello=yes
6243 if test "$_ftello" = yes ; then
6244 _def_ftello='#define HAVE_FTELLO 1'
6245 else
6246 _def_ftello='#undef HAVE_FTELLO'
6248 echores "$_ftello"
6250 # Determine OS dependent libs
6251 if cygwin ; then
6252 _def_confwin32='#define WIN32'
6253 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
6254 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
6255 CFLAGS="$CFLAGS -D__CYGWIN__"
6258 if win32 ; then
6259 _confwin32='TARGET_WIN32 = yes'
6260 else
6261 _confwin32='TARGET_WIN32 = no'
6264 # Dynamic linking flags
6265 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6266 _ld_dl_dynamic=''
6267 bsd && _ld_dl_dynamic='-rdynamic'
6268 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx ; then
6269 _ld_dl_dynamic='-rdynamic'
6272 _ld_arch="$_ld_arch $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6273 bsdos && _ld_arch="$_ld_arch -ldvd"
6274 if netbsd ; then
6275 x86 && _ld_arch="$_ld_arch -li386"
6278 _def_debug='#undef MP_DEBUG'
6279 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
6281 _def_linux='#undef TARGET_LINUX'
6282 linux && _def_linux='#define TARGET_LINUX 1'
6284 # TODO cleanup the VIDIX stuff here
6285 _def_vidix='#define CONFIG_VIDIX 1'
6286 test "$_vidix" = no && _def_vidix='#undef CONFIG_VIDIX'
6287 if test "$_vidix" = yes; then
6288 _vosrc="$_vosrc vo_cvidix.c"
6289 _vomodules="cvidix $_vomodules"
6290 else
6291 _novomodules="cvidix $_novomodules"
6293 if test "$_vidix" = yes && (win32); then
6294 _vosrc="$_vosrc vo_winvidix.c"
6295 _vomodules="winvidix $_vomodules"
6296 else
6297 _novomodules="winvidix $_novomodules"
6299 if test "$_vidix" = yes && test "$_x11" = yes; then
6300 _vosrc="$_vosrc vo_xvidix.c"
6301 _vomodules="xvidix $_vomodules"
6302 else
6303 _novomodules="xvidix $_novomodules"
6305 echo Checking for VIDIX ... "$_vidix"
6307 _def_joystick='#undef HAVE_JOYSTICK'
6308 if test "$_joystick" = yes ; then
6309 if linux ; then
6310 # TODO add some check
6311 _def_joystick='#define HAVE_JOYSTICK 1'
6312 else
6313 _joystick="no (unsupported under $system_name)"
6316 echo Checking for joystick ... "$_joystick"
6318 echocheck "lirc"
6319 if test "$_lirc" = auto ; then
6320 _lirc=no
6321 if test -c /dev/lirc -o -c /dev/lirc/0 ; then
6322 cat > $TMPC <<EOF
6323 #include <lirc/lirc_client.h>
6324 int main(void) { return 0; }
6326 cc_check -llirc_client && _lirc=yes
6329 if test "$_lirc" = yes ; then
6330 _def_lirc='#define HAVE_LIRC 1'
6331 _ld_lirc='-llirc_client'
6332 else
6333 _def_lirc='#undef HAVE_LIRC'
6335 echores "$_lirc"
6337 echocheck "lircc"
6338 if test "$_lircc" = auto ; then
6339 _lircc=no
6340 cat > $TMPC <<EOF
6341 #include <lirc/lircc.h>
6342 int main(void) { return 0; }
6344 cc_check -llircc && _lircc=yes
6346 if test "$_lircc" = yes ; then
6347 _def_lircc='#define HAVE_LIRCC 1'
6348 _ld_lircc='-llircc'
6349 else
6350 _def_lircc='#undef HAVE_LIRCC'
6352 echores "$_lircc"
6354 #############################################################################
6355 echo "Creating config.mak"
6356 cat > config.mak << EOF
6357 # -------- Generated by configure -----------
6359 LANG = C
6360 MAN_LANG = $MAN_LANG
6361 TARGET_OS = $system_name
6362 DESTDIR =
6363 prefix = \$(DESTDIR)$_prefix
6364 BINDIR = \$(DESTDIR)$_bindir
6365 DATADIR = \$(DESTDIR)$_datadir
6366 MANDIR = \$(DESTDIR)$_mandir
6367 CONFDIR = \$(DESTDIR)$_confdir
6368 LIBDIR = \$(DESTDIR)$_libdir
6369 #AR = ar
6370 CC = $_cc
6371 HOST_CC = $_host_cc
6372 AWK = $_awk
6373 RANLIB = $_ranlib
6374 INSTALL = $_install
6375 # OPTFLAGS = -O4 $_profile $_debug $_march $_mcpu $_pipe -fomit-frame-pointer -ffast-math
6376 EXTRA_INC = $_inc_extra $_inc_gtk
6377 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
6378 STRIPBINARIES = $_stripbinaries
6379 HELP_FILE = $_mp_help
6381 PRG = $_prg
6382 PRG_MENCODER = $_prg_mencoder
6384 $_live_libs_def
6386 MPLAYER_NETWORK = $_network
6387 STREAMING_LIVE_DOT_COM = $_live
6388 MPLAYER_NETWORK_LIB = $_ld_live $_ld_network
6389 DVBIN = $_dvbin
6390 VIDIX = $_vidix
6391 SHARED_PP = $_shared_pp
6392 CONFIG_PP = yes
6393 CONFIG_RISKY = yes
6394 CONFIG_MP3LAME = $_mp3lame
6395 LIBMENU = $_menu
6396 I18NLIBS = $_i18n_libs
6397 MATROSKA = $_matroska_internal
6399 OPENDIVX = $_opendivx
6401 MP3LIB = $_mp3lib
6402 LIBA52 = $_liba52
6403 LIBMPEG2 = $_libmpeg2
6405 UNRARLIB = $_unrarlib
6406 HAVE_FFPOSTPROCESS = $_def_haveffpostprocess
6407 PNG = $_mkf_png
6408 JPEG = $_mkf_jpg
6409 GIF = $_mkf_gif
6411 EXTRA_LIB = $_ld_extra
6412 Z_LIB = $_ld_static $_ld_zlib
6413 HAVE_MLIB = $_mlib
6414 WIN32_LIB = $_ld_win32libs
6415 STATIC_LIB = $_ld_static
6416 ENCA_LIB = $_ld_enca
6417 HAVE_PTHREADS = $_pthreads
6418 MATH_LIB = $_ld_lm
6420 X11_INC = $_inc_x11
6421 X11DIR = $_ld_x11
6423 HAVE_XVMC_ACCEL = $_xvmc
6425 # for libavcodec:
6426 SRC_PATH=..
6427 LIBPREF=lib
6428 LIBSUF=.a
6429 SLIBPREF=lib
6430 SLIBSUF=.so
6432 # video output
6433 X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
6434 GGI_LIB = $_ld_ggi
6435 MLIB_LIB = $_ld_mlib
6436 MLIB_INC = $_inc_mlib
6437 DXR2_INC = $_inc_dxr2
6438 DVB_INC = $_inc_dvb
6439 PNG_LIB = $_ld_png
6440 JPEG_LIB = $_ld_jpg
6441 GIF_LIB = $_ld_gif
6442 SDL_LIB = $_ld_sdl
6443 SVGA_LIB = $_ld_svga
6444 AA_LIB = $_ld_aa
6445 CACA_INC = $_inc_caca
6446 CACA_LIB = $_ld_caca
6448 # audio output
6449 ALSA_LIB = $_ld_alsa
6450 NAS_LIB = $_ld_nas
6451 ARTS_LIB = $_ld_arts
6452 ARTS_INC = $_inc_arts
6453 ESD_LIB = $_ld_esd
6454 ESD_INC = $_inc_esd
6455 JACK_LIB = $_ld_jack
6456 JACK_INC = $_inc_jack
6457 SGIAUDIO_LIB = $_ld_sgiaudio
6459 # input/demuxer/codecs
6460 TERMCAP_LIB = $_ld_termcap
6461 LIRC_LIB = $_ld_lirc
6462 LIRCC_LIB = $_ld_lircc
6463 DVDREAD_LIB = $_ld_dvdread
6464 DVDKIT = $_dvdkit
6465 DVDKIT2 = $_dvdkit2
6466 DVDKIT_SHARED = no
6467 SDL_INC = $_inc_sdl
6468 W32_DEP = $_dep_win32
6469 W32_LIB = $_ld_win32
6470 DS_DEP = $_dep_dshow
6471 DS_LIB = $_ld_dshow
6472 AV_DEP = $_dep_libavcodec $_dep_libavformat
6473 AV_LIB = $_ld_libavcodec $_ld_libavformat
6474 CONFIG_LIBAVFORMAT = $_libavformat
6475 ZORAN = $_zr
6476 FAME = $_fame
6477 FAME_LIB = $_ld_fame
6478 MP1E_DEP = $_dep_mp1e
6479 MP1E_LIB = $_ld_mp1e
6480 ARCH_LIB = $_ld_arch $_ld_iconv
6481 XVID = $_xvid
6482 XVID_INC = $_inc_xvid
6483 XVID_LIB = $_ld_xvid
6484 X264 = $_x264
6485 X264_INC = $_inc_x264
6486 X264_LIB = $_ld_x264
6487 CONFIG_DTS = $_libdts
6488 DTS_INC = $_inc_libdts
6489 DTS_LIB = $_ld_libdts
6490 DECORE_LIB = $_ld_decore $_ld_mp3lame
6491 MENCODER = $_mencoder
6492 ENCORE_LIB = $_ld_encore $_ld_mp3lame
6493 DIRECTFB_INC = $_inc_directfb
6494 DIRECTFB_LIB = $_ld_directfb
6495 CDPARANOIA_INC = $_inc_cdparanoia
6496 CDPARANOIA_LIB = $_ld_cdparanoia
6497 FREETYPE_INC = $_inc_freetype
6498 FREETYPE_LIB = $_ld_freetype
6499 FONTCONFIG_INC = $_inc_fontconfig
6500 FONTCONFIG_LIB = $_ld_fontconfig
6501 FRIBIDI_INC = $_inc_fribidi
6502 FRIBIDI_LIB = $_ld_fribidi
6503 LIBLZO_LIB= $_ld_liblzo
6504 MAD_LIB = $_ld_mad
6505 VORBIS_LIB = $_ld_vorbis $_ld_libdv
6506 THEORA_LIB = $_ld_theora
6507 FAAD_LIB = $_ld_faad
6508 INTERNAL_FAAD = $_faad_internal
6509 SMBSUPPORT_LIB = $_ld_smb
6510 XMMS_PLUGINS = $_xmms
6511 XMMS_LIB = $_xmms_lib
6512 MACOSX = $_macosx
6513 MACOSX_FRAMEWORKS = $_macosx_frameworks
6514 TOOLAME=$_toolame
6515 TOOLAME_EXTRAFLAGS=$_toolame_extraflags
6516 TOOLAME_LIB=$_toolame_lib
6518 # --- Some stuff for autoconfigure ----
6519 $_target_arch
6520 $_confwin32
6521 TARGET_CPU=$iproc
6522 TARGET_MMX = $_mmx
6523 TARGET_MMX2 = $_mmx2
6524 TARGET_3DNOW = $_3dnow
6525 TARGET_3DNOWEX = $_3dnowex
6526 TARGET_SSE = $_sse
6527 TARGET_ALTIVEC = $_altivec
6528 TARGET_VIS = $_vis
6530 # --- GUI stuff ---
6531 GTKLIB = $_ld_static $_ld_gtk
6532 GLIBLIB = $_ld_static $_ld_glib
6533 GTK_LIBS = $_ld_static $_ld_gui
6534 GUI = $_gui
6535 DEBUG = -DDEBUG
6539 #############################################################################
6540 echo "Creating config.h"
6541 cat > config.h << EOF
6542 /* -------- This file has been automatically generated by configure ---------
6543 Note: Any changes in it will be lost when you run configure again. */
6545 /* Protect against multiple inclusion */
6546 #ifndef MPLAYER_CONFIG_H
6547 #define MPLAYER_CONFIG_H 1
6549 /* use GNU internationalization */
6550 $_def_i18n
6552 /* missing mmap function on libc5 systems */
6553 #ifndef MAP_FAILED
6554 # define MAP_FAILED ((void *) -1)
6555 #endif
6557 /* use setlocale() function */
6558 $_def_setlocale
6560 /* Runtime CPU detection */
6561 $_def_runtime_cpudetection
6563 /* Dynamic a/v plugins */
6564 $_def_dynamic_plugins
6566 /* "restrict" keyword */
6567 #define restrict $_def_restrict_keyword
6569 /* attribute(used) as needed by some compilers */
6570 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
6571 # define attribute_used __attribute__((used))
6572 #else
6573 # define attribute_used
6574 #endif
6576 #define PREFIX "$_prefix"
6578 #define USE_OSD 1
6579 #define USE_SUB 1
6581 /* enable/disable SIGHANDLER */
6582 $_def_sighandler
6584 /* Toggles debugging informations */
6585 $_def_debug
6587 /* Indicates that Ogle's libdvdread is available for DVD playback */
6588 $_def_dvdread
6590 /* Indicates that dvdread is from libmpdvdkit */
6591 $_def_mpdvdkit
6593 /* Additional options for libmpdvdkit*/
6594 $_def_dvd
6595 $_def_cdrom
6596 $_def_cdio
6597 $_def_dvdio
6598 $_def_bsdi_dvd
6599 $_def_dvd_bsd
6600 $_def_dvd_linux
6601 $_dev_dvd_openbsd
6602 $_def_dvd_darwin
6603 $_def_sol_scsi_h
6604 $_def_hpux_scsi_h
6605 $_def_stddef
6607 /* Common data directory (for fonts, etc) */
6608 #define MPLAYER_DATADIR "$_datadir"
6609 #define MPLAYER_CONFDIR "$_confdir"
6610 #define MPLAYER_LIBDIR "$_libdir"
6612 /* Define this to compile stream-caching support, it can be enabled via
6613 -cache <kilobytes> */
6614 #define USE_STREAM_CACHE 1
6616 /* Define to include support for XviD/Divx4Linux/OpenDivx */
6617 $_def_divx
6619 /* Define to use the new XviD/DivX4Linux library instead of open source OpenDivX */
6620 /* You have to change DECORE_LIBS in config.mak, too! */
6621 $_def_decore
6623 /* Define if you are using DivX5Linux Decore library */
6624 $_def_divx5
6626 /* Define if you are using XviD library */
6627 $_def_xvid3
6628 $_def_xvid4
6629 $_def_decore_xvid
6630 $_def_encore_xvid
6632 /* Define if you are using the X.264 library */
6633 $_def_x264
6635 /* Define to include support for libdv-0.9.5 */
6636 $_def_libdv
6638 /* If build mencoder */
6639 $_mencoder_flag
6641 /* Indicates if XviD/Divx4linux encore is available
6642 Note: for mencoder */
6643 $_def_encore
6645 /* Indicates if libmp3lame is available
6646 Note: for mencoder */
6647 $_def_mp3lame
6648 $_def_cfg_mp3lame
6650 /* Define libmp1e for realtime mpeg encoding (for DXR3 and DVB cards) */
6651 $_def_mp1e
6653 /* Define this to enable avg. byte/sec-based AVI sync method by default:
6654 (use -bps or -nobps commandline option for run-time method selection)
6655 -bps gives better sync for vbr mp3 audio, it is now default */
6656 #define AVI_SYNC_BPS 1
6658 /* Undefine this if you do not want to select mono audio (left or right)
6659 with a stereo MPEG layer 2/3 audio stream. The command line option
6660 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6661 right-only), with 0 being the default.
6663 #define USE_FAKE_MONO 1
6665 /* Undefine this if your sound card driver has no working select().
6666 If you have kernel Oops, player hangups, or just no audio, you should
6667 try to recompile MPlayer with this option disabled! */
6668 $_def_select
6670 /* define this to use iconv(3) function to codepage conversions */
6671 $_def_iconv
6673 /* define this to use nl_langinfo function */
6674 $_def_langinfo
6676 /* define this to use RTC (/dev/rtc) for video timers (LINUX only) */
6677 $_def_rtc
6679 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
6680 #define MAX_OUTBURST 65536
6682 /* set up audio OUTBURST. Do not change this! */
6683 #define OUTBURST 512
6685 /* Define this if your system has the header file for the OSS sound interface */
6686 $_def_sys_soundcard
6688 /* Define this if your system has the header file for the OSS sound interface
6689 * in /usr/include */
6690 $_def_soundcard
6692 /* Define this if your system has the sysinfo header */
6693 $_def_sys_sysinfo
6695 /* Define this if your system has ftello() */
6697 $_def_ftello
6698 #ifndef HAVE_FTELLO
6699 /* Need these for FILE and off_t an config.h is usually before other includes*/
6700 #include <stdio.h>
6701 #include <sys/types.h>
6702 off_t ftello(FILE *);
6703 #endif
6705 /* Define this if your system has the "malloc.h" header file */
6706 $_def_malloc
6708 /* memalign is mapped to malloc if unsupported */
6709 $_def_memalign
6710 #ifndef HAVE_MEMALIGN
6711 # define memalign(a,b) malloc(b)
6712 #endif
6714 /* Define this if your system has the "alloca.h" header file */
6715 $_def_alloca
6717 /* Define this if your system has the "sys/mman.h" header file */
6718 $_def_mman
6720 /* Define this if you have the elf dynamic linker -ldl library */
6721 $_def_dl
6723 /* Define this if you have the kstat kernel statistics library */
6724 $_def_kstat
6726 /* Define this if you have zlib */
6727 $_def_zlib
6728 #ifdef HAVE_ZLIB
6729 #define CONFIG_ZLIB 1
6730 #endif
6732 /* Define this if you have shm support */
6733 $_def_shm
6735 /* Define this if your system has scandir & alphasort */
6736 $_def_scandir
6738 /* Define this if your system has strsep */
6739 $_def_strsep
6741 /* Define this if your system has strlcpy */
6742 $_def_strlcpy
6743 #ifndef HAVE_STRLCPY
6744 unsigned int strlcpy (char *dest, char *src, unsigned int size);
6745 #endif
6747 /* Define this if your system has strlcat */
6748 $_def_strlcat
6749 #ifndef HAVE_STRLCAT
6750 unsigned int strlcat (char *dest, char *src, unsigned int size);
6751 #endif
6753 /* Define this if your system has fseeko */
6754 $_def_fseeko
6755 #ifndef HAVE_FSEEKO
6756 /* Need these for FILE and off_t an config.h is usually before other includes*/
6757 #include <stdio.h>
6758 #include <sys/types.h>
6759 int fseeko(FILE *, off_t, int);
6760 #endif
6762 $_def_localtime_r
6764 /* Define this if your system has vsscanf */
6765 $_def_vsscanf
6767 /* Define this if your system has swab */
6768 $_def_swab
6770 /* Define this if your system has no posix select */
6771 $_def_no_posix_select
6773 /* Define this if your system has gettimeofday */
6774 $_def_gettimeofday
6776 /* Define this if your system has glob */
6777 $_def_glob
6779 /* Define this if your system has pthreads */
6780 $_def_pthreads
6782 /* LIRC (remote control, see www.lirc.org) support: */
6783 $_def_lirc
6786 * LIRCCD (LIRC client daemon)
6787 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
6789 $_def_lircc
6791 /* DVD navigation support using libdvdnav */
6792 $_def_dvdnav
6793 $_def_dvdnav_version
6795 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
6796 #define MPEG12_POSTPROC 1
6798 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
6799 $_def_ffpostprocess
6801 /* Define to include support for OpenDivx postprocessing */
6802 $_def_odivx_postprocess
6804 /* Win32 DLL support */
6805 $_def_win32
6806 #define WIN32_PATH "$_win32libdir"
6808 /* DirectShow support */
6809 $_def_dshow
6811 /* Mac OS X specific features */
6812 $_def_macosx
6814 /* Mac OS X SHLB support */
6815 $_def_macshlb
6817 /* Build our Win32-loader */
6818 $_def_win32_loader
6820 /* ffmpeg's libavcodec support (requires libavcodec source) */
6821 $_def_libavcodec
6822 $_def_libavcodecso
6824 /* ffmpeg's libavformat support (requires libavformat source) */
6825 $_def_libavformat
6826 $_def_libavformat_win32
6828 /* risky codecs */
6829 #define CONFIG_RISKY 1
6831 /* Use libavcodec's decoders */
6832 #define CONFIG_DECODERS 1
6833 /* Use libavcodec's encoders */
6834 #define CONFIG_ENCODERS 1
6836 #define CONFIG_MPEGAUDIO_HP 1
6838 /* Use codec libs included in mplayer CVS / source dist: */
6839 $_def_mp3lib
6840 $_def_liba52
6841 $_def_libdts
6842 $_def_libmpeg2
6844 /* Use libfame encoder filter */
6845 $_def_fame
6847 /* XAnim DLL support */
6848 $_def_xanim
6849 /* Default search path */
6850 $_def_xanim_path
6852 /* RealPlayer DLL support */
6853 $_def_real
6854 /* Default search path */
6855 $_def_real_path
6857 /* LIVE.COM Streaming Media library support */
6858 $_def_live
6860 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
6861 $_def_fastmemcpy
6863 /* Use unrarlib for Vobsubs */
6864 $_def_unrarlib
6866 /* gui support, please do not edit this option */
6867 $_def_gui
6869 /* Audio output drivers */
6870 $_def_ossaudio
6871 $_def_ossaudio_devdsp
6872 $_def_ossaudio_devmixer
6873 $_def_alsa5
6874 $_def_alsa9
6875 $_def_alsa1x
6876 $_def_arts
6877 $_def_esd
6878 $_def_esd_latency
6879 $_def_jack
6880 $_def_sys_asoundlib_h
6881 $_def_alsa_asoundlib_h
6882 $_def_sunaudio
6883 $_def_sgiaudio
6884 $_def_win32waveout
6885 $_def_nas
6887 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
6888 #undef FAST_OSD
6889 #undef FAST_OSD_TABLE
6891 /* Enable TV Interface support */
6892 $_def_tv
6894 /* Enable EDL support */
6895 $_def_edl
6897 /* Enable Video 4 Linux TV interface support */
6898 $_def_tv_v4l
6900 /* Enable Video 4 Linux 2 TV interface support */
6901 $_def_tv_v4l2
6903 /* Enable *BSD BrookTree TV interface support */
6904 $_def_tv_bsdbt848
6906 /* Define if your processor stores words with the most significant
6907 byte first (like Motorola and SPARC, unlike Intel and VAX). */
6908 $_def_words_endian
6910 $_def_arch
6912 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
6913 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
6915 #ifdef ARCH_POWERPC
6916 #define ARCH_PPC 1
6917 #endif
6919 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
6920 #ifdef ARCH_ARMV4L
6921 #define ARCH_ARM 1
6922 #endif
6924 /* only gcc3 can compile mvi instructions */
6925 $_def_gcc_mvi_support
6927 /* Define this for Cygwin build for win32 */
6928 $_def_confwin32
6930 /* Define this to any prefered value from 386 up to infinity with step 100 */
6931 #define __CPU__ $iproc
6933 $_mp_wordsize
6935 $_def_linux
6937 $_def_vcd
6939 #ifdef sun
6940 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
6941 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
6942 #elif defined(HPUX)
6943 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
6944 #define DEFAULT_DVD_DEVICE "/dev/dvd"
6945 #elif defined(WIN32)
6946 #define DEFAULT_CDROM_DEVICE "D:"
6947 #define DEFAULT_DVD_DEVICE "D:"
6948 #elif defined(SYS_DARWIN)
6949 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
6950 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
6951 #elif defined(__OpenBSD__)
6952 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
6953 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
6954 #else
6955 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
6956 #define DEFAULT_DVD_DEVICE "/dev/dvd"
6957 #endif
6960 /*----------------------------------------------------------------------------
6962 ** NOTE: Instead of modifying these definitions here, use the
6963 ** --enable/--disable options of the ./configure script!
6964 ** See ./configure --help for details.
6966 *---------------------------------------------------------------------------*/
6968 /* C99 lrintf function available */
6969 $_def_lrintf
6971 /* yes, we have inttypes.h */
6972 #define HAVE_INTTYPES_H 1
6974 /* int_fastXY_t emulation */
6975 $_def_fast_inttypes
6977 /* nanosleep support */
6978 $_def_nanosleep
6980 /* SMB support */
6981 $_def_smbsupport
6983 /* termcap flag for getch2.c */
6984 $_def_termcap
6986 /* termios flag for getch2.c */
6987 $_def_termios
6988 $_def_termios_h
6989 $_def_termios_sys_h
6991 /* enable PNG support */
6992 $_def_png
6994 /* enable JPEG support */
6995 $_def_jpg
6997 /* enable PNM support */
6998 $_def_pnm
7000 /* enable md5sum support */
7001 $_def_md5sum
7003 /* enable GIF support */
7004 $_def_gif
7005 $_def_gif_4
7006 $_def_gif_tvt_hack
7008 /* enable FreeType support */
7009 $_def_freetype
7011 /* enable Fontconfig support */
7012 $_def_fontconfig
7014 /* enable FriBiDi usage */
7015 $_def_fribidi
7017 /* enable ENCA usage */
7018 $_def_enca
7020 /* liblzo support */
7021 $_def_liblzo
7023 /* libmad support */
7024 $_def_mad
7026 /* enable OggVorbis support */
7027 $_def_vorbis
7029 /* enable Tremor as vorbis decoder */
7030 $_def_tremor
7032 /* enable OggTheora support */
7033 $_def_theora
7035 /* enable Matroska support */
7036 $_def_matroska
7038 /* enable FAAD (AAC) support */
7039 $_def_faad
7040 $_def_faad_internal
7041 $_def_faad_version
7043 /* enable network */
7044 $_def_network
7046 /* enable ftp support */
7047 $_def_ftp
7049 /* enable winsock2 instead of Unix functions*/
7050 $_def_winsock2
7052 /* define this to use inet_aton() instead of inet_pton() */
7053 $_def_use_aton
7055 /* enables / disables cdparanoia support */
7056 $_def_cdparanoia
7058 /* enables / disables VIDIX usage */
7059 $_def_vidix
7061 /* enables / disables new input joystick support */
7062 $_def_joystick
7064 /* enables / disables QTX codecs */
7065 $_def_qtx
7067 /* enables / disables osd menu */
7068 $_def_menu
7070 /* enables / disables subtitles sorting */
7071 $_def_sortsub
7073 /* XMMS input plugin support */
7074 $_def_xmms
7075 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7077 /* enables inet6 support */
7078 $_def_inet6
7080 /* do we have gethostbyname2? */
7081 $_def_gethostbyname2
7083 /* Extension defines */
7084 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
7085 $_def_3dnowex // only define if you have 3DNOWEX (AMD Athlon, etc.)
7086 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
7087 $_def_mmx2 // only define if you have MMX2 (Athlon/PIII/4/CelII)
7088 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
7089 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
7090 $_def_altivec // only define if you have Altivec (G4)
7092 $_def_altivec_h // enables usage of altivec.h
7095 $_def_mlib // Sun mediaLib, available only on solaris
7096 $_def_vis // only define if you have VIS ( ultrasparc )
7098 /* libmpeg2 uses a different feature test macro for mediaLib */
7099 #ifdef HAVE_MLIB
7100 #define LIBMPEG2_MLIB 1
7101 #endif
7103 /* libvo options */
7104 #define SCREEN_SIZE_X 1
7105 #define SCREEN_SIZE_Y 1
7106 $_def_x11
7107 $_def_xv
7108 $_def_xvmc
7109 $_def_vm
7110 $_def_xinerama
7111 $_def_gl
7112 $_def_gl_win32
7113 $_def_dga
7114 $_def_dga2
7115 $_def_sdl
7116 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
7117 $_def_sdlbuggy
7118 $_def_directx
7119 $_def_ggi
7120 $_def_3dfx
7121 $_def_tdfxfb
7122 $_def_tdfxvid
7123 $_def_directfb
7124 $_def_directfb_version
7125 $_def_zr
7126 $_def_bl
7127 $_def_mga
7128 $_def_xmga
7129 $_def_syncfb
7130 $_def_fbdev
7131 $_def_dxr2
7132 $_def_dxr3
7133 $_def_dvb
7134 $_def_dvb_in
7135 $_def_svga
7136 $_def_vesa
7137 $_def_xdpms
7138 $_def_aa
7139 $_def_caca
7140 $_def_tga
7141 $_def_toolame
7143 /* used by GUI: */
7144 $_def_xshape
7146 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
7147 #define X11_FULLSCREEN 1
7148 #endif
7150 #endif /* MPLAYER_CONFIG_H */
7153 #############################################################################
7155 echo "Creating libvo/config.mak"
7156 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g'`
7157 cat > libvo/config.mak << EOF
7158 include ../config.mak
7159 OPTIONAL_SRCS = $_vosrc
7160 OPTIONAL_OBJS = $_voobj
7163 #############################################################################
7165 echo "Creating libao2/config.mak"
7166 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'`
7167 cat > libao2/config.mak << EOF
7168 include ../config.mak
7169 OPTIONAL_SRCS = $_aosrc
7170 OPTIONAL_OBJS = $_aoobj
7173 #############################################################################
7175 cat << EOF
7177 Config files successfully generated by ./configure !
7179 Install prefix: $_prefix
7180 Data directory: $_datadir
7181 Config direct.: $_confdir
7183 Byte order: $_byte_order
7184 Optimizing for: $_optimizing
7186 Languages:
7187 Messages/GUI: $_language
7190 echo -n " Manual pages: $MAN_LANG"
7191 test "$LANGUAGES" = en && echo -n " (no localization selected, use --language=all)"
7192 echo
7194 cat << EOF
7196 Enabled optional drivers:
7197 Input: $_inputmodules
7198 Codecs: $_codecmodules
7199 Audio output: $_aomodules
7200 Video output: $_vomodules
7201 Disabled optional drivers:
7202 Input: $_noinputmodules
7203 Codecs: $_nocodecmodules
7204 Audio output: $_noaomodules
7205 Video output: $_novomodules
7207 'config.h' and 'config.mak' contain your configuration options.
7208 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7209 compile *** DO NOT REPORT BUGS if you tweak these files ***
7211 'make' will now compile MPlayer and 'make install' will install it.
7212 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7217 if test "$_mtrr" = yes ; then
7218 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/devices.html#mtrr)"
7219 echo
7222 if test "$_sdl" = "outdated" ; then
7223 cat <<EOF
7224 You have an outdated version of libSDL installed (older than v1.1.7) and SDL
7225 support has therefore been disabled.
7227 Please upgrade to a more recent version (version 1.1.8 and above are known to
7228 work). You may get this library from: http://www.libsdl.org
7230 You need to rerun ./configure and recompile after updating SDL. If you are
7231 only interested in the libSDL audio drivers, then an older version might work.
7233 Use --enable-sdl to force usage of libSDL.
7238 if x86; then
7239 if test "$_win32" = no ; then
7240 if test "$_win32libdir" ; then
7241 echo "Failed to find a Win32 codecs dir at $_win32libdir!"
7242 else
7243 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
7245 cat << EOF
7246 Create it and copy the DLL files there! You can download the codecs from our
7247 homepage at http://www.mplayerhq.hu/MPlayer/releases/codecs/
7251 else
7252 cat <<EOF
7253 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7254 operating system ($system_name). You may encounter a few files that cannot
7255 be played due to missing open source video/audio codec support.
7261 cat <<EOF
7263 Check $TMPLOG if you wonder why an autodetection failed (check whether
7264 the development headers/packages are installed).
7266 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
7270 if test "$_vidix" = no ; then
7271 cat <<EOF
7272 You've disabled VIDIX. Although it would be better to PORT it instead.
7273 Have a look at the documentation for supported cards!
7278 # Last move:
7279 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"