synced with 1.97
[mplayer/greg.git] / configure
bloba285eed9eab3d13ba5870746acbcfa55cfd7db71
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 cc_check() {
34 echo >> "$TMPLOG"
35 cat "$TMPC" >> "$TMPLOG"
36 echo >> "$TMPLOG"
37 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $TMPC -o $TMPO $@" >> "$TMPLOG"
38 rm -f "$TMPO"
39 $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra "$TMPC" -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 # Display error message, flushes tempfile, exit
49 die () {
50 echo
51 echo "Error: $@" >&2
52 echo >&2
53 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
54 echo "Check \"$TMPLOG\" if you do not understand why it failed."
55 exit 1
58 # OS test booleans functions
59 issystem() {
60 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
62 linux() { issystem "Linux" ; return "$?" ; }
63 sunos() { issystem "SunOS" ; return "$?" ; }
64 hpux() { issystem "HP-UX" ; return "$?" ; }
65 irix() { issystem "IRIX" ; return "$?" ; }
66 cygwin() { issystem "CYGWIN" ; return "$?" ; }
67 freebsd() { issystem "FreeBSD" ; return "$?" ; }
68 netbsd() { issystem "NetBSD" ; return "$?" ; }
69 bsdos() { issystem "BSD/OS" ; return "$?" ; }
70 openbsd() { issystem "OpenBSD" ; return "$?" ; }
71 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
72 qnx() { issystem "QNX" ; return "$?" ; }
73 darwin() { issystem "Darwin" ; return "$?" ; }
74 gnu() { issystem "GNU" ; return "$?" ; }
75 mingw32() { issystem "MINGW32" ; return "$?" ; }
76 morphos() { issystem "MorphOS" ; return "$?" ; }
77 win32() { cygwin || mingw32 ; return "$?" ; }
78 beos() { issystem "BEOS" ; return "$?" ; }
80 # arch test boolean functions
81 # x86/x86pc is used by QNX
82 x86() {
83 case "$host_arch" in
84 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
85 *) return 1 ;;
86 esac
89 x86_64() {
90 case "$host_arch" in
91 x86_64|amd64) return 0 ;;
92 *) return 1 ;;
93 esac
96 ppc() {
97 case "$host_arch" in
98 ppc) return 0;;
99 *) return 1;;
100 esac
103 alpha() {
104 case "$host_arch" in
105 alpha) return 0;;
106 *) return 1;;
107 esac
110 # not boolean test: implement the posix shell "!" operator for a
111 # non-posix /bin/sh.
112 # usage: not {command}
113 # returns exit status "success" when the execution of "command"
114 # fails.
115 not() {
116 eval "$@"
117 test $? -ne 0
120 # Use this before starting a check
121 echocheck() {
122 echo "============ Checking for $@ ============" >> "$TMPLOG"
123 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
126 # Use this to echo the results of a check
127 echores() {
128 if test "$_res_comment" ; then
129 _res_comment="($_res_comment)"
131 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
132 echo "##########################################" >> "$TMPLOG"
133 echo "" >> "$TMPLOG"
134 echo "$@ $_res_comment"
135 _res_comment=""
137 #############################################################################
139 # Check how echo works in this /bin/sh
140 case `echo -n` in
141 -n) _echo_n= _echo_c='\c' ;; # SysV echo
142 *) _echo_n='-n ' _echo_c= ;; # BSD echo
143 esac
145 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"`
147 for parm in "$@" ; do
148 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
149 cat << EOF
151 Usage: $0 [OPTIONS]...
153 Configuration:
154 -h, --help display this help and exit
156 Installation directories:
157 --prefix=DIR use this prefix for installing mplayer [/usr/local]
158 --bindir=DIR use this prefix for installing mplayer binary
159 [PREFIX/bin]
160 --datadir=DIR use this prefix for installing machine independent
161 data files (fonts, skins) [PREFIX/share/mplayer]
162 --mandir=DIR use this prefix for installing manpages [PREFIX/man]
163 --confdir=DIR use this prefix for installing configuration files
164 [PREFIX/etc/mplayer]
165 --libdir=DIR use this prefix for object code libraries [PREFIX/lib]
167 Optional features:
168 --disable-mencoder disable mencoder (a/v encoder) compilation [enable]
169 --enable-gui enable gmplayer compilation (GTK+ GUI) [disable]
170 --enable-old-gtk force using GTK 1.2 for GUI [disable]
171 --enable-largefiles enable support for files > 2 GBytes [disable]
172 --enable-linux-devfs set default devices to devfs ones [disable]
173 --enable-termcap use termcap database for key codes [autodetect]
174 --enable-termios use termios database for key codes [autodetect]
175 --disable-iconv do not use iconv(3) function [autodetect]
176 --disable-setlocale disable setlocale using in mplayer [autodetect]
177 --disable-langinfo do not use langinfo [autodetect]
178 --enable-lirc enable LIRC (remote control) support [autodetect]
179 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
180 --enable-joystick enable joystick support [disable]
181 --disable-vm disable support X video mode extensions [autodetect]
182 --disable-xf86keysym disable support for 'multimedia' keys [autodetect]
183 --disable-tv disable TV Interface (tv/dvb grabbers) [enable]
184 --disable-tv-v4l disable Video4Linux TV Interface support [autodetect]
185 --disable-tv-v4l2 disable Video4Linux2 TV Interface support [autodetect]
186 --disable-tv-bsdbt848 disable BSD BT848 Interface support [autodetect]
187 --disable-edl disable EDL (edit decision list) support [enable]
188 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
189 --disable-network disable network support (for: http/mms/rtp) [enable]
190 --enable-winsock2 enable winsock2 usage [autodetect]
191 --enable-smb enable Samba (SMB) input support [autodetect]
192 --enable-live enable LIVE555 Streaming Media support [autodetect]
193 --disable-dvdread Disable libdvdread support [autodetect]
194 --disable-mpdvdkit Disable mpdvdkit/mpdvdkit2 support [autodetect]
195 --disable-cdparanoia Disable cdparanoia support [autodetect]
196 --disable-freetype Disable freetype2 font rendering support [autodetect]
197 --disable-fontconfig Disable fontconfig font lookup support [autodetect]
198 --disable-unrarlib Disable Unique RAR File Library [enabled]
199 --enable-menu Enable OSD menu support (NOT DVD MENU) [disabled]
200 --disable-sortsub Disable subtitles sorting [enabled]
201 --enable-fribidi Enable using the FriBiDi libs [disabled]
202 --disable-enca Disable using ENCA charset oracle library [autodetect]
203 --disable-macosx Disable Mac OS X specific features [autodetect]
204 --enable-macosx-finder-support Enable Mac OS X Finder invocation parameter parsing [disabled]
205 --enable-macosx-bundle Enable Mac OS X bundle file locations [autodetect]
206 --disable-inet6 Disable IPv6 support [autodetect]
207 --disable-gethostbyname2 gethostbyname() function is not provided by the C
208 library [autodetect]
209 --disable-ftp Disable ftp support [enabled]
210 --disable-vstream Disable tivo vstream client support [autodetect]
211 --disable-pthreads Disable Posix threads support [autodetect]
213 Codecs:
214 --enable-gif enable gif support [autodetect]
215 --enable-png enable png input/output support [autodetect]
216 --enable-jpeg enable jpeg input/output support [autodetect]
217 --enable-liblzo enable external liblzo support [autodetect]
218 --disable-win32 disable Win32 DLL support [autodetect]
219 --disable-dshow disable Win32/DirectShow support [autodetect]
220 --disable-qtx disable Quicktime codecs [autodetect]
221 --disable-xanim disable XAnim DLL support [autodetect]
222 --disable-real disable RealPlayer DLL support [autodetect]
223 --disable-xvid disable XviD codec [autodetect]
224 --disable-x264 disable H.264 encoder [autodetect]
225 --disable-divx4linux disable DivX4linux/Divx5linux codec [autodetect]
226 --enable-opendivx enable _old_ OpenDivx codec [disable]
227 --disable-libavcodec disable libavcodec [autodetect]
228 --disable-libavformat disable libavformat [autodetect]
229 --enable-libfame enable libfame realtime encoder [autodetect]
230 --disable-internal-tremor do not build internal OggVorbis support [enabled]
231 --enable-tremor-low build with lower accuracy internal tremor [disabled]
232 --enable-external-tremor build with external tremor [disabled]
233 --disable-vorbis disable OggVorbis support entirely [autodetect]
234 --enable-theora build with OggTheora support [autodetect]
235 --disable-internal-matroska disable internal Matroska support [enabled]
236 --enable-external-faad build with external FAAD2 (AAC) support [autodetect]
237 --disable-internal-faad disable internal FAAD2 (AAC) support [autodetect]
238 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
239 --disable-ladspa disable LADSPA plugin support [autodetect]
240 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
241 --disable-mad disable libmad (MPEG audio) support [autodetect]
242 --disable-toolame disable Toolame (MPEG layer 2 audio) support in mencoder [autodetect]
243 --disable-twolame disable Twolame (MPEG layer 2 audio) support in mencoder [autodetect]
244 --enable-xmms build with XMMS inputplugin support [disabled]
245 --disable-mp3lib disable builtin mp3lib [enabled]
246 --disable-liba52 disable builtin liba52 [enabled]
247 --enable-libdts enable libdts support [autodetect]
248 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
249 --disable-musepack disable musepack support [autodetect]
250 --disable-amr_nb disable amr narrowband, floating point [autodetect]
251 --disable-amr_nb-fixed disable amr narrowband, fixed point [autodetect]
252 --disable-amr_wb disable amr wideband, floating point [autodetect]
253 --disable-codec=CODEC disable specified codec
254 --enable-codec=CODEC dnable specified codec
256 Video output:
257 --disable-vidix disable VIDIX [enable on x86 *nix]
258 --enable-gl build with OpenGL render support [autodetect]
259 --enable-dga[=n] build with DGA [n in {1, 2} ] support [autodetect]
260 --enable-vesa build with VESA support [autodetect]
261 --enable-svga build with SVGAlib support [autodetect]
262 --enable-sdl build with SDL render support [autodetect]
263 --enable-aa build with AAlib render support [autodetect]
264 --enable-caca build with CACA render support [autodetect]
265 --enable-ggi build with GGI render support [autodetect]
266 --enable-ggiwmh build with GGI libggiwmh extension [autodetect]
267 --enable-directx build with DirectX support [autodetect]
268 --enable-dxr2 build with DXR2 render support [autodetect]
269 --enable-dxr3 build with DXR3/H+ render support [autodetect]
270 --enable-dvb build with support for output via DVB-Card [autodetect]
271 --enable-dvbhead build with DVB support (HEAD version) [autodetect]
272 --enable-mga build with mga_vid (for Matrox G200/G4x0/G550) support
273 (check for /dev/mga_vid) [autodetect]
274 --enable-xmga build with mga_vid X Window support
275 (check for X & /dev/mga_vid) [autodetect]
276 --enable-xv build with Xv render support for X 4.x [autodetect]
277 --enable-xvmc build with XvMC acceleration for X 4.x [disable]
278 --enable-vm build with XF86VidMode support for X11 [autodetect]
279 --enable-xinerama build with Xinerama support for X11 [autodetect]
280 --enable-x11 build with X11 render support [autodetect]
281 --enable-fbdev build with FBDev render support [autodetect]
282 --enable-mlib build with MLIB support (Solaris only) [autodetect]
283 --enable-3dfx build with obsolete /dev/3dfx support [disable]
284 --enable-tdfxfb build with tdfxfb (Voodoo 3/banshee) support [disable]
285 --enable-directfb build with DirectFB support [autodetect]
286 --enable-zr build with ZR360[56]7/ZR36060 support [autodetect]
287 --enable-bl build with Blinkenlights support [disable]
288 --enable-tdfxvid build with tdfx_vid support [disable]
289 --disable-tga disable targa output support [enable]
290 --disable-pnm disable pnm output support [enable]
291 --disable-md5sum disable md5sum output support [enable]
293 Audio output:
294 --disable-alsa disable ALSA sound support [autodetect]
295 --disable-ossaudio disable OSS sound support [autodetect]
296 --disable-arts disable aRts sound support [autodetect]
297 --disable-esd disable esd sound support [autodetect]
298 --disable-polyp disable Polypaudio sound support [autodetect]
299 --disable-jack disable JACK sound support [autodetect]
300 --disable-nas disable NAS sound support [autodetect]
301 --disable-sgiaudio disable SGI sound support [autodetect]
302 --disable-sunaudio disable Sun sound support [autodetect]
303 --disable-win32waveout disable Windows waveout sound support [autodetect]
304 --disable-select disable using select() on audio device [enable]
306 Miscellaneous options:
307 --enable-runtime-cpudetection Enable runtime CPU detection [disable]
308 --cc=COMPILER use this C compiler to build MPlayer [gcc]
309 --host-cc=COMPILER use this C compiler to build apps needed for the build process [gcc]
310 --as=ASSEMBLER use this assembler to build MPlayer [as]
311 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
312 --enable-static build a statically linked binary. Set further linking
313 options with --enable-static="-lslang -lncurses"
314 --charset convert the help messages to this charset
315 --language=list a white space or comma separated list of languages
316 for translated man pages, the first language is the
317 primary and therefore used for translated messages
318 and GUI (also the environment variable \$LINGUAS is
319 honored) [en]
320 (Available: $LANGUAGES all)
321 --with-install=PATH use a custom install program (useful if your OS uses
322 a GNU-incompatible install utility by default and
323 you want to use GNU version)
324 --install-path=PATH the path to a custom install program
325 this option is obsolete and will be removed soon,
326 use --with-install instead.
328 Advanced options:
329 --enable-mmx build with MMX support [autodetect]
330 --enable-mmx2 build with MMX2 support (PIII, Athlon) [autodetect]
331 --enable-3dnow build with 3DNow! support [autodetect]
332 --enable-3dnowex build with extended 3DNow! support [autodetect]
333 --enable-sse build with SSE support [autodetect]
334 --enable-sse2 build with SSE2 support [autodetect]
335 --enable-shm build with shm support [autodetect]
336 --enable-altivec build with Altivec support (PowerPC) [autodetect]
337 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy() [enable]
338 --enable-big-endian Force byte order to big-endian [autodetect]
339 --enable-debug[=1-3] compile debugging information into mplayer [disable]
340 --enable-profile compile profiling information into mplayer [disable]
341 --disable-sighandler disable sighandler for crashes [enable]
342 --enable-crash-debug enable automatic gdb attach on crash [disable]
343 --enable-i18n _experimental_ gnu gettext() support [autodetect]
344 --enable-dynamic-plugins Enable support for dynamic a/v plugins [disable]
346 Hazardous options a.k.a. "DO NOT REPORT ANY BUGS!"
347 --disable-gcc-checking disable gcc version checking [enable]
349 Use these options if autodetection fails (Options marked with (*) accept
350 multiple paths separated by ':'):
351 --with-extraincdir=DIR extra headers (png, mad, sdl, ...) in DIR (*)
352 --with-extralibdir=DIR extra library files (png, mad, sdl, ...) in DIR (*)
353 --with-x11incdir=DIR X headers in DIR (*)
354 --with-x11libdir=DIR X library files in DIR (*)
355 --with-dxr2incdir=DIR DXR2 headers in DIR (*)
356 --with-dvbincdir=DIR DVB headers in DIR (*)
357 --with-madlibdir=DIR libmad (libmad shared library) in DIR (*)
358 --with-mlibdir=DIR libmlib (MLIB support) in DIR (Solaris only)
359 --with-codecsdir=DIR Binary codec files in DIR
360 --with-win32libdir=DIR W*ndows DLL files in DIR
361 --with-xanimlibdir=DIR XAnim DLL files in DIR
362 --with-reallibdir=DIR RealPlayer DLL files in DIR
363 --with-xvidlibdir=DIR libxvidcore (XviD) in DIR (*)
364 --with-xvidincdir=DIR XviD header in DIR (*)
365 --with-x264libdir=DIR libx264 in DIR
366 --with-x264incdir=DIR x264 header in DIR
367 --with-dtslibdir=DIR libdts library in DIR (*)
368 --with-dtsincdir=DIR libdts header in DIR (*)
369 --with-livelibdir=DIR LIVE555 Streaming Media libraries in DIR
370 --with-toolamedir=DIR path to Toolame library and include file
371 --with-xmmsplugindir=DIR XMMS plugins in DIR
372 --with-xmmslibdir=DIR libxmms.so.1 in DIR
373 --with-cdparanoiaincdir=DIR cdparanoia headers in DIR (*)
374 --with-cdparanoialibdir=DIR cdparanoia libraries (libcdda_*) in DIR (*)
375 --with-xvmclib=NAME name of adapter-specific library (e.g. XvMCNVIDIA)
376 --with-termcaplib=NAME name of library with termcap functionality
377 name should be given without leading "lib"
378 checks for "termcap" and "tinfo"
380 --with-freetype-config=PATH path to freetype-config
381 (e.g. /opt/bin/freetype-config)
382 --with-fribidi-config=PATH path to fribidi-config
383 (e.g. /opt/bin/fribidi-config)
384 --with-glib-config=PATH path to glib*-config (e.g. /opt/bin/glib-config)
385 --with-gtk-config=PATH path to gtk*-config (e.g. /opt/bin/gtk-config)
386 --with-sdl-config=PATH path to sdl*-config (e.g. /opt/bin/sdl-config)
388 This configure script is NOT autoconf-based, even though its output is similar.
389 It will try to autodetect all configuration options. If you --enable an option
390 it will be forcefully turned on, skipping autodetection. This can break
391 compilation, so you need to know what you are doing.
393 exit 0
395 done # for parm in ...
398 # 1st pass checking for vital options
399 _install=install
400 _ranlib=ranlib
401 _cc=cc
402 test "$CC" && _cc="$CC"
403 _as=auto
404 _runtime_cpudetection=no
405 for ac_option do
406 case "$ac_option" in
407 --target=*)
408 _target=`echo $ac_option | cut -d '=' -f 2`
410 --cc=*)
411 _cc=`echo $ac_option | cut -d '=' -f 2`
413 --host-cc=*)
414 _host_cc=`echo $ac_option | cut -d '=' -f 2`
416 --as=*)
417 _as=`echo $ac_option | cut -d '=' -f 2`
419 --enable-gcc-checking)
420 _skip_cc_check=no
422 --disable-gcc-checking)
423 _skip_cc_check=yes
425 --enable-static)
426 _ld_static='-static'
428 --disable-static)
429 _ld_static=''
431 --enable-static=*)
432 _ld_static="-static `echo $ac_option | cut -d '=' -f 2`"
434 --with-extraincdir=*)
435 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
437 --with-extralibdir=*)
438 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
440 --enable-runtime-cpudetection)
441 _runtime_cpudetection=yes
443 --disable-runtime-cpudetection)
444 _runtime_cpudetection=no
446 --install-path=*)
447 _install=`echo $ac_option | cut -d '=' -f 2 | sed 's/\/$//'`"/install"
449 --with-install=*)
450 _install=`echo $ac_option | cut -d '=' -f 2 `
452 esac
453 done
455 # Determine our OS name and CPU architecture
456 if test -z "$_target" ; then
457 # OS name
458 system_name=`uname -s 2>&1`
459 case "$system_name" in
460 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
462 IRIX*)
463 system_name=IRIX
465 HP-UX*)
466 system_name=HP-UX
468 [cC][yY][gG][wW][iI][nN]*)
469 system_name=CYGWIN
471 MINGW32*)
472 system_name=MINGW32
474 MorphOS)
475 system_name=MorphOS
478 system_name="$system_name-UNKNOWN"
480 esac
483 # host's CPU/instruction set
484 host_arch=`uname -p 2>&1`
485 case "$host_arch" in
486 i386|sparc|ppc|alpha|arm|mips|vax)
488 powerpc) # Darwin returns 'powerpc'
489 host_arch=ppc
491 *) # uname -p on Linux returns 'unknown' for the processor type,
492 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
494 # Maybe uname -m (machine hardware name) returns something we
495 # recognize.
497 # x86/x86pc is used by QNX
498 case "`uname -m 2>&1`" in
499 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 ;;
500 ia64) host_arch=ia64 ;;
501 x86_64|amd64)
502 if [ "`$_cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
503 -z "`echo $CFLAGS | grep -- -m32`" ]; then
504 host_arch=x86_64
505 else
506 host_arch=i386
509 macppc|ppc|ppc64) host_arch=ppc ;;
510 alpha) host_arch=alpha ;;
511 sparc) host_arch=sparc ;;
512 sparc64) host_arch=sparc64 ;;
513 parisc*|hppa*|9000*) host_arch=hppa ;;
514 arm*) host_arch=arm ;;
515 s390) host_arch=s390 ;;
516 s390x) host_arch=s390x ;;
517 mips) host_arch=mips ;;
518 vax) host_arch=vax ;;
519 *) host_arch=UNKNOWN ;;
520 esac
522 esac
523 else
524 system_name=`echo $_target | cut -d '-' -f 2`
525 case "`echo $system_name | tr A-Z a-z`" in
526 linux) system_name=Linux ;;
527 freebsd) system_name=FreeBSD ;;
528 netbsd) system_name=NetBSD ;;
529 bsd/os) system_name=BSD/OS ;;
530 openbsd) system_name=OpenBSD ;;
531 sunos) system_name=SunOS ;;
532 qnx) system_name=QNX ;;
533 morphos) system_name=MorphOS ;;
534 mingw32msvc) system_name=MINGW32 ;;
535 esac
536 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
537 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
540 echo "Detected operating system: $system_name"
541 echo "Detected host architecture: $host_arch"
543 # LGB: temporary files
544 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
545 test "$I" && break
546 done
548 TMPLOG="configure.log"
549 rm -f "$TMPLOG"
550 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
551 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
552 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
553 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
555 # config files
557 # FIXME: A lot of stuff is installed under /usr/local
558 # NK: But we should never use this stuff implicitly since we call compiler
559 # from /usr we should be sure that there no effects from other compilers
560 # (libraries) which might be installed into /usr/local. Let users use this
561 # stuff explicitly as command line argument. In other words: It would be
562 # resonable to have only /usr/include or only /usr/local/include.
564 if freebsd ; then
565 _ld_extra="$_ld_extra -L/usr/local/lib"
566 _inc_extra="$_inc_extra -I/usr/local/include"
569 if netbsd ; then
570 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
571 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
572 done
573 _ld_extra=$tmp
576 _ldd=ldd
577 if darwin; then
578 _ldd="otool -L"
581 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
582 # if used as 'head -1' instead of 'head -n 1', but older versions don't
583 # know about '-n'.
584 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
585 _head() { head -$1 2>/dev/null ; }
586 else
587 _head() { head -n $1 2>/dev/null ; }
589 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
590 _tail() { tail -$1 2>/dev/null ; }
591 else
592 _tail() { tail -n $1 2>/dev/null ; }
595 # Checking CC version...
596 if test "$_skip_cc_check" != yes ; then
597 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
598 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
599 echocheck "$_cc version"
600 cc_vendor=intel
601 cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1`
602 cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
603 _cc_major=`echo $cc_version | cut -d '.' -f 1`
604 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
605 # TODO verify older icc/ecc compatibility
606 case $cc_version in
608 cc_version="v. ?.??, bad"
609 cc_verc_fail=yes
611 8.0)
612 cc_version="$cc_version, ok"
613 cc_verc_fail=no
616 cc_version="$cc_version, bad"
617 cc_verc_fail=yes
619 esac
620 echores "$cc_version"
621 else
622 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
623 echocheck "$_cc version"
624 cc_vendor=gnu
625 cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
626 cc_version=`$_cc -dumpversion 2>&1`
627 if test "$?" -gt 0; then
628 cc_version="not found"
630 case $cc_version in
632 cc_version="v. ?.??, bad"
633 cc_verc_fail=yes
635 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
636 _cc_major=`echo $cc_version | cut -d '.' -f 1`
637 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
638 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
639 cc_version="$cc_version, ok"
640 cc_verc_fail=no
642 'not found')
643 cc_verc_fail=yes
646 cc_version="$cc_version, bad"
647 cc_verc_fail=yes
649 esac
650 echores "$cc_version"
651 test "$cc_verc_fail" = "no" && break
652 done
653 fi # icc
654 if test "$cc_verc_fail" = yes ; then
655 cat <<EOF
657 *** Please downgrade/upgrade C compiler to version gcc-2.95.x or gcc-3.x! ***
659 You are not using a supported compiler. We do not have the time to make sure
660 everything works with compilers other than the ones we use. Use either the
661 same compiler as we do, or use --disable-gcc-checking but DO *NOT* REPORT BUGS
662 unless you can reproduce them after recompiling with a 2.95.x or 3.x version!
664 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
665 mplayer and lame (which is used for mencoder). If you get compile errors,
666 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
667 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
668 bugs!
670 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
672 *** For details please read DOCS/HTML/en/users-vs-dev.html ***
675 die "Bad gcc version"
677 else
678 cat <<EOF
680 ******************************************************************************
682 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
683 Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???
685 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
686 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
687 Lame which is used by mencoder produces weird errors, too.
689 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
690 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
692 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
694 ******************************************************************************
698 read _answer
701 echocheck "host cc"
702 test "$_host_cc" || _host_cc=$_cc
703 echores $_host_cc
706 # ---
708 # now that we know what compiler should be used for compilation, try to find
709 # out which assembler is used by the $_cc compiler
710 if test "$_as" = auto ; then
711 _as=`$_cc -print-prog-name=as`
712 test -z "$_as" && _as=as
715 # XXX: this should be ok..
716 _cpuinfo="echo"
717 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
718 # FIXME: Remove the cygwin check once AMD CPUs are supported
719 if test -r /proc/cpuinfo && not cygwin; then
720 # Linux with /proc mounted, extract CPU information from it
721 _cpuinfo="cat /proc/cpuinfo"
722 elif test -r /compat/linux/proc/cpuinfo && not x86 ; then
723 # FreeBSD with Linux emulation /proc mounted,
724 # extract CPU information from it
725 _cpuinfo="cat /compat/linux/proc/cpuinfo"
726 elif darwin ; then
727 # use hostinfo on Darwin
728 _cpuinfo="hostinfo"
729 elif x86; then
730 # all other OSes try to extract CPU information from a small helper
731 # program TOOLS/cpuinfo instead
732 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
733 _cpuinfo="TOOLS/cpuinfo"
736 x86_exts_check()
738 pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | _head 1`
739 if test -z "$pparam" ; then
740 pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | _head 1`
743 _mmx=no
744 _3dnow=no
745 _3dnowex=no
746 _mmx2=no
747 _sse=no
748 _sse2=no
749 _mtrr=no
751 for i in $pparam ; do
752 case "$i" in
753 3dnow) _3dnow=yes ;;
754 3dnowext) _3dnow=yes _3dnowex=yes ;;
755 mmx) _mmx=yes ;;
756 mmxext) _mmx2=yes ;;
757 mtrr|k6_mtrr|cyrix_arr) _mtrr=yes ;;
758 xmm|sse|kni) _sse=yes _mmx2=yes ;;
759 sse2) _sse2=yes ;;
760 esac
761 done
764 case "$host_arch" in
765 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
766 _def_arch="#define ARCH_X86 1"
767 _target_arch="TARGET_ARCH_X86 = yes"
769 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
770 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
771 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
772 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
773 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
775 x86_exts_check
777 echocheck "CPU vendor"
778 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
780 echocheck "CPU type"
781 echores "$pname"
783 case "$pvendor" in
784 AuthenticAMD)
785 case "$pfamily" in
786 3) proc=i386 iproc=386 ;;
787 4) proc=i486 iproc=486 ;;
788 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
789 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
790 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
791 proc=k6-3
792 elif test "$pmodel" -ge 8; then
793 proc=k6-2
794 elif test "$pmodel" -ge 6; then
795 proc=k6
796 else
797 proc=i586
798 iproc=586
801 6) iproc=686
802 if test "$pmodel" -ge 7; then
803 proc=athlon-4
804 elif test "$pmodel" -ge 6; then
805 # only Athlon XP supports ssem MP, Duron etc not
806 # but most of them are CPUID 666, so check if sse detected
807 # btw. there is also athlon-mp opt, but we need extended
808 # CPUID to detect if CPU is SMP capable -> athlon-mp ::atmos
809 if test "$_sse" = yes && test "$pstepping" -ge 2; then
810 proc=athlon-xp
811 else
812 proc=athlon-4
814 elif test "$pmodel" -ge 4; then
815 proc=athlon-tbird
816 else
817 proc=athlon # TODO: should the Duron Spitfire be considered a Thunderbird instead?
820 15) iproc=686
821 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
822 # caught and remedied in the optimization tests below.
823 proc=k8
826 *) proc=athlon-xp iproc=686 ;;
827 esac
829 GenuineIntel)
830 case "$pfamily" in
831 3) proc=i386 iproc=386 ;;
832 4) proc=i486 iproc=486 ;;
833 5) iproc=586
834 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
835 proc=pentium-mmx # 4 is desktop, 8 is mobile
836 else
837 proc=i586
840 6) iproc=686
841 if test "$pmodel" -ge 7; then
842 proc=pentium3
843 elif test "$pmodel" -ge 3; then
844 proc=pentium2
845 else
846 proc=i686
849 15) proc=pentium4 iproc=686 ;;
850 *) proc=pentium4 iproc=686 ;;
851 esac
853 CentaurHauls)
854 case "$pfamily" in
855 5) iproc=586
856 if test "$pmodel" -ge 8; then
857 proc=winchip2
858 elif test "$pmodel" -ge 4; then
859 proc=winchip-c6
860 else
861 proc=i586
864 6) iproc=686
865 # VIA C3 has SSE, but doesn't have MMX2
866 # workaround for SSE => MMX2 implication above
867 _mmx2=no
868 if test "$pmodel" -ge 9; then
869 proc=c3-2
870 else
871 proc=i686
874 *) proc=i686 iproc=i686 ;;
875 esac
877 unknown)
878 case "$pfamily" in
879 3) proc=i386 iproc=386 ;;
880 4) proc=i486 iproc=486 ;;
881 *) proc=i586 iproc=586 ;;
882 esac
885 proc=i586 iproc=586 ;;
886 esac
888 # check that gcc supports our CPU, if not, fall back to earlier ones
889 # LGB: check -mcpu and -march swithing step by step with enabling
890 # to fall back till 386.
892 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
894 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
895 cpuopt=-mtune
896 else
897 cpuopt=-mcpu
900 echocheck "GCC & CPU optimization abilities"
901 cat > $TMPC << EOF
902 int main(void) { return 0; }
904 if test "$_runtime_cpudetection" = no ; then
905 if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
906 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
908 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" || test "$proc" = "athlon-tbird"; then
909 cc_check -march=$proc $cpuopt=$proc || proc=athlon
911 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
912 cc_check -march=$proc $cpuopt=$proc || proc=k6
914 if test "$proc" = "k6"; then
915 if not cc_check -march=$proc $cpuopt=$proc; then
916 if cc_check -march=i586 $cpuopt=i686; then
917 proc=i586-i686
918 else
919 proc=i586
923 if test "$proc" = "pentium4" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon" || test "$proc" = "c3-2"; then
924 cc_check -march=$proc $cpuopt=$proc || proc=i686
926 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
927 cc_check -march=$proc $cpuopt=$proc || proc=i586
929 if test "$proc" = "i586" || test "$proc" = "c3" ; then
930 cc_check -march=$proc $cpuopt=$proc || proc=i486
932 if test "$proc" = "i486" ; then
933 cc_check -march=$proc $cpuopt=$proc || proc=i386
935 if test "$proc" = "i386" ; then
936 cc_check -march=$proc $cpuopt=$proc || proc=error
938 if test "$proc" = "error" ; then
939 echores "Your $_cc does not even support \"i386\" for '-march' and '$cpuopt'."
940 _mcpu=""
941 _march=""
942 _optimizing=""
943 elif test "$proc" = "i586-i686"; then
944 _march="-march=i586"
945 _mcpu="$cpuopt=i686"
946 _optimizing="$proc"
947 else
948 _march="-march=$proc"
949 _mcpu="$cpuopt=$proc"
950 _optimizing="$proc"
952 else
953 # i686 is probably the most common CPU - optimize for it
954 _mcpu="$cpuopt=i686"
955 # at least i486 required, for bswap instruction
956 _march="-march=i486"
957 cc_check $_mcpu || _mcpu=""
958 cc_check $_march $_mcpu || _march=""
961 ## Gabucino : --target takes effect here (hopefully...) by overwriting
962 ## autodetected mcpu/march parameters
963 if test "$_target" ; then
964 # TODO: it may be a good idea to check GCC and fall back in all cases
965 if test "$host_arch" = "i586-i686"; then
966 _march="-march=i586"
967 _mcpu="$cpuopt=i686"
968 else
969 _march="-march=$host_arch"
970 _mcpu="$cpuopt=$host_arch"
973 proc="$host_arch"
975 case "$proc" in
976 i386) iproc=386 ;;
977 i486) iproc=486 ;;
978 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
979 i686|athlon*|pentium*) iproc=686 ;;
980 *) iproc=586 ;;
981 esac
984 echores "$proc"
987 ia64)
988 _def_arch='#define ARCH_IA64 1'
989 _target_arch='TARGET_ARCH_IA64 = yes'
990 iproc='ia64'
991 proc=''
992 _march=''
993 _mcpu=''
994 _optimizing=''
997 x86_64|amd64)
998 _def_arch='#define ARCH_X86_64 1'
999 _target_arch='TARGET_ARCH_X86_64 = yes'
1000 iproc='x86_64'
1002 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1003 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1004 cpuopt=-mtune
1005 else
1006 cpuopt=-mcpu
1008 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1009 # caught and remedied in the optimization tests below.
1010 proc=k8
1012 echocheck "GCC & CPU optimization abilities"
1013 cat > $TMPC << EOF
1014 int main(void) { return 0; }
1016 # This is a stripped-down version of the i386 fallback.
1017 if test "$_runtime_cpudetection" = no ; then
1018 if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
1019 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1021 # This will fail if gcc version < 3.3, which is ok because earlier
1022 # versions don't really support 64-bit on amd64.
1023 # Is this a valid assumption? -Corey
1024 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" ; then
1025 cc_check -march=$proc $cpuopt=$proc || proc=error
1027 _march="-march=$proc"
1028 _mcpu="$cpuopt=$proc"
1029 if test "$proc" = "error" ; then
1030 echores "Your $_cc does not even support \"athlon-xp\" for '-march' and '$cpuopt'."
1031 _mcpu=""
1032 _march=""
1034 else
1035 _march=""
1036 _mcpu=""
1039 _optimizing=""
1041 echores "$proc"
1043 x86_exts_check
1046 sparc)
1047 _def_arch='#define ARCH_SPARC 1'
1048 _target_arch='TARGET_ARCH_SPARC = yes'
1049 iproc='sparc'
1050 if sunos ; then
1051 echocheck "CPU type"
1052 karch=`uname -m`
1053 case "`echo $karch`" in
1054 sun4) proc=v7 ;;
1055 sun4c) proc=v7 ;;
1056 sun4d) proc=v8 ;;
1057 sun4m) proc=v8 ;;
1058 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1059 *) ;;
1060 esac
1061 echores "$proc"
1062 else
1063 proc=v8
1065 _march=''
1066 _mcpu="-mcpu=$proc"
1067 _optimizing="$proc"
1070 sparc64)
1071 _def_arch='#define ARCH_SPARC 1'
1072 _target_arch='TARGET_ARCH_SPARC = yes'
1073 _vis='yes'
1074 _def_vis='#define HAVE_VIS = yes'
1075 iproc='sparc'
1076 proc='v9'
1077 _march=''
1078 _mcpu="-mcpu=$proc"
1079 _optimizing="$proc"
1082 arm|armv4l|armv5tel)
1083 _def_arch='#define ARCH_ARMV4L 1'
1084 _target_arch='TARGET_ARCH_ARMV4L = yes'
1085 iproc='arm'
1086 proc=''
1087 _march=''
1088 _mcpu=''
1089 _optimizing=''
1092 ppc)
1093 _def_arch='#define ARCH_POWERPC 1'
1094 _def_dcbzl='#define NO_DCBZL 1'
1095 _target_arch='TARGET_ARCH_POWERPC = yes'
1096 iproc='ppc'
1097 proc=''
1098 _march=''
1099 _mcpu=''
1100 _optimizing=''
1101 _altivec=no
1103 echocheck "CPU type"
1104 if linux && test -n "$_cpuinfo"; then
1105 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1106 if test -n "`$_cpuinfo | grep altivec`"; then
1107 _altivec=yes
1110 if darwin ; then
1111 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1112 if [ `sysctl -n hw.vectorunit` -eq 1 ]; then
1113 _altivec=yes
1114 elif [ "`sysctl -n hw.optional.altivec 2>/dev/null`" = 1 ]; then
1115 _altivec=yes
1118 # only gcc 3.4 works reliably with altivec code under netbsd
1119 if netbsd ; then
1120 case $cc_version in
1121 2*|3.0*|3.1*|3.2*|3.3*)
1124 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1125 _altivec=yes
1128 esac
1130 if test "$_altivec" = yes; then
1131 echores "$proc altivec"
1132 else
1133 echores "$proc"
1136 echocheck "GCC & CPU optimization abilities"
1138 if test -n "$proc"; then
1139 case "$proc" in
1140 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1141 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1142 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1143 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1144 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1145 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1146 *) ;;
1147 esac
1148 # gcc 3.1(.1) and up supports 7400 and 7450
1149 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1150 case "$proc" in
1151 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1152 7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1153 *) ;;
1154 esac
1156 # gcc 3.2 and up supports 970
1157 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1158 case "$proc" in
1159 970*) _march='-mcpu=970' _mcpu='-mtune=970'
1160 _def_dcbzl='#undef NO_DCBZL' ;;
1161 *) ;;
1162 esac
1166 if test -n "$_mcpu"; then
1167 _optimizing=`echo $_mcpu | cut -c 8-`
1168 echores "$_optimizing"
1169 else
1170 echores "none"
1175 alpha)
1176 _def_arch='#define ARCH_ALPHA 1'
1177 _target_arch='TARGET_ARCH_ALPHA = yes'
1178 iproc='alpha'
1179 _march=''
1181 echocheck "CPU type"
1182 cat > $TMPC << EOF
1183 int main() {
1184 unsigned long ver, mask;
1185 asm ("implver %0" : "=r" (ver));
1186 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1187 printf("%ld-%x\n", ver, ~mask);
1188 return 0;
1191 $_cc -o "$TMPO" "$TMPC"
1192 case `"$TMPO"` in
1194 0-0) proc="ev4"; cpu_understands_mvi="0";;
1195 1-0) proc="ev5"; cpu_understands_mvi="0";;
1196 1-1) proc="ev56"; cpu_understands_mvi="0";;
1197 1-101) proc="pca56"; cpu_understands_mvi="1";;
1198 2-303) proc="ev6"; cpu_understands_mvi="1";;
1199 2-307) proc="ev67"; cpu_understands_mvi="1";;
1200 2-1307) proc="ev68"; cpu_understands_mvi="1";;
1201 esac
1202 echores "$proc"
1204 echocheck "GCC & CPU optimization abilities"
1205 if test "$proc" = "ev68" ; then
1206 cc_check -mcpu=$proc || proc=ev67
1208 if test "$proc" = "ev67" ; then
1209 cc_check -mcpu=$proc || proc=ev6
1211 _mcpu="-mcpu=$proc"
1212 echores "$proc"
1214 _optimizing="$proc"
1216 echocheck "MVI instruction support in GCC"
1217 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
1218 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
1219 echores "yes"
1220 else
1221 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
1222 echores "no, GCC = `$_cc -dumpversion 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
1226 mips)
1227 _def_arch='#define ARCH_SGI_MIPS 1'
1228 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
1229 iproc='sgi-mips'
1230 proc=''
1231 _march=''
1232 _mcpu=''
1233 _optimizing=''
1235 if irix ; then
1236 echocheck "CPU type"
1237 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
1238 case "`echo $proc`" in
1239 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
1240 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
1241 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
1242 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
1243 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
1244 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
1245 esac
1246 echores "$proc"
1251 hppa)
1252 _def_arch='#define ARCH_PA_RISC 1'
1253 _target_arch='TARGET_ARCH_PA_RISC = yes'
1254 iproc='PA-RISC'
1255 proc=''
1256 _march=''
1257 _mcpu=''
1258 _optimizing=''
1261 s390)
1262 _def_arch='#define ARCH_S390 1'
1263 _target_arch='TARGET_ARCH_S390 = yes'
1264 iproc='390'
1265 proc=''
1266 _march=''
1267 _mcpu=''
1268 _optimizing=''
1271 s390x)
1272 _def_arch='#define ARCH_S390X 1'
1273 _target_arch='TARGET_ARCH_S390X = yes'
1274 iproc='390x'
1275 proc=''
1276 _march=''
1277 _mcpu=''
1278 _optimizing=''
1281 vax)
1282 _def_arch='#define ARCH_VAX 1'
1283 _target_arch='TARGET_ARCH_VAX = yes'
1284 iproc='vax'
1285 proc=''
1286 _march=''
1287 _mcpu=''
1288 _optimizing=''
1292 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1293 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1294 die "unsupported architecture $host_arch"
1296 esac
1298 if test "$_runtime_cpudetection" = yes ; then
1299 if x86; then
1300 _mmx=yes
1301 _3dnow=yes
1302 _3dnowex=yes
1303 _mmx2=yes
1304 _sse=yes
1305 _sse2=yes
1306 _mtrr=yes
1308 if ppc; then
1309 _altivec=yes
1313 if x86 && test "$_runtime_cpudetection" = no ; then
1314 extcheck() {
1315 if test "$1" = yes ; then
1316 echocheck "kernel support of $2"
1317 cat > $TMPC <<EOF
1318 #include <signal.h>
1319 void catch() { exit(1); }
1320 int main(void){
1321 signal(SIGILL, catch);
1322 __asm__ __volatile__ ("$3":::"memory");return(0);
1326 if ( cc_check && $TMPO ) > /dev/null 2>&1 ; then
1327 echores "yes"
1328 _optimizing="$_optimizing $2"
1329 return 0
1330 else
1331 echores "failed"
1332 echo "It seems that your kernel does not correctly support $2."
1333 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1334 return 1
1337 return 0
1340 extcheck $_mmx "mmx" "emms" || _mmx=no
1341 extcheck $_mmx2 "mmx2" "sfence" || _mmx2=no
1342 extcheck $_3dnow "3dnow" "femms" || _3dnow=no
1343 extcheck $_3dnowex "3dnowex" "pswapd %%mm0, %%mm0" || _3dnowex=no
1344 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no _gcc3_ext="$_gcc3_ext -mno-sse"
1345 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no _gcc3_ext="$_gcc3_ext -mno-sse2"
1346 echocheck "mtrr support"
1347 echores "$_mtrr"
1349 if test "$_mtrr" = yes ; then
1350 _optimizing="$_optimizing mtrr"
1353 if test "$_gcc3_ext" != ""; then
1354 # if we had to disable sse/sse2 because the active kernel does not
1355 # support this instruction set extension, we also have to tell
1356 # gcc3 to not generate sse/sse2 instructions for normal C code
1357 cat > $TMPC << EOF
1358 int main(void) { return 0; }
1360 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1365 echocheck "assembler support of -pipe option"
1366 cat > $TMPC << EOF
1367 int main(void) { return 0; }
1369 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
1371 _prefix="/usr/local"
1372 _xvmclib="XvMCNVIDIA"
1374 # GOTCHA: the variables below defines the default behavior for autodetection
1375 # and have - unless stated otherwise - at least 2 states : yes no
1376 # If autodetection is available then the third state is: auto
1377 _libavcodec=auto
1378 _amr_nb=auto
1379 _amr_nb_fixed=auto
1380 _amr_wb=auto
1381 _libavcodecs=`grep 'register_avcodec(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1382 _libavcodecso=auto
1383 _libavformat=auto
1384 _fame=auto
1385 _mp1e=no
1386 _mencoder=yes
1387 _x11=auto
1388 _dga=auto # 1 2 no auto
1389 _xv=auto
1390 _xvmc=no #auto when complete
1391 _sdl=auto
1392 _directx=auto
1393 _win32waveout=auto
1394 _nas=auto
1395 _png=auto
1396 _jpg=auto
1397 _pnm=yes
1398 _md5sum=yes
1399 _gif=auto
1400 _gl=auto
1401 _ggi=auto
1402 _ggiwmh=auto
1403 _aa=auto
1404 _caca=auto
1405 _svga=auto
1406 _vesa=auto
1407 _fbdev=auto
1408 _dvb=auto
1409 _dvbhead=auto
1410 _dxr2=auto
1411 _dxr3=auto
1412 _iconv=auto
1413 _langinfo=auto
1414 _rtc=auto
1415 _ossaudio=auto
1416 _arts=auto
1417 _esd=auto
1418 _polyp=auto
1419 _jack=auto
1420 _liblzo=auto
1421 _mad=auto
1422 _toolame=auto
1423 _twolame=auto
1424 _tremor_internal=yes
1425 _tremor_low=no
1426 _vorbis=auto
1427 _theora=auto
1428 _mp3lib=yes
1429 _liba52=yes
1430 _libdts=auto
1431 _libmpeg2=yes
1432 _matroska_internal=yes
1433 _tremor=no
1434 _faad_internal=auto
1435 _faad_external=auto
1436 _faac=auto
1437 _ladspa=auto
1438 _xmms=no
1439 # dvdnav disabled, it does not work
1440 #_dvdnav=no
1441 _dvdread=auto
1442 _dvdkit=auto
1443 _xanim=auto
1444 _real=auto
1445 _live=auto
1446 _xinerama=auto
1447 _mga=auto
1448 _xmga=auto
1449 _vm=auto
1450 _xf86keysym=auto
1451 _mlib=auto
1452 _sgiaudio=auto
1453 _sunaudio=auto
1454 _alsa=auto
1455 _fastmemcpy=yes
1456 _unrarlib=yes
1457 _win32=auto
1458 _dshow=yes
1459 _select=yes
1460 _tv=yes
1461 _tv_v4l=auto
1462 _tv_v4l2=auto
1463 _tv_bsdbt848=auto
1464 _edl=yes
1465 _network=yes
1466 _winsock2=auto
1467 _smbsupport=auto
1468 _vidix=auto
1469 _joystick=no
1470 _xvid=auto
1471 _x264=auto
1472 _divx4linux=auto
1473 _opendivx=no
1474 _lirc=auto
1475 _lircc=auto
1476 _gui=no
1477 _gtk1=no
1478 _termcap=auto
1479 _termios=auto
1480 _3dfx=no
1481 _tdfxfb=no
1482 _tdfxvid=no
1483 _tga=yes
1484 _directfb=auto
1485 _zr=auto
1486 _bl=no
1487 _largefiles=no
1488 #_language=en
1489 _shm=auto
1490 _linux_devfs=no
1491 #_charset=utf8
1492 _i18n=auto
1493 _dynamic_plugins=no
1494 _crash_debug=auto
1495 _sighandler=yes
1496 _libdv=auto
1497 _cdparanoia=auto
1498 _big_endian=auto
1499 _freetype=auto
1500 _fontconfig=auto
1501 _menu=no
1502 _qtx=auto
1503 _macosx=auto
1504 _macosx_finder_support=no
1505 _macosx_bundle=auto
1506 _sortsub=yes
1507 _freetypeconfig='freetype-config'
1508 _fribidi=no
1509 _fribidiconfig='fribidi-config'
1510 _enca=auto
1511 _inet6=auto
1512 _gethostbyname2=auto
1513 _ftp=yes
1514 _musepack=auto
1515 _vstream=auto
1516 _pthreads=yes
1517 for ac_option do
1518 case "$ac_option" in
1519 # Skip 1st pass
1520 --target=*) ;;
1521 --cc=*) ;;
1522 --host-cc=*) ;;
1523 --as=*) ;;
1524 --enable-gcc-checking) ;;
1525 --disable-gcc-checking) ;;
1526 --enable-static*) ;;
1527 --disable-static*) ;;
1528 --with-extraincdir=*) ;;
1529 --with-extralibdir=*) ;;
1530 --enable-runtime-cpudetection) ;;
1531 --disable-runtime-cpudetection) ;;
1532 --install-path=*) ;;
1533 --with-install=*) ;;
1535 # Real 2nd pass
1536 --enable-mencoder) _mencoder=yes ;;
1537 --disable-mencoder) _mencoder=no ;;
1538 --enable-i18n) _i18n=yes ;;
1539 --disable-i18n) _i18n=no ;;
1540 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
1541 --disable-dynamic-plugins) _dynamic_plugins=no ;;
1542 --enable-x11) _x11=yes ;;
1543 --disable-x11) _x11=no ;;
1544 --enable-xv) _xv=yes ;;
1545 --disable-xv) _xv=no ;;
1546 --enable-xvmc) _xvmc=yes ;;
1547 --disable-xvmc) _xvmc=no ;;
1548 --enable-sdl) _sdl=yes ;;
1549 --disable-sdl) _sdl=no ;;
1550 --enable-directx) _directx=yes ;;
1551 --disable-directx) _directx=no ;;
1552 --enable-win32waveout) _win32waveout=yes ;;
1553 --disable-win32waveout) _win32waveout=no ;;
1554 --enable-nas) _nas=yes ;;
1555 --disable-nas) _nas=no ;;
1556 --enable-png) _png=yes ;;
1557 --disable-png) _png=no ;;
1558 --enable-jpeg) _jpg=yes ;;
1559 --disable-jpeg) _jpg=no ;;
1560 --enable-pnm) _pnm=yes ;;
1561 --disable-pnm) _pnm=no ;;
1562 --enable-md5sum) _md5sum=yes ;;
1563 --disable-md5sum) _md5sum=no ;;
1564 --enable-gif) _gif=yes ;;
1565 --disable-gif) _gif=no ;;
1566 --enable-gl) _gl=yes ;;
1567 --disable-gl) _gl=no ;;
1568 --enable-ggi) _ggi=yes ;;
1569 --disable-ggi) _ggi=no ;;
1570 --enable-ggiwmh) _ggiwmh=yes ;;
1571 --disable-ggiwmh) _ggiwmh=no ;;
1572 --enable-aa) _aa=yes ;;
1573 --disable-aa) _aa=no ;;
1574 --enable-caca) _caca=yes ;;
1575 --disable-caca) _caca=no ;;
1576 --enable-svga) _svga=yes ;;
1577 --disable-svga) _svga=no ;;
1578 --enable-vesa) _vesa=yes ;;
1579 --disable-vesa) _vesa=no ;;
1580 --enable-fbdev) _fbdev=yes ;;
1581 --disable-fbdev) _fbdev=no ;;
1582 --enable-dvb) _dvb=yes ;;
1583 --disable-dvb) _dvb=no ;;
1584 --enable-dvbhead) _dvbhead=yes ;;
1585 --disable-dvbhead) _dvbhead=no ;;
1586 --enable-dxr2) _dxr2=yes ;;
1587 --disable-dxr2) _dxr2=no ;;
1588 --enable-dxr3) _dxr3=yes ;;
1589 --disable-dxr3) _dxr3=no ;;
1590 --enable-iconv) _iconv=yes ;;
1591 --disable-iconv) _iconv=no ;;
1592 --enable-langinfo) _langinfo=yes ;;
1593 --disable-langinfo) _langinfo=no ;;
1594 --enable-rtc) _rtc=yes ;;
1595 --disable-rtc) _rtc=no ;;
1596 --enable-mp1e) _mp1e=yes ;;
1597 --disable-mp1e) _mp1e=no ;;
1598 --enable-libdv) _libdv=yes ;;
1599 --disable-libdv) _libdv=no ;;
1600 --enable-ossaudio) _ossaudio=yes ;;
1601 --disable-ossaudio) _ossaudio=no ;;
1602 --enable-arts) _arts=yes ;;
1603 --disable-arts) _arts=no ;;
1604 --enable-esd) _esd=yes ;;
1605 --disable-esd) _esd=no ;;
1606 --enable-polyp) _polyp=yes ;;
1607 --disable-polyp) _polyp=no ;;
1608 --enable-jack) _jack=yes ;;
1609 --disable-jack) _jack=no ;;
1610 --enable-mad) _mad=yes ;;
1611 --disable-mad) _mad=no ;;
1612 --disable-toolame) _toolame=no ;;
1613 --disable-twolame) _twolame=no ;;
1614 --enable-liblzo) _liblzo=yes ;;
1615 --disable-liblzo) _liblzo=no ;;
1616 --enable-vorbis) _vorbis=yes ;;
1617 --disable-vorbis) _vorbis=no ;;
1618 --enable-internal-tremor) _tremor_internal=yes ;;
1619 --disable-internal-tremor) _tremor_internal=no ;;
1620 --enable-tremor-low) _tremor_low=yes ;;
1621 --disable-tremor-low) _tremor_low=no ;;
1622 --enable-external-tremor) _tremor=yes ;;
1623 --disable-external-tremor) _tremor=no ;;
1624 --enable-theora) _theora=yes ;;
1625 --disable-theora) _theora=no ;;
1626 --enable-mp3lib) _mp3lib=yes ;;
1627 --disable-mp3lib) _mp3lib=no ;;
1628 --enable-liba52) _liba52=yes ;;
1629 --disable-liba52) _liba52=no ;;
1630 --enable-libdts) _libdts=yes ;;
1631 --disable-libdts) _libdts=no ;;
1632 --enable-libmpeg2) _libmpeg2=yes ;;
1633 --disable-libmpeg2) _libmpeg2=no ;;
1634 --enable-musepack) _musepack=yes ;;
1635 --disable-musepack) _musepack=no ;;
1636 --enable-internal-matroska) _matroska_internal=yes ;;
1637 --disable-internal-matroska) _matroska_internal=no ;;
1638 --enable-internal-faad) _faad_internal=yes _faad_external=no ;;
1639 --disable-internal-faad) _faad_internal=no ;;
1640 --enable-external-faad) _faad_external=yes _faad_internal=no ;;
1641 --disable-external-faad) _faad_external=no ;;
1642 --enable-faac) _faac=yes ;;
1643 --disable-faac) _faac=no ;;
1644 --enable-ladspa) _ladspa=yes ;;
1645 --disable-ladspa) _ladspa=no ;;
1646 --enable-xmms) _xmms=yes ;;
1647 --disable-xmms) _xmms=no ;;
1648 --enable-dvdread) _dvdread=yes ;;
1649 --disable-dvdread) _dvdread=no ;;
1650 --enable-mpdvdkit) _dvdkit=yes ;;
1651 --disable-mpdvdkit) _dvdkit=no ;;
1652 # dvdnav disabled, it does not work
1653 # --enable-dvdnav) _dvdnav=yes ;;
1654 # --disable-dvdnav) _dvdnav=no ;;
1655 --enable-xanim) _xanim=yes ;;
1656 --disable-xanim) _xanim=no ;;
1657 --enable-real) _real=yes ;;
1658 --disable-real) _real=no ;;
1659 --enable-live) _live=yes ;;
1660 --disable-live) _live=no ;;
1661 --enable-xinerama) _xinerama=yes ;;
1662 --disable-xinerama) _xinerama=no ;;
1663 --enable-mga) _mga=yes ;;
1664 --disable-mga) _mga=no ;;
1665 --enable-xmga) _xmga=yes ;;
1666 --disable-xmga) _xmga=no ;;
1667 --enable-vm) _vm=yes ;;
1668 --disable-vm) _vm=no ;;
1669 --enable-xf86keysym) _xf86keysym=yes ;;
1670 --disable-xf86keysym) _xf86keysym=no ;;
1671 --enable-mlib) _mlib=yes ;;
1672 --disable-mlib) _mlib=no ;;
1673 --enable-sunaudio) _sunaudio=yes ;;
1674 --disable-sunaudio) _sunaudio=no ;;
1675 --enable-sgiaudio) _sgiaudio=yes ;;
1676 --disable-sgiaudio) _sgiaudio=no ;;
1677 --enable-alsa) _alsa=yes ;;
1678 --disable-alsa) _alsa=no ;;
1679 --enable-tv) _tv=yes ;;
1680 --disable-tv) _tv=no ;;
1681 --enable-edl) _edl=yes ;;
1682 --disable-edl) _edl=no ;;
1683 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1684 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1685 --enable-tv-v4l) _tv_v4l=yes ;;
1686 --disable-tv-v4l) _tv_v4l=no ;;
1687 --enable-tv-v4l2) _tv_v4l2=yes ;;
1688 --disable-tv-v4l2) _tv_v4l2=no ;;
1689 --enable-fastmemcpy) _fastmemcpy=yes ;;
1690 --disable-fastmemcpy) _fastmemcpy=no ;;
1691 --enable-network) _network=yes ;;
1692 --disable-network) _network=no ;;
1693 --enable-winsock2) _winsock2=yes ;;
1694 --disable-winsock2) _winsock2=no ;;
1695 --enable-smb) _smbsupport=yes ;;
1696 --disable-smb) _smbsupport=no ;;
1697 --enable-vidix) _vidix=yes ;;
1698 --disable-vidix) _vidix=no ;;
1699 --enable-joystick) _joystick=yes ;;
1700 --disable-joystick) _joystick=no ;;
1701 --enable-xvid) _xvid=yes ;;
1702 --disable-xvid) _xvid=no ;;
1703 --enable-x264) _x264=yes ;;
1704 --disable-x264) _x264=no ;;
1705 --enable-divx4linux) _divx4linux=yes ;;
1706 --disable-divx4linux) _divx4linux=no ;;
1707 --enable-opendivx) _opendivx=yes ;;
1708 --disable-opendivx) _opendivx=no ;;
1709 --enable-libavcodec) _libavcodec=yes ;;
1710 --disable-libavcodec) _libavcodec=no ;;
1711 --enable-amr_nb) _amr_nb=yes ;;
1712 --disable-amr_nb) _amr_nb=no ;;
1713 --enable-amr_nb-fixed) _amr_nb_fixed=yes ;;
1714 --disable-amr_nb-fixed) _amr_nb_fixed=no ;;
1715 --enable-amr_wb) _amr_wb=yes ;;
1716 --disable-amr_wb) _amr_wb=no ;;
1717 --enable-codec=*) _libavcodecs="$_libavcodecs `echo $ac_option | cut -d '=' -f 2`" ;;
1718 --disable-codec=*) _libavcodecs=`echo $_libavcodecs | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1719 --enable-libavformat) _libavformat=yes;;
1720 --disable-libavformat) _libavformat=no ;;
1721 --enable-libfame) _fame=yes ;;
1722 --disable-libfame) _fame=no ;;
1723 --enable-lirc) _lirc=yes ;;
1724 --disable-lirc) _lirc=no ;;
1725 --enable-lircc) _lircc=yes ;;
1726 --disable-lircc) _lircc=no ;;
1727 --enable-gui) _gui=yes ;;
1728 --disable-gui) _gui=no ;;
1729 --enable-old-gtk) _gtk1=yes ;;
1730 --enable-termcap) _termcap=yes ;;
1731 --disable-termcap) _termcap=no ;;
1732 --enable-termios) _termios=yes ;;
1733 --disable-termios) _termios=no ;;
1734 --enable-3dfx) _3dfx=yes ;;
1735 --disable-3dfx) _3dfx=no ;;
1736 --enable-tdfxfb) _tdfxfb=yes ;;
1737 --disable-tdfxvid) _tdfxvid=no ;;
1738 --enable-tdfxvid) _tdfxvid=yes ;;
1739 --disable-tga) _tga=no ;;
1740 --enable-tga) _tga=yes ;;
1741 --disable-tdfxfb) _tdfxfb=no ;;
1742 --enable-directfb) _directfb=yes ;;
1743 --disable-directfb) _directfb=no ;;
1744 --enable-zr) _zr=yes ;;
1745 --disable-zr) _zr=no ;;
1746 --enable-bl) _bl=yes ;;
1747 --disable-bl) _bl=no ;;
1748 --enable-mtrr) _mtrr=yes ;;
1749 --disable-mtrr) _mtrr=no ;;
1750 --enable-largefiles) _largefiles=yes ;;
1751 --disable-largefiles) _largefiles=no ;;
1752 --enable-shm) _shm=yes ;;
1753 --disable-shm) _shm=no ;;
1754 --enable-select) _select=yes ;;
1755 --disable-select) _select=no ;;
1756 --enable-linux-devfs) _linux_devfs=yes ;;
1757 --disable-linux-devfs) _linux_devfs=no ;;
1758 --enable-cdparanoia) _cdparanoia=yes ;;
1759 --disable-cdparanoia) _cdparanoia=no ;;
1760 --enable-big-endian) _big_endian=yes ;;
1761 --disable-big-endian) _big_endian=no ;;
1762 --enable-freetype) _freetype=yes ;;
1763 --disable-freetype) _freetype=no ;;
1764 --enable-fontconfig) _fontconfig=yes ;;
1765 --disable-fontconfig) _fontconfig=no ;;
1766 --enable-unrarlib) _unrarlib=yes ;;
1767 --disable-unrarlib) _unrarlib=no ;;
1768 --enable-ftp) _ftp=yes ;;
1769 --disable-ftp) _ftp=no ;;
1770 --enable-vstream) _vstream=yes ;;
1771 --disable-vstream) _vstream=no ;;
1772 --enable-pthreads) _pthreads=yes ;;
1773 --disable-pthreads) _pthreads=no ;;
1775 --enable-fribidi) _fribidi=yes ;;
1776 --disable-fribidi) _fribidi=no ;;
1778 --enable-enca) _enca=yes ;;
1779 --disable-enca) _enca=no ;;
1781 --enable-inet6) _inet6=yes ;;
1782 --disable-inet6) _inet6=no ;;
1784 --enable-gethostbyname2) _gethostbyname2=yes ;;
1785 --disable-gethostbyname2) _gethostbyname2=no ;;
1787 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1788 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1789 --disable-dga) _dga=no ;;
1791 --enable-menu) _menu=yes ;;
1792 --disable-menu) _menu=no ;;
1794 --enable-qtx) _qtx=yes ;;
1795 --disable-qtx) _qtx=no ;;
1797 --enable-macosx) _macosx=yes ;;
1798 --disable-macosx) _macosx=no ;;
1799 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1800 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1801 --enable-macosx-bundle) _macosx_bundle=yes;;
1802 --disable-macosx-bundle) _macosx_bundle=no;;
1804 --enable-sortsub) _sortsub=yes ;;
1805 --disable-sortsub) _sortsub=no ;;
1807 --charset=*)
1808 _charset=`echo $ac_option | cut -d '=' -f 2`
1810 --language=*)
1811 _language=`echo $ac_option | cut -d '=' -f 2`
1813 # dvdnav disabled, it does not work
1814 # --with-libdvdnav=*)
1815 # _dvdnavdir=`echo $ac_option | cut -d '=' -f 2`
1816 # _dvdnav=yes
1817 # ;;
1819 --with-codecsdir=*)
1820 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1821 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1822 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1824 --with-win32libdir=*)
1825 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1826 _win32=yes
1828 --with-xanimlibdir=*)
1829 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1830 _xanim=yes
1832 --with-reallibdir=*)
1833 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1834 _real=yes
1836 --with-livelibdir=*)
1837 _livelibdir=`echo $ac_option | cut -d '=' -f 2`
1839 --with-toolamedir=*)
1840 _toolamedir=`echo $ac_option | cut -d '=' -f 2`
1842 --with-mlibdir=*)
1843 _mlibdir=`echo $ac_option | cut -d '=' -f 2`
1844 _mlib=yes
1847 --with-xmmslibdir=*)
1848 _xmmslibdir=`echo $ac_option | cut -d '=' -f 2`
1851 --with-xmmsplugindir=*)
1852 _xmmsplugindir=`echo $ac_option | cut -d '=' -f 2`
1855 --enable-profile)
1856 _profile='-p'
1858 --disable-profile)
1859 _profile=
1861 --enable-debug)
1862 _debug='-g'
1864 --enable-debug=*)
1865 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
1867 --disable-debug)
1868 _debug=
1870 --enable-crash-debug)
1871 _crash_debug=yes
1873 --disable-crash-debug)
1874 _crash_debug=no
1876 --enable-sighandler)
1877 _sighandler=yes
1879 --disable-sighandler)
1880 _sighandler=no
1883 --enable-sse) _sse=yes ;;
1884 --disable-sse) _sse=no ;;
1885 --enable-sse2) _sse2=yes ;;
1886 --disable-sse2) _sse2=no ;;
1887 --enable-mmx2) _mmx2=yes ;;
1888 --disable-mmx2) _mmx2=no ;;
1889 --enable-3dnow) _3dnow=yes ;;
1890 --disable-3dnow) _3dnow=no _3dnowex=no ;;
1891 --enable-3dnowex) _3dnow=yes _3dnowex=yes ;;
1892 --disable-3dnowex) _3dnowex=no ;;
1893 --enable-altivec) _altivec=yes ;;
1894 --disable-altivec) _altivec=no ;;
1895 --enable-mmx) _mmx=yes ;;
1896 --disable-mmx) # 3Dnow! and MMX2 require MMX
1897 _3dnow=no _3dnowex=no _mmx=no _mmx2=no ;;
1899 --enable-win32) _win32=yes ;;
1900 --disable-win32) _win32=no _dshow=no ;;
1901 --enable-dshow) _win32=yes _dshow=yes ;;
1902 --disable-dshow) _dshow=no ;;
1904 --with-x11incdir=*)
1905 _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1907 --with-x11libdir=*)
1908 _x11_paths=`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1910 --with-dxr2incdir=*)
1911 _inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1913 --with-xvmclib=*)
1914 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
1916 --with-dvbincdir=*)
1917 _inc_dvb=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1919 --with-xvidlibdir=*)
1920 _ld_xvid=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1922 --with-xvidincdir=*)
1923 _inc_xvid=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1925 --with-dtslibdir=*)
1926 _ld_libdts=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1928 --with-dtsincdir=*)
1929 _inc_libdts=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1931 --with-x264libdir=*)
1932 _ld_x264=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1934 --with-x264incdir=*)
1935 _inc_x264=-I`echo $ac_option | cut -d '=' -f 2 |sed 's,:, -I,g'`
1937 --with-sdl-config=*)
1938 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
1940 --with-freetype-config=*)
1941 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
1943 --with-fribidi-config=*)
1944 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
1946 --with-gtk-config=*)
1947 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
1949 --with-glib-config=*)
1950 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
1952 # dvdnav disabled, it does not work
1953 # --with-dvdnav-config=*)
1954 # _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
1955 # ;;
1956 --with-madlibdir=*)
1957 _ld_mad=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1959 --with-cdparanoiaincdir=*)
1960 _inc_cdparanoia=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1962 --with-cdparanoialibdir=*)
1963 _ld_cdparanoia=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1965 --with-termcaplib=*)
1966 _ld_termcap=-l`echo $ac_option | cut -d '=' -f 2`
1967 _termcap=yes
1969 --prefix=*)
1970 _prefix=`echo $ac_option | cut -d '=' -f 2`
1972 --bindir=*)
1973 _bindir=`echo $ac_option | cut -d '=' -f 2`
1975 --datadir=*)
1976 _datadir=`echo $ac_option | cut -d '=' -f 2`
1978 --mandir=*)
1979 _mandir=`echo $ac_option | cut -d '=' -f 2`
1981 --confdir=*)
1982 _confdir=`echo $ac_option | cut -d '=' -f 2`
1984 --libdir=*)
1985 _libdir=`echo $ac_option | cut -d '=' -f 2`
1989 echo "Unknown parameter: $ac_option"
1990 exit 1
1993 esac
1994 done
1996 # Atmos: moved this here, to be correct, if --prefix is specified
1997 test -z "$_bindir" && _bindir="$_prefix/bin"
1998 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1999 test -z "$_mandir" && _mandir="$_prefix/man"
2000 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
2001 test -z "$_libdir" && _libdir="$_prefix/lib"
2002 test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
2004 if x86 ; then
2005 # Checking assembler (_as) compatibility...
2006 # Added workaround for older as that reads from stdin by default - atmos
2007 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
2008 echocheck "assembler ($_as $as_version)"
2010 _pref_as_version='2.9.1'
2011 echo 'nop' > $TMPS
2012 if test "$_mmx" = yes ; then
2013 echo 'emms' >> $TMPS
2015 if test "$_3dnow" = yes ; then
2016 _pref_as_version='2.10.1'
2017 echo 'femms' >> $TMPS
2019 if test "$_3dnowex" = yes ; then
2020 _pref_as_version='2.10.1'
2021 echo 'pswapd %mm0, %mm0' >> $TMPS
2023 if test "$_mmx2" = yes ; then
2024 _pref_as_version='2.10.1'
2025 echo 'movntq %mm0, (%eax)' >> $TMPS
2027 if test "$_sse" = yes ; then
2028 _pref_as_version='2.10.1'
2029 echo 'xorps %xmm0, %xmm0' >> $TMPS
2031 #if test "$_sse2" = yes ; then
2032 # _pref_as_version='2.11'
2033 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2035 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2037 if test "$as_verc_fail" != yes ; then
2038 echores "ok"
2039 else
2040 echores "failed"
2041 echo "Upgrade binutils to ${_pref_as_version} ..."
2042 die "obsolete binutils version"
2046 if ppc ; then
2048 # check if altivec is supported by the compiler, and how to enable it
2050 _altivec_gcc_flags=''
2052 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2053 echocheck "GCC altivec support"
2055 p=''
2056 cat > $TMPC << EOF
2057 int main() {
2058 return 0;
2061 FSF_flags='-maltivec -mabi=altivec'
2062 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2064 # check for Darwin-style flags first, since
2065 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2066 # accepts but ignores FSF-style flags...
2068 if test -z "$p"; then
2069 cc_check $Darwin_flags && p='Darwin'
2071 if test -z "$p"; then
2072 cc_check $FSF_flags && p='FSF'
2075 case $p in
2076 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2077 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2078 *) _altivec=no ;;
2079 esac
2081 if test -z "$p"; then
2082 p=none
2083 else
2084 p="$p-style ($_altivec_gcc_flags)"
2087 echores "$p"
2090 # check if <altivec.h> should be included
2092 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2094 if test "$_altivec" = yes ; then
2095 echocheck "altivec.h"
2096 cat > $TMPC << EOF
2097 #include <altivec.h>
2098 int main(void) { return 0; }
2100 _have_altivec_h=no
2101 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2102 if test "$_have_altivec_h" = yes ; then
2103 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2105 echores "$_have_altivec_h"
2108 # disable runtime cpudetection if
2109 # - we cannot generate altivec code
2110 # - altivec is disabled by the user
2112 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2113 _runtime_cpudetection=no
2116 # show that we are optimizing for altivec (if enabled and supported)
2118 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2119 _optimizing="$_optimizing altivec"
2122 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2124 if test "$_altivec" = yes ; then
2125 _mcpu="$_mcpu $_altivec_gcc_flags"
2128 # setup _def_altivec correctly
2130 if test "$_altivec" = yes ; then
2131 _def_altivec='#define HAVE_ALTIVEC 1'
2132 else
2133 _def_altivec='#undef HAVE_ALTIVEC'
2137 _def_mmx='#undef HAVE_MMX'
2138 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2139 _def_mmx2='#undef HAVE_MMX2'
2140 test "$_mmx2" = yes && _def_mmx2='#define HAVE_MMX2 1'
2141 _def_3dnow='#undef HAVE_3DNOW'
2142 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2143 _def_3dnowex='#undef HAVE_3DNOWEX'
2144 test "$_3dnowex" = yes && _def_3dnowex='#define HAVE_3DNOWEX 1'
2145 _def_sse='#undef HAVE_SSE'
2146 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2147 _def_sse2='#undef HAVE_SSE2'
2148 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2150 # Checking kernel version...
2151 if x86 && linux ; then
2152 _k_verc_problem=no
2153 kernel_version=`uname -r 2>&1`
2154 echocheck "$system_name kernel version"
2155 case "$kernel_version" in
2156 '') kernel_version="?.??"; _k_verc_fail=yes;;
2157 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2158 _k_verc_problem=yes;;
2159 esac
2160 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2161 _k_verc_fail=yes
2163 if test "$_k_verc_fail" ; then
2164 echores "$kernel_version, fail"
2165 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2166 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2167 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2168 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2169 echo "2.2.x you must upgrade it to get SSE support!"
2170 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2171 else
2172 echores "$kernel_version, ok"
2176 if test "$_vidix" = auto ; then
2177 _vidix=no
2178 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2179 x86 && _vidix=yes
2180 x86_64 && _vidix=yes
2181 ppc && linux && _vidix=yes
2182 alpha && linux && _vidix=yes
2183 qnx && _vidix=no
2184 sunos && _vidix=no
2185 beos && _vidix=no
2188 echocheck "mplayer binary name"
2189 if win32 ; then
2190 _prg="mplayer.exe"
2191 _prg_mencoder="mencoder.exe"
2192 else
2193 _prg="mplayer"
2194 _prg_mencoder="mencoder"
2196 echores $_prg
2199 # On QNX we must link to libph - Gabucino
2200 if qnx ; then
2201 _ld_arch="$_ld_arch -lph"
2204 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2205 _awk=
2206 if test "$_vidix" = yes ; then
2207 _awk_verc_fail=yes
2208 echocheck "awk"
2209 for _awk in mawk gawk nawk awk; do
2210 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2211 _awk_verc_fail=no
2212 break
2214 done
2215 test "$_awk_verc_fail" = yes && _awk=no
2216 echores "$_awk"
2217 if test "$_awk_verc_fail" = yes; then
2218 echo "VIDIX needs awk, but no working implementation was found!"
2219 echo "Try the GNU version, which can be downloaded from:"
2220 echo "ftp://ftp.gnu.org/gnu/gawk/"
2221 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2222 die "no awk"
2226 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2227 if irix ; then
2228 _ranlib='ar -r'
2229 elif linux ; then
2230 _ranlib='true'
2233 ######################
2234 # MAIN TESTS GO HERE #
2235 ######################
2238 echocheck "extra headers"
2239 if test "$_inc_extra" ; then
2240 echores "$_inc_extra"
2241 else
2242 echores "none"
2246 echocheck "extra libs"
2247 if test "$_ld_extra" ; then
2248 echores "$_ld_extra"
2249 else
2250 echores "none"
2253 echocheck "-lposix"
2254 cat > $TMPC <<EOF
2255 int main(void) { return 0; }
2257 if cc_check -lposix ; then
2258 _ld_arch="$_ld_arch -lposix"
2259 echores "yes"
2260 else
2261 echores "no"
2264 echocheck "-lm"
2265 cat > $TMPC <<EOF
2266 int main(void) { return 0; }
2268 if cc_check -lm ; then
2269 _ld_lm="-lm"
2270 echores "yes"
2271 else
2272 _ld_lm=""
2273 echores "no"
2276 # Checking for localization ...
2277 # CSAK EGY MARADHAT - A HEGYLAKO
2278 echocheck "i18n"
2279 if test "$_i18n" != no ; then
2280 cat > $TMPC <<EOF
2281 #include <libintl.h>
2282 int main(void) { gettext("test"); return 0; }
2284 _i18n=no
2285 _i18n_libs=""
2286 if test "$_i18n" = auto ; then
2287 cc_check && _i18n=yes
2288 else
2289 for i18n_lib in "" "-lintl"; do
2290 cc_check $i18n_lib && _i18n=yes && _i18n_libs=$i18n_lib && break
2291 done
2294 if test "$_i18n" = yes ; then
2295 _def_i18n='#define USE_I18N 1'
2296 else
2297 _def_i18n='#undef USE_I18N'
2299 if test "$_i18n_libs" ; then
2300 _res_comment="using $_i18n_libs"
2302 echores "$_i18n"
2305 echocheck "langinfo"
2306 if test "$_langinfo" = auto ; then
2307 cat > $TMPC <<EOF
2308 #include <langinfo.h>
2309 int main(void) { nl_langinfo(CODESET); return 0; }
2311 _langinfo=no
2312 cc_check && _langinfo=yes
2314 if test "$_langinfo" = yes ; then
2315 _def_langinfo='#define USE_LANGINFO 1'
2316 else
2317 _def_langinfo='#undef USE_LANGINFO'
2319 echores "$_langinfo"
2322 echocheck "language"
2323 test -z "$_language" && _language=$LINGUAS
2324 _language=`echo $_language | sed 's/,/ /g'`
2325 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2326 for lang in $_language ; do
2327 test "$lang" = all && lang=en
2328 if test -f "help/help_mp-${lang}.h" ; then
2329 _language=$lang
2330 break
2331 else
2332 echo -n "$lang not found, "
2333 _language=`echo $_language | sed "s/$lang *//"`
2335 done
2336 test -z "$_language" && _language=en
2337 _mp_help="help/help_mp-${_language}.h"
2338 test -f $_mp_help || die "$_mp_help not found"
2339 for lang in $LANGUAGES ; do
2340 if test -f "DOCS/man/$lang/mplayer.1" ; then
2341 MAN_LANG="$MAN_LANG $lang"
2343 done
2344 _doc_lang=$_language
2345 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2346 echores "using $_language (man pages: $MAN_LANG)"
2349 echocheck "enable sighandler"
2350 if test "$_sighandler" = yes ; then
2351 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2352 else
2353 _def_sighandler='#undef ENABLE_SIGHANDLER'
2355 echores "$_sighandler"
2357 echocheck "runtime cpudetection"
2358 if test "$_runtime_cpudetection" = yes ; then
2359 _optimizing="Runtime CPU-Detection enabled"
2360 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2361 else
2362 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2364 echores "$_runtime_cpudetection"
2367 echocheck "restrict keyword"
2368 for restrict_keyword in restrict __restrict __restrict__ ; do
2369 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2370 if cc_check; then
2371 _def_restrict_keyword=$restrict_keyword
2372 break;
2374 done
2375 if [ -n "$_def_restrict_keyword" ]; then
2376 echores "$_def_restrict_keyword"
2377 else
2378 echores "none"
2380 # Avoid infinite recursion loop ("#define restrict restrict")
2381 if [ "$_def_restrict_keyword" != "restrict" ]; then
2382 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2383 else
2384 _def_restrict_keyword=""
2388 echocheck "__builtin_expect"
2389 # GCC branch prediction hint
2390 cat > $TMPC << EOF
2391 int foo (int a) {
2392 a = __builtin_expect (a, 10);
2393 return a == 10 ? 0 : 1;
2395 int main() { return foo(10) && foo(0); }
2397 _builtin_expect=no
2398 cc_check && _builtin_expect=yes
2399 if test "$_builtin_expect" = yes ; then
2400 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2401 else
2402 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2404 echores "$_builtin_expect"
2407 echocheck "kstat"
2408 cat > $TMPC << EOF
2409 #include <kstat.h>
2410 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2412 _kstat=no
2413 cc_check -lkstat && _kstat=yes
2414 if test "$_kstat" = yes ; then
2415 _def_kstat="#define HAVE_LIBKSTAT 1"
2416 _ld_arch="-lkstat $_ld_arch"
2417 else
2418 _def_kstat="#undef HAVE_LIBKSTAT"
2420 echores "$_kstat"
2423 echocheck "posix4"
2424 # required for nanosleep on some systems
2425 cat > $TMPC << EOF
2426 #include <time.h>
2427 int main(void) { (void) nanosleep(0, 0); return 0; }
2429 _posix4=no
2430 cc_check -lposix4 && _posix4=yes
2431 if test "$_posix4" = yes ; then
2432 _ld_arch="-lposix4 $_ld_arch"
2434 echores "$_posix4"
2436 echocheck "lrintf"
2437 cat > $TMPC << EOF
2438 #include <math.h>
2439 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2441 _lrintf=no
2442 cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2443 if test "$_lrintf" = yes ; then
2444 _def_lrintf="#define HAVE_LRINTF 1"
2445 else
2446 _def_lrintf="#undef HAVE_LRINTF"
2448 echores "$_lrintf"
2450 echocheck "round"
2451 cat > $TMPC << EOF
2452 #include <math.h>
2453 int main(void) { (void) round(0.0); return 0; }
2455 _round=no
2456 cc_check $_ld_lm && _round=yes
2457 if test "$_round" = yes ; then
2458 _def_round="#define HAVE_ROUND 1"
2459 else
2460 _def_round="#undef HAVE_ROUND"
2462 echores "$_round"
2464 echocheck "nanosleep"
2465 # also check for nanosleep
2466 cat > $TMPC << EOF
2467 #include <time.h>
2468 int main(void) { (void) nanosleep(0, 0); return 0; }
2470 _nanosleep=no
2471 cc_check $_ld_arch && _nanosleep=yes
2472 if test "$_nanosleep" = yes ; then
2473 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2474 else
2475 _def_nanosleep='#undef HAVE_NANOSLEEP'
2477 echores "$_nanosleep"
2480 echocheck "socklib"
2481 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2482 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2483 cat > $TMPC << EOF
2484 #include <netdb.h>
2485 int main(void) { (void) gethostbyname(0); return 0; }
2487 for _ld_tmp in "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2488 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && break
2489 done
2490 if test $_winsock2 = auto && not cygwin ; then
2491 _winsock2=no
2492 cat > $TMPC << EOF
2493 #include <winsock2.h>
2494 int main(void) { (void) gethostbyname(0); return 0; }
2496 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2498 if test "$_ld_sock" ; then
2499 echores "yes (using $_ld_sock)"
2500 else
2501 echores "no"
2505 if test $_winsock2 = yes ; then
2506 _ld_sock="-lws2_32"
2507 _def_winsock2='#define HAVE_WINSOCK2 1'
2508 else
2509 _def_winsock2='#undef HAVE_WINSOCK2'
2513 _use_aton=no
2514 echocheck "inet_pton()"
2515 cat > $TMPC << EOF
2516 #include <sys/types.h>
2517 #include <sys/socket.h>
2518 #include <arpa/inet.h>
2519 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2521 if test "$_winsock2" = yes ; then
2522 echores "not needed (using winsock2 functions)"
2523 elif cc_check $_ld_sock ; then
2524 # NOTE: Linux has libresolv but does not need it
2526 echores "yes (using $_ld_sock)"
2527 elif cc_check $_ld_sock -lresolv ; then
2528 # NOTE: needed for SunOS at least
2529 _ld_sock="$_ld_sock -lresolv"
2530 echores "yes (using $_ld_sock)"
2531 else
2532 echores "no (=> i'll try inet_aton next)"
2534 echocheck "inet_aton()"
2535 cat > $TMPC << EOF
2536 #include <sys/types.h>
2537 #include <sys/socket.h>
2538 #include <arpa/inet.h>
2539 int main(void) { (void) inet_aton(0, 0); return 0; }
2541 _use_aton=yes
2542 if cc_check $_ld_sock ; then
2543 # NOTE: Linux has libresolv but does not need it
2545 echores "yes (using $_ld_sock)"
2546 elif cc_check $_ld_sock -lresolv ; then
2547 # NOTE: needed for SunOS at least
2548 _ld_sock="$_ld_sock -lresolv"
2549 echores "yes (using $_ld_sock)"
2550 else
2551 _use_aton=no
2552 _network=no
2553 echores "no (=> network support disabled)"
2557 _def_use_aton='#undef USE_ATON'
2558 if test "$_use_aton" != no; then
2559 _def_use_aton='#define USE_ATON 1'
2563 echocheck "inttypes.h (required)"
2564 cat > $TMPC << EOF
2565 #include <inttypes.h>
2566 int main(void) { return 0; }
2568 _inttypes=no
2569 cc_check && _inttypes=yes
2570 if test "$_inttypes" = yes ; then
2571 # nothing to do
2573 else
2574 echores "no"
2575 echocheck "bitypes.h (inttypes.h predecessor)"
2576 cat > $TMPC << EOF
2577 #include <sys/bitypes.h>
2578 int main(void) { return 0; }
2580 _inttypes=no
2581 cc_check && _inttypes=yes
2582 if test "$_inttypes" = yes ; then
2583 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."
2584 else
2585 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2588 echores "$_inttypes"
2591 echocheck "int_fastXY_t in inttypes.h"
2592 cat > $TMPC << EOF
2593 #include <inttypes.h>
2594 int main(void) {
2595 volatile int_fast16_t v= 0;
2596 return v; }
2598 _fast_inttypes=no
2599 cc_check && _fast_inttypes=yes
2600 if test "$_fast_inttypes" = yes ; then
2601 # nothing to do
2603 else
2604 _def_fast_inttypes='
2605 typedef signed char int_fast8_t;
2606 typedef signed int int_fast16_t;
2607 typedef signed int int_fast32_t;
2608 typedef unsigned char uint_fast8_t;
2609 typedef unsigned int uint_fast16_t;
2610 typedef unsigned int uint_fast32_t;'
2612 echores "$_fast_inttypes"
2615 echocheck "word size"
2616 _mp_wordsize="#undef MP_WORDSIZE"
2617 cat > $TMPC << EOF
2618 #include <stdio.h>
2619 #include <sys/types.h>
2620 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2622 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2623 echores "$_wordsize"
2626 echocheck "stddef.h"
2627 cat > $TMPC << EOF
2628 #include <stddef.h>
2629 int main(void) { return 0; }
2631 _stddef=no
2632 cc_check && _stddef=yes
2633 if test "$_stddef" = yes ; then
2634 _def_stddef='#define HAVE_STDDEF_H 1'
2635 else
2636 _def_stddef='#undef HAVE_STDDEF_H'
2638 echores "$_stddef"
2641 echocheck "malloc.h"
2642 cat > $TMPC << EOF
2643 #include <malloc.h>
2644 int main(void) { (void) malloc(0); return 0; }
2646 _malloc=no
2647 cc_check && _malloc=yes
2648 if test "$_malloc" = yes ; then
2649 _def_malloc='#define HAVE_MALLOC_H 1'
2650 else
2651 _def_malloc='#undef HAVE_MALLOC_H'
2653 # malloc.h emits a warning in FreeBSD and OpenBSD
2654 freebsd || openbsd && _def_malloc='#undef HAVE_MALLOC_H'
2655 echores "$_malloc"
2658 echocheck "memalign()"
2659 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2660 cat > $TMPC << EOF
2661 #include <malloc.h>
2662 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2664 _memalign=no
2665 cc_check && _memalign=yes
2666 if test "$_memalign" = yes ; then
2667 _def_memalign='#define HAVE_MEMALIGN 1'
2668 else
2669 _def_memalign='#undef HAVE_MEMALIGN'
2671 echores "$_memalign"
2674 echocheck "alloca.h"
2675 cat > $TMPC << EOF
2676 #include <alloca.h>
2677 int main(void) { (void) alloca(0); return 0; }
2679 _alloca=no
2680 cc_check && _alloca=yes
2681 if cc_check ; then
2682 _def_alloca='#define HAVE_ALLOCA_H 1'
2683 else
2684 _def_alloca='#undef HAVE_ALLOCA_H'
2686 echores "$_alloca"
2689 echocheck "mman.h"
2690 cat > $TMPC << EOF
2691 #include <sys/types.h>
2692 #include <sys/mman.h>
2693 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2695 _mman=no
2696 cc_check && _mman=yes
2697 if test "$_mman" = yes ; then
2698 _def_mman='#define HAVE_SYS_MMAN_H 1'
2699 else
2700 _def_mman='#undef HAVE_SYS_MMAN_H'
2702 echores "$_mman"
2704 cat > $TMPC << EOF
2705 #include <sys/types.h>
2706 #include <sys/mman.h>
2707 int main(void) { void *p = MAP_FAILED; return 0; }
2709 _mman_has_map_failed=no
2710 cc_check && _mman_has_map_failed=yes
2711 if test "$_mman_has_map_failed" = yes ; then
2712 _def_mman_has_map_failed=''
2713 else
2714 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2717 echocheck "dynamic loader"
2718 cat > $TMPC << EOF
2719 #include <dlfcn.h>
2720 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2722 _dl=no
2723 for _ld_tmp in "" "-ldl" ; do
2724 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2725 done
2726 if test "$_dl" = yes ; then
2727 _def_dl='#define HAVE_LIBDL 1'
2728 else
2729 _def_dl='#undef HAVE_LIBDL'
2731 echores "$_dl"
2734 echocheck "dynamic a/v plugins support"
2735 if test "$_dl" = no ; then
2736 _dynamic_plugins=no
2738 if test "$_dynamic_plugins" = yes ; then
2739 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
2740 else
2741 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
2743 echores "$_dynamic_plugins"
2746 #echocheck "dynamic linking"
2747 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
2748 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
2749 #cat > $TMPC << EOF
2750 #int main(void) { return 0; }
2751 #EOF
2752 #if cc_check -rdynamic ; then
2753 # _ld_dl_dynamic='-rdynamic'
2754 #elif cc_check -Bdynamic ; then
2755 # _ld_dl_dynamic='-Bdynamic'
2756 #elif cc_check ; then
2757 # _ld_dl_dynamic=''
2759 #echores "using $_ld_dl_dynamic"
2761 _def_threads='#undef HAVE_THREADS'
2763 echocheck "pthread"
2764 if test "$_pthreads" != no ; then
2765 cat > $TMPC << EOF
2766 #include <pthread.h>
2767 void* func(void *arg) { return arg; }
2768 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
2770 _pthreads=no
2771 if not hpux ; then
2772 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
2773 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2774 cc_check $_ld_tmp && ($TMPO || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
2775 done
2778 if test "$_pthreads" = yes ; then
2779 echores "yes (using $_ld_pthread)"
2780 _pthreads='yes'
2781 _def_pthreads='#define HAVE_PTHREADS 1'
2782 _def_threads='#define HAVE_THREADS 1'
2783 else
2784 echores "no (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled)"
2785 _pthreads=''
2786 _def_pthreads='#undef HAVE_PTHREADS'
2787 _nas=no ; _tv_v4l=no ; _macosx=no
2788 if not mingw32 ; then
2789 _win32=no
2794 echocheck "iconv"
2795 if test "$_iconv" = auto ; then
2796 _iconv_tmp='#include <iconv.h>'
2798 cat > $TMPC << EOF
2799 #include <stdio.h>
2800 #include <unistd.h>
2801 $_iconv_tmp
2802 #define INBUFSIZE 1024
2803 #define OUTBUFSIZE 4096
2805 char inbuffer[INBUFSIZE];
2806 char outbuffer[OUTBUFSIZE];
2808 int main(void) {
2809 size_t numread;
2810 iconv_t icdsc;
2811 char *tocode="UTF-8";
2812 char *fromcode="cp1250";
2813 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
2814 while ((numread = read (0, inbuffer, INBUFSIZE))) {
2815 char *iptr=inbuffer;
2816 char *optr=outbuffer;
2817 size_t inleft=numread;
2818 size_t outleft=OUTBUFSIZE;
2819 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
2820 != (size_t)(-1)) {
2821 write (1, outbuffer, OUTBUFSIZE - outleft);
2824 if (iconv_close(icdsc) == -1)
2829 _iconv=no
2830 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
2831 cc_check $_ld_lm $_ld_tmp && _ld_iconv="$_ld_tmp" && _iconv=yes && break
2832 done
2834 if test "$_iconv" = yes ; then
2835 _def_iconv='#define USE_ICONV 1'
2836 else
2837 _def_iconv='#undef USE_ICONV'
2839 echores "$_iconv"
2842 echocheck "sys/soundcard.h"
2843 cat > $TMPC << EOF
2844 #include <sys/soundcard.h>
2845 int main(void) { return 0; }
2847 _sys_soundcard=no
2848 cc_check && _sys_soundcard=yes
2849 if test "$_sys_soundcard" = yes ; then
2850 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
2851 _inc_soundcard='#include <sys/soundcard.h>'
2852 else
2853 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
2855 echores "$_sys_soundcard"
2857 if test "$_sys_soundcard" != yes ; then
2858 echocheck "soundcard.h"
2859 cat > $TMPC << EOF
2860 #include <soundcard.h>
2861 int main(void) { return 0; }
2863 _soundcard=no
2864 cc_check && _soundcard=yes
2865 if linux || test "$_ossaudio" != no ; then
2866 # use soundcard.h on Linux, or when OSS support is enabled
2867 echores "$_soundcard"
2868 else
2869 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
2870 echores "$_soundcard, but ignored!"
2871 _soundcard=no
2873 if test "$_soundcard" = yes ; then
2874 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
2875 _inc_soundcard='#include <soundcard.h>'
2876 else
2877 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2879 else
2880 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2884 echocheck "sys/dvdio.h"
2885 cat > $TMPC << EOF
2886 #include <unistd.h>
2887 #include <sys/dvdio.h>
2888 int main(void) { return 0; }
2890 _dvdio=no
2891 cc_check && _dvdio=yes
2892 if test "$_dvdio" = yes ; then
2893 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
2894 else
2895 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
2897 echores "$_dvdio"
2900 echocheck "sys/cdio.h"
2901 cat > $TMPC << EOF
2902 #include <unistd.h>
2903 #include <sys/cdio.h>
2904 int main(void) { return 0; }
2906 _cdio=no
2907 cc_check && _cdio=yes
2908 if test "$_cdio" = yes ; then
2909 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
2910 else
2911 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
2913 echores "$_cdio"
2916 echocheck "linux/cdrom.h"
2917 cat > $TMPC << EOF
2918 #include <sys/types.h>
2919 #include <linux/cdrom.h>
2920 int main(void) { return 0; }
2922 _cdrom=no
2923 cc_check && _cdrom=yes
2924 if test "$_cdrom" = yes ; then
2925 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
2926 else
2927 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
2929 echores "$_cdrom"
2932 echocheck "dvd.h"
2933 cat > $TMPC << EOF
2934 #include <dvd.h>
2935 int main(void) { return 0; }
2937 _dvd=no
2938 cc_check && _dvd=yes
2939 if test "$_dvd" = yes ; then
2940 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
2941 else
2942 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
2944 echores "$_dvd"
2947 echocheck "BSDI dvd.h"
2948 cat > $TMPC << EOF
2949 #include <dvd.h>
2950 int main(void) { return 0; }
2952 _bsdi_dvd=no
2953 cc_check && _bsdi_dvd=yes
2954 if test "$_bsdi_dvd" = yes ; then
2955 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
2956 else
2957 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
2959 echores "$_bsdi_dvd"
2962 echocheck "HPUX SCSI header"
2963 cat > $TMPC << EOF
2964 #include <sys/scsi.h>
2965 int main(void) { return 0; }
2967 _hpux_scsi_h=no
2968 cc_check && _hpux_scsi_h=yes
2969 if test "$_hpux_scsi_h" = yes ; then
2970 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
2971 else
2972 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
2974 echores "$_hpux_scsi_h"
2977 echocheck "userspace SCSI headers (Solaris)"
2978 cat > $TMPC << EOF
2979 # include <unistd.h>
2980 # include <stropts.h>
2981 # include <sys/scsi/scsi_types.h>
2982 # include <sys/scsi/impl/uscsi.h>
2983 int main(void) { return 0; }
2985 _sol_scsi_h=no
2986 cc_check && _sol_scsi_h=yes
2987 if test "$_sol_scsi_h" = yes ; then
2988 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
2989 else
2990 _def_sol_scsi_h='#undef SOLARIS_USCSI'
2992 echores "$_sol_scsi_h"
2995 echocheck "termcap"
2996 if test "$_termcap" = auto ; then
2997 cat > $TMPC <<EOF
2998 int main(void) { return 0; }
3000 _termcap=no
3001 for _ld_tmp in "-ltermcap" "-ltinfo" ; do
3002 cc_check $_ld_tmp && _ld_termcap="$_ld_tmp" && _termcap=yes && break
3003 done
3005 if test "$_termcap" = yes ; then
3006 _def_termcap='#define USE_TERMCAP 1'
3007 _res_comment="using $_ld_termcap"
3008 else
3009 _def_termcap='#undef USE_TERMCAP'
3011 echores "$_termcap"
3014 echocheck "termios"
3015 if test "$_termios" = auto ; then
3016 cat > $TMPC <<EOF
3017 #include <sys/termios.h>
3018 int main(void) { return 0; }
3020 _termios=auto
3021 cc_check && _termios=yes
3022 _def_termios_h_name='sys/termios.h'
3024 # second test:
3025 if test "$_termios" = auto ; then
3026 cat > $TMPC <<EOF
3027 #include <termios.h>
3028 int main(void) { return 0; }
3030 _termios=no
3031 cc_check && _termios=yes
3032 _def_termios_h_name='termios.h'
3035 if test "$_termios" = yes ; then
3036 _def_termios='#define HAVE_TERMIOS 1'
3037 _def_termios_h='#undef HAVE_TERMIOS_H'
3038 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3040 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3041 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3042 elif test "$_def_termios_h_name" = 'termios.h' ; then
3043 _def_termios_h='#define HAVE_TERMIOS_H 1'
3045 _res_comment="using $_def_termios_h_name"
3046 else
3047 _def_termios='#undef HAVE_TERMIOS'
3048 _def_termios_h_name=''
3049 _termios=no
3051 echores "$_termios"
3054 echocheck "shm"
3055 if test "$_shm" = auto ; then
3056 cat > $TMPC << EOF
3057 #include <sys/types.h>
3058 #include <sys/shm.h>
3059 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3061 _shm=no
3062 cc_check && _shm=yes
3064 if test "$_shm" = yes ; then
3065 _def_shm='#define HAVE_SHM 1'
3066 else
3067 _def_shm='#undef HAVE_SHM'
3069 echores "$_shm"
3072 # XXX: FIXME, add runtime checking
3073 echocheck "linux devfs"
3074 echores "$_linux_devfs"
3077 echocheck "scandir()"
3078 cat > $TMPC << EOF
3079 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3081 _scandir=no
3082 cc_check && _scandir=yes
3083 if test "$_scandir" = yes ; then
3084 _def_scandir='#define HAVE_SCANDIR 1'
3085 else
3086 _def_scandir='#undef HAVE_SCANDIR'
3088 echores "$_scandir"
3091 echocheck "strsep()"
3092 cat > $TMPC << EOF
3093 #include <string.h>
3094 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3096 _strsep=no
3097 cc_check && _strsep=yes
3098 if test "$_strsep" = yes ; then
3099 _def_strsep='#define HAVE_STRSEP 1'
3100 else
3101 _def_strsep='#undef HAVE_STRSEP'
3103 echores "$_strsep"
3105 echocheck "strlcpy()"
3106 cat > $TMPC << EOF
3107 #include <string.h>
3108 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3110 _strlcpy=no
3111 cc_check && _strlcpy=yes
3112 if test "$_strlcpy" = yes ; then
3113 _def_strlcpy='#define HAVE_STRLCPY 1'
3114 else
3115 _def_strlcpy='#undef HAVE_STRLCPY'
3117 echores "$_strlcpy"
3119 echocheck "strlcat()"
3120 cat > $TMPC << EOF
3121 #include <string.h>
3122 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3124 _strlcat=no
3125 cc_check && _strlcat=yes
3126 if test "$_strlcat" = yes ; then
3127 _def_strlcat='#define HAVE_STRLCAT 1'
3128 else
3129 _def_strlcat='#undef HAVE_STRLCAT'
3131 echores "$_strlcat"
3133 echocheck "fseeko()"
3134 cat > $TMPC << EOF
3135 #include <stdio.h>
3136 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3138 _fseeko=no
3139 cc_check && _fseeko=yes
3140 if test "$_fseeko" = yes ; then
3141 _def_fseeko='#define HAVE_FSEEKO 1'
3142 else
3143 _def_fseeko='#undef HAVE_FSEEKO'
3145 echores "$_fseeko"
3147 echocheck "localtime_r()"
3148 cat > $TMPC << EOF
3149 #include <time.h>
3150 int main( void ) { localtime_r(NULL, NULL); }
3152 _localtime_r=no
3153 cc_check && _localtime_r=yes
3154 if test "$_localtime_r" = yes ; then
3155 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3156 else
3157 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3159 echores "$_localtime_r"
3161 echocheck "vsscanf()"
3162 cat > $TMPC << EOF
3163 #include <stdarg.h>
3164 int main(void) { vsscanf(0, 0, 0); return 0; }
3166 _vsscanf=no
3167 cc_check && _vsscanf=yes
3168 if test "$_vsscanf" = yes ; then
3169 _def_vsscanf='#define HAVE_VSSCANF 1'
3170 else
3171 _def_vsscanf='#undef HAVE_VSSCANF'
3173 echores "$_vsscanf"
3176 echocheck "swab()"
3177 cat > $TMPC << EOF
3178 #include <unistd.h>
3179 int main(void) { swab(0, 0, 0); return 0; }
3181 _swab=no
3182 cc_check && _swab=yes
3183 if test "$_swab" = yes ; then
3184 _def_swab='#define HAVE_SWAB 1'
3185 else
3186 _def_swab='#undef HAVE_SWAB'
3188 echores "$_swab"
3190 echocheck "posix select()"
3191 cat > $TMPC << EOF
3192 #include <stdio.h>
3193 #include <stdlib.h>
3194 #include <sys/types.h>
3195 #include <string.h>
3196 #include <sys/time.h>
3197 #include <unistd.h>
3198 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3200 _posix_select=no
3201 cc_check && _posix_select=yes
3202 if test "$_posix_select" = no ; then
3203 _def_no_posix_select='#define HAVE_NO_POSIX_SELECT 1'
3204 else
3205 _def_no_posix_select='#undef HAVE_NO_POSIX_SELECT'
3207 echores "$_posix_select"
3210 echocheck "gettimeofday()"
3211 cat > $TMPC << EOF
3212 #include <stdio.h>
3213 #include <sys/time.h>
3214 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3216 _gettimeofday=no
3217 cc_check && _gettimeofday=yes
3218 if test "$_gettimeofday" = yes ; then
3219 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3220 else
3221 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3223 echores "$_gettimeofday"
3226 echocheck "glob()"
3227 cat > $TMPC << EOF
3228 #include <stdio.h>
3229 #include <glob.h>
3230 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3232 _glob=no
3233 cc_check && _glob=yes
3234 if test "$_glob" = yes ; then
3235 _def_glob='#define HAVE_GLOB 1'
3236 else
3237 _def_glob='#undef HAVE_GLOB'
3239 echores "$_glob"
3242 echocheck "sys/sysinfo.h"
3243 cat > $TMPC << EOF
3244 #include <sys/sysinfo.h>
3245 int main(void) {
3246 struct sysinfo s_info;
3247 sysinfo(&s_info);
3248 return 0;
3251 _sys_sysinfo=no
3252 cc_check && _sys_sysinfo=yes
3253 if test "$_sys_sysinfo" = yes ; then
3254 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3255 _inc_sysinfo='#include <sys/sysinfo.h>'
3256 else
3257 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3259 echores "$_sys_sysinfo"
3262 echocheck "Mac OS X APIs"
3263 if test "$_macosx" = auto && darwin ; then
3264 productName=`/usr/bin/sw_vers -productName`
3265 if test "$productName" = "Mac OS X" ; then
3266 _macosx=yes
3267 else
3268 _macosx=no
3269 _def_macosx='#undef MACOSX'
3270 _noaomodules="macosx $_noaomodules"
3271 _novomodules="quartz $_novomodules"
3274 if test "$_macosx" = yes ; then
3275 cat > $TMPC <<EOF
3276 #include <Carbon/Carbon.h>
3277 #include <QuickTime/QuickTime.h>
3278 #include <CoreAudio/CoreAudio.h>
3279 int main(void) {
3280 EnterMovies();
3281 ExitMovies();
3282 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3285 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3286 _macosx=yes
3287 _macosx_frameworks="-framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3288 _def_macosx='#define MACOSX 1'
3289 _aosrc="$_aosrc ao_macosx.c"
3290 _aomodules="macosx $_aomodules"
3291 _vosrc="$_vosrc vo_quartz.c"
3292 _vomodules="quartz $_vomodules"
3293 else
3294 _macosx=no
3295 _def_macosx='#undef MACOSX'
3296 _noaomodules="macosx $_noaomodules"
3297 _novomodules="quartz $_novomodules"
3299 cat > $TMPC <<EOF
3300 #include <Carbon/Carbon.h>
3301 #include <QuartzCore/CoreVideo.h>
3302 int main(void) {}
3304 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3305 _vosrc="$_vosrc vo_macosx.m"
3306 _vomodules="macosx $_vomodules"
3307 _macosx_frameworks="$_macosx_frameworks -framework Cocoa -framework QuartzCore -framework OpenGL"
3308 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3309 _macosx_corevideo=yes
3310 else
3311 _novomodules="macosx $_novomodules"
3312 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3313 _macosx_corevideo=no
3316 echores "$_macosx"
3318 echocheck "Mac OS X Finder Support"
3319 if test "$_macosx_finder_support" = auto ; then
3320 _macosx_finder_support=$_macosx
3322 if test "$_macosx_finder_support" = yes; then
3323 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3324 _macosx_finder_support=yes
3325 else
3326 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3327 _macosx_finder_support=no
3329 echores "$_macosx_finder_support"
3331 echocheck "Mac OS X Bundle file locations"
3332 if test "$_macosx_bundle" = auto ; then
3333 _macosx_bundle=$_macosx_finder_support
3335 if test "$_macosx_bundle" = yes; then
3336 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3337 else
3338 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3339 _macosx_bundle=no
3341 echores "$_macosx_bundle"
3343 echocheck "Samba support (libsmbclient)"
3344 if test "$_smbsupport" = yes; then
3345 _ld_smb="-lsmbclient"
3347 if test "$_smbsupport" = auto; then
3348 _smbsupport=no
3349 cat > $TMPC << EOF
3350 #include <libsmbclient.h>
3351 int main(void) { smbc_opendir("smb://"); return 0; }
3353 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3354 cc_check $_ld_tmp && _ld_smb="$_ld_tmp" && _smbsupport=yes && break
3355 done
3358 if test "$_smbsupport" = yes; then
3359 _def_smbsupport="#define LIBSMBCLIENT"
3360 _inputmodules="smb $_inputmodules"
3361 else
3362 _def_smbsupport="#undef LIBSMBCLIENT"
3363 _noinputmodules="smb $_noinputmodules"
3365 echores "$_smbsupport"
3368 #########
3369 # VIDEO #
3370 #########
3373 echocheck "3dfx"
3374 if test "$_3dfx" = yes ; then
3375 _def_3dfx='#define HAVE_3DFX 1'
3376 _vosrc="$_vosrc vo_3dfx.c"
3377 _vomodules="3dfx $_vomodules"
3378 else
3379 _def_3dfx='#undef HAVE_3DFX'
3380 _novomodules="3dfx $_novomodules"
3382 echores "$_3dfx"
3385 echocheck "tdfxfb"
3386 if test "$_tdfxfb" = yes ; then
3387 _def_tdfxfb='#define HAVE_TDFXFB 1'
3388 _vosrc="$_vosrc vo_tdfxfb.c"
3389 _vomodules="tdfxfb $_vomodules"
3390 else
3391 _def_tdfxfb='#undef HAVE_TDFXFB'
3392 _novomodules="tdfxfb $_novomodules"
3394 echores "$_tdfxfb"
3396 echocheck "tdfxvid"
3397 if test "$_tdfxvid" = yes ; then
3398 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3399 _vosrc="$_vosrc vo_tdfx_vid.c"
3400 _vomodules="tdfx_vid $_vomodules"
3401 else
3402 _def_tdfxvid='#undef HAVE_TDFX_VID'
3403 _novomodules="tdfx_vid $_novomodules"
3405 echores "$_tdfxfb"
3407 echocheck "tga"
3408 if test "$_tga" = yes ; then
3409 _def_tga='#define HAVE_TGA 1'
3410 _vosrc="$_vosrc vo_tga.c"
3411 _vomodules="tga $_vomodules"
3412 else
3413 _def_tga='#undef HAVE_TGA'
3414 _novomodules="tga $_novomodules"
3416 echores "$_tga"
3418 echocheck "DirectFB headers presence"
3419 if test -z "$_inc_directfb" ; then
3420 for I in /usr/include /usr/local/include $_inc_extra; do
3421 if test -d "$I/directfb" && test -f "$I/directfb/directfb.h" ; then
3422 _inc_directfb="-I$I/directfb"
3423 echores "yes (using $_inc_directfb)"
3424 break
3426 if test -d "$I" && test -f "$I/directfb.h" ; then
3427 _inc_directfb="-I$I"
3428 echores "yes (using $_inc_directfb)"
3429 break
3431 done
3432 if test -z "$_inc_directfb" ; then
3433 _directfb=no
3434 echores "not found"
3436 else
3437 echores "yes (using $_inc_directfb)"
3439 if test "$_inc_directfb" = "-I/usr/include" ; then
3440 _inc_directfb=""
3443 echocheck "DirectFB"
3444 if test "$_directfb" = auto ; then
3445 _directfb=no
3446 cat > $TMPC <<EOF
3447 #include <directfb.h>
3448 int main(void) { IDirectFB *foo; return 0; }
3450 linux && test -c /dev/fb0 && cc_check $_inc_directfb -ldirectfb && _directfb=yes
3453 if test "$_directfb" = yes; then
3454 cat > $TMPC <<EOF
3455 #include <directfb.h>
3456 int main(void) {
3457 printf ("%i",(directfb_major_version*100+directfb_minor_version)*100+directfb_micro_version);
3458 return 0;
3461 if cc_check $_inc_directfb -ldirectfb && "$TMPO" >> "$TMPLOG" ; then
3462 _directfb_version=`"$TMPO"`
3463 _def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
3464 if test "$_directfb_version" -ge 913; then
3465 _res_comment="$_directfb_version"
3466 else
3467 _def_directfb_version='#undef DIRECTFBVERSION'
3468 _directfb=no
3469 _res_comment="version >=0.9.13 required"
3471 else
3472 _directfb=no
3473 _res_comment="failed to get version"
3476 echores "$_directfb"
3478 if test "$_directfb" = yes ; then
3479 _def_directfb='#define HAVE_DIRECTFB 1'
3480 if test "$_directfb_version" -ge 913; then
3481 _vosrc="$_vosrc vo_directfb2.c"
3482 _vomodules="directfb $_vomodules"
3483 _ld_directfb='-ldirectfb'
3486 if test "$_directfb_version" -ge 915; then
3487 _vosrc="$_vosrc vo_dfbmga.c"
3488 _vomodules="dfbmga $_vomodules"
3490 else
3491 _def_directfb='#undef HAVE_DIRECTFB'
3492 _novomodules="directfb $_novomodules"
3493 _inc_directfb=""
3497 echocheck "X11 headers presence"
3498 if test -z "$_inc_x11" ; then
3499 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3500 if test -d "$I/X11" && test -f "$I/X11/Xlib.h" ; then
3501 _inc_x11="-I$I"
3502 echores "yes (using $I)"
3503 break
3505 done
3506 if test -z "$_inc_x11" ; then
3507 _x11=no
3508 echores "not found (check if the dev(el) packages are installed)"
3510 else
3511 echores "yes (using $_inc_x11)"
3513 if test "$_inc_x11" = "-I/usr/include" ; then
3514 _inc_x11=""
3518 echocheck "X11"
3519 if test "$_x11" != no ; then
3520 cat > $TMPC <<EOF
3521 #include <X11/Xlib.h>
3522 #include <X11/Xutil.h>
3523 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3525 if test -z "$_x11_paths" ; then
3526 _x11_paths="/usr/X11R6/lib /usr/lib/X11R6 /usr/X11/lib /usr/lib32 /usr/openwin/lib /usr/X11R6/lib64 /usr/lib"
3528 for I in $_x11_paths ; do
3529 _ld_x11="-L$I -lXext -lX11 $_ld_sock $_ld_pthread"
3530 if netbsd; then
3531 _ld_x11="$_ld_x11 -Wl,-R$I"
3533 if test -d "$I" && cc_check $_inc_x11 $_ld_x11 ; then
3534 _x11=yes
3535 break
3537 done
3539 if test "$_x11" = yes ; then
3540 _def_x11='#define HAVE_X11 1'
3541 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3542 _vomodules="x11 xover $_vomodules"
3543 _res_comment="using $I"
3544 else
3545 _x11=no
3546 _def_x11='#undef HAVE_X11'
3547 _inc_x11=''
3548 _ld_x11=''
3549 _novomodules="x11 $_novomodules"
3550 _res_comment="check if the dev(el) packages are installed"
3552 echores "$_x11"
3555 echocheck "DPMS"
3556 _xdpms3=no
3557 _xdpms4=no
3558 if test "$_x11" = yes ; then
3559 cat > $TMPC <<EOF
3560 #include <X11/Xmd.h>
3561 #include <X11/Xlib.h>
3562 #include <X11/Xutil.h>
3563 #include <X11/Xatom.h>
3564 #include <X11/extensions/dpms.h>
3565 int main(void) {
3566 (void) DPMSQueryExtension(0, 0, 0);
3569 cc_check $_inc_x11 -lXdpms $_ld_x11 && _xdpms3=yes
3570 cat > $TMPC <<EOF
3571 #include <X11/Xlib.h>
3572 #include <X11/extensions/dpms.h>
3573 int main(void) {
3574 (void) DPMSQueryExtension(0, 0, 0);
3577 cc_check $_inc_x11 $_ld_x11 && _xdpms4=yes
3579 if test "$_xdpms4" = yes ; then
3580 _def_xdpms='#define HAVE_XDPMS 1'
3581 echores "yes (using Xdpms 4)"
3582 elif test "$_xdpms3" = yes ; then
3583 _def_xdpms='#define HAVE_XDPMS 1'
3584 _ld_x11="-lXdpms $_ld_x11"
3585 echores "yes (using Xdpms 3)"
3586 else
3587 _def_xdpms='#undef HAVE_XDPMS'
3588 echores "no"
3592 echocheck "Xv"
3593 if test "$_x11" = yes && test "$_xv" != no ; then
3594 cat > $TMPC <<EOF
3595 #include <X11/Xlib.h>
3596 #include <X11/extensions/Xvlib.h>
3597 int main(void) {
3598 (void) XvGetPortAttribute(0, 0, 0, 0);
3599 (void) XvQueryPortAttributes(0, 0, 0);
3600 return 0; }
3602 _xv=no
3603 cc_check $_inc_x11 -lXv $_ld_x11 && _xv=yes
3604 else
3605 _xv=no
3607 if test "$_xv" = yes ; then
3608 _def_xv='#define HAVE_XV 1'
3609 _ld_xv='-lXv'
3610 _vosrc="$_vosrc vo_xv.c"
3611 _vomodules="xv $_vomodules"
3612 else
3613 _def_xv='#undef HAVE_XV'
3614 _novomodules="xv $_novomodules"
3616 echores "$_xv"
3619 echocheck "XvMC"
3620 if test "$_x11" = yes && test "$_xv" = yes && test "$_xvmc" != no ; then
3621 _xvmc=no
3622 cat > $TMPC <<EOF
3623 #include <X11/Xlib.h>
3624 #include <X11/extensions/Xvlib.h>
3625 #include <X11/extensions/XvMClib.h>
3626 int main(void) {
3627 (void) XvMCQueryExtension(0,0,0);
3628 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3629 return 0; }
3631 cc_check $_inc_x11 -lXvMC -l$_xvmclib $_ld_xv $_ld_x11 && _xvmc=yes
3633 if test "$_xvmc" = yes ; then
3634 _def_xvmc='#define HAVE_XVMC 1'
3635 _ld_xvmc="-lXvMC -l$_xvmclib"
3636 _vosrc="$_vosrc vo_xvmc.c"
3637 _vomodules="xvmc $_vomodules"
3638 else
3639 _def_xvmc='#undef HAVE_XVMC'
3640 _novomodules="xvmc $_novomodules"
3642 echores "$_xvmc"
3645 echocheck "Xinerama"
3646 if test "$_x11" = yes && test "$_xinerama" != no ; then
3647 cat > $TMPC <<EOF
3648 #include <X11/Xlib.h>
3649 #include <X11/extensions/Xinerama.h>
3650 int main(void) { (void) XineramaIsActive(0); return 0; }
3652 _xinerama=no
3653 cc_check $_inc_x11 -lXinerama $_ld_x11 && _xinerama=yes
3654 else
3655 _xinerama=no
3657 if test "$_xinerama" = yes ; then
3658 _def_xinerama='#define HAVE_XINERAMA 1'
3659 _ld_xinerama='-lXinerama'
3660 else
3661 _def_xinerama='#undef HAVE_XINERAMA'
3663 echores "$_xinerama"
3666 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3667 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3668 # named 'X extensions' or something similar.
3669 # This check may be useful for future mplayer versions (to change resolution)
3670 # If you run into problems, remove '-lXxf86vm'.
3671 echocheck "Xxf86vm"
3672 if test "$_x11" = yes && test "$_vm" = auto ; then
3673 cat > $TMPC <<EOF
3674 #include <X11/Xlib.h>
3675 #include <X11/extensions/xf86vmode.h>
3676 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3678 _vm=no
3679 cc_check $_inc_x11 -lXxf86vm $_ld_x11 && _vm=yes
3681 if test "$_vm" = yes ; then
3682 _def_vm='#define HAVE_XF86VM 1'
3683 _ld_vm='-lXxf86vm'
3684 else
3685 _def_vm='#undef HAVE_XF86VM'
3687 echores "$_vm"
3689 # Check for the presence of special keycodes, like audio control buttons
3690 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3691 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3692 # have these new keycodes.
3693 echocheck "XF86keysym"
3694 if test "$_xf86keysym" = auto; then
3695 _xf86keysym=no
3696 if test "$_x11" = yes ; then
3697 cat > $TMPC <<EOF
3698 #include <X11/Xlib.h>
3699 #include <X11/XF86keysym.h>
3700 int main(void) { return XF86XK_AudioPause; }
3702 cc_check $_inc_x11 $_ld_x11 && _xf86keysym=yes
3705 if test "$_xf86keysym" = yes ; then
3706 _def_xf86keysym='#define HAVE_XF86XK 1'
3707 else
3708 _def_xf86keysym='#undef HAVE_XF86XK'
3710 echores "$_xf86keysym"
3712 echocheck "DGA"
3713 if test "$_x11" = no ; then
3714 _dga=no
3716 # Version 2 is preferred to version 1 if available
3717 if test "$_dga" = auto ; then
3718 cat > $TMPC << EOF
3719 #include <X11/Xlib.h>
3720 #include <X11/extensions/xf86dga.h>
3721 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
3723 _dga=no
3724 cc_check $_inc_x11 -lXxf86dga -lXxf86vm $_ld_x11 && _dga=1
3726 cat > $TMPC << EOF
3727 #include <X11/Xlib.h>
3728 #include <X11/extensions/xf86dga.h>
3729 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
3731 cc_check $_inc_x11 -lXxf86dga $_ld_x11 && _dga=2
3734 _def_dga='#undef HAVE_DGA'
3735 _def_dga2='#undef HAVE_DGA2'
3736 if test "$_dga" = 1 ; then
3737 _def_dga='#define HAVE_DGA 1'
3738 _ld_dga='-lXxf86dga'
3739 _vosrc="$_vosrc vo_dga.c"
3740 _vomodules="dga $_vomodules"
3741 echores "yes (using DGA 1.0)"
3742 elif test "$_dga" = 2 ; then
3743 _def_dga='#define HAVE_DGA 1'
3744 _def_dga2='#define HAVE_DGA2 1'
3745 _ld_dga='-lXxf86dga'
3746 _vosrc="$_vosrc vo_dga.c"
3747 _vomodules="dga $_vomodules"
3748 echores "yes (using DGA 2.0)"
3749 elif test "$_dga" = no ; then
3750 echores "no"
3751 _novomodules="dga $_novomodules"
3752 else
3753 die "DGA version must be 1 or 2"
3757 echocheck "OpenGL"
3758 #Note: this test is run even with --enable-gl since we autodetect $_ld_gl
3759 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
3760 cat > $TMPC << EOF
3761 #include <GL/gl.h>
3762 int main(void) { return 0; }
3764 _gl=no
3765 if cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm ; then
3766 _gl=yes
3767 _ld_gl="-lGL $_ld_dl"
3768 elif cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm $_ld_pthread ; then
3769 _gl=yes
3770 _ld_gl="-lGL $_ld_pthread $_ld_dl"
3771 elif cc_check -lopengl32 ; then
3772 _gl=yes
3773 _gl_win32=yes
3774 _ld_gl="-lopengl32 -lgdi32"
3776 else
3777 _gl=no
3779 if test "$_gl" = yes ; then
3780 _def_gl='#define HAVE_GL 1'
3781 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
3782 if test "$_gl_win32" = yes ; then
3783 _def_gl_win32='#define GL_WIN32 1'
3784 _vosrc="$_vosrc w32_common.c"
3785 _res_comment="win32 version"
3787 _vomodules="opengl $_vomodules"
3788 else
3789 _def_gl='#undef HAVE_GL'
3790 _def_gl_win32='#undef GL_WIN32'
3791 _novomodules="opengl $_novomodules"
3793 echores "$_gl"
3796 echocheck "/dev/mga_vid"
3797 if test "$_mga" = auto ; then
3798 _mga=no
3799 test -c /dev/mga_vid && _mga=yes
3801 if test "$_mga" = yes ; then
3802 _def_mga='#define HAVE_MGA 1'
3803 _vosrc="$_vosrc vo_mga.c"
3804 _vomodules="mga $_vomodules"
3805 else
3806 _def_mga='#undef HAVE_MGA'
3807 _novomodules="mga $_novomodules"
3809 echores "$_mga"
3812 # echocheck "syncfb"
3813 # _syncfb=no
3814 # test "$_mga" = yes && _syncfb=yes
3815 # if test "$_syncfb" = yes ; then
3816 # _def_syncfb='#define HAVE_SYNCFB 1'
3817 # _vosrc="$_vosrc vo_syncfb.c"
3818 # else
3819 # _def_syncfb='#undef HAVE_SYNCFB'
3820 # fi
3821 # echores "$_syncfb"
3824 echocheck "xmga"
3825 if test "$_xmga" = auto ; then
3826 _xmga=no
3827 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
3829 if test "$_xmga" = yes ; then
3830 _def_xmga='#define HAVE_XMGA 1'
3831 _vosrc="$_vosrc vo_xmga.c"
3832 _vomodules="xmga $_vomodules"
3833 else
3834 _def_xmga='#undef HAVE_XMGA'
3835 _novomodules="xmga $_novomodules"
3837 echores "$_xmga"
3840 echocheck "GGI"
3841 if test "$_ggi" = auto ; then
3842 cat > $TMPC << EOF
3843 #include <ggi/ggi.h>
3844 int main(void) { return 0; }
3846 _ggi=no
3847 cc_check -lggi && _ggi=yes
3849 if test "$_ggi" = yes ; then
3850 _def_ggi='#define HAVE_GGI 1'
3851 _ld_ggi='-lggi'
3852 _vosrc="$_vosrc vo_ggi.c"
3853 _vomodules="ggi $_vomodules"
3854 else
3855 _def_ggi='#undef HAVE_GGI'
3856 _novomodules="ggi $_novomodules"
3858 echores "$_ggi"
3860 echocheck "GGI extension: libggiwmh"
3861 if test "$_ggiwmh" = auto ; then
3862 _ggiwmh=no
3863 cat > $TMPC << EOF
3864 #include <ggi/ggi.h>
3865 #include <ggi/wmh.h>
3866 int main(void) { return 0; }
3868 cc_check -lggi -lggiwmh && _ggiwmh=yes
3870 # needed to get right output on obscure combination
3871 # like --disable-ggi --enable-ggiwmh
3872 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
3873 _def_ggiwmh='#define HAVE_GGIWMH 1'
3874 _ld_ggi="$_ld_ggi -lggiwmh"
3875 else
3876 _ggiwmh=no
3877 _def_ggiwmh='#undef HAVE_GGIWMH'
3879 echores "$_ggiwmh"
3882 echocheck "AA"
3883 if test "$_aa" = auto ; then
3884 cat > $TMPC << EOF
3885 #include <aalib.h>
3886 extern struct aa_hardware_params aa_defparams;
3887 extern struct aa_renderparams aa_defrenderparams;
3888 int main(void) {
3889 aa_context *c;
3890 aa_renderparams *p;
3891 (void) aa_init(0, 0, 0);
3892 c = aa_autoinit(&aa_defparams);
3893 p = aa_getrenderparams();
3894 aa_autoinitkbd(c,0);
3895 return 0; }
3897 _aa=no
3898 for _ld_tmp in "-laa" "$_ld_x11 -laa" ; do
3899 cc_check $_ld_tmp && _ld_aa=$_ld_tmp && _aa=yes && break
3900 done
3902 if test "$_aa" = yes ; then
3903 _def_aa='#define HAVE_AA 1'
3904 if cygwin ; then
3905 _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6`
3907 _vosrc="$_vosrc vo_aa.c"
3908 _vomodules="aa $_vomodules"
3909 else
3910 _def_aa='#undef HAVE_AA'
3911 _novomodules="aa $_novomodules"
3913 echores "$_aa"
3916 echocheck "CACA"
3917 if test "$_caca" = auto ; then
3918 _caca=no
3919 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3920 cat > $TMPC << EOF
3921 #include <caca.h>
3922 int main(void) { (void) caca_init(); return 0; }
3924 cc_check `caca-config --libs` && _caca=yes
3927 if test "$_caca" = yes ; then
3928 _def_caca='#define HAVE_CACA 1'
3929 _inc_caca=`caca-config --cflags`
3930 _ld_caca=`caca-config --libs`
3931 _vosrc="$_vosrc vo_caca.c"
3932 _vomodules="caca $_vomodules"
3933 else
3934 _def_caca='#undef HAVE_CACA'
3935 _novomodules="caca $_novomodules"
3937 echores "$_caca"
3940 echocheck "SVGAlib"
3941 if test "$_svga" = auto ; then
3942 cat > $TMPC << EOF
3943 #include <vga.h>
3944 int main(void) { return 0; }
3946 _svga=no
3947 cc_check -lvga $_ld_lm && _svga=yes
3949 if test "$_svga" = yes ; then
3950 _def_svga='#define HAVE_SVGALIB 1'
3951 _ld_svga="-lvga"
3952 _vosrc="$_vosrc vo_svga.c"
3953 _vomodules="svga $_vomodules"
3954 else
3955 _def_svga='#undef HAVE_SVGALIB'
3956 _novomodules="svga $_novomodules"
3958 echores "$_svga"
3961 echocheck "FBDev"
3962 if test "$_fbdev" = auto ; then
3963 _fbdev=no
3964 linux && test -c /dev/fb0 && _fbdev=yes
3966 if test "$_fbdev" = yes ; then
3967 _def_fbdev='#define HAVE_FBDEV 1'
3968 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
3969 _vomodules="fbdev $_vomodules"
3970 else
3971 _def_fbdev='#undef HAVE_FBDEV'
3972 _novomodules="fbdev $_novomodules"
3974 echores "$_fbdev"
3978 echocheck "DVB"
3979 if test "$_dvb" != no ; then
3980 _dvb=no
3981 cat >$TMPC << EOF
3982 #include <sys/poll.h>
3983 #include <sys/ioctl.h>
3984 #include <stdio.h>
3985 #include <time.h>
3986 #include <unistd.h>
3988 #include <ost/dmx.h>
3989 #include <ost/frontend.h>
3990 #include <ost/sec.h>
3991 #include <ost/video.h>
3992 #include <ost/audio.h>
3993 int main(void) {return 0;}
3995 if cc_check ; then
3996 _dvb=yes
3997 else
3998 for I in "$_inc_dvb" "-I/usr/src/DVB/ost/include" ; do
3999 if cc_check "$I" ; then
4000 _dvb=yes
4001 _inc_dvb="$I"
4002 _res_comment="using $_inc_dvb"
4003 break
4005 done
4006 test "$_dvb" = no && _res_comment="specify path to DVB/ost/include with --with-dvbincdir=DIR"
4009 echores "$_dvb"
4010 if test "$_dvb" = yes ; then
4011 _def_dvb='#define HAVE_DVB 1'
4012 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4013 _aomodules="mpegpes(dvb) $_aomodules"
4014 _vomodules="mpegpes(dvb) $_vomodules"
4016 if test "$_dvbhead" != no ; then
4017 echocheck "DVB HEAD"
4018 if test "$_dvbhead" != no ; then
4019 _dvbhead=no
4021 cat >$TMPC << EOF
4022 #include <sys/poll.h>
4023 #include <sys/ioctl.h>
4024 #include <stdio.h>
4025 #include <time.h>
4026 #include <unistd.h>
4028 #include <linux/dvb/dmx.h>
4029 #include <linux/dvb/frontend.h>
4030 #include <linux/dvb/video.h>
4031 #include <linux/dvb/audio.h>
4032 int main(void) {return 0;}
4034 if cc_check ; then
4035 _dvbhead=yes
4036 else
4037 for I in "$_inc_dvb" "-I/usr/src/DVB/include" ; do
4038 if cc_check "$I" ; then
4039 _dvbhead=yes
4040 _inc_dvb="$I"
4041 _res_comment="using $_inc_dvb"
4042 break
4044 done
4045 test "$_dvbhead" = no && _res_comment="specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR"
4048 echores "$_dvbhead"
4049 if test "$_dvbhead" = yes ; then
4050 _def_dvb='#define HAVE_DVB_HEAD 1'
4051 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4052 _aomodules="mpegpes(dvb) $_aomodules"
4053 _vomodules="mpegpes(dvb) $_vomodules"
4056 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4057 _def_dvb='#undef HAVE_DVB'
4058 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4059 _aomodules="mpegpes(file) $_aomodules"
4060 _vomodules="mpegpes(file) $_vomodules"
4063 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4064 _dvbin=yes
4065 _inputmodules="dvb $_inputmodules"
4066 else
4067 _dvbin=no
4068 _noinputmodules="dvb $_noinputmodules"
4071 echocheck "PNG support"
4072 if test "$_png" = auto ; then
4073 _png=no
4074 if irix ; then
4075 # Don't check for -lpng on irix since it has its own libpng
4076 # incompatible with the GNU libpng
4077 _res_comment="disabled on irix (not GNU libpng)"
4078 else
4079 cat > $TMPC << EOF
4080 #include <png.h>
4081 #include <string.h>
4082 int main(void) {
4083 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4084 printf("libpng: %s\n", png_libpng_ver);
4085 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4088 if cc_check -lpng -lz $_ld_lm ; then
4089 if "$TMPO" >> "$TMPLOG" ; then
4090 _png=yes
4091 else
4092 _res_comment="mismatch of library and header versions"
4097 echores "$_png"
4098 if test "$_png" = yes ; then
4099 _def_png='#define HAVE_PNG 1'
4100 _ld_png='-lpng -lz'
4101 _vosrc="$_vosrc vo_png.c"
4102 _vomodules="png $_vomodules"
4103 _mkf_png="yes"
4104 else
4105 _def_png='#undef HAVE_PNG'
4106 _novomodules="png $_novomodules"
4107 _mkf_png="no"
4110 echocheck "JPEG support"
4111 if test "$_jpg" = auto ; then
4112 _jpg=no
4113 cat > $TMPC << EOF
4114 #include <stdio.h>
4115 #include <stdlib.h>
4116 #include <setjmp.h>
4117 #include <string.h>
4118 #include <jpeglib.h>
4119 int main(void) {
4120 return 0;
4123 if cc_check -ljpeg $_ld_lm ; then
4124 if "$TMPO" >> "$TMPLOG" ; then
4125 _jpg=yes
4129 echores "$_jpg"
4131 if test "$_jpg" = yes ; then
4132 _def_jpg='#define HAVE_JPEG 1'
4133 _vosrc="$_vosrc vo_jpeg.c"
4134 _vomodules="jpeg $_vomodules"
4135 _ld_jpg="-ljpeg"
4136 _mkf_jpg="yes"
4137 else
4138 _def_jpg='#undef HAVE_JPEG'
4139 _novomodules="jpeg $_novomodules"
4140 _mkf_jpg="no"
4145 echocheck "PNM support"
4146 if test "$_pnm" = yes; then
4147 _def_pnm="#define HAVE_PNM"
4148 _vosrc="$_vosrc vo_pnm.c"
4149 _vomodules="pnm $_vomodules"
4150 else
4151 _def_pnm="#undef HAVE_PNM"
4152 _novomodules="pnm $_novomodules"
4154 echores "$_pnm"
4158 echocheck "md5sum support"
4159 if test "$_md5sum" = yes; then
4160 _def_md5sum="#define HAVE_MD5SUM"
4161 _vosrc="$_vosrc vo_md5sum.c md5sum.c"
4162 _vomodules="md5sum $_vomodules"
4163 else
4164 _def_md5sum="#undef HAVE_MD5SUM"
4165 _novomodules="md5sum $_novomodules"
4167 echores "$_md5sum"
4171 echocheck "GIF support"
4172 # This is to appease people who want to force gif support.
4173 # If it is forced to yes, then we still do checks to determine
4174 # which gif library to use.
4175 if test "$_gif" = yes ; then
4176 _force_gif=yes
4177 _gif=auto
4180 if test "$_gif" = auto ; then
4181 _gif=no
4182 cat > $TMPC << EOF
4183 #include <gif_lib.h>
4184 int main(void) {
4185 return 0;
4188 for _ld_tmp in "-lungif" "-lungif $_ld_x11" "-lgif" "-lgif $_ld_x11" ; do
4189 cc_check $_ld_tmp && "$TMPO" >> "$TMPLOG" && _ld_gif="$_ld_tmp" && _gif=yes && break
4190 done
4193 # If no library was found, and the user wants support forced,
4194 # then we force it on with libgif, as this is the safest
4195 # assumption IMHO. (libungif & libregif both create symbolic
4196 # links to libgif. We also assume that no x11 support is needed,
4197 # because if you are forcing this, then you _should_ know what
4198 # you are doing. [ Besides, package maintainers should never
4199 # have compiled x11 deps into libungif in the first place. ] )
4200 # </rant>
4201 # --Joey
4202 if test "$_force_gif" = yes && test "$_gif" = no ; then
4203 _gif=yes
4204 _ld_gif="-lgif"
4207 if test "$_gif" = yes ; then
4208 _def_gif='#define HAVE_GIF 1'
4209 _vosrc="$_vosrc vo_gif89a.c"
4210 _codecmodules="gif $_codecmodules"
4211 _vomodules="gif89a $_vomodules"
4212 _mkf_gif="yes"
4213 _gif="yes (old version, some encoding functions disabled)"
4214 _def_gif_4='#undef HAVE_GIF_4'
4216 cat > $TMPC << EOF
4217 #include <signal.h>
4218 #include <gif_lib.h>
4219 void catch() { exit(1); }
4220 int main(void) {
4221 signal(SIGSEGV, catch); // catch segfault
4222 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4223 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4224 return 0;
4227 if cc_check "$_ld_gif" && ( "$TMPO" ) >>"$TMPLOG" 2>&1 ; then
4228 _def_gif_4='#define HAVE_GIF_4 1'
4229 _gif="yes"
4231 else
4232 _def_gif='#undef HAVE_GIF'
4233 _def_gif_4='#undef HAVE_GIF_4'
4234 _novomodules="gif89a $_novomodules"
4235 _nocodecmodules="gif $_nocodecmodules"
4236 _mkf_gif="no"
4238 echores "$_gif"
4241 case "$_gif" in yes*)
4242 echocheck "broken giflib workaround"
4243 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4245 cat > $TMPC << EOF
4246 #include <gif_lib.h>
4247 int main(void) {
4248 GifFileType gif;
4249 printf("UserData is at address %p\n", gif.UserData);
4250 return 0;
4253 if cc_check "$_ld_gif" && "$TMPO" >>"$TMPLOG" 2>&1 ; then
4254 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4255 echores "disabled"
4256 else
4257 echores "enabled"
4260 esac
4263 echocheck "VESA support"
4264 if test "$_vesa" = auto ; then
4265 cat > $TMPC << EOF
4266 #include <vbe.h>
4267 int main(void) { vbeVersion(); return 0; }
4269 _vesa=no
4270 cc_check -lvbe -llrmi && _vesa=yes
4272 if test "$_vesa" = yes ; then
4273 _def_vesa='#define HAVE_VESA 1'
4274 _ld_vesa="-lvbe -llrmi"
4275 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c gtf.c"
4276 _vomodules="vesa $_vomodules"
4277 else
4278 _def_vesa='#undef HAVE_VESA'
4279 _novomodules="vesa $_novomodules"
4281 echores "$_vesa"
4283 #################
4284 # VIDEO + AUDIO #
4285 #################
4288 echocheck "SDL"
4289 if test -z "$_sdlconfig" ; then
4290 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4291 _sdlconfig="sdl-config"
4292 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4293 _sdlconfig="sdl11-config"
4294 else
4295 _sdlconfig=false
4298 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4299 cat > $TMPC << EOF
4300 #include <SDL.h>
4301 int main(int argc, char *argv[]) { return 0; }
4303 _sdl=no
4304 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4305 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4306 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4307 if test "$_sdlversion" -gt 116 ; then
4308 if test "$_sdlversion" -lt 121 ; then
4309 _def_sdlbuggy='#define BUGGY_SDL'
4310 else
4311 _def_sdlbuggy='#undef BUGGY_SDL'
4313 _sdl=yes
4314 else
4315 _res_comment=outdated
4320 if test "$_sdl" = yes ; then
4321 _def_sdl='#define HAVE_SDL 1'
4322 if cygwin ; then
4323 _ld_sdl=`$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`
4324 _inc_sdl=`$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`
4325 elif mingw32 ; then
4326 _ld_sdl=`$_sdlconfig --libs | sed s/-mwindows//`
4327 _inc_sdl=`$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`
4328 else
4329 _ld_sdl=`$_sdlconfig --libs`
4330 _inc_sdl=`$_sdlconfig --cflags`
4332 _vosrc="$_vosrc vo_sdl.c"
4333 _vomodules="sdl $_vomodules"
4334 _aosrc="$_aosrc ao_sdl.c"
4335 _aomodules="sdl $_aomodules"
4336 _res_comment="using $_sdlconfig"
4337 else
4338 _def_sdl='#undef HAVE_SDL'
4339 _novomodules="sdl $_novomodules"
4340 _noaomodules="sdl $_noaomodules"
4342 echores "$_sdl"
4344 echocheck "Windows waveout"
4345 if test "$_win32waveout" = auto ; then
4346 cat > $TMPC << EOF
4347 #include <windows.h>
4348 #include <mmsystem.h>
4349 int main(void) { return 0; }
4351 _win32waveout=no
4352 cc_check -lwinmm && _win32waveout=yes
4354 if test "$_win32waveout" = yes ; then
4355 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4356 _ld_win32libs="-lwinmm $_ld_win32libs"
4357 _aosrc="$_aosrc ao_win32.c"
4358 _aomodules="win32 $_aomodules"
4359 else
4360 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4361 _noaomodules="win32 $_noaomodules"
4363 echores "$_win32waveout"
4365 echocheck "Directx"
4366 if test "$_directx" = auto ; then
4367 cat > $TMPC << EOF
4368 #include <windows.h>
4369 #include <ddraw.h>
4370 #include <dsound.h>
4371 int main(void) { return 0; }
4373 _directx=no
4374 cc_check -lgdi32 && _directx=yes
4376 if test "$_directx" = yes ; then
4377 _def_directx='#define HAVE_DIRECTX 1'
4378 _ld_win32libs="-lgdi32 $_ld_win32libs"
4379 _vosrc="$_vosrc vo_directx.c"
4380 _vomodules="directx $_vomodules"
4381 _aosrc="$_aosrc ao_dsound.c"
4382 _aomodules="dsound $_aomodules"
4383 else
4384 _def_directx='#undef HAVE_DIRECTX'
4385 _novomodules="directx $_novomodules"
4386 _noaomodules="dsound $_noaomodules"
4388 echores "$_directx"
4390 echocheck "NAS"
4391 if test "$_nas" = auto ; then
4392 cat > $TMPC << EOF
4393 #include <audio/audiolib.h>
4394 int main(void) { return 0; }
4396 _nas=no
4397 cc_check -laudio $_inc_x11 -lXt $_ld_x11 $_ld_lm && _nas=yes
4399 if test "$_nas" = yes ; then
4400 _def_nas='#define HAVE_NAS 1'
4401 _ld_nas="-laudio -lXt $_ld_x11"
4402 _aosrc="$_aosrc ao_nas.c"
4403 _aomodules="nas $_aomodules"
4404 else
4405 _noaomodules="nas $_noaomodules"
4406 _def_nas='#undef HAVE_NAS'
4408 echores "$_nas"
4410 echocheck "DXR2"
4411 if test "$_dxr2" = auto; then
4412 _dxr2=no
4413 cat > $TMPC << EOF
4414 #include <dxr2ioctl.h>
4415 int main(void) { return 0; }
4417 for _inc_dxr2 in "$_inc_dxr2" \
4418 "-I/usr/local/include/dxr2" \
4419 "-I/usr/include/dxr2"; do
4420 cc_check $_inc_dxr2 && _dxr2=yes && break
4421 done
4423 if test "$_dxr2" = yes; then
4424 _def_dxr2='#define HAVE_DXR2 1'
4425 _vosrc="$_vosrc vo_dxr2.c"
4426 _aosrc="$_aosrc ao_dxr2.c"
4427 _aomodules="dxr2 $_aomodules"
4428 _vomodules="dxr2 $_vomodules"
4429 _res_comment="using $_inc_dxr2"
4430 else
4431 _def_dxr2='#undef HAVE_DXR2'
4432 _noaomodules="dxr2 $_noaomodules"
4433 _novomodules="dxr2 $_novomodules"
4434 _inc_dxr2=""
4436 echores "$_dxr2"
4438 echocheck "DXR3/H+"
4439 if test "$_dxr3" = auto ; then
4440 cat > $TMPC << EOF
4441 #include <linux/em8300.h>
4442 int main(void) { return 0; }
4444 _dxr3=no
4445 cc_check && _dxr3=yes
4447 if test "$_dxr3" = yes ; then
4448 _def_dxr3='#define HAVE_DXR3 1'
4449 _vosrc="$_vosrc vo_dxr3.c"
4450 _vomodules="dxr3 $_vomodules"
4451 else
4452 _def_dxr3='#undef HAVE_DXR3'
4453 _novomodules="dxr3 $_novomodules"
4454 if test "$_mp1e" = auto ; then
4455 # we don't need mp1e
4456 _mp1e=no
4459 echores "$_dxr3"
4461 echocheck "libmp1e"
4462 if test "$_mmx" = no ; then
4463 # mp1e REQUIRES mmx!
4464 _mp1e=no
4466 if test "$_mp1e" != no ; then
4467 _mp1e=yes
4468 _def_mp1e='#define USE_MP1E'
4469 _ld_mp1e='libmp1e/libmp1e.a'
4470 _dep_mp1e='libmp1e/libmp1e.a'
4471 else
4472 _mp1e=no
4473 _def_mp1e='#undef USE_MP1E'
4474 _ld_mp1e=""
4475 _dep_mp1e=''
4477 echores "$_mp1e"
4480 echocheck "libfame"
4481 if test "$_fame" = auto ; then
4482 _fame=no
4483 test "$_dxr2" = yes && _fame=auto
4484 test "$_dxr3" = yes && _fame=auto
4485 test "$_dvb" = yes && _fame=auto
4487 if test "$_fame" = auto ; then
4488 _fame=no
4489 if test -d libfame && test -f libfame/fame.h ; then
4490 # disable fame on cygwin as no sense to port - atmos
4491 cygwin || _fame=yes
4492 else
4493 _res_comment="no fame dir"
4496 echores "$_fame"
4498 _def_fame='#undef USE_LIBFAME'
4499 if test "$_fame" = yes ; then
4500 _def_fame='#define USE_LIBFAME 1'
4501 _ld_fame='libfame/libfame.a'
4505 #########
4506 # AUDIO #
4507 #########
4510 echocheck "OSS Audio"
4511 if test "$_ossaudio" = auto ; then
4512 cat > $TMPC << EOF
4513 #include <sys/ioctl.h>
4514 $_inc_soundcard
4515 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4517 _ossaudio=no
4518 cc_check && _ossaudio=yes
4520 if test "$_ossaudio" = yes ; then
4521 _def_ossaudio='#define USE_OSS_AUDIO 1'
4522 _aosrc="$_aosrc ao_oss.c"
4523 _aomodules="oss $_aomodules"
4524 if test "$_linux_devfs" = yes; then
4525 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4526 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4527 else
4528 cat > $TMPC << EOF
4529 #include <sys/ioctl.h>
4530 $_inc_soundcard
4531 #ifdef OPEN_SOUND_SYSTEM
4532 int main(void) { return 0; }
4533 #else
4534 #error Not the real thing
4535 #endif
4537 _real_ossaudio=no
4538 cc_check && _real_ossaudio=yes
4539 if test "$_real_ossaudio" = yes; then
4540 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4541 elif netbsd || openbsd ; then
4542 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4543 _ld_arch="$_ld_arch -lossaudio"
4544 else
4545 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4547 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4549 else
4550 _def_ossaudio='#undef USE_OSS_AUDIO'
4551 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4552 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4553 _noaomodules="oss $_noaomodules"
4555 echores "$_ossaudio"
4558 echocheck "aRts"
4559 if test "$_arts" = auto ; then
4560 _arts=no
4561 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4563 cat > $TMPC << EOF
4564 #include <artsc.h>
4565 int main(void) { return 0; }
4567 cc_check `artsc-config --libs` `artsc-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _arts=yes
4572 if test "$_arts" = yes ; then
4573 _def_arts='#define USE_ARTS 1'
4574 _aosrc="$_aosrc ao_arts.c"
4575 _aomodules="arts $_aomodules"
4576 _ld_arts=`artsc-config --libs`
4577 _inc_arts=`artsc-config --cflags`
4578 else
4579 _noaomodules="arts $_noaomodules"
4581 echores "$_arts"
4584 echocheck "EsounD"
4585 if test "$_esd" = auto ; then
4586 _esd=no
4587 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4589 cat > $TMPC << EOF
4590 #include <esd.h>
4591 int main(void) { return 0; }
4593 cc_check `esd-config --libs` `esd-config --cflags` && "$TMPO" >> "$TMPLOG" 2>&1 && _esd=yes
4597 echores "$_esd"
4599 if test "$_esd" = yes ; then
4600 _def_esd='#define USE_ESD 1'
4601 _aosrc="$_aosrc ao_esd.c"
4602 _aomodules="esd $_aomodules"
4603 _ld_esd=`esd-config --libs`
4604 _inc_esd=`esd-config --cflags`
4606 echocheck "esd_get_latency()"
4607 cat > $TMPC << EOF
4608 #include <esd.h>
4609 int main(void) { return esd_get_latency(0); }
4611 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4612 echores "$_esd_latency"
4613 else
4614 _def_esd='#undef USE_ESD'
4615 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4616 _noaomodules="esd $_noaomodules"
4619 echocheck "Polyp"
4620 if test "$_polyp" = auto ; then
4621 _polyp=no
4622 if ( pkg-config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ) >> "$TMPLOG" 2>&1 ; then
4624 cat > $TMPC << EOF
4625 #include <polyp/polyplib.h>
4626 #include <polyp/mainloop.h>
4627 #include <polyp/polyplib-error.h>
4628 int main(void) { return 0; }
4630 cc_check `pkg-config --libs --cflags polyplib polyplib-error polyplib-mainloop` && "$TMPO" >> "$TMPLOG" 2>&1 && _polyp=yes
4634 echores "$_polyp"
4636 if test "$_polyp" = yes ; then
4637 _def_polyp='#define USE_POLYP 1'
4638 _aosrc="$_aosrc ao_polyp.c"
4639 _aomodules="polyp $_aomodules"
4640 _ld_polyp=`pkg-config --libs polyplib polyplib-error polyplib-mainloop`
4641 _inc_polyp=`pkg-config --cflags polyplib polyplib-error polyplib-mainloop`
4642 else
4643 _def_polyp='#undef USE_POLYP'
4644 _noaomodules="polyp $_noaomodules"
4648 echocheck "JACK"
4649 if test "$_jack" = auto ; then
4650 _jack=yes
4652 cat > $TMPC << EOF
4653 #include <jack/jack.h>
4654 int main(void) { jack_client_new("test"); return 0; }
4656 if cc_check -ljack ; then
4657 _ld_jack="-ljack"
4658 elif cc_check `pkg-config --libs --cflags --silence-errors jack` ; then
4659 _ld_jack="`pkg-config --libs jack`"
4660 _inc_jack="`pkg-config --cflags jack`"
4661 else
4662 _jack=no
4666 if test "$_jack" = yes ; then
4667 _def_jack='#define USE_JACK 1'
4668 _aosrc="$_aosrc ao_jack.c"
4669 _aomodules="jack $_aomodules"
4670 else
4671 _noaomodules="jack $_noaomodules"
4673 echores "$_jack"
4676 echocheck "ALSA audio"
4677 if test "$_alsa" != no ; then
4678 _alsa=no
4679 cat > $TMPC << EOF
4680 #include <sys/asoundlib.h>
4681 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==5)); }
4683 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.5.x'
4685 cat > $TMPC << EOF
4686 #include <sys/asoundlib.h>
4687 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
4689 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-sys'
4690 cat > $TMPC << EOF
4691 #include <alsa/asoundlib.h>
4692 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
4694 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-alsa'
4696 cat > $TMPC << EOF
4697 #include <sys/asoundlib.h>
4698 int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
4700 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-sys'
4701 cat > $TMPC << EOF
4702 #include <alsa/asoundlib.h>
4703 int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
4705 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-alsa'
4707 _def_alsa5='#undef HAVE_ALSA5'
4708 _def_alsa9='#undef HAVE_ALSA9'
4709 _def_alsa1x='#undef HAVE_ALSA1X'
4710 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
4711 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
4712 if test "$_alsaver" ; then
4713 _alsa=yes
4714 if test "$_alsaver" = '0.5.x' ; then
4715 _aosrc="$_aosrc ao_alsa5.c"
4716 _aomodules="alsa5 $_aomodules"
4717 _def_alsa5='#define HAVE_ALSA5 1'
4718 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4719 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
4720 elif test "$_alsaver" = '0.9.x-sys' ; then
4721 _aosrc="$_aosrc ao_alsa.c"
4722 _aomodules="alsa $_aomodules"
4723 _def_alsa9='#define HAVE_ALSA9 1'
4724 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4725 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
4726 elif test "$_alsaver" = '0.9.x-alsa' ; then
4727 _aosrc="$_aosrc ao_alsa.c"
4728 _aomodules="alsa $_aomodules"
4729 _def_alsa9='#define HAVE_ALSA9 1'
4730 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4731 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
4732 elif test "$_alsaver" = '1.0.x-sys' ; then
4733 _aosrc="$_aosrc ao_alsa.c"
4734 _aomodules="alsa $_aomodules"
4735 _def_alsa1x="#define HAVE_ALSA1X 1"
4736 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4737 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
4738 elif test "$_alsaver" = '1.0.x-alsa' ; then
4739 _aosrc="$_aosrc ao_alsa.c"
4740 _aomodules="alsa $_aomodules"
4741 _def_alsa1x="#define HAVE_ALSA1X 1"
4742 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4743 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
4744 else
4745 _alsa=no
4746 _res_comment="unknown version"
4748 _ld_alsa="-lasound $_ld_dl $_ld_pthread"
4749 else
4750 _noaomodules="alsa $_noaomodules"
4752 echores "$_alsa"
4755 echocheck "Sun audio"
4756 if test "$_sunaudio" = auto ; then
4757 cat > $TMPC << EOF
4758 #include <sys/types.h>
4759 #include <sys/audioio.h>
4760 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4762 _sunaudio=no
4763 cc_check && _sunaudio=yes
4765 if test "$_sunaudio" = yes ; then
4766 _def_sunaudio='#define USE_SUN_AUDIO 1'
4767 _aosrc="$_aosrc ao_sun.c"
4768 _aomodules="sun $_aomodules"
4769 else
4770 _def_sunaudio='#undef USE_SUN_AUDIO'
4771 _noaomodules="sun $_noaomodules"
4773 echores "$_sunaudio"
4776 echocheck "Sun mediaLib"
4777 if test "$_mlib" = auto ; then
4778 _mlib=no
4779 test -z "$_mlibdir" && _mlibdir=/opt/SUNWmlib
4780 cat > $TMPC << EOF
4781 #include <mlib.h>
4782 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
4784 cc_check -I${_mlibdir}/include -L${_mlibdir}/lib -lmlib && _mlib=yes
4786 if test "$_mlib" = yes ; then
4787 _def_mlib='#define HAVE_MLIB 1'
4788 _inc_mlib=" -I${_mlibdir}/include "
4789 _ld_mlib=" -L${_mlibdir}/lib -R${_mlibdir}/lib -lmlib "
4790 else
4791 _def_mlib='#undef HAVE_MLIB'
4793 echores "$_mlib"
4796 echocheck "SGI audio"
4797 if test "$_sgiaudio" = auto ; then
4798 # check for SGI audio
4799 cat > $TMPC << EOF
4800 #include <dmedia/audio.h>
4801 int main(void) { return 0; }
4803 _sgiaudio=no
4804 cc_check && _sgiaudio=yes
4806 if test "$_sgiaudio" = "yes" ; then
4807 _def_sgiaudio='#define USE_SGI_AUDIO 1'
4808 _ld_sgiaudio='-laudio'
4809 _aosrc="$_aosrc ao_sgi.c"
4810 _aomodules="sgi $_aomodules"
4811 else
4812 _def_sgiaudio='#undef USE_SGI_AUDIO'
4813 _noaomodules="sgi $_noaomodules"
4815 echores "$_sgiaudio"
4818 echocheck "VCD support"
4819 if linux || bsdos || freebsd || netbsd || sunos || darwin ; then
4820 _inputmodules="vcd $_inputmodules"
4821 _def_vcd='#define HAVE_VCD 1'
4822 echores "ok"
4823 else
4824 _def_vcd='#undef HAVE_VCD'
4825 _noinputmodules="vcd $_noinputmodules"
4826 echores "not supported on this OS"
4829 echocheck "DVD support (libmpdvdkit)"
4830 if test "$_dvdkit" = auto ; then
4831 _dvdkit=no
4832 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux; then
4833 test -f "./libmpdvdkit2/Makefile" && _dvdkit=yes
4834 test -f "./libmpdvdkit/Makefile" && _dvdkit=yes
4837 if test "$_dvdkit" = yes ; then
4838 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
4839 if test -f "./libmpdvdkit2/Makefile" ; then
4840 _inputmodules="mpdvdkit2 $_inputmodules"
4841 _dvdread=libmpdvdkit2
4842 _dvdkit2=yes
4843 _dvdkit=no
4844 else
4845 _inputmodules="mpdvdkit $_inputmodules"
4846 _dvdread=libmpdvdkit
4848 else
4849 _noinputmodules="mpdvdkit $_noinputmodules"
4851 _def_dvd_linux='#undef HAVE_LINUX_DVD_STRUCT'
4852 _def_dvd_bsd='#undef HAVE_BSD_DVD_STRUCT'
4853 _dev_dvd_openbsd='#undef HAVE_OPENBSD_DVD_STRUCT'
4854 _def_dvd_darwin='#undef DARWIN_DVD_IOCTL'
4855 if linux || netbsd || openbsd || bsdos ; then
4856 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4857 if openbsd ; then
4858 _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4860 else
4861 if freebsd ; then
4862 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4863 else
4864 if darwin ; then
4865 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4869 else
4870 _noinputmodules="mpdvdkit $_noinputmodules"
4872 if test "$_dvdkit" = yes || test "$_dvdkit2" = yes; then
4873 echores "yes"
4874 else
4875 echores "no"
4878 echocheck "DVD support (libdvdread)"
4879 if test "$_dvdread" = auto ; then
4880 cat > $TMPC << EOF
4881 #include <inttypes.h>
4882 #include <dvdread/dvd_reader.h>
4883 #include <dvdread/ifo_types.h>
4884 #include <dvdread/ifo_read.h>
4885 #include <dvdread/nav_read.h>
4886 int main(void) { return 0; }
4888 _dvdread=no
4889 if test "$_dl" = yes; then
4890 cc_check \
4891 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread $_ld_dl && \
4892 _dvdread=yes
4895 _def_mpdvdkit="#undef USE_MPDVDKIT"
4896 case "$_dvdread" in
4897 yes)
4898 _largefiles=yes
4899 _def_dvdread='#define USE_DVDREAD 1'
4900 _ld_dvdread='-ldvdread'
4901 _inputmodules="dvdread $_inputmodules"
4902 echores "yes"
4905 _def_dvdread='#undef USE_DVDREAD'
4906 _noinputmodules="dvdread $_noinputmodules"
4907 echores "no"
4909 libmpdvdkit)
4910 _largefiles=yes
4911 _def_dvdread='#define USE_DVDREAD 1'
4912 _ld_dvdread='-Llibmpdvdkit -lmpdvdkit'
4913 _noinputmodules="dvdread $_noinputmodules"
4914 _def_mpdvdkit="#define USE_MPDVDKIT 1"
4915 echores "disabled by libmpdvdkit"
4917 libmpdvdkit2)
4918 _largefiles=yes
4919 _def_dvdread='#define USE_DVDREAD 1'
4920 _ld_dvdread='-Llibmpdvdkit2 -lmpdvdkit'
4921 _noinputmodules="dvdread $_noinputmodules"
4922 _def_mpdvdkit="#define USE_MPDVDKIT 2"
4923 echores "disabled by libmpdvdkit2"
4925 esac
4927 # dvdnav disabled, it does not work
4928 # echocheck "DVD support (libdvdnav)"
4929 # if test "$_dvdnav" = yes ; then
4930 # cat > $TMPC <<EOF
4931 # #include <dvdnav.h>
4932 # int main(void) { dvdnav_t *dvd=0; return 0; }
4933 # EOF
4934 # _dvdnav=no
4935 # test -n "$_dvdnavdir" && _legal_dvdnavdir=-L$_dvdnavdir/.libs
4936 # if test -z "$_dvdnavconfig" ; then
4937 # if ( dvdnav-config --version ) >/dev/null 2>&1 ; then
4938 # _dvdnavconfig="dvdnav-config"
4939 # fi
4940 # fi
4941 # test -z "$_dvdnavdir" && test -n "$_dvdnavconfig" && _dvdnavdir=`$_dvdnavconfig --cflags`
4942 # _used_css=
4943 # test "$_dvdkit" = no && test "$_dvdkit2" = no && _used_css=$_ld_css
4944 # cc_check $_inc_extra -I$_dvdnavdir $_legal_dvdnavdir -ldvdnav $_used_css $_ld_dl $_ld_pthread && _dvdnav=yes
4945 # fi
4946 # if test "$_dvdnav" = yes ; then
4947 # _largefiles=yes
4948 # _def_dvdnav='#define USE_DVDNAV 1'
4949 # if test -n "$_legal_dvdnavdir" ; then
4950 # _ld_css="$_ld_css $_legal_dvdnavdir -ldvdnav"
4951 # elif test -n "$_dvdnavconfig" ; then
4952 # _ld_css="$_ld_css `$_dvdnavconfig --libs`"
4953 # else
4954 # _ld_css="$_ld_css -ldvdnav"
4955 # fi
4956 # if test -n "$_dvdnavconfig" ; then
4957 # _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
4958 # _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
4959 # fi
4960 # if test -n "$_dvdnavdir" ; then
4961 # _inc_extra="$_inc_extra -I$_dvdnavdir"
4962 # fi
4963 # _inputmodules="dvdnav $_inputmodules"
4964 # echores "yes"
4965 # else
4966 # _def_dvdnav='#undef USE_DVDNAV'
4967 # _noinputmodules="dvdnav $_noinputmodules"
4968 # echores "no"
4969 # fi
4971 echocheck "cdparanoia"
4972 if test "$_cdparanoia" = auto ; then
4973 cat > $TMPC <<EOF
4974 #include <cdda_interface.h>
4975 #include <cdda_paranoia.h>
4976 // This need a better test. How ?
4977 int main(void) { return 1; }
4979 _cdparanoia=no
4980 for _inc_tmp in "$_inc_cdparanoia" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
4981 cc_check $_inc_tmp $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm && _inc_cdparanoia="$_inc_tmp" && _cdparanoia=yes && break
4982 done
4984 if test "$_cdparanoia" = yes ; then
4985 _def_cdparanoia='#define HAVE_CDDA'
4986 _inputmodules="cdda $_inputmodules"
4987 _ld_cdparanoia="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
4988 openbsd && _ld_cdparanoia="$_ld_cdparanoia -lutil"
4989 else
4990 _def_cdparanoia='#undef HAVE_CDDA'
4991 _noinputmodules="cdda $_noinputmodules"
4993 echores "$_cdparanoia"
4996 echocheck "freetype >= 2.0.9"
4998 # freetype depends on iconv
4999 if test "$_iconv" = no ; then
5000 _freetype=no
5001 _res_comment="iconv support needed"
5004 if test "$_freetype" = auto ; then
5005 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5006 cat > $TMPC << EOF
5007 #include <stdio.h>
5008 #include <ft2build.h>
5009 #include FT_FREETYPE_H
5010 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5011 #error "Need FreeType 2.0.9 or newer"
5012 #endif
5013 int main()
5015 FT_Library library;
5016 FT_Int major=-1,minor=-1,patch=-1;
5017 int err=FT_Init_FreeType(&library);
5018 if(err){
5019 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5020 exit(err);
5022 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5023 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5024 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5025 (int)major,(int)minor,(int)patch );
5026 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5027 printf("Library and header version mismatch! Fix it in your distribution!\n");
5028 exit(1);
5030 return 0;
5033 _freetype=no
5034 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && $TMPO >> "$TMPLOG" && _freetype=yes
5035 else
5036 _freetype=no
5039 if test "$_freetype" = yes ; then
5040 _def_freetype='#define HAVE_FREETYPE'
5041 _inc_freetype=`$_freetypeconfig --cflags`
5042 _ld_freetype=`$_freetypeconfig --libs`
5043 else
5044 _def_freetype='#undef HAVE_FREETYPE'
5046 echores "$_freetype"
5048 if test "$_freetype" = no ; then
5049 _fontconfig=no
5050 _res_comment="freetype support needed"
5052 echocheck "fontconfig"
5053 if test "$_fontconfig" = auto ; then
5054 cat > $TMPC << EOF
5055 #include <stdio.h>
5056 #include <fontconfig/fontconfig.h>
5057 int main()
5059 int err = FcInit();
5060 if(err == FcFalse){
5061 printf("Couldn't initialize fontconfig lib\n");
5062 exit(err);
5064 return 0;
5068 _fontconfig=yes
5069 if cc_check -lfontconfig ; then
5070 _ld_fontconfig="-lfontconfig"
5071 elif cc_check `pkg-config --cflags --libs fontconfig` ; then
5072 _inc_fontconfig=`pkg-config --cflags fontconfig`
5073 _ld_fontconfig=`pkg-config --libs fontconfig`
5074 else
5075 _fontconfig=no
5078 if test "$_fontconfig" = yes ; then
5079 _def_fontconfig='#define HAVE_FONTCONFIG'
5080 else
5081 _def_fontconfig='#undef HAVE_FONTCONFIG'
5083 echores "$_fontconfig"
5085 echocheck "fribidi with charsets"
5086 if test "$_fribidi" = yes ; then
5087 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5088 cat > $TMPC << EOF
5089 #include <stdio.h>
5090 /* workaround for fribidi 0.10.4 and below */
5091 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5092 #include <fribidi/fribidi.h>
5093 int main()
5095 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5096 printf("Fribidi headers are not consistents with the library!\n");
5097 exit(1);
5099 return 0;
5102 _fribidi=no
5103 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && $TMPO >> "$TMPLOG" && _fribidi=yes
5104 else
5105 _fribidi=no
5108 if test "$_fribidi" = yes ; then
5109 _def_fribidi='#define USE_FRIBIDI'
5110 _inc_fribidi=`$_fribidiconfig --cflags`
5111 _ld_fribidi=`$_fribidiconfig --libs`
5112 else
5113 _def_fribidi='#undef USE_FRIBIDI'
5115 echores "$_fribidi"
5118 echocheck "ENCA"
5119 if test "$_enca" = auto ; then
5120 cat > $TMPC << EOF
5121 #include <enca.h>
5122 int main()
5124 const char **langs;
5125 size_t langcnt;
5126 langs = enca_get_languages(&langcnt);
5127 return 0;
5130 _enca=no
5131 cc_check -lenca $_ld_lm && _enca=yes
5133 if test "$_enca" = yes ; then
5134 _def_enca='#define HAVE_ENCA 1'
5135 _ld_enca='-lenca'
5136 else
5137 _def_enca='#undef HAVE_ENCA'
5139 echores "$_enca"
5142 echocheck "zlib"
5143 cat > $TMPC << EOF
5144 #include <zlib.h>
5145 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5147 _zlib=no
5148 cc_check -lz && _zlib=yes
5149 if test "$_zlib" = yes ; then
5150 _def_zlib='#define HAVE_ZLIB 1'
5151 _ld_zlib='-lz'
5152 else
5153 _def_zlib='#undef HAVE_ZLIB'
5155 echores "$_zlib"
5158 echocheck "RTC"
5159 if test "$_rtc" = auto ; then
5160 cat > $TMPC << EOF
5161 #include <sys/ioctl.h>
5162 #ifdef __linux__
5163 #include <linux/rtc.h>
5164 #else
5165 #include <rtc.h>
5166 #define RTC_PIE_ON RTCIO_PIE_ON
5167 #endif
5168 int main(void) { return RTC_PIE_ON; }
5170 _rtc=no
5171 cc_check && _rtc=yes
5173 if test "$_rtc" = yes ; then
5174 _def_rtc='#define HAVE_RTC 1'
5175 else
5176 _def_rtc='#undef HAVE_RTC'
5178 echores "$_rtc"
5181 echocheck "external liblzo support"
5182 if test "$_liblzo" = auto ; then
5183 _liblzo=no
5184 cat > $TMPC << EOF
5185 #include <lzo1x.h>
5186 int main(void) { lzo_init();return 0; }
5188 cc_check -llzo && _liblzo=yes
5190 if test "$_liblzo" = yes ; then
5191 _def_liblzo='#define USE_LIBLZO 1'
5192 _ld_liblzo='-llzo'
5193 _codecmodules="liblzo $_codecmodules"
5194 else
5195 _def_liblzo='#undef USE_LIBLZO'
5196 _nocodecmodules="liblzo $_nocodecmodules"
5198 echores "$_liblzo"
5201 echocheck "mad support"
5202 if test "$_mad" = auto ; then
5203 _mad=no
5204 cat > $TMPC << EOF
5205 #include <mad.h>
5206 int main(void) { return 0; }
5208 cc_check $_madlibdir -lmad && _mad=yes
5210 if test "$_mad" = yes ; then
5211 _def_mad='#define USE_LIBMAD 1'
5212 _ld_mad='-lmad'
5213 _codecmodules="libmad $_codecmodules"
5214 else
5215 _def_mad='#undef USE_LIBMAD'
5216 _nocodecmodules="libmad $_nocodecmodules"
5218 echores "$_mad"
5220 echocheck "Toolame"
5221 if test "$_toolame" = auto ; then
5222 cat > $TMPC <<EOF
5223 #include <toolame.h>
5224 int main(void) { toolame_init(); return 0; }
5226 _toolame=no
5227 _toolame_extraflags=""
5228 _toolame_lib="-ltoolame"
5229 if test -n "$_toolamedir"; then
5230 _toolame_extraflags="-I$_toolamedir -L$_toolamedir"
5232 cc_check $_toolame_extraflags $_toolame_lib $_ld_lm && _toolame=yes
5234 if test "$_toolame" = yes ; then
5235 _def_toolame='#define HAVE_TOOLAME 1'
5236 _codecmodules="$_codecmodules toolame"
5237 else
5238 _def_toolame='#undef HAVE_TOOLAME'
5239 _toolame_lib=""
5240 _nocodecmodules="toolame $_nocodecmodules"
5242 if test "$_toolamedir" ; then
5243 _res_comment="using $_toolamedir"
5245 echores "$_toolame"
5247 echocheck "Twolame"
5248 if test "$_twolame" = auto ; then
5249 cat > $TMPC <<EOF
5250 #include <twolame.h>
5251 int main(void) { twolame_init(); return 0; }
5253 _twolame=no
5254 _twolame_lib="-ltwolame"
5255 cc_check $_twolame_lib $_ld_lm && _twolame=yes
5257 if test "$_twolame" = yes ; then
5258 _def_twolame='#define HAVE_TWOLAME 1'
5259 _codecmodules="$_codecmodules twolame"
5260 else
5261 _def_twolame='#undef HAVE_TWOLAME'
5262 _twolame_lib=""
5263 _nocodecmodules="twolame $_nocodecmodules"
5265 echores "$_twolame"
5267 echocheck "OggVorbis support"
5268 if test "$_tremor_internal" = yes; then
5269 _vorbis=yes
5270 elif test "$_vorbis" = auto; then
5271 _vorbis=no
5272 cat > $TMPC << EOF
5273 #include <vorbis/codec.h>
5274 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5276 cc_check -lvorbis -logg $_ld_lm && _vorbis=yes
5278 if test "$_vorbis" = yes ; then
5279 _def_vorbis='#define HAVE_OGGVORBIS 1'
5280 if test "$_tremor_internal" = yes ; then
5281 # do not set _ld_vorbis as it is resolved separately
5282 # mp3lame support for vorbis is deprecated so don't care
5283 _def_tremor='#define TREMOR 1'
5284 if test "$_tremor_low" = yes ; then
5285 _tremor_flags='-D_LOW_ACCURACY_'
5286 else
5287 _tremor_flags=''
5289 _codecmodules="tremor(internal) $_codecmodules"
5290 elif test "$_tremor" = yes ; then
5291 _def_tremor='#define TREMOR 1'
5292 _ld_vorbis='-lvorbisidec'
5293 _codecmodules="tremor $_codecmodules"
5294 else
5295 _def_tremor='#undef TREMOR'
5296 _ld_vorbis='-lvorbis -logg'
5297 _codecmodules="libvorbis $_codecmodules"
5299 else
5300 _def_vorbis='#undef HAVE_OGGVORBIS'
5301 _def_tremor='#undef TREMOR'
5302 _nocodecmodules="libvorbis $_nocodecmodules"
5304 if test "$_vorbis" = yes -a "$_tremor_internal" = yes -a "$_tremor_low" = yes ; then
5305 _res_comment="internal low accuracy Tremor"
5306 elif test "$_vorbis" = yes -a "$_tremor_internal" = yes ; then
5307 _res_comment="internal Tremor"
5308 elif test "$_vorbis" = yes -a "$_tremor" = yes ; then
5309 _res_comment="Tremor"
5311 echores "$_vorbis"
5313 echocheck "OggTheora support"
5314 if test "$_theora" = auto ; then
5315 _theora=no
5316 if ( pkg-config --exists 'theora' ) >> "$TMPLOG" 2>&1 ; then
5317 cat > $TMPC << EOF
5318 #include <theora/theora.h>
5319 #include <string.h>
5320 int main(void)
5322 /* theora is in flux, make sure that all interface routines and
5323 * datatypes exist and work the way we expect it, so we don't break
5324 * mplayer */
5325 ogg_packet op;
5326 theora_comment tc;
5327 theora_info inf;
5328 theora_state st;
5329 yuv_buffer yuv;
5330 int r;
5331 double t;
5333 theora_info_init (&inf);
5334 theora_comment_init (&tc);
5336 return 0;
5338 /* we don't want to execute this kind of nonsense; just for making sure
5339 * that compilation works... */
5340 memset(&op, 0, sizeof(op));
5341 r = theora_decode_header (&inf, &tc, &op);
5342 r = theora_decode_init (&st, &inf);
5343 t = theora_granule_time (&st, op.granulepos);
5344 r = theora_decode_packetin (&st, &op);
5345 r = theora_decode_YUVout (&st, &yuv);
5346 theora_clear (&st);
5348 return 0;
5351 cc_check `pkg-config --libs --cflags theora` && _theora=yes
5354 if test "$_theora" = yes ; then
5355 _def_theora='#define HAVE_OGGTHEORA 1'
5356 _codecmodules="libtheora $_codecmodules"
5357 _ld_theora=`pkg-config --libs --cflags theora`
5358 else
5359 _def_theora='#undef HAVE_OGGTHEORA'
5360 _nocodecmodules="libtheora $_nocodecmodules"
5362 echores "$_theora"
5364 echocheck "mp3lib support"
5365 if test "$_mp3lib" = yes ; then
5366 _def_mp3lib='#define USE_MP3LIB 1'
5367 _codecmodules="mp3lib $_codecmodules"
5368 else
5369 _def_mp3lib='#undef USE_MP3LIB'
5370 _nocodecmodules="mp3lib $_nocodecmodules"
5372 echores "$_mp3lib"
5374 echocheck "liba52 support"
5375 if test "$_liba52" = yes ; then
5376 _def_liba52='#define USE_LIBA52 1'
5377 _codecmodules="liba52 $_codecmodules"
5378 else
5379 _def_liba52='#undef USE_LIBA52'
5380 _nocodecmodules="liba52 $_nocodecmodules"
5382 echores "$_liba52"
5384 echocheck "libdts support"
5385 if test "$_libdts" = auto ; then
5386 _libdts=no
5387 cat > $TMPC << EOF
5388 #include <inttypes.h>
5389 #include <dts.h>
5390 int main(void) { dts_init (0); return 0; }
5392 cc_check $_inc_libdts $_ld_libdts -ldts $_ld_lm && _libdts=yes
5394 if test "$_libdts" = yes ; then
5395 _def_libdts='#define CONFIG_DTS 1'
5396 _ld_libdts="$_ld_libdts -ldts"
5397 _codecmodules="libdts $_codecmodules"
5398 else
5399 _def_libdts='#undef CONFIG_DTS'
5400 _nocodecmodules="libdts $_nocodecmodules"
5402 echores "$_libdts"
5404 echocheck "libmpeg2 support"
5405 if test "$_libmpeg2" = yes ; then
5406 _def_libmpeg2='#define USE_LIBMPEG2 1'
5407 _codecmodules="libmpeg2 $_codecmodules"
5408 else
5409 _def_libmpeg2='#undef USE_LIBMPEG2'
5410 _nocodecmodules="libmpeg2 $_nocodecmodules"
5412 echores "$_libmpeg2"
5414 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
5415 if test "$_musepack" = auto ; then
5416 _musepack=no
5417 cat > $TMPC << EOF
5418 #include <mpcdec/mpcdec.h>
5419 int main(void) {
5420 mpc_streaminfo info;
5421 mpc_decoder decoder;
5422 mpc_decoder_set_streaminfo(&decoder, &info);
5423 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
5426 cc_check -lmpcdec $_ld_lm && _musepack=yes
5428 if test "$_musepack" = yes ; then
5429 _def_musepack='#define HAVE_MUSEPACK 1'
5430 _ld_musepack='-lmpcdec'
5431 _codecmodules="musepack $_codecmodules"
5432 else
5433 _def_musepack='#undef HAVE_MUSEPACK'
5434 _nocodecmodules="musepack $_nocodecmodules"
5436 echores "$_musepack"
5439 echocheck "Matroska support"
5440 if test "$_matroska_internal" = yes ; then
5441 _inputmodules="matroska $_inputmodules"
5442 _def_matroska='#define HAVE_MATROSKA 1'
5443 else
5444 _noinputmodules="matroska $_noinputmodules"
5445 _def_matroska='#undef HAVE_MATROSKA'
5447 echores "$_matroska_internal"
5449 echocheck "FAAC (AAC encoder) support"
5450 if test "$_faac" = auto ; then
5451 cat > $TMPC <<EOF
5452 #include <inttypes.h>
5453 #include <faac.h>
5454 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5456 _faac=no
5457 for _ld_tmp in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
5458 cc_check -c -O4 $_ld_tmp $_ld_lm && _ld_faac="$_ld_tmp" && _faac=yes && break
5459 done
5461 if test "$_faac" = yes ; then
5462 _def_faac="#define HAVE_FAAC 1"
5463 _codecmodules="faac $_codecmodules"
5464 else
5465 _def_faac="#undef HAVE_FAAC"
5466 _nocodecmodules="faac $_nocodecmodules"
5468 echores "$_faac"
5470 echocheck "internal FAAD2 (AAC) support"
5471 _inc_faad="-I`pwd`/libfaad2"
5472 if test "$_faad_internal" = auto ; then
5473 # the faad check needs a config.h file
5474 if not test -f "config.h" ; then
5475 cat > config.h << EOF
5476 /* C99 lrintf function available */
5477 $_def_lrintf
5480 # internal faad: check if our dear gcc is able to compile it...
5481 cp "`pwd`/libfaad2/cfft.c" $TMPC
5482 if ( cc_check -c -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer -D_GNU_SOURCE $_inc_faad ); then
5483 _faad_internal=yes
5484 else
5485 _faad_internal="no (broken gcc)"
5488 if test "$_faad_internal" = yes ; then
5489 _def_faad_internal="#define USE_INTERNAL_FAAD 1"
5490 _faad_external=no
5491 else
5492 _def_faad_internal="#undef USE_INTERNAL_FAAD"
5493 _inc_faad=
5495 echores "$_faad_internal"
5498 echocheck "external FAAD2 (AAC) support"
5499 if test "$_faad_external" != no ; then
5500 _ld_faad='-lfaad'
5501 _inc_faad="$_inc_extra"
5502 # external faad: check if it's really faad2 :)
5503 if test "$_faad_external" = auto ; then
5504 _faad_external=no
5505 cat > $TMPC << EOF
5506 #include <faad.h>
5507 #ifndef FAAD_MIN_STREAMSIZE
5508 #error Too old version
5509 #endif
5510 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5512 cc_check $_inc_faad $_ld_faad $_ld_lm && _faad_external=yes
5515 echores "$_faad_external"
5517 if test "$_faad_external" = yes; then
5518 _def_faad='#define HAVE_FAAD 1'
5519 _codecmodules="faad2(external) $_codecmodules"
5520 elif test "$_faad_internal" = yes; then
5521 _def_faad='#define HAVE_FAAD 1'
5522 _codecmodules="faad2(internal) $_codecmodules"
5523 else
5524 _def_faad='#undef HAVE_FAAD'
5525 _nocodecmodules="faad2 $_nocodecmodules"
5526 _ld_faad=
5530 echocheck "LADSPA plugin support"
5531 if test "$_ladspa" = auto ; then
5532 cat > $TMPC <<EOF
5533 #include <stdio.h>
5534 #include <ladspa.h>
5535 int main(void) {
5536 const LADSPA_Descriptor *ld = NULL;
5537 return 0;
5540 _ladspa=no
5541 cc_check && _ladspa=yes
5543 if test "$_ladspa" = yes; then
5544 _def_ladspa="#define HAVE_LADSPA"
5545 _afsrc="$_afsrc af_ladspa.c"
5546 _afmodules="ladspa $_afmodules"
5547 else
5548 _def_ladspa="#undef HAVE_LADSPA"
5549 _noafmodules="ladspa $_noafmodules"
5551 echores "$_ladspa"
5554 if test "$_win32" = auto ; then
5555 if x86 ; then
5556 qnx && _win32=no
5557 else
5558 _win32=no # x86 arch only
5562 if test "$_win32" != no ; then
5563 if test -z "$_win32libdir" ; then
5564 for I in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5565 if test -d "$I" ; then
5566 _win32libdir="$I"
5567 break;
5569 done
5573 echocheck "Win32 codec DLL support"
5574 if test "$_win32" = auto ; then
5575 _win32=no
5576 test -n "$_win32libdir" && _win32=yes
5578 if test "$_win32" = yes ; then
5579 _def_win32='#define USE_WIN32DLL 1'
5580 _res_comment="using $_win32libdir"
5581 else
5582 _def_win32='#undef USE_WIN32DLL'
5583 _nocodecmodules="win32 $_nocodecmodules"
5584 _dshow=no
5586 echores "$_win32"
5588 if test "$_win32" != no ; then
5589 _def_win32_loader='#undef WIN32_LOADER'
5590 echocheck "Win32 loader support"
5591 _ld_win32='loader/libloader.a'
5592 _dep_win32='loader/libloader.a'
5593 _codecmodules="win32 $_codecmodules"
5594 if openbsd ; then
5595 x86 && _ld_win32="$_ld_win32 -li386"
5597 if not win32 ; then
5598 _def_win32_loader='#define WIN32_LOADER 1'
5599 echores "yes"
5600 else
5601 _ld_win32libs="$_ld_win32libs -ladvapi32 -lole32"
5602 echores "no (using native windows)"
5606 echocheck "DirectShow"
5607 if false ; then
5609 if test "$_dshow" != no ; then
5610 _dshow=no
5611 # check if compiler supports C++ and C++-libs are installed correctly
5612 cat > "$TMPCPP" << EOF
5613 #include <string>
5614 class myclass {
5615 private: int ret;
5616 public: int myreturn(void);
5618 int myclass::myreturn(void) { ret = 0; return ret ; }
5619 int main(void) { myclass myobject; return myobject.myreturn(); }
5621 echo "------------------------------------------------" >> "$TMPLOG"
5622 cat "$TMPCPP" >> "$TMPLOG"
5623 if ( $_cc "$TMPCPP" -o "$TMPO" && "$TMPO" ) >> "$TMPLOG" 2>&1 ; then
5624 _dshow=yes
5625 echores "yes (C++ is ok)"
5626 else
5627 echores "no"
5628 cat << EOF
5630 Your C++ runtime environment is broken.
5632 Hints: Does $_cc support C++? Do you have you a C++ compiler installed?
5633 Are the C++ libraries correctly installed?
5634 Check for libstdc++ and in (/etc/)ld.so.conf.
5636 If you do not need DirectShow support, you can also use:
5637 ./configure --disable-dshow <your-normal-configure-options>
5638 to disable building the C++ based DirectShow code.
5641 die "$_cc's C++ is broken"
5647 echores "$_dshow"
5649 if test "$_dshow" = yes ; then
5650 _def_dshow='#define USE_DIRECTSHOW 1'
5651 _ld_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5652 _dep_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5653 _codecmodules="dshow/dmo $_codecmodules"
5654 else
5655 _def_dshow='#undef USE_DIRECTSHOW'
5656 _nocodecmodules="dshow/dmo $_nocodecmodules"
5660 echocheck "XAnim DLL"
5661 if test "$_xanim" = auto ; then
5662 _xanim=no
5663 _res_comment="dynamic loader support needed"
5664 if test "$_dl" = yes ; then
5665 _res_comment="no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html"
5666 if test -z "$_xanimlibdir" ; then
5667 for I in "$_libdir/codecs" /usr/local/lib/xanim/mods /usr/lib/xanim/mods /usr/lib/xanim $XANIM_MOD_DIR ; do
5668 if test -d "$I" ; then
5669 _xanimlibdir="$I"
5670 break;
5672 done
5674 test "$_xanimlibdir" && _xanim=yes
5677 if test "$_xanim" = yes ; then
5678 _def_xanim='#define USE_XANIM 1'
5679 _def_xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
5680 _codecmodules="xanim $_codecmodules"
5681 _res_comment="using $_xanimlibdir"
5682 else
5683 _def_xanim='#undef USE_XANIM'
5684 _def_xanim_path='#undef XACODEC_PATH'
5685 _nocodecmodules="xanim $_nocodecmodules"
5687 echores "$_xanim"
5689 echocheck "RealPlayer DLL"
5690 if test "$_real" = auto ; then
5691 _real=no
5692 _res_comment="dynamic loader support needed"
5693 if test "$_dl" = yes || test "$_win32" = yes ; then
5694 # if test "$_dl" = yes ; then
5695 _res_comment="tested only on Linux/FreeBSD/NetBSD/Cygwin/MinGW/Darwin"
5696 if linux || freebsd || netbsd || win32 || darwin ; then
5697 _res_comment="no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html"
5698 if test -z "$_reallibdir" ; then
5699 for I in "$_libdir/codecs" "$_libdir/real" /usr/lib/real \
5700 /usr/lib/RealPlayer{9,8,}/Codecs /usr/local/RealPlayer{9,8,}/Codecs \
5701 /usr/local/lib/RealPlayer{9,8,}/Codecs /opt/RealPlayer{9,8,}/{Real/,}Codecs \
5702 {~,}/Applications/RealOne\ Player.app/Contents/MacOS/Library/Codecs \
5703 "$_win32libdir"; do
5704 if test -d "$I" ; then
5705 _reallibdir="$I"
5706 break
5708 done
5710 test "$_reallibdir" && _real=yes
5714 if test "$_real" = yes ; then
5715 _def_real='#define USE_REALCODECS 1'
5716 _def_real_path="#define REALCODEC_PATH \"$_reallibdir\""
5717 _codecmodules="real $_codecmodules"
5718 _res_comment="using $_reallibdir"
5719 else
5720 _def_real='#undef USE_REALCODECS'
5721 _def_real_path="#undef REALCODEC_PATH"
5722 _nocodecmodules="real $_nocodecmodules"
5724 echores "$_real"
5727 echocheck "LIVE555 Streaming Media libraries"
5728 if test "$_live" = auto && test "$_network" = yes ; then
5729 _TMPC=$TMPC
5730 TMPC=$TMPCPP
5731 cat >$TMPC <<EOF
5732 #include <liveMedia.hh>
5733 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1090195200)
5734 #error Please upgrade to version 2004.07.19 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
5735 #endif
5736 int main(void) {}
5739 _live=no
5740 for I in "$_livelibdir" "$_libdir/live" "/usr/lib/live" "/usr/local/live" "/usr/local/lib/live" ; do
5741 cc_check -I$I/liveMedia/include -I$I/UsageEnvironment/include -I$I/groupsock/include && _livelibdir=$I && _live=yes && break
5742 done
5743 if test "$_live" != yes ; then
5744 if cc_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
5745 _live_dist=yes
5749 TMPC=$_TMPC
5751 if test "$_live" = yes && test "$_network" = yes ; then
5752 echores "yes (using $_livelibdir)"
5753 _def_live='#define STREAMING_LIVE555 1'
5754 _live_libs_def="# LIVE555 Streaming Media libraries:
5755 LIVE_LIB_DIR = $_livelibdir
5756 LIVE_LIBS = \$(LIVE_LIB_DIR)/liveMedia/libliveMedia.a
5757 LIVE_LIBS += \$(LIVE_LIB_DIR)/groupsock/libgroupsock.a
5758 LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
5759 LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
5760 LIVE_LIBS += -lstdc++
5761 LIVE_INCLUDES = -I\$(LIVE_LIB_DIR)/liveMedia/include
5762 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/UsageEnvironment/include
5763 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/BasicUsageEnvironment/include
5764 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/groupsock/include"
5765 _ld_live='$(LIVE_LIBS)'
5766 _inputmodules="live555 $_inputmodules"
5767 elif test "$_live_dist" = yes && test "$_network" = yes ; then
5768 echores "yes (using distribution version)"
5769 _live="yes"
5770 _def_live='#define STREAMING_LIVE555 1'
5771 _live_libs_def="# LIVE555 Streaming Media libraries:
5772 LIVE_LIB_DIR = $_livelibdir
5773 LIVE_LIBS = -lliveMedia
5774 LIVE_LIBS += -lgroupsock
5775 LIVE_LIBS += -lUsageEnvironment
5776 LIVE_LIBS += -lBasicUsageEnvironment
5777 LIVE_LIBS += -lstdc++
5778 LIVE_INCLUDES = -I/usr/include/liveMedia
5779 LIVE_INCLUDES += -I/usr/include/UsageEnvironment
5780 LIVE_INCLUDES += -I/usr/include/BasicUsageEnvironment
5781 LIVE_INCLUDES += -I/usr/include/groupsock"
5782 _ld_live='$(LIVE_LIBS)'
5783 _inputmodules="live555 $_inputmodules"
5784 else
5785 echores "no"
5786 _def_live='#undef STREAMING_LIVE555'
5787 _noinputmodules="live555 $_noinputmodules"
5790 echocheck "FFmpeg libavutil (static)"
5791 if test -d libavutil ; then
5792 _libavutil=yes
5793 else
5794 _libavutil=no
5796 echores "$_libavutil"
5798 echocheck "FFmpeg libavcodec (static)"
5799 if test "$_libavcodec" = auto ; then
5800 # Note: static linking is preferred to dynamic linking
5801 _libavcodec=no
5802 _res_comment="see DOCS/HTML/$_doc_lang/codecs.html"
5803 if test -d libavcodec && test -f libavcodec/utils.c ; then
5804 _res_comment="old ffmpeg version, use CVS !"
5805 if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
5806 # check if libavutil is a required
5807 cat > $TMPC << EOF
5808 #include "libavcodec/avcodec.h"
5809 #if LIBAVCODEC_BUILD >= 3211265
5810 #error We need libavutil!
5811 #endif
5812 int main(void) { return 0; }
5815 if cc_check -I. -I./libavutil; then
5816 _libavutil_required="no"
5817 else
5818 _libavutil_required="yes"
5820 _res_comment="libavutil availability does not fit libavcodec version"
5821 if test "$_libavutil_required" = "$_libavutil"; then
5822 _libavcodec="yes"
5823 _res_comment=""
5828 echores "$_libavcodec"
5830 echocheck "FFmpeg libavformat (static)"
5831 if test "$_libavformat" = auto ; then
5832 # Note: static linking is preferred to dynamic linking
5833 _libavformat=no
5834 if test -d libavformat && test -f libavformat/utils.c ; then
5835 _libavformat=yes
5838 echores "$_libavformat"
5840 _def_haveffpostprocess='no'
5841 if test -d libavcodec && test -f libavcodec/libpostproc/postprocess.h ; then
5842 _def_haveffpostprocess='yes'
5845 if test "$_libavcodec" != yes ; then
5846 echocheck "FFmpeg libavcodec (dynamic)"
5847 if test "$_libavcodecso" = auto ; then
5848 _libavcodecso=no
5849 _res_comment="libavcodec.so is broken/obsolete"
5850 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
5851 cat > $TMPC << EOF
5852 #define FF_POSTPROCESS 1
5853 #include <ffmpeg/avcodec.h>
5854 int main(void) {
5855 avcodec_find_encoder_by_name("");
5856 return 0;
5859 if cc_check -lavcodec $_ld_lm ; then
5860 _libavcodecso=yes
5861 _res_comment="using libavcodec.so, but static libavcodec is recommended"
5864 echores "$_libavcodecso"
5867 _def_libavcodec='#undef USE_LIBAVCODEC'
5868 _def_libavcodecso='#undef USE_LIBAVCODEC_SO'
5869 _def_ffpostprocess='#undef FF_POSTPROCESS'
5870 if test "$_libavcodec" = yes ; then
5871 _def_libavcodec='#define USE_LIBAVCODEC 1'
5872 _ld_libavcodec='libavcodec/libavcodec.a'
5873 _dep_libavcodec='libavcodec/libavcodec.a'
5874 _def_ffpostprocess='#define FF_POSTPROCESS 1'
5875 _codecmodules="libavcodec $_codecmodules"
5876 if test "$_libavutil" = yes; then
5877 _ld_libavutil='libavutil/libavutil.a'
5878 _dep_libavutil='libavutil/libavutil.a'
5880 elif test "$_libavcodecso" = yes ; then
5881 _def_libavcodec='#define USE_LIBAVCODEC 1'
5882 _def_libavcodecso='#define USE_LIBAVCODEC_SO 1'
5883 _ld_libavcodec='-lavcodec'
5884 _codecmodules="libavcodec.so $_codecmodules"
5885 else
5886 _nocodecmodules="libavcodec $_nocodecmodules"
5889 _def_libavformat='#undef USE_LIBAVFORMAT'
5890 _def_libavformat_win32='#undef CONFIG_WIN32'
5891 if test "$_libavformat" = yes ; then
5892 _def_libavformat='#define USE_LIBAVFORMAT 1'
5893 _ld_libavformat='libavformat/libavformat.a'
5894 _dep_libavformat='libavformat/libavformat.a'
5895 if win32 ; then
5896 _def_libavformat_win32='#define CONFIG_WIN32 1'
5900 echocheck "amr narrowband"
5901 if test "$_amr_nb" = auto ; then
5902 _amr_nb=no
5903 if test -f libavcodec/amr_float/sp_dec.c ; then
5904 if test "$_libavcodec" = yes ; then
5905 _amr_nb=yes
5906 else
5907 _res_comment="libavcodec (static) is required by amr_nb, sorry"
5911 if test "$_amr_nb" = yes ; then
5912 _def_amr_nb='#define AMR_NB 1'
5913 else
5914 _def_amr_nb='#undef AMR_NB'
5916 echores "$_amr_nb $_echomsg"
5918 echocheck "amr narrowband, fixed point"
5919 if test "$_amr_nb_fixed" = auto ; then
5920 _amr_nb_fixed=no
5921 if test -f libavcodec/amr/dtx_dec.c ; then
5922 if test "$_libavcodec" = yes ; then
5923 if test "$_amr_nb" = no ; then
5924 _amr_nb_fixed=yes
5925 else
5926 _res_comment="disabled by amr_nb"
5928 else
5929 _res_comment="libavcodec (static) is required by amr_nb-fixed, sorry"
5933 if test "$_amr_nb_fixed" = yes ; then
5934 _def_amr_nb='#define AMR_NB 1'
5935 _def_amr_nb_fixed='#define AMR_NB_FIXED 1'
5936 _amr_nb=yes;
5937 else
5938 _def_amr_nb_fixed='#undef AMR_NB_FIXED'
5940 echores "$_amr_nb_fixed"
5942 if test "$_amr_nb" = yes ; then
5943 _codecmodules="amr_nb $_codecmodules"
5944 else
5945 _nocodecmodules="amr_nb $_nocodecmodules"
5948 echocheck "amr wideband"
5949 if test "$_amr_wb" = auto ; then
5950 _amr_wb=no
5951 if test -f libavcodec/amrwb_float/dec_dtx.c ; then
5952 if test "$_libavcodec" = yes ; then
5953 _amr_wb=yes
5954 else
5955 _res_comment="libavcodec (static) is required by amr_wb, sorry"
5959 if test "$_amr_wb" = yes ; then
5960 _def_amr_wb='#define AMR_WB 1'
5961 _codecmodules="amr_wb $_codecmodules"
5962 else
5963 _def_amr_wb='#undef AMR_WB'
5964 _nocodecmodules="amr_wb $_nocodecmodules"
5966 echores "$_amr_wb"
5968 echocheck "libdv-0.9.5+"
5969 if test "$_libdv" = auto ; then
5970 _libdv=no
5971 cat > $TMPC <<EOF
5972 #include <libdv/dv.h>
5973 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
5975 cc_check -ldv $_ld_lm && _libdv=yes
5977 if test "$_libdv" = yes ; then
5978 _def_libdv='#define HAVE_LIBDV095 1'
5979 _ld_libdv="-ldv"
5980 _codecmodules="libdv $_codecmodules"
5981 else
5982 _def_libdv='#undef HAVE_LIBDV095'
5983 _nocodecmodules="libdv $_nocodecmodules"
5985 echores "$_libdv"
5987 echocheck "zr"
5988 if test "$_zr" = auto ; then
5989 #36067's seem to identify themselves as 36057PQC's, so the line
5990 #below should work for 36067's and 36057's.
5991 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
5992 _zr=yes
5993 else
5994 _zr=no
5997 if test "$_zr" = yes ; then
5998 if test "$_libavcodec" = yes ; then
5999 _def_zr='#define HAVE_ZR 1'
6000 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6001 _vomodules="zr zr2 $_vomodules"
6002 else
6003 _res_comment="libavcodec (static) is required by zr, sorry"
6004 _novomodules="zr $_novomodules"
6005 _def_zr='#undef HAVE_ZR'
6007 else
6008 _def_zr='#undef HAVE_ZR'
6009 _novomodules="zr zr2 $_novomodules"
6011 echores "$_zr"
6013 echocheck "bl"
6014 if test "$_bl" = yes ; then
6015 _def_bl='#define HAVE_BL 1'
6016 _vosrc="$_vosrc vo_bl.c"
6017 _vomodules="bl $_vomodules"
6018 else
6019 _def_bl='#undef HAVE_BL'
6020 _novomodules="bl $_novomodules"
6022 echores "$_bl"
6024 echocheck "XviD"
6025 cat > $TMPC << EOF
6026 #include <xvid.h>
6027 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
6029 _ld_xvid="$_ld_xvid -lxvidcore"
6030 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid $_ld_lm ; then
6031 _xvid=yes
6032 _def_xvid3='#define HAVE_XVID3 1'
6033 _def_xvid4='#undef HAVE_XVID4'
6034 _codecmodules="xvid $_codecmodules"
6035 else
6036 cat > $TMPC << EOF
6037 #include <xvid.h>
6038 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6040 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid $_ld_lm ; then
6041 _xvid=yes
6042 _def_xvid3='#undef HAVE_XVID3'
6043 _def_xvid4='#define HAVE_XVID4 1'
6044 _codecmodules="xvid $_codecmodules"
6045 else
6046 _xvid=no
6047 _ld_xvid=''
6048 _def_xvid3='#undef HAVE_XVID3'
6049 _def_xvid4='#undef HAVE_XVID4'
6050 _nocodecmodules="xvid $_nocodecmodules"
6053 echores "$_xvid"
6055 _xvidcompat=no
6056 _def_decore_xvid='#undef DECORE_XVID'
6057 _def_encore_xvid='#undef ENCORE_XVID'
6058 if test "$_xvid" = yes ; then
6059 echocheck "DivX4 compatibility in XviD"
6060 cat > $TMPC << EOF
6061 #include <divx4.h>
6062 int main(void) { (void) decore(0, 0, 0, 0); return 0; }
6064 cc_check $_ld_lm "$_ld_xvid" && _xvidcompat=yes
6065 echores "$_xvidcompat"
6068 echocheck "x264"
6069 cat > $TMPC << EOF
6070 #include <inttypes.h>
6071 #include <x264.h>
6072 #if X264_BUILD < 36
6073 #error We do not support old versions of x264. Get the latest from SVN.
6074 #endif
6075 int main(void) { x264_encoder_open((void*)0); return 0; }
6077 _ld_x264="$_ld_x264 -lx264 $_ld_pthread"
6078 if test "$_x264" != no && \
6079 ( cc_check $_inc_x264 $_ld_x264 $_ld_lm || \
6080 ( test "$_x11" = yes && cc_check $_inc_x264 $_inc_x11 $_ld_x264 $_ld_x11 $_ld_lm )) ; \
6081 then
6082 _x264=yes
6083 _def_x264='#define HAVE_X264 1'
6084 _codecmodules="x264 $_codecmodules"
6085 else
6086 _x264=no
6087 _ld_x264=''
6088 _def_x264='#undef HAVE_X264'
6089 _nocodecmodules="x264 $_nocodecmodules"
6091 echores "$_x264"
6093 echocheck "DivX4linux/DivX5linux/OpenDivX decore"
6094 # DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
6095 cat > $TMPC << EOF
6096 #include <decore.h>
6097 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_FRAME_311; }
6099 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
6100 _opendivx=no
6101 _ld_decore='-ldivxdecore'
6102 _def_decore='#define NEW_DECORE 1'
6103 _def_divx='#define USE_DIVX'
6104 _def_divx5='#undef DECORE_DIVX5'
6105 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6106 _codecmodules="divx4linux $_codecmodules"
6107 echores "DivX4linux (with libdivxdecore.so)"
6108 else
6109 # if test "$_divx4linux" != no ; then
6110 # DivX5 check
6111 # OdivxPP disabled because of:
6112 # ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
6113 cat > $TMPC << EOF
6114 #include <decore.h>
6115 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_INIT; }
6117 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
6118 _opendivx=no
6119 # _ld_decore='-ldivxdecore opendivx/postprocess.o'
6120 _ld_decore='-ldivxdecore'
6121 _def_decore='#define NEW_DECORE 1'
6122 _def_divx='#define USE_DIVX'
6123 _def_divx5='#define DECORE_DIVX5 1'
6124 # _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
6125 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6126 _codecmodules="divx5linux $_codecmodules"
6127 _nocodecmodules="divx4linux $_nocodecmodules"
6128 echores "DivX5linux (with libdivxdecore.so)"
6129 elif test "$_opendivx" != no ; then
6130 _opendivx=yes
6131 _ld_decore='opendivx/libdecore.a'
6132 _def_decore='#undef NEW_DECORE'
6133 _def_divx='#define USE_DIVX'
6134 _def_divx5='#undef DECORE_DIVX5'
6135 _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
6136 _codecmodules="opendivx $_codecmodules"
6137 _nocodecmodules="divx5linux $_nocodecmodules"
6138 echores "OpenDivX"
6139 elif test "$_xvidcompat" = yes ; then
6140 _opendivx=no
6141 _ld_decore=''
6142 _def_decore='#define NEW_DECORE 1'
6143 _def_divx='#define USE_DIVX 1'
6144 _def_divx5='#undef DECORE_DIVX5'
6145 _def_decore_xvid='#define DECORE_XVID 1'
6146 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6147 _nocodecmodules="opendivx divx5linux divx4linux $_nocodecmodules"
6148 echores "XviD compat."
6149 else
6150 _opendivx=no
6151 _ld_decore=''
6152 _def_decore='#undef NEW_DECORE'
6153 _def_divx='#undef USE_DIVX'
6154 _def_divx5='#undef DECORE_DIVX5'
6155 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6156 _nocodecmodules="opendivx $_nocodecmodules"
6157 echores "no"
6158 fi # DivX5 check
6162 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
6163 if test "$_mencoder" != no ; then
6165 echocheck "libmp3lame (for mencoder)"
6166 _mp3lame=no
6167 cat > $TMPC <<EOF
6168 #include <lame/lame.h>
6169 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; }
6171 # Note: libmp3lame usually depends on vorbis
6172 cc_check -lmp3lame $_ld_vorbis $_ld_lm && "$TMPO" >> "$TMPLOG" 2>&1 && _mp3lame=yes
6173 if test "$_mp3lame" = yes ; then
6174 _def_mp3lame="#define HAVE_MP3LAME `$TMPO`"
6175 _def_cfg_mp3lame="#define CONFIG_MP3LAME `$TMPO`"
6176 _ld_mp3lame="-lmp3lame $_ld_vorbis"
6177 else
6178 _def_mp3lame='#undef HAVE_MP3LAME'
6179 _def_cfg_mp3lame='#undef CONFIG_MP3LAME'
6181 echores "$_mp3lame"
6184 echocheck "DivX4linux encore (for mencoder)"
6185 cat > $TMPC << EOF
6186 #include <encore2.h>
6187 int main(void) { (void) encore(0, 0, 0, 0); return 0; }
6189 if test "$_divx4linux" != no && cc_check -ldivxencore $_ld_lm ; then
6190 _def_encore='#define HAVE_DIVX4ENCORE 1'
6191 _ld_encore='-ldivxencore'
6192 echores "DivX4linux (with libdivxencore.so)"
6193 elif test "$_xvidcompat" = yes ; then
6194 _def_encore='#define HAVE_DIVX4ENCORE 1'
6195 _ld_encore=''
6196 _def_encore_xvid='#define ENCORE_XVID 1'
6197 echores "XviD compat."
6198 else
6199 _def_encore='#undef HAVE_DIVX4ENCORE'
6200 echores "no"
6205 echocheck "mencoder"
6206 _mencoder_flag='#undef HAVE_MENCODER'
6207 if test "$_mencoder" = yes ; then
6208 _mencoder_flag='#define HAVE_MENCODER'
6210 echores "$_mencoder"
6212 echocheck "fastmemcpy"
6213 # fastmemcpy check is done earlier with tests of CPU & binutils features
6214 if test "$_fastmemcpy" = yes ; then
6215 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6216 else
6217 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6219 echores "$_fastmemcpy"
6221 echocheck "UniquE RAR File Library"
6222 if test "$_unrarlib" = yes ; then
6223 _def_unrarlib='#define USE_UNRARLIB 1'
6224 else
6225 _def_unrarlib='#undef USE_UNRARLIB'
6227 echores "$_unrarlib"
6229 echocheck "TV interface"
6230 if test "$_tv" = yes ; then
6231 _def_tv='#define USE_TV 1'
6232 _inputmodules="tv $_inputmodules"
6233 else
6234 _noinputmodules="tv $_noinputmodules"
6235 _def_tv='#undef USE_TV'
6237 echores "$_tv"
6239 echocheck "EDL support"
6240 if test "$_edl" = yes ; then
6241 _def_edl='#define USE_EDL'
6242 _inputmodules="edl $_inputmodules"
6243 else
6244 _noinputmodules="edl $_noinputmodules"
6245 _def_edl='#undef USE_EDL'
6247 echores "$_edl"
6249 echocheck "*BSD BrookTree 848 TV interface"
6250 if test "$_tv_bsdbt848" = auto ; then
6251 _tv_bsdbt848=no
6252 if test "$_tv" = yes ; then
6253 cat > $TMPC <<EOF
6254 #include <sys/types.h>
6255 #if defined(__NetBSD__)
6256 #include <dev/ic/bt8xx.h>
6257 #else
6258 #include <machine/ioctl_bt848.h>
6259 #endif
6260 int main(void) { return 0; }
6262 cc_check && _tv_bsdbt848=yes
6265 if test "$_tv_bsdbt848" = yes ; then
6266 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6267 _inputmodules="tv-bsdbt848 $_inputmodules"
6268 else
6269 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6270 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6272 echores "$_tv_bsdbt848"
6274 echocheck "Video 4 Linux TV interface"
6275 if test "$_tv_v4l" = auto ; then
6276 _tv_v4l=no
6277 if test "$_tv" = yes && linux ; then
6278 cat > $TMPC <<EOF
6279 #include <stdlib.h>
6280 #include <linux/videodev.h>
6281 int main(void) { return 0; }
6283 cc_check && _tv_v4l=yes
6284 break
6287 if test "$_tv_v4l" = yes ; then
6288 _def_tv_v4l='#define HAVE_TV_V4L 1'
6289 _inputmodules="tv-v4l $_inputmodules"
6290 else
6291 _noinputmodules="tv-v4l $_noinputmodules"
6292 _def_tv_v4l='#undef HAVE_TV_V4L'
6294 echores "$_tv_v4l"
6297 echocheck "Video 4 Linux 2 TV interface"
6298 if test "$_tv_v4l2" = auto ; then
6299 _tv_v4l2=no
6300 if test "$_tv" = yes && linux ; then
6301 cat > $TMPC <<EOF
6302 #include <stdlib.h>
6303 #include <linux/types.h>
6304 #include <linux/videodev2.h>
6305 int main(void) { return 0; }
6307 cc_check && _tv_v4l2=yes
6308 break
6311 if test "$_tv_v4l2" = yes ; then
6312 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6313 _inputmodules="tv-v4l2 $_inputmodules"
6314 else
6315 _noinputmodules="tv-v4l2 $_noinputmodules"
6316 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6318 echores "$_tv_v4l2"
6321 echocheck "audio select()"
6322 if test "$_select" = no ; then
6323 _def_select='#undef HAVE_AUDIO_SELECT'
6324 elif test "$_select" = yes ; then
6325 _def_select='#define HAVE_AUDIO_SELECT 1'
6327 echores "$_select"
6330 echocheck "network"
6331 # FIXME network check
6332 if test "$_network" != no ; then
6333 _def_network='#define MPLAYER_NETWORK 1'
6334 _ld_network="$_ld_sock"
6335 _inputmodules="network $_inputmodules"
6336 else
6337 _noinputmodules="network $_noinputmodules"
6338 _def_network='#undef MPLAYER_NETWORK'
6339 _ftp=no
6341 echores "$_network"
6343 echocheck "ftp"
6344 if not beos && test "$_ftp" != no ; then
6345 _def_ftp='#define HAVE_FTP 1'
6346 _inputmodules="ftp $_inputmodules"
6347 else
6348 _noinputmodules="ftp $_noinputmodules"
6349 _def_ftp='#undef HAVE_FTP'
6351 echores "$_ftp"
6353 echocheck "vstream client"
6354 if test "$_vstream" = auto ; then
6355 _vstream=no
6356 cat > $TMPC <<EOF
6357 #include <vstream-client.h>
6358 void vstream_error(const char *format, ... ) {}
6359 int main(void) { vstream_start(); return 0; }
6361 cc_check -lvstream-client && _vstream=yes
6363 if test "$_vstream" = yes ; then
6364 _def_vstream='#define HAVE_VSTREAM 1'
6365 _inputmodules="vstream $_inputmodules"
6366 _ld_vstream='-lvstream-client'
6367 else
6368 _noinputmodules="vstream $_noinputmodules"
6369 _def_vstream='#undef HAVE_VSTREAM'
6371 echores "$_vstream"
6373 # endian testing
6374 echocheck "byte order"
6375 if test "$_big_endian" = auto ; then
6376 cat > $TMPC <<EOF
6377 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6378 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6379 int main(){
6380 char* s = (char*)ascii_name;
6381 return 0;
6384 if cc_check ; then
6385 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6386 _big_endian=yes
6387 else
6388 _big_endian=no
6390 else
6391 echo -n "failed to autodetect byte order, defaulting to "
6394 if test "$_big_endian" = yes ; then
6395 _byte_order='big-endian'
6396 _def_words_endian='#define WORDS_BIGENDIAN 1'
6397 else
6398 _byte_order='little-endian'
6399 _def_words_endian='#undef WORDS_BIGENDIAN'
6401 echores "$_byte_order"
6403 echocheck "OSD menu"
6404 if test "$_menu" = yes ; then
6405 _def_menu='#define HAVE_MENU 1'
6406 else
6407 _def_menu='#undef HAVE_MENU'
6409 echores "$_menu"
6411 # Check to see if they want QTX codecs enabled
6412 echocheck "QTX codecs"
6413 if test "$_qtx" = auto ; then
6414 _qtx=$_win32
6416 if test "$_qtx" = yes ; then
6417 _def_qtx='#define USE_QTX_CODECS 1'
6418 _codecmodules="qtx $_codecmodules"
6419 else
6420 _def_qtx='#undef USE_QTX_CODECS'
6421 _nocodecmodules="qtx $_nocodecmodules"
6423 echores "$_qtx"
6426 echocheck "Subtitles sorting"
6427 if test "$_sortsub" = yes ; then
6428 _def_sortsub='#define USE_SORTSUB 1'
6429 else
6430 _def_sortsub='#undef USE_SORTSUB'
6432 echores "$_sortsub"
6435 echocheck "XMMS inputplugin support"
6436 if test "$_xmms" = yes ; then
6438 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6439 if test -z "$_xmmsplugindir" ; then
6440 _xmmsplugindir=`xmms-config --input-plugin-dir`
6442 if test -z "$_xmmslibdir" ; then
6443 _xmmslibdir=`xmms-config --exec-prefix`/lib
6445 else
6446 if test -z "$_xmmsplugindir" ; then
6447 _xmmsplugindir=/usr/lib/xmms/Input
6449 if test -z "$_xmmslibdir" ; then
6450 _xmmslibdir=/usr/lib
6454 _def_xmms='#define HAVE_XMMS 1'
6455 if darwin ; then
6456 _xmms_lib="${_xmmslibdir}/libxmms.dylib"
6457 else
6458 _xmms_lib="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6460 else
6461 _def_xmms='#undef HAVE_XMMS'
6463 echores "$_xmms"
6465 echocheck "inet6"
6466 if test "$_inet6" = auto ; then
6467 cat > $TMPC << EOF
6468 #include <sys/types.h>
6469 #include <sys/socket.h>
6470 int main(void) { socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6472 _inet6=no
6473 if cc_check ; then
6474 _inet6=yes
6477 if test "$_inet6" = yes ; then
6478 _def_inet6='#define HAVE_AF_INET6 1'
6479 else
6480 _def_inet6='#undef HAVE_AF_INET6'
6482 echores "$_inet6"
6485 echocheck "gethostbyname2"
6486 if test "$_gethostbyname2" = auto ; then
6487 cat > $TMPC << EOF
6488 #include <sys/types.h>
6489 #include <sys/socket.h>
6490 #include <netdb.h>
6491 int main(void) { gethostbyname2("", AF_INET); }
6493 _gethostbyname2=no
6494 if cc_check ; then
6495 _gethostbyname2=yes
6499 if test "$_gethostbyname2" = yes ; then
6500 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6501 else
6502 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6504 echores "$_gethostbyname2"
6506 # --------------- GUI specific tests begin -------------------
6507 echocheck "GUI"
6508 echo "$_gui"
6509 if test "$_gui" = yes ; then
6511 # Required libraries
6512 test "$_png" != yes && die "PNG support required for GUI compilation, please install libpng and libpng-dev packages."
6513 test "$_x11" != yes && die "X11 support required for GUI compilation"
6515 echocheck "XShape extension"
6516 _xshape=no
6517 if test "$_x11" = yes ; then
6518 cat > $TMPC << EOF
6519 #include <X11/Xlib.h>
6520 #include <X11/Xproto.h>
6521 #include <X11/Xutil.h>
6522 #include <X11/extensions/shape.h>
6523 #include <stdlib.h>
6524 int main(void) {
6525 char *name = ":0.0";
6526 Display *wsDisplay;
6527 int exitvar = 0;
6528 int eventbase, errorbase;
6529 if (getenv("DISPLAY"))
6530 name=getenv("DISPLAY");
6531 wsDisplay=XOpenDisplay(name);
6532 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6533 exitvar=1;
6534 XCloseDisplay(wsDisplay);
6535 return exitvar;
6538 cc_check $_inc_x11 $_ld_x11 && _xshape=yes
6540 if test "$_xshape" = yes ; then
6541 _def_xshape='#define HAVE_XSHAPE 1'
6542 else
6543 die "The GUI requires the X11 extension XShape (which was not found)."
6545 echores "$_xshape"
6547 #Check for GTK
6548 if test "$_gtk1" = no ; then
6549 #Check for GTK2 :
6550 echocheck "GTK+ version"
6552 if pkg-config gtk+-2.0 --exists ; then
6553 _gtk=`pkg-config gtk+-2.0 --modversion 2>/dev/null`
6554 _inc_gtk=`pkg-config gtk+-2.0 --cflags 2>/dev/null`
6555 _ld_gtk=`pkg-config gtk+-2.0 --libs 2>/dev/null`
6556 echores "$_gtk"
6558 # Check for GLIB2
6559 if pkg-config glib-2.0 --exists ; then
6560 echocheck "glib version"
6561 _glib=`pkg-config glib-2.0 --modversion 2>/dev/null`
6562 _inc_glib=`pkg-config glib-2.0 --cflags 2>/dev/null`
6563 _ld_glib=`pkg-config glib-2.0 --libs 2>/dev/null`
6564 echores "$_glib"
6566 _def_gui='#define HAVE_NEW_GUI 1'
6567 _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
6568 _ld_gui='$(GTKLIB) $(GLIBLIB)'
6569 else
6570 _gtk1=yes
6571 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
6573 else
6574 echo "GTK-2 devel packages were not found, trying GTK 1.2"
6575 _gtk1=yes
6579 if test "$_gtk1" = yes ; then
6580 # Check for old GTK (1.2.x)
6581 echocheck "GTK version"
6582 if test -z "$_gtkconfig" ; then
6583 if ( gtk-config --version ) >/dev/null 2>&1 ; then
6584 _gtkconfig="gtk-config"
6585 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
6586 _gtkconfig="gtk12-config"
6587 else
6588 die "The GUI requires GTK devel packages (which were not found)."
6591 _gtk=`$_gtkconfig --version 2>&1`
6592 _inc_gtk=`$_gtkconfig --cflags 2>&1`
6593 _ld_gtk=`$_gtkconfig --libs 2>&1`
6594 echores "$_gtk (using $_gtkconfig)"
6596 # Check for GLIB
6597 echocheck "glib version"
6598 if test -z "$_glibconfig" ; then
6599 if ( glib-config --version ) >/dev/null 2>&1 ; then
6600 _glibconfig="glib-config"
6601 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
6602 _glibconfig="glib12-config"
6603 else
6604 die "The GUI requires GLib devel packages (which were not found)"
6607 _glib=`$_glibconfig --version 2>&1`
6608 _inc_glib=`$_glibconfig --cflags 2>&1`
6609 _ld_glib=`$_glibconfig --libs 2>&1`
6610 echores "$_glib (using $_glibconfig)"
6612 _def_gui='#define HAVE_NEW_GUI 1'
6613 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
6614 _ld_gui='$(GTKLIB) $(GLIBLIB)'
6617 echo "Creating Gui/config.mak"
6618 cat > Gui/config.mak << EOF
6619 # -------- Generated by configure -----------
6621 GTKINC = $_inc_gtk
6622 GTKLIBS = $_ld_gtk
6623 GLIBINC = $_inc_glib
6624 GLIBLIBS = $_ld_glib
6628 else
6629 _def_gui='#undef HAVE_NEW_GUI'
6630 _def_gtk2_gui='#undef HAVE_GTK2_GUI'
6632 # --------------- GUI specific tests end -------------------
6636 #############################################################################
6638 # Checking for CFLAGS
6639 _stripbinaries=yes
6640 if test "$_profile" != "" || test "$_debug" != "" ; then
6641 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
6642 if test "$_cc_major" -ge "3" ; then
6643 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
6645 _stripbinaries=no
6646 elif test -z "$CFLAGS" ; then
6647 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
6648 # always compile with '-g' if .developer:
6649 if test -f ".developer" ; then
6650 CFLAGS="-g $CFLAGS"
6651 if test "$_crash_debug" = auto && not mingw32 ; then
6652 _crash_debug=yes
6654 _stripbinaries=no
6656 else
6657 _warn_CFLAGS=yes
6660 echocheck "automatic gdb attach"
6661 if test "$_crash_debug" = yes ; then
6662 _def_crash_debug='#define CRASH_DEBUG 1'
6663 else
6664 _def_crash_debug='#undef CRASH_DEBUG'
6665 _crash_debug=no
6667 echores "$_crash_debug"
6669 if darwin ; then
6670 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN"
6671 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
6672 CFLAGS="$CFLAGS -no-cpp-precomp"
6675 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
6676 test "$_altivec" = yes && CFLAGS="$CFLAGS -DCONFIG_DARWIN"
6678 if hpux ; then
6679 # use flag for HPUX missing setenv()
6680 CFLAGS="$CFLAGS -DHPUX"
6682 # Thread support
6683 if linux ; then
6684 CFLAGS="$CFLAGS -D_REENTRANT"
6685 elif bsd ; then
6686 # FIXME bsd needs this so maybe other OS'es
6687 CFLAGS="$CFLAGS -D_THREAD_SAFE"
6689 # 64 bit file offsets?
6690 if test "$_largefiles" = yes || freebsd ; then
6691 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
6692 if test "$_dvdread" = yes ; then
6693 # dvdread support requires this (for off64_t)
6694 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
6698 echocheck "compiler support for -fno-PIC"
6699 if x86; then
6700 cat > $TMPC <<EOF
6701 int main(void) { return 0; }
6703 if cc_check -fno-PIC ; then
6704 CFLAGS="-fno-PIC $CFLAGS"
6705 echores "yes"
6706 else
6707 echores "no"
6709 else
6710 echores "only used for x86"
6713 echocheck "compiler support for noexecstack"
6714 cat > $TMPC <<EOF
6715 int main(void) { return 0; }
6717 if cc_check -Wl,-z,noexecstack ; then
6718 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
6719 echores "yes"
6720 else
6721 echores "no"
6724 echocheck "ftello()"
6725 # if we don't have ftello use the osdep/ compatibility module
6726 cat > $TMPC << EOF
6727 #include <stdio.h>
6728 #include <sys/types.h>
6729 int main (void) { ftello(stdin); return 0; }
6731 _ftello=no
6732 cc_check && _ftello=yes
6733 if test "$_ftello" = yes ; then
6734 _def_ftello='#define HAVE_FTELLO 1'
6735 else
6736 _def_ftello='#undef HAVE_FTELLO'
6738 echores "$_ftello"
6740 # Determine OS dependent libs
6741 if cygwin ; then
6742 _def_confwin32='#define WIN32'
6743 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
6744 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
6745 CFLAGS="$CFLAGS -D__CYGWIN__"
6748 if win32 ; then
6749 _confwin32='TARGET_WIN32 = yes'
6750 else
6751 _confwin32='TARGET_WIN32 = no'
6754 # Dynamic linking flags
6755 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6756 _ld_dl_dynamic=''
6757 bsd && _ld_dl_dynamic='-rdynamic'
6758 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx ; then
6759 _ld_dl_dynamic='-rdynamic'
6762 _ld_arch="$_ld_arch $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6763 bsdos && _ld_arch="$_ld_arch -ldvd"
6764 if netbsd ; then
6765 x86 && _ld_arch="$_ld_arch -li386"
6768 _def_debug='#undef MP_DEBUG'
6769 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
6771 _def_linux='#undef TARGET_LINUX'
6772 linux && _def_linux='#define TARGET_LINUX 1'
6774 # TODO cleanup the VIDIX stuff here
6775 _def_vidix='#define CONFIG_VIDIX 1'
6776 test "$_vidix" = no && _def_vidix='#undef CONFIG_VIDIX'
6777 if test "$_vidix" = yes; then
6778 _vosrc="$_vosrc vo_cvidix.c"
6779 _vomodules="cvidix $_vomodules"
6780 else
6781 _novomodules="cvidix $_novomodules"
6783 if test "$_vidix" = yes && win32; then
6784 _vosrc="$_vosrc vo_winvidix.c"
6785 _vomodules="winvidix $_vomodules"
6786 _ld_win32libs="-lgdi32 $_ld_win32libs"
6787 else
6788 _novomodules="winvidix $_novomodules"
6790 if test "$_vidix" = yes && test "$_x11" = yes; then
6791 _vosrc="$_vosrc vo_xvidix.c"
6792 _vomodules="xvidix $_vomodules"
6793 else
6794 _novomodules="xvidix $_novomodules"
6796 echo Checking for VIDIX ... "$_vidix"
6798 _def_joystick='#undef HAVE_JOYSTICK'
6799 if test "$_joystick" = yes ; then
6800 if linux ; then
6801 # TODO add some check
6802 _def_joystick='#define HAVE_JOYSTICK 1'
6803 else
6804 _joystick="no (unsupported under $system_name)"
6807 echo Checking for joystick ... "$_joystick"
6809 echocheck "lirc"
6810 if test "$_lirc" = auto ; then
6811 _lirc=no
6812 if test -c /dev/lirc -o -c /dev/lirc/0 ; then
6813 cat > $TMPC <<EOF
6814 #include <lirc/lirc_client.h>
6815 int main(void) { return 0; }
6817 cc_check -llirc_client && _lirc=yes
6820 if test "$_lirc" = yes ; then
6821 _def_lirc='#define HAVE_LIRC 1'
6822 _ld_lirc='-llirc_client'
6823 else
6824 _def_lirc='#undef HAVE_LIRC'
6826 echores "$_lirc"
6828 echocheck "lircc"
6829 if test "$_lircc" = auto ; then
6830 _lircc=no
6831 cat > $TMPC <<EOF
6832 #include <lirc/lircc.h>
6833 int main(void) { return 0; }
6835 cc_check -llircc && _lircc=yes
6837 if test "$_lircc" = yes ; then
6838 _def_lircc='#define HAVE_LIRCC 1'
6839 _ld_lircc='-llircc'
6840 else
6841 _def_lircc='#undef HAVE_LIRCC'
6843 echores "$_lircc"
6845 #############################################################################
6846 echo "Creating config.mak"
6847 cat > config.mak << EOF
6848 # -------- Generated by configure -----------
6850 LANG = C
6851 MAN_LANG = $MAN_LANG
6852 TARGET_OS = $system_name
6853 DESTDIR =
6854 prefix = \$(DESTDIR)$_prefix
6855 BINDIR = \$(DESTDIR)$_bindir
6856 DATADIR = \$(DESTDIR)$_datadir
6857 MANDIR = \$(DESTDIR)$_mandir
6858 CONFDIR = \$(DESTDIR)$_confdir
6859 LIBDIR = \$(DESTDIR)$_libdir
6860 # FFmpeg uses libdir instead of LIBDIR
6861 libdir = \$(LIBDIR)
6862 #AR = ar
6863 CC = $_cc
6864 HOST_CC = $_host_cc
6865 AWK = $_awk
6866 RANLIB = $_ranlib
6867 INSTALL = $_install
6868 # OPTFLAGS = -O4 $_profile $_debug $_march $_mcpu $_pipe -fomit-frame-pointer -ffast-math
6869 EXTRA_INC = $_inc_extra
6870 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
6871 STRIPBINARIES = $_stripbinaries
6872 CHARSET = $_charset
6873 HELP_FILE = $_mp_help
6875 PRG = $_prg
6876 PRG_MENCODER = $_prg_mencoder
6878 $_live_libs_def
6880 MPLAYER_NETWORK = $_network
6881 STREAMING_LIVE555 = $_live
6882 MPLAYER_NETWORK_LIB = $_ld_live $_ld_vstream $_ld_network
6883 DVBIN = $_dvbin
6884 VIDIX = $_vidix
6885 CONFIG_PP = yes
6886 CONFIG_MP3LAME = $_mp3lame
6887 LIBMENU = $_menu
6888 I18NLIBS = $_i18n_libs
6889 MATROSKA = $_matroska_internal
6891 OPENDIVX = $_opendivx
6893 MP3LIB = $_mp3lib
6894 LIBA52 = $_liba52
6895 LIBMPEG2 = $_libmpeg2
6896 TREMOR = $_tremor_internal
6897 TREMOR_FLAGS = $_tremor_flags
6899 MUSEPACK = $_musepack
6901 UNRARLIB = $_unrarlib
6902 HAVE_FFPOSTPROCESS = $_def_haveffpostprocess
6903 PNG = $_mkf_png
6904 JPEG = $_mkf_jpg
6905 GIF = $_mkf_gif
6907 EXTRA_LIB = $_ld_extra
6908 Z_LIB = $_ld_static $_ld_zlib
6909 HAVE_MLIB = $_mlib
6910 WIN32_LIB = $_ld_win32libs
6911 STATIC_LIB = $_ld_static
6912 ENCA_LIB = $_ld_enca
6913 HAVE_PTHREADS = $_pthreads
6914 MATH_LIB = $_ld_lm
6916 X11_INC = $_inc_x11
6917 X11DIR = $_ld_x11
6919 HAVE_XVMC_ACCEL = $_xvmc
6921 # for libavcodec:
6922 SRC_PATH=..
6923 LIBPREF=lib
6924 LIBSUF=.a
6925 SLIBPREF=lib
6926 SLIBSUF=.so
6928 # video output
6929 X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
6930 GGI_LIB = $_ld_ggi
6931 MLIB_LIB = $_ld_mlib
6932 MLIB_INC = $_inc_mlib
6933 DXR2_INC = $_inc_dxr2
6934 DVB_INC = $_inc_dvb
6935 PNG_LIB = $_ld_png
6936 JPEG_LIB = $_ld_jpg
6937 GIF_LIB = $_ld_gif
6938 SDL_LIB = $_ld_sdl
6939 SVGA_LIB = $_ld_svga
6940 VESA_LIB = $_ld_vesa
6941 AA_LIB = $_ld_aa
6942 CACA_INC = $_inc_caca
6943 CACA_LIB = $_ld_caca
6945 # audio output
6946 ALSA_LIB = $_ld_alsa
6947 NAS_LIB = $_ld_nas
6948 ARTS_LIB = $_ld_arts
6949 ARTS_INC = $_inc_arts
6950 ESD_LIB = $_ld_esd
6951 ESD_INC = $_inc_esd
6952 POLYP_LIB = $_ld_polyp
6953 POLYP_INC = $_inc_polyp
6954 JACK_LIB = $_ld_jack
6955 JACK_INC = $_inc_jack
6956 SGIAUDIO_LIB = $_ld_sgiaudio
6958 # input/demuxer/codecs
6959 TERMCAP_LIB = $_ld_termcap
6960 LIRC_LIB = $_ld_lirc
6961 LIRCC_LIB = $_ld_lircc
6962 DVDREAD_LIB = $_ld_dvdread
6963 DVDKIT = $_dvdkit
6964 DVDKIT2 = $_dvdkit2
6965 DVDKIT_SHARED = no
6966 SDL_INC = $_inc_sdl
6967 W32_DEP = $_dep_win32
6968 W32_LIB = $_ld_win32
6969 DS_DEP = $_dep_dshow
6970 DS_LIB = $_ld_dshow
6971 AV_DEP = $_dep_libavutil $_dep_libavcodec $_dep_libavformat
6972 AV_LIB = $_ld_libavformat $_ld_libavcodec $_ld_libavutil
6973 CONFIG_LIBAVUTIL = $_libavutil
6974 CONFIG_LIBAVCODEC = $_libavcodec
6975 CONFIG_LIBAVCODECSO = $_libavcodecso
6976 CONFIG_LIBAVFORMAT = $_libavformat
6977 ZORAN = $_zr
6978 FAME = $_fame
6979 FAME_LIB = $_ld_fame
6980 MP1E_DEP = $_dep_mp1e
6981 MP1E_LIB = $_ld_mp1e
6982 ARCH_LIB = $_ld_arch $_ld_iconv
6983 XVID = $_xvid
6984 XVID_INC = $_inc_xvid
6985 XVID_LIB = $_ld_xvid
6986 X264 = $_x264
6987 X264_INC = $_inc_x264
6988 X264_LIB = $_ld_x264
6989 CONFIG_DTS = $_libdts
6990 DTS_INC = $_inc_libdts
6991 DTS_LIB = $_ld_libdts
6992 DECORE_LIB = $_ld_decore $_ld_mp3lame
6993 MENCODER = $_mencoder
6994 ENCORE_LIB = $_ld_encore $_ld_mp3lame
6995 DIRECTFB_INC = $_inc_directfb
6996 DIRECTFB_LIB = $_ld_directfb
6997 CDPARANOIA_INC = $_inc_cdparanoia
6998 CDPARANOIA_LIB = $_ld_cdparanoia
6999 FREETYPE_INC = $_inc_freetype
7000 FREETYPE_LIB = $_ld_freetype
7001 FONTCONFIG_INC = $_inc_fontconfig
7002 FONTCONFIG_LIB = $_ld_fontconfig
7003 FRIBIDI_INC = $_inc_fribidi
7004 FRIBIDI_LIB = $_ld_fribidi
7005 LIBLZO_LIB= $_ld_liblzo
7006 MAD_LIB = $_ld_mad
7007 VORBIS_LIB = $_ld_vorbis $_ld_libdv
7008 THEORA_LIB = $_ld_theora
7009 FAAD_LIB = $_ld_faad
7010 INTERNAL_FAAD = $_faad_internal
7011 SMBSUPPORT_LIB = $_ld_smb
7012 XMMS_PLUGINS = $_xmms
7013 XMMS_LIB = $_xmms_lib
7014 MACOSX = $_macosx
7015 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7016 MACOSX_BUNDLE = $_macosx_bundle
7017 MACOSX_FRAMEWORKS = $_macosx_frameworks
7018 MACOSX_COREVIDEO = $_macosx_corevideo
7019 TOOLAME=$_toolame
7020 TOOLAME_EXTRAFLAGS=$_toolame_extraflags
7021 TOOLAME_LIB=$_toolame_lib
7022 TWOLAME=$_twolame
7023 TWOLAME_LIB=$_twolame_lib
7024 MUSEPACK_LIB = $_ld_musepack
7025 FAAC=$_faac
7026 FAAC_LIB=$_ld_faac
7027 AMR_NB=$_amr_nb
7028 AMR_NB_FIXED=$_amr_nb_fixed
7029 AMR_WB=$_amr_wb
7030 `echo $_libavcodecs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7031 CONFIG_GPL=yes
7033 # --- Some stuff for autoconfigure ----
7034 $_target_arch
7035 $_confwin32
7036 TARGET_CPU=$iproc
7037 TARGET_MMX = $_mmx
7038 TARGET_MMX2 = $_mmx2
7039 TARGET_3DNOW = $_3dnow
7040 TARGET_3DNOWEX = $_3dnowex
7041 TARGET_SSE = $_sse
7042 TARGET_ALTIVEC = $_altivec
7043 TARGET_VIS = $_vis
7045 # --- GUI stuff ---
7046 GTKINC = $_inc_gtk
7047 GTKLIB = $_ld_static $_ld_gtk
7048 GLIBLIB = $_ld_static $_ld_glib
7049 GTK_LIBS = $_ld_static $_ld_gui
7050 GUI = $_gui
7051 DEBUG = -DDEBUG
7055 #############################################################################
7056 echo "Creating config.h"
7057 cat > config.h << EOF
7058 /* -------- This file has been automatically generated by configure ---------
7059 Note: Any changes in it will be lost when you run configure again. */
7061 /* Protect against multiple inclusion */
7062 #ifndef MPLAYER_CONFIG_H
7063 #define MPLAYER_CONFIG_H 1
7065 /* use GNU internationalization */
7066 $_def_i18n
7068 /* Runtime CPU detection */
7069 $_def_runtime_cpudetection
7071 /* Dynamic a/v plugins */
7072 $_def_dynamic_plugins
7074 /* "restrict" keyword */
7075 $_def_restrict_keyword
7077 /* __builtin_expect branch prediction hint */
7078 $_def_builtin_expect
7079 #ifdef HAVE_BUILTIN_EXPECT
7080 #define likely(x) __builtin_expect ((x) != 0, 1)
7081 #define unlikely(x) __builtin_expect ((x) != 0, 0)
7082 #else
7083 #define likely(x) (x)
7084 #define unlikely(x) (x)
7085 #endif
7087 /* attribute(used) as needed by some compilers */
7088 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7089 # define attribute_used __attribute__((used))
7090 #else
7091 # define attribute_used
7092 #endif
7094 #define PREFIX "$_prefix"
7096 #define USE_OSD 1
7097 #define USE_SUB 1
7099 /* enable/disable SIGHANDLER */
7100 $_def_sighandler
7102 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7103 $_def_crash_debug
7105 /* Toggles debugging informations */
7106 $_def_debug
7108 /* Toggles colorized output */
7109 //#define MSG_USE_COLORS 1
7111 /* Indicates that Ogle's libdvdread is available for DVD playback */
7112 $_def_dvdread
7114 /* Indicates that dvdread is from libmpdvdkit */
7115 $_def_mpdvdkit
7117 /* Additional options for libmpdvdkit*/
7118 $_def_dvd
7119 $_def_cdrom
7120 $_def_cdio
7121 $_def_dvdio
7122 $_def_bsdi_dvd
7123 $_def_dvd_bsd
7124 $_def_dvd_linux
7125 $_dev_dvd_openbsd
7126 $_def_dvd_darwin
7127 $_def_sol_scsi_h
7128 $_def_hpux_scsi_h
7129 $_def_stddef
7131 /* Common data directory (for fonts, etc) */
7132 #define MPLAYER_DATADIR "$_datadir"
7133 #define MPLAYER_CONFDIR "$_confdir"
7134 #define MPLAYER_LIBDIR "$_libdir"
7136 /* Define this to compile stream-caching support, it can be enabled via
7137 -cache <kilobytes> */
7138 #define USE_STREAM_CACHE 1
7140 /* Define to include support for XviD/Divx4Linux/OpenDivx */
7141 $_def_divx
7143 /* Define to use the new XviD/DivX4Linux library instead of open source OpenDivX */
7144 /* You have to change DECORE_LIBS in config.mak, too! */
7145 $_def_decore
7147 /* Define if you are using DivX5Linux Decore library */
7148 $_def_divx5
7150 /* Define if you are using XviD library */
7151 $_def_xvid3
7152 $_def_xvid4
7153 $_def_decore_xvid
7154 $_def_encore_xvid
7156 /* Define if you are using the X.264 library */
7157 $_def_x264
7159 /* Define to include support for libdv-0.9.5 */
7160 $_def_libdv
7162 /* If build mencoder */
7163 $_mencoder_flag
7165 /* Indicates if XviD/Divx4linux encore is available
7166 Note: for mencoder */
7167 $_def_encore
7169 /* Indicates if libmp3lame is available
7170 Note: for mencoder */
7171 $_def_mp3lame
7172 $_def_cfg_mp3lame
7174 /* Define libmp1e for realtime mpeg encoding (for DXR3 and DVB cards) */
7175 $_def_mp1e
7177 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7178 (use -bps or -nobps commandline option for run-time method selection)
7179 -bps gives better sync for vbr mp3 audio, it is now default */
7180 #define AVI_SYNC_BPS 1
7182 /* Undefine this if you do not want to select mono audio (left or right)
7183 with a stereo MPEG layer 2/3 audio stream. The command line option
7184 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7185 right-only), with 0 being the default.
7187 #define USE_FAKE_MONO 1
7189 /* Undefine this if your sound card driver has no working select().
7190 If you have kernel Oops, player hangups, or just no audio, you should
7191 try to recompile MPlayer with this option disabled! */
7192 $_def_select
7194 /* define this to use iconv(3) function to codepage conversions */
7195 $_def_iconv
7197 /* define this to use nl_langinfo function */
7198 $_def_langinfo
7200 /* define this to use RTC (/dev/rtc) for video timers */
7201 $_def_rtc
7203 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7204 #define MAX_OUTBURST 65536
7206 /* set up audio OUTBURST. Do not change this! */
7207 #define OUTBURST 512
7209 /* Define this if your system has the header file for the OSS sound interface */
7210 $_def_sys_soundcard
7212 /* Define this if your system has the header file for the OSS sound interface
7213 * in /usr/include */
7214 $_def_soundcard
7216 /* Define this if your system has the sysinfo header */
7217 $_def_sys_sysinfo
7219 /* Define this if your system has ftello() */
7221 $_def_ftello
7222 #ifndef HAVE_FTELLO
7223 /* Need these for FILE and off_t an config.h is usually before other includes*/
7224 #include <stdio.h>
7225 #include <sys/types.h>
7226 off_t ftello(FILE *);
7227 #endif
7229 /* Define this if your system has the "malloc.h" header file */
7230 $_def_malloc
7232 /* memalign is mapped to malloc if unsupported */
7233 $_def_memalign
7234 #ifndef HAVE_MEMALIGN
7235 # define memalign(a,b) malloc(b)
7236 #define MEMALIGN_HACK 1
7237 #endif
7239 /* Define this if your system has the "alloca.h" header file */
7240 $_def_alloca
7242 /* Define this if your system has the "sys/mman.h" header file */
7243 $_def_mman
7244 $_def_mman_has_map_failed
7246 /* Define this if you have the elf dynamic linker -ldl library */
7247 $_def_dl
7249 /* Define this if you have the kstat kernel statistics library */
7250 $_def_kstat
7252 /* Define this if you have zlib */
7253 $_def_zlib
7254 #ifdef HAVE_ZLIB
7255 #define CONFIG_ZLIB 1
7256 #endif
7258 /* Define this if you have shm support */
7259 $_def_shm
7261 /* Define this if your system has scandir & alphasort */
7262 $_def_scandir
7264 /* Define this if your system has strsep */
7265 $_def_strsep
7267 /* Define this if your system has strlcpy */
7268 $_def_strlcpy
7269 #ifndef HAVE_STRLCPY
7270 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7271 #endif
7273 /* Define this if your system has strlcat */
7274 $_def_strlcat
7275 #ifndef HAVE_STRLCAT
7276 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7277 #endif
7279 /* Define this if your system has fseeko */
7280 $_def_fseeko
7281 #ifndef HAVE_FSEEKO
7282 /* Need these for FILE and off_t an config.h is usually before other includes*/
7283 #include <stdio.h>
7284 #include <sys/types.h>
7285 int fseeko(FILE *, off_t, int);
7286 #endif
7288 $_def_localtime_r
7290 /* Define this if your system has vsscanf */
7291 $_def_vsscanf
7293 /* Define this if your system has swab */
7294 $_def_swab
7296 /* Define this if your system has no posix select */
7297 $_def_no_posix_select
7299 /* Define this if your system has gettimeofday */
7300 $_def_gettimeofday
7302 /* Define this if your system has glob */
7303 $_def_glob
7305 /* Define this if your system has pthreads */
7306 $_def_pthreads
7308 /* Define this if you enabled thread support for libavcodec */
7309 $_def_threads
7311 /* LIRC (remote control, see www.lirc.org) support: */
7312 $_def_lirc
7315 * LIRCCD (LIRC client daemon)
7316 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7318 $_def_lircc
7320 /* DVD navigation support using libdvdnav */
7321 $_def_dvdnav
7322 $_def_dvdnav_version
7324 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7325 #define MPEG12_POSTPROC 1
7327 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7328 $_def_ffpostprocess
7330 /* Define to include support for OpenDivx postprocessing */
7331 $_def_odivx_postprocess
7333 /* Win32 DLL support */
7334 $_def_win32
7335 #define WIN32_PATH "$_win32libdir"
7337 /* DirectShow support */
7338 $_def_dshow
7340 /* Mac OS X specific features */
7341 $_def_macosx
7342 $_def_macosx_finder_support
7343 $_def_macosx_bundle
7344 $_def_macosx_corevideo
7346 /* Build our Win32-loader */
7347 $_def_win32_loader
7349 /* ffmpeg's libavcodec support (requires libavcodec source) */
7350 $_def_libavcodec
7351 $_def_libavcodecso
7353 /* ffmpeg's libavformat support (requires libavformat source) */
7354 $_def_libavformat
7355 $_def_libavformat_win32
7357 /* Use libavcodec's decoders */
7358 #define CONFIG_DECODERS 1
7359 /* Use libavcodec's encoders */
7360 #define CONFIG_ENCODERS 1
7362 /* Use libavformat's demuxers */
7363 #define CONFIG_DEMUXERS 1
7364 /* Use libavformat's muxers */
7365 #define CONFIG_MUXERS 1
7367 #define CONFIG_MPEGAUDIO_HP 1
7369 #define CONFIG_GPL 1
7371 /* Use amr codecs from libavcodec (requires amr sources) */
7372 $_def_amr_nb
7373 $_def_amr_nb_fixed
7374 $_def_amr_wb
7376 /* Use specific codecs from libavcodec */
7377 `echo $_libavcodecs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7379 /* Use codec libs included in mplayer CVS / source dist: */
7380 $_def_mp3lib
7381 $_def_liba52
7382 $_def_libdts
7383 $_def_libmpeg2
7385 /* Use libfame encoder filter */
7386 $_def_fame
7388 /* XAnim DLL support */
7389 $_def_xanim
7390 /* Default search path */
7391 $_def_xanim_path
7393 /* RealPlayer DLL support */
7394 $_def_real
7395 /* Default search path */
7396 $_def_real_path
7398 /* LIVE555 Streaming Media library support */
7399 $_def_live
7401 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
7402 $_def_fastmemcpy
7404 /* Use unrarlib for Vobsubs */
7405 $_def_unrarlib
7407 /* gui support, please do not edit this option */
7408 $_def_gui
7409 $_def_gtk2_gui
7411 /* Audio output drivers */
7412 $_def_ossaudio
7413 $_def_ossaudio_devdsp
7414 $_def_ossaudio_devmixer
7415 $_def_alsa5
7416 $_def_alsa9
7417 $_def_alsa1x
7418 $_def_arts
7419 $_def_esd
7420 $_def_esd_latency
7421 $_def_polyp
7422 $_def_jack
7423 $_def_sys_asoundlib_h
7424 $_def_alsa_asoundlib_h
7425 $_def_sunaudio
7426 $_def_sgiaudio
7427 $_def_win32waveout
7428 $_def_nas
7430 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7431 #undef FAST_OSD
7432 #undef FAST_OSD_TABLE
7434 /* Enable TV Interface support */
7435 $_def_tv
7437 /* Enable EDL support */
7438 $_def_edl
7440 /* Enable Video 4 Linux TV interface support */
7441 $_def_tv_v4l
7443 /* Enable Video 4 Linux 2 TV interface support */
7444 $_def_tv_v4l2
7446 /* Enable *BSD BrookTree TV interface support */
7447 $_def_tv_bsdbt848
7449 /* Define if your processor stores words with the most significant
7450 byte first (like Motorola and SPARC, unlike Intel and VAX). */
7451 $_def_words_endian
7453 $_def_arch
7455 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
7456 have the instruction. */
7457 $_def_dcbzl
7459 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
7460 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
7462 #ifdef ARCH_POWERPC
7463 #define ARCH_PPC 1
7464 #endif
7466 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
7467 #ifdef ARCH_ARMV4L
7468 #define ARCH_ARM 1
7469 #endif
7471 /* only gcc3 can compile mvi instructions */
7472 $_def_gcc_mvi_support
7474 /* Define this for Cygwin build for win32 */
7475 $_def_confwin32
7477 /* Define this to any prefered value from 386 up to infinity with step 100 */
7478 #define __CPU__ $iproc
7480 $_mp_wordsize
7482 $_def_linux
7484 $_def_vcd
7486 #ifdef sun
7487 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
7488 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7489 #elif defined(HPUX)
7490 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7491 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7492 #elif defined(WIN32)
7493 #define DEFAULT_CDROM_DEVICE "D:"
7494 #define DEFAULT_DVD_DEVICE "D:"
7495 #elif defined(SYS_DARWIN)
7496 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
7497 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
7498 #elif defined(__OpenBSD__)
7499 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
7500 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7501 #elif defined(__FreeBSD__)
7502 #define DEFAULT_CDROM_DEVICE "/dev/acd0"
7503 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7504 #else
7505 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7506 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7507 #endif
7510 /*----------------------------------------------------------------------------
7512 ** NOTE: Instead of modifying these definitions here, use the
7513 ** --enable/--disable options of the ./configure script!
7514 ** See ./configure --help for details.
7516 *---------------------------------------------------------------------------*/
7518 /* C99 lrintf function available */
7519 $_def_lrintf
7521 /* round function is available */
7522 $_def_round
7524 /* yes, we have inttypes.h */
7525 #define HAVE_INTTYPES_H 1
7527 /* int_fastXY_t emulation */
7528 $_def_fast_inttypes
7530 /* nanosleep support */
7531 $_def_nanosleep
7533 /* SMB support */
7534 $_def_smbsupport
7536 /* termcap flag for getch2.c */
7537 $_def_termcap
7539 /* termios flag for getch2.c */
7540 $_def_termios
7541 $_def_termios_h
7542 $_def_termios_sys_h
7544 /* enable PNG support */
7545 $_def_png
7547 /* enable JPEG support */
7548 $_def_jpg
7550 /* enable PNM support */
7551 $_def_pnm
7553 /* enable md5sum support */
7554 $_def_md5sum
7556 /* enable GIF support */
7557 $_def_gif
7558 $_def_gif_4
7559 $_def_gif_tvt_hack
7561 /* enable FreeType support */
7562 $_def_freetype
7564 /* enable Fontconfig support */
7565 $_def_fontconfig
7567 /* enable FriBiDi usage */
7568 $_def_fribidi
7570 /* enable ENCA usage */
7571 $_def_enca
7573 /* liblzo support */
7574 $_def_liblzo
7576 /* libmad support */
7577 $_def_mad
7579 /* enable OggVorbis support */
7580 $_def_vorbis
7582 /* enable Tremor as vorbis decoder */
7583 $_def_tremor
7585 /* enable musepack support */
7586 $_def_musepack
7588 /* enable OggTheora support */
7589 $_def_theora
7591 /* enable Matroska support */
7592 $_def_matroska
7594 /* enable FAAD (AAC) support */
7595 $_def_faad
7596 $_def_faad_internal
7598 /* enable FAAC (AAC encoder) support */
7599 $_def_faac
7601 /* enable LADSPA plugin support */
7602 $_def_ladspa
7604 /* enable network */
7605 $_def_network
7607 /* enable ftp support */
7608 $_def_ftp
7610 /* enable vstream support */
7611 $_def_vstream
7613 /* enable winsock2 instead of Unix functions*/
7614 $_def_winsock2
7616 /* define this to use inet_aton() instead of inet_pton() */
7617 $_def_use_aton
7619 /* enables / disables cdparanoia support */
7620 $_def_cdparanoia
7622 /* enables / disables VIDIX usage */
7623 $_def_vidix
7625 /* enables / disables new input joystick support */
7626 $_def_joystick
7628 /* enables / disables QTX codecs */
7629 $_def_qtx
7631 /* enables / disables osd menu */
7632 $_def_menu
7634 /* enables / disables subtitles sorting */
7635 $_def_sortsub
7637 /* XMMS input plugin support */
7638 $_def_xmms
7639 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7641 /* enables inet6 support */
7642 $_def_inet6
7644 /* do we have gethostbyname2? */
7645 $_def_gethostbyname2
7647 /* Extension defines */
7648 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
7649 $_def_3dnowex // only define if you have 3DNOWEX (AMD Athlon, etc.)
7650 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
7651 $_def_mmx2 // only define if you have MMX2 (Athlon/PIII/4/CelII)
7652 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
7653 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
7654 $_def_altivec // only define if you have Altivec (G4)
7656 $_def_altivec_h // enables usage of altivec.h
7659 $_def_mlib // Sun mediaLib, available only on solaris
7660 $_def_vis // only define if you have VIS ( ultrasparc )
7662 /* libmpeg2 uses a different feature test macro for mediaLib */
7663 #ifdef HAVE_MLIB
7664 #define LIBMPEG2_MLIB 1
7665 #endif
7667 /* libvo options */
7668 #define SCREEN_SIZE_X 1
7669 #define SCREEN_SIZE_Y 1
7670 $_def_x11
7671 $_def_xv
7672 $_def_xvmc
7673 $_def_vm
7674 $_def_xf86keysym
7675 $_def_xinerama
7676 $_def_gl
7677 $_def_gl_win32
7678 $_def_dga
7679 $_def_dga2
7680 $_def_sdl
7681 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
7682 $_def_sdlbuggy
7683 $_def_directx
7684 $_def_ggi
7685 $_def_ggiwmh
7686 $_def_3dfx
7687 $_def_tdfxfb
7688 $_def_tdfxvid
7689 $_def_directfb
7690 $_def_directfb_version
7691 $_def_zr
7692 $_def_bl
7693 $_def_mga
7694 $_def_xmga
7695 $_def_syncfb
7696 $_def_fbdev
7697 $_def_dxr2
7698 $_def_dxr3
7699 $_def_dvb
7700 $_def_dvb_in
7701 $_def_svga
7702 $_def_vesa
7703 $_def_xdpms
7704 $_def_aa
7705 $_def_caca
7706 $_def_tga
7707 $_def_toolame
7708 $_def_twolame
7710 /* used by GUI: */
7711 $_def_xshape
7713 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
7714 #define X11_FULLSCREEN 1
7715 #endif
7717 #endif /* MPLAYER_CONFIG_H */
7720 #############################################################################
7722 echo "Creating libvo/config.mak"
7723 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g;s/\.m/\.o/g'`
7724 cat > libvo/config.mak << EOF
7725 include ../config.mak
7726 OPTIONAL_SRCS = $_vosrc
7727 OPTIONAL_OBJS = $_voobj
7730 #############################################################################
7732 echo "Creating libao2/config.mak"
7733 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'`
7734 cat > libao2/config.mak << EOF
7735 include ../config.mak
7736 OPTIONAL_SRCS = $_aosrc
7737 OPTIONAL_OBJS = $_aoobj
7740 #############################################################################
7742 echo "Creating libaf/config.mak"
7743 _afobj=`echo $_afsrc | sed -e 's/\.c/\.o/g'`
7744 cat > libaf/config.mak << EOF
7745 include ../config.mak
7746 OPTIONAL_SRCS = $_afsrc
7747 OPTIONAL_OBJS = $_afobj
7750 #############################################################################
7752 cat << EOF
7754 Config files successfully generated by ./configure !
7756 Install prefix: $_prefix
7757 Data directory: $_datadir
7758 Config direct.: $_confdir
7760 Byte order: $_byte_order
7761 Optimizing for: $_optimizing
7763 Languages:
7764 Messages/GUI: $_language
7767 echo -n " Manual pages: $MAN_LANG"
7768 test "$LANGUAGES" = en && echo -n " (no localization selected, use --language=all)"
7769 echo
7771 cat << EOF
7773 Enabled optional drivers:
7774 Input: $_inputmodules
7775 Codecs: $_codecmodules
7776 Audio output: $_aomodules
7777 Video output: $_vomodules
7778 Audio filters: $_afmodules
7779 Disabled optional drivers:
7780 Input: $_noinputmodules
7781 Codecs: $_nocodecmodules
7782 Audio output: $_noaomodules
7783 Video output: $_novomodules
7784 Audio filters: $_noafmodules
7786 'config.h' and 'config.mak' contain your configuration options.
7787 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7788 compile *** DO NOT REPORT BUGS if you tweak these files ***
7790 'make' will now compile MPlayer and 'make install' will install it.
7791 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7796 if test "$_mtrr" = yes ; then
7797 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
7798 echo
7801 if test "$_sdl" = "outdated" ; then
7802 cat <<EOF
7803 You have an outdated version of libSDL installed (older than v1.1.7) and SDL
7804 support has therefore been disabled.
7806 Please upgrade to a more recent version (version 1.1.8 and above are known to
7807 work). You may get this library from: http://www.libsdl.org
7809 You need to rerun ./configure and recompile after updating SDL. If you are
7810 only interested in the libSDL audio drivers, then an older version might work.
7812 Use --enable-sdl to force usage of libSDL.
7817 if x86; then
7818 if test "$_win32" = no ; then
7819 if test "$_win32libdir" ; then
7820 echo "Failed to find a Win32 codecs dir at $_win32libdir!"
7821 else
7822 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
7824 cat << EOF
7825 Create it and copy the DLL files there! You can download the codecs from our
7826 homepage at http://www.mplayerhq.hu/MPlayer/releases/codecs/
7830 else
7831 cat <<EOF
7832 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7833 operating system ($system_name). You may encounter a few files that cannot
7834 be played due to missing open source video/audio codec support.
7840 cat <<EOF
7842 Check $TMPLOG if you wonder why an autodetection failed (check whether
7843 the development headers/packages are installed).
7844 Do not report compilation errors if you used any of the --enable-* options
7845 (except --enable-gui and maybe --enable-debug).
7847 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
7851 if test "$_vidix" = no ; then
7852 cat <<EOF
7853 You've disabled VIDIX. Although it would be better to PORT it instead.
7854 Have a look at the documentation for supported cards!
7859 if test "$_warn_CFLAGS" = yes; then
7860 cat <<EOF
7862 MPlayer compilation will use the CFLAGS set by you, but:
7864 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
7866 It is strongly recommended to let MPlayer choose the correct CFLAGS!
7867 To do so, execute 'CFLAGS= ./configure <options>'
7872 # Last move:
7873 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"