mach64_mmio size fix from vidix.sf.net, possible bugfix for #59
[mplayer/greg.git] / configure
blob0f2ac29a3c1a7368a5f4b8105a8d867ff65fe7c2
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
23 # libaf/config.mak
25 #############################################################################
27 # Prevent locale nonsense from breaking basic text processing utils
28 LC_ALL=C
29 export LC_ALL
31 # Prefer these macros to full length text !
32 # These macros only return an error code - NO display is done
33 compile_check() {
34 echo >> "$TMPLOG"
35 cat "$1" >> "$TMPLOG"
36 echo >> "$TMPLOG"
37 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o $TMPO $@" >> "$TMPLOG"
38 rm -f "$TMPO"
39 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra -o "$TMPO" "$@" >> "$TMPLOG" 2>&1
40 TMP="$?"
41 echo >> "$TMPLOG"
42 echo "ldd $TMPO" >> "$TMPLOG"
43 $_ldd "$TMPO" >> "$TMPLOG" 2>&1
44 echo >> "$TMPLOG"
45 return "$TMP"
48 cc_check() {
49 compile_check $TMPC $@
52 cxx_check() {
53 compile_check $TMPCPP $@ -lstdc++
56 tmp_run() {
57 "$TMPO" >> "$TMPLOG" 2>&1
60 # Display error message, flushes tempfile, exit
61 die () {
62 echo
63 echo "Error: $@" >&2
64 echo >&2
65 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
66 echo "Check \"$TMPLOG\" if you do not understand why it failed."
67 exit 1
70 # OS test booleans functions
71 issystem() {
72 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
74 linux() { issystem "Linux" ; return "$?" ; }
75 sunos() { issystem "SunOS" ; return "$?" ; }
76 hpux() { issystem "HP-UX" ; return "$?" ; }
77 irix() { issystem "IRIX" ; return "$?" ; }
78 cygwin() { issystem "CYGWIN" ; return "$?" ; }
79 freebsd() { issystem "FreeBSD" ; return "$?" ; }
80 netbsd() { issystem "NetBSD" ; return "$?" ; }
81 bsdos() { issystem "BSD/OS" ; return "$?" ; }
82 openbsd() { issystem "OpenBSD" ; return "$?" ; }
83 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
84 qnx() { issystem "QNX" ; return "$?" ; }
85 darwin() { issystem "Darwin" ; return "$?" ; }
86 gnu() { issystem "GNU" ; return "$?" ; }
87 mingw32() { issystem "MINGW32" ; return "$?" ; }
88 morphos() { issystem "MorphOS" ; return "$?" ; }
89 win32() { cygwin || mingw32 ; return "$?" ; }
90 beos() { issystem "BEOS" ; return "$?" ; }
92 # arch test boolean functions
93 # x86/x86pc is used by QNX
94 x86() {
95 case "$host_arch" in
96 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
97 *) return 1 ;;
98 esac
101 x86_64() {
102 case "$host_arch" in
103 x86_64|amd64) return 0 ;;
104 *) return 1 ;;
105 esac
108 ppc() {
109 case "$host_arch" in
110 ppc) return 0;;
111 *) return 1;;
112 esac
115 alpha() {
116 case "$host_arch" in
117 alpha) return 0;;
118 *) return 1;;
119 esac
122 # not boolean test: implement the posix shell "!" operator for a
123 # non-posix /bin/sh.
124 # usage: not {command}
125 # returns exit status "success" when the execution of "command"
126 # fails.
127 not() {
128 eval "$@"
129 test $? -ne 0
132 # Use this before starting a check
133 echocheck() {
134 echo "============ Checking for $@ ============" >> "$TMPLOG"
135 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
138 # Use this to echo the results of a check
139 echores() {
140 if test "$_res_comment" ; then
141 _res_comment="($_res_comment)"
143 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
144 echo "##########################################" >> "$TMPLOG"
145 echo "" >> "$TMPLOG"
146 echo "$@ $_res_comment"
147 _res_comment=""
149 #############################################################################
151 # Check how echo works in this /bin/sh
152 case `echo -n` in
153 -n) _echo_n= _echo_c='\c' ;; # SysV echo
154 *) _echo_n='-n ' _echo_c= ;; # BSD echo
155 esac
157 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"`
159 for parm in "$@" ; do
160 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
161 cat << EOF
163 Usage: $0 [OPTIONS]...
165 Configuration:
166 -h, --help display this help and exit
168 Installation directories:
169 --prefix=DIR use this prefix for installing mplayer [/usr/local]
170 --bindir=DIR use this prefix for installing mplayer binary
171 [PREFIX/bin]
172 --datadir=DIR use this prefix for installing machine independent
173 data files (fonts, skins) [PREFIX/share/mplayer]
174 --mandir=DIR use this prefix for installing manpages [PREFIX/man]
175 --confdir=DIR use this prefix for installing configuration files
176 [PREFIX/etc/mplayer]
177 --libdir=DIR use this prefix for object code libraries [PREFIX/lib]
179 Optional features:
180 --disable-mencoder disable mencoder (a/v encoder) compilation [enable]
181 --enable-gui enable gmplayer compilation (GTK+ GUI) [disable]
182 --enable-old-gtk force using GTK 1.2 for GUI [disable]
183 --enable-largefiles enable support for files > 2 GBytes [disable]
184 --enable-linux-devfs set default devices to devfs ones [disable]
185 --enable-termcap use termcap database for key codes [autodetect]
186 --enable-termios use termios database for key codes [autodetect]
187 --disable-iconv do not use iconv(3) function [autodetect]
188 --disable-setlocale disable setlocale using in mplayer [autodetect]
189 --disable-langinfo do not use langinfo [autodetect]
190 --enable-lirc enable LIRC (remote control) support [autodetect]
191 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
192 --enable-joystick enable joystick support [disable]
193 --disable-vm disable support X video mode extensions [autodetect]
194 --disable-xf86keysym disable support for 'multimedia' keys [autodetect]
195 --disable-tv disable TV Interface (tv/dvb grabbers) [enable]
196 --disable-tv-v4l disable Video4Linux TV Interface support [autodetect]
197 --disable-tv-v4l2 disable Video4Linux2 TV Interface support [autodetect]
198 --disable-tv-bsdbt848 disable BSD BT848 Interface support [autodetect]
199 --disable-edl disable EDL (edit decision list) support [enable]
200 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
201 --disable-network disable network support (for: http/mms/rtp) [enable]
202 --enable-winsock2 enable winsock2 usage [autodetect]
203 --enable-smb enable Samba (SMB) input support [autodetect]
204 --enable-live enable LIVE555 Streaming Media support [autodetect]
205 --disable-dvdread Disable libdvdread support [autodetect]
206 --disable-mpdvdkit Disable mpdvdkit/mpdvdkit2 support [autodetect]
207 --disable-cdparanoia Disable cdparanoia support [autodetect]
208 --disable-freetype Disable freetype2 font rendering support [autodetect]
209 --disable-fontconfig Disable fontconfig font lookup support [autodetect]
210 --disable-unrarlib Disable Unique RAR File Library [enabled]
211 --enable-menu Enable OSD menu support (NOT DVD MENU) [disabled]
212 --disable-sortsub Disable subtitles sorting [enabled]
213 --enable-fribidi Enable using the FriBiDi libs [disabled]
214 --disable-enca Disable using ENCA charset oracle library [autodetect]
215 --disable-macosx Disable Mac OS X specific features [autodetect]
216 --enable-macosx-finder-support Enable Mac OS X Finder invocation parameter parsing [disabled]
217 --enable-macosx-bundle Enable Mac OS X bundle file locations [autodetect]
218 --disable-inet6 Disable IPv6 support [autodetect]
219 --disable-gethostbyname2 gethostbyname() function is not provided by the C
220 library [autodetect]
221 --disable-ftp Disable ftp support [enabled]
222 --disable-vstream Disable tivo vstream client support [autodetect]
223 --disable-pthreads Disable Posix threads support [autodetect]
225 Codecs:
226 --enable-gif enable gif support [autodetect]
227 --enable-png enable png input/output support [autodetect]
228 --enable-jpeg enable jpeg input/output support [autodetect]
229 --enable-liblzo enable external liblzo support [autodetect]
230 --disable-win32 disable Win32 DLL support [autodetect]
231 --disable-dshow disable Win32/DirectShow support [autodetect]
232 --disable-qtx disable Quicktime codecs [autodetect]
233 --disable-xanim disable XAnim DLL support [autodetect]
234 --disable-real disable RealPlayer DLL support [autodetect]
235 --disable-xvid disable XviD codec [autodetect]
236 --disable-x264 disable H.264 encoder [autodetect]
237 --disable-divx4linux disable DivX4linux/Divx5linux codec [autodetect]
238 --enable-opendivx enable _old_ OpenDivx codec [disable]
239 --disable-libavcodec disable libavcodec [autodetect]
240 --disable-libavformat disable libavformat [autodetect]
241 --enable-libfame enable libfame realtime encoder [autodetect]
242 --disable-internal-tremor do not build internal OggVorbis support [enabled]
243 --enable-tremor-low build with lower accuracy internal tremor [disabled]
244 --enable-external-tremor build with external tremor [disabled]
245 --disable-vorbis disable OggVorbis support entirely [autodetect]
246 --enable-theora build with OggTheora support [autodetect]
247 --disable-internal-matroska disable internal Matroska support [enabled]
248 --enable-external-faad build with external FAAD2 (AAC) support [autodetect]
249 --disable-internal-faad disable internal FAAD2 (AAC) support [autodetect]
250 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
251 --disable-ladspa disable LADSPA plugin support [autodetect]
252 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
253 --disable-mad disable libmad (MPEG audio) support [autodetect]
254 --disable-toolame disable Toolame (MPEG layer 2 audio) support in mencoder [autodetect]
255 --disable-twolame disable Twolame (MPEG layer 2 audio) support in mencoder [autodetect]
256 --enable-xmms build with XMMS inputplugin support [disabled]
257 --disable-mp3lib disable builtin mp3lib [enabled]
258 --disable-liba52 disable builtin liba52 [enabled]
259 --enable-libdts enable libdts support [autodetect]
260 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
261 --disable-musepack disable musepack support [autodetect]
262 --disable-amr_nb disable amr narrowband, floating point [autodetect]
263 --disable-amr_nb-fixed disable amr narrowband, fixed point [autodetect]
264 --disable-amr_wb disable amr wideband, floating point [autodetect]
265 --disable-codec=CODEC disable specified codec
266 --enable-codec=CODEC dnable specified codec
268 Video output:
269 --disable-vidix disable VIDIX [enable on x86 *nix]
270 --enable-gl build with OpenGL render support [autodetect]
271 --enable-dga[=n] build with DGA [n in {1, 2} ] support [autodetect]
272 --enable-vesa build with VESA support [autodetect]
273 --enable-svga build with SVGAlib support [autodetect]
274 --enable-sdl build with SDL render support [autodetect]
275 --enable-aa build with AAlib render support [autodetect]
276 --enable-caca build with CACA render support [autodetect]
277 --enable-ggi build with GGI render support [autodetect]
278 --enable-ggiwmh build with GGI libggiwmh extension [autodetect]
279 --enable-directx build with DirectX support [autodetect]
280 --enable-dxr2 build with DXR2 render support [autodetect]
281 --enable-dxr3 build with DXR3/H+ render support [autodetect]
282 --enable-dvb build with support for output via DVB-Card [autodetect]
283 --enable-dvbhead build with DVB support (HEAD version) [autodetect]
284 --enable-mga build with mga_vid (for Matrox G200/G4x0/G550) support
285 (check for /dev/mga_vid) [autodetect]
286 --enable-xmga build with mga_vid X Window support
287 (check for X & /dev/mga_vid) [autodetect]
288 --enable-xv build with Xv render support for X 4.x [autodetect]
289 --enable-xvmc build with XvMC acceleration for X 4.x [disable]
290 --enable-vm build with XF86VidMode support for X11 [autodetect]
291 --enable-xinerama build with Xinerama support for X11 [autodetect]
292 --enable-x11 build with X11 render support [autodetect]
293 --enable-fbdev build with FBDev render support [autodetect]
294 --enable-mlib build with MLIB support (Solaris only) [autodetect]
295 --enable-3dfx build with obsolete /dev/3dfx support [disable]
296 --enable-tdfxfb build with tdfxfb (Voodoo 3/banshee) support [disable]
297 --enable-directfb build with DirectFB support [autodetect]
298 --enable-zr build with ZR360[56]7/ZR36060 support [autodetect]
299 --enable-bl build with Blinkenlights support [disable]
300 --enable-tdfxvid build with tdfx_vid support [disable]
301 --disable-tga disable targa output support [enable]
302 --disable-pnm disable pnm output support [enable]
303 --disable-md5sum disable md5sum output support [enable]
305 Audio output:
306 --disable-alsa disable ALSA sound support [autodetect]
307 --disable-ossaudio disable OSS sound support [autodetect]
308 --disable-arts disable aRts sound support [autodetect]
309 --disable-esd disable esd sound support [autodetect]
310 --disable-polyp disable Polypaudio sound support [autodetect]
311 --disable-jack disable JACK sound support [autodetect]
312 --disable-nas disable NAS sound support [autodetect]
313 --disable-sgiaudio disable SGI sound support [autodetect]
314 --disable-sunaudio disable Sun sound support [autodetect]
315 --disable-win32waveout disable Windows waveout sound support [autodetect]
316 --disable-select disable using select() on audio device [enable]
318 Miscellaneous options:
319 --enable-runtime-cpudetection Enable runtime CPU detection [disable]
320 --enable-cross-compile Enable cross-compilation [autodetect]
321 --cc=COMPILER use this C compiler to build MPlayer [gcc]
322 --host-cc=COMPILER use this C compiler to build apps needed for the build process [gcc]
323 --as=ASSEMBLER use this assembler to build MPlayer [as]
324 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
325 --enable-static build a statically linked binary. Set further linking
326 options with --enable-static="-lslang -lncurses"
327 --charset convert the help messages to this charset
328 --language=list a white space or comma separated list of languages
329 for translated man pages, the first language is the
330 primary and therefore used for translated messages
331 and GUI (also the environment variable \$LINGUAS is
332 honored) [en]
333 (Available: $LANGUAGES all)
334 --with-install=PATH use a custom install program (useful if your OS uses
335 a GNU-incompatible install utility by default and
336 you want to use GNU version)
337 --install-path=PATH the path to a custom install program
338 this option is obsolete and will be removed soon,
339 use --with-install instead.
341 Advanced options:
342 --enable-mmx build with MMX support [autodetect]
343 --enable-mmx2 build with MMX2 support (PIII, Athlon) [autodetect]
344 --enable-3dnow build with 3DNow! support [autodetect]
345 --enable-3dnowex build with extended 3DNow! support [autodetect]
346 --enable-sse build with SSE support [autodetect]
347 --enable-sse2 build with SSE2 support [autodetect]
348 --enable-shm build with shm support [autodetect]
349 --enable-altivec build with Altivec support (PowerPC) [autodetect]
350 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy() [enable]
351 --enable-big-endian Force byte order to big-endian [autodetect]
352 --enable-debug[=1-3] compile debugging information into mplayer [disable]
353 --enable-profile compile profiling information into mplayer [disable]
354 --disable-sighandler disable sighandler for crashes [enable]
355 --enable-crash-debug enable automatic gdb attach on crash [disable]
356 --enable-i18n _experimental_ gnu gettext() support [autodetect]
357 --enable-dynamic-plugins Enable support for dynamic a/v plugins [disable]
359 Hazardous options a.k.a. "DO NOT REPORT ANY BUGS!"
360 --disable-gcc-checking disable gcc version checking [enable]
362 Use these options if autodetection fails (Options marked with (*) accept
363 multiple paths separated by ':'):
364 --with-extraincdir=DIR extra headers (png, mad, sdl, ...) in DIR (*)
365 --with-extralibdir=DIR extra library files (png, mad, sdl, ...) in DIR (*)
366 --with-x11incdir=DIR X headers in DIR (*)
367 --with-x11libdir=DIR X library files in DIR (*)
368 --with-dxr2incdir=DIR DXR2 headers in DIR (*)
369 --with-dvbincdir=DIR DVB headers in DIR (*)
370 --with-madlibdir=DIR libmad (libmad shared library) in DIR (*)
371 --with-mlibdir=DIR libmlib (MLIB support) in DIR (Solaris only)
372 --with-codecsdir=DIR Binary codec files in DIR
373 --with-win32libdir=DIR W*ndows DLL files in DIR
374 --with-xanimlibdir=DIR XAnim DLL files in DIR
375 --with-reallibdir=DIR RealPlayer DLL files in DIR
376 --with-xvidlibdir=DIR libxvidcore (XviD) in DIR (*)
377 --with-xvidincdir=DIR XviD header in DIR (*)
378 --with-x264libdir=DIR libx264 in DIR
379 --with-x264incdir=DIR x264 header in DIR
380 --with-dtslibdir=DIR libdts library in DIR (*)
381 --with-dtsincdir=DIR libdts header in DIR (*)
382 --with-livelibdir=DIR LIVE555 Streaming Media libraries in DIR
383 --with-toolamedir=DIR path to Toolame library and include file
384 --with-xmmsplugindir=DIR XMMS plugins in DIR
385 --with-xmmslibdir=DIR libxmms.so.1 in DIR
386 --with-cdparanoiaincdir=DIR cdparanoia headers in DIR (*)
387 --with-cdparanoialibdir=DIR cdparanoia libraries (libcdda_*) in DIR (*)
388 --with-xvmclib=NAME name of adapter-specific library (e.g. XvMCNVIDIA)
389 --with-termcaplib=NAME name of library with termcap functionality
390 name should be given without leading "lib"
391 checks for "termcap" and "tinfo"
393 --with-freetype-config=PATH path to freetype-config
394 (e.g. /opt/bin/freetype-config)
395 --with-fribidi-config=PATH path to fribidi-config
396 (e.g. /opt/bin/fribidi-config)
397 --with-glib-config=PATH path to glib*-config (e.g. /opt/bin/glib-config)
398 --with-gtk-config=PATH path to gtk*-config (e.g. /opt/bin/gtk-config)
399 --with-sdl-config=PATH path to sdl*-config (e.g. /opt/bin/sdl-config)
401 This configure script is NOT autoconf-based, even though its output is similar.
402 It will try to autodetect all configuration options. If you --enable an option
403 it will be forcefully turned on, skipping autodetection. This can break
404 compilation, so you need to know what you are doing.
406 exit 0
408 done # for parm in ...
411 # 1st pass checking for vital options
412 _install=install
413 _ranlib=ranlib
414 _cc=cc
415 test "$CC" && _cc="$CC"
416 _as=auto
417 _runtime_cpudetection=no
418 _cross_compile=auto
419 for ac_option do
420 case "$ac_option" in
421 --target=*)
422 _target=`echo $ac_option | cut -d '=' -f 2`
424 --cc=*)
425 _cc=`echo $ac_option | cut -d '=' -f 2`
427 --host-cc=*)
428 _host_cc=`echo $ac_option | cut -d '=' -f 2`
430 --as=*)
431 _as=`echo $ac_option | cut -d '=' -f 2`
433 --enable-gcc-checking)
434 _skip_cc_check=no
436 --disable-gcc-checking)
437 _skip_cc_check=yes
439 --enable-static)
440 _ld_static='-static'
442 --disable-static)
443 _ld_static=''
445 --enable-static=*)
446 _ld_static="-static `echo $ac_option | cut -d '=' -f 2`"
448 --with-extraincdir=*)
449 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
451 --with-extralibdir=*)
452 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
454 --enable-runtime-cpudetection)
455 _runtime_cpudetection=yes
457 --disable-runtime-cpudetection)
458 _runtime_cpudetection=no
460 --enable-cross-compile)
461 _cross_compile=yes
463 --disable-cross-compile)
464 _cross_compile=no
466 --install-path=*)
467 _install=`echo $ac_option | cut -d '=' -f 2 | sed 's/\/$//'`"/install"
469 --with-install=*)
470 _install=`echo $ac_option | cut -d '=' -f 2 `
472 esac
473 done
475 # Determine our OS name and CPU architecture
476 if test -z "$_target" ; then
477 # OS name
478 system_name=`uname -s 2>&1`
479 case "$system_name" in
480 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
482 IRIX*)
483 system_name=IRIX
485 HP-UX*)
486 system_name=HP-UX
488 [cC][yY][gG][wW][iI][nN]*)
489 system_name=CYGWIN
491 MINGW32*)
492 system_name=MINGW32
494 MorphOS)
495 system_name=MorphOS
498 system_name="$system_name-UNKNOWN"
500 esac
503 # host's CPU/instruction set
504 host_arch=`uname -p 2>&1`
505 case "$host_arch" in
506 i386|sparc|ppc|alpha|arm|mips|vax)
508 powerpc) # Darwin returns 'powerpc'
509 host_arch=ppc
511 *) # uname -p on Linux returns 'unknown' for the processor type,
512 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
514 # Maybe uname -m (machine hardware name) returns something we
515 # recognize.
517 # x86/x86pc is used by QNX
518 case "`uname -m 2>&1`" in
519 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 ;;
520 ia64) host_arch=ia64 ;;
521 x86_64|amd64)
522 if [ "`$_cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
523 -z "`echo $CFLAGS | grep -- -m32`" ]; then
524 host_arch=x86_64
525 else
526 host_arch=i386
529 macppc|ppc|ppc64) host_arch=ppc ;;
530 alpha) host_arch=alpha ;;
531 sparc) host_arch=sparc ;;
532 sparc64) host_arch=sparc64 ;;
533 parisc*|hppa*|9000*) host_arch=hppa ;;
534 arm*) host_arch=arm ;;
535 s390) host_arch=s390 ;;
536 s390x) host_arch=s390x ;;
537 mips*) host_arch=mips ;;
538 vax) host_arch=vax ;;
539 *) host_arch=UNKNOWN ;;
540 esac
542 esac
543 else
544 system_name=`echo $_target | cut -d '-' -f 2`
545 case "`echo $system_name | tr A-Z a-z`" in
546 linux) system_name=Linux ;;
547 freebsd) system_name=FreeBSD ;;
548 netbsd) system_name=NetBSD ;;
549 bsd/os) system_name=BSD/OS ;;
550 openbsd) system_name=OpenBSD ;;
551 sunos) system_name=SunOS ;;
552 qnx) system_name=QNX ;;
553 morphos) system_name=MorphOS ;;
554 mingw32msvc) system_name=MINGW32 ;;
555 esac
556 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
557 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
560 echo "Detected operating system: $system_name"
561 echo "Detected host architecture: $host_arch"
563 # LGB: temporary files
564 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
565 test "$I" && break
566 done
568 TMPLOG="configure.log"
569 rm -f "$TMPLOG"
570 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
571 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
572 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
573 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
575 # config files
577 # FIXME: A lot of stuff is installed under /usr/local
578 # NK: But we should never use this stuff implicitly since we call compiler
579 # from /usr we should be sure that there no effects from other compilers
580 # (libraries) which might be installed into /usr/local. Let users use this
581 # stuff explicitly as command line argument. In other words: It would be
582 # resonable to have only /usr/include or only /usr/local/include.
584 if freebsd ; then
585 _ld_extra="$_ld_extra -L/usr/local/lib"
586 _inc_extra="$_inc_extra -I/usr/local/include"
589 if netbsd ; then
590 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
591 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
592 done
593 _ld_extra=$tmp
596 _ldd=ldd
597 if darwin; then
598 _ldd="otool -L"
601 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
602 # if used as 'head -1' instead of 'head -n 1', but older versions don't
603 # know about '-n'.
604 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
605 _head() { head -$1 2>/dev/null ; }
606 else
607 _head() { head -n $1 2>/dev/null ; }
609 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
610 _tail() { tail -$1 2>/dev/null ; }
611 else
612 _tail() { tail -n $1 2>/dev/null ; }
615 # Checking CC version...
616 if test "$_skip_cc_check" != yes ; then
617 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
618 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
619 echocheck "$_cc version"
620 cc_vendor=intel
621 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
622 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
623 _cc_major=`echo $cc_version | cut -d '.' -f 1`
624 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
625 # TODO verify older icc/ecc compatibility
626 case $cc_version in
628 cc_version="v. ?.??, bad"
629 cc_verc_fail=yes
631 8.0)
632 cc_version="$cc_version, ok"
633 cc_verc_fail=no
636 cc_version="$cc_version, bad"
637 cc_verc_fail=yes
639 esac
640 echores "$cc_version"
641 else
642 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
643 echocheck "$_cc version"
644 cc_vendor=gnu
645 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
646 cc_version=`$_cc -dumpversion 2>&1`
647 if test "$?" -gt 0; then
648 cc_version="not found"
650 case $cc_version in
652 cc_version="v. ?.??, bad"
653 cc_verc_fail=yes
655 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
656 _cc_major=`echo $cc_version | cut -d '.' -f 1`
657 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
658 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
659 cc_version="$cc_version, ok"
660 cc_verc_fail=no
662 'not found')
663 cc_verc_fail=yes
666 cc_version="$cc_version, bad"
667 cc_verc_fail=yes
669 esac
670 echores "$cc_version"
671 test "$cc_verc_fail" = "no" && break
672 done
673 fi # icc
674 if test "$cc_verc_fail" = yes ; then
675 cat <<EOF
677 *** Please downgrade/upgrade C compiler to version gcc-2.95.x or gcc-3.x! ***
679 You are not using a supported compiler. We do not have the time to make sure
680 everything works with compilers other than the ones we use. Use either the
681 same compiler as we do, or use --disable-gcc-checking but DO *NOT* REPORT BUGS
682 unless you can reproduce them after recompiling with a 2.95.x or 3.x version!
684 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
685 mplayer and lame (which is used for mencoder). If you get compile errors,
686 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
687 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
688 bugs!
690 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
692 *** For details please read DOCS/HTML/en/users-vs-dev.html ***
695 die "Bad gcc version"
697 else
698 cat <<EOF
700 ******************************************************************************
702 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
703 Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???
705 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
706 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
707 Lame which is used by mencoder produces weird errors, too.
709 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
710 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
712 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
714 ******************************************************************************
718 read _answer
721 echocheck "host cc"
722 test "$_host_cc" || _host_cc=$_cc
723 echores $_host_cc
725 echocheck "cross compilation"
726 if test $_cross_compile = auto ; then
727 cat > $TMPC << EOF
728 int main() { return 0; }
730 _cross_compile=yes
731 cc_check && "$TMPO" && _cross_compile=no
733 echores $_cross_compile
735 if test $_cross_compile = yes; then
736 tmp_run() {
737 return 0
741 # ---
743 # now that we know what compiler should be used for compilation, try to find
744 # out which assembler is used by the $_cc compiler
745 if test "$_as" = auto ; then
746 _as=`$_cc -print-prog-name=as`
747 test -z "$_as" && _as=as
750 # XXX: this should be ok..
751 _cpuinfo="echo"
752 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
753 # FIXME: Remove the cygwin check once AMD CPUs are supported
754 if test -r /proc/cpuinfo && not cygwin; then
755 # Linux with /proc mounted, extract CPU information from it
756 _cpuinfo="cat /proc/cpuinfo"
757 elif test -r /compat/linux/proc/cpuinfo && not x86 ; then
758 # FreeBSD with Linux emulation /proc mounted,
759 # extract CPU information from it
760 _cpuinfo="cat /compat/linux/proc/cpuinfo"
761 elif darwin ; then
762 # use hostinfo on Darwin
763 _cpuinfo="hostinfo"
764 elif x86; then
765 # all other OSes try to extract CPU information from a small helper
766 # program TOOLS/cpuinfo instead
767 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
768 _cpuinfo="TOOLS/cpuinfo"
771 x86_exts_check()
773 pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | _head 1`
774 if test -z "$pparam" ; then
775 pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | _head 1`
778 _mmx=no
779 _3dnow=no
780 _3dnowex=no
781 _mmx2=no
782 _sse=no
783 _sse2=no
784 _mtrr=no
786 for i in $pparam ; do
787 case "$i" in
788 3dnow) _3dnow=yes ;;
789 3dnowext) _3dnow=yes _3dnowex=yes ;;
790 mmx) _mmx=yes ;;
791 mmxext) _mmx2=yes ;;
792 mtrr|k6_mtrr|cyrix_arr) _mtrr=yes ;;
793 xmm|sse|kni) _sse=yes _mmx2=yes ;;
794 sse2) _sse2=yes ;;
795 esac
796 done
799 case "$host_arch" in
800 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
801 _def_arch="#define ARCH_X86 1"
802 _target_arch="TARGET_ARCH_X86 = yes"
804 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
805 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
806 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
807 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
808 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
810 x86_exts_check
812 echocheck "CPU vendor"
813 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
815 echocheck "CPU type"
816 echores "$pname"
818 case "$pvendor" in
819 AuthenticAMD)
820 case "$pfamily" in
821 3) proc=i386 iproc=386 ;;
822 4) proc=i486 iproc=486 ;;
823 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
824 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
825 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
826 proc=k6-3
827 elif test "$pmodel" -ge 8; then
828 proc=k6-2
829 elif test "$pmodel" -ge 6; then
830 proc=k6
831 else
832 proc=i586
833 iproc=586
836 6) iproc=686
837 if test "$pmodel" -ge 7; then
838 proc=athlon-4
839 elif test "$pmodel" -ge 6; then
840 # only Athlon XP supports ssem MP, Duron etc not
841 # but most of them are CPUID 666, so check if sse detected
842 # btw. there is also athlon-mp opt, but we need extended
843 # CPUID to detect if CPU is SMP capable -> athlon-mp ::atmos
844 if test "$_sse" = yes && test "$pstepping" -ge 2; then
845 proc=athlon-xp
846 else
847 proc=athlon-4
849 elif test "$pmodel" -ge 4; then
850 proc=athlon-tbird
851 else
852 proc=athlon # TODO: should the Duron Spitfire be considered a Thunderbird instead?
855 15) iproc=686
856 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
857 # caught and remedied in the optimization tests below.
858 proc=k8
861 *) proc=athlon-xp iproc=686 ;;
862 esac
864 GenuineIntel)
865 case "$pfamily" in
866 3) proc=i386 iproc=386 ;;
867 4) proc=i486 iproc=486 ;;
868 5) iproc=586
869 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
870 proc=pentium-mmx # 4 is desktop, 8 is mobile
871 else
872 proc=i586
875 6) iproc=686
876 if test "$pmodel" -ge 7; then
877 proc=pentium3
878 elif test "$pmodel" -ge 3; then
879 proc=pentium2
880 else
881 proc=i686
884 15) proc=pentium4 iproc=686 ;;
885 *) proc=pentium4 iproc=686 ;;
886 esac
888 CentaurHauls)
889 case "$pfamily" in
890 5) iproc=586
891 if test "$pmodel" -ge 8; then
892 proc=winchip2
893 elif test "$pmodel" -ge 4; then
894 proc=winchip-c6
895 else
896 proc=i586
899 6) iproc=686
900 # VIA C3 has SSE, but doesn't have MMX2
901 # workaround for SSE => MMX2 implication above
902 _mmx2=no
903 if test "$pmodel" -ge 9; then
904 proc=c3-2
905 else
906 proc=i686
909 *) proc=i686 iproc=i686 ;;
910 esac
912 unknown)
913 case "$pfamily" in
914 3) proc=i386 iproc=386 ;;
915 4) proc=i486 iproc=486 ;;
916 *) proc=i586 iproc=586 ;;
917 esac
920 proc=i586 iproc=586 ;;
921 esac
923 # check that gcc supports our CPU, if not, fall back to earlier ones
924 # LGB: check -mcpu and -march swithing step by step with enabling
925 # to fall back till 386.
927 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
929 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
930 cpuopt=-mtune
931 else
932 cpuopt=-mcpu
935 echocheck "GCC & CPU optimization abilities"
936 cat > $TMPC << EOF
937 int main(void) { return 0; }
939 if test "$_runtime_cpudetection" = no ; then
940 if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
941 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
943 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" || test "$proc" = "athlon-tbird"; then
944 cc_check -march=$proc $cpuopt=$proc || proc=athlon
946 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
947 cc_check -march=$proc $cpuopt=$proc || proc=k6
949 if test "$proc" = "k6"; then
950 if not cc_check -march=$proc $cpuopt=$proc; then
951 if cc_check -march=i586 $cpuopt=i686; then
952 proc=i586-i686
953 else
954 proc=i586
958 if test "$proc" = "pentium4" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon" || test "$proc" = "c3-2"; then
959 cc_check -march=$proc $cpuopt=$proc || proc=i686
961 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
962 cc_check -march=$proc $cpuopt=$proc || proc=i586
964 if test "$proc" = "i586" || test "$proc" = "c3" ; then
965 cc_check -march=$proc $cpuopt=$proc || proc=i486
967 if test "$proc" = "i486" ; then
968 cc_check -march=$proc $cpuopt=$proc || proc=i386
970 if test "$proc" = "i386" ; then
971 cc_check -march=$proc $cpuopt=$proc || proc=error
973 if test "$proc" = "error" ; then
974 echores "Your $_cc does not even support \"i386\" for '-march' and '$cpuopt'."
975 _mcpu=""
976 _march=""
977 _optimizing=""
978 elif test "$proc" = "i586-i686"; then
979 _march="-march=i586"
980 _mcpu="$cpuopt=i686"
981 _optimizing="$proc"
982 else
983 _march="-march=$proc"
984 _mcpu="$cpuopt=$proc"
985 _optimizing="$proc"
987 else
988 # i686 is probably the most common CPU - optimize for it
989 _mcpu="$cpuopt=i686"
990 # at least i486 required, for bswap instruction
991 _march="-march=i486"
992 cc_check $_mcpu || _mcpu=""
993 cc_check $_march $_mcpu || _march=""
996 ## Gabucino : --target takes effect here (hopefully...) by overwriting
997 ## autodetected mcpu/march parameters
998 if test "$_target" ; then
999 # TODO: it may be a good idea to check GCC and fall back in all cases
1000 if test "$host_arch" = "i586-i686"; then
1001 _march="-march=i586"
1002 _mcpu="$cpuopt=i686"
1003 else
1004 _march="-march=$host_arch"
1005 _mcpu="$cpuopt=$host_arch"
1008 proc="$host_arch"
1010 case "$proc" in
1011 i386) iproc=386 ;;
1012 i486) iproc=486 ;;
1013 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1014 i686|athlon*|pentium*) iproc=686 ;;
1015 *) iproc=586 ;;
1016 esac
1019 echores "$proc"
1022 ia64)
1023 _def_arch='#define ARCH_IA64 1'
1024 _target_arch='TARGET_ARCH_IA64 = yes'
1025 iproc='ia64'
1026 proc=''
1027 _march=''
1028 _mcpu=''
1029 _optimizing=''
1032 x86_64|amd64)
1033 _def_arch='#define ARCH_X86_64 1'
1034 _target_arch='TARGET_ARCH_X86_64 = yes'
1035 iproc='x86_64'
1037 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1038 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1039 cpuopt=-mtune
1040 else
1041 cpuopt=-mcpu
1043 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1044 # caught and remedied in the optimization tests below.
1045 proc=k8
1047 echocheck "GCC & CPU optimization abilities"
1048 cat > $TMPC << EOF
1049 int main(void) { return 0; }
1051 # This is a stripped-down version of the i386 fallback.
1052 if test "$_runtime_cpudetection" = no ; then
1053 if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
1054 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1056 # This will fail if gcc version < 3.3, which is ok because earlier
1057 # versions don't really support 64-bit on amd64.
1058 # Is this a valid assumption? -Corey
1059 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" ; then
1060 cc_check -march=$proc $cpuopt=$proc || proc=error
1062 _march="-march=$proc"
1063 _mcpu="$cpuopt=$proc"
1064 if test "$proc" = "error" ; then
1065 echores "Your $_cc does not even support \"athlon-xp\" for '-march' and '$cpuopt'."
1066 _mcpu=""
1067 _march=""
1069 else
1070 _march=""
1071 _mcpu=""
1074 _optimizing=""
1076 echores "$proc"
1078 x86_exts_check
1081 sparc)
1082 _def_arch='#define ARCH_SPARC 1'
1083 _target_arch='TARGET_ARCH_SPARC = yes'
1084 iproc='sparc'
1085 if sunos ; then
1086 echocheck "CPU type"
1087 karch=`uname -m`
1088 case "`echo $karch`" in
1089 sun4) proc=v7 ;;
1090 sun4c) proc=v7 ;;
1091 sun4d) proc=v8 ;;
1092 sun4m) proc=v8 ;;
1093 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1094 *) ;;
1095 esac
1096 echores "$proc"
1097 else
1098 proc=v8
1100 _march=''
1101 _mcpu="-mcpu=$proc"
1102 _optimizing="$proc"
1105 sparc64)
1106 _def_arch='#define ARCH_SPARC 1'
1107 _target_arch='TARGET_ARCH_SPARC = yes'
1108 _vis='yes'
1109 _def_vis='#define HAVE_VIS = yes'
1110 iproc='sparc'
1111 proc='v9'
1112 _march=''
1113 _mcpu="-mcpu=$proc"
1114 _optimizing="$proc"
1117 arm|armv4l|armv5tel)
1118 _def_arch='#define ARCH_ARMV4L 1'
1119 _target_arch='TARGET_ARCH_ARMV4L = yes'
1120 iproc='arm'
1121 proc=''
1122 _march=''
1123 _mcpu=''
1124 _optimizing=''
1127 ppc)
1128 _def_arch='#define ARCH_POWERPC 1'
1129 _def_dcbzl='#define NO_DCBZL 1'
1130 _target_arch='TARGET_ARCH_POWERPC = yes'
1131 iproc='ppc'
1132 proc=''
1133 _march=''
1134 _mcpu=''
1135 _optimizing=''
1136 _altivec=no
1138 echocheck "CPU type"
1139 if linux && test -n "$_cpuinfo"; then
1140 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1141 if test -n "`$_cpuinfo | grep altivec`"; then
1142 _altivec=yes
1145 if darwin ; then
1146 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1147 if [ `sysctl -n hw.vectorunit` -eq 1 ]; then
1148 _altivec=yes
1149 elif [ "`sysctl -n hw.optional.altivec 2>/dev/null`" = 1 ]; then
1150 _altivec=yes
1153 # only gcc 3.4 works reliably with altivec code under netbsd
1154 if netbsd ; then
1155 case $cc_version in
1156 2*|3.0*|3.1*|3.2*|3.3*)
1159 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1160 _altivec=yes
1163 esac
1165 if test "$_altivec" = yes; then
1166 echores "$proc altivec"
1167 else
1168 echores "$proc"
1171 echocheck "GCC & CPU optimization abilities"
1173 if test -n "$proc"; then
1174 case "$proc" in
1175 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1176 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1177 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1178 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1179 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1180 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1181 *) ;;
1182 esac
1183 # gcc 3.1(.1) and up supports 7400 and 7450
1184 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1185 case "$proc" in
1186 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1187 7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1188 *) ;;
1189 esac
1191 # gcc 3.2 and up supports 970
1192 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1193 case "$proc" in
1194 970*) _march='-mcpu=970' _mcpu='-mtune=970'
1195 _def_dcbzl='#undef NO_DCBZL' ;;
1196 *) ;;
1197 esac
1201 if test -n "$_mcpu"; then
1202 _optimizing=`echo $_mcpu | cut -c 8-`
1203 echores "$_optimizing"
1204 else
1205 echores "none"
1210 alpha)
1211 _def_arch='#define ARCH_ALPHA 1'
1212 _target_arch='TARGET_ARCH_ALPHA = yes'
1213 iproc='alpha'
1214 _march=''
1216 echocheck "CPU type"
1217 cat > $TMPC << EOF
1218 int main() {
1219 unsigned long ver, mask;
1220 asm ("implver %0" : "=r" (ver));
1221 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1222 printf("%ld-%x\n", ver, ~mask);
1223 return 0;
1226 $_cc -o "$TMPO" "$TMPC"
1227 case `"$TMPO"` in
1229 0-0) proc="ev4"; cpu_understands_mvi="0";;
1230 1-0) proc="ev5"; cpu_understands_mvi="0";;
1231 1-1) proc="ev56"; cpu_understands_mvi="0";;
1232 1-101) proc="pca56"; cpu_understands_mvi="1";;
1233 2-303) proc="ev6"; cpu_understands_mvi="1";;
1234 2-307) proc="ev67"; cpu_understands_mvi="1";;
1235 2-1307) proc="ev68"; cpu_understands_mvi="1";;
1236 esac
1237 echores "$proc"
1239 echocheck "GCC & CPU optimization abilities"
1240 if test "$proc" = "ev68" ; then
1241 cc_check -mcpu=$proc || proc=ev67
1243 if test "$proc" = "ev67" ; then
1244 cc_check -mcpu=$proc || proc=ev6
1246 _mcpu="-mcpu=$proc"
1247 echores "$proc"
1249 _optimizing="$proc"
1251 echocheck "MVI instruction support in GCC"
1252 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
1253 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
1254 echores "yes"
1255 else
1256 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
1257 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
1261 mips)
1262 _def_arch='#define ARCH_SGI_MIPS 1'
1263 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
1264 iproc='sgi-mips'
1265 proc=''
1266 _march=''
1267 _mcpu=''
1268 _optimizing=''
1270 if irix ; then
1271 echocheck "CPU type"
1272 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
1273 case "`echo $proc`" in
1274 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
1275 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
1276 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
1277 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
1278 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
1279 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
1280 esac
1281 echores "$proc"
1286 hppa)
1287 _def_arch='#define ARCH_PA_RISC 1'
1288 _target_arch='TARGET_ARCH_PA_RISC = yes'
1289 iproc='PA-RISC'
1290 proc=''
1291 _march=''
1292 _mcpu=''
1293 _optimizing=''
1296 s390)
1297 _def_arch='#define ARCH_S390 1'
1298 _target_arch='TARGET_ARCH_S390 = yes'
1299 iproc='390'
1300 proc=''
1301 _march=''
1302 _mcpu=''
1303 _optimizing=''
1306 s390x)
1307 _def_arch='#define ARCH_S390X 1'
1308 _target_arch='TARGET_ARCH_S390X = yes'
1309 iproc='390x'
1310 proc=''
1311 _march=''
1312 _mcpu=''
1313 _optimizing=''
1316 vax)
1317 _def_arch='#define ARCH_VAX 1'
1318 _target_arch='TARGET_ARCH_VAX = yes'
1319 iproc='vax'
1320 proc=''
1321 _march=''
1322 _mcpu=''
1323 _optimizing=''
1327 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1328 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1329 die "unsupported architecture $host_arch"
1331 esac
1333 if test "$_runtime_cpudetection" = yes ; then
1334 if x86; then
1335 _mmx=yes
1336 _3dnow=yes
1337 _3dnowex=yes
1338 _mmx2=yes
1339 _sse=yes
1340 _sse2=yes
1341 _mtrr=yes
1343 if ppc; then
1344 _altivec=yes
1348 if x86 && test "$_runtime_cpudetection" = no ; then
1349 extcheck() {
1350 if test "$1" = yes ; then
1351 echocheck "kernel support of $2"
1352 cat > $TMPC <<EOF
1353 #include <signal.h>
1354 void catch() { exit(1); }
1355 int main(void){
1356 signal(SIGILL, catch);
1357 __asm__ __volatile__ ("$3":::"memory");return(0);
1361 if cc_check && tmp_run ; then
1362 echores "yes"
1363 _optimizing="$_optimizing $2"
1364 return 0
1365 else
1366 echores "failed"
1367 echo "It seems that your kernel does not correctly support $2."
1368 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1369 return 1
1372 return 0
1375 extcheck $_mmx "mmx" "emms" || _mmx=no
1376 extcheck $_mmx2 "mmx2" "sfence" || _mmx2=no
1377 extcheck $_3dnow "3dnow" "femms" || _3dnow=no
1378 extcheck $_3dnowex "3dnowex" "pswapd %%mm0, %%mm0" || _3dnowex=no
1379 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no _gcc3_ext="$_gcc3_ext -mno-sse"
1380 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no _gcc3_ext="$_gcc3_ext -mno-sse2"
1381 echocheck "mtrr support"
1382 echores "$_mtrr"
1384 if test "$_mtrr" = yes ; then
1385 _optimizing="$_optimizing mtrr"
1388 if test "$_gcc3_ext" != ""; then
1389 # if we had to disable sse/sse2 because the active kernel does not
1390 # support this instruction set extension, we also have to tell
1391 # gcc3 to not generate sse/sse2 instructions for normal C code
1392 cat > $TMPC << EOF
1393 int main(void) { return 0; }
1395 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1400 echocheck "assembler support of -pipe option"
1401 cat > $TMPC << EOF
1402 int main(void) { return 0; }
1404 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
1406 _prefix="/usr/local"
1407 _xvmclib="XvMCNVIDIA"
1409 # GOTCHA: the variables below defines the default behavior for autodetection
1410 # and have - unless stated otherwise - at least 2 states : yes no
1411 # If autodetection is available then the third state is: auto
1412 _libavcodec=auto
1413 _amr_nb=auto
1414 _amr_nb_fixed=auto
1415 _amr_wb=auto
1416 _libavcodecs=`grep 'register_avcodec(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1417 _libavcodecso=auto
1418 _libavformat=auto
1419 _fame=auto
1420 _mp1e=no
1421 _mencoder=yes
1422 _x11=auto
1423 _dga=auto # 1 2 no auto
1424 _xv=auto
1425 _xvmc=no #auto when complete
1426 _sdl=auto
1427 _directx=auto
1428 _win32waveout=auto
1429 _nas=auto
1430 _png=auto
1431 _jpg=auto
1432 _pnm=yes
1433 _md5sum=yes
1434 _gif=auto
1435 _gl=auto
1436 _ggi=auto
1437 _ggiwmh=auto
1438 _aa=auto
1439 _caca=auto
1440 _svga=auto
1441 _vesa=auto
1442 _fbdev=auto
1443 _dvb=auto
1444 _dvbhead=auto
1445 _dxr2=auto
1446 _dxr3=auto
1447 _iconv=auto
1448 _langinfo=auto
1449 _rtc=auto
1450 _ossaudio=auto
1451 _arts=auto
1452 _esd=auto
1453 _polyp=auto
1454 _jack=auto
1455 _liblzo=auto
1456 _mad=auto
1457 _toolame=auto
1458 _twolame=auto
1459 _tremor_internal=yes
1460 _tremor_low=no
1461 _vorbis=auto
1462 _theora=auto
1463 _mp3lib=yes
1464 _liba52=yes
1465 _libdts=auto
1466 _libmpeg2=yes
1467 _matroska_internal=yes
1468 _tremor=no
1469 _faad_internal=auto
1470 _faad_external=auto
1471 _faac=auto
1472 _ladspa=auto
1473 _xmms=no
1474 # dvdnav disabled, it does not work
1475 #_dvdnav=no
1476 _dvdread=auto
1477 _dvdkit=auto
1478 _xanim=auto
1479 _real=auto
1480 _live=auto
1481 _xinerama=auto
1482 _mga=auto
1483 _xmga=auto
1484 _vm=auto
1485 _xf86keysym=auto
1486 _mlib=auto
1487 _sgiaudio=auto
1488 _sunaudio=auto
1489 _alsa=auto
1490 _fastmemcpy=yes
1491 _unrarlib=yes
1492 _win32=auto
1493 _dshow=yes
1494 _select=yes
1495 _tv=yes
1496 _tv_v4l=auto
1497 _tv_v4l2=auto
1498 _tv_bsdbt848=auto
1499 _edl=yes
1500 _network=yes
1501 _winsock2=auto
1502 _smbsupport=auto
1503 _vidix=auto
1504 _joystick=no
1505 _xvid=auto
1506 _x264=auto
1507 _divx4linux=auto
1508 _opendivx=no
1509 _lirc=auto
1510 _lircc=auto
1511 _gui=no
1512 _gtk1=no
1513 _termcap=auto
1514 _termios=auto
1515 _3dfx=no
1516 _tdfxfb=no
1517 _tdfxvid=no
1518 _tga=yes
1519 _directfb=auto
1520 _zr=auto
1521 _bl=no
1522 _largefiles=no
1523 #_language=en
1524 _shm=auto
1525 _linux_devfs=no
1526 #_charset=utf8
1527 _i18n=auto
1528 _dynamic_plugins=no
1529 _crash_debug=auto
1530 _sighandler=yes
1531 _libdv=auto
1532 _cdparanoia=auto
1533 _big_endian=auto
1534 _freetype=auto
1535 _fontconfig=auto
1536 _menu=no
1537 _qtx=auto
1538 _macosx=auto
1539 _macosx_finder_support=no
1540 _macosx_bundle=auto
1541 _sortsub=yes
1542 _freetypeconfig='freetype-config'
1543 _fribidi=no
1544 _fribidiconfig='fribidi-config'
1545 _enca=auto
1546 _inet6=auto
1547 _gethostbyname2=auto
1548 _ftp=yes
1549 _musepack=auto
1550 _vstream=auto
1551 _pthreads=yes
1552 for ac_option do
1553 case "$ac_option" in
1554 # Skip 1st pass
1555 --target=*) ;;
1556 --cc=*) ;;
1557 --host-cc=*) ;;
1558 --as=*) ;;
1559 --enable-gcc-checking) ;;
1560 --disable-gcc-checking) ;;
1561 --enable-static*) ;;
1562 --disable-static*) ;;
1563 --with-extraincdir=*) ;;
1564 --with-extralibdir=*) ;;
1565 --enable-runtime-cpudetection) ;;
1566 --disable-runtime-cpudetection) ;;
1567 --enable-cross-compile) ;;
1568 --disable-cross-compile) ;;
1569 --install-path=*) ;;
1570 --with-install=*) ;;
1572 # Real 2nd pass
1573 --enable-mencoder) _mencoder=yes ;;
1574 --disable-mencoder) _mencoder=no ;;
1575 --enable-i18n) _i18n=yes ;;
1576 --disable-i18n) _i18n=no ;;
1577 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
1578 --disable-dynamic-plugins) _dynamic_plugins=no ;;
1579 --enable-x11) _x11=yes ;;
1580 --disable-x11) _x11=no ;;
1581 --enable-xv) _xv=yes ;;
1582 --disable-xv) _xv=no ;;
1583 --enable-xvmc) _xvmc=yes ;;
1584 --disable-xvmc) _xvmc=no ;;
1585 --enable-sdl) _sdl=yes ;;
1586 --disable-sdl) _sdl=no ;;
1587 --enable-directx) _directx=yes ;;
1588 --disable-directx) _directx=no ;;
1589 --enable-win32waveout) _win32waveout=yes ;;
1590 --disable-win32waveout) _win32waveout=no ;;
1591 --enable-nas) _nas=yes ;;
1592 --disable-nas) _nas=no ;;
1593 --enable-png) _png=yes ;;
1594 --disable-png) _png=no ;;
1595 --enable-jpeg) _jpg=yes ;;
1596 --disable-jpeg) _jpg=no ;;
1597 --enable-pnm) _pnm=yes ;;
1598 --disable-pnm) _pnm=no ;;
1599 --enable-md5sum) _md5sum=yes ;;
1600 --disable-md5sum) _md5sum=no ;;
1601 --enable-gif) _gif=yes ;;
1602 --disable-gif) _gif=no ;;
1603 --enable-gl) _gl=yes ;;
1604 --disable-gl) _gl=no ;;
1605 --enable-ggi) _ggi=yes ;;
1606 --disable-ggi) _ggi=no ;;
1607 --enable-ggiwmh) _ggiwmh=yes ;;
1608 --disable-ggiwmh) _ggiwmh=no ;;
1609 --enable-aa) _aa=yes ;;
1610 --disable-aa) _aa=no ;;
1611 --enable-caca) _caca=yes ;;
1612 --disable-caca) _caca=no ;;
1613 --enable-svga) _svga=yes ;;
1614 --disable-svga) _svga=no ;;
1615 --enable-vesa) _vesa=yes ;;
1616 --disable-vesa) _vesa=no ;;
1617 --enable-fbdev) _fbdev=yes ;;
1618 --disable-fbdev) _fbdev=no ;;
1619 --enable-dvb) _dvb=yes ;;
1620 --disable-dvb) _dvb=no ;;
1621 --enable-dvbhead) _dvbhead=yes ;;
1622 --disable-dvbhead) _dvbhead=no ;;
1623 --enable-dxr2) _dxr2=yes ;;
1624 --disable-dxr2) _dxr2=no ;;
1625 --enable-dxr3) _dxr3=yes ;;
1626 --disable-dxr3) _dxr3=no ;;
1627 --enable-iconv) _iconv=yes ;;
1628 --disable-iconv) _iconv=no ;;
1629 --enable-langinfo) _langinfo=yes ;;
1630 --disable-langinfo) _langinfo=no ;;
1631 --enable-rtc) _rtc=yes ;;
1632 --disable-rtc) _rtc=no ;;
1633 --enable-mp1e) _mp1e=yes ;;
1634 --disable-mp1e) _mp1e=no ;;
1635 --enable-libdv) _libdv=yes ;;
1636 --disable-libdv) _libdv=no ;;
1637 --enable-ossaudio) _ossaudio=yes ;;
1638 --disable-ossaudio) _ossaudio=no ;;
1639 --enable-arts) _arts=yes ;;
1640 --disable-arts) _arts=no ;;
1641 --enable-esd) _esd=yes ;;
1642 --disable-esd) _esd=no ;;
1643 --enable-polyp) _polyp=yes ;;
1644 --disable-polyp) _polyp=no ;;
1645 --enable-jack) _jack=yes ;;
1646 --disable-jack) _jack=no ;;
1647 --enable-mad) _mad=yes ;;
1648 --disable-mad) _mad=no ;;
1649 --disable-toolame) _toolame=no ;;
1650 --disable-twolame) _twolame=no ;;
1651 --enable-liblzo) _liblzo=yes ;;
1652 --disable-liblzo) _liblzo=no ;;
1653 --enable-vorbis) _vorbis=yes ;;
1654 --disable-vorbis) _vorbis=no ;;
1655 --enable-internal-tremor) _tremor_internal=yes ;;
1656 --disable-internal-tremor) _tremor_internal=no ;;
1657 --enable-tremor-low) _tremor_low=yes ;;
1658 --disable-tremor-low) _tremor_low=no ;;
1659 --enable-external-tremor) _tremor=yes ;;
1660 --disable-external-tremor) _tremor=no ;;
1661 --enable-theora) _theora=yes ;;
1662 --disable-theora) _theora=no ;;
1663 --enable-mp3lib) _mp3lib=yes ;;
1664 --disable-mp3lib) _mp3lib=no ;;
1665 --enable-liba52) _liba52=yes ;;
1666 --disable-liba52) _liba52=no ;;
1667 --enable-libdts) _libdts=yes ;;
1668 --disable-libdts) _libdts=no ;;
1669 --enable-libmpeg2) _libmpeg2=yes ;;
1670 --disable-libmpeg2) _libmpeg2=no ;;
1671 --enable-musepack) _musepack=yes ;;
1672 --disable-musepack) _musepack=no ;;
1673 --enable-internal-matroska) _matroska_internal=yes ;;
1674 --disable-internal-matroska) _matroska_internal=no ;;
1675 --enable-internal-faad) _faad_internal=yes _faad_external=no ;;
1676 --disable-internal-faad) _faad_internal=no ;;
1677 --enable-external-faad) _faad_external=yes _faad_internal=no ;;
1678 --disable-external-faad) _faad_external=no ;;
1679 --enable-faac) _faac=yes ;;
1680 --disable-faac) _faac=no ;;
1681 --enable-ladspa) _ladspa=yes ;;
1682 --disable-ladspa) _ladspa=no ;;
1683 --enable-xmms) _xmms=yes ;;
1684 --disable-xmms) _xmms=no ;;
1685 --enable-dvdread) _dvdread=yes ;;
1686 --disable-dvdread) _dvdread=no ;;
1687 --enable-mpdvdkit) _dvdkit=yes ;;
1688 --disable-mpdvdkit) _dvdkit=no ;;
1689 # dvdnav disabled, it does not work
1690 # --enable-dvdnav) _dvdnav=yes ;;
1691 # --disable-dvdnav) _dvdnav=no ;;
1692 --enable-xanim) _xanim=yes ;;
1693 --disable-xanim) _xanim=no ;;
1694 --enable-real) _real=yes ;;
1695 --disable-real) _real=no ;;
1696 --enable-live) _live=yes ;;
1697 --disable-live) _live=no ;;
1698 --enable-xinerama) _xinerama=yes ;;
1699 --disable-xinerama) _xinerama=no ;;
1700 --enable-mga) _mga=yes ;;
1701 --disable-mga) _mga=no ;;
1702 --enable-xmga) _xmga=yes ;;
1703 --disable-xmga) _xmga=no ;;
1704 --enable-vm) _vm=yes ;;
1705 --disable-vm) _vm=no ;;
1706 --enable-xf86keysym) _xf86keysym=yes ;;
1707 --disable-xf86keysym) _xf86keysym=no ;;
1708 --enable-mlib) _mlib=yes ;;
1709 --disable-mlib) _mlib=no ;;
1710 --enable-sunaudio) _sunaudio=yes ;;
1711 --disable-sunaudio) _sunaudio=no ;;
1712 --enable-sgiaudio) _sgiaudio=yes ;;
1713 --disable-sgiaudio) _sgiaudio=no ;;
1714 --enable-alsa) _alsa=yes ;;
1715 --disable-alsa) _alsa=no ;;
1716 --enable-tv) _tv=yes ;;
1717 --disable-tv) _tv=no ;;
1718 --enable-edl) _edl=yes ;;
1719 --disable-edl) _edl=no ;;
1720 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1721 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1722 --enable-tv-v4l) _tv_v4l=yes ;;
1723 --disable-tv-v4l) _tv_v4l=no ;;
1724 --enable-tv-v4l2) _tv_v4l2=yes ;;
1725 --disable-tv-v4l2) _tv_v4l2=no ;;
1726 --enable-fastmemcpy) _fastmemcpy=yes ;;
1727 --disable-fastmemcpy) _fastmemcpy=no ;;
1728 --enable-network) _network=yes ;;
1729 --disable-network) _network=no ;;
1730 --enable-winsock2) _winsock2=yes ;;
1731 --disable-winsock2) _winsock2=no ;;
1732 --enable-smb) _smbsupport=yes ;;
1733 --disable-smb) _smbsupport=no ;;
1734 --enable-vidix) _vidix=yes ;;
1735 --disable-vidix) _vidix=no ;;
1736 --enable-joystick) _joystick=yes ;;
1737 --disable-joystick) _joystick=no ;;
1738 --enable-xvid) _xvid=yes ;;
1739 --disable-xvid) _xvid=no ;;
1740 --enable-x264) _x264=yes ;;
1741 --disable-x264) _x264=no ;;
1742 --enable-divx4linux) _divx4linux=yes ;;
1743 --disable-divx4linux) _divx4linux=no ;;
1744 --enable-opendivx) _opendivx=yes ;;
1745 --disable-opendivx) _opendivx=no ;;
1746 --enable-libavcodec) _libavcodec=yes ;;
1747 --disable-libavcodec) _libavcodec=no ;;
1748 --enable-amr_nb) _amr_nb=yes ;;
1749 --disable-amr_nb) _amr_nb=no ;;
1750 --enable-amr_nb-fixed) _amr_nb_fixed=yes ;;
1751 --disable-amr_nb-fixed) _amr_nb_fixed=no ;;
1752 --enable-amr_wb) _amr_wb=yes ;;
1753 --disable-amr_wb) _amr_wb=no ;;
1754 --enable-codec=*) _libavcodecs="$_libavcodecs `echo $ac_option | cut -d '=' -f 2`" ;;
1755 --disable-codec=*) _libavcodecs=`echo $_libavcodecs | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1756 --enable-libavformat) _libavformat=yes;;
1757 --disable-libavformat) _libavformat=no ;;
1758 --enable-libfame) _fame=yes ;;
1759 --disable-libfame) _fame=no ;;
1760 --enable-lirc) _lirc=yes ;;
1761 --disable-lirc) _lirc=no ;;
1762 --enable-lircc) _lircc=yes ;;
1763 --disable-lircc) _lircc=no ;;
1764 --enable-gui) _gui=yes ;;
1765 --disable-gui) _gui=no ;;
1766 --enable-old-gtk) _gtk1=yes ;;
1767 --enable-termcap) _termcap=yes ;;
1768 --disable-termcap) _termcap=no ;;
1769 --enable-termios) _termios=yes ;;
1770 --disable-termios) _termios=no ;;
1771 --enable-3dfx) _3dfx=yes ;;
1772 --disable-3dfx) _3dfx=no ;;
1773 --enable-tdfxfb) _tdfxfb=yes ;;
1774 --disable-tdfxvid) _tdfxvid=no ;;
1775 --enable-tdfxvid) _tdfxvid=yes ;;
1776 --disable-tga) _tga=no ;;
1777 --enable-tga) _tga=yes ;;
1778 --disable-tdfxfb) _tdfxfb=no ;;
1779 --enable-directfb) _directfb=yes ;;
1780 --disable-directfb) _directfb=no ;;
1781 --enable-zr) _zr=yes ;;
1782 --disable-zr) _zr=no ;;
1783 --enable-bl) _bl=yes ;;
1784 --disable-bl) _bl=no ;;
1785 --enable-mtrr) _mtrr=yes ;;
1786 --disable-mtrr) _mtrr=no ;;
1787 --enable-largefiles) _largefiles=yes ;;
1788 --disable-largefiles) _largefiles=no ;;
1789 --enable-shm) _shm=yes ;;
1790 --disable-shm) _shm=no ;;
1791 --enable-select) _select=yes ;;
1792 --disable-select) _select=no ;;
1793 --enable-linux-devfs) _linux_devfs=yes ;;
1794 --disable-linux-devfs) _linux_devfs=no ;;
1795 --enable-cdparanoia) _cdparanoia=yes ;;
1796 --disable-cdparanoia) _cdparanoia=no ;;
1797 --enable-big-endian) _big_endian=yes ;;
1798 --disable-big-endian) _big_endian=no ;;
1799 --enable-freetype) _freetype=yes ;;
1800 --disable-freetype) _freetype=no ;;
1801 --enable-fontconfig) _fontconfig=yes ;;
1802 --disable-fontconfig) _fontconfig=no ;;
1803 --enable-unrarlib) _unrarlib=yes ;;
1804 --disable-unrarlib) _unrarlib=no ;;
1805 --enable-ftp) _ftp=yes ;;
1806 --disable-ftp) _ftp=no ;;
1807 --enable-vstream) _vstream=yes ;;
1808 --disable-vstream) _vstream=no ;;
1809 --enable-pthreads) _pthreads=yes ;;
1810 --disable-pthreads) _pthreads=no ;;
1812 --enable-fribidi) _fribidi=yes ;;
1813 --disable-fribidi) _fribidi=no ;;
1815 --enable-enca) _enca=yes ;;
1816 --disable-enca) _enca=no ;;
1818 --enable-inet6) _inet6=yes ;;
1819 --disable-inet6) _inet6=no ;;
1821 --enable-gethostbyname2) _gethostbyname2=yes ;;
1822 --disable-gethostbyname2) _gethostbyname2=no ;;
1824 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1825 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1826 --disable-dga) _dga=no ;;
1828 --enable-menu) _menu=yes ;;
1829 --disable-menu) _menu=no ;;
1831 --enable-qtx) _qtx=yes ;;
1832 --disable-qtx) _qtx=no ;;
1834 --enable-macosx) _macosx=yes ;;
1835 --disable-macosx) _macosx=no ;;
1836 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1837 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1838 --enable-macosx-bundle) _macosx_bundle=yes;;
1839 --disable-macosx-bundle) _macosx_bundle=no;;
1841 --enable-sortsub) _sortsub=yes ;;
1842 --disable-sortsub) _sortsub=no ;;
1844 --charset=*)
1845 _charset=`echo $ac_option | cut -d '=' -f 2`
1847 --language=*)
1848 _language=`echo $ac_option | cut -d '=' -f 2`
1850 # dvdnav disabled, it does not work
1851 # --with-libdvdnav=*)
1852 # _dvdnavdir=`echo $ac_option | cut -d '=' -f 2`
1853 # _dvdnav=yes
1854 # ;;
1856 --with-codecsdir=*)
1857 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1858 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1859 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1861 --with-win32libdir=*)
1862 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1863 _win32=yes
1865 --with-xanimlibdir=*)
1866 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1867 _xanim=yes
1869 --with-reallibdir=*)
1870 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1871 _real=yes
1873 --with-livelibdir=*)
1874 _livelibdir=`echo $ac_option | cut -d '=' -f 2`
1876 --with-toolamedir=*)
1877 _toolamedir=`echo $ac_option | cut -d '=' -f 2`
1879 --with-mlibdir=*)
1880 _mlibdir=`echo $ac_option | cut -d '=' -f 2`
1881 _mlib=yes
1884 --with-xmmslibdir=*)
1885 _xmmslibdir=`echo $ac_option | cut -d '=' -f 2`
1888 --with-xmmsplugindir=*)
1889 _xmmsplugindir=`echo $ac_option | cut -d '=' -f 2`
1892 --enable-profile)
1893 _profile='-p'
1895 --disable-profile)
1896 _profile=
1898 --enable-debug)
1899 _debug='-g'
1901 --enable-debug=*)
1902 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
1904 --disable-debug)
1905 _debug=
1907 --enable-crash-debug)
1908 _crash_debug=yes
1910 --disable-crash-debug)
1911 _crash_debug=no
1913 --enable-sighandler)
1914 _sighandler=yes
1916 --disable-sighandler)
1917 _sighandler=no
1920 --enable-sse) _sse=yes ;;
1921 --disable-sse) _sse=no ;;
1922 --enable-sse2) _sse2=yes ;;
1923 --disable-sse2) _sse2=no ;;
1924 --enable-mmx2) _mmx2=yes ;;
1925 --disable-mmx2) _mmx2=no ;;
1926 --enable-3dnow) _3dnow=yes ;;
1927 --disable-3dnow) _3dnow=no _3dnowex=no ;;
1928 --enable-3dnowex) _3dnow=yes _3dnowex=yes ;;
1929 --disable-3dnowex) _3dnowex=no ;;
1930 --enable-altivec) _altivec=yes ;;
1931 --disable-altivec) _altivec=no ;;
1932 --enable-mmx) _mmx=yes ;;
1933 --disable-mmx) # 3Dnow! and MMX2 require MMX
1934 _3dnow=no _3dnowex=no _mmx=no _mmx2=no ;;
1936 --enable-win32) _win32=yes ;;
1937 --disable-win32) _win32=no _dshow=no ;;
1938 --enable-dshow) _win32=yes _dshow=yes ;;
1939 --disable-dshow) _dshow=no ;;
1941 --with-x11incdir=*)
1942 _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1944 --with-x11libdir=*)
1945 _x11_paths=`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1947 --with-dxr2incdir=*)
1948 _inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1950 --with-xvmclib=*)
1951 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
1953 --with-dvbincdir=*)
1954 _inc_dvb=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1956 --with-xvidlibdir=*)
1957 _ld_xvid=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1959 --with-xvidincdir=*)
1960 _inc_xvid=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1962 --with-dtslibdir=*)
1963 _ld_libdts=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1965 --with-dtsincdir=*)
1966 _inc_libdts=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1968 --with-x264libdir=*)
1969 _ld_x264=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1971 --with-x264incdir=*)
1972 _inc_x264=-I`echo $ac_option | cut -d '=' -f 2 |sed 's,:, -I,g'`
1974 --with-sdl-config=*)
1975 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
1977 --with-freetype-config=*)
1978 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
1980 --with-fribidi-config=*)
1981 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
1983 --with-gtk-config=*)
1984 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
1986 --with-glib-config=*)
1987 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
1989 # dvdnav disabled, it does not work
1990 # --with-dvdnav-config=*)
1991 # _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
1992 # ;;
1993 --with-madlibdir=*)
1994 _ld_mad=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1996 --with-cdparanoiaincdir=*)
1997 _inc_cdparanoia=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1999 --with-cdparanoialibdir=*)
2000 _ld_cdparanoia=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
2002 --with-termcaplib=*)
2003 _ld_termcap=-l`echo $ac_option | cut -d '=' -f 2`
2004 _termcap=yes
2006 --prefix=*)
2007 _prefix=`echo $ac_option | cut -d '=' -f 2`
2009 --bindir=*)
2010 _bindir=`echo $ac_option | cut -d '=' -f 2`
2012 --datadir=*)
2013 _datadir=`echo $ac_option | cut -d '=' -f 2`
2015 --mandir=*)
2016 _mandir=`echo $ac_option | cut -d '=' -f 2`
2018 --confdir=*)
2019 _confdir=`echo $ac_option | cut -d '=' -f 2`
2021 --libdir=*)
2022 _libdir=`echo $ac_option | cut -d '=' -f 2`
2026 echo "Unknown parameter: $ac_option"
2027 exit 1
2030 esac
2031 done
2033 # Atmos: moved this here, to be correct, if --prefix is specified
2034 test -z "$_bindir" && _bindir="$_prefix/bin"
2035 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
2036 test -z "$_mandir" && _mandir="$_prefix/man"
2037 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
2038 test -z "$_libdir" && _libdir="$_prefix/lib"
2039 test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
2041 if x86 ; then
2042 # Checking assembler (_as) compatibility...
2043 # Added workaround for older as that reads from stdin by default - atmos
2044 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2045 echocheck "assembler ($_as $as_version)"
2047 _pref_as_version='2.9.1'
2048 echo 'nop' > $TMPS
2049 if test "$_mmx" = yes ; then
2050 echo 'emms' >> $TMPS
2052 if test "$_3dnow" = yes ; then
2053 _pref_as_version='2.10.1'
2054 echo 'femms' >> $TMPS
2056 if test "$_3dnowex" = yes ; then
2057 _pref_as_version='2.10.1'
2058 echo 'pswapd %mm0, %mm0' >> $TMPS
2060 if test "$_mmx2" = yes ; then
2061 _pref_as_version='2.10.1'
2062 echo 'movntq %mm0, (%eax)' >> $TMPS
2064 if test "$_sse" = yes ; then
2065 _pref_as_version='2.10.1'
2066 echo 'xorps %xmm0, %xmm0' >> $TMPS
2068 #if test "$_sse2" = yes ; then
2069 # _pref_as_version='2.11'
2070 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2072 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2074 if test "$as_verc_fail" != yes ; then
2075 echores "ok"
2076 else
2077 echores "failed"
2078 echo "Upgrade binutils to ${_pref_as_version} ..."
2079 die "obsolete binutils version"
2083 if ppc ; then
2085 # check if altivec is supported by the compiler, and how to enable it
2087 _altivec_gcc_flags=''
2089 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2090 echocheck "GCC altivec support"
2092 p=''
2093 cat > $TMPC << EOF
2094 int main() {
2095 return 0;
2098 FSF_flags='-maltivec -mabi=altivec'
2099 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2101 # check for Darwin-style flags first, since
2102 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2103 # accepts but ignores FSF-style flags...
2105 if test -z "$p"; then
2106 cc_check $Darwin_flags && p='Darwin'
2108 if test -z "$p"; then
2109 cc_check $FSF_flags && p='FSF'
2112 case $p in
2113 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2114 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2115 *) _altivec=no ;;
2116 esac
2118 if test -z "$p"; then
2119 p=none
2120 else
2121 p="$p-style ($_altivec_gcc_flags)"
2124 echores "$p"
2127 # check if <altivec.h> should be included
2129 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2131 if test "$_altivec" = yes ; then
2132 echocheck "altivec.h"
2133 cat > $TMPC << EOF
2134 #include <altivec.h>
2135 int main(void) { return 0; }
2137 _have_altivec_h=no
2138 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2139 if test "$_have_altivec_h" = yes ; then
2140 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2142 echores "$_have_altivec_h"
2145 # disable runtime cpudetection if
2146 # - we cannot generate altivec code
2147 # - altivec is disabled by the user
2149 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2150 _runtime_cpudetection=no
2153 # show that we are optimizing for altivec (if enabled and supported)
2155 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2156 _optimizing="$_optimizing altivec"
2159 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2161 if test "$_altivec" = yes ; then
2162 _mcpu="$_mcpu $_altivec_gcc_flags"
2165 # setup _def_altivec correctly
2167 if test "$_altivec" = yes ; then
2168 _def_altivec='#define HAVE_ALTIVEC 1'
2169 else
2170 _def_altivec='#undef HAVE_ALTIVEC'
2174 _def_mmx='#undef HAVE_MMX'
2175 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2176 _def_mmx2='#undef HAVE_MMX2'
2177 test "$_mmx2" = yes && _def_mmx2='#define HAVE_MMX2 1'
2178 _def_3dnow='#undef HAVE_3DNOW'
2179 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2180 _def_3dnowex='#undef HAVE_3DNOWEX'
2181 test "$_3dnowex" = yes && _def_3dnowex='#define HAVE_3DNOWEX 1'
2182 _def_sse='#undef HAVE_SSE'
2183 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2184 _def_sse2='#undef HAVE_SSE2'
2185 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2187 # Checking kernel version...
2188 if x86 && linux ; then
2189 _k_verc_problem=no
2190 kernel_version=`uname -r 2>&1`
2191 echocheck "$system_name kernel version"
2192 case "$kernel_version" in
2193 '') kernel_version="?.??"; _k_verc_fail=yes;;
2194 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2195 _k_verc_problem=yes;;
2196 esac
2197 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2198 _k_verc_fail=yes
2200 if test "$_k_verc_fail" ; then
2201 echores "$kernel_version, fail"
2202 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2203 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2204 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2205 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2206 echo "2.2.x you must upgrade it to get SSE support!"
2207 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2208 else
2209 echores "$kernel_version, ok"
2213 if test "$_vidix" = auto ; then
2214 _vidix=no
2215 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2216 x86 && _vidix=yes
2217 x86_64 && _vidix=yes
2218 ppc && linux && _vidix=yes
2219 alpha && linux && _vidix=yes
2220 qnx && _vidix=no
2221 sunos && _vidix=no
2222 beos && _vidix=no
2225 echocheck "mplayer binary name"
2226 if win32 ; then
2227 _prg="mplayer.exe"
2228 _prg_mencoder="mencoder.exe"
2229 else
2230 _prg="mplayer"
2231 _prg_mencoder="mencoder"
2233 echores $_prg
2236 # On QNX we must link to libph - Gabucino
2237 if qnx ; then
2238 _ld_arch="$_ld_arch -lph"
2241 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2242 _awk=
2243 if test "$_vidix" = yes ; then
2244 _awk_verc_fail=yes
2245 echocheck "awk"
2246 for _awk in mawk gawk nawk awk; do
2247 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2248 _awk_verc_fail=no
2249 break
2251 done
2252 test "$_awk_verc_fail" = yes && _awk=no
2253 echores "$_awk"
2254 if test "$_awk_verc_fail" = yes; then
2255 echo "VIDIX needs awk, but no working implementation was found!"
2256 echo "Try the GNU version, which can be downloaded from:"
2257 echo "ftp://ftp.gnu.org/gnu/gawk/"
2258 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2259 die "no awk"
2263 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2264 if irix ; then
2265 _ranlib='ar -r'
2266 elif linux ; then
2267 _ranlib='true'
2270 ######################
2271 # MAIN TESTS GO HERE #
2272 ######################
2275 echocheck "extra headers"
2276 if test "$_inc_extra" ; then
2277 echores "$_inc_extra"
2278 else
2279 echores "none"
2283 echocheck "extra libs"
2284 if test "$_ld_extra" ; then
2285 echores "$_ld_extra"
2286 else
2287 echores "none"
2290 echocheck "-lposix"
2291 cat > $TMPC <<EOF
2292 int main(void) { return 0; }
2294 if cc_check -lposix ; then
2295 _ld_arch="$_ld_arch -lposix"
2296 echores "yes"
2297 else
2298 echores "no"
2301 echocheck "-lm"
2302 cat > $TMPC <<EOF
2303 int main(void) { return 0; }
2305 if cc_check -lm ; then
2306 _ld_lm="-lm"
2307 echores "yes"
2308 else
2309 _ld_lm=""
2310 echores "no"
2313 # Checking for localization ...
2314 # CSAK EGY MARADHAT - A HEGYLAKO
2315 echocheck "i18n"
2316 if test "$_i18n" != no ; then
2317 cat > $TMPC <<EOF
2318 #include <libintl.h>
2319 int main(void) { gettext("test"); return 0; }
2321 _i18n=no
2322 _i18n_libs=""
2323 if test "$_i18n" = auto ; then
2324 cc_check && _i18n=yes
2325 else
2326 for i18n_lib in "" "-lintl"; do
2327 cc_check $i18n_lib && _i18n=yes && _i18n_libs=$i18n_lib && break
2328 done
2331 if test "$_i18n" = yes ; then
2332 _def_i18n='#define USE_I18N 1'
2333 else
2334 _def_i18n='#undef USE_I18N'
2336 if test "$_i18n_libs" ; then
2337 _res_comment="using $_i18n_libs"
2339 echores "$_i18n"
2342 echocheck "langinfo"
2343 if test "$_langinfo" = auto ; then
2344 cat > $TMPC <<EOF
2345 #include <langinfo.h>
2346 int main(void) { nl_langinfo(CODESET); return 0; }
2348 _langinfo=no
2349 cc_check && _langinfo=yes
2351 if test "$_langinfo" = yes ; then
2352 _def_langinfo='#define USE_LANGINFO 1'
2353 else
2354 _def_langinfo='#undef USE_LANGINFO'
2356 echores "$_langinfo"
2359 echocheck "language"
2360 test -z "$_language" && _language=$LINGUAS
2361 _language=`echo $_language | sed 's/,/ /g'`
2362 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2363 for lang in $_language ; do
2364 test "$lang" = all && lang=en
2365 if test -f "help/help_mp-${lang}.h" ; then
2366 _language=$lang
2367 break
2368 else
2369 echo -n "$lang not found, "
2370 _language=`echo $_language | sed "s/$lang *//"`
2372 done
2373 test -z "$_language" && _language=en
2374 _mp_help="help/help_mp-${_language}.h"
2375 test -f $_mp_help || die "$_mp_help not found"
2376 for lang in $LANGUAGES ; do
2377 if test -f "DOCS/man/$lang/mplayer.1" ; then
2378 MAN_LANG="$MAN_LANG $lang"
2380 done
2381 _doc_lang=$_language
2382 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2383 echores "using $_language (man pages: $MAN_LANG)"
2386 echocheck "enable sighandler"
2387 if test "$_sighandler" = yes ; then
2388 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2389 else
2390 _def_sighandler='#undef ENABLE_SIGHANDLER'
2392 echores "$_sighandler"
2394 echocheck "runtime cpudetection"
2395 if test "$_runtime_cpudetection" = yes ; then
2396 _optimizing="Runtime CPU-Detection enabled"
2397 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2398 else
2399 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2401 echores "$_runtime_cpudetection"
2404 echocheck "restrict keyword"
2405 for restrict_keyword in restrict __restrict __restrict__ ; do
2406 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2407 if cc_check; then
2408 _def_restrict_keyword=$restrict_keyword
2409 break;
2411 done
2412 if [ -n "$_def_restrict_keyword" ]; then
2413 echores "$_def_restrict_keyword"
2414 else
2415 echores "none"
2417 # Avoid infinite recursion loop ("#define restrict restrict")
2418 if [ "$_def_restrict_keyword" != "restrict" ]; then
2419 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2420 else
2421 _def_restrict_keyword=""
2425 echocheck "__builtin_expect"
2426 # GCC branch prediction hint
2427 cat > $TMPC << EOF
2428 int foo (int a) {
2429 a = __builtin_expect (a, 10);
2430 return a == 10 ? 0 : 1;
2432 int main() { return foo(10) && foo(0); }
2434 _builtin_expect=no
2435 cc_check && _builtin_expect=yes
2436 if test "$_builtin_expect" = yes ; then
2437 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2438 else
2439 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2441 echores "$_builtin_expect"
2444 echocheck "kstat"
2445 cat > $TMPC << EOF
2446 #include <kstat.h>
2447 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2449 _kstat=no
2450 cc_check -lkstat && _kstat=yes
2451 if test "$_kstat" = yes ; then
2452 _def_kstat="#define HAVE_LIBKSTAT 1"
2453 _ld_arch="-lkstat $_ld_arch"
2454 else
2455 _def_kstat="#undef HAVE_LIBKSTAT"
2457 echores "$_kstat"
2460 echocheck "posix4"
2461 # required for nanosleep on some systems
2462 cat > $TMPC << EOF
2463 #include <time.h>
2464 int main(void) { (void) nanosleep(0, 0); return 0; }
2466 _posix4=no
2467 cc_check -lposix4 && _posix4=yes
2468 if test "$_posix4" = yes ; then
2469 _ld_arch="-lposix4 $_ld_arch"
2471 echores "$_posix4"
2473 echocheck "lrintf"
2474 cat > $TMPC << EOF
2475 #include <math.h>
2476 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2478 _lrintf=no
2479 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2480 if test "$_lrintf" = yes ; then
2481 _def_lrintf="#define HAVE_LRINTF 1"
2482 else
2483 _def_lrintf="#undef HAVE_LRINTF"
2485 echores "$_lrintf"
2487 echocheck "round"
2488 cat > $TMPC << EOF
2489 #include <math.h>
2490 int main(void) { (void) round(0.0); return 0; }
2492 _round=no
2493 cc_check $_ld_lm && _round=yes
2494 if test "$_round" = yes ; then
2495 _def_round="#define HAVE_ROUND 1"
2496 else
2497 _def_round="#undef HAVE_ROUND"
2499 echores "$_round"
2501 echocheck "nanosleep"
2502 # also check for nanosleep
2503 cat > $TMPC << EOF
2504 #include <time.h>
2505 int main(void) { (void) nanosleep(0, 0); return 0; }
2507 _nanosleep=no
2508 cc_check $_ld_arch && _nanosleep=yes
2509 if test "$_nanosleep" = yes ; then
2510 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2511 else
2512 _def_nanosleep='#undef HAVE_NANOSLEEP'
2514 echores "$_nanosleep"
2517 echocheck "socklib"
2518 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2519 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2520 cat > $TMPC << EOF
2521 #include <netdb.h>
2522 #include <sys/socket.h>
2523 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2525 for _ld_tmp in "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2526 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && break
2527 done
2528 if test $_winsock2 = auto && not cygwin ; then
2529 _winsock2=no
2530 cat > $TMPC << EOF
2531 #include <winsock2.h>
2532 int main(void) { (void) gethostbyname(0); return 0; }
2534 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2536 if test "$_ld_sock" ; then
2537 echores "yes (using $_ld_sock)"
2538 else
2539 echores "no"
2543 if test $_winsock2 = yes ; then
2544 _ld_sock="-lws2_32"
2545 _def_winsock2='#define HAVE_WINSOCK2 1'
2546 else
2547 _def_winsock2='#undef HAVE_WINSOCK2'
2551 _use_aton=no
2552 echocheck "inet_pton()"
2553 cat > $TMPC << EOF
2554 #include <sys/types.h>
2555 #include <sys/socket.h>
2556 #include <arpa/inet.h>
2557 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2559 if test "$_winsock2" = yes ; then
2560 echores "not needed (using winsock2 functions)"
2561 elif cc_check $_ld_sock ; then
2562 # NOTE: Linux has libresolv but does not need it
2564 echores "yes (using $_ld_sock)"
2565 elif cc_check $_ld_sock -lresolv ; then
2566 # NOTE: needed for SunOS at least
2567 _ld_sock="$_ld_sock -lresolv"
2568 echores "yes (using $_ld_sock)"
2569 else
2570 echores "no (=> i'll try inet_aton next)"
2572 echocheck "inet_aton()"
2573 cat > $TMPC << EOF
2574 #include <sys/types.h>
2575 #include <sys/socket.h>
2576 #include <arpa/inet.h>
2577 int main(void) { (void) inet_aton(0, 0); return 0; }
2579 _use_aton=yes
2580 if cc_check $_ld_sock ; then
2581 # NOTE: Linux has libresolv but does not need it
2583 echores "yes (using $_ld_sock)"
2584 elif cc_check $_ld_sock -lresolv ; then
2585 # NOTE: needed for SunOS at least
2586 _ld_sock="$_ld_sock -lresolv"
2587 echores "yes (using $_ld_sock)"
2588 else
2589 _use_aton=no
2590 _network=no
2591 echores "no (=> network support disabled)"
2595 _def_use_aton='#undef USE_ATON'
2596 if test "$_use_aton" != no; then
2597 _def_use_aton='#define USE_ATON 1'
2601 echocheck "inttypes.h (required)"
2602 cat > $TMPC << EOF
2603 #include <inttypes.h>
2604 int main(void) { return 0; }
2606 _inttypes=no
2607 cc_check && _inttypes=yes
2608 if test "$_inttypes" = yes ; then
2609 # nothing to do
2611 else
2612 echores "no"
2613 echocheck "bitypes.h (inttypes.h predecessor)"
2614 cat > $TMPC << EOF
2615 #include <sys/bitypes.h>
2616 int main(void) { return 0; }
2618 _inttypes=no
2619 cc_check && _inttypes=yes
2620 if test "$_inttypes" = yes ; then
2621 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."
2622 else
2623 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2626 echores "$_inttypes"
2629 echocheck "int_fastXY_t in inttypes.h"
2630 cat > $TMPC << EOF
2631 #include <inttypes.h>
2632 int main(void) {
2633 volatile int_fast16_t v= 0;
2634 return v; }
2636 _fast_inttypes=no
2637 cc_check && _fast_inttypes=yes
2638 if test "$_fast_inttypes" = yes ; then
2639 # nothing to do
2641 else
2642 _def_fast_inttypes='
2643 typedef signed char int_fast8_t;
2644 typedef signed int int_fast16_t;
2645 typedef signed int int_fast32_t;
2646 typedef unsigned char uint_fast8_t;
2647 typedef unsigned int uint_fast16_t;
2648 typedef unsigned int uint_fast32_t;'
2650 echores "$_fast_inttypes"
2653 echocheck "word size"
2654 _mp_wordsize="#undef MP_WORDSIZE"
2655 cat > $TMPC << EOF
2656 #include <stdio.h>
2657 #include <sys/types.h>
2658 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2660 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2661 echores "$_wordsize"
2664 echocheck "stddef.h"
2665 cat > $TMPC << EOF
2666 #include <stddef.h>
2667 int main(void) { return 0; }
2669 _stddef=no
2670 cc_check && _stddef=yes
2671 if test "$_stddef" = yes ; then
2672 _def_stddef='#define HAVE_STDDEF_H 1'
2673 else
2674 _def_stddef='#undef HAVE_STDDEF_H'
2676 echores "$_stddef"
2679 echocheck "malloc.h"
2680 cat > $TMPC << EOF
2681 #include <malloc.h>
2682 int main(void) { (void) malloc(0); return 0; }
2684 _malloc=no
2685 cc_check && _malloc=yes
2686 if test "$_malloc" = yes ; then
2687 _def_malloc='#define HAVE_MALLOC_H 1'
2688 else
2689 _def_malloc='#undef HAVE_MALLOC_H'
2691 # malloc.h emits a warning in FreeBSD and OpenBSD
2692 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2693 echores "$_malloc"
2696 echocheck "memalign()"
2697 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2698 cat > $TMPC << EOF
2699 #include <malloc.h>
2700 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2702 _memalign=no
2703 cc_check && _memalign=yes
2704 if test "$_memalign" = yes ; then
2705 _def_memalign='#define HAVE_MEMALIGN 1'
2706 else
2707 _def_memalign='#undef HAVE_MEMALIGN'
2709 echores "$_memalign"
2712 echocheck "alloca.h"
2713 cat > $TMPC << EOF
2714 #include <alloca.h>
2715 int main(void) { (void) alloca(0); return 0; }
2717 _alloca=no
2718 cc_check && _alloca=yes
2719 if cc_check ; then
2720 _def_alloca='#define HAVE_ALLOCA_H 1'
2721 else
2722 _def_alloca='#undef HAVE_ALLOCA_H'
2724 echores "$_alloca"
2727 echocheck "mman.h"
2728 cat > $TMPC << EOF
2729 #include <sys/types.h>
2730 #include <sys/mman.h>
2731 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2733 _mman=no
2734 cc_check && _mman=yes
2735 if test "$_mman" = yes ; then
2736 _def_mman='#define HAVE_SYS_MMAN_H 1'
2737 else
2738 _def_mman='#undef HAVE_SYS_MMAN_H'
2740 echores "$_mman"
2742 cat > $TMPC << EOF
2743 #include <sys/types.h>
2744 #include <sys/mman.h>
2745 int main(void) { void *p = MAP_FAILED; return 0; }
2747 _mman_has_map_failed=no
2748 cc_check && _mman_has_map_failed=yes
2749 if test "$_mman_has_map_failed" = yes ; then
2750 _def_mman_has_map_failed=''
2751 else
2752 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2755 echocheck "dynamic loader"
2756 cat > $TMPC << EOF
2757 #include <dlfcn.h>
2758 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2760 _dl=no
2761 for _ld_tmp in "" "-ldl" ; do
2762 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2763 done
2764 if test "$_dl" = yes ; then
2765 _def_dl='#define HAVE_LIBDL 1'
2766 else
2767 _def_dl='#undef HAVE_LIBDL'
2769 echores "$_dl"
2772 echocheck "dynamic a/v plugins support"
2773 if test "$_dl" = no ; then
2774 _dynamic_plugins=no
2776 if test "$_dynamic_plugins" = yes ; then
2777 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
2778 else
2779 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
2781 echores "$_dynamic_plugins"
2784 #echocheck "dynamic linking"
2785 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
2786 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
2787 #cat > $TMPC << EOF
2788 #int main(void) { return 0; }
2789 #EOF
2790 #if cc_check -rdynamic ; then
2791 # _ld_dl_dynamic='-rdynamic'
2792 #elif cc_check -Bdynamic ; then
2793 # _ld_dl_dynamic='-Bdynamic'
2794 #elif cc_check ; then
2795 # _ld_dl_dynamic=''
2797 #echores "using $_ld_dl_dynamic"
2799 _def_threads='#undef HAVE_THREADS'
2801 echocheck "pthread"
2802 if test "$_pthreads" != no ; then
2803 cat > $TMPC << EOF
2804 #include <pthread.h>
2805 void* func(void *arg) { return arg; }
2806 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
2808 _pthreads=no
2809 if not hpux ; then
2810 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2811 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2812 cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
2813 done
2816 if test "$_pthreads" = yes ; then
2817 echores "yes (using $_ld_pthread)"
2818 _pthreads='yes'
2819 _def_pthreads='#define HAVE_PTHREADS 1'
2820 _def_threads='#define HAVE_THREADS 1'
2821 else
2822 echores "no (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled)"
2823 _pthreads=''
2824 _def_pthreads='#undef HAVE_PTHREADS'
2825 _nas=no ; _tv_v4l=no ; _macosx=no
2826 if not mingw32 ; then
2827 _win32=no
2832 echocheck "iconv"
2833 if test "$_iconv" = auto ; then
2834 _iconv_tmp='#include <iconv.h>'
2836 cat > $TMPC << EOF
2837 #include <stdio.h>
2838 #include <unistd.h>
2839 $_iconv_tmp
2840 #define INBUFSIZE 1024
2841 #define OUTBUFSIZE 4096
2843 char inbuffer[INBUFSIZE];
2844 char outbuffer[OUTBUFSIZE];
2846 int main(void) {
2847 size_t numread;
2848 iconv_t icdsc;
2849 char *tocode="UTF-8";
2850 char *fromcode="cp1250";
2851 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
2852 while ((numread = read (0, inbuffer, INBUFSIZE))) {
2853 char *iptr=inbuffer;
2854 char *optr=outbuffer;
2855 size_t inleft=numread;
2856 size_t outleft=OUTBUFSIZE;
2857 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
2858 != (size_t)(-1)) {
2859 write (1, outbuffer, OUTBUFSIZE - outleft);
2862 if (iconv_close(icdsc) == -1)
2867 _iconv=no
2868 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
2869 cc_check $_ld_lm $_ld_tmp && _ld_iconv="$_ld_tmp" && _iconv=yes && break
2870 done
2872 if test "$_iconv" = yes ; then
2873 _def_iconv='#define USE_ICONV 1'
2874 else
2875 _def_iconv='#undef USE_ICONV'
2877 echores "$_iconv"
2880 echocheck "sys/soundcard.h"
2881 cat > $TMPC << EOF
2882 #include <sys/soundcard.h>
2883 int main(void) { return 0; }
2885 _sys_soundcard=no
2886 cc_check && _sys_soundcard=yes
2887 if test "$_sys_soundcard" = yes ; then
2888 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
2889 _inc_soundcard='#include <sys/soundcard.h>'
2890 else
2891 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
2893 echores "$_sys_soundcard"
2895 if test "$_sys_soundcard" != yes ; then
2896 echocheck "soundcard.h"
2897 cat > $TMPC << EOF
2898 #include <soundcard.h>
2899 int main(void) { return 0; }
2901 _soundcard=no
2902 cc_check && _soundcard=yes
2903 if linux || test "$_ossaudio" != no ; then
2904 # use soundcard.h on Linux, or when OSS support is enabled
2905 echores "$_soundcard"
2906 else
2907 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
2908 echores "$_soundcard, but ignored!"
2909 _soundcard=no
2911 if test "$_soundcard" = yes ; then
2912 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
2913 _inc_soundcard='#include <soundcard.h>'
2914 else
2915 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2917 else
2918 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2922 echocheck "sys/dvdio.h"
2923 cat > $TMPC << EOF
2924 #include <unistd.h>
2925 #include <sys/dvdio.h>
2926 int main(void) { return 0; }
2928 _dvdio=no
2929 cc_check && _dvdio=yes
2930 if test "$_dvdio" = yes ; then
2931 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
2932 else
2933 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
2935 echores "$_dvdio"
2938 echocheck "sys/cdio.h"
2939 cat > $TMPC << EOF
2940 #include <unistd.h>
2941 #include <sys/cdio.h>
2942 int main(void) { return 0; }
2944 _cdio=no
2945 cc_check && _cdio=yes
2946 if test "$_cdio" = yes ; then
2947 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
2948 else
2949 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
2951 echores "$_cdio"
2954 echocheck "linux/cdrom.h"
2955 cat > $TMPC << EOF
2956 #include <sys/types.h>
2957 #include <linux/cdrom.h>
2958 int main(void) { return 0; }
2960 _cdrom=no
2961 cc_check && _cdrom=yes
2962 if test "$_cdrom" = yes ; then
2963 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
2964 else
2965 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
2967 echores "$_cdrom"
2970 echocheck "dvd.h"
2971 cat > $TMPC << EOF
2972 #include <dvd.h>
2973 int main(void) { return 0; }
2975 _dvd=no
2976 cc_check && _dvd=yes
2977 if test "$_dvd" = yes ; then
2978 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
2979 else
2980 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
2982 echores "$_dvd"
2985 echocheck "BSDI dvd.h"
2986 cat > $TMPC << EOF
2987 #include <dvd.h>
2988 int main(void) { return 0; }
2990 _bsdi_dvd=no
2991 cc_check && _bsdi_dvd=yes
2992 if test "$_bsdi_dvd" = yes ; then
2993 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
2994 else
2995 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
2997 echores "$_bsdi_dvd"
3000 echocheck "HPUX SCSI header"
3001 cat > $TMPC << EOF
3002 #include <sys/scsi.h>
3003 int main(void) { return 0; }
3005 _hpux_scsi_h=no
3006 cc_check && _hpux_scsi_h=yes
3007 if test "$_hpux_scsi_h" = yes ; then
3008 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3009 else
3010 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3012 echores "$_hpux_scsi_h"
3015 echocheck "userspace SCSI headers (Solaris)"
3016 cat > $TMPC << EOF
3017 # include <unistd.h>
3018 # include <stropts.h>
3019 # include <sys/scsi/scsi_types.h>
3020 # include <sys/scsi/impl/uscsi.h>
3021 int main(void) { return 0; }
3023 _sol_scsi_h=no
3024 cc_check && _sol_scsi_h=yes
3025 if test "$_sol_scsi_h" = yes ; then
3026 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
3027 else
3028 _def_sol_scsi_h='#undef SOLARIS_USCSI'
3030 echores "$_sol_scsi_h"
3033 echocheck "termcap"
3034 if test "$_termcap" = auto ; then
3035 cat > $TMPC <<EOF
3036 int main(void) { return 0; }
3038 _termcap=no
3039 for _ld_tmp in "-ltermcap" "-ltinfo" ; do
3040 cc_check $_ld_tmp && _ld_termcap="$_ld_tmp" && _termcap=yes && break
3041 done
3043 if test "$_termcap" = yes ; then
3044 _def_termcap='#define USE_TERMCAP 1'
3045 _res_comment="using $_ld_termcap"
3046 else
3047 _def_termcap='#undef USE_TERMCAP'
3049 echores "$_termcap"
3052 echocheck "termios"
3053 if test "$_termios" = auto ; then
3054 cat > $TMPC <<EOF
3055 #include <sys/termios.h>
3056 int main(void) { return 0; }
3058 _termios=auto
3059 cc_check && _termios=yes
3060 _def_termios_h_name='sys/termios.h'
3062 # second test:
3063 if test "$_termios" = auto ; then
3064 cat > $TMPC <<EOF
3065 #include <termios.h>
3066 int main(void) { return 0; }
3068 _termios=no
3069 cc_check && _termios=yes
3070 _def_termios_h_name='termios.h'
3073 if test "$_termios" = yes ; then
3074 _def_termios='#define HAVE_TERMIOS 1'
3075 _def_termios_h='#undef HAVE_TERMIOS_H'
3076 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3078 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3079 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3080 elif test "$_def_termios_h_name" = 'termios.h' ; then
3081 _def_termios_h='#define HAVE_TERMIOS_H 1'
3083 _res_comment="using $_def_termios_h_name"
3084 else
3085 _def_termios='#undef HAVE_TERMIOS'
3086 _def_termios_h_name=''
3087 _termios=no
3089 echores "$_termios"
3092 echocheck "shm"
3093 if test "$_shm" = auto ; then
3094 cat > $TMPC << EOF
3095 #include <sys/types.h>
3096 #include <sys/shm.h>
3097 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3099 _shm=no
3100 cc_check && _shm=yes
3102 if test "$_shm" = yes ; then
3103 _def_shm='#define HAVE_SHM 1'
3104 else
3105 _def_shm='#undef HAVE_SHM'
3107 echores "$_shm"
3110 # XXX: FIXME, add runtime checking
3111 echocheck "linux devfs"
3112 echores "$_linux_devfs"
3115 echocheck "scandir()"
3116 cat > $TMPC << EOF
3117 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3119 _scandir=no
3120 cc_check && _scandir=yes
3121 if test "$_scandir" = yes ; then
3122 _def_scandir='#define HAVE_SCANDIR 1'
3123 else
3124 _def_scandir='#undef HAVE_SCANDIR'
3126 echores "$_scandir"
3129 echocheck "strsep()"
3130 cat > $TMPC << EOF
3131 #include <string.h>
3132 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3134 _strsep=no
3135 cc_check && _strsep=yes
3136 if test "$_strsep" = yes ; then
3137 _def_strsep='#define HAVE_STRSEP 1'
3138 else
3139 _def_strsep='#undef HAVE_STRSEP'
3141 echores "$_strsep"
3143 echocheck "strlcpy()"
3144 cat > $TMPC << EOF
3145 #include <string.h>
3146 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3148 _strlcpy=no
3149 cc_check && _strlcpy=yes
3150 if test "$_strlcpy" = yes ; then
3151 _def_strlcpy='#define HAVE_STRLCPY 1'
3152 else
3153 _def_strlcpy='#undef HAVE_STRLCPY'
3155 echores "$_strlcpy"
3157 echocheck "strlcat()"
3158 cat > $TMPC << EOF
3159 #include <string.h>
3160 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3162 _strlcat=no
3163 cc_check && _strlcat=yes
3164 if test "$_strlcat" = yes ; then
3165 _def_strlcat='#define HAVE_STRLCAT 1'
3166 else
3167 _def_strlcat='#undef HAVE_STRLCAT'
3169 echores "$_strlcat"
3171 echocheck "fseeko()"
3172 cat > $TMPC << EOF
3173 #include <stdio.h>
3174 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3176 _fseeko=no
3177 cc_check && _fseeko=yes
3178 if test "$_fseeko" = yes ; then
3179 _def_fseeko='#define HAVE_FSEEKO 1'
3180 else
3181 _def_fseeko='#undef HAVE_FSEEKO'
3183 echores "$_fseeko"
3185 echocheck "localtime_r()"
3186 cat > $TMPC << EOF
3187 #include <time.h>
3188 int main( void ) { localtime_r(NULL, NULL); }
3190 _localtime_r=no
3191 cc_check && _localtime_r=yes
3192 if test "$_localtime_r" = yes ; then
3193 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3194 else
3195 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3197 echores "$_localtime_r"
3199 echocheck "vsscanf()"
3200 cat > $TMPC << EOF
3201 #include <stdarg.h>
3202 int main(void) { vsscanf(0, 0, 0); return 0; }
3204 _vsscanf=no
3205 cc_check && _vsscanf=yes
3206 if test "$_vsscanf" = yes ; then
3207 _def_vsscanf='#define HAVE_VSSCANF 1'
3208 else
3209 _def_vsscanf='#undef HAVE_VSSCANF'
3211 echores "$_vsscanf"
3214 echocheck "swab()"
3215 cat > $TMPC << EOF
3216 #include <unistd.h>
3217 int main(void) { swab(0, 0, 0); return 0; }
3219 _swab=no
3220 cc_check && _swab=yes
3221 if test "$_swab" = yes ; then
3222 _def_swab='#define HAVE_SWAB 1'
3223 else
3224 _def_swab='#undef HAVE_SWAB'
3226 echores "$_swab"
3228 echocheck "posix select()"
3229 cat > $TMPC << EOF
3230 #include <stdio.h>
3231 #include <stdlib.h>
3232 #include <sys/types.h>
3233 #include <string.h>
3234 #include <sys/time.h>
3235 #include <unistd.h>
3236 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3238 _posix_select=no
3239 cc_check && _posix_select=yes
3240 if test "$_posix_select" = no ; then
3241 _def_no_posix_select='#define HAVE_NO_POSIX_SELECT 1'
3242 else
3243 _def_no_posix_select='#undef HAVE_NO_POSIX_SELECT'
3245 echores "$_posix_select"
3248 echocheck "gettimeofday()"
3249 cat > $TMPC << EOF
3250 #include <stdio.h>
3251 #include <sys/time.h>
3252 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3254 _gettimeofday=no
3255 cc_check && _gettimeofday=yes
3256 if test "$_gettimeofday" = yes ; then
3257 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3258 else
3259 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3261 echores "$_gettimeofday"
3264 echocheck "glob()"
3265 cat > $TMPC << EOF
3266 #include <stdio.h>
3267 #include <glob.h>
3268 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3270 _glob=no
3271 cc_check && _glob=yes
3272 if test "$_glob" = yes ; then
3273 _def_glob='#define HAVE_GLOB 1'
3274 else
3275 _def_glob='#undef HAVE_GLOB'
3277 echores "$_glob"
3280 echocheck "sys/sysinfo.h"
3281 cat > $TMPC << EOF
3282 #include <sys/sysinfo.h>
3283 int main(void) {
3284 struct sysinfo s_info;
3285 sysinfo(&s_info);
3286 return 0;
3289 _sys_sysinfo=no
3290 cc_check && _sys_sysinfo=yes
3291 if test "$_sys_sysinfo" = yes ; then
3292 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3293 _inc_sysinfo='#include <sys/sysinfo.h>'
3294 else
3295 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3297 echores "$_sys_sysinfo"
3300 echocheck "Mac OS X APIs"
3301 if test "$_macosx" = auto && darwin ; then
3302 productName=`/usr/bin/sw_vers -productName`
3303 if test "$productName" = "Mac OS X" ; then
3304 _macosx=yes
3305 else
3306 _macosx=no
3307 _def_macosx='#undef MACOSX'
3308 _noaomodules="macosx $_noaomodules"
3309 _novomodules="quartz $_novomodules"
3312 if test "$_macosx" = yes ; then
3313 cat > $TMPC <<EOF
3314 #include <Carbon/Carbon.h>
3315 #include <QuickTime/QuickTime.h>
3316 #include <CoreAudio/CoreAudio.h>
3317 int main(void) {
3318 EnterMovies();
3319 ExitMovies();
3320 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3323 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3324 _macosx=yes
3325 _macosx_frameworks="-framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3326 _def_macosx='#define MACOSX 1'
3327 _aosrc="$_aosrc ao_macosx.c"
3328 _aomodules="macosx $_aomodules"
3329 _vosrc="$_vosrc vo_quartz.c"
3330 _vomodules="quartz $_vomodules"
3331 else
3332 _macosx=no
3333 _def_macosx='#undef MACOSX'
3334 _noaomodules="macosx $_noaomodules"
3335 _novomodules="quartz $_novomodules"
3337 cat > $TMPC <<EOF
3338 #include <Carbon/Carbon.h>
3339 #include <QuartzCore/CoreVideo.h>
3340 int main(void) {}
3342 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3343 _vosrc="$_vosrc vo_macosx.m"
3344 _vomodules="macosx $_vomodules"
3345 _macosx_frameworks="$_macosx_frameworks -framework Cocoa -framework QuartzCore -framework OpenGL"
3346 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3347 _macosx_corevideo=yes
3348 else
3349 _novomodules="macosx $_novomodules"
3350 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3351 _macosx_corevideo=no
3354 echores "$_macosx"
3356 echocheck "Mac OS X Finder Support"
3357 if test "$_macosx_finder_support" = auto ; then
3358 _macosx_finder_support=$_macosx
3360 if test "$_macosx_finder_support" = yes; then
3361 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3362 _macosx_finder_support=yes
3363 else
3364 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3365 _macosx_finder_support=no
3367 echores "$_macosx_finder_support"
3369 echocheck "Mac OS X Bundle file locations"
3370 if test "$_macosx_bundle" = auto ; then
3371 _macosx_bundle=$_macosx_finder_support
3373 if test "$_macosx_bundle" = yes; then
3374 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3375 else
3376 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3377 _macosx_bundle=no
3379 echores "$_macosx_bundle"
3381 echocheck "Samba support (libsmbclient)"
3382 if test "$_smbsupport" = yes; then
3383 _ld_smb="-lsmbclient"
3385 if test "$_smbsupport" = auto; then
3386 _smbsupport=no
3387 cat > $TMPC << EOF
3388 #include <libsmbclient.h>
3389 int main(void) { smbc_opendir("smb://"); return 0; }
3391 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3392 cc_check $_ld_tmp && _ld_smb="$_ld_tmp" && _smbsupport=yes && break
3393 done
3396 if test "$_smbsupport" = yes; then
3397 _def_smbsupport="#define LIBSMBCLIENT"
3398 _inputmodules="smb $_inputmodules"
3399 else
3400 _def_smbsupport="#undef LIBSMBCLIENT"
3401 _noinputmodules="smb $_noinputmodules"
3403 echores "$_smbsupport"
3406 #########
3407 # VIDEO #
3408 #########
3411 echocheck "3dfx"
3412 if test "$_3dfx" = yes ; then
3413 _def_3dfx='#define HAVE_3DFX 1'
3414 _vosrc="$_vosrc vo_3dfx.c"
3415 _vomodules="3dfx $_vomodules"
3416 else
3417 _def_3dfx='#undef HAVE_3DFX'
3418 _novomodules="3dfx $_novomodules"
3420 echores "$_3dfx"
3423 echocheck "tdfxfb"
3424 if test "$_tdfxfb" = yes ; then
3425 _def_tdfxfb='#define HAVE_TDFXFB 1'
3426 _vosrc="$_vosrc vo_tdfxfb.c"
3427 _vomodules="tdfxfb $_vomodules"
3428 else
3429 _def_tdfxfb='#undef HAVE_TDFXFB'
3430 _novomodules="tdfxfb $_novomodules"
3432 echores "$_tdfxfb"
3434 echocheck "tdfxvid"
3435 if test "$_tdfxvid" = yes ; then
3436 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3437 _vosrc="$_vosrc vo_tdfx_vid.c"
3438 _vomodules="tdfx_vid $_vomodules"
3439 else
3440 _def_tdfxvid='#undef HAVE_TDFX_VID'
3441 _novomodules="tdfx_vid $_novomodules"
3443 echores "$_tdfxfb"
3445 echocheck "tga"
3446 if test "$_tga" = yes ; then
3447 _def_tga='#define HAVE_TGA 1'
3448 _vosrc="$_vosrc vo_tga.c"
3449 _vomodules="tga $_vomodules"
3450 else
3451 _def_tga='#undef HAVE_TGA'
3452 _novomodules="tga $_novomodules"
3454 echores "$_tga"
3456 echocheck "DirectFB headers presence"
3457 if test -z "$_inc_directfb" ; then
3458 for I in /usr/include /usr/local/include $_inc_extra; do
3459 if test -d "$I/directfb" && test -f "$I/directfb/directfb.h" ; then
3460 _inc_directfb="-I$I/directfb"
3461 echores "yes (using $_inc_directfb)"
3462 break
3464 if test -d "$I" && test -f "$I/directfb.h" ; then
3465 _inc_directfb="-I$I"
3466 echores "yes (using $_inc_directfb)"
3467 break
3469 done
3470 if test -z "$_inc_directfb" ; then
3471 _directfb=no
3472 echores "not found"
3474 else
3475 echores "yes (using $_inc_directfb)"
3477 if test "$_inc_directfb" = "-I/usr/include" ; then
3478 _inc_directfb=""
3481 echocheck "DirectFB"
3482 if test "$_directfb" = auto ; then
3483 _directfb=no
3484 cat > $TMPC <<EOF
3485 #include <directfb.h>
3486 int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; }
3488 linux && test -c /dev/fb0 && cc_check $_inc_directfb -ldirectfb && _directfb=yes
3491 if test "$_directfb" = yes; then
3492 cat > $TMPC << EOF
3493 #include <directfb_version.h>
3495 dfb_ver = DIRECTFB_MAJOR_VERSION DIRECTFB_MINOR_VERSION DIRECTFB_MICRO_VERSION
3498 if $_cc -E $TMPC $_inc_directfb > "$TMPO"; then
3499 _directfb_version=`sed -n 's/^dfb_ver[^1-9]*\(.*\)/\1/p' "$TMPO" | tr -d '() '`
3500 _def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
3501 if test "$_directfb_version" -ge 913; then
3502 _res_comment="$_directfb_version"
3503 else
3504 _def_directfb_version='#undef DIRECTFBVERSION'
3505 _directfb=no
3506 _res_comment="version >=0.9.13 required"
3508 else
3509 _directfb=no
3510 _res_comment="failed to get version"
3513 echores "$_directfb"
3515 if test "$_directfb" = yes ; then
3516 _def_directfb='#define HAVE_DIRECTFB 1'
3517 if test "$_directfb_version" -ge 913; then
3518 _vosrc="$_vosrc vo_directfb2.c"
3519 _vomodules="directfb $_vomodules"
3520 _ld_directfb='-ldirectfb'
3523 if test "$_directfb_version" -ge 915; then
3524 _vosrc="$_vosrc vo_dfbmga.c"
3525 _vomodules="dfbmga $_vomodules"
3527 else
3528 _def_directfb='#undef HAVE_DIRECTFB'
3529 _novomodules="directfb $_novomodules"
3530 _inc_directfb=""
3534 echocheck "X11 headers presence"
3535 if test -z "$_inc_x11" ; then
3536 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3537 if test -d "$I/X11" && test -f "$I/X11/Xlib.h" ; then
3538 _inc_x11="-I$I"
3539 echores "yes (using $I)"
3540 break
3542 done
3543 if test -z "$_inc_x11" ; then
3544 _x11=no
3545 echores "not found (check if the dev(el) packages are installed)"
3547 else
3548 echores "yes (using $_inc_x11)"
3550 if test "$_inc_x11" = "-I/usr/include" ; then
3551 _inc_x11=""
3555 echocheck "X11"
3556 if test "$_x11" != no ; then
3557 cat > $TMPC <<EOF
3558 #include <X11/Xlib.h>
3559 #include <X11/Xutil.h>
3560 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3562 if test -z "$_x11_paths" ; then
3563 _x11_paths="/usr/X11R6/lib /usr/lib/X11R6 /usr/X11/lib /usr/lib32 /usr/openwin/lib /usr/X11R6/lib64 /usr/lib"
3565 for I in $_x11_paths ; do
3566 _ld_x11="-L$I -lXext -lX11 $_ld_sock $_ld_pthread"
3567 if netbsd; then
3568 _ld_x11="$_ld_x11 -Wl,-R$I"
3570 if test -d "$I" && cc_check $_inc_x11 $_ld_x11 ; then
3571 _x11=yes
3572 break
3574 done
3576 if test "$_x11" = yes ; then
3577 _def_x11='#define HAVE_X11 1'
3578 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3579 _vomodules="x11 xover $_vomodules"
3580 _res_comment="using $I"
3581 else
3582 _x11=no
3583 _def_x11='#undef HAVE_X11'
3584 _inc_x11=''
3585 _ld_x11=''
3586 _novomodules="x11 $_novomodules"
3587 _res_comment="check if the dev(el) packages are installed"
3589 echores "$_x11"
3592 echocheck "DPMS"
3593 _xdpms3=no
3594 _xdpms4=no
3595 if test "$_x11" = yes ; then
3596 cat > $TMPC <<EOF
3597 #include <X11/Xmd.h>
3598 #include <X11/Xlib.h>
3599 #include <X11/Xutil.h>
3600 #include <X11/Xatom.h>
3601 #include <X11/extensions/dpms.h>
3602 int main(void) {
3603 (void) DPMSQueryExtension(0, 0, 0);
3606 cc_check $_inc_x11 -lXdpms $_ld_x11 && _xdpms3=yes
3607 cat > $TMPC <<EOF
3608 #include <X11/Xlib.h>
3609 #include <X11/extensions/dpms.h>
3610 int main(void) {
3611 (void) DPMSQueryExtension(0, 0, 0);
3614 cc_check $_inc_x11 $_ld_x11 && _xdpms4=yes
3616 if test "$_xdpms4" = yes ; then
3617 _def_xdpms='#define HAVE_XDPMS 1'
3618 echores "yes (using Xdpms 4)"
3619 elif test "$_xdpms3" = yes ; then
3620 _def_xdpms='#define HAVE_XDPMS 1'
3621 _ld_x11="-lXdpms $_ld_x11"
3622 echores "yes (using Xdpms 3)"
3623 else
3624 _def_xdpms='#undef HAVE_XDPMS'
3625 echores "no"
3629 echocheck "Xv"
3630 if test "$_x11" = yes && test "$_xv" != no ; then
3631 cat > $TMPC <<EOF
3632 #include <X11/Xlib.h>
3633 #include <X11/extensions/Xvlib.h>
3634 int main(void) {
3635 (void) XvGetPortAttribute(0, 0, 0, 0);
3636 (void) XvQueryPortAttributes(0, 0, 0);
3637 return 0; }
3639 _xv=no
3640 cc_check $_inc_x11 -lXv $_ld_x11 && _xv=yes
3641 else
3642 _xv=no
3644 if test "$_xv" = yes ; then
3645 _def_xv='#define HAVE_XV 1'
3646 _ld_xv='-lXv'
3647 _vosrc="$_vosrc vo_xv.c"
3648 _vomodules="xv $_vomodules"
3649 else
3650 _def_xv='#undef HAVE_XV'
3651 _novomodules="xv $_novomodules"
3653 echores "$_xv"
3656 echocheck "XvMC"
3657 if test "$_x11" = yes && test "$_xv" = yes && test "$_xvmc" != no ; then
3658 _xvmc=no
3659 cat > $TMPC <<EOF
3660 #include <X11/Xlib.h>
3661 #include <X11/extensions/Xvlib.h>
3662 #include <X11/extensions/XvMClib.h>
3663 int main(void) {
3664 (void) XvMCQueryExtension(0,0,0);
3665 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3666 return 0; }
3668 cc_check $_inc_x11 -lXvMC -l$_xvmclib $_ld_xv $_ld_x11 && _xvmc=yes
3670 if test "$_xvmc" = yes ; then
3671 _def_xvmc='#define HAVE_XVMC 1'
3672 _ld_xvmc="-lXvMC -l$_xvmclib"
3673 _vosrc="$_vosrc vo_xvmc.c"
3674 _vomodules="xvmc $_vomodules"
3675 else
3676 _def_xvmc='#undef HAVE_XVMC'
3677 _novomodules="xvmc $_novomodules"
3679 echores "$_xvmc"
3682 echocheck "Xinerama"
3683 if test "$_x11" = yes && test "$_xinerama" != no ; then
3684 cat > $TMPC <<EOF
3685 #include <X11/Xlib.h>
3686 #include <X11/extensions/Xinerama.h>
3687 int main(void) { (void) XineramaIsActive(0); return 0; }
3689 _xinerama=no
3690 cc_check $_inc_x11 -lXinerama $_ld_x11 && _xinerama=yes
3691 else
3692 _xinerama=no
3694 if test "$_xinerama" = yes ; then
3695 _def_xinerama='#define HAVE_XINERAMA 1'
3696 _ld_xinerama='-lXinerama'
3697 else
3698 _def_xinerama='#undef HAVE_XINERAMA'
3700 echores "$_xinerama"
3703 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3704 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3705 # named 'X extensions' or something similar.
3706 # This check may be useful for future mplayer versions (to change resolution)
3707 # If you run into problems, remove '-lXxf86vm'.
3708 echocheck "Xxf86vm"
3709 if test "$_x11" = yes && test "$_vm" = auto ; then
3710 cat > $TMPC <<EOF
3711 #include <X11/Xlib.h>
3712 #include <X11/extensions/xf86vmode.h>
3713 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3715 _vm=no
3716 cc_check $_inc_x11 -lXxf86vm $_ld_x11 && _vm=yes
3718 if test "$_vm" = yes ; then
3719 _def_vm='#define HAVE_XF86VM 1'
3720 _ld_vm='-lXxf86vm'
3721 else
3722 _def_vm='#undef HAVE_XF86VM'
3724 echores "$_vm"
3726 # Check for the presence of special keycodes, like audio control buttons
3727 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3728 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3729 # have these new keycodes.
3730 echocheck "XF86keysym"
3731 if test "$_xf86keysym" = auto; then
3732 _xf86keysym=no
3733 if test "$_x11" = yes ; then
3734 cat > $TMPC <<EOF
3735 #include <X11/Xlib.h>
3736 #include <X11/XF86keysym.h>
3737 int main(void) { return XF86XK_AudioPause; }
3739 cc_check $_inc_x11 $_ld_x11 && _xf86keysym=yes
3742 if test "$_xf86keysym" = yes ; then
3743 _def_xf86keysym='#define HAVE_XF86XK 1'
3744 else
3745 _def_xf86keysym='#undef HAVE_XF86XK'
3747 echores "$_xf86keysym"
3749 echocheck "DGA"
3750 if test "$_x11" = no ; then
3751 _dga=no
3753 # Version 2 is preferred to version 1 if available
3754 if test "$_dga" = auto ; then
3755 cat > $TMPC << EOF
3756 #include <X11/Xlib.h>
3757 #include <X11/extensions/xf86dga.h>
3758 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
3760 _dga=no
3761 cc_check $_inc_x11 -lXxf86dga -lXxf86vm $_ld_x11 && _dga=1
3763 cat > $TMPC << EOF
3764 #include <X11/Xlib.h>
3765 #include <X11/extensions/xf86dga.h>
3766 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
3768 cc_check $_inc_x11 -lXxf86dga $_ld_x11 && _dga=2
3771 _def_dga='#undef HAVE_DGA'
3772 _def_dga2='#undef HAVE_DGA2'
3773 if test "$_dga" = 1 ; then
3774 _def_dga='#define HAVE_DGA 1'
3775 _ld_dga='-lXxf86dga'
3776 _vosrc="$_vosrc vo_dga.c"
3777 _vomodules="dga $_vomodules"
3778 echores "yes (using DGA 1.0)"
3779 elif test "$_dga" = 2 ; then
3780 _def_dga='#define HAVE_DGA 1'
3781 _def_dga2='#define HAVE_DGA2 1'
3782 _ld_dga='-lXxf86dga'
3783 _vosrc="$_vosrc vo_dga.c"
3784 _vomodules="dga $_vomodules"
3785 echores "yes (using DGA 2.0)"
3786 elif test "$_dga" = no ; then
3787 echores "no"
3788 _novomodules="dga $_novomodules"
3789 else
3790 die "DGA version must be 1 or 2"
3794 echocheck "OpenGL"
3795 #Note: this test is run even with --enable-gl since we autodetect $_ld_gl
3796 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
3797 cat > $TMPC << EOF
3798 #include <GL/gl.h>
3799 int main(void) { return 0; }
3801 _gl=no
3802 if cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm ; then
3803 _gl=yes
3804 _ld_gl="-lGL $_ld_dl"
3805 elif cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm $_ld_pthread ; then
3806 _gl=yes
3807 _ld_gl="-lGL $_ld_pthread $_ld_dl"
3808 elif cc_check -lopengl32 ; then
3809 _gl=yes
3810 _gl_win32=yes
3811 _ld_gl="-lopengl32 -lgdi32"
3813 else
3814 _gl=no
3816 if test "$_gl" = yes ; then
3817 _def_gl='#define HAVE_GL 1'
3818 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
3819 if test "$_gl_win32" = yes ; then
3820 _def_gl_win32='#define GL_WIN32 1'
3821 _vosrc="$_vosrc w32_common.c"
3822 _res_comment="win32 version"
3824 _vomodules="opengl $_vomodules"
3825 else
3826 _def_gl='#undef HAVE_GL'
3827 _def_gl_win32='#undef GL_WIN32'
3828 _novomodules="opengl $_novomodules"
3830 echores "$_gl"
3833 echocheck "/dev/mga_vid"
3834 if test "$_mga" = auto ; then
3835 _mga=no
3836 test -c /dev/mga_vid && _mga=yes
3838 if test "$_mga" = yes ; then
3839 _def_mga='#define HAVE_MGA 1'
3840 _vosrc="$_vosrc vo_mga.c"
3841 _vomodules="mga $_vomodules"
3842 else
3843 _def_mga='#undef HAVE_MGA'
3844 _novomodules="mga $_novomodules"
3846 echores "$_mga"
3849 # echocheck "syncfb"
3850 # _syncfb=no
3851 # test "$_mga" = yes && _syncfb=yes
3852 # if test "$_syncfb" = yes ; then
3853 # _def_syncfb='#define HAVE_SYNCFB 1'
3854 # _vosrc="$_vosrc vo_syncfb.c"
3855 # else
3856 # _def_syncfb='#undef HAVE_SYNCFB'
3857 # fi
3858 # echores "$_syncfb"
3861 echocheck "xmga"
3862 if test "$_xmga" = auto ; then
3863 _xmga=no
3864 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
3866 if test "$_xmga" = yes ; then
3867 _def_xmga='#define HAVE_XMGA 1'
3868 _vosrc="$_vosrc vo_xmga.c"
3869 _vomodules="xmga $_vomodules"
3870 else
3871 _def_xmga='#undef HAVE_XMGA'
3872 _novomodules="xmga $_novomodules"
3874 echores "$_xmga"
3877 echocheck "GGI"
3878 if test "$_ggi" = auto ; then
3879 cat > $TMPC << EOF
3880 #include <ggi/ggi.h>
3881 int main(void) { return 0; }
3883 _ggi=no
3884 cc_check -lggi && _ggi=yes
3886 if test "$_ggi" = yes ; then
3887 _def_ggi='#define HAVE_GGI 1'
3888 _ld_ggi='-lggi'
3889 _vosrc="$_vosrc vo_ggi.c"
3890 _vomodules="ggi $_vomodules"
3891 else
3892 _def_ggi='#undef HAVE_GGI'
3893 _novomodules="ggi $_novomodules"
3895 echores "$_ggi"
3897 echocheck "GGI extension: libggiwmh"
3898 if test "$_ggiwmh" = auto ; then
3899 _ggiwmh=no
3900 cat > $TMPC << EOF
3901 #include <ggi/ggi.h>
3902 #include <ggi/wmh.h>
3903 int main(void) { return 0; }
3905 cc_check -lggi -lggiwmh && _ggiwmh=yes
3907 # needed to get right output on obscure combination
3908 # like --disable-ggi --enable-ggiwmh
3909 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
3910 _def_ggiwmh='#define HAVE_GGIWMH 1'
3911 _ld_ggi="$_ld_ggi -lggiwmh"
3912 else
3913 _ggiwmh=no
3914 _def_ggiwmh='#undef HAVE_GGIWMH'
3916 echores "$_ggiwmh"
3919 echocheck "AA"
3920 if test "$_aa" = auto ; then
3921 cat > $TMPC << EOF
3922 #include <aalib.h>
3923 extern struct aa_hardware_params aa_defparams;
3924 extern struct aa_renderparams aa_defrenderparams;
3925 int main(void) {
3926 aa_context *c;
3927 aa_renderparams *p;
3928 (void) aa_init(0, 0, 0);
3929 c = aa_autoinit(&aa_defparams);
3930 p = aa_getrenderparams();
3931 aa_autoinitkbd(c,0);
3932 return 0; }
3934 _aa=no
3935 for _ld_tmp in "-laa" "$_ld_x11 -laa" ; do
3936 cc_check $_ld_tmp && _ld_aa=$_ld_tmp && _aa=yes && break
3937 done
3939 if test "$_aa" = yes ; then
3940 _def_aa='#define HAVE_AA 1'
3941 if cygwin ; then
3942 _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6`
3944 _vosrc="$_vosrc vo_aa.c"
3945 _vomodules="aa $_vomodules"
3946 else
3947 _def_aa='#undef HAVE_AA'
3948 _novomodules="aa $_novomodules"
3950 echores "$_aa"
3953 echocheck "CACA"
3954 if test "$_caca" = auto ; then
3955 _caca=no
3956 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3957 cat > $TMPC << EOF
3958 #include <caca.h>
3959 int main(void) { (void) caca_init(); return 0; }
3961 cc_check `caca-config --libs` && _caca=yes
3964 if test "$_caca" = yes ; then
3965 _def_caca='#define HAVE_CACA 1'
3966 _inc_caca=`caca-config --cflags`
3967 _ld_caca=`caca-config --libs`
3968 _vosrc="$_vosrc vo_caca.c"
3969 _vomodules="caca $_vomodules"
3970 else
3971 _def_caca='#undef HAVE_CACA'
3972 _novomodules="caca $_novomodules"
3974 echores "$_caca"
3977 echocheck "SVGAlib"
3978 if test "$_svga" = auto ; then
3979 cat > $TMPC << EOF
3980 #include <vga.h>
3981 int main(void) { return 0; }
3983 _svga=no
3984 cc_check -lvga $_ld_lm && _svga=yes
3986 if test "$_svga" = yes ; then
3987 _def_svga='#define HAVE_SVGALIB 1'
3988 _ld_svga="-lvga"
3989 _vosrc="$_vosrc vo_svga.c"
3990 _vomodules="svga $_vomodules"
3991 else
3992 _def_svga='#undef HAVE_SVGALIB'
3993 _novomodules="svga $_novomodules"
3995 echores "$_svga"
3998 echocheck "FBDev"
3999 if test "$_fbdev" = auto ; then
4000 _fbdev=no
4001 linux && test -c /dev/fb0 && _fbdev=yes
4003 if test "$_fbdev" = yes ; then
4004 _def_fbdev='#define HAVE_FBDEV 1'
4005 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
4006 _vomodules="fbdev $_vomodules"
4007 else
4008 _def_fbdev='#undef HAVE_FBDEV'
4009 _novomodules="fbdev $_novomodules"
4011 echores "$_fbdev"
4015 echocheck "DVB"
4016 if test "$_dvb" != no ; then
4017 _dvb=no
4018 cat >$TMPC << EOF
4019 #include <sys/poll.h>
4020 #include <sys/ioctl.h>
4021 #include <stdio.h>
4022 #include <time.h>
4023 #include <unistd.h>
4025 #include <ost/dmx.h>
4026 #include <ost/frontend.h>
4027 #include <ost/sec.h>
4028 #include <ost/video.h>
4029 #include <ost/audio.h>
4030 int main(void) {return 0;}
4032 if cc_check ; then
4033 _dvb=yes
4034 else
4035 for I in "$_inc_dvb" "-I/usr/src/DVB/ost/include" ; do
4036 if cc_check "$I" ; then
4037 _dvb=yes
4038 _inc_dvb="$I"
4039 _res_comment="using $_inc_dvb"
4040 break
4042 done
4043 test "$_dvb" = no && _res_comment="specify path to DVB/ost/include with --with-dvbincdir=DIR"
4046 echores "$_dvb"
4047 if test "$_dvb" = yes ; then
4048 _def_dvb='#define HAVE_DVB 1'
4049 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4050 _aomodules="mpegpes(dvb) $_aomodules"
4051 _vomodules="mpegpes(dvb) $_vomodules"
4053 if test "$_dvbhead" != no ; then
4054 echocheck "DVB HEAD"
4055 if test "$_dvbhead" != no ; then
4056 _dvbhead=no
4058 cat >$TMPC << EOF
4059 #include <sys/poll.h>
4060 #include <sys/ioctl.h>
4061 #include <stdio.h>
4062 #include <time.h>
4063 #include <unistd.h>
4065 #include <linux/dvb/dmx.h>
4066 #include <linux/dvb/frontend.h>
4067 #include <linux/dvb/video.h>
4068 #include <linux/dvb/audio.h>
4069 int main(void) {return 0;}
4071 if cc_check ; then
4072 _dvbhead=yes
4073 else
4074 for I in "$_inc_dvb" "-I/usr/src/DVB/include" ; do
4075 if cc_check "$I" ; then
4076 _dvbhead=yes
4077 _inc_dvb="$I"
4078 _res_comment="using $_inc_dvb"
4079 break
4081 done
4082 test "$_dvbhead" = no && _res_comment="specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR"
4085 echores "$_dvbhead"
4086 if test "$_dvbhead" = yes ; then
4087 _def_dvb='#define HAVE_DVB_HEAD 1'
4088 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4089 _aomodules="mpegpes(dvb) $_aomodules"
4090 _vomodules="mpegpes(dvb) $_vomodules"
4093 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4094 _def_dvb='#undef HAVE_DVB'
4095 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4096 _aomodules="mpegpes(file) $_aomodules"
4097 _vomodules="mpegpes(file) $_vomodules"
4100 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4101 _dvbin=yes
4102 _inputmodules="dvb $_inputmodules"
4103 else
4104 _dvbin=no
4105 _noinputmodules="dvb $_noinputmodules"
4108 echocheck "PNG support"
4109 if test "$_png" = auto ; then
4110 _png=no
4111 if irix ; then
4112 # Don't check for -lpng on irix since it has its own libpng
4113 # incompatible with the GNU libpng
4114 _res_comment="disabled on irix (not GNU libpng)"
4115 else
4116 cat > $TMPC << EOF
4117 #include <png.h>
4118 #include <string.h>
4119 int main(void) {
4120 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4121 printf("libpng: %s\n", png_libpng_ver);
4122 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4125 if cc_check -lpng -lz $_ld_lm ; then
4126 if tmp_run ; then
4127 _png=yes
4128 else
4129 _res_comment="mismatch of library and header versions"
4134 echores "$_png"
4135 if test "$_png" = yes ; then
4136 _def_png='#define HAVE_PNG 1'
4137 _ld_png='-lpng -lz'
4138 _vosrc="$_vosrc vo_png.c"
4139 _vomodules="png $_vomodules"
4140 _mkf_png="yes"
4141 else
4142 _def_png='#undef HAVE_PNG'
4143 _novomodules="png $_novomodules"
4144 _mkf_png="no"
4147 echocheck "JPEG support"
4148 if test "$_jpg" = auto ; then
4149 _jpg=no
4150 cat > $TMPC << EOF
4151 #include <stdio.h>
4152 #include <stdlib.h>
4153 #include <setjmp.h>
4154 #include <string.h>
4155 #include <jpeglib.h>
4156 int main(void) {
4157 return 0;
4160 if cc_check -ljpeg $_ld_lm ; then
4161 if tmp_run ; then
4162 _jpg=yes
4166 echores "$_jpg"
4168 if test "$_jpg" = yes ; then
4169 _def_jpg='#define HAVE_JPEG 1'
4170 _vosrc="$_vosrc vo_jpeg.c"
4171 _vomodules="jpeg $_vomodules"
4172 _ld_jpg="-ljpeg"
4173 _mkf_jpg="yes"
4174 else
4175 _def_jpg='#undef HAVE_JPEG'
4176 _novomodules="jpeg $_novomodules"
4177 _mkf_jpg="no"
4182 echocheck "PNM support"
4183 if test "$_pnm" = yes; then
4184 _def_pnm="#define HAVE_PNM"
4185 _vosrc="$_vosrc vo_pnm.c"
4186 _vomodules="pnm $_vomodules"
4187 else
4188 _def_pnm="#undef HAVE_PNM"
4189 _novomodules="pnm $_novomodules"
4191 echores "$_pnm"
4195 echocheck "md5sum support"
4196 if test "$_md5sum" = yes; then
4197 _def_md5sum="#define HAVE_MD5SUM"
4198 _vosrc="$_vosrc vo_md5sum.c md5sum.c"
4199 _vomodules="md5sum $_vomodules"
4200 else
4201 _def_md5sum="#undef HAVE_MD5SUM"
4202 _novomodules="md5sum $_novomodules"
4204 echores "$_md5sum"
4208 echocheck "GIF support"
4209 # This is to appease people who want to force gif support.
4210 # If it is forced to yes, then we still do checks to determine
4211 # which gif library to use.
4212 if test "$_gif" = yes ; then
4213 _force_gif=yes
4214 _gif=auto
4217 if test "$_gif" = auto ; then
4218 _gif=no
4219 cat > $TMPC << EOF
4220 #include <gif_lib.h>
4221 int main(void) {
4222 return 0;
4225 for _ld_tmp in "-lungif" "-lungif $_ld_x11" "-lgif" "-lgif $_ld_x11" ; do
4226 cc_check $_ld_tmp && tmp_run && _ld_gif="$_ld_tmp" && _gif=yes && break
4227 done
4230 # If no library was found, and the user wants support forced,
4231 # then we force it on with libgif, as this is the safest
4232 # assumption IMHO. (libungif & libregif both create symbolic
4233 # links to libgif. We also assume that no x11 support is needed,
4234 # because if you are forcing this, then you _should_ know what
4235 # you are doing. [ Besides, package maintainers should never
4236 # have compiled x11 deps into libungif in the first place. ] )
4237 # </rant>
4238 # --Joey
4239 if test "$_force_gif" = yes && test "$_gif" = no ; then
4240 _gif=yes
4241 _ld_gif="-lgif"
4244 if test "$_gif" = yes ; then
4245 _def_gif='#define HAVE_GIF 1'
4246 _vosrc="$_vosrc vo_gif89a.c"
4247 _codecmodules="gif $_codecmodules"
4248 _vomodules="gif89a $_vomodules"
4249 _mkf_gif="yes"
4250 _gif="yes (old version, some encoding functions disabled)"
4251 _def_gif_4='#undef HAVE_GIF_4'
4253 cat > $TMPC << EOF
4254 #include <signal.h>
4255 #include <gif_lib.h>
4256 void catch() { exit(1); }
4257 int main(void) {
4258 signal(SIGSEGV, catch); // catch segfault
4259 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4260 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4261 return 0;
4264 if cc_check "$_ld_gif" && tmp_run ; then
4265 _def_gif_4='#define HAVE_GIF_4 1'
4266 _gif="yes"
4268 else
4269 _def_gif='#undef HAVE_GIF'
4270 _def_gif_4='#undef HAVE_GIF_4'
4271 _novomodules="gif89a $_novomodules"
4272 _nocodecmodules="gif $_nocodecmodules"
4273 _mkf_gif="no"
4275 echores "$_gif"
4278 case "$_gif" in yes*)
4279 echocheck "broken giflib workaround"
4280 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4282 cat > $TMPC << EOF
4283 #include <gif_lib.h>
4284 int main(void) {
4285 GifFileType gif;
4286 printf("UserData is at address %p\n", gif.UserData);
4287 return 0;
4290 if cc_check "$_ld_gif" && tmp_run ; then
4291 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4292 echores "disabled"
4293 else
4294 echores "enabled"
4297 esac
4300 echocheck "VESA support"
4301 if test "$_vesa" = auto ; then
4302 cat > $TMPC << EOF
4303 #include <vbe.h>
4304 int main(void) { vbeVersion(); return 0; }
4306 _vesa=no
4307 cc_check -lvbe -llrmi && _vesa=yes
4309 if test "$_vesa" = yes ; then
4310 _def_vesa='#define HAVE_VESA 1'
4311 _ld_vesa="-lvbe -llrmi"
4312 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4313 _vomodules="vesa $_vomodules"
4314 else
4315 _def_vesa='#undef HAVE_VESA'
4316 _novomodules="vesa $_novomodules"
4318 echores "$_vesa"
4320 #################
4321 # VIDEO + AUDIO #
4322 #################
4325 echocheck "SDL"
4326 if test -z "$_sdlconfig" ; then
4327 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4328 _sdlconfig="sdl-config"
4329 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4330 _sdlconfig="sdl11-config"
4331 else
4332 _sdlconfig=false
4335 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4336 cat > $TMPC << EOF
4337 #include <SDL.h>
4338 int main(int argc, char *argv[]) { return 0; }
4340 _sdl=no
4341 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4342 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4343 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4344 if test "$_sdlversion" -gt 116 ; then
4345 if test "$_sdlversion" -lt 121 ; then
4346 _def_sdlbuggy='#define BUGGY_SDL'
4347 else
4348 _def_sdlbuggy='#undef BUGGY_SDL'
4350 _sdl=yes
4351 else
4352 _res_comment=outdated
4357 if test "$_sdl" = yes ; then
4358 _def_sdl='#define HAVE_SDL 1'
4359 if cygwin ; then
4360 _ld_sdl=`$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`
4361 _inc_sdl=`$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`
4362 elif mingw32 ; then
4363 _ld_sdl=`$_sdlconfig --libs | sed s/-mwindows//`
4364 _inc_sdl=`$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`
4365 else
4366 _ld_sdl=`$_sdlconfig --libs`
4367 _inc_sdl=`$_sdlconfig --cflags`
4369 _vosrc="$_vosrc vo_sdl.c"
4370 _vomodules="sdl $_vomodules"
4371 _aosrc="$_aosrc ao_sdl.c"
4372 _aomodules="sdl $_aomodules"
4373 _res_comment="using $_sdlconfig"
4374 else
4375 _def_sdl='#undef HAVE_SDL'
4376 _novomodules="sdl $_novomodules"
4377 _noaomodules="sdl $_noaomodules"
4379 echores "$_sdl"
4381 echocheck "Windows waveout"
4382 if test "$_win32waveout" = auto ; then
4383 cat > $TMPC << EOF
4384 #include <windows.h>
4385 #include <mmsystem.h>
4386 int main(void) { return 0; }
4388 _win32waveout=no
4389 cc_check -lwinmm && _win32waveout=yes
4391 if test "$_win32waveout" = yes ; then
4392 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4393 _ld_win32libs="-lwinmm $_ld_win32libs"
4394 _aosrc="$_aosrc ao_win32.c"
4395 _aomodules="win32 $_aomodules"
4396 else
4397 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4398 _noaomodules="win32 $_noaomodules"
4400 echores "$_win32waveout"
4402 echocheck "Directx"
4403 if test "$_directx" = auto ; then
4404 cat > $TMPC << EOF
4405 #include <windows.h>
4406 #include <ddraw.h>
4407 #include <dsound.h>
4408 int main(void) { return 0; }
4410 _directx=no
4411 cc_check -lgdi32 && _directx=yes
4413 if test "$_directx" = yes ; then
4414 _def_directx='#define HAVE_DIRECTX 1'
4415 _ld_win32libs="-lgdi32 $_ld_win32libs"
4416 _vosrc="$_vosrc vo_directx.c"
4417 _vomodules="directx $_vomodules"
4418 _aosrc="$_aosrc ao_dsound.c"
4419 _aomodules="dsound $_aomodules"
4420 else
4421 _def_directx='#undef HAVE_DIRECTX'
4422 _novomodules="directx $_novomodules"
4423 _noaomodules="dsound $_noaomodules"
4425 echores "$_directx"
4427 echocheck "NAS"
4428 if test "$_nas" = auto ; then
4429 cat > $TMPC << EOF
4430 #include <audio/audiolib.h>
4431 int main(void) { return 0; }
4433 _nas=no
4434 cc_check -laudio $_inc_x11 -lXt $_ld_x11 $_ld_lm && _nas=yes
4436 if test "$_nas" = yes ; then
4437 _def_nas='#define HAVE_NAS 1'
4438 _ld_nas="-laudio -lXt $_ld_x11"
4439 _aosrc="$_aosrc ao_nas.c"
4440 _aomodules="nas $_aomodules"
4441 else
4442 _noaomodules="nas $_noaomodules"
4443 _def_nas='#undef HAVE_NAS'
4445 echores "$_nas"
4447 echocheck "DXR2"
4448 if test "$_dxr2" = auto; then
4449 _dxr2=no
4450 cat > $TMPC << EOF
4451 #include <dxr2ioctl.h>
4452 int main(void) { return 0; }
4454 for _inc_dxr2 in "$_inc_dxr2" \
4455 "-I/usr/local/include/dxr2" \
4456 "-I/usr/include/dxr2"; do
4457 cc_check $_inc_dxr2 && _dxr2=yes && break
4458 done
4460 if test "$_dxr2" = yes; then
4461 _def_dxr2='#define HAVE_DXR2 1'
4462 _vosrc="$_vosrc vo_dxr2.c"
4463 _aosrc="$_aosrc ao_dxr2.c"
4464 _aomodules="dxr2 $_aomodules"
4465 _vomodules="dxr2 $_vomodules"
4466 _res_comment="using $_inc_dxr2"
4467 else
4468 _def_dxr2='#undef HAVE_DXR2'
4469 _noaomodules="dxr2 $_noaomodules"
4470 _novomodules="dxr2 $_novomodules"
4471 _inc_dxr2=""
4473 echores "$_dxr2"
4475 echocheck "DXR3/H+"
4476 if test "$_dxr3" = auto ; then
4477 cat > $TMPC << EOF
4478 #include <linux/em8300.h>
4479 int main(void) { return 0; }
4481 _dxr3=no
4482 cc_check && _dxr3=yes
4484 if test "$_dxr3" = yes ; then
4485 _def_dxr3='#define HAVE_DXR3 1'
4486 _vosrc="$_vosrc vo_dxr3.c"
4487 _vomodules="dxr3 $_vomodules"
4488 else
4489 _def_dxr3='#undef HAVE_DXR3'
4490 _novomodules="dxr3 $_novomodules"
4491 if test "$_mp1e" = auto ; then
4492 # we don't need mp1e
4493 _mp1e=no
4496 echores "$_dxr3"
4498 echocheck "libmp1e"
4499 if test "$_mmx" = no ; then
4500 # mp1e REQUIRES mmx!
4501 _mp1e=no
4503 if test "$_mp1e" != no ; then
4504 _mp1e=yes
4505 _def_mp1e='#define USE_MP1E'
4506 _ld_mp1e='libmp1e/libmp1e.a'
4507 _dep_mp1e='libmp1e/libmp1e.a'
4508 else
4509 _mp1e=no
4510 _def_mp1e='#undef USE_MP1E'
4511 _ld_mp1e=""
4512 _dep_mp1e=''
4514 echores "$_mp1e"
4517 echocheck "libfame"
4518 if test "$_fame" = auto ; then
4519 _fame=no
4520 test "$_dxr2" = yes && _fame=auto
4521 test "$_dxr3" = yes && _fame=auto
4522 test "$_dvb" = yes && _fame=auto
4524 if test "$_fame" = auto ; then
4525 _fame=no
4526 if test -d libfame && test -f libfame/fame.h ; then
4527 # disable fame on cygwin as no sense to port - atmos
4528 cygwin || _fame=yes
4529 else
4530 _res_comment="no fame dir"
4533 echores "$_fame"
4535 _def_fame='#undef USE_LIBFAME'
4536 if test "$_fame" = yes ; then
4537 _def_fame='#define USE_LIBFAME 1'
4538 _ld_fame='libfame/libfame.a'
4542 #########
4543 # AUDIO #
4544 #########
4547 echocheck "OSS Audio"
4548 if test "$_ossaudio" = auto ; then
4549 cat > $TMPC << EOF
4550 #include <sys/ioctl.h>
4551 $_inc_soundcard
4552 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4554 _ossaudio=no
4555 cc_check && _ossaudio=yes
4557 if test "$_ossaudio" = yes ; then
4558 _def_ossaudio='#define USE_OSS_AUDIO 1'
4559 _aosrc="$_aosrc ao_oss.c"
4560 _aomodules="oss $_aomodules"
4561 if test "$_linux_devfs" = yes; then
4562 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4563 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4564 else
4565 cat > $TMPC << EOF
4566 #include <sys/ioctl.h>
4567 $_inc_soundcard
4568 #ifdef OPEN_SOUND_SYSTEM
4569 int main(void) { return 0; }
4570 #else
4571 #error Not the real thing
4572 #endif
4574 _real_ossaudio=no
4575 cc_check && _real_ossaudio=yes
4576 if test "$_real_ossaudio" = yes; then
4577 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4578 elif netbsd || openbsd ; then
4579 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4580 _ld_arch="$_ld_arch -lossaudio"
4581 else
4582 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4584 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4586 else
4587 _def_ossaudio='#undef USE_OSS_AUDIO'
4588 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4589 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4590 _noaomodules="oss $_noaomodules"
4592 echores "$_ossaudio"
4595 echocheck "aRts"
4596 if test "$_arts" = auto ; then
4597 _arts=no
4598 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4600 cat > $TMPC << EOF
4601 #include <artsc.h>
4602 int main(void) { return 0; }
4604 cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes
4609 if test "$_arts" = yes ; then
4610 _def_arts='#define USE_ARTS 1'
4611 _aosrc="$_aosrc ao_arts.c"
4612 _aomodules="arts $_aomodules"
4613 _ld_arts=`artsc-config --libs`
4614 _inc_arts=`artsc-config --cflags`
4615 else
4616 _noaomodules="arts $_noaomodules"
4618 echores "$_arts"
4621 echocheck "EsounD"
4622 if test "$_esd" = auto ; then
4623 _esd=no
4624 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4626 cat > $TMPC << EOF
4627 #include <esd.h>
4628 int main(void) { return 0; }
4630 cc_check `esd-config --libs` `esd-config --cflags` && tmp_run && _esd=yes
4634 echores "$_esd"
4636 if test "$_esd" = yes ; then
4637 _def_esd='#define USE_ESD 1'
4638 _aosrc="$_aosrc ao_esd.c"
4639 _aomodules="esd $_aomodules"
4640 _ld_esd=`esd-config --libs`
4641 _inc_esd=`esd-config --cflags`
4643 echocheck "esd_get_latency()"
4644 cat > $TMPC << EOF
4645 #include <esd.h>
4646 int main(void) { return esd_get_latency(0); }
4648 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4649 echores "$_esd_latency"
4650 else
4651 _def_esd='#undef USE_ESD'
4652 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4653 _noaomodules="esd $_noaomodules"
4656 echocheck "Polyp"
4657 if test "$_polyp" = auto ; then
4658 _polyp=no
4659 if ( pkg-config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ) >> "$TMPLOG" 2>&1 ; then
4661 cat > $TMPC << EOF
4662 #include <polyp/polyplib.h>
4663 #include <polyp/mainloop.h>
4664 #include <polyp/polyplib-error.h>
4665 int main(void) { return 0; }
4667 cc_check `pkg-config --libs --cflags polyplib polyplib-error polyplib-mainloop` && tmp_run && _polyp=yes
4671 echores "$_polyp"
4673 if test "$_polyp" = yes ; then
4674 _def_polyp='#define USE_POLYP 1'
4675 _aosrc="$_aosrc ao_polyp.c"
4676 _aomodules="polyp $_aomodules"
4677 _ld_polyp=`pkg-config --libs polyplib polyplib-error polyplib-mainloop`
4678 _inc_polyp=`pkg-config --cflags polyplib polyplib-error polyplib-mainloop`
4679 else
4680 _def_polyp='#undef USE_POLYP'
4681 _noaomodules="polyp $_noaomodules"
4685 echocheck "JACK"
4686 if test "$_jack" = auto ; then
4687 _jack=yes
4689 cat > $TMPC << EOF
4690 #include <jack/jack.h>
4691 int main(void) { jack_client_new("test"); return 0; }
4693 if cc_check -ljack ; then
4694 _ld_jack="-ljack"
4695 elif cc_check `pkg-config --libs --cflags --silence-errors jack` ; then
4696 _ld_jack="`pkg-config --libs jack`"
4697 _inc_jack="`pkg-config --cflags jack`"
4698 else
4699 _jack=no
4703 if test "$_jack" = yes ; then
4704 _def_jack='#define USE_JACK 1'
4705 _aosrc="$_aosrc ao_jack.c"
4706 _aomodules="jack $_aomodules"
4707 else
4708 _noaomodules="jack $_noaomodules"
4710 echores "$_jack"
4713 echocheck "ALSA audio"
4714 if test "$_alsa" != no ; then
4715 _alsa=no
4716 cat > $TMPC << EOF
4717 #include <sys/asoundlib.h>
4718 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
4719 #error "alsa version != 0.5.x"
4720 #endif
4721 int main(void) { return 0; }
4723 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
4725 cat > $TMPC << EOF
4726 #include <sys/asoundlib.h>
4727 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4728 #error "alsa version != 0.9.x"
4729 #endif
4730 int main(void) { return 0; }
4732 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
4733 cat > $TMPC << EOF
4734 #include <alsa/asoundlib.h>
4735 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
4736 #error "alsa version != 0.9.x"
4737 #endif
4738 int main(void) { return 0; }
4740 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
4742 cat > $TMPC << EOF
4743 #include <sys/asoundlib.h>
4744 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4745 #error "alsa version != 1.0.x"
4746 #endif
4747 int main(void) { return 0; }
4749 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
4750 cat > $TMPC << EOF
4751 #include <alsa/asoundlib.h>
4752 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
4753 #error "alsa version != 1.0.x"
4754 #endif
4755 int main(void) { return 0; }
4757 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
4759 _def_alsa5='#undef HAVE_ALSA5'
4760 _def_alsa9='#undef HAVE_ALSA9'
4761 _def_alsa1x='#undef HAVE_ALSA1X'
4762 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
4763 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
4764 if test "$_alsaver" ; then
4765 _alsa=yes
4766 if test "$_alsaver" = '0.5.x' ; then
4767 _aosrc="$_aosrc ao_alsa5.c"
4768 _aomodules="alsa5 $_aomodules"
4769 _def_alsa5='#define HAVE_ALSA5 1'
4770 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4771 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
4772 elif test "$_alsaver" = '0.9.x-sys' ; then
4773 _aosrc="$_aosrc ao_alsa.c"
4774 _aomodules="alsa $_aomodules"
4775 _def_alsa9='#define HAVE_ALSA9 1'
4776 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4777 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
4778 elif test "$_alsaver" = '0.9.x-alsa' ; then
4779 _aosrc="$_aosrc ao_alsa.c"
4780 _aomodules="alsa $_aomodules"
4781 _def_alsa9='#define HAVE_ALSA9 1'
4782 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4783 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
4784 elif test "$_alsaver" = '1.0.x-sys' ; then
4785 _aosrc="$_aosrc ao_alsa.c"
4786 _aomodules="alsa $_aomodules"
4787 _def_alsa1x="#define HAVE_ALSA1X 1"
4788 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4789 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
4790 elif test "$_alsaver" = '1.0.x-alsa' ; then
4791 _aosrc="$_aosrc ao_alsa.c"
4792 _aomodules="alsa $_aomodules"
4793 _def_alsa1x="#define HAVE_ALSA1X 1"
4794 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4795 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
4796 else
4797 _alsa=no
4798 _res_comment="unknown version"
4800 _ld_alsa="-lasound $_ld_dl $_ld_pthread"
4801 else
4802 _noaomodules="alsa $_noaomodules"
4804 echores "$_alsa"
4807 echocheck "Sun audio"
4808 if test "$_sunaudio" = auto ; then
4809 cat > $TMPC << EOF
4810 #include <sys/types.h>
4811 #include <sys/audioio.h>
4812 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4814 _sunaudio=no
4815 cc_check && _sunaudio=yes
4817 if test "$_sunaudio" = yes ; then
4818 _def_sunaudio='#define USE_SUN_AUDIO 1'
4819 _aosrc="$_aosrc ao_sun.c"
4820 _aomodules="sun $_aomodules"
4821 else
4822 _def_sunaudio='#undef USE_SUN_AUDIO'
4823 _noaomodules="sun $_noaomodules"
4825 echores "$_sunaudio"
4828 echocheck "Sun mediaLib"
4829 if test "$_mlib" = auto ; then
4830 _mlib=no
4831 test -z "$_mlibdir" && _mlibdir=/opt/SUNWmlib
4832 cat > $TMPC << EOF
4833 #include <mlib.h>
4834 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
4836 cc_check -I${_mlibdir}/include -L${_mlibdir}/lib -lmlib && _mlib=yes
4838 if test "$_mlib" = yes ; then
4839 _def_mlib='#define HAVE_MLIB 1'
4840 _inc_mlib=" -I${_mlibdir}/include "
4841 _ld_mlib=" -L${_mlibdir}/lib -R${_mlibdir}/lib -lmlib "
4842 else
4843 _def_mlib='#undef HAVE_MLIB'
4845 echores "$_mlib"
4848 echocheck "SGI audio"
4849 if test "$_sgiaudio" = auto ; then
4850 # check for SGI audio
4851 cat > $TMPC << EOF
4852 #include <dmedia/audio.h>
4853 int main(void) { return 0; }
4855 _sgiaudio=no
4856 cc_check && _sgiaudio=yes
4858 if test "$_sgiaudio" = "yes" ; then
4859 _def_sgiaudio='#define USE_SGI_AUDIO 1'
4860 _ld_sgiaudio='-laudio'
4861 _aosrc="$_aosrc ao_sgi.c"
4862 _aomodules="sgi $_aomodules"
4863 else
4864 _def_sgiaudio='#undef USE_SGI_AUDIO'
4865 _noaomodules="sgi $_noaomodules"
4867 echores "$_sgiaudio"
4870 echocheck "VCD support"
4871 if linux || bsdos || freebsd || netbsd || sunos || darwin ; then
4872 _inputmodules="vcd $_inputmodules"
4873 _def_vcd='#define HAVE_VCD 1'
4874 echores "ok"
4875 else
4876 _def_vcd='#undef HAVE_VCD'
4877 _noinputmodules="vcd $_noinputmodules"
4878 echores "not supported on this OS"
4881 echocheck "DVD support (libmpdvdkit)"
4882 if test "$_dvdkit" = auto ; then
4883 _dvdkit=no
4884 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux; then
4885 test -f "./libmpdvdkit2/Makefile" && _dvdkit=yes
4886 test -f "./libmpdvdkit/Makefile" && _dvdkit=yes
4889 if test "$_dvdkit" = yes ; then
4890 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
4891 if test -f "./libmpdvdkit2/Makefile" ; then
4892 _inputmodules="mpdvdkit2 $_inputmodules"
4893 _dvdread=libmpdvdkit2
4894 _dvdkit2=yes
4895 _dvdkit=no
4896 else
4897 _inputmodules="mpdvdkit $_inputmodules"
4898 _dvdread=libmpdvdkit
4900 else
4901 _noinputmodules="mpdvdkit $_noinputmodules"
4903 _def_dvd_linux='#undef HAVE_LINUX_DVD_STRUCT'
4904 _def_dvd_bsd='#undef HAVE_BSD_DVD_STRUCT'
4905 _dev_dvd_openbsd='#undef HAVE_OPENBSD_DVD_STRUCT'
4906 _def_dvd_darwin='#undef DARWIN_DVD_IOCTL'
4907 if linux || netbsd || openbsd || bsdos ; then
4908 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4909 if openbsd ; then
4910 _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4912 else
4913 if freebsd ; then
4914 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4915 else
4916 if darwin ; then
4917 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4921 else
4922 _noinputmodules="mpdvdkit $_noinputmodules"
4924 if test "$_dvdkit" = yes || test "$_dvdkit2" = yes; then
4925 echores "yes"
4926 else
4927 echores "no"
4930 echocheck "DVD support (libdvdread)"
4931 if test "$_dvdread" = auto ; then
4932 cat > $TMPC << EOF
4933 #include <inttypes.h>
4934 #include <dvdread/dvd_reader.h>
4935 #include <dvdread/ifo_types.h>
4936 #include <dvdread/ifo_read.h>
4937 #include <dvdread/nav_read.h>
4938 int main(void) { return 0; }
4940 _dvdread=no
4941 if test "$_dl" = yes; then
4942 cc_check \
4943 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread $_ld_dl && \
4944 _dvdread=yes
4947 _def_mpdvdkit="#undef USE_MPDVDKIT"
4948 case "$_dvdread" in
4949 yes)
4950 _largefiles=yes
4951 _def_dvdread='#define USE_DVDREAD 1'
4952 _ld_dvdread='-ldvdread'
4953 _inputmodules="dvdread $_inputmodules"
4954 echores "yes"
4957 _def_dvdread='#undef USE_DVDREAD'
4958 _noinputmodules="dvdread $_noinputmodules"
4959 echores "no"
4961 libmpdvdkit)
4962 _largefiles=yes
4963 _def_dvdread='#define USE_DVDREAD 1'
4964 _ld_dvdread='-Llibmpdvdkit -lmpdvdkit'
4965 _noinputmodules="dvdread $_noinputmodules"
4966 _def_mpdvdkit="#define USE_MPDVDKIT 1"
4967 echores "disabled by libmpdvdkit"
4969 libmpdvdkit2)
4970 _largefiles=yes
4971 _def_dvdread='#define USE_DVDREAD 1'
4972 _ld_dvdread='-Llibmpdvdkit2 -lmpdvdkit'
4973 _noinputmodules="dvdread $_noinputmodules"
4974 _def_mpdvdkit="#define USE_MPDVDKIT 2"
4975 echores "disabled by libmpdvdkit2"
4977 esac
4979 # dvdnav disabled, it does not work
4980 # echocheck "DVD support (libdvdnav)"
4981 # if test "$_dvdnav" = yes ; then
4982 # cat > $TMPC <<EOF
4983 # #include <dvdnav.h>
4984 # int main(void) { dvdnav_t *dvd=0; return 0; }
4985 # EOF
4986 # _dvdnav=no
4987 # test -n "$_dvdnavdir" && _legal_dvdnavdir=-L$_dvdnavdir/.libs
4988 # if test -z "$_dvdnavconfig" ; then
4989 # if ( dvdnav-config --version ) >/dev/null 2>&1 ; then
4990 # _dvdnavconfig="dvdnav-config"
4991 # fi
4992 # fi
4993 # test -z "$_dvdnavdir" && test -n "$_dvdnavconfig" && _dvdnavdir=`$_dvdnavconfig --cflags`
4994 # _used_css=
4995 # test "$_dvdkit" = no && test "$_dvdkit2" = no && _used_css=$_ld_css
4996 # cc_check $_inc_extra -I$_dvdnavdir $_legal_dvdnavdir -ldvdnav $_used_css $_ld_dl $_ld_pthread && _dvdnav=yes
4997 # fi
4998 # if test "$_dvdnav" = yes ; then
4999 # _largefiles=yes
5000 # _def_dvdnav='#define USE_DVDNAV 1'
5001 # if test -n "$_legal_dvdnavdir" ; then
5002 # _ld_css="$_ld_css $_legal_dvdnavdir -ldvdnav"
5003 # elif test -n "$_dvdnavconfig" ; then
5004 # _ld_css="$_ld_css `$_dvdnavconfig --libs`"
5005 # else
5006 # _ld_css="$_ld_css -ldvdnav"
5007 # fi
5008 # if test -n "$_dvdnavconfig" ; then
5009 # _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
5010 # _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
5011 # fi
5012 # if test -n "$_dvdnavdir" ; then
5013 # _inc_extra="$_inc_extra -I$_dvdnavdir"
5014 # fi
5015 # _inputmodules="dvdnav $_inputmodules"
5016 # echores "yes"
5017 # else
5018 # _def_dvdnav='#undef USE_DVDNAV'
5019 # _noinputmodules="dvdnav $_noinputmodules"
5020 # echores "no"
5021 # fi
5023 echocheck "cdparanoia"
5024 if test "$_cdparanoia" = auto ; then
5025 cat > $TMPC <<EOF
5026 #include <cdda_interface.h>
5027 #include <cdda_paranoia.h>
5028 // This need a better test. How ?
5029 int main(void) { return 1; }
5031 _cdparanoia=no
5032 for _inc_tmp in "$_inc_cdparanoia" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5033 cc_check $_inc_tmp $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm && _inc_cdparanoia="$_inc_tmp" && _cdparanoia=yes && break
5034 done
5036 if test "$_cdparanoia" = yes ; then
5037 _def_cdparanoia='#define HAVE_CDDA'
5038 _inputmodules="cdda $_inputmodules"
5039 _ld_cdparanoia="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
5040 openbsd && _ld_cdparanoia="$_ld_cdparanoia -lutil"
5041 else
5042 _def_cdparanoia='#undef HAVE_CDDA'
5043 _noinputmodules="cdda $_noinputmodules"
5045 echores "$_cdparanoia"
5048 echocheck "freetype >= 2.0.9"
5050 # freetype depends on iconv
5051 if test "$_iconv" = no ; then
5052 _freetype=no
5053 _res_comment="iconv support needed"
5056 if test "$_freetype" = auto ; then
5057 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5058 cat > $TMPC << EOF
5059 #include <stdio.h>
5060 #include <ft2build.h>
5061 #include FT_FREETYPE_H
5062 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5063 #error "Need FreeType 2.0.9 or newer"
5064 #endif
5065 int main()
5067 FT_Library library;
5068 FT_Int major=-1,minor=-1,patch=-1;
5069 int err=FT_Init_FreeType(&library);
5070 if(err){
5071 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5072 exit(err);
5074 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5075 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5076 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5077 (int)major,(int)minor,(int)patch );
5078 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5079 printf("Library and header version mismatch! Fix it in your distribution!\n");
5080 exit(1);
5082 return 0;
5085 _freetype=no
5086 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && tmp_run && _freetype=yes
5087 else
5088 _freetype=no
5091 if test "$_freetype" = yes ; then
5092 _def_freetype='#define HAVE_FREETYPE'
5093 _inc_freetype=`$_freetypeconfig --cflags`
5094 _ld_freetype=`$_freetypeconfig --libs`
5095 else
5096 _def_freetype='#undef HAVE_FREETYPE'
5098 echores "$_freetype"
5100 if test "$_freetype" = no ; then
5101 _fontconfig=no
5102 _res_comment="freetype support needed"
5104 echocheck "fontconfig"
5105 if test "$_fontconfig" = auto ; then
5106 cat > $TMPC << EOF
5107 #include <stdio.h>
5108 #include <fontconfig/fontconfig.h>
5109 int main()
5111 int err = FcInit();
5112 if(err == FcFalse){
5113 printf("Couldn't initialize fontconfig lib\n");
5114 exit(err);
5116 return 0;
5120 _fontconfig=yes
5121 if cc_check -lfontconfig ; then
5122 _ld_fontconfig="-lfontconfig"
5123 elif cc_check `pkg-config --cflags --libs fontconfig` ; then
5124 _inc_fontconfig=`pkg-config --cflags fontconfig`
5125 _ld_fontconfig=`pkg-config --libs fontconfig`
5126 else
5127 _fontconfig=no
5130 if test "$_fontconfig" = yes ; then
5131 _def_fontconfig='#define HAVE_FONTCONFIG'
5132 else
5133 _def_fontconfig='#undef HAVE_FONTCONFIG'
5135 echores "$_fontconfig"
5137 echocheck "fribidi with charsets"
5138 if test "$_fribidi" = yes ; then
5139 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5140 cat > $TMPC << EOF
5141 #include <stdio.h>
5142 /* workaround for fribidi 0.10.4 and below */
5143 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5144 #include <fribidi/fribidi.h>
5145 int main()
5147 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5148 printf("Fribidi headers are not consistents with the library!\n");
5149 exit(1);
5151 return 0;
5154 _fribidi=no
5155 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && tmp_run && _fribidi=yes
5156 else
5157 _fribidi=no
5160 if test "$_fribidi" = yes ; then
5161 _def_fribidi='#define USE_FRIBIDI'
5162 _inc_fribidi=`$_fribidiconfig --cflags`
5163 _ld_fribidi=`$_fribidiconfig --libs`
5164 else
5165 _def_fribidi='#undef USE_FRIBIDI'
5167 echores "$_fribidi"
5170 echocheck "ENCA"
5171 if test "$_enca" = auto ; then
5172 cat > $TMPC << EOF
5173 #include <enca.h>
5174 int main()
5176 const char **langs;
5177 size_t langcnt;
5178 langs = enca_get_languages(&langcnt);
5179 return 0;
5182 _enca=no
5183 cc_check -lenca $_ld_lm && _enca=yes
5185 if test "$_enca" = yes ; then
5186 _def_enca='#define HAVE_ENCA 1'
5187 _ld_enca='-lenca'
5188 else
5189 _def_enca='#undef HAVE_ENCA'
5191 echores "$_enca"
5194 echocheck "zlib"
5195 cat > $TMPC << EOF
5196 #include <zlib.h>
5197 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5199 _zlib=no
5200 cc_check -lz && _zlib=yes
5201 if test "$_zlib" = yes ; then
5202 _def_zlib='#define HAVE_ZLIB 1'
5203 _ld_zlib='-lz'
5204 else
5205 _def_zlib='#undef HAVE_ZLIB'
5207 echores "$_zlib"
5210 echocheck "RTC"
5211 if test "$_rtc" = auto ; then
5212 cat > $TMPC << EOF
5213 #include <sys/ioctl.h>
5214 #ifdef __linux__
5215 #include <linux/rtc.h>
5216 #else
5217 #include <rtc.h>
5218 #define RTC_PIE_ON RTCIO_PIE_ON
5219 #endif
5220 int main(void) { return RTC_PIE_ON; }
5222 _rtc=no
5223 cc_check && _rtc=yes
5225 if test "$_rtc" = yes ; then
5226 _def_rtc='#define HAVE_RTC 1'
5227 else
5228 _def_rtc='#undef HAVE_RTC'
5230 echores "$_rtc"
5233 echocheck "external liblzo support"
5234 if test "$_liblzo" = auto ; then
5235 _liblzo=no
5236 cat > $TMPC << EOF
5237 #include <lzo1x.h>
5238 int main(void) { lzo_init();return 0; }
5240 cc_check -llzo && _liblzo=yes
5242 if test "$_liblzo" = yes ; then
5243 _def_liblzo='#define USE_LIBLZO 1'
5244 _ld_liblzo='-llzo'
5245 _codecmodules="liblzo $_codecmodules"
5246 else
5247 _def_liblzo='#undef USE_LIBLZO'
5248 _nocodecmodules="liblzo $_nocodecmodules"
5250 echores "$_liblzo"
5253 echocheck "mad support"
5254 if test "$_mad" = auto ; then
5255 _mad=no
5256 cat > $TMPC << EOF
5257 #include <mad.h>
5258 int main(void) { return 0; }
5260 cc_check $_madlibdir -lmad && _mad=yes
5262 if test "$_mad" = yes ; then
5263 _def_mad='#define USE_LIBMAD 1'
5264 _ld_mad='-lmad'
5265 _codecmodules="libmad $_codecmodules"
5266 else
5267 _def_mad='#undef USE_LIBMAD'
5268 _nocodecmodules="libmad $_nocodecmodules"
5270 echores "$_mad"
5272 echocheck "Toolame"
5273 if test "$_toolame" = auto ; then
5274 cat > $TMPC <<EOF
5275 #include <toolame.h>
5276 int main(void) { toolame_init(); return 0; }
5278 _toolame=no
5279 _toolame_extraflags=""
5280 _toolame_lib="-ltoolame"
5281 if test -n "$_toolamedir"; then
5282 _toolame_extraflags="-I$_toolamedir -L$_toolamedir"
5284 cc_check $_toolame_extraflags $_toolame_lib $_ld_lm && _toolame=yes
5286 if test "$_toolame" = yes ; then
5287 _def_toolame='#define HAVE_TOOLAME 1'
5288 _codecmodules="$_codecmodules toolame"
5289 else
5290 _def_toolame='#undef HAVE_TOOLAME'
5291 _toolame_lib=""
5292 _nocodecmodules="toolame $_nocodecmodules"
5294 if test "$_toolamedir" ; then
5295 _res_comment="using $_toolamedir"
5297 echores "$_toolame"
5299 echocheck "Twolame"
5300 if test "$_twolame" = auto ; then
5301 cat > $TMPC <<EOF
5302 #include <twolame.h>
5303 int main(void) { twolame_init(); return 0; }
5305 _twolame=no
5306 _twolame_lib="-ltwolame"
5307 cc_check $_twolame_lib $_ld_lm && _twolame=yes
5309 if test "$_twolame" = yes ; then
5310 _def_twolame='#define HAVE_TWOLAME 1'
5311 _codecmodules="$_codecmodules twolame"
5312 else
5313 _def_twolame='#undef HAVE_TWOLAME'
5314 _twolame_lib=""
5315 _nocodecmodules="twolame $_nocodecmodules"
5317 echores "$_twolame"
5319 echocheck "OggVorbis support"
5320 if test "$_tremor_internal" = yes; then
5321 _vorbis=yes
5322 elif test "$_vorbis" = auto; then
5323 _vorbis=no
5324 cat > $TMPC << EOF
5325 #include <vorbis/codec.h>
5326 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5328 cc_check -lvorbis -logg $_ld_lm && _vorbis=yes
5330 if test "$_vorbis" = yes ; then
5331 _def_vorbis='#define HAVE_OGGVORBIS 1'
5332 if test "$_tremor_internal" = yes ; then
5333 # do not set _ld_vorbis as it is resolved separately
5334 # mp3lame support for vorbis is deprecated so don't care
5335 _def_tremor='#define TREMOR 1'
5336 if test "$_tremor_low" = yes ; then
5337 _tremor_flags='-D_LOW_ACCURACY_'
5338 else
5339 _tremor_flags=''
5341 _codecmodules="tremor(internal) $_codecmodules"
5342 elif test "$_tremor" = yes ; then
5343 _def_tremor='#define TREMOR 1'
5344 _ld_vorbis='-lvorbisidec'
5345 _codecmodules="tremor $_codecmodules"
5346 else
5347 _def_tremor='#undef TREMOR'
5348 _ld_vorbis='-lvorbis -logg'
5349 _codecmodules="libvorbis $_codecmodules"
5351 else
5352 _def_vorbis='#undef HAVE_OGGVORBIS'
5353 _def_tremor='#undef TREMOR'
5354 _nocodecmodules="libvorbis $_nocodecmodules"
5356 if test "$_vorbis" = yes -a "$_tremor_internal" = yes -a "$_tremor_low" = yes ; then
5357 _res_comment="internal low accuracy Tremor"
5358 elif test "$_vorbis" = yes -a "$_tremor_internal" = yes ; then
5359 _res_comment="internal Tremor"
5360 elif test "$_vorbis" = yes -a "$_tremor" = yes ; then
5361 _res_comment="Tremor"
5363 echores "$_vorbis"
5365 echocheck "OggTheora support"
5366 if test "$_theora" = auto ; then
5367 _theora=no
5368 if ( pkg-config --exists 'theora' ) >> "$TMPLOG" 2>&1 ; then
5369 cat > $TMPC << EOF
5370 #include <theora/theora.h>
5371 #include <string.h>
5372 int main(void)
5374 /* theora is in flux, make sure that all interface routines and
5375 * datatypes exist and work the way we expect it, so we don't break
5376 * mplayer */
5377 ogg_packet op;
5378 theora_comment tc;
5379 theora_info inf;
5380 theora_state st;
5381 yuv_buffer yuv;
5382 int r;
5383 double t;
5385 theora_info_init (&inf);
5386 theora_comment_init (&tc);
5388 return 0;
5390 /* we don't want to execute this kind of nonsense; just for making sure
5391 * that compilation works... */
5392 memset(&op, 0, sizeof(op));
5393 r = theora_decode_header (&inf, &tc, &op);
5394 r = theora_decode_init (&st, &inf);
5395 t = theora_granule_time (&st, op.granulepos);
5396 r = theora_decode_packetin (&st, &op);
5397 r = theora_decode_YUVout (&st, &yuv);
5398 theora_clear (&st);
5400 return 0;
5403 cc_check `pkg-config --libs --cflags theora` && _theora=yes
5406 if test "$_theora" = yes ; then
5407 _def_theora='#define HAVE_OGGTHEORA 1'
5408 _codecmodules="libtheora $_codecmodules"
5409 _ld_theora=`pkg-config --libs --cflags theora`
5410 else
5411 _def_theora='#undef HAVE_OGGTHEORA'
5412 _nocodecmodules="libtheora $_nocodecmodules"
5414 echores "$_theora"
5416 echocheck "mp3lib support"
5417 if test "$_mp3lib" = yes ; then
5418 _def_mp3lib='#define USE_MP3LIB 1'
5419 _codecmodules="mp3lib $_codecmodules"
5420 else
5421 _def_mp3lib='#undef USE_MP3LIB'
5422 _nocodecmodules="mp3lib $_nocodecmodules"
5424 echores "$_mp3lib"
5426 echocheck "liba52 support"
5427 if test "$_liba52" = yes ; then
5428 _def_liba52='#define USE_LIBA52 1'
5429 _codecmodules="liba52 $_codecmodules"
5430 else
5431 _def_liba52='#undef USE_LIBA52'
5432 _nocodecmodules="liba52 $_nocodecmodules"
5434 echores "$_liba52"
5436 echocheck "libdts support"
5437 if test "$_libdts" = auto ; then
5438 _libdts=no
5439 cat > $TMPC << EOF
5440 #include <inttypes.h>
5441 #include <dts.h>
5442 int main(void) { dts_init (0); return 0; }
5444 cc_check $_inc_libdts $_ld_libdts -ldts $_ld_lm && _libdts=yes
5446 if test "$_libdts" = yes ; then
5447 _def_libdts='#define CONFIG_DTS 1'
5448 _ld_libdts="$_ld_libdts -ldts"
5449 _codecmodules="libdts $_codecmodules"
5450 else
5451 _def_libdts='#undef CONFIG_DTS'
5452 _nocodecmodules="libdts $_nocodecmodules"
5454 echores "$_libdts"
5456 echocheck "libmpeg2 support"
5457 if test "$_libmpeg2" = yes ; then
5458 _def_libmpeg2='#define USE_LIBMPEG2 1'
5459 _codecmodules="libmpeg2 $_codecmodules"
5460 else
5461 _def_libmpeg2='#undef USE_LIBMPEG2'
5462 _nocodecmodules="libmpeg2 $_nocodecmodules"
5464 echores "$_libmpeg2"
5466 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5467 if test "$_musepack" = auto ; then
5468 _musepack=no
5469 cat > $TMPC << EOF
5470 #include <mpcdec/mpcdec.h>
5471 int main(void) {
5472 mpc_streaminfo info;
5473 mpc_decoder decoder;
5474 mpc_decoder_set_streaminfo(&decoder, &info);
5475 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5478 cc_check -lmpcdec $_ld_lm && _musepack=yes
5480 if test "$_musepack" = yes ; then
5481 _def_musepack='#define HAVE_MUSEPACK 1'
5482 _ld_musepack='-lmpcdec'
5483 _codecmodules="musepack $_codecmodules"
5484 else
5485 _def_musepack='#undef HAVE_MUSEPACK'
5486 _nocodecmodules="musepack $_nocodecmodules"
5488 echores "$_musepack"
5491 echocheck "Matroska support"
5492 if test "$_matroska_internal" = yes ; then
5493 _inputmodules="matroska $_inputmodules"
5494 _def_matroska='#define HAVE_MATROSKA 1'
5495 else
5496 _noinputmodules="matroska $_noinputmodules"
5497 _def_matroska='#undef HAVE_MATROSKA'
5499 echores "$_matroska_internal"
5501 echocheck "FAAC (AAC encoder) support"
5502 if test "$_faac" = auto ; then
5503 cat > $TMPC <<EOF
5504 #include <inttypes.h>
5505 #include <faac.h>
5506 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5508 _faac=no
5509 for _ld_tmp in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5510 cc_check -c -O4 $_ld_tmp $_ld_lm && _ld_faac="$_ld_tmp" && _faac=yes && break
5511 done
5513 if test "$_faac" = yes ; then
5514 _def_faac="#define HAVE_FAAC 1"
5515 _codecmodules="faac $_codecmodules"
5516 else
5517 _def_faac="#undef HAVE_FAAC"
5518 _nocodecmodules="faac $_nocodecmodules"
5520 echores "$_faac"
5522 echocheck "internal FAAD2 (AAC) support"
5523 _inc_faad="-I`pwd`/libfaad2"
5524 if test "$_faad_internal" = auto ; then
5525 # the faad check needs a config.h file
5526 if not test -f "config.h" ; then
5527 cat > config.h << EOF
5528 /* C99 lrintf function available */
5529 $_def_lrintf
5532 # internal faad: check if our dear gcc is able to compile it...
5533 cp "`pwd`/libfaad2/cfft.c" $TMPC
5534 if ( cc_check -c -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer -D_GNU_SOURCE $_inc_faad ); then
5535 _faad_internal=yes
5536 else
5537 _faad_internal="no (broken gcc)"
5540 if test "$_faad_internal" = yes ; then
5541 _def_faad_internal="#define USE_INTERNAL_FAAD 1"
5542 _faad_external=no
5543 else
5544 _def_faad_internal="#undef USE_INTERNAL_FAAD"
5545 _inc_faad=
5547 echores "$_faad_internal"
5550 echocheck "external FAAD2 (AAC) support"
5551 if test "$_faad_external" != no ; then
5552 _ld_faad='-lfaad'
5553 _inc_faad="$_inc_extra"
5554 # external faad: check if it's really faad2 :)
5555 if test "$_faad_external" = auto ; then
5556 _faad_external=no
5557 cat > $TMPC << EOF
5558 #include <faad.h>
5559 #ifndef FAAD_MIN_STREAMSIZE
5560 #error Too old version
5561 #endif
5562 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5564 cc_check $_inc_faad $_ld_faad $_ld_lm && _faad_external=yes
5567 echores "$_faad_external"
5569 if test "$_faad_external" = yes; then
5570 _def_faad='#define HAVE_FAAD 1'
5571 _codecmodules="faad2(external) $_codecmodules"
5572 elif test "$_faad_internal" = yes; then
5573 _def_faad='#define HAVE_FAAD 1'
5574 _codecmodules="faad2(internal) $_codecmodules"
5575 else
5576 _def_faad='#undef HAVE_FAAD'
5577 _nocodecmodules="faad2 $_nocodecmodules"
5578 _ld_faad=
5582 echocheck "LADSPA plugin support"
5583 if test "$_ladspa" = auto ; then
5584 cat > $TMPC <<EOF
5585 #include <stdio.h>
5586 #include <ladspa.h>
5587 int main(void) {
5588 const LADSPA_Descriptor *ld = NULL;
5589 return 0;
5592 _ladspa=no
5593 cc_check && _ladspa=yes
5595 if test "$_ladspa" = yes; then
5596 _def_ladspa="#define HAVE_LADSPA"
5597 _afsrc="$_afsrc af_ladspa.c"
5598 _afmodules="ladspa $_afmodules"
5599 else
5600 _def_ladspa="#undef HAVE_LADSPA"
5601 _noafmodules="ladspa $_noafmodules"
5603 echores "$_ladspa"
5606 if test "$_win32" = auto ; then
5607 if x86 ; then
5608 qnx && _win32=no
5609 else
5610 _win32=no # x86 arch only
5614 if test "$_win32" != no ; then
5615 if test -z "$_win32libdir" ; then
5616 for I in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5617 if test -d "$I" ; then
5618 _win32libdir="$I"
5619 break;
5621 done
5625 echocheck "Win32 codec DLL support"
5626 if test "$_win32" = auto ; then
5627 _win32=no
5628 test -n "$_win32libdir" && _win32=yes
5630 if test "$_win32" = yes ; then
5631 _def_win32='#define USE_WIN32DLL 1'
5632 _res_comment="using $_win32libdir"
5633 else
5634 _def_win32='#undef USE_WIN32DLL'
5635 _nocodecmodules="win32 $_nocodecmodules"
5636 _dshow=no
5638 echores "$_win32"
5640 if test "$_win32" != no ; then
5641 _def_win32_loader='#undef WIN32_LOADER'
5642 echocheck "Win32 loader support"
5643 _ld_win32='loader/libloader.a'
5644 _dep_win32='loader/libloader.a'
5645 _codecmodules="win32 $_codecmodules"
5646 if openbsd ; then
5647 x86 && _ld_win32="$_ld_win32 -li386"
5649 if not win32 ; then
5650 _def_win32_loader='#define WIN32_LOADER 1'
5651 echores "yes"
5652 else
5653 _ld_win32libs="$_ld_win32libs -ladvapi32 -lole32"
5654 echores "no (using native windows)"
5658 echocheck "DirectShow"
5659 if false ; then
5661 if test "$_dshow" != no ; then
5662 _dshow=no
5663 # check if compiler supports C++ and C++-libs are installed correctly
5664 cat > "$TMPCPP" << EOF
5665 #include <string>
5666 class myclass {
5667 private: int ret;
5668 public: int myreturn(void);
5670 int myclass::myreturn(void) { ret = 0; return ret ; }
5671 int main(void) { myclass myobject; return myobject.myreturn(); }
5673 if cxx_check && tmp_run ; then
5674 _dshow=yes
5675 echores "yes (C++ is ok)"
5676 else
5677 echores "no"
5678 cat << EOF
5680 Your C++ runtime environment is broken.
5682 Hints: Does $_cc support C++? Do you have you a C++ compiler installed?
5683 Are the C++ libraries correctly installed?
5684 Check for libstdc++ and in (/etc/)ld.so.conf.
5686 If you do not need DirectShow support, you can also use:
5687 ./configure --disable-dshow <your-normal-configure-options>
5688 to disable building the C++ based DirectShow code.
5691 die "$_cc's C++ is broken"
5697 echores "$_dshow"
5699 if test "$_dshow" = yes ; then
5700 _def_dshow='#define USE_DIRECTSHOW 1'
5701 _ld_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5702 _dep_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5703 _codecmodules="dshow/dmo $_codecmodules"
5704 else
5705 _def_dshow='#undef USE_DIRECTSHOW'
5706 _nocodecmodules="dshow/dmo $_nocodecmodules"
5710 echocheck "XAnim DLL"
5711 if test "$_xanim" = auto ; then
5712 _xanim=no
5713 _res_comment="dynamic loader support needed"
5714 if test "$_dl" = yes ; then
5715 _res_comment="no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html"
5716 if test -z "$_xanimlibdir" ; then
5717 for I in "$_libdir/codecs" /usr/local/lib/xanim/mods /usr/lib/xanim/mods /usr/lib/xanim $XANIM_MOD_DIR ; do
5718 if test -d "$I" ; then
5719 _xanimlibdir="$I"
5720 break;
5722 done
5724 test "$_xanimlibdir" && _xanim=yes
5727 if test "$_xanim" = yes ; then
5728 _def_xanim='#define USE_XANIM 1'
5729 _def_xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
5730 _codecmodules="xanim $_codecmodules"
5731 _res_comment="using $_xanimlibdir"
5732 else
5733 _def_xanim='#undef USE_XANIM'
5734 _def_xanim_path='#undef XACODEC_PATH'
5735 _nocodecmodules="xanim $_nocodecmodules"
5737 echores "$_xanim"
5739 echocheck "RealPlayer DLL"
5740 if test "$_real" = auto ; then
5741 _real=no
5742 _res_comment="dynamic loader support needed"
5743 if test "$_dl" = yes || test "$_win32" = yes ; then
5744 # if test "$_dl" = yes ; then
5745 _res_comment="tested only on Linux/FreeBSD/NetBSD/Cygwin/MinGW/Darwin"
5746 if linux || freebsd || netbsd || win32 || darwin ; then
5747 _res_comment="no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html"
5748 if test -z "$_reallibdir" ; then
5749 for I in "$_libdir/codecs" "$_libdir/real" /usr/lib/real \
5750 /usr/lib/RealPlayer{9,8,}/Codecs /usr/local/RealPlayer{9,8,}/Codecs \
5751 /usr/local/lib/RealPlayer{9,8,}/Codecs /opt/RealPlayer{9,8,}/{Real/,}Codecs \
5752 {~,}/Applications/RealOne\ Player.app/Contents/MacOS/Library/Codecs \
5753 "$_win32libdir"; do
5754 if test -d "$I" ; then
5755 _reallibdir="$I"
5756 break
5758 done
5760 test "$_reallibdir" && _real=yes
5764 if test "$_real" = yes ; then
5765 _def_real='#define USE_REALCODECS 1'
5766 _def_real_path="#define REALCODEC_PATH \"$_reallibdir\""
5767 _codecmodules="real $_codecmodules"
5768 _res_comment="using $_reallibdir"
5769 else
5770 _def_real='#undef USE_REALCODECS'
5771 _def_real_path="#undef REALCODEC_PATH"
5772 _nocodecmodules="real $_nocodecmodules"
5774 echores "$_real"
5777 echocheck "LIVE555 Streaming Media libraries"
5778 if test "$_live" = auto && test "$_network" = yes ; then
5779 cat > $TMPCPP << EOF
5780 #include <liveMedia.hh>
5781 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1090195200)
5782 #error Please upgrade to version 2004.07.19 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5783 #endif
5784 int main(void) {}
5787 _live=no
5788 for I in "$_livelibdir" "$_libdir/live" "/usr/lib/live" "/usr/local/live" "/usr/local/lib/live" ; do
5789 cxx_check -I$I/liveMedia/include -I$I/UsageEnvironment/include -I$I/groupsock/include && _livelibdir=$I && _live=yes && break
5790 done
5791 if test "$_live" != yes ; then
5792 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
5793 _live_dist=yes
5797 if test "$_live" = yes && test "$_network" = yes ; then
5798 echores "yes (using $_livelibdir)"
5799 _def_live='#define STREAMING_LIVE555 1'
5800 _live_libs_def="# LIVE555 Streaming Media libraries:
5801 LIVE_LIB_DIR = $_livelibdir
5802 LIVE_LIBS = \$(LIVE_LIB_DIR)/liveMedia/libliveMedia.a
5803 LIVE_LIBS += \$(LIVE_LIB_DIR)/groupsock/libgroupsock.a
5804 LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
5805 LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
5806 LIVE_LIBS += -lstdc++
5807 LIVE_INCLUDES = -I\$(LIVE_LIB_DIR)/liveMedia/include
5808 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/UsageEnvironment/include
5809 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/BasicUsageEnvironment/include
5810 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/groupsock/include"
5811 _ld_live='$(LIVE_LIBS)'
5812 _inputmodules="live555 $_inputmodules"
5813 elif test "$_live_dist" = yes && test "$_network" = yes ; then
5814 echores "yes (using distribution version)"
5815 _live="yes"
5816 _def_live='#define STREAMING_LIVE555 1'
5817 _live_libs_def="# LIVE555 Streaming Media libraries:
5818 LIVE_LIB_DIR = $_livelibdir
5819 LIVE_LIBS = -lliveMedia
5820 LIVE_LIBS += -lgroupsock
5821 LIVE_LIBS += -lUsageEnvironment
5822 LIVE_LIBS += -lBasicUsageEnvironment
5823 LIVE_LIBS += -lstdc++
5824 LIVE_INCLUDES = -I/usr/include/liveMedia
5825 LIVE_INCLUDES += -I/usr/include/UsageEnvironment
5826 LIVE_INCLUDES += -I/usr/include/BasicUsageEnvironment
5827 LIVE_INCLUDES += -I/usr/include/groupsock"
5828 _ld_live='$(LIVE_LIBS)'
5829 _inputmodules="live555 $_inputmodules"
5830 else
5831 echores "no"
5832 _def_live='#undef STREAMING_LIVE555'
5833 _noinputmodules="live555 $_noinputmodules"
5836 echocheck "FFmpeg libavutil (static)"
5837 if test -d libavutil ; then
5838 _libavutil=yes
5839 else
5840 _libavutil=no
5842 echores "$_libavutil"
5844 echocheck "FFmpeg libavcodec (static)"
5845 if test "$_libavcodec" = auto ; then
5846 # Note: static linking is preferred to dynamic linking
5847 _libavcodec=no
5848 _res_comment="see DOCS/HTML/$_doc_lang/codecs.html"
5849 if test -d libavcodec && test -f libavcodec/utils.c ; then
5850 _res_comment="old ffmpeg version, use CVS !"
5851 if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
5852 # check if libavutil is a required
5853 cat > $TMPC << EOF
5854 #include "libavcodec/avcodec.h"
5855 #if LIBAVCODEC_BUILD >= 3211265
5856 #error We need libavutil!
5857 #endif
5858 int main(void) { return 0; }
5861 if cc_check -I. -I./libavutil; then
5862 _libavutil_required="no"
5863 else
5864 _libavutil_required="yes"
5866 _res_comment="libavutil availability does not fit libavcodec version"
5867 if test "$_libavutil_required" = "$_libavutil"; then
5868 _libavcodec="yes"
5869 _res_comment=""
5874 echores "$_libavcodec"
5876 echocheck "FFmpeg libavformat (static)"
5877 if test "$_libavformat" = auto ; then
5878 # Note: static linking is preferred to dynamic linking
5879 _libavformat=no
5880 if test -d libavformat && test -f libavformat/utils.c ; then
5881 _libavformat=yes
5884 echores "$_libavformat"
5886 _def_haveffpostprocess='no'
5887 if test -d libavcodec && test -f libavcodec/libpostproc/postprocess.h ; then
5888 _def_haveffpostprocess='yes'
5891 if test "$_libavcodec" != yes ; then
5892 echocheck "FFmpeg libavcodec (dynamic)"
5893 if test "$_libavcodecso" = auto ; then
5894 _libavcodecso=no
5895 _res_comment="libavcodec.so is broken/obsolete"
5896 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
5897 cat > $TMPC << EOF
5898 #define FF_POSTPROCESS 1
5899 #include <ffmpeg/avcodec.h>
5900 int main(void) {
5901 avcodec_find_encoder_by_name("");
5902 return 0;
5905 if cc_check -lavcodec $_ld_lm ; then
5906 _libavcodecso=yes
5907 _res_comment="using libavcodec.so, but static libavcodec is recommended"
5910 echores "$_libavcodecso"
5913 _def_libavcodec='#undef USE_LIBAVCODEC'
5914 _def_libavcodecso='#undef USE_LIBAVCODEC_SO'
5915 _def_ffpostprocess='#undef FF_POSTPROCESS'
5916 if test "$_libavcodec" = yes ; then
5917 _def_libavcodec='#define USE_LIBAVCODEC 1'
5918 _ld_libavcodec='libavcodec/libavcodec.a'
5919 _dep_libavcodec='libavcodec/libavcodec.a'
5920 _def_ffpostprocess='#define FF_POSTPROCESS 1'
5921 _codecmodules="libavcodec $_codecmodules"
5922 if test "$_libavutil" = yes; then
5923 _ld_libavutil='libavutil/libavutil.a'
5924 _dep_libavutil='libavutil/libavutil.a'
5926 elif test "$_libavcodecso" = yes ; then
5927 _def_libavcodec='#define USE_LIBAVCODEC 1'
5928 _def_libavcodecso='#define USE_LIBAVCODEC_SO 1'
5929 _ld_libavcodec='-lavcodec'
5930 _codecmodules="libavcodec.so $_codecmodules"
5931 else
5932 _nocodecmodules="libavcodec $_nocodecmodules"
5935 _def_libavformat='#undef USE_LIBAVFORMAT'
5936 _def_libavformat_win32='#undef CONFIG_WIN32'
5937 if test "$_libavformat" = yes ; then
5938 _def_libavformat='#define USE_LIBAVFORMAT 1'
5939 _ld_libavformat='libavformat/libavformat.a'
5940 _dep_libavformat='libavformat/libavformat.a'
5941 if win32 ; then
5942 _def_libavformat_win32='#define CONFIG_WIN32 1'
5946 echocheck "amr narrowband"
5947 if test "$_amr_nb" = auto ; then
5948 _amr_nb=no
5949 if test -f libavcodec/amr_float/sp_dec.c ; then
5950 if test "$_libavcodec" = yes ; then
5951 _amr_nb=yes
5952 else
5953 _res_comment="libavcodec (static) is required by amr_nb, sorry"
5957 if test "$_amr_nb" = yes ; then
5958 _def_amr_nb='#define AMR_NB 1'
5959 else
5960 _def_amr_nb='#undef AMR_NB'
5962 echores "$_amr_nb $_echomsg"
5964 echocheck "amr narrowband, fixed point"
5965 if test "$_amr_nb_fixed" = auto ; then
5966 _amr_nb_fixed=no
5967 if test -f libavcodec/amr/dtx_dec.c ; then
5968 if test "$_libavcodec" = yes ; then
5969 if test "$_amr_nb" = no ; then
5970 _amr_nb_fixed=yes
5971 else
5972 _res_comment="disabled by amr_nb"
5974 else
5975 _res_comment="libavcodec (static) is required by amr_nb-fixed, sorry"
5979 if test "$_amr_nb_fixed" = yes ; then
5980 _def_amr_nb='#define AMR_NB 1'
5981 _def_amr_nb_fixed='#define AMR_NB_FIXED 1'
5982 _amr_nb=yes;
5983 else
5984 _def_amr_nb_fixed='#undef AMR_NB_FIXED'
5986 echores "$_amr_nb_fixed"
5988 if test "$_amr_nb" = yes ; then
5989 _codecmodules="amr_nb $_codecmodules"
5990 else
5991 _nocodecmodules="amr_nb $_nocodecmodules"
5994 echocheck "amr wideband"
5995 if test "$_amr_wb" = auto ; then
5996 _amr_wb=no
5997 if test -f libavcodec/amrwb_float/dec_dtx.c ; then
5998 if test "$_libavcodec" = yes ; then
5999 _amr_wb=yes
6000 else
6001 _res_comment="libavcodec (static) is required by amr_wb, sorry"
6005 if test "$_amr_wb" = yes ; then
6006 _def_amr_wb='#define AMR_WB 1'
6007 _codecmodules="amr_wb $_codecmodules"
6008 else
6009 _def_amr_wb='#undef AMR_WB'
6010 _nocodecmodules="amr_wb $_nocodecmodules"
6012 echores "$_amr_wb"
6014 echocheck "libdv-0.9.5+"
6015 if test "$_libdv" = auto ; then
6016 _libdv=no
6017 cat > $TMPC <<EOF
6018 #include <libdv/dv.h>
6019 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6021 cc_check -ldv $_ld_lm && _libdv=yes
6023 if test "$_libdv" = yes ; then
6024 _def_libdv='#define HAVE_LIBDV095 1'
6025 _ld_libdv="-ldv"
6026 _codecmodules="libdv $_codecmodules"
6027 else
6028 _def_libdv='#undef HAVE_LIBDV095'
6029 _nocodecmodules="libdv $_nocodecmodules"
6031 echores "$_libdv"
6033 echocheck "zr"
6034 if test "$_zr" = auto ; then
6035 #36067's seem to identify themselves as 36057PQC's, so the line
6036 #below should work for 36067's and 36057's.
6037 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6038 _zr=yes
6039 else
6040 _zr=no
6043 if test "$_zr" = yes ; then
6044 if test "$_libavcodec" = yes ; then
6045 _def_zr='#define HAVE_ZR 1'
6046 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6047 _vomodules="zr zr2 $_vomodules"
6048 else
6049 _res_comment="libavcodec (static) is required by zr, sorry"
6050 _novomodules="zr $_novomodules"
6051 _def_zr='#undef HAVE_ZR'
6053 else
6054 _def_zr='#undef HAVE_ZR'
6055 _novomodules="zr zr2 $_novomodules"
6057 echores "$_zr"
6059 echocheck "bl"
6060 if test "$_bl" = yes ; then
6061 _def_bl='#define HAVE_BL 1'
6062 _vosrc="$_vosrc vo_bl.c"
6063 _vomodules="bl $_vomodules"
6064 else
6065 _def_bl='#undef HAVE_BL'
6066 _novomodules="bl $_novomodules"
6068 echores "$_bl"
6070 echocheck "XviD"
6071 cat > $TMPC << EOF
6072 #include <xvid.h>
6073 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
6075 _ld_xvid="$_ld_xvid -lxvidcore"
6076 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid $_ld_lm ; then
6077 _xvid=yes
6078 _def_xvid3='#define HAVE_XVID3 1'
6079 _def_xvid4='#undef HAVE_XVID4'
6080 _codecmodules="xvid $_codecmodules"
6081 else
6082 cat > $TMPC << EOF
6083 #include <xvid.h>
6084 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6086 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid $_ld_lm ; then
6087 _xvid=yes
6088 _def_xvid3='#undef HAVE_XVID3'
6089 _def_xvid4='#define HAVE_XVID4 1'
6090 _codecmodules="xvid $_codecmodules"
6091 else
6092 _xvid=no
6093 _ld_xvid=''
6094 _def_xvid3='#undef HAVE_XVID3'
6095 _def_xvid4='#undef HAVE_XVID4'
6096 _nocodecmodules="xvid $_nocodecmodules"
6099 echores "$_xvid"
6101 _xvidcompat=no
6102 _def_decore_xvid='#undef DECORE_XVID'
6103 _def_encore_xvid='#undef ENCORE_XVID'
6104 if test "$_xvid" = yes ; then
6105 echocheck "DivX4 compatibility in XviD"
6106 cat > $TMPC << EOF
6107 #include <divx4.h>
6108 int main(void) { (void) decore(0, 0, 0, 0); return 0; }
6110 cc_check $_ld_lm "$_ld_xvid" && _xvidcompat=yes
6111 echores "$_xvidcompat"
6114 echocheck "x264"
6115 cat > $TMPC << EOF
6116 #include <inttypes.h>
6117 #include <x264.h>
6118 #if X264_BUILD < 36
6119 #error We do not support old versions of x264. Get the latest from SVN.
6120 #endif
6121 int main(void) { x264_encoder_open((void*)0); return 0; }
6123 _ld_x264="$_ld_x264 -lx264 $_ld_pthread"
6124 if test "$_x264" != no && \
6125 ( cc_check $_inc_x264 $_ld_x264 $_ld_lm || \
6126 ( test "$_x11" = yes && cc_check $_inc_x264 $_inc_x11 $_ld_x264 $_ld_x11 $_ld_lm )) ; \
6127 then
6128 _x264=yes
6129 _def_x264='#define HAVE_X264 1'
6130 _codecmodules="x264 $_codecmodules"
6131 else
6132 _x264=no
6133 _ld_x264=''
6134 _def_x264='#undef HAVE_X264'
6135 _nocodecmodules="x264 $_nocodecmodules"
6137 echores "$_x264"
6139 echocheck "DivX4linux/DivX5linux/OpenDivX decore"
6140 # DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
6141 cat > $TMPC << EOF
6142 #include <decore.h>
6143 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_FRAME_311; }
6145 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
6146 _opendivx=no
6147 _ld_decore='-ldivxdecore'
6148 _def_decore='#define NEW_DECORE 1'
6149 _def_divx='#define USE_DIVX'
6150 _def_divx5='#undef DECORE_DIVX5'
6151 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6152 _codecmodules="divx4linux $_codecmodules"
6153 echores "DivX4linux (with libdivxdecore.so)"
6154 else
6155 # if test "$_divx4linux" != no ; then
6156 # DivX5 check
6157 # OdivxPP disabled because of:
6158 # ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
6159 cat > $TMPC << EOF
6160 #include <decore.h>
6161 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_INIT; }
6163 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
6164 _opendivx=no
6165 # _ld_decore='-ldivxdecore opendivx/postprocess.o'
6166 _ld_decore='-ldivxdecore'
6167 _def_decore='#define NEW_DECORE 1'
6168 _def_divx='#define USE_DIVX'
6169 _def_divx5='#define DECORE_DIVX5 1'
6170 # _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
6171 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6172 _codecmodules="divx5linux $_codecmodules"
6173 _nocodecmodules="divx4linux $_nocodecmodules"
6174 echores "DivX5linux (with libdivxdecore.so)"
6175 elif test "$_opendivx" != no ; then
6176 _opendivx=yes
6177 _ld_decore='opendivx/libdecore.a'
6178 _def_decore='#undef NEW_DECORE'
6179 _def_divx='#define USE_DIVX'
6180 _def_divx5='#undef DECORE_DIVX5'
6181 _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
6182 _codecmodules="opendivx $_codecmodules"
6183 _nocodecmodules="divx5linux $_nocodecmodules"
6184 echores "OpenDivX"
6185 elif test "$_xvidcompat" = yes ; then
6186 _opendivx=no
6187 _ld_decore=''
6188 _def_decore='#define NEW_DECORE 1'
6189 _def_divx='#define USE_DIVX 1'
6190 _def_divx5='#undef DECORE_DIVX5'
6191 _def_decore_xvid='#define DECORE_XVID 1'
6192 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6193 _nocodecmodules="opendivx divx5linux divx4linux $_nocodecmodules"
6194 echores "XviD compat."
6195 else
6196 _opendivx=no
6197 _ld_decore=''
6198 _def_decore='#undef NEW_DECORE'
6199 _def_divx='#undef USE_DIVX'
6200 _def_divx5='#undef DECORE_DIVX5'
6201 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6202 _nocodecmodules="opendivx $_nocodecmodules"
6203 echores "no"
6204 fi # DivX5 check
6208 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
6209 if test "$_mencoder" != no ; then
6211 echocheck "libmp3lame (for mencoder)"
6212 _mp3lame=no
6213 _def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
6214 _def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
6215 cat > $TMPC <<EOF
6216 #include <lame/lame.h>
6217 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; }
6219 # Note: libmp3lame usually depends on vorbis
6220 cc_check -lmp3lame $_ld_vorbis $_ld_lm && tmp_run && _mp3lame=yes
6221 if test "$_mp3lame" = yes ; then
6222 _def_mp3lame="#define HAVE_MP3LAME"
6223 _ld_mp3lame="-lmp3lame $_ld_vorbis"
6224 cat > $TMPC << EOF
6225 #include <lame/lame.h>
6226 int main(void) { int p = STANDARD_FAST; return 0; }
6228 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
6229 cat > $TMPC << EOF
6230 #include <lame/lame.h>
6231 int main(void) { int p = MEDIUM_FAST; return 0; }
6233 cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
6234 else
6235 _def_mp3lame='#undef HAVE_MP3LAME'
6237 echores "$_mp3lame"
6240 echocheck "DivX4linux encore (for mencoder)"
6241 cat > $TMPC << EOF
6242 #include <encore2.h>
6243 int main(void) { (void) encore(0, 0, 0, 0); return 0; }
6245 if test "$_divx4linux" != no && cc_check -ldivxencore $_ld_lm ; then
6246 _def_encore='#define HAVE_DIVX4ENCORE 1'
6247 _ld_encore='-ldivxencore'
6248 echores "DivX4linux (with libdivxencore.so)"
6249 elif test "$_xvidcompat" = yes ; then
6250 _def_encore='#define HAVE_DIVX4ENCORE 1'
6251 _ld_encore=''
6252 _def_encore_xvid='#define ENCORE_XVID 1'
6253 echores "XviD compat."
6254 else
6255 _def_encore='#undef HAVE_DIVX4ENCORE'
6256 echores "no"
6261 echocheck "mencoder"
6262 _mencoder_flag='#undef HAVE_MENCODER'
6263 if test "$_mencoder" = yes ; then
6264 _mencoder_flag='#define HAVE_MENCODER'
6266 echores "$_mencoder"
6268 echocheck "fastmemcpy"
6269 # fastmemcpy check is done earlier with tests of CPU & binutils features
6270 if test "$_fastmemcpy" = yes ; then
6271 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6272 else
6273 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6275 echores "$_fastmemcpy"
6277 echocheck "UniquE RAR File Library"
6278 if test "$_unrarlib" = yes ; then
6279 _def_unrarlib='#define USE_UNRARLIB 1'
6280 else
6281 _def_unrarlib='#undef USE_UNRARLIB'
6283 echores "$_unrarlib"
6285 echocheck "TV interface"
6286 if test "$_tv" = yes ; then
6287 _def_tv='#define USE_TV 1'
6288 _inputmodules="tv $_inputmodules"
6289 else
6290 _noinputmodules="tv $_noinputmodules"
6291 _def_tv='#undef USE_TV'
6293 echores "$_tv"
6295 echocheck "EDL support"
6296 if test "$_edl" = yes ; then
6297 _def_edl='#define USE_EDL'
6298 _inputmodules="edl $_inputmodules"
6299 else
6300 _noinputmodules="edl $_noinputmodules"
6301 _def_edl='#undef USE_EDL'
6303 echores "$_edl"
6305 echocheck "*BSD BrookTree 848 TV interface"
6306 if test "$_tv_bsdbt848" = auto ; then
6307 _tv_bsdbt848=no
6308 if test "$_tv" = yes ; then
6309 cat > $TMPC <<EOF
6310 #include <sys/types.h>
6311 #if defined(__NetBSD__)
6312 #include <dev/ic/bt8xx.h>
6313 #else
6314 #include <machine/ioctl_bt848.h>
6315 #endif
6316 int main(void) { return 0; }
6318 cc_check && _tv_bsdbt848=yes
6321 if test "$_tv_bsdbt848" = yes ; then
6322 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6323 _inputmodules="tv-bsdbt848 $_inputmodules"
6324 else
6325 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6326 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6328 echores "$_tv_bsdbt848"
6330 echocheck "Video 4 Linux TV interface"
6331 if test "$_tv_v4l" = auto ; then
6332 _tv_v4l=no
6333 if test "$_tv" = yes && linux ; then
6334 cat > $TMPC <<EOF
6335 #include <stdlib.h>
6336 #include <linux/videodev.h>
6337 int main(void) { return 0; }
6339 cc_check && _tv_v4l=yes
6342 if test "$_tv_v4l" = yes ; then
6343 _def_tv_v4l='#define HAVE_TV_V4L 1'
6344 _inputmodules="tv-v4l $_inputmodules"
6345 else
6346 _noinputmodules="tv-v4l $_noinputmodules"
6347 _def_tv_v4l='#undef HAVE_TV_V4L'
6349 echores "$_tv_v4l"
6352 echocheck "Video 4 Linux 2 TV interface"
6353 if test "$_tv_v4l2" = auto ; then
6354 _tv_v4l2=no
6355 if test "$_tv" = yes && linux ; then
6356 cat > $TMPC <<EOF
6357 #include <stdlib.h>
6358 #include <linux/types.h>
6359 #include <linux/videodev2.h>
6360 int main(void) { return 0; }
6362 cc_check && _tv_v4l2=yes
6365 if test "$_tv_v4l2" = yes ; then
6366 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6367 _inputmodules="tv-v4l2 $_inputmodules"
6368 else
6369 _noinputmodules="tv-v4l2 $_noinputmodules"
6370 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6372 echores "$_tv_v4l2"
6375 echocheck "audio select()"
6376 if test "$_select" = no ; then
6377 _def_select='#undef HAVE_AUDIO_SELECT'
6378 elif test "$_select" = yes ; then
6379 _def_select='#define HAVE_AUDIO_SELECT 1'
6381 echores "$_select"
6384 echocheck "network"
6385 # FIXME network check
6386 if test "$_network" != no ; then
6387 _def_network='#define MPLAYER_NETWORK 1'
6388 _ld_network="$_ld_sock"
6389 _inputmodules="network $_inputmodules"
6390 else
6391 _noinputmodules="network $_noinputmodules"
6392 _def_network='#undef MPLAYER_NETWORK'
6393 _ftp=no
6395 echores "$_network"
6397 echocheck "ftp"
6398 if not beos && test "$_ftp" != no ; then
6399 _def_ftp='#define HAVE_FTP 1'
6400 _inputmodules="ftp $_inputmodules"
6401 else
6402 _noinputmodules="ftp $_noinputmodules"
6403 _def_ftp='#undef HAVE_FTP'
6405 echores "$_ftp"
6407 echocheck "vstream client"
6408 if test "$_vstream" = auto ; then
6409 _vstream=no
6410 cat > $TMPC <<EOF
6411 #include <vstream-client.h>
6412 void vstream_error(const char *format, ... ) {}
6413 int main(void) { vstream_start(); return 0; }
6415 cc_check -lvstream-client && _vstream=yes
6417 if test "$_vstream" = yes ; then
6418 _def_vstream='#define HAVE_VSTREAM 1'
6419 _inputmodules="vstream $_inputmodules"
6420 _ld_vstream='-lvstream-client'
6421 else
6422 _noinputmodules="vstream $_noinputmodules"
6423 _def_vstream='#undef HAVE_VSTREAM'
6425 echores "$_vstream"
6427 # endian testing
6428 echocheck "byte order"
6429 if test "$_big_endian" = auto ; then
6430 cat > $TMPC <<EOF
6431 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6432 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6433 int main(){
6434 char* s = (char*)ascii_name;
6435 return 0;
6438 if cc_check ; then
6439 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6440 _big_endian=yes
6441 else
6442 _big_endian=no
6444 else
6445 echo -n "failed to autodetect byte order, defaulting to "
6448 if test "$_big_endian" = yes ; then
6449 _byte_order='big-endian'
6450 _def_words_endian='#define WORDS_BIGENDIAN 1'
6451 else
6452 _byte_order='little-endian'
6453 _def_words_endian='#undef WORDS_BIGENDIAN'
6455 echores "$_byte_order"
6457 echocheck "OSD menu"
6458 if test "$_menu" = yes ; then
6459 _def_menu='#define HAVE_MENU 1'
6460 else
6461 _def_menu='#undef HAVE_MENU'
6463 echores "$_menu"
6465 # Check to see if they want QTX codecs enabled
6466 echocheck "QTX codecs"
6467 if test "$_qtx" = auto ; then
6468 _qtx=$_win32
6470 if test "$_qtx" = yes ; then
6471 _def_qtx='#define USE_QTX_CODECS 1'
6472 _codecmodules="qtx $_codecmodules"
6473 else
6474 _def_qtx='#undef USE_QTX_CODECS'
6475 _nocodecmodules="qtx $_nocodecmodules"
6477 echores "$_qtx"
6480 echocheck "Subtitles sorting"
6481 if test "$_sortsub" = yes ; then
6482 _def_sortsub='#define USE_SORTSUB 1'
6483 else
6484 _def_sortsub='#undef USE_SORTSUB'
6486 echores "$_sortsub"
6489 echocheck "XMMS inputplugin support"
6490 if test "$_xmms" = yes ; then
6492 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6493 if test -z "$_xmmsplugindir" ; then
6494 _xmmsplugindir=`xmms-config --input-plugin-dir`
6496 if test -z "$_xmmslibdir" ; then
6497 _xmmslibdir=`xmms-config --exec-prefix`/lib
6499 else
6500 if test -z "$_xmmsplugindir" ; then
6501 _xmmsplugindir=/usr/lib/xmms/Input
6503 if test -z "$_xmmslibdir" ; then
6504 _xmmslibdir=/usr/lib
6508 _def_xmms='#define HAVE_XMMS 1'
6509 if darwin ; then
6510 _xmms_lib="${_xmmslibdir}/libxmms.dylib"
6511 else
6512 _xmms_lib="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6514 else
6515 _def_xmms='#undef HAVE_XMMS'
6517 echores "$_xmms"
6519 echocheck "inet6"
6520 if test "$_inet6" = auto ; then
6521 cat > $TMPC << EOF
6522 #include <sys/types.h>
6523 #include <sys/socket.h>
6524 int main(void) { socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6526 _inet6=no
6527 if cc_check ; then
6528 _inet6=yes
6531 if test "$_inet6" = yes ; then
6532 _def_inet6='#define HAVE_AF_INET6 1'
6533 else
6534 _def_inet6='#undef HAVE_AF_INET6'
6536 echores "$_inet6"
6539 echocheck "gethostbyname2"
6540 if test "$_gethostbyname2" = auto ; then
6541 cat > $TMPC << EOF
6542 #include <sys/types.h>
6543 #include <sys/socket.h>
6544 #include <netdb.h>
6545 int main(void) { gethostbyname2("", AF_INET); }
6547 _gethostbyname2=no
6548 if cc_check ; then
6549 _gethostbyname2=yes
6553 if test "$_gethostbyname2" = yes ; then
6554 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6555 else
6556 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6558 echores "$_gethostbyname2"
6560 # --------------- GUI specific tests begin -------------------
6561 echocheck "GUI"
6562 echo "$_gui"
6563 if test "$_gui" = yes ; then
6565 # Required libraries
6566 test "$_png" != yes && die "PNG support required for GUI compilation, please install libpng and libpng-dev packages."
6567 test "$_x11" != yes && die "X11 support required for GUI compilation"
6569 echocheck "XShape extension"
6570 _xshape=no
6571 if test "$_x11" = yes ; then
6572 cat > $TMPC << EOF
6573 #include <X11/Xlib.h>
6574 #include <X11/Xproto.h>
6575 #include <X11/Xutil.h>
6576 #include <X11/extensions/shape.h>
6577 #include <stdlib.h>
6578 int main(void) {
6579 char *name = ":0.0";
6580 Display *wsDisplay;
6581 int exitvar = 0;
6582 int eventbase, errorbase;
6583 if (getenv("DISPLAY"))
6584 name=getenv("DISPLAY");
6585 wsDisplay=XOpenDisplay(name);
6586 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6587 exitvar=1;
6588 XCloseDisplay(wsDisplay);
6589 return exitvar;
6592 cc_check $_inc_x11 $_ld_x11 && _xshape=yes
6594 if test "$_xshape" = yes ; then
6595 _def_xshape='#define HAVE_XSHAPE 1'
6596 else
6597 die "The GUI requires the X11 extension XShape (which was not found)."
6599 echores "$_xshape"
6601 #Check for GTK
6602 if test "$_gtk1" = no ; then
6603 #Check for GTK2 :
6604 echocheck "GTK+ version"
6606 if pkg-config gtk+-2.0 --exists ; then
6607 _gtk=`pkg-config gtk+-2.0 --modversion 2>/dev/null`
6608 _inc_gtk=`pkg-config gtk+-2.0 --cflags 2>/dev/null`
6609 _ld_gtk=`pkg-config gtk+-2.0 --libs 2>/dev/null`
6610 echores "$_gtk"
6612 # Check for GLIB2
6613 if pkg-config glib-2.0 --exists ; then
6614 echocheck "glib version"
6615 _glib=`pkg-config glib-2.0 --modversion 2>/dev/null`
6616 _inc_glib=`pkg-config glib-2.0 --cflags 2>/dev/null`
6617 _ld_glib=`pkg-config glib-2.0 --libs 2>/dev/null`
6618 echores "$_glib"
6620 _def_gui='#define HAVE_NEW_GUI 1'
6621 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
6622 _ld_gui='$(GTKLIB) $(GLIBLIB)'
6623 else
6624 _gtk1=yes
6625 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
6627 else
6628 echo "GTK-2 devel packages were not found, trying GTK 1.2"
6629 _gtk1=yes
6633 if test "$_gtk1" = yes ; then
6634 # Check for old GTK (1.2.x)
6635 echocheck "GTK version"
6636 if test -z "$_gtkconfig" ; then
6637 if ( gtk-config --version ) >/dev/null 2>&1 ; then
6638 _gtkconfig="gtk-config"
6639 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
6640 _gtkconfig="gtk12-config"
6641 else
6642 die "The GUI requires GTK devel packages (which were not found)."
6645 _gtk=`$_gtkconfig --version 2>&1`
6646 _inc_gtk=`$_gtkconfig --cflags 2>&1`
6647 _ld_gtk=`$_gtkconfig --libs 2>&1`
6648 echores "$_gtk (using $_gtkconfig)"
6650 # Check for GLIB
6651 echocheck "glib version"
6652 if test -z "$_glibconfig" ; then
6653 if ( glib-config --version ) >/dev/null 2>&1 ; then
6654 _glibconfig="glib-config"
6655 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
6656 _glibconfig="glib12-config"
6657 else
6658 die "The GUI requires GLib devel packages (which were not found)"
6661 _glib=`$_glibconfig --version 2>&1`
6662 _inc_glib=`$_glibconfig --cflags 2>&1`
6663 _ld_glib=`$_glibconfig --libs 2>&1`
6664 echores "$_glib (using $_glibconfig)"
6666 _def_gui='#define HAVE_NEW_GUI 1'
6667 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
6668 _ld_gui='$(GTKLIB) $(GLIBLIB)'
6671 echo "Creating Gui/config.mak"
6672 cat > Gui/config.mak << EOF
6673 # -------- Generated by configure -----------
6675 GTKINC = $_inc_gtk
6676 GTKLIBS = $_ld_gtk
6677 GLIBINC = $_inc_glib
6678 GLIBLIBS = $_ld_glib
6682 else
6683 _def_gui='#undef HAVE_NEW_GUI'
6684 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
6686 # --------------- GUI specific tests end -------------------
6690 #############################################################################
6692 # Checking for CFLAGS
6693 _stripbinaries=yes
6694 if test "$_profile" != "" || test "$_debug" != "" ; then
6695 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
6696 if test "$_cc_major" -ge "3" ; then
6697 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
6699 _stripbinaries=no
6700 elif test -z "$CFLAGS" ; then
6701 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
6702 # always compile with '-g' if .developer:
6703 if test -f ".developer" ; then
6704 CFLAGS="-g $CFLAGS"
6705 if test "$_crash_debug" = auto && not mingw32 ; then
6706 _crash_debug=yes
6708 _stripbinaries=no
6710 else
6711 _warn_CFLAGS=yes
6714 echocheck "automatic gdb attach"
6715 if test "$_crash_debug" = yes ; then
6716 _def_crash_debug='#define CRASH_DEBUG 1'
6717 else
6718 _def_crash_debug='#undef CRASH_DEBUG'
6719 _crash_debug=no
6721 echores "$_crash_debug"
6723 if darwin ; then
6724 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN"
6725 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
6726 CFLAGS="$CFLAGS -no-cpp-precomp"
6729 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
6730 test "$_altivec" = yes && CFLAGS="$CFLAGS -DCONFIG_DARWIN"
6732 if hpux ; then
6733 # use flag for HPUX missing setenv()
6734 CFLAGS="$CFLAGS -DHPUX"
6736 # Thread support
6737 if linux ; then
6738 CFLAGS="$CFLAGS -D_REENTRANT"
6739 elif bsd ; then
6740 # FIXME bsd needs this so maybe other OS'es
6741 CFLAGS="$CFLAGS -D_THREAD_SAFE"
6743 # 64 bit file offsets?
6744 if test "$_largefiles" = yes || freebsd ; then
6745 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
6746 if test "$_dvdread" = yes ; then
6747 # dvdread support requires this (for off64_t)
6748 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
6752 echocheck "compiler support for -fno-PIC"
6753 if x86; then
6754 cat > $TMPC <<EOF
6755 int main(void) { return 0; }
6757 if cc_check -fno-PIC ; then
6758 CFLAGS="-fno-PIC $CFLAGS"
6759 echores "yes"
6760 else
6761 echores "no"
6763 else
6764 echores "only used for x86"
6767 echocheck "compiler support for noexecstack"
6768 cat > $TMPC <<EOF
6769 int main(void) { return 0; }
6771 if cc_check -Wl,-z,noexecstack ; then
6772 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
6773 echores "yes"
6774 else
6775 echores "no"
6778 echocheck "ftello()"
6779 # if we don't have ftello use the osdep/ compatibility module
6780 cat > $TMPC << EOF
6781 #include <stdio.h>
6782 #include <sys/types.h>
6783 int main (void) { ftello(stdin); return 0; }
6785 _ftello=no
6786 cc_check && _ftello=yes
6787 if test "$_ftello" = yes ; then
6788 _def_ftello='#define HAVE_FTELLO 1'
6789 else
6790 _def_ftello='#undef HAVE_FTELLO'
6792 echores "$_ftello"
6794 # Determine OS dependent libs
6795 if cygwin ; then
6796 _def_confwin32='#define WIN32'
6797 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
6798 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
6799 CFLAGS="$CFLAGS -D__CYGWIN__"
6802 if win32 ; then
6803 _confwin32='TARGET_WIN32 = yes'
6804 else
6805 _confwin32='TARGET_WIN32 = no'
6808 # Dynamic linking flags
6809 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6810 _ld_dl_dynamic=''
6811 bsd && _ld_dl_dynamic='-rdynamic'
6812 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx ; then
6813 _ld_dl_dynamic='-rdynamic'
6816 _ld_arch="$_ld_arch $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6817 bsdos && _ld_arch="$_ld_arch -ldvd"
6818 if netbsd ; then
6819 x86 && _ld_arch="$_ld_arch -li386"
6822 _def_debug='#undef MP_DEBUG'
6823 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
6825 _def_linux='#undef TARGET_LINUX'
6826 linux && _def_linux='#define TARGET_LINUX 1'
6828 # TODO cleanup the VIDIX stuff here
6829 _def_vidix='#define CONFIG_VIDIX 1'
6830 test "$_vidix" = no && _def_vidix='#undef CONFIG_VIDIX'
6831 if test "$_vidix" = yes; then
6832 _vosrc="$_vosrc vo_cvidix.c"
6833 _vomodules="cvidix $_vomodules"
6834 else
6835 _novomodules="cvidix $_novomodules"
6837 if test "$_vidix" = yes && win32; then
6838 _vosrc="$_vosrc vo_winvidix.c"
6839 _vomodules="winvidix $_vomodules"
6840 _ld_win32libs="-lgdi32 $_ld_win32libs"
6841 else
6842 _novomodules="winvidix $_novomodules"
6844 if test "$_vidix" = yes && test "$_x11" = yes; then
6845 _vosrc="$_vosrc vo_xvidix.c"
6846 _vomodules="xvidix $_vomodules"
6847 else
6848 _novomodules="xvidix $_novomodules"
6850 echo Checking for VIDIX ... "$_vidix"
6852 _def_joystick='#undef HAVE_JOYSTICK'
6853 if test "$_joystick" = yes ; then
6854 if linux ; then
6855 # TODO add some check
6856 _def_joystick='#define HAVE_JOYSTICK 1'
6857 else
6858 _joystick="no (unsupported under $system_name)"
6861 echo Checking for joystick ... "$_joystick"
6863 echocheck "lirc"
6864 if test "$_lirc" = auto ; then
6865 _lirc=no
6866 if test -c /dev/lirc -o -c /dev/lirc/0 ; then
6867 cat > $TMPC <<EOF
6868 #include <lirc/lirc_client.h>
6869 int main(void) { return 0; }
6871 cc_check -llirc_client && _lirc=yes
6874 if test "$_lirc" = yes ; then
6875 _def_lirc='#define HAVE_LIRC 1'
6876 _ld_lirc='-llirc_client'
6877 else
6878 _def_lirc='#undef HAVE_LIRC'
6880 echores "$_lirc"
6882 echocheck "lircc"
6883 if test "$_lircc" = auto ; then
6884 _lircc=no
6885 cat > $TMPC <<EOF
6886 #include <lirc/lircc.h>
6887 int main(void) { return 0; }
6889 cc_check -llircc && _lircc=yes
6891 if test "$_lircc" = yes ; then
6892 _def_lircc='#define HAVE_LIRCC 1'
6893 _ld_lircc='-llircc'
6894 else
6895 _def_lircc='#undef HAVE_LIRCC'
6897 echores "$_lircc"
6899 #############################################################################
6900 echo "Creating config.mak"
6901 cat > config.mak << EOF
6902 # -------- Generated by configure -----------
6904 LANG = C
6905 MAN_LANG = $MAN_LANG
6906 TARGET_OS = $system_name
6907 DESTDIR =
6908 prefix = \$(DESTDIR)$_prefix
6909 BINDIR = \$(DESTDIR)$_bindir
6910 DATADIR = \$(DESTDIR)$_datadir
6911 MANDIR = \$(DESTDIR)$_mandir
6912 CONFDIR = \$(DESTDIR)$_confdir
6913 LIBDIR = \$(DESTDIR)$_libdir
6914 # FFmpeg uses libdir instead of LIBDIR
6915 libdir = \$(LIBDIR)
6916 #AR = ar
6917 CC = $_cc
6918 HOST_CC = $_host_cc
6919 AWK = $_awk
6920 RANLIB = $_ranlib
6921 INSTALL = $_install
6922 # OPTFLAGS = -O4 $_profile $_debug $_march $_mcpu $_pipe -fomit-frame-pointer -ffast-math
6923 EXTRA_INC = $_inc_extra
6924 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
6925 STRIPBINARIES = $_stripbinaries
6926 CHARSET = $_charset
6927 HELP_FILE = $_mp_help
6929 PRG = $_prg
6930 PRG_MENCODER = $_prg_mencoder
6932 $_live_libs_def
6934 MPLAYER_NETWORK = $_network
6935 STREAMING_LIVE555 = $_live
6936 MPLAYER_NETWORK_LIB = $_ld_live $_ld_vstream $_ld_network
6937 DVBIN = $_dvbin
6938 VIDIX = $_vidix
6939 CONFIG_PP = yes
6940 CONFIG_MP3LAME = $_mp3lame
6941 LIBMENU = $_menu
6942 I18NLIBS = $_i18n_libs
6943 MATROSKA = $_matroska_internal
6945 OPENDIVX = $_opendivx
6947 MP3LIB = $_mp3lib
6948 LIBA52 = $_liba52
6949 LIBMPEG2 = $_libmpeg2
6950 TREMOR = $_tremor_internal
6951 TREMOR_FLAGS = $_tremor_flags
6953 MUSEPACK = $_musepack
6955 UNRARLIB = $_unrarlib
6956 HAVE_FFPOSTPROCESS = $_def_haveffpostprocess
6957 PNG = $_mkf_png
6958 JPEG = $_mkf_jpg
6959 GIF = $_mkf_gif
6961 EXTRA_LIB = $_ld_extra
6962 Z_LIB = $_ld_static $_ld_zlib
6963 HAVE_MLIB = $_mlib
6964 WIN32_LIB = $_ld_win32libs
6965 STATIC_LIB = $_ld_static
6966 ENCA_LIB = $_ld_enca
6967 HAVE_PTHREADS = $_pthreads
6968 MATH_LIB = $_ld_lm
6970 X11_INC = $_inc_x11
6971 X11DIR = $_ld_x11
6973 HAVE_XVMC_ACCEL = $_xvmc
6975 # for libavcodec:
6976 SRC_PATH=..
6977 LIBPREF=lib
6978 LIBSUF=.a
6979 SLIBPREF=lib
6980 SLIBSUF=.so
6982 # video output
6983 X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
6984 GGI_LIB = $_ld_ggi
6985 MLIB_LIB = $_ld_mlib
6986 MLIB_INC = $_inc_mlib
6987 DXR2_INC = $_inc_dxr2
6988 DVB_INC = $_inc_dvb
6989 PNG_LIB = $_ld_png
6990 JPEG_LIB = $_ld_jpg
6991 GIF_LIB = $_ld_gif
6992 SDL_LIB = $_ld_sdl
6993 SVGA_LIB = $_ld_svga
6994 VESA_LIB = $_ld_vesa
6995 AA_LIB = $_ld_aa
6996 CACA_INC = $_inc_caca
6997 CACA_LIB = $_ld_caca
6999 # audio output
7000 ALSA_LIB = $_ld_alsa
7001 NAS_LIB = $_ld_nas
7002 ARTS_LIB = $_ld_arts
7003 ARTS_INC = $_inc_arts
7004 ESD_LIB = $_ld_esd
7005 ESD_INC = $_inc_esd
7006 POLYP_LIB = $_ld_polyp
7007 POLYP_INC = $_inc_polyp
7008 JACK_LIB = $_ld_jack
7009 JACK_INC = $_inc_jack
7010 SGIAUDIO_LIB = $_ld_sgiaudio
7012 # input/demuxer/codecs
7013 TERMCAP_LIB = $_ld_termcap
7014 LIRC_LIB = $_ld_lirc
7015 LIRCC_LIB = $_ld_lircc
7016 DVDREAD_LIB = $_ld_dvdread
7017 DVDKIT = $_dvdkit
7018 DVDKIT2 = $_dvdkit2
7019 DVDKIT_SHARED = no
7020 SDL_INC = $_inc_sdl
7021 W32_DEP = $_dep_win32
7022 W32_LIB = $_ld_win32
7023 DS_DEP = $_dep_dshow
7024 DS_LIB = $_ld_dshow
7025 AV_DEP = $_dep_libavutil $_dep_libavcodec $_dep_libavformat
7026 AV_LIB = $_ld_libavformat $_ld_libavcodec $_ld_libavutil
7027 CONFIG_LIBAVUTIL = $_libavutil
7028 CONFIG_LIBAVCODEC = $_libavcodec
7029 CONFIG_LIBAVCODECSO = $_libavcodecso
7030 CONFIG_LIBAVFORMAT = $_libavformat
7031 ZORAN = $_zr
7032 FAME = $_fame
7033 FAME_LIB = $_ld_fame
7034 MP1E_DEP = $_dep_mp1e
7035 MP1E_LIB = $_ld_mp1e
7036 ARCH_LIB = $_ld_arch $_ld_iconv
7037 XVID = $_xvid
7038 XVID_INC = $_inc_xvid
7039 XVID_LIB = $_ld_xvid
7040 X264 = $_x264
7041 X264_INC = $_inc_x264
7042 X264_LIB = $_ld_x264
7043 CONFIG_DTS = $_libdts
7044 DTS_INC = $_inc_libdts
7045 DTS_LIB = $_ld_libdts
7046 DECORE_LIB = $_ld_decore $_ld_mp3lame
7047 MENCODER = $_mencoder
7048 ENCORE_LIB = $_ld_encore $_ld_mp3lame
7049 DIRECTFB_INC = $_inc_directfb
7050 DIRECTFB_LIB = $_ld_directfb
7051 CDPARANOIA_INC = $_inc_cdparanoia
7052 CDPARANOIA_LIB = $_ld_cdparanoia
7053 FREETYPE_INC = $_inc_freetype
7054 FREETYPE_LIB = $_ld_freetype
7055 FONTCONFIG_INC = $_inc_fontconfig
7056 FONTCONFIG_LIB = $_ld_fontconfig
7057 FRIBIDI_INC = $_inc_fribidi
7058 FRIBIDI_LIB = $_ld_fribidi
7059 LIBLZO_LIB= $_ld_liblzo
7060 MAD_LIB = $_ld_mad
7061 VORBIS_LIB = $_ld_vorbis $_ld_libdv
7062 THEORA_LIB = $_ld_theora
7063 FAAD_LIB = $_ld_faad
7064 INTERNAL_FAAD = $_faad_internal
7065 SMBSUPPORT_LIB = $_ld_smb
7066 XMMS_PLUGINS = $_xmms
7067 XMMS_LIB = $_xmms_lib
7068 MACOSX = $_macosx
7069 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7070 MACOSX_BUNDLE = $_macosx_bundle
7071 MACOSX_FRAMEWORKS = $_macosx_frameworks
7072 MACOSX_COREVIDEO = $_macosx_corevideo
7073 TOOLAME=$_toolame
7074 TOOLAME_EXTRAFLAGS=$_toolame_extraflags
7075 TOOLAME_LIB=$_toolame_lib
7076 TWOLAME=$_twolame
7077 TWOLAME_LIB=$_twolame_lib
7078 MUSEPACK_LIB = $_ld_musepack
7079 FAAC=$_faac
7080 FAAC_LIB=$_ld_faac
7081 AMR_NB=$_amr_nb
7082 AMR_NB_FIXED=$_amr_nb_fixed
7083 AMR_WB=$_amr_wb
7084 `echo $_libavcodecs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7085 CONFIG_GPL=yes
7087 # --- Some stuff for autoconfigure ----
7088 $_target_arch
7089 $_confwin32
7090 TARGET_CPU=$iproc
7091 TARGET_MMX = $_mmx
7092 TARGET_MMX2 = $_mmx2
7093 TARGET_3DNOW = $_3dnow
7094 TARGET_3DNOWEX = $_3dnowex
7095 TARGET_SSE = $_sse
7096 TARGET_ALTIVEC = $_altivec
7097 TARGET_VIS = $_vis
7099 # --- GUI stuff ---
7100 GTKINC = $_inc_gtk
7101 GTKLIB = $_ld_static $_ld_gtk
7102 GLIBLIB = $_ld_static $_ld_glib
7103 GTK_LIBS = $_ld_static $_ld_gui
7104 GUI = $_gui
7105 DEBUG = -DDEBUG
7109 #############################################################################
7110 echo "Creating config.h"
7111 cat > config.h << EOF
7112 /* -------- This file has been automatically generated by configure ---------
7113 Note: Any changes in it will be lost when you run configure again. */
7115 /* Protect against multiple inclusion */
7116 #ifndef MPLAYER_CONFIG_H
7117 #define MPLAYER_CONFIG_H 1
7119 /* use GNU internationalization */
7120 $_def_i18n
7122 /* Runtime CPU detection */
7123 $_def_runtime_cpudetection
7125 /* Dynamic a/v plugins */
7126 $_def_dynamic_plugins
7128 /* "restrict" keyword */
7129 $_def_restrict_keyword
7131 /* __builtin_expect branch prediction hint */
7132 $_def_builtin_expect
7133 #ifdef HAVE_BUILTIN_EXPECT
7134 #define likely(x) __builtin_expect ((x) != 0, 1)
7135 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7136 #else
7137 #define likely(x) (x)
7138 #define unlikely(x) (x)
7139 #endif
7141 /* attribute(used) as needed by some compilers */
7142 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7143 # define attribute_used __attribute__((used))
7144 #else
7145 # define attribute_used
7146 #endif
7148 #define PREFIX "$_prefix"
7150 #define USE_OSD 1
7151 #define USE_SUB 1
7153 /* enable/disable SIGHANDLER */
7154 $_def_sighandler
7156 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7157 $_def_crash_debug
7159 /* Toggles debugging informations */
7160 $_def_debug
7162 /* Toggles colorized output */
7163 //#define MSG_USE_COLORS 1
7165 /* Indicates that Ogle's libdvdread is available for DVD playback */
7166 $_def_dvdread
7168 /* Indicates that dvdread is from libmpdvdkit */
7169 $_def_mpdvdkit
7171 /* Additional options for libmpdvdkit*/
7172 $_def_dvd
7173 $_def_cdrom
7174 $_def_cdio
7175 $_def_dvdio
7176 $_def_bsdi_dvd
7177 $_def_dvd_bsd
7178 $_def_dvd_linux
7179 $_dev_dvd_openbsd
7180 $_def_dvd_darwin
7181 $_def_sol_scsi_h
7182 $_def_hpux_scsi_h
7183 $_def_stddef
7185 /* Common data directory (for fonts, etc) */
7186 #define MPLAYER_DATADIR "$_datadir"
7187 #define MPLAYER_CONFDIR "$_confdir"
7188 #define MPLAYER_LIBDIR "$_libdir"
7190 /* Define this to compile stream-caching support, it can be enabled via
7191 -cache <kilobytes> */
7192 #define USE_STREAM_CACHE 1
7194 /* Define to include support for XviD/Divx4Linux/OpenDivx */
7195 $_def_divx
7197 /* Define to use the new XviD/DivX4Linux library instead of open source OpenDivX */
7198 /* You have to change DECORE_LIBS in config.mak, too! */
7199 $_def_decore
7201 /* Define if you are using DivX5Linux Decore library */
7202 $_def_divx5
7204 /* Define if you are using XviD library */
7205 $_def_xvid3
7206 $_def_xvid4
7207 $_def_decore_xvid
7208 $_def_encore_xvid
7210 /* Define if you are using the X.264 library */
7211 $_def_x264
7213 /* Define to include support for libdv-0.9.5 */
7214 $_def_libdv
7216 /* If build mencoder */
7217 $_mencoder_flag
7219 /* Indicates if XviD/Divx4linux encore is available
7220 Note: for mencoder */
7221 $_def_encore
7223 /* Indicates if libmp3lame is available
7224 Note: for mencoder */
7225 $_def_mp3lame
7226 $_def_mp3lame_preset
7227 $_def_mp3lame_preset_medium
7229 /* Define libmp1e for realtime mpeg encoding (for DXR3 and DVB cards) */
7230 $_def_mp1e
7232 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7233 (use -bps or -nobps commandline option for run-time method selection)
7234 -bps gives better sync for vbr mp3 audio, it is now default */
7235 #define AVI_SYNC_BPS 1
7237 /* Undefine this if you do not want to select mono audio (left or right)
7238 with a stereo MPEG layer 2/3 audio stream. The command line option
7239 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7240 right-only), with 0 being the default.
7242 #define USE_FAKE_MONO 1
7244 /* Undefine this if your sound card driver has no working select().
7245 If you have kernel Oops, player hangups, or just no audio, you should
7246 try to recompile MPlayer with this option disabled! */
7247 $_def_select
7249 /* define this to use iconv(3) function to codepage conversions */
7250 $_def_iconv
7252 /* define this to use nl_langinfo function */
7253 $_def_langinfo
7255 /* define this to use RTC (/dev/rtc) for video timers */
7256 $_def_rtc
7258 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7259 #define MAX_OUTBURST 65536
7261 /* set up audio OUTBURST. Do not change this! */
7262 #define OUTBURST 512
7264 /* Define this if your system has the header file for the OSS sound interface */
7265 $_def_sys_soundcard
7267 /* Define this if your system has the header file for the OSS sound interface
7268 * in /usr/include */
7269 $_def_soundcard
7271 /* Define this if your system has the sysinfo header */
7272 $_def_sys_sysinfo
7274 /* Define this if your system has ftello() */
7276 $_def_ftello
7277 #ifndef HAVE_FTELLO
7278 /* Need these for FILE and off_t an config.h is usually before other includes*/
7279 #include <stdio.h>
7280 #include <sys/types.h>
7281 off_t ftello(FILE *);
7282 #endif
7284 /* Define this if your system has the "malloc.h" header file */
7285 $_def_malloc
7287 /* memalign is mapped to malloc if unsupported */
7288 $_def_memalign
7289 #ifndef HAVE_MEMALIGN
7290 # define memalign(a,b) malloc(b)
7291 #define MEMALIGN_HACK 1
7292 #endif
7294 /* Define this if your system has the "alloca.h" header file */
7295 $_def_alloca
7297 /* Define this if your system has the "sys/mman.h" header file */
7298 $_def_mman
7299 $_def_mman_has_map_failed
7301 /* Define this if you have the elf dynamic linker -ldl library */
7302 $_def_dl
7304 /* Define this if you have the kstat kernel statistics library */
7305 $_def_kstat
7307 /* Define this if you have zlib */
7308 $_def_zlib
7309 #ifdef HAVE_ZLIB
7310 #define CONFIG_ZLIB 1
7311 #endif
7313 /* Define this if you have shm support */
7314 $_def_shm
7316 /* Define this if your system has scandir & alphasort */
7317 $_def_scandir
7319 /* Define this if your system has strsep */
7320 $_def_strsep
7322 /* Define this if your system has strlcpy */
7323 $_def_strlcpy
7324 #ifndef HAVE_STRLCPY
7325 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7326 #endif
7328 /* Define this if your system has strlcat */
7329 $_def_strlcat
7330 #ifndef HAVE_STRLCAT
7331 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7332 #endif
7334 /* Define this if your system has fseeko */
7335 $_def_fseeko
7336 #ifndef HAVE_FSEEKO
7337 /* Need these for FILE and off_t an config.h is usually before other includes*/
7338 #include <stdio.h>
7339 #include <sys/types.h>
7340 int fseeko(FILE *, off_t, int);
7341 #endif
7343 $_def_localtime_r
7345 /* Define this if your system has vsscanf */
7346 $_def_vsscanf
7348 /* Define this if your system has swab */
7349 $_def_swab
7351 /* Define this if your system has no posix select */
7352 $_def_no_posix_select
7354 /* Define this if your system has gettimeofday */
7355 $_def_gettimeofday
7357 /* Define this if your system has glob */
7358 $_def_glob
7360 /* Define this if your system has pthreads */
7361 $_def_pthreads
7363 /* Define this if you enabled thread support for libavcodec */
7364 $_def_threads
7366 /* LIRC (remote control, see www.lirc.org) support: */
7367 $_def_lirc
7370 * LIRCCD (LIRC client daemon)
7371 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7373 $_def_lircc
7375 /* DVD navigation support using libdvdnav */
7376 $_def_dvdnav
7377 $_def_dvdnav_version
7379 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7380 #define MPEG12_POSTPROC 1
7382 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7383 $_def_ffpostprocess
7385 /* Define to include support for OpenDivx postprocessing */
7386 $_def_odivx_postprocess
7388 /* Win32 DLL support */
7389 $_def_win32
7390 #define WIN32_PATH "$_win32libdir"
7392 /* DirectShow support */
7393 $_def_dshow
7395 /* Mac OS X specific features */
7396 $_def_macosx
7397 $_def_macosx_finder_support
7398 $_def_macosx_bundle
7399 $_def_macosx_corevideo
7401 /* Build our Win32-loader */
7402 $_def_win32_loader
7404 /* ffmpeg's libavcodec support (requires libavcodec source) */
7405 $_def_libavcodec
7406 $_def_libavcodecso
7408 /* ffmpeg's libavformat support (requires libavformat source) */
7409 $_def_libavformat
7410 $_def_libavformat_win32
7412 /* Use libavcodec's decoders */
7413 #define CONFIG_DECODERS 1
7414 /* Use libavcodec's encoders */
7415 #define CONFIG_ENCODERS 1
7417 /* Use libavformat's demuxers */
7418 #define CONFIG_DEMUXERS 1
7419 /* Use libavformat's muxers */
7420 #define CONFIG_MUXERS 1
7422 #define CONFIG_MPEGAUDIO_HP 1
7424 #define CONFIG_GPL 1
7426 /* Use amr codecs from libavcodec (requires amr sources) */
7427 $_def_amr_nb
7428 $_def_amr_nb_fixed
7429 $_def_amr_wb
7431 /* Use specific codecs from libavcodec */
7432 `echo $_libavcodecs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7434 /* Use codec libs included in mplayer CVS / source dist: */
7435 $_def_mp3lib
7436 $_def_liba52
7437 $_def_libdts
7438 $_def_libmpeg2
7440 /* Use libfame encoder filter */
7441 $_def_fame
7443 /* XAnim DLL support */
7444 $_def_xanim
7445 /* Default search path */
7446 $_def_xanim_path
7448 /* RealPlayer DLL support */
7449 $_def_real
7450 /* Default search path */
7451 $_def_real_path
7453 /* LIVE555 Streaming Media library support */
7454 $_def_live
7456 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
7457 $_def_fastmemcpy
7459 /* Use unrarlib for Vobsubs */
7460 $_def_unrarlib
7462 /* gui support, please do not edit this option */
7463 $_def_gui
7464 $_def_gtk2_gui
7466 /* Audio output drivers */
7467 $_def_ossaudio
7468 $_def_ossaudio_devdsp
7469 $_def_ossaudio_devmixer
7470 $_def_alsa5
7471 $_def_alsa9
7472 $_def_alsa1x
7473 $_def_arts
7474 $_def_esd
7475 $_def_esd_latency
7476 $_def_polyp
7477 $_def_jack
7478 $_def_sys_asoundlib_h
7479 $_def_alsa_asoundlib_h
7480 $_def_sunaudio
7481 $_def_sgiaudio
7482 $_def_win32waveout
7483 $_def_nas
7485 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7486 #undef FAST_OSD
7487 #undef FAST_OSD_TABLE
7489 /* Enable TV Interface support */
7490 $_def_tv
7492 /* Enable EDL support */
7493 $_def_edl
7495 /* Enable Video 4 Linux TV interface support */
7496 $_def_tv_v4l
7498 /* Enable Video 4 Linux 2 TV interface support */
7499 $_def_tv_v4l2
7501 /* Enable *BSD BrookTree TV interface support */
7502 $_def_tv_bsdbt848
7504 /* Define if your processor stores words with the most significant
7505 byte first (like Motorola and SPARC, unlike Intel and VAX). */
7506 $_def_words_endian
7508 $_def_arch
7510 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
7511 have the instruction. */
7512 $_def_dcbzl
7514 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
7515 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
7517 #ifdef ARCH_POWERPC
7518 #define ARCH_PPC 1
7519 #endif
7521 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
7522 #ifdef ARCH_ARMV4L
7523 #define ARCH_ARM 1
7524 #endif
7526 /* only gcc3 can compile mvi instructions */
7527 $_def_gcc_mvi_support
7529 /* Define this for Cygwin build for win32 */
7530 $_def_confwin32
7532 /* Define this to any prefered value from 386 up to infinity with step 100 */
7533 #define __CPU__ $iproc
7535 $_mp_wordsize
7537 $_def_linux
7539 $_def_vcd
7541 #ifdef sun
7542 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
7543 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7544 #elif defined(HPUX)
7545 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7546 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7547 #elif defined(WIN32)
7548 #define DEFAULT_CDROM_DEVICE "D:"
7549 #define DEFAULT_DVD_DEVICE "D:"
7550 #elif defined(SYS_DARWIN)
7551 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
7552 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
7553 #elif defined(__OpenBSD__)
7554 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
7555 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7556 #elif defined(__FreeBSD__)
7557 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
7558 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7559 #else
7560 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7561 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7562 #endif
7565 /*----------------------------------------------------------------------------
7567 ** NOTE: Instead of modifying these definitions here, use the
7568 ** --enable/--disable options of the ./configure script!
7569 ** See ./configure --help for details.
7571 *---------------------------------------------------------------------------*/
7573 /* C99 lrintf function available */
7574 $_def_lrintf
7576 /* round function is available */
7577 $_def_round
7579 /* yes, we have inttypes.h */
7580 #define HAVE_INTTYPES_H 1
7582 /* int_fastXY_t emulation */
7583 $_def_fast_inttypes
7585 /* nanosleep support */
7586 $_def_nanosleep
7588 /* SMB support */
7589 $_def_smbsupport
7591 /* termcap flag for getch2.c */
7592 $_def_termcap
7594 /* termios flag for getch2.c */
7595 $_def_termios
7596 $_def_termios_h
7597 $_def_termios_sys_h
7599 /* enable PNG support */
7600 $_def_png
7602 /* enable JPEG support */
7603 $_def_jpg
7605 /* enable PNM support */
7606 $_def_pnm
7608 /* enable md5sum support */
7609 $_def_md5sum
7611 /* enable GIF support */
7612 $_def_gif
7613 $_def_gif_4
7614 $_def_gif_tvt_hack
7616 /* enable FreeType support */
7617 $_def_freetype
7619 /* enable Fontconfig support */
7620 $_def_fontconfig
7622 /* enable FriBiDi usage */
7623 $_def_fribidi
7625 /* enable ENCA usage */
7626 $_def_enca
7628 /* liblzo support */
7629 $_def_liblzo
7631 /* libmad support */
7632 $_def_mad
7634 /* enable OggVorbis support */
7635 $_def_vorbis
7637 /* enable Tremor as vorbis decoder */
7638 $_def_tremor
7640 /* enable musepack support */
7641 $_def_musepack
7643 /* enable OggTheora support */
7644 $_def_theora
7646 /* enable Matroska support */
7647 $_def_matroska
7649 /* enable FAAD (AAC) support */
7650 $_def_faad
7651 $_def_faad_internal
7653 /* enable FAAC (AAC encoder) support */
7654 $_def_faac
7656 /* enable LADSPA plugin support */
7657 $_def_ladspa
7659 /* enable network */
7660 $_def_network
7662 /* enable ftp support */
7663 $_def_ftp
7665 /* enable vstream support */
7666 $_def_vstream
7668 /* enable winsock2 instead of Unix functions*/
7669 $_def_winsock2
7671 /* define this to use inet_aton() instead of inet_pton() */
7672 $_def_use_aton
7674 /* enables / disables cdparanoia support */
7675 $_def_cdparanoia
7677 /* enables / disables VIDIX usage */
7678 $_def_vidix
7680 /* enables / disables new input joystick support */
7681 $_def_joystick
7683 /* enables / disables QTX codecs */
7684 $_def_qtx
7686 /* enables / disables osd menu */
7687 $_def_menu
7689 /* enables / disables subtitles sorting */
7690 $_def_sortsub
7692 /* XMMS input plugin support */
7693 $_def_xmms
7694 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7696 /* enables inet6 support */
7697 $_def_inet6
7699 /* do we have gethostbyname2? */
7700 $_def_gethostbyname2
7702 /* Extension defines */
7703 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
7704 $_def_3dnowex // only define if you have 3DNOWEX (AMD Athlon, etc.)
7705 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
7706 $_def_mmx2 // only define if you have MMX2 (Athlon/PIII/4/CelII)
7707 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
7708 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
7709 $_def_altivec // only define if you have Altivec (G4)
7711 $_def_altivec_h // enables usage of altivec.h
7714 $_def_mlib // Sun mediaLib, available only on solaris
7715 $_def_vis // only define if you have VIS ( ultrasparc )
7717 /* libmpeg2 uses a different feature test macro for mediaLib */
7718 #ifdef HAVE_MLIB
7719 #define LIBMPEG2_MLIB 1
7720 #endif
7722 /* libvo options */
7723 #define SCREEN_SIZE_X 1
7724 #define SCREEN_SIZE_Y 1
7725 $_def_x11
7726 $_def_xv
7727 $_def_xvmc
7728 $_def_vm
7729 $_def_xf86keysym
7730 $_def_xinerama
7731 $_def_gl
7732 $_def_gl_win32
7733 $_def_dga
7734 $_def_dga2
7735 $_def_sdl
7736 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
7737 $_def_sdlbuggy
7738 $_def_directx
7739 $_def_ggi
7740 $_def_ggiwmh
7741 $_def_3dfx
7742 $_def_tdfxfb
7743 $_def_tdfxvid
7744 $_def_directfb
7745 $_def_directfb_version
7746 $_def_zr
7747 $_def_bl
7748 $_def_mga
7749 $_def_xmga
7750 $_def_syncfb
7751 $_def_fbdev
7752 $_def_dxr2
7753 $_def_dxr3
7754 $_def_dvb
7755 $_def_dvb_in
7756 $_def_svga
7757 $_def_vesa
7758 $_def_xdpms
7759 $_def_aa
7760 $_def_caca
7761 $_def_tga
7762 $_def_toolame
7763 $_def_twolame
7765 /* used by GUI: */
7766 $_def_xshape
7768 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
7769 #define X11_FULLSCREEN 1
7770 #endif
7772 #endif /* MPLAYER_CONFIG_H */
7775 #############################################################################
7777 echo "Creating libvo/config.mak"
7778 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g;s/\.m/\.o/g'`
7779 cat > libvo/config.mak << EOF
7780 include ../config.mak
7781 OPTIONAL_SRCS = $_vosrc
7782 OPTIONAL_OBJS = $_voobj
7785 #############################################################################
7787 echo "Creating libao2/config.mak"
7788 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'`
7789 cat > libao2/config.mak << EOF
7790 include ../config.mak
7791 OPTIONAL_SRCS = $_aosrc
7792 OPTIONAL_OBJS = $_aoobj
7795 #############################################################################
7797 echo "Creating libaf/config.mak"
7798 _afobj=`echo $_afsrc | sed -e 's/\.c/\.o/g'`
7799 cat > libaf/config.mak << EOF
7800 include ../config.mak
7801 OPTIONAL_SRCS = $_afsrc
7802 OPTIONAL_OBJS = $_afobj
7805 #############################################################################
7807 cat << EOF
7809 Config files successfully generated by ./configure !
7811 Install prefix: $_prefix
7812 Data directory: $_datadir
7813 Config direct.: $_confdir
7815 Byte order: $_byte_order
7816 Optimizing for: $_optimizing
7818 Languages:
7819 Messages/GUI: $_language
7822 echo -n " Manual pages: $MAN_LANG"
7823 test "$LANGUAGES" = en && echo -n " (no localization selected, use --language=all)"
7824 echo
7826 cat << EOF
7828 Enabled optional drivers:
7829 Input: $_inputmodules
7830 Codecs: $_codecmodules
7831 Audio output: $_aomodules
7832 Video output: $_vomodules
7833 Audio filters: $_afmodules
7834 Disabled optional drivers:
7835 Input: $_noinputmodules
7836 Codecs: $_nocodecmodules
7837 Audio output: $_noaomodules
7838 Video output: $_novomodules
7839 Audio filters: $_noafmodules
7841 'config.h' and 'config.mak' contain your configuration options.
7842 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7843 compile *** DO NOT REPORT BUGS if you tweak these files ***
7845 'make' will now compile MPlayer and 'make install' will install it.
7846 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7851 if test "$_mtrr" = yes ; then
7852 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
7853 echo
7856 if test "$_sdl" = "outdated" ; then
7857 cat <<EOF
7858 You have an outdated version of libSDL installed (older than v1.1.7) and SDL
7859 support has therefore been disabled.
7861 Please upgrade to a more recent version (version 1.1.8 and above are known to
7862 work). You may get this library from: http://www.libsdl.org
7864 You need to rerun ./configure and recompile after updating SDL. If you are
7865 only interested in the libSDL audio drivers, then an older version might work.
7867 Use --enable-sdl to force usage of libSDL.
7872 if x86; then
7873 if test "$_win32" = no ; then
7874 if test "$_win32libdir" ; then
7875 echo "Failed to find a Win32 codecs dir at $_win32libdir!"
7876 else
7877 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
7879 cat << EOF
7880 Create it and copy the DLL files there! You can download the codecs from our
7881 homepage at http://www.mplayerhq.hu/MPlayer/releases/codecs/
7885 else
7886 cat <<EOF
7887 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7888 operating system ($system_name). You may encounter a few files that cannot
7889 be played due to missing open source video/audio codec support.
7895 cat <<EOF
7897 Check $TMPLOG if you wonder why an autodetection failed (check whether
7898 the development headers/packages are installed).
7899 Do not report compilation errors if you used any of the --enable-* options
7900 (except --enable-gui and maybe --enable-debug).
7902 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
7906 if test "$_vidix" = no ; then
7907 cat <<EOF
7908 You've disabled VIDIX. Although it would be better to PORT it instead.
7909 Have a look at the documentation for supported cards!
7914 if test "$_warn_CFLAGS" = yes; then
7915 cat <<EOF
7917 MPlayer compilation will use the CFLAGS set by you, but:
7919 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
7921 It is strongly recommended to let MPlayer choose the correct CFLAGS!
7922 To do so, execute 'CFLAGS= ./configure <options>'
7927 # Last move:
7928 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"